From 80a9b084f2f1a6df9d38364b8c77d65deab3e079 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Tue, 12 Oct 2021 15:01:28 +0200 Subject: [PATCH] Built motion from commit 5413e8d1.|2.5.36 --- 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/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/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 +- 1152 files changed, 1152 insertions(+), 1152 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 657b39b..011388f 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-12T12:28:36.910Z", + "time": "2021-10-12T12:52:12.343Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 5908c1d..1faffac 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-12T12:28:36.910Z", + "time": "2021-10-12T12:52:12.343Z", "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 ae532db..8690e6c 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 _0x4dba=['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)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','integration','motionbar','urlForward','browser','bot'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4dba,0x15f));var _0xa4db=function(_0x9c5aae,_0x29f57b){_0x9c5aae=_0x9c5aae-0x0;var _0x4fa511=_0x4dba[_0x9c5aae];return _0x4fa511;};'use strict';var Sequelize=require(_0xa4db('0x0'));module[_0xa4db('0x1')]={'name':{'type':Sequelize[_0xa4db('0x2')],'get':function(_0x5b2ed3){return this[_0xa4db('0x3')](_0xa4db('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa4db('0x5'),_0xa4db('0x6'),'jscripty',_0xa4db('0x7'),_0xa4db('0x8'),_0xa4db('0x9'),'script']],'msg':_0xa4db('0xa')}},'comment':_0xa4db('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xa4db('0xb')},'data2':{'type':Sequelize[_0xa4db('0xc')](0x1000),'comment':_0xa4db('0xd')},'data3':{'type':Sequelize[_0xa4db('0xc')](0x1000),'comment':_0xa4db('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xa4db('0xf')},'data5':{'type':Sequelize[_0xa4db('0xc')](0x1000),'comments':_0xa4db('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0xa4db('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xa4db('0x12')}}; \ No newline at end of file +var _0x7beb=['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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x30c474,_0x1d5583){var _0xf46f28=function(_0x4e45da){while(--_0x4e45da){_0x30c474['push'](_0x30c474['shift']());}};_0xf46f28(++_0x1d5583);}(_0x7beb,0xc5));var _0xb7be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7beb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb7be('0x0')],'get':function(_0x28e5d0){return this[_0xb7be('0x1')](_0xb7be('0x2'));}},'action':{'type':Sequelize[_0xb7be('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb7be('0x4'),_0xb7be('0x5'),_0xb7be('0x6'),_0xb7be('0x7'),_0xb7be('0x8'),_0xb7be('0x9'),_0xb7be('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb7be('0xb')},'data1':{'type':Sequelize[_0xb7be('0x3')](0x1000),'comment':_0xb7be('0xc')},'data2':{'type':Sequelize[_0xb7be('0x3')](0x1000),'comment':_0xb7be('0xd')},'data3':{'type':Sequelize[_0xb7be('0x3')](0x1000),'comment':_0xb7be('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xb7be('0xf')},'data5':{'type':Sequelize[_0xb7be('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xb7be('0x3')],'comments':_0xb7be('0x10')},'data7':{'type':Sequelize[_0xb7be('0x11')],'comments':_0xb7be('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 51174f3..837594c 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 _0x6aae=['../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5e00dd,_0x468cfd){var _0x30998c=function(_0x5ec0b8){while(--_0x5ec0b8){_0x5e00dd['push'](_0x5e00dd['shift']());}};_0x30998c(++_0x468cfd);}(_0x6aae,0x139));var _0xe6aa=function(_0x298c5c,_0x24092f){_0x298c5c=_0x298c5c-0x0;var _0x1f0500=_0x6aae[_0x298c5c];return _0x1f0500;};'use strict';var emlformat=require(_0xe6aa('0x0'));var rimraf=require(_0xe6aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe6aa('0x2'));var moment=require(_0xe6aa('0x3'));var BPromise=require(_0xe6aa('0x4'));var Mustache=require(_0xe6aa('0x5'));var util=require(_0xe6aa('0x6'));var path=require(_0xe6aa('0x7'));var sox=require(_0xe6aa('0x8'));var csv=require(_0xe6aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6aa('0xa'));var squel=require(_0xe6aa('0xb'));var crypto=require(_0xe6aa('0xc'));var jsforce=require(_0xe6aa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6aa('0xe'));var Papa=require(_0xe6aa('0xf'));var Redis=require(_0xe6aa('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe6aa('0x11'));var hardwareService=require(_0xe6aa('0x12'));var logger=require(_0xe6aa('0x13'))(_0xe6aa('0x14'));var utils=require(_0xe6aa('0x15'));var config=require(_0xe6aa('0x16'));var licenseUtil=require(_0xe6aa('0x17'));var db=require(_0xe6aa('0x18'))['db'];function respondWithStatusCode(_0x17dd81,_0x1b6b97){_0x1b6b97=_0x1b6b97||0xcc;return function(_0x84bcc6){if(_0x84bcc6){return _0x17dd81['sendStatus'](_0x1b6b97);}return _0x17dd81[_0xe6aa('0x19')](_0x1b6b97)['end']();};}function respondWithResult(_0x15c4ed,_0x46d592){_0x46d592=_0x46d592||0xc8;return function(_0x102e44){if(_0x102e44){return _0x15c4ed[_0xe6aa('0x19')](_0x46d592)[_0xe6aa('0x1a')](_0x102e44);}};}function respondWithFilteredResult(_0x1bc5e1,_0x1f8ff1){return function(_0x1f224e){if(_0x1f224e){var _0x5bd3db=typeof _0x1f8ff1['offset']===_0xe6aa('0x1b')&&typeof _0x1f8ff1[_0xe6aa('0x1c')]===_0xe6aa('0x1b');var _0x125f12=_0x1f224e[_0xe6aa('0x1d')];var _0x3a14a5=_0x5bd3db?0x0:_0x1f8ff1[_0xe6aa('0x1e')];var _0x31b6af=_0x5bd3db?_0x1f224e[_0xe6aa('0x1d')]:_0x1f8ff1[_0xe6aa('0x1e')]+_0x1f8ff1['limit'];var _0x50b25a;if(_0x31b6af>=_0x125f12){_0x31b6af=_0x125f12;_0x50b25a=0xc8;}else{_0x50b25a=0xce;}_0x1bc5e1[_0xe6aa('0x19')](_0x50b25a);return _0x1bc5e1[_0xe6aa('0x1f')]('Content-Range',_0x3a14a5+'-'+_0x31b6af+'/'+_0x125f12)[_0xe6aa('0x1a')](_0x1f224e);}return null;};}function patchUpdates(_0x4316e1){return function(_0x462693){try{jsonpatch[_0xe6aa('0x20')](_0x462693,_0x4316e1,!![]);}catch(_0x5e5ded){return BPromise[_0xe6aa('0x21')](_0x5e5ded);}return _0x462693[_0xe6aa('0x22')]();};}function saveUpdates(_0x22259e,_0x12a855){return function(_0x58390f){if(_0x58390f){return _0x58390f[_0xe6aa('0x23')](_0x22259e)['then'](function(_0x538db7){return _0x538db7;});}return null;};}function removeEntity(_0x152580,_0x5dd397){return function(_0x4be44){if(_0x4be44){return _0x4be44[_0xe6aa('0x24')]()[_0xe6aa('0x25')](function(){_0x152580[_0xe6aa('0x19')](0xcc)[_0xe6aa('0x26')]();});}};}function handleEntityNotFound(_0x31a1d8,_0xd35628){return function(_0x41e771){if(!_0x41e771){_0x31a1d8['sendStatus'](0x194);}return _0x41e771;};}function handleError(_0x57afb2,_0xfd43b0){_0xfd43b0=_0xfd43b0||0x1f4;return function(_0x301ac2){logger[_0xe6aa('0x27')](_0x301ac2[_0xe6aa('0x28')]);if(_0x301ac2[_0xe6aa('0x29')]){delete _0x301ac2[_0xe6aa('0x29')];}_0x57afb2[_0xe6aa('0x19')](_0xfd43b0)[_0xe6aa('0x2a')](_0x301ac2);};}exports[_0xe6aa('0x23')]=function(_0x3695b5,_0x38c092){if(_0x3695b5[_0xe6aa('0x2b')]['id']){delete _0x3695b5[_0xe6aa('0x2b')]['id'];}return db[_0xe6aa('0x2c')]['find']({'where':{'id':_0x3695b5[_0xe6aa('0x2d')]['id']}})[_0xe6aa('0x25')](handleEntityNotFound(_0x38c092,null))[_0xe6aa('0x25')](saveUpdates(_0x3695b5['body'],null))[_0xe6aa('0x25')](respondWithResult(_0x38c092,null))[_0xe6aa('0x2e')](handleError(_0x38c092,null));};exports[_0xe6aa('0x24')]=function(_0x36148e,_0x1b71c1){return db[_0xe6aa('0x2c')][_0xe6aa('0x2f')]({'where':{'id':_0x36148e[_0xe6aa('0x2d')]['id']}})[_0xe6aa('0x25')](handleEntityNotFound(_0x1b71c1,null))[_0xe6aa('0x25')](removeEntity(_0x1b71c1,null))[_0xe6aa('0x2e')](handleError(_0x1b71c1,null));}; \ No newline at end of file +var _0x520d=['Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','status','sendStatus','stack','name','update','body'];(function(_0x520523,_0x468f1){var _0x1e6742=function(_0x53368a){while(--_0x53368a){_0x520523['push'](_0x520523['shift']());}};_0x1e6742(++_0x468f1);}(_0x520d,0x14b));var _0xd520=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x520d[_0x420513];return _0x1b44ec;};'use strict';var emlformat=require(_0xd520('0x0'));var rimraf=require(_0xd520('0x1'));var zipdir=require(_0xd520('0x2'));var jsonpatch=require(_0xd520('0x3'));var rp=require(_0xd520('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd520('0x5'));var util=require(_0xd520('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd520('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd520('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd520('0x9'));var deskjs=require(_0xd520('0xa'));var toCsv=require(_0xd520('0xb'));var querystring=require('querystring');var Papa=require(_0xd520('0xc'));var Redis=require(_0xd520('0xd'));var authService=require(_0xd520('0xe'));var qs=require(_0xd520('0xf'));var as=require(_0xd520('0x10'));var hardwareService=require(_0xd520('0x11'));var logger=require(_0xd520('0x12'))(_0xd520('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd520('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a377c,_0x588013){_0x588013=_0x588013||0xcc;return function(_0x5b2561){if(_0x5b2561){return _0x4a377c['sendStatus'](_0x588013);}return _0x4a377c['status'](_0x588013)[_0xd520('0x15')]();};}function respondWithResult(_0xbfa2a5,_0x33f0b9){_0x33f0b9=_0x33f0b9||0xc8;return function(_0x55e60e){if(_0x55e60e){return _0xbfa2a5['status'](_0x33f0b9)[_0xd520('0x16')](_0x55e60e);}};}function respondWithFilteredResult(_0x135540,_0xb87912){return function(_0x2d20c1){if(_0x2d20c1){var _0x5c1a40=typeof _0xb87912[_0xd520('0x17')]===_0xd520('0x18')&&typeof _0xb87912[_0xd520('0x19')]===_0xd520('0x18');var _0xff88b5=_0x2d20c1['count'];var _0x32ac35=_0x5c1a40?0x0:_0xb87912[_0xd520('0x17')];var _0x37a687=_0x5c1a40?_0x2d20c1[_0xd520('0x1a')]:_0xb87912[_0xd520('0x17')]+_0xb87912['limit'];var _0x17a79e;if(_0x37a687>=_0xff88b5){_0x37a687=_0xff88b5;_0x17a79e=0xc8;}else{_0x17a79e=0xce;}_0x135540['status'](_0x17a79e);return _0x135540[_0xd520('0x1b')](_0xd520('0x1c'),_0x32ac35+'-'+_0x37a687+'/'+_0xff88b5)[_0xd520('0x16')](_0x2d20c1);}return null;};}function patchUpdates(_0x2f9029){return function(_0x4bd98d){try{jsonpatch['apply'](_0x4bd98d,_0x2f9029,!![]);}catch(_0x546dfc){return BPromise['reject'](_0x546dfc);}return _0x4bd98d[_0xd520('0x1d')]();};}function saveUpdates(_0x3c7ef6,_0x243593){return function(_0x3bece1){if(_0x3bece1){return _0x3bece1['update'](_0x3c7ef6)[_0xd520('0x1e')](function(_0x193719){return _0x193719;});}return null;};}function removeEntity(_0x200737,_0x5e1a40){return function(_0x1ce8f7){if(_0x1ce8f7){return _0x1ce8f7[_0xd520('0x1f')]()[_0xd520('0x1e')](function(){_0x200737[_0xd520('0x20')](0xcc)[_0xd520('0x15')]();});}};}function handleEntityNotFound(_0x51d59c,_0x21ecd7){return function(_0x506cc1){if(!_0x506cc1){_0x51d59c[_0xd520('0x21')](0x194);}return _0x506cc1;};}function handleError(_0x391c88,_0x362aba){_0x362aba=_0x362aba||0x1f4;return function(_0x4624ff){logger['error'](_0x4624ff[_0xd520('0x22')]);if(_0x4624ff[_0xd520('0x23')]){delete _0x4624ff[_0xd520('0x23')];}_0x391c88[_0xd520('0x20')](_0x362aba)['send'](_0x4624ff);};}exports[_0xd520('0x24')]=function(_0x2897bf,_0x3b5122){if(_0x2897bf[_0xd520('0x25')]['id']){delete _0x2897bf[_0xd520('0x25')]['id'];}return db[_0xd520('0x26')][_0xd520('0x27')]({'where':{'id':_0x2897bf['params']['id']}})[_0xd520('0x1e')](handleEntityNotFound(_0x3b5122,null))['then'](saveUpdates(_0x2897bf[_0xd520('0x25')],null))[_0xd520('0x1e')](respondWithResult(_0x3b5122,null))['catch'](handleError(_0x3b5122,null));};exports[_0xd520('0x1f')]=function(_0x3d8ee0,_0x1e6b95){return db[_0xd520('0x26')][_0xd520('0x27')]({'where':{'id':_0x3d8ee0[_0xd520('0x28')]['id']}})[_0xd520('0x1e')](handleEntityNotFound(_0x1e6b95,null))[_0xd520('0x1e')](removeEntity(_0x1e6b95,null))['catch'](handleError(_0x1e6b95,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 136442e..b9261f7 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 _0x112a=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b54e2,_0x4a376f){var _0x56d58e=function(_0x32e629){while(--_0x32e629){_0x2b54e2['push'](_0x2b54e2['shift']());}};_0x56d58e(++_0x4a376f);}(_0x112a,0x115));var _0xa112=function(_0x565e2b,_0x399119){_0x565e2b=_0x565e2b-0x0;var _0x5b10e8=_0x112a[_0x565e2b];return _0x5b10e8;};'use strict';var _=require(_0xa112('0x0'));var util=require(_0xa112('0x1'));var logger=require(_0xa112('0x2'))(_0xa112('0x3'));var moment=require(_0xa112('0x4'));var BPromise=require(_0xa112('0x5'));var rp=require(_0xa112('0x6'));var fs=require('fs');var path=require(_0xa112('0x7'));var rimraf=require(_0xa112('0x8'));var config=require(_0xa112('0x9'));var attributes=require(_0xa112('0xa'));module[_0xa112('0xb')]=function(_0x41ca4c,_0x350cc4){return _0x41ca4c[_0xa112('0xc')](_0xa112('0xd'),attributes,{'tableName':_0xa112('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x917a=['Action','tools_actions','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x917a,0x173));var _0xa917=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x917a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa917('0x0'))(_0xa917('0x1'));var moment=require(_0xa917('0x2'));var BPromise=require('bluebird');var rp=require(_0xa917('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa917('0x4'));var config=require(_0xa917('0x5'));var attributes=require('./action.attributes');module['exports']=function(_0x58aa58,_0x3cbd72){return _0x58aa58[_0xa917('0x6')](_0xa917('0x7'),attributes,{'tableName':_0xa917('0x8'),'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 19f2eb3..13cebf7 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3a701d,_0x50f1bb){var _0x5ed6a9=function(_0x2efc79){while(--_0x2efc79){_0x3a701d['push'](_0x3a701d['shift']());}};_0x5ed6a9(++_0x50f1bb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xf00991,_0x590aec){var _0x32307f=function(_0x498a2e){while(--_0x498a2e){_0xf00991['push'](_0xf00991['shift']());}};_0x32307f(++_0x590aec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index b9da893..326aa96 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 _0xb85a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','update','delete','isAuthenticated','util','path'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xb85a,0xa3));var _0xab85=function(_0x2ba67d,_0x342b60){_0x2ba67d=_0x2ba67d-0x0;var _0x3b34d3=_0xb85a[_0x2ba67d];return _0x3b34d3;};'use strict';var multer=require('multer');var util=require(_0xab85('0x0'));var path=require(_0xab85('0x1'));var timeout=require('connect-timeout');var express=require(_0xab85('0x2'));var router=express[_0xab85('0x3')]();var fs_extra=require(_0xab85('0x4'));var auth=require(_0xab85('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab85('0x6'));var controller=require('./action.controller');router['put'](_0xab85('0x7'),auth['isAuthenticated'](),controller[_0xab85('0x8')]);router[_0xab85('0x9')](_0xab85('0x7'),auth[_0xab85('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x61a8=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy'];(function(_0x48c368,_0x4a2ae5){var _0x771166=function(_0x24cc9e){while(--_0x24cc9e){_0x48c368['push'](_0x48c368['shift']());}};_0x771166(++_0x4a2ae5);}(_0x61a8,0xc4));var _0x861a=function(_0x4920f2,_0xa4bfbf){_0x4920f2=_0x4920f2-0x0;var _0x1f27cf=_0x61a8[_0x4920f2];return _0x1f27cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x861a('0x0'));var timeout=require('connect-timeout');var express=require(_0x861a('0x1'));var router=express[_0x861a('0x2')]();var fs_extra=require(_0x861a('0x3'));var auth=require(_0x861a('0x4'));var interaction=require(_0x861a('0x5'));var config=require('../../config/environment');var controller=require(_0x861a('0x6'));router[_0x861a('0x7')](_0x861a('0x8'),auth[_0x861a('0x9')](),controller['update']);router[_0x861a('0xa')](_0x861a('0x8'),auth[_0x861a('0x9')](),controller[_0x861a('0xb')]);module[_0x861a('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index e87609c..7e2ce08 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0x46ed,0x168));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0xc2e388,_0x1b2fa4){var _0x1bbf48=function(_0x49b105){while(--_0x49b105){_0xc2e388['push'](_0xc2e388['shift']());}};_0x1bbf48(++_0x1b2fa4);}(_0xeff8,0x186));var _0x8eff=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xeff8[_0x386c3e];return _0x4b8e13;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 4ee2096..7d60ae6 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 _0x0c11=['SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','IS\x20EMPTY','Sequelize','ValidationErrorItem','function','DESC','%s.%s\x20=\x20%s.%s','table','fullPath','%s-%s.%s','generate','output','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','debug','Limited\x20Query:','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','AnalyticCustomReport','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','rows','show','params','includeAll','include','options','catch','create','body','user','get','role','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','replace','format','groupBy','orderBy','order','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','sequelize','QueryTypes','cross_join','MAX(%s)','GROUP_CONCAT(%s)'];(function(_0x43a61c,_0x366b11){var _0x3d42ad=function(_0x3aad3c){while(--_0x3aad3c){_0x43a61c['push'](_0x43a61c['shift']());}};_0x3d42ad(++_0x366b11);}(_0x0c11,0x179));var _0x10c1=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x0c11[_0xb725be];return _0x2f2424;};'use strict';var emlformat=require(_0x10c1('0x0'));var rimraf=require(_0x10c1('0x1'));var zipdir=require(_0x10c1('0x2'));var jsonpatch=require(_0x10c1('0x3'));var rp=require(_0x10c1('0x4'));var moment=require(_0x10c1('0x5'));var BPromise=require(_0x10c1('0x6'));var Mustache=require(_0x10c1('0x7'));var util=require(_0x10c1('0x8'));var path=require(_0x10c1('0x9'));var sox=require(_0x10c1('0xa'));var csv=require(_0x10c1('0xb'));var ejs=require(_0x10c1('0xc'));var fs=require('fs');var fs_extra=require(_0x10c1('0xd'));var _=require(_0x10c1('0xe'));var squel=require(_0x10c1('0xf'));var crypto=require(_0x10c1('0x10'));var jsforce=require(_0x10c1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x10c1('0xb'));var querystring=require(_0x10c1('0x12'));var Papa=require(_0x10c1('0x13'));var Redis=require(_0x10c1('0x14'));var authService=require(_0x10c1('0x15'));var qs=require(_0x10c1('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10c1('0x17'));var logger=require(_0x10c1('0x18'))(_0x10c1('0x19'));var utils=require(_0x10c1('0x1a'));var config=require(_0x10c1('0x1b'));var licenseUtil=require(_0x10c1('0x1c'));var db=require('../../mysqldb')['db'];var dbH=require(_0x10c1('0x1d'))[_0x10c1('0x1e')];function respondWithStatusCode(_0x4ec6e2,_0x3ff6ab){_0x3ff6ab=_0x3ff6ab||0xcc;return function(_0x2bf9d4){if(_0x2bf9d4){return _0x4ec6e2[_0x10c1('0x1f')](_0x3ff6ab);}return _0x4ec6e2[_0x10c1('0x20')](_0x3ff6ab)[_0x10c1('0x21')]();};}function respondWithResult(_0x1e8629,_0x23fe8c){_0x23fe8c=_0x23fe8c||0xc8;return function(_0x1db6f7){if(_0x1db6f7){return _0x1e8629[_0x10c1('0x20')](_0x23fe8c)[_0x10c1('0x22')](_0x1db6f7);}};}function respondWithFilteredResult(_0x5a8ef7,_0x1bee8d){return function(_0x2f346a){if(_0x2f346a){var _0xff1312=typeof _0x1bee8d[_0x10c1('0x23')]===_0x10c1('0x24')&&typeof _0x1bee8d[_0x10c1('0x25')]===_0x10c1('0x24');var _0x17a8ac=_0x2f346a[_0x10c1('0x26')];var _0x3e09a9=_0xff1312?0x0:_0x1bee8d[_0x10c1('0x23')];var _0x53c39d=_0xff1312?_0x2f346a[_0x10c1('0x26')]:_0x1bee8d[_0x10c1('0x23')]+_0x1bee8d[_0x10c1('0x25')];var _0x2cd2d3;if(_0x53c39d>=_0x17a8ac){_0x53c39d=_0x17a8ac;_0x2cd2d3=0xc8;}else{_0x2cd2d3=0xce;}_0x5a8ef7['status'](_0x2cd2d3);return _0x5a8ef7[_0x10c1('0x27')](_0x10c1('0x28'),_0x3e09a9+'-'+_0x53c39d+'/'+_0x17a8ac)[_0x10c1('0x22')](_0x2f346a);}return null;};}function patchUpdates(_0x31d130){return function(_0xed19d8){try{jsonpatch['apply'](_0xed19d8,_0x31d130,!![]);}catch(_0x9f4441){return BPromise[_0x10c1('0x29')](_0x9f4441);}return _0xed19d8[_0x10c1('0x2a')]();};}function saveUpdates(_0x51e2de,_0x33be3a){return function(_0x41bbe7){if(_0x41bbe7){return _0x41bbe7[_0x10c1('0x2b')](_0x51e2de)[_0x10c1('0x2c')](function(_0x386d07){return _0x386d07;});}return null;};}function removeEntity(_0x4bf67e,_0x1886b5){return function(_0xa0e422){if(_0xa0e422){return _0xa0e422['destroy']()['then'](function(){var _0x3aafec=_0xa0e422['get']({'plain':!![]});var _0x18c9f0='CustomReports';return db[_0x10c1('0x2d')][_0x10c1('0x2e')]({'where':{'type':_0x18c9f0,'resourceId':_0x3aafec['id']}})[_0x10c1('0x2c')](function(){return _0xa0e422;});})[_0x10c1('0x2c')](function(){_0x4bf67e[_0x10c1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bde8f,_0x3507e1){return function(_0x585ba6){if(!_0x585ba6){_0x2bde8f[_0x10c1('0x1f')](0x194);}return _0x585ba6;};}function handleError(_0x183274,_0x4a5c14){_0x4a5c14=_0x4a5c14||0x1f4;return function(_0x4baa65){logger[_0x10c1('0x2f')](_0x4baa65[_0x10c1('0x30')]);if(_0x4baa65['name']){delete _0x4baa65[_0x10c1('0x31')];}_0x183274['status'](_0x4a5c14)[_0x10c1('0x32')](_0x4baa65);};}exports[_0x10c1('0x33')]=function(_0x21d6ca,_0x23b25e){var _0x3b7d55={},_0x14780e={},_0x22dece={'count':0x0,'rows':[]};var _0x3218d1=_['map'](db[_0x10c1('0x34')]['rawAttributes'],function(_0x1c05f2){return{'name':_0x1c05f2[_0x10c1('0x35')],'type':_0x1c05f2[_0x10c1('0x36')]['key']};});_0x14780e[_0x10c1('0x37')]=_[_0x10c1('0x38')](_0x3218d1,_0x10c1('0x31'));_0x14780e[_0x10c1('0x39')]=_[_0x10c1('0x3a')](_0x21d6ca['query']);_0x14780e[_0x10c1('0x3b')]=_[_0x10c1('0x3c')](_0x14780e[_0x10c1('0x37')],_0x14780e[_0x10c1('0x39')]);_0x3b7d55['attributes']=_['intersection'](_0x14780e[_0x10c1('0x37')],qs[_0x10c1('0x3d')](_0x21d6ca[_0x10c1('0x39')]['fields']));_0x3b7d55[_0x10c1('0x3e')]=_0x3b7d55[_0x10c1('0x3e')][_0x10c1('0x3f')]?_0x3b7d55['attributes']:_0x14780e['model'];if(!_0x21d6ca[_0x10c1('0x39')][_0x10c1('0x40')](_0x10c1('0x41'))){_0x3b7d55[_0x10c1('0x25')]=qs[_0x10c1('0x25')](_0x21d6ca[_0x10c1('0x39')]['limit']);_0x3b7d55['offset']=qs['offset'](_0x21d6ca['query'][_0x10c1('0x23')]);}_0x3b7d55['order']=qs[_0x10c1('0x42')](_0x21d6ca[_0x10c1('0x39')][_0x10c1('0x42')]);_0x3b7d55[_0x10c1('0x43')]=qs[_0x10c1('0x3b')](_[_0x10c1('0x44')](_0x21d6ca[_0x10c1('0x39')],_0x14780e[_0x10c1('0x3b')]),_0x3218d1);if(_0x21d6ca[_0x10c1('0x39')][_0x10c1('0x45')]){_0x3b7d55[_0x10c1('0x43')]=_[_0x10c1('0x46')](_0x3b7d55[_0x10c1('0x43')],{'$or':_[_0x10c1('0x38')](_0x3218d1,function(_0x53076f){if(_0x53076f[_0x10c1('0x36')]!==_0x10c1('0x47')){var _0x442dc8={};_0x442dc8[_0x53076f[_0x10c1('0x31')]]={'$like':'%'+_0x21d6ca[_0x10c1('0x39')][_0x10c1('0x45')]+'%'};return _0x442dc8;}})});}_0x3b7d55=_['merge']({},_0x3b7d55,_0x21d6ca['options']);var _0x3614c6={'where':_0x3b7d55[_0x10c1('0x43')]};return db[_0x10c1('0x34')][_0x10c1('0x26')](_0x3614c6)[_0x10c1('0x2c')](function(_0x264915){_0x22dece[_0x10c1('0x26')]=_0x264915;if(_0x21d6ca[_0x10c1('0x39')]['includeAll']){_0x3b7d55['include']=[{'all':!![]}];}return db[_0x10c1('0x34')]['findAll'](_0x3b7d55);})[_0x10c1('0x2c')](function(_0x2127c2){_0x22dece[_0x10c1('0x48')]=_0x2127c2;return _0x22dece;})[_0x10c1('0x2c')](respondWithFilteredResult(_0x23b25e,_0x3b7d55))['catch'](handleError(_0x23b25e,null));};exports[_0x10c1('0x49')]=function(_0x4e7f82,_0x1afb68){var _0x77b84b={'raw':![],'where':{'id':_0x4e7f82[_0x10c1('0x4a')]['id']}},_0x3f0dab={};_0x3f0dab[_0x10c1('0x37')]=_[_0x10c1('0x3a')](db['AnalyticCustomReport']['rawAttributes']);_0x3f0dab[_0x10c1('0x39')]=_[_0x10c1('0x3a')](_0x4e7f82[_0x10c1('0x39')]);_0x3f0dab[_0x10c1('0x3b')]=_['intersection'](_0x3f0dab['model'],_0x3f0dab[_0x10c1('0x39')]);_0x77b84b['attributes']=_[_0x10c1('0x3c')](_0x3f0dab['model'],qs['fields'](_0x4e7f82['query'][_0x10c1('0x3d')]));_0x77b84b['attributes']=_0x77b84b['attributes'][_0x10c1('0x3f')]?_0x77b84b[_0x10c1('0x3e')]:_0x3f0dab[_0x10c1('0x37')];if(_0x4e7f82[_0x10c1('0x39')][_0x10c1('0x4b')]){_0x77b84b[_0x10c1('0x4c')]=[{'all':!![]}];}_0x77b84b=_[_0x10c1('0x46')]({},_0x77b84b,_0x4e7f82[_0x10c1('0x4d')]);return db[_0x10c1('0x34')]['find'](_0x77b84b)[_0x10c1('0x2c')](handleEntityNotFound(_0x1afb68,null))['then'](respondWithResult(_0x1afb68,null))[_0x10c1('0x4e')](handleError(_0x1afb68,null));};exports[_0x10c1('0x4f')]=function(_0x401576,_0x563837){return db[_0x10c1('0x34')][_0x10c1('0x4f')](_0x401576[_0x10c1('0x50')],{})[_0x10c1('0x2c')](function(_0x5ebff7){var _0x4790d5=_0x401576[_0x10c1('0x51')][_0x10c1('0x52')]({'plain':!![]});if(!_0x4790d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4790d5[_0x10c1('0x53')]===_0x10c1('0x51')){var _0x175523=_0x5ebff7[_0x10c1('0x52')]({'plain':!![]});var _0x261f41=_0x10c1('0x54');return db[_0x10c1('0x55')][_0x10c1('0x56')]({'where':{'name':_0x261f41,'userProfileId':_0x4790d5[_0x10c1('0x57')]},'raw':!![]})['then'](function(_0x3e7e4b){if(_0x3e7e4b&&_0x3e7e4b['autoAssociation']===0x0){return db[_0x10c1('0x2d')][_0x10c1('0x4f')]({'name':_0x175523[_0x10c1('0x31')],'resourceId':_0x175523['id'],'type':'CustomReports','sectionId':_0x3e7e4b['id']},{})[_0x10c1('0x2c')](function(){return _0x5ebff7;});}else{return _0x5ebff7;}})[_0x10c1('0x4e')](function(_0x12a28c){logger[_0x10c1('0x2f')](_0x10c1('0x58'),_0x12a28c);throw _0x12a28c;});}return _0x5ebff7;})['then'](respondWithResult(_0x563837,0xc9))[_0x10c1('0x4e')](handleError(_0x563837,null));};exports[_0x10c1('0x2b')]=function(_0x1aa137,_0x5d4761){if(_0x1aa137[_0x10c1('0x50')]['id']){delete _0x1aa137[_0x10c1('0x50')]['id'];}return db['AnalyticCustomReport'][_0x10c1('0x56')]({'where':{'id':_0x1aa137['params']['id']}})[_0x10c1('0x2c')](handleEntityNotFound(_0x5d4761,null))[_0x10c1('0x2c')](saveUpdates(_0x1aa137['body'],null))[_0x10c1('0x2c')](respondWithResult(_0x5d4761,null))['catch'](handleError(_0x5d4761,null));};exports['destroy']=function(_0x530f9a,_0x472623){return db['AnalyticCustomReport']['find']({'where':{'id':_0x530f9a['params']['id']}})[_0x10c1('0x2c')](handleEntityNotFound(_0x472623,null))[_0x10c1('0x2c')](removeEntity(_0x472623,null))[_0x10c1('0x4e')](handleError(_0x472623,null));};exports[_0x10c1('0x59')]=function(_0x5eb930,_0x452e0e){var _0x545a94=0xa;var _0x49e52c=[_0x10c1('0x5a'),_0x10c1('0x5b'),_0x10c1('0x5c'),'cross_join'];var _0x143e9c={'SUM':_0x10c1('0x5d'),'COUNT':_0x10c1('0x5e'),'COUNT DISTINCT':_0x10c1('0x5f'),'MAX':'MAX(%s)','MIN':_0x10c1('0x60'),'AVG':_0x10c1('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x10c1('0x62'),'GROUP_CONCAT DESC':_0x10c1('0x63')};var _0x3fe57b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x10c1('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x10c1('0x65'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x334eeb=function(_0x28cbd6){return!_[_0x10c1('0x66')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x10c1('0x67')],_0x28cbd6);};var _0x4dff1e=function(_0x358259){if(!_0x358259||!_0x358259[_0x10c1('0x68')][_0x10c1('0x3f')]){return'';}for(var _0x19a756='(',_0x42bb4c=0x0;_0x42bb4c<_0x358259[_0x10c1('0x68')][_0x10c1('0x3f')];_0x42bb4c+=0x1){_0x42bb4c>0x0&&(_0x19a756+='\x20'+_0x358259[_0x10c1('0x69')]+'\x20');_0x19a756+=_0x358259[_0x10c1('0x68')][_0x42bb4c][_0x10c1('0x6a')]?_0x4dff1e(_0x358259['rules'][_0x42bb4c][_0x10c1('0x6a')]):_0x358259[_0x10c1('0x68')][_0x42bb4c]['field']+'\x20'+_0x358259[_0x10c1('0x68')][_0x42bb4c][_0x10c1('0x6b')]+(_0x334eeb(_0x358259['rules'][_0x42bb4c][_0x10c1('0x6b')])?'\x20'+_0x358259['rules'][_0x42bb4c][_0x10c1('0x6c')]:'');}return _0x19a756+')';};var _0x34e789={'where':{'id':_0x5eb930[_0x10c1('0x4a')]['id']}},_0x237e5c,_0x2fe3a2,_0x3b3580,_0x3b97d7,_0x158838;_0x34e789=_[_0x10c1('0x46')]({},_0x34e789,_0x5eb930[_0x10c1('0x4d')]);return db[_0x10c1('0x34')][_0x10c1('0x56')](_0x34e789)[_0x10c1('0x2c')](function(_0x46a0e1){if(_0x46a0e1){_0x237e5c=_0x46a0e1;return _0x46a0e1[_0x10c1('0x6d')]();}return null;})[_0x10c1('0x2c')](function(_0xe2fd5e){if(_0xe2fd5e){if(!_0xe2fd5e[_0x10c1('0x3f')]){throw new db['Sequelize']['ValidationErrorItem'](_0x10c1('0x6e'),0x193);}_0x2fe3a2=_0xe2fd5e;return db[_0x10c1('0x6f')][_0x10c1('0x70')]({'raw':!![]});}return null;})[_0x10c1('0x2c')](function(_0x1178ec){if(_0x1178ec){_0x3b3580=_[_0x10c1('0x71')](_0x1178ec,'id');var _0x261827;var _0x1ae2ef=squel[_0x10c1('0x72')]();_0x1ae2ef[_0x10c1('0x73')](_0x237e5c['table']);for(var _0xbbc745=0x0;_0xbbc745<_0x2fe3a2[_0x10c1('0x3f')];_0xbbc745+=0x1){_0x261827=_0x2fe3a2[_0xbbc745][_0x10c1('0x74')]?_0x3b3580[_0x2fe3a2[_0xbbc745][_0x10c1('0x74')]][_0x10c1('0x75')]:_0x2fe3a2[_0xbbc745][_0x10c1('0x76')];_0x261827=_0x2fe3a2[_0xbbc745]['function']?_[_0x10c1('0x77')](_0x143e9c[_0x2fe3a2[_0xbbc745]['function']],'%s',_0x261827):_0x261827;_0x261827=_0x2fe3a2[_0xbbc745][_0x10c1('0x78')]?_[_0x10c1('0x77')](_0x3fe57b[_0x2fe3a2[_0xbbc745][_0x10c1('0x78')]],'%s',_0x261827):_0x261827;if(_0x2fe3a2[_0xbbc745][_0x10c1('0x79')]){_0x1ae2ef['group'](_0x261827);}_0x2fe3a2[_0xbbc745][_0x10c1('0x7a')]&&_0x1ae2ef[_0x10c1('0x7b')](_0x261827,_0x2fe3a2[_0xbbc745][_0x10c1('0x7a')]==='DESC'?![]:!![]);_0x1ae2ef[_0x10c1('0x76')](_0x261827,_0x2fe3a2[_0xbbc745]['alias']||_0x261827);}if(_0x237e5c[_0x10c1('0x7c')]){_0x237e5c['joins']=JSON[_0x10c1('0x7d')](_0x237e5c['joins']);for(var _0xa8b163=0x0;_0xa8b163<_0x237e5c[_0x10c1('0x7c')][_0x10c1('0x3f')];_0xa8b163+=0x1){if(_0x237e5c[_0x10c1('0x7c')][_0xa8b163][_0x10c1('0x36')]&&_[_0x10c1('0x66')](_0x49e52c,_0x237e5c['joins'][_0xa8b163][_0x10c1('0x36')])&&_0x237e5c[_0x10c1('0x7c')][_0xa8b163][_0x10c1('0x7e')]&&_0x237e5c['joins'][_0xa8b163]['foreignTable']&&_0x237e5c[_0x10c1('0x7c')][_0xa8b163][_0x10c1('0x7f')]){_0x1ae2ef[_0x237e5c[_0x10c1('0x7c')][_0xa8b163][_0x10c1('0x36')]](_0x237e5c['joins'][_0xa8b163]['foreignTable'],null,util[_0x10c1('0x78')]('%s.%s\x20=\x20%s.%s',_0x237e5c['table'],_0x237e5c['joins'][_0xa8b163]['parentKey'],_0x237e5c[_0x10c1('0x7c')][_0xa8b163][_0x10c1('0x80')],_0x237e5c[_0x10c1('0x7c')][_0xa8b163]['foreignKey']));}}}if(_0x237e5c[_0x10c1('0x81')]){_0x237e5c['conditions']=JSON[_0x10c1('0x7d')](_0x237e5c[_0x10c1('0x81')]);_0x1ae2ef['where'](_0x4dff1e(_0x237e5c[_0x10c1('0x81')][_0x10c1('0x6a')]));}_0x158838=_0x1ae2ef[_0x10c1('0x82')]();_0x1ae2ef[_0x10c1('0x25')](_0x545a94);_0x1ae2ef[_0x10c1('0x23')](0x0);logger['debug']('Limited\x20Query:',_0x1ae2ef['toString']());return dbH[_0x10c1('0x83')][_0x10c1('0x39')](_0x1ae2ef['toString'](),{'type':dbH['sequelize'][_0x10c1('0x84')]['SELECT']});}})[_0x10c1('0x2c')](respondWithResult(_0x452e0e,null))['catch'](handleError(_0x452e0e,null));};function runReport(_0x36feff,_0x2e8f21,_0x3b227a){var _0x281905=_0x2e8f21['name'];var _0x1b01c0=0xa;var _0x46a8c8=['join',_0x10c1('0x5b'),'right_join',_0x10c1('0x85')];var _0x1a56b1={'SUM':_0x10c1('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x10c1('0x86'),'MIN':_0x10c1('0x60'),'AVG':_0x10c1('0x61'),'GROUP_CONCAT':_0x10c1('0x87'),'GROUP_CONCAT ASC':_0x10c1('0x62'),'GROUP_CONCAT DESC':_0x10c1('0x63')};var _0x56324d={'SEC_TO_TIME':_0x10c1('0x88'),'DATE':_0x10c1('0x64'),'HOUR':_0x10c1('0x89'),'ROUND':_0x10c1('0x65'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2fc067=function(_0x2d8f03){return!_[_0x10c1('0x66')]([_0x10c1('0x8a'),'IS\x20NOT\x20NULL',_0x10c1('0x8b'),'IS\x20NOT\x20EMPTY'],_0x2d8f03);};var _0x1d02ec=function(_0x386225){if(!_0x386225||!_0x386225['rules'][_0x10c1('0x3f')]){return'';}for(var _0x519118='(',_0x43bd79=0x0;_0x43bd79<_0x386225[_0x10c1('0x68')]['length'];_0x43bd79+=0x1){_0x43bd79>0x0&&(_0x519118+='\x20'+_0x386225[_0x10c1('0x69')]+'\x20');_0x519118+=_0x386225[_0x10c1('0x68')][_0x43bd79][_0x10c1('0x6a')]?_0x1d02ec(_0x386225[_0x10c1('0x68')][_0x43bd79]['group']):_0x386225['rules'][_0x43bd79]['field']+'\x20'+_0x386225[_0x10c1('0x68')][_0x43bd79][_0x10c1('0x6b')]+(_0x2fc067(_0x386225[_0x10c1('0x68')][_0x43bd79]['condition'])?'\x20'+_0x386225[_0x10c1('0x68')][_0x43bd79][_0x10c1('0x6c')]:'');}return _0x519118+')';};var _0x28d2ef={'where':{'id':_0x36feff['id']}},_0x1b463c,_0x41c46c,_0x562b31,_0x3a4dae,_0x8b3846;_0x28d2ef=_[_0x10c1('0x46')]({},_0x28d2ef,_0x3b227a);return db[_0x10c1('0x34')][_0x10c1('0x56')](_0x28d2ef)[_0x10c1('0x2c')](function(_0x567734){if(_0x567734){_0x1b463c=_0x567734;return _0x567734['getFields']();}return null;})[_0x10c1('0x2c')](function(_0x140bdb){if(_0x140bdb){if(!_0x140bdb[_0x10c1('0x3f')]){throw new db[(_0x10c1('0x8c'))][(_0x10c1('0x8d'))](_0x10c1('0x6e'),0x193);}_0x41c46c=_0x140bdb;return db[_0x10c1('0x6f')][_0x10c1('0x70')]({'raw':!![]});}return null;})[_0x10c1('0x2c')](function(_0x18e47e){if(_0x18e47e){_0x562b31=_[_0x10c1('0x71')](_0x18e47e,'id');var _0x100eb8;var _0x20bfea=squel[_0x10c1('0x72')]();_0x20bfea[_0x10c1('0x73')](_0x1b463c['table']);for(var _0x307d3b=0x0;_0x307d3b<_0x41c46c[_0x10c1('0x3f')];_0x307d3b+=0x1){_0x100eb8=_0x41c46c[_0x307d3b][_0x10c1('0x74')]?_0x562b31[_0x41c46c[_0x307d3b][_0x10c1('0x74')]][_0x10c1('0x75')]:_0x41c46c[_0x307d3b][_0x10c1('0x76')];_0x100eb8=_0x41c46c[_0x307d3b]['function']?_[_0x10c1('0x77')](_0x1a56b1[_0x41c46c[_0x307d3b][_0x10c1('0x8e')]],'%s',_0x100eb8):_0x100eb8;_0x100eb8=_0x41c46c[_0x307d3b][_0x10c1('0x78')]?_[_0x10c1('0x77')](_0x56324d[_0x41c46c[_0x307d3b][_0x10c1('0x78')]],'%s',_0x100eb8):_0x100eb8;if(_0x41c46c[_0x307d3b][_0x10c1('0x79')]){_0x20bfea['group'](_0x100eb8);}_0x41c46c[_0x307d3b]['orderBy']&&_0x20bfea[_0x10c1('0x7b')](_0x100eb8,_0x41c46c[_0x307d3b][_0x10c1('0x7a')]===_0x10c1('0x8f')?![]:!![]);_0x20bfea['field'](_0x100eb8,_0x41c46c[_0x307d3b]['alias']||_0x100eb8);}if(_0x1b463c[_0x10c1('0x7c')]){_0x1b463c['joins']=JSON[_0x10c1('0x7d')](_0x1b463c['joins']);for(var _0x23b28e=0x0;_0x23b28e<_0x1b463c[_0x10c1('0x7c')][_0x10c1('0x3f')];_0x23b28e+=0x1){if(_0x1b463c[_0x10c1('0x7c')][_0x23b28e][_0x10c1('0x36')]&&_['includes'](_0x46a8c8,_0x1b463c['joins'][_0x23b28e][_0x10c1('0x36')])&&_0x1b463c[_0x10c1('0x7c')][_0x23b28e][_0x10c1('0x7e')]&&_0x1b463c[_0x10c1('0x7c')][_0x23b28e]['foreignTable']&&_0x1b463c[_0x10c1('0x7c')][_0x23b28e][_0x10c1('0x7f')]){_0x20bfea[_0x1b463c['joins'][_0x23b28e][_0x10c1('0x36')]](_0x1b463c['joins'][_0x23b28e]['foreignTable'],null,util[_0x10c1('0x78')](_0x10c1('0x90'),_0x1b463c[_0x10c1('0x91')],_0x1b463c[_0x10c1('0x7c')][_0x23b28e][_0x10c1('0x7e')],_0x1b463c[_0x10c1('0x7c')][_0x23b28e][_0x10c1('0x80')],_0x1b463c['joins'][_0x23b28e]['foreignKey']));}}}if(_0x1b463c[_0x10c1('0x81')]){_0x1b463c['conditions']=JSON[_0x10c1('0x7d')](_0x1b463c[_0x10c1('0x81')]);_0x20bfea['where'](_0x1d02ec(_0x1b463c['conditions']['group']));}_0x8b3846=_0x20bfea['clone']();_0x20bfea[_0x10c1('0x25')](_0x1b01c0);_0x20bfea[_0x10c1('0x23')](0x0);return;}})['then'](function(){if(_0x2e8f21['output']==='web'){return null;}var _0x28689f=_[_0x10c1('0x46')](_0x2e8f21,{'name':_0x2e8f21[_0x10c1('0x92')]||_0x2e8f21['name']||_0x1b463c[_0x10c1('0x31')],'basename':_0x281905,'savename':util[_0x10c1('0x78')](_0x10c1('0x93'),_0x2e8f21[_0x10c1('0x31')]||_0x1b463c[_0x10c1('0x31')],require('randomstring')[_0x10c1('0x94')](0x4),_0x2e8f21[_0x10c1('0x95')]||_0x10c1('0x96')),'reportId':_0x1b463c['id'],'reportType':_0x10c1('0x97')});return db['AnalyticExtractedReport'][_0x10c1('0x4f')](_0x28689f,{'raw':!![]});})['then'](function(_0x5dba2b){if(_0x1b463c[_0x10c1('0x91')]==='cdr'){_0x8b3846[_0x10c1('0x43')](_0x1b463c[_0x10c1('0x91')]+_0x10c1('0x98'),_0x2e8f21[_0x10c1('0x99')],_0x2e8f21[_0x10c1('0x9a')]);}else{_0x8b3846['where'](_0x1b463c[_0x10c1('0x91')]+_0x10c1('0x9b'),_0x2e8f21[_0x10c1('0x99')],_0x2e8f21[_0x10c1('0x9a')]);}if(_0x5dba2b){logger[_0x10c1('0x9c')](_0x10c1('0x9d'),_0x8b3846[_0x10c1('0x9e')]());require(_0x10c1('0x9f'))['fork'](path[_0x10c1('0x5a')](__dirname,_0x10c1('0xa0'),_0x5dba2b[_0x10c1('0x95')]),[_0x5dba2b['id'],_0x8b3846[_0x10c1('0x9e')](),path[_0x10c1('0x5a')](__dirname,_0x10c1('0xa1'),_0x5dba2b[_0x10c1('0xa2')]),_0x281905]);return _0x5dba2b;}else{var _0x4679e3=squel['select']();_0x4679e3[_0x10c1('0x73')]('('+_0x8b3846[_0x10c1('0x9e')]()+')','countTable');_0x4679e3['field'](_0x10c1('0xa3'),_0x10c1('0x26'));_0x8b3846[_0x10c1('0x25')](_0x2e8f21[_0x10c1('0x25')]||_0x1b01c0);_0x8b3846[_0x10c1('0x23')](_0x2e8f21[_0x10c1('0x23')]||0x0);return dbH[_0x10c1('0x83')]['query'](_0x4679e3['toString'](),{'type':dbH[_0x10c1('0x83')]['QueryTypes'][_0x10c1('0xa4')]})[_0x10c1('0x2c')](function(_0x14a3c9){if(!_0x14a3c9[_0x10c1('0x3f')]){_0x3a4dae=0x0;}else{_0x3a4dae=_0x14a3c9[0x0]['count']||0x0;}return dbH['sequelize'][_0x10c1('0x39')](_0x8b3846['toString'](),{'type':dbH[_0x10c1('0x83')][_0x10c1('0x84')][_0x10c1('0xa4')]});})[_0x10c1('0x2c')](function(_0x46c42e){return{'rows':_0x46c42e||[],'count':_0x3a4dae};});}});}exports[_0x10c1('0xa5')]=function(_0x1106e6,_0x562262){return runReport(_0x1106e6[_0x10c1('0x4a')],_0x1106e6[_0x10c1('0x39')],_0x1106e6[_0x10c1('0x4d')])['then'](respondWithResult(_0x562262,null))['catch'](handleError(_0x562262,null));};exports[_0x10c1('0xa6')]=runReport;exports[_0x10c1('0x39')]=function(_0x585d6f,_0x1977b1){var _0x6b1366=0xa;var _0x268f3d=['join',_0x10c1('0x5b'),'right_join','cross_join'];var _0x277ff0={'SUM':'SUM(%s)','COUNT':_0x10c1('0x5e'),'COUNT DISTINCT':_0x10c1('0x5f'),'MAX':_0x10c1('0x86'),'MIN':_0x10c1('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x10c1('0x87'),'GROUP_CONCAT ASC':_0x10c1('0x62'),'GROUP_CONCAT DESC':_0x10c1('0x63')};var _0x1939ea={'SEC_TO_TIME':_0x10c1('0x88'),'DATE':_0x10c1('0x64'),'HOUR':_0x10c1('0x89'),'ROUND':_0x10c1('0x65'),'UNIX_TIMESTAMP':_0x10c1('0xa7')};var _0x4051a0=function(_0x2757b0){return!_[_0x10c1('0x66')]([_0x10c1('0x8a'),_0x10c1('0xa8'),_0x10c1('0x8b'),_0x10c1('0x67')],_0x2757b0);};var _0x30abad=function(_0x186969){if(!_0x186969||!_0x186969['rules']['length']){return'';}for(var _0xaec656='(',_0x16bd93=0x0;_0x16bd93<_0x186969[_0x10c1('0x68')][_0x10c1('0x3f')];_0x16bd93+=0x1){_0x16bd93>0x0&&(_0xaec656+='\x20'+_0x186969['operator']+'\x20');_0xaec656+=_0x186969['rules'][_0x16bd93][_0x10c1('0x6a')]?_0x30abad(_0x186969[_0x10c1('0x68')][_0x16bd93]['group']):_0x186969[_0x10c1('0x68')][_0x16bd93][_0x10c1('0x76')]+'\x20'+_0x186969[_0x10c1('0x68')][_0x16bd93][_0x10c1('0x6b')]+(_0x4051a0(_0x186969[_0x10c1('0x68')][_0x16bd93][_0x10c1('0x6b')])?'\x20'+_0x186969[_0x10c1('0x68')][_0x16bd93][_0x10c1('0x6c')]:'');}return _0xaec656+')';};var _0x53c24b={'where':{'id':_0x585d6f[_0x10c1('0x4a')]['id']}},_0x2cef0b,_0x42649f,_0xccc50b,_0x5d309b,_0x56d795;_0x53c24b=_['merge']({},_0x53c24b,_0x585d6f[_0x10c1('0x4d')]);return db[_0x10c1('0x34')]['find'](_0x53c24b)[_0x10c1('0x2c')](function(_0x17a1ca){if(_0x17a1ca){_0x2cef0b=_0x17a1ca;return _0x17a1ca['getFields']();}return null;})[_0x10c1('0x2c')](function(_0x503eea){if(_0x503eea){if(!_0x503eea[_0x10c1('0x3f')]){throw new db['Sequelize'][(_0x10c1('0x8d'))](_0x10c1('0x6e'),0x193);}_0x42649f=_0x503eea;return db[_0x10c1('0x6f')][_0x10c1('0x70')]({'raw':!![]});}return null;})[_0x10c1('0x2c')](function(_0x1e4f8d){if(_0x1e4f8d){_0xccc50b=_['keyBy'](_0x1e4f8d,'id');var _0x463ad7;var _0x14a5a5=squel[_0x10c1('0x72')]();_0x14a5a5[_0x10c1('0x73')](_0x2cef0b[_0x10c1('0x91')]);for(var _0x2aeb53=0x0;_0x2aeb53<_0x42649f[_0x10c1('0x3f')];_0x2aeb53+=0x1){_0x463ad7=_0x42649f[_0x2aeb53][_0x10c1('0x74')]?_0xccc50b[_0x42649f[_0x2aeb53][_0x10c1('0x74')]][_0x10c1('0x75')]:_0x42649f[_0x2aeb53][_0x10c1('0x76')];_0x463ad7=_0x42649f[_0x2aeb53][_0x10c1('0x8e')]?_[_0x10c1('0x77')](_0x277ff0[_0x42649f[_0x2aeb53][_0x10c1('0x8e')]],'%s',_0x463ad7):_0x463ad7;_0x463ad7=_0x42649f[_0x2aeb53][_0x10c1('0x78')]?_['replace'](_0x1939ea[_0x42649f[_0x2aeb53][_0x10c1('0x78')]],'%s',_0x463ad7):_0x463ad7;if(_0x42649f[_0x2aeb53][_0x10c1('0x79')]){_0x14a5a5[_0x10c1('0x6a')](_0x463ad7);}_0x42649f[_0x2aeb53]['orderBy']&&_0x14a5a5[_0x10c1('0x7b')](_0x463ad7,_0x42649f[_0x2aeb53][_0x10c1('0x7a')]===_0x10c1('0x8f')?![]:!![]);_0x14a5a5['field'](_0x463ad7,_0x42649f[_0x2aeb53]['alias']||_0x463ad7);}if(_0x2cef0b[_0x10c1('0x7c')]){_0x2cef0b[_0x10c1('0x7c')]=JSON[_0x10c1('0x7d')](_0x2cef0b[_0x10c1('0x7c')]);for(var _0x4eb43d=0x0;_0x4eb43d<_0x2cef0b['joins']['length'];_0x4eb43d+=0x1){if(_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d]['type']&&_[_0x10c1('0x66')](_0x268f3d,_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x36')])&&_0x2cef0b['joins'][_0x4eb43d]['parentKey']&&_0x2cef0b['joins'][_0x4eb43d]['foreignTable']&&_0x2cef0b['joins'][_0x4eb43d][_0x10c1('0x7f')]){_0x14a5a5[_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x36')]](_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x80')],null,util['format'](_0x10c1('0x90'),_0x2cef0b[_0x10c1('0x91')],_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x7e')],_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x80')],_0x2cef0b[_0x10c1('0x7c')][_0x4eb43d][_0x10c1('0x7f')]));}}}if(_0x2cef0b[_0x10c1('0x81')]){_0x2cef0b[_0x10c1('0x81')]=JSON['parse'](_0x2cef0b[_0x10c1('0x81')]);_0x14a5a5['where'](_0x30abad(_0x2cef0b[_0x10c1('0x81')][_0x10c1('0x6a')]));}_0x56d795=_0x14a5a5[_0x10c1('0x82')]();_0x14a5a5[_0x10c1('0x25')](_0x6b1366);_0x14a5a5[_0x10c1('0x23')](0x0);logger[_0x10c1('0xa9')](_0x10c1('0xaa'),_0x14a5a5[_0x10c1('0x9e')]());return dbH[_0x10c1('0x83')]['query'](_0x14a5a5['toString'](),{'type':dbH[_0x10c1('0x83')][_0x10c1('0x84')][_0x10c1('0xa4')]});}})['then'](function(){return{'sql':_0x56d795[_0x10c1('0x9e')]()};})[_0x10c1('0x2c')](respondWithResult(_0x1977b1,null))[_0x10c1('0x4e')](handleError(_0x1977b1,null));}; \ No newline at end of file +var _0xf301=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','CustomReports','UserProfileResource','then','end','error','name','send','index','map','rawAttributes','type','model','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','SELECT','operator','MetricId','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','fork','../../components/export/','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service'];(function(_0x1cf0bc,_0x1792b1){var _0x487e5a=function(_0x3b8dbe){while(--_0x3b8dbe){_0x1cf0bc['push'](_0x1cf0bc['shift']());}};_0x487e5a(++_0x1792b1);}(_0xf301,0x1d8));var _0x1f30=function(_0x1a5276,_0x121d2e){_0x1a5276=_0x1a5276-0x0;var _0x2dd49c=_0xf301[_0x1a5276];return _0x2dd49c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f30('0x0'));var zipdir=require(_0x1f30('0x1'));var jsonpatch=require(_0x1f30('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f30('0x3'));var Mustache=require(_0x1f30('0x4'));var util=require(_0x1f30('0x5'));var path=require(_0x1f30('0x6'));var sox=require(_0x1f30('0x7'));var csv=require(_0x1f30('0x8'));var ejs=require(_0x1f30('0x9'));var fs=require('fs');var fs_extra=require(_0x1f30('0xa'));var _=require(_0x1f30('0xb'));var squel=require(_0x1f30('0xc'));var crypto=require('crypto');var jsforce=require(_0x1f30('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1f30('0x8'));var querystring=require('querystring');var Papa=require(_0x1f30('0xe'));var Redis=require(_0x1f30('0xf'));var authService=require(_0x1f30('0x10'));var qs=require(_0x1f30('0x11'));var as=require(_0x1f30('0x12'));var hardwareService=require(_0x1f30('0x13'));var logger=require(_0x1f30('0x14'))('api');var utils=require(_0x1f30('0x15'));var config=require(_0x1f30('0x16'));var licenseUtil=require(_0x1f30('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1f30('0x18'))['dbH'];function respondWithStatusCode(_0x3052c7,_0x116bfb){_0x116bfb=_0x116bfb||0xcc;return function(_0x4e92d0){if(_0x4e92d0){return _0x3052c7[_0x1f30('0x19')](_0x116bfb);}return _0x3052c7[_0x1f30('0x1a')](_0x116bfb)['end']();};}function respondWithResult(_0x32b905,_0x34f23d){_0x34f23d=_0x34f23d||0xc8;return function(_0x3015e0){if(_0x3015e0){return _0x32b905['status'](_0x34f23d)[_0x1f30('0x1b')](_0x3015e0);}};}function respondWithFilteredResult(_0x321391,_0x9a29a){return function(_0x32a71e){if(_0x32a71e){var _0x335110=typeof _0x9a29a[_0x1f30('0x1c')]===_0x1f30('0x1d')&&typeof _0x9a29a[_0x1f30('0x1e')]==='undefined';var _0x5cb4c9=_0x32a71e['count'];var _0x30dae1=_0x335110?0x0:_0x9a29a['offset'];var _0x56cf33=_0x335110?_0x32a71e[_0x1f30('0x1f')]:_0x9a29a[_0x1f30('0x1c')]+_0x9a29a[_0x1f30('0x1e')];var _0x4b0587;if(_0x56cf33>=_0x5cb4c9){_0x56cf33=_0x5cb4c9;_0x4b0587=0xc8;}else{_0x4b0587=0xce;}_0x321391[_0x1f30('0x1a')](_0x4b0587);return _0x321391[_0x1f30('0x20')]('Content-Range',_0x30dae1+'-'+_0x56cf33+'/'+_0x5cb4c9)[_0x1f30('0x1b')](_0x32a71e);}return null;};}function patchUpdates(_0x188205){return function(_0x4d1a86){try{jsonpatch[_0x1f30('0x21')](_0x4d1a86,_0x188205,!![]);}catch(_0x53fff1){return BPromise[_0x1f30('0x22')](_0x53fff1);}return _0x4d1a86['save']();};}function saveUpdates(_0x347a6a,_0x12a1fd){return function(_0x8326fe){if(_0x8326fe){return _0x8326fe[_0x1f30('0x23')](_0x347a6a)['then'](function(_0x37c61b){return _0x37c61b;});}return null;};}function removeEntity(_0x9b4ae2,_0xf6ba87){return function(_0x47a54f){if(_0x47a54f){return _0x47a54f[_0x1f30('0x24')]()['then'](function(){var _0x34043d=_0x47a54f[_0x1f30('0x25')]({'plain':!![]});var _0x50276d=_0x1f30('0x26');return db[_0x1f30('0x27')][_0x1f30('0x24')]({'where':{'type':_0x50276d,'resourceId':_0x34043d['id']}})[_0x1f30('0x28')](function(){return _0x47a54f;});})[_0x1f30('0x28')](function(){_0x9b4ae2['status'](0xcc)[_0x1f30('0x29')]();});}};}function handleEntityNotFound(_0x551f84,_0x1b6cf2){return function(_0x11b9f4){if(!_0x11b9f4){_0x551f84[_0x1f30('0x19')](0x194);}return _0x11b9f4;};}function handleError(_0x1efe8b,_0x417238){_0x417238=_0x417238||0x1f4;return function(_0x3bfe5e){logger[_0x1f30('0x2a')](_0x3bfe5e['stack']);if(_0x3bfe5e[_0x1f30('0x2b')]){delete _0x3bfe5e[_0x1f30('0x2b')];}_0x1efe8b[_0x1f30('0x1a')](_0x417238)[_0x1f30('0x2c')](_0x3bfe5e);};}exports[_0x1f30('0x2d')]=function(_0x48f62d,_0x6b9d8f){var _0x4b2969={},_0x1edb88={},_0x591ff6={'count':0x0,'rows':[]};var _0x4b7d50=_[_0x1f30('0x2e')](db['AnalyticCustomReport'][_0x1f30('0x2f')],function(_0x48d2a7){return{'name':_0x48d2a7['fieldName'],'type':_0x48d2a7[_0x1f30('0x30')]['key']};});_0x1edb88[_0x1f30('0x31')]=_[_0x1f30('0x2e')](_0x4b7d50,_0x1f30('0x2b'));_0x1edb88[_0x1f30('0x32')]=_['keys'](_0x48f62d[_0x1f30('0x32')]);_0x1edb88[_0x1f30('0x33')]=_['intersection'](_0x1edb88[_0x1f30('0x31')],_0x1edb88[_0x1f30('0x32')]);_0x4b2969[_0x1f30('0x34')]=_['intersection'](_0x1edb88[_0x1f30('0x31')],qs['fields'](_0x48f62d[_0x1f30('0x32')][_0x1f30('0x35')]));_0x4b2969[_0x1f30('0x34')]=_0x4b2969[_0x1f30('0x34')]['length']?_0x4b2969[_0x1f30('0x34')]:_0x1edb88[_0x1f30('0x31')];if(!_0x48f62d[_0x1f30('0x32')]['hasOwnProperty'](_0x1f30('0x36'))){_0x4b2969['limit']=qs[_0x1f30('0x1e')](_0x48f62d[_0x1f30('0x32')]['limit']);_0x4b2969[_0x1f30('0x1c')]=qs[_0x1f30('0x1c')](_0x48f62d['query'][_0x1f30('0x1c')]);}_0x4b2969['order']=qs[_0x1f30('0x37')](_0x48f62d[_0x1f30('0x32')][_0x1f30('0x37')]);_0x4b2969[_0x1f30('0x38')]=qs[_0x1f30('0x33')](_[_0x1f30('0x39')](_0x48f62d[_0x1f30('0x32')],_0x1edb88['filters']),_0x4b7d50);if(_0x48f62d[_0x1f30('0x32')][_0x1f30('0x3a')]){_0x4b2969[_0x1f30('0x38')]=_[_0x1f30('0x3b')](_0x4b2969[_0x1f30('0x38')],{'$or':_[_0x1f30('0x2e')](_0x4b7d50,function(_0x125e46){if(_0x125e46[_0x1f30('0x30')]!==_0x1f30('0x3c')){var _0x5d909e={};_0x5d909e[_0x125e46[_0x1f30('0x2b')]]={'$like':'%'+_0x48f62d[_0x1f30('0x32')][_0x1f30('0x3a')]+'%'};return _0x5d909e;}})});}_0x4b2969=_[_0x1f30('0x3b')]({},_0x4b2969,_0x48f62d[_0x1f30('0x3d')]);var _0x11927b={'where':_0x4b2969[_0x1f30('0x38')]};return db['AnalyticCustomReport'][_0x1f30('0x1f')](_0x11927b)[_0x1f30('0x28')](function(_0x12e44c){_0x591ff6[_0x1f30('0x1f')]=_0x12e44c;if(_0x48f62d[_0x1f30('0x32')][_0x1f30('0x3e')]){_0x4b2969[_0x1f30('0x3f')]=[{'all':!![]}];}return db[_0x1f30('0x40')][_0x1f30('0x41')](_0x4b2969);})[_0x1f30('0x28')](function(_0xe3b1c){_0x591ff6[_0x1f30('0x42')]=_0xe3b1c;return _0x591ff6;})[_0x1f30('0x28')](respondWithFilteredResult(_0x6b9d8f,_0x4b2969))[_0x1f30('0x43')](handleError(_0x6b9d8f,null));};exports[_0x1f30('0x44')]=function(_0x8c0e7a,_0x2a160d){var _0x1a4fbd={'raw':![],'where':{'id':_0x8c0e7a[_0x1f30('0x45')]['id']}},_0x5e9900={};_0x5e9900[_0x1f30('0x31')]=_['keys'](db[_0x1f30('0x40')][_0x1f30('0x2f')]);_0x5e9900[_0x1f30('0x32')]=_['keys'](_0x8c0e7a[_0x1f30('0x32')]);_0x5e9900[_0x1f30('0x33')]=_['intersection'](_0x5e9900[_0x1f30('0x31')],_0x5e9900[_0x1f30('0x32')]);_0x1a4fbd[_0x1f30('0x34')]=_[_0x1f30('0x46')](_0x5e9900[_0x1f30('0x31')],qs[_0x1f30('0x35')](_0x8c0e7a['query'][_0x1f30('0x35')]));_0x1a4fbd['attributes']=_0x1a4fbd[_0x1f30('0x34')][_0x1f30('0x47')]?_0x1a4fbd[_0x1f30('0x34')]:_0x5e9900['model'];if(_0x8c0e7a[_0x1f30('0x32')][_0x1f30('0x3e')]){_0x1a4fbd[_0x1f30('0x3f')]=[{'all':!![]}];}_0x1a4fbd=_[_0x1f30('0x3b')]({},_0x1a4fbd,_0x8c0e7a[_0x1f30('0x3d')]);return db[_0x1f30('0x40')][_0x1f30('0x48')](_0x1a4fbd)[_0x1f30('0x28')](handleEntityNotFound(_0x2a160d,null))[_0x1f30('0x28')](respondWithResult(_0x2a160d,null))['catch'](handleError(_0x2a160d,null));};exports[_0x1f30('0x49')]=function(_0xe87449,_0x5e1a86){return db['AnalyticCustomReport'][_0x1f30('0x49')](_0xe87449[_0x1f30('0x4a')],{})['then'](function(_0x12f4f8){var _0x5b2a91=_0xe87449[_0x1f30('0x4b')][_0x1f30('0x25')]({'plain':!![]});if(!_0x5b2a91)throw new Error(_0x1f30('0x4c'));if(_0x5b2a91[_0x1f30('0x4d')]===_0x1f30('0x4b')){var _0x17eb0d=_0x12f4f8['get']({'plain':!![]});var _0x177e76=_0x1f30('0x4e');return db[_0x1f30('0x4f')][_0x1f30('0x48')]({'where':{'name':_0x177e76,'userProfileId':_0x5b2a91[_0x1f30('0x50')]},'raw':!![]})[_0x1f30('0x28')](function(_0x1d8872){if(_0x1d8872&&_0x1d8872[_0x1f30('0x51')]===0x0){return db[_0x1f30('0x27')]['create']({'name':_0x17eb0d[_0x1f30('0x2b')],'resourceId':_0x17eb0d['id'],'type':_0x1f30('0x26'),'sectionId':_0x1d8872['id']},{})[_0x1f30('0x28')](function(){return _0x12f4f8;});}else{return _0x12f4f8;}})[_0x1f30('0x43')](function(_0x19e118){logger[_0x1f30('0x2a')](_0x1f30('0x52'),_0x19e118);throw _0x19e118;});}return _0x12f4f8;})[_0x1f30('0x28')](respondWithResult(_0x5e1a86,0xc9))[_0x1f30('0x43')](handleError(_0x5e1a86,null));};exports[_0x1f30('0x23')]=function(_0x231f76,_0x21f4f1){if(_0x231f76['body']['id']){delete _0x231f76['body']['id'];}return db['AnalyticCustomReport'][_0x1f30('0x48')]({'where':{'id':_0x231f76[_0x1f30('0x45')]['id']}})['then'](handleEntityNotFound(_0x21f4f1,null))[_0x1f30('0x28')](saveUpdates(_0x231f76[_0x1f30('0x4a')],null))[_0x1f30('0x28')](respondWithResult(_0x21f4f1,null))[_0x1f30('0x43')](handleError(_0x21f4f1,null));};exports[_0x1f30('0x24')]=function(_0x340adf,_0x415e4d){return db['AnalyticCustomReport'][_0x1f30('0x48')]({'where':{'id':_0x340adf[_0x1f30('0x45')]['id']}})[_0x1f30('0x28')](handleEntityNotFound(_0x415e4d,null))['then'](removeEntity(_0x415e4d,null))[_0x1f30('0x43')](handleError(_0x415e4d,null));};exports['preview']=function(_0x4bc825,_0x248010){var _0x35dc01=0xa;var _0x2880b=[_0x1f30('0x53'),_0x1f30('0x54'),_0x1f30('0x55'),_0x1f30('0x56')];var _0x5203f6={'SUM':_0x1f30('0x57'),'COUNT':_0x1f30('0x58'),'COUNT DISTINCT':_0x1f30('0x59'),'MAX':_0x1f30('0x5a'),'MIN':_0x1f30('0x5b'),'AVG':_0x1f30('0x5c'),'GROUP_CONCAT':_0x1f30('0x5d'),'GROUP_CONCAT ASC':_0x1f30('0x5e'),'GROUP_CONCAT DESC':_0x1f30('0x5f')};var _0x3f53c9={'SEC_TO_TIME':_0x1f30('0x60'),'DATE':_0x1f30('0x61'),'HOUR':_0x1f30('0x62'),'ROUND':_0x1f30('0x63'),'UNIX_TIMESTAMP':_0x1f30('0x64')};var _0x55ff8c=function(_0x1e55fa){return!_[_0x1f30('0x65')]([_0x1f30('0x66'),_0x1f30('0x67'),_0x1f30('0x68'),_0x1f30('0x69')],_0x1e55fa);};var _0x1087e4=function(_0x1aa0ef){if(!_0x1aa0ef||!_0x1aa0ef['rules'][_0x1f30('0x47')]){return'';}for(var _0x21ae98='(',_0x21c339=0x0;_0x21c339<_0x1aa0ef[_0x1f30('0x6a')][_0x1f30('0x47')];_0x21c339+=0x1){_0x21c339>0x0&&(_0x21ae98+='\x20'+_0x1aa0ef['operator']+'\x20');_0x21ae98+=_0x1aa0ef[_0x1f30('0x6a')][_0x21c339][_0x1f30('0x6b')]?_0x1087e4(_0x1aa0ef['rules'][_0x21c339][_0x1f30('0x6b')]):_0x1aa0ef['rules'][_0x21c339][_0x1f30('0x6c')]+'\x20'+_0x1aa0ef[_0x1f30('0x6a')][_0x21c339]['condition']+(_0x55ff8c(_0x1aa0ef[_0x1f30('0x6a')][_0x21c339][_0x1f30('0x6d')])?'\x20'+_0x1aa0ef[_0x1f30('0x6a')][_0x21c339][_0x1f30('0x6e')]:'');}return _0x21ae98+')';};var _0x5e254f={'where':{'id':_0x4bc825[_0x1f30('0x45')]['id']}},_0x3f3f59,_0x17e9e7,_0x362809,_0x4dd187,_0x196975;_0x5e254f=_[_0x1f30('0x3b')]({},_0x5e254f,_0x4bc825[_0x1f30('0x3d')]);return db['AnalyticCustomReport'][_0x1f30('0x48')](_0x5e254f)[_0x1f30('0x28')](function(_0x1784f9){if(_0x1784f9){_0x3f3f59=_0x1784f9;return _0x1784f9[_0x1f30('0x6f')]();}return null;})[_0x1f30('0x28')](function(_0x4c136f){if(_0x4c136f){if(!_0x4c136f[_0x1f30('0x47')]){throw new db[(_0x1f30('0x70'))][(_0x1f30('0x71'))](_0x1f30('0x72'),0x193);}_0x17e9e7=_0x4c136f;return db[_0x1f30('0x73')][_0x1f30('0x41')]({'raw':!![]});}return null;})[_0x1f30('0x28')](function(_0x5570a4){if(_0x5570a4){_0x362809=_[_0x1f30('0x74')](_0x5570a4,'id');var _0xe475fe;var _0x4a6b26=squel[_0x1f30('0x75')]();_0x4a6b26[_0x1f30('0x76')](_0x3f3f59[_0x1f30('0x77')]);for(var _0x180049=0x0;_0x180049<_0x17e9e7[_0x1f30('0x47')];_0x180049+=0x1){_0xe475fe=_0x17e9e7[_0x180049]['MetricId']?_0x362809[_0x17e9e7[_0x180049]['MetricId']][_0x1f30('0x78')]:_0x17e9e7[_0x180049][_0x1f30('0x6c')];_0xe475fe=_0x17e9e7[_0x180049][_0x1f30('0x79')]?_[_0x1f30('0x7a')](_0x5203f6[_0x17e9e7[_0x180049][_0x1f30('0x79')]],'%s',_0xe475fe):_0xe475fe;_0xe475fe=_0x17e9e7[_0x180049][_0x1f30('0x7b')]?_[_0x1f30('0x7a')](_0x3f53c9[_0x17e9e7[_0x180049]['format']],'%s',_0xe475fe):_0xe475fe;if(_0x17e9e7[_0x180049][_0x1f30('0x7c')]){_0x4a6b26[_0x1f30('0x6b')](_0xe475fe);}_0x17e9e7[_0x180049][_0x1f30('0x7d')]&&_0x4a6b26[_0x1f30('0x7e')](_0xe475fe,_0x17e9e7[_0x180049][_0x1f30('0x7d')]===_0x1f30('0x7f')?![]:!![]);_0x4a6b26[_0x1f30('0x6c')](_0xe475fe,_0x17e9e7[_0x180049][_0x1f30('0x80')]||_0xe475fe);}if(_0x3f3f59[_0x1f30('0x81')]){_0x3f3f59[_0x1f30('0x81')]=JSON[_0x1f30('0x82')](_0x3f3f59[_0x1f30('0x81')]);for(var _0x192282=0x0;_0x192282<_0x3f3f59['joins'][_0x1f30('0x47')];_0x192282+=0x1){if(_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x30')]&&_[_0x1f30('0x65')](_0x2880b,_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x30')])&&_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x83')]&&_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x84')]&&_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x85')]){_0x4a6b26[_0x3f3f59[_0x1f30('0x81')][_0x192282]['type']](_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x84')],null,util[_0x1f30('0x7b')]('%s.%s\x20=\x20%s.%s',_0x3f3f59[_0x1f30('0x77')],_0x3f3f59['joins'][_0x192282]['parentKey'],_0x3f3f59[_0x1f30('0x81')][_0x192282][_0x1f30('0x84')],_0x3f3f59['joins'][_0x192282]['foreignKey']));}}}if(_0x3f3f59[_0x1f30('0x86')]){_0x3f3f59[_0x1f30('0x86')]=JSON[_0x1f30('0x82')](_0x3f3f59[_0x1f30('0x86')]);_0x4a6b26[_0x1f30('0x38')](_0x1087e4(_0x3f3f59['conditions'][_0x1f30('0x6b')]));}_0x196975=_0x4a6b26[_0x1f30('0x87')]();_0x4a6b26[_0x1f30('0x1e')](_0x35dc01);_0x4a6b26[_0x1f30('0x1c')](0x0);logger[_0x1f30('0x88')](_0x1f30('0x89'),_0x4a6b26['toString']());return dbH['sequelize'][_0x1f30('0x32')](_0x4a6b26['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x1f30('0x8a')]});}})['then'](respondWithResult(_0x248010,null))[_0x1f30('0x43')](handleError(_0x248010,null));};function runReport(_0x276f3b,_0x2cd775,_0x119f60){var _0x4e20ac=_0x2cd775[_0x1f30('0x2b')];var _0x139ad5=0xa;var _0x270865=[_0x1f30('0x53'),_0x1f30('0x54'),_0x1f30('0x55'),_0x1f30('0x56')];var _0x592867={'SUM':_0x1f30('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1f30('0x59'),'MAX':_0x1f30('0x5a'),'MIN':_0x1f30('0x5b'),'AVG':_0x1f30('0x5c'),'GROUP_CONCAT':_0x1f30('0x5d'),'GROUP_CONCAT ASC':_0x1f30('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4cc512={'SEC_TO_TIME':_0x1f30('0x60'),'DATE':_0x1f30('0x61'),'HOUR':_0x1f30('0x62'),'ROUND':_0x1f30('0x63'),'UNIX_TIMESTAMP':_0x1f30('0x64')};var _0x12b294=function(_0x329c73){return!_[_0x1f30('0x65')]([_0x1f30('0x66'),_0x1f30('0x67'),_0x1f30('0x68'),_0x1f30('0x69')],_0x329c73);};var _0x1d30cf=function(_0x300518){if(!_0x300518||!_0x300518[_0x1f30('0x6a')]['length']){return'';}for(var _0x5787d4='(',_0x2fe18a=0x0;_0x2fe18a<_0x300518[_0x1f30('0x6a')][_0x1f30('0x47')];_0x2fe18a+=0x1){_0x2fe18a>0x0&&(_0x5787d4+='\x20'+_0x300518[_0x1f30('0x8b')]+'\x20');_0x5787d4+=_0x300518['rules'][_0x2fe18a][_0x1f30('0x6b')]?_0x1d30cf(_0x300518['rules'][_0x2fe18a][_0x1f30('0x6b')]):_0x300518[_0x1f30('0x6a')][_0x2fe18a][_0x1f30('0x6c')]+'\x20'+_0x300518[_0x1f30('0x6a')][_0x2fe18a][_0x1f30('0x6d')]+(_0x12b294(_0x300518[_0x1f30('0x6a')][_0x2fe18a][_0x1f30('0x6d')])?'\x20'+_0x300518[_0x1f30('0x6a')][_0x2fe18a][_0x1f30('0x6e')]:'');}return _0x5787d4+')';};var _0x4bf8c2={'where':{'id':_0x276f3b['id']}},_0x16e5ac,_0x3df078,_0x56d074,_0xafca43,_0x158a44;_0x4bf8c2=_['merge']({},_0x4bf8c2,_0x119f60);return db[_0x1f30('0x40')]['find'](_0x4bf8c2)[_0x1f30('0x28')](function(_0x8aea4e){if(_0x8aea4e){_0x16e5ac=_0x8aea4e;return _0x8aea4e[_0x1f30('0x6f')]();}return null;})['then'](function(_0x23a81a){if(_0x23a81a){if(!_0x23a81a[_0x1f30('0x47')]){throw new db[(_0x1f30('0x70'))][(_0x1f30('0x71'))](_0x1f30('0x72'),0x193);}_0x3df078=_0x23a81a;return db[_0x1f30('0x73')][_0x1f30('0x41')]({'raw':!![]});}return null;})[_0x1f30('0x28')](function(_0x12fcca){if(_0x12fcca){_0x56d074=_[_0x1f30('0x74')](_0x12fcca,'id');var _0x3700e1;var _0x3aa02a=squel['select']();_0x3aa02a[_0x1f30('0x76')](_0x16e5ac[_0x1f30('0x77')]);for(var _0x25a4b3=0x0;_0x25a4b3<_0x3df078[_0x1f30('0x47')];_0x25a4b3+=0x1){_0x3700e1=_0x3df078[_0x25a4b3][_0x1f30('0x8c')]?_0x56d074[_0x3df078[_0x25a4b3][_0x1f30('0x8c')]]['metric']:_0x3df078[_0x25a4b3]['field'];_0x3700e1=_0x3df078[_0x25a4b3][_0x1f30('0x79')]?_[_0x1f30('0x7a')](_0x592867[_0x3df078[_0x25a4b3][_0x1f30('0x79')]],'%s',_0x3700e1):_0x3700e1;_0x3700e1=_0x3df078[_0x25a4b3][_0x1f30('0x7b')]?_['replace'](_0x4cc512[_0x3df078[_0x25a4b3][_0x1f30('0x7b')]],'%s',_0x3700e1):_0x3700e1;if(_0x3df078[_0x25a4b3][_0x1f30('0x7c')]){_0x3aa02a[_0x1f30('0x6b')](_0x3700e1);}_0x3df078[_0x25a4b3]['orderBy']&&_0x3aa02a[_0x1f30('0x7e')](_0x3700e1,_0x3df078[_0x25a4b3][_0x1f30('0x7d')]===_0x1f30('0x7f')?![]:!![]);_0x3aa02a[_0x1f30('0x6c')](_0x3700e1,_0x3df078[_0x25a4b3][_0x1f30('0x80')]||_0x3700e1);}if(_0x16e5ac[_0x1f30('0x81')]){_0x16e5ac[_0x1f30('0x81')]=JSON[_0x1f30('0x82')](_0x16e5ac[_0x1f30('0x81')]);for(var _0x241977=0x0;_0x241977<_0x16e5ac[_0x1f30('0x81')]['length'];_0x241977+=0x1){if(_0x16e5ac[_0x1f30('0x81')][_0x241977][_0x1f30('0x30')]&&_[_0x1f30('0x65')](_0x270865,_0x16e5ac['joins'][_0x241977][_0x1f30('0x30')])&&_0x16e5ac['joins'][_0x241977][_0x1f30('0x83')]&&_0x16e5ac[_0x1f30('0x81')][_0x241977][_0x1f30('0x84')]&&_0x16e5ac[_0x1f30('0x81')][_0x241977]['foreignKey']){_0x3aa02a[_0x16e5ac['joins'][_0x241977][_0x1f30('0x30')]](_0x16e5ac[_0x1f30('0x81')][_0x241977][_0x1f30('0x84')],null,util[_0x1f30('0x7b')](_0x1f30('0x8d'),_0x16e5ac[_0x1f30('0x77')],_0x16e5ac[_0x1f30('0x81')][_0x241977][_0x1f30('0x83')],_0x16e5ac['joins'][_0x241977][_0x1f30('0x84')],_0x16e5ac[_0x1f30('0x81')][_0x241977][_0x1f30('0x85')]));}}}if(_0x16e5ac[_0x1f30('0x86')]){_0x16e5ac['conditions']=JSON[_0x1f30('0x82')](_0x16e5ac[_0x1f30('0x86')]);_0x3aa02a[_0x1f30('0x38')](_0x1d30cf(_0x16e5ac[_0x1f30('0x86')]['group']));}_0x158a44=_0x3aa02a[_0x1f30('0x87')]();_0x3aa02a[_0x1f30('0x1e')](_0x139ad5);_0x3aa02a[_0x1f30('0x1c')](0x0);return;}})[_0x1f30('0x28')](function(){if(_0x2cd775[_0x1f30('0x8e')]===_0x1f30('0x8f')){return null;}var _0x48e78a=_[_0x1f30('0x3b')](_0x2cd775,{'name':_0x2cd775['fullPath']||_0x2cd775[_0x1f30('0x2b')]||_0x16e5ac[_0x1f30('0x2b')],'basename':_0x4e20ac,'savename':util['format'](_0x1f30('0x90'),_0x2cd775[_0x1f30('0x2b')]||_0x16e5ac[_0x1f30('0x2b')],require(_0x1f30('0x91'))[_0x1f30('0x92')](0x4),_0x2cd775[_0x1f30('0x8e')]||_0x1f30('0x93')),'reportId':_0x16e5ac['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x1f30('0x49')](_0x48e78a,{'raw':!![]});})[_0x1f30('0x28')](function(_0x2e0454){if(_0x16e5ac[_0x1f30('0x77')]===_0x1f30('0x94')){_0x158a44['where'](_0x16e5ac[_0x1f30('0x77')]+_0x1f30('0x95'),_0x2cd775['startDate'],_0x2cd775[_0x1f30('0x96')]);}else{_0x158a44['where'](_0x16e5ac['table']+_0x1f30('0x97'),_0x2cd775['startDate'],_0x2cd775[_0x1f30('0x96')]);}if(_0x2e0454){logger[_0x1f30('0x98')](_0x1f30('0x99'),_0x158a44[_0x1f30('0x9a')]());require('child_process')[_0x1f30('0x9b')](path[_0x1f30('0x53')](__dirname,_0x1f30('0x9c'),_0x2e0454[_0x1f30('0x8e')]),[_0x2e0454['id'],_0x158a44['toString'](),path[_0x1f30('0x53')](__dirname,'../../files/reports',_0x2e0454['savename']),_0x4e20ac]);return _0x2e0454;}else{var _0x1ac10c=squel[_0x1f30('0x75')]();_0x1ac10c[_0x1f30('0x76')]('('+_0x158a44[_0x1f30('0x9a')]()+')',_0x1f30('0x9d'));_0x1ac10c[_0x1f30('0x6c')](_0x1f30('0x9e'),_0x1f30('0x1f'));_0x158a44[_0x1f30('0x1e')](_0x2cd775[_0x1f30('0x1e')]||_0x139ad5);_0x158a44[_0x1f30('0x1c')](_0x2cd775[_0x1f30('0x1c')]||0x0);return dbH[_0x1f30('0x9f')]['query'](_0x1ac10c[_0x1f30('0x9a')](),{'type':dbH[_0x1f30('0x9f')][_0x1f30('0xa0')]['SELECT']})[_0x1f30('0x28')](function(_0x545ed1){if(!_0x545ed1[_0x1f30('0x47')]){_0xafca43=0x0;}else{_0xafca43=_0x545ed1[0x0][_0x1f30('0x1f')]||0x0;}return dbH['sequelize'][_0x1f30('0x32')](_0x158a44[_0x1f30('0x9a')](),{'type':dbH[_0x1f30('0x9f')][_0x1f30('0xa0')][_0x1f30('0x8a')]});})['then'](function(_0x43d1db){return{'rows':_0x43d1db||[],'count':_0xafca43};});}});}exports[_0x1f30('0xa1')]=function(_0x275d7d,_0x1d42b7){return runReport(_0x275d7d[_0x1f30('0x45')],_0x275d7d[_0x1f30('0x32')],_0x275d7d[_0x1f30('0x3d')])['then'](respondWithResult(_0x1d42b7,null))['catch'](handleError(_0x1d42b7,null));};exports[_0x1f30('0xa2')]=runReport;exports[_0x1f30('0x32')]=function(_0x10a1d0,_0x3ad1d2){var _0x159c18=0xa;var _0x1d5ed0=[_0x1f30('0x53'),'left_join',_0x1f30('0x55'),_0x1f30('0x56')];var _0x1438ff={'SUM':_0x1f30('0x57'),'COUNT':_0x1f30('0x58'),'COUNT DISTINCT':_0x1f30('0x59'),'MAX':_0x1f30('0x5a'),'MIN':'MIN(%s)','AVG':_0x1f30('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1f30('0x5e'),'GROUP_CONCAT DESC':_0x1f30('0x5f')};var _0x4e6210={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x1f30('0x63'),'UNIX_TIMESTAMP':_0x1f30('0x64')};var _0x2b7059=function(_0x4b3c49){return!_[_0x1f30('0x65')]([_0x1f30('0x66'),_0x1f30('0x67'),'IS\x20EMPTY',_0x1f30('0x69')],_0x4b3c49);};var _0x4bd7ff=function(_0x43b0e3){if(!_0x43b0e3||!_0x43b0e3['rules'][_0x1f30('0x47')]){return'';}for(var _0x4114bb='(',_0x202f0c=0x0;_0x202f0c<_0x43b0e3[_0x1f30('0x6a')][_0x1f30('0x47')];_0x202f0c+=0x1){_0x202f0c>0x0&&(_0x4114bb+='\x20'+_0x43b0e3[_0x1f30('0x8b')]+'\x20');_0x4114bb+=_0x43b0e3[_0x1f30('0x6a')][_0x202f0c][_0x1f30('0x6b')]?_0x4bd7ff(_0x43b0e3[_0x1f30('0x6a')][_0x202f0c][_0x1f30('0x6b')]):_0x43b0e3[_0x1f30('0x6a')][_0x202f0c]['field']+'\x20'+_0x43b0e3[_0x1f30('0x6a')][_0x202f0c][_0x1f30('0x6d')]+(_0x2b7059(_0x43b0e3[_0x1f30('0x6a')][_0x202f0c][_0x1f30('0x6d')])?'\x20'+_0x43b0e3[_0x1f30('0x6a')][_0x202f0c][_0x1f30('0x6e')]:'');}return _0x4114bb+')';};var _0x48d1ac={'where':{'id':_0x10a1d0['params']['id']}},_0x56f0ab,_0x531bfe,_0x32fad4,_0x2fe0e3,_0x513470;_0x48d1ac=_['merge']({},_0x48d1ac,_0x10a1d0['options']);return db[_0x1f30('0x40')][_0x1f30('0x48')](_0x48d1ac)['then'](function(_0x5d332d){if(_0x5d332d){_0x56f0ab=_0x5d332d;return _0x5d332d[_0x1f30('0x6f')]();}return null;})[_0x1f30('0x28')](function(_0x29c982){if(_0x29c982){if(!_0x29c982['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x1f30('0x72'),0x193);}_0x531bfe=_0x29c982;return db[_0x1f30('0x73')]['findAll']({'raw':!![]});}return null;})[_0x1f30('0x28')](function(_0x5bedb1){if(_0x5bedb1){_0x32fad4=_[_0x1f30('0x74')](_0x5bedb1,'id');var _0x1fba01;var _0x2cfc96=squel[_0x1f30('0x75')]();_0x2cfc96[_0x1f30('0x76')](_0x56f0ab[_0x1f30('0x77')]);for(var _0x394ebe=0x0;_0x394ebe<_0x531bfe[_0x1f30('0x47')];_0x394ebe+=0x1){_0x1fba01=_0x531bfe[_0x394ebe]['MetricId']?_0x32fad4[_0x531bfe[_0x394ebe][_0x1f30('0x8c')]][_0x1f30('0x78')]:_0x531bfe[_0x394ebe][_0x1f30('0x6c')];_0x1fba01=_0x531bfe[_0x394ebe]['function']?_['replace'](_0x1438ff[_0x531bfe[_0x394ebe]['function']],'%s',_0x1fba01):_0x1fba01;_0x1fba01=_0x531bfe[_0x394ebe][_0x1f30('0x7b')]?_['replace'](_0x4e6210[_0x531bfe[_0x394ebe][_0x1f30('0x7b')]],'%s',_0x1fba01):_0x1fba01;if(_0x531bfe[_0x394ebe]['groupBy']){_0x2cfc96[_0x1f30('0x6b')](_0x1fba01);}_0x531bfe[_0x394ebe][_0x1f30('0x7d')]&&_0x2cfc96[_0x1f30('0x7e')](_0x1fba01,_0x531bfe[_0x394ebe][_0x1f30('0x7d')]===_0x1f30('0x7f')?![]:!![]);_0x2cfc96[_0x1f30('0x6c')](_0x1fba01,_0x531bfe[_0x394ebe][_0x1f30('0x80')]||_0x1fba01);}if(_0x56f0ab[_0x1f30('0x81')]){_0x56f0ab['joins']=JSON[_0x1f30('0x82')](_0x56f0ab[_0x1f30('0x81')]);for(var _0x17cdb0=0x0;_0x17cdb0<_0x56f0ab[_0x1f30('0x81')]['length'];_0x17cdb0+=0x1){if(_0x56f0ab['joins'][_0x17cdb0][_0x1f30('0x30')]&&_['includes'](_0x1d5ed0,_0x56f0ab[_0x1f30('0x81')][_0x17cdb0]['type'])&&_0x56f0ab[_0x1f30('0x81')][_0x17cdb0][_0x1f30('0x83')]&&_0x56f0ab[_0x1f30('0x81')][_0x17cdb0][_0x1f30('0x84')]&&_0x56f0ab['joins'][_0x17cdb0][_0x1f30('0x85')]){_0x2cfc96[_0x56f0ab['joins'][_0x17cdb0][_0x1f30('0x30')]](_0x56f0ab[_0x1f30('0x81')][_0x17cdb0][_0x1f30('0x84')],null,util[_0x1f30('0x7b')](_0x1f30('0x8d'),_0x56f0ab['table'],_0x56f0ab[_0x1f30('0x81')][_0x17cdb0]['parentKey'],_0x56f0ab[_0x1f30('0x81')][_0x17cdb0][_0x1f30('0x84')],_0x56f0ab[_0x1f30('0x81')][_0x17cdb0][_0x1f30('0x85')]));}}}if(_0x56f0ab[_0x1f30('0x86')]){_0x56f0ab[_0x1f30('0x86')]=JSON[_0x1f30('0x82')](_0x56f0ab[_0x1f30('0x86')]);_0x2cfc96[_0x1f30('0x38')](_0x4bd7ff(_0x56f0ab[_0x1f30('0x86')][_0x1f30('0x6b')]));}_0x513470=_0x2cfc96[_0x1f30('0x87')]();_0x2cfc96[_0x1f30('0x1e')](_0x159c18);_0x2cfc96['offset'](0x0);logger['debug'](_0x1f30('0x89'),_0x2cfc96['toString']());return dbH['sequelize'][_0x1f30('0x32')](_0x2cfc96[_0x1f30('0x9a')](),{'type':dbH[_0x1f30('0x9f')][_0x1f30('0xa0')][_0x1f30('0x8a')]});}})['then'](function(){return{'sql':_0x513470[_0x1f30('0x9a')]()};})[_0x1f30('0x28')](respondWithResult(_0x3ad1d2,null))[_0x1f30('0x43')](handleError(_0x3ad1d2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4c3ac90..932c789 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 _0x2e37=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api'];(function(_0x122828,_0x2823a0){var _0x321e2d=function(_0x3bd793){while(--_0x3bd793){_0x122828['push'](_0x122828['shift']());}};_0x321e2d(++_0x2823a0);}(_0x2e37,0x133));var _0x72e3=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x2e37[_0x5ad220];return _0xdec77d;};'use strict';var _=require('lodash');var util=require(_0x72e3('0x0'));var logger=require(_0x72e3('0x1'))(_0x72e3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x72e3('0x3'));var rimraf=require(_0x72e3('0x4'));var config=require('../../config/environment');var attributes=require(_0x72e3('0x5'));module[_0x72e3('0x6')]=function(_0x5d303f,_0x5ba9c5){return _0x5d303f[_0x72e3('0x7')](_0x72e3('0x8'),attributes,{'tableName':_0x72e3('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38f2=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger'];(function(_0xdc9e8c,_0x49d700){var _0x32d3f2=function(_0x2283d2){while(--_0x2283d2){_0xdc9e8c['push'](_0xdc9e8c['shift']());}};_0x32d3f2(++_0x49d700);}(_0x38f2,0x16a));var _0x238f=function(_0x391518,_0x5471bb){_0x391518=_0x391518-0x0;var _0x37b05b=_0x38f2[_0x391518];return _0x37b05b;};'use strict';var _=require(_0x238f('0x0'));var util=require('util');var logger=require(_0x238f('0x1'))(_0x238f('0x2'));var moment=require(_0x238f('0x3'));var BPromise=require(_0x238f('0x4'));var rp=require(_0x238f('0x5'));var fs=require('fs');var path=require(_0x238f('0x6'));var rimraf=require('rimraf');var config=require(_0x238f('0x7'));var attributes=require(_0x238f('0x8'));module[_0x238f('0x9')]=function(_0x43b39f,_0x44a5e1){return _0x43b39f[_0x238f('0xa')](_0x238f('0xb'),attributes,{'tableName':_0x238f('0xc'),'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 485b52a..d1827e1 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 _0x4159=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','AnalyticCustomReport,\x20%s,\x20%s','error','message','result','util','moment','bluebird'];(function(_0x33954c,_0x23dd23){var _0x144cbb=function(_0x28f678){while(--_0x28f678){_0x33954c['push'](_0x33954c['shift']());}};_0x144cbb(++_0x23dd23);}(_0x4159,0x166));var _0x9415=function(_0x21dc45,_0x12c9b3){_0x21dc45=_0x21dc45-0x0;var _0xd88d5e=_0x4159[_0x21dc45];return _0xd88d5e;};'use strict';var _=require('lodash');var util=require(_0x9415('0x0'));var moment=require(_0x9415('0x1'));var BPromise=require(_0x9415('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9415('0x3'));var db=require(_0x9415('0x4'))['db'];var utils=require(_0x9415('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9415('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9415('0x7')][_0x9415('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf02002,_0x32e050,_0x49f6ed){return new BPromise(function(_0x701eb7,_0x2c4746){return client['request'](_0xf02002,_0x49f6ed)['then'](function(_0x5c5210){logger[_0x9415('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x32e050,_0x9415('0xa'));logger[_0x9415('0xb')](_0x9415('0xc'),_0x32e050,_0x9415('0xa'),JSON[_0x9415('0xd')](_0x5c5210));if(_0x5c5210['error']){if(_0x5c5210['error'][_0x9415('0xe')]===0x1f4){logger['error'](_0x9415('0xf'),_0x32e050,_0x5c5210[_0x9415('0x10')][_0x9415('0x11')]);return _0x2c4746(_0x5c5210[_0x9415('0x10')][_0x9415('0x11')]);}logger[_0x9415('0x10')](_0x9415('0xf'),_0x32e050,_0x5c5210[_0x9415('0x10')][_0x9415('0x11')]);return _0x701eb7(_0x5c5210[_0x9415('0x10')][_0x9415('0x11')]);}else{logger[_0x9415('0x9')](_0x9415('0xf'),_0x32e050,'request\x20sent');_0x701eb7(_0x5c5210[_0x9415('0x12')][_0x9415('0x11')]);}})['catch'](function(_0xaa49e8){logger[_0x9415('0x10')](_0x9415('0xf'),_0x32e050,_0xaa49e8);_0x2c4746(_0xaa49e8);});});} \ No newline at end of file +var _0xdc3a=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x11866c,_0x3100dc){var _0x239bce=function(_0x4f6196){while(--_0x4f6196){_0x11866c['push'](_0x11866c['shift']());}};_0x239bce(++_0x3100dc);}(_0xdc3a,0x15c));var _0xadc3=function(_0x49a6c2,_0x4a7ec5){_0x49a6c2=_0x49a6c2-0x0;var _0x1b05dc=_0xdc3a[_0x49a6c2];return _0x1b05dc;};'use strict';var _=require(_0xadc3('0x0'));var util=require('util');var moment=require(_0xadc3('0x1'));var BPromise=require(_0xadc3('0x2'));var rs=require(_0xadc3('0x3'));var fs=require('fs');var Redis=require(_0xadc3('0x4'));var db=require(_0xadc3('0x5'))['db'];var utils=require(_0xadc3('0x6'));var logger=require(_0xadc3('0x7'))(_0xadc3('0x8'));var config=require(_0xadc3('0x9'));var jayson=require(_0xadc3('0xa'));var client=jayson['client'][_0xadc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194086,_0x503dd0,_0x1533c1){return new BPromise(function(_0x37f9d8,_0x1f128c){return client[_0xadc3('0xc')](_0x194086,_0x1533c1)[_0xadc3('0xd')](function(_0x3c10a8){logger[_0xadc3('0xe')](_0xadc3('0xf'),_0x503dd0,_0xadc3('0x10'));logger[_0xadc3('0x11')](_0xadc3('0x12'),_0x503dd0,'request\x20sent',JSON[_0xadc3('0x13')](_0x3c10a8));if(_0x3c10a8['error']){if(_0x3c10a8[_0xadc3('0x14')][_0xadc3('0x15')]===0x1f4){logger[_0xadc3('0x14')](_0xadc3('0xf'),_0x503dd0,_0x3c10a8[_0xadc3('0x14')][_0xadc3('0x16')]);return _0x1f128c(_0x3c10a8[_0xadc3('0x14')][_0xadc3('0x16')]);}logger[_0xadc3('0x14')](_0xadc3('0xf'),_0x503dd0,_0x3c10a8[_0xadc3('0x14')][_0xadc3('0x16')]);return _0x37f9d8(_0x3c10a8['error']['message']);}else{logger[_0xadc3('0xe')](_0xadc3('0xf'),_0x503dd0,'request\x20sent');_0x37f9d8(_0x3c10a8[_0xadc3('0x17')][_0xadc3('0x16')]);}})['catch'](function(_0x947426){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x503dd0,_0x947426);_0x1f128c(_0x947426);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 8ea604b..15e0c98 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 _0x8e72=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','post'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x8e72,0xdd));var _0x28e7=function(_0x3b856e,_0x4b558a){_0x3b856e=_0x3b856e-0x0;var _0x63012d=_0x8e72[_0x3b856e];return _0x63012d;};'use strict';var multer=require(_0x28e7('0x0'));var util=require(_0x28e7('0x1'));var path=require(_0x28e7('0x2'));var timeout=require(_0x28e7('0x3'));var express=require(_0x28e7('0x4'));var router=express[_0x28e7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x28e7('0x6'));var config=require(_0x28e7('0x7'));var controller=require(_0x28e7('0x8'));router[_0x28e7('0x9')]('/',auth[_0x28e7('0xa')](),controller[_0x28e7('0xb')]);router[_0x28e7('0x9')](_0x28e7('0xc'),auth[_0x28e7('0xa')](),controller['show']);router['get'](_0x28e7('0xd'),auth['isAuthenticated'](),controller[_0x28e7('0xe')]);router['get'](_0x28e7('0xf'),auth[_0x28e7('0xa')](),controller[_0x28e7('0x10')]);router[_0x28e7('0x9')](_0x28e7('0x11'),auth[_0x28e7('0xa')](),controller['query']);router[_0x28e7('0x12')]('/',auth[_0x28e7('0xa')](),controller[_0x28e7('0x13')]);router['put'](_0x28e7('0xc'),auth[_0x28e7('0xa')](),controller[_0x28e7('0x14')]);router[_0x28e7('0x15')](_0x28e7('0xc'),auth[_0x28e7('0xa')](),controller[_0x28e7('0x16')]);module[_0x28e7('0x17')]=router; \ No newline at end of file +var _0x07b8=['isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run','run','create','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x30435b,_0x54a8ba){var _0x42c731=function(_0xf429a7){while(--_0xf429a7){_0x30435b['push'](_0x30435b['shift']());}};_0x42c731(++_0x54a8ba);}(_0x07b8,0xca));var _0x807b=function(_0x1deba0,_0x45a0d2){_0x1deba0=_0x1deba0-0x0;var _0x2a8d36=_0x07b8[_0x1deba0];return _0x2a8d36;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x807b('0x0'));var timeout=require(_0x807b('0x1'));var express=require(_0x807b('0x2'));var router=express[_0x807b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x807b('0x4'));var interaction=require(_0x807b('0x5'));var config=require(_0x807b('0x6'));var controller=require(_0x807b('0x7'));router['get']('/',auth[_0x807b('0x8')](),controller[_0x807b('0x9')]);router['get'](_0x807b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x807b('0xb')](_0x807b('0xc'),auth[_0x807b('0x8')](),controller[_0x807b('0xd')]);router[_0x807b('0xb')](_0x807b('0xe'),auth[_0x807b('0x8')](),controller[_0x807b('0xf')]);router[_0x807b('0xb')]('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x807b('0x8')](),controller[_0x807b('0x10')]);router[_0x807b('0x11')](_0x807b('0xa'),auth[_0x807b('0x8')](),controller[_0x807b('0x12')]);router['delete']('/:id',auth[_0x807b('0x8')](),controller[_0x807b('0x13')]);module[_0x807b('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 31148f8..20b7e27 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x5df8f2,_0x9b6c5d){var _0x5b05ee=function(_0x1565cf){while(--_0x1565cf){_0x5df8f2['push'](_0x5df8f2['shift']());}};_0x5b05ee(++_0x9b6c5d);}(_0x7c09,0x102));var _0x97c0=function(_0x10d806,_0x45c562){_0x10d806=_0x10d806-0x0;var _0x1d5e8d=_0x7c09[_0x10d806];return _0x1d5e8d;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x7da7[_0x5cbd7b];return _0x3fdfb8;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'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 66a1e87..663266a 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x4570a3,_0x4f8d6e){var _0x1ddbd3=function(_0xff53fd){while(--_0xff53fd){_0x4570a3['push'](_0x4570a3['shift']());}};_0x1ddbd3(++_0x4f8d6e);}(_0xba34,0x119));var _0x4ba3=function(_0x43eb62,_0xab8ed3){_0x43eb62=_0x43eb62-0x0;var _0x2830eb=_0xba34[_0x43eb62];return _0x2830eb;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file +var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x1f1624,_0x31e9d2){var _0x17aa21=function(_0x4c3243){while(--_0x4c3243){_0x1f1624['push'](_0x1f1624['shift']());}};_0x17aa21(++_0x31e9d2);}(_0xf494,0x1c6));var _0x4f49=function(_0xcab4db,_0x1df7c0){_0xcab4db=_0xcab4db-0x0;var _0x19b3b2=_0xf494[_0xcab4db];return _0x19b3b2;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 9534049..382045c 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 _0x3356=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x2b54bb,_0x36db1b){var _0x21b7e2=function(_0x3f3f87){while(--_0x3f3f87){_0x2b54bb['push'](_0x2b54bb['shift']());}};_0x21b7e2(++_0x36db1b);}(_0x3356,0x8c));var _0x6335=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3356[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6335('0x0'));var util=require(_0x6335('0x1'));var logger=require(_0x6335('0x2'))(_0x6335('0x3'));var moment=require('moment');var BPromise=require(_0x6335('0x4'));var rp=require(_0x6335('0x5'));var fs=require('fs');var path=require(_0x6335('0x6'));var rimraf=require(_0x6335('0x7'));var config=require(_0x6335('0x8'));var attributes=require(_0x6335('0x9'));module[_0x6335('0xa')]=function(_0xa6b48b,_0x55c014){return _0xa6b48b['define'](_0x6335('0xb'),attributes,{'tableName':_0x6335('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e76=['util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3e76,0x1a1));var _0x63e7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3e76[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x63e7('0x0'));var util=require(_0x63e7('0x1'));var logger=require(_0x63e7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x63e7('0x3'));var rp=require(_0x63e7('0x4'));var fs=require('fs');var path=require(_0x63e7('0x5'));var rimraf=require(_0x63e7('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x63e7('0x7')]=function(_0x3a9aac,_0x106b4f){return _0x3a9aac[_0x63e7('0x8')](_0x63e7('0x9'),attributes,{'tableName':_0x63e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 33ba60e..d65ecac 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 _0xac16=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x354a96,_0x9a966e){var _0x3f2fa1=function(_0x5510db){while(--_0x5510db){_0x354a96['push'](_0x354a96['shift']());}};_0x3f2fa1(++_0x9a966e);}(_0xac16,0xc0));var _0x6ac1=function(_0x5c8a4d,_0x327b17){_0x5c8a4d=_0x5c8a4d-0x0;var _0x1f0d0a=_0xac16[_0x5c8a4d];return _0x1f0d0a;};'use strict';var _=require(_0x6ac1('0x0'));var util=require(_0x6ac1('0x1'));var moment=require(_0x6ac1('0x2'));var BPromise=require(_0x6ac1('0x3'));var rs=require(_0x6ac1('0x4'));var fs=require('fs');var Redis=require(_0x6ac1('0x5'));var db=require(_0x6ac1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ac1('0x7'));var jayson=require(_0x6ac1('0x8'));var client=jayson[_0x6ac1('0x9')][_0x6ac1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26af4a,_0x34e7cb,_0x149cb0){return new BPromise(function(_0x18a19a,_0x1e965b){return client[_0x6ac1('0xb')](_0x26af4a,_0x149cb0)['then'](function(_0x5ca77a){logger[_0x6ac1('0xc')](_0x6ac1('0xd'),_0x34e7cb,_0x6ac1('0xe'));logger[_0x6ac1('0xf')](_0x6ac1('0x10'),_0x34e7cb,'request\x20sent',JSON[_0x6ac1('0x11')](_0x5ca77a));if(_0x5ca77a[_0x6ac1('0x12')]){if(_0x5ca77a[_0x6ac1('0x12')][_0x6ac1('0x13')]===0x1f4){logger[_0x6ac1('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34e7cb,_0x5ca77a[_0x6ac1('0x12')][_0x6ac1('0x14')]);return _0x1e965b(_0x5ca77a[_0x6ac1('0x12')][_0x6ac1('0x14')]);}logger[_0x6ac1('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x34e7cb,_0x5ca77a[_0x6ac1('0x12')][_0x6ac1('0x14')]);return _0x18a19a(_0x5ca77a[_0x6ac1('0x12')][_0x6ac1('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x34e7cb,_0x6ac1('0xe'));_0x18a19a(_0x5ca77a[_0x6ac1('0x15')][_0x6ac1('0x14')]);}})[_0x6ac1('0x16')](function(_0x22d2dc){logger[_0x6ac1('0x12')](_0x6ac1('0xd'),_0x34e7cb,_0x22d2dc);_0x1e965b(_0x22d2dc);});});} \ No newline at end of file +var _0x62db=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0xf1096b,_0x1b4494){var _0x1194cf=function(_0x95abcb){while(--_0x95abcb){_0xf1096b['push'](_0xf1096b['shift']());}};_0x1194cf(++_0x1b4494);}(_0x62db,0x11c));var _0xb62d=function(_0x40043c,_0x150500){_0x40043c=_0x40043c-0x0;var _0x69d272=_0x62db[_0x40043c];return _0x69d272;};'use strict';var _=require(_0xb62d('0x0'));var util=require(_0xb62d('0x1'));var moment=require(_0xb62d('0x2'));var BPromise=require(_0xb62d('0x3'));var rs=require(_0xb62d('0x4'));var fs=require('fs');var Redis=require(_0xb62d('0x5'));var db=require(_0xb62d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb62d('0x7'));var config=require(_0xb62d('0x8'));var jayson=require(_0xb62d('0x9'));var client=jayson[_0xb62d('0xa')][_0xb62d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3236a6,_0x4f11da,_0x28e109){return new BPromise(function(_0x4f1e32,_0x4b77c1){return client[_0xb62d('0xc')](_0x3236a6,_0x28e109)[_0xb62d('0xd')](function(_0x56d8da){logger[_0xb62d('0xe')](_0xb62d('0xf'),_0x4f11da,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4f11da,_0xb62d('0x10'),JSON[_0xb62d('0x11')](_0x56d8da));if(_0x56d8da[_0xb62d('0x12')]){if(_0x56d8da['error'][_0xb62d('0x13')]===0x1f4){logger[_0xb62d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4f11da,_0x56d8da[_0xb62d('0x12')][_0xb62d('0x14')]);return _0x4b77c1(_0x56d8da[_0xb62d('0x12')]['message']);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4f11da,_0x56d8da[_0xb62d('0x12')][_0xb62d('0x14')]);return _0x4f1e32(_0x56d8da[_0xb62d('0x12')][_0xb62d('0x14')]);}else{logger['info'](_0xb62d('0xf'),_0x4f11da,'request\x20sent');_0x4f1e32(_0x56d8da[_0xb62d('0x15')][_0xb62d('0x14')]);}})['catch'](function(_0x2b01d0){logger[_0xb62d('0x12')](_0xb62d('0xf'),_0x4f11da,_0x2b01d0);_0x4b77c1(_0x2b01d0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 92ee90a..d6a490a 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 _0x9a37=['../../config/environment','get','index','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55f10e,_0x3f312f){var _0x13c376=function(_0x5bf5b9){while(--_0x5bf5b9){_0x55f10e['push'](_0x55f10e['shift']());}};_0x13c376(++_0x3f312f);}(_0x9a37,0x17d));var _0x79a3=function(_0xaa9204,_0x163a47){_0xaa9204=_0xaa9204-0x0;var _0x1e39f8=_0x9a37[_0xaa9204];return _0x1e39f8;};'use strict';var multer=require(_0x79a3('0x0'));var util=require(_0x79a3('0x1'));var path=require(_0x79a3('0x2'));var timeout=require(_0x79a3('0x3'));var express=require(_0x79a3('0x4'));var router=express[_0x79a3('0x5')]();var fs_extra=require(_0x79a3('0x6'));var auth=require(_0x79a3('0x7'));var interaction=require(_0x79a3('0x8'));var config=require(_0x79a3('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x79a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x79a3('0xb')]);router[_0x79a3('0xa')]('/:id',auth[_0x79a3('0xc')](),controller[_0x79a3('0xd')]);router[_0x79a3('0xa')](_0x79a3('0xe'),auth[_0x79a3('0xc')](),controller[_0x79a3('0xf')]);router[_0x79a3('0xa')](_0x79a3('0x10'),auth['isAuthenticated'](),controller[_0x79a3('0x11')]);router[_0x79a3('0xa')](_0x79a3('0x12'),auth[_0x79a3('0xc')](),controller[_0x79a3('0x13')]);router[_0x79a3('0x14')]('/',auth[_0x79a3('0xc')](),controller['create']);router[_0x79a3('0x15')]('/:id',auth[_0x79a3('0xc')](),controller[_0x79a3('0x16')]);router['delete'](_0x79a3('0x17'),auth['isAuthenticated'](),controller[_0x79a3('0x18')]);module[_0x79a3('0x19')]=router; \ No newline at end of file +var _0xa673=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','/:id','get','/:id/preview','/:id/run','run','/:id/query','delete','destroy','exports','multer'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xa673,0x17b));var _0x3a67=function(_0x5edbab,_0x47ae62){_0x5edbab=_0x5edbab-0x0;var _0x5b0ae2=_0xa673[_0x5edbab];return _0x5b0ae2;};'use strict';var multer=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var path=require(_0x3a67('0x2'));var timeout=require(_0x3a67('0x3'));var express=require(_0x3a67('0x4'));var router=express['Router']();var fs_extra=require(_0x3a67('0x5'));var auth=require(_0x3a67('0x6'));var interaction=require(_0x3a67('0x7'));var config=require('../../config/environment');var controller=require(_0x3a67('0x8'));router['get']('/',auth[_0x3a67('0x9')](),controller[_0x3a67('0xa')]);router['get'](_0x3a67('0xb'),auth[_0x3a67('0x9')](),controller['show']);router[_0x3a67('0xc')](_0x3a67('0xd'),auth[_0x3a67('0x9')](),controller['preview']);router['get'](_0x3a67('0xe'),auth[_0x3a67('0x9')](),controller[_0x3a67('0xf')]);router[_0x3a67('0xc')](_0x3a67('0x10'),auth[_0x3a67('0x9')](),controller['query']);router['post']('/',auth[_0x3a67('0x9')](),controller['create']);router['put'](_0x3a67('0xb'),auth[_0x3a67('0x9')](),controller['update']);router[_0x3a67('0x11')]('/:id',auth[_0x3a67('0x9')](),controller[_0x3a67('0x12')]);module[_0x3a67('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 22c76e7..a407342 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 _0x92a9=['sequelize','moment','exports','ENUM','csv','xlsx','STRING','DATE','manual','scheduled','INTEGER'];(function(_0x20e38f,_0x2cf551){var _0x475449=function(_0x1cbf8b){while(--_0x1cbf8b){_0x20e38f['push'](_0x20e38f['shift']());}};_0x475449(++_0x2cf551);}(_0x92a9,0x6e));var _0x992a=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x92a9[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x992a('0x0'));var moment=require(_0x992a('0x1'));module[_0x992a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x992a('0x3')](_0x992a('0x4'),'pdf',_0x992a('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x992a('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0x992a('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x992a('0x6')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x992a('0x3')](_0x992a('0x8'),_0x992a('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x992a('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd728=['manual','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','DATE'];(function(_0x32d1a9,_0x1b470c){var _0x50eaf1=function(_0x5cac22){while(--_0x5cac22){_0x32d1a9['push'](_0x32d1a9['shift']());}};_0x50eaf1(++_0x1b470c);}(_0xd728,0x1d6));var _0x8d72=function(_0x45a4e2,_0x55543c){_0x45a4e2=_0x45a4e2-0x0;var _0x258167=_0xd728[_0x45a4e2];return _0x258167;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8d72('0x0'));module[_0x8d72('0x1')]={'name':{'type':Sequelize[_0x8d72('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8d72('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8d72('0x3')](_0x8d72('0x4'),_0x8d72('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x8d72('0x4')},'savename':{'type':Sequelize[_0x8d72('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8d72('0x6')]},'endDate':{'type':Sequelize[_0x8d72('0x6')]},'status':{'type':Sequelize[_0x8d72('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8d72('0x3')](_0x8d72('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8d72('0x8')]},'reportType':{'type':Sequelize[_0x8d72('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 21859b7..7caafaa 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 _0xd31e=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','body','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','exists','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd31e,0x194));var _0xed31=function(_0x3ccd91,_0x2cb22f){_0x3ccd91=_0x3ccd91-0x0;var _0x2caca1=_0xd31e[_0x3ccd91];return _0x2caca1;};'use strict';var emlformat=require(_0xed31('0x0'));var rimraf=require(_0xed31('0x1'));var zipdir=require(_0xed31('0x2'));var jsonpatch=require(_0xed31('0x3'));var rp=require(_0xed31('0x4'));var moment=require('moment');var BPromise=require(_0xed31('0x5'));var Mustache=require(_0xed31('0x6'));var util=require(_0xed31('0x7'));var path=require(_0xed31('0x8'));var sox=require(_0xed31('0x9'));var csv=require(_0xed31('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed31('0xb'));var _=require(_0xed31('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed31('0xd'));var toCsv=require('to-csv');var querystring=require(_0xed31('0xe'));var Papa=require(_0xed31('0xf'));var Redis=require(_0xed31('0x10'));var authService=require(_0xed31('0x11'));var qs=require(_0xed31('0x12'));var as=require(_0xed31('0x13'));var hardwareService=require(_0xed31('0x14'));var logger=require('../../config/logger')(_0xed31('0x15'));var utils=require(_0xed31('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xed31('0x17'));var db=require(_0xed31('0x18'))['db'];function respondWithStatusCode(_0x2e0880,_0x3c19da){_0x3c19da=_0x3c19da||0xcc;return function(_0x20c2e9){if(_0x20c2e9){return _0x2e0880[_0xed31('0x19')](_0x3c19da);}return _0x2e0880[_0xed31('0x1a')](_0x3c19da)[_0xed31('0x1b')]();};}function respondWithResult(_0x5aa62f,_0x433e4e){_0x433e4e=_0x433e4e||0xc8;return function(_0x5bfeed){if(_0x5bfeed){return _0x5aa62f[_0xed31('0x1a')](_0x433e4e)[_0xed31('0x1c')](_0x5bfeed);}};}function respondWithFilteredResult(_0x256ba1,_0x874825){return function(_0x281775){if(_0x281775){var _0x5d0e16=typeof _0x874825[_0xed31('0x1d')]===_0xed31('0x1e')&&typeof _0x874825[_0xed31('0x1f')]===_0xed31('0x1e');var _0x2fbce7=_0x281775[_0xed31('0x20')];var _0x44a240=_0x5d0e16?0x0:_0x874825[_0xed31('0x1d')];var _0x3a5c75=_0x5d0e16?_0x281775[_0xed31('0x20')]:_0x874825[_0xed31('0x1d')]+_0x874825[_0xed31('0x1f')];var _0x4dfd8c;if(_0x3a5c75>=_0x2fbce7){_0x3a5c75=_0x2fbce7;_0x4dfd8c=0xc8;}else{_0x4dfd8c=0xce;}_0x256ba1[_0xed31('0x1a')](_0x4dfd8c);return _0x256ba1[_0xed31('0x21')](_0xed31('0x22'),_0x44a240+'-'+_0x3a5c75+'/'+_0x2fbce7)[_0xed31('0x1c')](_0x281775);}return null;};}function patchUpdates(_0x189d5a){return function(_0x400b54){try{jsonpatch[_0xed31('0x23')](_0x400b54,_0x189d5a,!![]);}catch(_0x1ad12a){return BPromise[_0xed31('0x24')](_0x1ad12a);}return _0x400b54[_0xed31('0x25')]();};}function saveUpdates(_0x33659f,_0x4edada){return function(_0x12acf4){if(_0x12acf4){return _0x12acf4[_0xed31('0x26')](_0x33659f)[_0xed31('0x27')](function(_0x526544){return _0x526544;});}return null;};}function removeEntity(_0x16014a,_0x422a8e){return function(_0x37b0ea){if(_0x37b0ea){return _0x37b0ea[_0xed31('0x28')]()[_0xed31('0x27')](function(){var _0x479aa1=_0x37b0ea[_0xed31('0x29')]({'plain':!![]});var _0x3e35a2=_0xed31('0x2a');return db[_0xed31('0x2b')][_0xed31('0x28')]({'where':{'type':_0x3e35a2,'resourceId':_0x479aa1['id']}})[_0xed31('0x27')](function(){return _0x37b0ea;});})[_0xed31('0x27')](function(){_0x16014a[_0xed31('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d460c,_0xe29d72){return function(_0x53fb95){if(!_0x53fb95){_0x4d460c[_0xed31('0x19')](0x194);}return _0x53fb95;};}function handleError(_0x17c3f4,_0x34d667){_0x34d667=_0x34d667||0x1f4;return function(_0x459c46){logger['error'](_0x459c46[_0xed31('0x2c')]);if(_0x459c46[_0xed31('0x2d')]){delete _0x459c46[_0xed31('0x2d')];}_0x17c3f4[_0xed31('0x1a')](_0x34d667)[_0xed31('0x2e')](_0x459c46);};}exports['index']=function(_0xa4a30,_0xe968e4){var _0x8bb899={},_0x2ac643={},_0x354f92={'count':0x0,'rows':[]};var _0x36411e=_[_0xed31('0x2f')](db[_0xed31('0x30')][_0xed31('0x31')],function(_0x51bbb0){return{'name':_0x51bbb0['fieldName'],'type':_0x51bbb0[_0xed31('0x32')][_0xed31('0x33')]};});_0x2ac643['model']=_[_0xed31('0x2f')](_0x36411e,_0xed31('0x2d'));_0x2ac643[_0xed31('0x34')]=_[_0xed31('0x35')](_0xa4a30[_0xed31('0x34')]);_0x2ac643['filters']=_[_0xed31('0x36')](_0x2ac643[_0xed31('0x37')],_0x2ac643['query']);_0x8bb899[_0xed31('0x38')]=_[_0xed31('0x36')](_0x2ac643[_0xed31('0x37')],qs[_0xed31('0x39')](_0xa4a30[_0xed31('0x34')][_0xed31('0x39')]));_0x8bb899[_0xed31('0x38')]=_0x8bb899[_0xed31('0x38')][_0xed31('0x3a')]?_0x8bb899[_0xed31('0x38')]:_0x2ac643[_0xed31('0x37')];if(!_0xa4a30[_0xed31('0x34')][_0xed31('0x3b')](_0xed31('0x3c'))){_0x8bb899[_0xed31('0x1f')]=qs[_0xed31('0x1f')](_0xa4a30[_0xed31('0x34')][_0xed31('0x1f')]);_0x8bb899[_0xed31('0x1d')]=qs[_0xed31('0x1d')](_0xa4a30[_0xed31('0x34')]['offset']);}_0x8bb899[_0xed31('0x3d')]=qs[_0xed31('0x3e')](_0xa4a30[_0xed31('0x34')][_0xed31('0x3e')]);_0x8bb899[_0xed31('0x3f')]=qs['filters'](_[_0xed31('0x40')](_0xa4a30['query'],_0x2ac643[_0xed31('0x41')]),_0x36411e);if(_0xa4a30[_0xed31('0x34')][_0xed31('0x42')]){_0x8bb899[_0xed31('0x3f')]=_[_0xed31('0x43')](_0x8bb899[_0xed31('0x3f')],{'$or':_[_0xed31('0x2f')](_0x36411e,function(_0x2f3305){if(_0x2f3305['type']!==_0xed31('0x44')){var _0x360f42={};_0x360f42[_0x2f3305[_0xed31('0x2d')]]={'$like':'%'+_0xa4a30[_0xed31('0x34')]['filter']+'%'};return _0x360f42;}})});}_0x8bb899=_[_0xed31('0x43')]({},_0x8bb899,_0xa4a30[_0xed31('0x45')]);var _0x2f2f2e={'where':_0x8bb899[_0xed31('0x3f')]};return db['AnalyticExtractedReport'][_0xed31('0x20')](_0x2f2f2e)[_0xed31('0x27')](function(_0x4eef7e){_0x354f92['count']=_0x4eef7e;if(_0xa4a30[_0xed31('0x34')]['includeAll']){_0x8bb899[_0xed31('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x8bb899);})[_0xed31('0x27')](function(_0x2f19ff){_0x354f92['rows']=_0x2f19ff;return _0x354f92;})[_0xed31('0x27')](respondWithFilteredResult(_0xe968e4,_0x8bb899))[_0xed31('0x47')](handleError(_0xe968e4,null));};exports[_0xed31('0x48')]=function(_0x4f561c,_0x4698e1){var _0x5b2683={'raw':!![],'where':{'id':_0x4f561c[_0xed31('0x49')]['id']}},_0x2a799e={};_0x2a799e[_0xed31('0x37')]=_['keys'](db['AnalyticExtractedReport'][_0xed31('0x31')]);_0x2a799e['query']=_[_0xed31('0x35')](_0x4f561c[_0xed31('0x34')]);_0x2a799e[_0xed31('0x41')]=_['intersection'](_0x2a799e['model'],_0x2a799e[_0xed31('0x34')]);_0x5b2683[_0xed31('0x38')]=_[_0xed31('0x36')](_0x2a799e[_0xed31('0x37')],qs['fields'](_0x4f561c[_0xed31('0x34')][_0xed31('0x39')]));_0x5b2683[_0xed31('0x38')]=_0x5b2683[_0xed31('0x38')][_0xed31('0x3a')]?_0x5b2683[_0xed31('0x38')]:_0x2a799e[_0xed31('0x37')];if(_0x4f561c[_0xed31('0x34')][_0xed31('0x4a')]){_0x5b2683['include']=[{'all':!![]}];}_0x5b2683=_[_0xed31('0x43')]({},_0x5b2683,_0x4f561c['options']);return db['AnalyticExtractedReport'][_0xed31('0x4b')](_0x5b2683)[_0xed31('0x27')](handleEntityNotFound(_0x4698e1,null))[_0xed31('0x27')](respondWithResult(_0x4698e1,null))[_0xed31('0x47')](handleError(_0x4698e1,null));};exports['create']=function(_0x256d73,_0x57cc67){return db[_0xed31('0x30')]['create'](_0x256d73['body'],{})['then'](function(_0x5bcdd1){var _0x4e35e9=_0x256d73[_0xed31('0x4c')]['get']({'plain':!![]});if(!_0x4e35e9)throw new Error(_0xed31('0x4d'));if(_0x4e35e9[_0xed31('0x4e')]==='user'){var _0x44f72e=_0x5bcdd1['get']({'plain':!![]});var _0x8e2c50=_0xed31('0x2a');return db[_0xed31('0x4f')][_0xed31('0x4b')]({'where':{'name':_0x8e2c50,'userProfileId':_0x4e35e9[_0xed31('0x50')]},'raw':!![]})[_0xed31('0x27')](function(_0x5d1dff){if(_0x5d1dff&&_0x5d1dff[_0xed31('0x51')]===0x0){return db[_0xed31('0x2b')][_0xed31('0x52')]({'name':_0x44f72e[_0xed31('0x2d')],'resourceId':_0x44f72e['id'],'type':_0x5d1dff[_0xed31('0x2d')],'sectionId':_0x5d1dff['id']},{})[_0xed31('0x27')](function(){return _0x5bcdd1;});}else{return _0x5bcdd1;}})[_0xed31('0x47')](function(_0x501c55){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501c55);throw _0x501c55;});}return _0x5bcdd1;})['then'](respondWithResult(_0x57cc67,0xc9))[_0xed31('0x47')](handleError(_0x57cc67,null));};exports['update']=function(_0x3d82b6,_0x48c933){if(_0x3d82b6[_0xed31('0x53')]['id']){delete _0x3d82b6[_0xed31('0x53')]['id'];}return db[_0xed31('0x30')][_0xed31('0x4b')]({'where':{'id':_0x3d82b6[_0xed31('0x49')]['id']}})['then'](handleEntityNotFound(_0x48c933,null))[_0xed31('0x27')](saveUpdates(_0x3d82b6['body'],null))[_0xed31('0x27')](respondWithResult(_0x48c933,null))['catch'](handleError(_0x48c933,null));};exports['destroy']=function(_0x581195,_0x3e6f2b){return db[_0xed31('0x30')][_0xed31('0x4b')]({'where':{'id':_0x581195[_0xed31('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e6f2b,null))[_0xed31('0x27')](removeEntity(_0x3e6f2b,null))[_0xed31('0x47')](handleError(_0x3e6f2b,null));};exports[_0xed31('0x54')]=function(_0x354d4f,_0x18572d,_0x59d1bc){return db[_0xed31('0x30')][_0xed31('0x4b')]({'where':{'id':_0x354d4f[_0xed31('0x49')]['id']},'attributes':[_0xed31('0x2d'),_0xed31('0x55'),_0xed31('0x56'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x18572d,null))[_0xed31('0x27')](function(_0x1f350a){if(_0x1f350a){if(!fs[_0xed31('0x57')](path[_0xed31('0x58')](config[_0xed31('0x59')],'server/files/reports',_0x1f350a['savename']))){throw new db[(_0xed31('0x5a'))][(_0xed31('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x354d4f['query'][_0xed31('0x5c')]){return _0x18572d['sendStatus'](0xc8);}return _0x18572d['download'](path[_0xed31('0x58')](config[_0xed31('0x59')],'server/files/reports',_0x1f350a[_0xed31('0x56')]),util['format'](_0xed31('0x5d'),_0x1f350a[_0xed31('0x55')]||_0x1f350a[_0xed31('0x2d')],_0x1f350a[_0xed31('0x5e')][_0xed31('0x5f')]()));}})[_0xed31('0x47')](handleError(_0x18572d,null));}; \ No newline at end of file +var _0x1da2=['send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','create','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','rimraf','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','stack','name'];(function(_0x534770,_0x47d495){var _0x139ae9=function(_0x463d22){while(--_0x463d22){_0x534770['push'](_0x534770['shift']());}};_0x139ae9(++_0x47d495);}(_0x1da2,0x1f1));var _0x21da=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1da2[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x21da('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x21da('0x2'));var util=require(_0x21da('0x3'));var path=require(_0x21da('0x4'));var sox=require(_0x21da('0x5'));var csv=require(_0x21da('0x6'));var ejs=require(_0x21da('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21da('0x8'));var squel=require(_0x21da('0x9'));var crypto=require(_0x21da('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x21da('0xb'));var toCsv=require('to-csv');var querystring=require(_0x21da('0xc'));var Papa=require(_0x21da('0xd'));var Redis=require(_0x21da('0xe'));var authService=require(_0x21da('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x21da('0x10'));var hardwareService=require(_0x21da('0x11'));var logger=require('../../config/logger')(_0x21da('0x12'));var utils=require('../../config/utils');var config=require(_0x21da('0x13'));var licenseUtil=require(_0x21da('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589645,_0x35386e){_0x35386e=_0x35386e||0xcc;return function(_0x15dc32){if(_0x15dc32){return _0x589645[_0x21da('0x15')](_0x35386e);}return _0x589645[_0x21da('0x16')](_0x35386e)['end']();};}function respondWithResult(_0x12304f,_0x25b4c6){_0x25b4c6=_0x25b4c6||0xc8;return function(_0x15844e){if(_0x15844e){return _0x12304f[_0x21da('0x16')](_0x25b4c6)[_0x21da('0x17')](_0x15844e);}};}function respondWithFilteredResult(_0x48ac02,_0x35fea9){return function(_0x13ad0b){if(_0x13ad0b){var _0x4a039d=typeof _0x35fea9[_0x21da('0x18')]===_0x21da('0x19')&&typeof _0x35fea9[_0x21da('0x1a')]===_0x21da('0x19');var _0x1bedff=_0x13ad0b[_0x21da('0x1b')];var _0x345705=_0x4a039d?0x0:_0x35fea9['offset'];var _0x1074a2=_0x4a039d?_0x13ad0b['count']:_0x35fea9['offset']+_0x35fea9[_0x21da('0x1a')];var _0x33e23c;if(_0x1074a2>=_0x1bedff){_0x1074a2=_0x1bedff;_0x33e23c=0xc8;}else{_0x33e23c=0xce;}_0x48ac02[_0x21da('0x16')](_0x33e23c);return _0x48ac02[_0x21da('0x1c')](_0x21da('0x1d'),_0x345705+'-'+_0x1074a2+'/'+_0x1bedff)[_0x21da('0x17')](_0x13ad0b);}return null;};}function patchUpdates(_0x152bb0){return function(_0x555960){try{jsonpatch[_0x21da('0x1e')](_0x555960,_0x152bb0,!![]);}catch(_0x36ce3f){return BPromise[_0x21da('0x1f')](_0x36ce3f);}return _0x555960[_0x21da('0x20')]();};}function saveUpdates(_0xf1e35d,_0x100089){return function(_0x4060ae){if(_0x4060ae){return _0x4060ae[_0x21da('0x21')](_0xf1e35d)['then'](function(_0x3e0fb4){return _0x3e0fb4;});}return null;};}function removeEntity(_0x51553b,_0x3f064a){return function(_0xca3e7f){if(_0xca3e7f){return _0xca3e7f['destroy']()[_0x21da('0x22')](function(){var _0x5e20f6=_0xca3e7f[_0x21da('0x23')]({'plain':!![]});var _0x490915=_0x21da('0x24');return db[_0x21da('0x25')][_0x21da('0x26')]({'where':{'type':_0x490915,'resourceId':_0x5e20f6['id']}})[_0x21da('0x22')](function(){return _0xca3e7f;});})['then'](function(){_0x51553b[_0x21da('0x16')](0xcc)[_0x21da('0x27')]();});}};}function handleEntityNotFound(_0x1803a9,_0x69b78b){return function(_0x1bc8c0){if(!_0x1bc8c0){_0x1803a9[_0x21da('0x15')](0x194);}return _0x1bc8c0;};}function handleError(_0x358d53,_0xbaa365){_0xbaa365=_0xbaa365||0x1f4;return function(_0xc44f69){logger[_0x21da('0x28')](_0xc44f69[_0x21da('0x29')]);if(_0xc44f69[_0x21da('0x2a')]){delete _0xc44f69[_0x21da('0x2a')];}_0x358d53[_0x21da('0x16')](_0xbaa365)[_0x21da('0x2b')](_0xc44f69);};}exports['index']=function(_0x527b3f,_0x4da251){var _0x167177={},_0x13134f={},_0x155baa={'count':0x0,'rows':[]};var _0x119bde=_['map'](db[_0x21da('0x2c')][_0x21da('0x2d')],function(_0x582bcc){return{'name':_0x582bcc[_0x21da('0x2e')],'type':_0x582bcc[_0x21da('0x2f')][_0x21da('0x30')]};});_0x13134f[_0x21da('0x31')]=_[_0x21da('0x32')](_0x119bde,_0x21da('0x2a'));_0x13134f[_0x21da('0x33')]=_[_0x21da('0x34')](_0x527b3f['query']);_0x13134f[_0x21da('0x35')]=_[_0x21da('0x36')](_0x13134f[_0x21da('0x31')],_0x13134f[_0x21da('0x33')]);_0x167177['attributes']=_[_0x21da('0x36')](_0x13134f[_0x21da('0x31')],qs[_0x21da('0x37')](_0x527b3f[_0x21da('0x33')][_0x21da('0x37')]));_0x167177[_0x21da('0x38')]=_0x167177[_0x21da('0x38')][_0x21da('0x39')]?_0x167177['attributes']:_0x13134f[_0x21da('0x31')];if(!_0x527b3f[_0x21da('0x33')]['hasOwnProperty'](_0x21da('0x3a'))){_0x167177[_0x21da('0x1a')]=qs[_0x21da('0x1a')](_0x527b3f[_0x21da('0x33')][_0x21da('0x1a')]);_0x167177['offset']=qs['offset'](_0x527b3f[_0x21da('0x33')][_0x21da('0x18')]);}_0x167177[_0x21da('0x3b')]=qs[_0x21da('0x3c')](_0x527b3f[_0x21da('0x33')][_0x21da('0x3c')]);_0x167177[_0x21da('0x3d')]=qs[_0x21da('0x35')](_[_0x21da('0x3e')](_0x527b3f[_0x21da('0x33')],_0x13134f[_0x21da('0x35')]),_0x119bde);if(_0x527b3f['query'][_0x21da('0x3f')]){_0x167177[_0x21da('0x3d')]=_['merge'](_0x167177[_0x21da('0x3d')],{'$or':_[_0x21da('0x32')](_0x119bde,function(_0x532971){if(_0x532971[_0x21da('0x2f')]!==_0x21da('0x40')){var _0x4cfe85={};_0x4cfe85[_0x532971[_0x21da('0x2a')]]={'$like':'%'+_0x527b3f[_0x21da('0x33')][_0x21da('0x3f')]+'%'};return _0x4cfe85;}})});}_0x167177=_['merge']({},_0x167177,_0x527b3f[_0x21da('0x41')]);var _0x1d2a07={'where':_0x167177[_0x21da('0x3d')]};return db[_0x21da('0x2c')]['count'](_0x1d2a07)[_0x21da('0x22')](function(_0x634b79){_0x155baa['count']=_0x634b79;if(_0x527b3f[_0x21da('0x33')][_0x21da('0x42')]){_0x167177['include']=[{'all':!![]}];}return db[_0x21da('0x2c')][_0x21da('0x43')](_0x167177);})[_0x21da('0x22')](function(_0x20a205){_0x155baa['rows']=_0x20a205;return _0x155baa;})['then'](respondWithFilteredResult(_0x4da251,_0x167177))[_0x21da('0x44')](handleError(_0x4da251,null));};exports['show']=function(_0x11ad63,_0x27045a){var _0x3920e2={'raw':!![],'where':{'id':_0x11ad63[_0x21da('0x45')]['id']}},_0x5f127c={};_0x5f127c[_0x21da('0x31')]=_[_0x21da('0x34')](db['AnalyticExtractedReport'][_0x21da('0x2d')]);_0x5f127c[_0x21da('0x33')]=_[_0x21da('0x34')](_0x11ad63[_0x21da('0x33')]);_0x5f127c[_0x21da('0x35')]=_['intersection'](_0x5f127c[_0x21da('0x31')],_0x5f127c['query']);_0x3920e2[_0x21da('0x38')]=_[_0x21da('0x36')](_0x5f127c[_0x21da('0x31')],qs[_0x21da('0x37')](_0x11ad63[_0x21da('0x33')][_0x21da('0x37')]));_0x3920e2[_0x21da('0x38')]=_0x3920e2[_0x21da('0x38')][_0x21da('0x39')]?_0x3920e2[_0x21da('0x38')]:_0x5f127c['model'];if(_0x11ad63[_0x21da('0x33')][_0x21da('0x42')]){_0x3920e2['include']=[{'all':!![]}];}_0x3920e2=_['merge']({},_0x3920e2,_0x11ad63[_0x21da('0x41')]);return db[_0x21da('0x2c')][_0x21da('0x46')](_0x3920e2)[_0x21da('0x22')](handleEntityNotFound(_0x27045a,null))[_0x21da('0x22')](respondWithResult(_0x27045a,null))[_0x21da('0x44')](handleError(_0x27045a,null));};exports['create']=function(_0x35f234,_0x123e32){return db[_0x21da('0x2c')]['create'](_0x35f234['body'],{})[_0x21da('0x22')](function(_0x1992af){var _0x3b1946=_0x35f234['user']['get']({'plain':!![]});if(!_0x3b1946)throw new Error(_0x21da('0x47'));if(_0x3b1946[_0x21da('0x48')]===_0x21da('0x49')){var _0xc97b69=_0x1992af[_0x21da('0x23')]({'plain':!![]});var _0x24a27a='ExtractedReports';return db['UserProfileSection'][_0x21da('0x46')]({'where':{'name':_0x24a27a,'userProfileId':_0x3b1946['userProfileId']},'raw':!![]})['then'](function(_0x495ed3){if(_0x495ed3&&_0x495ed3[_0x21da('0x4a')]===0x0){return db[_0x21da('0x25')][_0x21da('0x4b')]({'name':_0xc97b69['name'],'resourceId':_0xc97b69['id'],'type':_0x495ed3[_0x21da('0x2a')],'sectionId':_0x495ed3['id']},{})[_0x21da('0x22')](function(){return _0x1992af;});}else{return _0x1992af;}})['catch'](function(_0x4b5072){logger[_0x21da('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b5072);throw _0x4b5072;});}return _0x1992af;})[_0x21da('0x22')](respondWithResult(_0x123e32,0xc9))['catch'](handleError(_0x123e32,null));};exports[_0x21da('0x21')]=function(_0x4b9c54,_0x40d7ba){if(_0x4b9c54[_0x21da('0x4c')]['id']){delete _0x4b9c54[_0x21da('0x4c')]['id'];}return db[_0x21da('0x2c')][_0x21da('0x46')]({'where':{'id':_0x4b9c54[_0x21da('0x45')]['id']}})['then'](handleEntityNotFound(_0x40d7ba,null))['then'](saveUpdates(_0x4b9c54[_0x21da('0x4c')],null))[_0x21da('0x22')](respondWithResult(_0x40d7ba,null))[_0x21da('0x44')](handleError(_0x40d7ba,null));};exports[_0x21da('0x26')]=function(_0x288ea6,_0x1fa675){return db[_0x21da('0x2c')][_0x21da('0x46')]({'where':{'id':_0x288ea6[_0x21da('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fa675,null))[_0x21da('0x22')](removeEntity(_0x1fa675,null))[_0x21da('0x44')](handleError(_0x1fa675,null));};exports[_0x21da('0x4d')]=function(_0xf750f1,_0x2f8cab,_0x588da8){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xf750f1[_0x21da('0x45')]['id']},'attributes':[_0x21da('0x2a'),_0x21da('0x4e'),_0x21da('0x4f'),_0x21da('0x50')],'raw':!![]})[_0x21da('0x22')](handleEntityNotFound(_0x2f8cab,null))[_0x21da('0x22')](function(_0xfa2941){if(_0xfa2941){if(!fs[_0x21da('0x51')](path[_0x21da('0x52')](config[_0x21da('0x53')],_0x21da('0x54'),_0xfa2941[_0x21da('0x4f')]))){throw new db[(_0x21da('0x55'))][(_0x21da('0x56'))](_0x21da('0x57'));}if(_0xf750f1[_0x21da('0x33')][_0x21da('0x58')]){return _0x2f8cab[_0x21da('0x15')](0xc8);}return _0x2f8cab[_0x21da('0x4d')](path['join'](config[_0x21da('0x53')],_0x21da('0x54'),_0xfa2941[_0x21da('0x4f')]),util['format'](_0x21da('0x59'),_0xfa2941[_0x21da('0x4e')]||_0xfa2941[_0x21da('0x2a')],_0xfa2941['output']['toLowerCase']()));}})['catch'](handleError(_0x2f8cab,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ff86692..a766e9b 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 _0xac7e=['exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticExtractedReport.attributes'];(function(_0x115683,_0x4a1c36){var _0x5715b0=function(_0x17a343){while(--_0x17a343){_0x115683['push'](_0x115683['shift']());}};_0x5715b0(++_0x4a1c36);}(_0xac7e,0x14d));var _0xeac7=function(_0x20eff5,_0x459af0){_0x20eff5=_0x20eff5-0x0;var _0x59141f=_0xac7e[_0x20eff5];return _0x59141f;};'use strict';var _=require(_0xeac7('0x0'));var util=require(_0xeac7('0x1'));var logger=require(_0xeac7('0x2'))(_0xeac7('0x3'));var moment=require(_0xeac7('0x4'));var BPromise=require(_0xeac7('0x5'));var rp=require(_0xeac7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeac7('0x7'));module[_0xeac7('0x8')]=function(_0x54f4f0,_0xd5f9c){return _0x54f4f0[_0xeac7('0x9')](_0xeac7('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c95=['analytics_extracted_reports','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x58f8b9,_0x497bc4){var _0x2bf198=function(_0x24f6f3){while(--_0x24f6f3){_0x58f8b9['push'](_0x58f8b9['shift']());}};_0x2bf198(++_0x497bc4);}(_0x7c95,0x109));var _0x57c9=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7c95[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x57c9('0x0'));var logger=require(_0x57c9('0x1'))(_0x57c9('0x2'));var moment=require('moment');var BPromise=require(_0x57c9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57c9('0x4'));var rimraf=require(_0x57c9('0x5'));var config=require(_0x57c9('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x57c9('0x7')]=function(_0x52d540,_0x34ec11){return _0x52d540[_0x57c9('0x8')](_0x57c9('0x9'),attributes,{'tableName':_0x57c9('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 b6ac36e..4751582 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 _0x2ab7=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3d123f,_0x24db7f){var _0x1fcc10=function(_0x324b0d){while(--_0x324b0d){_0x3d123f['push'](_0x3d123f['shift']());}};_0x1fcc10(++_0x24db7f);}(_0x2ab7,0xe7));var _0x72ab=function(_0x2c70a9,_0x4e7a6d){_0x2c70a9=_0x2c70a9-0x0;var _0x50f468=_0x2ab7[_0x2c70a9];return _0x50f468;};'use strict';var _=require(_0x72ab('0x0'));var util=require(_0x72ab('0x1'));var moment=require(_0x72ab('0x2'));var BPromise=require(_0x72ab('0x3'));var rs=require(_0x72ab('0x4'));var fs=require('fs');var Redis=require(_0x72ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x72ab('0x6'));var logger=require(_0x72ab('0x7'))(_0x72ab('0x8'));var config=require(_0x72ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x72ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54caaf,_0x188caa,_0x2ed3b1){return new BPromise(function(_0xbd73df,_0x4dd1fe){return client['request'](_0x54caaf,_0x2ed3b1)[_0x72ab('0xb')](function(_0x4819ef){logger[_0x72ab('0xc')](_0x72ab('0xd'),_0x188caa,'request\x20sent');logger[_0x72ab('0xe')](_0x72ab('0xf'),_0x188caa,_0x72ab('0x10'),JSON[_0x72ab('0x11')](_0x4819ef));if(_0x4819ef[_0x72ab('0x12')]){if(_0x4819ef[_0x72ab('0x12')][_0x72ab('0x13')]===0x1f4){logger[_0x72ab('0x12')](_0x72ab('0xd'),_0x188caa,_0x4819ef[_0x72ab('0x12')]['message']);return _0x4dd1fe(_0x4819ef['error'][_0x72ab('0x14')]);}logger[_0x72ab('0x12')](_0x72ab('0xd'),_0x188caa,_0x4819ef['error']['message']);return _0xbd73df(_0x4819ef[_0x72ab('0x12')][_0x72ab('0x14')]);}else{logger[_0x72ab('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x188caa,_0x72ab('0x10'));_0xbd73df(_0x4819ef['result'][_0x72ab('0x14')]);}})[_0x72ab('0x15')](function(_0x337218){logger[_0x72ab('0x12')](_0x72ab('0xd'),_0x188caa,_0x337218);_0x4dd1fe(_0x337218);});});} \ No newline at end of file +var _0x7fd9=['jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','rpc'];(function(_0x257105,_0x54f3f2){var _0x2cdd01=function(_0x5d5dc4){while(--_0x5d5dc4){_0x257105['push'](_0x257105['shift']());}};_0x2cdd01(++_0x54f3f2);}(_0x7fd9,0x66));var _0x97fd=function(_0x5f4585,_0x287c9f){_0x5f4585=_0x5f4585-0x0;var _0x32b347=_0x7fd9[_0x5f4585];return _0x32b347;};'use strict';var _=require(_0x97fd('0x0'));var util=require(_0x97fd('0x1'));var moment=require(_0x97fd('0x2'));var BPromise=require(_0x97fd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x97fd('0x4'));var logger=require('../../config/logger')(_0x97fd('0x5'));var config=require('../../config/environment');var jayson=require(_0x97fd('0x6'));var client=jayson[_0x97fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6115,_0x3deac3,_0x19b422){return new BPromise(function(_0x36a84,_0x599c93){return client['request'](_0x5c6115,_0x19b422)[_0x97fd('0x8')](function(_0x53d4dd){logger[_0x97fd('0x9')](_0x97fd('0xa'),_0x3deac3,_0x97fd('0xb'));logger['debug'](_0x97fd('0xc'),_0x3deac3,_0x97fd('0xb'),JSON[_0x97fd('0xd')](_0x53d4dd));if(_0x53d4dd[_0x97fd('0xe')]){if(_0x53d4dd['error'][_0x97fd('0xf')]===0x1f4){logger[_0x97fd('0xe')](_0x97fd('0xa'),_0x3deac3,_0x53d4dd[_0x97fd('0xe')][_0x97fd('0x10')]);return _0x599c93(_0x53d4dd[_0x97fd('0xe')][_0x97fd('0x10')]);}logger[_0x97fd('0xe')](_0x97fd('0xa'),_0x3deac3,_0x53d4dd[_0x97fd('0xe')]['message']);return _0x36a84(_0x53d4dd[_0x97fd('0xe')][_0x97fd('0x10')]);}else{logger[_0x97fd('0x9')](_0x97fd('0xa'),_0x3deac3,_0x97fd('0xb'));_0x36a84(_0x53d4dd[_0x97fd('0x11')][_0x97fd('0x10')]);}})['catch'](function(_0x2d7eb0){logger['error'](_0x97fd('0xa'),_0x3deac3,_0x2d7eb0);_0x599c93(_0x2d7eb0);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 682eb02..4346966 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 _0x5069=['isAuthenticated','/:id','show','/:id/download','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5d9a3d,_0x2ce39f){var _0x2a2d9c=function(_0x1fcee6){while(--_0x1fcee6){_0x5d9a3d['push'](_0x5d9a3d['shift']());}};_0x2a2d9c(++_0x2ce39f);}(_0x5069,0x96));var _0x9506=function(_0x5026ab,_0x25bd8b){_0x5026ab=_0x5026ab-0x0;var _0x55f39a=_0x5069[_0x5026ab];return _0x55f39a;};'use strict';var multer=require(_0x9506('0x0'));var util=require(_0x9506('0x1'));var path=require(_0x9506('0x2'));var timeout=require('connect-timeout');var express=require(_0x9506('0x3'));var router=express[_0x9506('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9506('0x5'));var interaction=require(_0x9506('0x6'));var config=require(_0x9506('0x7'));var controller=require(_0x9506('0x8'));router[_0x9506('0x9')]('/',auth[_0x9506('0xa')](),controller['index']);router['get'](_0x9506('0xb'),auth[_0x9506('0xa')](),controller[_0x9506('0xc')]);router[_0x9506('0x9')](_0x9506('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x9506('0xa')](),controller[_0x9506('0xe')]);router[_0x9506('0xf')](_0x9506('0xb'),auth[_0x9506('0xa')](),controller[_0x9506('0x10')]);router[_0x9506('0x11')](_0x9506('0xb'),auth[_0x9506('0xa')](),controller[_0x9506('0x12')]);module[_0x9506('0x13')]=router; \ No newline at end of file +var _0x280c=['/:id/download','download','post','/:id','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x280c,0xc5));var _0xc280=function(_0x5ec6a6,_0x515274){_0x5ec6a6=_0x5ec6a6-0x0;var _0x551e77=_0x280c[_0x5ec6a6];return _0x551e77;};'use strict';var multer=require(_0xc280('0x0'));var util=require(_0xc280('0x1'));var path=require('path');var timeout=require(_0xc280('0x2'));var express=require('express');var router=express[_0xc280('0x3')]();var fs_extra=require(_0xc280('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc280('0x5'));var config=require(_0xc280('0x6'));var controller=require(_0xc280('0x7'));router[_0xc280('0x8')]('/',auth[_0xc280('0x9')](),controller[_0xc280('0xa')]);router[_0xc280('0x8')]('/:id',auth[_0xc280('0x9')](),controller[_0xc280('0xb')]);router[_0xc280('0x8')](_0xc280('0xc'),auth['isAuthenticated'](),controller[_0xc280('0xd')]);router[_0xc280('0xe')]('/',auth[_0xc280('0x9')](),controller['create']);router['put'](_0xc280('0xf'),auth[_0xc280('0x9')](),controller[_0xc280('0x10')]);router['delete'](_0xc280('0xf'),auth['isAuthenticated'](),controller[_0xc280('0x11')]);module[_0xc280('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3272386..dc6979c 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 _0xd46c=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xd46c,0xb4));var _0xcd46=function(_0x29ee16,_0x329748){_0x29ee16=_0x29ee16-0x0;var _0x3814c3=_0xd46c[_0x29ee16];return _0x3814c3;};'use strict';var Sequelize=require(_0xcd46('0x0'));module[_0xcd46('0x1')]={'field':{'type':Sequelize[_0xcd46('0x2')]},'alias':{'type':Sequelize[_0xcd46('0x3')]},'function':{'type':Sequelize[_0xcd46('0x3')]},'format':{'type':Sequelize[_0xcd46('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xcd46('0x3')]},'custom':{'type':Sequelize[_0xcd46('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x936b=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x936b,0x95));var _0xb936=function(_0x4f7f19,_0x352719){_0x4f7f19=_0x4f7f19-0x0;var _0x327931=_0x936b[_0x4f7f19];return _0x327931;};'use strict';var Sequelize=require(_0xb936('0x0'));module[_0xb936('0x1')]={'field':{'type':Sequelize[_0xb936('0x2')]},'alias':{'type':Sequelize[_0xb936('0x3')]},'function':{'type':Sequelize[_0xb936('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb936('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb936('0x3')]},'custom':{'type':Sequelize[_0xb936('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9659390..d3f00e8 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 _0x1738=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x1738,0x13f));var _0x8173=function(_0x3da312,_0x391ccd){_0x3da312=_0x3da312-0x0;var _0x28fb08=_0x1738[_0x3da312];return _0x28fb08;};'use strict';var emlformat=require(_0x8173('0x0'));var rimraf=require(_0x8173('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8173('0x2'));var rp=require(_0x8173('0x3'));var moment=require(_0x8173('0x4'));var BPromise=require(_0x8173('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8173('0x6'));var sox=require(_0x8173('0x7'));var csv=require(_0x8173('0x8'));var ejs=require(_0x8173('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8173('0xa'));var squel=require(_0x8173('0xb'));var crypto=require(_0x8173('0xc'));var jsforce=require(_0x8173('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8173('0xe'));var Papa=require('papaparse');var Redis=require(_0x8173('0xf'));var authService=require(_0x8173('0x10'));var qs=require(_0x8173('0x11'));var as=require(_0x8173('0x12'));var hardwareService=require(_0x8173('0x13'));var logger=require(_0x8173('0x14'))(_0x8173('0x15'));var utils=require(_0x8173('0x16'));var config=require(_0x8173('0x17'));var licenseUtil=require(_0x8173('0x18'));var db=require(_0x8173('0x19'))['db'];function respondWithStatusCode(_0x1a3dc4,_0x2a6aad){_0x2a6aad=_0x2a6aad||0xcc;return function(_0x299ae9){if(_0x299ae9){return _0x1a3dc4['sendStatus'](_0x2a6aad);}return _0x1a3dc4[_0x8173('0x1a')](_0x2a6aad)[_0x8173('0x1b')]();};}function respondWithResult(_0x167b0e,_0xcea595){_0xcea595=_0xcea595||0xc8;return function(_0xfbbd7b){if(_0xfbbd7b){return _0x167b0e[_0x8173('0x1a')](_0xcea595)[_0x8173('0x1c')](_0xfbbd7b);}};}function respondWithFilteredResult(_0x373d7a,_0x5ac311){return function(_0x1c9a4f){if(_0x1c9a4f){var _0x1351c9=typeof _0x5ac311['offset']===_0x8173('0x1d')&&typeof _0x5ac311[_0x8173('0x1e')]===_0x8173('0x1d');var _0x20d32a=_0x1c9a4f[_0x8173('0x1f')];var _0x348199=_0x1351c9?0x0:_0x5ac311[_0x8173('0x20')];var _0xd74139=_0x1351c9?_0x1c9a4f['count']:_0x5ac311[_0x8173('0x20')]+_0x5ac311[_0x8173('0x1e')];var _0x19bd09;if(_0xd74139>=_0x20d32a){_0xd74139=_0x20d32a;_0x19bd09=0xc8;}else{_0x19bd09=0xce;}_0x373d7a['status'](_0x19bd09);return _0x373d7a['set'](_0x8173('0x21'),_0x348199+'-'+_0xd74139+'/'+_0x20d32a)[_0x8173('0x1c')](_0x1c9a4f);}return null;};}function patchUpdates(_0x3c5980){return function(_0x493b64){try{jsonpatch['apply'](_0x493b64,_0x3c5980,!![]);}catch(_0xb5a67){return BPromise[_0x8173('0x22')](_0xb5a67);}return _0x493b64[_0x8173('0x23')]();};}function saveUpdates(_0x413897,_0x4550d8){return function(_0x26041b){if(_0x26041b){return _0x26041b[_0x8173('0x24')](_0x413897)['then'](function(_0x15dfbe){return _0x15dfbe;});}return null;};}function removeEntity(_0x1abfc0,_0x37afa6){return function(_0xa1177){if(_0xa1177){return _0xa1177[_0x8173('0x25')]()[_0x8173('0x26')](function(){_0x1abfc0[_0x8173('0x1a')](0xcc)[_0x8173('0x1b')]();});}};}function handleEntityNotFound(_0x4ea030,_0x2a262f){return function(_0x6790d8){if(!_0x6790d8){_0x4ea030[_0x8173('0x27')](0x194);}return _0x6790d8;};}function handleError(_0xd2c7bf,_0x1d4d5a){_0x1d4d5a=_0x1d4d5a||0x1f4;return function(_0x4ec437){logger[_0x8173('0x28')](_0x4ec437[_0x8173('0x29')]);if(_0x4ec437[_0x8173('0x2a')]){delete _0x4ec437['name'];}_0xd2c7bf[_0x8173('0x1a')](_0x1d4d5a)[_0x8173('0x2b')](_0x4ec437);};}exports[_0x8173('0x2c')]=function(_0x3f4b,_0x2a9cab){var _0x4992ce={},_0xb067af={},_0x3d53ee={'count':0x0,'rows':[]};var _0x215ed5=_[_0x8173('0x2d')](db[_0x8173('0x2e')]['rawAttributes'],function(_0x2ff16f){return{'name':_0x2ff16f['fieldName'],'type':_0x2ff16f[_0x8173('0x2f')][_0x8173('0x30')]};});_0xb067af[_0x8173('0x31')]=_[_0x8173('0x2d')](_0x215ed5,'name');_0xb067af['query']=_[_0x8173('0x32')](_0x3f4b[_0x8173('0x33')]);_0xb067af[_0x8173('0x34')]=_['intersection'](_0xb067af[_0x8173('0x31')],_0xb067af[_0x8173('0x33')]);_0x4992ce[_0x8173('0x35')]=_['intersection'](_0xb067af['model'],qs[_0x8173('0x36')](_0x3f4b[_0x8173('0x33')][_0x8173('0x36')]));_0x4992ce['attributes']=_0x4992ce[_0x8173('0x35')][_0x8173('0x37')]?_0x4992ce[_0x8173('0x35')]:_0xb067af[_0x8173('0x31')];if(!_0x3f4b[_0x8173('0x33')][_0x8173('0x38')](_0x8173('0x39'))){_0x4992ce[_0x8173('0x1e')]=qs[_0x8173('0x1e')](_0x3f4b[_0x8173('0x33')]['limit']);_0x4992ce['offset']=qs[_0x8173('0x20')](_0x3f4b[_0x8173('0x33')]['offset']);}_0x4992ce[_0x8173('0x3a')]=qs['sort'](_0x3f4b['query'][_0x8173('0x3b')]);_0x4992ce[_0x8173('0x3c')]=qs[_0x8173('0x34')](_[_0x8173('0x3d')](_0x3f4b[_0x8173('0x33')],_0xb067af[_0x8173('0x34')]),_0x215ed5);if(_0x3f4b[_0x8173('0x33')]['filter']){_0x4992ce[_0x8173('0x3c')]=_['merge'](_0x4992ce['where'],{'$or':_[_0x8173('0x2d')](_0x215ed5,function(_0x51ae28){if(_0x51ae28[_0x8173('0x2f')]!==_0x8173('0x3e')){var _0x4454fa={};_0x4454fa[_0x51ae28[_0x8173('0x2a')]]={'$like':'%'+_0x3f4b[_0x8173('0x33')][_0x8173('0x3f')]+'%'};return _0x4454fa;}})});}_0x4992ce=_[_0x8173('0x40')]({},_0x4992ce,_0x3f4b[_0x8173('0x41')]);var _0x37e095={'where':_0x4992ce[_0x8173('0x3c')]};return db[_0x8173('0x2e')][_0x8173('0x1f')](_0x37e095)[_0x8173('0x26')](function(_0x38291f){_0x3d53ee[_0x8173('0x1f')]=_0x38291f;if(_0x3f4b[_0x8173('0x33')][_0x8173('0x42')]){_0x4992ce[_0x8173('0x43')]=[{'all':!![]}];}return db[_0x8173('0x2e')]['findAll'](_0x4992ce);})[_0x8173('0x26')](function(_0x43e27b){_0x3d53ee[_0x8173('0x44')]=_0x43e27b;return _0x3d53ee;})[_0x8173('0x26')](respondWithFilteredResult(_0x2a9cab,_0x4992ce))[_0x8173('0x45')](handleError(_0x2a9cab,null));};exports[_0x8173('0x46')]=function(_0x336a84,_0x5963eb){var _0x23d3b6={'raw':![],'where':{'id':_0x336a84[_0x8173('0x47')]['id']}},_0x472ffe={};_0x472ffe[_0x8173('0x31')]=_['keys'](db[_0x8173('0x2e')]['rawAttributes']);_0x472ffe[_0x8173('0x33')]=_[_0x8173('0x32')](_0x336a84[_0x8173('0x33')]);_0x472ffe['filters']=_[_0x8173('0x48')](_0x472ffe[_0x8173('0x31')],_0x472ffe[_0x8173('0x33')]);_0x23d3b6[_0x8173('0x35')]=_[_0x8173('0x48')](_0x472ffe['model'],qs[_0x8173('0x36')](_0x336a84[_0x8173('0x33')][_0x8173('0x36')]));_0x23d3b6['attributes']=_0x23d3b6[_0x8173('0x35')][_0x8173('0x37')]?_0x23d3b6['attributes']:_0x472ffe[_0x8173('0x31')];if(_0x336a84[_0x8173('0x33')][_0x8173('0x42')]){_0x23d3b6[_0x8173('0x43')]=[{'all':!![]}];}_0x23d3b6=_[_0x8173('0x40')]({},_0x23d3b6,_0x336a84[_0x8173('0x41')]);return db['AnalyticFieldReport'][_0x8173('0x49')](_0x23d3b6)[_0x8173('0x26')](handleEntityNotFound(_0x5963eb,null))[_0x8173('0x26')](respondWithResult(_0x5963eb,null))[_0x8173('0x45')](handleError(_0x5963eb,null));};exports['create']=function(_0x410134,_0xaeeb57){return db[_0x8173('0x2e')][_0x8173('0x4a')](_0x410134[_0x8173('0x4b')],{})[_0x8173('0x26')](respondWithResult(_0xaeeb57,0xc9))['catch'](handleError(_0xaeeb57,null));};exports[_0x8173('0x4c')]=function(_0x247a68,_0x2678bf){return db[_0x8173('0x2e')]['bulkCreate'](_0x247a68[_0x8173('0x4b')],{'raw':![],'individualHooks':!![]})[_0x8173('0x26')](respondWithResult(_0x2678bf,0xc9))[_0x8173('0x45')](handleError(_0x2678bf,null));};exports['update']=function(_0x2421d7,_0x549495){if(_0x2421d7[_0x8173('0x4b')]['id']){delete _0x2421d7[_0x8173('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x8173('0x49')]({'where':{'id':_0x2421d7[_0x8173('0x47')]['id']}})[_0x8173('0x26')](handleEntityNotFound(_0x549495,null))[_0x8173('0x26')](saveUpdates(_0x2421d7[_0x8173('0x4b')],null))['then'](respondWithResult(_0x549495,null))[_0x8173('0x45')](handleError(_0x549495,null));};exports[_0x8173('0x25')]=function(_0x4eda67,_0x482848){return db['AnalyticFieldReport'][_0x8173('0x49')]({'where':{'id':_0x4eda67[_0x8173('0x47')]['id']}})[_0x8173('0x26')](handleEntityNotFound(_0x482848,null))[_0x8173('0x26')](removeEntity(_0x482848,null))[_0x8173('0x45')](handleError(_0x482848,null));};exports[_0x8173('0x4d')]=function(_0x583933,_0x5edbea){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x583933['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8173('0x26')](respondWithResult(_0x5edbea,0xcc))['catch'](handleError(_0x5edbea,null));};exports[_0x8173('0x4e')]=function(_0x461550,_0x7a5f0e,_0x4ae7a9){return db[_0x8173('0x4f')]['findOne']({'where':{'id':_0x461550[_0x8173('0x47')]['id']}})['then'](handleEntityNotFound(_0x7a5f0e,null))[_0x8173('0x26')](function(_0x3beb5d){if(_0x3beb5d){return db[_0x8173('0x50')][_0x8173('0x51')](function(_0x21236a){return db[_0x8173('0x2e')]['destroy']({'where':{'CustomReportId':_0x461550[_0x8173('0x47')]['id']},'transaction':_0x21236a})[_0x8173('0x26')](function(_0x5eb432){var _0x577027=_[_0x8173('0x2d')](_0x461550[_0x8173('0x4b')],function(_0x4e0a6f){delete _0x4e0a6f['id'];_0x4e0a6f['CustomReportId']=_0x461550[_0x8173('0x47')]['id'];return _0x4e0a6f;});return db[_0x8173('0x2e')][_0x8173('0x4c')](_0x577027,{'transaction':_0x21236a});});})[_0x8173('0x26')](function(){return db[_0x8173('0x2e')][_0x8173('0x52')]({'where':{'CustomReportId':_0x461550[_0x8173('0x47')]['id']}});});}})[_0x8173('0x26')](respondWithResult(_0x7a5f0e,null))[_0x8173('0x45')](handleError(_0x7a5f0e,null));}; \ No newline at end of file +var _0x4121=['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/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','bulkCreate','bulkDestroy','addFields','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x221dcd,_0xd5ca98){var _0x321e00=function(_0x50be41){while(--_0x50be41){_0x221dcd['push'](_0x221dcd['shift']());}};_0x321e00(++_0xd5ca98);}(_0x4121,0x14b));var _0x1412=function(_0x38b88b,_0x413a0e){_0x38b88b=_0x38b88b-0x0;var _0x564386=_0x4121[_0x38b88b];return _0x564386;};'use strict';var emlformat=require(_0x1412('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1412('0x1'));var jsonpatch=require(_0x1412('0x2'));var rp=require(_0x1412('0x3'));var moment=require('moment');var BPromise=require(_0x1412('0x4'));var Mustache=require(_0x1412('0x5'));var util=require(_0x1412('0x6'));var path=require(_0x1412('0x7'));var sox=require(_0x1412('0x8'));var csv=require(_0x1412('0x9'));var ejs=require(_0x1412('0xa'));var fs=require('fs');var fs_extra=require(_0x1412('0xb'));var _=require(_0x1412('0xc'));var squel=require(_0x1412('0xd'));var crypto=require(_0x1412('0xe'));var jsforce=require(_0x1412('0xf'));var deskjs=require(_0x1412('0x10'));var toCsv=require(_0x1412('0x9'));var querystring=require(_0x1412('0x11'));var Papa=require(_0x1412('0x12'));var Redis=require(_0x1412('0x13'));var authService=require(_0x1412('0x14'));var qs=require(_0x1412('0x15'));var as=require(_0x1412('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1412('0x17'))(_0x1412('0x18'));var utils=require(_0x1412('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1412('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d539f,_0xe93370){_0xe93370=_0xe93370||0xcc;return function(_0x2905ac){if(_0x2905ac){return _0x2d539f[_0x1412('0x1b')](_0xe93370);}return _0x2d539f['status'](_0xe93370)['end']();};}function respondWithResult(_0x1d5e5b,_0x2b01a3){_0x2b01a3=_0x2b01a3||0xc8;return function(_0xecbb95){if(_0xecbb95){return _0x1d5e5b[_0x1412('0x1c')](_0x2b01a3)[_0x1412('0x1d')](_0xecbb95);}};}function respondWithFilteredResult(_0x2e2c43,_0x1c1c84){return function(_0x3c78b4){if(_0x3c78b4){var _0x418b20=typeof _0x1c1c84[_0x1412('0x1e')]===_0x1412('0x1f')&&typeof _0x1c1c84[_0x1412('0x20')]===_0x1412('0x1f');var _0x2e6182=_0x3c78b4['count'];var _0x2b14c7=_0x418b20?0x0:_0x1c1c84[_0x1412('0x1e')];var _0x4f3714=_0x418b20?_0x3c78b4[_0x1412('0x21')]:_0x1c1c84[_0x1412('0x1e')]+_0x1c1c84[_0x1412('0x20')];var _0x55c098;if(_0x4f3714>=_0x2e6182){_0x4f3714=_0x2e6182;_0x55c098=0xc8;}else{_0x55c098=0xce;}_0x2e2c43['status'](_0x55c098);return _0x2e2c43[_0x1412('0x22')](_0x1412('0x23'),_0x2b14c7+'-'+_0x4f3714+'/'+_0x2e6182)[_0x1412('0x1d')](_0x3c78b4);}return null;};}function patchUpdates(_0x328937){return function(_0x26b48d){try{jsonpatch[_0x1412('0x24')](_0x26b48d,_0x328937,!![]);}catch(_0x97d4dd){return BPromise[_0x1412('0x25')](_0x97d4dd);}return _0x26b48d[_0x1412('0x26')]();};}function saveUpdates(_0x262766,_0x3a9421){return function(_0x1c989d){if(_0x1c989d){return _0x1c989d[_0x1412('0x27')](_0x262766)[_0x1412('0x28')](function(_0x330bb5){return _0x330bb5;});}return null;};}function removeEntity(_0x18ab7c,_0x5ed15e){return function(_0x317c25){if(_0x317c25){return _0x317c25[_0x1412('0x29')]()[_0x1412('0x28')](function(){_0x18ab7c[_0x1412('0x1c')](0xcc)[_0x1412('0x2a')]();});}};}function handleEntityNotFound(_0x513fc6,_0xa7332){return function(_0x4f0e66){if(!_0x4f0e66){_0x513fc6[_0x1412('0x1b')](0x194);}return _0x4f0e66;};}function handleError(_0x3bd385,_0x2fb6be){_0x2fb6be=_0x2fb6be||0x1f4;return function(_0xda43f0){logger[_0x1412('0x2b')](_0xda43f0[_0x1412('0x2c')]);if(_0xda43f0[_0x1412('0x2d')]){delete _0xda43f0[_0x1412('0x2d')];}_0x3bd385[_0x1412('0x1c')](_0x2fb6be)[_0x1412('0x2e')](_0xda43f0);};}exports[_0x1412('0x2f')]=function(_0x2818a0,_0x1be198){var _0x114424={},_0x5e874a={},_0x4beaa3={'count':0x0,'rows':[]};var _0x3b5a9c=_[_0x1412('0x30')](db[_0x1412('0x31')][_0x1412('0x32')],function(_0x1f659b){return{'name':_0x1f659b[_0x1412('0x33')],'type':_0x1f659b[_0x1412('0x34')]['key']};});_0x5e874a[_0x1412('0x35')]=_[_0x1412('0x30')](_0x3b5a9c,_0x1412('0x2d'));_0x5e874a[_0x1412('0x36')]=_[_0x1412('0x37')](_0x2818a0[_0x1412('0x36')]);_0x5e874a[_0x1412('0x38')]=_[_0x1412('0x39')](_0x5e874a[_0x1412('0x35')],_0x5e874a[_0x1412('0x36')]);_0x114424[_0x1412('0x3a')]=_[_0x1412('0x39')](_0x5e874a['model'],qs[_0x1412('0x3b')](_0x2818a0[_0x1412('0x36')]['fields']));_0x114424[_0x1412('0x3a')]=_0x114424[_0x1412('0x3a')][_0x1412('0x3c')]?_0x114424['attributes']:_0x5e874a['model'];if(!_0x2818a0['query'][_0x1412('0x3d')](_0x1412('0x3e'))){_0x114424[_0x1412('0x20')]=qs[_0x1412('0x20')](_0x2818a0[_0x1412('0x36')]['limit']);_0x114424[_0x1412('0x1e')]=qs[_0x1412('0x1e')](_0x2818a0[_0x1412('0x36')][_0x1412('0x1e')]);}_0x114424[_0x1412('0x3f')]=qs['sort'](_0x2818a0[_0x1412('0x36')][_0x1412('0x40')]);_0x114424['where']=qs[_0x1412('0x38')](_[_0x1412('0x41')](_0x2818a0[_0x1412('0x36')],_0x5e874a['filters']),_0x3b5a9c);if(_0x2818a0[_0x1412('0x36')][_0x1412('0x42')]){_0x114424[_0x1412('0x43')]=_[_0x1412('0x44')](_0x114424['where'],{'$or':_['map'](_0x3b5a9c,function(_0x201de8){if(_0x201de8[_0x1412('0x34')]!==_0x1412('0x45')){var _0x16eef4={};_0x16eef4[_0x201de8[_0x1412('0x2d')]]={'$like':'%'+_0x2818a0[_0x1412('0x36')][_0x1412('0x42')]+'%'};return _0x16eef4;}})});}_0x114424=_[_0x1412('0x44')]({},_0x114424,_0x2818a0[_0x1412('0x46')]);var _0x111c2e={'where':_0x114424['where']};return db[_0x1412('0x31')][_0x1412('0x21')](_0x111c2e)['then'](function(_0x5643d7){_0x4beaa3[_0x1412('0x21')]=_0x5643d7;if(_0x2818a0[_0x1412('0x36')][_0x1412('0x47')]){_0x114424['include']=[{'all':!![]}];}return db[_0x1412('0x31')][_0x1412('0x48')](_0x114424);})[_0x1412('0x28')](function(_0x2f0053){_0x4beaa3['rows']=_0x2f0053;return _0x4beaa3;})[_0x1412('0x28')](respondWithFilteredResult(_0x1be198,_0x114424))[_0x1412('0x49')](handleError(_0x1be198,null));};exports['show']=function(_0x23937a,_0x2b70a4){var _0x32214b={'raw':![],'where':{'id':_0x23937a[_0x1412('0x4a')]['id']}},_0x179f88={};_0x179f88[_0x1412('0x35')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x179f88['query']=_[_0x1412('0x37')](_0x23937a[_0x1412('0x36')]);_0x179f88[_0x1412('0x38')]=_[_0x1412('0x39')](_0x179f88[_0x1412('0x35')],_0x179f88[_0x1412('0x36')]);_0x32214b['attributes']=_[_0x1412('0x39')](_0x179f88[_0x1412('0x35')],qs[_0x1412('0x3b')](_0x23937a[_0x1412('0x36')]['fields']));_0x32214b[_0x1412('0x3a')]=_0x32214b[_0x1412('0x3a')]['length']?_0x32214b[_0x1412('0x3a')]:_0x179f88[_0x1412('0x35')];if(_0x23937a[_0x1412('0x36')][_0x1412('0x47')]){_0x32214b[_0x1412('0x4b')]=[{'all':!![]}];}_0x32214b=_[_0x1412('0x44')]({},_0x32214b,_0x23937a[_0x1412('0x46')]);return db['AnalyticFieldReport'][_0x1412('0x4c')](_0x32214b)[_0x1412('0x28')](handleEntityNotFound(_0x2b70a4,null))['then'](respondWithResult(_0x2b70a4,null))[_0x1412('0x49')](handleError(_0x2b70a4,null));};exports[_0x1412('0x4d')]=function(_0x193966,_0x3f91c9){return db[_0x1412('0x31')][_0x1412('0x4d')](_0x193966[_0x1412('0x4e')],{})[_0x1412('0x28')](respondWithResult(_0x3f91c9,0xc9))[_0x1412('0x49')](handleError(_0x3f91c9,null));};exports['bulkCreate']=function(_0x206ed4,_0xdedf3b){return db[_0x1412('0x31')][_0x1412('0x4f')](_0x206ed4[_0x1412('0x4e')],{'raw':![],'individualHooks':!![]})[_0x1412('0x28')](respondWithResult(_0xdedf3b,0xc9))[_0x1412('0x49')](handleError(_0xdedf3b,null));};exports[_0x1412('0x27')]=function(_0x592613,_0x3b76bf){if(_0x592613[_0x1412('0x4e')]['id']){delete _0x592613[_0x1412('0x4e')]['id'];}return db[_0x1412('0x31')][_0x1412('0x4c')]({'where':{'id':_0x592613[_0x1412('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b76bf,null))[_0x1412('0x28')](saveUpdates(_0x592613[_0x1412('0x4e')],null))[_0x1412('0x28')](respondWithResult(_0x3b76bf,null))[_0x1412('0x49')](handleError(_0x3b76bf,null));};exports[_0x1412('0x29')]=function(_0x2b981b,_0x27bef6){return db[_0x1412('0x31')][_0x1412('0x4c')]({'where':{'id':_0x2b981b['params']['id']}})['then'](handleEntityNotFound(_0x27bef6,null))[_0x1412('0x28')](removeEntity(_0x27bef6,null))['catch'](handleError(_0x27bef6,null));};exports[_0x1412('0x50')]=function(_0x17dbfa,_0x4b4c15){return db[_0x1412('0x31')][_0x1412('0x29')]({'where':{'id':_0x17dbfa[_0x1412('0x36')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4b4c15,0xcc))[_0x1412('0x49')](handleError(_0x4b4c15,null));};exports[_0x1412('0x51')]=function(_0x280cda,_0x52f0cd,_0x4e02b9){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x280cda[_0x1412('0x4a')]['id']}})[_0x1412('0x28')](handleEntityNotFound(_0x52f0cd,null))[_0x1412('0x28')](function(_0x9bec63){if(_0x9bec63){return db[_0x1412('0x52')][_0x1412('0x53')](function(_0x1c1967){return db[_0x1412('0x31')]['destroy']({'where':{'CustomReportId':_0x280cda[_0x1412('0x4a')]['id']},'transaction':_0x1c1967})[_0x1412('0x28')](function(_0x20181c){var _0x5a3741=_['map'](_0x280cda[_0x1412('0x4e')],function(_0x240b2b){delete _0x240b2b['id'];_0x240b2b[_0x1412('0x54')]=_0x280cda[_0x1412('0x4a')]['id'];return _0x240b2b;});return db[_0x1412('0x31')][_0x1412('0x4f')](_0x5a3741,{'transaction':_0x1c1967});});})[_0x1412('0x28')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x280cda[_0x1412('0x4a')]['id']}});});}})[_0x1412('0x28')](respondWithResult(_0x52f0cd,null))[_0x1412('0x49')](handleError(_0x52f0cd,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index f43c6de..ffc6032 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 _0x3566=['define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3d79c1,_0x3e22b3){var _0x247907=function(_0x1630d1){while(--_0x1630d1){_0x3d79c1['push'](_0x3d79c1['shift']());}};_0x247907(++_0x3e22b3);}(_0x3566,0x13a));var _0x6356=function(_0x117460,_0x1445c1){_0x117460=_0x117460-0x0;var _0x7131ea=_0x3566[_0x117460];return _0x7131ea;};'use strict';var _=require(_0x6356('0x0'));var util=require(_0x6356('0x1'));var logger=require(_0x6356('0x2'))(_0x6356('0x3'));var moment=require(_0x6356('0x4'));var BPromise=require(_0x6356('0x5'));var rp=require(_0x6356('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6356('0x7'));var config=require(_0x6356('0x8'));var attributes=require(_0x6356('0x9'));module['exports']=function(_0x2c4859,_0x3d11c3){return _0x2c4859[_0x6356('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x6356('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2deb=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','api','moment','bluebird','request-promise'];(function(_0x17e30d,_0x5e59dc){var _0x11a516=function(_0x230806){while(--_0x230806){_0x17e30d['push'](_0x17e30d['shift']());}};_0x11a516(++_0x5e59dc);}(_0x2deb,0x163));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2de('0x5'));var config=require(_0xb2de('0x6'));var attributes=require(_0xb2de('0x7'));module[_0xb2de('0x8')]=function(_0x419370,_0x513f26){return _0x419370[_0xb2de('0x9')](_0xb2de('0xa'),attributes,{'tableName':_0xb2de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index acac290..40b852e 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 _0x3889=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x27a750,_0x36ba51){var _0x2f137c=function(_0x1708c6){while(--_0x1708c6){_0x27a750['push'](_0x27a750['shift']());}};_0x2f137c(++_0x36ba51);}(_0x3889,0x1dd));var _0x9388=function(_0x4f40e1,_0xa22f94){_0x4f40e1=_0x4f40e1-0x0;var _0x2e323d=_0x3889[_0x4f40e1];return _0x2e323d;};'use strict';var _=require('lodash');var util=require(_0x9388('0x0'));var moment=require(_0x9388('0x1'));var BPromise=require('bluebird');var rs=require(_0x9388('0x2'));var fs=require('fs');var Redis=require(_0x9388('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9388('0x4'));var logger=require(_0x9388('0x5'))(_0x9388('0x6'));var config=require(_0x9388('0x7'));var jayson=require(_0x9388('0x8'));var client=jayson['client'][_0x9388('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35030,_0x27f117,_0x41e856){return new BPromise(function(_0x895ec9,_0x1d5bb0){return client[_0x9388('0xa')](_0x35030,_0x41e856)[_0x9388('0xb')](function(_0x257c7b){logger[_0x9388('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x27f117,_0x9388('0xd'));logger[_0x9388('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x27f117,_0x9388('0xd'),JSON[_0x9388('0xf')](_0x257c7b));if(_0x257c7b[_0x9388('0x10')]){if(_0x257c7b[_0x9388('0x10')][_0x9388('0x11')]===0x1f4){logger[_0x9388('0x10')](_0x9388('0x12'),_0x27f117,_0x257c7b[_0x9388('0x10')]['message']);return _0x1d5bb0(_0x257c7b[_0x9388('0x10')][_0x9388('0x13')]);}logger[_0x9388('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x27f117,_0x257c7b[_0x9388('0x10')]['message']);return _0x895ec9(_0x257c7b[_0x9388('0x10')][_0x9388('0x13')]);}else{logger[_0x9388('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x27f117,_0x9388('0xd'));_0x895ec9(_0x257c7b[_0x9388('0x14')][_0x9388('0x13')]);}})[_0x9388('0x15')](function(_0x40855d){logger[_0x9388('0x10')](_0x9388('0x12'),_0x27f117,_0x40855d);_0x1d5bb0(_0x40855d);});});} \ No newline at end of file +var _0x68df=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','request\x20sent','catch','util','moment'];(function(_0x362e87,_0x38d17c){var _0x334244=function(_0x24feb8){while(--_0x24feb8){_0x362e87['push'](_0x362e87['shift']());}};_0x334244(++_0x38d17c);}(_0x68df,0x8e));var _0xf68d=function(_0x2f8177,_0x1bb2a9){_0x2f8177=_0x2f8177-0x0;var _0x249cb4=_0x68df[_0x2f8177];return _0x249cb4;};'use strict';var _=require('lodash');var util=require(_0xf68d('0x0'));var moment=require(_0xf68d('0x1'));var BPromise=require(_0xf68d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf68d('0x3'));var db=require(_0xf68d('0x4'))['db'];var utils=require(_0xf68d('0x5'));var logger=require(_0xf68d('0x6'))(_0xf68d('0x7'));var config=require(_0xf68d('0x8'));var jayson=require(_0xf68d('0x9'));var client=jayson[_0xf68d('0xa')][_0xf68d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ed860,_0x54dac4,_0x334a27){return new BPromise(function(_0x45fe1f,_0x3ea60f){return client[_0xf68d('0xc')](_0x4ed860,_0x334a27)[_0xf68d('0xd')](function(_0x326026){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x54dac4,'request\x20sent');logger[_0xf68d('0xe')](_0xf68d('0xf'),_0x54dac4,'request\x20sent',JSON[_0xf68d('0x10')](_0x326026));if(_0x326026[_0xf68d('0x11')]){if(_0x326026['error'][_0xf68d('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x54dac4,_0x326026[_0xf68d('0x11')]['message']);return _0x3ea60f(_0x326026[_0xf68d('0x11')]['message']);}logger[_0xf68d('0x11')](_0xf68d('0x13'),_0x54dac4,_0x326026[_0xf68d('0x11')][_0xf68d('0x14')]);return _0x45fe1f(_0x326026['error']['message']);}else{logger[_0xf68d('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54dac4,_0xf68d('0x16'));_0x45fe1f(_0x326026['result'][_0xf68d('0x14')]);}})[_0xf68d('0x17')](function(_0x3ad0ed){logger[_0xf68d('0x11')](_0xf68d('0x13'),_0x54dac4,_0x3ad0ed);_0x3ea60f(_0x3ad0ed);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e1709dc..4c0e9e9 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(_0x399d79,_0x11a3dc){var _0x37ee0d=function(_0xf52d2a){while(--_0xf52d2a){_0x399d79['push'](_0x399d79['shift']());}};_0x37ee0d(++_0x11a3dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x1146f4,_0xd94349){var _0x3bbae7=function(_0x325d25){while(--_0x325d25){_0x1146f4['push'](_0x1146f4['shift']());}};_0x3bbae7(++_0xd94349);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 d285e4c..bf89d86 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 _0x5bc5=['STRING','name','TEXT','sequelize','exports'];(function(_0x736eb,_0x345088){var _0x30ea13=function(_0xbdab7c){while(--_0xbdab7c){_0x736eb['push'](_0x736eb['shift']());}};_0x30ea13(++_0x345088);}(_0x5bc5,0xb2));var _0x55bc=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x5bc5[_0x128450];return _0x4d80ed;};'use strict';var Sequelize=require(_0x55bc('0x0'));module[_0x55bc('0x1')]={'name':{'type':Sequelize[_0x55bc('0x2')],'allowNull':![],'unique':_0x55bc('0x3')},'table':{'type':Sequelize[_0x55bc('0x2')]},'metric':{'type':Sequelize[_0x55bc('0x4')]},'description':{'type':Sequelize[_0x55bc('0x2')]}}; \ No newline at end of file +var _0x58e5=['exports','STRING','name','TEXT','sequelize'];(function(_0x3fcfb9,_0x3ccab1){var _0x10384b=function(_0x48e8f2){while(--_0x48e8f2){_0x3fcfb9['push'](_0x3fcfb9['shift']());}};_0x10384b(++_0x3ccab1);}(_0x58e5,0xd1));var _0x558e=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x58e5[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x558e('0x0'));module[_0x558e('0x1')]={'name':{'type':Sequelize[_0x558e('0x2')],'allowNull':![],'unique':_0x558e('0x3')},'table':{'type':Sequelize[_0x558e('0x2')]},'metric':{'type':Sequelize[_0x558e('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 94a7dae..ca62c3c 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 _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x63a32e,_0x37ab4e){var _0x152a74=function(_0x5911a1){while(--_0x5911a1){_0x63a32e['push'](_0x63a32e['shift']());}};_0x152a74(++_0x37ab4e);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));}; \ No newline at end of file +var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x1c48fb,_0x591978){var _0xdf2526=function(_0x642e1c){while(--_0x642e1c){_0x1c48fb['push'](_0x1c48fb['shift']());}};_0xdf2526(++_0x591978);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x24ca[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index edb4197..0c19b96 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 _0x6075=['path','rimraf','../../config/environment','exports','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x6075,0x191));var _0x5607=function(_0x184abd,_0x49b194){_0x184abd=_0x184abd-0x0;var _0x524c6d=_0x6075[_0x184abd];return _0x524c6d;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('AnalyticMetric',attributes,{'tableName':_0x5607('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd8=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3044e3,_0x255336){var _0x389181=function(_0x4aac71){while(--_0x4aac71){_0x3044e3['push'](_0x3044e3['shift']());}};_0x389181(++_0x255336);}(_0x2bd8,0x130));var _0x82bd=function(_0x56c09e,_0x5e5255){_0x56c09e=_0x56c09e-0x0;var _0x4830ef=_0x2bd8[_0x56c09e];return _0x4830ef;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index e4d42b1..81b99f0 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 _0x7f87=['../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7f87,0x65));var _0x77f8=function(_0x43821a,_0x549fde){_0x43821a=_0x43821a-0x0;var _0x126d3e=_0x7f87[_0x43821a];return _0x126d3e;};'use strict';var _=require(_0x77f8('0x0'));var util=require(_0x77f8('0x1'));var moment=require(_0x77f8('0x2'));var BPromise=require(_0x77f8('0x3'));var rs=require(_0x77f8('0x4'));var fs=require('fs');var Redis=require(_0x77f8('0x5'));var db=require(_0x77f8('0x6'))['db'];var utils=require(_0x77f8('0x7'));var logger=require(_0x77f8('0x8'))('rpc');var config=require(_0x77f8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x77f8('0xa')][_0x77f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44b59e,_0x316eea,_0x31ea4f){return new BPromise(function(_0x15098b,_0x22b3c9){return client[_0x77f8('0xc')](_0x44b59e,_0x31ea4f)[_0x77f8('0xd')](function(_0x5211a6){logger['info'](_0x77f8('0xe'),_0x316eea,_0x77f8('0xf'));logger['debug'](_0x77f8('0x10'),_0x316eea,'request\x20sent',JSON['stringify'](_0x5211a6));if(_0x5211a6[_0x77f8('0x11')]){if(_0x5211a6[_0x77f8('0x11')][_0x77f8('0x12')]===0x1f4){logger['error'](_0x77f8('0xe'),_0x316eea,_0x5211a6['error'][_0x77f8('0x13')]);return _0x22b3c9(_0x5211a6[_0x77f8('0x11')][_0x77f8('0x13')]);}logger[_0x77f8('0x11')](_0x77f8('0xe'),_0x316eea,_0x5211a6[_0x77f8('0x11')]['message']);return _0x15098b(_0x5211a6[_0x77f8('0x11')]['message']);}else{logger[_0x77f8('0x14')](_0x77f8('0xe'),_0x316eea,_0x77f8('0xf'));_0x15098b(_0x5211a6['result'][_0x77f8('0x13')]);}})[_0x77f8('0x15')](function(_0x51a469){logger[_0x77f8('0x11')](_0x77f8('0xe'),_0x316eea,_0x51a469);_0x22b3c9(_0x51a469);});});} \ No newline at end of file +var _0x28e2=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x3005bc,_0xeea208){var _0x236d5d=function(_0x1c982d){while(--_0x1c982d){_0x3005bc['push'](_0x3005bc['shift']());}};_0x236d5d(++_0xeea208);}(_0x28e2,0x8e));var _0x228e=function(_0x4ac208,_0x346596){_0x4ac208=_0x4ac208-0x0;var _0x20078f=_0x28e2[_0x4ac208];return _0x20078f;};'use strict';var _=require(_0x228e('0x0'));var util=require('util');var moment=require(_0x228e('0x1'));var BPromise=require(_0x228e('0x2'));var rs=require(_0x228e('0x3'));var fs=require('fs');var Redis=require(_0x228e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x228e('0x5'));var logger=require(_0x228e('0x6'))('rpc');var config=require(_0x228e('0x7'));var jayson=require(_0x228e('0x8'));var client=jayson['client'][_0x228e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a1e3c,_0x36610d,_0x363090){return new BPromise(function(_0x2d915d,_0x3205d5){return client['request'](_0x5a1e3c,_0x363090)[_0x228e('0xa')](function(_0x51d27f){logger[_0x228e('0xb')](_0x228e('0xc'),_0x36610d,_0x228e('0xd'));logger[_0x228e('0xe')](_0x228e('0xf'),_0x36610d,_0x228e('0xd'),JSON[_0x228e('0x10')](_0x51d27f));if(_0x51d27f[_0x228e('0x11')]){if(_0x51d27f[_0x228e('0x11')][_0x228e('0x12')]===0x1f4){logger['error'](_0x228e('0xc'),_0x36610d,_0x51d27f[_0x228e('0x11')]['message']);return _0x3205d5(_0x51d27f[_0x228e('0x11')]['message']);}logger[_0x228e('0x11')](_0x228e('0xc'),_0x36610d,_0x51d27f[_0x228e('0x11')][_0x228e('0x13')]);return _0x2d915d(_0x51d27f[_0x228e('0x11')][_0x228e('0x13')]);}else{logger[_0x228e('0xb')](_0x228e('0xc'),_0x36610d,'request\x20sent');_0x2d915d(_0x51d27f[_0x228e('0x14')][_0x228e('0x13')]);}})[_0x228e('0x15')](function(_0x1d84cc){logger[_0x228e('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x36610d,_0x1d84cc);_0x3205d5(_0x1d84cc);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index fe9a8eb..8904bfd 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 _0x455d=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x5866a9,_0x8e6869){var _0x4ca549=function(_0x10969d){while(--_0x10969d){_0x5866a9['push'](_0x5866a9['shift']());}};_0x4ca549(++_0x8e6869);}(_0x455d,0x190));var _0xd455=function(_0x4cccd7,_0x317cfd){_0x4cccd7=_0x4cccd7-0x0;var _0x118dcf=_0x455d[_0x4cccd7];return _0x118dcf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['post']('/',auth[_0xd455('0x9')](),controller[_0xd455('0xc')]);router[_0xd455('0xd')](_0xd455('0xe'),auth['isAuthenticated'](),controller[_0xd455('0xf')]);router[_0xd455('0x10')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);module[_0xd455('0x12')]=router; \ No newline at end of file +var _0x4491=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x436f43,_0x5e9728){var _0x595bde=function(_0x31ed6a){while(--_0x31ed6a){_0x436f43['push'](_0x436f43['shift']());}};_0x595bde(++_0x5e9728);}(_0x4491,0x1bb));var _0x1449=function(_0x3dc3e0,_0x534c19){_0x3dc3e0=_0x3dc3e0-0x0;var _0x2232d7=_0x4491[_0x3dc3e0];return _0x2232d7;};'use strict';var multer=require(_0x1449('0x0'));var util=require('util');var path=require(_0x1449('0x1'));var timeout=require('connect-timeout');var express=require(_0x1449('0x2'));var router=express[_0x1449('0x3')]();var fs_extra=require(_0x1449('0x4'));var auth=require(_0x1449('0x5'));var interaction=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var controller=require('./analyticMetric.controller');router[_0x1449('0x8')]('/',auth['isAuthenticated'](),controller[_0x1449('0x9')]);router[_0x1449('0x8')](_0x1449('0xa'),auth[_0x1449('0xb')](),controller[_0x1449('0xc')]);router[_0x1449('0xd')]('/',auth['isAuthenticated'](),controller[_0x1449('0xe')]);router[_0x1449('0xf')]('/:id',auth[_0x1449('0xb')](),controller[_0x1449('0x10')]);router['delete'](_0x1449('0xa'),auth[_0x1449('0xb')](),controller['destroy']);module[_0x1449('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9deb262..09ad35b 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 _0xdfba=['exports','TEXT','sequelize'];(function(_0x14e239,_0x129be9){var _0x154c94=function(_0x4ea187){while(--_0x4ea187){_0x14e239['push'](_0x14e239['shift']());}};_0x154c94(++_0x129be9);}(_0xdfba,0x1cd));var _0xadfb=function(_0x422045,_0x3e8d52){_0x422045=_0x422045-0x0;var _0x44e444=_0xdfba[_0x422045];return _0x44e444;};'use strict';var Sequelize=require(_0xadfb('0x0'));module[_0xadfb('0x1')]={'tree':{'type':Sequelize[_0xadfb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc302=['TEXT','exports'];(function(_0x3a55cf,_0x5aa77b){var _0x2dc991=function(_0x3d7a41){while(--_0x3d7a41){_0x3a55cf['push'](_0x3a55cf['shift']());}};_0x2dc991(++_0x5aa77b);}(_0xc302,0x187));var _0x2c30=function(_0x2fdd4f,_0x5eecfd){_0x2fdd4f=_0x2fdd4f-0x0;var _0x5ebfbd=_0xc302[_0x2fdd4f];return _0x5ebfbd;};'use strict';var Sequelize=require('sequelize');module[_0x2c30('0x0')]={'tree':{'type':Sequelize[_0x2c30('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 5fac497..9c38545 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 _0xaf54=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','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','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','key','keys'];(function(_0x2efa93,_0x4e18c4){var _0x42c19d=function(_0x4837d2){while(--_0x4837d2){_0x2efa93['push'](_0x2efa93['shift']());}};_0x42c19d(++_0x4e18c4);}(_0xaf54,0x191));var _0x4af5=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0xaf54[_0x15fc7a];return _0x3aa9f4;};'use strict';var emlformat=require(_0x4af5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4af5('0x1'));var jsonpatch=require(_0x4af5('0x2'));var rp=require('request-promise');var moment=require(_0x4af5('0x3'));var BPromise=require(_0x4af5('0x4'));var Mustache=require(_0x4af5('0x5'));var util=require(_0x4af5('0x6'));var path=require(_0x4af5('0x7'));var sox=require('sox');var csv=require(_0x4af5('0x8'));var ejs=require(_0x4af5('0x9'));var fs=require('fs');var fs_extra=require(_0x4af5('0xa'));var _=require(_0x4af5('0xb'));var squel=require('squel');var crypto=require(_0x4af5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4af5('0xd'));var toCsv=require(_0x4af5('0x8'));var querystring=require(_0x4af5('0xe'));var Papa=require(_0x4af5('0xf'));var Redis=require(_0x4af5('0x10'));var authService=require(_0x4af5('0x11'));var qs=require(_0x4af5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4af5('0x13'));var logger=require('../../config/logger')(_0x4af5('0x14'));var utils=require(_0x4af5('0x15'));var config=require(_0x4af5('0x16'));var licenseUtil=require(_0x4af5('0x17'));var db=require(_0x4af5('0x18'))['db'];function respondWithStatusCode(_0x446799,_0x51a5fb){_0x51a5fb=_0x51a5fb||0xcc;return function(_0x3f12a0){if(_0x3f12a0){return _0x446799[_0x4af5('0x19')](_0x51a5fb);}return _0x446799[_0x4af5('0x1a')](_0x51a5fb)[_0x4af5('0x1b')]();};}function respondWithResult(_0x30fdaf,_0x18c9d7){_0x18c9d7=_0x18c9d7||0xc8;return function(_0x33fc4d){if(_0x33fc4d){return _0x30fdaf[_0x4af5('0x1a')](_0x18c9d7)[_0x4af5('0x1c')](_0x33fc4d);}};}function respondWithFilteredResult(_0x1c8c56,_0x1c4931){return function(_0x374980){if(_0x374980){var _0x177e67=typeof _0x1c4931[_0x4af5('0x1d')]==='undefined'&&typeof _0x1c4931[_0x4af5('0x1e')]===_0x4af5('0x1f');var _0x2b8e50=_0x374980[_0x4af5('0x20')];var _0x73e3f=_0x177e67?0x0:_0x1c4931[_0x4af5('0x1d')];var _0x212526=_0x177e67?_0x374980[_0x4af5('0x20')]:_0x1c4931['offset']+_0x1c4931[_0x4af5('0x1e')];var _0x2e41f7;if(_0x212526>=_0x2b8e50){_0x212526=_0x2b8e50;_0x2e41f7=0xc8;}else{_0x2e41f7=0xce;}_0x1c8c56[_0x4af5('0x1a')](_0x2e41f7);return _0x1c8c56[_0x4af5('0x21')](_0x4af5('0x22'),_0x73e3f+'-'+_0x212526+'/'+_0x2b8e50)[_0x4af5('0x1c')](_0x374980);}return null;};}function patchUpdates(_0x4e1142){return function(_0x28b15f){try{jsonpatch[_0x4af5('0x23')](_0x28b15f,_0x4e1142,!![]);}catch(_0x34e703){return BPromise['reject'](_0x34e703);}return _0x28b15f['save']();};}function saveUpdates(_0x1e9dca,_0x28ece3){return function(_0x492763){if(_0x492763){return _0x492763[_0x4af5('0x24')](_0x1e9dca)[_0x4af5('0x25')](function(_0x47a328){return _0x47a328;});}return null;};}function removeEntity(_0x11372c,_0x8f9ac9){return function(_0x246d9c){if(_0x246d9c){return _0x246d9c[_0x4af5('0x26')]()[_0x4af5('0x25')](function(){_0x11372c['status'](0xcc)[_0x4af5('0x1b')]();});}};}function handleEntityNotFound(_0x5359c8,_0x10b699){return function(_0x415ab2){if(!_0x415ab2){_0x5359c8['sendStatus'](0x194);}return _0x415ab2;};}function handleError(_0x1b4310,_0xc5d7a){_0xc5d7a=_0xc5d7a||0x1f4;return function(_0x505b1a){logger[_0x4af5('0x27')](_0x505b1a[_0x4af5('0x28')]);if(_0x505b1a[_0x4af5('0x29')]){delete _0x505b1a[_0x4af5('0x29')];}_0x1b4310[_0x4af5('0x1a')](_0xc5d7a)[_0x4af5('0x2a')](_0x505b1a);};}exports[_0x4af5('0x2b')]=function(_0x455aec,_0x14a86f){var _0x3bfd3f={},_0x501a9b={},_0x37d6f3={'count':0x0,'rows':[]};var _0x225ba6=_[_0x4af5('0x2c')](db[_0x4af5('0x2d')][_0x4af5('0x2e')],function(_0x5187dc){return{'name':_0x5187dc['fieldName'],'type':_0x5187dc['type'][_0x4af5('0x2f')]};});_0x501a9b['model']=_[_0x4af5('0x2c')](_0x225ba6,'name');_0x501a9b['query']=_[_0x4af5('0x30')](_0x455aec[_0x4af5('0x31')]);_0x501a9b[_0x4af5('0x32')]=_[_0x4af5('0x33')](_0x501a9b[_0x4af5('0x34')],_0x501a9b['query']);_0x3bfd3f[_0x4af5('0x35')]=_['intersection'](_0x501a9b[_0x4af5('0x34')],qs[_0x4af5('0x36')](_0x455aec[_0x4af5('0x31')]['fields']));_0x3bfd3f[_0x4af5('0x35')]=_0x3bfd3f['attributes'][_0x4af5('0x37')]?_0x3bfd3f['attributes']:_0x501a9b[_0x4af5('0x34')];if(!_0x455aec[_0x4af5('0x31')][_0x4af5('0x38')](_0x4af5('0x39'))){_0x3bfd3f['limit']=qs[_0x4af5('0x1e')](_0x455aec[_0x4af5('0x31')][_0x4af5('0x1e')]);_0x3bfd3f[_0x4af5('0x1d')]=qs['offset'](_0x455aec[_0x4af5('0x31')]['offset']);}_0x3bfd3f[_0x4af5('0x3a')]=qs['sort'](_0x455aec['query'][_0x4af5('0x3b')]);_0x3bfd3f[_0x4af5('0x3c')]=qs[_0x4af5('0x32')](_[_0x4af5('0x3d')](_0x455aec[_0x4af5('0x31')],_0x501a9b['filters']),_0x225ba6);if(_0x455aec[_0x4af5('0x31')][_0x4af5('0x3e')]){_0x3bfd3f[_0x4af5('0x3c')]=_[_0x4af5('0x3f')](_0x3bfd3f[_0x4af5('0x3c')],{'$or':_['map'](_0x225ba6,function(_0xddd75e){if(_0xddd75e[_0x4af5('0x40')]!==_0x4af5('0x41')){var _0x5b138c={};_0x5b138c[_0xddd75e[_0x4af5('0x29')]]={'$like':'%'+_0x455aec['query'][_0x4af5('0x3e')]+'%'};return _0x5b138c;}})});}_0x3bfd3f=_[_0x4af5('0x3f')]({},_0x3bfd3f,_0x455aec[_0x4af5('0x42')]);var _0x130fa8={'where':_0x3bfd3f[_0x4af5('0x3c')]};return db[_0x4af5('0x2d')][_0x4af5('0x20')](_0x130fa8)[_0x4af5('0x25')](function(_0xda7007){_0x37d6f3[_0x4af5('0x20')]=_0xda7007;if(_0x455aec[_0x4af5('0x31')]['includeAll']){_0x3bfd3f[_0x4af5('0x43')]=[{'all':!![]}];}return db[_0x4af5('0x2d')][_0x4af5('0x44')](_0x3bfd3f);})['then'](function(_0x526620){_0x37d6f3['rows']=_0x526620;return _0x37d6f3;})['then'](respondWithFilteredResult(_0x14a86f,_0x3bfd3f))[_0x4af5('0x45')](handleError(_0x14a86f,null));};exports[_0x4af5('0x46')]=function(_0x2b0d21,_0x4966d1){var _0x5834b3={'raw':!![],'where':{'id':_0x2b0d21['params']['id']}},_0x35bc85={};_0x35bc85[_0x4af5('0x34')]=_[_0x4af5('0x30')](db['AnalyticTreeReport'][_0x4af5('0x2e')]);_0x35bc85[_0x4af5('0x31')]=_[_0x4af5('0x30')](_0x2b0d21[_0x4af5('0x31')]);_0x35bc85[_0x4af5('0x32')]=_[_0x4af5('0x33')](_0x35bc85[_0x4af5('0x34')],_0x35bc85[_0x4af5('0x31')]);_0x5834b3[_0x4af5('0x35')]=_[_0x4af5('0x33')](_0x35bc85['model'],qs[_0x4af5('0x36')](_0x2b0d21[_0x4af5('0x31')][_0x4af5('0x36')]));_0x5834b3['attributes']=_0x5834b3['attributes']['length']?_0x5834b3[_0x4af5('0x35')]:_0x35bc85[_0x4af5('0x34')];if(_0x2b0d21[_0x4af5('0x31')]['includeAll']){_0x5834b3[_0x4af5('0x43')]=[{'all':!![]}];}_0x5834b3=_[_0x4af5('0x3f')]({},_0x5834b3,_0x2b0d21['options']);return db[_0x4af5('0x2d')][_0x4af5('0x47')](_0x5834b3)['then'](handleEntityNotFound(_0x4966d1,null))[_0x4af5('0x25')](respondWithResult(_0x4966d1,null))['catch'](handleError(_0x4966d1,null));};exports[_0x4af5('0x48')]=function(_0x160f42,_0x51d25f){return db[_0x4af5('0x2d')][_0x4af5('0x48')](_0x160f42[_0x4af5('0x49')],{})[_0x4af5('0x25')](respondWithResult(_0x51d25f,0xc9))[_0x4af5('0x45')](handleError(_0x51d25f,null));};exports[_0x4af5('0x24')]=function(_0x262939,_0x4f9931){if(_0x262939['body']['id']){delete _0x262939['body']['id'];}return db[_0x4af5('0x2d')][_0x4af5('0x47')]({'where':{'id':_0x262939[_0x4af5('0x4a')]['id']}})[_0x4af5('0x25')](handleEntityNotFound(_0x4f9931,null))[_0x4af5('0x25')](saveUpdates(_0x262939['body'],null))[_0x4af5('0x25')](respondWithResult(_0x4f9931,null))['catch'](handleError(_0x4f9931,null));};exports[_0x4af5('0x26')]=function(_0x56d08f,_0x57036a){return db['AnalyticTreeReport'][_0x4af5('0x47')]({'where':{'id':_0x56d08f[_0x4af5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57036a,null))[_0x4af5('0x25')](removeEntity(_0x57036a,null))[_0x4af5('0x45')](handleError(_0x57036a,null));}; \ No newline at end of file +var _0x84f0=['../../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','limit','set','apply','reject','update','then','destroy','end','error','name','send','AnalyticTreeReport','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','rows','catch','keys','length','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x197005,_0x1d8b1b){var _0x5501e1=function(_0x5625d5){while(--_0x5625d5){_0x197005['push'](_0x197005['shift']());}};_0x5501e1(++_0x1d8b1b);}(_0x84f0,0x1aa));var _0x084f=function(_0x23c2ff,_0x9e7163){_0x23c2ff=_0x23c2ff-0x0;var _0x5f55ef=_0x84f0[_0x23c2ff];return _0x5f55ef;};'use strict';var emlformat=require(_0x084f('0x0'));var rimraf=require(_0x084f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x084f('0x2'));var rp=require(_0x084f('0x3'));var moment=require(_0x084f('0x4'));var BPromise=require(_0x084f('0x5'));var Mustache=require(_0x084f('0x6'));var util=require(_0x084f('0x7'));var path=require(_0x084f('0x8'));var sox=require(_0x084f('0x9'));var csv=require(_0x084f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x084f('0xb'));var _=require(_0x084f('0xc'));var squel=require('squel');var crypto=require(_0x084f('0xd'));var jsforce=require(_0x084f('0xe'));var deskjs=require(_0x084f('0xf'));var toCsv=require(_0x084f('0xa'));var querystring=require(_0x084f('0x10'));var Papa=require('papaparse');var Redis=require(_0x084f('0x11'));var authService=require(_0x084f('0x12'));var qs=require(_0x084f('0x13'));var as=require(_0x084f('0x14'));var hardwareService=require(_0x084f('0x15'));var logger=require(_0x084f('0x16'))(_0x084f('0x17'));var utils=require(_0x084f('0x18'));var config=require(_0x084f('0x19'));var licenseUtil=require(_0x084f('0x1a'));var db=require(_0x084f('0x1b'))['db'];function respondWithStatusCode(_0x3297ed,_0x6d923f){_0x6d923f=_0x6d923f||0xcc;return function(_0x10b897){if(_0x10b897){return _0x3297ed[_0x084f('0x1c')](_0x6d923f);}return _0x3297ed[_0x084f('0x1d')](_0x6d923f)['end']();};}function respondWithResult(_0x2b058d,_0x465709){_0x465709=_0x465709||0xc8;return function(_0xd282e3){if(_0xd282e3){return _0x2b058d[_0x084f('0x1d')](_0x465709)[_0x084f('0x1e')](_0xd282e3);}};}function respondWithFilteredResult(_0x49e853,_0x4e5a37){return function(_0x3bebc6){if(_0x3bebc6){var _0x346c40=typeof _0x4e5a37[_0x084f('0x1f')]===_0x084f('0x20')&&typeof _0x4e5a37['limit']==='undefined';var _0x331651=_0x3bebc6['count'];var _0x56cb5e=_0x346c40?0x0:_0x4e5a37['offset'];var _0x331b5b=_0x346c40?_0x3bebc6[_0x084f('0x21')]:_0x4e5a37[_0x084f('0x1f')]+_0x4e5a37[_0x084f('0x22')];var _0x5def7d;if(_0x331b5b>=_0x331651){_0x331b5b=_0x331651;_0x5def7d=0xc8;}else{_0x5def7d=0xce;}_0x49e853[_0x084f('0x1d')](_0x5def7d);return _0x49e853[_0x084f('0x23')]('Content-Range',_0x56cb5e+'-'+_0x331b5b+'/'+_0x331651)[_0x084f('0x1e')](_0x3bebc6);}return null;};}function patchUpdates(_0x3678f7){return function(_0x34eff5){try{jsonpatch[_0x084f('0x24')](_0x34eff5,_0x3678f7,!![]);}catch(_0x24dd96){return BPromise[_0x084f('0x25')](_0x24dd96);}return _0x34eff5['save']();};}function saveUpdates(_0x3e95e8,_0x327ee1){return function(_0x2671d9){if(_0x2671d9){return _0x2671d9[_0x084f('0x26')](_0x3e95e8)[_0x084f('0x27')](function(_0x19f899){return _0x19f899;});}return null;};}function removeEntity(_0x3245c0,_0x21adc6){return function(_0x1ea55e){if(_0x1ea55e){return _0x1ea55e[_0x084f('0x28')]()['then'](function(){_0x3245c0[_0x084f('0x1d')](0xcc)[_0x084f('0x29')]();});}};}function handleEntityNotFound(_0x400154,_0xf49090){return function(_0x56873c){if(!_0x56873c){_0x400154[_0x084f('0x1c')](0x194);}return _0x56873c;};}function handleError(_0x562afc,_0x3abcc5){_0x3abcc5=_0x3abcc5||0x1f4;return function(_0x5d173b){logger[_0x084f('0x2a')](_0x5d173b['stack']);if(_0x5d173b[_0x084f('0x2b')]){delete _0x5d173b[_0x084f('0x2b')];}_0x562afc[_0x084f('0x1d')](_0x3abcc5)[_0x084f('0x2c')](_0x5d173b);};}exports['index']=function(_0x421b49,_0x4ff872){var _0x5db2c9={},_0x30b722={},_0x338cea={'count':0x0,'rows':[]};var _0x5619f7=_['map'](db[_0x084f('0x2d')][_0x084f('0x2e')],function(_0x133232){return{'name':_0x133232[_0x084f('0x2f')],'type':_0x133232['type']['key']};});_0x30b722[_0x084f('0x30')]=_[_0x084f('0x31')](_0x5619f7,'name');_0x30b722[_0x084f('0x32')]=_['keys'](_0x421b49[_0x084f('0x32')]);_0x30b722[_0x084f('0x33')]=_[_0x084f('0x34')](_0x30b722[_0x084f('0x30')],_0x30b722['query']);_0x5db2c9['attributes']=_['intersection'](_0x30b722[_0x084f('0x30')],qs['fields'](_0x421b49[_0x084f('0x32')][_0x084f('0x35')]));_0x5db2c9['attributes']=_0x5db2c9[_0x084f('0x36')]['length']?_0x5db2c9[_0x084f('0x36')]:_0x30b722[_0x084f('0x30')];if(!_0x421b49['query'][_0x084f('0x37')]('nolimit')){_0x5db2c9[_0x084f('0x22')]=qs[_0x084f('0x22')](_0x421b49[_0x084f('0x32')][_0x084f('0x22')]);_0x5db2c9[_0x084f('0x1f')]=qs[_0x084f('0x1f')](_0x421b49[_0x084f('0x32')][_0x084f('0x1f')]);}_0x5db2c9[_0x084f('0x38')]=qs['sort'](_0x421b49[_0x084f('0x32')][_0x084f('0x39')]);_0x5db2c9[_0x084f('0x3a')]=qs['filters'](_[_0x084f('0x3b')](_0x421b49[_0x084f('0x32')],_0x30b722[_0x084f('0x33')]),_0x5619f7);if(_0x421b49[_0x084f('0x32')][_0x084f('0x3c')]){_0x5db2c9['where']=_[_0x084f('0x3d')](_0x5db2c9[_0x084f('0x3a')],{'$or':_[_0x084f('0x31')](_0x5619f7,function(_0x17b9a0){if(_0x17b9a0[_0x084f('0x3e')]!=='VIRTUAL'){var _0x178b1a={};_0x178b1a[_0x17b9a0[_0x084f('0x2b')]]={'$like':'%'+_0x421b49[_0x084f('0x32')][_0x084f('0x3c')]+'%'};return _0x178b1a;}})});}_0x5db2c9=_[_0x084f('0x3d')]({},_0x5db2c9,_0x421b49['options']);var _0x2c72d1={'where':_0x5db2c9[_0x084f('0x3a')]};return db['AnalyticTreeReport'][_0x084f('0x21')](_0x2c72d1)[_0x084f('0x27')](function(_0x1bf3cb){_0x338cea[_0x084f('0x21')]=_0x1bf3cb;if(_0x421b49[_0x084f('0x32')][_0x084f('0x3f')]){_0x5db2c9[_0x084f('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x5db2c9);})[_0x084f('0x27')](function(_0x2fc743){_0x338cea[_0x084f('0x41')]=_0x2fc743;return _0x338cea;})[_0x084f('0x27')](respondWithFilteredResult(_0x4ff872,_0x5db2c9))[_0x084f('0x42')](handleError(_0x4ff872,null));};exports['show']=function(_0x2e3d14,_0x4852f7){var _0x28b65a={'raw':!![],'where':{'id':_0x2e3d14['params']['id']}},_0x4d93ee={};_0x4d93ee[_0x084f('0x30')]=_[_0x084f('0x43')](db[_0x084f('0x2d')][_0x084f('0x2e')]);_0x4d93ee[_0x084f('0x32')]=_[_0x084f('0x43')](_0x2e3d14[_0x084f('0x32')]);_0x4d93ee['filters']=_['intersection'](_0x4d93ee[_0x084f('0x30')],_0x4d93ee['query']);_0x28b65a['attributes']=_[_0x084f('0x34')](_0x4d93ee[_0x084f('0x30')],qs[_0x084f('0x35')](_0x2e3d14[_0x084f('0x32')][_0x084f('0x35')]));_0x28b65a[_0x084f('0x36')]=_0x28b65a[_0x084f('0x36')][_0x084f('0x44')]?_0x28b65a[_0x084f('0x36')]:_0x4d93ee['model'];if(_0x2e3d14[_0x084f('0x32')][_0x084f('0x3f')]){_0x28b65a[_0x084f('0x40')]=[{'all':!![]}];}_0x28b65a=_[_0x084f('0x3d')]({},_0x28b65a,_0x2e3d14[_0x084f('0x45')]);return db['AnalyticTreeReport'][_0x084f('0x46')](_0x28b65a)[_0x084f('0x27')](handleEntityNotFound(_0x4852f7,null))[_0x084f('0x27')](respondWithResult(_0x4852f7,null))[_0x084f('0x42')](handleError(_0x4852f7,null));};exports[_0x084f('0x47')]=function(_0x3bed7b,_0x41087b){return db[_0x084f('0x2d')][_0x084f('0x47')](_0x3bed7b[_0x084f('0x48')],{})[_0x084f('0x27')](respondWithResult(_0x41087b,0xc9))[_0x084f('0x42')](handleError(_0x41087b,null));};exports[_0x084f('0x26')]=function(_0x473884,_0x496de0){if(_0x473884[_0x084f('0x48')]['id']){delete _0x473884[_0x084f('0x48')]['id'];}return db['AnalyticTreeReport'][_0x084f('0x46')]({'where':{'id':_0x473884['params']['id']}})[_0x084f('0x27')](handleEntityNotFound(_0x496de0,null))['then'](saveUpdates(_0x473884[_0x084f('0x48')],null))[_0x084f('0x27')](respondWithResult(_0x496de0,null))[_0x084f('0x42')](handleError(_0x496de0,null));};exports[_0x084f('0x28')]=function(_0x2f37f1,_0x4caf2a){return db[_0x084f('0x2d')]['find']({'where':{'id':_0x2f37f1[_0x084f('0x49')]['id']}})[_0x084f('0x27')](handleEntityNotFound(_0x4caf2a,null))[_0x084f('0x27')](removeEntity(_0x4caf2a,null))['catch'](handleError(_0x4caf2a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 790a5d2..857e9ff 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 _0x9566=['analytics_report_trees','lodash','util','api','request-promise','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9566,0x1f0));var _0x6956=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9566[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x6956('0x0'));var util=require(_0x6956('0x1'));var logger=require('../../config/logger')(_0x6956('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6956('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6956('0x4'));module[_0x6956('0x5')]=function(_0x1e61d9,_0x26be16){return _0x1e61d9[_0x6956('0x6')](_0x6956('0x7'),attributes,{'tableName':_0x6956('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6a6=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x5cf76b,_0xfbf968){var _0x50d61f=function(_0x5a4bd0){while(--_0x5a4bd0){_0x5cf76b['push'](_0x5cf76b['shift']());}};_0x50d61f(++_0xfbf968);}(_0xf6a6,0x74));var _0x6f6a=function(_0x12bd12,_0x463566){_0x12bd12=_0x12bd12-0x0;var _0x57c035=_0xf6a6[_0x12bd12];return _0x57c035;};'use strict';var _=require(_0x6f6a('0x0'));var util=require(_0x6f6a('0x1'));var logger=require(_0x6f6a('0x2'))('api');var moment=require(_0x6f6a('0x3'));var BPromise=require(_0x6f6a('0x4'));var rp=require(_0x6f6a('0x5'));var fs=require('fs');var path=require(_0x6f6a('0x6'));var rimraf=require(_0x6f6a('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f6a('0x8'));module[_0x6f6a('0x9')]=function(_0x1a24d0,_0x4a818f){return _0x1a24d0[_0x6f6a('0xa')](_0x6f6a('0xb'),attributes,{'tableName':_0x6f6a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 88a3153..36fba5f 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 _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(_0x4b17bd,_0x36025c){var _0x521516=function(_0x12f4f){while(--_0x12f4f){_0x4b17bd['push'](_0x4b17bd['shift']());}};_0x521516(++_0x36025c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52bf5a,_0x47bb35){_0x52bf5a=_0x52bf5a-0x0;var _0xd5b6e8=_0x5f2f[_0x52bf5a];return _0xd5b6e8;};'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 +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(_0x3855c5,_0x3366bc){var _0x1b1cd7=function(_0x32e1f3){while(--_0x32e1f3){_0x3855c5['push'](_0x3855c5['shift']());}};_0x1b1cd7(++_0x3366bc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e84f507..4a477ce 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 _0x0365=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','put','update','delete','/:id','multer','util','path','express'];(function(_0x428c2f,_0x1ca58d){var _0x57a1d1=function(_0x1114b8){while(--_0x1114b8){_0x428c2f['push'](_0x428c2f['shift']());}};_0x57a1d1(++_0x1ca58d);}(_0x0365,0x12c));var _0x5036=function(_0x12baa8,_0x43ce92){_0x12baa8=_0x12baa8-0x0;var _0x49e7b7=_0x0365[_0x12baa8];return _0x49e7b7;};'use strict';var multer=require(_0x5036('0x0'));var util=require(_0x5036('0x1'));var path=require(_0x5036('0x2'));var timeout=require('connect-timeout');var express=require(_0x5036('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5036('0x4'));var interaction=require(_0x5036('0x5'));var config=require(_0x5036('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x5036('0x7')](),controller[_0x5036('0x8')]);router[_0x5036('0x9')]('/:id',auth[_0x5036('0x7')](),controller[_0x5036('0xa')]);router[_0x5036('0xb')]('/',auth[_0x5036('0x7')](),controller['create']);router[_0x5036('0xc')]('/:id',auth[_0x5036('0x7')](),controller[_0x5036('0xd')]);router[_0x5036('0xe')](_0x5036('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8f76=['index','/:id','show','post','create','put','update','delete','destroy','util','express','Router','fs-extra','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8f76,0x1d4));var _0x68f7=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x8f76[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require('multer');var util=require(_0x68f7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x68f7('0x1'));var router=express[_0x68f7('0x2')]();var fs_extra=require(_0x68f7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x68f7('0x4'));var controller=require(_0x68f7('0x5'));router[_0x68f7('0x6')]('/',auth[_0x68f7('0x7')](),controller[_0x68f7('0x8')]);router['get'](_0x68f7('0x9'),auth[_0x68f7('0x7')](),controller[_0x68f7('0xa')]);router[_0x68f7('0xb')]('/',auth[_0x68f7('0x7')](),controller[_0x68f7('0xc')]);router[_0x68f7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x68f7('0xe')]);router[_0x68f7('0xf')](_0x68f7('0x9'),auth[_0x68f7('0x7')](),controller[_0x68f7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c046b57..9e85da0 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 _0x616c=['exports','STRING'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x616c,0x1b6));var _0xc616=function(_0x42177a,_0x488f2f){_0x42177a=_0x42177a-0x0;var _0x43aeac=_0x616c[_0x42177a];return _0x43aeac;};'use strict';var Sequelize=require('sequelize');module[_0xc616('0x0')]={'name':{'type':Sequelize[_0xc616('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc616('0x1')]}}; \ No newline at end of file +var _0x0f3c=['exports','sequelize'];(function(_0xd66229,_0x4bdfc6){var _0xc91000=function(_0x1c5242){while(--_0x1c5242){_0xd66229['push'](_0xd66229['shift']());}};_0xc91000(++_0x4bdfc6);}(_0x0f3c,0x189));var _0xc0f3=function(_0x517d06,_0x3e9cb1){_0x517d06=_0x517d06-0x0;var _0x4bca7a=_0x0f3c[_0x517d06];return _0x4bca7a;};'use strict';var Sequelize=require(_0xc0f3('0x0'));module[_0xc0f3('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c9dfac0..495f70a 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 _0x85ad=['ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','update','then','destroy','name','send','index','map','Attachment','rawAttributes','fieldName','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','filters','filter','where','merge','options','includeAll','include','findAll','show','find','catch','clone','params','get','omit','createdAt','body','updatedAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0xe79d9f,_0x15231d){var _0x5c77fa=function(_0x40a65a){while(--_0x40a65a){_0xe79d9f['push'](_0xe79d9f['shift']());}};_0x5c77fa(++_0x15231d);}(_0x85ad,0x1a0));var _0xd85a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x85ad[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xd85a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd85a('0x1'));var jsonpatch=require(_0xd85a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd85a('0x3'));var Mustache=require(_0xd85a('0x4'));var util=require(_0xd85a('0x5'));var path=require(_0xd85a('0x6'));var sox=require(_0xd85a('0x7'));var csv=require(_0xd85a('0x8'));var ejs=require(_0xd85a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd85a('0xa'));var crypto=require(_0xd85a('0xb'));var jsforce=require(_0xd85a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd85a('0xd'));var Papa=require(_0xd85a('0xe'));var Redis=require(_0xd85a('0xf'));var authService=require(_0xd85a('0x10'));var qs=require(_0xd85a('0x11'));var as=require(_0xd85a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd85a('0x13'))(_0xd85a('0x14'));var utils=require(_0xd85a('0x15'));var config=require(_0xd85a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd85a('0x17'))['db'];function respondWithStatusCode(_0x469a42,_0x106b27){_0x106b27=_0x106b27||0xcc;return function(_0x182d8d){if(_0x182d8d){return _0x469a42[_0xd85a('0x18')](_0x106b27);}return _0x469a42[_0xd85a('0x19')](_0x106b27)[_0xd85a('0x1a')]();};}function respondWithResult(_0x38b57f,_0x422903){_0x422903=_0x422903||0xc8;return function(_0x2db068){if(_0x2db068){return _0x38b57f[_0xd85a('0x19')](_0x422903)['json'](_0x2db068);}};}function respondWithFilteredResult(_0x348199,_0x485b3e){return function(_0x3cf445){if(_0x3cf445){var _0x377b7d=typeof _0x485b3e['offset']==='undefined'&&typeof _0x485b3e[_0xd85a('0x1b')]===_0xd85a('0x1c');var _0x5d6755=_0x3cf445[_0xd85a('0x1d')];var _0x160b72=_0x377b7d?0x0:_0x485b3e[_0xd85a('0x1e')];var _0x229922=_0x377b7d?_0x3cf445[_0xd85a('0x1d')]:_0x485b3e[_0xd85a('0x1e')]+_0x485b3e[_0xd85a('0x1b')];var _0x1e0194;if(_0x229922>=_0x5d6755){_0x229922=_0x5d6755;_0x1e0194=0xc8;}else{_0x1e0194=0xce;}_0x348199[_0xd85a('0x19')](_0x1e0194);return _0x348199[_0xd85a('0x1f')](_0xd85a('0x20'),_0x160b72+'-'+_0x229922+'/'+_0x5d6755)[_0xd85a('0x21')](_0x3cf445);}return null;};}function patchUpdates(_0x2c7768){return function(_0x4a7ebf){try{jsonpatch[_0xd85a('0x22')](_0x4a7ebf,_0x2c7768,!![]);}catch(_0x3ba962){return BPromise['reject'](_0x3ba962);}return _0x4a7ebf['save']();};}function saveUpdates(_0x482d15,_0x1ec06d){return function(_0x377e2d){if(_0x377e2d){return _0x377e2d[_0xd85a('0x23')](_0x482d15)[_0xd85a('0x24')](function(_0x29ad27){return _0x29ad27;});}return null;};}function removeEntity(_0xddf5c8,_0x3e3b52){return function(_0x1dc89a){if(_0x1dc89a){return _0x1dc89a[_0xd85a('0x25')]()[_0xd85a('0x24')](function(){_0xddf5c8[_0xd85a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4392b2,_0x3a1d0c){return function(_0xe5ae6d){if(!_0xe5ae6d){_0x4392b2['sendStatus'](0x194);}return _0xe5ae6d;};}function handleError(_0x5e0ddc,_0x1736ff){_0x1736ff=_0x1736ff||0x1f4;return function(_0x3114b3){logger['error'](_0x3114b3['stack']);if(_0x3114b3['name']){delete _0x3114b3[_0xd85a('0x26')];}_0x5e0ddc[_0xd85a('0x19')](_0x1736ff)[_0xd85a('0x27')](_0x3114b3);};}exports[_0xd85a('0x28')]=function(_0x288a6b,_0x160257){var _0x344095={},_0x111d32={},_0x191303={'count':0x0,'rows':[]};var _0x4adc45=_[_0xd85a('0x29')](db[_0xd85a('0x2a')][_0xd85a('0x2b')],function(_0x53963b){return{'name':_0x53963b[_0xd85a('0x2c')],'type':_0x53963b[_0xd85a('0x2d')]['key']};});_0x111d32['model']=_['map'](_0x4adc45,'name');_0x111d32[_0xd85a('0x2e')]=_[_0xd85a('0x2f')](_0x288a6b[_0xd85a('0x2e')]);_0x111d32['filters']=_['intersection'](_0x111d32[_0xd85a('0x30')],_0x111d32[_0xd85a('0x2e')]);_0x344095[_0xd85a('0x31')]=_[_0xd85a('0x32')](_0x111d32[_0xd85a('0x30')],qs[_0xd85a('0x33')](_0x288a6b[_0xd85a('0x2e')][_0xd85a('0x33')]));_0x344095['attributes']=_0x344095[_0xd85a('0x31')][_0xd85a('0x34')]?_0x344095[_0xd85a('0x31')]:_0x111d32[_0xd85a('0x30')];if(!_0x288a6b[_0xd85a('0x2e')][_0xd85a('0x35')]('nolimit')){_0x344095[_0xd85a('0x1b')]=qs['limit'](_0x288a6b[_0xd85a('0x2e')][_0xd85a('0x1b')]);_0x344095[_0xd85a('0x1e')]=qs['offset'](_0x288a6b['query'][_0xd85a('0x1e')]);}_0x344095['order']=qs[_0xd85a('0x36')](_0x288a6b[_0xd85a('0x2e')]['sort']);_0x344095['where']=qs[_0xd85a('0x37')](_['pick'](_0x288a6b[_0xd85a('0x2e')],_0x111d32[_0xd85a('0x37')]),_0x4adc45);if(_0x288a6b[_0xd85a('0x2e')][_0xd85a('0x38')]){_0x344095[_0xd85a('0x39')]=_[_0xd85a('0x3a')](_0x344095[_0xd85a('0x39')],{'$or':_[_0xd85a('0x29')](_0x4adc45,function(_0x2d13d2){if(_0x2d13d2[_0xd85a('0x2d')]!=='VIRTUAL'){var _0x3e6322={};_0x3e6322[_0x2d13d2[_0xd85a('0x26')]]={'$like':'%'+_0x288a6b['query']['filter']+'%'};return _0x3e6322;}})});}_0x344095=_[_0xd85a('0x3a')]({},_0x344095,_0x288a6b[_0xd85a('0x3b')]);var _0x143116={'where':_0x344095['where']};return db[_0xd85a('0x2a')][_0xd85a('0x1d')](_0x143116)[_0xd85a('0x24')](function(_0xf3d512){_0x191303['count']=_0xf3d512;if(_0x288a6b[_0xd85a('0x2e')][_0xd85a('0x3c')]){_0x344095[_0xd85a('0x3d')]=[{'all':!![]}];}return db[_0xd85a('0x2a')][_0xd85a('0x3e')](_0x344095);})[_0xd85a('0x24')](function(_0x2ba88d){_0x191303['rows']=_0x2ba88d;return _0x191303;})[_0xd85a('0x24')](respondWithFilteredResult(_0x160257,_0x344095))['catch'](handleError(_0x160257,null));};exports[_0xd85a('0x3f')]=function(_0x5f0b39,_0x4d0434){var _0x3f94cf={'raw':!![],'where':{'id':_0x5f0b39['params']['id']}},_0x2a3dec={};_0x2a3dec[_0xd85a('0x30')]=_[_0xd85a('0x2f')](db['Attachment'][_0xd85a('0x2b')]);_0x2a3dec[_0xd85a('0x2e')]=_['keys'](_0x5f0b39[_0xd85a('0x2e')]);_0x2a3dec[_0xd85a('0x37')]=_[_0xd85a('0x32')](_0x2a3dec[_0xd85a('0x30')],_0x2a3dec[_0xd85a('0x2e')]);_0x3f94cf[_0xd85a('0x31')]=_[_0xd85a('0x32')](_0x2a3dec[_0xd85a('0x30')],qs[_0xd85a('0x33')](_0x5f0b39[_0xd85a('0x2e')][_0xd85a('0x33')]));_0x3f94cf[_0xd85a('0x31')]=_0x3f94cf[_0xd85a('0x31')][_0xd85a('0x34')]?_0x3f94cf[_0xd85a('0x31')]:_0x2a3dec[_0xd85a('0x30')];if(_0x5f0b39['query'][_0xd85a('0x3c')]){_0x3f94cf[_0xd85a('0x3d')]=[{'all':!![]}];}_0x3f94cf=_[_0xd85a('0x3a')]({},_0x3f94cf,_0x5f0b39[_0xd85a('0x3b')]);return db[_0xd85a('0x2a')][_0xd85a('0x40')](_0x3f94cf)['then'](handleEntityNotFound(_0x4d0434,null))[_0xd85a('0x24')](respondWithResult(_0x4d0434,null))[_0xd85a('0x41')](handleError(_0x4d0434,null));};exports[_0xd85a('0x42')]=function(_0x1409d4,_0x294ee1){var _0x1c119c={'where':{'id':_0x1409d4[_0xd85a('0x43')]['id']}},_0x358f26={};_0x358f26[_0xd85a('0x30')]=_['keys'](db[_0xd85a('0x2a')]['rawAttributes']);_0x1c119c[_0xd85a('0x31')]=_[_0xd85a('0x32')](_0x358f26[_0xd85a('0x30')],qs[_0xd85a('0x33')](_0x1409d4[_0xd85a('0x2e')][_0xd85a('0x33')]));_0x1c119c[_0xd85a('0x31')]=_0x1c119c[_0xd85a('0x31')]['length']?_0x1c119c[_0xd85a('0x31')]:_0x358f26['model'];if(_0x1409d4[_0xd85a('0x2e')][_0xd85a('0x3c')]){_0x1c119c['include']=[{'all':!![]}];}_0x1c119c=_[_0xd85a('0x3a')]({},_0x1c119c,_0x1409d4[_0xd85a('0x3b')]);return db[_0xd85a('0x2a')][_0xd85a('0x40')](_0x1c119c)[_0xd85a('0x24')](handleEntityNotFound(_0x294ee1,null))[_0xd85a('0x24')](function(_0xeb768e){if(_0xeb768e){var _0x5287fa=_0xeb768e[_0xd85a('0x44')]({'plain':!![]});_0x5287fa=qs[_0xd85a('0x45')](_0x5287fa,['id',_0xd85a('0x46'),'updatedAt']);_0x1409d4[_0xd85a('0x47')]=_['omit'](_0x1409d4[_0xd85a('0x47')],['id',_0xd85a('0x46'),_0xd85a('0x48')]);return db[_0xd85a('0x2a')]['create'](_[_0xd85a('0x3a')](_0x5287fa,_0x1409d4[_0xd85a('0x47')]),{'include':_0x1409d4['query'][_0xd85a('0x3c')]?[{'all':!![]}]:undefined});}})[_0xd85a('0x24')](respondWithResult(_0x294ee1,0xc9))['catch'](handleError(_0x294ee1,null));};exports[_0xd85a('0x23')]=function(_0x4c18eb,_0x6cfc8f){if(_0x4c18eb[_0xd85a('0x47')]['id']){delete _0x4c18eb[_0xd85a('0x47')]['id'];}return db['Attachment'][_0xd85a('0x40')]({'where':{'id':_0x4c18eb[_0xd85a('0x43')]['id']}})['then'](handleEntityNotFound(_0x6cfc8f,null))[_0xd85a('0x24')](saveUpdates(_0x4c18eb[_0xd85a('0x47')],null))[_0xd85a('0x24')](respondWithResult(_0x6cfc8f,null))[_0xd85a('0x41')](handleError(_0x6cfc8f,null));};exports[_0xd85a('0x25')]=function(_0x21ee2b,_0x31efce){return db[_0xd85a('0x2a')][_0xd85a('0x40')]({'where':{'id':_0x21ee2b[_0xd85a('0x43')]['id']}})[_0xd85a('0x24')](handleEntityNotFound(_0x31efce,null))['then'](removeEntity(_0x31efce,null))[_0xd85a('0x41')](handleError(_0x31efce,null));};exports[_0xd85a('0x49')]=function(_0x483da7,_0x432f2d,_0x3af43e){_0x483da7['body'][_0xd85a('0x26')]=_0x483da7[_0xd85a('0x4a')]['originalname'];_0x483da7['body'][_0xd85a('0x4b')]=_0x483da7['file'][_0xd85a('0x4c')];_0x483da7[_0xd85a('0x47')][_0xd85a('0x2d')]=_0x483da7[_0xd85a('0x4a')][_0xd85a('0x4d')];return db[_0xd85a('0x2a')]['create'](_0x483da7[_0xd85a('0x47')])['then'](respondWithResult(_0x432f2d,0xc9))[_0xd85a('0x41')](handleError(_0x432f2d,null));};exports[_0xd85a('0x4e')]=function(_0x258ac1,_0x3ef2ab,_0xc76968){return db['Attachment'][_0xd85a('0x4f')]({'where':{'id':_0x258ac1[_0xd85a('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3ef2ab,null))['then'](function(_0x2f0b1c){if(_0x2f0b1c){var _0x31576a=_0x2f0b1c[_0xd85a('0x50')]!==null;var _0x10ff68=path[_0xd85a('0x51')](config[_0xd85a('0x52')],_0xd85a('0x53'));if(_0x31576a){_0x10ff68=path[_0xd85a('0x51')](_0x10ff68,_0xd85a('0x54'));}var _0x3d0448=path['join'](_0x10ff68,_0x2f0b1c[_0xd85a('0x4b')]);return _0x3ef2ab[_0xd85a('0x4e')](_0x3d0448);}})[_0xd85a('0x41')](handleError(_0x3ef2ab,null));}; \ No newline at end of file +var _0x527f=['stack','name','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','params','include','includeAll','find','get','omit','updatedAt','body','create','catch','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x5cf946,_0x41ba58){var _0x57c851=function(_0x34f423){while(--_0x34f423){_0x5cf946['push'](_0x5cf946['shift']());}};_0x57c851(++_0x41ba58);}(_0x527f,0x17b));var _0xf527=function(_0x41882b,_0x39a1e8){_0x41882b=_0x41882b-0x0;var _0x35287=_0x527f[_0x41882b];return _0x35287;};'use strict';var emlformat=require(_0xf527('0x0'));var rimraf=require(_0xf527('0x1'));var zipdir=require(_0xf527('0x2'));var jsonpatch=require(_0xf527('0x3'));var rp=require('request-promise');var moment=require(_0xf527('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf527('0x5'));var util=require('util');var path=require(_0xf527('0x6'));var sox=require(_0xf527('0x7'));var csv=require(_0xf527('0x8'));var ejs=require(_0xf527('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf527('0xa'));var squel=require(_0xf527('0xb'));var crypto=require(_0xf527('0xc'));var jsforce=require(_0xf527('0xd'));var deskjs=require(_0xf527('0xe'));var toCsv=require(_0xf527('0x8'));var querystring=require(_0xf527('0xf'));var Papa=require(_0xf527('0x10'));var Redis=require('ioredis');var authService=require(_0xf527('0x11'));var qs=require(_0xf527('0x12'));var as=require(_0xf527('0x13'));var hardwareService=require(_0xf527('0x14'));var logger=require('../../config/logger')(_0xf527('0x15'));var utils=require('../../config/utils');var config=require(_0xf527('0x16'));var licenseUtil=require(_0xf527('0x17'));var db=require(_0xf527('0x18'))['db'];function respondWithStatusCode(_0x25f98a,_0x258cfb){_0x258cfb=_0x258cfb||0xcc;return function(_0x32fc1f){if(_0x32fc1f){return _0x25f98a['sendStatus'](_0x258cfb);}return _0x25f98a[_0xf527('0x19')](_0x258cfb)[_0xf527('0x1a')]();};}function respondWithResult(_0x3a3d2c,_0x231c5c){_0x231c5c=_0x231c5c||0xc8;return function(_0x1fdfe0){if(_0x1fdfe0){return _0x3a3d2c[_0xf527('0x19')](_0x231c5c)['json'](_0x1fdfe0);}};}function respondWithFilteredResult(_0x55051b,_0x427b4a){return function(_0x5acc27){if(_0x5acc27){var _0x2826ba=typeof _0x427b4a[_0xf527('0x1b')]==='undefined'&&typeof _0x427b4a[_0xf527('0x1c')]==='undefined';var _0x339bcd=_0x5acc27[_0xf527('0x1d')];var _0x106e7e=_0x2826ba?0x0:_0x427b4a[_0xf527('0x1b')];var _0x586038=_0x2826ba?_0x5acc27[_0xf527('0x1d')]:_0x427b4a[_0xf527('0x1b')]+_0x427b4a[_0xf527('0x1c')];var _0x2538a6;if(_0x586038>=_0x339bcd){_0x586038=_0x339bcd;_0x2538a6=0xc8;}else{_0x2538a6=0xce;}_0x55051b[_0xf527('0x19')](_0x2538a6);return _0x55051b[_0xf527('0x1e')](_0xf527('0x1f'),_0x106e7e+'-'+_0x586038+'/'+_0x339bcd)[_0xf527('0x20')](_0x5acc27);}return null;};}function patchUpdates(_0x4e08c2){return function(_0x3ddcde){try{jsonpatch[_0xf527('0x21')](_0x3ddcde,_0x4e08c2,!![]);}catch(_0x9fb0c5){return BPromise[_0xf527('0x22')](_0x9fb0c5);}return _0x3ddcde[_0xf527('0x23')]();};}function saveUpdates(_0x2f7565,_0x539bde){return function(_0x376572){if(_0x376572){return _0x376572[_0xf527('0x24')](_0x2f7565)[_0xf527('0x25')](function(_0x57697a){return _0x57697a;});}return null;};}function removeEntity(_0x347f70,_0x3d5a98){return function(_0x277f72){if(_0x277f72){return _0x277f72[_0xf527('0x26')]()[_0xf527('0x25')](function(){_0x347f70['status'](0xcc)[_0xf527('0x1a')]();});}};}function handleEntityNotFound(_0x3a5249,_0x4232fc){return function(_0x200ef7){if(!_0x200ef7){_0x3a5249[_0xf527('0x27')](0x194);}return _0x200ef7;};}function handleError(_0x1a5ef1,_0x7138bf){_0x7138bf=_0x7138bf||0x1f4;return function(_0xe5a896){logger[_0xf527('0x28')](_0xe5a896[_0xf527('0x29')]);if(_0xe5a896[_0xf527('0x2a')]){delete _0xe5a896[_0xf527('0x2a')];}_0x1a5ef1[_0xf527('0x19')](_0x7138bf)['send'](_0xe5a896);};}exports[_0xf527('0x2b')]=function(_0x4db8fd,_0x32901b){var _0x1a2cde={},_0x2336aa={},_0x1bbc3d={'count':0x0,'rows':[]};var _0x2f6333=_[_0xf527('0x2c')](db[_0xf527('0x2d')][_0xf527('0x2e')],function(_0x4db939){return{'name':_0x4db939['fieldName'],'type':_0x4db939[_0xf527('0x2f')][_0xf527('0x30')]};});_0x2336aa[_0xf527('0x31')]=_[_0xf527('0x2c')](_0x2f6333,_0xf527('0x2a'));_0x2336aa[_0xf527('0x32')]=_[_0xf527('0x33')](_0x4db8fd[_0xf527('0x32')]);_0x2336aa[_0xf527('0x34')]=_['intersection'](_0x2336aa[_0xf527('0x31')],_0x2336aa['query']);_0x1a2cde[_0xf527('0x35')]=_[_0xf527('0x36')](_0x2336aa[_0xf527('0x31')],qs[_0xf527('0x37')](_0x4db8fd[_0xf527('0x32')]['fields']));_0x1a2cde[_0xf527('0x35')]=_0x1a2cde['attributes']['length']?_0x1a2cde[_0xf527('0x35')]:_0x2336aa[_0xf527('0x31')];if(!_0x4db8fd['query'][_0xf527('0x38')](_0xf527('0x39'))){_0x1a2cde['limit']=qs['limit'](_0x4db8fd[_0xf527('0x32')][_0xf527('0x1c')]);_0x1a2cde[_0xf527('0x1b')]=qs[_0xf527('0x1b')](_0x4db8fd[_0xf527('0x32')][_0xf527('0x1b')]);}_0x1a2cde['order']=qs[_0xf527('0x3a')](_0x4db8fd['query'][_0xf527('0x3a')]);_0x1a2cde['where']=qs[_0xf527('0x34')](_[_0xf527('0x3b')](_0x4db8fd[_0xf527('0x32')],_0x2336aa[_0xf527('0x34')]),_0x2f6333);if(_0x4db8fd[_0xf527('0x32')][_0xf527('0x3c')]){_0x1a2cde[_0xf527('0x3d')]=_[_0xf527('0x3e')](_0x1a2cde[_0xf527('0x3d')],{'$or':_['map'](_0x2f6333,function(_0x1438b5){if(_0x1438b5[_0xf527('0x2f')]!==_0xf527('0x3f')){var _0x3e9388={};_0x3e9388[_0x1438b5[_0xf527('0x2a')]]={'$like':'%'+_0x4db8fd[_0xf527('0x32')][_0xf527('0x3c')]+'%'};return _0x3e9388;}})});}_0x1a2cde=_[_0xf527('0x3e')]({},_0x1a2cde,_0x4db8fd[_0xf527('0x40')]);var _0x56888b={'where':_0x1a2cde[_0xf527('0x3d')]};return db[_0xf527('0x2d')][_0xf527('0x1d')](_0x56888b)[_0xf527('0x25')](function(_0x453ce5){_0x1bbc3d['count']=_0x453ce5;if(_0x4db8fd[_0xf527('0x32')]['includeAll']){_0x1a2cde['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1a2cde);})[_0xf527('0x25')](function(_0x5041b0){_0x1bbc3d['rows']=_0x5041b0;return _0x1bbc3d;})[_0xf527('0x25')](respondWithFilteredResult(_0x32901b,_0x1a2cde))['catch'](handleError(_0x32901b,null));};exports['show']=function(_0x3ccb5c,_0x39599a){var _0x42642b={'raw':!![],'where':{'id':_0x3ccb5c[_0xf527('0x41')]['id']}},_0x57bf9c={};_0x57bf9c['model']=_[_0xf527('0x33')](db[_0xf527('0x2d')]['rawAttributes']);_0x57bf9c['query']=_['keys'](_0x3ccb5c[_0xf527('0x32')]);_0x57bf9c[_0xf527('0x34')]=_[_0xf527('0x36')](_0x57bf9c[_0xf527('0x31')],_0x57bf9c[_0xf527('0x32')]);_0x42642b[_0xf527('0x35')]=_['intersection'](_0x57bf9c[_0xf527('0x31')],qs[_0xf527('0x37')](_0x3ccb5c['query']['fields']));_0x42642b['attributes']=_0x42642b[_0xf527('0x35')]['length']?_0x42642b['attributes']:_0x57bf9c[_0xf527('0x31')];if(_0x3ccb5c['query']['includeAll']){_0x42642b[_0xf527('0x42')]=[{'all':!![]}];}_0x42642b=_[_0xf527('0x3e')]({},_0x42642b,_0x3ccb5c[_0xf527('0x40')]);return db['Attachment']['find'](_0x42642b)[_0xf527('0x25')](handleEntityNotFound(_0x39599a,null))[_0xf527('0x25')](respondWithResult(_0x39599a,null))['catch'](handleError(_0x39599a,null));};exports['clone']=function(_0x11cc80,_0x244839){var _0x11a979={'where':{'id':_0x11cc80['params']['id']}},_0x1a1838={};_0x1a1838[_0xf527('0x31')]=_[_0xf527('0x33')](db['Attachment'][_0xf527('0x2e')]);_0x11a979['attributes']=_['intersection'](_0x1a1838['model'],qs[_0xf527('0x37')](_0x11cc80[_0xf527('0x32')][_0xf527('0x37')]));_0x11a979[_0xf527('0x35')]=_0x11a979[_0xf527('0x35')]['length']?_0x11a979[_0xf527('0x35')]:_0x1a1838[_0xf527('0x31')];if(_0x11cc80[_0xf527('0x32')][_0xf527('0x43')]){_0x11a979[_0xf527('0x42')]=[{'all':!![]}];}_0x11a979=_[_0xf527('0x3e')]({},_0x11a979,_0x11cc80[_0xf527('0x40')]);return db['Attachment'][_0xf527('0x44')](_0x11a979)[_0xf527('0x25')](handleEntityNotFound(_0x244839,null))['then'](function(_0x58b2d2){if(_0x58b2d2){var _0x23d27c=_0x58b2d2[_0xf527('0x45')]({'plain':!![]});_0x23d27c=qs[_0xf527('0x46')](_0x23d27c,['id','createdAt',_0xf527('0x47')]);_0x11cc80['body']=_[_0xf527('0x46')](_0x11cc80[_0xf527('0x48')],['id','createdAt','updatedAt']);return db[_0xf527('0x2d')][_0xf527('0x49')](_['merge'](_0x23d27c,_0x11cc80[_0xf527('0x48')]),{'include':_0x11cc80[_0xf527('0x32')][_0xf527('0x43')]?[{'all':!![]}]:undefined});}})[_0xf527('0x25')](respondWithResult(_0x244839,0xc9))[_0xf527('0x4a')](handleError(_0x244839,null));};exports[_0xf527('0x24')]=function(_0x5d8979,_0x1eaf36){if(_0x5d8979[_0xf527('0x48')]['id']){delete _0x5d8979[_0xf527('0x48')]['id'];}return db[_0xf527('0x2d')][_0xf527('0x44')]({'where':{'id':_0x5d8979[_0xf527('0x41')]['id']}})[_0xf527('0x25')](handleEntityNotFound(_0x1eaf36,null))['then'](saveUpdates(_0x5d8979[_0xf527('0x48')],null))[_0xf527('0x25')](respondWithResult(_0x1eaf36,null))[_0xf527('0x4a')](handleError(_0x1eaf36,null));};exports[_0xf527('0x26')]=function(_0x4b8a77,_0x445321){return db[_0xf527('0x2d')][_0xf527('0x44')]({'where':{'id':_0x4b8a77[_0xf527('0x41')]['id']}})[_0xf527('0x25')](handleEntityNotFound(_0x445321,null))[_0xf527('0x25')](removeEntity(_0x445321,null))['catch'](handleError(_0x445321,null));};exports[_0xf527('0x49')]=function(_0x5c9af5,_0x385561,_0x49627c){_0x5c9af5[_0xf527('0x48')][_0xf527('0x2a')]=_0x5c9af5[_0xf527('0x4b')][_0xf527('0x4c')];_0x5c9af5[_0xf527('0x48')][_0xf527('0x4d')]=_0x5c9af5[_0xf527('0x4b')][_0xf527('0x4e')];_0x5c9af5[_0xf527('0x48')][_0xf527('0x2f')]=_0x5c9af5[_0xf527('0x4b')]['mimetype'];return db[_0xf527('0x2d')][_0xf527('0x49')](_0x5c9af5['body'])[_0xf527('0x25')](respondWithResult(_0x385561,0xc9))['catch'](handleError(_0x385561,null));};exports[_0xf527('0x4f')]=function(_0x5d7b8e,_0x502a3f,_0x1062bd){return db['Attachment'][_0xf527('0x50')]({'where':{'id':_0x5d7b8e['params']['id']},'raw':!![]})[_0xf527('0x25')](handleEntityNotFound(_0x502a3f,null))[_0xf527('0x25')](function(_0x5adbc4){if(_0x5adbc4){var _0x1fd11a=_0x5adbc4[_0xf527('0x51')]!==null;var _0x1f4007=path['join'](config['root'],_0xf527('0x52'));if(_0x1fd11a){_0x1f4007=path['join'](_0x1f4007,'offline-chat/');}var _0x5035c6=path[_0xf527('0x53')](_0x1f4007,_0x5adbc4[_0xf527('0x4d')]);return _0x502a3f['download'](_0x5035c6);}})[_0xf527('0x4a')](handleError(_0x502a3f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7f35681..34d2268 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 _0x61db=['request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x29b7a6,_0x71a735){var _0x1add01=function(_0x508c0a){while(--_0x508c0a){_0x29b7a6['push'](_0x29b7a6['shift']());}};_0x1add01(++_0x71a735);}(_0x61db,0x126));var _0xb61d=function(_0xe5a380,_0xa6112e){_0xe5a380=_0xe5a380-0x0;var _0x344347=_0x61db[_0xe5a380];return _0x344347;};'use strict';var _=require(_0xb61d('0x0'));var util=require(_0xb61d('0x1'));var logger=require(_0xb61d('0x2'))(_0xb61d('0x3'));var moment=require(_0xb61d('0x4'));var BPromise=require('bluebird');var rp=require(_0xb61d('0x5'));var fs=require('fs');var path=require(_0xb61d('0x6'));var rimraf=require(_0xb61d('0x7'));var config=require('../../config/environment');var attributes=require(_0xb61d('0x8'));module[_0xb61d('0x9')]=function(_0x4a0f1f,_0x459b15){return _0x4a0f1f[_0xb61d('0xa')](_0xb61d('0xb'),attributes,{'tableName':_0xb61d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9771=['request-promise','path','../../config/environment','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment'];(function(_0x331a8d,_0x4aaeff){var _0x39ee0b=function(_0xc3186b){while(--_0xc3186b){_0x331a8d['push'](_0x331a8d['shift']());}};_0x39ee0b(++_0x4aaeff);}(_0x9771,0x188));var _0x1977=function(_0x1b75db,_0x26c339){_0x1b75db=_0x1b75db-0x0;var _0x11f5df=_0x9771[_0x1b75db];return _0x11f5df;};'use strict';var _=require(_0x1977('0x0'));var util=require('util');var logger=require(_0x1977('0x1'))(_0x1977('0x2'));var moment=require(_0x1977('0x3'));var BPromise=require('bluebird');var rp=require(_0x1977('0x4'));var fs=require('fs');var path=require(_0x1977('0x5'));var rimraf=require('rimraf');var config=require(_0x1977('0x6'));var attributes=require('./attachment.attributes');module[_0x1977('0x7')]=function(_0x516bec,_0x2f4634){return _0x516bec[_0x1977('0x8')](_0x1977('0x9'),attributes,{'tableName':_0x1977('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index a79e979..bdf03ed 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 _0xa5ca=['rpc','../../config/environment','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x55e00b,_0x3f1949){var _0x5c7f41=function(_0x51236a){while(--_0x51236a){_0x55e00b['push'](_0x55e00b['shift']());}};_0x5c7f41(++_0x3f1949);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xa5ca[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var moment=require(_0xaa5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa5c('0x3'));var db=require(_0xaa5c('0x4'))['db'];var utils=require(_0xaa5c('0x5'));var logger=require(_0xaa5c('0x6'))(_0xaa5c('0x7'));var config=require(_0xaa5c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41b86b,_0x10bee5,_0x283bc5){return new BPromise(function(_0x5b39a7,_0x496243){return client[_0xaa5c('0x9')](_0x41b86b,_0x283bc5)[_0xaa5c('0xa')](function(_0x170d3b){logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));logger[_0xaa5c('0xd')](_0xaa5c('0xe'),_0x10bee5,_0xaa5c('0xc'),JSON[_0xaa5c('0xf')](_0x170d3b));if(_0x170d3b[_0xaa5c('0x10')]){if(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x11')]===0x1f4){logger[_0xaa5c('0x10')](_0xaa5c('0xb'),_0x10bee5,_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);return _0x496243(_0x170d3b['error'][_0xaa5c('0x12')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x170d3b['error'][_0xaa5c('0x12')]);return _0x5b39a7(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);}else{logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));_0x5b39a7(_0x170d3b[_0xaa5c('0x13')][_0xaa5c('0x12')]);}})[_0xaa5c('0x14')](function(_0x272d06){logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x272d06);_0x496243(_0x272d06);});});}exports[_0xaa5c('0x15')]=function(_0x5ebbf0){var _0x43990d=this;return new Promise(function(_0xa016ba,_0x4f5038){return db['Attachment']['create'](_0x5ebbf0['body'],{'raw':_0x5ebbf0[_0xaa5c('0x16')]?_0x5ebbf0[_0xaa5c('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xaa5c('0xa')](function(_0x114363){logger['info']('CreateAttachment',_0x5ebbf0);logger[_0xaa5c('0xd')](_0xaa5c('0x15'),_0x5ebbf0,JSON[_0xaa5c('0xf')](_0x114363));_0xa016ba(_0x114363);})[_0xaa5c('0x14')](function(_0xa280bc){logger[_0xaa5c('0x10')]('CreateAttachment',_0xa280bc[_0xaa5c('0x12')],_0x5ebbf0);_0x4f5038(_0x43990d[_0xaa5c('0x10')](0x1f4,_0xa280bc['message']));});});}; \ No newline at end of file +var _0xd4b6=['jayson/promise','client','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x31fd58,_0xd2d9b4){var _0x1f562c=function(_0x5f09ac){while(--_0x5f09ac){_0x31fd58['push'](_0x31fd58['shift']());}};_0x1f562c(++_0xd2d9b4);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x5ee6c8,_0x300382){_0x5ee6c8=_0x5ee6c8-0x0;var _0xb061cc=_0xd4b6[_0x5ee6c8];return _0xb061cc;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var moment=require('moment');var BPromise=require(_0x6d4b('0x2'));var rs=require(_0x6d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6d4b('0x5'));var jayson=require(_0x6d4b('0x6'));var client=jayson[_0x6d4b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f52a,_0x42a52a,_0x424690){return new BPromise(function(_0x262eed,_0x4dcf3d){return client[_0x6d4b('0x8')](_0x20f52a,_0x424690)[_0x6d4b('0x9')](function(_0xb2567b){logger[_0x6d4b('0xa')]('Attachment,\x20%s,\x20%s',_0x42a52a,_0x6d4b('0xb'));logger[_0x6d4b('0xc')](_0x6d4b('0xd'),_0x42a52a,_0x6d4b('0xb'),JSON[_0x6d4b('0xe')](_0xb2567b));if(_0xb2567b[_0x6d4b('0xf')]){if(_0xb2567b[_0x6d4b('0xf')]['code']===0x1f4){logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')]['message']);return _0x4dcf3d(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}logger[_0x6d4b('0xf')](_0x6d4b('0x10'),_0x42a52a,_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);return _0x262eed(_0xb2567b[_0x6d4b('0xf')][_0x6d4b('0x11')]);}else{logger[_0x6d4b('0xa')](_0x6d4b('0x10'),_0x42a52a,'request\x20sent');_0x262eed(_0xb2567b[_0x6d4b('0x12')]['message']);}})[_0x6d4b('0x13')](function(_0x428b75){logger['error']('Attachment,\x20%s,\x20%s',_0x42a52a,_0x428b75);_0x4dcf3d(_0x428b75);});});}exports[_0x6d4b('0x14')]=function(_0x3a30b2){var _0x318b0f=this;return new Promise(function(_0x2694ba,_0xa2f130){return db[_0x6d4b('0x15')][_0x6d4b('0x16')](_0x3a30b2[_0x6d4b('0x17')],{'raw':_0x3a30b2[_0x6d4b('0x18')]?_0x3a30b2[_0x6d4b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x25a1fa){logger[_0x6d4b('0xa')](_0x6d4b('0x14'),_0x3a30b2);logger['debug'](_0x6d4b('0x14'),_0x3a30b2,JSON[_0x6d4b('0xe')](_0x25a1fa));_0x2694ba(_0x25a1fa);})[_0x6d4b('0x13')](function(_0x26b72d){logger['error'](_0x6d4b('0x14'),_0x26b72d[_0x6d4b('0x11')],_0x3a30b2);_0xa2f130(_0x318b0f[_0x6d4b('0xf')](0x1f4,_0x26b72d[_0x6d4b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index cdf1078..40a8d0e 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a71529f..3f1ef0a 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 _0xda42=['then','find','emails','user','agent','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration'];(function(_0x51bd72,_0x1bf44b){var _0x46c7cb=function(_0x4b3269){while(--_0x4b3269){_0x51bd72['push'](_0x51bd72['shift']());}};_0x46c7cb(++_0x1bf44b);}(_0xda42,0x111));var _0x2da4=function(_0x46fb2b,_0x4e8f99){_0x46fb2b=_0x46fb2b-0x0;var _0x5c59a8=_0xda42[_0x46fb2b];return _0x5c59a8;};'use strict';var _=require(_0x2da4('0x0'));var passport=require(_0x2da4('0x1'));var GoogleStrategy=require(_0x2da4('0x2'))[_0x2da4('0x3')];var moment=require(_0x2da4('0x4'));var db=require(_0x2da4('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0x2da4('0x6'))[_0x2da4('0x7')];var utils=require(_0x2da4('0x8'));exports[_0x2da4('0x9')]=passport[_0x2da4('0xa')](_0x2da4('0xb'),{'failureRedirect':_0x2da4('0xc'),'scope':[_0x2da4('0xd'),_0x2da4('0xe')],'session':![]});exports[_0x2da4('0xf')]=passport[_0x2da4('0xa')](_0x2da4('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x2da4('0x10')](new GoogleStrategy({'clientID':config[_0x2da4('0xb')]?config['google'][_0x2da4('0x11')]:'id','clientSecret':config[_0x2da4('0xb')]?config['google']['clientSecret']:'secret','callbackURL':config[_0x2da4('0xb')]?config[_0x2da4('0xb')][_0x2da4('0x12')]:''},function(_0x33342e,_0x383586,_0x1579df,_0x45f240){var _0x338ded,_0x55f52d;return db[_0x2da4('0x13')][_0x2da4('0x14')]({'where':{'id':0x1},'attributes':[_0x2da4('0x15'),_0x2da4('0x16')],'raw':!![]})[_0x2da4('0x17')](function(_0xc77fd1){_0x338ded=_0xc77fd1;return db['User'][_0x2da4('0x18')]({'where':{'email':_['map'](_0x1579df[_0x2da4('0x19')],'value'),'role':{'$or':['admin',_0x2da4('0x1a'),_0x2da4('0x1b')]}}});})[_0x2da4('0x17')](function(_0x23110a){_0x55f52d=_0x23110a;if(_0x55f52d){if(_0x55f52d[_0x2da4('0x1c')]){return _0x45f240('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x338ded[_0x2da4('0x16')]>0x0){if(_0x55f52d[_0x2da4('0x1d')]){if(moment(_0x55f52d[_0x2da4('0x1e')])[_0x2da4('0x1f')](_0x338ded[_0x2da4('0x16')],_0x2da4('0x20'))>moment()){return _0x45f240(_0x2da4('0x21'));}else{return utils[_0x2da4('0x22')](_0x55f52d,0x0,![],null)[_0x2da4('0x17')](function(){return utils['getLicense'](_0x55f52d);})[_0x2da4('0x17')](function(){return _0x45f240(null,_0x55f52d);});}}else{return utils['getLicense'](_0x55f52d)[_0x2da4('0x17')](function(){return _0x45f240(null,_0x55f52d);});}}else{return utils[_0x2da4('0x23')](_0x55f52d)[_0x2da4('0x17')](function(){return _0x45f240(null,_0x55f52d);});}}return _0x45f240(_0x2da4('0x21'));})[_0x2da4('0x24')](function(_0x2694b4){_0x45f240(_0x2694b4);});})); \ No newline at end of file +var _0xa97c=['signToken','login','/login','profile','email','callback','authenticate','use','google','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa97c,0xfc));var _0xca97=function(_0x30a5a7,_0x9c3482){_0x30a5a7=_0x30a5a7-0x0;var _0xa42e41=_0xa97c[_0x30a5a7];return _0xa42e41;};'use strict';var _=require(_0xca97('0x0'));var passport=require(_0xca97('0x1'));var GoogleStrategy=require(_0xca97('0x2'))[_0xca97('0x3')];var moment=require('moment');var db=require(_0xca97('0x4'))['db'];var config=require(_0xca97('0x5'));var signToken=require(_0xca97('0x6'))[_0xca97('0x7')];var utils=require('../../config/utils');exports[_0xca97('0x8')]=passport['authenticate']('google',{'failureRedirect':_0xca97('0x9'),'scope':[_0xca97('0xa'),_0xca97('0xb')],'session':![]});exports[_0xca97('0xc')]=passport[_0xca97('0xd')]('google',{'failureRedirect':_0xca97('0x9'),'session':![]});passport[_0xca97('0xe')](new GoogleStrategy({'clientID':config[_0xca97('0xf')]?config['google'][_0xca97('0x10')]:'id','clientSecret':config['google']?config[_0xca97('0xf')][_0xca97('0x11')]:_0xca97('0x12'),'callbackURL':config[_0xca97('0xf')]?config[_0xca97('0xf')][_0xca97('0x13')]:''},function(_0x3a98a4,_0x3b5995,_0x5c273e,_0x3b4390){var _0x1ea2c1,_0x2b4b3e;return db[_0xca97('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xca97('0x15'),_0xca97('0x16')],'raw':!![]})[_0xca97('0x17')](function(_0x182d51){_0x1ea2c1=_0x182d51;return db[_0xca97('0x18')][_0xca97('0x19')]({'where':{'email':_[_0xca97('0x1a')](_0x5c273e['emails'],'value'),'role':{'$or':[_0xca97('0x1b'),_0xca97('0x1c'),_0xca97('0x1d')]}}});})[_0xca97('0x17')](function(_0x18ab9e){_0x2b4b3e=_0x18ab9e;if(_0x2b4b3e){if(_0x2b4b3e['disabled']){return _0x3b4390(_0xca97('0x1e'));}else if(_0x1ea2c1['blockDuration']>0x0){if(_0x2b4b3e[_0xca97('0x1f')]){if(moment(_0x2b4b3e[_0xca97('0x20')])[_0xca97('0x21')](_0x1ea2c1[_0xca97('0x16')],_0xca97('0x22'))>moment()){return _0x3b4390(_0xca97('0x1e'));}else{return utils[_0xca97('0x23')](_0x2b4b3e,0x0,![],null)[_0xca97('0x17')](function(){return utils['getLicense'](_0x2b4b3e);})[_0xca97('0x17')](function(){return _0x3b4390(null,_0x2b4b3e);});}}else{return utils[_0xca97('0x24')](_0x2b4b3e)['then'](function(){return _0x3b4390(null,_0x2b4b3e);});}}else{return utils[_0xca97('0x24')](_0x2b4b3e)[_0xca97('0x17')](function(){return _0x3b4390(null,_0x2b4b3e);});}}return _0x3b4390(_0xca97('0x1e'));})['catch'](function(_0x279908){_0x3b4390(_0x279908);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3e725cc..f71e92b 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 _0x31b2=['../../components/auth/service','login','/callback','callback','exports','express','Router','./authGoogle.controller'];(function(_0x5b8608,_0x527731){var _0x3f8d3d=function(_0x131b70){while(--_0x131b70){_0x5b8608['push'](_0x5b8608['shift']());}};_0x3f8d3d(++_0x527731);}(_0x31b2,0xc5));var _0x231b=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x31b2[_0x2ae22a];return _0x286a82;};'use strict';var express=require(_0x231b('0x0'));var passport=require('passport');var router=express[_0x231b('0x1')]();var controller=require(_0x231b('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x231b('0x3'));router['get']('/',controller[_0x231b('0x4')]);router['get'](_0x231b('0x5'),controller[_0x231b('0x6')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x231b('0x7')]=router; \ No newline at end of file +var _0x132b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x36426d,_0x4d62fe){var _0x40bd33=function(_0x278d94){while(--_0x278d94){_0x36426d['push'](_0x36426d['shift']());}};_0x40bd33(++_0x4d62fe);}(_0x132b,0x8d));var _0xb132=function(_0x2fe73c,_0x1ac46b){_0x2fe73c=_0x2fe73c-0x0;var _0x1bf8eb=_0x132b[_0x2fe73c];return _0x1bf8eb;};'use strict';var express=require(_0xb132('0x0'));var passport=require(_0xb132('0x1'));var router=express['Router']();var controller=require(_0xb132('0x2'));var userController=require(_0xb132('0x3'));var authService=require(_0xb132('0x4'));router['get']('/',controller[_0xb132('0x5')]);router[_0xb132('0x6')]('/callback',controller[_0xb132('0x7')],authService[_0xb132('0x8')],userController['login'],authService[_0xb132('0x9')]);module[_0xb132('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d716ee3..547c1f3 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 _0x17b6=['salt','disabled','blocked','loginAttempts','admin','user','agent','authenticate','blockedAt','add','minutes','clearBlockUser','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','find','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','status','send','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','randomstring','moment','../../mysqldb','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x4a352c,_0x1844ac){var _0x488000=function(_0x161bbc){while(--_0x161bbc){_0x4a352c['push'](_0x4a352c['shift']());}};_0x488000(++_0x1844ac);}(_0x17b6,0xf7));var _0x617b=function(_0x7e9407,_0x3fac7f){_0x7e9407=_0x7e9407-0x0;var _0xa94290=_0x17b6[_0x7e9407];return _0xa94290;};'use strict';var util=require(_0x617b('0x0'));var passport=require(_0x617b('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x617b('0x2'));var moment=require(_0x617b('0x3'));var db=require(_0x617b('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x617b('0x5'));var client=jayson[_0x617b('0x6')]['http']({'port':0x232b});function localAuthenticate(_0x3088f3,_0x2ca647,_0x502d56,_0x4ddd96){var _0x3e9f8c,_0x19729e;return db['Setting'][_0x617b('0x7')]({'where':{'id':0x1},'attributes':[_0x617b('0x8'),_0x617b('0x9')],'raw':!![]})[_0x617b('0xa')](function(_0x2bac6d){_0x3e9f8c=_0x2bac6d;return _0x3088f3[_0x617b('0x7')]({'attributes':['id','name','password',_0x617b('0xb'),'role',_0x617b('0xc'),_0x617b('0xd'),'blockedAt',_0x617b('0xe')],'where':{'name':_0x2ca647,'role':{'$or':[_0x617b('0xf'),_0x617b('0x10'),_0x617b('0x11')]}}});})[_0x617b('0xa')](function(_0x35b8a7){if(!_0x35b8a7||_0x35b8a7&&_0x35b8a7['name']!==_0x2ca647){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x19729e=_0x35b8a7;return _0x19729e;}})[_0x617b('0xa')](function(){_0x19729e[_0x617b('0x12')](_0x502d56,function(_0xbc1203,_0x3eda14){var _0xfc8565=_0x19729e[_0x617b('0xe')]+0x1;if(_0xbc1203){return _0x4ddd96(_0xbc1203);}else if(!_0x3eda14){if(_0x19729e[_0x617b('0xc')]){return _0x4ddd96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3e9f8c[_0x617b('0x8')]>0x0){if(_0x19729e['blocked']){if(_0x3e9f8c[_0x617b('0x9')]>0x0){if(moment(_0x19729e[_0x617b('0x13')])[_0x617b('0x14')](_0x3e9f8c[_0x617b('0x9')],_0x617b('0x15'))>moment()){return _0x4ddd96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x617b('0x16')](_0x19729e,_0xfc8565,![],null)[_0x617b('0xa')](function(){return _0x4ddd96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}}else{if(_0xfc8565>=_0x3e9f8c[_0x617b('0x8')]){return utils[_0x617b('0x16')](_0x19729e,0x0,!![],moment())['then'](function(){return _0x4ddd96(null,![],{'message':_0x617b('0x17')});});}else{return utils[_0x617b('0x16')](_0x19729e,_0xfc8565,![],null)[_0x617b('0xa')](function(){return _0x4ddd96(null,![],{'message':_0x617b('0x17')});});}}}else{return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}}else{if(_0x19729e[_0x617b('0xc')]){return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}else if(_0x3e9f8c[_0x617b('0x8')]>0x0){if(_0x19729e[_0x617b('0xd')]){if(_0x3e9f8c['blockDuration']>0x0){if(moment(_0x19729e[_0x617b('0x13')])[_0x617b('0x14')](_0x3e9f8c[_0x617b('0x9')],_0x617b('0x15'))>moment()){return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}else{return utils[_0x617b('0x16')](_0x19729e,0x0,![],null)[_0x617b('0xa')](function(){return utils['getLicense'](_0x19729e);})[_0x617b('0xa')](function(){return _0x4ddd96(null,_0x19729e);});}}else{return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}}else{return utils[_0x617b('0x16')](_0x19729e,0x0,![],null)[_0x617b('0xa')](function(){return utils[_0x617b('0x18')](_0x19729e);})['then'](function(){return _0x4ddd96(null,_0x19729e);})['catch'](function(_0x54ce87){return _0x4ddd96(null,![],_0x54ce87);});}}else{if(_0x19729e[_0x617b('0xd')]){return _0x4ddd96(null,![],{'message':_0x617b('0x17')});}else{return utils['getLicense'](_0x19729e)[_0x617b('0xa')](function(){return _0x4ddd96(null,_0x19729e);});}}}});})[_0x617b('0x19')](function(_0x5f0503){return _0x4ddd96(null,![],_0x5f0503);});}function sendServiceMail(_0x23c14b){return db['MailAccount'][_0x617b('0x1a')]({'where':{'service':!![]},'attributes':['id',_0x617b('0x1b'),_0x617b('0x1c')],'include':[{'model':db[_0x617b('0x1d')],'as':_0x617b('0x1e')}]})[_0x617b('0xa')](function(_0x37d7b1){if(!_0x37d7b1){throw new Error(_0x617b('0x1f'));}var _0x4b078c={'tls':{'rejectUnauthorized':![]}};if(_0x37d7b1[_0x617b('0x1e')][_0x617b('0x20')]){_0x4b078c[_0x617b('0x20')]=_0x37d7b1[_0x617b('0x1e')][_0x617b('0x20')];}else{_0x4b078c[_0x617b('0x21')]=_0x37d7b1[_0x617b('0x1e')][_0x617b('0x21')];_0x4b078c[_0x617b('0x22')]=_0x37d7b1[_0x617b('0x1e')][_0x617b('0x22')];_0x4b078c[_0x617b('0x23')]=_0x37d7b1[_0x617b('0x1e')][_0x617b('0x23')];}if(_0x37d7b1[_0x617b('0x1e')][_0x617b('0x24')]){_0x4b078c[_0x617b('0x25')]={'user':_0x37d7b1[_0x617b('0x1e')][_0x617b('0x10')],'pass':_0x37d7b1[_0x617b('0x1e')][_0x617b('0x26')]};}var _0x58fc0b={'account':_0x4b078c,'message':_[_0x617b('0x27')]({'from':util[_0x617b('0x28')]('\x22%s\x22\x20<%s>',_0x37d7b1[_0x617b('0x1b')],_0x37d7b1[_0x617b('0x1c')]||_0x37d7b1[_0x617b('0x1e')][_0x617b('0x10')])},_0x23c14b)};return client[_0x617b('0x29')](_0x617b('0x2a'),_0x58fc0b);})[_0x617b('0xa')](function(_0x41b456){if(_0x41b456[_0x617b('0x2b')]){throw new Error(util[_0x617b('0x28')](_0x617b('0x2c'),_0x41b456[_0x617b('0x2b')][_0x617b('0x2d')]||JSON[_0x617b('0x2e')](_0x41b456[_0x617b('0x2b')])));}return!![];});}function handleError(_0x20d5fd,_0x19ef5e,_0x22a183){return _0x20d5fd['status'](_0x19ef5e||0x1f4)['send']({'message':_0x22a183?_0x22a183[_0x617b('0x2d')]||_0x22a183:''});}exports['login']=function(_0x33ff86,_0x29952d,_0x1156e1){passport[_0x617b('0x12')](_0x617b('0x2f'),function(_0x94c3d5,_0x3b6415,_0xd1fc86){var _0x1ef69d=_0x94c3d5||_0xd1fc86;if(_0x1ef69d){return handleError(_0x29952d,0x191,_0x1ef69d);}if(!_0x3b6415){return handleError(_0x29952d,0x194,{'message':_0x617b('0x30')});}else{var _0x3f8efa={'payload':{'id':_0x3b6415['id'],'role':_0x3b6415[_0x617b('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x617b('0x32')](_0x3f8efa)[_0x617b('0xa')](function(_0x432e35){_0x29952d[_0x617b('0x33')]({'id':_0x3b6415['id'],'token':_0x432e35,'statusCall':'','isAlreadyLogged':_0x3b6415[_0x617b('0x34')]});});}})(_0x33ff86,_0x29952d,_0x1156e1);};exports[_0x617b('0x35')]=function(_0x3c170d,_0x4b3bfa,_0x12fe8b){if(!_0x3c170d['body'][_0x617b('0x1c')]){return handleError(_0x4b3bfa,0x1f4,{'message':_0x617b('0x36')});}var _0x500dc6=rs[_0x617b('0x37')]();_0x3c170d['body'][_0x617b('0x1c')]=_0x3c170d[_0x617b('0x38')][_0x617b('0x1c')][_0x617b('0x39')]()[_0x617b('0x3a')]();var _0x2b6ecf;return db[_0x617b('0x3b')][_0x617b('0x7')]({'where':{'id':0x1},'attributes':[_0x617b('0x8'),_0x617b('0x9')],'raw':!![]})['then'](function(_0x4f4b8a){_0x2b6ecf=_0x4f4b8a;return db[_0x617b('0x3c')]['find']({'where':{'email':_0x3c170d[_0x617b('0x38')][_0x617b('0x1c')]}});})[_0x617b('0xa')](function(_0x408e19){if(!_0x408e19){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x408e19[_0x617b('0xc')]){throw new Error(_0x617b('0x3d'));}if(_0x408e19['blocked']){if(moment(_0x408e19[_0x617b('0x13')])[_0x617b('0x14')](_0x2b6ecf[_0x617b('0x9')],_0x617b('0x15'))>moment()){throw new Error(_0x617b('0x3e'));}else{_0x408e19[_0x617b('0xd')]=![];_0x408e19[_0x617b('0x13')]=null;}}_0x408e19[_0x617b('0x3f')]=_0x500dc6;_0x408e19['resetPasswordExpires']=Date[_0x617b('0x40')]()+0x36ee80;return _0x408e19[_0x617b('0x41')]();})[_0x617b('0xa')](function(){return sendServiceMail({'to':_0x3c170d[_0x617b('0x38')][_0x617b('0x1c')],'subject':_0x617b('0x42'),'text':_0x617b('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x3c170d[_0x617b('0x44')]['host']+_0x617b('0x45')+_0x500dc6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x617b('0xa')](function(){_0x4b3bfa[_0x617b('0x46')](0xc8)[_0x617b('0x47')]({'message':_0x617b('0x48')});})[_0x617b('0x19')](function(_0x4d3360){return handleError(_0x4b3bfa,0x1f4,_0x4d3360);});};exports['reset']=function(_0x151eb8,_0x5c7713,_0x323cf7){return db[_0x617b('0x3c')][_0x617b('0x1a')]({'where':{'resetPasswordToken':_0x151eb8[_0x617b('0x49')][_0x617b('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x617b('0xa')](function(_0x585f59){if(!_0x585f59){throw new Error(_0x617b('0x4b'));}return db[_0x617b('0x3b')][_0x617b('0x7')]({'attributes':['id','securePassword',_0x617b('0x4c'),_0x617b('0x4d')]})[_0x617b('0xa')](function(_0x4bcd64){if(_0x4bcd64[_0x617b('0x4e')])authService[_0x617b('0x4f')](_0x151eb8['body'][_0x617b('0x50')]);if(!_0x4bcd64[_0x617b('0x4c')]||!_0x585f59[_0x617b('0x51')])return _0x585f59;authService[_0x617b('0x52')](_0x151eb8['body']['password'],_0x585f59[_0x617b('0x51')],_0x4bcd64['passwordHistoryLimit']);return _0x585f59;})['then'](function(){_0x585f59[_0x617b('0x50')]=_0x151eb8['body'][_0x617b('0x50')];_0x585f59[_0x617b('0x3f')]=null;_0x585f59[_0x617b('0x53')]=null;return _0x585f59[_0x617b('0x41')]();});})['then'](function(){_0x5c7713[_0x617b('0x46')](0xc8)[_0x617b('0x47')]({'message':_0x617b('0x54')});})['catch'](function(_0x28842c){return handleError(_0x5c7713,0x1f4,_0x28842c);});};passport[_0x617b('0x55')](new LocalStrategy({'usernameField':_0x617b('0x1b'),'passwordField':_0x617b('0x50')},function(_0x5f49dd,_0x5265c2,_0x243911){return localAuthenticate(db[_0x617b('0x3c')],_0x5f49dd,_0x5265c2,_0x243911);})); \ No newline at end of file +var _0xba30=['Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','Smtp','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','Reset\x20Email\x20sent!','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','moment','../../mysqldb','../../config/utils','client','http'];(function(_0x2dd6b7,_0x4ccce3){var _0x9c28c1=function(_0x2a3124){while(--_0x2a3124){_0x2dd6b7['push'](_0x2dd6b7['shift']());}};_0x9c28c1(++_0x4ccce3);}(_0xba30,0xf0));var _0x0ba3=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0xba30[_0x32b79a];return _0x483450;};'use strict';var util=require(_0x0ba3('0x0'));var passport=require(_0x0ba3('0x1'));var LocalStrategy=require(_0x0ba3('0x2'))['Strategy'];var jayson=require(_0x0ba3('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x0ba3('0x4'));var db=require(_0x0ba3('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0ba3('0x6'));var client=jayson[_0x0ba3('0x7')][_0x0ba3('0x8')]({'port':0x232b});function localAuthenticate(_0x5475c7,_0x45429c,_0x1888a2,_0x390541){var _0x2b3d81,_0x43e5ba;return db[_0x0ba3('0x9')][_0x0ba3('0xa')]({'where':{'id':0x1},'attributes':[_0x0ba3('0xb'),_0x0ba3('0xc')],'raw':!![]})[_0x0ba3('0xd')](function(_0x5570aa){_0x2b3d81=_0x5570aa;return _0x5475c7[_0x0ba3('0xa')]({'attributes':['id',_0x0ba3('0xe'),_0x0ba3('0xf'),_0x0ba3('0x10'),_0x0ba3('0x11'),_0x0ba3('0x12'),_0x0ba3('0x13'),_0x0ba3('0x14'),_0x0ba3('0x15')],'where':{'name':_0x45429c,'role':{'$or':[_0x0ba3('0x16'),_0x0ba3('0x17'),'agent']}}});})[_0x0ba3('0xd')](function(_0x20e995){if(!_0x20e995||_0x20e995&&_0x20e995[_0x0ba3('0xe')]!==_0x45429c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x43e5ba=_0x20e995;return _0x43e5ba;}})[_0x0ba3('0xd')](function(){_0x43e5ba[_0x0ba3('0x18')](_0x1888a2,function(_0x3aba4a,_0x25a224){var _0x24cfcf=_0x43e5ba[_0x0ba3('0x15')]+0x1;if(_0x3aba4a){return _0x390541(_0x3aba4a);}else if(!_0x25a224){if(_0x43e5ba[_0x0ba3('0x12')]){return _0x390541(null,![],{'message':_0x0ba3('0x19')});}else if(_0x2b3d81[_0x0ba3('0xb')]>0x0){if(_0x43e5ba[_0x0ba3('0x13')]){if(_0x2b3d81[_0x0ba3('0xc')]>0x0){if(moment(_0x43e5ba['blockedAt'])[_0x0ba3('0x1a')](_0x2b3d81['blockDuration'],_0x0ba3('0x1b'))>moment()){return _0x390541(null,![],{'message':_0x0ba3('0x19')});}else{return utils[_0x0ba3('0x1c')](_0x43e5ba,_0x24cfcf,![],null)['then'](function(){return _0x390541(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x390541(null,![],{'message':_0x0ba3('0x19')});}}else{if(_0x24cfcf>=_0x2b3d81[_0x0ba3('0xb')]){return utils[_0x0ba3('0x1c')](_0x43e5ba,0x0,!![],moment())['then'](function(){return _0x390541(null,![],{'message':_0x0ba3('0x19')});});}else{return utils[_0x0ba3('0x1c')](_0x43e5ba,_0x24cfcf,![],null)[_0x0ba3('0xd')](function(){return _0x390541(null,![],{'message':_0x0ba3('0x19')});});}}}else{return _0x390541(null,![],{'message':_0x0ba3('0x19')});}}else{if(_0x43e5ba['disabled']){return _0x390541(null,![],{'message':_0x0ba3('0x19')});}else if(_0x2b3d81[_0x0ba3('0xb')]>0x0){if(_0x43e5ba[_0x0ba3('0x13')]){if(_0x2b3d81[_0x0ba3('0xc')]>0x0){if(moment(_0x43e5ba['blockedAt'])[_0x0ba3('0x1a')](_0x2b3d81[_0x0ba3('0xc')],_0x0ba3('0x1b'))>moment()){return _0x390541(null,![],{'message':_0x0ba3('0x19')});}else{return utils[_0x0ba3('0x1c')](_0x43e5ba,0x0,![],null)['then'](function(){return utils[_0x0ba3('0x1d')](_0x43e5ba);})[_0x0ba3('0xd')](function(){return _0x390541(null,_0x43e5ba);});}}else{return _0x390541(null,![],{'message':_0x0ba3('0x19')});}}else{return utils['clearBlockUser'](_0x43e5ba,0x0,![],null)[_0x0ba3('0xd')](function(){return utils['getLicense'](_0x43e5ba);})[_0x0ba3('0xd')](function(){return _0x390541(null,_0x43e5ba);})[_0x0ba3('0x1e')](function(_0x5669e5){return _0x390541(null,![],_0x5669e5);});}}else{if(_0x43e5ba[_0x0ba3('0x13')]){return _0x390541(null,![],{'message':_0x0ba3('0x19')});}else{return utils[_0x0ba3('0x1d')](_0x43e5ba)[_0x0ba3('0xd')](function(){return _0x390541(null,_0x43e5ba);});}}}});})[_0x0ba3('0x1e')](function(_0x1574e9){return _0x390541(null,![],_0x1574e9);});}function sendServiceMail(_0x56a996){return db['MailAccount'][_0x0ba3('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x0ba3('0x20')],'include':[{'model':db[_0x0ba3('0x21')],'as':'Smtp'}]})['then'](function(_0x165f59){if(!_0x165f59){throw new Error(_0x0ba3('0x22'));}var _0x27e32b={'tls':{'rejectUnauthorized':![]}};if(_0x165f59['Smtp'][_0x0ba3('0x23')]){_0x27e32b[_0x0ba3('0x23')]=_0x165f59['Smtp'][_0x0ba3('0x23')];}else{_0x27e32b[_0x0ba3('0x24')]=_0x165f59[_0x0ba3('0x25')][_0x0ba3('0x24')];_0x27e32b[_0x0ba3('0x26')]=_0x165f59[_0x0ba3('0x25')][_0x0ba3('0x26')];_0x27e32b['secure']=_0x165f59[_0x0ba3('0x25')][_0x0ba3('0x27')];}if(_0x165f59[_0x0ba3('0x25')][_0x0ba3('0x28')]){_0x27e32b[_0x0ba3('0x29')]={'user':_0x165f59[_0x0ba3('0x25')][_0x0ba3('0x17')],'pass':_0x165f59['Smtp'][_0x0ba3('0x2a')]};}var _0x173442={'account':_0x27e32b,'message':_[_0x0ba3('0x2b')]({'from':util[_0x0ba3('0x2c')]('\x22%s\x22\x20<%s>',_0x165f59[_0x0ba3('0xe')],_0x165f59[_0x0ba3('0x20')]||_0x165f59[_0x0ba3('0x25')]['user'])},_0x56a996)};return client[_0x0ba3('0x2d')](_0x0ba3('0x2e'),_0x173442);})[_0x0ba3('0xd')](function(_0x38b1d9){if(_0x38b1d9['error']){throw new Error(util[_0x0ba3('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x38b1d9[_0x0ba3('0x2f')][_0x0ba3('0x30')]||JSON[_0x0ba3('0x31')](_0x38b1d9[_0x0ba3('0x2f')])));}return!![];});}function handleError(_0x4f5962,_0x3a91ff,_0x4453b7){return _0x4f5962[_0x0ba3('0x32')](_0x3a91ff||0x1f4)[_0x0ba3('0x33')]({'message':_0x4453b7?_0x4453b7[_0x0ba3('0x30')]||_0x4453b7:''});}exports[_0x0ba3('0x34')]=function(_0x28f40e,_0x5b9bc,_0x4ea898){passport['authenticate'](_0x0ba3('0x35'),function(_0xcc3ada,_0x4bf50a,_0x37b538){var _0x27391f=_0xcc3ada||_0x37b538;if(_0x27391f){return handleError(_0x5b9bc,0x191,_0x27391f);}if(!_0x4bf50a){return handleError(_0x5b9bc,0x194,{'message':_0x0ba3('0x36')});}else{var _0x4ba7a3={'payload':{'id':_0x4bf50a['id'],'role':_0x4bf50a[_0x0ba3('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0ba3('0x37')](_0x4ba7a3)['then'](function(_0x4f0e62){_0x5b9bc[_0x0ba3('0x38')]({'id':_0x4bf50a['id'],'token':_0x4f0e62,'statusCall':'','isAlreadyLogged':_0x4bf50a['online']});});}})(_0x28f40e,_0x5b9bc,_0x4ea898);};exports['forgot']=function(_0x37083d,_0x13b162,_0x3a18fe){if(!_0x37083d[_0x0ba3('0x39')][_0x0ba3('0x20')]){return handleError(_0x13b162,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x122a79=rs[_0x0ba3('0x3a')]();_0x37083d[_0x0ba3('0x39')][_0x0ba3('0x20')]=_0x37083d[_0x0ba3('0x39')][_0x0ba3('0x20')][_0x0ba3('0x3b')]()[_0x0ba3('0x3c')]();var _0x272df8;return db[_0x0ba3('0x9')][_0x0ba3('0xa')]({'where':{'id':0x1},'attributes':[_0x0ba3('0xb'),_0x0ba3('0xc')],'raw':!![]})[_0x0ba3('0xd')](function(_0x49dcde){_0x272df8=_0x49dcde;return db[_0x0ba3('0x3d')][_0x0ba3('0x1f')]({'where':{'email':_0x37083d[_0x0ba3('0x39')][_0x0ba3('0x20')]}});})[_0x0ba3('0xd')](function(_0x4d762c){if(!_0x4d762c){throw new Error(_0x0ba3('0x3e'));}if(_0x4d762c[_0x0ba3('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4d762c[_0x0ba3('0x13')]){if(moment(_0x4d762c['blockedAt'])[_0x0ba3('0x1a')](_0x272df8[_0x0ba3('0xc')],_0x0ba3('0x1b'))>moment()){throw new Error(_0x0ba3('0x3f'));}else{_0x4d762c['blocked']=![];_0x4d762c['blockedAt']=null;}}_0x4d762c[_0x0ba3('0x40')]=_0x122a79;_0x4d762c[_0x0ba3('0x41')]=Date[_0x0ba3('0x42')]()+0x36ee80;return _0x4d762c['save']();})[_0x0ba3('0xd')](function(){return sendServiceMail({'to':_0x37083d[_0x0ba3('0x39')][_0x0ba3('0x20')],'subject':_0x0ba3('0x43'),'text':_0x0ba3('0x44')+_0x0ba3('0x45')+_0x0ba3('0x46')+_0x37083d[_0x0ba3('0x47')][_0x0ba3('0x24')]+'/reset/'+_0x122a79+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0ba3('0xd')](function(){_0x13b162[_0x0ba3('0x32')](0xc8)[_0x0ba3('0x33')]({'message':_0x0ba3('0x48')});})['catch'](function(_0x308f24){return handleError(_0x13b162,0x1f4,_0x308f24);});};exports['reset']=function(_0x4c0c0e,_0xa50ec8,_0x1e1ec4){return db[_0x0ba3('0x3d')][_0x0ba3('0x1f')]({'where':{'resetPasswordToken':_0x4c0c0e[_0x0ba3('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x0ba3('0x42')]()}}})[_0x0ba3('0xd')](function(_0x4a1a03){if(!_0x4a1a03){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x0ba3('0x9')][_0x0ba3('0xa')]({'attributes':['id',_0x0ba3('0x4a'),_0x0ba3('0x4b'),_0x0ba3('0x4c')]})[_0x0ba3('0xd')](function(_0x140e3a){if(_0x140e3a['securePassword'])authService[_0x0ba3('0x4d')](_0x4c0c0e[_0x0ba3('0x39')][_0x0ba3('0xf')]);if(!_0x140e3a['enforcePasswordHistory']||!_0x4a1a03[_0x0ba3('0x4e')])return _0x4a1a03;authService[_0x0ba3('0x4f')](_0x4c0c0e[_0x0ba3('0x39')]['password'],_0x4a1a03[_0x0ba3('0x4e')],_0x140e3a['passwordHistoryLimit']);return _0x4a1a03;})[_0x0ba3('0xd')](function(){_0x4a1a03[_0x0ba3('0xf')]=_0x4c0c0e[_0x0ba3('0x39')][_0x0ba3('0xf')];_0x4a1a03[_0x0ba3('0x40')]=null;_0x4a1a03[_0x0ba3('0x41')]=null;return _0x4a1a03[_0x0ba3('0x50')]();});})['then'](function(){_0xa50ec8['status'](0xc8)[_0x0ba3('0x33')]({'message':_0x0ba3('0x51')});})[_0x0ba3('0x1e')](function(_0x15b737){return handleError(_0xa50ec8,0x1f4,_0x15b737);});};passport[_0x0ba3('0x52')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2e07f6,_0x8eeaae,_0x3b2a0e){return localAuthenticate(db[_0x0ba3('0x3d')],_0x2e07f6,_0x8eeaae,_0x3b2a0e);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8f24b85..0f64b62 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 _0xb7f5=['express','Router','post','login','/forgot','forgot','reset','exports'];(function(_0x2a5ccb,_0x206fa6){var _0x35e0b0=function(_0x22dd28){while(--_0x22dd28){_0x2a5ccb['push'](_0x2a5ccb['shift']());}};_0x35e0b0(++_0x206fa6);}(_0xb7f5,0xa8));var _0x5b7f=function(_0xa7c6dc,_0x395fe5){_0xa7c6dc=_0xa7c6dc-0x0;var _0x291f0c=_0xb7f5[_0xa7c6dc];return _0x291f0c;};'use strict';var express=require(_0x5b7f('0x0'));var router=express[_0x5b7f('0x1')]();var controller=require('./authLocal.controller');router[_0x5b7f('0x2')]('/',controller[_0x5b7f('0x3')]);router['post'](_0x5b7f('0x4'),controller[_0x5b7f('0x5')]);router[_0x5b7f('0x2')]('/reset/:token',controller[_0x5b7f('0x6')]);module[_0x5b7f('0x7')]=router; \ No newline at end of file +var _0xab89=['/reset/:token','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x1e2c60,_0x35869a){var _0x44dc44=function(_0x1e8876){while(--_0x1e8876){_0x1e2c60['push'](_0x1e2c60['shift']());}};_0x44dc44(++_0x35869a);}(_0xab89,0x1d1));var _0x9ab8=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xab89[_0x819464];return _0x49dcc0;};'use strict';var express=require(_0x9ab8('0x0'));var router=express[_0x9ab8('0x1')]();var controller=require(_0x9ab8('0x2'));router[_0x9ab8('0x3')]('/',controller[_0x9ab8('0x4')]);router[_0x9ab8('0x3')](_0x9ab8('0x5'),controller[_0x9ab8('0x6')]);router[_0x9ab8('0x3')](_0x9ab8('0x7'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2811d40..0a2ebfb 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 _0x2c65=['BOOLEAN','sequelize','exports','STRING'];(function(_0x11f85b,_0x1c368d){var _0x573270=function(_0x590e74){while(--_0x590e74){_0x11f85b['push'](_0x11f85b['shift']());}};_0x573270(++_0x1c368d);}(_0x2c65,0x13d));var _0x52c6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c65[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x52c6('0x0'));module[_0x52c6('0x1')]={'name':{'type':Sequelize[_0x52c6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x52c6('0x2')]},'description':{'type':Sequelize[_0x52c6('0x2')]},'status':{'type':Sequelize[_0x52c6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x520e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x4819e8,_0x1346de){var _0x1100eb=function(_0x3065ce){while(--_0x3065ce){_0x4819e8['push'](_0x4819e8['shift']());}};_0x1100eb(++_0x1346de);}(_0x520e,0x11c));var _0xe520=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x520e[_0x284506];return _0x1e9ee5;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe520('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe520('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe520('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index b3307b2..49245ba 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 _0xbd51=['undefined','count','set','Content-Range','reject','update','then','destroy','error','name','Automation','model','map','query','keys','filters','attributes','intersection','fields','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','length','find','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x1a013b,_0x11ee01){var _0x2941e2=function(_0x53f388){while(--_0x53f388){_0x1a013b['push'](_0x1a013b['shift']());}};_0x2941e2(++_0x11ee01);}(_0xbd51,0xd2));var _0x1bd5=function(_0xf0a090,_0x3b9ed2){_0xf0a090=_0xf0a090-0x0;var _0x507cea=_0xbd51[_0xf0a090];return _0x507cea;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1bd5('0x1'));var rp=require(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var Mustache=require(_0x1bd5('0x5'));var util=require(_0x1bd5('0x6'));var path=require(_0x1bd5('0x7'));var sox=require(_0x1bd5('0x8'));var csv=require(_0x1bd5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bd5('0xa'));var _=require(_0x1bd5('0xb'));var squel=require(_0x1bd5('0xc'));var crypto=require(_0x1bd5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1bd5('0xe'));var toCsv=require(_0x1bd5('0x9'));var querystring=require(_0x1bd5('0xf'));var Papa=require(_0x1bd5('0x10'));var Redis=require('ioredis');var authService=require(_0x1bd5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1bd5('0x12'));var hardwareService=require(_0x1bd5('0x13'));var logger=require(_0x1bd5('0x14'))('api');var utils=require(_0x1bd5('0x15'));var config=require(_0x1bd5('0x16'));var licenseUtil=require(_0x1bd5('0x17'));var db=require(_0x1bd5('0x18'))['db'];function respondWithStatusCode(_0x2df3ae,_0xc2b022){_0xc2b022=_0xc2b022||0xcc;return function(_0x3f1b37){if(_0x3f1b37){return _0x2df3ae[_0x1bd5('0x19')](_0xc2b022);}return _0x2df3ae['status'](_0xc2b022)[_0x1bd5('0x1a')]();};}function respondWithResult(_0x1f5e92,_0x428ef0){_0x428ef0=_0x428ef0||0xc8;return function(_0xd75756){if(_0xd75756){return _0x1f5e92[_0x1bd5('0x1b')](_0x428ef0)[_0x1bd5('0x1c')](_0xd75756);}};}function respondWithFilteredResult(_0x4deaee,_0x193508){return function(_0x1a3eb9){if(_0x1a3eb9){var _0x36e84e=typeof _0x193508[_0x1bd5('0x1d')]==='undefined'&&typeof _0x193508['limit']===_0x1bd5('0x1e');var _0x37841f=_0x1a3eb9[_0x1bd5('0x1f')];var _0x5cf9ae=_0x36e84e?0x0:_0x193508[_0x1bd5('0x1d')];var _0x15e159=_0x36e84e?_0x1a3eb9[_0x1bd5('0x1f')]:_0x193508[_0x1bd5('0x1d')]+_0x193508['limit'];var _0x32b4a9;if(_0x15e159>=_0x37841f){_0x15e159=_0x37841f;_0x32b4a9=0xc8;}else{_0x32b4a9=0xce;}_0x4deaee[_0x1bd5('0x1b')](_0x32b4a9);return _0x4deaee[_0x1bd5('0x20')](_0x1bd5('0x21'),_0x5cf9ae+'-'+_0x15e159+'/'+_0x37841f)[_0x1bd5('0x1c')](_0x1a3eb9);}return null;};}function patchUpdates(_0xf4e7c9){return function(_0x5a1860){try{jsonpatch['apply'](_0x5a1860,_0xf4e7c9,!![]);}catch(_0x3e7fa2){return BPromise[_0x1bd5('0x22')](_0x3e7fa2);}return _0x5a1860['save']();};}function saveUpdates(_0x28be6d,_0x5baa97){return function(_0x2057b9){if(_0x2057b9){return _0x2057b9[_0x1bd5('0x23')](_0x28be6d)[_0x1bd5('0x24')](function(_0x53bb79){return _0x53bb79;});}return null;};}function removeEntity(_0x270695,_0x528a1c){return function(_0x3c8320){if(_0x3c8320){return _0x3c8320[_0x1bd5('0x25')]()[_0x1bd5('0x24')](function(){_0x270695[_0x1bd5('0x1b')](0xcc)[_0x1bd5('0x1a')]();});}};}function handleEntityNotFound(_0x455fad,_0x3057d4){return function(_0x5f52c7){if(!_0x5f52c7){_0x455fad[_0x1bd5('0x19')](0x194);}return _0x5f52c7;};}function handleError(_0x26352a,_0x14aec4){_0x14aec4=_0x14aec4||0x1f4;return function(_0x425b90){logger[_0x1bd5('0x26')](_0x425b90['stack']);if(_0x425b90['name']){delete _0x425b90[_0x1bd5('0x27')];}_0x26352a[_0x1bd5('0x1b')](_0x14aec4)['send'](_0x425b90);};}exports['index']=function(_0x8dc53,_0x1c20f8){var _0x4f3b02={},_0x487048={},_0x407d42={'count':0x0,'rows':[]};var _0x4e8745=_['map'](db[_0x1bd5('0x28')]['rawAttributes'],function(_0x476900){return{'name':_0x476900['fieldName'],'type':_0x476900['type']['key']};});_0x487048[_0x1bd5('0x29')]=_[_0x1bd5('0x2a')](_0x4e8745,_0x1bd5('0x27'));_0x487048[_0x1bd5('0x2b')]=_[_0x1bd5('0x2c')](_0x8dc53[_0x1bd5('0x2b')]);_0x487048[_0x1bd5('0x2d')]=_['intersection'](_0x487048[_0x1bd5('0x29')],_0x487048['query']);_0x4f3b02[_0x1bd5('0x2e')]=_[_0x1bd5('0x2f')](_0x487048[_0x1bd5('0x29')],qs['fields'](_0x8dc53[_0x1bd5('0x2b')][_0x1bd5('0x30')]));_0x4f3b02[_0x1bd5('0x2e')]=_0x4f3b02[_0x1bd5('0x2e')]['length']?_0x4f3b02[_0x1bd5('0x2e')]:_0x487048[_0x1bd5('0x29')];if(!_0x8dc53[_0x1bd5('0x2b')]['hasOwnProperty']('nolimit')){_0x4f3b02[_0x1bd5('0x31')]=qs[_0x1bd5('0x31')](_0x8dc53[_0x1bd5('0x2b')][_0x1bd5('0x31')]);_0x4f3b02[_0x1bd5('0x1d')]=qs[_0x1bd5('0x1d')](_0x8dc53['query'][_0x1bd5('0x1d')]);}_0x4f3b02[_0x1bd5('0x32')]=qs[_0x1bd5('0x33')](_0x8dc53[_0x1bd5('0x2b')][_0x1bd5('0x33')]);_0x4f3b02[_0x1bd5('0x34')]=qs['filters'](_[_0x1bd5('0x35')](_0x8dc53['query'],_0x487048['filters']),_0x4e8745);if(_0x8dc53['query'][_0x1bd5('0x36')]){_0x4f3b02[_0x1bd5('0x34')]=_[_0x1bd5('0x37')](_0x4f3b02[_0x1bd5('0x34')],{'$or':_[_0x1bd5('0x2a')](_0x4e8745,function(_0x34328b){if(_0x34328b[_0x1bd5('0x38')]!==_0x1bd5('0x39')){var _0x313f12={};_0x313f12[_0x34328b['name']]={'$like':'%'+_0x8dc53[_0x1bd5('0x2b')][_0x1bd5('0x36')]+'%'};return _0x313f12;}})});}_0x4f3b02=_[_0x1bd5('0x37')]({},_0x4f3b02,_0x8dc53[_0x1bd5('0x3a')]);var _0x18c9b3={'where':_0x4f3b02[_0x1bd5('0x34')]};return db['Automation'][_0x1bd5('0x1f')](_0x18c9b3)[_0x1bd5('0x24')](function(_0xe2bb4f){_0x407d42['count']=_0xe2bb4f;if(_0x8dc53['query'][_0x1bd5('0x3b')]){_0x4f3b02[_0x1bd5('0x3c')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x4f3b02);})[_0x1bd5('0x24')](function(_0x1e6141){_0x407d42['rows']=_0x1e6141;return _0x407d42;})['then'](respondWithFilteredResult(_0x1c20f8,_0x4f3b02))[_0x1bd5('0x3d')](handleError(_0x1c20f8,null));};exports[_0x1bd5('0x3e')]=function(_0x1b741c,_0x30d24b){var _0x27b857={'raw':![],'where':{'id':_0x1b741c['params']['id']}},_0x4fa9c9={};_0x4fa9c9[_0x1bd5('0x29')]=_['keys'](db[_0x1bd5('0x28')][_0x1bd5('0x3f')]);_0x4fa9c9[_0x1bd5('0x2b')]=_[_0x1bd5('0x2c')](_0x1b741c['query']);_0x4fa9c9[_0x1bd5('0x2d')]=_[_0x1bd5('0x2f')](_0x4fa9c9[_0x1bd5('0x29')],_0x4fa9c9[_0x1bd5('0x2b')]);_0x27b857[_0x1bd5('0x2e')]=_[_0x1bd5('0x2f')](_0x4fa9c9[_0x1bd5('0x29')],qs[_0x1bd5('0x30')](_0x1b741c[_0x1bd5('0x2b')][_0x1bd5('0x30')]));_0x27b857[_0x1bd5('0x2e')]=_0x27b857['attributes'][_0x1bd5('0x40')]?_0x27b857['attributes']:_0x4fa9c9[_0x1bd5('0x29')];if(_0x1b741c[_0x1bd5('0x2b')][_0x1bd5('0x3b')]){_0x27b857['include']=[{'all':!![]}];}_0x27b857=_[_0x1bd5('0x37')]({},_0x27b857,_0x1b741c[_0x1bd5('0x3a')]);return db[_0x1bd5('0x28')][_0x1bd5('0x41')](_0x27b857)[_0x1bd5('0x24')](handleEntityNotFound(_0x30d24b,null))[_0x1bd5('0x24')](respondWithResult(_0x30d24b,null))[_0x1bd5('0x3d')](handleError(_0x30d24b,null));};exports[_0x1bd5('0x42')]=function(_0x1f0a79,_0x4c9c23){return db[_0x1bd5('0x28')][_0x1bd5('0x42')](_0x1f0a79['body'],{})['then'](respondWithResult(_0x4c9c23,0xc9))[_0x1bd5('0x3d')](handleError(_0x4c9c23,null));};exports['update']=function(_0x1490c8,_0x2cb73a){if(_0x1490c8[_0x1bd5('0x43')]['id']){delete _0x1490c8[_0x1bd5('0x43')]['id'];}return db[_0x1bd5('0x28')][_0x1bd5('0x41')]({'where':{'id':_0x1490c8[_0x1bd5('0x44')]['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x2cb73a,null))[_0x1bd5('0x24')](saveUpdates(_0x1490c8[_0x1bd5('0x43')],null))[_0x1bd5('0x24')](respondWithResult(_0x2cb73a,null))[_0x1bd5('0x3d')](handleError(_0x2cb73a,null));};exports['destroy']=function(_0x460670,_0x149462){return db['Automation']['find']({'where':{'id':_0x460670[_0x1bd5('0x44')]['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x149462,null))[_0x1bd5('0x24')](removeEntity(_0x149462,null))[_0x1bd5('0x3d')](handleError(_0x149462,null));};exports['addConditions']=function(_0x4df15f,_0x29fab9,_0x4490cf){return db[_0x1bd5('0x45')][_0x1bd5('0x41')]({'where':{'id':_0x4df15f[_0x1bd5('0x44')]['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x29fab9,null))[_0x1bd5('0x24')](function(_0x1ce427){if(_0x1ce427){return _0x1ce427[_0x1bd5('0x46')](_0x4df15f[_0x1bd5('0x43')][_0x1bd5('0x47')],_[_0x1bd5('0x48')](_0x4df15f[_0x1bd5('0x43')],[_0x1bd5('0x47'),'id'])||{});}})[_0x1bd5('0x24')](respondWithResult(_0x29fab9,null))[_0x1bd5('0x3d')](handleError(_0x29fab9,null));};exports[_0x1bd5('0x49')]=function(_0x1456ad,_0x231975,_0x2be565){var _0xdc90eb={};var _0x3d2339={};var _0x505f23;var _0x42fc75;return db[_0x1bd5('0x28')][_0x1bd5('0x4a')]({'where':{'id':_0x1456ad[_0x1bd5('0x44')]['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x231975,null))[_0x1bd5('0x24')](function(_0x412e18){if(_0x412e18){_0x505f23=_0x412e18;_0x3d2339[_0x1bd5('0x29')]=_['keys'](db[_0x1bd5('0x45')][_0x1bd5('0x3f')]);_0x3d2339[_0x1bd5('0x2b')]=_[_0x1bd5('0x2c')](_0x1456ad[_0x1bd5('0x2b')]);_0x3d2339[_0x1bd5('0x2d')]=_[_0x1bd5('0x2f')](_0x3d2339[_0x1bd5('0x29')],_0x3d2339[_0x1bd5('0x2b')]);_0xdc90eb['attributes']=_[_0x1bd5('0x2f')](_0x3d2339[_0x1bd5('0x29')],qs[_0x1bd5('0x30')](_0x1456ad[_0x1bd5('0x2b')][_0x1bd5('0x30')]));_0xdc90eb[_0x1bd5('0x2e')]=_0xdc90eb[_0x1bd5('0x2e')][_0x1bd5('0x40')]?_0xdc90eb[_0x1bd5('0x2e')]:_0x3d2339[_0x1bd5('0x29')];_0xdc90eb[_0x1bd5('0x32')]=qs['sort'](_0x1456ad[_0x1bd5('0x2b')]['sort']);_0xdc90eb[_0x1bd5('0x34')]=qs[_0x1bd5('0x2d')](_[_0x1bd5('0x35')](_0x1456ad[_0x1bd5('0x2b')],_0x3d2339[_0x1bd5('0x2d')]));if(_0x1456ad['query'][_0x1bd5('0x36')]){_0xdc90eb[_0x1bd5('0x34')]=_[_0x1bd5('0x37')](_0xdc90eb[_0x1bd5('0x34')],{'$or':_[_0x1bd5('0x2a')](_0xdc90eb['attributes'],function(_0x2fd93d){var _0x56879b={};_0x56879b[_0x2fd93d]={'$like':'%'+_0x1456ad[_0x1bd5('0x2b')]['filter']+'%'};return _0x56879b;})});}_0xdc90eb=_[_0x1bd5('0x37')]({},_0xdc90eb,_0x1456ad[_0x1bd5('0x3a')]);return _0x505f23[_0x1bd5('0x49')](_0xdc90eb);}})[_0x1bd5('0x24')](function(_0x40219a){if(_0x40219a){_0x42fc75=_0x40219a[_0x1bd5('0x40')];if(!_0x1456ad[_0x1bd5('0x2b')]['hasOwnProperty'](_0x1bd5('0x4b'))){_0xdc90eb[_0x1bd5('0x31')]=qs['limit'](_0x1456ad['query']['limit']);_0xdc90eb[_0x1bd5('0x1d')]=qs[_0x1bd5('0x1d')](_0x1456ad[_0x1bd5('0x2b')]['offset']);}return _0x505f23[_0x1bd5('0x49')](_0xdc90eb);}})[_0x1bd5('0x24')](function(_0x1b0920){if(_0x1b0920){return _0x1b0920?{'count':_0x42fc75,'rows':_0x1b0920}:null;}})[_0x1bd5('0x24')](respondWithResult(_0x231975,null))[_0x1bd5('0x3d')](handleError(_0x231975,null));};exports[_0x1bd5('0x4c')]=function(_0x360728,_0x1d034f,_0x2e86a8){return db[_0x1bd5('0x4d')][_0x1bd5('0x41')]({'where':{'id':_0x360728['params']['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x1d034f,null))['then'](function(_0x18921c){if(_0x18921c){return _0x18921c[_0x1bd5('0x4c')](_0x360728[_0x1bd5('0x43')][_0x1bd5('0x47')],_['omit'](_0x360728[_0x1bd5('0x43')],[_0x1bd5('0x47'),'id'])||{});}})['then'](respondWithResult(_0x1d034f,null))[_0x1bd5('0x3d')](handleError(_0x1d034f,null));};exports[_0x1bd5('0x4e')]=function(_0x23f2d3,_0x2a906e,_0x55e125){var _0xf5b94c={};var _0x2b2198={};var _0x467b84;var _0x1e689b;return db[_0x1bd5('0x28')][_0x1bd5('0x4a')]({'where':{'id':_0x23f2d3[_0x1bd5('0x44')]['id']}})[_0x1bd5('0x24')](handleEntityNotFound(_0x2a906e,null))[_0x1bd5('0x24')](function(_0x1d73dc){if(_0x1d73dc){_0x467b84=_0x1d73dc;_0x2b2198[_0x1bd5('0x29')]=_[_0x1bd5('0x2c')](db[_0x1bd5('0x4d')][_0x1bd5('0x3f')]);_0x2b2198[_0x1bd5('0x2b')]=_[_0x1bd5('0x2c')](_0x23f2d3[_0x1bd5('0x2b')]);_0x2b2198[_0x1bd5('0x2d')]=_['intersection'](_0x2b2198['model'],_0x2b2198[_0x1bd5('0x2b')]);_0xf5b94c[_0x1bd5('0x2e')]=_[_0x1bd5('0x2f')](_0x2b2198[_0x1bd5('0x29')],qs[_0x1bd5('0x30')](_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x30')]));_0xf5b94c[_0x1bd5('0x2e')]=_0xf5b94c['attributes'][_0x1bd5('0x40')]?_0xf5b94c[_0x1bd5('0x2e')]:_0x2b2198[_0x1bd5('0x29')];_0xf5b94c['order']=qs[_0x1bd5('0x33')](_0x23f2d3[_0x1bd5('0x2b')]['sort']);_0xf5b94c['where']=qs[_0x1bd5('0x2d')](_[_0x1bd5('0x35')](_0x23f2d3[_0x1bd5('0x2b')],_0x2b2198['filters']));if(_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x36')]){_0xf5b94c['where']=_['merge'](_0xf5b94c['where'],{'$or':_[_0x1bd5('0x2a')](_0xf5b94c['attributes'],function(_0x48a095){var _0x26fe36={};_0x26fe36[_0x48a095]={'$like':'%'+_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x36')]+'%'};return _0x26fe36;})});}_0xf5b94c=_[_0x1bd5('0x37')]({},_0xf5b94c,_0x23f2d3['options']);return _0x467b84[_0x1bd5('0x4e')](_0xf5b94c);}})[_0x1bd5('0x24')](function(_0x357c89){if(_0x357c89){_0x1e689b=_0x357c89[_0x1bd5('0x40')];if(!_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x1bd5('0x4b'))){_0xf5b94c[_0x1bd5('0x31')]=qs['limit'](_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x31')]);_0xf5b94c[_0x1bd5('0x1d')]=qs[_0x1bd5('0x1d')](_0x23f2d3[_0x1bd5('0x2b')][_0x1bd5('0x1d')]);}return _0x467b84[_0x1bd5('0x4e')](_0xf5b94c);}})[_0x1bd5('0x24')](function(_0x1264c5){if(_0x1264c5){return _0x1264c5?{'count':_0x1e689b,'rows':_0x1264c5}:null;}})[_0x1bd5('0x24')](respondWithResult(_0x2a906e,null))[_0x1bd5('0x3d')](handleError(_0x2a906e,null));}; \ No newline at end of file +var _0x6f6e=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','includeAll','include','Automation','findAll','rows','catch','show','keys','create','body','params','destroy','addConditions','Condition','find','ids','getConditions','findOne','pick','options','nolimit','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x45977c,_0x7eaed0){var _0x399413=function(_0x41cc76){while(--_0x41cc76){_0x45977c['push'](_0x45977c['shift']());}};_0x399413(++_0x7eaed0);}(_0x6f6e,0x194));var _0xe6f6=function(_0xd7937f,_0x4400fe){_0xd7937f=_0xd7937f-0x0;var _0x3727b4=_0x6f6e[_0xd7937f];return _0x3727b4;};'use strict';var emlformat=require(_0xe6f6('0x0'));var rimraf=require(_0xe6f6('0x1'));var zipdir=require(_0xe6f6('0x2'));var jsonpatch=require(_0xe6f6('0x3'));var rp=require('request-promise');var moment=require(_0xe6f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe6f6('0x5'));var util=require('util');var path=require(_0xe6f6('0x6'));var sox=require(_0xe6f6('0x7'));var csv=require(_0xe6f6('0x8'));var ejs=require(_0xe6f6('0x9'));var fs=require('fs');var fs_extra=require(_0xe6f6('0xa'));var _=require(_0xe6f6('0xb'));var squel=require(_0xe6f6('0xc'));var crypto=require(_0xe6f6('0xd'));var jsforce=require(_0xe6f6('0xe'));var deskjs=require(_0xe6f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe6f6('0x10'));var Papa=require('papaparse');var Redis=require(_0xe6f6('0x11'));var authService=require(_0xe6f6('0x12'));var qs=require(_0xe6f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6f6('0x14'));var logger=require('../../config/logger')(_0xe6f6('0x15'));var utils=require('../../config/utils');var config=require(_0xe6f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6f6('0x17'))['db'];function respondWithStatusCode(_0x1dc4b8,_0x16412d){_0x16412d=_0x16412d||0xcc;return function(_0x1e6aed){if(_0x1e6aed){return _0x1dc4b8[_0xe6f6('0x18')](_0x16412d);}return _0x1dc4b8['status'](_0x16412d)[_0xe6f6('0x19')]();};}function respondWithResult(_0x4bbbf0,_0x65a73a){_0x65a73a=_0x65a73a||0xc8;return function(_0xd8b41d){if(_0xd8b41d){return _0x4bbbf0[_0xe6f6('0x1a')](_0x65a73a)[_0xe6f6('0x1b')](_0xd8b41d);}};}function respondWithFilteredResult(_0x8c1c74,_0x21a63b){return function(_0x513933){if(_0x513933){var _0x5c7531=typeof _0x21a63b[_0xe6f6('0x1c')]===_0xe6f6('0x1d')&&typeof _0x21a63b['limit']===_0xe6f6('0x1d');var _0x193abc=_0x513933['count'];var _0x3f4806=_0x5c7531?0x0:_0x21a63b[_0xe6f6('0x1c')];var _0x18f5c2=_0x5c7531?_0x513933[_0xe6f6('0x1e')]:_0x21a63b[_0xe6f6('0x1c')]+_0x21a63b['limit'];var _0x1afd8d;if(_0x18f5c2>=_0x193abc){_0x18f5c2=_0x193abc;_0x1afd8d=0xc8;}else{_0x1afd8d=0xce;}_0x8c1c74[_0xe6f6('0x1a')](_0x1afd8d);return _0x8c1c74['set']('Content-Range',_0x3f4806+'-'+_0x18f5c2+'/'+_0x193abc)[_0xe6f6('0x1b')](_0x513933);}return null;};}function patchUpdates(_0x3d0427){return function(_0x390ad5){try{jsonpatch['apply'](_0x390ad5,_0x3d0427,!![]);}catch(_0x36ffd0){return BPromise['reject'](_0x36ffd0);}return _0x390ad5[_0xe6f6('0x1f')]();};}function saveUpdates(_0x3629da,_0x19c484){return function(_0x29c5ee){if(_0x29c5ee){return _0x29c5ee[_0xe6f6('0x20')](_0x3629da)[_0xe6f6('0x21')](function(_0x20e84a){return _0x20e84a;});}return null;};}function removeEntity(_0x104312,_0x5cde5a){return function(_0x3aa6ba){if(_0x3aa6ba){return _0x3aa6ba['destroy']()['then'](function(){_0x104312[_0xe6f6('0x1a')](0xcc)[_0xe6f6('0x19')]();});}};}function handleEntityNotFound(_0x6f3a04,_0x3d3173){return function(_0x383983){if(!_0x383983){_0x6f3a04[_0xe6f6('0x18')](0x194);}return _0x383983;};}function handleError(_0x4f865d,_0x1f1989){_0x1f1989=_0x1f1989||0x1f4;return function(_0x4ab63a){logger[_0xe6f6('0x22')](_0x4ab63a[_0xe6f6('0x23')]);if(_0x4ab63a['name']){delete _0x4ab63a[_0xe6f6('0x24')];}_0x4f865d[_0xe6f6('0x1a')](_0x1f1989)['send'](_0x4ab63a);};}exports[_0xe6f6('0x25')]=function(_0x486a6e,_0x379f7e){var _0xf0b350={},_0x4bbc5c={},_0x7b5031={'count':0x0,'rows':[]};var _0x5076e3=_[_0xe6f6('0x26')](db['Automation'][_0xe6f6('0x27')],function(_0x449ebf){return{'name':_0x449ebf[_0xe6f6('0x28')],'type':_0x449ebf['type'][_0xe6f6('0x29')]};});_0x4bbc5c[_0xe6f6('0x2a')]=_['map'](_0x5076e3,'name');_0x4bbc5c[_0xe6f6('0x2b')]=_['keys'](_0x486a6e['query']);_0x4bbc5c['filters']=_['intersection'](_0x4bbc5c[_0xe6f6('0x2a')],_0x4bbc5c['query']);_0xf0b350[_0xe6f6('0x2c')]=_[_0xe6f6('0x2d')](_0x4bbc5c['model'],qs[_0xe6f6('0x2e')](_0x486a6e['query'][_0xe6f6('0x2e')]));_0xf0b350[_0xe6f6('0x2c')]=_0xf0b350[_0xe6f6('0x2c')][_0xe6f6('0x2f')]?_0xf0b350[_0xe6f6('0x2c')]:_0x4bbc5c[_0xe6f6('0x2a')];if(!_0x486a6e['query'][_0xe6f6('0x30')]('nolimit')){_0xf0b350['limit']=qs['limit'](_0x486a6e[_0xe6f6('0x2b')][_0xe6f6('0x31')]);_0xf0b350[_0xe6f6('0x1c')]=qs['offset'](_0x486a6e[_0xe6f6('0x2b')][_0xe6f6('0x1c')]);}_0xf0b350[_0xe6f6('0x32')]=qs[_0xe6f6('0x33')](_0x486a6e[_0xe6f6('0x2b')][_0xe6f6('0x33')]);_0xf0b350['where']=qs[_0xe6f6('0x34')](_['pick'](_0x486a6e[_0xe6f6('0x2b')],_0x4bbc5c['filters']),_0x5076e3);if(_0x486a6e[_0xe6f6('0x2b')][_0xe6f6('0x35')]){_0xf0b350[_0xe6f6('0x36')]=_[_0xe6f6('0x37')](_0xf0b350[_0xe6f6('0x36')],{'$or':_['map'](_0x5076e3,function(_0x220761){if(_0x220761[_0xe6f6('0x38')]!==_0xe6f6('0x39')){var _0x5958ad={};_0x5958ad[_0x220761[_0xe6f6('0x24')]]={'$like':'%'+_0x486a6e[_0xe6f6('0x2b')]['filter']+'%'};return _0x5958ad;}})});}_0xf0b350=_['merge']({},_0xf0b350,_0x486a6e['options']);var _0x492f8a={'where':_0xf0b350[_0xe6f6('0x36')]};return db['Automation'][_0xe6f6('0x1e')](_0x492f8a)[_0xe6f6('0x21')](function(_0x25d62e){_0x7b5031[_0xe6f6('0x1e')]=_0x25d62e;if(_0x486a6e[_0xe6f6('0x2b')][_0xe6f6('0x3a')]){_0xf0b350[_0xe6f6('0x3b')]=[{'all':!![]}];}return db[_0xe6f6('0x3c')][_0xe6f6('0x3d')](_0xf0b350);})[_0xe6f6('0x21')](function(_0x7d1b35){_0x7b5031[_0xe6f6('0x3e')]=_0x7d1b35;return _0x7b5031;})[_0xe6f6('0x21')](respondWithFilteredResult(_0x379f7e,_0xf0b350))[_0xe6f6('0x3f')](handleError(_0x379f7e,null));};exports[_0xe6f6('0x40')]=function(_0x239665,_0x1d29a7){var _0x5f3e74={'raw':![],'where':{'id':_0x239665['params']['id']}},_0x110e60={};_0x110e60[_0xe6f6('0x2a')]=_['keys'](db[_0xe6f6('0x3c')][_0xe6f6('0x27')]);_0x110e60['query']=_[_0xe6f6('0x41')](_0x239665[_0xe6f6('0x2b')]);_0x110e60[_0xe6f6('0x34')]=_[_0xe6f6('0x2d')](_0x110e60[_0xe6f6('0x2a')],_0x110e60['query']);_0x5f3e74[_0xe6f6('0x2c')]=_[_0xe6f6('0x2d')](_0x110e60[_0xe6f6('0x2a')],qs[_0xe6f6('0x2e')](_0x239665[_0xe6f6('0x2b')][_0xe6f6('0x2e')]));_0x5f3e74[_0xe6f6('0x2c')]=_0x5f3e74[_0xe6f6('0x2c')][_0xe6f6('0x2f')]?_0x5f3e74['attributes']:_0x110e60[_0xe6f6('0x2a')];if(_0x239665[_0xe6f6('0x2b')]['includeAll']){_0x5f3e74['include']=[{'all':!![]}];}_0x5f3e74=_[_0xe6f6('0x37')]({},_0x5f3e74,_0x239665['options']);return db[_0xe6f6('0x3c')]['find'](_0x5f3e74)[_0xe6f6('0x21')](handleEntityNotFound(_0x1d29a7,null))[_0xe6f6('0x21')](respondWithResult(_0x1d29a7,null))[_0xe6f6('0x3f')](handleError(_0x1d29a7,null));};exports['create']=function(_0x584a17,_0xcaf7e){return db[_0xe6f6('0x3c')][_0xe6f6('0x42')](_0x584a17[_0xe6f6('0x43')],{})['then'](respondWithResult(_0xcaf7e,0xc9))[_0xe6f6('0x3f')](handleError(_0xcaf7e,null));};exports[_0xe6f6('0x20')]=function(_0x1dd612,_0x3f09b9){if(_0x1dd612[_0xe6f6('0x43')]['id']){delete _0x1dd612[_0xe6f6('0x43')]['id'];}return db['Automation']['find']({'where':{'id':_0x1dd612[_0xe6f6('0x44')]['id']}})[_0xe6f6('0x21')](handleEntityNotFound(_0x3f09b9,null))[_0xe6f6('0x21')](saveUpdates(_0x1dd612[_0xe6f6('0x43')],null))[_0xe6f6('0x21')](respondWithResult(_0x3f09b9,null))['catch'](handleError(_0x3f09b9,null));};exports[_0xe6f6('0x45')]=function(_0x40f4f2,_0x5cc9da){return db[_0xe6f6('0x3c')]['find']({'where':{'id':_0x40f4f2[_0xe6f6('0x44')]['id']}})[_0xe6f6('0x21')](handleEntityNotFound(_0x5cc9da,null))['then'](removeEntity(_0x5cc9da,null))[_0xe6f6('0x3f')](handleError(_0x5cc9da,null));};exports[_0xe6f6('0x46')]=function(_0x191d12,_0x525e7e,_0x41ec5f){return db[_0xe6f6('0x47')][_0xe6f6('0x48')]({'where':{'id':_0x191d12['params']['id']}})[_0xe6f6('0x21')](handleEntityNotFound(_0x525e7e,null))[_0xe6f6('0x21')](function(_0x7f85b4){if(_0x7f85b4){return _0x7f85b4[_0xe6f6('0x46')](_0x191d12[_0xe6f6('0x43')][_0xe6f6('0x49')],_['omit'](_0x191d12[_0xe6f6('0x43')],[_0xe6f6('0x49'),'id'])||{});}})[_0xe6f6('0x21')](respondWithResult(_0x525e7e,null))[_0xe6f6('0x3f')](handleError(_0x525e7e,null));};exports[_0xe6f6('0x4a')]=function(_0x46e913,_0x287365,_0xebdcea){var _0x47e81e={};var _0x11ef34={};var _0x3d017d;var _0xe01518;return db[_0xe6f6('0x3c')][_0xe6f6('0x4b')]({'where':{'id':_0x46e913[_0xe6f6('0x44')]['id']}})['then'](handleEntityNotFound(_0x287365,null))['then'](function(_0x6a7d16){if(_0x6a7d16){_0x3d017d=_0x6a7d16;_0x11ef34[_0xe6f6('0x2a')]=_[_0xe6f6('0x41')](db[_0xe6f6('0x47')][_0xe6f6('0x27')]);_0x11ef34[_0xe6f6('0x2b')]=_['keys'](_0x46e913['query']);_0x11ef34[_0xe6f6('0x34')]=_[_0xe6f6('0x2d')](_0x11ef34[_0xe6f6('0x2a')],_0x11ef34[_0xe6f6('0x2b')]);_0x47e81e['attributes']=_[_0xe6f6('0x2d')](_0x11ef34[_0xe6f6('0x2a')],qs[_0xe6f6('0x2e')](_0x46e913['query'][_0xe6f6('0x2e')]));_0x47e81e['attributes']=_0x47e81e[_0xe6f6('0x2c')][_0xe6f6('0x2f')]?_0x47e81e['attributes']:_0x11ef34[_0xe6f6('0x2a')];_0x47e81e[_0xe6f6('0x32')]=qs[_0xe6f6('0x33')](_0x46e913[_0xe6f6('0x2b')][_0xe6f6('0x33')]);_0x47e81e[_0xe6f6('0x36')]=qs[_0xe6f6('0x34')](_[_0xe6f6('0x4c')](_0x46e913[_0xe6f6('0x2b')],_0x11ef34['filters']));if(_0x46e913[_0xe6f6('0x2b')]['filter']){_0x47e81e[_0xe6f6('0x36')]=_['merge'](_0x47e81e[_0xe6f6('0x36')],{'$or':_[_0xe6f6('0x26')](_0x47e81e[_0xe6f6('0x2c')],function(_0x25e2c6){var _0x558eb7={};_0x558eb7[_0x25e2c6]={'$like':'%'+_0x46e913[_0xe6f6('0x2b')][_0xe6f6('0x35')]+'%'};return _0x558eb7;})});}_0x47e81e=_[_0xe6f6('0x37')]({},_0x47e81e,_0x46e913[_0xe6f6('0x4d')]);return _0x3d017d[_0xe6f6('0x4a')](_0x47e81e);}})[_0xe6f6('0x21')](function(_0x311fd7){if(_0x311fd7){_0xe01518=_0x311fd7[_0xe6f6('0x2f')];if(!_0x46e913[_0xe6f6('0x2b')][_0xe6f6('0x30')](_0xe6f6('0x4e'))){_0x47e81e['limit']=qs[_0xe6f6('0x31')](_0x46e913[_0xe6f6('0x2b')][_0xe6f6('0x31')]);_0x47e81e[_0xe6f6('0x1c')]=qs[_0xe6f6('0x1c')](_0x46e913[_0xe6f6('0x2b')][_0xe6f6('0x1c')]);}return _0x3d017d[_0xe6f6('0x4a')](_0x47e81e);}})['then'](function(_0x4430c5){if(_0x4430c5){return _0x4430c5?{'count':_0xe01518,'rows':_0x4430c5}:null;}})[_0xe6f6('0x21')](respondWithResult(_0x287365,null))[_0xe6f6('0x3f')](handleError(_0x287365,null));};exports[_0xe6f6('0x4f')]=function(_0x5d9f7b,_0x3252ca,_0x817816){return db[_0xe6f6('0x50')]['find']({'where':{'id':_0x5d9f7b['params']['id']}})[_0xe6f6('0x21')](handleEntityNotFound(_0x3252ca,null))[_0xe6f6('0x21')](function(_0x50d63c){if(_0x50d63c){return _0x50d63c[_0xe6f6('0x4f')](_0x5d9f7b[_0xe6f6('0x43')][_0xe6f6('0x49')],_[_0xe6f6('0x51')](_0x5d9f7b[_0xe6f6('0x43')],['ids','id'])||{});}})[_0xe6f6('0x21')](respondWithResult(_0x3252ca,null))[_0xe6f6('0x3f')](handleError(_0x3252ca,null));};exports[_0xe6f6('0x52')]=function(_0x5d0ac2,_0x4e4403,_0x217a89){var _0xd64cca={};var _0x3fe361={};var _0x336be;var _0x150b23;return db['Automation'][_0xe6f6('0x4b')]({'where':{'id':_0x5d0ac2[_0xe6f6('0x44')]['id']}})[_0xe6f6('0x21')](handleEntityNotFound(_0x4e4403,null))[_0xe6f6('0x21')](function(_0x269691){if(_0x269691){_0x336be=_0x269691;_0x3fe361[_0xe6f6('0x2a')]=_[_0xe6f6('0x41')](db[_0xe6f6('0x50')]['rawAttributes']);_0x3fe361['query']=_[_0xe6f6('0x41')](_0x5d0ac2[_0xe6f6('0x2b')]);_0x3fe361['filters']=_['intersection'](_0x3fe361[_0xe6f6('0x2a')],_0x3fe361[_0xe6f6('0x2b')]);_0xd64cca[_0xe6f6('0x2c')]=_[_0xe6f6('0x2d')](_0x3fe361['model'],qs[_0xe6f6('0x2e')](_0x5d0ac2[_0xe6f6('0x2b')][_0xe6f6('0x2e')]));_0xd64cca[_0xe6f6('0x2c')]=_0xd64cca[_0xe6f6('0x2c')][_0xe6f6('0x2f')]?_0xd64cca[_0xe6f6('0x2c')]:_0x3fe361[_0xe6f6('0x2a')];_0xd64cca[_0xe6f6('0x32')]=qs[_0xe6f6('0x33')](_0x5d0ac2[_0xe6f6('0x2b')][_0xe6f6('0x33')]);_0xd64cca[_0xe6f6('0x36')]=qs['filters'](_['pick'](_0x5d0ac2[_0xe6f6('0x2b')],_0x3fe361['filters']));if(_0x5d0ac2[_0xe6f6('0x2b')]['filter']){_0xd64cca[_0xe6f6('0x36')]=_[_0xe6f6('0x37')](_0xd64cca[_0xe6f6('0x36')],{'$or':_['map'](_0xd64cca[_0xe6f6('0x2c')],function(_0xe92a16){var _0x4cc830={};_0x4cc830[_0xe92a16]={'$like':'%'+_0x5d0ac2[_0xe6f6('0x2b')]['filter']+'%'};return _0x4cc830;})});}_0xd64cca=_[_0xe6f6('0x37')]({},_0xd64cca,_0x5d0ac2[_0xe6f6('0x4d')]);return _0x336be[_0xe6f6('0x52')](_0xd64cca);}})[_0xe6f6('0x21')](function(_0x3d4120){if(_0x3d4120){_0x150b23=_0x3d4120[_0xe6f6('0x2f')];if(!_0x5d0ac2['query']['hasOwnProperty'](_0xe6f6('0x4e'))){_0xd64cca[_0xe6f6('0x31')]=qs[_0xe6f6('0x31')](_0x5d0ac2[_0xe6f6('0x2b')][_0xe6f6('0x31')]);_0xd64cca[_0xe6f6('0x1c')]=qs[_0xe6f6('0x1c')](_0x5d0ac2[_0xe6f6('0x2b')][_0xe6f6('0x1c')]);}return _0x336be[_0xe6f6('0x52')](_0xd64cca);}})[_0xe6f6('0x21')](function(_0xdd2b04){if(_0xdd2b04){return _0xdd2b04?{'count':_0x150b23,'rows':_0xdd2b04}:null;}})['then'](respondWithResult(_0x4e4403,null))['catch'](handleError(_0x4e4403,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3ec4bb9..82197b5 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 _0x2974=['./automation.attributes','Automation','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xbe7a41,_0x2173a7){var _0x933130=function(_0x1821b8){while(--_0x1821b8){_0xbe7a41['push'](_0xbe7a41['shift']());}};_0x933130(++_0x2173a7);}(_0x2974,0xfc));var _0x4297=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x2974[_0x3c6ae2];return _0x4edda;};'use strict';var _=require(_0x4297('0x0'));var util=require(_0x4297('0x1'));var logger=require('../../config/logger')(_0x4297('0x2'));var moment=require(_0x4297('0x3'));var BPromise=require('bluebird');var rp=require(_0x4297('0x4'));var fs=require('fs');var path=require(_0x4297('0x5'));var rimraf=require(_0x4297('0x6'));var config=require(_0x4297('0x7'));var attributes=require(_0x4297('0x8'));module['exports']=function(_0x4f1eb3,_0x58167d){return _0x4f1eb3['define'](_0x4297('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8f2=['path','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb8f2,0x19e));var _0x2b8f=function(_0x374ed1,_0x1d728c){_0x374ed1=_0x374ed1-0x0;var _0x12bc51=_0xb8f2[_0x374ed1];return _0x12bc51;};'use strict';var _=require(_0x2b8f('0x0'));var util=require(_0x2b8f('0x1'));var logger=require(_0x2b8f('0x2'))(_0x2b8f('0x3'));var moment=require(_0x2b8f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b8f('0x5'));var fs=require('fs');var path=require(_0x2b8f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b8f('0x7'));module[_0x2b8f('0x8')]=function(_0x569bd3,_0x154d3e){return _0x569bd3[_0x2b8f('0x9')](_0x2b8f('0xa'),attributes,{'tableName':_0x2b8f('0xb'),'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 8e18522..4fe8746 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 _0xbc95=['stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x4c0efa,_0x43bc32){var _0x5d0e53=function(_0xfa2a3e){while(--_0xfa2a3e){_0x4c0efa['push'](_0x4c0efa['shift']());}};_0x5d0e53(++_0x43bc32);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x32dc62,_0xb7f67c){_0x32dc62=_0x32dc62-0x0;var _0x307f88=_0xbc95[_0x32dc62];return _0x307f88;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc9('0x5'))(_0x5bc9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5bc9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c02e9,_0x2fb0a2,_0x4bdc20){return new BPromise(function(_0x49ab1a,_0x6cc9f1){return client[_0x5bc9('0x8')](_0x5c02e9,_0x4bdc20)[_0x5bc9('0x9')](function(_0x357d27){logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,'request\x20sent');logger[_0x5bc9('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2fb0a2,'request\x20sent',JSON[_0x5bc9('0xd')](_0x357d27));if(_0x357d27['error']){if(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0xf')]===0x1f4){logger[_0x5bc9('0xe')](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27[_0x5bc9('0xe')]['message']);return _0x6cc9f1(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}logger['error'](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27['error']['message']);return _0x49ab1a(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}else{logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,_0x5bc9('0x11'));_0x49ab1a(_0x357d27[_0x5bc9('0x12')]['message']);}})['catch'](function(_0x617dad){logger[_0x5bc9('0xe')]('Automation,\x20%s,\x20%s',_0x2fb0a2,_0x617dad);_0x6cc9f1(_0x617dad);});});} \ No newline at end of file +var _0xcb10=['info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0xcb10,0x104));var _0x0cb1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcb10[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var moment=require('moment');var BPromise=require(_0x0cb1('0x2'));var rs=require(_0x0cb1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cb1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cb1('0x5'))(_0x0cb1('0x6'));var config=require(_0x0cb1('0x7'));var jayson=require(_0x0cb1('0x8'));var client=jayson[_0x0cb1('0x9')][_0x0cb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x390335,_0xdda18c,_0x575138){return new BPromise(function(_0x43620c,_0x1f815e){return client[_0x0cb1('0xb')](_0x390335,_0x575138)[_0x0cb1('0xc')](function(_0x41e0d2){logger[_0x0cb1('0xd')](_0x0cb1('0xe'),_0xdda18c,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xdda18c,_0x0cb1('0xf'),JSON[_0x0cb1('0x10')](_0x41e0d2));if(_0x41e0d2['error']){if(_0x41e0d2['error']['code']===0x1f4){logger[_0x0cb1('0x11')]('Automation,\x20%s,\x20%s',_0xdda18c,_0x41e0d2[_0x0cb1('0x11')][_0x0cb1('0x12')]);return _0x1f815e(_0x41e0d2[_0x0cb1('0x11')][_0x0cb1('0x12')]);}logger[_0x0cb1('0x11')](_0x0cb1('0xe'),_0xdda18c,_0x41e0d2['error'][_0x0cb1('0x12')]);return _0x43620c(_0x41e0d2[_0x0cb1('0x11')]['message']);}else{logger[_0x0cb1('0xd')]('Automation,\x20%s,\x20%s',_0xdda18c,_0x0cb1('0xf'));_0x43620c(_0x41e0d2[_0x0cb1('0x13')]['message']);}})[_0x0cb1('0x14')](function(_0x24315d){logger[_0x0cb1('0x11')](_0x0cb1('0xe'),_0xdda18c,_0x24315d);_0x1f815e(_0x24315d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ce02337..f1daf38 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 _0x5640=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','create','addActions','put','/:id','update','delete','exports','multer','path'];(function(_0x479307,_0x1ae280){var _0x46e8f8=function(_0x1dcea8){while(--_0x1dcea8){_0x479307['push'](_0x479307['shift']());}};_0x46e8f8(++_0x1ae280);}(_0x5640,0x111));var _0x0564=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5640[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x0564('0x0'));var util=require('util');var path=require(_0x0564('0x1'));var timeout=require(_0x0564('0x2'));var express=require(_0x0564('0x3'));var router=express[_0x0564('0x4')]();var fs_extra=require(_0x0564('0x5'));var auth=require(_0x0564('0x6'));var interaction=require(_0x0564('0x7'));var config=require(_0x0564('0x8'));var controller=require(_0x0564('0x9'));router[_0x0564('0xa')]('/',auth[_0x0564('0xb')](),controller[_0x0564('0xc')]);router[_0x0564('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0564('0xd')]);router[_0x0564('0xa')](_0x0564('0xe'),auth[_0x0564('0xb')](),controller['getConditions']);router[_0x0564('0xa')](_0x0564('0xf'),auth['isAuthenticated'](),controller[_0x0564('0x10')]);router[_0x0564('0x11')]('/',auth['isAuthenticated'](),controller[_0x0564('0x12')]);router[_0x0564('0x11')](_0x0564('0xe'),auth['isAuthenticated'](),controller['addConditions']);router[_0x0564('0x11')]('/:id/actions',auth[_0x0564('0xb')](),controller[_0x0564('0x13')]);router[_0x0564('0x14')](_0x0564('0x15'),auth[_0x0564('0xb')](),controller[_0x0564('0x16')]);router[_0x0564('0x17')](_0x0564('0x15'),auth[_0x0564('0xb')](),controller['destroy']);module[_0x0564('0x18')]=router; \ No newline at end of file +var _0x6b27=['index','get','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x6b27,0x176));var _0x76b2=function(_0x205f12,_0x3f6454){_0x205f12=_0x205f12-0x0;var _0x571fc6=_0x6b27[_0x205f12];return _0x571fc6;};'use strict';var multer=require(_0x76b2('0x0'));var util=require(_0x76b2('0x1'));var path=require('path');var timeout=require(_0x76b2('0x2'));var express=require(_0x76b2('0x3'));var router=express[_0x76b2('0x4')]();var fs_extra=require(_0x76b2('0x5'));var auth=require(_0x76b2('0x6'));var interaction=require(_0x76b2('0x7'));var config=require(_0x76b2('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0x76b2('0x9')](),controller[_0x76b2('0xa')]);router[_0x76b2('0xb')](_0x76b2('0xc'),auth[_0x76b2('0x9')](),controller[_0x76b2('0xd')]);router[_0x76b2('0xb')]('/:id/conditions',auth[_0x76b2('0x9')](),controller['getConditions']);router[_0x76b2('0xb')](_0x76b2('0xe'),auth['isAuthenticated'](),controller[_0x76b2('0xf')]);router[_0x76b2('0x10')]('/',auth[_0x76b2('0x9')](),controller[_0x76b2('0x11')]);router[_0x76b2('0x10')](_0x76b2('0x12'),auth[_0x76b2('0x9')](),controller['addConditions']);router[_0x76b2('0x10')](_0x76b2('0xe'),auth[_0x76b2('0x9')](),controller[_0x76b2('0x13')]);router[_0x76b2('0x14')]('/:id',auth[_0x76b2('0x9')](),controller['update']);router[_0x76b2('0x15')](_0x76b2('0xc'),auth[_0x76b2('0x9')](),controller[_0x76b2('0x16')]);module[_0x76b2('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 871678d..310639a 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 _0xe721=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0xe721,0x138));var _0x1e72=function(_0x5b5784,_0x103fef){_0x5b5784=_0x5b5784-0x0;var _0x5a7b69=_0xe721[_0x5b5784];return _0x5a7b69;};'use strict';var Sequelize=require(_0x1e72('0x0'));module[_0x1e72('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1e72('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1e72('0x5')]},'active':{'type':Sequelize[_0x1e72('0x6')],'defaultValue':0x0,'comment':_0x1e72('0x7')},'limitCalls':{'type':Sequelize[_0x1e72('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1e72('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1e72('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1e72('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1e72('0x11')},'dialTimezone':{'type':Sequelize[_0x1e72('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1e72('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x1e72('0x3')](_0x1e72('0x13'),_0x1e72('0x14'),_0x1e72('0x15')),'defaultValue':_0x1e72('0x13')},'dialAMDActive':{'type':Sequelize[_0x1e72('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1e72('0x8')](0x9)[_0x1e72('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1e72('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1e72('0x8')](0x9)[_0x1e72('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1e72('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1e72('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1e72('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1e72('0x8')](0x9)[_0x1e72('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1e72('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x1e72('0x8')](0x9)[_0x1e72('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1e72('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1e72('0x8')](0x9)[_0x1e72('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1e72('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1e72('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1e72('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1e72('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1e72('0x1e'),_0x1e72('0x1f')),'defaultValue':_0x1e72('0x1e')},'dialPrefix':{'type':Sequelize[_0x1e72('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1e72('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1e72('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1e72('0x8')](0x3)[_0x1e72('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e72('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1e72('0x8')](0x5)[_0x1e72('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e72('0x29')}}; \ No newline at end of file +var _0x38a1=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x245a7b,_0x342d5e){var _0x20f68d=function(_0x26d6bf){while(--_0x26d6bf){_0x245a7b['push'](_0x245a7b['shift']());}};_0x20f68d(++_0x342d5e);}(_0x38a1,0x160));var _0x138a=function(_0x5d2505,_0x1f334d){_0x5d2505=_0x5d2505-0x0;var _0x1dfa39=_0x38a1[_0x5d2505];return _0x1dfa39;};'use strict';var Sequelize=require(_0x138a('0x0'));module[_0x138a('0x1')]={'name':{'type':Sequelize[_0x138a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x138a('0x3')](_0x138a('0x4')),'allowNull':![],'defaultValue':_0x138a('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x138a('0x5')],'defaultValue':0x0,'comment':_0x138a('0x6')},'limitCalls':{'type':Sequelize[_0x138a('0x7')](0x4)[_0x138a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x138a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x138a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x138a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x138a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x138a('0xf')},'dialTimezone':{'type':Sequelize[_0x138a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x138a('0x2')],'defaultValue':_0x138a('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x138a('0x3')](_0x138a('0x11'),_0x138a('0x12'),_0x138a('0x13')),'defaultValue':_0x138a('0x11')},'dialAMDActive':{'type':Sequelize[_0x138a('0x5')],'defaultValue':0x0,'comment':_0x138a('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x138a('0x7')](0x9)[_0x138a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x138a('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x138a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x138a('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x138a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x138a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x138a('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x138a('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x138a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x138a('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x138a('0x7')](0x9)[_0x138a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x138a('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x138a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x138a('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x138a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x138a('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x138a('0x3')](_0x138a('0x1d'),'ASC'),'defaultValue':_0x138a('0x1d')},'dialPrefix':{'type':Sequelize[_0x138a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x138a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x138a('0x1e')},'dialCutDigit':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x138a('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x138a('0x7')](0x3)[_0x138a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x138a('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x138a('0x7')](0x5)[_0x138a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x138a('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 06224ec..f8a1add 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 _0x5d63=['into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','fromQuery','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','includeAll','include','rows','catch','keys','intersection','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert'];(function(_0x43f294,_0x254515){var _0x343113=function(_0x52fcf1){while(--_0x52fcf1){_0x43f294['push'](_0x43f294['shift']());}};_0x343113(++_0x254515);}(_0x5d63,0x12c));var _0x35d6=function(_0xbf1747,_0x43b06c){_0xbf1747=_0xbf1747-0x0;var _0x3b7657=_0x5d63[_0xbf1747];return _0x3b7657;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35d6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x35d6('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x35d6('0x2'));var util=require(_0x35d6('0x3'));var path=require(_0x35d6('0x4'));var sox=require(_0x35d6('0x5'));var csv=require(_0x35d6('0x6'));var ejs=require(_0x35d6('0x7'));var fs=require('fs');var fs_extra=require(_0x35d6('0x8'));var _=require(_0x35d6('0x9'));var squel=require(_0x35d6('0xa'));var crypto=require(_0x35d6('0xb'));var jsforce=require(_0x35d6('0xc'));var deskjs=require(_0x35d6('0xd'));var toCsv=require(_0x35d6('0x6'));var querystring=require(_0x35d6('0xe'));var Papa=require(_0x35d6('0xf'));var Redis=require('ioredis');var authService=require(_0x35d6('0x10'));var qs=require(_0x35d6('0x11'));var as=require(_0x35d6('0x12'));var hardwareService=require(_0x35d6('0x13'));var logger=require(_0x35d6('0x14'))('api');var utils=require(_0x35d6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x35d6('0x16'));var db=require(_0x35d6('0x17'))['db'];function respondWithStatusCode(_0x242dff,_0x3a9f66){_0x3a9f66=_0x3a9f66||0xcc;return function(_0x548ca5){if(_0x548ca5){return _0x242dff['sendStatus'](_0x3a9f66);}return _0x242dff[_0x35d6('0x18')](_0x3a9f66)[_0x35d6('0x19')]();};}function respondWithResult(_0x2a4c58,_0x4499dd){_0x4499dd=_0x4499dd||0xc8;return function(_0x2c128c){if(_0x2c128c){return _0x2a4c58['status'](_0x4499dd)[_0x35d6('0x1a')](_0x2c128c);}};}function respondWithFilteredResult(_0x1eb536,_0x1a30d9){return function(_0x2b13b7){if(_0x2b13b7){var _0x4a16a5=typeof _0x1a30d9[_0x35d6('0x1b')]==='undefined'&&typeof _0x1a30d9[_0x35d6('0x1c')]==='undefined';var _0x37ef38=_0x2b13b7['count'];var _0x600b91=_0x4a16a5?0x0:_0x1a30d9['offset'];var _0x129e73=_0x4a16a5?_0x2b13b7[_0x35d6('0x1d')]:_0x1a30d9['offset']+_0x1a30d9[_0x35d6('0x1c')];var _0x432a01;if(_0x129e73>=_0x37ef38){_0x129e73=_0x37ef38;_0x432a01=0xc8;}else{_0x432a01=0xce;}_0x1eb536[_0x35d6('0x18')](_0x432a01);return _0x1eb536[_0x35d6('0x1e')](_0x35d6('0x1f'),_0x600b91+'-'+_0x129e73+'/'+_0x37ef38)[_0x35d6('0x1a')](_0x2b13b7);}return null;};}function patchUpdates(_0x388e0c){return function(_0x25fe58){try{jsonpatch[_0x35d6('0x20')](_0x25fe58,_0x388e0c,!![]);}catch(_0x2e63ee){return BPromise[_0x35d6('0x21')](_0x2e63ee);}return _0x25fe58[_0x35d6('0x22')]();};}function saveUpdates(_0x44cbdb,_0x5de8a0){return function(_0xbe348e){if(_0xbe348e){return _0xbe348e[_0x35d6('0x23')](_0x44cbdb)[_0x35d6('0x24')](function(_0x5c50dd){return _0x5c50dd;});}return null;};}function removeEntity(_0x59372d,_0x47574e){return function(_0xe0699a){if(_0xe0699a){return _0xe0699a[_0x35d6('0x25')]()['then'](function(){var _0xc93c44=_0xe0699a[_0x35d6('0x26')]({'plain':!![]});var _0x54e067=_0x35d6('0x27');return db[_0x35d6('0x28')]['destroy']({'where':{'type':_0x54e067,'resourceId':_0xc93c44['id']}})['then'](function(){return _0xe0699a;});})[_0x35d6('0x24')](function(){_0x59372d[_0x35d6('0x18')](0xcc)[_0x35d6('0x19')]();});}};}function handleEntityNotFound(_0x3931bb,_0x520921){return function(_0x132e94){if(!_0x132e94){_0x3931bb[_0x35d6('0x29')](0x194);}return _0x132e94;};}function handleError(_0x19760b,_0xa48bcd){_0xa48bcd=_0xa48bcd||0x1f4;return function(_0x53a3f2){logger[_0x35d6('0x2a')](_0x53a3f2[_0x35d6('0x2b')]);if(_0x53a3f2[_0x35d6('0x2c')]){delete _0x53a3f2[_0x35d6('0x2c')];}_0x19760b[_0x35d6('0x18')](_0xa48bcd)[_0x35d6('0x2d')](_0x53a3f2);};}exports[_0x35d6('0x2e')]=function(_0x40ad5d,_0x4f2ecb){var _0x558f5c={},_0x10cd9a={},_0x6232b3={'count':0x0,'rows':[]};var _0x4916ea=_[_0x35d6('0x2f')](db[_0x35d6('0x30')][_0x35d6('0x31')],function(_0x1d7cd2){return{'name':_0x1d7cd2['fieldName'],'type':_0x1d7cd2[_0x35d6('0x32')][_0x35d6('0x33')]};});_0x10cd9a['model']=_['map'](_0x4916ea,_0x35d6('0x2c'));_0x10cd9a[_0x35d6('0x34')]=_['keys'](_0x40ad5d[_0x35d6('0x34')]);_0x10cd9a[_0x35d6('0x35')]=_['intersection'](_0x10cd9a[_0x35d6('0x36')],_0x10cd9a['query']);_0x558f5c[_0x35d6('0x37')]=_['intersection'](_0x10cd9a[_0x35d6('0x36')],qs[_0x35d6('0x38')](_0x40ad5d[_0x35d6('0x34')]['fields']));_0x558f5c[_0x35d6('0x37')]=_0x558f5c[_0x35d6('0x37')][_0x35d6('0x39')]?_0x558f5c['attributes']:_0x10cd9a['model'];if(!_0x40ad5d[_0x35d6('0x34')][_0x35d6('0x3a')](_0x35d6('0x3b'))){_0x558f5c[_0x35d6('0x1c')]=qs[_0x35d6('0x1c')](_0x40ad5d['query'][_0x35d6('0x1c')]);_0x558f5c[_0x35d6('0x1b')]=qs[_0x35d6('0x1b')](_0x40ad5d[_0x35d6('0x34')][_0x35d6('0x1b')]);}_0x558f5c[_0x35d6('0x3c')]=qs[_0x35d6('0x3d')](_0x40ad5d['query'][_0x35d6('0x3d')]);_0x558f5c['where']=qs[_0x35d6('0x35')](_[_0x35d6('0x3e')](_0x40ad5d[_0x35d6('0x34')],_0x10cd9a[_0x35d6('0x35')]),_0x4916ea);if(_0x40ad5d[_0x35d6('0x34')]['filter']){_0x558f5c['where']=_['merge'](_0x558f5c[_0x35d6('0x3f')],{'$or':_[_0x35d6('0x2f')](_0x4916ea,function(_0x571e75){if(_0x571e75[_0x35d6('0x32')]!==_0x35d6('0x40')){var _0x3a79fc={};_0x3a79fc[_0x571e75[_0x35d6('0x2c')]]={'$like':'%'+_0x40ad5d[_0x35d6('0x34')][_0x35d6('0x41')]+'%'};return _0x3a79fc;}})});}_0x558f5c=_['merge']({},_0x558f5c,_0x40ad5d['options']);var _0x38d72e={'where':_0x558f5c[_0x35d6('0x3f')]};return db['Campaign'][_0x35d6('0x1d')](_0x38d72e)[_0x35d6('0x24')](function(_0x16abe2){_0x6232b3['count']=_0x16abe2;if(_0x40ad5d['query'][_0x35d6('0x42')]){_0x558f5c[_0x35d6('0x43')]=[{'all':!![]}];}return db[_0x35d6('0x30')]['findAll'](_0x558f5c);})[_0x35d6('0x24')](function(_0x593c77){_0x6232b3[_0x35d6('0x44')]=_0x593c77;return _0x6232b3;})[_0x35d6('0x24')](respondWithFilteredResult(_0x4f2ecb,_0x558f5c))[_0x35d6('0x45')](handleError(_0x4f2ecb,null));};exports['show']=function(_0x1aa8b7,_0x174e96){var _0x4cdee6={'raw':![],'where':{'id':_0x1aa8b7['params']['id']}},_0x2aabbb={};_0x2aabbb[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x30')][_0x35d6('0x31')]);_0x2aabbb[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x1aa8b7[_0x35d6('0x34')]);_0x2aabbb[_0x35d6('0x35')]=_[_0x35d6('0x47')](_0x2aabbb['model'],_0x2aabbb[_0x35d6('0x34')]);_0x4cdee6[_0x35d6('0x37')]=_[_0x35d6('0x47')](_0x2aabbb[_0x35d6('0x36')],qs['fields'](_0x1aa8b7['query'][_0x35d6('0x38')]));_0x4cdee6[_0x35d6('0x37')]=_0x4cdee6[_0x35d6('0x37')]['length']?_0x4cdee6[_0x35d6('0x37')]:_0x2aabbb['model'];if(_0x1aa8b7[_0x35d6('0x34')]['includeAll']){_0x4cdee6[_0x35d6('0x43')]=[{'all':!![]}];}_0x4cdee6=_[_0x35d6('0x48')]({},_0x4cdee6,_0x1aa8b7[_0x35d6('0x49')]);return db[_0x35d6('0x30')][_0x35d6('0x4a')](_0x4cdee6)[_0x35d6('0x24')](handleEntityNotFound(_0x174e96,null))[_0x35d6('0x24')](respondWithResult(_0x174e96,null))[_0x35d6('0x45')](handleError(_0x174e96,null));};exports[_0x35d6('0x4b')]=function(_0x1e6e8b,_0x40a2d0){return db[_0x35d6('0x30')][_0x35d6('0x4b')](_0x1e6e8b[_0x35d6('0x4c')],{})[_0x35d6('0x24')](function(_0x4f7ac1){var _0x33fe7f=_0x1e6e8b[_0x35d6('0x4d')]['get']({'plain':!![]});if(!_0x33fe7f)throw new Error(_0x35d6('0x4e'));if(_0x33fe7f[_0x35d6('0x4f')]===_0x35d6('0x4d')){var _0x22f712=_0x4f7ac1[_0x35d6('0x26')]({'plain':!![]});var _0x365bb1=_0x35d6('0x27');return db[_0x35d6('0x50')][_0x35d6('0x4a')]({'where':{'name':_0x365bb1,'userProfileId':_0x33fe7f[_0x35d6('0x51')]},'raw':!![]})[_0x35d6('0x24')](function(_0x3d93de){if(_0x3d93de&&_0x3d93de[_0x35d6('0x52')]===0x0){return db[_0x35d6('0x28')][_0x35d6('0x4b')]({'name':_0x22f712[_0x35d6('0x2c')],'resourceId':_0x22f712['id'],'type':_0x3d93de[_0x35d6('0x2c')],'sectionId':_0x3d93de['id']},{})[_0x35d6('0x24')](function(){return _0x4f7ac1;});}else{return _0x4f7ac1;}})['catch'](function(_0x5d0ce4){logger[_0x35d6('0x2a')](_0x35d6('0x53'),_0x5d0ce4);throw _0x5d0ce4;});}return _0x4f7ac1;})['then'](respondWithResult(_0x40a2d0,0xc9))[_0x35d6('0x45')](handleError(_0x40a2d0,null));};exports[_0x35d6('0x54')]=function(_0x483836,_0x4c475c){var _0x8d193a={'where':{'id':_0x483836[_0x35d6('0x55')]['id']}},_0x5160e8={};_0x5160e8[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x30')][_0x35d6('0x31')]);_0x8d193a['attributes']=_[_0x35d6('0x47')](_0x5160e8[_0x35d6('0x36')],qs['fields'](_0x483836['query'][_0x35d6('0x38')]));_0x8d193a[_0x35d6('0x37')]=_0x8d193a[_0x35d6('0x37')][_0x35d6('0x39')]?_0x8d193a[_0x35d6('0x37')]:_0x5160e8[_0x35d6('0x36')];if(_0x483836[_0x35d6('0x34')][_0x35d6('0x42')]){_0x8d193a[_0x35d6('0x43')]=[{'all':!![]}];}_0x8d193a=_[_0x35d6('0x48')]({},_0x8d193a,_0x483836[_0x35d6('0x49')]);return db['Campaign'][_0x35d6('0x4a')](_0x8d193a)[_0x35d6('0x24')](handleEntityNotFound(_0x4c475c,null))[_0x35d6('0x24')](function(_0xa85577){if(_0xa85577){var _0x45e808=_0xa85577['get']({'plain':!![]});_0x45e808=qs[_0x35d6('0x56')](_0x45e808,['id',_0x35d6('0x57'),_0x35d6('0x58')]);_0x483836[_0x35d6('0x4c')]=_[_0x35d6('0x56')](_0x483836[_0x35d6('0x4c')],['id','createdAt',_0x35d6('0x58')]);return db[_0x35d6('0x30')][_0x35d6('0x4b')](_[_0x35d6('0x48')](_0x45e808,_0x483836[_0x35d6('0x4c')]),{'include':_0x483836[_0x35d6('0x34')][_0x35d6('0x42')]?[{'all':!![]}]:undefined})[_0x35d6('0x24')](function(_0x415ff2){var _0xd42544=_0x483836[_0x35d6('0x4d')]['get']({'plain':!![]});if(!_0xd42544)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd42544[_0x35d6('0x4f')]===_0x35d6('0x4d')){var _0x3561d8=_0x415ff2[_0x35d6('0x26')]({'plain':!![]});var _0x784f7=_0x35d6('0x27');return db[_0x35d6('0x50')]['find']({'where':{'name':_0x784f7,'userProfileId':_0xd42544['userProfileId']},'raw':!![]})['then'](function(_0x11081e){if(_0x11081e&&_0x11081e[_0x35d6('0x52')]===0x0){return db['UserProfileResource'][_0x35d6('0x4b')]({'name':_0x3561d8[_0x35d6('0x2c')],'resourceId':_0x3561d8['id'],'type':_0x11081e[_0x35d6('0x2c')],'sectionId':_0x11081e['id']},{})['then'](function(){return _0x415ff2;});}else{return _0x415ff2;}})[_0x35d6('0x45')](function(_0x39f528){logger[_0x35d6('0x2a')](_0x35d6('0x53'),_0x39f528);throw _0x39f528;});}return _0x415ff2;});}})[_0x35d6('0x24')](respondWithResult(_0x4c475c,0xc9))[_0x35d6('0x45')](handleError(_0x4c475c,null));};exports[_0x35d6('0x23')]=function(_0x464fb3,_0x4fd8ff){if(_0x464fb3['body']['id']){delete _0x464fb3[_0x35d6('0x4c')]['id'];}return db['Campaign'][_0x35d6('0x4a')]({'where':{'id':_0x464fb3[_0x35d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x4fd8ff,null))['then'](saveUpdates(_0x464fb3[_0x35d6('0x4c')],null))[_0x35d6('0x24')](respondWithResult(_0x4fd8ff,null))[_0x35d6('0x45')](handleError(_0x4fd8ff,null));};exports[_0x35d6('0x25')]=function(_0x2d0bb4,_0x1fb158){return db[_0x35d6('0x30')]['find']({'where':{'id':_0x2d0bb4[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x1fb158,null))[_0x35d6('0x24')](removeEntity(_0x1fb158,null))[_0x35d6('0x45')](handleError(_0x1fb158,null));};exports[_0x35d6('0x59')]=function(_0x1952c5,_0xf4d675,_0x5be9ea){var _0x558e3b={'raw':!![],'where':{}};var _0x567485={};var _0x59e69e={'count':0x0,'rows':[]};return db[_0x35d6('0x30')][_0x35d6('0x5a')]({'where':{'id':_0x1952c5[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0xf4d675,null))['then'](function(_0x276ce4){if(_0x276ce4){_0x567485[_0x35d6('0x36')]=_[_0x35d6('0x46')](db['CmHopper'][_0x35d6('0x31')]);_0x567485[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x1952c5[_0x35d6('0x34')]);_0x567485[_0x35d6('0x35')]=_[_0x35d6('0x47')](_0x567485[_0x35d6('0x36')],_0x567485['query']);_0x558e3b['attributes']=_[_0x35d6('0x47')](_0x567485[_0x35d6('0x36')],qs[_0x35d6('0x38')](_0x1952c5['query'][_0x35d6('0x38')]));_0x558e3b['attributes']=_0x558e3b[_0x35d6('0x37')][_0x35d6('0x39')]?_0x558e3b[_0x35d6('0x37')]:_0x567485[_0x35d6('0x36')];if(!_0x1952c5[_0x35d6('0x34')]['hasOwnProperty'](_0x35d6('0x3b'))){_0x558e3b[_0x35d6('0x1c')]=qs['limit'](_0x1952c5[_0x35d6('0x34')][_0x35d6('0x1c')]);_0x558e3b[_0x35d6('0x1b')]=qs['offset'](_0x1952c5[_0x35d6('0x34')]['offset']);}_0x558e3b[_0x35d6('0x3c')]=qs[_0x35d6('0x3d')](_0x1952c5[_0x35d6('0x34')][_0x35d6('0x3d')]);_0x558e3b['where']=qs['filters'](_[_0x35d6('0x3e')](_0x1952c5[_0x35d6('0x34')],_0x567485[_0x35d6('0x35')]));_0x558e3b[_0x35d6('0x3f')][_0x35d6('0x5b')]=_0x276ce4['id'];if(_0x1952c5['query'][_0x35d6('0x41')]){_0x558e3b['where']=_[_0x35d6('0x48')](_0x558e3b[_0x35d6('0x3f')],{'$or':_[_0x35d6('0x2f')](_0x558e3b[_0x35d6('0x37')],function(_0x103e23){var _0x265816={};_0x265816[_0x103e23]={'$like':'%'+_0x1952c5['query']['filter']+'%'};return _0x265816;})});}_0x558e3b=_[_0x35d6('0x48')]({},_0x558e3b,_0x1952c5[_0x35d6('0x49')]);return db[_0x35d6('0x5c')]['count']({'where':_0x558e3b[_0x35d6('0x3f')]})[_0x35d6('0x24')](function(_0x5668fc){_0x59e69e[_0x35d6('0x1d')]=_0x5668fc;if(_0x1952c5['query'][_0x35d6('0x42')]){_0x558e3b['include']=[{'all':!![]}];}return db[_0x35d6('0x5c')][_0x35d6('0x5d')](_0x558e3b);})['then'](function(_0x26f6db){_0x59e69e[_0x35d6('0x44')]=_0x26f6db;return _0x59e69e;});}})['then'](respondWithFilteredResult(_0xf4d675,_0x558e3b))[_0x35d6('0x45')](handleError(_0xf4d675,null));};exports[_0x35d6('0x5e')]=function(_0x1763dc,_0x1726c2,_0x4a7680){var _0x3e8119={'raw':!![],'where':{}};var _0x9c0c18={};var _0x448c54={'count':0x0,'rows':[]};return db[_0x35d6('0x30')]['findOne']({'where':{'id':_0x1763dc[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x1726c2,null))[_0x35d6('0x24')](function(_0x58bef0){if(_0x58bef0){_0x9c0c18[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x5f')][_0x35d6('0x31')]);_0x9c0c18[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x1763dc['query']);_0x9c0c18[_0x35d6('0x35')]=_[_0x35d6('0x47')](_0x9c0c18[_0x35d6('0x36')],_0x9c0c18['query']);_0x3e8119[_0x35d6('0x37')]=_[_0x35d6('0x47')](_0x9c0c18[_0x35d6('0x36')],qs['fields'](_0x1763dc[_0x35d6('0x34')][_0x35d6('0x38')]));_0x3e8119[_0x35d6('0x37')]=_0x3e8119[_0x35d6('0x37')]['length']?_0x3e8119[_0x35d6('0x37')]:_0x9c0c18[_0x35d6('0x36')];if(!_0x1763dc[_0x35d6('0x34')]['hasOwnProperty'](_0x35d6('0x3b'))){_0x3e8119['limit']=qs[_0x35d6('0x1c')](_0x1763dc[_0x35d6('0x34')][_0x35d6('0x1c')]);_0x3e8119[_0x35d6('0x1b')]=qs[_0x35d6('0x1b')](_0x1763dc['query'][_0x35d6('0x1b')]);}_0x3e8119[_0x35d6('0x3c')]=qs[_0x35d6('0x3d')](_0x1763dc['query'][_0x35d6('0x3d')]);_0x3e8119[_0x35d6('0x3f')]=qs[_0x35d6('0x35')](_[_0x35d6('0x3e')](_0x1763dc[_0x35d6('0x34')],_0x9c0c18[_0x35d6('0x35')]));_0x3e8119[_0x35d6('0x3f')]['CampaignId']=_0x58bef0['id'];if(_0x1763dc['query']['filter']){_0x3e8119[_0x35d6('0x3f')]=_[_0x35d6('0x48')](_0x3e8119['where'],{'$or':_[_0x35d6('0x2f')](_0x3e8119[_0x35d6('0x37')],function(_0x59f5db){var _0x12e119={};_0x12e119[_0x59f5db]={'$like':'%'+_0x1763dc[_0x35d6('0x34')]['filter']+'%'};return _0x12e119;})});}_0x3e8119=_['merge']({},_0x3e8119,_0x1763dc[_0x35d6('0x49')]);return db[_0x35d6('0x5f')]['count']({'where':_0x3e8119[_0x35d6('0x3f')]})[_0x35d6('0x24')](function(_0xa1b67f){_0x448c54[_0x35d6('0x1d')]=_0xa1b67f;if(_0x1763dc[_0x35d6('0x34')][_0x35d6('0x42')]){_0x3e8119['include']=[{'all':!![]}];}return db[_0x35d6('0x5f')][_0x35d6('0x5d')](_0x3e8119);})['then'](function(_0x13f519){_0x448c54[_0x35d6('0x44')]=_0x13f519;return _0x448c54;});}})[_0x35d6('0x24')](respondWithFilteredResult(_0x1726c2,_0x3e8119))[_0x35d6('0x45')](handleError(_0x1726c2,null));};exports[_0x35d6('0x60')]=function(_0x1d241b,_0x4abb2c,_0x5a660e){var _0xe700d={'raw':!![],'where':{}};var _0x1aa915={};var _0x57a371={'count':0x0,'rows':[]};return db[_0x35d6('0x30')][_0x35d6('0x5a')]({'where':{'id':_0x1d241b[_0x35d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x4abb2c,null))[_0x35d6('0x24')](function(_0x453bf5){if(_0x453bf5){_0x1aa915[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x61')][_0x35d6('0x31')]);_0x1aa915[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x1d241b[_0x35d6('0x34')]);_0x1aa915[_0x35d6('0x35')]=_[_0x35d6('0x47')](_0x1aa915['model'],_0x1aa915[_0x35d6('0x34')]);_0xe700d['attributes']=_['intersection'](_0x1aa915[_0x35d6('0x36')],qs['fields'](_0x1d241b['query']['fields']));_0xe700d[_0x35d6('0x37')]=_0xe700d['attributes']['length']?_0xe700d[_0x35d6('0x37')]:_0x1aa915['model'];if(!_0x1d241b[_0x35d6('0x34')][_0x35d6('0x3a')](_0x35d6('0x3b'))){_0xe700d[_0x35d6('0x1c')]=qs[_0x35d6('0x1c')](_0x1d241b['query'][_0x35d6('0x1c')]);_0xe700d[_0x35d6('0x1b')]=qs[_0x35d6('0x1b')](_0x1d241b[_0x35d6('0x34')][_0x35d6('0x1b')]);}_0xe700d[_0x35d6('0x3c')]=qs['sort'](_0x1d241b[_0x35d6('0x34')][_0x35d6('0x3d')]);_0xe700d[_0x35d6('0x3f')]=qs[_0x35d6('0x35')](_['pick'](_0x1d241b[_0x35d6('0x34')],_0x1aa915[_0x35d6('0x35')]));_0xe700d[_0x35d6('0x3f')][_0x35d6('0x5b')]=_0x453bf5['id'];if(_0x1d241b[_0x35d6('0x34')]['filter']){_0xe700d['where']=_[_0x35d6('0x48')](_0xe700d['where'],{'$or':_['map'](_0xe700d[_0x35d6('0x37')],function(_0x1cd774){var _0x3c9b5b={};_0x3c9b5b[_0x1cd774]={'$like':'%'+_0x1d241b[_0x35d6('0x34')][_0x35d6('0x41')]+'%'};return _0x3c9b5b;})});}_0xe700d=_[_0x35d6('0x48')]({},_0xe700d,_0x1d241b[_0x35d6('0x49')]);return db['CmHopperFinal'][_0x35d6('0x1d')]({'where':_0xe700d[_0x35d6('0x3f')]})[_0x35d6('0x24')](function(_0xa48642){_0x57a371[_0x35d6('0x1d')]=_0xa48642;if(_0x1d241b[_0x35d6('0x34')]['includeAll']){_0xe700d['include']=[{'all':!![]}];}return db[_0x35d6('0x61')]['findAll'](_0xe700d);})[_0x35d6('0x24')](function(_0x47a905){_0x57a371['rows']=_0x47a905;return _0x57a371;});}})['then'](respondWithFilteredResult(_0x4abb2c,_0xe700d))[_0x35d6('0x45')](handleError(_0x4abb2c,null));};exports[_0x35d6('0x62')]=function(_0x57092f,_0x10bc22,_0x37ae9d){var _0x3557e2={'raw':!![],'where':{}};var _0x120de9={};var _0x3cf5f5={'count':0x0,'rows':[]};return db[_0x35d6('0x30')]['findOne']({'where':{'id':_0x57092f[_0x35d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x10bc22,null))['then'](function(_0x3a9a99){if(_0x3a9a99){_0x120de9[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x63')][_0x35d6('0x31')]);_0x120de9[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x57092f[_0x35d6('0x34')]);_0x120de9[_0x35d6('0x35')]=_['intersection'](_0x120de9[_0x35d6('0x36')],_0x120de9[_0x35d6('0x34')]);_0x3557e2[_0x35d6('0x37')]=_[_0x35d6('0x47')](_0x120de9['model'],qs['fields'](_0x57092f['query'][_0x35d6('0x38')]));_0x3557e2['attributes']=_0x3557e2[_0x35d6('0x37')][_0x35d6('0x39')]?_0x3557e2[_0x35d6('0x37')]:_0x120de9[_0x35d6('0x36')];if(!_0x57092f['query'][_0x35d6('0x3a')](_0x35d6('0x3b'))){_0x3557e2[_0x35d6('0x1c')]=qs[_0x35d6('0x1c')](_0x57092f[_0x35d6('0x34')]['limit']);_0x3557e2[_0x35d6('0x1b')]=qs[_0x35d6('0x1b')](_0x57092f[_0x35d6('0x34')][_0x35d6('0x1b')]);}_0x3557e2[_0x35d6('0x3c')]=qs[_0x35d6('0x3d')](_0x57092f[_0x35d6('0x34')]['sort']);_0x3557e2[_0x35d6('0x3f')]=qs['filters'](_[_0x35d6('0x3e')](_0x57092f[_0x35d6('0x34')],_0x120de9[_0x35d6('0x35')]));_0x3557e2[_0x35d6('0x3f')]['CampaignId']=_0x3a9a99['id'];if(_0x57092f[_0x35d6('0x34')][_0x35d6('0x41')]){_0x3557e2['where']=_['merge'](_0x3557e2[_0x35d6('0x3f')],{'$or':_[_0x35d6('0x2f')](_0x3557e2[_0x35d6('0x37')],function(_0x45fddd){var _0x3e83c3={};_0x3e83c3[_0x45fddd]={'$like':'%'+_0x57092f[_0x35d6('0x34')][_0x35d6('0x41')]+'%'};return _0x3e83c3;})});}_0x3557e2=_[_0x35d6('0x48')]({},_0x3557e2,_0x57092f[_0x35d6('0x49')]);return db['CmHopperBlack'][_0x35d6('0x1d')]({'where':_0x3557e2[_0x35d6('0x3f')]})['then'](function(_0x3389a3){_0x3cf5f5[_0x35d6('0x1d')]=_0x3389a3;if(_0x57092f['query']['includeAll']){_0x3557e2[_0x35d6('0x43')]=[{'all':!![]}];}return db[_0x35d6('0x63')][_0x35d6('0x5d')](_0x3557e2);})[_0x35d6('0x24')](function(_0x206a44){_0x3cf5f5[_0x35d6('0x44')]=_0x206a44;return _0x3cf5f5;});}})[_0x35d6('0x24')](respondWithFilteredResult(_0x10bc22,_0x3557e2))['catch'](handleError(_0x10bc22,null));};exports['getLists']=function(_0x10d529,_0x49c7f6,_0x4fb153){var _0x128cfc={};var _0x236e19={};var _0x2c54f9;var _0x4f11ce;return db[_0x35d6('0x30')][_0x35d6('0x5a')]({'where':{'id':_0x10d529['params']['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x49c7f6,null))['then'](function(_0x4113d5){if(_0x4113d5){_0x2c54f9=_0x4113d5;_0x236e19[_0x35d6('0x36')]=_[_0x35d6('0x46')](db[_0x35d6('0x64')]['rawAttributes']);_0x236e19[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x10d529[_0x35d6('0x34')]);_0x236e19['filters']=_[_0x35d6('0x47')](_0x236e19[_0x35d6('0x36')],_0x236e19[_0x35d6('0x34')]);_0x128cfc[_0x35d6('0x37')]=_['intersection'](_0x236e19[_0x35d6('0x36')],qs[_0x35d6('0x38')](_0x10d529[_0x35d6('0x34')]['fields']));_0x128cfc[_0x35d6('0x37')]=_0x128cfc[_0x35d6('0x37')][_0x35d6('0x39')]?_0x128cfc[_0x35d6('0x37')]:_0x236e19['model'];_0x128cfc[_0x35d6('0x3c')]=qs[_0x35d6('0x3d')](_0x10d529[_0x35d6('0x34')][_0x35d6('0x3d')]);_0x128cfc[_0x35d6('0x3f')]=qs['filters'](_[_0x35d6('0x3e')](_0x10d529[_0x35d6('0x34')],_0x236e19[_0x35d6('0x35')]));if(_0x10d529[_0x35d6('0x34')][_0x35d6('0x41')]){_0x128cfc[_0x35d6('0x3f')]=_[_0x35d6('0x48')](_0x128cfc[_0x35d6('0x3f')],{'$or':_[_0x35d6('0x2f')](_0x128cfc['attributes'],function(_0x2fd0c5){var _0x55be29={};_0x55be29[_0x2fd0c5]={'$like':'%'+_0x10d529[_0x35d6('0x34')][_0x35d6('0x41')]+'%'};return _0x55be29;})});}_0x128cfc=_[_0x35d6('0x48')]({},_0x128cfc,_0x10d529[_0x35d6('0x49')]);return _0x2c54f9[_0x35d6('0x65')](_0x128cfc);}})[_0x35d6('0x24')](function(_0x26c8e9){if(_0x26c8e9){_0x4f11ce=_0x26c8e9[_0x35d6('0x39')];if(!_0x10d529[_0x35d6('0x34')][_0x35d6('0x3a')](_0x35d6('0x3b'))){_0x128cfc[_0x35d6('0x1c')]=qs['limit'](_0x10d529['query'][_0x35d6('0x1c')]);_0x128cfc[_0x35d6('0x1b')]=qs['offset'](_0x10d529[_0x35d6('0x34')][_0x35d6('0x1b')]);}return _0x2c54f9['getLists'](_0x128cfc);}})[_0x35d6('0x24')](function(_0x46f86a){if(_0x46f86a){return _0x46f86a?{'count':_0x4f11ce,'rows':_0x46f86a}:null;}})['then'](respondWithResult(_0x49c7f6,null))['catch'](handleError(_0x49c7f6,null));};exports[_0x35d6('0x66')]=function(_0x5c7e85,_0x4b78ab,_0x191383){var _0x421a35,_0x175ce8;return db[_0x35d6('0x30')][_0x35d6('0x4a')]({'where':{'id':_0x5c7e85[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x4b78ab,null))[_0x35d6('0x24')](function(_0x4082a7){if(_0x4082a7){_0x175ce8=_0x4082a7;return _0x4082a7[_0x35d6('0x66')](_0x5c7e85[_0x35d6('0x4c')][_0x35d6('0x67')],_[_0x35d6('0x56')](_0x5c7e85[_0x35d6('0x4c')],[_0x35d6('0x67'),'id'])||{});}return null;})[_0x35d6('0x68')](function(_0x27892e){var _0x18b14a;_0x421a35=_0x27892e||[];var _0x4687fd=[];if(_0x27892e){for(var _0x5346f1=0x0;_0x5346f1<_0x27892e['length'];_0x5346f1+=0x1){var _0x575fbc=_0x27892e[_0x5346f1][_0x35d6('0x26')]({'plain':!![]});_0x175ce8[_0x35d6('0x69')]=_0x5c7e85[_0x35d6('0x4c')][_0x35d6('0x69')]?_0x5c7e85[_0x35d6('0x4c')][_0x35d6('0x69')]:_0x175ce8[_0x35d6('0x69')];switch(_0x175ce8['dialCheckDuplicateType']){case _0x35d6('0x6a'):_0x18b14a=squel[_0x35d6('0x6b')]()[_0x35d6('0x6c')](_0x35d6('0x6d'))['fromQuery']([_0x35d6('0x6e'),_0x35d6('0x6f'),_0x35d6('0x70'),_0x35d6('0x71'),_0x35d6('0x5b'),'createdAt',_0x35d6('0x58')],squel[_0x35d6('0x72')]()[_0x35d6('0x73')]('phone','phone')[_0x35d6('0x73')](_0x35d6('0x74'),_0x35d6('0x6f'))['field']('id','ContactId')[_0x35d6('0x73')](_0x575fbc[_0x35d6('0x75')][_0x35d6('0x76')](),'ListId')[_0x35d6('0x73')](_0x5c7e85['params']['id']['toString'](),_0x35d6('0x5b'))['field'](_0x35d6('0x74'),_0x35d6('0x57'))['field']('NOW()',_0x35d6('0x58'))[_0x35d6('0x77')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x35d6('0x3f')]('ListId\x20=\x20?',_0x575fbc[_0x35d6('0x75')][_0x35d6('0x76')]())[_0x35d6('0x3f')](_0x35d6('0x78'))[_0x35d6('0x3f')](_0x35d6('0x79'),squel[_0x35d6('0x72')]()[_0x35d6('0x73')](_0x35d6('0x7a'))[_0x35d6('0x77')](_0x35d6('0x7b'))[_0x35d6('0x3f')]('CampaignId\x20=\x20?',_0x5c7e85[_0x35d6('0x55')]['id'][_0x35d6('0x76')]()))[_0x35d6('0x3f')](_0x35d6('0x79'),squel[_0x35d6('0x72')]()[_0x35d6('0x73')](_0x35d6('0x7c'))[_0x35d6('0x77')](_0x35d6('0x6d'))[_0x35d6('0x3f')](_0x35d6('0x7d'),_0x5c7e85[_0x35d6('0x55')]['id'][_0x35d6('0x76')]())))[_0x35d6('0x76')]();break;case'onlyIfOpen':_0x18b14a=squel[_0x35d6('0x6b')]()[_0x35d6('0x6c')]('cm_hopper')[_0x35d6('0x7e')]([_0x35d6('0x6e'),_0x35d6('0x6f'),_0x35d6('0x70'),_0x35d6('0x71'),'CampaignId',_0x35d6('0x57'),'updatedAt'],squel[_0x35d6('0x72')]()[_0x35d6('0x73')](_0x35d6('0x6e'),_0x35d6('0x6e'))['field']('NOW()',_0x35d6('0x6f'))[_0x35d6('0x73')]('id','ContactId')[_0x35d6('0x73')](_0x575fbc[_0x35d6('0x75')][_0x35d6('0x76')](),_0x35d6('0x71'))[_0x35d6('0x73')](_0x5c7e85[_0x35d6('0x55')]['id'][_0x35d6('0x76')](),_0x35d6('0x5b'))[_0x35d6('0x73')](_0x35d6('0x74'),_0x35d6('0x57'))['field']('NOW()','updatedAt')['from'](_0x35d6('0x7f'))[_0x35d6('0x3f')](_0x35d6('0x80'))[_0x35d6('0x3f')](_0x35d6('0x81'),_0x575fbc[_0x35d6('0x75')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x35d6('0x72')]()[_0x35d6('0x73')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x35d6('0x3f')](_0x35d6('0x7d'),_0x5c7e85[_0x35d6('0x55')]['id'][_0x35d6('0x76')]())))[_0x35d6('0x76')]();break;default:_0x18b14a=squel['insert']()[_0x35d6('0x6c')](_0x35d6('0x6d'))[_0x35d6('0x7e')]([_0x35d6('0x6e'),_0x35d6('0x6f'),_0x35d6('0x70'),_0x35d6('0x71'),_0x35d6('0x5b'),_0x35d6('0x57'),_0x35d6('0x58')],squel[_0x35d6('0x72')]()[_0x35d6('0x73')](_0x35d6('0x6e'),_0x35d6('0x6e'))['field'](_0x35d6('0x74'),_0x35d6('0x6f'))[_0x35d6('0x73')]('id',_0x35d6('0x70'))[_0x35d6('0x73')](_0x575fbc[_0x35d6('0x75')][_0x35d6('0x76')](),_0x35d6('0x71'))[_0x35d6('0x73')](_0x5c7e85[_0x35d6('0x55')]['id'][_0x35d6('0x76')](),_0x35d6('0x5b'))['field'](_0x35d6('0x74'),'createdAt')[_0x35d6('0x73')](_0x35d6('0x74'),_0x35d6('0x58'))[_0x35d6('0x77')](_0x35d6('0x7f'))[_0x35d6('0x3f')](_0x35d6('0x80'))[_0x35d6('0x3f')]('ListId\x20=\x20?',_0x575fbc[_0x35d6('0x75')][_0x35d6('0x76')]())[_0x35d6('0x3f')](_0x35d6('0x78')))['toString']();}_0x4687fd['push'](db[_0x35d6('0x82')]['query'](_0x18b14a));}return BPromise['all'](_0x4687fd);}})[_0x35d6('0x24')](function(){return _0x421a35;})[_0x35d6('0x24')](respondWithResult(_0x4b78ab,null))[_0x35d6('0x45')](handleError(_0x4b78ab,null));};exports[_0x35d6('0x83')]=function(_0x1defda,_0x28d411,_0x346f80){return db['Campaign']['find']({'where':{'id':_0x1defda[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x28d411,null))[_0x35d6('0x24')](function(_0x2ed7d){if(_0x2ed7d){return _0x2ed7d[_0x35d6('0x83')](_0x1defda[_0x35d6('0x34')][_0x35d6('0x67')]);}})['then'](function(_0x1c975d){if(_0x1c975d){return db[_0x35d6('0x5c')]['destroy']({'where':{'ListId':_0x1defda[_0x35d6('0x34')][_0x35d6('0x67')],'CampaignId':_0x1defda[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](function(){return _0x1c975d;});}})[_0x35d6('0x24')](respondWithStatusCode(_0x28d411,null))[_0x35d6('0x45')](handleError(_0x28d411,null));};exports['getBlackLists']=function(_0x16dd4f,_0x3eb1a5,_0xbff1b5){var _0x4aa8a5={};var _0x167371={};var _0x1edb07;var _0x400539;return db[_0x35d6('0x30')][_0x35d6('0x5a')]({'where':{'id':_0x16dd4f[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x3eb1a5,null))['then'](function(_0xef905f){if(_0xef905f){_0x1edb07=_0xef905f;_0x167371['model']=_['keys'](db[_0x35d6('0x64')]['rawAttributes']);_0x167371[_0x35d6('0x34')]=_[_0x35d6('0x46')](_0x16dd4f[_0x35d6('0x34')]);_0x167371[_0x35d6('0x35')]=_[_0x35d6('0x47')](_0x167371[_0x35d6('0x36')],_0x167371[_0x35d6('0x34')]);_0x4aa8a5['attributes']=_['intersection'](_0x167371[_0x35d6('0x36')],qs[_0x35d6('0x38')](_0x16dd4f[_0x35d6('0x34')]['fields']));_0x4aa8a5[_0x35d6('0x37')]=_0x4aa8a5[_0x35d6('0x37')]['length']?_0x4aa8a5[_0x35d6('0x37')]:_0x167371[_0x35d6('0x36')];_0x4aa8a5['order']=qs[_0x35d6('0x3d')](_0x16dd4f[_0x35d6('0x34')][_0x35d6('0x3d')]);_0x4aa8a5['where']=qs['filters'](_[_0x35d6('0x3e')](_0x16dd4f['query'],_0x167371[_0x35d6('0x35')]));if(_0x16dd4f[_0x35d6('0x34')][_0x35d6('0x41')]){_0x4aa8a5[_0x35d6('0x3f')]=_[_0x35d6('0x48')](_0x4aa8a5['where'],{'$or':_[_0x35d6('0x2f')](_0x4aa8a5[_0x35d6('0x37')],function(_0x4a852b){var _0x2fdacb={};_0x2fdacb[_0x4a852b]={'$like':'%'+_0x16dd4f['query'][_0x35d6('0x41')]+'%'};return _0x2fdacb;})});}_0x4aa8a5=_[_0x35d6('0x48')]({},_0x4aa8a5,_0x16dd4f[_0x35d6('0x49')]);return _0x1edb07[_0x35d6('0x84')](_0x4aa8a5);}})[_0x35d6('0x24')](function(_0xa1fa70){if(_0xa1fa70){_0x400539=_0xa1fa70['length'];if(!_0x16dd4f[_0x35d6('0x34')][_0x35d6('0x3a')](_0x35d6('0x3b'))){_0x4aa8a5['limit']=qs['limit'](_0x16dd4f[_0x35d6('0x34')]['limit']);_0x4aa8a5['offset']=qs[_0x35d6('0x1b')](_0x16dd4f[_0x35d6('0x34')][_0x35d6('0x1b')]);}return _0x1edb07[_0x35d6('0x84')](_0x4aa8a5);}})[_0x35d6('0x24')](function(_0x300b87){if(_0x300b87){return _0x300b87?{'count':_0x400539,'rows':_0x300b87}:null;}})[_0x35d6('0x24')](respondWithResult(_0x3eb1a5,null))[_0x35d6('0x45')](handleError(_0x3eb1a5,null));};exports[_0x35d6('0x85')]=function(_0x1fd317,_0x2faaf1,_0x219d68){var _0x50d4ac,_0x3f4f40;return db[_0x35d6('0x30')]['find']({'where':{'id':_0x1fd317[_0x35d6('0x55')]['id']}})[_0x35d6('0x24')](handleEntityNotFound(_0x2faaf1,null))[_0x35d6('0x24')](function(_0x5127df){if(_0x5127df){_0x3f4f40=_0x5127df;return _0x5127df[_0x35d6('0x85')](_0x1fd317[_0x35d6('0x4c')][_0x35d6('0x67')],_[_0x35d6('0x56')](_0x1fd317['body'],['ids','id'])||{});}return null;})['spread'](function(_0x4664d1){var _0x4cab66;_0x50d4ac=_0x4664d1||[];var _0x11c489=[];if(_0x4664d1){for(var _0x2e02c7=0x0;_0x2e02c7<_0x4664d1['length'];_0x2e02c7+=0x1){var _0x22ce1f=_0x4664d1[_0x2e02c7][_0x35d6('0x26')]({'plain':!![]});_0x4cab66=squel['insert']()[_0x35d6('0x6c')](_0x35d6('0x86'))['fromQuery'](['phone',_0x35d6('0x70'),_0x35d6('0x71'),_0x35d6('0x5b'),_0x35d6('0x57'),_0x35d6('0x58')],squel[_0x35d6('0x72')]()[_0x35d6('0x73')]('phone','phone')[_0x35d6('0x73')]('id',_0x35d6('0x70'))[_0x35d6('0x73')](_0x22ce1f[_0x35d6('0x75')][_0x35d6('0x76')](),_0x35d6('0x71'))['field'](_0x1fd317[_0x35d6('0x55')]['id'][_0x35d6('0x76')](),_0x35d6('0x5b'))[_0x35d6('0x73')](_0x35d6('0x74'),_0x35d6('0x57'))[_0x35d6('0x73')](_0x35d6('0x74'),_0x35d6('0x58'))[_0x35d6('0x77')](_0x35d6('0x7f'))[_0x35d6('0x3f')](_0x35d6('0x80'))[_0x35d6('0x3f')](_0x35d6('0x81'),_0x22ce1f['CmListId']['toString']())['where'](_0x35d6('0x78')))[_0x35d6('0x76')]();_0x11c489['push'](db[_0x35d6('0x82')]['query'](_0x4cab66));}return BPromise[_0x35d6('0x87')](_0x11c489);}})[_0x35d6('0x24')](function(){return _0x50d4ac;})['then'](respondWithResult(_0x2faaf1,null))[_0x35d6('0x45')](handleError(_0x2faaf1,null));};exports['removeBlackLists']=function(_0x373749,_0x57b975,_0x16edf2){return db[_0x35d6('0x30')][_0x35d6('0x4a')]({'where':{'id':_0x373749[_0x35d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x57b975,null))['then'](function(_0x3a34c9){if(_0x3a34c9){return _0x3a34c9['removeBlackLists'](_0x373749[_0x35d6('0x34')]['ids']);}})[_0x35d6('0x24')](function(_0x5f0f1d){if(_0x5f0f1d){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x373749['query'][_0x35d6('0x67')],'CampaignId':_0x373749['params']['id']}})[_0x35d6('0x24')](function(){return _0x5f0f1d;});}})[_0x35d6('0x24')](respondWithStatusCode(_0x57b975,null))[_0x35d6('0x45')](handleError(_0x57b975,null));}; \ No newline at end of file +var _0xed49=['CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','Campaign','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','nolimit','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x1f28e4,_0x5ae9b1){var _0x3b9251=function(_0x2dd1bc){while(--_0x2dd1bc){_0x1f28e4['push'](_0x1f28e4['shift']());}};_0x3b9251(++_0x5ae9b1);}(_0xed49,0x11b));var _0x9ed4=function(_0x20af56,_0x2d97af){_0x20af56=_0x20af56-0x0;var _0x3277cc=_0xed49[_0x20af56];return _0x3277cc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9ed4('0x0'));var jsonpatch=require(_0x9ed4('0x1'));var rp=require('request-promise');var moment=require(_0x9ed4('0x2'));var BPromise=require(_0x9ed4('0x3'));var Mustache=require(_0x9ed4('0x4'));var util=require(_0x9ed4('0x5'));var path=require(_0x9ed4('0x6'));var sox=require('sox');var csv=require(_0x9ed4('0x7'));var ejs=require(_0x9ed4('0x8'));var fs=require('fs');var fs_extra=require(_0x9ed4('0x9'));var _=require('lodash');var squel=require(_0x9ed4('0xa'));var crypto=require(_0x9ed4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9ed4('0xc'));var toCsv=require(_0x9ed4('0x7'));var querystring=require(_0x9ed4('0xd'));var Papa=require(_0x9ed4('0xe'));var Redis=require(_0x9ed4('0xf'));var authService=require(_0x9ed4('0x10'));var qs=require(_0x9ed4('0x11'));var as=require(_0x9ed4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ed4('0x13'))(_0x9ed4('0x14'));var utils=require(_0x9ed4('0x15'));var config=require(_0x9ed4('0x16'));var licenseUtil=require(_0x9ed4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10cd16,_0xee0d29){_0xee0d29=_0xee0d29||0xcc;return function(_0x319a56){if(_0x319a56){return _0x10cd16['sendStatus'](_0xee0d29);}return _0x10cd16[_0x9ed4('0x18')](_0xee0d29)[_0x9ed4('0x19')]();};}function respondWithResult(_0x2339ad,_0x13f5b3){_0x13f5b3=_0x13f5b3||0xc8;return function(_0x2fabd5){if(_0x2fabd5){return _0x2339ad[_0x9ed4('0x18')](_0x13f5b3)[_0x9ed4('0x1a')](_0x2fabd5);}};}function respondWithFilteredResult(_0x3e2e87,_0x3995b5){return function(_0x412651){if(_0x412651){var _0x53a668=typeof _0x3995b5[_0x9ed4('0x1b')]===_0x9ed4('0x1c')&&typeof _0x3995b5[_0x9ed4('0x1d')]===_0x9ed4('0x1c');var _0x49d8c0=_0x412651[_0x9ed4('0x1e')];var _0x189b96=_0x53a668?0x0:_0x3995b5[_0x9ed4('0x1b')];var _0x49f3bd=_0x53a668?_0x412651[_0x9ed4('0x1e')]:_0x3995b5[_0x9ed4('0x1b')]+_0x3995b5[_0x9ed4('0x1d')];var _0x2a6e0a;if(_0x49f3bd>=_0x49d8c0){_0x49f3bd=_0x49d8c0;_0x2a6e0a=0xc8;}else{_0x2a6e0a=0xce;}_0x3e2e87['status'](_0x2a6e0a);return _0x3e2e87['set'](_0x9ed4('0x1f'),_0x189b96+'-'+_0x49f3bd+'/'+_0x49d8c0)[_0x9ed4('0x1a')](_0x412651);}return null;};}function patchUpdates(_0x5e815c){return function(_0x2ae3d4){try{jsonpatch[_0x9ed4('0x20')](_0x2ae3d4,_0x5e815c,!![]);}catch(_0x3e7f03){return BPromise['reject'](_0x3e7f03);}return _0x2ae3d4[_0x9ed4('0x21')]();};}function saveUpdates(_0x411755,_0x4a4ae1){return function(_0x901734){if(_0x901734){return _0x901734['update'](_0x411755)[_0x9ed4('0x22')](function(_0x30689e){return _0x30689e;});}return null;};}function removeEntity(_0xb1a7ec,_0xcddd0f){return function(_0xea20bd){if(_0xea20bd){return _0xea20bd[_0x9ed4('0x23')]()[_0x9ed4('0x22')](function(){var _0x33c92a=_0xea20bd[_0x9ed4('0x24')]({'plain':!![]});var _0x132e24=_0x9ed4('0x25');return db[_0x9ed4('0x26')][_0x9ed4('0x23')]({'where':{'type':_0x132e24,'resourceId':_0x33c92a['id']}})['then'](function(){return _0xea20bd;});})[_0x9ed4('0x22')](function(){_0xb1a7ec[_0x9ed4('0x18')](0xcc)[_0x9ed4('0x19')]();});}};}function handleEntityNotFound(_0x42a08d,_0x163252){return function(_0x546223){if(!_0x546223){_0x42a08d[_0x9ed4('0x27')](0x194);}return _0x546223;};}function handleError(_0x2b872d,_0x16b3c4){_0x16b3c4=_0x16b3c4||0x1f4;return function(_0x520437){logger[_0x9ed4('0x28')](_0x520437[_0x9ed4('0x29')]);if(_0x520437[_0x9ed4('0x2a')]){delete _0x520437[_0x9ed4('0x2a')];}_0x2b872d[_0x9ed4('0x18')](_0x16b3c4)['send'](_0x520437);};}exports[_0x9ed4('0x2b')]=function(_0x35558f,_0x3bbd07){var _0x2d1a3d={},_0x468c76={},_0x5a3ee1={'count':0x0,'rows':[]};var _0x6de1e0=_[_0x9ed4('0x2c')](db['Campaign'][_0x9ed4('0x2d')],function(_0x739827){return{'name':_0x739827[_0x9ed4('0x2e')],'type':_0x739827[_0x9ed4('0x2f')]['key']};});_0x468c76[_0x9ed4('0x30')]=_[_0x9ed4('0x2c')](_0x6de1e0,_0x9ed4('0x2a'));_0x468c76['query']=_[_0x9ed4('0x31')](_0x35558f[_0x9ed4('0x32')]);_0x468c76[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x468c76[_0x9ed4('0x30')],_0x468c76[_0x9ed4('0x32')]);_0x2d1a3d['attributes']=_[_0x9ed4('0x34')](_0x468c76[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x35558f[_0x9ed4('0x32')][_0x9ed4('0x35')]));_0x2d1a3d['attributes']=_0x2d1a3d[_0x9ed4('0x36')]['length']?_0x2d1a3d['attributes']:_0x468c76[_0x9ed4('0x30')];if(!_0x35558f[_0x9ed4('0x32')][_0x9ed4('0x37')]('nolimit')){_0x2d1a3d['limit']=qs[_0x9ed4('0x1d')](_0x35558f['query']['limit']);_0x2d1a3d['offset']=qs[_0x9ed4('0x1b')](_0x35558f['query'][_0x9ed4('0x1b')]);}_0x2d1a3d[_0x9ed4('0x38')]=qs['sort'](_0x35558f[_0x9ed4('0x32')][_0x9ed4('0x39')]);_0x2d1a3d['where']=qs[_0x9ed4('0x33')](_['pick'](_0x35558f[_0x9ed4('0x32')],_0x468c76[_0x9ed4('0x33')]),_0x6de1e0);if(_0x35558f[_0x9ed4('0x32')]['filter']){_0x2d1a3d['where']=_['merge'](_0x2d1a3d[_0x9ed4('0x3a')],{'$or':_['map'](_0x6de1e0,function(_0xa2d2e3){if(_0xa2d2e3[_0x9ed4('0x2f')]!=='VIRTUAL'){var _0x54209a={};_0x54209a[_0xa2d2e3[_0x9ed4('0x2a')]]={'$like':'%'+_0x35558f[_0x9ed4('0x32')][_0x9ed4('0x3b')]+'%'};return _0x54209a;}})});}_0x2d1a3d=_[_0x9ed4('0x3c')]({},_0x2d1a3d,_0x35558f['options']);var _0x50d4e0={'where':_0x2d1a3d[_0x9ed4('0x3a')]};return db[_0x9ed4('0x3d')][_0x9ed4('0x1e')](_0x50d4e0)[_0x9ed4('0x22')](function(_0x47a221){_0x5a3ee1[_0x9ed4('0x1e')]=_0x47a221;if(_0x35558f[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0x2d1a3d[_0x9ed4('0x3f')]=[{'all':!![]}];}return db[_0x9ed4('0x3d')][_0x9ed4('0x40')](_0x2d1a3d);})[_0x9ed4('0x22')](function(_0x979590){_0x5a3ee1[_0x9ed4('0x41')]=_0x979590;return _0x5a3ee1;})[_0x9ed4('0x22')](respondWithFilteredResult(_0x3bbd07,_0x2d1a3d))[_0x9ed4('0x42')](handleError(_0x3bbd07,null));};exports[_0x9ed4('0x43')]=function(_0x2c76a6,_0x43de90){var _0x53661e={'raw':![],'where':{'id':_0x2c76a6[_0x9ed4('0x44')]['id']}},_0x25ae77={};_0x25ae77[_0x9ed4('0x30')]=_[_0x9ed4('0x31')](db[_0x9ed4('0x3d')][_0x9ed4('0x2d')]);_0x25ae77[_0x9ed4('0x32')]=_[_0x9ed4('0x31')](_0x2c76a6[_0x9ed4('0x32')]);_0x25ae77[_0x9ed4('0x33')]=_['intersection'](_0x25ae77[_0x9ed4('0x30')],_0x25ae77[_0x9ed4('0x32')]);_0x53661e[_0x9ed4('0x36')]=_[_0x9ed4('0x34')](_0x25ae77['model'],qs['fields'](_0x2c76a6['query'][_0x9ed4('0x35')]));_0x53661e['attributes']=_0x53661e[_0x9ed4('0x36')][_0x9ed4('0x45')]?_0x53661e[_0x9ed4('0x36')]:_0x25ae77[_0x9ed4('0x30')];if(_0x2c76a6[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0x53661e['include']=[{'all':!![]}];}_0x53661e=_['merge']({},_0x53661e,_0x2c76a6[_0x9ed4('0x46')]);return db[_0x9ed4('0x3d')][_0x9ed4('0x47')](_0x53661e)['then'](handleEntityNotFound(_0x43de90,null))[_0x9ed4('0x22')](respondWithResult(_0x43de90,null))[_0x9ed4('0x42')](handleError(_0x43de90,null));};exports['create']=function(_0x314e6e,_0x426517){return db[_0x9ed4('0x3d')]['create'](_0x314e6e[_0x9ed4('0x48')],{})[_0x9ed4('0x22')](function(_0xe1f4f2){var _0x56e8f7=_0x314e6e[_0x9ed4('0x49')][_0x9ed4('0x24')]({'plain':!![]});if(!_0x56e8f7)throw new Error(_0x9ed4('0x4a'));if(_0x56e8f7[_0x9ed4('0x4b')]==='user'){var _0x40c4a6=_0xe1f4f2['get']({'plain':!![]});var _0x1858e0=_0x9ed4('0x25');return db[_0x9ed4('0x4c')]['find']({'where':{'name':_0x1858e0,'userProfileId':_0x56e8f7[_0x9ed4('0x4d')]},'raw':!![]})['then'](function(_0x33dd6d){if(_0x33dd6d&&_0x33dd6d[_0x9ed4('0x4e')]===0x0){return db[_0x9ed4('0x26')][_0x9ed4('0x4f')]({'name':_0x40c4a6[_0x9ed4('0x2a')],'resourceId':_0x40c4a6['id'],'type':_0x33dd6d[_0x9ed4('0x2a')],'sectionId':_0x33dd6d['id']},{})[_0x9ed4('0x22')](function(){return _0xe1f4f2;});}else{return _0xe1f4f2;}})[_0x9ed4('0x42')](function(_0x5f1140){logger[_0x9ed4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f1140);throw _0x5f1140;});}return _0xe1f4f2;})[_0x9ed4('0x22')](respondWithResult(_0x426517,0xc9))[_0x9ed4('0x42')](handleError(_0x426517,null));};exports[_0x9ed4('0x50')]=function(_0x1d59f9,_0x1ef1e3){var _0x510d0b={'where':{'id':_0x1d59f9['params']['id']}},_0x323afc={};_0x323afc[_0x9ed4('0x30')]=_[_0x9ed4('0x31')](db[_0x9ed4('0x3d')][_0x9ed4('0x2d')]);_0x510d0b['attributes']=_['intersection'](_0x323afc[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x1d59f9[_0x9ed4('0x32')]['fields']));_0x510d0b[_0x9ed4('0x36')]=_0x510d0b[_0x9ed4('0x36')][_0x9ed4('0x45')]?_0x510d0b['attributes']:_0x323afc[_0x9ed4('0x30')];if(_0x1d59f9[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0x510d0b[_0x9ed4('0x3f')]=[{'all':!![]}];}_0x510d0b=_[_0x9ed4('0x3c')]({},_0x510d0b,_0x1d59f9[_0x9ed4('0x46')]);return db['Campaign'][_0x9ed4('0x47')](_0x510d0b)['then'](handleEntityNotFound(_0x1ef1e3,null))[_0x9ed4('0x22')](function(_0x3f3cdb){if(_0x3f3cdb){var _0x10bfea=_0x3f3cdb[_0x9ed4('0x24')]({'plain':!![]});_0x10bfea=qs[_0x9ed4('0x51')](_0x10bfea,['id',_0x9ed4('0x52'),_0x9ed4('0x53')]);_0x1d59f9[_0x9ed4('0x48')]=_[_0x9ed4('0x51')](_0x1d59f9[_0x9ed4('0x48')],['id','createdAt','updatedAt']);return db[_0x9ed4('0x3d')]['create'](_[_0x9ed4('0x3c')](_0x10bfea,_0x1d59f9[_0x9ed4('0x48')]),{'include':_0x1d59f9[_0x9ed4('0x32')][_0x9ed4('0x3e')]?[{'all':!![]}]:undefined})[_0x9ed4('0x22')](function(_0x2892c0){var _0x22cd57=_0x1d59f9['user'][_0x9ed4('0x24')]({'plain':!![]});if(!_0x22cd57)throw new Error(_0x9ed4('0x4a'));if(_0x22cd57['role']===_0x9ed4('0x49')){var _0x50c4d9=_0x2892c0[_0x9ed4('0x24')]({'plain':!![]});var _0x20f257=_0x9ed4('0x25');return db[_0x9ed4('0x4c')][_0x9ed4('0x47')]({'where':{'name':_0x20f257,'userProfileId':_0x22cd57[_0x9ed4('0x4d')]},'raw':!![]})['then'](function(_0x25b44f){if(_0x25b44f&&_0x25b44f[_0x9ed4('0x4e')]===0x0){return db[_0x9ed4('0x26')]['create']({'name':_0x50c4d9[_0x9ed4('0x2a')],'resourceId':_0x50c4d9['id'],'type':_0x25b44f[_0x9ed4('0x2a')],'sectionId':_0x25b44f['id']},{})['then'](function(){return _0x2892c0;});}else{return _0x2892c0;}})[_0x9ed4('0x42')](function(_0x402c85){logger[_0x9ed4('0x28')](_0x9ed4('0x54'),_0x402c85);throw _0x402c85;});}return _0x2892c0;});}})['then'](respondWithResult(_0x1ef1e3,0xc9))[_0x9ed4('0x42')](handleError(_0x1ef1e3,null));};exports[_0x9ed4('0x55')]=function(_0x4d1b9b,_0x37476a){if(_0x4d1b9b[_0x9ed4('0x48')]['id']){delete _0x4d1b9b[_0x9ed4('0x48')]['id'];}return db['Campaign'][_0x9ed4('0x47')]({'where':{'id':_0x4d1b9b['params']['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x37476a,null))[_0x9ed4('0x22')](saveUpdates(_0x4d1b9b['body'],null))[_0x9ed4('0x22')](respondWithResult(_0x37476a,null))[_0x9ed4('0x42')](handleError(_0x37476a,null));};exports[_0x9ed4('0x23')]=function(_0x5075d2,_0x4b743d){return db[_0x9ed4('0x3d')][_0x9ed4('0x47')]({'where':{'id':_0x5075d2['params']['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x4b743d,null))[_0x9ed4('0x22')](removeEntity(_0x4b743d,null))[_0x9ed4('0x42')](handleError(_0x4b743d,null));};exports[_0x9ed4('0x56')]=function(_0x44dabe,_0x1a15a0,_0x5e73fd){var _0xcb1767={'raw':!![],'where':{}};var _0x383e4a={};var _0x32bfd6={'count':0x0,'rows':[]};return db[_0x9ed4('0x3d')]['findOne']({'where':{'id':_0x44dabe[_0x9ed4('0x44')]['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x1a15a0,null))['then'](function(_0x2b4c9b){if(_0x2b4c9b){_0x383e4a[_0x9ed4('0x30')]=_[_0x9ed4('0x31')](db['CmHopper']['rawAttributes']);_0x383e4a[_0x9ed4('0x32')]=_[_0x9ed4('0x31')](_0x44dabe[_0x9ed4('0x32')]);_0x383e4a[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x383e4a[_0x9ed4('0x30')],_0x383e4a[_0x9ed4('0x32')]);_0xcb1767[_0x9ed4('0x36')]=_[_0x9ed4('0x34')](_0x383e4a[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x44dabe[_0x9ed4('0x32')]['fields']));_0xcb1767[_0x9ed4('0x36')]=_0xcb1767[_0x9ed4('0x36')][_0x9ed4('0x45')]?_0xcb1767[_0x9ed4('0x36')]:_0x383e4a[_0x9ed4('0x30')];if(!_0x44dabe[_0x9ed4('0x32')]['hasOwnProperty'](_0x9ed4('0x57'))){_0xcb1767['limit']=qs['limit'](_0x44dabe[_0x9ed4('0x32')][_0x9ed4('0x1d')]);_0xcb1767[_0x9ed4('0x1b')]=qs['offset'](_0x44dabe[_0x9ed4('0x32')][_0x9ed4('0x1b')]);}_0xcb1767['order']=qs[_0x9ed4('0x39')](_0x44dabe[_0x9ed4('0x32')]['sort']);_0xcb1767[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_[_0x9ed4('0x58')](_0x44dabe[_0x9ed4('0x32')],_0x383e4a[_0x9ed4('0x33')]));_0xcb1767[_0x9ed4('0x3a')][_0x9ed4('0x59')]=_0x2b4c9b['id'];if(_0x44dabe[_0x9ed4('0x32')][_0x9ed4('0x3b')]){_0xcb1767[_0x9ed4('0x3a')]=_[_0x9ed4('0x3c')](_0xcb1767[_0x9ed4('0x3a')],{'$or':_['map'](_0xcb1767[_0x9ed4('0x36')],function(_0x57aaa7){var _0xfb4a26={};_0xfb4a26[_0x57aaa7]={'$like':'%'+_0x44dabe['query'][_0x9ed4('0x3b')]+'%'};return _0xfb4a26;})});}_0xcb1767=_['merge']({},_0xcb1767,_0x44dabe[_0x9ed4('0x46')]);return db[_0x9ed4('0x5a')][_0x9ed4('0x1e')]({'where':_0xcb1767['where']})['then'](function(_0x326558){_0x32bfd6['count']=_0x326558;if(_0x44dabe[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0xcb1767[_0x9ed4('0x3f')]=[{'all':!![]}];}return db[_0x9ed4('0x5a')]['findAll'](_0xcb1767);})[_0x9ed4('0x22')](function(_0x5c6460){_0x32bfd6['rows']=_0x5c6460;return _0x32bfd6;});}})['then'](respondWithFilteredResult(_0x1a15a0,_0xcb1767))[_0x9ed4('0x42')](handleError(_0x1a15a0,null));};exports[_0x9ed4('0x5b')]=function(_0x158291,_0x1ce82e,_0x6c6ad3){var _0x4594ab={'raw':!![],'where':{}};var _0x3c3b6a={};var _0x34809e={'count':0x0,'rows':[]};return db[_0x9ed4('0x3d')]['findOne']({'where':{'id':_0x158291[_0x9ed4('0x44')]['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x1ce82e,null))['then'](function(_0x110f3b){if(_0x110f3b){_0x3c3b6a[_0x9ed4('0x30')]=_[_0x9ed4('0x31')](db[_0x9ed4('0x5c')][_0x9ed4('0x2d')]);_0x3c3b6a['query']=_[_0x9ed4('0x31')](_0x158291[_0x9ed4('0x32')]);_0x3c3b6a[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x3c3b6a[_0x9ed4('0x30')],_0x3c3b6a[_0x9ed4('0x32')]);_0x4594ab[_0x9ed4('0x36')]=_[_0x9ed4('0x34')](_0x3c3b6a[_0x9ed4('0x30')],qs['fields'](_0x158291[_0x9ed4('0x32')][_0x9ed4('0x35')]));_0x4594ab[_0x9ed4('0x36')]=_0x4594ab[_0x9ed4('0x36')][_0x9ed4('0x45')]?_0x4594ab[_0x9ed4('0x36')]:_0x3c3b6a[_0x9ed4('0x30')];if(!_0x158291[_0x9ed4('0x32')][_0x9ed4('0x37')](_0x9ed4('0x57'))){_0x4594ab[_0x9ed4('0x1d')]=qs[_0x9ed4('0x1d')](_0x158291[_0x9ed4('0x32')]['limit']);_0x4594ab[_0x9ed4('0x1b')]=qs['offset'](_0x158291[_0x9ed4('0x32')]['offset']);}_0x4594ab[_0x9ed4('0x38')]=qs[_0x9ed4('0x39')](_0x158291[_0x9ed4('0x32')][_0x9ed4('0x39')]);_0x4594ab[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_['pick'](_0x158291[_0x9ed4('0x32')],_0x3c3b6a[_0x9ed4('0x33')]));_0x4594ab[_0x9ed4('0x3a')]['CampaignId']=_0x110f3b['id'];if(_0x158291[_0x9ed4('0x32')]['filter']){_0x4594ab[_0x9ed4('0x3a')]=_[_0x9ed4('0x3c')](_0x4594ab[_0x9ed4('0x3a')],{'$or':_[_0x9ed4('0x2c')](_0x4594ab[_0x9ed4('0x36')],function(_0xc69872){var _0x2cc1f0={};_0x2cc1f0[_0xc69872]={'$like':'%'+_0x158291[_0x9ed4('0x32')][_0x9ed4('0x3b')]+'%'};return _0x2cc1f0;})});}_0x4594ab=_['merge']({},_0x4594ab,_0x158291[_0x9ed4('0x46')]);return db[_0x9ed4('0x5c')][_0x9ed4('0x1e')]({'where':_0x4594ab[_0x9ed4('0x3a')]})[_0x9ed4('0x22')](function(_0x2d5a71){_0x34809e[_0x9ed4('0x1e')]=_0x2d5a71;if(_0x158291[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0x4594ab[_0x9ed4('0x3f')]=[{'all':!![]}];}return db[_0x9ed4('0x5c')][_0x9ed4('0x40')](_0x4594ab);})[_0x9ed4('0x22')](function(_0x3e68c7){_0x34809e[_0x9ed4('0x41')]=_0x3e68c7;return _0x34809e;});}})[_0x9ed4('0x22')](respondWithFilteredResult(_0x1ce82e,_0x4594ab))[_0x9ed4('0x42')](handleError(_0x1ce82e,null));};exports[_0x9ed4('0x5d')]=function(_0x10163d,_0x17bc65,_0x3da513){var _0x2bcdf2={'raw':!![],'where':{}};var _0x4e4959={};var _0x21aa8f={'count':0x0,'rows':[]};return db[_0x9ed4('0x3d')][_0x9ed4('0x5e')]({'where':{'id':_0x10163d[_0x9ed4('0x44')]['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x17bc65,null))['then'](function(_0x32cb06){if(_0x32cb06){_0x4e4959[_0x9ed4('0x30')]=_[_0x9ed4('0x31')](db[_0x9ed4('0x5f')]['rawAttributes']);_0x4e4959['query']=_['keys'](_0x10163d['query']);_0x4e4959[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x4e4959['model'],_0x4e4959[_0x9ed4('0x32')]);_0x2bcdf2['attributes']=_[_0x9ed4('0x34')](_0x4e4959['model'],qs[_0x9ed4('0x35')](_0x10163d['query']['fields']));_0x2bcdf2['attributes']=_0x2bcdf2[_0x9ed4('0x36')][_0x9ed4('0x45')]?_0x2bcdf2[_0x9ed4('0x36')]:_0x4e4959[_0x9ed4('0x30')];if(!_0x10163d['query'][_0x9ed4('0x37')](_0x9ed4('0x57'))){_0x2bcdf2['limit']=qs[_0x9ed4('0x1d')](_0x10163d['query']['limit']);_0x2bcdf2['offset']=qs[_0x9ed4('0x1b')](_0x10163d[_0x9ed4('0x32')][_0x9ed4('0x1b')]);}_0x2bcdf2['order']=qs[_0x9ed4('0x39')](_0x10163d['query'][_0x9ed4('0x39')]);_0x2bcdf2[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_[_0x9ed4('0x58')](_0x10163d[_0x9ed4('0x32')],_0x4e4959[_0x9ed4('0x33')]));_0x2bcdf2[_0x9ed4('0x3a')][_0x9ed4('0x59')]=_0x32cb06['id'];if(_0x10163d['query']['filter']){_0x2bcdf2[_0x9ed4('0x3a')]=_['merge'](_0x2bcdf2[_0x9ed4('0x3a')],{'$or':_['map'](_0x2bcdf2[_0x9ed4('0x36')],function(_0x31f766){var _0x27434b={};_0x27434b[_0x31f766]={'$like':'%'+_0x10163d['query']['filter']+'%'};return _0x27434b;})});}_0x2bcdf2=_[_0x9ed4('0x3c')]({},_0x2bcdf2,_0x10163d[_0x9ed4('0x46')]);return db[_0x9ed4('0x5f')][_0x9ed4('0x1e')]({'where':_0x2bcdf2[_0x9ed4('0x3a')]})[_0x9ed4('0x22')](function(_0x2afc49){_0x21aa8f[_0x9ed4('0x1e')]=_0x2afc49;if(_0x10163d['query']['includeAll']){_0x2bcdf2[_0x9ed4('0x3f')]=[{'all':!![]}];}return db[_0x9ed4('0x5f')][_0x9ed4('0x40')](_0x2bcdf2);})['then'](function(_0x4c6cdb){_0x21aa8f[_0x9ed4('0x41')]=_0x4c6cdb;return _0x21aa8f;});}})[_0x9ed4('0x22')](respondWithFilteredResult(_0x17bc65,_0x2bcdf2))['catch'](handleError(_0x17bc65,null));};exports[_0x9ed4('0x60')]=function(_0x2e55f8,_0x361900,_0x10216f){var _0x4d10c7={'raw':!![],'where':{}};var _0x2d37a7={};var _0x542a3d={'count':0x0,'rows':[]};return db[_0x9ed4('0x3d')][_0x9ed4('0x5e')]({'where':{'id':_0x2e55f8['params']['id']}})['then'](handleEntityNotFound(_0x361900,null))['then'](function(_0x42bd4a){if(_0x42bd4a){_0x2d37a7['model']=_[_0x9ed4('0x31')](db['CmHopperBlack'][_0x9ed4('0x2d')]);_0x2d37a7['query']=_[_0x9ed4('0x31')](_0x2e55f8[_0x9ed4('0x32')]);_0x2d37a7[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x2d37a7[_0x9ed4('0x30')],_0x2d37a7['query']);_0x4d10c7[_0x9ed4('0x36')]=_[_0x9ed4('0x34')](_0x2d37a7[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x2e55f8[_0x9ed4('0x32')]['fields']));_0x4d10c7['attributes']=_0x4d10c7[_0x9ed4('0x36')]['length']?_0x4d10c7[_0x9ed4('0x36')]:_0x2d37a7[_0x9ed4('0x30')];if(!_0x2e55f8[_0x9ed4('0x32')][_0x9ed4('0x37')](_0x9ed4('0x57'))){_0x4d10c7[_0x9ed4('0x1d')]=qs[_0x9ed4('0x1d')](_0x2e55f8[_0x9ed4('0x32')][_0x9ed4('0x1d')]);_0x4d10c7[_0x9ed4('0x1b')]=qs['offset'](_0x2e55f8[_0x9ed4('0x32')]['offset']);}_0x4d10c7[_0x9ed4('0x38')]=qs[_0x9ed4('0x39')](_0x2e55f8['query']['sort']);_0x4d10c7[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_[_0x9ed4('0x58')](_0x2e55f8[_0x9ed4('0x32')],_0x2d37a7[_0x9ed4('0x33')]));_0x4d10c7[_0x9ed4('0x3a')][_0x9ed4('0x59')]=_0x42bd4a['id'];if(_0x2e55f8[_0x9ed4('0x32')][_0x9ed4('0x3b')]){_0x4d10c7[_0x9ed4('0x3a')]=_[_0x9ed4('0x3c')](_0x4d10c7[_0x9ed4('0x3a')],{'$or':_[_0x9ed4('0x2c')](_0x4d10c7[_0x9ed4('0x36')],function(_0x8bb6ea){var _0x14e689={};_0x14e689[_0x8bb6ea]={'$like':'%'+_0x2e55f8['query'][_0x9ed4('0x3b')]+'%'};return _0x14e689;})});}_0x4d10c7=_['merge']({},_0x4d10c7,_0x2e55f8[_0x9ed4('0x46')]);return db[_0x9ed4('0x61')][_0x9ed4('0x1e')]({'where':_0x4d10c7[_0x9ed4('0x3a')]})[_0x9ed4('0x22')](function(_0x1df336){_0x542a3d['count']=_0x1df336;if(_0x2e55f8[_0x9ed4('0x32')][_0x9ed4('0x3e')]){_0x4d10c7['include']=[{'all':!![]}];}return db[_0x9ed4('0x61')]['findAll'](_0x4d10c7);})[_0x9ed4('0x22')](function(_0x35d2fe){_0x542a3d[_0x9ed4('0x41')]=_0x35d2fe;return _0x542a3d;});}})[_0x9ed4('0x22')](respondWithFilteredResult(_0x361900,_0x4d10c7))[_0x9ed4('0x42')](handleError(_0x361900,null));};exports[_0x9ed4('0x62')]=function(_0x32a181,_0x508ed3,_0x4bce16){var _0x332105={};var _0xbcb02c={};var _0xda0a25;var _0x2f44be;return db[_0x9ed4('0x3d')]['findOne']({'where':{'id':_0x32a181['params']['id']}})['then'](handleEntityNotFound(_0x508ed3,null))[_0x9ed4('0x22')](function(_0x155467){if(_0x155467){_0xda0a25=_0x155467;_0xbcb02c[_0x9ed4('0x30')]=_['keys'](db[_0x9ed4('0x63')][_0x9ed4('0x2d')]);_0xbcb02c[_0x9ed4('0x32')]=_['keys'](_0x32a181[_0x9ed4('0x32')]);_0xbcb02c[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0xbcb02c['model'],_0xbcb02c['query']);_0x332105['attributes']=_[_0x9ed4('0x34')](_0xbcb02c[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x32a181[_0x9ed4('0x32')]['fields']));_0x332105[_0x9ed4('0x36')]=_0x332105['attributes'][_0x9ed4('0x45')]?_0x332105[_0x9ed4('0x36')]:_0xbcb02c['model'];_0x332105[_0x9ed4('0x38')]=qs[_0x9ed4('0x39')](_0x32a181[_0x9ed4('0x32')][_0x9ed4('0x39')]);_0x332105[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_['pick'](_0x32a181[_0x9ed4('0x32')],_0xbcb02c['filters']));if(_0x32a181[_0x9ed4('0x32')]['filter']){_0x332105['where']=_['merge'](_0x332105[_0x9ed4('0x3a')],{'$or':_['map'](_0x332105[_0x9ed4('0x36')],function(_0x38efab){var _0x13531f={};_0x13531f[_0x38efab]={'$like':'%'+_0x32a181[_0x9ed4('0x32')][_0x9ed4('0x3b')]+'%'};return _0x13531f;})});}_0x332105=_[_0x9ed4('0x3c')]({},_0x332105,_0x32a181[_0x9ed4('0x46')]);return _0xda0a25['getLists'](_0x332105);}})[_0x9ed4('0x22')](function(_0x1a1a1b){if(_0x1a1a1b){_0x2f44be=_0x1a1a1b[_0x9ed4('0x45')];if(!_0x32a181['query'][_0x9ed4('0x37')](_0x9ed4('0x57'))){_0x332105[_0x9ed4('0x1d')]=qs['limit'](_0x32a181[_0x9ed4('0x32')][_0x9ed4('0x1d')]);_0x332105[_0x9ed4('0x1b')]=qs[_0x9ed4('0x1b')](_0x32a181[_0x9ed4('0x32')][_0x9ed4('0x1b')]);}return _0xda0a25['getLists'](_0x332105);}})[_0x9ed4('0x22')](function(_0x36740e){if(_0x36740e){return _0x36740e?{'count':_0x2f44be,'rows':_0x36740e}:null;}})['then'](respondWithResult(_0x508ed3,null))[_0x9ed4('0x42')](handleError(_0x508ed3,null));};exports[_0x9ed4('0x64')]=function(_0x448636,_0x320d54,_0xdca409){var _0x1bf66a,_0x196e31;return db[_0x9ed4('0x3d')]['find']({'where':{'id':_0x448636['params']['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x320d54,null))[_0x9ed4('0x22')](function(_0x371910){if(_0x371910){_0x196e31=_0x371910;return _0x371910[_0x9ed4('0x64')](_0x448636[_0x9ed4('0x48')][_0x9ed4('0x65')],_[_0x9ed4('0x51')](_0x448636[_0x9ed4('0x48')],[_0x9ed4('0x65'),'id'])||{});}return null;})['spread'](function(_0x26340f){var _0xebf41b;_0x1bf66a=_0x26340f||[];var _0x3c55e5=[];if(_0x26340f){for(var _0x223d74=0x0;_0x223d74<_0x26340f[_0x9ed4('0x45')];_0x223d74+=0x1){var _0x179689=_0x26340f[_0x223d74][_0x9ed4('0x24')]({'plain':!![]});_0x196e31[_0x9ed4('0x66')]=_0x448636['body'][_0x9ed4('0x66')]?_0x448636[_0x9ed4('0x48')][_0x9ed4('0x66')]:_0x196e31['dialCheckDuplicateType'];switch(_0x196e31[_0x9ed4('0x66')]){case _0x9ed4('0x67'):_0xebf41b=squel[_0x9ed4('0x68')]()[_0x9ed4('0x69')](_0x9ed4('0x6a'))[_0x9ed4('0x6b')]([_0x9ed4('0x6c'),_0x9ed4('0x6d'),'ContactId',_0x9ed4('0x6e'),_0x9ed4('0x59'),'createdAt',_0x9ed4('0x53')],squel[_0x9ed4('0x6f')]()[_0x9ed4('0x70')](_0x9ed4('0x6c'),_0x9ed4('0x6c'))['field']('NOW()',_0x9ed4('0x6d'))[_0x9ed4('0x70')]('id',_0x9ed4('0x71'))[_0x9ed4('0x70')](_0x179689[_0x9ed4('0x72')][_0x9ed4('0x73')](),'ListId')[_0x9ed4('0x70')](_0x448636[_0x9ed4('0x44')]['id'][_0x9ed4('0x73')](),_0x9ed4('0x59'))[_0x9ed4('0x70')](_0x9ed4('0x74'),_0x9ed4('0x52'))[_0x9ed4('0x70')](_0x9ed4('0x74'),_0x9ed4('0x53'))[_0x9ed4('0x75')](_0x9ed4('0x76'))[_0x9ed4('0x3a')](_0x9ed4('0x77'))['where'](_0x9ed4('0x78'),_0x179689[_0x9ed4('0x72')]['toString']())[_0x9ed4('0x3a')](_0x9ed4('0x79'))[_0x9ed4('0x3a')](_0x9ed4('0x7a'),squel[_0x9ed4('0x6f')]()[_0x9ed4('0x70')](_0x9ed4('0x7b'))['from'](_0x9ed4('0x7c'))[_0x9ed4('0x3a')](_0x9ed4('0x7d'),_0x448636[_0x9ed4('0x44')]['id'][_0x9ed4('0x73')]()))[_0x9ed4('0x3a')](_0x9ed4('0x7a'),squel[_0x9ed4('0x6f')]()['field'](_0x9ed4('0x7e'))[_0x9ed4('0x75')](_0x9ed4('0x6a'))[_0x9ed4('0x3a')](_0x9ed4('0x7d'),_0x448636[_0x9ed4('0x44')]['id'][_0x9ed4('0x73')]())))[_0x9ed4('0x73')]();break;case _0x9ed4('0x7f'):_0xebf41b=squel['insert']()[_0x9ed4('0x69')](_0x9ed4('0x6a'))[_0x9ed4('0x6b')]([_0x9ed4('0x6c'),_0x9ed4('0x6d'),_0x9ed4('0x71'),_0x9ed4('0x6e'),'CampaignId',_0x9ed4('0x52'),_0x9ed4('0x53')],squel[_0x9ed4('0x6f')]()[_0x9ed4('0x70')](_0x9ed4('0x6c'),_0x9ed4('0x6c'))[_0x9ed4('0x70')](_0x9ed4('0x74'),_0x9ed4('0x6d'))[_0x9ed4('0x70')]('id',_0x9ed4('0x71'))[_0x9ed4('0x70')](_0x179689['CmListId'][_0x9ed4('0x73')](),'ListId')[_0x9ed4('0x70')](_0x448636[_0x9ed4('0x44')]['id'][_0x9ed4('0x73')](),'CampaignId')[_0x9ed4('0x70')]('NOW()',_0x9ed4('0x52'))['field'](_0x9ed4('0x74'),_0x9ed4('0x53'))[_0x9ed4('0x75')](_0x9ed4('0x76'))[_0x9ed4('0x3a')](_0x9ed4('0x77'))['where'](_0x9ed4('0x78'),_0x179689[_0x9ed4('0x72')][_0x9ed4('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9ed4('0x70')](_0x9ed4('0x7e'))['from'](_0x9ed4('0x6a'))[_0x9ed4('0x3a')]('CampaignId\x20=\x20?',_0x448636[_0x9ed4('0x44')]['id']['toString']())))[_0x9ed4('0x73')]();break;default:_0xebf41b=squel['insert']()[_0x9ed4('0x69')](_0x9ed4('0x6a'))[_0x9ed4('0x6b')](['phone',_0x9ed4('0x6d'),'ContactId',_0x9ed4('0x6e'),_0x9ed4('0x59'),'createdAt',_0x9ed4('0x53')],squel['select']()['field']('phone','phone')[_0x9ed4('0x70')](_0x9ed4('0x74'),_0x9ed4('0x6d'))[_0x9ed4('0x70')]('id',_0x9ed4('0x71'))['field'](_0x179689[_0x9ed4('0x72')][_0x9ed4('0x73')](),_0x9ed4('0x6e'))['field'](_0x448636['params']['id']['toString'](),_0x9ed4('0x59'))[_0x9ed4('0x70')]('NOW()',_0x9ed4('0x52'))[_0x9ed4('0x70')](_0x9ed4('0x74'),_0x9ed4('0x53'))[_0x9ed4('0x75')](_0x9ed4('0x76'))['where'](_0x9ed4('0x77'))[_0x9ed4('0x3a')](_0x9ed4('0x78'),_0x179689[_0x9ed4('0x72')][_0x9ed4('0x73')]())['where'](_0x9ed4('0x79')))[_0x9ed4('0x73')]();}_0x3c55e5['push'](db[_0x9ed4('0x80')]['query'](_0xebf41b));}return BPromise[_0x9ed4('0x81')](_0x3c55e5);}})[_0x9ed4('0x22')](function(){return _0x1bf66a;})[_0x9ed4('0x22')](respondWithResult(_0x320d54,null))['catch'](handleError(_0x320d54,null));};exports[_0x9ed4('0x82')]=function(_0x1c7604,_0x136d9a,_0x135e2a){return db[_0x9ed4('0x3d')]['find']({'where':{'id':_0x1c7604['params']['id']}})['then'](handleEntityNotFound(_0x136d9a,null))['then'](function(_0x4850b9){if(_0x4850b9){return _0x4850b9[_0x9ed4('0x82')](_0x1c7604['query'][_0x9ed4('0x65')]);}})[_0x9ed4('0x22')](function(_0x34fd45){if(_0x34fd45){return db[_0x9ed4('0x5a')][_0x9ed4('0x23')]({'where':{'ListId':_0x1c7604[_0x9ed4('0x32')][_0x9ed4('0x65')],'CampaignId':_0x1c7604[_0x9ed4('0x44')]['id']}})['then'](function(){return _0x34fd45;});}})[_0x9ed4('0x22')](respondWithStatusCode(_0x136d9a,null))['catch'](handleError(_0x136d9a,null));};exports[_0x9ed4('0x83')]=function(_0x53cfc7,_0x2fec7b,_0x752b17){var _0x3919dd={};var _0x3a108d={};var _0x3ad663;var _0x1eb535;return db[_0x9ed4('0x3d')][_0x9ed4('0x5e')]({'where':{'id':_0x53cfc7[_0x9ed4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fec7b,null))[_0x9ed4('0x22')](function(_0x145ffe){if(_0x145ffe){_0x3ad663=_0x145ffe;_0x3a108d[_0x9ed4('0x30')]=_['keys'](db[_0x9ed4('0x63')][_0x9ed4('0x2d')]);_0x3a108d[_0x9ed4('0x32')]=_[_0x9ed4('0x31')](_0x53cfc7['query']);_0x3a108d[_0x9ed4('0x33')]=_[_0x9ed4('0x34')](_0x3a108d[_0x9ed4('0x30')],_0x3a108d[_0x9ed4('0x32')]);_0x3919dd[_0x9ed4('0x36')]=_['intersection'](_0x3a108d[_0x9ed4('0x30')],qs[_0x9ed4('0x35')](_0x53cfc7['query'][_0x9ed4('0x35')]));_0x3919dd[_0x9ed4('0x36')]=_0x3919dd['attributes']['length']?_0x3919dd['attributes']:_0x3a108d[_0x9ed4('0x30')];_0x3919dd[_0x9ed4('0x38')]=qs[_0x9ed4('0x39')](_0x53cfc7[_0x9ed4('0x32')][_0x9ed4('0x39')]);_0x3919dd[_0x9ed4('0x3a')]=qs[_0x9ed4('0x33')](_[_0x9ed4('0x58')](_0x53cfc7[_0x9ed4('0x32')],_0x3a108d['filters']));if(_0x53cfc7[_0x9ed4('0x32')]['filter']){_0x3919dd[_0x9ed4('0x3a')]=_['merge'](_0x3919dd['where'],{'$or':_['map'](_0x3919dd[_0x9ed4('0x36')],function(_0x201524){var _0x246b7f={};_0x246b7f[_0x201524]={'$like':'%'+_0x53cfc7[_0x9ed4('0x32')][_0x9ed4('0x3b')]+'%'};return _0x246b7f;})});}_0x3919dd=_[_0x9ed4('0x3c')]({},_0x3919dd,_0x53cfc7['options']);return _0x3ad663[_0x9ed4('0x83')](_0x3919dd);}})[_0x9ed4('0x22')](function(_0x1e10d7){if(_0x1e10d7){_0x1eb535=_0x1e10d7['length'];if(!_0x53cfc7[_0x9ed4('0x32')][_0x9ed4('0x37')]('nolimit')){_0x3919dd['limit']=qs[_0x9ed4('0x1d')](_0x53cfc7[_0x9ed4('0x32')][_0x9ed4('0x1d')]);_0x3919dd['offset']=qs[_0x9ed4('0x1b')](_0x53cfc7[_0x9ed4('0x32')][_0x9ed4('0x1b')]);}return _0x3ad663[_0x9ed4('0x83')](_0x3919dd);}})['then'](function(_0x2adad9){if(_0x2adad9){return _0x2adad9?{'count':_0x1eb535,'rows':_0x2adad9}:null;}})[_0x9ed4('0x22')](respondWithResult(_0x2fec7b,null))['catch'](handleError(_0x2fec7b,null));};exports[_0x9ed4('0x84')]=function(_0x27b1e6,_0x802a2f,_0x4a1872){var _0x4b580e,_0x542e0a;return db[_0x9ed4('0x3d')][_0x9ed4('0x47')]({'where':{'id':_0x27b1e6[_0x9ed4('0x44')]['id']}})['then'](handleEntityNotFound(_0x802a2f,null))[_0x9ed4('0x22')](function(_0x513e18){if(_0x513e18){_0x542e0a=_0x513e18;return _0x513e18[_0x9ed4('0x84')](_0x27b1e6[_0x9ed4('0x48')][_0x9ed4('0x65')],_[_0x9ed4('0x51')](_0x27b1e6[_0x9ed4('0x48')],[_0x9ed4('0x65'),'id'])||{});}return null;})['spread'](function(_0x1b70e8){var _0xae113b;_0x4b580e=_0x1b70e8||[];var _0x3134d4=[];if(_0x1b70e8){for(var _0x419393=0x0;_0x419393<_0x1b70e8[_0x9ed4('0x45')];_0x419393+=0x1){var _0xde735f=_0x1b70e8[_0x419393]['get']({'plain':!![]});_0xae113b=squel[_0x9ed4('0x68')]()[_0x9ed4('0x69')](_0x9ed4('0x85'))[_0x9ed4('0x6b')](['phone',_0x9ed4('0x71'),_0x9ed4('0x6e'),'CampaignId',_0x9ed4('0x52'),'updatedAt'],squel['select']()[_0x9ed4('0x70')](_0x9ed4('0x6c'),_0x9ed4('0x6c'))[_0x9ed4('0x70')]('id',_0x9ed4('0x71'))[_0x9ed4('0x70')](_0xde735f[_0x9ed4('0x72')]['toString'](),'ListId')[_0x9ed4('0x70')](_0x27b1e6[_0x9ed4('0x44')]['id'][_0x9ed4('0x73')](),'CampaignId')[_0x9ed4('0x70')]('NOW()','createdAt')['field']('NOW()',_0x9ed4('0x53'))['from'](_0x9ed4('0x76'))[_0x9ed4('0x3a')](_0x9ed4('0x77'))[_0x9ed4('0x3a')](_0x9ed4('0x78'),_0xde735f[_0x9ed4('0x72')][_0x9ed4('0x73')]())[_0x9ed4('0x3a')](_0x9ed4('0x79')))[_0x9ed4('0x73')]();_0x3134d4[_0x9ed4('0x86')](db[_0x9ed4('0x80')][_0x9ed4('0x32')](_0xae113b));}return BPromise[_0x9ed4('0x81')](_0x3134d4);}})[_0x9ed4('0x22')](function(){return _0x4b580e;})[_0x9ed4('0x22')](respondWithResult(_0x802a2f,null))[_0x9ed4('0x42')](handleError(_0x802a2f,null));};exports['removeBlackLists']=function(_0x281254,_0x5c7696,_0xdcdee5){return db[_0x9ed4('0x3d')][_0x9ed4('0x47')]({'where':{'id':_0x281254[_0x9ed4('0x44')]['id']}})[_0x9ed4('0x22')](handleEntityNotFound(_0x5c7696,null))[_0x9ed4('0x22')](function(_0x36f3fb){if(_0x36f3fb){return _0x36f3fb[_0x9ed4('0x87')](_0x281254[_0x9ed4('0x32')][_0x9ed4('0x65')]);}})[_0x9ed4('0x22')](function(_0x466164){if(_0x466164){return db[_0x9ed4('0x61')][_0x9ed4('0x23')]({'where':{'ListId':_0x281254[_0x9ed4('0x32')][_0x9ed4('0x65')],'CampaignId':_0x281254[_0x9ed4('0x44')]['id']}})[_0x9ed4('0x22')](function(){return _0x466164;});}})[_0x9ed4('0x22')](respondWithStatusCode(_0x5c7696,null))[_0x9ed4('0x42')](handleError(_0x5c7696,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6e56022..1bce77b 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(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4f7a8a,_0x590072){var _0x356fdc=function(_0x4d8d34){while(--_0x4d8d34){_0x4f7a8a['push'](_0x4f7a8a['shift']());}};_0x356fdc(++_0x590072);}(_0x7a54,0x106));var _0x47a5=function(_0x78df20,_0x5a2c55){_0x78df20=_0x78df20-0x0;var _0x44b8d2=_0x7a54[_0x78df20];return _0x44b8d2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index be9b40a..7effc28 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 _0xbe02=['then','stringify','error','code','Campaign,\x20%s,\x20%s','message','request\x20sent','catch','GetCampaign','Campaign','findAll','options','raw','limit','include','map','model','attributes','info','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x43ff6a,_0x47f558){var _0x2781b6=function(_0x48081f){while(--_0x48081f){_0x43ff6a['push'](_0x43ff6a['shift']());}};_0x2781b6(++_0x47f558);}(_0xbe02,0x146));var _0x2be0=function(_0x5d0f69,_0xf4a45){_0x5d0f69=_0x5d0f69-0x0;var _0x8a6beb=_0xbe02[_0x5d0f69];return _0x8a6beb;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2be0('0x4'));var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson[_0x2be0('0xb')][_0x2be0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e872c,_0x4ca22f,_0x176f12){return new BPromise(function(_0xdfef68,_0x1ac0a3){return client[_0x2be0('0xd')](_0x4e872c,_0x176f12)[_0x2be0('0xe')](function(_0x45d9f5){logger['info']('Campaign,\x20%s,\x20%s',_0x4ca22f,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4ca22f,'request\x20sent',JSON[_0x2be0('0xf')](_0x45d9f5));if(_0x45d9f5[_0x2be0('0x10')]){if(_0x45d9f5['error'][_0x2be0('0x11')]===0x1f4){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);return _0x1ac0a3(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x45d9f5[_0x2be0('0x10')]['message']);return _0xdfef68(_0x45d9f5[_0x2be0('0x10')][_0x2be0('0x13')]);}else{logger['info'](_0x2be0('0x12'),_0x4ca22f,_0x2be0('0x14'));_0xdfef68(_0x45d9f5['result'][_0x2be0('0x13')]);}})[_0x2be0('0x15')](function(_0x137ce9){logger[_0x2be0('0x10')](_0x2be0('0x12'),_0x4ca22f,_0x137ce9);_0x1ac0a3(_0x137ce9);});});}exports[_0x2be0('0x16')]=function(_0x48d386){var _0x415894=this;return new Promise(function(_0x3f8dba,_0x35da90){return db[_0x2be0('0x17')][_0x2be0('0x18')]({'raw':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1a')]===undefined?!![]:![]:!![],'where':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')]['where']||null:null,'attributes':_0x48d386['options']?_0x48d386[_0x2be0('0x19')]['attributes']||null:null,'limit':_0x48d386['options']?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1b')]||null:null,'include':_0x48d386[_0x2be0('0x19')]?_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x48d386[_0x2be0('0x19')][_0x2be0('0x1c')],function(_0x494fb4){return{'model':db[_0x494fb4[_0x2be0('0x1e')]],'as':_0x494fb4['as'],'attributes':_0x494fb4['attributes'],'include':_0x494fb4['include']?_[_0x2be0('0x1d')](_0x494fb4[_0x2be0('0x1c')],function(_0x166aa1){return{'model':db[_0x166aa1[_0x2be0('0x1e')]],'as':_0x166aa1['as'],'attributes':_0x166aa1[_0x2be0('0x1f')],'include':_0x166aa1[_0x2be0('0x1c')]?_[_0x2be0('0x1d')](_0x166aa1['include'],function(_0x1c24be){return{'model':db[_0x1c24be[_0x2be0('0x1e')]],'as':_0x1c24be['as'],'attributes':_0x1c24be['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd3eb){logger[_0x2be0('0x20')]('GetCampaign',_0x48d386);logger[_0x2be0('0x21')](_0x2be0('0x16'),_0x48d386,JSON[_0x2be0('0xf')](_0x1fd3eb));_0x3f8dba(_0x1fd3eb);})[_0x2be0('0x15')](function(_0x3b97c0){logger[_0x2be0('0x10')](_0x2be0('0x16'),_0x3b97c0['message'],_0x48d386);_0x35da90(_0x415894[_0x2be0('0x10')](0x1f4,_0x3b97c0['message']));});});}; \ No newline at end of file +var _0xd84b=['request','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x1c0c09,_0x1d6d19){var _0x336769=function(_0xd83366){while(--_0xd83366){_0x1c0c09['push'](_0x1c0c09['shift']());}};_0x336769(++_0x1d6d19);}(_0xd84b,0x177));var _0xbd84=function(_0x5bd4b5,_0xf4b03f){_0x5bd4b5=_0x5bd4b5-0x0;var _0x3f236e=_0xd84b[_0x5bd4b5];return _0x3f236e;};'use strict';var _=require('lodash');var util=require(_0xbd84('0x0'));var moment=require(_0xbd84('0x1'));var BPromise=require(_0xbd84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd84('0x3'))['db'];var utils=require(_0xbd84('0x4'));var logger=require(_0xbd84('0x5'))(_0xbd84('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd84('0x7')][_0xbd84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32211a,_0x597a3f,_0x50c325){return new BPromise(function(_0x5008a7,_0x53bdc0){return client[_0xbd84('0x9')](_0x32211a,_0x50c325)['then'](function(_0x55fd4a){logger['info']('Campaign,\x20%s,\x20%s',_0x597a3f,'request\x20sent');logger[_0xbd84('0xa')](_0xbd84('0xb'),_0x597a3f,_0xbd84('0xc'),JSON[_0xbd84('0xd')](_0x55fd4a));if(_0x55fd4a[_0xbd84('0xe')]){if(_0x55fd4a['error'][_0xbd84('0xf')]===0x1f4){logger[_0xbd84('0xe')](_0xbd84('0x10'),_0x597a3f,_0x55fd4a[_0xbd84('0xe')][_0xbd84('0x11')]);return _0x53bdc0(_0x55fd4a['error'][_0xbd84('0x11')]);}logger['error'](_0xbd84('0x10'),_0x597a3f,_0x55fd4a[_0xbd84('0xe')][_0xbd84('0x11')]);return _0x5008a7(_0x55fd4a[_0xbd84('0xe')][_0xbd84('0x11')]);}else{logger[_0xbd84('0x12')]('Campaign,\x20%s,\x20%s',_0x597a3f,_0xbd84('0xc'));_0x5008a7(_0x55fd4a[_0xbd84('0x13')]['message']);}})[_0xbd84('0x14')](function(_0x286bec){logger[_0xbd84('0xe')](_0xbd84('0x10'),_0x597a3f,_0x286bec);_0x53bdc0(_0x286bec);});});}exports[_0xbd84('0x15')]=function(_0x7c4e82){var _0x57c7b2=this;return new Promise(function(_0x3ec509,_0x15c4dd){return db[_0xbd84('0x16')][_0xbd84('0x17')]({'raw':_0x7c4e82['options']?_0x7c4e82[_0xbd84('0x18')][_0xbd84('0x19')]===undefined?!![]:![]:!![],'where':_0x7c4e82[_0xbd84('0x18')]?_0x7c4e82['options'][_0xbd84('0x1a')]||null:null,'attributes':_0x7c4e82[_0xbd84('0x18')]?_0x7c4e82[_0xbd84('0x18')][_0xbd84('0x1b')]||null:null,'limit':_0x7c4e82[_0xbd84('0x18')]?_0x7c4e82['options'][_0xbd84('0x1c')]||null:null,'include':_0x7c4e82[_0xbd84('0x18')]?_0x7c4e82['options']['include']?_[_0xbd84('0x1d')](_0x7c4e82[_0xbd84('0x18')]['include'],function(_0x396923){return{'model':db[_0x396923['model']],'as':_0x396923['as'],'attributes':_0x396923[_0xbd84('0x1b')],'include':_0x396923['include']?_[_0xbd84('0x1d')](_0x396923[_0xbd84('0x1e')],function(_0x2d4a9d){return{'model':db[_0x2d4a9d[_0xbd84('0x1f')]],'as':_0x2d4a9d['as'],'attributes':_0x2d4a9d['attributes'],'include':_0x2d4a9d[_0xbd84('0x1e')]?_[_0xbd84('0x1d')](_0x2d4a9d[_0xbd84('0x1e')],function(_0x148cea){return{'model':db[_0x148cea[_0xbd84('0x1f')]],'as':_0x148cea['as'],'attributes':_0x148cea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb212f2){logger['info'](_0xbd84('0x15'),_0x7c4e82);logger[_0xbd84('0xa')](_0xbd84('0x15'),_0x7c4e82,JSON['stringify'](_0xb212f2));_0x3ec509(_0xb212f2);})[_0xbd84('0x14')](function(_0x55f99f){logger[_0xbd84('0xe')](_0xbd84('0x15'),_0x55f99f[_0xbd84('0x11')],_0x7c4e82);_0x15c4dd(_0x57c7b2['error'](0x1f4,_0x55f99f[_0xbd84('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index bd863ed..6630a9d 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 _0xb708=['index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperFinals','getHopperBlacks','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','destroy','delete','/:id/lists','removeLists','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x52000f,_0x5f5df7){var _0x326981=function(_0x226579){while(--_0x226579){_0x52000f['push'](_0x52000f['shift']());}};_0x326981(++_0x5f5df7);}(_0xb708,0xe7));var _0x8b70=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xb708[_0x2cf2e9];return _0xd3670d;};'use strict';var multer=require(_0x8b70('0x0'));var util=require('util');var path=require(_0x8b70('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b70('0x2'));var router=express[_0x8b70('0x3')]();var fs_extra=require(_0x8b70('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b70('0x5'));var config=require(_0x8b70('0x6'));var controller=require(_0x8b70('0x7'));router['get']('/',auth[_0x8b70('0x8')](),controller[_0x8b70('0x9')]);router['get'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller[_0x8b70('0xb')]);router[_0x8b70('0xc')]('/:id/hoppers',auth[_0x8b70('0x8')](),controller[_0x8b70('0xd')]);router['get'](_0x8b70('0xe'),auth[_0x8b70('0x8')](),controller['getHopperHistories']);router[_0x8b70('0xc')]('/:id/hopper_finals',auth[_0x8b70('0x8')](),controller[_0x8b70('0xf')]);router[_0x8b70('0xc')]('/:id/hopper_black',auth[_0x8b70('0x8')](),controller[_0x8b70('0x10')]);router['get']('/:id/lists',auth[_0x8b70('0x8')](),controller['getLists']);router[_0x8b70('0xc')](_0x8b70('0x11'),auth['isAuthenticated'](),controller[_0x8b70('0x12')]);router[_0x8b70('0x13')]('/',auth[_0x8b70('0x8')](),controller['create']);router['post'](_0x8b70('0x14'),auth['isAuthenticated'](),controller[_0x8b70('0x15')]);router[_0x8b70('0x13')]('/:id/lists',auth[_0x8b70('0x8')](),controller[_0x8b70('0x16')]);router[_0x8b70('0x13')](_0x8b70('0x11'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x8b70('0x17')](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller['update']);router['delete'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller[_0x8b70('0x18')]);router[_0x8b70('0x19')](_0x8b70('0x1a'),auth[_0x8b70('0x8')](),controller[_0x8b70('0x1b')]);router[_0x8b70('0x19')](_0x8b70('0x11'),auth[_0x8b70('0x8')](),controller[_0x8b70('0x1c')]);module[_0x8b70('0x1d')]=router; \ No newline at end of file +var _0x2367=['/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index'];(function(_0x3c7fcf,_0x39dae1){var _0x4c8233=function(_0x21ce7d){while(--_0x21ce7d){_0x3c7fcf['push'](_0x3c7fcf['shift']());}};_0x4c8233(++_0x39dae1);}(_0x2367,0x7f));var _0x7236=function(_0x198f2e,_0x23a169){_0x198f2e=_0x198f2e-0x0;var _0xcc7b49=_0x2367[_0x198f2e];return _0xcc7b49;};'use strict';var multer=require(_0x7236('0x0'));var util=require(_0x7236('0x1'));var path=require(_0x7236('0x2'));var timeout=require('connect-timeout');var express=require(_0x7236('0x3'));var router=express[_0x7236('0x4')]();var fs_extra=require(_0x7236('0x5'));var auth=require(_0x7236('0x6'));var interaction=require(_0x7236('0x7'));var config=require(_0x7236('0x8'));var controller=require(_0x7236('0x9'));router[_0x7236('0xa')]('/',auth[_0x7236('0xb')](),controller[_0x7236('0xc')]);router['get'](_0x7236('0xd'),auth[_0x7236('0xb')](),controller[_0x7236('0xe')]);router[_0x7236('0xa')](_0x7236('0xf'),auth[_0x7236('0xb')](),controller['getHoppers']);router[_0x7236('0xa')](_0x7236('0x10'),auth[_0x7236('0xb')](),controller[_0x7236('0x11')]);router[_0x7236('0xa')]('/:id/hopper_finals',auth[_0x7236('0xb')](),controller['getHopperFinals']);router[_0x7236('0xa')](_0x7236('0x12'),auth[_0x7236('0xb')](),controller[_0x7236('0x13')]);router[_0x7236('0xa')]('/:id/lists',auth[_0x7236('0xb')](),controller[_0x7236('0x14')]);router[_0x7236('0xa')](_0x7236('0x15'),auth[_0x7236('0xb')](),controller['getBlackLists']);router[_0x7236('0x16')]('/',auth[_0x7236('0xb')](),controller[_0x7236('0x17')]);router[_0x7236('0x16')](_0x7236('0x18'),auth[_0x7236('0xb')](),controller[_0x7236('0x19')]);router[_0x7236('0x16')](_0x7236('0x1a'),auth[_0x7236('0xb')](),controller[_0x7236('0x1b')]);router[_0x7236('0x16')]('/:id/blacklists',auth[_0x7236('0xb')](),controller[_0x7236('0x1c')]);router[_0x7236('0x1d')](_0x7236('0xd'),auth['isAuthenticated'](),controller[_0x7236('0x1e')]);router[_0x7236('0x1f')](_0x7236('0xd'),auth['isAuthenticated'](),controller[_0x7236('0x20')]);router[_0x7236('0x1f')](_0x7236('0x1a'),auth['isAuthenticated'](),controller['removeLists']);router[_0x7236('0x1f')](_0x7236('0x15'),auth[_0x7236('0xb')](),controller[_0x7236('0x21')]);module[_0x7236('0x22')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index a26faa7..6e6550e 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 _0x08d6=['sequelize','exports','STRING','TEXT','key'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x08d6,0x154));var _0x608d=function(_0x1a069c,_0x49521a){_0x1a069c=_0x1a069c-0x0;var _0x4475d9=_0x08d6[_0x1a069c];return _0x4475d9;};'use strict';var Sequelize=require(_0x608d('0x0'));module[_0x608d('0x1')]={'key':{'type':Sequelize[_0x608d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x608d('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x608d('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x608d('0x4'));}}}; \ No newline at end of file +var _0x6f16=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0x68c4e3,_0x5b18b0){var _0xaca048=function(_0x485160){while(--_0x485160){_0x68c4e3['push'](_0x68c4e3['shift']());}};_0xaca048(++_0x5b18b0);}(_0x6f16,0x153));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x66f1('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x66f1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x66f1('0x2')]},'name':{'type':Sequelize[_0x66f1('0x3')],'get':function(){return this[_0x66f1('0x4')](_0x66f1('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4460f62..e8ad9b8 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 _0xd523=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','name','eml-format','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','destroy','get','error','stack','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','catch','params','keys','filters','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user'];(function(_0x5c6c2e,_0x86e980){var _0xd262ac=function(_0x2469a1){while(--_0x2469a1){_0x5c6c2e['push'](_0x5c6c2e['shift']());}};_0xd262ac(++_0x86e980);}(_0xd523,0xa0));var _0x3d52=function(_0xfb093c,_0x399b44){_0xfb093c=_0xfb093c-0x0;var _0x5556c4=_0xd523[_0xfb093c];return _0x5556c4;};'use strict';var emlformat=require(_0x3d52('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3d52('0x1'));var rp=require(_0x3d52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3d52('0x3'));var sox=require(_0x3d52('0x4'));var csv=require(_0x3d52('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d52('0x6'));var _=require(_0x3d52('0x7'));var squel=require('squel');var crypto=require(_0x3d52('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3d52('0x9'));var toCsv=require(_0x3d52('0x5'));var querystring=require(_0x3d52('0xa'));var Papa=require(_0x3d52('0xb'));var Redis=require(_0x3d52('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3d52('0xd'));var as=require(_0x3d52('0xe'));var hardwareService=require(_0x3d52('0xf'));var logger=require(_0x3d52('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x3d52('0x11'));var licenseUtil=require(_0x3d52('0x12'));var db=require(_0x3d52('0x13'))['db'];function respondWithStatusCode(_0x15fcb0,_0x8e4834){_0x8e4834=_0x8e4834||0xcc;return function(_0x581d16){if(_0x581d16){return _0x15fcb0[_0x3d52('0x14')](_0x8e4834);}return _0x15fcb0['status'](_0x8e4834)[_0x3d52('0x15')]();};}function respondWithResult(_0xd7cd15,_0x3704b0){_0x3704b0=_0x3704b0||0xc8;return function(_0x51bda2){if(_0x51bda2){return _0xd7cd15['status'](_0x3704b0)[_0x3d52('0x16')](_0x51bda2);}};}function respondWithFilteredResult(_0x3d3930,_0x660a62){return function(_0x3c8c1a){if(_0x3c8c1a){var _0x5bf803=typeof _0x660a62[_0x3d52('0x17')]===_0x3d52('0x18')&&typeof _0x660a62[_0x3d52('0x19')]==='undefined';var _0x25c281=_0x3c8c1a[_0x3d52('0x1a')];var _0x90ded2=_0x5bf803?0x0:_0x660a62[_0x3d52('0x17')];var _0x37fc49=_0x5bf803?_0x3c8c1a['count']:_0x660a62[_0x3d52('0x17')]+_0x660a62[_0x3d52('0x19')];var _0x261947;if(_0x37fc49>=_0x25c281){_0x37fc49=_0x25c281;_0x261947=0xc8;}else{_0x261947=0xce;}_0x3d3930[_0x3d52('0x1b')](_0x261947);return _0x3d3930['set'](_0x3d52('0x1c'),_0x90ded2+'-'+_0x37fc49+'/'+_0x25c281)[_0x3d52('0x16')](_0x3c8c1a);}return null;};}function patchUpdates(_0xce9b97){return function(_0x5d1e74){try{jsonpatch[_0x3d52('0x1d')](_0x5d1e74,_0xce9b97,!![]);}catch(_0x5d07cc){return BPromise['reject'](_0x5d07cc);}return _0x5d1e74[_0x3d52('0x1e')]();};}function saveUpdates(_0x5f22b3,_0x19c005){return function(_0x5b00b2){if(_0x5b00b2){return _0x5b00b2[_0x3d52('0x1f')](_0x5f22b3)[_0x3d52('0x20')](function(_0x415574){return _0x415574;});}return null;};}function removeEntity(_0x13a714,_0x26cc88){return function(_0xde81da){if(_0xde81da){return _0xde81da[_0x3d52('0x21')]()[_0x3d52('0x20')](function(){var _0x3bdc8e=_0xde81da[_0x3d52('0x22')]({'plain':!![]});var _0x132c87='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x132c87,'resourceId':_0x3bdc8e['id']}})[_0x3d52('0x20')](function(){return _0xde81da;});})['then'](function(){_0x13a714['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x606100,_0x1141df){return function(_0x5a900a){if(!_0x5a900a){_0x606100[_0x3d52('0x14')](0x194);}return _0x5a900a;};}function handleError(_0x44d1ac,_0x587881){_0x587881=_0x587881||0x1f4;return function(_0x452658){logger[_0x3d52('0x23')](_0x452658[_0x3d52('0x24')]);if(_0x452658['name']){delete _0x452658['name'];}_0x44d1ac[_0x3d52('0x1b')](_0x587881)['send'](_0x452658);};}exports[_0x3d52('0x25')]=function(_0x30827b,_0x3b4b1f){var _0x10dc9e={},_0x5e4b1d={},_0x160d31={'count':0x0,'rows':[]};var _0x55f23f=_[_0x3d52('0x26')](db[_0x3d52('0x27')][_0x3d52('0x28')],function(_0x4bf25c){return{'name':_0x4bf25c[_0x3d52('0x29')],'type':_0x4bf25c[_0x3d52('0x2a')][_0x3d52('0x2b')]};});_0x5e4b1d[_0x3d52('0x2c')]=_[_0x3d52('0x26')](_0x55f23f,'name');_0x5e4b1d['query']=_['keys'](_0x30827b[_0x3d52('0x2d')]);_0x5e4b1d['filters']=_[_0x3d52('0x2e')](_0x5e4b1d[_0x3d52('0x2c')],_0x5e4b1d[_0x3d52('0x2d')]);_0x10dc9e[_0x3d52('0x2f')]=_[_0x3d52('0x2e')](_0x5e4b1d[_0x3d52('0x2c')],qs[_0x3d52('0x30')](_0x30827b[_0x3d52('0x2d')][_0x3d52('0x30')]));_0x10dc9e[_0x3d52('0x2f')]=_0x10dc9e[_0x3d52('0x2f')][_0x3d52('0x31')]?_0x10dc9e[_0x3d52('0x2f')]:_0x5e4b1d[_0x3d52('0x2c')];if(!_0x30827b[_0x3d52('0x2d')]['hasOwnProperty'](_0x3d52('0x32'))){_0x10dc9e[_0x3d52('0x19')]=qs['limit'](_0x30827b[_0x3d52('0x2d')]['limit']);_0x10dc9e[_0x3d52('0x17')]=qs['offset'](_0x30827b[_0x3d52('0x2d')][_0x3d52('0x17')]);}_0x10dc9e[_0x3d52('0x33')]=qs[_0x3d52('0x34')](_0x30827b[_0x3d52('0x2d')][_0x3d52('0x34')]);_0x10dc9e[_0x3d52('0x35')]=qs['filters'](_[_0x3d52('0x36')](_0x30827b[_0x3d52('0x2d')],_0x5e4b1d['filters']),_0x55f23f);if(_0x30827b[_0x3d52('0x2d')]['filter']){_0x10dc9e[_0x3d52('0x35')]=_[_0x3d52('0x37')](_0x10dc9e[_0x3d52('0x35')],{'$or':[{'key':{'$like':'%'+_0x30827b[_0x3d52('0x2d')]['filter']+'%'}},{'value':{'$like':'%'+_0x30827b[_0x3d52('0x2d')][_0x3d52('0x38')]+'%'}}]});}_0x10dc9e=_[_0x3d52('0x37')]({},_0x10dc9e,_0x30827b['options']);var _0x39293e={'where':_0x10dc9e[_0x3d52('0x35')]};return db[_0x3d52('0x27')][_0x3d52('0x1a')](_0x39293e)[_0x3d52('0x20')](function(_0x5f29ec){_0x160d31[_0x3d52('0x1a')]=_0x5f29ec;if(_0x30827b['query'][_0x3d52('0x39')]){_0x10dc9e[_0x3d52('0x3a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3d52('0x3b')](_0x10dc9e);})[_0x3d52('0x20')](function(_0x36638d){_0x160d31['rows']=_0x36638d;return _0x160d31;})[_0x3d52('0x20')](respondWithFilteredResult(_0x3b4b1f,_0x10dc9e))[_0x3d52('0x3c')](handleError(_0x3b4b1f,null));};exports['show']=function(_0x286ffd,_0x201f05){var _0x4b6c5d={'raw':!![],'where':{'id':_0x286ffd[_0x3d52('0x3d')]['id']}},_0x16a53f={};_0x16a53f[_0x3d52('0x2c')]=_[_0x3d52('0x3e')](db[_0x3d52('0x27')][_0x3d52('0x28')]);_0x16a53f['query']=_[_0x3d52('0x3e')](_0x286ffd['query']);_0x16a53f[_0x3d52('0x3f')]=_[_0x3d52('0x2e')](_0x16a53f[_0x3d52('0x2c')],_0x16a53f[_0x3d52('0x2d')]);_0x4b6c5d[_0x3d52('0x2f')]=_[_0x3d52('0x2e')](_0x16a53f[_0x3d52('0x2c')],qs['fields'](_0x286ffd['query']['fields']));_0x4b6c5d[_0x3d52('0x2f')]=_0x4b6c5d[_0x3d52('0x2f')]['length']?_0x4b6c5d[_0x3d52('0x2f')]:_0x16a53f[_0x3d52('0x2c')];if(_0x286ffd[_0x3d52('0x2d')][_0x3d52('0x39')]){_0x4b6c5d[_0x3d52('0x3a')]=[{'all':!![]}];}_0x4b6c5d=_[_0x3d52('0x37')]({},_0x4b6c5d,_0x286ffd[_0x3d52('0x40')]);return db[_0x3d52('0x27')][_0x3d52('0x41')](_0x4b6c5d)[_0x3d52('0x20')](handleEntityNotFound(_0x201f05,null))[_0x3d52('0x20')](respondWithResult(_0x201f05,null))[_0x3d52('0x3c')](handleError(_0x201f05,null));};exports[_0x3d52('0x1f')]=function(_0x51983e,_0x3bf800){if(_0x51983e['body']['id']){delete _0x51983e[_0x3d52('0x42')]['id'];}return db[_0x3d52('0x27')][_0x3d52('0x41')]({'where':{'id':_0x51983e[_0x3d52('0x3d')]['id']}})[_0x3d52('0x20')](handleEntityNotFound(_0x3bf800,null))[_0x3d52('0x20')](saveUpdates(_0x51983e[_0x3d52('0x42')],null))[_0x3d52('0x20')](respondWithResult(_0x3bf800,null))[_0x3d52('0x3c')](handleError(_0x3bf800,null));};exports['destroy']=function(_0x1d0c91,_0x3bf95f){return db['CannedAnswer'][_0x3d52('0x41')]({'where':{'id':_0x1d0c91['params']['id']}})[_0x3d52('0x20')](handleEntityNotFound(_0x3bf95f,null))[_0x3d52('0x20')](removeEntity(_0x3bf95f,null))[_0x3d52('0x3c')](handleError(_0x3bf95f,null));};exports[_0x3d52('0x43')]=function(_0xd97d18,_0x4f9a90){var _0x53f0f2={'key':_0xd97d18[_0x3d52('0x42')][_0x3d52('0x2b')]};if(_0xd97d18[_0x3d52('0x42')][_0x3d52('0x44')]){_0x53f0f2[_0x3d52('0x44')]=_0xd97d18[_0x3d52('0x42')][_0x3d52('0x44')];}else if(_0xd97d18['body'][_0x3d52('0x45')]){_0x53f0f2[_0x3d52('0x45')]=_0xd97d18['body'][_0x3d52('0x45')];}else if(_0xd97d18[_0x3d52('0x42')][_0x3d52('0x46')]){_0x53f0f2['OpenchannelAccountId']=_0xd97d18[_0x3d52('0x42')]['OpenchannelAccountId'];}else if(_0xd97d18[_0x3d52('0x42')][_0x3d52('0x47')]){_0x53f0f2[_0x3d52('0x47')]=_0xd97d18[_0x3d52('0x42')][_0x3d52('0x47')];}return db[_0x3d52('0x27')][_0x3d52('0x41')]({'where':_0x53f0f2})[_0x3d52('0x20')](function(_0x142d5b){if(_0x142d5b){throw new db['Sequelize']['ValidationError'](_0x3d52('0x48'));}return db[_0x3d52('0x27')][_0x3d52('0x43')](_0xd97d18[_0x3d52('0x42')]);})['then'](function(_0x1951a1){var _0x2dd3fc=_0xd97d18[_0x3d52('0x49')][_0x3d52('0x22')]({'plain':!![]});if(!_0x2dd3fc)throw new Error(_0x3d52('0x4a'));if(_0x2dd3fc['role']===_0x3d52('0x49')){var _0x656e2a=_0x1951a1[_0x3d52('0x22')]({'plain':!![]});return db[_0x3d52('0x4b')][_0x3d52('0x41')]({'where':{'name':'CannedAnswers','userProfileId':_0x2dd3fc['userProfileId']},'raw':!![]})[_0x3d52('0x20')](function(_0x17964f){if(_0x17964f&&_0x17964f['autoAssociation']===0x0){return db[_0x3d52('0x4c')][_0x3d52('0x43')]({'name':_0x656e2a[_0x3d52('0x4d')],'resourceId':_0x656e2a['id'],'type':_0x17964f[_0x3d52('0x4d')],'sectionId':_0x17964f['id']},{})['then'](function(){return _0x1951a1;});}else{return _0x1951a1;}})[_0x3d52('0x3c')](function(_0x3058e9){logger[_0x3d52('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3058e9);throw _0x3058e9;});}return _0x1951a1;})[_0x3d52('0x20')](respondWithResult(_0x4f9a90,0xc9))['catch'](handleError(_0x4f9a90,null));}; \ No newline at end of file +var _0x13f4=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','error','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','params','find','body','create'];(function(_0x505f65,_0x586327){var _0x459478=function(_0x460cc5){while(--_0x460cc5){_0x505f65['push'](_0x505f65['shift']());}};_0x459478(++_0x586327);}(_0x13f4,0x1c6));var _0x413f=function(_0x4b775b,_0x2aadc6){_0x4b775b=_0x4b775b-0x0;var _0xf84d39=_0x13f4[_0x4b775b];return _0xf84d39;};'use strict';var emlformat=require(_0x413f('0x0'));var rimraf=require(_0x413f('0x1'));var zipdir=require(_0x413f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x413f('0x3'));var moment=require('moment');var BPromise=require(_0x413f('0x4'));var Mustache=require('mustache');var util=require(_0x413f('0x5'));var path=require(_0x413f('0x6'));var sox=require(_0x413f('0x7'));var csv=require(_0x413f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x413f('0x9'));var _=require(_0x413f('0xa'));var squel=require(_0x413f('0xb'));var crypto=require('crypto');var jsforce=require(_0x413f('0xc'));var deskjs=require(_0x413f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x413f('0xe'));var Papa=require(_0x413f('0xf'));var Redis=require(_0x413f('0x10'));var authService=require(_0x413f('0x11'));var qs=require(_0x413f('0x12'));var as=require(_0x413f('0x13'));var hardwareService=require(_0x413f('0x14'));var logger=require(_0x413f('0x15'))('api');var utils=require(_0x413f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x413f('0x17'));var db=require(_0x413f('0x18'))['db'];function respondWithStatusCode(_0x52f611,_0x45bf5f){_0x45bf5f=_0x45bf5f||0xcc;return function(_0x1a4d93){if(_0x1a4d93){return _0x52f611[_0x413f('0x19')](_0x45bf5f);}return _0x52f611[_0x413f('0x1a')](_0x45bf5f)[_0x413f('0x1b')]();};}function respondWithResult(_0x2ceaf8,_0x4b2ac6){_0x4b2ac6=_0x4b2ac6||0xc8;return function(_0x515bf5){if(_0x515bf5){return _0x2ceaf8[_0x413f('0x1a')](_0x4b2ac6)[_0x413f('0x1c')](_0x515bf5);}};}function respondWithFilteredResult(_0x5eab2f,_0x11c681){return function(_0x4dd7fc){if(_0x4dd7fc){var _0x2b5859=typeof _0x11c681[_0x413f('0x1d')]===_0x413f('0x1e')&&typeof _0x11c681['limit']===_0x413f('0x1e');var _0x5dbcbb=_0x4dd7fc[_0x413f('0x1f')];var _0x3239fa=_0x2b5859?0x0:_0x11c681['offset'];var _0x177603=_0x2b5859?_0x4dd7fc['count']:_0x11c681[_0x413f('0x1d')]+_0x11c681['limit'];var _0x5ae171;if(_0x177603>=_0x5dbcbb){_0x177603=_0x5dbcbb;_0x5ae171=0xc8;}else{_0x5ae171=0xce;}_0x5eab2f[_0x413f('0x1a')](_0x5ae171);return _0x5eab2f['set'](_0x413f('0x20'),_0x3239fa+'-'+_0x177603+'/'+_0x5dbcbb)['json'](_0x4dd7fc);}return null;};}function patchUpdates(_0x4efd5b){return function(_0x463bfb){try{jsonpatch['apply'](_0x463bfb,_0x4efd5b,!![]);}catch(_0x6ec686){return BPromise[_0x413f('0x21')](_0x6ec686);}return _0x463bfb[_0x413f('0x22')]();};}function saveUpdates(_0x3cc0b0,_0x19fe9c){return function(_0x3ffb7d){if(_0x3ffb7d){return _0x3ffb7d[_0x413f('0x23')](_0x3cc0b0)[_0x413f('0x24')](function(_0x126515){return _0x126515;});}return null;};}function removeEntity(_0x3d6485,_0x5ea7a1){return function(_0x3c593e){if(_0x3c593e){return _0x3c593e[_0x413f('0x25')]()['then'](function(){var _0x43ef02=_0x3c593e[_0x413f('0x26')]({'plain':!![]});var _0x24be91=_0x413f('0x27');return db['UserProfileResource'][_0x413f('0x25')]({'where':{'type':_0x24be91,'resourceId':_0x43ef02['id']}})['then'](function(){return _0x3c593e;});})[_0x413f('0x24')](function(){_0x3d6485['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d575,_0x37caab){return function(_0x4e7fec){if(!_0x4e7fec){_0x55d575['sendStatus'](0x194);}return _0x4e7fec;};}function handleError(_0x296d8c,_0x304210){_0x304210=_0x304210||0x1f4;return function(_0x26205d){logger[_0x413f('0x28')](_0x26205d['stack']);if(_0x26205d[_0x413f('0x29')]){delete _0x26205d[_0x413f('0x29')];}_0x296d8c[_0x413f('0x1a')](_0x304210)['send'](_0x26205d);};}exports[_0x413f('0x2a')]=function(_0x3e68e8,_0x2e8aaa){var _0x4eaaf9={},_0x4e689e={},_0x3a7666={'count':0x0,'rows':[]};var _0x219a46=_['map'](db[_0x413f('0x2b')][_0x413f('0x2c')],function(_0x341fa0){return{'name':_0x341fa0[_0x413f('0x2d')],'type':_0x341fa0[_0x413f('0x2e')][_0x413f('0x2f')]};});_0x4e689e[_0x413f('0x30')]=_[_0x413f('0x31')](_0x219a46,_0x413f('0x29'));_0x4e689e[_0x413f('0x32')]=_[_0x413f('0x33')](_0x3e68e8[_0x413f('0x32')]);_0x4e689e['filters']=_[_0x413f('0x34')](_0x4e689e[_0x413f('0x30')],_0x4e689e['query']);_0x4eaaf9[_0x413f('0x35')]=_[_0x413f('0x34')](_0x4e689e[_0x413f('0x30')],qs[_0x413f('0x36')](_0x3e68e8[_0x413f('0x32')][_0x413f('0x36')]));_0x4eaaf9[_0x413f('0x35')]=_0x4eaaf9['attributes'][_0x413f('0x37')]?_0x4eaaf9['attributes']:_0x4e689e['model'];if(!_0x3e68e8[_0x413f('0x32')][_0x413f('0x38')](_0x413f('0x39'))){_0x4eaaf9[_0x413f('0x3a')]=qs['limit'](_0x3e68e8[_0x413f('0x32')]['limit']);_0x4eaaf9[_0x413f('0x1d')]=qs[_0x413f('0x1d')](_0x3e68e8[_0x413f('0x32')]['offset']);}_0x4eaaf9[_0x413f('0x3b')]=qs[_0x413f('0x3c')](_0x3e68e8[_0x413f('0x32')][_0x413f('0x3c')]);_0x4eaaf9[_0x413f('0x3d')]=qs[_0x413f('0x3e')](_['pick'](_0x3e68e8[_0x413f('0x32')],_0x4e689e['filters']),_0x219a46);if(_0x3e68e8[_0x413f('0x32')][_0x413f('0x3f')]){_0x4eaaf9[_0x413f('0x3d')]=_[_0x413f('0x40')](_0x4eaaf9['where'],{'$or':[{'key':{'$like':'%'+_0x3e68e8[_0x413f('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x3e68e8[_0x413f('0x32')][_0x413f('0x3f')]+'%'}}]});}_0x4eaaf9=_[_0x413f('0x40')]({},_0x4eaaf9,_0x3e68e8[_0x413f('0x41')]);var _0x55f845={'where':_0x4eaaf9[_0x413f('0x3d')]};return db[_0x413f('0x2b')][_0x413f('0x1f')](_0x55f845)[_0x413f('0x24')](function(_0x1ee734){_0x3a7666['count']=_0x1ee734;if(_0x3e68e8[_0x413f('0x32')]['includeAll']){_0x4eaaf9[_0x413f('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x413f('0x43')](_0x4eaaf9);})[_0x413f('0x24')](function(_0x4624bb){_0x3a7666[_0x413f('0x44')]=_0x4624bb;return _0x3a7666;})[_0x413f('0x24')](respondWithFilteredResult(_0x2e8aaa,_0x4eaaf9))[_0x413f('0x45')](handleError(_0x2e8aaa,null));};exports['show']=function(_0x3b1da8,_0x1c1edf){var _0x5e5cce={'raw':!![],'where':{'id':_0x3b1da8[_0x413f('0x46')]['id']}},_0x236ced={};_0x236ced[_0x413f('0x30')]=_[_0x413f('0x33')](db['CannedAnswer'][_0x413f('0x2c')]);_0x236ced[_0x413f('0x32')]=_['keys'](_0x3b1da8[_0x413f('0x32')]);_0x236ced['filters']=_['intersection'](_0x236ced[_0x413f('0x30')],_0x236ced[_0x413f('0x32')]);_0x5e5cce[_0x413f('0x35')]=_[_0x413f('0x34')](_0x236ced['model'],qs['fields'](_0x3b1da8[_0x413f('0x32')][_0x413f('0x36')]));_0x5e5cce[_0x413f('0x35')]=_0x5e5cce[_0x413f('0x35')]['length']?_0x5e5cce[_0x413f('0x35')]:_0x236ced[_0x413f('0x30')];if(_0x3b1da8[_0x413f('0x32')]['includeAll']){_0x5e5cce[_0x413f('0x42')]=[{'all':!![]}];}_0x5e5cce=_[_0x413f('0x40')]({},_0x5e5cce,_0x3b1da8[_0x413f('0x41')]);return db[_0x413f('0x2b')][_0x413f('0x47')](_0x5e5cce)[_0x413f('0x24')](handleEntityNotFound(_0x1c1edf,null))[_0x413f('0x24')](respondWithResult(_0x1c1edf,null))[_0x413f('0x45')](handleError(_0x1c1edf,null));};exports[_0x413f('0x23')]=function(_0x3176a7,_0x1b236a){if(_0x3176a7[_0x413f('0x48')]['id']){delete _0x3176a7[_0x413f('0x48')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x3176a7[_0x413f('0x46')]['id']}})[_0x413f('0x24')](handleEntityNotFound(_0x1b236a,null))['then'](saveUpdates(_0x3176a7['body'],null))['then'](respondWithResult(_0x1b236a,null))[_0x413f('0x45')](handleError(_0x1b236a,null));};exports[_0x413f('0x25')]=function(_0x3fae47,_0x310923){return db['CannedAnswer']['find']({'where':{'id':_0x3fae47[_0x413f('0x46')]['id']}})[_0x413f('0x24')](handleEntityNotFound(_0x310923,null))['then'](removeEntity(_0x310923,null))[_0x413f('0x45')](handleError(_0x310923,null));};exports[_0x413f('0x49')]=function(_0x55f917,_0x52fc1a){var _0x2c8a5a={'key':_0x55f917['body'][_0x413f('0x2f')]};if(_0x55f917['body'][_0x413f('0x4a')]){_0x2c8a5a[_0x413f('0x4a')]=_0x55f917[_0x413f('0x48')][_0x413f('0x4a')];}else if(_0x55f917[_0x413f('0x48')][_0x413f('0x4b')]){_0x2c8a5a['SmsAccountId']=_0x55f917[_0x413f('0x48')][_0x413f('0x4b')];}else if(_0x55f917[_0x413f('0x48')]['OpenchannelAccountId']){_0x2c8a5a[_0x413f('0x4c')]=_0x55f917[_0x413f('0x48')][_0x413f('0x4c')];}else if(_0x55f917['body'][_0x413f('0x4d')]){_0x2c8a5a['ChatWebsiteId']=_0x55f917[_0x413f('0x48')][_0x413f('0x4d')];}return db['CannedAnswer']['find']({'where':_0x2c8a5a})[_0x413f('0x24')](function(_0x3f219d){if(_0x3f219d){throw new db[(_0x413f('0x4e'))][(_0x413f('0x4f'))](_0x413f('0x50'));}return db[_0x413f('0x2b')][_0x413f('0x49')](_0x55f917[_0x413f('0x48')]);})[_0x413f('0x24')](function(_0x57a894){var _0x571d7f=_0x55f917[_0x413f('0x51')][_0x413f('0x26')]({'plain':!![]});if(!_0x571d7f)throw new Error(_0x413f('0x52'));if(_0x571d7f[_0x413f('0x53')]===_0x413f('0x51')){var _0x477ffa=_0x57a894[_0x413f('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x413f('0x47')]({'where':{'name':_0x413f('0x27'),'userProfileId':_0x571d7f[_0x413f('0x54')]},'raw':!![]})[_0x413f('0x24')](function(_0xd6f5e){if(_0xd6f5e&&_0xd6f5e[_0x413f('0x55')]===0x0){return db[_0x413f('0x56')][_0x413f('0x49')]({'name':_0x477ffa['name'],'resourceId':_0x477ffa['id'],'type':_0xd6f5e['name'],'sectionId':_0xd6f5e['id']},{})[_0x413f('0x24')](function(){return _0x57a894;});}else{return _0x57a894;}})[_0x413f('0x45')](function(_0xfa26f8){logger[_0x413f('0x28')](_0x413f('0x57'),_0xfa26f8);throw _0xfa26f8;});}return _0x57a894;})[_0x413f('0x24')](respondWithResult(_0x52fc1a,0xc9))[_0x413f('0x45')](handleError(_0x52fc1a,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 74a2372..9624303 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 _0xce8d=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x195f76,_0xececaf){var _0x1b06dc=function(_0xcd8e7d){while(--_0xcd8e7d){_0x195f76['push'](_0x195f76['shift']());}};_0x1b06dc(++_0xececaf);}(_0xce8d,0x9b));var _0xdce8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdce8('0x0'));var logger=require(_0xdce8('0x1'))(_0xdce8('0x2'));var moment=require(_0xdce8('0x3'));var BPromise=require(_0xdce8('0x4'));var rp=require(_0xdce8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdce8('0x6'));var config=require(_0xdce8('0x7'));var attributes=require(_0xdce8('0x8'));module['exports']=function(_0x3f387b,_0x382ffc){return _0x3f387b[_0xdce8('0x9')](_0xdce8('0xa'),attributes,{'tableName':_0xdce8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdce8('0xc'),'collate':_0xdce8('0xd')});}; \ No newline at end of file +var _0x7a4a=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a4a,0x1c7));var _0xa7a4=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x7a4a[_0x1df7b8];return _0x29d911;};'use strict';var _=require('lodash');var util=require(_0xa7a4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa7a4('0x1'));var BPromise=require(_0xa7a4('0x2'));var rp=require(_0xa7a4('0x3'));var fs=require('fs');var path=require(_0xa7a4('0x4'));var rimraf=require(_0xa7a4('0x5'));var config=require('../../config/environment');var attributes=require(_0xa7a4('0x6'));module['exports']=function(_0x458894,_0xd0b44e){return _0x458894[_0xa7a4('0x7')](_0xa7a4('0x8'),attributes,{'tableName':_0xa7a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa7a4('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 51d8b10..e15b763 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(_0x48999e,_0xa058c5){var _0x557293=function(_0x41ec26){while(--_0x41ec26){_0x48999e['push'](_0x48999e['shift']());}};_0x557293(++_0xa058c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x141046,_0x50590f){var _0x5a7bdf=function(_0x1691f6){while(--_0x1691f6){_0x141046['push'](_0x141046['shift']());}};_0x5a7bdf(++_0x50590f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 cd57480..c99afce 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 _0x3735=['index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x190161,_0x802569){var _0x5868fe=function(_0x429231){while(--_0x429231){_0x190161['push'](_0x190161['shift']());}};_0x5868fe(++_0x802569);}(_0x3735,0x15f));var _0x5373=function(_0x1b81b9,_0x1d314a){_0x1b81b9=_0x1b81b9-0x0;var _0x27a94d=_0x3735[_0x1b81b9];return _0x27a94d;};'use strict';var multer=require(_0x5373('0x0'));var util=require(_0x5373('0x1'));var path=require('path');var timeout=require(_0x5373('0x2'));var express=require(_0x5373('0x3'));var router=express[_0x5373('0x4')]();var fs_extra=require(_0x5373('0x5'));var auth=require(_0x5373('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5373('0x7'));var controller=require('./cannedAnswer.controller');router[_0x5373('0x8')]('/',auth[_0x5373('0x9')](),controller[_0x5373('0xa')]);router[_0x5373('0x8')](_0x5373('0xb'),auth[_0x5373('0x9')](),controller[_0x5373('0xc')]);router[_0x5373('0xd')]('/',auth[_0x5373('0x9')](),controller[_0x5373('0xe')]);router['put'](_0x5373('0xb'),auth[_0x5373('0x9')](),controller[_0x5373('0xf')]);router[_0x5373('0x10')](_0x5373('0xb'),auth[_0x5373('0x9')](),controller[_0x5373('0x11')]);module[_0x5373('0x12')]=router; \ No newline at end of file +var _0xff55=['get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller'];(function(_0x1c90c2,_0x4af1f6){var _0x5edf7c=function(_0x5ac017){while(--_0x5ac017){_0x1c90c2['push'](_0x1c90c2['shift']());}};_0x5edf7c(++_0x4af1f6);}(_0xff55,0x87));var _0x5ff5=function(_0x22ee35,_0x5b1707){_0x22ee35=_0x22ee35-0x0;var _0x59fdf0=_0xff55[_0x22ee35];return _0x59fdf0;};'use strict';var multer=require(_0x5ff5('0x0'));var util=require(_0x5ff5('0x1'));var path=require(_0x5ff5('0x2'));var timeout=require(_0x5ff5('0x3'));var express=require(_0x5ff5('0x4'));var router=express['Router']();var fs_extra=require(_0x5ff5('0x5'));var auth=require(_0x5ff5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5ff5('0x7'));var controller=require(_0x5ff5('0x8'));router[_0x5ff5('0x9')]('/',auth[_0x5ff5('0xa')](),controller[_0x5ff5('0xb')]);router['get'](_0x5ff5('0xc'),auth[_0x5ff5('0xa')](),controller[_0x5ff5('0xd')]);router[_0x5ff5('0xe')]('/',auth[_0x5ff5('0xa')](),controller[_0x5ff5('0xf')]);router['put'](_0x5ff5('0xc'),auth[_0x5ff5('0xa')](),controller['update']);router['delete'](_0x5ff5('0xc'),auth[_0x5ff5('0xa')](),controller[_0x5ff5('0x10')]);module[_0x5ff5('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b2ea0d2..a07b737 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 _0x008d=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2eaedf,_0x481885){var _0x4b0bf8=function(_0x1feb83){while(--_0x1feb83){_0x2eaedf['push'](_0x2eaedf['shift']());}};_0x4b0bf8(++_0x481885);}(_0x008d,0x9b));var _0xd008=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x008d[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xd008('0x0'));module[_0xd008('0x1')]={'calldate':{'type':Sequelize[_0xd008('0x2')],'allowNull':![],'defaultValue':_0xd008('0x3')},'clid':{'type':Sequelize[_0xd008('0x4')]},'src':{'type':Sequelize[_0xd008('0x4')]},'dst':{'type':Sequelize[_0xd008('0x4')]},'dcontext':{'type':Sequelize[_0xd008('0x4')]},'channel':{'type':Sequelize[_0xd008('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd008('0x4')]},'lastdata':{'type':Sequelize[_0xd008('0x4')]},'duration':{'type':Sequelize[_0xd008('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd008('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd008('0x4')]},'amaflags':{'type':Sequelize[_0xd008('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd008('0x4')]},'userfield':{'type':Sequelize[_0xd008('0x4')]},'uniqueid':{'type':Sequelize[_0xd008('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd008('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd008('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e63=['INTEGER','exports','STRING'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x8e63,0x7c));var _0x38e6=function(_0x3ceffc,_0x3ec0f2){_0x3ceffc=_0x3ceffc-0x0;var _0x288ca1=_0x8e63[_0x3ceffc];return _0x288ca1;};'use strict';var Sequelize=require('sequelize');module[_0x38e6('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x38e6('0x1')]},'src':{'type':Sequelize[_0x38e6('0x1')]},'dst':{'type':Sequelize[_0x38e6('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x38e6('0x1')]},'lastapp':{'type':Sequelize[_0x38e6('0x1')]},'lastdata':{'type':Sequelize[_0x38e6('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x38e6('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x38e6('0x1')]},'amaflags':{'type':Sequelize[_0x38e6('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x38e6('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x38e6('0x1')]},'sequence':{'type':Sequelize[_0x38e6('0x1')]},'peeraccount':{'type':Sequelize[_0x38e6('0x1')]},'type':{'type':Sequelize[_0x38e6('0x1')]},'tag':{'type':Sequelize[_0x38e6('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 782652f..a795674 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 _0x8ef6=['includeAll','include','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','count'];(function(_0x597d1e,_0x339556){var _0x45e34d=function(_0x4133ff){while(--_0x4133ff){_0x597d1e['push'](_0x597d1e['shift']());}};_0x45e34d(++_0x339556);}(_0x8ef6,0xf2));var _0x68ef=function(_0x22b203,_0x468393){_0x22b203=_0x22b203-0x0;var _0x43d162=_0x8ef6[_0x22b203];return _0x43d162;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x13280b,_0x5e4dbe){return function(_0x178460){if(!_0x178460){_0x13280b['sendStatus'](0x194);}return _0x178460;};}function handleError(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0x1f4;return function(_0x1a7ce1){logger[_0x68ef('0x29')](_0x1a7ce1[_0x68ef('0x2a')]);if(_0x1a7ce1[_0x68ef('0x2b')]){delete _0x1a7ce1['name'];}_0x599243['status'](_0x55d8b0)[_0x68ef('0x2c')](_0x1a7ce1);};}exports[_0x68ef('0x2d')]=function(_0x7bf96,_0x263b30){var _0x22ef25={},_0x201884={},_0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x30')]['key']};});_0x201884[_0x68ef('0x31')]=_[_0x68ef('0x32')](_0x4579cb,'name');_0x201884['query']=_[_0x68ef('0x33')](_0x7bf96[_0x68ef('0x34')]);_0x201884['filters']=_[_0x68ef('0x35')](_0x201884[_0x68ef('0x31')],_0x201884[_0x68ef('0x34')]);_0x22ef25[_0x68ef('0x36')]=_['intersection'](_0x201884[_0x68ef('0x31')],qs[_0x68ef('0x37')](_0x7bf96['query'][_0x68ef('0x37')]));_0x22ef25['attributes']=_0x22ef25[_0x68ef('0x36')][_0x68ef('0x38')]?_0x22ef25['attributes']:_0x201884[_0x68ef('0x31')];if(!_0x7bf96['query'][_0x68ef('0x39')]('nolimit')){_0x22ef25[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x7bf96[_0x68ef('0x34')]['limit']);_0x22ef25[_0x68ef('0x1f')]=qs['offset'](_0x7bf96[_0x68ef('0x34')]['offset']);}_0x22ef25[_0x68ef('0x3a')]=qs[_0x68ef('0x3b')](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3b')]);_0x22ef25[_0x68ef('0x3c')]=qs[_0x68ef('0x3d')](_['pick'](_0x7bf96[_0x68ef('0x34')],_0x201884[_0x68ef('0x3d')]),_0x4579cb);if(_0x7bf96[_0x68ef('0x34')]['filter']){_0x22ef25[_0x68ef('0x3c')]=_[_0x68ef('0x3e')](_0x22ef25[_0x68ef('0x3c')],{'$or':_['map'](_0x4579cb,function(_0x49f260){if(_0x49f260[_0x68ef('0x30')]!==_0x68ef('0x3f')){var _0x36213a={};_0x36213a[_0x49f260[_0x68ef('0x2b')]]={'$like':'%'+_0x7bf96[_0x68ef('0x34')][_0x68ef('0x40')]+'%'};return _0x36213a;}})});}_0x22ef25=_[_0x68ef('0x3e')]({},_0x22ef25,_0x7bf96['options']);var _0xaf7df1={'where':_0x22ef25[_0x68ef('0x3c')]};return db[_0x68ef('0x2e')][_0x68ef('0x41')](_0xaf7df1)['then'](function(_0x3cb156){_0x26288a[_0x68ef('0x41')]=_0x3cb156;if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x42')]){_0x22ef25[_0x68ef('0x43')]=[{'all':!![]}];}return db[_0x68ef('0x2e')]['findAll'](_0x22ef25);})[_0x68ef('0x27')](function(_0x3f7699){_0x26288a[_0x68ef('0x44')]=_0x3f7699;return _0x26288a;})[_0x68ef('0x27')](respondWithFilteredResult(_0x263b30,_0x22ef25))[_0x68ef('0x45')](handleError(_0x263b30,null));};exports[_0x68ef('0x46')]=function(_0x13ee90,_0xd6a0b5){var _0xc687ab={'raw':!![],'where':{'id':_0x13ee90[_0x68ef('0x47')]['id']}},_0x531096={};_0x531096[_0x68ef('0x31')]=_[_0x68ef('0x33')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0x531096[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x13ee90['query']);_0x531096[_0x68ef('0x3d')]=_['intersection'](_0x531096[_0x68ef('0x31')],_0x531096[_0x68ef('0x34')]);_0xc687ab[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x531096['model'],qs[_0x68ef('0x37')](_0x13ee90['query'][_0x68ef('0x37')]));_0xc687ab['attributes']=_0xc687ab[_0x68ef('0x36')][_0x68ef('0x38')]?_0xc687ab[_0x68ef('0x36')]:_0x531096['model'];if(_0x13ee90['query'][_0x68ef('0x42')]){_0xc687ab[_0x68ef('0x43')]=[{'all':!![]}];}_0xc687ab=_['merge']({},_0xc687ab,_0x13ee90['options']);return db['Cdr'][_0x68ef('0x48')](_0xc687ab)[_0x68ef('0x27')](handleEntityNotFound(_0xd6a0b5,null))[_0x68ef('0x27')](respondWithResult(_0xd6a0b5,null))[_0x68ef('0x45')](handleError(_0xd6a0b5,null));};exports[_0x68ef('0x49')]=function(_0x583566,_0x55f385){return db[_0x68ef('0x2e')][_0x68ef('0x49')](_0x583566[_0x68ef('0x4a')],{})[_0x68ef('0x27')](respondWithResult(_0x55f385,0xc9))['catch'](handleError(_0x55f385,null));};exports[_0x68ef('0x4b')]=function(_0x474e5a,_0x1c9b6f){if(_0x474e5a[_0x68ef('0x4a')]['id']){delete _0x474e5a['body']['id'];}return db['Cdr'][_0x68ef('0x48')]({'where':{'id':_0x474e5a[_0x68ef('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c9b6f,null))[_0x68ef('0x27')](saveUpdates(_0x474e5a[_0x68ef('0x4a')],null))[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,null))[_0x68ef('0x45')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x28')]=function(_0x4f0f77,_0x35d6bd){return db[_0x68ef('0x2e')][_0x68ef('0x48')]({'where':{'id':_0x4f0f77['params']['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x35d6bd,null))[_0x68ef('0x27')](removeEntity(_0x35d6bd,null))[_0x68ef('0x45')](handleError(_0x35d6bd,null));};exports['describe']=function(_0x7dce90,_0x59e8ee){return db['Cdr'][_0x68ef('0x4c')]()['then'](respondWithResult(_0x59e8ee,null))[_0x68ef('0x45')](handleError(_0x59e8ee,null));}; \ No newline at end of file +var _0x7bae=['hasOwnProperty','order','sort','where','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','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','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7bae[_0x4fc9e6];return _0x551d28;};'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')]=_['map'](_0x587c7d,_0xe7ba('0x29'));_0x369451['query']=_['keys'](_0x48c869[_0xe7ba('0x31')]);_0x369451[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7['attributes']=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x34')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x92fe7['attributes']=_0x92fe7[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x92fe7['attributes']:_0x369451[_0xe7ba('0x30')];if(!_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x37')]('nolimit')){_0x92fe7[_0xe7ba('0x1e')]=qs[_0xe7ba('0x1e')](_0x48c869['query'][_0xe7ba('0x1e')]);_0x92fe7[_0xe7ba('0x20')]=qs[_0xe7ba('0x20')](_0x48c869['query'][_0xe7ba('0x20')]);}_0x92fe7[_0xe7ba('0x38')]=qs['sort'](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x39')]);_0x92fe7[_0xe7ba('0x3a')]=qs['filters'](_['pick'](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x32')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]){_0x92fe7[_0xe7ba('0x3a')]=_['merge'](_0x92fe7[_0xe7ba('0x3a')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x3139a6){if(_0x3139a6[_0xe7ba('0x3c')]!=='VIRTUAL'){var _0xe67917={};_0xe67917[_0x3139a6[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]+'%'};return _0xe67917;}})});}_0x92fe7=_[_0xe7ba('0x3d')]({},_0x92fe7,_0x48c869[_0xe7ba('0x3e')]);var _0x124cc4={'where':_0x92fe7['where']};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x124cc4)[_0xe7ba('0x26')](function(_0x401b0a){_0x4bf5f9[_0xe7ba('0x1f')]=_0x401b0a;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x92fe7[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x2c')]['findAll'](_0x92fe7);})[_0xe7ba('0x26')](function(_0x417734){_0x4bf5f9['rows']=_0x417734;return _0x4bf5f9;})['then'](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x41')](handleError(_0x102925,null));};exports[_0xe7ba('0x42')]=function(_0x368af2,_0x5589c4){var _0x249e1d={'raw':!![],'where':{'id':_0x368af2[_0xe7ba('0x43')]['id']}},_0x82246e={};_0x82246e[_0xe7ba('0x30')]=_[_0xe7ba('0x44')](db['Cdr'][_0xe7ba('0x2d')]);_0x82246e['query']=_[_0xe7ba('0x44')](_0x368af2[_0xe7ba('0x31')]);_0x82246e[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x82246e[_0xe7ba('0x30')],_0x82246e[_0xe7ba('0x31')]);_0x249e1d[_0xe7ba('0x35')]=_[_0xe7ba('0x33')](_0x82246e['model'],qs[_0xe7ba('0x34')](_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x249e1d[_0xe7ba('0x35')]=_0x249e1d[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x249e1d[_0xe7ba('0x35')]:_0x82246e[_0xe7ba('0x30')];if(_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x249e1d['include']=[{'all':!![]}];}_0x249e1d=_[_0xe7ba('0x3d')]({},_0x249e1d,_0x368af2['options']);return db[_0xe7ba('0x2c')][_0xe7ba('0x45')](_0x249e1d)[_0xe7ba('0x26')](handleEntityNotFound(_0x5589c4,null))[_0xe7ba('0x26')](respondWithResult(_0x5589c4,null))[_0xe7ba('0x41')](handleError(_0x5589c4,null));};exports[_0xe7ba('0x46')]=function(_0x48ae57,_0x271592){return db[_0xe7ba('0x2c')][_0xe7ba('0x46')](_0x48ae57[_0xe7ba('0x47')],{})[_0xe7ba('0x26')](respondWithResult(_0x271592,0xc9))[_0xe7ba('0x41')](handleError(_0x271592,null));};exports[_0xe7ba('0x25')]=function(_0x266ace,_0x272cb9){if(_0x266ace[_0xe7ba('0x47')]['id']){delete _0x266ace[_0xe7ba('0x47')]['id'];}return db['Cdr'][_0xe7ba('0x45')]({'where':{'id':_0x266ace[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x272cb9,null))[_0xe7ba('0x26')](saveUpdates(_0x266ace[_0xe7ba('0x47')],null))[_0xe7ba('0x26')](respondWithResult(_0x272cb9,null))['catch'](handleError(_0x272cb9,null));};exports[_0xe7ba('0x48')]=function(_0x3ee828,_0x520477){return db[_0xe7ba('0x2c')][_0xe7ba('0x45')]({'where':{'id':_0x3ee828[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x520477,null))['then'](removeEntity(_0x520477,null))['catch'](handleError(_0x520477,null));};exports[_0xe7ba('0x49')]=function(_0x2cfdc3,_0x285743){return db['Cdr'][_0xe7ba('0x49')]()[_0xe7ba('0x26')](respondWithResult(_0x285743,null))[_0xe7ba('0x41')](handleError(_0x285743,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ed2c22f..52288b9 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1c42db,_0xda1099){var _0x6428ba=function(_0x152981){while(--_0x152981){_0x1c42db['push'](_0x1c42db['shift']());}};_0x6428ba(++_0xda1099);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x45f753,_0x7d7810){var _0x47db4b=function(_0x98051d){while(--_0x98051d){_0x45f753['push'](_0x45f753['shift']());}};_0x47db4b(++_0x7d7810);}(_0x7a54,0x106));var _0x47a5=function(_0x1cc55e,_0x238ff5){_0x1cc55e=_0x1cc55e-0x0;var _0x4e1a9c=_0x7a54[_0x1cc55e];return _0x4e1a9c;};'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 541b100..5c362a8 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 _0x558b=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x558b,0x17b));var _0xb558=function(_0x1194f5,_0x4dc01b){_0x1194f5=_0x1194f5-0x0;var _0x3ed851=_0x558b[_0x1194f5];return _0x3ed851;};'use strict';var _=require(_0xb558('0x0'));var util=require(_0xb558('0x1'));var moment=require(_0xb558('0x2'));var BPromise=require('bluebird');var rs=require(_0xb558('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb558('0x4'))['db'];var utils=require(_0xb558('0x5'));var logger=require(_0xb558('0x6'))(_0xb558('0x7'));var config=require('../../config/environment');var jayson=require(_0xb558('0x8'));var client=jayson[_0xb558('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46e8cd,_0x2b8035,_0x722b3a){return new BPromise(function(_0x2c5ac6,_0x919728){return client[_0xb558('0xa')](_0x46e8cd,_0x722b3a)[_0xb558('0xb')](function(_0x4214e8){logger[_0xb558('0xc')]('Cdr,\x20%s,\x20%s',_0x2b8035,_0xb558('0xd'));logger[_0xb558('0xe')](_0xb558('0xf'),_0x2b8035,_0xb558('0xd'),JSON[_0xb558('0x10')](_0x4214e8));if(_0x4214e8[_0xb558('0x11')]){if(_0x4214e8[_0xb558('0x11')][_0xb558('0x12')]===0x1f4){logger[_0xb558('0x11')](_0xb558('0x13'),_0x2b8035,_0x4214e8[_0xb558('0x11')][_0xb558('0x14')]);return _0x919728(_0x4214e8[_0xb558('0x11')][_0xb558('0x14')]);}logger[_0xb558('0x11')](_0xb558('0x13'),_0x2b8035,_0x4214e8[_0xb558('0x11')][_0xb558('0x14')]);return _0x2c5ac6(_0x4214e8[_0xb558('0x11')][_0xb558('0x14')]);}else{logger[_0xb558('0xc')](_0xb558('0x13'),_0x2b8035,_0xb558('0xd'));_0x2c5ac6(_0x4214e8[_0xb558('0x15')][_0xb558('0x14')]);}})[_0xb558('0x16')](function(_0x3ad399){logger['error'](_0xb558('0x13'),_0x2b8035,_0x3ad399);_0x919728(_0x3ad399);});});} \ No newline at end of file +var _0x89cc=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x89cc,0xc3));var _0xc89c=function(_0x128847,_0x3dc1f8){_0x128847=_0x128847-0x0;var _0x1f9ff2=_0x89cc[_0x128847];return _0x1f9ff2;};'use strict';var _=require(_0xc89c('0x0'));var util=require('util');var moment=require(_0xc89c('0x1'));var BPromise=require(_0xc89c('0x2'));var rs=require(_0xc89c('0x3'));var fs=require('fs');var Redis=require(_0xc89c('0x4'));var db=require(_0xc89c('0x5'))['db'];var utils=require(_0xc89c('0x6'));var logger=require(_0xc89c('0x7'))(_0xc89c('0x8'));var config=require(_0xc89c('0x9'));var jayson=require(_0xc89c('0xa'));var client=jayson[_0xc89c('0xb')][_0xc89c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40d513,_0x4a8e37,_0x1a3ec7){return new BPromise(function(_0xfed1b3,_0x25790e){return client['request'](_0x40d513,_0x1a3ec7)[_0xc89c('0xd')](function(_0x338427){logger[_0xc89c('0xe')](_0xc89c('0xf'),_0x4a8e37,_0xc89c('0x10'));logger[_0xc89c('0x11')](_0xc89c('0x12'),_0x4a8e37,_0xc89c('0x10'),JSON['stringify'](_0x338427));if(_0x338427[_0xc89c('0x13')]){if(_0x338427[_0xc89c('0x13')][_0xc89c('0x14')]===0x1f4){logger[_0xc89c('0x13')](_0xc89c('0xf'),_0x4a8e37,_0x338427['error'][_0xc89c('0x15')]);return _0x25790e(_0x338427[_0xc89c('0x13')][_0xc89c('0x15')]);}logger[_0xc89c('0x13')](_0xc89c('0xf'),_0x4a8e37,_0x338427[_0xc89c('0x13')][_0xc89c('0x15')]);return _0xfed1b3(_0x338427['error']['message']);}else{logger[_0xc89c('0xe')](_0xc89c('0xf'),_0x4a8e37,_0xc89c('0x10'));_0xfed1b3(_0x338427[_0xc89c('0x16')][_0xc89c('0x15')]);}})[_0xc89c('0x17')](function(_0x3e51fd){logger[_0xc89c('0x13')]('Cdr,\x20%s,\x20%s',_0x4a8e37,_0x3e51fd);_0x25790e(_0x3e51fd);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 44bbb5d..ffc9143 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(_0x72cd0f,_0x18f4e6){var _0x3f5d2c=function(_0x162491){while(--_0x162491){_0x72cd0f['push'](_0x72cd0f['shift']());}};_0x3f5d2c(++_0x18f4e6);}(_0xb10b,0x12a));var _0xbb10=function(_0xa9c870,_0x111b20){_0xa9c870=_0xa9c870-0x0;var _0x2d13a3=_0xb10b[_0xa9c870];return _0x2d13a3;};'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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6a71051..34d18d5 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 _0xea41=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xea41,0x14f));var _0x1ea4=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xea41[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x1ea4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1ea4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1ea4('0x2')],'allowNull':![],'defaultValue':_0x1ea4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1ea4('0x2')]},'interval':{'type':Sequelize[_0x1ea4('0x2')],'defaultValue':_0x1ea4('0x4')}}; \ No newline at end of file +var _0xbd51=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x3c5a79,_0x565097){var _0x52835f=function(_0x139063){while(--_0x139063){_0x3c5a79['push'](_0x3c5a79['shift']());}};_0x52835f(++_0x565097);}(_0xbd51,0xbf));var _0x1bd5=function(_0x1c990f,_0x123bb5){_0x1c990f=_0x1c990f-0x0;var _0x20c891=_0xbd51[_0x1c990f];return _0x20c891;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1bd5('0x2')],'allowNull':![],'defaultValue':_0x1bd5('0x3')},'appdata':{'type':Sequelize[_0x1bd5('0x4')]()},'description':{'type':Sequelize[_0x1bd5('0x2')]},'interval':{'type':Sequelize[_0x1bd5('0x2')],'defaultValue':_0x1bd5('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index fd486f0..1b775b4 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 _0x1120=['offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','catch','body','find','params','eml-format','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','sendStatus','json'];(function(_0xd7e034,_0x2e5f38){var _0x5acdb7=function(_0x5c00f2){while(--_0x5c00f2){_0xd7e034['push'](_0xd7e034['shift']());}};_0x5acdb7(++_0x2e5f38);}(_0x1120,0x140));var _0x0112=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1120[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0x0112('0x0'));var rimraf=require(_0x0112('0x1'));var zipdir=require(_0x0112('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0112('0x3'));var util=require(_0x0112('0x4'));var path=require(_0x0112('0x5'));var sox=require(_0x0112('0x6'));var csv=require(_0x0112('0x7'));var ejs=require(_0x0112('0x8'));var fs=require('fs');var fs_extra=require(_0x0112('0x9'));var _=require(_0x0112('0xa'));var squel=require(_0x0112('0xb'));var crypto=require(_0x0112('0xc'));var jsforce=require(_0x0112('0xd'));var deskjs=require(_0x0112('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0112('0xf'));var Papa=require(_0x0112('0x10'));var Redis=require(_0x0112('0x11'));var authService=require(_0x0112('0x12'));var qs=require(_0x0112('0x13'));var as=require(_0x0112('0x14'));var hardwareService=require(_0x0112('0x15'));var logger=require('../../config/logger')(_0x0112('0x16'));var utils=require(_0x0112('0x17'));var config=require(_0x0112('0x18'));var licenseUtil=require(_0x0112('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x95d441,_0x394926){_0x394926=_0x394926||0xcc;return function(_0xb58a0b){if(_0xb58a0b){return _0x95d441[_0x0112('0x1a')](_0x394926);}return _0x95d441['status'](_0x394926)['end']();};}function respondWithResult(_0x44d646,_0x4d591e){_0x4d591e=_0x4d591e||0xc8;return function(_0x19dd06){if(_0x19dd06){return _0x44d646['status'](_0x4d591e)[_0x0112('0x1b')](_0x19dd06);}};}function respondWithFilteredResult(_0x1e273d,_0xe2ec19){return function(_0x1a2549){if(_0x1a2549){var _0x54269a=typeof _0xe2ec19[_0x0112('0x1c')]===_0x0112('0x1d')&&typeof _0xe2ec19[_0x0112('0x1e')]==='undefined';var _0x58aa63=_0x1a2549[_0x0112('0x1f')];var _0x58f0ed=_0x54269a?0x0:_0xe2ec19[_0x0112('0x1c')];var _0x4e34c1=_0x54269a?_0x1a2549[_0x0112('0x1f')]:_0xe2ec19[_0x0112('0x1c')]+_0xe2ec19['limit'];var _0x590c3e;if(_0x4e34c1>=_0x58aa63){_0x4e34c1=_0x58aa63;_0x590c3e=0xc8;}else{_0x590c3e=0xce;}_0x1e273d[_0x0112('0x20')](_0x590c3e);return _0x1e273d[_0x0112('0x21')]('Content-Range',_0x58f0ed+'-'+_0x4e34c1+'/'+_0x58aa63)[_0x0112('0x1b')](_0x1a2549);}return null;};}function patchUpdates(_0x548681){return function(_0x51ac2d){try{jsonpatch['apply'](_0x51ac2d,_0x548681,!![]);}catch(_0x2ce17a){return BPromise[_0x0112('0x22')](_0x2ce17a);}return _0x51ac2d[_0x0112('0x23')]();};}function saveUpdates(_0x53f19c,_0x3dd2aa){return function(_0xf92cb4){if(_0xf92cb4){return _0xf92cb4[_0x0112('0x24')](_0x53f19c)[_0x0112('0x25')](function(_0x57bd39){return _0x57bd39;});}return null;};}function removeEntity(_0x33cb56,_0x408bb8){return function(_0x2d99c1){if(_0x2d99c1){return _0x2d99c1[_0x0112('0x26')]()['then'](function(){_0x33cb56[_0x0112('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ea13,_0x27252e){return function(_0x4a583e){if(!_0x4a583e){_0x58ea13[_0x0112('0x1a')](0x194);}return _0x4a583e;};}function handleError(_0x5bce7b,_0x32035e){_0x32035e=_0x32035e||0x1f4;return function(_0x58e5){logger[_0x0112('0x27')](_0x58e5[_0x0112('0x28')]);if(_0x58e5[_0x0112('0x29')]){delete _0x58e5[_0x0112('0x29')];}_0x5bce7b[_0x0112('0x20')](_0x32035e)[_0x0112('0x2a')](_0x58e5);};}exports[_0x0112('0x2b')]=function(_0x29c9d0,_0x36669c){var _0x52aabd={'raw':!![],'where':{'id':_0x29c9d0['params']['id']}},_0x6d44bb={};_0x6d44bb[_0x0112('0x2c')]=_[_0x0112('0x2d')](db[_0x0112('0x2e')]['rawAttributes']);_0x6d44bb[_0x0112('0x2f')]=_['keys'](_0x29c9d0[_0x0112('0x2f')]);_0x6d44bb[_0x0112('0x30')]=_[_0x0112('0x31')](_0x6d44bb['model'],_0x6d44bb['query']);_0x52aabd['attributes']=_[_0x0112('0x31')](_0x6d44bb['model'],qs['fields'](_0x29c9d0['query']['fields']));_0x52aabd['attributes']=_0x52aabd[_0x0112('0x32')][_0x0112('0x33')]?_0x52aabd[_0x0112('0x32')]:_0x6d44bb['model'];if(_0x29c9d0[_0x0112('0x2f')][_0x0112('0x34')]){_0x52aabd['include']=[{'all':!![]}];}_0x52aabd=_[_0x0112('0x35')]({},_0x52aabd,_0x29c9d0['options']);return db[_0x0112('0x2e')]['find'](_0x52aabd)[_0x0112('0x25')](handleEntityNotFound(_0x36669c,null))[_0x0112('0x25')](respondWithResult(_0x36669c,null))[_0x0112('0x36')](handleError(_0x36669c,null));};exports['update']=function(_0x4d5ac4,_0x5a0e37){if(_0x4d5ac4['body']['id']){delete _0x4d5ac4[_0x0112('0x37')]['id'];}return db[_0x0112('0x2e')][_0x0112('0x38')]({'where':{'id':_0x4d5ac4[_0x0112('0x39')]['id']}})[_0x0112('0x25')](handleEntityNotFound(_0x5a0e37,null))[_0x0112('0x25')](saveUpdates(_0x4d5ac4[_0x0112('0x37')],null))[_0x0112('0x25')](respondWithResult(_0x5a0e37,null))[_0x0112('0x36')](handleError(_0x5a0e37,null));};exports[_0x0112('0x26')]=function(_0xf2573c,_0x18bbfc){return db[_0x0112('0x2e')][_0x0112('0x38')]({'where':{'id':_0xf2573c['params']['id']}})['then'](handleEntityNotFound(_0x18bbfc,null))['then'](removeEntity(_0x18bbfc,null))['catch'](handleError(_0x18bbfc,null));}; \ No newline at end of file +var _0xc68d=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','options','find','catch','body','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x43a01e,_0x24133c){var _0x100f18=function(_0x38ac04){while(--_0x38ac04){_0x43a01e['push'](_0x43a01e['shift']());}};_0x100f18(++_0x24133c);}(_0xc68d,0x17a));var _0xdc68=function(_0x4de708,_0x133bae){_0x4de708=_0x4de708-0x0;var _0x21c16c=_0xc68d[_0x4de708];return _0x21c16c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc68('0x0'));var zipdir=require(_0xdc68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc68('0x2'));var BPromise=require(_0xdc68('0x3'));var Mustache=require(_0xdc68('0x4'));var util=require(_0xdc68('0x5'));var path=require(_0xdc68('0x6'));var sox=require(_0xdc68('0x7'));var csv=require('to-csv');var ejs=require(_0xdc68('0x8'));var fs=require('fs');var fs_extra=require(_0xdc68('0x9'));var _=require(_0xdc68('0xa'));var squel=require('squel');var crypto=require(_0xdc68('0xb'));var jsforce=require(_0xdc68('0xc'));var deskjs=require(_0xdc68('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc68('0xe'));var Redis=require(_0xdc68('0xf'));var authService=require(_0xdc68('0x10'));var qs=require(_0xdc68('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc68('0x12'));var logger=require(_0xdc68('0x13'))(_0xdc68('0x14'));var utils=require(_0xdc68('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdc68('0x16'));var db=require(_0xdc68('0x17'))['db'];function respondWithStatusCode(_0x500a71,_0x44775f){_0x44775f=_0x44775f||0xcc;return function(_0x448d4a){if(_0x448d4a){return _0x500a71[_0xdc68('0x18')](_0x44775f);}return _0x500a71['status'](_0x44775f)[_0xdc68('0x19')]();};}function respondWithResult(_0x181136,_0x19c1ed){_0x19c1ed=_0x19c1ed||0xc8;return function(_0xd229ba){if(_0xd229ba){return _0x181136[_0xdc68('0x1a')](_0x19c1ed)[_0xdc68('0x1b')](_0xd229ba);}};}function respondWithFilteredResult(_0x2b6883,_0x4a139b){return function(_0x210d65){if(_0x210d65){var _0x4aa2ad=typeof _0x4a139b[_0xdc68('0x1c')]==='undefined'&&typeof _0x4a139b[_0xdc68('0x1d')]===_0xdc68('0x1e');var _0x5c6d6b=_0x210d65[_0xdc68('0x1f')];var _0x3afa9a=_0x4aa2ad?0x0:_0x4a139b[_0xdc68('0x1c')];var _0x59896b=_0x4aa2ad?_0x210d65[_0xdc68('0x1f')]:_0x4a139b[_0xdc68('0x1c')]+_0x4a139b[_0xdc68('0x1d')];var _0x17c349;if(_0x59896b>=_0x5c6d6b){_0x59896b=_0x5c6d6b;_0x17c349=0xc8;}else{_0x17c349=0xce;}_0x2b6883['status'](_0x17c349);return _0x2b6883['set']('Content-Range',_0x3afa9a+'-'+_0x59896b+'/'+_0x5c6d6b)[_0xdc68('0x1b')](_0x210d65);}return null;};}function patchUpdates(_0x15f955){return function(_0x16e37d){try{jsonpatch[_0xdc68('0x20')](_0x16e37d,_0x15f955,!![]);}catch(_0xbeae7d){return BPromise['reject'](_0xbeae7d);}return _0x16e37d[_0xdc68('0x21')]();};}function saveUpdates(_0x42e1ce,_0x3199d8){return function(_0x1cea8e){if(_0x1cea8e){return _0x1cea8e[_0xdc68('0x22')](_0x42e1ce)[_0xdc68('0x23')](function(_0x5b3f02){return _0x5b3f02;});}return null;};}function removeEntity(_0x1f14b3,_0x34273d){return function(_0x5685ed){if(_0x5685ed){return _0x5685ed[_0xdc68('0x24')]()['then'](function(){_0x1f14b3[_0xdc68('0x1a')](0xcc)[_0xdc68('0x19')]();});}};}function handleEntityNotFound(_0xd5cceb,_0xeb9997){return function(_0x5e6f52){if(!_0x5e6f52){_0xd5cceb[_0xdc68('0x18')](0x194);}return _0x5e6f52;};}function handleError(_0x599af3,_0x4121cd){_0x4121cd=_0x4121cd||0x1f4;return function(_0x41e500){logger[_0xdc68('0x25')](_0x41e500[_0xdc68('0x26')]);if(_0x41e500[_0xdc68('0x27')]){delete _0x41e500['name'];}_0x599af3['status'](_0x4121cd)['send'](_0x41e500);};}exports['show']=function(_0x268766,_0x11418b){var _0x296424={'raw':!![],'where':{'id':_0x268766[_0xdc68('0x28')]['id']}},_0x472ca4={};_0x472ca4[_0xdc68('0x29')]=_[_0xdc68('0x2a')](db[_0xdc68('0x2b')][_0xdc68('0x2c')]);_0x472ca4[_0xdc68('0x2d')]=_[_0xdc68('0x2a')](_0x268766['query']);_0x472ca4[_0xdc68('0x2e')]=_[_0xdc68('0x2f')](_0x472ca4['model'],_0x472ca4['query']);_0x296424[_0xdc68('0x30')]=_[_0xdc68('0x2f')](_0x472ca4['model'],qs[_0xdc68('0x31')](_0x268766[_0xdc68('0x2d')]['fields']));_0x296424[_0xdc68('0x30')]=_0x296424['attributes']['length']?_0x296424[_0xdc68('0x30')]:_0x472ca4['model'];if(_0x268766[_0xdc68('0x2d')][_0xdc68('0x32')]){_0x296424['include']=[{'all':!![]}];}_0x296424=_['merge']({},_0x296424,_0x268766[_0xdc68('0x33')]);return db[_0xdc68('0x2b')][_0xdc68('0x34')](_0x296424)['then'](handleEntityNotFound(_0x11418b,null))[_0xdc68('0x23')](respondWithResult(_0x11418b,null))[_0xdc68('0x35')](handleError(_0x11418b,null));};exports['update']=function(_0x1bf8c6,_0x4e47c5){if(_0x1bf8c6[_0xdc68('0x36')]['id']){delete _0x1bf8c6[_0xdc68('0x36')]['id'];}return db[_0xdc68('0x2b')][_0xdc68('0x34')]({'where':{'id':_0x1bf8c6[_0xdc68('0x28')]['id']}})['then'](handleEntityNotFound(_0x4e47c5,null))[_0xdc68('0x23')](saveUpdates(_0x1bf8c6[_0xdc68('0x36')],null))['then'](respondWithResult(_0x4e47c5,null))[_0xdc68('0x35')](handleError(_0x4e47c5,null));};exports[_0xdc68('0x24')]=function(_0x5b77b3,_0x1e563a){return db[_0xdc68('0x2b')][_0xdc68('0x34')]({'where':{'id':_0x5b77b3['params']['id']}})[_0xdc68('0x23')](handleEntityNotFound(_0x1e563a,null))[_0xdc68('0x23')](removeEntity(_0x1e563a,null))[_0xdc68('0x35')](handleError(_0x1e563a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 0a924c0..f115de4 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 _0x4e92=['bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x4c4e44,_0x22d77c){var _0x57ed07=function(_0x58cc2c){while(--_0x58cc2c){_0x4c4e44['push'](_0x4c4e44['shift']());}};_0x57ed07(++_0x22d77c);}(_0x4e92,0xed));var _0x24e9=function(_0x361422,_0xa27d1e){_0x361422=_0x361422-0x0;var _0x2daa43=_0x4e92[_0x361422];return _0x2daa43;};'use strict';var _=require(_0x24e9('0x0'));var util=require(_0x24e9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x24e9('0x2'));var BPromise=require(_0x24e9('0x3'));var rp=require(_0x24e9('0x4'));var fs=require('fs');var path=require(_0x24e9('0x5'));var rimraf=require('rimraf');var config=require(_0x24e9('0x6'));var attributes=require(_0x24e9('0x7'));module['exports']=function(_0x588c95,_0x39ac4b){return _0x588c95[_0x24e9('0x8')](_0x24e9('0x9'),attributes,{'tableName':_0x24e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x24e9('0xb')});}; \ No newline at end of file +var _0x175e=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x175e,0xe6));var _0xe175=function(_0x55aff0,_0x5a5359){_0x55aff0=_0x55aff0-0x0;var _0xbfa3f1=_0x175e[_0x55aff0];return _0xbfa3f1;};'use strict';var _=require(_0xe175('0x0'));var util=require(_0xe175('0x1'));var logger=require(_0xe175('0x2'))(_0xe175('0x3'));var moment=require(_0xe175('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe175('0x5'));var rimraf=require(_0xe175('0x6'));var config=require(_0xe175('0x7'));var attributes=require(_0xe175('0x8'));module[_0xe175('0x9')]=function(_0x278a8d,_0x7eba){return _0x278a8d[_0xe175('0xa')](_0xe175('0xb'),attributes,{'tableName':_0xe175('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe175('0xd'),'collate':_0xe175('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 04c9bfe..30233d3 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 _0x3fa4=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird'];(function(_0x4f0db5,_0x18e951){var _0x18b226=function(_0x43072b){while(--_0x43072b){_0x4f0db5['push'](_0x4f0db5['shift']());}};_0x18b226(++_0x18e951);}(_0x3fa4,0x164));var _0x43fa=function(_0x12d5c1,_0x2e6cc7){_0x12d5c1=_0x12d5c1-0x0;var _0x17b70e=_0x3fa4[_0x12d5c1];return _0x17b70e;};'use strict';var _=require(_0x43fa('0x0'));var util=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43fa('0x4'))['db'];var utils=require(_0x43fa('0x5'));var logger=require(_0x43fa('0x6'))('rpc');var config=require(_0x43fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x8')][_0x43fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f93c7,_0x1b65df,_0x25a62d){return new BPromise(function(_0x5e51b5,_0x24b12b){return client['request'](_0x2f93c7,_0x25a62d)[_0x43fa('0xa')](function(_0x2de891){logger['info']('ChatApplication,\x20%s,\x20%s',_0x1b65df,'request\x20sent');logger[_0x43fa('0xb')](_0x43fa('0xc'),_0x1b65df,_0x43fa('0xd'),JSON[_0x43fa('0xe')](_0x2de891));if(_0x2de891['error']){if(_0x2de891['error']['code']===0x1f4){logger[_0x43fa('0xf')](_0x43fa('0x10'),_0x1b65df,_0x2de891[_0x43fa('0xf')]['message']);return _0x24b12b(_0x2de891['error'][_0x43fa('0x11')]);}logger['error'](_0x43fa('0x10'),_0x1b65df,_0x2de891[_0x43fa('0xf')]['message']);return _0x5e51b5(_0x2de891[_0x43fa('0xf')][_0x43fa('0x11')]);}else{logger[_0x43fa('0x12')](_0x43fa('0x10'),_0x1b65df,_0x43fa('0xd'));_0x5e51b5(_0x2de891['result'][_0x43fa('0x11')]);}})[_0x43fa('0x13')](function(_0x3327ed){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1b65df,_0x3327ed);_0x24b12b(_0x3327ed);});});} \ No newline at end of file +var _0x7ebb=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x495deb,_0x573ea2){var _0x19c038=function(_0x3ae02f){while(--_0x3ae02f){_0x495deb['push'](_0x495deb['shift']());}};_0x19c038(++_0x573ea2);}(_0x7ebb,0x173));var _0xb7eb=function(_0x1d5880,_0x2c3c3a){_0x1d5880=_0x1d5880-0x0;var _0x3ec809=_0x7ebb[_0x1d5880];return _0x3ec809;};'use strict';var _=require(_0xb7eb('0x0'));var util=require('util');var moment=require(_0xb7eb('0x1'));var BPromise=require(_0xb7eb('0x2'));var rs=require(_0xb7eb('0x3'));var fs=require('fs');var Redis=require(_0xb7eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7eb('0x5'));var logger=require(_0xb7eb('0x6'))(_0xb7eb('0x7'));var config=require(_0xb7eb('0x8'));var jayson=require(_0xb7eb('0x9'));var client=jayson[_0xb7eb('0xa')][_0xb7eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f0e31,_0x488a52,_0x2b2cd1){return new BPromise(function(_0x2d6641,_0x399db5){return client[_0xb7eb('0xc')](_0x5f0e31,_0x2b2cd1)[_0xb7eb('0xd')](function(_0x43979b){logger[_0xb7eb('0xe')](_0xb7eb('0xf'),_0x488a52,_0xb7eb('0x10'));logger['debug'](_0xb7eb('0x11'),_0x488a52,'request\x20sent',JSON[_0xb7eb('0x12')](_0x43979b));if(_0x43979b[_0xb7eb('0x13')]){if(_0x43979b[_0xb7eb('0x13')][_0xb7eb('0x14')]===0x1f4){logger[_0xb7eb('0x13')]('ChatApplication,\x20%s,\x20%s',_0x488a52,_0x43979b['error'][_0xb7eb('0x15')]);return _0x399db5(_0x43979b[_0xb7eb('0x13')]['message']);}logger[_0xb7eb('0x13')](_0xb7eb('0xf'),_0x488a52,_0x43979b[_0xb7eb('0x13')][_0xb7eb('0x15')]);return _0x2d6641(_0x43979b[_0xb7eb('0x13')][_0xb7eb('0x15')]);}else{logger[_0xb7eb('0xe')](_0xb7eb('0xf'),_0x488a52,_0xb7eb('0x10'));_0x2d6641(_0x43979b[_0xb7eb('0x16')][_0xb7eb('0x15')]);}})[_0xb7eb('0x17')](function(_0x565bd1){logger[_0xb7eb('0x13')]('ChatApplication,\x20%s,\x20%s',_0x488a52,_0x565bd1);_0x399db5(_0x565bd1);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 8d09a7d..3d721b0 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 _0x20f8=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./chatApplication.controller','get'];(function(_0xcd4c5b,_0x2152b6){var _0x17d55e=function(_0x4ec8db){while(--_0x4ec8db){_0xcd4c5b['push'](_0xcd4c5b['shift']());}};_0x17d55e(++_0x2152b6);}(_0x20f8,0x7f));var _0x820f=function(_0x5272fd,_0x46d398){_0x5272fd=_0x5272fd-0x0;var _0x6b5ca6=_0x20f8[_0x5272fd];return _0x6b5ca6;};'use strict';var multer=require(_0x820f('0x0'));var util=require(_0x820f('0x1'));var path=require(_0x820f('0x2'));var timeout=require('connect-timeout');var express=require(_0x820f('0x3'));var router=express[_0x820f('0x4')]();var fs_extra=require(_0x820f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x820f('0x6'));var controller=require(_0x820f('0x7'));router[_0x820f('0x8')](_0x820f('0x9'),auth[_0x820f('0xa')](),controller[_0x820f('0xb')]);router[_0x820f('0xc')](_0x820f('0x9'),auth['isAuthenticated'](),controller[_0x820f('0xd')]);router[_0x820f('0xe')](_0x820f('0x9'),auth[_0x820f('0xa')](),controller[_0x820f('0xf')]);module[_0x820f('0x10')]=router; \ No newline at end of file +var _0x7a3d=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util'];(function(_0x4cd3db,_0x28e2a0){var _0x20135a=function(_0x27cdca){while(--_0x27cdca){_0x4cd3db['push'](_0x4cd3db['shift']());}};_0x20135a(++_0x28e2a0);}(_0x7a3d,0x1ae));var _0xd7a3=function(_0x5b95d8,_0x5b0636){_0x5b95d8=_0x5b95d8-0x0;var _0x22bcec=_0x7a3d[_0x5b95d8];return _0x22bcec;};'use strict';var multer=require(_0xd7a3('0x0'));var util=require(_0xd7a3('0x1'));var path=require('path');var timeout=require(_0xd7a3('0x2'));var express=require(_0xd7a3('0x3'));var router=express[_0xd7a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd7a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a3('0x6'));var controller=require(_0xd7a3('0x7'));router[_0xd7a3('0x8')](_0xd7a3('0x9'),auth[_0xd7a3('0xa')](),controller[_0xd7a3('0xb')]);router[_0xd7a3('0xc')]('/:id',auth[_0xd7a3('0xa')](),controller['update']);router[_0xd7a3('0xd')](_0xd7a3('0x9'),auth[_0xd7a3('0xa')](),controller[_0xd7a3('0xe')]);module[_0xd7a3('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c4abeb1..94ab670 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 _0x0599=['STRING','BOOLEAN'];(function(_0x579e23,_0x4d36e0){var _0x212c64=function(_0x2d5faf){while(--_0x2d5faf){_0x579e23['push'](_0x579e23['shift']());}};_0x212c64(++_0x4d36e0);}(_0x0599,0x120));var _0x9059=function(_0x2f9fe8,_0x51b63c){_0x2f9fe8=_0x2f9fe8-0x0;var _0x217a81=_0x0599[_0x2f9fe8];return _0x217a81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9059('0x0')]},'write':{'type':Sequelize[_0x9059('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3336=['BOOLEAN','sequelize','STRING'];(function(_0x161ab6,_0x51ee5c){var _0x437d12=function(_0x38002d){while(--_0x38002d){_0x161ab6['push'](_0x161ab6['shift']());}};_0x437d12(++_0x51ee5c);}(_0x3336,0x106));var _0x6333=function(_0x4b1665,_0xb0c095){_0x4b1665=_0x4b1665-0x0;var _0x5850c0=_0x3336[_0x4b1665];return _0x5850c0;};'use strict';var Sequelize=require(_0x6333('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6333('0x1')]},'write':{'type':Sequelize[_0x6333('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index cac5a18..65a5884 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 _0xe8c0=['addMessage','ChatGroupId','getMessages','findOne','pick','$gte','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','removeMembers'];(function(_0x7f424b,_0x31b67f){var _0x379dd0=function(_0x1facbc){while(--_0x1facbc){_0x7f424b['push'](_0x7f424b['shift']());}};_0x379dd0(++_0x31b67f);}(_0xe8c0,0x18a));var _0x0e8c=function(_0x374554,_0x195ff4){_0x374554=_0x374554-0x0;var _0x3e7d05=_0xe8c0[_0x374554];return _0x3e7d05;};'use strict';var emlformat=require(_0x0e8c('0x0'));var rimraf=require(_0x0e8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0e8c('0x2'));var moment=require(_0x0e8c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e8c('0x4'));var util=require(_0x0e8c('0x5'));var path=require(_0x0e8c('0x6'));var sox=require(_0x0e8c('0x7'));var csv=require(_0x0e8c('0x8'));var ejs=require(_0x0e8c('0x9'));var fs=require('fs');var fs_extra=require(_0x0e8c('0xa'));var _=require('lodash');var squel=require(_0x0e8c('0xb'));var crypto=require(_0x0e8c('0xc'));var jsforce=require(_0x0e8c('0xd'));var deskjs=require(_0x0e8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0e8c('0xf'));var Papa=require(_0x0e8c('0x10'));var Redis=require('ioredis');var authService=require(_0x0e8c('0x11'));var qs=require(_0x0e8c('0x12'));var as=require(_0x0e8c('0x13'));var hardwareService=require(_0x0e8c('0x14'));var logger=require(_0x0e8c('0x15'))(_0x0e8c('0x16'));var utils=require(_0x0e8c('0x17'));var config=require(_0x0e8c('0x18'));var licenseUtil=require(_0x0e8c('0x19'));var db=require(_0x0e8c('0x1a'))['db'];config['redis']=_['defaults'](config[_0x0e8c('0x1b')],{'host':_0x0e8c('0x1c'),'port':0x18eb});var socket=require(_0x0e8c('0x1d'))(new Redis(config[_0x0e8c('0x1b')]));require(_0x0e8c('0x1e'))['register'](socket);function respondWithStatusCode(_0x101b2f,_0x14eaf8){_0x14eaf8=_0x14eaf8||0xcc;return function(_0x3f82e6){if(_0x3f82e6){return _0x101b2f[_0x0e8c('0x1f')](_0x14eaf8);}return _0x101b2f[_0x0e8c('0x20')](_0x14eaf8)[_0x0e8c('0x21')]();};}function respondWithResult(_0x2b89c3,_0x5ede4e){_0x5ede4e=_0x5ede4e||0xc8;return function(_0x4c9025){if(_0x4c9025){return _0x2b89c3[_0x0e8c('0x20')](_0x5ede4e)[_0x0e8c('0x22')](_0x4c9025);}};}function respondWithFilteredResult(_0x514b48,_0x33cd99){return function(_0x3a3ee6){if(_0x3a3ee6){var _0x5f383d=typeof _0x33cd99['offset']===_0x0e8c('0x23')&&typeof _0x33cd99[_0x0e8c('0x24')]===_0x0e8c('0x23');var _0x27411e=_0x3a3ee6[_0x0e8c('0x25')];var _0x5c7f9e=_0x5f383d?0x0:_0x33cd99[_0x0e8c('0x26')];var _0x7e6090=_0x5f383d?_0x3a3ee6['count']:_0x33cd99[_0x0e8c('0x26')]+_0x33cd99['limit'];var _0x1ef15b;if(_0x7e6090>=_0x27411e){_0x7e6090=_0x27411e;_0x1ef15b=0xc8;}else{_0x1ef15b=0xce;}_0x514b48[_0x0e8c('0x20')](_0x1ef15b);return _0x514b48['set'](_0x0e8c('0x27'),_0x5c7f9e+'-'+_0x7e6090+'/'+_0x27411e)[_0x0e8c('0x22')](_0x3a3ee6);}return null;};}function patchUpdates(_0xe83a90){return function(_0x216fb4){try{jsonpatch[_0x0e8c('0x28')](_0x216fb4,_0xe83a90,!![]);}catch(_0xe34721){return BPromise[_0x0e8c('0x29')](_0xe34721);}return _0x216fb4[_0x0e8c('0x2a')]();};}function saveUpdates(_0x8a212a,_0xb69dad){return function(_0x25a138){if(_0x25a138){return _0x25a138[_0x0e8c('0x2b')](_0x8a212a)[_0x0e8c('0x2c')](function(_0x41e149){return _0x41e149;});}return null;};}function removeEntity(_0xd3b6cd,_0x44df95){return function(_0x2dd8d8){if(_0x2dd8d8){return _0x2dd8d8[_0x0e8c('0x2d')]()[_0x0e8c('0x2c')](function(){_0xd3b6cd['status'](0xcc)[_0x0e8c('0x21')]();});}};}function handleEntityNotFound(_0x44619f,_0x13def7){return function(_0x1158bd){if(!_0x1158bd){_0x44619f['sendStatus'](0x194);}return _0x1158bd;};}function handleError(_0x358b3c,_0x4d7ea9){_0x4d7ea9=_0x4d7ea9||0x1f4;return function(_0x413d4b){logger[_0x0e8c('0x2e')](_0x413d4b[_0x0e8c('0x2f')]);if(_0x413d4b['name']){delete _0x413d4b[_0x0e8c('0x30')];}_0x358b3c['status'](_0x4d7ea9)[_0x0e8c('0x31')](_0x413d4b);};}exports[_0x0e8c('0x32')]=function(_0x257588,_0x2eba7e){var _0xa1de8c={},_0x4824e4={},_0x19a275={'count':0x0,'rows':[]};var _0x5b3519=_[_0x0e8c('0x33')](db[_0x0e8c('0x34')][_0x0e8c('0x35')],function(_0x5ad707){return{'name':_0x5ad707[_0x0e8c('0x36')],'type':_0x5ad707[_0x0e8c('0x37')]['key']};});_0x4824e4[_0x0e8c('0x38')]=_[_0x0e8c('0x33')](_0x5b3519,'name');_0x4824e4[_0x0e8c('0x39')]=_[_0x0e8c('0x3a')](_0x257588['query']);_0x4824e4[_0x0e8c('0x3b')]=_[_0x0e8c('0x3c')](_0x4824e4['model'],_0x4824e4[_0x0e8c('0x39')]);_0xa1de8c[_0x0e8c('0x3d')]=_[_0x0e8c('0x3c')](_0x4824e4[_0x0e8c('0x38')],qs[_0x0e8c('0x3e')](_0x257588['query'][_0x0e8c('0x3e')]));_0xa1de8c[_0x0e8c('0x3d')]=_0xa1de8c[_0x0e8c('0x3d')][_0x0e8c('0x3f')]?_0xa1de8c[_0x0e8c('0x3d')]:_0x4824e4[_0x0e8c('0x38')];if(!_0x257588['query'][_0x0e8c('0x40')](_0x0e8c('0x41'))){_0xa1de8c[_0x0e8c('0x24')]=qs[_0x0e8c('0x24')](_0x257588[_0x0e8c('0x39')][_0x0e8c('0x24')]);_0xa1de8c['offset']=qs['offset'](_0x257588[_0x0e8c('0x39')][_0x0e8c('0x26')]);}_0xa1de8c[_0x0e8c('0x42')]=qs['sort'](_0x257588[_0x0e8c('0x39')][_0x0e8c('0x43')]);_0xa1de8c[_0x0e8c('0x44')]=qs['filters'](_['pick'](_0x257588['query'],_0x4824e4[_0x0e8c('0x3b')]),_0x5b3519);if(_0x257588['query'][_0x0e8c('0x45')]){_0xa1de8c['where']=_[_0x0e8c('0x46')](_0xa1de8c[_0x0e8c('0x44')],{'$or':_[_0x0e8c('0x33')](_0x5b3519,function(_0x5e3ec3){if(_0x5e3ec3[_0x0e8c('0x37')]!=='VIRTUAL'){var _0x2866ef={};_0x2866ef[_0x5e3ec3[_0x0e8c('0x30')]]={'$like':'%'+_0x257588[_0x0e8c('0x39')][_0x0e8c('0x45')]+'%'};return _0x2866ef;}})});}_0xa1de8c=_[_0x0e8c('0x46')]({},_0xa1de8c,_0x257588[_0x0e8c('0x47')]);var _0x5aa54e={'where':_0xa1de8c[_0x0e8c('0x44')]};return db[_0x0e8c('0x34')][_0x0e8c('0x25')](_0x5aa54e)[_0x0e8c('0x2c')](function(_0x2eddf4){_0x19a275[_0x0e8c('0x25')]=_0x2eddf4;if(_0x257588[_0x0e8c('0x39')][_0x0e8c('0x48')]){_0xa1de8c[_0x0e8c('0x49')]=[{'all':!![]}];}return db[_0x0e8c('0x34')][_0x0e8c('0x4a')](_0xa1de8c);})['then'](function(_0x11afe3){_0x19a275[_0x0e8c('0x4b')]=_0x11afe3;return _0x19a275;})[_0x0e8c('0x2c')](respondWithFilteredResult(_0x2eba7e,_0xa1de8c))[_0x0e8c('0x4c')](handleError(_0x2eba7e,null));};exports[_0x0e8c('0x4d')]=function(_0x39883a,_0x1d2fa2){var _0x445edb={'raw':!![],'where':{'id':_0x39883a[_0x0e8c('0x4e')]['id']}},_0x2e4dbe={};_0x2e4dbe[_0x0e8c('0x38')]=_['keys'](db[_0x0e8c('0x34')][_0x0e8c('0x35')]);_0x2e4dbe[_0x0e8c('0x39')]=_[_0x0e8c('0x3a')](_0x39883a['query']);_0x2e4dbe['filters']=_[_0x0e8c('0x3c')](_0x2e4dbe[_0x0e8c('0x38')],_0x2e4dbe[_0x0e8c('0x39')]);_0x445edb['attributes']=_[_0x0e8c('0x3c')](_0x2e4dbe[_0x0e8c('0x38')],qs[_0x0e8c('0x3e')](_0x39883a[_0x0e8c('0x39')][_0x0e8c('0x3e')]));_0x445edb[_0x0e8c('0x3d')]=_0x445edb[_0x0e8c('0x3d')][_0x0e8c('0x3f')]?_0x445edb[_0x0e8c('0x3d')]:_0x2e4dbe[_0x0e8c('0x38')];if(_0x39883a[_0x0e8c('0x39')]['includeAll']){_0x445edb[_0x0e8c('0x49')]=[{'all':!![]}];}_0x445edb=_['merge']({},_0x445edb,_0x39883a['options']);return db[_0x0e8c('0x34')][_0x0e8c('0x4f')](_0x445edb)[_0x0e8c('0x2c')](handleEntityNotFound(_0x1d2fa2,null))[_0x0e8c('0x2c')](respondWithResult(_0x1d2fa2,null))[_0x0e8c('0x4c')](handleError(_0x1d2fa2,null));};exports['create']=function(_0xa17061,_0x2aca6e){return db[_0x0e8c('0x34')][_0x0e8c('0x50')](_0xa17061[_0x0e8c('0x51')],{})[_0x0e8c('0x2c')](respondWithResult(_0x2aca6e,0xc9))[_0x0e8c('0x4c')](handleError(_0x2aca6e,null));};exports[_0x0e8c('0x2b')]=function(_0x393b8f,_0x5eb9f8){if(_0x393b8f[_0x0e8c('0x51')]['id']){delete _0x393b8f['body']['id'];}return db[_0x0e8c('0x34')]['find']({'where':{'id':_0x393b8f[_0x0e8c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5eb9f8,null))[_0x0e8c('0x2c')](saveUpdates(_0x393b8f['body'],null))[_0x0e8c('0x2c')](respondWithResult(_0x5eb9f8,null))[_0x0e8c('0x4c')](handleError(_0x5eb9f8,null));};exports[_0x0e8c('0x2d')]=function(_0x531720,_0x139f11){return db[_0x0e8c('0x34')][_0x0e8c('0x4f')]({'where':{'id':_0x531720[_0x0e8c('0x4e')]['id']}})[_0x0e8c('0x2c')](handleEntityNotFound(_0x139f11,null))[_0x0e8c('0x2c')](removeEntity(_0x139f11,null))[_0x0e8c('0x4c')](handleError(_0x139f11,null));};exports[_0x0e8c('0x52')]=function(_0x2094b2,_0x36c3f3){return db[_0x0e8c('0x34')][_0x0e8c('0x52')]()[_0x0e8c('0x2c')](respondWithResult(_0x36c3f3,null))[_0x0e8c('0x4c')](handleError(_0x36c3f3,null));};exports[_0x0e8c('0x53')]=function(_0x421ee9,_0x3065b6,_0x273092){return db[_0x0e8c('0x54')]['count']({'where':{'ChatGroupId':_0x421ee9[_0x0e8c('0x4e')]['id'],'ToId':_0x421ee9['user']['id'],'read':![]}})['then'](function(_0x559f35){return{'id':_[_0x0e8c('0x55')](_0x421ee9[_0x0e8c('0x4e')]['id']),'count':_0x559f35};})[_0x0e8c('0x2c')](respondWithResult(_0x3065b6,null))[_0x0e8c('0x4c')](handleError(_0x3065b6,null));};exports['addMembers']=function(_0x3c63b8,_0x57a5b2,_0xfe89b5){return db[_0x0e8c('0x34')][_0x0e8c('0x4f')]({'where':{'id':_0x3c63b8[_0x0e8c('0x4e')]['id']}})[_0x0e8c('0x2c')](handleEntityNotFound(_0x57a5b2,null))[_0x0e8c('0x2c')](function(_0x2743b9){if(_0x2743b9){return _0x2743b9[_0x0e8c('0x56')](_0x3c63b8[_0x0e8c('0x51')][_0x0e8c('0x57')],_[_0x0e8c('0x58')](_0x3c63b8[_0x0e8c('0x51')],[_0x0e8c('0x57'),'id'])||{});}})[_0x0e8c('0x2c')](respondWithResult(_0x57a5b2,null))[_0x0e8c('0x4c')](handleError(_0x57a5b2,null));};exports[_0x0e8c('0x59')]=function(_0x18b2f5,_0x57855c,_0x5d36b6){var _0xc1bda={};var _0x149f80={};var _0x3aa6a4;var _0x424b70;return db[_0x0e8c('0x34')]['findOne']({'where':{'id':_0x18b2f5[_0x0e8c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x57855c,null))[_0x0e8c('0x2c')](function(_0x45d0a6){if(_0x45d0a6){_0x3aa6a4=_0x45d0a6;_0x149f80[_0x0e8c('0x38')]=_[_0x0e8c('0x3a')](db['User'][_0x0e8c('0x35')]);_0x149f80[_0x0e8c('0x39')]=_[_0x0e8c('0x3a')](_0x18b2f5[_0x0e8c('0x39')]);_0x149f80[_0x0e8c('0x3b')]=_['intersection'](_0x149f80[_0x0e8c('0x38')],_0x149f80[_0x0e8c('0x39')]);_0xc1bda['attributes']=_['intersection'](_0x149f80[_0x0e8c('0x38')],qs['fields'](_0x18b2f5['query']['fields']));_0xc1bda[_0x0e8c('0x3d')]=_0xc1bda[_0x0e8c('0x3d')][_0x0e8c('0x3f')]?_0xc1bda[_0x0e8c('0x3d')]:_0x149f80[_0x0e8c('0x38')];_0xc1bda[_0x0e8c('0x42')]=qs[_0x0e8c('0x43')](_0x18b2f5[_0x0e8c('0x39')]['sort']);_0xc1bda[_0x0e8c('0x44')]=qs[_0x0e8c('0x3b')](_['pick'](_0x18b2f5['query'],_0x149f80['filters']));if(_0x18b2f5[_0x0e8c('0x39')][_0x0e8c('0x45')]){_0xc1bda[_0x0e8c('0x44')]=_[_0x0e8c('0x46')](_0xc1bda[_0x0e8c('0x44')],{'$or':_[_0x0e8c('0x33')](_0xc1bda[_0x0e8c('0x3d')],function(_0x4a908e){var _0x26ba71={};_0x26ba71[_0x4a908e]={'$like':'%'+_0x18b2f5[_0x0e8c('0x39')][_0x0e8c('0x45')]+'%'};return _0x26ba71;})});}_0xc1bda=_['merge']({},_0xc1bda,_0x18b2f5['options']);return _0x3aa6a4['getMembers'](_0xc1bda);}})[_0x0e8c('0x2c')](function(_0x5056c9){if(_0x5056c9){_0x424b70=_0x5056c9['length'];if(!_0x18b2f5[_0x0e8c('0x39')][_0x0e8c('0x40')](_0x0e8c('0x41'))){_0xc1bda['limit']=qs['limit'](_0x18b2f5[_0x0e8c('0x39')][_0x0e8c('0x24')]);_0xc1bda[_0x0e8c('0x26')]=qs['offset'](_0x18b2f5[_0x0e8c('0x39')][_0x0e8c('0x26')]);}return _0x3aa6a4[_0x0e8c('0x59')](_0xc1bda);}})['then'](function(_0x824273){if(_0x824273){return _0x824273?{'count':_0x424b70,'rows':_0x824273}:null;}})['then'](respondWithResult(_0x57855c,null))[_0x0e8c('0x4c')](handleError(_0x57855c,null));};exports[_0x0e8c('0x5a')]=function(_0x1ec04a,_0x203535,_0x113b5b){return db[_0x0e8c('0x34')][_0x0e8c('0x4f')]({'where':{'id':_0x1ec04a[_0x0e8c('0x4e')]['id']}})[_0x0e8c('0x2c')](handleEntityNotFound(_0x203535,null))[_0x0e8c('0x2c')](function(_0x553825){if(_0x553825){return _0x553825[_0x0e8c('0x5a')](_0x1ec04a[_0x0e8c('0x39')][_0x0e8c('0x57')]);}})['then'](respondWithStatusCode(_0x203535,null))['catch'](handleError(_0x203535,null));};exports[_0x0e8c('0x5b')]=function(_0xe512a1,_0x201f9b,_0x4964a1){if(_0xe512a1['body']['id']){delete _0xe512a1['body']['id'];}return db[_0x0e8c('0x34')]['find']({'where':{'id':_0xe512a1[_0x0e8c('0x4e')]['id']}})[_0x0e8c('0x2c')](handleEntityNotFound(_0x201f9b,null))[_0x0e8c('0x2c')](function(_0x4f316){if(_0x4f316){_0xe512a1['body'][_0x0e8c('0x5c')]=_0x4f316['id'];return db[_0x0e8c('0x54')][_0x0e8c('0x50')](_0xe512a1[_0x0e8c('0x51')]);}})[_0x0e8c('0x2c')](respondWithResult(_0x201f9b,null))[_0x0e8c('0x4c')](handleError(_0x201f9b,null));};exports[_0x0e8c('0x5d')]=function(_0x17ae6f,_0x1f6ca5,_0x1084ac){var _0x1cf7a5={};var _0x323a17={};var _0x1908f3;var _0xf7dadf;return db[_0x0e8c('0x34')][_0x0e8c('0x5e')]({'where':{'id':_0x17ae6f['params']['id']}})[_0x0e8c('0x2c')](handleEntityNotFound(_0x1f6ca5,null))['then'](function(_0x5c53c7){if(_0x5c53c7){_0x1908f3=_0x5c53c7;_0x323a17['model']=_[_0x0e8c('0x3a')](db[_0x0e8c('0x54')][_0x0e8c('0x35')]);_0x323a17[_0x0e8c('0x39')]=_[_0x0e8c('0x3a')](_0x17ae6f['query']);_0x323a17[_0x0e8c('0x3b')]=_['intersection'](_0x323a17['model'],_0x323a17[_0x0e8c('0x39')]);_0x1cf7a5[_0x0e8c('0x3d')]=_['intersection'](_0x323a17[_0x0e8c('0x38')],qs[_0x0e8c('0x3e')](_0x17ae6f[_0x0e8c('0x39')][_0x0e8c('0x3e')]));_0x1cf7a5[_0x0e8c('0x3d')]=_0x1cf7a5[_0x0e8c('0x3d')][_0x0e8c('0x3f')]?_0x1cf7a5['attributes']:_0x323a17['model'];_0x1cf7a5['order']=qs[_0x0e8c('0x43')](_0x17ae6f[_0x0e8c('0x39')]['sort']);_0x1cf7a5[_0x0e8c('0x44')]=qs['filters'](_[_0x0e8c('0x5f')](_0x17ae6f[_0x0e8c('0x39')],_0x323a17[_0x0e8c('0x3b')]));if(_0x17ae6f[_0x0e8c('0x39')][_0x0e8c('0x45')]){_0x1cf7a5[_0x0e8c('0x44')]=_[_0x0e8c('0x46')](_0x1cf7a5[_0x0e8c('0x44')],{'$or':_[_0x0e8c('0x33')](_0x1cf7a5['attributes'],function(_0x1b0ec4){var _0x3cb8e6={};_0x3cb8e6[_0x1b0ec4]={'$like':'%'+_0x17ae6f[_0x0e8c('0x39')]['filter']+'%'};return _0x3cb8e6;})});}if(_0x17ae6f['query'][_0x0e8c('0x60')]){var _0x16261f=_0x17ae6f[_0x0e8c('0x39')]['$gte']['split'](',');var _0x1e4ca2={};_0x1e4ca2[_0x16261f[0x0]]={'$gte':moment(_0x16261f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cf7a5['where']=_[_0x0e8c('0x46')](_0x1cf7a5[_0x0e8c('0x44')],_0x1e4ca2);}_0x1cf7a5=_[_0x0e8c('0x46')]({},_0x1cf7a5,_0x17ae6f[_0x0e8c('0x47')]);return _0x1908f3['getMessages'](_0x1cf7a5);}})['then'](function(_0x3adb92){if(_0x3adb92){_0xf7dadf=_0x3adb92[_0x0e8c('0x3f')];if(!_0x17ae6f['query'][_0x0e8c('0x40')](_0x0e8c('0x41'))){_0x1cf7a5[_0x0e8c('0x24')]=qs[_0x0e8c('0x24')](_0x17ae6f[_0x0e8c('0x39')][_0x0e8c('0x24')]);_0x1cf7a5[_0x0e8c('0x26')]=qs['offset'](_0x17ae6f[_0x0e8c('0x39')][_0x0e8c('0x26')]);}return _0x1908f3[_0x0e8c('0x5d')](_0x1cf7a5);}})[_0x0e8c('0x2c')](function(_0x3088c8){if(_0x3088c8){return _0x3088c8?{'count':_0xf7dadf,'rows':_0x3088c8}:null;}})['then'](respondWithResult(_0x1f6ca5,null))['catch'](handleError(_0x1f6ca5,null));}; \ No newline at end of file +var _0x600a=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','destroy','then','error','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','pick','nolimit','removeMembers','ChatGroupId','getMessages','split','format'];(function(_0x3349ac,_0x889beb){var _0x18d071=function(_0x2993d3){while(--_0x2993d3){_0x3349ac['push'](_0x3349ac['shift']());}};_0x18d071(++_0x889beb);}(_0x600a,0x1db));var _0xa600=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x600a[_0x31ced5];return _0x10d9e5;};'use strict';var emlformat=require(_0xa600('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa600('0x1'));var jsonpatch=require(_0xa600('0x2'));var rp=require(_0xa600('0x3'));var moment=require(_0xa600('0x4'));var BPromise=require(_0xa600('0x5'));var Mustache=require(_0xa600('0x6'));var util=require(_0xa600('0x7'));var path=require(_0xa600('0x8'));var sox=require(_0xa600('0x9'));var csv=require(_0xa600('0xa'));var ejs=require(_0xa600('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa600('0xc'));var squel=require('squel');var crypto=require(_0xa600('0xd'));var jsforce=require(_0xa600('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa600('0xf'));var Papa=require(_0xa600('0x10'));var Redis=require(_0xa600('0x11'));var authService=require(_0xa600('0x12'));var qs=require(_0xa600('0x13'));var as=require(_0xa600('0x14'));var hardwareService=require(_0xa600('0x15'));var logger=require(_0xa600('0x16'))(_0xa600('0x17'));var utils=require(_0xa600('0x18'));var config=require(_0xa600('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa600('0x1a')]=_[_0xa600('0x1b')](config['redis'],{'host':_0xa600('0x1c'),'port':0x18eb});var socket=require(_0xa600('0x1d'))(new Redis(config[_0xa600('0x1a')]));require(_0xa600('0x1e'))[_0xa600('0x1f')](socket);function respondWithStatusCode(_0x42767a,_0x2b6202){_0x2b6202=_0x2b6202||0xcc;return function(_0x3ac1eb){if(_0x3ac1eb){return _0x42767a[_0xa600('0x20')](_0x2b6202);}return _0x42767a[_0xa600('0x21')](_0x2b6202)[_0xa600('0x22')]();};}function respondWithResult(_0x4e25ec,_0x106dc4){_0x106dc4=_0x106dc4||0xc8;return function(_0x2a2279){if(_0x2a2279){return _0x4e25ec[_0xa600('0x21')](_0x106dc4)['json'](_0x2a2279);}};}function respondWithFilteredResult(_0xcf9e75,_0x1bcba2){return function(_0x2bd9e9){if(_0x2bd9e9){var _0x1f3463=typeof _0x1bcba2[_0xa600('0x23')]===_0xa600('0x24')&&typeof _0x1bcba2[_0xa600('0x25')]===_0xa600('0x24');var _0x3814f4=_0x2bd9e9[_0xa600('0x26')];var _0x393ccb=_0x1f3463?0x0:_0x1bcba2['offset'];var _0x2ecd4b=_0x1f3463?_0x2bd9e9[_0xa600('0x26')]:_0x1bcba2[_0xa600('0x23')]+_0x1bcba2[_0xa600('0x25')];var _0x42292a;if(_0x2ecd4b>=_0x3814f4){_0x2ecd4b=_0x3814f4;_0x42292a=0xc8;}else{_0x42292a=0xce;}_0xcf9e75[_0xa600('0x21')](_0x42292a);return _0xcf9e75[_0xa600('0x27')](_0xa600('0x28'),_0x393ccb+'-'+_0x2ecd4b+'/'+_0x3814f4)[_0xa600('0x29')](_0x2bd9e9);}return null;};}function patchUpdates(_0xae036){return function(_0x92842a){try{jsonpatch['apply'](_0x92842a,_0xae036,!![]);}catch(_0x3f1137){return BPromise['reject'](_0x3f1137);}return _0x92842a[_0xa600('0x2a')]();};}function saveUpdates(_0x3560ad,_0x559726){return function(_0x53eb39){if(_0x53eb39){return _0x53eb39['update'](_0x3560ad)['then'](function(_0x4fd113){return _0x4fd113;});}return null;};}function removeEntity(_0x5cb1c3,_0xb2079b){return function(_0x20a800){if(_0x20a800){return _0x20a800[_0xa600('0x2b')]()[_0xa600('0x2c')](function(){_0x5cb1c3[_0xa600('0x21')](0xcc)[_0xa600('0x22')]();});}};}function handleEntityNotFound(_0x3faf96,_0x18d6bc){return function(_0x4aefb5){if(!_0x4aefb5){_0x3faf96[_0xa600('0x20')](0x194);}return _0x4aefb5;};}function handleError(_0x5358fa,_0x18a196){_0x18a196=_0x18a196||0x1f4;return function(_0x49e982){logger[_0xa600('0x2d')](_0x49e982[_0xa600('0x2e')]);if(_0x49e982[_0xa600('0x2f')]){delete _0x49e982['name'];}_0x5358fa[_0xa600('0x21')](_0x18a196)['send'](_0x49e982);};}exports[_0xa600('0x30')]=function(_0x8d8403,_0x52f7e9){var _0x1d00be={},_0x53cfd4={},_0xb6e33d={'count':0x0,'rows':[]};var _0x441118=_[_0xa600('0x31')](db[_0xa600('0x32')][_0xa600('0x33')],function(_0x1c49ea){return{'name':_0x1c49ea['fieldName'],'type':_0x1c49ea[_0xa600('0x34')][_0xa600('0x35')]};});_0x53cfd4[_0xa600('0x36')]=_['map'](_0x441118,_0xa600('0x2f'));_0x53cfd4[_0xa600('0x37')]=_[_0xa600('0x38')](_0x8d8403['query']);_0x53cfd4[_0xa600('0x39')]=_[_0xa600('0x3a')](_0x53cfd4[_0xa600('0x36')],_0x53cfd4['query']);_0x1d00be['attributes']=_[_0xa600('0x3a')](_0x53cfd4['model'],qs['fields'](_0x8d8403[_0xa600('0x37')][_0xa600('0x3b')]));_0x1d00be[_0xa600('0x3c')]=_0x1d00be[_0xa600('0x3c')][_0xa600('0x3d')]?_0x1d00be[_0xa600('0x3c')]:_0x53cfd4[_0xa600('0x36')];if(!_0x8d8403[_0xa600('0x37')][_0xa600('0x3e')]('nolimit')){_0x1d00be[_0xa600('0x25')]=qs[_0xa600('0x25')](_0x8d8403[_0xa600('0x37')][_0xa600('0x25')]);_0x1d00be[_0xa600('0x23')]=qs[_0xa600('0x23')](_0x8d8403['query']['offset']);}_0x1d00be[_0xa600('0x3f')]=qs[_0xa600('0x40')](_0x8d8403[_0xa600('0x37')][_0xa600('0x40')]);_0x1d00be[_0xa600('0x41')]=qs[_0xa600('0x39')](_['pick'](_0x8d8403[_0xa600('0x37')],_0x53cfd4[_0xa600('0x39')]),_0x441118);if(_0x8d8403[_0xa600('0x37')][_0xa600('0x42')]){_0x1d00be['where']=_[_0xa600('0x43')](_0x1d00be['where'],{'$or':_[_0xa600('0x31')](_0x441118,function(_0x284feb){if(_0x284feb[_0xa600('0x34')]!=='VIRTUAL'){var _0x3456c2={};_0x3456c2[_0x284feb[_0xa600('0x2f')]]={'$like':'%'+_0x8d8403['query'][_0xa600('0x42')]+'%'};return _0x3456c2;}})});}_0x1d00be=_[_0xa600('0x43')]({},_0x1d00be,_0x8d8403[_0xa600('0x44')]);var _0x1e656a={'where':_0x1d00be[_0xa600('0x41')]};return db[_0xa600('0x32')][_0xa600('0x26')](_0x1e656a)['then'](function(_0x2e3c3f){_0xb6e33d[_0xa600('0x26')]=_0x2e3c3f;if(_0x8d8403[_0xa600('0x37')]['includeAll']){_0x1d00be[_0xa600('0x45')]=[{'all':!![]}];}return db[_0xa600('0x32')][_0xa600('0x46')](_0x1d00be);})[_0xa600('0x2c')](function(_0x54abac){_0xb6e33d[_0xa600('0x47')]=_0x54abac;return _0xb6e33d;})[_0xa600('0x2c')](respondWithFilteredResult(_0x52f7e9,_0x1d00be))[_0xa600('0x48')](handleError(_0x52f7e9,null));};exports['show']=function(_0x5e6d0e,_0x351ef1){var _0x3f71dc={'raw':!![],'where':{'id':_0x5e6d0e[_0xa600('0x49')]['id']}},_0x29930b={};_0x29930b[_0xa600('0x36')]=_['keys'](db['ChatGroup'][_0xa600('0x33')]);_0x29930b[_0xa600('0x37')]=_[_0xa600('0x38')](_0x5e6d0e[_0xa600('0x37')]);_0x29930b[_0xa600('0x39')]=_[_0xa600('0x3a')](_0x29930b[_0xa600('0x36')],_0x29930b[_0xa600('0x37')]);_0x3f71dc[_0xa600('0x3c')]=_[_0xa600('0x3a')](_0x29930b[_0xa600('0x36')],qs[_0xa600('0x3b')](_0x5e6d0e[_0xa600('0x37')][_0xa600('0x3b')]));_0x3f71dc[_0xa600('0x3c')]=_0x3f71dc['attributes'][_0xa600('0x3d')]?_0x3f71dc['attributes']:_0x29930b['model'];if(_0x5e6d0e[_0xa600('0x37')][_0xa600('0x4a')]){_0x3f71dc[_0xa600('0x45')]=[{'all':!![]}];}_0x3f71dc=_[_0xa600('0x43')]({},_0x3f71dc,_0x5e6d0e[_0xa600('0x44')]);return db[_0xa600('0x32')][_0xa600('0x4b')](_0x3f71dc)['then'](handleEntityNotFound(_0x351ef1,null))[_0xa600('0x2c')](respondWithResult(_0x351ef1,null))[_0xa600('0x48')](handleError(_0x351ef1,null));};exports['create']=function(_0x3d46d2,_0x3d7db7){return db[_0xa600('0x32')]['create'](_0x3d46d2[_0xa600('0x4c')],{})['then'](respondWithResult(_0x3d7db7,0xc9))[_0xa600('0x48')](handleError(_0x3d7db7,null));};exports['update']=function(_0x2410b5,_0x1a604d){if(_0x2410b5[_0xa600('0x4c')]['id']){delete _0x2410b5[_0xa600('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2410b5['params']['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x1a604d,null))[_0xa600('0x2c')](saveUpdates(_0x2410b5[_0xa600('0x4c')],null))[_0xa600('0x2c')](respondWithResult(_0x1a604d,null))[_0xa600('0x48')](handleError(_0x1a604d,null));};exports['destroy']=function(_0x51f589,_0x423778){return db[_0xa600('0x32')][_0xa600('0x4b')]({'where':{'id':_0x51f589[_0xa600('0x49')]['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x423778,null))['then'](removeEntity(_0x423778,null))['catch'](handleError(_0x423778,null));};exports[_0xa600('0x4d')]=function(_0x3767ff,_0x2d327d){return db['ChatGroup'][_0xa600('0x4d')]()[_0xa600('0x2c')](respondWithResult(_0x2d327d,null))[_0xa600('0x48')](handleError(_0x2d327d,null));};exports[_0xa600('0x4e')]=function(_0x112789,_0x26522a,_0x459813){return db[_0xa600('0x4f')][_0xa600('0x26')]({'where':{'ChatGroupId':_0x112789[_0xa600('0x49')]['id'],'ToId':_0x112789[_0xa600('0x50')]['id'],'read':![]}})[_0xa600('0x2c')](function(_0x5dbc03){return{'id':_[_0xa600('0x51')](_0x112789[_0xa600('0x49')]['id']),'count':_0x5dbc03};})[_0xa600('0x2c')](respondWithResult(_0x26522a,null))[_0xa600('0x48')](handleError(_0x26522a,null));};exports[_0xa600('0x52')]=function(_0x475738,_0x3c5e3f,_0x3d9958){return db[_0xa600('0x32')][_0xa600('0x4b')]({'where':{'id':_0x475738[_0xa600('0x49')]['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x3c5e3f,null))[_0xa600('0x2c')](function(_0x9bbba2){if(_0x9bbba2){return _0x9bbba2[_0xa600('0x52')](_0x475738['body']['ids'],_[_0xa600('0x53')](_0x475738[_0xa600('0x4c')],[_0xa600('0x54'),'id'])||{});}})[_0xa600('0x2c')](respondWithResult(_0x3c5e3f,null))[_0xa600('0x48')](handleError(_0x3c5e3f,null));};exports[_0xa600('0x55')]=function(_0x25aee8,_0x362524,_0x31a344){var _0xbc2bd0={};var _0x542df7={};var _0xdf6523;var _0x2ef18f;return db[_0xa600('0x32')][_0xa600('0x56')]({'where':{'id':_0x25aee8[_0xa600('0x49')]['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x362524,null))[_0xa600('0x2c')](function(_0x2cc28f){if(_0x2cc28f){_0xdf6523=_0x2cc28f;_0x542df7[_0xa600('0x36')]=_[_0xa600('0x38')](db[_0xa600('0x57')]['rawAttributes']);_0x542df7[_0xa600('0x37')]=_[_0xa600('0x38')](_0x25aee8[_0xa600('0x37')]);_0x542df7[_0xa600('0x39')]=_['intersection'](_0x542df7['model'],_0x542df7[_0xa600('0x37')]);_0xbc2bd0[_0xa600('0x3c')]=_[_0xa600('0x3a')](_0x542df7[_0xa600('0x36')],qs[_0xa600('0x3b')](_0x25aee8[_0xa600('0x37')][_0xa600('0x3b')]));_0xbc2bd0['attributes']=_0xbc2bd0[_0xa600('0x3c')][_0xa600('0x3d')]?_0xbc2bd0['attributes']:_0x542df7[_0xa600('0x36')];_0xbc2bd0['order']=qs[_0xa600('0x40')](_0x25aee8[_0xa600('0x37')][_0xa600('0x40')]);_0xbc2bd0['where']=qs[_0xa600('0x39')](_[_0xa600('0x58')](_0x25aee8[_0xa600('0x37')],_0x542df7[_0xa600('0x39')]));if(_0x25aee8['query']['filter']){_0xbc2bd0[_0xa600('0x41')]=_[_0xa600('0x43')](_0xbc2bd0[_0xa600('0x41')],{'$or':_['map'](_0xbc2bd0[_0xa600('0x3c')],function(_0x21bc0e){var _0x2232cd={};_0x2232cd[_0x21bc0e]={'$like':'%'+_0x25aee8['query'][_0xa600('0x42')]+'%'};return _0x2232cd;})});}_0xbc2bd0=_[_0xa600('0x43')]({},_0xbc2bd0,_0x25aee8['options']);return _0xdf6523[_0xa600('0x55')](_0xbc2bd0);}})['then'](function(_0xc68f45){if(_0xc68f45){_0x2ef18f=_0xc68f45[_0xa600('0x3d')];if(!_0x25aee8[_0xa600('0x37')][_0xa600('0x3e')](_0xa600('0x59'))){_0xbc2bd0[_0xa600('0x25')]=qs['limit'](_0x25aee8[_0xa600('0x37')][_0xa600('0x25')]);_0xbc2bd0['offset']=qs[_0xa600('0x23')](_0x25aee8[_0xa600('0x37')][_0xa600('0x23')]);}return _0xdf6523[_0xa600('0x55')](_0xbc2bd0);}})[_0xa600('0x2c')](function(_0x3571ed){if(_0x3571ed){return _0x3571ed?{'count':_0x2ef18f,'rows':_0x3571ed}:null;}})[_0xa600('0x2c')](respondWithResult(_0x362524,null))[_0xa600('0x48')](handleError(_0x362524,null));};exports['removeMembers']=function(_0x406ded,_0x27424a,_0x4f9cb7){return db['ChatGroup'][_0xa600('0x4b')]({'where':{'id':_0x406ded[_0xa600('0x49')]['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x27424a,null))[_0xa600('0x2c')](function(_0x296246){if(_0x296246){return _0x296246[_0xa600('0x5a')](_0x406ded[_0xa600('0x37')][_0xa600('0x54')]);}})[_0xa600('0x2c')](respondWithStatusCode(_0x27424a,null))[_0xa600('0x48')](handleError(_0x27424a,null));};exports['addMessage']=function(_0x5ddd36,_0x26aca1,_0x42cd79){if(_0x5ddd36[_0xa600('0x4c')]['id']){delete _0x5ddd36[_0xa600('0x4c')]['id'];}return db[_0xa600('0x32')]['find']({'where':{'id':_0x5ddd36[_0xa600('0x49')]['id']}})['then'](handleEntityNotFound(_0x26aca1,null))[_0xa600('0x2c')](function(_0x2ef7ef){if(_0x2ef7ef){_0x5ddd36[_0xa600('0x4c')][_0xa600('0x5b')]=_0x2ef7ef['id'];return db[_0xa600('0x4f')]['create'](_0x5ddd36[_0xa600('0x4c')]);}})[_0xa600('0x2c')](respondWithResult(_0x26aca1,null))[_0xa600('0x48')](handleError(_0x26aca1,null));};exports[_0xa600('0x5c')]=function(_0x22daaf,_0x499917,_0x4caf9d){var _0x577be4={};var _0x495210={};var _0x11cf19;var _0x3652d6;return db[_0xa600('0x32')][_0xa600('0x56')]({'where':{'id':_0x22daaf[_0xa600('0x49')]['id']}})[_0xa600('0x2c')](handleEntityNotFound(_0x499917,null))[_0xa600('0x2c')](function(_0x5f2ee8){if(_0x5f2ee8){_0x11cf19=_0x5f2ee8;_0x495210[_0xa600('0x36')]=_['keys'](db[_0xa600('0x4f')][_0xa600('0x33')]);_0x495210['query']=_['keys'](_0x22daaf[_0xa600('0x37')]);_0x495210[_0xa600('0x39')]=_['intersection'](_0x495210[_0xa600('0x36')],_0x495210['query']);_0x577be4['attributes']=_[_0xa600('0x3a')](_0x495210['model'],qs[_0xa600('0x3b')](_0x22daaf[_0xa600('0x37')]['fields']));_0x577be4[_0xa600('0x3c')]=_0x577be4[_0xa600('0x3c')]['length']?_0x577be4['attributes']:_0x495210['model'];_0x577be4[_0xa600('0x3f')]=qs['sort'](_0x22daaf['query'][_0xa600('0x40')]);_0x577be4[_0xa600('0x41')]=qs[_0xa600('0x39')](_[_0xa600('0x58')](_0x22daaf[_0xa600('0x37')],_0x495210[_0xa600('0x39')]));if(_0x22daaf[_0xa600('0x37')]['filter']){_0x577be4[_0xa600('0x41')]=_[_0xa600('0x43')](_0x577be4[_0xa600('0x41')],{'$or':_[_0xa600('0x31')](_0x577be4['attributes'],function(_0x2d5b1d){var _0xe468d3={};_0xe468d3[_0x2d5b1d]={'$like':'%'+_0x22daaf[_0xa600('0x37')][_0xa600('0x42')]+'%'};return _0xe468d3;})});}if(_0x22daaf['query']['$gte']){var _0x3c1637=_0x22daaf[_0xa600('0x37')]['$gte'][_0xa600('0x5d')](',');var _0x430f29={};_0x430f29[_0x3c1637[0x0]]={'$gte':moment(_0x3c1637[0x1])[_0xa600('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x577be4[_0xa600('0x41')]=_[_0xa600('0x43')](_0x577be4[_0xa600('0x41')],_0x430f29);}_0x577be4=_[_0xa600('0x43')]({},_0x577be4,_0x22daaf[_0xa600('0x44')]);return _0x11cf19[_0xa600('0x5c')](_0x577be4);}})[_0xa600('0x2c')](function(_0x3be568){if(_0x3be568){_0x3652d6=_0x3be568[_0xa600('0x3d')];if(!_0x22daaf[_0xa600('0x37')]['hasOwnProperty']('nolimit')){_0x577be4[_0xa600('0x25')]=qs[_0xa600('0x25')](_0x22daaf['query'][_0xa600('0x25')]);_0x577be4[_0xa600('0x23')]=qs[_0xa600('0x23')](_0x22daaf[_0xa600('0x37')][_0xa600('0x23')]);}return _0x11cf19[_0xa600('0x5c')](_0x577be4);}})['then'](function(_0x38b20c){if(_0x38b20c){return _0x38b20c?{'count':_0x3652d6,'rows':_0x38b20c}:null;}})[_0xa600('0x2c')](respondWithResult(_0x499917,null))[_0xa600('0x48')](handleError(_0x499917,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6830d6e..ffe8218 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 _0x720f=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','hasOwnProperty','exports'];(function(_0x1da7b,_0x3ce5ec){var _0x4bf8e3=function(_0x21bed2){while(--_0x21bed2){_0x1da7b['push'](_0x1da7b['shift']());}};_0x4bf8e3(++_0x3ce5ec);}(_0x720f,0x80));var _0xf720=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x720f[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xf720('0x0'))['db'][_0xf720('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf720('0x2')](0x0);var events={'afterCreate':_0xf720('0x3'),'afterUpdate':_0xf720('0x4'),'afterDestroy':_0xf720('0x5')};function emitEvent(_0x5b4c09){return function(_0x2e722c,_0x57bb58,_0x54ac80){ChatGroupEvents['emit'](_0x5b4c09+':'+_0x2e722c['id'],_0x2e722c);ChatGroupEvents['emit'](_0x5b4c09,_0x2e722c);_0x54ac80(null);};}for(var e in events){if(events[_0xf720('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xf720('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x1477=['exports','events','../../mysqldb','ChatGroup','save','update','emit','hasOwnProperty','hook'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1477,0x14e));var _0x7147=function(_0x1000d6,_0x478b06){_0x1000d6=_0x1000d6-0x0;var _0x4f610d=_0x1477[_0x1000d6];return _0x4f610d;};'use strict';var EventEmitter=require(_0x7147('0x0'));var ChatGroup=require(_0x7147('0x1'))['db'][_0x7147('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7147('0x3'),'afterUpdate':_0x7147('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7d699c){return function(_0x2af5a8,_0x13b9d5,_0x285c95){ChatGroupEvents[_0x7147('0x5')](_0x7d699c+':'+_0x2af5a8['id'],_0x2af5a8);ChatGroupEvents[_0x7147('0x5')](_0x7d699c,_0x2af5a8);_0x285c95(null);};}for(var e in events){if(events[_0x7147('0x6')](e)){var event=events[e];ChatGroup[_0x7147('0x7')](e,emitEvent(event));}}module[_0x7147('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index a3c868f..00af4ec 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 _0x2eb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api'];(function(_0xf2d1bf,_0x19c53a){var _0x388d2c=function(_0x217e55){while(--_0x217e55){_0xf2d1bf['push'](_0xf2d1bf['shift']());}};_0x388d2c(++_0x19c53a);}(_0x2eb1,0xda));var _0x12eb=function(_0x2d4d28,_0x52e3db){_0x2d4d28=_0x2d4d28-0x0;var _0x3043fd=_0x2eb1[_0x2d4d28];return _0x3043fd;};'use strict';var _=require(_0x12eb('0x0'));var util=require('util');var logger=require(_0x12eb('0x1'))(_0x12eb('0x2'));var moment=require(_0x12eb('0x3'));var BPromise=require(_0x12eb('0x4'));var rp=require(_0x12eb('0x5'));var fs=require('fs');var path=require(_0x12eb('0x6'));var rimraf=require(_0x12eb('0x7'));var config=require(_0x12eb('0x8'));var attributes=require('./chatGroup.attributes');module[_0x12eb('0x9')]=function(_0x801152,_0x35f031){return _0x801152[_0x12eb('0xa')](_0x12eb('0xb'),attributes,{'tableName':_0x12eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2d=['util','api','moment','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x11cfca,_0x4f3bc6){var _0x2c8cd6=function(_0x490261){while(--_0x490261){_0x11cfca['push'](_0x11cfca['shift']());}};_0x2c8cd6(++_0x4f3bc6);}(_0x9a2d,0x15f));var _0xd9a2=function(_0x50e43,_0x1f4bef){_0x50e43=_0x50e43-0x0;var _0x763566=_0x9a2d[_0x50e43];return _0x763566;};'use strict';var _=require(_0xd9a2('0x0'));var util=require(_0xd9a2('0x1'));var logger=require('../../config/logger')(_0xd9a2('0x2'));var moment=require(_0xd9a2('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9a2('0x4'));var fs=require('fs');var path=require(_0xd9a2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd9a2('0x6'));module[_0xd9a2('0x7')]=function(_0x3d856f,_0x2d191c){return _0x3d856f[_0xd9a2('0x8')](_0xd9a2('0x9'),attributes,{'tableName':_0xd9a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 542bcd5..c75f031 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 _0x5977=['socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3f67ea,_0x2c70e5){var _0x573b10=function(_0x5ac259){while(--_0x5ac259){_0x3f67ea['push'](_0x3f67ea['shift']());}};_0x573b10(++_0x2c70e5);}(_0x5977,0xe1));var _0x7597=function(_0x562d57,_0x2dce57){_0x562d57=_0x562d57-0x0;var _0x15a781=_0x5977[_0x562d57];return _0x15a781;};'use strict';var _=require(_0x7597('0x0'));var util=require(_0x7597('0x1'));var moment=require(_0x7597('0x2'));var BPromise=require(_0x7597('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7597('0x4'));var db=require(_0x7597('0x5'))['db'];var utils=require(_0x7597('0x6'));var logger=require('../../config/logger')(_0x7597('0x7'));var config=require(_0x7597('0x8'));var jayson=require(_0x7597('0x9'));var client=jayson[_0x7597('0xa')][_0x7597('0xb')]({'port':0x232a});config[_0x7597('0xc')]=_[_0x7597('0xd')](config[_0x7597('0xc')],{'host':_0x7597('0xe'),'port':0x18eb});var socket=require(_0x7597('0xf'))(new Redis(config[_0x7597('0xc')]));require('./chatGroup.socket')[_0x7597('0x10')](socket);function respondWithRpcPromise(_0x41e623,_0x1cae93,_0x180d34){return new BPromise(function(_0x1a1872,_0x3bc316){return client[_0x7597('0x11')](_0x41e623,_0x180d34)[_0x7597('0x12')](function(_0x147925){logger[_0x7597('0x13')](_0x7597('0x14'),_0x1cae93,'request\x20sent');logger[_0x7597('0x15')](_0x7597('0x16'),_0x1cae93,_0x7597('0x17'),JSON[_0x7597('0x18')](_0x147925));if(_0x147925[_0x7597('0x19')]){if(_0x147925['error'][_0x7597('0x1a')]===0x1f4){logger[_0x7597('0x19')]('ChatGroup,\x20%s,\x20%s',_0x1cae93,_0x147925[_0x7597('0x19')][_0x7597('0x1b')]);return _0x3bc316(_0x147925[_0x7597('0x19')][_0x7597('0x1b')]);}logger[_0x7597('0x19')](_0x7597('0x14'),_0x1cae93,_0x147925[_0x7597('0x19')][_0x7597('0x1b')]);return _0x1a1872(_0x147925['error']['message']);}else{logger[_0x7597('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1cae93,_0x7597('0x17'));_0x1a1872(_0x147925[_0x7597('0x1c')][_0x7597('0x1b')]);}})[_0x7597('0x1d')](function(_0x4751f2){logger['error'](_0x7597('0x14'),_0x1cae93,_0x4751f2);_0x3bc316(_0x4751f2);});});} \ No newline at end of file +var _0xa1a5=['code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd553ab,_0x788918){var _0x215442=function(_0x5b32f8){while(--_0x5b32f8){_0xd553ab['push'](_0xd553ab['shift']());}};_0x215442(++_0x788918);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x25f9c6,_0x421e54){_0x25f9c6=_0x25f9c6-0x0;var _0x1c691e=_0xa1a5[_0x25f9c6];return _0x1c691e;};'use strict';var _=require(_0x5a1a('0x0'));var util=require('util');var moment=require(_0x5a1a('0x1'));var BPromise=require(_0x5a1a('0x2'));var rs=require(_0x5a1a('0x3'));var fs=require('fs');var Redis=require(_0x5a1a('0x4'));var db=require(_0x5a1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a1a('0x6'))(_0x5a1a('0x7'));var config=require(_0x5a1a('0x8'));var jayson=require(_0x5a1a('0x9'));var client=jayson[_0x5a1a('0xa')][_0x5a1a('0xb')]({'port':0x232a});config[_0x5a1a('0xc')]=_['defaults'](config[_0x5a1a('0xc')],{'host':_0x5a1a('0xd'),'port':0x18eb});var socket=require(_0x5a1a('0xe'))(new Redis(config[_0x5a1a('0xc')]));require(_0x5a1a('0xf'))[_0x5a1a('0x10')](socket);function respondWithRpcPromise(_0x450879,_0x45cf06,_0x761a91){return new BPromise(function(_0x57c5ca,_0x403112){return client[_0x5a1a('0x11')](_0x450879,_0x761a91)[_0x5a1a('0x12')](function(_0x4c9226){logger[_0x5a1a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x45cf06,'request\x20sent');logger['debug'](_0x5a1a('0x14'),_0x45cf06,_0x5a1a('0x15'),JSON[_0x5a1a('0x16')](_0x4c9226));if(_0x4c9226[_0x5a1a('0x17')]){if(_0x4c9226['error'][_0x5a1a('0x18')]===0x1f4){logger[_0x5a1a('0x17')]('ChatGroup,\x20%s,\x20%s',_0x45cf06,_0x4c9226[_0x5a1a('0x17')][_0x5a1a('0x19')]);return _0x403112(_0x4c9226[_0x5a1a('0x17')]['message']);}logger[_0x5a1a('0x17')](_0x5a1a('0x1a'),_0x45cf06,_0x4c9226[_0x5a1a('0x17')][_0x5a1a('0x19')]);return _0x57c5ca(_0x4c9226[_0x5a1a('0x17')][_0x5a1a('0x19')]);}else{logger[_0x5a1a('0x13')](_0x5a1a('0x1a'),_0x45cf06,'request\x20sent');_0x57c5ca(_0x4c9226[_0x5a1a('0x1b')][_0x5a1a('0x19')]);}})[_0x5a1a('0x1c')](function(_0x2c8ee9){logger[_0x5a1a('0x17')](_0x5a1a('0x1a'),_0x45cf06,_0x2c8ee9);_0x403112(_0x2c8ee9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 30e5129..7c1de56 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 _0xdf18=['save','remove','update','length','chatGroup:','./chatGroup.events'];(function(_0x98d5f5,_0x12ea21){var _0x2826d3=function(_0x2e16b3){while(--_0x2e16b3){_0x98d5f5['push'](_0x98d5f5['shift']());}};_0x2826d3(++_0x12ea21);}(_0xdf18,0x12b));var _0x8df1=function(_0x5be7ff,_0x1c701b){_0x5be7ff=_0x5be7ff-0x0;var _0x5e851d=_0xdf18[_0x5be7ff];return _0x5e851d;};'use strict';var ChatGroupEvents=require(_0x8df1('0x0'));var events=[_0x8df1('0x1'),_0x8df1('0x2'),_0x8df1('0x3')];function createListener(_0x3c7d11,_0x5bce0f){return function(_0x165a73){_0x5bce0f['emit'](_0x3c7d11,_0x165a73);};}function removeListener(_0x3a685b,_0x2e916d){return function(){ChatGroupEvents['removeListener'](_0x3a685b,_0x2e916d);};}exports['register']=function(_0x2cb5fa){for(var _0x31d17e=0x0,_0x260c8d=events[_0x8df1('0x4')];_0x31d17e<_0x260c8d;_0x31d17e++){var _0x36ac9b=events[_0x31d17e];var _0x35f276=createListener(_0x8df1('0x5')+_0x36ac9b,_0x2cb5fa);ChatGroupEvents['on'](_0x36ac9b,_0x35f276);}}; \ No newline at end of file +var _0x664f=['chatGroup:','./chatGroup.events','save','update','emit','register'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x664f,0x1c3));var _0xf664=function(_0x3b2035,_0x375ce8){_0x3b2035=_0x3b2035-0x0;var _0x161ca3=_0x664f[_0x3b2035];return _0x161ca3;};'use strict';var ChatGroupEvents=require(_0xf664('0x0'));var events=[_0xf664('0x1'),'remove',_0xf664('0x2')];function createListener(_0x545323,_0x470164){return function(_0x59fd2a){_0x470164[_0xf664('0x3')](_0x545323,_0x59fd2a);};}function removeListener(_0x26e898,_0x1183c6){return function(){ChatGroupEvents['removeListener'](_0x26e898,_0x1183c6);};}exports[_0xf664('0x4')]=function(_0x46d4e7){for(var _0x27c703=0x0,_0x51aa5b=events['length'];_0x27c703<_0x51aa5b;_0x27c703++){var _0x53f3d2=events[_0x27c703];var _0x1bdb0a=createListener(_0xf664('0x5')+_0x53f3d2,_0x46d4e7);ChatGroupEvents['on'](_0x53f3d2,_0x1bdb0a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 768d74f..d7acd97 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 _0xd63d=['/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show'];(function(_0x4f8919,_0x24be23){var _0x44d54a=function(_0x44518e){while(--_0x44518e){_0x4f8919['push'](_0x4f8919['shift']());}};_0x44d54a(++_0x24be23);}(_0xd63d,0x8f));var _0xdd63=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xd63d[_0x4347ec];return _0x4c8314;};'use strict';var multer=require(_0xdd63('0x0'));var util=require('util');var path=require(_0xdd63('0x1'));var timeout=require(_0xdd63('0x2'));var express=require(_0xdd63('0x3'));var router=express[_0xdd63('0x4')]();var fs_extra=require(_0xdd63('0x5'));var auth=require(_0xdd63('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdd63('0x7'));var controller=require('./chatGroup.controller');router[_0xdd63('0x8')]('/',auth[_0xdd63('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdd63('0xa')]);router[_0xdd63('0x8')](_0xdd63('0xb'),auth[_0xdd63('0x9')](),controller[_0xdd63('0xc')]);router[_0xdd63('0x8')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0xdd63('0x8')](_0xdd63('0xd'),auth[_0xdd63('0x9')](),controller[_0xdd63('0xe')]);router[_0xdd63('0x8')](_0xdd63('0xf'),auth[_0xdd63('0x9')](),controller[_0xdd63('0x10')]);router[_0xdd63('0x11')]('/',auth['isAuthenticated'](),controller[_0xdd63('0x12')]);router[_0xdd63('0x11')](_0xdd63('0xd'),auth[_0xdd63('0x9')](),controller[_0xdd63('0x13')]);router[_0xdd63('0x11')]('/:id/messages',auth[_0xdd63('0x9')](),controller['addMessage']);router[_0xdd63('0x14')](_0xdd63('0xb'),auth['isAuthenticated'](),controller[_0xdd63('0x15')]);router[_0xdd63('0x16')]('/:id',auth[_0xdd63('0x9')](),controller[_0xdd63('0x17')]);router[_0xdd63('0x16')]('/:id/members',auth[_0xdd63('0x9')](),controller[_0xdd63('0x18')]);module[_0xdd63('0x19')]=router; \ No newline at end of file +var _0xca96=['get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0xca96,0xc3));var _0x6ca9=function(_0xfb71c0,_0xde60c5){_0xfb71c0=_0xfb71c0-0x0;var _0x251060=_0xca96[_0xfb71c0];return _0x251060;};'use strict';var multer=require(_0x6ca9('0x0'));var util=require('util');var path=require(_0x6ca9('0x1'));var timeout=require(_0x6ca9('0x2'));var express=require('express');var router=express[_0x6ca9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca9('0x4'));var interaction=require(_0x6ca9('0x5'));var config=require(_0x6ca9('0x6'));var controller=require(_0x6ca9('0x7'));router[_0x6ca9('0x8')]('/',auth[_0x6ca9('0x9')](),controller['index']);router['get'](_0x6ca9('0xa'),auth[_0x6ca9('0x9')](),controller[_0x6ca9('0xb')]);router['get'](_0x6ca9('0xc'),auth[_0x6ca9('0x9')](),controller[_0x6ca9('0xd')]);router[_0x6ca9('0x8')](_0x6ca9('0xe'),auth['isAuthenticated'](),controller[_0x6ca9('0xf')]);router[_0x6ca9('0x8')]('/:id/members',auth[_0x6ca9('0x9')](),controller[_0x6ca9('0x10')]);router[_0x6ca9('0x8')](_0x6ca9('0x11'),auth[_0x6ca9('0x9')](),controller['getMessages']);router[_0x6ca9('0x12')]('/',auth['isAuthenticated'](),controller[_0x6ca9('0x13')]);router[_0x6ca9('0x12')](_0x6ca9('0x14'),auth['isAuthenticated'](),controller[_0x6ca9('0x15')]);router['post'](_0x6ca9('0x11'),auth['isAuthenticated'](),controller[_0x6ca9('0x16')]);router[_0x6ca9('0x17')](_0x6ca9('0xc'),auth[_0x6ca9('0x9')](),controller[_0x6ca9('0x18')]);router['delete'](_0x6ca9('0xc'),auth[_0x6ca9('0x9')](),controller[_0x6ca9('0x19')]);router[_0x6ca9('0x1a')](_0x6ca9('0x14'),auth[_0x6ca9('0x9')](),controller[_0x6ca9('0x1b')]);module[_0x6ca9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3ddc332..f62747a 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 _0x6c50=['STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','star','TEXT'];(function(_0x3bcbc6,_0x303850){var _0x3a6389=function(_0x599abe){while(--_0x599abe){_0x3bcbc6['push'](_0x3bcbc6['shift']());}};_0x3a6389(++_0x303850);}(_0x6c50,0xa4));var _0x06c5=function(_0x54c414,_0x51b0a2){_0x54c414=_0x54c414-0x0;var _0x5befc1=_0x6c50[_0x54c414];return _0x5befc1;};'use strict';var Sequelize=require(_0x06c5('0x0'));module[_0x06c5('0x1')]={'closed':{'type':Sequelize[_0x06c5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x06c5('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x06c5('0x4'),'thumb'),'defaultValue':_0x06c5('0x4')},'ratingMessage':{'type':Sequelize[_0x06c5('0x5')]},'pathTranscript':{'type':Sequelize[_0x06c5('0x5')]},'mailTranscript':{'type':Sequelize[_0x06c5('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x06c5('0x7')]},'disposition':{'type':Sequelize[_0x06c5('0x6')]},'secondDisposition':{'type':Sequelize[_0x06c5('0x6')]},'thirdDisposition':{'type':Sequelize[_0x06c5('0x6')]},'note':{'type':Sequelize[_0x06c5('0x6')]},'browserName':{'type':Sequelize[_0x06c5('0x6')]},'browserVersion':{'type':Sequelize[_0x06c5('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x06c5('0x6')]},'deviceModel':{'type':Sequelize[_0x06c5('0x6')]},'deviceVendor':{'type':Sequelize[_0x06c5('0x6')]},'deviceType':{'type':Sequelize[_0x06c5('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x06c5('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06c5('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x06c5('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x06c5('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x06c5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7072=['long','out','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE'];(function(_0x2a275e,_0x5aa79b){var _0x2287fe=function(_0x2f2a70){while(--_0x2f2a70){_0x2a275e['push'](_0x2a275e['shift']());}};_0x2287fe(++_0x5aa79b);}(_0x7072,0x138));var _0x2707=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7072[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'closed':{'type':Sequelize[_0x2707('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2707('0x2')]},'ratingType':{'type':Sequelize[_0x2707('0x3')](_0x2707('0x4'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2707('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2707('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2707('0x7')]},'disposition':{'type':Sequelize[_0x2707('0x6')]},'secondDisposition':{'type':Sequelize[_0x2707('0x6')]},'thirdDisposition':{'type':Sequelize[_0x2707('0x6')]},'note':{'type':Sequelize[_0x2707('0x6')]},'browserName':{'type':Sequelize[_0x2707('0x6')]},'browserVersion':{'type':Sequelize[_0x2707('0x6')]},'osName':{'type':Sequelize[_0x2707('0x6')]},'osVersion':{'type':Sequelize[_0x2707('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2707('0x6')]},'referer':{'type':Sequelize[_0x2707('0x5')]},'customerIp':{'type':Sequelize[_0x2707('0x6')]},'formData':{'type':Sequelize[_0x2707('0x5')](_0x2707('0x8'))},'read1stAt':{'type':Sequelize[_0x2707('0x7')]},'lastMsgAt':{'type':Sequelize[_0x2707('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x2707('0x3')]('in',_0x2707('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2707('0x6')]},'customerPort':{'type':Sequelize[_0x2707('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x2707('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x2707('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 1894025..7fda6f7 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 _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(_0x129db3,_0x4c7c55){var _0x13d665=function(_0x5cb77c){while(--_0x5cb77c){_0x129db3['push'](_0x129db3['shift']());}};_0x13d665(++_0x4c7c55);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'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 +var _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','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','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x087b,0x11a));var _0xb087=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x087b[_0x47a349];return _0x18ab75;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['field']('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',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 29070be..2dac5b3 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 _0x8781=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch'];(function(_0x1780b8,_0x24ed2e){var _0x14147a=function(_0x2f4172){while(--_0x2f4172){_0x1780b8['push'](_0x1780b8['shift']());}};_0x14147a(++_0x24ed2e);}(_0x8781,0x7b));var _0x1878=function(_0x2ac152,_0x583280){_0x2ac152=_0x2ac152-0x0;var _0x4a6970=_0x8781[_0x2ac152];return _0x4a6970;};'use strict';var EventEmitter=require(_0x1878('0x0'));var ChatInteraction=require(_0x1878('0x1'))['db'][_0x1878('0x2')];var ChatMessage=require(_0x1878('0x1'))['db'][_0x1878('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1878('0x4')](0x0);var events={'afterCreate':_0x1878('0x5'),'afterUpdate':_0x1878('0x6'),'afterDestroy':'remove'};function emitEvent(_0x473703){return function(_0x5a1088,_0x3df251,_0x3d2ade){_0x5a1088[_0x1878('0x7')]({'attributes':['id'],'raw':!![]})[_0x1878('0x8')](function(_0xc11c53){_0x5a1088[_0x1878('0x9')](_0x1878('0xa'),_0xc11c53[_0x1878('0xb')](function(_0x57c850){return{'id':_0x57c850['id']};}));return ChatMessage[_0x1878('0xc')]({'where':{'ChatInteractionId':_0x5a1088['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1878('0x8')](function(_0x27fa75){_0x5a1088[_0x1878('0x9')](_0x1878('0xd'),_0x27fa75[_0x1878('0xe')]);ChatInteractionEvents[_0x1878('0xf')](_0x473703+':'+_0x5a1088['id'],_0x5a1088);ChatInteractionEvents[_0x1878('0xf')](_0x473703,_0x5a1088);_0x3d2ade(null);})[_0x1878('0x10')](_0x3d2ade(null));};}for(var e in events){if(events[_0x1878('0x11')](e)){var event=events[e];ChatInteraction[_0x1878('0x12')](e,emitEvent(event));}}module[_0x1878('0x13')]=ChatInteractionEvents; \ No newline at end of file +var _0xbbcb=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','remove'];(function(_0x113e24,_0x1ebde6){var _0x3726b4=function(_0x403809){while(--_0x403809){_0x113e24['push'](_0x113e24['shift']());}};_0x3726b4(++_0x1ebde6);}(_0xbbcb,0x11a));var _0xbbbc=function(_0x66bb4d,_0x1c878d){_0x66bb4d=_0x66bb4d-0x0;var _0x3eb339=_0xbbcb[_0x66bb4d];return _0x3eb339;};'use strict';var EventEmitter=require(_0xbbbc('0x0'));var ChatInteraction=require(_0xbbbc('0x1'))['db'][_0xbbbc('0x2')];var ChatMessage=require(_0xbbbc('0x1'))['db'][_0xbbbc('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbbbc('0x4'),'afterUpdate':'update','afterDestroy':_0xbbbc('0x5')};function emitEvent(_0x21398f){return function(_0x46d0b1,_0x4e9c7f,_0x5ca20a){_0x46d0b1[_0xbbbc('0x6')]({'attributes':['id'],'raw':!![]})[_0xbbbc('0x7')](function(_0x1c8fb3){_0x46d0b1[_0xbbbc('0x8')](_0xbbbc('0x9'),_0x1c8fb3[_0xbbbc('0xa')](function(_0xc05d35){return{'id':_0xc05d35['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x46d0b1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbbbc('0x7')](function(_0x4ba585){_0x46d0b1[_0xbbbc('0x8')](_0xbbbc('0xb'),_0x4ba585[_0xbbbc('0xc')]);ChatInteractionEvents[_0xbbbc('0xd')](_0x21398f+':'+_0x46d0b1['id'],_0x46d0b1);ChatInteractionEvents[_0xbbbc('0xd')](_0x21398f,_0x46d0b1);_0x5ca20a(null);})[_0xbbbc('0xe')](_0x5ca20a(null));};}for(var e in events){if(events[_0xbbbc('0xf')](e)){var event=events[e];ChatInteraction[_0xbbbc('0x10')](e,emitEvent(event));}}module[_0xbbbc('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index bf10f49..c8393d2 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 _0x8ba7=['format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','changed','closed'];(function(_0xb95dfb,_0xa089c9){var _0x8742e8=function(_0x146dca){while(--_0x146dca){_0xb95dfb['push'](_0xb95dfb['shift']());}};_0x8742e8(++_0xa089c9);}(_0x8ba7,0x1a3));var _0x78ba=function(_0x1f2d06,_0x38d815){_0x1f2d06=_0x1f2d06-0x0;var _0x17667c=_0x8ba7[_0x1f2d06];return _0x17667c;};'use strict';var _=require(_0x78ba('0x0'));var util=require(_0x78ba('0x1'));var logger=require(_0x78ba('0x2'))('api');var moment=require(_0x78ba('0x3'));var BPromise=require('bluebird');var rp=require(_0x78ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78ba('0x5'));var config=require(_0x78ba('0x6'));var attributes=require(_0x78ba('0x7'));module['exports']=function(_0x467bd4,_0xf45041){return _0x467bd4['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db54e,_0x19ce38,_0x5caf62){if(_0x2db54e[_0x78ba('0x8')](_0x78ba('0x9'))){_0x2db54e['closedAt']=moment()[_0x78ba('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5caf62(null,_0x2db54e);}},'charset':_0x78ba('0xb'),'collate':_0x78ba('0xc')});}; \ No newline at end of file +var _0x3bcf=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt'];(function(_0x3a44e4,_0x3ab711){var _0x2c94c1=function(_0x5cd32d){while(--_0x5cd32d){_0x3a44e4['push'](_0x3a44e4['shift']());}};_0x2c94c1(++_0x3ab711);}(_0x3bcf,0xb8));var _0xf3bc=function(_0x5093cd,_0x58aeb2){_0x5093cd=_0x5093cd-0x0;var _0x24c7df=_0x3bcf[_0x5093cd];return _0x24c7df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf3bc('0x0'))(_0xf3bc('0x1'));var moment=require(_0xf3bc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3bc('0x3'));var rimraf=require('rimraf');var config=require(_0xf3bc('0x4'));var attributes=require(_0xf3bc('0x5'));module['exports']=function(_0x237e20,_0x2bbfac){return _0x237e20[_0xf3bc('0x6')](_0xf3bc('0x7'),attributes,{'tableName':_0xf3bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x254d4e,_0xd5f397,_0x33e605){if(_0x254d4e['changed'](_0xf3bc('0x9'))){_0x254d4e[_0xf3bc('0xa')]=moment()[_0xf3bc('0xb')](_0xf3bc('0xc'));}_0x33e605(null,_0x254d4e);}},'charset':_0xf3bc('0xd'),'collate':_0xf3bc('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 4f6e90e..907964f 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 _0x5f07=['UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','then','stringify','catch','AddTagsToChatInteraction','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0x18ac2f,_0x402911){var _0x18a5ab=function(_0x40a002){while(--_0x40a002){_0x18ac2f['push'](_0x18ac2f['shift']());}};_0x18a5ab(++_0x402911);}(_0x5f07,0x84));var _0x75f0=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x5f07[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x75f0('0x0'));var util=require(_0x75f0('0x1'));var moment=require('moment');var BPromise=require(_0x75f0('0x2'));var rs=require(_0x75f0('0x3'));var fs=require('fs');var Redis=require(_0x75f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x75f0('0x5'));var logger=require('../../config/logger')(_0x75f0('0x6'));var config=require(_0x75f0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x75f0('0x8')]({'port':0x232a});config[_0x75f0('0x9')]=_[_0x75f0('0xa')](config[_0x75f0('0x9')],{'host':_0x75f0('0xb'),'port':0x18eb});var socket=require(_0x75f0('0xc'))(new Redis(config[_0x75f0('0x9')]));require(_0x75f0('0xd'))[_0x75f0('0xe')](socket);function respondWithRpcPromise(_0x49f591,_0x412d60,_0x17e172){return new BPromise(function(_0x461d5c,_0x3acf79){return client[_0x75f0('0xf')](_0x49f591,_0x17e172)['then'](function(_0x3b3027){logger['info'](_0x75f0('0x10'),_0x412d60,'request\x20sent');logger[_0x75f0('0x11')](_0x75f0('0x12'),_0x412d60,_0x75f0('0x13'),JSON['stringify'](_0x3b3027));if(_0x3b3027[_0x75f0('0x14')]){if(_0x3b3027['error']['code']===0x1f4){logger[_0x75f0('0x14')](_0x75f0('0x10'),_0x412d60,_0x3b3027[_0x75f0('0x14')][_0x75f0('0x15')]);return _0x3acf79(_0x3b3027[_0x75f0('0x14')][_0x75f0('0x15')]);}logger[_0x75f0('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x412d60,_0x3b3027['error'][_0x75f0('0x15')]);return _0x461d5c(_0x3b3027[_0x75f0('0x14')][_0x75f0('0x15')]);}else{logger[_0x75f0('0x16')](_0x75f0('0x10'),_0x412d60,_0x75f0('0x13'));_0x461d5c(_0x3b3027[_0x75f0('0x17')]['message']);}})['catch'](function(_0x576fa6){logger[_0x75f0('0x14')](_0x75f0('0x10'),_0x412d60,_0x576fa6);_0x3acf79(_0x576fa6);});});}exports[_0x75f0('0x18')]=function(_0xf28c82){var _0x35c356=this;return new Promise(function(_0x400f9a,_0x3d5b51){return db[_0x75f0('0x19')][_0x75f0('0x1a')](_0xf28c82[_0x75f0('0x1b')],{'raw':_0xf28c82[_0x75f0('0x1c')]?_0xf28c82[_0x75f0('0x1c')][_0x75f0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf28c82[_0x75f0('0x1c')]?_0xf28c82[_0x75f0('0x1c')]['where']||null:null,'attributes':_0xf28c82[_0x75f0('0x1c')]?_0xf28c82[_0x75f0('0x1c')][_0x75f0('0x1e')]||null:null,'limit':_0xf28c82[_0x75f0('0x1c')]?_0xf28c82[_0x75f0('0x1c')][_0x75f0('0x1f')]||null:null})[_0x75f0('0x20')](function(_0x1fe1b6){logger[_0x75f0('0x16')](_0x75f0('0x18'),_0xf28c82);logger[_0x75f0('0x11')](_0x75f0('0x18'),_0xf28c82,JSON[_0x75f0('0x21')](_0x1fe1b6));_0x400f9a(_0x1fe1b6);})[_0x75f0('0x22')](function(_0x382125){logger[_0x75f0('0x14')](_0x75f0('0x18'),_0x382125[_0x75f0('0x15')],_0xf28c82);_0x3d5b51(_0x35c356[_0x75f0('0x14')](0x1f4,_0x382125[_0x75f0('0x15')]));});});};exports[_0x75f0('0x23')]=function(_0xe3516e){return new Promise(function(_0x4a8b79,_0x5e200a){return db[_0x75f0('0x19')]['find']({'where':_0xe3516e[_0x75f0('0x1c')]?_0xe3516e[_0x75f0('0x1c')]['where']||null:null})[_0x75f0('0x20')](function(_0x330404){if(_0x330404){return _0x330404['addTags'](_0xe3516e[_0x75f0('0x1b')]['ids'],_['omit'](_0xe3516e[_0x75f0('0x1b')],[_0x75f0('0x24'),'id'])||{});}})[_0x75f0('0x25')](function(_0x950915){logger[_0x75f0('0x16')](_0x75f0('0x26'),_0xe3516e);logger[_0x75f0('0x11')](_0x75f0('0x26'),_0xe3516e,JSON[_0x75f0('0x21')](_0x950915));_0x4a8b79(_0x950915);})[_0x75f0('0x22')](function(_0x4d873f){logger[_0x75f0('0x14')](_0x75f0('0x26'),_0x4d873f[_0x75f0('0x15')],_0xe3516e);_0x5e200a(_this[_0x75f0('0x14')](0x1f4,_0x4d873f['message']));});});}; \ No newline at end of file +var _0x5439=['body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction'];(function(_0x265f5a,_0x535037){var _0x3ccaf2=function(_0x34a5a8){while(--_0x34a5a8){_0x265f5a['push'](_0x265f5a['shift']());}};_0x3ccaf2(++_0x535037);}(_0x5439,0xf3));var _0x9543=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5439[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9543('0x0'));var util=require(_0x9543('0x1'));var moment=require(_0x9543('0x2'));var BPromise=require(_0x9543('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9543('0x4'));var db=require(_0x9543('0x5'))['db'];var utils=require(_0x9543('0x6'));var logger=require(_0x9543('0x7'))(_0x9543('0x8'));var config=require(_0x9543('0x9'));var jayson=require(_0x9543('0xa'));var client=jayson[_0x9543('0xb')][_0x9543('0xc')]({'port':0x232a});config[_0x9543('0xd')]=_[_0x9543('0xe')](config['redis'],{'host':_0x9543('0xf'),'port':0x18eb});var socket=require(_0x9543('0x10'))(new Redis(config[_0x9543('0xd')]));require(_0x9543('0x11'))['register'](socket);function respondWithRpcPromise(_0x563f3b,_0x7bf666,_0x412ee3){return new BPromise(function(_0x573c92,_0x569628){return client[_0x9543('0x12')](_0x563f3b,_0x412ee3)[_0x9543('0x13')](function(_0x36fb80){logger[_0x9543('0x14')](_0x9543('0x15'),_0x7bf666,'request\x20sent');logger[_0x9543('0x16')](_0x9543('0x17'),_0x7bf666,_0x9543('0x18'),JSON[_0x9543('0x19')](_0x36fb80));if(_0x36fb80[_0x9543('0x1a')]){if(_0x36fb80[_0x9543('0x1a')][_0x9543('0x1b')]===0x1f4){logger[_0x9543('0x1a')](_0x9543('0x15'),_0x7bf666,_0x36fb80[_0x9543('0x1a')][_0x9543('0x1c')]);return _0x569628(_0x36fb80['error']['message']);}logger[_0x9543('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x7bf666,_0x36fb80[_0x9543('0x1a')]['message']);return _0x573c92(_0x36fb80[_0x9543('0x1a')]['message']);}else{logger['info'](_0x9543('0x15'),_0x7bf666,_0x9543('0x18'));_0x573c92(_0x36fb80[_0x9543('0x1d')]['message']);}})[_0x9543('0x1e')](function(_0x563546){logger[_0x9543('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x7bf666,_0x563546);_0x569628(_0x563546);});});}exports[_0x9543('0x1f')]=function(_0x5069a7){var _0x2636bb=this;return new Promise(function(_0x4ef95e,_0x4d9d3d){return db[_0x9543('0x20')]['update'](_0x5069a7[_0x9543('0x21')],{'raw':_0x5069a7['options']?_0x5069a7[_0x9543('0x22')][_0x9543('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5069a7[_0x9543('0x22')]?_0x5069a7[_0x9543('0x22')][_0x9543('0x24')]||null:null,'attributes':_0x5069a7[_0x9543('0x22')]?_0x5069a7['options'][_0x9543('0x25')]||null:null,'limit':_0x5069a7[_0x9543('0x22')]?_0x5069a7[_0x9543('0x22')][_0x9543('0x26')]||null:null})[_0x9543('0x13')](function(_0x37cb2c){logger['info']('UpdateChatInteraction',_0x5069a7);logger[_0x9543('0x16')](_0x9543('0x1f'),_0x5069a7,JSON[_0x9543('0x19')](_0x37cb2c));_0x4ef95e(_0x37cb2c);})['catch'](function(_0x33bd7a){logger['error'](_0x9543('0x1f'),_0x33bd7a[_0x9543('0x1c')],_0x5069a7);_0x4d9d3d(_0x2636bb['error'](0x1f4,_0x33bd7a[_0x9543('0x1c')]));});});};exports[_0x9543('0x27')]=function(_0x21a852){return new Promise(function(_0x152fab,_0x1cbef1){return db[_0x9543('0x20')][_0x9543('0x28')]({'where':_0x21a852[_0x9543('0x22')]?_0x21a852[_0x9543('0x22')][_0x9543('0x24')]||null:null})[_0x9543('0x13')](function(_0x31fe2a){if(_0x31fe2a){return _0x31fe2a[_0x9543('0x29')](_0x21a852[_0x9543('0x21')]['ids'],_[_0x9543('0x2a')](_0x21a852[_0x9543('0x21')],[_0x9543('0x2b'),'id'])||{});}})[_0x9543('0x2c')](function(_0x384463){logger[_0x9543('0x14')]('AddTags',_0x21a852);logger[_0x9543('0x16')](_0x9543('0x2d'),_0x21a852,JSON['stringify'](_0x384463));_0x152fab(_0x384463);})[_0x9543('0x1e')](function(_0x532caf){logger[_0x9543('0x1a')](_0x9543('0x2d'),_0x532caf[_0x9543('0x1c')],_0x21a852);_0x1cbef1(_this[_0x9543('0x1a')](0x1f4,_0x532caf[_0x9543('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8e4ed68..fb7d485 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 _0xf53f=['update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x41ce4d,_0x275a09){var _0x41fa90=function(_0x2d5da0){while(--_0x2d5da0){_0x41ce4d['push'](_0x41ce4d['shift']());}};_0x41fa90(++_0x275a09);}(_0xf53f,0x8d));var _0xff53=function(_0x3608b5,_0x4d3561){_0x3608b5=_0x3608b5-0x0;var _0x30adb7=_0xf53f[_0x3608b5];return _0x30adb7;};'use strict';var ChatInteractionEvents=require(_0xff53('0x0'));var events=[_0xff53('0x1'),_0xff53('0x2'),_0xff53('0x3')];function createListener(_0x3b48fc,_0x4afcd){return function(_0x492e12){_0x4afcd[_0xff53('0x4')](_0x3b48fc,_0x492e12);};}function removeListener(_0x18b504,_0x2077b9){return function(){ChatInteractionEvents[_0xff53('0x5')](_0x18b504,_0x2077b9);};}exports[_0xff53('0x6')]=function(_0x54d39c){for(var _0x54e637=0x0,_0x27b397=events['length'];_0x54e637<_0x27b397;_0x54e637++){var _0x1c27bb=events[_0x54e637];var _0x122746=createListener(_0xff53('0x7')+_0x1c27bb,_0x54d39c);ChatInteractionEvents['on'](_0x1c27bb,_0x122746);}}; \ No newline at end of file +var _0x38b4=['length','./chatInteraction.events','remove','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x38b4,0x6d));var _0x438b=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x38b4[_0x515afd];return _0x536d53;};'use strict';var ChatInteractionEvents=require(_0x438b('0x0'));var events=['save',_0x438b('0x1'),'update'];function createListener(_0x4d8bf0,_0x5a04ed){return function(_0x23131a){_0x5a04ed[_0x438b('0x2')](_0x4d8bf0,_0x23131a);};}function removeListener(_0x420272,_0x478f03){return function(){ChatInteractionEvents[_0x438b('0x3')](_0x420272,_0x478f03);};}exports[_0x438b('0x4')]=function(_0xb97519){for(var _0x4f3e50=0x0,_0x1945c7=events[_0x438b('0x5')];_0x4f3e50<_0x1945c7;_0x4f3e50++){var _0x20d3df=events[_0x4f3e50];var _0x18e26c=createListener('chatInteraction:'+_0x20d3df,_0xb97519);ChatInteractionEvents['on'](_0x20d3df,_0x18e26c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ea05fdb..65d1c90 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 _0x3c57=['isChatInteractionAuthorized','show','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x3c57,0x14f));var _0x73c5=function(_0x182e16,_0x3214b3){_0x182e16=_0x182e16-0x0;var _0x56035a=_0x3c57[_0x182e16];return _0x56035a;};'use strict';var multer=require(_0x73c5('0x0'));var util=require('util');var path=require(_0x73c5('0x1'));var timeout=require(_0x73c5('0x2'));var express=require(_0x73c5('0x3'));var router=express[_0x73c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x73c5('0x5'));var interaction=require(_0x73c5('0x6'));var config=require(_0x73c5('0x7'));var controller=require(_0x73c5('0x8'));router[_0x73c5('0x9')]('/',auth[_0x73c5('0xa')](),controller[_0x73c5('0xb')]);router['get'](_0x73c5('0xc'),auth[_0x73c5('0xa')](),controller[_0x73c5('0xd')]);router[_0x73c5('0x9')](_0x73c5('0xe'),auth[_0x73c5('0xf')](),controller[_0x73c5('0x10')]);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x73c5('0x9')]('/:id/messages',auth[_0x73c5('0xa')](),controller[_0x73c5('0x11')]);router[_0x73c5('0x9')](_0x73c5('0x12'),auth[_0x73c5('0xf')](),controller[_0x73c5('0x13')]);router['get']('/:id/download',auth[_0x73c5('0xa')](),controller[_0x73c5('0x14')]);router['post']('/',auth[_0x73c5('0xa')](),controller['create']);router[_0x73c5('0x15')](_0x73c5('0x16'),auth[_0x73c5('0xa')](),controller[_0x73c5('0x17')]);var upload=multer({'storage':multer[_0x73c5('0x18')]({'destination':function(_0x4ca7aa,_0x24d0de,_0x5c43cf){_0x5c43cf(null,path['join'](config[_0x73c5('0x19')],'server/files/attachments/'));},'filename':function(_0x29e896,_0x5ca30a,_0x59c7eb){_0x59c7eb(null,util[_0x73c5('0x1a')]('%s-%s',Date[_0x73c5('0x1b')](),_0x5ca30a[_0x73c5('0x1c')][_0x73c5('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x73c5('0x15')](_0x73c5('0x1e'),upload[_0x73c5('0x1f')](_0x73c5('0x20')),controller[_0x73c5('0x21')]);router[_0x73c5('0x15')]('/:id/messages',auth[_0x73c5('0xf')](),controller[_0x73c5('0x22')]);router[_0x73c5('0x15')](_0x73c5('0x23'),auth[_0x73c5('0xa')](),interaction[_0x73c5('0x24')]('chat','chatinteraction:addtags'),controller[_0x73c5('0x25')]);router[_0x73c5('0x26')](_0x73c5('0xe'),auth[_0x73c5('0xa')](),interaction[_0x73c5('0x24')](_0x73c5('0x27'),_0x73c5('0x28')),controller[_0x73c5('0x29')]);router[_0x73c5('0x26')](_0x73c5('0x2a'),controller['customUpdate']);router[_0x73c5('0x26')](_0x73c5('0x2b'),auth[_0x73c5('0xf')](),controller['abandon']);router['put'](_0x73c5('0x2c'),controller[_0x73c5('0x2d')]);router[_0x73c5('0x2e')]('/:id',auth[_0x73c5('0xa')](),interaction['tracked'](_0x73c5('0x27'),_0x73c5('0x2f')),controller['destroy']);router[_0x73c5('0x2e')](_0x73c5('0x23'),auth[_0x73c5('0xa')](),controller[_0x73c5('0x30')]);module[_0x73c5('0x31')]=router; \ No newline at end of file +var _0x4a2a=['root','%s-%s','now','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','createVidaooSession','diskStorage'];(function(_0xc5c58e,_0x46de8e){var _0x88f119=function(_0x5c7dd2){while(--_0x5c7dd2){_0xc5c58e['push'](_0xc5c58e['shift']());}};_0x88f119(++_0x46de8e);}(_0x4a2a,0x7b));var _0xa4a2=function(_0x19bff6,_0x27bb81){_0x19bff6=_0x19bff6-0x0;var _0x3e9294=_0x4a2a[_0x19bff6];return _0x3e9294;};'use strict';var multer=require('multer');var util=require(_0xa4a2('0x0'));var path=require('path');var timeout=require(_0xa4a2('0x1'));var express=require(_0xa4a2('0x2'));var router=express[_0xa4a2('0x3')]();var fs_extra=require(_0xa4a2('0x4'));var auth=require(_0xa4a2('0x5'));var interaction=require(_0xa4a2('0x6'));var config=require(_0xa4a2('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x9')]);router[_0xa4a2('0xa')](_0xa4a2('0xb'),auth[_0xa4a2('0x8')](),controller[_0xa4a2('0xc')]);router[_0xa4a2('0xa')](_0xa4a2('0xd'),auth[_0xa4a2('0xe')](),controller[_0xa4a2('0xf')]);router[_0xa4a2('0xa')]('/:id/attachment_download',auth[_0xa4a2('0xe')](),controller[_0xa4a2('0x10')]);router['get'](_0xa4a2('0x11'),auth['isAuthenticated'](),controller[_0xa4a2('0x12')]);router[_0xa4a2('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xa4a2('0x13')]);router[_0xa4a2('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa4a2('0x14')]);router[_0xa4a2('0x15')]('/',auth[_0xa4a2('0x8')](),controller['create']);router[_0xa4a2('0x15')]('/:id/vidaoo',auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x16')]);var upload=multer({'storage':multer[_0xa4a2('0x17')]({'destination':function(_0x23b8dc,_0x368949,_0x5f28f2){_0x5f28f2(null,path['join'](config[_0xa4a2('0x18')],'server/files/attachments/'));},'filename':function(_0xeca2e0,_0x5b2180,_0x5623d7){_0x5623d7(null,util['format'](_0xa4a2('0x19'),Date[_0xa4a2('0x1a')](),_0x5b2180['originalname'][_0xa4a2('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa4a2('0x1c'),upload[_0xa4a2('0x1d')](_0xa4a2('0x1e')),controller['attachmentUpload']);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xa4a2('0x1f')]);router[_0xa4a2('0x15')](_0xa4a2('0x20'),auth[_0xa4a2('0x8')](),interaction[_0xa4a2('0x21')](_0xa4a2('0x22'),_0xa4a2('0x23')),controller[_0xa4a2('0x24')]);router[_0xa4a2('0x25')](_0xa4a2('0xd'),auth[_0xa4a2('0x8')](),interaction[_0xa4a2('0x21')]('chat',_0xa4a2('0x26')),controller[_0xa4a2('0x27')]);router[_0xa4a2('0x25')](_0xa4a2('0x28'),controller[_0xa4a2('0x29')]);router[_0xa4a2('0x25')](_0xa4a2('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0xa4a2('0x2b')]);router[_0xa4a2('0x25')](_0xa4a2('0x2c'),controller[_0xa4a2('0x2d')]);router[_0xa4a2('0x2e')](_0xa4a2('0xd'),auth[_0xa4a2('0x8')](),interaction[_0xa4a2('0x21')](_0xa4a2('0x22'),_0xa4a2('0x2f')),controller['destroy']);router[_0xa4a2('0x2e')]('/:id/tags',auth[_0xa4a2('0x8')](),controller[_0xa4a2('0x30')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 9606395..5652890 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 _0x301f=['INTEGER','sequelize','exports','TEXT','medium'];(function(_0x93ee5d,_0x1cb13a){var _0x15e735=function(_0x3587e7){while(--_0x3587e7){_0x93ee5d['push'](_0x93ee5d['shift']());}};_0x15e735(++_0x1cb13a);}(_0x301f,0x1eb));var _0xf301=function(_0x8d0102,_0x2b5fb1){_0x8d0102=_0x8d0102-0x0;var _0x57e9e0=_0x301f[_0x8d0102];return _0x57e9e0;};'use strict';var Sequelize=require(_0xf301('0x0'));module[_0xf301('0x1')]={'body':{'type':Sequelize[_0xf301('0x2')](_0xf301('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf301('0x4')]}}; \ No newline at end of file +var _0x1bba=['BOOLEAN','exports','TEXT'];(function(_0x468b32,_0xbc8ca6){var _0x3ac9a8=function(_0x378d21){while(--_0x378d21){_0x468b32['push'](_0x468b32['shift']());}};_0x3ac9a8(++_0xbc8ca6);}(_0x1bba,0x151));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa1bb('0x0')]={'body':{'type':Sequelize[_0xa1bb('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa1bb('0x2')],'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 079cbe3..982ac8a 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 _0x45eb=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x567077,_0x375bc2){var _0x4d15b8=function(_0x166312){while(--_0x166312){_0x567077['push'](_0x567077['shift']());}};_0x4d15b8(++_0x375bc2);}(_0x45eb,0x140));var _0xb45e=function(_0x35f1ab,_0x427d19){_0x35f1ab=_0x35f1ab-0x0;var _0x53fa2a=_0x45eb[_0x35f1ab];return _0x53fa2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb45e('0x0'));var zipdir=require(_0xb45e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb45e('0x2'));var moment=require('moment');var BPromise=require(_0xb45e('0x3'));var Mustache=require(_0xb45e('0x4'));var util=require(_0xb45e('0x5'));var path=require(_0xb45e('0x6'));var sox=require(_0xb45e('0x7'));var csv=require('to-csv');var ejs=require(_0xb45e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb45e('0x9'));var squel=require('squel');var crypto=require(_0xb45e('0xa'));var jsforce=require(_0xb45e('0xb'));var deskjs=require(_0xb45e('0xc'));var toCsv=require(_0xb45e('0xd'));var querystring=require(_0xb45e('0xe'));var Papa=require(_0xb45e('0xf'));var Redis=require('ioredis');var authService=require(_0xb45e('0x10'));var qs=require(_0xb45e('0x11'));var as=require(_0xb45e('0x12'));var hardwareService=require(_0xb45e('0x13'));var logger=require(_0xb45e('0x14'))('api');var utils=require(_0xb45e('0x15'));var config=require(_0xb45e('0x16'));var licenseUtil=require(_0xb45e('0x17'));var db=require(_0xb45e('0x18'))['db'];config['redis']=_[_0xb45e('0x19')](config[_0xb45e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb45e('0x1b'))(new Redis(config[_0xb45e('0x1a')]));require(_0xb45e('0x1c'))[_0xb45e('0x1d')](socket);function respondWithStatusCode(_0x5a86e5,_0x41a02b){_0x41a02b=_0x41a02b||0xcc;return function(_0x195702){if(_0x195702){return _0x5a86e5[_0xb45e('0x1e')](_0x41a02b);}return _0x5a86e5['status'](_0x41a02b)[_0xb45e('0x1f')]();};}function respondWithResult(_0x13a1a8,_0xf581c5){_0xf581c5=_0xf581c5||0xc8;return function(_0x1c6933){if(_0x1c6933){return _0x13a1a8['status'](_0xf581c5)[_0xb45e('0x20')](_0x1c6933);}};}function respondWithFilteredResult(_0x517adb,_0x22433e){return function(_0x1cfc48){if(_0x1cfc48){var _0x5c924f=typeof _0x22433e[_0xb45e('0x21')]===_0xb45e('0x22')&&typeof _0x22433e[_0xb45e('0x23')]===_0xb45e('0x22');var _0x262d31=_0x1cfc48[_0xb45e('0x24')];var _0x2a5a70=_0x5c924f?0x0:_0x22433e[_0xb45e('0x21')];var _0x2a0985=_0x5c924f?_0x1cfc48['count']:_0x22433e[_0xb45e('0x21')]+_0x22433e[_0xb45e('0x23')];var _0x5be604;if(_0x2a0985>=_0x262d31){_0x2a0985=_0x262d31;_0x5be604=0xc8;}else{_0x5be604=0xce;}_0x517adb[_0xb45e('0x25')](_0x5be604);return _0x517adb[_0xb45e('0x26')]('Content-Range',_0x2a5a70+'-'+_0x2a0985+'/'+_0x262d31)[_0xb45e('0x20')](_0x1cfc48);}return null;};}function patchUpdates(_0x3aadeb){return function(_0xc8bcac){try{jsonpatch[_0xb45e('0x27')](_0xc8bcac,_0x3aadeb,!![]);}catch(_0x65513e){return BPromise['reject'](_0x65513e);}return _0xc8bcac[_0xb45e('0x28')]();};}function saveUpdates(_0x2a9dfb,_0x509280){return function(_0x10362c){if(_0x10362c){return _0x10362c[_0xb45e('0x29')](_0x2a9dfb)[_0xb45e('0x2a')](function(_0x1e03d2){return _0x1e03d2;});}return null;};}function removeEntity(_0x505383,_0x501399){return function(_0x34ad50){if(_0x34ad50){return _0x34ad50[_0xb45e('0x2b')]()[_0xb45e('0x2a')](function(){_0x505383['status'](0xcc)[_0xb45e('0x1f')]();});}};}function handleEntityNotFound(_0xcc95c5,_0x47c930){return function(_0x26b2a8){if(!_0x26b2a8){_0xcc95c5['sendStatus'](0x194);}return _0x26b2a8;};}function handleError(_0x10c16c,_0x365acc){_0x365acc=_0x365acc||0x1f4;return function(_0x32f0a6){logger[_0xb45e('0x2c')](_0x32f0a6[_0xb45e('0x2d')]);if(_0x32f0a6[_0xb45e('0x2e')]){delete _0x32f0a6[_0xb45e('0x2e')];}_0x10c16c[_0xb45e('0x25')](_0x365acc)['send'](_0x32f0a6);};}exports['index']=function(_0x30b023,_0x1f228b){var _0x5660fe={},_0x4e0af2={},_0x70745a={'count':0x0,'rows':[]};var _0x36274b=_[_0xb45e('0x2f')](db[_0xb45e('0x30')][_0xb45e('0x31')],function(_0x15c411){return{'name':_0x15c411[_0xb45e('0x32')],'type':_0x15c411[_0xb45e('0x33')]['key']};});_0x4e0af2[_0xb45e('0x34')]=_['map'](_0x36274b,'name');_0x4e0af2[_0xb45e('0x35')]=_[_0xb45e('0x36')](_0x30b023['query']);_0x4e0af2['filters']=_[_0xb45e('0x37')](_0x4e0af2[_0xb45e('0x34')],_0x4e0af2[_0xb45e('0x35')]);_0x5660fe[_0xb45e('0x38')]=_['intersection'](_0x4e0af2[_0xb45e('0x34')],qs[_0xb45e('0x39')](_0x30b023[_0xb45e('0x35')][_0xb45e('0x39')]));_0x5660fe[_0xb45e('0x38')]=_0x5660fe[_0xb45e('0x38')]['length']?_0x5660fe[_0xb45e('0x38')]:_0x4e0af2[_0xb45e('0x34')];if(!_0x30b023[_0xb45e('0x35')][_0xb45e('0x3a')](_0xb45e('0x3b'))){_0x5660fe['limit']=qs['limit'](_0x30b023[_0xb45e('0x35')][_0xb45e('0x23')]);_0x5660fe['offset']=qs[_0xb45e('0x21')](_0x30b023[_0xb45e('0x35')][_0xb45e('0x21')]);}_0x5660fe['order']=qs[_0xb45e('0x3c')](_0x30b023[_0xb45e('0x35')][_0xb45e('0x3c')]);_0x5660fe['where']=qs[_0xb45e('0x3d')](_['pick'](_0x30b023[_0xb45e('0x35')],_0x4e0af2[_0xb45e('0x3d')]),_0x36274b);if(_0x30b023[_0xb45e('0x35')][_0xb45e('0x3e')]){_0x5660fe[_0xb45e('0x3f')]=_[_0xb45e('0x40')](_0x5660fe[_0xb45e('0x3f')],{'$or':_[_0xb45e('0x2f')](_0x36274b,function(_0x37d2a0){if(_0x37d2a0['type']!==_0xb45e('0x41')){var _0x571569={};_0x571569[_0x37d2a0[_0xb45e('0x2e')]]={'$like':'%'+_0x30b023[_0xb45e('0x35')][_0xb45e('0x3e')]+'%'};return _0x571569;}})});}_0x5660fe=_[_0xb45e('0x40')]({},_0x5660fe,_0x30b023['options']);var _0x1b9d6e={'where':_0x5660fe['where']};return db[_0xb45e('0x30')][_0xb45e('0x24')](_0x1b9d6e)[_0xb45e('0x2a')](function(_0x1f2bab){_0x70745a[_0xb45e('0x24')]=_0x1f2bab;if(_0x30b023[_0xb45e('0x35')][_0xb45e('0x42')]){_0x5660fe[_0xb45e('0x43')]=[{'all':!![]}];}return db[_0xb45e('0x30')][_0xb45e('0x44')](_0x5660fe);})[_0xb45e('0x2a')](function(_0x4e5b4f){_0x70745a[_0xb45e('0x45')]=_0x4e5b4f;return _0x70745a;})['then'](respondWithFilteredResult(_0x1f228b,_0x5660fe))[_0xb45e('0x46')](handleError(_0x1f228b,null));};exports[_0xb45e('0x47')]=function(_0x3af22c,_0xc86e4b){var _0x360658={'raw':!![],'where':{'id':_0x3af22c['params']['id']}},_0x4d01bf={};_0x4d01bf[_0xb45e('0x34')]=_[_0xb45e('0x36')](db[_0xb45e('0x30')][_0xb45e('0x31')]);_0x4d01bf[_0xb45e('0x35')]=_[_0xb45e('0x36')](_0x3af22c[_0xb45e('0x35')]);_0x4d01bf[_0xb45e('0x3d')]=_[_0xb45e('0x37')](_0x4d01bf[_0xb45e('0x34')],_0x4d01bf[_0xb45e('0x35')]);_0x360658[_0xb45e('0x38')]=_[_0xb45e('0x37')](_0x4d01bf[_0xb45e('0x34')],qs[_0xb45e('0x39')](_0x3af22c['query']['fields']));_0x360658[_0xb45e('0x38')]=_0x360658[_0xb45e('0x38')][_0xb45e('0x48')]?_0x360658['attributes']:_0x4d01bf[_0xb45e('0x34')];if(_0x3af22c[_0xb45e('0x35')][_0xb45e('0x42')]){_0x360658['include']=[{'all':!![]}];}_0x360658=_[_0xb45e('0x40')]({},_0x360658,_0x3af22c[_0xb45e('0x49')]);return db[_0xb45e('0x30')][_0xb45e('0x4a')](_0x360658)[_0xb45e('0x2a')](handleEntityNotFound(_0xc86e4b,null))[_0xb45e('0x2a')](respondWithResult(_0xc86e4b,null))[_0xb45e('0x46')](handleError(_0xc86e4b,null));};exports[_0xb45e('0x4b')]=function(_0x76c541,_0x1958b0){return db[_0xb45e('0x30')][_0xb45e('0x4b')](_0x76c541[_0xb45e('0x4c')],{})[_0xb45e('0x2a')](respondWithResult(_0x1958b0,0xc9))[_0xb45e('0x46')](handleError(_0x1958b0,null));};exports[_0xb45e('0x29')]=function(_0x4bbbb2,_0xde6b60){if(_0x4bbbb2['body']['id']){delete _0x4bbbb2['body']['id'];}return db['ChatInternalMessage'][_0xb45e('0x4a')]({'where':{'id':_0x4bbbb2[_0xb45e('0x4d')]['id']}})[_0xb45e('0x2a')](handleEntityNotFound(_0xde6b60,null))['then'](saveUpdates(_0x4bbbb2[_0xb45e('0x4c')],null))['then'](respondWithResult(_0xde6b60,null))[_0xb45e('0x46')](handleError(_0xde6b60,null));};exports[_0xb45e('0x2b')]=function(_0x19b592,_0x410a56){return db[_0xb45e('0x30')][_0xb45e('0x4a')]({'where':{'id':_0x19b592[_0xb45e('0x4d')]['id']}})[_0xb45e('0x2a')](handleEntityNotFound(_0x410a56,null))[_0xb45e('0x2a')](removeEntity(_0x410a56,null))[_0xb45e('0x46')](handleError(_0x410a56,null));};exports[_0xb45e('0x4e')]=function(_0x45226d,_0x3f5695){return db[_0xb45e('0x30')][_0xb45e('0x4e')]()[_0xb45e('0x2a')](respondWithResult(_0x3f5695,null))[_0xb45e('0x46')](handleError(_0x3f5695,null));};function wrapUser(_0x520227){return function(_0x141529){var _0xe4900e=_0x520227[_0xb45e('0x4f')]({'plain':!![]});_0xe4900e[_0xb45e('0x50')]=[];if(_0x141529){_0xe4900e['lastMessageAt']=_0x141529[_0xb45e('0x51')];_0xe4900e[_0xb45e('0x52')]=_0x141529;}else{_0xe4900e[_0xb45e('0x53')]=moment(0x0)[_0xb45e('0x54')](_0xb45e('0x55'));_0xe4900e[_0xb45e('0x52')]={};}return _0xe4900e;};}exports[_0xb45e('0x56')]=function(_0x52313d,_0x1aef2f,_0x193fc0){var _0x23d595=[];return db[_0xb45e('0x57')]['findAll']({'where':{'role':['agent','admin',_0xb45e('0x58')]},'attributes':['id',_0xb45e('0x59'),_0xb45e('0x2e'),'role',_0xb45e('0x5a'),_0xb45e('0x5b'),_0xb45e('0x5c'),'lastLoginAt',_0xb45e('0x5d'),_0xb45e('0x5e')],'order':qs['sort'](_0xb45e('0x5f')),'include':[{'model':db[_0xb45e('0x60')],'as':_0xb45e('0x61'),'attributes':['id','name',_0xb45e('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x5b0a53){if(_0x5b0a53){var _0x29f5ab=_0x52313d[_0xb45e('0x58')][_0xb45e('0x4f')]({'plain':!![]});if(!_0x29f5ab)throw new Error(_0xb45e('0x62'));if(_0x29f5ab[_0xb45e('0x63')]===_0xb45e('0x58')){return db[_0xb45e('0x64')]['find']({'where':{'name':_0xb45e('0x65'),'userProfileId':_0x29f5ab['userProfileId']},'raw':!![]})[_0xb45e('0x2a')](function(_0x23385c){if(_0x23385c){if(_0x23385c['autoAssociation']===0x0){return db[_0xb45e('0x66')][_0xb45e('0x44')]({'where':{'sectionId':_0x23385c['id']},'raw':!![]})['then'](function(_0x1c978b){var _0x946cba=[];if(_['isEmpty'](_0x1c978b)){_0x946cba=_[_0xb45e('0x3e')](_0x5b0a53,function(_0x4619ad){if(_0x4619ad[_0xb45e('0x63')]!=='agent'){return _0x4619ad;}});return _0x946cba;}else{for(var _0x4f96ee=0x0;_0x4f96ee<_0x5b0a53['length'];_0x4f96ee++){var _0x1dcd0d=_0x5b0a53[_0x4f96ee];if(_0x1dcd0d[_0xb45e('0x63')]===_0xb45e('0x67')){var _0x1c31d2=_[_0xb45e('0x4a')](_0x1c978b,function(_0x4fde7d){return _0x4fde7d[_0xb45e('0x68')]===_0x1dcd0d['id'];});if(_0x1c31d2)_0x946cba[_0xb45e('0x69')](_0x1dcd0d);}else{_0x946cba['push'](_0x1dcd0d);}}return _0x946cba;}});}else{return _0x5b0a53;}}else{var _0xda5571=_[_0xb45e('0x3e')](_0x5b0a53,function(_0x382bb4){if(_0x382bb4[_0xb45e('0x63')]!==_0xb45e('0x67')){return _0x382bb4;}});return _0xda5571;}});}else{return _0x5b0a53;}}})[_0xb45e('0x2a')](function(_0x470ca0){var _0x32f9a5=[];if(_0x470ca0){_0x23d595=_0x470ca0;for(var _0x29c2b4=0x0;_0x29c2b4<_0x470ca0[_0xb45e('0x48')];_0x29c2b4+=0x1){_0x23d595[_0x29c2b4][_0xb45e('0x50')]=[];_0x32f9a5[_0xb45e('0x69')](db[_0xb45e('0x30')][_0xb45e('0x4a')]({'where':{'FromId':[_0x52313d[_0xb45e('0x58')]['id'],_0x470ca0[_0x29c2b4]['id']],'ToId':[_0x52313d[_0xb45e('0x58')]['id'],_0x470ca0[_0x29c2b4]['id']],'ChatGroupId':null},'attributes':['id',_0xb45e('0x51'),_0xb45e('0x6a'),_0xb45e('0x6b'),_0xb45e('0x6c'),'body'],'order':qs['sort'](_0xb45e('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb45e('0x2a')](wrapUser(_0x470ca0[_0x29c2b4])));}return BPromise['all'](_0x32f9a5);}return[];})['then'](function(_0x35c996){return{'rows':_0x35c996,'count':_0x35c996[_0xb45e('0x48')]};})[_0xb45e('0x2a')](respondWithResult(_0x1aef2f,null))['catch'](handleError(_0x1aef2f,null));}; \ No newline at end of file +var _0xda5a=['merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','destroy','params','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda5a,0x112));var _0xada5=function(_0x14b195,_0x460868){_0x14b195=_0x14b195-0x0;var _0x42f003=_0xda5a[_0x14b195];return _0x42f003;};'use strict';var emlformat=require(_0xada5('0x0'));var rimraf=require(_0xada5('0x1'));var zipdir=require(_0xada5('0x2'));var jsonpatch=require(_0xada5('0x3'));var rp=require(_0xada5('0x4'));var moment=require('moment');var BPromise=require(_0xada5('0x5'));var Mustache=require(_0xada5('0x6'));var util=require(_0xada5('0x7'));var path=require(_0xada5('0x8'));var sox=require(_0xada5('0x9'));var csv=require(_0xada5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xada5('0xb'));var _=require(_0xada5('0xc'));var squel=require(_0xada5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xada5('0xa'));var querystring=require('querystring');var Papa=require(_0xada5('0xe'));var Redis=require(_0xada5('0xf'));var authService=require(_0xada5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xada5('0x11'));var hardwareService=require(_0xada5('0x12'));var logger=require(_0xada5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xada5('0x14'));var licenseUtil=require(_0xada5('0x15'));var db=require(_0xada5('0x16'))['db'];config[_0xada5('0x17')]=_[_0xada5('0x18')](config[_0xada5('0x17')],{'host':_0xada5('0x19'),'port':0x18eb});var socket=require(_0xada5('0x1a'))(new Redis(config[_0xada5('0x17')]));require('./chatInternalMessage.socket')[_0xada5('0x1b')](socket);function respondWithStatusCode(_0x2ef8e9,_0x1812e3){_0x1812e3=_0x1812e3||0xcc;return function(_0x4f3b79){if(_0x4f3b79){return _0x2ef8e9[_0xada5('0x1c')](_0x1812e3);}return _0x2ef8e9[_0xada5('0x1d')](_0x1812e3)[_0xada5('0x1e')]();};}function respondWithResult(_0x80b621,_0x2950c1){_0x2950c1=_0x2950c1||0xc8;return function(_0xe6fb4f){if(_0xe6fb4f){return _0x80b621['status'](_0x2950c1)[_0xada5('0x1f')](_0xe6fb4f);}};}function respondWithFilteredResult(_0x19ed52,_0xf46e4f){return function(_0x4c2c40){if(_0x4c2c40){var _0x500444=typeof _0xf46e4f[_0xada5('0x20')]===_0xada5('0x21')&&typeof _0xf46e4f[_0xada5('0x22')]==='undefined';var _0x2adc27=_0x4c2c40['count'];var _0x55b1b5=_0x500444?0x0:_0xf46e4f['offset'];var _0x22bd5b=_0x500444?_0x4c2c40[_0xada5('0x23')]:_0xf46e4f[_0xada5('0x20')]+_0xf46e4f[_0xada5('0x22')];var _0x4015bc;if(_0x22bd5b>=_0x2adc27){_0x22bd5b=_0x2adc27;_0x4015bc=0xc8;}else{_0x4015bc=0xce;}_0x19ed52['status'](_0x4015bc);return _0x19ed52[_0xada5('0x24')](_0xada5('0x25'),_0x55b1b5+'-'+_0x22bd5b+'/'+_0x2adc27)[_0xada5('0x1f')](_0x4c2c40);}return null;};}function patchUpdates(_0x4aadf7){return function(_0x32746e){try{jsonpatch[_0xada5('0x26')](_0x32746e,_0x4aadf7,!![]);}catch(_0x443db7){return BPromise[_0xada5('0x27')](_0x443db7);}return _0x32746e[_0xada5('0x28')]();};}function saveUpdates(_0x3fe951,_0x553902){return function(_0xdcf3fc){if(_0xdcf3fc){return _0xdcf3fc[_0xada5('0x29')](_0x3fe951)[_0xada5('0x2a')](function(_0xa47f01){return _0xa47f01;});}return null;};}function removeEntity(_0x4b3585,_0x50445e){return function(_0x43623f){if(_0x43623f){return _0x43623f['destroy']()[_0xada5('0x2a')](function(){_0x4b3585['status'](0xcc)[_0xada5('0x1e')]();});}};}function handleEntityNotFound(_0xd38d40,_0xee354b){return function(_0x239cda){if(!_0x239cda){_0xd38d40[_0xada5('0x1c')](0x194);}return _0x239cda;};}function handleError(_0x25be89,_0x265e3c){_0x265e3c=_0x265e3c||0x1f4;return function(_0x309ba0){logger[_0xada5('0x2b')](_0x309ba0[_0xada5('0x2c')]);if(_0x309ba0[_0xada5('0x2d')]){delete _0x309ba0[_0xada5('0x2d')];}_0x25be89[_0xada5('0x1d')](_0x265e3c)[_0xada5('0x2e')](_0x309ba0);};}exports[_0xada5('0x2f')]=function(_0x5749c6,_0x550c7b){var _0x2f1b0e={},_0x264240={},_0x41c593={'count':0x0,'rows':[]};var _0x44b1d0=_[_0xada5('0x30')](db[_0xada5('0x31')]['rawAttributes'],function(_0x5a1eea){return{'name':_0x5a1eea[_0xada5('0x32')],'type':_0x5a1eea['type'][_0xada5('0x33')]};});_0x264240[_0xada5('0x34')]=_['map'](_0x44b1d0,_0xada5('0x2d'));_0x264240[_0xada5('0x35')]=_[_0xada5('0x36')](_0x5749c6[_0xada5('0x35')]);_0x264240['filters']=_[_0xada5('0x37')](_0x264240[_0xada5('0x34')],_0x264240[_0xada5('0x35')]);_0x2f1b0e[_0xada5('0x38')]=_[_0xada5('0x37')](_0x264240[_0xada5('0x34')],qs['fields'](_0x5749c6[_0xada5('0x35')][_0xada5('0x39')]));_0x2f1b0e['attributes']=_0x2f1b0e[_0xada5('0x38')][_0xada5('0x3a')]?_0x2f1b0e[_0xada5('0x38')]:_0x264240[_0xada5('0x34')];if(!_0x5749c6[_0xada5('0x35')][_0xada5('0x3b')](_0xada5('0x3c'))){_0x2f1b0e['limit']=qs[_0xada5('0x22')](_0x5749c6['query'][_0xada5('0x22')]);_0x2f1b0e['offset']=qs[_0xada5('0x20')](_0x5749c6[_0xada5('0x35')][_0xada5('0x20')]);}_0x2f1b0e[_0xada5('0x3d')]=qs[_0xada5('0x3e')](_0x5749c6[_0xada5('0x35')]['sort']);_0x2f1b0e[_0xada5('0x3f')]=qs[_0xada5('0x40')](_['pick'](_0x5749c6[_0xada5('0x35')],_0x264240[_0xada5('0x40')]),_0x44b1d0);if(_0x5749c6['query'][_0xada5('0x41')]){_0x2f1b0e['where']=_['merge'](_0x2f1b0e[_0xada5('0x3f')],{'$or':_[_0xada5('0x30')](_0x44b1d0,function(_0x2b2944){if(_0x2b2944[_0xada5('0x42')]!==_0xada5('0x43')){var _0x19f863={};_0x19f863[_0x2b2944['name']]={'$like':'%'+_0x5749c6[_0xada5('0x35')][_0xada5('0x41')]+'%'};return _0x19f863;}})});}_0x2f1b0e=_[_0xada5('0x44')]({},_0x2f1b0e,_0x5749c6[_0xada5('0x45')]);var _0x4acc7c={'where':_0x2f1b0e[_0xada5('0x3f')]};return db[_0xada5('0x31')][_0xada5('0x23')](_0x4acc7c)['then'](function(_0x347426){_0x41c593[_0xada5('0x23')]=_0x347426;if(_0x5749c6['query'][_0xada5('0x46')]){_0x2f1b0e['include']=[{'all':!![]}];}return db[_0xada5('0x31')][_0xada5('0x47')](_0x2f1b0e);})[_0xada5('0x2a')](function(_0x1b235e){_0x41c593[_0xada5('0x48')]=_0x1b235e;return _0x41c593;})['then'](respondWithFilteredResult(_0x550c7b,_0x2f1b0e))[_0xada5('0x49')](handleError(_0x550c7b,null));};exports[_0xada5('0x4a')]=function(_0xcc61ef,_0x24593a){var _0x2bdb77={'raw':!![],'where':{'id':_0xcc61ef['params']['id']}},_0x22060e={};_0x22060e[_0xada5('0x34')]=_['keys'](db['ChatInternalMessage'][_0xada5('0x4b')]);_0x22060e['query']=_[_0xada5('0x36')](_0xcc61ef[_0xada5('0x35')]);_0x22060e[_0xada5('0x40')]=_[_0xada5('0x37')](_0x22060e[_0xada5('0x34')],_0x22060e[_0xada5('0x35')]);_0x2bdb77['attributes']=_[_0xada5('0x37')](_0x22060e[_0xada5('0x34')],qs['fields'](_0xcc61ef[_0xada5('0x35')]['fields']));_0x2bdb77[_0xada5('0x38')]=_0x2bdb77[_0xada5('0x38')][_0xada5('0x3a')]?_0x2bdb77[_0xada5('0x38')]:_0x22060e[_0xada5('0x34')];if(_0xcc61ef[_0xada5('0x35')][_0xada5('0x46')]){_0x2bdb77[_0xada5('0x4c')]=[{'all':!![]}];}_0x2bdb77=_[_0xada5('0x44')]({},_0x2bdb77,_0xcc61ef[_0xada5('0x45')]);return db[_0xada5('0x31')][_0xada5('0x4d')](_0x2bdb77)[_0xada5('0x2a')](handleEntityNotFound(_0x24593a,null))[_0xada5('0x2a')](respondWithResult(_0x24593a,null))[_0xada5('0x49')](handleError(_0x24593a,null));};exports[_0xada5('0x4e')]=function(_0x37ab72,_0x50c7e1){return db[_0xada5('0x31')][_0xada5('0x4e')](_0x37ab72['body'],{})[_0xada5('0x2a')](respondWithResult(_0x50c7e1,0xc9))[_0xada5('0x49')](handleError(_0x50c7e1,null));};exports['update']=function(_0x56837c,_0x762afe){if(_0x56837c[_0xada5('0x4f')]['id']){delete _0x56837c[_0xada5('0x4f')]['id'];}return db[_0xada5('0x31')][_0xada5('0x4d')]({'where':{'id':_0x56837c['params']['id']}})[_0xada5('0x2a')](handleEntityNotFound(_0x762afe,null))[_0xada5('0x2a')](saveUpdates(_0x56837c['body'],null))[_0xada5('0x2a')](respondWithResult(_0x762afe,null))[_0xada5('0x49')](handleError(_0x762afe,null));};exports[_0xada5('0x50')]=function(_0x51a279,_0x1d31e9){return db[_0xada5('0x31')][_0xada5('0x4d')]({'where':{'id':_0x51a279[_0xada5('0x51')]['id']}})[_0xada5('0x2a')](handleEntityNotFound(_0x1d31e9,null))[_0xada5('0x2a')](removeEntity(_0x1d31e9,null))[_0xada5('0x49')](handleError(_0x1d31e9,null));};exports['describe']=function(_0xf09162,_0x246e00){return db[_0xada5('0x31')]['describe']()[_0xada5('0x2a')](respondWithResult(_0x246e00,null))[_0xada5('0x49')](handleError(_0x246e00,null));};function wrapUser(_0x3d942f){return function(_0x4f967c){var _0x592cba=_0x3d942f['get']({'plain':!![]});_0x592cba[_0xada5('0x52')]=[];if(_0x4f967c){_0x592cba[_0xada5('0x53')]=_0x4f967c[_0xada5('0x54')];_0x592cba[_0xada5('0x55')]=_0x4f967c;}else{_0x592cba['lastMessageAt']=moment(0x0)[_0xada5('0x56')](_0xada5('0x57'));_0x592cba[_0xada5('0x55')]={};}return _0x592cba;};}exports[_0xada5('0x58')]=function(_0x2e95bc,_0x5e4736,_0x2278f5){var _0x3595c7=[];return db[_0xada5('0x59')][_0xada5('0x47')]({'where':{'role':['agent',_0xada5('0x5a'),_0xada5('0x5b')]},'attributes':['id',_0xada5('0x5c'),_0xada5('0x2d'),_0xada5('0x5d'),_0xada5('0x5e'),_0xada5('0x5f'),_0xada5('0x60'),_0xada5('0x61'),_0xada5('0x62'),_0xada5('0x63')],'order':qs[_0xada5('0x3e')]('-online'),'include':[{'model':db[_0xada5('0x64')],'as':_0xada5('0x65'),'attributes':['id',_0xada5('0x2d'),_0xada5('0x42')],'through':{'attributes':[]}}]})[_0xada5('0x2a')](function(_0x1ed917){if(_0x1ed917){var _0x122478=_0x2e95bc[_0xada5('0x5b')][_0xada5('0x66')]({'plain':!![]});if(!_0x122478)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x122478['role']===_0xada5('0x5b')){return db[_0xada5('0x67')][_0xada5('0x4d')]({'where':{'name':_0xada5('0x68'),'userProfileId':_0x122478[_0xada5('0x69')]},'raw':!![]})[_0xada5('0x2a')](function(_0x24c32e){if(_0x24c32e){if(_0x24c32e[_0xada5('0x6a')]===0x0){return db[_0xada5('0x6b')]['findAll']({'where':{'sectionId':_0x24c32e['id']},'raw':!![]})['then'](function(_0x51b8c1){var _0x2f3c82=[];if(_[_0xada5('0x6c')](_0x51b8c1)){_0x2f3c82=_[_0xada5('0x41')](_0x1ed917,function(_0x48eaab){if(_0x48eaab['role']!=='agent'){return _0x48eaab;}});return _0x2f3c82;}else{for(var _0x46dd7f=0x0;_0x46dd7f<_0x1ed917[_0xada5('0x3a')];_0x46dd7f++){var _0x425f7d=_0x1ed917[_0x46dd7f];if(_0x425f7d[_0xada5('0x5d')]===_0xada5('0x6d')){var _0x52349e=_[_0xada5('0x4d')](_0x51b8c1,function(_0x14280){return _0x14280[_0xada5('0x6e')]===_0x425f7d['id'];});if(_0x52349e)_0x2f3c82[_0xada5('0x6f')](_0x425f7d);}else{_0x2f3c82[_0xada5('0x6f')](_0x425f7d);}}return _0x2f3c82;}});}else{return _0x1ed917;}}else{var _0x1f4f30=_['filter'](_0x1ed917,function(_0x258e11){if(_0x258e11[_0xada5('0x5d')]!=='agent'){return _0x258e11;}});return _0x1f4f30;}});}else{return _0x1ed917;}}})[_0xada5('0x2a')](function(_0x274907){var _0x14a999=[];if(_0x274907){_0x3595c7=_0x274907;for(var _0x53a4d0=0x0;_0x53a4d0<_0x274907[_0xada5('0x3a')];_0x53a4d0+=0x1){_0x3595c7[_0x53a4d0][_0xada5('0x52')]=[];_0x14a999[_0xada5('0x6f')](db[_0xada5('0x31')][_0xada5('0x4d')]({'where':{'FromId':[_0x2e95bc['user']['id'],_0x274907[_0x53a4d0]['id']],'ToId':[_0x2e95bc[_0xada5('0x5b')]['id'],_0x274907[_0x53a4d0]['id']],'ChatGroupId':null},'attributes':['id',_0xada5('0x54'),_0xada5('0x70'),_0xada5('0x71'),'read','body'],'order':qs[_0xada5('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xada5('0x2a')](wrapUser(_0x274907[_0x53a4d0])));}return BPromise['all'](_0x14a999);}return[];})[_0xada5('0x2a')](function(_0x52daa3){return{'rows':_0x52daa3,'count':_0x52daa3[_0xada5('0x3a')]};})[_0xada5('0x2a')](respondWithResult(_0x5e4736,null))['catch'](handleError(_0x5e4736,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 07f6941..132d14b 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 _0x445e=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x333752,_0x11b776){var _0x2c3de5=function(_0x2cc0fb){while(--_0x2cc0fb){_0x333752['push'](_0x333752['shift']());}};_0x2c3de5(++_0x11b776);}(_0x445e,0x1d1));var _0xe445=function(_0x441dd4,_0x582db9){_0x441dd4=_0x441dd4-0x0;var _0x54ea8b=_0x445e[_0x441dd4];return _0x54ea8b;};'use strict';var EventEmitter=require(_0xe445('0x0'));var ChatInternalMessage=require(_0xe445('0x1'))['db'][_0xe445('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe445('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11a226){return function(_0x5d46f4,_0x4071a9,_0x45418c){ChatInternalMessageEvents[_0xe445('0x4')](_0x11a226+':'+_0x5d46f4['id'],_0x5d46f4);ChatInternalMessageEvents[_0xe445('0x4')](_0x11a226,_0x5d46f4);_0x45418c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xe445('0x5')](e,emitEvent(event));}}module[_0xe445('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xfead=['emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','save','remove'];(function(_0x159a90,_0x187619){var _0x2fdc0b=function(_0x3ee4fa){while(--_0x3ee4fa){_0x159a90['push'](_0x159a90['shift']());}};_0x2fdc0b(++_0x187619);}(_0xfead,0x152));var _0xdfea=function(_0x52ac8d,_0x5c8337){_0x52ac8d=_0x52ac8d-0x0;var _0x2aad15=_0xfead[_0x52ac8d];return _0x2aad15;};'use strict';var EventEmitter=require(_0xdfea('0x0'));var ChatInternalMessage=require(_0xdfea('0x1'))['db'][_0xdfea('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdfea('0x3'),'afterUpdate':'update','afterDestroy':_0xdfea('0x4')};function emitEvent(_0xbf9cc5){return function(_0x3ba75f,_0x5a6bec,_0x2d8770){ChatInternalMessageEvents['emit'](_0xbf9cc5+':'+_0x3ba75f['id'],_0x3ba75f);ChatInternalMessageEvents[_0xdfea('0x5')](_0xbf9cc5,_0x3ba75f);_0x2d8770(null);};}for(var e in events){if(events[_0xdfea('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 8fb7e21..22d7308 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 _0x5850=['bluebird','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x5850,0x14e));var _0x0585=function(_0x5ce0c5,_0x31c821){_0x5ce0c5=_0x5ce0c5-0x0;var _0x2ef5c0=_0x5850[_0x5ce0c5];return _0x2ef5c0;};'use strict';var _=require(_0x0585('0x0'));var util=require(_0x0585('0x1'));var logger=require(_0x0585('0x2'))('api');var moment=require(_0x0585('0x3'));var BPromise=require(_0x0585('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0585('0x5'));var rimraf=require(_0x0585('0x6'));var config=require('../../config/environment');var attributes=require(_0x0585('0x7'));module[_0x0585('0x8')]=function(_0x52be25,_0xcb7420){return _0x52be25[_0x0585('0x9')](_0x0585('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0585('0xb'),'collate':_0x0585('0xc')});}; \ No newline at end of file +var _0xfea3=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xfea3,0x67));var _0x3fea=function(_0x33ae47,_0x347b06){_0x33ae47=_0x33ae47-0x0;var _0x96ad9e=_0xfea3[_0x33ae47];return _0x96ad9e;};'use strict';var _=require('lodash');var util=require(_0x3fea('0x0'));var logger=require(_0x3fea('0x1'))(_0x3fea('0x2'));var moment=require('moment');var BPromise=require(_0x3fea('0x3'));var rp=require(_0x3fea('0x4'));var fs=require('fs');var path=require(_0x3fea('0x5'));var rimraf=require(_0x3fea('0x6'));var config=require(_0x3fea('0x7'));var attributes=require(_0x3fea('0x8'));module['exports']=function(_0x3e8fcd,_0x48e3f6){return _0x3e8fcd[_0x3fea('0x9')](_0x3fea('0xa'),attributes,{'tableName':_0x3fea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fea('0xc'),'collate':_0x3fea('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 24dcb25..f752c41 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 _0x899a=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4e8a6c,_0x57aaea){var _0x4ee7f9=function(_0x16e499){while(--_0x16e499){_0x4e8a6c['push'](_0x4e8a6c['shift']());}};_0x4ee7f9(++_0x57aaea);}(_0x899a,0x1b6));var _0xa899=function(_0xd1effc,_0x2b719f){_0xd1effc=_0xd1effc-0x0;var _0x13935a=_0x899a[_0xd1effc];return _0x13935a;};'use strict';var _=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var moment=require('moment');var BPromise=require(_0xa899('0x2'));var rs=require(_0xa899('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa899('0x4'))['db'];var utils=require(_0xa899('0x5'));var logger=require(_0xa899('0x6'))(_0xa899('0x7'));var config=require('../../config/environment');var jayson=require(_0xa899('0x8'));var client=jayson[_0xa899('0x9')][_0xa899('0xa')]({'port':0x232a});config[_0xa899('0xb')]=_['defaults'](config[_0xa899('0xb')],{'host':_0xa899('0xc'),'port':0x18eb});var socket=require(_0xa899('0xd'))(new Redis(config[_0xa899('0xb')]));require(_0xa899('0xe'))[_0xa899('0xf')](socket);function respondWithRpcPromise(_0x30954d,_0x184920,_0x1fbfa6){return new BPromise(function(_0x34282a,_0x5a6582){return client[_0xa899('0x10')](_0x30954d,_0x1fbfa6)['then'](function(_0x4eb704){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x184920,_0xa899('0x11'));logger[_0xa899('0x12')](_0xa899('0x13'),_0x184920,'request\x20sent',JSON[_0xa899('0x14')](_0x4eb704));if(_0x4eb704[_0xa899('0x15')]){if(_0x4eb704['error'][_0xa899('0x16')]===0x1f4){logger[_0xa899('0x15')](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')]['message']);return _0x5a6582(_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);}logger['error'](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);return _0x34282a(_0x4eb704['error']['message']);}else{logger[_0xa899('0x19')](_0xa899('0x17'),_0x184920,_0xa899('0x11'));_0x34282a(_0x4eb704[_0xa899('0x1a')][_0xa899('0x18')]);}})['catch'](function(_0x332ced){logger['error'](_0xa899('0x17'),_0x184920,_0x332ced);_0x5a6582(_0x332ced);});});} \ No newline at end of file +var _0x0207=['code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x491f74,_0x10b98c){var _0x1f372a=function(_0x12b94b){while(--_0x12b94b){_0x491f74['push'](_0x491f74['shift']());}};_0x1f372a(++_0x10b98c);}(_0x0207,0x162));var _0x7020=function(_0x454178,_0x11890a){_0x454178=_0x454178-0x0;var _0x1866dc=_0x0207[_0x454178];return _0x1866dc;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});config[_0x7020('0x9')]=_[_0x7020('0xa')](config[_0x7020('0x9')],{'host':_0x7020('0xb'),'port':0x18eb});var socket=require(_0x7020('0xc'))(new Redis(config[_0x7020('0x9')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x11a2e8,_0x7b820e,_0xd4432){return new BPromise(function(_0x47c324,_0x22fff6){return client[_0x7020('0xd')](_0x11a2e8,_0xd4432)['then'](function(_0x1a68a7){logger[_0x7020('0xe')](_0x7020('0xf'),_0x7b820e,'request\x20sent');logger[_0x7020('0x10')](_0x7020('0x11'),_0x7b820e,_0x7020('0x12'),JSON[_0x7020('0x13')](_0x1a68a7));if(_0x1a68a7[_0x7020('0x14')]){if(_0x1a68a7['error'][_0x7020('0x15')]===0x1f4){logger['error'](_0x7020('0xf'),_0x7b820e,_0x1a68a7[_0x7020('0x14')][_0x7020('0x16')]);return _0x22fff6(_0x1a68a7[_0x7020('0x14')][_0x7020('0x16')]);}logger[_0x7020('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x7b820e,_0x1a68a7[_0x7020('0x14')]['message']);return _0x47c324(_0x1a68a7[_0x7020('0x14')][_0x7020('0x16')]);}else{logger[_0x7020('0xe')](_0x7020('0xf'),_0x7b820e,'request\x20sent');_0x47c324(_0x1a68a7[_0x7020('0x17')][_0x7020('0x16')]);}})[_0x7020('0x18')](function(_0x254b8b){logger[_0x7020('0x14')](_0x7020('0xf'),_0x7b820e,_0x254b8b);_0x22fff6(_0x254b8b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 823b022..faef2b1 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 _0x0a2e=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x0a2e,0x174));var _0xe0a2=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x0a2e[_0x23ec06];return _0x2831d4;};'use strict';var ChatInternalMessageEvents=require(_0xe0a2('0x0'));var events=[_0xe0a2('0x1'),_0xe0a2('0x2'),_0xe0a2('0x3')];function createListener(_0x147566,_0x46de12){return function(_0x3bc5fa){_0x46de12[_0xe0a2('0x4')](_0x147566,_0x3bc5fa);};}function removeListener(_0x564b80,_0x25d7b9){return function(){ChatInternalMessageEvents['removeListener'](_0x564b80,_0x25d7b9);};}exports[_0xe0a2('0x5')]=function(_0x3a3cd7){for(var _0x248133=0x0,_0x17515f=events[_0xe0a2('0x6')];_0x248133<_0x17515f;_0x248133++){var _0x4913ae=events[_0x248133];var _0xc7a496=createListener(_0xe0a2('0x7')+_0x4913ae,_0x3a3cd7);ChatInternalMessageEvents['on'](_0x4913ae,_0xc7a496);}}; \ No newline at end of file +var _0x030e=['save','remove','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x030e,0x195));var _0xe030=function(_0x8c1925,_0x280e1b){_0x8c1925=_0x8c1925-0x0;var _0x167778=_0x030e[_0x8c1925];return _0x167778;};'use strict';var ChatInternalMessageEvents=require(_0xe030('0x0'));var events=[_0xe030('0x1'),_0xe030('0x2'),'update'];function createListener(_0x3caff7,_0x9bd25c){return function(_0x35dbf0){_0x9bd25c['emit'](_0x3caff7,_0x35dbf0);};}function removeListener(_0x5c64a1,_0x4eb256){return function(){ChatInternalMessageEvents[_0xe030('0x3')](_0x5c64a1,_0x4eb256);};}exports[_0xe030('0x4')]=function(_0x24e80f){for(var _0x606ca3=0x0,_0x4873c6=events[_0xe030('0x5')];_0x606ca3<_0x4873c6;_0x606ca3++){var _0x9eea4=events[_0x606ca3];var _0x22810c=createListener(_0xe030('0x6')+_0x9eea4,_0x24e80f);ChatInternalMessageEvents['on'](_0x9eea4,_0x22810c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 18934d3..0a13fce 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 _0xa40c=['put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','get','index','isAuthenticated','describe','/users','/:id','show'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa40c,0x1f1));var _0xca40=function(_0x1e3b2c,_0x446d83){_0x1e3b2c=_0x1e3b2c-0x0;var _0x561c3a=_0xa40c[_0x1e3b2c];return _0x561c3a;};'use strict';var multer=require(_0xca40('0x0'));var util=require(_0xca40('0x1'));var path=require(_0xca40('0x2'));var timeout=require('connect-timeout');var express=require(_0xca40('0x3'));var router=express[_0xca40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca40('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xca40('0x6')]('/',auth['isAuthenticated'](),controller[_0xca40('0x7')]);router[_0xca40('0x6')]('/describe',auth[_0xca40('0x8')](),controller[_0xca40('0x9')]);router['get'](_0xca40('0xa'),auth[_0xca40('0x8')](),controller['getUsers']);router['get'](_0xca40('0xb'),auth[_0xca40('0x8')](),controller[_0xca40('0xc')]);router['post']('/',auth[_0xca40('0x8')](),controller['create']);router[_0xca40('0xd')](_0xca40('0xb'),controller[_0xca40('0xe')]);router[_0xca40('0xf')](_0xca40('0xb'),auth[_0xca40('0x8')](),controller['destroy']);module[_0xca40('0x10')]=router; \ No newline at end of file +var _0xd7c4=['post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/users','getUsers'];(function(_0xe44ce6,_0x5c176e){var _0x251c0b=function(_0x45ecf1){while(--_0x45ecf1){_0xe44ce6['push'](_0xe44ce6['shift']());}};_0x251c0b(++_0x5c176e);}(_0xd7c4,0x132));var _0x4d7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7c4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4d7c('0x0'));var util=require(_0x4d7c('0x1'));var path=require(_0x4d7c('0x2'));var timeout=require(_0x4d7c('0x3'));var express=require('express');var router=express[_0x4d7c('0x4')]();var fs_extra=require(_0x4d7c('0x5'));var auth=require(_0x4d7c('0x6'));var interaction=require(_0x4d7c('0x7'));var config=require(_0x4d7c('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x4d7c('0x9')](),controller[_0x4d7c('0xa')]);router[_0x4d7c('0xb')](_0x4d7c('0xc'),auth[_0x4d7c('0x9')](),controller[_0x4d7c('0xd')]);router['get'](_0x4d7c('0xe'),auth[_0x4d7c('0x9')](),controller[_0x4d7c('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4d7c('0x10')]('/',auth['isAuthenticated'](),controller[_0x4d7c('0x11')]);router['put'](_0x4d7c('0x12'),controller[_0x4d7c('0x13')]);router[_0x4d7c('0x14')]('/:id',auth[_0x4d7c('0x9')](),controller[_0x4d7c('0x15')]);module[_0x4d7c('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 074b670..019673c 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 _0x9ffd=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x298d38,_0x2805b5){_0x298d38=_0x298d38-0x0;var _0x18be54=_0x9ffd[_0x298d38];return _0x18be54;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'body':{'type':Sequelize[_0xd9ff('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9ff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9ff('0x4')]('in',_0xd9ff('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xd9ff('0x6')]},'providerName':{'type':Sequelize[_0xd9ff('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xaebd=['STRING','sequelize','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x261b1f,_0x594b1f){var _0x56529a=function(_0x31937e){while(--_0x31937e){_0x261b1f['push'](_0x261b1f['shift']());}};_0x56529a(++_0x594b1f);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x13422b,_0x458191){_0x13422b=_0x13422b-0x0;var _0x2ca2cf=_0xaebd[_0x13422b];return _0x2ca2cf;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'body':{'type':Sequelize[_0xdaeb('0x1')](_0xdaeb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdaeb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdaeb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdaeb('0x4')]('in','out'),'defaultValue':_0xdaeb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdaeb('0x6')]},'providerName':{'type':Sequelize[_0xdaeb('0x7')]},'providerResponse':{'type':Sequelize[_0xdaeb('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index d78cc2a..7e80000 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 _0xf04e=['lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','map','ChatMessage','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','include','findAll','rows','rawAttributes','includeAll','find','create','params','body','describe','../../config/logger','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1cd320,_0x5247bd){var _0x491f85=function(_0x196c20){while(--_0x196c20){_0x1cd320['push'](_0x1cd320['shift']());}};_0x491f85(++_0x5247bd);}(_0xf04e,0x17c));var _0xef04=function(_0xc4f350,_0x42f971){_0xc4f350=_0xc4f350-0x0;var _0x292196=_0xf04e[_0xc4f350];return _0x292196;};'use strict';var emlformat=require(_0xef04('0x0'));var rimraf=require(_0xef04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef04('0x2'));var rp=require('request-promise');var moment=require(_0xef04('0x3'));var BPromise=require(_0xef04('0x4'));var Mustache=require(_0xef04('0x5'));var util=require(_0xef04('0x6'));var path=require('path');var sox=require(_0xef04('0x7'));var csv=require(_0xef04('0x8'));var ejs=require(_0xef04('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef04('0xa'));var squel=require(_0xef04('0xb'));var crypto=require(_0xef04('0xc'));var jsforce=require(_0xef04('0xd'));var deskjs=require(_0xef04('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef04('0xf'));var qs=require(_0xef04('0x10'));var as=require(_0xef04('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef04('0x12'));var utils=require(_0xef04('0x13'));var config=require(_0xef04('0x14'));var licenseUtil=require(_0xef04('0x15'));var db=require('../../mysqldb')['db'];config[_0xef04('0x16')]=_['defaults'](config['redis'],{'host':_0xef04('0x17'),'port':0x18eb});var socket=require(_0xef04('0x18'))(new Redis(config['redis']));require(_0xef04('0x19'))['register'](socket);var jayson=require(_0xef04('0x1a'));var client=jayson[_0xef04('0x1b')][_0xef04('0x1c')]({'port':0x232c});var client9002=jayson[_0xef04('0x1b')][_0xef04('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5e06a5,_0x274974,_0xee319b,_0x35cdff){return new BPromise(function(_0x196fc4,_0x5c85c6){var _0x356c0e=_0x35cdff||client;return _0x356c0e[_0xef04('0x1d')](_0x5e06a5,_0xee319b)[_0xef04('0x1e')](function(_0x2a54c3){logger['info'](_0xef04('0x1f'),_0x274974,'request\x20sent');logger[_0xef04('0x20')](_0xef04('0x21'),_0x274974,_0xef04('0x22'),JSON[_0xef04('0x23')](_0x2a54c3));if(_0x2a54c3[_0xef04('0x24')]){if(_0x2a54c3[_0xef04('0x24')][_0xef04('0x25')]===0x1f4){logger[_0xef04('0x24')](_0xef04('0x1f'),_0x274974,_0x2a54c3[_0xef04('0x24')][_0xef04('0x26')]);return _0x5c85c6(_0x2a54c3[_0xef04('0x24')]['message']);}logger[_0xef04('0x24')]('ChatMessage,\x20%s,\x20%s',_0x274974,_0x2a54c3[_0xef04('0x24')][_0xef04('0x26')]);return _0x196fc4(_0x2a54c3[_0xef04('0x24')]['message']);}else{logger[_0xef04('0x27')](_0xef04('0x1f'),_0x274974,_0xef04('0x22'));_0x196fc4(_0x2a54c3[_0xef04('0x28')]['message']);}})[_0xef04('0x29')](function(_0x1eca0e){logger[_0xef04('0x24')](_0xef04('0x1f'),_0x274974,_0x1eca0e);_0x5c85c6(_0x1eca0e);});});}function respondWithStatusCode(_0x344643,_0x4b17c6){_0x4b17c6=_0x4b17c6||0xcc;return function(_0x238f69){if(_0x238f69){return _0x344643[_0xef04('0x2a')](_0x4b17c6);}return _0x344643[_0xef04('0x2b')](_0x4b17c6)['end']();};}function respondWithResult(_0x5fe9ad,_0x1046fa){_0x1046fa=_0x1046fa||0xc8;return function(_0xf90ad5){if(_0xf90ad5){return _0x5fe9ad[_0xef04('0x2b')](_0x1046fa)['json'](_0xf90ad5);}};}function respondWithFilteredResult(_0x36fa36,_0x2e2ca2){return function(_0x4d7ed9){if(_0x4d7ed9){var _0x5182b1=typeof _0x2e2ca2['offset']===_0xef04('0x2c')&&typeof _0x2e2ca2[_0xef04('0x2d')]===_0xef04('0x2c');var _0x2c920b=_0x4d7ed9[_0xef04('0x2e')];var _0x30f378=_0x5182b1?0x0:_0x2e2ca2['offset'];var _0x4c12aa=_0x5182b1?_0x4d7ed9['count']:_0x2e2ca2[_0xef04('0x2f')]+_0x2e2ca2[_0xef04('0x2d')];var _0x2cd82b;if(_0x4c12aa>=_0x2c920b){_0x4c12aa=_0x2c920b;_0x2cd82b=0xc8;}else{_0x2cd82b=0xce;}_0x36fa36[_0xef04('0x2b')](_0x2cd82b);return _0x36fa36[_0xef04('0x30')](_0xef04('0x31'),_0x30f378+'-'+_0x4c12aa+'/'+_0x2c920b)['json'](_0x4d7ed9);}return null;};}function patchUpdates(_0x26c6a2){return function(_0x542327){try{jsonpatch[_0xef04('0x32')](_0x542327,_0x26c6a2,!![]);}catch(_0x3bd1ba){return BPromise[_0xef04('0x33')](_0x3bd1ba);}return _0x542327[_0xef04('0x34')]();};}function saveUpdates(_0x1d6903,_0x1d88e5){return function(_0x34a54b){if(_0x34a54b){return _0x34a54b[_0xef04('0x35')](_0x1d6903)[_0xef04('0x1e')](function(_0x5a33a5){return _0x5a33a5;});}return null;};}function removeEntity(_0x547a59,_0x3ee907){return function(_0x38f020){if(_0x38f020){return _0x38f020['destroy']()[_0xef04('0x1e')](function(){_0x547a59[_0xef04('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3581e3,_0x3d36d5){return function(_0x45e29c){if(!_0x45e29c){_0x3581e3[_0xef04('0x2a')](0x194);}return _0x45e29c;};}function handleError(_0x16562b,_0x169c85){_0x169c85=_0x169c85||0x1f4;return function(_0x458773){logger[_0xef04('0x24')](_0x458773[_0xef04('0x36')]);if(_0x458773[_0xef04('0x37')]){delete _0x458773['name'];}_0x16562b[_0xef04('0x2b')](_0x169c85)[_0xef04('0x38')](_0x458773);};}exports['index']=function(_0x17151b,_0x1921ed){var _0x441737={},_0x3d7c35={},_0x566a5d={'count':0x0,'rows':[]};var _0x2444c2=_[_0xef04('0x39')](db[_0xef04('0x3a')]['rawAttributes'],function(_0x1677fd){return{'name':_0x1677fd['fieldName'],'type':_0x1677fd[_0xef04('0x3b')][_0xef04('0x3c')]};});_0x3d7c35['model']=_[_0xef04('0x39')](_0x2444c2,_0xef04('0x37'));_0x3d7c35['query']=_[_0xef04('0x3d')](_0x17151b[_0xef04('0x3e')]);_0x3d7c35['filters']=_[_0xef04('0x3f')](_0x3d7c35[_0xef04('0x40')],_0x3d7c35['query']);_0x441737['attributes']=_['intersection'](_0x3d7c35[_0xef04('0x40')],qs[_0xef04('0x41')](_0x17151b['query'][_0xef04('0x41')]));_0x441737[_0xef04('0x42')]=_0x441737[_0xef04('0x42')][_0xef04('0x43')]?_0x441737['attributes']:_0x3d7c35[_0xef04('0x40')];if(!_0x17151b['query'][_0xef04('0x44')](_0xef04('0x45'))){_0x441737[_0xef04('0x2d')]=qs[_0xef04('0x2d')](_0x17151b[_0xef04('0x3e')][_0xef04('0x2d')]);_0x441737[_0xef04('0x2f')]=qs['offset'](_0x17151b[_0xef04('0x3e')][_0xef04('0x2f')]);}_0x441737['order']=qs[_0xef04('0x46')](_0x17151b[_0xef04('0x3e')][_0xef04('0x46')]);_0x441737[_0xef04('0x47')]=qs[_0xef04('0x48')](_[_0xef04('0x49')](_0x17151b[_0xef04('0x3e')],_0x3d7c35['filters']),_0x2444c2);if(_0x17151b[_0xef04('0x3e')]['filter']){_0x441737[_0xef04('0x47')]=_[_0xef04('0x4a')](_0x441737[_0xef04('0x47')],{'$or':_[_0xef04('0x39')](_0x2444c2,function(_0x4b1241){if(_0x4b1241[_0xef04('0x3b')]!=='VIRTUAL'){var _0x52ca9f={};_0x52ca9f[_0x4b1241[_0xef04('0x37')]]={'$like':'%'+_0x17151b[_0xef04('0x3e')][_0xef04('0x4b')]+'%'};return _0x52ca9f;}})});}_0x441737=_[_0xef04('0x4a')]({},_0x441737,_0x17151b[_0xef04('0x4c')]);var _0x4fbc2e={'where':_0x441737['where']};return db[_0xef04('0x3a')][_0xef04('0x2e')](_0x4fbc2e)[_0xef04('0x1e')](function(_0xf8cd3f){_0x566a5d[_0xef04('0x2e')]=_0xf8cd3f;if(_0x17151b[_0xef04('0x3e')]['includeAll']){_0x441737[_0xef04('0x4d')]=[{'all':!![]}];}return db[_0xef04('0x3a')][_0xef04('0x4e')](_0x441737);})[_0xef04('0x1e')](function(_0x2dc931){_0x566a5d[_0xef04('0x4f')]=_0x2dc931;return _0x566a5d;})[_0xef04('0x1e')](respondWithFilteredResult(_0x1921ed,_0x441737))[_0xef04('0x29')](handleError(_0x1921ed,null));};exports['show']=function(_0x5770fc,_0x1cbacf){var _0x585768={'raw':!![],'where':{'id':_0x5770fc['params']['id']}},_0x3ae263={};_0x3ae263[_0xef04('0x40')]=_[_0xef04('0x3d')](db['ChatMessage'][_0xef04('0x50')]);_0x3ae263['query']=_[_0xef04('0x3d')](_0x5770fc[_0xef04('0x3e')]);_0x3ae263[_0xef04('0x48')]=_[_0xef04('0x3f')](_0x3ae263[_0xef04('0x40')],_0x3ae263[_0xef04('0x3e')]);_0x585768[_0xef04('0x42')]=_[_0xef04('0x3f')](_0x3ae263['model'],qs['fields'](_0x5770fc[_0xef04('0x3e')][_0xef04('0x41')]));_0x585768['attributes']=_0x585768[_0xef04('0x42')][_0xef04('0x43')]?_0x585768[_0xef04('0x42')]:_0x3ae263[_0xef04('0x40')];if(_0x5770fc[_0xef04('0x3e')][_0xef04('0x51')]){_0x585768[_0xef04('0x4d')]=[{'all':!![]}];}_0x585768=_[_0xef04('0x4a')]({},_0x585768,_0x5770fc[_0xef04('0x4c')]);return db[_0xef04('0x3a')][_0xef04('0x52')](_0x585768)[_0xef04('0x1e')](handleEntityNotFound(_0x1cbacf,null))[_0xef04('0x1e')](respondWithResult(_0x1cbacf,null))[_0xef04('0x29')](handleError(_0x1cbacf,null));};exports[_0xef04('0x53')]=function(_0x2573b8,_0x44e83d){return db['ChatMessage'][_0xef04('0x53')](_0x2573b8['body'],{})[_0xef04('0x1e')](respondWithResult(_0x44e83d,0xc9))[_0xef04('0x29')](handleError(_0x44e83d,null));};exports[_0xef04('0x35')]=function(_0x3733c7,_0x4d943f){if(_0x3733c7['body']['id']){delete _0x3733c7['body']['id'];}return db[_0xef04('0x3a')][_0xef04('0x52')]({'where':{'id':_0x3733c7[_0xef04('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d943f,null))['then'](saveUpdates(_0x3733c7[_0xef04('0x55')],null))[_0xef04('0x1e')](respondWithResult(_0x4d943f,null))['catch'](handleError(_0x4d943f,null));};exports['destroy']=function(_0x874fb4,_0x310622){return db[_0xef04('0x3a')][_0xef04('0x52')]({'where':{'id':_0x874fb4[_0xef04('0x54')]['id']}})['then'](handleEntityNotFound(_0x310622,null))[_0xef04('0x1e')](removeEntity(_0x310622,null))[_0xef04('0x29')](handleError(_0x310622,null));};exports[_0xef04('0x56')]=function(_0x3e891d,_0x11e6d0){return db['ChatMessage'][_0xef04('0x56')]()[_0xef04('0x1e')](respondWithResult(_0x11e6d0,null))[_0xef04('0x29')](handleError(_0x11e6d0,null));};var interaction_log=require(_0xef04('0x57'))(_0xef04('0x58'));exports[_0xef04('0x59')]=function(_0x3a65a9,_0xc6a4ff,_0x1d25be){var _0xbbe568={'agent':{},'channel':'chat'};if(_0x3a65a9[_0xef04('0x55')]['id']){delete _0x3a65a9['body']['id'];}_0x3a65a9['body'][_0xef04('0x5a')]=!![];_0x3a65a9[_0xef04('0x55')]['readAt']=moment()[_0xef04('0x5b')](_0xef04('0x5c'));_0x3a65a9['body'][_0xef04('0x5d')]=_0x3a65a9['body'][_0xef04('0x5d')]||_0x3a65a9[_0xef04('0x5e')]['id'];_0xbbe568[_0xef04('0x5f')]['id']=_0x3a65a9[_0xef04('0x55')][_0xef04('0x5d')];return db['ChatMessage'][_0xef04('0x52')]({'where':{'id':_0x3a65a9[_0xef04('0x54')]['id'],'UserId':null}})[_0xef04('0x1e')](handleEntityNotFound(_0xc6a4ff,null))[_0xef04('0x1e')](saveUpdates(_0x3a65a9[_0xef04('0x55')],null))[_0xef04('0x1e')](function(_0x143037){if(_0x143037){_0xbbe568[_0xef04('0x26')]=_0x143037['get']({'plain':!![]});return db['ChatInteraction'][_0xef04('0x52')]({'where':{'id':_0x143037[_0xef04('0x60')]}});}return null;})[_0xef04('0x1e')](handleEntityNotFound(_0xc6a4ff,null))['then'](function(_0x313ddc){if(_0x313ddc){return _0x313ddc[_0xef04('0x35')]({'UserId':_0x3a65a9['body'][_0xef04('0x5d')],'read1stAt':_[_0xef04('0x61')](_0x313ddc[_0xef04('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xef04('0x1e')](function(_0x1a9359){if(_0x1a9359){_0xbbe568['interaction']=_0x1a9359['get']({'plain':!![]});interaction_log[_0xef04('0x27')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a65a9[_0xef04('0x5e')]['id'],_0x3a65a9['user'][_0xef04('0x37')],_0x3a65a9['user'][_0xef04('0x63')],_0xbbe568[_0xef04('0x64')]['id'],_0x3a65a9[_0xef04('0x55')]?JSON['stringify'](_0x3a65a9['body']):_0xef04('0x65'));return respondWithRpcPromise(_0xef04('0x66'),_0xef04('0x67'),_0xbbe568);}return null;})[_0xef04('0x1e')](function(_0x3dd1d8){var _0x50a0e6=_0xef04('0x68')+_0x3dd1d8['message'][_0xef04('0x69')];return db['sequelize']['query'](_0x50a0e6,{'type':db[_0xef04('0x6a')][_0xef04('0x6b')][_0xef04('0x6c')],'raw':!![]})['then'](function(_0x473746){return _0x473746;});})[_0xef04('0x1e')](function(_0x10885f){if(_0x10885f){_0xbbe568[_0xef04('0x26')][_0xef04('0x6d')]=_0x10885f[0x0];if(!_0x3a65a9[_0xef04('0x55')][_0xef04('0x5d')])return;return db[_0xef04('0x6e')][_0xef04('0x52')]({'where':{'id':_0x3a65a9[_0xef04('0x55')][_0xef04('0x5d')],'role':_0xef04('0x5f')},'attributes':['id',_0xef04('0x37'),_0xef04('0x6f'),_0xef04('0x70'),_0xef04('0x71')],'raw':!![]});}return null;})[_0xef04('0x1e')](function(_0x3bad5e){if(!_0x3bad5e)return null;_0xbbe568[_0xef04('0x26')]['agent']=_0x3bad5e;return _0xbbe568;})[_0xef04('0x1e')](function(_0x13dd6a){if(_0x13dd6a){if(_0x3a65a9[_0xef04('0x55')][_0xef04('0x72')]){_0xbbe568[_0xef04('0x26')][_0xef04('0x73')]=util['format'](_0xef04('0x74'),_0x3a65a9[_0xef04('0x5e')][_0xef04('0x37')]);_0xbbe568[_0xef04('0x26')]['channel']=_0xbbe568['channel'];_0xbbe568[_0xef04('0x26')][_0xef04('0x75')]=_0xbbe568[_0xef04('0x76')];_0xbbe568[_0xef04('0x26')][_0xef04('0x77')]='accept';return respondWithRpcPromise('EventManager',_0xef04('0x78'),{'event':_0xef04('0x79'),'message':_['merge'](_0xbbe568[_0xef04('0x26')],JSON[_0xef04('0x7a')](_0xbbe568['interaction'][_0xef04('0x7b')]))},client9002)['then'](function(){return _0xbbe568;});}return _0xbbe568;}return null;})[_0xef04('0x1e')](respondWithResult(_0xc6a4ff,null))['catch'](handleError(_0xc6a4ff,null));};var interaction_log=require(_0xef04('0x57'))(_0xef04('0x58'));exports[_0xef04('0x33')]=function(_0x493795,_0x42f84e,_0x58f1b0){var _0x2d7f54={'agent':{},'channel':'chat'};if(_0x493795[_0xef04('0x55')]['id']){delete _0x493795[_0xef04('0x55')]['id'];}_0x493795[_0xef04('0x55')]['UserId']=_0x493795['body'][_0xef04('0x5d')]||_0x493795['user']['id'];_0x2d7f54[_0xef04('0x5f')]['id']=_0x493795[_0xef04('0x55')][_0xef04('0x5d')];return db['ChatMessage'][_0xef04('0x52')]({'where':{'id':_0x493795[_0xef04('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42f84e,null))[_0xef04('0x1e')](function(_0x100742){if(_0x100742){_0x2d7f54[_0xef04('0x26')]=_0x100742[_0xef04('0x7c')]({'plain':!![]});return db[_0xef04('0x7d')][_0xef04('0x52')]({'where':{'id':_0x100742['ChatInteractionId']}});}return null;})[_0xef04('0x1e')](handleEntityNotFound(_0x42f84e,null))[_0xef04('0x1e')](function(_0x7b75c8){if(_0x7b75c8){_0x2d7f54[_0xef04('0x64')]=_0x7b75c8[_0xef04('0x7c')]({'plain':!![]});interaction_log[_0xef04('0x27')](_0xef04('0x7e'),_0x493795[_0xef04('0x5e')]['id'],_0x493795['user'][_0xef04('0x37')],_0x493795[_0xef04('0x5e')][_0xef04('0x63')],_0x2d7f54[_0xef04('0x64')]['id'],_0x493795['body']?JSON[_0xef04('0x23')](_0x493795[_0xef04('0x55')]):_0xef04('0x65'));return respondWithRpcPromise(_0xef04('0x7f'),_0xef04('0x80'),_0x2d7f54);}return null;})['then'](function(_0x2d2b08){var _0x44d70e=_0xef04('0x68')+_0x2d2b08[_0xef04('0x26')]['ContactId'];return db['sequelize'][_0xef04('0x3e')](_0x44d70e,{'type':db[_0xef04('0x6a')][_0xef04('0x6b')][_0xef04('0x6c')],'raw':!![]})[_0xef04('0x1e')](function(_0x1d9507){return _0x1d9507;});})[_0xef04('0x1e')](function(_0x19e417){if(_0x19e417){_0x2d7f54[_0xef04('0x26')][_0xef04('0x6d')]=_0x19e417[0x0];if(!_0x493795[_0xef04('0x55')]['UserId'])return;return db[_0xef04('0x6e')][_0xef04('0x52')]({'where':{'id':_0x493795[_0xef04('0x55')]['UserId'],'role':_0xef04('0x5f')},'attributes':['id','name',_0xef04('0x6f'),'email',_0xef04('0x71')],'raw':!![]});}return null;})['then'](function(_0x1cd087){if(!_0x1cd087)return null;_0x2d7f54[_0xef04('0x26')]['agent']=_0x1cd087;return _0x2d7f54;})[_0xef04('0x1e')](function(_0x10877b){if(_0x10877b){_0x10877b[_0xef04('0x26')][_0xef04('0x73')]=util[_0xef04('0x5b')](_0xef04('0x74'),_0x493795[_0xef04('0x5e')][_0xef04('0x37')]);_0x10877b[_0xef04('0x26')][_0xef04('0x76')]=_0x2d7f54[_0xef04('0x76')];_0x10877b[_0xef04('0x26')]['motionChannel']=_0x2d7f54[_0xef04('0x76')];_0x10877b[_0xef04('0x26')][_0xef04('0x77')]=_0xef04('0x33');respondWithRpcPromise('EventManager',_0xef04('0x78'),{'event':_0xef04('0x81'),'message':_[_0xef04('0x4a')](_0x2d7f54['message'],JSON[_0xef04('0x7a')](_0x2d7f54['interaction'][_0xef04('0x7b')]))},client9002);return _0x2d7f54;}return null;})[_0xef04('0x1e')](respondWithResult(_0x42f84e,null))[_0xef04('0x29')](handleError(_0x42f84e,null));}; \ No newline at end of file +var _0x03d3=['contact','User','agent','fullname','manual','interface','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','email','internal','event','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','show','find','body','params','describe','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x35e083,_0x2a67b7){var _0x4c1d88=function(_0xa75e0){while(--_0xa75e0){_0x35e083['push'](_0x35e083['shift']());}};_0x4c1d88(++_0x2a67b7);}(_0x03d3,0x11a));var _0x303d=function(_0x3df0fe,_0x113940){_0x3df0fe=_0x3df0fe-0x0;var _0x3c7917=_0x03d3[_0x3df0fe];return _0x3c7917;};'use strict';var emlformat=require(_0x303d('0x0'));var rimraf=require(_0x303d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x303d('0x2'));var rp=require(_0x303d('0x3'));var moment=require(_0x303d('0x4'));var BPromise=require(_0x303d('0x5'));var Mustache=require(_0x303d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x303d('0x7'));var csv=require(_0x303d('0x8'));var ejs=require(_0x303d('0x9'));var fs=require('fs');var fs_extra=require(_0x303d('0xa'));var _=require(_0x303d('0xb'));var squel=require(_0x303d('0xc'));var crypto=require(_0x303d('0xd'));var jsforce=require(_0x303d('0xe'));var deskjs=require(_0x303d('0xf'));var toCsv=require(_0x303d('0x8'));var querystring=require(_0x303d('0x10'));var Papa=require(_0x303d('0x11'));var Redis=require(_0x303d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x303d('0x13'));var logger=require(_0x303d('0x14'))(_0x303d('0x15'));var utils=require(_0x303d('0x16'));var config=require(_0x303d('0x17'));var licenseUtil=require(_0x303d('0x18'));var db=require(_0x303d('0x19'))['db'];config['redis']=_[_0x303d('0x1a')](config['redis'],{'host':_0x303d('0x1b'),'port':0x18eb});var socket=require(_0x303d('0x1c'))(new Redis(config[_0x303d('0x1d')]));require('./chatMessage.socket')[_0x303d('0x1e')](socket);var jayson=require(_0x303d('0x1f'));var client=jayson[_0x303d('0x20')][_0x303d('0x21')]({'port':0x232c});var client9002=jayson[_0x303d('0x20')][_0x303d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4e2abc,_0x24922d,_0x2b353c,_0x3c0b77){return new BPromise(function(_0x3eb50f,_0x3c3f48){var _0x16b221=_0x3c0b77||client;return _0x16b221[_0x303d('0x22')](_0x4e2abc,_0x2b353c)[_0x303d('0x23')](function(_0x2bb110){logger[_0x303d('0x24')](_0x303d('0x25'),_0x24922d,_0x303d('0x26'));logger[_0x303d('0x27')](_0x303d('0x28'),_0x24922d,_0x303d('0x26'),JSON[_0x303d('0x29')](_0x2bb110));if(_0x2bb110[_0x303d('0x2a')]){if(_0x2bb110['error']['code']===0x1f4){logger[_0x303d('0x2a')](_0x303d('0x25'),_0x24922d,_0x2bb110[_0x303d('0x2a')][_0x303d('0x2b')]);return _0x3c3f48(_0x2bb110[_0x303d('0x2a')][_0x303d('0x2b')]);}logger['error'](_0x303d('0x25'),_0x24922d,_0x2bb110[_0x303d('0x2a')]['message']);return _0x3eb50f(_0x2bb110[_0x303d('0x2a')][_0x303d('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x24922d,_0x303d('0x26'));_0x3eb50f(_0x2bb110[_0x303d('0x2c')][_0x303d('0x2b')]);}})[_0x303d('0x2d')](function(_0xf6b119){logger[_0x303d('0x2a')](_0x303d('0x25'),_0x24922d,_0xf6b119);_0x3c3f48(_0xf6b119);});});}function respondWithStatusCode(_0xb7f332,_0x152e4a){_0x152e4a=_0x152e4a||0xcc;return function(_0xd201cc){if(_0xd201cc){return _0xb7f332[_0x303d('0x2e')](_0x152e4a);}return _0xb7f332['status'](_0x152e4a)[_0x303d('0x2f')]();};}function respondWithResult(_0x463f89,_0x3e835d){_0x3e835d=_0x3e835d||0xc8;return function(_0x357f95){if(_0x357f95){return _0x463f89[_0x303d('0x30')](_0x3e835d)[_0x303d('0x31')](_0x357f95);}};}function respondWithFilteredResult(_0x17c394,_0x220b38){return function(_0x29a4dc){if(_0x29a4dc){var _0x56735f=typeof _0x220b38[_0x303d('0x32')]==='undefined'&&typeof _0x220b38[_0x303d('0x33')]===_0x303d('0x34');var _0x278954=_0x29a4dc['count'];var _0x1f946e=_0x56735f?0x0:_0x220b38['offset'];var _0x3d1b7f=_0x56735f?_0x29a4dc[_0x303d('0x35')]:_0x220b38['offset']+_0x220b38[_0x303d('0x33')];var _0x4a256a;if(_0x3d1b7f>=_0x278954){_0x3d1b7f=_0x278954;_0x4a256a=0xc8;}else{_0x4a256a=0xce;}_0x17c394['status'](_0x4a256a);return _0x17c394['set'](_0x303d('0x36'),_0x1f946e+'-'+_0x3d1b7f+'/'+_0x278954)[_0x303d('0x31')](_0x29a4dc);}return null;};}function patchUpdates(_0x593e54){return function(_0xb0bc5f){try{jsonpatch['apply'](_0xb0bc5f,_0x593e54,!![]);}catch(_0x884150){return BPromise[_0x303d('0x37')](_0x884150);}return _0xb0bc5f['save']();};}function saveUpdates(_0xccb6b8,_0x2fec6f){return function(_0x348533){if(_0x348533){return _0x348533[_0x303d('0x38')](_0xccb6b8)[_0x303d('0x23')](function(_0x54387b){return _0x54387b;});}return null;};}function removeEntity(_0x3c9e2a,_0x2890ae){return function(_0x4ab189){if(_0x4ab189){return _0x4ab189[_0x303d('0x39')]()['then'](function(){_0x3c9e2a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3828,_0x33bed8){return function(_0x2324da){if(!_0x2324da){_0x2e3828[_0x303d('0x2e')](0x194);}return _0x2324da;};}function handleError(_0xdb87f2,_0x113623){_0x113623=_0x113623||0x1f4;return function(_0x50a8df){logger[_0x303d('0x2a')](_0x50a8df[_0x303d('0x3a')]);if(_0x50a8df[_0x303d('0x3b')]){delete _0x50a8df['name'];}_0xdb87f2[_0x303d('0x30')](_0x113623)[_0x303d('0x3c')](_0x50a8df);};}exports['index']=function(_0x123d0e,_0x4b9890){var _0x31bc15={},_0x88c425={},_0x4ae2c9={'count':0x0,'rows':[]};var _0x39b701=_[_0x303d('0x3d')](db[_0x303d('0x3e')][_0x303d('0x3f')],function(_0x3ab0c5){return{'name':_0x3ab0c5['fieldName'],'type':_0x3ab0c5[_0x303d('0x40')][_0x303d('0x41')]};});_0x88c425[_0x303d('0x42')]=_[_0x303d('0x3d')](_0x39b701,_0x303d('0x3b'));_0x88c425[_0x303d('0x43')]=_[_0x303d('0x44')](_0x123d0e[_0x303d('0x43')]);_0x88c425[_0x303d('0x45')]=_[_0x303d('0x46')](_0x88c425[_0x303d('0x42')],_0x88c425[_0x303d('0x43')]);_0x31bc15['attributes']=_[_0x303d('0x46')](_0x88c425[_0x303d('0x42')],qs[_0x303d('0x47')](_0x123d0e[_0x303d('0x43')][_0x303d('0x47')]));_0x31bc15[_0x303d('0x48')]=_0x31bc15[_0x303d('0x48')]['length']?_0x31bc15['attributes']:_0x88c425[_0x303d('0x42')];if(!_0x123d0e['query']['hasOwnProperty'](_0x303d('0x49'))){_0x31bc15[_0x303d('0x33')]=qs['limit'](_0x123d0e['query'][_0x303d('0x33')]);_0x31bc15['offset']=qs['offset'](_0x123d0e[_0x303d('0x43')][_0x303d('0x32')]);}_0x31bc15[_0x303d('0x4a')]=qs[_0x303d('0x4b')](_0x123d0e[_0x303d('0x43')][_0x303d('0x4b')]);_0x31bc15['where']=qs[_0x303d('0x45')](_['pick'](_0x123d0e['query'],_0x88c425[_0x303d('0x45')]),_0x39b701);if(_0x123d0e[_0x303d('0x43')][_0x303d('0x4c')]){_0x31bc15['where']=_['merge'](_0x31bc15[_0x303d('0x4d')],{'$or':_['map'](_0x39b701,function(_0x14a984){if(_0x14a984[_0x303d('0x40')]!=='VIRTUAL'){var _0x2f0117={};_0x2f0117[_0x14a984['name']]={'$like':'%'+_0x123d0e[_0x303d('0x43')]['filter']+'%'};return _0x2f0117;}})});}_0x31bc15=_[_0x303d('0x4e')]({},_0x31bc15,_0x123d0e['options']);var _0x4f0801={'where':_0x31bc15[_0x303d('0x4d')]};return db['ChatMessage'][_0x303d('0x35')](_0x4f0801)[_0x303d('0x23')](function(_0x9d4189){_0x4ae2c9[_0x303d('0x35')]=_0x9d4189;if(_0x123d0e[_0x303d('0x43')][_0x303d('0x4f')]){_0x31bc15[_0x303d('0x50')]=[{'all':!![]}];}return db[_0x303d('0x3e')][_0x303d('0x51')](_0x31bc15);})['then'](function(_0x4a0489){_0x4ae2c9['rows']=_0x4a0489;return _0x4ae2c9;})['then'](respondWithFilteredResult(_0x4b9890,_0x31bc15))['catch'](handleError(_0x4b9890,null));};exports[_0x303d('0x52')]=function(_0x5ef63a,_0x38aa51){var _0x39e2ac={'raw':!![],'where':{'id':_0x5ef63a['params']['id']}},_0x5403e7={};_0x5403e7[_0x303d('0x42')]=_[_0x303d('0x44')](db[_0x303d('0x3e')][_0x303d('0x3f')]);_0x5403e7[_0x303d('0x43')]=_[_0x303d('0x44')](_0x5ef63a[_0x303d('0x43')]);_0x5403e7[_0x303d('0x45')]=_[_0x303d('0x46')](_0x5403e7[_0x303d('0x42')],_0x5403e7[_0x303d('0x43')]);_0x39e2ac[_0x303d('0x48')]=_[_0x303d('0x46')](_0x5403e7[_0x303d('0x42')],qs[_0x303d('0x47')](_0x5ef63a[_0x303d('0x43')][_0x303d('0x47')]));_0x39e2ac[_0x303d('0x48')]=_0x39e2ac['attributes']['length']?_0x39e2ac['attributes']:_0x5403e7['model'];if(_0x5ef63a[_0x303d('0x43')][_0x303d('0x4f')]){_0x39e2ac[_0x303d('0x50')]=[{'all':!![]}];}_0x39e2ac=_[_0x303d('0x4e')]({},_0x39e2ac,_0x5ef63a['options']);return db[_0x303d('0x3e')][_0x303d('0x53')](_0x39e2ac)[_0x303d('0x23')](handleEntityNotFound(_0x38aa51,null))[_0x303d('0x23')](respondWithResult(_0x38aa51,null))[_0x303d('0x2d')](handleError(_0x38aa51,null));};exports['create']=function(_0x3269d0,_0x20f2e2){return db[_0x303d('0x3e')]['create'](_0x3269d0[_0x303d('0x54')],{})[_0x303d('0x23')](respondWithResult(_0x20f2e2,0xc9))[_0x303d('0x2d')](handleError(_0x20f2e2,null));};exports['update']=function(_0x50c597,_0x40d72e){if(_0x50c597['body']['id']){delete _0x50c597[_0x303d('0x54')]['id'];}return db[_0x303d('0x3e')]['find']({'where':{'id':_0x50c597['params']['id']}})[_0x303d('0x23')](handleEntityNotFound(_0x40d72e,null))[_0x303d('0x23')](saveUpdates(_0x50c597['body'],null))[_0x303d('0x23')](respondWithResult(_0x40d72e,null))['catch'](handleError(_0x40d72e,null));};exports[_0x303d('0x39')]=function(_0x30ee30,_0x12a2f0){return db[_0x303d('0x3e')][_0x303d('0x53')]({'where':{'id':_0x30ee30[_0x303d('0x55')]['id']}})[_0x303d('0x23')](handleEntityNotFound(_0x12a2f0,null))[_0x303d('0x23')](removeEntity(_0x12a2f0,null))['catch'](handleError(_0x12a2f0,null));};exports[_0x303d('0x56')]=function(_0x34966e,_0x621148){return db['ChatMessage']['describe']()[_0x303d('0x23')](respondWithResult(_0x621148,null))['catch'](handleError(_0x621148,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x284064,_0xf60477,_0x4ca3fc){var _0x5f0759={'agent':{},'channel':_0x303d('0x57')};if(_0x284064[_0x303d('0x54')]['id']){delete _0x284064['body']['id'];}_0x284064[_0x303d('0x54')]['read']=!![];_0x284064['body'][_0x303d('0x58')]=moment()[_0x303d('0x59')](_0x303d('0x5a'));_0x284064[_0x303d('0x54')][_0x303d('0x5b')]=_0x284064[_0x303d('0x54')][_0x303d('0x5b')]||_0x284064[_0x303d('0x5c')]['id'];_0x5f0759['agent']['id']=_0x284064[_0x303d('0x54')]['UserId'];return db[_0x303d('0x3e')][_0x303d('0x53')]({'where':{'id':_0x284064[_0x303d('0x55')]['id'],'UserId':null}})[_0x303d('0x23')](handleEntityNotFound(_0xf60477,null))[_0x303d('0x23')](saveUpdates(_0x284064[_0x303d('0x54')],null))['then'](function(_0xf4e4d3){if(_0xf4e4d3){_0x5f0759['message']=_0xf4e4d3[_0x303d('0x5d')]({'plain':!![]});return db[_0x303d('0x5e')][_0x303d('0x53')]({'where':{'id':_0xf4e4d3[_0x303d('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xf60477,null))[_0x303d('0x23')](function(_0x149513){if(_0x149513){return _0x149513[_0x303d('0x38')]({'UserId':_0x284064['body']['UserId'],'read1stAt':_[_0x303d('0x60')](_0x149513['read1stAt'])?moment()[_0x303d('0x59')](_0x303d('0x5a')):undefined});}return null;})[_0x303d('0x23')](function(_0x4d1118){if(_0x4d1118){_0x5f0759[_0x303d('0x61')]=_0x4d1118[_0x303d('0x5d')]({'plain':!![]});interaction_log['info'](_0x303d('0x62'),_0x284064['user']['id'],_0x284064[_0x303d('0x5c')][_0x303d('0x3b')],_0x284064[_0x303d('0x5c')][_0x303d('0x63')],_0x5f0759[_0x303d('0x61')]['id'],_0x284064['body']?JSON['stringify'](_0x284064[_0x303d('0x54')]):'null');return respondWithRpcPromise(_0x303d('0x64'),'acceptMessage',_0x5f0759);}return null;})[_0x303d('0x23')](function(_0x2611ab){var _0x22e820='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2611ab[_0x303d('0x2b')]['ContactId'];return db[_0x303d('0x65')]['query'](_0x22e820,{'type':db[_0x303d('0x66')][_0x303d('0x67')][_0x303d('0x68')],'raw':!![]})[_0x303d('0x23')](function(_0xe7da24){return _0xe7da24;});})['then'](function(_0x2930f1){if(_0x2930f1){_0x5f0759[_0x303d('0x2b')][_0x303d('0x69')]=_0x2930f1[0x0];if(!_0x284064[_0x303d('0x54')][_0x303d('0x5b')])return;return db[_0x303d('0x6a')][_0x303d('0x53')]({'where':{'id':_0x284064[_0x303d('0x54')]['UserId'],'role':_0x303d('0x6b')},'attributes':['id',_0x303d('0x3b'),_0x303d('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0x303d('0x23')](function(_0x1057d3){if(!_0x1057d3)return null;_0x5f0759[_0x303d('0x2b')][_0x303d('0x6b')]=_0x1057d3;return _0x5f0759;})[_0x303d('0x23')](function(_0x1281fa){if(_0x1281fa){if(_0x284064[_0x303d('0x54')][_0x303d('0x6d')]){_0x5f0759['message'][_0x303d('0x6e')]=util[_0x303d('0x59')]('SIP/%s',_0x284064['user'][_0x303d('0x3b')]);_0x5f0759[_0x303d('0x2b')][_0x303d('0x6f')]=_0x5f0759['channel'];_0x5f0759['message'][_0x303d('0x70')]=_0x5f0759[_0x303d('0x6f')];_0x5f0759['message']['event']=_0x303d('0x71');return respondWithRpcPromise('EventManager',_0x303d('0x72'),{'event':_0x303d('0x73'),'message':_[_0x303d('0x4e')](_0x5f0759[_0x303d('0x2b')],JSON[_0x303d('0x74')](_0x5f0759[_0x303d('0x61')][_0x303d('0x75')]))},client9002)['then'](function(){return _0x5f0759;});}return _0x5f0759;}return null;})['then'](respondWithResult(_0xf60477,null))[_0x303d('0x2d')](handleError(_0xf60477,null));};var interaction_log=require(_0x303d('0x14'))(_0x303d('0x76'));exports[_0x303d('0x37')]=function(_0x4eccd7,_0x1da0d1,_0x524521){var _0x2beb00={'agent':{},'channel':_0x303d('0x57')};if(_0x4eccd7[_0x303d('0x54')]['id']){delete _0x4eccd7[_0x303d('0x54')]['id'];}_0x4eccd7[_0x303d('0x54')][_0x303d('0x5b')]=_0x4eccd7[_0x303d('0x54')][_0x303d('0x5b')]||_0x4eccd7[_0x303d('0x5c')]['id'];_0x2beb00['agent']['id']=_0x4eccd7[_0x303d('0x54')]['UserId'];return db[_0x303d('0x3e')][_0x303d('0x53')]({'where':{'id':_0x4eccd7[_0x303d('0x55')]['id'],'UserId':null}})[_0x303d('0x23')](handleEntityNotFound(_0x1da0d1,null))[_0x303d('0x23')](function(_0x217fb8){if(_0x217fb8){_0x2beb00[_0x303d('0x2b')]=_0x217fb8[_0x303d('0x5d')]({'plain':!![]});return db['ChatInteraction'][_0x303d('0x53')]({'where':{'id':_0x217fb8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1da0d1,null))[_0x303d('0x23')](function(_0x7fb273){if(_0x7fb273){_0x2beb00[_0x303d('0x61')]=_0x7fb273['get']({'plain':!![]});interaction_log[_0x303d('0x24')](_0x303d('0x77'),_0x4eccd7[_0x303d('0x5c')]['id'],_0x4eccd7[_0x303d('0x5c')][_0x303d('0x3b')],_0x4eccd7[_0x303d('0x5c')][_0x303d('0x63')],_0x2beb00[_0x303d('0x61')]['id'],_0x4eccd7[_0x303d('0x54')]?JSON[_0x303d('0x29')](_0x4eccd7[_0x303d('0x54')]):_0x303d('0x78'));return respondWithRpcPromise(_0x303d('0x79'),_0x303d('0x7a'),_0x2beb00);}return null;})[_0x303d('0x23')](function(_0x40f37a){var _0x37c9f5=_0x303d('0x7b')+_0x40f37a['message'][_0x303d('0x7c')];return db['sequelize']['query'](_0x37c9f5,{'type':db['Sequelize']['QueryTypes'][_0x303d('0x68')],'raw':!![]})[_0x303d('0x23')](function(_0x35db40){return _0x35db40;});})[_0x303d('0x23')](function(_0x1955af){if(_0x1955af){_0x2beb00[_0x303d('0x2b')][_0x303d('0x69')]=_0x1955af[0x0];if(!_0x4eccd7[_0x303d('0x54')][_0x303d('0x5b')])return;return db[_0x303d('0x6a')]['find']({'where':{'id':_0x4eccd7[_0x303d('0x54')]['UserId'],'role':_0x303d('0x6b')},'attributes':['id',_0x303d('0x3b'),_0x303d('0x6c'),_0x303d('0x7d'),_0x303d('0x7e')],'raw':!![]});}return null;})['then'](function(_0x5750ce){if(!_0x5750ce)return null;_0x2beb00[_0x303d('0x2b')][_0x303d('0x6b')]=_0x5750ce;return _0x2beb00;})[_0x303d('0x23')](function(_0x187bf0){if(_0x187bf0){_0x187bf0[_0x303d('0x2b')][_0x303d('0x6e')]=util[_0x303d('0x59')]('SIP/%s',_0x4eccd7[_0x303d('0x5c')]['name']);_0x187bf0[_0x303d('0x2b')][_0x303d('0x6f')]=_0x2beb00[_0x303d('0x6f')];_0x187bf0['message'][_0x303d('0x70')]=_0x2beb00[_0x303d('0x6f')];_0x187bf0[_0x303d('0x2b')][_0x303d('0x7f')]=_0x303d('0x37');respondWithRpcPromise(_0x303d('0x72'),'EventManager',{'event':_0x303d('0x80'),'message':_[_0x303d('0x4e')](_0x2beb00[_0x303d('0x2b')],JSON[_0x303d('0x74')](_0x2beb00[_0x303d('0x61')][_0x303d('0x75')]))},client9002);return _0x2beb00;}return null;})['then'](respondWithResult(_0x1da0d1,null))[_0x303d('0x2d')](handleError(_0x1da0d1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index dfe9b62..059b70b 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 _0x7bbf=['update','remove','emit','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x48be24,_0xf4cba){var _0x445643=function(_0x3f7119){while(--_0x3f7119){_0x48be24['push'](_0x48be24['shift']());}};_0x445643(++_0xf4cba);}(_0x7bbf,0x16c));var _0xf7bb=function(_0x253383,_0x26abe7){_0x253383=_0x253383-0x0;var _0x1dcb3d=_0x7bbf[_0x253383];return _0x1dcb3d;};'use strict';var EventEmitter=require(_0xf7bb('0x0'));var ChatMessage=require(_0xf7bb('0x1'))['db'][_0xf7bb('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf7bb('0x3')](0x0);var events={'afterCreate':_0xf7bb('0x4'),'afterUpdate':_0xf7bb('0x5'),'afterDestroy':_0xf7bb('0x6')};function emitEvent(_0x56f21e){return function(_0x49abb5,_0x41cae0,_0x3c0c15){ChatMessageEvents[_0xf7bb('0x7')](_0x56f21e+':'+_0x49abb5['id'],_0x49abb5);ChatMessageEvents[_0xf7bb('0x7')](_0x56f21e,_0x49abb5);_0x3c0c15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf7bb('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xda19=['ChatMessage','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0x166));var _0x9da1=function(_0xfaa291,_0x33534f){_0xfaa291=_0xfaa291-0x0;var _0x8ad402=_0xda19[_0xfaa291];return _0x8ad402;};'use strict';var EventEmitter=require(_0x9da1('0x0'));var ChatMessage=require(_0x9da1('0x1'))['db'][_0x9da1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9da1('0x3')](0x0);var events={'afterCreate':_0x9da1('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a0b72){return function(_0x1919d9,_0x26fdfc,_0x175eae){ChatMessageEvents[_0x9da1('0x5')](_0x2a0b72+':'+_0x1919d9['id'],_0x1919d9);ChatMessageEvents[_0x9da1('0x5')](_0x2a0b72,_0x1919d9);_0x175eae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9da1('0x6')](e,emitEvent(event));}}module[_0x9da1('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 1839a71..a638801 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 _0x539b=['ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne'];(function(_0x6465b0,_0x45653a){var _0x4884fe=function(_0x427085){while(--_0x427085){_0x6465b0['push'](_0x6465b0['shift']());}};_0x4884fe(++_0x45653a);}(_0x539b,0x1ac));var _0xb539=function(_0x4f1f20,_0x14d272){_0x4f1f20=_0x4f1f20-0x0;var _0x5d8085=_0x539b[_0x4f1f20];return _0x5d8085;};'use strict';var _=require(_0xb539('0x0'));var util=require(_0xb539('0x1'));var logger=require('../../config/logger')(_0xb539('0x2'));var moment=require(_0xb539('0x3'));var BPromise=require('bluebird');var rp=require(_0xb539('0x4'));var fs=require('fs');var path=require(_0xb539('0x5'));var rimraf=require(_0xb539('0x6'));var config=require(_0xb539('0x7'));var attributes=require(_0xb539('0x8'));module['exports']=function(_0x1a55e3,_0x22ed09){return _0x1a55e3[_0xb539('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xb539('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1dc659,_0x5c751b,_0x135304){var _0xecfc4d=_0x1a55e3[_0xb539('0xb')];var _0x10c699=_0x1dc659[_0xb539('0xc')]({'plain':!![]});if(_0x10c699[_0xb539('0xd')][_0xb539('0xe')]()==='in'||_0x10c699['direction'][_0xb539('0xe')]()===_0xb539('0xf')&&!_0x10c699['secret']&&!_[_0xb539('0x10')](_0x10c699[_0xb539('0x11')])){_0xecfc4d[_0xb539('0x12')][_0xb539('0x13')]({'where':{'id':_0x10c699[_0xb539('0x14')]}})[_0xb539('0x15')](function(_0x185cfd){if(_0x185cfd){_0x185cfd[_0xb539('0x16')]({'lastMsgAt':_0x10c699[_0xb539('0x17')],'lastMsgDirection':_0x10c699['direction'][_0xb539('0xe')]()});}})[_0xb539('0x18')](function(_0x40fa35){console[_0xb539('0x19')](_0x40fa35);});}_0x135304();}},'charset':_0xb539('0x1a'),'collate':_0xb539('0x1b')});}; \ No newline at end of file +var _0xdb4a=['./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c276d,_0x291770){var _0x26f05e=function(_0x17009f){while(--_0x17009f){_0x3c276d['push'](_0x3c276d['shift']());}};_0x26f05e(++_0x291770);}(_0xdb4a,0x1ba));var _0xadb4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdb4a[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xadb4('0x0'));var util=require(_0xadb4('0x1'));var logger=require(_0xadb4('0x2'))(_0xadb4('0x3'));var moment=require(_0xadb4('0x4'));var BPromise=require('bluebird');var rp=require(_0xadb4('0x5'));var fs=require('fs');var path=require(_0xadb4('0x6'));var rimraf=require(_0xadb4('0x7'));var config=require('../../config/environment');var attributes=require(_0xadb4('0x8'));module[_0xadb4('0x9')]=function(_0x2c8e5f,_0xe931f5){return _0x2c8e5f['define'](_0xadb4('0xa'),attributes,{'tableName':_0xadb4('0xb'),'paranoid':![],'indexes':[{'name':_0xadb4('0xc'),'fields':[_0xadb4('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x222558,_0x303cc7,_0x57e7d2){var _0x12b064=_0x2c8e5f[_0xadb4('0xe')];var _0x54f8cf=_0x222558[_0xadb4('0xf')]({'plain':!![]});if(_0x54f8cf['direction'][_0xadb4('0x10')]()==='in'||_0x54f8cf[_0xadb4('0x11')][_0xadb4('0x10')]()==='out'&&!_0x54f8cf[_0xadb4('0x12')]&&!_[_0xadb4('0x13')](_0x54f8cf[_0xadb4('0x14')])){_0x12b064[_0xadb4('0x15')][_0xadb4('0x16')]({'where':{'id':_0x54f8cf['ChatInteractionId']}})[_0xadb4('0x17')](function(_0x3b3d54){if(_0x3b3d54){_0x3b3d54[_0xadb4('0x18')]({'lastMsgAt':_0x54f8cf[_0xadb4('0x19')],'lastMsgDirection':_0x54f8cf[_0xadb4('0x11')][_0xadb4('0x10')]()});}})[_0xadb4('0x1a')](function(_0x26c550){console[_0xadb4('0x1b')](_0x26c550);});}_0x57e7d2();}},'charset':_0xadb4('0x1c'),'collate':_0xadb4('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 719a7f1..ceb53fa 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 _0xdb4d=['redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','defaults'];(function(_0x374359,_0x35adb6){var _0x4a8449=function(_0x232382){while(--_0x232382){_0x374359['push'](_0x374359['shift']());}};_0x4a8449(++_0x35adb6);}(_0xdb4d,0x77));var _0xddb4=function(_0x316903,_0x17cf64){_0x316903=_0x316903-0x0;var _0xbdecaf=_0xdb4d[_0x316903];return _0xbdecaf;};'use strict';var _=require(_0xddb4('0x0'));var util=require('util');var moment=require(_0xddb4('0x1'));var BPromise=require('bluebird');var rs=require(_0xddb4('0x2'));var fs=require('fs');var Redis=require(_0xddb4('0x3'));var db=require(_0xddb4('0x4'))['db'];var utils=require(_0xddb4('0x5'));var logger=require(_0xddb4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xddb4('0x7')]['http']({'port':0x232a});config['redis']=_[_0xddb4('0x8')](config[_0xddb4('0x9')],{'host':_0xddb4('0xa'),'port':0x18eb});var socket=require(_0xddb4('0xb'))(new Redis(config[_0xddb4('0x9')]));require(_0xddb4('0xc'))[_0xddb4('0xd')](socket);function respondWithRpcPromise(_0x8e32ca,_0xc367ff,_0xe111f7){return new BPromise(function(_0x4170e7,_0x3bc514){return client[_0xddb4('0xe')](_0x8e32ca,_0xe111f7)[_0xddb4('0xf')](function(_0x33e085){logger[_0xddb4('0x10')](_0xddb4('0x11'),_0xc367ff,_0xddb4('0x12'));logger['debug'](_0xddb4('0x13'),_0xc367ff,'request\x20sent',JSON[_0xddb4('0x14')](_0x33e085));if(_0x33e085[_0xddb4('0x15')]){if(_0x33e085[_0xddb4('0x15')]['code']===0x1f4){logger[_0xddb4('0x15')](_0xddb4('0x11'),_0xc367ff,_0x33e085[_0xddb4('0x15')]['message']);return _0x3bc514(_0x33e085[_0xddb4('0x15')][_0xddb4('0x16')]);}logger[_0xddb4('0x15')](_0xddb4('0x11'),_0xc367ff,_0x33e085[_0xddb4('0x15')][_0xddb4('0x16')]);return _0x4170e7(_0x33e085[_0xddb4('0x15')][_0xddb4('0x16')]);}else{logger[_0xddb4('0x10')]('ChatMessage,\x20%s,\x20%s',_0xc367ff,'request\x20sent');_0x4170e7(_0x33e085[_0xddb4('0x17')][_0xddb4('0x16')]);}})[_0xddb4('0x18')](function(_0x49e8ec){logger[_0xddb4('0x15')]('ChatMessage,\x20%s,\x20%s',_0xc367ff,_0x49e8ec);_0x3bc514(_0x49e8ec);});});}exports[_0xddb4('0x19')]=function(_0x20943e){var _0x10263a=this;return new Promise(function(_0x2e6b34,_0x454813){return db[_0xddb4('0x1a')][_0xddb4('0x1b')](_0x20943e[_0xddb4('0x1c')],{'raw':_0x20943e['options']?_0x20943e[_0xddb4('0x1d')][_0xddb4('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x14871b){logger[_0xddb4('0x10')](_0xddb4('0x19'),_0x20943e);logger[_0xddb4('0x1f')]('CreateChatMessage',_0x20943e,JSON[_0xddb4('0x14')](_0x14871b));_0x2e6b34(_0x14871b);})[_0xddb4('0x18')](function(_0x1ba86c){logger['error'](_0xddb4('0x19'),_0x1ba86c[_0xddb4('0x16')],_0x20943e);_0x454813(_0x10263a[_0xddb4('0x15')](0x1f4,_0x1ba86c[_0xddb4('0x16')]));});});}; \ No newline at end of file +var _0xf326=['catch','create','body','options','raw','CreateChatMessage','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0xf326,0x17d));var _0x6f32=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0xf326[_0x1551af];return _0xd8eb82;};'use strict';var _=require('lodash');var util=require(_0x6f32('0x0'));var moment=require(_0x6f32('0x1'));var BPromise=require(_0x6f32('0x2'));var rs=require(_0x6f32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f32('0x4'))['db'];var utils=require(_0x6f32('0x5'));var logger=require(_0x6f32('0x6'))(_0x6f32('0x7'));var config=require(_0x6f32('0x8'));var jayson=require(_0x6f32('0x9'));var client=jayson[_0x6f32('0xa')][_0x6f32('0xb')]({'port':0x232a});config[_0x6f32('0xc')]=_['defaults'](config[_0x6f32('0xc')],{'host':_0x6f32('0xd'),'port':0x18eb});var socket=require(_0x6f32('0xe'))(new Redis(config[_0x6f32('0xc')]));require(_0x6f32('0xf'))[_0x6f32('0x10')](socket);function respondWithRpcPromise(_0x4fc31c,_0x3c240f,_0x58d673){return new BPromise(function(_0x320e6b,_0x160676){return client[_0x6f32('0x11')](_0x4fc31c,_0x58d673)[_0x6f32('0x12')](function(_0x391421){logger['info'](_0x6f32('0x13'),_0x3c240f,_0x6f32('0x14'));logger[_0x6f32('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c240f,_0x6f32('0x14'),JSON['stringify'](_0x391421));if(_0x391421['error']){if(_0x391421[_0x6f32('0x16')][_0x6f32('0x17')]===0x1f4){logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);return _0x160676(_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);}logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x391421[_0x6f32('0x16')][_0x6f32('0x18')]);return _0x320e6b(_0x391421[_0x6f32('0x16')]['message']);}else{logger[_0x6f32('0x19')](_0x6f32('0x13'),_0x3c240f,'request\x20sent');_0x320e6b(_0x391421[_0x6f32('0x1a')][_0x6f32('0x18')]);}})[_0x6f32('0x1b')](function(_0x21cd25){logger[_0x6f32('0x16')](_0x6f32('0x13'),_0x3c240f,_0x21cd25);_0x160676(_0x21cd25);});});}exports['CreateChatMessage']=function(_0x25d9df){var _0x216b95=this;return new Promise(function(_0x1443d7,_0x5b3886){return db['ChatMessage'][_0x6f32('0x1c')](_0x25d9df[_0x6f32('0x1d')],{'raw':_0x25d9df[_0x6f32('0x1e')]?_0x25d9df[_0x6f32('0x1e')][_0x6f32('0x1f')]===undefined?!![]:![]:!![]})[_0x6f32('0x12')](function(_0x515802){logger[_0x6f32('0x19')](_0x6f32('0x20'),_0x25d9df);logger['debug'](_0x6f32('0x20'),_0x25d9df,JSON[_0x6f32('0x21')](_0x515802));_0x1443d7(_0x515802);})[_0x6f32('0x1b')](function(_0x3aeabb){logger['error']('CreateChatMessage',_0x3aeabb[_0x6f32('0x18')],_0x25d9df);_0x5b3886(_0x216b95[_0x6f32('0x16')](0x1f4,_0x3aeabb[_0x6f32('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2e30df6..d3af11c 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 _0x17c4=['save','remove','update','emit','removeListener','length','./chatMessage.events'];(function(_0x1754e1,_0x333501){var _0x327090=function(_0x2f5014){while(--_0x2f5014){_0x1754e1['push'](_0x1754e1['shift']());}};_0x327090(++_0x333501);}(_0x17c4,0x102));var _0x417c=function(_0x51069d,_0x51ce9d){_0x51069d=_0x51069d-0x0;var _0x3d9440=_0x17c4[_0x51069d];return _0x3d9440;};'use strict';var ChatMessageEvents=require(_0x417c('0x0'));var events=[_0x417c('0x1'),_0x417c('0x2'),_0x417c('0x3')];function createListener(_0x2f1975,_0x2e9ccf){return function(_0x6579e5){_0x2e9ccf[_0x417c('0x4')](_0x2f1975,_0x6579e5);};}function removeListener(_0x212ac0,_0x413ee5){return function(){ChatMessageEvents[_0x417c('0x5')](_0x212ac0,_0x413ee5);};}exports['register']=function(_0x24e681){for(var _0x117c5d=0x0,_0x340095=events[_0x417c('0x6')];_0x117c5d<_0x340095;_0x117c5d++){var _0x1106df=events[_0x117c5d];var _0x4c6534=createListener('chatMessage:'+_0x1106df,_0x24e681);ChatMessageEvents['on'](_0x1106df,_0x4c6534);}}; \ No newline at end of file +var _0x2e65=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x2e65,0x193));var _0x52e6=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x2e65[_0x1646fa];return _0x5a47a5;};'use strict';var ChatMessageEvents=require(_0x52e6('0x0'));var events=[_0x52e6('0x1'),_0x52e6('0x2'),_0x52e6('0x3')];function createListener(_0xd7e693,_0x23aa21){return function(_0x1ab739){_0x23aa21[_0x52e6('0x4')](_0xd7e693,_0x1ab739);};}function removeListener(_0x47912f,_0x383919){return function(){ChatMessageEvents[_0x52e6('0x5')](_0x47912f,_0x383919);};}exports[_0x52e6('0x6')]=function(_0xe67caa){for(var _0x1cf6d2=0x0,_0x116651=events[_0x52e6('0x7')];_0x1cf6d2<_0x116651;_0x1cf6d2++){var _0x1401a3=events[_0x1cf6d2];var _0x27f270=createListener(_0x52e6('0x8')+_0x1401a3,_0xe67caa);ChatMessageEvents['on'](_0x1401a3,_0x27f270);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 76fb696..fffacef 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 _0x6581=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','show','post','chat','chatmessage:create','create','put','/:id','update','accept','/:id/reject','destroy'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x6581,0x190));var _0x1658=function(_0x1ea110,_0x42b99d){_0x1ea110=_0x1ea110-0x0;var _0x5749af=_0x6581[_0x1ea110];return _0x5749af;};'use strict';var multer=require('multer');var util=require(_0x1658('0x0'));var path=require(_0x1658('0x1'));var timeout=require(_0x1658('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1658('0x3'));var auth=require(_0x1658('0x4'));var interaction=require(_0x1658('0x5'));var config=require('../../config/environment');var controller=require(_0x1658('0x6'));router[_0x1658('0x7')]('/',auth[_0x1658('0x8')](),controller['index']);router[_0x1658('0x7')]('/describe',auth[_0x1658('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1658('0x8')](),controller[_0x1658('0x9')]);router[_0x1658('0xa')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x1658('0xb'),_0x1658('0xc')),controller[_0x1658('0xd')]);router[_0x1658('0xe')](_0x1658('0xf'),controller[_0x1658('0x10')]);router[_0x1658('0xe')]('/:id/accept',auth[_0x1658('0x8')](),controller[_0x1658('0x11')]);router['put'](_0x1658('0x12'),auth[_0x1658('0x8')](),controller['reject']);router['delete'](_0x1658('0xf'),auth[_0x1658('0x8')](),controller[_0x1658('0x13')]);module[_0x1658('0x14')]=router; \ No newline at end of file +var _0x3b1e=['/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','show','post','tracked','chatmessage:create','create','put'];(function(_0x5b537e,_0x325a74){var _0x16dae3=function(_0x11492b){while(--_0x11492b){_0x5b537e['push'](_0x5b537e['shift']());}};_0x16dae3(++_0x325a74);}(_0x3b1e,0x6e));var _0xe3b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b1e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe3b1('0x0'));var util=require(_0xe3b1('0x1'));var path=require(_0xe3b1('0x2'));var timeout=require(_0xe3b1('0x3'));var express=require(_0xe3b1('0x4'));var router=express[_0xe3b1('0x5')]();var fs_extra=require(_0xe3b1('0x6'));var auth=require(_0xe3b1('0x7'));var interaction=require(_0xe3b1('0x8'));var config=require('../../config/environment');var controller=require(_0xe3b1('0x9'));router[_0xe3b1('0xa')]('/',auth[_0xe3b1('0xb')](),controller[_0xe3b1('0xc')]);router[_0xe3b1('0xa')]('/describe',auth[_0xe3b1('0xb')](),controller[_0xe3b1('0xd')]);router[_0xe3b1('0xa')]('/:id',auth[_0xe3b1('0xb')](),controller[_0xe3b1('0xe')]);router[_0xe3b1('0xf')]('/',auth['isAuthenticated'](),interaction[_0xe3b1('0x10')]('chat',_0xe3b1('0x11')),controller[_0xe3b1('0x12')]);router[_0xe3b1('0x13')]('/:id',controller['update']);router['put'](_0xe3b1('0x14'),auth[_0xe3b1('0xb')](),controller[_0xe3b1('0x15')]);router[_0xe3b1('0x13')](_0xe3b1('0x16'),auth[_0xe3b1('0xb')](),controller[_0xe3b1('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe3b1('0x18')]);module[_0xe3b1('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 3c9d9f4..52ff177 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 _0x60c9=['TEXT','medium','sequelize','exports'];(function(_0x57f4b2,_0xf506cd){var _0x242289=function(_0x2d3133){while(--_0x2d3133){_0x57f4b2['push'](_0x57f4b2['shift']());}};_0x242289(++_0xf506cd);}(_0x60c9,0x116));var _0x960c=function(_0x245166,_0x30c8d7){_0x245166=_0x245166-0x0;var _0x294561=_0x60c9[_0x245166];return _0x294561;};'use strict';var Sequelize=require(_0x960c('0x0'));module[_0x960c('0x1')]={'body':{'type':Sequelize[_0x960c('0x2')](_0x960c('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xacd2=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacd2,0x94));var _0x2acd=function(_0x20625e,_0x410c5f){_0x20625e=_0x20625e-0x0;var _0x37099a=_0xacd2[_0x20625e];return _0x37099a;};'use strict';var Sequelize=require(_0x2acd('0x0'));module[_0x2acd('0x1')]={'body':{'type':Sequelize[_0x2acd('0x2')](_0x2acd('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index b39d06c..e4570e5 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(_0x4ef41b,_0x176e87){var _0x1c0549=function(_0x3adcb5){while(--_0x3adcb5){_0x4ef41b['push'](_0x4ef41b['shift']());}};_0x1c0549(++_0x176e87);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0x2b1e00,_0x4c67ed){var _0x53dce7=function(_0x4aa9b0){while(--_0x4aa9b0){_0x2b1e00['push'](_0x2b1e00['shift']());}};_0x53dce7(++_0x4c67ed);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 24fb5be..79457e2 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 _0xf864=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1bd679,_0xa9ef66){var _0x5d7eab=function(_0x3fb440){while(--_0x3fb440){_0x1bd679['push'](_0x1bd679['shift']());}};_0x5d7eab(++_0xa9ef66);}(_0xf864,0x16c));var _0x4f86=function(_0x30edc8,_0x32f580){_0x30edc8=_0x30edc8-0x0;var _0x23005b=_0xf864[_0x30edc8];return _0x23005b;};'use strict';var _=require(_0x4f86('0x0'));var util=require(_0x4f86('0x1'));var logger=require(_0x4f86('0x2'))(_0x4f86('0x3'));var moment=require(_0x4f86('0x4'));var BPromise=require(_0x4f86('0x5'));var rp=require(_0x4f86('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f86('0x7'));var config=require(_0x4f86('0x8'));var attributes=require(_0x4f86('0x9'));module[_0x4f86('0xa')]=function(_0x16ec82,_0x15205a){return _0x16ec82[_0x4f86('0xb')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f86('0xc'),'collate':_0x4f86('0xd')});}; \ No newline at end of file +var _0xd8ca=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58ba86,_0x41f5d1){var _0x14ebe8=function(_0x26eb90){while(--_0x26eb90){_0x58ba86['push'](_0x58ba86['shift']());}};_0x14ebe8(++_0x41f5d1);}(_0xd8ca,0xa2));var _0xad8c=function(_0x2ae15f,_0x3e1860){_0x2ae15f=_0x2ae15f-0x0;var _0x42a3d3=_0xd8ca[_0x2ae15f];return _0x42a3d3;};'use strict';var _=require(_0xad8c('0x0'));var util=require('util');var logger=require(_0xad8c('0x1'))(_0xad8c('0x2'));var moment=require(_0xad8c('0x3'));var BPromise=require(_0xad8c('0x4'));var rp=require(_0xad8c('0x5'));var fs=require('fs');var path=require(_0xad8c('0x6'));var rimraf=require(_0xad8c('0x7'));var config=require(_0xad8c('0x8'));var attributes=require(_0xad8c('0x9'));module['exports']=function(_0x3bda46,_0x220c55){return _0x3bda46[_0xad8c('0xa')]('ChatOfflineMessage',attributes,{'tableName':_0xad8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad8c('0xc'),'collate':_0xad8c('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6300d15..fdfc013 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 _0x9a02=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','message','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','request','then','info'];(function(_0x2eb828,_0x5b4396){var _0xdb47b7=function(_0x5797cb){while(--_0x5797cb){_0x2eb828['push'](_0x2eb828['shift']());}};_0xdb47b7(++_0x5b4396);}(_0x9a02,0x1a4));var _0x29a0=function(_0x561eec,_0x4aa701){_0x561eec=_0x561eec-0x0;var _0x3a3401=_0x9a02[_0x561eec];return _0x3a3401;};'use strict';var _=require(_0x29a0('0x0'));var util=require('util');var moment=require(_0x29a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x29a0('0x3'));var logger=require(_0x29a0('0x4'))('rpc');var config=require(_0x29a0('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1dc3,_0x1389bb,_0x285d78){return new BPromise(function(_0x1d646d,_0x142e18){return client[_0x29a0('0x6')](_0x1f1dc3,_0x285d78)[_0x29a0('0x7')](function(_0x398088){logger[_0x29a0('0x8')](_0x29a0('0x9'),_0x1389bb,_0x29a0('0xa'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1389bb,_0x29a0('0xa'),JSON['stringify'](_0x398088));if(_0x398088[_0x29a0('0xb')]){if(_0x398088['error']['code']===0x1f4){logger[_0x29a0('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1389bb,_0x398088[_0x29a0('0xb')][_0x29a0('0xc')]);return _0x142e18(_0x398088['error']['message']);}logger[_0x29a0('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1389bb,_0x398088[_0x29a0('0xb')][_0x29a0('0xc')]);return _0x1d646d(_0x398088[_0x29a0('0xb')][_0x29a0('0xc')]);}else{logger[_0x29a0('0x8')](_0x29a0('0x9'),_0x1389bb,_0x29a0('0xa'));_0x1d646d(_0x398088['result'][_0x29a0('0xc')]);}})['catch'](function(_0x2ab555){logger['error'](_0x29a0('0x9'),_0x1389bb,_0x2ab555);_0x142e18(_0x2ab555);});});} \ No newline at end of file +var _0xd28c=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29d082,_0x4bc402){var _0x11be31=function(_0x45b88c){while(--_0x45b88c){_0x29d082['push'](_0x29d082['shift']());}};_0x11be31(++_0x4bc402);}(_0xd28c,0x72));var _0xcd28=function(_0x44ba19,_0x4f829d){_0x44ba19=_0x44ba19-0x0;var _0x56f6ee=_0xd28c[_0x44ba19];return _0x56f6ee;};'use strict';var _=require('lodash');var util=require(_0xcd28('0x0'));var moment=require(_0xcd28('0x1'));var BPromise=require(_0xcd28('0x2'));var rs=require(_0xcd28('0x3'));var fs=require('fs');var Redis=require(_0xcd28('0x4'));var db=require(_0xcd28('0x5'))['db'];var utils=require(_0xcd28('0x6'));var logger=require(_0xcd28('0x7'))('rpc');var config=require(_0xcd28('0x8'));var jayson=require(_0xcd28('0x9'));var client=jayson['client'][_0xcd28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29634e,_0x5d5562,_0x3113d9){return new BPromise(function(_0x3c5c81,_0xe4edbd){return client['request'](_0x29634e,_0x3113d9)[_0xcd28('0xb')](function(_0x45251c){logger[_0xcd28('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5d5562,_0xcd28('0xd'));logger['debug'](_0xcd28('0xe'),_0x5d5562,'request\x20sent',JSON[_0xcd28('0xf')](_0x45251c));if(_0x45251c[_0xcd28('0x10')]){if(_0x45251c[_0xcd28('0x10')][_0xcd28('0x11')]===0x1f4){logger[_0xcd28('0x10')](_0xcd28('0x12'),_0x5d5562,_0x45251c[_0xcd28('0x10')]['message']);return _0xe4edbd(_0x45251c[_0xcd28('0x10')][_0xcd28('0x13')]);}logger['error'](_0xcd28('0x12'),_0x5d5562,_0x45251c[_0xcd28('0x10')][_0xcd28('0x13')]);return _0x3c5c81(_0x45251c['error'][_0xcd28('0x13')]);}else{logger['info'](_0xcd28('0x12'),_0x5d5562,_0xcd28('0xd'));_0x3c5c81(_0x45251c[_0xcd28('0x14')]['message']);}})[_0xcd28('0x15')](function(_0x39418b){logger['error'](_0xcd28('0x12'),_0x5d5562,_0x39418b);_0xe4edbd(_0x39418b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index fa58460..96c3050 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 _0xaf47=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','post','create','/:id','update','delete','destroy','exports','util'];(function(_0x42e06a,_0x2f5fd1){var _0x3d3c90=function(_0xbd9403){while(--_0xbd9403){_0x42e06a['push'](_0x42e06a['shift']());}};_0x3d3c90(++_0x2f5fd1);}(_0xaf47,0x1b8));var _0x7af4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf47[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7af4('0x0'));var path=require(_0x7af4('0x1'));var timeout=require(_0x7af4('0x2'));var express=require(_0x7af4('0x3'));var router=express['Router']();var fs_extra=require(_0x7af4('0x4'));var auth=require(_0x7af4('0x5'));var interaction=require(_0x7af4('0x6'));var config=require(_0x7af4('0x7'));var controller=require(_0x7af4('0x8'));router['get']('/',auth[_0x7af4('0x9')](),controller[_0x7af4('0xa')]);router['get'](_0x7af4('0xb'),auth[_0x7af4('0x9')](),controller[_0x7af4('0xc')]);router[_0x7af4('0xd')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7af4('0xe')]('/',auth[_0x7af4('0x9')](),controller[_0x7af4('0xf')]);router['put'](_0x7af4('0x10'),auth['isAuthenticated'](),controller[_0x7af4('0x11')]);router[_0x7af4('0x12')](_0x7af4('0x10'),auth[_0x7af4('0x9')](),controller[_0x7af4('0x13')]);module[_0x7af4('0x14')]=router; \ No newline at end of file +var _0x818e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','put','update','delete','destroy'];(function(_0x5a9123,_0x69bbac){var _0x1cb8d9=function(_0x56bf22){while(--_0x56bf22){_0x5a9123['push'](_0x5a9123['shift']());}};_0x1cb8d9(++_0x69bbac);}(_0x818e,0x1cf));var _0xe818=function(_0x622e87,_0x293775){_0x622e87=_0x622e87-0x0;var _0xd8f353=_0x818e[_0x622e87];return _0xd8f353;};'use strict';var multer=require('multer');var util=require(_0xe818('0x0'));var path=require(_0xe818('0x1'));var timeout=require(_0xe818('0x2'));var express=require(_0xe818('0x3'));var router=express[_0xe818('0x4')]();var fs_extra=require(_0xe818('0x5'));var auth=require(_0xe818('0x6'));var interaction=require(_0xe818('0x7'));var config=require(_0xe818('0x8'));var controller=require(_0xe818('0x9'));router[_0xe818('0xa')]('/',auth['isAuthenticated'](),controller[_0xe818('0xb')]);router[_0xe818('0xa')](_0xe818('0xc'),auth[_0xe818('0xd')](),controller[_0xe818('0xe')]);router[_0xe818('0xa')](_0xe818('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe818('0x10')](_0xe818('0xf'),auth[_0xe818('0xd')](),controller[_0xe818('0x11')]);router[_0xe818('0x12')]('/:id',auth[_0xe818('0xd')](),controller[_0xe818('0x13')]);module[_0xe818('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 8a17609..fc29c08 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 _0x6443=['ENUM','timeout','mouseOver','exports','STRING'];(function(_0x573b40,_0x35df55){var _0x2532a4=function(_0x2e1d99){while(--_0x2e1d99){_0x573b40['push'](_0x573b40['shift']());}};_0x2532a4(++_0x35df55);}(_0x6443,0xf8));var _0x3644=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0x6443[_0x39a2d6];return _0x23af66;};'use strict';var Sequelize=require('sequelize');module[_0x3644('0x0')]={'name':{'type':Sequelize[_0x3644('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3644('0x2')]('mouseOver',_0x3644('0x3')),'defaultValue':_0x3644('0x4')},'selector':{'type':Sequelize[_0x3644('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9a19=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x513f27,_0x5ce5ac){var _0x423a20=function(_0x336d10){while(--_0x336d10){_0x513f27['push'](_0x513f27['shift']());}};_0x423a20(++_0x5ce5ac);}(_0x9a19,0xaa));var _0x99a1=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x9a19[_0xa30766];return _0x24e780;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x99a1('0x3')](_0x99a1('0x4'),_0x99a1('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x99a1('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 95ad438..f5c2574 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 _0xcee8=['include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','length','includeAll'];(function(_0x38f91c,_0x25a21d){var _0x1fc0e5=function(_0x34f04f){while(--_0x34f04f){_0x38f91c['push'](_0x38f91c['shift']());}};_0x1fc0e5(++_0x25a21d);}(_0xcee8,0xb1));var _0x8cee=function(_0x4644a2,_0x1601a5){_0x4644a2=_0x4644a2-0x0;var _0x460618=_0xcee8[_0x4644a2];return _0x460618;};'use strict';var emlformat=require(_0x8cee('0x0'));var rimraf=require(_0x8cee('0x1'));var zipdir=require(_0x8cee('0x2'));var jsonpatch=require(_0x8cee('0x3'));var rp=require(_0x8cee('0x4'));var moment=require(_0x8cee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8cee('0x6'));var util=require(_0x8cee('0x7'));var path=require(_0x8cee('0x8'));var sox=require(_0x8cee('0x9'));var csv=require('to-csv');var ejs=require(_0x8cee('0xa'));var fs=require('fs');var fs_extra=require(_0x8cee('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8cee('0xd'));var toCsv=require(_0x8cee('0xe'));var querystring=require(_0x8cee('0xf'));var Papa=require(_0x8cee('0x10'));var Redis=require('ioredis');var authService=require(_0x8cee('0x11'));var qs=require(_0x8cee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cee('0x13'));var logger=require(_0x8cee('0x14'))('api');var utils=require(_0x8cee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8cee('0x16'));var db=require(_0x8cee('0x17'))['db'];function respondWithStatusCode(_0x404578,_0x28bd09){_0x28bd09=_0x28bd09||0xcc;return function(_0x4e1f09){if(_0x4e1f09){return _0x404578['sendStatus'](_0x28bd09);}return _0x404578[_0x8cee('0x18')](_0x28bd09)[_0x8cee('0x19')]();};}function respondWithResult(_0x10d74f,_0x227762){_0x227762=_0x227762||0xc8;return function(_0xedc808){if(_0xedc808){return _0x10d74f[_0x8cee('0x18')](_0x227762)[_0x8cee('0x1a')](_0xedc808);}};}function respondWithFilteredResult(_0x3c3694,_0x237248){return function(_0x487241){if(_0x487241){var _0x33b07e=typeof _0x237248[_0x8cee('0x1b')]===_0x8cee('0x1c')&&typeof _0x237248[_0x8cee('0x1d')]===_0x8cee('0x1c');var _0x5f53e3=_0x487241[_0x8cee('0x1e')];var _0x581ce9=_0x33b07e?0x0:_0x237248['offset'];var _0x8e242b=_0x33b07e?_0x487241[_0x8cee('0x1e')]:_0x237248[_0x8cee('0x1b')]+_0x237248[_0x8cee('0x1d')];var _0x42d863;if(_0x8e242b>=_0x5f53e3){_0x8e242b=_0x5f53e3;_0x42d863=0xc8;}else{_0x42d863=0xce;}_0x3c3694['status'](_0x42d863);return _0x3c3694[_0x8cee('0x1f')](_0x8cee('0x20'),_0x581ce9+'-'+_0x8e242b+'/'+_0x5f53e3)[_0x8cee('0x1a')](_0x487241);}return null;};}function patchUpdates(_0x5d1a1d){return function(_0x31dbd5){try{jsonpatch[_0x8cee('0x21')](_0x31dbd5,_0x5d1a1d,!![]);}catch(_0x52262a){return BPromise['reject'](_0x52262a);}return _0x31dbd5[_0x8cee('0x22')]();};}function saveUpdates(_0x47b3c0,_0x54539b){return function(_0x51a93f){if(_0x51a93f){return _0x51a93f['update'](_0x47b3c0)[_0x8cee('0x23')](function(_0x5109df){return _0x5109df;});}return null;};}function removeEntity(_0x117bc6,_0x5e231e){return function(_0x2ea47b){if(_0x2ea47b){return _0x2ea47b[_0x8cee('0x24')]()[_0x8cee('0x23')](function(){_0x117bc6[_0x8cee('0x18')](0xcc)[_0x8cee('0x19')]();});}};}function handleEntityNotFound(_0x51f79f,_0x89974f){return function(_0x415f47){if(!_0x415f47){_0x51f79f['sendStatus'](0x194);}return _0x415f47;};}function handleError(_0x307de3,_0xc2ad7f){_0xc2ad7f=_0xc2ad7f||0x1f4;return function(_0x5df746){logger['error'](_0x5df746[_0x8cee('0x25')]);if(_0x5df746[_0x8cee('0x26')]){delete _0x5df746[_0x8cee('0x26')];}_0x307de3[_0x8cee('0x18')](_0xc2ad7f)[_0x8cee('0x27')](_0x5df746);};}exports[_0x8cee('0x28')]=function(_0x51003d,_0x1572d5){var _0x4a7781={'raw':!![],'where':{'id':_0x51003d[_0x8cee('0x29')]['id']}},_0x75f082={};_0x75f082[_0x8cee('0x2a')]=_[_0x8cee('0x2b')](db[_0x8cee('0x2c')]['rawAttributes']);_0x75f082[_0x8cee('0x2d')]=_['keys'](_0x51003d[_0x8cee('0x2d')]);_0x75f082[_0x8cee('0x2e')]=_[_0x8cee('0x2f')](_0x75f082[_0x8cee('0x2a')],_0x75f082['query']);_0x4a7781[_0x8cee('0x30')]=_['intersection'](_0x75f082[_0x8cee('0x2a')],qs['fields'](_0x51003d[_0x8cee('0x2d')]['fields']));_0x4a7781['attributes']=_0x4a7781[_0x8cee('0x30')][_0x8cee('0x31')]?_0x4a7781[_0x8cee('0x30')]:_0x75f082[_0x8cee('0x2a')];if(_0x51003d[_0x8cee('0x2d')][_0x8cee('0x32')]){_0x4a7781[_0x8cee('0x33')]=[{'all':!![]}];}_0x4a7781=_[_0x8cee('0x34')]({},_0x4a7781,_0x51003d['options']);return db['ChatProactiveAction'][_0x8cee('0x35')](_0x4a7781)[_0x8cee('0x23')](handleEntityNotFound(_0x1572d5,null))[_0x8cee('0x23')](respondWithResult(_0x1572d5,null))[_0x8cee('0x36')](handleError(_0x1572d5,null));};exports[_0x8cee('0x37')]=function(_0x1ba01a,_0x4a47e3){return db[_0x8cee('0x2c')][_0x8cee('0x37')](_0x1ba01a[_0x8cee('0x38')],{})[_0x8cee('0x23')](respondWithResult(_0x4a47e3,0xc9))['catch'](handleError(_0x4a47e3,null));};exports['update']=function(_0x537cb4,_0x4c79ef){if(_0x537cb4[_0x8cee('0x38')]['id']){delete _0x537cb4['body']['id'];}return db['ChatProactiveAction'][_0x8cee('0x35')]({'where':{'id':_0x537cb4[_0x8cee('0x29')]['id']}})[_0x8cee('0x23')](handleEntityNotFound(_0x4c79ef,null))[_0x8cee('0x23')](saveUpdates(_0x537cb4[_0x8cee('0x38')],null))[_0x8cee('0x23')](respondWithResult(_0x4c79ef,null))['catch'](handleError(_0x4c79ef,null));};exports['destroy']=function(_0x49cd85,_0x1f1cd8){return db[_0x8cee('0x2c')][_0x8cee('0x35')]({'where':{'id':_0x49cd85[_0x8cee('0x29')]['id']}})[_0x8cee('0x23')](handleEntityNotFound(_0x1f1cd8,null))[_0x8cee('0x23')](removeEntity(_0x1f1cd8,null))[_0x8cee('0x36')](handleError(_0x1f1cd8,null));}; \ No newline at end of file +var _0x41d9=['find','create','body','catch','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','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','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','then','sendStatus','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options'];(function(_0x40b106,_0xb7547f){var _0x100433=function(_0x1a2641){while(--_0x1a2641){_0x40b106['push'](_0x40b106['shift']());}};_0x100433(++_0xb7547f);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require(_0x941d('0x6'));var Mustache=require('mustache');var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require('sox');var csv=require(_0x941d('0x9'));var ejs=require(_0x941d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x941d('0xb'));var squel=require('squel');var crypto=require(_0x941d('0xc'));var jsforce=require(_0x941d('0xd'));var deskjs=require(_0x941d('0xe'));var toCsv=require(_0x941d('0x9'));var querystring=require(_0x941d('0xf'));var Papa=require('papaparse');var Redis=require(_0x941d('0x10'));var authService=require(_0x941d('0x11'));var qs=require(_0x941d('0x12'));var as=require(_0x941d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x14'))(_0x941d('0x15'));var utils=require(_0x941d('0x16'));var config=require(_0x941d('0x17'));var licenseUtil=require(_0x941d('0x18'));var db=require(_0x941d('0x19'))['db'];function respondWithStatusCode(_0x4d93c4,_0x192331){_0x192331=_0x192331||0xcc;return function(_0x55c5aa){if(_0x55c5aa){return _0x4d93c4['sendStatus'](_0x192331);}return _0x4d93c4[_0x941d('0x1a')](_0x192331)[_0x941d('0x1b')]();};}function respondWithResult(_0xbd3711,_0x2aa972){_0x2aa972=_0x2aa972||0xc8;return function(_0x20a6ab){if(_0x20a6ab){return _0xbd3711[_0x941d('0x1a')](_0x2aa972)[_0x941d('0x1c')](_0x20a6ab);}};}function respondWithFilteredResult(_0x45d85d,_0x369b0b){return function(_0x1f1aeb){if(_0x1f1aeb){var _0x7df80e=typeof _0x369b0b['offset']===_0x941d('0x1d')&&typeof _0x369b0b[_0x941d('0x1e')]===_0x941d('0x1d');var _0x2e5c4f=_0x1f1aeb[_0x941d('0x1f')];var _0x3ac25f=_0x7df80e?0x0:_0x369b0b[_0x941d('0x20')];var _0x2c6ce5=_0x7df80e?_0x1f1aeb[_0x941d('0x1f')]:_0x369b0b['offset']+_0x369b0b[_0x941d('0x1e')];var _0x57f5e6;if(_0x2c6ce5>=_0x2e5c4f){_0x2c6ce5=_0x2e5c4f;_0x57f5e6=0xc8;}else{_0x57f5e6=0xce;}_0x45d85d[_0x941d('0x1a')](_0x57f5e6);return _0x45d85d[_0x941d('0x21')]('Content-Range',_0x3ac25f+'-'+_0x2c6ce5+'/'+_0x2e5c4f)[_0x941d('0x1c')](_0x1f1aeb);}return null;};}function patchUpdates(_0x5ac2e6){return function(_0x526708){try{jsonpatch[_0x941d('0x22')](_0x526708,_0x5ac2e6,!![]);}catch(_0xf6636){return BPromise[_0x941d('0x23')](_0xf6636);}return _0x526708['save']();};}function saveUpdates(_0x1309af,_0x3baf0b){return function(_0xc19c76){if(_0xc19c76){return _0xc19c76['update'](_0x1309af)['then'](function(_0x520bb2){return _0x520bb2;});}return null;};}function removeEntity(_0x306557,_0x26b7b6){return function(_0xd72c49){if(_0xd72c49){return _0xd72c49[_0x941d('0x24')]()[_0x941d('0x25')](function(){_0x306557['status'](0xcc)[_0x941d('0x1b')]();});}};}function handleEntityNotFound(_0x43a443,_0x11c2c9){return function(_0x48baff){if(!_0x48baff){_0x43a443[_0x941d('0x26')](0x194);}return _0x48baff;};}function handleError(_0x1ce2fe,_0x3190d4){_0x3190d4=_0x3190d4||0x1f4;return function(_0x3a72d7){logger[_0x941d('0x27')](_0x3a72d7[_0x941d('0x28')]);if(_0x3a72d7[_0x941d('0x29')]){delete _0x3a72d7[_0x941d('0x29')];}_0x1ce2fe[_0x941d('0x1a')](_0x3190d4)[_0x941d('0x2a')](_0x3a72d7);};}exports[_0x941d('0x2b')]=function(_0x1cacc4,_0x4cf929){var _0x30615a={'raw':!![],'where':{'id':_0x1cacc4['params']['id']}},_0x42050d={};_0x42050d[_0x941d('0x2c')]=_[_0x941d('0x2d')](db[_0x941d('0x2e')][_0x941d('0x2f')]);_0x42050d[_0x941d('0x30')]=_[_0x941d('0x2d')](_0x1cacc4[_0x941d('0x30')]);_0x42050d['filters']=_['intersection'](_0x42050d[_0x941d('0x2c')],_0x42050d[_0x941d('0x30')]);_0x30615a[_0x941d('0x31')]=_['intersection'](_0x42050d['model'],qs[_0x941d('0x32')](_0x1cacc4[_0x941d('0x30')][_0x941d('0x32')]));_0x30615a['attributes']=_0x30615a[_0x941d('0x31')][_0x941d('0x33')]?_0x30615a[_0x941d('0x31')]:_0x42050d[_0x941d('0x2c')];if(_0x1cacc4['query'][_0x941d('0x34')]){_0x30615a[_0x941d('0x35')]=[{'all':!![]}];}_0x30615a=_[_0x941d('0x36')]({},_0x30615a,_0x1cacc4[_0x941d('0x37')]);return db[_0x941d('0x2e')][_0x941d('0x38')](_0x30615a)['then'](handleEntityNotFound(_0x4cf929,null))['then'](respondWithResult(_0x4cf929,null))['catch'](handleError(_0x4cf929,null));};exports[_0x941d('0x39')]=function(_0x558846,_0x204259){return db[_0x941d('0x2e')][_0x941d('0x39')](_0x558846[_0x941d('0x3a')],{})[_0x941d('0x25')](respondWithResult(_0x204259,0xc9))[_0x941d('0x3b')](handleError(_0x204259,null));};exports[_0x941d('0x3c')]=function(_0x32d072,_0x202c89){if(_0x32d072[_0x941d('0x3a')]['id']){delete _0x32d072['body']['id'];}return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0x32d072[_0x941d('0x3d')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x202c89,null))[_0x941d('0x25')](saveUpdates(_0x32d072[_0x941d('0x3a')],null))[_0x941d('0x25')](respondWithResult(_0x202c89,null))[_0x941d('0x3b')](handleError(_0x202c89,null));};exports[_0x941d('0x24')]=function(_0xcdd784,_0x37b04c){return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0xcdd784['params']['id']}})['then'](handleEntityNotFound(_0x37b04c,null))[_0x941d('0x25')](removeEntity(_0x37b04c,null))[_0x941d('0x3b')](handleError(_0x37b04c,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f9ebeb7..f82a76a 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 _0x3c54=['exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x56d78c,_0x2b65d6){var _0x9a8155=function(_0x3cb3ad){while(--_0x3cb3ad){_0x56d78c['push'](_0x56d78c['shift']());}};_0x9a8155(++_0x2b65d6);}(_0x3c54,0x16f));var _0x43c5=function(_0xfdb271,_0x550ca1){_0xfdb271=_0xfdb271-0x0;var _0x54c007=_0x3c54[_0xfdb271];return _0x54c007;};'use strict';var _=require(_0x43c5('0x0'));var util=require('util');var logger=require(_0x43c5('0x1'))(_0x43c5('0x2'));var moment=require(_0x43c5('0x3'));var BPromise=require(_0x43c5('0x4'));var rp=require(_0x43c5('0x5'));var fs=require('fs');var path=require(_0x43c5('0x6'));var rimraf=require(_0x43c5('0x7'));var config=require(_0x43c5('0x8'));var attributes=require(_0x43c5('0x9'));module[_0x43c5('0xa')]=function(_0x548d43,_0x5de9dd){return _0x548d43[_0x43c5('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x43c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a0=['chat_proactive_actions','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0x96a0,0x1e1));var _0x096a=function(_0xaeab25,_0x4ef61f){_0xaeab25=_0xaeab25-0x0;var _0x52ad50=_0x96a0[_0xaeab25];return _0x52ad50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x096a('0x0'));var BPromise=require(_0x096a('0x1'));var rp=require(_0x096a('0x2'));var fs=require('fs');var path=require(_0x096a('0x3'));var rimraf=require('rimraf');var config=require(_0x096a('0x4'));var attributes=require(_0x096a('0x5'));module['exports']=function(_0x18395a,_0x2888c8){return _0x18395a[_0x096a('0x6')]('ChatProactiveAction',attributes,{'tableName':_0x096a('0x7'),'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 a950aa6..1b98c13 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 _0xb400=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb400,0x159));var _0x0b40=function(_0x563304,_0x707858){_0x563304=_0x563304-0x0;var _0x3a6502=_0xb400[_0x563304];return _0x3a6502;};'use strict';var _=require(_0x0b40('0x0'));var util=require(_0x0b40('0x1'));var moment=require(_0x0b40('0x2'));var BPromise=require(_0x0b40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b40('0x4'));var db=require(_0x0b40('0x5'))['db'];var utils=require(_0x0b40('0x6'));var logger=require(_0x0b40('0x7'))(_0x0b40('0x8'));var config=require(_0x0b40('0x9'));var jayson=require(_0x0b40('0xa'));var client=jayson[_0x0b40('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263e76,_0xa4d12f,_0x179fc9){return new BPromise(function(_0x55187b,_0x1531c0){return client[_0x0b40('0xc')](_0x263e76,_0x179fc9)[_0x0b40('0xd')](function(_0x2444e7){logger[_0x0b40('0xe')](_0x0b40('0xf'),_0xa4d12f,_0x0b40('0x10'));logger['debug'](_0x0b40('0x11'),_0xa4d12f,_0x0b40('0x10'),JSON['stringify'](_0x2444e7));if(_0x2444e7[_0x0b40('0x12')]){if(_0x2444e7[_0x0b40('0x12')][_0x0b40('0x13')]===0x1f4){logger[_0x0b40('0x12')](_0x0b40('0xf'),_0xa4d12f,_0x2444e7[_0x0b40('0x12')][_0x0b40('0x14')]);return _0x1531c0(_0x2444e7[_0x0b40('0x12')]['message']);}logger[_0x0b40('0x12')](_0x0b40('0xf'),_0xa4d12f,_0x2444e7[_0x0b40('0x12')]['message']);return _0x55187b(_0x2444e7[_0x0b40('0x12')]['message']);}else{logger[_0x0b40('0xe')](_0x0b40('0xf'),_0xa4d12f,_0x0b40('0x10'));_0x55187b(_0x2444e7[_0x0b40('0x15')][_0x0b40('0x14')]);}})[_0x0b40('0x16')](function(_0x5ec6b7){logger[_0x0b40('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xa4d12f,_0x5ec6b7);_0x1531c0(_0x5ec6b7);});});} \ No newline at end of file +var _0x4f22=['request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x4ea152,_0x275df2){var _0x5669c1=function(_0x76bd98){while(--_0x76bd98){_0x4ea152['push'](_0x4ea152['shift']());}};_0x5669c1(++_0x275df2);}(_0x4f22,0xc5));var _0x24f2=function(_0x461826,_0x13e04e){_0x461826=_0x461826-0x0;var _0x5d7ddb=_0x4f22[_0x461826];return _0x5d7ddb;};'use strict';var _=require(_0x24f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x24f2('0x1'));var rs=require(_0x24f2('0x2'));var fs=require('fs');var Redis=require(_0x24f2('0x3'));var db=require(_0x24f2('0x4'))['db'];var utils=require(_0x24f2('0x5'));var logger=require(_0x24f2('0x6'))(_0x24f2('0x7'));var config=require('../../config/environment');var jayson=require(_0x24f2('0x8'));var client=jayson['client'][_0x24f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2871ce,_0x34d49e,_0x5dc297){return new BPromise(function(_0x5c9ec6,_0x436d1f){return client[_0x24f2('0xa')](_0x2871ce,_0x5dc297)[_0x24f2('0xb')](function(_0x301ffb){logger['info'](_0x24f2('0xc'),_0x34d49e,_0x24f2('0xd'));logger[_0x24f2('0xe')](_0x24f2('0xf'),_0x34d49e,_0x24f2('0xd'),JSON[_0x24f2('0x10')](_0x301ffb));if(_0x301ffb['error']){if(_0x301ffb[_0x24f2('0x11')][_0x24f2('0x12')]===0x1f4){logger['error'](_0x24f2('0xc'),_0x34d49e,_0x301ffb[_0x24f2('0x11')][_0x24f2('0x13')]);return _0x436d1f(_0x301ffb[_0x24f2('0x11')][_0x24f2('0x13')]);}logger[_0x24f2('0x11')](_0x24f2('0xc'),_0x34d49e,_0x301ffb['error'][_0x24f2('0x13')]);return _0x5c9ec6(_0x301ffb['error'][_0x24f2('0x13')]);}else{logger[_0x24f2('0x14')](_0x24f2('0xc'),_0x34d49e,_0x24f2('0xd'));_0x5c9ec6(_0x301ffb[_0x24f2('0x15')]['message']);}})[_0x24f2('0x16')](function(_0x3bbc0c){logger[_0x24f2('0x11')](_0x24f2('0xc'),_0x34d49e,_0x3bbc0c);_0x436d1f(_0x3bbc0c);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6d85f68..151495e 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 _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x21f074,_0x3c7959){var _0x1521b1=function(_0x4796f9){while(--_0x4796f9){_0x21f074['push'](_0x21f074['shift']());}};_0x1521b1(++_0x3c7959);}(_0x326f,0xd1));var _0xf326=function(_0x199542,_0x50b180){_0x199542=_0x199542-0x0;var _0x4a434a=_0x326f[_0x199542];return _0x4a434a;};'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')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router; \ No newline at end of file +var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x14523d,_0x548920){_0x14523d=_0x14523d-0x0;var _0x1478c7=_0x425d[_0x14523d];return _0x1478c7;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 80e7ac5..0333832 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 _0xa1c5=['beepall','roundrobin','exports','STRING','ENUM'];(function(_0x9ab349,_0x48e3d9){var _0x5a2923=function(_0x2e3fa4){while(--_0x2e3fa4){_0x9ab349['push'](_0x9ab349['shift']());}};_0x5a2923(++_0x48e3d9);}(_0xa1c5,0x1d8));var _0x5a1c=function(_0x2dfa64,_0x21c355){_0x2dfa64=_0x2dfa64-0x0;var _0xa28511=_0xa1c5[_0x2dfa64];return _0xa28511;};'use strict';var Sequelize=require('sequelize');module[_0x5a1c('0x0')]={'name':{'type':Sequelize[_0x5a1c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5a1c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5a1c('0x2')]('rrmemory',_0x5a1c('0x3'),_0x5a1c('0x4'))}}; \ No newline at end of file +var _0xd893=['sequelize','exports','STRING','name','rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd893,0x82));var _0x3d89=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd893[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x3d89('0x0'));module[_0x3d89('0x1')]={'name':{'type':Sequelize[_0x3d89('0x2')],'unique':_0x3d89('0x3'),'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'](_0x3d89('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 3eb2627..1876ead 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 _0x69f0=['key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','includeAll','rows','show','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','ChatQueueId','filter','options','UserChatQueue','User','findAndCountAll','UserId','chatPause','createdAt','format','%s/%s','SIP','updatedAt','findOne','Team','getTeams','ids','Agents','voicePause','interface','flatMap','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','ChatQueues','UserProfileResource','stack','send','index','map','ChatQueue','rawAttributes','fieldName','type'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x69f0,0xf5));var _0x069f=function(_0x499e05,_0x34f10b){_0x499e05=_0x499e05-0x0;var _0x5abbb9=_0x69f0[_0x499e05];return _0x5abbb9;};'use strict';var emlformat=require(_0x069f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x069f('0x1'));var rp=require(_0x069f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x069f('0x3'));var util=require('util');var path=require(_0x069f('0x4'));var sox=require(_0x069f('0x5'));var csv=require(_0x069f('0x6'));var ejs=require(_0x069f('0x7'));var fs=require('fs');var fs_extra=require(_0x069f('0x8'));var _=require(_0x069f('0x9'));var squel=require('squel');var crypto=require(_0x069f('0xa'));var jsforce=require(_0x069f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x069f('0x6'));var querystring=require(_0x069f('0xc'));var Papa=require('papaparse');var Redis=require(_0x069f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x069f('0xe'));var as=require(_0x069f('0xf'));var hardwareService=require(_0x069f('0x10'));var logger=require(_0x069f('0x11'))(_0x069f('0x12'));var utils=require(_0x069f('0x13'));var config=require(_0x069f('0x14'));var licenseUtil=require(_0x069f('0x15'));var db=require(_0x069f('0x16'))['db'];config[_0x069f('0x17')]=_[_0x069f('0x18')](config['redis'],{'host':_0x069f('0x19'),'port':0x18eb});var socket=require(_0x069f('0x1a'))(new Redis(config[_0x069f('0x17')]));require(_0x069f('0x1b'))[_0x069f('0x1c')](socket);var jayson=require(_0x069f('0x1d'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c69e0,_0x1d274b,_0x1db3ba,_0x203027){return new BPromise(function(_0x2b1aaa,_0x586e52){var _0x2ad9ca=_0x203027||client;return _0x2ad9ca['request'](_0x3c69e0,_0x1db3ba)[_0x069f('0x1e')](function(_0x35bb98){logger[_0x069f('0x1f')](_0x069f('0x20'),_0x1d274b,_0x069f('0x21'));logger[_0x069f('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1d274b,'request\x20sent',JSON[_0x069f('0x23')](_0x35bb98));if(_0x35bb98[_0x069f('0x24')]){if(_0x35bb98[_0x069f('0x24')][_0x069f('0x25')]===0x1f4){logger['error'](_0x069f('0x20'),_0x1d274b,_0x35bb98[_0x069f('0x24')][_0x069f('0x26')]);return _0x586e52(_0x35bb98[_0x069f('0x24')][_0x069f('0x26')]);}logger['error'](_0x069f('0x20'),_0x1d274b,_0x35bb98[_0x069f('0x24')]['message']);return _0x2b1aaa(_0x35bb98[_0x069f('0x24')][_0x069f('0x26')]);}else{logger[_0x069f('0x1f')](_0x069f('0x20'),_0x1d274b,'request\x20sent');_0x2b1aaa(_0x35bb98[_0x069f('0x27')][_0x069f('0x26')]);}})[_0x069f('0x28')](function(_0x2e5083){logger[_0x069f('0x24')](_0x069f('0x20'),_0x1d274b,_0x2e5083);_0x586e52(_0x2e5083);});});}function respondWithStatusCode(_0x56b775,_0x7adbb7){_0x7adbb7=_0x7adbb7||0xcc;return function(_0x132f32){if(_0x132f32){return _0x56b775[_0x069f('0x29')](_0x7adbb7);}return _0x56b775['status'](_0x7adbb7)[_0x069f('0x2a')]();};}function respondWithResult(_0x245d07,_0x50a4fe){_0x50a4fe=_0x50a4fe||0xc8;return function(_0xb0e971){if(_0xb0e971){return _0x245d07[_0x069f('0x2b')](_0x50a4fe)[_0x069f('0x2c')](_0xb0e971);}};}function respondWithFilteredResult(_0x4e3dda,_0x1b91f4){return function(_0x11be86){if(_0x11be86){var _0x3ef767=typeof _0x1b91f4[_0x069f('0x2d')]==='undefined'&&typeof _0x1b91f4[_0x069f('0x2e')]===_0x069f('0x2f');var _0x3767f4=_0x11be86[_0x069f('0x30')];var _0x1c5a80=_0x3ef767?0x0:_0x1b91f4[_0x069f('0x2d')];var _0x3afb6d=_0x3ef767?_0x11be86['count']:_0x1b91f4[_0x069f('0x2d')]+_0x1b91f4[_0x069f('0x2e')];var _0x2ccd04;if(_0x3afb6d>=_0x3767f4){_0x3afb6d=_0x3767f4;_0x2ccd04=0xc8;}else{_0x2ccd04=0xce;}_0x4e3dda[_0x069f('0x2b')](_0x2ccd04);return _0x4e3dda[_0x069f('0x31')](_0x069f('0x32'),_0x1c5a80+'-'+_0x3afb6d+'/'+_0x3767f4)[_0x069f('0x2c')](_0x11be86);}return null;};}function patchUpdates(_0x36221a){return function(_0x3c0c20){try{jsonpatch[_0x069f('0x33')](_0x3c0c20,_0x36221a,!![]);}catch(_0x466136){return BPromise['reject'](_0x466136);}return _0x3c0c20[_0x069f('0x34')]();};}function saveUpdates(_0x44b02b,_0x54fa07){return function(_0x223f23){if(_0x223f23){return _0x223f23[_0x069f('0x35')](_0x44b02b)['then'](function(_0xe069da){return _0xe069da;});}return null;};}function removeEntity(_0x55b56b,_0x3b65b9){return function(_0x22e359){if(_0x22e359){return _0x22e359['destroy']()[_0x069f('0x1e')](function(){var _0x2f19db=_0x22e359[_0x069f('0x36')]({'plain':!![]});var _0x574bd5=_0x069f('0x37');return db[_0x069f('0x38')]['destroy']({'where':{'type':_0x574bd5,'resourceId':_0x2f19db['id']}})[_0x069f('0x1e')](function(){return _0x22e359;});})[_0x069f('0x1e')](function(){_0x55b56b[_0x069f('0x2b')](0xcc)[_0x069f('0x2a')]();});}};}function handleEntityNotFound(_0x274db5,_0x585488){return function(_0x47d57e){if(!_0x47d57e){_0x274db5[_0x069f('0x29')](0x194);}return _0x47d57e;};}function handleError(_0x2380a9,_0xa0bfbe){_0xa0bfbe=_0xa0bfbe||0x1f4;return function(_0x77151){logger['error'](_0x77151[_0x069f('0x39')]);if(_0x77151['name']){delete _0x77151['name'];}_0x2380a9[_0x069f('0x2b')](_0xa0bfbe)[_0x069f('0x3a')](_0x77151);};}exports[_0x069f('0x3b')]=function(_0x5029a7,_0x31427e){var _0x255e4a={},_0x325b28={},_0x22e167={'count':0x0,'rows':[]};var _0x1e6def=_[_0x069f('0x3c')](db[_0x069f('0x3d')][_0x069f('0x3e')],function(_0x4f2421){return{'name':_0x4f2421[_0x069f('0x3f')],'type':_0x4f2421[_0x069f('0x40')][_0x069f('0x41')]};});_0x325b28['model']=_[_0x069f('0x3c')](_0x1e6def,_0x069f('0x42'));_0x325b28[_0x069f('0x43')]=_[_0x069f('0x44')](_0x5029a7['query']);_0x325b28[_0x069f('0x45')]=_[_0x069f('0x46')](_0x325b28[_0x069f('0x47')],_0x325b28[_0x069f('0x43')]);_0x255e4a[_0x069f('0x48')]=_['intersection'](_0x325b28[_0x069f('0x47')],qs[_0x069f('0x49')](_0x5029a7[_0x069f('0x43')][_0x069f('0x49')]));_0x255e4a[_0x069f('0x48')]=_0x255e4a[_0x069f('0x48')][_0x069f('0x4a')]?_0x255e4a[_0x069f('0x48')]:_0x325b28[_0x069f('0x47')];if(!_0x5029a7['query'][_0x069f('0x4b')](_0x069f('0x4c'))){_0x255e4a[_0x069f('0x2e')]=qs['limit'](_0x5029a7[_0x069f('0x43')][_0x069f('0x2e')]);_0x255e4a[_0x069f('0x2d')]=qs[_0x069f('0x2d')](_0x5029a7[_0x069f('0x43')][_0x069f('0x2d')]);}_0x255e4a[_0x069f('0x4d')]=qs[_0x069f('0x4e')](_0x5029a7[_0x069f('0x43')]['sort']);_0x255e4a['where']=qs[_0x069f('0x45')](_[_0x069f('0x4f')](_0x5029a7[_0x069f('0x43')],_0x325b28[_0x069f('0x45')]),_0x1e6def);if(_0x5029a7[_0x069f('0x43')]['filter']){_0x255e4a[_0x069f('0x50')]=_[_0x069f('0x51')](_0x255e4a['where'],{'$or':_[_0x069f('0x3c')](_0x1e6def,function(_0x2edd07){if(_0x2edd07['type']!==_0x069f('0x52')){var _0x8a4b0a={};_0x8a4b0a[_0x2edd07[_0x069f('0x42')]]={'$like':'%'+_0x5029a7[_0x069f('0x43')]['filter']+'%'};return _0x8a4b0a;}})});}_0x255e4a=_[_0x069f('0x51')]({},_0x255e4a,_0x5029a7['options']);var _0x5b4df2={'where':_0x255e4a[_0x069f('0x50')]};return db['ChatQueue'][_0x069f('0x30')](_0x5b4df2)['then'](function(_0x278035){_0x22e167['count']=_0x278035;if(_0x5029a7[_0x069f('0x43')][_0x069f('0x53')]){_0x255e4a['include']=[{'all':!![]}];}return db[_0x069f('0x3d')]['findAll'](_0x255e4a);})[_0x069f('0x1e')](function(_0x407171){_0x22e167[_0x069f('0x54')]=_0x407171;return _0x22e167;})[_0x069f('0x1e')](respondWithFilteredResult(_0x31427e,_0x255e4a))[_0x069f('0x28')](handleError(_0x31427e,null));};exports[_0x069f('0x55')]=function(_0x1520d8,_0x44d31b){var _0x144513={'raw':!![],'where':{'id':_0x1520d8[_0x069f('0x56')]['id']}},_0x581fa3={};_0x581fa3[_0x069f('0x47')]=_[_0x069f('0x44')](db[_0x069f('0x3d')]['rawAttributes']);_0x581fa3[_0x069f('0x43')]=_[_0x069f('0x44')](_0x1520d8['query']);_0x581fa3[_0x069f('0x45')]=_[_0x069f('0x46')](_0x581fa3[_0x069f('0x47')],_0x581fa3[_0x069f('0x43')]);_0x144513[_0x069f('0x48')]=_[_0x069f('0x46')](_0x581fa3[_0x069f('0x47')],qs[_0x069f('0x49')](_0x1520d8[_0x069f('0x43')][_0x069f('0x49')]));_0x144513[_0x069f('0x48')]=_0x144513['attributes'][_0x069f('0x4a')]?_0x144513[_0x069f('0x48')]:_0x581fa3[_0x069f('0x47')];if(_0x1520d8[_0x069f('0x43')][_0x069f('0x53')]){_0x144513[_0x069f('0x57')]=[{'all':!![]}];}_0x144513=_['merge']({},_0x144513,_0x1520d8['options']);return db[_0x069f('0x3d')][_0x069f('0x58')](_0x144513)[_0x069f('0x1e')](handleEntityNotFound(_0x44d31b,null))['then'](respondWithResult(_0x44d31b,null))['catch'](handleError(_0x44d31b,null));};exports[_0x069f('0x59')]=function(_0x47c151,_0x4ce0f2){return db[_0x069f('0x3d')][_0x069f('0x59')](_0x47c151[_0x069f('0x5a')],{})['then'](function(_0x3fccb9){var _0x1e3312=_0x47c151[_0x069f('0x5b')][_0x069f('0x36')]({'plain':!![]});if(!_0x1e3312)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e3312[_0x069f('0x5c')]===_0x069f('0x5b')){var _0x1000f7=_0x3fccb9[_0x069f('0x36')]({'plain':!![]});var _0x27269a=_0x069f('0x37');return db[_0x069f('0x5d')][_0x069f('0x58')]({'where':{'name':_0x27269a,'userProfileId':_0x1e3312[_0x069f('0x5e')]},'raw':!![]})[_0x069f('0x1e')](function(_0x307bb4){if(_0x307bb4&&_0x307bb4[_0x069f('0x5f')]===0x0){return db[_0x069f('0x38')][_0x069f('0x59')]({'name':_0x1000f7[_0x069f('0x42')],'resourceId':_0x1000f7['id'],'type':_0x307bb4[_0x069f('0x42')],'sectionId':_0x307bb4['id']},{})[_0x069f('0x1e')](function(){return _0x3fccb9;});}else{return _0x3fccb9;}})['catch'](function(_0x261e89){logger[_0x069f('0x24')](_0x069f('0x60'),_0x261e89);throw _0x261e89;});}return _0x3fccb9;})['then'](respondWithResult(_0x4ce0f2,0xc9))[_0x069f('0x28')](handleError(_0x4ce0f2,null));};exports[_0x069f('0x35')]=function(_0x2eaf41,_0x1407d1){if(_0x2eaf41[_0x069f('0x5a')]['id']){delete _0x2eaf41[_0x069f('0x5a')]['id'];}return db[_0x069f('0x3d')][_0x069f('0x58')]({'where':{'id':_0x2eaf41[_0x069f('0x56')]['id']}})['then'](handleEntityNotFound(_0x1407d1,null))[_0x069f('0x1e')](saveUpdates(_0x2eaf41[_0x069f('0x5a')],null))[_0x069f('0x1e')](respondWithResult(_0x1407d1,null))[_0x069f('0x28')](handleError(_0x1407d1,null));};exports[_0x069f('0x61')]=function(_0x2157a1,_0x32d889){return db['ChatQueue'][_0x069f('0x58')]({'where':{'id':_0x2157a1[_0x069f('0x56')]['id']}})[_0x069f('0x1e')](handleEntityNotFound(_0x32d889,null))[_0x069f('0x1e')](removeEntity(_0x32d889,null))[_0x069f('0x28')](handleError(_0x32d889,null));};exports['describe']=function(_0x106d87,_0x36085d){return db[_0x069f('0x3d')][_0x069f('0x62')]()['then'](respondWithResult(_0x36085d,null))[_0x069f('0x28')](handleError(_0x36085d,null));};exports[_0x069f('0x63')]=function(_0x2eb974,_0x40d9df,_0x10f618){var _0x3ca035={'raw':!![],'where':{}},_0x4cf3bb={},_0x1e7cc6;return db[_0x069f('0x3d')]['findOne']({'where':{'id':_0x2eb974[_0x069f('0x56')]['id']}})[_0x069f('0x1e')](handleEntityNotFound(_0x40d9df,null))['then'](function(_0x3ed2e0){if(_0x3ed2e0){_0x1e7cc6=_0x3ed2e0[_0x069f('0x36')]({'plain':!![]});_0x4cf3bb[_0x069f('0x47')]=_[_0x069f('0x44')](db['UserChatQueue']['rawAttributes']);_0x4cf3bb[_0x069f('0x43')]=_['keys'](_0x2eb974[_0x069f('0x43')]);_0x4cf3bb[_0x069f('0x45')]=_[_0x069f('0x46')](_0x4cf3bb['model'],_0x4cf3bb[_0x069f('0x43')]);_0x3ca035[_0x069f('0x48')]=_[_0x069f('0x46')](_0x4cf3bb[_0x069f('0x47')],qs['fields'](_0x2eb974[_0x069f('0x43')][_0x069f('0x49')]));_0x3ca035[_0x069f('0x48')]=_0x3ca035[_0x069f('0x48')][_0x069f('0x4a')]?_0x3ca035['attributes']:_0x4cf3bb[_0x069f('0x47')];if(!_0x2eb974[_0x069f('0x43')][_0x069f('0x4b')](_0x069f('0x4c'))){_0x3ca035[_0x069f('0x2e')]=qs[_0x069f('0x2e')](_0x2eb974['query'][_0x069f('0x2e')]);_0x3ca035[_0x069f('0x2d')]=qs[_0x069f('0x2d')](_0x2eb974[_0x069f('0x43')]['offset']);}_0x3ca035['order']=qs[_0x069f('0x4e')](_0x2eb974[_0x069f('0x43')][_0x069f('0x4e')]);_0x3ca035['where']=qs['filters'](_[_0x069f('0x4f')](_0x2eb974[_0x069f('0x43')],_0x4cf3bb[_0x069f('0x45')]));_0x3ca035['where'][_0x069f('0x64')]=_0x3ed2e0['id'];if(_0x2eb974[_0x069f('0x43')][_0x069f('0x65')]){_0x3ca035[_0x069f('0x50')]=_[_0x069f('0x51')](_0x3ca035['where'],{'$or':_[_0x069f('0x3c')](_0x3ca035[_0x069f('0x48')],function(_0x3186){var _0x90ab76={};_0x90ab76[_0x3186]={'$like':'%'+_0x2eb974['query']['filter']+'%'};return _0x90ab76;})});}_0x3ca035=_[_0x069f('0x51')]({},_0x3ca035,_0x2eb974[_0x069f('0x66')]);return db[_0x069f('0x67')]['findAll'](_0x3ca035);}})['then'](function(_0x46a309){if(_0x46a309){return db[_0x069f('0x68')][_0x069f('0x69')]({'where':{'id':_[_0x069f('0x3c')](_0x46a309,_0x069f('0x6a')),'role':'agent'},'attributes':['id',_0x069f('0x42'),_0x069f('0x6b'),'updatedAt',_0x069f('0x6c')]});}})[_0x069f('0x1e')](function(_0xeb552d){if(_0xeb552d){return{'count':_0xeb552d[_0x069f('0x30')],'rows':_[_0x069f('0x3c')](_0xeb552d[_0x069f('0x54')],function(_0x21c38f){return{'membername':_0x21c38f[_0x069f('0x42')],'UserId':_0x21c38f['id'],'queue_name':_0x1e7cc6[_0x069f('0x42')],'ChatQueueId':_0x1e7cc6['id'],'interface':util[_0x069f('0x6d')](_0x069f('0x6e'),_0x069f('0x6f'),_0x21c38f[_0x069f('0x42')]),'penalty':0x0,'paused':_0x21c38f[_0x069f('0x6b')],'createdAt':_0x21c38f[_0x069f('0x6c')],'updatedAt':_0x21c38f[_0x069f('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x40d9df,_0x3ca035))[_0x069f('0x28')](handleError(_0x40d9df,null));};exports['getTeams']=function(_0x362b23,_0x3039e4,_0x2feaa7){var _0x3c61f8={};var _0x305262={};var _0x554095;var _0x156843;return db[_0x069f('0x3d')][_0x069f('0x71')]({'where':{'id':_0x362b23[_0x069f('0x56')]['id']}})['then'](handleEntityNotFound(_0x3039e4,null))[_0x069f('0x1e')](function(_0x4f1341){if(_0x4f1341){_0x554095=_0x4f1341;_0x305262[_0x069f('0x47')]=_[_0x069f('0x44')](db[_0x069f('0x72')][_0x069f('0x3e')]);_0x305262[_0x069f('0x43')]=_['keys'](_0x362b23['query']);_0x305262[_0x069f('0x45')]=_['intersection'](_0x305262['model'],_0x305262[_0x069f('0x43')]);_0x3c61f8[_0x069f('0x48')]=_[_0x069f('0x46')](_0x305262[_0x069f('0x47')],qs[_0x069f('0x49')](_0x362b23[_0x069f('0x43')][_0x069f('0x49')]));_0x3c61f8[_0x069f('0x48')]=_0x3c61f8['attributes'][_0x069f('0x4a')]?_0x3c61f8[_0x069f('0x48')]:_0x305262[_0x069f('0x47')];_0x3c61f8[_0x069f('0x4d')]=qs['sort'](_0x362b23[_0x069f('0x43')][_0x069f('0x4e')]);_0x3c61f8['where']=qs['filters'](_[_0x069f('0x4f')](_0x362b23['query'],_0x305262[_0x069f('0x45')]));if(_0x362b23[_0x069f('0x43')]['filter']){_0x3c61f8[_0x069f('0x50')]=_[_0x069f('0x51')](_0x3c61f8['where'],{'$or':_[_0x069f('0x3c')](_0x3c61f8['attributes'],function(_0x22592b){var _0x3dad59={};_0x3dad59[_0x22592b]={'$like':'%'+_0x362b23[_0x069f('0x43')][_0x069f('0x65')]+'%'};return _0x3dad59;})});}_0x3c61f8=_[_0x069f('0x51')]({},_0x3c61f8,_0x362b23[_0x069f('0x66')]);return _0x554095[_0x069f('0x73')](_0x3c61f8);}})['then'](function(_0x4d8155){if(_0x4d8155){_0x156843=_0x4d8155[_0x069f('0x4a')];if(!_0x362b23[_0x069f('0x43')][_0x069f('0x4b')]('nolimit')){_0x3c61f8[_0x069f('0x2e')]=qs[_0x069f('0x2e')](_0x362b23[_0x069f('0x43')][_0x069f('0x2e')]);_0x3c61f8[_0x069f('0x2d')]=qs['offset'](_0x362b23[_0x069f('0x43')][_0x069f('0x2d')]);}return _0x554095[_0x069f('0x73')](_0x3c61f8);}})['then'](function(_0x5798f0){if(_0x5798f0){return _0x5798f0?{'count':_0x156843,'rows':_0x5798f0}:null;}})[_0x069f('0x1e')](respondWithResult(_0x3039e4,null))[_0x069f('0x28')](handleError(_0x3039e4,null));};exports['addTeams']=function(_0x12e51d,_0xe26f66,_0x849994){var _0x31cb03=_0x12e51d[_0x069f('0x5a')][_0x069f('0x74')];return db['Team']['findAll']({'where':{'id':_0x31cb03},'attributes':['id'],'include':[{'model':db['User'],'as':_0x069f('0x75'),'attributes':['id',_0x069f('0x42'),'online',_0x069f('0x76'),_0x069f('0x77')],'raw':!![]}]})['then'](function(_0x34f9af){if(_0x34f9af){var _0x56d94f=_[_0x069f('0x78')](_0x34f9af,function(_0x41cd7f){var _0x54dd9=_0x41cd7f['get']({'plain':!![]});return _0x54dd9['Agents'];});return db[_0x069f('0x3d')][_0x069f('0x58')]({'where':{'id':_0x12e51d[_0x069f('0x56')]['id']}})[_0x069f('0x1e')](function(_0x5e4ecb){return db['sequelize']['transaction'](function(_0x206aa8){return _0x5e4ecb[_0x069f('0x79')](_0x31cb03,{'transaction':_0x206aa8})[_0x069f('0x1e')](function(){return BPromise[_0x069f('0x7a')](_0x56d94f,function(_0x27997f){return db[_0x069f('0x67')][_0x069f('0x7b')]({'where':{'UserId':_0x27997f['id'],'ChatQueueId':_0x12e51d[_0x069f('0x56')]['id']},'transaction':_0x206aa8});});})[_0x069f('0x1e')](function(){_0x56d94f[_0x069f('0x7c')](function(_0x2aa88e){socket[_0x069f('0x7d')](_0x069f('0x7e'),{'UserId':_0x2aa88e['id'],'ChatQueueId':_0x5e4ecb['id']});});});});});}})[_0x069f('0x1e')](respondWithStatusCode(_0xe26f66,null))[_0x069f('0x28')](handleError(_0xe26f66,null));};exports[_0x069f('0x7f')]=function(_0x125967,_0x282195,_0x5c7211){return db[_0x069f('0x72')]['findAll']({'where':{'id':_0x125967[_0x069f('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0x069f('0x68')],'as':_0x069f('0x75'),'attributes':['id'],'raw':!![]}]})[_0x069f('0x1e')](handleEntityNotFound(_0x282195,null))['then'](function(_0x2924b3){var _0x42fe5b=_['map'](_0x2924b3,'id');var _0x29bd53=[];var _0x4101d7=[];var _0x39dbff=squel['select']();_0x39dbff[_0x069f('0x80')](_0x069f('0x81'))[_0x069f('0x82')](_0x069f('0x83'),'tq')[_0x069f('0x84')](_0x069f('0x85'),'ut',_0x069f('0x86'))[_0x069f('0x50')](_0x069f('0x87'),_0x125967['params']['id']);for(var _0x281073=0x0;_0x281073<_0x2924b3[_0x069f('0x4a')];_0x281073+=0x1){let _0x1899fc=_0x2924b3[_0x281073];for(var _0x2493b5=0x0;_0x2493b5<_0x1899fc[_0x069f('0x75')][_0x069f('0x4a')];_0x2493b5+=0x1){let _0xb31608=_0x1899fc['Agents'][_0x2493b5];var _0x558322=_0x39dbff[_0x069f('0x88')]();_0x558322[_0x069f('0x50')](_0x069f('0x89'),_0xb31608['id']);_0x4101d7[_0x069f('0x8a')](db[_0x069f('0x8b')]['query'](_0x558322[_0x069f('0x8c')](),{'type':db[_0x069f('0x8b')][_0x069f('0x8d')]['SELECT']})['then'](function(_0x5a4bda){if(_0x5a4bda[_0x069f('0x4a')]===0x1){return _0xb31608['id'];}else{var _0xe67d25=_[_0x069f('0x8e')](_['map'](_0x5a4bda,_0x069f('0x8f')),function(_0x393dc7){return _['includes'](_0x42fe5b,_0x393dc7);});if(_0xe67d25){return _0xb31608['id'];}}}));}}return BPromise[_0x069f('0x90')](_0x4101d7)[_0x069f('0x1e')](function(_0x37bd30){_0x29bd53=_(_0x29bd53)[_0x069f('0x91')](_0x37bd30)[_0x069f('0x92')]()[_0x069f('0x93')]();return db[_0x069f('0x3d')]['find']({'where':{'id':_0x125967['params']['id']}})[_0x069f('0x1e')](function(_0x2f9a54){return db[_0x069f('0x8b')]['transaction'](function(_0x1c25ca){return _0x2f9a54[_0x069f('0x7f')](_0x125967[_0x069f('0x43')][_0x069f('0x74')],{'transaction':_0x1c25ca})[_0x069f('0x1e')](function(){if(!_[_0x069f('0x94')](_0x29bd53)){return _0x2f9a54[_0x069f('0x95')](_0x29bd53,{'transaction':_0x1c25ca});}})[_0x069f('0x1e')](function(){_0x29bd53[_0x069f('0x7c')](function(_0x4179a0){socket[_0x069f('0x7d')]('userChatQueue:remove',{'UserId':_0x4179a0,'ChatQueueId':_0x2f9a54['id']});});});});});});})[_0x069f('0x1e')](respondWithStatusCode(_0x282195,null))['catch'](handleError(_0x282195,null));};exports['addAgents']=function(_0x461006,_0x43a626,_0x1d8e7a){return db['ChatQueue'][_0x069f('0x58')]({'where':{'id':_0x461006[_0x069f('0x56')]['id']}})[_0x069f('0x1e')](handleEntityNotFound(_0x43a626,null))['then'](function(_0x12a950){if(_0x12a950){return _0x12a950[_0x069f('0x96')](_0x461006['body'][_0x069f('0x74')],_[_0x069f('0x97')](_0x461006[_0x069f('0x5a')],[_0x069f('0x74'),'id'])||{})[_0x069f('0x98')](function(_0x517d82){for(var _0x2a830f=0x0;_0x2a830f<_0x461006[_0x069f('0x5a')]['ids'][_0x069f('0x4a')];_0x2a830f+=0x1){socket[_0x069f('0x7d')]('userChatQueue:save',{'UserId':Number(_0x461006[_0x069f('0x5a')][_0x069f('0x74')][_0x2a830f]),'ChatQueueId':Number(_0x461006[_0x069f('0x56')]['id'])});}return _0x517d82;});}})[_0x069f('0x1e')](respondWithResult(_0x43a626,null))[_0x069f('0x28')](handleError(_0x43a626,null));};exports['removeAgents']=function(_0x89466a,_0xabc1f9,_0x46ce79){return db[_0x069f('0x3d')][_0x069f('0x58')]({'where':{'id':_0x89466a[_0x069f('0x56')]['id']}})[_0x069f('0x1e')](handleEntityNotFound(_0xabc1f9,null))[_0x069f('0x1e')](function(_0x584d41){if(_0x584d41){return _0x584d41[_0x069f('0x95')](_0x89466a[_0x069f('0x43')][_0x069f('0x74')])['then'](function(){if(_['isArray'](_0x89466a[_0x069f('0x43')][_0x069f('0x74')])){for(var _0x55e87c=0x0;_0x55e87c<_0x89466a[_0x069f('0x43')][_0x069f('0x74')][_0x069f('0x4a')];_0x55e87c+=0x1){socket[_0x069f('0x7d')](_0x069f('0x99'),{'UserId':Number(_0x89466a['query'][_0x069f('0x74')][_0x55e87c]),'ChatQueueId':Number(_0x89466a[_0x069f('0x56')]['id'])});}}else{socket['emit'](_0x069f('0x99'),{'UserId':Number(_0x89466a[_0x069f('0x43')][_0x069f('0x74')]),'ChatQueueId':Number(_0x89466a['params']['id'])});}});}})['then'](respondWithStatusCode(_0xabc1f9,null))['catch'](handleError(_0xabc1f9,null));};exports[_0x069f('0x9a')]=function(_0x1a49c1,_0x3e3701,_0x401841){var _0x1036ec={};var _0x155bfc={};var _0x4e0d2e;var _0xfae515;return db[_0x069f('0x3d')][_0x069f('0x71')]({'where':{'id':_0x1a49c1[_0x069f('0x56')]['id']}})['then'](handleEntityNotFound(_0x3e3701,null))[_0x069f('0x1e')](function(_0x58f140){if(_0x58f140){_0x4e0d2e=_0x58f140;_0x155bfc['model']=_[_0x069f('0x44')](db[_0x069f('0x68')][_0x069f('0x3e')]);_0x155bfc[_0x069f('0x43')]=_[_0x069f('0x44')](_0x1a49c1['query']);_0x155bfc[_0x069f('0x45')]=_[_0x069f('0x46')](_0x155bfc[_0x069f('0x47')],_0x155bfc[_0x069f('0x43')]);_0x1036ec[_0x069f('0x48')]=_[_0x069f('0x46')](_0x155bfc[_0x069f('0x47')],qs[_0x069f('0x49')](_0x1a49c1[_0x069f('0x43')][_0x069f('0x49')]));_0x1036ec[_0x069f('0x48')]=_0x1036ec[_0x069f('0x48')]['length']?_0x1036ec[_0x069f('0x48')]:_0x155bfc[_0x069f('0x47')];_0x1036ec['order']=qs[_0x069f('0x4e')](_0x1a49c1['query'][_0x069f('0x4e')]);_0x1036ec[_0x069f('0x50')]=qs[_0x069f('0x45')](_[_0x069f('0x4f')](_0x1a49c1[_0x069f('0x43')],_0x155bfc[_0x069f('0x45')]));if(_0x1a49c1[_0x069f('0x43')]['filter']){_0x1036ec[_0x069f('0x50')]=_['merge'](_0x1036ec[_0x069f('0x50')],{'$or':_[_0x069f('0x3c')](_0x1036ec[_0x069f('0x48')],function(_0x2884a1){var _0x40c66a={};_0x40c66a[_0x2884a1]={'$like':'%'+_0x1a49c1[_0x069f('0x43')][_0x069f('0x65')]+'%'};return _0x40c66a;})});}_0x1036ec=_[_0x069f('0x51')]({},_0x1036ec,_0x1a49c1[_0x069f('0x66')]);return _0x4e0d2e[_0x069f('0x9a')](_0x1036ec);}})[_0x069f('0x1e')](function(_0x4b6ae9){if(_0x4b6ae9){_0xfae515=_0x4b6ae9[_0x069f('0x4a')];if(!_0x1a49c1[_0x069f('0x43')]['hasOwnProperty'](_0x069f('0x4c'))){_0x1036ec[_0x069f('0x2e')]=qs['limit'](_0x1a49c1[_0x069f('0x43')]['limit']);_0x1036ec['offset']=qs[_0x069f('0x2d')](_0x1a49c1['query']['offset']);}return _0x4e0d2e['getAgents'](_0x1036ec);}})['then'](function(_0xff17f8){if(_0xff17f8){return _0xff17f8?{'count':_0xfae515,'rows':_0xff17f8}:null;}})[_0x069f('0x1e')](respondWithResult(_0x3e3701,null))[_0x069f('0x28')](handleError(_0x3e3701,null));}; \ No newline at end of file +var _0x724a=['message','result','catch','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','map','ChatQueue','fieldName','type','key','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','length','find','create','body','user','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','options','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','ids','User','Agents','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','isArray','userChatQueue:remove','getAgents','rawAttributes','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4bbc21,_0x2c5995){var _0x3f8296=function(_0x389b1b){while(--_0x389b1b){_0x4bbc21['push'](_0x4bbc21['shift']());}};_0x3f8296(++_0x2c5995);}(_0x724a,0x19f));var _0xa724=function(_0xa6a3b1,_0x5ccc11){_0xa6a3b1=_0xa6a3b1-0x0;var _0x4054ff=_0x724a[_0xa6a3b1];return _0x4054ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa724('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa724('0x1'));var moment=require(_0xa724('0x2'));var BPromise=require(_0xa724('0x3'));var Mustache=require(_0xa724('0x4'));var util=require(_0xa724('0x5'));var path=require(_0xa724('0x6'));var sox=require(_0xa724('0x7'));var csv=require(_0xa724('0x8'));var ejs=require(_0xa724('0x9'));var fs=require('fs');var fs_extra=require(_0xa724('0xa'));var _=require(_0xa724('0xb'));var squel=require(_0xa724('0xc'));var crypto=require(_0xa724('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa724('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa724('0xf'));var authService=require(_0xa724('0x10'));var qs=require(_0xa724('0x11'));var as=require(_0xa724('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa724('0x13'))(_0xa724('0x14'));var utils=require(_0xa724('0x15'));var config=require(_0xa724('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa724('0x17'))['db'];config[_0xa724('0x18')]=_['defaults'](config[_0xa724('0x18')],{'host':_0xa724('0x19'),'port':0x18eb});var socket=require(_0xa724('0x1a'))(new Redis(config['redis']));require(_0xa724('0x1b'))[_0xa724('0x1c')](socket);var jayson=require(_0xa724('0x1d'));var client=jayson[_0xa724('0x1e')][_0xa724('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4be6,_0x4ff62b,_0x2ce257,_0x578824){return new BPromise(function(_0x833e92,_0x1eebe5){var _0x335887=_0x578824||client;return _0x335887[_0xa724('0x20')](_0x4be6,_0x2ce257)['then'](function(_0x382ece){logger[_0xa724('0x21')](_0xa724('0x22'),_0x4ff62b,_0xa724('0x23'));logger[_0xa724('0x24')](_0xa724('0x25'),_0x4ff62b,_0xa724('0x23'),JSON[_0xa724('0x26')](_0x382ece));if(_0x382ece[_0xa724('0x27')]){if(_0x382ece[_0xa724('0x27')][_0xa724('0x28')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4ff62b,_0x382ece[_0xa724('0x27')][_0xa724('0x29')]);return _0x1eebe5(_0x382ece['error'][_0xa724('0x29')]);}logger[_0xa724('0x27')](_0xa724('0x22'),_0x4ff62b,_0x382ece[_0xa724('0x27')][_0xa724('0x29')]);return _0x833e92(_0x382ece[_0xa724('0x27')][_0xa724('0x29')]);}else{logger[_0xa724('0x21')](_0xa724('0x22'),_0x4ff62b,_0xa724('0x23'));_0x833e92(_0x382ece[_0xa724('0x2a')][_0xa724('0x29')]);}})[_0xa724('0x2b')](function(_0x5bd671){logger[_0xa724('0x27')](_0xa724('0x22'),_0x4ff62b,_0x5bd671);_0x1eebe5(_0x5bd671);});});}function respondWithStatusCode(_0x3b2494,_0x5e6878){_0x5e6878=_0x5e6878||0xcc;return function(_0x1686c8){if(_0x1686c8){return _0x3b2494['sendStatus'](_0x5e6878);}return _0x3b2494[_0xa724('0x2c')](_0x5e6878)['end']();};}function respondWithResult(_0x333796,_0x441bb3){_0x441bb3=_0x441bb3||0xc8;return function(_0x39dd83){if(_0x39dd83){return _0x333796[_0xa724('0x2c')](_0x441bb3)['json'](_0x39dd83);}};}function respondWithFilteredResult(_0x491bb7,_0x2dbb00){return function(_0x56f796){if(_0x56f796){var _0x151dc2=typeof _0x2dbb00[_0xa724('0x2d')]===_0xa724('0x2e')&&typeof _0x2dbb00['limit']===_0xa724('0x2e');var _0x4cc3c2=_0x56f796[_0xa724('0x2f')];var _0x3ceda5=_0x151dc2?0x0:_0x2dbb00[_0xa724('0x2d')];var _0x31d02e=_0x151dc2?_0x56f796[_0xa724('0x2f')]:_0x2dbb00['offset']+_0x2dbb00[_0xa724('0x30')];var _0x39760b;if(_0x31d02e>=_0x4cc3c2){_0x31d02e=_0x4cc3c2;_0x39760b=0xc8;}else{_0x39760b=0xce;}_0x491bb7[_0xa724('0x2c')](_0x39760b);return _0x491bb7[_0xa724('0x31')](_0xa724('0x32'),_0x3ceda5+'-'+_0x31d02e+'/'+_0x4cc3c2)[_0xa724('0x33')](_0x56f796);}return null;};}function patchUpdates(_0x19dce9){return function(_0x56d2cf){try{jsonpatch['apply'](_0x56d2cf,_0x19dce9,!![]);}catch(_0x1b8f6c){return BPromise[_0xa724('0x34')](_0x1b8f6c);}return _0x56d2cf[_0xa724('0x35')]();};}function saveUpdates(_0xb1422b,_0x91f8d6){return function(_0x44655d){if(_0x44655d){return _0x44655d[_0xa724('0x36')](_0xb1422b)[_0xa724('0x37')](function(_0x24d8c8){return _0x24d8c8;});}return null;};}function removeEntity(_0x5d8b14,_0x3d38fe){return function(_0x1253a1){if(_0x1253a1){return _0x1253a1[_0xa724('0x38')]()[_0xa724('0x37')](function(){var _0x24d03d=_0x1253a1[_0xa724('0x39')]({'plain':!![]});var _0x47106d=_0xa724('0x3a');return db[_0xa724('0x3b')]['destroy']({'where':{'type':_0x47106d,'resourceId':_0x24d03d['id']}})[_0xa724('0x37')](function(){return _0x1253a1;});})[_0xa724('0x37')](function(){_0x5d8b14[_0xa724('0x2c')](0xcc)[_0xa724('0x3c')]();});}};}function handleEntityNotFound(_0x50d81c,_0x5d24b4){return function(_0xffa5b){if(!_0xffa5b){_0x50d81c[_0xa724('0x3d')](0x194);}return _0xffa5b;};}function handleError(_0x4f42da,_0x21e0e3){_0x21e0e3=_0x21e0e3||0x1f4;return function(_0x2da4c3){logger[_0xa724('0x27')](_0x2da4c3[_0xa724('0x3e')]);if(_0x2da4c3[_0xa724('0x3f')]){delete _0x2da4c3[_0xa724('0x3f')];}_0x4f42da[_0xa724('0x2c')](_0x21e0e3)['send'](_0x2da4c3);};}exports['index']=function(_0x5574cf,_0x4c9ecf){var _0x1bc3c0={},_0x512bd0={},_0x2581e0={'count':0x0,'rows':[]};var _0xc1ce35=_[_0xa724('0x40')](db[_0xa724('0x41')]['rawAttributes'],function(_0x264035){return{'name':_0x264035[_0xa724('0x42')],'type':_0x264035[_0xa724('0x43')][_0xa724('0x44')]};});_0x512bd0['model']=_[_0xa724('0x40')](_0xc1ce35,'name');_0x512bd0['query']=_[_0xa724('0x45')](_0x5574cf[_0xa724('0x46')]);_0x512bd0['filters']=_[_0xa724('0x47')](_0x512bd0[_0xa724('0x48')],_0x512bd0['query']);_0x1bc3c0['attributes']=_[_0xa724('0x47')](_0x512bd0['model'],qs['fields'](_0x5574cf[_0xa724('0x46')][_0xa724('0x49')]));_0x1bc3c0[_0xa724('0x4a')]=_0x1bc3c0['attributes']['length']?_0x1bc3c0[_0xa724('0x4a')]:_0x512bd0[_0xa724('0x48')];if(!_0x5574cf['query'][_0xa724('0x4b')](_0xa724('0x4c'))){_0x1bc3c0['limit']=qs['limit'](_0x5574cf[_0xa724('0x46')][_0xa724('0x30')]);_0x1bc3c0[_0xa724('0x2d')]=qs[_0xa724('0x2d')](_0x5574cf[_0xa724('0x46')][_0xa724('0x2d')]);}_0x1bc3c0['order']=qs[_0xa724('0x4d')](_0x5574cf[_0xa724('0x46')][_0xa724('0x4d')]);_0x1bc3c0['where']=qs[_0xa724('0x4e')](_[_0xa724('0x4f')](_0x5574cf['query'],_0x512bd0[_0xa724('0x4e')]),_0xc1ce35);if(_0x5574cf[_0xa724('0x46')][_0xa724('0x50')]){_0x1bc3c0['where']=_['merge'](_0x1bc3c0[_0xa724('0x51')],{'$or':_['map'](_0xc1ce35,function(_0x4bc3c8){if(_0x4bc3c8[_0xa724('0x43')]!==_0xa724('0x52')){var _0x5027df={};_0x5027df[_0x4bc3c8[_0xa724('0x3f')]]={'$like':'%'+_0x5574cf['query'][_0xa724('0x50')]+'%'};return _0x5027df;}})});}_0x1bc3c0=_[_0xa724('0x53')]({},_0x1bc3c0,_0x5574cf['options']);var _0x4bf46c={'where':_0x1bc3c0[_0xa724('0x51')]};return db[_0xa724('0x41')][_0xa724('0x2f')](_0x4bf46c)[_0xa724('0x37')](function(_0xa9d3f9){_0x2581e0[_0xa724('0x2f')]=_0xa9d3f9;if(_0x5574cf[_0xa724('0x46')][_0xa724('0x54')]){_0x1bc3c0[_0xa724('0x55')]=[{'all':!![]}];}return db[_0xa724('0x41')][_0xa724('0x56')](_0x1bc3c0);})[_0xa724('0x37')](function(_0x43f576){_0x2581e0[_0xa724('0x57')]=_0x43f576;return _0x2581e0;})[_0xa724('0x37')](respondWithFilteredResult(_0x4c9ecf,_0x1bc3c0))['catch'](handleError(_0x4c9ecf,null));};exports[_0xa724('0x58')]=function(_0x1e7823,_0x17347b){var _0x15029f={'raw':!![],'where':{'id':_0x1e7823[_0xa724('0x59')]['id']}},_0x449487={};_0x449487[_0xa724('0x48')]=_[_0xa724('0x45')](db[_0xa724('0x41')]['rawAttributes']);_0x449487['query']=_['keys'](_0x1e7823['query']);_0x449487[_0xa724('0x4e')]=_['intersection'](_0x449487[_0xa724('0x48')],_0x449487['query']);_0x15029f['attributes']=_[_0xa724('0x47')](_0x449487[_0xa724('0x48')],qs[_0xa724('0x49')](_0x1e7823[_0xa724('0x46')][_0xa724('0x49')]));_0x15029f[_0xa724('0x4a')]=_0x15029f['attributes'][_0xa724('0x5a')]?_0x15029f[_0xa724('0x4a')]:_0x449487['model'];if(_0x1e7823[_0xa724('0x46')]['includeAll']){_0x15029f[_0xa724('0x55')]=[{'all':!![]}];}_0x15029f=_['merge']({},_0x15029f,_0x1e7823['options']);return db[_0xa724('0x41')][_0xa724('0x5b')](_0x15029f)[_0xa724('0x37')](handleEntityNotFound(_0x17347b,null))[_0xa724('0x37')](respondWithResult(_0x17347b,null))['catch'](handleError(_0x17347b,null));};exports[_0xa724('0x5c')]=function(_0xbfd462,_0x25e331){return db[_0xa724('0x41')][_0xa724('0x5c')](_0xbfd462[_0xa724('0x5d')],{})['then'](function(_0x336976){var _0x824dcb=_0xbfd462[_0xa724('0x5e')][_0xa724('0x39')]({'plain':!![]});if(!_0x824dcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x824dcb['role']===_0xa724('0x5e')){var _0x55bed9=_0x336976[_0xa724('0x39')]({'plain':!![]});var _0x12868f=_0xa724('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x12868f,'userProfileId':_0x824dcb[_0xa724('0x5f')]},'raw':!![]})[_0xa724('0x37')](function(_0x299771){if(_0x299771&&_0x299771[_0xa724('0x60')]===0x0){return db[_0xa724('0x3b')][_0xa724('0x5c')]({'name':_0x55bed9[_0xa724('0x3f')],'resourceId':_0x55bed9['id'],'type':_0x299771[_0xa724('0x3f')],'sectionId':_0x299771['id']},{})[_0xa724('0x37')](function(){return _0x336976;});}else{return _0x336976;}})['catch'](function(_0x3fb82b){logger[_0xa724('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fb82b);throw _0x3fb82b;});}return _0x336976;})[_0xa724('0x37')](respondWithResult(_0x25e331,0xc9))[_0xa724('0x2b')](handleError(_0x25e331,null));};exports['update']=function(_0x38c871,_0x2d0efd){if(_0x38c871[_0xa724('0x5d')]['id']){delete _0x38c871['body']['id'];}return db[_0xa724('0x41')][_0xa724('0x5b')]({'where':{'id':_0x38c871['params']['id']}})[_0xa724('0x37')](handleEntityNotFound(_0x2d0efd,null))[_0xa724('0x37')](saveUpdates(_0x38c871[_0xa724('0x5d')],null))['then'](respondWithResult(_0x2d0efd,null))[_0xa724('0x2b')](handleError(_0x2d0efd,null));};exports[_0xa724('0x38')]=function(_0x4aafdb,_0x43fc3b){return db[_0xa724('0x41')][_0xa724('0x5b')]({'where':{'id':_0x4aafdb['params']['id']}})['then'](handleEntityNotFound(_0x43fc3b,null))[_0xa724('0x37')](removeEntity(_0x43fc3b,null))['catch'](handleError(_0x43fc3b,null));};exports[_0xa724('0x61')]=function(_0x1dcee8,_0x2e01dc){return db[_0xa724('0x41')][_0xa724('0x61')]()[_0xa724('0x37')](respondWithResult(_0x2e01dc,null))['catch'](handleError(_0x2e01dc,null));};exports[_0xa724('0x62')]=function(_0x3b5645,_0xa0ec78,_0xc2b9b9){var _0x5d83c7={'raw':!![],'where':{}},_0x11a6b2={},_0x4933a0;return db[_0xa724('0x41')][_0xa724('0x63')]({'where':{'id':_0x3b5645['params']['id']}})[_0xa724('0x37')](handleEntityNotFound(_0xa0ec78,null))[_0xa724('0x37')](function(_0x2b7f92){if(_0x2b7f92){_0x4933a0=_0x2b7f92[_0xa724('0x39')]({'plain':!![]});_0x11a6b2['model']=_[_0xa724('0x45')](db[_0xa724('0x64')]['rawAttributes']);_0x11a6b2['query']=_[_0xa724('0x45')](_0x3b5645['query']);_0x11a6b2[_0xa724('0x4e')]=_[_0xa724('0x47')](_0x11a6b2[_0xa724('0x48')],_0x11a6b2['query']);_0x5d83c7[_0xa724('0x4a')]=_[_0xa724('0x47')](_0x11a6b2[_0xa724('0x48')],qs['fields'](_0x3b5645['query'][_0xa724('0x49')]));_0x5d83c7['attributes']=_0x5d83c7['attributes'][_0xa724('0x5a')]?_0x5d83c7[_0xa724('0x4a')]:_0x11a6b2['model'];if(!_0x3b5645['query'][_0xa724('0x4b')](_0xa724('0x4c'))){_0x5d83c7[_0xa724('0x30')]=qs[_0xa724('0x30')](_0x3b5645[_0xa724('0x46')][_0xa724('0x30')]);_0x5d83c7[_0xa724('0x2d')]=qs[_0xa724('0x2d')](_0x3b5645[_0xa724('0x46')][_0xa724('0x2d')]);}_0x5d83c7[_0xa724('0x65')]=qs[_0xa724('0x4d')](_0x3b5645['query'][_0xa724('0x4d')]);_0x5d83c7[_0xa724('0x51')]=qs[_0xa724('0x4e')](_[_0xa724('0x4f')](_0x3b5645[_0xa724('0x46')],_0x11a6b2[_0xa724('0x4e')]));_0x5d83c7['where'][_0xa724('0x66')]=_0x2b7f92['id'];if(_0x3b5645[_0xa724('0x46')][_0xa724('0x50')]){_0x5d83c7[_0xa724('0x51')]=_[_0xa724('0x53')](_0x5d83c7[_0xa724('0x51')],{'$or':_[_0xa724('0x40')](_0x5d83c7['attributes'],function(_0x25de71){var _0x1a6b88={};_0x1a6b88[_0x25de71]={'$like':'%'+_0x3b5645['query'][_0xa724('0x50')]+'%'};return _0x1a6b88;})});}_0x5d83c7=_[_0xa724('0x53')]({},_0x5d83c7,_0x3b5645[_0xa724('0x67')]);return db['UserChatQueue']['findAll'](_0x5d83c7);}})[_0xa724('0x37')](function(_0x31c63f){if(_0x31c63f){return db['User'][_0xa724('0x68')]({'where':{'id':_[_0xa724('0x40')](_0x31c63f,_0xa724('0x69')),'role':_0xa724('0x6a')},'attributes':['id',_0xa724('0x3f'),_0xa724('0x6b'),'updatedAt',_0xa724('0x6c')]});}})[_0xa724('0x37')](function(_0x2c9ac8){if(_0x2c9ac8){return{'count':_0x2c9ac8['count'],'rows':_[_0xa724('0x40')](_0x2c9ac8[_0xa724('0x57')],function(_0x3d13e6){return{'membername':_0x3d13e6[_0xa724('0x3f')],'UserId':_0x3d13e6['id'],'queue_name':_0x4933a0[_0xa724('0x3f')],'ChatQueueId':_0x4933a0['id'],'interface':util['format'](_0xa724('0x6d'),_0xa724('0x6e'),_0x3d13e6[_0xa724('0x3f')]),'penalty':0x0,'paused':_0x3d13e6[_0xa724('0x6b')],'createdAt':_0x3d13e6[_0xa724('0x6c')],'updatedAt':_0x3d13e6[_0xa724('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa724('0x37')](respondWithFilteredResult(_0xa0ec78,_0x5d83c7))[_0xa724('0x2b')](handleError(_0xa0ec78,null));};exports[_0xa724('0x70')]=function(_0x4c9aa5,_0x1b9cfe,_0x9b47d1){var _0xd3fb81={};var _0x5ba378={};var _0x133ec5;var _0x331813;return db['ChatQueue'][_0xa724('0x63')]({'where':{'id':_0x4c9aa5[_0xa724('0x59')]['id']}})[_0xa724('0x37')](handleEntityNotFound(_0x1b9cfe,null))['then'](function(_0x28c821){if(_0x28c821){_0x133ec5=_0x28c821;_0x5ba378[_0xa724('0x48')]=_[_0xa724('0x45')](db[_0xa724('0x71')]['rawAttributes']);_0x5ba378['query']=_['keys'](_0x4c9aa5['query']);_0x5ba378[_0xa724('0x4e')]=_[_0xa724('0x47')](_0x5ba378['model'],_0x5ba378[_0xa724('0x46')]);_0xd3fb81[_0xa724('0x4a')]=_[_0xa724('0x47')](_0x5ba378['model'],qs[_0xa724('0x49')](_0x4c9aa5[_0xa724('0x46')][_0xa724('0x49')]));_0xd3fb81['attributes']=_0xd3fb81[_0xa724('0x4a')]['length']?_0xd3fb81[_0xa724('0x4a')]:_0x5ba378[_0xa724('0x48')];_0xd3fb81['order']=qs[_0xa724('0x4d')](_0x4c9aa5[_0xa724('0x46')][_0xa724('0x4d')]);_0xd3fb81[_0xa724('0x51')]=qs[_0xa724('0x4e')](_['pick'](_0x4c9aa5[_0xa724('0x46')],_0x5ba378[_0xa724('0x4e')]));if(_0x4c9aa5[_0xa724('0x46')][_0xa724('0x50')]){_0xd3fb81[_0xa724('0x51')]=_[_0xa724('0x53')](_0xd3fb81['where'],{'$or':_[_0xa724('0x40')](_0xd3fb81[_0xa724('0x4a')],function(_0x5dc0e8){var _0x5a3bac={};_0x5a3bac[_0x5dc0e8]={'$like':'%'+_0x4c9aa5[_0xa724('0x46')]['filter']+'%'};return _0x5a3bac;})});}_0xd3fb81=_[_0xa724('0x53')]({},_0xd3fb81,_0x4c9aa5[_0xa724('0x67')]);return _0x133ec5['getTeams'](_0xd3fb81);}})[_0xa724('0x37')](function(_0x3763cb){if(_0x3763cb){_0x331813=_0x3763cb[_0xa724('0x5a')];if(!_0x4c9aa5['query'][_0xa724('0x4b')]('nolimit')){_0xd3fb81[_0xa724('0x30')]=qs[_0xa724('0x30')](_0x4c9aa5[_0xa724('0x46')][_0xa724('0x30')]);_0xd3fb81[_0xa724('0x2d')]=qs[_0xa724('0x2d')](_0x4c9aa5[_0xa724('0x46')][_0xa724('0x2d')]);}return _0x133ec5['getTeams'](_0xd3fb81);}})[_0xa724('0x37')](function(_0x27e769){if(_0x27e769){return _0x27e769?{'count':_0x331813,'rows':_0x27e769}:null;}})['then'](respondWithResult(_0x1b9cfe,null))[_0xa724('0x2b')](handleError(_0x1b9cfe,null));};exports['addTeams']=function(_0x383554,_0xdc8edd,_0x1f683c){var _0x31dec7=_0x383554[_0xa724('0x5d')][_0xa724('0x72')];return db[_0xa724('0x71')][_0xa724('0x56')]({'where':{'id':_0x31dec7},'attributes':['id'],'include':[{'model':db[_0xa724('0x73')],'as':_0xa724('0x74'),'attributes':['id','name',_0xa724('0x75'),'voicePause',_0xa724('0x76')],'raw':!![]}]})[_0xa724('0x37')](function(_0x408ac9){if(_0x408ac9){var _0xcc308d=_[_0xa724('0x77')](_0x408ac9,function(_0x399cbe){var _0x496b46=_0x399cbe[_0xa724('0x39')]({'plain':!![]});return _0x496b46['Agents'];});return db[_0xa724('0x41')][_0xa724('0x5b')]({'where':{'id':_0x383554[_0xa724('0x59')]['id']}})[_0xa724('0x37')](function(_0x4662d){return db[_0xa724('0x78')][_0xa724('0x79')](function(_0x2f3764){return _0x4662d[_0xa724('0x7a')](_0x31dec7,{'transaction':_0x2f3764})[_0xa724('0x37')](function(){return BPromise['each'](_0xcc308d,function(_0x1d21e3){return db[_0xa724('0x64')][_0xa724('0x7b')]({'where':{'UserId':_0x1d21e3['id'],'ChatQueueId':_0x383554['params']['id']},'transaction':_0x2f3764});});})['then'](function(){_0xcc308d['forEach'](function(_0x230e42){socket[_0xa724('0x7c')](_0xa724('0x7d'),{'UserId':_0x230e42['id'],'ChatQueueId':_0x4662d['id']});});});});});}})['then'](respondWithStatusCode(_0xdc8edd,null))[_0xa724('0x2b')](handleError(_0xdc8edd,null));};exports[_0xa724('0x7e')]=function(_0x5f595f,_0x4f9eaa,_0x58ad1f){return db[_0xa724('0x71')][_0xa724('0x56')]({'where':{'id':_0x5f595f['query'][_0xa724('0x72')]},'attributes':['id'],'include':[{'model':db[_0xa724('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f9eaa,null))[_0xa724('0x37')](function(_0x222594){var _0x17500a=_[_0xa724('0x40')](_0x222594,'id');var _0x163a13=[];var _0x3cdcef=[];var _0x357316=squel[_0xa724('0x7f')]();_0x357316[_0xa724('0x80')](_0xa724('0x81'))['from'](_0xa724('0x82'),'tq')['join'](_0xa724('0x83'),'ut',_0xa724('0x84'))['where']('ChatQueueId\x20=\x20?',_0x5f595f[_0xa724('0x59')]['id']);for(var _0x444b8a=0x0;_0x444b8a<_0x222594[_0xa724('0x5a')];_0x444b8a+=0x1){let _0x198b1e=_0x222594[_0x444b8a];for(var _0x4ccdae=0x0;_0x4ccdae<_0x198b1e[_0xa724('0x74')][_0xa724('0x5a')];_0x4ccdae+=0x1){let _0xef06d6=_0x198b1e[_0xa724('0x74')][_0x4ccdae];var _0x50fa3f=_0x357316[_0xa724('0x85')]();_0x50fa3f['where'](_0xa724('0x86'),_0xef06d6['id']);_0x3cdcef['push'](db['sequelize'][_0xa724('0x46')](_0x50fa3f[_0xa724('0x87')](),{'type':db[_0xa724('0x78')][_0xa724('0x88')][_0xa724('0x89')]})[_0xa724('0x37')](function(_0x24f721){if(_0x24f721[_0xa724('0x5a')]===0x1){return _0xef06d6['id'];}else{var _0x4b5948=_['every'](_[_0xa724('0x40')](_0x24f721,'TeamId'),function(_0x16934a){return _[_0xa724('0x8a')](_0x17500a,_0x16934a);});if(_0x4b5948){return _0xef06d6['id'];}}}));}}return BPromise[_0xa724('0x8b')](_0x3cdcef)['then'](function(_0x1fb832){_0x163a13=_(_0x163a13)[_0xa724('0x8c')](_0x1fb832)[_0xa724('0x8d')]()[_0xa724('0x8e')]();return db[_0xa724('0x41')][_0xa724('0x5b')]({'where':{'id':_0x5f595f[_0xa724('0x59')]['id']}})[_0xa724('0x37')](function(_0x1d68b9){return db[_0xa724('0x78')][_0xa724('0x79')](function(_0x1c9652){return _0x1d68b9[_0xa724('0x7e')](_0x5f595f[_0xa724('0x46')][_0xa724('0x72')],{'transaction':_0x1c9652})[_0xa724('0x37')](function(){if(!_[_0xa724('0x8f')](_0x163a13)){return _0x1d68b9[_0xa724('0x90')](_0x163a13,{'transaction':_0x1c9652});}})[_0xa724('0x37')](function(){_0x163a13[_0xa724('0x91')](function(_0x57e828){socket[_0xa724('0x7c')]('userChatQueue:remove',{'UserId':_0x57e828,'ChatQueueId':_0x1d68b9['id']});});});});});});})[_0xa724('0x37')](respondWithStatusCode(_0x4f9eaa,null))['catch'](handleError(_0x4f9eaa,null));};exports['addAgents']=function(_0x62ff6d,_0x31e18c,_0x1fe4e5){return db[_0xa724('0x41')][_0xa724('0x5b')]({'where':{'id':_0x62ff6d['params']['id']}})[_0xa724('0x37')](handleEntityNotFound(_0x31e18c,null))[_0xa724('0x37')](function(_0x5442b0){if(_0x5442b0){return _0x5442b0[_0xa724('0x92')](_0x62ff6d[_0xa724('0x5d')][_0xa724('0x72')],_[_0xa724('0x93')](_0x62ff6d['body'],['ids','id'])||{})['spread'](function(_0x58e83c){for(var _0x2eeba6=0x0;_0x2eeba6<_0x62ff6d[_0xa724('0x5d')][_0xa724('0x72')][_0xa724('0x5a')];_0x2eeba6+=0x1){socket[_0xa724('0x7c')](_0xa724('0x7d'),{'UserId':Number(_0x62ff6d['body'][_0xa724('0x72')][_0x2eeba6]),'ChatQueueId':Number(_0x62ff6d[_0xa724('0x59')]['id'])});}return _0x58e83c;});}})[_0xa724('0x37')](respondWithResult(_0x31e18c,null))[_0xa724('0x2b')](handleError(_0x31e18c,null));};exports[_0xa724('0x90')]=function(_0x358fa7,_0x5623aa,_0x4864ff){return db[_0xa724('0x41')]['find']({'where':{'id':_0x358fa7[_0xa724('0x59')]['id']}})[_0xa724('0x37')](handleEntityNotFound(_0x5623aa,null))[_0xa724('0x37')](function(_0xe942b4){if(_0xe942b4){return _0xe942b4[_0xa724('0x90')](_0x358fa7[_0xa724('0x46')]['ids'])['then'](function(){if(_[_0xa724('0x94')](_0x358fa7[_0xa724('0x46')][_0xa724('0x72')])){for(var _0x3c54a6=0x0;_0x3c54a6<_0x358fa7[_0xa724('0x46')][_0xa724('0x72')][_0xa724('0x5a')];_0x3c54a6+=0x1){socket['emit'](_0xa724('0x95'),{'UserId':Number(_0x358fa7['query']['ids'][_0x3c54a6]),'ChatQueueId':Number(_0x358fa7[_0xa724('0x59')]['id'])});}}else{socket[_0xa724('0x7c')](_0xa724('0x95'),{'UserId':Number(_0x358fa7[_0xa724('0x46')][_0xa724('0x72')]),'ChatQueueId':Number(_0x358fa7[_0xa724('0x59')]['id'])});}});}})[_0xa724('0x37')](respondWithStatusCode(_0x5623aa,null))[_0xa724('0x2b')](handleError(_0x5623aa,null));};exports[_0xa724('0x96')]=function(_0x2e43c7,_0x18de90,_0xa69e3e){var _0x4e8e77={};var _0x1ceef9={};var _0x532abd;var _0x3a8471;return db['ChatQueue']['findOne']({'where':{'id':_0x2e43c7[_0xa724('0x59')]['id']}})[_0xa724('0x37')](handleEntityNotFound(_0x18de90,null))[_0xa724('0x37')](function(_0x5ebdd7){if(_0x5ebdd7){_0x532abd=_0x5ebdd7;_0x1ceef9[_0xa724('0x48')]=_['keys'](db[_0xa724('0x73')][_0xa724('0x97')]);_0x1ceef9[_0xa724('0x46')]=_['keys'](_0x2e43c7[_0xa724('0x46')]);_0x1ceef9[_0xa724('0x4e')]=_[_0xa724('0x47')](_0x1ceef9['model'],_0x1ceef9['query']);_0x4e8e77[_0xa724('0x4a')]=_['intersection'](_0x1ceef9[_0xa724('0x48')],qs[_0xa724('0x49')](_0x2e43c7[_0xa724('0x46')]['fields']));_0x4e8e77[_0xa724('0x4a')]=_0x4e8e77['attributes'][_0xa724('0x5a')]?_0x4e8e77['attributes']:_0x1ceef9[_0xa724('0x48')];_0x4e8e77[_0xa724('0x65')]=qs[_0xa724('0x4d')](_0x2e43c7[_0xa724('0x46')][_0xa724('0x4d')]);_0x4e8e77[_0xa724('0x51')]=qs[_0xa724('0x4e')](_[_0xa724('0x4f')](_0x2e43c7[_0xa724('0x46')],_0x1ceef9['filters']));if(_0x2e43c7[_0xa724('0x46')][_0xa724('0x50')]){_0x4e8e77[_0xa724('0x51')]=_[_0xa724('0x53')](_0x4e8e77[_0xa724('0x51')],{'$or':_['map'](_0x4e8e77['attributes'],function(_0x627fe1){var _0x44b61b={};_0x44b61b[_0x627fe1]={'$like':'%'+_0x2e43c7[_0xa724('0x46')][_0xa724('0x50')]+'%'};return _0x44b61b;})});}_0x4e8e77=_[_0xa724('0x53')]({},_0x4e8e77,_0x2e43c7[_0xa724('0x67')]);return _0x532abd['getAgents'](_0x4e8e77);}})['then'](function(_0x193cda){if(_0x193cda){_0x3a8471=_0x193cda[_0xa724('0x5a')];if(!_0x2e43c7[_0xa724('0x46')][_0xa724('0x4b')](_0xa724('0x4c'))){_0x4e8e77[_0xa724('0x30')]=qs[_0xa724('0x30')](_0x2e43c7['query'][_0xa724('0x30')]);_0x4e8e77['offset']=qs[_0xa724('0x2d')](_0x2e43c7[_0xa724('0x46')][_0xa724('0x2d')]);}return _0x532abd[_0xa724('0x96')](_0x4e8e77);}})[_0xa724('0x37')](function(_0x3f00c1){if(_0x3f00c1){return _0x3f00c1?{'count':_0x3a8471,'rows':_0x3f00c1}:null;}})[_0xa724('0x37')](respondWithResult(_0x18de90,null))[_0xa724('0x2b')](handleError(_0x18de90,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 461dbb9..bc87c33 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 _0xaa77=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x481c6d,_0x4d4274){var _0x6f073c=function(_0x3197ac){while(--_0x3197ac){_0x481c6d['push'](_0x481c6d['shift']());}};_0x6f073c(++_0x4d4274);}(_0xaa77,0xb0));var _0x7aa7=function(_0x10f889,_0x25caff){_0x10f889=_0x10f889-0x0;var _0x2b28cb=_0xaa77[_0x10f889];return _0x2b28cb;};'use strict';var EventEmitter=require(_0x7aa7('0x0'));var ChatQueue=require(_0x7aa7('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7aa7('0x2')](0x0);var events={'afterCreate':_0x7aa7('0x3'),'afterUpdate':_0x7aa7('0x4'),'afterDestroy':_0x7aa7('0x5')};function emitEvent(_0xbd0589){return function(_0x3b9f51,_0x4b6f76,_0x44773d){ChatQueueEvents['emit'](_0xbd0589+':'+_0x3b9f51['id'],_0x3b9f51);ChatQueueEvents[_0x7aa7('0x6')](_0xbd0589,_0x3b9f51);_0x44773d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x7aa7('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x1af1=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x508eb8,_0x575522){var _0x4b75bc=function(_0x3107a3){while(--_0x3107a3){_0x508eb8['push'](_0x508eb8['shift']());}};_0x4b75bc(++_0x575522);}(_0x1af1,0x1e9));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x11af('0x0'));var ChatQueue=require(_0x11af('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11af('0x2'),'afterUpdate':_0x11af('0x3'),'afterDestroy':_0x11af('0x4')};function emitEvent(_0x13f81e){return function(_0x3b163a,_0x1c1c9d,_0x4e1a4d){ChatQueueEvents[_0x11af('0x5')](_0x13f81e+':'+_0x3b163a['id'],_0x3b163a);ChatQueueEvents[_0x11af('0x5')](_0x13f81e,_0x3b163a);_0x4e1a4d(null);};}for(var e in events){if(events[_0x11af('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x11af('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 0e6a3c8..f3f847a 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 _0x1d38=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e6aca,_0x5a1d15){var _0x14ae1b=function(_0x2f46a3){while(--_0x2f46a3){_0x4e6aca['push'](_0x4e6aca['shift']());}};_0x14ae1b(++_0x5a1d15);}(_0x1d38,0x8f));var _0x81d3=function(_0x12a365,_0x44252a){_0x12a365=_0x12a365-0x0;var _0x2f10f0=_0x1d38[_0x12a365];return _0x2f10f0;};'use strict';var _=require(_0x81d3('0x0'));var util=require(_0x81d3('0x1'));var logger=require(_0x81d3('0x2'))(_0x81d3('0x3'));var moment=require(_0x81d3('0x4'));var BPromise=require(_0x81d3('0x5'));var rp=require(_0x81d3('0x6'));var fs=require('fs');var path=require(_0x81d3('0x7'));var rimraf=require(_0x81d3('0x8'));var config=require(_0x81d3('0x9'));var attributes=require(_0x81d3('0xa'));module[_0x81d3('0xb')]=function(_0x2fe372,_0x16b94c){return _0x2fe372[_0x81d3('0xc')](_0x81d3('0xd'),attributes,{'tableName':_0x81d3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e44=['api','moment','bluebird','request-promise','path','rimraf','exports','define','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6e44,0x1a2));var _0x46e4=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x6e44[_0x38b2d9];return _0x23a3e1;};'use strict';var _=require('lodash');var util=require(_0x46e4('0x0'));var logger=require(_0x46e4('0x1'))(_0x46e4('0x2'));var moment=require(_0x46e4('0x3'));var BPromise=require(_0x46e4('0x4'));var rp=require(_0x46e4('0x5'));var fs=require('fs');var path=require(_0x46e4('0x6'));var rimraf=require(_0x46e4('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x46e4('0x8')]=function(_0xce0644,_0xfb6058){return _0xce0644[_0x46e4('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 945f532..47885f8 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 _0x6df4=['socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','limit','include','map','model','attributes','then','raw','where','ShowChatQueue','lodash','moment','bluebird','../../config/utils','jayson/promise','http','redis','localhost'];(function(_0x10fe3f,_0x10363b){var _0x12b968=function(_0x3b44e9){while(--_0x3b44e9){_0x10fe3f['push'](_0x10fe3f['shift']());}};_0x12b968(++_0x10363b);}(_0x6df4,0x78));var _0x46df=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x6df4[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x46df('0x0'));var util=require('util');var moment=require(_0x46df('0x1'));var BPromise=require(_0x46df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x46df('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x46df('0x4'));var client=jayson['client'][_0x46df('0x5')]({'port':0x232a});config[_0x46df('0x6')]=_['defaults'](config[_0x46df('0x6')],{'host':_0x46df('0x7'),'port':0x18eb});var socket=require(_0x46df('0x8'))(new Redis(config[_0x46df('0x6')]));require(_0x46df('0x9'))['register'](socket);function respondWithRpcPromise(_0x147f22,_0x4e0844,_0x432f39){return new BPromise(function(_0x32b48d,_0x1d491e){return client[_0x46df('0xa')](_0x147f22,_0x432f39)['then'](function(_0x1c33a2){logger[_0x46df('0xb')](_0x46df('0xc'),_0x4e0844,_0x46df('0xd'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4e0844,_0x46df('0xd'),JSON[_0x46df('0xe')](_0x1c33a2));if(_0x1c33a2['error']){if(_0x1c33a2['error']['code']===0x1f4){logger['error'](_0x46df('0xc'),_0x4e0844,_0x1c33a2[_0x46df('0xf')][_0x46df('0x10')]);return _0x1d491e(_0x1c33a2[_0x46df('0xf')][_0x46df('0x10')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4e0844,_0x1c33a2[_0x46df('0xf')]['message']);return _0x32b48d(_0x1c33a2[_0x46df('0xf')][_0x46df('0x10')]);}else{logger[_0x46df('0xb')](_0x46df('0xc'),_0x4e0844,'request\x20sent');_0x32b48d(_0x1c33a2[_0x46df('0x11')]['message']);}})[_0x46df('0x12')](function(_0x161d5a){logger[_0x46df('0xf')]('ChatQueue,\x20%s,\x20%s',_0x4e0844,_0x161d5a);_0x1d491e(_0x161d5a);});});}exports[_0x46df('0x13')]=function(_0x155704){var _0x51d6b6=this;return new Promise(function(_0x15956f,_0xc654f){return db[_0x46df('0x14')][_0x46df('0x15')]({'raw':_0x155704[_0x46df('0x16')]?_0x155704[_0x46df('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x155704[_0x46df('0x16')]?_0x155704[_0x46df('0x16')]['where']||null:null,'attributes':_0x155704[_0x46df('0x16')]?_0x155704[_0x46df('0x16')]['attributes']||null:null,'limit':_0x155704['options']?_0x155704[_0x46df('0x16')][_0x46df('0x17')]||null:null,'include':_0x155704[_0x46df('0x16')]?_0x155704[_0x46df('0x16')][_0x46df('0x18')]?_[_0x46df('0x19')](_0x155704['options'][_0x46df('0x18')],function(_0x18abb5){return{'model':db[_0x18abb5[_0x46df('0x1a')]],'as':_0x18abb5['as'],'attributes':_0x18abb5[_0x46df('0x1b')],'include':_0x18abb5['include']?_['map'](_0x18abb5[_0x46df('0x18')],function(_0xfa8cdf){return{'model':db[_0xfa8cdf['model']],'as':_0xfa8cdf['as'],'attributes':_0xfa8cdf['attributes'],'include':_0xfa8cdf['include']?_[_0x46df('0x19')](_0xfa8cdf[_0x46df('0x18')],function(_0x5a6c75){return{'model':db[_0x5a6c75[_0x46df('0x1a')]],'as':_0x5a6c75['as'],'attributes':_0x5a6c75['attributes']};}):[]};}):[]};}):[]:[]})[_0x46df('0x1c')](function(_0x52bed8){logger[_0x46df('0xb')]('GetChatQueue',_0x155704);logger['debug'](_0x46df('0x13'),_0x155704,JSON['stringify'](_0x52bed8));_0x15956f(_0x52bed8);})['catch'](function(_0x70b16a){logger[_0x46df('0xf')](_0x46df('0x13'),_0x70b16a[_0x46df('0x10')],_0x155704);_0xc654f(_0x51d6b6['error'](0x1f4,_0x70b16a[_0x46df('0x10')]));});});};exports['ShowChatQueue']=function(_0x161928){var _0x34f6b0=this;return new Promise(function(_0x4de7da,_0x54ffff){return db[_0x46df('0x14')]['find']({'raw':_0x161928[_0x46df('0x16')]?_0x161928[_0x46df('0x16')][_0x46df('0x1d')]===undefined?!![]:![]:!![],'where':_0x161928['options']?_0x161928[_0x46df('0x16')][_0x46df('0x1e')]||null:null,'attributes':_0x161928['options']?_0x161928[_0x46df('0x16')][_0x46df('0x1b')]||null:null,'include':_0x161928[_0x46df('0x16')]?_0x161928[_0x46df('0x16')]['include']?_[_0x46df('0x19')](_0x161928[_0x46df('0x16')][_0x46df('0x18')],function(_0x5bcf2b){return{'model':db[_0x5bcf2b[_0x46df('0x1a')]],'as':_0x5bcf2b['as'],'attributes':_0x5bcf2b[_0x46df('0x1b')],'include':_0x5bcf2b[_0x46df('0x18')]?_[_0x46df('0x19')](_0x5bcf2b[_0x46df('0x18')],function(_0x582c2b){return{'model':db[_0x582c2b['model']],'as':_0x582c2b['as'],'attributes':_0x582c2b['attributes'],'include':_0x582c2b['include']?_[_0x46df('0x19')](_0x582c2b[_0x46df('0x18')],function(_0x1a32eb){return{'model':db[_0x1a32eb['model']],'as':_0x1a32eb['as'],'attributes':_0x1a32eb[_0x46df('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x46df('0x1c')](function(_0x4cee23){logger[_0x46df('0xb')](_0x46df('0x1f'),_0x161928);logger['debug'](_0x46df('0x1f'),_0x161928,JSON[_0x46df('0xe')](_0x4cee23));_0x4de7da(_0x4cee23);})['catch'](function(_0x1dd351){logger[_0x46df('0xf')](_0x46df('0x1f'),_0x1dd351[_0x46df('0x10')],_0x161928);_0x54ffff(_0x34f6b0[_0x46df('0xf')](0x1f4,_0x1dd351[_0x46df('0x10')]));});});}; \ No newline at end of file +var _0x1131=['ShowChatQueue','find','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','limit','map','include','attributes','model'];(function(_0x45baf4,_0x37bd6d){var _0x55888d=function(_0x107632){while(--_0x107632){_0x45baf4['push'](_0x45baf4['shift']());}};_0x55888d(++_0x37bd6d);}(_0x1131,0x71));var _0x1113=function(_0x51b529,_0x7c4ba6){_0x51b529=_0x51b529-0x0;var _0x1e1739=_0x1131[_0x51b529];return _0x1e1739;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1113('0x1'));var db=require(_0x1113('0x2'))['db'];var utils=require(_0x1113('0x3'));var logger=require(_0x1113('0x4'))(_0x1113('0x5'));var config=require(_0x1113('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1113('0x7')]['http']({'port':0x232a});config[_0x1113('0x8')]=_['defaults'](config['redis'],{'host':_0x1113('0x9'),'port':0x18eb});var socket=require(_0x1113('0xa'))(new Redis(config[_0x1113('0x8')]));require(_0x1113('0xb'))[_0x1113('0xc')](socket);function respondWithRpcPromise(_0x36df92,_0x399e4c,_0x4deffb){return new BPromise(function(_0x4da83a,_0x37405f){return client[_0x1113('0xd')](_0x36df92,_0x4deffb)[_0x1113('0xe')](function(_0x55e205){logger[_0x1113('0xf')](_0x1113('0x10'),_0x399e4c,'request\x20sent');logger[_0x1113('0x11')](_0x1113('0x12'),_0x399e4c,_0x1113('0x13'),JSON[_0x1113('0x14')](_0x55e205));if(_0x55e205['error']){if(_0x55e205['error']['code']===0x1f4){logger['error'](_0x1113('0x10'),_0x399e4c,_0x55e205[_0x1113('0x15')][_0x1113('0x16')]);return _0x37405f(_0x55e205[_0x1113('0x15')]['message']);}logger[_0x1113('0x15')](_0x1113('0x10'),_0x399e4c,_0x55e205[_0x1113('0x15')][_0x1113('0x16')]);return _0x4da83a(_0x55e205[_0x1113('0x15')][_0x1113('0x16')]);}else{logger[_0x1113('0xf')](_0x1113('0x10'),_0x399e4c,_0x1113('0x13'));_0x4da83a(_0x55e205[_0x1113('0x17')]['message']);}})[_0x1113('0x18')](function(_0x4d3cbe){logger[_0x1113('0x15')]('ChatQueue,\x20%s,\x20%s',_0x399e4c,_0x4d3cbe);_0x37405f(_0x4d3cbe);});});}exports[_0x1113('0x19')]=function(_0xb7b818){var _0x5853bf=this;return new Promise(function(_0x4ed209,_0x58e795){return db['ChatQueue'][_0x1113('0x1a')]({'raw':_0xb7b818[_0x1113('0x1b')]?_0xb7b818[_0x1113('0x1b')][_0x1113('0x1c')]===undefined?!![]:![]:!![],'where':_0xb7b818[_0x1113('0x1b')]?_0xb7b818[_0x1113('0x1b')][_0x1113('0x1d')]||null:null,'attributes':_0xb7b818[_0x1113('0x1b')]?_0xb7b818[_0x1113('0x1b')]['attributes']||null:null,'limit':_0xb7b818[_0x1113('0x1b')]?_0xb7b818[_0x1113('0x1b')][_0x1113('0x1e')]||null:null,'include':_0xb7b818['options']?_0xb7b818[_0x1113('0x1b')]['include']?_[_0x1113('0x1f')](_0xb7b818[_0x1113('0x1b')][_0x1113('0x20')],function(_0x35ae31){return{'model':db[_0x35ae31['model']],'as':_0x35ae31['as'],'attributes':_0x35ae31[_0x1113('0x21')],'include':_0x35ae31[_0x1113('0x20')]?_[_0x1113('0x1f')](_0x35ae31[_0x1113('0x20')],function(_0x5c0b06){return{'model':db[_0x5c0b06[_0x1113('0x22')]],'as':_0x5c0b06['as'],'attributes':_0x5c0b06[_0x1113('0x21')],'include':_0x5c0b06[_0x1113('0x20')]?_['map'](_0x5c0b06[_0x1113('0x20')],function(_0x1bdf2b){return{'model':db[_0x1bdf2b[_0x1113('0x22')]],'as':_0x1bdf2b['as'],'attributes':_0x1bdf2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1113('0xe')](function(_0x1d8c4a){logger[_0x1113('0xf')](_0x1113('0x19'),_0xb7b818);logger[_0x1113('0x11')](_0x1113('0x19'),_0xb7b818,JSON[_0x1113('0x14')](_0x1d8c4a));_0x4ed209(_0x1d8c4a);})[_0x1113('0x18')](function(_0x28b5d0){logger[_0x1113('0x15')](_0x1113('0x19'),_0x28b5d0[_0x1113('0x16')],_0xb7b818);_0x58e795(_0x5853bf['error'](0x1f4,_0x28b5d0['message']));});});};exports[_0x1113('0x23')]=function(_0x2d5107){var _0x503a53=this;return new Promise(function(_0x428065,_0x28657d){return db['ChatQueue'][_0x1113('0x24')]({'raw':_0x2d5107[_0x1113('0x1b')]?_0x2d5107['options'][_0x1113('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d5107[_0x1113('0x1b')]?_0x2d5107[_0x1113('0x1b')][_0x1113('0x1d')]||null:null,'attributes':_0x2d5107['options']?_0x2d5107['options'][_0x1113('0x21')]||null:null,'include':_0x2d5107[_0x1113('0x1b')]?_0x2d5107['options'][_0x1113('0x20')]?_['map'](_0x2d5107[_0x1113('0x1b')][_0x1113('0x20')],function(_0x3e7abf){return{'model':db[_0x3e7abf[_0x1113('0x22')]],'as':_0x3e7abf['as'],'attributes':_0x3e7abf[_0x1113('0x21')],'include':_0x3e7abf[_0x1113('0x20')]?_['map'](_0x3e7abf[_0x1113('0x20')],function(_0x5c9d2e){return{'model':db[_0x5c9d2e[_0x1113('0x22')]],'as':_0x5c9d2e['as'],'attributes':_0x5c9d2e[_0x1113('0x21')],'include':_0x5c9d2e['include']?_[_0x1113('0x1f')](_0x5c9d2e['include'],function(_0x2c9090){return{'model':db[_0x2c9090[_0x1113('0x22')]],'as':_0x2c9090['as'],'attributes':_0x2c9090['attributes']};}):[]};}):[]};}):[]:[]})[_0x1113('0xe')](function(_0x5171ea){logger[_0x1113('0xf')](_0x1113('0x23'),_0x2d5107);logger[_0x1113('0x11')]('ShowChatQueue',_0x2d5107,JSON['stringify'](_0x5171ea));_0x428065(_0x5171ea);})[_0x1113('0x18')](function(_0x43d7dc){logger[_0x1113('0x15')](_0x1113('0x23'),_0x43d7dc[_0x1113('0x16')],_0x2d5107);_0x28657d(_0x503a53[_0x1113('0x15')](0x1f4,_0x43d7dc[_0x1113('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b0fcbd6..48a5540 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x9d69c8,_0x128291){var _0x53181a=function(_0x4e0f10){while(--_0x4e0f10){_0x9d69c8['push'](_0x9d69c8['shift']());}};_0x53181a(++_0x128291);}(_0x22fb,0x192));var _0xb22f=function(_0x1ef4b2,_0x930e58){_0x1ef4b2=_0x1ef4b2-0x0;var _0x624415=_0x22fb[_0x1ef4b2];return _0x624415;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file +var _0xac31=['remove','update','length','chatQueue:','./chatQueue.events','save'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xac31,0xca));var _0x1ac3=function(_0x4afa46,_0xf6c8ac){_0x4afa46=_0x4afa46-0x0;var _0x5de5fb=_0xac31[_0x4afa46];return _0x5de5fb;};'use strict';var ChatQueueEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){ChatQueueEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);ChatQueueEvents['on'](_0x157604,_0x57893c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4a849b9..5395b5f 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c85bb,_0x22e053){var _0x5666d5=function(_0xf06350){while(--_0xf06350){_0x4c85bb['push'](_0x4c85bb['shift']());}};_0x5666d5(++_0x22e053);}(_0x008c,0x188));var _0xc008=function(_0x2ea9bb,_0x41a73f){_0x2ea9bb=_0x2ea9bb-0x0;var _0x3f0084=_0x008c[_0x2ea9bb];return _0x3f0084;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x154e53,_0x3f6d2c){var _0x2c2471=function(_0x11137){while(--_0x11137){_0x154e53['push'](_0x154e53['shift']());}};_0x2c2471(++_0x3f6d2c);}(_0x814b,0x1a2));var _0xb814=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x814b[_0x16771d];return _0x386f11;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ed8227e..98b3790 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 _0x6c03=['STRING','DATE','moment','sequelize','exports'];(function(_0x5cd394,_0x2c362c){var _0xb48c29=function(_0x26c210){while(--_0x26c210){_0x5cd394['push'](_0x5cd394['shift']());}};_0xb48c29(++_0x2c362c);}(_0x6c03,0xca));var _0x36c0=function(_0x360c64,_0x1c239a){_0x360c64=_0x360c64-0x0;var _0x4e0332=_0x6c03[_0x360c64];return _0x4e0332;};'use strict';var moment=require(_0x36c0('0x0'));var Sequelize=require(_0x36c0('0x1'));module[_0x36c0('0x2')]={'uniqueid':{'type':Sequelize[_0x36c0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x36c0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x36c0('0x4')]},'exitAt':{'type':Sequelize[_0x36c0('0x4')]},'reason':{'type':Sequelize[_0x36c0('0x3')]}}; \ No newline at end of file +var _0x80ea=['exports','STRING','DATE','moment','sequelize'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x80ea,0x15c));var _0xa80e=function(_0x347854,_0x4f16b0){_0x347854=_0x347854-0x0;var _0x228013=_0x80ea[_0x347854];return _0x228013;};'use strict';var moment=require(_0xa80e('0x0'));var Sequelize=require(_0xa80e('0x1'));module[_0xa80e('0x2')]={'uniqueid':{'type':Sequelize[_0xa80e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa80e('0x3')]},'joinAt':{'type':Sequelize[_0xa80e('0x4')]},'leaveAt':{'type':Sequelize[_0xa80e('0x4')]},'acceptAt':{'type':Sequelize[_0xa80e('0x4')]},'exitAt':{'type':Sequelize[_0xa80e('0x4')]},'reason':{'type':Sequelize[_0xa80e('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c94ee5a..e6eff59 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 _0x0eb2=['fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','then','error','stack','name','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','keys','includeAll','find','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs'];(function(_0x23a971,_0x70b461){var _0x36c6d3=function(_0x3ccc4e){while(--_0x3ccc4e){_0x23a971['push'](_0x23a971['shift']());}};_0x36c6d3(++_0x70b461);}(_0x0eb2,0x11c));var _0x20eb=function(_0x3957a6,_0x338f80){_0x3957a6=_0x3957a6-0x0;var _0x56525c=_0x0eb2[_0x3957a6];return _0x56525c;};'use strict';var emlformat=require(_0x20eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20eb('0x1'));var jsonpatch=require(_0x20eb('0x2'));var rp=require(_0x20eb('0x3'));var moment=require(_0x20eb('0x4'));var BPromise=require(_0x20eb('0x5'));var Mustache=require('mustache');var util=require(_0x20eb('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20eb('0x7'));var fs=require('fs');var fs_extra=require(_0x20eb('0x8'));var _=require(_0x20eb('0x9'));var squel=require('squel');var crypto=require(_0x20eb('0xa'));var jsforce=require(_0x20eb('0xb'));var deskjs=require(_0x20eb('0xc'));var toCsv=require(_0x20eb('0xd'));var querystring=require(_0x20eb('0xe'));var Papa=require(_0x20eb('0xf'));var Redis=require(_0x20eb('0x10'));var authService=require(_0x20eb('0x11'));var qs=require(_0x20eb('0x12'));var as=require(_0x20eb('0x13'));var hardwareService=require(_0x20eb('0x14'));var logger=require(_0x20eb('0x15'))(_0x20eb('0x16'));var utils=require(_0x20eb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x20eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120651,_0x5371a8){_0x5371a8=_0x5371a8||0xcc;return function(_0x2ffef9){if(_0x2ffef9){return _0x120651[_0x20eb('0x19')](_0x5371a8);}return _0x120651[_0x20eb('0x1a')](_0x5371a8)[_0x20eb('0x1b')]();};}function respondWithResult(_0xfee98d,_0xa548eb){_0xa548eb=_0xa548eb||0xc8;return function(_0x4160b2){if(_0x4160b2){return _0xfee98d[_0x20eb('0x1a')](_0xa548eb)[_0x20eb('0x1c')](_0x4160b2);}};}function respondWithFilteredResult(_0x45473f,_0x155545){return function(_0x11b1cc){if(_0x11b1cc){var _0x150704=typeof _0x155545[_0x20eb('0x1d')]===_0x20eb('0x1e')&&typeof _0x155545['limit']===_0x20eb('0x1e');var _0x579270=_0x11b1cc[_0x20eb('0x1f')];var _0x21765e=_0x150704?0x0:_0x155545[_0x20eb('0x1d')];var _0x3c083a=_0x150704?_0x11b1cc[_0x20eb('0x1f')]:_0x155545[_0x20eb('0x1d')]+_0x155545[_0x20eb('0x20')];var _0x51eb8d;if(_0x3c083a>=_0x579270){_0x3c083a=_0x579270;_0x51eb8d=0xc8;}else{_0x51eb8d=0xce;}_0x45473f[_0x20eb('0x1a')](_0x51eb8d);return _0x45473f[_0x20eb('0x21')]('Content-Range',_0x21765e+'-'+_0x3c083a+'/'+_0x579270)[_0x20eb('0x1c')](_0x11b1cc);}return null;};}function patchUpdates(_0x3eb2be){return function(_0x5d5d8d){try{jsonpatch[_0x20eb('0x22')](_0x5d5d8d,_0x3eb2be,!![]);}catch(_0x1c7853){return BPromise[_0x20eb('0x23')](_0x1c7853);}return _0x5d5d8d['save']();};}function saveUpdates(_0x989b4,_0x258a64){return function(_0x431f82){if(_0x431f82){return _0x431f82['update'](_0x989b4)[_0x20eb('0x24')](function(_0x15bac3){return _0x15bac3;});}return null;};}function removeEntity(_0x22350d,_0x5dc978){return function(_0x2a1b56){if(_0x2a1b56){return _0x2a1b56['destroy']()[_0x20eb('0x24')](function(){_0x22350d[_0x20eb('0x1a')](0xcc)[_0x20eb('0x1b')]();});}};}function handleEntityNotFound(_0x3b88b3,_0x2e88d6){return function(_0x391739){if(!_0x391739){_0x3b88b3[_0x20eb('0x19')](0x194);}return _0x391739;};}function handleError(_0x1adb65,_0x4256ca){_0x4256ca=_0x4256ca||0x1f4;return function(_0x58b8c3){logger[_0x20eb('0x25')](_0x58b8c3[_0x20eb('0x26')]);if(_0x58b8c3[_0x20eb('0x27')]){delete _0x58b8c3['name'];}_0x1adb65['status'](_0x4256ca)['send'](_0x58b8c3);};}exports['index']=function(_0x42455f,_0xd3592a){var _0x53c0f0={},_0x155752={},_0x50b08d={'count':0x0,'rows':[]};var _0x4547d6=_['map'](db['ChatQueueReport'][_0x20eb('0x28')],function(_0x3999ec){return{'name':_0x3999ec['fieldName'],'type':_0x3999ec['type'][_0x20eb('0x29')]};});_0x155752[_0x20eb('0x2a')]=_['map'](_0x4547d6,_0x20eb('0x27'));_0x155752[_0x20eb('0x2b')]=_['keys'](_0x42455f[_0x20eb('0x2b')]);_0x155752[_0x20eb('0x2c')]=_['intersection'](_0x155752[_0x20eb('0x2a')],_0x155752['query']);_0x53c0f0[_0x20eb('0x2d')]=_[_0x20eb('0x2e')](_0x155752[_0x20eb('0x2a')],qs['fields'](_0x42455f[_0x20eb('0x2b')][_0x20eb('0x2f')]));_0x53c0f0[_0x20eb('0x2d')]=_0x53c0f0[_0x20eb('0x2d')]['length']?_0x53c0f0[_0x20eb('0x2d')]:_0x155752[_0x20eb('0x2a')];if(!_0x42455f[_0x20eb('0x2b')][_0x20eb('0x30')](_0x20eb('0x31'))){_0x53c0f0[_0x20eb('0x20')]=qs[_0x20eb('0x20')](_0x42455f[_0x20eb('0x2b')][_0x20eb('0x20')]);_0x53c0f0[_0x20eb('0x1d')]=qs[_0x20eb('0x1d')](_0x42455f['query'][_0x20eb('0x1d')]);}_0x53c0f0[_0x20eb('0x32')]=qs[_0x20eb('0x33')](_0x42455f[_0x20eb('0x2b')]['sort']);_0x53c0f0[_0x20eb('0x34')]=qs[_0x20eb('0x2c')](_[_0x20eb('0x35')](_0x42455f['query'],_0x155752[_0x20eb('0x2c')]),_0x4547d6);if(_0x42455f[_0x20eb('0x2b')][_0x20eb('0x36')]){_0x53c0f0[_0x20eb('0x34')]=_[_0x20eb('0x37')](_0x53c0f0[_0x20eb('0x34')],{'$or':_[_0x20eb('0x38')](_0x4547d6,function(_0x44eb8b){if(_0x44eb8b[_0x20eb('0x39')]!==_0x20eb('0x3a')){var _0x588837={};_0x588837[_0x44eb8b[_0x20eb('0x27')]]={'$like':'%'+_0x42455f['query'][_0x20eb('0x36')]+'%'};return _0x588837;}})});}_0x53c0f0=_[_0x20eb('0x37')]({},_0x53c0f0,_0x42455f[_0x20eb('0x3b')]);var _0x341f62={'where':_0x53c0f0[_0x20eb('0x34')]};return db[_0x20eb('0x3c')][_0x20eb('0x1f')](_0x341f62)[_0x20eb('0x24')](function(_0x1dc004){_0x50b08d['count']=_0x1dc004;if(_0x42455f[_0x20eb('0x2b')]['includeAll']){_0x53c0f0[_0x20eb('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x20eb('0x3e')](_0x53c0f0);})[_0x20eb('0x24')](function(_0x565f6b){_0x50b08d[_0x20eb('0x3f')]=_0x565f6b;return _0x50b08d;})[_0x20eb('0x24')](respondWithFilteredResult(_0xd3592a,_0x53c0f0))[_0x20eb('0x40')](handleError(_0xd3592a,null));};exports[_0x20eb('0x41')]=function(_0x363138,_0xb9b902){var _0x3c9020={'raw':!![],'where':{'id':_0x363138[_0x20eb('0x42')]['id']}},_0x8fb3af={};_0x8fb3af[_0x20eb('0x2a')]=_[_0x20eb('0x43')](db[_0x20eb('0x3c')][_0x20eb('0x28')]);_0x8fb3af[_0x20eb('0x2b')]=_[_0x20eb('0x43')](_0x363138[_0x20eb('0x2b')]);_0x8fb3af[_0x20eb('0x2c')]=_[_0x20eb('0x2e')](_0x8fb3af[_0x20eb('0x2a')],_0x8fb3af['query']);_0x3c9020[_0x20eb('0x2d')]=_[_0x20eb('0x2e')](_0x8fb3af[_0x20eb('0x2a')],qs[_0x20eb('0x2f')](_0x363138[_0x20eb('0x2b')]['fields']));_0x3c9020[_0x20eb('0x2d')]=_0x3c9020[_0x20eb('0x2d')]['length']?_0x3c9020[_0x20eb('0x2d')]:_0x8fb3af['model'];if(_0x363138[_0x20eb('0x2b')][_0x20eb('0x44')]){_0x3c9020[_0x20eb('0x3d')]=[{'all':!![]}];}_0x3c9020=_[_0x20eb('0x37')]({},_0x3c9020,_0x363138['options']);return db[_0x20eb('0x3c')][_0x20eb('0x45')](_0x3c9020)[_0x20eb('0x24')](handleEntityNotFound(_0xb9b902,null))['then'](respondWithResult(_0xb9b902,null))[_0x20eb('0x40')](handleError(_0xb9b902,null));};exports['create']=function(_0x27bd65,_0xeb35d9){return db[_0x20eb('0x3c')]['create'](_0x27bd65[_0x20eb('0x46')],{})[_0x20eb('0x24')](respondWithResult(_0xeb35d9,0xc9))[_0x20eb('0x40')](handleError(_0xeb35d9,null));};exports[_0x20eb('0x47')]=function(_0x4aa040,_0xcd25ff){if(_0x4aa040[_0x20eb('0x46')]['id']){delete _0x4aa040[_0x20eb('0x46')]['id'];}return db[_0x20eb('0x3c')][_0x20eb('0x45')]({'where':{'id':_0x4aa040['params']['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0xcd25ff,null))[_0x20eb('0x24')](saveUpdates(_0x4aa040[_0x20eb('0x46')],null))[_0x20eb('0x24')](respondWithResult(_0xcd25ff,null))[_0x20eb('0x40')](handleError(_0xcd25ff,null));};exports['destroy']=function(_0x1ffce3,_0x3faa09){return db[_0x20eb('0x3c')]['find']({'where':{'id':_0x1ffce3[_0x20eb('0x42')]['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0x3faa09,null))[_0x20eb('0x24')](removeEntity(_0x3faa09,null))[_0x20eb('0x40')](handleError(_0x3faa09,null));};exports[_0x20eb('0x48')]=function(_0x3ac919,_0x5bf350){return db[_0x20eb('0x3c')][_0x20eb('0x48')]()['then'](respondWithResult(_0x5bf350,null))[_0x20eb('0x40')](handleError(_0x5bf350,null));}; \ No newline at end of file +var _0x56da=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0xf530db,_0x190564){var _0x5ce2b6=function(_0x10a84e){while(--_0x10a84e){_0xf530db['push'](_0xf530db['shift']());}};_0x5ce2b6(++_0x190564);}(_0x56da,0x119));var _0xa56d=function(_0x1a48a0,_0x3c95f5){_0x1a48a0=_0x1a48a0-0x0;var _0x269714=_0x56da[_0x1a48a0];return _0x269714;};'use strict';var emlformat=require(_0xa56d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa56d('0x1'));var jsonpatch=require(_0xa56d('0x2'));var rp=require('request-promise');var moment=require(_0xa56d('0x3'));var BPromise=require(_0xa56d('0x4'));var Mustache=require(_0xa56d('0x5'));var util=require(_0xa56d('0x6'));var path=require(_0xa56d('0x7'));var sox=require(_0xa56d('0x8'));var csv=require(_0xa56d('0x9'));var ejs=require(_0xa56d('0xa'));var fs=require('fs');var fs_extra=require(_0xa56d('0xb'));var _=require(_0xa56d('0xc'));var squel=require(_0xa56d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa56d('0xe'));var toCsv=require(_0xa56d('0x9'));var querystring=require(_0xa56d('0xf'));var Papa=require(_0xa56d('0x10'));var Redis=require(_0xa56d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa56d('0x12'));var hardwareService=require(_0xa56d('0x13'));var logger=require(_0xa56d('0x14'))('api');var utils=require(_0xa56d('0x15'));var config=require(_0xa56d('0x16'));var licenseUtil=require(_0xa56d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e2244,_0x44bfd8){_0x44bfd8=_0x44bfd8||0xcc;return function(_0x3e8e12){if(_0x3e8e12){return _0x3e2244[_0xa56d('0x18')](_0x44bfd8);}return _0x3e2244[_0xa56d('0x19')](_0x44bfd8)[_0xa56d('0x1a')]();};}function respondWithResult(_0x247c49,_0x3f5975){_0x3f5975=_0x3f5975||0xc8;return function(_0x4ce69b){if(_0x4ce69b){return _0x247c49[_0xa56d('0x19')](_0x3f5975)[_0xa56d('0x1b')](_0x4ce69b);}};}function respondWithFilteredResult(_0x4ed4ed,_0x576e28){return function(_0x3cebbc){if(_0x3cebbc){var _0x17d8ab=typeof _0x576e28[_0xa56d('0x1c')]===_0xa56d('0x1d')&&typeof _0x576e28[_0xa56d('0x1e')]==='undefined';var _0x24fd18=_0x3cebbc['count'];var _0x30ba3f=_0x17d8ab?0x0:_0x576e28[_0xa56d('0x1c')];var _0x2d7a1a=_0x17d8ab?_0x3cebbc[_0xa56d('0x1f')]:_0x576e28[_0xa56d('0x1c')]+_0x576e28[_0xa56d('0x1e')];var _0x4abc54;if(_0x2d7a1a>=_0x24fd18){_0x2d7a1a=_0x24fd18;_0x4abc54=0xc8;}else{_0x4abc54=0xce;}_0x4ed4ed[_0xa56d('0x19')](_0x4abc54);return _0x4ed4ed['set'](_0xa56d('0x20'),_0x30ba3f+'-'+_0x2d7a1a+'/'+_0x24fd18)[_0xa56d('0x1b')](_0x3cebbc);}return null;};}function patchUpdates(_0x1cf843){return function(_0x330bf4){try{jsonpatch[_0xa56d('0x21')](_0x330bf4,_0x1cf843,!![]);}catch(_0x271fe7){return BPromise[_0xa56d('0x22')](_0x271fe7);}return _0x330bf4[_0xa56d('0x23')]();};}function saveUpdates(_0x33070c,_0x59661d){return function(_0x8df769){if(_0x8df769){return _0x8df769[_0xa56d('0x24')](_0x33070c)[_0xa56d('0x25')](function(_0x58160f){return _0x58160f;});}return null;};}function removeEntity(_0x4f23e7,_0x257841){return function(_0x5f28b8){if(_0x5f28b8){return _0x5f28b8['destroy']()[_0xa56d('0x25')](function(){_0x4f23e7[_0xa56d('0x19')](0xcc)[_0xa56d('0x1a')]();});}};}function handleEntityNotFound(_0x2fe90e,_0x24a935){return function(_0x1028c7){if(!_0x1028c7){_0x2fe90e[_0xa56d('0x18')](0x194);}return _0x1028c7;};}function handleError(_0x26d264,_0x2ff4ab){_0x2ff4ab=_0x2ff4ab||0x1f4;return function(_0x537ebc){logger[_0xa56d('0x26')](_0x537ebc[_0xa56d('0x27')]);if(_0x537ebc[_0xa56d('0x28')]){delete _0x537ebc[_0xa56d('0x28')];}_0x26d264[_0xa56d('0x19')](_0x2ff4ab)[_0xa56d('0x29')](_0x537ebc);};}exports[_0xa56d('0x2a')]=function(_0x139300,_0x3a3db5){var _0xac1e4f={},_0xb446a0={},_0x4c0459={'count':0x0,'rows':[]};var _0x20d9a2=_[_0xa56d('0x2b')](db[_0xa56d('0x2c')]['rawAttributes'],function(_0x465142){return{'name':_0x465142[_0xa56d('0x2d')],'type':_0x465142[_0xa56d('0x2e')][_0xa56d('0x2f')]};});_0xb446a0[_0xa56d('0x30')]=_[_0xa56d('0x2b')](_0x20d9a2,_0xa56d('0x28'));_0xb446a0[_0xa56d('0x31')]=_[_0xa56d('0x32')](_0x139300[_0xa56d('0x31')]);_0xb446a0['filters']=_[_0xa56d('0x33')](_0xb446a0[_0xa56d('0x30')],_0xb446a0['query']);_0xac1e4f[_0xa56d('0x34')]=_[_0xa56d('0x33')](_0xb446a0['model'],qs[_0xa56d('0x35')](_0x139300[_0xa56d('0x31')][_0xa56d('0x35')]));_0xac1e4f[_0xa56d('0x34')]=_0xac1e4f[_0xa56d('0x34')][_0xa56d('0x36')]?_0xac1e4f[_0xa56d('0x34')]:_0xb446a0[_0xa56d('0x30')];if(!_0x139300['query']['hasOwnProperty'](_0xa56d('0x37'))){_0xac1e4f[_0xa56d('0x1e')]=qs['limit'](_0x139300['query'][_0xa56d('0x1e')]);_0xac1e4f[_0xa56d('0x1c')]=qs[_0xa56d('0x1c')](_0x139300['query'][_0xa56d('0x1c')]);}_0xac1e4f[_0xa56d('0x38')]=qs[_0xa56d('0x39')](_0x139300[_0xa56d('0x31')]['sort']);_0xac1e4f[_0xa56d('0x3a')]=qs[_0xa56d('0x3b')](_['pick'](_0x139300[_0xa56d('0x31')],_0xb446a0['filters']),_0x20d9a2);if(_0x139300['query']['filter']){_0xac1e4f[_0xa56d('0x3a')]=_['merge'](_0xac1e4f[_0xa56d('0x3a')],{'$or':_[_0xa56d('0x2b')](_0x20d9a2,function(_0x35ee79){if(_0x35ee79[_0xa56d('0x2e')]!==_0xa56d('0x3c')){var _0xe15df5={};_0xe15df5[_0x35ee79[_0xa56d('0x28')]]={'$like':'%'+_0x139300['query'][_0xa56d('0x3d')]+'%'};return _0xe15df5;}})});}_0xac1e4f=_[_0xa56d('0x3e')]({},_0xac1e4f,_0x139300[_0xa56d('0x3f')]);var _0x119828={'where':_0xac1e4f[_0xa56d('0x3a')]};return db['ChatQueueReport'][_0xa56d('0x1f')](_0x119828)['then'](function(_0x1a0435){_0x4c0459[_0xa56d('0x1f')]=_0x1a0435;if(_0x139300[_0xa56d('0x31')][_0xa56d('0x40')]){_0xac1e4f['include']=[{'all':!![]}];}return db[_0xa56d('0x2c')][_0xa56d('0x41')](_0xac1e4f);})[_0xa56d('0x25')](function(_0x435aa0){_0x4c0459[_0xa56d('0x42')]=_0x435aa0;return _0x4c0459;})[_0xa56d('0x25')](respondWithFilteredResult(_0x3a3db5,_0xac1e4f))[_0xa56d('0x43')](handleError(_0x3a3db5,null));};exports[_0xa56d('0x44')]=function(_0x468280,_0xd2c2db){var _0x544886={'raw':!![],'where':{'id':_0x468280[_0xa56d('0x45')]['id']}},_0x3572a4={};_0x3572a4['model']=_[_0xa56d('0x32')](db[_0xa56d('0x2c')]['rawAttributes']);_0x3572a4[_0xa56d('0x31')]=_[_0xa56d('0x32')](_0x468280['query']);_0x3572a4[_0xa56d('0x3b')]=_[_0xa56d('0x33')](_0x3572a4[_0xa56d('0x30')],_0x3572a4[_0xa56d('0x31')]);_0x544886['attributes']=_[_0xa56d('0x33')](_0x3572a4['model'],qs[_0xa56d('0x35')](_0x468280[_0xa56d('0x31')][_0xa56d('0x35')]));_0x544886[_0xa56d('0x34')]=_0x544886[_0xa56d('0x34')][_0xa56d('0x36')]?_0x544886[_0xa56d('0x34')]:_0x3572a4['model'];if(_0x468280[_0xa56d('0x31')][_0xa56d('0x40')]){_0x544886[_0xa56d('0x46')]=[{'all':!![]}];}_0x544886=_['merge']({},_0x544886,_0x468280[_0xa56d('0x3f')]);return db['ChatQueueReport']['find'](_0x544886)[_0xa56d('0x25')](handleEntityNotFound(_0xd2c2db,null))[_0xa56d('0x25')](respondWithResult(_0xd2c2db,null))['catch'](handleError(_0xd2c2db,null));};exports[_0xa56d('0x47')]=function(_0x7ae53f,_0x5af65b){return db['ChatQueueReport'][_0xa56d('0x47')](_0x7ae53f[_0xa56d('0x48')],{})[_0xa56d('0x25')](respondWithResult(_0x5af65b,0xc9))[_0xa56d('0x43')](handleError(_0x5af65b,null));};exports[_0xa56d('0x24')]=function(_0x1dcca8,_0xfdcaf8){if(_0x1dcca8[_0xa56d('0x48')]['id']){delete _0x1dcca8['body']['id'];}return db[_0xa56d('0x2c')][_0xa56d('0x49')]({'where':{'id':_0x1dcca8[_0xa56d('0x45')]['id']}})['then'](handleEntityNotFound(_0xfdcaf8,null))[_0xa56d('0x25')](saveUpdates(_0x1dcca8[_0xa56d('0x48')],null))[_0xa56d('0x25')](respondWithResult(_0xfdcaf8,null))[_0xa56d('0x43')](handleError(_0xfdcaf8,null));};exports[_0xa56d('0x4a')]=function(_0x1ec121,_0x308003){return db[_0xa56d('0x2c')]['find']({'where':{'id':_0x1ec121[_0xa56d('0x45')]['id']}})[_0xa56d('0x25')](handleEntityNotFound(_0x308003,null))[_0xa56d('0x25')](removeEntity(_0x308003,null))[_0xa56d('0x43')](handleError(_0x308003,null));};exports[_0xa56d('0x4b')]=function(_0x453f59,_0x48c85b){return db[_0xa56d('0x2c')][_0xa56d('0x4b')]()[_0xa56d('0x25')](respondWithResult(_0x48c85b,null))[_0xa56d('0x43')](handleError(_0x48c85b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 2c2d44d..3d8679e 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x84b55a,_0x29154a){var _0x47c6ac=function(_0x1312d5){while(--_0x1312d5){_0x84b55a['push'](_0x84b55a['shift']());}};_0x47c6ac(++_0x29154a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x496c78,_0x23fadf){var _0x2b0f92=function(_0x87eda){while(--_0x87eda){_0x496c78['push'](_0x496c78['shift']());}};_0x2b0f92(++_0x23fadf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b45cbcf..a26de48 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 _0x4f0c=['CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options'];(function(_0x3644b9,_0x5cd3a6){var _0x4d196d=function(_0x2bb4ef){while(--_0x2bb4ef){_0x3644b9['push'](_0x3644b9['shift']());}};_0x4d196d(++_0x5cd3a6);}(_0x4f0c,0x117));var _0xc4f0=function(_0xb52378,_0x3c30bb){_0xb52378=_0xb52378-0x0;var _0x14082e=_0x4f0c[_0xb52378];return _0x14082e;};'use strict';var _=require(_0xc4f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc4f0('0x1'));var rs=require(_0xc4f0('0x2'));var fs=require('fs');var Redis=require(_0xc4f0('0x3'));var db=require(_0xc4f0('0x4'))['db'];var utils=require(_0xc4f0('0x5'));var logger=require(_0xc4f0('0x6'))(_0xc4f0('0x7'));var config=require(_0xc4f0('0x8'));var jayson=require(_0xc4f0('0x9'));var client=jayson[_0xc4f0('0xa')][_0xc4f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x73c546,_0x4eedbf,_0x4a0a2a){return new BPromise(function(_0x37405f,_0x3fa153){return client['request'](_0x73c546,_0x4a0a2a)[_0xc4f0('0xc')](function(_0x20aba0){logger[_0xc4f0('0xd')](_0xc4f0('0xe'),_0x4eedbf,_0xc4f0('0xf'));logger[_0xc4f0('0x10')](_0xc4f0('0x11'),_0x4eedbf,_0xc4f0('0xf'),JSON[_0xc4f0('0x12')](_0x20aba0));if(_0x20aba0[_0xc4f0('0x13')]){if(_0x20aba0[_0xc4f0('0x13')][_0xc4f0('0x14')]===0x1f4){logger[_0xc4f0('0x13')](_0xc4f0('0xe'),_0x4eedbf,_0x20aba0['error']['message']);return _0x3fa153(_0x20aba0[_0xc4f0('0x13')][_0xc4f0('0x15')]);}logger['error'](_0xc4f0('0xe'),_0x4eedbf,_0x20aba0['error'][_0xc4f0('0x15')]);return _0x37405f(_0x20aba0[_0xc4f0('0x13')][_0xc4f0('0x15')]);}else{logger[_0xc4f0('0xd')](_0xc4f0('0xe'),_0x4eedbf,_0xc4f0('0xf'));_0x37405f(_0x20aba0[_0xc4f0('0x16')][_0xc4f0('0x15')]);}})[_0xc4f0('0x17')](function(_0x4fb778){logger[_0xc4f0('0x13')](_0xc4f0('0xe'),_0x4eedbf,_0x4fb778);_0x3fa153(_0x4fb778);});});}exports['CreateChatQueueReport']=function(_0x54782b){var _0x255f27=this;return new Promise(function(_0x4812d9,_0x90869c){return db['ChatQueueReport'][_0xc4f0('0x18')](_0x54782b[_0xc4f0('0x19')],{'raw':_0x54782b[_0xc4f0('0x1a')]?_0x54782b[_0xc4f0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc4f0('0xc')](function(_0xd6004f){logger[_0xc4f0('0xd')](_0xc4f0('0x1b'),_0x54782b);logger[_0xc4f0('0x10')]('CreateChatQueueReport',_0x54782b,JSON[_0xc4f0('0x12')](_0xd6004f));_0x4812d9(_0xd6004f);})[_0xc4f0('0x17')](function(_0x11d201){logger[_0xc4f0('0x13')](_0xc4f0('0x1b'),_0x11d201[_0xc4f0('0x15')],_0x54782b);_0x90869c(_0x255f27['error'](0x1f4,_0x11d201[_0xc4f0('0x15')]));});});};exports[_0xc4f0('0x1c')]=function(_0x3d1ad1){var _0x59733c=this;return new Promise(function(_0x2815be,_0x2a89df){return db[_0xc4f0('0x1d')][_0xc4f0('0x1e')](_0x3d1ad1['body'],{'raw':_0x3d1ad1['options']?_0x3d1ad1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d1ad1[_0xc4f0('0x1a')]?_0x3d1ad1[_0xc4f0('0x1a')][_0xc4f0('0x1f')]||null:null,'attributes':_0x3d1ad1[_0xc4f0('0x1a')]?_0x3d1ad1['options'][_0xc4f0('0x20')]||null:null,'limit':_0x3d1ad1[_0xc4f0('0x1a')]?_0x3d1ad1['options'][_0xc4f0('0x21')]||null:null})[_0xc4f0('0xc')](function(_0xf7d22a){logger[_0xc4f0('0xd')](_0xc4f0('0x1c'),_0x3d1ad1);logger[_0xc4f0('0x10')]('UpdateChatQueueReport',_0x3d1ad1,JSON[_0xc4f0('0x12')](_0xf7d22a));_0x2815be(_0xf7d22a);})[_0xc4f0('0x17')](function(_0x44098c){logger[_0xc4f0('0x13')](_0xc4f0('0x1c'),_0x44098c[_0xc4f0('0x15')],_0x3d1ad1);_0x2a89df(_0x59733c[_0xc4f0('0x13')](0x1f4,_0x44098c[_0xc4f0('0x15')]));});});}; \ No newline at end of file +var _0xe2b4=['jayson/promise','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x251197,_0xef8d88){var _0x48ecc0=function(_0x5a1fab){while(--_0x5a1fab){_0x251197['push'](_0x251197['shift']());}};_0x48ecc0(++_0xef8d88);}(_0xe2b4,0x1d3));var _0x4e2b=function(_0x305e9b,_0x357f06){_0x305e9b=_0x305e9b-0x0;var _0x39bed2=_0xe2b4[_0x305e9b];return _0x39bed2;};'use strict';var _=require(_0x4e2b('0x0'));var util=require('util');var moment=require(_0x4e2b('0x1'));var BPromise=require(_0x4e2b('0x2'));var rs=require(_0x4e2b('0x3'));var fs=require('fs');var Redis=require(_0x4e2b('0x4'));var db=require(_0x4e2b('0x5'))['db'];var utils=require(_0x4e2b('0x6'));var logger=require(_0x4e2b('0x7'))(_0x4e2b('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e2b('0x9'));var client=jayson[_0x4e2b('0xa')][_0x4e2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf51885,_0xc8590a,_0x2a2516){return new BPromise(function(_0x2913a9,_0x4dd80b){return client['request'](_0xf51885,_0x2a2516)['then'](function(_0x2b2827){logger[_0x4e2b('0xc')](_0x4e2b('0xd'),_0xc8590a,_0x4e2b('0xe'));logger[_0x4e2b('0xf')](_0x4e2b('0x10'),_0xc8590a,_0x4e2b('0xe'),JSON[_0x4e2b('0x11')](_0x2b2827));if(_0x2b2827['error']){if(_0x2b2827[_0x4e2b('0x12')][_0x4e2b('0x13')]===0x1f4){logger['error'](_0x4e2b('0xd'),_0xc8590a,_0x2b2827[_0x4e2b('0x12')]['message']);return _0x4dd80b(_0x2b2827[_0x4e2b('0x12')]['message']);}logger[_0x4e2b('0x12')](_0x4e2b('0xd'),_0xc8590a,_0x2b2827[_0x4e2b('0x12')][_0x4e2b('0x14')]);return _0x2913a9(_0x2b2827[_0x4e2b('0x12')][_0x4e2b('0x14')]);}else{logger[_0x4e2b('0xc')](_0x4e2b('0xd'),_0xc8590a,_0x4e2b('0xe'));_0x2913a9(_0x2b2827[_0x4e2b('0x15')]['message']);}})[_0x4e2b('0x16')](function(_0x4c1cd2){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xc8590a,_0x4c1cd2);_0x4dd80b(_0x4c1cd2);});});}exports[_0x4e2b('0x17')]=function(_0x25285d){var _0x150aa8=this;return new Promise(function(_0x193661,_0x1fd980){return db[_0x4e2b('0x18')][_0x4e2b('0x19')](_0x25285d[_0x4e2b('0x1a')],{'raw':_0x25285d['options']?_0x25285d[_0x4e2b('0x1b')][_0x4e2b('0x1c')]===undefined?!![]:![]:!![]})[_0x4e2b('0x1d')](function(_0x3d9ff3){logger[_0x4e2b('0xc')](_0x4e2b('0x17'),_0x25285d);logger[_0x4e2b('0xf')]('CreateChatQueueReport',_0x25285d,JSON[_0x4e2b('0x11')](_0x3d9ff3));_0x193661(_0x3d9ff3);})[_0x4e2b('0x16')](function(_0x2ea3b5){logger[_0x4e2b('0x12')](_0x4e2b('0x17'),_0x2ea3b5['message'],_0x25285d);_0x1fd980(_0x150aa8['error'](0x1f4,_0x2ea3b5[_0x4e2b('0x14')]));});});};exports[_0x4e2b('0x1e')]=function(_0x1d6cc4){var _0x1e6d68=this;return new Promise(function(_0x2009a9,_0x40028c){return db[_0x4e2b('0x18')][_0x4e2b('0x1f')](_0x1d6cc4['body'],{'raw':_0x1d6cc4[_0x4e2b('0x1b')]?_0x1d6cc4[_0x4e2b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6cc4['options']?_0x1d6cc4[_0x4e2b('0x1b')]['where']||null:null,'attributes':_0x1d6cc4['options']?_0x1d6cc4[_0x4e2b('0x1b')][_0x4e2b('0x20')]||null:null,'limit':_0x1d6cc4[_0x4e2b('0x1b')]?_0x1d6cc4['options'][_0x4e2b('0x21')]||null:null})[_0x4e2b('0x1d')](function(_0x192161){logger['info'](_0x4e2b('0x1e'),_0x1d6cc4);logger['debug']('UpdateChatQueueReport',_0x1d6cc4,JSON['stringify'](_0x192161));_0x2009a9(_0x192161);})[_0x4e2b('0x16')](function(_0x1c0923){logger[_0x4e2b('0x12')](_0x4e2b('0x1e'),_0x1c0923['message'],_0x1d6cc4);_0x40028c(_0x1e6d68[_0x4e2b('0x12')](0x1f4,_0x1c0923['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fcb2476..dfffe4c 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 _0x49c4=['isAuthenticated','show','create','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','/:id'];(function(_0x57a2a6,_0x3d21b2){var _0x74724a=function(_0x5918cc){while(--_0x5918cc){_0x57a2a6['push'](_0x57a2a6['shift']());}};_0x74724a(++_0x3d21b2);}(_0x49c4,0xaf));var _0x449c=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x49c4[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x449c('0x0'));var util=require(_0x449c('0x1'));var path=require(_0x449c('0x2'));var timeout=require(_0x449c('0x3'));var express=require(_0x449c('0x4'));var router=express[_0x449c('0x5')]();var fs_extra=require(_0x449c('0x6'));var auth=require(_0x449c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x449c('0x8'));var controller=require(_0x449c('0x9'));router[_0x449c('0xa')]('/',auth['isAuthenticated'](),controller[_0x449c('0xb')]);router[_0x449c('0xa')](_0x449c('0xc'),auth['isAuthenticated'](),controller[_0x449c('0xd')]);router[_0x449c('0xa')](_0x449c('0xe'),auth[_0x449c('0xf')](),controller[_0x449c('0x10')]);router['post']('/',auth[_0x449c('0xf')](),controller[_0x449c('0x11')]);router['put'](_0x449c('0xe'),auth[_0x449c('0xf')](),controller['update']);router[_0x449c('0x12')](_0x449c('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xefea=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','post','create','put','update','delete','/:id','destroy','exports','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefea,0x165));var _0xaefe=function(_0x1a9a23,_0x1c37f5){_0x1a9a23=_0x1a9a23-0x0;var _0x21288a=_0xefea[_0x1a9a23];return _0x21288a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaefe('0x0'));var timeout=require(_0xaefe('0x1'));var express=require('express');var router=express[_0xaefe('0x2')]();var fs_extra=require(_0xaefe('0x3'));var auth=require(_0xaefe('0x4'));var interaction=require(_0xaefe('0x5'));var config=require(_0xaefe('0x6'));var controller=require(_0xaefe('0x7'));router[_0xaefe('0x8')]('/',auth[_0xaefe('0x9')](),controller[_0xaefe('0xa')]);router[_0xaefe('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xaefe('0xb')]);router[_0xaefe('0x8')]('/:id',auth[_0xaefe('0x9')](),controller['show']);router[_0xaefe('0xc')]('/',auth[_0xaefe('0x9')](),controller[_0xaefe('0xd')]);router[_0xaefe('0xe')]('/:id',auth[_0xaefe('0x9')](),controller[_0xaefe('0xf')]);router[_0xaefe('0x10')](_0xaefe('0x11'),auth[_0xaefe('0x9')](),controller[_0xaefe('0x12')]);module[_0xaefe('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6de6ab2..37670b1 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x6408f,_0x4e07f4){var _0x4601a9=function(_0x595f6c){while(--_0x595f6c){_0x6408f['push'](_0x6408f['shift']());}};_0x4601a9(++_0x4e07f4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xf3cd[_0x511bd1];return _0x4c48ec;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x9bde,0xe1));var _0xe9bd=function(_0x37cd2b,_0x53834f){_0x37cd2b=_0x37cd2b-0x0;var _0x2b3dfd=_0x9bde[_0x37cd2b];return _0x2b3dfd;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c50d49e..0dc1783 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 _0x120a=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','then','status','end','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','ChatTransferReport','rawAttributes','find','create','body','describe','eml-format','rimraf'];(function(_0x3cc1d5,_0x2f5bda){var _0x488fcd=function(_0x30a173){while(--_0x30a173){_0x3cc1d5['push'](_0x3cc1d5['shift']());}};_0x488fcd(++_0x2f5bda);}(_0x120a,0x16b));var _0xa120=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x120a[_0x53f37f];return _0x2fe5f8;};'use strict';var emlformat=require(_0xa120('0x0'));var rimraf=require(_0xa120('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa120('0x2'));var rp=require(_0xa120('0x3'));var moment=require('moment');var BPromise=require(_0xa120('0x4'));var Mustache=require(_0xa120('0x5'));var util=require(_0xa120('0x6'));var path=require('path');var sox=require(_0xa120('0x7'));var csv=require(_0xa120('0x8'));var ejs=require(_0xa120('0x9'));var fs=require('fs');var fs_extra=require(_0xa120('0xa'));var _=require(_0xa120('0xb'));var squel=require('squel');var crypto=require(_0xa120('0xc'));var jsforce=require(_0xa120('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa120('0x8'));var querystring=require(_0xa120('0xe'));var Papa=require('papaparse');var Redis=require(_0xa120('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa120('0x10'));var as=require(_0xa120('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa120('0x12'))(_0xa120('0x13'));var utils=require(_0xa120('0x14'));var config=require(_0xa120('0x15'));var licenseUtil=require(_0xa120('0x16'));var db=require(_0xa120('0x17'))['db'];function respondWithStatusCode(_0x396c20,_0x5cbd8b){_0x5cbd8b=_0x5cbd8b||0xcc;return function(_0x10b832){if(_0x10b832){return _0x396c20[_0xa120('0x18')](_0x5cbd8b);}return _0x396c20['status'](_0x5cbd8b)['end']();};}function respondWithResult(_0xdd35a5,_0x5eef28){_0x5eef28=_0x5eef28||0xc8;return function(_0x44fdaf){if(_0x44fdaf){return _0xdd35a5['status'](_0x5eef28)[_0xa120('0x19')](_0x44fdaf);}};}function respondWithFilteredResult(_0x2d443b,_0x229db5){return function(_0x4d6aee){if(_0x4d6aee){var _0x2c4213=typeof _0x229db5['offset']===_0xa120('0x1a')&&typeof _0x229db5['limit']==='undefined';var _0x42d345=_0x4d6aee[_0xa120('0x1b')];var _0x51c0df=_0x2c4213?0x0:_0x229db5[_0xa120('0x1c')];var _0x20b5ef=_0x2c4213?_0x4d6aee[_0xa120('0x1b')]:_0x229db5[_0xa120('0x1c')]+_0x229db5[_0xa120('0x1d')];var _0x1710a3;if(_0x20b5ef>=_0x42d345){_0x20b5ef=_0x42d345;_0x1710a3=0xc8;}else{_0x1710a3=0xce;}_0x2d443b['status'](_0x1710a3);return _0x2d443b['set'](_0xa120('0x1e'),_0x51c0df+'-'+_0x20b5ef+'/'+_0x42d345)['json'](_0x4d6aee);}return null;};}function patchUpdates(_0x5ea11b){return function(_0x1b9a57){try{jsonpatch[_0xa120('0x1f')](_0x1b9a57,_0x5ea11b,!![]);}catch(_0x48fd0f){return BPromise['reject'](_0x48fd0f);}return _0x1b9a57[_0xa120('0x20')]();};}function saveUpdates(_0x17edac,_0x557914){return function(_0x1fa5ae){if(_0x1fa5ae){return _0x1fa5ae[_0xa120('0x21')](_0x17edac)['then'](function(_0x1e1511){return _0x1e1511;});}return null;};}function removeEntity(_0x3624f8,_0x2e4dff){return function(_0x47b49c){if(_0x47b49c){return _0x47b49c[_0xa120('0x22')]()[_0xa120('0x23')](function(){_0x3624f8[_0xa120('0x24')](0xcc)[_0xa120('0x25')]();});}};}function handleEntityNotFound(_0x5f210f,_0xdd5f0c){return function(_0x1f7aad){if(!_0x1f7aad){_0x5f210f[_0xa120('0x18')](0x194);}return _0x1f7aad;};}function handleError(_0x292aac,_0x31acd1){_0x31acd1=_0x31acd1||0x1f4;return function(_0x18b273){logger['error'](_0x18b273[_0xa120('0x26')]);if(_0x18b273[_0xa120('0x27')]){delete _0x18b273['name'];}_0x292aac[_0xa120('0x24')](_0x31acd1)[_0xa120('0x28')](_0x18b273);};}exports['index']=function(_0x33da46,_0x8ebf08){var _0x3bbba4={},_0x57a3f3={},_0xea5568={'count':0x0,'rows':[]};var _0x4e8243=_[_0xa120('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x6063e6){return{'name':_0x6063e6[_0xa120('0x2a')],'type':_0x6063e6[_0xa120('0x2b')][_0xa120('0x2c')]};});_0x57a3f3[_0xa120('0x2d')]=_[_0xa120('0x29')](_0x4e8243,'name');_0x57a3f3['query']=_[_0xa120('0x2e')](_0x33da46[_0xa120('0x2f')]);_0x57a3f3[_0xa120('0x30')]=_[_0xa120('0x31')](_0x57a3f3[_0xa120('0x2d')],_0x57a3f3[_0xa120('0x2f')]);_0x3bbba4[_0xa120('0x32')]=_[_0xa120('0x31')](_0x57a3f3[_0xa120('0x2d')],qs[_0xa120('0x33')](_0x33da46[_0xa120('0x2f')]['fields']));_0x3bbba4[_0xa120('0x32')]=_0x3bbba4['attributes'][_0xa120('0x34')]?_0x3bbba4['attributes']:_0x57a3f3[_0xa120('0x2d')];if(!_0x33da46['query'][_0xa120('0x35')](_0xa120('0x36'))){_0x3bbba4[_0xa120('0x1d')]=qs[_0xa120('0x1d')](_0x33da46[_0xa120('0x2f')][_0xa120('0x1d')]);_0x3bbba4[_0xa120('0x1c')]=qs[_0xa120('0x1c')](_0x33da46[_0xa120('0x2f')][_0xa120('0x1c')]);}_0x3bbba4['order']=qs[_0xa120('0x37')](_0x33da46[_0xa120('0x2f')][_0xa120('0x37')]);_0x3bbba4[_0xa120('0x38')]=qs[_0xa120('0x30')](_[_0xa120('0x39')](_0x33da46[_0xa120('0x2f')],_0x57a3f3[_0xa120('0x30')]),_0x4e8243);if(_0x33da46[_0xa120('0x2f')][_0xa120('0x3a')]){_0x3bbba4[_0xa120('0x38')]=_[_0xa120('0x3b')](_0x3bbba4[_0xa120('0x38')],{'$or':_[_0xa120('0x29')](_0x4e8243,function(_0x597800){if(_0x597800[_0xa120('0x2b')]!=='VIRTUAL'){var _0x130b04={};_0x130b04[_0x597800['name']]={'$like':'%'+_0x33da46['query'][_0xa120('0x3a')]+'%'};return _0x130b04;}})});}_0x3bbba4=_['merge']({},_0x3bbba4,_0x33da46[_0xa120('0x3c')]);var _0x4bd6e8={'where':_0x3bbba4[_0xa120('0x38')]};return db['ChatTransferReport'][_0xa120('0x1b')](_0x4bd6e8)['then'](function(_0x4ad27b){_0xea5568[_0xa120('0x1b')]=_0x4ad27b;if(_0x33da46[_0xa120('0x2f')][_0xa120('0x3d')]){_0x3bbba4[_0xa120('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa120('0x3f')](_0x3bbba4);})[_0xa120('0x23')](function(_0x16a249){_0xea5568['rows']=_0x16a249;return _0xea5568;})[_0xa120('0x23')](respondWithFilteredResult(_0x8ebf08,_0x3bbba4))[_0xa120('0x40')](handleError(_0x8ebf08,null));};exports[_0xa120('0x41')]=function(_0x3262bc,_0x4d6492){var _0x1d40ce={'raw':!![],'where':{'id':_0x3262bc[_0xa120('0x42')]['id']}},_0x22be03={};_0x22be03[_0xa120('0x2d')]=_['keys'](db[_0xa120('0x43')][_0xa120('0x44')]);_0x22be03[_0xa120('0x2f')]=_[_0xa120('0x2e')](_0x3262bc['query']);_0x22be03[_0xa120('0x30')]=_[_0xa120('0x31')](_0x22be03[_0xa120('0x2d')],_0x22be03[_0xa120('0x2f')]);_0x1d40ce['attributes']=_[_0xa120('0x31')](_0x22be03[_0xa120('0x2d')],qs[_0xa120('0x33')](_0x3262bc['query']['fields']));_0x1d40ce[_0xa120('0x32')]=_0x1d40ce[_0xa120('0x32')][_0xa120('0x34')]?_0x1d40ce[_0xa120('0x32')]:_0x22be03['model'];if(_0x3262bc[_0xa120('0x2f')]['includeAll']){_0x1d40ce[_0xa120('0x3e')]=[{'all':!![]}];}_0x1d40ce=_[_0xa120('0x3b')]({},_0x1d40ce,_0x3262bc[_0xa120('0x3c')]);return db[_0xa120('0x43')][_0xa120('0x45')](_0x1d40ce)[_0xa120('0x23')](handleEntityNotFound(_0x4d6492,null))[_0xa120('0x23')](respondWithResult(_0x4d6492,null))['catch'](handleError(_0x4d6492,null));};exports[_0xa120('0x46')]=function(_0x2ae177,_0x1a84ee){return db[_0xa120('0x43')][_0xa120('0x46')](_0x2ae177['body'],{})['then'](respondWithResult(_0x1a84ee,0xc9))[_0xa120('0x40')](handleError(_0x1a84ee,null));};exports[_0xa120('0x21')]=function(_0x3162e4,_0x1c0663){if(_0x3162e4[_0xa120('0x47')]['id']){delete _0x3162e4[_0xa120('0x47')]['id'];}return db[_0xa120('0x43')][_0xa120('0x45')]({'where':{'id':_0x3162e4['params']['id']}})['then'](handleEntityNotFound(_0x1c0663,null))[_0xa120('0x23')](saveUpdates(_0x3162e4['body'],null))[_0xa120('0x23')](respondWithResult(_0x1c0663,null))[_0xa120('0x40')](handleError(_0x1c0663,null));};exports['destroy']=function(_0x85d176,_0x31686b){return db['ChatTransferReport'][_0xa120('0x45')]({'where':{'id':_0x85d176[_0xa120('0x42')]['id']}})['then'](handleEntityNotFound(_0x31686b,null))[_0xa120('0x23')](removeEntity(_0x31686b,null))[_0xa120('0x40')](handleError(_0x31686b,null));};exports[_0xa120('0x48')]=function(_0xc716c1,_0x2f3ae5){return db[_0xa120('0x43')][_0xa120('0x48')]()['then'](respondWithResult(_0x2f3ae5,null))[_0xa120('0x40')](handleError(_0x2f3ae5,null));}; \ No newline at end of file +var _0x14a3=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','includeAll','include','findAll','rows','show','params','merge','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','status','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3b925f,_0x5e8367){var _0xdeba74=function(_0x33b1af){while(--_0x33b1af){_0x3b925f['push'](_0x3b925f['shift']());}};_0xdeba74(++_0x5e8367);}(_0x14a3,0xb3));var _0x314a=function(_0x18b2a3,_0x2a639b){_0x18b2a3=_0x18b2a3-0x0;var _0x50659f=_0x14a3[_0x18b2a3];return _0x50659f;};'use strict';var emlformat=require(_0x314a('0x0'));var rimraf=require(_0x314a('0x1'));var zipdir=require(_0x314a('0x2'));var jsonpatch=require(_0x314a('0x3'));var rp=require(_0x314a('0x4'));var moment=require(_0x314a('0x5'));var BPromise=require(_0x314a('0x6'));var Mustache=require(_0x314a('0x7'));var util=require(_0x314a('0x8'));var path=require(_0x314a('0x9'));var sox=require(_0x314a('0xa'));var csv=require(_0x314a('0xb'));var ejs=require(_0x314a('0xc'));var fs=require('fs');var fs_extra=require(_0x314a('0xd'));var _=require(_0x314a('0xe'));var squel=require('squel');var crypto=require(_0x314a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x314a('0x10'));var toCsv=require(_0x314a('0xb'));var querystring=require(_0x314a('0x11'));var Papa=require(_0x314a('0x12'));var Redis=require(_0x314a('0x13'));var authService=require(_0x314a('0x14'));var qs=require(_0x314a('0x15'));var as=require(_0x314a('0x16'));var hardwareService=require(_0x314a('0x17'));var logger=require('../../config/logger')(_0x314a('0x18'));var utils=require('../../config/utils');var config=require(_0x314a('0x19'));var licenseUtil=require(_0x314a('0x1a'));var db=require(_0x314a('0x1b'))['db'];function respondWithStatusCode(_0x5e8b87,_0x3931c0){_0x3931c0=_0x3931c0||0xcc;return function(_0x5c8686){if(_0x5c8686){return _0x5e8b87['sendStatus'](_0x3931c0);}return _0x5e8b87['status'](_0x3931c0)[_0x314a('0x1c')]();};}function respondWithResult(_0x4173ce,_0x5ad2aa){_0x5ad2aa=_0x5ad2aa||0xc8;return function(_0x5a8b80){if(_0x5a8b80){return _0x4173ce['status'](_0x5ad2aa)['json'](_0x5a8b80);}};}function respondWithFilteredResult(_0x317713,_0x4c67b6){return function(_0x51920f){if(_0x51920f){var _0x1532f5=typeof _0x4c67b6[_0x314a('0x1d')]===_0x314a('0x1e')&&typeof _0x4c67b6[_0x314a('0x1f')]===_0x314a('0x1e');var _0x542e90=_0x51920f['count'];var _0x1cb97a=_0x1532f5?0x0:_0x4c67b6[_0x314a('0x1d')];var _0x2affd7=_0x1532f5?_0x51920f[_0x314a('0x20')]:_0x4c67b6[_0x314a('0x1d')]+_0x4c67b6[_0x314a('0x1f')];var _0x408d3a;if(_0x2affd7>=_0x542e90){_0x2affd7=_0x542e90;_0x408d3a=0xc8;}else{_0x408d3a=0xce;}_0x317713['status'](_0x408d3a);return _0x317713[_0x314a('0x21')]('Content-Range',_0x1cb97a+'-'+_0x2affd7+'/'+_0x542e90)[_0x314a('0x22')](_0x51920f);}return null;};}function patchUpdates(_0x327278){return function(_0x5e6c3e){try{jsonpatch['apply'](_0x5e6c3e,_0x327278,!![]);}catch(_0x1dfa3c){return BPromise[_0x314a('0x23')](_0x1dfa3c);}return _0x5e6c3e[_0x314a('0x24')]();};}function saveUpdates(_0xb6513e,_0x39bba1){return function(_0x28274b){if(_0x28274b){return _0x28274b[_0x314a('0x25')](_0xb6513e)[_0x314a('0x26')](function(_0x235f79){return _0x235f79;});}return null;};}function removeEntity(_0x53a70c,_0x45f349){return function(_0x2ca29f){if(_0x2ca29f){return _0x2ca29f[_0x314a('0x27')]()[_0x314a('0x26')](function(){_0x53a70c[_0x314a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fcf5,_0x325040){return function(_0x55e1bc){if(!_0x55e1bc){_0x10fcf5['sendStatus'](0x194);}return _0x55e1bc;};}function handleError(_0x4a5d8c,_0x28149e){_0x28149e=_0x28149e||0x1f4;return function(_0x504c8d){logger[_0x314a('0x29')](_0x504c8d['stack']);if(_0x504c8d['name']){delete _0x504c8d['name'];}_0x4a5d8c[_0x314a('0x28')](_0x28149e)[_0x314a('0x2a')](_0x504c8d);};}exports[_0x314a('0x2b')]=function(_0x183df6,_0x36ccb3){var _0x4b19bf={},_0x49fc8a={},_0x194f18={'count':0x0,'rows':[]};var _0x42f8cf=_[_0x314a('0x2c')](db[_0x314a('0x2d')][_0x314a('0x2e')],function(_0x1a7a3f){return{'name':_0x1a7a3f[_0x314a('0x2f')],'type':_0x1a7a3f[_0x314a('0x30')][_0x314a('0x31')]};});_0x49fc8a[_0x314a('0x32')]=_[_0x314a('0x2c')](_0x42f8cf,'name');_0x49fc8a[_0x314a('0x33')]=_[_0x314a('0x34')](_0x183df6['query']);_0x49fc8a[_0x314a('0x35')]=_[_0x314a('0x36')](_0x49fc8a[_0x314a('0x32')],_0x49fc8a['query']);_0x4b19bf[_0x314a('0x37')]=_[_0x314a('0x36')](_0x49fc8a[_0x314a('0x32')],qs['fields'](_0x183df6[_0x314a('0x33')][_0x314a('0x38')]));_0x4b19bf[_0x314a('0x37')]=_0x4b19bf['attributes'][_0x314a('0x39')]?_0x4b19bf[_0x314a('0x37')]:_0x49fc8a[_0x314a('0x32')];if(!_0x183df6[_0x314a('0x33')][_0x314a('0x3a')](_0x314a('0x3b'))){_0x4b19bf[_0x314a('0x1f')]=qs[_0x314a('0x1f')](_0x183df6[_0x314a('0x33')][_0x314a('0x1f')]);_0x4b19bf[_0x314a('0x1d')]=qs[_0x314a('0x1d')](_0x183df6[_0x314a('0x33')][_0x314a('0x1d')]);}_0x4b19bf[_0x314a('0x3c')]=qs[_0x314a('0x3d')](_0x183df6[_0x314a('0x33')]['sort']);_0x4b19bf[_0x314a('0x3e')]=qs['filters'](_[_0x314a('0x3f')](_0x183df6[_0x314a('0x33')],_0x49fc8a['filters']),_0x42f8cf);if(_0x183df6[_0x314a('0x33')]['filter']){_0x4b19bf[_0x314a('0x3e')]=_['merge'](_0x4b19bf[_0x314a('0x3e')],{'$or':_[_0x314a('0x2c')](_0x42f8cf,function(_0xac739c){if(_0xac739c[_0x314a('0x30')]!==_0x314a('0x40')){var _0x7bd91f={};_0x7bd91f[_0xac739c['name']]={'$like':'%'+_0x183df6[_0x314a('0x33')]['filter']+'%'};return _0x7bd91f;}})});}_0x4b19bf=_['merge']({},_0x4b19bf,_0x183df6['options']);var _0x222843={'where':_0x4b19bf[_0x314a('0x3e')]};return db[_0x314a('0x2d')][_0x314a('0x20')](_0x222843)[_0x314a('0x26')](function(_0x22c67b){_0x194f18[_0x314a('0x20')]=_0x22c67b;if(_0x183df6[_0x314a('0x33')][_0x314a('0x41')]){_0x4b19bf[_0x314a('0x42')]=[{'all':!![]}];}return db[_0x314a('0x2d')][_0x314a('0x43')](_0x4b19bf);})[_0x314a('0x26')](function(_0x14ed0c){_0x194f18[_0x314a('0x44')]=_0x14ed0c;return _0x194f18;})[_0x314a('0x26')](respondWithFilteredResult(_0x36ccb3,_0x4b19bf))['catch'](handleError(_0x36ccb3,null));};exports[_0x314a('0x45')]=function(_0x4b12ea,_0x1cc710){var _0x28e85a={'raw':!![],'where':{'id':_0x4b12ea[_0x314a('0x46')]['id']}},_0x463ebc={};_0x463ebc[_0x314a('0x32')]=_[_0x314a('0x34')](db[_0x314a('0x2d')][_0x314a('0x2e')]);_0x463ebc['query']=_['keys'](_0x4b12ea[_0x314a('0x33')]);_0x463ebc[_0x314a('0x35')]=_[_0x314a('0x36')](_0x463ebc[_0x314a('0x32')],_0x463ebc['query']);_0x28e85a[_0x314a('0x37')]=_[_0x314a('0x36')](_0x463ebc[_0x314a('0x32')],qs[_0x314a('0x38')](_0x4b12ea[_0x314a('0x33')][_0x314a('0x38')]));_0x28e85a[_0x314a('0x37')]=_0x28e85a['attributes'][_0x314a('0x39')]?_0x28e85a['attributes']:_0x463ebc[_0x314a('0x32')];if(_0x4b12ea['query'][_0x314a('0x41')]){_0x28e85a[_0x314a('0x42')]=[{'all':!![]}];}_0x28e85a=_[_0x314a('0x47')]({},_0x28e85a,_0x4b12ea[_0x314a('0x48')]);return db[_0x314a('0x2d')]['find'](_0x28e85a)[_0x314a('0x26')](handleEntityNotFound(_0x1cc710,null))[_0x314a('0x26')](respondWithResult(_0x1cc710,null))[_0x314a('0x49')](handleError(_0x1cc710,null));};exports[_0x314a('0x4a')]=function(_0x3e5c4d,_0x5d9f67){return db[_0x314a('0x2d')][_0x314a('0x4a')](_0x3e5c4d[_0x314a('0x4b')],{})[_0x314a('0x26')](respondWithResult(_0x5d9f67,0xc9))[_0x314a('0x49')](handleError(_0x5d9f67,null));};exports[_0x314a('0x25')]=function(_0x2e6b7f,_0x475786){if(_0x2e6b7f[_0x314a('0x4b')]['id']){delete _0x2e6b7f[_0x314a('0x4b')]['id'];}return db[_0x314a('0x2d')]['find']({'where':{'id':_0x2e6b7f['params']['id']}})[_0x314a('0x26')](handleEntityNotFound(_0x475786,null))[_0x314a('0x26')](saveUpdates(_0x2e6b7f[_0x314a('0x4b')],null))[_0x314a('0x26')](respondWithResult(_0x475786,null))[_0x314a('0x49')](handleError(_0x475786,null));};exports[_0x314a('0x27')]=function(_0x364b91,_0x1f80ac){return db[_0x314a('0x2d')][_0x314a('0x4c')]({'where':{'id':_0x364b91[_0x314a('0x46')]['id']}})[_0x314a('0x26')](handleEntityNotFound(_0x1f80ac,null))[_0x314a('0x26')](removeEntity(_0x1f80ac,null))[_0x314a('0x49')](handleError(_0x1f80ac,null));};exports[_0x314a('0x4d')]=function(_0x5c9128,_0x1478ba){return db[_0x314a('0x2d')][_0x314a('0x4d')]()['then'](respondWithResult(_0x1478ba,null))['catch'](handleError(_0x1478ba,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 23cd180..1e74364 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 _0x4113=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x171997,_0x3b890f){var _0x228060=function(_0x5ce335){while(--_0x5ce335){_0x171997['push'](_0x171997['shift']());}};_0x228060(++_0x3b890f);}(_0x4113,0x1c5));var _0x3411=function(_0x8ad570,_0x486faf){_0x8ad570=_0x8ad570-0x0;var _0x454fbb=_0x4113[_0x8ad570];return _0x454fbb;};'use strict';var _=require(_0x3411('0x0'));var util=require(_0x3411('0x1'));var logger=require('../../config/logger')(_0x3411('0x2'));var moment=require('moment');var BPromise=require(_0x3411('0x3'));var rp=require(_0x3411('0x4'));var fs=require('fs');var path=require(_0x3411('0x5'));var rimraf=require(_0x3411('0x6'));var config=require(_0x3411('0x7'));var attributes=require(_0x3411('0x8'));module[_0x3411('0x9')]=function(_0x4575d2,_0x2b0370){return _0x4575d2[_0x3411('0xa')](_0x3411('0xb'),attributes,{'tableName':_0x3411('0xc'),'paranoid':![],'indexes':[{'name':_0x3411('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x982f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid'];(function(_0x12b735,_0x2342bb){var _0x1d6238=function(_0x1911f6){while(--_0x1911f6){_0x12b735['push'](_0x12b735['shift']());}};_0x1d6238(++_0x2342bb);}(_0x982f,0x68));var _0xf982=function(_0x3fae48,_0x118251){_0x3fae48=_0x3fae48-0x0;var _0x2b597f=_0x982f[_0x3fae48];return _0x2b597f;};'use strict';var _=require(_0xf982('0x0'));var util=require(_0xf982('0x1'));var logger=require(_0xf982('0x2'))(_0xf982('0x3'));var moment=require(_0xf982('0x4'));var BPromise=require(_0xf982('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf982('0x6'));var rimraf=require(_0xf982('0x7'));var config=require(_0xf982('0x8'));var attributes=require(_0xf982('0x9'));module[_0xf982('0xa')]=function(_0x556fff,_0x31eaab){return _0x556fff['define']('ChatTransferReport',attributes,{'tableName':_0xf982('0xb'),'paranoid':![],'indexes':[{'name':_0xf982('0xc'),'fields':[_0xf982('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 911bc95..f2404b8 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 _0xcf88=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x59c142,_0x236d2e){var _0x2a28a6=function(_0x5d366f){while(--_0x5d366f){_0x59c142['push'](_0x59c142['shift']());}};_0x2a28a6(++_0x236d2e);}(_0xcf88,0x136));var _0x8cf8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xcf88[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x8cf8('0x0'));var util=require(_0x8cf8('0x1'));var moment=require(_0x8cf8('0x2'));var BPromise=require(_0x8cf8('0x3'));var rs=require(_0x8cf8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf8('0x5'))['db'];var utils=require(_0x8cf8('0x6'));var logger=require(_0x8cf8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8cf8('0x8'));var client=jayson[_0x8cf8('0x9')][_0x8cf8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9f0f,_0xc9e60f,_0x411713){return new BPromise(function(_0x4f5f7e,_0x1243f8){return client[_0x8cf8('0xb')](_0x3f9f0f,_0x411713)['then'](function(_0x185b97){logger[_0x8cf8('0xc')](_0x8cf8('0xd'),_0xc9e60f,_0x8cf8('0xe'));logger[_0x8cf8('0xf')](_0x8cf8('0x10'),_0xc9e60f,'request\x20sent',JSON[_0x8cf8('0x11')](_0x185b97));if(_0x185b97[_0x8cf8('0x12')]){if(_0x185b97['error'][_0x8cf8('0x13')]===0x1f4){logger[_0x8cf8('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0xc9e60f,_0x185b97[_0x8cf8('0x12')][_0x8cf8('0x14')]);return _0x1243f8(_0x185b97[_0x8cf8('0x12')][_0x8cf8('0x14')]);}logger[_0x8cf8('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0xc9e60f,_0x185b97[_0x8cf8('0x12')][_0x8cf8('0x14')]);return _0x4f5f7e(_0x185b97[_0x8cf8('0x12')][_0x8cf8('0x14')]);}else{logger[_0x8cf8('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0xc9e60f,'request\x20sent');_0x4f5f7e(_0x185b97[_0x8cf8('0x15')][_0x8cf8('0x14')]);}})[_0x8cf8('0x16')](function(_0x268a21){logger[_0x8cf8('0x12')](_0x8cf8('0xd'),_0xc9e60f,_0x268a21);_0x1243f8(_0x268a21);});});} \ No newline at end of file +var _0xc2cd=['client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x196eb7,_0x1f5366){var _0x3f8cae=function(_0x16037e){while(--_0x16037e){_0x196eb7['push'](_0x196eb7['shift']());}};_0x3f8cae(++_0x1f5366);}(_0xc2cd,0x18e));var _0xdc2c=function(_0x464bd1,_0x4863e0){_0x464bd1=_0x464bd1-0x0;var _0x3399c7=_0xc2cd[_0x464bd1];return _0x3399c7;};'use strict';var _=require(_0xdc2c('0x0'));var util=require(_0xdc2c('0x1'));var moment=require('moment');var BPromise=require(_0xdc2c('0x2'));var rs=require(_0xdc2c('0x3'));var fs=require('fs');var Redis=require(_0xdc2c('0x4'));var db=require(_0xdc2c('0x5'))['db'];var utils=require(_0xdc2c('0x6'));var logger=require(_0xdc2c('0x7'))(_0xdc2c('0x8'));var config=require(_0xdc2c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdc2c('0xa')][_0xdc2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd00578,_0x5ac514,_0x5a9324){return new BPromise(function(_0x4a0567,_0x131aef){return client[_0xdc2c('0xc')](_0xd00578,_0x5a9324)[_0xdc2c('0xd')](function(_0x10e48e){logger[_0xdc2c('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5ac514,_0xdc2c('0xf'));logger[_0xdc2c('0x10')](_0xdc2c('0x11'),_0x5ac514,_0xdc2c('0xf'),JSON[_0xdc2c('0x12')](_0x10e48e));if(_0x10e48e['error']){if(_0x10e48e[_0xdc2c('0x13')][_0xdc2c('0x14')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5ac514,_0x10e48e['error'][_0xdc2c('0x15')]);return _0x131aef(_0x10e48e[_0xdc2c('0x13')][_0xdc2c('0x15')]);}logger[_0xdc2c('0x13')](_0xdc2c('0x16'),_0x5ac514,_0x10e48e[_0xdc2c('0x13')][_0xdc2c('0x15')]);return _0x4a0567(_0x10e48e[_0xdc2c('0x13')][_0xdc2c('0x15')]);}else{logger[_0xdc2c('0xe')](_0xdc2c('0x16'),_0x5ac514,'request\x20sent');_0x4a0567(_0x10e48e['result'][_0xdc2c('0x15')]);}})[_0xdc2c('0x17')](function(_0x144748){logger['error'](_0xdc2c('0x16'),_0x5ac514,_0x144748);_0x131aef(_0x144748);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d345ec8..1fcd502 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 _0xadec=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x217d51,_0x34ad3f){var _0x26dbcd=function(_0x4ecc26){while(--_0x4ecc26){_0x217d51['push'](_0x217d51['shift']());}};_0x26dbcd(++_0x34ad3f);}(_0xadec,0xd5));var _0xcade=function(_0x11f248,_0x2c19d7){_0x11f248=_0x11f248-0x0;var _0x4cd82e=_0xadec[_0x11f248];return _0x4cd82e;};'use strict';var multer=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var path=require(_0xcade('0x2'));var timeout=require(_0xcade('0x3'));var express=require(_0xcade('0x4'));var router=express[_0xcade('0x5')]();var fs_extra=require(_0xcade('0x6'));var auth=require(_0xcade('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcade('0x8'));var controller=require(_0xcade('0x9'));router[_0xcade('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcade('0xb'),auth[_0xcade('0xc')](),controller['describe']);router[_0xcade('0xa')]('/:id',auth[_0xcade('0xc')](),controller[_0xcade('0xd')]);router[_0xcade('0xe')]('/',auth[_0xcade('0xc')](),controller[_0xcade('0xf')]);router[_0xcade('0x10')]('/:id',auth[_0xcade('0xc')](),controller[_0xcade('0x11')]);router['delete']('/:id',auth[_0xcade('0xc')](),controller[_0xcade('0x12')]);module[_0xcade('0x13')]=router; \ No newline at end of file +var _0x44f1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x27e187,_0x54038f){var _0x4de615=function(_0x1729ee){while(--_0x1729ee){_0x27e187['push'](_0x27e187['shift']());}};_0x4de615(++_0x54038f);}(_0x44f1,0x7c));var _0x144f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x44f1[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x144f('0x0'));var util=require(_0x144f('0x1'));var path=require(_0x144f('0x2'));var timeout=require(_0x144f('0x3'));var express=require(_0x144f('0x4'));var router=express[_0x144f('0x5')]();var fs_extra=require(_0x144f('0x6'));var auth=require(_0x144f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x144f('0x8'));var controller=require(_0x144f('0x9'));router[_0x144f('0xa')]('/',auth[_0x144f('0xb')](),controller['index']);router[_0x144f('0xa')](_0x144f('0xc'),auth[_0x144f('0xb')](),controller[_0x144f('0xd')]);router['get'](_0x144f('0xe'),auth['isAuthenticated'](),controller[_0x144f('0xf')]);router[_0x144f('0x10')]('/',auth[_0x144f('0xb')](),controller[_0x144f('0x11')]);router['put'](_0x144f('0xe'),auth[_0x144f('0xb')](),controller[_0x144f('0x12')]);router[_0x144f('0x13')]('/:id',auth[_0x144f('0xb')](),controller['destroy']);module[_0x144f('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 51a782a..d6ec5b2 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 _0xa60c=['sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x55b633,_0x321e5a){var _0x24c8a2=function(_0xab5c90){while(--_0xab5c90){_0x55b633['push'](_0x55b633['shift']());}};_0x24c8a2(++_0x321e5a);}(_0xa60c,0xa2));var _0xca60=function(_0x5df229,_0x2b7647){_0x5df229=_0x5df229-0x0;var _0x316cdd=_0xa60c[_0x5df229];return _0x316cdd;};'use strict';var Sequelize=require(_0xca60('0x0'));var rs=require(_0xca60('0x1'));module[_0xca60('0x2')]={'name':{'type':Sequelize[_0xca60('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xca60('0x3')],'allowNull':![],'unique':_0xca60('0x4')},'description':{'type':Sequelize[_0xca60('0x3')]},'mapKey':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x5')},'mapKeyOffline':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x5')},'key':{'type':Sequelize[_0xca60('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xca60('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xca60('0x3')],'allowNull':![],'defaultValue':_0xca60('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca60('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca60('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xca60('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xca60('0x3')]},'animation':{'type':Sequelize[_0xca60('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xca60('0xa')](_0xca60('0xb'),_0xca60('0xc')),'defaultValue':_0xca60('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xca60('0xd')},'start_chat_button':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0xe')},'offline_chat_button':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0xf')},'header_offline':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x10')},'download_transcript':{'type':Sequelize[_0xca60('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xca60('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x14')},'noteTitle':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x15')},'placeholderMessage':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0xf')},'skipMessageButton':{'type':Sequelize[_0xca60('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x17')},'ratingType':{'type':Sequelize[_0xca60('0xa')](_0xca60('0x18'),_0xca60('0x19')),'defaultValue':_0xca60('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xca60('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xca60('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xca60('0x1b'),'variable':null,'config':{'placeholder':_0xca60('0x1c'),'type':_0xca60('0x1d'),'required':!![]},'props':{'title':_0xca60('0x1c'),'helpText':''}},{'type':_0xca60('0x1b'),'props':{'title':_0xca60('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xca60('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xca60('0x1e')](_0xca60('0x1f'))?JSON[_0xca60('0x20')](this['getDataValue'](_0xca60('0x1f'))):{};},'set':function(_0x55e272){return this[_0xca60('0x21')](_0xca60('0x1f'),JSON['stringify'](_0x55e272));}},'offlineForm':{'type':Sequelize[_0xca60('0x1a')],'defaultValue':function(){return JSON[_0xca60('0x22')]({'items':[{'type':_0xca60('0x1b'),'props':{'title':_0xca60('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xca60('0x5'),'type':_0xca60('0x5')},'variable':null},{'type':_0xca60('0x23'),'config':{'placeholder':_0xca60('0x24')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xca60('0x1e')](_0xca60('0x25'))?JSON[_0xca60('0x20')](this[_0xca60('0x1e')](_0xca60('0x25'))):{};},'set':function(_0x1fddc5){return this['setDataValue'](_0xca60('0x25'),JSON['stringify'](_0x1fddc5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xca60('0x26')]();}},'autoclose':{'type':Sequelize[_0xca60('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xca60('0x3')]},'waitingTitle':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x27')},'waitingMessage':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xca60('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xca60('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xca60('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x2a')},'sendUnmanaged':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xca60('0x1a')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xca60('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xca60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x2c')},'verticalAlignment':{'type':Sequelize[_0xca60('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x2d')},'defaultTitle':{'type':Sequelize[_0xca60('0x3')]},'customerAvatar':{'type':Sequelize[_0xca60('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xca60('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca60('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xca60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xca60('0x3')],'defaultValue':_0xca60('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca60('0x8')],'comment':_0xca60('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xca60('0x31'),'set':function(_0xf05693){if(!_0xf05693)this[_0xca60('0x21')](_0xca60('0x32'),null);this['setDataValue'](_0xca60('0x33'),_0xf05693);}},'vidaooEscalation':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xca60('0x3')]},'vidaooTopic':{'type':Sequelize[_0xca60('0x3')],'allowNull':![],'defaultValue':_0xca60('0x34')},'vidaooNote':{'type':Sequelize[_0xca60('0x3')],'defaultValue':function(){return _0xca60('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xca60('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xca60('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xca60('0x1a')]}}; \ No newline at end of file +var _0xca92=['rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','name','text','onlineForm','parse','getDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM'];(function(_0x4e8a44,_0xd0d7dd){var _0x5ce552=function(_0x5576f3){while(--_0x5576f3){_0x4e8a44['push'](_0x4e8a44['shift']());}};_0x5ce552(++_0xd0d7dd);}(_0xca92,0x132));var _0x2ca9=function(_0x5d60d1,_0x325ad0){_0x5d60d1=_0x5d60d1-0x0;var _0x5e94a7=_0xca92[_0x5d60d1];return _0x5e94a7;};'use strict';var Sequelize=require(_0x2ca9('0x0'));var rs=require('randomstring');module[_0x2ca9('0x1')]={'name':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![],'unique':_0x2ca9('0x3')},'description':{'type':Sequelize[_0x2ca9('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x2ca9('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2ca9('0x4')},'key':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![],'defaultValue':_0x2ca9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![],'defaultValue':_0x2ca9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![],'defaultValue':_0x2ca9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2ca9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2ca9('0x8')](_0x2ca9('0x9'),_0x2ca9('0xa')),'defaultValue':_0x2ca9('0x9')},'header_online':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0xb')},'start_chat_button':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0xc')},'header_offline':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2ca9('0x10')]},'closingQuestion':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x13')},'closingMessage':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x14')},'closingMessageButton':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2ca9('0x15')},'conditionAgreement':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x16')},'ratingType':{'type':Sequelize[_0x2ca9('0x8')]('star',_0x2ca9('0x17')),'defaultValue':_0x2ca9('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x2ca9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2ca9('0x10')],'defaultValue':function(){return JSON[_0x2ca9('0x19')]({'items':[{'type':_0x2ca9('0x1a'),'variable':null,'config':{'placeholder':_0x2ca9('0x1b'),'type':_0x2ca9('0x1c'),'required':!![]},'props':{'title':_0x2ca9('0x1b'),'helpText':''}},{'type':_0x2ca9('0x1a'),'props':{'title':_0x2ca9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ca9('0x4'),'type':_0x2ca9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2ca9('0x1d'))?JSON[_0x2ca9('0x1e')](this[_0x2ca9('0x1f')]('onlineForm')):{};},'set':function(_0x4ec965){return this['setDataValue']('onlineForm',JSON[_0x2ca9('0x19')](_0x4ec965));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2ca9('0x1a'),'props':{'title':_0x2ca9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2ca9('0x4'),'type':_0x2ca9('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x2ca9('0x20')},'props':{'title':_0x2ca9('0x20'),'helpText':_0x2ca9('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x2ca9('0x1f')](_0x2ca9('0x22'))?JSON[_0x2ca9('0x1e')](this[_0x2ca9('0x1f')]('offlineForm')):{};},'set':function(_0x2ef935){return this['setDataValue'](_0x2ca9('0x22'),JSON[_0x2ca9('0x19')](_0x2ef935));}},'token':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':function(){return rs[_0x2ca9('0x23')]();}},'autoclose':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2ca9('0x2')]},'forwardOffline':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2ca9('0x2')]},'waitingTitle':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x25')},'offlineMessageBody':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x27')},'skipUnmanaged':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':_0x2ca9('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x2ca9('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2ca9('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2ca9('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x2ca9('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2ca9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2ca9('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ca9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ca9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x2ca9('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ca9('0x7')],'comment':_0x2ca9('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1efedc){if(!_0x1efedc)this[_0x2ca9('0x2a')]('mandatoryDispositionPauseId',null);this[_0x2ca9('0x2a')](_0x2ca9('0x2b'),_0x1efedc);}},'vidaooEscalation':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2ca9('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2ca9('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x2ca9('0x2')],'defaultValue':function(){return _0x2ca9('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x2ca9('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2ca9('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b127302..8d50d70 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 _0xfca8=['from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','ListId','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','get','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','CmContact','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','utf8','toPairs','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','offset','undefined','count','limit','save','update','destroy','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','pick','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','notify','user-agent-parser','setUA','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId'];(function(_0x27a0a9,_0x1e7dd1){var _0x11cb3b=function(_0x5a9aa3){while(--_0x5a9aa3){_0x27a0a9['push'](_0x27a0a9['shift']());}};_0x11cb3b(++_0x1e7dd1);}(_0xfca8,0x9f));var _0x8fca=function(_0x50ed26,_0x35e931){_0x50ed26=_0x50ed26-0x0;var _0x11d383=_0xfca8[_0x50ed26];return _0x11d383;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fca('0x0'));var zipdir=require(_0x8fca('0x1'));var jsonpatch=require(_0x8fca('0x2'));var rp=require(_0x8fca('0x3'));var moment=require(_0x8fca('0x4'));var BPromise=require(_0x8fca('0x5'));var Mustache=require(_0x8fca('0x6'));var util=require(_0x8fca('0x7'));var path=require(_0x8fca('0x8'));var sox=require(_0x8fca('0x9'));var csv=require(_0x8fca('0xa'));var ejs=require(_0x8fca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fca('0xc'));var squel=require(_0x8fca('0xd'));var crypto=require(_0x8fca('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8fca('0xa'));var querystring=require(_0x8fca('0xf'));var Papa=require(_0x8fca('0x10'));var Redis=require(_0x8fca('0x11'));var authService=require(_0x8fca('0x12'));var qs=require(_0x8fca('0x13'));var as=require(_0x8fca('0x14'));var hardwareService=require(_0x8fca('0x15'));var logger=require(_0x8fca('0x16'))(_0x8fca('0x17'));var utils=require('../../config/utils');var config=require(_0x8fca('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fca('0x19'))['db'];config[_0x8fca('0x1a')]=_['defaults'](config['redis'],{'host':_0x8fca('0x1b'),'port':0x18eb});var socket=require(_0x8fca('0x1c'))(new Redis(config[_0x8fca('0x1a')]));require('./chatWebsite.socket')[_0x8fca('0x1d')](socket);var jayson=require(_0x8fca('0x1e'));var client=jayson[_0x8fca('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x8fca('0x1f')][_0x8fca('0x20')]({'port':0x232a});var client9003=jayson[_0x8fca('0x1f')][_0x8fca('0x20')]({'port':0x232b});var client9001=jayson[_0x8fca('0x1f')][_0x8fca('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5f13f8,_0x32073f,_0x8db5f7,_0x2d82dd){return new BPromise(function(_0x489db9,_0x30c8fc){var _0x4070ff=_0x2d82dd||client;return _0x4070ff[_0x8fca('0x21')](_0x5f13f8,_0x8db5f7)[_0x8fca('0x22')](function(_0x4f3a5e){logger['info'](_0x8fca('0x23'),_0x32073f,_0x8fca('0x24'));logger[_0x8fca('0x25')](_0x8fca('0x26'),_0x32073f,_0x8fca('0x24'),JSON['stringify'](_0x4f3a5e));if(_0x4f3a5e[_0x8fca('0x27')]){if(_0x4f3a5e[_0x8fca('0x27')][_0x8fca('0x28')]===0x1f4){logger[_0x8fca('0x27')](_0x8fca('0x23'),_0x32073f,_0x4f3a5e[_0x8fca('0x27')][_0x8fca('0x29')]);return _0x30c8fc(_0x4f3a5e[_0x8fca('0x27')][_0x8fca('0x29')]);}logger[_0x8fca('0x27')](_0x8fca('0x23'),_0x32073f,_0x4f3a5e[_0x8fca('0x27')][_0x8fca('0x29')]);return _0x489db9(_0x4f3a5e[_0x8fca('0x27')][_0x8fca('0x29')]);}else{logger[_0x8fca('0x2a')](_0x8fca('0x23'),_0x32073f,_0x8fca('0x24'));_0x489db9(_0x4f3a5e[_0x8fca('0x2b')][_0x8fca('0x29')]);}})['catch'](function(_0x3d6f9c){logger[_0x8fca('0x27')](_0x8fca('0x23'),_0x32073f,_0x3d6f9c);_0x30c8fc(_0x3d6f9c);});});}function respondWithStatusCode(_0x54abe8,_0x25c5f1){_0x25c5f1=_0x25c5f1||0xcc;return function(_0x1fc4b5){if(_0x1fc4b5){return _0x54abe8[_0x8fca('0x2c')](_0x25c5f1);}return _0x54abe8[_0x8fca('0x2d')](_0x25c5f1)[_0x8fca('0x2e')]();};}function respondWithResult(_0x1cdc23,_0x41953d){_0x41953d=_0x41953d||0xc8;return function(_0x2c912c){if(_0x2c912c){return _0x1cdc23[_0x8fca('0x2d')](_0x41953d)['json'](_0x2c912c);}};}function respondWithFilteredResult(_0x5bee76,_0x2de026){return function(_0x3f4241){if(_0x3f4241){var _0x4cdae5=typeof _0x2de026[_0x8fca('0x2f')]===_0x8fca('0x30')&&typeof _0x2de026['limit']==='undefined';var _0x3703bc=_0x3f4241[_0x8fca('0x31')];var _0x4b4c0f=_0x4cdae5?0x0:_0x2de026['offset'];var _0x5f1fcf=_0x4cdae5?_0x3f4241[_0x8fca('0x31')]:_0x2de026[_0x8fca('0x2f')]+_0x2de026[_0x8fca('0x32')];var _0x583d28;if(_0x5f1fcf>=_0x3703bc){_0x5f1fcf=_0x3703bc;_0x583d28=0xc8;}else{_0x583d28=0xce;}_0x5bee76['status'](_0x583d28);return _0x5bee76['set']('Content-Range',_0x4b4c0f+'-'+_0x5f1fcf+'/'+_0x3703bc)['json'](_0x3f4241);}return null;};}function patchUpdates(_0x25498f){return function(_0x4569fb){try{jsonpatch['apply'](_0x4569fb,_0x25498f,!![]);}catch(_0x55c565){return BPromise['reject'](_0x55c565);}return _0x4569fb[_0x8fca('0x33')]();};}function saveUpdates(_0x1948a7,_0x4140c4){return function(_0x44fff1){if(_0x44fff1){return _0x44fff1[_0x8fca('0x34')](_0x1948a7)[_0x8fca('0x22')](function(_0x507b0a){return _0x507b0a;});}return null;};}function removeEntity(_0x37c80b,_0x2c0985){return function(_0x705769){if(_0x705769){return _0x705769[_0x8fca('0x35')]()['then'](function(){var _0x14caba=_0x705769['get']({'plain':!![]});var _0x1a89e8=_0x8fca('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a89e8,'resourceId':_0x14caba['id']}})[_0x8fca('0x22')](function(){return _0x705769;});})['then'](function(){_0x37c80b[_0x8fca('0x2d')](0xcc)[_0x8fca('0x2e')]();});}};}function handleEntityNotFound(_0x34851b,_0x4fe063){return function(_0x35c1ed){if(!_0x35c1ed){_0x34851b[_0x8fca('0x2c')](0x194);}return _0x35c1ed;};}function handleError(_0x524615,_0x322c2f){_0x322c2f=_0x322c2f||0x1f4;return function(_0x3364be){logger[_0x8fca('0x27')](_0x3364be[_0x8fca('0x37')]);if(_0x3364be[_0x8fca('0x38')]){delete _0x3364be[_0x8fca('0x38')];}_0x524615[_0x8fca('0x2d')](_0x322c2f)[_0x8fca('0x39')](_0x3364be);};}exports[_0x8fca('0x3a')]=function(_0x3d50b1,_0x32c84f){var _0x4a2a60={'include':[{'model':db['Pause'],'as':_0x8fca('0x3b')}]},_0x54f4ff={},_0x33b894={'count':0x0,'rows':[]};var _0x3169e6=_[_0x8fca('0x3c')](db[_0x8fca('0x3d')][_0x8fca('0x3e')],function(_0x2fba36){return{'name':_0x2fba36['fieldName'],'type':_0x2fba36[_0x8fca('0x3f')][_0x8fca('0x40')]};});_0x54f4ff[_0x8fca('0x41')]=_[_0x8fca('0x3c')](_0x3169e6,_0x8fca('0x38'));_0x54f4ff[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x3d50b1[_0x8fca('0x42')]);_0x54f4ff[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x54f4ff[_0x8fca('0x41')],_0x54f4ff[_0x8fca('0x42')]);_0x4a2a60[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x54f4ff[_0x8fca('0x41')],qs['fields'](_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x47')]));_0x4a2a60[_0x8fca('0x46')]=_0x4a2a60['attributes'][_0x8fca('0x48')]?_0x4a2a60[_0x8fca('0x46')]:_0x54f4ff[_0x8fca('0x41')];if(!_0x3d50b1[_0x8fca('0x42')]['hasOwnProperty'](_0x8fca('0x49'))){_0x4a2a60[_0x8fca('0x32')]=qs[_0x8fca('0x32')](_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x32')]);_0x4a2a60[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x2f')]);}_0x4a2a60[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x4b')]);_0x4a2a60['where']=qs[_0x8fca('0x44')](_['pick'](_0x3d50b1[_0x8fca('0x42')],_0x54f4ff[_0x8fca('0x44')]),_0x3169e6);if(_0x3d50b1[_0x8fca('0x42')]['filter']){_0x4a2a60[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0x4a2a60[_0x8fca('0x4c')],{'$or':_['map'](_0x3169e6,function(_0x139c3e){if(_0x139c3e[_0x8fca('0x3f')]!==_0x8fca('0x4e')){var _0x1c70fc={};_0x1c70fc[_0x139c3e[_0x8fca('0x38')]]={'$like':'%'+_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x4f')]+'%'};return _0x1c70fc;}})});}_0x4a2a60=_[_0x8fca('0x4d')]({},_0x4a2a60,_0x3d50b1[_0x8fca('0x50')]);var _0x43f225={'where':_0x4a2a60[_0x8fca('0x4c')]};return db[_0x8fca('0x3d')][_0x8fca('0x31')](_0x43f225)['then'](function(_0x122f0c){_0x33b894['count']=_0x122f0c;if(_0x3d50b1[_0x8fca('0x42')][_0x8fca('0x51')]){_0x4a2a60['include']=[{'all':!![]}];}return db[_0x8fca('0x3d')][_0x8fca('0x52')](_0x4a2a60);})[_0x8fca('0x22')](function(_0x1f40a3){_0x33b894[_0x8fca('0x53')]=_0x1f40a3;return _0x33b894;})[_0x8fca('0x22')](respondWithFilteredResult(_0x32c84f,_0x4a2a60))[_0x8fca('0x54')](handleError(_0x32c84f,null));};exports[_0x8fca('0x55')]=function(_0x566780,_0x106dce){var _0x55951a={'raw':![],'where':{'id':_0x566780['params']['id']},'include':[{'model':db[_0x8fca('0x56')],'as':_0x8fca('0x3b')}]},_0x36f331={};_0x36f331[_0x8fca('0x41')]=_['keys'](db[_0x8fca('0x3d')][_0x8fca('0x3e')]);_0x36f331['query']=_[_0x8fca('0x43')](_0x566780['query']);_0x36f331['filters']=_['intersection'](_0x36f331[_0x8fca('0x41')],_0x36f331[_0x8fca('0x42')]);_0x55951a['attributes']=_[_0x8fca('0x45')](_0x36f331['model'],qs[_0x8fca('0x47')](_0x566780[_0x8fca('0x42')]['fields']));_0x55951a[_0x8fca('0x46')]=_0x55951a[_0x8fca('0x46')][_0x8fca('0x48')]?_0x55951a[_0x8fca('0x46')]:_0x36f331[_0x8fca('0x41')];if(_0x566780[_0x8fca('0x42')][_0x8fca('0x51')]){_0x55951a[_0x8fca('0x57')]=[{'all':!![]}];}_0x55951a=_[_0x8fca('0x4d')]({},_0x55951a,_0x566780[_0x8fca('0x50')]);return db['ChatWebsite'][_0x8fca('0x58')](_0x55951a)[_0x8fca('0x22')](handleEntityNotFound(_0x106dce,null))[_0x8fca('0x22')](respondWithResult(_0x106dce,null))[_0x8fca('0x54')](handleError(_0x106dce,null));};exports[_0x8fca('0x59')]=function(_0x2d2073,_0x17f0ae){return db[_0x8fca('0x3d')][_0x8fca('0x59')](_0x2d2073[_0x8fca('0x5a')],{})[_0x8fca('0x22')](function(_0x4a709b){var _0x2fc552=_0x2d2073[_0x8fca('0x5b')]['get']({'plain':!![]});if(!_0x2fc552)throw new Error(_0x8fca('0x5c'));if(_0x2fc552['role']===_0x8fca('0x5b')){var _0x4b376d=_0x4a709b['get']({'plain':!![]});var _0x1f376a='ChatWebsites';return db[_0x8fca('0x5d')][_0x8fca('0x58')]({'where':{'name':_0x1f376a,'userProfileId':_0x2fc552[_0x8fca('0x5e')]},'raw':!![]})[_0x8fca('0x22')](function(_0x5dcbd5){if(_0x5dcbd5&&_0x5dcbd5[_0x8fca('0x5f')]===0x0){return db['UserProfileResource'][_0x8fca('0x59')]({'name':_0x4b376d[_0x8fca('0x38')],'resourceId':_0x4b376d['id'],'type':_0x5dcbd5[_0x8fca('0x38')],'sectionId':_0x5dcbd5['id']},{})[_0x8fca('0x22')](function(){return _0x4a709b;});}else{return _0x4a709b;}})[_0x8fca('0x54')](function(_0xb78a75){logger[_0x8fca('0x27')](_0x8fca('0x60'),_0xb78a75);throw _0xb78a75;});}return _0x4a709b;})[_0x8fca('0x22')](respondWithResult(_0x17f0ae,0xc9))[_0x8fca('0x54')](handleError(_0x17f0ae,null));};exports[_0x8fca('0x34')]=function(_0x36a53f,_0x1d7cc0){if(_0x36a53f['body']['id']){delete _0x36a53f[_0x8fca('0x5a')]['id'];}return db[_0x8fca('0x3d')]['find']({'where':{'id':_0x36a53f[_0x8fca('0x61')]['id']},'include':[{'model':db[_0x8fca('0x56')],'as':_0x8fca('0x3b')}]})['then'](handleEntityNotFound(_0x1d7cc0,null))[_0x8fca('0x22')](saveUpdates(_0x36a53f[_0x8fca('0x5a')],null))[_0x8fca('0x22')](respondWithResult(_0x1d7cc0,null))['catch'](handleError(_0x1d7cc0,null));};exports[_0x8fca('0x35')]=function(_0xf97f05,_0x4e5456){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0xf97f05[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x4e5456,null))[_0x8fca('0x22')](removeEntity(_0x4e5456,null))[_0x8fca('0x54')](handleError(_0x4e5456,null));};exports[_0x8fca('0x62')]=function(_0x4dffcc,_0x570056){return db[_0x8fca('0x3d')][_0x8fca('0x62')]()['then'](respondWithResult(_0x570056,null))['catch'](handleError(_0x570056,null));};exports[_0x8fca('0x63')]=function(_0x2be17f,_0x58e1df,_0x9c5104){if(_0x2be17f['body']['id']){delete _0x2be17f[_0x8fca('0x5a')]['id'];}return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x2be17f['params']['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x58e1df,null))['then'](function(_0x356435){if(_0x356435){_0x2be17f[_0x8fca('0x5a')][_0x8fca('0x64')]=_0x356435['id'];return db[_0x8fca('0x65')]['create'](_0x2be17f[_0x8fca('0x5a')]);}})['then'](respondWithResult(_0x58e1df,null))['catch'](handleError(_0x58e1df,null));};exports[_0x8fca('0x66')]=function(_0x13a9b4,_0x5ba6a7,_0x1ae7e1){var _0x540c5a={'raw':![],'where':{}};var _0x3b1487={};var _0x905d46={'count':0x0,'rows':[]};return db[_0x8fca('0x3d')]['findOne']({'where':{'id':_0x13a9b4[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x5ba6a7,null))['then'](function(_0x38fab6){if(_0x38fab6){_0x3b1487['model']=_[_0x8fca('0x43')](db['Disposition'][_0x8fca('0x3e')]);_0x3b1487['query']=_[_0x8fca('0x43')](_0x13a9b4[_0x8fca('0x42')]);_0x3b1487[_0x8fca('0x44')]=_['intersection'](_0x3b1487['model'],_0x3b1487[_0x8fca('0x42')]);_0x540c5a[_0x8fca('0x46')]=_['intersection'](_0x3b1487[_0x8fca('0x41')],qs[_0x8fca('0x47')](_0x13a9b4[_0x8fca('0x42')]['fields']));_0x540c5a['attributes']=_0x540c5a['attributes'][_0x8fca('0x48')]?_0x540c5a[_0x8fca('0x46')]:_0x3b1487[_0x8fca('0x41')];if(!_0x13a9b4['query'][_0x8fca('0x67')](_0x8fca('0x49'))){_0x540c5a[_0x8fca('0x32')]=qs['limit'](_0x13a9b4[_0x8fca('0x42')][_0x8fca('0x32')]);_0x540c5a[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x13a9b4['query'][_0x8fca('0x2f')]);}_0x540c5a[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x13a9b4[_0x8fca('0x42')]['sort']);_0x540c5a[_0x8fca('0x4c')]=qs['filters'](_[_0x8fca('0x68')](_0x13a9b4['query'],_0x3b1487['filters']));_0x540c5a[_0x8fca('0x4c')][_0x8fca('0x64')]=_0x38fab6['id'];if(_0x13a9b4[_0x8fca('0x42')][_0x8fca('0x4f')]){_0x540c5a[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0x540c5a['where'],{'$or':_[_0x8fca('0x3c')](_0x540c5a[_0x8fca('0x46')],function(_0xa5be01){var _0x14e2c8={};_0x14e2c8[_0xa5be01]={'$like':'%'+_0x13a9b4[_0x8fca('0x42')]['filter']+'%'};return _0x14e2c8;})});}_0x540c5a=_[_0x8fca('0x4d')]({},_0x540c5a,_0x13a9b4[_0x8fca('0x50')]);return db[_0x8fca('0x65')]['count']({'where':_0x540c5a[_0x8fca('0x4c')]})[_0x8fca('0x22')](function(_0x581a79){_0x905d46[_0x8fca('0x31')]=_0x581a79;if(_0x13a9b4['query'][_0x8fca('0x51')]){_0x540c5a[_0x8fca('0x57')]=[{'all':!![]}];}return db[_0x8fca('0x65')][_0x8fca('0x52')](_0x540c5a);})[_0x8fca('0x22')](function(_0x25b04d){_0x905d46[_0x8fca('0x53')]=_0x25b04d;return _0x905d46;});}})['then'](respondWithFilteredResult(_0x5ba6a7,_0x540c5a))[_0x8fca('0x54')](handleError(_0x5ba6a7,null));};exports[_0x8fca('0x69')]=function(_0x577ae2,_0x143e30,_0x3a8c8c){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x577ae2['params']['id']}})['then'](handleEntityNotFound(_0x143e30,null))['then'](function(_0x3ba9ec){if(_0x3ba9ec){return _0x3ba9ec[_0x8fca('0x69')](_0x577ae2[_0x8fca('0x42')][_0x8fca('0x6a')]);}})[_0x8fca('0x22')](respondWithStatusCode(_0x143e30,null))['catch'](handleError(_0x143e30,null));};exports['addAnswer']=function(_0x4374c5,_0x1d7cb4,_0x326c49){if(_0x4374c5[_0x8fca('0x5a')]['id']){delete _0x4374c5['body']['id'];}return db['ChatWebsite'][_0x8fca('0x58')]({'where':{'id':_0x4374c5[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0x1d7cb4,null))['then'](function(_0x2dbcda){if(_0x2dbcda){_0x4374c5[_0x8fca('0x5a')]['ChatWebsiteId']=_0x2dbcda['id'];return db[_0x8fca('0x6b')]['create'](_0x4374c5[_0x8fca('0x5a')]);}})[_0x8fca('0x22')](respondWithResult(_0x1d7cb4,null))['catch'](handleError(_0x1d7cb4,null));};exports['getAnswers']=function(_0x1b6d9a,_0x1ffd42,_0x230e0d){var _0x4679d8={'raw':![],'where':{}};var _0x59c332={};var _0x5255be={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8fca('0x6c')]({'where':{'id':_0x1b6d9a['params']['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x1ffd42,null))[_0x8fca('0x22')](function(_0x58ab3d){if(_0x58ab3d){_0x59c332[_0x8fca('0x41')]=_['keys'](db[_0x8fca('0x6b')][_0x8fca('0x3e')]);_0x59c332[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x1b6d9a['query']);_0x59c332['filters']=_[_0x8fca('0x45')](_0x59c332[_0x8fca('0x41')],_0x59c332['query']);_0x4679d8[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x59c332[_0x8fca('0x41')],qs[_0x8fca('0x47')](_0x1b6d9a[_0x8fca('0x42')][_0x8fca('0x47')]));_0x4679d8['attributes']=_0x4679d8[_0x8fca('0x46')]['length']?_0x4679d8[_0x8fca('0x46')]:_0x59c332[_0x8fca('0x41')];if(!_0x1b6d9a[_0x8fca('0x42')]['hasOwnProperty']('nolimit')){_0x4679d8['limit']=qs[_0x8fca('0x32')](_0x1b6d9a[_0x8fca('0x42')]['limit']);_0x4679d8[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x1b6d9a[_0x8fca('0x42')][_0x8fca('0x2f')]);}_0x4679d8[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x1b6d9a[_0x8fca('0x42')][_0x8fca('0x4b')]);_0x4679d8['where']=qs['filters'](_[_0x8fca('0x68')](_0x1b6d9a[_0x8fca('0x42')],_0x59c332[_0x8fca('0x44')]));_0x4679d8[_0x8fca('0x4c')][_0x8fca('0x64')]=_0x58ab3d['id'];if(_0x1b6d9a[_0x8fca('0x42')][_0x8fca('0x4f')]){_0x4679d8[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0x4679d8[_0x8fca('0x4c')],{'$or':_['map'](_0x4679d8[_0x8fca('0x46')],function(_0x5b982){var _0x5b1e65={};_0x5b1e65[_0x5b982]={'$like':'%'+_0x1b6d9a['query']['filter']+'%'};return _0x5b1e65;})});}_0x4679d8=_[_0x8fca('0x4d')]({},_0x4679d8,_0x1b6d9a[_0x8fca('0x50')]);return db[_0x8fca('0x6b')][_0x8fca('0x31')]({'where':_0x4679d8[_0x8fca('0x4c')]})[_0x8fca('0x22')](function(_0x363bb9){_0x5255be['count']=_0x363bb9;if(_0x1b6d9a['query'][_0x8fca('0x51')]){_0x4679d8[_0x8fca('0x57')]=[{'all':!![]}];}return db[_0x8fca('0x6b')][_0x8fca('0x52')](_0x4679d8);})[_0x8fca('0x22')](function(_0x32c225){_0x5255be[_0x8fca('0x53')]=_0x32c225;return _0x5255be;});}})[_0x8fca('0x22')](respondWithFilteredResult(_0x1ffd42,_0x4679d8))[_0x8fca('0x54')](handleError(_0x1ffd42,null));};exports[_0x8fca('0x6d')]=function(_0x541060,_0x4d59e3,_0x44e70e){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x541060[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x4d59e3,null))[_0x8fca('0x22')](function(_0x48866c){if(_0x48866c){return _0x48866c['removeAnswers'](_0x541060[_0x8fca('0x42')][_0x8fca('0x6a')]);}})[_0x8fca('0x22')](respondWithStatusCode(_0x4d59e3,null))[_0x8fca('0x54')](handleError(_0x4d59e3,null));};exports[_0x8fca('0x6e')]=function(_0x25ba1d,_0x5bfd75,_0x566745){_0x25ba1d[_0x8fca('0x5a')][_0x8fca('0x6f')]=_0x25ba1d[_0x8fca('0x70')][_0x8fca('0x71')];return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x25ba1d['params']['id']}})['then'](handleEntityNotFound(_0x5bfd75,null))[_0x8fca('0x22')](saveUpdates(_0x25ba1d[_0x8fca('0x5a')],null))[_0x8fca('0x22')](respondWithResult(_0x5bfd75,null))[_0x8fca('0x54')](handleError(_0x5bfd75,null));};exports[_0x8fca('0x72')]=function(_0x57ee11,_0x29532b,_0x38daa5){_0x57ee11[_0x8fca('0x5a')][_0x8fca('0x73')]=_0x57ee11[_0x8fca('0x70')][_0x8fca('0x71')];return db[_0x8fca('0x3d')]['find']({'where':{'id':_0x57ee11[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x29532b,null))['then'](saveUpdates(_0x57ee11['body'],null))[_0x8fca('0x22')](respondWithResult(_0x29532b,null))[_0x8fca('0x54')](handleError(_0x29532b,null));};exports[_0x8fca('0x74')]=function(_0x25d551,_0x1e8a43,_0x1fddd7){_0x25d551[_0x8fca('0x5a')][_0x8fca('0x75')]=_0x25d551[_0x8fca('0x70')][_0x8fca('0x71')];return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x25d551['params']['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x1e8a43,null))[_0x8fca('0x22')](saveUpdates(_0x25d551[_0x8fca('0x5a')],null))[_0x8fca('0x22')](respondWithResult(_0x1e8a43,null))[_0x8fca('0x54')](handleError(_0x1e8a43,null));};exports[_0x8fca('0x76')]=function(_0x3d1182,_0x4dfc1a,_0xa84d0e){_0x3d1182[_0x8fca('0x5a')][_0x8fca('0x77')]=_0x3d1182[_0x8fca('0x70')][_0x8fca('0x71')];return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x3d1182[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x4dfc1a,null))[_0x8fca('0x22')](saveUpdates(_0x3d1182['body'],null))['then'](respondWithResult(_0x4dfc1a,null))['catch'](handleError(_0x4dfc1a,null));};exports[_0x8fca('0x78')]=function(_0xedd25a,_0x3d86b4,_0x2709de){var _0x4f5589=path[_0x8fca('0x79')](config[_0x8fca('0x7a')],'server/files/images/logos/default_logo.svg');var _0x34b5e2={'where':{'id':_0xedd25a['params']['id']},'attributes':['id',_0x8fca('0x6f')],'raw':!![]};var _0x110f09=![];return require(_0x8fca('0x7b'))[_0x8fca('0x7c')]()[_0x8fca('0x22')](function(_0x5004ef){if(_0x5004ef){_0x110f09=_0x5004ef[_0x8fca('0x7d')];}})[_0x8fca('0x22')](function(){return db[_0x8fca('0x3d')][_0x8fca('0x58')](_0x34b5e2);})[_0x8fca('0x22')](handleEntityNotFound(_0x3d86b4,null))['then'](function(_0x595924){if(_0x595924){if(!_[_0x8fca('0x7e')](_0x595924[_0x8fca('0x6f')])){if(fs[_0x8fca('0x7f')](path[_0x8fca('0x79')](config[_0x8fca('0x7a')],'server/files/images/logos/',_0x595924[_0x8fca('0x6f')]))&&_0x110f09){_0x4f5589=path[_0x8fca('0x79')](config[_0x8fca('0x7a')],'server/files/images/logos/',_0x595924[_0x8fca('0x6f')]);}}return _0x3d86b4[_0x8fca('0x80')](_0x4f5589);}})[_0x8fca('0x54')](handleError(_0x3d86b4,null));};exports[_0x8fca('0x81')]=function(_0xb96316,_0xf30f08,_0x5b401d){var _0x41de6a=path[_0x8fca('0x79')](config[_0x8fca('0x7a')],_0x8fca('0x82'));var _0x42bfd9={'where':{'id':_0xb96316[_0x8fca('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x8fca('0x3d')]['find'](_0x42bfd9)[_0x8fca('0x22')](handleEntityNotFound(_0xf30f08,null))['then'](function(_0x38b9aa){if(_0x38b9aa){if(!_[_0x8fca('0x7e')](_0x38b9aa[_0x8fca('0x73')])){if(fs[_0x8fca('0x7f')](path['join'](config[_0x8fca('0x7a')],_0x8fca('0x83'),_0x38b9aa[_0x8fca('0x73')]))){_0x41de6a=path['join'](config[_0x8fca('0x7a')],_0x8fca('0x83'),_0x38b9aa[_0x8fca('0x73')]);}}return _0xf30f08[_0x8fca('0x80')](_0x41de6a);}})['catch'](handleError(_0xf30f08,null));};exports[_0x8fca('0x84')]=function(_0x8e493d,_0x5a53b7,_0xa690ff){var _0x3754aa=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x425664={'where':{'id':_0x8e493d['params']['id']},'attributes':['id','customerAvatar',_0x8fca('0x85')],'raw':!![]};return db[_0x8fca('0x3d')][_0x8fca('0x58')](_0x425664)[_0x8fca('0x22')](handleEntityNotFound(_0x5a53b7,null))[_0x8fca('0x22')](function(_0x3cd67d){if(_0x3cd67d){if(!_['isNil'](_0x3cd67d[_0x8fca('0x75')])){if(fs[_0x8fca('0x7f')](path[_0x8fca('0x79')](config['root'],_0x8fca('0x83'),_0x3cd67d[_0x8fca('0x75')]))&&_0x3cd67d[_0x8fca('0x85')]){_0x3754aa=path[_0x8fca('0x79')](config['root'],_0x8fca('0x83'),_0x3cd67d[_0x8fca('0x75')]);}}return _0x5a53b7[_0x8fca('0x80')](_0x3754aa);}})['catch'](handleError(_0x5a53b7,null));};exports['getSystemAvatar']=function(_0x1eecac,_0x5a0d7a,_0x43502a){var _0x3a69c2=path['join'](config[_0x8fca('0x7a')],'server/files/images/avatars/system_avatar.png');var _0x4a1530={'where':{'id':_0x1eecac[_0x8fca('0x61')]['id']},'attributes':['id',_0x8fca('0x77')],'raw':!![]};return db[_0x8fca('0x3d')][_0x8fca('0x58')](_0x4a1530)[_0x8fca('0x22')](handleEntityNotFound(_0x5a0d7a,null))[_0x8fca('0x22')](function(_0x55a10e){if(_0x55a10e){if(!_['isNil'](_0x55a10e[_0x8fca('0x77')])){if(fs[_0x8fca('0x7f')](path[_0x8fca('0x79')](config['root'],_0x8fca('0x83'),_0x55a10e[_0x8fca('0x77')]))){_0x3a69c2=path[_0x8fca('0x79')](config[_0x8fca('0x7a')],'server/files/images/avatars/',_0x55a10e[_0x8fca('0x77')]);}}return _0x5a0d7a[_0x8fca('0x80')](_0x3a69c2);}})[_0x8fca('0x54')](handleError(_0x5a0d7a,null));};exports[_0x8fca('0x86')]=function(_0xd97ea,_0x193e1c,_0x41dd30){var _0x24f386=require(_0x8fca('0x87'));var _0x5bba46=new _0x24f386();var _0x17dbc8=_0x5bba46[_0x8fca('0x88')](_0xd97ea['headers'][_0x8fca('0x89')])['getResult']();var _0x29f558={'body':_0xd97ea[_0x8fca('0x5a')],'channel':_0x8fca('0x8a')};var _0x11a9e0=[];var _0x290377=[];var _0x7dcdc5={};var _0x185929=![];return db['CmContact']['describe']()[_0x8fca('0x22')](function(_0x1fbb58){if(!_0x1fbb58){throw new db[(_0x8fca('0x8b'))][(_0x8fca('0x8c'))](_0x8fca('0x8d'));}_0x11a9e0=_[_0x8fca('0x8e')](_[_0x8fca('0x43')](_0x1fbb58),[_0x8fca('0x8f'),_0x8fca('0x90')]);_0x290377=_[_0x8fca('0x8e')](_[_0x8fca('0x43')](_0x1fbb58),[_0x8fca('0x8f'),_0x8fca('0x90'),_0x8fca('0x91'),'ListId']);if(_0xd97ea['body']['id']){delete _0xd97ea['body']['id'];}if(_[_0x8fca('0x7e')](_0xd97ea['body'][_0x8fca('0x92')])){throw new db['Sequelize'][(_0x8fca('0x8c'))](_0x8fca('0x93'));}if(_[_0x8fca('0x7e')](_0xd97ea['body'][_0x8fca('0x5a')])||_0xd97ea[_0x8fca('0x5a')]['body']===''){throw new db[(_0x8fca('0x8b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8fca('0x7e')](_0xd97ea[_0x8fca('0x5a')]['mapKey'])){throw new db[(_0x8fca('0x8b'))][(_0x8fca('0x8c'))](_0x8fca('0x94')+_0x290377);}if(!_[_0x8fca('0x95')](_0x290377,_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x96')])){throw new db['Sequelize'][(_0x8fca('0x8c'))](_0x8fca('0x97')+_0x290377);}_0x7dcdc5[_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x96')]]=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x92')];})['then'](function(){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0xd97ea[_0x8fca('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x8fca('0x98'),'include':[{'model':db['CmContact'],'as':_0x8fca('0x99'),'where':_0x7dcdc5,'limit':0x1,'order':[[_0x8fca('0x90'),_0x8fca('0x9a')]]}]},{'model':db[_0x8fca('0x9b')],'as':_0x8fca('0x9c')}]});})[_0x8fca('0x22')](handleEntityNotFound(_0x193e1c,null))['then'](function(_0x50ad47){if(_0x50ad47&&_0x50ad47[_0x8fca('0x98')]){_0x29f558[_0x8fca('0x9d')]=_0x50ad47;_0x29f558[_0x8fca('0x9e')]=_0x50ad47[_0x8fca('0x9c')];_0x29f558[_0x8fca('0x9f')]=_0x50ad47[_0x8fca('0x98')];_0x29f558[_0x8fca('0x9e')]=_[_0x8fca('0xa0')](_0x29f558[_0x8fca('0x9e')],['priority'],[_0x8fca('0xa1')]);if(_0x29f558[_0x8fca('0x9d')][_0x8fca('0x9c')]){delete _0x29f558['account'][_0x8fca('0x9c')];}if(_0x29f558['account'][_0x8fca('0x98')]&&_0x29f558['account'][_0x8fca('0x98')]['Contacts'][_0x8fca('0x48')]){return _0x29f558['account'][_0x8fca('0x98')]['Contacts'][0x0];}var _0x2d85b8=_[_0x8fca('0xa2')](_0xd97ea[_0x8fca('0x5a')],{'firstName':_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x92')],'ListId':_0x50ad47[_0x8fca('0xa3')]});_0x2d85b8[_0xd97ea['body']['mapKey']]=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x92')];return db['CmContact'][_0x8fca('0x59')](_0x2d85b8,{'fields':_0x11a9e0,'raw':!![]});}})[_0x8fca('0x22')](handleEntityNotFound(_0x193e1c,null))['then'](function(_0x546f26){_0x29f558[_0x8fca('0xa4')]=_0x546f26;var _0x3c97f9=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xa5')];if(_0xd97ea['headers'][_0x8fca('0xa6')]){_0x3c97f9=_0xd97ea[_0x8fca('0xa7')][_0x8fca('0xa6')];}else if(_0xd97ea[_0x8fca('0xa7')][_0x8fca('0xa8')]){_0x3c97f9=_[_0x8fca('0xa9')](_0xd97ea['headers'][_0x8fca('0xa8')]['split'](','));}if(_0x546f26){var _0x52d1a6={'ContactId':_0x546f26['id'],'ChatWebsiteId':_0xd97ea[_0x8fca('0x61')]['id'],'from':(_0x546f26[_0x8fca('0xaa')]||'')+'\x20'+(_0x546f26[_0x8fca('0xab')]||''),'customerIp':_0x3c97f9,'customerPort':_0xd97ea[_0x8fca('0xa7')]['x-real-port']?_0xd97ea[_0x8fca('0xa7')][_0x8fca('0xac')]:null,'referer':_0xd97ea['body'][_0x8fca('0xad')],'browserName':_0x17dbc8[_0x8fca('0xae')][_0x8fca('0x38')]&&_0x17dbc8[_0x8fca('0xae')][_0x8fca('0xaf')]?util['format'](_0x8fca('0xb0'),_0x17dbc8[_0x8fca('0xae')][_0x8fca('0x38')],_0x17dbc8[_0x8fca('0xae')]['version']):_0x8fca('0xb1'),'browserVersion':_0x17dbc8[_0x8fca('0xae')][_0x8fca('0xaf')]||_0x8fca('0xb1'),'osName':util[_0x8fca('0xb2')](_0x8fca('0xb0'),_0x17dbc8['os']['name'],_0x17dbc8['os'][_0x8fca('0xaf')]),'osVersion':_0x17dbc8['os'][_0x8fca('0xaf')],'deviceModel':_0x17dbc8[_0x8fca('0xb3')][_0x8fca('0x41')]&&_0x17dbc8[_0x8fca('0xb3')][_0x8fca('0xb4')]?util[_0x8fca('0xb2')](_0x8fca('0xb5'),_0x17dbc8[_0x8fca('0xb3')][_0x8fca('0x41')],_0x17dbc8[_0x8fca('0xb3')][_0x8fca('0xb4')],_0x17dbc8[_0x8fca('0xb3')]['type']):null,'deviceVendor':_0x17dbc8['device'][_0x8fca('0xb4')],'deviceType':_0x17dbc8[_0x8fca('0xb3')][_0x8fca('0x3f')],'formData':JSON[_0x8fca('0xb6')](_0xd97ea['body'])};var _0x5183c1={'ChatWebsiteId':_0xd97ea[_0x8fca('0x61')]['id'],'closed':![]};if(_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xb7')]){_0x5183c1[_0x8fca('0xb7')]=_0xd97ea[_0x8fca('0x5a')]['threadId'];return db[_0x8fca('0xb8')][_0x8fca('0x58')]({'where':_0x5183c1})['then'](function(_0x213e50){if(_0x213e50){return[_0x213e50,![]];}_0x52d1a6[_0x8fca('0xb7')]=_0xd97ea['body'][_0x8fca('0xb7')];_0x52d1a6[_0x8fca('0xb9')]=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xb9')];return db[_0x8fca('0xb8')]['create'](_0x52d1a6)[_0x8fca('0x22')](function(_0x4f55a9){return[_0x4f55a9,!![]];});});}_0x5183c1[_0x8fca('0xba')]=_0x546f26['id'];if(_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xbb')]&&_0xd97ea['body'][_0x8fca('0xbb')]['id']){_0x5183c1['id']=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xbb')]['id'];return db[_0x8fca('0xb8')][_0x8fca('0x58')]({'where':_0x5183c1})['then'](function(_0x513a03){if(_0x513a03){return[_0x513a03,![]];}return db['ChatInteraction'][_0x8fca('0x59')](_0x52d1a6)[_0x8fca('0x22')](function(_0x24df9a){return[_0x24df9a,!![]];});});}return db[_0x8fca('0xb8')][_0x8fca('0x59')](_0x52d1a6)[_0x8fca('0x22')](function(_0x37f826){return[_0x37f826,!![]];});}})[_0x8fca('0xbc')](function(_0x3f6925,_0x287f31){if(_0x3f6925){_0x185929=_0x287f31;if(!_0x287f31){var _0xcb36d0={'from':(_0x29f558[_0x8fca('0xa4')][_0x8fca('0xaa')]||'')+'\x20'+(_0x29f558[_0x8fca('0xa4')][_0x8fca('0xab')]||'')};if(_0xd97ea[_0x8fca('0x5a')]['threadId']&&_0xd97ea['body'][_0x8fca('0xbd')]&&_0xd97ea['body'][_0x8fca('0xb7')]!=_0xd97ea[_0x8fca('0x5a')]['messageId']){_0xcb36d0[_0x8fca('0xb7')]=_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xbd')];}return _0x3f6925['update'](_0xcb36d0);}else{return _0x3f6925;}}})[_0x8fca('0x22')](function(_0x25bd02){_0x29f558['interaction']=_0x25bd02[_0x8fca('0xbe')]({'plain':!![]});_0x29f558[_0x8fca('0xbb')][_0x8fca('0xbf')]=_0x185929;if(_0x29f558[_0x8fca('0xbb')][_0x8fca('0xbf')]){if(_0x29f558[_0x8fca('0x9d')][_0x8fca('0xc0')]){_0x29f558[_0x8fca('0x9e')][_0x8fca('0xc1')]({'id':0x0,'priority':_0x29f558['applications'][_0x8fca('0x48')]+0x1,'app':_0x8fca('0xc2'),'appdata':_0x8fca('0xc3'),'interval':_0x8fca('0xc4')});}}return db['ChatMessage'][_0x8fca('0x59')]({'body':_0xd97ea[_0x8fca('0x5a')][_0x8fca('0x5a')],'ChatWebsiteId':_0xd97ea['params']['id'],'ChatInteractionId':_0x25bd02['id'],'direction':'in','ContactId':_0x29f558[_0x8fca('0xa4')]['id'],'AttachmentId':_0xd97ea[_0x8fca('0x5a')][_0x8fca('0xc5')]});})[_0x8fca('0x22')](function(_0x53fc4d){_0x29f558[_0x8fca('0x29')]=_0x53fc4d;if(_0x29f558['interaction']['UserId']){return db[_0x8fca('0xc6')][_0x8fca('0x58')]({'attributes':['id',_0x8fca('0x38')],'where':{'id':_0x29f558[_0x8fca('0xbb')][_0x8fca('0xc7')]}})[_0x8fca('0x22')](function(_0x41cb00){if(_0x41cb00){_0x29f558[_0x8fca('0x9e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8fca('0xc8'),'appdata':_0x41cb00[_0x8fca('0x38')]+','+(_0x29f558[_0x8fca('0x9d')][_0x8fca('0xc9')]||0xa),'interval':_0x8fca('0xc4')});_0x29f558[_0x8fca('0xca')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x29f558);});}return respondWithRpcPromise(_0x8fca('0xcb'),_0x8fca('0xcc'),_0x29f558);})[_0x8fca('0x22')](function(_0x3b3b17){respondWithRpcPromise(_0x8fca('0xcd'),_0x8fca('0xcd'),{'event':_0x8fca('0x86'),'message':_0x3b3b17},client9002);return _0x3b3b17;})[_0x8fca('0x22')](respondWithResult(_0x193e1c,null))['catch'](handleError(_0x193e1c,null));};exports['offline']=function(_0x19a829,_0x4ce959,_0x38f2a4){var _0x50495a,_0x3edbaf,_0x46d3d6;var _0x17be23=[];var _0x4ffd88=[];var _0x17cae6={};var _0xb8334a=_0x19a829['files']||[];var _0x3fc75c=[];var _0xc0a1c0;return db[_0x8fca('0xce')][_0x8fca('0x62')]()['then'](function(_0x1886c2){if(!_0x1886c2){throw new db['Sequelize'][(_0x8fca('0x8c'))](_0x8fca('0x8d'));}_0x4ffd88=_['difference'](_[_0x8fca('0x43')](_0x1886c2),[_0x8fca('0x8f'),_0x8fca('0x90')]);_0x17be23=_['difference'](_[_0x8fca('0x43')](_0x1886c2),[_0x8fca('0x8f'),_0x8fca('0x90'),_0x8fca('0x91'),_0x8fca('0xa3')]);if(_0x19a829[_0x8fca('0x5a')]['id']){delete _0x19a829['body']['id'];}if(_[_0x8fca('0x7e')](_0x19a829[_0x8fca('0x5a')][_0x8fca('0x92')])){throw _0x4ce959[_0x8fca('0x2d')](0x1f4)[_0x8fca('0x39')](new db[(_0x8fca('0x8b'))]['ValidationError'](_0x8fca('0x93')));}if(_['isNil'](_0x19a829['body'][_0x8fca('0x5a')])||_0x19a829['body']['body']===''){throw _0x4ce959[_0x8fca('0x2d')](0x1f4)['send'](new db[(_0x8fca('0x8b'))]['ValidationError'](_0x8fca('0xcf')));}if(_[_0x8fca('0x7e')](_0x19a829[_0x8fca('0x5a')][_0x8fca('0xd0')])){throw _0x4ce959['status'](0x1f4)[_0x8fca('0x39')](new db[(_0x8fca('0x8b'))]['ValidationError'](_0x8fca('0xd1')+_0x17be23));}if(!_[_0x8fca('0x95')](_0x17be23,_0x19a829['body']['mapKeyOffline'])){throw _0x4ce959[_0x8fca('0x2d')](0x1f4)[_0x8fca('0x39')](new db['Sequelize'][(_0x8fca('0x8c'))](_0x8fca('0xd2')+_0x17be23));}_0x17cae6[_0x19a829['body']['mapKeyOffline']]=_0x19a829[_0x8fca('0x5a')]['from'];})[_0x8fca('0x22')](function(){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x19a829[_0x8fca('0x61')]['id']},'include':[{'model':db[_0x8fca('0xd3')],'as':'List'},{'model':db['MailAccount'],'as':_0x8fca('0xd4')}]});})[_0x8fca('0x22')](handleEntityNotFound(_0x4ce959,null))['then'](function(_0x2bcc63){if(_0x2bcc63&&_0x2bcc63['List']){_0x3edbaf=_0x2bcc63;var _0x2fdfd9=_[_0x8fca('0xa2')](_0x19a829[_0x8fca('0x5a')],{'firstName':_0x19a829[_0x8fca('0x5a')][_0x8fca('0x92')],'phone':_0x19a829[_0x8fca('0x5a')][_0x8fca('0x92')],'ListId':_0x2bcc63[_0x8fca('0xa3')]});_0x2fdfd9[_0x19a829[_0x8fca('0x5a')][_0x8fca('0xd0')]]=_0x19a829[_0x8fca('0x5a')][_0x8fca('0x92')];return db[_0x8fca('0xce')][_0x8fca('0xd5')]({'where':_0x17cae6,'defaults':_0x2fdfd9});}})[_0x8fca('0xbc')](function(_0x38852d){if(_0x38852d){_0x46d3d6=_0x38852d;var _0x40ec26=fs[_0x8fca('0xd6')](path[_0x8fca('0x79')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x8fca('0xd7'));var _0x1a91ae=ejs['render'](_0x40ec26,{'body':_[_0x8fca('0xd8')](_0x19a829[_0x8fca('0x5a')][_0x8fca('0x5a')]),'bodyTitle':_0x3edbaf['offlineMessageBody']});return db[_0x8fca('0xd9')][_0x8fca('0x59')]({'body':_0x1a91ae,'ContactId':_0x38852d['id'],'ChatWebsiteId':_0x3edbaf['id']});}})['then'](function(_0x4fce80){_0xc0a1c0=_0x4fce80;if(_0xb8334a[_0x8fca('0x48')]){var _0x5c186f=_0xb8334a['map'](function(_0x1c6a1c){return{'name':_0x1c6a1c[_0x8fca('0xda')],'basename':_0x1c6a1c[_0x8fca('0x71')],'type':_0x1c6a1c['mimetype'],'ChatOfflineMessageId':_0x4fce80['id']};});_0x3fc75c=_0x5c186f['map'](_0x40ccbb=>{var _0x4a8dec={'filename':_0x40ccbb[_0x8fca('0x38')],'path':path['join'](config[_0x8fca('0x7a')],_0x8fca('0xdb'),_0x8fca('0xdc'),_0x8fca('0xdd'),_0x8fca('0xde'),_0x40ccbb[_0x8fca('0xdf')])};return _0x4a8dec;});if(!_0x3edbaf[_0x8fca('0xe0')]){return db['sequelize'][_0x8fca('0xe1')](function(_0x275cdb){return db[_0x8fca('0xe2')][_0x8fca('0xe3')](_0x5c186f,{'transaction':_0x275cdb});});}}})[_0x8fca('0x22')](function(){if(_0xc0a1c0){_0x50495a=_0xc0a1c0;return db['MailAccount'][_0x8fca('0x6c')]({'where':{'active':!![]},'include':[{'model':db[_0x8fca('0xe4')],'as':_0x8fca('0xe5'),'raw':!![]}]});}})[_0x8fca('0x22')](function(_0x5db5cb){if(_0x5db5cb&&_0x5db5cb['Smtp']&&_0x3edbaf[_0x8fca('0xe6')]&&_0x3edbaf[_0x8fca('0xe7')]){var _0x49fb30={'tls':{'rejectUnauthorized':![]}};if(_0x5db5cb[_0x8fca('0xe5')][_0x8fca('0xe8')]){_0x49fb30['service']=_0x5db5cb['Smtp'][_0x8fca('0xe8')];}else{_0x49fb30['host']=_0x5db5cb[_0x8fca('0xe5')]['host'];_0x49fb30[_0x8fca('0xe9')]=_0x5db5cb['Smtp'][_0x8fca('0xe9')];_0x49fb30[_0x8fca('0xea')]=_0x5db5cb[_0x8fca('0xe5')][_0x8fca('0xea')];}if(_0x5db5cb[_0x8fca('0xe5')]['authentication']){_0x49fb30[_0x8fca('0xeb')]={'user':_0x5db5cb['Smtp'][_0x8fca('0x5b')],'pass':_0x5db5cb[_0x8fca('0xe5')][_0x8fca('0xec')]};}return respondWithRpcPromise(_0x8fca('0xed'),'sendMail',{'account':_0x49fb30,'message':{'from':util[_0x8fca('0xb2')](_0x8fca('0xee'),_0x5db5cb['name'],_0x5db5cb[_0x8fca('0xef')]||_0x5db5cb[_0x8fca('0xe5')][_0x8fca('0x5b')]),'to':_0x3edbaf[_0x8fca('0xe7')],'subject':_0x3edbaf[_0x8fca('0xf0')],'html':_0x50495a[_0x8fca('0x5a')],'attachments':_0x3fc75c}},client9003)['then'](function(){return _0x50495a;})[_0x8fca('0x54')](function(_0x1aaabc){console[_0x8fca('0x27')](_0x1aaabc);});}})[_0x8fca('0x22')](function(){if(_0x3edbaf&&_0x3edbaf['openNewInteraction']&&_0x3edbaf[_0x8fca('0xf1')]){var _0x1b6f81=[];if(_0xb8334a[_0x8fca('0x48')]){_0x1b6f81=_0xb8334a['map'](function(_0x1d3958){return{'name':_0x1d3958[_0x8fca('0xda')],'basename':_0x1d3958[_0x8fca('0x71')],'type':_0x1d3958[_0x8fca('0xf2')],'ChatOfflineMessageId':_0xc0a1c0['id']};});}var _0x53fdf2;if(!_[_0x8fca('0x7e')](_0x3edbaf[_0x8fca('0xf3')])){var _0x7a7dae=_[_0x8fca('0x3c')](_0x19a829['body'],function(_0x43004f){return _0x43004f;});var _0x18e6d7=_['toPairsIn'](_0x7a7dae)[0x0];var _0xc6964a=_[_0x8fca('0xf4')](_0x18e6d7,function(_0x1fc75f){return _0x1fc75f;});_0x53fdf2=_0xc6964a[0x1][_0x3edbaf[_0x8fca('0xf3')]];}var _0x2a9bbd={'from':_0x46d3d6[_0x8fca('0xef')],'firstName':_0x46d3d6[_0x8fca('0xaa')],'lastName':_0x46d3d6['lastName'],'mapKey':_0x8fca('0xef'),'message':{'from':_0x46d3d6[_0x8fca('0xef')],'to':_0x3edbaf[_0x8fca('0xd4')]['email'],'cc':'','subject':_[_0x8fca('0x7e')](_0x53fdf2)?_0x3edbaf['offlineMessageSubject']:_0x53fdf2,'messageId':'','sentAt':new Date(),'attach':_0x1b6f81[_0x8fca('0x48')],'attachments':_0x1b6f81,'originChannel':'Chat','ChatWebsiteId':_0x3edbaf['id'],'ChatOfflineMessageId':_0x50495a['id'],'originTo':_0x3edbaf[_0x8fca('0xd4')][_0x8fca('0xef')]},'body':_0x50495a['body']};var _0x5d9e2d={'account':{'id':_0x3edbaf['MailAccountId']},'body':_0x2a9bbd,'log':_0x8fca('0xf5')};return respondWithRpcPromise(_0x8fca('0xf5'),_0x8fca('0xf6'),_0x5d9e2d,client9001)[_0x8fca('0x22')](function(){return _0x50495a;})[_0x8fca('0x54')](function(_0x8c05b7){console[_0x8fca('0x27')](_0x8c05b7);});}return;})[_0x8fca('0x22')](function(){if(_0x50495a){return _0x50495a;}})['then'](respondWithResult(_0x4ce959,null))[_0x8fca('0x54')](function(_0x32092a){console[_0x8fca('0x27')](_0x8fca('0x54'),_0x32092a);for(var _0x51086e of _0xb8334a){var _0x457b2e=path[_0x8fca('0x79')](config['root'],_0x8fca('0xdb'),_0x8fca('0xdc'),'attachments',_0x8fca('0xde'),_0x51086e[_0x8fca('0x71')]);fs_extra[_0x8fca('0xf7')](_0x457b2e)[_0x8fca('0x54')](function(_0x4b248f){console['error'](_0x8fca('0xf8'),_0x457b2e,_0x4b248f);});}});};exports[_0x8fca('0xf9')]=function(_0x4ec5c4,_0x251de6,_0x479327){return db[_0x8fca('0xb8')][_0x8fca('0x58')]({'where':{'id':_0x4ec5c4[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x251de6,null))[_0x8fca('0x22')](function(_0x43cdf7){if(_0x43cdf7){return _0x43cdf7[_0x8fca('0xf9')](_0x4ec5c4['body']['ids'],_[_0x8fca('0xfa')](_0x4ec5c4[_0x8fca('0x5a')],[_0x8fca('0x6a'),'id'])||{});}})[_0x8fca('0x22')](respondWithResult(_0x251de6,null))[_0x8fca('0x54')](handleError(_0x251de6,null));};exports['getInteractions']=function(_0x4de386,_0x1a713b,_0xff20bd){var _0xce0cc={'raw':![],'where':{}};var _0x5093c6={};var _0x32d13b={'count':0x0,'rows':[]};return db[_0x8fca('0x3d')][_0x8fca('0x6c')]({'where':{'id':_0x4de386[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0x1a713b,null))[_0x8fca('0x22')](function(_0x3b3775){if(_0x3b3775){_0x5093c6[_0x8fca('0x41')]=_[_0x8fca('0x43')](db[_0x8fca('0xb8')][_0x8fca('0x3e')]);_0x5093c6[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x4de386[_0x8fca('0x42')]);_0x5093c6[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x5093c6[_0x8fca('0x41')],_0x5093c6[_0x8fca('0x42')]);_0xce0cc['attributes']=_[_0x8fca('0x45')](_0x5093c6[_0x8fca('0x41')],qs['fields'](_0x4de386['query'][_0x8fca('0x47')]));_0xce0cc[_0x8fca('0x46')]=_0xce0cc[_0x8fca('0x46')][_0x8fca('0x48')]?_0xce0cc[_0x8fca('0x46')]:_0x5093c6[_0x8fca('0x41')];if(!_0x4de386[_0x8fca('0x42')][_0x8fca('0x67')](_0x8fca('0x49'))){_0xce0cc[_0x8fca('0x32')]=qs[_0x8fca('0x32')](_0x4de386[_0x8fca('0x42')]['limit']);_0xce0cc[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x4de386['query'][_0x8fca('0x2f')]);}_0xce0cc[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x4de386['query'][_0x8fca('0x4b')]);_0xce0cc[_0x8fca('0x4c')]=qs[_0x8fca('0x44')](_['pick'](_0x4de386[_0x8fca('0x42')],_0x5093c6['filters']));_0xce0cc[_0x8fca('0x4c')][_0x8fca('0x64')]=_0x3b3775['id'];if(_0x4de386[_0x8fca('0x42')][_0x8fca('0x4f')]){_0xce0cc[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0xce0cc[_0x8fca('0x4c')],{'$or':_[_0x8fca('0x3c')](_0xce0cc['attributes'],function(_0x2a6102){var _0x9091d1={};_0x9091d1[_0x2a6102]={'$like':'%'+_0x4de386[_0x8fca('0x42')][_0x8fca('0x4f')]+'%'};return _0x9091d1;})});}_0xce0cc=_['merge']({},_0xce0cc,_0x4de386['options']);return db[_0x8fca('0xb8')]['count']({'where':_0xce0cc[_0x8fca('0x4c')]})[_0x8fca('0x22')](function(_0x206618){_0x32d13b[_0x8fca('0x31')]=_0x206618;if(_0x4de386['query']['includeAll']){_0xce0cc[_0x8fca('0x57')]=[{'model':db[_0x8fca('0xce')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8fca('0x38'),_0x8fca('0xfb'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x8fca('0xfc'),'attributes':['id',_0x8fca('0x38'),_0x8fca('0xfd')],'where':_0x4de386[_0x8fca('0x42')][_0x8fca('0xfe')]?{'id':_0x4de386['query']['tag']}:undefined,'required':_0x4de386[_0x8fca('0x42')]['tag']?!![]:![]}];}return db[_0x8fca('0xb8')][_0x8fca('0x52')](_0xce0cc);})['then'](function(_0x4fb2e7){_0x32d13b['rows']=_0x4fb2e7;return _0x32d13b;});}})[_0x8fca('0x22')](respondWithFilteredResult(_0x1a713b,_0xce0cc))['catch'](handleError(_0x1a713b,null));};function iftimePromise(_0x54d508,_0xfa2e1f){return respondWithRpcPromise(_0x8fca('0xff'),_0x8fca('0x100'),{'command':_0xfa2e1f[_0x8fca('0x101')]?util[_0x8fca('0xb2')](_0x8fca('0x102'),_0x54d508['interval'],_0xfa2e1f['timezone']):util[_0x8fca('0xb2')]('iftime\x20%s',_0x54d508[_0x8fca('0x103')])},client9002)[_0x8fca('0x22')](function(_0x5c4b0e){var _0xf8bd05=_0x5c4b0e&&_0x5c4b0e['indexOf'](_0x8fca('0x104'))>=0x0?!![]:![];logger[_0x8fca('0x2a')](_0x8fca('0x105'),_0xfa2e1f['id'],_0x54d508['id'],_0x54d508[_0x8fca('0x103')],_0xf8bd05?_0x8fca('0x106'):_0x8fca('0x107'),_0xfa2e1f[_0x8fca('0x101')]?_0xfa2e1f[_0x8fca('0x101')]:_0x8fca('0x108'));return _0xf8bd05;})[_0x8fca('0x54')](function(_0x228f32){logger[_0x8fca('0x27')](_0x8fca('0x105'),_0xfa2e1f['id'],_0x54d508['id'],_0x54d508[_0x8fca('0x103')],util[_0x8fca('0x109')](_0x228f32,{'showHidden':![],'depth':null}),_0xfa2e1f[_0x8fca('0x101')]?_0xfa2e1f[_0x8fca('0x101')]:_0x8fca('0x108'));return![];});}exports[_0x8fca('0x100')]=function(_0x3b5e2c,_0x59a7a1,_0x41f764){var _0x141812=0x0;var _0x4cdd80=0x0;var _0x32159e=![];var _0x30d5e1;var _0x3292ba;return db[_0x8fca('0x3d')]['find']({'where':{'id':_0x3b5e2c['params']['id']},'include':[{'model':db[_0x8fca('0x10a')],'as':_0x8fca('0x10a'),'include':[{'model':db[_0x8fca('0x10a')],'as':'Intervals','attributes':['id',_0x8fca('0x103')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x59a7a1,null))[_0x8fca('0x22')](function(_0x33d390){if(_0x33d390){_0x30d5e1=_0x33d390;return _0x33d390[_0x8fca('0x10b')]({'raw':!![]});}})['then'](function(_0x162b92){if(_0x30d5e1){if(_0x162b92){_0x3292ba=_0x162b92;}}return require(_0x8fca('0x7b'))['getLicense']();})[_0x8fca('0x22')](function(_0x3116ab){if(_0x3116ab){_0x4cdd80=_0x3116ab[_0x8fca('0x10c')];_0x32159e=_0x3116ab[_0x8fca('0x7d')];}})[_0x8fca('0x22')](function(){return db['ChatInteraction'][_0x8fca('0x31')]({'where':{'closed':![]}});})['then'](function(_0x55065c){_0x141812=_0x55065c;if(_0x4cdd80&&_0x55065c>_0x4cdd80){return db[_0x8fca('0x10d')]['findOne']({'where':{'id':0x1}})['then'](function(_0x2cea53){if(_0x2cea53){_0x2cea53[_0x8fca('0x10e')](_0x8fca('0x10f'));}});}})[_0x8fca('0x22')](function(){if(_0x30d5e1[_0x8fca('0x10a')]&&_0x30d5e1[_0x8fca('0x10a')][_0x8fca('0x110')]){var _0x7760fd=[];for(var _0xbec647=0x0;_0xbec647<_0x30d5e1[_0x8fca('0x10a')]['Intervals'][_0x8fca('0x48')];_0xbec647++){var _0x31ee5a=_0x30d5e1[_0x8fca('0x10a')][_0x8fca('0x110')][_0xbec647]['get']({'plain':!![]});_0x7760fd[_0x8fca('0xc1')](iftimePromise(_0x31ee5a,_0x30d5e1));}return BPromise['all'](_0x7760fd)['then'](function(_0xb8a989){return _[_0x8fca('0x111')](_0xb8a989);});}else{return!![];}})[_0x8fca('0x22')](function(_0x2ba269){var _0x3762d0=fs['readFileSync'](path[_0x8fca('0x79')](config[_0x8fca('0x7a')],_0x8fca('0x112')),_0x8fca('0xd7'));var _0x1ce248={'remote':_0x30d5e1[_0x8fca('0x113')],'query':querystring['stringify'](_[_0x8fca('0x4d')](_0x30d5e1['get']({'plain':!![]}),{'customerIp':_0x3b5e2c['headers'][_0x8fca('0xa8')]||_0x3b5e2c[_0x8fca('0xa7')][_0x8fca('0x114')]||_0x3b5e2c[_0x8fca('0x115')][_0x8fca('0x116')]||_0x3b5e2c['ip'],'referer':_0x3b5e2c[_0x8fca('0xa7')][_0x8fca('0xad')],'openedInteractions':_0x141812,'maxInteractions':_0x4cdd80,'virtual':_0x32159e[_0x8fca('0x10c')],'online':_0x2ba269,'custom':_0x32159e}))[_0x8fca('0x117')](/'/g,'\x5c\x27')};_0x59a7a1[_0x8fca('0x39')](ejs[_0x8fca('0x118')](Mustache['render'](_0x3762d0,_0x1ce248),{'proactiveActions':_0x3292ba,'alignment':_0x30d5e1[_0x8fca('0x119')],'verticalAlignment':_0x30d5e1['verticalAlignment'],'div_color':_0x30d5e1[_0x8fca('0xfd')],'text_color':_0x30d5e1[_0x8fca('0x11a')],'button_color':_0x30d5e1[_0x8fca('0x11b')],'background_color':_0x30d5e1[_0x8fca('0x11c')]}));})[_0x8fca('0x54')](handleError(_0x59a7a1,null));};exports[_0x8fca('0x11d')]=function(_0xaf693a,_0x2aa705,_0x1a105d){return db['ChatWebsite'][_0x8fca('0x6c')]({'where':{'id':_0xaf693a[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x2aa705,null))[_0x8fca('0x22')](function(_0x205f3b){if(_0x205f3b){return db['sequelize'][_0x8fca('0xe1')](function(_0x25b37e){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0xaf693a[_0x8fca('0x61')]['id']},'transaction':_0x25b37e})[_0x8fca('0x22')](function(_0x4a8614){var _0x6c821c=_[_0x8fca('0x3c')](_0xaf693a['body'],function(_0x286a5d){_0x286a5d[_0x8fca('0x64')]=_0xaf693a[_0x8fca('0x61')]['id'];return _0x286a5d;});return db[_0x8fca('0x9b')][_0x8fca('0xe3')](_0x6c821c,{'transaction':_0x25b37e});});})[_0x8fca('0x22')](function(){return db[_0x8fca('0x9b')][_0x8fca('0x11e')]({'where':{'ChatWebsiteId':_0xaf693a[_0x8fca('0x61')]['id']},'order':_0x8fca('0x11f')});});}})[_0x8fca('0x22')](respondWithResult(_0x2aa705,null))['catch'](handleError(_0x2aa705,null));};exports[_0x8fca('0x120')]=function(_0x1bf767,_0xfd094f,_0x2be677){var _0x4ebfae={};var _0x5e70d8={};var _0x3ddaa3;var _0x4b9b8d;return db[_0x8fca('0x3d')][_0x8fca('0x6c')]({'where':{'id':_0x1bf767[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0xfd094f,null))[_0x8fca('0x22')](function(_0x12700c){if(_0x12700c){_0x3ddaa3=_0x12700c;_0x5e70d8['model']=_[_0x8fca('0x43')](db[_0x8fca('0x9b')][_0x8fca('0x3e')]);_0x5e70d8[_0x8fca('0x42')]=_['keys'](_0x1bf767['query']);_0x5e70d8[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x5e70d8['model'],_0x5e70d8[_0x8fca('0x42')]);_0x4ebfae[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x5e70d8[_0x8fca('0x41')],qs[_0x8fca('0x47')](_0x1bf767[_0x8fca('0x42')][_0x8fca('0x47')]));_0x4ebfae[_0x8fca('0x46')]=_0x4ebfae['attributes'][_0x8fca('0x48')]?_0x4ebfae[_0x8fca('0x46')]:_0x5e70d8[_0x8fca('0x41')];_0x4ebfae[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x1bf767[_0x8fca('0x42')][_0x8fca('0x4b')]);_0x4ebfae[_0x8fca('0x4c')]=qs[_0x8fca('0x44')](_[_0x8fca('0x68')](_0x1bf767['query'],_0x5e70d8[_0x8fca('0x44')]));if(_0x1bf767[_0x8fca('0x42')][_0x8fca('0x4f')]){_0x4ebfae[_0x8fca('0x4c')]=_['merge'](_0x4ebfae[_0x8fca('0x4c')],{'$or':_['map'](_0x4ebfae[_0x8fca('0x46')],function(_0xd8f9da){var _0x19493d={};_0x19493d[_0xd8f9da]={'$like':'%'+_0x1bf767[_0x8fca('0x42')][_0x8fca('0x4f')]+'%'};return _0x19493d;})});}_0x4ebfae=_['merge']({},_0x4ebfae,_0x1bf767[_0x8fca('0x50')]);return _0x3ddaa3[_0x8fca('0x120')](_0x4ebfae);}})[_0x8fca('0x22')](function(_0x2d6485){if(_0x2d6485){_0x4b9b8d=_0x2d6485[_0x8fca('0x48')];if(!_0x1bf767[_0x8fca('0x42')][_0x8fca('0x67')](_0x8fca('0x49'))){_0x4ebfae['limit']=qs['limit'](_0x1bf767['query'][_0x8fca('0x32')]);_0x4ebfae['offset']=qs[_0x8fca('0x2f')](_0x1bf767[_0x8fca('0x42')]['offset']);}return _0x3ddaa3[_0x8fca('0x120')](_0x4ebfae);}})[_0x8fca('0x22')](function(_0x2c376c){if(_0x2c376c){return _0x2c376c?{'count':_0x4b9b8d,'rows':_0x2c376c}:null;}})[_0x8fca('0x22')](respondWithResult(_0xfd094f,null))['catch'](handleError(_0xfd094f,null));};exports[_0x8fca('0x121')]=function(_0x2b1634,_0x1539bd,_0x20c4ee){return db[_0x8fca('0x122')][_0x8fca('0x58')]({'where':{'id':_0x2b1634[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0x1539bd,null))['then'](function(_0x19db73){if(_0x19db73){return _0x19db73[_0x8fca('0x121')](_0x2b1634['body'][_0x8fca('0x6a')],_[_0x8fca('0xfa')](_0x2b1634[_0x8fca('0x5a')],['ids','id'])||{});}})[_0x8fca('0x22')](respondWithResult(_0x1539bd,null))[_0x8fca('0x54')](handleError(_0x1539bd,null));};exports[_0x8fca('0x10b')]=function(_0x31f40e,_0x56deb3,_0x22bb79){var _0x7e1851={};var _0x2e2fcf={};var _0x1b21a2;var _0x5543a2;return db[_0x8fca('0x3d')][_0x8fca('0x6c')]({'where':{'id':_0x31f40e[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x56deb3,null))[_0x8fca('0x22')](function(_0x47ec36){if(_0x47ec36){_0x1b21a2=_0x47ec36;_0x2e2fcf[_0x8fca('0x41')]=_[_0x8fca('0x43')](db[_0x8fca('0x123')]['rawAttributes']);_0x2e2fcf[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x31f40e['query']);_0x2e2fcf[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x2e2fcf[_0x8fca('0x41')],_0x2e2fcf[_0x8fca('0x42')]);_0x7e1851[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x2e2fcf[_0x8fca('0x41')],qs[_0x8fca('0x47')](_0x31f40e[_0x8fca('0x42')]['fields']));_0x7e1851[_0x8fca('0x46')]=_0x7e1851[_0x8fca('0x46')][_0x8fca('0x48')]?_0x7e1851[_0x8fca('0x46')]:_0x2e2fcf[_0x8fca('0x41')];_0x7e1851['order']=qs[_0x8fca('0x4b')](_0x31f40e[_0x8fca('0x42')]['sort']);_0x7e1851[_0x8fca('0x4c')]=qs[_0x8fca('0x44')](_[_0x8fca('0x68')](_0x31f40e[_0x8fca('0x42')],_0x2e2fcf[_0x8fca('0x44')]));if(_0x31f40e['query'][_0x8fca('0x4f')]){_0x7e1851[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0x7e1851[_0x8fca('0x4c')],{'$or':_[_0x8fca('0x3c')](_0x7e1851[_0x8fca('0x46')],function(_0x334d31){var _0x2964b4={};_0x2964b4[_0x334d31]={'$like':'%'+_0x31f40e[_0x8fca('0x42')][_0x8fca('0x4f')]+'%'};return _0x2964b4;})});}_0x7e1851=_[_0x8fca('0x4d')]({},_0x7e1851,_0x31f40e[_0x8fca('0x50')]);return _0x1b21a2['getProactiveActions'](_0x7e1851);}})[_0x8fca('0x22')](function(_0x4c6da6){if(_0x4c6da6){_0x5543a2=_0x4c6da6[_0x8fca('0x48')];if(!_0x31f40e['query']['hasOwnProperty'](_0x8fca('0x49'))){_0x7e1851[_0x8fca('0x32')]=qs[_0x8fca('0x32')](_0x31f40e[_0x8fca('0x42')][_0x8fca('0x32')]);_0x7e1851[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x31f40e['query'][_0x8fca('0x2f')]);}return _0x1b21a2[_0x8fca('0x10b')](_0x7e1851);}})[_0x8fca('0x22')](function(_0x3620d6){if(_0x3620d6){return _0x3620d6?{'count':_0x5543a2,'rows':_0x3620d6}:null;}})[_0x8fca('0x22')](respondWithResult(_0x56deb3,null))['catch'](handleError(_0x56deb3,null));};exports[_0x8fca('0x124')]=function(_0x464ad9,_0x47aea7,_0x36aa12){var _0xddd151=_0x464ad9[_0x8fca('0x42')]['online']===_0x8fca('0x125')?_0x8fca('0x126'):_0x8fca('0x127');return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'attributes':['id',_0xddd151],'where':{'id':_0x464ad9[_0x8fca('0x61')]['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x47aea7,null))[_0x8fca('0x22')](function(_0x1637c6){if(_0x1637c6){var _0x56c625=_0x1637c6[_0xddd151];var _0x29005d=_0x56c625&&_0x56c625[_0x8fca('0x128')]?_0x56c625['items']:[];_0x47aea7[_0x8fca('0x39')]({'fromKey':_[_0x8fca('0x7e')](_0x56c625[_0x8fca('0x129')])?undefined:_0x56c625[_0x8fca('0x129')],'count':_0x29005d[_0x8fca('0x48')],'rows':_0x29005d});}})[_0x8fca('0x54')](handleError(_0x47aea7,null));};exports[_0x8fca('0x12a')]=function(_0x2c03c3,_0x1b7337,_0x1f32d6){var _0x26667b={'raw':![],'where':{}};var _0x57bd50={};var _0xeb5c01={'count':0x0,'rows':[]};return db[_0x8fca('0x3d')][_0x8fca('0x6c')]({'where':{'id':_0x2c03c3[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0x1b7337,null))[_0x8fca('0x22')](function(_0x3f27ef){if(_0x3f27ef){_0x57bd50[_0x8fca('0x41')]=_[_0x8fca('0x43')](db[_0x8fca('0xd9')][_0x8fca('0x3e')]);_0x57bd50[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x2c03c3[_0x8fca('0x42')]);_0x57bd50[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x57bd50['model'],_0x57bd50[_0x8fca('0x42')]);_0x26667b[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x57bd50[_0x8fca('0x41')],qs['fields'](_0x2c03c3[_0x8fca('0x42')]['fields']));_0x26667b['attributes']=_0x26667b[_0x8fca('0x46')][_0x8fca('0x48')]?_0x26667b[_0x8fca('0x46')]:_0x57bd50[_0x8fca('0x41')];if(!_0x2c03c3[_0x8fca('0x42')][_0x8fca('0x67')]('nolimit')){_0x26667b['limit']=qs[_0x8fca('0x32')](_0x2c03c3[_0x8fca('0x42')]['limit']);_0x26667b[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x2c03c3[_0x8fca('0x42')][_0x8fca('0x2f')]);}_0x26667b[_0x8fca('0x4a')]=qs[_0x8fca('0x4b')](_0x2c03c3[_0x8fca('0x42')]['sort']);_0x26667b['where']=qs['filters'](_['pick'](_0x2c03c3[_0x8fca('0x42')],_0x57bd50[_0x8fca('0x44')]));_0x26667b[_0x8fca('0x4c')]['ChatWebsiteId']=_0x3f27ef['id'];if(_0x2c03c3['query'][_0x8fca('0x4f')]){_0x26667b[_0x8fca('0x4c')]=_[_0x8fca('0x4d')](_0x26667b[_0x8fca('0x4c')],{'$or':_['map'](_0x26667b['attributes'],function(_0x192ad1){var _0x2bb75b={};_0x2bb75b[_0x192ad1]={'$like':'%'+_0x2c03c3[_0x8fca('0x42')]['filter']+'%'};return _0x2bb75b;})});}_0x26667b=_[_0x8fca('0x4d')]({},_0x26667b,_0x2c03c3[_0x8fca('0x50')]);return db[_0x8fca('0xd9')]['count']({'where':_0x26667b[_0x8fca('0x4c')]})['then'](function(_0x49ccd1){_0xeb5c01[_0x8fca('0x31')]=_0x49ccd1;if(_0x2c03c3[_0x8fca('0x42')][_0x8fca('0x51')]){_0x26667b[_0x8fca('0x57')]=[{'all':!![]}];}else{_0x26667b['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x8fca('0xe2')],'as':'Attachments','required':![]}];}return db[_0x8fca('0xd9')][_0x8fca('0x52')](_0x26667b);})[_0x8fca('0x22')](function(_0x280345){_0xeb5c01[_0x8fca('0x53')]=_0x280345;return _0xeb5c01;});}})['then'](respondWithFilteredResult(_0x1b7337,_0x26667b))[_0x8fca('0x54')](handleError(_0x1b7337,null));};exports[_0x8fca('0x12b')]=function(_0x50a017,_0x5118cd,_0x46e19f){return db[_0x8fca('0x3d')][_0x8fca('0x58')]({'where':{'id':_0x50a017['params']['id']}})[_0x8fca('0x22')](handleEntityNotFound(_0x5118cd,null))['then'](function(_0x1d8314){if(_0x1d8314){return _0x1d8314[_0x8fca('0x12b')](_0x50a017[_0x8fca('0x5a')][_0x8fca('0x6a')],_['omit'](_0x50a017['body'],[_0x8fca('0x6a'),'id'])||{})[_0x8fca('0xbc')](function(_0x379334){for(var _0x155f2a=0x0;_0x155f2a<_0x50a017[_0x8fca('0x5a')][_0x8fca('0x6a')]['length'];_0x155f2a+=0x1){socket[_0x8fca('0x12c')]('userChatWebsite:save',{'UserId':Number(_0x50a017[_0x8fca('0x5a')]['ids'][_0x155f2a]),'ChatWebsiteId':Number(_0x50a017['params']['id'])});}return _0x379334;});}})[_0x8fca('0x22')](respondWithResult(_0x5118cd,null))['catch'](handleError(_0x5118cd,null));};exports[_0x8fca('0x12d')]=function(_0x9bda9f,_0x494ea3,_0x500849){return db[_0x8fca('0x3d')]['find']({'where':{'id':_0x9bda9f[_0x8fca('0x61')]['id']}})['then'](handleEntityNotFound(_0x494ea3,null))[_0x8fca('0x22')](function(_0x39ba4e){if(_0x39ba4e){return _0x39ba4e[_0x8fca('0x12d')](_0x9bda9f['query'][_0x8fca('0x6a')])[_0x8fca('0x22')](function(){if(_[_0x8fca('0x12e')](_0x9bda9f[_0x8fca('0x42')][_0x8fca('0x6a')])){for(var _0x9b4f7=0x0;_0x9b4f7<_0x9bda9f['query'][_0x8fca('0x6a')][_0x8fca('0x48')];_0x9b4f7+=0x1){socket[_0x8fca('0x12c')]('userChatWebsite:remove',{'UserId':Number(_0x9bda9f['query'][_0x8fca('0x6a')][_0x9b4f7]),'ChatWebsiteId':Number(_0x9bda9f[_0x8fca('0x61')]['id'])});}}else{socket[_0x8fca('0x12c')](_0x8fca('0x12f'),{'UserId':Number(_0x9bda9f['query'][_0x8fca('0x6a')]),'ChatWebsiteId':Number(_0x9bda9f['params']['id'])});}});}})[_0x8fca('0x22')](respondWithStatusCode(_0x494ea3,null))[_0x8fca('0x54')](handleError(_0x494ea3,null));};exports[_0x8fca('0x130')]=function(_0x537f92,_0x4b2ef7,_0x4c7479){var _0x3a4262={};var _0x164128={};var _0x2cbde0;var _0x5d3c35;return db['ChatWebsite'][_0x8fca('0x6c')]({'where':{'id':_0x537f92['params']['id']}})['then'](handleEntityNotFound(_0x4b2ef7,null))[_0x8fca('0x22')](function(_0x39ae51){if(_0x39ae51){_0x2cbde0=_0x39ae51;_0x164128[_0x8fca('0x41')]=_[_0x8fca('0x43')](db[_0x8fca('0xc6')][_0x8fca('0x3e')]);_0x164128[_0x8fca('0x42')]=_[_0x8fca('0x43')](_0x537f92[_0x8fca('0x42')]);_0x164128[_0x8fca('0x44')]=_[_0x8fca('0x45')](_0x164128[_0x8fca('0x41')],_0x164128[_0x8fca('0x42')]);_0x3a4262[_0x8fca('0x46')]=_[_0x8fca('0x45')](_0x164128[_0x8fca('0x41')],qs[_0x8fca('0x47')](_0x537f92[_0x8fca('0x42')][_0x8fca('0x47')]));_0x3a4262['attributes']=_0x3a4262[_0x8fca('0x46')]['length']?_0x3a4262[_0x8fca('0x46')]:_0x164128[_0x8fca('0x41')];_0x3a4262['order']=qs[_0x8fca('0x4b')](_0x537f92['query'][_0x8fca('0x4b')]);_0x3a4262['where']=qs[_0x8fca('0x44')](_[_0x8fca('0x68')](_0x537f92['query'],_0x164128[_0x8fca('0x44')]));if(_0x537f92[_0x8fca('0x42')][_0x8fca('0x4f')]){_0x3a4262['where']=_['merge'](_0x3a4262[_0x8fca('0x4c')],{'$or':_['map'](_0x3a4262[_0x8fca('0x46')],function(_0x5e71d9){var _0x2fed2b={};_0x2fed2b[_0x5e71d9]={'$like':'%'+_0x537f92[_0x8fca('0x42')]['filter']+'%'};return _0x2fed2b;})});}_0x3a4262=_[_0x8fca('0x4d')]({},_0x3a4262,_0x537f92[_0x8fca('0x50')]);return _0x2cbde0[_0x8fca('0x130')](_0x3a4262);}})[_0x8fca('0x22')](function(_0x344b17){if(_0x344b17){_0x5d3c35=_0x344b17[_0x8fca('0x48')];if(!_0x537f92[_0x8fca('0x42')]['hasOwnProperty'](_0x8fca('0x49'))){_0x3a4262[_0x8fca('0x32')]=qs[_0x8fca('0x32')](_0x537f92[_0x8fca('0x42')][_0x8fca('0x32')]);_0x3a4262[_0x8fca('0x2f')]=qs[_0x8fca('0x2f')](_0x537f92['query'][_0x8fca('0x2f')]);}return _0x2cbde0['getAgents'](_0x3a4262);}})[_0x8fca('0x22')](function(_0x40ae7d){if(_0x40ae7d){return _0x40ae7d?{'count':_0x5d3c35,'rows':_0x40ae7d}:null;}})[_0x8fca('0x22')](respondWithResult(_0x4b2ef7,null))[_0x8fca('0x54')](handleError(_0x4b2ef7,null));}; \ No newline at end of file +var _0x41dc=['moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','params','mandatoryDispositionPause','keys','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','applications','List','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','getInteractions','Contact','Owner','internal','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','addApplications','sequelize','findAndCountAll','getApplications','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise'];(function(_0x174503,_0x3f1c68){var _0x3a3a40=function(_0x2a9d9f){while(--_0x2a9d9f){_0x174503['push'](_0x174503['shift']());}};_0x3a3a40(++_0x3f1c68);}(_0x41dc,0x135));var _0xc41d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x41dc[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xc41d('0x0'));var rimraf=require(_0xc41d('0x1'));var zipdir=require(_0xc41d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc41d('0x3'));var moment=require(_0xc41d('0x4'));var BPromise=require(_0xc41d('0x5'));var Mustache=require(_0xc41d('0x6'));var util=require(_0xc41d('0x7'));var path=require(_0xc41d('0x8'));var sox=require('sox');var csv=require(_0xc41d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc41d('0xa'));var _=require(_0xc41d('0xb'));var squel=require(_0xc41d('0xc'));var crypto=require(_0xc41d('0xd'));var jsforce=require(_0xc41d('0xe'));var deskjs=require(_0xc41d('0xf'));var toCsv=require(_0xc41d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc41d('0x10'));var authService=require(_0xc41d('0x11'));var qs=require(_0xc41d('0x12'));var as=require(_0xc41d('0x13'));var hardwareService=require(_0xc41d('0x14'));var logger=require(_0xc41d('0x15'))('api');var utils=require(_0xc41d('0x16'));var config=require(_0xc41d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc41d('0x18'))['db'];config[_0xc41d('0x19')]=_[_0xc41d('0x1a')](config[_0xc41d('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc41d('0x19')]));require(_0xc41d('0x1b'))[_0xc41d('0x1c')](socket);var jayson=require(_0xc41d('0x1d'));var client=jayson['client'][_0xc41d('0x1e')]({'port':0x232c});var client9002=jayson[_0xc41d('0x1f')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc41d('0x1e')]({'port':0x232b});var client9001=jayson[_0xc41d('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x64000a,_0x5d0810,_0x263fec,_0x22bd3d){return new BPromise(function(_0x3f5c8f,_0x36a809){var _0x527016=_0x22bd3d||client;return _0x527016[_0xc41d('0x20')](_0x64000a,_0x263fec)[_0xc41d('0x21')](function(_0x1907fb){logger[_0xc41d('0x22')](_0xc41d('0x23'),_0x5d0810,_0xc41d('0x24'));logger[_0xc41d('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5d0810,_0xc41d('0x24'),JSON[_0xc41d('0x26')](_0x1907fb));if(_0x1907fb[_0xc41d('0x27')]){if(_0x1907fb['error']['code']===0x1f4){logger[_0xc41d('0x27')](_0xc41d('0x23'),_0x5d0810,_0x1907fb[_0xc41d('0x27')]['message']);return _0x36a809(_0x1907fb[_0xc41d('0x27')][_0xc41d('0x28')]);}logger['error'](_0xc41d('0x23'),_0x5d0810,_0x1907fb['error'][_0xc41d('0x28')]);return _0x3f5c8f(_0x1907fb[_0xc41d('0x27')][_0xc41d('0x28')]);}else{logger[_0xc41d('0x22')](_0xc41d('0x23'),_0x5d0810,_0xc41d('0x24'));_0x3f5c8f(_0x1907fb[_0xc41d('0x29')][_0xc41d('0x28')]);}})[_0xc41d('0x2a')](function(_0x2a64df){logger[_0xc41d('0x27')](_0xc41d('0x23'),_0x5d0810,_0x2a64df);_0x36a809(_0x2a64df);});});}function respondWithStatusCode(_0x4bd280,_0x515f80){_0x515f80=_0x515f80||0xcc;return function(_0x4f0567){if(_0x4f0567){return _0x4bd280[_0xc41d('0x2b')](_0x515f80);}return _0x4bd280[_0xc41d('0x2c')](_0x515f80)[_0xc41d('0x2d')]();};}function respondWithResult(_0x899f0a,_0x46917c){_0x46917c=_0x46917c||0xc8;return function(_0x219656){if(_0x219656){return _0x899f0a[_0xc41d('0x2c')](_0x46917c)[_0xc41d('0x2e')](_0x219656);}};}function respondWithFilteredResult(_0x4c1c54,_0x235930){return function(_0x597b96){if(_0x597b96){var _0x3f97e9=typeof _0x235930[_0xc41d('0x2f')]===_0xc41d('0x30')&&typeof _0x235930['limit']===_0xc41d('0x30');var _0x341863=_0x597b96[_0xc41d('0x31')];var _0x4486fd=_0x3f97e9?0x0:_0x235930['offset'];var _0x38a2b8=_0x3f97e9?_0x597b96['count']:_0x235930[_0xc41d('0x2f')]+_0x235930['limit'];var _0x1a89bf;if(_0x38a2b8>=_0x341863){_0x38a2b8=_0x341863;_0x1a89bf=0xc8;}else{_0x1a89bf=0xce;}_0x4c1c54[_0xc41d('0x2c')](_0x1a89bf);return _0x4c1c54[_0xc41d('0x32')](_0xc41d('0x33'),_0x4486fd+'-'+_0x38a2b8+'/'+_0x341863)[_0xc41d('0x2e')](_0x597b96);}return null;};}function patchUpdates(_0x55127d){return function(_0x3e47f6){try{jsonpatch[_0xc41d('0x34')](_0x3e47f6,_0x55127d,!![]);}catch(_0x287962){return BPromise['reject'](_0x287962);}return _0x3e47f6[_0xc41d('0x35')]();};}function saveUpdates(_0x2c9279,_0x3c3790){return function(_0x45f454){if(_0x45f454){return _0x45f454[_0xc41d('0x36')](_0x2c9279)[_0xc41d('0x21')](function(_0x5b0dc5){return _0x5b0dc5;});}return null;};}function removeEntity(_0x52987e,_0x3bb788){return function(_0x2d89ce){if(_0x2d89ce){return _0x2d89ce[_0xc41d('0x37')]()[_0xc41d('0x21')](function(){var _0x32a0c9=_0x2d89ce[_0xc41d('0x38')]({'plain':!![]});var _0x3e471e='ChatWebsites';return db[_0xc41d('0x39')][_0xc41d('0x37')]({'where':{'type':_0x3e471e,'resourceId':_0x32a0c9['id']}})[_0xc41d('0x21')](function(){return _0x2d89ce;});})[_0xc41d('0x21')](function(){_0x52987e[_0xc41d('0x2c')](0xcc)[_0xc41d('0x2d')]();});}};}function handleEntityNotFound(_0x52f66f,_0x38e876){return function(_0x3dc9ab){if(!_0x3dc9ab){_0x52f66f[_0xc41d('0x2b')](0x194);}return _0x3dc9ab;};}function handleError(_0x878ee6,_0x3b1520){_0x3b1520=_0x3b1520||0x1f4;return function(_0x242dee){logger[_0xc41d('0x27')](_0x242dee[_0xc41d('0x3a')]);if(_0x242dee[_0xc41d('0x3b')]){delete _0x242dee['name'];}_0x878ee6[_0xc41d('0x2c')](_0x3b1520)[_0xc41d('0x3c')](_0x242dee);};}exports['index']=function(_0x4e835b,_0x44593b){var _0x4ec1f0={'include':[{'model':db[_0xc41d('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1abbcf={},_0x11adef={'count':0x0,'rows':[]};var _0x1acf94=_[_0xc41d('0x3e')](db[_0xc41d('0x3f')][_0xc41d('0x40')],function(_0x4b97f7){return{'name':_0x4b97f7['fieldName'],'type':_0x4b97f7[_0xc41d('0x41')]['key']};});_0x1abbcf[_0xc41d('0x42')]=_['map'](_0x1acf94,_0xc41d('0x3b'));_0x1abbcf[_0xc41d('0x43')]=_['keys'](_0x4e835b[_0xc41d('0x43')]);_0x1abbcf[_0xc41d('0x44')]=_['intersection'](_0x1abbcf['model'],_0x1abbcf[_0xc41d('0x43')]);_0x4ec1f0[_0xc41d('0x45')]=_[_0xc41d('0x46')](_0x1abbcf[_0xc41d('0x42')],qs[_0xc41d('0x47')](_0x4e835b[_0xc41d('0x43')][_0xc41d('0x47')]));_0x4ec1f0[_0xc41d('0x45')]=_0x4ec1f0[_0xc41d('0x45')][_0xc41d('0x48')]?_0x4ec1f0[_0xc41d('0x45')]:_0x1abbcf[_0xc41d('0x42')];if(!_0x4e835b[_0xc41d('0x43')]['hasOwnProperty'](_0xc41d('0x49'))){_0x4ec1f0['limit']=qs[_0xc41d('0x4a')](_0x4e835b[_0xc41d('0x43')]['limit']);_0x4ec1f0[_0xc41d('0x2f')]=qs['offset'](_0x4e835b[_0xc41d('0x43')][_0xc41d('0x2f')]);}_0x4ec1f0[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0x4e835b[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x4ec1f0[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_[_0xc41d('0x4e')](_0x4e835b['query'],_0x1abbcf[_0xc41d('0x44')]),_0x1acf94);if(_0x4e835b[_0xc41d('0x43')][_0xc41d('0x4f')]){_0x4ec1f0['where']=_[_0xc41d('0x50')](_0x4ec1f0[_0xc41d('0x4d')],{'$or':_['map'](_0x1acf94,function(_0x4cf2c1){if(_0x4cf2c1[_0xc41d('0x41')]!=='VIRTUAL'){var _0x57e44b={};_0x57e44b[_0x4cf2c1[_0xc41d('0x3b')]]={'$like':'%'+_0x4e835b[_0xc41d('0x43')][_0xc41d('0x4f')]+'%'};return _0x57e44b;}})});}_0x4ec1f0=_[_0xc41d('0x50')]({},_0x4ec1f0,_0x4e835b['options']);var _0x212a61={'where':_0x4ec1f0[_0xc41d('0x4d')]};return db['ChatWebsite'][_0xc41d('0x31')](_0x212a61)[_0xc41d('0x21')](function(_0x3242c8){_0x11adef[_0xc41d('0x31')]=_0x3242c8;if(_0x4e835b['query'][_0xc41d('0x51')]){_0x4ec1f0[_0xc41d('0x52')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x4ec1f0);})[_0xc41d('0x21')](function(_0x2af2d4){_0x11adef['rows']=_0x2af2d4;return _0x11adef;})['then'](respondWithFilteredResult(_0x44593b,_0x4ec1f0))[_0xc41d('0x2a')](handleError(_0x44593b,null));};exports['show']=function(_0xb6a893,_0x439cfa){var _0x52da67={'raw':![],'where':{'id':_0xb6a893[_0xc41d('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xc41d('0x54')}]},_0x354115={};_0x354115[_0xc41d('0x42')]=_[_0xc41d('0x55')](db[_0xc41d('0x3f')][_0xc41d('0x40')]);_0x354115['query']=_[_0xc41d('0x55')](_0xb6a893[_0xc41d('0x43')]);_0x354115[_0xc41d('0x44')]=_['intersection'](_0x354115[_0xc41d('0x42')],_0x354115['query']);_0x52da67['attributes']=_[_0xc41d('0x46')](_0x354115[_0xc41d('0x42')],qs[_0xc41d('0x47')](_0xb6a893[_0xc41d('0x43')][_0xc41d('0x47')]));_0x52da67[_0xc41d('0x45')]=_0x52da67['attributes'][_0xc41d('0x48')]?_0x52da67[_0xc41d('0x45')]:_0x354115[_0xc41d('0x42')];if(_0xb6a893[_0xc41d('0x43')]['includeAll']){_0x52da67[_0xc41d('0x52')]=[{'all':!![]}];}_0x52da67=_['merge']({},_0x52da67,_0xb6a893[_0xc41d('0x56')]);return db[_0xc41d('0x3f')][_0xc41d('0x57')](_0x52da67)['then'](handleEntityNotFound(_0x439cfa,null))[_0xc41d('0x21')](respondWithResult(_0x439cfa,null))[_0xc41d('0x2a')](handleError(_0x439cfa,null));};exports['create']=function(_0x42f113,_0x297e83){return db[_0xc41d('0x3f')]['create'](_0x42f113['body'],{})['then'](function(_0x301ee5){var _0x20f542=_0x42f113[_0xc41d('0x58')][_0xc41d('0x38')]({'plain':!![]});if(!_0x20f542)throw new Error(_0xc41d('0x59'));if(_0x20f542[_0xc41d('0x5a')]==='user'){var _0x37e089=_0x301ee5[_0xc41d('0x38')]({'plain':!![]});var _0x1826be='ChatWebsites';return db['UserProfileSection'][_0xc41d('0x57')]({'where':{'name':_0x1826be,'userProfileId':_0x20f542[_0xc41d('0x5b')]},'raw':!![]})[_0xc41d('0x21')](function(_0x33c806){if(_0x33c806&&_0x33c806[_0xc41d('0x5c')]===0x0){return db[_0xc41d('0x39')][_0xc41d('0x5d')]({'name':_0x37e089['name'],'resourceId':_0x37e089['id'],'type':_0x33c806[_0xc41d('0x3b')],'sectionId':_0x33c806['id']},{})[_0xc41d('0x21')](function(){return _0x301ee5;});}else{return _0x301ee5;}})[_0xc41d('0x2a')](function(_0x5e03e1){logger[_0xc41d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e03e1);throw _0x5e03e1;});}return _0x301ee5;})[_0xc41d('0x21')](respondWithResult(_0x297e83,0xc9))[_0xc41d('0x2a')](handleError(_0x297e83,null));};exports['update']=function(_0x3a73f2,_0x43e933){if(_0x3a73f2['body']['id']){delete _0x3a73f2[_0xc41d('0x5e')]['id'];}return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0x3a73f2[_0xc41d('0x53')]['id']},'include':[{'model':db[_0xc41d('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xc41d('0x21')](handleEntityNotFound(_0x43e933,null))[_0xc41d('0x21')](saveUpdates(_0x3a73f2[_0xc41d('0x5e')],null))['then'](respondWithResult(_0x43e933,null))['catch'](handleError(_0x43e933,null));};exports['destroy']=function(_0x2abe33,_0x109e4e){return db[_0xc41d('0x3f')]['find']({'where':{'id':_0x2abe33[_0xc41d('0x53')]['id']}})['then'](handleEntityNotFound(_0x109e4e,null))[_0xc41d('0x21')](removeEntity(_0x109e4e,null))[_0xc41d('0x2a')](handleError(_0x109e4e,null));};exports['describe']=function(_0x3dedf8,_0x1d7e11){return db[_0xc41d('0x3f')][_0xc41d('0x5f')]()['then'](respondWithResult(_0x1d7e11,null))[_0xc41d('0x2a')](handleError(_0x1d7e11,null));};exports[_0xc41d('0x60')]=function(_0x54166c,_0x3beb61,_0x332444){if(_0x54166c[_0xc41d('0x5e')]['id']){delete _0x54166c[_0xc41d('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x54166c[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x3beb61,null))['then'](function(_0x8af6fb){if(_0x8af6fb){_0x54166c['body'][_0xc41d('0x61')]=_0x8af6fb['id'];return db[_0xc41d('0x62')][_0xc41d('0x5d')](_0x54166c['body']);}})[_0xc41d('0x21')](respondWithResult(_0x3beb61,null))[_0xc41d('0x2a')](handleError(_0x3beb61,null));};exports[_0xc41d('0x63')]=function(_0x3254c1,_0x331b95,_0x35f533){var _0x2f1038={'raw':![],'where':{}};var _0x1cf5d2={};var _0x3fffd4={'count':0x0,'rows':[]};return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x3254c1[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x331b95,null))['then'](function(_0x1154d9){if(_0x1154d9){_0x1cf5d2[_0xc41d('0x42')]=_[_0xc41d('0x55')](db[_0xc41d('0x62')][_0xc41d('0x40')]);_0x1cf5d2['query']=_['keys'](_0x3254c1[_0xc41d('0x43')]);_0x1cf5d2['filters']=_['intersection'](_0x1cf5d2[_0xc41d('0x42')],_0x1cf5d2[_0xc41d('0x43')]);_0x2f1038['attributes']=_['intersection'](_0x1cf5d2[_0xc41d('0x42')],qs['fields'](_0x3254c1[_0xc41d('0x43')][_0xc41d('0x47')]));_0x2f1038[_0xc41d('0x45')]=_0x2f1038[_0xc41d('0x45')][_0xc41d('0x48')]?_0x2f1038['attributes']:_0x1cf5d2[_0xc41d('0x42')];if(!_0x3254c1[_0xc41d('0x43')][_0xc41d('0x65')](_0xc41d('0x49'))){_0x2f1038['limit']=qs[_0xc41d('0x4a')](_0x3254c1[_0xc41d('0x43')]['limit']);_0x2f1038[_0xc41d('0x2f')]=qs['offset'](_0x3254c1[_0xc41d('0x43')][_0xc41d('0x2f')]);}_0x2f1038['order']=qs[_0xc41d('0x4c')](_0x3254c1[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x2f1038[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_[_0xc41d('0x4e')](_0x3254c1[_0xc41d('0x43')],_0x1cf5d2['filters']));_0x2f1038['where'][_0xc41d('0x61')]=_0x1154d9['id'];if(_0x3254c1['query']['filter']){_0x2f1038[_0xc41d('0x4d')]=_[_0xc41d('0x50')](_0x2f1038[_0xc41d('0x4d')],{'$or':_[_0xc41d('0x3e')](_0x2f1038[_0xc41d('0x45')],function(_0x2a0ef3){var _0x5ca1b3={};_0x5ca1b3[_0x2a0ef3]={'$like':'%'+_0x3254c1['query']['filter']+'%'};return _0x5ca1b3;})});}_0x2f1038=_['merge']({},_0x2f1038,_0x3254c1['options']);return db[_0xc41d('0x62')]['count']({'where':_0x2f1038[_0xc41d('0x4d')]})['then'](function(_0x280a14){_0x3fffd4['count']=_0x280a14;if(_0x3254c1[_0xc41d('0x43')]['includeAll']){_0x2f1038[_0xc41d('0x52')]=[{'all':!![]}];}return db[_0xc41d('0x62')]['findAll'](_0x2f1038);})[_0xc41d('0x21')](function(_0xc30555){_0x3fffd4[_0xc41d('0x66')]=_0xc30555;return _0x3fffd4;});}})[_0xc41d('0x21')](respondWithFilteredResult(_0x331b95,_0x2f1038))[_0xc41d('0x2a')](handleError(_0x331b95,null));};exports[_0xc41d('0x67')]=function(_0x32c4e2,_0x3f7118,_0x5bb09e){return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0x32c4e2[_0xc41d('0x53')]['id']}})['then'](handleEntityNotFound(_0x3f7118,null))[_0xc41d('0x21')](function(_0x50b6ea){if(_0x50b6ea){return _0x50b6ea[_0xc41d('0x67')](_0x32c4e2[_0xc41d('0x43')][_0xc41d('0x68')]);}})[_0xc41d('0x21')](respondWithStatusCode(_0x3f7118,null))['catch'](handleError(_0x3f7118,null));};exports[_0xc41d('0x69')]=function(_0x3eaf38,_0x48dc48,_0x4a808a){if(_0x3eaf38[_0xc41d('0x5e')]['id']){delete _0x3eaf38['body']['id'];}return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x3eaf38['params']['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x48dc48,null))[_0xc41d('0x21')](function(_0x1f490d){if(_0x1f490d){_0x3eaf38[_0xc41d('0x5e')]['ChatWebsiteId']=_0x1f490d['id'];return db[_0xc41d('0x6a')][_0xc41d('0x5d')](_0x3eaf38['body']);}})[_0xc41d('0x21')](respondWithResult(_0x48dc48,null))['catch'](handleError(_0x48dc48,null));};exports[_0xc41d('0x6b')]=function(_0x37c434,_0x1bd684,_0x41b7ac){var _0x425152={'raw':![],'where':{}};var _0x18b882={};var _0x139eed={'count':0x0,'rows':[]};return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x37c434[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x1bd684,null))[_0xc41d('0x21')](function(_0x36946d){if(_0x36946d){_0x18b882['model']=_[_0xc41d('0x55')](db[_0xc41d('0x6a')][_0xc41d('0x40')]);_0x18b882[_0xc41d('0x43')]=_[_0xc41d('0x55')](_0x37c434[_0xc41d('0x43')]);_0x18b882[_0xc41d('0x44')]=_['intersection'](_0x18b882[_0xc41d('0x42')],_0x18b882[_0xc41d('0x43')]);_0x425152['attributes']=_[_0xc41d('0x46')](_0x18b882['model'],qs['fields'](_0x37c434['query']['fields']));_0x425152['attributes']=_0x425152['attributes'][_0xc41d('0x48')]?_0x425152[_0xc41d('0x45')]:_0x18b882[_0xc41d('0x42')];if(!_0x37c434[_0xc41d('0x43')][_0xc41d('0x65')](_0xc41d('0x49'))){_0x425152[_0xc41d('0x4a')]=qs['limit'](_0x37c434[_0xc41d('0x43')][_0xc41d('0x4a')]);_0x425152[_0xc41d('0x2f')]=qs[_0xc41d('0x2f')](_0x37c434[_0xc41d('0x43')]['offset']);}_0x425152[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0x37c434[_0xc41d('0x43')]['sort']);_0x425152[_0xc41d('0x4d')]=qs['filters'](_[_0xc41d('0x4e')](_0x37c434[_0xc41d('0x43')],_0x18b882[_0xc41d('0x44')]));_0x425152[_0xc41d('0x4d')]['ChatWebsiteId']=_0x36946d['id'];if(_0x37c434[_0xc41d('0x43')]['filter']){_0x425152[_0xc41d('0x4d')]=_[_0xc41d('0x50')](_0x425152[_0xc41d('0x4d')],{'$or':_['map'](_0x425152['attributes'],function(_0x33b4a5){var _0xd0cba0={};_0xd0cba0[_0x33b4a5]={'$like':'%'+_0x37c434[_0xc41d('0x43')]['filter']+'%'};return _0xd0cba0;})});}_0x425152=_['merge']({},_0x425152,_0x37c434['options']);return db[_0xc41d('0x6a')][_0xc41d('0x31')]({'where':_0x425152[_0xc41d('0x4d')]})[_0xc41d('0x21')](function(_0x58ef3e){_0x139eed[_0xc41d('0x31')]=_0x58ef3e;if(_0x37c434[_0xc41d('0x43')][_0xc41d('0x51')]){_0x425152[_0xc41d('0x52')]=[{'all':!![]}];}return db[_0xc41d('0x6a')][_0xc41d('0x6c')](_0x425152);})[_0xc41d('0x21')](function(_0x32fb7d){_0x139eed[_0xc41d('0x66')]=_0x32fb7d;return _0x139eed;});}})[_0xc41d('0x21')](respondWithFilteredResult(_0x1bd684,_0x425152))[_0xc41d('0x2a')](handleError(_0x1bd684,null));};exports[_0xc41d('0x6d')]=function(_0x59e326,_0x4c39df,_0xe3f9fa){return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x59e326['params']['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x4c39df,null))[_0xc41d('0x21')](function(_0x5447d3){if(_0x5447d3){return _0x5447d3[_0xc41d('0x6d')](_0x59e326['query'][_0xc41d('0x68')]);}})[_0xc41d('0x21')](respondWithStatusCode(_0x4c39df,null))['catch'](handleError(_0x4c39df,null));};exports[_0xc41d('0x6e')]=function(_0xb01f57,_0x33ac2f,_0x44a933){_0xb01f57[_0xc41d('0x5e')][_0xc41d('0x6f')]=_0xb01f57[_0xc41d('0x70')][_0xc41d('0x71')];return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0xb01f57['params']['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x33ac2f,null))[_0xc41d('0x21')](saveUpdates(_0xb01f57['body'],null))[_0xc41d('0x21')](respondWithResult(_0x33ac2f,null))[_0xc41d('0x2a')](handleError(_0x33ac2f,null));};exports[_0xc41d('0x72')]=function(_0x31d544,_0x2b2fa1,_0x41a692){_0x31d544[_0xc41d('0x5e')][_0xc41d('0x73')]=_0x31d544[_0xc41d('0x70')]['filename'];return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x31d544[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x2b2fa1,null))[_0xc41d('0x21')](saveUpdates(_0x31d544[_0xc41d('0x5e')],null))[_0xc41d('0x21')](respondWithResult(_0x2b2fa1,null))[_0xc41d('0x2a')](handleError(_0x2b2fa1,null));};exports[_0xc41d('0x74')]=function(_0x22c19f,_0x5d3125,_0x13ed53){_0x22c19f[_0xc41d('0x5e')][_0xc41d('0x75')]=_0x22c19f[_0xc41d('0x70')]['filename'];return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x22c19f[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x5d3125,null))[_0xc41d('0x21')](saveUpdates(_0x22c19f['body'],null))[_0xc41d('0x21')](respondWithResult(_0x5d3125,null))[_0xc41d('0x2a')](handleError(_0x5d3125,null));};exports[_0xc41d('0x76')]=function(_0xe34546,_0x3868da,_0x2bea13){_0xe34546[_0xc41d('0x5e')][_0xc41d('0x77')]=_0xe34546[_0xc41d('0x70')]['filename'];return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0xe34546[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x3868da,null))[_0xc41d('0x21')](saveUpdates(_0xe34546[_0xc41d('0x5e')],null))[_0xc41d('0x21')](respondWithResult(_0x3868da,null))[_0xc41d('0x2a')](handleError(_0x3868da,null));};exports[_0xc41d('0x78')]=function(_0x3ec91b,_0xa54373,_0x341446){var _0x13a15e=path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x7b'));var _0x1e0826={'where':{'id':_0x3ec91b['params']['id']},'attributes':['id',_0xc41d('0x6f')],'raw':!![]};var _0x47e245=![];return require(_0xc41d('0x7c'))[_0xc41d('0x7d')]()[_0xc41d('0x21')](function(_0x42bfb0){if(_0x42bfb0){_0x47e245=_0x42bfb0[_0xc41d('0x7e')];}})['then'](function(){return db[_0xc41d('0x3f')]['find'](_0x1e0826);})[_0xc41d('0x21')](handleEntityNotFound(_0xa54373,null))[_0xc41d('0x21')](function(_0x447b8a){if(_0x447b8a){if(!_[_0xc41d('0x7f')](_0x447b8a[_0xc41d('0x6f')])){if(fs[_0xc41d('0x80')](path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x81'),_0x447b8a[_0xc41d('0x6f')]))&&_0x47e245){_0x13a15e=path[_0xc41d('0x79')](config[_0xc41d('0x7a')],'server/files/images/logos/',_0x447b8a[_0xc41d('0x6f')]);}}return _0xa54373[_0xc41d('0x82')](_0x13a15e);}})[_0xc41d('0x2a')](handleError(_0xa54373,null));};exports[_0xc41d('0x83')]=function(_0x30c8d3,_0x5246d8,_0x249ca7){var _0xe75762=path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x84'));var _0x191ed2={'where':{'id':_0x30c8d3[_0xc41d('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc41d('0x57')](_0x191ed2)[_0xc41d('0x21')](handleEntityNotFound(_0x5246d8,null))[_0xc41d('0x21')](function(_0xeeeb4b){if(_0xeeeb4b){if(!_[_0xc41d('0x7f')](_0xeeeb4b[_0xc41d('0x73')])){if(fs['existsSync'](path['join'](config[_0xc41d('0x7a')],'server/files/images/avatars/',_0xeeeb4b['agentAvatar']))){_0xe75762=path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x85'),_0xeeeb4b[_0xc41d('0x73')]);}}return _0x5246d8['download'](_0xe75762);}})['catch'](handleError(_0x5246d8,null));};exports[_0xc41d('0x86')]=function(_0x18a72e,_0x47f3e0,_0x5cd4ed){var _0x387391=path['join'](config[_0xc41d('0x7a')],_0xc41d('0x87'));var _0x20f1d3={'where':{'id':_0x18a72e[_0xc41d('0x53')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc41d('0x57')](_0x20f1d3)[_0xc41d('0x21')](handleEntityNotFound(_0x47f3e0,null))[_0xc41d('0x21')](function(_0x5a944d){if(_0x5a944d){if(!_[_0xc41d('0x7f')](_0x5a944d[_0xc41d('0x75')])){if(fs[_0xc41d('0x80')](path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x85'),_0x5a944d[_0xc41d('0x75')]))&&_0x5a944d[_0xc41d('0x88')]){_0x387391=path['join'](config[_0xc41d('0x7a')],_0xc41d('0x85'),_0x5a944d[_0xc41d('0x75')]);}}return _0x47f3e0[_0xc41d('0x82')](_0x387391);}})['catch'](handleError(_0x47f3e0,null));};exports[_0xc41d('0x89')]=function(_0x9ed214,_0x57faf8,_0x51062d){var _0x17adf7=path[_0xc41d('0x79')](config['root'],_0xc41d('0x8a'));var _0x5609dd={'where':{'id':_0x9ed214['params']['id']},'attributes':['id',_0xc41d('0x77')],'raw':!![]};return db[_0xc41d('0x3f')]['find'](_0x5609dd)[_0xc41d('0x21')](handleEntityNotFound(_0x57faf8,null))[_0xc41d('0x21')](function(_0x5a0d45){if(_0x5a0d45){if(!_['isNil'](_0x5a0d45['systemAvatar'])){if(fs['existsSync'](path[_0xc41d('0x79')](config[_0xc41d('0x7a')],'server/files/images/avatars/',_0x5a0d45[_0xc41d('0x77')]))){_0x17adf7=path['join'](config[_0xc41d('0x7a')],_0xc41d('0x85'),_0x5a0d45[_0xc41d('0x77')]);}}return _0x57faf8[_0xc41d('0x82')](_0x17adf7);}})[_0xc41d('0x2a')](handleError(_0x57faf8,null));};exports['notify']=function(_0xd68550,_0xe66d85,_0x33785c){var _0x2f2729=require('user-agent-parser');var _0x5e58c5=new _0x2f2729();var _0x5f4873=_0x5e58c5[_0xc41d('0x8b')](_0xd68550[_0xc41d('0x8c')][_0xc41d('0x8d')])[_0xc41d('0x8e')]();var _0x2a43b2={'body':_0xd68550[_0xc41d('0x5e')],'channel':_0xc41d('0x8f')};var _0x34f0c0=[];var _0x54111e=[];var _0x1555c2={};var _0x511e08=![];return db[_0xc41d('0x90')][_0xc41d('0x5f')]()['then'](function(_0x37a0d0){if(!_0x37a0d0){throw new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0x93'));}_0x34f0c0=_[_0xc41d('0x94')](_[_0xc41d('0x55')](_0x37a0d0),['createdAt',_0xc41d('0x95')]);_0x54111e=_[_0xc41d('0x94')](_['keys'](_0x37a0d0),['createdAt','updatedAt',_0xc41d('0x96'),_0xc41d('0x97')]);if(_0xd68550[_0xc41d('0x5e')]['id']){delete _0xd68550[_0xc41d('0x5e')]['id'];}if(_[_0xc41d('0x7f')](_0xd68550[_0xc41d('0x5e')][_0xc41d('0x98')])){throw new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))]('from\x20is\x20mandatory');}if(_['isNil'](_0xd68550[_0xc41d('0x5e')][_0xc41d('0x5e')])||_0xd68550[_0xc41d('0x5e')][_0xc41d('0x5e')]===''){throw new db['Sequelize'][(_0xc41d('0x92'))](_0xc41d('0x99'));}if(_['isNil'](_0xd68550[_0xc41d('0x5e')][_0xc41d('0x9a')])){throw new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0x9b')+_0x54111e);}if(!_[_0xc41d('0x9c')](_0x54111e,_0xd68550[_0xc41d('0x5e')]['mapKey'])){throw new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0x9d')+_0x54111e);}_0x1555c2[_0xd68550[_0xc41d('0x5e')]['mapKey']]=_0xd68550['body']['from'];})[_0xc41d('0x21')](function(){return db[_0xc41d('0x3f')]['find']({'where':{'id':_0xd68550['params']['id']},'include':[{'model':db[_0xc41d('0x9e')],'as':'List','include':[{'model':db[_0xc41d('0x90')],'as':_0xc41d('0x9f'),'where':_0x1555c2,'limit':0x1,'order':[[_0xc41d('0x95'),_0xc41d('0xa0')]]}]},{'model':db[_0xc41d('0xa1')],'as':_0xc41d('0xa2')}]});})['then'](handleEntityNotFound(_0xe66d85,null))[_0xc41d('0x21')](function(_0x428bba){if(_0x428bba&&_0x428bba['List']){_0x2a43b2['account']=_0x428bba;_0x2a43b2[_0xc41d('0xa3')]=_0x428bba['Applications'];_0x2a43b2['list']=_0x428bba[_0xc41d('0xa4')];_0x2a43b2['applications']=_[_0xc41d('0xa5')](_0x2a43b2['applications'],[_0xc41d('0xa6')],[_0xc41d('0xa7')]);if(_0x2a43b2[_0xc41d('0xa8')]['Applications']){delete _0x2a43b2[_0xc41d('0xa8')][_0xc41d('0xa2')];}if(_0x2a43b2[_0xc41d('0xa8')]['List']&&_0x2a43b2[_0xc41d('0xa8')]['List'][_0xc41d('0x9f')][_0xc41d('0x48')]){return _0x2a43b2['account'][_0xc41d('0xa4')]['Contacts'][0x0];}var _0x2e9359=_[_0xc41d('0x1a')](_0xd68550[_0xc41d('0x5e')],{'firstName':_0xd68550[_0xc41d('0x5e')][_0xc41d('0x98')],'ListId':_0x428bba[_0xc41d('0x97')]});_0x2e9359[_0xd68550[_0xc41d('0x5e')]['mapKey']]=_0xd68550[_0xc41d('0x5e')]['from'];return db[_0xc41d('0x90')][_0xc41d('0x5d')](_0x2e9359,{'fields':_0x34f0c0,'raw':!![]});}})['then'](handleEntityNotFound(_0xe66d85,null))[_0xc41d('0x21')](function(_0x59061f){_0x2a43b2[_0xc41d('0xa9')]=_0x59061f;var _0x4172a7=_0xd68550['body'][_0xc41d('0xaa')];if(_0xd68550['headers'][_0xc41d('0xab')]){_0x4172a7=_0xd68550[_0xc41d('0x8c')]['cf-connecting-ip'];}else if(_0xd68550[_0xc41d('0x8c')][_0xc41d('0xac')]){_0x4172a7=_[_0xc41d('0xad')](_0xd68550[_0xc41d('0x8c')][_0xc41d('0xac')][_0xc41d('0xae')](','));}if(_0x59061f){var _0x2ea128={'ContactId':_0x59061f['id'],'ChatWebsiteId':_0xd68550[_0xc41d('0x53')]['id'],'from':(_0x59061f[_0xc41d('0xaf')]||'')+'\x20'+(_0x59061f[_0xc41d('0xb0')]||''),'customerIp':_0x4172a7,'customerPort':_0xd68550[_0xc41d('0x8c')][_0xc41d('0xb1')]?_0xd68550[_0xc41d('0x8c')][_0xc41d('0xb1')]:null,'referer':_0xd68550['body'][_0xc41d('0xb2')],'browserName':_0x5f4873[_0xc41d('0xb3')][_0xc41d('0x3b')]&&_0x5f4873['browser'][_0xc41d('0xb4')]?util['format'](_0xc41d('0xb5'),_0x5f4873[_0xc41d('0xb3')][_0xc41d('0x3b')],_0x5f4873[_0xc41d('0xb3')][_0xc41d('0xb4')]):_0xc41d('0xb6'),'browserVersion':_0x5f4873[_0xc41d('0xb3')][_0xc41d('0xb4')]||'unknown','osName':util[_0xc41d('0xb7')](_0xc41d('0xb5'),_0x5f4873['os']['name'],_0x5f4873['os'][_0xc41d('0xb4')]),'osVersion':_0x5f4873['os']['version'],'deviceModel':_0x5f4873[_0xc41d('0xb8')][_0xc41d('0x42')]&&_0x5f4873[_0xc41d('0xb8')][_0xc41d('0xb9')]?util[_0xc41d('0xb7')](_0xc41d('0xba'),_0x5f4873[_0xc41d('0xb8')][_0xc41d('0x42')],_0x5f4873[_0xc41d('0xb8')]['vendor'],_0x5f4873['device'][_0xc41d('0x41')]):null,'deviceVendor':_0x5f4873[_0xc41d('0xb8')][_0xc41d('0xb9')],'deviceType':_0x5f4873[_0xc41d('0xb8')]['type'],'formData':JSON[_0xc41d('0x26')](_0xd68550[_0xc41d('0x5e')])};var _0x5a86c8={'ChatWebsiteId':_0xd68550[_0xc41d('0x53')]['id'],'closed':![]};if(_0xd68550[_0xc41d('0x5e')][_0xc41d('0xbb')]){_0x5a86c8[_0xc41d('0xbb')]=_0xd68550[_0xc41d('0x5e')]['threadId'];return db[_0xc41d('0xbc')][_0xc41d('0x57')]({'where':_0x5a86c8})[_0xc41d('0x21')](function(_0x20a32c){if(_0x20a32c){return[_0x20a32c,![]];}_0x2ea128[_0xc41d('0xbb')]=_0xd68550[_0xc41d('0x5e')][_0xc41d('0xbb')];_0x2ea128[_0xc41d('0xbd')]=_0xd68550['body'][_0xc41d('0xbd')];return db['ChatInteraction']['create'](_0x2ea128)[_0xc41d('0x21')](function(_0x160570){return[_0x160570,!![]];});});}_0x5a86c8['ContactId']=_0x59061f['id'];if(_0xd68550['body']['interaction']&&_0xd68550['body'][_0xc41d('0xbe')]['id']){_0x5a86c8['id']=_0xd68550[_0xc41d('0x5e')]['interaction']['id'];return db[_0xc41d('0xbc')]['find']({'where':_0x5a86c8})[_0xc41d('0x21')](function(_0x385d06){if(_0x385d06){return[_0x385d06,![]];}return db['ChatInteraction']['create'](_0x2ea128)['then'](function(_0x262e36){return[_0x262e36,!![]];});});}return db[_0xc41d('0xbc')][_0xc41d('0x5d')](_0x2ea128)['then'](function(_0x3fe88b){return[_0x3fe88b,!![]];});}})[_0xc41d('0xbf')](function(_0x2c3033,_0x2fe937){if(_0x2c3033){_0x511e08=_0x2fe937;if(!_0x2fe937){var _0x20c271={'from':(_0x2a43b2['contact'][_0xc41d('0xaf')]||'')+'\x20'+(_0x2a43b2['contact'][_0xc41d('0xb0')]||'')};if(_0xd68550[_0xc41d('0x5e')][_0xc41d('0xbb')]&&_0xd68550[_0xc41d('0x5e')][_0xc41d('0xc0')]&&_0xd68550[_0xc41d('0x5e')][_0xc41d('0xbb')]!=_0xd68550[_0xc41d('0x5e')][_0xc41d('0xc0')]){_0x20c271['threadId']=_0xd68550[_0xc41d('0x5e')][_0xc41d('0xc0')];}return _0x2c3033[_0xc41d('0x36')](_0x20c271);}else{return _0x2c3033;}}})[_0xc41d('0x21')](function(_0x1262fa){_0x2a43b2[_0xc41d('0xbe')]=_0x1262fa['get']({'plain':!![]});_0x2a43b2[_0xc41d('0xbe')][_0xc41d('0xc1')]=_0x511e08;if(_0x2a43b2[_0xc41d('0xbe')][_0xc41d('0xc1')]){if(_0x2a43b2[_0xc41d('0xa8')][_0xc41d('0xc2')]){_0x2a43b2[_0xc41d('0xa3')][_0xc41d('0xc3')]({'id':0x0,'priority':_0x2a43b2[_0xc41d('0xa3')][_0xc41d('0x48')]+0x1,'app':_0xc41d('0xc4'),'appdata':_0xc41d('0xc5'),'interval':_0xc41d('0xc6')});}}return db[_0xc41d('0xc7')]['create']({'body':_0xd68550[_0xc41d('0x5e')]['body'],'ChatWebsiteId':_0xd68550['params']['id'],'ChatInteractionId':_0x1262fa['id'],'direction':'in','ContactId':_0x2a43b2[_0xc41d('0xa9')]['id'],'AttachmentId':_0xd68550['body'][_0xc41d('0xc8')]});})['then'](function(_0x447c7c){_0x2a43b2[_0xc41d('0x28')]=_0x447c7c;if(_0x2a43b2[_0xc41d('0xbe')][_0xc41d('0xc9')]){return db['User'][_0xc41d('0x57')]({'attributes':['id',_0xc41d('0x3b')],'where':{'id':_0x2a43b2['interaction'][_0xc41d('0xc9')]}})[_0xc41d('0x21')](function(_0x2a306d){if(_0x2a306d){_0x2a43b2[_0xc41d('0xa3')][_0xc41d('0xca')]({'id':0x0,'priority':0x0,'app':_0xc41d('0xcb'),'appdata':_0x2a306d['name']+','+(_0x2a43b2['account'][_0xc41d('0xcc')]||0xa),'interval':_0xc41d('0xc6')});_0x2a43b2[_0xc41d('0xcd')]=!![];}return respondWithRpcPromise('Start',_0xc41d('0xce'),_0x2a43b2);});}return respondWithRpcPromise(_0xc41d('0xcf'),'startRouting',_0x2a43b2);})['then'](function(_0x3f2bf9){respondWithRpcPromise(_0xc41d('0xd0'),'EventManager',{'event':_0xc41d('0xd1'),'message':_0x3f2bf9},client9002);return _0x3f2bf9;})[_0xc41d('0x21')](respondWithResult(_0xe66d85,null))[_0xc41d('0x2a')](handleError(_0xe66d85,null));};exports['offline']=function(_0x208943,_0x17a88a,_0x21c94d){var _0x4b3f18,_0x27ac09,_0x16db72;var _0x56a867=[];var _0x4d7e48=[];var _0x3f7ad9={};var _0x483c48=_0x208943[_0xc41d('0xd2')]||[];var _0x286776=[];var _0x4fd682;return db[_0xc41d('0x90')][_0xc41d('0x5f')]()[_0xc41d('0x21')](function(_0x3938cf){if(!_0x3938cf){throw new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0x93'));}_0x4d7e48=_['difference'](_[_0xc41d('0x55')](_0x3938cf),['createdAt','updatedAt']);_0x56a867=_[_0xc41d('0x94')](_[_0xc41d('0x55')](_0x3938cf),[_0xc41d('0xd3'),_0xc41d('0x95'),'CompanyId',_0xc41d('0x97')]);if(_0x208943['body']['id']){delete _0x208943[_0xc41d('0x5e')]['id'];}if(_[_0xc41d('0x7f')](_0x208943[_0xc41d('0x5e')]['from'])){throw _0x17a88a[_0xc41d('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0xc41d('0x92'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x208943['body']['body'])||_0x208943['body']['body']===''){throw _0x17a88a['status'](0x1f4)[_0xc41d('0x3c')](new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0x99')));}if(_[_0xc41d('0x7f')](_0x208943[_0xc41d('0x5e')][_0xc41d('0xd4')])){throw _0x17a88a[_0xc41d('0x2c')](0x1f4)[_0xc41d('0x3c')](new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0xd5')+_0x56a867));}if(!_[_0xc41d('0x9c')](_0x56a867,_0x208943['body']['mapKeyOffline'])){throw _0x17a88a[_0xc41d('0x2c')](0x1f4)['send'](new db[(_0xc41d('0x91'))][(_0xc41d('0x92'))](_0xc41d('0xd6')+_0x56a867));}_0x3f7ad9[_0x208943[_0xc41d('0x5e')][_0xc41d('0xd4')]]=_0x208943[_0xc41d('0x5e')][_0xc41d('0x98')];})[_0xc41d('0x21')](function(){return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0x208943[_0xc41d('0x53')]['id']},'include':[{'model':db[_0xc41d('0x9e')],'as':_0xc41d('0xa4')},{'model':db[_0xc41d('0xd7')],'as':_0xc41d('0xd7')}]});})[_0xc41d('0x21')](handleEntityNotFound(_0x17a88a,null))[_0xc41d('0x21')](function(_0xa3f922){if(_0xa3f922&&_0xa3f922[_0xc41d('0xa4')]){_0x27ac09=_0xa3f922;var _0x1e4a70=_[_0xc41d('0x1a')](_0x208943[_0xc41d('0x5e')],{'firstName':_0x208943[_0xc41d('0x5e')][_0xc41d('0x98')],'phone':_0x208943[_0xc41d('0x5e')][_0xc41d('0x98')],'ListId':_0xa3f922['ListId']});_0x1e4a70[_0x208943[_0xc41d('0x5e')][_0xc41d('0xd4')]]=_0x208943[_0xc41d('0x5e')][_0xc41d('0x98')];return db[_0xc41d('0x90')][_0xc41d('0xd8')]({'where':_0x3f7ad9,'defaults':_0x1e4a70});}})[_0xc41d('0xbf')](function(_0x28410c){if(_0x28410c){_0x16db72=_0x28410c;var _0x50aa70=fs[_0xc41d('0xd9')](path[_0xc41d('0x79')](config[_0xc41d('0x7a')],'server/files/templates/chatOfflineMessage.ejs'),_0xc41d('0xda'));var _0x30c1cc=ejs[_0xc41d('0xdb')](_0x50aa70,{'body':_[_0xc41d('0xdc')](_0x208943['body']['body']),'bodyTitle':_0x27ac09[_0xc41d('0xdd')]});return db[_0xc41d('0xde')]['create']({'body':_0x30c1cc,'ContactId':_0x28410c['id'],'ChatWebsiteId':_0x27ac09['id']});}})[_0xc41d('0x21')](function(_0x28076b){_0x4fd682=_0x28076b;if(_0x483c48[_0xc41d('0x48')]){var _0xeba854=_0x483c48['map'](function(_0x4a8966){return{'name':_0x4a8966['originalname'],'basename':_0x4a8966[_0xc41d('0x71')],'type':_0x4a8966[_0xc41d('0xdf')],'ChatOfflineMessageId':_0x28076b['id']};});_0x286776=_0xeba854[_0xc41d('0x3e')](_0x332c9e=>{var _0x174a85={'filename':_0x332c9e[_0xc41d('0x3b')],'path':path['join'](config[_0xc41d('0x7a')],_0xc41d('0xe0'),_0xc41d('0xd2'),_0xc41d('0xe1'),_0xc41d('0xe2'),_0x332c9e[_0xc41d('0xe3')])};return _0x174a85;});if(!_0x27ac09[_0xc41d('0xe4')]){return db['sequelize'][_0xc41d('0xe5')](function(_0x48e3d2){return db[_0xc41d('0xe6')][_0xc41d('0xe7')](_0xeba854,{'transaction':_0x48e3d2});});}}})[_0xc41d('0x21')](function(){if(_0x4fd682){_0x4b3f18=_0x4fd682;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xc41d('0xe8')],'as':_0xc41d('0xe9'),'raw':!![]}]});}})[_0xc41d('0x21')](function(_0xc69154){if(_0xc69154&&_0xc69154['Smtp']&&_0x27ac09[_0xc41d('0xea')]&&_0x27ac09[_0xc41d('0xeb')]){var _0x3646af={'tls':{'rejectUnauthorized':![]}};if(_0xc69154[_0xc41d('0xe9')][_0xc41d('0xec')]){_0x3646af[_0xc41d('0xec')]=_0xc69154[_0xc41d('0xe9')]['service'];}else{_0x3646af[_0xc41d('0xed')]=_0xc69154[_0xc41d('0xe9')]['host'];_0x3646af[_0xc41d('0xee')]=_0xc69154[_0xc41d('0xe9')][_0xc41d('0xee')];_0x3646af['secure']=_0xc69154[_0xc41d('0xe9')][_0xc41d('0xef')];}if(_0xc69154[_0xc41d('0xe9')][_0xc41d('0xf0')]){_0x3646af[_0xc41d('0xf1')]={'user':_0xc69154[_0xc41d('0xe9')][_0xc41d('0x58')],'pass':_0xc69154['Smtp'][_0xc41d('0xf2')]};}return respondWithRpcPromise(_0xc41d('0xf3'),_0xc41d('0xf4'),{'account':_0x3646af,'message':{'from':util[_0xc41d('0xb7')](_0xc41d('0xf5'),_0xc69154[_0xc41d('0x3b')],_0xc69154[_0xc41d('0xf6')]||_0xc69154[_0xc41d('0xe9')][_0xc41d('0x58')]),'to':_0x27ac09['forwardOfflineAddress'],'subject':_0x27ac09['offlineMessageSubject'],'html':_0x4b3f18[_0xc41d('0x5e')],'attachments':_0x286776}},client9003)[_0xc41d('0x21')](function(){return _0x4b3f18;})[_0xc41d('0x2a')](function(_0x368e14){console[_0xc41d('0x27')](_0x368e14);});}})[_0xc41d('0x21')](function(){if(_0x27ac09&&_0x27ac09[_0xc41d('0xe4')]&&_0x27ac09[_0xc41d('0xf7')]){var _0x225b9d=[];if(_0x483c48['length']){_0x225b9d=_0x483c48['map'](function(_0x1846d2){return{'name':_0x1846d2[_0xc41d('0xf8')],'basename':_0x1846d2['filename'],'type':_0x1846d2[_0xc41d('0xdf')],'ChatOfflineMessageId':_0x4fd682['id']};});}var _0x511372;if(!_[_0xc41d('0x7f')](_0x27ac09[_0xc41d('0xf9')])){var _0x28b278=_['map'](_0x208943[_0xc41d('0x5e')],function(_0x2d40e4){return _0x2d40e4;});var _0xc62f3c=_['toPairsIn'](_0x28b278)[0x0];var _0x43b7bf=_[_0xc41d('0xfa')](_0xc62f3c,function(_0x259a71){return _0x259a71;});_0x511372=_0x43b7bf[0x1][_0x27ac09[_0xc41d('0xf9')]];}var _0x17c2c6={'from':_0x16db72[_0xc41d('0xf6')],'firstName':_0x16db72['firstName'],'lastName':_0x16db72[_0xc41d('0xb0')],'mapKey':_0xc41d('0xf6'),'message':{'from':_0x16db72['email'],'to':_0x27ac09['MailAccount'][_0xc41d('0xf6')],'cc':'','subject':_[_0xc41d('0x7f')](_0x511372)?_0x27ac09[_0xc41d('0xfb')]:_0x511372,'messageId':'','sentAt':new Date(),'attach':_0x225b9d['length'],'attachments':_0x225b9d,'originChannel':_0xc41d('0xfc'),'ChatWebsiteId':_0x27ac09['id'],'ChatOfflineMessageId':_0x4b3f18['id'],'originTo':_0x27ac09[_0xc41d('0xd7')][_0xc41d('0xf6')]},'body':_0x4b3f18[_0xc41d('0x5e')]};var _0x5d9b8f={'account':{'id':_0x27ac09[_0xc41d('0xf7')]},'body':_0x17c2c6,'log':_0xc41d('0xfd')};return respondWithRpcPromise(_0xc41d('0xfd'),_0xc41d('0xfe'),_0x5d9b8f,client9001)[_0xc41d('0x21')](function(){return _0x4b3f18;})['catch'](function(_0x3f1005){console[_0xc41d('0x27')](_0x3f1005);});}return;})['then'](function(){if(_0x4b3f18){return _0x4b3f18;}})[_0xc41d('0x21')](respondWithResult(_0x17a88a,null))['catch'](function(_0x219144){console[_0xc41d('0x27')](_0xc41d('0x2a'),_0x219144);for(var _0x3ed8b0 of _0x483c48){var _0x55b22b=path['join'](config['root'],'server',_0xc41d('0xd2'),_0xc41d('0xe1'),'offline-chat',_0x3ed8b0[_0xc41d('0x71')]);fs_extra[_0xc41d('0xff')](_0x55b22b)[_0xc41d('0x2a')](function(_0x2150a5){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x55b22b,_0x2150a5);});}});};exports[_0xc41d('0x100')]=function(_0x4975b2,_0x43643b,_0x4aef72){return db[_0xc41d('0xbc')][_0xc41d('0x57')]({'where':{'id':_0x4975b2[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x43643b,null))[_0xc41d('0x21')](function(_0x330389){if(_0x330389){return _0x330389[_0xc41d('0x100')](_0x4975b2['body'][_0xc41d('0x68')],_['omit'](_0x4975b2[_0xc41d('0x5e')],[_0xc41d('0x68'),'id'])||{});}})[_0xc41d('0x21')](respondWithResult(_0x43643b,null))[_0xc41d('0x2a')](handleError(_0x43643b,null));};exports[_0xc41d('0x101')]=function(_0xf190c2,_0x1a2c88,_0x37855c){var _0x168642={'raw':![],'where':{}};var _0x4ef1fd={};var _0x41b094={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xf190c2[_0xc41d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a2c88,null))[_0xc41d('0x21')](function(_0x4e1ad9){if(_0x4e1ad9){_0x4ef1fd[_0xc41d('0x42')]=_[_0xc41d('0x55')](db[_0xc41d('0xbc')][_0xc41d('0x40')]);_0x4ef1fd[_0xc41d('0x43')]=_['keys'](_0xf190c2[_0xc41d('0x43')]);_0x4ef1fd[_0xc41d('0x44')]=_['intersection'](_0x4ef1fd[_0xc41d('0x42')],_0x4ef1fd[_0xc41d('0x43')]);_0x168642[_0xc41d('0x45')]=_[_0xc41d('0x46')](_0x4ef1fd[_0xc41d('0x42')],qs[_0xc41d('0x47')](_0xf190c2[_0xc41d('0x43')][_0xc41d('0x47')]));_0x168642['attributes']=_0x168642[_0xc41d('0x45')][_0xc41d('0x48')]?_0x168642[_0xc41d('0x45')]:_0x4ef1fd[_0xc41d('0x42')];if(!_0xf190c2['query'][_0xc41d('0x65')](_0xc41d('0x49'))){_0x168642[_0xc41d('0x4a')]=qs[_0xc41d('0x4a')](_0xf190c2['query'][_0xc41d('0x4a')]);_0x168642[_0xc41d('0x2f')]=qs['offset'](_0xf190c2[_0xc41d('0x43')][_0xc41d('0x2f')]);}_0x168642[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0xf190c2[_0xc41d('0x43')]['sort']);_0x168642[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_[_0xc41d('0x4e')](_0xf190c2[_0xc41d('0x43')],_0x4ef1fd[_0xc41d('0x44')]));_0x168642[_0xc41d('0x4d')]['ChatWebsiteId']=_0x4e1ad9['id'];if(_0xf190c2[_0xc41d('0x43')]['filter']){_0x168642[_0xc41d('0x4d')]=_[_0xc41d('0x50')](_0x168642[_0xc41d('0x4d')],{'$or':_[_0xc41d('0x3e')](_0x168642[_0xc41d('0x45')],function(_0x3c5efa){var _0x108c00={};_0x108c00[_0x3c5efa]={'$like':'%'+_0xf190c2[_0xc41d('0x43')][_0xc41d('0x4f')]+'%'};return _0x108c00;})});}_0x168642=_[_0xc41d('0x50')]({},_0x168642,_0xf190c2[_0xc41d('0x56')]);return db[_0xc41d('0xbc')][_0xc41d('0x31')]({'where':_0x168642['where']})[_0xc41d('0x21')](function(_0x495883){_0x41b094[_0xc41d('0x31')]=_0x495883;if(_0xf190c2[_0xc41d('0x43')][_0xc41d('0x51')]){_0x168642['include']=[{'model':db[_0xc41d('0x90')],'as':_0xc41d('0x102'),'required':![]},{'model':db['User'],'as':_0xc41d('0x103'),'attributes':[_0xc41d('0x3b'),'fullname',_0xc41d('0x104')],'required':![]},{'model':db['Tag'],'as':_0xc41d('0x105'),'attributes':['id','name','color'],'where':_0xf190c2[_0xc41d('0x43')][_0xc41d('0x106')]?{'id':_0xf190c2[_0xc41d('0x43')]['tag']}:undefined,'required':_0xf190c2[_0xc41d('0x43')][_0xc41d('0x106')]?!![]:![]}];}return db[_0xc41d('0xbc')][_0xc41d('0x6c')](_0x168642);})[_0xc41d('0x21')](function(_0x320d3d){_0x41b094[_0xc41d('0x66')]=_0x320d3d;return _0x41b094;});}})[_0xc41d('0x21')](respondWithFilteredResult(_0x1a2c88,_0x168642))['catch'](handleError(_0x1a2c88,null));};function iftimePromise(_0x48ac5f,_0x167ac3){return respondWithRpcPromise('Command',_0xc41d('0x107'),{'command':_0x167ac3[_0xc41d('0x108')]?util['format'](_0xc41d('0x109'),_0x48ac5f[_0xc41d('0x10a')],_0x167ac3[_0xc41d('0x108')]):util['format'](_0xc41d('0x10b'),_0x48ac5f[_0xc41d('0x10a')])},client9002)['then'](function(_0x4d19b9){var _0x33c80e=_0x4d19b9&&_0x4d19b9[_0xc41d('0x10c')](_0xc41d('0x10d'))>=0x0?!![]:![];logger[_0xc41d('0x22')](_0xc41d('0x10e'),_0x167ac3['id'],_0x48ac5f['id'],_0x48ac5f[_0xc41d('0x10a')],_0x33c80e?_0xc41d('0x10f'):_0xc41d('0x110'),_0x167ac3['timezone']?_0x167ac3[_0xc41d('0x108')]:'No\x20timezone');return _0x33c80e;})[_0xc41d('0x2a')](function(_0x509779){logger[_0xc41d('0x27')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x167ac3['id'],_0x48ac5f['id'],_0x48ac5f[_0xc41d('0x10a')],util[_0xc41d('0x111')](_0x509779,{'showHidden':![],'depth':null}),_0x167ac3[_0xc41d('0x108')]?_0x167ac3[_0xc41d('0x108')]:_0xc41d('0x112'));return![];});}exports[_0xc41d('0x107')]=function(_0x45b371,_0x135d27,_0x478623){var _0x1d699c=0x0;var _0x363d29=0x0;var _0x44d7ec=![];var _0x30da57;var _0x295d3e;return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x45b371[_0xc41d('0x53')]['id']},'include':[{'model':db[_0xc41d('0x113')],'as':_0xc41d('0x113'),'include':[{'model':db[_0xc41d('0x113')],'as':_0xc41d('0x114'),'attributes':['id',_0xc41d('0x10a')],'raw':!![]}]}]})[_0xc41d('0x21')](handleEntityNotFound(_0x135d27,null))[_0xc41d('0x21')](function(_0x30d62f){if(_0x30d62f){_0x30da57=_0x30d62f;return _0x30d62f[_0xc41d('0x115')]({'raw':!![]});}})[_0xc41d('0x21')](function(_0x109a35){if(_0x30da57){if(_0x109a35){_0x295d3e=_0x109a35;}}return require(_0xc41d('0x7c'))[_0xc41d('0x7d')]();})[_0xc41d('0x21')](function(_0x29ad4a){if(_0x29ad4a){_0x363d29=_0x29ad4a[_0xc41d('0x116')];_0x44d7ec=_0x29ad4a['custom'];}})[_0xc41d('0x21')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0xed68f0){_0x1d699c=_0xed68f0;if(_0x363d29&&_0xed68f0>_0x363d29){return db[_0xc41d('0x117')][_0xc41d('0x64')]({'where':{'id':0x1}})[_0xc41d('0x21')](function(_0x15745a){if(_0x15745a){_0x15745a[_0xc41d('0x118')](_0xc41d('0x119'));}});}})[_0xc41d('0x21')](function(){if(_0x30da57[_0xc41d('0x113')]&&_0x30da57[_0xc41d('0x113')]['Intervals']){var _0x247356=[];for(var _0x249d73=0x0;_0x249d73<_0x30da57[_0xc41d('0x113')]['Intervals'][_0xc41d('0x48')];_0x249d73++){var _0x3e27c6=_0x30da57[_0xc41d('0x113')]['Intervals'][_0x249d73][_0xc41d('0x38')]({'plain':!![]});_0x247356['push'](iftimePromise(_0x3e27c6,_0x30da57));}return BPromise[_0xc41d('0x11a')](_0x247356)[_0xc41d('0x21')](function(_0xc24a16){return _[_0xc41d('0x11b')](_0xc24a16);});}else{return!![];}})[_0xc41d('0x21')](function(_0x49591b){var _0x500ba8=fs[_0xc41d('0xd9')](path[_0xc41d('0x79')](config[_0xc41d('0x7a')],_0xc41d('0x11c')),_0xc41d('0xda'));var _0x39014d={'remote':_0x30da57[_0xc41d('0x11d')],'query':querystring['stringify'](_[_0xc41d('0x50')](_0x30da57[_0xc41d('0x38')]({'plain':!![]}),{'customerIp':_0x45b371[_0xc41d('0x8c')][_0xc41d('0xac')]||_0x45b371[_0xc41d('0x8c')][_0xc41d('0x11e')]||_0x45b371[_0xc41d('0x11f')]['remoteAddress']||_0x45b371['ip'],'referer':_0x45b371['headers'][_0xc41d('0xb2')],'openedInteractions':_0x1d699c,'maxInteractions':_0x363d29,'virtual':_0x44d7ec[_0xc41d('0x116')],'online':_0x49591b,'custom':_0x44d7ec}))[_0xc41d('0x120')](/'/g,'\x5c\x27')};_0x135d27[_0xc41d('0x3c')](ejs[_0xc41d('0xdb')](Mustache[_0xc41d('0xdb')](_0x500ba8,_0x39014d),{'proactiveActions':_0x295d3e,'alignment':_0x30da57[_0xc41d('0x121')],'verticalAlignment':_0x30da57[_0xc41d('0x122')],'div_color':_0x30da57['color'],'text_color':_0x30da57['textColor'],'button_color':_0x30da57['color_button'],'background_color':_0x30da57['backgroundColor']}));})['catch'](handleError(_0x135d27,null));};exports[_0xc41d('0x123')]=function(_0x479c71,_0x22983b,_0x1895bc){return db[_0xc41d('0x3f')]['findOne']({'where':{'id':_0x479c71[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x22983b,null))[_0xc41d('0x21')](function(_0x2109d8){if(_0x2109d8){return db[_0xc41d('0x124')][_0xc41d('0xe5')](function(_0x562e05){return db[_0xc41d('0xa1')][_0xc41d('0x37')]({'where':{'ChatWebsiteId':_0x479c71['params']['id']},'transaction':_0x562e05})[_0xc41d('0x21')](function(_0x5b13d8){var _0x5939c5=_['map'](_0x479c71[_0xc41d('0x5e')],function(_0x45395f){_0x45395f[_0xc41d('0x61')]=_0x479c71['params']['id'];return _0x45395f;});return db[_0xc41d('0xa1')]['bulkCreate'](_0x5939c5,{'transaction':_0x562e05});});})['then'](function(){return db[_0xc41d('0xa1')][_0xc41d('0x125')]({'where':{'ChatWebsiteId':_0x479c71[_0xc41d('0x53')]['id']},'order':_0xc41d('0xa6')});});}})[_0xc41d('0x21')](respondWithResult(_0x22983b,null))[_0xc41d('0x2a')](handleError(_0x22983b,null));};exports[_0xc41d('0x126')]=function(_0x403faf,_0x51e4d6,_0x5dc974){var _0x6766e6={};var _0xcfbadc={};var _0x2b41d3;var _0x2b5c71;return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x403faf[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x51e4d6,null))['then'](function(_0x5ec7f3){if(_0x5ec7f3){_0x2b41d3=_0x5ec7f3;_0xcfbadc['model']=_[_0xc41d('0x55')](db[_0xc41d('0xa1')][_0xc41d('0x40')]);_0xcfbadc[_0xc41d('0x43')]=_[_0xc41d('0x55')](_0x403faf[_0xc41d('0x43')]);_0xcfbadc[_0xc41d('0x44')]=_[_0xc41d('0x46')](_0xcfbadc[_0xc41d('0x42')],_0xcfbadc[_0xc41d('0x43')]);_0x6766e6[_0xc41d('0x45')]=_['intersection'](_0xcfbadc[_0xc41d('0x42')],qs[_0xc41d('0x47')](_0x403faf[_0xc41d('0x43')][_0xc41d('0x47')]));_0x6766e6['attributes']=_0x6766e6['attributes'][_0xc41d('0x48')]?_0x6766e6[_0xc41d('0x45')]:_0xcfbadc['model'];_0x6766e6[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0x403faf[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x6766e6[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_[_0xc41d('0x4e')](_0x403faf[_0xc41d('0x43')],_0xcfbadc[_0xc41d('0x44')]));if(_0x403faf['query'][_0xc41d('0x4f')]){_0x6766e6[_0xc41d('0x4d')]=_['merge'](_0x6766e6['where'],{'$or':_[_0xc41d('0x3e')](_0x6766e6['attributes'],function(_0x5b4ae1){var _0x4e4c74={};_0x4e4c74[_0x5b4ae1]={'$like':'%'+_0x403faf[_0xc41d('0x43')]['filter']+'%'};return _0x4e4c74;})});}_0x6766e6=_[_0xc41d('0x50')]({},_0x6766e6,_0x403faf['options']);return _0x2b41d3[_0xc41d('0x126')](_0x6766e6);}})[_0xc41d('0x21')](function(_0x1b05d0){if(_0x1b05d0){_0x2b5c71=_0x1b05d0['length'];if(!_0x403faf['query'][_0xc41d('0x65')]('nolimit')){_0x6766e6[_0xc41d('0x4a')]=qs[_0xc41d('0x4a')](_0x403faf[_0xc41d('0x43')][_0xc41d('0x4a')]);_0x6766e6[_0xc41d('0x2f')]=qs[_0xc41d('0x2f')](_0x403faf['query'][_0xc41d('0x2f')]);}return _0x2b41d3['getApplications'](_0x6766e6);}})[_0xc41d('0x21')](function(_0x2003a8){if(_0x2003a8){return _0x2003a8?{'count':_0x2b5c71,'rows':_0x2003a8}:null;}})[_0xc41d('0x21')](respondWithResult(_0x51e4d6,null))[_0xc41d('0x2a')](handleError(_0x51e4d6,null));};exports['addProactiveActions']=function(_0x1486e2,_0x39b8f5,_0x382971){return db['chatProactiveAction'][_0xc41d('0x57')]({'where':{'id':_0x1486e2[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x39b8f5,null))['then'](function(_0x4f1a95){if(_0x4f1a95){return _0x4f1a95[_0xc41d('0x127')](_0x1486e2[_0xc41d('0x5e')]['ids'],_[_0xc41d('0x128')](_0x1486e2[_0xc41d('0x5e')],['ids','id'])||{});}})[_0xc41d('0x21')](respondWithResult(_0x39b8f5,null))[_0xc41d('0x2a')](handleError(_0x39b8f5,null));};exports[_0xc41d('0x115')]=function(_0x3b7031,_0x38592b,_0x295495){var _0x20b121={};var _0x2d1d21={};var _0x551037;var _0x395a60;return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x3b7031['params']['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x38592b,null))[_0xc41d('0x21')](function(_0x54ae70){if(_0x54ae70){_0x551037=_0x54ae70;_0x2d1d21['model']=_[_0xc41d('0x55')](db[_0xc41d('0x129')]['rawAttributes']);_0x2d1d21[_0xc41d('0x43')]=_[_0xc41d('0x55')](_0x3b7031[_0xc41d('0x43')]);_0x2d1d21['filters']=_[_0xc41d('0x46')](_0x2d1d21[_0xc41d('0x42')],_0x2d1d21['query']);_0x20b121['attributes']=_[_0xc41d('0x46')](_0x2d1d21['model'],qs[_0xc41d('0x47')](_0x3b7031[_0xc41d('0x43')][_0xc41d('0x47')]));_0x20b121[_0xc41d('0x45')]=_0x20b121[_0xc41d('0x45')][_0xc41d('0x48')]?_0x20b121['attributes']:_0x2d1d21[_0xc41d('0x42')];_0x20b121[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0x3b7031[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x20b121['where']=qs[_0xc41d('0x44')](_['pick'](_0x3b7031[_0xc41d('0x43')],_0x2d1d21[_0xc41d('0x44')]));if(_0x3b7031[_0xc41d('0x43')][_0xc41d('0x4f')]){_0x20b121['where']=_[_0xc41d('0x50')](_0x20b121[_0xc41d('0x4d')],{'$or':_[_0xc41d('0x3e')](_0x20b121[_0xc41d('0x45')],function(_0x447863){var _0x2f427d={};_0x2f427d[_0x447863]={'$like':'%'+_0x3b7031[_0xc41d('0x43')][_0xc41d('0x4f')]+'%'};return _0x2f427d;})});}_0x20b121=_[_0xc41d('0x50')]({},_0x20b121,_0x3b7031[_0xc41d('0x56')]);return _0x551037['getProactiveActions'](_0x20b121);}})[_0xc41d('0x21')](function(_0x594606){if(_0x594606){_0x395a60=_0x594606['length'];if(!_0x3b7031[_0xc41d('0x43')]['hasOwnProperty'](_0xc41d('0x49'))){_0x20b121[_0xc41d('0x4a')]=qs['limit'](_0x3b7031['query']['limit']);_0x20b121['offset']=qs[_0xc41d('0x2f')](_0x3b7031[_0xc41d('0x43')]['offset']);}return _0x551037[_0xc41d('0x115')](_0x20b121);}})['then'](function(_0x1d8e8c){if(_0x1d8e8c){return _0x1d8e8c?{'count':_0x395a60,'rows':_0x1d8e8c}:null;}})[_0xc41d('0x21')](respondWithResult(_0x38592b,null))[_0xc41d('0x2a')](handleError(_0x38592b,null));};exports['getFields']=function(_0x11caab,_0x265d88,_0x1579b3){var _0x13ed16=_0x11caab[_0xc41d('0x43')][_0xc41d('0x12a')]===_0xc41d('0x12b')?_0xc41d('0x12c'):_0xc41d('0x12d');return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'attributes':['id',_0x13ed16],'where':{'id':_0x11caab[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x265d88,null))[_0xc41d('0x21')](function(_0x5df555){if(_0x5df555){var _0x546865=_0x5df555[_0x13ed16];var _0xea7fc=_0x546865&&_0x546865[_0xc41d('0x12e')]?_0x546865[_0xc41d('0x12e')]:[];_0x265d88['send']({'fromKey':_[_0xc41d('0x7f')](_0x546865[_0xc41d('0x12f')])?undefined:_0x546865[_0xc41d('0x12f')],'count':_0xea7fc['length'],'rows':_0xea7fc});}})[_0xc41d('0x2a')](handleError(_0x265d88,null));};exports[_0xc41d('0x130')]=function(_0x3cff85,_0x25265d,_0x2036c4){var _0x54d81f={'raw':![],'where':{}};var _0x1368ef={};var _0xf081a9={'count':0x0,'rows':[]};return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x3cff85[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x25265d,null))[_0xc41d('0x21')](function(_0x27d7c4){if(_0x27d7c4){_0x1368ef[_0xc41d('0x42')]=_[_0xc41d('0x55')](db[_0xc41d('0xde')][_0xc41d('0x40')]);_0x1368ef[_0xc41d('0x43')]=_[_0xc41d('0x55')](_0x3cff85[_0xc41d('0x43')]);_0x1368ef[_0xc41d('0x44')]=_['intersection'](_0x1368ef[_0xc41d('0x42')],_0x1368ef[_0xc41d('0x43')]);_0x54d81f['attributes']=_['intersection'](_0x1368ef[_0xc41d('0x42')],qs[_0xc41d('0x47')](_0x3cff85[_0xc41d('0x43')][_0xc41d('0x47')]));_0x54d81f['attributes']=_0x54d81f[_0xc41d('0x45')][_0xc41d('0x48')]?_0x54d81f['attributes']:_0x1368ef[_0xc41d('0x42')];if(!_0x3cff85['query']['hasOwnProperty'](_0xc41d('0x49'))){_0x54d81f['limit']=qs['limit'](_0x3cff85[_0xc41d('0x43')][_0xc41d('0x4a')]);_0x54d81f[_0xc41d('0x2f')]=qs['offset'](_0x3cff85[_0xc41d('0x43')]['offset']);}_0x54d81f['order']=qs[_0xc41d('0x4c')](_0x3cff85[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x54d81f[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_['pick'](_0x3cff85[_0xc41d('0x43')],_0x1368ef[_0xc41d('0x44')]));_0x54d81f[_0xc41d('0x4d')]['ChatWebsiteId']=_0x27d7c4['id'];if(_0x3cff85['query'][_0xc41d('0x4f')]){_0x54d81f[_0xc41d('0x4d')]=_[_0xc41d('0x50')](_0x54d81f['where'],{'$or':_[_0xc41d('0x3e')](_0x54d81f['attributes'],function(_0x19edd7){var _0x1fd1ac={};_0x1fd1ac[_0x19edd7]={'$like':'%'+_0x3cff85[_0xc41d('0x43')][_0xc41d('0x4f')]+'%'};return _0x1fd1ac;})});}_0x54d81f=_[_0xc41d('0x50')]({},_0x54d81f,_0x3cff85[_0xc41d('0x56')]);return db[_0xc41d('0xde')]['count']({'where':_0x54d81f[_0xc41d('0x4d')]})[_0xc41d('0x21')](function(_0x5d7003){_0xf081a9[_0xc41d('0x31')]=_0x5d7003;if(_0x3cff85[_0xc41d('0x43')][_0xc41d('0x51')]){_0x54d81f[_0xc41d('0x52')]=[{'all':!![]}];}else{_0x54d81f[_0xc41d('0x52')]=[{'model':db[_0xc41d('0x90')],'as':_0xc41d('0x102'),'required':![]},{'model':db[_0xc41d('0xe6')],'as':_0xc41d('0x131'),'required':![]}];}return db['ChatOfflineMessage'][_0xc41d('0x6c')](_0x54d81f);})[_0xc41d('0x21')](function(_0x15cb5a){_0xf081a9[_0xc41d('0x66')]=_0x15cb5a;return _0xf081a9;});}})[_0xc41d('0x21')](respondWithFilteredResult(_0x25265d,_0x54d81f))[_0xc41d('0x2a')](handleError(_0x25265d,null));};exports[_0xc41d('0x132')]=function(_0x580702,_0x315f35,_0x81b934){return db[_0xc41d('0x3f')][_0xc41d('0x57')]({'where':{'id':_0x580702[_0xc41d('0x53')]['id']}})['then'](handleEntityNotFound(_0x315f35,null))['then'](function(_0x46829d){if(_0x46829d){return _0x46829d[_0xc41d('0x132')](_0x580702[_0xc41d('0x5e')]['ids'],_[_0xc41d('0x128')](_0x580702['body'],['ids','id'])||{})['spread'](function(_0x17307){for(var _0x3b65b4=0x0;_0x3b65b4<_0x580702[_0xc41d('0x5e')][_0xc41d('0x68')][_0xc41d('0x48')];_0x3b65b4+=0x1){socket[_0xc41d('0x133')](_0xc41d('0x134'),{'UserId':Number(_0x580702[_0xc41d('0x5e')][_0xc41d('0x68')][_0x3b65b4]),'ChatWebsiteId':Number(_0x580702[_0xc41d('0x53')]['id'])});}return _0x17307;});}})['then'](respondWithResult(_0x315f35,null))['catch'](handleError(_0x315f35,null));};exports['removeAgents']=function(_0x3dcb11,_0xa10c40,_0x16190d){return db['ChatWebsite'][_0xc41d('0x57')]({'where':{'id':_0x3dcb11['params']['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0xa10c40,null))['then'](function(_0x4e3969){if(_0x4e3969){return _0x4e3969['removeAgents'](_0x3dcb11[_0xc41d('0x43')][_0xc41d('0x68')])['then'](function(){if(_[_0xc41d('0x135')](_0x3dcb11[_0xc41d('0x43')]['ids'])){for(var _0x497721=0x0;_0x497721<_0x3dcb11[_0xc41d('0x43')][_0xc41d('0x68')][_0xc41d('0x48')];_0x497721+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3dcb11['query'][_0xc41d('0x68')][_0x497721]),'ChatWebsiteId':Number(_0x3dcb11[_0xc41d('0x53')]['id'])});}}else{socket[_0xc41d('0x133')](_0xc41d('0x136'),{'UserId':Number(_0x3dcb11[_0xc41d('0x43')][_0xc41d('0x68')]),'ChatWebsiteId':Number(_0x3dcb11[_0xc41d('0x53')]['id'])});}});}})[_0xc41d('0x21')](respondWithStatusCode(_0xa10c40,null))[_0xc41d('0x2a')](handleError(_0xa10c40,null));};exports['getAgents']=function(_0x34f224,_0x1b3dd3,_0x21c1d5){var _0x30ad55={};var _0x260f5b={};var _0x1d0da0;var _0x235cdf;return db[_0xc41d('0x3f')][_0xc41d('0x64')]({'where':{'id':_0x34f224[_0xc41d('0x53')]['id']}})[_0xc41d('0x21')](handleEntityNotFound(_0x1b3dd3,null))['then'](function(_0x1a5e4a){if(_0x1a5e4a){_0x1d0da0=_0x1a5e4a;_0x260f5b[_0xc41d('0x42')]=_[_0xc41d('0x55')](db[_0xc41d('0x137')][_0xc41d('0x40')]);_0x260f5b[_0xc41d('0x43')]=_[_0xc41d('0x55')](_0x34f224[_0xc41d('0x43')]);_0x260f5b[_0xc41d('0x44')]=_['intersection'](_0x260f5b[_0xc41d('0x42')],_0x260f5b[_0xc41d('0x43')]);_0x30ad55['attributes']=_['intersection'](_0x260f5b[_0xc41d('0x42')],qs['fields'](_0x34f224['query'][_0xc41d('0x47')]));_0x30ad55[_0xc41d('0x45')]=_0x30ad55[_0xc41d('0x45')][_0xc41d('0x48')]?_0x30ad55[_0xc41d('0x45')]:_0x260f5b['model'];_0x30ad55[_0xc41d('0x4b')]=qs[_0xc41d('0x4c')](_0x34f224[_0xc41d('0x43')][_0xc41d('0x4c')]);_0x30ad55[_0xc41d('0x4d')]=qs[_0xc41d('0x44')](_[_0xc41d('0x4e')](_0x34f224[_0xc41d('0x43')],_0x260f5b[_0xc41d('0x44')]));if(_0x34f224['query'][_0xc41d('0x4f')]){_0x30ad55[_0xc41d('0x4d')]=_[_0xc41d('0x50')](_0x30ad55[_0xc41d('0x4d')],{'$or':_['map'](_0x30ad55[_0xc41d('0x45')],function(_0x587518){var _0x1aebaa={};_0x1aebaa[_0x587518]={'$like':'%'+_0x34f224[_0xc41d('0x43')]['filter']+'%'};return _0x1aebaa;})});}_0x30ad55=_['merge']({},_0x30ad55,_0x34f224[_0xc41d('0x56')]);return _0x1d0da0[_0xc41d('0x138')](_0x30ad55);}})[_0xc41d('0x21')](function(_0xe8ce7b){if(_0xe8ce7b){_0x235cdf=_0xe8ce7b[_0xc41d('0x48')];if(!_0x34f224[_0xc41d('0x43')][_0xc41d('0x65')](_0xc41d('0x49'))){_0x30ad55[_0xc41d('0x4a')]=qs[_0xc41d('0x4a')](_0x34f224[_0xc41d('0x43')][_0xc41d('0x4a')]);_0x30ad55['offset']=qs[_0xc41d('0x2f')](_0x34f224['query']['offset']);}return _0x1d0da0[_0xc41d('0x138')](_0x30ad55);}})[_0xc41d('0x21')](function(_0xc61a3d){if(_0xc61a3d){return _0xc61a3d?{'count':_0x235cdf,'rows':_0xc61a3d}:null;}})[_0xc41d('0x21')](respondWithResult(_0x1b3dd3,null))[_0xc41d('0x2a')](handleError(_0x1b3dd3,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0ca2a51..77dbe46 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 _0x7bae=['ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0xf2a52b,_0x149ae2){var _0x5f2e44=function(_0x13f749){while(--_0x13f749){_0xf2a52b['push'](_0xf2a52b['shift']());}};_0x5f2e44(++_0x149ae2);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7bae[_0x55e08b];return _0xd1a7ff;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xe7ba('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe7ba('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7ba('0x2'),'afterDestroy':'remove'};function emitEvent(_0x120efa){return function(_0x10908b,_0x166acb,_0x2276df){ChatWebsiteEvents[_0xe7ba('0x3')](_0x120efa+':'+_0x10908b['id'],_0x10908b);ChatWebsiteEvents[_0xe7ba('0x3')](_0x120efa,_0x10908b);_0x2276df(null);};}for(var e in events){if(events[_0xe7ba('0x4')](e)){var event=events[e];ChatWebsite[_0xe7ba('0x5')](e,emitEvent(event));}}module[_0xe7ba('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe002=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x46db76,_0x258da2){var _0x4b9aa0=function(_0x359903){while(--_0x359903){_0x46db76['push'](_0x46db76['shift']());}};_0x4b9aa0(++_0x258da2);}(_0xe002,0xf7));var _0x2e00=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xe002[_0x265aa2];return _0x447a3a;};'use strict';var EventEmitter=require(_0x2e00('0x0'));var ChatWebsite=require(_0x2e00('0x1'))['db'][_0x2e00('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e00('0x3'),'afterUpdate':_0x2e00('0x4'),'afterDestroy':_0x2e00('0x5')};function emitEvent(_0x5ea0f5){return function(_0x34f964,_0xba44f2,_0x2cb0ac){ChatWebsiteEvents[_0x2e00('0x6')](_0x5ea0f5+':'+_0x34f964['id'],_0x34f964);ChatWebsiteEvents[_0x2e00('0x6')](_0x5ea0f5,_0x34f964);_0x2cb0ac(null);};}for(var e in events){if(events[_0x2e00('0x7')](e)){var event=events[e];ChatWebsite[_0x2e00('0x8')](e,emitEvent(event));}}module[_0x2e00('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 7d88536..c9133d9 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 _0xc2b3=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','util','../../config/logger','api','moment','bluebird'];(function(_0x39f470,_0x30a1bc){var _0x3ea2a5=function(_0x495464){while(--_0x495464){_0x39f470['push'](_0x39f470['shift']());}};_0x3ea2a5(++_0x30a1bc);}(_0xc2b3,0x157));var _0x3c2b=function(_0x5218b1,_0x1adbe3){_0x5218b1=_0x5218b1-0x0;var _0x2013e9=_0xc2b3[_0x5218b1];return _0x2013e9;};'use strict';var _=require('lodash');var util=require(_0x3c2b('0x0'));var logger=require(_0x3c2b('0x1'))(_0x3c2b('0x2'));var moment=require(_0x3c2b('0x3'));var BPromise=require(_0x3c2b('0x4'));var rp=require(_0x3c2b('0x5'));var fs=require('fs');var path=require(_0x3c2b('0x6'));var rimraf=require(_0x3c2b('0x7'));var config=require(_0x3c2b('0x8'));var attributes=require(_0x3c2b('0x9'));module[_0x3c2b('0xa')]=function(_0x59dbdd,_0x41fac0){return _0x59dbdd['define']('ChatWebsite',attributes,{'tableName':_0x3c2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3c7=['./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53939b,_0x4dd494){var _0x3ad9e7=function(_0x50b4bd){while(--_0x50b4bd){_0x53939b['push'](_0x53939b['shift']());}};_0x3ad9e7(++_0x4dd494);}(_0xb3c7,0xd0));var _0x7b3c=function(_0x1e2371,_0x2f6319){_0x1e2371=_0x1e2371-0x0;var _0x27e36c=_0xb3c7[_0x1e2371];return _0x27e36c;};'use strict';var _=require(_0x7b3c('0x0'));var util=require(_0x7b3c('0x1'));var logger=require(_0x7b3c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7b3c('0x3'));var rp=require(_0x7b3c('0x4'));var fs=require('fs');var path=require(_0x7b3c('0x5'));var rimraf=require(_0x7b3c('0x6'));var config=require(_0x7b3c('0x7'));var attributes=require(_0x7b3c('0x8'));module[_0x7b3c('0x9')]=function(_0x469740,_0xc37aca){return _0x469740['define'](_0x7b3c('0xa'),attributes,{'tableName':_0x7b3c('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 432ec77..046a770 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 _0x9c9a=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x52fb31,_0x8af16b){var _0x1139ec=function(_0x2130eb){while(--_0x2130eb){_0x52fb31['push'](_0x52fb31['shift']());}};_0x1139ec(++_0x8af16b);}(_0x9c9a,0xe8));var _0xa9c9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9c9a[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xa9c9('0x0'));var util=require(_0xa9c9('0x1'));var moment=require(_0xa9c9('0x2'));var BPromise=require(_0xa9c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9c9('0x4'));var db=require(_0xa9c9('0x5'))['db'];var utils=require(_0xa9c9('0x6'));var logger=require(_0xa9c9('0x7'))(_0xa9c9('0x8'));var config=require(_0xa9c9('0x9'));var jayson=require(_0xa9c9('0xa'));var client=jayson[_0xa9c9('0xb')][_0xa9c9('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa9c9('0xd')],{'host':_0xa9c9('0xe'),'port':0x18eb});var socket=require(_0xa9c9('0xf'))(new Redis(config[_0xa9c9('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x96e73b,_0xee5faa,_0x5c0af7){return new BPromise(function(_0x458e22,_0x568604){return client['request'](_0x96e73b,_0x5c0af7)['then'](function(_0x2f09a6){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xee5faa,_0xa9c9('0x10'));logger['debug'](_0xa9c9('0x11'),_0xee5faa,_0xa9c9('0x10'),JSON[_0xa9c9('0x12')](_0x2f09a6));if(_0x2f09a6[_0xa9c9('0x13')]){if(_0x2f09a6[_0xa9c9('0x13')][_0xa9c9('0x14')]===0x1f4){logger[_0xa9c9('0x13')](_0xa9c9('0x15'),_0xee5faa,_0x2f09a6[_0xa9c9('0x13')][_0xa9c9('0x16')]);return _0x568604(_0x2f09a6[_0xa9c9('0x13')]['message']);}logger[_0xa9c9('0x13')](_0xa9c9('0x15'),_0xee5faa,_0x2f09a6[_0xa9c9('0x13')][_0xa9c9('0x16')]);return _0x458e22(_0x2f09a6['error'][_0xa9c9('0x16')]);}else{logger['info'](_0xa9c9('0x15'),_0xee5faa,_0xa9c9('0x10'));_0x458e22(_0x2f09a6['result']['message']);}})[_0xa9c9('0x17')](function(_0x1269bb){logger[_0xa9c9('0x13')]('ChatWebsite,\x20%s,\x20%s',_0xee5faa,_0x1269bb);_0x568604(_0x1269bb);});});} \ No newline at end of file +var _0xef16=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x8d73af,_0x1945d9){var _0x5e93f9=function(_0x466adf){while(--_0x466adf){_0x8d73af['push'](_0x8d73af['shift']());}};_0x5e93f9(++_0x1945d9);}(_0xef16,0x69));var _0x6ef1=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xef16[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x6ef1('0x0'));var util=require(_0x6ef1('0x1'));var moment=require(_0x6ef1('0x2'));var BPromise=require(_0x6ef1('0x3'));var rs=require(_0x6ef1('0x4'));var fs=require('fs');var Redis=require(_0x6ef1('0x5'));var db=require(_0x6ef1('0x6'))['db'];var utils=require(_0x6ef1('0x7'));var logger=require(_0x6ef1('0x8'))(_0x6ef1('0x9'));var config=require(_0x6ef1('0xa'));var jayson=require(_0x6ef1('0xb'));var client=jayson[_0x6ef1('0xc')][_0x6ef1('0xd')]({'port':0x232a});config[_0x6ef1('0xe')]=_[_0x6ef1('0xf')](config[_0x6ef1('0xe')],{'host':_0x6ef1('0x10'),'port':0x18eb});var socket=require(_0x6ef1('0x11'))(new Redis(config[_0x6ef1('0xe')]));require(_0x6ef1('0x12'))[_0x6ef1('0x13')](socket);function respondWithRpcPromise(_0x2b474c,_0x4ce00b,_0xbbe5e1){return new BPromise(function(_0xbd88cc,_0xd2bed0){return client[_0x6ef1('0x14')](_0x2b474c,_0xbbe5e1)[_0x6ef1('0x15')](function(_0x1d8c3c){logger[_0x6ef1('0x16')](_0x6ef1('0x17'),_0x4ce00b,_0x6ef1('0x18'));logger[_0x6ef1('0x19')](_0x6ef1('0x1a'),_0x4ce00b,'request\x20sent',JSON[_0x6ef1('0x1b')](_0x1d8c3c));if(_0x1d8c3c['error']){if(_0x1d8c3c[_0x6ef1('0x1c')][_0x6ef1('0x1d')]===0x1f4){logger[_0x6ef1('0x1c')](_0x6ef1('0x17'),_0x4ce00b,_0x1d8c3c[_0x6ef1('0x1c')][_0x6ef1('0x1e')]);return _0xd2bed0(_0x1d8c3c[_0x6ef1('0x1c')]['message']);}logger[_0x6ef1('0x1c')](_0x6ef1('0x17'),_0x4ce00b,_0x1d8c3c[_0x6ef1('0x1c')][_0x6ef1('0x1e')]);return _0xbd88cc(_0x1d8c3c['error'][_0x6ef1('0x1e')]);}else{logger[_0x6ef1('0x16')](_0x6ef1('0x17'),_0x4ce00b,_0x6ef1('0x18'));_0xbd88cc(_0x1d8c3c[_0x6ef1('0x1f')][_0x6ef1('0x1e')]);}})[_0x6ef1('0x20')](function(_0x4117d8){logger[_0x6ef1('0x1c')](_0x6ef1('0x17'),_0x4ce00b,_0x4117d8);_0xd2bed0(_0x4117d8);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 94a638f..197f875 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 _0xb94a=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xb94a,0x1a8));var _0xab94=function(_0x5d4f0f,_0xd564f1){_0x5d4f0f=_0x5d4f0f-0x0;var _0x558fe2=_0xb94a[_0x5d4f0f];return _0x558fe2;};'use strict';var ChatWebsiteEvents=require(_0xab94('0x0'));var events=[_0xab94('0x1'),_0xab94('0x2'),'update'];function createListener(_0x4850ac,_0x563d2e){return function(_0x186813){_0x563d2e['emit'](_0x4850ac,_0x186813);};}function removeListener(_0x215e56,_0x32a228){return function(){ChatWebsiteEvents[_0xab94('0x3')](_0x215e56,_0x32a228);};}exports[_0xab94('0x4')]=function(_0x4a8de5){for(var _0x299cf5=0x0,_0x31cf12=events[_0xab94('0x5')];_0x299cf5<_0x31cf12;_0x299cf5++){var _0x46787f=events[_0x299cf5];var _0x4176c4=createListener(_0xab94('0x6')+_0x46787f,_0x4a8de5);ChatWebsiteEvents['on'](_0x46787f,_0x4176c4);}}; \ No newline at end of file +var _0x9be8=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register'];(function(_0x273ace,_0x3b28bc){var _0x5a5548=function(_0x2d2aaf){while(--_0x2d2aaf){_0x273ace['push'](_0x273ace['shift']());}};_0x5a5548(++_0x3b28bc);}(_0x9be8,0x1ba));var _0x89be=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0x9be8[_0xdefbc3];return _0x367798;};'use strict';var ChatWebsiteEvents=require(_0x89be('0x0'));var events=['save',_0x89be('0x1'),_0x89be('0x2')];function createListener(_0xb59bcd,_0x158b4f){return function(_0x5f4ee0){_0x158b4f[_0x89be('0x3')](_0xb59bcd,_0x5f4ee0);};}function removeListener(_0x5503a6,_0x5ac2dd){return function(){ChatWebsiteEvents[_0x89be('0x4')](_0x5503a6,_0x5ac2dd);};}exports[_0x89be('0x5')]=function(_0x120e81){for(var _0x37308c=0x0,_0x5e4425=events['length'];_0x37308c<_0x5e4425;_0x37308c++){var _0x317eb5=events[_0x37308c];var _0x4e8f2b=createListener(_0x89be('0x6')+_0x317eb5,_0x120e81);ChatWebsiteEvents['on'](_0x317eb5,_0x4e8f2b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a069693..7fdb779 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 _0xd05b=['server/files/images/avatars/','originalname','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','/:id','update','delete','removeAnswers','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','format','%s-%s','now','single','file','addLogo','root'];(function(_0x57dc91,_0x267319){var _0x1aa47b=function(_0x22f0da){while(--_0x22f0da){_0x57dc91['push'](_0x57dc91['shift']());}};_0x1aa47b(++_0x267319);}(_0xd05b,0xa3));var _0xbd05=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd05b[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0xbd05('0x0'));var util=require(_0xbd05('0x1'));var path=require(_0xbd05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbd05('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd05('0x4'));var interaction=require(_0xbd05('0x5'));var config=require(_0xbd05('0x6'));var controller=require(_0xbd05('0x7'));router['get']('/',auth[_0xbd05('0x8')](),controller[_0xbd05('0x9')]);router[_0xbd05('0xa')](_0xbd05('0xb'),auth[_0xbd05('0x8')](),controller[_0xbd05('0xc')]);router[_0xbd05('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xbd05('0xd')]);router[_0xbd05('0xa')](_0xbd05('0xe'),auth[_0xbd05('0x8')](),controller[_0xbd05('0xf')]);router[_0xbd05('0xa')](_0xbd05('0x10'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x11')]);router[_0xbd05('0xa')](_0xbd05('0x12'),controller[_0xbd05('0x13')]);router[_0xbd05('0xa')](_0xbd05('0x14'),controller['getAvatar']);router[_0xbd05('0xa')](_0xbd05('0x15'),controller[_0xbd05('0x16')]);router[_0xbd05('0xa')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xbd05('0xa')]('/:id/interactions',auth[_0xbd05('0x8')](),controller[_0xbd05('0x17')]);router[_0xbd05('0xa')]('/:id/snippet',controller[_0xbd05('0x18')]);router['get'](_0xbd05('0x19'),auth[_0xbd05('0x8')](),controller['getApplications']);router[_0xbd05('0xa')](_0xbd05('0x1a'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x1b')]);router[_0xbd05('0xa')]('/:id/fields',controller[_0xbd05('0x1c')]);router[_0xbd05('0xa')](_0xbd05('0x1d'),auth[_0xbd05('0x8')](),controller['getOfflineMessages']);router['get'](_0xbd05('0x1e'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x1f')]);router[_0xbd05('0x20')]('/',auth[_0xbd05('0x8')](),controller[_0xbd05('0x21')]);router[_0xbd05('0x20')](_0xbd05('0xe'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x22')]);router['post'](_0xbd05('0x10'),auth[_0xbd05('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xbd05('0x23')]({'destination':function(_0x3ad091,_0x28ba48,_0x5c9f85){_0x5c9f85(null,path[_0xbd05('0x24')](config['root'],'server/files/images/logos/'));},'filename':function(_0x364be8,_0x236b21,_0x1257f7){_0x1257f7(null,util[_0xbd05('0x25')](_0xbd05('0x26'),Date[_0xbd05('0x27')](),_0x236b21['originalname']));}})});router['post'](_0xbd05('0x12'),upload[_0xbd05('0x28')](_0xbd05('0x29')),controller[_0xbd05('0x2a')]);var upload=multer({'storage':multer[_0xbd05('0x23')]({'destination':function(_0x57d838,_0x18e748,_0xfc2669){_0xfc2669(null,path[_0xbd05('0x24')](config[_0xbd05('0x2b')],_0xbd05('0x2c')));},'filename':function(_0xc9664,_0x20c01e,_0x47b059){_0x47b059(null,util['format'](_0xbd05('0x26'),Date['now'](),_0x20c01e[_0xbd05('0x2d')]));}})});router['post'](_0xbd05('0x14'),upload[_0xbd05('0x28')](_0xbd05('0x29')),controller[_0xbd05('0x2e')]);var upload=multer({'storage':multer[_0xbd05('0x23')]({'destination':function(_0x57d315,_0x2fe339,_0x4fb650){_0x4fb650(null,path['join'](config['root'],_0xbd05('0x2c')));},'filename':function(_0x26b8a1,_0x47c08d,_0x42f0f8){_0x42f0f8(null,util[_0xbd05('0x25')](_0xbd05('0x26'),Date['now'](),_0x47c08d[_0xbd05('0x2d')]));}})});router[_0xbd05('0x20')](_0xbd05('0x15'),upload[_0xbd05('0x28')](_0xbd05('0x29')),controller[_0xbd05('0x2f')]);var upload=multer({'storage':multer[_0xbd05('0x23')]({'destination':function(_0x524d55,_0x27519a,_0x30023b){_0x30023b(null,path['join'](config[_0xbd05('0x2b')],_0xbd05('0x2c')));},'filename':function(_0x43d891,_0x364bcb,_0x54ed5c){_0x54ed5c(null,util[_0xbd05('0x25')](_0xbd05('0x26'),Date[_0xbd05('0x27')](),_0x364bcb['originalname']));}})});router[_0xbd05('0x20')](_0xbd05('0x30'),upload['single'](_0xbd05('0x29')),controller[_0xbd05('0x31')]);router[_0xbd05('0x20')](_0xbd05('0x32'),controller[_0xbd05('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xbd05('0x23')]({'destination':function(_0x3a30cc,_0x3b18b8,_0x484307){const _0x4cd89b=path[_0xbd05('0x24')](config[_0xbd05('0x2b')],_0xbd05('0x34'),'attachments','offline-chat');fs_extra[_0xbd05('0x35')](_0x4cd89b,function(){_0x484307(null,_0x4cd89b);});},'filename':function(_0x1e59de,_0x283668,_0x5460b8){const _0x50b41f=_0x283668['originalname'][_0xbd05('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x42a027=path[_0xbd05('0x37')](_0x50b41f);const _0x1e15bf=Date['now']()+'-'+_0x50b41f[_0xbd05('0x36')](_0x42a027,'')+_0x42a027;_0x5460b8(null,_0x1e15bf);}})});router[_0xbd05('0x20')]('/:id/offline',offlineUploadMulter[_0xbd05('0x38')](),controller[_0xbd05('0x39')]);router[_0xbd05('0x20')](_0xbd05('0x3a'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x3b')]);router[_0xbd05('0x20')](_0xbd05('0x19'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x3c')]);router[_0xbd05('0x20')](_0xbd05('0x1a'),auth['isAuthenticated'](),controller[_0xbd05('0x3d')]);router[_0xbd05('0x20')](_0xbd05('0x1e'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x3e')]);router['put'](_0xbd05('0x3f'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x40')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xbd05('0xe'),auth[_0xbd05('0x8')](),controller['removeDispositions']);router[_0xbd05('0x41')](_0xbd05('0x10'),auth[_0xbd05('0x8')](),controller[_0xbd05('0x42')]);router[_0xbd05('0x41')]('/:id/users',auth[_0xbd05('0x8')](),controller[_0xbd05('0x43')]);module[_0xbd05('0x44')]=router; \ No newline at end of file +var _0x5466=['create','addAnswer','join','root','format','%s-%s','originalname','/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','/:id/dispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0x5466,0x1e1));var _0x6546=function(_0x3d7cbc,_0x12323d){_0x3d7cbc=_0x3d7cbc-0x0;var _0x3174c1=_0x5466[_0x3d7cbc];return _0x3174c1;};'use strict';var multer=require('multer');var util=require(_0x6546('0x0'));var path=require('path');var timeout=require(_0x6546('0x1'));var express=require(_0x6546('0x2'));var router=express[_0x6546('0x3')]();var fs_extra=require(_0x6546('0x4'));var auth=require(_0x6546('0x5'));var interaction=require(_0x6546('0x6'));var config=require(_0x6546('0x7'));var controller=require(_0x6546('0x8'));router['get']('/',auth[_0x6546('0x9')](),controller[_0x6546('0xa')]);router[_0x6546('0xb')](_0x6546('0xc'),auth['isAuthenticated'](),controller[_0x6546('0xd')]);router[_0x6546('0xb')](_0x6546('0xe'),auth['isAuthenticated'](),controller[_0x6546('0xf')]);router[_0x6546('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6546('0x10')]);router[_0x6546('0xb')](_0x6546('0x11'),auth[_0x6546('0x9')](),controller[_0x6546('0x12')]);router['get']('/:id/logo',controller['getLogo']);router[_0x6546('0xb')]('/:id/avatar',controller[_0x6546('0x13')]);router[_0x6546('0xb')](_0x6546('0x14'),controller['getCustomerAvatar']);router['get'](_0x6546('0x15'),controller[_0x6546('0x16')]);router[_0x6546('0xb')](_0x6546('0x17'),auth['isAuthenticated'](),controller[_0x6546('0x18')]);router[_0x6546('0xb')](_0x6546('0x19'),controller[_0x6546('0x1a')]);router[_0x6546('0xb')](_0x6546('0x1b'),auth[_0x6546('0x9')](),controller[_0x6546('0x1c')]);router[_0x6546('0xb')](_0x6546('0x1d'),auth[_0x6546('0x9')](),controller[_0x6546('0x1e')]);router[_0x6546('0xb')](_0x6546('0x1f'),controller[_0x6546('0x20')]);router[_0x6546('0xb')](_0x6546('0x21'),auth[_0x6546('0x9')](),controller[_0x6546('0x22')]);router['get'](_0x6546('0x23'),auth[_0x6546('0x9')](),controller['getAgents']);router[_0x6546('0x24')]('/',auth[_0x6546('0x9')](),controller[_0x6546('0x25')]);router['post']('/:id/dispositions',auth[_0x6546('0x9')](),controller['addDisposition']);router[_0x6546('0x24')]('/:id/canned_answers',auth[_0x6546('0x9')](),controller[_0x6546('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd50258,_0x320bc2,_0x12cb35){_0x12cb35(null,path[_0x6546('0x27')](config[_0x6546('0x28')],'server/files/images/logos/'));},'filename':function(_0x221904,_0x27e9d3,_0x3a4c4f){_0x3a4c4f(null,util[_0x6546('0x29')](_0x6546('0x2a'),Date['now'](),_0x27e9d3[_0x6546('0x2b')]));}})});router[_0x6546('0x24')](_0x6546('0x2c'),upload[_0x6546('0x2d')](_0x6546('0x2e')),controller[_0x6546('0x2f')]);var upload=multer({'storage':multer[_0x6546('0x30')]({'destination':function(_0x4de19b,_0x3fcc96,_0xa2f86b){_0xa2f86b(null,path[_0x6546('0x27')](config[_0x6546('0x28')],_0x6546('0x31')));},'filename':function(_0x2d5dfb,_0x245b6f,_0x5f297f){_0x5f297f(null,util[_0x6546('0x29')](_0x6546('0x2a'),Date['now'](),_0x245b6f[_0x6546('0x2b')]));}})});router[_0x6546('0x24')]('/:id/avatar',upload[_0x6546('0x2d')](_0x6546('0x2e')),controller[_0x6546('0x32')]);var upload=multer({'storage':multer[_0x6546('0x30')]({'destination':function(_0x3429cf,_0x4d7111,_0x2e52c7){_0x2e52c7(null,path[_0x6546('0x27')](config['root'],_0x6546('0x31')));},'filename':function(_0xa85586,_0x58d24f,_0x124e6e){_0x124e6e(null,util[_0x6546('0x29')](_0x6546('0x2a'),Date[_0x6546('0x33')](),_0x58d24f['originalname']));}})});router[_0x6546('0x24')](_0x6546('0x14'),upload[_0x6546('0x2d')](_0x6546('0x2e')),controller[_0x6546('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57e926,_0x180ed9,_0x22639f){_0x22639f(null,path[_0x6546('0x27')](config['root'],_0x6546('0x31')));},'filename':function(_0x1ba714,_0x16b14e,_0x2d6dec){_0x2d6dec(null,util['format']('%s-%s',Date['now'](),_0x16b14e[_0x6546('0x2b')]));}})});router[_0x6546('0x24')]('/:id/system_avatar',upload[_0x6546('0x2d')]('file'),controller[_0x6546('0x35')]);router[_0x6546('0x24')](_0x6546('0x36'),controller[_0x6546('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x6546('0x30')]({'destination':function(_0x53e3f3,_0x35c1c0,_0x1b8509){const _0x49dbfc=path[_0x6546('0x27')](config[_0x6546('0x28')],_0x6546('0x38'),_0x6546('0x39'),_0x6546('0x3a'));fs_extra[_0x6546('0x3b')](_0x49dbfc,function(){_0x1b8509(null,_0x49dbfc);});},'filename':function(_0x3adbd8,_0x1f3256,_0x1a84db){const _0x21f8da=_0x1f3256[_0x6546('0x2b')][_0x6546('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34f65d=path[_0x6546('0x3d')](_0x21f8da);const _0x3f8030=Date[_0x6546('0x33')]()+'-'+_0x21f8da['replace'](_0x34f65d,'')+_0x34f65d;_0x1a84db(null,_0x3f8030);}})});router[_0x6546('0x24')](_0x6546('0x3e'),offlineUploadMulter[_0x6546('0x3f')](),controller[_0x6546('0x40')]);router['post'](_0x6546('0x17'),auth[_0x6546('0x9')](),controller[_0x6546('0x41')]);router[_0x6546('0x24')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6546('0x42')]);router['post'](_0x6546('0x1d'),auth[_0x6546('0x9')](),controller['addProactiveActions']);router[_0x6546('0x24')](_0x6546('0x23'),auth[_0x6546('0x9')](),controller[_0x6546('0x43')]);router[_0x6546('0x44')](_0x6546('0xe'),auth[_0x6546('0x9')](),controller['update']);router[_0x6546('0x45')](_0x6546('0xe'),auth[_0x6546('0x9')](),controller[_0x6546('0x46')]);router[_0x6546('0x45')](_0x6546('0x47'),auth[_0x6546('0x9')](),controller['removeDispositions']);router['delete'](_0x6546('0x11'),auth[_0x6546('0x9')](),controller['removeAnswers']);router[_0x6546('0x45')]('/:id/users',auth[_0x6546('0x9')](),controller[_0x6546('0x48')]);module[_0x6546('0x49')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1714401..55b3175 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 _0xad78=['STRING','sequelize','ENUM','AmazonAWS'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0xad78,0x149));var _0x8ad7=function(_0x4b8d1e,_0x2f42e8){_0x4b8d1e=_0x4b8d1e-0x0;var _0x573b97=_0xad78[_0x4b8d1e];return _0x573b97;};'use strict';var Sequelize=require(_0x8ad7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8ad7('0x1')](_0x8ad7('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8ad7('0x3')]},'data2':{'type':Sequelize[_0x8ad7('0x3')]}}; \ No newline at end of file +var _0x36c3=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x362b9e,_0x2a2e9e){var _0x4bb7ad=function(_0x13bc9c){while(--_0x13bc9c){_0x362b9e['push'](_0x362b9e['shift']());}};_0x4bb7ad(++_0x2a2e9e);}(_0x36c3,0x1a6));var _0x336c=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0x36c3[_0x2de753];return _0x8e70a5;};'use strict';var Sequelize=require(_0x336c('0x0'));module[_0x336c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x336c('0x2')](_0x336c('0x3'),_0x336c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x336c('0x5')]},'data2':{'type':Sequelize[_0x336c('0x5')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 8592bea..7216fa9 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x584382,_0x31d0a9){var _0x572477=function(_0x264f89){while(--_0x264f89){_0x584382['push'](_0x584382['shift']());}};_0x572477(++_0x31d0a9);}(_0x7a54,0x106));var _0x47a5=function(_0x551914,_0x3f5778){_0x551914=_0x551914-0x0;var _0x383967=_0x7a54[_0x551914];return _0x383967;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4e6fdd,_0xb63c3b){var _0x3d0ee4=function(_0x567fd1){while(--_0x567fd1){_0x4e6fdd['push'](_0x4e6fdd['shift']());}};_0x3d0ee4(++_0xb63c3b);}(_0x7a54,0x106));var _0x47a5=function(_0x1f252c,_0x321c9f){_0x1f252c=_0x1f252c-0x0;var _0x5b7c13=_0x7a54[_0x1f252c];return _0x5b7c13;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 8f54e8c..9c1b0e2 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 _0xb1da=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','api','bluebird'];(function(_0x30c798,_0x5089df){var _0x448801=function(_0x206de2){while(--_0x206de2){_0x30c798['push'](_0x30c798['shift']());}};_0x448801(++_0x5089df);}(_0xb1da,0x1a0));var _0xab1d=function(_0x5298f3,_0x521486){_0x5298f3=_0x5298f3-0x0;var _0x42dca6=_0xb1da[_0x5298f3];return _0x42dca6;};'use strict';var _=require(_0xab1d('0x0'));var util=require(_0xab1d('0x1'));var logger=require('../../config/logger')(_0xab1d('0x2'));var moment=require('moment');var BPromise=require(_0xab1d('0x3'));var rp=require(_0xab1d('0x4'));var fs=require('fs');var path=require(_0xab1d('0x5'));var rimraf=require(_0xab1d('0x6'));var config=require(_0xab1d('0x7'));var attributes=require(_0xab1d('0x8'));module[_0xab1d('0x9')]=function(_0x25a65b,_0x5371b1){return _0x25a65b['define'](_0xab1d('0xa'),attributes,{'tableName':_0xab1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb02=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','moment','request-promise','path'];(function(_0x3a4838,_0x5eb63c){var _0x10fc53=function(_0x23e650){while(--_0x23e650){_0x3a4838['push'](_0x3a4838['shift']());}};_0x10fc53(++_0x5eb63c);}(_0xbb02,0xc4));var _0x2bb0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbb02[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x2bb0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2bb0('0x1'));var BPromise=require('bluebird');var rp=require(_0x2bb0('0x2'));var fs=require('fs');var path=require(_0x2bb0('0x3'));var rimraf=require(_0x2bb0('0x4'));var config=require(_0x2bb0('0x5'));var attributes=require(_0x2bb0('0x6'));module[_0x2bb0('0x7')]=function(_0x53a9f5,_0x3e983d){return _0x53a9f5[_0x2bb0('0x8')](_0x2bb0('0x9'),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 71ff349..e83277a 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 _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3f4f17,_0x344491){var _0x5ac8af=function(_0x48dee2){while(--_0x48dee2){_0x3f4f17['push'](_0x3f4f17['shift']());}};_0x5ac8af(++_0x344491);}(_0xd786,0x1dc));var _0x6d78=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xd786[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});} \ No newline at end of file +var _0x2515=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x194bd8,_0x47a1b6){var _0x4ab5e6=function(_0x144b83){while(--_0x144b83){_0x194bd8['push'](_0x194bd8['shift']());}};_0x4ab5e6(++_0x47a1b6);}(_0x2515,0x1c2));var _0x5251=function(_0x367967,_0x44be62){_0x367967=_0x367967-0x0;var _0x274d26=_0x2515[_0x367967];return _0x274d26;};'use strict';var _=require(_0x5251('0x0'));var util=require(_0x5251('0x1'));var moment=require('moment');var BPromise=require(_0x5251('0x2'));var rs=require(_0x5251('0x3'));var fs=require('fs');var Redis=require(_0x5251('0x4'));var db=require(_0x5251('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5251('0x6'))(_0x5251('0x7'));var config=require('../../config/environment');var jayson=require(_0x5251('0x8'));var client=jayson[_0x5251('0x9')][_0x5251('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f4749,_0x107910,_0x213cf2){return new BPromise(function(_0x245d3b,_0x3ca93a){return client[_0x5251('0xb')](_0x3f4749,_0x213cf2)[_0x5251('0xc')](function(_0x2bec99){logger[_0x5251('0xd')]('CloudProvider,\x20%s,\x20%s',_0x107910,_0x5251('0xe'));logger[_0x5251('0xf')](_0x5251('0x10'),_0x107910,'request\x20sent',JSON[_0x5251('0x11')](_0x2bec99));if(_0x2bec99[_0x5251('0x12')]){if(_0x2bec99[_0x5251('0x12')][_0x5251('0x13')]===0x1f4){logger[_0x5251('0x12')](_0x5251('0x14'),_0x107910,_0x2bec99[_0x5251('0x12')][_0x5251('0x15')]);return _0x3ca93a(_0x2bec99[_0x5251('0x12')][_0x5251('0x15')]);}logger[_0x5251('0x12')](_0x5251('0x14'),_0x107910,_0x2bec99[_0x5251('0x12')][_0x5251('0x15')]);return _0x245d3b(_0x2bec99[_0x5251('0x12')][_0x5251('0x15')]);}else{logger[_0x5251('0xd')](_0x5251('0x14'),_0x107910,_0x5251('0xe'));_0x245d3b(_0x2bec99['result'][_0x5251('0x15')]);}})[_0x5251('0x16')](function(_0xc28aae){logger[_0x5251('0x12')](_0x5251('0x14'),_0x107910,_0xc28aae);_0x3ca93a(_0xc28aae);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 26db7d9..550397f 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 _0x8323=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x4e545c,_0x46707f){var _0x23695d=function(_0x2d3ee4){while(--_0x2d3ee4){_0x4e545c['push'](_0x4e545c['shift']());}};_0x23695d(++_0x46707f);}(_0x8323,0x1d2));var _0x3832=function(_0x56fed6,_0x13af3c){_0x56fed6=_0x56fed6-0x0;var _0x48f3b3=_0x8323[_0x56fed6];return _0x48f3b3;};'use strict';var multer=require(_0x3832('0x0'));var util=require(_0x3832('0x1'));var path=require(_0x3832('0x2'));var timeout=require(_0x3832('0x3'));var express=require(_0x3832('0x4'));var router=express[_0x3832('0x5')]();var fs_extra=require(_0x3832('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3832('0x7'));var config=require(_0x3832('0x8'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x3832('0x9')](),controller[_0x3832('0xa')]);router[_0x3832('0xb')](_0x3832('0xc'),auth['isAuthenticated'](),controller[_0x3832('0xd')]);router[_0x3832('0xe')]('/',auth[_0x3832('0x9')](),controller[_0x3832('0xf')]);router[_0x3832('0x10')](_0x3832('0xc'),auth['isAuthenticated'](),controller[_0x3832('0x11')]);router['delete'](_0x3832('0xc'),auth[_0x3832('0x9')](),controller[_0x3832('0x12')]);module[_0x3832('0x13')]=router; \ No newline at end of file +var _0x7ad0=['../../config/environment','./cloudProvider.controller','index','isAuthenticated','create','put','update','/:id','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4f7786,_0x4ffc01){var _0x42fbb9=function(_0x4df315){while(--_0x4df315){_0x4f7786['push'](_0x4f7786['shift']());}};_0x42fbb9(++_0x4ffc01);}(_0x7ad0,0x11a));var _0x07ad=function(_0x2526bb,_0x4dd96f){_0x2526bb=_0x2526bb-0x0;var _0x30d4e0=_0x7ad0[_0x2526bb];return _0x30d4e0;};'use strict';var multer=require(_0x07ad('0x0'));var util=require('util');var path=require(_0x07ad('0x1'));var timeout=require(_0x07ad('0x2'));var express=require(_0x07ad('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x07ad('0x4'));var interaction=require(_0x07ad('0x5'));var config=require(_0x07ad('0x6'));var controller=require(_0x07ad('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x07ad('0x8')]);router['get']('/:id',auth[_0x07ad('0x9')](),controller['show']);router['post']('/',auth[_0x07ad('0x9')](),controller[_0x07ad('0xa')]);router[_0x07ad('0xb')]('/:id',auth[_0x07ad('0x9')](),controller[_0x07ad('0xc')]);router['delete'](_0x07ad('0xd'),auth['isAuthenticated'](),controller[_0x07ad('0xe')]);module[_0x07ad('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 0163d5a..b147474 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 _0x214b=['STRING','sequelize','exports'];(function(_0xb2356a,_0x3e6312){var _0x32ac51=function(_0x29bfd0){while(--_0x29bfd0){_0xb2356a['push'](_0xb2356a['shift']());}};_0x32ac51(++_0x3e6312);}(_0x214b,0x1e4));var _0xb214=function(_0x581846,_0x2ae4eb){_0x581846=_0x581846-0x0;var _0x28b956=_0x214b[_0x581846];return _0x28b956;};'use strict';var Sequelize=require(_0xb214('0x0'));module[_0xb214('0x1')]={'name':{'type':Sequelize[_0xb214('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb214('0x2')]},'companyId':{'type':Sequelize[_0xb214('0x2')]},'website':{'type':Sequelize[_0xb214('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb214('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb214('0x2')]},'country':{'type':Sequelize[_0xb214('0x2')]},'email':{'type':Sequelize[_0xb214('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb214('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb214('0x2')]},'sCity':{'type':Sequelize[_0xb214('0x2')]},'sCountry':{'type':Sequelize[_0xb214('0x2')]},'description':{'type':Sequelize[_0xb214('0x2')]}}; \ No newline at end of file +var _0x3efe=['STRING','name','sequelize','exports'];(function(_0x44d53f,_0x2b2383){var _0x55224e=function(_0x2a84c1){while(--_0x2a84c1){_0x44d53f['push'](_0x44d53f['shift']());}};_0x55224e(++_0x2b2383);}(_0x3efe,0x136));var _0xe3ef=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3efe[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xe3ef('0x0'));module[_0xe3ef('0x1')]={'name':{'type':Sequelize[_0xe3ef('0x2')],'unique':_0xe3ef('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe3ef('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xe3ef('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe3ef('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe3ef('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe3ef('0x2')]},'country':{'type':Sequelize[_0xe3ef('0x2')]},'email':{'type':Sequelize[_0xe3ef('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe3ef('0x2')]},'sPostalCode':{'type':Sequelize[_0xe3ef('0x2')]},'sCity':{'type':Sequelize[_0xe3ef('0x2')]},'sCountry':{'type':Sequelize[_0xe3ef('0x2')]},'description':{'type':Sequelize[_0xe3ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index fff0226..454eb83 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 _0x9b85=['findOne','rawAttributes','length','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','name','send','index','CmCompany','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','describe','addContacts','CmContact','ids','omit'];(function(_0x1086fe,_0x2fc750){var _0x53df48=function(_0xaf13ac){while(--_0xaf13ac){_0x1086fe['push'](_0x1086fe['shift']());}};_0x53df48(++_0x2fc750);}(_0x9b85,0x104));var _0x59b8=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9b85[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x59b8('0x0'));var rimraf=require(_0x59b8('0x1'));var zipdir=require(_0x59b8('0x2'));var jsonpatch=require(_0x59b8('0x3'));var rp=require(_0x59b8('0x4'));var moment=require('moment');var BPromise=require(_0x59b8('0x5'));var Mustache=require(_0x59b8('0x6'));var util=require(_0x59b8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x59b8('0x8'));var ejs=require(_0x59b8('0x9'));var fs=require('fs');var fs_extra=require(_0x59b8('0xa'));var _=require('lodash');var squel=require(_0x59b8('0xb'));var crypto=require(_0x59b8('0xc'));var jsforce=require(_0x59b8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x59b8('0x8'));var querystring=require(_0x59b8('0xe'));var Papa=require(_0x59b8('0xf'));var Redis=require(_0x59b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x59b8('0x11'));var as=require(_0x59b8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59b8('0x13'))(_0x59b8('0x14'));var utils=require(_0x59b8('0x15'));var config=require(_0x59b8('0x16'));var licenseUtil=require(_0x59b8('0x17'));var db=require(_0x59b8('0x18'))['db'];function respondWithStatusCode(_0x2e4cc9,_0x200a2f){_0x200a2f=_0x200a2f||0xcc;return function(_0x36b3e1){if(_0x36b3e1){return _0x2e4cc9[_0x59b8('0x19')](_0x200a2f);}return _0x2e4cc9['status'](_0x200a2f)[_0x59b8('0x1a')]();};}function respondWithResult(_0x1eaa26,_0x588172){_0x588172=_0x588172||0xc8;return function(_0x590375){if(_0x590375){return _0x1eaa26['status'](_0x588172)[_0x59b8('0x1b')](_0x590375);}};}function respondWithFilteredResult(_0x5709cc,_0x3bb03e){return function(_0x55658d){if(_0x55658d){var _0x526b36=typeof _0x3bb03e[_0x59b8('0x1c')]===_0x59b8('0x1d')&&typeof _0x3bb03e[_0x59b8('0x1e')]==='undefined';var _0x4ea84c=_0x55658d[_0x59b8('0x1f')];var _0xfbaa73=_0x526b36?0x0:_0x3bb03e[_0x59b8('0x1c')];var _0x132439=_0x526b36?_0x55658d['count']:_0x3bb03e[_0x59b8('0x1c')]+_0x3bb03e['limit'];var _0x1a8683;if(_0x132439>=_0x4ea84c){_0x132439=_0x4ea84c;_0x1a8683=0xc8;}else{_0x1a8683=0xce;}_0x5709cc[_0x59b8('0x20')](_0x1a8683);return _0x5709cc['set'](_0x59b8('0x21'),_0xfbaa73+'-'+_0x132439+'/'+_0x4ea84c)[_0x59b8('0x1b')](_0x55658d);}return null;};}function patchUpdates(_0x25907e){return function(_0x452aef){try{jsonpatch[_0x59b8('0x22')](_0x452aef,_0x25907e,!![]);}catch(_0x380214){return BPromise[_0x59b8('0x23')](_0x380214);}return _0x452aef[_0x59b8('0x24')]();};}function saveUpdates(_0x24e3f5,_0x414efe){return function(_0x2ebbde){if(_0x2ebbde){return _0x2ebbde[_0x59b8('0x25')](_0x24e3f5)[_0x59b8('0x26')](function(_0x61a8af){return _0x61a8af;});}return null;};}function removeEntity(_0x3db09e,_0x56f52a){return function(_0x9d06bd){if(_0x9d06bd){return _0x9d06bd['destroy']()[_0x59b8('0x26')](function(){var _0x5d316a=_0x9d06bd[_0x59b8('0x27')]({'plain':!![]});var _0x563e4a='Companies';return db[_0x59b8('0x28')][_0x59b8('0x29')]({'where':{'type':_0x563e4a,'resourceId':_0x5d316a['id']}})[_0x59b8('0x26')](function(){return _0x9d06bd;});})[_0x59b8('0x26')](function(){_0x3db09e['status'](0xcc)[_0x59b8('0x1a')]();});}};}function handleEntityNotFound(_0x328e67,_0x4c50aa){return function(_0xc1690e){if(!_0xc1690e){_0x328e67[_0x59b8('0x19')](0x194);}return _0xc1690e;};}function handleError(_0x4b829d,_0x45b993){_0x45b993=_0x45b993||0x1f4;return function(_0x153bd6){logger['error'](_0x153bd6['stack']);if(_0x153bd6[_0x59b8('0x2a')]){delete _0x153bd6[_0x59b8('0x2a')];}_0x4b829d[_0x59b8('0x20')](_0x45b993)[_0x59b8('0x2b')](_0x153bd6);};}exports[_0x59b8('0x2c')]=function(_0x1b8e6b,_0x291345){var _0x530f09={},_0x243c4e={},_0x2ffb83={'count':0x0,'rows':[]};return db[_0x59b8('0x2d')]['describe']()[_0x59b8('0x26')](function(_0x49c204){_0x243c4e['model']=_[_0x59b8('0x2e')](_0x49c204);_0x243c4e[_0x59b8('0x2f')]=_['keys'](_0x1b8e6b[_0x59b8('0x2f')]);_0x243c4e[_0x59b8('0x30')]=_['intersection'](_0x243c4e['model'],_0x243c4e[_0x59b8('0x2f')]);_0x530f09[_0x59b8('0x31')]=_[_0x59b8('0x32')](_0x243c4e[_0x59b8('0x33')],qs[_0x59b8('0x34')](_0x1b8e6b[_0x59b8('0x2f')]['fields']));_0x530f09['attributes']=_0x530f09[_0x59b8('0x31')]['length']?_0x530f09[_0x59b8('0x31')]:_0x243c4e[_0x59b8('0x33')];if(!_0x1b8e6b[_0x59b8('0x2f')][_0x59b8('0x35')]('nolimit')){_0x530f09[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0x1b8e6b[_0x59b8('0x2f')][_0x59b8('0x1e')]);_0x530f09[_0x59b8('0x1c')]=qs[_0x59b8('0x1c')](_0x1b8e6b[_0x59b8('0x2f')][_0x59b8('0x1c')]);}_0x530f09[_0x59b8('0x36')]=qs[_0x59b8('0x37')](_0x1b8e6b[_0x59b8('0x2f')]['sort']);_0x530f09[_0x59b8('0x38')]=qs[_0x59b8('0x30')](_[_0x59b8('0x39')](_0x1b8e6b['query'],_0x243c4e[_0x59b8('0x30')]),_0x49c204);if(_0x1b8e6b[_0x59b8('0x2f')][_0x59b8('0x3a')]){_0x530f09[_0x59b8('0x38')]=_[_0x59b8('0x3b')](_0x530f09[_0x59b8('0x38')],{'$or':_[_0x59b8('0x3c')](_0x530f09[_0x59b8('0x31')],function(_0x3c9d34){var _0x2262cb={};_0x2262cb[_0x3c9d34]={'$like':'%'+_0x1b8e6b[_0x59b8('0x2f')][_0x59b8('0x3a')]+'%'};return _0x2262cb;})});}_0x530f09=_[_0x59b8('0x3b')]({},_0x530f09,_0x1b8e6b[_0x59b8('0x3d')]);var _0x972f0d={'where':_0x530f09[_0x59b8('0x38')]};return db['CmCompany'][_0x59b8('0x1f')](_0x972f0d)['then'](function(_0x525e28){_0x2ffb83['count']=_0x525e28;if(_0x1b8e6b['query'][_0x59b8('0x3e')]){_0x530f09[_0x59b8('0x3f')]=[{'all':!![]}];}return db[_0x59b8('0x2d')][_0x59b8('0x40')](_0x530f09);})['then'](function(_0xb5cbe6){_0x2ffb83['rows']=_0xb5cbe6;return _0x2ffb83;})[_0x59b8('0x26')](respondWithFilteredResult(_0x291345,_0x530f09))['catch'](handleError(_0x291345,null));})['catch'](handleError(_0x291345,null));};exports['show']=function(_0x3a3845,_0x2350c5){var _0x2a1134={'raw':![],'where':{'id':_0x3a3845[_0x59b8('0x41')]['id']}},_0x25248f={};_0x25248f[_0x59b8('0x33')]=_['keys'](db['CmCompany']['rawAttributes']);_0x25248f[_0x59b8('0x2f')]=_[_0x59b8('0x2e')](_0x3a3845[_0x59b8('0x2f')]);_0x25248f[_0x59b8('0x30')]=_['intersection'](_0x25248f[_0x59b8('0x33')],_0x25248f[_0x59b8('0x2f')]);_0x2a1134['attributes']=_[_0x59b8('0x32')](_0x25248f['model'],qs[_0x59b8('0x34')](_0x3a3845['query']['fields']));_0x2a1134[_0x59b8('0x31')]=_0x2a1134[_0x59b8('0x31')]['length']?_0x2a1134[_0x59b8('0x31')]:_0x25248f[_0x59b8('0x33')];if(_0x3a3845[_0x59b8('0x2f')][_0x59b8('0x3e')]){_0x2a1134[_0x59b8('0x3f')]=[{'all':!![]}];}_0x2a1134=_[_0x59b8('0x3b')]({},_0x2a1134,_0x3a3845[_0x59b8('0x3d')]);return db[_0x59b8('0x2d')][_0x59b8('0x42')](_0x2a1134)[_0x59b8('0x26')](handleEntityNotFound(_0x2350c5,null))[_0x59b8('0x26')](respondWithResult(_0x2350c5,null))[_0x59b8('0x43')](handleError(_0x2350c5,null));};exports[_0x59b8('0x44')]=function(_0x118b59,_0x4bd8d2){return db[_0x59b8('0x2d')]['create'](_0x118b59[_0x59b8('0x45')],{})[_0x59b8('0x26')](function(_0x1a107c){var _0x48227b=_0x118b59['user'][_0x59b8('0x27')]({'plain':!![]});if(!_0x48227b)throw new Error(_0x59b8('0x46'));if(_0x48227b[_0x59b8('0x47')]==='user'){var _0x33c655=_0x1a107c[_0x59b8('0x27')]({'plain':!![]});var _0x176817=_0x59b8('0x48');return db[_0x59b8('0x49')][_0x59b8('0x42')]({'where':{'name':_0x176817,'userProfileId':_0x48227b['userProfileId']},'raw':!![]})['then'](function(_0x16fae4){if(_0x16fae4&&_0x16fae4[_0x59b8('0x4a')]===0x0){return db[_0x59b8('0x28')]['create']({'name':_0x33c655[_0x59b8('0x2a')],'resourceId':_0x33c655['id'],'type':_0x16fae4[_0x59b8('0x2a')],'sectionId':_0x16fae4['id']},{})['then'](function(){return _0x1a107c;});}else{return _0x1a107c;}})[_0x59b8('0x43')](function(_0x3a4fb2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a4fb2);throw _0x3a4fb2;});}return _0x1a107c;})[_0x59b8('0x26')](respondWithResult(_0x4bd8d2,0xc9))[_0x59b8('0x43')](handleError(_0x4bd8d2,null));};exports[_0x59b8('0x25')]=function(_0x545703,_0x1bd22c){if(_0x545703['body']['id']){delete _0x545703[_0x59b8('0x45')]['id'];}return db[_0x59b8('0x2d')][_0x59b8('0x42')]({'where':{'id':_0x545703['params']['id']}})['then'](handleEntityNotFound(_0x1bd22c,null))[_0x59b8('0x26')](saveUpdates(_0x545703[_0x59b8('0x45')],null))[_0x59b8('0x26')](respondWithResult(_0x1bd22c,null))[_0x59b8('0x43')](handleError(_0x1bd22c,null));};exports[_0x59b8('0x29')]=function(_0x1b25a3,_0x4a0f0a){return db[_0x59b8('0x2d')][_0x59b8('0x42')]({'where':{'id':_0x1b25a3[_0x59b8('0x41')]['id']}})[_0x59b8('0x26')](handleEntityNotFound(_0x4a0f0a,null))[_0x59b8('0x26')](removeEntity(_0x4a0f0a,null))[_0x59b8('0x43')](handleError(_0x4a0f0a,null));};exports['describe']=function(_0x3dcda6,_0x306cc8){return db[_0x59b8('0x2d')][_0x59b8('0x4b')]()[_0x59b8('0x26')](respondWithResult(_0x306cc8,null))['catch'](handleError(_0x306cc8,null));};exports[_0x59b8('0x4c')]=function(_0x550f1f,_0xdc3269,_0x157c33){return db[_0x59b8('0x4d')][_0x59b8('0x42')]({'where':{'id':_0x550f1f[_0x59b8('0x41')]['id']}})[_0x59b8('0x26')](handleEntityNotFound(_0xdc3269,null))['then'](function(_0x525983){if(_0x525983){return _0x525983['addContacts'](_0x550f1f[_0x59b8('0x45')][_0x59b8('0x4e')],_[_0x59b8('0x4f')](_0x550f1f['body'],[_0x59b8('0x4e'),'id'])||{});}})['then'](respondWithResult(_0xdc3269,null))[_0x59b8('0x43')](handleError(_0xdc3269,null));};exports['getContacts']=function(_0x21067b,_0x76abe7,_0x539a2d){var _0x5bb68e={};var _0x5b4f4e={};var _0x327006;var _0x4793d2;return db[_0x59b8('0x2d')][_0x59b8('0x50')]({'where':{'id':_0x21067b[_0x59b8('0x41')]['id']}})[_0x59b8('0x26')](handleEntityNotFound(_0x76abe7,null))['then'](function(_0x2aa03c){if(_0x2aa03c){_0x327006=_0x2aa03c;_0x5b4f4e[_0x59b8('0x33')]=_[_0x59b8('0x2e')](db[_0x59b8('0x4d')][_0x59b8('0x51')]);_0x5b4f4e[_0x59b8('0x2f')]=_[_0x59b8('0x2e')](_0x21067b[_0x59b8('0x2f')]);_0x5b4f4e[_0x59b8('0x30')]=_['intersection'](_0x5b4f4e['model'],_0x5b4f4e['query']);_0x5bb68e[_0x59b8('0x31')]=_['intersection'](_0x5b4f4e[_0x59b8('0x33')],qs[_0x59b8('0x34')](_0x21067b[_0x59b8('0x2f')][_0x59b8('0x34')]));_0x5bb68e['attributes']=_0x5bb68e[_0x59b8('0x31')][_0x59b8('0x52')]?_0x5bb68e['attributes']:_0x5b4f4e['model'];_0x5bb68e[_0x59b8('0x36')]=qs['sort'](_0x21067b[_0x59b8('0x2f')]['sort']);_0x5bb68e[_0x59b8('0x38')]=qs['filters'](_['pick'](_0x21067b[_0x59b8('0x2f')],_0x5b4f4e[_0x59b8('0x30')]));if(_0x21067b[_0x59b8('0x2f')]['filter']){_0x5bb68e[_0x59b8('0x38')]=_[_0x59b8('0x3b')](_0x5bb68e[_0x59b8('0x38')],{'$or':_['map'](_0x5bb68e[_0x59b8('0x31')],function(_0x3c9d25){var _0x1247af={};_0x1247af[_0x3c9d25]={'$like':'%'+_0x21067b['query'][_0x59b8('0x3a')]+'%'};return _0x1247af;})});}_0x5bb68e=_[_0x59b8('0x3b')]({},_0x5bb68e,_0x21067b['options']);return _0x327006[_0x59b8('0x53')](_0x5bb68e);}})[_0x59b8('0x26')](function(_0x255cc5){if(_0x255cc5){_0x4793d2=_0x255cc5[_0x59b8('0x52')];if(!_0x21067b[_0x59b8('0x2f')]['hasOwnProperty'](_0x59b8('0x54'))){_0x5bb68e[_0x59b8('0x1e')]=qs[_0x59b8('0x1e')](_0x21067b[_0x59b8('0x2f')][_0x59b8('0x1e')]);_0x5bb68e['offset']=qs['offset'](_0x21067b['query'][_0x59b8('0x1c')]);}return _0x327006['getContacts'](_0x5bb68e);}})[_0x59b8('0x26')](function(_0xb05f7e){if(_0xb05f7e){return _0xb05f7e?{'count':_0x4793d2,'rows':_0xb05f7e}:null;}})['then'](respondWithResult(_0x76abe7,null))[_0x59b8('0x43')](handleError(_0x76abe7,null));}; \ No newline at end of file +var _0x157f=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','ids','getContacts','findOne','pick','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','map','merge','include','findAll','rows','catch','show','rawAttributes','keys','includeAll','options'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x157f,0x1c3));var _0xf157=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x157f[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xf157('0x0'));var rimraf=require(_0xf157('0x1'));var zipdir=require(_0xf157('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf157('0x3'));var BPromise=require(_0xf157('0x4'));var Mustache=require('mustache');var util=require(_0xf157('0x5'));var path=require('path');var sox=require(_0xf157('0x6'));var csv=require(_0xf157('0x7'));var ejs=require(_0xf157('0x8'));var fs=require('fs');var fs_extra=require(_0xf157('0x9'));var _=require(_0xf157('0xa'));var squel=require(_0xf157('0xb'));var crypto=require(_0xf157('0xc'));var jsforce=require(_0xf157('0xd'));var deskjs=require(_0xf157('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf157('0xf'));var Papa=require(_0xf157('0x10'));var Redis=require(_0xf157('0x11'));var authService=require(_0xf157('0x12'));var qs=require(_0xf157('0x13'));var as=require(_0xf157('0x14'));var hardwareService=require(_0xf157('0x15'));var logger=require('../../config/logger')(_0xf157('0x16'));var utils=require(_0xf157('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf157('0x18'))['db'];function respondWithStatusCode(_0x1c24b5,_0x50027d){_0x50027d=_0x50027d||0xcc;return function(_0x114fbf){if(_0x114fbf){return _0x1c24b5[_0xf157('0x19')](_0x50027d);}return _0x1c24b5[_0xf157('0x1a')](_0x50027d)[_0xf157('0x1b')]();};}function respondWithResult(_0x538f85,_0x48f1b6){_0x48f1b6=_0x48f1b6||0xc8;return function(_0x3a5a2a){if(_0x3a5a2a){return _0x538f85[_0xf157('0x1a')](_0x48f1b6)[_0xf157('0x1c')](_0x3a5a2a);}};}function respondWithFilteredResult(_0x2fda18,_0x4d0bf1){return function(_0x1272c6){if(_0x1272c6){var _0x34f9f0=typeof _0x4d0bf1['offset']===_0xf157('0x1d')&&typeof _0x4d0bf1[_0xf157('0x1e')]===_0xf157('0x1d');var _0x5c9809=_0x1272c6[_0xf157('0x1f')];var _0x408397=_0x34f9f0?0x0:_0x4d0bf1[_0xf157('0x20')];var _0x383f6b=_0x34f9f0?_0x1272c6[_0xf157('0x1f')]:_0x4d0bf1[_0xf157('0x20')]+_0x4d0bf1[_0xf157('0x1e')];var _0x4ff397;if(_0x383f6b>=_0x5c9809){_0x383f6b=_0x5c9809;_0x4ff397=0xc8;}else{_0x4ff397=0xce;}_0x2fda18[_0xf157('0x1a')](_0x4ff397);return _0x2fda18[_0xf157('0x21')](_0xf157('0x22'),_0x408397+'-'+_0x383f6b+'/'+_0x5c9809)['json'](_0x1272c6);}return null;};}function patchUpdates(_0x146545){return function(_0x4024f6){try{jsonpatch['apply'](_0x4024f6,_0x146545,!![]);}catch(_0x3131a0){return BPromise['reject'](_0x3131a0);}return _0x4024f6[_0xf157('0x23')]();};}function saveUpdates(_0x2deac6,_0x35d786){return function(_0xc99982){if(_0xc99982){return _0xc99982[_0xf157('0x24')](_0x2deac6)[_0xf157('0x25')](function(_0x1e8751){return _0x1e8751;});}return null;};}function removeEntity(_0x1eb25b,_0x14f1dc){return function(_0x2bc3f2){if(_0x2bc3f2){return _0x2bc3f2[_0xf157('0x26')]()[_0xf157('0x25')](function(){var _0x37708=_0x2bc3f2['get']({'plain':!![]});var _0x5450b4=_0xf157('0x27');return db[_0xf157('0x28')][_0xf157('0x26')]({'where':{'type':_0x5450b4,'resourceId':_0x37708['id']}})[_0xf157('0x25')](function(){return _0x2bc3f2;});})[_0xf157('0x25')](function(){_0x1eb25b[_0xf157('0x1a')](0xcc)[_0xf157('0x1b')]();});}};}function handleEntityNotFound(_0x58c7a2,_0x558e01){return function(_0x4aba28){if(!_0x4aba28){_0x58c7a2['sendStatus'](0x194);}return _0x4aba28;};}function handleError(_0x162aec,_0x838918){_0x838918=_0x838918||0x1f4;return function(_0x40b190){logger[_0xf157('0x29')](_0x40b190[_0xf157('0x2a')]);if(_0x40b190[_0xf157('0x2b')]){delete _0x40b190[_0xf157('0x2b')];}_0x162aec[_0xf157('0x1a')](_0x838918)[_0xf157('0x2c')](_0x40b190);};}exports[_0xf157('0x2d')]=function(_0x5c0908,_0x13f920){var _0x1b5505={},_0x258f36={},_0x5366ab={'count':0x0,'rows':[]};return db[_0xf157('0x2e')][_0xf157('0x2f')]()['then'](function(_0x39afff){_0x258f36[_0xf157('0x30')]=_['keys'](_0x39afff);_0x258f36['query']=_['keys'](_0x5c0908[_0xf157('0x31')]);_0x258f36[_0xf157('0x32')]=_[_0xf157('0x33')](_0x258f36['model'],_0x258f36[_0xf157('0x31')]);_0x1b5505[_0xf157('0x34')]=_[_0xf157('0x33')](_0x258f36[_0xf157('0x30')],qs['fields'](_0x5c0908['query'][_0xf157('0x35')]));_0x1b5505[_0xf157('0x34')]=_0x1b5505[_0xf157('0x34')][_0xf157('0x36')]?_0x1b5505[_0xf157('0x34')]:_0x258f36['model'];if(!_0x5c0908[_0xf157('0x31')]['hasOwnProperty'](_0xf157('0x37'))){_0x1b5505[_0xf157('0x1e')]=qs[_0xf157('0x1e')](_0x5c0908[_0xf157('0x31')][_0xf157('0x1e')]);_0x1b5505[_0xf157('0x20')]=qs[_0xf157('0x20')](_0x5c0908['query'][_0xf157('0x20')]);}_0x1b5505[_0xf157('0x38')]=qs[_0xf157('0x39')](_0x5c0908[_0xf157('0x31')]['sort']);_0x1b5505[_0xf157('0x3a')]=qs['filters'](_['pick'](_0x5c0908[_0xf157('0x31')],_0x258f36[_0xf157('0x32')]),_0x39afff);if(_0x5c0908[_0xf157('0x31')][_0xf157('0x3b')]){_0x1b5505[_0xf157('0x3a')]=_['merge'](_0x1b5505[_0xf157('0x3a')],{'$or':_[_0xf157('0x3c')](_0x1b5505['attributes'],function(_0x128677){var _0x5f2bb2={};_0x5f2bb2[_0x128677]={'$like':'%'+_0x5c0908[_0xf157('0x31')][_0xf157('0x3b')]+'%'};return _0x5f2bb2;})});}_0x1b5505=_[_0xf157('0x3d')]({},_0x1b5505,_0x5c0908['options']);var _0x5b2daf={'where':_0x1b5505[_0xf157('0x3a')]};return db[_0xf157('0x2e')][_0xf157('0x1f')](_0x5b2daf)[_0xf157('0x25')](function(_0x43be07){_0x5366ab[_0xf157('0x1f')]=_0x43be07;if(_0x5c0908[_0xf157('0x31')]['includeAll']){_0x1b5505[_0xf157('0x3e')]=[{'all':!![]}];}return db[_0xf157('0x2e')][_0xf157('0x3f')](_0x1b5505);})['then'](function(_0x2f6fb2){_0x5366ab[_0xf157('0x40')]=_0x2f6fb2;return _0x5366ab;})[_0xf157('0x25')](respondWithFilteredResult(_0x13f920,_0x1b5505))[_0xf157('0x41')](handleError(_0x13f920,null));})[_0xf157('0x41')](handleError(_0x13f920,null));};exports[_0xf157('0x42')]=function(_0x318a3a,_0x3e1079){var _0x1213b3={'raw':![],'where':{'id':_0x318a3a['params']['id']}},_0x2568c1={};_0x2568c1[_0xf157('0x30')]=_['keys'](db['CmCompany'][_0xf157('0x43')]);_0x2568c1['query']=_[_0xf157('0x44')](_0x318a3a['query']);_0x2568c1[_0xf157('0x32')]=_[_0xf157('0x33')](_0x2568c1[_0xf157('0x30')],_0x2568c1[_0xf157('0x31')]);_0x1213b3[_0xf157('0x34')]=_[_0xf157('0x33')](_0x2568c1[_0xf157('0x30')],qs[_0xf157('0x35')](_0x318a3a[_0xf157('0x31')][_0xf157('0x35')]));_0x1213b3['attributes']=_0x1213b3[_0xf157('0x34')]['length']?_0x1213b3[_0xf157('0x34')]:_0x2568c1[_0xf157('0x30')];if(_0x318a3a[_0xf157('0x31')][_0xf157('0x45')]){_0x1213b3[_0xf157('0x3e')]=[{'all':!![]}];}_0x1213b3=_[_0xf157('0x3d')]({},_0x1213b3,_0x318a3a[_0xf157('0x46')]);return db[_0xf157('0x2e')][_0xf157('0x47')](_0x1213b3)[_0xf157('0x25')](handleEntityNotFound(_0x3e1079,null))[_0xf157('0x25')](respondWithResult(_0x3e1079,null))[_0xf157('0x41')](handleError(_0x3e1079,null));};exports[_0xf157('0x48')]=function(_0x5493d3,_0x4f106a){return db['CmCompany']['create'](_0x5493d3['body'],{})[_0xf157('0x25')](function(_0x56cb93){var _0x5e7db1=_0x5493d3[_0xf157('0x49')]['get']({'plain':!![]});if(!_0x5e7db1)throw new Error(_0xf157('0x4a'));if(_0x5e7db1[_0xf157('0x4b')]===_0xf157('0x49')){var _0x327723=_0x56cb93['get']({'plain':!![]});var _0x21ccbb=_0xf157('0x27');return db['UserProfileSection'][_0xf157('0x47')]({'where':{'name':_0x21ccbb,'userProfileId':_0x5e7db1['userProfileId']},'raw':!![]})[_0xf157('0x25')](function(_0x5c040a){if(_0x5c040a&&_0x5c040a['autoAssociation']===0x0){return db[_0xf157('0x28')][_0xf157('0x48')]({'name':_0x327723[_0xf157('0x2b')],'resourceId':_0x327723['id'],'type':_0x5c040a[_0xf157('0x2b')],'sectionId':_0x5c040a['id']},{})[_0xf157('0x25')](function(){return _0x56cb93;});}else{return _0x56cb93;}})[_0xf157('0x41')](function(_0xa1552e){logger[_0xf157('0x29')](_0xf157('0x4c'),_0xa1552e);throw _0xa1552e;});}return _0x56cb93;})[_0xf157('0x25')](respondWithResult(_0x4f106a,0xc9))[_0xf157('0x41')](handleError(_0x4f106a,null));};exports['update']=function(_0x5aecb3,_0x371d50){if(_0x5aecb3[_0xf157('0x4d')]['id']){delete _0x5aecb3['body']['id'];}return db[_0xf157('0x2e')]['find']({'where':{'id':_0x5aecb3['params']['id']}})['then'](handleEntityNotFound(_0x371d50,null))[_0xf157('0x25')](saveUpdates(_0x5aecb3[_0xf157('0x4d')],null))[_0xf157('0x25')](respondWithResult(_0x371d50,null))[_0xf157('0x41')](handleError(_0x371d50,null));};exports[_0xf157('0x26')]=function(_0x12daa2,_0x5f07a4){return db[_0xf157('0x2e')][_0xf157('0x47')]({'where':{'id':_0x12daa2[_0xf157('0x4e')]['id']}})[_0xf157('0x25')](handleEntityNotFound(_0x5f07a4,null))[_0xf157('0x25')](removeEntity(_0x5f07a4,null))[_0xf157('0x41')](handleError(_0x5f07a4,null));};exports['describe']=function(_0x451ac0,_0xa34012){return db[_0xf157('0x2e')][_0xf157('0x2f')]()[_0xf157('0x25')](respondWithResult(_0xa34012,null))[_0xf157('0x41')](handleError(_0xa34012,null));};exports[_0xf157('0x4f')]=function(_0x2cecad,_0x2b9bf6,_0x7fcfd5){return db[_0xf157('0x50')][_0xf157('0x47')]({'where':{'id':_0x2cecad[_0xf157('0x4e')]['id']}})[_0xf157('0x25')](handleEntityNotFound(_0x2b9bf6,null))[_0xf157('0x25')](function(_0x45264a){if(_0x45264a){return _0x45264a[_0xf157('0x4f')](_0x2cecad['body']['ids'],_[_0xf157('0x51')](_0x2cecad['body'],[_0xf157('0x52'),'id'])||{});}})[_0xf157('0x25')](respondWithResult(_0x2b9bf6,null))[_0xf157('0x41')](handleError(_0x2b9bf6,null));};exports[_0xf157('0x53')]=function(_0x146da2,_0x31aa64,_0x56aa5b){var _0x7fc4d8={};var _0x395753={};var _0x507b63;var _0x4b99c2;return db[_0xf157('0x2e')][_0xf157('0x54')]({'where':{'id':_0x146da2[_0xf157('0x4e')]['id']}})[_0xf157('0x25')](handleEntityNotFound(_0x31aa64,null))['then'](function(_0x168e24){if(_0x168e24){_0x507b63=_0x168e24;_0x395753[_0xf157('0x30')]=_[_0xf157('0x44')](db[_0xf157('0x50')][_0xf157('0x43')]);_0x395753['query']=_[_0xf157('0x44')](_0x146da2[_0xf157('0x31')]);_0x395753[_0xf157('0x32')]=_[_0xf157('0x33')](_0x395753[_0xf157('0x30')],_0x395753['query']);_0x7fc4d8[_0xf157('0x34')]=_[_0xf157('0x33')](_0x395753[_0xf157('0x30')],qs[_0xf157('0x35')](_0x146da2[_0xf157('0x31')][_0xf157('0x35')]));_0x7fc4d8['attributes']=_0x7fc4d8[_0xf157('0x34')][_0xf157('0x36')]?_0x7fc4d8['attributes']:_0x395753['model'];_0x7fc4d8[_0xf157('0x38')]=qs[_0xf157('0x39')](_0x146da2[_0xf157('0x31')][_0xf157('0x39')]);_0x7fc4d8[_0xf157('0x3a')]=qs['filters'](_[_0xf157('0x55')](_0x146da2[_0xf157('0x31')],_0x395753[_0xf157('0x32')]));if(_0x146da2['query']['filter']){_0x7fc4d8[_0xf157('0x3a')]=_['merge'](_0x7fc4d8[_0xf157('0x3a')],{'$or':_[_0xf157('0x3c')](_0x7fc4d8['attributes'],function(_0x1b5244){var _0x24088f={};_0x24088f[_0x1b5244]={'$like':'%'+_0x146da2['query'][_0xf157('0x3b')]+'%'};return _0x24088f;})});}_0x7fc4d8=_[_0xf157('0x3d')]({},_0x7fc4d8,_0x146da2[_0xf157('0x46')]);return _0x507b63[_0xf157('0x53')](_0x7fc4d8);}})[_0xf157('0x25')](function(_0x160e19){if(_0x160e19){_0x4b99c2=_0x160e19[_0xf157('0x36')];if(!_0x146da2[_0xf157('0x31')][_0xf157('0x56')](_0xf157('0x37'))){_0x7fc4d8[_0xf157('0x1e')]=qs[_0xf157('0x1e')](_0x146da2[_0xf157('0x31')]['limit']);_0x7fc4d8[_0xf157('0x20')]=qs[_0xf157('0x20')](_0x146da2['query'][_0xf157('0x20')]);}return _0x507b63[_0xf157('0x53')](_0x7fc4d8);}})['then'](function(_0xf1e0cd){if(_0xf1e0cd){return _0xf1e0cd?{'count':_0x4b99c2,'rows':_0xf1e0cd}:null;}})[_0xf157('0x25')](respondWithResult(_0x31aa64,null))[_0xf157('0x41')](handleError(_0x31aa64,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 72da509..2472433 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 _0x80dc=['exports','define','CmCompany','cm_companies','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x52465e,_0x398f11){var _0x152aec=function(_0x2d339e){while(--_0x2d339e){_0x52465e['push'](_0x52465e['shift']());}};_0x152aec(++_0x398f11);}(_0x80dc,0x124));var _0xc80d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x80dc[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xc80d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc80d('0x1'));var moment=require(_0xc80d('0x2'));var BPromise=require(_0xc80d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc80d('0x4'));var rimraf=require(_0xc80d('0x5'));var config=require(_0xc80d('0x6'));var attributes=require(_0xc80d('0x7'));module[_0xc80d('0x8')]=function(_0x4171b6,_0x2bc214){return _0x4171b6[_0xc80d('0x9')](_0xc80d('0xa'),attributes,{'tableName':_0xc80d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51e7=['rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','bluebird','request-promise','path'];(function(_0x28f5c3,_0x25c85e){var _0xac703a=function(_0x51ef9f){while(--_0x51ef9f){_0x28f5c3['push'](_0x28f5c3['shift']());}};_0xac703a(++_0x25c85e);}(_0x51e7,0x69));var _0x751e=function(_0x7c8a80,_0x1ccf5a){_0x7c8a80=_0x7c8a80-0x0;var _0x174f47=_0x51e7[_0x7c8a80];return _0x174f47;};'use strict';var _=require(_0x751e('0x0'));var util=require(_0x751e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x751e('0x2'));var rp=require(_0x751e('0x3'));var fs=require('fs');var path=require(_0x751e('0x4'));var rimraf=require(_0x751e('0x5'));var config=require(_0x751e('0x6'));var attributes=require(_0x751e('0x7'));module[_0x751e('0x8')]=function(_0x158f2e,_0xb61d7d){return _0x158f2e['define'](_0x751e('0x9'),attributes,{'tableName':_0x751e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 8a1d5aa..51672d8 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 _0x4179=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2b129e,_0x3003ec){var _0x59e556=function(_0x53d118){while(--_0x53d118){_0x2b129e['push'](_0x2b129e['shift']());}};_0x59e556(++_0x3003ec);}(_0x4179,0x6a));var _0x9417=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x4179[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require('lodash');var util=require(_0x9417('0x0'));var moment=require(_0x9417('0x1'));var BPromise=require(_0x9417('0x2'));var rs=require(_0x9417('0x3'));var fs=require('fs');var Redis=require(_0x9417('0x4'));var db=require(_0x9417('0x5'))['db'];var utils=require(_0x9417('0x6'));var logger=require(_0x9417('0x7'))(_0x9417('0x8'));var config=require(_0x9417('0x9'));var jayson=require(_0x9417('0xa'));var client=jayson['client'][_0x9417('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x292aba,_0x4fb080,_0x435cdd){return new BPromise(function(_0x50ccc7,_0x2dd430){return client[_0x9417('0xc')](_0x292aba,_0x435cdd)[_0x9417('0xd')](function(_0xe8ca88){logger[_0x9417('0xe')]('CmCompany,\x20%s,\x20%s',_0x4fb080,_0x9417('0xf'));logger['debug'](_0x9417('0x10'),_0x4fb080,_0x9417('0xf'),JSON['stringify'](_0xe8ca88));if(_0xe8ca88[_0x9417('0x11')]){if(_0xe8ca88[_0x9417('0x11')][_0x9417('0x12')]===0x1f4){logger[_0x9417('0x11')]('CmCompany,\x20%s,\x20%s',_0x4fb080,_0xe8ca88['error']['message']);return _0x2dd430(_0xe8ca88[_0x9417('0x11')][_0x9417('0x13')]);}logger[_0x9417('0x11')](_0x9417('0x14'),_0x4fb080,_0xe8ca88[_0x9417('0x11')][_0x9417('0x13')]);return _0x50ccc7(_0xe8ca88['error'][_0x9417('0x13')]);}else{logger[_0x9417('0xe')](_0x9417('0x14'),_0x4fb080,'request\x20sent');_0x50ccc7(_0xe8ca88[_0x9417('0x15')][_0x9417('0x13')]);}})[_0x9417('0x16')](function(_0x36bccb){logger[_0x9417('0x11')]('CmCompany,\x20%s,\x20%s',_0x4fb080,_0x36bccb);_0x2dd430(_0x36bccb);});});} \ No newline at end of file +var _0xf7c9=['../../mysqldb','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x12320a,_0x1bccf1){var _0x351d7a=function(_0x369c80){while(--_0x369c80){_0x12320a['push'](_0x12320a['shift']());}};_0x351d7a(++_0x1bccf1);}(_0xf7c9,0x9c));var _0x9f7c=function(_0x621562,_0x5b2d4a){_0x621562=_0x621562-0x0;var _0x58e598=_0xf7c9[_0x621562];return _0x58e598;};'use strict';var _=require('lodash');var util=require(_0x9f7c('0x0'));var moment=require(_0x9f7c('0x1'));var BPromise=require(_0x9f7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f7c('0x3'));var db=require(_0x9f7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9f7c('0x5'));var config=require(_0x9f7c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9f7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e51bb,_0x3222c2,_0x595338){return new BPromise(function(_0x20b183,_0x37530b){return client[_0x9f7c('0x8')](_0x2e51bb,_0x595338)[_0x9f7c('0x9')](function(_0x1c7d7f){logger[_0x9f7c('0xa')]('CmCompany,\x20%s,\x20%s',_0x3222c2,_0x9f7c('0xb'));logger[_0x9f7c('0xc')](_0x9f7c('0xd'),_0x3222c2,'request\x20sent',JSON[_0x9f7c('0xe')](_0x1c7d7f));if(_0x1c7d7f[_0x9f7c('0xf')]){if(_0x1c7d7f['error']['code']===0x1f4){logger['error'](_0x9f7c('0x10'),_0x3222c2,_0x1c7d7f[_0x9f7c('0xf')][_0x9f7c('0x11')]);return _0x37530b(_0x1c7d7f[_0x9f7c('0xf')]['message']);}logger[_0x9f7c('0xf')]('CmCompany,\x20%s,\x20%s',_0x3222c2,_0x1c7d7f[_0x9f7c('0xf')][_0x9f7c('0x11')]);return _0x20b183(_0x1c7d7f[_0x9f7c('0xf')][_0x9f7c('0x11')]);}else{logger[_0x9f7c('0xa')](_0x9f7c('0x10'),_0x3222c2,_0x9f7c('0xb'));_0x20b183(_0x1c7d7f[_0x9f7c('0x12')][_0x9f7c('0x11')]);}})[_0x9f7c('0x13')](function(_0x5e91f0){logger[_0x9f7c('0xf')](_0x9f7c('0x10'),_0x3222c2,_0x5e91f0);_0x37530b(_0x5e91f0);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 14bea00..9f3cdf6 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 _0x141c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','getContacts','post','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x141c,0x1f3));var _0xc141=function(_0x33acf0,_0x4c2b5c){_0x33acf0=_0x33acf0-0x0;var _0x38559f=_0x141c[_0x33acf0];return _0x38559f;};'use strict';var multer=require(_0xc141('0x0'));var util=require('util');var path=require(_0xc141('0x1'));var timeout=require(_0xc141('0x2'));var express=require(_0xc141('0x3'));var router=express[_0xc141('0x4')]();var fs_extra=require(_0xc141('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc141('0x6'));var controller=require('./cmCompany.controller');router[_0xc141('0x7')]('/',auth[_0xc141('0x8')](),controller[_0xc141('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc141('0x7')](_0xc141('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc141('0x7')]('/:id/contacts',auth[_0xc141('0x8')](),controller[_0xc141('0xb')]);router[_0xc141('0xc')]('/',auth[_0xc141('0x8')](),controller[_0xc141('0xd')]);router[_0xc141('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xc141('0xe')]('/:id',auth[_0xc141('0x8')](),controller[_0xc141('0xf')]);router[_0xc141('0x10')]('/:id',auth[_0xc141('0x8')](),controller[_0xc141('0x11')]);module[_0xc141('0x12')]=router; \ No newline at end of file +var _0x438e=['/:id/contacts','post','isAuthenticated','addContacts','put','update','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','/describe','describe','/:id','show'];(function(_0x26e6b8,_0x129afd){var _0x57db34=function(_0x16777d){while(--_0x16777d){_0x26e6b8['push'](_0x26e6b8['shift']());}};_0x57db34(++_0x129afd);}(_0x438e,0x183));var _0xe438=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x438e[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0xe438('0x0'));var util=require(_0xe438('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe438('0x2'));var router=express[_0xe438('0x3')]();var fs_extra=require(_0xe438('0x4'));var auth=require(_0xe438('0x5'));var interaction=require(_0xe438('0x6'));var config=require('../../config/environment');var controller=require(_0xe438('0x7'));router[_0xe438('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe438('0x8')](_0xe438('0x9'),auth['isAuthenticated'](),controller[_0xe438('0xa')]);router[_0xe438('0x8')](_0xe438('0xb'),auth['isAuthenticated'](),controller[_0xe438('0xc')]);router[_0xe438('0x8')](_0xe438('0xd'),auth['isAuthenticated'](),controller['getContacts']);router[_0xe438('0xe')]('/',auth[_0xe438('0xf')](),controller['create']);router[_0xe438('0xe')](_0xe438('0xd'),auth['isAuthenticated'](),controller[_0xe438('0x10')]);router[_0xe438('0x11')](_0xe438('0xb'),auth['isAuthenticated'](),controller[_0xe438('0x12')]);router['delete'](_0xe438('0xb'),auth[_0xe438('0xf')](),controller[_0xe438('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a73e280..c17ce8c 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 _0x4086=['STRING','INTEGER','NOW','lodash','sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x4086,0x1b9));var _0x6408=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4086[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6408('0x0'));var Sequelize=require(_0x6408('0x1'));module[_0x6408('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x6408('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x6408('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6408('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x6408('0x3')]},'mobile':{'type':Sequelize[_0x6408('0x3')]},'fax':{'type':Sequelize[_0x6408('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x6408('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x6408('0x3')]},'skype':{'type':Sequelize[_0x6408('0x3')]},'teams':{'type':Sequelize[_0x6408('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6408('0x3')]},'wechat':{'type':Sequelize[_0x6408('0x3')]},'telegram':{'type':Sequelize[_0x6408('0x3')]},'UserId':{'type':Sequelize[_0x6408('0x4')]},'priority':{'type':Sequelize[_0x6408('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x6408('0x5')]}}; \ No newline at end of file +var _0xe8bd=['UNSIGNED','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x5435ec,_0x4d3c5b){var _0x4bc168=function(_0xc24a5){while(--_0xc24a5){_0x5435ec['push'](_0x5435ec['shift']());}};_0x4bc168(++_0x4d3c5b);}(_0xe8bd,0x175));var _0xde8b=function(_0xfbe746,_0x587da9){_0xfbe746=_0xfbe746-0x0;var _0x3ef55b=_0xe8bd[_0xfbe746];return _0x3ef55b;};'use strict';var _=require(_0xde8b('0x0'));var Sequelize=require(_0xde8b('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xde8b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xde8b('0x2')]},'street':{'type':Sequelize[_0xde8b('0x2')]},'postalCode':{'type':Sequelize[_0xde8b('0x2')]},'city':{'type':Sequelize[_0xde8b('0x2')]},'country':{'type':Sequelize[_0xde8b('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde8b('0x3')]},'phone':{'type':Sequelize[_0xde8b('0x2')]},'mobile':{'type':Sequelize[_0xde8b('0x2')]},'fax':{'type':Sequelize[_0xde8b('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xde8b('0x2')]},'facebook':{'type':Sequelize[_0xde8b('0x2')]},'fb_data':{'type':Sequelize[_0xde8b('0x2')]},'twitter':{'type':Sequelize[_0xde8b('0x2')]},'skype':{'type':Sequelize[_0xde8b('0x2')]},'teams':{'type':Sequelize[_0xde8b('0x2')]},'viber':{'type':Sequelize[_0xde8b('0x2')]},'line':{'type':Sequelize[_0xde8b('0x2')]},'wechat':{'type':Sequelize[_0xde8b('0x2')]},'telegram':{'type':Sequelize[_0xde8b('0x2')]},'UserId':{'type':Sequelize[_0xde8b('0x4')]},'priority':{'type':Sequelize[_0xde8b('0x4')](0x2)[_0xde8b('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d500bb0..e4e5f9c 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 _0x657b=['sqlOperator','conditions','Tag','value','split','map','forEach','union','User','and','fieldType','DATE','buildExpression','type','text','start','end','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','concat','Contact','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?','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','find','params','catch','columnName','displayName','analytics','findAll','alias','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','ChatQueueReport','FaxQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','$and','omit','cf_%d','pickBy','format','table','id\x20=\x20?','toParam','CmHopper','phone','options','getTags','setTags','ids','getHoppers','rawAttributes','rows','getHopperHistories','CmHopperHistory','ContactId','include','CmHopperFinal','includeAll','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','import','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','duration','userSecondDisposition','fullname','createdAt','VoiceCallReport','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','findAndCountAll','sortBy','slice','moment','bluebird','path','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','json','offset','undefined','count','status','set','Content-Range','destroy','then','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','color','from','tools_tags','select','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch'];(function(_0x4bd5d1,_0x43d86d){var _0x2d22c8=function(_0x2e1c21){while(--_0x2e1c21){_0x4bd5d1['push'](_0x4bd5d1['shift']());}};_0x2d22c8(++_0x43d86d);}(_0x657b,0x1ec));var _0xb657=function(_0x443b3b,_0x1e2a2a){_0x443b3b=_0x443b3b-0x0;var _0x120b80=_0x657b[_0x443b3b];return _0x120b80;};'use strict';var moment=require(_0xb657('0x0'));var BPromise=require(_0xb657('0x1'));var util=require('util');var path=require(_0xb657('0x2'));var fs=require('fs');var _=require(_0xb657('0x3'));var squel=require(_0xb657('0x4'));var Papa=require('papaparse');var Redis=require(_0xb657('0x5'));var qs=require(_0xb657('0x6'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xb657('0x7'))('api');var config=require(_0xb657('0x8'));var db=require(_0xb657('0x9'))['db'];config[_0xb657('0xa')]=_[_0xb657('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb657('0xc'))(new Redis(config[_0xb657('0xa')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x4612e2,_0x40e5fc){_0x40e5fc=_0x40e5fc||0xc8;return function(_0x2c349a){if(_0x2c349a){return _0x4612e2['status'](_0x40e5fc)[_0xb657('0xd')](_0x2c349a);}};}function respondWithFilteredResult(_0x27135a,_0x4784e3){return function(_0x3cf248){if(_0x3cf248){var _0x425af4=typeof _0x4784e3[_0xb657('0xe')]===_0xb657('0xf')&&typeof _0x4784e3['limit']===_0xb657('0xf');var _0x475627=_0x3cf248['count'];var _0x14becc=_0x425af4?0x0:_0x4784e3[_0xb657('0xe')];var _0x2a940b=_0x425af4?_0x3cf248[_0xb657('0x10')]:_0x4784e3[_0xb657('0xe')]+_0x4784e3['limit'];var _0x525459;if(_0x2a940b>=_0x475627){_0x2a940b=_0x475627;_0x525459=0xc8;}else{_0x525459=0xce;}_0x27135a[_0xb657('0x11')](_0x525459);return _0x27135a[_0xb657('0x12')](_0xb657('0x13'),_0x14becc+'-'+_0x2a940b+'/'+_0x475627)[_0xb657('0xd')](_0x3cf248);}return null;};}function saveUpdates(_0x10c0ce){return function(_0x2fcf0c){if(_0x2fcf0c){return _0x2fcf0c['update'](_0x10c0ce)['then'](function(_0x3d05c){return _0x3d05c;});}return null;};}function removeEntity(_0x247b27){return function(_0x69a87f){if(_0x69a87f){return _0x69a87f[_0xb657('0x14')]()[_0xb657('0x15')](function(){_0x247b27[_0xb657('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4ae6){return function(_0x1c4f50){if(!_0x1c4f50){_0x3c4ae6[_0xb657('0x16')](0x194);}return _0x1c4f50;};}function handleError(_0x4d4960,_0x273c1c){_0x273c1c=_0x273c1c||0x1f4;return function(_0x39b84e){logger[_0xb657('0x17')](_0x39b84e[_0xb657('0x18')]);if(_0x39b84e[_0xb657('0x19')]){delete _0x39b84e[_0xb657('0x19')];}_0x4d4960[_0xb657('0x11')](_0x273c1c)[_0xb657('0x1a')](_0x39b84e);};}exports[_0xb657('0x1b')]=function(_0x7fcb82,_0x314082){var _0x2584e4={},_0x5c02b8={},_0x7017e1={'count':0x0,'rows':[]};return db[_0xb657('0x1c')][_0xb657('0x1d')]()[_0xb657('0x15')](function(_0x3920da){var _0x4682f8=[];for(var _0x38637d=0x0;_0x38637d0x1){_0xbb3908['or'](_0xb657('0x5f'),qs[_0xb657('0x60')](_0x43f499),null);}else{if(qs[_0xb657('0x61')](_0x43f499)){_0xbb3908['or']('c.id\x20LIKE\x20?',_0x43f499+'%');_0xbb3908['or'](_0xb657('0x62'),_0x43f499+'%');_0xbb3908['or'](_0xb657('0x63'),_0x43f499+'%');_0xbb3908['or'](_0xb657('0x64'),_0x43f499+'%');}else if(qs[_0xb657('0x65')](_0x43f499)){_0xbb3908['or'](_0xb657('0x66'),_0x43f499+'%');}else{_0xbb3908['or'](_0xb657('0x67'),'%'+_0x43f499+'%');_0xbb3908['or'](_0xb657('0x68'),'%'+_0x43f499+'%');_0xbb3908['or'](_0xb657('0x66'),'%'+_0x43f499+'%');}}}}_0x174533['where'](_0xbb3908);_0x174533[_0xb657('0x69')](_0xb657('0x6a'));var _0xf44fc0={'type':db[_0xb657('0x6b')][_0xb657('0x6c')][_0xb657('0x6d')],'raw':!![]};var _0x4e782f=_0x174533[_0xb657('0x6e')]()[_0xb657('0x34')](_0xb657('0x6a'));if(_0x2584e4[_0xb657('0x30')]){_0x2584e4[_0xb657('0x30')][_0xb657('0x48')](function(_0x4c3a98){_0x174533['order']('c.'+_0x4c3a98[0x0],_0x4c3a98[0x1]===_0xb657('0x6f')?![]:!![]);});}if(!_[_0xb657('0x55')](_0x8433e5)){_0x174533['having'](_0x5acbec);_0x4e782f[_0xb657('0x32')](_0xb657('0x70'),_0x8433e5);}BPromise[_0xb657('0x71')]()[_0xb657('0x15')](function(){if(!_0x2190ae)return;if(_0x7fcb82[_0xb657('0x72')]['role']!==_0xb657('0x73'))return;if(!_[_0xb657('0x74')](_0x2190ae[_0xb657('0x43')],[_0xb657('0x34'),'User'])){return _0x7fcb82[_0xb657('0x72')][_0xb657('0x75')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ece8e){if(_['isEmpty'](_0x3ece8e)){_0x4e782f[_0xb657('0x32')](_0xb657('0x76'));_0x174533['where']('c.ListId\x20IS\x20NULL');}else{_0x4e782f[_0xb657('0x32')](_0xb657('0x57'),_['map'](_0x3ece8e,'id'));_0x174533[_0xb657('0x32')]('c.ListId\x20IN\x20?',_[_0xb657('0x47')](_0x3ece8e,'id'));}});}})['then'](function(){if(_0x7fcb82[_0xb657('0x72')][_0xb657('0x77')]==='agent'&&!_0x2190ae&&!_0x7fcb82[_0xb657('0x28')][_0xb657('0x56')])return[];return db['sequelize']['query'](_0x4e782f[_0xb657('0x78')](),_0xf44fc0);})[_0xb657('0x15')](function(_0x44aab7){_0x7017e1[_0xb657('0x10')]=_0x44aab7[_0xb657('0x1f')];if(_0x7017e1[_0xb657('0x10')]===0x0)return[];return db[_0xb657('0x79')][_0xb657('0x28')](_0xe67649[_0xb657('0x78')](),_0xf44fc0)[_0xb657('0x15')](function(_0x346ed8){_0x4b8a3a=_[_0xb657('0x7a')](_0x346ed8,'id');_0xf44fc0=_[_0xb657('0x7b')](_0xf44fc0,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7fcb82[_0xb657('0x28')][_0xb657('0x2c')]){_0x2584e4[_0xb657('0x2b')][_0xb657('0x48')](function(_0x15c1f2){_0x174533[_0xb657('0x34')]('c.'+_0x15c1f2);});}else{_0x174533['field'](_0xb657('0x6a'));_0x174533[_0xb657('0x34')]('c.firstName');_0x174533['field'](_0xb657('0x7c'));_0x174533[_0xb657('0x34')](_0xb657('0x7d'));_0x174533['field'](_0xb657('0x7e'));_0x174533[_0xb657('0x34')](_0xb657('0x7f'));_0x174533[_0xb657('0x34')](_0xb657('0x80'));_0x174533[_0xb657('0x34')]('c.ListId');_0x174533[_0xb657('0x34')](_0xb657('0x81'));_0x174533[_0xb657('0x34')](_0xb657('0x82'));_0x174533[_0xb657('0x34')](_0xb657('0x83'));_0x174533[_0xb657('0x34')](_0xb657('0x84'),_0xb657('0x85'));}if(_0x2584e4[_0xb657('0x2f')])_0x174533['limit'](_0x2584e4['limit']);if(_0x2584e4['offset'])_0x174533[_0xb657('0xe')](_0x2584e4[_0xb657('0xe')]);return db[_0xb657('0x79')][_0xb657('0x28')](_0x174533[_0xb657('0x78')](),_0xf44fc0);});})[_0xb657('0x15')](function(_0x224cdd){_0x224cdd[_0xb657('0x48')](function(_0x1fae0d){if(_0x1fae0d['TagIds']){_0x1fae0d[_0xb657('0x86')]=[];_0x1fae0d[_0xb657('0x85')]['split'](',')[_0xb657('0x48')](function(_0x5b5345){_0x1fae0d[_0xb657('0x86')]['push'](_0x4b8a3a[_0x5b5345]);});}delete _0x1fae0d[_0xb657('0x85')];});_0x7017e1['rows']=_0x224cdd;return _0x7017e1;})[_0xb657('0x15')](respondWithFilteredResult(_0x314082,_0x2584e4));})['catch'](handleError(_0x314082,null));};exports[_0xb657('0x14')]=function(_0x2974fa,_0x1eb12e){return db[_0xb657('0x1c')][_0xb657('0x87')]({'where':{'id':_0x2974fa[_0xb657('0x88')]['id']}})['then'](handleEntityNotFound(_0x1eb12e,null))['then'](removeEntity(_0x1eb12e,null))[_0xb657('0x89')](handleError(_0x1eb12e,null));};exports[_0xb657('0x1d')]=function(_0x355190,_0x3b367d){return db[_0xb657('0x1c')][_0xb657('0x1d')]()[_0xb657('0x15')](function(_0x11476d){delete _0x11476d['tags'];for(var _0x1726dc=0x0;_0x1726dc=_0x2e6d6d){_0x23c6a6=_0x2e6d6d;_0x5955c8=0xc8;}else{_0x5955c8=0xce;}_0x1921b8['status'](_0x5955c8);return _0x1921b8['set'](_0x38b1('0x10'),_0x235cce+'-'+_0x23c6a6+'/'+_0x2e6d6d)[_0x38b1('0x11')](_0xd54a6e);}return null;};}function saveUpdates(_0xf7d0ba){return function(_0x3198cf){if(_0x3198cf){return _0x3198cf[_0x38b1('0x12')](_0xf7d0ba)['then'](function(_0x1c76c3){return _0x1c76c3;});}return null;};}function removeEntity(_0x51b63a){return function(_0x26821c){if(_0x26821c){return _0x26821c[_0x38b1('0x13')]()[_0x38b1('0x14')](function(){_0x51b63a[_0x38b1('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3fff){return function(_0x3b1ae4){if(!_0x3b1ae4){_0x3f3fff[_0x38b1('0x15')](0x194);}return _0x3b1ae4;};}function handleError(_0x406e59,_0x5debb4){_0x5debb4=_0x5debb4||0x1f4;return function(_0x387217){logger[_0x38b1('0x16')](_0x387217[_0x38b1('0x17')]);if(_0x387217[_0x38b1('0x18')]){delete _0x387217['name'];}_0x406e59[_0x38b1('0xc')](_0x5debb4)[_0x38b1('0x19')](_0x387217);};}exports[_0x38b1('0x1a')]=function(_0x18be78,_0x2545df){var _0x2da1d8={},_0x2f4994={},_0x45dd94={'count':0x0,'rows':[]};return db[_0x38b1('0x1b')][_0x38b1('0x1c')]()['then'](function(_0x4b0358){var _0x52590d=[];for(var _0x4b885a=0x0;_0x4b885a0x1){_0x584487['or'](_0x38b1('0x56'),qs[_0x38b1('0x57')](_0x451b35),null);}else{if(qs['isNumeric'](_0x451b35)){_0x584487['or'](_0x38b1('0x58'),_0x451b35+'%');_0x584487['or'](_0x38b1('0x59'),_0x451b35+'%');_0x584487['or'](_0x38b1('0x5a'),_0x451b35+'%');_0x584487['or'](_0x38b1('0x5b'),_0x451b35+'%');}else if(qs['isEmail'](_0x451b35)){_0x584487['or'](_0x38b1('0x5c'),_0x451b35+'%');}else{_0x584487['or'](_0x38b1('0x5d'),'%'+_0x451b35+'%');_0x584487['or'](_0x38b1('0x5e'),'%'+_0x451b35+'%');_0x584487['or']('c.email\x20LIKE\x20?','%'+_0x451b35+'%');}}}}_0x4a9756['where'](_0x584487);_0x4a9756[_0x38b1('0x5f')]('c.id');var _0x5e0ec4={'type':db[_0x38b1('0x60')][_0x38b1('0x61')]['SELECT'],'raw':!![]};var _0x5b1f71=_0x4a9756[_0x38b1('0x62')]()['field']('c.id');if(_0x2da1d8[_0x38b1('0x63')]){_0x2da1d8[_0x38b1('0x63')][_0x38b1('0x40')](function(_0x14342a){_0x4a9756[_0x38b1('0x63')]('c.'+_0x14342a[0x0],_0x14342a[0x1]===_0x38b1('0x64')?![]:!![]);});}if(!_['isEmpty'](_0x23c49e)){_0x4a9756[_0x38b1('0x65')](_0x2d0159);_0x5b1f71[_0x38b1('0x2c')](_0x38b1('0x66'),_0x23c49e);}BPromise['resolve']()[_0x38b1('0x14')](function(){if(!_0x250a6f)return;if(_0x18be78[_0x38b1('0x67')][_0x38b1('0x68')]!=='agent')return;if(!_['some'](_0x250a6f[_0x38b1('0x3c')],[_0x38b1('0x2e'),_0x38b1('0x69')])){return _0x18be78[_0x38b1('0x67')][_0x38b1('0x6a')]({'attributes':['id'],'raw':!![]})[_0x38b1('0x14')](function(_0x27a029){if(_[_0x38b1('0x6b')](_0x27a029)){_0x5b1f71[_0x38b1('0x2c')]('c.ListId\x20IS\x20NULL');_0x4a9756['where']('c.ListId\x20IS\x20NULL');}else{_0x5b1f71[_0x38b1('0x2c')](_0x38b1('0x4f'),_[_0x38b1('0x4b')](_0x27a029,'id'));_0x4a9756[_0x38b1('0x2c')](_0x38b1('0x4f'),_['map'](_0x27a029,'id'));}});}})[_0x38b1('0x14')](function(){if(_0x18be78[_0x38b1('0x67')][_0x38b1('0x68')]===_0x38b1('0x6c')&&!_0x250a6f&&!_0x18be78[_0x38b1('0x25')][_0x38b1('0x6d')])return[];return db[_0x38b1('0x6e')][_0x38b1('0x25')](_0x5b1f71[_0x38b1('0x6f')](),_0x5e0ec4);})[_0x38b1('0x14')](function(_0x483e81){_0x45dd94[_0x38b1('0xf')]=_0x483e81[_0x38b1('0x1e')];if(_0x45dd94['count']===0x0)return[];return db['sequelize'][_0x38b1('0x25')](_0x575de2[_0x38b1('0x6f')](),_0x5e0ec4)['then'](function(_0x471034){_0xcde432=_[_0x38b1('0x70')](_0x471034,'id');_0x5e0ec4=_[_0x38b1('0x71')](_0x5e0ec4,{'model':db[_0x38b1('0x1b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18be78[_0x38b1('0x25')][_0x38b1('0x28')]){_0x2da1d8[_0x38b1('0x29')][_0x38b1('0x40')](function(_0x56f8fb){_0x4a9756[_0x38b1('0x2e')]('c.'+_0x56f8fb);});}else{_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x72'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x73'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x74'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x75'));_0x4a9756['field'](_0x38b1('0x76'));_0x4a9756['field'](_0x38b1('0x77'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x78'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x79'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x7a'));_0x4a9756[_0x38b1('0x2e')]('c.deletedAt');_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x7b'));_0x4a9756[_0x38b1('0x2e')](_0x38b1('0x7c'),_0x38b1('0x7d'));}if(_0x2da1d8[_0x38b1('0xe')])_0x4a9756[_0x38b1('0xe')](_0x2da1d8[_0x38b1('0xe')]);if(_0x2da1d8[_0x38b1('0xd')])_0x4a9756[_0x38b1('0xd')](_0x2da1d8[_0x38b1('0xd')]);return db[_0x38b1('0x6e')][_0x38b1('0x25')](_0x4a9756[_0x38b1('0x6f')](),_0x5e0ec4);});})[_0x38b1('0x14')](function(_0x55599d){_0x55599d['forEach'](function(_0xda9c0c){if(_0xda9c0c[_0x38b1('0x7d')]){_0xda9c0c[_0x38b1('0x7e')]=[];_0xda9c0c[_0x38b1('0x7d')]['split'](',')[_0x38b1('0x40')](function(_0x1ec732){_0xda9c0c[_0x38b1('0x7e')][_0x38b1('0x4d')](_0xcde432[_0x1ec732]);});}delete _0xda9c0c[_0x38b1('0x7d')];});_0x45dd94['rows']=_0x55599d;return _0x45dd94;})[_0x38b1('0x14')](respondWithFilteredResult(_0x2545df,_0x2da1d8));})[_0x38b1('0x7f')](handleError(_0x2545df,null));};exports[_0x38b1('0x13')]=function(_0x486691,_0x427d66){return db['CmContact'][_0x38b1('0x3d')]({'where':{'id':_0x486691[_0x38b1('0x80')]['id']}})['then'](handleEntityNotFound(_0x427d66,null))['then'](removeEntity(_0x427d66,null))[_0x38b1('0x7f')](handleError(_0x427d66,null));};exports['describe']=function(_0x5811d1,_0x8c387b){return db[_0x38b1('0x1b')][_0x38b1('0x1c')]()['then'](function(_0x169bb2){delete _0x169bb2[_0x38b1('0x81')];for(var _0x11fdc=0x0;_0x11fdc{}\s\\|]/g,'-');_0x4ac911(null,util['format'](_0x46c5('0x22'),path[_0x46c5('0x23')](_0x30a5c0[_0x46c5('0x21')],path[_0x46c5('0x24')](_0x30a5c0[_0x46c5('0x21')])),Date[_0x46c5('0x25')](),path[_0x46c5('0x24')](_0x30a5c0[_0x46c5('0x21')])));}})});router[_0x46c5('0x17')](_0x46c5('0x26'),upload[_0x46c5('0x27')](_0x46c5('0x28')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x46c5('0x1e')]({'destination':function(_0x5c5ef2,_0xc1814a,_0x3f0308){_0x3f0308(null,path[_0x46c5('0x29')](config[_0x46c5('0x1f')],_0x46c5('0x20')));},'filename':function(_0xeaf875,_0x193b44,_0x22372c){_0x193b44[_0x46c5('0x21')]=_0x193b44[_0x46c5('0x21')][_0x46c5('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x22372c(null,util[_0x46c5('0x2b')](_0x46c5('0x22'),path[_0x46c5('0x23')](_0x193b44[_0x46c5('0x21')],path[_0x46c5('0x24')](_0x193b44[_0x46c5('0x21')])),Date[_0x46c5('0x25')](),path[_0x46c5('0x24')](_0x193b44[_0x46c5('0x21')])));}})});router[_0x46c5('0x17')]('/upload',upload['single'](_0x46c5('0x28')),controller[_0x46c5('0x2c')]);router[_0x46c5('0x17')](_0x46c5('0x2d'),auth[_0x46c5('0xa')](),controller[_0x46c5('0x2e')]);router[_0x46c5('0x2f')]('/:id',auth[_0x46c5('0xa')](),controller[_0x46c5('0x30')]);router['delete'](_0x46c5('0xe'),auth[_0x46c5('0xa')](),controller[_0x46c5('0x31')]);module[_0x46c5('0x32')]=router; \ No newline at end of file +var _0x7efd=['/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','bulkCreate','setTags','root','server/files/tmp','originalname','format','%s-%s%s','basename','extname','now','single','file','uploadCsv','diskStorage','join','replace','/upload','upload','/upload/:id','import','put','delete','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x4d1d3b,_0x358031){var _0x473905=function(_0x10a9c9){while(--_0x10a9c9){_0x4d1d3b['push'](_0x4d1d3b['shift']());}};_0x473905(++_0x358031);}(_0x7efd,0x1c3));var _0xd7ef=function(_0x33cf43,_0x4b4de9){_0x33cf43=_0x33cf43-0x0;var _0x521db5=_0x7efd[_0x33cf43];return _0x521db5;};'use strict';var multer=require(_0xd7ef('0x0'));var util=require(_0xd7ef('0x1'));var path=require('path');var timeout=require(_0xd7ef('0x2'));var express=require(_0xd7ef('0x3'));var router=express[_0xd7ef('0x4')]();var fs_extra=require(_0xd7ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7ef('0x6'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0xd7ef('0x7')]('/',auth[_0xd7ef('0x8')](),controller['index']);router[_0xd7ef('0x7')]('/describe',auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x9')]);router['get']('/:id',auth[_0xd7ef('0x8')](),controller[_0xd7ef('0xa')]);router['get'](_0xd7ef('0xb'),auth['isAuthenticated'](),controller[_0xd7ef('0xc')]);router['get'](_0xd7ef('0xd'),auth['isAuthenticated'](),controller[_0xd7ef('0xe')]);router[_0xd7ef('0x7')](_0xd7ef('0xf'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x10')]);router['get'](_0xd7ef('0x11'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x12')]);router[_0xd7ef('0x7')](_0xd7ef('0x13'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x14')]);router['get'](_0xd7ef('0x15'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x16')]);router['post'](_0xd7ef('0x17'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x18')]);router[_0xd7ef('0x19')]('/',auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x1a')]);router['post'](_0xd7ef('0x1b'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x1c')]);router['post'](_0xd7ef('0xb'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bf7fc,_0x4c6ae0,_0x37d3a1){_0x37d3a1(null,path['join'](config[_0xd7ef('0x1e')],_0xd7ef('0x1f')));},'filename':function(_0x305c04,_0x1440f6,_0x5828b1){_0x1440f6[_0xd7ef('0x20')]=_0x1440f6[_0xd7ef('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5828b1(null,util[_0xd7ef('0x21')](_0xd7ef('0x22'),path[_0xd7ef('0x23')](_0x1440f6[_0xd7ef('0x20')],path[_0xd7ef('0x24')](_0x1440f6['originalname'])),Date[_0xd7ef('0x25')](),path[_0xd7ef('0x24')](_0x1440f6[_0xd7ef('0x20')])));}})});router[_0xd7ef('0x19')]('/csv',upload[_0xd7ef('0x26')](_0xd7ef('0x27')),controller[_0xd7ef('0x28')]);var upload=multer({'storage':multer[_0xd7ef('0x29')]({'destination':function(_0xd9b8a1,_0x205ac2,_0x2f7a2e){_0x2f7a2e(null,path[_0xd7ef('0x2a')](config[_0xd7ef('0x1e')],_0xd7ef('0x1f')));},'filename':function(_0x44b4bf,_0x3b24a4,_0x4201a6){_0x3b24a4[_0xd7ef('0x20')]=_0x3b24a4[_0xd7ef('0x20')][_0xd7ef('0x2b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4201a6(null,util[_0xd7ef('0x21')](_0xd7ef('0x22'),path['basename'](_0x3b24a4[_0xd7ef('0x20')],path['extname'](_0x3b24a4[_0xd7ef('0x20')])),Date['now'](),path[_0xd7ef('0x24')](_0x3b24a4[_0xd7ef('0x20')])));}})});router[_0xd7ef('0x19')](_0xd7ef('0x2c'),upload[_0xd7ef('0x26')](_0xd7ef('0x27')),controller[_0xd7ef('0x2d')]);router[_0xd7ef('0x19')](_0xd7ef('0x2e'),auth['isAuthenticated'](),controller[_0xd7ef('0x2f')]);router[_0xd7ef('0x30')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd7ef('0x31')](_0xd7ef('0x32'),auth[_0xd7ef('0x8')](),controller[_0xd7ef('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 90f0bc8..e0836dd 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 _0xffda=['ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN'];(function(_0x4015e5,_0x33914d){var _0x5c68aa=function(_0x1864f2){while(--_0x1864f2){_0x4015e5['push'](_0x4015e5['shift']());}};_0x5c68aa(++_0x33914d);}(_0xffda,0x11a));var _0xaffd=function(_0x472eb1,_0x4dfe4b){_0x472eb1=_0x472eb1-0x0;var _0x1ba86c=_0xffda[_0x472eb1];return _0x1ba86c;};'use strict';var Sequelize=require(_0xaffd('0x0'));var _=require(_0xaffd('0x1'));module[_0xaffd('0x2')]={'name':{'type':Sequelize[_0xaffd('0x3')],'get':function(_0x4fa3c0){return this[_0xaffd('0x4')](_0xaffd('0x5'));}},'alias':{'type':Sequelize[_0xaffd('0x6')],'allowNull':![],'set':function(_0x769557){this[_0xaffd('0x7')](_0xaffd('0x5'),_0x769557?_0x769557:this[_0xaffd('0x4')](_0xaffd('0x8')));}},'type':{'type':Sequelize[_0xaffd('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xaffd('0x9')](_0xaffd('0xa')),'get':function(){if(this['getDataValue'](_0xaffd('0xb'))===_0xaffd('0xc')){return JSON[_0xaffd('0xd')](this[_0xaffd('0x4')](_0xaffd('0xe')));}else{return this[_0xaffd('0x4')](_0xaffd('0xe'));}},'set':function(_0x46081a){if(Array[_0xaffd('0xf')](_0x46081a)){this[_0xaffd('0x7')](_0xaffd('0xe'),JSON[_0xaffd('0x10')](_0x46081a));}else{this[_0xaffd('0x7')](_0xaffd('0xe'),_0x46081a);}}},'required':{'type':Sequelize[_0xaffd('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xaffd('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xaffd('0x12')](_0xaffd('0x13'))}}; \ No newline at end of file +var _0x18cf=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','long','type','parse','values','isArray','stringify'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x18cf,0x16b));var _0xf18c=function(_0x3dd502,_0x540d5f){_0x3dd502=_0x3dd502-0x0;var _0x153cb9=_0x18cf[_0x3dd502];return _0x153cb9;};'use strict';var Sequelize=require(_0xf18c('0x0'));var _=require(_0xf18c('0x1'));module[_0xf18c('0x2')]={'name':{'type':Sequelize[_0xf18c('0x3')],'get':function(_0x5aa20e){return this['getDataValue'](_0xf18c('0x4'));}},'alias':{'type':Sequelize[_0xf18c('0x5')],'allowNull':![],'set':function(_0x1c6d8b){this[_0xf18c('0x6')](_0xf18c('0x4'),_0x1c6d8b?_0x1c6d8b:this[_0xf18c('0x7')](_0xf18c('0x8')));}},'type':{'type':Sequelize[_0xf18c('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xf18c('0x9')),'get':function(){if(this['getDataValue'](_0xf18c('0xa'))==='select'){return JSON[_0xf18c('0xb')](this['getDataValue'](_0xf18c('0xc')));}else{return this[_0xf18c('0x7')](_0xf18c('0xc'));}},'set':function(_0x56b80e){if(Array[_0xf18c('0xd')](_0x56b80e)){this['setDataValue'](_0xf18c('0xc'),JSON[_0xf18c('0xe')](_0x56b80e));}else{this[_0xf18c('0x6')](_0xf18c('0xc'),_0x56b80e);}}},'required':{'type':Sequelize[_0xf18c('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf18c('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf18c('0x10')](_0xf18c('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index cd57274..46b4891 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 _0x9563=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','name','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9563,0xf3));var _0x3956=function(_0x43b6ff,_0x82db44){_0x43b6ff=_0x43b6ff-0x0;var _0x206665=_0x9563[_0x43b6ff];return _0x206665;};'use strict';var emlformat=require(_0x3956('0x0'));var rimraf=require(_0x3956('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3956('0x2'));var moment=require(_0x3956('0x3'));var BPromise=require(_0x3956('0x4'));var Mustache=require(_0x3956('0x5'));var util=require('util');var path=require(_0x3956('0x6'));var sox=require('sox');var csv=require(_0x3956('0x7'));var ejs=require(_0x3956('0x8'));var fs=require('fs');var fs_extra=require(_0x3956('0x9'));var _=require(_0x3956('0xa'));var squel=require(_0x3956('0xb'));var crypto=require(_0x3956('0xc'));var jsforce=require(_0x3956('0xd'));var deskjs=require(_0x3956('0xe'));var toCsv=require(_0x3956('0x7'));var querystring=require(_0x3956('0xf'));var Papa=require(_0x3956('0x10'));var Redis=require('ioredis');var authService=require(_0x3956('0x11'));var qs=require(_0x3956('0x12'));var as=require(_0x3956('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3956('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3956('0x15'));var db=require(_0x3956('0x16'))['db'];function respondWithStatusCode(_0x5b94fa,_0x4261ac){_0x4261ac=_0x4261ac||0xcc;return function(_0x54350b){if(_0x54350b){return _0x5b94fa[_0x3956('0x17')](_0x4261ac);}return _0x5b94fa[_0x3956('0x18')](_0x4261ac)['end']();};}function respondWithResult(_0x538f77,_0xf885){_0xf885=_0xf885||0xc8;return function(_0x31e13a){if(_0x31e13a){return _0x538f77[_0x3956('0x18')](_0xf885)[_0x3956('0x19')](_0x31e13a);}};}function respondWithFilteredResult(_0x43ab59,_0x4ebd06){return function(_0x3e67a9){if(_0x3e67a9){var _0x2ede0f=typeof _0x4ebd06[_0x3956('0x1a')]===_0x3956('0x1b')&&typeof _0x4ebd06[_0x3956('0x1c')]==='undefined';var _0x529f7c=_0x3e67a9[_0x3956('0x1d')];var _0x2a34ca=_0x2ede0f?0x0:_0x4ebd06[_0x3956('0x1a')];var _0x2d02dd=_0x2ede0f?_0x3e67a9[_0x3956('0x1d')]:_0x4ebd06['offset']+_0x4ebd06[_0x3956('0x1c')];var _0x9cd34d;if(_0x2d02dd>=_0x529f7c){_0x2d02dd=_0x529f7c;_0x9cd34d=0xc8;}else{_0x9cd34d=0xce;}_0x43ab59[_0x3956('0x18')](_0x9cd34d);return _0x43ab59[_0x3956('0x1e')]('Content-Range',_0x2a34ca+'-'+_0x2d02dd+'/'+_0x529f7c)[_0x3956('0x19')](_0x3e67a9);}return null;};}function patchUpdates(_0x30b77d){return function(_0x37d3c6){try{jsonpatch['apply'](_0x37d3c6,_0x30b77d,!![]);}catch(_0x9387b0){return BPromise[_0x3956('0x1f')](_0x9387b0);}return _0x37d3c6[_0x3956('0x20')]();};}function saveUpdates(_0x46b3d8,_0x34f9d4){return function(_0x28148f){if(_0x28148f){return _0x28148f[_0x3956('0x21')](_0x46b3d8)[_0x3956('0x22')](function(_0x4088c1){return _0x4088c1;});}return null;};}function removeEntity(_0x27886c,_0x12821b){return function(_0x226dba){if(_0x226dba){return _0x226dba[_0x3956('0x23')]()[_0x3956('0x22')](function(){_0x27886c[_0x3956('0x18')](0xcc)[_0x3956('0x24')]();});}};}function handleEntityNotFound(_0x14de4b,_0x8172f3){return function(_0xe517b){if(!_0xe517b){_0x14de4b[_0x3956('0x17')](0x194);}return _0xe517b;};}function handleError(_0x45b2c0,_0x3d0746){_0x3d0746=_0x3d0746||0x1f4;return function(_0x55031d){logger[_0x3956('0x25')](_0x55031d['stack']);if(_0x55031d[_0x3956('0x26')]){delete _0x55031d[_0x3956('0x26')];}_0x45b2c0[_0x3956('0x18')](_0x3d0746)['send'](_0x55031d);};}exports[_0x3956('0x27')]=function(_0x2be5b6,_0x4773c3){var _0x4ec268={},_0x1b9f6b={},_0x2d655a={'count':0x0,'rows':[]};var _0xd11048=_[_0x3956('0x28')](db[_0x3956('0x29')][_0x3956('0x2a')],function(_0x213d87){return{'name':_0x213d87['fieldName'],'type':_0x213d87['type'][_0x3956('0x2b')]};});_0x1b9f6b[_0x3956('0x2c')]=_[_0x3956('0x2d')](_[_0x3956('0x28')](_0xd11048,_0x3956('0x26')),[_0x3956('0x26')]);_0x1b9f6b[_0x3956('0x2e')]=_[_0x3956('0x2f')](_0x2be5b6[_0x3956('0x2e')]);_0x1b9f6b[_0x3956('0x30')]=_[_0x3956('0x31')](_0x1b9f6b[_0x3956('0x2c')],_0x1b9f6b[_0x3956('0x2e')]);_0x4ec268[_0x3956('0x32')]=_[_0x3956('0x31')](_0x1b9f6b['model'],qs['fields'](_0x2be5b6[_0x3956('0x2e')][_0x3956('0x33')]));_0x4ec268[_0x3956('0x32')]=_0x4ec268[_0x3956('0x32')][_0x3956('0x34')]?_0x4ec268[_0x3956('0x32')]:_0x1b9f6b[_0x3956('0x2c')];if(!_0x2be5b6[_0x3956('0x2e')][_0x3956('0x35')](_0x3956('0x36'))){_0x4ec268['limit']=qs[_0x3956('0x1c')](_0x2be5b6[_0x3956('0x2e')][_0x3956('0x1c')]);_0x4ec268[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x2be5b6[_0x3956('0x2e')][_0x3956('0x1a')]);}_0x4ec268[_0x3956('0x37')]=qs['sort'](_0x2be5b6[_0x3956('0x2e')][_0x3956('0x38')]);_0x4ec268[_0x3956('0x39')]=qs['filters'](_[_0x3956('0x3a')](_0x2be5b6[_0x3956('0x2e')],_0x1b9f6b[_0x3956('0x30')]),_0xd11048);if(_0x2be5b6[_0x3956('0x2e')]['filter']){_0x4ec268[_0x3956('0x39')]=_[_0x3956('0x3b')](_0x4ec268['where'],{'$or':_[_0x3956('0x28')](_0xd11048,function(_0x221568){if(_0x221568[_0x3956('0x3c')]!==_0x3956('0x3d')){var _0x570f5a={};_0x570f5a[_0x221568[_0x3956('0x26')]]={'$like':'%'+_0x2be5b6[_0x3956('0x2e')]['filter']+'%'};return _0x570f5a;}})});}_0x4ec268=_[_0x3956('0x3b')]({},_0x4ec268,_0x2be5b6[_0x3956('0x3e')]);var _0x464294={'where':_0x4ec268['where']};return db[_0x3956('0x29')][_0x3956('0x1d')](_0x464294)['then'](function(_0xae286e){_0x2d655a[_0x3956('0x1d')]=_0xae286e;if(_0x2be5b6[_0x3956('0x2e')][_0x3956('0x3f')]){_0x4ec268[_0x3956('0x40')]=[{'all':!![]}];}return db[_0x3956('0x29')][_0x3956('0x41')](_0x4ec268);})[_0x3956('0x22')](function(_0x52738a){_0x2d655a[_0x3956('0x42')]=_0x52738a;return _0x2d655a;})[_0x3956('0x22')](respondWithFilteredResult(_0x4773c3,_0x4ec268))[_0x3956('0x43')](handleError(_0x4773c3,null));};exports[_0x3956('0x44')]=function(_0x1a2949,_0x142aa8){var _0x549ff5={'raw':!![],'where':{'id':_0x1a2949[_0x3956('0x45')]['id']}},_0x2bd56f={};_0x2bd56f[_0x3956('0x2c')]=_['keys'](db['CmCustomField'][_0x3956('0x2a')]);_0x2bd56f[_0x3956('0x2e')]=_[_0x3956('0x2f')](_0x1a2949[_0x3956('0x2e')]);_0x2bd56f[_0x3956('0x30')]=_['intersection'](_0x2bd56f['model'],_0x2bd56f[_0x3956('0x2e')]);_0x549ff5[_0x3956('0x32')]=_[_0x3956('0x31')](_0x2bd56f['model'],qs['fields'](_0x1a2949['query'][_0x3956('0x33')]));_0x549ff5['attributes']=_0x549ff5[_0x3956('0x32')][_0x3956('0x34')]?_0x549ff5[_0x3956('0x32')]:_0x2bd56f['model'];if(_0x1a2949['query'][_0x3956('0x3f')]){_0x549ff5[_0x3956('0x40')]=[{'all':!![]}];}_0x549ff5=_[_0x3956('0x3b')]({},_0x549ff5,_0x1a2949['options']);return db[_0x3956('0x29')][_0x3956('0x46')](_0x549ff5)[_0x3956('0x22')](handleEntityNotFound(_0x142aa8,null))[_0x3956('0x22')](respondWithResult(_0x142aa8,null))[_0x3956('0x43')](handleError(_0x142aa8,null));};exports['update']=function(_0x206cd0,_0x4e5cd0){if(_0x206cd0[_0x3956('0x47')]['id']){delete _0x206cd0[_0x3956('0x47')]['id'];}return db[_0x3956('0x29')][_0x3956('0x46')]({'where':{'id':_0x206cd0[_0x3956('0x45')]['id']}})[_0x3956('0x22')](handleEntityNotFound(_0x4e5cd0,null))[_0x3956('0x22')](saveUpdates(_0x206cd0['body'],null))[_0x3956('0x22')](respondWithResult(_0x4e5cd0,null))[_0x3956('0x43')](handleError(_0x4e5cd0,null));};exports[_0x3956('0x23')]=function(_0x4dc3ae,_0x52efd0){return db['CmCustomField']['find']({'where':{'id':_0x4dc3ae[_0x3956('0x45')]['id']}})[_0x3956('0x22')](handleEntityNotFound(_0x52efd0,null))[_0x3956('0x22')](removeEntity(_0x52efd0,null))[_0x3956('0x43')](handleError(_0x52efd0,null));};exports[_0x3956('0x48')]=function(_0x37d5e0,_0x4ab164){var _0xec2a9f;return db[_0x3956('0x49')]['transaction'](function(_0x32c8e1){return db[_0x3956('0x29')][_0x3956('0x48')](_0x37d5e0[_0x3956('0x47')],{'transaction':_0x32c8e1})[_0x3956('0x22')](function(_0x55d4e6){_0xec2a9f=_0x55d4e6;var _0x243e53={'type':db['Sequelize'][_0x3956('0x4a')],'transaction':_0x32c8e1};switch(_0x37d5e0[_0x3956('0x47')]['type']){case'text':_0x243e53[_0x3956('0x3c')]=db[_0x3956('0x4b')][_0x3956('0x4a')];break;case _0x3956('0x4c'):_0x243e53[_0x3956('0x3c')]=db['Sequelize'][_0x3956('0x4d')];break;case'switch':_0x243e53[_0x3956('0x3c')]=db[_0x3956('0x4b')][_0x3956('0x4e')];_0x243e53[_0x3956('0x4f')]=![];break;default:}return db['sequelize'][_0x3956('0x50')][_0x3956('0x51')](_0x3956('0x52'),util[_0x3956('0x53')](_0x3956('0x54'),_0xec2a9f['id']),_0x243e53);})[_0x3956('0x22')](function(){return _0xec2a9f;});})[_0x3956('0x22')](respondWithResult(_0x4ab164,0xc9))[_0x3956('0x43')](handleError(_0x4ab164,null));}; \ No newline at end of file +var _0x4d2d=['nolimit','sort','pick','filter','where','merge','VIRTUAL','CmCustomField','includeAll','findAll','rows','catch','show','keys','options','find','body','params','sequelize','transaction','create','TEXT','text','Sequelize','INTEGER','switch','queryInterface','format','cf_%d','eml-format','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x4d2d,0x175));var _0xd4d2=function(_0x14bf66,_0x3e1066){_0x14bf66=_0x14bf66-0x0;var _0xaf4bf7=_0x4d2d[_0x14bf66];return _0xaf4bf7;};'use strict';var emlformat=require(_0xd4d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4d2('0x1'));var rp=require('request-promise');var moment=require(_0xd4d2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd4d2('0x3'));var util=require(_0xd4d2('0x4'));var path=require(_0xd4d2('0x5'));var sox=require(_0xd4d2('0x6'));var csv=require('to-csv');var ejs=require(_0xd4d2('0x7'));var fs=require('fs');var fs_extra=require(_0xd4d2('0x8'));var _=require(_0xd4d2('0x9'));var squel=require('squel');var crypto=require(_0xd4d2('0xa'));var jsforce=require(_0xd4d2('0xb'));var deskjs=require(_0xd4d2('0xc'));var toCsv=require(_0xd4d2('0xd'));var querystring=require(_0xd4d2('0xe'));var Papa=require(_0xd4d2('0xf'));var Redis=require(_0xd4d2('0x10'));var authService=require(_0xd4d2('0x11'));var qs=require(_0xd4d2('0x12'));var as=require(_0xd4d2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4d2('0x14'))(_0xd4d2('0x15'));var utils=require('../../config/utils');var config=require(_0xd4d2('0x16'));var licenseUtil=require(_0xd4d2('0x17'));var db=require(_0xd4d2('0x18'))['db'];function respondWithStatusCode(_0x2e3545,_0x444b67){_0x444b67=_0x444b67||0xcc;return function(_0x31c274){if(_0x31c274){return _0x2e3545[_0xd4d2('0x19')](_0x444b67);}return _0x2e3545[_0xd4d2('0x1a')](_0x444b67)['end']();};}function respondWithResult(_0x22d923,_0x3522f7){_0x3522f7=_0x3522f7||0xc8;return function(_0xad2ddb){if(_0xad2ddb){return _0x22d923[_0xd4d2('0x1a')](_0x3522f7)[_0xd4d2('0x1b')](_0xad2ddb);}};}function respondWithFilteredResult(_0x477e42,_0x3a82c7){return function(_0x2befc8){if(_0x2befc8){var _0x49f2e0=typeof _0x3a82c7[_0xd4d2('0x1c')]===_0xd4d2('0x1d')&&typeof _0x3a82c7[_0xd4d2('0x1e')]===_0xd4d2('0x1d');var _0x151c24=_0x2befc8[_0xd4d2('0x1f')];var _0x458c16=_0x49f2e0?0x0:_0x3a82c7[_0xd4d2('0x1c')];var _0x4e45ba=_0x49f2e0?_0x2befc8[_0xd4d2('0x1f')]:_0x3a82c7[_0xd4d2('0x1c')]+_0x3a82c7['limit'];var _0x3f6ee3;if(_0x4e45ba>=_0x151c24){_0x4e45ba=_0x151c24;_0x3f6ee3=0xc8;}else{_0x3f6ee3=0xce;}_0x477e42[_0xd4d2('0x1a')](_0x3f6ee3);return _0x477e42[_0xd4d2('0x20')](_0xd4d2('0x21'),_0x458c16+'-'+_0x4e45ba+'/'+_0x151c24)['json'](_0x2befc8);}return null;};}function patchUpdates(_0x44844d){return function(_0x382cd1){try{jsonpatch['apply'](_0x382cd1,_0x44844d,!![]);}catch(_0x1ef063){return BPromise[_0xd4d2('0x22')](_0x1ef063);}return _0x382cd1['save']();};}function saveUpdates(_0x10f4e8,_0x3fd790){return function(_0x30df3d){if(_0x30df3d){return _0x30df3d[_0xd4d2('0x23')](_0x10f4e8)[_0xd4d2('0x24')](function(_0x58ea19){return _0x58ea19;});}return null;};}function removeEntity(_0x37ee5d,_0x43067e){return function(_0x412bc7){if(_0x412bc7){return _0x412bc7[_0xd4d2('0x25')]()['then'](function(){_0x37ee5d[_0xd4d2('0x1a')](0xcc)[_0xd4d2('0x26')]();});}};}function handleEntityNotFound(_0x2b7966,_0x131328){return function(_0x44d219){if(!_0x44d219){_0x2b7966[_0xd4d2('0x19')](0x194);}return _0x44d219;};}function handleError(_0x1df78c,_0x55c74c){_0x55c74c=_0x55c74c||0x1f4;return function(_0x170940){logger[_0xd4d2('0x27')](_0x170940[_0xd4d2('0x28')]);if(_0x170940[_0xd4d2('0x29')]){delete _0x170940['name'];}_0x1df78c[_0xd4d2('0x1a')](_0x55c74c)[_0xd4d2('0x2a')](_0x170940);};}exports[_0xd4d2('0x2b')]=function(_0x2aec73,_0x4269a1){var _0x12199e={},_0x3eab70={},_0x25b8b8={'count':0x0,'rows':[]};var _0x598504=_['map'](db['CmCustomField'][_0xd4d2('0x2c')],function(_0x12b7bb){return{'name':_0x12b7bb[_0xd4d2('0x2d')],'type':_0x12b7bb[_0xd4d2('0x2e')][_0xd4d2('0x2f')]};});_0x3eab70[_0xd4d2('0x30')]=_[_0xd4d2('0x31')](_['map'](_0x598504,'name'),[_0xd4d2('0x29')]);_0x3eab70[_0xd4d2('0x32')]=_['keys'](_0x2aec73['query']);_0x3eab70[_0xd4d2('0x33')]=_[_0xd4d2('0x34')](_0x3eab70['model'],_0x3eab70[_0xd4d2('0x32')]);_0x12199e['attributes']=_[_0xd4d2('0x34')](_0x3eab70[_0xd4d2('0x30')],qs[_0xd4d2('0x35')](_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x35')]));_0x12199e[_0xd4d2('0x36')]=_0x12199e[_0xd4d2('0x36')][_0xd4d2('0x37')]?_0x12199e[_0xd4d2('0x36')]:_0x3eab70[_0xd4d2('0x30')];if(!_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x38')](_0xd4d2('0x39'))){_0x12199e['limit']=qs[_0xd4d2('0x1e')](_0x2aec73[_0xd4d2('0x32')]['limit']);_0x12199e['offset']=qs[_0xd4d2('0x1c')](_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x1c')]);}_0x12199e['order']=qs[_0xd4d2('0x3a')](_0x2aec73['query'][_0xd4d2('0x3a')]);_0x12199e['where']=qs['filters'](_[_0xd4d2('0x3b')](_0x2aec73[_0xd4d2('0x32')],_0x3eab70['filters']),_0x598504);if(_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x3c')]){_0x12199e[_0xd4d2('0x3d')]=_[_0xd4d2('0x3e')](_0x12199e[_0xd4d2('0x3d')],{'$or':_['map'](_0x598504,function(_0x5e9c29){if(_0x5e9c29[_0xd4d2('0x2e')]!==_0xd4d2('0x3f')){var _0x21d500={};_0x21d500[_0x5e9c29['name']]={'$like':'%'+_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x3c')]+'%'};return _0x21d500;}})});}_0x12199e=_[_0xd4d2('0x3e')]({},_0x12199e,_0x2aec73['options']);var _0x2ef66e={'where':_0x12199e[_0xd4d2('0x3d')]};return db[_0xd4d2('0x40')][_0xd4d2('0x1f')](_0x2ef66e)[_0xd4d2('0x24')](function(_0x273604){_0x25b8b8[_0xd4d2('0x1f')]=_0x273604;if(_0x2aec73[_0xd4d2('0x32')][_0xd4d2('0x41')]){_0x12199e['include']=[{'all':!![]}];}return db[_0xd4d2('0x40')][_0xd4d2('0x42')](_0x12199e);})['then'](function(_0x4fa2e7){_0x25b8b8[_0xd4d2('0x43')]=_0x4fa2e7;return _0x25b8b8;})[_0xd4d2('0x24')](respondWithFilteredResult(_0x4269a1,_0x12199e))[_0xd4d2('0x44')](handleError(_0x4269a1,null));};exports[_0xd4d2('0x45')]=function(_0x12edc1,_0x251b52){var _0x341053={'raw':!![],'where':{'id':_0x12edc1['params']['id']}},_0x493644={};_0x493644[_0xd4d2('0x30')]=_['keys'](db[_0xd4d2('0x40')]['rawAttributes']);_0x493644[_0xd4d2('0x32')]=_[_0xd4d2('0x46')](_0x12edc1[_0xd4d2('0x32')]);_0x493644[_0xd4d2('0x33')]=_[_0xd4d2('0x34')](_0x493644[_0xd4d2('0x30')],_0x493644[_0xd4d2('0x32')]);_0x341053['attributes']=_['intersection'](_0x493644[_0xd4d2('0x30')],qs[_0xd4d2('0x35')](_0x12edc1['query'][_0xd4d2('0x35')]));_0x341053[_0xd4d2('0x36')]=_0x341053['attributes'][_0xd4d2('0x37')]?_0x341053[_0xd4d2('0x36')]:_0x493644[_0xd4d2('0x30')];if(_0x12edc1[_0xd4d2('0x32')][_0xd4d2('0x41')]){_0x341053['include']=[{'all':!![]}];}_0x341053=_[_0xd4d2('0x3e')]({},_0x341053,_0x12edc1[_0xd4d2('0x47')]);return db['CmCustomField'][_0xd4d2('0x48')](_0x341053)[_0xd4d2('0x24')](handleEntityNotFound(_0x251b52,null))[_0xd4d2('0x24')](respondWithResult(_0x251b52,null))[_0xd4d2('0x44')](handleError(_0x251b52,null));};exports[_0xd4d2('0x23')]=function(_0x3f3e9d,_0x2d2ca0){if(_0x3f3e9d[_0xd4d2('0x49')]['id']){delete _0x3f3e9d[_0xd4d2('0x49')]['id'];}return db[_0xd4d2('0x40')][_0xd4d2('0x48')]({'where':{'id':_0x3f3e9d['params']['id']}})['then'](handleEntityNotFound(_0x2d2ca0,null))[_0xd4d2('0x24')](saveUpdates(_0x3f3e9d[_0xd4d2('0x49')],null))['then'](respondWithResult(_0x2d2ca0,null))[_0xd4d2('0x44')](handleError(_0x2d2ca0,null));};exports['destroy']=function(_0x5cc6ac,_0x219d6c){return db['CmCustomField'][_0xd4d2('0x48')]({'where':{'id':_0x5cc6ac[_0xd4d2('0x4a')]['id']}})[_0xd4d2('0x24')](handleEntityNotFound(_0x219d6c,null))[_0xd4d2('0x24')](removeEntity(_0x219d6c,null))[_0xd4d2('0x44')](handleError(_0x219d6c,null));};exports['create']=function(_0x1e47f3,_0xe2a1f3){var _0x79c74;return db[_0xd4d2('0x4b')][_0xd4d2('0x4c')](function(_0x660568){return db[_0xd4d2('0x40')][_0xd4d2('0x4d')](_0x1e47f3[_0xd4d2('0x49')],{'transaction':_0x660568})[_0xd4d2('0x24')](function(_0x142117){_0x79c74=_0x142117;var _0x1873ae={'type':db['Sequelize'][_0xd4d2('0x4e')],'transaction':_0x660568};switch(_0x1e47f3[_0xd4d2('0x49')]['type']){case _0xd4d2('0x4f'):_0x1873ae[_0xd4d2('0x2e')]=db[_0xd4d2('0x50')][_0xd4d2('0x4e')];break;case'number':_0x1873ae[_0xd4d2('0x2e')]=db[_0xd4d2('0x50')][_0xd4d2('0x51')];break;case _0xd4d2('0x52'):_0x1873ae[_0xd4d2('0x2e')]=db[_0xd4d2('0x50')]['BOOLEAN'];_0x1873ae['defaultValue']=![];break;default:}return db['sequelize'][_0xd4d2('0x53')]['addColumn']('cm_contacts',util[_0xd4d2('0x54')](_0xd4d2('0x55'),_0x79c74['id']),_0x1873ae);})[_0xd4d2('0x24')](function(){return _0x79c74;});})[_0xd4d2('0x24')](respondWithResult(_0xe2a1f3,0xc9))['catch'](handleError(_0xe2a1f3,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8e96798..715b4ab 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 _0xeba4=['./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e733a,_0x477403){var _0x34322b=function(_0x3d7210){while(--_0x3d7210){_0x1e733a['push'](_0x1e733a['shift']());}};_0x34322b(++_0x477403);}(_0xeba4,0x1a8));var _0x4eba=function(_0x5bf34c,_0x31429d){_0x5bf34c=_0x5bf34c-0x0;var _0x1c1817=_0xeba4[_0x5bf34c];return _0x1c1817;};'use strict';var _=require(_0x4eba('0x0'));var util=require('util');var logger=require(_0x4eba('0x1'))(_0x4eba('0x2'));var moment=require(_0x4eba('0x3'));var BPromise=require(_0x4eba('0x4'));var rp=require(_0x4eba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4eba('0x6'));module['exports']=function(_0x186955,_0x403837){return _0x186955[_0x4eba('0x7')](_0x4eba('0x8'),attributes,{'tableName':_0x4eba('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7149=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','util'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x7149,0x1df));var _0x9714=function(_0x27f541,_0xe56bc1){_0x27f541=_0x27f541-0x0;var _0x6a0717=_0x7149[_0x27f541];return _0x6a0717;};'use strict';var _=require('lodash');var util=require(_0x9714('0x0'));var logger=require(_0x9714('0x1'))(_0x9714('0x2'));var moment=require('moment');var BPromise=require(_0x9714('0x3'));var rp=require(_0x9714('0x4'));var fs=require('fs');var path=require(_0x9714('0x5'));var rimraf=require(_0x9714('0x6'));var config=require(_0x9714('0x7'));var attributes=require('./cmCustomField.attributes');module[_0x9714('0x8')]=function(_0x2704f9,_0x5343af){return _0x2704f9[_0x9714('0x9')](_0x9714('0xa'),attributes,{'tableName':_0x9714('0xb'),'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 52c595d..c54b743 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 _0xfc88=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','result','lodash','moment','bluebird','randomstring'];(function(_0x4a9ac6,_0xa1ae26){var _0x25786e=function(_0x3c02bd){while(--_0x3c02bd){_0x4a9ac6['push'](_0x4a9ac6['shift']());}};_0x25786e(++_0xa1ae26);}(_0xfc88,0xd8));var _0x8fc8=function(_0x4f252e,_0x20cc01){_0x4f252e=_0x4f252e-0x0;var _0x264643=_0xfc88[_0x4f252e];return _0x264643;};'use strict';var _=require(_0x8fc8('0x0'));var util=require('util');var moment=require(_0x8fc8('0x1'));var BPromise=require(_0x8fc8('0x2'));var rs=require(_0x8fc8('0x3'));var fs=require('fs');var Redis=require(_0x8fc8('0x4'));var db=require(_0x8fc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fc8('0x6'))(_0x8fc8('0x7'));var config=require(_0x8fc8('0x8'));var jayson=require(_0x8fc8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c42a1,_0x50b812,_0x30e4cf){return new BPromise(function(_0x4da044,_0x4fac8f){return client[_0x8fc8('0xa')](_0x2c42a1,_0x30e4cf)[_0x8fc8('0xb')](function(_0x255e99){logger[_0x8fc8('0xc')](_0x8fc8('0xd'),_0x50b812,_0x8fc8('0xe'));logger[_0x8fc8('0xf')](_0x8fc8('0x10'),_0x50b812,'request\x20sent',JSON[_0x8fc8('0x11')](_0x255e99));if(_0x255e99[_0x8fc8('0x12')]){if(_0x255e99[_0x8fc8('0x12')]['code']===0x1f4){logger[_0x8fc8('0x12')](_0x8fc8('0xd'),_0x50b812,_0x255e99[_0x8fc8('0x12')]['message']);return _0x4fac8f(_0x255e99[_0x8fc8('0x12')]['message']);}logger[_0x8fc8('0x12')](_0x8fc8('0xd'),_0x50b812,_0x255e99[_0x8fc8('0x12')]['message']);return _0x4da044(_0x255e99['error']['message']);}else{logger['info'](_0x8fc8('0xd'),_0x50b812,_0x8fc8('0xe'));_0x4da044(_0x255e99[_0x8fc8('0x13')]['message']);}})['catch'](function(_0x5eb26e){logger[_0x8fc8('0x12')]('CmCustomField,\x20%s,\x20%s',_0x50b812,_0x5eb26e);_0x4fac8f(_0x5eb26e);});});} \ No newline at end of file +var _0x25fb=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x25fb,0x132));var _0xb25f=function(_0x36e5c8,_0x330ecb){_0x36e5c8=_0x36e5c8-0x0;var _0x2ada98=_0x25fb[_0x36e5c8];return _0x2ada98;};'use strict';var _=require('lodash');var util=require(_0xb25f('0x0'));var moment=require(_0xb25f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb25f('0x2'));var db=require(_0xb25f('0x3'))['db'];var utils=require(_0xb25f('0x4'));var logger=require(_0xb25f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb25f('0x6')][_0xb25f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22feaa,_0x155639,_0x5f41e0){return new BPromise(function(_0x582bfb,_0x814617){return client[_0xb25f('0x8')](_0x22feaa,_0x5f41e0)['then'](function(_0x577b30){logger[_0xb25f('0x9')](_0xb25f('0xa'),_0x155639,'request\x20sent');logger[_0xb25f('0xb')](_0xb25f('0xc'),_0x155639,_0xb25f('0xd'),JSON[_0xb25f('0xe')](_0x577b30));if(_0x577b30[_0xb25f('0xf')]){if(_0x577b30[_0xb25f('0xf')]['code']===0x1f4){logger[_0xb25f('0xf')](_0xb25f('0xa'),_0x155639,_0x577b30[_0xb25f('0xf')]['message']);return _0x814617(_0x577b30[_0xb25f('0xf')][_0xb25f('0x10')]);}logger[_0xb25f('0xf')](_0xb25f('0xa'),_0x155639,_0x577b30[_0xb25f('0xf')][_0xb25f('0x10')]);return _0x582bfb(_0x577b30['error'][_0xb25f('0x10')]);}else{logger[_0xb25f('0x9')](_0xb25f('0xa'),_0x155639,'request\x20sent');_0x582bfb(_0x577b30[_0xb25f('0x11')]['message']);}})[_0xb25f('0x12')](function(_0x3acd73){logger[_0xb25f('0xf')](_0xb25f('0xa'),_0x155639,_0x3acd73);_0x814617(_0x3acd73);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 706bdf0..dd325ec 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 _0x359a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','update','destroy','multer'];(function(_0x379d4a,_0x57522f){var _0x24af65=function(_0x7daeef){while(--_0x7daeef){_0x379d4a['push'](_0x379d4a['shift']());}};_0x24af65(++_0x57522f);}(_0x359a,0x153));var _0xa359=function(_0x54799d,_0x2cc089){_0x54799d=_0x54799d-0x0;var _0x2b3d7f=_0x359a[_0x54799d];return _0x2b3d7f;};'use strict';var multer=require(_0xa359('0x0'));var util=require(_0xa359('0x1'));var path=require(_0xa359('0x2'));var timeout=require(_0xa359('0x3'));var express=require(_0xa359('0x4'));var router=express['Router']();var fs_extra=require(_0xa359('0x5'));var auth=require(_0xa359('0x6'));var interaction=require(_0xa359('0x7'));var config=require(_0xa359('0x8'));var controller=require(_0xa359('0x9'));router[_0xa359('0xa')]('/',auth[_0xa359('0xb')](),controller[_0xa359('0xc')]);router[_0xa359('0xa')](_0xa359('0xd'),auth['isAuthenticated'](),controller[_0xa359('0xe')]);router['post']('/',auth[_0xa359('0xb')](),controller['create']);router['put'](_0xa359('0xd'),auth[_0xa359('0xb')](),controller[_0xa359('0xf')]);router['delete']('/:id',auth[_0xa359('0xb')](),controller[_0xa359('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb99c=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xb99c,0x1a9));var _0xcb99=function(_0xad843f,_0x175347){_0xad843f=_0xad843f-0x0;var _0x31cb2b=_0xb99c[_0xad843f];return _0x31cb2b;};'use strict';var multer=require(_0xcb99('0x0'));var util=require(_0xcb99('0x1'));var path=require('path');var timeout=require(_0xcb99('0x2'));var express=require(_0xcb99('0x3'));var router=express[_0xcb99('0x4')]();var fs_extra=require(_0xcb99('0x5'));var auth=require(_0xcb99('0x6'));var interaction=require(_0xcb99('0x7'));var config=require(_0xcb99('0x8'));var controller=require(_0xcb99('0x9'));router[_0xcb99('0xa')]('/',auth[_0xcb99('0xb')](),controller['index']);router[_0xcb99('0xa')](_0xcb99('0xc'),auth[_0xcb99('0xb')](),controller[_0xcb99('0xd')]);router['post']('/',auth[_0xcb99('0xb')](),controller[_0xcb99('0xe')]);router[_0xcb99('0xf')](_0xcb99('0xc'),auth[_0xcb99('0xb')](),controller[_0xcb99('0x10')]);router[_0xcb99('0x11')]('/:id',auth[_0xcb99('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 796014c..5410fc4 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 _0xd560=['contactListQueue','moment','STRING','BOOLEAN','format','INTEGER','UNSIGNED'];(function(_0x5786e1,_0x233643){var _0x1590a8=function(_0x2be521){while(--_0x2be521){_0x5786e1['push'](_0x5786e1['shift']());}};_0x1590a8(++_0x233643);}(_0xd560,0x135));var _0x0d56=function(_0x30d650,_0xffb8e2){_0x30d650=_0x30d650-0x0;var _0x41fbab=_0xd560[_0x30d650];return _0x41fbab;};'use strict';var moment=require(_0x0d56('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x0d56('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x0d56('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0d56('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0d56('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0d56('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x0d56('0x4')](0x2)[_0x0d56('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0d56('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0d56('0x4')],'unique':_0x0d56('0x6')},'ListId':{'type':Sequelize[_0x0d56('0x4')],'unique':_0x0d56('0x6')},'UserId':{'type':Sequelize[_0x0d56('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x0d56('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x0d56('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0d56('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfc15=['sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN','contactListQueue'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfc15,0x144));var _0x5fc1=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xfc15[_0x2f9467];return _0x39894c;};'use strict';var moment=require('moment');var Sequelize=require(_0x5fc1('0x0'));module[_0x5fc1('0x1')]={'phone':{'type':Sequelize[_0x5fc1('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5fc1('0x3')](_0x5fc1('0x4'))},'countbusyretry':{'type':Sequelize[_0x5fc1('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5fc1('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5fc1('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x5fc1('0x5')](0x2)[_0x5fc1('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5fc1('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5fc1('0x5')],'unique':_0x5fc1('0x8')},'ListId':{'type':Sequelize[_0x5fc1('0x5')],'unique':_0x5fc1('0x8')},'UserId':{'type':Sequelize[_0x5fc1('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x5fc1('0x5')],'unique':_0x5fc1('0x8')},'CampaignId':{'type':Sequelize[_0x5fc1('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5fc1('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5fc1('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5fc1('0x5')],'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 3a00aa0..4fdbaee 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 _0x0b13=['user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmContact','getVoiceQueues','outbound','dialPreviewAutoRecallMe','sequelize','transaction','value','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','getOpenContacts','preview','json','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','$and','$or','$gt','$gte','$lt','$ne','$eq','$notBetween','$in','$notIn','$like','$iLike','$contained','$any','attributes','fields','nolimit','where','pick','merge','VIRTUAL','filter','CmHopper','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername'];(function(_0x5cdeba,_0x3a8713){var _0x15df83=function(_0x5f4719){while(--_0x5f4719){_0x5cdeba['push'](_0x5cdeba['shift']());}};_0x15df83(++_0x3a8713);}(_0x0b13,0x150));var _0x30b1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0b13[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x30b1('0x0'));var rimraf=require(_0x30b1('0x1'));var zipdir=require(_0x30b1('0x2'));var jsonpatch=require(_0x30b1('0x3'));var rp=require(_0x30b1('0x4'));var moment=require(_0x30b1('0x5'));var BPromise=require(_0x30b1('0x6'));var Mustache=require(_0x30b1('0x7'));var util=require(_0x30b1('0x8'));var path=require(_0x30b1('0x9'));var sox=require(_0x30b1('0xa'));var csv=require(_0x30b1('0xb'));var ejs=require(_0x30b1('0xc'));var fs=require('fs');var fs_extra=require(_0x30b1('0xd'));var _=require(_0x30b1('0xe'));var squel=require(_0x30b1('0xf'));var crypto=require(_0x30b1('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x30b1('0x11'));var toCsv=require(_0x30b1('0xb'));var querystring=require(_0x30b1('0x12'));var Papa=require(_0x30b1('0x13'));var Redis=require(_0x30b1('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x30b1('0x15'));var as=require(_0x30b1('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x30b1('0x17'));var utils=require(_0x30b1('0x18'));var config=require(_0x30b1('0x19'));var licenseUtil=require(_0x30b1('0x1a'));var db=require(_0x30b1('0x1b'))['db'];function respondWithStatusCode(_0x2a17d8,_0x2bd1f2){_0x2bd1f2=_0x2bd1f2||0xcc;return function(_0x19f069){if(_0x19f069){return _0x2a17d8[_0x30b1('0x1c')](_0x2bd1f2);}return _0x2a17d8[_0x30b1('0x1d')](_0x2bd1f2)[_0x30b1('0x1e')]();};}function respondWithResult(_0x166d92,_0x39c3f3){_0x39c3f3=_0x39c3f3||0xc8;return function(_0x546e1f){if(_0x546e1f){return _0x166d92[_0x30b1('0x1d')](_0x39c3f3)['json'](_0x546e1f);}};}function respondWithFilteredResult(_0x812ee3,_0xdb8da4){return function(_0x290c89){if(_0x290c89){var _0x1bc890=typeof _0xdb8da4[_0x30b1('0x1f')]===_0x30b1('0x20')&&typeof _0xdb8da4[_0x30b1('0x21')]===_0x30b1('0x20');var _0x417f3b=_0x290c89[_0x30b1('0x22')];var _0x1666cb=_0x1bc890?0x0:_0xdb8da4[_0x30b1('0x1f')];var _0x1ef404=_0x1bc890?_0x290c89[_0x30b1('0x22')]:_0xdb8da4[_0x30b1('0x1f')]+_0xdb8da4['limit'];var _0x273f05;if(_0x1ef404>=_0x417f3b){_0x1ef404=_0x417f3b;_0x273f05=0xc8;}else{_0x273f05=0xce;}_0x812ee3[_0x30b1('0x1d')](_0x273f05);return _0x812ee3['set'](_0x30b1('0x23'),_0x1666cb+'-'+_0x1ef404+'/'+_0x417f3b)['json'](_0x290c89);}return null;};}function patchUpdates(_0x771cbd){return function(_0xbeae78){try{jsonpatch[_0x30b1('0x24')](_0xbeae78,_0x771cbd,!![]);}catch(_0xad9931){return BPromise['reject'](_0xad9931);}return _0xbeae78[_0x30b1('0x25')]();};}function saveUpdates(_0xe36387,_0xb2ceec){return function(_0x495320){if(_0x495320){return _0x495320[_0x30b1('0x26')](_0xe36387)[_0x30b1('0x27')](function(_0x3dfeb4){return _0x3dfeb4;});}return null;};}function removeEntity(_0x204d1a,_0xee69ea){return function(_0x3324aa){if(_0x3324aa){return _0x3324aa[_0x30b1('0x28')]()[_0x30b1('0x27')](function(){_0x204d1a[_0x30b1('0x1d')](0xcc)[_0x30b1('0x1e')]();});}};}function handleEntityNotFound(_0x24b468,_0x538997){return function(_0x34126d){if(!_0x34126d){_0x24b468['sendStatus'](0x194);}return _0x34126d;};}function handleError(_0x2c125d,_0x1a4378){_0x1a4378=_0x1a4378||0x1f4;return function(_0x1064a0){logger[_0x30b1('0x29')](_0x1064a0[_0x30b1('0x2a')]);if(_0x1064a0[_0x30b1('0x2b')]){delete _0x1064a0[_0x30b1('0x2b')];}_0x2c125d['status'](_0x1a4378)[_0x30b1('0x2c')](_0x1064a0);};}exports[_0x30b1('0x2d')]=function(_0x5a0e6b,_0x111ef9){var _0x56876d={},_0x21500f={},_0x32f6c4={'count':0x0,'rows':[]};var _0x509b29=_[_0x30b1('0x2e')](db['CmHopper']['rawAttributes'],function(_0x50324e){return{'name':_0x50324e[_0x30b1('0x2f')],'type':_0x50324e[_0x30b1('0x30')][_0x30b1('0x31')]};});_0x21500f[_0x30b1('0x32')]=_[_0x30b1('0x2e')](_0x509b29,_0x30b1('0x2b'));_0x21500f[_0x30b1('0x33')]=_['keys'](_0x5a0e6b[_0x30b1('0x33')]);_0x21500f[_0x30b1('0x34')]=_[_0x30b1('0x35')](_0x21500f[_0x30b1('0x32')],_0x21500f[_0x30b1('0x33')]);_0x21500f[_0x30b1('0x34')]=_['concat'](_0x21500f[_0x30b1('0x34')],[_0x30b1('0x36'),_0x30b1('0x37'),_0x30b1('0x38'),_0x30b1('0x39'),_0x30b1('0x3a'),'$lte',_0x30b1('0x3b'),_0x30b1('0x3c'),'$not','$between',_0x30b1('0x3d'),_0x30b1('0x3e'),_0x30b1('0x3f'),_0x30b1('0x40'),'$notLike',_0x30b1('0x41'),'$notILike','$like','$overlap','$contains',_0x30b1('0x42'),_0x30b1('0x43')]);_0x56876d[_0x30b1('0x44')]=_[_0x30b1('0x35')](_0x21500f[_0x30b1('0x32')],qs[_0x30b1('0x45')](_0x5a0e6b['query']['fields']));_0x56876d['attributes']=_0x56876d[_0x30b1('0x44')]['length']?_0x56876d['attributes']:_0x21500f[_0x30b1('0x32')];if(!_0x5a0e6b[_0x30b1('0x33')]['hasOwnProperty'](_0x30b1('0x46'))){_0x56876d[_0x30b1('0x21')]=qs[_0x30b1('0x21')](_0x5a0e6b[_0x30b1('0x33')][_0x30b1('0x21')]);_0x56876d['offset']=qs[_0x30b1('0x1f')](_0x5a0e6b[_0x30b1('0x33')][_0x30b1('0x1f')]);}_0x56876d['order']=qs['sort'](_0x5a0e6b[_0x30b1('0x33')]['sort']);_0x56876d[_0x30b1('0x47')]=qs[_0x30b1('0x34')](_[_0x30b1('0x48')](_0x5a0e6b['query'],_0x21500f[_0x30b1('0x34')]),_0x509b29);if(_0x5a0e6b[_0x30b1('0x33')]['filter']){_0x56876d[_0x30b1('0x47')]=_[_0x30b1('0x49')](_0x56876d[_0x30b1('0x47')],{'$or':_[_0x30b1('0x2e')](_0x509b29,function(_0xaa6ac3){if(_0xaa6ac3[_0x30b1('0x30')]!==_0x30b1('0x4a')){var _0x3b8243={};_0x3b8243[_0xaa6ac3[_0x30b1('0x2b')]]={'$like':'%'+_0x5a0e6b[_0x30b1('0x33')][_0x30b1('0x4b')]+'%'};return _0x3b8243;}})});}_0x56876d=_[_0x30b1('0x49')]({},_0x56876d,_0x5a0e6b['options']);var _0x62c2c9={'where':_0x56876d[_0x30b1('0x47')]};return db[_0x30b1('0x4c')][_0x30b1('0x22')](_0x62c2c9)[_0x30b1('0x27')](function(_0x18f9f6){_0x32f6c4['count']=_0x18f9f6;if(_0x5a0e6b['query'][_0x30b1('0x4d')]){_0x56876d[_0x30b1('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x30b1('0x4f')](_0x56876d);})[_0x30b1('0x27')](function(_0x4dc2c2){_0x32f6c4[_0x30b1('0x50')]=_0x4dc2c2;return _0x32f6c4;})[_0x30b1('0x27')](respondWithFilteredResult(_0x111ef9,_0x56876d))['catch'](handleError(_0x111ef9,null));};exports[_0x30b1('0x51')]=function(_0x48f2b7,_0x5b55a1){var _0x5d1bdc={'raw':!![],'where':{'id':_0x48f2b7[_0x30b1('0x52')]['id']}},_0x2e955f={};_0x2e955f[_0x30b1('0x32')]=_[_0x30b1('0x53')](db[_0x30b1('0x4c')]['rawAttributes']);_0x2e955f[_0x30b1('0x33')]=_[_0x30b1('0x53')](_0x48f2b7[_0x30b1('0x33')]);_0x2e955f[_0x30b1('0x34')]=_[_0x30b1('0x35')](_0x2e955f[_0x30b1('0x32')],_0x2e955f[_0x30b1('0x33')]);_0x5d1bdc[_0x30b1('0x44')]=_[_0x30b1('0x35')](_0x2e955f['model'],qs[_0x30b1('0x45')](_0x48f2b7[_0x30b1('0x33')]['fields']));_0x5d1bdc[_0x30b1('0x44')]=_0x5d1bdc[_0x30b1('0x44')][_0x30b1('0x54')]?_0x5d1bdc[_0x30b1('0x44')]:_0x2e955f[_0x30b1('0x32')];if(_0x48f2b7['query'][_0x30b1('0x4d')]){_0x5d1bdc['include']=[{'all':!![]}];}_0x5d1bdc=_[_0x30b1('0x49')]({},_0x5d1bdc,_0x48f2b7[_0x30b1('0x55')]);return db['CmHopper'][_0x30b1('0x56')](_0x5d1bdc)['then'](handleEntityNotFound(_0x5b55a1,null))[_0x30b1('0x27')](respondWithResult(_0x5b55a1,null))[_0x30b1('0x57')](handleError(_0x5b55a1,null));};exports[_0x30b1('0x58')]=function(_0x327505,_0x5be16e){return db[_0x30b1('0x4c')][_0x30b1('0x58')](_0x327505['body'],{})[_0x30b1('0x27')](respondWithResult(_0x5be16e,0xc9))[_0x30b1('0x57')](handleError(_0x5be16e,null));};exports[_0x30b1('0x26')]=function(_0x22c528,_0x58fb7d){if(_0x22c528[_0x30b1('0x59')]['id']){delete _0x22c528['body']['id'];}return db[_0x30b1('0x4c')][_0x30b1('0x56')]({'where':{'id':_0x22c528[_0x30b1('0x52')]['id']}})[_0x30b1('0x27')](handleEntityNotFound(_0x58fb7d,null))['then'](saveUpdates(_0x22c528[_0x30b1('0x59')],null))[_0x30b1('0x27')](respondWithResult(_0x58fb7d,null))[_0x30b1('0x57')](handleError(_0x58fb7d,null));};exports[_0x30b1('0x5a')]=function(_0x203f18,_0x1120df){return db[_0x30b1('0x4c')][_0x30b1('0x5a')]()[_0x30b1('0x27')](respondWithResult(_0x1120df,null))[_0x30b1('0x57')](handleError(_0x1120df,null));};exports[_0x30b1('0x28')]=function(_0x2aca10,_0x5cc709){var _0x3d20a2;return db['CmHopper']['find']({'where':{'id':_0x2aca10[_0x30b1('0x52')]['id']}})[_0x30b1('0x27')](handleEntityNotFound(_0x5cc709,null))[_0x30b1('0x27')](function(_0x3c3a18){if(_0x3c3a18){return _0x3c3a18[_0x30b1('0x28')]()[_0x30b1('0x27')](function(_0x4de64f){return _0x4de64f;});}})[_0x30b1('0x27')](function(_0x19947c){_0x3d20a2=_0x19947c;if(_0x19947c){if(_0x19947c[_0x30b1('0x5b')]||_0x19947c[_0x30b1('0x5c')]){return db[_0x19947c['VoiceQueueId']?_0x30b1('0x5d'):'Campaign'][_0x30b1('0x56')]({'where':{'id':_0x19947c[_0x30b1('0x5b')]?_0x19947c['VoiceQueueId']:_0x19947c['CampaignId']},'attributes':['id',_0x30b1('0x2b')],'raw':!![]});}}})[_0x30b1('0x27')](function(_0x50734c){var _0x2bec2b={};if(_0x50734c){_[_0x30b1('0x49')](_0x2bec2b,_[_0x30b1('0x5e')](_0x3d20a2[_0x30b1('0x5f')],[_0x30b1('0x60'),_0x30b1('0x61'),'id']));_0x2bec2b[_0x30b1('0x62')]=0x15;_0x2bec2b['statedesc']=_0x30b1('0x63');_0x2bec2b[_0x30b1('0x64')]=_0x50734c[_0x30b1('0x2b')];_0x2bec2b[_0x30b1('0x65')]=_0x2aca10[_0x30b1('0x66')][_0x30b1('0x2b')];_0x2bec2b['UserId']=_0x2aca10['user']['id'];_0x2bec2b['deleted']=!![];_0x2bec2b[_0x30b1('0x67')]=moment()[_0x30b1('0x68')](_0x30b1('0x69'));_0x2bec2b[_0x30b1('0x6a')]=_0x3d20a2['phone'];_0x2bec2b[_0x30b1('0x6b')]=_0x3d20a2[_0x30b1('0x5b')]?_0x30b1('0x6c'):_0x30b1('0x6d');return db['CmContact'][_0x30b1('0x56')]({'where':{'id':_0x2bec2b[_0x30b1('0x6e')]},'attributes':[_0x30b1('0x6f'),_0x30b1('0x70')]})[_0x30b1('0x27')](function(_0x5c9d9c){if(!_[_0x30b1('0x71')](_0x5cc709)&&!_[_0x30b1('0x71')](_0x5c9d9c['firstName'])){_0x2bec2b[_0x30b1('0x72')]=_0x5c9d9c[_0x30b1('0x6f')];if(!_[_0x30b1('0x71')](_0x5c9d9c[_0x30b1('0x70')])){_0x2bec2b[_0x30b1('0x72')]+='\x20'+_0x5c9d9c[_0x30b1('0x70')];}}})[_0x30b1('0x73')](function(){return db[_0x30b1('0x74')]['create'](_0x2bec2b);});}})[_0x30b1('0x27')](function(){return _0x5cc709[_0x30b1('0x1d')](0xcc)[_0x30b1('0x1e')]();})[_0x30b1('0x57')](handleError(_0x5cc709,null));};exports['getPreview']=function(_0x1b7b9f,_0x4c3a2e,_0x118b08){var _0x1a451a=[];return db[_0x30b1('0x75')][_0x30b1('0x5a')]()[_0x30b1('0x27')](function(_0x491e49){_0x1a451a=_['keys'](_0x491e49);return _0x1b7b9f[_0x30b1('0x66')][_0x30b1('0x76')]({'where':{'type':_0x30b1('0x77'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0x30b1('0x78')],'raw':!![]});})['then'](function(_0x331438){if(_0x331438&&_0x331438['length']){return db[_0x30b1('0x79')][_0x30b1('0x7a')](function(_0x12a879){var _0x1fef99={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x30b1('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x30b1('0x2e')](_0x331438,'id')},'$or':[{'UserId':null},{'UserId':_0x1b7b9f[_0x30b1('0x66')]['id']}]};var _0x5a2210={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x331438)[_0x30b1('0x4b')]([_0x30b1('0x78'),0x0])[_0x30b1('0x2e')]('id')[_0x30b1('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x1b7b9f[_0x30b1('0x66')]['id']}]};var _0x19cd54={'$or':[_0x1fef99,_0x5a2210]};var _0xdd41d=[];if(_0x1b7b9f['body']['direction']&&_0x1b7b9f[_0x30b1('0x59')]['direction']==='prev'){if(!_[_0x30b1('0x7c')](_0x1b7b9f[_0x30b1('0x59')][_0x30b1('0x7d')])){_0x19cd54['id']={'$in':_0x1b7b9f[_0x30b1('0x59')][_0x30b1('0x7d')]};}_0xdd41d=[[_0x30b1('0x7e'),_0x30b1('0x7f')],['scheduledAt',_0x331438[0x0][_0x30b1('0x80')]==='ASC'?_0x30b1('0x81'):_0x30b1('0x7f')],db['sequelize'][_0x30b1('0x82')](_0x30b1('0x83')),['id',_0x30b1('0x81')]];}else{if(!_[_0x30b1('0x7c')](_0x1b7b9f['body'][_0x30b1('0x7d')])){_0x19cd54['id']={'$notIn':_0x1b7b9f[_0x30b1('0x59')][_0x30b1('0x7d')]};}_0xdd41d=[[_0x30b1('0x7e'),_0x30b1('0x81')],['scheduledAt',_0x331438[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x30b1('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db['CmHopper'][_0x30b1('0x84')]({'attributes':['id',_0x30b1('0x85'),_0x30b1('0x86')],'where':_0x19cd54,'order':_0xdd41d,'transaction':_0x12a879,'lock':_0x12a879[_0x30b1('0x87')][_0x30b1('0x88')],'include':[{'model':db[_0x30b1('0x75')],'as':_0x30b1('0x89'),'attributes':_0x1a451a,'include':[{'model':db[_0x30b1('0x8a')],'as':_0x30b1('0x8b'),'attributes':['id',_0x30b1('0x2b')]}]},{'model':db['CmList'],'as':_0x30b1('0x8c'),'attributes':['id',_0x30b1('0x2b')]},{'model':db['VoiceQueue'],'as':_0x30b1('0x8d'),'attributes':['id','name','dialActive']}]})['then'](function(_0x1876dc){if(_0x1876dc){return _0x1876dc[_0x30b1('0x26')]({'UserId':_0x1b7b9f[_0x30b1('0x66')]['id']},{'transaction':_0x12a879});}});});}})['then'](handleEntityNotFound(_0x4c3a2e,null))[_0x30b1('0x27')](respondWithResult(_0x4c3a2e,null))[_0x30b1('0x57')](handleError(_0x4c3a2e,null));};exports[_0x30b1('0x8e')]=function(_0xdf15b2,_0x46403c,_0x338ce5){return _0xdf15b2[_0x30b1('0x66')][_0x30b1('0x76')]({'where':{'type':_0x30b1('0x77'),'dialActive':!![],'dialMethod':_0x30b1('0x8f')},'attributes':['id'],'raw':!![]})[_0x30b1('0x27')](function(_0x57db7b){if(_0x57db7b&&_0x57db7b[_0x30b1('0x54')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x30b1('0x68')](_0x30b1('0x69'))},'VoiceQueueId':{'$in':_[_0x30b1('0x2e')](_0x57db7b,'id')},'$or':[{'UserId':null},{'UserId':_0xdf15b2['user']['id']}]}});}return 0x0;})[_0x30b1('0x27')](function(_0x3514c6){if(!_['isNil'](_0x3514c6)&&_['isNumber'](_0x3514c6)){return _0x46403c['status'](0xc8)[_0x30b1('0x90')]({'contacts':_0x3514c6});}else{logger[_0x30b1('0x29')](_0x30b1('0x91'),_0x30b1('0x8e'),0x194,'entity\x20not\x20found');_0x46403c[_0x30b1('0x1c')](0x194);}})[_0x30b1('0x57')](handleError(_0x46403c,null));}; \ No newline at end of file +var _0x8be2=['find','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','user','UserId','deleted','deletedat','format','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','preview','YYYY-MM-DD\x20HH:mm:ss','error','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','reject','update','then','destroy','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','model','map','query','keys','intersection','filters','concat','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$like','$notLike','$iLike','$contained','$any','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','catch'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8be2,0xcd));var _0x28be=function(_0x4a4c78,_0x13d5b7){_0x4a4c78=_0x4a4c78-0x0;var _0xd58f32=_0x8be2[_0x4a4c78];return _0xd58f32;};'use strict';var emlformat=require(_0x28be('0x0'));var rimraf=require(_0x28be('0x1'));var zipdir=require(_0x28be('0x2'));var jsonpatch=require(_0x28be('0x3'));var rp=require(_0x28be('0x4'));var moment=require('moment');var BPromise=require(_0x28be('0x5'));var Mustache=require('mustache');var util=require(_0x28be('0x6'));var path=require(_0x28be('0x7'));var sox=require(_0x28be('0x8'));var csv=require(_0x28be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28be('0xa'));var _=require(_0x28be('0xb'));var squel=require('squel');var crypto=require(_0x28be('0xc'));var jsforce=require(_0x28be('0xd'));var deskjs=require(_0x28be('0xe'));var toCsv=require(_0x28be('0x9'));var querystring=require(_0x28be('0xf'));var Papa=require('papaparse');var Redis=require(_0x28be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x28be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28be('0x12'));var logger=require(_0x28be('0x13'))(_0x28be('0x14'));var utils=require(_0x28be('0x15'));var config=require(_0x28be('0x16'));var licenseUtil=require(_0x28be('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15ef96,_0x3cdaeb){_0x3cdaeb=_0x3cdaeb||0xcc;return function(_0x1af6d8){if(_0x1af6d8){return _0x15ef96[_0x28be('0x18')](_0x3cdaeb);}return _0x15ef96['status'](_0x3cdaeb)[_0x28be('0x19')]();};}function respondWithResult(_0x524176,_0x338d54){_0x338d54=_0x338d54||0xc8;return function(_0x1e5f2c){if(_0x1e5f2c){return _0x524176[_0x28be('0x1a')](_0x338d54)[_0x28be('0x1b')](_0x1e5f2c);}};}function respondWithFilteredResult(_0x5e759a,_0x275e4e){return function(_0x2536af){if(_0x2536af){var _0x251ebd=typeof _0x275e4e['offset']==='undefined'&&typeof _0x275e4e[_0x28be('0x1c')]===_0x28be('0x1d');var _0x94961d=_0x2536af[_0x28be('0x1e')];var _0x594706=_0x251ebd?0x0:_0x275e4e[_0x28be('0x1f')];var _0x408383=_0x251ebd?_0x2536af[_0x28be('0x1e')]:_0x275e4e[_0x28be('0x1f')]+_0x275e4e[_0x28be('0x1c')];var _0xde69b8;if(_0x408383>=_0x94961d){_0x408383=_0x94961d;_0xde69b8=0xc8;}else{_0xde69b8=0xce;}_0x5e759a[_0x28be('0x1a')](_0xde69b8);return _0x5e759a['set'](_0x28be('0x20'),_0x594706+'-'+_0x408383+'/'+_0x94961d)['json'](_0x2536af);}return null;};}function patchUpdates(_0x210b33){return function(_0x5aa85d){try{jsonpatch['apply'](_0x5aa85d,_0x210b33,!![]);}catch(_0x20d66f){return BPromise[_0x28be('0x21')](_0x20d66f);}return _0x5aa85d['save']();};}function saveUpdates(_0x208017,_0x838107){return function(_0x410445){if(_0x410445){return _0x410445[_0x28be('0x22')](_0x208017)[_0x28be('0x23')](function(_0x5f468f){return _0x5f468f;});}return null;};}function removeEntity(_0x4ab3d1,_0x40d77e){return function(_0x2958a0){if(_0x2958a0){return _0x2958a0[_0x28be('0x24')]()[_0x28be('0x23')](function(){_0x4ab3d1[_0x28be('0x1a')](0xcc)[_0x28be('0x19')]();});}};}function handleEntityNotFound(_0x4b8a93,_0x181432){return function(_0xfa1c52){if(!_0xfa1c52){_0x4b8a93[_0x28be('0x18')](0x194);}return _0xfa1c52;};}function handleError(_0xa64004,_0x4471af){_0x4471af=_0x4471af||0x1f4;return function(_0x55f11a){logger['error'](_0x55f11a[_0x28be('0x25')]);if(_0x55f11a[_0x28be('0x26')]){delete _0x55f11a[_0x28be('0x26')];}_0xa64004[_0x28be('0x1a')](_0x4471af)[_0x28be('0x27')](_0x55f11a);};}exports[_0x28be('0x28')]=function(_0x43c9dd,_0x12cf53){var _0x574f19={},_0x4da745={},_0x494721={'count':0x0,'rows':[]};var _0x450a4f=_['map'](db[_0x28be('0x29')][_0x28be('0x2a')],function(_0x278245){return{'name':_0x278245[_0x28be('0x2b')],'type':_0x278245[_0x28be('0x2c')]['key']};});_0x4da745[_0x28be('0x2d')]=_[_0x28be('0x2e')](_0x450a4f,_0x28be('0x26'));_0x4da745[_0x28be('0x2f')]=_[_0x28be('0x30')](_0x43c9dd['query']);_0x4da745['filters']=_[_0x28be('0x31')](_0x4da745[_0x28be('0x2d')],_0x4da745[_0x28be('0x2f')]);_0x4da745[_0x28be('0x32')]=_[_0x28be('0x33')](_0x4da745['filters'],['$and',_0x28be('0x34'),_0x28be('0x35'),_0x28be('0x36'),_0x28be('0x37'),_0x28be('0x38'),_0x28be('0x39'),'$eq',_0x28be('0x3a'),_0x28be('0x3b'),_0x28be('0x3c'),'$in','$notIn',_0x28be('0x3d'),_0x28be('0x3e'),_0x28be('0x3f'),'$notILike',_0x28be('0x3d'),'$overlap','$contains',_0x28be('0x40'),_0x28be('0x41')]);_0x574f19['attributes']=_[_0x28be('0x31')](_0x4da745['model'],qs[_0x28be('0x42')](_0x43c9dd[_0x28be('0x2f')]['fields']));_0x574f19['attributes']=_0x574f19['attributes'][_0x28be('0x43')]?_0x574f19[_0x28be('0x44')]:_0x4da745[_0x28be('0x2d')];if(!_0x43c9dd[_0x28be('0x2f')][_0x28be('0x45')]('nolimit')){_0x574f19[_0x28be('0x1c')]=qs[_0x28be('0x1c')](_0x43c9dd['query'][_0x28be('0x1c')]);_0x574f19[_0x28be('0x1f')]=qs[_0x28be('0x1f')](_0x43c9dd[_0x28be('0x2f')][_0x28be('0x1f')]);}_0x574f19[_0x28be('0x46')]=qs[_0x28be('0x47')](_0x43c9dd[_0x28be('0x2f')][_0x28be('0x47')]);_0x574f19[_0x28be('0x48')]=qs[_0x28be('0x32')](_['pick'](_0x43c9dd[_0x28be('0x2f')],_0x4da745['filters']),_0x450a4f);if(_0x43c9dd['query'][_0x28be('0x49')]){_0x574f19[_0x28be('0x48')]=_[_0x28be('0x4a')](_0x574f19[_0x28be('0x48')],{'$or':_['map'](_0x450a4f,function(_0x2f45c5){if(_0x2f45c5[_0x28be('0x2c')]!=='VIRTUAL'){var _0x1313f0={};_0x1313f0[_0x2f45c5[_0x28be('0x26')]]={'$like':'%'+_0x43c9dd[_0x28be('0x2f')][_0x28be('0x49')]+'%'};return _0x1313f0;}})});}_0x574f19=_['merge']({},_0x574f19,_0x43c9dd[_0x28be('0x4b')]);var _0x2c3324={'where':_0x574f19[_0x28be('0x48')]};return db[_0x28be('0x29')]['count'](_0x2c3324)[_0x28be('0x23')](function(_0x2ff1c4){_0x494721[_0x28be('0x1e')]=_0x2ff1c4;if(_0x43c9dd[_0x28be('0x2f')][_0x28be('0x4c')]){_0x574f19[_0x28be('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x28be('0x4e')](_0x574f19);})['then'](function(_0x13fd87){_0x494721[_0x28be('0x4f')]=_0x13fd87;return _0x494721;})[_0x28be('0x23')](respondWithFilteredResult(_0x12cf53,_0x574f19))['catch'](handleError(_0x12cf53,null));};exports[_0x28be('0x50')]=function(_0x1c3863,_0x34d283){var _0xbd724c={'raw':!![],'where':{'id':_0x1c3863[_0x28be('0x51')]['id']}},_0x9c269a={};_0x9c269a[_0x28be('0x2d')]=_[_0x28be('0x30')](db[_0x28be('0x29')][_0x28be('0x2a')]);_0x9c269a[_0x28be('0x2f')]=_[_0x28be('0x30')](_0x1c3863[_0x28be('0x2f')]);_0x9c269a['filters']=_[_0x28be('0x31')](_0x9c269a[_0x28be('0x2d')],_0x9c269a[_0x28be('0x2f')]);_0xbd724c[_0x28be('0x44')]=_['intersection'](_0x9c269a[_0x28be('0x2d')],qs['fields'](_0x1c3863[_0x28be('0x2f')][_0x28be('0x42')]));_0xbd724c[_0x28be('0x44')]=_0xbd724c[_0x28be('0x44')]['length']?_0xbd724c[_0x28be('0x44')]:_0x9c269a[_0x28be('0x2d')];if(_0x1c3863[_0x28be('0x2f')][_0x28be('0x4c')]){_0xbd724c['include']=[{'all':!![]}];}_0xbd724c=_[_0x28be('0x4a')]({},_0xbd724c,_0x1c3863[_0x28be('0x4b')]);return db[_0x28be('0x29')]['find'](_0xbd724c)[_0x28be('0x23')](handleEntityNotFound(_0x34d283,null))[_0x28be('0x23')](respondWithResult(_0x34d283,null))['catch'](handleError(_0x34d283,null));};exports[_0x28be('0x52')]=function(_0x5e19f3,_0x221048){return db[_0x28be('0x29')][_0x28be('0x52')](_0x5e19f3[_0x28be('0x53')],{})[_0x28be('0x23')](respondWithResult(_0x221048,0xc9))[_0x28be('0x54')](handleError(_0x221048,null));};exports[_0x28be('0x22')]=function(_0x67367c,_0x5585a6){if(_0x67367c[_0x28be('0x53')]['id']){delete _0x67367c['body']['id'];}return db[_0x28be('0x29')][_0x28be('0x55')]({'where':{'id':_0x67367c[_0x28be('0x51')]['id']}})['then'](handleEntityNotFound(_0x5585a6,null))[_0x28be('0x23')](saveUpdates(_0x67367c[_0x28be('0x53')],null))[_0x28be('0x23')](respondWithResult(_0x5585a6,null))[_0x28be('0x54')](handleError(_0x5585a6,null));};exports[_0x28be('0x56')]=function(_0x77b695,_0x5002c9){return db[_0x28be('0x29')][_0x28be('0x56')]()[_0x28be('0x23')](respondWithResult(_0x5002c9,null))[_0x28be('0x54')](handleError(_0x5002c9,null));};exports[_0x28be('0x24')]=function(_0x34d919,_0x368522){var _0x52057e;return db[_0x28be('0x29')][_0x28be('0x55')]({'where':{'id':_0x34d919[_0x28be('0x51')]['id']}})['then'](handleEntityNotFound(_0x368522,null))[_0x28be('0x23')](function(_0x21c711){if(_0x21c711){return _0x21c711['destroy']()[_0x28be('0x23')](function(_0x58edb7){return _0x58edb7;});}})[_0x28be('0x23')](function(_0x224920){_0x52057e=_0x224920;if(_0x224920){if(_0x224920[_0x28be('0x57')]||_0x224920[_0x28be('0x58')]){return db[_0x224920[_0x28be('0x57')]?'VoiceQueue':_0x28be('0x59')][_0x28be('0x55')]({'where':{'id':_0x224920[_0x28be('0x57')]?_0x224920[_0x28be('0x57')]:_0x224920[_0x28be('0x58')]},'attributes':['id',_0x28be('0x26')],'raw':!![]});}}})[_0x28be('0x23')](function(_0x4e6f40){var _0x1d6505={};if(_0x4e6f40){_[_0x28be('0x4a')](_0x1d6505,_[_0x28be('0x5a')](_0x52057e[_0x28be('0x5b')],[_0x28be('0x5c'),_0x28be('0x5d'),'id']));_0x1d6505[_0x28be('0x5e')]=0x15;_0x1d6505['statedesc']='deleted';_0x1d6505['campaign']=_0x4e6f40[_0x28be('0x26')];_0x1d6505['membername']=_0x34d919[_0x28be('0x5f')][_0x28be('0x26')];_0x1d6505[_0x28be('0x60')]=_0x34d919[_0x28be('0x5f')]['id'];_0x1d6505[_0x28be('0x61')]=!![];_0x1d6505[_0x28be('0x62')]=moment()[_0x28be('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d6505[_0x28be('0x64')]=_0x52057e[_0x28be('0x65')];_0x1d6505[_0x28be('0x66')]=_0x52057e[_0x28be('0x57')]?'queue':_0x28be('0x67');return db[_0x28be('0x68')]['find']({'where':{'id':_0x1d6505[_0x28be('0x69')]},'attributes':[_0x28be('0x6a'),'lastName']})[_0x28be('0x23')](function(_0x5ba1c9){if(!_['isNil'](_0x368522)&&!_[_0x28be('0x6b')](_0x5ba1c9[_0x28be('0x6a')])){_0x1d6505[_0x28be('0x6c')]=_0x5ba1c9[_0x28be('0x6a')];if(!_['isNil'](_0x5ba1c9['lastName'])){_0x1d6505['calleridname']+='\x20'+_0x5ba1c9['lastName'];}}})[_0x28be('0x6d')](function(){return db[_0x28be('0x6e')]['create'](_0x1d6505);});}})[_0x28be('0x23')](function(){return _0x368522[_0x28be('0x1a')](0xcc)['end']();})[_0x28be('0x54')](handleError(_0x368522,null));};exports[_0x28be('0x6f')]=function(_0x6d78d8,_0x1151b8,_0x552636){var _0x3e7642=[];return db[_0x28be('0x68')][_0x28be('0x56')]()['then'](function(_0x24f87e){_0x3e7642=_[_0x28be('0x30')](_0x24f87e);return _0x6d78d8[_0x28be('0x5f')][_0x28be('0x70')]({'where':{'type':_0x28be('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x28be('0x72'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x28be('0x23')](function(_0x1a7be5){if(_0x1a7be5&&_0x1a7be5['length']){return db[_0x28be('0x73')][_0x28be('0x74')](function(_0x6eab80){var _0x52f457={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x28be('0x63')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x28be('0x2e')](_0x1a7be5,'id')},'$or':[{'UserId':null},{'UserId':_0x6d78d8[_0x28be('0x5f')]['id']}]};var _0x44bdaf={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1a7be5)[_0x28be('0x49')]([_0x28be('0x75'),0x0])['map']('id')[_0x28be('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x6d78d8[_0x28be('0x5f')]['id']}]};var _0x8b03b5={'$or':[_0x52f457,_0x44bdaf]};var _0x291a0f=[];if(_0x6d78d8[_0x28be('0x53')][_0x28be('0x77')]&&_0x6d78d8[_0x28be('0x53')][_0x28be('0x77')]==='prev'){if(!_[_0x28be('0x78')](_0x6d78d8[_0x28be('0x53')][_0x28be('0x79')])){_0x8b03b5['id']={'$in':_0x6d78d8[_0x28be('0x53')]['hopperIds']};}_0x291a0f=[[_0x28be('0x7a'),_0x28be('0x7b')],['scheduledAt',_0x1a7be5[0x0]['dialOrderByScheduledAt']==='ASC'?_0x28be('0x7c'):_0x28be('0x7b')],db[_0x28be('0x73')][_0x28be('0x7d')](_0x28be('0x7e')),['id',_0x28be('0x7c')]];}else{if(!_[_0x28be('0x78')](_0x6d78d8[_0x28be('0x53')][_0x28be('0x79')])){_0x8b03b5['id']={'$notIn':_0x6d78d8[_0x28be('0x53')][_0x28be('0x79')]};}_0x291a0f=[[_0x28be('0x7a'),'DESC'],['scheduledAt',_0x1a7be5[0x0][_0x28be('0x72')]],db['sequelize'][_0x28be('0x7d')](_0x28be('0x7f')),['id',_0x28be('0x7b')]];}return db['CmHopper'][_0x28be('0x80')]({'attributes':['id',_0x28be('0x81'),_0x28be('0x82')],'where':_0x8b03b5,'order':_0x291a0f,'transaction':_0x6eab80,'lock':_0x6eab80[_0x28be('0x83')][_0x28be('0x84')],'include':[{'model':db[_0x28be('0x68')],'as':_0x28be('0x85'),'attributes':_0x3e7642,'include':[{'model':db[_0x28be('0x86')],'as':_0x28be('0x87'),'attributes':['id',_0x28be('0x26')]}]},{'model':db[_0x28be('0x88')],'as':_0x28be('0x89'),'attributes':['id',_0x28be('0x26')]},{'model':db[_0x28be('0x8a')],'as':_0x28be('0x8b'),'attributes':['id','name','dialActive']}]})[_0x28be('0x23')](function(_0x40e604){if(_0x40e604){return _0x40e604['update']({'UserId':_0x6d78d8[_0x28be('0x5f')]['id']},{'transaction':_0x6eab80});}});});}})['then'](handleEntityNotFound(_0x1151b8,null))[_0x28be('0x23')](respondWithResult(_0x1151b8,null))[_0x28be('0x54')](handleError(_0x1151b8,null));};exports['getOpenContacts']=function(_0x45f8d0,_0x575d23,_0x33ab3a){return _0x45f8d0[_0x28be('0x5f')][_0x28be('0x70')]({'where':{'type':_0x28be('0x71'),'dialActive':!![],'dialMethod':_0x28be('0x8c')},'attributes':['id'],'raw':!![]})['then'](function(_0x215683){if(_0x215683&&_0x215683[_0x28be('0x43')]){return db[_0x28be('0x29')][_0x28be('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x28be('0x63')](_0x28be('0x8d'))},'VoiceQueueId':{'$in':_[_0x28be('0x2e')](_0x215683,'id')},'$or':[{'UserId':null},{'UserId':_0x45f8d0[_0x28be('0x5f')]['id']}]}});}return 0x0;})[_0x28be('0x23')](function(_0x948794){if(!_[_0x28be('0x6b')](_0x948794)&&_['isNumber'](_0x948794)){return _0x575d23[_0x28be('0x1a')](0xc8)[_0x28be('0x1b')]({'contacts':_0x948794});}else{logger[_0x28be('0x8e')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x28be('0x8f'),0x194,_0x28be('0x90'));_0x575d23[_0x28be('0x18')](0x194);}})['catch'](handleError(_0x575d23,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 29c0df5..682c655 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 _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ce175,_0x42edb3){var _0x53ba2e=function(_0x305edd){while(--_0x305edd){_0x4ce175['push'](_0x4ce175['shift']());}};_0x53ba2e(++_0x42edb3);}(_0x1261,0x144));var _0x1126=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x1261[_0x21b762];return _0x2ea6d4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x13f9b2,_0x5a09c9){var _0x404c57=function(_0x5852be){while(--_0x5852be){_0x13f9b2['push'](_0x13f9b2['shift']());}};_0x404c57(++_0x5a09c9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x5fc3[_0x4bb2b9];return _0x40e2a2;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 3129f53..3100ac1 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 _0x54cd=['model','map','then','GetCmHopper','debug','catch','CmHopper','find','raw','ShowCmHopper','CreateCmHopper','UpdateCmHopper','update','body','DestroyCmHopper','destroy','describe','transaction','findAll','UPDATE','CmContact','Contact','keys','User','Agent','voicePause','UserId','push','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','sequelize','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','length','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','options','where','attributes','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54cd,0x145));var _0xd54c=function(_0x461ddb,_0x1703ce){_0x461ddb=_0x461ddb-0x0;var _0x45dbfa=_0x54cd[_0x461ddb];return _0x45dbfa;};'use strict';var _=require(_0xd54c('0x0'));var util=require(_0xd54c('0x1'));var moment=require(_0xd54c('0x2'));var BPromise=require(_0xd54c('0x3'));var rs=require(_0xd54c('0x4'));var fs=require('fs');var Redis=require(_0xd54c('0x5'));var db=require(_0xd54c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd54c('0x7'))(_0xd54c('0x8'));var config=require(_0xd54c('0x9'));var jayson=require(_0xd54c('0xa'));var client=jayson['client'][_0xd54c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54b50d,_0x336d11,_0x339b9f){return new BPromise(function(_0x149b2e,_0x4de007){return client['request'](_0x54b50d,_0x339b9f)['then'](function(_0x234b33){logger[_0xd54c('0xc')](_0xd54c('0xd'),_0x336d11,_0xd54c('0xe'));logger['debug'](_0xd54c('0xf'),_0x336d11,_0xd54c('0xe'),JSON[_0xd54c('0x10')](_0x234b33));if(_0x234b33[_0xd54c('0x11')]){if(_0x234b33[_0xd54c('0x11')]['code']===0x1f4){logger[_0xd54c('0x11')](_0xd54c('0xd'),_0x336d11,_0x234b33[_0xd54c('0x11')][_0xd54c('0x12')]);return _0x4de007(_0x234b33[_0xd54c('0x11')][_0xd54c('0x12')]);}logger[_0xd54c('0x11')]('CmHopper,\x20%s,\x20%s',_0x336d11,_0x234b33[_0xd54c('0x11')][_0xd54c('0x12')]);return _0x149b2e(_0x234b33[_0xd54c('0x11')][_0xd54c('0x12')]);}else{logger[_0xd54c('0xc')]('CmHopper,\x20%s,\x20%s',_0x336d11,'request\x20sent');_0x149b2e(_0x234b33[_0xd54c('0x13')]['message']);}})['catch'](function(_0x1466bc){logger['error'](_0xd54c('0xd'),_0x336d11,_0x1466bc);_0x4de007(_0x1466bc);});});}exports['GetCmHopper']=function(_0x25a0ec){var _0x17629f=this;return new Promise(function(_0x52ff70,_0x5cf7ab){return db['CmHopper']['findAll']({'raw':_0x25a0ec['options']?_0x25a0ec[_0xd54c('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x25a0ec['options']?_0x25a0ec['options'][_0xd54c('0x15')]||null:null,'attributes':_0x25a0ec[_0xd54c('0x14')]?_0x25a0ec[_0xd54c('0x14')][_0xd54c('0x16')]||null:null,'limit':_0x25a0ec[_0xd54c('0x14')]?_0x25a0ec[_0xd54c('0x14')][_0xd54c('0x17')]||null:null,'include':_0x25a0ec['options']?_0x25a0ec[_0xd54c('0x14')][_0xd54c('0x18')]?_['map'](_0x25a0ec[_0xd54c('0x14')][_0xd54c('0x18')],function(_0x572258){return{'model':db[_0x572258[_0xd54c('0x19')]],'as':_0x572258['as'],'attributes':_0x572258[_0xd54c('0x16')],'include':_0x572258['include']?_[_0xd54c('0x1a')](_0x572258['include'],function(_0x4730fb){return{'model':db[_0x4730fb[_0xd54c('0x19')]],'as':_0x4730fb['as'],'attributes':_0x4730fb[_0xd54c('0x16')],'include':_0x4730fb[_0xd54c('0x18')]?_['map'](_0x4730fb[_0xd54c('0x18')],function(_0x12f443){return{'model':db[_0x12f443['model']],'as':_0x12f443['as'],'attributes':_0x12f443[_0xd54c('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd54c('0x1b')](function(_0x2f2089){logger['info'](_0xd54c('0x1c'),_0x25a0ec);logger[_0xd54c('0x1d')](_0xd54c('0x1c'),_0x25a0ec,JSON[_0xd54c('0x10')](_0x2f2089));_0x52ff70(_0x2f2089);})[_0xd54c('0x1e')](function(_0x5e24e5){logger['error'](_0xd54c('0x1c'),_0x5e24e5[_0xd54c('0x12')],_0x25a0ec);_0x5cf7ab(_0x17629f[_0xd54c('0x11')](0x1f4,_0x5e24e5[_0xd54c('0x12')]));});});};exports['ShowCmHopper']=function(_0x3748f3){var _0xf1bb9a=this;return new Promise(function(_0x48319f,_0x1a981a){return db[_0xd54c('0x1f')][_0xd54c('0x20')]({'raw':_0x3748f3[_0xd54c('0x14')]?_0x3748f3[_0xd54c('0x14')][_0xd54c('0x21')]===undefined?!![]:![]:!![],'where':_0x3748f3[_0xd54c('0x14')]?_0x3748f3[_0xd54c('0x14')][_0xd54c('0x15')]||null:null,'attributes':_0x3748f3[_0xd54c('0x14')]?_0x3748f3[_0xd54c('0x14')][_0xd54c('0x16')]||null:null,'include':_0x3748f3['options']?_0x3748f3['options'][_0xd54c('0x18')]?_['map'](_0x3748f3[_0xd54c('0x14')][_0xd54c('0x18')],function(_0x20f00d){return{'model':db[_0x20f00d[_0xd54c('0x19')]],'as':_0x20f00d['as'],'attributes':_0x20f00d[_0xd54c('0x16')],'include':_0x20f00d[_0xd54c('0x18')]?_[_0xd54c('0x1a')](_0x20f00d[_0xd54c('0x18')],function(_0x5457df){return{'model':db[_0x5457df['model']],'as':_0x5457df['as'],'attributes':_0x5457df[_0xd54c('0x16')],'include':_0x5457df[_0xd54c('0x18')]?_[_0xd54c('0x1a')](_0x5457df[_0xd54c('0x18')],function(_0x461b69){return{'model':db[_0x461b69[_0xd54c('0x19')]],'as':_0x461b69['as'],'attributes':_0x461b69[_0xd54c('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd54c('0x1b')](function(_0x32535e){logger[_0xd54c('0xc')](_0xd54c('0x22'),_0x3748f3);logger[_0xd54c('0x1d')](_0xd54c('0x22'),_0x3748f3,JSON[_0xd54c('0x10')](_0x32535e));_0x48319f(_0x32535e);})[_0xd54c('0x1e')](function(_0x37578a){logger[_0xd54c('0x11')](_0xd54c('0x22'),_0x37578a[_0xd54c('0x12')],_0x3748f3);_0x1a981a(_0xf1bb9a['error'](0x1f4,_0x37578a[_0xd54c('0x12')]));});});};exports[_0xd54c('0x23')]=function(_0x4f6801){var _0x419370=this;return new Promise(function(_0x3721bb,_0x44ee1c){return db[_0xd54c('0x1f')]['create'](_0x4f6801['body'],{'raw':_0x4f6801[_0xd54c('0x14')]?_0x4f6801['options']['raw']===undefined?!![]:![]:!![]})[_0xd54c('0x1b')](function(_0x1542e3){logger[_0xd54c('0xc')](_0xd54c('0x23'),_0x4f6801);logger[_0xd54c('0x1d')](_0xd54c('0x23'),_0x4f6801,JSON[_0xd54c('0x10')](_0x1542e3));_0x3721bb(_0x1542e3);})[_0xd54c('0x1e')](function(_0xd3fe6){logger[_0xd54c('0x11')](_0xd54c('0x23'),_0xd3fe6[_0xd54c('0x12')],_0x4f6801);_0x44ee1c(_0x419370[_0xd54c('0x11')](0x1f4,_0xd3fe6[_0xd54c('0x12')]));});});};exports[_0xd54c('0x24')]=function(_0x989179){var _0x52724e=this;return new Promise(function(_0x53b7be,_0x35716f){return db[_0xd54c('0x1f')][_0xd54c('0x25')](_0x989179[_0xd54c('0x26')],{'raw':_0x989179['options']?_0x989179[_0xd54c('0x14')][_0xd54c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x989179['options']?_0x989179['options'][_0xd54c('0x15')]||null:null,'attributes':_0x989179[_0xd54c('0x14')]?_0x989179[_0xd54c('0x14')]['attributes']||null:null,'limit':_0x989179['options']?_0x989179['options'][_0xd54c('0x17')]||null:null})[_0xd54c('0x1b')](function(_0x591c04){logger[_0xd54c('0xc')]('UpdateCmHopper',_0x989179);logger[_0xd54c('0x1d')](_0xd54c('0x24'),_0x989179,JSON[_0xd54c('0x10')](_0x591c04));_0x53b7be(_0x591c04);})[_0xd54c('0x1e')](function(_0x206100){logger[_0xd54c('0x11')]('UpdateCmHopper',_0x206100[_0xd54c('0x12')],_0x989179);_0x35716f(_0x52724e[_0xd54c('0x11')](0x1f4,_0x206100['message']));});});};exports[_0xd54c('0x27')]=function(_0x4a7283){var _0x412917=this;return new Promise(function(_0x25df5d,_0x4ba5ca){return db[_0xd54c('0x1f')][_0xd54c('0x28')]({'where':_0x4a7283[_0xd54c('0x14')]?_0x4a7283[_0xd54c('0x14')][_0xd54c('0x15')]||null:null})[_0xd54c('0x1b')](function(_0x11422c){logger[_0xd54c('0xc')](_0xd54c('0x27'),_0x4a7283);logger[_0xd54c('0x1d')](_0xd54c('0x27'),_0x4a7283,JSON[_0xd54c('0x10')](_0x11422c));_0x25df5d(_0x11422c);})[_0xd54c('0x1e')](function(_0x5b8f7d){logger[_0xd54c('0x11')]('DestroyCmHopper',_0x5b8f7d[_0xd54c('0x12')],_0x4a7283);_0x4ba5ca(_0x412917[_0xd54c('0x11')](0x1f4,_0x5b8f7d['message']));});});};exports['GetContactDialer']=function(_0x3330cc){var _0x5bcde3=this;return new Promise(function(_0xa47bac,_0xba397e){return db['CmContact'][_0xd54c('0x29')]()['then'](function(_0xa82433){return db['sequelize'][_0xd54c('0x2a')](function(_0x430b06){return db[_0xd54c('0x1f')][_0xd54c('0x2b')]({'where':_0x3330cc[_0xd54c('0x14')]?_0x3330cc[_0xd54c('0x14')]['where']||null:null,'attributes':_0x3330cc['options']?_0x3330cc[_0xd54c('0x14')][_0xd54c('0x16')]||null:null,'limit':_0x3330cc[_0xd54c('0x14')]?_0x3330cc[_0xd54c('0x14')][_0xd54c('0x17')]||null:null,'order':_0x3330cc[_0xd54c('0x14')]?_0x3330cc[_0xd54c('0x14')]['order']||null:null,'transaction':_0x430b06,'lock':_0x430b06['LOCK'][_0xd54c('0x2c')],'include':[{'model':db[_0xd54c('0x2d')],'as':_0xd54c('0x2e'),'attributes':_[_0xd54c('0x2f')](_0xa82433)},{'model':db[_0xd54c('0x30')],'as':_0xd54c('0x31'),'attributes':['id','name',_0xd54c('0x32')]}]})[_0xd54c('0x1b')](function(_0x4cad08){var _0x3a6f4d=[];var _0x3897f8=[];for(var _0x3c7619=0x0;_0x3c7619<_0x4cad08['length'];_0x3c7619+=0x1){var _0x378751=_0x4cad08[_0x3c7619][_0xd54c('0x33')];if(_0x378751===null){_0x3a6f4d['push'](_0x4cad08[_0x3c7619]['update'](_0x3330cc[_0xd54c('0x26')],{'transaction':_0x430b06}));}else if(!_0x3897f8['includes'](_0x378751)){_0x3897f8[_0xd54c('0x34')](_0x378751);_0x3a6f4d[_0xd54c('0x34')](_0x4cad08[_0x3c7619][_0xd54c('0x25')](_0x3330cc[_0xd54c('0x26')],{'transaction':_0x430b06}));}}return BPromise[_0xd54c('0x35')](_0x3a6f4d);});})['then'](function(_0x4b1a68){logger[_0xd54c('0xc')]('GetContactDialer',_0x3330cc);logger[_0xd54c('0x1d')](_0xd54c('0x36'),_0x3330cc,JSON['stringify'](_0x4b1a68));_0xa47bac(_0x4b1a68);})[_0xd54c('0x1e')](function(_0x6e8037){logger[_0xd54c('0x11')](_0xd54c('0x36'),_0x6e8037[_0xd54c('0x12')],_0x3330cc);_0xba397e(_0x5bcde3['error'](0x1f4,_0x6e8037['message']));});});});};exports[_0xd54c('0x37')]=function(_0x4bb1b0){var _0xdd5824=this;return new Promise(function(_0x598461,_0x4c18a9){return db['sequelize'][_0xd54c('0x2a')](function(_0x74ed65){return db[_0xd54c('0x38')]['create'](_0x4bb1b0[_0xd54c('0x26')],{'raw':_0x4bb1b0[_0xd54c('0x14')]?_0x4bb1b0[_0xd54c('0x14')][_0xd54c('0x21')]===undefined?!![]:![]:!![],'transaction':_0x74ed65})['then'](function(){return db['CmHopper'][_0xd54c('0x28')]({'where':_0x4bb1b0[_0xd54c('0x14')]?_0x4bb1b0[_0xd54c('0x14')][_0xd54c('0x15')]||null:null,'transaction':_0x74ed65});});})[_0xd54c('0x1b')](function(_0x2aadd1){logger[_0xd54c('0xc')](_0xd54c('0x37'),_0x4bb1b0);logger[_0xd54c('0x1d')]('MoveContactManagedDialer',_0x4bb1b0,JSON[_0xd54c('0x10')](_0x2aadd1));_0x598461(_0x2aadd1);})[_0xd54c('0x1e')](function(_0x1a9fc6){logger[_0xd54c('0x11')]('MoveContactManagedDialer',_0x1a9fc6[_0xd54c('0x12')],_0x4bb1b0);_0x4c18a9(_0xdd5824[_0xd54c('0x11')](0x1f4,_0x1a9fc6[_0xd54c('0x12')]));});});};exports[_0xd54c('0x39')]=function(_0x126c0f){var _0x554fc3=this;return new Promise(function(_0x16e1d5,_0x50c963){return db[_0xd54c('0x1f')][_0xd54c('0x2b')]({'raw':_0x126c0f[_0xd54c('0x14')]?_0x126c0f[_0xd54c('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x126c0f[_0xd54c('0x14')]?_0x126c0f['options'][_0xd54c('0x15')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd54c('0x3a'),db[_0xd54c('0x3b')]['fn']('IF',db['sequelize'][_0xd54c('0x3c')](_0xd54c('0x3d')+util['format']('\x22%s\x22',moment()[_0xd54c('0x3e')](_0xd54c('0x3f')))+_0xd54c('0x40')))),_0xd54c('0x41')]]})['then'](function(_0x5495fd){logger[_0xd54c('0xc')](_0xd54c('0x39'),_0x126c0f);logger['debug'](_0xd54c('0x39'),_0x126c0f,JSON[_0xd54c('0x10')](_0x5495fd));_0x16e1d5(_0x5495fd);})['catch'](function(_0x12537d){logger['error'](_0xd54c('0x39'),_0x12537d[_0xd54c('0x12')],_0x126c0f);_0x50c963(_0x554fc3[_0xd54c('0x11')](0x1f4,_0x12537d['message']));});});};exports[_0xd54c('0x42')]=function(_0x494fa0){var _0x3f339c=this;return new Promise(function(_0x2ed625,_0x231f6a){return db[_0xd54c('0x2d')][_0xd54c('0x29')]()[_0xd54c('0x1b')](function(_0x4d382f){return db[_0xd54c('0x3b')]['transaction'](function(_0x452189){return db[_0xd54c('0x1f')][_0xd54c('0x2b')]({'where':_0x494fa0[_0xd54c('0x14')]?_0x494fa0[_0xd54c('0x14')][_0xd54c('0x15')]||null:null,'attributes':_0x494fa0['options']?_0x494fa0[_0xd54c('0x14')][_0xd54c('0x16')]||null:null,'limit':0x1,'order':_0x494fa0[_0xd54c('0x14')]?_0x494fa0[_0xd54c('0x14')][_0xd54c('0x43')]||null:null,'group':db[_0xd54c('0x1f')]['UserId'],'transaction':_0x452189,'lock':_0x452189['LOCK'][_0xd54c('0x2c')],'include':_0x494fa0[_0xd54c('0x14')]?_0x494fa0[_0xd54c('0x14')][_0xd54c('0x18')]?_[_0xd54c('0x1a')](_0x494fa0['options']['include'],function(_0xe1978b){return{'model':db[_0xe1978b[_0xd54c('0x19')]],'as':_0xe1978b['as'],'attributes':_0xe1978b[_0xd54c('0x16')],'include':_0xe1978b[_0xd54c('0x18')]?_[_0xd54c('0x1a')](_0xe1978b['include'],function(_0x519328){return{'model':db[_0x519328[_0xd54c('0x19')]],'as':_0x519328['as'],'attributes':_0x519328[_0xd54c('0x16')],'include':_0x519328['include']?_[_0xd54c('0x1a')](_0x519328[_0xd54c('0x18')],function(_0x50dbbd){return{'model':db[_0x50dbbd['model']],'as':_0x50dbbd['as'],'attributes':_0x50dbbd['attributes']};}):[]};}):[]};}):[]:[]})[_0xd54c('0x1b')](function(_0x513c33){var _0x2ee92a=[];for(var _0x372006=0x0;_0x372006<_0x513c33[_0xd54c('0x44')];_0x372006+=0x1){_0x2ee92a[_0xd54c('0x34')](_0x513c33[_0x372006][_0xd54c('0x25')](_0x494fa0['body'],{'transaction':_0x452189}));}return BPromise['all'](_0x2ee92a);});})['then'](function(_0x55613e){logger[_0xd54c('0xc')]('GetContactRecallMe',_0x494fa0);logger[_0xd54c('0x1d')](_0xd54c('0x42'),_0x494fa0,JSON[_0xd54c('0x10')](_0x55613e));_0x2ed625(_0x55613e);})[_0xd54c('0x1e')](function(_0x957916){logger[_0xd54c('0x11')](_0xd54c('0x42'),_0x957916[_0xd54c('0x12')],_0x494fa0);_0x231f6a(_0x3f339c[_0xd54c('0x11')](0x1f4,_0x957916[_0xd54c('0x12')]));});});});};exports[_0xd54c('0x45')]=function(_0x40aa8c){var _0x3bca38=this;return new Promise(function(_0x177505,_0x16c93d){db[_0xd54c('0x2d')]['describe']()[_0xd54c('0x1b')](function(_0x1830c9){return db[_0xd54c('0x1f')][_0xd54c('0x2b')]({'raw':_0x40aa8c['options']?_0x40aa8c['options'][_0xd54c('0x21')]===undefined?!![]:![]:!![],'where':_0x40aa8c[_0xd54c('0x14')]?_0x40aa8c[_0xd54c('0x14')][_0xd54c('0x15')]||null:null,'attributes':_0x40aa8c[_0xd54c('0x14')]?_0x40aa8c[_0xd54c('0x14')][_0xd54c('0x16')]||null:null,'limit':_0x40aa8c[_0xd54c('0x14')]?_0x40aa8c[_0xd54c('0x14')]['limit']||null:null,'include':_0x40aa8c[_0xd54c('0x14')]?_0x40aa8c['options']['include']?_[_0xd54c('0x1a')](_0x40aa8c['options'][_0xd54c('0x18')],function(_0x31aad1){return{'model':db[_0x31aad1[_0xd54c('0x19')]],'as':_0x31aad1['as'],'attributes':_0x31aad1['as']==='Contact'?_['keys'](_0x1830c9):_0x31aad1[_0xd54c('0x16')],'include':_0x31aad1[_0xd54c('0x18')]?_[_0xd54c('0x1a')](_0x31aad1['include'],function(_0x1dcffe){return{'model':db[_0x1dcffe[_0xd54c('0x19')]],'as':_0x1dcffe['as'],'attributes':_0x1dcffe[_0xd54c('0x16')],'include':_0x1dcffe['include']?_['map'](_0x1dcffe[_0xd54c('0x18')],function(_0x5208ea){return{'model':db[_0x5208ea[_0xd54c('0x19')]],'as':_0x5208ea['as'],'attributes':_0x5208ea['attributes']};}):[]};}):[]};}):[]:[]})[_0xd54c('0x1b')](function(_0xa01ee6){logger[_0xd54c('0xc')](_0xd54c('0x1c'),_0x40aa8c);logger[_0xd54c('0x1d')](_0xd54c('0x1c'),_0x40aa8c,JSON['stringify'](_0xa01ee6));_0x177505(_0xa01ee6);})['catch'](function(_0x195b20){logger[_0xd54c('0x11')](_0xd54c('0x1c'),_0x195b20['message'],_0x40aa8c);_0x16c93d(_0x3bca38[_0xd54c('0x11')](0x1f4,_0x195b20[_0xd54c('0x12')]));});});});}; \ No newline at end of file +var _0x9e1f=['CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','UserId','push','body','includes','MoveContactManagedDialer','CountReScheduled','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','all','GetCmHopperPreview','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find'];(function(_0xaa1cd4,_0x27e8e7){var _0x3e3ff1=function(_0x1e7f50){while(--_0x1e7f50){_0xaa1cd4['push'](_0xaa1cd4['shift']());}};_0x3e3ff1(++_0x27e8e7);}(_0x9e1f,0xe1));var _0xf9e1=function(_0x324d5f,_0x213869){_0x324d5f=_0x324d5f-0x0;var _0x34cfef=_0x9e1f[_0x324d5f];return _0x34cfef;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9e1('0x4'))['db'];var utils=require(_0xf9e1('0x5'));var logger=require('../../config/logger')(_0xf9e1('0x6'));var config=require(_0xf9e1('0x7'));var jayson=require(_0xf9e1('0x8'));var client=jayson[_0xf9e1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5468b0,_0x4c0ff3,_0x22732b){return new BPromise(function(_0xf8d16a,_0x25481c){return client['request'](_0x5468b0,_0x22732b)[_0xf9e1('0xa')](function(_0x52af54){logger[_0xf9e1('0xb')](_0xf9e1('0xc'),_0x4c0ff3,_0xf9e1('0xd'));logger[_0xf9e1('0xe')](_0xf9e1('0xf'),_0x4c0ff3,_0xf9e1('0xd'),JSON[_0xf9e1('0x10')](_0x52af54));if(_0x52af54[_0xf9e1('0x11')]){if(_0x52af54[_0xf9e1('0x11')][_0xf9e1('0x12')]===0x1f4){logger['error'](_0xf9e1('0xc'),_0x4c0ff3,_0x52af54[_0xf9e1('0x11')][_0xf9e1('0x13')]);return _0x25481c(_0x52af54['error']['message']);}logger[_0xf9e1('0x11')](_0xf9e1('0xc'),_0x4c0ff3,_0x52af54['error'][_0xf9e1('0x13')]);return _0xf8d16a(_0x52af54[_0xf9e1('0x11')][_0xf9e1('0x13')]);}else{logger[_0xf9e1('0xb')](_0xf9e1('0xc'),_0x4c0ff3,_0xf9e1('0xd'));_0xf8d16a(_0x52af54[_0xf9e1('0x14')]['message']);}})[_0xf9e1('0x15')](function(_0x39bbf2){logger[_0xf9e1('0x11')](_0xf9e1('0xc'),_0x4c0ff3,_0x39bbf2);_0x25481c(_0x39bbf2);});});}exports[_0xf9e1('0x16')]=function(_0x5a3dec){var _0x43c9d4=this;return new Promise(function(_0x46c3a0,_0x517f6a){return db[_0xf9e1('0x17')][_0xf9e1('0x18')]({'raw':_0x5a3dec[_0xf9e1('0x19')]?_0x5a3dec[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a3dec['options']?_0x5a3dec['options'][_0xf9e1('0x1b')]||null:null,'attributes':_0x5a3dec[_0xf9e1('0x19')]?_0x5a3dec['options'][_0xf9e1('0x1c')]||null:null,'limit':_0x5a3dec['options']?_0x5a3dec[_0xf9e1('0x19')][_0xf9e1('0x1d')]||null:null,'include':_0x5a3dec[_0xf9e1('0x19')]?_0x5a3dec[_0xf9e1('0x19')][_0xf9e1('0x1e')]?_[_0xf9e1('0x1f')](_0x5a3dec[_0xf9e1('0x19')]['include'],function(_0x4a78cf){return{'model':db[_0x4a78cf['model']],'as':_0x4a78cf['as'],'attributes':_0x4a78cf[_0xf9e1('0x1c')],'include':_0x4a78cf[_0xf9e1('0x1e')]?_[_0xf9e1('0x1f')](_0x4a78cf[_0xf9e1('0x1e')],function(_0x4a126e){return{'model':db[_0x4a126e[_0xf9e1('0x20')]],'as':_0x4a126e['as'],'attributes':_0x4a126e[_0xf9e1('0x1c')],'include':_0x4a126e['include']?_[_0xf9e1('0x1f')](_0x4a126e[_0xf9e1('0x1e')],function(_0x15119a){return{'model':db[_0x15119a[_0xf9e1('0x20')]],'as':_0x15119a['as'],'attributes':_0x15119a[_0xf9e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf9e1('0xa')](function(_0x5db17f){logger[_0xf9e1('0xb')](_0xf9e1('0x16'),_0x5a3dec);logger[_0xf9e1('0xe')]('GetCmHopper',_0x5a3dec,JSON['stringify'](_0x5db17f));_0x46c3a0(_0x5db17f);})['catch'](function(_0x8289db){logger[_0xf9e1('0x11')](_0xf9e1('0x16'),_0x8289db[_0xf9e1('0x13')],_0x5a3dec);_0x517f6a(_0x43c9d4[_0xf9e1('0x11')](0x1f4,_0x8289db['message']));});});};exports[_0xf9e1('0x21')]=function(_0x57aae0){var _0x388253=this;return new Promise(function(_0xe46c9e,_0x2617f7){return db[_0xf9e1('0x17')][_0xf9e1('0x22')]({'raw':_0x57aae0[_0xf9e1('0x19')]?_0x57aae0['options']['raw']===undefined?!![]:![]:!![],'where':_0x57aae0[_0xf9e1('0x19')]?_0x57aae0['options'][_0xf9e1('0x1b')]||null:null,'attributes':_0x57aae0[_0xf9e1('0x19')]?_0x57aae0[_0xf9e1('0x19')]['attributes']||null:null,'include':_0x57aae0[_0xf9e1('0x19')]?_0x57aae0['options']['include']?_[_0xf9e1('0x1f')](_0x57aae0[_0xf9e1('0x19')][_0xf9e1('0x1e')],function(_0x49d282){return{'model':db[_0x49d282[_0xf9e1('0x20')]],'as':_0x49d282['as'],'attributes':_0x49d282[_0xf9e1('0x1c')],'include':_0x49d282['include']?_['map'](_0x49d282['include'],function(_0x285519){return{'model':db[_0x285519[_0xf9e1('0x20')]],'as':_0x285519['as'],'attributes':_0x285519[_0xf9e1('0x1c')],'include':_0x285519['include']?_[_0xf9e1('0x1f')](_0x285519[_0xf9e1('0x1e')],function(_0x597494){return{'model':db[_0x597494[_0xf9e1('0x20')]],'as':_0x597494['as'],'attributes':_0x597494['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9e1('0xa')](function(_0x5ca098){logger['info'](_0xf9e1('0x21'),_0x57aae0);logger[_0xf9e1('0xe')](_0xf9e1('0x21'),_0x57aae0,JSON[_0xf9e1('0x10')](_0x5ca098));_0xe46c9e(_0x5ca098);})[_0xf9e1('0x15')](function(_0x344edf){logger[_0xf9e1('0x11')]('ShowCmHopper',_0x344edf[_0xf9e1('0x13')],_0x57aae0);_0x2617f7(_0x388253[_0xf9e1('0x11')](0x1f4,_0x344edf[_0xf9e1('0x13')]));});});};exports[_0xf9e1('0x23')]=function(_0x55efc1){var _0x5b2a7f=this;return new Promise(function(_0x13ec3a,_0x5c1319){return db['CmHopper'][_0xf9e1('0x24')](_0x55efc1['body'],{'raw':_0x55efc1[_0xf9e1('0x19')]?_0x55efc1[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![]})[_0xf9e1('0xa')](function(_0x178dcd){logger['info'](_0xf9e1('0x23'),_0x55efc1);logger[_0xf9e1('0xe')](_0xf9e1('0x23'),_0x55efc1,JSON['stringify'](_0x178dcd));_0x13ec3a(_0x178dcd);})[_0xf9e1('0x15')](function(_0x8224f2){logger[_0xf9e1('0x11')](_0xf9e1('0x23'),_0x8224f2['message'],_0x55efc1);_0x5c1319(_0x5b2a7f[_0xf9e1('0x11')](0x1f4,_0x8224f2[_0xf9e1('0x13')]));});});};exports['UpdateCmHopper']=function(_0x59c6c8){var _0x36c180=this;return new Promise(function(_0xf5717,_0x412d02){return db['CmHopper'][_0xf9e1('0x25')](_0x59c6c8['body'],{'raw':_0x59c6c8[_0xf9e1('0x19')]?_0x59c6c8[_0xf9e1('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c6c8[_0xf9e1('0x19')]?_0x59c6c8['options'][_0xf9e1('0x1b')]||null:null,'attributes':_0x59c6c8['options']?_0x59c6c8['options']['attributes']||null:null,'limit':_0x59c6c8[_0xf9e1('0x19')]?_0x59c6c8[_0xf9e1('0x19')]['limit']||null:null})[_0xf9e1('0xa')](function(_0x31cb09){logger['info'](_0xf9e1('0x26'),_0x59c6c8);logger['debug'](_0xf9e1('0x26'),_0x59c6c8,JSON[_0xf9e1('0x10')](_0x31cb09));_0xf5717(_0x31cb09);})['catch'](function(_0x6125a0){logger['error']('UpdateCmHopper',_0x6125a0['message'],_0x59c6c8);_0x412d02(_0x36c180[_0xf9e1('0x11')](0x1f4,_0x6125a0['message']));});});};exports[_0xf9e1('0x27')]=function(_0x3f0886){var _0x24bf2a=this;return new Promise(function(_0x31b5c1,_0xa44fbf){return db[_0xf9e1('0x17')]['destroy']({'where':_0x3f0886[_0xf9e1('0x19')]?_0x3f0886['options']['where']||null:null})[_0xf9e1('0xa')](function(_0x27b593){logger['info'](_0xf9e1('0x27'),_0x3f0886);logger[_0xf9e1('0xe')](_0xf9e1('0x27'),_0x3f0886,JSON[_0xf9e1('0x10')](_0x27b593));_0x31b5c1(_0x27b593);})[_0xf9e1('0x15')](function(_0x21025f){logger[_0xf9e1('0x11')]('DestroyCmHopper',_0x21025f[_0xf9e1('0x13')],_0x3f0886);_0xa44fbf(_0x24bf2a[_0xf9e1('0x11')](0x1f4,_0x21025f[_0xf9e1('0x13')]));});});};exports[_0xf9e1('0x28')]=function(_0x28265f){var _0x1f20cf=this;return new Promise(function(_0x5f27ca,_0x2b7657){return db[_0xf9e1('0x29')]['describe']()[_0xf9e1('0xa')](function(_0x24430e){return db[_0xf9e1('0x2a')][_0xf9e1('0x2b')](function(_0x3ede3c){return db[_0xf9e1('0x17')][_0xf9e1('0x18')]({'where':_0x28265f[_0xf9e1('0x19')]?_0x28265f['options']['where']||null:null,'attributes':_0x28265f['options']?_0x28265f[_0xf9e1('0x19')][_0xf9e1('0x1c')]||null:null,'limit':_0x28265f[_0xf9e1('0x19')]?_0x28265f['options'][_0xf9e1('0x1d')]||null:null,'order':_0x28265f[_0xf9e1('0x19')]?_0x28265f[_0xf9e1('0x19')][_0xf9e1('0x2c')]||null:null,'transaction':_0x3ede3c,'lock':_0x3ede3c[_0xf9e1('0x2d')][_0xf9e1('0x2e')],'include':[{'model':db[_0xf9e1('0x29')],'as':'Contact','attributes':_[_0xf9e1('0x2f')](_0x24430e)},{'model':db[_0xf9e1('0x30')],'as':_0xf9e1('0x31'),'attributes':['id','name','voicePause']}]})[_0xf9e1('0xa')](function(_0xf3f024){var _0x4c1271=[];var _0xdf40b8=[];for(var _0xcbe558=0x0;_0xcbe558<_0xf3f024['length'];_0xcbe558+=0x1){var _0xbadc5b=_0xf3f024[_0xcbe558][_0xf9e1('0x32')];if(_0xbadc5b===null){_0x4c1271[_0xf9e1('0x33')](_0xf3f024[_0xcbe558][_0xf9e1('0x25')](_0x28265f[_0xf9e1('0x34')],{'transaction':_0x3ede3c}));}else if(!_0xdf40b8[_0xf9e1('0x35')](_0xbadc5b)){_0xdf40b8[_0xf9e1('0x33')](_0xbadc5b);_0x4c1271[_0xf9e1('0x33')](_0xf3f024[_0xcbe558][_0xf9e1('0x25')](_0x28265f[_0xf9e1('0x34')],{'transaction':_0x3ede3c}));}}return BPromise['all'](_0x4c1271);});})[_0xf9e1('0xa')](function(_0x46e97e){logger[_0xf9e1('0xb')](_0xf9e1('0x28'),_0x28265f);logger[_0xf9e1('0xe')](_0xf9e1('0x28'),_0x28265f,JSON[_0xf9e1('0x10')](_0x46e97e));_0x5f27ca(_0x46e97e);})['catch'](function(_0x54300a){logger['error'](_0xf9e1('0x28'),_0x54300a[_0xf9e1('0x13')],_0x28265f);_0x2b7657(_0x1f20cf[_0xf9e1('0x11')](0x1f4,_0x54300a[_0xf9e1('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x9b2e68){var _0x86c938=this;return new Promise(function(_0x4a9c33,_0x1a9fee){return db[_0xf9e1('0x2a')][_0xf9e1('0x2b')](function(_0xfe81b7){return db['CmHopperFinal']['create'](_0x9b2e68[_0xf9e1('0x34')],{'raw':_0x9b2e68[_0xf9e1('0x19')]?_0x9b2e68[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'transaction':_0xfe81b7})['then'](function(){return db['CmHopper']['destroy']({'where':_0x9b2e68['options']?_0x9b2e68['options']['where']||null:null,'transaction':_0xfe81b7});});})[_0xf9e1('0xa')](function(_0x51ccb0){logger[_0xf9e1('0xb')](_0xf9e1('0x36'),_0x9b2e68);logger['debug']('MoveContactManagedDialer',_0x9b2e68,JSON[_0xf9e1('0x10')](_0x51ccb0));_0x4a9c33(_0x51ccb0);})['catch'](function(_0x2f52bd){logger[_0xf9e1('0x11')](_0xf9e1('0x36'),_0x2f52bd[_0xf9e1('0x13')],_0x9b2e68);_0x1a9fee(_0x86c938['error'](0x1f4,_0x2f52bd[_0xf9e1('0x13')]));});});};exports[_0xf9e1('0x37')]=function(_0x2470ea){var _0x5ea280=this;return new Promise(function(_0x507da4,_0x195df7){return db[_0xf9e1('0x17')][_0xf9e1('0x18')]({'raw':_0x2470ea['options']?_0x2470ea[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2470ea[_0xf9e1('0x19')]?_0x2470ea[_0xf9e1('0x19')][_0xf9e1('0x1b')]||null:null,'attributes':[[db[_0xf9e1('0x2a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf9e1('0x2a')][_0xf9e1('0x38')]('`scheduledat`\x20>=\x20'+util[_0xf9e1('0x39')]('\x22%s\x22',moment()[_0xf9e1('0x39')](_0xf9e1('0x3a')))+_0xf9e1('0x3b')))),_0xf9e1('0x3c')]]})[_0xf9e1('0xa')](function(_0x5912f4){logger[_0xf9e1('0xb')](_0xf9e1('0x37'),_0x2470ea);logger['debug'](_0xf9e1('0x37'),_0x2470ea,JSON[_0xf9e1('0x10')](_0x5912f4));_0x507da4(_0x5912f4);})[_0xf9e1('0x15')](function(_0x281655){logger[_0xf9e1('0x11')](_0xf9e1('0x37'),_0x281655['message'],_0x2470ea);_0x195df7(_0x5ea280[_0xf9e1('0x11')](0x1f4,_0x281655[_0xf9e1('0x13')]));});});};exports[_0xf9e1('0x3d')]=function(_0x5ab225){var _0x3dccda=this;return new Promise(function(_0x1871ff,_0x462606){return db[_0xf9e1('0x29')][_0xf9e1('0x3e')]()['then'](function(_0x39d54d){return db[_0xf9e1('0x2a')]['transaction'](function(_0x85b8ef){return db['CmHopper'][_0xf9e1('0x18')]({'where':_0x5ab225[_0xf9e1('0x19')]?_0x5ab225['options'][_0xf9e1('0x1b')]||null:null,'attributes':_0x5ab225['options']?_0x5ab225['options'][_0xf9e1('0x1c')]||null:null,'limit':0x1,'order':_0x5ab225[_0xf9e1('0x19')]?_0x5ab225['options'][_0xf9e1('0x2c')]||null:null,'group':db[_0xf9e1('0x17')][_0xf9e1('0x32')],'transaction':_0x85b8ef,'lock':_0x85b8ef[_0xf9e1('0x2d')][_0xf9e1('0x2e')],'include':_0x5ab225[_0xf9e1('0x19')]?_0x5ab225['options'][_0xf9e1('0x1e')]?_[_0xf9e1('0x1f')](_0x5ab225[_0xf9e1('0x19')][_0xf9e1('0x1e')],function(_0x5d0814){return{'model':db[_0x5d0814[_0xf9e1('0x20')]],'as':_0x5d0814['as'],'attributes':_0x5d0814[_0xf9e1('0x1c')],'include':_0x5d0814['include']?_['map'](_0x5d0814[_0xf9e1('0x1e')],function(_0x404b2c){return{'model':db[_0x404b2c[_0xf9e1('0x20')]],'as':_0x404b2c['as'],'attributes':_0x404b2c[_0xf9e1('0x1c')],'include':_0x404b2c[_0xf9e1('0x1e')]?_['map'](_0x404b2c[_0xf9e1('0x1e')],function(_0x2f5b8e){return{'model':db[_0x2f5b8e[_0xf9e1('0x20')]],'as':_0x2f5b8e['as'],'attributes':_0x2f5b8e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52c4ae){var _0x245387=[];for(var _0xe072a5=0x0;_0xe072a5<_0x52c4ae['length'];_0xe072a5+=0x1){_0x245387['push'](_0x52c4ae[_0xe072a5][_0xf9e1('0x25')](_0x5ab225['body'],{'transaction':_0x85b8ef}));}return BPromise[_0xf9e1('0x3f')](_0x245387);});})[_0xf9e1('0xa')](function(_0x5277a9){logger[_0xf9e1('0xb')](_0xf9e1('0x3d'),_0x5ab225);logger[_0xf9e1('0xe')](_0xf9e1('0x3d'),_0x5ab225,JSON[_0xf9e1('0x10')](_0x5277a9));_0x1871ff(_0x5277a9);})[_0xf9e1('0x15')](function(_0x229a06){logger[_0xf9e1('0x11')](_0xf9e1('0x3d'),_0x229a06[_0xf9e1('0x13')],_0x5ab225);_0x462606(_0x3dccda[_0xf9e1('0x11')](0x1f4,_0x229a06[_0xf9e1('0x13')]));});});});};exports[_0xf9e1('0x40')]=function(_0x336ba7){var _0x49c7d0=this;return new Promise(function(_0x3934ed,_0x2061ab){db['CmContact'][_0xf9e1('0x3e')]()['then'](function(_0x387b87){return db['CmHopper']['findAll']({'raw':_0x336ba7[_0xf9e1('0x19')]?_0x336ba7[_0xf9e1('0x19')][_0xf9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x336ba7['options']?_0x336ba7[_0xf9e1('0x19')][_0xf9e1('0x1b')]||null:null,'attributes':_0x336ba7['options']?_0x336ba7['options'][_0xf9e1('0x1c')]||null:null,'limit':_0x336ba7[_0xf9e1('0x19')]?_0x336ba7['options'][_0xf9e1('0x1d')]||null:null,'include':_0x336ba7[_0xf9e1('0x19')]?_0x336ba7['options'][_0xf9e1('0x1e')]?_['map'](_0x336ba7[_0xf9e1('0x19')]['include'],function(_0xc710c2){return{'model':db[_0xc710c2['model']],'as':_0xc710c2['as'],'attributes':_0xc710c2['as']==='Contact'?_[_0xf9e1('0x2f')](_0x387b87):_0xc710c2['attributes'],'include':_0xc710c2[_0xf9e1('0x1e')]?_[_0xf9e1('0x1f')](_0xc710c2[_0xf9e1('0x1e')],function(_0x36e81f){return{'model':db[_0x36e81f[_0xf9e1('0x20')]],'as':_0x36e81f['as'],'attributes':_0x36e81f[_0xf9e1('0x1c')],'include':_0x36e81f[_0xf9e1('0x1e')]?_['map'](_0x36e81f['include'],function(_0x5dc4ac){return{'model':db[_0x5dc4ac['model']],'as':_0x5dc4ac['as'],'attributes':_0x5dc4ac[_0xf9e1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b41c4){logger[_0xf9e1('0xb')](_0xf9e1('0x16'),_0x336ba7);logger[_0xf9e1('0xe')](_0xf9e1('0x16'),_0x336ba7,JSON[_0xf9e1('0x10')](_0x1b41c4));_0x3934ed(_0x1b41c4);})[_0xf9e1('0x15')](function(_0x5d1a68){logger[_0xf9e1('0x11')]('GetCmHopper',_0x5d1a68['message'],_0x336ba7);_0x2061ab(_0x49c7d0['error'](0x1f4,_0x5d1a68[_0xf9e1('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3633444..6e051b1 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 _0xead5=['index','/describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xead5,0x1ed));var _0x5ead=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xead5[_0x81f000];return _0x337aa2;};'use strict';var multer=require(_0x5ead('0x0'));var util=require(_0x5ead('0x1'));var path=require(_0x5ead('0x2'));var timeout=require(_0x5ead('0x3'));var express=require(_0x5ead('0x4'));var router=express[_0x5ead('0x5')]();var fs_extra=require(_0x5ead('0x6'));var auth=require(_0x5ead('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5ead('0x8'));var controller=require('./cmHopper.controller');router[_0x5ead('0x9')]('/',auth[_0x5ead('0xa')](),controller[_0x5ead('0xb')]);router[_0x5ead('0x9')](_0x5ead('0xc'),auth[_0x5ead('0xa')](),controller['describe']);router[_0x5ead('0x9')](_0x5ead('0xd'),auth['isAuthenticated'](),controller[_0x5ead('0xe')]);router[_0x5ead('0x9')](_0x5ead('0xf'),auth['isAuthenticated'](),controller[_0x5ead('0x10')]);router[_0x5ead('0x11')]('/',auth[_0x5ead('0xa')](),controller['create']);router[_0x5ead('0x11')](_0x5ead('0x12'),auth[_0x5ead('0xa')](),controller[_0x5ead('0x13')]);router[_0x5ead('0x14')](_0x5ead('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x5ead('0x15')](_0x5ead('0xf'),auth[_0x5ead('0xa')](),controller[_0x5ead('0x16')]);module[_0x5ead('0x17')]=router; \ No newline at end of file +var _0x945c=['create','/preview','getPreview','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x945c,0x165));var _0xc945=function(_0x2bb787,_0x41bf02){_0x2bb787=_0x2bb787-0x0;var _0x425b33=_0x945c[_0x2bb787];return _0x425b33;};'use strict';var multer=require(_0xc945('0x0'));var util=require(_0xc945('0x1'));var path=require(_0xc945('0x2'));var timeout=require('connect-timeout');var express=require(_0xc945('0x3'));var router=express['Router']();var fs_extra=require(_0xc945('0x4'));var auth=require(_0xc945('0x5'));var interaction=require(_0xc945('0x6'));var config=require('../../config/environment');var controller=require(_0xc945('0x7'));router[_0xc945('0x8')]('/',auth[_0xc945('0x9')](),controller[_0xc945('0xa')]);router[_0xc945('0x8')](_0xc945('0xb'),auth['isAuthenticated'](),controller[_0xc945('0xc')]);router[_0xc945('0x8')](_0xc945('0xd'),auth['isAuthenticated'](),controller[_0xc945('0xe')]);router['get'](_0xc945('0xf'),auth[_0xc945('0x9')](),controller[_0xc945('0x10')]);router[_0xc945('0x11')]('/',auth['isAuthenticated'](),controller[_0xc945('0x12')]);router[_0xc945('0x11')](_0xc945('0x13'),auth[_0xc945('0x9')](),controller[_0xc945('0x14')]);router[_0xc945('0x15')](_0xc945('0xf'),auth['isAuthenticated'](),controller[_0xc945('0x16')]);router[_0xc945('0x17')]('/:id',auth[_0xc945('0x9')](),controller['destroy']);module[_0xc945('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 787b99b..b70976c 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 _0x6ec2=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x1e2768,_0x502a8f){var _0xb73fde=function(_0x296f62){while(--_0x296f62){_0x1e2768['push'](_0x1e2768['shift']());}};_0xb73fde(++_0x502a8f);}(_0x6ec2,0x78));var _0x26ec=function(_0x44b353,_0x27a8be){_0x44b353=_0x44b353-0x0;var _0x2b1b76=_0x6ec2[_0x44b353];return _0x2b1b76;};'use strict';var moment=require(_0x26ec('0x0'));var Sequelize=require(_0x26ec('0x1'));module[_0x26ec('0x2')]={'phone':{'type':Sequelize[_0x26ec('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x26ec('0x4')],'unique':_0x26ec('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x26ec('0x5')},'VoiceQueueId':{'type':Sequelize[_0x26ec('0x4')],'unique':_0x26ec('0x5')}}; \ No newline at end of file +var _0x8bea=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x153cb0,_0x3fd51d){var _0x23eec9=function(_0x103431){while(--_0x103431){_0x153cb0['push'](_0x153cb0['shift']());}};_0x23eec9(++_0x3fd51d);}(_0x8bea,0xfc));var _0xa8be=function(_0x32c79f,_0x1f8cef){_0x32c79f=_0x32c79f-0x0;var _0x27ae75=_0x8bea[_0x32c79f];return _0x27ae75;};'use strict';var moment=require(_0xa8be('0x0'));var Sequelize=require(_0xa8be('0x1'));module[_0xa8be('0x2')]={'phone':{'type':Sequelize[_0xa8be('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa8be('0x4')],'unique':_0xa8be('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa8be('0x5')},'VoiceQueueId':{'type':Sequelize[_0xa8be('0x4')],'unique':_0xa8be('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2f67cc1..56265ce 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 _0xcde7=['find','catch','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','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','count','limit','set','reject','save','then','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','length'];(function(_0x5c5cfb,_0x856fe6){var _0xb89878=function(_0x32e5d4){while(--_0x32e5d4){_0x5c5cfb['push'](_0x5c5cfb['shift']());}};_0xb89878(++_0x856fe6);}(_0xcde7,0x129));var _0x7cde=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcde7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7cde('0x0'));var rimraf=require(_0x7cde('0x1'));var zipdir=require(_0x7cde('0x2'));var jsonpatch=require(_0x7cde('0x3'));var rp=require(_0x7cde('0x4'));var moment=require(_0x7cde('0x5'));var BPromise=require(_0x7cde('0x6'));var Mustache=require(_0x7cde('0x7'));var util=require(_0x7cde('0x8'));var path=require(_0x7cde('0x9'));var sox=require('sox');var csv=require(_0x7cde('0xa'));var ejs=require(_0x7cde('0xb'));var fs=require('fs');var fs_extra=require(_0x7cde('0xc'));var _=require('lodash');var squel=require(_0x7cde('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7cde('0xe'));var toCsv=require(_0x7cde('0xa'));var querystring=require(_0x7cde('0xf'));var Papa=require('papaparse');var Redis=require(_0x7cde('0x10'));var authService=require(_0x7cde('0x11'));var qs=require(_0x7cde('0x12'));var as=require(_0x7cde('0x13'));var hardwareService=require(_0x7cde('0x14'));var logger=require(_0x7cde('0x15'))(_0x7cde('0x16'));var utils=require('../../config/utils');var config=require(_0x7cde('0x17'));var licenseUtil=require(_0x7cde('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57765c,_0x45e2b9){_0x45e2b9=_0x45e2b9||0xcc;return function(_0x5c46a2){if(_0x5c46a2){return _0x57765c[_0x7cde('0x19')](_0x45e2b9);}return _0x57765c[_0x7cde('0x1a')](_0x45e2b9)[_0x7cde('0x1b')]();};}function respondWithResult(_0x5424a1,_0x447fc9){_0x447fc9=_0x447fc9||0xc8;return function(_0x504381){if(_0x504381){return _0x5424a1[_0x7cde('0x1a')](_0x447fc9)[_0x7cde('0x1c')](_0x504381);}};}function respondWithFilteredResult(_0x2fccf9,_0x5461aa){return function(_0x54313c){if(_0x54313c){var _0xb059ea=typeof _0x5461aa[_0x7cde('0x1d')]===_0x7cde('0x1e')&&typeof _0x5461aa['limit']===_0x7cde('0x1e');var _0x5af2e7=_0x54313c['count'];var _0x3081b3=_0xb059ea?0x0:_0x5461aa[_0x7cde('0x1d')];var _0x56f3a3=_0xb059ea?_0x54313c[_0x7cde('0x1f')]:_0x5461aa[_0x7cde('0x1d')]+_0x5461aa[_0x7cde('0x20')];var _0x584edc;if(_0x56f3a3>=_0x5af2e7){_0x56f3a3=_0x5af2e7;_0x584edc=0xc8;}else{_0x584edc=0xce;}_0x2fccf9[_0x7cde('0x1a')](_0x584edc);return _0x2fccf9[_0x7cde('0x21')]('Content-Range',_0x3081b3+'-'+_0x56f3a3+'/'+_0x5af2e7)[_0x7cde('0x1c')](_0x54313c);}return null;};}function patchUpdates(_0x57f3e0){return function(_0x187973){try{jsonpatch['apply'](_0x187973,_0x57f3e0,!![]);}catch(_0x2a1d89){return BPromise[_0x7cde('0x22')](_0x2a1d89);}return _0x187973[_0x7cde('0x23')]();};}function saveUpdates(_0x21e2d9,_0x1e2095){return function(_0x16df27){if(_0x16df27){return _0x16df27['update'](_0x21e2d9)[_0x7cde('0x24')](function(_0x1b4d02){return _0x1b4d02;});}return null;};}function removeEntity(_0x38f8c8,_0x5707ed){return function(_0x40b8cb){if(_0x40b8cb){return _0x40b8cb[_0x7cde('0x25')]()[_0x7cde('0x24')](function(){_0x38f8c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab22c,_0x31c622){return function(_0x5bfb51){if(!_0x5bfb51){_0x3ab22c[_0x7cde('0x19')](0x194);}return _0x5bfb51;};}function handleError(_0x438070,_0x50e13b){_0x50e13b=_0x50e13b||0x1f4;return function(_0x3d2b5b){logger[_0x7cde('0x26')](_0x3d2b5b['stack']);if(_0x3d2b5b[_0x7cde('0x27')]){delete _0x3d2b5b[_0x7cde('0x27')];}_0x438070[_0x7cde('0x1a')](_0x50e13b)[_0x7cde('0x28')](_0x3d2b5b);};}exports[_0x7cde('0x29')]=function(_0xef9c97,_0x5c5537){var _0x303d69={},_0x2052d9={},_0x55e5f0={'count':0x0,'rows':[]};var _0x511cf7=_[_0x7cde('0x2a')](db[_0x7cde('0x2b')][_0x7cde('0x2c')],function(_0x754945){return{'name':_0x754945[_0x7cde('0x2d')],'type':_0x754945[_0x7cde('0x2e')]['key']};});_0x2052d9['model']=_['map'](_0x511cf7,_0x7cde('0x27'));_0x2052d9['query']=_[_0x7cde('0x2f')](_0xef9c97[_0x7cde('0x30')]);_0x2052d9[_0x7cde('0x31')]=_[_0x7cde('0x32')](_0x2052d9[_0x7cde('0x33')],_0x2052d9[_0x7cde('0x30')]);_0x303d69[_0x7cde('0x34')]=_[_0x7cde('0x32')](_0x2052d9['model'],qs[_0x7cde('0x35')](_0xef9c97[_0x7cde('0x30')][_0x7cde('0x35')]));_0x303d69[_0x7cde('0x34')]=_0x303d69[_0x7cde('0x34')]['length']?_0x303d69[_0x7cde('0x34')]:_0x2052d9[_0x7cde('0x33')];if(!_0xef9c97[_0x7cde('0x30')][_0x7cde('0x36')](_0x7cde('0x37'))){_0x303d69['limit']=qs[_0x7cde('0x20')](_0xef9c97['query']['limit']);_0x303d69['offset']=qs[_0x7cde('0x1d')](_0xef9c97[_0x7cde('0x30')]['offset']);}_0x303d69[_0x7cde('0x38')]=qs[_0x7cde('0x39')](_0xef9c97[_0x7cde('0x30')]['sort']);_0x303d69['where']=qs['filters'](_[_0x7cde('0x3a')](_0xef9c97['query'],_0x2052d9[_0x7cde('0x31')]),_0x511cf7);if(_0xef9c97[_0x7cde('0x30')]['filter']){_0x303d69['where']=_[_0x7cde('0x3b')](_0x303d69['where'],{'$or':_[_0x7cde('0x2a')](_0x511cf7,function(_0x49fa7b){if(_0x49fa7b[_0x7cde('0x2e')]!==_0x7cde('0x3c')){var _0x180536={};_0x180536[_0x49fa7b[_0x7cde('0x27')]]={'$like':'%'+_0xef9c97['query'][_0x7cde('0x3d')]+'%'};return _0x180536;}})});}_0x303d69=_['merge']({},_0x303d69,_0xef9c97[_0x7cde('0x3e')]);var _0x16da5f={'where':_0x303d69['where']};return db[_0x7cde('0x2b')][_0x7cde('0x1f')](_0x16da5f)['then'](function(_0x1407d1){_0x55e5f0[_0x7cde('0x1f')]=_0x1407d1;if(_0xef9c97[_0x7cde('0x30')][_0x7cde('0x3f')]){_0x303d69[_0x7cde('0x40')]=[{'all':!![]}];}return db[_0x7cde('0x2b')][_0x7cde('0x41')](_0x303d69);})['then'](function(_0x34fadb){_0x55e5f0['rows']=_0x34fadb;return _0x55e5f0;})[_0x7cde('0x24')](respondWithFilteredResult(_0x5c5537,_0x303d69))['catch'](handleError(_0x5c5537,null));};exports['show']=function(_0x7ead52,_0x2ffc47){var _0x264ca4={'raw':!![],'where':{'id':_0x7ead52[_0x7cde('0x42')]['id']}},_0x34255a={};_0x34255a[_0x7cde('0x33')]=_[_0x7cde('0x2f')](db[_0x7cde('0x2b')][_0x7cde('0x2c')]);_0x34255a[_0x7cde('0x30')]=_[_0x7cde('0x2f')](_0x7ead52[_0x7cde('0x30')]);_0x34255a[_0x7cde('0x31')]=_['intersection'](_0x34255a['model'],_0x34255a[_0x7cde('0x30')]);_0x264ca4[_0x7cde('0x34')]=_[_0x7cde('0x32')](_0x34255a[_0x7cde('0x33')],qs[_0x7cde('0x35')](_0x7ead52[_0x7cde('0x30')][_0x7cde('0x35')]));_0x264ca4[_0x7cde('0x34')]=_0x264ca4[_0x7cde('0x34')][_0x7cde('0x43')]?_0x264ca4[_0x7cde('0x34')]:_0x34255a[_0x7cde('0x33')];if(_0x7ead52[_0x7cde('0x30')]['includeAll']){_0x264ca4['include']=[{'all':!![]}];}_0x264ca4=_[_0x7cde('0x3b')]({},_0x264ca4,_0x7ead52[_0x7cde('0x3e')]);return db[_0x7cde('0x2b')][_0x7cde('0x44')](_0x264ca4)[_0x7cde('0x24')](handleEntityNotFound(_0x2ffc47,null))[_0x7cde('0x24')](respondWithResult(_0x2ffc47,null))[_0x7cde('0x45')](handleError(_0x2ffc47,null));};exports[_0x7cde('0x46')]=function(_0x2f3168,_0x1548bd){if(_0x2f3168[_0x7cde('0x47')]['id']){delete _0x2f3168[_0x7cde('0x47')]['id'];}return db[_0x7cde('0x2b')][_0x7cde('0x44')]({'where':{'id':_0x2f3168[_0x7cde('0x42')]['id']}})[_0x7cde('0x24')](handleEntityNotFound(_0x1548bd,null))[_0x7cde('0x24')](saveUpdates(_0x2f3168[_0x7cde('0x47')],null))[_0x7cde('0x24')](respondWithResult(_0x1548bd,null))[_0x7cde('0x45')](handleError(_0x1548bd,null));};exports['destroy']=function(_0x570420,_0x3332f7){return db['CmHopperBlack']['find']({'where':{'id':_0x570420['params']['id']}})['then'](handleEntityNotFound(_0x3332f7,null))[_0x7cde('0x24')](removeEntity(_0x3332f7,null))['catch'](handleError(_0x3332f7,null));};exports[_0x7cde('0x48')]=function(_0x50d2d6,_0x5e4a46){return db[_0x7cde('0x2b')][_0x7cde('0x48')]()['then'](respondWithResult(_0x5e4a46,null))[_0x7cde('0x45')](handleError(_0x5e4a46,null));}; \ No newline at end of file +var _0xb944=['util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','VIRTUAL','filter','options','CmHopperBlack','includeAll','include','findAll','rows','show','params','find','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xb944,0xcc));var _0x4b94=function(_0x5f5b7a,_0x563e61){_0x5f5b7a=_0x5f5b7a-0x0;var _0x7d276d=_0xb944[_0x5f5b7a];return _0x7d276d;};'use strict';var emlformat=require(_0x4b94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b94('0x1'));var jsonpatch=require(_0x4b94('0x2'));var rp=require(_0x4b94('0x3'));var moment=require('moment');var BPromise=require(_0x4b94('0x4'));var Mustache=require(_0x4b94('0x5'));var util=require(_0x4b94('0x6'));var path=require('path');var sox=require(_0x4b94('0x7'));var csv=require(_0x4b94('0x8'));var ejs=require(_0x4b94('0x9'));var fs=require('fs');var fs_extra=require(_0x4b94('0xa'));var _=require('lodash');var squel=require(_0x4b94('0xb'));var crypto=require(_0x4b94('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b94('0x8'));var querystring=require(_0x4b94('0xd'));var Papa=require(_0x4b94('0xe'));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(_0x4b94('0xf'));var logger=require(_0x4b94('0x10'))(_0x4b94('0x11'));var utils=require(_0x4b94('0x12'));var config=require(_0x4b94('0x13'));var licenseUtil=require(_0x4b94('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cf57f,_0x3dcebc){_0x3dcebc=_0x3dcebc||0xcc;return function(_0x5b54df){if(_0x5b54df){return _0x4cf57f[_0x4b94('0x15')](_0x3dcebc);}return _0x4cf57f[_0x4b94('0x16')](_0x3dcebc)['end']();};}function respondWithResult(_0x4919ee,_0x3a86b1){_0x3a86b1=_0x3a86b1||0xc8;return function(_0x33f3ed){if(_0x33f3ed){return _0x4919ee[_0x4b94('0x16')](_0x3a86b1)[_0x4b94('0x17')](_0x33f3ed);}};}function respondWithFilteredResult(_0x4b55a9,_0x1c2849){return function(_0x27b628){if(_0x27b628){var _0x38658a=typeof _0x1c2849[_0x4b94('0x18')]===_0x4b94('0x19')&&typeof _0x1c2849[_0x4b94('0x1a')]===_0x4b94('0x19');var _0x1306a2=_0x27b628[_0x4b94('0x1b')];var _0x437aba=_0x38658a?0x0:_0x1c2849[_0x4b94('0x18')];var _0x23e87d=_0x38658a?_0x27b628[_0x4b94('0x1b')]:_0x1c2849[_0x4b94('0x18')]+_0x1c2849['limit'];var _0x1f9bb1;if(_0x23e87d>=_0x1306a2){_0x23e87d=_0x1306a2;_0x1f9bb1=0xc8;}else{_0x1f9bb1=0xce;}_0x4b55a9['status'](_0x1f9bb1);return _0x4b55a9[_0x4b94('0x1c')](_0x4b94('0x1d'),_0x437aba+'-'+_0x23e87d+'/'+_0x1306a2)[_0x4b94('0x17')](_0x27b628);}return null;};}function patchUpdates(_0x56893d){return function(_0x599c5b){try{jsonpatch[_0x4b94('0x1e')](_0x599c5b,_0x56893d,!![]);}catch(_0x7459e2){return BPromise[_0x4b94('0x1f')](_0x7459e2);}return _0x599c5b['save']();};}function saveUpdates(_0x3295d0,_0x1eb6a0){return function(_0x3e1f21){if(_0x3e1f21){return _0x3e1f21[_0x4b94('0x20')](_0x3295d0)['then'](function(_0x406640){return _0x406640;});}return null;};}function removeEntity(_0x28dff2,_0x296e50){return function(_0x1dc871){if(_0x1dc871){return _0x1dc871[_0x4b94('0x21')]()[_0x4b94('0x22')](function(){_0x28dff2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7b84,_0x572fea){return function(_0x1b7a28){if(!_0x1b7a28){_0x1c7b84[_0x4b94('0x15')](0x194);}return _0x1b7a28;};}function handleError(_0x480361,_0x10b1b0){_0x10b1b0=_0x10b1b0||0x1f4;return function(_0x5ab91e){logger['error'](_0x5ab91e[_0x4b94('0x23')]);if(_0x5ab91e[_0x4b94('0x24')]){delete _0x5ab91e['name'];}_0x480361[_0x4b94('0x16')](_0x10b1b0)[_0x4b94('0x25')](_0x5ab91e);};}exports['index']=function(_0x2f693a,_0x443a55){var _0x254a78={},_0x1c992c={},_0x2b4357={'count':0x0,'rows':[]};var _0x30dbeb=_[_0x4b94('0x26')](db['CmHopperBlack'][_0x4b94('0x27')],function(_0x4b6d57){return{'name':_0x4b6d57[_0x4b94('0x28')],'type':_0x4b6d57[_0x4b94('0x29')][_0x4b94('0x2a')]};});_0x1c992c[_0x4b94('0x2b')]=_[_0x4b94('0x26')](_0x30dbeb,_0x4b94('0x24'));_0x1c992c['query']=_[_0x4b94('0x2c')](_0x2f693a['query']);_0x1c992c['filters']=_['intersection'](_0x1c992c[_0x4b94('0x2b')],_0x1c992c[_0x4b94('0x2d')]);_0x254a78[_0x4b94('0x2e')]=_[_0x4b94('0x2f')](_0x1c992c['model'],qs[_0x4b94('0x30')](_0x2f693a['query'][_0x4b94('0x30')]));_0x254a78[_0x4b94('0x2e')]=_0x254a78['attributes'][_0x4b94('0x31')]?_0x254a78[_0x4b94('0x2e')]:_0x1c992c[_0x4b94('0x2b')];if(!_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x32')](_0x4b94('0x33'))){_0x254a78[_0x4b94('0x1a')]=qs[_0x4b94('0x1a')](_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x1a')]);_0x254a78['offset']=qs[_0x4b94('0x18')](_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x18')]);}_0x254a78['order']=qs[_0x4b94('0x34')](_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x34')]);_0x254a78['where']=qs[_0x4b94('0x35')](_[_0x4b94('0x36')](_0x2f693a[_0x4b94('0x2d')],_0x1c992c[_0x4b94('0x35')]),_0x30dbeb);if(_0x2f693a[_0x4b94('0x2d')]['filter']){_0x254a78['where']=_[_0x4b94('0x37')](_0x254a78[_0x4b94('0x38')],{'$or':_['map'](_0x30dbeb,function(_0x3756ca){if(_0x3756ca[_0x4b94('0x29')]!==_0x4b94('0x39')){var _0x52c647={};_0x52c647[_0x3756ca[_0x4b94('0x24')]]={'$like':'%'+_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x3a')]+'%'};return _0x52c647;}})});}_0x254a78=_[_0x4b94('0x37')]({},_0x254a78,_0x2f693a[_0x4b94('0x3b')]);var _0x60c2e9={'where':_0x254a78[_0x4b94('0x38')]};return db[_0x4b94('0x3c')][_0x4b94('0x1b')](_0x60c2e9)[_0x4b94('0x22')](function(_0x4c3b05){_0x2b4357['count']=_0x4c3b05;if(_0x2f693a[_0x4b94('0x2d')][_0x4b94('0x3d')]){_0x254a78[_0x4b94('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4b94('0x3f')](_0x254a78);})[_0x4b94('0x22')](function(_0x513dd3){_0x2b4357[_0x4b94('0x40')]=_0x513dd3;return _0x2b4357;})[_0x4b94('0x22')](respondWithFilteredResult(_0x443a55,_0x254a78))['catch'](handleError(_0x443a55,null));};exports[_0x4b94('0x41')]=function(_0x1e7854,_0x49fd27){var _0x46af55={'raw':!![],'where':{'id':_0x1e7854[_0x4b94('0x42')]['id']}},_0x3918ae={};_0x3918ae['model']=_['keys'](db[_0x4b94('0x3c')]['rawAttributes']);_0x3918ae[_0x4b94('0x2d')]=_['keys'](_0x1e7854[_0x4b94('0x2d')]);_0x3918ae['filters']=_['intersection'](_0x3918ae['model'],_0x3918ae[_0x4b94('0x2d')]);_0x46af55[_0x4b94('0x2e')]=_[_0x4b94('0x2f')](_0x3918ae[_0x4b94('0x2b')],qs['fields'](_0x1e7854[_0x4b94('0x2d')]['fields']));_0x46af55['attributes']=_0x46af55[_0x4b94('0x2e')][_0x4b94('0x31')]?_0x46af55['attributes']:_0x3918ae[_0x4b94('0x2b')];if(_0x1e7854[_0x4b94('0x2d')]['includeAll']){_0x46af55[_0x4b94('0x3e')]=[{'all':!![]}];}_0x46af55=_[_0x4b94('0x37')]({},_0x46af55,_0x1e7854[_0x4b94('0x3b')]);return db['CmHopperBlack'][_0x4b94('0x43')](_0x46af55)['then'](handleEntityNotFound(_0x49fd27,null))['then'](respondWithResult(_0x49fd27,null))[_0x4b94('0x44')](handleError(_0x49fd27,null));};exports['update']=function(_0xe90ea0,_0x58f874){if(_0xe90ea0['body']['id']){delete _0xe90ea0['body']['id'];}return db[_0x4b94('0x3c')][_0x4b94('0x43')]({'where':{'id':_0xe90ea0[_0x4b94('0x42')]['id']}})[_0x4b94('0x22')](handleEntityNotFound(_0x58f874,null))[_0x4b94('0x22')](saveUpdates(_0xe90ea0['body'],null))[_0x4b94('0x22')](respondWithResult(_0x58f874,null))[_0x4b94('0x44')](handleError(_0x58f874,null));};exports['destroy']=function(_0x21acce,_0x5ed664){return db['CmHopperBlack'][_0x4b94('0x43')]({'where':{'id':_0x21acce[_0x4b94('0x42')]['id']}})[_0x4b94('0x22')](handleEntityNotFound(_0x5ed664,null))[_0x4b94('0x22')](removeEntity(_0x5ed664,null))[_0x4b94('0x44')](handleError(_0x5ed664,null));};exports[_0x4b94('0x45')]=function(_0x3b95a5,_0x4d41b2){return db[_0x4b94('0x3c')][_0x4b94('0x45')]()[_0x4b94('0x22')](respondWithResult(_0x4d41b2,null))[_0x4b94('0x44')](handleError(_0x4d41b2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 92711df..5ea003e 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 _0x028e=['util','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x028e,0x6d));var _0xe028=function(_0x1d6d74,_0x1ee985){_0x1d6d74=_0x1d6d74-0x0;var _0x5e2af6=_0x028e[_0x1d6d74];return _0x5e2af6;};'use strict';var _=require(_0xe028('0x0'));var util=require(_0xe028('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe028('0x2'));var BPromise=require(_0xe028('0x3'));var rp=require(_0xe028('0x4'));var fs=require('fs');var path=require(_0xe028('0x5'));var rimraf=require('rimraf');var config=require(_0xe028('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0xe028('0x7')]=function(_0x3d6c9a,_0xfefacb){return _0x3d6c9a[_0xe028('0x8')](_0xe028('0x9'),attributes,{'tableName':_0xe028('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde55=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4254a6,_0x9b90f9){var _0x48631a=function(_0x25d38b){while(--_0x25d38b){_0x4254a6['push'](_0x4254a6['shift']());}};_0x48631a(++_0x9b90f9);}(_0xde55,0x137));var _0x5de5=function(_0xa25446,_0x57411){_0xa25446=_0xa25446-0x0;var _0x1cf357=_0xde55[_0xa25446];return _0x1cf357;};'use strict';var _=require(_0x5de5('0x0'));var util=require(_0x5de5('0x1'));var logger=require(_0x5de5('0x2'))(_0x5de5('0x3'));var moment=require(_0x5de5('0x4'));var BPromise=require(_0x5de5('0x5'));var rp=require(_0x5de5('0x6'));var fs=require('fs');var path=require(_0x5de5('0x7'));var rimraf=require(_0x5de5('0x8'));var config=require(_0x5de5('0x9'));var attributes=require('./cmHopperBlack.attributes');module[_0x5de5('0xa')]=function(_0x35d91a,_0x16902c){return _0x35d91a[_0x5de5('0xb')](_0x5de5('0xc'),attributes,{'tableName':_0x5de5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 134a47d..1160624 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 _0x9eb9=['GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x436641,_0x4afca2){var _0x29e38f=function(_0x352f84){while(--_0x352f84){_0x436641['push'](_0x436641['shift']());}};_0x29e38f(++_0x4afca2);}(_0x9eb9,0x1bf));var _0x99eb=function(_0x2c13dc,_0x5f900e){_0x2c13dc=_0x2c13dc-0x0;var _0x4e15e6=_0x9eb9[_0x2c13dc];return _0x4e15e6;};'use strict';var _=require(_0x99eb('0x0'));var util=require(_0x99eb('0x1'));var moment=require(_0x99eb('0x2'));var BPromise=require(_0x99eb('0x3'));var rs=require(_0x99eb('0x4'));var fs=require('fs');var Redis=require(_0x99eb('0x5'));var db=require(_0x99eb('0x6'))['db'];var utils=require(_0x99eb('0x7'));var logger=require(_0x99eb('0x8'))('rpc');var config=require(_0x99eb('0x9'));var jayson=require(_0x99eb('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8c3a,_0x1e2a46,_0x5931dc){return new BPromise(function(_0x5ee5e7,_0x5e87bb){return client[_0x99eb('0xb')](_0x3c8c3a,_0x5931dc)['then'](function(_0x924cb8){logger['info'](_0x99eb('0xc'),_0x1e2a46,_0x99eb('0xd'));logger[_0x99eb('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1e2a46,_0x99eb('0xd'),JSON[_0x99eb('0xf')](_0x924cb8));if(_0x924cb8[_0x99eb('0x10')]){if(_0x924cb8[_0x99eb('0x10')]['code']===0x1f4){logger[_0x99eb('0x10')](_0x99eb('0xc'),_0x1e2a46,_0x924cb8[_0x99eb('0x10')][_0x99eb('0x11')]);return _0x5e87bb(_0x924cb8[_0x99eb('0x10')][_0x99eb('0x11')]);}logger[_0x99eb('0x10')](_0x99eb('0xc'),_0x1e2a46,_0x924cb8[_0x99eb('0x10')][_0x99eb('0x11')]);return _0x5ee5e7(_0x924cb8[_0x99eb('0x10')]['message']);}else{logger[_0x99eb('0x12')](_0x99eb('0xc'),_0x1e2a46,'request\x20sent');_0x5ee5e7(_0x924cb8[_0x99eb('0x13')]['message']);}})[_0x99eb('0x14')](function(_0x1fc0be){logger[_0x99eb('0x10')](_0x99eb('0xc'),_0x1e2a46,_0x1fc0be);_0x5e87bb(_0x1fc0be);});});}exports[_0x99eb('0x15')]=function(_0x488d58){var _0x4be413=this;return new Promise(function(_0x3884c7,_0x8a137){return db[_0x99eb('0x16')][_0x99eb('0x17')]({'raw':_0x488d58[_0x99eb('0x18')]?_0x488d58[_0x99eb('0x18')][_0x99eb('0x19')]===undefined?!![]:![]:!![],'where':_0x488d58[_0x99eb('0x18')]?_0x488d58[_0x99eb('0x18')][_0x99eb('0x1a')]||null:null,'attributes':_0x488d58[_0x99eb('0x18')]?_0x488d58[_0x99eb('0x18')][_0x99eb('0x1b')]||null:null,'limit':_0x488d58[_0x99eb('0x18')]?_0x488d58[_0x99eb('0x18')]['limit']||null:null,'include':_0x488d58[_0x99eb('0x18')]?_0x488d58[_0x99eb('0x18')][_0x99eb('0x1c')]?_[_0x99eb('0x1d')](_0x488d58[_0x99eb('0x18')][_0x99eb('0x1c')],function(_0x1250a8){return{'model':db[_0x1250a8[_0x99eb('0x1e')]],'as':_0x1250a8['as'],'attributes':_0x1250a8[_0x99eb('0x1b')],'include':_0x1250a8[_0x99eb('0x1c')]?_['map'](_0x1250a8[_0x99eb('0x1c')],function(_0x56f072){return{'model':db[_0x56f072[_0x99eb('0x1e')]],'as':_0x56f072['as'],'attributes':_0x56f072[_0x99eb('0x1b')],'include':_0x56f072[_0x99eb('0x1c')]?_[_0x99eb('0x1d')](_0x56f072[_0x99eb('0x1c')],function(_0x8bbb52){return{'model':db[_0x8bbb52[_0x99eb('0x1e')]],'as':_0x8bbb52['as'],'attributes':_0x8bbb52[_0x99eb('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x224e38){logger[_0x99eb('0x12')]('GetCmHopperBlack',_0x488d58);logger['debug'](_0x99eb('0x15'),_0x488d58,JSON[_0x99eb('0xf')](_0x224e38));_0x3884c7(_0x224e38);})[_0x99eb('0x14')](function(_0x3b4281){logger[_0x99eb('0x10')]('GetCmHopperBlack',_0x3b4281['message'],_0x488d58);_0x8a137(_0x4be413[_0x99eb('0x10')](0x1f4,_0x3b4281[_0x99eb('0x11')]));});});};exports[_0x99eb('0x1f')]=function(_0x5eae69){var _0x55d376=this;return new Promise(function(_0x1a25df,_0x546368){return db['CmHopperBlack'][_0x99eb('0x20')](_0x5eae69['body'],{'raw':_0x5eae69['options']?_0x5eae69[_0x99eb('0x18')][_0x99eb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eae69[_0x99eb('0x18')]?_0x5eae69[_0x99eb('0x18')][_0x99eb('0x1a')]||null:null,'attributes':_0x5eae69[_0x99eb('0x18')]?_0x5eae69[_0x99eb('0x18')]['attributes']||null:null,'limit':_0x5eae69[_0x99eb('0x18')]?_0x5eae69['options']['limit']||null:null})['then'](function(_0xbd7589){logger['info'](_0x99eb('0x1f'),_0x5eae69);logger[_0x99eb('0xe')](_0x99eb('0x1f'),_0x5eae69,JSON[_0x99eb('0xf')](_0xbd7589));_0x1a25df(_0xbd7589);})[_0x99eb('0x14')](function(_0x3f1d1a){logger['error']('UpdateCmHopperBlack',_0x3f1d1a['message'],_0x5eae69);_0x546368(_0x55d376[_0x99eb('0x10')](0x1f4,_0x3f1d1a[_0x99eb('0x11')]));});});};exports[_0x99eb('0x21')]=function(_0xf4b7f2){var _0x4ef131=this;return new Promise(function(_0x5a1863,_0x263cb1){return db[_0x99eb('0x16')][_0x99eb('0x22')]({'where':_0xf4b7f2[_0x99eb('0x18')]?_0xf4b7f2['options'][_0x99eb('0x1a')]||null:null})[_0x99eb('0x23')](function(_0x4308ef){logger[_0x99eb('0x12')](_0x99eb('0x21'),_0xf4b7f2);logger['debug'](_0x99eb('0x21'),_0xf4b7f2,JSON[_0x99eb('0xf')](_0x4308ef));_0x5a1863(_0x4308ef);})[_0x99eb('0x14')](function(_0x4ab173){logger['error']('DestroyCmHopperBlack',_0x4ab173[_0x99eb('0x11')],_0xf4b7f2);_0x263cb1(_0x4ef131[_0x99eb('0x10')](0x1f4,_0x4ab173[_0x99eb('0x11')]));});});}; \ No newline at end of file +var _0x2a13=['CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','update','debug','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetCmHopperBlack'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x2a13,0x113));var _0x32a1=function(_0x110a3f,_0x36d320){_0x110a3f=_0x110a3f-0x0;var _0x1302c0=_0x2a13[_0x110a3f];return _0x1302c0;};'use strict';var _=require(_0x32a1('0x0'));var util=require('util');var moment=require(_0x32a1('0x1'));var BPromise=require(_0x32a1('0x2'));var rs=require(_0x32a1('0x3'));var fs=require('fs');var Redis=require(_0x32a1('0x4'));var db=require(_0x32a1('0x5'))['db'];var utils=require(_0x32a1('0x6'));var logger=require(_0x32a1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32a1('0x8'));var client=jayson[_0x32a1('0x9')][_0x32a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1646d,_0x149ede,_0x167fc9){return new BPromise(function(_0x13ca67,_0xfb63f6){return client[_0x32a1('0xb')](_0x1646d,_0x167fc9)[_0x32a1('0xc')](function(_0x514bac){logger[_0x32a1('0xd')](_0x32a1('0xe'),_0x149ede,_0x32a1('0xf'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x149ede,_0x32a1('0xf'),JSON[_0x32a1('0x10')](_0x514bac));if(_0x514bac[_0x32a1('0x11')]){if(_0x514bac[_0x32a1('0x11')][_0x32a1('0x12')]===0x1f4){logger[_0x32a1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x149ede,_0x514bac[_0x32a1('0x11')][_0x32a1('0x13')]);return _0xfb63f6(_0x514bac['error'][_0x32a1('0x13')]);}logger[_0x32a1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x149ede,_0x514bac[_0x32a1('0x11')][_0x32a1('0x13')]);return _0x13ca67(_0x514bac['error']['message']);}else{logger[_0x32a1('0xd')](_0x32a1('0xe'),_0x149ede,_0x32a1('0xf'));_0x13ca67(_0x514bac['result'][_0x32a1('0x13')]);}})['catch'](function(_0x2ff28a){logger[_0x32a1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x149ede,_0x2ff28a);_0xfb63f6(_0x2ff28a);});});}exports[_0x32a1('0x14')]=function(_0x537f99){var _0x2c75bd=this;return new Promise(function(_0x5a6b05,_0x77347d){return db[_0x32a1('0x15')][_0x32a1('0x16')]({'raw':_0x537f99[_0x32a1('0x17')]?_0x537f99[_0x32a1('0x17')][_0x32a1('0x18')]===undefined?!![]:![]:!![],'where':_0x537f99['options']?_0x537f99[_0x32a1('0x17')][_0x32a1('0x19')]||null:null,'attributes':_0x537f99['options']?_0x537f99[_0x32a1('0x17')][_0x32a1('0x1a')]||null:null,'limit':_0x537f99['options']?_0x537f99['options'][_0x32a1('0x1b')]||null:null,'include':_0x537f99[_0x32a1('0x17')]?_0x537f99[_0x32a1('0x17')][_0x32a1('0x1c')]?_[_0x32a1('0x1d')](_0x537f99['options'][_0x32a1('0x1c')],function(_0x1f1a29){return{'model':db[_0x1f1a29[_0x32a1('0x1e')]],'as':_0x1f1a29['as'],'attributes':_0x1f1a29[_0x32a1('0x1a')],'include':_0x1f1a29[_0x32a1('0x1c')]?_[_0x32a1('0x1d')](_0x1f1a29[_0x32a1('0x1c')],function(_0xb91c2e){return{'model':db[_0xb91c2e['model']],'as':_0xb91c2e['as'],'attributes':_0xb91c2e[_0x32a1('0x1a')],'include':_0xb91c2e[_0x32a1('0x1c')]?_[_0x32a1('0x1d')](_0xb91c2e[_0x32a1('0x1c')],function(_0x4af43c){return{'model':db[_0x4af43c[_0x32a1('0x1e')]],'as':_0x4af43c['as'],'attributes':_0x4af43c[_0x32a1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x32a1('0xc')](function(_0x142d88){logger[_0x32a1('0xd')](_0x32a1('0x14'),_0x537f99);logger['debug'](_0x32a1('0x14'),_0x537f99,JSON['stringify'](_0x142d88));_0x5a6b05(_0x142d88);})[_0x32a1('0x1f')](function(_0x49860b){logger[_0x32a1('0x11')](_0x32a1('0x14'),_0x49860b['message'],_0x537f99);_0x77347d(_0x2c75bd['error'](0x1f4,_0x49860b[_0x32a1('0x13')]));});});};exports[_0x32a1('0x20')]=function(_0x5f2c30){var _0x43cebe=this;return new Promise(function(_0xa04a02,_0x57a2bd){return db[_0x32a1('0x15')][_0x32a1('0x21')](_0x5f2c30['body'],{'raw':_0x5f2c30[_0x32a1('0x17')]?_0x5f2c30['options'][_0x32a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2c30[_0x32a1('0x17')]?_0x5f2c30[_0x32a1('0x17')][_0x32a1('0x19')]||null:null,'attributes':_0x5f2c30['options']?_0x5f2c30['options'][_0x32a1('0x1a')]||null:null,'limit':_0x5f2c30['options']?_0x5f2c30[_0x32a1('0x17')][_0x32a1('0x1b')]||null:null})[_0x32a1('0xc')](function(_0x567fc6){logger[_0x32a1('0xd')](_0x32a1('0x20'),_0x5f2c30);logger[_0x32a1('0x22')](_0x32a1('0x20'),_0x5f2c30,JSON[_0x32a1('0x10')](_0x567fc6));_0xa04a02(_0x567fc6);})[_0x32a1('0x1f')](function(_0x944cf2){logger[_0x32a1('0x11')](_0x32a1('0x20'),_0x944cf2[_0x32a1('0x13')],_0x5f2c30);_0x57a2bd(_0x43cebe[_0x32a1('0x11')](0x1f4,_0x944cf2[_0x32a1('0x13')]));});});};exports[_0x32a1('0x23')]=function(_0xf5467c){var _0x146a4e=this;return new Promise(function(_0x57c4e5,_0x500b8e){return db[_0x32a1('0x15')][_0x32a1('0x24')]({'where':_0xf5467c[_0x32a1('0x17')]?_0xf5467c[_0x32a1('0x17')][_0x32a1('0x19')]||null:null})[_0x32a1('0xc')](function(_0x158faf){logger[_0x32a1('0xd')]('DestroyCmHopperBlack',_0xf5467c);logger[_0x32a1('0x22')](_0x32a1('0x23'),_0xf5467c,JSON[_0x32a1('0x10')](_0x158faf));_0x57c4e5(_0x158faf);})['catch'](function(_0x3de53d){logger[_0x32a1('0x11')](_0x32a1('0x23'),_0x3de53d[_0x32a1('0x13')],_0xf5467c);_0x500b8e(_0x146a4e[_0x32a1('0x11')](0x1f4,_0x3de53d[_0x32a1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 9145f3a..d32a9b0 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 _0x6455=['index','/describe','/:id','show','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x6455,0x97));var _0x5645=function(_0x4e213a,_0x2e0965){_0x4e213a=_0x4e213a-0x0;var _0xf475cc=_0x6455[_0x4e213a];return _0xf475cc;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0xf')](_0x5645('0xd'),auth[_0x5645('0xa')](),controller['update']);router[_0x5645('0x10')](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf2e3=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy'];(function(_0x542ae7,_0x57332f){var _0x5a96a6=function(_0x3c06ad){while(--_0x3c06ad){_0x542ae7['push'](_0x542ae7['shift']());}};_0x5a96a6(++_0x57332f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf2e3[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0x13')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);module[_0x3f2e('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 755970c..24f1a86 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 _0x10cb=['STRING','getDataValue','setDataValue','diff','dispositionat','BOOLEAN','sequelize','INTEGER','DATE'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0x10cb,0x1c8));var _0xb10c=function(_0x2965d6,_0x4f3c54){_0x2965d6=_0x2965d6-0x0;var _0x122ef7=_0x10cb[_0x2965d6];return _0x122ef7;};'use strict';var Sequelize=require(_0xb10c('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xb10c('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb10c('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb10c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb10c('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb10c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb10c('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb10c('0x2')]},'endtime':{'type':Sequelize[_0xb10c('0x2')]},'ringtime':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb10c('0x3')]},'campaign':{'type':Sequelize[_0xb10c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb10c('0x3')]},'reason':{'type':Sequelize[_0xb10c('0x3')]},'disposition':{'type':Sequelize[_0xb10c('0x3')]},'secondDisposition':{'type':Sequelize[_0xb10c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xb10c('0x2')],'set':function(_0x58900b){var _0x5a603f=this[_0xb10c('0x4')]('endtime');if(_0x5a603f&&_0x58900b){this[_0xb10c('0x5')]('followuptime',moment(_0x58900b)[_0xb10c('0x6')](moment(_0x5a603f),'seconds'));}return this[_0xb10c('0x5')](_0xb10c('0x7'),_0x58900b);}},'amd':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb10c('0x2')]},'callback':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb10c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb10c('0x2')]},'deleted':{'type':Sequelize[_0xb10c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb10c('0x2')]},'recallme':{'type':Sequelize[_0xb10c('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb10c('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb10c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe232=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x43975e,_0x2fafdb){var _0x1ae777=function(_0x560c34){while(--_0x560c34){_0x43975e['push'](_0x43975e['shift']());}};_0x1ae777(++_0x2fafdb);}(_0xe232,0x148));var _0x2e23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe232[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2e23('0x0'));var moment=require(_0x2e23('0x1'));module[_0x2e23('0x2')]={'state':{'type':Sequelize[_0x2e23('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2e23('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2e23('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2e23('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2e23('0x4')]},'calleridnum':{'type':Sequelize[_0x2e23('0x4')]},'calleridname':{'type':Sequelize[_0x2e23('0x4')]},'starttime':{'type':Sequelize[_0x2e23('0x5')]},'responsetime':{'type':Sequelize[_0x2e23('0x5')]},'answertime':{'type':Sequelize[_0x2e23('0x5')]},'droptime':{'type':Sequelize[_0x2e23('0x5')]},'endtime':{'type':Sequelize[_0x2e23('0x5')]},'ringtime':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2e23('0x4')]},'campaign':{'type':Sequelize[_0x2e23('0x4')]},'campaigntype':{'type':Sequelize[_0x2e23('0x4')]},'membername':{'type':Sequelize[_0x2e23('0x4')]},'reason':{'type':Sequelize[_0x2e23('0x4')]},'disposition':{'type':Sequelize[_0x2e23('0x4')]},'secondDisposition':{'type':Sequelize[_0x2e23('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x2e23('0x5')],'set':function(_0x2d3b35){var _0x8e6b03=this[_0x2e23('0x6')](_0x2e23('0x7'));if(_0x8e6b03&&_0x2d3b35){this[_0x2e23('0x8')](_0x2e23('0x9'),moment(_0x2d3b35)[_0x2e23('0xa')](moment(_0x8e6b03),_0x2e23('0xb')));}return this[_0x2e23('0x8')]('dispositionat',_0x2d3b35);}},'amd':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2e23('0x5')]},'callback':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2e23('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2e23('0x5')]},'recallme':{'type':Sequelize[_0x2e23('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2e23('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2e23('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 19dd7e3..557e62b 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(_0xb832af,_0x418c62){var _0x518549=function(_0x8aefbe){while(--_0x8aefbe){_0xb832af['push'](_0xb832af['shift']());}};_0x518549(++_0x418c62);}(_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 _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x814b,0x1a2));var _0xb814=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x814b[_0x5a636f];return _0x6a8cfb;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8897baa..fcce065 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 _0x01cd=['calleridnum','uniqueid','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x01cd,0xb8));var _0xd01c=function(_0x322ff9,_0xf1ef52){_0x322ff9=_0x322ff9-0x0;var _0x6a9d34=_0x01cd[_0x322ff9];return _0x6a9d34;};'use strict';var _=require('lodash');var util=require(_0xd01c('0x0'));var logger=require(_0xd01c('0x1'))('api');var moment=require(_0xd01c('0x2'));var BPromise=require('bluebird');var rp=require(_0xd01c('0x3'));var fs=require('fs');var path=require(_0xd01c('0x4'));var rimraf=require(_0xd01c('0x5'));var config=require(_0xd01c('0x6'));var attributes=require(_0xd01c('0x7'));module[_0xd01c('0x8')]=function(_0x3ef46f,_0x20ae9b){return _0x3ef46f[_0xd01c('0x9')](_0xd01c('0xa'),attributes,{'tableName':_0xd01c('0xb'),'paranoid':![],'indexes':[{'name':_0xd01c('0xc'),'fields':[_0xd01c('0xc')]},{'name':_0xd01c('0xd'),'fields':[_0xd01c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0899=['rimraf','../../config/environment','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x35d210,_0x1591b9){var _0x3d635d=function(_0x2041a0){while(--_0x2041a0){_0x35d210['push'](_0x35d210['shift']());}};_0x3d635d(++_0x1591b9);}(_0x0899,0x16d));var _0x9089=function(_0x229764,_0x3687f1){_0x229764=_0x229764-0x0;var _0x143dea=_0x0899[_0x229764];return _0x143dea;};'use strict';var _=require(_0x9089('0x0'));var util=require(_0x9089('0x1'));var logger=require(_0x9089('0x2'))(_0x9089('0x3'));var moment=require(_0x9089('0x4'));var BPromise=require(_0x9089('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9089('0x6'));var rimraf=require(_0x9089('0x7'));var config=require(_0x9089('0x8'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x413766,_0x162acb){return _0x413766['define'](_0x9089('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9089('0xa'),'fields':['calleridnum']},{'name':_0x9089('0xb'),'fields':[_0x9089('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9fe78e2..71c96b1 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x162141,_0x119200){var _0x154245=function(_0x3b1554){while(--_0x3b1554){_0x162141['push'](_0x162141['shift']());}};_0x154245(++_0x119200);}(_0xb10b,0x12a));var _0xbb10=function(_0x1031ab,_0x11a0e6){_0x1031ab=_0x1031ab-0x0;var _0x15ba29=_0xb10b[_0x1031ab];return _0x15ba29;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x17a4cd,_0x3b87d2){var _0x502891=function(_0x2ff7bc){while(--_0x2ff7bc){_0x17a4cd['push'](_0x17a4cd['shift']());}};_0x502891(++_0x3b87d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x7c13ed,_0x4d9dd5){_0x7c13ed=_0x7c13ed-0x0;var _0x4cad66=_0xb10b[_0x7c13ed];return _0x4cad66;};'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 6c1b5dd..47f6ec5 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 _0xd576=['describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd576,0xb1));var _0x6d57=function(_0x5856d3,_0xb4e105){_0x5856d3=_0x5856d3-0x0;var _0x217fd0=_0xd576[_0x5856d3];return _0x217fd0;};'use strict';var multer=require(_0x6d57('0x0'));var util=require(_0x6d57('0x1'));var path=require(_0x6d57('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d57('0x3'));var router=express[_0x6d57('0x4')]();var fs_extra=require(_0x6d57('0x5'));var auth=require(_0x6d57('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d57('0x7'));var controller=require(_0x6d57('0x8'));router[_0x6d57('0x9')]('/',auth[_0x6d57('0xa')](),controller['index']);router[_0x6d57('0x9')](_0x6d57('0xb'),auth[_0x6d57('0xa')](),controller[_0x6d57('0xc')]);router[_0x6d57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6d57('0xd')]);router['get'](_0x6d57('0xe'),auth[_0x6d57('0xa')](),controller[_0x6d57('0xf')]);router[_0x6d57('0x9')](_0x6d57('0x10'),auth[_0x6d57('0xa')](),controller[_0x6d57('0x11')]);router[_0x6d57('0x12')](_0x6d57('0x13'),auth[_0x6d57('0xa')](),controller[_0x6d57('0x14')]);router[_0x6d57('0x12')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x6d57('0x12')](_0x6d57('0x15'),auth[_0x6d57('0xa')](),controller[_0x6d57('0x16')]);router[_0x6d57('0x17')](_0x6d57('0x18'),auth[_0x6d57('0xa')](),controller[_0x6d57('0x19')]);module[_0x6d57('0x1a')]=router; \ No newline at end of file +var _0x2fcb=['describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','path','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe'];(function(_0x22a75f,_0xf98f1f){var _0x583584=function(_0x48a6cc){while(--_0x48a6cc){_0x22a75f['push'](_0x22a75f['shift']());}};_0x583584(++_0xf98f1f);}(_0x2fcb,0x98));var _0xb2fc=function(_0x4bf8bf,_0x5e7ac0){_0x4bf8bf=_0x4bf8bf-0x0;var _0x5e3d14=_0x2fcb[_0x4bf8bf];return _0x5e3d14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2fc('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2fc('0x1')]();var fs_extra=require(_0xb2fc('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb2fc('0x3'));var config=require('../../config/environment');var controller=require(_0xb2fc('0x4'));router[_0xb2fc('0x5')]('/',auth[_0xb2fc('0x6')](),controller[_0xb2fc('0x7')]);router[_0xb2fc('0x5')](_0xb2fc('0x8'),auth[_0xb2fc('0x6')](),controller[_0xb2fc('0x9')]);router[_0xb2fc('0x5')](_0xb2fc('0xa'),auth[_0xb2fc('0x6')](),controller[_0xb2fc('0xb')]);router[_0xb2fc('0x5')](_0xb2fc('0xc'),auth[_0xb2fc('0x6')](),controller[_0xb2fc('0xd')]);router[_0xb2fc('0x5')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xb2fc('0xe')]('/voice/queue/moveContacts/:id',auth[_0xb2fc('0x6')](),controller[_0xb2fc('0xf')]);router[_0xb2fc('0xe')](_0xb2fc('0x10'),auth['isAuthenticated'](),controller[_0xb2fc('0x11')]);router[_0xb2fc('0xe')](_0xb2fc('0x12'),auth['isAuthenticated'](),controller[_0xb2fc('0x13')]);router[_0xb2fc('0x14')](_0xb2fc('0xa'),auth[_0xb2fc('0x6')](),controller[_0xb2fc('0x15')]);module[_0xb2fc('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7638cb9..11c2a70 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 _0x3cff=['DATE','STRING','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x3c73ea,_0x37afb4){var _0x3ed8cd=function(_0x275d8b){while(--_0x275d8b){_0x3c73ea['push'](_0x3c73ea['shift']());}};_0x3ed8cd(++_0x37afb4);}(_0x3cff,0xbd));var _0xf3cf=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3cff[_0x12f688];return _0x59c3de;};'use strict';var Sequelize=require(_0xf3cf('0x0'));module[_0xf3cf('0x1')]={'state':{'type':Sequelize[_0xf3cf('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf3cf('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf3cf('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xf3cf('0x4')]},'calleridnum':{'type':Sequelize[_0xf3cf('0x4')]},'calleridname':{'type':Sequelize[_0xf3cf('0x4')]},'starttime':{'type':Sequelize[_0xf3cf('0x3')]},'responsetime':{'type':Sequelize[_0xf3cf('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xf3cf('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf3cf('0x4')]},'campaign':{'type':Sequelize[_0xf3cf('0x4')]},'campaigntype':{'type':Sequelize[_0xf3cf('0x4')]},'membername':{'type':Sequelize[_0xf3cf('0x4')]},'reason':{'type':Sequelize[_0xf3cf('0x4')]},'amd':{'type':Sequelize[_0xf3cf('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xf3cf('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf3cf('0x3')]},'edited':{'type':Sequelize[_0xf3cf('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf3cf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7af6=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0x7af6,0x17c));var _0x67af=function(_0x37f2df,_0x3e4ade){_0x37f2df=_0x37f2df-0x0;var _0x54465c=_0x7af6[_0x37f2df];return _0x54465c;};'use strict';var Sequelize=require(_0x67af('0x0'));module[_0x67af('0x1')]={'state':{'type':Sequelize[_0x67af('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x67af('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x67af('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x67af('0x3')]},'originatecalleridname':{'type':Sequelize[_0x67af('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x67af('0x3')]},'starttime':{'type':Sequelize[_0x67af('0x4')]},'responsetime':{'type':Sequelize[_0x67af('0x4')]},'answertime':{'type':Sequelize[_0x67af('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x67af('0x3')]},'campaign':{'type':Sequelize[_0x67af('0x3')]},'campaigntype':{'type':Sequelize[_0x67af('0x3')]},'membername':{'type':Sequelize[_0x67af('0x3')]},'reason':{'type':Sequelize[_0x67af('0x3')]},'amd':{'type':Sequelize[_0x67af('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x67af('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x67af('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x67af('0x4')]},'recallme':{'type':Sequelize[_0x67af('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x67af('0x4')]},'edited':{'type':Sequelize[_0x67af('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x67af('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67af('0x2')],'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 d56a05b..cde9aa3 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 _0xfceb=['sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','catch','params','include','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfceb,0x169));var _0xbfce=function(_0x5ee8e1,_0x38e3f5){_0x5ee8e1=_0x5ee8e1-0x0;var _0xd77d65=_0xfceb[_0x5ee8e1];return _0xd77d65;};'use strict';var emlformat=require(_0xbfce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbfce('0x1'));var jsonpatch=require(_0xbfce('0x2'));var rp=require(_0xbfce('0x3'));var moment=require(_0xbfce('0x4'));var BPromise=require(_0xbfce('0x5'));var Mustache=require(_0xbfce('0x6'));var util=require(_0xbfce('0x7'));var path=require(_0xbfce('0x8'));var sox=require(_0xbfce('0x9'));var csv=require(_0xbfce('0xa'));var ejs=require(_0xbfce('0xb'));var fs=require('fs');var fs_extra=require(_0xbfce('0xc'));var _=require('lodash');var squel=require(_0xbfce('0xd'));var crypto=require(_0xbfce('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbfce('0xf'));var toCsv=require(_0xbfce('0xa'));var querystring=require(_0xbfce('0x10'));var Papa=require(_0xbfce('0x11'));var Redis=require(_0xbfce('0x12'));var authService=require(_0xbfce('0x13'));var qs=require(_0xbfce('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfce('0x15'));var logger=require(_0xbfce('0x16'))(_0xbfce('0x17'));var utils=require('../../config/utils');var config=require(_0xbfce('0x18'));var licenseUtil=require(_0xbfce('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c929f,_0x2eefa4){_0x2eefa4=_0x2eefa4||0xcc;return function(_0x1f4365){if(_0x1f4365){return _0x2c929f[_0xbfce('0x1a')](_0x2eefa4);}return _0x2c929f['status'](_0x2eefa4)[_0xbfce('0x1b')]();};}function respondWithResult(_0x2cc65a,_0x4455c9){_0x4455c9=_0x4455c9||0xc8;return function(_0x5c9a5d){if(_0x5c9a5d){return _0x2cc65a[_0xbfce('0x1c')](_0x4455c9)[_0xbfce('0x1d')](_0x5c9a5d);}};}function respondWithFilteredResult(_0x2c85cd,_0x1e9d9e){return function(_0x31160b){if(_0x31160b){var _0x116c29=typeof _0x1e9d9e[_0xbfce('0x1e')]===_0xbfce('0x1f')&&typeof _0x1e9d9e[_0xbfce('0x20')]===_0xbfce('0x1f');var _0x1da817=_0x31160b[_0xbfce('0x21')];var _0x1c540f=_0x116c29?0x0:_0x1e9d9e[_0xbfce('0x1e')];var _0x3be6c1=_0x116c29?_0x31160b[_0xbfce('0x21')]:_0x1e9d9e['offset']+_0x1e9d9e[_0xbfce('0x20')];var _0xa40f14;if(_0x3be6c1>=_0x1da817){_0x3be6c1=_0x1da817;_0xa40f14=0xc8;}else{_0xa40f14=0xce;}_0x2c85cd[_0xbfce('0x1c')](_0xa40f14);return _0x2c85cd[_0xbfce('0x22')](_0xbfce('0x23'),_0x1c540f+'-'+_0x3be6c1+'/'+_0x1da817)['json'](_0x31160b);}return null;};}function patchUpdates(_0x4f5546){return function(_0x229528){try{jsonpatch['apply'](_0x229528,_0x4f5546,!![]);}catch(_0x1d6d49){return BPromise[_0xbfce('0x24')](_0x1d6d49);}return _0x229528[_0xbfce('0x25')]();};}function saveUpdates(_0x1183ac,_0x3272dd){return function(_0x16aba1){if(_0x16aba1){return _0x16aba1[_0xbfce('0x26')](_0x1183ac)[_0xbfce('0x27')](function(_0x463613){return _0x463613;});}return null;};}function removeEntity(_0x2d555a,_0x457c38){return function(_0x1a2fa4){if(_0x1a2fa4){return _0x1a2fa4[_0xbfce('0x28')]()[_0xbfce('0x27')](function(){_0x2d555a['status'](0xcc)[_0xbfce('0x1b')]();});}};}function handleEntityNotFound(_0x38c8bf,_0x72057a){return function(_0x3895d7){if(!_0x3895d7){_0x38c8bf[_0xbfce('0x1a')](0x194);}return _0x3895d7;};}function handleError(_0x3c0834,_0x2fc7af){_0x2fc7af=_0x2fc7af||0x1f4;return function(_0x1b4647){logger[_0xbfce('0x29')](_0x1b4647[_0xbfce('0x2a')]);if(_0x1b4647[_0xbfce('0x2b')]){delete _0x1b4647['name'];}_0x3c0834[_0xbfce('0x1c')](_0x2fc7af)[_0xbfce('0x2c')](_0x1b4647);};}exports['index']=function(_0x2dbb34,_0xc9cc5b){var _0x3aaee2={},_0x482286={},_0xce59ae={'count':0x0,'rows':[]};var _0x3c1fe0=_[_0xbfce('0x2d')](db[_0xbfce('0x2e')][_0xbfce('0x2f')],function(_0x5f02e9){return{'name':_0x5f02e9['fieldName'],'type':_0x5f02e9['type']['key']};});_0x482286[_0xbfce('0x30')]=_['map'](_0x3c1fe0,'name');_0x482286['query']=_[_0xbfce('0x31')](_0x2dbb34[_0xbfce('0x32')]);_0x482286['filters']=_[_0xbfce('0x33')](_0x482286[_0xbfce('0x30')],_0x482286[_0xbfce('0x32')]);_0x3aaee2['attributes']=_[_0xbfce('0x33')](_0x482286[_0xbfce('0x30')],qs['fields'](_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x34')]));_0x3aaee2[_0xbfce('0x35')]=_0x3aaee2[_0xbfce('0x35')][_0xbfce('0x36')]?_0x3aaee2[_0xbfce('0x35')]:_0x482286[_0xbfce('0x30')];if(!_0x2dbb34['query'][_0xbfce('0x37')](_0xbfce('0x38'))){_0x3aaee2[_0xbfce('0x20')]=qs[_0xbfce('0x20')](_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x20')]);_0x3aaee2[_0xbfce('0x1e')]=qs[_0xbfce('0x1e')](_0x2dbb34[_0xbfce('0x32')]['offset']);}_0x3aaee2['order']=qs[_0xbfce('0x39')](_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x39')]);_0x3aaee2[_0xbfce('0x3a')]=qs[_0xbfce('0x3b')](_[_0xbfce('0x3c')](_0x2dbb34['query'],_0x482286[_0xbfce('0x3b')]),_0x3c1fe0);if(_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x3d')]){_0x3aaee2['where']=_[_0xbfce('0x3e')](_0x3aaee2[_0xbfce('0x3a')],{'$or':_['map'](_0x3c1fe0,function(_0x52d882){if(_0x52d882[_0xbfce('0x3f')]!=='VIRTUAL'){var _0x75d070={};_0x75d070[_0x52d882[_0xbfce('0x2b')]]={'$like':'%'+_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x3d')]+'%'};return _0x75d070;}})});}_0x3aaee2=_[_0xbfce('0x3e')]({},_0x3aaee2,_0x2dbb34[_0xbfce('0x40')]);var _0x45e73f={'where':_0x3aaee2['where']};return db['CmHopperHistory'][_0xbfce('0x21')](_0x45e73f)[_0xbfce('0x27')](function(_0x5077f4){_0xce59ae['count']=_0x5077f4;if(_0x2dbb34[_0xbfce('0x32')][_0xbfce('0x41')]){_0x3aaee2['include']=[{'all':!![]}];}return db[_0xbfce('0x2e')]['findAll'](_0x3aaee2);})['then'](function(_0x5a7d7b){_0xce59ae['rows']=_0x5a7d7b;return _0xce59ae;})[_0xbfce('0x27')](respondWithFilteredResult(_0xc9cc5b,_0x3aaee2))[_0xbfce('0x42')](handleError(_0xc9cc5b,null));};exports['show']=function(_0x512350,_0x5d3ed6){var _0x39a6fa={'raw':!![],'where':{'id':_0x512350[_0xbfce('0x43')]['id']}},_0x1b313d={};_0x1b313d[_0xbfce('0x30')]=_[_0xbfce('0x31')](db[_0xbfce('0x2e')][_0xbfce('0x2f')]);_0x1b313d[_0xbfce('0x32')]=_[_0xbfce('0x31')](_0x512350[_0xbfce('0x32')]);_0x1b313d[_0xbfce('0x3b')]=_[_0xbfce('0x33')](_0x1b313d[_0xbfce('0x30')],_0x1b313d['query']);_0x39a6fa[_0xbfce('0x35')]=_[_0xbfce('0x33')](_0x1b313d['model'],qs[_0xbfce('0x34')](_0x512350[_0xbfce('0x32')][_0xbfce('0x34')]));_0x39a6fa[_0xbfce('0x35')]=_0x39a6fa['attributes'][_0xbfce('0x36')]?_0x39a6fa['attributes']:_0x1b313d['model'];if(_0x512350[_0xbfce('0x32')][_0xbfce('0x41')]){_0x39a6fa[_0xbfce('0x44')]=[{'all':!![]}];}_0x39a6fa=_[_0xbfce('0x3e')]({},_0x39a6fa,_0x512350[_0xbfce('0x40')]);return db[_0xbfce('0x2e')][_0xbfce('0x45')](_0x39a6fa)[_0xbfce('0x27')](handleEntityNotFound(_0x5d3ed6,null))['then'](respondWithResult(_0x5d3ed6,null))[_0xbfce('0x42')](handleError(_0x5d3ed6,null));};exports[_0xbfce('0x46')]=function(_0x590689,_0x2a2262){return db['CmHopperHistory'][_0xbfce('0x46')](_0x590689[_0xbfce('0x47')],{})[_0xbfce('0x27')](respondWithResult(_0x2a2262,0xc9))[_0xbfce('0x42')](handleError(_0x2a2262,null));};exports[_0xbfce('0x48')]=function(_0x87891c,_0x1babf0){return db['CmHopperHistory'][_0xbfce('0x48')]()[_0xbfce('0x27')](respondWithResult(_0x1babf0,null))['catch'](handleError(_0x1babf0,null));};exports['update']=function(_0x54c0cd,_0xde43ba){if(_0x54c0cd[_0xbfce('0x47')][_0xbfce('0x49')]){delete _0x54c0cd['body'][_0xbfce('0x49')];}return db[_0xbfce('0x2e')][_0xbfce('0x45')]({'where':{'uniqueid':_0x54c0cd[_0xbfce('0x43')]['id']}})[_0xbfce('0x27')](handleEntityNotFound(_0xde43ba,null))['then'](saveUpdates(_0x54c0cd[_0xbfce('0x47')],null))[_0xbfce('0x27')](respondWithResult(_0xde43ba,null))[_0xbfce('0x42')](handleError(_0xde43ba,null));}; \ No newline at end of file +var _0x469a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x469a,0x64));var _0xa469=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x469a[_0x333714];return _0x4c211e;};'use strict';var emlformat=require(_0xa469('0x0'));var rimraf=require(_0xa469('0x1'));var zipdir=require(_0xa469('0x2'));var jsonpatch=require(_0xa469('0x3'));var rp=require(_0xa469('0x4'));var moment=require(_0xa469('0x5'));var BPromise=require(_0xa469('0x6'));var Mustache=require(_0xa469('0x7'));var util=require(_0xa469('0x8'));var path=require(_0xa469('0x9'));var sox=require(_0xa469('0xa'));var csv=require(_0xa469('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa469('0xc'));var _=require(_0xa469('0xd'));var squel=require(_0xa469('0xe'));var crypto=require(_0xa469('0xf'));var jsforce=require(_0xa469('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa469('0xb'));var querystring=require(_0xa469('0x11'));var Papa=require(_0xa469('0x12'));var Redis=require(_0xa469('0x13'));var authService=require(_0xa469('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa469('0x15'));var hardwareService=require(_0xa469('0x16'));var logger=require(_0xa469('0x17'))(_0xa469('0x18'));var utils=require(_0xa469('0x19'));var config=require(_0xa469('0x1a'));var licenseUtil=require(_0xa469('0x1b'));var db=require(_0xa469('0x1c'))['db'];function respondWithStatusCode(_0x18279e,_0x15a3ce){_0x15a3ce=_0x15a3ce||0xcc;return function(_0x5274d0){if(_0x5274d0){return _0x18279e[_0xa469('0x1d')](_0x15a3ce);}return _0x18279e[_0xa469('0x1e')](_0x15a3ce)[_0xa469('0x1f')]();};}function respondWithResult(_0x21bb85,_0x4fe9cb){_0x4fe9cb=_0x4fe9cb||0xc8;return function(_0x176519){if(_0x176519){return _0x21bb85['status'](_0x4fe9cb)[_0xa469('0x20')](_0x176519);}};}function respondWithFilteredResult(_0x42178d,_0x547b0b){return function(_0x36640a){if(_0x36640a){var _0xc8e941=typeof _0x547b0b['offset']===_0xa469('0x21')&&typeof _0x547b0b['limit']==='undefined';var _0x2ff642=_0x36640a[_0xa469('0x22')];var _0x2b2e8d=_0xc8e941?0x0:_0x547b0b['offset'];var _0x342a84=_0xc8e941?_0x36640a['count']:_0x547b0b[_0xa469('0x23')]+_0x547b0b[_0xa469('0x24')];var _0x55a72b;if(_0x342a84>=_0x2ff642){_0x342a84=_0x2ff642;_0x55a72b=0xc8;}else{_0x55a72b=0xce;}_0x42178d['status'](_0x55a72b);return _0x42178d['set'](_0xa469('0x25'),_0x2b2e8d+'-'+_0x342a84+'/'+_0x2ff642)[_0xa469('0x20')](_0x36640a);}return null;};}function patchUpdates(_0x353714){return function(_0x33ba9a){try{jsonpatch[_0xa469('0x26')](_0x33ba9a,_0x353714,!![]);}catch(_0x36d542){return BPromise[_0xa469('0x27')](_0x36d542);}return _0x33ba9a[_0xa469('0x28')]();};}function saveUpdates(_0x1a85b3,_0x116132){return function(_0x178457){if(_0x178457){return _0x178457[_0xa469('0x29')](_0x1a85b3)[_0xa469('0x2a')](function(_0x337ad0){return _0x337ad0;});}return null;};}function removeEntity(_0x5017f8,_0xd25129){return function(_0x1203fb){if(_0x1203fb){return _0x1203fb['destroy']()['then'](function(){_0x5017f8['status'](0xcc)[_0xa469('0x1f')]();});}};}function handleEntityNotFound(_0x1fc553,_0x4af79a){return function(_0x51f419){if(!_0x51f419){_0x1fc553[_0xa469('0x1d')](0x194);}return _0x51f419;};}function handleError(_0x4552b1,_0x468a3a){_0x468a3a=_0x468a3a||0x1f4;return function(_0x116844){logger['error'](_0x116844[_0xa469('0x2b')]);if(_0x116844[_0xa469('0x2c')]){delete _0x116844['name'];}_0x4552b1[_0xa469('0x1e')](_0x468a3a)[_0xa469('0x2d')](_0x116844);};}exports['index']=function(_0xf66a1d,_0x233750){var _0x40c4be={},_0xd328ed={},_0x1b90c4={'count':0x0,'rows':[]};var _0x22a6b2=_[_0xa469('0x2e')](db[_0xa469('0x2f')][_0xa469('0x30')],function(_0x3e2f9c){return{'name':_0x3e2f9c[_0xa469('0x31')],'type':_0x3e2f9c[_0xa469('0x32')]['key']};});_0xd328ed[_0xa469('0x33')]=_[_0xa469('0x2e')](_0x22a6b2,_0xa469('0x2c'));_0xd328ed[_0xa469('0x34')]=_['keys'](_0xf66a1d[_0xa469('0x34')]);_0xd328ed[_0xa469('0x35')]=_[_0xa469('0x36')](_0xd328ed[_0xa469('0x33')],_0xd328ed[_0xa469('0x34')]);_0x40c4be[_0xa469('0x37')]=_[_0xa469('0x36')](_0xd328ed[_0xa469('0x33')],qs[_0xa469('0x38')](_0xf66a1d[_0xa469('0x34')]['fields']));_0x40c4be[_0xa469('0x37')]=_0x40c4be[_0xa469('0x37')][_0xa469('0x39')]?_0x40c4be[_0xa469('0x37')]:_0xd328ed[_0xa469('0x33')];if(!_0xf66a1d['query'][_0xa469('0x3a')](_0xa469('0x3b'))){_0x40c4be[_0xa469('0x24')]=qs[_0xa469('0x24')](_0xf66a1d[_0xa469('0x34')][_0xa469('0x24')]);_0x40c4be[_0xa469('0x23')]=qs[_0xa469('0x23')](_0xf66a1d[_0xa469('0x34')][_0xa469('0x23')]);}_0x40c4be[_0xa469('0x3c')]=qs[_0xa469('0x3d')](_0xf66a1d['query'][_0xa469('0x3d')]);_0x40c4be[_0xa469('0x3e')]=qs[_0xa469('0x35')](_[_0xa469('0x3f')](_0xf66a1d['query'],_0xd328ed[_0xa469('0x35')]),_0x22a6b2);if(_0xf66a1d[_0xa469('0x34')][_0xa469('0x40')]){_0x40c4be[_0xa469('0x3e')]=_[_0xa469('0x41')](_0x40c4be[_0xa469('0x3e')],{'$or':_[_0xa469('0x2e')](_0x22a6b2,function(_0x196295){if(_0x196295['type']!=='VIRTUAL'){var _0x9bd6ed={};_0x9bd6ed[_0x196295[_0xa469('0x2c')]]={'$like':'%'+_0xf66a1d[_0xa469('0x34')]['filter']+'%'};return _0x9bd6ed;}})});}_0x40c4be=_[_0xa469('0x41')]({},_0x40c4be,_0xf66a1d[_0xa469('0x42')]);var _0x554fc0={'where':_0x40c4be[_0xa469('0x3e')]};return db[_0xa469('0x2f')]['count'](_0x554fc0)[_0xa469('0x2a')](function(_0x1ed8c9){_0x1b90c4['count']=_0x1ed8c9;if(_0xf66a1d[_0xa469('0x34')][_0xa469('0x43')]){_0x40c4be[_0xa469('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa469('0x45')](_0x40c4be);})[_0xa469('0x2a')](function(_0x43ce86){_0x1b90c4[_0xa469('0x46')]=_0x43ce86;return _0x1b90c4;})[_0xa469('0x2a')](respondWithFilteredResult(_0x233750,_0x40c4be))[_0xa469('0x47')](handleError(_0x233750,null));};exports['show']=function(_0xdfea56,_0x473818){var _0x4aa426={'raw':!![],'where':{'id':_0xdfea56['params']['id']}},_0x158261={};_0x158261[_0xa469('0x33')]=_[_0xa469('0x48')](db[_0xa469('0x2f')][_0xa469('0x30')]);_0x158261[_0xa469('0x34')]=_[_0xa469('0x48')](_0xdfea56['query']);_0x158261['filters']=_[_0xa469('0x36')](_0x158261[_0xa469('0x33')],_0x158261[_0xa469('0x34')]);_0x4aa426[_0xa469('0x37')]=_[_0xa469('0x36')](_0x158261[_0xa469('0x33')],qs[_0xa469('0x38')](_0xdfea56[_0xa469('0x34')][_0xa469('0x38')]));_0x4aa426[_0xa469('0x37')]=_0x4aa426[_0xa469('0x37')][_0xa469('0x39')]?_0x4aa426[_0xa469('0x37')]:_0x158261[_0xa469('0x33')];if(_0xdfea56[_0xa469('0x34')][_0xa469('0x43')]){_0x4aa426[_0xa469('0x44')]=[{'all':!![]}];}_0x4aa426=_[_0xa469('0x41')]({},_0x4aa426,_0xdfea56[_0xa469('0x42')]);return db[_0xa469('0x2f')][_0xa469('0x49')](_0x4aa426)['then'](handleEntityNotFound(_0x473818,null))[_0xa469('0x2a')](respondWithResult(_0x473818,null))[_0xa469('0x47')](handleError(_0x473818,null));};exports[_0xa469('0x4a')]=function(_0x28fa4e,_0x5ae172){return db[_0xa469('0x2f')][_0xa469('0x4a')](_0x28fa4e[_0xa469('0x4b')],{})[_0xa469('0x2a')](respondWithResult(_0x5ae172,0xc9))[_0xa469('0x47')](handleError(_0x5ae172,null));};exports[_0xa469('0x4c')]=function(_0x2db29d,_0x13b5eb){return db[_0xa469('0x2f')][_0xa469('0x4c')]()[_0xa469('0x2a')](respondWithResult(_0x13b5eb,null))[_0xa469('0x47')](handleError(_0x13b5eb,null));};exports[_0xa469('0x29')]=function(_0x3bcc23,_0x58fc5f){if(_0x3bcc23['body']['uniqueid']){delete _0x3bcc23['body'][_0xa469('0x4d')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x3bcc23[_0xa469('0x4e')]['id']}})['then'](handleEntityNotFound(_0x58fc5f,null))[_0xa469('0x2a')](saveUpdates(_0x3bcc23['body'],null))['then'](respondWithResult(_0x58fc5f,null))[_0xa469('0x47')](handleError(_0x58fc5f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index dfbb07f..56b0c11 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 _0x8276=['moment','bluebird','path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x50c2c8,_0x17421e){var _0x55f8a3=function(_0x1fb37e){while(--_0x1fb37e){_0x50c2c8['push'](_0x50c2c8['shift']());}};_0x55f8a3(++_0x17421e);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6827('0x0'));var util=require(_0x6827('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6827('0x2'));var BPromise=require(_0x6827('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6827('0x4'));var rimraf=require(_0x6827('0x5'));var config=require('../../config/environment');var attributes=require(_0x6827('0x6'));module[_0x6827('0x7')]=function(_0xc96297,_0x1c7983){return _0xc96297[_0x6827('0x8')](_0x6827('0x9'),attributes,{'tableName':_0x6827('0xa'),'paranoid':![],'indexes':[{'name':_0x6827('0xb'),'fields':[_0x6827('0xb')]},{'name':'uniqueid','fields':[_0x6827('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16a2=['moment','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4042d5,_0x475798){var _0x3eed69=function(_0x12f524){while(--_0x12f524){_0x4042d5['push'](_0x4042d5['shift']());}};_0x3eed69(++_0x475798);}(_0x16a2,0x1d0));var _0x216a=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x16a2[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var logger=require(_0x216a('0x2'))(_0x216a('0x3'));var moment=require(_0x216a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x216a('0x5'));var rimraf=require(_0x216a('0x6'));var config=require(_0x216a('0x7'));var attributes=require(_0x216a('0x8'));module['exports']=function(_0x4d97cd,_0x4456ad){return _0x4d97cd[_0x216a('0x9')](_0x216a('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x216a('0xb'),'fields':[_0x216a('0xb')]},{'name':_0x216a('0xc'),'fields':[_0x216a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ea54e2d..4100df7 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 _0x6d4a=['GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','debug','AvgHandleTime','where','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','stringify','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory'];(function(_0x3f4030,_0xd488eb){var _0x587095=function(_0x20dc58){while(--_0x20dc58){_0x3f4030['push'](_0x3f4030['shift']());}};_0x587095(++_0xd488eb);}(_0x6d4a,0x117));var _0xa6d4=function(_0x36c116,_0xf005b5){_0x36c116=_0x36c116-0x0;var _0x61f0a=_0x6d4a[_0x36c116];return _0x61f0a;};'use strict';var _=require(_0xa6d4('0x0'));var util=require('util');var moment=require(_0xa6d4('0x1'));var BPromise=require(_0xa6d4('0x2'));var rs=require(_0xa6d4('0x3'));var fs=require('fs');var Redis=require(_0xa6d4('0x4'));var db=require(_0xa6d4('0x5'))['db'];var utils=require(_0xa6d4('0x6'));var logger=require(_0xa6d4('0x7'))(_0xa6d4('0x8'));var config=require(_0xa6d4('0x9'));var jayson=require(_0xa6d4('0xa'));var client=jayson[_0xa6d4('0xb')][_0xa6d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x354148,_0x444bf9,_0x49a9e8){return new BPromise(function(_0x71ccfa,_0xc6d920){return client['request'](_0x354148,_0x49a9e8)[_0xa6d4('0xd')](function(_0x36af3a){logger[_0xa6d4('0xe')](_0xa6d4('0xf'),_0x444bf9,_0xa6d4('0x10'));logger['debug'](_0xa6d4('0x11'),_0x444bf9,_0xa6d4('0x10'),JSON['stringify'](_0x36af3a));if(_0x36af3a[_0xa6d4('0x12')]){if(_0x36af3a[_0xa6d4('0x12')][_0xa6d4('0x13')]===0x1f4){logger['error'](_0xa6d4('0xf'),_0x444bf9,_0x36af3a['error'][_0xa6d4('0x14')]);return _0xc6d920(_0x36af3a[_0xa6d4('0x12')]['message']);}logger[_0xa6d4('0x12')](_0xa6d4('0xf'),_0x444bf9,_0x36af3a[_0xa6d4('0x12')][_0xa6d4('0x14')]);return _0x71ccfa(_0x36af3a[_0xa6d4('0x12')][_0xa6d4('0x14')]);}else{logger[_0xa6d4('0xe')](_0xa6d4('0xf'),_0x444bf9,_0xa6d4('0x10'));_0x71ccfa(_0x36af3a[_0xa6d4('0x15')][_0xa6d4('0x14')]);}})[_0xa6d4('0x16')](function(_0x518a73){logger[_0xa6d4('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x444bf9,_0x518a73);_0xc6d920(_0x518a73);});});}exports[_0xa6d4('0x17')]=function(_0x474b62){var _0x4533ea=this;return new Promise(function(_0x4a7af1,_0x12226a){return db[_0xa6d4('0x18')]['create'](_0x474b62[_0xa6d4('0x19')],{'raw':_0x474b62[_0xa6d4('0x1a')]?_0x474b62[_0xa6d4('0x1a')][_0xa6d4('0x1b')]===undefined?!![]:![]:!![]})[_0xa6d4('0xd')](function(_0x5c40f5){logger[_0xa6d4('0xe')](_0xa6d4('0x17'),_0x474b62);logger[_0xa6d4('0x1c')]('CreateCmHopperHistory',_0x474b62,JSON['stringify'](_0x5c40f5));_0x4a7af1(_0x5c40f5);})[_0xa6d4('0x16')](function(_0x32bea3){logger[_0xa6d4('0x12')](_0xa6d4('0x17'),_0x32bea3[_0xa6d4('0x14')],_0x474b62);_0x12226a(_0x4533ea[_0xa6d4('0x12')](0x1f4,_0x32bea3['message']));});});};exports[_0xa6d4('0x1d')]=function(_0xd4a69e){var _0xfa4806=this;return new Promise(function(_0x46c48e,_0x27ecc6){return db[_0xa6d4('0x18')]['findAll']({'raw':_0xd4a69e[_0xa6d4('0x1a')]?_0xd4a69e['options'][_0xa6d4('0x1b')]===undefined?!![]:![]:!![],'where':_0xd4a69e['options']?_0xd4a69e[_0xa6d4('0x1a')][_0xa6d4('0x1e')]||null:null,'attributes':[[db[_0xa6d4('0x1f')]['fn']('COUNT',db[_0xa6d4('0x1f')][_0xa6d4('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xa6d4('0x22')](_0xa6d4('0x23')))),_0xa6d4('0x24')],[db['sequelize']['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x25')))),_0xa6d4('0x26')],[db[_0xa6d4('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x27')))),_0xa6d4('0x28')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x29'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xa6d4('0x2a')]]})['then'](function(_0x1e0e2c){logger[_0xa6d4('0xe')](_0xa6d4('0x1d'),_0xd4a69e);logger[_0xa6d4('0x1c')](_0xa6d4('0x1d'),_0xd4a69e,JSON[_0xa6d4('0x2b')](_0x1e0e2c));_0x46c48e(_0x1e0e2c);})[_0xa6d4('0x16')](function(_0x4dcc1b){logger['error'](_0xa6d4('0x1d'),_0x4dcc1b[_0xa6d4('0x14')],_0xd4a69e);_0x27ecc6(_0xfa4806['error'](0x1f4,_0x4dcc1b[_0xa6d4('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x145860){var _0x37e796=this;return new Promise(function(_0x52f2e3,_0x5f0f00){return db[_0xa6d4('0x18')][_0xa6d4('0x2c')]({'raw':_0x145860['options']?_0x145860[_0xa6d4('0x1a')][_0xa6d4('0x1b')]===undefined?!![]:![]:!![],'where':_0x145860[_0xa6d4('0x1a')]?_0x145860[_0xa6d4('0x1a')][_0xa6d4('0x1e')]||null:null,'attributes':[[_0xa6d4('0x2d'),_0xa6d4('0x2e')],[db['sequelize']['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db['sequelize'][_0xa6d4('0x22')](_0xa6d4('0x2f')))),'outboundNoSuchCallsDay'],[db[_0xa6d4('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x30')))),_0xa6d4('0x31')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x23')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xa6d4('0x21'),db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0xa6d4('0x32')],[db['sequelize']['fn']('COUNT',db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x33')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0xa6d4('0x21'),db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x34')))),_0xa6d4('0x35')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x36')))),_0xa6d4('0x37')],[db['sequelize']['fn'](_0xa6d4('0x21'),db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x38')))),'outboundUnknownCallsDay'],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db['sequelize']['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x39')))),_0xa6d4('0x3a')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x3b')))),_0xa6d4('0x3c')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x3d')))),'outboundRejectCallsDay'],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa6d4('0x3e')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')][_0xa6d4('0x22')](_0xa6d4('0x3f')))),_0xa6d4('0x40')]],'group':[_0xa6d4('0x2d')]})['then'](function(_0x2227a4){logger[_0xa6d4('0xe')](_0xa6d4('0x41'),_0x145860);logger['debug']('GetVoiceQueueHopperHistory',_0x145860,JSON[_0xa6d4('0x2b')](_0x2227a4));_0x52f2e3(_0x2227a4);})[_0xa6d4('0x16')](function(_0x5ce0c9){logger[_0xa6d4('0x12')](_0xa6d4('0x41'),_0x5ce0c9[_0xa6d4('0x14')],_0x145860);_0x5f0f00(_0x37e796['error'](0x1f4,_0x5ce0c9[_0xa6d4('0x14')]));});});};exports[_0xa6d4('0x42')]=function(_0x2ff28b){var _0x1e0ab7=this;return new Promise(function(_0xc232a2,_0x5db317){return db[_0xa6d4('0x18')][_0xa6d4('0x2c')]({'raw':_0x2ff28b[_0xa6d4('0x1a')]?_0x2ff28b[_0xa6d4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2ff28b[_0xa6d4('0x1a')]?_0x2ff28b['options']['where']||null:null,'attributes':[[_0xa6d4('0x2d'),'name'],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')][_0xa6d4('0x20')]('id')),_0xa6d4('0x43')],[db[_0xa6d4('0x1f')]['fn'](_0xa6d4('0x21'),db[_0xa6d4('0x1f')]['fn']('IF',db[_0xa6d4('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xa6d4('0x44')]],'group':[_0xa6d4('0x2d')]})[_0xa6d4('0xd')](function(_0x53e2d5){logger[_0xa6d4('0xe')](_0xa6d4('0x42'),_0x2ff28b);logger[_0xa6d4('0x1c')](_0xa6d4('0x42'),_0x2ff28b,JSON[_0xa6d4('0x2b')](_0x53e2d5));_0xc232a2(_0x53e2d5);})[_0xa6d4('0x16')](function(_0xad2bf8){logger[_0xa6d4('0x12')](_0xa6d4('0x42'),_0xad2bf8[_0xa6d4('0x14')],_0x2ff28b);_0x5db317(_0x1e0ab7[_0xa6d4('0x12')](0x1f4,_0xad2bf8[_0xa6d4('0x14')]));});});}; \ No newline at end of file +var _0x9f3e=['name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`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','GetVoiceQueueHopperHistory','catch','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','create','body','options','raw','CmHopperHistory','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','campaign'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x325d24,_0x862744){_0x325d24=_0x325d24-0x0;var _0xb07667=_0x9f3e[_0x325d24];return _0xb07667;};'use strict';var _=require(_0xe9f3('0x0'));var util=require(_0xe9f3('0x1'));var moment=require(_0xe9f3('0x2'));var BPromise=require(_0xe9f3('0x3'));var rs=require(_0xe9f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9f3('0x5'))('rpc');var config=require(_0xe9f3('0x6'));var jayson=require(_0xe9f3('0x7'));var client=jayson[_0xe9f3('0x8')][_0xe9f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e25d,_0x1611eb,_0x407123){return new BPromise(function(_0x4014b1,_0x1fe4af){return client[_0xe9f3('0xa')](_0x46e25d,_0x407123)[_0xe9f3('0xb')](function(_0x30e00e){logger[_0xe9f3('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x1611eb,_0xe9f3('0xd'));logger[_0xe9f3('0xe')](_0xe9f3('0xf'),_0x1611eb,_0xe9f3('0xd'),JSON[_0xe9f3('0x10')](_0x30e00e));if(_0x30e00e['error']){if(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x12')]===0x1f4){logger['error'](_0xe9f3('0x13'),_0x1611eb,_0x30e00e['error'][_0xe9f3('0x14')]);return _0x1fe4af(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1611eb,_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);return _0x4014b1(_0x30e00e['error'][_0xe9f3('0x14')]);}else{logger[_0xe9f3('0xc')](_0xe9f3('0x13'),_0x1611eb,_0xe9f3('0xd'));_0x4014b1(_0x30e00e[_0xe9f3('0x15')]['message']);}})['catch'](function(_0x32e9ae){logger[_0xe9f3('0x11')](_0xe9f3('0x13'),_0x1611eb,_0x32e9ae);_0x1fe4af(_0x32e9ae);});});}exports[_0xe9f3('0x16')]=function(_0x16b788){var _0x58825e=this;return new Promise(function(_0x1496f,_0x3df9a5){return db['CmHopperHistory'][_0xe9f3('0x17')](_0x16b788[_0xe9f3('0x18')],{'raw':_0x16b788[_0xe9f3('0x19')]?_0x16b788[_0xe9f3('0x19')][_0xe9f3('0x1a')]===undefined?!![]:![]:!![]})[_0xe9f3('0xb')](function(_0x3866cc){logger[_0xe9f3('0xc')]('CreateCmHopperHistory',_0x16b788);logger[_0xe9f3('0xe')](_0xe9f3('0x16'),_0x16b788,JSON[_0xe9f3('0x10')](_0x3866cc));_0x1496f(_0x3866cc);})['catch'](function(_0x138e5d){logger[_0xe9f3('0x11')](_0xe9f3('0x16'),_0x138e5d['message'],_0x16b788);_0x3df9a5(_0x58825e['error'](0x1f4,_0x138e5d[_0xe9f3('0x14')]));});});};exports['AvgHandleTime']=function(_0x35a8af){var _0x52d646=this;return new Promise(function(_0x2cffca,_0x5c7d8f){return db[_0xe9f3('0x1b')][_0xe9f3('0x1c')]({'raw':_0x35a8af[_0xe9f3('0x19')]?_0x35a8af[_0xe9f3('0x19')][_0xe9f3('0x1a')]===undefined?!![]:![]:!![],'where':_0x35a8af['options']?_0x35a8af[_0xe9f3('0x19')][_0xe9f3('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')][_0xe9f3('0x20')]('id')),_0xe9f3('0x21')],[db[_0xe9f3('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe9f3('0x1f')]['literal'](_0xe9f3('0x22')))),_0xe9f3('0x23')],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x25')))),_0xe9f3('0x26')],[db[_0xe9f3('0x1f')]['fn']('COUNT',db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x28'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xe9f3('0x29')],[db[_0xe9f3('0x1f')]['fn']('AVG',db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')]['literal'](_0xe9f3('0x2a')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x8d2d8f){logger['info']('AvgHandleTime',_0x35a8af);logger['debug'](_0xe9f3('0x2b'),_0x35a8af,JSON[_0xe9f3('0x10')](_0x8d2d8f));_0x2cffca(_0x8d2d8f);})['catch'](function(_0x318d1f){logger[_0xe9f3('0x11')](_0xe9f3('0x2b'),_0x318d1f[_0xe9f3('0x14')],_0x35a8af);_0x5c7d8f(_0x52d646[_0xe9f3('0x11')](0x1f4,_0x318d1f[_0xe9f3('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x2be9e0){var _0x308e52=this;return new Promise(function(_0x2343dd,_0x1630d8){return db['CmHopperHistory']['findAll']({'raw':_0x2be9e0[_0xe9f3('0x19')]?_0x2be9e0[_0xe9f3('0x19')][_0xe9f3('0x1a')]===undefined?!![]:![]:!![],'where':_0x2be9e0[_0xe9f3('0x19')]?_0x2be9e0[_0xe9f3('0x19')][_0xe9f3('0x1d')]||null:null,'attributes':[[_0xe9f3('0x2c'),_0xe9f3('0x2d')],[db['sequelize']['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x2e')))),_0xe9f3('0x2f')],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db['sequelize'][_0xe9f3('0x24')](_0xe9f3('0x30')))),_0xe9f3('0x31')],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x22')))),_0xe9f3('0x32')],[db['sequelize']['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db['sequelize'][_0xe9f3('0x24')](_0xe9f3('0x33')))),'outboundBusyCallsDay'],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db['sequelize']['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0xe9f3('0x34')],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x35')))),_0xe9f3('0x36')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x38')))),_0xe9f3('0x39')],[db[_0xe9f3('0x1f')]['fn']('COUNT',db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0xe9f3('0x3a')],[db['sequelize']['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')]['literal'](_0xe9f3('0x3b')))),_0xe9f3('0x3c')],[db['sequelize']['fn']('COUNT',db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x3d')))),_0xe9f3('0x3e')],[db[_0xe9f3('0x1f')]['fn']('COUNT',db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')]['literal'](_0xe9f3('0x3f')))),_0xe9f3('0x3c')],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['fn']('IF',db[_0xe9f3('0x1f')][_0xe9f3('0x24')](_0xe9f3('0x40')))),_0xe9f3('0x41')]],'group':[_0xe9f3('0x2c')]})['then'](function(_0x2d1744){logger[_0xe9f3('0xc')](_0xe9f3('0x42'),_0x2be9e0);logger['debug'](_0xe9f3('0x42'),_0x2be9e0,JSON[_0xe9f3('0x10')](_0x2d1744));_0x2343dd(_0x2d1744);})[_0xe9f3('0x43')](function(_0x5e3e7f){logger[_0xe9f3('0x11')](_0xe9f3('0x42'),_0x5e3e7f[_0xe9f3('0x14')],_0x2be9e0);_0x1630d8(_0x308e52[_0xe9f3('0x11')](0x1f4,_0x5e3e7f[_0xe9f3('0x14')]));});});};exports[_0xe9f3('0x44')]=function(_0xfb04ba){var _0x27cbc1=this;return new Promise(function(_0x12865d,_0xa875c3){return db[_0xe9f3('0x1b')]['findAll']({'raw':_0xfb04ba[_0xe9f3('0x19')]?_0xfb04ba[_0xe9f3('0x19')][_0xe9f3('0x1a')]===undefined?!![]:![]:!![],'where':_0xfb04ba[_0xe9f3('0x19')]?_0xfb04ba[_0xe9f3('0x19')][_0xe9f3('0x1d')]||null:null,'attributes':[[_0xe9f3('0x2c'),'name'],[db[_0xe9f3('0x1f')]['fn'](_0xe9f3('0x1e'),db[_0xe9f3('0x1f')]['col']('id')),_0xe9f3('0x45')],[db[_0xe9f3('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe9f3('0x24')](_0xe9f3('0x22')))),_0xe9f3('0x46')]],'group':[_0xe9f3('0x2c')]})[_0xe9f3('0xb')](function(_0x2c66a6){logger[_0xe9f3('0xc')]('GetCampaignHopperHistory',_0xfb04ba);logger[_0xe9f3('0xe')](_0xe9f3('0x44'),_0xfb04ba,JSON[_0xe9f3('0x10')](_0x2c66a6));_0x12865d(_0x2c66a6);})[_0xe9f3('0x43')](function(_0x23c2bc){logger[_0xe9f3('0x11')](_0xe9f3('0x44'),_0x23c2bc['message'],_0xfb04ba);_0xa875c3(_0x27cbc1[_0xe9f3('0x11')](0x1f4,_0x23c2bc['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d7b94f4..a7e8ca5 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 _0xa8e8=['create','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xa8e8,0x11f));var _0x8a8e=function(_0x4969d0,_0x4a5788){_0x4969d0=_0x4969d0-0x0;var _0x754944=_0xa8e8[_0x4969d0];return _0x754944;};'use strict';var multer=require(_0x8a8e('0x0'));var util=require(_0x8a8e('0x1'));var path=require(_0x8a8e('0x2'));var timeout=require(_0x8a8e('0x3'));var express=require(_0x8a8e('0x4'));var router=express[_0x8a8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8a8e('0x6'));var interaction=require(_0x8a8e('0x7'));var config=require(_0x8a8e('0x8'));var controller=require(_0x8a8e('0x9'));router[_0x8a8e('0xa')]('/',auth[_0x8a8e('0xb')](),controller[_0x8a8e('0xc')]);router['get'](_0x8a8e('0xd'),auth[_0x8a8e('0xb')](),controller['describe']);router[_0x8a8e('0xa')](_0x8a8e('0xe'),auth[_0x8a8e('0xb')](),controller[_0x8a8e('0xf')]);router[_0x8a8e('0x10')]('/',auth[_0x8a8e('0xb')](),controller[_0x8a8e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);module[_0x8a8e('0x12')]=router; \ No newline at end of file +var _0x2644=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','exports','multer','util','path'];(function(_0x11e22a,_0x28269a){var _0x3806ad=function(_0x9f2c78){while(--_0x9f2c78){_0x11e22a['push'](_0x11e22a['shift']());}};_0x3806ad(++_0x28269a);}(_0x2644,0x1a6));var _0x4264=function(_0x4e4827,_0x4c1947){_0x4e4827=_0x4e4827-0x0;var _0x58d622=_0x2644[_0x4e4827];return _0x58d622;};'use strict';var multer=require(_0x4264('0x0'));var util=require(_0x4264('0x1'));var path=require(_0x4264('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4264('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4264('0x4'));var interaction=require(_0x4264('0x5'));var config=require(_0x4264('0x6'));var controller=require(_0x4264('0x7'));router[_0x4264('0x8')]('/',auth[_0x4264('0x9')](),controller[_0x4264('0xa')]);router[_0x4264('0x8')](_0x4264('0xb'),auth[_0x4264('0x9')](),controller['describe']);router['get'](_0x4264('0xc'),auth[_0x4264('0x9')](),controller['show']);router[_0x4264('0xd')]('/',auth[_0x4264('0x9')](),controller[_0x4264('0xe')]);router['put'](_0x4264('0xc'),auth[_0x4264('0x9')](),controller[_0x4264('0xf')]);module[_0x4264('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ecc4f11..668fe6f 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 _0x15cb=['STRING','exports','name'];(function(_0xa2836c,_0x206339){var _0x1c1df7=function(_0x518f9a){while(--_0x518f9a){_0xa2836c['push'](_0xa2836c['shift']());}};_0x1c1df7(++_0x206339);}(_0x15cb,0x16f));var _0xb15c=function(_0x58c627,_0x452888){_0x58c627=_0x58c627-0x0;var _0x135379=_0x15cb[_0x58c627];return _0x135379;};'use strict';var Sequelize=require('sequelize');module[_0xb15c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb15c('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xb15c('0x2')]}}; \ No newline at end of file +var _0xb90d=['exports','STRING','name'];(function(_0xbc25e1,_0x27007d){var _0xaf0a85=function(_0x52acb3){while(--_0x52acb3){_0xbc25e1['push'](_0xbc25e1['shift']());}};_0xaf0a85(++_0x27007d);}(_0xb90d,0x17a));var _0xdb90=function(_0x398841,_0xfa02fe){_0x398841=_0x398841-0x0;var _0x171adc=_0xb90d[_0x398841];return _0x171adc;};'use strict';var Sequelize=require('sequelize');module[_0xdb90('0x0')]={'name':{'type':Sequelize[_0xdb90('0x1')],'unique':_0xdb90('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdb90('0x1')]},'dialPrefix':{'type':Sequelize[_0xdb90('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 67e8d49..759dac8 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 _0x2a2d=['CustomFields','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Lists','UserProfileResource','end','name','index','map','CmList','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','getDispositions','findOne','Disposition','pick','rows','ids','addContacts','tags','isArray','join','CmContact','omit','success','push','dataValues','message','getContacts','CmCustomField','concat'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x2a2d,0x14d));var _0xd2a2=function(_0x32ed89,_0x11d953){_0x32ed89=_0x32ed89-0x0;var _0x262961=_0x2a2d[_0x32ed89];return _0x262961;};'use strict';var emlformat=require(_0xd2a2('0x0'));var rimraf=require(_0xd2a2('0x1'));var zipdir=require(_0xd2a2('0x2'));var jsonpatch=require(_0xd2a2('0x3'));var rp=require(_0xd2a2('0x4'));var moment=require(_0xd2a2('0x5'));var BPromise=require(_0xd2a2('0x6'));var Mustache=require(_0xd2a2('0x7'));var util=require('util');var path=require(_0xd2a2('0x8'));var sox=require(_0xd2a2('0x9'));var csv=require(_0xd2a2('0xa'));var ejs=require(_0xd2a2('0xb'));var fs=require('fs');var fs_extra=require(_0xd2a2('0xc'));var _=require('lodash');var squel=require(_0xd2a2('0xd'));var crypto=require(_0xd2a2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd2a2('0xf'));var toCsv=require(_0xd2a2('0xa'));var querystring=require(_0xd2a2('0x10'));var Papa=require(_0xd2a2('0x11'));var Redis=require('ioredis');var authService=require(_0xd2a2('0x12'));var qs=require(_0xd2a2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2a2('0x14'));var logger=require(_0xd2a2('0x15'))(_0xd2a2('0x16'));var utils=require(_0xd2a2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd2a2('0x18'));var db=require(_0xd2a2('0x19'))['db'];config[_0xd2a2('0x1a')]=_[_0xd2a2('0x1b')](config[_0xd2a2('0x1a')],{'host':_0xd2a2('0x1c'),'port':0x18eb});var socket=require(_0xd2a2('0x1d'))(new Redis(config[_0xd2a2('0x1a')]));require(_0xd2a2('0x1e'))[_0xd2a2('0x1f')](socket);function respondWithStatusCode(_0x8a6a74,_0x1530bb){_0x1530bb=_0x1530bb||0xcc;return function(_0x4a24a1){if(_0x4a24a1){return _0x8a6a74[_0xd2a2('0x20')](_0x1530bb);}return _0x8a6a74[_0xd2a2('0x21')](_0x1530bb)['end']();};}function respondWithResult(_0x1071aa,_0x4f148f){_0x4f148f=_0x4f148f||0xc8;return function(_0x2adea9){if(_0x2adea9){return _0x1071aa[_0xd2a2('0x21')](_0x4f148f)[_0xd2a2('0x22')](_0x2adea9);}};}function respondWithFilteredResult(_0x50cd49,_0x2403e5){return function(_0x451143){if(_0x451143){var _0x4a3b80=typeof _0x2403e5[_0xd2a2('0x23')]===_0xd2a2('0x24')&&typeof _0x2403e5[_0xd2a2('0x25')]===_0xd2a2('0x24');var _0x3403e4=_0x451143[_0xd2a2('0x26')];var _0x1d13f3=_0x4a3b80?0x0:_0x2403e5['offset'];var _0x1ade42=_0x4a3b80?_0x451143[_0xd2a2('0x26')]:_0x2403e5[_0xd2a2('0x23')]+_0x2403e5[_0xd2a2('0x25')];var _0x3eb757;if(_0x1ade42>=_0x3403e4){_0x1ade42=_0x3403e4;_0x3eb757=0xc8;}else{_0x3eb757=0xce;}_0x50cd49[_0xd2a2('0x21')](_0x3eb757);return _0x50cd49[_0xd2a2('0x27')](_0xd2a2('0x28'),_0x1d13f3+'-'+_0x1ade42+'/'+_0x3403e4)[_0xd2a2('0x22')](_0x451143);}return null;};}function patchUpdates(_0xa35786){return function(_0x225a3f){try{jsonpatch[_0xd2a2('0x29')](_0x225a3f,_0xa35786,!![]);}catch(_0x10ba48){return BPromise['reject'](_0x10ba48);}return _0x225a3f[_0xd2a2('0x2a')]();};}function saveUpdates(_0x2a41f8,_0x3a81a2){return function(_0x38c057){if(_0x38c057){return _0x38c057[_0xd2a2('0x2b')](_0x2a41f8)[_0xd2a2('0x2c')](function(_0x140bd0){return _0x140bd0;});}return null;};}function removeEntity(_0xce08a6,_0x3d5152){return function(_0x262f8f){if(_0x262f8f){return _0x262f8f[_0xd2a2('0x2d')]()[_0xd2a2('0x2c')](function(){var _0xaa75f3=_0x262f8f['get']({'plain':!![]});var _0x19675a=_0xd2a2('0x2e');return db[_0xd2a2('0x2f')][_0xd2a2('0x2d')]({'where':{'type':_0x19675a,'resourceId':_0xaa75f3['id']}})[_0xd2a2('0x2c')](function(){return _0x262f8f;});})[_0xd2a2('0x2c')](function(){_0xce08a6[_0xd2a2('0x21')](0xcc)[_0xd2a2('0x30')]();});}};}function handleEntityNotFound(_0x1c421d,_0x2c1bd2){return function(_0x581d97){if(!_0x581d97){_0x1c421d[_0xd2a2('0x20')](0x194);}return _0x581d97;};}function handleError(_0xa2c55e,_0x3779be){_0x3779be=_0x3779be||0x1f4;return function(_0x36db84){logger['error'](_0x36db84['stack']);if(_0x36db84[_0xd2a2('0x31')]){delete _0x36db84[_0xd2a2('0x31')];}_0xa2c55e[_0xd2a2('0x21')](_0x3779be)['send'](_0x36db84);};}exports[_0xd2a2('0x32')]=function(_0x1f98ef,_0x586228){var _0x1de895={},_0x40f2da={},_0x32d88c={'count':0x0,'rows':[]};var _0x1be026=_[_0xd2a2('0x33')](db[_0xd2a2('0x34')][_0xd2a2('0x35')],function(_0x74019){return{'name':_0x74019[_0xd2a2('0x36')],'type':_0x74019[_0xd2a2('0x37')][_0xd2a2('0x38')]};});_0x40f2da[_0xd2a2('0x39')]=_[_0xd2a2('0x33')](_0x1be026,_0xd2a2('0x31'));_0x40f2da['query']=_[_0xd2a2('0x3a')](_0x1f98ef[_0xd2a2('0x3b')]);_0x40f2da[_0xd2a2('0x3c')]=_['intersection'](_0x40f2da[_0xd2a2('0x39')],_0x40f2da[_0xd2a2('0x3b')]);_0x1de895[_0xd2a2('0x3d')]=_[_0xd2a2('0x3e')](_0x40f2da['model'],qs['fields'](_0x1f98ef['query'][_0xd2a2('0x3f')]));_0x1de895[_0xd2a2('0x3d')]=_0x1de895[_0xd2a2('0x3d')][_0xd2a2('0x40')]?_0x1de895['attributes']:_0x40f2da['model'];if(!_0x1f98ef[_0xd2a2('0x3b')][_0xd2a2('0x41')](_0xd2a2('0x42'))){_0x1de895['limit']=qs[_0xd2a2('0x25')](_0x1f98ef['query']['limit']);_0x1de895[_0xd2a2('0x23')]=qs[_0xd2a2('0x23')](_0x1f98ef[_0xd2a2('0x3b')][_0xd2a2('0x23')]);}_0x1de895[_0xd2a2('0x43')]=qs['sort'](_0x1f98ef[_0xd2a2('0x3b')][_0xd2a2('0x44')]);_0x1de895['where']=qs[_0xd2a2('0x3c')](_['pick'](_0x1f98ef[_0xd2a2('0x3b')],_0x40f2da[_0xd2a2('0x3c')]),_0x1be026);if(_0x1f98ef['query'][_0xd2a2('0x45')]){_0x1de895[_0xd2a2('0x46')]=_['merge'](_0x1de895[_0xd2a2('0x46')],{'$or':_[_0xd2a2('0x33')](_0x1be026,function(_0x151908){if(_0x151908[_0xd2a2('0x37')]!==_0xd2a2('0x47')){var _0x3a217b={};_0x3a217b[_0x151908['name']]={'$like':'%'+_0x1f98ef[_0xd2a2('0x3b')][_0xd2a2('0x45')]+'%'};return _0x3a217b;}})});}_0x1de895=_[_0xd2a2('0x48')]({},_0x1de895,_0x1f98ef[_0xd2a2('0x49')]);var _0x3f882e={'where':_0x1de895[_0xd2a2('0x46')]};return db['CmList'][_0xd2a2('0x26')](_0x3f882e)[_0xd2a2('0x2c')](function(_0x1f341b){_0x32d88c[_0xd2a2('0x26')]=_0x1f341b;if(_0x1f98ef[_0xd2a2('0x3b')]['includeAll']){_0x1de895[_0xd2a2('0x4a')]=[{'all':!![]}];}return db[_0xd2a2('0x34')][_0xd2a2('0x4b')](_0x1de895);})['then'](function(_0x5b6cf9){_0x32d88c['rows']=_0x5b6cf9;return _0x32d88c;})['then'](respondWithFilteredResult(_0x586228,_0x1de895))[_0xd2a2('0x4c')](handleError(_0x586228,null));};exports[_0xd2a2('0x4d')]=function(_0x2a948f,_0x3300ab){var _0x176842={'raw':![],'where':{'id':_0x2a948f[_0xd2a2('0x4e')]['id']}},_0x1db8c2={};_0x1db8c2[_0xd2a2('0x39')]=_[_0xd2a2('0x3a')](db[_0xd2a2('0x34')][_0xd2a2('0x35')]);_0x1db8c2[_0xd2a2('0x3b')]=_[_0xd2a2('0x3a')](_0x2a948f[_0xd2a2('0x3b')]);_0x1db8c2[_0xd2a2('0x3c')]=_[_0xd2a2('0x3e')](_0x1db8c2[_0xd2a2('0x39')],_0x1db8c2[_0xd2a2('0x3b')]);_0x176842[_0xd2a2('0x3d')]=_[_0xd2a2('0x3e')](_0x1db8c2[_0xd2a2('0x39')],qs[_0xd2a2('0x3f')](_0x2a948f[_0xd2a2('0x3b')][_0xd2a2('0x3f')]));_0x176842[_0xd2a2('0x3d')]=_0x176842[_0xd2a2('0x3d')]['length']?_0x176842['attributes']:_0x1db8c2[_0xd2a2('0x39')];if(_0x2a948f['query'][_0xd2a2('0x4f')]){_0x176842[_0xd2a2('0x4a')]=[{'all':!![]}];}_0x176842=_[_0xd2a2('0x48')]({},_0x176842,_0x2a948f[_0xd2a2('0x49')]);return db[_0xd2a2('0x34')][_0xd2a2('0x50')](_0x176842)[_0xd2a2('0x2c')](handleEntityNotFound(_0x3300ab,null))['then'](respondWithResult(_0x3300ab,null))[_0xd2a2('0x4c')](handleError(_0x3300ab,null));};exports[_0xd2a2('0x51')]=function(_0x1145ab,_0x4dd62f){return db['CmList'][_0xd2a2('0x51')](_0x1145ab[_0xd2a2('0x52')],{})[_0xd2a2('0x2c')](function(_0x5a54e8){var _0x2faad1=_0x1145ab[_0xd2a2('0x53')]['get']({'plain':!![]});if(!_0x2faad1)throw new Error(_0xd2a2('0x54'));if(_0x2faad1[_0xd2a2('0x55')]===_0xd2a2('0x53')){var _0x413764=_0x5a54e8[_0xd2a2('0x56')]({'plain':!![]});var _0x47d233='Lists';return db[_0xd2a2('0x57')][_0xd2a2('0x50')]({'where':{'name':_0x47d233,'userProfileId':_0x2faad1[_0xd2a2('0x58')]},'raw':!![]})[_0xd2a2('0x2c')](function(_0x5044ce){if(_0x5044ce&&_0x5044ce['autoAssociation']===0x0){return db[_0xd2a2('0x2f')][_0xd2a2('0x51')]({'name':_0x413764[_0xd2a2('0x31')],'resourceId':_0x413764['id'],'type':_0x5044ce[_0xd2a2('0x31')],'sectionId':_0x5044ce['id']},{})[_0xd2a2('0x2c')](function(){return _0x5a54e8;});}else{return _0x5a54e8;}})[_0xd2a2('0x4c')](function(_0x30d66d){logger['error'](_0xd2a2('0x59'),_0x30d66d);throw _0x30d66d;});}return _0x5a54e8;})[_0xd2a2('0x2c')](respondWithResult(_0x4dd62f,0xc9))[_0xd2a2('0x4c')](handleError(_0x4dd62f,null));};exports[_0xd2a2('0x2b')]=function(_0xeab680,_0x2dfde0){if(_0xeab680['body']['id']){delete _0xeab680[_0xd2a2('0x52')]['id'];}return db[_0xd2a2('0x34')][_0xd2a2('0x50')]({'where':{'id':_0xeab680[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x2dfde0,null))['then'](saveUpdates(_0xeab680[_0xd2a2('0x52')],null))[_0xd2a2('0x2c')](respondWithResult(_0x2dfde0,null))['catch'](handleError(_0x2dfde0,null));};exports[_0xd2a2('0x2d')]=function(_0x4dc384,_0x325440){return db[_0xd2a2('0x34')][_0xd2a2('0x50')]({'where':{'id':_0x4dc384[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x325440,null))[_0xd2a2('0x2c')](removeEntity(_0x325440,null))[_0xd2a2('0x4c')](handleError(_0x325440,null));};exports['describe']=function(_0x2a5275,_0x1c2c7f){return db[_0xd2a2('0x34')][_0xd2a2('0x5a')]()[_0xd2a2('0x2c')](respondWithResult(_0x1c2c7f,null))[_0xd2a2('0x4c')](handleError(_0x1c2c7f,null));};exports['addDisposition']=function(_0x226ee0,_0x397d68,_0x5f3757){if(_0x226ee0[_0xd2a2('0x52')]['id']){delete _0x226ee0[_0xd2a2('0x52')]['id'];}return db[_0xd2a2('0x34')][_0xd2a2('0x50')]({'where':{'id':_0x226ee0['params']['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x397d68,null))[_0xd2a2('0x2c')](function(_0x474833){if(_0x474833){_0x226ee0[_0xd2a2('0x52')][_0xd2a2('0x5b')]=_0x474833['id'];return db['Disposition'][_0xd2a2('0x51')](_0x226ee0[_0xd2a2('0x52')]);}})['then'](respondWithResult(_0x397d68,null))[_0xd2a2('0x4c')](handleError(_0x397d68,null));};exports[_0xd2a2('0x5c')]=function(_0x234bb5,_0x387626,_0x5d433b){var _0x34e57b={'raw':![],'where':{}};var _0x1e687a={};var _0x261546={'count':0x0,'rows':[]};return db[_0xd2a2('0x34')][_0xd2a2('0x5d')]({'where':{'id':_0x234bb5[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x387626,null))['then'](function(_0x3c9086){if(_0x3c9086){_0x1e687a[_0xd2a2('0x39')]=_['keys'](db[_0xd2a2('0x5e')][_0xd2a2('0x35')]);_0x1e687a['query']=_[_0xd2a2('0x3a')](_0x234bb5['query']);_0x1e687a[_0xd2a2('0x3c')]=_[_0xd2a2('0x3e')](_0x1e687a['model'],_0x1e687a[_0xd2a2('0x3b')]);_0x34e57b[_0xd2a2('0x3d')]=_[_0xd2a2('0x3e')](_0x1e687a[_0xd2a2('0x39')],qs[_0xd2a2('0x3f')](_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x3f')]));_0x34e57b[_0xd2a2('0x3d')]=_0x34e57b[_0xd2a2('0x3d')][_0xd2a2('0x40')]?_0x34e57b[_0xd2a2('0x3d')]:_0x1e687a[_0xd2a2('0x39')];if(!_0x234bb5['query'][_0xd2a2('0x41')](_0xd2a2('0x42'))){_0x34e57b[_0xd2a2('0x25')]=qs[_0xd2a2('0x25')](_0x234bb5[_0xd2a2('0x3b')]['limit']);_0x34e57b[_0xd2a2('0x23')]=qs[_0xd2a2('0x23')](_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x23')]);}_0x34e57b[_0xd2a2('0x43')]=qs[_0xd2a2('0x44')](_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x44')]);_0x34e57b['where']=qs[_0xd2a2('0x3c')](_[_0xd2a2('0x5f')](_0x234bb5[_0xd2a2('0x3b')],_0x1e687a['filters']));_0x34e57b[_0xd2a2('0x46')][_0xd2a2('0x5b')]=_0x3c9086['id'];if(_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x45')]){_0x34e57b['where']=_['merge'](_0x34e57b[_0xd2a2('0x46')],{'$or':_['map'](_0x34e57b[_0xd2a2('0x3d')],function(_0x242934){var _0xacc7ce={};_0xacc7ce[_0x242934]={'$like':'%'+_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x45')]+'%'};return _0xacc7ce;})});}_0x34e57b=_[_0xd2a2('0x48')]({},_0x34e57b,_0x234bb5['options']);return db[_0xd2a2('0x5e')][_0xd2a2('0x26')]({'where':_0x34e57b[_0xd2a2('0x46')]})[_0xd2a2('0x2c')](function(_0x14062a){_0x261546['count']=_0x14062a;if(_0x234bb5[_0xd2a2('0x3b')][_0xd2a2('0x4f')]){_0x34e57b[_0xd2a2('0x4a')]=[{'all':!![]}];}return db[_0xd2a2('0x5e')][_0xd2a2('0x4b')](_0x34e57b);})[_0xd2a2('0x2c')](function(_0x4dc911){_0x261546[_0xd2a2('0x60')]=_0x4dc911;return _0x261546;});}})['then'](respondWithFilteredResult(_0x387626,_0x34e57b))['catch'](handleError(_0x387626,null));};exports['removeDispositions']=function(_0x48a8eb,_0xe3bb54,_0x40dc3e){return db[_0xd2a2('0x34')][_0xd2a2('0x50')]({'where':{'id':_0x48a8eb[_0xd2a2('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe3bb54,null))[_0xd2a2('0x2c')](function(_0x19dac6){if(_0x19dac6){return _0x19dac6['removeDispositions'](_0x48a8eb[_0xd2a2('0x3b')][_0xd2a2('0x61')]);}})[_0xd2a2('0x2c')](respondWithStatusCode(_0xe3bb54,null))[_0xd2a2('0x4c')](handleError(_0xe3bb54,null));};exports[_0xd2a2('0x62')]=function(_0x2d1baa,_0x22cf84,_0x41093f){return db[_0xd2a2('0x34')][_0xd2a2('0x50')]({'where':{'id':_0x2d1baa[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x22cf84,null))[_0xd2a2('0x2c')](function(_0x260d48){if(_0x260d48){var _0x110564=[];var _0x520393={'success':[],'errors':[]};return db['CmContact'][_0xd2a2('0x5a')]()[_0xd2a2('0x2c')](function(_0x851c4e){if(_0x2d1baa[_0xd2a2('0x52')][_0xd2a2('0x63')]&&_[_0xd2a2('0x64')](_0x2d1baa[_0xd2a2('0x52')]['tags'])){if(_0x2d1baa['body'][_0xd2a2('0x63')][_0xd2a2('0x40')]){_0x2d1baa['body'][_0xd2a2('0x63')]=_0x2d1baa[_0xd2a2('0x52')]['tags'][_0xd2a2('0x65')](';')+';';}else{_0x2d1baa[_0xd2a2('0x52')]['tags']=null;}}else{_0x2d1baa[_0xd2a2('0x52')][_0xd2a2('0x63')]=null;}if(_0x2d1baa[_0xd2a2('0x52')]&&_[_0xd2a2('0x64')](_0x2d1baa[_0xd2a2('0x52')])){for(var _0x5c024b=0x0;_0x5c024b<_0x2d1baa[_0xd2a2('0x52')][_0xd2a2('0x40')];_0x5c024b+=0x1){_0x2d1baa['body'][_0x5c024b][_0xd2a2('0x5b')]=_0x2d1baa[_0xd2a2('0x4e')]['id'];_0x110564['push'](_0x2d1baa[_0xd2a2('0x52')][_0x5c024b]);}return BPromise['each'](_0x110564,function(_0x3de806){return db[_0xd2a2('0x66')][_0xd2a2('0x51')](_[_0xd2a2('0x67')](_0x3de806,[_0xd2a2('0x61'),'id'])||{},{'fields':_[_0xd2a2('0x3a')](_0x851c4e),'raw':!![]})[_0xd2a2('0x2c')](function(_0x1f08a2){_0x520393[_0xd2a2('0x68')][_0xd2a2('0x69')](_0x1f08a2[_0xd2a2('0x6a')]);})['catch'](function(_0x1c36e1){_0x520393['errors']['push']({'data':_0x3de806,'error':_0x1c36e1[_0xd2a2('0x6b')]});});})[_0xd2a2('0x2c')](function(_0x758eab){return _0x520393;})['catch'](function(_0x194ad2){return _0x194ad2;});}else{_0x22cf84[_0xd2a2('0x21')](0x190)[_0xd2a2('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xd2a2('0x2c')](respondWithResult(_0x22cf84,null))[_0xd2a2('0x4c')](handleError(_0x22cf84,null));};exports[_0xd2a2('0x6c')]=function(_0x497132,_0x448ada,_0x5493d7){var _0x25ea0a;return db['CmList'][_0xd2a2('0x50')]({'where':{'id':_0x497132[_0xd2a2('0x4e')]['id']},'include':[{'model':db[_0xd2a2('0x6d')],'as':'CustomFields'}]})[_0xd2a2('0x2c')](handleEntityNotFound(_0x448ada,null))['then'](function(_0x141756){if(_0x141756){_0x25ea0a=_0x141756;return db['CmContact'][_0xd2a2('0x35')];}})[_0xd2a2('0x2c')](function(_0x7fd8c8){if(_0x7fd8c8){var _0x24a47c={};var _0x1ce5b0={};_0x1ce5b0[_0xd2a2('0x39')]=_[_0xd2a2('0x6e')](_[_0xd2a2('0x3a')](_0x7fd8c8),_[_0xd2a2('0x33')](_0x25ea0a[_0xd2a2('0x6f')],function(_0x524b3a){return util[_0xd2a2('0x70')](_0xd2a2('0x71'),_0x524b3a['id']);}));_0x1ce5b0[_0xd2a2('0x3b')]=_[_0xd2a2('0x3a')](_0x497132['query']);_0x1ce5b0[_0xd2a2('0x3c')]=_[_0xd2a2('0x3e')](_0x1ce5b0['model'],_0x1ce5b0[_0xd2a2('0x3b')]);_0x24a47c['attributes']=_[_0xd2a2('0x3e')](_0x1ce5b0[_0xd2a2('0x39')],qs[_0xd2a2('0x3f')](_0x497132[_0xd2a2('0x3b')]['fields']));_0x24a47c['attributes']=_0x24a47c[_0xd2a2('0x3d')][_0xd2a2('0x40')]?_0x24a47c['attributes']:_0x1ce5b0[_0xd2a2('0x39')];if(!_0x497132[_0xd2a2('0x3b')][_0xd2a2('0x41')](_0xd2a2('0x42'))){_0x24a47c[_0xd2a2('0x25')]=qs[_0xd2a2('0x25')](_0x497132['query'][_0xd2a2('0x25')]);_0x24a47c['offset']=qs[_0xd2a2('0x23')](_0x497132[_0xd2a2('0x3b')][_0xd2a2('0x23')]);}_0x24a47c['order']=qs['sort'](_0x497132[_0xd2a2('0x3b')][_0xd2a2('0x44')]);_0x24a47c[_0xd2a2('0x46')]=qs['filters'](_[_0xd2a2('0x5f')](_0x497132[_0xd2a2('0x3b')],_0x1ce5b0['filters']));_0x24a47c[_0xd2a2('0x72')]=!![];if(_0x497132[_0xd2a2('0x3b')][_0xd2a2('0x45')]){_0x24a47c[_0xd2a2('0x46')]=_[_0xd2a2('0x48')](_0x24a47c['where'],{'$or':_[_0xd2a2('0x33')](_0x24a47c[_0xd2a2('0x3d')],function(_0x2e8ddf){var _0x249541={};_0x249541[_0x2e8ddf]={'$like':'%'+_0x497132['query'][_0xd2a2('0x45')]+'%'};return _0x249541;})});}_0x24a47c=_[_0xd2a2('0x48')]({},_0x24a47c,_0x497132[_0xd2a2('0x49')]);return _0x25ea0a[_0xd2a2('0x6c')](_0x24a47c);}})['then'](respondWithResult(_0x448ada,null))[_0xd2a2('0x4c')](handleError(_0x448ada,null));};exports[_0xd2a2('0x73')]=function(_0x519487,_0x1dd684,_0x13048d){var _0x1530fa;return db['CmList']['find']({'where':{'id':_0x519487['params']['id']},'include':[{'model':db[_0xd2a2('0x6d')],'as':_0xd2a2('0x6f')}]})[_0xd2a2('0x2c')](handleEntityNotFound(_0x1dd684,null))[_0xd2a2('0x2c')](function(_0x195f47){if(_0x195f47){_0x1530fa=_0x195f47;return db[_0xd2a2('0x66')][_0xd2a2('0x35')];}})[_0xd2a2('0x2c')](function(_0x1a5621){if(_0x1a5621){var _0x2d20b0={};var _0x40c4fe={};_0x40c4fe[_0xd2a2('0x39')]=_[_0xd2a2('0x6e')](_[_0xd2a2('0x3a')](_0x1a5621),_[_0xd2a2('0x33')](_0x1530fa[_0xd2a2('0x6f')],function(_0xa4db90){return util[_0xd2a2('0x70')](_0xd2a2('0x71'),_0xa4db90['id']);}));_0x40c4fe[_0xd2a2('0x3b')]=_[_0xd2a2('0x3a')](_0x519487['query']);_0x40c4fe[_0xd2a2('0x3c')]=_[_0xd2a2('0x3e')](_0x40c4fe[_0xd2a2('0x39')],_0x40c4fe[_0xd2a2('0x3b')]);_0x2d20b0[_0xd2a2('0x3d')]=_[_0xd2a2('0x3e')](_0x40c4fe[_0xd2a2('0x39')],qs['fields'](_0x519487['query']['fields']));_0x2d20b0[_0xd2a2('0x3d')]=_0x2d20b0[_0xd2a2('0x3d')][_0xd2a2('0x40')]?_0x2d20b0['attributes']:_0x40c4fe['model'];if(!_0x519487[_0xd2a2('0x3b')][_0xd2a2('0x41')]('nolimit')){_0x2d20b0['limit']=qs[_0xd2a2('0x25')](_0x519487['query']['limit']);_0x2d20b0[_0xd2a2('0x23')]=qs[_0xd2a2('0x23')](_0x519487[_0xd2a2('0x3b')][_0xd2a2('0x23')]);}_0x2d20b0[_0xd2a2('0x43')]=qs[_0xd2a2('0x44')](_0x519487[_0xd2a2('0x3b')][_0xd2a2('0x44')]);_0x2d20b0[_0xd2a2('0x46')]=qs[_0xd2a2('0x3c')](_['pick'](_0x519487[_0xd2a2('0x3b')],_0x40c4fe[_0xd2a2('0x3c')]));_0x2d20b0['raw']=!![];if(_0x519487[_0xd2a2('0x3b')][_0xd2a2('0x45')]){_0x2d20b0[_0xd2a2('0x46')]=_[_0xd2a2('0x48')](_0x2d20b0[_0xd2a2('0x46')],{'$or':_['map'](_0x2d20b0[_0xd2a2('0x3d')],function(_0x299d18){var _0x2df694={};_0x2df694[_0x299d18]={'$like':'%'+_0x519487[_0xd2a2('0x3b')][_0xd2a2('0x45')]+'%'};return _0x2df694;})});}_0x2d20b0=_[_0xd2a2('0x48')]({},_0x2d20b0,_0x519487[_0xd2a2('0x49')]);return _0x1530fa['getContacts'](_0x2d20b0);}})[_0xd2a2('0x2c')](function(_0x3006af){if(!_[_0xd2a2('0x74')](_0x3006af)){var _0x332ab4=toCsv(_0x3006af);var _0x568dc0=Date[_0xd2a2('0x75')]();fs[_0xd2a2('0x76')](util[_0xd2a2('0x70')](_0xd2a2('0x77'),_0x1530fa['id'],_0x568dc0),_0x332ab4);_0x1dd684[_0xd2a2('0x78')](_0xd2a2('0x79'),_0xd2a2('0x7a')+util['format'](_0xd2a2('0x7b'),_0x1530fa['id'],_0x568dc0));_0x1dd684['setHeader']('Content-type',_0xd2a2('0x7c'));return _0x1dd684[_0xd2a2('0x7d')](util[_0xd2a2('0x70')](_0xd2a2('0x77'),_0x1530fa['id'],_0x568dc0));}else{return _0x1dd684['sendStatus'](0xcc);}})[_0xd2a2('0x4c')](handleError(_0x1dd684,null));};exports['addCustomField']=function(_0x14d85b,_0x2fb7d3,_0x46d641){var _0x3b1d10;delete _0x14d85b[_0xd2a2('0x52')]['id'];return db[_0xd2a2('0x34')]['findOne']({'where':{'id':_0x14d85b[_0xd2a2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fb7d3,null))[_0xd2a2('0x2c')](function(_0x47f8b4){if(_0x47f8b4){return db['sequelize'][_0xd2a2('0x7e')](function(_0x4e81b9){return db[_0xd2a2('0x6d')][_0xd2a2('0x51')](_0x14d85b[_0xd2a2('0x52')],{'transaction':_0x4e81b9})['then'](function(_0x339d86){_0x3b1d10=_0x339d86;return _0x47f8b4[_0xd2a2('0x7f')](_0x339d86,{'transaction':_0x4e81b9});})[_0xd2a2('0x2c')](function(){var _0xbab2f8={'type':db[_0xd2a2('0x80')][_0xd2a2('0x81')],'transaction':_0x4e81b9};switch(_0x14d85b[_0xd2a2('0x52')]['type']){case _0xd2a2('0x82'):_0xbab2f8[_0xd2a2('0x37')]=db['Sequelize']['TEXT'];break;case _0xd2a2('0x83'):_0xbab2f8[_0xd2a2('0x37')]=db[_0xd2a2('0x80')][_0xd2a2('0x84')];break;case _0xd2a2('0x85'):_0xbab2f8['type']=db['Sequelize'][_0xd2a2('0x86')];_0xbab2f8['defaultValue']=![];break;default:}return db[_0xd2a2('0x87')][_0xd2a2('0x88')][_0xd2a2('0x89')](_0xd2a2('0x8a'),util[_0xd2a2('0x70')](_0xd2a2('0x8b'),_0x3b1d10['id']),_0xbab2f8);})[_0xd2a2('0x2c')](function(){return _0x3b1d10;});});}})[_0xd2a2('0x2c')](respondWithResult(_0x2fb7d3,null))[_0xd2a2('0x4c')](handleError(_0x2fb7d3,null));};exports['getCustomFields']=function(_0x4281f2,_0x5d3182,_0x12e8ec){var _0x581edd={};var _0x358c79={};var _0x326e23;var _0xa162ef;return db[_0xd2a2('0x34')][_0xd2a2('0x5d')]({'where':{'id':_0x4281f2[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x5d3182,null))[_0xd2a2('0x2c')](function(_0x5bca44){if(_0x5bca44){_0x326e23=_0x5bca44;_0x358c79[_0xd2a2('0x39')]=_['keys'](db[_0xd2a2('0x6d')][_0xd2a2('0x35')]);_0x358c79['query']=_['keys'](_0x4281f2[_0xd2a2('0x3b')]);_0x358c79[_0xd2a2('0x3c')]=_['intersection'](_0x358c79['model'],_0x358c79[_0xd2a2('0x3b')]);_0x581edd[_0xd2a2('0x3d')]=_[_0xd2a2('0x3e')](_0x358c79['model'],qs[_0xd2a2('0x3f')](_0x4281f2[_0xd2a2('0x3b')][_0xd2a2('0x3f')]));_0x581edd['attributes']=_0x581edd[_0xd2a2('0x3d')][_0xd2a2('0x40')]?_0x581edd[_0xd2a2('0x3d')]:_0x358c79[_0xd2a2('0x39')];_0x581edd['order']=qs[_0xd2a2('0x44')](_0x4281f2[_0xd2a2('0x3b')]['sort']);_0x581edd[_0xd2a2('0x46')]=qs['filters'](_[_0xd2a2('0x5f')](_0x4281f2['query'],_0x358c79['filters']));_0x581edd[_0xd2a2('0x46')]=_[_0xd2a2('0x48')](_0x581edd['where'],{'$or':[{'ListId':_0x5bca44['id']},{'ListId':null}]});if(_0x4281f2['query'][_0xd2a2('0x45')]){_0x581edd['where']=_[_0xd2a2('0x48')](_0x581edd[_0xd2a2('0x46')],{'$or':_[_0xd2a2('0x33')](_0x581edd[_0xd2a2('0x3d')],function(_0x563f4c){var _0x394d6b={};_0x394d6b[_0x563f4c]={'$like':'%'+_0x4281f2[_0xd2a2('0x3b')][_0xd2a2('0x45')]+'%'};return _0x394d6b;})});}_0x581edd=_[_0xd2a2('0x48')]({},_0x581edd,_0x4281f2['options']);return db['CmCustomField']['findAndCountAll'](_0x581edd);}})[_0xd2a2('0x2c')](respondWithResult(_0x5d3182,null))[_0xd2a2('0x4c')](handleError(_0x5d3182,null));};exports[_0xd2a2('0x8c')]=function(_0x5e5fdc,_0x31154b,_0x501f1f){return db[_0xd2a2('0x34')]['find']({'where':{'id':_0x5e5fdc[_0xd2a2('0x4e')]['id']}})[_0xd2a2('0x2c')](handleEntityNotFound(_0x31154b,null))[_0xd2a2('0x2c')](function(_0x48a752){if(_0x48a752){return _0x48a752[_0xd2a2('0x8c')](_0x5e5fdc[_0xd2a2('0x52')][_0xd2a2('0x61')],_[_0xd2a2('0x67')](_0x5e5fdc[_0xd2a2('0x52')],['ids','id'])||{})[_0xd2a2('0x8d')](function(_0x39995e){for(var _0x247bf7=0x0;_0x247bf7<_0x5e5fdc[_0xd2a2('0x52')][_0xd2a2('0x61')][_0xd2a2('0x40')];_0x247bf7+=0x1){socket[_0xd2a2('0x8e')](_0xd2a2('0x8f'),{'UserId':Number(_0x5e5fdc['body'][_0xd2a2('0x61')][_0x247bf7]),'CmListId':Number(_0x5e5fdc[_0xd2a2('0x4e')]['id'])});}return _0x39995e;});}})[_0xd2a2('0x2c')](respondWithResult(_0x31154b,null))[_0xd2a2('0x4c')](handleError(_0x31154b,null));};exports[_0xd2a2('0x90')]=function(_0x179c35,_0x3e3e6b,_0x3b03a7){return db[_0xd2a2('0x34')]['find']({'where':{'id':_0x179c35['params']['id']}})['then'](handleEntityNotFound(_0x3e3e6b,null))[_0xd2a2('0x2c')](function(_0x382b3c){if(_0x382b3c){return _0x382b3c['removeAgents'](_0x179c35[_0xd2a2('0x3b')]['ids'])[_0xd2a2('0x2c')](function(){if(_['isArray'](_0x179c35[_0xd2a2('0x3b')][_0xd2a2('0x61')])){for(var _0x7ec730=0x0;_0x7ec730<_0x179c35[_0xd2a2('0x3b')][_0xd2a2('0x61')][_0xd2a2('0x40')];_0x7ec730+=0x1){socket[_0xd2a2('0x8e')](_0xd2a2('0x91'),{'UserId':Number(_0x179c35[_0xd2a2('0x3b')][_0xd2a2('0x61')][_0x7ec730]),'CmListId':Number(_0x179c35[_0xd2a2('0x4e')]['id'])});}}else{socket['emit'](_0xd2a2('0x91'),{'UserId':Number(_0x179c35[_0xd2a2('0x3b')][_0xd2a2('0x61')]),'CmListId':Number(_0x179c35['params']['id'])});}});}})[_0xd2a2('0x2c')](respondWithStatusCode(_0x3e3e6b,null))['catch'](handleError(_0x3e3e6b,null));};exports['getAgents']=function(_0x3df7e0,_0x1701f9,_0x307789){var _0x232fa0={};var _0x3e1c73={};var _0x40f09a;var _0x32d81d;return db[_0xd2a2('0x34')][_0xd2a2('0x5d')]({'where':{'id':_0x3df7e0['params']['id']}})['then'](handleEntityNotFound(_0x1701f9,null))[_0xd2a2('0x2c')](function(_0x46310d){if(_0x46310d){_0x40f09a=_0x46310d;_0x3e1c73[_0xd2a2('0x39')]=_[_0xd2a2('0x3a')](db[_0xd2a2('0x92')][_0xd2a2('0x35')]);_0x3e1c73['query']=_[_0xd2a2('0x3a')](_0x3df7e0[_0xd2a2('0x3b')]);_0x3e1c73[_0xd2a2('0x3c')]=_['intersection'](_0x3e1c73['model'],_0x3e1c73[_0xd2a2('0x3b')]);_0x232fa0['attributes']=_[_0xd2a2('0x3e')](_0x3e1c73[_0xd2a2('0x39')],qs['fields'](_0x3df7e0[_0xd2a2('0x3b')][_0xd2a2('0x3f')]));_0x232fa0[_0xd2a2('0x3d')]=_0x232fa0[_0xd2a2('0x3d')]['length']?_0x232fa0[_0xd2a2('0x3d')]:_0x3e1c73[_0xd2a2('0x39')];_0x232fa0[_0xd2a2('0x43')]=qs[_0xd2a2('0x44')](_0x3df7e0[_0xd2a2('0x3b')][_0xd2a2('0x44')]);_0x232fa0[_0xd2a2('0x46')]=qs[_0xd2a2('0x3c')](_[_0xd2a2('0x5f')](_0x3df7e0['query'],_0x3e1c73['filters']));if(_0x3df7e0['query'][_0xd2a2('0x45')]){_0x232fa0[_0xd2a2('0x46')]=_[_0xd2a2('0x48')](_0x232fa0[_0xd2a2('0x46')],{'$or':_[_0xd2a2('0x33')](_0x232fa0[_0xd2a2('0x3d')],function(_0x8abbf0){var _0x5d7476={};_0x5d7476[_0x8abbf0]={'$like':'%'+_0x3df7e0[_0xd2a2('0x3b')]['filter']+'%'};return _0x5d7476;})});}_0x232fa0=_[_0xd2a2('0x48')]({},_0x232fa0,_0x3df7e0[_0xd2a2('0x49')]);return _0x40f09a[_0xd2a2('0x93')](_0x232fa0);}})[_0xd2a2('0x2c')](function(_0x10d32c){if(_0x10d32c){_0x32d81d=_0x10d32c[_0xd2a2('0x40')];if(!_0x3df7e0[_0xd2a2('0x3b')]['hasOwnProperty']('nolimit')){_0x232fa0[_0xd2a2('0x25')]=qs[_0xd2a2('0x25')](_0x3df7e0['query'][_0xd2a2('0x25')]);_0x232fa0['offset']=qs[_0xd2a2('0x23')](_0x3df7e0[_0xd2a2('0x3b')]['offset']);}return _0x40f09a[_0xd2a2('0x93')](_0x232fa0);}})[_0xd2a2('0x2c')](function(_0x49de20){if(_0x49de20){return _0x49de20?{'count':_0x32d81d,'rows':_0x49de20}:null;}})[_0xd2a2('0x2c')](respondWithResult(_0x1701f9,null))[_0xd2a2('0x4c')](handleError(_0x1701f9,null));}; \ No newline at end of file +var _0x0edf=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','then','get','Lists','UserProfileResource','destroy','error','stack','send','index','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','CmList','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','describe','ListId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','CmContact','tags','join','isArray','push','each','omit','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','concat','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','text','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','ids','spread','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2ba368,_0x4288ba){var _0x33da2b=function(_0x44e706){while(--_0x44e706){_0x2ba368['push'](_0x2ba368['shift']());}};_0x33da2b(++_0x4288ba);}(_0x0edf,0x83));var _0xf0ed=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x0edf[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0xf0ed('0x0'));var rimraf=require(_0xf0ed('0x1'));var zipdir=require(_0xf0ed('0x2'));var jsonpatch=require(_0xf0ed('0x3'));var rp=require(_0xf0ed('0x4'));var moment=require(_0xf0ed('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf0ed('0x6'));var path=require(_0xf0ed('0x7'));var sox=require(_0xf0ed('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ed('0x9'));var squel=require(_0xf0ed('0xa'));var crypto=require('crypto');var jsforce=require(_0xf0ed('0xb'));var deskjs=require(_0xf0ed('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf0ed('0xd'));var Redis=require(_0xf0ed('0xe'));var authService=require(_0xf0ed('0xf'));var qs=require(_0xf0ed('0x10'));var as=require(_0xf0ed('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ed('0x12'))(_0xf0ed('0x13'));var utils=require(_0xf0ed('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf0ed('0x15'));var db=require(_0xf0ed('0x16'))['db'];config['redis']=_[_0xf0ed('0x17')](config[_0xf0ed('0x18')],{'host':_0xf0ed('0x19'),'port':0x18eb});var socket=require(_0xf0ed('0x1a'))(new Redis(config[_0xf0ed('0x18')]));require(_0xf0ed('0x1b'))[_0xf0ed('0x1c')](socket);function respondWithStatusCode(_0x495d2f,_0x1d92ee){_0x1d92ee=_0x1d92ee||0xcc;return function(_0x5d15e8){if(_0x5d15e8){return _0x495d2f[_0xf0ed('0x1d')](_0x1d92ee);}return _0x495d2f[_0xf0ed('0x1e')](_0x1d92ee)[_0xf0ed('0x1f')]();};}function respondWithResult(_0x1fac1c,_0x33246e){_0x33246e=_0x33246e||0xc8;return function(_0x4e776c){if(_0x4e776c){return _0x1fac1c[_0xf0ed('0x1e')](_0x33246e)[_0xf0ed('0x20')](_0x4e776c);}};}function respondWithFilteredResult(_0x4bb632,_0x5ac870){return function(_0x164ad6){if(_0x164ad6){var _0x129377=typeof _0x5ac870[_0xf0ed('0x21')]==='undefined'&&typeof _0x5ac870[_0xf0ed('0x22')]===_0xf0ed('0x23');var _0x17bd18=_0x164ad6[_0xf0ed('0x24')];var _0x3c90bb=_0x129377?0x0:_0x5ac870['offset'];var _0xfcb687=_0x129377?_0x164ad6[_0xf0ed('0x24')]:_0x5ac870[_0xf0ed('0x21')]+_0x5ac870[_0xf0ed('0x22')];var _0x33a1ac;if(_0xfcb687>=_0x17bd18){_0xfcb687=_0x17bd18;_0x33a1ac=0xc8;}else{_0x33a1ac=0xce;}_0x4bb632[_0xf0ed('0x1e')](_0x33a1ac);return _0x4bb632['set'](_0xf0ed('0x25'),_0x3c90bb+'-'+_0xfcb687+'/'+_0x17bd18)[_0xf0ed('0x20')](_0x164ad6);}return null;};}function patchUpdates(_0x2299b2){return function(_0x4f660a){try{jsonpatch[_0xf0ed('0x26')](_0x4f660a,_0x2299b2,!![]);}catch(_0x10762e){return BPromise['reject'](_0x10762e);}return _0x4f660a[_0xf0ed('0x27')]();};}function saveUpdates(_0x3b9714,_0x150795){return function(_0x2b5754){if(_0x2b5754){return _0x2b5754['update'](_0x3b9714)[_0xf0ed('0x28')](function(_0x13f113){return _0x13f113;});}return null;};}function removeEntity(_0x34bd71,_0xdaef01){return function(_0x235137){if(_0x235137){return _0x235137['destroy']()['then'](function(){var _0x53ebce=_0x235137[_0xf0ed('0x29')]({'plain':!![]});var _0x465116=_0xf0ed('0x2a');return db[_0xf0ed('0x2b')][_0xf0ed('0x2c')]({'where':{'type':_0x465116,'resourceId':_0x53ebce['id']}})[_0xf0ed('0x28')](function(){return _0x235137;});})[_0xf0ed('0x28')](function(){_0x34bd71['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22de5f,_0x4eb37d){return function(_0x3c9ab8){if(!_0x3c9ab8){_0x22de5f[_0xf0ed('0x1d')](0x194);}return _0x3c9ab8;};}function handleError(_0x26eb14,_0x5625f6){_0x5625f6=_0x5625f6||0x1f4;return function(_0x5309b0){logger[_0xf0ed('0x2d')](_0x5309b0[_0xf0ed('0x2e')]);if(_0x5309b0['name']){delete _0x5309b0['name'];}_0x26eb14[_0xf0ed('0x1e')](_0x5625f6)[_0xf0ed('0x2f')](_0x5309b0);};}exports[_0xf0ed('0x30')]=function(_0x4afef2,_0x17a7d9){var _0x12b625={},_0x2ab631={},_0x286611={'count':0x0,'rows':[]};var _0x379af0=_[_0xf0ed('0x31')](db['CmList'][_0xf0ed('0x32')],function(_0x12bac7){return{'name':_0x12bac7['fieldName'],'type':_0x12bac7[_0xf0ed('0x33')][_0xf0ed('0x34')]};});_0x2ab631['model']=_[_0xf0ed('0x31')](_0x379af0,_0xf0ed('0x35'));_0x2ab631[_0xf0ed('0x36')]=_[_0xf0ed('0x37')](_0x4afef2[_0xf0ed('0x36')]);_0x2ab631[_0xf0ed('0x38')]=_[_0xf0ed('0x39')](_0x2ab631[_0xf0ed('0x3a')],_0x2ab631[_0xf0ed('0x36')]);_0x12b625['attributes']=_[_0xf0ed('0x39')](_0x2ab631[_0xf0ed('0x3a')],qs[_0xf0ed('0x3b')](_0x4afef2[_0xf0ed('0x36')][_0xf0ed('0x3b')]));_0x12b625[_0xf0ed('0x3c')]=_0x12b625[_0xf0ed('0x3c')][_0xf0ed('0x3d')]?_0x12b625['attributes']:_0x2ab631[_0xf0ed('0x3a')];if(!_0x4afef2[_0xf0ed('0x36')]['hasOwnProperty'](_0xf0ed('0x3e'))){_0x12b625[_0xf0ed('0x22')]=qs[_0xf0ed('0x22')](_0x4afef2['query']['limit']);_0x12b625[_0xf0ed('0x21')]=qs['offset'](_0x4afef2[_0xf0ed('0x36')][_0xf0ed('0x21')]);}_0x12b625[_0xf0ed('0x3f')]=qs[_0xf0ed('0x40')](_0x4afef2[_0xf0ed('0x36')][_0xf0ed('0x40')]);_0x12b625['where']=qs[_0xf0ed('0x38')](_[_0xf0ed('0x41')](_0x4afef2['query'],_0x2ab631[_0xf0ed('0x38')]),_0x379af0);if(_0x4afef2[_0xf0ed('0x36')][_0xf0ed('0x42')]){_0x12b625[_0xf0ed('0x43')]=_[_0xf0ed('0x44')](_0x12b625[_0xf0ed('0x43')],{'$or':_[_0xf0ed('0x31')](_0x379af0,function(_0x1e1256){if(_0x1e1256['type']!==_0xf0ed('0x45')){var _0x327531={};_0x327531[_0x1e1256['name']]={'$like':'%'+_0x4afef2[_0xf0ed('0x36')]['filter']+'%'};return _0x327531;}})});}_0x12b625=_[_0xf0ed('0x44')]({},_0x12b625,_0x4afef2[_0xf0ed('0x46')]);var _0x13257b={'where':_0x12b625['where']};return db['CmList'][_0xf0ed('0x24')](_0x13257b)[_0xf0ed('0x28')](function(_0x38be4c){_0x286611[_0xf0ed('0x24')]=_0x38be4c;if(_0x4afef2[_0xf0ed('0x36')][_0xf0ed('0x47')]){_0x12b625[_0xf0ed('0x48')]=[{'all':!![]}];}return db[_0xf0ed('0x49')][_0xf0ed('0x4a')](_0x12b625);})[_0xf0ed('0x28')](function(_0x1d82df){_0x286611[_0xf0ed('0x4b')]=_0x1d82df;return _0x286611;})[_0xf0ed('0x28')](respondWithFilteredResult(_0x17a7d9,_0x12b625))[_0xf0ed('0x4c')](handleError(_0x17a7d9,null));};exports[_0xf0ed('0x4d')]=function(_0x471e45,_0x5dd3e4){var _0x4004c2={'raw':![],'where':{'id':_0x471e45['params']['id']}},_0x5d0e4c={};_0x5d0e4c[_0xf0ed('0x3a')]=_[_0xf0ed('0x37')](db['CmList'][_0xf0ed('0x32')]);_0x5d0e4c[_0xf0ed('0x36')]=_['keys'](_0x471e45[_0xf0ed('0x36')]);_0x5d0e4c[_0xf0ed('0x38')]=_[_0xf0ed('0x39')](_0x5d0e4c['model'],_0x5d0e4c['query']);_0x4004c2[_0xf0ed('0x3c')]=_[_0xf0ed('0x39')](_0x5d0e4c[_0xf0ed('0x3a')],qs[_0xf0ed('0x3b')](_0x471e45[_0xf0ed('0x36')][_0xf0ed('0x3b')]));_0x4004c2[_0xf0ed('0x3c')]=_0x4004c2[_0xf0ed('0x3c')][_0xf0ed('0x3d')]?_0x4004c2[_0xf0ed('0x3c')]:_0x5d0e4c[_0xf0ed('0x3a')];if(_0x471e45[_0xf0ed('0x36')][_0xf0ed('0x47')]){_0x4004c2[_0xf0ed('0x48')]=[{'all':!![]}];}_0x4004c2=_[_0xf0ed('0x44')]({},_0x4004c2,_0x471e45[_0xf0ed('0x46')]);return db['CmList'][_0xf0ed('0x4e')](_0x4004c2)[_0xf0ed('0x28')](handleEntityNotFound(_0x5dd3e4,null))['then'](respondWithResult(_0x5dd3e4,null))[_0xf0ed('0x4c')](handleError(_0x5dd3e4,null));};exports[_0xf0ed('0x4f')]=function(_0x16f709,_0x5595a7){return db[_0xf0ed('0x49')][_0xf0ed('0x4f')](_0x16f709[_0xf0ed('0x50')],{})[_0xf0ed('0x28')](function(_0x106c70){var _0x25f117=_0x16f709[_0xf0ed('0x51')][_0xf0ed('0x29')]({'plain':!![]});if(!_0x25f117)throw new Error(_0xf0ed('0x52'));if(_0x25f117[_0xf0ed('0x53')]===_0xf0ed('0x51')){var _0x2a46e5=_0x106c70[_0xf0ed('0x29')]({'plain':!![]});var _0x23639e=_0xf0ed('0x2a');return db[_0xf0ed('0x54')]['find']({'where':{'name':_0x23639e,'userProfileId':_0x25f117[_0xf0ed('0x55')]},'raw':!![]})[_0xf0ed('0x28')](function(_0x437dc7){if(_0x437dc7&&_0x437dc7['autoAssociation']===0x0){return db[_0xf0ed('0x2b')][_0xf0ed('0x4f')]({'name':_0x2a46e5[_0xf0ed('0x35')],'resourceId':_0x2a46e5['id'],'type':_0x437dc7[_0xf0ed('0x35')],'sectionId':_0x437dc7['id']},{})[_0xf0ed('0x28')](function(){return _0x106c70;});}else{return _0x106c70;}})[_0xf0ed('0x4c')](function(_0x4ffe06){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ffe06);throw _0x4ffe06;});}return _0x106c70;})[_0xf0ed('0x28')](respondWithResult(_0x5595a7,0xc9))[_0xf0ed('0x4c')](handleError(_0x5595a7,null));};exports[_0xf0ed('0x56')]=function(_0x176fab,_0x179486){if(_0x176fab[_0xf0ed('0x50')]['id']){delete _0x176fab[_0xf0ed('0x50')]['id'];}return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x176fab[_0xf0ed('0x57')]['id']}})['then'](handleEntityNotFound(_0x179486,null))[_0xf0ed('0x28')](saveUpdates(_0x176fab[_0xf0ed('0x50')],null))[_0xf0ed('0x28')](respondWithResult(_0x179486,null))[_0xf0ed('0x4c')](handleError(_0x179486,null));};exports[_0xf0ed('0x2c')]=function(_0x3c4eb4,_0x46f110){return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x3c4eb4[_0xf0ed('0x57')]['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x46f110,null))['then'](removeEntity(_0x46f110,null))['catch'](handleError(_0x46f110,null));};exports['describe']=function(_0x45989f,_0x55faef){return db[_0xf0ed('0x49')][_0xf0ed('0x58')]()[_0xf0ed('0x28')](respondWithResult(_0x55faef,null))[_0xf0ed('0x4c')](handleError(_0x55faef,null));};exports['addDisposition']=function(_0x2bb8d4,_0xbfb0f6,_0x3c9f18){if(_0x2bb8d4['body']['id']){delete _0x2bb8d4[_0xf0ed('0x50')]['id'];}return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x2bb8d4[_0xf0ed('0x57')]['id']}})['then'](handleEntityNotFound(_0xbfb0f6,null))[_0xf0ed('0x28')](function(_0x3afb48){if(_0x3afb48){_0x2bb8d4['body'][_0xf0ed('0x59')]=_0x3afb48['id'];return db['Disposition']['create'](_0x2bb8d4[_0xf0ed('0x50')]);}})[_0xf0ed('0x28')](respondWithResult(_0xbfb0f6,null))[_0xf0ed('0x4c')](handleError(_0xbfb0f6,null));};exports[_0xf0ed('0x5a')]=function(_0x2cd8e2,_0x4e28ec,_0x521406){var _0x711047={'raw':![],'where':{}};var _0x5e9131={};var _0x7b0890={'count':0x0,'rows':[]};return db[_0xf0ed('0x49')][_0xf0ed('0x5b')]({'where':{'id':_0x2cd8e2[_0xf0ed('0x57')]['id']}})['then'](handleEntityNotFound(_0x4e28ec,null))[_0xf0ed('0x28')](function(_0x5ac89c){if(_0x5ac89c){_0x5e9131[_0xf0ed('0x3a')]=_[_0xf0ed('0x37')](db[_0xf0ed('0x5c')][_0xf0ed('0x32')]);_0x5e9131['query']=_['keys'](_0x2cd8e2[_0xf0ed('0x36')]);_0x5e9131[_0xf0ed('0x38')]=_[_0xf0ed('0x39')](_0x5e9131[_0xf0ed('0x3a')],_0x5e9131[_0xf0ed('0x36')]);_0x711047['attributes']=_[_0xf0ed('0x39')](_0x5e9131[_0xf0ed('0x3a')],qs[_0xf0ed('0x3b')](_0x2cd8e2[_0xf0ed('0x36')]['fields']));_0x711047['attributes']=_0x711047[_0xf0ed('0x3c')]['length']?_0x711047[_0xf0ed('0x3c')]:_0x5e9131['model'];if(!_0x2cd8e2[_0xf0ed('0x36')][_0xf0ed('0x5d')]('nolimit')){_0x711047[_0xf0ed('0x22')]=qs[_0xf0ed('0x22')](_0x2cd8e2['query']['limit']);_0x711047[_0xf0ed('0x21')]=qs[_0xf0ed('0x21')](_0x2cd8e2[_0xf0ed('0x36')][_0xf0ed('0x21')]);}_0x711047[_0xf0ed('0x3f')]=qs[_0xf0ed('0x40')](_0x2cd8e2[_0xf0ed('0x36')][_0xf0ed('0x40')]);_0x711047[_0xf0ed('0x43')]=qs[_0xf0ed('0x38')](_[_0xf0ed('0x41')](_0x2cd8e2[_0xf0ed('0x36')],_0x5e9131['filters']));_0x711047[_0xf0ed('0x43')][_0xf0ed('0x59')]=_0x5ac89c['id'];if(_0x2cd8e2[_0xf0ed('0x36')][_0xf0ed('0x42')]){_0x711047[_0xf0ed('0x43')]=_[_0xf0ed('0x44')](_0x711047[_0xf0ed('0x43')],{'$or':_[_0xf0ed('0x31')](_0x711047[_0xf0ed('0x3c')],function(_0x1a0174){var _0x12647e={};_0x12647e[_0x1a0174]={'$like':'%'+_0x2cd8e2['query'][_0xf0ed('0x42')]+'%'};return _0x12647e;})});}_0x711047=_[_0xf0ed('0x44')]({},_0x711047,_0x2cd8e2[_0xf0ed('0x46')]);return db[_0xf0ed('0x5c')][_0xf0ed('0x24')]({'where':_0x711047['where']})[_0xf0ed('0x28')](function(_0x180507){_0x7b0890[_0xf0ed('0x24')]=_0x180507;if(_0x2cd8e2[_0xf0ed('0x36')][_0xf0ed('0x47')]){_0x711047[_0xf0ed('0x48')]=[{'all':!![]}];}return db[_0xf0ed('0x5c')][_0xf0ed('0x4a')](_0x711047);})[_0xf0ed('0x28')](function(_0x3d50ba){_0x7b0890['rows']=_0x3d50ba;return _0x7b0890;});}})['then'](respondWithFilteredResult(_0x4e28ec,_0x711047))[_0xf0ed('0x4c')](handleError(_0x4e28ec,null));};exports[_0xf0ed('0x5e')]=function(_0x5a505e,_0x5a939d,_0x1ee5de){return db['CmList'][_0xf0ed('0x4e')]({'where':{'id':_0x5a505e['params']['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x5a939d,null))[_0xf0ed('0x28')](function(_0x53b1a9){if(_0x53b1a9){return _0x53b1a9[_0xf0ed('0x5e')](_0x5a505e[_0xf0ed('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x5a939d,null))['catch'](handleError(_0x5a939d,null));};exports['addContacts']=function(_0x353553,_0x3b93e3,_0x2a6900){return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x353553[_0xf0ed('0x57')]['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x3b93e3,null))[_0xf0ed('0x28')](function(_0x542923){if(_0x542923){var _0x293db4=[];var _0x2e47d5={'success':[],'errors':[]};return db[_0xf0ed('0x5f')][_0xf0ed('0x58')]()['then'](function(_0x5c408d){if(_0x353553[_0xf0ed('0x50')][_0xf0ed('0x60')]&&_['isArray'](_0x353553[_0xf0ed('0x50')]['tags'])){if(_0x353553[_0xf0ed('0x50')][_0xf0ed('0x60')][_0xf0ed('0x3d')]){_0x353553[_0xf0ed('0x50')]['tags']=_0x353553[_0xf0ed('0x50')][_0xf0ed('0x60')][_0xf0ed('0x61')](';')+';';}else{_0x353553[_0xf0ed('0x50')][_0xf0ed('0x60')]=null;}}else{_0x353553[_0xf0ed('0x50')][_0xf0ed('0x60')]=null;}if(_0x353553[_0xf0ed('0x50')]&&_[_0xf0ed('0x62')](_0x353553['body'])){for(var _0x1755cc=0x0;_0x1755cc<_0x353553[_0xf0ed('0x50')]['length'];_0x1755cc+=0x1){_0x353553[_0xf0ed('0x50')][_0x1755cc][_0xf0ed('0x59')]=_0x353553[_0xf0ed('0x57')]['id'];_0x293db4[_0xf0ed('0x63')](_0x353553[_0xf0ed('0x50')][_0x1755cc]);}return BPromise[_0xf0ed('0x64')](_0x293db4,function(_0x1e4f6a){return db[_0xf0ed('0x5f')][_0xf0ed('0x4f')](_[_0xf0ed('0x65')](_0x1e4f6a,['ids','id'])||{},{'fields':_[_0xf0ed('0x37')](_0x5c408d),'raw':!![]})[_0xf0ed('0x28')](function(_0x113c09){_0x2e47d5['success'][_0xf0ed('0x63')](_0x113c09[_0xf0ed('0x66')]);})['catch'](function(_0x1c3193){_0x2e47d5[_0xf0ed('0x67')][_0xf0ed('0x63')]({'data':_0x1e4f6a,'error':_0x1c3193['message']});});})['then'](function(_0x36bf64){return _0x2e47d5;})['catch'](function(_0x4e4179){return _0x4e4179;});}else{_0x3b93e3[_0xf0ed('0x1e')](0x190)[_0xf0ed('0x20')]({'message':_0xf0ed('0x68')});}});}})[_0xf0ed('0x28')](respondWithResult(_0x3b93e3,null))[_0xf0ed('0x4c')](handleError(_0x3b93e3,null));};exports[_0xf0ed('0x69')]=function(_0x2ba19d,_0x1bf568,_0xa1b903){var _0x4ec4dd;return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x2ba19d[_0xf0ed('0x57')]['id']},'include':[{'model':db[_0xf0ed('0x6a')],'as':_0xf0ed('0x6b')}]})[_0xf0ed('0x28')](handleEntityNotFound(_0x1bf568,null))[_0xf0ed('0x28')](function(_0x526f99){if(_0x526f99){_0x4ec4dd=_0x526f99;return db[_0xf0ed('0x5f')][_0xf0ed('0x32')];}})['then'](function(_0x3c4b32){if(_0x3c4b32){var _0x103c43={};var _0x4d77d3={};_0x4d77d3[_0xf0ed('0x3a')]=_['concat'](_[_0xf0ed('0x37')](_0x3c4b32),_[_0xf0ed('0x31')](_0x4ec4dd[_0xf0ed('0x6b')],function(_0x57d009){return util[_0xf0ed('0x6c')](_0xf0ed('0x6d'),_0x57d009['id']);}));_0x4d77d3['query']=_['keys'](_0x2ba19d[_0xf0ed('0x36')]);_0x4d77d3[_0xf0ed('0x38')]=_['intersection'](_0x4d77d3[_0xf0ed('0x3a')],_0x4d77d3[_0xf0ed('0x36')]);_0x103c43['attributes']=_[_0xf0ed('0x39')](_0x4d77d3[_0xf0ed('0x3a')],qs['fields'](_0x2ba19d['query']['fields']));_0x103c43['attributes']=_0x103c43[_0xf0ed('0x3c')][_0xf0ed('0x3d')]?_0x103c43[_0xf0ed('0x3c')]:_0x4d77d3[_0xf0ed('0x3a')];if(!_0x2ba19d[_0xf0ed('0x36')][_0xf0ed('0x5d')](_0xf0ed('0x3e'))){_0x103c43['limit']=qs[_0xf0ed('0x22')](_0x2ba19d[_0xf0ed('0x36')][_0xf0ed('0x22')]);_0x103c43['offset']=qs[_0xf0ed('0x21')](_0x2ba19d[_0xf0ed('0x36')][_0xf0ed('0x21')]);}_0x103c43['order']=qs['sort'](_0x2ba19d['query'][_0xf0ed('0x40')]);_0x103c43[_0xf0ed('0x43')]=qs[_0xf0ed('0x38')](_['pick'](_0x2ba19d[_0xf0ed('0x36')],_0x4d77d3[_0xf0ed('0x38')]));_0x103c43['raw']=!![];if(_0x2ba19d['query']['filter']){_0x103c43['where']=_[_0xf0ed('0x44')](_0x103c43['where'],{'$or':_[_0xf0ed('0x31')](_0x103c43[_0xf0ed('0x3c')],function(_0x39c3fd){var _0x19d5d2={};_0x19d5d2[_0x39c3fd]={'$like':'%'+_0x2ba19d[_0xf0ed('0x36')]['filter']+'%'};return _0x19d5d2;})});}_0x103c43=_[_0xf0ed('0x44')]({},_0x103c43,_0x2ba19d[_0xf0ed('0x46')]);return _0x4ec4dd[_0xf0ed('0x69')](_0x103c43);}})[_0xf0ed('0x28')](respondWithResult(_0x1bf568,null))[_0xf0ed('0x4c')](handleError(_0x1bf568,null));};exports[_0xf0ed('0x6e')]=function(_0x4a4d76,_0x4ed6a7,_0x41261b){var _0x5c238d;return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x4a4d76['params']['id']},'include':[{'model':db[_0xf0ed('0x6a')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x4ed6a7,null))[_0xf0ed('0x28')](function(_0x4a7a4c){if(_0x4a7a4c){_0x5c238d=_0x4a7a4c;return db[_0xf0ed('0x5f')][_0xf0ed('0x32')];}})[_0xf0ed('0x28')](function(_0x51a048){if(_0x51a048){var _0x28fe73={};var _0xb462d3={};_0xb462d3[_0xf0ed('0x3a')]=_[_0xf0ed('0x6f')](_[_0xf0ed('0x37')](_0x51a048),_[_0xf0ed('0x31')](_0x5c238d[_0xf0ed('0x6b')],function(_0x2f799c){return util[_0xf0ed('0x6c')]('cf_%d',_0x2f799c['id']);}));_0xb462d3[_0xf0ed('0x36')]=_[_0xf0ed('0x37')](_0x4a4d76[_0xf0ed('0x36')]);_0xb462d3[_0xf0ed('0x38')]=_[_0xf0ed('0x39')](_0xb462d3[_0xf0ed('0x3a')],_0xb462d3['query']);_0x28fe73[_0xf0ed('0x3c')]=_['intersection'](_0xb462d3['model'],qs['fields'](_0x4a4d76[_0xf0ed('0x36')][_0xf0ed('0x3b')]));_0x28fe73[_0xf0ed('0x3c')]=_0x28fe73[_0xf0ed('0x3c')][_0xf0ed('0x3d')]?_0x28fe73[_0xf0ed('0x3c')]:_0xb462d3['model'];if(!_0x4a4d76[_0xf0ed('0x36')]['hasOwnProperty'](_0xf0ed('0x3e'))){_0x28fe73[_0xf0ed('0x22')]=qs['limit'](_0x4a4d76[_0xf0ed('0x36')][_0xf0ed('0x22')]);_0x28fe73[_0xf0ed('0x21')]=qs[_0xf0ed('0x21')](_0x4a4d76[_0xf0ed('0x36')][_0xf0ed('0x21')]);}_0x28fe73['order']=qs[_0xf0ed('0x40')](_0x4a4d76['query'][_0xf0ed('0x40')]);_0x28fe73[_0xf0ed('0x43')]=qs[_0xf0ed('0x38')](_['pick'](_0x4a4d76['query'],_0xb462d3[_0xf0ed('0x38')]));_0x28fe73[_0xf0ed('0x70')]=!![];if(_0x4a4d76[_0xf0ed('0x36')][_0xf0ed('0x42')]){_0x28fe73['where']=_[_0xf0ed('0x44')](_0x28fe73[_0xf0ed('0x43')],{'$or':_[_0xf0ed('0x31')](_0x28fe73[_0xf0ed('0x3c')],function(_0x19d4f0){var _0xe90411={};_0xe90411[_0x19d4f0]={'$like':'%'+_0x4a4d76[_0xf0ed('0x36')]['filter']+'%'};return _0xe90411;})});}_0x28fe73=_[_0xf0ed('0x44')]({},_0x28fe73,_0x4a4d76[_0xf0ed('0x46')]);return _0x5c238d[_0xf0ed('0x69')](_0x28fe73);}})[_0xf0ed('0x28')](function(_0x20b20a){if(!_[_0xf0ed('0x71')](_0x20b20a)){var _0x370458=toCsv(_0x20b20a);var _0x266efb=Date[_0xf0ed('0x72')]();fs[_0xf0ed('0x73')](util[_0xf0ed('0x6c')](_0xf0ed('0x74'),_0x5c238d['id'],_0x266efb),_0x370458);_0x4ed6a7['setHeader'](_0xf0ed('0x75'),_0xf0ed('0x76')+util[_0xf0ed('0x6c')](_0xf0ed('0x77'),_0x5c238d['id'],_0x266efb));_0x4ed6a7[_0xf0ed('0x78')](_0xf0ed('0x79'),_0xf0ed('0x7a'));return _0x4ed6a7[_0xf0ed('0x7b')](util['format']('/tmp/list_%d_%s.csv',_0x5c238d['id'],_0x266efb));}else{return _0x4ed6a7[_0xf0ed('0x1d')](0xcc);}})[_0xf0ed('0x4c')](handleError(_0x4ed6a7,null));};exports[_0xf0ed('0x7c')]=function(_0x126f1a,_0x1107e0,_0x5c448f){var _0x46cfa2;delete _0x126f1a[_0xf0ed('0x50')]['id'];return db['CmList']['findOne']({'where':{'id':_0x126f1a['params']['id']}})['then'](handleEntityNotFound(_0x1107e0,null))[_0xf0ed('0x28')](function(_0xf612e2){if(_0xf612e2){return db[_0xf0ed('0x7d')][_0xf0ed('0x7e')](function(_0x5919f3){return db['CmCustomField'][_0xf0ed('0x4f')](_0x126f1a[_0xf0ed('0x50')],{'transaction':_0x5919f3})['then'](function(_0x634f6){_0x46cfa2=_0x634f6;return _0xf612e2[_0xf0ed('0x7f')](_0x634f6,{'transaction':_0x5919f3});})[_0xf0ed('0x28')](function(){var _0x544236={'type':db['Sequelize']['TEXT'],'transaction':_0x5919f3};switch(_0x126f1a[_0xf0ed('0x50')][_0xf0ed('0x33')]){case _0xf0ed('0x80'):_0x544236[_0xf0ed('0x33')]=db[_0xf0ed('0x81')][_0xf0ed('0x82')];break;case _0xf0ed('0x83'):_0x544236[_0xf0ed('0x33')]=db[_0xf0ed('0x81')][_0xf0ed('0x84')];break;case _0xf0ed('0x85'):_0x544236['type']=db[_0xf0ed('0x81')][_0xf0ed('0x86')];_0x544236[_0xf0ed('0x87')]=![];break;default:}return db[_0xf0ed('0x7d')][_0xf0ed('0x88')][_0xf0ed('0x89')](_0xf0ed('0x8a'),util[_0xf0ed('0x6c')]('cf_%s',_0x46cfa2['id']),_0x544236);})['then'](function(){return _0x46cfa2;});});}})['then'](respondWithResult(_0x1107e0,null))[_0xf0ed('0x4c')](handleError(_0x1107e0,null));};exports[_0xf0ed('0x8b')]=function(_0x5e10f0,_0x29144b,_0x5530a9){var _0x422957={};var _0x1e88dd={};var _0x52d70e;var _0x568080;return db[_0xf0ed('0x49')][_0xf0ed('0x5b')]({'where':{'id':_0x5e10f0['params']['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x29144b,null))[_0xf0ed('0x28')](function(_0x852f64){if(_0x852f64){_0x52d70e=_0x852f64;_0x1e88dd[_0xf0ed('0x3a')]=_['keys'](db[_0xf0ed('0x6a')]['rawAttributes']);_0x1e88dd[_0xf0ed('0x36')]=_[_0xf0ed('0x37')](_0x5e10f0[_0xf0ed('0x36')]);_0x1e88dd['filters']=_['intersection'](_0x1e88dd['model'],_0x1e88dd[_0xf0ed('0x36')]);_0x422957[_0xf0ed('0x3c')]=_[_0xf0ed('0x39')](_0x1e88dd[_0xf0ed('0x3a')],qs[_0xf0ed('0x3b')](_0x5e10f0[_0xf0ed('0x36')][_0xf0ed('0x3b')]));_0x422957[_0xf0ed('0x3c')]=_0x422957[_0xf0ed('0x3c')][_0xf0ed('0x3d')]?_0x422957['attributes']:_0x1e88dd[_0xf0ed('0x3a')];_0x422957[_0xf0ed('0x3f')]=qs[_0xf0ed('0x40')](_0x5e10f0[_0xf0ed('0x36')][_0xf0ed('0x40')]);_0x422957[_0xf0ed('0x43')]=qs[_0xf0ed('0x38')](_['pick'](_0x5e10f0[_0xf0ed('0x36')],_0x1e88dd[_0xf0ed('0x38')]));_0x422957[_0xf0ed('0x43')]=_['merge'](_0x422957['where'],{'$or':[{'ListId':_0x852f64['id']},{'ListId':null}]});if(_0x5e10f0[_0xf0ed('0x36')][_0xf0ed('0x42')]){_0x422957[_0xf0ed('0x43')]=_[_0xf0ed('0x44')](_0x422957[_0xf0ed('0x43')],{'$or':_[_0xf0ed('0x31')](_0x422957[_0xf0ed('0x3c')],function(_0x43c752){var _0x953cf1={};_0x953cf1[_0x43c752]={'$like':'%'+_0x5e10f0['query']['filter']+'%'};return _0x953cf1;})});}_0x422957=_['merge']({},_0x422957,_0x5e10f0[_0xf0ed('0x46')]);return db['CmCustomField'][_0xf0ed('0x8c')](_0x422957);}})[_0xf0ed('0x28')](respondWithResult(_0x29144b,null))[_0xf0ed('0x4c')](handleError(_0x29144b,null));};exports['addAgents']=function(_0x2ceb4b,_0x5b8192,_0xf9f6ef){return db[_0xf0ed('0x49')][_0xf0ed('0x4e')]({'where':{'id':_0x2ceb4b[_0xf0ed('0x57')]['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x5b8192,null))[_0xf0ed('0x28')](function(_0x4a8bcc){if(_0x4a8bcc){return _0x4a8bcc[_0xf0ed('0x8d')](_0x2ceb4b[_0xf0ed('0x50')][_0xf0ed('0x8e')],_[_0xf0ed('0x65')](_0x2ceb4b['body'],[_0xf0ed('0x8e'),'id'])||{})[_0xf0ed('0x8f')](function(_0x5bf028){for(var _0x226ff4=0x0;_0x226ff4<_0x2ceb4b[_0xf0ed('0x50')][_0xf0ed('0x8e')][_0xf0ed('0x3d')];_0x226ff4+=0x1){socket[_0xf0ed('0x90')]('userCmList:save',{'UserId':Number(_0x2ceb4b[_0xf0ed('0x50')][_0xf0ed('0x8e')][_0x226ff4]),'CmListId':Number(_0x2ceb4b[_0xf0ed('0x57')]['id'])});}return _0x5bf028;});}})['then'](respondWithResult(_0x5b8192,null))[_0xf0ed('0x4c')](handleError(_0x5b8192,null));};exports[_0xf0ed('0x91')]=function(_0x45b205,_0x2cdab1,_0x2e0773){return db[_0xf0ed('0x49')]['find']({'where':{'id':_0x45b205[_0xf0ed('0x57')]['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x2cdab1,null))['then'](function(_0xda04ae){if(_0xda04ae){return _0xda04ae[_0xf0ed('0x91')](_0x45b205[_0xf0ed('0x36')][_0xf0ed('0x8e')])[_0xf0ed('0x28')](function(){if(_[_0xf0ed('0x62')](_0x45b205['query']['ids'])){for(var _0x136654=0x0;_0x136654<_0x45b205[_0xf0ed('0x36')][_0xf0ed('0x8e')]['length'];_0x136654+=0x1){socket[_0xf0ed('0x90')](_0xf0ed('0x92'),{'UserId':Number(_0x45b205[_0xf0ed('0x36')]['ids'][_0x136654]),'CmListId':Number(_0x45b205[_0xf0ed('0x57')]['id'])});}}else{socket[_0xf0ed('0x90')]('userCmList:remove',{'UserId':Number(_0x45b205['query'][_0xf0ed('0x8e')]),'CmListId':Number(_0x45b205[_0xf0ed('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cdab1,null))[_0xf0ed('0x4c')](handleError(_0x2cdab1,null));};exports['getAgents']=function(_0x57eae1,_0x57605a,_0x34eaed){var _0x3b4f9c={};var _0x20df21={};var _0x79e23b;var _0x5bb96c;return db[_0xf0ed('0x49')][_0xf0ed('0x5b')]({'where':{'id':_0x57eae1[_0xf0ed('0x57')]['id']}})[_0xf0ed('0x28')](handleEntityNotFound(_0x57605a,null))['then'](function(_0x2b228c){if(_0x2b228c){_0x79e23b=_0x2b228c;_0x20df21[_0xf0ed('0x3a')]=_['keys'](db['User'][_0xf0ed('0x32')]);_0x20df21[_0xf0ed('0x36')]=_[_0xf0ed('0x37')](_0x57eae1[_0xf0ed('0x36')]);_0x20df21['filters']=_[_0xf0ed('0x39')](_0x20df21['model'],_0x20df21[_0xf0ed('0x36')]);_0x3b4f9c[_0xf0ed('0x3c')]=_[_0xf0ed('0x39')](_0x20df21[_0xf0ed('0x3a')],qs[_0xf0ed('0x3b')](_0x57eae1[_0xf0ed('0x36')]['fields']));_0x3b4f9c['attributes']=_0x3b4f9c['attributes']['length']?_0x3b4f9c['attributes']:_0x20df21[_0xf0ed('0x3a')];_0x3b4f9c[_0xf0ed('0x3f')]=qs[_0xf0ed('0x40')](_0x57eae1[_0xf0ed('0x36')][_0xf0ed('0x40')]);_0x3b4f9c[_0xf0ed('0x43')]=qs[_0xf0ed('0x38')](_[_0xf0ed('0x41')](_0x57eae1['query'],_0x20df21[_0xf0ed('0x38')]));if(_0x57eae1[_0xf0ed('0x36')][_0xf0ed('0x42')]){_0x3b4f9c[_0xf0ed('0x43')]=_[_0xf0ed('0x44')](_0x3b4f9c[_0xf0ed('0x43')],{'$or':_['map'](_0x3b4f9c[_0xf0ed('0x3c')],function(_0x29b4c2){var _0x40e00f={};_0x40e00f[_0x29b4c2]={'$like':'%'+_0x57eae1['query'][_0xf0ed('0x42')]+'%'};return _0x40e00f;})});}_0x3b4f9c=_[_0xf0ed('0x44')]({},_0x3b4f9c,_0x57eae1[_0xf0ed('0x46')]);return _0x79e23b[_0xf0ed('0x93')](_0x3b4f9c);}})[_0xf0ed('0x28')](function(_0x278402){if(_0x278402){_0x5bb96c=_0x278402[_0xf0ed('0x3d')];if(!_0x57eae1[_0xf0ed('0x36')][_0xf0ed('0x5d')](_0xf0ed('0x3e'))){_0x3b4f9c[_0xf0ed('0x22')]=qs[_0xf0ed('0x22')](_0x57eae1[_0xf0ed('0x36')][_0xf0ed('0x22')]);_0x3b4f9c['offset']=qs[_0xf0ed('0x21')](_0x57eae1[_0xf0ed('0x36')][_0xf0ed('0x21')]);}return _0x79e23b[_0xf0ed('0x93')](_0x3b4f9c);}})[_0xf0ed('0x28')](function(_0x42c0f5){if(_0x42c0f5){return _0x42c0f5?{'count':_0x5bb96c,'rows':_0x42c0f5}:null;}})['then'](respondWithResult(_0x57605a,null))[_0xf0ed('0x4c')](handleError(_0x57605a,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6e371bc..577d9e0 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x5fc3,0xa8));var _0x35fc=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x5fc3[_0x10291b];return _0x1d5fbe;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x5fc3[_0x22e47a];return _0x15a12a;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index dc6d60a..0f02745 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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x21a11e,_0x2bb7db){var _0x55e5a3=function(_0x8e02fe){while(--_0x8e02fe){_0x21a11e['push'](_0x21a11e['shift']());}};_0x55e5a3(++_0x2bb7db);}(_0x54ef,0x112));var _0xf54e=function(_0x41d2f9,_0x67c430){_0x41d2f9=_0x41d2f9-0x0;var _0x20a280=_0x54ef[_0x41d2f9];return _0x20a280;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x26a5a0,_0xfa3023){var _0xc0cfe6=function(_0x396689){while(--_0x396689){_0x26a5a0['push'](_0x26a5a0['shift']());}};_0xc0cfe6(++_0xfa3023);}(_0x3c81,0x102));var _0x13c8=function(_0x49c2e7,_0x410b84){_0x49c2e7=_0x49c2e7-0x0;var _0x173ba2=_0x3c81[_0x49c2e7];return _0x173ba2;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 2328e61..c83dd40 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 _0xb559=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x5c374e,_0x41141b){var _0xebf39d=function(_0x68c64e){while(--_0x68c64e){_0x5c374e['push'](_0x5c374e['shift']());}};_0xebf39d(++_0x41141b);}(_0xb559,0x194));var _0x9b55=function(_0x48f80a,_0x3bb5d4){_0x48f80a=_0x48f80a-0x0;var _0x1327fb=_0xb559[_0x48f80a];return _0x1327fb;};'use strict';var _=require(_0x9b55('0x0'));var util=require(_0x9b55('0x1'));var moment=require(_0x9b55('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b55('0x3'));var db=require(_0x9b55('0x4'))['db'];var utils=require(_0x9b55('0x5'));var logger=require(_0x9b55('0x6'))('rpc');var config=require(_0x9b55('0x7'));var jayson=require(_0x9b55('0x8'));var client=jayson[_0x9b55('0x9')][_0x9b55('0xa')]({'port':0x232a});config[_0x9b55('0xb')]=_[_0x9b55('0xc')](config[_0x9b55('0xb')],{'host':_0x9b55('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b55('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4e9f14,_0xd11829,_0x575240){return new BPromise(function(_0x3e4061,_0x67423c){return client['request'](_0x4e9f14,_0x575240)['then'](function(_0xa45e75){logger[_0x9b55('0xe')](_0x9b55('0xf'),_0xd11829,_0x9b55('0x10'));logger[_0x9b55('0x11')](_0x9b55('0x12'),_0xd11829,_0x9b55('0x10'),JSON[_0x9b55('0x13')](_0xa45e75));if(_0xa45e75[_0x9b55('0x14')]){if(_0xa45e75[_0x9b55('0x14')][_0x9b55('0x15')]===0x1f4){logger[_0x9b55('0x14')](_0x9b55('0xf'),_0xd11829,_0xa45e75['error']['message']);return _0x67423c(_0xa45e75[_0x9b55('0x14')][_0x9b55('0x16')]);}logger[_0x9b55('0x14')](_0x9b55('0xf'),_0xd11829,_0xa45e75[_0x9b55('0x14')][_0x9b55('0x16')]);return _0x3e4061(_0xa45e75[_0x9b55('0x14')][_0x9b55('0x16')]);}else{logger['info'](_0x9b55('0xf'),_0xd11829,_0x9b55('0x10'));_0x3e4061(_0xa45e75[_0x9b55('0x17')][_0x9b55('0x16')]);}})['catch'](function(_0x30671d){logger['error']('CmList,\x20%s,\x20%s',_0xd11829,_0x30671d);_0x67423c(_0x30671d);});});} \ No newline at end of file +var _0x7223=['request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x47d44e,_0x4ce58c){var _0x218f05=function(_0x28ca5e){while(--_0x28ca5e){_0x47d44e['push'](_0x47d44e['shift']());}};_0x218f05(++_0x4ce58c);}(_0x7223,0x172));var _0x3722=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7223[_0x45783c];return _0x1161da;};'use strict';var _=require('lodash');var util=require(_0x3722('0x0'));var moment=require(_0x3722('0x1'));var BPromise=require('bluebird');var rs=require(_0x3722('0x2'));var fs=require('fs');var Redis=require(_0x3722('0x3'));var db=require(_0x3722('0x4'))['db'];var utils=require(_0x3722('0x5'));var logger=require(_0x3722('0x6'))(_0x3722('0x7'));var config=require('../../config/environment');var jayson=require(_0x3722('0x8'));var client=jayson[_0x3722('0x9')][_0x3722('0xa')]({'port':0x232a});config[_0x3722('0xb')]=_[_0x3722('0xc')](config[_0x3722('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3722('0xd'))(new Redis(config[_0x3722('0xb')]));require(_0x3722('0xe'))[_0x3722('0xf')](socket);function respondWithRpcPromise(_0x2002d7,_0x3a941f,_0x3e4bf4){return new BPromise(function(_0x2596cb,_0x150d9f){return client[_0x3722('0x10')](_0x2002d7,_0x3e4bf4)[_0x3722('0x11')](function(_0x4ebe42){logger[_0x3722('0x12')](_0x3722('0x13'),_0x3a941f,_0x3722('0x14'));logger[_0x3722('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x3a941f,_0x3722('0x14'),JSON[_0x3722('0x16')](_0x4ebe42));if(_0x4ebe42[_0x3722('0x17')]){if(_0x4ebe42[_0x3722('0x17')]['code']===0x1f4){logger[_0x3722('0x17')]('CmList,\x20%s,\x20%s',_0x3a941f,_0x4ebe42[_0x3722('0x17')][_0x3722('0x18')]);return _0x150d9f(_0x4ebe42[_0x3722('0x17')][_0x3722('0x18')]);}logger['error']('CmList,\x20%s,\x20%s',_0x3a941f,_0x4ebe42['error']['message']);return _0x2596cb(_0x4ebe42[_0x3722('0x17')]['message']);}else{logger[_0x3722('0x12')](_0x3722('0x13'),_0x3a941f,'request\x20sent');_0x2596cb(_0x4ebe42[_0x3722('0x19')][_0x3722('0x18')]);}})['catch'](function(_0x1cf9ae){logger[_0x3722('0x17')](_0x3722('0x13'),_0x3a941f,_0x1cf9ae);_0x150d9f(_0x1cf9ae);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index c4ab0eb..20b7c07 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 _0xd704=['update','emit','removeListener','register','length','./cmList.events','remove'];(function(_0x444bce,_0x2b189c){var _0x4f4520=function(_0x534525){while(--_0x534525){_0x444bce['push'](_0x444bce['shift']());}};_0x4f4520(++_0x2b189c);}(_0xd704,0xd0));var _0x4d70=function(_0x4f897d,_0x24d781){_0x4f897d=_0x4f897d-0x0;var _0x5546fb=_0xd704[_0x4f897d];return _0x5546fb;};'use strict';var CmListEvents=require(_0x4d70('0x0'));var events=['save',_0x4d70('0x1'),_0x4d70('0x2')];function createListener(_0x53af0c,_0x436091){return function(_0x577670){_0x436091[_0x4d70('0x3')](_0x53af0c,_0x577670);};}function removeListener(_0x1574fa,_0x2c3657){return function(){CmListEvents[_0x4d70('0x4')](_0x1574fa,_0x2c3657);};}exports[_0x4d70('0x5')]=function(_0xc3b24b){for(var _0x48839f=0x0,_0x503a5e=events[_0x4d70('0x6')];_0x48839f<_0x503a5e;_0x48839f++){var _0x6bbf4f=events[_0x48839f];var _0x3c61cd=createListener('cmList:'+_0x6bbf4f,_0xc3b24b);CmListEvents['on'](_0x6bbf4f,_0x3c61cd);}}; \ No newline at end of file +var _0xa13d=['emit','register','length','cmList:','./cmList.events','remove','update'];(function(_0x45b882,_0x11fc3e){var _0x2523d7=function(_0x53d3e9){while(--_0x53d3e9){_0x45b882['push'](_0x45b882['shift']());}};_0x2523d7(++_0x11fc3e);}(_0xa13d,0x154));var _0xda13=function(_0x1ef5ec,_0x4d47ae){_0x1ef5ec=_0x1ef5ec-0x0;var _0x4fbad7=_0xa13d[_0x1ef5ec];return _0x4fbad7;};'use strict';var CmListEvents=require(_0xda13('0x0'));var events=['save',_0xda13('0x1'),_0xda13('0x2')];function createListener(_0x558451,_0x3549a5){return function(_0x52c2c5){_0x3549a5[_0xda13('0x3')](_0x558451,_0x52c2c5);};}function removeListener(_0x208aa8,_0x56837b){return function(){CmListEvents['removeListener'](_0x208aa8,_0x56837b);};}exports[_0xda13('0x4')]=function(_0x3d5a0e){for(var _0x4df317=0x0,_0x48cd5f=events[_0xda13('0x5')];_0x4df317<_0x48cd5f;_0x4df317++){var _0x2584c5=events[_0x4df317];var _0x51fa1b=createListener(_0xda13('0x6')+_0x2584c5,_0x3d5a0e);CmListEvents['on'](_0x2584c5,_0x51fa1b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4ddbd7c..608598a 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 _0xdb4c=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe'];(function(_0x1e88eb,_0x186ef3){var _0x5dafcb=function(_0x51ffd4){while(--_0x51ffd4){_0x1e88eb['push'](_0x1e88eb['shift']());}};_0x5dafcb(++_0x186ef3);}(_0xdb4c,0x1dc));var _0xcdb4=function(_0x2ac2fa,_0x45fcbd){_0x2ac2fa=_0x2ac2fa-0x0;var _0x446364=_0xdb4c[_0x2ac2fa];return _0x446364;};'use strict';var multer=require(_0xcdb4('0x0'));var util=require(_0xcdb4('0x1'));var path=require(_0xcdb4('0x2'));var timeout=require(_0xcdb4('0x3'));var express=require(_0xcdb4('0x4'));var router=express['Router']();var fs_extra=require(_0xcdb4('0x5'));var auth=require(_0xcdb4('0x6'));var interaction=require(_0xcdb4('0x7'));var config=require(_0xcdb4('0x8'));var controller=require(_0xcdb4('0x9'));router[_0xcdb4('0xa')]('/',auth[_0xcdb4('0xb')](),controller['index']);router[_0xcdb4('0xa')](_0xcdb4('0xc'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0xd')]);router['get'](_0xcdb4('0xe'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0xf')]);router[_0xcdb4('0xa')](_0xcdb4('0x10'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x11')]);router[_0xcdb4('0xa')](_0xcdb4('0x12'),auth[_0xcdb4('0xb')](),controller['getContacts']);router[_0xcdb4('0xa')]('/:id/contacts/csv',auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x13')]);router[_0xcdb4('0xa')](_0xcdb4('0x14'),auth['isAuthenticated'](),controller[_0xcdb4('0x15')]);router['get'](_0xcdb4('0x16'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x17')]);router[_0xcdb4('0x18')]('/',auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x19')]);router[_0xcdb4('0x18')]('/:id/dispositions',auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x1a')]);router['post'](_0xcdb4('0x12'),auth['isAuthenticated'](),controller['addContacts']);router['post'](_0xcdb4('0x14'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x1b')]);router[_0xcdb4('0x18')](_0xcdb4('0x16'),auth['isAuthenticated'](),controller[_0xcdb4('0x1c')]);router[_0xcdb4('0x1d')](_0xcdb4('0xe'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x1e')]);router['delete'](_0xcdb4('0xe'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x1f')]);router[_0xcdb4('0x20')](_0xcdb4('0x10'),auth[_0xcdb4('0xb')](),controller[_0xcdb4('0x21')]);router['delete'](_0xcdb4('0x16'),auth['isAuthenticated'](),controller[_0xcdb4('0x22')]);module['exports']=router; \ No newline at end of file +var _0x0bf4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','update','delete','removeDispositions','removeAgents','exports','multer'];(function(_0x1f2d10,_0x4dab0b){var _0x31cb34=function(_0x3d7743){while(--_0x3d7743){_0x1f2d10['push'](_0x1f2d10['shift']());}};_0x31cb34(++_0x4dab0b);}(_0x0bf4,0x180));var _0x40bf=function(_0xd46227,_0x18477f){_0xd46227=_0xd46227-0x0;var _0x2a980d=_0x0bf4[_0xd46227];return _0x2a980d;};'use strict';var multer=require(_0x40bf('0x0'));var util=require('util');var path=require(_0x40bf('0x1'));var timeout=require(_0x40bf('0x2'));var express=require(_0x40bf('0x3'));var router=express[_0x40bf('0x4')]();var fs_extra=require(_0x40bf('0x5'));var auth=require(_0x40bf('0x6'));var interaction=require(_0x40bf('0x7'));var config=require('../../config/environment');var controller=require(_0x40bf('0x8'));router[_0x40bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x40bf('0xa')]);router['get']('/describe',auth[_0x40bf('0xb')](),controller[_0x40bf('0xc')]);router[_0x40bf('0x9')](_0x40bf('0xd'),auth[_0x40bf('0xb')](),controller[_0x40bf('0xe')]);router['get'](_0x40bf('0xf'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x10')]);router[_0x40bf('0x9')](_0x40bf('0x11'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x12')]);router[_0x40bf('0x9')](_0x40bf('0x13'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x14')]);router['get'](_0x40bf('0x15'),auth['isAuthenticated'](),controller[_0x40bf('0x16')]);router[_0x40bf('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x40bf('0x17')]);router[_0x40bf('0x18')]('/',auth[_0x40bf('0xb')](),controller[_0x40bf('0x19')]);router[_0x40bf('0x18')](_0x40bf('0xf'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x1a')]);router[_0x40bf('0x18')]('/:id/contacts',auth[_0x40bf('0xb')](),controller[_0x40bf('0x1b')]);router[_0x40bf('0x18')]('/:id/fields',auth[_0x40bf('0xb')](),controller[_0x40bf('0x1c')]);router[_0x40bf('0x18')](_0x40bf('0x1d'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x40bf('0xd'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x1e')]);router[_0x40bf('0x1f')](_0x40bf('0xd'),auth[_0x40bf('0xb')](),controller['destroy']);router[_0x40bf('0x1f')](_0x40bf('0xf'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x20')]);router['delete'](_0x40bf('0x1d'),auth[_0x40bf('0xb')](),controller[_0x40bf('0x21')]);module[_0x40bf('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 6e82f02..c0f2d9c 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 _0xab4f=['sequelize','exports','VIRTUAL','STRING'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xab4f,0xbc));var _0xfab4=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xab4f[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0xfab4('0x0'));module[_0xfab4('0x1')]={'name':{'type':Sequelize[_0xfab4('0x2')],'get':function(_0x27ed9f){return this['getDataValue']('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xfab4('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xfab4('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xeb83=['exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x310c87,_0xad934d){var _0xd67cb4=function(_0x28ff86){while(--_0x28ff86){_0x310c87['push'](_0x310c87['shift']());}};_0xd67cb4(++_0xad934d);}(_0xeb83,0x11d));var _0x3eb8=function(_0x30c30e,_0x483c4e){_0x30c30e=_0x30c30e-0x0;var _0xf9220b=_0xeb83[_0x30c30e];return _0xf9220b;};'use strict';var Sequelize=require('sequelize');module[_0x3eb8('0x0')]={'name':{'type':Sequelize[_0x3eb8('0x1')],'get':function(_0x10365c){return this[_0x3eb8('0x2')](_0x3eb8('0x3'));}},'field':{'type':Sequelize[_0x3eb8('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x3eb8('0x4')],'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 e85ec46..b3e96ca 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(_0x438abc,_0x150145){var _0x20d24b=function(_0x55bfc7){while(--_0x55bfc7){_0x438abc['push'](_0x438abc['shift']());}};_0x20d24b(++_0x150145);}(_0x7a54,0x106));var _0x47a5=function(_0x395e4f,_0x4159a6){_0x395e4f=_0x395e4f-0x0;var _0x1dbacd=_0x7a54[_0x395e4f];return _0x1dbacd;};'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(_0x538a10,_0x107a85){var _0x4fe629=function(_0x256d4b){while(--_0x256d4b){_0x538a10['push'](_0x538a10['shift']());}};_0x4fe629(++_0x107a85);}(_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){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 8b64d94..5e09ed2 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 _0x6dee=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','Condition','lodash'];(function(_0x1762c4,_0x458ac5){var _0x5075a8=function(_0x371c56){while(--_0x371c56){_0x1762c4['push'](_0x1762c4['shift']());}};_0x5075a8(++_0x458ac5);}(_0x6dee,0x81));var _0xe6de=function(_0x45b46f,_0x291dbb){_0x45b46f=_0x45b46f-0x0;var _0x584441=_0x6dee[_0x45b46f];return _0x584441;};'use strict';var _=require(_0xe6de('0x0'));var util=require(_0xe6de('0x1'));var logger=require(_0xe6de('0x2'))(_0xe6de('0x3'));var moment=require(_0xe6de('0x4'));var BPromise=require('bluebird');var rp=require(_0xe6de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe6de('0x6'));var config=require(_0xe6de('0x7'));var attributes=require('./condition.attributes');module[_0xe6de('0x8')]=function(_0x2c82d4,_0x37bbe0){return _0x2c82d4['define'](_0xe6de('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3990=['../../config/logger','api','moment','request-promise','./condition.attributes','tools_conditions','lodash'];(function(_0x4cae63,_0x506211){var _0x65d08=function(_0x467fa1){while(--_0x467fa1){_0x4cae63['push'](_0x4cae63['shift']());}};_0x65d08(++_0x506211);}(_0x3990,0xa7));var _0x0399=function(_0x427d3c,_0xf5efc7){_0x427d3c=_0x427d3c-0x0;var _0x3c041e=_0x3990[_0x427d3c];return _0x3c041e;};'use strict';var _=require(_0x0399('0x0'));var util=require('util');var logger=require(_0x0399('0x1'))(_0x0399('0x2'));var moment=require(_0x0399('0x3'));var BPromise=require('bluebird');var rp=require(_0x0399('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0399('0x5'));module['exports']=function(_0x2f7b2b,_0x375f19){return _0x2f7b2b['define']('Condition',attributes,{'tableName':_0x0399('0x6'),'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 eb01dc8..f755df9 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 _0x11f2=['then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3b5357,_0x1fbdde){var _0x9dce83=function(_0xa0807a){while(--_0xa0807a){_0x3b5357['push'](_0x3b5357['shift']());}};_0x9dce83(++_0x1fbdde);}(_0x11f2,0x9b));var _0x211f=function(_0x8b0e80,_0x3f21b5){_0x8b0e80=_0x8b0e80-0x0;var _0x270535=_0x11f2[_0x8b0e80];return _0x270535;};'use strict';var _=require('lodash');var util=require(_0x211f('0x0'));var moment=require(_0x211f('0x1'));var BPromise=require(_0x211f('0x2'));var rs=require(_0x211f('0x3'));var fs=require('fs');var Redis=require(_0x211f('0x4'));var db=require(_0x211f('0x5'))['db'];var utils=require(_0x211f('0x6'));var logger=require(_0x211f('0x7'))(_0x211f('0x8'));var config=require(_0x211f('0x9'));var jayson=require(_0x211f('0xa'));var client=jayson[_0x211f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3970c4,_0x35f8e3,_0x5d5b8c){return new BPromise(function(_0x5caca3,_0x5d4f7f){return client[_0x211f('0xc')](_0x3970c4,_0x5d5b8c)[_0x211f('0xd')](function(_0x3075d0){logger[_0x211f('0xe')](_0x211f('0xf'),_0x35f8e3,'request\x20sent');logger[_0x211f('0x10')](_0x211f('0x11'),_0x35f8e3,_0x211f('0x12'),JSON[_0x211f('0x13')](_0x3075d0));if(_0x3075d0[_0x211f('0x14')]){if(_0x3075d0[_0x211f('0x14')]['code']===0x1f4){logger[_0x211f('0x14')](_0x211f('0xf'),_0x35f8e3,_0x3075d0['error']['message']);return _0x5d4f7f(_0x3075d0[_0x211f('0x14')][_0x211f('0x15')]);}logger['error']('Condition,\x20%s,\x20%s',_0x35f8e3,_0x3075d0[_0x211f('0x14')][_0x211f('0x15')]);return _0x5caca3(_0x3075d0[_0x211f('0x14')][_0x211f('0x15')]);}else{logger[_0x211f('0xe')](_0x211f('0xf'),_0x35f8e3,_0x211f('0x12'));_0x5caca3(_0x3075d0[_0x211f('0x16')][_0x211f('0x15')]);}})[_0x211f('0x17')](function(_0x89f68f){logger[_0x211f('0x14')](_0x211f('0xf'),_0x35f8e3,_0x89f68f);_0x5d4f7f(_0x89f68f);});});} \ No newline at end of file +var _0x3a64=['message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2acd99,_0x55a1a4){var _0x44bf61=function(_0x27b0e6){while(--_0x27b0e6){_0x2acd99['push'](_0x2acd99['shift']());}};_0x44bf61(++_0x55a1a4);}(_0x3a64,0x71));var _0x43a6=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x3a64[_0x47a349];return _0x18ab75;};'use strict';var _=require('lodash');var util=require(_0x43a6('0x0'));var moment=require(_0x43a6('0x1'));var BPromise=require(_0x43a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43a6('0x3'))['db'];var utils=require(_0x43a6('0x4'));var logger=require(_0x43a6('0x5'))(_0x43a6('0x6'));var config=require(_0x43a6('0x7'));var jayson=require(_0x43a6('0x8'));var client=jayson[_0x43a6('0x9')][_0x43a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf141a,_0x28fac3,_0x1d98ec){return new BPromise(function(_0x12cdaa,_0x3a19ab){return client['request'](_0xf141a,_0x1d98ec)[_0x43a6('0xb')](function(_0x211dfd){logger[_0x43a6('0xc')](_0x43a6('0xd'),_0x28fac3,_0x43a6('0xe'));logger[_0x43a6('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x28fac3,'request\x20sent',JSON[_0x43a6('0x10')](_0x211dfd));if(_0x211dfd[_0x43a6('0x11')]){if(_0x211dfd[_0x43a6('0x11')][_0x43a6('0x12')]===0x1f4){logger[_0x43a6('0x11')](_0x43a6('0xd'),_0x28fac3,_0x211dfd[_0x43a6('0x11')]['message']);return _0x3a19ab(_0x211dfd[_0x43a6('0x11')][_0x43a6('0x13')]);}logger[_0x43a6('0x11')](_0x43a6('0xd'),_0x28fac3,_0x211dfd['error'][_0x43a6('0x13')]);return _0x12cdaa(_0x211dfd[_0x43a6('0x11')][_0x43a6('0x13')]);}else{logger[_0x43a6('0xc')](_0x43a6('0xd'),_0x28fac3,_0x43a6('0xe'));_0x12cdaa(_0x211dfd[_0x43a6('0x14')][_0x43a6('0x13')]);}})[_0x43a6('0x15')](function(_0x38105d){logger[_0x43a6('0x11')](_0x43a6('0xd'),_0x28fac3,_0x38105d);_0x3a19ab(_0x38105d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5376469..bf57f5c 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 _0xcffd=['multer','util','path','Router','../../components/auth/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports'];(function(_0x5e5a72,_0x3811ba){var _0x6bf9c2=function(_0x54e443){while(--_0x54e443){_0x5e5a72['push'](_0x5e5a72['shift']());}};_0x6bf9c2(++_0x3811ba);}(_0xcffd,0x188));var _0xdcff=function(_0x437191,_0x3dfedc){_0x437191=_0x437191-0x0;var _0x3b5d70=_0xcffd[_0x437191];return _0x3b5d70;};'use strict';var multer=require(_0xdcff('0x0'));var util=require(_0xdcff('0x1'));var path=require(_0xdcff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdcff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdcff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdcff('0x5'));var controller=require(_0xdcff('0x6'));router[_0xdcff('0x7')]('/:id',auth[_0xdcff('0x8')](),controller[_0xdcff('0x9')]);router[_0xdcff('0xa')](_0xdcff('0xb'),auth[_0xdcff('0x8')](),controller[_0xdcff('0xc')]);module[_0xdcff('0xd')]=router; \ No newline at end of file +var _0xa3fd=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x5106c1,_0x13233a){var _0x5bcaac=function(_0x18c12e){while(--_0x18c12e){_0x5106c1['push'](_0x5106c1['shift']());}};_0x5bcaac(++_0x13233a);}(_0xa3fd,0x1c2));var _0xda3f=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0xa3fd[_0x284bc3];return _0x41ac81;};'use strict';var multer=require('multer');var util=require(_0xda3f('0x0'));var path=require('path');var timeout=require(_0xda3f('0x1'));var express=require(_0xda3f('0x2'));var router=express[_0xda3f('0x3')]();var fs_extra=require(_0xda3f('0x4'));var auth=require(_0xda3f('0x5'));var interaction=require(_0xda3f('0x6'));var config=require(_0xda3f('0x7'));var controller=require(_0xda3f('0x8'));router[_0xda3f('0x9')](_0xda3f('0xa'),auth[_0xda3f('0xb')](),controller['update']);router[_0xda3f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xda3f('0xd')]);module[_0xda3f('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9d1de9c..9532816 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(_0x14c300,_0x18bf25){var _0x4753ae=function(_0x367c1c){while(--_0x367c1c){_0x14c300['push'](_0x14c300['shift']());}};_0x4753ae(++_0x18bf25);}(_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 _0xbaf0=['name','exports','STRING'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 5a6264a..ed3c057 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 _0x0796=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','get','CustomDashboards','destroy','then','end','error','stack','name','send','index','map','Dashboard','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','clone','params','omit','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0x0796,0x6b));var _0x6079=function(_0x3ca63c,_0x3d5ffa){_0x3ca63c=_0x3ca63c-0x0;var _0x5097dd=_0x0796[_0x3ca63c];return _0x5097dd;};'use strict';var emlformat=require(_0x6079('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6079('0x1'));var jsonpatch=require(_0x6079('0x2'));var rp=require(_0x6079('0x3'));var moment=require(_0x6079('0x4'));var BPromise=require(_0x6079('0x5'));var Mustache=require('mustache');var util=require(_0x6079('0x6'));var path=require(_0x6079('0x7'));var sox=require(_0x6079('0x8'));var csv=require(_0x6079('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6079('0xa'));var _=require(_0x6079('0xb'));var squel=require('squel');var crypto=require(_0x6079('0xc'));var jsforce=require(_0x6079('0xd'));var deskjs=require(_0x6079('0xe'));var toCsv=require(_0x6079('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6079('0xf'));var authService=require(_0x6079('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6079('0x11'));var hardwareService=require(_0x6079('0x12'));var logger=require(_0x6079('0x13'))(_0x6079('0x14'));var utils=require('../../config/utils');var config=require(_0x6079('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6079('0x16'))['db'];config[_0x6079('0x17')]=_[_0x6079('0x18')](config[_0x6079('0x17')],{'host':_0x6079('0x19'),'port':0x18eb});var socket=require(_0x6079('0x1a'))(new Redis(config[_0x6079('0x17')]));require('./dashboard.socket')[_0x6079('0x1b')](socket);function respondWithStatusCode(_0x555dc5,_0xf9f2f8){_0xf9f2f8=_0xf9f2f8||0xcc;return function(_0x28e7e3){if(_0x28e7e3){return _0x555dc5[_0x6079('0x1c')](_0xf9f2f8);}return _0x555dc5[_0x6079('0x1d')](_0xf9f2f8)['end']();};}function respondWithResult(_0x3ff093,_0x576797){_0x576797=_0x576797||0xc8;return function(_0x3abf5e){if(_0x3abf5e){return _0x3ff093['status'](_0x576797)[_0x6079('0x1e')](_0x3abf5e);}};}function respondWithFilteredResult(_0x37530c,_0x173cb8){return function(_0x1968d9){if(_0x1968d9){var _0x279453=typeof _0x173cb8[_0x6079('0x1f')]===_0x6079('0x20')&&typeof _0x173cb8['limit']===_0x6079('0x20');var _0x1aae2b=_0x1968d9[_0x6079('0x21')];var _0x2c4197=_0x279453?0x0:_0x173cb8['offset'];var _0x248da8=_0x279453?_0x1968d9[_0x6079('0x21')]:_0x173cb8[_0x6079('0x1f')]+_0x173cb8['limit'];var _0x4f304f;if(_0x248da8>=_0x1aae2b){_0x248da8=_0x1aae2b;_0x4f304f=0xc8;}else{_0x4f304f=0xce;}_0x37530c[_0x6079('0x1d')](_0x4f304f);return _0x37530c[_0x6079('0x22')](_0x6079('0x23'),_0x2c4197+'-'+_0x248da8+'/'+_0x1aae2b)[_0x6079('0x1e')](_0x1968d9);}return null;};}function patchUpdates(_0x4a9ec8){return function(_0x19188c){try{jsonpatch[_0x6079('0x24')](_0x19188c,_0x4a9ec8,!![]);}catch(_0x42469f){return BPromise[_0x6079('0x25')](_0x42469f);}return _0x19188c[_0x6079('0x26')]();};}function saveUpdates(_0x4635b5,_0x66424e){return function(_0x10604c){if(_0x10604c){return _0x10604c[_0x6079('0x27')](_0x4635b5)['then'](function(_0x3cfbed){return _0x3cfbed;});}return null;};}function removeEntity(_0x5291af,_0x3e63cf){return function(_0x31ab7a){if(_0x31ab7a){return _0x31ab7a['destroy']()['then'](function(){var _0x4d646a=_0x31ab7a[_0x6079('0x28')]({'plain':!![]});var _0x568558=_0x6079('0x29');return db['UserProfileResource'][_0x6079('0x2a')]({'where':{'type':_0x568558,'resourceId':_0x4d646a['id']}})[_0x6079('0x2b')](function(){return _0x31ab7a;});})[_0x6079('0x2b')](function(){_0x5291af[_0x6079('0x1d')](0xcc)[_0x6079('0x2c')]();});}};}function handleEntityNotFound(_0x2f3fb7,_0x3820a7){return function(_0x1f39b3){if(!_0x1f39b3){_0x2f3fb7[_0x6079('0x1c')](0x194);}return _0x1f39b3;};}function handleError(_0x1bd0ee,_0x2629eb){_0x2629eb=_0x2629eb||0x1f4;return function(_0x5c31fc){logger[_0x6079('0x2d')](_0x5c31fc[_0x6079('0x2e')]);if(_0x5c31fc[_0x6079('0x2f')]){delete _0x5c31fc['name'];}_0x1bd0ee['status'](_0x2629eb)[_0x6079('0x30')](_0x5c31fc);};}exports[_0x6079('0x31')]=function(_0x5a08a7,_0x37da54){var _0x24740c={},_0xdc5c20={},_0x2b33f2={'count':0x0,'rows':[]};var _0x546961=_[_0x6079('0x32')](db[_0x6079('0x33')][_0x6079('0x34')],function(_0x583bb8){return{'name':_0x583bb8['fieldName'],'type':_0x583bb8[_0x6079('0x35')]['key']};});_0xdc5c20[_0x6079('0x36')]=_[_0x6079('0x32')](_0x546961,_0x6079('0x2f'));_0xdc5c20[_0x6079('0x37')]=_[_0x6079('0x38')](_0x5a08a7['query']);_0xdc5c20[_0x6079('0x39')]=_[_0x6079('0x3a')](_0xdc5c20[_0x6079('0x36')],_0xdc5c20[_0x6079('0x37')]);_0x24740c['attributes']=_['intersection'](_0xdc5c20[_0x6079('0x36')],qs['fields'](_0x5a08a7[_0x6079('0x37')][_0x6079('0x3b')]));_0x24740c['attributes']=_0x24740c[_0x6079('0x3c')]['length']?_0x24740c['attributes']:_0xdc5c20[_0x6079('0x36')];if(!_0x5a08a7[_0x6079('0x37')]['hasOwnProperty'](_0x6079('0x3d'))){_0x24740c[_0x6079('0x3e')]=qs[_0x6079('0x3e')](_0x5a08a7['query'][_0x6079('0x3e')]);_0x24740c[_0x6079('0x1f')]=qs[_0x6079('0x1f')](_0x5a08a7[_0x6079('0x37')]['offset']);}_0x24740c[_0x6079('0x3f')]=qs[_0x6079('0x40')](_0x5a08a7['query'][_0x6079('0x40')]);_0x24740c[_0x6079('0x41')]=qs[_0x6079('0x39')](_[_0x6079('0x42')](_0x5a08a7['query'],_0xdc5c20[_0x6079('0x39')]),_0x546961);if(_0x5a08a7[_0x6079('0x37')]['filter']){_0x24740c['where']=_[_0x6079('0x43')](_0x24740c[_0x6079('0x41')],{'$or':_['map'](_0x546961,function(_0x5771eb){if(_0x5771eb[_0x6079('0x35')]!=='VIRTUAL'){var _0x35d512={};_0x35d512[_0x5771eb[_0x6079('0x2f')]]={'$like':'%'+_0x5a08a7[_0x6079('0x37')][_0x6079('0x44')]+'%'};return _0x35d512;}})});}_0x24740c=_[_0x6079('0x43')]({},_0x24740c,_0x5a08a7[_0x6079('0x45')]);var _0xe3f81c={'where':_0x24740c[_0x6079('0x41')]};return db[_0x6079('0x33')][_0x6079('0x21')](_0xe3f81c)['then'](function(_0x2644ea){_0x2b33f2['count']=_0x2644ea;if(_0x5a08a7[_0x6079('0x37')][_0x6079('0x46')]){_0x24740c[_0x6079('0x47')]=[{'all':!![]}];}return db[_0x6079('0x33')][_0x6079('0x48')](_0x24740c);})['then'](function(_0x2debcd){_0x2b33f2[_0x6079('0x49')]=_0x2debcd;return _0x2b33f2;})[_0x6079('0x2b')](respondWithFilteredResult(_0x37da54,_0x24740c))[_0x6079('0x4a')](handleError(_0x37da54,null));};exports[_0x6079('0x4b')]=function(_0x5d1adf,_0x364b31){var _0x752a39={'raw':![],'where':{'id':_0x5d1adf['params']['id']}},_0x10f16c={};_0x10f16c['model']=_['keys'](db[_0x6079('0x33')]['rawAttributes']);_0x10f16c[_0x6079('0x37')]=_['keys'](_0x5d1adf[_0x6079('0x37')]);_0x10f16c[_0x6079('0x39')]=_[_0x6079('0x3a')](_0x10f16c[_0x6079('0x36')],_0x10f16c[_0x6079('0x37')]);_0x752a39[_0x6079('0x3c')]=_[_0x6079('0x3a')](_0x10f16c['model'],qs[_0x6079('0x3b')](_0x5d1adf[_0x6079('0x37')][_0x6079('0x3b')]));_0x752a39[_0x6079('0x3c')]=_0x752a39[_0x6079('0x3c')][_0x6079('0x4c')]?_0x752a39[_0x6079('0x3c')]:_0x10f16c[_0x6079('0x36')];if(_0x5d1adf[_0x6079('0x37')][_0x6079('0x46')]){_0x752a39[_0x6079('0x47')]=[{'all':!![]}];}_0x752a39=_[_0x6079('0x43')]({},_0x752a39,_0x5d1adf['options']);return db[_0x6079('0x33')]['find'](_0x752a39)[_0x6079('0x2b')](handleEntityNotFound(_0x364b31,null))['then'](respondWithResult(_0x364b31,null))[_0x6079('0x4a')](handleError(_0x364b31,null));};exports[_0x6079('0x4d')]=function(_0x383be6,_0x42686f){return db[_0x6079('0x33')][_0x6079('0x4d')](_0x383be6[_0x6079('0x4e')],{})[_0x6079('0x2b')](function(_0x180776){var _0xb4bd23=_0x383be6[_0x6079('0x4f')][_0x6079('0x28')]({'plain':!![]});if(!_0xb4bd23)throw new Error(_0x6079('0x50'));if(_0xb4bd23[_0x6079('0x51')]===_0x6079('0x4f')){var _0x2d34e9=_0x180776[_0x6079('0x28')]({'plain':!![]});var _0x3fc610='CustomDashboards';return db[_0x6079('0x52')][_0x6079('0x53')]({'where':{'name':_0x3fc610,'userProfileId':_0xb4bd23[_0x6079('0x54')]},'raw':!![]})[_0x6079('0x2b')](function(_0x14f158){if(_0x14f158&&_0x14f158[_0x6079('0x55')]===0x0){return db[_0x6079('0x56')][_0x6079('0x4d')]({'name':_0x2d34e9[_0x6079('0x2f')],'resourceId':_0x2d34e9['id'],'type':_0x14f158[_0x6079('0x2f')],'sectionId':_0x14f158['id']},{})[_0x6079('0x2b')](function(){return _0x180776;});}else{return _0x180776;}})[_0x6079('0x4a')](function(_0x2ffcbf){logger[_0x6079('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ffcbf);throw _0x2ffcbf;});}return _0x180776;})['then'](respondWithResult(_0x42686f,0xc9))[_0x6079('0x4a')](handleError(_0x42686f,null));};exports[_0x6079('0x57')]=function(_0x2c97b1,_0x3f51b0){var _0x2bbc3e={'where':{'id':_0x2c97b1[_0x6079('0x58')]['id']}},_0x2bdc3a={};_0x2bdc3a[_0x6079('0x36')]=_[_0x6079('0x38')](db['Dashboard'][_0x6079('0x34')]);_0x2bbc3e[_0x6079('0x3c')]=_['intersection'](_0x2bdc3a[_0x6079('0x36')],qs[_0x6079('0x3b')](_0x2c97b1[_0x6079('0x37')][_0x6079('0x3b')]));_0x2bbc3e[_0x6079('0x3c')]=_0x2bbc3e[_0x6079('0x3c')][_0x6079('0x4c')]?_0x2bbc3e[_0x6079('0x3c')]:_0x2bdc3a[_0x6079('0x36')];if(_0x2c97b1[_0x6079('0x37')][_0x6079('0x46')]){_0x2bbc3e['include']=[{'all':!![]}];}_0x2bbc3e=_['merge']({},_0x2bbc3e,_0x2c97b1[_0x6079('0x45')]);return db[_0x6079('0x33')][_0x6079('0x53')](_0x2bbc3e)[_0x6079('0x2b')](handleEntityNotFound(_0x3f51b0,null))[_0x6079('0x2b')](function(_0x49453a){if(_0x49453a){var _0x2b7946=_0x49453a[_0x6079('0x28')]({'plain':!![]});_0x2b7946=qs[_0x6079('0x59')](_0x2b7946,['id','createdAt',_0x6079('0x5a')]);_0x2c97b1[_0x6079('0x4e')]=_[_0x6079('0x59')](_0x2c97b1[_0x6079('0x4e')],['id',_0x6079('0x5b'),_0x6079('0x5a')]);return db[_0x6079('0x33')][_0x6079('0x4d')](_['merge'](_0x2b7946,_0x2c97b1[_0x6079('0x4e')]),{'include':_0x2c97b1[_0x6079('0x37')][_0x6079('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0xd08ae8){var _0xf8b32a=_0x2c97b1[_0x6079('0x4f')][_0x6079('0x28')]({'plain':!![]});if(!_0xf8b32a)throw new Error(_0x6079('0x50'));if(_0xf8b32a[_0x6079('0x51')]===_0x6079('0x4f')){var _0xaf7556=_0xd08ae8[_0x6079('0x28')]({'plain':!![]});var _0x2c2ca1=_0x6079('0x29');return db[_0x6079('0x52')][_0x6079('0x53')]({'where':{'name':_0x2c2ca1,'userProfileId':_0xf8b32a['userProfileId']},'raw':!![]})['then'](function(_0x36fbcb){if(_0x36fbcb&&_0x36fbcb[_0x6079('0x55')]===0x0){return db['UserProfileResource'][_0x6079('0x4d')]({'name':_0xaf7556[_0x6079('0x2f')],'resourceId':_0xaf7556['id'],'type':_0x36fbcb[_0x6079('0x2f')],'sectionId':_0x36fbcb['id']},{})[_0x6079('0x2b')](function(){return _0xd08ae8;});}else{return _0xd08ae8;}})[_0x6079('0x4a')](function(_0x456d3a){logger[_0x6079('0x2d')](_0x6079('0x5c'),_0x456d3a);throw _0x456d3a;});}return _0xd08ae8;});}})[_0x6079('0x2b')](respondWithResult(_0x3f51b0,0xc9))[_0x6079('0x4a')](handleError(_0x3f51b0,null));};exports[_0x6079('0x27')]=function(_0xb44394,_0x2357e8){if(_0xb44394[_0x6079('0x4e')]['id']){delete _0xb44394['body']['id'];}return db[_0x6079('0x33')][_0x6079('0x53')]({'where':{'id':_0xb44394['params']['id']}})[_0x6079('0x2b')](handleEntityNotFound(_0x2357e8,null))['then'](saveUpdates(_0xb44394[_0x6079('0x4e')],null))[_0x6079('0x2b')](respondWithResult(_0x2357e8,null))['catch'](handleError(_0x2357e8,null));};exports[_0x6079('0x2a')]=function(_0x17e841,_0x87304){return db[_0x6079('0x33')][_0x6079('0x53')]({'where':{'id':_0x17e841['params']['id']}})[_0x6079('0x2b')](handleEntityNotFound(_0x87304,null))[_0x6079('0x2b')](removeEntity(_0x87304,null))['catch'](handleError(_0x87304,null));};function widgetAttributes(_0x48c5f8){try{switch(_0x48c5f8[_0x6079('0x35')]){case'iframe':return[{'name':_0x6079('0x5d'),'value':_0x48c5f8[_0x6079('0x5d')]||(_0x48c5f8['attrs']&&_0x48c5f8[_0x6079('0x5e')][0x0]?_0x48c5f8[_0x6079('0x5e')][0x0][_0x6079('0x5f')]:undefined)||'https://'}];case _0x6079('0x60'):return[{'name':_0x6079('0x61'),'value':_0x48c5f8[_0x6079('0x61')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8['attrs'][0x0]?_0x48c5f8['attrs'][0x0][_0x6079('0x5f')]:undefined)||''}];case _0x6079('0x62'):return[{'name':_0x6079('0x63'),'value':_0x48c5f8[_0x6079('0x63')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x0]?_0x48c5f8[_0x6079('0x5e')][0x0][_0x6079('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0x6079('0x64'),'value':_0x48c5f8[_0x6079('0x64')]||(_0x48c5f8['attrs']&&_0x48c5f8[_0x6079('0x5e')][0x1]?_0x48c5f8[_0x6079('0x5e')][0x1][_0x6079('0x5f')]:undefined)||_0x6079('0x65')},{'name':_0x6079('0x66'),'value':_0x48c5f8[_0x6079('0x66')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x2]?_0x48c5f8[_0x6079('0x5e')][0x2][_0x6079('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x6079('0x67'),'value':_0x48c5f8[_0x6079('0x67')]||(_0x48c5f8['attrs']&&_0x48c5f8[_0x6079('0x5e')][0x0]?_0x48c5f8['attrs'][0x0]['value']:undefined)||_0x6079('0x68')},{'name':_0x6079('0x69'),'value':_0x48c5f8[_0x6079('0x69')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8['attrs'][0x1]?_0x48c5f8['attrs'][0x1][_0x6079('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x48c5f8['attrFontSize']||(_0x48c5f8['attrs']&&_0x48c5f8[_0x6079('0x5e')][0x2]?_0x48c5f8['attrs'][0x2][_0x6079('0x5f')]:undefined)||0x14}];case _0x6079('0x6a'):case'pie-chart':return[{'name':'attrSerie1','value':_0x48c5f8['attrSerie1']||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8['attrs'][0x0]?_0x48c5f8[_0x6079('0x5e')][0x0][_0x6079('0x5f')]:undefined)||'total'},{'name':'attrSerie2','value':_0x48c5f8['attrSerie2']||(_0x48c5f8['attrs']&&_0x48c5f8['attrs'][0x1]?_0x48c5f8['attrs'][0x1][_0x6079('0x5f')]:undefined)||null},{'name':_0x6079('0x6b'),'value':_0x48c5f8[_0x6079('0x6b')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x2]?_0x48c5f8['attrs'][0x2][_0x6079('0x5f')]:undefined)||null},{'name':_0x6079('0x69'),'value':_0x48c5f8[_0x6079('0x69')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8['attrs'][0x3]?_0x48c5f8[_0x6079('0x5e')][0x3][_0x6079('0x5f')]:undefined)||[]}];case _0x6079('0x6c'):return[{'name':_0x6079('0x6d'),'type':_0x48c5f8[_0x6079('0x6e')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x0]?_0x48c5f8['attrs'][0x0][_0x6079('0x35')]:undefined)||null,'value':_0x48c5f8[_0x6079('0x6d')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x0]?_0x48c5f8[_0x6079('0x5e')][0x0]['value']:undefined)||null},{'name':_0x6079('0x6f'),'value':_0x48c5f8[_0x6079('0x6f')]||(_0x48c5f8[_0x6079('0x5e')]&&_0x48c5f8[_0x6079('0x5e')][0x1]?_0x48c5f8[_0x6079('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x32df00){logger[_0x6079('0x2d')](_0x6079('0x70'),JSON[_0x6079('0x71')](_0x32df00));return[];}}exports['addItem']=function(_0x493d1e,_0x1c8869,_0x431398){if(_0x493d1e[_0x6079('0x4e')]['id']){delete _0x493d1e[_0x6079('0x4e')]['id'];}return db[_0x6079('0x33')][_0x6079('0x53')]({'where':{'id':_0x493d1e[_0x6079('0x58')]['id']}})[_0x6079('0x2b')](handleEntityNotFound(_0x1c8869,null))[_0x6079('0x2b')](function(_0xfb5b44){if(_0xfb5b44){_0x493d1e[_0x6079('0x4e')][_0x6079('0x72')]=_0xfb5b44['id'];_0x493d1e[_0x6079('0x4e')]['attrs']=widgetAttributes(_0x493d1e['body']);return db[_0x6079('0x73')][_0x6079('0x4d')](_0x493d1e[_0x6079('0x4e')]);}})['then'](respondWithResult(_0x1c8869,null))[_0x6079('0x4a')](handleError(_0x1c8869,null));};exports[_0x6079('0x74')]=function(_0x1620c8,_0x4eec7a,_0x726b10){var _0x5a9b3a={};var _0x3bb7a4={};var _0xab01ee;var _0x499764;return db[_0x6079('0x33')][_0x6079('0x75')]({'where':{'id':_0x1620c8[_0x6079('0x58')]['id']}})[_0x6079('0x2b')](handleEntityNotFound(_0x4eec7a,null))[_0x6079('0x2b')](function(_0x1e2497){if(_0x1e2497){_0xab01ee=_0x1e2497;_0x3bb7a4[_0x6079('0x36')]=_[_0x6079('0x38')](db['DashboardItem'][_0x6079('0x34')]);_0x3bb7a4[_0x6079('0x37')]=_['keys'](_0x1620c8[_0x6079('0x37')]);_0x3bb7a4[_0x6079('0x39')]=_['intersection'](_0x3bb7a4[_0x6079('0x36')],_0x3bb7a4[_0x6079('0x37')]);_0x5a9b3a[_0x6079('0x3c')]=_[_0x6079('0x3a')](_0x3bb7a4['model'],qs[_0x6079('0x3b')](_0x1620c8[_0x6079('0x37')]['fields']));_0x5a9b3a[_0x6079('0x3c')]=_0x5a9b3a['attributes']['length']?_0x5a9b3a['attributes']:_0x3bb7a4[_0x6079('0x36')];_0x5a9b3a[_0x6079('0x3f')]=qs[_0x6079('0x40')](_0x1620c8['query'][_0x6079('0x40')]);_0x5a9b3a[_0x6079('0x41')]=qs['filters'](_['pick'](_0x1620c8['query'],_0x3bb7a4[_0x6079('0x39')]));if(_0x1620c8[_0x6079('0x37')][_0x6079('0x44')]){_0x5a9b3a['where']=_[_0x6079('0x43')](_0x5a9b3a[_0x6079('0x41')],{'$or':_['map'](_0x5a9b3a[_0x6079('0x3c')],function(_0x48094b){var _0x295d22={};_0x295d22[_0x48094b]={'$like':'%'+_0x1620c8[_0x6079('0x37')][_0x6079('0x44')]+'%'};return _0x295d22;})});}_0x5a9b3a=_[_0x6079('0x43')]({},_0x5a9b3a,_0x1620c8[_0x6079('0x45')]);return _0xab01ee[_0x6079('0x74')](_0x5a9b3a);}})[_0x6079('0x2b')](function(_0x4e945c){if(_0x4e945c){_0x499764=_0x4e945c[_0x6079('0x4c')];if(!_0x1620c8[_0x6079('0x37')][_0x6079('0x76')]('nolimit')){_0x5a9b3a[_0x6079('0x3e')]=qs[_0x6079('0x3e')](_0x1620c8[_0x6079('0x37')][_0x6079('0x3e')]);_0x5a9b3a[_0x6079('0x1f')]=qs['offset'](_0x1620c8[_0x6079('0x37')][_0x6079('0x1f')]);}return _0xab01ee[_0x6079('0x74')](_0x5a9b3a);}})[_0x6079('0x2b')](function(_0x2ffc8f){if(_0x2ffc8f){return _0x2ffc8f?{'count':_0x499764,'rows':_0x2ffc8f}:null;}})[_0x6079('0x2b')](respondWithResult(_0x4eec7a,null))[_0x6079('0x4a')](handleError(_0x4eec7a,null));}; \ No newline at end of file +var _0x9792=['type','key','map','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','merge','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','includeAll','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','clone','params','omit','createdAt','updatedAt','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','getItems','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','Dashboard','rawAttributes','fieldName'];(function(_0x4a5b3a,_0x3c69e6){var _0x5c6487=function(_0x30ef6b){while(--_0x30ef6b){_0x4a5b3a['push'](_0x4a5b3a['shift']());}};_0x5c6487(++_0x3c69e6);}(_0x9792,0x140));var _0x2979=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9792[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x2979('0x0'));var rimraf=require(_0x2979('0x1'));var zipdir=require(_0x2979('0x2'));var jsonpatch=require(_0x2979('0x3'));var rp=require(_0x2979('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2979('0x5'));var util=require(_0x2979('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2979('0x7'));var ejs=require(_0x2979('0x8'));var fs=require('fs');var fs_extra=require(_0x2979('0x9'));var _=require(_0x2979('0xa'));var squel=require(_0x2979('0xb'));var crypto=require('crypto');var jsforce=require(_0x2979('0xc'));var deskjs=require(_0x2979('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2979('0xe'));var Papa=require(_0x2979('0xf'));var Redis=require(_0x2979('0x10'));var authService=require(_0x2979('0x11'));var qs=require(_0x2979('0x12'));var as=require(_0x2979('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2979('0x14'))(_0x2979('0x15'));var utils=require(_0x2979('0x16'));var config=require(_0x2979('0x17'));var licenseUtil=require(_0x2979('0x18'));var db=require(_0x2979('0x19'))['db'];config['redis']=_[_0x2979('0x1a')](config['redis'],{'host':_0x2979('0x1b'),'port':0x18eb});var socket=require(_0x2979('0x1c'))(new Redis(config['redis']));require(_0x2979('0x1d'))['register'](socket);function respondWithStatusCode(_0x1e1288,_0x475981){_0x475981=_0x475981||0xcc;return function(_0x425e34){if(_0x425e34){return _0x1e1288[_0x2979('0x1e')](_0x475981);}return _0x1e1288[_0x2979('0x1f')](_0x475981)[_0x2979('0x20')]();};}function respondWithResult(_0x441f8a,_0x2b6825){_0x2b6825=_0x2b6825||0xc8;return function(_0x42b252){if(_0x42b252){return _0x441f8a[_0x2979('0x1f')](_0x2b6825)['json'](_0x42b252);}};}function respondWithFilteredResult(_0xbe37d3,_0x286970){return function(_0x4b8a59){if(_0x4b8a59){var _0x1b025e=typeof _0x286970[_0x2979('0x21')]===_0x2979('0x22')&&typeof _0x286970[_0x2979('0x23')]===_0x2979('0x22');var _0x1316af=_0x4b8a59[_0x2979('0x24')];var _0x371122=_0x1b025e?0x0:_0x286970['offset'];var _0x474815=_0x1b025e?_0x4b8a59[_0x2979('0x24')]:_0x286970[_0x2979('0x21')]+_0x286970[_0x2979('0x23')];var _0x38c40a;if(_0x474815>=_0x1316af){_0x474815=_0x1316af;_0x38c40a=0xc8;}else{_0x38c40a=0xce;}_0xbe37d3[_0x2979('0x1f')](_0x38c40a);return _0xbe37d3[_0x2979('0x25')](_0x2979('0x26'),_0x371122+'-'+_0x474815+'/'+_0x1316af)[_0x2979('0x27')](_0x4b8a59);}return null;};}function patchUpdates(_0x16f8bb){return function(_0x1177b3){try{jsonpatch[_0x2979('0x28')](_0x1177b3,_0x16f8bb,!![]);}catch(_0xb7b08d){return BPromise['reject'](_0xb7b08d);}return _0x1177b3[_0x2979('0x29')]();};}function saveUpdates(_0x523e27,_0x3a7ede){return function(_0x34a1d9){if(_0x34a1d9){return _0x34a1d9[_0x2979('0x2a')](_0x523e27)[_0x2979('0x2b')](function(_0x21fe8c){return _0x21fe8c;});}return null;};}function removeEntity(_0x6ba39e,_0x4f118a){return function(_0x2d10eb){if(_0x2d10eb){return _0x2d10eb[_0x2979('0x2c')]()[_0x2979('0x2b')](function(){var _0xbe6515=_0x2d10eb[_0x2979('0x2d')]({'plain':!![]});var _0x39637a=_0x2979('0x2e');return db[_0x2979('0x2f')]['destroy']({'where':{'type':_0x39637a,'resourceId':_0xbe6515['id']}})[_0x2979('0x2b')](function(){return _0x2d10eb;});})[_0x2979('0x2b')](function(){_0x6ba39e[_0x2979('0x1f')](0xcc)[_0x2979('0x20')]();});}};}function handleEntityNotFound(_0xdb28e9,_0x543b3d){return function(_0x414804){if(!_0x414804){_0xdb28e9[_0x2979('0x1e')](0x194);}return _0x414804;};}function handleError(_0xaddcb1,_0x49a962){_0x49a962=_0x49a962||0x1f4;return function(_0x14b3bd){logger[_0x2979('0x30')](_0x14b3bd[_0x2979('0x31')]);if(_0x14b3bd[_0x2979('0x32')]){delete _0x14b3bd['name'];}_0xaddcb1[_0x2979('0x1f')](_0x49a962)[_0x2979('0x33')](_0x14b3bd);};}exports['index']=function(_0x58c49e,_0x1bb25c){var _0x549e09={},_0x5e8646={},_0x36d456={'count':0x0,'rows':[]};var _0x4322e7=_['map'](db[_0x2979('0x34')][_0x2979('0x35')],function(_0x21a17c){return{'name':_0x21a17c[_0x2979('0x36')],'type':_0x21a17c[_0x2979('0x37')][_0x2979('0x38')]};});_0x5e8646['model']=_[_0x2979('0x39')](_0x4322e7,_0x2979('0x32'));_0x5e8646[_0x2979('0x3a')]=_['keys'](_0x58c49e[_0x2979('0x3a')]);_0x5e8646['filters']=_[_0x2979('0x3b')](_0x5e8646[_0x2979('0x3c')],_0x5e8646[_0x2979('0x3a')]);_0x549e09[_0x2979('0x3d')]=_[_0x2979('0x3b')](_0x5e8646['model'],qs[_0x2979('0x3e')](_0x58c49e[_0x2979('0x3a')][_0x2979('0x3e')]));_0x549e09[_0x2979('0x3d')]=_0x549e09['attributes'][_0x2979('0x3f')]?_0x549e09['attributes']:_0x5e8646[_0x2979('0x3c')];if(!_0x58c49e['query']['hasOwnProperty'](_0x2979('0x40'))){_0x549e09[_0x2979('0x23')]=qs[_0x2979('0x23')](_0x58c49e['query'][_0x2979('0x23')]);_0x549e09[_0x2979('0x21')]=qs[_0x2979('0x21')](_0x58c49e['query'][_0x2979('0x21')]);}_0x549e09[_0x2979('0x41')]=qs[_0x2979('0x42')](_0x58c49e[_0x2979('0x3a')]['sort']);_0x549e09['where']=qs[_0x2979('0x43')](_['pick'](_0x58c49e[_0x2979('0x3a')],_0x5e8646['filters']),_0x4322e7);if(_0x58c49e[_0x2979('0x3a')]['filter']){_0x549e09['where']=_[_0x2979('0x44')](_0x549e09[_0x2979('0x45')],{'$or':_[_0x2979('0x39')](_0x4322e7,function(_0x258db1){if(_0x258db1[_0x2979('0x37')]!==_0x2979('0x46')){var _0x1d0853={};_0x1d0853[_0x258db1[_0x2979('0x32')]]={'$like':'%'+_0x58c49e['query'][_0x2979('0x47')]+'%'};return _0x1d0853;}})});}_0x549e09=_['merge']({},_0x549e09,_0x58c49e[_0x2979('0x48')]);var _0x5d620e={'where':_0x549e09[_0x2979('0x45')]};return db[_0x2979('0x34')][_0x2979('0x24')](_0x5d620e)[_0x2979('0x2b')](function(_0x52ad4f){_0x36d456[_0x2979('0x24')]=_0x52ad4f;if(_0x58c49e[_0x2979('0x3a')]['includeAll']){_0x549e09[_0x2979('0x49')]=[{'all':!![]}];}return db[_0x2979('0x34')][_0x2979('0x4a')](_0x549e09);})[_0x2979('0x2b')](function(_0x5144f2){_0x36d456[_0x2979('0x4b')]=_0x5144f2;return _0x36d456;})[_0x2979('0x2b')](respondWithFilteredResult(_0x1bb25c,_0x549e09))[_0x2979('0x4c')](handleError(_0x1bb25c,null));};exports[_0x2979('0x4d')]=function(_0x13bb69,_0x3e19a1){var _0x46b18c={'raw':![],'where':{'id':_0x13bb69['params']['id']}},_0x1a73f9={};_0x1a73f9[_0x2979('0x3c')]=_['keys'](db['Dashboard'][_0x2979('0x35')]);_0x1a73f9[_0x2979('0x3a')]=_[_0x2979('0x4e')](_0x13bb69[_0x2979('0x3a')]);_0x1a73f9[_0x2979('0x43')]=_['intersection'](_0x1a73f9['model'],_0x1a73f9[_0x2979('0x3a')]);_0x46b18c['attributes']=_['intersection'](_0x1a73f9[_0x2979('0x3c')],qs[_0x2979('0x3e')](_0x13bb69[_0x2979('0x3a')][_0x2979('0x3e')]));_0x46b18c['attributes']=_0x46b18c['attributes']['length']?_0x46b18c[_0x2979('0x3d')]:_0x1a73f9['model'];if(_0x13bb69[_0x2979('0x3a')][_0x2979('0x4f')]){_0x46b18c[_0x2979('0x49')]=[{'all':!![]}];}_0x46b18c=_[_0x2979('0x44')]({},_0x46b18c,_0x13bb69['options']);return db['Dashboard'][_0x2979('0x50')](_0x46b18c)[_0x2979('0x2b')](handleEntityNotFound(_0x3e19a1,null))[_0x2979('0x2b')](respondWithResult(_0x3e19a1,null))[_0x2979('0x4c')](handleError(_0x3e19a1,null));};exports[_0x2979('0x51')]=function(_0xb286e3,_0x38f36f){return db['Dashboard'][_0x2979('0x51')](_0xb286e3[_0x2979('0x52')],{})[_0x2979('0x2b')](function(_0x2b9fe9){var _0x48b968=_0xb286e3[_0x2979('0x53')][_0x2979('0x2d')]({'plain':!![]});if(!_0x48b968)throw new Error(_0x2979('0x54'));if(_0x48b968[_0x2979('0x55')]==='user'){var _0x19c7eb=_0x2b9fe9['get']({'plain':!![]});var _0x3597f7='CustomDashboards';return db[_0x2979('0x56')][_0x2979('0x50')]({'where':{'name':_0x3597f7,'userProfileId':_0x48b968[_0x2979('0x57')]},'raw':!![]})[_0x2979('0x2b')](function(_0x2f0d73){if(_0x2f0d73&&_0x2f0d73[_0x2979('0x58')]===0x0){return db[_0x2979('0x2f')][_0x2979('0x51')]({'name':_0x19c7eb['name'],'resourceId':_0x19c7eb['id'],'type':_0x2f0d73['name'],'sectionId':_0x2f0d73['id']},{})[_0x2979('0x2b')](function(){return _0x2b9fe9;});}else{return _0x2b9fe9;}})['catch'](function(_0x363d7f){logger[_0x2979('0x30')](_0x2979('0x59'),_0x363d7f);throw _0x363d7f;});}return _0x2b9fe9;})[_0x2979('0x2b')](respondWithResult(_0x38f36f,0xc9))[_0x2979('0x4c')](handleError(_0x38f36f,null));};exports[_0x2979('0x5a')]=function(_0xa885a3,_0x4f0b30){var _0xbbaf35={'where':{'id':_0xa885a3[_0x2979('0x5b')]['id']}},_0x3579ce={};_0x3579ce[_0x2979('0x3c')]=_[_0x2979('0x4e')](db[_0x2979('0x34')][_0x2979('0x35')]);_0xbbaf35[_0x2979('0x3d')]=_[_0x2979('0x3b')](_0x3579ce['model'],qs[_0x2979('0x3e')](_0xa885a3['query'][_0x2979('0x3e')]));_0xbbaf35['attributes']=_0xbbaf35[_0x2979('0x3d')][_0x2979('0x3f')]?_0xbbaf35[_0x2979('0x3d')]:_0x3579ce[_0x2979('0x3c')];if(_0xa885a3['query'][_0x2979('0x4f')]){_0xbbaf35[_0x2979('0x49')]=[{'all':!![]}];}_0xbbaf35=_[_0x2979('0x44')]({},_0xbbaf35,_0xa885a3[_0x2979('0x48')]);return db[_0x2979('0x34')][_0x2979('0x50')](_0xbbaf35)[_0x2979('0x2b')](handleEntityNotFound(_0x4f0b30,null))[_0x2979('0x2b')](function(_0x289e0d){if(_0x289e0d){var _0x77e718=_0x289e0d[_0x2979('0x2d')]({'plain':!![]});_0x77e718=qs[_0x2979('0x5c')](_0x77e718,['id',_0x2979('0x5d'),_0x2979('0x5e')]);_0xa885a3[_0x2979('0x52')]=_[_0x2979('0x5c')](_0xa885a3[_0x2979('0x52')],['id','createdAt',_0x2979('0x5e')]);return db[_0x2979('0x34')][_0x2979('0x51')](_[_0x2979('0x44')](_0x77e718,_0xa885a3[_0x2979('0x52')]),{'include':_0xa885a3[_0x2979('0x3a')][_0x2979('0x4f')]?[{'all':!![]}]:undefined})[_0x2979('0x2b')](function(_0x2fdf62){var _0x4ddc68=_0xa885a3[_0x2979('0x53')]['get']({'plain':!![]});if(!_0x4ddc68)throw new Error(_0x2979('0x54'));if(_0x4ddc68['role']==='user'){var _0x236ec6=_0x2fdf62[_0x2979('0x2d')]({'plain':!![]});var _0x355dc8=_0x2979('0x2e');return db[_0x2979('0x56')]['find']({'where':{'name':_0x355dc8,'userProfileId':_0x4ddc68['userProfileId']},'raw':!![]})[_0x2979('0x2b')](function(_0x216733){if(_0x216733&&_0x216733['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x236ec6[_0x2979('0x32')],'resourceId':_0x236ec6['id'],'type':_0x216733[_0x2979('0x32')],'sectionId':_0x216733['id']},{})[_0x2979('0x2b')](function(){return _0x2fdf62;});}else{return _0x2fdf62;}})['catch'](function(_0x4e8e3f){logger[_0x2979('0x30')](_0x2979('0x59'),_0x4e8e3f);throw _0x4e8e3f;});}return _0x2fdf62;});}})[_0x2979('0x2b')](respondWithResult(_0x4f0b30,0xc9))[_0x2979('0x4c')](handleError(_0x4f0b30,null));};exports[_0x2979('0x2a')]=function(_0x5d9d1c,_0x3b4be6){if(_0x5d9d1c['body']['id']){delete _0x5d9d1c[_0x2979('0x52')]['id'];}return db[_0x2979('0x34')]['find']({'where':{'id':_0x5d9d1c[_0x2979('0x5b')]['id']}})[_0x2979('0x2b')](handleEntityNotFound(_0x3b4be6,null))[_0x2979('0x2b')](saveUpdates(_0x5d9d1c['body'],null))[_0x2979('0x2b')](respondWithResult(_0x3b4be6,null))[_0x2979('0x4c')](handleError(_0x3b4be6,null));};exports[_0x2979('0x2c')]=function(_0x3c6f26,_0x131e8a){return db['Dashboard']['find']({'where':{'id':_0x3c6f26[_0x2979('0x5b')]['id']}})['then'](handleEntityNotFound(_0x131e8a,null))['then'](removeEntity(_0x131e8a,null))[_0x2979('0x4c')](handleError(_0x131e8a,null));};function widgetAttributes(_0xee835e){try{switch(_0xee835e[_0x2979('0x37')]){case'iframe':return[{'name':_0x2979('0x5f'),'value':_0xee835e[_0x2979('0x5f')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e['attrs'][0x0]?_0xee835e[_0x2979('0x60')][0x0][_0x2979('0x61')]:undefined)||_0x2979('0x62')}];case _0x2979('0x63'):return[{'name':_0x2979('0x64'),'value':_0xee835e[_0x2979('0x64')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e['attrs'][0x0]?_0xee835e[_0x2979('0x60')][0x0][_0x2979('0x61')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0xee835e[_0x2979('0x65')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x0]?_0xee835e['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x2979('0x66'),'value':_0xee835e[_0x2979('0x66')]||(_0xee835e['attrs']&&_0xee835e[_0x2979('0x60')][0x1]?_0xee835e[_0x2979('0x60')][0x1][_0x2979('0x61')]:undefined)||_0x2979('0x67')},{'name':_0x2979('0x68'),'value':_0xee835e[_0x2979('0x68')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x2]?_0xee835e[_0x2979('0x60')][0x2]['value']:undefined)||0xc}];case _0x2979('0x69'):return[{'name':_0x2979('0x6a'),'value':_0xee835e[_0x2979('0x6a')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x0]?_0xee835e[_0x2979('0x60')][0x0][_0x2979('0x61')]:undefined)||_0x2979('0x6b')},{'name':'attrVoiceQueues','value':_0xee835e[_0x2979('0x6c')]||(_0xee835e['attrs']&&_0xee835e[_0x2979('0x60')][0x1]?_0xee835e[_0x2979('0x60')][0x1][_0x2979('0x61')]:undefined)||[]},{'name':_0x2979('0x68'),'value':_0xee835e[_0x2979('0x68')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x2]?_0xee835e[_0x2979('0x60')][0x2][_0x2979('0x61')]:undefined)||0x14}];case _0x2979('0x6d'):case _0x2979('0x6e'):return[{'name':_0x2979('0x6f'),'value':_0xee835e[_0x2979('0x6f')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x0]?_0xee835e[_0x2979('0x60')][0x0][_0x2979('0x61')]:undefined)||_0x2979('0x6b')},{'name':_0x2979('0x70'),'value':_0xee835e[_0x2979('0x70')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x1]?_0xee835e[_0x2979('0x60')][0x1][_0x2979('0x61')]:undefined)||null},{'name':_0x2979('0x71'),'value':_0xee835e[_0x2979('0x71')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x2]?_0xee835e['attrs'][0x2][_0x2979('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xee835e[_0x2979('0x6c')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x3]?_0xee835e[_0x2979('0x60')][0x3]['value']:undefined)||[]}];case _0x2979('0x72'):return[{'name':'attrReport','type':_0xee835e[_0x2979('0x73')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x0]?_0xee835e[_0x2979('0x60')][0x0]['type']:undefined)||null,'value':_0xee835e[_0x2979('0x74')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x0]?_0xee835e[_0x2979('0x60')][0x0][_0x2979('0x61')]:undefined)||null},{'name':_0x2979('0x75'),'value':_0xee835e[_0x2979('0x75')]||(_0xee835e[_0x2979('0x60')]&&_0xee835e[_0x2979('0x60')][0x1]?_0xee835e[_0x2979('0x60')][0x1][_0x2979('0x61')]:undefined)||0x0}];default:return[];}}catch(_0xbf69c4){logger['error'](_0x2979('0x76'),JSON[_0x2979('0x77')](_0xbf69c4));return[];}}exports['addItem']=function(_0x9a5999,_0x3b0b52,_0x3bd92a){if(_0x9a5999[_0x2979('0x52')]['id']){delete _0x9a5999[_0x2979('0x52')]['id'];}return db[_0x2979('0x34')]['find']({'where':{'id':_0x9a5999[_0x2979('0x5b')]['id']}})[_0x2979('0x2b')](handleEntityNotFound(_0x3b0b52,null))['then'](function(_0x374f3f){if(_0x374f3f){_0x9a5999[_0x2979('0x52')][_0x2979('0x78')]=_0x374f3f['id'];_0x9a5999[_0x2979('0x52')][_0x2979('0x60')]=widgetAttributes(_0x9a5999[_0x2979('0x52')]);return db[_0x2979('0x79')][_0x2979('0x51')](_0x9a5999[_0x2979('0x52')]);}})[_0x2979('0x2b')](respondWithResult(_0x3b0b52,null))[_0x2979('0x4c')](handleError(_0x3b0b52,null));};exports['getItems']=function(_0xb3efa,_0x3fa731,_0x5f3474){var _0x3d32bd={};var _0x2b8b1b={};var _0x4365eb;var _0x6dc4dc;return db['Dashboard'][_0x2979('0x7a')]({'where':{'id':_0xb3efa[_0x2979('0x5b')]['id']}})[_0x2979('0x2b')](handleEntityNotFound(_0x3fa731,null))['then'](function(_0x204827){if(_0x204827){_0x4365eb=_0x204827;_0x2b8b1b['model']=_[_0x2979('0x4e')](db[_0x2979('0x79')][_0x2979('0x35')]);_0x2b8b1b['query']=_[_0x2979('0x4e')](_0xb3efa[_0x2979('0x3a')]);_0x2b8b1b[_0x2979('0x43')]=_[_0x2979('0x3b')](_0x2b8b1b[_0x2979('0x3c')],_0x2b8b1b[_0x2979('0x3a')]);_0x3d32bd['attributes']=_[_0x2979('0x3b')](_0x2b8b1b[_0x2979('0x3c')],qs[_0x2979('0x3e')](_0xb3efa[_0x2979('0x3a')][_0x2979('0x3e')]));_0x3d32bd[_0x2979('0x3d')]=_0x3d32bd['attributes'][_0x2979('0x3f')]?_0x3d32bd[_0x2979('0x3d')]:_0x2b8b1b['model'];_0x3d32bd[_0x2979('0x41')]=qs['sort'](_0xb3efa['query']['sort']);_0x3d32bd[_0x2979('0x45')]=qs[_0x2979('0x43')](_['pick'](_0xb3efa[_0x2979('0x3a')],_0x2b8b1b[_0x2979('0x43')]));if(_0xb3efa['query'][_0x2979('0x47')]){_0x3d32bd[_0x2979('0x45')]=_[_0x2979('0x44')](_0x3d32bd[_0x2979('0x45')],{'$or':_[_0x2979('0x39')](_0x3d32bd['attributes'],function(_0x561469){var _0x4b0c26={};_0x4b0c26[_0x561469]={'$like':'%'+_0xb3efa[_0x2979('0x3a')][_0x2979('0x47')]+'%'};return _0x4b0c26;})});}_0x3d32bd=_[_0x2979('0x44')]({},_0x3d32bd,_0xb3efa['options']);return _0x4365eb[_0x2979('0x7b')](_0x3d32bd);}})['then'](function(_0x20fa36){if(_0x20fa36){_0x6dc4dc=_0x20fa36['length'];if(!_0xb3efa[_0x2979('0x3a')][_0x2979('0x7c')](_0x2979('0x40'))){_0x3d32bd[_0x2979('0x23')]=qs[_0x2979('0x23')](_0xb3efa[_0x2979('0x3a')][_0x2979('0x23')]);_0x3d32bd[_0x2979('0x21')]=qs[_0x2979('0x21')](_0xb3efa[_0x2979('0x3a')][_0x2979('0x21')]);}return _0x4365eb[_0x2979('0x7b')](_0x3d32bd);}})[_0x2979('0x2b')](function(_0xc3d38f){if(_0xc3d38f){return _0xc3d38f?{'count':_0x6dc4dc,'rows':_0xc3d38f}:null;}})[_0x2979('0x2b')](respondWithResult(_0x3fa731,null))[_0x2979('0x4c')](handleError(_0x3fa731,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c21d0af..e18309f 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 _0x48ad=['emit','hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','update','remove'];(function(_0x5274b8,_0x492cfb){var _0x1a4b00=function(_0x22bffd){while(--_0x22bffd){_0x5274b8['push'](_0x5274b8['shift']());}};_0x1a4b00(++_0x492cfb);}(_0x48ad,0xe5));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd48a('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xd48a('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd48a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd48a('0x3'),'afterDestroy':_0xd48a('0x4')};function emitEvent(_0x3a5444){return function(_0x339a1d,_0x5365d2,_0x112c8e){DashboardEvents[_0xd48a('0x5')](_0x3a5444+':'+_0x339a1d['id'],_0x339a1d);DashboardEvents['emit'](_0x3a5444,_0x339a1d);_0x112c8e(null);};}for(var e in events){if(events[_0xd48a('0x6')](e)){var event=events[e];Dashboard[_0xd48a('0x7')](e,emitEvent(event));}}module[_0xd48a('0x8')]=DashboardEvents; \ No newline at end of file +var _0x97ce=['hook','events','../../mysqldb','Dashboard','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x281586,_0x504d09){var _0x469003=function(_0x3207c4){while(--_0x3207c4){_0x281586['push'](_0x281586['shift']());}};_0x469003(++_0x504d09);}(_0x97ce,0x151));var _0xe97c=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x97ce[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require(_0xe97c('0x0'));var Dashboard=require(_0xe97c('0x1'))['db'][_0xe97c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe97c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe97c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3001eb){return function(_0x49df42,_0x443ea2,_0x259e69){DashboardEvents[_0xe97c('0x5')](_0x3001eb+':'+_0x49df42['id'],_0x49df42);DashboardEvents[_0xe97c('0x5')](_0x3001eb,_0x49df42);_0x259e69(null);};}for(var e in events){if(events[_0xe97c('0x6')](e)){var event=events[e];Dashboard[_0xe97c('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 0ac0992..32ad925 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 _0x717b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboard.attributes','Dashboard','dashboards','lodash','util'];(function(_0x44761c,_0x3e8a38){var _0x495f15=function(_0x1c7fdf){while(--_0x1c7fdf){_0x44761c['push'](_0x44761c['shift']());}};_0x495f15(++_0x3e8a38);}(_0x717b,0x18a));var _0xb717=function(_0x16e89b,_0x345462){_0x16e89b=_0x16e89b-0x0;var _0x36da3e=_0x717b[_0x16e89b];return _0x36da3e;};'use strict';var _=require(_0xb717('0x0'));var util=require(_0xb717('0x1'));var logger=require(_0xb717('0x2'))(_0xb717('0x3'));var moment=require(_0xb717('0x4'));var BPromise=require(_0xb717('0x5'));var rp=require(_0xb717('0x6'));var fs=require('fs');var path=require(_0xb717('0x7'));var rimraf=require(_0xb717('0x8'));var config=require('../../config/environment');var attributes=require(_0xb717('0x9'));module['exports']=function(_0x4822dd,_0x40bc9d){return _0x4822dd['define'](_0xb717('0xa'),attributes,{'tableName':_0xb717('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb45=['Dashboard','dashboards','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./dashboard.attributes','define'];(function(_0x11848e,_0x39d149){var _0x1f60fa=function(_0x40e62f){while(--_0x40e62f){_0x11848e['push'](_0x11848e['shift']());}};_0x1f60fa(++_0x39d149);}(_0xbb45,0xd3));var _0x5bb4=function(_0x4b512a,_0x5e478d){_0x4b512a=_0x4b512a-0x0;var _0x49d427=_0xbb45[_0x4b512a];return _0x49d427;};'use strict';var _=require(_0x5bb4('0x0'));var util=require(_0x5bb4('0x1'));var logger=require(_0x5bb4('0x2'))('api');var moment=require(_0x5bb4('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bb4('0x4'));var fs=require('fs');var path=require(_0x5bb4('0x5'));var rimraf=require(_0x5bb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x5bb4('0x7'));module['exports']=function(_0x435f5f,_0x1f8763){return _0x435f5f[_0x5bb4('0x8')](_0x5bb4('0x9'),attributes,{'tableName':_0x5bb4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index b0a0d7d..8f53fa8 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 _0x47ba=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request'];(function(_0x4de798,_0x146402){var _0x3c0757=function(_0x42a629){while(--_0x42a629){_0x4de798['push'](_0x4de798['shift']());}};_0x3c0757(++_0x146402);}(_0x47ba,0x119));var _0xa47b=function(_0x54b179,_0x14a660){_0x54b179=_0x54b179-0x0;var _0x4a5650=_0x47ba[_0x54b179];return _0x4a5650;};'use strict';var _=require(_0xa47b('0x0'));var util=require(_0xa47b('0x1'));var moment=require('moment');var BPromise=require(_0xa47b('0x2'));var rs=require(_0xa47b('0x3'));var fs=require('fs');var Redis=require(_0xa47b('0x4'));var db=require(_0xa47b('0x5'))['db'];var utils=require(_0xa47b('0x6'));var logger=require('../../config/logger')(_0xa47b('0x7'));var config=require(_0xa47b('0x8'));var jayson=require(_0xa47b('0x9'));var client=jayson[_0xa47b('0xa')][_0xa47b('0xb')]({'port':0x232a});config['redis']=_[_0xa47b('0xc')](config[_0xa47b('0xd')],{'host':_0xa47b('0xe'),'port':0x18eb});var socket=require(_0xa47b('0xf'))(new Redis(config[_0xa47b('0xd')]));require(_0xa47b('0x10'))[_0xa47b('0x11')](socket);function respondWithRpcPromise(_0x1b0d0c,_0x4882b2,_0x59d3d6){return new BPromise(function(_0x389c7e,_0xbd2fdd){return client[_0xa47b('0x12')](_0x1b0d0c,_0x59d3d6)[_0xa47b('0x13')](function(_0x48ad60){logger[_0xa47b('0x14')](_0xa47b('0x15'),_0x4882b2,_0xa47b('0x16'));logger[_0xa47b('0x17')](_0xa47b('0x18'),_0x4882b2,_0xa47b('0x16'),JSON[_0xa47b('0x19')](_0x48ad60));if(_0x48ad60[_0xa47b('0x1a')]){if(_0x48ad60[_0xa47b('0x1a')]['code']===0x1f4){logger[_0xa47b('0x1a')](_0xa47b('0x15'),_0x4882b2,_0x48ad60[_0xa47b('0x1a')][_0xa47b('0x1b')]);return _0xbd2fdd(_0x48ad60[_0xa47b('0x1a')]['message']);}logger['error'](_0xa47b('0x15'),_0x4882b2,_0x48ad60['error'][_0xa47b('0x1b')]);return _0x389c7e(_0x48ad60[_0xa47b('0x1a')][_0xa47b('0x1b')]);}else{logger['info'](_0xa47b('0x15'),_0x4882b2,_0xa47b('0x16'));_0x389c7e(_0x48ad60[_0xa47b('0x1c')][_0xa47b('0x1b')]);}})[_0xa47b('0x1d')](function(_0x43776d){logger[_0xa47b('0x1a')]('Dashboard,\x20%s,\x20%s',_0x4882b2,_0x43776d);_0xbd2fdd(_0x43776d);});});} \ No newline at end of file +var _0xdfaa=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x268569,_0x1d4d44){var _0x145e91=function(_0x5ad86b){while(--_0x5ad86b){_0x268569['push'](_0x268569['shift']());}};_0x145e91(++_0x1d4d44);}(_0xdfaa,0xd0));var _0xadfa=function(_0x59223e,_0x48082e){_0x59223e=_0x59223e-0x0;var _0x552c95=_0xdfaa[_0x59223e];return _0x552c95;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var moment=require(_0xadfa('0x2'));var BPromise=require(_0xadfa('0x3'));var rs=require(_0xadfa('0x4'));var fs=require('fs');var Redis=require(_0xadfa('0x5'));var db=require(_0xadfa('0x6'))['db'];var utils=require(_0xadfa('0x7'));var logger=require(_0xadfa('0x8'))(_0xadfa('0x9'));var config=require('../../config/environment');var jayson=require(_0xadfa('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xadfa('0xb')](config[_0xadfa('0xc')],{'host':_0xadfa('0xd'),'port':0x18eb});var socket=require(_0xadfa('0xe'))(new Redis(config[_0xadfa('0xc')]));require(_0xadfa('0xf'))[_0xadfa('0x10')](socket);function respondWithRpcPromise(_0x5a6f04,_0x445e6c,_0x187e94){return new BPromise(function(_0x2fab79,_0x2d5314){return client[_0xadfa('0x11')](_0x5a6f04,_0x187e94)[_0xadfa('0x12')](function(_0xd4e2dc){logger[_0xadfa('0x13')](_0xadfa('0x14'),_0x445e6c,_0xadfa('0x15'));logger[_0xadfa('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x445e6c,_0xadfa('0x15'),JSON[_0xadfa('0x17')](_0xd4e2dc));if(_0xd4e2dc[_0xadfa('0x18')]){if(_0xd4e2dc['error'][_0xadfa('0x19')]===0x1f4){logger[_0xadfa('0x18')]('Dashboard,\x20%s,\x20%s',_0x445e6c,_0xd4e2dc[_0xadfa('0x18')][_0xadfa('0x1a')]);return _0x2d5314(_0xd4e2dc[_0xadfa('0x18')][_0xadfa('0x1a')]);}logger[_0xadfa('0x18')]('Dashboard,\x20%s,\x20%s',_0x445e6c,_0xd4e2dc[_0xadfa('0x18')]['message']);return _0x2fab79(_0xd4e2dc['error'][_0xadfa('0x1a')]);}else{logger[_0xadfa('0x13')](_0xadfa('0x14'),_0x445e6c,_0xadfa('0x15'));_0x2fab79(_0xd4e2dc['result'][_0xadfa('0x1a')]);}})[_0xadfa('0x1b')](function(_0x28c90c){logger['error'](_0xadfa('0x14'),_0x445e6c,_0x28c90c);_0x2d5314(_0x28c90c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f1a6a7c..0c8e160 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 _0x116e=['dashboard:','./dashboard.events','remove','update','emit','removeListener','register','length'];(function(_0x41acfd,_0xcfa795){var _0x3f1e79=function(_0x3e6db9){while(--_0x3e6db9){_0x41acfd['push'](_0x41acfd['shift']());}};_0x3f1e79(++_0xcfa795);}(_0x116e,0x69));var _0xe116=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x116e[_0x56138f];return _0x1acaf7;};'use strict';var DashboardEvents=require(_0xe116('0x0'));var events=['save',_0xe116('0x1'),_0xe116('0x2')];function createListener(_0x57a9b0,_0x276663){return function(_0xb0811b){_0x276663[_0xe116('0x3')](_0x57a9b0,_0xb0811b);};}function removeListener(_0x26dcc7,_0x580c50){return function(){DashboardEvents[_0xe116('0x4')](_0x26dcc7,_0x580c50);};}exports[_0xe116('0x5')]=function(_0x329184){for(var _0x5e0ba1=0x0,_0x4bdce4=events[_0xe116('0x6')];_0x5e0ba1<_0x4bdce4;_0x5e0ba1++){var _0x2fb445=events[_0x5e0ba1];var _0x2c9dfe=createListener(_0xe116('0x7')+_0x2fb445,_0x329184);DashboardEvents['on'](_0x2fb445,_0x2c9dfe);}}; \ No newline at end of file +var _0xb22f=['remove','update','emit','removeListener','dashboard:','./dashboard.events','save'];(function(_0x624548,_0x29f9e0){var _0x3967b0=function(_0x19dfe7){while(--_0x19dfe7){_0x624548['push'](_0x624548['shift']());}};_0x3967b0(++_0x29f9e0);}(_0xb22f,0xad));var _0xfb22=function(_0x3227ee,_0x3a8bdc){_0x3227ee=_0x3227ee-0x0;var _0x196789=_0xb22f[_0x3227ee];return _0x196789;};'use strict';var DashboardEvents=require(_0xfb22('0x0'));var events=[_0xfb22('0x1'),_0xfb22('0x2'),_0xfb22('0x3')];function createListener(_0x11e55b,_0x2ff62f){return function(_0x513599){_0x2ff62f[_0xfb22('0x4')](_0x11e55b,_0x513599);};}function removeListener(_0x27f787,_0x4cfb44){return function(){DashboardEvents[_0xfb22('0x5')](_0x27f787,_0x4cfb44);};}exports['register']=function(_0x363a86){for(var _0x3a90ac=0x0,_0x3b31ff=events['length'];_0x3a90ac<_0x3b31ff;_0x3a90ac++){var _0x3ef3a6=events[_0x3a90ac];var _0x52fd84=createListener(_0xfb22('0x6')+_0x3ef3a6,_0x363a86);DashboardEvents['on'](_0x3ef3a6,_0x52fd84);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 43db593..cf83782 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 _0xa93c=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3236f8,_0x379d97){var _0x2b5ed2=function(_0x3264e6){while(--_0x3264e6){_0x3236f8['push'](_0x3236f8['shift']());}};_0x2b5ed2(++_0x379d97);}(_0xa93c,0xd8));var _0xca93=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xa93c[_0x50a004];return _0x5e9992;};'use strict';var multer=require(_0xca93('0x0'));var util=require(_0xca93('0x1'));var path=require(_0xca93('0x2'));var timeout=require(_0xca93('0x3'));var express=require(_0xca93('0x4'));var router=express[_0xca93('0x5')]();var fs_extra=require(_0xca93('0x6'));var auth=require(_0xca93('0x7'));var interaction=require(_0xca93('0x8'));var config=require(_0xca93('0x9'));var controller=require('./dashboard.controller');router[_0xca93('0xa')]('/',auth[_0xca93('0xb')](),controller[_0xca93('0xc')]);router[_0xca93('0xa')](_0xca93('0xd'),auth[_0xca93('0xb')](),controller[_0xca93('0xe')]);router[_0xca93('0xa')](_0xca93('0xf'),auth[_0xca93('0xb')](),controller[_0xca93('0x10')]);router[_0xca93('0x11')]('/',auth[_0xca93('0xb')](),controller[_0xca93('0x12')]);router['post'](_0xca93('0x13'),auth[_0xca93('0xb')](),controller[_0xca93('0x14')]);router[_0xca93('0x11')]('/:id/items',auth[_0xca93('0xb')](),controller[_0xca93('0x15')]);router['put'](_0xca93('0xd'),auth['isAuthenticated'](),controller[_0xca93('0x16')]);router[_0xca93('0x17')](_0xca93('0xd'),auth[_0xca93('0xb')](),controller['destroy']);module[_0xca93('0x18')]=router; \ No newline at end of file +var _0x8800=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','isAuthenticated','show','/:id/items','create','post','/:id/clone','addItem','put','/:id','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x5d3adf,_0x19d65e){var _0x491f1c=function(_0x3bc6e8){while(--_0x3bc6e8){_0x5d3adf['push'](_0x5d3adf['shift']());}};_0x491f1c(++_0x19d65e);}(_0x8800,0xd4));var _0x0880=function(_0x1682fe,_0x206257){_0x1682fe=_0x1682fe-0x0;var _0x3fc240=_0x8800[_0x1682fe];return _0x3fc240;};'use strict';var multer=require(_0x0880('0x0'));var util=require(_0x0880('0x1'));var path=require('path');var timeout=require(_0x0880('0x2'));var express=require(_0x0880('0x3'));var router=express[_0x0880('0x4')]();var fs_extra=require(_0x0880('0x5'));var auth=require(_0x0880('0x6'));var interaction=require(_0x0880('0x7'));var config=require(_0x0880('0x8'));var controller=require(_0x0880('0x9'));router[_0x0880('0xa')]('/',auth['isAuthenticated'](),controller[_0x0880('0xb')]);router[_0x0880('0xa')]('/:id',auth[_0x0880('0xc')](),controller[_0x0880('0xd')]);router[_0x0880('0xa')](_0x0880('0xe'),auth['isAuthenticated'](),controller['getItems']);router['post']('/',auth[_0x0880('0xc')](),controller[_0x0880('0xf')]);router[_0x0880('0x10')](_0x0880('0x11'),auth[_0x0880('0xc')](),controller['clone']);router[_0x0880('0x10')]('/:id/items',auth[_0x0880('0xc')](),controller[_0x0880('0x12')]);router[_0x0880('0x13')](_0x0880('0x14'),auth['isAuthenticated'](),controller[_0x0880('0x15')]);router[_0x0880('0x16')](_0x0880('0x14'),auth['isAuthenticated'](),controller[_0x0880('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 06a580b..2a92560 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 _0xfcf0=['sequelize','squel','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x5c879e,_0xe58074){var _0x30942b=function(_0x535b57){while(--_0x535b57){_0x5c879e['push'](_0x5c879e['shift']());}};_0x30942b(++_0xe58074);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xfcf0[_0x2d982d];return _0x4f36b0;};'use strict';var Sequelize=require(_0x0fcf('0x0'));var squel=require(_0x0fcf('0x1'));var _=require('lodash');module[_0x0fcf('0x2')]={'title':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0fcf('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0fcf('0x4')]('long'),'get':function(){try{return JSON[_0x0fcf('0x5')](this[_0x0fcf('0x6')](_0x0fcf('0x7')));}catch(_0x3af316){return[];}},'set':function(_0x1bace8){try{this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')](_0x1bace8));}catch(_0x50c575){this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0fcf('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0fcf('0xa')]},'col':{'type':Sequelize[_0x0fcf('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0fcf('0x3')]},'titleFontSize':{'type':Sequelize[_0x0fcf('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x1f70ec,_0x17e3e1){_0x1f70ec=_0x1f70ec-0x0;var _0x37581b=_0x7a54[_0x1f70ec];return _0x37581b;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'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 10e7ce0..3cf6f51 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 _0xb328=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','destroy','type','iframe','attrUrl','attrs','https://','custom','attrPath','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5a9207,_0x3770f9){var _0x51a97b=function(_0x5ce94f){while(--_0x5ce94f){_0x5a9207['push'](_0x5a9207['shift']());}};_0x51a97b(++_0x3770f9);}(_0xb328,0x104));var _0x8b32=function(_0xd65f2d,_0x1aeb88){_0xd65f2d=_0xd65f2d-0x0;var _0xffe841=_0xb328[_0xd65f2d];return _0xffe841;};'use strict';var emlformat=require(_0x8b32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b32('0x1'));var jsonpatch=require(_0x8b32('0x2'));var rp=require('request-promise');var moment=require(_0x8b32('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8b32('0x4'));var util=require(_0x8b32('0x5'));var path=require(_0x8b32('0x6'));var sox=require('sox');var csv=require(_0x8b32('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b32('0x8'));var squel=require(_0x8b32('0x9'));var crypto=require(_0x8b32('0xa'));var jsforce=require(_0x8b32('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8b32('0x7'));var querystring=require(_0x8b32('0xc'));var Papa=require(_0x8b32('0xd'));var Redis=require('ioredis');var authService=require(_0x8b32('0xe'));var qs=require(_0x8b32('0xf'));var as=require(_0x8b32('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b32('0x11'))(_0x8b32('0x12'));var utils=require(_0x8b32('0x13'));var config=require(_0x8b32('0x14'));var licenseUtil=require(_0x8b32('0x15'));var db=require(_0x8b32('0x16'))['db'];config['redis']=_[_0x8b32('0x17')](config['redis'],{'host':_0x8b32('0x18'),'port':0x18eb});var socket=require(_0x8b32('0x19'))(new Redis(config[_0x8b32('0x1a')]));require(_0x8b32('0x1b'))[_0x8b32('0x1c')](socket);function respondWithStatusCode(_0x34e7ec,_0x3d12a0){_0x3d12a0=_0x3d12a0||0xcc;return function(_0x53a6e7){if(_0x53a6e7){return _0x34e7ec[_0x8b32('0x1d')](_0x3d12a0);}return _0x34e7ec[_0x8b32('0x1e')](_0x3d12a0)['end']();};}function respondWithResult(_0x139aee,_0x1696fd){_0x1696fd=_0x1696fd||0xc8;return function(_0x144c2f){if(_0x144c2f){return _0x139aee['status'](_0x1696fd)[_0x8b32('0x1f')](_0x144c2f);}};}function respondWithFilteredResult(_0x2f193c,_0x1e6b4c){return function(_0x3b2287){if(_0x3b2287){var _0x337a6e=typeof _0x1e6b4c[_0x8b32('0x20')]===_0x8b32('0x21')&&typeof _0x1e6b4c['limit']===_0x8b32('0x21');var _0x17b204=_0x3b2287['count'];var _0x3606a7=_0x337a6e?0x0:_0x1e6b4c[_0x8b32('0x20')];var _0x4144a2=_0x337a6e?_0x3b2287[_0x8b32('0x22')]:_0x1e6b4c[_0x8b32('0x20')]+_0x1e6b4c[_0x8b32('0x23')];var _0x390cdb;if(_0x4144a2>=_0x17b204){_0x4144a2=_0x17b204;_0x390cdb=0xc8;}else{_0x390cdb=0xce;}_0x2f193c[_0x8b32('0x1e')](_0x390cdb);return _0x2f193c[_0x8b32('0x24')](_0x8b32('0x25'),_0x3606a7+'-'+_0x4144a2+'/'+_0x17b204)[_0x8b32('0x1f')](_0x3b2287);}return null;};}function patchUpdates(_0x6d7b78){return function(_0x26f8be){try{jsonpatch[_0x8b32('0x26')](_0x26f8be,_0x6d7b78,!![]);}catch(_0x4ba34a){return BPromise['reject'](_0x4ba34a);}return _0x26f8be[_0x8b32('0x27')]();};}function saveUpdates(_0x2be159,_0xd190ff){return function(_0x35259a){if(_0x35259a){return _0x35259a[_0x8b32('0x28')](_0x2be159)[_0x8b32('0x29')](function(_0x119a29){return _0x119a29;});}return null;};}function removeEntity(_0x238439,_0x5bd116){return function(_0x17497d){if(_0x17497d){return _0x17497d['destroy']()[_0x8b32('0x29')](function(){_0x238439['status'](0xcc)[_0x8b32('0x2a')]();});}};}function handleEntityNotFound(_0x2f0bad,_0x54e7f5){return function(_0x1b998a){if(!_0x1b998a){_0x2f0bad[_0x8b32('0x1d')](0x194);}return _0x1b998a;};}function handleError(_0x2a4526,_0x3b3193){_0x3b3193=_0x3b3193||0x1f4;return function(_0x227b69){logger[_0x8b32('0x2b')](_0x227b69[_0x8b32('0x2c')]);if(_0x227b69[_0x8b32('0x2d')]){delete _0x227b69[_0x8b32('0x2d')];}_0x2a4526[_0x8b32('0x1e')](_0x3b3193)[_0x8b32('0x2e')](_0x227b69);};}exports[_0x8b32('0x2f')]=function(_0x413d00,_0x51d32c){var _0x1b4882={'raw':![],'where':{'id':_0x413d00[_0x8b32('0x30')]['id']}},_0x27eb93={};_0x27eb93[_0x8b32('0x31')]=_[_0x8b32('0x32')](db[_0x8b32('0x33')][_0x8b32('0x34')]);_0x27eb93[_0x8b32('0x35')]=_['keys'](_0x413d00['query']);_0x27eb93[_0x8b32('0x36')]=_[_0x8b32('0x37')](_0x27eb93[_0x8b32('0x31')],_0x27eb93[_0x8b32('0x35')]);_0x1b4882[_0x8b32('0x38')]=_[_0x8b32('0x37')](_0x27eb93[_0x8b32('0x31')],qs['fields'](_0x413d00[_0x8b32('0x35')][_0x8b32('0x39')]));_0x1b4882['attributes']=_0x1b4882[_0x8b32('0x38')]['length']?_0x1b4882['attributes']:_0x27eb93[_0x8b32('0x31')];if(_0x413d00[_0x8b32('0x35')][_0x8b32('0x3a')]){_0x1b4882[_0x8b32('0x3b')]=[{'all':!![]}];}_0x1b4882=_[_0x8b32('0x3c')]({},_0x1b4882,_0x413d00[_0x8b32('0x3d')]);return db[_0x8b32('0x33')][_0x8b32('0x3e')](_0x1b4882)[_0x8b32('0x29')](handleEntityNotFound(_0x51d32c,null))[_0x8b32('0x29')](respondWithResult(_0x51d32c,null))[_0x8b32('0x3f')](handleError(_0x51d32c,null));};exports[_0x8b32('0x40')]=function(_0x4852ad,_0x34f3d5){return db[_0x8b32('0x33')][_0x8b32('0x3e')]({'where':{'id':_0x4852ad[_0x8b32('0x30')]['id']}})[_0x8b32('0x29')](handleEntityNotFound(_0x34f3d5,null))[_0x8b32('0x29')](removeEntity(_0x34f3d5,null))[_0x8b32('0x3f')](handleError(_0x34f3d5,null));};function widgetAttributes(_0x59afc3){try{switch(_0x59afc3[_0x8b32('0x41')]){case _0x8b32('0x42'):return[{'name':'attrUrl','value':_0x59afc3[_0x8b32('0x43')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3[_0x8b32('0x44')][0x0]['value']:undefined)||_0x8b32('0x45')}];case _0x8b32('0x46'):return[{'name':_0x8b32('0x47'),'value':_0x59afc3[_0x8b32('0x47')]||(_0x59afc3['attrs']&&_0x59afc3['attrs'][0x0]?_0x59afc3[_0x8b32('0x44')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x59afc3[_0x8b32('0x48')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3[_0x8b32('0x44')][0x0][_0x8b32('0x49')]:undefined)||_0x8b32('0x4a')},{'name':_0x8b32('0x4b'),'value':_0x59afc3[_0x8b32('0x4b')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3['attrs'][0x1]?_0x59afc3[_0x8b32('0x44')][0x1]['value']:undefined)||_0x8b32('0x4c')},{'name':_0x8b32('0x4d'),'value':_0x59afc3[_0x8b32('0x4d')]||(_0x59afc3['attrs']&&_0x59afc3[_0x8b32('0x44')][0x2]?_0x59afc3['attrs'][0x2][_0x8b32('0x49')]:undefined)||0xc}];case _0x8b32('0x4e'):return[{'name':_0x8b32('0x4f'),'value':_0x59afc3[_0x8b32('0x4f')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3[_0x8b32('0x44')][0x0][_0x8b32('0x49')]:undefined)||_0x8b32('0x50')},{'name':_0x8b32('0x51'),'value':_0x59afc3['attrVoiceQueues']||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3['attrs'][0x1]?_0x59afc3['attrs'][0x1][_0x8b32('0x49')]:undefined)||[]},{'name':_0x8b32('0x4d'),'value':_0x59afc3['attrFontSize']||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x2]?_0x59afc3['attrs'][0x2][_0x8b32('0x49')]:undefined)||0x14}];case _0x8b32('0x52'):case'pie-chart':return[{'name':_0x8b32('0x53'),'value':_0x59afc3['attrSerie1']||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3[_0x8b32('0x44')][0x0][_0x8b32('0x49')]:undefined)||_0x8b32('0x50')},{'name':'attrSerie2','value':_0x59afc3[_0x8b32('0x54')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x1]?_0x59afc3[_0x8b32('0x44')][0x1][_0x8b32('0x49')]:undefined)||null},{'name':_0x8b32('0x55'),'value':_0x59afc3[_0x8b32('0x55')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x2]?_0x59afc3[_0x8b32('0x44')][0x2][_0x8b32('0x49')]:undefined)||null},{'name':_0x8b32('0x51'),'value':_0x59afc3[_0x8b32('0x51')]||(_0x59afc3[_0x8b32('0x44')]&&_0x59afc3[_0x8b32('0x44')][0x3]?_0x59afc3[_0x8b32('0x44')][0x3][_0x8b32('0x49')]:undefined)||[]}];case _0x8b32('0x56'):return[{'name':_0x8b32('0x57'),'type':_0x59afc3[_0x8b32('0x58')]||(_0x59afc3['attrs']&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3['attrs'][0x0][_0x8b32('0x41')]:undefined)||null,'value':_0x59afc3[_0x8b32('0x57')]||(_0x59afc3['attrs']&&_0x59afc3[_0x8b32('0x44')][0x0]?_0x59afc3[_0x8b32('0x44')][0x0][_0x8b32('0x49')]:undefined)||null},{'name':_0x8b32('0x59'),'value':_0x59afc3[_0x8b32('0x59')]||(_0x59afc3['attrs']&&_0x59afc3['attrs'][0x1]?_0x59afc3[_0x8b32('0x44')][0x1][_0x8b32('0x49')]:undefined)||0x0}];default:return[];}}catch(_0x1830f8){logger[_0x8b32('0x2b')](_0x8b32('0x5a'),JSON[_0x8b32('0x5b')](_0x1830f8));return[];}}exports[_0x8b32('0x5c')]=function(_0x36938a,_0x308759){if(_0x36938a[_0x8b32('0x5d')]){_0x36938a[_0x8b32('0x5d')]['attrs']=widgetAttributes(_0x36938a[_0x8b32('0x5d')]);}return db[_0x8b32('0x33')][_0x8b32('0x5c')](_0x36938a[_0x8b32('0x5d')],{})['then'](respondWithResult(_0x308759,0xc9))['catch'](handleError(_0x308759,null));};exports[_0x8b32('0x28')]=function(_0x25d9f2,_0x148830){if(_0x25d9f2[_0x8b32('0x5d')]['id']){delete _0x25d9f2[_0x8b32('0x5d')]['id'];}_0x25d9f2[_0x8b32('0x5d')][_0x8b32('0x44')]=widgetAttributes(_0x25d9f2[_0x8b32('0x5d')]);return db[_0x8b32('0x33')]['find']({'where':{'id':_0x25d9f2[_0x8b32('0x30')]['id']}})[_0x8b32('0x29')](handleEntityNotFound(_0x148830,null))[_0x8b32('0x29')](saveUpdates(_0x25d9f2[_0x8b32('0x5d')],null))[_0x8b32('0x29')](respondWithResult(_0x148830,null))['catch'](handleError(_0x148830,null));}; \ No newline at end of file +var _0x4be5=['merge','options','find','catch','params','iframe','attrUrl','attrs','https://','attrHourFormat','value','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include'];(function(_0x4b9c30,_0xbfb43e){var _0xed779a=function(_0x27dbcf){while(--_0x27dbcf){_0x4b9c30['push'](_0x4b9c30['shift']());}};_0xed779a(++_0xbfb43e);}(_0x4be5,0xc1));var _0x54be=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x4be5[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x54be('0x0'));var rimraf=require(_0x54be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54be('0x2'));var rp=require('request-promise');var moment=require(_0x54be('0x3'));var BPromise=require(_0x54be('0x4'));var Mustache=require(_0x54be('0x5'));var util=require(_0x54be('0x6'));var path=require(_0x54be('0x7'));var sox=require(_0x54be('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54be('0x9'));var _=require('lodash');var squel=require(_0x54be('0xa'));var crypto=require(_0x54be('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x54be('0xc'));var toCsv=require(_0x54be('0xd'));var querystring=require(_0x54be('0xe'));var Papa=require(_0x54be('0xf'));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('../../config/license/hardware');var logger=require(_0x54be('0x10'))(_0x54be('0x11'));var utils=require('../../config/utils');var config=require(_0x54be('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x54be('0x13'))['db'];config[_0x54be('0x14')]=_[_0x54be('0x15')](config[_0x54be('0x14')],{'host':_0x54be('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54be('0x14')]));require(_0x54be('0x17'))[_0x54be('0x18')](socket);function respondWithStatusCode(_0x1128d0,_0x26631e){_0x26631e=_0x26631e||0xcc;return function(_0x4350b7){if(_0x4350b7){return _0x1128d0[_0x54be('0x19')](_0x26631e);}return _0x1128d0[_0x54be('0x1a')](_0x26631e)[_0x54be('0x1b')]();};}function respondWithResult(_0x1f6de7,_0x370a02){_0x370a02=_0x370a02||0xc8;return function(_0x16a088){if(_0x16a088){return _0x1f6de7[_0x54be('0x1a')](_0x370a02)[_0x54be('0x1c')](_0x16a088);}};}function respondWithFilteredResult(_0x35be40,_0x2edcee){return function(_0x80317){if(_0x80317){var _0x52d7e4=typeof _0x2edcee[_0x54be('0x1d')]===_0x54be('0x1e')&&typeof _0x2edcee[_0x54be('0x1f')]===_0x54be('0x1e');var _0x349486=_0x80317[_0x54be('0x20')];var _0x4ade16=_0x52d7e4?0x0:_0x2edcee['offset'];var _0x11ba68=_0x52d7e4?_0x80317[_0x54be('0x20')]:_0x2edcee['offset']+_0x2edcee[_0x54be('0x1f')];var _0x537c07;if(_0x11ba68>=_0x349486){_0x11ba68=_0x349486;_0x537c07=0xc8;}else{_0x537c07=0xce;}_0x35be40[_0x54be('0x1a')](_0x537c07);return _0x35be40['set'](_0x54be('0x21'),_0x4ade16+'-'+_0x11ba68+'/'+_0x349486)[_0x54be('0x1c')](_0x80317);}return null;};}function patchUpdates(_0x39b0c8){return function(_0x316af9){try{jsonpatch['apply'](_0x316af9,_0x39b0c8,!![]);}catch(_0x3791e9){return BPromise[_0x54be('0x22')](_0x3791e9);}return _0x316af9[_0x54be('0x23')]();};}function saveUpdates(_0x58c03b,_0x55bcf2){return function(_0x4bbcb6){if(_0x4bbcb6){return _0x4bbcb6[_0x54be('0x24')](_0x58c03b)[_0x54be('0x25')](function(_0x18336e){return _0x18336e;});}return null;};}function removeEntity(_0x4e2eac,_0x3f764c){return function(_0x4ea50d){if(_0x4ea50d){return _0x4ea50d[_0x54be('0x26')]()[_0x54be('0x25')](function(){_0x4e2eac[_0x54be('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e463d,_0x24e270){return function(_0xc6a1b3){if(!_0xc6a1b3){_0x2e463d['sendStatus'](0x194);}return _0xc6a1b3;};}function handleError(_0x12f278,_0xa3f710){_0xa3f710=_0xa3f710||0x1f4;return function(_0x11d2aa){logger[_0x54be('0x27')](_0x11d2aa['stack']);if(_0x11d2aa[_0x54be('0x28')]){delete _0x11d2aa[_0x54be('0x28')];}_0x12f278[_0x54be('0x1a')](_0xa3f710)[_0x54be('0x29')](_0x11d2aa);};}exports['show']=function(_0x1b7a91,_0x4b1386){var _0x1b439a={'raw':![],'where':{'id':_0x1b7a91['params']['id']}},_0x4f2d53={};_0x4f2d53[_0x54be('0x2a')]=_[_0x54be('0x2b')](db[_0x54be('0x2c')][_0x54be('0x2d')]);_0x4f2d53[_0x54be('0x2e')]=_['keys'](_0x1b7a91[_0x54be('0x2e')]);_0x4f2d53['filters']=_[_0x54be('0x2f')](_0x4f2d53[_0x54be('0x2a')],_0x4f2d53[_0x54be('0x2e')]);_0x1b439a[_0x54be('0x30')]=_[_0x54be('0x2f')](_0x4f2d53[_0x54be('0x2a')],qs[_0x54be('0x31')](_0x1b7a91['query'][_0x54be('0x31')]));_0x1b439a[_0x54be('0x30')]=_0x1b439a[_0x54be('0x30')][_0x54be('0x32')]?_0x1b439a['attributes']:_0x4f2d53['model'];if(_0x1b7a91['query'][_0x54be('0x33')]){_0x1b439a[_0x54be('0x34')]=[{'all':!![]}];}_0x1b439a=_[_0x54be('0x35')]({},_0x1b439a,_0x1b7a91[_0x54be('0x36')]);return db['DashboardItem'][_0x54be('0x37')](_0x1b439a)[_0x54be('0x25')](handleEntityNotFound(_0x4b1386,null))[_0x54be('0x25')](respondWithResult(_0x4b1386,null))[_0x54be('0x38')](handleError(_0x4b1386,null));};exports['destroy']=function(_0x3bb166,_0x4f7dc1){return db[_0x54be('0x2c')][_0x54be('0x37')]({'where':{'id':_0x3bb166[_0x54be('0x39')]['id']}})['then'](handleEntityNotFound(_0x4f7dc1,null))[_0x54be('0x25')](removeEntity(_0x4f7dc1,null))[_0x54be('0x38')](handleError(_0x4f7dc1,null));};function widgetAttributes(_0x1b559d){try{switch(_0x1b559d['type']){case _0x54be('0x3a'):return[{'name':_0x54be('0x3b'),'value':_0x1b559d[_0x54be('0x3b')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d['attrs'][0x0]?_0x1b559d['attrs'][0x0]['value']:undefined)||_0x54be('0x3d')}];case'custom':return[{'name':'attrPath','value':_0x1b559d['attrPath']||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x54be('0x3e'),'value':_0x1b559d[_0x54be('0x3e')]||(_0x1b559d['attrs']&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x1b559d['attrTimezone']||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x1]?_0x1b559d[_0x54be('0x3c')][0x1][_0x54be('0x3f')]:undefined)||_0x54be('0x40')},{'name':'attrFontSize','value':_0x1b559d[_0x54be('0x41')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d['attrs'][0x2]?_0x1b559d[_0x54be('0x3c')][0x2][_0x54be('0x3f')]:undefined)||0xc}];case _0x54be('0x42'):return[{'name':_0x54be('0x43'),'value':_0x1b559d[_0x54be('0x43')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0][_0x54be('0x3f')]:undefined)||_0x54be('0x44')},{'name':_0x54be('0x45'),'value':_0x1b559d[_0x54be('0x45')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x1]?_0x1b559d[_0x54be('0x3c')][0x1][_0x54be('0x3f')]:undefined)||[]},{'name':_0x54be('0x41'),'value':_0x1b559d[_0x54be('0x41')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d['attrs'][0x2]?_0x1b559d[_0x54be('0x3c')][0x2][_0x54be('0x3f')]:undefined)||0x14}];case _0x54be('0x46'):case _0x54be('0x47'):return[{'name':_0x54be('0x48'),'value':_0x1b559d['attrSerie1']||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0][_0x54be('0x3f')]:undefined)||_0x54be('0x44')},{'name':'attrSerie2','value':_0x1b559d[_0x54be('0x49')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x1]?_0x1b559d[_0x54be('0x3c')][0x1][_0x54be('0x3f')]:undefined)||null},{'name':_0x54be('0x4a'),'value':_0x1b559d[_0x54be('0x4a')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d['attrs'][0x2]?_0x1b559d[_0x54be('0x3c')][0x2][_0x54be('0x3f')]:undefined)||null},{'name':_0x54be('0x45'),'value':_0x1b559d['attrVoiceQueues']||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x3]?_0x1b559d[_0x54be('0x3c')][0x3][_0x54be('0x3f')]:undefined)||[]}];case _0x54be('0x4b'):return[{'name':_0x54be('0x4c'),'type':_0x1b559d['reportType']||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0][_0x54be('0x4d')]:undefined)||null,'value':_0x1b559d[_0x54be('0x4c')]||(_0x1b559d[_0x54be('0x3c')]&&_0x1b559d[_0x54be('0x3c')][0x0]?_0x1b559d[_0x54be('0x3c')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1b559d[_0x54be('0x4e')]||(_0x1b559d['attrs']&&_0x1b559d[_0x54be('0x3c')][0x1]?_0x1b559d['attrs'][0x1][_0x54be('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x266b50){logger[_0x54be('0x27')](_0x54be('0x4f'),JSON['stringify'](_0x266b50));return[];}}exports[_0x54be('0x50')]=function(_0x1c2dc6,_0x5a678b){if(_0x1c2dc6['body']){_0x1c2dc6[_0x54be('0x51')]['attrs']=widgetAttributes(_0x1c2dc6[_0x54be('0x51')]);}return db[_0x54be('0x2c')][_0x54be('0x50')](_0x1c2dc6[_0x54be('0x51')],{})[_0x54be('0x25')](respondWithResult(_0x5a678b,0xc9))['catch'](handleError(_0x5a678b,null));};exports[_0x54be('0x24')]=function(_0x4d9146,_0x1e42bd){if(_0x4d9146['body']['id']){delete _0x4d9146[_0x54be('0x51')]['id'];}_0x4d9146[_0x54be('0x51')][_0x54be('0x3c')]=widgetAttributes(_0x4d9146[_0x54be('0x51')]);return db[_0x54be('0x2c')][_0x54be('0x37')]({'where':{'id':_0x4d9146[_0x54be('0x39')]['id']}})[_0x54be('0x25')](handleEntityNotFound(_0x1e42bd,null))[_0x54be('0x25')](saveUpdates(_0x4d9146[_0x54be('0x51')],null))[_0x54be('0x25')](respondWithResult(_0x1e42bd,null))['catch'](handleError(_0x1e42bd,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index efbf634..9ee4f46 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 _0x1c76=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit'];(function(_0x34f553,_0x5885f0){var _0x271bf2=function(_0x481545){while(--_0x481545){_0x34f553['push'](_0x34f553['shift']());}};_0x271bf2(++_0x5885f0);}(_0x1c76,0x107));var _0x61c7=function(_0x10b312,_0x349cdd){_0x10b312=_0x10b312-0x0;var _0x3f0935=_0x1c76[_0x10b312];return _0x3f0935;};'use strict';var EventEmitter=require(_0x61c7('0x0'));var DashboardItem=require(_0x61c7('0x1'))['db'][_0x61c7('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x61c7('0x3')](0x0);var events={'afterCreate':_0x61c7('0x4'),'afterUpdate':_0x61c7('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa73bfc){return function(_0xbdbee5,_0x6b87b7,_0x4de42a){DashboardItemEvents[_0x61c7('0x6')](_0xa73bfc+':'+_0xbdbee5['id'],_0xbdbee5);DashboardItemEvents[_0x61c7('0x6')](_0xa73bfc,_0xbdbee5);_0x4de42a(null);};}for(var e in events){if(events[_0x61c7('0x7')](e)){var event=events[e];DashboardItem[_0x61c7('0x8')](e,emitEvent(event));}}module[_0x61c7('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xbd1c=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xbd1c,0x14e));var _0xcbd1=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbd1c[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0xcbd1('0x0'));var DashboardItem=require(_0xcbd1('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xcbd1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbd1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x336f52){return function(_0xefdb86,_0x1a419d,_0x593014){DashboardItemEvents[_0xcbd1('0x4')](_0x336f52+':'+_0xefdb86['id'],_0xefdb86);DashboardItemEvents['emit'](_0x336f52,_0xefdb86);_0x593014(null);};}for(var e in events){if(events[_0xcbd1('0x5')](e)){var event=events[e];DashboardItem[_0xcbd1('0x6')](e,emitEvent(event));}}module[_0xcbd1('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2da7001..6c4d787 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 _0xf8cd=['api','moment','path','rimraf','exports','define','dashboard_items','lodash','util','../../config/logger'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xf8cd,0x16f));var _0xdf8c=function(_0x2f50e2,_0x346e69){_0x2f50e2=_0x2f50e2-0x0;var _0x19414d=_0xf8cd[_0x2f50e2];return _0x19414d;};'use strict';var _=require(_0xdf8c('0x0'));var util=require(_0xdf8c('0x1'));var logger=require(_0xdf8c('0x2'))(_0xdf8c('0x3'));var moment=require(_0xdf8c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf8c('0x5'));var rimraf=require(_0xdf8c('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xdf8c('0x7')]=function(_0x4d8081,_0x451cb1){return _0x4d8081[_0xdf8c('0x8')]('DashboardItem',attributes,{'tableName':_0xdf8c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94fe=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x15e4cd,_0x71d779){var _0x577ea1=function(_0x2b451f){while(--_0x2b451f){_0x15e4cd['push'](_0x15e4cd['shift']());}};_0x577ea1(++_0x71d779);}(_0x94fe,0x167));var _0xe94f=function(_0x5d18ea,_0x2dd44a){_0x5d18ea=_0x5d18ea-0x0;var _0x302e72=_0x94fe[_0x5d18ea];return _0x302e72;};'use strict';var _=require(_0xe94f('0x0'));var util=require(_0xe94f('0x1'));var logger=require(_0xe94f('0x2'))(_0xe94f('0x3'));var moment=require(_0xe94f('0x4'));var BPromise=require('bluebird');var rp=require(_0xe94f('0x5'));var fs=require('fs');var path=require(_0xe94f('0x6'));var rimraf=require(_0xe94f('0x7'));var config=require(_0xe94f('0x8'));var attributes=require(_0xe94f('0x9'));module[_0xe94f('0xa')]=function(_0x13ee9a,_0x14ea58){return _0x13ee9a['define'](_0xe94f('0xb'),attributes,{'tableName':_0xe94f('0xc'),'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 945fbff..9eec39d 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 _0x2719=['localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x41b9ec,_0x2af5f9){var _0xc68d0f=function(_0x5b014a){while(--_0x5b014a){_0x41b9ec['push'](_0x41b9ec['shift']());}};_0xc68d0f(++_0x2af5f9);}(_0x2719,0x17c));var _0x9271=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0x2719[_0x4fa0ea];return _0x51d027;};'use strict';var _=require(_0x9271('0x0'));var util=require(_0x9271('0x1'));var moment=require(_0x9271('0x2'));var BPromise=require(_0x9271('0x3'));var rs=require(_0x9271('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9271('0x5'))['db'];var utils=require(_0x9271('0x6'));var logger=require('../../config/logger')(_0x9271('0x7'));var config=require(_0x9271('0x8'));var jayson=require(_0x9271('0x9'));var client=jayson['client'][_0x9271('0xa')]({'port':0x232a});config[_0x9271('0xb')]=_['defaults'](config[_0x9271('0xb')],{'host':_0x9271('0xc'),'port':0x18eb});var socket=require(_0x9271('0xd'))(new Redis(config[_0x9271('0xb')]));require(_0x9271('0xe'))['register'](socket);function respondWithRpcPromise(_0x46ab82,_0x2b2f7c,_0x323ecf){return new BPromise(function(_0x159a3f,_0x40dbc9){return client[_0x9271('0xf')](_0x46ab82,_0x323ecf)[_0x9271('0x10')](function(_0x76a722){logger[_0x9271('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2b2f7c,_0x9271('0x12'));logger[_0x9271('0x13')](_0x9271('0x14'),_0x2b2f7c,_0x9271('0x12'),JSON[_0x9271('0x15')](_0x76a722));if(_0x76a722[_0x9271('0x16')]){if(_0x76a722['error'][_0x9271('0x17')]===0x1f4){logger['error'](_0x9271('0x18'),_0x2b2f7c,_0x76a722[_0x9271('0x16')][_0x9271('0x19')]);return _0x40dbc9(_0x76a722[_0x9271('0x16')][_0x9271('0x19')]);}logger[_0x9271('0x16')]('DashboardItem,\x20%s,\x20%s',_0x2b2f7c,_0x76a722[_0x9271('0x16')][_0x9271('0x19')]);return _0x159a3f(_0x76a722[_0x9271('0x16')][_0x9271('0x19')]);}else{logger[_0x9271('0x11')](_0x9271('0x18'),_0x2b2f7c,_0x9271('0x12'));_0x159a3f(_0x76a722[_0x9271('0x1a')]['message']);}})[_0x9271('0x1b')](function(_0x55ee4a){logger[_0x9271('0x16')](_0x9271('0x18'),_0x2b2f7c,_0x55ee4a);_0x40dbc9(_0x55ee4a);});});} \ No newline at end of file +var _0xe347=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0xe347,0xe2));var _0x7e34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe347[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e34('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e34('0x1'));var rs=require(_0x7e34('0x2'));var fs=require('fs');var Redis=require(_0x7e34('0x3'));var db=require(_0x7e34('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e34('0x5'))(_0x7e34('0x6'));var config=require(_0x7e34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7e34('0x8')][_0x7e34('0x9')]({'port':0x232a});config[_0x7e34('0xa')]=_[_0x7e34('0xb')](config['redis'],{'host':_0x7e34('0xc'),'port':0x18eb});var socket=require(_0x7e34('0xd'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x7e34('0xe')](socket);function respondWithRpcPromise(_0x305646,_0x3c44a4,_0x1785d8){return new BPromise(function(_0x2b925d,_0x338317){return client[_0x7e34('0xf')](_0x305646,_0x1785d8)[_0x7e34('0x10')](function(_0x41e32f){logger[_0x7e34('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3c44a4,_0x7e34('0x12'));logger[_0x7e34('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3c44a4,_0x7e34('0x12'),JSON[_0x7e34('0x14')](_0x41e32f));if(_0x41e32f[_0x7e34('0x15')]){if(_0x41e32f['error'][_0x7e34('0x16')]===0x1f4){logger[_0x7e34('0x15')](_0x7e34('0x17'),_0x3c44a4,_0x41e32f[_0x7e34('0x15')]['message']);return _0x338317(_0x41e32f['error'][_0x7e34('0x18')]);}logger[_0x7e34('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3c44a4,_0x41e32f[_0x7e34('0x15')][_0x7e34('0x18')]);return _0x2b925d(_0x41e32f['error'][_0x7e34('0x18')]);}else{logger[_0x7e34('0x11')](_0x7e34('0x17'),_0x3c44a4,_0x7e34('0x12'));_0x2b925d(_0x41e32f['result']['message']);}})[_0x7e34('0x19')](function(_0x5cf14a){logger[_0x7e34('0x15')](_0x7e34('0x17'),_0x3c44a4,_0x5cf14a);_0x338317(_0x5cf14a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index fe890bb..b878fad 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 _0xaca4=['length','./dashboardItem.events','save','emit','removeListener','register'];(function(_0x21f4a3,_0xe52114){var _0x55eb87=function(_0x1410ef){while(--_0x1410ef){_0x21f4a3['push'](_0x21f4a3['shift']());}};_0x55eb87(++_0xe52114);}(_0xaca4,0x145));var _0x4aca=function(_0x1e84ff,_0x354f81){_0x1e84ff=_0x1e84ff-0x0;var _0x244512=_0xaca4[_0x1e84ff];return _0x244512;};'use strict';var DashboardItemEvents=require(_0x4aca('0x0'));var events=[_0x4aca('0x1'),'remove','update'];function createListener(_0x5ea558,_0x2a80ef){return function(_0x29dd41){_0x2a80ef[_0x4aca('0x2')](_0x5ea558,_0x29dd41);};}function removeListener(_0x1602f4,_0x11f074){return function(){DashboardItemEvents[_0x4aca('0x3')](_0x1602f4,_0x11f074);};}exports[_0x4aca('0x4')]=function(_0x2ac61d){for(var _0x411418=0x0,_0x2bf8cb=events[_0x4aca('0x5')];_0x411418<_0x2bf8cb;_0x411418++){var _0x1be776=events[_0x411418];var _0x849016=createListener('dashboardItem:'+_0x1be776,_0x2ac61d);DashboardItemEvents['on'](_0x1be776,_0x849016);}}; \ No newline at end of file +var _0xc013=['dashboardItem:','remove','update','emit','removeListener','register','length'];(function(_0x1a2543,_0x4487a6){var _0x12b6c6=function(_0x84d150){while(--_0x84d150){_0x1a2543['push'](_0x1a2543['shift']());}};_0x12b6c6(++_0x4487a6);}(_0xc013,0xda));var _0x3c01=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc013[_0x13d07a];return _0x5ee0ee;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x3c01('0x0'),_0x3c01('0x1')];function createListener(_0x90ed5c,_0x148be7){return function(_0x51136b){_0x148be7[_0x3c01('0x2')](_0x90ed5c,_0x51136b);};}function removeListener(_0x12cf24,_0xd80b75){return function(){DashboardItemEvents[_0x3c01('0x3')](_0x12cf24,_0xd80b75);};}exports[_0x3c01('0x4')]=function(_0xa3c620){for(var _0x3a5fcf=0x0,_0x227e36=events[_0x3c01('0x5')];_0x3a5fcf<_0x227e36;_0x3a5fcf++){var _0x49b953=events[_0x3a5fcf];var _0x29f307=createListener(_0x3c01('0x6')+_0x49b953,_0xa3c620);DashboardItemEvents['on'](_0x49b953,_0x29f307);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 9252515..21993bd 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 _0x9cea=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x305bdf,_0x1fd2d7){var _0x4b8c73=function(_0x45289e){while(--_0x45289e){_0x305bdf['push'](_0x305bdf['shift']());}};_0x4b8c73(++_0x1fd2d7);}(_0x9cea,0x1c3));var _0xa9ce=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9cea[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xa9ce('0x0'));var util=require('util');var path=require(_0xa9ce('0x1'));var timeout=require(_0xa9ce('0x2'));var express=require(_0xa9ce('0x3'));var router=express[_0xa9ce('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa9ce('0x5'));var config=require(_0xa9ce('0x6'));var controller=require('./dashboardItem.controller');router[_0xa9ce('0x7')](_0xa9ce('0x8'),auth[_0xa9ce('0x9')](),controller[_0xa9ce('0xa')]);router[_0xa9ce('0xb')]('/',auth[_0xa9ce('0x9')](),controller[_0xa9ce('0xc')]);router[_0xa9ce('0xd')](_0xa9ce('0x8'),auth['isAuthenticated'](),controller[_0xa9ce('0xe')]);router[_0xa9ce('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa9ce('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf49e=['isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id'];(function(_0x523e7f,_0x5d6ed6){var _0xe715c6=function(_0x49aaa1){while(--_0x49aaa1){_0x523e7f['push'](_0x523e7f['shift']());}};_0xe715c6(++_0x5d6ed6);}(_0xf49e,0xb3));var _0xef49=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf49e[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xef49('0x0'));var util=require(_0xef49('0x1'));var path=require(_0xef49('0x2'));var timeout=require(_0xef49('0x3'));var express=require(_0xef49('0x4'));var router=express['Router']();var fs_extra=require(_0xef49('0x5'));var auth=require(_0xef49('0x6'));var interaction=require(_0xef49('0x7'));var config=require('../../config/environment');var controller=require(_0xef49('0x8'));router[_0xef49('0x9')](_0xef49('0xa'),auth[_0xef49('0xb')](),controller[_0xef49('0xc')]);router[_0xef49('0xd')]('/',auth[_0xef49('0xb')](),controller['create']);router[_0xef49('0xe')](_0xef49('0xa'),auth[_0xef49('0xb')](),controller[_0xef49('0xf')]);router[_0xef49('0x10')](_0xef49('0xa'),auth[_0xef49('0xb')](),controller[_0xef49('0x11')]);module[_0xef49('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 cdc2b1f..1d1abd3 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 _0xb31c=['STRING','ENUM','first','second','third','sequelize'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xb31c,0x101));var _0xcb31=function(_0x159b5e,_0x178251){_0x159b5e=_0x159b5e-0x0;var _0x4fb93d=_0xb31c[_0x159b5e];return _0x4fb93d;};'use strict';var Sequelize=require(_0xcb31('0x0'));module['exports']={'name':{'type':Sequelize[_0xcb31('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xcb31('0x2')](_0xcb31('0x3'),_0xcb31('0x4'),_0xcb31('0x5')),'allowNull':![],'defaultValue':_0xcb31('0x3')},'description':{'type':Sequelize[_0xcb31('0x1')]}}; \ No newline at end of file +var _0xc271=['first','second','third','exports','STRING'];(function(_0x5404e9,_0x2d43e8){var _0x1ba85e=function(_0x45ceb9){while(--_0x45ceb9){_0x5404e9['push'](_0x5404e9['shift']());}};_0x1ba85e(++_0x2d43e8);}(_0xc271,0xd5));var _0x1c27=function(_0x4a6de2,_0x183433){_0x4a6de2=_0x4a6de2-0x0;var _0x3b0690=_0xc271[_0x4a6de2];return _0x3b0690;};'use strict';var Sequelize=require('sequelize');module[_0x1c27('0x0')]={'name':{'type':Sequelize[_0x1c27('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x1c27('0x2'),_0x1c27('0x3'),_0x1c27('0x4')),'allowNull':![],'defaultValue':_0x1c27('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 88f0769..3dee4ad 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 _0xc205=['destroy','end','error','stack','name','index','map','Disposition','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','include','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','Dispositions','UserProfileResource'];(function(_0x97bb48,_0x40dec1){var _0xd01b6=function(_0xff7505){while(--_0xff7505){_0x97bb48['push'](_0x97bb48['shift']());}};_0xd01b6(++_0x40dec1);}(_0xc205,0xcb));var _0x5c20=function(_0x5b2224,_0x1d20c3){_0x5b2224=_0x5b2224-0x0;var _0x4a65c9=_0xc205[_0x5b2224];return _0x4a65c9;};'use strict';var emlformat=require(_0x5c20('0x0'));var rimraf=require(_0x5c20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c20('0x2'));var rp=require(_0x5c20('0x3'));var moment=require(_0x5c20('0x4'));var BPromise=require(_0x5c20('0x5'));var Mustache=require(_0x5c20('0x6'));var util=require(_0x5c20('0x7'));var path=require(_0x5c20('0x8'));var sox=require(_0x5c20('0x9'));var csv=require(_0x5c20('0xa'));var ejs=require(_0x5c20('0xb'));var fs=require('fs');var fs_extra=require(_0x5c20('0xc'));var _=require('lodash');var squel=require(_0x5c20('0xd'));var crypto=require('crypto');var jsforce=require(_0x5c20('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c20('0xa'));var querystring=require(_0x5c20('0xf'));var Papa=require(_0x5c20('0x10'));var Redis=require(_0x5c20('0x11'));var authService=require(_0x5c20('0x12'));var qs=require(_0x5c20('0x13'));var as=require(_0x5c20('0x14'));var hardwareService=require(_0x5c20('0x15'));var logger=require(_0x5c20('0x16'))(_0x5c20('0x17'));var utils=require('../../config/utils');var config=require(_0x5c20('0x18'));var licenseUtil=require(_0x5c20('0x19'));var db=require(_0x5c20('0x1a'))['db'];function respondWithStatusCode(_0x4fd0e2,_0x367082){_0x367082=_0x367082||0xcc;return function(_0x5701c5){if(_0x5701c5){return _0x4fd0e2[_0x5c20('0x1b')](_0x367082);}return _0x4fd0e2[_0x5c20('0x1c')](_0x367082)['end']();};}function respondWithResult(_0x34608f,_0x74240e){_0x74240e=_0x74240e||0xc8;return function(_0x16666b){if(_0x16666b){return _0x34608f['status'](_0x74240e)[_0x5c20('0x1d')](_0x16666b);}};}function respondWithFilteredResult(_0x5a7407,_0x37c601){return function(_0xac4be7){if(_0xac4be7){var _0x27a65f=typeof _0x37c601[_0x5c20('0x1e')]==='undefined'&&typeof _0x37c601[_0x5c20('0x1f')]===_0x5c20('0x20');var _0x4b1cb4=_0xac4be7[_0x5c20('0x21')];var _0x5c1050=_0x27a65f?0x0:_0x37c601[_0x5c20('0x1e')];var _0x52fafa=_0x27a65f?_0xac4be7[_0x5c20('0x21')]:_0x37c601[_0x5c20('0x1e')]+_0x37c601['limit'];var _0x1bc0f0;if(_0x52fafa>=_0x4b1cb4){_0x52fafa=_0x4b1cb4;_0x1bc0f0=0xc8;}else{_0x1bc0f0=0xce;}_0x5a7407[_0x5c20('0x1c')](_0x1bc0f0);return _0x5a7407['set'](_0x5c20('0x22'),_0x5c1050+'-'+_0x52fafa+'/'+_0x4b1cb4)['json'](_0xac4be7);}return null;};}function patchUpdates(_0x359dee){return function(_0x5b8f3d){try{jsonpatch[_0x5c20('0x23')](_0x5b8f3d,_0x359dee,!![]);}catch(_0x123b80){return BPromise[_0x5c20('0x24')](_0x123b80);}return _0x5b8f3d[_0x5c20('0x25')]();};}function saveUpdates(_0xe1849d,_0xcc3b93){return function(_0x34506d){if(_0x34506d){return _0x34506d[_0x5c20('0x26')](_0xe1849d)[_0x5c20('0x27')](function(_0x300280){return _0x300280;});}return null;};}function removeEntity(_0x24fbb6,_0x274765){return function(_0x596217){if(_0x596217){return _0x596217['destroy']()[_0x5c20('0x27')](function(){var _0x317d2f=_0x596217[_0x5c20('0x28')]({'plain':!![]});var _0x327db0=_0x5c20('0x29');return db[_0x5c20('0x2a')][_0x5c20('0x2b')]({'where':{'type':_0x327db0,'resourceId':_0x317d2f['id']}})['then'](function(){return _0x596217;});})[_0x5c20('0x27')](function(){_0x24fbb6[_0x5c20('0x1c')](0xcc)[_0x5c20('0x2c')]();});}};}function handleEntityNotFound(_0x2b8948,_0xf00ed4){return function(_0x2f694f){if(!_0x2f694f){_0x2b8948[_0x5c20('0x1b')](0x194);}return _0x2f694f;};}function handleError(_0x3f139c,_0x510786){_0x510786=_0x510786||0x1f4;return function(_0x4bfbd0){logger[_0x5c20('0x2d')](_0x4bfbd0[_0x5c20('0x2e')]);if(_0x4bfbd0[_0x5c20('0x2f')]){delete _0x4bfbd0[_0x5c20('0x2f')];}_0x3f139c[_0x5c20('0x1c')](_0x510786)['send'](_0x4bfbd0);};}exports[_0x5c20('0x30')]=function(_0xa66e3e,_0x5f2152){var _0x8c376a={},_0x1753f0={},_0x5cc2bc={'count':0x0,'rows':[]};var _0x5604df=_[_0x5c20('0x31')](db[_0x5c20('0x32')][_0x5c20('0x33')],function(_0x4b804a){return{'name':_0x4b804a['fieldName'],'type':_0x4b804a['type'][_0x5c20('0x34')]};});_0x1753f0[_0x5c20('0x35')]=_[_0x5c20('0x31')](_0x5604df,'name');_0x1753f0['query']=_['keys'](_0xa66e3e[_0x5c20('0x36')]);_0x1753f0[_0x5c20('0x37')]=_[_0x5c20('0x38')](_0x1753f0[_0x5c20('0x35')],_0x1753f0['query']);_0x8c376a[_0x5c20('0x39')]=_[_0x5c20('0x38')](_0x1753f0[_0x5c20('0x35')],qs[_0x5c20('0x3a')](_0xa66e3e[_0x5c20('0x36')][_0x5c20('0x3a')]));_0x8c376a[_0x5c20('0x39')]=_0x8c376a[_0x5c20('0x39')][_0x5c20('0x3b')]?_0x8c376a[_0x5c20('0x39')]:_0x1753f0['model'];if(!_0xa66e3e[_0x5c20('0x36')]['hasOwnProperty'](_0x5c20('0x3c'))){_0x8c376a['limit']=qs[_0x5c20('0x1f')](_0xa66e3e[_0x5c20('0x36')]['limit']);_0x8c376a[_0x5c20('0x1e')]=qs['offset'](_0xa66e3e[_0x5c20('0x36')][_0x5c20('0x1e')]);}_0x8c376a[_0x5c20('0x3d')]=qs[_0x5c20('0x3e')](_0xa66e3e[_0x5c20('0x36')]['sort']);_0x8c376a['where']=qs[_0x5c20('0x37')](_[_0x5c20('0x3f')](_0xa66e3e[_0x5c20('0x36')],_0x1753f0['filters']),_0x5604df);if(_0xa66e3e[_0x5c20('0x36')][_0x5c20('0x40')]){_0x8c376a[_0x5c20('0x41')]=_[_0x5c20('0x42')](_0x8c376a[_0x5c20('0x41')],{'$or':_['map'](_0x5604df,function(_0x3a1d14){if(_0x3a1d14[_0x5c20('0x43')]!=='VIRTUAL'){var _0x1144d7={};_0x1144d7[_0x3a1d14[_0x5c20('0x2f')]]={'$like':'%'+_0xa66e3e[_0x5c20('0x36')]['filter']+'%'};return _0x1144d7;}})});}_0x8c376a=_[_0x5c20('0x42')]({},_0x8c376a,_0xa66e3e['options']);var _0x2c247b={'where':_0x8c376a[_0x5c20('0x41')]};return db['Disposition']['count'](_0x2c247b)[_0x5c20('0x27')](function(_0x4b3575){_0x5cc2bc[_0x5c20('0x21')]=_0x4b3575;if(_0xa66e3e['query']['includeAll']){_0x8c376a[_0x5c20('0x44')]=[{'all':!![]}];}return db[_0x5c20('0x32')]['findAll'](_0x8c376a);})[_0x5c20('0x27')](function(_0x10d79e){_0x5cc2bc[_0x5c20('0x45')]=_0x10d79e;return _0x5cc2bc;})[_0x5c20('0x27')](respondWithFilteredResult(_0x5f2152,_0x8c376a))[_0x5c20('0x46')](handleError(_0x5f2152,null));};exports[_0x5c20('0x47')]=function(_0x844d0c,_0x426fe1){var _0x23e0df={'raw':!![],'where':{'id':_0x844d0c[_0x5c20('0x48')]['id']}},_0x43e751={};_0x43e751[_0x5c20('0x35')]=_[_0x5c20('0x49')](db[_0x5c20('0x32')][_0x5c20('0x33')]);_0x43e751['query']=_[_0x5c20('0x49')](_0x844d0c['query']);_0x43e751[_0x5c20('0x37')]=_['intersection'](_0x43e751[_0x5c20('0x35')],_0x43e751['query']);_0x23e0df[_0x5c20('0x39')]=_['intersection'](_0x43e751['model'],qs[_0x5c20('0x3a')](_0x844d0c[_0x5c20('0x36')][_0x5c20('0x3a')]));_0x23e0df[_0x5c20('0x39')]=_0x23e0df[_0x5c20('0x39')]['length']?_0x23e0df['attributes']:_0x43e751[_0x5c20('0x35')];if(_0x844d0c[_0x5c20('0x36')]['includeAll']){_0x23e0df[_0x5c20('0x44')]=[{'all':!![]}];}_0x23e0df=_['merge']({},_0x23e0df,_0x844d0c[_0x5c20('0x4a')]);return db[_0x5c20('0x32')][_0x5c20('0x4b')](_0x23e0df)[_0x5c20('0x27')](handleEntityNotFound(_0x426fe1,null))[_0x5c20('0x27')](respondWithResult(_0x426fe1,null))[_0x5c20('0x46')](handleError(_0x426fe1,null));};exports[_0x5c20('0x4c')]=function(_0x295742,_0xe6e4b6){return db['Disposition'][_0x5c20('0x4c')](_0x295742[_0x5c20('0x4d')],{})[_0x5c20('0x27')](function(_0x48477e){var _0x1a9ac9=_0x295742[_0x5c20('0x4e')][_0x5c20('0x28')]({'plain':!![]});if(!_0x1a9ac9)throw new Error(_0x5c20('0x4f'));if(_0x1a9ac9['role']===_0x5c20('0x4e')){var _0x4f977a=_0x48477e[_0x5c20('0x28')]({'plain':!![]});var _0x1b38d9=_0x5c20('0x29');return db[_0x5c20('0x50')]['find']({'where':{'name':_0x1b38d9,'userProfileId':_0x1a9ac9[_0x5c20('0x51')]},'raw':!![]})[_0x5c20('0x27')](function(_0x2aaf1a){if(_0x2aaf1a&&_0x2aaf1a['autoAssociation']===0x0){return db[_0x5c20('0x2a')]['create']({'name':_0x4f977a['name'],'resourceId':_0x4f977a['id'],'type':_0x2aaf1a[_0x5c20('0x2f')],'sectionId':_0x2aaf1a['id']},{})[_0x5c20('0x27')](function(){return _0x48477e;});}else{return _0x48477e;}})[_0x5c20('0x46')](function(_0x58f608){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58f608);throw _0x58f608;});}return _0x48477e;})[_0x5c20('0x27')](respondWithResult(_0xe6e4b6,0xc9))[_0x5c20('0x46')](handleError(_0xe6e4b6,null));};exports[_0x5c20('0x26')]=function(_0x1f8a2e,_0x1d3976){if(_0x1f8a2e[_0x5c20('0x4d')]['id']){delete _0x1f8a2e[_0x5c20('0x4d')]['id'];}return db[_0x5c20('0x32')]['find']({'where':{'id':_0x1f8a2e[_0x5c20('0x48')]['id']}})[_0x5c20('0x27')](handleEntityNotFound(_0x1d3976,null))[_0x5c20('0x27')](saveUpdates(_0x1f8a2e['body'],null))[_0x5c20('0x27')](respondWithResult(_0x1d3976,null))['catch'](handleError(_0x1d3976,null));};exports[_0x5c20('0x2b')]=function(_0xa88c2f,_0x234b63){return db[_0x5c20('0x32')]['find']({'where':{'id':_0xa88c2f['params']['id']}})[_0x5c20('0x27')](handleEntityNotFound(_0x234b63,null))[_0x5c20('0x27')](removeEntity(_0x234b63,null))['catch'](handleError(_0x234b63,null));}; \ No newline at end of file +var _0x2635=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','limit','undefined','count','offset','set','apply','save','then','destroy','Dispositions','end','stack','name','send','index','map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x2635,0x148));var _0x5263=function(_0x518d96,_0x2082d9){_0x518d96=_0x518d96-0x0;var _0x9a6070=_0x2635[_0x518d96];return _0x9a6070;};'use strict';var emlformat=require(_0x5263('0x0'));var rimraf=require(_0x5263('0x1'));var zipdir=require(_0x5263('0x2'));var jsonpatch=require(_0x5263('0x3'));var rp=require(_0x5263('0x4'));var moment=require(_0x5263('0x5'));var BPromise=require(_0x5263('0x6'));var Mustache=require(_0x5263('0x7'));var util=require(_0x5263('0x8'));var path=require(_0x5263('0x9'));var sox=require(_0x5263('0xa'));var csv=require(_0x5263('0xb'));var ejs=require(_0x5263('0xc'));var fs=require('fs');var fs_extra=require(_0x5263('0xd'));var _=require(_0x5263('0xe'));var squel=require(_0x5263('0xf'));var crypto=require(_0x5263('0x10'));var jsforce=require(_0x5263('0x11'));var deskjs=require(_0x5263('0x12'));var toCsv=require(_0x5263('0xb'));var querystring=require('querystring');var Papa=require(_0x5263('0x13'));var Redis=require(_0x5263('0x14'));var authService=require(_0x5263('0x15'));var qs=require(_0x5263('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5263('0x17'));var logger=require(_0x5263('0x18'))(_0x5263('0x19'));var utils=require(_0x5263('0x1a'));var config=require(_0x5263('0x1b'));var licenseUtil=require(_0x5263('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41b23d,_0x50fa06){_0x50fa06=_0x50fa06||0xcc;return function(_0x367908){if(_0x367908){return _0x41b23d['sendStatus'](_0x50fa06);}return _0x41b23d['status'](_0x50fa06)['end']();};}function respondWithResult(_0x25c590,_0x23b978){_0x23b978=_0x23b978||0xc8;return function(_0x220178){if(_0x220178){return _0x25c590[_0x5263('0x1d')](_0x23b978)[_0x5263('0x1e')](_0x220178);}};}function respondWithFilteredResult(_0x3f2e33,_0x15d7aa){return function(_0x3a50d6){if(_0x3a50d6){var _0x1614d1=typeof _0x15d7aa['offset']==='undefined'&&typeof _0x15d7aa[_0x5263('0x1f')]===_0x5263('0x20');var _0x3094dc=_0x3a50d6[_0x5263('0x21')];var _0x424736=_0x1614d1?0x0:_0x15d7aa[_0x5263('0x22')];var _0x1d3853=_0x1614d1?_0x3a50d6['count']:_0x15d7aa[_0x5263('0x22')]+_0x15d7aa[_0x5263('0x1f')];var _0x172381;if(_0x1d3853>=_0x3094dc){_0x1d3853=_0x3094dc;_0x172381=0xc8;}else{_0x172381=0xce;}_0x3f2e33[_0x5263('0x1d')](_0x172381);return _0x3f2e33[_0x5263('0x23')]('Content-Range',_0x424736+'-'+_0x1d3853+'/'+_0x3094dc)[_0x5263('0x1e')](_0x3a50d6);}return null;};}function patchUpdates(_0x116cd3){return function(_0x4e8fc1){try{jsonpatch[_0x5263('0x24')](_0x4e8fc1,_0x116cd3,!![]);}catch(_0x25542b){return BPromise['reject'](_0x25542b);}return _0x4e8fc1[_0x5263('0x25')]();};}function saveUpdates(_0x55b008,_0x421875){return function(_0x4712f6){if(_0x4712f6){return _0x4712f6['update'](_0x55b008)[_0x5263('0x26')](function(_0x2bec36){return _0x2bec36;});}return null;};}function removeEntity(_0x4c043d,_0xb39f33){return function(_0x150e59){if(_0x150e59){return _0x150e59[_0x5263('0x27')]()[_0x5263('0x26')](function(){var _0x56b990=_0x150e59['get']({'plain':!![]});var _0x2d3916=_0x5263('0x28');return db['UserProfileResource'][_0x5263('0x27')]({'where':{'type':_0x2d3916,'resourceId':_0x56b990['id']}})['then'](function(){return _0x150e59;});})['then'](function(){_0x4c043d['status'](0xcc)[_0x5263('0x29')]();});}};}function handleEntityNotFound(_0x292868,_0x34edb8){return function(_0x44edf1){if(!_0x44edf1){_0x292868['sendStatus'](0x194);}return _0x44edf1;};}function handleError(_0x4bfd22,_0x207586){_0x207586=_0x207586||0x1f4;return function(_0x30cd85){logger['error'](_0x30cd85[_0x5263('0x2a')]);if(_0x30cd85['name']){delete _0x30cd85[_0x5263('0x2b')];}_0x4bfd22[_0x5263('0x1d')](_0x207586)[_0x5263('0x2c')](_0x30cd85);};}exports[_0x5263('0x2d')]=function(_0xb4e455,_0x5eec8a){var _0x571e67={},_0x3de43b={},_0x3145ac={'count':0x0,'rows':[]};var _0x540483=_[_0x5263('0x2e')](db[_0x5263('0x2f')]['rawAttributes'],function(_0x3c689a){return{'name':_0x3c689a[_0x5263('0x30')],'type':_0x3c689a[_0x5263('0x31')][_0x5263('0x32')]};});_0x3de43b[_0x5263('0x33')]=_['map'](_0x540483,_0x5263('0x2b'));_0x3de43b[_0x5263('0x34')]=_[_0x5263('0x35')](_0xb4e455[_0x5263('0x34')]);_0x3de43b[_0x5263('0x36')]=_[_0x5263('0x37')](_0x3de43b[_0x5263('0x33')],_0x3de43b[_0x5263('0x34')]);_0x571e67[_0x5263('0x38')]=_['intersection'](_0x3de43b[_0x5263('0x33')],qs['fields'](_0xb4e455['query'][_0x5263('0x39')]));_0x571e67[_0x5263('0x38')]=_0x571e67[_0x5263('0x38')][_0x5263('0x3a')]?_0x571e67['attributes']:_0x3de43b['model'];if(!_0xb4e455[_0x5263('0x34')][_0x5263('0x3b')](_0x5263('0x3c'))){_0x571e67['limit']=qs[_0x5263('0x1f')](_0xb4e455['query']['limit']);_0x571e67['offset']=qs[_0x5263('0x22')](_0xb4e455[_0x5263('0x34')][_0x5263('0x22')]);}_0x571e67[_0x5263('0x3d')]=qs[_0x5263('0x3e')](_0xb4e455[_0x5263('0x34')][_0x5263('0x3e')]);_0x571e67['where']=qs['filters'](_[_0x5263('0x3f')](_0xb4e455['query'],_0x3de43b[_0x5263('0x36')]),_0x540483);if(_0xb4e455['query'][_0x5263('0x40')]){_0x571e67[_0x5263('0x41')]=_[_0x5263('0x42')](_0x571e67[_0x5263('0x41')],{'$or':_[_0x5263('0x2e')](_0x540483,function(_0x4b7632){if(_0x4b7632[_0x5263('0x31')]!==_0x5263('0x43')){var _0x1ddcdc={};_0x1ddcdc[_0x4b7632[_0x5263('0x2b')]]={'$like':'%'+_0xb4e455[_0x5263('0x34')]['filter']+'%'};return _0x1ddcdc;}})});}_0x571e67=_[_0x5263('0x42')]({},_0x571e67,_0xb4e455['options']);var _0x17ac1b={'where':_0x571e67['where']};return db[_0x5263('0x2f')][_0x5263('0x21')](_0x17ac1b)['then'](function(_0x51943a){_0x3145ac[_0x5263('0x21')]=_0x51943a;if(_0xb4e455[_0x5263('0x34')][_0x5263('0x44')]){_0x571e67['include']=[{'all':!![]}];}return db[_0x5263('0x2f')][_0x5263('0x45')](_0x571e67);})[_0x5263('0x26')](function(_0x22c452){_0x3145ac[_0x5263('0x46')]=_0x22c452;return _0x3145ac;})[_0x5263('0x26')](respondWithFilteredResult(_0x5eec8a,_0x571e67))[_0x5263('0x47')](handleError(_0x5eec8a,null));};exports[_0x5263('0x48')]=function(_0x5208a6,_0x4ddbe7){var _0x33907c={'raw':!![],'where':{'id':_0x5208a6[_0x5263('0x49')]['id']}},_0x1de98a={};_0x1de98a['model']=_['keys'](db[_0x5263('0x2f')]['rawAttributes']);_0x1de98a['query']=_[_0x5263('0x35')](_0x5208a6[_0x5263('0x34')]);_0x1de98a['filters']=_[_0x5263('0x37')](_0x1de98a['model'],_0x1de98a[_0x5263('0x34')]);_0x33907c[_0x5263('0x38')]=_['intersection'](_0x1de98a[_0x5263('0x33')],qs[_0x5263('0x39')](_0x5208a6[_0x5263('0x34')][_0x5263('0x39')]));_0x33907c[_0x5263('0x38')]=_0x33907c[_0x5263('0x38')][_0x5263('0x3a')]?_0x33907c[_0x5263('0x38')]:_0x1de98a[_0x5263('0x33')];if(_0x5208a6[_0x5263('0x34')][_0x5263('0x44')]){_0x33907c[_0x5263('0x4a')]=[{'all':!![]}];}_0x33907c=_[_0x5263('0x42')]({},_0x33907c,_0x5208a6['options']);return db[_0x5263('0x2f')][_0x5263('0x4b')](_0x33907c)[_0x5263('0x26')](handleEntityNotFound(_0x4ddbe7,null))[_0x5263('0x26')](respondWithResult(_0x4ddbe7,null))['catch'](handleError(_0x4ddbe7,null));};exports[_0x5263('0x4c')]=function(_0x49dff8,_0x2eb4e4){return db['Disposition'][_0x5263('0x4c')](_0x49dff8[_0x5263('0x4d')],{})[_0x5263('0x26')](function(_0xb16ba){var _0xe91acd=_0x49dff8[_0x5263('0x4e')][_0x5263('0x4f')]({'plain':!![]});if(!_0xe91acd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe91acd[_0x5263('0x50')]===_0x5263('0x4e')){var _0x4c5a27=_0xb16ba['get']({'plain':!![]});var _0x8f6466=_0x5263('0x28');return db[_0x5263('0x51')][_0x5263('0x4b')]({'where':{'name':_0x8f6466,'userProfileId':_0xe91acd['userProfileId']},'raw':!![]})[_0x5263('0x26')](function(_0x1a2fcf){if(_0x1a2fcf&&_0x1a2fcf[_0x5263('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c5a27[_0x5263('0x2b')],'resourceId':_0x4c5a27['id'],'type':_0x1a2fcf[_0x5263('0x2b')],'sectionId':_0x1a2fcf['id']},{})['then'](function(){return _0xb16ba;});}else{return _0xb16ba;}})['catch'](function(_0x106a5f){logger['error'](_0x5263('0x53'),_0x106a5f);throw _0x106a5f;});}return _0xb16ba;})[_0x5263('0x26')](respondWithResult(_0x2eb4e4,0xc9))[_0x5263('0x47')](handleError(_0x2eb4e4,null));};exports['update']=function(_0x50f1da,_0x532e05){if(_0x50f1da[_0x5263('0x4d')]['id']){delete _0x50f1da[_0x5263('0x4d')]['id'];}return db[_0x5263('0x2f')][_0x5263('0x4b')]({'where':{'id':_0x50f1da[_0x5263('0x49')]['id']}})[_0x5263('0x26')](handleEntityNotFound(_0x532e05,null))[_0x5263('0x26')](saveUpdates(_0x50f1da[_0x5263('0x4d')],null))[_0x5263('0x26')](respondWithResult(_0x532e05,null))[_0x5263('0x47')](handleError(_0x532e05,null));};exports[_0x5263('0x27')]=function(_0x4de3d7,_0x46e413){return db[_0x5263('0x2f')][_0x5263('0x4b')]({'where':{'id':_0x4de3d7[_0x5263('0x49')]['id']}})[_0x5263('0x26')](handleEntityNotFound(_0x46e413,null))[_0x5263('0x26')](removeEntity(_0x46e413,null))['catch'](handleError(_0x46e413,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f0322ae..64e60e7 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 _0xb19d=['OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId'];(function(_0x55f9c5,_0x58c540){var _0x18900d=function(_0x4ba148){while(--_0x4ba148){_0x55f9c5['push'](_0x55f9c5['shift']());}};_0x18900d(++_0x58c540);}(_0xb19d,0x1b3));var _0xdb19=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xb19d[_0x2d8d69];return _0x39ae22;};'use strict';var _=require('lodash');var util=require(_0xdb19('0x0'));var logger=require(_0xdb19('0x1'))(_0xdb19('0x2'));var moment=require(_0xdb19('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb19('0x4'));var fs=require('fs');var path=require(_0xdb19('0x5'));var rimraf=require(_0xdb19('0x6'));var config=require(_0xdb19('0x7'));var attributes=require(_0xdb19('0x8'));module[_0xdb19('0x9')]=function(_0x2bf75a,_0x599c68){return _0x2bf75a[_0xdb19('0xa')](_0xdb19('0xb'),attributes,{'tableName':_0xdb19('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdb19('0xd'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':[_0xdb19('0xe'),_0xdb19('0xf')]},{'unique':!![],'name':_0xdb19('0x10'),'fields':[_0xdb19('0xe'),'MailAccountId']},{'unique':!![],'name':_0xdb19('0x11'),'fields':['name',_0xdb19('0x12')]},{'unique':!![],'name':_0xdb19('0x13'),'fields':[_0xdb19('0xe'),_0xdb19('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0xdb19('0xe'),_0xdb19('0x15')]},{'unique':!![],'name':_0xdb19('0x16'),'fields':['name',_0xdb19('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe652=['name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name','ListId','ChatWebsiteId','name_mail'];(function(_0x427bda,_0x7cd6ca){var _0x298587=function(_0x28735c){while(--_0x28735c){_0x427bda['push'](_0x427bda['shift']());}};_0x298587(++_0x7cd6ca);}(_0xe652,0xf5));var _0x2e65=function(_0x4cb26a,_0x16bb49){_0x4cb26a=_0x4cb26a-0x0;var _0x12e181=_0xe652[_0x4cb26a];return _0x12e181;};'use strict';var _=require(_0x2e65('0x0'));var util=require('util');var logger=require(_0x2e65('0x1'))(_0x2e65('0x2'));var moment=require(_0x2e65('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e65('0x4'));var rimraf=require(_0x2e65('0x5'));var config=require(_0x2e65('0x6'));var attributes=require(_0x2e65('0x7'));module['exports']=function(_0x1b2be4,_0x26ad00){return _0x1b2be4[_0x2e65('0x8')](_0x2e65('0x9'),attributes,{'tableName':_0x2e65('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x2e65('0xb'),_0x2e65('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x2e65('0xb'),_0x2e65('0xd')]},{'unique':!![],'name':_0x2e65('0xe'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x2e65('0xf'),'fields':['name',_0x2e65('0x10')]},{'unique':!![],'name':'name_fax','fields':['name',_0x2e65('0x11')]},{'unique':!![],'name':_0x2e65('0x12'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x2e65('0x13'),'fields':[_0x2e65('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index a89dedd..dcb6b60 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(_0x1f5dd5,_0x2b60b0){var _0x3daafc=function(_0x5643ff){while(--_0x5643ff){_0x1f5dd5['push'](_0x1f5dd5['shift']());}};_0x3daafc(++_0x2b60b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x2bf496,_0x18211d){var _0x47ba6a=function(_0x43baf6){while(--_0x43baf6){_0x2bf496['push'](_0x2bf496['shift']());}};_0x47ba6a(++_0x18211d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 b548773..3d6defe 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 _0x95dc=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x146f93,_0x5c5dac){var _0x3c78b7=function(_0x46652a){while(--_0x46652a){_0x146f93['push'](_0x146f93['shift']());}};_0x3c78b7(++_0x5c5dac);}(_0x95dc,0x7f));var _0xc95d=function(_0x5beb45,_0x2cef68){_0x5beb45=_0x5beb45-0x0;var _0x29781d=_0x95dc[_0x5beb45];return _0x29781d;};'use strict';var multer=require(_0xc95d('0x0'));var util=require('util');var path=require(_0xc95d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc95d('0x2'));var router=express[_0xc95d('0x3')]();var fs_extra=require(_0xc95d('0x4'));var auth=require(_0xc95d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc95d('0x6'));var controller=require(_0xc95d('0x7'));router[_0xc95d('0x8')]('/',auth[_0xc95d('0x9')](),controller[_0xc95d('0xa')]);router['get'](_0xc95d('0xb'),auth[_0xc95d('0x9')](),controller[_0xc95d('0xc')]);router[_0xc95d('0xd')]('/',auth[_0xc95d('0x9')](),controller[_0xc95d('0xe')]);router[_0xc95d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc95d('0x10')]);router[_0xc95d('0x11')]('/:id',auth[_0xc95d('0x9')](),controller['destroy']);module[_0xc95d('0x12')]=router; \ No newline at end of file +var _0x4b84=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4b84,0x10b));var _0x44b8=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x4b84[_0x2fb87c];return _0x43038b;};'use strict';var multer=require(_0x44b8('0x0'));var util=require('util');var path=require(_0x44b8('0x1'));var timeout=require(_0x44b8('0x2'));var express=require('express');var router=express[_0x44b8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x4'));var interaction=require(_0x44b8('0x5'));var config=require(_0x44b8('0x6'));var controller=require('./disposition.controller');router[_0x44b8('0x7')]('/',auth[_0x44b8('0x8')](),controller['index']);router[_0x44b8('0x7')](_0x44b8('0x9'),auth[_0x44b8('0x8')](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth[_0x44b8('0x8')](),controller['create']);router[_0x44b8('0xc')](_0x44b8('0x9'),auth[_0x44b8('0x8')](),controller[_0x44b8('0xd')]);router[_0x44b8('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index ab982eb..f559ad5 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 _0x919d=['v17,v27,v29','INTEGER','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','localstationid','ENUM','7200','9600','12000','4800','2400','14400'];(function(_0x4452a1,_0x1d50fa){var _0x2e5604=function(_0x198e90){while(--_0x198e90){_0x4452a1['push'](_0x4452a1['shift']());}};_0x2e5604(++_0x1d50fa);}(_0x919d,0x1c0));var _0xd919=function(_0x3ed536,_0x38296d){_0x3ed536=_0x3ed536-0x0;var _0x543a14=_0x919d[_0x3ed536];return _0x543a14;};'use strict';var Sequelize=require(_0xd919('0x0'));module[_0xd919('0x1')]={'name':{'type':Sequelize[_0xd919('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd919('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xd919('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xd919('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xd919('0x4')},'minrate':{'type':Sequelize[_0xd919('0x5')]('2400','4800',_0xd919('0x6'),_0xd919('0x7'),_0xd919('0x8'),'14400'),'defaultValue':_0xd919('0x9')},'maxrate':{'type':Sequelize[_0xd919('0x5')](_0xd919('0xa'),_0xd919('0x9'),_0xd919('0x6'),'9600',_0xd919('0x8'),_0xd919('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xd919('0xc')},'gateway':{'type':Sequelize[_0xd919('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd919('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd919('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0xd919('0xe'),'DADHI',_0xd919('0xf')),'defaultValue':_0xd919('0x10')},'key':{'type':Sequelize[_0xd919('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd919('0x11')],'defaultValue':function(){return _0xd919('0x12');}},'notificationSound':{'type':Sequelize[_0xd919('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd919('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd919('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd919('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd919('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd919('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd919('0x13')],'defaultValue':![],'comment':_0xd919('0x14'),'set':function(_0x503cba){if(!_0x503cba)this[_0xd919('0x15')](_0xd919('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x503cba);}}}; \ No newline at end of file +var _0x5dbc=['IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','INTEGER'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x5dbc,0xa4));var _0xc5db=function(_0x4acc2c,_0x424e67){_0x4acc2c=_0x4acc2c-0x0;var _0x2624ac=_0x5dbc[_0x4acc2c];return _0x2624ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc5db('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc5db('0x0')]},'ecm':{'type':Sequelize[_0xc5db('0x1')]('yes','no'),'defaultValue':_0xc5db('0x2')},'headerinfo':{'type':Sequelize[_0xc5db('0x0')],'defaultValue':_0xc5db('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xc5db('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xc5db('0x5'),_0xc5db('0x6'),_0xc5db('0x7'),_0xc5db('0x8'),_0xc5db('0x9'),_0xc5db('0xa')),'defaultValue':_0xc5db('0x6')},'maxrate':{'type':Sequelize[_0xc5db('0x1')](_0xc5db('0x5'),_0xc5db('0x6'),_0xc5db('0x7'),_0xc5db('0x8'),'12000',_0xc5db('0xa')),'defaultValue':_0xc5db('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc5db('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc5db('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc5db('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0xc5db('0xc'),_0xc5db('0xd'),_0xc5db('0xe')),'defaultValue':_0xc5db('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc5db('0x10')],'defaultValue':function(){return _0xc5db('0x11');}},'notificationSound':{'type':Sequelize[_0xc5db('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc5db('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc5db('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc5db('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc5db('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc5db('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc5db('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc5db('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc5db('0x12')],'defaultValue':![],'comment':_0xc5db('0x13'),'set':function(_0x5716f9){if(!_0x5716f9)this['setDataValue'](_0xc5db('0x14'),null);this[_0xc5db('0x15')]('mandatoryDisposition',_0x5716f9);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index bbd0ae4..bcdf056 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 _0x1e75=['where','filter','merge','options','findAll','rows','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','hasOwnProperty','order','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','key','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','send','CmList','List','updatedAt','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','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','defaults','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','sort'];(function(_0x3d6eb1,_0x1f99b1){var _0x4e5356=function(_0x203406){while(--_0x203406){_0x3d6eb1['push'](_0x3d6eb1['shift']());}};_0x4e5356(++_0x1f99b1);}(_0x1e75,0x6f));var _0x51e7=function(_0x94442f,_0x843f87){_0x94442f=_0x94442f-0x0;var _0x5d4e56=_0x1e75[_0x94442f];return _0x5d4e56;};'use strict';var emlformat=require(_0x51e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x51e7('0x1'));var rp=require(_0x51e7('0x2'));var moment=require(_0x51e7('0x3'));var BPromise=require(_0x51e7('0x4'));var Mustache=require(_0x51e7('0x5'));var util=require(_0x51e7('0x6'));var path=require(_0x51e7('0x7'));var sox=require(_0x51e7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51e7('0x9'));var _=require(_0x51e7('0xa'));var squel=require(_0x51e7('0xb'));var crypto=require(_0x51e7('0xc'));var jsforce=require(_0x51e7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x51e7('0xe'));var querystring=require(_0x51e7('0xf'));var Papa=require(_0x51e7('0x10'));var Redis=require('ioredis');var authService=require(_0x51e7('0x11'));var qs=require(_0x51e7('0x12'));var as=require(_0x51e7('0x13'));var hardwareService=require(_0x51e7('0x14'));var logger=require(_0x51e7('0x15'))(_0x51e7('0x16'));var utils=require(_0x51e7('0x17'));var config=require(_0x51e7('0x18'));var licenseUtil=require(_0x51e7('0x19'));var db=require(_0x51e7('0x1a'))['db'];config['redis']=_[_0x51e7('0x1b')](config[_0x51e7('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x51e7('0x1d'))(new Redis(config[_0x51e7('0x1c')]));require(_0x51e7('0x1e'))[_0x51e7('0x1f')](socket);var jayson=require(_0x51e7('0x20'));var client=jayson['client'][_0x51e7('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x51e7('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4c723e,_0x3bfa36,_0x386be6,_0x52c2c3){return new BPromise(function(_0x1c0006,_0x4738ac){var _0x4fcf60=_0x52c2c3||client;return _0x4fcf60[_0x51e7('0x22')](_0x4c723e,_0x386be6)[_0x51e7('0x23')](function(_0x286bd2){logger[_0x51e7('0x24')](_0x51e7('0x25'),_0x3bfa36,_0x51e7('0x26'));logger[_0x51e7('0x27')](_0x51e7('0x28'),_0x3bfa36,_0x51e7('0x26'),JSON[_0x51e7('0x29')](_0x286bd2));if(_0x286bd2[_0x51e7('0x2a')]){if(_0x286bd2['error'][_0x51e7('0x2b')]===0x1f4){logger[_0x51e7('0x2a')](_0x51e7('0x25'),_0x3bfa36,_0x286bd2[_0x51e7('0x2a')][_0x51e7('0x2c')]);return _0x4738ac(_0x286bd2[_0x51e7('0x2a')][_0x51e7('0x2c')]);}logger['error'](_0x51e7('0x25'),_0x3bfa36,_0x286bd2[_0x51e7('0x2a')][_0x51e7('0x2c')]);return _0x1c0006(_0x286bd2[_0x51e7('0x2a')][_0x51e7('0x2c')]);}else{logger[_0x51e7('0x24')](_0x51e7('0x25'),_0x3bfa36,'request\x20sent');_0x1c0006(_0x286bd2[_0x51e7('0x2d')][_0x51e7('0x2c')]);}})[_0x51e7('0x2e')](function(_0x5e85de){logger[_0x51e7('0x2a')](_0x51e7('0x25'),_0x3bfa36,_0x5e85de);_0x4738ac(_0x5e85de);});});}function respondWithStatusCode(_0x95192c,_0x13efd3){_0x13efd3=_0x13efd3||0xcc;return function(_0x2adc43){if(_0x2adc43){return _0x95192c[_0x51e7('0x2f')](_0x13efd3);}return _0x95192c['status'](_0x13efd3)['end']();};}function respondWithResult(_0x448ff7,_0x146b56){_0x146b56=_0x146b56||0xc8;return function(_0xbb55e){if(_0xbb55e){return _0x448ff7[_0x51e7('0x30')](_0x146b56)[_0x51e7('0x31')](_0xbb55e);}};}function respondWithFilteredResult(_0x3390dd,_0x59f2b4){return function(_0x247b96){if(_0x247b96){var _0x2d047e=typeof _0x59f2b4['offset']===_0x51e7('0x32')&&typeof _0x59f2b4['limit']===_0x51e7('0x32');var _0x14b2b4=_0x247b96[_0x51e7('0x33')];var _0x2a23e1=_0x2d047e?0x0:_0x59f2b4['offset'];var _0x32a769=_0x2d047e?_0x247b96['count']:_0x59f2b4['offset']+_0x59f2b4['limit'];var _0x80244e;if(_0x32a769>=_0x14b2b4){_0x32a769=_0x14b2b4;_0x80244e=0xc8;}else{_0x80244e=0xce;}_0x3390dd['status'](_0x80244e);return _0x3390dd[_0x51e7('0x34')](_0x51e7('0x35'),_0x2a23e1+'-'+_0x32a769+'/'+_0x14b2b4)['json'](_0x247b96);}return null;};}function patchUpdates(_0x34cd52){return function(_0x37b5c9){try{jsonpatch[_0x51e7('0x36')](_0x37b5c9,_0x34cd52,!![]);}catch(_0x28d273){return BPromise[_0x51e7('0x37')](_0x28d273);}return _0x37b5c9[_0x51e7('0x38')]();};}function saveUpdates(_0x5e9e3d,_0x16f172){return function(_0xdfbbe1){if(_0xdfbbe1){return _0xdfbbe1[_0x51e7('0x39')](_0x5e9e3d)[_0x51e7('0x23')](function(_0x409b22){return _0x409b22;});}return null;};}function removeEntity(_0x249a0d,_0x23908c){return function(_0x51d262){if(_0x51d262){return _0x51d262[_0x51e7('0x3a')]()['then'](function(){var _0x31c705=_0x51d262[_0x51e7('0x3b')]({'plain':!![]});var _0x17755e=_0x51e7('0x3c');return db[_0x51e7('0x3d')][_0x51e7('0x3a')]({'where':{'type':_0x17755e,'resourceId':_0x31c705['id']}})['then'](function(){return _0x51d262;});})[_0x51e7('0x23')](function(){_0x249a0d[_0x51e7('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30728c,_0x5e799c){return function(_0x2e0697){if(!_0x2e0697){_0x30728c[_0x51e7('0x2f')](0x194);}return _0x2e0697;};}function handleError(_0xa1b7c5,_0x536784){_0x536784=_0x536784||0x1f4;return function(_0x2298a3){logger['error'](_0x2298a3[_0x51e7('0x3e')]);if(_0x2298a3[_0x51e7('0x3f')]){delete _0x2298a3[_0x51e7('0x3f')];}_0xa1b7c5[_0x51e7('0x30')](_0x536784)['send'](_0x2298a3);};}exports[_0x51e7('0x40')]=function(_0x37b08f,_0x43dd0f){var _0x2ccff5={'include':[{'model':db[_0x51e7('0x41')],'as':_0x51e7('0x42')}]},_0x3a0c26={},_0x38126c={'count':0x0,'rows':[]};var _0x1fd3bd=_[_0x51e7('0x43')](db[_0x51e7('0x44')][_0x51e7('0x45')],function(_0x11f967){return{'name':_0x11f967[_0x51e7('0x46')],'type':_0x11f967[_0x51e7('0x47')]['key']};});_0x3a0c26[_0x51e7('0x48')]=_[_0x51e7('0x43')](_0x1fd3bd,_0x51e7('0x3f'));_0x3a0c26[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0x37b08f[_0x51e7('0x49')]);_0x3a0c26[_0x51e7('0x4b')]=_[_0x51e7('0x4c')](_0x3a0c26[_0x51e7('0x48')],_0x3a0c26['query']);_0x2ccff5[_0x51e7('0x4d')]=_[_0x51e7('0x4c')](_0x3a0c26['model'],qs[_0x51e7('0x4e')](_0x37b08f[_0x51e7('0x49')][_0x51e7('0x4e')]));_0x2ccff5[_0x51e7('0x4d')]=_0x2ccff5[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0x2ccff5[_0x51e7('0x4d')]:_0x3a0c26[_0x51e7('0x48')];if(!_0x37b08f[_0x51e7('0x49')]['hasOwnProperty'](_0x51e7('0x50'))){_0x2ccff5['limit']=qs[_0x51e7('0x51')](_0x37b08f['query'][_0x51e7('0x51')]);_0x2ccff5[_0x51e7('0x52')]=qs[_0x51e7('0x52')](_0x37b08f[_0x51e7('0x49')][_0x51e7('0x52')]);}_0x2ccff5['order']=qs[_0x51e7('0x53')](_0x37b08f[_0x51e7('0x49')][_0x51e7('0x53')]);_0x2ccff5[_0x51e7('0x54')]=qs[_0x51e7('0x4b')](_['pick'](_0x37b08f['query'],_0x3a0c26[_0x51e7('0x4b')]),_0x1fd3bd);if(_0x37b08f[_0x51e7('0x49')][_0x51e7('0x55')]){_0x2ccff5[_0x51e7('0x54')]=_['merge'](_0x2ccff5[_0x51e7('0x54')],{'$or':_['map'](_0x1fd3bd,function(_0x20553d){if(_0x20553d[_0x51e7('0x47')]!=='VIRTUAL'){var _0x1f5878={};_0x1f5878[_0x20553d[_0x51e7('0x3f')]]={'$like':'%'+_0x37b08f[_0x51e7('0x49')][_0x51e7('0x55')]+'%'};return _0x1f5878;}})});}_0x2ccff5=_[_0x51e7('0x56')]({},_0x2ccff5,_0x37b08f[_0x51e7('0x57')]);var _0x366e50={'where':_0x2ccff5[_0x51e7('0x54')]};return db[_0x51e7('0x44')][_0x51e7('0x33')](_0x366e50)[_0x51e7('0x23')](function(_0x2b0dbd){_0x38126c[_0x51e7('0x33')]=_0x2b0dbd;if(_0x37b08f['query']['includeAll']){_0x2ccff5['include']=[{'all':!![]}];}return db[_0x51e7('0x44')][_0x51e7('0x58')](_0x2ccff5);})[_0x51e7('0x23')](function(_0xdf8564){_0x38126c[_0x51e7('0x59')]=_0xdf8564;return _0x38126c;})[_0x51e7('0x23')](respondWithFilteredResult(_0x43dd0f,_0x2ccff5))[_0x51e7('0x2e')](handleError(_0x43dd0f,null));};exports[_0x51e7('0x5a')]=function(_0xaffef9,_0x4919fe){var _0x4256ff={'raw':![],'where':{'id':_0xaffef9[_0x51e7('0x5b')]['id']},'include':[{'model':db[_0x51e7('0x41')],'as':_0x51e7('0x42')}]},_0x23ea48={};_0x23ea48['model']=_[_0x51e7('0x4a')](db[_0x51e7('0x44')][_0x51e7('0x45')]);_0x23ea48[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0xaffef9[_0x51e7('0x49')]);_0x23ea48['filters']=_[_0x51e7('0x4c')](_0x23ea48['model'],_0x23ea48['query']);_0x4256ff[_0x51e7('0x4d')]=_['intersection'](_0x23ea48[_0x51e7('0x48')],qs['fields'](_0xaffef9['query']['fields']));_0x4256ff[_0x51e7('0x4d')]=_0x4256ff[_0x51e7('0x4d')]['length']?_0x4256ff[_0x51e7('0x4d')]:_0x23ea48[_0x51e7('0x48')];if(_0xaffef9[_0x51e7('0x49')]['includeAll']){_0x4256ff[_0x51e7('0x5c')]=[{'all':!![]}];}_0x4256ff=_['merge']({},_0x4256ff,_0xaffef9[_0x51e7('0x57')]);return db[_0x51e7('0x44')]['find'](_0x4256ff)[_0x51e7('0x23')](handleEntityNotFound(_0x4919fe,null))['then'](respondWithResult(_0x4919fe,null))[_0x51e7('0x2e')](handleError(_0x4919fe,null));};exports[_0x51e7('0x5d')]=function(_0x337e96,_0x20fd71){return db[_0x51e7('0x44')][_0x51e7('0x5d')](_0x337e96[_0x51e7('0x5e')],{})['then'](function(_0x142e24){var _0xe12cde=_0x337e96[_0x51e7('0x5f')]['get']({'plain':!![]});if(!_0xe12cde)throw new Error(_0x51e7('0x60'));if(_0xe12cde[_0x51e7('0x61')]===_0x51e7('0x5f')){var _0x4cb5d1=_0x142e24[_0x51e7('0x3b')]({'plain':!![]});var _0x506412=_0x51e7('0x3c');return db[_0x51e7('0x62')]['find']({'where':{'name':_0x506412,'userProfileId':_0xe12cde[_0x51e7('0x63')]},'raw':!![]})[_0x51e7('0x23')](function(_0x517520){if(_0x517520&&_0x517520[_0x51e7('0x64')]===0x0){return db[_0x51e7('0x3d')][_0x51e7('0x5d')]({'name':_0x4cb5d1[_0x51e7('0x3f')],'resourceId':_0x4cb5d1['id'],'type':_0x517520['name'],'sectionId':_0x517520['id']},{})[_0x51e7('0x23')](function(){return _0x142e24;});}else{return _0x142e24;}})[_0x51e7('0x2e')](function(_0x3c68c1){logger[_0x51e7('0x2a')](_0x51e7('0x65'),_0x3c68c1);throw _0x3c68c1;});}return _0x142e24;})[_0x51e7('0x23')](respondWithResult(_0x20fd71,0xc9))[_0x51e7('0x2e')](handleError(_0x20fd71,null));};exports[_0x51e7('0x39')]=function(_0xc9e281,_0x531830){if(_0xc9e281[_0x51e7('0x5e')]['id']){delete _0xc9e281['body']['id'];}return db[_0x51e7('0x44')]['find']({'where':{'id':_0xc9e281[_0x51e7('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x51e7('0x42')}]})['then'](handleEntityNotFound(_0x531830,null))[_0x51e7('0x23')](saveUpdates(_0xc9e281[_0x51e7('0x5e')],null))[_0x51e7('0x23')](respondWithResult(_0x531830,null))[_0x51e7('0x2e')](handleError(_0x531830,null));};exports[_0x51e7('0x3a')]=function(_0x1a6ba3,_0xac218b){return db[_0x51e7('0x44')][_0x51e7('0x66')]({'where':{'id':_0x1a6ba3[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0xac218b,null))['then'](removeEntity(_0xac218b,null))[_0x51e7('0x2e')](handleError(_0xac218b,null));};exports[_0x51e7('0x67')]=function(_0x23c656,_0x46d612){return db[_0x51e7('0x44')][_0x51e7('0x67')]()['then'](respondWithResult(_0x46d612,null))[_0x51e7('0x2e')](handleError(_0x46d612,null));};exports[_0x51e7('0x68')]=function(_0x35d9a2,_0x1b24f2,_0xbfefab){if(_0x35d9a2[_0x51e7('0x5e')]['id']){delete _0x35d9a2[_0x51e7('0x5e')]['id'];}return db['FaxAccount'][_0x51e7('0x66')]({'where':{'id':_0x35d9a2['params']['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x1b24f2,null))[_0x51e7('0x23')](function(_0x2e0dbc){if(_0x2e0dbc){_0x35d9a2[_0x51e7('0x5e')][_0x51e7('0x69')]=_0x2e0dbc['id'];return db['Disposition'][_0x51e7('0x5d')](_0x35d9a2[_0x51e7('0x5e')]);}})[_0x51e7('0x23')](respondWithResult(_0x1b24f2,null))[_0x51e7('0x2e')](handleError(_0x1b24f2,null));};exports[_0x51e7('0x6a')]=function(_0x3b3fa3,_0x175613,_0x5c3ee4){var _0xad44f9={'raw':![],'where':{}};var _0x2c62fc={};var _0x2ea7e9={'count':0x0,'rows':[]};return db['FaxAccount'][_0x51e7('0x6b')]({'where':{'id':_0x3b3fa3[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x175613,null))['then'](function(_0x2abab1){if(_0x2abab1){_0x2c62fc[_0x51e7('0x48')]=_[_0x51e7('0x4a')](db[_0x51e7('0x6c')][_0x51e7('0x45')]);_0x2c62fc[_0x51e7('0x49')]=_['keys'](_0x3b3fa3['query']);_0x2c62fc[_0x51e7('0x4b')]=_['intersection'](_0x2c62fc[_0x51e7('0x48')],_0x2c62fc['query']);_0xad44f9['attributes']=_[_0x51e7('0x4c')](_0x2c62fc[_0x51e7('0x48')],qs[_0x51e7('0x4e')](_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x4e')]));_0xad44f9[_0x51e7('0x4d')]=_0xad44f9[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0xad44f9[_0x51e7('0x4d')]:_0x2c62fc[_0x51e7('0x48')];if(!_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x6d')](_0x51e7('0x50'))){_0xad44f9['limit']=qs[_0x51e7('0x51')](_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x51')]);_0xad44f9['offset']=qs[_0x51e7('0x52')](_0x3b3fa3[_0x51e7('0x49')]['offset']);}_0xad44f9[_0x51e7('0x6e')]=qs[_0x51e7('0x53')](_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x53')]);_0xad44f9[_0x51e7('0x54')]=qs['filters'](_['pick'](_0x3b3fa3['query'],_0x2c62fc[_0x51e7('0x4b')]));_0xad44f9[_0x51e7('0x54')][_0x51e7('0x69')]=_0x2abab1['id'];if(_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x55')]){_0xad44f9[_0x51e7('0x54')]=_['merge'](_0xad44f9[_0x51e7('0x54')],{'$or':_[_0x51e7('0x43')](_0xad44f9[_0x51e7('0x4d')],function(_0xdd1c9e){var _0x38d136={};_0x38d136[_0xdd1c9e]={'$like':'%'+_0x3b3fa3['query'][_0x51e7('0x55')]+'%'};return _0x38d136;})});}_0xad44f9=_['merge']({},_0xad44f9,_0x3b3fa3[_0x51e7('0x57')]);return db[_0x51e7('0x6c')][_0x51e7('0x33')]({'where':_0xad44f9[_0x51e7('0x54')]})[_0x51e7('0x23')](function(_0x8bb509){_0x2ea7e9[_0x51e7('0x33')]=_0x8bb509;if(_0x3b3fa3[_0x51e7('0x49')][_0x51e7('0x6f')]){_0xad44f9[_0x51e7('0x5c')]=[{'all':!![]}];}return db[_0x51e7('0x6c')][_0x51e7('0x58')](_0xad44f9);})['then'](function(_0x3014d6){_0x2ea7e9[_0x51e7('0x59')]=_0x3014d6;return _0x2ea7e9;});}})[_0x51e7('0x23')](respondWithFilteredResult(_0x175613,_0xad44f9))['catch'](handleError(_0x175613,null));};exports[_0x51e7('0x70')]=function(_0xdb8d08,_0x480685,_0x375694){return db[_0x51e7('0x44')][_0x51e7('0x66')]({'where':{'id':_0xdb8d08[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x480685,null))[_0x51e7('0x23')](function(_0x59fc75){if(_0x59fc75){return _0x59fc75['removeDispositions'](_0xdb8d08[_0x51e7('0x49')][_0x51e7('0x71')]);}})[_0x51e7('0x23')](respondWithStatusCode(_0x480685,null))[_0x51e7('0x2e')](handleError(_0x480685,null));};exports['addAnswer']=function(_0x2be151,_0x249497,_0x2b3779){if(_0x2be151[_0x51e7('0x5e')]['id']){delete _0x2be151[_0x51e7('0x5e')]['id'];}return db[_0x51e7('0x44')]['find']({'where':{'id':_0x2be151[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x249497,null))[_0x51e7('0x23')](function(_0x557049){if(_0x557049){_0x2be151[_0x51e7('0x5e')][_0x51e7('0x69')]=_0x557049['id'];return db[_0x51e7('0x72')]['create'](_0x2be151[_0x51e7('0x5e')]);}})['then'](respondWithResult(_0x249497,null))[_0x51e7('0x2e')](handleError(_0x249497,null));};exports[_0x51e7('0x73')]=function(_0x1790e4,_0x411b86,_0x2d58da){var _0x53c73f={'raw':![],'where':{}};var _0x5e8932={};var _0x4bea59={'count':0x0,'rows':[]};return db[_0x51e7('0x44')][_0x51e7('0x6b')]({'where':{'id':_0x1790e4[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x411b86,null))[_0x51e7('0x23')](function(_0x1dab01){if(_0x1dab01){_0x5e8932[_0x51e7('0x48')]=_[_0x51e7('0x4a')](db[_0x51e7('0x72')]['rawAttributes']);_0x5e8932[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0x1790e4['query']);_0x5e8932[_0x51e7('0x4b')]=_[_0x51e7('0x4c')](_0x5e8932[_0x51e7('0x48')],_0x5e8932['query']);_0x53c73f[_0x51e7('0x4d')]=_['intersection'](_0x5e8932[_0x51e7('0x48')],qs[_0x51e7('0x4e')](_0x1790e4[_0x51e7('0x49')][_0x51e7('0x4e')]));_0x53c73f[_0x51e7('0x4d')]=_0x53c73f[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0x53c73f[_0x51e7('0x4d')]:_0x5e8932[_0x51e7('0x48')];if(!_0x1790e4[_0x51e7('0x49')][_0x51e7('0x6d')](_0x51e7('0x50'))){_0x53c73f['limit']=qs[_0x51e7('0x51')](_0x1790e4[_0x51e7('0x49')][_0x51e7('0x51')]);_0x53c73f[_0x51e7('0x52')]=qs[_0x51e7('0x52')](_0x1790e4['query'][_0x51e7('0x52')]);}_0x53c73f[_0x51e7('0x6e')]=qs[_0x51e7('0x53')](_0x1790e4['query']['sort']);_0x53c73f[_0x51e7('0x54')]=qs[_0x51e7('0x4b')](_[_0x51e7('0x74')](_0x1790e4[_0x51e7('0x49')],_0x5e8932['filters']));_0x53c73f[_0x51e7('0x54')][_0x51e7('0x69')]=_0x1dab01['id'];if(_0x1790e4[_0x51e7('0x49')][_0x51e7('0x55')]){_0x53c73f[_0x51e7('0x54')]=_['merge'](_0x53c73f['where'],{'$or':_[_0x51e7('0x43')](_0x53c73f[_0x51e7('0x4d')],function(_0x56789e){var _0x3823eb={};_0x3823eb[_0x56789e]={'$like':'%'+_0x1790e4[_0x51e7('0x49')][_0x51e7('0x55')]+'%'};return _0x3823eb;})});}_0x53c73f=_['merge']({},_0x53c73f,_0x1790e4[_0x51e7('0x57')]);return db[_0x51e7('0x72')][_0x51e7('0x33')]({'where':_0x53c73f[_0x51e7('0x54')]})['then'](function(_0x2ff210){_0x4bea59['count']=_0x2ff210;if(_0x1790e4[_0x51e7('0x49')]['includeAll']){_0x53c73f[_0x51e7('0x5c')]=[{'all':!![]}];}return db[_0x51e7('0x72')][_0x51e7('0x58')](_0x53c73f);})[_0x51e7('0x23')](function(_0x16437b){_0x4bea59[_0x51e7('0x59')]=_0x16437b;return _0x4bea59;});}})[_0x51e7('0x23')](respondWithFilteredResult(_0x411b86,_0x53c73f))[_0x51e7('0x2e')](handleError(_0x411b86,null));};exports[_0x51e7('0x75')]=function(_0x1a8dc3,_0x815aeb,_0x54bcc8){return db[_0x51e7('0x44')]['find']({'where':{'id':_0x1a8dc3['params']['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x815aeb,null))[_0x51e7('0x23')](function(_0x535964){if(_0x535964){return _0x535964['removeAnswers'](_0x1a8dc3[_0x51e7('0x49')][_0x51e7('0x71')]);}})[_0x51e7('0x23')](respondWithStatusCode(_0x815aeb,null))[_0x51e7('0x2e')](handleError(_0x815aeb,null));};exports['addInteraction']=function(_0x5d7536,_0x4ff03c,_0x4874d8){return db[_0x51e7('0x76')][_0x51e7('0x66')]({'where':{'id':_0x5d7536['params']['id']}})['then'](handleEntityNotFound(_0x4ff03c,null))[_0x51e7('0x23')](function(_0x31ad6a){if(_0x31ad6a){return _0x31ad6a[_0x51e7('0x77')](_0x5d7536['body'][_0x51e7('0x71')],_[_0x51e7('0x78')](_0x5d7536[_0x51e7('0x5e')],[_0x51e7('0x71'),'id'])||{});}})['then'](respondWithResult(_0x4ff03c,null))['catch'](handleError(_0x4ff03c,null));};exports[_0x51e7('0x79')]=function(_0x2cf821,_0x35bcf5,_0x4b0728){var _0x555fdf={'raw':![],'where':{}};var _0x53a5a6={};var _0x2e634e={'count':0x0,'rows':[]};return db[_0x51e7('0x44')][_0x51e7('0x6b')]({'where':{'id':_0x2cf821[_0x51e7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x35bcf5,null))[_0x51e7('0x23')](function(_0x476b29){if(_0x476b29){_0x53a5a6[_0x51e7('0x48')]=_['keys'](db[_0x51e7('0x76')][_0x51e7('0x45')]);_0x53a5a6[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0x2cf821['query']);_0x53a5a6[_0x51e7('0x4b')]=_[_0x51e7('0x4c')](_0x53a5a6[_0x51e7('0x48')],_0x53a5a6[_0x51e7('0x49')]);_0x555fdf[_0x51e7('0x4d')]=_['intersection'](_0x53a5a6[_0x51e7('0x48')],qs[_0x51e7('0x4e')](_0x2cf821[_0x51e7('0x49')][_0x51e7('0x4e')]));_0x555fdf[_0x51e7('0x4d')]=_0x555fdf[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0x555fdf[_0x51e7('0x4d')]:_0x53a5a6[_0x51e7('0x48')];if(!_0x2cf821['query'][_0x51e7('0x6d')](_0x51e7('0x50'))){_0x555fdf[_0x51e7('0x51')]=qs[_0x51e7('0x51')](_0x2cf821[_0x51e7('0x49')][_0x51e7('0x51')]);_0x555fdf[_0x51e7('0x52')]=qs[_0x51e7('0x52')](_0x2cf821['query'][_0x51e7('0x52')]);}_0x555fdf[_0x51e7('0x6e')]=qs[_0x51e7('0x53')](_0x2cf821['query'][_0x51e7('0x53')]);_0x555fdf[_0x51e7('0x54')]=qs[_0x51e7('0x4b')](_['pick'](_0x2cf821[_0x51e7('0x49')],_0x53a5a6[_0x51e7('0x4b')]));_0x555fdf['where']['FaxAccountId']=_0x476b29['id'];if(_0x2cf821[_0x51e7('0x49')][_0x51e7('0x55')]){_0x555fdf[_0x51e7('0x54')]=_[_0x51e7('0x56')](_0x555fdf[_0x51e7('0x54')],{'$or':_['map'](_0x555fdf[_0x51e7('0x4d')],function(_0x42dfb3){var _0x504398={};_0x504398[_0x42dfb3]={'$like':'%'+_0x2cf821['query'][_0x51e7('0x55')]+'%'};return _0x504398;})});}_0x555fdf=_['merge']({},_0x555fdf,_0x2cf821[_0x51e7('0x57')]);return db[_0x51e7('0x76')][_0x51e7('0x33')]({'where':_0x555fdf[_0x51e7('0x54')]})[_0x51e7('0x23')](function(_0x3862fb){_0x2e634e['count']=_0x3862fb;if(_0x2cf821[_0x51e7('0x49')][_0x51e7('0x6f')]){_0x555fdf['include']=[{'model':db[_0x51e7('0x7a')],'as':_0x51e7('0x7b'),'required':![]},{'model':db[_0x51e7('0x7c')],'as':_0x51e7('0x7d'),'attributes':[_0x51e7('0x3f'),_0x51e7('0x7e'),_0x51e7('0x7f')],'required':![]},{'model':db[_0x51e7('0x80')],'as':'Tags','attributes':['id',_0x51e7('0x3f'),_0x51e7('0x81')],'where':_0x2cf821[_0x51e7('0x49')][_0x51e7('0x82')]?{'id':_0x2cf821[_0x51e7('0x49')][_0x51e7('0x82')]}:undefined,'required':_0x2cf821[_0x51e7('0x49')][_0x51e7('0x82')]?!![]:![]}];}return db[_0x51e7('0x76')]['findAll'](_0x555fdf);})['then'](function(_0x40b494){_0x2e634e[_0x51e7('0x59')]=_0x40b494;return _0x2e634e;});}})[_0x51e7('0x23')](respondWithFilteredResult(_0x35bcf5,_0x555fdf))[_0x51e7('0x2e')](handleError(_0x35bcf5,null));};exports[_0x51e7('0x83')]=function(_0x16a02a,_0x1a358a,_0x1d7381){return db[_0x51e7('0x44')]['findOne']({'where':{'id':_0x16a02a[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x1a358a,null))[_0x51e7('0x23')](function(_0x2a863c){if(_0x2a863c){return db[_0x51e7('0x84')][_0x51e7('0x85')](function(_0x3e451a){return db['FaxApplication'][_0x51e7('0x3a')]({'where':{'FaxAccountId':_0x16a02a[_0x51e7('0x5b')]['id']},'transaction':_0x3e451a})[_0x51e7('0x23')](function(_0x23cfff){var _0xb8f792=_['map'](_0x16a02a['body'],function(_0x1a4cad){_0x1a4cad[_0x51e7('0x69')]=_0x16a02a['params']['id'];return _0x1a4cad;});return db[_0x51e7('0x86')][_0x51e7('0x87')](_0xb8f792,{'transaction':_0x3e451a});});})[_0x51e7('0x23')](function(){return db[_0x51e7('0x86')][_0x51e7('0x88')]({'where':{'FaxAccountId':_0x16a02a[_0x51e7('0x5b')]['id']},'order':_0x51e7('0x89')});});}})[_0x51e7('0x23')](respondWithResult(_0x1a358a,null))[_0x51e7('0x2e')](handleError(_0x1a358a,null));};exports['getApplications']=function(_0x2f6fef,_0x19af16,_0x503d72){var _0x47cd58={};var _0x5afcea={};var _0x33a35a;var _0x516875;return db[_0x51e7('0x44')][_0x51e7('0x6b')]({'where':{'id':_0x2f6fef[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x19af16,null))[_0x51e7('0x23')](function(_0x3ed351){if(_0x3ed351){_0x33a35a=_0x3ed351;_0x5afcea[_0x51e7('0x48')]=_[_0x51e7('0x4a')](db[_0x51e7('0x86')][_0x51e7('0x45')]);_0x5afcea[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0x2f6fef[_0x51e7('0x49')]);_0x5afcea['filters']=_[_0x51e7('0x4c')](_0x5afcea[_0x51e7('0x48')],_0x5afcea[_0x51e7('0x49')]);_0x47cd58[_0x51e7('0x4d')]=_['intersection'](_0x5afcea[_0x51e7('0x48')],qs[_0x51e7('0x4e')](_0x2f6fef[_0x51e7('0x49')][_0x51e7('0x4e')]));_0x47cd58[_0x51e7('0x4d')]=_0x47cd58[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0x47cd58[_0x51e7('0x4d')]:_0x5afcea[_0x51e7('0x48')];_0x47cd58[_0x51e7('0x6e')]=qs[_0x51e7('0x53')](_0x2f6fef[_0x51e7('0x49')][_0x51e7('0x53')]);_0x47cd58[_0x51e7('0x54')]=qs[_0x51e7('0x4b')](_[_0x51e7('0x74')](_0x2f6fef['query'],_0x5afcea[_0x51e7('0x4b')]));if(_0x2f6fef['query']['filter']){_0x47cd58[_0x51e7('0x54')]=_[_0x51e7('0x56')](_0x47cd58['where'],{'$or':_[_0x51e7('0x43')](_0x47cd58['attributes'],function(_0x30e642){var _0x16ce0f={};_0x16ce0f[_0x30e642]={'$like':'%'+_0x2f6fef['query'][_0x51e7('0x55')]+'%'};return _0x16ce0f;})});}_0x47cd58=_[_0x51e7('0x56')]({},_0x47cd58,_0x2f6fef[_0x51e7('0x57')]);return _0x33a35a[_0x51e7('0x8a')](_0x47cd58);}})[_0x51e7('0x23')](function(_0x481992){if(_0x481992){_0x516875=_0x481992[_0x51e7('0x4f')];if(!_0x2f6fef[_0x51e7('0x49')][_0x51e7('0x6d')](_0x51e7('0x50'))){_0x47cd58['limit']=qs['limit'](_0x2f6fef[_0x51e7('0x49')]['limit']);_0x47cd58[_0x51e7('0x52')]=qs['offset'](_0x2f6fef[_0x51e7('0x49')][_0x51e7('0x52')]);}return _0x33a35a[_0x51e7('0x8a')](_0x47cd58);}})[_0x51e7('0x23')](function(_0x772a4c){if(_0x772a4c){return _0x772a4c?{'count':_0x516875,'rows':_0x772a4c}:null;}})[_0x51e7('0x23')](respondWithResult(_0x19af16,null))[_0x51e7('0x2e')](handleError(_0x19af16,null));};function Extension(_0x59b9e8,_0x431f1e,_0xf2b6ff,_0x37f251){this[_0x51e7('0x8b')]=_0x51e7('0x8c');this['exten']=_0x59b9e8['localstationid'];this['app']=_0x37f251;this[_0x51e7('0x47')]='system';this[_0x51e7('0x8d')]=_0x51e7('0x8e');this[_0x51e7('0x69')]=_0x59b9e8['id'];this['priority']=_0x431f1e;this[_0x51e7('0x8f')]=_0xf2b6ff;}function createExtensionsReciveFax(_0x478d56){var _0x4076da=0x1;var _0x193960=[];_0x193960[_0x51e7('0x90')](new Extension(_0x478d56,_0x4076da,'',_0x51e7('0x91')));_0x4076da+=0x1;_0x193960[_0x51e7('0x90')](new Extension(_0x478d56,_0x4076da,_0x51e7('0x92'),_0x51e7('0x93')));_0x4076da+=0x1;for(var _0x5c0b54 in _0x478d56){if(_0x478d56[_0x51e7('0x6d')](_0x5c0b54)&&(_0x5c0b54===_0x51e7('0x94')||_0x5c0b54==='localstationid'||_0x5c0b54===_0x51e7('0x95')||_0x5c0b54===_0x51e7('0x96')||_0x5c0b54===_0x51e7('0x97')||_0x5c0b54==='maxrate'||_0x5c0b54===_0x51e7('0x98')||_0x5c0b54==='modem'||_0x5c0b54===_0x51e7('0x99'))){_0x193960['push'](new Extension(_0x478d56,_0x4076da,'FAXOPT('+_0x5c0b54+')='+_0x478d56[_0x5c0b54],_0x51e7('0x93')));_0x4076da+=0x1;}}_0x193960[_0x51e7('0x90')](new Extension(_0x478d56,_0x4076da,'6','Wait'));_0x4076da+=0x1;_0x193960[_0x51e7('0x90')](new Extension(_0x478d56,_0x4076da,_0x51e7('0x9a'),_0x51e7('0x9b')));_0x4076da=0x0;return _0x193960;}exports[_0x51e7('0x9c')]=function(_0x48b655,_0x4bccfa,_0x52b360){var _0x3d1f1f;return db[_0x51e7('0x84')][_0x51e7('0x85')](function(_0x26a4f4){return db[_0x51e7('0x44')][_0x51e7('0x5d')](_0x48b655['body'],{'transaction':_0x26a4f4})['then'](function(_0x172f11){_0x3d1f1f=_0x172f11[_0x51e7('0x3b')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x3d1f1f),{'transaction':_0x26a4f4});});})[_0x51e7('0x23')](function(){return _0x3d1f1f;})['then'](respondWithResult(_0x4bccfa,null))[_0x51e7('0x2e')](handleError(_0x4bccfa,null));};exports[_0x51e7('0x9d')]=function(_0x2d398f,_0x141112,_0x2e338c){var _0x3925ca;return db[_0x51e7('0x84')][_0x51e7('0x85')](function(_0x450612){return db['FaxAccount'][_0x51e7('0x39')](_0x2d398f['body'],{'where':{'id':_0x2d398f[_0x51e7('0x5e')]['id']},'transaction':_0x450612})[_0x51e7('0x23')](function(_0x487239){return db['VoiceExtension'][_0x51e7('0x3a')]({'where':{'FaxAccountId':_0x2d398f[_0x51e7('0x5e')]['id']},'transaction':_0x450612})[_0x51e7('0x23')](function(_0x173a11){return db[_0x51e7('0x9e')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x2d398f['body'],['tech',_0x51e7('0x9f'),_0x51e7('0xa0'),'updatedAt',_0x51e7('0xa1'),_0x51e7('0xa2')])),{'transaction':_0x450612});});});})[_0x51e7('0x23')](function(){return db[_0x51e7('0x44')][_0x51e7('0xa3')](_0x2d398f[_0x51e7('0x5e')]['id']);})[_0x51e7('0x23')](respondWithResult(_0x141112,null))[_0x51e7('0x2e')](handleError(_0x141112,null));};exports[_0x51e7('0xa4')]=function(_0x199cdc,_0x4b65f6,_0x72375e){var _0xbc2c2f={'raw':!![],'where':{}};var _0x190a37={};var _0x56567a={'count':0x0,'rows':[]};return db[_0x51e7('0x44')]['findOne']({'where':{'id':_0x199cdc['params']['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x4b65f6,null))[_0x51e7('0x23')](function(_0x1c73dc){if(_0x1c73dc){_0x190a37['model']=_[_0x51e7('0x4a')](db[_0x51e7('0xa5')][_0x51e7('0x45')]);_0x190a37[_0x51e7('0x49')]=_[_0x51e7('0x4a')](_0x199cdc[_0x51e7('0x49')]);_0x190a37['filters']=_[_0x51e7('0x4c')](_0x190a37['model'],_0x190a37[_0x51e7('0x49')]);_0xbc2c2f[_0x51e7('0x4d')]=_['intersection'](_0x190a37['model'],qs[_0x51e7('0x4e')](_0x199cdc[_0x51e7('0x49')][_0x51e7('0x4e')]));_0xbc2c2f[_0x51e7('0x4d')]=_0xbc2c2f[_0x51e7('0x4d')][_0x51e7('0x4f')]?_0xbc2c2f[_0x51e7('0x4d')]:_0x190a37[_0x51e7('0x48')];if(!_0x199cdc[_0x51e7('0x49')][_0x51e7('0x6d')](_0x51e7('0x50'))){_0xbc2c2f[_0x51e7('0x51')]=qs[_0x51e7('0x51')](_0x199cdc['query'][_0x51e7('0x51')]);_0xbc2c2f['offset']=qs[_0x51e7('0x52')](_0x199cdc[_0x51e7('0x49')][_0x51e7('0x52')]);}_0xbc2c2f[_0x51e7('0x6e')]=qs[_0x51e7('0x53')](_0x199cdc['query'][_0x51e7('0x53')]);_0xbc2c2f[_0x51e7('0x54')]=qs[_0x51e7('0x4b')](_[_0x51e7('0x74')](_0x199cdc[_0x51e7('0x49')],_0x190a37[_0x51e7('0x4b')]));_0xbc2c2f[_0x51e7('0x54')][_0x51e7('0x69')]=_0x1c73dc['id'];if(_0x199cdc[_0x51e7('0x49')][_0x51e7('0x55')]){_0xbc2c2f[_0x51e7('0x54')]=_[_0x51e7('0x56')](_0xbc2c2f[_0x51e7('0x54')],{'$or':_[_0x51e7('0x43')](_0xbc2c2f['attributes'],function(_0x1f3888){var _0x593966={};_0x593966[_0x1f3888]={'$like':'%'+_0x199cdc['query']['filter']+'%'};return _0x593966;})});}if(_0x199cdc[_0x51e7('0x49')][_0x51e7('0xa6')]){var _0x54eb3a=_0x199cdc[_0x51e7('0x49')][_0x51e7('0xa6')]['split'](',');var _0x288c3a={};_0x288c3a[_0x54eb3a[0x0]]={'$gte':moment(_0x54eb3a[0x1])[_0x51e7('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbc2c2f[_0x51e7('0x54')]=_['merge'](_0xbc2c2f[_0x51e7('0x54')],_0x288c3a);}_0xbc2c2f=_[_0x51e7('0x56')]({},_0xbc2c2f,_0x199cdc[_0x51e7('0x57')]);return db[_0x51e7('0xa5')][_0x51e7('0x33')]({'where':_0xbc2c2f['where']})['then'](function(_0xca65ad){_0x56567a[_0x51e7('0x33')]=_0xca65ad;if(_0x199cdc[_0x51e7('0x49')]['includeAll']){_0xbc2c2f[_0x51e7('0x5c')]=[{'all':!![]}];}return db[_0x51e7('0xa5')]['findAll'](_0xbc2c2f);})['then'](function(_0x41ac6f){_0x56567a[_0x51e7('0x59')]=_0x41ac6f;return _0x56567a;});}})[_0x51e7('0x23')](respondWithFilteredResult(_0x4b65f6,_0xbc2c2f))[_0x51e7('0x2e')](handleError(_0x4b65f6,null));};exports[_0x51e7('0xa8')]=function(_0x95f541,_0x26695e,_0x52a1df){var _0x377a72,_0x132b13={},_0x14f5d4;if(_0x95f541[_0x51e7('0x5e')]['to']){_0x14f5d4=_0x95f541[_0x51e7('0x5e')]['to'][0x0];}return db[_0x51e7('0x44')][_0x51e7('0x66')]({'where':{'id':_0x95f541[_0x51e7('0x5b')]['id']},'include':[{'model':db[_0x51e7('0xa9')],'as':_0x51e7('0xaa'),'include':[{'model':db[_0x51e7('0x7a')],'as':'Contacts','where':{'fax':_0x14f5d4},'limit':0x1,'order':[[_0x51e7('0xab'),'DESC']]}]}]})[_0x51e7('0x23')](handleEntityNotFound(_0x26695e,null))[_0x51e7('0x23')](function(_0x68211e){_0x377a72=_0x68211e;if(_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')]&&_0x95f541['body'][_0x51e7('0xac')][_0x51e7('0x4f')]){for(var _0x2e99db=0x0;_0x2e99db<_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][_0x51e7('0x4f')];_0x2e99db+=0x1){_0x95f541[_0x51e7('0x5e')]['attachments'][_0x2e99db]={'filename':_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][_0x2e99db]['name'],'id':_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][_0x2e99db]['id'],'path':path[_0x51e7('0xad')](config['root'],_0x51e7('0xae'),_0x95f541['body'][_0x51e7('0xac')][_0x2e99db][_0x51e7('0xaf')])};}}return respondWithRpcPromise('CheckAfterSend',_0x51e7('0xb0'),{'FaxAccountId':_[_0x51e7('0xb1')](_0x95f541['params']['id'])?undefined:_0x95f541[_0x51e7('0x5b')]['id'],'path':_['isNil'](_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][0x0][_0x51e7('0x7')])?undefined:_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][0x0]['path'],'fax':_[_0x51e7('0xb1')](_0x95f541['body']['to'][0x0])?undefined:_0x95f541[_0x51e7('0x5e')]['to'][0x0]},client9002);})[_0x51e7('0x23')](function(){if(_0x377a72){if(_[_0x51e7('0xb1')](_0x95f541[_0x51e7('0x5e')][_0x51e7('0xb2')])){_0x95f541[_0x51e7('0x5e')]['from']=util[_0x51e7('0xa7')]('\x22%s\x22\x20<%s>',_0x377a72[_0x51e7('0x3f')],_0x377a72[_0x51e7('0xb3')]);}if(_0x377a72[_0x51e7('0xaa')]){if(_0x377a72[_0x51e7('0xaa')][_0x51e7('0xb4')][_0x51e7('0x4f')]){return _0x377a72[_0x51e7('0xaa')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x51e7('0x1b')](_0x95f541['body'],{'firstName':_0x95f541[_0x51e7('0x5e')]['to'][0x0],'phone':_0x95f541[_0x51e7('0x5e')]['to'][0x0],'fax':_0x95f541[_0x51e7('0x5e')]['to'][0x0],'ListId':_0x377a72['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x51e7('0x23')](function(_0x3e3904){if(_0x3e3904){return db[_0x51e7('0x76')]['find']({'where':{'ContactId':_0x3e3904['id'],'closed':![],'FaxAccountId':_0x377a72['id']}})['then'](function(_0x29836e){if(_0x29836e){return[_0x29836e,![]];}return db[_0x51e7('0x76')]['create']({'UserId':_0x95f541[_0x51e7('0x5f')]['id'],'ContactId':_0x3e3904['id'],'FaxAccountId':_0x377a72['id'],'fax':_0x95f541[_0x51e7('0x5e')]['to'][0x0],'firstMsgDirection':_0x51e7('0xb5'),'Messages':[_['merge'](_0x95f541[_0x51e7('0x5e')],{'read':![],'body':_0x95f541[_0x51e7('0x5e')]['attachments'][0x0][_0x51e7('0xb6')],'FaxAccountId':_0x377a72['id'],'UserId':_0x95f541[_0x51e7('0x5f')]['id'],'ContactId':_0x3e3904['id'],'AttachmentId':_0x95f541[_0x51e7('0x5e')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x51e7('0xa5')],'as':'Messages'}]})[_0x51e7('0x23')](function(_0x1347a5){return[_0x1347a5,!![]];});});}else{throw new Error(_0x51e7('0xb7'));}})[_0x51e7('0xb8')](function(_0x4e3c87,_0x398961){if(_0x398961){return _0x4e3c87;}return db[_0x51e7('0xa5')][_0x51e7('0x5d')]({'direction':_0x51e7('0xb5'),'read':![],'body':_0x95f541['body'][_0x51e7('0xac')][0x0][_0x51e7('0xb6')],'FaxAccountId':_0x377a72['id'],'FaxInteractionId':_0x4e3c87['id'],'UserId':_0x95f541[_0x51e7('0x5f')]['id'],'ContactId':_0x4e3c87['ContactId'],'AttachmentId':_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][0x0]['id']})['then'](function(_0x555a3b){_0x4e3c87[_0x51e7('0xb9')]['Messages']=[];_0x4e3c87[_0x51e7('0xb9')][_0x51e7('0xba')]['push'](_0x555a3b[_0x51e7('0xb9')]);return _0x4e3c87;});})[_0x51e7('0x23')](function(_0x38816b){respondWithRpcPromise('SendFax',_0x51e7('0xbb'),{'FaxAccountId':_[_0x51e7('0xb1')](_0x95f541['params']['id'])?undefined:_0x95f541['params']['id'],'path':_[_0x51e7('0xb1')](_0x95f541['body'][_0x51e7('0xac')][0x0][_0x51e7('0x7')])?undefined:_0x95f541[_0x51e7('0x5e')]['attachments'][0x0][_0x51e7('0x7')],'fax':_[_0x51e7('0xb1')](_0x95f541[_0x51e7('0x5e')]['to'][0x0])?undefined:_0x95f541[_0x51e7('0x5e')]['to'][0x0],'AttachmentId':_0x95f541[_0x51e7('0x5e')][_0x51e7('0xac')][0x0]['id']},client9002)[_0x51e7('0x23')](function(_0x52ce98){logger[_0x51e7('0x24')](_0x51e7('0xbc'),_0x52ce98);})[_0x51e7('0x2e')](function(_0x1b7802){logger[_0x51e7('0x24')](_0x51e7('0xbc'),_0x1b7802);});return _0x38816b;})[_0x51e7('0x23')](respondWithResult(_0x26695e,null))['catch'](handleError(_0x26695e,null));};exports['addAgents']=function(_0x5c4a2e,_0x362973,_0x37c863){return db['FaxAccount'][_0x51e7('0x66')]({'where':{'id':_0x5c4a2e[_0x51e7('0x5b')]['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x362973,null))[_0x51e7('0x23')](function(_0xe125b9){if(_0xe125b9){return _0xe125b9['addAgents'](_0x5c4a2e[_0x51e7('0x5e')][_0x51e7('0x71')],_['omit'](_0x5c4a2e['body'],['ids','id'])||{})['spread'](function(_0x24f5af){for(var _0x3997bf=0x0;_0x3997bf<_0x5c4a2e[_0x51e7('0x5e')][_0x51e7('0x71')]['length'];_0x3997bf+=0x1){socket[_0x51e7('0xbd')](_0x51e7('0xbe'),{'UserId':Number(_0x5c4a2e['body'][_0x51e7('0x71')][_0x3997bf]),'FaxAccountId':Number(_0x5c4a2e[_0x51e7('0x5b')]['id'])});}return _0x24f5af;});}})[_0x51e7('0x23')](respondWithResult(_0x362973,null))['catch'](handleError(_0x362973,null));};exports[_0x51e7('0xbf')]=function(_0x5e9ea7,_0x4404b4,_0xdcac1c){return db[_0x51e7('0x44')][_0x51e7('0x66')]({'where':{'id':_0x5e9ea7['params']['id']}})['then'](handleEntityNotFound(_0x4404b4,null))[_0x51e7('0x23')](function(_0xdda989){if(_0xdda989){return _0xdda989[_0x51e7('0xbf')](_0x5e9ea7[_0x51e7('0x49')][_0x51e7('0x71')])[_0x51e7('0x23')](function(){if(_[_0x51e7('0xc0')](_0x5e9ea7[_0x51e7('0x49')][_0x51e7('0x71')])){for(var _0xf2b81c=0x0;_0xf2b81c<_0x5e9ea7[_0x51e7('0x49')][_0x51e7('0x71')][_0x51e7('0x4f')];_0xf2b81c+=0x1){socket[_0x51e7('0xbd')](_0x51e7('0xc1'),{'UserId':Number(_0x5e9ea7[_0x51e7('0x49')][_0x51e7('0x71')][_0xf2b81c]),'FaxAccountId':Number(_0x5e9ea7[_0x51e7('0x5b')]['id'])});}}else{socket[_0x51e7('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x5e9ea7['query'][_0x51e7('0x71')]),'FaxAccountId':Number(_0x5e9ea7[_0x51e7('0x5b')]['id'])});}});}})[_0x51e7('0x23')](respondWithStatusCode(_0x4404b4,null))[_0x51e7('0x2e')](handleError(_0x4404b4,null));};exports[_0x51e7('0xc2')]=function(_0x153220,_0x5d971,_0x586fa4){var _0x2c9a4a={};var _0xcbb483={};var _0x476b18;var _0x57eb8d;return db[_0x51e7('0x44')][_0x51e7('0x6b')]({'where':{'id':_0x153220['params']['id']}})[_0x51e7('0x23')](handleEntityNotFound(_0x5d971,null))[_0x51e7('0x23')](function(_0x556ac1){if(_0x556ac1){_0x476b18=_0x556ac1;_0xcbb483[_0x51e7('0x48')]=_[_0x51e7('0x4a')](db[_0x51e7('0x7c')][_0x51e7('0x45')]);_0xcbb483[_0x51e7('0x49')]=_['keys'](_0x153220['query']);_0xcbb483[_0x51e7('0x4b')]=_[_0x51e7('0x4c')](_0xcbb483[_0x51e7('0x48')],_0xcbb483[_0x51e7('0x49')]);_0x2c9a4a[_0x51e7('0x4d')]=_['intersection'](_0xcbb483[_0x51e7('0x48')],qs[_0x51e7('0x4e')](_0x153220[_0x51e7('0x49')][_0x51e7('0x4e')]));_0x2c9a4a[_0x51e7('0x4d')]=_0x2c9a4a[_0x51e7('0x4d')]['length']?_0x2c9a4a[_0x51e7('0x4d')]:_0xcbb483[_0x51e7('0x48')];_0x2c9a4a['order']=qs[_0x51e7('0x53')](_0x153220[_0x51e7('0x49')]['sort']);_0x2c9a4a[_0x51e7('0x54')]=qs['filters'](_['pick'](_0x153220[_0x51e7('0x49')],_0xcbb483[_0x51e7('0x4b')]));if(_0x153220['query']['filter']){_0x2c9a4a['where']=_[_0x51e7('0x56')](_0x2c9a4a[_0x51e7('0x54')],{'$or':_['map'](_0x2c9a4a['attributes'],function(_0x14b3a5){var _0x54f923={};_0x54f923[_0x14b3a5]={'$like':'%'+_0x153220[_0x51e7('0x49')][_0x51e7('0x55')]+'%'};return _0x54f923;})});}_0x2c9a4a=_['merge']({},_0x2c9a4a,_0x153220[_0x51e7('0x57')]);return _0x476b18[_0x51e7('0xc2')](_0x2c9a4a);}})[_0x51e7('0x23')](function(_0xcf8155){if(_0xcf8155){_0x57eb8d=_0xcf8155[_0x51e7('0x4f')];if(!_0x153220[_0x51e7('0x49')][_0x51e7('0x6d')]('nolimit')){_0x2c9a4a['limit']=qs[_0x51e7('0x51')](_0x153220[_0x51e7('0x49')][_0x51e7('0x51')]);_0x2c9a4a[_0x51e7('0x52')]=qs[_0x51e7('0x52')](_0x153220[_0x51e7('0x49')][_0x51e7('0x52')]);}return _0x476b18[_0x51e7('0xc2')](_0x2c9a4a);}})[_0x51e7('0x23')](function(_0x97d727){if(_0x97d727){return _0x97d727?{'count':_0x57eb8d,'rows':_0x97d727}:null;}})[_0x51e7('0x23')](respondWithResult(_0x5d971,null))[_0x51e7('0x2e')](handleError(_0x5d971,null));}; \ No newline at end of file +var _0x0b2a=['SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','FaxAccount','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','sort','where','pick','filters','VIRTUAL','filter','options','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','rawAttributes','length','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','FaxAccountId','getDispositions','Disposition','hasOwnProperty','order','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','User','Owner','fullname','internal','tag','transaction','bulkCreate','findAndCountAll','priority','getApplications','FaxApplication','context','from-voip-provider','exten','localstationid','Fax\x20Extension','appdata','push','Answer','Set','faxdetect','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','ReceiveFax','sequelize','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','$gte','format','FaxMessage','CmList','List','CmContact','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax'];(function(_0x2bee62,_0x2733dc){var _0x2f3aa9=function(_0xe0fd85){while(--_0xe0fd85){_0x2bee62['push'](_0x2bee62['shift']());}};_0x2f3aa9(++_0x2733dc);}(_0x0b2a,0xcb));var _0xa0b2=function(_0xdf3ef9,_0x3d98de){_0xdf3ef9=_0xdf3ef9-0x0;var _0x3731e1=_0x0b2a[_0xdf3ef9];return _0x3731e1;};'use strict';var emlformat=require(_0xa0b2('0x0'));var rimraf=require(_0xa0b2('0x1'));var zipdir=require(_0xa0b2('0x2'));var jsonpatch=require(_0xa0b2('0x3'));var rp=require(_0xa0b2('0x4'));var moment=require('moment');var BPromise=require(_0xa0b2('0x5'));var Mustache=require(_0xa0b2('0x6'));var util=require(_0xa0b2('0x7'));var path=require(_0xa0b2('0x8'));var sox=require(_0xa0b2('0x9'));var csv=require(_0xa0b2('0xa'));var ejs=require(_0xa0b2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0b2('0xc'));var squel=require(_0xa0b2('0xd'));var crypto=require(_0xa0b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa0b2('0xf'));var toCsv=require(_0xa0b2('0xa'));var querystring=require('querystring');var Papa=require(_0xa0b2('0x10'));var Redis=require(_0xa0b2('0x11'));var authService=require(_0xa0b2('0x12'));var qs=require(_0xa0b2('0x13'));var as=require(_0xa0b2('0x14'));var hardwareService=require(_0xa0b2('0x15'));var logger=require(_0xa0b2('0x16'))(_0xa0b2('0x17'));var utils=require(_0xa0b2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa0b2('0x19'));var db=require('../../mysqldb')['db'];config[_0xa0b2('0x1a')]=_['defaults'](config['redis'],{'host':_0xa0b2('0x1b'),'port':0x18eb});var socket=require(_0xa0b2('0x1c'))(new Redis(config['redis']));require(_0xa0b2('0x1d'))[_0xa0b2('0x1e')](socket);var jayson=require(_0xa0b2('0x1f'));var client=jayson[_0xa0b2('0x20')][_0xa0b2('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xa0b2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4c8675,_0xd2a661,_0x35ecf0,_0x4d70cd){return new BPromise(function(_0x4fdea9,_0x1315fd){var _0x508028=_0x4d70cd||client;return _0x508028[_0xa0b2('0x22')](_0x4c8675,_0x35ecf0)['then'](function(_0x10be62){logger[_0xa0b2('0x23')](_0xa0b2('0x24'),_0xd2a661,_0xa0b2('0x25'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0xd2a661,_0xa0b2('0x25'),JSON[_0xa0b2('0x26')](_0x10be62));if(_0x10be62[_0xa0b2('0x27')]){if(_0x10be62[_0xa0b2('0x27')][_0xa0b2('0x28')]===0x1f4){logger[_0xa0b2('0x27')]('FaxAccount,\x20%s,\x20%s',_0xd2a661,_0x10be62[_0xa0b2('0x27')]['message']);return _0x1315fd(_0x10be62['error']['message']);}logger[_0xa0b2('0x27')](_0xa0b2('0x24'),_0xd2a661,_0x10be62['error']['message']);return _0x4fdea9(_0x10be62['error'][_0xa0b2('0x29')]);}else{logger[_0xa0b2('0x23')](_0xa0b2('0x24'),_0xd2a661,_0xa0b2('0x25'));_0x4fdea9(_0x10be62[_0xa0b2('0x2a')][_0xa0b2('0x29')]);}})[_0xa0b2('0x2b')](function(_0x58b508){logger['error'](_0xa0b2('0x24'),_0xd2a661,_0x58b508);_0x1315fd(_0x58b508);});});}function respondWithStatusCode(_0x1e1c3f,_0x373849){_0x373849=_0x373849||0xcc;return function(_0x4820c4){if(_0x4820c4){return _0x1e1c3f[_0xa0b2('0x2c')](_0x373849);}return _0x1e1c3f['status'](_0x373849)[_0xa0b2('0x2d')]();};}function respondWithResult(_0x504b5e,_0x43f815){_0x43f815=_0x43f815||0xc8;return function(_0x957316){if(_0x957316){return _0x504b5e[_0xa0b2('0x2e')](_0x43f815)[_0xa0b2('0x2f')](_0x957316);}};}function respondWithFilteredResult(_0x5629f0,_0x4774a3){return function(_0x2bdc71){if(_0x2bdc71){var _0x515164=typeof _0x4774a3[_0xa0b2('0x30')]===_0xa0b2('0x31')&&typeof _0x4774a3['limit']===_0xa0b2('0x31');var _0x33b25f=_0x2bdc71[_0xa0b2('0x32')];var _0x2af42e=_0x515164?0x0:_0x4774a3[_0xa0b2('0x30')];var _0xb3cd6d=_0x515164?_0x2bdc71[_0xa0b2('0x32')]:_0x4774a3[_0xa0b2('0x30')]+_0x4774a3[_0xa0b2('0x33')];var _0x559bc4;if(_0xb3cd6d>=_0x33b25f){_0xb3cd6d=_0x33b25f;_0x559bc4=0xc8;}else{_0x559bc4=0xce;}_0x5629f0[_0xa0b2('0x2e')](_0x559bc4);return _0x5629f0[_0xa0b2('0x34')](_0xa0b2('0x35'),_0x2af42e+'-'+_0xb3cd6d+'/'+_0x33b25f)['json'](_0x2bdc71);}return null;};}function patchUpdates(_0x58f410){return function(_0x814986){try{jsonpatch[_0xa0b2('0x36')](_0x814986,_0x58f410,!![]);}catch(_0x4297a7){return BPromise[_0xa0b2('0x37')](_0x4297a7);}return _0x814986[_0xa0b2('0x38')]();};}function saveUpdates(_0x36da13,_0x341080){return function(_0x28bda8){if(_0x28bda8){return _0x28bda8[_0xa0b2('0x39')](_0x36da13)['then'](function(_0x44518f){return _0x44518f;});}return null;};}function removeEntity(_0x40d71a,_0x499bf9){return function(_0x90eb){if(_0x90eb){return _0x90eb[_0xa0b2('0x3a')]()[_0xa0b2('0x3b')](function(){var _0x18195c=_0x90eb[_0xa0b2('0x3c')]({'plain':!![]});var _0x7ac931='FaxAccounts';return db[_0xa0b2('0x3d')][_0xa0b2('0x3a')]({'where':{'type':_0x7ac931,'resourceId':_0x18195c['id']}})[_0xa0b2('0x3b')](function(){return _0x90eb;});})[_0xa0b2('0x3b')](function(){_0x40d71a[_0xa0b2('0x2e')](0xcc)[_0xa0b2('0x2d')]();});}};}function handleEntityNotFound(_0x519ea2,_0x1d338e){return function(_0x4c115f){if(!_0x4c115f){_0x519ea2[_0xa0b2('0x2c')](0x194);}return _0x4c115f;};}function handleError(_0x214771,_0x185cde){_0x185cde=_0x185cde||0x1f4;return function(_0x1fd296){logger[_0xa0b2('0x27')](_0x1fd296[_0xa0b2('0x3e')]);if(_0x1fd296[_0xa0b2('0x3f')]){delete _0x1fd296[_0xa0b2('0x3f')];}_0x214771[_0xa0b2('0x2e')](_0x185cde)[_0xa0b2('0x40')](_0x1fd296);};}exports[_0xa0b2('0x41')]=function(_0x15974c,_0x2a9bc2){var _0x44a399={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4e5e49={},_0x5b5b76={'count':0x0,'rows':[]};var _0x3d0212=_[_0xa0b2('0x42')](db[_0xa0b2('0x43')]['rawAttributes'],function(_0x1fe6e7){return{'name':_0x1fe6e7[_0xa0b2('0x44')],'type':_0x1fe6e7[_0xa0b2('0x45')]['key']};});_0x4e5e49[_0xa0b2('0x46')]=_[_0xa0b2('0x42')](_0x3d0212,'name');_0x4e5e49[_0xa0b2('0x47')]=_[_0xa0b2('0x48')](_0x15974c[_0xa0b2('0x47')]);_0x4e5e49['filters']=_[_0xa0b2('0x49')](_0x4e5e49['model'],_0x4e5e49['query']);_0x44a399[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x4e5e49[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x4b')]));_0x44a399['attributes']=_0x44a399[_0xa0b2('0x4a')]['length']?_0x44a399[_0xa0b2('0x4a')]:_0x4e5e49[_0xa0b2('0x46')];if(!_0x15974c[_0xa0b2('0x47')]['hasOwnProperty'](_0xa0b2('0x4c'))){_0x44a399[_0xa0b2('0x33')]=qs[_0xa0b2('0x33')](_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0x44a399[_0xa0b2('0x30')]=qs[_0xa0b2('0x30')](_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x30')]);}_0x44a399['order']=qs[_0xa0b2('0x4d')](_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x4d')]);_0x44a399[_0xa0b2('0x4e')]=qs['filters'](_[_0xa0b2('0x4f')](_0x15974c['query'],_0x4e5e49[_0xa0b2('0x50')]),_0x3d0212);if(_0x15974c['query']['filter']){_0x44a399[_0xa0b2('0x4e')]=_['merge'](_0x44a399[_0xa0b2('0x4e')],{'$or':_['map'](_0x3d0212,function(_0x29dd2c){if(_0x29dd2c[_0xa0b2('0x45')]!==_0xa0b2('0x51')){var _0x5c7f9a={};_0x5c7f9a[_0x29dd2c[_0xa0b2('0x3f')]]={'$like':'%'+_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x5c7f9a;}})});}_0x44a399=_['merge']({},_0x44a399,_0x15974c[_0xa0b2('0x53')]);var _0x41c793={'where':_0x44a399[_0xa0b2('0x4e')]};return db[_0xa0b2('0x43')]['count'](_0x41c793)[_0xa0b2('0x3b')](function(_0x5e1588){_0x5b5b76[_0xa0b2('0x32')]=_0x5e1588;if(_0x15974c[_0xa0b2('0x47')][_0xa0b2('0x54')]){_0x44a399[_0xa0b2('0x55')]=[{'all':!![]}];}return db[_0xa0b2('0x43')]['findAll'](_0x44a399);})['then'](function(_0x5b89d6){_0x5b5b76[_0xa0b2('0x56')]=_0x5b89d6;return _0x5b5b76;})[_0xa0b2('0x3b')](respondWithFilteredResult(_0x2a9bc2,_0x44a399))[_0xa0b2('0x2b')](handleError(_0x2a9bc2,null));};exports[_0xa0b2('0x57')]=function(_0x396fbf,_0x87ca20){var _0x4e1f74={'raw':![],'where':{'id':_0x396fbf[_0xa0b2('0x58')]['id']},'include':[{'model':db[_0xa0b2('0x59')],'as':_0xa0b2('0x5a')}]},_0xabe277={};_0xabe277[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db[_0xa0b2('0x43')][_0xa0b2('0x5b')]);_0xabe277['query']=_['keys'](_0x396fbf[_0xa0b2('0x47')]);_0xabe277['filters']=_[_0xa0b2('0x49')](_0xabe277[_0xa0b2('0x46')],_0xabe277['query']);_0x4e1f74[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0xabe277[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x396fbf['query'][_0xa0b2('0x4b')]));_0x4e1f74[_0xa0b2('0x4a')]=_0x4e1f74[_0xa0b2('0x4a')][_0xa0b2('0x5c')]?_0x4e1f74[_0xa0b2('0x4a')]:_0xabe277['model'];if(_0x396fbf[_0xa0b2('0x47')][_0xa0b2('0x54')]){_0x4e1f74[_0xa0b2('0x55')]=[{'all':!![]}];}_0x4e1f74=_[_0xa0b2('0x5d')]({},_0x4e1f74,_0x396fbf[_0xa0b2('0x53')]);return db[_0xa0b2('0x43')]['find'](_0x4e1f74)[_0xa0b2('0x3b')](handleEntityNotFound(_0x87ca20,null))[_0xa0b2('0x3b')](respondWithResult(_0x87ca20,null))[_0xa0b2('0x2b')](handleError(_0x87ca20,null));};exports[_0xa0b2('0x5e')]=function(_0x1147ed,_0x1f3c5f){return db[_0xa0b2('0x43')][_0xa0b2('0x5e')](_0x1147ed[_0xa0b2('0x5f')],{})[_0xa0b2('0x3b')](function(_0x514a44){var _0x493117=_0x1147ed['user']['get']({'plain':!![]});if(!_0x493117)throw new Error(_0xa0b2('0x60'));if(_0x493117['role']===_0xa0b2('0x61')){var _0x44ef18=_0x514a44[_0xa0b2('0x3c')]({'plain':!![]});var _0x4c81d9=_0xa0b2('0x62');return db[_0xa0b2('0x63')]['find']({'where':{'name':_0x4c81d9,'userProfileId':_0x493117['userProfileId']},'raw':!![]})['then'](function(_0xec29f6){if(_0xec29f6&&_0xec29f6[_0xa0b2('0x64')]===0x0){return db[_0xa0b2('0x3d')][_0xa0b2('0x5e')]({'name':_0x44ef18['name'],'resourceId':_0x44ef18['id'],'type':_0xec29f6[_0xa0b2('0x3f')],'sectionId':_0xec29f6['id']},{})['then'](function(){return _0x514a44;});}else{return _0x514a44;}})[_0xa0b2('0x2b')](function(_0x462e33){logger[_0xa0b2('0x27')](_0xa0b2('0x65'),_0x462e33);throw _0x462e33;});}return _0x514a44;})[_0xa0b2('0x3b')](respondWithResult(_0x1f3c5f,0xc9))['catch'](handleError(_0x1f3c5f,null));};exports[_0xa0b2('0x39')]=function(_0x57720b,_0x26a7e3){if(_0x57720b[_0xa0b2('0x5f')]['id']){delete _0x57720b[_0xa0b2('0x5f')]['id'];}return db['FaxAccount'][_0xa0b2('0x66')]({'where':{'id':_0x57720b['params']['id']},'include':[{'model':db[_0xa0b2('0x59')],'as':_0xa0b2('0x5a')}]})[_0xa0b2('0x3b')](handleEntityNotFound(_0x26a7e3,null))[_0xa0b2('0x3b')](saveUpdates(_0x57720b['body'],null))[_0xa0b2('0x3b')](respondWithResult(_0x26a7e3,null))[_0xa0b2('0x2b')](handleError(_0x26a7e3,null));};exports[_0xa0b2('0x3a')]=function(_0x1ba392,_0x392791){return db[_0xa0b2('0x43')][_0xa0b2('0x66')]({'where':{'id':_0x1ba392[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x392791,null))[_0xa0b2('0x3b')](removeEntity(_0x392791,null))['catch'](handleError(_0x392791,null));};exports[_0xa0b2('0x67')]=function(_0x5acdbd,_0x11808d){return db[_0xa0b2('0x43')]['describe']()[_0xa0b2('0x3b')](respondWithResult(_0x11808d,null))[_0xa0b2('0x2b')](handleError(_0x11808d,null));};exports[_0xa0b2('0x68')]=function(_0x5cf5f9,_0x5db3b9,_0x3ea189){if(_0x5cf5f9[_0xa0b2('0x5f')]['id']){delete _0x5cf5f9['body']['id'];}return db[_0xa0b2('0x43')][_0xa0b2('0x66')]({'where':{'id':_0x5cf5f9['params']['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x5db3b9,null))[_0xa0b2('0x3b')](function(_0x477e2c){if(_0x477e2c){_0x5cf5f9[_0xa0b2('0x5f')][_0xa0b2('0x69')]=_0x477e2c['id'];return db['Disposition'][_0xa0b2('0x5e')](_0x5cf5f9[_0xa0b2('0x5f')]);}})[_0xa0b2('0x3b')](respondWithResult(_0x5db3b9,null))['catch'](handleError(_0x5db3b9,null));};exports[_0xa0b2('0x6a')]=function(_0x59476c,_0x7cecda,_0x544766){var _0x5a8a63={'raw':![],'where':{}};var _0x1d2ec4={};var _0x104595={'count':0x0,'rows':[]};return db[_0xa0b2('0x43')]['findOne']({'where':{'id':_0x59476c[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x7cecda,null))[_0xa0b2('0x3b')](function(_0xddd568){if(_0xddd568){_0x1d2ec4[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db[_0xa0b2('0x6b')]['rawAttributes']);_0x1d2ec4['query']=_['keys'](_0x59476c[_0xa0b2('0x47')]);_0x1d2ec4[_0xa0b2('0x50')]=_['intersection'](_0x1d2ec4[_0xa0b2('0x46')],_0x1d2ec4[_0xa0b2('0x47')]);_0x5a8a63[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x1d2ec4[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x59476c[_0xa0b2('0x47')]['fields']));_0x5a8a63[_0xa0b2('0x4a')]=_0x5a8a63[_0xa0b2('0x4a')][_0xa0b2('0x5c')]?_0x5a8a63[_0xa0b2('0x4a')]:_0x1d2ec4[_0xa0b2('0x46')];if(!_0x59476c[_0xa0b2('0x47')][_0xa0b2('0x6c')](_0xa0b2('0x4c'))){_0x5a8a63[_0xa0b2('0x33')]=qs[_0xa0b2('0x33')](_0x59476c[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0x5a8a63[_0xa0b2('0x30')]=qs[_0xa0b2('0x30')](_0x59476c[_0xa0b2('0x47')]['offset']);}_0x5a8a63[_0xa0b2('0x6d')]=qs[_0xa0b2('0x4d')](_0x59476c['query']['sort']);_0x5a8a63[_0xa0b2('0x4e')]=qs[_0xa0b2('0x50')](_['pick'](_0x59476c['query'],_0x1d2ec4['filters']));_0x5a8a63[_0xa0b2('0x4e')][_0xa0b2('0x69')]=_0xddd568['id'];if(_0x59476c[_0xa0b2('0x47')]['filter']){_0x5a8a63['where']=_[_0xa0b2('0x5d')](_0x5a8a63['where'],{'$or':_['map'](_0x5a8a63[_0xa0b2('0x4a')],function(_0x4992df){var _0x158333={};_0x158333[_0x4992df]={'$like':'%'+_0x59476c[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x158333;})});}_0x5a8a63=_[_0xa0b2('0x5d')]({},_0x5a8a63,_0x59476c[_0xa0b2('0x53')]);return db[_0xa0b2('0x6b')][_0xa0b2('0x32')]({'where':_0x5a8a63['where']})['then'](function(_0x342b32){_0x104595[_0xa0b2('0x32')]=_0x342b32;if(_0x59476c[_0xa0b2('0x47')][_0xa0b2('0x54')]){_0x5a8a63['include']=[{'all':!![]}];}return db[_0xa0b2('0x6b')][_0xa0b2('0x6e')](_0x5a8a63);})[_0xa0b2('0x3b')](function(_0x46be53){_0x104595[_0xa0b2('0x56')]=_0x46be53;return _0x104595;});}})['then'](respondWithFilteredResult(_0x7cecda,_0x5a8a63))[_0xa0b2('0x2b')](handleError(_0x7cecda,null));};exports[_0xa0b2('0x6f')]=function(_0x2f0e55,_0x19b97e,_0xdf2a16){return db[_0xa0b2('0x43')][_0xa0b2('0x66')]({'where':{'id':_0x2f0e55[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x19b97e,null))[_0xa0b2('0x3b')](function(_0x503ecf){if(_0x503ecf){return _0x503ecf[_0xa0b2('0x6f')](_0x2f0e55[_0xa0b2('0x47')][_0xa0b2('0x70')]);}})[_0xa0b2('0x3b')](respondWithStatusCode(_0x19b97e,null))[_0xa0b2('0x2b')](handleError(_0x19b97e,null));};exports[_0xa0b2('0x71')]=function(_0x4f2cb1,_0xbb5c0b,_0x417626){if(_0x4f2cb1[_0xa0b2('0x5f')]['id']){delete _0x4f2cb1[_0xa0b2('0x5f')]['id'];}return db['FaxAccount'][_0xa0b2('0x66')]({'where':{'id':_0x4f2cb1[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0xbb5c0b,null))[_0xa0b2('0x3b')](function(_0x542524){if(_0x542524){_0x4f2cb1[_0xa0b2('0x5f')]['FaxAccountId']=_0x542524['id'];return db['CannedAnswer'][_0xa0b2('0x5e')](_0x4f2cb1[_0xa0b2('0x5f')]);}})[_0xa0b2('0x3b')](respondWithResult(_0xbb5c0b,null))[_0xa0b2('0x2b')](handleError(_0xbb5c0b,null));};exports[_0xa0b2('0x72')]=function(_0x192254,_0x29ef43,_0x108423){var _0x47c475={'raw':![],'where':{}};var _0x2e7ebf={};var _0x2e99ff={'count':0x0,'rows':[]};return db[_0xa0b2('0x43')][_0xa0b2('0x73')]({'where':{'id':_0x192254[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x29ef43,null))['then'](function(_0x39c6b5){if(_0x39c6b5){_0x2e7ebf[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db[_0xa0b2('0x74')]['rawAttributes']);_0x2e7ebf[_0xa0b2('0x47')]=_['keys'](_0x192254[_0xa0b2('0x47')]);_0x2e7ebf[_0xa0b2('0x50')]=_['intersection'](_0x2e7ebf['model'],_0x2e7ebf['query']);_0x47c475[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x2e7ebf[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x192254['query'][_0xa0b2('0x4b')]));_0x47c475['attributes']=_0x47c475[_0xa0b2('0x4a')][_0xa0b2('0x5c')]?_0x47c475['attributes']:_0x2e7ebf[_0xa0b2('0x46')];if(!_0x192254['query'][_0xa0b2('0x6c')](_0xa0b2('0x4c'))){_0x47c475['limit']=qs[_0xa0b2('0x33')](_0x192254[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0x47c475[_0xa0b2('0x30')]=qs[_0xa0b2('0x30')](_0x192254[_0xa0b2('0x47')][_0xa0b2('0x30')]);}_0x47c475[_0xa0b2('0x6d')]=qs['sort'](_0x192254[_0xa0b2('0x47')][_0xa0b2('0x4d')]);_0x47c475[_0xa0b2('0x4e')]=qs[_0xa0b2('0x50')](_['pick'](_0x192254['query'],_0x2e7ebf['filters']));_0x47c475[_0xa0b2('0x4e')]['FaxAccountId']=_0x39c6b5['id'];if(_0x192254[_0xa0b2('0x47')][_0xa0b2('0x52')]){_0x47c475[_0xa0b2('0x4e')]=_[_0xa0b2('0x5d')](_0x47c475['where'],{'$or':_[_0xa0b2('0x42')](_0x47c475[_0xa0b2('0x4a')],function(_0x147461){var _0x5b0845={};_0x5b0845[_0x147461]={'$like':'%'+_0x192254[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x5b0845;})});}_0x47c475=_[_0xa0b2('0x5d')]({},_0x47c475,_0x192254[_0xa0b2('0x53')]);return db[_0xa0b2('0x74')][_0xa0b2('0x32')]({'where':_0x47c475[_0xa0b2('0x4e')]})[_0xa0b2('0x3b')](function(_0x429328){_0x2e99ff[_0xa0b2('0x32')]=_0x429328;if(_0x192254[_0xa0b2('0x47')]['includeAll']){_0x47c475['include']=[{'all':!![]}];}return db[_0xa0b2('0x74')][_0xa0b2('0x6e')](_0x47c475);})[_0xa0b2('0x3b')](function(_0xe98874){_0x2e99ff[_0xa0b2('0x56')]=_0xe98874;return _0x2e99ff;});}})[_0xa0b2('0x3b')](respondWithFilteredResult(_0x29ef43,_0x47c475))[_0xa0b2('0x2b')](handleError(_0x29ef43,null));};exports[_0xa0b2('0x75')]=function(_0x838265,_0x42d8bc,_0x27b195){return db['FaxAccount'][_0xa0b2('0x66')]({'where':{'id':_0x838265[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x42d8bc,null))[_0xa0b2('0x3b')](function(_0x11239c){if(_0x11239c){return _0x11239c[_0xa0b2('0x75')](_0x838265['query'][_0xa0b2('0x70')]);}})[_0xa0b2('0x3b')](respondWithStatusCode(_0x42d8bc,null))[_0xa0b2('0x2b')](handleError(_0x42d8bc,null));};exports[_0xa0b2('0x76')]=function(_0x19ba19,_0x15c543,_0x28bcf5){return db[_0xa0b2('0x77')][_0xa0b2('0x66')]({'where':{'id':_0x19ba19['params']['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x15c543,null))['then'](function(_0x1c84c0){if(_0x1c84c0){return _0x1c84c0[_0xa0b2('0x76')](_0x19ba19[_0xa0b2('0x5f')][_0xa0b2('0x70')],_[_0xa0b2('0x78')](_0x19ba19[_0xa0b2('0x5f')],[_0xa0b2('0x70'),'id'])||{});}})[_0xa0b2('0x3b')](respondWithResult(_0x15c543,null))[_0xa0b2('0x2b')](handleError(_0x15c543,null));};exports[_0xa0b2('0x79')]=function(_0x104814,_0x173bc2,_0x1427c8){var _0x559ede={'raw':![],'where':{}};var _0x21d53a={};var _0x3320ce={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x104814[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x173bc2,null))[_0xa0b2('0x3b')](function(_0x1b51ab){if(_0x1b51ab){_0x21d53a[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db[_0xa0b2('0x77')][_0xa0b2('0x5b')]);_0x21d53a[_0xa0b2('0x47')]=_['keys'](_0x104814['query']);_0x21d53a[_0xa0b2('0x50')]=_[_0xa0b2('0x49')](_0x21d53a[_0xa0b2('0x46')],_0x21d53a[_0xa0b2('0x47')]);_0x559ede[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x21d53a[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x104814[_0xa0b2('0x47')]['fields']));_0x559ede[_0xa0b2('0x4a')]=_0x559ede['attributes']['length']?_0x559ede[_0xa0b2('0x4a')]:_0x21d53a[_0xa0b2('0x46')];if(!_0x104814[_0xa0b2('0x47')]['hasOwnProperty'](_0xa0b2('0x4c'))){_0x559ede[_0xa0b2('0x33')]=qs[_0xa0b2('0x33')](_0x104814[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0x559ede['offset']=qs[_0xa0b2('0x30')](_0x104814[_0xa0b2('0x47')][_0xa0b2('0x30')]);}_0x559ede[_0xa0b2('0x6d')]=qs[_0xa0b2('0x4d')](_0x104814[_0xa0b2('0x47')][_0xa0b2('0x4d')]);_0x559ede[_0xa0b2('0x4e')]=qs[_0xa0b2('0x50')](_[_0xa0b2('0x4f')](_0x104814[_0xa0b2('0x47')],_0x21d53a[_0xa0b2('0x50')]));_0x559ede[_0xa0b2('0x4e')][_0xa0b2('0x69')]=_0x1b51ab['id'];if(_0x104814[_0xa0b2('0x47')]['filter']){_0x559ede[_0xa0b2('0x4e')]=_[_0xa0b2('0x5d')](_0x559ede[_0xa0b2('0x4e')],{'$or':_[_0xa0b2('0x42')](_0x559ede['attributes'],function(_0x16167a){var _0x8f5c9c={};_0x8f5c9c[_0x16167a]={'$like':'%'+_0x104814[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x8f5c9c;})});}_0x559ede=_[_0xa0b2('0x5d')]({},_0x559ede,_0x104814[_0xa0b2('0x53')]);return db['FaxInteraction']['count']({'where':_0x559ede['where']})[_0xa0b2('0x3b')](function(_0x5122ac){_0x3320ce[_0xa0b2('0x32')]=_0x5122ac;if(_0x104814['query'][_0xa0b2('0x54')]){_0x559ede['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa0b2('0x7a')],'as':_0xa0b2('0x7b'),'attributes':['name',_0xa0b2('0x7c'),_0xa0b2('0x7d')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa0b2('0x3f'),'color'],'where':_0x104814[_0xa0b2('0x47')][_0xa0b2('0x7e')]?{'id':_0x104814[_0xa0b2('0x47')][_0xa0b2('0x7e')]}:undefined,'required':_0x104814['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0xa0b2('0x6e')](_0x559ede);})[_0xa0b2('0x3b')](function(_0x70e304){_0x3320ce[_0xa0b2('0x56')]=_0x70e304;return _0x3320ce;});}})[_0xa0b2('0x3b')](respondWithFilteredResult(_0x173bc2,_0x559ede))[_0xa0b2('0x2b')](handleError(_0x173bc2,null));};exports['addApplications']=function(_0x472884,_0x14ef03,_0x20252b){return db['FaxAccount'][_0xa0b2('0x73')]({'where':{'id':_0x472884[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x14ef03,null))['then'](function(_0x3c712b){if(_0x3c712b){return db['sequelize'][_0xa0b2('0x7f')](function(_0x471eb2){return db['FaxApplication'][_0xa0b2('0x3a')]({'where':{'FaxAccountId':_0x472884[_0xa0b2('0x58')]['id']},'transaction':_0x471eb2})['then'](function(_0x4d9765){var _0x2da1bd=_[_0xa0b2('0x42')](_0x472884['body'],function(_0x707530){_0x707530['FaxAccountId']=_0x472884[_0xa0b2('0x58')]['id'];return _0x707530;});return db['FaxApplication'][_0xa0b2('0x80')](_0x2da1bd,{'transaction':_0x471eb2});});})['then'](function(){return db['FaxApplication'][_0xa0b2('0x81')]({'where':{'FaxAccountId':_0x472884[_0xa0b2('0x58')]['id']},'order':_0xa0b2('0x82')});});}})[_0xa0b2('0x3b')](respondWithResult(_0x14ef03,null))[_0xa0b2('0x2b')](handleError(_0x14ef03,null));};exports[_0xa0b2('0x83')]=function(_0x4465a1,_0x2b34e0,_0x2ae90f){var _0x5625d4={};var _0x8b462f={};var _0x4ce444;var _0x3a3fb0;return db['FaxAccount'][_0xa0b2('0x73')]({'where':{'id':_0x4465a1[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x2b34e0,null))[_0xa0b2('0x3b')](function(_0x2429bb){if(_0x2429bb){_0x4ce444=_0x2429bb;_0x8b462f[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db[_0xa0b2('0x84')][_0xa0b2('0x5b')]);_0x8b462f[_0xa0b2('0x47')]=_[_0xa0b2('0x48')](_0x4465a1[_0xa0b2('0x47')]);_0x8b462f['filters']=_[_0xa0b2('0x49')](_0x8b462f[_0xa0b2('0x46')],_0x8b462f[_0xa0b2('0x47')]);_0x5625d4['attributes']=_[_0xa0b2('0x49')](_0x8b462f[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x4465a1[_0xa0b2('0x47')]['fields']));_0x5625d4[_0xa0b2('0x4a')]=_0x5625d4[_0xa0b2('0x4a')]['length']?_0x5625d4[_0xa0b2('0x4a')]:_0x8b462f[_0xa0b2('0x46')];_0x5625d4[_0xa0b2('0x6d')]=qs['sort'](_0x4465a1[_0xa0b2('0x47')]['sort']);_0x5625d4[_0xa0b2('0x4e')]=qs[_0xa0b2('0x50')](_['pick'](_0x4465a1[_0xa0b2('0x47')],_0x8b462f['filters']));if(_0x4465a1[_0xa0b2('0x47')]['filter']){_0x5625d4[_0xa0b2('0x4e')]=_[_0xa0b2('0x5d')](_0x5625d4['where'],{'$or':_['map'](_0x5625d4['attributes'],function(_0x257f74){var _0x832eb1={};_0x832eb1[_0x257f74]={'$like':'%'+_0x4465a1[_0xa0b2('0x47')]['filter']+'%'};return _0x832eb1;})});}_0x5625d4=_[_0xa0b2('0x5d')]({},_0x5625d4,_0x4465a1[_0xa0b2('0x53')]);return _0x4ce444[_0xa0b2('0x83')](_0x5625d4);}})[_0xa0b2('0x3b')](function(_0xb55184){if(_0xb55184){_0x3a3fb0=_0xb55184[_0xa0b2('0x5c')];if(!_0x4465a1['query'][_0xa0b2('0x6c')](_0xa0b2('0x4c'))){_0x5625d4[_0xa0b2('0x33')]=qs[_0xa0b2('0x33')](_0x4465a1['query']['limit']);_0x5625d4[_0xa0b2('0x30')]=qs[_0xa0b2('0x30')](_0x4465a1['query'][_0xa0b2('0x30')]);}return _0x4ce444['getApplications'](_0x5625d4);}})[_0xa0b2('0x3b')](function(_0x1e84a9){if(_0x1e84a9){return _0x1e84a9?{'count':_0x3a3fb0,'rows':_0x1e84a9}:null;}})['then'](respondWithResult(_0x2b34e0,null))[_0xa0b2('0x2b')](handleError(_0x2b34e0,null));};function Extension(_0x3040f9,_0x35bf83,_0x2c4e0f,_0x4d34e0){this[_0xa0b2('0x85')]=_0xa0b2('0x86');this[_0xa0b2('0x87')]=_0x3040f9[_0xa0b2('0x88')];this['app']=_0x4d34e0;this[_0xa0b2('0x45')]='system';this['description']=_0xa0b2('0x89');this[_0xa0b2('0x69')]=_0x3040f9['id'];this[_0xa0b2('0x82')]=_0x35bf83;this[_0xa0b2('0x8a')]=_0x2c4e0f;}function createExtensionsReciveFax(_0x298595){var _0x42688e=0x1;var _0x4af895=[];_0x4af895[_0xa0b2('0x8b')](new Extension(_0x298595,_0x42688e,'',_0xa0b2('0x8c')));_0x42688e+=0x1;_0x4af895[_0xa0b2('0x8b')](new Extension(_0x298595,_0x42688e,'CDR(type)=inbound-fax',_0xa0b2('0x8d')));_0x42688e+=0x1;for(var _0x2a0222 in _0x298595){if(_0x298595[_0xa0b2('0x6c')](_0x2a0222)&&(_0x2a0222==='ecm'||_0x2a0222===_0xa0b2('0x88')||_0x2a0222==='gateway'||_0x2a0222===_0xa0b2('0x8e')||_0x2a0222===_0xa0b2('0x8f')||_0x2a0222===_0xa0b2('0x90')||_0x2a0222===_0xa0b2('0x91')||_0x2a0222===_0xa0b2('0x92')||_0x2a0222===_0xa0b2('0x93'))){_0x4af895[_0xa0b2('0x8b')](new Extension(_0x298595,_0x42688e,_0xa0b2('0x94')+_0x2a0222+')='+_0x298595[_0x2a0222],'Set'));_0x42688e+=0x1;}}_0x4af895[_0xa0b2('0x8b')](new Extension(_0x298595,_0x42688e,'6',_0xa0b2('0x95')));_0x42688e+=0x1;_0x4af895['push'](new Extension(_0x298595,_0x42688e,_0xa0b2('0x96'),_0xa0b2('0x97')));_0x42688e=0x0;return _0x4af895;}exports['addAccountApplications']=function(_0x1b0c78,_0x497dc1,_0xfccee6){var _0x4c0a99;return db[_0xa0b2('0x98')][_0xa0b2('0x7f')](function(_0x33e5c9){return db[_0xa0b2('0x43')][_0xa0b2('0x5e')](_0x1b0c78['body'],{'transaction':_0x33e5c9})['then'](function(_0x435c7e){_0x4c0a99=_0x435c7e[_0xa0b2('0x3c')]({'plain':!![]});return db[_0xa0b2('0x99')][_0xa0b2('0x80')](createExtensionsReciveFax(_0x4c0a99),{'transaction':_0x33e5c9});});})['then'](function(){return _0x4c0a99;})[_0xa0b2('0x3b')](respondWithResult(_0x497dc1,null))[_0xa0b2('0x2b')](handleError(_0x497dc1,null));};exports[_0xa0b2('0x9a')]=function(_0x351091,_0x13d3b0,_0xc6d086){var _0x36e135;return db[_0xa0b2('0x98')]['transaction'](function(_0x4b41d9){return db[_0xa0b2('0x43')][_0xa0b2('0x39')](_0x351091[_0xa0b2('0x5f')],{'where':{'id':_0x351091[_0xa0b2('0x5f')]['id']},'transaction':_0x4b41d9})[_0xa0b2('0x3b')](function(_0x49475a){return db[_0xa0b2('0x99')][_0xa0b2('0x3a')]({'where':{'FaxAccountId':_0x351091[_0xa0b2('0x5f')]['id']},'transaction':_0x4b41d9})[_0xa0b2('0x3b')](function(_0x133fe6){return db[_0xa0b2('0x99')][_0xa0b2('0x80')](createExtensionsReciveFax(_[_0xa0b2('0x78')](_0x351091[_0xa0b2('0x5f')],[_0xa0b2('0x9b'),_0xa0b2('0x9c'),_0xa0b2('0x9d'),_0xa0b2('0x9e'),_0xa0b2('0x9f'),_0xa0b2('0xa0')])),{'transaction':_0x4b41d9});});});})[_0xa0b2('0x3b')](function(){return db['FaxAccount']['findById'](_0x351091[_0xa0b2('0x5f')]['id']);})['then'](respondWithResult(_0x13d3b0,null))['catch'](handleError(_0x13d3b0,null));};exports['getMessages']=function(_0xb07408,_0xa8e192,_0x524220){var _0x2f547c={'raw':!![],'where':{}};var _0x4fd433={};var _0xbf9644={'count':0x0,'rows':[]};return db[_0xa0b2('0x43')][_0xa0b2('0x73')]({'where':{'id':_0xb07408[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0xa8e192,null))[_0xa0b2('0x3b')](function(_0x91d32b){if(_0x91d32b){_0x4fd433[_0xa0b2('0x46')]=_[_0xa0b2('0x48')](db['FaxMessage'][_0xa0b2('0x5b')]);_0x4fd433[_0xa0b2('0x47')]=_[_0xa0b2('0x48')](_0xb07408[_0xa0b2('0x47')]);_0x4fd433['filters']=_['intersection'](_0x4fd433[_0xa0b2('0x46')],_0x4fd433[_0xa0b2('0x47')]);_0x2f547c[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x4fd433[_0xa0b2('0x46')],qs['fields'](_0xb07408[_0xa0b2('0x47')]['fields']));_0x2f547c[_0xa0b2('0x4a')]=_0x2f547c[_0xa0b2('0x4a')][_0xa0b2('0x5c')]?_0x2f547c[_0xa0b2('0x4a')]:_0x4fd433['model'];if(!_0xb07408[_0xa0b2('0x47')]['hasOwnProperty'](_0xa0b2('0x4c'))){_0x2f547c[_0xa0b2('0x33')]=qs[_0xa0b2('0x33')](_0xb07408[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0x2f547c[_0xa0b2('0x30')]=qs['offset'](_0xb07408[_0xa0b2('0x47')][_0xa0b2('0x30')]);}_0x2f547c[_0xa0b2('0x6d')]=qs[_0xa0b2('0x4d')](_0xb07408[_0xa0b2('0x47')][_0xa0b2('0x4d')]);_0x2f547c[_0xa0b2('0x4e')]=qs[_0xa0b2('0x50')](_[_0xa0b2('0x4f')](_0xb07408[_0xa0b2('0x47')],_0x4fd433[_0xa0b2('0x50')]));_0x2f547c[_0xa0b2('0x4e')][_0xa0b2('0x69')]=_0x91d32b['id'];if(_0xb07408[_0xa0b2('0x47')]['filter']){_0x2f547c['where']=_[_0xa0b2('0x5d')](_0x2f547c[_0xa0b2('0x4e')],{'$or':_[_0xa0b2('0x42')](_0x2f547c[_0xa0b2('0x4a')],function(_0x4e0402){var _0x53842c={};_0x53842c[_0x4e0402]={'$like':'%'+_0xb07408[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x53842c;})});}if(_0xb07408[_0xa0b2('0x47')][_0xa0b2('0xa1')]){var _0x1f70cb=_0xb07408['query'][_0xa0b2('0xa1')]['split'](',');var _0x341d69={};_0x341d69[_0x1f70cb[0x0]]={'$gte':moment(_0x1f70cb[0x1])[_0xa0b2('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f547c[_0xa0b2('0x4e')]=_['merge'](_0x2f547c[_0xa0b2('0x4e')],_0x341d69);}_0x2f547c=_['merge']({},_0x2f547c,_0xb07408[_0xa0b2('0x53')]);return db['FaxMessage'][_0xa0b2('0x32')]({'where':_0x2f547c[_0xa0b2('0x4e')]})[_0xa0b2('0x3b')](function(_0x2d0fe4){_0xbf9644[_0xa0b2('0x32')]=_0x2d0fe4;if(_0xb07408['query'][_0xa0b2('0x54')]){_0x2f547c[_0xa0b2('0x55')]=[{'all':!![]}];}return db[_0xa0b2('0xa3')][_0xa0b2('0x6e')](_0x2f547c);})[_0xa0b2('0x3b')](function(_0x52d485){_0xbf9644[_0xa0b2('0x56')]=_0x52d485;return _0xbf9644;});}})[_0xa0b2('0x3b')](respondWithFilteredResult(_0xa8e192,_0x2f547c))[_0xa0b2('0x2b')](handleError(_0xa8e192,null));};exports[_0xa0b2('0x40')]=function(_0x3bd2c2,_0x3bc216,_0x4bd76b){var _0x13cc37,_0x219648={},_0x177cb9;if(_0x3bd2c2[_0xa0b2('0x5f')]['to']){_0x177cb9=_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0];}return db[_0xa0b2('0x43')][_0xa0b2('0x66')]({'where':{'id':_0x3bd2c2[_0xa0b2('0x58')]['id']},'include':[{'model':db[_0xa0b2('0xa4')],'as':_0xa0b2('0xa5'),'include':[{'model':db[_0xa0b2('0xa6')],'as':'Contacts','where':{'fax':_0x177cb9},'limit':0x1,'order':[[_0xa0b2('0x9e'),_0xa0b2('0xa7')]]}]}]})[_0xa0b2('0x3b')](handleEntityNotFound(_0x3bc216,null))[_0xa0b2('0x3b')](function(_0x1eda4e){_0x13cc37=_0x1eda4e;if(_0x3bd2c2['body'][_0xa0b2('0xa8')]&&_0x3bd2c2['body'][_0xa0b2('0xa8')]['length']){for(var _0x4a32e7=0x0;_0x4a32e7<_0x3bd2c2['body'][_0xa0b2('0xa8')][_0xa0b2('0x5c')];_0x4a32e7+=0x1){_0x3bd2c2['body'][_0xa0b2('0xa8')][_0x4a32e7]={'filename':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][_0x4a32e7][_0xa0b2('0x3f')],'id':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][_0x4a32e7]['id'],'path':path[_0xa0b2('0xa9')](config[_0xa0b2('0xaa')],_0xa0b2('0xab'),_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][_0x4a32e7][_0xa0b2('0xac')])};}}return respondWithRpcPromise('CheckAfterSend',_0xa0b2('0xad'),{'FaxAccountId':_['isNil'](_0x3bd2c2[_0xa0b2('0x58')]['id'])?undefined:_0x3bd2c2['params']['id'],'path':_[_0xa0b2('0xae')](_0x3bd2c2['body'][_0xa0b2('0xa8')][0x0]['path'])?undefined:_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0][_0xa0b2('0x8')],'fax':_[_0xa0b2('0xae')](_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0])?undefined:_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0]},client9002);})[_0xa0b2('0x3b')](function(){if(_0x13cc37){if(_[_0xa0b2('0xae')](_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xaf')])){_0x3bd2c2['body'][_0xa0b2('0xaf')]=util[_0xa0b2('0xa2')](_0xa0b2('0xb0'),_0x13cc37[_0xa0b2('0x3f')],_0x13cc37[_0xa0b2('0xb1')]);}if(_0x13cc37[_0xa0b2('0xa5')]){if(_0x13cc37[_0xa0b2('0xa5')][_0xa0b2('0xb2')][_0xa0b2('0x5c')]){return _0x13cc37[_0xa0b2('0xa5')][_0xa0b2('0xb2')][0x0];}else{return db[_0xa0b2('0xa6')][_0xa0b2('0x5e')](_[_0xa0b2('0xb3')](_0x3bd2c2[_0xa0b2('0x5f')],{'firstName':_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0],'phone':_0x3bd2c2['body']['to'][0x0],'fax':_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0],'ListId':_0x13cc37[_0xa0b2('0xa0')]}));}}else{throw new Error(_0xa0b2('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x1d2fca){if(_0x1d2fca){return db['FaxInteraction'][_0xa0b2('0x66')]({'where':{'ContactId':_0x1d2fca['id'],'closed':![],'FaxAccountId':_0x13cc37['id']}})[_0xa0b2('0x3b')](function(_0x3ea567){if(_0x3ea567){return[_0x3ea567,![]];}return db[_0xa0b2('0x77')][_0xa0b2('0x5e')]({'UserId':_0x3bd2c2[_0xa0b2('0x61')]['id'],'ContactId':_0x1d2fca['id'],'FaxAccountId':_0x13cc37['id'],'fax':_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0],'firstMsgDirection':_0xa0b2('0xb5'),'Messages':[_['merge'](_0x3bd2c2[_0xa0b2('0x5f')],{'read':![],'body':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0][_0xa0b2('0xb6')],'FaxAccountId':_0x13cc37['id'],'UserId':_0x3bd2c2[_0xa0b2('0x61')]['id'],'ContactId':_0x1d2fca['id'],'AttachmentId':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xa0b2('0xa3')],'as':_0xa0b2('0xb7')}]})[_0xa0b2('0x3b')](function(_0x362bc8){return[_0x362bc8,!![]];});});}else{throw new Error(_0xa0b2('0xb8'));}})[_0xa0b2('0xb9')](function(_0x2b09af,_0x1d55e5){if(_0x1d55e5){return _0x2b09af;}return db['FaxMessage'][_0xa0b2('0x5e')]({'direction':'out','read':![],'body':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0][_0xa0b2('0xb6')],'FaxAccountId':_0x13cc37['id'],'FaxInteractionId':_0x2b09af['id'],'UserId':_0x3bd2c2['user']['id'],'ContactId':_0x2b09af[_0xa0b2('0xba')],'AttachmentId':_0x3bd2c2['body'][_0xa0b2('0xa8')][0x0]['id']})[_0xa0b2('0x3b')](function(_0x430625){_0x2b09af['dataValues']['Messages']=[];_0x2b09af[_0xa0b2('0xbb')]['Messages'][_0xa0b2('0x8b')](_0x430625[_0xa0b2('0xbb')]);return _0x2b09af;});})[_0xa0b2('0x3b')](function(_0x4abdb8){respondWithRpcPromise(_0xa0b2('0xbc'),'SendFax',{'FaxAccountId':_[_0xa0b2('0xae')](_0x3bd2c2[_0xa0b2('0x58')]['id'])?undefined:_0x3bd2c2['params']['id'],'path':_[_0xa0b2('0xae')](_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0][_0xa0b2('0x8')])?undefined:_0x3bd2c2['body']['attachments'][0x0][_0xa0b2('0x8')],'fax':_[_0xa0b2('0xae')](_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0])?undefined:_0x3bd2c2[_0xa0b2('0x5f')]['to'][0x0],'AttachmentId':_0x3bd2c2[_0xa0b2('0x5f')][_0xa0b2('0xa8')][0x0]['id']},client9002)[_0xa0b2('0x3b')](function(_0x203360){logger[_0xa0b2('0x23')](_0xa0b2('0xbd'),_0x203360);})[_0xa0b2('0x2b')](function(_0x1f008c){logger['info'](_0xa0b2('0xbd'),_0x1f008c);});return _0x4abdb8;})[_0xa0b2('0x3b')](respondWithResult(_0x3bc216,null))['catch'](handleError(_0x3bc216,null));};exports[_0xa0b2('0xbe')]=function(_0x427245,_0x7b91b7,_0x3b3448){return db['FaxAccount']['find']({'where':{'id':_0x427245[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x7b91b7,null))[_0xa0b2('0x3b')](function(_0x4651bd){if(_0x4651bd){return _0x4651bd[_0xa0b2('0xbe')](_0x427245[_0xa0b2('0x5f')][_0xa0b2('0x70')],_[_0xa0b2('0x78')](_0x427245[_0xa0b2('0x5f')],['ids','id'])||{})['spread'](function(_0x3adc54){for(var _0x44cee0=0x0;_0x44cee0<_0x427245[_0xa0b2('0x5f')][_0xa0b2('0x70')][_0xa0b2('0x5c')];_0x44cee0+=0x1){socket[_0xa0b2('0xbf')]('userFaxAccount:save',{'UserId':Number(_0x427245[_0xa0b2('0x5f')]['ids'][_0x44cee0]),'FaxAccountId':Number(_0x427245[_0xa0b2('0x58')]['id'])});}return _0x3adc54;});}})['then'](respondWithResult(_0x7b91b7,null))[_0xa0b2('0x2b')](handleError(_0x7b91b7,null));};exports[_0xa0b2('0xc0')]=function(_0x4301b8,_0x5a8e50,_0x44f7c3){return db['FaxAccount'][_0xa0b2('0x66')]({'where':{'id':_0x4301b8[_0xa0b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x5a8e50,null))[_0xa0b2('0x3b')](function(_0x56d0d1){if(_0x56d0d1){return _0x56d0d1['removeAgents'](_0x4301b8[_0xa0b2('0x47')][_0xa0b2('0x70')])[_0xa0b2('0x3b')](function(){if(_[_0xa0b2('0xc1')](_0x4301b8[_0xa0b2('0x47')][_0xa0b2('0x70')])){for(var _0x515618=0x0;_0x515618<_0x4301b8[_0xa0b2('0x47')][_0xa0b2('0x70')][_0xa0b2('0x5c')];_0x515618+=0x1){socket[_0xa0b2('0xbf')](_0xa0b2('0xc2'),{'UserId':Number(_0x4301b8[_0xa0b2('0x47')]['ids'][_0x515618]),'FaxAccountId':Number(_0x4301b8[_0xa0b2('0x58')]['id'])});}}else{socket[_0xa0b2('0xbf')](_0xa0b2('0xc2'),{'UserId':Number(_0x4301b8['query'][_0xa0b2('0x70')]),'FaxAccountId':Number(_0x4301b8[_0xa0b2('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a8e50,null))[_0xa0b2('0x2b')](handleError(_0x5a8e50,null));};exports[_0xa0b2('0xc3')]=function(_0x5c02f4,_0x33a8cc,_0x3f6d5b){var _0xbeaf5c={};var _0x3a9666={};var _0x1b84b9;var _0x4f8e58;return db[_0xa0b2('0x43')][_0xa0b2('0x73')]({'where':{'id':_0x5c02f4[_0xa0b2('0x58')]['id']}})[_0xa0b2('0x3b')](handleEntityNotFound(_0x33a8cc,null))[_0xa0b2('0x3b')](function(_0x11658b){if(_0x11658b){_0x1b84b9=_0x11658b;_0x3a9666[_0xa0b2('0x46')]=_['keys'](db[_0xa0b2('0x7a')]['rawAttributes']);_0x3a9666[_0xa0b2('0x47')]=_['keys'](_0x5c02f4['query']);_0x3a9666[_0xa0b2('0x50')]=_[_0xa0b2('0x49')](_0x3a9666[_0xa0b2('0x46')],_0x3a9666[_0xa0b2('0x47')]);_0xbeaf5c[_0xa0b2('0x4a')]=_[_0xa0b2('0x49')](_0x3a9666[_0xa0b2('0x46')],qs[_0xa0b2('0x4b')](_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x4b')]));_0xbeaf5c[_0xa0b2('0x4a')]=_0xbeaf5c[_0xa0b2('0x4a')]['length']?_0xbeaf5c[_0xa0b2('0x4a')]:_0x3a9666['model'];_0xbeaf5c['order']=qs[_0xa0b2('0x4d')](_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x4d')]);_0xbeaf5c[_0xa0b2('0x4e')]=qs['filters'](_['pick'](_0x5c02f4['query'],_0x3a9666['filters']));if(_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x52')]){_0xbeaf5c[_0xa0b2('0x4e')]=_[_0xa0b2('0x5d')](_0xbeaf5c[_0xa0b2('0x4e')],{'$or':_[_0xa0b2('0x42')](_0xbeaf5c[_0xa0b2('0x4a')],function(_0x3c40fa){var _0x59c8ce={};_0x59c8ce[_0x3c40fa]={'$like':'%'+_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x52')]+'%'};return _0x59c8ce;})});}_0xbeaf5c=_[_0xa0b2('0x5d')]({},_0xbeaf5c,_0x5c02f4[_0xa0b2('0x53')]);return _0x1b84b9[_0xa0b2('0xc3')](_0xbeaf5c);}})[_0xa0b2('0x3b')](function(_0x3123fb){if(_0x3123fb){_0x4f8e58=_0x3123fb[_0xa0b2('0x5c')];if(!_0x5c02f4['query'][_0xa0b2('0x6c')](_0xa0b2('0x4c'))){_0xbeaf5c[_0xa0b2('0x33')]=qs['limit'](_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x33')]);_0xbeaf5c[_0xa0b2('0x30')]=qs[_0xa0b2('0x30')](_0x5c02f4[_0xa0b2('0x47')][_0xa0b2('0x30')]);}return _0x1b84b9[_0xa0b2('0xc3')](_0xbeaf5c);}})['then'](function(_0xc0d558){if(_0xc0d558){return _0xc0d558?{'count':_0x4f8e58,'rows':_0xc0d558}:null;}})[_0xa0b2('0x3b')](respondWithResult(_0x33a8cc,null))[_0xa0b2('0x2b')](handleError(_0x33a8cc,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ebfbb9b..9ce4dc9 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 _0xd906=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','FaxAccount'];(function(_0x5bf84b,_0x304515){var _0x39271a=function(_0xd84289){while(--_0xd84289){_0x5bf84b['push'](_0x5bf84b['shift']());}};_0x39271a(++_0x304515);}(_0xd906,0x6b));var _0x6d90=function(_0x59d94c,_0x33f979){_0x59d94c=_0x59d94c-0x0;var _0x4a6d77=_0xd906[_0x59d94c];return _0x4a6d77;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x6d90('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6d90('0x1')](0x0);var events={'afterCreate':_0x6d90('0x2'),'afterUpdate':_0x6d90('0x3'),'afterDestroy':_0x6d90('0x4')};function emitEvent(_0x4d5bbd){return function(_0x2ae140,_0x431c1e,_0x132c67){FaxAccountEvents[_0x6d90('0x5')](_0x4d5bbd+':'+_0x2ae140['id'],_0x2ae140);FaxAccountEvents['emit'](_0x4d5bbd,_0x2ae140);_0x132c67(null);};}for(var e in events){if(events[_0x6d90('0x6')](e)){var event=events[e];FaxAccount[_0x6d90('0x7')](e,emitEvent(event));}}module[_0x6d90('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x36e8=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x1c208e,_0x2a0a5b){var _0x5104ff=function(_0x3ca41f){while(--_0x3ca41f){_0x1c208e['push'](_0x1c208e['shift']());}};_0x5104ff(++_0x2a0a5b);}(_0x36e8,0x103));var _0x836e=function(_0x41751b,_0xc54a9){_0x41751b=_0x41751b-0x0;var _0x3e4968=_0x36e8[_0x41751b];return _0x3e4968;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x836e('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x836e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x836e('0x2'),'afterDestroy':_0x836e('0x3')};function emitEvent(_0x11b332){return function(_0x239f93,_0xe5937f,_0x748a7f){FaxAccountEvents[_0x836e('0x4')](_0x11b332+':'+_0x239f93['id'],_0x239f93);FaxAccountEvents[_0x836e('0x4')](_0x11b332,_0x239f93);_0x748a7f(null);};}for(var e in events){if(events[_0x836e('0x5')](e)){var event=events[e];FaxAccount[_0x836e('0x6')](e,emitEvent(event));}}module[_0x836e('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 022c0eb..61a3913 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 _0x412d=['util','../../config/logger','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x451999,_0x1b3908){var _0x1b696e=function(_0x259ab1){while(--_0x259ab1){_0x451999['push'](_0x451999['shift']());}};_0x1b696e(++_0x1b3908);}(_0x412d,0x74));var _0xd412=function(_0x2b6d79,_0x2d6498){_0x2b6d79=_0x2b6d79-0x0;var _0x5b16e4=_0x412d[_0x2b6d79];return _0x5b16e4;};'use strict';var _=require(_0xd412('0x0'));var util=require(_0xd412('0x1'));var logger=require(_0xd412('0x2'))(_0xd412('0x3'));var moment=require(_0xd412('0x4'));var BPromise=require(_0xd412('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd412('0x6'));var rimraf=require(_0xd412('0x7'));var config=require('../../config/environment');var attributes=require(_0xd412('0x8'));module[_0xd412('0x9')]=function(_0x4a368a,_0x1b04b0){return _0x4a368a[_0xd412('0xa')](_0xd412('0xb'),attributes,{'tableName':_0xd412('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x797a=['FaxAccount','fax_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x797a,0xaa));var _0xa797=function(_0x1e9fc0,_0x441968){_0x1e9fc0=_0x1e9fc0-0x0;var _0x3f6a31=_0x797a[_0x1e9fc0];return _0x3f6a31;};'use strict';var _=require(_0xa797('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa797('0x1'));var moment=require(_0xa797('0x2'));var BPromise=require(_0xa797('0x3'));var rp=require(_0xa797('0x4'));var fs=require('fs');var path=require(_0xa797('0x5'));var rimraf=require(_0xa797('0x6'));var config=require(_0xa797('0x7'));var attributes=require('./faxAccount.attributes');module[_0xa797('0x8')]=function(_0x23c75a,_0x49a349){return _0x23c75a[_0xa797('0x9')](_0xa797('0xa'),attributes,{'tableName':_0xa797('0xb'),'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 2b99f89..176c7c6 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 _0x30d8=['rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','raw','options','attributes','limit','include','map','model','debug','stringify','catch','NotifyFaxAccount','body','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','get','applications','Applications','list','priority','asc','Contacts','length','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','name','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x538785,_0x3daf79){var _0x22ec0e=function(_0x573cb8){while(--_0x573cb8){_0x538785['push'](_0x538785['shift']());}};_0x22ec0e(++_0x3daf79);}(_0x30d8,0x1bf));var _0x830d=function(_0x3bc5b0,_0xbf659a){_0x3bc5b0=_0x3bc5b0-0x0;var _0x72ec68=_0x30d8[_0x3bc5b0];return _0x72ec68;};'use strict';var _=require(_0x830d('0x0'));var util=require(_0x830d('0x1'));var moment=require(_0x830d('0x2'));var BPromise=require(_0x830d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x830d('0x4'));var db=require(_0x830d('0x5'))['db'];var utils=require(_0x830d('0x6'));var logger=require(_0x830d('0x7'))(_0x830d('0x8'));var config=require(_0x830d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x830d('0xa')]['http']({'port':0x232c});config[_0x830d('0xb')]=_[_0x830d('0xc')](config[_0x830d('0xb')],{'host':_0x830d('0xd'),'port':0x18eb});var socket=require(_0x830d('0xe'))(new Redis(config[_0x830d('0xb')]));require(_0x830d('0xf'))['register'](socket);function respondWithRpcPromise(_0x21e707,_0x188124,_0x1ac942){return new BPromise(function(_0x177138,_0x38c119){return client[_0x830d('0x10')](_0x21e707,_0x1ac942)[_0x830d('0x11')](function(_0x562979){logger[_0x830d('0x12')]('FaxAccount,\x20%s,\x20%s',_0x188124,'request\x20sent');logger['debug'](_0x830d('0x13'),_0x188124,'request\x20sent',JSON['stringify'](_0x562979));if(_0x562979['error']){if(_0x562979[_0x830d('0x14')][_0x830d('0x15')]===0x1f4){logger[_0x830d('0x14')](_0x830d('0x16'),_0x188124,_0x562979[_0x830d('0x14')][_0x830d('0x17')]);return _0x38c119(_0x562979[_0x830d('0x14')][_0x830d('0x17')]);}logger['error'](_0x830d('0x16'),_0x188124,_0x562979['error'][_0x830d('0x17')]);return _0x177138(_0x562979[_0x830d('0x14')][_0x830d('0x17')]);}else{logger[_0x830d('0x12')]('FaxAccount,\x20%s,\x20%s',_0x188124,'request\x20sent');_0x177138(_0x562979[_0x830d('0x18')][_0x830d('0x17')]);}})['catch'](function(_0x5685f8){logger['error'](_0x830d('0x16'),_0x188124,_0x5685f8);_0x38c119(_0x5685f8);});});}exports[_0x830d('0x19')]=function(_0x599af8){var _0x441f2d=this;return new Promise(function(_0x4986ee,_0x503350){return db[_0x830d('0x1a')]['findAll']({'raw':_0x599af8['options']?_0x599af8['options'][_0x830d('0x1b')]===undefined?!![]:![]:!![],'where':_0x599af8[_0x830d('0x1c')]?_0x599af8[_0x830d('0x1c')]['where']||null:null,'attributes':_0x599af8[_0x830d('0x1c')]?_0x599af8[_0x830d('0x1c')][_0x830d('0x1d')]||null:null,'limit':_0x599af8[_0x830d('0x1c')]?_0x599af8[_0x830d('0x1c')][_0x830d('0x1e')]||null:null,'include':_0x599af8[_0x830d('0x1c')]?_0x599af8[_0x830d('0x1c')][_0x830d('0x1f')]?_[_0x830d('0x20')](_0x599af8['options'][_0x830d('0x1f')],function(_0x40042a){return{'model':db[_0x40042a[_0x830d('0x21')]],'as':_0x40042a['as'],'attributes':_0x40042a[_0x830d('0x1d')],'include':_0x40042a[_0x830d('0x1f')]?_['map'](_0x40042a['include'],function(_0x1ec3ac){return{'model':db[_0x1ec3ac[_0x830d('0x21')]],'as':_0x1ec3ac['as'],'attributes':_0x1ec3ac[_0x830d('0x1d')],'include':_0x1ec3ac[_0x830d('0x1f')]?_[_0x830d('0x20')](_0x1ec3ac['include'],function(_0x28982b){return{'model':db[_0x28982b[_0x830d('0x21')]],'as':_0x28982b['as'],'attributes':_0x28982b['attributes']};}):[]};}):[]};}):[]:[]})[_0x830d('0x11')](function(_0x2ee4a4){logger[_0x830d('0x12')](_0x830d('0x19'),_0x599af8);logger[_0x830d('0x22')](_0x830d('0x19'),_0x599af8,JSON[_0x830d('0x23')](_0x2ee4a4));_0x4986ee(_0x2ee4a4);})[_0x830d('0x24')](function(_0x128bcf){logger[_0x830d('0x14')]('GetFaxAccount',_0x128bcf['message'],_0x599af8);_0x503350(_0x441f2d[_0x830d('0x14')](0x1f4,_0x128bcf[_0x830d('0x17')]));});});};exports[_0x830d('0x25')]=function(_0x4f4f21,_0x13c364,_0x27afb8){var _0x3940e8=this;return new Promise(function(_0x154ea0,_0x2e69d3){var _0x3a863e={'body':_0x4f4f21[_0x830d('0x26')],'channel':'fax'};var _0x5bed75=[];var _0x35dee4=[];var _0x10b48f={};return db[_0x830d('0x27')][_0x830d('0x28')]()[_0x830d('0x11')](function(_0x1a7b8c){if(!_0x1a7b8c){throw new db['Sequelize'][(_0x830d('0x29'))](_0x830d('0x2a'));}_0x5bed75=_[_0x830d('0x2b')](_[_0x830d('0x2c')](_0x1a7b8c),[_0x830d('0x2d'),_0x830d('0x2e')]);_0x35dee4=_['difference'](_['keys'](_0x1a7b8c),[_0x830d('0x2d'),_0x830d('0x2e'),_0x830d('0x2f'),_0x830d('0x30')]);if(_0x4f4f21[_0x830d('0x26')]['id']){delete _0x4f4f21[_0x830d('0x26')]['id'];}if(_[_0x830d('0x31')](_0x4f4f21[_0x830d('0x26')][_0x830d('0x32')])){throw new db[(_0x830d('0x33'))]['ValidationError'](_0x830d('0x34'));}if(_[_0x830d('0x31')](_0x4f4f21[_0x830d('0x26')][_0x830d('0x26')])||_0x4f4f21[_0x830d('0x26')][_0x830d('0x26')]===''){throw new db[(_0x830d('0x33'))][(_0x830d('0x29'))](_0x830d('0x35'));}if(_[_0x830d('0x31')](_0x4f4f21[_0x830d('0x26')][_0x830d('0x36')])){throw new db['Sequelize'][(_0x830d('0x29'))](_0x830d('0x37')+_0x35dee4);}if(!_[_0x830d('0x38')](_0x35dee4,_0x4f4f21[_0x830d('0x26')]['mapKey'])){throw new db[(_0x830d('0x33'))]['ValidationError'](_0x830d('0x39')+_0x35dee4);}_0x10b48f[_0x4f4f21['body']['mapKey']]=_0x4f4f21[_0x830d('0x26')][_0x830d('0x32')];})[_0x830d('0x11')](function(){return db[_0x830d('0x1a')][_0x830d('0x3a')]({'where':{'id':_0x4f4f21[_0x830d('0x3b')]['id']},'include':[{'model':db[_0x830d('0x3c')],'as':_0x830d('0x3d'),'include':[{'model':db[_0x830d('0x27')],'as':'Contacts','where':_0x10b48f,'limit':0x1,'order':[['updatedAt',_0x830d('0x3e')]]}]},{'model':db[_0x830d('0x3f')],'as':'Applications'}]});})[_0x830d('0x11')](function(_0x131137){if(_0x131137&&_0x131137[_0x830d('0x3d')]){var _0x2b826c=_0x131137[_0x830d('0x40')]({'plain':!![]});_0x3a863e[_0x830d('0x3b')]=_0x2b826c;_0x3a863e[_0x830d('0x41')]=_0x2b826c[_0x830d('0x42')];_0x3a863e[_0x830d('0x43')]=_0x2b826c[_0x830d('0x3d')];_0x3a863e['applications']=_['orderBy'](_0x3a863e[_0x830d('0x41')],[_0x830d('0x44')],[_0x830d('0x45')]);if(_0x3a863e[_0x830d('0x3b')]['Applications']){delete _0x3a863e[_0x830d('0x3b')][_0x830d('0x42')];}if(_0x3a863e[_0x830d('0x3b')][_0x830d('0x3d')]&&_0x3a863e[_0x830d('0x3b')][_0x830d('0x3d')][_0x830d('0x46')][_0x830d('0x47')]){return _0x3a863e['account'][_0x830d('0x3d')]['Contacts'][0x0];}var _0x5a9b4b=_[_0x830d('0xc')](_0x4f4f21[_0x830d('0x26')],{'firstName':_0x4f4f21[_0x830d('0x26')]['from'],'ListId':_0x2b826c[_0x830d('0x30')]});_0x5a9b4b[_0x4f4f21[_0x830d('0x26')]['mapKey']]=_0x4f4f21[_0x830d('0x26')][_0x830d('0x32')];return db['CmContact']['create'](_0x5a9b4b,{'fields':_0x5bed75,'raw':!![]});}})[_0x830d('0x11')](function(_0x126663){_0x3a863e[_0x830d('0x48')]=_0x126663;if(_0x126663){var _0x3e2322={'ContactId':_0x126663['id'],'FaxAccountId':_0x4f4f21['account']['id'],'fax':_0x126663[_0x830d('0x49')]};return db[_0x830d('0x4a')][_0x830d('0x3a')]({'where':{'ContactId':_0x126663['id'],'closed':![],'FaxAccountId':_0x4f4f21[_0x830d('0x3b')]['id']}})[_0x830d('0x11')](function(_0x27fb8b){if(_0x27fb8b){return[_0x27fb8b,![]];}return db[_0x830d('0x4a')]['create'](_0x3e2322)[_0x830d('0x11')](function(_0x2feed8){return[_0x2feed8,!![]];});});}else{throw new Error(_0x830d('0x4b'));}})[_0x830d('0x4c')](function(_0x3d42b0,_0x4d33eb){var _0x492c5d=_0x3d42b0[_0x830d('0x40')]({'plain':!![]});if(_0x4d33eb){if(_0x3a863e[_0x830d('0x3b')][_0x830d('0x4d')]){_0x3a863e[_0x830d('0x41')]['push']({'id':0x0,'priority':_0x3a863e['applications'][_0x830d('0x47')]+0x1,'app':_0x830d('0x4e'),'appdata':_0x830d('0x4f'),'interval':_0x830d('0x50')});}_0x492c5d[_0x830d('0x51')]=!![];}else{_0x492c5d['created']=![];}_0x3a863e['interaction']=_0x492c5d;return db[_0x830d('0x52')]['create']({'body':_0x4f4f21[_0x830d('0x26')][_0x830d('0x26')],'FaxAccountId':_0x4f4f21['account']['id'],'FaxInteractionId':_0x3d42b0['id'],'direction':'in','ContactId':_0x3d42b0[_0x830d('0x53')],'AttachmentId':_0x4f4f21['body']['AttachmentId']});})[_0x830d('0x11')](function(_0x2dcb73){_0x3a863e['message']=_0x2dcb73;if(_0x3a863e[_0x830d('0x54')][_0x830d('0x55')]){return db['User'][_0x830d('0x3a')]({'attributes':['id',_0x830d('0x56')],'where':{'id':_0x3a863e[_0x830d('0x54')]['UserId']}})[_0x830d('0x11')](function(_0x2ca535){if(_0x2ca535){_0x3a863e[_0x830d('0x41')][_0x830d('0x57')]({'id':0x0,'priority':0x0,'app':_0x830d('0x58'),'appdata':_0x2ca535[_0x830d('0x56')]+','+(_0x3a863e[_0x830d('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x830d('0x50')});}return respondWithRpcPromise('Start','startRouting',_0x3a863e);});}return respondWithRpcPromise(_0x830d('0x59'),_0x830d('0x5a'),_0x3a863e);})['then'](function(_0x2dfb47){_0x154ea0(_0x2dfb47);})['catch'](function(_0x256279){_0x2e69d3(_0x3940e8[_0x830d('0x14')](0x1f4,_0x256279[_0x830d('0x17')]));});});}; \ No newline at end of file +var _0xa082=['findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','CompanyId','ListId','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','asc','length','create','contact','FaxInteraction','spread','push','created','interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount'];(function(_0x1efc8c,_0x46e5ef){var _0x2f2ace=function(_0x1623a4){while(--_0x1623a4){_0x1efc8c['push'](_0x1efc8c['shift']());}};_0x2f2ace(++_0x46e5ef);}(_0xa082,0xe9));var _0x2a08=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa082[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x2a08('0x0'));var util=require(_0x2a08('0x1'));var moment=require(_0x2a08('0x2'));var BPromise=require(_0x2a08('0x3'));var rs=require(_0x2a08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a08('0x5'))['db'];var utils=require(_0x2a08('0x6'));var logger=require(_0x2a08('0x7'))(_0x2a08('0x8'));var config=require(_0x2a08('0x9'));var jayson=require(_0x2a08('0xa'));var client=jayson[_0x2a08('0xb')][_0x2a08('0xc')]({'port':0x232c});config[_0x2a08('0xd')]=_[_0x2a08('0xe')](config[_0x2a08('0xd')],{'host':_0x2a08('0xf'),'port':0x18eb});var socket=require(_0x2a08('0x10'))(new Redis(config[_0x2a08('0xd')]));require('./faxAccount.socket')[_0x2a08('0x11')](socket);function respondWithRpcPromise(_0x3b5a1d,_0x5c30e7,_0x5b477f){return new BPromise(function(_0xbd7d85,_0x106906){return client['request'](_0x3b5a1d,_0x5b477f)[_0x2a08('0x12')](function(_0x4b8bad){logger[_0x2a08('0x13')](_0x2a08('0x14'),_0x5c30e7,_0x2a08('0x15'));logger[_0x2a08('0x16')](_0x2a08('0x17'),_0x5c30e7,_0x2a08('0x15'),JSON['stringify'](_0x4b8bad));if(_0x4b8bad[_0x2a08('0x18')]){if(_0x4b8bad['error'][_0x2a08('0x19')]===0x1f4){logger[_0x2a08('0x18')](_0x2a08('0x14'),_0x5c30e7,_0x4b8bad[_0x2a08('0x18')][_0x2a08('0x1a')]);return _0x106906(_0x4b8bad[_0x2a08('0x18')][_0x2a08('0x1a')]);}logger[_0x2a08('0x18')](_0x2a08('0x14'),_0x5c30e7,_0x4b8bad[_0x2a08('0x18')]['message']);return _0xbd7d85(_0x4b8bad['error']['message']);}else{logger[_0x2a08('0x13')](_0x2a08('0x14'),_0x5c30e7,_0x2a08('0x15'));_0xbd7d85(_0x4b8bad[_0x2a08('0x1b')][_0x2a08('0x1a')]);}})[_0x2a08('0x1c')](function(_0x2154f2){logger[_0x2a08('0x18')](_0x2a08('0x14'),_0x5c30e7,_0x2154f2);_0x106906(_0x2154f2);});});}exports[_0x2a08('0x1d')]=function(_0xf1ba4){var _0x44b8b6=this;return new Promise(function(_0x4cdd4a,_0x4f6bad){return db[_0x2a08('0x1e')][_0x2a08('0x1f')]({'raw':_0xf1ba4[_0x2a08('0x20')]?_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x21')]===undefined?!![]:![]:!![],'where':_0xf1ba4[_0x2a08('0x20')]?_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x22')]||null:null,'attributes':_0xf1ba4['options']?_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x23')]||null:null,'limit':_0xf1ba4[_0x2a08('0x20')]?_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x24')]||null:null,'include':_0xf1ba4['options']?_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x25')]?_[_0x2a08('0x26')](_0xf1ba4[_0x2a08('0x20')][_0x2a08('0x25')],function(_0x19f39f){return{'model':db[_0x19f39f[_0x2a08('0x27')]],'as':_0x19f39f['as'],'attributes':_0x19f39f[_0x2a08('0x23')],'include':_0x19f39f['include']?_[_0x2a08('0x26')](_0x19f39f[_0x2a08('0x25')],function(_0x477228){return{'model':db[_0x477228[_0x2a08('0x27')]],'as':_0x477228['as'],'attributes':_0x477228[_0x2a08('0x23')],'include':_0x477228[_0x2a08('0x25')]?_[_0x2a08('0x26')](_0x477228[_0x2a08('0x25')],function(_0x305a43){return{'model':db[_0x305a43[_0x2a08('0x27')]],'as':_0x305a43['as'],'attributes':_0x305a43[_0x2a08('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2a08('0x12')](function(_0x4bd66c){logger[_0x2a08('0x13')](_0x2a08('0x1d'),_0xf1ba4);logger[_0x2a08('0x16')](_0x2a08('0x1d'),_0xf1ba4,JSON['stringify'](_0x4bd66c));_0x4cdd4a(_0x4bd66c);})[_0x2a08('0x1c')](function(_0x3d17f9){logger[_0x2a08('0x18')](_0x2a08('0x1d'),_0x3d17f9[_0x2a08('0x1a')],_0xf1ba4);_0x4f6bad(_0x44b8b6[_0x2a08('0x18')](0x1f4,_0x3d17f9['message']));});});};exports[_0x2a08('0x28')]=function(_0x341dac,_0x155875,_0x237b5e){var _0x5bfe0b=this;return new Promise(function(_0x41059d,_0x35f9a7){var _0x30b061={'body':_0x341dac[_0x2a08('0x29')],'channel':'fax'};var _0x2aae62=[];var _0x544a04=[];var _0x10f928={};return db[_0x2a08('0x2a')][_0x2a08('0x2b')]()[_0x2a08('0x12')](function(_0xe07b26){if(!_0xe07b26){throw new db[(_0x2a08('0x2c'))]['ValidationError'](_0x2a08('0x2d'));}_0x2aae62=_[_0x2a08('0x2e')](_[_0x2a08('0x2f')](_0xe07b26),['createdAt',_0x2a08('0x30')]);_0x544a04=_['difference'](_['keys'](_0xe07b26),['createdAt',_0x2a08('0x30'),_0x2a08('0x31'),_0x2a08('0x32')]);if(_0x341dac[_0x2a08('0x29')]['id']){delete _0x341dac[_0x2a08('0x29')]['id'];}if(_[_0x2a08('0x33')](_0x341dac[_0x2a08('0x29')]['from'])){throw new db[(_0x2a08('0x2c'))][(_0x2a08('0x34'))]('from\x20is\x20mandatory');}if(_[_0x2a08('0x33')](_0x341dac[_0x2a08('0x29')][_0x2a08('0x29')])||_0x341dac[_0x2a08('0x29')][_0x2a08('0x29')]===''){throw new db['Sequelize'][(_0x2a08('0x34'))](_0x2a08('0x35'));}if(_[_0x2a08('0x33')](_0x341dac[_0x2a08('0x29')][_0x2a08('0x36')])){throw new db[(_0x2a08('0x2c'))][(_0x2a08('0x34'))](_0x2a08('0x37')+_0x544a04);}if(!_['includes'](_0x544a04,_0x341dac[_0x2a08('0x29')][_0x2a08('0x36')])){throw new db[(_0x2a08('0x2c'))][(_0x2a08('0x34'))](_0x2a08('0x38')+_0x544a04);}_0x10f928[_0x341dac['body']['mapKey']]=_0x341dac[_0x2a08('0x29')][_0x2a08('0x39')];})['then'](function(){return db['FaxAccount'][_0x2a08('0x3a')]({'where':{'id':_0x341dac[_0x2a08('0x3b')]['id']},'include':[{'model':db[_0x2a08('0x3c')],'as':_0x2a08('0x3d'),'include':[{'model':db[_0x2a08('0x2a')],'as':_0x2a08('0x3e'),'where':_0x10f928,'limit':0x1,'order':[[_0x2a08('0x30'),_0x2a08('0x3f')]]}]},{'model':db[_0x2a08('0x40')],'as':'Applications'}]});})[_0x2a08('0x12')](function(_0x20c77f){if(_0x20c77f&&_0x20c77f[_0x2a08('0x3d')]){var _0x397c33=_0x20c77f[_0x2a08('0x41')]({'plain':!![]});_0x30b061[_0x2a08('0x3b')]=_0x397c33;_0x30b061[_0x2a08('0x42')]=_0x397c33[_0x2a08('0x43')];_0x30b061[_0x2a08('0x44')]=_0x397c33['List'];_0x30b061[_0x2a08('0x42')]=_['orderBy'](_0x30b061[_0x2a08('0x42')],['priority'],[_0x2a08('0x45')]);if(_0x30b061['account'][_0x2a08('0x43')]){delete _0x30b061[_0x2a08('0x3b')][_0x2a08('0x43')];}if(_0x30b061[_0x2a08('0x3b')][_0x2a08('0x3d')]&&_0x30b061[_0x2a08('0x3b')]['List'][_0x2a08('0x3e')][_0x2a08('0x46')]){return _0x30b061['account'][_0x2a08('0x3d')][_0x2a08('0x3e')][0x0];}var _0x187340=_['defaults'](_0x341dac[_0x2a08('0x29')],{'firstName':_0x341dac[_0x2a08('0x29')]['from'],'ListId':_0x397c33[_0x2a08('0x32')]});_0x187340[_0x341dac[_0x2a08('0x29')][_0x2a08('0x36')]]=_0x341dac[_0x2a08('0x29')][_0x2a08('0x39')];return db[_0x2a08('0x2a')][_0x2a08('0x47')](_0x187340,{'fields':_0x2aae62,'raw':!![]});}})['then'](function(_0x5d8179){_0x30b061[_0x2a08('0x48')]=_0x5d8179;if(_0x5d8179){var _0x26e6fe={'ContactId':_0x5d8179['id'],'FaxAccountId':_0x341dac['account']['id'],'fax':_0x5d8179['fax']};return db[_0x2a08('0x49')]['find']({'where':{'ContactId':_0x5d8179['id'],'closed':![],'FaxAccountId':_0x341dac[_0x2a08('0x3b')]['id']}})['then'](function(_0x5c9e63){if(_0x5c9e63){return[_0x5c9e63,![]];}return db[_0x2a08('0x49')]['create'](_0x26e6fe)['then'](function(_0x5b1e26){return[_0x5b1e26,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x2a08('0x4a')](function(_0x5b66f1,_0x10350f){var _0x4c4d69=_0x5b66f1[_0x2a08('0x41')]({'plain':!![]});if(_0x10350f){if(_0x30b061['account']['autoclose']){_0x30b061[_0x2a08('0x42')][_0x2a08('0x4b')]({'id':0x0,'priority':_0x30b061[_0x2a08('0x42')][_0x2a08('0x46')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x4c4d69[_0x2a08('0x4c')]=!![];}else{_0x4c4d69[_0x2a08('0x4c')]=![];}_0x30b061[_0x2a08('0x4d')]=_0x4c4d69;return db['FaxMessage']['create']({'body':_0x341dac[_0x2a08('0x29')][_0x2a08('0x29')],'FaxAccountId':_0x341dac['account']['id'],'FaxInteractionId':_0x5b66f1['id'],'direction':'in','ContactId':_0x5b66f1[_0x2a08('0x4e')],'AttachmentId':_0x341dac['body']['AttachmentId']});})[_0x2a08('0x12')](function(_0x5c0fdf){_0x30b061['message']=_0x5c0fdf;if(_0x30b061[_0x2a08('0x4d')][_0x2a08('0x4f')]){return db[_0x2a08('0x50')][_0x2a08('0x3a')]({'attributes':['id',_0x2a08('0x51')],'where':{'id':_0x30b061[_0x2a08('0x4d')][_0x2a08('0x4f')]}})[_0x2a08('0x12')](function(_0x329e92){if(_0x329e92){_0x30b061['applications'][_0x2a08('0x52')]({'id':0x0,'priority':0x0,'app':_0x2a08('0x53'),'appdata':_0x329e92[_0x2a08('0x51')]+','+(_0x30b061[_0x2a08('0x3b')][_0x2a08('0x54')]||0xa),'interval':_0x2a08('0x55')});}return respondWithRpcPromise(_0x2a08('0x56'),_0x2a08('0x57'),_0x30b061);});}return respondWithRpcPromise(_0x2a08('0x56'),_0x2a08('0x57'),_0x30b061);})[_0x2a08('0x12')](function(_0x53bdb9){_0x41059d(_0x53bdb9);})[_0x2a08('0x1c')](function(_0x6e5b76){_0x35f9a7(_0x5bfe0b['error'](0x1f4,_0x6e5b76[_0x2a08('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 4911e52..bb14cc0 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 _0x2598=['update','emit','removeListener','register','./faxAccount.events','remove'];(function(_0x19d43e,_0x176978){var _0x5eef74=function(_0x440d3a){while(--_0x440d3a){_0x19d43e['push'](_0x19d43e['shift']());}};_0x5eef74(++_0x176978);}(_0x2598,0x1c6));var _0x8259=function(_0x3c0c9e,_0x3ecdee){_0x3c0c9e=_0x3c0c9e-0x0;var _0x5ba5fe=_0x2598[_0x3c0c9e];return _0x5ba5fe;};'use strict';var FaxAccountEvents=require(_0x8259('0x0'));var events=['save',_0x8259('0x1'),_0x8259('0x2')];function createListener(_0x281258,_0x11f49b){return function(_0x30190f){_0x11f49b[_0x8259('0x3')](_0x281258,_0x30190f);};}function removeListener(_0x12a252,_0xdcee9c){return function(){FaxAccountEvents[_0x8259('0x4')](_0x12a252,_0xdcee9c);};}exports[_0x8259('0x5')]=function(_0x22151b){for(var _0x1dac24=0x0,_0x573547=events['length'];_0x1dac24<_0x573547;_0x1dac24++){var _0xc0eeda=events[_0x1dac24];var _0x52a418=createListener('faxAccount:'+_0xc0eeda,_0x22151b);FaxAccountEvents['on'](_0xc0eeda,_0x52a418);}}; \ No newline at end of file +var _0xd507=['faxAccount:','remove','update','emit','removeListener','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd507,0xb0));var _0x7d50=function(_0x11e0a4,_0x20b367){_0x11e0a4=_0x11e0a4-0x0;var _0x42a95d=_0xd507[_0x11e0a4];return _0x42a95d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x7d50('0x0'),_0x7d50('0x1')];function createListener(_0x4b5057,_0x536458){return function(_0x155507){_0x536458[_0x7d50('0x2')](_0x4b5057,_0x155507);};}function removeListener(_0x2e2eae,_0x106f11){return function(){FaxAccountEvents[_0x7d50('0x3')](_0x2e2eae,_0x106f11);};}exports[_0x7d50('0x4')]=function(_0x53a6f1){for(var _0x5c726a=0x0,_0x1b5391=events[_0x7d50('0x5')];_0x5c726a<_0x1b5391;_0x5c726a++){var _0x252a36=events[_0x5c726a];var _0x20338a=createListener(_0x7d50('0x6')+_0x252a36,_0x53a6f1);FaxAccountEvents['on'](_0x252a36,_0x20338a);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 10dbb7c..0be0ef1 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(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_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 +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(_0x6d6f7,_0x4ba1a9){var _0x2a6afe=function(_0x2b9c3c){while(--_0x2b9c3c){_0x6d6f7['push'](_0x6d6f7['shift']());}};_0x2a6afe(++_0x4ba1a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 b57839e..5a6ac23 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 _0xfaa4=['TEXT','*,*,*,*','sequelize','STRING'];(function(_0x4d461c,_0x1f18f2){var _0x1413bb=function(_0x13ad3d){while(--_0x13ad3d){_0x4d461c['push'](_0x4d461c['shift']());}};_0x1413bb(++_0x1f18f2);}(_0xfaa4,0xde));var _0x4faa=function(_0x3eee67,_0x125ea6){_0x3eee67=_0x3eee67-0x0;var _0x1f30bc=_0xfaa4[_0x3eee67];return _0x1f30bc;};'use strict';var Sequelize=require(_0x4faa('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4faa('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4faa('0x2')]()},'description':{'type':Sequelize[_0x4faa('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4faa('0x3')}}; \ No newline at end of file +var _0xa495=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa495,0x1e7));var _0x5a49=function(_0x5bb149,_0x456cdc){_0x5bb149=_0x5bb149-0x0;var _0x1c85f5=_0xa495[_0x5bb149];return _0x1c85f5;};'use strict';var Sequelize=require(_0x5a49('0x0'));module[_0x5a49('0x1')]={'priority':{'type':Sequelize[_0x5a49('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5a49('0x3')},'appdata':{'type':Sequelize[_0x5a49('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5a49('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 23632e0..d644823 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 _0x9f47=['apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','FaxApplication','includeAll','include','catch','show','params','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x9f47,0xc1));var _0x79f4=function(_0x40d4dc,_0x4dc80d){_0x40d4dc=_0x40d4dc-0x0;var _0xa78734=_0x9f47[_0x40d4dc];return _0xa78734;};'use strict';var emlformat=require(_0x79f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79f4('0x2'));var moment=require(_0x79f4('0x3'));var BPromise=require(_0x79f4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x79f4('0x5'));var csv=require(_0x79f4('0x6'));var ejs=require(_0x79f4('0x7'));var fs=require('fs');var fs_extra=require(_0x79f4('0x8'));var _=require(_0x79f4('0x9'));var squel=require(_0x79f4('0xa'));var crypto=require(_0x79f4('0xb'));var jsforce=require(_0x79f4('0xc'));var deskjs=require(_0x79f4('0xd'));var toCsv=require(_0x79f4('0x6'));var querystring=require(_0x79f4('0xe'));var Papa=require(_0x79f4('0xf'));var Redis=require(_0x79f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x79f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79f4('0x12'));var logger=require('../../config/logger')(_0x79f4('0x13'));var utils=require(_0x79f4('0x14'));var config=require(_0x79f4('0x15'));var licenseUtil=require(_0x79f4('0x16'));var db=require(_0x79f4('0x17'))['db'];function respondWithStatusCode(_0x475fa4,_0x8fbebf){_0x8fbebf=_0x8fbebf||0xcc;return function(_0xa8baa3){if(_0xa8baa3){return _0x475fa4['sendStatus'](_0x8fbebf);}return _0x475fa4['status'](_0x8fbebf)['end']();};}function respondWithResult(_0x456219,_0x5250ba){_0x5250ba=_0x5250ba||0xc8;return function(_0x2caf2d){if(_0x2caf2d){return _0x456219['status'](_0x5250ba)[_0x79f4('0x18')](_0x2caf2d);}};}function respondWithFilteredResult(_0x4ed6a0,_0x2284fb){return function(_0x35dc33){if(_0x35dc33){var _0x4b3d23=typeof _0x2284fb[_0x79f4('0x19')]===_0x79f4('0x1a')&&typeof _0x2284fb[_0x79f4('0x1b')]==='undefined';var _0x3941f5=_0x35dc33[_0x79f4('0x1c')];var _0x2314f7=_0x4b3d23?0x0:_0x2284fb[_0x79f4('0x19')];var _0x340859=_0x4b3d23?_0x35dc33[_0x79f4('0x1c')]:_0x2284fb[_0x79f4('0x19')]+_0x2284fb[_0x79f4('0x1b')];var _0x183e92;if(_0x340859>=_0x3941f5){_0x340859=_0x3941f5;_0x183e92=0xc8;}else{_0x183e92=0xce;}_0x4ed6a0[_0x79f4('0x1d')](_0x183e92);return _0x4ed6a0[_0x79f4('0x1e')](_0x79f4('0x1f'),_0x2314f7+'-'+_0x340859+'/'+_0x3941f5)[_0x79f4('0x18')](_0x35dc33);}return null;};}function patchUpdates(_0x819de0){return function(_0x545cc8){try{jsonpatch[_0x79f4('0x20')](_0x545cc8,_0x819de0,!![]);}catch(_0x437019){return BPromise[_0x79f4('0x21')](_0x437019);}return _0x545cc8[_0x79f4('0x22')]();};}function saveUpdates(_0xc6447f,_0x804d0){return function(_0x929c70){if(_0x929c70){return _0x929c70['update'](_0xc6447f)[_0x79f4('0x23')](function(_0x2c15d5){return _0x2c15d5;});}return null;};}function removeEntity(_0x20b9f4,_0x5ecf7f){return function(_0x5b7280){if(_0x5b7280){return _0x5b7280[_0x79f4('0x24')]()['then'](function(){_0x20b9f4[_0x79f4('0x1d')](0xcc)[_0x79f4('0x25')]();});}};}function handleEntityNotFound(_0x5a4888,_0x3d44d6){return function(_0x1d74e9){if(!_0x1d74e9){_0x5a4888[_0x79f4('0x26')](0x194);}return _0x1d74e9;};}function handleError(_0x1ce61d,_0x49454){_0x49454=_0x49454||0x1f4;return function(_0x35fbf2){logger[_0x79f4('0x27')](_0x35fbf2[_0x79f4('0x28')]);if(_0x35fbf2[_0x79f4('0x29')]){delete _0x35fbf2['name'];}_0x1ce61d[_0x79f4('0x1d')](_0x49454)[_0x79f4('0x2a')](_0x35fbf2);};}exports[_0x79f4('0x2b')]=function(_0xb4ac8b,_0x4c5c32){var _0x35172e={},_0x8d6173={},_0x4e5b93={'count':0x0,'rows':[]};var _0x5ec4ba=_[_0x79f4('0x2c')](db['FaxApplication'][_0x79f4('0x2d')],function(_0x533552){return{'name':_0x533552[_0x79f4('0x2e')],'type':_0x533552[_0x79f4('0x2f')][_0x79f4('0x30')]};});_0x8d6173[_0x79f4('0x31')]=_[_0x79f4('0x2c')](_0x5ec4ba,_0x79f4('0x29'));_0x8d6173[_0x79f4('0x32')]=_[_0x79f4('0x33')](_0xb4ac8b['query']);_0x8d6173[_0x79f4('0x34')]=_[_0x79f4('0x35')](_0x8d6173[_0x79f4('0x31')],_0x8d6173[_0x79f4('0x32')]);_0x35172e[_0x79f4('0x36')]=_[_0x79f4('0x35')](_0x8d6173[_0x79f4('0x31')],qs[_0x79f4('0x37')](_0xb4ac8b[_0x79f4('0x32')][_0x79f4('0x37')]));_0x35172e[_0x79f4('0x36')]=_0x35172e['attributes'][_0x79f4('0x38')]?_0x35172e[_0x79f4('0x36')]:_0x8d6173[_0x79f4('0x31')];if(!_0xb4ac8b['query'][_0x79f4('0x39')]('nolimit')){_0x35172e['limit']=qs[_0x79f4('0x1b')](_0xb4ac8b[_0x79f4('0x32')][_0x79f4('0x1b')]);_0x35172e['offset']=qs[_0x79f4('0x19')](_0xb4ac8b['query'][_0x79f4('0x19')]);}_0x35172e[_0x79f4('0x3a')]=qs[_0x79f4('0x3b')](_0xb4ac8b['query'][_0x79f4('0x3b')]);_0x35172e[_0x79f4('0x3c')]=qs[_0x79f4('0x34')](_['pick'](_0xb4ac8b[_0x79f4('0x32')],_0x8d6173[_0x79f4('0x34')]),_0x5ec4ba);if(_0xb4ac8b[_0x79f4('0x32')][_0x79f4('0x3d')]){_0x35172e[_0x79f4('0x3c')]=_['merge'](_0x35172e[_0x79f4('0x3c')],{'$or':_[_0x79f4('0x2c')](_0x5ec4ba,function(_0x11f897){if(_0x11f897[_0x79f4('0x2f')]!==_0x79f4('0x3e')){var _0x1a81d4={};_0x1a81d4[_0x11f897[_0x79f4('0x29')]]={'$like':'%'+_0xb4ac8b['query'][_0x79f4('0x3d')]+'%'};return _0x1a81d4;}})});}_0x35172e=_[_0x79f4('0x3f')]({},_0x35172e,_0xb4ac8b[_0x79f4('0x40')]);var _0x4a9085={'where':_0x35172e[_0x79f4('0x3c')]};return db[_0x79f4('0x41')]['count'](_0x4a9085)[_0x79f4('0x23')](function(_0x861d2b){_0x4e5b93[_0x79f4('0x1c')]=_0x861d2b;if(_0xb4ac8b[_0x79f4('0x32')][_0x79f4('0x42')]){_0x35172e[_0x79f4('0x43')]=[{'all':!![]}];}return db[_0x79f4('0x41')]['findAll'](_0x35172e);})[_0x79f4('0x23')](function(_0x10ea7b){_0x4e5b93['rows']=_0x10ea7b;return _0x4e5b93;})[_0x79f4('0x23')](respondWithFilteredResult(_0x4c5c32,_0x35172e))[_0x79f4('0x44')](handleError(_0x4c5c32,null));};exports[_0x79f4('0x45')]=function(_0xddbdb,_0x496e70){var _0x1e1e1a={'raw':!![],'where':{'id':_0xddbdb[_0x79f4('0x46')]['id']}},_0x510dc3={};_0x510dc3['model']=_['keys'](db[_0x79f4('0x41')][_0x79f4('0x2d')]);_0x510dc3[_0x79f4('0x32')]=_[_0x79f4('0x33')](_0xddbdb['query']);_0x510dc3['filters']=_[_0x79f4('0x35')](_0x510dc3[_0x79f4('0x31')],_0x510dc3[_0x79f4('0x32')]);_0x1e1e1a[_0x79f4('0x36')]=_['intersection'](_0x510dc3['model'],qs[_0x79f4('0x37')](_0xddbdb[_0x79f4('0x32')][_0x79f4('0x37')]));_0x1e1e1a[_0x79f4('0x36')]=_0x1e1e1a[_0x79f4('0x36')][_0x79f4('0x38')]?_0x1e1e1a[_0x79f4('0x36')]:_0x510dc3[_0x79f4('0x31')];if(_0xddbdb[_0x79f4('0x32')][_0x79f4('0x42')]){_0x1e1e1a[_0x79f4('0x43')]=[{'all':!![]}];}_0x1e1e1a=_['merge']({},_0x1e1e1a,_0xddbdb[_0x79f4('0x40')]);return db['FaxApplication'][_0x79f4('0x47')](_0x1e1e1a)[_0x79f4('0x23')](handleEntityNotFound(_0x496e70,null))[_0x79f4('0x23')](respondWithResult(_0x496e70,null))[_0x79f4('0x44')](handleError(_0x496e70,null));};exports['create']=function(_0x41d4ef,_0x3eae71){return db[_0x79f4('0x41')][_0x79f4('0x48')](_0x41d4ef[_0x79f4('0x49')],{})[_0x79f4('0x23')](respondWithResult(_0x3eae71,0xc9))[_0x79f4('0x44')](handleError(_0x3eae71,null));};exports[_0x79f4('0x4a')]=function(_0x1f4fdd,_0x274ee5){if(_0x1f4fdd[_0x79f4('0x49')]['id']){delete _0x1f4fdd[_0x79f4('0x49')]['id'];}return db[_0x79f4('0x41')][_0x79f4('0x47')]({'where':{'id':_0x1f4fdd[_0x79f4('0x46')]['id']}})[_0x79f4('0x23')](handleEntityNotFound(_0x274ee5,null))[_0x79f4('0x23')](saveUpdates(_0x1f4fdd[_0x79f4('0x49')],null))[_0x79f4('0x23')](respondWithResult(_0x274ee5,null))[_0x79f4('0x44')](handleError(_0x274ee5,null));};exports['destroy']=function(_0x2bd4c7,_0x5a8e3f){return db[_0x79f4('0x41')][_0x79f4('0x47')]({'where':{'id':_0x2bd4c7[_0x79f4('0x46')]['id']}})[_0x79f4('0x23')](handleEntityNotFound(_0x5a8e3f,null))[_0x79f4('0x23')](removeEntity(_0x5a8e3f,null))[_0x79f4('0x44')](handleError(_0x5a8e3f,null));}; \ No newline at end of file +var _0x38c9=['VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x15b9e1,_0xfc0909){var _0x4db0d6=function(_0x1b2ef9){while(--_0x1b2ef9){_0x15b9e1['push'](_0x15b9e1['shift']());}};_0x4db0d6(++_0xfc0909);}(_0x38c9,0xea));var _0x938c=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x38c9[_0x311909];return _0x8d3163;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x938c('0x0'));var jsonpatch=require(_0x938c('0x1'));var rp=require(_0x938c('0x2'));var moment=require(_0x938c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x938c('0x4'));var util=require(_0x938c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x938c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x938c('0x7'));var crypto=require(_0x938c('0x8'));var jsforce=require(_0x938c('0x9'));var deskjs=require(_0x938c('0xa'));var toCsv=require(_0x938c('0xb'));var querystring=require(_0x938c('0xc'));var Papa=require(_0x938c('0xd'));var Redis=require(_0x938c('0xe'));var authService=require(_0x938c('0xf'));var qs=require(_0x938c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x938c('0x11'));var logger=require(_0x938c('0x12'))(_0x938c('0x13'));var utils=require('../../config/utils');var config=require(_0x938c('0x14'));var licenseUtil=require(_0x938c('0x15'));var db=require(_0x938c('0x16'))['db'];function respondWithStatusCode(_0x5b30bd,_0x143a1d){_0x143a1d=_0x143a1d||0xcc;return function(_0x49c17c){if(_0x49c17c){return _0x5b30bd[_0x938c('0x17')](_0x143a1d);}return _0x5b30bd['status'](_0x143a1d)[_0x938c('0x18')]();};}function respondWithResult(_0x4c5dd1,_0xf1c904){_0xf1c904=_0xf1c904||0xc8;return function(_0x37d22a){if(_0x37d22a){return _0x4c5dd1[_0x938c('0x19')](_0xf1c904)[_0x938c('0x1a')](_0x37d22a);}};}function respondWithFilteredResult(_0x1fa947,_0x4c8071){return function(_0x3a62b1){if(_0x3a62b1){var _0x2f4710=typeof _0x4c8071[_0x938c('0x1b')]===_0x938c('0x1c')&&typeof _0x4c8071[_0x938c('0x1d')]===_0x938c('0x1c');var _0x2ca2ae=_0x3a62b1[_0x938c('0x1e')];var _0x603458=_0x2f4710?0x0:_0x4c8071[_0x938c('0x1b')];var _0x176d8a=_0x2f4710?_0x3a62b1[_0x938c('0x1e')]:_0x4c8071[_0x938c('0x1b')]+_0x4c8071[_0x938c('0x1d')];var _0x5715ec;if(_0x176d8a>=_0x2ca2ae){_0x176d8a=_0x2ca2ae;_0x5715ec=0xc8;}else{_0x5715ec=0xce;}_0x1fa947[_0x938c('0x19')](_0x5715ec);return _0x1fa947[_0x938c('0x1f')](_0x938c('0x20'),_0x603458+'-'+_0x176d8a+'/'+_0x2ca2ae)[_0x938c('0x1a')](_0x3a62b1);}return null;};}function patchUpdates(_0x3c6db9){return function(_0x3b9649){try{jsonpatch['apply'](_0x3b9649,_0x3c6db9,!![]);}catch(_0x714789){return BPromise[_0x938c('0x21')](_0x714789);}return _0x3b9649[_0x938c('0x22')]();};}function saveUpdates(_0x5668ab,_0x4adb19){return function(_0x518ea8){if(_0x518ea8){return _0x518ea8[_0x938c('0x23')](_0x5668ab)[_0x938c('0x24')](function(_0x5d67de){return _0x5d67de;});}return null;};}function removeEntity(_0x218db2,_0xf23832){return function(_0x2a15c8){if(_0x2a15c8){return _0x2a15c8[_0x938c('0x25')]()[_0x938c('0x24')](function(){_0x218db2[_0x938c('0x19')](0xcc)[_0x938c('0x18')]();});}};}function handleEntityNotFound(_0x2d29bb,_0x5a132c){return function(_0x58a4aa){if(!_0x58a4aa){_0x2d29bb[_0x938c('0x17')](0x194);}return _0x58a4aa;};}function handleError(_0x19330e,_0xb464ea){_0xb464ea=_0xb464ea||0x1f4;return function(_0x35deef){logger[_0x938c('0x26')](_0x35deef[_0x938c('0x27')]);if(_0x35deef[_0x938c('0x28')]){delete _0x35deef['name'];}_0x19330e[_0x938c('0x19')](_0xb464ea)[_0x938c('0x29')](_0x35deef);};}exports[_0x938c('0x2a')]=function(_0x3fb60d,_0xd7d2ea){var _0x52f58e={},_0x18e6db={},_0x5fc699={'count':0x0,'rows':[]};var _0x11c4ed=_[_0x938c('0x2b')](db['FaxApplication'][_0x938c('0x2c')],function(_0x52569b){return{'name':_0x52569b['fieldName'],'type':_0x52569b[_0x938c('0x2d')][_0x938c('0x2e')]};});_0x18e6db[_0x938c('0x2f')]=_[_0x938c('0x2b')](_0x11c4ed,_0x938c('0x28'));_0x18e6db[_0x938c('0x30')]=_[_0x938c('0x31')](_0x3fb60d[_0x938c('0x30')]);_0x18e6db[_0x938c('0x32')]=_[_0x938c('0x33')](_0x18e6db['model'],_0x18e6db['query']);_0x52f58e[_0x938c('0x34')]=_[_0x938c('0x33')](_0x18e6db[_0x938c('0x2f')],qs['fields'](_0x3fb60d['query'][_0x938c('0x35')]));_0x52f58e[_0x938c('0x34')]=_0x52f58e['attributes'][_0x938c('0x36')]?_0x52f58e[_0x938c('0x34')]:_0x18e6db[_0x938c('0x2f')];if(!_0x3fb60d[_0x938c('0x30')][_0x938c('0x37')](_0x938c('0x38'))){_0x52f58e[_0x938c('0x1d')]=qs[_0x938c('0x1d')](_0x3fb60d['query'][_0x938c('0x1d')]);_0x52f58e['offset']=qs[_0x938c('0x1b')](_0x3fb60d[_0x938c('0x30')][_0x938c('0x1b')]);}_0x52f58e['order']=qs[_0x938c('0x39')](_0x3fb60d[_0x938c('0x30')]['sort']);_0x52f58e[_0x938c('0x3a')]=qs['filters'](_[_0x938c('0x3b')](_0x3fb60d['query'],_0x18e6db[_0x938c('0x32')]),_0x11c4ed);if(_0x3fb60d[_0x938c('0x30')][_0x938c('0x3c')]){_0x52f58e[_0x938c('0x3a')]=_[_0x938c('0x3d')](_0x52f58e[_0x938c('0x3a')],{'$or':_[_0x938c('0x2b')](_0x11c4ed,function(_0x3b284f){if(_0x3b284f[_0x938c('0x2d')]!==_0x938c('0x3e')){var _0x12f681={};_0x12f681[_0x3b284f[_0x938c('0x28')]]={'$like':'%'+_0x3fb60d['query'][_0x938c('0x3c')]+'%'};return _0x12f681;}})});}_0x52f58e=_[_0x938c('0x3d')]({},_0x52f58e,_0x3fb60d[_0x938c('0x3f')]);var _0x6eee5e={'where':_0x52f58e[_0x938c('0x3a')]};return db[_0x938c('0x40')][_0x938c('0x1e')](_0x6eee5e)[_0x938c('0x24')](function(_0x5d1e78){_0x5fc699[_0x938c('0x1e')]=_0x5d1e78;if(_0x3fb60d[_0x938c('0x30')][_0x938c('0x41')]){_0x52f58e[_0x938c('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x938c('0x43')](_0x52f58e);})['then'](function(_0x355ba2){_0x5fc699[_0x938c('0x44')]=_0x355ba2;return _0x5fc699;})[_0x938c('0x24')](respondWithFilteredResult(_0xd7d2ea,_0x52f58e))[_0x938c('0x45')](handleError(_0xd7d2ea,null));};exports['show']=function(_0x5057ed,_0x2f3dfc){var _0xcaa2a2={'raw':!![],'where':{'id':_0x5057ed[_0x938c('0x46')]['id']}},_0x15870c={};_0x15870c[_0x938c('0x2f')]=_[_0x938c('0x31')](db[_0x938c('0x40')][_0x938c('0x2c')]);_0x15870c['query']=_[_0x938c('0x31')](_0x5057ed['query']);_0x15870c[_0x938c('0x32')]=_[_0x938c('0x33')](_0x15870c[_0x938c('0x2f')],_0x15870c['query']);_0xcaa2a2[_0x938c('0x34')]=_[_0x938c('0x33')](_0x15870c['model'],qs['fields'](_0x5057ed[_0x938c('0x30')]['fields']));_0xcaa2a2[_0x938c('0x34')]=_0xcaa2a2[_0x938c('0x34')][_0x938c('0x36')]?_0xcaa2a2[_0x938c('0x34')]:_0x15870c[_0x938c('0x2f')];if(_0x5057ed['query']['includeAll']){_0xcaa2a2[_0x938c('0x42')]=[{'all':!![]}];}_0xcaa2a2=_['merge']({},_0xcaa2a2,_0x5057ed[_0x938c('0x3f')]);return db['FaxApplication'][_0x938c('0x47')](_0xcaa2a2)[_0x938c('0x24')](handleEntityNotFound(_0x2f3dfc,null))[_0x938c('0x24')](respondWithResult(_0x2f3dfc,null))[_0x938c('0x45')](handleError(_0x2f3dfc,null));};exports['create']=function(_0x5eaf9e,_0x496716){return db[_0x938c('0x40')][_0x938c('0x48')](_0x5eaf9e[_0x938c('0x49')],{})[_0x938c('0x24')](respondWithResult(_0x496716,0xc9))[_0x938c('0x45')](handleError(_0x496716,null));};exports[_0x938c('0x23')]=function(_0x49dd7d,_0x46ba0c){if(_0x49dd7d[_0x938c('0x49')]['id']){delete _0x49dd7d[_0x938c('0x49')]['id'];}return db[_0x938c('0x40')][_0x938c('0x47')]({'where':{'id':_0x49dd7d[_0x938c('0x46')]['id']}})[_0x938c('0x24')](handleEntityNotFound(_0x46ba0c,null))[_0x938c('0x24')](saveUpdates(_0x49dd7d[_0x938c('0x49')],null))[_0x938c('0x24')](respondWithResult(_0x46ba0c,null))[_0x938c('0x45')](handleError(_0x46ba0c,null));};exports[_0x938c('0x25')]=function(_0x52155a,_0x4150b3){return db[_0x938c('0x40')][_0x938c('0x47')]({'where':{'id':_0x52155a[_0x938c('0x46')]['id']}})[_0x938c('0x24')](handleEntityNotFound(_0x4150b3,null))[_0x938c('0x24')](removeEntity(_0x4150b3,null))[_0x938c('0x45')](handleError(_0x4150b3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 200d1a5..00ffb94 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 _0x1ff8=['request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x1a1271,_0x3056b9){var _0x592623=function(_0x315dcf){while(--_0x315dcf){_0x1a1271['push'](_0x1a1271['shift']());}};_0x592623(++_0x3056b9);}(_0x1ff8,0x136));var _0x81ff=function(_0x471b36,_0x2095a9){_0x471b36=_0x471b36-0x0;var _0x1e10c6=_0x1ff8[_0x471b36];return _0x1e10c6;};'use strict';var _=require('lodash');var util=require(_0x81ff('0x0'));var logger=require(_0x81ff('0x1'))(_0x81ff('0x2'));var moment=require(_0x81ff('0x3'));var BPromise=require(_0x81ff('0x4'));var rp=require(_0x81ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81ff('0x6'));var config=require(_0x81ff('0x7'));var attributes=require(_0x81ff('0x8'));module[_0x81ff('0x9')]=function(_0x3dc008,_0xe8e4e7){return _0x3dc008[_0x81ff('0xa')](_0x81ff('0xb'),attributes,{'tableName':_0x81ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81ff('0xd'),'collate':_0x81ff('0xe')});}; \ No newline at end of file +var _0x776d=['bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3cf1bc,_0x2968d6){var _0x5642ce=function(_0x5ab375){while(--_0x5ab375){_0x3cf1bc['push'](_0x3cf1bc['shift']());}};_0x5642ce(++_0x2968d6);}(_0x776d,0x75));var _0xd776=function(_0x448987,_0x4b9dbd){_0x448987=_0x448987-0x0;var _0x483901=_0x776d[_0x448987];return _0x483901;};'use strict';var _=require('lodash');var util=require(_0xd776('0x0'));var logger=require(_0xd776('0x1'))(_0xd776('0x2'));var moment=require('moment');var BPromise=require(_0xd776('0x3'));var rp=require(_0xd776('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd776('0x5'));var config=require(_0xd776('0x6'));var attributes=require(_0xd776('0x7'));module[_0xd776('0x8')]=function(_0x3ba42f,_0xc5a0cc){return _0x3ba42f['define'](_0xd776('0x9'),attributes,{'tableName':_0xd776('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd776('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c34e284..fba53b3 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 _0x21f8=['code','message','info','result','UpdateFaxApplication','update','body','options','raw','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x552bf3,_0x13d3e7){var _0x5f5c29=function(_0x458df5){while(--_0x458df5){_0x552bf3['push'](_0x552bf3['shift']());}};_0x5f5c29(++_0x13d3e7);}(_0x21f8,0x119));var _0x821f=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x21f8[_0x3bceea];return _0x30a8d3;};'use strict';var _=require(_0x821f('0x0'));var util=require(_0x821f('0x1'));var moment=require(_0x821f('0x2'));var BPromise=require(_0x821f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x821f('0x4'));var db=require(_0x821f('0x5'))['db'];var utils=require(_0x821f('0x6'));var logger=require(_0x821f('0x7'))(_0x821f('0x8'));var config=require('../../config/environment');var jayson=require(_0x821f('0x9'));var client=jayson[_0x821f('0xa')][_0x821f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x333410,_0x46372d,_0x4d5f4d){return new BPromise(function(_0x2bb352,_0x276b45){return client['request'](_0x333410,_0x4d5f4d)[_0x821f('0xc')](function(_0x2f5ab3){logger['info'](_0x821f('0xd'),_0x46372d,_0x821f('0xe'));logger[_0x821f('0xf')](_0x821f('0x10'),_0x46372d,_0x821f('0xe'),JSON[_0x821f('0x11')](_0x2f5ab3));if(_0x2f5ab3['error']){if(_0x2f5ab3[_0x821f('0x12')][_0x821f('0x13')]===0x1f4){logger[_0x821f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x46372d,_0x2f5ab3['error'][_0x821f('0x14')]);return _0x276b45(_0x2f5ab3[_0x821f('0x12')][_0x821f('0x14')]);}logger[_0x821f('0x12')](_0x821f('0xd'),_0x46372d,_0x2f5ab3[_0x821f('0x12')][_0x821f('0x14')]);return _0x2bb352(_0x2f5ab3['error'][_0x821f('0x14')]);}else{logger[_0x821f('0x15')](_0x821f('0xd'),_0x46372d,'request\x20sent');_0x2bb352(_0x2f5ab3[_0x821f('0x16')]['message']);}})['catch'](function(_0x48b503){logger[_0x821f('0x12')](_0x821f('0xd'),_0x46372d,_0x48b503);_0x276b45(_0x48b503);});});}exports[_0x821f('0x17')]=function(_0x40ee51){var _0x603abb=this;return new Promise(function(_0x572afd,_0x4a48dd){return db['FaxApplication'][_0x821f('0x18')](_0x40ee51[_0x821f('0x19')],{'raw':_0x40ee51[_0x821f('0x1a')]?_0x40ee51[_0x821f('0x1a')][_0x821f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40ee51[_0x821f('0x1a')]?_0x40ee51['options']['where']||null:null,'attributes':_0x40ee51[_0x821f('0x1a')]?_0x40ee51[_0x821f('0x1a')][_0x821f('0x1c')]||null:null,'limit':_0x40ee51[_0x821f('0x1a')]?_0x40ee51[_0x821f('0x1a')][_0x821f('0x1d')]||null:null})[_0x821f('0xc')](function(_0x2fef9a){logger[_0x821f('0x15')](_0x821f('0x17'),_0x40ee51);logger[_0x821f('0xf')](_0x821f('0x17'),_0x40ee51,JSON['stringify'](_0x2fef9a));_0x572afd(_0x2fef9a);})['catch'](function(_0x51a923){logger[_0x821f('0x12')]('UpdateFaxApplication',_0x51a923[_0x821f('0x14')],_0x40ee51);_0x4a48dd(_0x603abb['error'](0x1f4,_0x51a923['message']));});});}; \ No newline at end of file +var _0xfc7a=['stringify','error','code','FaxApplication,\x20%s,\x20%s','message','catch','update','body','options','raw','where','attributes','UpdateFaxApplication','debug','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','then','info','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x11a3f0,_0x1ed3a6){var _0xfdddfe=function(_0x347ba0){while(--_0x347ba0){_0x11a3f0['push'](_0x11a3f0['shift']());}};_0xfdddfe(++_0x1ed3a6);}(_0xfc7a,0xbd));var _0xafc7=function(_0x21fe11,_0x52f846){_0x21fe11=_0x21fe11-0x0;var _0x5eb704=_0xfc7a[_0x21fe11];return _0x5eb704;};'use strict';var _=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var moment=require('moment');var BPromise=require(_0xafc7('0x2'));var rs=require(_0xafc7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xafc7('0x4'))(_0xafc7('0x5'));var config=require('../../config/environment');var jayson=require(_0xafc7('0x6'));var client=jayson['client'][_0xafc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1499f1,_0x320ac4,_0x5bfa47){return new BPromise(function(_0x564acc,_0x112a6f){return client['request'](_0x1499f1,_0x5bfa47)[_0xafc7('0x8')](function(_0x2aff3f){logger[_0xafc7('0x9')]('FaxApplication,\x20%s,\x20%s',_0x320ac4,'request\x20sent');logger['debug'](_0xafc7('0xa'),_0x320ac4,'request\x20sent',JSON[_0xafc7('0xb')](_0x2aff3f));if(_0x2aff3f[_0xafc7('0xc')]){if(_0x2aff3f[_0xafc7('0xc')][_0xafc7('0xd')]===0x1f4){logger[_0xafc7('0xc')](_0xafc7('0xe'),_0x320ac4,_0x2aff3f['error'][_0xafc7('0xf')]);return _0x112a6f(_0x2aff3f[_0xafc7('0xc')]['message']);}logger['error'](_0xafc7('0xe'),_0x320ac4,_0x2aff3f[_0xafc7('0xc')][_0xafc7('0xf')]);return _0x564acc(_0x2aff3f[_0xafc7('0xc')][_0xafc7('0xf')]);}else{logger[_0xafc7('0x9')](_0xafc7('0xe'),_0x320ac4,'request\x20sent');_0x564acc(_0x2aff3f['result'][_0xafc7('0xf')]);}})[_0xafc7('0x10')](function(_0x583b3b){logger[_0xafc7('0xc')]('FaxApplication,\x20%s,\x20%s',_0x320ac4,_0x583b3b);_0x112a6f(_0x583b3b);});});}exports['UpdateFaxApplication']=function(_0x19a65b){var _0x5bf94c=this;return new Promise(function(_0x10a0e0,_0x14b967){return db['FaxApplication'][_0xafc7('0x11')](_0x19a65b[_0xafc7('0x12')],{'raw':_0x19a65b[_0xafc7('0x13')]?_0x19a65b[_0xafc7('0x13')][_0xafc7('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19a65b[_0xafc7('0x13')]?_0x19a65b[_0xafc7('0x13')][_0xafc7('0x15')]||null:null,'attributes':_0x19a65b[_0xafc7('0x13')]?_0x19a65b[_0xafc7('0x13')][_0xafc7('0x16')]||null:null,'limit':_0x19a65b[_0xafc7('0x13')]?_0x19a65b[_0xafc7('0x13')]['limit']||null:null})[_0xafc7('0x8')](function(_0x2681dd){logger[_0xafc7('0x9')](_0xafc7('0x17'),_0x19a65b);logger[_0xafc7('0x18')](_0xafc7('0x17'),_0x19a65b,JSON['stringify'](_0x2681dd));_0x10a0e0(_0x2681dd);})[_0xafc7('0x10')](function(_0x495eec){logger[_0xafc7('0xc')](_0xafc7('0x17'),_0x495eec[_0xafc7('0xf')],_0x19a65b);_0x14b967(_0x5bf94c['error'](0x1f4,_0x495eec[_0xafc7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 42429f0..fbe0a6b 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x88620a,_0x1bc1d5){var _0x28983a=function(_0x2fef0c){while(--_0x2fef0c){_0x88620a['push'](_0x88620a['shift']());}};_0x28983a(++_0x1bc1d5);}(_0x2032,0xd9));var _0x2203=function(_0x7fa3d2,_0x2aed73){_0x7fa3d2=_0x7fa3d2-0x0;var _0x381afc=_0x2032[_0x7fa3d2];return _0x381afc;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0x0b0e=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a5195,_0x20603e){var _0x30908e=function(_0x3c57bf){while(--_0x3c57bf){_0x4a5195['push'](_0x4a5195['shift']());}};_0x30908e(++_0x20603e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3145af,_0x53a1d5){_0x3145af=_0x3145af-0x0;var _0x37758a=_0x0b0e[_0x3145af];return _0x37758a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index fb12f24..e98e706 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 _0x9814=['STRING','out','ENUM','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9814,0x15c));var _0x4981=function(_0x39c3d1,_0x1dbc5d){_0x39c3d1=_0x39c3d1-0x0;var _0x4a543b=_0x9814[_0x39c3d1];return _0x4a543b;};'use strict';var Sequelize=require('sequelize');module[_0x4981('0x0')]={'closed':{'type':Sequelize[_0x4981('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4981('0x2')]},'secondDisposition':{'type':Sequelize[_0x4981('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4981('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x4981('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4981('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4981('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x4e9f=['DATE','ENUM','out','sequelize','BOOLEAN','STRING'];(function(_0x1a5361,_0x1cef2d){var _0x220abe=function(_0x256acf){while(--_0x256acf){_0x1a5361['push'](_0x1a5361['shift']());}};_0x220abe(++_0x1cef2d);}(_0x4e9f,0x12f));var _0xf4e9=function(_0x1bfe3a,_0x5ed939){_0x1bfe3a=_0x1bfe3a-0x0;var _0x4fdfc0=_0x4e9f[_0x1bfe3a];return _0x4fdfc0;};'use strict';var Sequelize=require(_0xf4e9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf4e9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf4e9('0x2')]},'secondDisposition':{'type':Sequelize[_0xf4e9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf4e9('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf4e9('0x3')]},'fax':{'type':Sequelize[_0xf4e9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf4e9('0x4')]('in',_0xf4e9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf4e9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf4e9('0x4')]('in',_0xf4e9('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 753dfb2..72d1e9a 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 _0x9f38=['c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','rows','show','params','includeAll','include','options','create','body','describe','addMessage','FaxMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','download','unix','join','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./faxInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','map','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','cm_contacts','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','`\x20=\x200','having','`\x20>\x200','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x9f38,0x1c7));var _0x89f3=function(_0x554306,_0x2ac2f2){_0x554306=_0x554306-0x0;var _0x38c807=_0x9f38[_0x554306];return _0x38c807;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x89f3('0x0'));var rp=require('request-promise');var moment=require(_0x89f3('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x89f3('0x2'));var util=require(_0x89f3('0x3'));var path=require(_0x89f3('0x4'));var sox=require(_0x89f3('0x5'));var csv=require(_0x89f3('0x6'));var ejs=require(_0x89f3('0x7'));var fs=require('fs');var fs_extra=require(_0x89f3('0x8'));var _=require('lodash');var squel=require(_0x89f3('0x9'));var crypto=require(_0x89f3('0xa'));var jsforce=require(_0x89f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x89f3('0x6'));var querystring=require(_0x89f3('0xc'));var Papa=require(_0x89f3('0xd'));var Redis=require(_0x89f3('0xe'));var authService=require(_0x89f3('0xf'));var qs=require(_0x89f3('0x10'));var as=require(_0x89f3('0x11'));var hardwareService=require(_0x89f3('0x12'));var logger=require(_0x89f3('0x13'))(_0x89f3('0x14'));var utils=require(_0x89f3('0x15'));var config=require(_0x89f3('0x16'));var licenseUtil=require(_0x89f3('0x17'));var db=require('../../mysqldb')['db'];config[_0x89f3('0x18')]=_['defaults'](config[_0x89f3('0x18')],{'host':_0x89f3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89f3('0x18')]));require(_0x89f3('0x1a'))[_0x89f3('0x1b')](socket);function respondWithStatusCode(_0x236668,_0x46316e){_0x46316e=_0x46316e||0xcc;return function(_0xaf31c9){if(_0xaf31c9){return _0x236668['sendStatus'](_0x46316e);}return _0x236668[_0x89f3('0x1c')](_0x46316e)[_0x89f3('0x1d')]();};}function respondWithResult(_0x42df6c,_0x39415c){_0x39415c=_0x39415c||0xc8;return function(_0xf25bd0){if(_0xf25bd0){return _0x42df6c['status'](_0x39415c)[_0x89f3('0x1e')](_0xf25bd0);}};}function respondWithFilteredResult(_0x3638de,_0x1c3746){return function(_0xe0d57){if(_0xe0d57){var _0xa14ed2=typeof _0x1c3746['offset']===_0x89f3('0x1f')&&typeof _0x1c3746[_0x89f3('0x20')]===_0x89f3('0x1f');var _0x4caccc=_0xe0d57[_0x89f3('0x21')];var _0x3fad2b=_0xa14ed2?0x0:_0x1c3746[_0x89f3('0x22')];var _0x2a3c87=_0xa14ed2?_0xe0d57[_0x89f3('0x21')]:_0x1c3746[_0x89f3('0x22')]+_0x1c3746['limit'];var _0x478759;if(_0x2a3c87>=_0x4caccc){_0x2a3c87=_0x4caccc;_0x478759=0xc8;}else{_0x478759=0xce;}_0x3638de['status'](_0x478759);return _0x3638de[_0x89f3('0x23')](_0x89f3('0x24'),_0x3fad2b+'-'+_0x2a3c87+'/'+_0x4caccc)[_0x89f3('0x1e')](_0xe0d57);}return null;};}function patchUpdates(_0x587a37){return function(_0x5d0e57){try{jsonpatch[_0x89f3('0x25')](_0x5d0e57,_0x587a37,!![]);}catch(_0x10f1bc){return BPromise['reject'](_0x10f1bc);}return _0x5d0e57[_0x89f3('0x26')]();};}function saveUpdates(_0x25ebff,_0x53407b){return function(_0x67a26a){if(_0x67a26a){return _0x67a26a[_0x89f3('0x27')](_0x25ebff)[_0x89f3('0x28')](function(_0x5f01f2){return _0x5f01f2;});}return null;};}function removeEntity(_0x5a6fbb,_0x1dff77){return function(_0x47df72){if(_0x47df72){return _0x47df72[_0x89f3('0x29')]()[_0x89f3('0x28')](function(){_0x5a6fbb[_0x89f3('0x1c')](0xcc)[_0x89f3('0x1d')]();});}};}function handleEntityNotFound(_0x351ff0,_0x55f9c9){return function(_0xa5807c){if(!_0xa5807c){_0x351ff0[_0x89f3('0x2a')](0x194);}return _0xa5807c;};}function handleError(_0x29655a,_0x32bf3f){_0x32bf3f=_0x32bf3f||0x1f4;return function(_0x3f4133){logger[_0x89f3('0x2b')](_0x3f4133['stack']);if(_0x3f4133[_0x89f3('0x2c')]){delete _0x3f4133['name'];}_0x29655a[_0x89f3('0x1c')](_0x32bf3f)[_0x89f3('0x2d')](_0x3f4133);};}function getInteractionUsers(_0x248bb4,_0x588ce9){return new BPromise(function(_0x5892df,_0x33f933){try{if(_0x588ce9[_0x248bb4['id']]){_0x248bb4['Users']=_[_0x89f3('0x2e')](_0x588ce9[_0x248bb4['id']],function(_0x52ba62){return{'id':_0x52ba62['id'],'fullname':_0x52ba62['fullname']};});}}catch(_0x3b9e18){_0x33f933(_0x3b9e18);}_0x5892df(_0x248bb4);});}function getInteractionTags(_0x1a3919,_0x5d6661){return new BPromise(function(_0x454913,_0xacbc5){try{if(_0x1a3919[_0x89f3('0x2f')]){_0x1a3919[_0x89f3('0x30')]=[];_0x1a3919['TagIds'][_0x89f3('0x31')](',')[_0x89f3('0x32')](function(_0x1061ae){_0x1a3919['Tags'][_0x89f3('0x33')](_0x5d6661[_0x1061ae]);});}delete _0x1a3919[_0x89f3('0x2f')];}catch(_0x329360){_0xacbc5(_0x329360);}_0x454913(_0x1a3919);});}function updateFaxInteraction(_0x4d6f8a,_0x4f8851,_0x2aad54){return new BPromise(function(_0x4ff3d1,_0x95d2bf){return getInteractionUsers(_0x4d6f8a,_0x2aad54)[_0x89f3('0x28')](function(_0x5a61d7){return getInteractionTags(_0x5a61d7,_0x4f8851);})[_0x89f3('0x28')](function(_0x1d6866){_0x4ff3d1(_0x1d6866);})[_0x89f3('0x34')](function(_0xc4cc38){_0x95d2bf(_0xc4cc38);});});}exports[_0x89f3('0x35')]=function(_0x2f0e38,_0x5ecf7){var _0x3dd40c={},_0x40ccf6={},_0x58a365={'count':0x0,'rows':[]};var _0xc5ce2d=_[_0x89f3('0x2e')](db[_0x89f3('0x36')][_0x89f3('0x37')],function(_0x1e29e2){return{'name':_0x1e29e2['fieldName'],'type':_0x1e29e2[_0x89f3('0x38')][_0x89f3('0x39')]};});_0x40ccf6[_0x89f3('0x3a')]=_['map'](_0xc5ce2d,_0x89f3('0x2c'));_0x40ccf6[_0x89f3('0x3b')]=_[_0x89f3('0x3c')](_0x2f0e38[_0x89f3('0x3b')]);_0x40ccf6[_0x89f3('0x3d')]=_[_0x89f3('0x3e')](_0x40ccf6[_0x89f3('0x3a')],_0x40ccf6[_0x89f3('0x3b')]);_0x3dd40c[_0x89f3('0x3f')]=_[_0x89f3('0x3e')](_0x40ccf6['model'],qs['fields'](_0x2f0e38[_0x89f3('0x3b')]['fields']));_0x3dd40c[_0x89f3('0x3f')]=_0x3dd40c[_0x89f3('0x3f')][_0x89f3('0x40')]?_0x3dd40c[_0x89f3('0x3f')]:_0x40ccf6[_0x89f3('0x3a')];if(!_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x41')](_0x89f3('0x42'))){_0x3dd40c[_0x89f3('0x20')]=qs[_0x89f3('0x20')](_0x2f0e38['query'][_0x89f3('0x20')]);_0x3dd40c[_0x89f3('0x22')]=qs['offset'](_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x22')]);}_0x3dd40c[_0x89f3('0x43')]=qs[_0x89f3('0x44')](_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x44')]);_0x3dd40c[_0x89f3('0x45')]=qs[_0x89f3('0x3d')](_[_0x89f3('0x46')](_0x2f0e38[_0x89f3('0x3b')],_0x40ccf6[_0x89f3('0x3d')]),_0xc5ce2d);var _0x5c5d3b=[];var _0x72f15e=squel[_0x89f3('0x47')]()[_0x89f3('0x48')]('id')[_0x89f3('0x48')](_0x89f3('0x2c'))[_0x89f3('0x48')](_0x89f3('0x49'))['from'](_0x89f3('0x4a'));var _0x752977=squel[_0x89f3('0x47')]()[_0x89f3('0x48')]('u.id')[_0x89f3('0x48')]('u.fullname')[_0x89f3('0x48')](_0x89f3('0x4b'))[_0x89f3('0x4c')](_0x89f3('0x4d'),'ui')[_0x89f3('0x4e')](_0x89f3('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x2ef372=squel[_0x89f3('0x47')]()['from']('fax_interactions','i')[_0x89f3('0x4e')](_0x89f3('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x89f3('0x4e')](_0x89f3('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x89f3('0x4e')](_0x89f3('0x51'),'a','a.id\x20=\x20i.FaxAccountId')[_0x89f3('0x4e')]('fax_messages','me',_0x89f3('0x52'))[_0x89f3('0x4e')]('fax_interaction_has_tags','it',_0x89f3('0x53'))[_0x89f3('0x4e')](_0x89f3('0x4a'),'t',_0x89f3('0x54'));var _0x2b1d6e=squel[_0x89f3('0x55')]();var _0x34777b=[];var _0x5c5b34=squel[_0x89f3('0x55')]();var _0x12bc77;if(_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x56')]){_0x12bc77=as[_0x89f3('0x57')](_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x56')]);var _0x280bc7=_0x12bc77['sqlOperator'];for(var _0x24d691=0x0;_0x24d691<_0x12bc77[_0x89f3('0x58')]['length'];_0x24d691++){var _0x525336=_0x12bc77[_0x89f3('0x58')][_0x24d691];var _0x41b295='i';var _0x4d86a8=_['find'](_0xc5ce2d,['name',_0x525336[_0x89f3('0x48')]]);if(!_0x4d86a8){switch(_0x525336[_0x89f3('0x48')]){case _0x89f3('0x59'):if(_0x525336['value']==0x1){_0x2ef372['having']('`'+_0x525336[_0x89f3('0x48')]+_0x89f3('0x5a'));}else{_0x2ef372[_0x89f3('0x5b')]('`'+_0x525336[_0x89f3('0x48')]+_0x89f3('0x5c'));}break;case'Contact':if(_0x525336[_0x89f3('0x5d')]===_0x89f3('0x5e')){if(_0x525336[_0x89f3('0x5f')]['split']('\x20')[_0x89f3('0x40')]>0x1){_0x2b1d6e[_0x280bc7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x89f3('0x60')](_0x525336[_0x89f3('0x5f')]),null);}else{var _0x17c4f8='%'+_0x525336['value']+'%';_0x2b1d6e[_0x280bc7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x17c4f8,_0x17c4f8,_0x17c4f8);}}else{_0x4d86a8=_[_0x89f3('0x61')](_0xc5ce2d,[_0x89f3('0x2c'),'ContactId']);_0x525336[_0x89f3('0x48')]=_0x89f3('0x62');_0x4ded09=as[_0x89f3('0x63')](_0x41b295,_0x4d86a8[_0x89f3('0x38')],_0x525336);_0x2b1d6e[_0x280bc7](_0x4ded09[_0x89f3('0x64')],_0x4ded09[_0x89f3('0x5f')]['start'],_0x4ded09[_0x89f3('0x5f')][_0x89f3('0x1d')]);}break;case _0x89f3('0x65'):var _0x2dc47f=_0x525336[_0x89f3('0x5f')][_0x89f3('0x31')](',')[_0x89f3('0x2e')](function(_0x2949cc){return Number(_0x2949cc);});_0x2dc47f['forEach'](function(_0x778c97){_0x5c5b34['or'](_0x89f3('0x66'),'%,'+_0x778c97+',%');});_0x34777b=_['union'](_0x34777b,_0x2dc47f);break;case _0x89f3('0x67'):if(_0x525336[_0x89f3('0x5d')]===_0x89f3('0x5e')){_0x2b1d6e[_0x280bc7](_0x89f3('0x68'),'%'+_0x525336[_0x89f3('0x5f')]+'%',null);}else{_0x4d86a8=_['find'](_0xc5ce2d,['name','UserId']);_0x525336[_0x89f3('0x48')]='UserId';_0x4ded09=as['buildExpression'](_0x41b295,_0x4d86a8[_0x89f3('0x38')],_0x525336);_0x2b1d6e[_0x280bc7](_0x4ded09['text'],_0x4ded09[_0x89f3('0x5f')]['start'],_0x4ded09['value'][_0x89f3('0x1d')]);}break;case'body':_0x4ded09=as[_0x89f3('0x63')]('me',null,_0x525336);_0x2b1d6e[_0x280bc7](_0x4ded09[_0x89f3('0x64')],_0x4ded09[_0x89f3('0x5f')][_0x89f3('0x69')],_0x4ded09['value'][_0x89f3('0x1d')]);break;}}else{var _0x4ded09=as[_0x89f3('0x63')](_0x41b295,_0x4d86a8[_0x89f3('0x38')],_0x525336);_0x2b1d6e[_0x280bc7](_0x4ded09[_0x89f3('0x64')],_0x4ded09[_0x89f3('0x5f')][_0x89f3('0x69')],_0x4ded09[_0x89f3('0x5f')][_0x89f3('0x1d')]);}}}else{var _0x38c56c=_(_0x2f0e38[_0x89f3('0x3b')])['keys']()[_0x89f3('0x2e')](function(_0x29a93e){return _[_0x89f3('0x6a')](_0xc5ce2d,[_0x89f3('0x2c'),_0x29a93e])?_0x29a93e:undefined;})['compact']()[_0x89f3('0x5f')]();if(!_[_0x89f3('0x6b')](_0x38c56c)){_0x38c56c[_0x89f3('0x32')](function(_0x184ae2){if(_0x184ae2===_0x89f3('0x6c')){_0x2ef372[_0x89f3('0x45')](_0x89f3('0x6d'),[][_0x89f3('0x6e')](_0x2f0e38[_0x89f3('0x3b')][_0x184ae2]));}else if(_0x184ae2===_0x89f3('0x6f')){var _0x5f0db2=JSON['parse'](_0x2f0e38[_0x89f3('0x3b')][_0x184ae2])[_0x89f3('0x70')];var _0x1c050e=JSON[_0x89f3('0x71')](_0x2f0e38[_0x89f3('0x3b')][_0x184ae2])['$lte'];_0x2ef372[_0x89f3('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f0db2,_0x1c050e);}else{if(_0x2f0e38[_0x89f3('0x3b')][_0x184ae2]==='null'){_0x2ef372[_0x89f3('0x45')]('i.'+_0x184ae2+_0x89f3('0x72'));}else{_0x2ef372['where']('i.'+_0x184ae2+_0x89f3('0x73'),_0x2f0e38[_0x89f3('0x3b')][_0x184ae2]);}}});}if(_0x2f0e38['query'][_0x89f3('0x74')]){if(_0x2f0e38['query'][_0x89f3('0x74')]==0x1){_0x2ef372[_0x89f3('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x2ef372[_0x89f3('0x5b')]('`unreadMessages`\x20>\x200');}}if(_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x75')]){_0x34777b=_['isArray'](_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x75')])?_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x75')]:new Array(_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x75')]);_0x34777b[_0x89f3('0x32')](function(_0x2ba4f5){_0x5c5b34['or'](_0x89f3('0x66'),'%,'+_0x2ba4f5+',%');});}if(_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x76')]){var _0x1648ed=_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x76')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x89f3('0x77')](_0x1648ed)){_0x2b1d6e['or'](_0x89f3('0x78'),_0x1648ed+'%')['or'](_0x89f3('0x79'),_0x1648ed+'%');}_0x2b1d6e['or'](_0x89f3('0x7a'),_0x1648ed+'%');}}_0x2ef372[_0x89f3('0x45')](_0x2b1d6e);_0x2ef372['group'](_0x89f3('0x7b'));var _0x49fdb2={'type':db[_0x89f3('0x7c')]['QueryTypes'][_0x89f3('0x7d')],'raw':!![]};var _0x3ded3e=_0x2ef372['clone']();_0x3ded3e[_0x89f3('0x48')](_0x89f3('0x7b'));_0x3ded3e[_0x89f3('0x48')](_0x89f3('0x7e'),_0x89f3('0x59'));if(_0x3dd40c[_0x89f3('0x43')]){_0x3dd40c[_0x89f3('0x43')][_0x89f3('0x32')](function(_0x57cd9e){var _0x17b856=_0x57cd9e[0x0]===_0x89f3('0x7f')?_0x57cd9e[0x0]:'i.'+_0x57cd9e[0x0];_0x2ef372[_0x89f3('0x43')](_0x17b856,_0x57cd9e[0x1]===_0x89f3('0x80')?![]:!![]);});}if(!_['isEmpty'](_0x34777b)){_0x2ef372[_0x89f3('0x5b')](_0x5c5b34);_0x3ded3e[_0x89f3('0x45')]('t.id\x20IN\x20?',_0x34777b);}BPromise['resolve']()['then'](function(){if(!_0x12bc77){if(_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x6c')])return;_0x3ded3e[_0x89f3('0x45')](_0x89f3('0x81'));_0x2ef372[_0x89f3('0x45')](_0x89f3('0x81'));return;}if(_0x2f0e38['user'][_0x89f3('0x82')]!==_0x89f3('0x83'))return;return _0x2f0e38[_0x89f3('0x84')][_0x89f3('0x85')]({'attributes':['id'],'raw':!![]})[_0x89f3('0x28')](function(_0x1f77b1){if(_[_0x89f3('0x6b')](_0x1f77b1)){_0x3ded3e[_0x89f3('0x45')](_0x89f3('0x86'));_0x2ef372[_0x89f3('0x45')](_0x89f3('0x86'));}else{_0x3ded3e[_0x89f3('0x45')](_0x89f3('0x6d'),_['map'](_0x1f77b1,'id'));_0x2ef372[_0x89f3('0x45')](_0x89f3('0x6d'),_[_0x89f3('0x2e')](_0x1f77b1,'id'));}});})[_0x89f3('0x28')](function(){if(_0x2f0e38[_0x89f3('0x84')][_0x89f3('0x82')]===_0x89f3('0x83')&&!_0x12bc77&&!_0x2f0e38[_0x89f3('0x3b')][_0x89f3('0x6c')])return[];return db[_0x89f3('0x87')][_0x89f3('0x3b')](_0x3ded3e['toString'](),_0x49fdb2);})[_0x89f3('0x28')](function(_0x2a3842){_0x58a365[_0x89f3('0x21')]=_0x2a3842[_0x89f3('0x40')];if(_0x58a365[_0x89f3('0x21')]===0x0)return[];return db[_0x89f3('0x87')][_0x89f3('0x3b')](_0x72f15e[_0x89f3('0x88')](),_0x49fdb2)[_0x89f3('0x28')](function(_0x5d859f){_0x5c5d3b=_['keyBy'](_0x5d859f,'id');_0x49fdb2=_[_0x89f3('0x89')](_0x49fdb2,{'model':db[_0x89f3('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f0e38['query'][_0x89f3('0x8a')]){_0x3dd40c[_0x89f3('0x3f')][_0x89f3('0x32')](function(_0x53cafc){_0x2ef372[_0x89f3('0x48')]('i.'+_0x53cafc);});}else{_0x2ef372[_0x89f3('0x48')](_0x89f3('0x7e'),'unreadMessages');_0x2ef372[_0x89f3('0x48')](_0x89f3('0x8b'),_0x89f3('0x8c'));_0x2ef372['field'](_0x89f3('0x8d'),_0x89f3('0x8e'));_0x2ef372[_0x89f3('0x48')](_0x89f3('0x8f'),'contactName');_0x2ef372[_0x89f3('0x48')](_0x89f3('0x90'));_0x2ef372[_0x89f3('0x48')](_0x89f3('0x91'),'Contact.firstName');_0x2ef372[_0x89f3('0x48')](_0x89f3('0x92'),_0x89f3('0x93'));_0x2ef372['field'](_0x89f3('0x94'),_0x89f3('0x95'));_0x2ef372[_0x89f3('0x48')]('c.phone',_0x89f3('0x96'));_0x2ef372[_0x89f3('0x48')](_0x89f3('0x97'),'Contact.mobile');_0x2ef372[_0x89f3('0x48')](_0x89f3('0x98'),_0x89f3('0x99'));_0x2ef372[_0x89f3('0x48')]('o.fullname',_0x89f3('0x9a'));_0x2ef372[_0x89f3('0x48')](_0x89f3('0x9b'),_0x89f3('0x9c'));_0x2ef372[_0x89f3('0x48')](_0x89f3('0x9d'),_0x89f3('0x2f'));}if(_0x3dd40c[_0x89f3('0x20')])_0x2ef372[_0x89f3('0x20')](_0x3dd40c[_0x89f3('0x20')]);if(_0x3dd40c[_0x89f3('0x22')])_0x2ef372[_0x89f3('0x22')](_0x3dd40c['offset']);return db[_0x89f3('0x87')][_0x89f3('0x3b')](_0x2ef372[_0x89f3('0x88')](),_0x49fdb2);})[_0x89f3('0x28')](function(_0x27eb24){if(_0x27eb24['length']>0x0)_0x752977[_0x89f3('0x45')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x27eb24,'id'));return db[_0x89f3('0x87')][_0x89f3('0x3b')](_0x752977[_0x89f3('0x88')](),_0x49fdb2)['then'](function(_0x5c10f2){var _0x28ff8d=_[_0x89f3('0x9e')](_0x5c10f2,_0x89f3('0x9f'));var _0x56e6e5=[];_0x27eb24[_0x89f3('0x32')](function(_0x29402b){_0x56e6e5[_0x89f3('0x33')](updateFaxInteraction(_0x29402b,_0x5c5d3b,_0x28ff8d));});return BPromise['all'](_0x56e6e5);});});})[_0x89f3('0x28')](function(_0x3df3e4){_0x58a365[_0x89f3('0xa0')]=_0x3df3e4;return _0x58a365;})[_0x89f3('0x28')](respondWithFilteredResult(_0x5ecf7,_0x3dd40c))[_0x89f3('0x34')](handleError(_0x5ecf7,null));};exports[_0x89f3('0xa1')]=function(_0x1b1823,_0xb226c6){var _0x230bc8={'raw':![],'where':{'id':_0x1b1823[_0x89f3('0xa2')]['id']}},_0x5009fa={};_0x5009fa[_0x89f3('0x3a')]=_[_0x89f3('0x3c')](db[_0x89f3('0x36')]['rawAttributes']);_0x5009fa[_0x89f3('0x3b')]=_[_0x89f3('0x3c')](_0x1b1823[_0x89f3('0x3b')]);_0x5009fa[_0x89f3('0x3d')]=_[_0x89f3('0x3e')](_0x5009fa[_0x89f3('0x3a')],_0x5009fa[_0x89f3('0x3b')]);_0x230bc8[_0x89f3('0x3f')]=_[_0x89f3('0x3e')](_0x5009fa[_0x89f3('0x3a')],qs[_0x89f3('0x8a')](_0x1b1823[_0x89f3('0x3b')][_0x89f3('0x8a')]));_0x230bc8[_0x89f3('0x3f')]=_0x230bc8['attributes'][_0x89f3('0x40')]?_0x230bc8['attributes']:_0x5009fa[_0x89f3('0x3a')];if(_0x1b1823[_0x89f3('0x3b')][_0x89f3('0xa3')]){_0x230bc8[_0x89f3('0xa4')]=[{'all':!![]}];}_0x230bc8=_[_0x89f3('0x89')]({},_0x230bc8,_0x1b1823[_0x89f3('0xa5')]);return db[_0x89f3('0x36')]['find'](_0x230bc8)['then'](handleEntityNotFound(_0xb226c6,null))[_0x89f3('0x28')](respondWithResult(_0xb226c6,null))['catch'](handleError(_0xb226c6,null));};exports['create']=function(_0xd0da9c,_0x2c6a5c){return db[_0x89f3('0x36')][_0x89f3('0xa6')](_0xd0da9c[_0x89f3('0xa7')],{})['then'](respondWithResult(_0x2c6a5c,0xc9))[_0x89f3('0x34')](handleError(_0x2c6a5c,null));};exports[_0x89f3('0x27')]=function(_0x583dce,_0x1d2394){if(_0x583dce['body']['id']){delete _0x583dce['body']['id'];}return db[_0x89f3('0x36')]['find']({'where':{'id':_0x583dce[_0x89f3('0xa2')]['id']}})[_0x89f3('0x28')](handleEntityNotFound(_0x1d2394,null))[_0x89f3('0x28')](saveUpdates(_0x583dce[_0x89f3('0xa7')],null))['then'](respondWithResult(_0x1d2394,null))['catch'](handleError(_0x1d2394,null));};exports[_0x89f3('0x29')]=function(_0x214f7a,_0x769928){return db[_0x89f3('0x36')][_0x89f3('0x61')]({'where':{'id':_0x214f7a[_0x89f3('0xa2')]['id']}})[_0x89f3('0x28')](handleEntityNotFound(_0x769928,null))[_0x89f3('0x28')](removeEntity(_0x769928,null))['catch'](handleError(_0x769928,null));};exports['describe']=function(_0x43bba8,_0x59109e){return db[_0x89f3('0x36')][_0x89f3('0xa8')]()[_0x89f3('0x28')](respondWithResult(_0x59109e,null))[_0x89f3('0x34')](handleError(_0x59109e,null));};exports[_0x89f3('0xa9')]=function(_0x3060aa,_0x5d740e,_0x59a246){return db[_0x89f3('0xaa')][_0x89f3('0x61')]({'where':{'id':_0x3060aa[_0x89f3('0xa2')]['id']}})[_0x89f3('0x28')](handleEntityNotFound(_0x5d740e,null))[_0x89f3('0x28')](function(_0x504d30){if(_0x504d30){return _0x504d30[_0x89f3('0xa9')](_0x3060aa[_0x89f3('0xa7')][_0x89f3('0xab')],_['omit'](_0x3060aa[_0x89f3('0xa7')],[_0x89f3('0xab'),'id'])||{});}})[_0x89f3('0x28')](respondWithResult(_0x5d740e,null))[_0x89f3('0x34')](handleError(_0x5d740e,null));};exports[_0x89f3('0xac')]=function(_0x2a9f84,_0x520951,_0x5c51a7){var _0xf2a48={'raw':![],'where':{}};var _0x2ab25f={};var _0xf83d6f={'count':0x0,'rows':[]};return db[_0x89f3('0x36')]['findOne']({'where':{'id':_0x2a9f84[_0x89f3('0xa2')]['id']}})[_0x89f3('0x28')](handleEntityNotFound(_0x520951,null))['then'](function(_0x10e329){if(_0x10e329){_0x2ab25f[_0x89f3('0x3a')]=_[_0x89f3('0x3c')](db[_0x89f3('0xaa')]['rawAttributes']);_0x2ab25f[_0x89f3('0x3b')]=_['keys'](_0x2a9f84[_0x89f3('0x3b')]);_0x2ab25f[_0x89f3('0x3d')]=_['intersection'](_0x2ab25f[_0x89f3('0x3a')],_0x2ab25f[_0x89f3('0x3b')]);_0xf2a48[_0x89f3('0x3f')]=_['intersection'](_0x2ab25f['model'],qs[_0x89f3('0x8a')](_0x2a9f84['query'][_0x89f3('0x8a')]));_0xf2a48[_0x89f3('0x3f')]=_0xf2a48[_0x89f3('0x3f')]['length']?_0xf2a48[_0x89f3('0x3f')]:_0x2ab25f['model'];if(!_0x2a9f84[_0x89f3('0x3b')][_0x89f3('0x41')](_0x89f3('0x42'))){_0xf2a48['limit']=qs[_0x89f3('0x20')](_0x2a9f84[_0x89f3('0x3b')][_0x89f3('0x20')]);_0xf2a48[_0x89f3('0x22')]=qs[_0x89f3('0x22')](_0x2a9f84[_0x89f3('0x3b')]['offset']);}_0xf2a48[_0x89f3('0x43')]=qs[_0x89f3('0x44')](_0x2a9f84[_0x89f3('0x3b')][_0x89f3('0x44')]);_0xf2a48['where']=qs['filters'](_[_0x89f3('0x46')](_0x2a9f84[_0x89f3('0x3b')],_0x2ab25f['filters']));_0xf2a48[_0x89f3('0x45')]['FaxInteractionId']=_0x10e329['id'];if(_0x2a9f84['query'][_0x89f3('0x76')]){_0xf2a48[_0x89f3('0x45')]=_[_0x89f3('0x89')](_0xf2a48[_0x89f3('0x45')],{'$or':_[_0x89f3('0x2e')](_0xf2a48[_0x89f3('0x3f')],function(_0x191a05){var _0x499504={};_0x499504[_0x191a05]={'$like':'%'+_0x2a9f84[_0x89f3('0x3b')]['filter']+'%'};return _0x499504;})});}if(_0x2a9f84['query'][_0x89f3('0x70')]){var _0x22eccc=_0x2a9f84[_0x89f3('0x3b')][_0x89f3('0x70')][_0x89f3('0x31')](',');var _0x490757={};_0x490757[_0x22eccc[0x0]]={'$gte':moment(_0x22eccc[0x1])[_0x89f3('0xad')](_0x89f3('0xae'))};_0xf2a48[_0x89f3('0x45')]=_[_0x89f3('0x89')](_0xf2a48[_0x89f3('0x45')],_0x490757);}_0xf2a48=_[_0x89f3('0x89')]({},_0xf2a48,_0x2a9f84[_0x89f3('0xa5')]);return db[_0x89f3('0xaa')][_0x89f3('0x21')]({'where':_0xf2a48[_0x89f3('0x45')]})[_0x89f3('0x28')](function(_0x4ded56){_0xf83d6f[_0x89f3('0x21')]=_0x4ded56;if(_0x2a9f84['query'][_0x89f3('0xa3')]){_0xf2a48['include']=[{'all':!![]}];}return db[_0x89f3('0xaa')]['findAll'](_0xf2a48);})[_0x89f3('0x28')](function(_0xd9d686){_0xf83d6f[_0x89f3('0xa0')]=_0xd9d686;return _0xf83d6f;});}})[_0x89f3('0x28')](respondWithFilteredResult(_0x520951,_0xf2a48))['catch'](handleError(_0x520951,null));};exports[_0x89f3('0xaf')]=function(_0x31a0d4,_0x281ab3,_0x573240){return db[_0x89f3('0x36')][_0x89f3('0x61')]({'where':{'id':_0x31a0d4[_0x89f3('0xa2')]['id']}})[_0x89f3('0x28')](handleEntityNotFound(_0x281ab3,null))[_0x89f3('0x28')](function(_0x4cdf2d){if(_0x4cdf2d){return _0x4cdf2d[_0x89f3('0xb0')](_0x31a0d4[_0x89f3('0xa7')][_0x89f3('0xab')],_['omit'](_0x31a0d4[_0x89f3('0xa7')],[_0x89f3('0xab'),'id'])||{})[_0x89f3('0xb1')](function(){return db[_0x89f3('0x65')][_0x89f3('0xb2')]({'attributes':['id',_0x89f3('0x2c'),_0x89f3('0x49')],'where':{'id':_0x31a0d4[_0x89f3('0xa7')][_0x89f3('0xab')]}});})[_0x89f3('0x28')](function(_0x53ba90){socket[_0x89f3('0xb3')](_0x89f3('0xb4'),{'id':Number(_0x31a0d4[_0x89f3('0xa2')]['id']),'tags':_0x53ba90||[]});return{'id':Number(_0x31a0d4[_0x89f3('0xa2')]['id']),'tags':_0x53ba90||[]};});}})[_0x89f3('0x28')](respondWithResult(_0x281ab3,null))[_0x89f3('0x34')](handleError(_0x281ab3,null));};exports[_0x89f3('0xb5')]=function(_0xec2f44,_0x1f965a,_0x177fad){return db[_0x89f3('0x36')][_0x89f3('0x61')]({'where':{'id':_0xec2f44[_0x89f3('0xa2')]['id']}})['then'](handleEntityNotFound(_0x1f965a,null))[_0x89f3('0x28')](function(_0x4b6a5c){if(_0x4b6a5c){return _0x4b6a5c[_0x89f3('0xb5')](_0xec2f44[_0x89f3('0x3b')]['ids']);}})[_0x89f3('0x28')](respondWithStatusCode(_0x1f965a,null))[_0x89f3('0x34')](handleError(_0x1f965a,null));};exports[_0x89f3('0xb6')]=function(_0x33c8a5,_0x5f71ae){var _0x3a4717=moment()[_0x89f3('0xb7')]()['toString']();var _0xcdc9d3=path[_0x89f3('0xb8')](config['root'],'server',_0x89f3('0xb9'),_0x89f3('0xba'));var _0x4cc62b=path[_0x89f3('0xb8')](config[_0x89f3('0xbb')],'server',_0x89f3('0xb9'),_0x89f3('0xbc'));var _0x2f2c10=path[_0x89f3('0xb8')](_0xcdc9d3,_0x3a4717);var _0x422d48=util[_0x89f3('0xad')](_0x89f3('0xbd'),_0x33c8a5[_0x89f3('0xa2')]['id'],_0x3a4717);var _0x13620e=path[_0x89f3('0xb8')](_0xcdc9d3,_0x422d48);var _0x57fded=[];_0x57fded[_0x89f3('0x33')]({'model':db[_0x89f3('0xbe')],'as':_0x89f3('0xbe'),'raw':!![]});var _0x44fdd1=[{'model':db[_0x89f3('0xaa')],'as':'Messages','attributes':['id',_0x89f3('0xa7'),_0x89f3('0x6f')],'include':_0x57fded}];return db['FaxInteraction'][_0x89f3('0x61')]({'where':{'id':_0x33c8a5['params']['id']},'include':_0x44fdd1})[_0x89f3('0x28')](handleEntityNotFound(_0x5f71ae,null))[_0x89f3('0x28')](function(_0x45d1fd){if(_0x45d1fd&&_0x45d1fd[_0x89f3('0xbf')]){var _0x2d65b5=_0x45d1fd[_0x89f3('0xc0')]({'plain':!![]});fs[_0x89f3('0xc1')](_0x2f2c10);for(var _0x22fd1b=0x0;_0x22fd1b<_0x2d65b5['Messages'][_0x89f3('0x40')];_0x22fd1b++){var _0x3a1afd=_0x2d65b5[_0x89f3('0xbf')][_0x22fd1b][_0x89f3('0xbe')];if(_0x3a1afd){var _0x542e7a=path[_0x89f3('0xb8')](_0x4cc62b,_0x3a1afd[_0x89f3('0xc2')]);if(fs['existsSync'](_0x542e7a)){fs[_0x89f3('0xc3')](_0x542e7a)[_0x89f3('0xc4')](fs[_0x89f3('0xc5')](path[_0x89f3('0xb8')](_0x2f2c10,_0x3a1afd[_0x89f3('0xc2')])));}}}return BPromise[_0x89f3('0xc6')]()['then'](function(){return new BPromise(function(_0x93f3e7,_0x5bcdac){zipdir(_0x2f2c10,{'saveTo':_0x13620e},function(_0x296790,_0xda3593){if(_0x296790)return _0x5bcdac(_0x296790);return _0x93f3e7(_0xda3593);});})[_0x89f3('0x28')](function(){return new BPromise(function(_0x2cedf1,_0x592b1d){rimraf(_0x2f2c10,function(_0x57ed74){if(_0x57ed74)_0x592b1d(_0x57ed74);return _0x2cedf1();});});})[_0x89f3('0x28')](function(){return _0x5f71ae[_0x89f3('0xb6')](_0x13620e,_0x422d48,function(_0x1b1ff6){if(_0x1b1ff6){console[_0x89f3('0xc7')](_0x89f3('0xc8'),_0x1b1ff6);}else{fs[_0x89f3('0xc9')](_0x13620e);}});});});}else{return _0x5f71ae[_0x89f3('0x2a')](0xc8);}})[_0x89f3('0x34')](handleError(_0x5f71ae,null));}; \ No newline at end of file +var _0x2217=['toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','FaxInteractionId','all','params','includeAll','options','create','catch','body','destroy','describe','addMessage','FaxMessage','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','ids','spread','removeTags','download','unix','join','root','server','tmp','files','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','json','undefined','count','limit','set','reject','save','update','then','end','error','name','send','Tags','TagIds','split','forEach','push','index','map','FaxInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','select','field','color','from','u.id','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','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','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IN\x20?','sequelize'];(function(_0x22f419,_0x72d43a){var _0x30864b=function(_0xfdb552){while(--_0xfdb552){_0x22f419['push'](_0x22f419['shift']());}};_0x30864b(++_0x72d43a);}(_0x2217,0x115));var _0x7221=function(_0x1e153d,_0x2a69e4){_0x1e153d=_0x1e153d-0x0;var _0x20773a=_0x2217[_0x1e153d];return _0x20773a;};'use strict';var emlformat=require(_0x7221('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7221('0x1'));var jsonpatch=require(_0x7221('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7221('0x3'));var Mustache=require('mustache');var util=require(_0x7221('0x4'));var path=require(_0x7221('0x5'));var sox=require('sox');var csv=require(_0x7221('0x6'));var ejs=require(_0x7221('0x7'));var fs=require('fs');var fs_extra=require(_0x7221('0x8'));var _=require('lodash');var squel=require(_0x7221('0x9'));var crypto=require(_0x7221('0xa'));var jsforce=require(_0x7221('0xb'));var deskjs=require(_0x7221('0xc'));var toCsv=require(_0x7221('0x6'));var querystring=require(_0x7221('0xd'));var Papa=require(_0x7221('0xe'));var Redis=require(_0x7221('0xf'));var authService=require(_0x7221('0x10'));var qs=require(_0x7221('0x11'));var as=require(_0x7221('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7221('0x13'))(_0x7221('0x14'));var utils=require('../../config/utils');var config=require(_0x7221('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7221('0x16'))['db'];config[_0x7221('0x17')]=_[_0x7221('0x18')](config[_0x7221('0x17')],{'host':_0x7221('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7221('0x1a'))['register'](socket);function respondWithStatusCode(_0x10adf6,_0x8be609){_0x8be609=_0x8be609||0xcc;return function(_0x27d2b1){if(_0x27d2b1){return _0x10adf6[_0x7221('0x1b')](_0x8be609);}return _0x10adf6['status'](_0x8be609)['end']();};}function respondWithResult(_0x58894d,_0xd63407){_0xd63407=_0xd63407||0xc8;return function(_0x50dd80){if(_0x50dd80){return _0x58894d[_0x7221('0x1c')](_0xd63407)[_0x7221('0x1d')](_0x50dd80);}};}function respondWithFilteredResult(_0x2f8fd7,_0xaead0c){return function(_0x1230f9){if(_0x1230f9){var _0x337d9e=typeof _0xaead0c['offset']==='undefined'&&typeof _0xaead0c['limit']===_0x7221('0x1e');var _0x464934=_0x1230f9[_0x7221('0x1f')];var _0x331a4c=_0x337d9e?0x0:_0xaead0c['offset'];var _0x47c662=_0x337d9e?_0x1230f9[_0x7221('0x1f')]:_0xaead0c['offset']+_0xaead0c[_0x7221('0x20')];var _0x46a9ac;if(_0x47c662>=_0x464934){_0x47c662=_0x464934;_0x46a9ac=0xc8;}else{_0x46a9ac=0xce;}_0x2f8fd7[_0x7221('0x1c')](_0x46a9ac);return _0x2f8fd7[_0x7221('0x21')]('Content-Range',_0x331a4c+'-'+_0x47c662+'/'+_0x464934)[_0x7221('0x1d')](_0x1230f9);}return null;};}function patchUpdates(_0x1f5ba2){return function(_0x2d34de){try{jsonpatch['apply'](_0x2d34de,_0x1f5ba2,!![]);}catch(_0x42fe6c){return BPromise[_0x7221('0x22')](_0x42fe6c);}return _0x2d34de[_0x7221('0x23')]();};}function saveUpdates(_0x5be2ec,_0x29821e){return function(_0x1cb859){if(_0x1cb859){return _0x1cb859[_0x7221('0x24')](_0x5be2ec)['then'](function(_0x2b1d11){return _0x2b1d11;});}return null;};}function removeEntity(_0x2e0c63,_0x34c14c){return function(_0x375c3d){if(_0x375c3d){return _0x375c3d['destroy']()[_0x7221('0x25')](function(){_0x2e0c63[_0x7221('0x1c')](0xcc)[_0x7221('0x26')]();});}};}function handleEntityNotFound(_0x3d197e,_0x1b3f1e){return function(_0x5c50a8){if(!_0x5c50a8){_0x3d197e[_0x7221('0x1b')](0x194);}return _0x5c50a8;};}function handleError(_0x34137a,_0x566b07){_0x566b07=_0x566b07||0x1f4;return function(_0x4c480e){logger[_0x7221('0x27')](_0x4c480e['stack']);if(_0x4c480e[_0x7221('0x28')]){delete _0x4c480e[_0x7221('0x28')];}_0x34137a[_0x7221('0x1c')](_0x566b07)[_0x7221('0x29')](_0x4c480e);};}function getInteractionUsers(_0xf6df69,_0x54f722){return new BPromise(function(_0x2823bf,_0x381eb5){try{if(_0x54f722[_0xf6df69['id']]){_0xf6df69['Users']=_['map'](_0x54f722[_0xf6df69['id']],function(_0x2d3074){return{'id':_0x2d3074['id'],'fullname':_0x2d3074['fullname']};});}}catch(_0x5f5df6){_0x381eb5(_0x5f5df6);}_0x2823bf(_0xf6df69);});}function getInteractionTags(_0x24f3f8,_0x3d703b){return new BPromise(function(_0x5e44c4,_0x15dc2a){try{if(_0x24f3f8['TagIds']){_0x24f3f8[_0x7221('0x2a')]=[];_0x24f3f8[_0x7221('0x2b')][_0x7221('0x2c')](',')[_0x7221('0x2d')](function(_0x4247e2){_0x24f3f8[_0x7221('0x2a')][_0x7221('0x2e')](_0x3d703b[_0x4247e2]);});}delete _0x24f3f8[_0x7221('0x2b')];}catch(_0x14ead1){_0x15dc2a(_0x14ead1);}_0x5e44c4(_0x24f3f8);});}function updateFaxInteraction(_0x414fe9,_0x1ee574,_0xa52cb){return new BPromise(function(_0x52dce1,_0x4226f5){return getInteractionUsers(_0x414fe9,_0xa52cb)[_0x7221('0x25')](function(_0x19cb10){return getInteractionTags(_0x19cb10,_0x1ee574);})['then'](function(_0x51394e){_0x52dce1(_0x51394e);})['catch'](function(_0x3241de){_0x4226f5(_0x3241de);});});}exports[_0x7221('0x2f')]=function(_0x4bc6d1,_0x2818ce){var _0x456a95={},_0x26167e={},_0x3153fc={'count':0x0,'rows':[]};var _0x20cfc9=_[_0x7221('0x30')](db[_0x7221('0x31')][_0x7221('0x32')],function(_0x477eb1){return{'name':_0x477eb1[_0x7221('0x33')],'type':_0x477eb1[_0x7221('0x34')][_0x7221('0x35')]};});_0x26167e[_0x7221('0x36')]=_[_0x7221('0x30')](_0x20cfc9,_0x7221('0x28'));_0x26167e['query']=_[_0x7221('0x37')](_0x4bc6d1[_0x7221('0x38')]);_0x26167e[_0x7221('0x39')]=_['intersection'](_0x26167e['model'],_0x26167e[_0x7221('0x38')]);_0x456a95[_0x7221('0x3a')]=_[_0x7221('0x3b')](_0x26167e[_0x7221('0x36')],qs[_0x7221('0x3c')](_0x4bc6d1[_0x7221('0x38')][_0x7221('0x3c')]));_0x456a95[_0x7221('0x3a')]=_0x456a95[_0x7221('0x3a')][_0x7221('0x3d')]?_0x456a95[_0x7221('0x3a')]:_0x26167e[_0x7221('0x36')];if(!_0x4bc6d1[_0x7221('0x38')][_0x7221('0x3e')](_0x7221('0x3f'))){_0x456a95[_0x7221('0x20')]=qs[_0x7221('0x20')](_0x4bc6d1[_0x7221('0x38')][_0x7221('0x20')]);_0x456a95[_0x7221('0x40')]=qs[_0x7221('0x40')](_0x4bc6d1[_0x7221('0x38')][_0x7221('0x40')]);}_0x456a95['order']=qs[_0x7221('0x41')](_0x4bc6d1[_0x7221('0x38')][_0x7221('0x41')]);_0x456a95[_0x7221('0x42')]=qs[_0x7221('0x39')](_[_0x7221('0x43')](_0x4bc6d1[_0x7221('0x38')],_0x26167e[_0x7221('0x39')]),_0x20cfc9);var _0x40291c=[];var _0x29300d=squel[_0x7221('0x44')]()[_0x7221('0x45')]('id')[_0x7221('0x45')]('name')['field'](_0x7221('0x46'))[_0x7221('0x47')]('tools_tags');var _0x37b508=squel[_0x7221('0x44')]()[_0x7221('0x45')](_0x7221('0x48'))[_0x7221('0x45')]('u.fullname')['field'](_0x7221('0x49'))['from'](_0x7221('0x4a'),'ui')['left_join'](_0x7221('0x4b'),'u',_0x7221('0x4c'));var _0xf967a2=squel[_0x7221('0x44')]()[_0x7221('0x47')](_0x7221('0x4d'),'i')[_0x7221('0x4e')]('cm_contacts','c',_0x7221('0x4f'))[_0x7221('0x4e')](_0x7221('0x4b'),'o',_0x7221('0x50'))[_0x7221('0x4e')]('fax_accounts','a',_0x7221('0x51'))[_0x7221('0x4e')](_0x7221('0x52'),'me',_0x7221('0x53'))['left_join'](_0x7221('0x54'),'it',_0x7221('0x55'))[_0x7221('0x4e')]('tools_tags','t',_0x7221('0x56'));var _0x2290bb=squel[_0x7221('0x57')]();var _0x383ca3=[];var _0x1df45e=squel[_0x7221('0x57')]();var _0xd4856a;if(_0x4bc6d1[_0x7221('0x38')][_0x7221('0x58')]){_0xd4856a=as['parseSearch'](_0x4bc6d1['query'][_0x7221('0x58')]);var _0x13aa1d=_0xd4856a[_0x7221('0x59')];for(var _0x106d76=0x0;_0x106d76<_0xd4856a[_0x7221('0x5a')][_0x7221('0x3d')];_0x106d76++){var _0x47f00d=_0xd4856a['conditions'][_0x106d76];var _0x236e00='i';var _0x2f6efe=_[_0x7221('0x5b')](_0x20cfc9,[_0x7221('0x28'),_0x47f00d['field']]);if(!_0x2f6efe){switch(_0x47f00d[_0x7221('0x45')]){case _0x7221('0x5c'):if(_0x47f00d[_0x7221('0x5d')]==0x1){_0xf967a2[_0x7221('0x5e')]('`'+_0x47f00d[_0x7221('0x45')]+_0x7221('0x5f'));}else{_0xf967a2['having']('`'+_0x47f00d[_0x7221('0x45')]+_0x7221('0x60'));}break;case _0x7221('0x61'):if(_0x47f00d[_0x7221('0x62')]===_0x7221('0x63')){if(_0x47f00d[_0x7221('0x5d')][_0x7221('0x2c')]('\x20')[_0x7221('0x3d')]>0x1){_0x2290bb[_0x13aa1d](_0x7221('0x64'),qs[_0x7221('0x65')](_0x47f00d[_0x7221('0x5d')]),null);}else{var _0x112c0b='%'+_0x47f00d[_0x7221('0x5d')]+'%';_0x2290bb[_0x13aa1d](_0x7221('0x66'),_0x112c0b,_0x112c0b,_0x112c0b);}}else{_0x2f6efe=_[_0x7221('0x5b')](_0x20cfc9,[_0x7221('0x28'),_0x7221('0x67')]);_0x47f00d[_0x7221('0x45')]=_0x7221('0x67');_0x7412a4=as[_0x7221('0x68')](_0x236e00,_0x2f6efe[_0x7221('0x34')],_0x47f00d);_0x2290bb[_0x13aa1d](_0x7412a4[_0x7221('0x69')],_0x7412a4[_0x7221('0x5d')][_0x7221('0x6a')],_0x7412a4[_0x7221('0x5d')][_0x7221('0x26')]);}break;case _0x7221('0x6b'):var _0x2403d0=_0x47f00d[_0x7221('0x5d')]['split'](',')['map'](function(_0x58e20c){return Number(_0x58e20c);});_0x2403d0['forEach'](function(_0x17afaa){_0x1df45e['or'](_0x7221('0x6c'),'%,'+_0x17afaa+',%');});_0x383ca3=_[_0x7221('0x6d')](_0x383ca3,_0x2403d0);break;case _0x7221('0x6e'):if(_0x47f00d[_0x7221('0x62')]===_0x7221('0x63')){_0x2290bb[_0x13aa1d](_0x7221('0x6f'),'%'+_0x47f00d[_0x7221('0x5d')]+'%',null);}else{_0x2f6efe=_[_0x7221('0x5b')](_0x20cfc9,[_0x7221('0x28'),_0x7221('0x70')]);_0x47f00d['field']='UserId';_0x7412a4=as[_0x7221('0x68')](_0x236e00,_0x2f6efe[_0x7221('0x34')],_0x47f00d);_0x2290bb[_0x13aa1d](_0x7412a4[_0x7221('0x69')],_0x7412a4[_0x7221('0x5d')][_0x7221('0x6a')],_0x7412a4[_0x7221('0x5d')][_0x7221('0x26')]);}break;case'body':_0x7412a4=as[_0x7221('0x68')]('me',null,_0x47f00d);_0x2290bb[_0x13aa1d](_0x7412a4[_0x7221('0x69')],_0x7412a4['value'][_0x7221('0x6a')],_0x7412a4[_0x7221('0x5d')][_0x7221('0x26')]);break;}}else{var _0x7412a4=as[_0x7221('0x68')](_0x236e00,_0x2f6efe[_0x7221('0x34')],_0x47f00d);_0x2290bb[_0x13aa1d](_0x7412a4['text'],_0x7412a4[_0x7221('0x5d')]['start'],_0x7412a4[_0x7221('0x5d')]['end']);}}}else{var _0x48ce56=_(_0x4bc6d1[_0x7221('0x38')])[_0x7221('0x37')]()[_0x7221('0x30')](function(_0x1484aa){return _['some'](_0x20cfc9,[_0x7221('0x28'),_0x1484aa])?_0x1484aa:undefined;})[_0x7221('0x71')]()[_0x7221('0x5d')]();if(!_[_0x7221('0x72')](_0x48ce56)){_0x48ce56[_0x7221('0x2d')](function(_0x403b2f){if(_0x403b2f==='FaxAccountId'){_0xf967a2[_0x7221('0x42')]('i.FaxAccountId\x20IN\x20?',[][_0x7221('0x73')](_0x4bc6d1[_0x7221('0x38')][_0x403b2f]));}else if(_0x403b2f===_0x7221('0x74')){var _0x5a9d00=JSON[_0x7221('0x75')](_0x4bc6d1[_0x7221('0x38')][_0x403b2f])[_0x7221('0x76')];var _0x9593ed=JSON[_0x7221('0x75')](_0x4bc6d1[_0x7221('0x38')][_0x403b2f])[_0x7221('0x77')];_0xf967a2[_0x7221('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a9d00,_0x9593ed);}else{if(_0x4bc6d1[_0x7221('0x38')][_0x403b2f]===_0x7221('0x78')){_0xf967a2[_0x7221('0x42')]('i.'+_0x403b2f+_0x7221('0x79'));}else{_0xf967a2[_0x7221('0x42')]('i.'+_0x403b2f+_0x7221('0x7a'),_0x4bc6d1[_0x7221('0x38')][_0x403b2f]);}}});}if(_0x4bc6d1['query']['read']){if(_0x4bc6d1[_0x7221('0x38')][_0x7221('0x7b')]==0x1){_0xf967a2['having'](_0x7221('0x7c'));}else{_0xf967a2[_0x7221('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x4bc6d1[_0x7221('0x38')]['tag']){_0x383ca3=_[_0x7221('0x7d')](_0x4bc6d1[_0x7221('0x38')][_0x7221('0x7e')])?_0x4bc6d1[_0x7221('0x38')][_0x7221('0x7e')]:new Array(_0x4bc6d1[_0x7221('0x38')][_0x7221('0x7e')]);_0x383ca3['forEach'](function(_0x3cf66a){_0x1df45e['or'](_0x7221('0x6c'),'%,'+_0x3cf66a+',%');});}if(_0x4bc6d1['query']['filter']){var _0x3bd508=_0x4bc6d1[_0x7221('0x38')][_0x7221('0x7f')][_0x7221('0x80')]('\x5c','\x5c\x5c')[_0x7221('0x80')](/'/g,'\x27\x27');if(qs[_0x7221('0x81')](_0x3bd508)){_0x2290bb['or'](_0x7221('0x82'),_0x3bd508+'%')['or']('i.fax\x20LIKE\x20?',_0x3bd508+'%');}_0x2290bb['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3bd508+'%');}}_0xf967a2[_0x7221('0x42')](_0x2290bb);_0xf967a2['group'](_0x7221('0x83'));var _0x5b0923={'type':db[_0x7221('0x84')][_0x7221('0x85')][_0x7221('0x86')],'raw':!![]};var _0x1d48f5=_0xf967a2['clone']();_0x1d48f5[_0x7221('0x45')](_0x7221('0x83'));_0x1d48f5['field'](_0x7221('0x87'),_0x7221('0x5c'));if(_0x456a95[_0x7221('0x88')]){_0x456a95[_0x7221('0x88')][_0x7221('0x2d')](function(_0x532fbe){var _0x37f292=_0x532fbe[0x0]===_0x7221('0x89')?_0x532fbe[0x0]:'i.'+_0x532fbe[0x0];_0xf967a2[_0x7221('0x88')](_0x37f292,_0x532fbe[0x1]===_0x7221('0x8a')?![]:!![]);});}if(!_[_0x7221('0x72')](_0x383ca3)){_0xf967a2['having'](_0x1df45e);_0x1d48f5['where'](_0x7221('0x8b'),_0x383ca3);}BPromise[_0x7221('0x8c')]()[_0x7221('0x25')](function(){if(!_0xd4856a){if(_0x4bc6d1[_0x7221('0x38')][_0x7221('0x8d')])return;_0x1d48f5[_0x7221('0x42')](_0x7221('0x8e'));_0xf967a2[_0x7221('0x42')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4bc6d1[_0x7221('0x8f')][_0x7221('0x90')]!==_0x7221('0x91'))return;return _0x4bc6d1['user'][_0x7221('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36f951){if(_[_0x7221('0x72')](_0x36f951)){_0x1d48f5[_0x7221('0x42')]('i.FaxAccountId\x20IS\x20NULL');_0xf967a2[_0x7221('0x42')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x1d48f5['where'](_0x7221('0x93'),_[_0x7221('0x30')](_0x36f951,'id'));_0xf967a2[_0x7221('0x42')](_0x7221('0x93'),_['map'](_0x36f951,'id'));}});})[_0x7221('0x25')](function(){if(_0x4bc6d1[_0x7221('0x8f')][_0x7221('0x90')]===_0x7221('0x91')&&!_0xd4856a&&!_0x4bc6d1[_0x7221('0x38')][_0x7221('0x8d')])return[];return db[_0x7221('0x94')][_0x7221('0x38')](_0x1d48f5[_0x7221('0x95')](),_0x5b0923);})[_0x7221('0x25')](function(_0x27a4b1){_0x3153fc[_0x7221('0x1f')]=_0x27a4b1[_0x7221('0x3d')];if(_0x3153fc['count']===0x0)return[];return db[_0x7221('0x94')][_0x7221('0x38')](_0x29300d[_0x7221('0x95')](),_0x5b0923)['then'](function(_0x580c85){_0x40291c=_[_0x7221('0x96')](_0x580c85,'id');_0x5b0923=_[_0x7221('0x97')](_0x5b0923,{'model':db[_0x7221('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bc6d1[_0x7221('0x38')][_0x7221('0x3c')]){_0x456a95['attributes']['forEach'](function(_0x3b09d5){_0xf967a2[_0x7221('0x45')]('i.'+_0x3b09d5);});}else{_0xf967a2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7221('0x5c'));_0xf967a2[_0x7221('0x45')](_0x7221('0x98'),_0x7221('0x99'));_0xf967a2[_0x7221('0x45')](_0x7221('0x9a'),_0x7221('0x9b'));_0xf967a2[_0x7221('0x45')]('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',_0x7221('0x89'));_0xf967a2[_0x7221('0x45')](_0x7221('0x9c'));_0xf967a2['field'](_0x7221('0x9d'),'Contact.firstName');_0xf967a2['field'](_0x7221('0x9e'),_0x7221('0x9f'));_0xf967a2['field'](_0x7221('0xa0'),_0x7221('0xa1'));_0xf967a2[_0x7221('0x45')](_0x7221('0xa2'),_0x7221('0xa3'));_0xf967a2['field']('c.mobile',_0x7221('0xa4'));_0xf967a2[_0x7221('0x45')](_0x7221('0xa5'),_0x7221('0xa6'));_0xf967a2[_0x7221('0x45')](_0x7221('0xa7'),_0x7221('0xa8'));_0xf967a2[_0x7221('0x45')]('o.internal',_0x7221('0xa9'));_0xf967a2[_0x7221('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7221('0x2b'));}if(_0x456a95[_0x7221('0x20')])_0xf967a2[_0x7221('0x20')](_0x456a95['limit']);if(_0x456a95[_0x7221('0x40')])_0xf967a2[_0x7221('0x40')](_0x456a95[_0x7221('0x40')]);return db['sequelize'][_0x7221('0x38')](_0xf967a2[_0x7221('0x95')](),_0x5b0923);})[_0x7221('0x25')](function(_0x1ea17a){if(_0x1ea17a['length']>0x0)_0x37b508[_0x7221('0x42')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x1ea17a,'id'));return db['sequelize'][_0x7221('0x38')](_0x37b508['toString'](),_0x5b0923)[_0x7221('0x25')](function(_0xb93f46){var _0x409b5c=_[_0x7221('0xaa')](_0xb93f46,_0x7221('0xab'));var _0x33a3b2=[];_0x1ea17a[_0x7221('0x2d')](function(_0x198eb4){_0x33a3b2[_0x7221('0x2e')](updateFaxInteraction(_0x198eb4,_0x40291c,_0x409b5c));});return BPromise[_0x7221('0xac')](_0x33a3b2);});});})[_0x7221('0x25')](function(_0x591cb4){_0x3153fc['rows']=_0x591cb4;return _0x3153fc;})['then'](respondWithFilteredResult(_0x2818ce,_0x456a95))['catch'](handleError(_0x2818ce,null));};exports['show']=function(_0x3b52d5,_0x27e6e0){var _0x462c24={'raw':![],'where':{'id':_0x3b52d5[_0x7221('0xad')]['id']}},_0x4cd539={};_0x4cd539[_0x7221('0x36')]=_[_0x7221('0x37')](db[_0x7221('0x31')][_0x7221('0x32')]);_0x4cd539[_0x7221('0x38')]=_[_0x7221('0x37')](_0x3b52d5[_0x7221('0x38')]);_0x4cd539['filters']=_['intersection'](_0x4cd539[_0x7221('0x36')],_0x4cd539[_0x7221('0x38')]);_0x462c24[_0x7221('0x3a')]=_[_0x7221('0x3b')](_0x4cd539[_0x7221('0x36')],qs[_0x7221('0x3c')](_0x3b52d5[_0x7221('0x38')]['fields']));_0x462c24[_0x7221('0x3a')]=_0x462c24[_0x7221('0x3a')][_0x7221('0x3d')]?_0x462c24[_0x7221('0x3a')]:_0x4cd539[_0x7221('0x36')];if(_0x3b52d5[_0x7221('0x38')][_0x7221('0xae')]){_0x462c24['include']=[{'all':!![]}];}_0x462c24=_[_0x7221('0x97')]({},_0x462c24,_0x3b52d5[_0x7221('0xaf')]);return db[_0x7221('0x31')]['find'](_0x462c24)[_0x7221('0x25')](handleEntityNotFound(_0x27e6e0,null))['then'](respondWithResult(_0x27e6e0,null))['catch'](handleError(_0x27e6e0,null));};exports[_0x7221('0xb0')]=function(_0x2c695a,_0x23f8b4){return db[_0x7221('0x31')]['create'](_0x2c695a['body'],{})[_0x7221('0x25')](respondWithResult(_0x23f8b4,0xc9))[_0x7221('0xb1')](handleError(_0x23f8b4,null));};exports[_0x7221('0x24')]=function(_0x50233c,_0x48d2fa){if(_0x50233c[_0x7221('0xb2')]['id']){delete _0x50233c['body']['id'];}return db[_0x7221('0x31')][_0x7221('0x5b')]({'where':{'id':_0x50233c[_0x7221('0xad')]['id']}})['then'](handleEntityNotFound(_0x48d2fa,null))[_0x7221('0x25')](saveUpdates(_0x50233c[_0x7221('0xb2')],null))['then'](respondWithResult(_0x48d2fa,null))[_0x7221('0xb1')](handleError(_0x48d2fa,null));};exports[_0x7221('0xb3')]=function(_0x52e8a0,_0x1f54b4){return db[_0x7221('0x31')]['find']({'where':{'id':_0x52e8a0[_0x7221('0xad')]['id']}})[_0x7221('0x25')](handleEntityNotFound(_0x1f54b4,null))['then'](removeEntity(_0x1f54b4,null))[_0x7221('0xb1')](handleError(_0x1f54b4,null));};exports[_0x7221('0xb4')]=function(_0xc0d2cf,_0xf9814a){return db[_0x7221('0x31')][_0x7221('0xb4')]()[_0x7221('0x25')](respondWithResult(_0xf9814a,null))[_0x7221('0xb1')](handleError(_0xf9814a,null));};exports[_0x7221('0xb5')]=function(_0x2af0f5,_0x2c435a,_0x2e2ea4){return db[_0x7221('0xb6')][_0x7221('0x5b')]({'where':{'id':_0x2af0f5[_0x7221('0xad')]['id']}})[_0x7221('0x25')](handleEntityNotFound(_0x2c435a,null))[_0x7221('0x25')](function(_0x5cbba6){if(_0x5cbba6){return _0x5cbba6[_0x7221('0xb5')](_0x2af0f5[_0x7221('0xb2')]['ids'],_[_0x7221('0xb7')](_0x2af0f5[_0x7221('0xb2')],['ids','id'])||{});}})['then'](respondWithResult(_0x2c435a,null))[_0x7221('0xb1')](handleError(_0x2c435a,null));};exports[_0x7221('0xb8')]=function(_0x55a17d,_0xc06482,_0x361187){var _0x52b597={'raw':![],'where':{}};var _0x37e7f2={};var _0x27c739={'count':0x0,'rows':[]};return db[_0x7221('0x31')][_0x7221('0xb9')]({'where':{'id':_0x55a17d[_0x7221('0xad')]['id']}})[_0x7221('0x25')](handleEntityNotFound(_0xc06482,null))[_0x7221('0x25')](function(_0x37ec25){if(_0x37ec25){_0x37e7f2[_0x7221('0x36')]=_[_0x7221('0x37')](db[_0x7221('0xb6')]['rawAttributes']);_0x37e7f2[_0x7221('0x38')]=_[_0x7221('0x37')](_0x55a17d[_0x7221('0x38')]);_0x37e7f2['filters']=_[_0x7221('0x3b')](_0x37e7f2['model'],_0x37e7f2['query']);_0x52b597[_0x7221('0x3a')]=_[_0x7221('0x3b')](_0x37e7f2[_0x7221('0x36')],qs[_0x7221('0x3c')](_0x55a17d[_0x7221('0x38')]['fields']));_0x52b597[_0x7221('0x3a')]=_0x52b597[_0x7221('0x3a')]['length']?_0x52b597[_0x7221('0x3a')]:_0x37e7f2[_0x7221('0x36')];if(!_0x55a17d[_0x7221('0x38')]['hasOwnProperty']('nolimit')){_0x52b597[_0x7221('0x20')]=qs[_0x7221('0x20')](_0x55a17d[_0x7221('0x38')][_0x7221('0x20')]);_0x52b597[_0x7221('0x40')]=qs['offset'](_0x55a17d[_0x7221('0x38')]['offset']);}_0x52b597['order']=qs[_0x7221('0x41')](_0x55a17d['query']['sort']);_0x52b597['where']=qs[_0x7221('0x39')](_[_0x7221('0x43')](_0x55a17d[_0x7221('0x38')],_0x37e7f2[_0x7221('0x39')]));_0x52b597['where'][_0x7221('0xab')]=_0x37ec25['id'];if(_0x55a17d[_0x7221('0x38')][_0x7221('0x7f')]){_0x52b597[_0x7221('0x42')]=_['merge'](_0x52b597[_0x7221('0x42')],{'$or':_[_0x7221('0x30')](_0x52b597['attributes'],function(_0x2948cb){var _0x348c4e={};_0x348c4e[_0x2948cb]={'$like':'%'+_0x55a17d[_0x7221('0x38')][_0x7221('0x7f')]+'%'};return _0x348c4e;})});}if(_0x55a17d[_0x7221('0x38')][_0x7221('0x76')]){var _0x3322f7=_0x55a17d['query'][_0x7221('0x76')]['split'](',');var _0x442021={};_0x442021[_0x3322f7[0x0]]={'$gte':moment(_0x3322f7[0x1])[_0x7221('0xba')](_0x7221('0xbb'))};_0x52b597[_0x7221('0x42')]=_[_0x7221('0x97')](_0x52b597[_0x7221('0x42')],_0x442021);}_0x52b597=_[_0x7221('0x97')]({},_0x52b597,_0x55a17d[_0x7221('0xaf')]);return db[_0x7221('0xb6')][_0x7221('0x1f')]({'where':_0x52b597['where']})[_0x7221('0x25')](function(_0x56f721){_0x27c739[_0x7221('0x1f')]=_0x56f721;if(_0x55a17d['query'][_0x7221('0xae')]){_0x52b597['include']=[{'all':!![]}];}return db[_0x7221('0xb6')][_0x7221('0xbc')](_0x52b597);})[_0x7221('0x25')](function(_0x18aace){_0x27c739[_0x7221('0xbd')]=_0x18aace;return _0x27c739;});}})[_0x7221('0x25')](respondWithFilteredResult(_0xc06482,_0x52b597))[_0x7221('0xb1')](handleError(_0xc06482,null));};exports['addTags']=function(_0x252025,_0x4a6719,_0x17a895){return db[_0x7221('0x31')][_0x7221('0x5b')]({'where':{'id':_0x252025[_0x7221('0xad')]['id']}})[_0x7221('0x25')](handleEntityNotFound(_0x4a6719,null))[_0x7221('0x25')](function(_0x556c11){if(_0x556c11){return _0x556c11['setTags'](_0x252025[_0x7221('0xb2')][_0x7221('0xbe')],_[_0x7221('0xb7')](_0x252025[_0x7221('0xb2')],[_0x7221('0xbe'),'id'])||{})[_0x7221('0xbf')](function(){return db[_0x7221('0x6b')][_0x7221('0xbc')]({'attributes':['id','name',_0x7221('0x46')],'where':{'id':_0x252025[_0x7221('0xb2')][_0x7221('0xbe')]}});})[_0x7221('0x25')](function(_0x1b87ed){socket['emit']('faxInteractionTags:save',{'id':Number(_0x252025['params']['id']),'tags':_0x1b87ed||[]});return{'id':Number(_0x252025[_0x7221('0xad')]['id']),'tags':_0x1b87ed||[]};});}})[_0x7221('0x25')](respondWithResult(_0x4a6719,null))[_0x7221('0xb1')](handleError(_0x4a6719,null));};exports['removeTags']=function(_0x5e49c8,_0x129d0e,_0x5c1629){return db['FaxInteraction'][_0x7221('0x5b')]({'where':{'id':_0x5e49c8[_0x7221('0xad')]['id']}})[_0x7221('0x25')](handleEntityNotFound(_0x129d0e,null))[_0x7221('0x25')](function(_0x411726){if(_0x411726){return _0x411726[_0x7221('0xc0')](_0x5e49c8[_0x7221('0x38')][_0x7221('0xbe')]);}})[_0x7221('0x25')](respondWithStatusCode(_0x129d0e,null))[_0x7221('0xb1')](handleError(_0x129d0e,null));};exports[_0x7221('0xc1')]=function(_0x1e9eb3,_0x3a7cc9){var _0x5f4466=moment()[_0x7221('0xc2')]()['toString']();var _0x1de7c4=path[_0x7221('0xc3')](config[_0x7221('0xc4')],_0x7221('0xc5'),'files',_0x7221('0xc6'));var _0x5a7b24=path['join'](config[_0x7221('0xc4')],_0x7221('0xc5'),_0x7221('0xc7'),'attachments');var _0x1e3d99=path['join'](_0x1de7c4,_0x5f4466);var _0x1bf114=util[_0x7221('0xba')](_0x7221('0xc8'),_0x1e9eb3['params']['id'],_0x5f4466);var _0x4565f4=path[_0x7221('0xc3')](_0x1de7c4,_0x1bf114);var _0x3c82c6=[];_0x3c82c6[_0x7221('0x2e')]({'model':db[_0x7221('0xc9')],'as':_0x7221('0xc9'),'raw':!![]});var _0x475596=[{'model':db[_0x7221('0xb6')],'as':_0x7221('0xca'),'attributes':['id','body','createdAt'],'include':_0x3c82c6}];return db[_0x7221('0x31')]['find']({'where':{'id':_0x1e9eb3['params']['id']},'include':_0x475596})[_0x7221('0x25')](handleEntityNotFound(_0x3a7cc9,null))[_0x7221('0x25')](function(_0xfa5431){if(_0xfa5431&&_0xfa5431['Messages']){var _0x51cc92=_0xfa5431[_0x7221('0xcb')]({'plain':!![]});fs[_0x7221('0xcc')](_0x1e3d99);for(var _0x1f6fb3=0x0;_0x1f6fb3<_0x51cc92['Messages'][_0x7221('0x3d')];_0x1f6fb3++){var _0x4fc29a=_0x51cc92['Messages'][_0x1f6fb3][_0x7221('0xc9')];if(_0x4fc29a){var _0x3c9771=path['join'](_0x5a7b24,_0x4fc29a['basename']);if(fs[_0x7221('0xcd')](_0x3c9771)){fs[_0x7221('0xce')](_0x3c9771)[_0x7221('0xcf')](fs[_0x7221('0xd0')](path[_0x7221('0xc3')](_0x1e3d99,_0x4fc29a[_0x7221('0xd1')])));}}}return BPromise[_0x7221('0x8c')]()['then'](function(){return new BPromise(function(_0x14248e,_0x13e5d1){zipdir(_0x1e3d99,{'saveTo':_0x4565f4},function(_0x3f8746,_0x3729cf){if(_0x3f8746)return _0x13e5d1(_0x3f8746);return _0x14248e(_0x3729cf);});})[_0x7221('0x25')](function(){return new BPromise(function(_0x308efc,_0x1e954a){rimraf(_0x1e3d99,function(_0x42ae6c){if(_0x42ae6c)_0x1e954a(_0x42ae6c);return _0x308efc();});});})[_0x7221('0x25')](function(){return _0x3a7cc9[_0x7221('0xc1')](_0x4565f4,_0x1bf114,function(_0x2dec80){if(_0x2dec80){console[_0x7221('0xd2')](_0x7221('0xd3'),_0x2dec80);}else{fs[_0x7221('0xd4')](_0x4565f4);}});});});}else{return _0x3a7cc9[_0x7221('0x1b')](0xc8);}})['catch'](handleError(_0x3a7cc9,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f98f030..98bab22 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 _0x7db2=['getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','remove'];(function(_0x3f9d9b,_0x175b8a){var _0x5d0f71=function(_0x38f389){while(--_0x38f389){_0x3f9d9b['push'](_0x3f9d9b['shift']());}};_0x5d0f71(++_0x175b8a);}(_0x7db2,0x170));var _0x27db=function(_0x29bc28,_0x2f73ba){_0x29bc28=_0x29bc28-0x0;var _0x406c1c=_0x7db2[_0x29bc28];return _0x406c1c;};'use strict';var EventEmitter=require(_0x27db('0x0'));var FaxInteraction=require(_0x27db('0x1'))['db'][_0x27db('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x27db('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x27db('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x27db('0x5')};function emitEvent(_0x5d423a){return function(_0x14599f,_0x5bfab5,_0x5b4b77){_0x14599f[_0x27db('0x6')]({'attributes':['id'],'raw':!![]})[_0x27db('0x7')](function(_0x105d86){_0x14599f[_0x27db('0x8')](_0x27db('0x9'),_0x105d86[_0x27db('0xa')](function(_0x201c43){return{'id':_0x201c43['id']};}));return FaxMessage[_0x27db('0xb')]({'where':{'FaxInteractionId':_0x14599f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2cc9fc){_0x14599f[_0x27db('0x8')]('unreadMessages',_0x2cc9fc[_0x27db('0xc')]);FaxInteractionEvents[_0x27db('0xd')](_0x5d423a+':'+_0x14599f['id'],_0x14599f);FaxInteractionEvents['emit'](_0x5d423a,_0x14599f);_0x5b4b77(null);})[_0x27db('0xe')](_0x5b4b77(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x27db('0xf')](e,emitEvent(event));}}module[_0x27db('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x5bc5=['emit','catch','hook','exports','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x4cc540,_0x4a2268){var _0x3703ee=function(_0x127428){while(--_0x127428){_0x4cc540['push'](_0x4cc540['shift']());}};_0x3703ee(++_0x4a2268);}(_0x5bc5,0x17e));var _0x55bc=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x5bc5[_0x31a37b];return _0x49ae16;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x55bc('0x0')];var FaxMessage=require(_0x55bc('0x1'))['db'][_0x55bc('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x55bc('0x3')](0x0);var events={'afterCreate':_0x55bc('0x4'),'afterUpdate':_0x55bc('0x5'),'afterDestroy':_0x55bc('0x6')};function emitEvent(_0x38bbe2){return function(_0x6e8b8b,_0x1bfd9a,_0x1d3400){_0x6e8b8b['getUsers']({'attributes':['id'],'raw':!![]})[_0x55bc('0x7')](function(_0x2f28fe){_0x6e8b8b[_0x55bc('0x8')](_0x55bc('0x9'),_0x2f28fe[_0x55bc('0xa')](function(_0x21cf43){return{'id':_0x21cf43['id']};}));return FaxMessage[_0x55bc('0xb')]({'where':{'FaxInteractionId':_0x6e8b8b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x55bc('0x7')](function(_0x112349){_0x6e8b8b[_0x55bc('0x8')](_0x55bc('0xc'),_0x112349[_0x55bc('0xd')]);FaxInteractionEvents[_0x55bc('0xe')](_0x38bbe2+':'+_0x6e8b8b['id'],_0x6e8b8b);FaxInteractionEvents[_0x55bc('0xe')](_0x38bbe2,_0x6e8b8b);_0x1d3400(null);})[_0x55bc('0xf')](_0x1d3400(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x55bc('0x10')](e,emitEvent(event));}}module[_0x55bc('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 8e0dee3..5133747 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 _0x3942=['define','FaxInteraction','fax_interactions','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3942,0x1d9));var _0x2394=function(_0x4dd5ce,_0x50b2ce){_0x4dd5ce=_0x4dd5ce-0x0;var _0x6b8ef7=_0x3942[_0x4dd5ce];return _0x6b8ef7;};'use strict';var _=require(_0x2394('0x0'));var util=require(_0x2394('0x1'));var logger=require('../../config/logger')(_0x2394('0x2'));var moment=require(_0x2394('0x3'));var BPromise=require('bluebird');var rp=require(_0x2394('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2394('0x5'));var config=require(_0x2394('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x2394('0x7')]=function(_0x44ac68,_0x21cac3){return _0x44ac68[_0x2394('0x8')](_0x2394('0x9'),attributes,{'tableName':_0x2394('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x455668,_0x3384e6,_0x30adc8){if(_0x455668['changed']('closed')){_0x455668['closedAt']=moment()[_0x2394('0xb')](_0x2394('0xc'));}_0x30adc8(null,_0x455668);}}});}; \ No newline at end of file +var _0x2f5e=['util','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x2f5e,0xe0));var _0xe2f5=function(_0x5cb76d,_0x47d11a){_0x5cb76d=_0x5cb76d-0x0;var _0x34a1f2=_0x2f5e[_0x5cb76d];return _0x34a1f2;};'use strict';var _=require('lodash');var util=require(_0xe2f5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe2f5('0x1'));var BPromise=require(_0xe2f5('0x2'));var rp=require(_0xe2f5('0x3'));var fs=require('fs');var path=require(_0xe2f5('0x4'));var rimraf=require(_0xe2f5('0x5'));var config=require('../../config/environment');var attributes=require(_0xe2f5('0x6'));module[_0xe2f5('0x7')]=function(_0x50ba81,_0x30f75a){return _0x50ba81[_0xe2f5('0x8')](_0xe2f5('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d290a,_0x2562a3,_0x49edc0){if(_0x3d290a[_0xe2f5('0xa')](_0xe2f5('0xb'))){_0x3d290a[_0xe2f5('0xc')]=moment()['format'](_0xe2f5('0xd'));}_0x49edc0(null,_0x3d290a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d13b111..10739b0 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 _0xb7d9=['moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','addTags','body','ids','omit','spread','AddTags','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7d9,0x124));var _0x9b7d=function(_0x5b759b,_0x3b7b66){_0x5b759b=_0x5b759b-0x0;var _0x3d43bd=_0xb7d9[_0x5b759b];return _0x3d43bd;};'use strict';var _=require(_0x9b7d('0x0'));var util=require(_0x9b7d('0x1'));var moment=require(_0x9b7d('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b7d('0x3'));var fs=require('fs');var Redis=require(_0x9b7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b7d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b7d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9b7d('0x7')][_0x9b7d('0x8')]({'port':0x232a});config['redis']=_[_0x9b7d('0x9')](config[_0x9b7d('0xa')],{'host':_0x9b7d('0xb'),'port':0x18eb});var socket=require(_0x9b7d('0xc'))(new Redis(config['redis']));require(_0x9b7d('0xd'))[_0x9b7d('0xe')](socket);function respondWithRpcPromise(_0x199fa9,_0xc5762,_0x3f6997){return new BPromise(function(_0x297fc3,_0x561081){return client[_0x9b7d('0xf')](_0x199fa9,_0x3f6997)[_0x9b7d('0x10')](function(_0x4b3b18){logger[_0x9b7d('0x11')](_0x9b7d('0x12'),_0xc5762,_0x9b7d('0x13'));logger[_0x9b7d('0x14')](_0x9b7d('0x15'),_0xc5762,_0x9b7d('0x13'),JSON[_0x9b7d('0x16')](_0x4b3b18));if(_0x4b3b18[_0x9b7d('0x17')]){if(_0x4b3b18[_0x9b7d('0x17')][_0x9b7d('0x18')]===0x1f4){logger[_0x9b7d('0x17')](_0x9b7d('0x12'),_0xc5762,_0x4b3b18[_0x9b7d('0x17')][_0x9b7d('0x19')]);return _0x561081(_0x4b3b18[_0x9b7d('0x17')]['message']);}logger[_0x9b7d('0x17')](_0x9b7d('0x12'),_0xc5762,_0x4b3b18[_0x9b7d('0x17')][_0x9b7d('0x19')]);return _0x297fc3(_0x4b3b18['error'][_0x9b7d('0x19')]);}else{logger['info'](_0x9b7d('0x12'),_0xc5762,_0x9b7d('0x13'));_0x297fc3(_0x4b3b18[_0x9b7d('0x1a')][_0x9b7d('0x19')]);}})[_0x9b7d('0x1b')](function(_0x1947dd){logger[_0x9b7d('0x17')](_0x9b7d('0x12'),_0xc5762,_0x1947dd);_0x561081(_0x1947dd);});});}exports[_0x9b7d('0x1c')]=function(_0x56de87){var _0x4f06de=this;return new Promise(function(_0x52cf2a,_0x5692b9){return db[_0x9b7d('0x1d')][_0x9b7d('0x1e')](_0x56de87['body'],{'raw':_0x56de87[_0x9b7d('0x1f')]?_0x56de87['options'][_0x9b7d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56de87[_0x9b7d('0x1f')]?_0x56de87[_0x9b7d('0x1f')][_0x9b7d('0x21')]||null:null,'attributes':_0x56de87[_0x9b7d('0x1f')]?_0x56de87[_0x9b7d('0x1f')][_0x9b7d('0x22')]||null:null,'limit':_0x56de87[_0x9b7d('0x1f')]?_0x56de87[_0x9b7d('0x1f')][_0x9b7d('0x23')]||null:null})[_0x9b7d('0x10')](function(_0x594ac4){logger[_0x9b7d('0x11')]('UpdateFaxInteraction',_0x56de87);logger['debug'](_0x9b7d('0x1c'),_0x56de87,JSON[_0x9b7d('0x16')](_0x594ac4));_0x52cf2a(_0x594ac4);})[_0x9b7d('0x1b')](function(_0x358273){logger['error']('UpdateFaxInteraction',_0x358273['message'],_0x56de87);_0x5692b9(_0x4f06de['error'](0x1f4,_0x358273[_0x9b7d('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x165d2c){return new Promise(function(_0x4fd84e,_0x2fbbbd){return db[_0x9b7d('0x1d')]['find']({'where':_0x165d2c[_0x9b7d('0x1f')]?_0x165d2c[_0x9b7d('0x1f')][_0x9b7d('0x21')]||null:null})['then'](function(_0x4f2445){if(_0x4f2445){return _0x4f2445[_0x9b7d('0x24')](_0x165d2c[_0x9b7d('0x25')][_0x9b7d('0x26')],_[_0x9b7d('0x27')](_0x165d2c['body'],['ids','id'])||{});}})[_0x9b7d('0x28')](function(_0x48a5e1){logger[_0x9b7d('0x11')]('AddTags',_0x165d2c);logger[_0x9b7d('0x14')](_0x9b7d('0x29'),_0x165d2c,JSON[_0x9b7d('0x16')](_0x48a5e1));_0x4fd84e(_0x48a5e1);})[_0x9b7d('0x1b')](function(_0x52d591){logger[_0x9b7d('0x17')](_0x9b7d('0x29'),_0x52d591[_0x9b7d('0x19')],_0x165d2c);_0x2fbbbd(_this[_0x9b7d('0x17')](0x1f4,_0x52d591['message']));});});}; \ No newline at end of file +var _0xf57c=['stringify','error','code','message','result','catch','UpdateFaxInteraction','update','body','options','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf57c,0x114));var _0xcf57=function(_0x26ef5b,_0x5f155d){_0x26ef5b=_0x26ef5b-0x0;var _0x5e313f=_0xf57c[_0x26ef5b];return _0x5e313f;};'use strict';var _=require(_0xcf57('0x0'));var util=require(_0xcf57('0x1'));var moment=require(_0xcf57('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf57('0x3'));var fs=require('fs');var Redis=require(_0xcf57('0x4'));var db=require(_0xcf57('0x5'))['db'];var utils=require(_0xcf57('0x6'));var logger=require('../../config/logger')(_0xcf57('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xcf57('0x8')]=_[_0xcf57('0x9')](config[_0xcf57('0x8')],{'host':_0xcf57('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf57('0xb'))[_0xcf57('0xc')](socket);function respondWithRpcPromise(_0x41d499,_0x3a7ec8,_0x20b071){return new BPromise(function(_0x5c6e65,_0x5e2711){return client[_0xcf57('0xd')](_0x41d499,_0x20b071)[_0xcf57('0xe')](function(_0x46b376){logger[_0xcf57('0xf')](_0xcf57('0x10'),_0x3a7ec8,_0xcf57('0x11'));logger[_0xcf57('0x12')](_0xcf57('0x13'),_0x3a7ec8,'request\x20sent',JSON[_0xcf57('0x14')](_0x46b376));if(_0x46b376[_0xcf57('0x15')]){if(_0x46b376['error'][_0xcf57('0x16')]===0x1f4){logger[_0xcf57('0x15')](_0xcf57('0x10'),_0x3a7ec8,_0x46b376['error'][_0xcf57('0x17')]);return _0x5e2711(_0x46b376[_0xcf57('0x15')]['message']);}logger['error'](_0xcf57('0x10'),_0x3a7ec8,_0x46b376[_0xcf57('0x15')]['message']);return _0x5c6e65(_0x46b376[_0xcf57('0x15')][_0xcf57('0x17')]);}else{logger['info'](_0xcf57('0x10'),_0x3a7ec8,_0xcf57('0x11'));_0x5c6e65(_0x46b376[_0xcf57('0x18')][_0xcf57('0x17')]);}})[_0xcf57('0x19')](function(_0x2a86a8){logger[_0xcf57('0x15')](_0xcf57('0x10'),_0x3a7ec8,_0x2a86a8);_0x5e2711(_0x2a86a8);});});}exports[_0xcf57('0x1a')]=function(_0x20ea06){var _0x200d74=this;return new Promise(function(_0x25c7ff,_0x385ba1){return db['FaxInteraction'][_0xcf57('0x1b')](_0x20ea06[_0xcf57('0x1c')],{'raw':_0x20ea06[_0xcf57('0x1d')]?_0x20ea06[_0xcf57('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ea06[_0xcf57('0x1d')]?_0x20ea06[_0xcf57('0x1d')]['where']||null:null,'attributes':_0x20ea06[_0xcf57('0x1d')]?_0x20ea06[_0xcf57('0x1d')]['attributes']||null:null,'limit':_0x20ea06[_0xcf57('0x1d')]?_0x20ea06[_0xcf57('0x1d')]['limit']||null:null})['then'](function(_0x1f5842){logger['info'](_0xcf57('0x1a'),_0x20ea06);logger['debug'](_0xcf57('0x1a'),_0x20ea06,JSON[_0xcf57('0x14')](_0x1f5842));_0x25c7ff(_0x1f5842);})['catch'](function(_0x318204){logger[_0xcf57('0x15')]('UpdateFaxInteraction',_0x318204[_0xcf57('0x17')],_0x20ea06);_0x385ba1(_0x200d74[_0xcf57('0x15')](0x1f4,_0x318204['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x5019f2){return new Promise(function(_0x22af5c,_0x3dec85){return db[_0xcf57('0x1e')][_0xcf57('0x1f')]({'where':_0x5019f2[_0xcf57('0x1d')]?_0x5019f2[_0xcf57('0x1d')]['where']||null:null})[_0xcf57('0xe')](function(_0x1441bb){if(_0x1441bb){return _0x1441bb[_0xcf57('0x20')](_0x5019f2[_0xcf57('0x1c')][_0xcf57('0x21')],_[_0xcf57('0x22')](_0x5019f2[_0xcf57('0x1c')],['ids','id'])||{});}})[_0xcf57('0x23')](function(_0x37a0a6){logger[_0xcf57('0xf')](_0xcf57('0x24'),_0x5019f2);logger['debug']('AddTags',_0x5019f2,JSON[_0xcf57('0x14')](_0x37a0a6));_0x22af5c(_0x37a0a6);})['catch'](function(_0x46dea5){logger[_0xcf57('0x15')](_0xcf57('0x24'),_0x46dea5[_0xcf57('0x17')],_0x5019f2);_0x3dec85(_this[_0xcf57('0x15')](0x1f4,_0x46dea5[_0xcf57('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index cc35758..e9949b7 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 _0xa1c5=['length','./faxInteraction.events','save','remove','update','removeListener'];(function(_0x4fd843,_0x160e2b){var _0x4676f8=function(_0x2dd82f){while(--_0x2dd82f){_0x4fd843['push'](_0x4fd843['shift']());}};_0x4676f8(++_0x160e2b);}(_0xa1c5,0x193));var _0x5a1c=function(_0x351095,_0x22ba27){_0x351095=_0x351095-0x0;var _0x76d2ca=_0xa1c5[_0x351095];return _0x76d2ca;};'use strict';var FaxInteractionEvents=require(_0x5a1c('0x0'));var events=[_0x5a1c('0x1'),_0x5a1c('0x2'),_0x5a1c('0x3')];function createListener(_0x4f6c10,_0x19a94e){return function(_0x3fb9f7){_0x19a94e['emit'](_0x4f6c10,_0x3fb9f7);};}function removeListener(_0x364e49,_0xba1886){return function(){FaxInteractionEvents[_0x5a1c('0x4')](_0x364e49,_0xba1886);};}exports['register']=function(_0x5d2237){for(var _0x49aa96=0x0,_0x22c4a5=events[_0x5a1c('0x5')];_0x49aa96<_0x22c4a5;_0x49aa96++){var _0x3525b6=events[_0x49aa96];var _0x10ebed=createListener('faxInteraction:'+_0x3525b6,_0x5d2237);FaxInteractionEvents['on'](_0x3525b6,_0x10ebed);}}; \ No newline at end of file +var _0x66c4=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x497355,_0x5d4dd0){var _0x2272a0=function(_0xbab2d2){while(--_0xbab2d2){_0x497355['push'](_0x497355['shift']());}};_0x2272a0(++_0x5d4dd0);}(_0x66c4,0x1cf));var _0x466c=function(_0x3657c4,_0xd44051){_0x3657c4=_0x3657c4-0x0;var _0x1047b3=_0x66c4[_0x3657c4];return _0x1047b3;};'use strict';var FaxInteractionEvents=require(_0x466c('0x0'));var events=['save',_0x466c('0x1'),_0x466c('0x2')];function createListener(_0x4b11af,_0x3083ee){return function(_0x4f1093){_0x3083ee[_0x466c('0x3')](_0x4b11af,_0x4f1093);};}function removeListener(_0xb8cecd,_0x58c1bc){return function(){FaxInteractionEvents[_0x466c('0x4')](_0xb8cecd,_0x58c1bc);};}exports[_0x466c('0x5')]=function(_0x54f680){for(var _0x258486=0x0,_0x5ed8e4=events[_0x466c('0x6')];_0x258486<_0x5ed8e4;_0x258486++){var _0x52afe5=events[_0x258486];var _0x182364=createListener(_0x466c('0x7')+_0x52afe5,_0x54f680);FaxInteractionEvents['on'](_0x52afe5,_0x182364);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 872ed0a..a19fbd6 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 _0x8fe3=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','addMessage','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x8fe3,0x163));var _0x38fe=function(_0xb9a5da,_0x138776){_0xb9a5da=_0xb9a5da-0x0;var _0x2487fc=_0x8fe3[_0xb9a5da];return _0x2487fc;};'use strict';var multer=require(_0x38fe('0x0'));var util=require(_0x38fe('0x1'));var path=require('path');var timeout=require(_0x38fe('0x2'));var express=require('express');var router=express[_0x38fe('0x3')]();var fs_extra=require(_0x38fe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38fe('0x5'));var config=require(_0x38fe('0x6'));var controller=require('./faxInteraction.controller');router[_0x38fe('0x7')]('/',auth[_0x38fe('0x8')](),controller['index']);router[_0x38fe('0x7')](_0x38fe('0x9'),auth[_0x38fe('0x8')](),controller[_0x38fe('0xa')]);router['get'](_0x38fe('0xb'),auth['isAuthenticated'](),controller[_0x38fe('0xc')]);router[_0x38fe('0x7')](_0x38fe('0xd'),auth['isAuthenticated'](),controller[_0x38fe('0xe')]);router[_0x38fe('0x7')](_0x38fe('0xf'),auth[_0x38fe('0x8')](),controller['download']);router['post']('/',auth[_0x38fe('0x8')](),controller[_0x38fe('0x10')]);router['post'](_0x38fe('0xd'),auth[_0x38fe('0x8')](),controller[_0x38fe('0x11')]);router['post']('/:id/tags',auth[_0x38fe('0x8')](),interaction[_0x38fe('0x12')]('fax',_0x38fe('0x13')),controller[_0x38fe('0x14')]);router['put']('/:id',auth[_0x38fe('0x8')](),interaction[_0x38fe('0x12')](_0x38fe('0x15'),_0x38fe('0x16')),controller[_0x38fe('0x17')]);router[_0x38fe('0x18')](_0x38fe('0xb'),auth[_0x38fe('0x8')](),interaction[_0x38fe('0x12')](_0x38fe('0x15'),_0x38fe('0x19')),controller['destroy']);router[_0x38fe('0x18')]('/:id/tags',auth[_0x38fe('0x8')](),controller[_0x38fe('0x1a')]);module[_0x38fe('0x1b')]=router; \ No newline at end of file +var _0xc172=['./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc172,0x1bd));var _0x2c17=function(_0x274b43,_0x132497){_0x274b43=_0x274b43-0x0;var _0x32071b=_0xc172[_0x274b43];return _0x32071b;};'use strict';var multer=require(_0x2c17('0x0'));var util=require(_0x2c17('0x1'));var path=require(_0x2c17('0x2'));var timeout=require(_0x2c17('0x3'));var express=require(_0x2c17('0x4'));var router=express[_0x2c17('0x5')]();var fs_extra=require(_0x2c17('0x6'));var auth=require(_0x2c17('0x7'));var interaction=require(_0x2c17('0x8'));var config=require(_0x2c17('0x9'));var controller=require(_0x2c17('0xa'));router[_0x2c17('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c17('0xc')]);router[_0x2c17('0xb')](_0x2c17('0xd'),auth[_0x2c17('0xe')](),controller[_0x2c17('0xf')]);router[_0x2c17('0xb')](_0x2c17('0x10'),auth[_0x2c17('0xe')](),controller['show']);router['get'](_0x2c17('0x11'),auth[_0x2c17('0xe')](),controller[_0x2c17('0x12')]);router[_0x2c17('0xb')](_0x2c17('0x13'),auth[_0x2c17('0xe')](),controller[_0x2c17('0x14')]);router['post']('/',auth[_0x2c17('0xe')](),controller[_0x2c17('0x15')]);router[_0x2c17('0x16')](_0x2c17('0x11'),auth[_0x2c17('0xe')](),controller[_0x2c17('0x17')]);router[_0x2c17('0x16')](_0x2c17('0x18'),auth[_0x2c17('0xe')](),interaction[_0x2c17('0x19')]('fax','faxinteraction:addtags'),controller[_0x2c17('0x1a')]);router[_0x2c17('0x1b')](_0x2c17('0x10'),auth[_0x2c17('0xe')](),interaction[_0x2c17('0x19')](_0x2c17('0x1c'),_0x2c17('0x1d')),controller[_0x2c17('0x1e')]);router[_0x2c17('0x1f')]('/:id',auth[_0x2c17('0xe')](),interaction['tracked'](_0x2c17('0x1c'),_0x2c17('0x20')),controller[_0x2c17('0x21')]);router[_0x2c17('0x1f')]('/:id/tags',auth[_0x2c17('0xe')](),controller['removeTags']);module[_0x2c17('0x22')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 45e4509..74af13c 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 _0x0f69=['BOOLEAN','ENUM','out','TEXT'];(function(_0x55caf7,_0x23a2b9){var _0x377d36=function(_0xbfcc08){while(--_0xbfcc08){_0x55caf7['push'](_0x55caf7['shift']());}};_0x377d36(++_0x23a2b9);}(_0x0f69,0x173));var _0x90f6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0f69[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x90f6('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x90f6('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x90f6('0x2')]('in','out'),'defaultValue':_0x90f6('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x90f6('0x0')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xed1f=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1a27f3,_0x1c082d){var _0x3ce222=function(_0x3f93e1){while(--_0x3f93e1){_0x1a27f3['push'](_0x1a27f3['shift']());}};_0x3ce222(++_0x1c082d);}(_0xed1f,0x6a));var _0xfed1=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xed1f[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'body':{'type':Sequelize[_0xfed1('0x2')](_0xfed1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfed1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfed1('0x5')]('in',_0xfed1('0x6')),'defaultValue':_0xfed1('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xfed1('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xfed1('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5e21bb2..ab99dfe 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 _0xcb82=['read','format','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','Sequelize','User','internal','motionChannel','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','attachments','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','sendStatus','stack','name','map','FaxMessage','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','find','update','body','describe','fax-interactions','accept','fax'];(function(_0x4d4cf5,_0x438e6a){var _0x4933a3=function(_0x271aa7){while(--_0x271aa7){_0x4d4cf5['push'](_0x4d4cf5['shift']());}};_0x4933a3(++_0x438e6a);}(_0xcb82,0x155));var _0x2cb8=function(_0x4edfec,_0x581a4a){_0x4edfec=_0x4edfec-0x0;var _0x22c10b=_0xcb82[_0x4edfec];return _0x22c10b;};'use strict';var emlformat=require(_0x2cb8('0x0'));var rimraf=require(_0x2cb8('0x1'));var zipdir=require(_0x2cb8('0x2'));var jsonpatch=require(_0x2cb8('0x3'));var rp=require(_0x2cb8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2cb8('0x5'));var util=require('util');var path=require(_0x2cb8('0x6'));var sox=require(_0x2cb8('0x7'));var csv=require(_0x2cb8('0x8'));var ejs=require(_0x2cb8('0x9'));var fs=require('fs');var fs_extra=require(_0x2cb8('0xa'));var _=require(_0x2cb8('0xb'));var squel=require(_0x2cb8('0xc'));var crypto=require(_0x2cb8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2cb8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2cb8('0xf'));var Papa=require(_0x2cb8('0x10'));var Redis=require('ioredis');var authService=require(_0x2cb8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2cb8('0x12'));var hardwareService=require(_0x2cb8('0x13'));var logger=require(_0x2cb8('0x14'))(_0x2cb8('0x15'));var utils=require(_0x2cb8('0x16'));var config=require(_0x2cb8('0x17'));var licenseUtil=require(_0x2cb8('0x18'));var db=require(_0x2cb8('0x19'))['db'];config[_0x2cb8('0x1a')]=_[_0x2cb8('0x1b')](config[_0x2cb8('0x1a')],{'host':_0x2cb8('0x1c'),'port':0x18eb});var socket=require(_0x2cb8('0x1d'))(new Redis(config['redis']));require(_0x2cb8('0x1e'))[_0x2cb8('0x1f')](socket);var jayson=require(_0x2cb8('0x20'));var client=jayson[_0x2cb8('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x2cb8('0x21')][_0x2cb8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2a459c,_0x1aa101,_0x37e931,_0x4afad0){return new BPromise(function(_0x33efdf,_0x2ae6ee){var _0x4e86c3=_0x4afad0||client;return _0x4e86c3[_0x2cb8('0x23')](_0x2a459c,_0x37e931)[_0x2cb8('0x24')](function(_0x137492){logger[_0x2cb8('0x25')](_0x2cb8('0x26'),_0x1aa101,_0x2cb8('0x27'));logger[_0x2cb8('0x28')](_0x2cb8('0x29'),_0x1aa101,_0x2cb8('0x27'),JSON[_0x2cb8('0x2a')](_0x137492));if(_0x137492[_0x2cb8('0x2b')]){if(_0x137492[_0x2cb8('0x2b')]['code']===0x1f4){logger[_0x2cb8('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x1aa101,_0x137492[_0x2cb8('0x2b')]['message']);return _0x2ae6ee(_0x137492['error'][_0x2cb8('0x2c')]);}logger[_0x2cb8('0x2b')](_0x2cb8('0x26'),_0x1aa101,_0x137492[_0x2cb8('0x2b')][_0x2cb8('0x2c')]);return _0x33efdf(_0x137492[_0x2cb8('0x2b')][_0x2cb8('0x2c')]);}else{logger[_0x2cb8('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1aa101,'request\x20sent');_0x33efdf(_0x137492[_0x2cb8('0x2d')][_0x2cb8('0x2c')]);}})['catch'](function(_0x30cf3e){logger[_0x2cb8('0x2b')](_0x2cb8('0x26'),_0x1aa101,_0x30cf3e);_0x2ae6ee(_0x30cf3e);});});}function respondWithStatusCode(_0x37f176,_0x2887e9){_0x2887e9=_0x2887e9||0xcc;return function(_0x55a5d2){if(_0x55a5d2){return _0x37f176['sendStatus'](_0x2887e9);}return _0x37f176[_0x2cb8('0x2e')](_0x2887e9)[_0x2cb8('0x2f')]();};}function respondWithResult(_0x273f72,_0x56d58a){_0x56d58a=_0x56d58a||0xc8;return function(_0x2205c8){if(_0x2205c8){return _0x273f72['status'](_0x56d58a)[_0x2cb8('0x30')](_0x2205c8);}};}function respondWithFilteredResult(_0x4936bf,_0x3deb61){return function(_0xc38354){if(_0xc38354){var _0x24ffa1=typeof _0x3deb61[_0x2cb8('0x31')]==='undefined'&&typeof _0x3deb61['limit']===_0x2cb8('0x32');var _0x108b91=_0xc38354[_0x2cb8('0x33')];var _0x2872a9=_0x24ffa1?0x0:_0x3deb61[_0x2cb8('0x31')];var _0x179324=_0x24ffa1?_0xc38354['count']:_0x3deb61[_0x2cb8('0x31')]+_0x3deb61[_0x2cb8('0x34')];var _0x1f7ee9;if(_0x179324>=_0x108b91){_0x179324=_0x108b91;_0x1f7ee9=0xc8;}else{_0x1f7ee9=0xce;}_0x4936bf[_0x2cb8('0x2e')](_0x1f7ee9);return _0x4936bf[_0x2cb8('0x35')](_0x2cb8('0x36'),_0x2872a9+'-'+_0x179324+'/'+_0x108b91)[_0x2cb8('0x30')](_0xc38354);}return null;};}function patchUpdates(_0x51d380){return function(_0x66a382){try{jsonpatch[_0x2cb8('0x37')](_0x66a382,_0x51d380,!![]);}catch(_0x46a64a){return BPromise[_0x2cb8('0x38')](_0x46a64a);}return _0x66a382[_0x2cb8('0x39')]();};}function saveUpdates(_0x5d647a,_0x47be94){return function(_0x11503d){if(_0x11503d){return _0x11503d['update'](_0x5d647a)['then'](function(_0x4df69e){return _0x4df69e;});}return null;};}function removeEntity(_0x514122,_0x5d0400){return function(_0x30efc9){if(_0x30efc9){return _0x30efc9['destroy']()[_0x2cb8('0x24')](function(){_0x514122['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x112799,_0x24d710){return function(_0x4e4f4c){if(!_0x4e4f4c){_0x112799[_0x2cb8('0x3a')](0x194);}return _0x4e4f4c;};}function handleError(_0x417a7e,_0x399932){_0x399932=_0x399932||0x1f4;return function(_0x3830ad){logger['error'](_0x3830ad[_0x2cb8('0x3b')]);if(_0x3830ad[_0x2cb8('0x3c')]){delete _0x3830ad['name'];}_0x417a7e[_0x2cb8('0x2e')](_0x399932)['send'](_0x3830ad);};}exports['index']=function(_0x3e36e2,_0x533494){var _0x4bc1c2={},_0x4c8159={},_0x5afc27={'count':0x0,'rows':[]};var _0x34ff55=_[_0x2cb8('0x3d')](db[_0x2cb8('0x3e')][_0x2cb8('0x3f')],function(_0x40c80c){return{'name':_0x40c80c[_0x2cb8('0x40')],'type':_0x40c80c['type']['key']};});_0x4c8159['model']=_[_0x2cb8('0x3d')](_0x34ff55,_0x2cb8('0x3c'));_0x4c8159[_0x2cb8('0x41')]=_[_0x2cb8('0x42')](_0x3e36e2[_0x2cb8('0x41')]);_0x4c8159[_0x2cb8('0x43')]=_[_0x2cb8('0x44')](_0x4c8159[_0x2cb8('0x45')],_0x4c8159['query']);_0x4bc1c2[_0x2cb8('0x46')]=_[_0x2cb8('0x44')](_0x4c8159['model'],qs[_0x2cb8('0x47')](_0x3e36e2[_0x2cb8('0x41')]['fields']));_0x4bc1c2[_0x2cb8('0x46')]=_0x4bc1c2[_0x2cb8('0x46')]['length']?_0x4bc1c2['attributes']:_0x4c8159[_0x2cb8('0x45')];if(!_0x3e36e2[_0x2cb8('0x41')]['hasOwnProperty'](_0x2cb8('0x48'))){_0x4bc1c2['limit']=qs['limit'](_0x3e36e2[_0x2cb8('0x41')][_0x2cb8('0x34')]);_0x4bc1c2['offset']=qs[_0x2cb8('0x31')](_0x3e36e2[_0x2cb8('0x41')][_0x2cb8('0x31')]);}_0x4bc1c2['order']=qs[_0x2cb8('0x49')](_0x3e36e2[_0x2cb8('0x41')][_0x2cb8('0x49')]);_0x4bc1c2[_0x2cb8('0x4a')]=qs[_0x2cb8('0x43')](_[_0x2cb8('0x4b')](_0x3e36e2[_0x2cb8('0x41')],_0x4c8159[_0x2cb8('0x43')]),_0x34ff55);if(_0x3e36e2[_0x2cb8('0x41')][_0x2cb8('0x4c')]){_0x4bc1c2['where']=_['merge'](_0x4bc1c2[_0x2cb8('0x4a')],{'$or':_[_0x2cb8('0x3d')](_0x34ff55,function(_0x1196ac){if(_0x1196ac[_0x2cb8('0x4d')]!==_0x2cb8('0x4e')){var _0x10846f={};_0x10846f[_0x1196ac[_0x2cb8('0x3c')]]={'$like':'%'+_0x3e36e2[_0x2cb8('0x41')]['filter']+'%'};return _0x10846f;}})});}_0x4bc1c2=_[_0x2cb8('0x4f')]({},_0x4bc1c2,_0x3e36e2['options']);var _0x4c2267={'where':_0x4bc1c2[_0x2cb8('0x4a')]};return db[_0x2cb8('0x3e')][_0x2cb8('0x33')](_0x4c2267)[_0x2cb8('0x24')](function(_0x1f6317){_0x5afc27['count']=_0x1f6317;if(_0x3e36e2[_0x2cb8('0x41')][_0x2cb8('0x50')]){_0x4bc1c2['include']=[{'all':!![]}];}return db[_0x2cb8('0x3e')][_0x2cb8('0x51')](_0x4bc1c2);})['then'](function(_0x3d7bcf){_0x5afc27[_0x2cb8('0x52')]=_0x3d7bcf;return _0x5afc27;})[_0x2cb8('0x24')](respondWithFilteredResult(_0x533494,_0x4bc1c2))[_0x2cb8('0x53')](handleError(_0x533494,null));};exports[_0x2cb8('0x54')]=function(_0x39beb1,_0x446add){var _0x1b72fb={'raw':!![],'where':{'id':_0x39beb1[_0x2cb8('0x55')]['id']}},_0x2ab151={};_0x2ab151[_0x2cb8('0x45')]=_[_0x2cb8('0x42')](db[_0x2cb8('0x3e')][_0x2cb8('0x3f')]);_0x2ab151['query']=_[_0x2cb8('0x42')](_0x39beb1['query']);_0x2ab151[_0x2cb8('0x43')]=_['intersection'](_0x2ab151[_0x2cb8('0x45')],_0x2ab151[_0x2cb8('0x41')]);_0x1b72fb[_0x2cb8('0x46')]=_[_0x2cb8('0x44')](_0x2ab151[_0x2cb8('0x45')],qs[_0x2cb8('0x47')](_0x39beb1['query'][_0x2cb8('0x47')]));_0x1b72fb[_0x2cb8('0x46')]=_0x1b72fb[_0x2cb8('0x46')]['length']?_0x1b72fb[_0x2cb8('0x46')]:_0x2ab151[_0x2cb8('0x45')];if(_0x39beb1[_0x2cb8('0x41')]['includeAll']){_0x1b72fb[_0x2cb8('0x56')]=[{'all':!![]}];}_0x1b72fb=_[_0x2cb8('0x4f')]({},_0x1b72fb,_0x39beb1['options']);return db[_0x2cb8('0x3e')][_0x2cb8('0x57')](_0x1b72fb)[_0x2cb8('0x24')](handleEntityNotFound(_0x446add,null))[_0x2cb8('0x24')](respondWithResult(_0x446add,null))['catch'](handleError(_0x446add,null));};exports[_0x2cb8('0x58')]=function(_0x36b15a,_0x408518){if(_0x36b15a[_0x2cb8('0x59')]['id']){delete _0x36b15a[_0x2cb8('0x59')]['id'];}return db[_0x2cb8('0x3e')]['find']({'where':{'id':_0x36b15a[_0x2cb8('0x55')]['id']}})[_0x2cb8('0x24')](handleEntityNotFound(_0x408518,null))[_0x2cb8('0x24')](saveUpdates(_0x36b15a[_0x2cb8('0x59')],null))[_0x2cb8('0x24')](respondWithResult(_0x408518,null))['catch'](handleError(_0x408518,null));};exports['destroy']=function(_0x4bd52c,_0x3379da){return db['FaxMessage']['find']({'where':{'id':_0x4bd52c[_0x2cb8('0x55')]['id']}})['then'](handleEntityNotFound(_0x3379da,null))[_0x2cb8('0x24')](removeEntity(_0x3379da,null))[_0x2cb8('0x53')](handleError(_0x3379da,null));};exports[_0x2cb8('0x5a')]=function(_0x4b4bc5,_0x22691d){return db['FaxMessage'][_0x2cb8('0x5a')]()[_0x2cb8('0x24')](respondWithResult(_0x22691d,null))[_0x2cb8('0x53')](handleError(_0x22691d,null));};var interaction_log=require('../../config/logger')(_0x2cb8('0x5b'));exports[_0x2cb8('0x5c')]=function(_0x1ba257,_0x5a5333,_0x4b24a2){var _0xaafcb4={'agent':{},'channel':_0x2cb8('0x5d')};if(_0x1ba257[_0x2cb8('0x59')]['id']){delete _0x1ba257[_0x2cb8('0x59')]['id'];}_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x5e')]=!![];_0x1ba257[_0x2cb8('0x59')]['readAt']=moment()[_0x2cb8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')]=_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')]||_0x1ba257['user']['id'];_0xaafcb4[_0x2cb8('0x61')]['id']=_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')];return db[_0x2cb8('0x3e')][_0x2cb8('0x57')]({'where':{'id':_0x1ba257[_0x2cb8('0x55')]['id'],'UserId':null}})[_0x2cb8('0x24')](handleEntityNotFound(_0x5a5333,null))['then'](saveUpdates(_0x1ba257[_0x2cb8('0x59')],null))[_0x2cb8('0x24')](function(_0x5f3c0c){if(_0x5f3c0c){_0xaafcb4['message']=_0x5f3c0c[_0x2cb8('0x62')]({'plain':!![]});return db[_0x2cb8('0x63')][_0x2cb8('0x57')]({'where':{'id':_0x5f3c0c[_0x2cb8('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x5a5333,null))[_0x2cb8('0x24')](function(_0x1b8f97){if(_0x1b8f97){return _0x1b8f97[_0x2cb8('0x58')]({'UserId':_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')],'read1stAt':_[_0x2cb8('0x65')](_0x1b8f97[_0x2cb8('0x66')])?moment()[_0x2cb8('0x5f')](_0x2cb8('0x67')):undefined});}return null;})['then'](function(_0x4e0cc4){if(_0x4e0cc4){_0xaafcb4[_0x2cb8('0x68')]=_0x4e0cc4[_0x2cb8('0x62')]({'plain':!![]});interaction_log['info'](_0x2cb8('0x69'),_0x1ba257[_0x2cb8('0x6a')]['id'],_0x1ba257[_0x2cb8('0x6a')]['name'],_0x1ba257[_0x2cb8('0x6a')][_0x2cb8('0x6b')],_0xaafcb4['interaction']['id'],_0x1ba257[_0x2cb8('0x59')]?JSON[_0x2cb8('0x2a')](_0x1ba257[_0x2cb8('0x59')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xaafcb4);}return null;})['then'](function(_0x492ebd){var _0x558086=_0x2cb8('0x6c')+_0x492ebd[_0x2cb8('0x2c')][_0x2cb8('0x6d')];return db['sequelize'][_0x2cb8('0x41')](_0x558086,{'type':db['Sequelize'][_0x2cb8('0x6e')][_0x2cb8('0x6f')],'raw':!![]})[_0x2cb8('0x24')](function(_0xb79c7f){return _0xb79c7f;});})[_0x2cb8('0x24')](function(_0x444bb4){if(_0x444bb4){_0xaafcb4[_0x2cb8('0x2c')][_0x2cb8('0x70')]=_0x444bb4[0x0];if(!_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')])return;return db['User'][_0x2cb8('0x57')]({'where':{'id':_0x1ba257[_0x2cb8('0x59')][_0x2cb8('0x60')],'role':_0x2cb8('0x61')},'attributes':['id',_0x2cb8('0x3c'),'fullname',_0x2cb8('0x71'),'internal'],'raw':!![]});}return null;})[_0x2cb8('0x24')](function(_0x460876){if(!_0x460876)return null;_0xaafcb4[_0x2cb8('0x2c')]['agent']=_0x460876;return _0xaafcb4;})[_0x2cb8('0x24')](function(_0x2560c9){if(_0x2560c9){if(_0x1ba257['body'][_0x2cb8('0x72')]){_0xaafcb4[_0x2cb8('0x2c')][_0x2cb8('0x73')]=util[_0x2cb8('0x5f')](_0x2cb8('0x74'),_0x1ba257[_0x2cb8('0x6a')][_0x2cb8('0x3c')]);_0xaafcb4[_0x2cb8('0x2c')][_0x2cb8('0x75')]=_0xaafcb4[_0x2cb8('0x75')];_0xaafcb4[_0x2cb8('0x2c')]['motionChannel']=_0xaafcb4[_0x2cb8('0x75')];_0xaafcb4['message'][_0x2cb8('0x76')]='accept';return respondWithRpcPromise(_0x2cb8('0x77'),_0x2cb8('0x77'),{'event':_0x2cb8('0x78'),'message':_0xaafcb4['message']},client9002)[_0x2cb8('0x24')](function(){return _0xaafcb4;});}return _0xaafcb4;}return null;})[_0x2cb8('0x24')](respondWithResult(_0x5a5333,null))[_0x2cb8('0x53')](handleError(_0x5a5333,null));};var interaction_log=require(_0x2cb8('0x14'))(_0x2cb8('0x5b'));exports[_0x2cb8('0x38')]=function(_0x1a8a9e,_0x5ec1bc,_0x58b18d){var _0x177ea8={'agent':{},'channel':_0x2cb8('0x5d')};if(_0x1a8a9e[_0x2cb8('0x59')]['id']){delete _0x1a8a9e[_0x2cb8('0x59')]['id'];}_0x1a8a9e[_0x2cb8('0x59')]['UserId']=_0x1a8a9e[_0x2cb8('0x59')][_0x2cb8('0x60')]||_0x1a8a9e[_0x2cb8('0x6a')]['id'];_0x177ea8[_0x2cb8('0x61')]['id']=_0x1a8a9e[_0x2cb8('0x59')][_0x2cb8('0x60')];return db['FaxMessage']['find']({'where':{'id':_0x1a8a9e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ec1bc,null))[_0x2cb8('0x24')](function(_0x5d2d22){if(_0x5d2d22){_0x177ea8['message']=_0x5d2d22[_0x2cb8('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x2cb8('0x57')]({'where':{'id':_0x5d2d22[_0x2cb8('0x64')]}});}return null;})[_0x2cb8('0x24')](handleEntityNotFound(_0x5ec1bc,null))['then'](function(_0x421448){if(_0x421448){_0x177ea8[_0x2cb8('0x68')]=_0x421448['get']({'plain':!![]});interaction_log[_0x2cb8('0x25')](_0x2cb8('0x79'),_0x1a8a9e['user']['id'],_0x1a8a9e['user']['name'],_0x1a8a9e[_0x2cb8('0x6a')][_0x2cb8('0x6b')],_0x177ea8[_0x2cb8('0x68')]['id'],_0x1a8a9e[_0x2cb8('0x59')]?JSON[_0x2cb8('0x2a')](_0x1a8a9e[_0x2cb8('0x59')]):_0x2cb8('0x7a'));return respondWithRpcPromise(_0x2cb8('0x7b'),_0x2cb8('0x7c'),_0x177ea8);}return null;})[_0x2cb8('0x24')](function(_0x103754){var _0xc787ee=_0x2cb8('0x6c')+_0x103754[_0x2cb8('0x2c')]['ContactId'];return db[_0x2cb8('0x7d')][_0x2cb8('0x41')](_0xc787ee,{'type':db[_0x2cb8('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2cb8('0x24')](function(_0x5b92bb){return _0x5b92bb;});})[_0x2cb8('0x24')](function(_0x3747fd){if(_0x3747fd){_0x177ea8[_0x2cb8('0x2c')][_0x2cb8('0x70')]=_0x3747fd[0x0];if(!_0x1a8a9e[_0x2cb8('0x59')][_0x2cb8('0x60')])return;return db[_0x2cb8('0x7f')][_0x2cb8('0x57')]({'where':{'id':_0x1a8a9e['body']['UserId'],'role':'agent'},'attributes':['id',_0x2cb8('0x3c'),'fullname','email',_0x2cb8('0x80')],'raw':!![]});}return null;})[_0x2cb8('0x24')](function(_0xb2ecff){if(!_0xb2ecff)return null;_0x177ea8[_0x2cb8('0x2c')][_0x2cb8('0x61')]=_0xb2ecff;return _0x177ea8;})[_0x2cb8('0x24')](function(_0x24b49c){if(_0x24b49c){_0x24b49c[_0x2cb8('0x2c')][_0x2cb8('0x73')]=util[_0x2cb8('0x5f')](_0x2cb8('0x74'),_0x1a8a9e['user']['name']);_0x24b49c[_0x2cb8('0x2c')][_0x2cb8('0x75')]=_0x177ea8[_0x2cb8('0x75')];_0x24b49c[_0x2cb8('0x2c')][_0x2cb8('0x81')]=_0x177ea8[_0x2cb8('0x75')];_0x24b49c[_0x2cb8('0x2c')][_0x2cb8('0x76')]=_0x2cb8('0x38');respondWithRpcPromise(_0x2cb8('0x77'),_0x2cb8('0x77'),{'event':_0x2cb8('0x82'),'message':_0x24b49c[_0x2cb8('0x2c')]},client9002);return _0x177ea8;}return null;})[_0x2cb8('0x24')](respondWithResult(_0x5ec1bc,null))[_0x2cb8('0x53')](handleError(_0x5ec1bc,null));};exports[_0x2cb8('0x83')]=function(_0x34ab90,_0x1cb581){var _0x41f1be;return db['FaxMessage'][_0x2cb8('0x83')](_0x34ab90[_0x2cb8('0x59')],{})[_0x2cb8('0x24')](function(_0x5e303f){_0x41f1be=_0x5e303f;return db[_0x2cb8('0x84')][_0x2cb8('0x85')]({'where':{'id':_0x41f1be[_0x2cb8('0x6d')]}});})[_0x2cb8('0x24')](function(_0x18a491){if(_['isNil'](_0x18a491)){return;}else{_0x41f1be['fax']=_0x18a491[_0x2cb8('0x5d')];return db['Attachment'][_0x2cb8('0x85')]({'where':{'id':_0x41f1be[_0x2cb8('0x86')]}});}})[_0x2cb8('0x24')](function(_0x1d09e4){return respondWithRpcPromise(_0x2cb8('0x87'),'SendFax',{'FaxAccountId':_[_0x2cb8('0x65')](_0x34ab90['body'])?undefined:_0x34ab90['body'][_0x2cb8('0x88')],'path':_[_0x2cb8('0x65')](_0x1d09e4)?undefined:util[_0x2cb8('0x5f')](_0x2cb8('0x89'),_0x1d09e4[_0x2cb8('0x8a')]),'fax':_['isNil'](_0x41f1be[_0x2cb8('0x5d')])?undefined:_0x41f1be['fax'],'AttachmentId':_0x41f1be[_0x2cb8('0x86')]},client9002);})[_0x2cb8('0x24')](respondWithResult(_0x1cb581,0xc9))[_0x2cb8('0x53')](handleError(_0x1cb581,null));};exports[_0x2cb8('0x8b')]=function(_0x392446,_0x1fcb41){var _0x2477c4=path['join'](config[_0x2cb8('0x8c')],_0x2cb8('0x8d'),'files',_0x2cb8('0x8e'));return db['FaxMessage']['find']({'where':{'id':_0x392446[_0x2cb8('0x55')]['id']},'include':[{'model':db[_0x2cb8('0x8f')],'as':'Attachment'}]})[_0x2cb8('0x24')](handleEntityNotFound(_0x1fcb41,null))[_0x2cb8('0x24')](function(_0x31ac43){if(_0x31ac43){return _0x1fcb41[_0x2cb8('0x8b')](path[_0x2cb8('0x90')](_0x2477c4,_0x31ac43[_0x2cb8('0x8f')]['basename']));}})[_0x2cb8('0x53')](handleError(_0x1fcb41,null));}; \ No newline at end of file +var _0xa897=['request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','find','body','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','interaction','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','agent','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','QueryTypes','email','interface','rejectmessage','create','findOne','fax','Attachment','SendFax','isNil','/var/opt/motion2/server/files/attachments/%s','basename','join','files','download','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','http','request','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s'];(function(_0x11c74e,_0x26ac28){var _0x59d683=function(_0x1447e9){while(--_0x1447e9){_0x11c74e['push'](_0x11c74e['shift']());}};_0x59d683(++_0x26ac28);}(_0xa897,0xed));var _0x7a89=function(_0x428534,_0x19c3bd){_0x428534=_0x428534-0x0;var _0xdc40fb=_0xa897[_0x428534];return _0xdc40fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a89('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a89('0x1'));var moment=require(_0x7a89('0x2'));var BPromise=require(_0x7a89('0x3'));var Mustache=require(_0x7a89('0x4'));var util=require('util');var path=require(_0x7a89('0x5'));var sox=require(_0x7a89('0x6'));var csv=require('to-csv');var ejs=require(_0x7a89('0x7'));var fs=require('fs');var fs_extra=require(_0x7a89('0x8'));var _=require('lodash');var squel=require(_0x7a89('0x9'));var crypto=require(_0x7a89('0xa'));var jsforce=require(_0x7a89('0xb'));var deskjs=require(_0x7a89('0xc'));var toCsv=require(_0x7a89('0xd'));var querystring=require('querystring');var Papa=require(_0x7a89('0xe'));var Redis=require(_0x7a89('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a89('0x10'));var as=require(_0x7a89('0x11'));var hardwareService=require(_0x7a89('0x12'));var logger=require(_0x7a89('0x13'))(_0x7a89('0x14'));var utils=require(_0x7a89('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7a89('0x16'));var db=require(_0x7a89('0x17'))['db'];config[_0x7a89('0x18')]=_[_0x7a89('0x19')](config['redis'],{'host':_0x7a89('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a89('0x18')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x7a89('0x1b'));var client=jayson['client'][_0x7a89('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x111436,_0x225e68,_0x1b990c,_0x187921){return new BPromise(function(_0x200bfa,_0x7eed4c){var _0x391590=_0x187921||client;return _0x391590[_0x7a89('0x1d')](_0x111436,_0x1b990c)[_0x7a89('0x1e')](function(_0x2d4714){logger['info'](_0x7a89('0x1f'),_0x225e68,'request\x20sent');logger['debug'](_0x7a89('0x20'),_0x225e68,_0x7a89('0x21'),JSON[_0x7a89('0x22')](_0x2d4714));if(_0x2d4714[_0x7a89('0x23')]){if(_0x2d4714[_0x7a89('0x23')]['code']===0x1f4){logger[_0x7a89('0x23')](_0x7a89('0x1f'),_0x225e68,_0x2d4714[_0x7a89('0x23')][_0x7a89('0x24')]);return _0x7eed4c(_0x2d4714[_0x7a89('0x23')][_0x7a89('0x24')]);}logger[_0x7a89('0x23')](_0x7a89('0x1f'),_0x225e68,_0x2d4714[_0x7a89('0x23')][_0x7a89('0x24')]);return _0x200bfa(_0x2d4714[_0x7a89('0x23')][_0x7a89('0x24')]);}else{logger[_0x7a89('0x25')](_0x7a89('0x1f'),_0x225e68,_0x7a89('0x21'));_0x200bfa(_0x2d4714[_0x7a89('0x26')][_0x7a89('0x24')]);}})[_0x7a89('0x27')](function(_0x135f56){logger['error'](_0x7a89('0x1f'),_0x225e68,_0x135f56);_0x7eed4c(_0x135f56);});});}function respondWithStatusCode(_0x12279b,_0x12b999){_0x12b999=_0x12b999||0xcc;return function(_0x2331e7){if(_0x2331e7){return _0x12279b[_0x7a89('0x28')](_0x12b999);}return _0x12279b['status'](_0x12b999)['end']();};}function respondWithResult(_0x525f1d,_0x5c2687){_0x5c2687=_0x5c2687||0xc8;return function(_0x43eaa6){if(_0x43eaa6){return _0x525f1d[_0x7a89('0x29')](_0x5c2687)['json'](_0x43eaa6);}};}function respondWithFilteredResult(_0x4d7b70,_0x136eb6){return function(_0x3df0d3){if(_0x3df0d3){var _0x10b010=typeof _0x136eb6['offset']===_0x7a89('0x2a')&&typeof _0x136eb6[_0x7a89('0x2b')]===_0x7a89('0x2a');var _0x49d77c=_0x3df0d3[_0x7a89('0x2c')];var _0x2cad58=_0x10b010?0x0:_0x136eb6[_0x7a89('0x2d')];var _0x648936=_0x10b010?_0x3df0d3[_0x7a89('0x2c')]:_0x136eb6[_0x7a89('0x2d')]+_0x136eb6[_0x7a89('0x2b')];var _0x6895;if(_0x648936>=_0x49d77c){_0x648936=_0x49d77c;_0x6895=0xc8;}else{_0x6895=0xce;}_0x4d7b70['status'](_0x6895);return _0x4d7b70[_0x7a89('0x2e')](_0x7a89('0x2f'),_0x2cad58+'-'+_0x648936+'/'+_0x49d77c)[_0x7a89('0x30')](_0x3df0d3);}return null;};}function patchUpdates(_0x149b1b){return function(_0x1f28bc){try{jsonpatch[_0x7a89('0x31')](_0x1f28bc,_0x149b1b,!![]);}catch(_0x5079c4){return BPromise[_0x7a89('0x32')](_0x5079c4);}return _0x1f28bc['save']();};}function saveUpdates(_0x94dda9,_0x356e33){return function(_0x43bfbf){if(_0x43bfbf){return _0x43bfbf[_0x7a89('0x33')](_0x94dda9)[_0x7a89('0x1e')](function(_0x19cc3a){return _0x19cc3a;});}return null;};}function removeEntity(_0x2b8198,_0x53748c){return function(_0xc292a2){if(_0xc292a2){return _0xc292a2[_0x7a89('0x34')]()[_0x7a89('0x1e')](function(){_0x2b8198['status'](0xcc)[_0x7a89('0x35')]();});}};}function handleEntityNotFound(_0x265219,_0x4fc29c){return function(_0x17a485){if(!_0x17a485){_0x265219[_0x7a89('0x28')](0x194);}return _0x17a485;};}function handleError(_0xf18aa3,_0x4c61f9){_0x4c61f9=_0x4c61f9||0x1f4;return function(_0x56037b){logger['error'](_0x56037b[_0x7a89('0x36')]);if(_0x56037b['name']){delete _0x56037b[_0x7a89('0x37')];}_0xf18aa3['status'](_0x4c61f9)[_0x7a89('0x38')](_0x56037b);};}exports[_0x7a89('0x39')]=function(_0x244981,_0x42f492){var _0x55c233={},_0xbd234a={},_0x42996c={'count':0x0,'rows':[]};var _0x2677b1=_[_0x7a89('0x3a')](db[_0x7a89('0x3b')][_0x7a89('0x3c')],function(_0x1c3eb1){return{'name':_0x1c3eb1[_0x7a89('0x3d')],'type':_0x1c3eb1[_0x7a89('0x3e')][_0x7a89('0x3f')]};});_0xbd234a[_0x7a89('0x40')]=_['map'](_0x2677b1,_0x7a89('0x37'));_0xbd234a['query']=_[_0x7a89('0x41')](_0x244981['query']);_0xbd234a[_0x7a89('0x42')]=_[_0x7a89('0x43')](_0xbd234a['model'],_0xbd234a[_0x7a89('0x44')]);_0x55c233['attributes']=_['intersection'](_0xbd234a[_0x7a89('0x40')],qs[_0x7a89('0x45')](_0x244981[_0x7a89('0x44')][_0x7a89('0x45')]));_0x55c233[_0x7a89('0x46')]=_0x55c233['attributes'][_0x7a89('0x47')]?_0x55c233[_0x7a89('0x46')]:_0xbd234a[_0x7a89('0x40')];if(!_0x244981[_0x7a89('0x44')][_0x7a89('0x48')](_0x7a89('0x49'))){_0x55c233[_0x7a89('0x2b')]=qs[_0x7a89('0x2b')](_0x244981[_0x7a89('0x44')]['limit']);_0x55c233[_0x7a89('0x2d')]=qs[_0x7a89('0x2d')](_0x244981[_0x7a89('0x44')]['offset']);}_0x55c233[_0x7a89('0x4a')]=qs['sort'](_0x244981['query']['sort']);_0x55c233['where']=qs[_0x7a89('0x42')](_[_0x7a89('0x4b')](_0x244981[_0x7a89('0x44')],_0xbd234a[_0x7a89('0x42')]),_0x2677b1);if(_0x244981[_0x7a89('0x44')]['filter']){_0x55c233[_0x7a89('0x4c')]=_[_0x7a89('0x4d')](_0x55c233[_0x7a89('0x4c')],{'$or':_[_0x7a89('0x3a')](_0x2677b1,function(_0x24d2d3){if(_0x24d2d3[_0x7a89('0x3e')]!==_0x7a89('0x4e')){var _0x7b3822={};_0x7b3822[_0x24d2d3[_0x7a89('0x37')]]={'$like':'%'+_0x244981[_0x7a89('0x44')][_0x7a89('0x4f')]+'%'};return _0x7b3822;}})});}_0x55c233=_['merge']({},_0x55c233,_0x244981[_0x7a89('0x50')]);var _0x199677={'where':_0x55c233[_0x7a89('0x4c')]};return db[_0x7a89('0x3b')][_0x7a89('0x2c')](_0x199677)[_0x7a89('0x1e')](function(_0x2a9c3c){_0x42996c[_0x7a89('0x2c')]=_0x2a9c3c;if(_0x244981[_0x7a89('0x44')][_0x7a89('0x51')]){_0x55c233[_0x7a89('0x52')]=[{'all':!![]}];}return db[_0x7a89('0x3b')]['findAll'](_0x55c233);})[_0x7a89('0x1e')](function(_0x455db3){_0x42996c[_0x7a89('0x53')]=_0x455db3;return _0x42996c;})['then'](respondWithFilteredResult(_0x42f492,_0x55c233))[_0x7a89('0x27')](handleError(_0x42f492,null));};exports['show']=function(_0x471dde,_0x3629db){var _0x379f55={'raw':!![],'where':{'id':_0x471dde[_0x7a89('0x54')]['id']}},_0x1e50a0={};_0x1e50a0['model']=_['keys'](db[_0x7a89('0x3b')]['rawAttributes']);_0x1e50a0['query']=_[_0x7a89('0x41')](_0x471dde[_0x7a89('0x44')]);_0x1e50a0['filters']=_[_0x7a89('0x43')](_0x1e50a0[_0x7a89('0x40')],_0x1e50a0[_0x7a89('0x44')]);_0x379f55[_0x7a89('0x46')]=_[_0x7a89('0x43')](_0x1e50a0['model'],qs['fields'](_0x471dde['query']['fields']));_0x379f55[_0x7a89('0x46')]=_0x379f55['attributes'][_0x7a89('0x47')]?_0x379f55[_0x7a89('0x46')]:_0x1e50a0['model'];if(_0x471dde[_0x7a89('0x44')]['includeAll']){_0x379f55[_0x7a89('0x52')]=[{'all':!![]}];}_0x379f55=_[_0x7a89('0x4d')]({},_0x379f55,_0x471dde['options']);return db[_0x7a89('0x3b')][_0x7a89('0x55')](_0x379f55)[_0x7a89('0x1e')](handleEntityNotFound(_0x3629db,null))[_0x7a89('0x1e')](respondWithResult(_0x3629db,null))[_0x7a89('0x27')](handleError(_0x3629db,null));};exports[_0x7a89('0x33')]=function(_0x56be24,_0x4be4b9){if(_0x56be24[_0x7a89('0x56')]['id']){delete _0x56be24[_0x7a89('0x56')]['id'];}return db[_0x7a89('0x3b')]['find']({'where':{'id':_0x56be24[_0x7a89('0x54')]['id']}})[_0x7a89('0x1e')](handleEntityNotFound(_0x4be4b9,null))[_0x7a89('0x1e')](saveUpdates(_0x56be24[_0x7a89('0x56')],null))[_0x7a89('0x1e')](respondWithResult(_0x4be4b9,null))[_0x7a89('0x27')](handleError(_0x4be4b9,null));};exports[_0x7a89('0x34')]=function(_0x5a9a8e,_0x16caa7){return db[_0x7a89('0x3b')]['find']({'where':{'id':_0x5a9a8e[_0x7a89('0x54')]['id']}})[_0x7a89('0x1e')](handleEntityNotFound(_0x16caa7,null))['then'](removeEntity(_0x16caa7,null))['catch'](handleError(_0x16caa7,null));};exports['describe']=function(_0x1976d9,_0x5f482c){return db[_0x7a89('0x3b')][_0x7a89('0x57')]()[_0x7a89('0x1e')](respondWithResult(_0x5f482c,null))[_0x7a89('0x27')](handleError(_0x5f482c,null));};var interaction_log=require(_0x7a89('0x13'))(_0x7a89('0x58'));exports[_0x7a89('0x59')]=function(_0x4ccf87,_0x4b354,_0x218d82){var _0x3a8b52={'agent':{},'channel':'fax'};if(_0x4ccf87[_0x7a89('0x56')]['id']){delete _0x4ccf87[_0x7a89('0x56')]['id'];}_0x4ccf87[_0x7a89('0x56')][_0x7a89('0x5a')]=!![];_0x4ccf87[_0x7a89('0x56')]['readAt']=moment()[_0x7a89('0x5b')](_0x7a89('0x5c'));_0x4ccf87[_0x7a89('0x56')]['UserId']=_0x4ccf87[_0x7a89('0x56')][_0x7a89('0x5d')]||_0x4ccf87['user']['id'];_0x3a8b52['agent']['id']=_0x4ccf87[_0x7a89('0x56')]['UserId'];return db[_0x7a89('0x3b')][_0x7a89('0x55')]({'where':{'id':_0x4ccf87[_0x7a89('0x54')]['id'],'UserId':null}})[_0x7a89('0x1e')](handleEntityNotFound(_0x4b354,null))[_0x7a89('0x1e')](saveUpdates(_0x4ccf87[_0x7a89('0x56')],null))['then'](function(_0x31ac46){if(_0x31ac46){_0x3a8b52['message']=_0x31ac46[_0x7a89('0x5e')]({'plain':!![]});return db[_0x7a89('0x5f')][_0x7a89('0x55')]({'where':{'id':_0x31ac46[_0x7a89('0x60')]}});}return null;})[_0x7a89('0x1e')](handleEntityNotFound(_0x4b354,null))['then'](function(_0x27c014){if(_0x27c014){return _0x27c014[_0x7a89('0x33')]({'UserId':_0x4ccf87[_0x7a89('0x56')]['UserId'],'read1stAt':_['isNil'](_0x27c014['read1stAt'])?moment()[_0x7a89('0x5b')](_0x7a89('0x5c')):undefined});}return null;})['then'](function(_0x2a921f){if(_0x2a921f){_0x3a8b52[_0x7a89('0x61')]=_0x2a921f[_0x7a89('0x5e')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ccf87['user']['id'],_0x4ccf87[_0x7a89('0x62')][_0x7a89('0x37')],_0x4ccf87[_0x7a89('0x62')][_0x7a89('0x63')],_0x3a8b52[_0x7a89('0x61')]['id'],_0x4ccf87['body']?JSON[_0x7a89('0x22')](_0x4ccf87[_0x7a89('0x56')]):_0x7a89('0x64'));return respondWithRpcPromise(_0x7a89('0x65'),_0x7a89('0x66'),_0x3a8b52);}return null;})[_0x7a89('0x1e')](function(_0x4435c4){var _0x42445d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4435c4[_0x7a89('0x24')][_0x7a89('0x67')];return db[_0x7a89('0x68')][_0x7a89('0x44')](_0x42445d,{'type':db[_0x7a89('0x69')]['QueryTypes'][_0x7a89('0x6a')],'raw':!![]})[_0x7a89('0x1e')](function(_0x59363b){return _0x59363b;});})['then'](function(_0x25f0e0){if(_0x25f0e0){_0x3a8b52[_0x7a89('0x24')][_0x7a89('0x6b')]=_0x25f0e0[0x0];if(!_0x4ccf87['body'][_0x7a89('0x5d')])return;return db['User'][_0x7a89('0x55')]({'where':{'id':_0x4ccf87[_0x7a89('0x56')][_0x7a89('0x5d')],'role':_0x7a89('0x6c')},'attributes':['id','name',_0x7a89('0x6d'),'email',_0x7a89('0x6e')],'raw':!![]});}return null;})[_0x7a89('0x1e')](function(_0x1f9363){if(!_0x1f9363)return null;_0x3a8b52['message'][_0x7a89('0x6c')]=_0x1f9363;return _0x3a8b52;})[_0x7a89('0x1e')](function(_0x20c504){if(_0x20c504){if(_0x4ccf87[_0x7a89('0x56')][_0x7a89('0x6f')]){_0x3a8b52[_0x7a89('0x24')]['interface']=util['format'](_0x7a89('0x70'),_0x4ccf87['user'][_0x7a89('0x37')]);_0x3a8b52[_0x7a89('0x24')][_0x7a89('0x71')]=_0x3a8b52[_0x7a89('0x71')];_0x3a8b52[_0x7a89('0x24')][_0x7a89('0x72')]=_0x3a8b52[_0x7a89('0x71')];_0x3a8b52['message'][_0x7a89('0x73')]=_0x7a89('0x59');return respondWithRpcPromise(_0x7a89('0x74'),_0x7a89('0x74'),{'event':_0x7a89('0x75'),'message':_0x3a8b52['message']},client9002)[_0x7a89('0x1e')](function(){return _0x3a8b52;});}return _0x3a8b52;}return null;})[_0x7a89('0x1e')](respondWithResult(_0x4b354,null))['catch'](handleError(_0x4b354,null));};var interaction_log=require('../../config/logger')(_0x7a89('0x58'));exports[_0x7a89('0x32')]=function(_0x5607e6,_0x2e8d28,_0x50e2b3){var _0x269d4c={'agent':{},'channel':'fax'};if(_0x5607e6[_0x7a89('0x56')]['id']){delete _0x5607e6[_0x7a89('0x56')]['id'];}_0x5607e6[_0x7a89('0x56')][_0x7a89('0x5d')]=_0x5607e6[_0x7a89('0x56')][_0x7a89('0x5d')]||_0x5607e6[_0x7a89('0x62')]['id'];_0x269d4c[_0x7a89('0x6c')]['id']=_0x5607e6[_0x7a89('0x56')][_0x7a89('0x5d')];return db['FaxMessage'][_0x7a89('0x55')]({'where':{'id':_0x5607e6[_0x7a89('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e8d28,null))[_0x7a89('0x1e')](function(_0x3fb382){if(_0x3fb382){_0x269d4c[_0x7a89('0x24')]=_0x3fb382[_0x7a89('0x5e')]({'plain':!![]});return db['FaxInteraction'][_0x7a89('0x55')]({'where':{'id':_0x3fb382[_0x7a89('0x60')]}});}return null;})[_0x7a89('0x1e')](handleEntityNotFound(_0x2e8d28,null))['then'](function(_0x47ef51){if(_0x47ef51){_0x269d4c[_0x7a89('0x61')]=_0x47ef51[_0x7a89('0x5e')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5607e6[_0x7a89('0x62')]['id'],_0x5607e6[_0x7a89('0x62')][_0x7a89('0x37')],_0x5607e6[_0x7a89('0x62')][_0x7a89('0x63')],_0x269d4c['interaction']['id'],_0x5607e6[_0x7a89('0x56')]?JSON[_0x7a89('0x22')](_0x5607e6['body']):_0x7a89('0x64'));return respondWithRpcPromise(_0x7a89('0x76'),_0x7a89('0x77'),_0x269d4c);}return null;})[_0x7a89('0x1e')](function(_0x359e34){var _0x17d2d5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x359e34[_0x7a89('0x24')][_0x7a89('0x67')];return db['sequelize']['query'](_0x17d2d5,{'type':db[_0x7a89('0x69')][_0x7a89('0x78')][_0x7a89('0x6a')],'raw':!![]})[_0x7a89('0x1e')](function(_0x14746a){return _0x14746a;});})[_0x7a89('0x1e')](function(_0x1977aa){if(_0x1977aa){_0x269d4c[_0x7a89('0x24')][_0x7a89('0x6b')]=_0x1977aa[0x0];if(!_0x5607e6[_0x7a89('0x56')][_0x7a89('0x5d')])return;return db['User']['find']({'where':{'id':_0x5607e6[_0x7a89('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x7a89('0x37'),'fullname',_0x7a89('0x79'),_0x7a89('0x6e')],'raw':!![]});}return null;})[_0x7a89('0x1e')](function(_0x4a8a2a){if(!_0x4a8a2a)return null;_0x269d4c['message'][_0x7a89('0x6c')]=_0x4a8a2a;return _0x269d4c;})[_0x7a89('0x1e')](function(_0x295214){if(_0x295214){_0x295214[_0x7a89('0x24')][_0x7a89('0x7a')]=util['format'](_0x7a89('0x70'),_0x5607e6[_0x7a89('0x62')]['name']);_0x295214[_0x7a89('0x24')][_0x7a89('0x71')]=_0x269d4c[_0x7a89('0x71')];_0x295214[_0x7a89('0x24')][_0x7a89('0x72')]=_0x269d4c[_0x7a89('0x71')];_0x295214[_0x7a89('0x24')]['event']='reject';respondWithRpcPromise(_0x7a89('0x74'),_0x7a89('0x74'),{'event':_0x7a89('0x7b'),'message':_0x295214['message']},client9002);return _0x269d4c;}return null;})[_0x7a89('0x1e')](respondWithResult(_0x2e8d28,null))[_0x7a89('0x27')](handleError(_0x2e8d28,null));};exports[_0x7a89('0x7c')]=function(_0x39b984,_0x8ea85d){var _0x30f236;return db[_0x7a89('0x3b')]['create'](_0x39b984[_0x7a89('0x56')],{})['then'](function(_0x132344){_0x30f236=_0x132344;return db['CmContact'][_0x7a89('0x7d')]({'where':{'id':_0x30f236[_0x7a89('0x67')]}});})[_0x7a89('0x1e')](function(_0x495bfd){if(_['isNil'](_0x495bfd)){return;}else{_0x30f236[_0x7a89('0x7e')]=_0x495bfd[_0x7a89('0x7e')];return db[_0x7a89('0x7f')][_0x7a89('0x7d')]({'where':{'id':_0x30f236['AttachmentId']}});}})[_0x7a89('0x1e')](function(_0x104fbd){return respondWithRpcPromise('SendFax',_0x7a89('0x80'),{'FaxAccountId':_['isNil'](_0x39b984['body'])?undefined:_0x39b984['body']['FaxAccountId'],'path':_[_0x7a89('0x81')](_0x104fbd)?undefined:util[_0x7a89('0x5b')](_0x7a89('0x82'),_0x104fbd[_0x7a89('0x83')]),'fax':_[_0x7a89('0x81')](_0x30f236[_0x7a89('0x7e')])?undefined:_0x30f236['fax'],'AttachmentId':_0x30f236['AttachmentId']},client9002);})[_0x7a89('0x1e')](respondWithResult(_0x8ea85d,0xc9))[_0x7a89('0x27')](handleError(_0x8ea85d,null));};exports['download']=function(_0x1fb9f6,_0x546ea4){var _0x10eedb=path[_0x7a89('0x84')](config['root'],'server',_0x7a89('0x85'),'attachments');return db[_0x7a89('0x3b')][_0x7a89('0x55')]({'where':{'id':_0x1fb9f6[_0x7a89('0x54')]['id']},'include':[{'model':db[_0x7a89('0x7f')],'as':_0x7a89('0x7f')}]})[_0x7a89('0x1e')](handleEntityNotFound(_0x546ea4,null))[_0x7a89('0x1e')](function(_0x370456){if(_0x370456){return _0x546ea4[_0x7a89('0x86')](path[_0x7a89('0x84')](_0x10eedb,_0x370456['Attachment'][_0x7a89('0x83')]));}})[_0x7a89('0x27')](handleError(_0x546ea4,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3a2c6d5..da58f7b 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 _0xad68=['remove','emit','hook','exports','FaxMessage','setMaxListeners'];(function(_0x5f2fea,_0x9fde07){var _0x198a0c=function(_0x2bb11a){while(--_0x2bb11a){_0x5f2fea['push'](_0x5f2fea['shift']());}};_0x198a0c(++_0x9fde07);}(_0xad68,0x100));var _0x8ad6=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xad68[_0x543242];return _0x4c99b6;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x8ad6('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8ad6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8ad6('0x2')};function emitEvent(_0x2b533e){return function(_0x186cec,_0x1aec69,_0x11451d){FaxMessageEvents[_0x8ad6('0x3')](_0x2b533e+':'+_0x186cec['id'],_0x186cec);FaxMessageEvents[_0x8ad6('0x3')](_0x2b533e,_0x186cec);_0x11451d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x8ad6('0x4')](e,emitEvent(event));}}module[_0x8ad6('0x5')]=FaxMessageEvents; \ No newline at end of file +var _0xe797=['emit','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update'];(function(_0x5a06dc,_0x3c5691){var _0x2e6434=function(_0x11cefe){while(--_0x11cefe){_0x5a06dc['push'](_0x5a06dc['shift']());}};_0x2e6434(++_0x3c5691);}(_0xe797,0x12a));var _0x7e79=function(_0x4f85da,_0x4e205c){_0x4f85da=_0x4f85da-0x0;var _0x2bd5c3=_0xe797[_0x4f85da];return _0x2bd5c3;};'use strict';var EventEmitter=require(_0x7e79('0x0'));var FaxMessage=require(_0x7e79('0x1'))['db'][_0x7e79('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7e79('0x3')](0x0);var events={'afterCreate':_0x7e79('0x4'),'afterUpdate':_0x7e79('0x5'),'afterDestroy':'remove'};function emitEvent(_0x214cdc){return function(_0x22a597,_0x5ba3bf,_0x2053c1){FaxMessageEvents[_0x7e79('0x6')](_0x214cdc+':'+_0x22a597['id'],_0x22a597);FaxMessageEvents[_0x7e79('0x6')](_0x214cdc,_0x22a597);_0x2053c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7e79('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index effa0db..6409ff3 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 _0x4e2f=['FaxInteraction','findOne','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x1612e9,_0x272ff8){var _0x5a39fd=function(_0x358eb9){while(--_0x358eb9){_0x1612e9['push'](_0x1612e9['shift']());}};_0x5a39fd(++_0x272ff8);}(_0x4e2f,0x157));var _0xf4e2=function(_0x180edc,_0x2be29c){_0x180edc=_0x180edc-0x0;var _0x15cbe2=_0x4e2f[_0x180edc];return _0x15cbe2;};'use strict';var _=require(_0xf4e2('0x0'));var util=require('util');var logger=require(_0xf4e2('0x1'))('api');var moment=require(_0xf4e2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4e2('0x3'));var rimraf=require(_0xf4e2('0x4'));var config=require(_0xf4e2('0x5'));var attributes=require(_0xf4e2('0x6'));module[_0xf4e2('0x7')]=function(_0x4d1e4b,_0x4b7d90){return _0x4d1e4b[_0xf4e2('0x8')](_0xf4e2('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xf4e2('0xa'),'fields':[_0xf4e2('0xb')],'type':_0xf4e2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40e14f,_0x2bdb10,_0x3d4683){var _0x94e21=_0x4d1e4b[_0xf4e2('0xd')];var _0x19d7ca=_0x40e14f[_0xf4e2('0xe')]({'plain':!![]});if(_0x19d7ca[_0xf4e2('0xf')][_0xf4e2('0x10')]()==='in'||_0x19d7ca[_0xf4e2('0xf')][_0xf4e2('0x10')]()===_0xf4e2('0x11')&&!_0x19d7ca[_0xf4e2('0x12')]&&!_[_0xf4e2('0x13')](_0x19d7ca[_0xf4e2('0x14')])){_0x94e21[_0xf4e2('0x15')][_0xf4e2('0x16')]({'where':{'id':_0x19d7ca['FaxInteractionId']}})['then'](function(_0x369b54){if(_0x369b54){_0x369b54[_0xf4e2('0x17')]({'lastMsgAt':_0x19d7ca[_0xf4e2('0x18')],'lastMsgDirection':_0x19d7ca[_0xf4e2('0xf')]['toLowerCase']()});}})[_0xf4e2('0x19')](function(_0x3074b8){console[_0xf4e2('0x1a')](_0x3074b8);});}_0x3d4683();}},'charset':_0xf4e2('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9c9f=['moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','error','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x9c9f,0x1ea));var _0xf9c9=function(_0x2cccdf,_0x512ddf){_0x2cccdf=_0x2cccdf-0x0;var _0xca3cab=_0x9c9f[_0x2cccdf];return _0xca3cab;};'use strict';var _=require(_0xf9c9('0x0'));var util=require('util');var logger=require(_0xf9c9('0x1'))(_0xf9c9('0x2'));var moment=require(_0xf9c9('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9c9('0x4'));var fs=require('fs');var path=require(_0xf9c9('0x5'));var rimraf=require(_0xf9c9('0x6'));var config=require(_0xf9c9('0x7'));var attributes=require(_0xf9c9('0x8'));module[_0xf9c9('0x9')]=function(_0x1dd41e,_0x1b0b07){return _0x1dd41e[_0xf9c9('0xa')](_0xf9c9('0xb'),attributes,{'tableName':_0xf9c9('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xf9c9('0xd')],'type':_0xf9c9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f8b29,_0x279aed,_0x234546){var _0x5976b1=_0x1dd41e['models'];var _0x323119=_0x4f8b29[_0xf9c9('0xf')]({'plain':!![]});if(_0x323119[_0xf9c9('0x10')][_0xf9c9('0x11')]()==='in'||_0x323119[_0xf9c9('0x10')][_0xf9c9('0x11')]()===_0xf9c9('0x12')&&!_0x323119[_0xf9c9('0x13')]&&!_[_0xf9c9('0x14')](_0x323119[_0xf9c9('0x15')])){_0x5976b1[_0xf9c9('0x16')][_0xf9c9('0x17')]({'where':{'id':_0x323119[_0xf9c9('0x18')]}})['then'](function(_0x2f75e7){if(_0x2f75e7){_0x2f75e7[_0xf9c9('0x19')]({'lastMsgAt':_0x323119[_0xf9c9('0x1a')],'lastMsgDirection':_0x323119[_0xf9c9('0x10')]['toLowerCase']()});}})['catch'](function(_0x4ff35a){console[_0xf9c9('0x1b')](_0x4ff35a);});}_0x234546();}},'charset':'utf8mb4','collate':_0xf9c9('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 2d3c433..763243f 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 _0x9a19=['http','redis','socket.io-emitter','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','update','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x9a19,0x114));var _0x99a1=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x9a19[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});config[_0x99a1('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x99a1('0xe'))(new Redis(config[_0x99a1('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4696f6,_0xd7b568,_0x23db53){return new BPromise(function(_0x26473f,_0x1551a1){return client['request'](_0x4696f6,_0x23db53)[_0x99a1('0xf')](function(_0xdd29e1){logger[_0x99a1('0x10')](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));logger[_0x99a1('0x13')](_0x99a1('0x14'),_0xd7b568,_0x99a1('0x12'),JSON[_0x99a1('0x15')](_0xdd29e1));if(_0xdd29e1[_0x99a1('0x16')]){if(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x17')]===0x1f4){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')]['message']);return _0x1551a1(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);}logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);return _0x26473f(_0xdd29e1[_0x99a1('0x16')]['message']);}else{logger['info'](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));_0x26473f(_0xdd29e1[_0x99a1('0x19')][_0x99a1('0x18')]);}})[_0x99a1('0x1a')](function(_0x209021){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0x209021);_0x1551a1(_0x209021);});});}exports[_0x99a1('0x1b')]=function(_0x2d8cac){var _0x3c23c0=this;return new Promise(function(_0x5eabcb,_0x3023a1){return db[_0x99a1('0x1c')]['create'](_0x2d8cac[_0x99a1('0x1d')],{'raw':_0x2d8cac['options']?_0x2d8cac[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![]})[_0x99a1('0xf')](function(_0x2d3b82){logger['info'](_0x99a1('0x1b'),_0x2d8cac);logger[_0x99a1('0x13')]('CreateFaxMessage',_0x2d8cac,JSON[_0x99a1('0x15')](_0x2d3b82));_0x5eabcb(_0x2d3b82);})['catch'](function(_0x1f9800){logger[_0x99a1('0x16')](_0x99a1('0x1b'),_0x1f9800[_0x99a1('0x18')],_0x2d8cac);_0x3023a1(_0x3c23c0[_0x99a1('0x16')](0x1f4,_0x1f9800[_0x99a1('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x114b38){var _0x5dabd9=this;return new Promise(function(_0x5dc733,_0xafea84){return db[_0x99a1('0x1c')][_0x99a1('0x20')](_0x114b38[_0x99a1('0x1d')],{'raw':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')]['where']||null:null,'attributes':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x21')]||null:null,'limit':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x22')]||null:null})['then'](function(_0x37514e){logger[_0x99a1('0x10')](_0x99a1('0x23'),_0x114b38);logger[_0x99a1('0x13')](_0x99a1('0x23'),_0x114b38,JSON[_0x99a1('0x15')](_0x37514e));_0x5dc733(_0x37514e);})[_0x99a1('0x1a')](function(_0x26c23c){logger['error']('UpdateFaxMessage',_0x26c23c[_0x99a1('0x18')],_0x114b38);_0xafea84(_0x5dabd9['error'](0x1f4,_0x26c23c[_0x99a1('0x18')]));});});}; \ No newline at end of file +var _0x9bde=['body','options','raw','CreateFaxMessage','debug','UpdateFaxMessage','limit','then','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxMessage','create'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9bde,0xe1));var _0xe9bd=function(_0x55626a,_0x26e14e){_0x55626a=_0x55626a-0x0;var _0x17c7be=_0x9bde[_0x55626a];return _0x17c7be;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});config[_0xe9bd('0xa')]=_[_0xe9bd('0xb')](config[_0xe9bd('0xa')],{'host':_0xe9bd('0xc'),'port':0x18eb});var socket=require(_0xe9bd('0xd'))(new Redis(config[_0xe9bd('0xa')]));require(_0xe9bd('0xe'))[_0xe9bd('0xf')](socket);function respondWithRpcPromise(_0x45c7ba,_0x581602,_0x5f36c8){return new BPromise(function(_0x3c8e95,_0x145521){return client[_0xe9bd('0x10')](_0x45c7ba,_0x5f36c8)['then'](function(_0x12c96e){logger[_0xe9bd('0x11')](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));logger['debug'](_0xe9bd('0x14'),_0x581602,'request\x20sent',JSON[_0xe9bd('0x15')](_0x12c96e));if(_0x12c96e[_0xe9bd('0x16')]){if(_0x12c96e[_0xe9bd('0x16')]['code']===0x1f4){logger['error'](_0xe9bd('0x12'),_0x581602,_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);return _0x145521(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}logger[_0xe9bd('0x16')](_0xe9bd('0x12'),_0x581602,_0x12c96e['error'][_0xe9bd('0x17')]);return _0x3c8e95(_0x12c96e[_0xe9bd('0x16')][_0xe9bd('0x17')]);}else{logger['info'](_0xe9bd('0x12'),_0x581602,_0xe9bd('0x13'));_0x3c8e95(_0x12c96e[_0xe9bd('0x18')][_0xe9bd('0x17')]);}})['catch'](function(_0x20ec32){logger['error'](_0xe9bd('0x12'),_0x581602,_0x20ec32);_0x145521(_0x20ec32);});});}exports['CreateFaxMessage']=function(_0x26aa4a){var _0x417113=this;return new Promise(function(_0x134c4e,_0x3dda13){return db[_0xe9bd('0x19')][_0xe9bd('0x1a')](_0x26aa4a[_0xe9bd('0x1b')],{'raw':_0x26aa4a['options']?_0x26aa4a[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x37aec1){logger['info'](_0xe9bd('0x1e'),_0x26aa4a);logger[_0xe9bd('0x1f')](_0xe9bd('0x1e'),_0x26aa4a,JSON[_0xe9bd('0x15')](_0x37aec1));_0x134c4e(_0x37aec1);})['catch'](function(_0x24cf25){logger[_0xe9bd('0x16')](_0xe9bd('0x1e'),_0x24cf25[_0xe9bd('0x17')],_0x26aa4a);_0x3dda13(_0x417113[_0xe9bd('0x16')](0x1f4,_0x24cf25[_0xe9bd('0x17')]));});});};exports[_0xe9bd('0x20')]=function(_0x43ea90){var _0x1ae889=this;return new Promise(function(_0x5987af,_0x3c211a){return db[_0xe9bd('0x19')]['update'](_0x43ea90[_0xe9bd('0x1b')],{'raw':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')]['where']||null:null,'attributes':_0x43ea90['options']?_0x43ea90[_0xe9bd('0x1c')]['attributes']||null:null,'limit':_0x43ea90[_0xe9bd('0x1c')]?_0x43ea90[_0xe9bd('0x1c')][_0xe9bd('0x21')]||null:null})[_0xe9bd('0x22')](function(_0x4057df){logger['info']('UpdateFaxMessage',_0x43ea90);logger[_0xe9bd('0x1f')](_0xe9bd('0x20'),_0x43ea90,JSON[_0xe9bd('0x15')](_0x4057df));_0x5987af(_0x4057df);})[_0xe9bd('0x23')](function(_0xe2436){logger[_0xe9bd('0x16')](_0xe9bd('0x20'),_0xe2436[_0xe9bd('0x17')],_0x43ea90);_0x3c211a(_0x1ae889[_0xe9bd('0x16')](0x1f4,_0xe2436['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 6a59c03..6ca5ab7 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 _0x2df1=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x3de3ba,_0x4cf9e7){var _0x148d13=function(_0x2fe925){while(--_0x2fe925){_0x3de3ba['push'](_0x3de3ba['shift']());}};_0x148d13(++_0x4cf9e7);}(_0x2df1,0xca));var _0x12df=function(_0x387825,_0x91d108){_0x387825=_0x387825-0x0;var _0x3a72d4=_0x2df1[_0x387825];return _0x3a72d4;};'use strict';var FaxMessageEvents=require(_0x12df('0x0'));var events=[_0x12df('0x1'),_0x12df('0x2'),_0x12df('0x3')];function createListener(_0x42a453,_0x40708e){return function(_0x15a2d0){_0x40708e['emit'](_0x42a453,_0x15a2d0);};}function removeListener(_0x324d26,_0x1139eb){return function(){FaxMessageEvents[_0x12df('0x4')](_0x324d26,_0x1139eb);};}exports[_0x12df('0x5')]=function(_0x1542d3){for(var _0x49f4de=0x0,_0x2e7401=events[_0x12df('0x6')];_0x49f4de<_0x2e7401;_0x49f4de++){var _0x248ecc=events[_0x49f4de];var _0x7f3dd6=createListener(_0x12df('0x7')+_0x248ecc,_0x1542d3);FaxMessageEvents['on'](_0x248ecc,_0x7f3dd6);}}; \ No newline at end of file +var _0x3510=['./faxMessage.events','remove','update','emit','register','length','faxMessage:'];(function(_0x5f4585,_0x287c9f){var _0x32b347=function(_0x301639){while(--_0x301639){_0x5f4585['push'](_0x5f4585['shift']());}};_0x32b347(++_0x287c9f);}(_0x3510,0xf5));var _0x0351=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3510[_0x1facfa];return _0x9ec701;};'use strict';var FaxMessageEvents=require(_0x0351('0x0'));var events=['save',_0x0351('0x1'),_0x0351('0x2')];function createListener(_0x35be7c,_0xbc9e88){return function(_0x16010c){_0xbc9e88[_0x0351('0x3')](_0x35be7c,_0x16010c);};}function removeListener(_0xfc67fb,_0x285d48){return function(){FaxMessageEvents['removeListener'](_0xfc67fb,_0x285d48);};}exports[_0x0351('0x4')]=function(_0x427f5e){for(var _0x33bf06=0x0,_0x4941f8=events[_0x0351('0x5')];_0x33bf06<_0x4941f8;_0x33bf06++){var _0x4c2f6c=events[_0x33bf06];var _0x229768=createListener(_0x0351('0x6')+_0x4c2f6c,_0x427f5e);FaxMessageEvents['on'](_0x4c2f6c,_0x229768);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 7f06ff8..c689eed 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 _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0xcea2,0x15a));var _0x2cea=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xcea2[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router; \ No newline at end of file +var _0xaa88=['describe','get','show','download','post','fax','faxmessage:create','put','/:id','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated'];(function(_0x1c90bd,_0x48dedc){var _0x36327e=function(_0xaffe9c){while(--_0xaffe9c){_0x1c90bd['push'](_0x1c90bd['shift']());}};_0x36327e(++_0x48dedc);}(_0xaa88,0x137));var _0x8aa8=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xaa88[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0xe')]('/:id/download',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x11')]('/',auth[_0x8aa8('0xc')](),interaction['tracked'](_0x8aa8('0x12'),_0x8aa8('0x13')),controller['create']);router[_0x8aa8('0x14')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x16'),auth[_0x8aa8('0xc')](),controller['accept']);router[_0x8aa8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8aa8('0x17')]);router[_0x8aa8('0x18')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x19')]);module[_0x8aa8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 79cff83..eda7056 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 _0x65ac=['exports','STRING','name','INTEGER','ENUM','rrmemory','sequelize'];(function(_0x2571ff,_0x3abf38){var _0x13a088=function(_0x2b2e2c){while(--_0x2b2e2c){_0x2571ff['push'](_0x2571ff['shift']());}};_0x13a088(++_0x3abf38);}(_0x65ac,0x1a3));var _0xc65a=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x65ac[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0xc65a('0x0'));module[_0xc65a('0x1')]={'name':{'type':Sequelize[_0xc65a('0x2')],'unique':_0xc65a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc65a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc65a('0x5')](_0xc65a('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc65a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x39c3=['INTEGER','exports','rrmemory','roundrobin'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x39c3,0x179));var _0x339c=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x39c3[_0x5f519b];return _0x2461e2;};'use strict';var Sequelize=require('sequelize');module[_0x339c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x339c('0x1'),'beepall',_0x339c('0x2')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x339c('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 95086fe..8b6bb9d 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 _0x3aff=['push','toString','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxQueue','include','findAll','show','params','rawAttributes','length','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','pick','FaxQueueId','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','createdAt','rows','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','voicePause','sequelize','transaction','each','forEach','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x3aff,0x128));var _0xf3af=function(_0x4076cf,_0x5b5b8b){_0x4076cf=_0x4076cf-0x0;var _0xee24fe=_0x3aff[_0x4076cf];return _0xee24fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3af('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf3af('0x1'));var moment=require(_0xf3af('0x2'));var BPromise=require(_0xf3af('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf3af('0x4'));var sox=require(_0xf3af('0x5'));var csv=require(_0xf3af('0x6'));var ejs=require(_0xf3af('0x7'));var fs=require('fs');var fs_extra=require(_0xf3af('0x8'));var _=require('lodash');var squel=require(_0xf3af('0x9'));var crypto=require('crypto');var jsforce=require(_0xf3af('0xa'));var deskjs=require(_0xf3af('0xb'));var toCsv=require(_0xf3af('0x6'));var querystring=require(_0xf3af('0xc'));var Papa=require('papaparse');var Redis=require(_0xf3af('0xd'));var authService=require(_0xf3af('0xe'));var qs=require(_0xf3af('0xf'));var as=require(_0xf3af('0x10'));var hardwareService=require(_0xf3af('0x11'));var logger=require('../../config/logger')(_0xf3af('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3af('0x13'));var db=require(_0xf3af('0x14'))['db'];config[_0xf3af('0x15')]=_[_0xf3af('0x16')](config['redis'],{'host':_0xf3af('0x17'),'port':0x18eb});var socket=require(_0xf3af('0x18'))(new Redis(config[_0xf3af('0x15')]));require(_0xf3af('0x19'))['register'](socket);function respondWithStatusCode(_0x333180,_0x5253d7){_0x5253d7=_0x5253d7||0xcc;return function(_0x3c44da){if(_0x3c44da){return _0x333180[_0xf3af('0x1a')](_0x5253d7);}return _0x333180[_0xf3af('0x1b')](_0x5253d7)[_0xf3af('0x1c')]();};}function respondWithResult(_0x393a9b,_0x39384e){_0x39384e=_0x39384e||0xc8;return function(_0x5097b6){if(_0x5097b6){return _0x393a9b['status'](_0x39384e)['json'](_0x5097b6);}};}function respondWithFilteredResult(_0x5b5be8,_0x403e36){return function(_0x38af48){if(_0x38af48){var _0x5e2567=typeof _0x403e36[_0xf3af('0x1d')]===_0xf3af('0x1e')&&typeof _0x403e36[_0xf3af('0x1f')]===_0xf3af('0x1e');var _0x477abc=_0x38af48['count'];var _0x240478=_0x5e2567?0x0:_0x403e36[_0xf3af('0x1d')];var _0x30b07a=_0x5e2567?_0x38af48[_0xf3af('0x20')]:_0x403e36[_0xf3af('0x1d')]+_0x403e36[_0xf3af('0x1f')];var _0x538254;if(_0x30b07a>=_0x477abc){_0x30b07a=_0x477abc;_0x538254=0xc8;}else{_0x538254=0xce;}_0x5b5be8[_0xf3af('0x1b')](_0x538254);return _0x5b5be8[_0xf3af('0x21')](_0xf3af('0x22'),_0x240478+'-'+_0x30b07a+'/'+_0x477abc)[_0xf3af('0x23')](_0x38af48);}return null;};}function patchUpdates(_0x3fd310){return function(_0x14e538){try{jsonpatch[_0xf3af('0x24')](_0x14e538,_0x3fd310,!![]);}catch(_0x3d292f){return BPromise[_0xf3af('0x25')](_0x3d292f);}return _0x14e538[_0xf3af('0x26')]();};}function saveUpdates(_0xa36a0b,_0x27c810){return function(_0x55cd09){if(_0x55cd09){return _0x55cd09[_0xf3af('0x27')](_0xa36a0b)[_0xf3af('0x28')](function(_0x57bc24){return _0x57bc24;});}return null;};}function removeEntity(_0x4b87a7,_0x41c896){return function(_0x27830f){if(_0x27830f){return _0x27830f[_0xf3af('0x29')]()[_0xf3af('0x28')](function(){var _0x56bd7c=_0x27830f['get']({'plain':!![]});var _0x3457af=_0xf3af('0x2a');return db[_0xf3af('0x2b')][_0xf3af('0x29')]({'where':{'type':_0x3457af,'resourceId':_0x56bd7c['id']}})[_0xf3af('0x28')](function(){return _0x27830f;});})[_0xf3af('0x28')](function(){_0x4b87a7[_0xf3af('0x1b')](0xcc)[_0xf3af('0x1c')]();});}};}function handleEntityNotFound(_0x29e480,_0x46f7a8){return function(_0x232d37){if(!_0x232d37){_0x29e480[_0xf3af('0x1a')](0x194);}return _0x232d37;};}function handleError(_0x2dda55,_0xff66a2){_0xff66a2=_0xff66a2||0x1f4;return function(_0x213065){logger[_0xf3af('0x2c')](_0x213065[_0xf3af('0x2d')]);if(_0x213065[_0xf3af('0x2e')]){delete _0x213065['name'];}_0x2dda55['status'](_0xff66a2)[_0xf3af('0x2f')](_0x213065);};}exports[_0xf3af('0x30')]=function(_0x47cb28,_0x542937){var _0x190ffb={},_0x36557f={},_0x4cd473={'count':0x0,'rows':[]};var _0x1a934e=_[_0xf3af('0x31')](db['FaxQueue']['rawAttributes'],function(_0x5eee0b){return{'name':_0x5eee0b[_0xf3af('0x32')],'type':_0x5eee0b[_0xf3af('0x33')][_0xf3af('0x34')]};});_0x36557f[_0xf3af('0x35')]=_[_0xf3af('0x31')](_0x1a934e,_0xf3af('0x2e'));_0x36557f[_0xf3af('0x36')]=_[_0xf3af('0x37')](_0x47cb28[_0xf3af('0x36')]);_0x36557f[_0xf3af('0x38')]=_['intersection'](_0x36557f[_0xf3af('0x35')],_0x36557f['query']);_0x190ffb[_0xf3af('0x39')]=_[_0xf3af('0x3a')](_0x36557f['model'],qs['fields'](_0x47cb28[_0xf3af('0x36')][_0xf3af('0x3b')]));_0x190ffb[_0xf3af('0x39')]=_0x190ffb[_0xf3af('0x39')]['length']?_0x190ffb[_0xf3af('0x39')]:_0x36557f[_0xf3af('0x35')];if(!_0x47cb28[_0xf3af('0x36')][_0xf3af('0x3c')](_0xf3af('0x3d'))){_0x190ffb[_0xf3af('0x1f')]=qs['limit'](_0x47cb28[_0xf3af('0x36')][_0xf3af('0x1f')]);_0x190ffb[_0xf3af('0x1d')]=qs[_0xf3af('0x1d')](_0x47cb28[_0xf3af('0x36')][_0xf3af('0x1d')]);}_0x190ffb[_0xf3af('0x3e')]=qs[_0xf3af('0x3f')](_0x47cb28[_0xf3af('0x36')]['sort']);_0x190ffb[_0xf3af('0x40')]=qs[_0xf3af('0x38')](_['pick'](_0x47cb28[_0xf3af('0x36')],_0x36557f[_0xf3af('0x38')]),_0x1a934e);if(_0x47cb28[_0xf3af('0x36')][_0xf3af('0x41')]){_0x190ffb[_0xf3af('0x40')]=_[_0xf3af('0x42')](_0x190ffb[_0xf3af('0x40')],{'$or':_[_0xf3af('0x31')](_0x1a934e,function(_0x2d18c8){if(_0x2d18c8[_0xf3af('0x33')]!==_0xf3af('0x43')){var _0x464248={};_0x464248[_0x2d18c8[_0xf3af('0x2e')]]={'$like':'%'+_0x47cb28[_0xf3af('0x36')][_0xf3af('0x41')]+'%'};return _0x464248;}})});}_0x190ffb=_[_0xf3af('0x42')]({},_0x190ffb,_0x47cb28[_0xf3af('0x44')]);var _0xb0d964={'where':_0x190ffb['where']};return db[_0xf3af('0x45')][_0xf3af('0x20')](_0xb0d964)[_0xf3af('0x28')](function(_0xec023f){_0x4cd473[_0xf3af('0x20')]=_0xec023f;if(_0x47cb28['query']['includeAll']){_0x190ffb[_0xf3af('0x46')]=[{'all':!![]}];}return db[_0xf3af('0x45')][_0xf3af('0x47')](_0x190ffb);})[_0xf3af('0x28')](function(_0x5cafa4){_0x4cd473['rows']=_0x5cafa4;return _0x4cd473;})[_0xf3af('0x28')](respondWithFilteredResult(_0x542937,_0x190ffb))['catch'](handleError(_0x542937,null));};exports[_0xf3af('0x48')]=function(_0x1a1224,_0x55603d){var _0x7a29f4={'raw':!![],'where':{'id':_0x1a1224[_0xf3af('0x49')]['id']}},_0x3451ff={};_0x3451ff[_0xf3af('0x35')]=_['keys'](db['FaxQueue'][_0xf3af('0x4a')]);_0x3451ff[_0xf3af('0x36')]=_[_0xf3af('0x37')](_0x1a1224[_0xf3af('0x36')]);_0x3451ff[_0xf3af('0x38')]=_[_0xf3af('0x3a')](_0x3451ff[_0xf3af('0x35')],_0x3451ff[_0xf3af('0x36')]);_0x7a29f4[_0xf3af('0x39')]=_[_0xf3af('0x3a')](_0x3451ff[_0xf3af('0x35')],qs[_0xf3af('0x3b')](_0x1a1224[_0xf3af('0x36')]['fields']));_0x7a29f4[_0xf3af('0x39')]=_0x7a29f4[_0xf3af('0x39')][_0xf3af('0x4b')]?_0x7a29f4['attributes']:_0x3451ff['model'];if(_0x1a1224['query'][_0xf3af('0x4c')]){_0x7a29f4[_0xf3af('0x46')]=[{'all':!![]}];}_0x7a29f4=_[_0xf3af('0x42')]({},_0x7a29f4,_0x1a1224[_0xf3af('0x44')]);return db[_0xf3af('0x45')]['find'](_0x7a29f4)[_0xf3af('0x28')](handleEntityNotFound(_0x55603d,null))['then'](respondWithResult(_0x55603d,null))[_0xf3af('0x4d')](handleError(_0x55603d,null));};exports[_0xf3af('0x4e')]=function(_0x1f83a0,_0x4caaad){return db[_0xf3af('0x45')][_0xf3af('0x4e')](_0x1f83a0[_0xf3af('0x4f')],{})[_0xf3af('0x28')](function(_0x4e256f){var _0xf9e770=_0x1f83a0[_0xf3af('0x50')]['get']({'plain':!![]});if(!_0xf9e770)throw new Error(_0xf3af('0x51'));if(_0xf9e770['role']===_0xf3af('0x50')){var _0x239fd4=_0x4e256f[_0xf3af('0x52')]({'plain':!![]});var _0xd5a5f1='FaxQueues';return db[_0xf3af('0x53')][_0xf3af('0x54')]({'where':{'name':_0xd5a5f1,'userProfileId':_0xf9e770['userProfileId']},'raw':!![]})[_0xf3af('0x28')](function(_0x4ca386){if(_0x4ca386&&_0x4ca386['autoAssociation']===0x0){return db[_0xf3af('0x2b')][_0xf3af('0x4e')]({'name':_0x239fd4[_0xf3af('0x2e')],'resourceId':_0x239fd4['id'],'type':_0x4ca386[_0xf3af('0x2e')],'sectionId':_0x4ca386['id']},{})[_0xf3af('0x28')](function(){return _0x4e256f;});}else{return _0x4e256f;}})[_0xf3af('0x4d')](function(_0x8c2c1){logger[_0xf3af('0x2c')](_0xf3af('0x55'),_0x8c2c1);throw _0x8c2c1;});}return _0x4e256f;})[_0xf3af('0x28')](respondWithResult(_0x4caaad,0xc9))[_0xf3af('0x4d')](handleError(_0x4caaad,null));};exports['update']=function(_0x5c3175,_0x219463){if(_0x5c3175[_0xf3af('0x4f')]['id']){delete _0x5c3175[_0xf3af('0x4f')]['id'];}return db[_0xf3af('0x45')][_0xf3af('0x54')]({'where':{'id':_0x5c3175['params']['id']}})['then'](handleEntityNotFound(_0x219463,null))['then'](saveUpdates(_0x5c3175[_0xf3af('0x4f')],null))[_0xf3af('0x28')](respondWithResult(_0x219463,null))[_0xf3af('0x4d')](handleError(_0x219463,null));};exports[_0xf3af('0x29')]=function(_0x224bc2,_0x57eddb){return db['FaxQueue']['find']({'where':{'id':_0x224bc2[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x57eddb,null))[_0xf3af('0x28')](removeEntity(_0x57eddb,null))[_0xf3af('0x4d')](handleError(_0x57eddb,null));};exports[_0xf3af('0x56')]=function(_0x17c3c4,_0x2fa6bd){return db[_0xf3af('0x45')]['describe']()[_0xf3af('0x28')](respondWithResult(_0x2fa6bd,null))['catch'](handleError(_0x2fa6bd,null));};exports[_0xf3af('0x57')]=function(_0x4d86e8,_0x2de60c,_0x4189a6){var _0x57967f={'raw':!![],'where':{}},_0x119a71={},_0x239b7d;return db[_0xf3af('0x45')][_0xf3af('0x58')]({'where':{'id':_0x4d86e8[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x2de60c,null))[_0xf3af('0x28')](function(_0x2decd1){if(_0x2decd1){_0x239b7d=_0x2decd1[_0xf3af('0x52')]({'plain':!![]});_0x119a71[_0xf3af('0x35')]=_['keys'](db['UserFaxQueue'][_0xf3af('0x4a')]);_0x119a71['query']=_[_0xf3af('0x37')](_0x4d86e8[_0xf3af('0x36')]);_0x119a71['filters']=_[_0xf3af('0x3a')](_0x119a71[_0xf3af('0x35')],_0x119a71[_0xf3af('0x36')]);_0x57967f['attributes']=_[_0xf3af('0x3a')](_0x119a71[_0xf3af('0x35')],qs[_0xf3af('0x3b')](_0x4d86e8['query'][_0xf3af('0x3b')]));_0x57967f[_0xf3af('0x39')]=_0x57967f[_0xf3af('0x39')][_0xf3af('0x4b')]?_0x57967f[_0xf3af('0x39')]:_0x119a71['model'];if(!_0x4d86e8['query'][_0xf3af('0x3c')](_0xf3af('0x3d'))){_0x57967f['limit']=qs[_0xf3af('0x1f')](_0x4d86e8['query'][_0xf3af('0x1f')]);_0x57967f[_0xf3af('0x1d')]=qs[_0xf3af('0x1d')](_0x4d86e8[_0xf3af('0x36')][_0xf3af('0x1d')]);}_0x57967f[_0xf3af('0x3e')]=qs[_0xf3af('0x3f')](_0x4d86e8[_0xf3af('0x36')][_0xf3af('0x3f')]);_0x57967f['where']=qs['filters'](_[_0xf3af('0x59')](_0x4d86e8[_0xf3af('0x36')],_0x119a71[_0xf3af('0x38')]));_0x57967f[_0xf3af('0x40')][_0xf3af('0x5a')]=_0x2decd1['id'];if(_0x4d86e8[_0xf3af('0x36')][_0xf3af('0x41')]){_0x57967f['where']=_[_0xf3af('0x42')](_0x57967f[_0xf3af('0x40')],{'$or':_[_0xf3af('0x31')](_0x57967f['attributes'],function(_0x305f20){var _0xa66fe3={};_0xa66fe3[_0x305f20]={'$like':'%'+_0x4d86e8[_0xf3af('0x36')][_0xf3af('0x41')]+'%'};return _0xa66fe3;})});}_0x57967f=_[_0xf3af('0x42')]({},_0x57967f,_0x4d86e8['options']);return db[_0xf3af('0x5b')][_0xf3af('0x47')](_0x57967f);}})['then'](function(_0x2b4cf0){if(_0x2b4cf0){return db['User'][_0xf3af('0x5c')]({'where':{'id':_[_0xf3af('0x31')](_0x2b4cf0,_0xf3af('0x5d')),'role':_0xf3af('0x5e')},'attributes':['id','name',_0xf3af('0x5f'),'updatedAt',_0xf3af('0x60')]});}})[_0xf3af('0x28')](function(_0x29a006){if(_0x29a006){return{'count':_0x29a006['count'],'rows':_[_0xf3af('0x31')](_0x29a006[_0xf3af('0x61')],function(_0xc5b59f){return{'membername':_0xc5b59f[_0xf3af('0x2e')],'UserId':_0xc5b59f['id'],'queue_name':_0x239b7d[_0xf3af('0x2e')],'FaxQueueId':_0x239b7d['id'],'interface':util[_0xf3af('0x62')](_0xf3af('0x63'),_0xf3af('0x64'),_0xc5b59f[_0xf3af('0x2e')]),'penalty':0x0,'paused':_0xc5b59f['faxPause'],'createdAt':_0xc5b59f[_0xf3af('0x60')],'updatedAt':_0xc5b59f[_0xf3af('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3af('0x28')](respondWithFilteredResult(_0x2de60c,_0x57967f))['catch'](handleError(_0x2de60c,null));};exports['getTeams']=function(_0x4d01c0,_0x48de07,_0x5f31eb){var _0x12c7ac={};var _0x492bac={};var _0x53d54b;var _0x1f0965;return db[_0xf3af('0x45')][_0xf3af('0x58')]({'where':{'id':_0x4d01c0[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x48de07,null))[_0xf3af('0x28')](function(_0xbd7d4f){if(_0xbd7d4f){_0x53d54b=_0xbd7d4f;_0x492bac[_0xf3af('0x35')]=_[_0xf3af('0x37')](db[_0xf3af('0x66')]['rawAttributes']);_0x492bac[_0xf3af('0x36')]=_[_0xf3af('0x37')](_0x4d01c0['query']);_0x492bac['filters']=_[_0xf3af('0x3a')](_0x492bac[_0xf3af('0x35')],_0x492bac[_0xf3af('0x36')]);_0x12c7ac[_0xf3af('0x39')]=_[_0xf3af('0x3a')](_0x492bac['model'],qs[_0xf3af('0x3b')](_0x4d01c0['query'][_0xf3af('0x3b')]));_0x12c7ac[_0xf3af('0x39')]=_0x12c7ac[_0xf3af('0x39')][_0xf3af('0x4b')]?_0x12c7ac[_0xf3af('0x39')]:_0x492bac[_0xf3af('0x35')];_0x12c7ac[_0xf3af('0x3e')]=qs[_0xf3af('0x3f')](_0x4d01c0['query']['sort']);_0x12c7ac[_0xf3af('0x40')]=qs['filters'](_[_0xf3af('0x59')](_0x4d01c0[_0xf3af('0x36')],_0x492bac['filters']));if(_0x4d01c0[_0xf3af('0x36')][_0xf3af('0x41')]){_0x12c7ac[_0xf3af('0x40')]=_['merge'](_0x12c7ac[_0xf3af('0x40')],{'$or':_[_0xf3af('0x31')](_0x12c7ac[_0xf3af('0x39')],function(_0x5bd41e){var _0x2fdd98={};_0x2fdd98[_0x5bd41e]={'$like':'%'+_0x4d01c0[_0xf3af('0x36')][_0xf3af('0x41')]+'%'};return _0x2fdd98;})});}_0x12c7ac=_[_0xf3af('0x42')]({},_0x12c7ac,_0x4d01c0[_0xf3af('0x44')]);return _0x53d54b[_0xf3af('0x67')](_0x12c7ac);}})[_0xf3af('0x28')](function(_0x1ee217){if(_0x1ee217){_0x1f0965=_0x1ee217[_0xf3af('0x4b')];if(!_0x4d01c0[_0xf3af('0x36')][_0xf3af('0x3c')]('nolimit')){_0x12c7ac[_0xf3af('0x1f')]=qs['limit'](_0x4d01c0['query'][_0xf3af('0x1f')]);_0x12c7ac[_0xf3af('0x1d')]=qs['offset'](_0x4d01c0[_0xf3af('0x36')][_0xf3af('0x1d')]);}return _0x53d54b[_0xf3af('0x67')](_0x12c7ac);}})[_0xf3af('0x28')](function(_0x836dd7){if(_0x836dd7){return _0x836dd7?{'count':_0x1f0965,'rows':_0x836dd7}:null;}})[_0xf3af('0x28')](respondWithResult(_0x48de07,null))[_0xf3af('0x4d')](handleError(_0x48de07,null));};exports[_0xf3af('0x68')]=function(_0x1fde8d,_0x1d9682,_0x6d3b44){var _0x38fb68=_0x1fde8d[_0xf3af('0x4f')][_0xf3af('0x69')];return db[_0xf3af('0x66')][_0xf3af('0x47')]({'where':{'id':_0x38fb68},'attributes':['id'],'include':[{'model':db[_0xf3af('0x6a')],'as':_0xf3af('0x6b'),'attributes':['id',_0xf3af('0x2e'),'online',_0xf3af('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x5d78c0){if(_0x5d78c0){var _0x1f867c=_['flatMap'](_0x5d78c0,function(_0x49a089){var _0x2f9a85=_0x49a089[_0xf3af('0x52')]({'plain':!![]});return _0x2f9a85['Agents'];});return db[_0xf3af('0x45')][_0xf3af('0x54')]({'where':{'id':_0x1fde8d['params']['id']}})[_0xf3af('0x28')](function(_0xbf1fb4){return db[_0xf3af('0x6d')][_0xf3af('0x6e')](function(_0x34446e){return _0xbf1fb4[_0xf3af('0x68')](_0x38fb68,{'transaction':_0x34446e})[_0xf3af('0x28')](function(){return BPromise[_0xf3af('0x6f')](_0x1f867c,function(_0x376f96){return db[_0xf3af('0x5b')]['findOrCreate']({'where':{'UserId':_0x376f96['id'],'FaxQueueId':_0x1fde8d[_0xf3af('0x49')]['id']},'transaction':_0x34446e});});})[_0xf3af('0x28')](function(){_0x1f867c[_0xf3af('0x70')](function(_0x29af35){socket['emit']('userFaxQueue:save',{'UserId':_0x29af35['id'],'FaxQueueId':_0xbf1fb4['id']});});});});});}})['then'](respondWithStatusCode(_0x1d9682,null))[_0xf3af('0x4d')](handleError(_0x1d9682,null));};exports[_0xf3af('0x71')]=function(_0x324c4f,_0x44aab5,_0x466270){return db[_0xf3af('0x66')][_0xf3af('0x47')]({'where':{'id':_0x324c4f[_0xf3af('0x36')][_0xf3af('0x69')]},'attributes':['id'],'include':[{'model':db[_0xf3af('0x6a')],'as':_0xf3af('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xf3af('0x28')](handleEntityNotFound(_0x44aab5,null))[_0xf3af('0x28')](function(_0x103a3b){var _0x5789cd=_[_0xf3af('0x31')](_0x103a3b,'id');var _0x1ef73c=[];var _0x420eeb=[];var _0x46df28=squel['select']();_0x46df28['field'](_0xf3af('0x72'))[_0xf3af('0x73')]('team_has_fax_queues','tq')[_0xf3af('0x74')](_0xf3af('0x75'),'ut',_0xf3af('0x76'))[_0xf3af('0x40')]('FaxQueueId\x20=\x20?',_0x324c4f[_0xf3af('0x49')]['id']);for(var _0x4e9637=0x0;_0x4e9637<_0x103a3b['length'];_0x4e9637+=0x1){let _0x2a2393=_0x103a3b[_0x4e9637];for(var _0x395cda=0x0;_0x395cda<_0x2a2393[_0xf3af('0x6b')]['length'];_0x395cda+=0x1){let _0x2e0227=_0x2a2393[_0xf3af('0x6b')][_0x395cda];var _0x58eb03=_0x46df28[_0xf3af('0x77')]();_0x58eb03['where'](_0xf3af('0x78'),_0x2e0227['id']);_0x420eeb[_0xf3af('0x79')](db[_0xf3af('0x6d')][_0xf3af('0x36')](_0x58eb03[_0xf3af('0x7a')](),{'type':db[_0xf3af('0x6d')]['QueryTypes']['SELECT']})[_0xf3af('0x28')](function(_0x56f754){if(_0x56f754[_0xf3af('0x4b')]===0x1){return _0x2e0227['id'];}else{var _0x11e1ec=_[_0xf3af('0x7b')](_[_0xf3af('0x31')](_0x56f754,_0xf3af('0x7c')),function(_0x3ffeb2){return _[_0xf3af('0x7d')](_0x5789cd,_0x3ffeb2);});if(_0x11e1ec){return _0x2e0227['id'];}}}));}}return BPromise[_0xf3af('0x7e')](_0x420eeb)[_0xf3af('0x28')](function(_0x2ed647){_0x1ef73c=_(_0x1ef73c)[_0xf3af('0x7f')](_0x2ed647)['compact']()[_0xf3af('0x80')]();return db[_0xf3af('0x45')]['find']({'where':{'id':_0x324c4f[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](function(_0x2d02cb){return db[_0xf3af('0x6d')]['transaction'](function(_0x52b5c9){return _0x2d02cb[_0xf3af('0x71')](_0x324c4f[_0xf3af('0x36')]['ids'],{'transaction':_0x52b5c9})['then'](function(){if(!_[_0xf3af('0x81')](_0x1ef73c)){return _0x2d02cb[_0xf3af('0x82')](_0x1ef73c,{'transaction':_0x52b5c9});}})[_0xf3af('0x28')](function(){_0x1ef73c['forEach'](function(_0x5a7780){socket[_0xf3af('0x83')](_0xf3af('0x84'),{'UserId':_0x5a7780,'FaxQueueId':_0x2d02cb['id']});});});});});});})[_0xf3af('0x28')](respondWithStatusCode(_0x44aab5,null))['catch'](handleError(_0x44aab5,null));};exports[_0xf3af('0x85')]=function(_0x3d0408,_0x5ef5bf,_0x29b01a){return db[_0xf3af('0x45')]['find']({'where':{'id':_0x3d0408[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x5ef5bf,null))[_0xf3af('0x28')](function(_0x23f52c){if(_0x23f52c){return _0x23f52c['addAgents'](_0x3d0408[_0xf3af('0x4f')][_0xf3af('0x69')],_[_0xf3af('0x86')](_0x3d0408[_0xf3af('0x4f')],[_0xf3af('0x69'),'id'])||{})[_0xf3af('0x87')](function(_0x1b35f2){for(var _0xe8603=0x0;_0xe8603<_0x3d0408[_0xf3af('0x4f')][_0xf3af('0x69')][_0xf3af('0x4b')];_0xe8603+=0x1){socket[_0xf3af('0x83')](_0xf3af('0x88'),{'UserId':Number(_0x3d0408['body'][_0xf3af('0x69')][_0xe8603]),'FaxQueueId':Number(_0x3d0408[_0xf3af('0x49')]['id'])});}return _0x1b35f2;});}})[_0xf3af('0x28')](respondWithResult(_0x5ef5bf,null))['catch'](handleError(_0x5ef5bf,null));};exports[_0xf3af('0x82')]=function(_0x2a1886,_0x68e471,_0x4de5e7){return db[_0xf3af('0x45')][_0xf3af('0x54')]({'where':{'id':_0x2a1886[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x68e471,null))[_0xf3af('0x28')](function(_0x43e307){if(_0x43e307){return _0x43e307['removeAgents'](_0x2a1886[_0xf3af('0x36')][_0xf3af('0x69')])[_0xf3af('0x28')](function(){if(_[_0xf3af('0x89')](_0x2a1886[_0xf3af('0x36')][_0xf3af('0x69')])){for(var _0x47d75f=0x0;_0x47d75f<_0x2a1886[_0xf3af('0x36')]['ids'][_0xf3af('0x4b')];_0x47d75f+=0x1){socket[_0xf3af('0x83')](_0xf3af('0x84'),{'UserId':Number(_0x2a1886['query'][_0xf3af('0x69')][_0x47d75f]),'FaxQueueId':Number(_0x2a1886[_0xf3af('0x49')]['id'])});}}else{socket[_0xf3af('0x83')]('userFaxQueue:remove',{'UserId':Number(_0x2a1886[_0xf3af('0x36')][_0xf3af('0x69')]),'FaxQueueId':Number(_0x2a1886[_0xf3af('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x68e471,null))['catch'](handleError(_0x68e471,null));};exports['getAgents']=function(_0x5c79d8,_0x361154,_0x4f2cd2){var _0x53a64a={};var _0x215f77={};var _0x12ef19;var _0x2868fe;return db[_0xf3af('0x45')]['findOne']({'where':{'id':_0x5c79d8[_0xf3af('0x49')]['id']}})[_0xf3af('0x28')](handleEntityNotFound(_0x361154,null))['then'](function(_0x4bf77f){if(_0x4bf77f){_0x12ef19=_0x4bf77f;_0x215f77['model']=_[_0xf3af('0x37')](db[_0xf3af('0x6a')]['rawAttributes']);_0x215f77['query']=_[_0xf3af('0x37')](_0x5c79d8['query']);_0x215f77[_0xf3af('0x38')]=_[_0xf3af('0x3a')](_0x215f77[_0xf3af('0x35')],_0x215f77[_0xf3af('0x36')]);_0x53a64a[_0xf3af('0x39')]=_[_0xf3af('0x3a')](_0x215f77[_0xf3af('0x35')],qs[_0xf3af('0x3b')](_0x5c79d8[_0xf3af('0x36')][_0xf3af('0x3b')]));_0x53a64a['attributes']=_0x53a64a['attributes'][_0xf3af('0x4b')]?_0x53a64a[_0xf3af('0x39')]:_0x215f77[_0xf3af('0x35')];_0x53a64a[_0xf3af('0x3e')]=qs[_0xf3af('0x3f')](_0x5c79d8[_0xf3af('0x36')][_0xf3af('0x3f')]);_0x53a64a[_0xf3af('0x40')]=qs[_0xf3af('0x38')](_[_0xf3af('0x59')](_0x5c79d8[_0xf3af('0x36')],_0x215f77[_0xf3af('0x38')]));if(_0x5c79d8[_0xf3af('0x36')][_0xf3af('0x41')]){_0x53a64a[_0xf3af('0x40')]=_[_0xf3af('0x42')](_0x53a64a[_0xf3af('0x40')],{'$or':_[_0xf3af('0x31')](_0x53a64a[_0xf3af('0x39')],function(_0x7ee5d3){var _0x4fe2bb={};_0x4fe2bb[_0x7ee5d3]={'$like':'%'+_0x5c79d8[_0xf3af('0x36')][_0xf3af('0x41')]+'%'};return _0x4fe2bb;})});}_0x53a64a=_['merge']({},_0x53a64a,_0x5c79d8[_0xf3af('0x44')]);return _0x12ef19[_0xf3af('0x8a')](_0x53a64a);}})['then'](function(_0x34e417){if(_0x34e417){_0x2868fe=_0x34e417[_0xf3af('0x4b')];if(!_0x5c79d8[_0xf3af('0x36')]['hasOwnProperty'](_0xf3af('0x3d'))){_0x53a64a[_0xf3af('0x1f')]=qs[_0xf3af('0x1f')](_0x5c79d8[_0xf3af('0x36')][_0xf3af('0x1f')]);_0x53a64a['offset']=qs[_0xf3af('0x1d')](_0x5c79d8[_0xf3af('0x36')]['offset']);}return _0x12ef19[_0xf3af('0x8a')](_0x53a64a);}})[_0xf3af('0x28')](function(_0x51a302){if(_0x51a302){return _0x51a302?{'count':_0x2868fe,'rows':_0x51a302}:null;}})[_0xf3af('0x28')](respondWithResult(_0x361154,null))[_0xf3af('0x4d')](handleError(_0x361154,null));}; \ No newline at end of file +var _0xfcdb=['order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','intersection','find','create','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','flatMap','transaction','each','findOrCreate','userFaxQueue:save','removeTeams','ids','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','FaxQueues','UserProfileResource','destroy','stack','name','send','map','FaxQueue','rawAttributes','fieldName','key','keys','filters','model','query','attributes','fields','length','hasOwnProperty'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xfcdb,0x169));var _0xbfcd=function(_0x936f1f,_0x2eaf2f){_0x936f1f=_0x936f1f-0x0;var _0xb36ff7=_0xfcdb[_0x936f1f];return _0xb36ff7;};'use strict';var emlformat=require(_0xbfcd('0x0'));var rimraf=require(_0xbfcd('0x1'));var zipdir=require(_0xbfcd('0x2'));var jsonpatch=require(_0xbfcd('0x3'));var rp=require(_0xbfcd('0x4'));var moment=require(_0xbfcd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbfcd('0x6'));var util=require(_0xbfcd('0x7'));var path=require('path');var sox=require(_0xbfcd('0x8'));var csv=require('to-csv');var ejs=require(_0xbfcd('0x9'));var fs=require('fs');var fs_extra=require(_0xbfcd('0xa'));var _=require(_0xbfcd('0xb'));var squel=require(_0xbfcd('0xc'));var crypto=require(_0xbfcd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbfcd('0xe'));var toCsv=require(_0xbfcd('0xf'));var querystring=require(_0xbfcd('0x10'));var Papa=require(_0xbfcd('0x11'));var Redis=require(_0xbfcd('0x12'));var authService=require(_0xbfcd('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfcd('0x14'))(_0xbfcd('0x15'));var utils=require('../../config/utils');var config=require(_0xbfcd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbfcd('0x17'))['db'];config[_0xbfcd('0x18')]=_[_0xbfcd('0x19')](config[_0xbfcd('0x18')],{'host':_0xbfcd('0x1a'),'port':0x18eb});var socket=require(_0xbfcd('0x1b'))(new Redis(config[_0xbfcd('0x18')]));require(_0xbfcd('0x1c'))['register'](socket);function respondWithStatusCode(_0x432bdf,_0x5c996c){_0x5c996c=_0x5c996c||0xcc;return function(_0x5501e6){if(_0x5501e6){return _0x432bdf[_0xbfcd('0x1d')](_0x5c996c);}return _0x432bdf[_0xbfcd('0x1e')](_0x5c996c)[_0xbfcd('0x1f')]();};}function respondWithResult(_0x5f12d0,_0x1cbb2f){_0x1cbb2f=_0x1cbb2f||0xc8;return function(_0x2c91d4){if(_0x2c91d4){return _0x5f12d0[_0xbfcd('0x1e')](_0x1cbb2f)[_0xbfcd('0x20')](_0x2c91d4);}};}function respondWithFilteredResult(_0x2a8a3e,_0x59cbe9){return function(_0xc6466f){if(_0xc6466f){var _0x376884=typeof _0x59cbe9[_0xbfcd('0x21')]===_0xbfcd('0x22')&&typeof _0x59cbe9[_0xbfcd('0x23')]===_0xbfcd('0x22');var _0x301c7c=_0xc6466f[_0xbfcd('0x24')];var _0xc55e85=_0x376884?0x0:_0x59cbe9[_0xbfcd('0x21')];var _0x3d841b=_0x376884?_0xc6466f[_0xbfcd('0x24')]:_0x59cbe9[_0xbfcd('0x21')]+_0x59cbe9['limit'];var _0x4c9ed2;if(_0x3d841b>=_0x301c7c){_0x3d841b=_0x301c7c;_0x4c9ed2=0xc8;}else{_0x4c9ed2=0xce;}_0x2a8a3e[_0xbfcd('0x1e')](_0x4c9ed2);return _0x2a8a3e[_0xbfcd('0x25')](_0xbfcd('0x26'),_0xc55e85+'-'+_0x3d841b+'/'+_0x301c7c)['json'](_0xc6466f);}return null;};}function patchUpdates(_0x35fa02){return function(_0x4ab0de){try{jsonpatch[_0xbfcd('0x27')](_0x4ab0de,_0x35fa02,!![]);}catch(_0x37c4cb){return BPromise[_0xbfcd('0x28')](_0x37c4cb);}return _0x4ab0de['save']();};}function saveUpdates(_0x52820a,_0xf66afb){return function(_0x47f7b2){if(_0x47f7b2){return _0x47f7b2['update'](_0x52820a)[_0xbfcd('0x29')](function(_0x1209ae){return _0x1209ae;});}return null;};}function removeEntity(_0x57c72a,_0x5bb7ea){return function(_0x163f65){if(_0x163f65){return _0x163f65['destroy']()[_0xbfcd('0x29')](function(){var _0x59c1b7=_0x163f65[_0xbfcd('0x2a')]({'plain':!![]});var _0x59a2d3=_0xbfcd('0x2b');return db[_0xbfcd('0x2c')][_0xbfcd('0x2d')]({'where':{'type':_0x59a2d3,'resourceId':_0x59c1b7['id']}})['then'](function(){return _0x163f65;});})[_0xbfcd('0x29')](function(){_0x57c72a['status'](0xcc)[_0xbfcd('0x1f')]();});}};}function handleEntityNotFound(_0x4f8a34,_0x39e6c3){return function(_0x46b795){if(!_0x46b795){_0x4f8a34[_0xbfcd('0x1d')](0x194);}return _0x46b795;};}function handleError(_0x1d4ebb,_0x3e1a52){_0x3e1a52=_0x3e1a52||0x1f4;return function(_0x1b7d5b){logger['error'](_0x1b7d5b[_0xbfcd('0x2e')]);if(_0x1b7d5b['name']){delete _0x1b7d5b[_0xbfcd('0x2f')];}_0x1d4ebb[_0xbfcd('0x1e')](_0x3e1a52)[_0xbfcd('0x30')](_0x1b7d5b);};}exports['index']=function(_0x3a0853,_0x30de24){var _0x3cb4e4={},_0x5e5d9b={},_0x418b5a={'count':0x0,'rows':[]};var _0x1a17a4=_[_0xbfcd('0x31')](db[_0xbfcd('0x32')][_0xbfcd('0x33')],function(_0x1ed519){return{'name':_0x1ed519[_0xbfcd('0x34')],'type':_0x1ed519['type'][_0xbfcd('0x35')]};});_0x5e5d9b['model']=_[_0xbfcd('0x31')](_0x1a17a4,'name');_0x5e5d9b['query']=_[_0xbfcd('0x36')](_0x3a0853['query']);_0x5e5d9b[_0xbfcd('0x37')]=_['intersection'](_0x5e5d9b[_0xbfcd('0x38')],_0x5e5d9b[_0xbfcd('0x39')]);_0x3cb4e4[_0xbfcd('0x3a')]=_['intersection'](_0x5e5d9b[_0xbfcd('0x38')],qs[_0xbfcd('0x3b')](_0x3a0853[_0xbfcd('0x39')]['fields']));_0x3cb4e4[_0xbfcd('0x3a')]=_0x3cb4e4[_0xbfcd('0x3a')][_0xbfcd('0x3c')]?_0x3cb4e4[_0xbfcd('0x3a')]:_0x5e5d9b['model'];if(!_0x3a0853['query'][_0xbfcd('0x3d')]('nolimit')){_0x3cb4e4[_0xbfcd('0x23')]=qs['limit'](_0x3a0853['query'][_0xbfcd('0x23')]);_0x3cb4e4['offset']=qs[_0xbfcd('0x21')](_0x3a0853['query'][_0xbfcd('0x21')]);}_0x3cb4e4[_0xbfcd('0x3e')]=qs['sort'](_0x3a0853[_0xbfcd('0x39')][_0xbfcd('0x3f')]);_0x3cb4e4['where']=qs[_0xbfcd('0x37')](_[_0xbfcd('0x40')](_0x3a0853[_0xbfcd('0x39')],_0x5e5d9b['filters']),_0x1a17a4);if(_0x3a0853[_0xbfcd('0x39')]['filter']){_0x3cb4e4[_0xbfcd('0x41')]=_['merge'](_0x3cb4e4[_0xbfcd('0x41')],{'$or':_['map'](_0x1a17a4,function(_0x24db2c){if(_0x24db2c[_0xbfcd('0x42')]!==_0xbfcd('0x43')){var _0xba0120={};_0xba0120[_0x24db2c[_0xbfcd('0x2f')]]={'$like':'%'+_0x3a0853[_0xbfcd('0x39')][_0xbfcd('0x44')]+'%'};return _0xba0120;}})});}_0x3cb4e4=_[_0xbfcd('0x45')]({},_0x3cb4e4,_0x3a0853[_0xbfcd('0x46')]);var _0x27f7cd={'where':_0x3cb4e4['where']};return db[_0xbfcd('0x32')][_0xbfcd('0x24')](_0x27f7cd)[_0xbfcd('0x29')](function(_0x444502){_0x418b5a[_0xbfcd('0x24')]=_0x444502;if(_0x3a0853['query'][_0xbfcd('0x47')]){_0x3cb4e4[_0xbfcd('0x48')]=[{'all':!![]}];}return db[_0xbfcd('0x32')]['findAll'](_0x3cb4e4);})[_0xbfcd('0x29')](function(_0x2ce990){_0x418b5a[_0xbfcd('0x49')]=_0x2ce990;return _0x418b5a;})[_0xbfcd('0x29')](respondWithFilteredResult(_0x30de24,_0x3cb4e4))[_0xbfcd('0x4a')](handleError(_0x30de24,null));};exports['show']=function(_0x5d905e,_0x504245){var _0x21ccc7={'raw':!![],'where':{'id':_0x5d905e[_0xbfcd('0x4b')]['id']}},_0x18d2fd={};_0x18d2fd['model']=_[_0xbfcd('0x36')](db[_0xbfcd('0x32')]['rawAttributes']);_0x18d2fd[_0xbfcd('0x39')]=_[_0xbfcd('0x36')](_0x5d905e[_0xbfcd('0x39')]);_0x18d2fd['filters']=_[_0xbfcd('0x4c')](_0x18d2fd[_0xbfcd('0x38')],_0x18d2fd[_0xbfcd('0x39')]);_0x21ccc7[_0xbfcd('0x3a')]=_[_0xbfcd('0x4c')](_0x18d2fd[_0xbfcd('0x38')],qs['fields'](_0x5d905e[_0xbfcd('0x39')]['fields']));_0x21ccc7[_0xbfcd('0x3a')]=_0x21ccc7[_0xbfcd('0x3a')][_0xbfcd('0x3c')]?_0x21ccc7[_0xbfcd('0x3a')]:_0x18d2fd[_0xbfcd('0x38')];if(_0x5d905e[_0xbfcd('0x39')][_0xbfcd('0x47')]){_0x21ccc7[_0xbfcd('0x48')]=[{'all':!![]}];}_0x21ccc7=_[_0xbfcd('0x45')]({},_0x21ccc7,_0x5d905e[_0xbfcd('0x46')]);return db['FaxQueue'][_0xbfcd('0x4d')](_0x21ccc7)[_0xbfcd('0x29')](handleEntityNotFound(_0x504245,null))[_0xbfcd('0x29')](respondWithResult(_0x504245,null))[_0xbfcd('0x4a')](handleError(_0x504245,null));};exports[_0xbfcd('0x4e')]=function(_0x24519a,_0x686abd){return db[_0xbfcd('0x32')][_0xbfcd('0x4e')](_0x24519a['body'],{})['then'](function(_0x13d5d2){var _0x4e04c9=_0x24519a[_0xbfcd('0x4f')]['get']({'plain':!![]});if(!_0x4e04c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e04c9[_0xbfcd('0x50')]===_0xbfcd('0x4f')){var _0x26fb4c=_0x13d5d2[_0xbfcd('0x2a')]({'plain':!![]});var _0x2dc689=_0xbfcd('0x2b');return db[_0xbfcd('0x51')][_0xbfcd('0x4d')]({'where':{'name':_0x2dc689,'userProfileId':_0x4e04c9['userProfileId']},'raw':!![]})[_0xbfcd('0x29')](function(_0x13bfdb){if(_0x13bfdb&&_0x13bfdb[_0xbfcd('0x52')]===0x0){return db[_0xbfcd('0x2c')]['create']({'name':_0x26fb4c[_0xbfcd('0x2f')],'resourceId':_0x26fb4c['id'],'type':_0x13bfdb[_0xbfcd('0x2f')],'sectionId':_0x13bfdb['id']},{})['then'](function(){return _0x13d5d2;});}else{return _0x13d5d2;}})[_0xbfcd('0x4a')](function(_0x367edf){logger[_0xbfcd('0x53')](_0xbfcd('0x54'),_0x367edf);throw _0x367edf;});}return _0x13d5d2;})[_0xbfcd('0x29')](respondWithResult(_0x686abd,0xc9))[_0xbfcd('0x4a')](handleError(_0x686abd,null));};exports[_0xbfcd('0x55')]=function(_0x387f48,_0x3b0c18){if(_0x387f48[_0xbfcd('0x56')]['id']){delete _0x387f48['body']['id'];}return db[_0xbfcd('0x32')][_0xbfcd('0x4d')]({'where':{'id':_0x387f48[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0x3b0c18,null))[_0xbfcd('0x29')](saveUpdates(_0x387f48[_0xbfcd('0x56')],null))[_0xbfcd('0x29')](respondWithResult(_0x3b0c18,null))['catch'](handleError(_0x3b0c18,null));};exports[_0xbfcd('0x2d')]=function(_0x307c8c,_0x507d53){return db[_0xbfcd('0x32')][_0xbfcd('0x4d')]({'where':{'id':_0x307c8c[_0xbfcd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x507d53,null))[_0xbfcd('0x29')](removeEntity(_0x507d53,null))['catch'](handleError(_0x507d53,null));};exports[_0xbfcd('0x57')]=function(_0x16c31e,_0x26d453){return db[_0xbfcd('0x32')][_0xbfcd('0x57')]()[_0xbfcd('0x29')](respondWithResult(_0x26d453,null))['catch'](handleError(_0x26d453,null));};exports[_0xbfcd('0x58')]=function(_0x41de50,_0xe1b06d,_0x2f3fc3){var _0x5774fd={'raw':!![],'where':{}},_0x21fc5={},_0x2bc611;return db[_0xbfcd('0x32')][_0xbfcd('0x59')]({'where':{'id':_0x41de50[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0xe1b06d,null))['then'](function(_0x3afc01){if(_0x3afc01){_0x2bc611=_0x3afc01[_0xbfcd('0x2a')]({'plain':!![]});_0x21fc5[_0xbfcd('0x38')]=_[_0xbfcd('0x36')](db[_0xbfcd('0x5a')]['rawAttributes']);_0x21fc5['query']=_[_0xbfcd('0x36')](_0x41de50[_0xbfcd('0x39')]);_0x21fc5['filters']=_[_0xbfcd('0x4c')](_0x21fc5[_0xbfcd('0x38')],_0x21fc5[_0xbfcd('0x39')]);_0x5774fd[_0xbfcd('0x3a')]=_[_0xbfcd('0x4c')](_0x21fc5[_0xbfcd('0x38')],qs[_0xbfcd('0x3b')](_0x41de50[_0xbfcd('0x39')]['fields']));_0x5774fd[_0xbfcd('0x3a')]=_0x5774fd[_0xbfcd('0x3a')]['length']?_0x5774fd[_0xbfcd('0x3a')]:_0x21fc5['model'];if(!_0x41de50[_0xbfcd('0x39')]['hasOwnProperty'](_0xbfcd('0x5b'))){_0x5774fd['limit']=qs[_0xbfcd('0x23')](_0x41de50[_0xbfcd('0x39')]['limit']);_0x5774fd[_0xbfcd('0x21')]=qs[_0xbfcd('0x21')](_0x41de50['query'][_0xbfcd('0x21')]);}_0x5774fd[_0xbfcd('0x3e')]=qs[_0xbfcd('0x3f')](_0x41de50[_0xbfcd('0x39')][_0xbfcd('0x3f')]);_0x5774fd[_0xbfcd('0x41')]=qs[_0xbfcd('0x37')](_[_0xbfcd('0x40')](_0x41de50[_0xbfcd('0x39')],_0x21fc5[_0xbfcd('0x37')]));_0x5774fd[_0xbfcd('0x41')][_0xbfcd('0x5c')]=_0x3afc01['id'];if(_0x41de50[_0xbfcd('0x39')][_0xbfcd('0x44')]){_0x5774fd[_0xbfcd('0x41')]=_[_0xbfcd('0x45')](_0x5774fd[_0xbfcd('0x41')],{'$or':_['map'](_0x5774fd[_0xbfcd('0x3a')],function(_0x1024d3){var _0x3a5586={};_0x3a5586[_0x1024d3]={'$like':'%'+_0x41de50['query']['filter']+'%'};return _0x3a5586;})});}_0x5774fd=_['merge']({},_0x5774fd,_0x41de50[_0xbfcd('0x46')]);return db[_0xbfcd('0x5a')][_0xbfcd('0x5d')](_0x5774fd);}})[_0xbfcd('0x29')](function(_0x1b7efb){if(_0x1b7efb){return db[_0xbfcd('0x5e')][_0xbfcd('0x5f')]({'where':{'id':_[_0xbfcd('0x31')](_0x1b7efb,_0xbfcd('0x60')),'role':_0xbfcd('0x61')},'attributes':['id',_0xbfcd('0x2f'),_0xbfcd('0x62'),'updatedAt',_0xbfcd('0x63')]});}})['then'](function(_0x4ab9cc){if(_0x4ab9cc){return{'count':_0x4ab9cc['count'],'rows':_['map'](_0x4ab9cc['rows'],function(_0x15b29a){return{'membername':_0x15b29a[_0xbfcd('0x2f')],'UserId':_0x15b29a['id'],'queue_name':_0x2bc611[_0xbfcd('0x2f')],'FaxQueueId':_0x2bc611['id'],'interface':util[_0xbfcd('0x64')](_0xbfcd('0x65'),'SIP',_0x15b29a[_0xbfcd('0x2f')]),'penalty':0x0,'paused':_0x15b29a[_0xbfcd('0x62')],'createdAt':_0x15b29a[_0xbfcd('0x63')],'updatedAt':_0x15b29a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xe1b06d,_0x5774fd))[_0xbfcd('0x4a')](handleError(_0xe1b06d,null));};exports[_0xbfcd('0x66')]=function(_0x1226bc,_0x1bca6e,_0x4db1){var _0x453b9f={};var _0x2cbfd2={};var _0x5f1829;var _0x35873c;return db[_0xbfcd('0x32')][_0xbfcd('0x59')]({'where':{'id':_0x1226bc[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0x1bca6e,null))[_0xbfcd('0x29')](function(_0x320224){if(_0x320224){_0x5f1829=_0x320224;_0x2cbfd2[_0xbfcd('0x38')]=_['keys'](db[_0xbfcd('0x67')]['rawAttributes']);_0x2cbfd2[_0xbfcd('0x39')]=_[_0xbfcd('0x36')](_0x1226bc[_0xbfcd('0x39')]);_0x2cbfd2[_0xbfcd('0x37')]=_['intersection'](_0x2cbfd2[_0xbfcd('0x38')],_0x2cbfd2[_0xbfcd('0x39')]);_0x453b9f['attributes']=_['intersection'](_0x2cbfd2[_0xbfcd('0x38')],qs[_0xbfcd('0x3b')](_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x3b')]));_0x453b9f[_0xbfcd('0x3a')]=_0x453b9f[_0xbfcd('0x3a')][_0xbfcd('0x3c')]?_0x453b9f[_0xbfcd('0x3a')]:_0x2cbfd2['model'];_0x453b9f[_0xbfcd('0x3e')]=qs[_0xbfcd('0x3f')](_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x3f')]);_0x453b9f[_0xbfcd('0x41')]=qs[_0xbfcd('0x37')](_[_0xbfcd('0x40')](_0x1226bc[_0xbfcd('0x39')],_0x2cbfd2[_0xbfcd('0x37')]));if(_0x1226bc['query'][_0xbfcd('0x44')]){_0x453b9f['where']=_[_0xbfcd('0x45')](_0x453b9f[_0xbfcd('0x41')],{'$or':_[_0xbfcd('0x31')](_0x453b9f[_0xbfcd('0x3a')],function(_0xbbd346){var _0x3ba1c1={};_0x3ba1c1[_0xbbd346]={'$like':'%'+_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x44')]+'%'};return _0x3ba1c1;})});}_0x453b9f=_['merge']({},_0x453b9f,_0x1226bc[_0xbfcd('0x46')]);return _0x5f1829[_0xbfcd('0x66')](_0x453b9f);}})[_0xbfcd('0x29')](function(_0x1bd88b){if(_0x1bd88b){_0x35873c=_0x1bd88b[_0xbfcd('0x3c')];if(!_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x3d')](_0xbfcd('0x5b'))){_0x453b9f['limit']=qs[_0xbfcd('0x23')](_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x23')]);_0x453b9f[_0xbfcd('0x21')]=qs[_0xbfcd('0x21')](_0x1226bc[_0xbfcd('0x39')][_0xbfcd('0x21')]);}return _0x5f1829[_0xbfcd('0x66')](_0x453b9f);}})[_0xbfcd('0x29')](function(_0x46d51a){if(_0x46d51a){return _0x46d51a?{'count':_0x35873c,'rows':_0x46d51a}:null;}})[_0xbfcd('0x29')](respondWithResult(_0x1bca6e,null))['catch'](handleError(_0x1bca6e,null));};exports[_0xbfcd('0x68')]=function(_0x2fe6f1,_0x6629c5,_0x486bab){var _0x413ba2=_0x2fe6f1[_0xbfcd('0x56')]['ids'];return db[_0xbfcd('0x67')]['findAll']({'where':{'id':_0x413ba2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbfcd('0x69'),'attributes':['id',_0xbfcd('0x2f'),_0xbfcd('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0xbfcd('0x29')](function(_0x2c0a5d){if(_0x2c0a5d){var _0x331205=_[_0xbfcd('0x6b')](_0x2c0a5d,function(_0x34f562){var _0x2a5460=_0x34f562['get']({'plain':!![]});return _0x2a5460['Agents'];});return db[_0xbfcd('0x32')][_0xbfcd('0x4d')]({'where':{'id':_0x2fe6f1[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](function(_0x2cf88b){return db['sequelize'][_0xbfcd('0x6c')](function(_0x413acf){return _0x2cf88b[_0xbfcd('0x68')](_0x413ba2,{'transaction':_0x413acf})['then'](function(){return BPromise[_0xbfcd('0x6d')](_0x331205,function(_0x53f17d){return db[_0xbfcd('0x5a')][_0xbfcd('0x6e')]({'where':{'UserId':_0x53f17d['id'],'FaxQueueId':_0x2fe6f1['params']['id']},'transaction':_0x413acf});});})[_0xbfcd('0x29')](function(){_0x331205['forEach'](function(_0x5bc597){socket['emit'](_0xbfcd('0x6f'),{'UserId':_0x5bc597['id'],'FaxQueueId':_0x2cf88b['id']});});});});});}})[_0xbfcd('0x29')](respondWithStatusCode(_0x6629c5,null))[_0xbfcd('0x4a')](handleError(_0x6629c5,null));};exports[_0xbfcd('0x70')]=function(_0x4e2da1,_0x225f78,_0x3d8727){return db[_0xbfcd('0x67')][_0xbfcd('0x5d')]({'where':{'id':_0x4e2da1['query'][_0xbfcd('0x71')]},'attributes':['id'],'include':[{'model':db[_0xbfcd('0x5e')],'as':_0xbfcd('0x69'),'attributes':['id'],'raw':!![]}]})[_0xbfcd('0x29')](handleEntityNotFound(_0x225f78,null))['then'](function(_0x505a29){var _0x2c003f=_[_0xbfcd('0x31')](_0x505a29,'id');var _0xb42538=[];var _0x59d54d=[];var _0x45b0a=squel[_0xbfcd('0x72')]();_0x45b0a[_0xbfcd('0x73')]('tq.TeamId')[_0xbfcd('0x74')](_0xbfcd('0x75'),'tq')[_0xbfcd('0x76')](_0xbfcd('0x77'),'ut',_0xbfcd('0x78'))[_0xbfcd('0x41')](_0xbfcd('0x79'),_0x4e2da1[_0xbfcd('0x4b')]['id']);for(var _0x316c03=0x0;_0x316c03<_0x505a29['length'];_0x316c03+=0x1){let _0x5716e3=_0x505a29[_0x316c03];for(var _0x56fd9d=0x0;_0x56fd9d<_0x5716e3[_0xbfcd('0x69')][_0xbfcd('0x3c')];_0x56fd9d+=0x1){let _0x1e6219=_0x5716e3[_0xbfcd('0x69')][_0x56fd9d];var _0x4b43b2=_0x45b0a[_0xbfcd('0x7a')]();_0x4b43b2[_0xbfcd('0x41')]('ut.UserId\x20=\x20?',_0x1e6219['id']);_0x59d54d[_0xbfcd('0x7b')](db[_0xbfcd('0x7c')][_0xbfcd('0x39')](_0x4b43b2[_0xbfcd('0x7d')](),{'type':db[_0xbfcd('0x7c')][_0xbfcd('0x7e')][_0xbfcd('0x7f')]})[_0xbfcd('0x29')](function(_0x15fe0a){if(_0x15fe0a[_0xbfcd('0x3c')]===0x1){return _0x1e6219['id'];}else{var _0x5c716c=_['every'](_[_0xbfcd('0x31')](_0x15fe0a,_0xbfcd('0x80')),function(_0x43c4b4){return _[_0xbfcd('0x81')](_0x2c003f,_0x43c4b4);});if(_0x5c716c){return _0x1e6219['id'];}}}));}}return BPromise[_0xbfcd('0x82')](_0x59d54d)['then'](function(_0x564a7b){_0xb42538=_(_0xb42538)[_0xbfcd('0x83')](_0x564a7b)['compact']()[_0xbfcd('0x84')]();return db['FaxQueue']['find']({'where':{'id':_0x4e2da1[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](function(_0x36783c){return db[_0xbfcd('0x7c')][_0xbfcd('0x6c')](function(_0xdc3cae){return _0x36783c['removeTeams'](_0x4e2da1[_0xbfcd('0x39')][_0xbfcd('0x71')],{'transaction':_0xdc3cae})[_0xbfcd('0x29')](function(){if(!_[_0xbfcd('0x85')](_0xb42538)){return _0x36783c['removeAgents'](_0xb42538,{'transaction':_0xdc3cae});}})[_0xbfcd('0x29')](function(){_0xb42538[_0xbfcd('0x86')](function(_0x3b1a02){socket['emit'](_0xbfcd('0x87'),{'UserId':_0x3b1a02,'FaxQueueId':_0x36783c['id']});});});});});});})[_0xbfcd('0x29')](respondWithStatusCode(_0x225f78,null))['catch'](handleError(_0x225f78,null));};exports[_0xbfcd('0x88')]=function(_0x24cf7c,_0x51ee37,_0x20ce99){return db[_0xbfcd('0x32')][_0xbfcd('0x4d')]({'where':{'id':_0x24cf7c[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0x51ee37,null))[_0xbfcd('0x29')](function(_0x2dec9c){if(_0x2dec9c){return _0x2dec9c[_0xbfcd('0x88')](_0x24cf7c[_0xbfcd('0x56')][_0xbfcd('0x71')],_[_0xbfcd('0x89')](_0x24cf7c[_0xbfcd('0x56')],[_0xbfcd('0x71'),'id'])||{})[_0xbfcd('0x8a')](function(_0x2a9cc4){for(var _0x514641=0x0;_0x514641<_0x24cf7c[_0xbfcd('0x56')][_0xbfcd('0x71')]['length'];_0x514641+=0x1){socket['emit'](_0xbfcd('0x6f'),{'UserId':Number(_0x24cf7c[_0xbfcd('0x56')][_0xbfcd('0x71')][_0x514641]),'FaxQueueId':Number(_0x24cf7c[_0xbfcd('0x4b')]['id'])});}return _0x2a9cc4;});}})[_0xbfcd('0x29')](respondWithResult(_0x51ee37,null))[_0xbfcd('0x4a')](handleError(_0x51ee37,null));};exports['removeAgents']=function(_0x953b8,_0x38fd5a,_0x336055){return db[_0xbfcd('0x32')][_0xbfcd('0x4d')]({'where':{'id':_0x953b8[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0x38fd5a,null))[_0xbfcd('0x29')](function(_0x1e020f){if(_0x1e020f){return _0x1e020f['removeAgents'](_0x953b8[_0xbfcd('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x953b8[_0xbfcd('0x39')]['ids'])){for(var _0x3df852=0x0;_0x3df852<_0x953b8[_0xbfcd('0x39')][_0xbfcd('0x71')][_0xbfcd('0x3c')];_0x3df852+=0x1){socket[_0xbfcd('0x8b')](_0xbfcd('0x87'),{'UserId':Number(_0x953b8[_0xbfcd('0x39')][_0xbfcd('0x71')][_0x3df852]),'FaxQueueId':Number(_0x953b8[_0xbfcd('0x4b')]['id'])});}}else{socket[_0xbfcd('0x8b')](_0xbfcd('0x87'),{'UserId':Number(_0x953b8[_0xbfcd('0x39')][_0xbfcd('0x71')]),'FaxQueueId':Number(_0x953b8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x38fd5a,null))[_0xbfcd('0x4a')](handleError(_0x38fd5a,null));};exports[_0xbfcd('0x8c')]=function(_0x144220,_0x304f97,_0x6ec4ab){var _0x88a92b={};var _0x3af180={};var _0x23b45c;var _0x17292f;return db[_0xbfcd('0x32')][_0xbfcd('0x59')]({'where':{'id':_0x144220[_0xbfcd('0x4b')]['id']}})[_0xbfcd('0x29')](handleEntityNotFound(_0x304f97,null))['then'](function(_0x1fd5a9){if(_0x1fd5a9){_0x23b45c=_0x1fd5a9;_0x3af180['model']=_['keys'](db[_0xbfcd('0x5e')][_0xbfcd('0x33')]);_0x3af180[_0xbfcd('0x39')]=_[_0xbfcd('0x36')](_0x144220[_0xbfcd('0x39')]);_0x3af180[_0xbfcd('0x37')]=_[_0xbfcd('0x4c')](_0x3af180[_0xbfcd('0x38')],_0x3af180[_0xbfcd('0x39')]);_0x88a92b[_0xbfcd('0x3a')]=_[_0xbfcd('0x4c')](_0x3af180[_0xbfcd('0x38')],qs[_0xbfcd('0x3b')](_0x144220[_0xbfcd('0x39')][_0xbfcd('0x3b')]));_0x88a92b[_0xbfcd('0x3a')]=_0x88a92b['attributes'][_0xbfcd('0x3c')]?_0x88a92b['attributes']:_0x3af180[_0xbfcd('0x38')];_0x88a92b[_0xbfcd('0x3e')]=qs['sort'](_0x144220[_0xbfcd('0x39')][_0xbfcd('0x3f')]);_0x88a92b['where']=qs['filters'](_[_0xbfcd('0x40')](_0x144220[_0xbfcd('0x39')],_0x3af180['filters']));if(_0x144220[_0xbfcd('0x39')][_0xbfcd('0x44')]){_0x88a92b[_0xbfcd('0x41')]=_['merge'](_0x88a92b['where'],{'$or':_['map'](_0x88a92b['attributes'],function(_0xf8e251){var _0x44f653={};_0x44f653[_0xf8e251]={'$like':'%'+_0x144220[_0xbfcd('0x39')][_0xbfcd('0x44')]+'%'};return _0x44f653;})});}_0x88a92b=_[_0xbfcd('0x45')]({},_0x88a92b,_0x144220['options']);return _0x23b45c[_0xbfcd('0x8c')](_0x88a92b);}})['then'](function(_0x52ea64){if(_0x52ea64){_0x17292f=_0x52ea64[_0xbfcd('0x3c')];if(!_0x144220['query'][_0xbfcd('0x3d')](_0xbfcd('0x5b'))){_0x88a92b[_0xbfcd('0x23')]=qs[_0xbfcd('0x23')](_0x144220[_0xbfcd('0x39')]['limit']);_0x88a92b[_0xbfcd('0x21')]=qs['offset'](_0x144220[_0xbfcd('0x39')][_0xbfcd('0x21')]);}return _0x23b45c[_0xbfcd('0x8c')](_0x88a92b);}})[_0xbfcd('0x29')](function(_0x5089f1){if(_0x5089f1){return _0x5089f1?{'count':_0x17292f,'rows':_0x5089f1}:null;}})[_0xbfcd('0x29')](respondWithResult(_0x304f97,null))['catch'](handleError(_0x304f97,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ddb2984..80f9ce2 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 _0xe6e5=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x3f9c37,_0x11afdc){var _0x583e2a=function(_0x365aea){while(--_0x365aea){_0x3f9c37['push'](_0x3f9c37['shift']());}};_0x583e2a(++_0x11afdc);}(_0xe6e5,0x88));var _0x5e6e=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe6e5[_0x1da527];return _0x40fc7c;};'use strict';var EventEmitter=require(_0x5e6e('0x0'));var FaxQueue=require(_0x5e6e('0x1'))['db'][_0x5e6e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5e6e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e6e('0x4'),'afterDestroy':_0x5e6e('0x5')};function emitEvent(_0x4012f3){return function(_0x51c9cb,_0x562aa1,_0x458bff){FaxQueueEvents[_0x5e6e('0x6')](_0x4012f3+':'+_0x51c9cb['id'],_0x51c9cb);FaxQueueEvents[_0x5e6e('0x6')](_0x4012f3,_0x51c9cb);_0x458bff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x5e6e('0x7')](e,emitEvent(event));}}module[_0x5e6e('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xd8ae=['events','FaxQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xd8ae,0x99));var _0xed8a=function(_0x393213,_0x4d56e8){_0x393213=_0x393213-0x0;var _0x5b8d4c=_0xd8ae[_0x393213];return _0x5b8d4c;};'use strict';var EventEmitter=require(_0xed8a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xed8a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed8a('0x2'),'afterUpdate':_0xed8a('0x3'),'afterDestroy':_0xed8a('0x4')};function emitEvent(_0x5f2163){return function(_0x31737c,_0x1eb889,_0x801672){FaxQueueEvents['emit'](_0x5f2163+':'+_0x31737c['id'],_0x31737c);FaxQueueEvents[_0xed8a('0x5')](_0x5f2163,_0x31737c);_0x801672(null);};}for(var e in events){if(events[_0xed8a('0x6')](e)){var event=events[e];FaxQueue[_0xed8a('0x7')](e,emitEvent(event));}}module[_0xed8a('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 6a2bde5..8a684a9 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 _0xf9a2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x218756,_0x419c39){var _0x1b90ec=function(_0x237c8e){while(--_0x237c8e){_0x218756['push'](_0x218756['shift']());}};_0x1b90ec(++_0x419c39);}(_0xf9a2,0x1da));var _0x2f9a=function(_0x2da7d5,_0x42e03f){_0x2da7d5=_0x2da7d5-0x0;var _0x49f156=_0xf9a2[_0x2da7d5];return _0x49f156;};'use strict';var _=require(_0x2f9a('0x0'));var util=require('util');var logger=require(_0x2f9a('0x1'))(_0x2f9a('0x2'));var moment=require(_0x2f9a('0x3'));var BPromise=require(_0x2f9a('0x4'));var rp=require(_0x2f9a('0x5'));var fs=require('fs');var path=require(_0x2f9a('0x6'));var rimraf=require(_0x2f9a('0x7'));var config=require(_0x2f9a('0x8'));var attributes=require(_0x2f9a('0x9'));module[_0x2f9a('0xa')]=function(_0x30db82,_0x9da15){return _0x30db82[_0x2f9a('0xb')](_0x2f9a('0xc'),attributes,{'tableName':_0x2f9a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34a9=['lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x29d843,_0x3e6c0e){var _0x5351e9=function(_0x39fdff){while(--_0x39fdff){_0x29d843['push'](_0x29d843['shift']());}};_0x5351e9(++_0x3e6c0e);}(_0x34a9,0x1a2));var _0x934a=function(_0x1f6656,_0x388cf5){_0x1f6656=_0x1f6656-0x0;var _0x20ab9e=_0x34a9[_0x1f6656];return _0x20ab9e;};'use strict';var _=require(_0x934a('0x0'));var util=require('util');var logger=require(_0x934a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x934a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x934a('0x3'));var rimraf=require(_0x934a('0x4'));var config=require(_0x934a('0x5'));var attributes=require(_0x934a('0x6'));module[_0x934a('0x7')]=function(_0x2eb40b,_0x4bf34c){return _0x2eb40b[_0x934a('0x8')](_0x934a('0x9'),attributes,{'tableName':_0x934a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 42735db..ee749bf 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 _0xedcd=['where','attributes','limit','include','map','model','then','ShowFaxQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw'];(function(_0x411abe,_0x2d60ca){var _0x4b43c3=function(_0x1e75bb){while(--_0x1e75bb){_0x411abe['push'](_0x411abe['shift']());}};_0x4b43c3(++_0x2d60ca);}(_0xedcd,0x138));var _0xdedc=function(_0x1b17f5,_0x26cc08){_0x1b17f5=_0x1b17f5-0x0;var _0x503040=_0xedcd[_0x1b17f5];return _0x503040;};'use strict';var _=require(_0xdedc('0x0'));var util=require(_0xdedc('0x1'));var moment=require('moment');var BPromise=require(_0xdedc('0x2'));var rs=require(_0xdedc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdedc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdedc('0x5'))(_0xdedc('0x6'));var config=require(_0xdedc('0x7'));var jayson=require(_0xdedc('0x8'));var client=jayson[_0xdedc('0x9')][_0xdedc('0xa')]({'port':0x232a});config[_0xdedc('0xb')]=_['defaults'](config[_0xdedc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdedc('0xc'))(new Redis(config[_0xdedc('0xb')]));require(_0xdedc('0xd'))[_0xdedc('0xe')](socket);function respondWithRpcPromise(_0x44c936,_0x2683a8,_0x5dff43){return new BPromise(function(_0x669c84,_0x14b2de){return client[_0xdedc('0xf')](_0x44c936,_0x5dff43)['then'](function(_0x4ca31f){logger[_0xdedc('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2683a8,_0xdedc('0x11'));logger[_0xdedc('0x12')](_0xdedc('0x13'),_0x2683a8,_0xdedc('0x11'),JSON[_0xdedc('0x14')](_0x4ca31f));if(_0x4ca31f[_0xdedc('0x15')]){if(_0x4ca31f[_0xdedc('0x15')]['code']===0x1f4){logger[_0xdedc('0x15')](_0xdedc('0x16'),_0x2683a8,_0x4ca31f[_0xdedc('0x15')][_0xdedc('0x17')]);return _0x14b2de(_0x4ca31f['error'][_0xdedc('0x17')]);}logger['error'](_0xdedc('0x16'),_0x2683a8,_0x4ca31f[_0xdedc('0x15')][_0xdedc('0x17')]);return _0x669c84(_0x4ca31f['error'][_0xdedc('0x17')]);}else{logger[_0xdedc('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2683a8,'request\x20sent');_0x669c84(_0x4ca31f['result']['message']);}})[_0xdedc('0x18')](function(_0x4a3a06){logger[_0xdedc('0x15')](_0xdedc('0x16'),_0x2683a8,_0x4a3a06);_0x14b2de(_0x4a3a06);});});}exports[_0xdedc('0x19')]=function(_0x229870){var _0x5c91e3=this;return new Promise(function(_0x421123,_0xd87c7c){return db[_0xdedc('0x1a')][_0xdedc('0x1b')]({'raw':_0x229870[_0xdedc('0x1c')]?_0x229870[_0xdedc('0x1c')][_0xdedc('0x1d')]===undefined?!![]:![]:!![],'where':_0x229870[_0xdedc('0x1c')]?_0x229870[_0xdedc('0x1c')][_0xdedc('0x1e')]||null:null,'attributes':_0x229870[_0xdedc('0x1c')]?_0x229870[_0xdedc('0x1c')][_0xdedc('0x1f')]||null:null,'limit':_0x229870['options']?_0x229870[_0xdedc('0x1c')][_0xdedc('0x20')]||null:null,'include':_0x229870['options']?_0x229870[_0xdedc('0x1c')][_0xdedc('0x21')]?_[_0xdedc('0x22')](_0x229870[_0xdedc('0x1c')][_0xdedc('0x21')],function(_0x6e1a04){return{'model':db[_0x6e1a04[_0xdedc('0x23')]],'as':_0x6e1a04['as'],'attributes':_0x6e1a04['attributes'],'include':_0x6e1a04[_0xdedc('0x21')]?_[_0xdedc('0x22')](_0x6e1a04[_0xdedc('0x21')],function(_0x1e2364){return{'model':db[_0x1e2364[_0xdedc('0x23')]],'as':_0x1e2364['as'],'attributes':_0x1e2364[_0xdedc('0x1f')],'include':_0x1e2364[_0xdedc('0x21')]?_[_0xdedc('0x22')](_0x1e2364[_0xdedc('0x21')],function(_0x5f0795){return{'model':db[_0x5f0795['model']],'as':_0x5f0795['as'],'attributes':_0x5f0795[_0xdedc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdedc('0x24')](function(_0x172258){logger[_0xdedc('0x10')](_0xdedc('0x19'),_0x229870);logger[_0xdedc('0x12')](_0xdedc('0x19'),_0x229870,JSON['stringify'](_0x172258));_0x421123(_0x172258);})[_0xdedc('0x18')](function(_0x3bd469){logger[_0xdedc('0x15')](_0xdedc('0x19'),_0x3bd469[_0xdedc('0x17')],_0x229870);_0xd87c7c(_0x5c91e3['error'](0x1f4,_0x3bd469[_0xdedc('0x17')]));});});};exports['ShowFaxQueue']=function(_0x57f3b8){var _0x32d6f7=this;return new Promise(function(_0x4258ef,_0x236c89){return db['FaxQueue']['find']({'raw':_0x57f3b8[_0xdedc('0x1c')]?_0x57f3b8[_0xdedc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x57f3b8['options']?_0x57f3b8[_0xdedc('0x1c')][_0xdedc('0x1e')]||null:null,'attributes':_0x57f3b8['options']?_0x57f3b8[_0xdedc('0x1c')][_0xdedc('0x1f')]||null:null,'include':_0x57f3b8['options']?_0x57f3b8[_0xdedc('0x1c')]['include']?_['map'](_0x57f3b8[_0xdedc('0x1c')][_0xdedc('0x21')],function(_0x39d572){return{'model':db[_0x39d572[_0xdedc('0x23')]],'as':_0x39d572['as'],'attributes':_0x39d572[_0xdedc('0x1f')],'include':_0x39d572[_0xdedc('0x21')]?_['map'](_0x39d572[_0xdedc('0x21')],function(_0x68594f){return{'model':db[_0x68594f[_0xdedc('0x23')]],'as':_0x68594f['as'],'attributes':_0x68594f[_0xdedc('0x1f')],'include':_0x68594f[_0xdedc('0x21')]?_[_0xdedc('0x22')](_0x68594f[_0xdedc('0x21')],function(_0x22ca6f){return{'model':db[_0x22ca6f['model']],'as':_0x22ca6f['as'],'attributes':_0x22ca6f[_0xdedc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdedc('0x24')](function(_0x5e1abe){logger[_0xdedc('0x10')](_0xdedc('0x25'),_0x57f3b8);logger[_0xdedc('0x12')]('ShowFaxQueue',_0x57f3b8,JSON[_0xdedc('0x14')](_0x5e1abe));_0x4258ef(_0x5e1abe);})[_0xdedc('0x18')](function(_0x2fb3de){logger[_0xdedc('0x15')](_0xdedc('0x25'),_0x2fb3de[_0xdedc('0x17')],_0x57f3b8);_0x236c89(_0x32d6f7[_0xdedc('0x15')](0x1f4,_0x2fb3de[_0xdedc('0x17')]));});});}; \ No newline at end of file +var _0x0471=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x0471,0x9d));var _0x1047=function(_0x3f974f,_0x427777){_0x3f974f=_0x3f974f-0x0;var _0x13f0d1=_0x0471[_0x3f974f];return _0x13f0d1;};'use strict';var _=require(_0x1047('0x0'));var util=require(_0x1047('0x1'));var moment=require(_0x1047('0x2'));var BPromise=require(_0x1047('0x3'));var rs=require(_0x1047('0x4'));var fs=require('fs');var Redis=require(_0x1047('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1047('0x6'));var logger=require(_0x1047('0x7'))('rpc');var config=require(_0x1047('0x8'));var jayson=require(_0x1047('0x9'));var client=jayson[_0x1047('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1047('0xb')](config[_0x1047('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1047('0xd'))(new Redis(config['redis']));require(_0x1047('0xe'))[_0x1047('0xf')](socket);function respondWithRpcPromise(_0x4a8193,_0x3b4fd4,_0x40d234){return new BPromise(function(_0x3a8862,_0x2ccb68){return client[_0x1047('0x10')](_0x4a8193,_0x40d234)[_0x1047('0x11')](function(_0x544899){logger[_0x1047('0x12')](_0x1047('0x13'),_0x3b4fd4,_0x1047('0x14'));logger[_0x1047('0x15')](_0x1047('0x16'),_0x3b4fd4,_0x1047('0x14'),JSON[_0x1047('0x17')](_0x544899));if(_0x544899['error']){if(_0x544899[_0x1047('0x18')]['code']===0x1f4){logger['error'](_0x1047('0x13'),_0x3b4fd4,_0x544899[_0x1047('0x18')][_0x1047('0x19')]);return _0x2ccb68(_0x544899[_0x1047('0x18')][_0x1047('0x19')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x3b4fd4,_0x544899[_0x1047('0x18')][_0x1047('0x19')]);return _0x3a8862(_0x544899['error'][_0x1047('0x19')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x3b4fd4,_0x1047('0x14'));_0x3a8862(_0x544899[_0x1047('0x1a')][_0x1047('0x19')]);}})[_0x1047('0x1b')](function(_0xc1c51f){logger[_0x1047('0x18')]('FaxQueue,\x20%s,\x20%s',_0x3b4fd4,_0xc1c51f);_0x2ccb68(_0xc1c51f);});});}exports[_0x1047('0x1c')]=function(_0x41b4d8){var _0x4976d7=this;return new Promise(function(_0x58cd63,_0x37193e){return db['FaxQueue'][_0x1047('0x1d')]({'raw':_0x41b4d8[_0x1047('0x1e')]?_0x41b4d8[_0x1047('0x1e')][_0x1047('0x1f')]===undefined?!![]:![]:!![],'where':_0x41b4d8[_0x1047('0x1e')]?_0x41b4d8[_0x1047('0x1e')][_0x1047('0x20')]||null:null,'attributes':_0x41b4d8['options']?_0x41b4d8['options'][_0x1047('0x21')]||null:null,'limit':_0x41b4d8[_0x1047('0x1e')]?_0x41b4d8[_0x1047('0x1e')][_0x1047('0x22')]||null:null,'include':_0x41b4d8[_0x1047('0x1e')]?_0x41b4d8[_0x1047('0x1e')][_0x1047('0x23')]?_[_0x1047('0x24')](_0x41b4d8[_0x1047('0x1e')]['include'],function(_0x10eb4f){return{'model':db[_0x10eb4f[_0x1047('0x25')]],'as':_0x10eb4f['as'],'attributes':_0x10eb4f[_0x1047('0x21')],'include':_0x10eb4f[_0x1047('0x23')]?_[_0x1047('0x24')](_0x10eb4f[_0x1047('0x23')],function(_0x247093){return{'model':db[_0x247093[_0x1047('0x25')]],'as':_0x247093['as'],'attributes':_0x247093[_0x1047('0x21')],'include':_0x247093[_0x1047('0x23')]?_['map'](_0x247093[_0x1047('0x23')],function(_0x1e78ef){return{'model':db[_0x1e78ef[_0x1047('0x25')]],'as':_0x1e78ef['as'],'attributes':_0x1e78ef[_0x1047('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1047('0x11')](function(_0xf8ff6f){logger[_0x1047('0x12')](_0x1047('0x1c'),_0x41b4d8);logger[_0x1047('0x15')](_0x1047('0x1c'),_0x41b4d8,JSON[_0x1047('0x17')](_0xf8ff6f));_0x58cd63(_0xf8ff6f);})[_0x1047('0x1b')](function(_0x270b0d){logger['error'](_0x1047('0x1c'),_0x270b0d[_0x1047('0x19')],_0x41b4d8);_0x37193e(_0x4976d7[_0x1047('0x18')](0x1f4,_0x270b0d[_0x1047('0x19')]));});});};exports[_0x1047('0x26')]=function(_0x12756b){var _0x5ef73b=this;return new Promise(function(_0x3c2ea9,_0x2eabae){return db['FaxQueue'][_0x1047('0x27')]({'raw':_0x12756b[_0x1047('0x1e')]?_0x12756b['options'][_0x1047('0x1f')]===undefined?!![]:![]:!![],'where':_0x12756b[_0x1047('0x1e')]?_0x12756b[_0x1047('0x1e')][_0x1047('0x20')]||null:null,'attributes':_0x12756b[_0x1047('0x1e')]?_0x12756b['options'][_0x1047('0x21')]||null:null,'include':_0x12756b['options']?_0x12756b[_0x1047('0x1e')]['include']?_[_0x1047('0x24')](_0x12756b[_0x1047('0x1e')][_0x1047('0x23')],function(_0x5b5583){return{'model':db[_0x5b5583[_0x1047('0x25')]],'as':_0x5b5583['as'],'attributes':_0x5b5583['attributes'],'include':_0x5b5583[_0x1047('0x23')]?_[_0x1047('0x24')](_0x5b5583[_0x1047('0x23')],function(_0xfac1a0){return{'model':db[_0xfac1a0[_0x1047('0x25')]],'as':_0xfac1a0['as'],'attributes':_0xfac1a0['attributes'],'include':_0xfac1a0['include']?_[_0x1047('0x24')](_0xfac1a0[_0x1047('0x23')],function(_0x2b076d){return{'model':db[_0x2b076d[_0x1047('0x25')]],'as':_0x2b076d['as'],'attributes':_0x2b076d[_0x1047('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1047('0x11')](function(_0x42be1c){logger[_0x1047('0x12')](_0x1047('0x26'),_0x12756b);logger['debug']('ShowFaxQueue',_0x12756b,JSON['stringify'](_0x42be1c));_0x3c2ea9(_0x42be1c);})[_0x1047('0x1b')](function(_0x214a4f){logger[_0x1047('0x18')](_0x1047('0x26'),_0x214a4f['message'],_0x12756b);_0x2eabae(_0x5ef73b[_0x1047('0x18')](0x1f4,_0x214a4f[_0x1047('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 8a17f86..ab64acd 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 _0xb95d=['save','remove','update','emit','removeListener','register','length','./faxQueue.events'];(function(_0x1da515,_0x3e44c6){var _0x9ea2c1=function(_0x4c2928){while(--_0x4c2928){_0x1da515['push'](_0x1da515['shift']());}};_0x9ea2c1(++_0x3e44c6);}(_0xb95d,0x13f));var _0xdb95=function(_0x57ac7c,_0x13eb14){_0x57ac7c=_0x57ac7c-0x0;var _0x52d72c=_0xb95d[_0x57ac7c];return _0x52d72c;};'use strict';var FaxQueueEvents=require(_0xdb95('0x0'));var events=[_0xdb95('0x1'),_0xdb95('0x2'),_0xdb95('0x3')];function createListener(_0x1646bf,_0xf192ea){return function(_0x206da1){_0xf192ea[_0xdb95('0x4')](_0x1646bf,_0x206da1);};}function removeListener(_0x550436,_0x310a44){return function(){FaxQueueEvents[_0xdb95('0x5')](_0x550436,_0x310a44);};}exports[_0xdb95('0x6')]=function(_0x602baa){for(var _0x56103e=0x0,_0x1774e2=events[_0xdb95('0x7')];_0x56103e<_0x1774e2;_0x56103e++){var _0x4c8da2=events[_0x56103e];var _0x2973e4=createListener('faxQueue:'+_0x4c8da2,_0x602baa);FaxQueueEvents['on'](_0x4c8da2,_0x2973e4);}}; \ No newline at end of file +var _0x04f5=['remove','emit','removeListener','register','faxQueue:','./faxQueue.events','save'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x04f5,0x1a9));var _0x504f=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x04f5[_0x107f10];return _0x811cab;};'use strict';var FaxQueueEvents=require(_0x504f('0x0'));var events=[_0x504f('0x1'),_0x504f('0x2'),'update'];function createListener(_0x56d6f5,_0x3b7b84){return function(_0x1c9a12){_0x3b7b84[_0x504f('0x3')](_0x56d6f5,_0x1c9a12);};}function removeListener(_0x1f7b3f,_0x34f265){return function(){FaxQueueEvents[_0x504f('0x4')](_0x1f7b3f,_0x34f265);};}exports[_0x504f('0x5')]=function(_0x476f83){for(var _0x27ac19=0x0,_0x40ea1e=events['length'];_0x27ac19<_0x40ea1e;_0x27ac19++){var _0x46b5bd=events[_0x27ac19];var _0x37fbe6=createListener(_0x504f('0x6')+_0x46b5bd,_0x476f83);FaxQueueEvents['on'](_0x46b5bd,_0x37fbe6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 1836859..14982c2 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 _0x1a37=['/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3ee304,_0x489b28){var _0x20e697=function(_0x4aa49a){while(--_0x4aa49a){_0x3ee304['push'](_0x3ee304['shift']());}};_0x20e697(++_0x489b28);}(_0x1a37,0xb4));var _0x71a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1a37[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./faxQueue.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getTeams']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0x13')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x13')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x15')]);router[_0x71a3('0x13')](_0x71a3('0x16'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x71a3('0x19')]);router[_0x71a3('0x1a')](_0x71a3('0x1b'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1c')]);router[_0x71a3('0x1a')]('/:id/teams',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1d')]);router['delete']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);module[_0x71a3('0x1f')]=router; \ No newline at end of file +var _0xaa64=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x5e6fe1,_0x4d8f22){var _0xc7459=function(_0x144471){while(--_0x144471){_0x5e6fe1['push'](_0x5e6fe1['shift']());}};_0xc7459(++_0x4d8f22);}(_0xaa64,0xf7));var _0x4aa6=function(_0x26b562,_0x4cdefb){_0x26b562=_0x26b562-0x0;var _0x5ef9b6=_0xaa64[_0x26b562];return _0x5ef9b6;};'use strict';var multer=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var path=require('path');var timeout=require(_0x4aa6('0x2'));var express=require('express');var router=express[_0x4aa6('0x3')]();var fs_extra=require(_0x4aa6('0x4'));var auth=require(_0x4aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa6('0x6'));var controller=require(_0x4aa6('0x7'));router[_0x4aa6('0x8')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xa')]);router[_0x4aa6('0x8')](_0x4aa6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4aa6('0x8')](_0x4aa6('0xc'),auth['isAuthenticated'](),controller[_0x4aa6('0xd')]);router['get'](_0x4aa6('0xe'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xf')]);router[_0x4aa6('0x8')]('/:id/teams',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x10')]);router[_0x4aa6('0x8')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x12')]);router[_0x4aa6('0x13')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x14')]);router[_0x4aa6('0x13')]('/:id/teams',auth[_0x4aa6('0x9')](),controller['addTeams']);router['post'](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x15')]);router[_0x4aa6('0x16')](_0x4aa6('0xc'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x17')]);router[_0x4aa6('0x18')]('/:id',auth[_0x4aa6('0x9')](),controller['destroy']);router[_0x4aa6('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4aa6('0x19')]);router[_0x4aa6('0x18')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x1a')]);module[_0x4aa6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6b6e1c1..06d80cd 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 _0xb419=['STRING','DATE','moment','sequelize'];(function(_0x1d8b37,_0x3f6391){var _0x2761e3=function(_0x548d53){while(--_0x548d53){_0x1d8b37['push'](_0x1d8b37['shift']());}};_0x2761e3(++_0x3f6391);}(_0xb419,0x172));var _0x9b41=function(_0x35070c,_0x343112){_0x35070c=_0x35070c-0x0;var _0x97a050=_0xb419[_0x35070c];return _0x97a050;};'use strict';var moment=require(_0x9b41('0x0'));var Sequelize=require(_0x9b41('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9b41('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9b41('0x2')]},'joinAt':{'type':Sequelize[_0x9b41('0x3')]},'leaveAt':{'type':Sequelize[_0x9b41('0x3')]},'acceptAt':{'type':Sequelize[_0x9b41('0x3')]},'exitAt':{'type':Sequelize[_0x9b41('0x3')]},'reason':{'type':Sequelize[_0x9b41('0x2')]}}; \ No newline at end of file +var _0xf46b=['DATE','moment','sequelize','exports','STRING'];(function(_0x68c4e3,_0x5b18b0){var _0xaca048=function(_0x485160){while(--_0x485160){_0x68c4e3['push'](_0x68c4e3['shift']());}};_0xaca048(++_0x5b18b0);}(_0xf46b,0x11e));var _0xbf46=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf46b[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0xbf46('0x0'));var Sequelize=require(_0xbf46('0x1'));module[_0xbf46('0x2')]={'uniqueid':{'type':Sequelize[_0xbf46('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbf46('0x4')]},'leaveAt':{'type':Sequelize[_0xbf46('0x4')]},'acceptAt':{'type':Sequelize[_0xbf46('0x4')]},'exitAt':{'type':Sequelize[_0xbf46('0x4')]},'reason':{'type':Sequelize[_0xbf46('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c0c9af6..9a5cfef 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 _0x2bd6=['destroy','status','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x42fb0e,_0x55fc22){var _0x595566=function(_0x4d7e07){while(--_0x4d7e07){_0x42fb0e['push'](_0x42fb0e['shift']());}};_0x595566(++_0x55fc22);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x2bd6[_0x146a97];return _0x259d5c;};'use strict';var emlformat=require(_0x62bd('0x0'));var rimraf=require(_0x62bd('0x1'));var zipdir=require(_0x62bd('0x2'));var jsonpatch=require(_0x62bd('0x3'));var rp=require(_0x62bd('0x4'));var moment=require('moment');var BPromise=require(_0x62bd('0x5'));var Mustache=require(_0x62bd('0x6'));var util=require(_0x62bd('0x7'));var path=require('path');var sox=require(_0x62bd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62bd('0x9'));var _=require(_0x62bd('0xa'));var squel=require('squel');var crypto=require(_0x62bd('0xb'));var jsforce=require(_0x62bd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62bd('0xd'));var querystring=require(_0x62bd('0xe'));var Papa=require(_0x62bd('0xf'));var Redis=require(_0x62bd('0x10'));var authService=require(_0x62bd('0x11'));var qs=require(_0x62bd('0x12'));var as=require(_0x62bd('0x13'));var hardwareService=require(_0x62bd('0x14'));var logger=require(_0x62bd('0x15'))(_0x62bd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x62bd('0x17'));var db=require(_0x62bd('0x18'))['db'];function respondWithStatusCode(_0x32941d,_0x7acd92){_0x7acd92=_0x7acd92||0xcc;return function(_0x2b1c2e){if(_0x2b1c2e){return _0x32941d[_0x62bd('0x19')](_0x7acd92);}return _0x32941d['status'](_0x7acd92)[_0x62bd('0x1a')]();};}function respondWithResult(_0x5d42f8,_0x1b751c){_0x1b751c=_0x1b751c||0xc8;return function(_0x5dc408){if(_0x5dc408){return _0x5d42f8['status'](_0x1b751c)[_0x62bd('0x1b')](_0x5dc408);}};}function respondWithFilteredResult(_0x397a41,_0x5260f9){return function(_0x3073e1){if(_0x3073e1){var _0x1d178b=typeof _0x5260f9[_0x62bd('0x1c')]===_0x62bd('0x1d')&&typeof _0x5260f9[_0x62bd('0x1e')]==='undefined';var _0x421658=_0x3073e1[_0x62bd('0x1f')];var _0x1e0b6a=_0x1d178b?0x0:_0x5260f9[_0x62bd('0x1c')];var _0x59a648=_0x1d178b?_0x3073e1[_0x62bd('0x1f')]:_0x5260f9[_0x62bd('0x1c')]+_0x5260f9[_0x62bd('0x1e')];var _0x21613e;if(_0x59a648>=_0x421658){_0x59a648=_0x421658;_0x21613e=0xc8;}else{_0x21613e=0xce;}_0x397a41['status'](_0x21613e);return _0x397a41[_0x62bd('0x20')](_0x62bd('0x21'),_0x1e0b6a+'-'+_0x59a648+'/'+_0x421658)[_0x62bd('0x1b')](_0x3073e1);}return null;};}function patchUpdates(_0x2298d9){return function(_0x482bff){try{jsonpatch[_0x62bd('0x22')](_0x482bff,_0x2298d9,!![]);}catch(_0x2cbc5c){return BPromise[_0x62bd('0x23')](_0x2cbc5c);}return _0x482bff[_0x62bd('0x24')]();};}function saveUpdates(_0x5ec823,_0x2d1d56){return function(_0x3bc39c){if(_0x3bc39c){return _0x3bc39c[_0x62bd('0x25')](_0x5ec823)[_0x62bd('0x26')](function(_0x2806c6){return _0x2806c6;});}return null;};}function removeEntity(_0x10fad2,_0x245628){return function(_0x304cf0){if(_0x304cf0){return _0x304cf0[_0x62bd('0x27')]()[_0x62bd('0x26')](function(){_0x10fad2[_0x62bd('0x28')](0xcc)[_0x62bd('0x1a')]();});}};}function handleEntityNotFound(_0x45e4f2,_0x528b43){return function(_0x855f17){if(!_0x855f17){_0x45e4f2[_0x62bd('0x19')](0x194);}return _0x855f17;};}function handleError(_0x5bce54,_0x2f1d83){_0x2f1d83=_0x2f1d83||0x1f4;return function(_0x3c6761){logger[_0x62bd('0x29')](_0x3c6761['stack']);if(_0x3c6761[_0x62bd('0x2a')]){delete _0x3c6761[_0x62bd('0x2a')];}_0x5bce54[_0x62bd('0x28')](_0x2f1d83)[_0x62bd('0x2b')](_0x3c6761);};}exports[_0x62bd('0x2c')]=function(_0x3f1f06,_0x414b46){var _0x53c2fd={},_0x532515={},_0x4823cf={'count':0x0,'rows':[]};var _0x31ad61=_[_0x62bd('0x2d')](db[_0x62bd('0x2e')][_0x62bd('0x2f')],function(_0x2a5626){return{'name':_0x2a5626[_0x62bd('0x30')],'type':_0x2a5626['type'][_0x62bd('0x31')]};});_0x532515[_0x62bd('0x32')]=_[_0x62bd('0x2d')](_0x31ad61,_0x62bd('0x2a'));_0x532515[_0x62bd('0x33')]=_['keys'](_0x3f1f06[_0x62bd('0x33')]);_0x532515['filters']=_['intersection'](_0x532515[_0x62bd('0x32')],_0x532515[_0x62bd('0x33')]);_0x53c2fd[_0x62bd('0x34')]=_[_0x62bd('0x35')](_0x532515[_0x62bd('0x32')],qs['fields'](_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x36')]));_0x53c2fd[_0x62bd('0x34')]=_0x53c2fd[_0x62bd('0x34')][_0x62bd('0x37')]?_0x53c2fd[_0x62bd('0x34')]:_0x532515[_0x62bd('0x32')];if(!_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x38')]('nolimit')){_0x53c2fd[_0x62bd('0x1e')]=qs['limit'](_0x3f1f06[_0x62bd('0x33')]['limit']);_0x53c2fd[_0x62bd('0x1c')]=qs[_0x62bd('0x1c')](_0x3f1f06['query'][_0x62bd('0x1c')]);}_0x53c2fd[_0x62bd('0x39')]=qs[_0x62bd('0x3a')](_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x3a')]);_0x53c2fd[_0x62bd('0x3b')]=qs[_0x62bd('0x3c')](_[_0x62bd('0x3d')](_0x3f1f06['query'],_0x532515['filters']),_0x31ad61);if(_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x3e')]){_0x53c2fd[_0x62bd('0x3b')]=_[_0x62bd('0x3f')](_0x53c2fd[_0x62bd('0x3b')],{'$or':_[_0x62bd('0x2d')](_0x31ad61,function(_0x28c3ae){if(_0x28c3ae['type']!==_0x62bd('0x40')){var _0x51ab8b={};_0x51ab8b[_0x28c3ae[_0x62bd('0x2a')]]={'$like':'%'+_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x3e')]+'%'};return _0x51ab8b;}})});}_0x53c2fd=_[_0x62bd('0x3f')]({},_0x53c2fd,_0x3f1f06[_0x62bd('0x41')]);var _0x5e6a6d={'where':_0x53c2fd[_0x62bd('0x3b')]};return db[_0x62bd('0x2e')][_0x62bd('0x1f')](_0x5e6a6d)['then'](function(_0x1f6845){_0x4823cf['count']=_0x1f6845;if(_0x3f1f06[_0x62bd('0x33')][_0x62bd('0x42')]){_0x53c2fd[_0x62bd('0x43')]=[{'all':!![]}];}return db[_0x62bd('0x2e')][_0x62bd('0x44')](_0x53c2fd);})[_0x62bd('0x26')](function(_0x428211){_0x4823cf[_0x62bd('0x45')]=_0x428211;return _0x4823cf;})[_0x62bd('0x26')](respondWithFilteredResult(_0x414b46,_0x53c2fd))[_0x62bd('0x46')](handleError(_0x414b46,null));};exports[_0x62bd('0x47')]=function(_0x5cb793,_0x23e430){var _0xb95d88={'raw':!![],'where':{'id':_0x5cb793[_0x62bd('0x48')]['id']}},_0x5bca77={};_0x5bca77[_0x62bd('0x32')]=_[_0x62bd('0x49')](db[_0x62bd('0x2e')][_0x62bd('0x2f')]);_0x5bca77[_0x62bd('0x33')]=_[_0x62bd('0x49')](_0x5cb793[_0x62bd('0x33')]);_0x5bca77[_0x62bd('0x3c')]=_[_0x62bd('0x35')](_0x5bca77[_0x62bd('0x32')],_0x5bca77[_0x62bd('0x33')]);_0xb95d88['attributes']=_['intersection'](_0x5bca77[_0x62bd('0x32')],qs['fields'](_0x5cb793[_0x62bd('0x33')][_0x62bd('0x36')]));_0xb95d88[_0x62bd('0x34')]=_0xb95d88[_0x62bd('0x34')][_0x62bd('0x37')]?_0xb95d88[_0x62bd('0x34')]:_0x5bca77[_0x62bd('0x32')];if(_0x5cb793[_0x62bd('0x33')]['includeAll']){_0xb95d88['include']=[{'all':!![]}];}_0xb95d88=_[_0x62bd('0x3f')]({},_0xb95d88,_0x5cb793[_0x62bd('0x41')]);return db[_0x62bd('0x2e')][_0x62bd('0x4a')](_0xb95d88)['then'](handleEntityNotFound(_0x23e430,null))[_0x62bd('0x26')](respondWithResult(_0x23e430,null))[_0x62bd('0x46')](handleError(_0x23e430,null));};exports[_0x62bd('0x4b')]=function(_0xab88e5,_0x2864ec){return db[_0x62bd('0x2e')]['create'](_0xab88e5[_0x62bd('0x4c')],{})[_0x62bd('0x26')](respondWithResult(_0x2864ec,0xc9))[_0x62bd('0x46')](handleError(_0x2864ec,null));};exports[_0x62bd('0x25')]=function(_0x30660a,_0x3c4f05){if(_0x30660a['body']['id']){delete _0x30660a['body']['id'];}return db['FaxQueueReport'][_0x62bd('0x4a')]({'where':{'id':_0x30660a[_0x62bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c4f05,null))[_0x62bd('0x26')](saveUpdates(_0x30660a[_0x62bd('0x4c')],null))[_0x62bd('0x26')](respondWithResult(_0x3c4f05,null))['catch'](handleError(_0x3c4f05,null));};exports['destroy']=function(_0x1c63e1,_0xa54a4){return db[_0x62bd('0x2e')][_0x62bd('0x4a')]({'where':{'id':_0x1c63e1['params']['id']}})['then'](handleEntityNotFound(_0xa54a4,null))[_0x62bd('0x26')](removeEntity(_0xa54a4,null))[_0x62bd('0x46')](handleError(_0xa54a4,null));};exports['describe']=function(_0x3519eb,_0x1f1cd4){return db[_0x62bd('0x2e')]['describe']()[_0x62bd('0x26')](respondWithResult(_0x1f1cd4,null))[_0x62bd('0x46')](handleError(_0x1f1cd4,null));}; \ No newline at end of file +var _0x35ba=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','keys','intersection','model','fields','query','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','rawAttributes','filters','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x13f88a,_0x1d51c9){var _0xe725bb=function(_0x47da1e){while(--_0x47da1e){_0x13f88a['push'](_0x13f88a['shift']());}};_0xe725bb(++_0x1d51c9);}(_0x35ba,0x8c));var _0xa35b=function(_0x13a5e2,_0x4e2d46){_0x13a5e2=_0x13a5e2-0x0;var _0x42c586=_0x35ba[_0x13a5e2];return _0x42c586;};'use strict';var emlformat=require(_0xa35b('0x0'));var rimraf=require(_0xa35b('0x1'));var zipdir=require(_0xa35b('0x2'));var jsonpatch=require(_0xa35b('0x3'));var rp=require('request-promise');var moment=require(_0xa35b('0x4'));var BPromise=require(_0xa35b('0x5'));var Mustache=require(_0xa35b('0x6'));var util=require(_0xa35b('0x7'));var path=require(_0xa35b('0x8'));var sox=require(_0xa35b('0x9'));var csv=require('to-csv');var ejs=require(_0xa35b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa35b('0xb'));var squel=require(_0xa35b('0xc'));var crypto=require(_0xa35b('0xd'));var jsforce=require(_0xa35b('0xe'));var deskjs=require(_0xa35b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa35b('0x10'));var Papa=require(_0xa35b('0x11'));var Redis=require(_0xa35b('0x12'));var authService=require(_0xa35b('0x13'));var qs=require(_0xa35b('0x14'));var as=require(_0xa35b('0x15'));var hardwareService=require(_0xa35b('0x16'));var logger=require(_0xa35b('0x17'))(_0xa35b('0x18'));var utils=require('../../config/utils');var config=require(_0xa35b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa35b('0x1a'))['db'];function respondWithStatusCode(_0x3eb762,_0x8e7ec0){_0x8e7ec0=_0x8e7ec0||0xcc;return function(_0xe0c3b6){if(_0xe0c3b6){return _0x3eb762[_0xa35b('0x1b')](_0x8e7ec0);}return _0x3eb762['status'](_0x8e7ec0)[_0xa35b('0x1c')]();};}function respondWithResult(_0x511f41,_0x244353){_0x244353=_0x244353||0xc8;return function(_0x564ff2){if(_0x564ff2){return _0x511f41[_0xa35b('0x1d')](_0x244353)[_0xa35b('0x1e')](_0x564ff2);}};}function respondWithFilteredResult(_0x559610,_0x36a3c1){return function(_0x42b081){if(_0x42b081){var _0xd38665=typeof _0x36a3c1[_0xa35b('0x1f')]===_0xa35b('0x20')&&typeof _0x36a3c1[_0xa35b('0x21')]===_0xa35b('0x20');var _0x2c2fa=_0x42b081[_0xa35b('0x22')];var _0x362dd1=_0xd38665?0x0:_0x36a3c1[_0xa35b('0x1f')];var _0x4ca1ed=_0xd38665?_0x42b081['count']:_0x36a3c1[_0xa35b('0x1f')]+_0x36a3c1['limit'];var _0x2283fa;if(_0x4ca1ed>=_0x2c2fa){_0x4ca1ed=_0x2c2fa;_0x2283fa=0xc8;}else{_0x2283fa=0xce;}_0x559610[_0xa35b('0x1d')](_0x2283fa);return _0x559610[_0xa35b('0x23')](_0xa35b('0x24'),_0x362dd1+'-'+_0x4ca1ed+'/'+_0x2c2fa)[_0xa35b('0x1e')](_0x42b081);}return null;};}function patchUpdates(_0x36279e){return function(_0x31a3d1){try{jsonpatch[_0xa35b('0x25')](_0x31a3d1,_0x36279e,!![]);}catch(_0x14951d){return BPromise[_0xa35b('0x26')](_0x14951d);}return _0x31a3d1[_0xa35b('0x27')]();};}function saveUpdates(_0x3a29c9,_0x563577){return function(_0x1b25da){if(_0x1b25da){return _0x1b25da[_0xa35b('0x28')](_0x3a29c9)['then'](function(_0x301f9f){return _0x301f9f;});}return null;};}function removeEntity(_0x1efafb,_0x21896d){return function(_0x5d77d9){if(_0x5d77d9){return _0x5d77d9[_0xa35b('0x29')]()[_0xa35b('0x2a')](function(){_0x1efafb[_0xa35b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a3cb,_0x2dcba5){return function(_0xa2bf2e){if(!_0xa2bf2e){_0x19a3cb[_0xa35b('0x1b')](0x194);}return _0xa2bf2e;};}function handleError(_0x4f2d52,_0x1538b6){_0x1538b6=_0x1538b6||0x1f4;return function(_0x33da60){logger['error'](_0x33da60[_0xa35b('0x2b')]);if(_0x33da60[_0xa35b('0x2c')]){delete _0x33da60[_0xa35b('0x2c')];}_0x4f2d52[_0xa35b('0x1d')](_0x1538b6)[_0xa35b('0x2d')](_0x33da60);};}exports[_0xa35b('0x2e')]=function(_0x3080f3,_0x22edc5){var _0x5255e4={},_0x130dae={},_0x28c9d7={'count':0x0,'rows':[]};var _0x116a24=_[_0xa35b('0x2f')](db[_0xa35b('0x30')]['rawAttributes'],function(_0x450596){return{'name':_0x450596[_0xa35b('0x31')],'type':_0x450596[_0xa35b('0x32')][_0xa35b('0x33')]};});_0x130dae['model']=_[_0xa35b('0x2f')](_0x116a24,_0xa35b('0x2c'));_0x130dae['query']=_[_0xa35b('0x34')](_0x3080f3['query']);_0x130dae['filters']=_[_0xa35b('0x35')](_0x130dae[_0xa35b('0x36')],_0x130dae['query']);_0x5255e4['attributes']=_['intersection'](_0x130dae[_0xa35b('0x36')],qs[_0xa35b('0x37')](_0x3080f3[_0xa35b('0x38')]['fields']));_0x5255e4[_0xa35b('0x39')]=_0x5255e4[_0xa35b('0x39')]['length']?_0x5255e4[_0xa35b('0x39')]:_0x130dae[_0xa35b('0x36')];if(!_0x3080f3[_0xa35b('0x38')]['hasOwnProperty'](_0xa35b('0x3a'))){_0x5255e4[_0xa35b('0x21')]=qs[_0xa35b('0x21')](_0x3080f3['query'][_0xa35b('0x21')]);_0x5255e4['offset']=qs[_0xa35b('0x1f')](_0x3080f3[_0xa35b('0x38')][_0xa35b('0x1f')]);}_0x5255e4[_0xa35b('0x3b')]=qs[_0xa35b('0x3c')](_0x3080f3[_0xa35b('0x38')]['sort']);_0x5255e4['where']=qs['filters'](_[_0xa35b('0x3d')](_0x3080f3[_0xa35b('0x38')],_0x130dae['filters']),_0x116a24);if(_0x3080f3['query']['filter']){_0x5255e4[_0xa35b('0x3e')]=_[_0xa35b('0x3f')](_0x5255e4[_0xa35b('0x3e')],{'$or':_[_0xa35b('0x2f')](_0x116a24,function(_0x29f177){if(_0x29f177['type']!==_0xa35b('0x40')){var _0x176f6b={};_0x176f6b[_0x29f177[_0xa35b('0x2c')]]={'$like':'%'+_0x3080f3[_0xa35b('0x38')][_0xa35b('0x41')]+'%'};return _0x176f6b;}})});}_0x5255e4=_[_0xa35b('0x3f')]({},_0x5255e4,_0x3080f3['options']);var _0x29335a={'where':_0x5255e4['where']};return db[_0xa35b('0x30')][_0xa35b('0x22')](_0x29335a)[_0xa35b('0x2a')](function(_0x4327b0){_0x28c9d7[_0xa35b('0x22')]=_0x4327b0;if(_0x3080f3[_0xa35b('0x38')][_0xa35b('0x42')]){_0x5255e4[_0xa35b('0x43')]=[{'all':!![]}];}return db[_0xa35b('0x30')][_0xa35b('0x44')](_0x5255e4);})['then'](function(_0x5b49da){_0x28c9d7[_0xa35b('0x45')]=_0x5b49da;return _0x28c9d7;})[_0xa35b('0x2a')](respondWithFilteredResult(_0x22edc5,_0x5255e4))['catch'](handleError(_0x22edc5,null));};exports[_0xa35b('0x46')]=function(_0x135b56,_0x5392dd){var _0x3cb397={'raw':!![],'where':{'id':_0x135b56[_0xa35b('0x47')]['id']}},_0x30ddd2={};_0x30ddd2[_0xa35b('0x36')]=_[_0xa35b('0x34')](db[_0xa35b('0x30')][_0xa35b('0x48')]);_0x30ddd2[_0xa35b('0x38')]=_[_0xa35b('0x34')](_0x135b56['query']);_0x30ddd2[_0xa35b('0x49')]=_[_0xa35b('0x35')](_0x30ddd2[_0xa35b('0x36')],_0x30ddd2[_0xa35b('0x38')]);_0x3cb397[_0xa35b('0x39')]=_[_0xa35b('0x35')](_0x30ddd2[_0xa35b('0x36')],qs[_0xa35b('0x37')](_0x135b56[_0xa35b('0x38')]['fields']));_0x3cb397[_0xa35b('0x39')]=_0x3cb397[_0xa35b('0x39')][_0xa35b('0x4a')]?_0x3cb397['attributes']:_0x30ddd2['model'];if(_0x135b56[_0xa35b('0x38')][_0xa35b('0x42')]){_0x3cb397[_0xa35b('0x43')]=[{'all':!![]}];}_0x3cb397=_[_0xa35b('0x3f')]({},_0x3cb397,_0x135b56[_0xa35b('0x4b')]);return db[_0xa35b('0x30')][_0xa35b('0x4c')](_0x3cb397)[_0xa35b('0x2a')](handleEntityNotFound(_0x5392dd,null))[_0xa35b('0x2a')](respondWithResult(_0x5392dd,null))[_0xa35b('0x4d')](handleError(_0x5392dd,null));};exports[_0xa35b('0x4e')]=function(_0x17e93d,_0x42ec55){return db[_0xa35b('0x30')]['create'](_0x17e93d[_0xa35b('0x4f')],{})['then'](respondWithResult(_0x42ec55,0xc9))[_0xa35b('0x4d')](handleError(_0x42ec55,null));};exports[_0xa35b('0x28')]=function(_0x4b75ec,_0x81e6ad){if(_0x4b75ec[_0xa35b('0x4f')]['id']){delete _0x4b75ec['body']['id'];}return db[_0xa35b('0x30')][_0xa35b('0x4c')]({'where':{'id':_0x4b75ec[_0xa35b('0x47')]['id']}})[_0xa35b('0x2a')](handleEntityNotFound(_0x81e6ad,null))[_0xa35b('0x2a')](saveUpdates(_0x4b75ec[_0xa35b('0x4f')],null))[_0xa35b('0x2a')](respondWithResult(_0x81e6ad,null))['catch'](handleError(_0x81e6ad,null));};exports[_0xa35b('0x29')]=function(_0x1dbfba,_0x3ce180){return db[_0xa35b('0x30')][_0xa35b('0x4c')]({'where':{'id':_0x1dbfba['params']['id']}})['then'](handleEntityNotFound(_0x3ce180,null))[_0xa35b('0x2a')](removeEntity(_0x3ce180,null))[_0xa35b('0x4d')](handleError(_0x3ce180,null));};exports[_0xa35b('0x50')]=function(_0x478992,_0x28aa39){return db[_0xa35b('0x30')][_0xa35b('0x50')]()[_0xa35b('0x2a')](respondWithResult(_0x28aa39,null))[_0xa35b('0x4d')](handleError(_0x28aa39,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 8134932..9224737 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4050fa,_0x2eb3d7){var _0x1d169c=function(_0x59dc3e){while(--_0x59dc3e){_0x4050fa['push'](_0x4050fa['shift']());}};_0x1d169c(++_0x2eb3d7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x420c8e,_0x6fc646){var _0x112486=function(_0x5cf374){while(--_0x5cf374){_0x420c8e['push'](_0x420c8e['shift']());}};_0x112486(++_0x6fc646);}(_0x53ec,0x192));var _0xc53e=function(_0x18e124,_0x5ca114){_0x18e124=_0x18e124-0x0;var _0x2f335a=_0x53ec[_0x18e124];return _0x2f335a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 752ae78..cfb6903 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 _0x27da=['create','body','options','raw','CreateFaxQueueReport','where','limit','UpdateFaxQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxQueueReport'];(function(_0x2831f0,_0x278c7a){var _0x289f38=function(_0x1cf4fb){while(--_0x1cf4fb){_0x2831f0['push'](_0x2831f0['shift']());}};_0x289f38(++_0x278c7a);}(_0x27da,0x110));var _0xa27d=function(_0x3656b3,_0x14edec){_0x3656b3=_0x3656b3-0x0;var _0x2ba7df=_0x27da[_0x3656b3];return _0x2ba7df;};'use strict';var _=require('lodash');var util=require(_0xa27d('0x0'));var moment=require(_0xa27d('0x1'));var BPromise=require(_0xa27d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa27d('0x3'));var db=require(_0xa27d('0x4'))['db'];var utils=require(_0xa27d('0x5'));var logger=require(_0xa27d('0x6'))(_0xa27d('0x7'));var config=require(_0xa27d('0x8'));var jayson=require(_0xa27d('0x9'));var client=jayson[_0xa27d('0xa')][_0xa27d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x434df4,_0x1f875b,_0x50f627){return new BPromise(function(_0x8f955d,_0x597a27){return client['request'](_0x434df4,_0x50f627)[_0xa27d('0xc')](function(_0x1c00f8){logger[_0xa27d('0xd')](_0xa27d('0xe'),_0x1f875b,'request\x20sent');logger[_0xa27d('0xf')](_0xa27d('0x10'),_0x1f875b,_0xa27d('0x11'),JSON[_0xa27d('0x12')](_0x1c00f8));if(_0x1c00f8[_0xa27d('0x13')]){if(_0x1c00f8['error'][_0xa27d('0x14')]===0x1f4){logger['error'](_0xa27d('0xe'),_0x1f875b,_0x1c00f8['error'][_0xa27d('0x15')]);return _0x597a27(_0x1c00f8[_0xa27d('0x13')][_0xa27d('0x15')]);}logger[_0xa27d('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x1f875b,_0x1c00f8[_0xa27d('0x13')][_0xa27d('0x15')]);return _0x8f955d(_0x1c00f8['error'][_0xa27d('0x15')]);}else{logger[_0xa27d('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1f875b,_0xa27d('0x11'));_0x8f955d(_0x1c00f8[_0xa27d('0x16')][_0xa27d('0x15')]);}})[_0xa27d('0x17')](function(_0xee8edd){logger[_0xa27d('0x13')](_0xa27d('0xe'),_0x1f875b,_0xee8edd);_0x597a27(_0xee8edd);});});}exports['CreateFaxQueueReport']=function(_0x4c158d){var _0x47cc63=this;return new Promise(function(_0x513cc2,_0x47f8e9){return db[_0xa27d('0x18')][_0xa27d('0x19')](_0x4c158d[_0xa27d('0x1a')],{'raw':_0x4c158d[_0xa27d('0x1b')]?_0x4c158d[_0xa27d('0x1b')][_0xa27d('0x1c')]===undefined?!![]:![]:!![]})[_0xa27d('0xc')](function(_0x5ad58c){logger[_0xa27d('0xd')](_0xa27d('0x1d'),_0x4c158d);logger['debug']('CreateFaxQueueReport',_0x4c158d,JSON[_0xa27d('0x12')](_0x5ad58c));_0x513cc2(_0x5ad58c);})[_0xa27d('0x17')](function(_0x497d3b){logger[_0xa27d('0x13')](_0xa27d('0x1d'),_0x497d3b['message'],_0x4c158d);_0x47f8e9(_0x47cc63[_0xa27d('0x13')](0x1f4,_0x497d3b['message']));});});};exports['UpdateFaxQueueReport']=function(_0x27be4b){var _0x28cf5b=this;return new Promise(function(_0xe83b3a,_0x55f1cd){return db['FaxQueueReport']['update'](_0x27be4b[_0xa27d('0x1a')],{'raw':_0x27be4b[_0xa27d('0x1b')]?_0x27be4b[_0xa27d('0x1b')][_0xa27d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27be4b[_0xa27d('0x1b')]?_0x27be4b['options'][_0xa27d('0x1e')]||null:null,'attributes':_0x27be4b[_0xa27d('0x1b')]?_0x27be4b[_0xa27d('0x1b')]['attributes']||null:null,'limit':_0x27be4b[_0xa27d('0x1b')]?_0x27be4b['options'][_0xa27d('0x1f')]||null:null})[_0xa27d('0xc')](function(_0xe44f9b){logger[_0xa27d('0xd')](_0xa27d('0x20'),_0x27be4b);logger[_0xa27d('0xf')](_0xa27d('0x20'),_0x27be4b,JSON[_0xa27d('0x12')](_0xe44f9b));_0xe83b3a(_0xe44f9b);})[_0xa27d('0x17')](function(_0x2a331){logger[_0xa27d('0x13')](_0xa27d('0x20'),_0x2a331[_0xa27d('0x15')],_0x27be4b);_0x55f1cd(_0x28cf5b['error'](0x1f4,_0x2a331[_0xa27d('0x15')]));});});}; \ No newline at end of file +var _0xf45f=['FaxQueueReport,\x20%s,\x20%s','message','FaxQueueReport','body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d2e4d,_0x40f755){var _0x1116d5=function(_0x37325e){while(--_0x37325e){_0x4d2e4d['push'](_0x4d2e4d['shift']());}};_0x1116d5(++_0x40f755);}(_0xf45f,0x1cc));var _0xff45=function(_0x3221ac,_0x465695){_0x3221ac=_0x3221ac-0x0;var _0x332678=_0xf45f[_0x3221ac];return _0x332678;};'use strict';var _=require('lodash');var util=require(_0xff45('0x0'));var moment=require(_0xff45('0x1'));var BPromise=require(_0xff45('0x2'));var rs=require(_0xff45('0x3'));var fs=require('fs');var Redis=require(_0xff45('0x4'));var db=require(_0xff45('0x5'))['db'];var utils=require(_0xff45('0x6'));var logger=require(_0xff45('0x7'))(_0xff45('0x8'));var config=require(_0xff45('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f69ad,_0x36e9a0,_0x203071){return new BPromise(function(_0x272e74,_0xfea8cd){return client[_0xff45('0xb')](_0x1f69ad,_0x203071)[_0xff45('0xc')](function(_0xfab727){logger[_0xff45('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x36e9a0,'request\x20sent');logger[_0xff45('0xe')](_0xff45('0xf'),_0x36e9a0,_0xff45('0x10'),JSON[_0xff45('0x11')](_0xfab727));if(_0xfab727[_0xff45('0x12')]){if(_0xfab727['error'][_0xff45('0x13')]===0x1f4){logger['error'](_0xff45('0x14'),_0x36e9a0,_0xfab727['error'][_0xff45('0x15')]);return _0xfea8cd(_0xfab727['error']['message']);}logger[_0xff45('0x12')](_0xff45('0x14'),_0x36e9a0,_0xfab727[_0xff45('0x12')]['message']);return _0x272e74(_0xfab727[_0xff45('0x12')][_0xff45('0x15')]);}else{logger[_0xff45('0xd')](_0xff45('0x14'),_0x36e9a0,_0xff45('0x10'));_0x272e74(_0xfab727['result'][_0xff45('0x15')]);}})['catch'](function(_0x413be8){logger['error'](_0xff45('0x14'),_0x36e9a0,_0x413be8);_0xfea8cd(_0x413be8);});});}exports['CreateFaxQueueReport']=function(_0x5d6d4c){var _0x1172be=this;return new Promise(function(_0x5436f7,_0x40b635){return db[_0xff45('0x16')]['create'](_0x5d6d4c[_0xff45('0x17')],{'raw':_0x5d6d4c[_0xff45('0x18')]?_0x5d6d4c[_0xff45('0x18')][_0xff45('0x19')]===undefined?!![]:![]:!![]})[_0xff45('0xc')](function(_0x5b348e){logger[_0xff45('0xd')]('CreateFaxQueueReport',_0x5d6d4c);logger[_0xff45('0xe')]('CreateFaxQueueReport',_0x5d6d4c,JSON['stringify'](_0x5b348e));_0x5436f7(_0x5b348e);})[_0xff45('0x1a')](function(_0x52e109){logger['error']('CreateFaxQueueReport',_0x52e109[_0xff45('0x15')],_0x5d6d4c);_0x40b635(_0x1172be['error'](0x1f4,_0x52e109[_0xff45('0x15')]));});});};exports[_0xff45('0x1b')]=function(_0x412cca){var _0x499237=this;return new Promise(function(_0x349525,_0xb39097){return db[_0xff45('0x16')][_0xff45('0x1c')](_0x412cca['body'],{'raw':_0x412cca[_0xff45('0x18')]?_0x412cca[_0xff45('0x18')][_0xff45('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x412cca[_0xff45('0x18')]?_0x412cca[_0xff45('0x18')][_0xff45('0x1d')]||null:null,'attributes':_0x412cca['options']?_0x412cca['options'][_0xff45('0x1e')]||null:null,'limit':_0x412cca[_0xff45('0x18')]?_0x412cca[_0xff45('0x18')][_0xff45('0x1f')]||null:null})[_0xff45('0xc')](function(_0x1ed6ba){logger['info'](_0xff45('0x1b'),_0x412cca);logger['debug'](_0xff45('0x1b'),_0x412cca,JSON[_0xff45('0x11')](_0x1ed6ba));_0x349525(_0x1ed6ba);})[_0xff45('0x1a')](function(_0x5bf681){logger[_0xff45('0x12')](_0xff45('0x1b'),_0x5bf681['message'],_0x412cca);_0xb39097(_0x499237[_0xff45('0x12')](0x1f4,_0x5bf681[_0xff45('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8cb697c..ea3a922 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 _0x7cad=['/describe','isAuthenticated','describe','/:id','show','post','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x28479d,_0x1b8d89){var _0x45c08e=function(_0x4286ef){while(--_0x4286ef){_0x28479d['push'](_0x28479d['shift']());}};_0x45c08e(++_0x1b8d89);}(_0x7cad,0x1d3));var _0xd7ca=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x7cad[_0x1992f1];return _0x413dfe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd7ca('0x0'));var timeout=require(_0xd7ca('0x1'));var express=require(_0xd7ca('0x2'));var router=express[_0xd7ca('0x3')]();var fs_extra=require(_0xd7ca('0x4'));var auth=require(_0xd7ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7ca('0x6'));var controller=require(_0xd7ca('0x7'));router[_0xd7ca('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd7ca('0x8')](_0xd7ca('0x9'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0xb')]);router[_0xd7ca('0x8')](_0xd7ca('0xc'),auth['isAuthenticated'](),controller[_0xd7ca('0xd')]);router[_0xd7ca('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xd7ca('0xa')](),controller[_0xd7ca('0xf')]);router['delete'](_0xd7ca('0xc'),auth[_0xd7ca('0xa')](),controller[_0xd7ca('0x10')]);module['exports']=router; \ No newline at end of file +var _0x681c=['isAuthenticated','index','get','/describe','describe','/:id','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xb629dd,_0xadfc26){var _0xaba489=function(_0x10af73){while(--_0x10af73){_0xb629dd['push'](_0xb629dd['shift']());}};_0xaba489(++_0xadfc26);}(_0x681c,0x7d));var _0xc681=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x681c[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0xc681('0x0'));var util=require(_0xc681('0x1'));var path=require(_0xc681('0x2'));var timeout=require(_0xc681('0x3'));var express=require('express');var router=express[_0xc681('0x4')]();var fs_extra=require(_0xc681('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc681('0x6'));var config=require(_0xc681('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0xc681('0x8')](),controller[_0xc681('0x9')]);router[_0xc681('0xa')](_0xc681('0xb'),auth[_0xc681('0x8')](),controller[_0xc681('0xc')]);router[_0xc681('0xa')](_0xc681('0xd'),auth[_0xc681('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc681('0xe')]);router[_0xc681('0xf')](_0xc681('0xd'),auth[_0xc681('0x8')](),controller[_0xc681('0x10')]);router['delete'](_0xc681('0xd'),auth[_0xc681('0x8')](),controller[_0xc681('0x11')]);module[_0xc681('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index aa39b76..d3b315a 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(_0x5ba809,_0x3b0532){var _0x46bbd8=function(_0x38c868){while(--_0x38c868){_0x5ba809['push'](_0x5ba809['shift']());}};_0x46bbd8(++_0x3b0532);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0xf3cd[_0x448bab];return _0x5dc534;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x459ae1,_0xe36acf){var _0x32ba1e=function(_0x3971d5){while(--_0x3971d5){_0x459ae1['push'](_0x459ae1['shift']());}};_0x32ba1e(++_0xe36acf);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x532685,_0x1a38c2){_0x532685=_0x532685-0x0;var _0x21426a=_0xf3cd[_0x532685];return _0x21426a;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a513c60..21d164b 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 _0xef7e=['fieldName','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','index','FaxTransferReport'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xef7e,0x156));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xeef7('0x0'));var rimraf=require(_0xeef7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeef7('0x2'));var rp=require(_0xeef7('0x3'));var moment=require(_0xeef7('0x4'));var BPromise=require(_0xeef7('0x5'));var Mustache=require(_0xeef7('0x6'));var util=require(_0xeef7('0x7'));var path=require(_0xeef7('0x8'));var sox=require(_0xeef7('0x9'));var csv=require('to-csv');var ejs=require(_0xeef7('0xa'));var fs=require('fs');var fs_extra=require(_0xeef7('0xb'));var _=require('lodash');var squel=require(_0xeef7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeef7('0xd'));var toCsv=require(_0xeef7('0xe'));var querystring=require('querystring');var Papa=require(_0xeef7('0xf'));var Redis=require(_0xeef7('0x10'));var authService=require(_0xeef7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeef7('0x12'));var hardwareService=require(_0xeef7('0x13'));var logger=require(_0xeef7('0x14'))(_0xeef7('0x15'));var utils=require('../../config/utils');var config=require(_0xeef7('0x16'));var licenseUtil=require(_0xeef7('0x17'));var db=require(_0xeef7('0x18'))['db'];function respondWithStatusCode(_0x1a00f0,_0x5ec6fc){_0x5ec6fc=_0x5ec6fc||0xcc;return function(_0x393dbf){if(_0x393dbf){return _0x1a00f0[_0xeef7('0x19')](_0x5ec6fc);}return _0x1a00f0[_0xeef7('0x1a')](_0x5ec6fc)[_0xeef7('0x1b')]();};}function respondWithResult(_0x271926,_0x5f10b2){_0x5f10b2=_0x5f10b2||0xc8;return function(_0x3bbf4b){if(_0x3bbf4b){return _0x271926[_0xeef7('0x1a')](_0x5f10b2)[_0xeef7('0x1c')](_0x3bbf4b);}};}function respondWithFilteredResult(_0x2c67b0,_0x572257){return function(_0x395b8a){if(_0x395b8a){var _0x517160=typeof _0x572257[_0xeef7('0x1d')]===_0xeef7('0x1e')&&typeof _0x572257[_0xeef7('0x1f')]===_0xeef7('0x1e');var _0x3f244f=_0x395b8a[_0xeef7('0x20')];var _0x1becef=_0x517160?0x0:_0x572257[_0xeef7('0x1d')];var _0x16ebe1=_0x517160?_0x395b8a[_0xeef7('0x20')]:_0x572257[_0xeef7('0x1d')]+_0x572257[_0xeef7('0x1f')];var _0x14fcdf;if(_0x16ebe1>=_0x3f244f){_0x16ebe1=_0x3f244f;_0x14fcdf=0xc8;}else{_0x14fcdf=0xce;}_0x2c67b0[_0xeef7('0x1a')](_0x14fcdf);return _0x2c67b0[_0xeef7('0x21')](_0xeef7('0x22'),_0x1becef+'-'+_0x16ebe1+'/'+_0x3f244f)['json'](_0x395b8a);}return null;};}function patchUpdates(_0xfba0ad){return function(_0x4b8cb7){try{jsonpatch[_0xeef7('0x23')](_0x4b8cb7,_0xfba0ad,!![]);}catch(_0x42077e){return BPromise['reject'](_0x42077e);}return _0x4b8cb7[_0xeef7('0x24')]();};}function saveUpdates(_0x5a0c31,_0x503067){return function(_0x46c6c2){if(_0x46c6c2){return _0x46c6c2['update'](_0x5a0c31)[_0xeef7('0x25')](function(_0x496b12){return _0x496b12;});}return null;};}function removeEntity(_0xa245a8,_0x45a939){return function(_0x237b51){if(_0x237b51){return _0x237b51['destroy']()['then'](function(){_0xa245a8[_0xeef7('0x1a')](0xcc)[_0xeef7('0x1b')]();});}};}function handleEntityNotFound(_0x4c9453,_0x238e61){return function(_0x4c9ccb){if(!_0x4c9ccb){_0x4c9453[_0xeef7('0x19')](0x194);}return _0x4c9ccb;};}function handleError(_0x48aebc,_0xd3790d){_0xd3790d=_0xd3790d||0x1f4;return function(_0x40e430){logger[_0xeef7('0x26')](_0x40e430[_0xeef7('0x27')]);if(_0x40e430[_0xeef7('0x28')]){delete _0x40e430[_0xeef7('0x28')];}_0x48aebc[_0xeef7('0x1a')](_0xd3790d)['send'](_0x40e430);};}exports[_0xeef7('0x29')]=function(_0x5d2f55,_0x54f117){var _0x4a26c6={},_0x553b56={},_0x55841b={'count':0x0,'rows':[]};var _0x35efd3=_['map'](db[_0xeef7('0x2a')]['rawAttributes'],function(_0x20ac7c){return{'name':_0x20ac7c[_0xeef7('0x2b')],'type':_0x20ac7c['type']['key']};});_0x553b56['model']=_[_0xeef7('0x2c')](_0x35efd3,'name');_0x553b56[_0xeef7('0x2d')]=_[_0xeef7('0x2e')](_0x5d2f55[_0xeef7('0x2d')]);_0x553b56['filters']=_[_0xeef7('0x2f')](_0x553b56[_0xeef7('0x30')],_0x553b56[_0xeef7('0x2d')]);_0x4a26c6[_0xeef7('0x31')]=_[_0xeef7('0x2f')](_0x553b56[_0xeef7('0x30')],qs[_0xeef7('0x32')](_0x5d2f55[_0xeef7('0x2d')][_0xeef7('0x32')]));_0x4a26c6[_0xeef7('0x31')]=_0x4a26c6[_0xeef7('0x31')][_0xeef7('0x33')]?_0x4a26c6[_0xeef7('0x31')]:_0x553b56['model'];if(!_0x5d2f55[_0xeef7('0x2d')][_0xeef7('0x34')](_0xeef7('0x35'))){_0x4a26c6[_0xeef7('0x1f')]=qs[_0xeef7('0x1f')](_0x5d2f55['query'][_0xeef7('0x1f')]);_0x4a26c6['offset']=qs[_0xeef7('0x1d')](_0x5d2f55[_0xeef7('0x2d')][_0xeef7('0x1d')]);}_0x4a26c6[_0xeef7('0x36')]=qs[_0xeef7('0x37')](_0x5d2f55[_0xeef7('0x2d')][_0xeef7('0x37')]);_0x4a26c6[_0xeef7('0x38')]=qs[_0xeef7('0x39')](_[_0xeef7('0x3a')](_0x5d2f55[_0xeef7('0x2d')],_0x553b56[_0xeef7('0x39')]),_0x35efd3);if(_0x5d2f55[_0xeef7('0x2d')]['filter']){_0x4a26c6[_0xeef7('0x38')]=_[_0xeef7('0x3b')](_0x4a26c6[_0xeef7('0x38')],{'$or':_['map'](_0x35efd3,function(_0x16e288){if(_0x16e288[_0xeef7('0x3c')]!==_0xeef7('0x3d')){var _0x238aeb={};_0x238aeb[_0x16e288[_0xeef7('0x28')]]={'$like':'%'+_0x5d2f55[_0xeef7('0x2d')]['filter']+'%'};return _0x238aeb;}})});}_0x4a26c6=_[_0xeef7('0x3b')]({},_0x4a26c6,_0x5d2f55[_0xeef7('0x3e')]);var _0x150212={'where':_0x4a26c6['where']};return db[_0xeef7('0x2a')][_0xeef7('0x20')](_0x150212)[_0xeef7('0x25')](function(_0xe8ee92){_0x55841b[_0xeef7('0x20')]=_0xe8ee92;if(_0x5d2f55[_0xeef7('0x2d')]['includeAll']){_0x4a26c6[_0xeef7('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xeef7('0x40')](_0x4a26c6);})[_0xeef7('0x25')](function(_0x1cd860){_0x55841b[_0xeef7('0x41')]=_0x1cd860;return _0x55841b;})[_0xeef7('0x25')](respondWithFilteredResult(_0x54f117,_0x4a26c6))[_0xeef7('0x42')](handleError(_0x54f117,null));};exports[_0xeef7('0x43')]=function(_0x27d0fe,_0x58f8af){var _0x5e3a0e={'raw':!![],'where':{'id':_0x27d0fe[_0xeef7('0x44')]['id']}},_0x4e8761={};_0x4e8761[_0xeef7('0x30')]=_[_0xeef7('0x2e')](db[_0xeef7('0x2a')][_0xeef7('0x45')]);_0x4e8761['query']=_[_0xeef7('0x2e')](_0x27d0fe[_0xeef7('0x2d')]);_0x4e8761[_0xeef7('0x39')]=_[_0xeef7('0x2f')](_0x4e8761[_0xeef7('0x30')],_0x4e8761['query']);_0x5e3a0e[_0xeef7('0x31')]=_[_0xeef7('0x2f')](_0x4e8761['model'],qs['fields'](_0x27d0fe['query'][_0xeef7('0x32')]));_0x5e3a0e[_0xeef7('0x31')]=_0x5e3a0e[_0xeef7('0x31')][_0xeef7('0x33')]?_0x5e3a0e[_0xeef7('0x31')]:_0x4e8761['model'];if(_0x27d0fe[_0xeef7('0x2d')][_0xeef7('0x46')]){_0x5e3a0e['include']=[{'all':!![]}];}_0x5e3a0e=_['merge']({},_0x5e3a0e,_0x27d0fe[_0xeef7('0x3e')]);return db[_0xeef7('0x2a')]['find'](_0x5e3a0e)[_0xeef7('0x25')](handleEntityNotFound(_0x58f8af,null))[_0xeef7('0x25')](respondWithResult(_0x58f8af,null))[_0xeef7('0x42')](handleError(_0x58f8af,null));};exports[_0xeef7('0x47')]=function(_0x20f3d2,_0x399f32){return db[_0xeef7('0x2a')][_0xeef7('0x47')](_0x20f3d2[_0xeef7('0x48')],{})[_0xeef7('0x25')](respondWithResult(_0x399f32,0xc9))[_0xeef7('0x42')](handleError(_0x399f32,null));};exports[_0xeef7('0x49')]=function(_0x224487,_0xb442e){if(_0x224487[_0xeef7('0x48')]['id']){delete _0x224487[_0xeef7('0x48')]['id'];}return db[_0xeef7('0x2a')][_0xeef7('0x4a')]({'where':{'id':_0x224487[_0xeef7('0x44')]['id']}})[_0xeef7('0x25')](handleEntityNotFound(_0xb442e,null))[_0xeef7('0x25')](saveUpdates(_0x224487[_0xeef7('0x48')],null))[_0xeef7('0x25')](respondWithResult(_0xb442e,null))[_0xeef7('0x42')](handleError(_0xb442e,null));};exports[_0xeef7('0x4b')]=function(_0x12e812,_0x2db7d2){return db[_0xeef7('0x2a')][_0xeef7('0x4a')]({'where':{'id':_0x12e812[_0xeef7('0x44')]['id']}})[_0xeef7('0x25')](handleEntityNotFound(_0x2db7d2,null))['then'](removeEntity(_0x2db7d2,null))[_0xeef7('0x42')](handleError(_0x2db7d2,null));};exports['describe']=function(_0x6dee32,_0xe3b313){return db['FaxTransferReport'][_0xeef7('0x4c')]()[_0xeef7('0x25')](respondWithResult(_0xe3b313,null))[_0xeef7('0x42')](handleError(_0xe3b313,null));}; \ No newline at end of file +var _0xc81c=['error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','rows','catch','find','create','update','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy'];(function(_0x3f5fdc,_0x422743){var _0xaa7fdb=function(_0x24210a){while(--_0x24210a){_0x3f5fdc['push'](_0x3f5fdc['shift']());}};_0xaa7fdb(++_0x422743);}(_0xc81c,0x6f));var _0xcc81=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc81c[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0xcc81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc81('0x2'));var moment=require(_0xcc81('0x3'));var BPromise=require(_0xcc81('0x4'));var Mustache=require(_0xcc81('0x5'));var util=require(_0xcc81('0x6'));var path=require(_0xcc81('0x7'));var sox=require(_0xcc81('0x8'));var csv=require(_0xcc81('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc81('0xa'));var _=require(_0xcc81('0xb'));var squel=require(_0xcc81('0xc'));var crypto=require(_0xcc81('0xd'));var jsforce=require(_0xcc81('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcc81('0xf'));var Papa=require(_0xcc81('0x10'));var Redis=require(_0xcc81('0x11'));var authService=require(_0xcc81('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcc81('0x13'));var hardwareService=require(_0xcc81('0x14'));var logger=require(_0xcc81('0x15'))('api');var utils=require(_0xcc81('0x16'));var config=require(_0xcc81('0x17'));var licenseUtil=require(_0xcc81('0x18'));var db=require(_0xcc81('0x19'))['db'];function respondWithStatusCode(_0x3afba4,_0x429efc){_0x429efc=_0x429efc||0xcc;return function(_0x65ced8){if(_0x65ced8){return _0x3afba4[_0xcc81('0x1a')](_0x429efc);}return _0x3afba4['status'](_0x429efc)[_0xcc81('0x1b')]();};}function respondWithResult(_0x21e803,_0x50fc41){_0x50fc41=_0x50fc41||0xc8;return function(_0x4ec9be){if(_0x4ec9be){return _0x21e803[_0xcc81('0x1c')](_0x50fc41)[_0xcc81('0x1d')](_0x4ec9be);}};}function respondWithFilteredResult(_0x3cd446,_0x4638c6){return function(_0x5de0d0){if(_0x5de0d0){var _0x2f24e4=typeof _0x4638c6[_0xcc81('0x1e')]===_0xcc81('0x1f')&&typeof _0x4638c6[_0xcc81('0x20')]===_0xcc81('0x1f');var _0x373d30=_0x5de0d0['count'];var _0x127fee=_0x2f24e4?0x0:_0x4638c6[_0xcc81('0x1e')];var _0x33a8af=_0x2f24e4?_0x5de0d0[_0xcc81('0x21')]:_0x4638c6['offset']+_0x4638c6[_0xcc81('0x20')];var _0x63a2f7;if(_0x33a8af>=_0x373d30){_0x33a8af=_0x373d30;_0x63a2f7=0xc8;}else{_0x63a2f7=0xce;}_0x3cd446[_0xcc81('0x1c')](_0x63a2f7);return _0x3cd446[_0xcc81('0x22')](_0xcc81('0x23'),_0x127fee+'-'+_0x33a8af+'/'+_0x373d30)[_0xcc81('0x1d')](_0x5de0d0);}return null;};}function patchUpdates(_0xbb7749){return function(_0x251474){try{jsonpatch[_0xcc81('0x24')](_0x251474,_0xbb7749,!![]);}catch(_0x258ab6){return BPromise['reject'](_0x258ab6);}return _0x251474[_0xcc81('0x25')]();};}function saveUpdates(_0xa1a232,_0x456116){return function(_0x17e7a9){if(_0x17e7a9){return _0x17e7a9['update'](_0xa1a232)['then'](function(_0x31b756){return _0x31b756;});}return null;};}function removeEntity(_0x1b852a,_0x30fcff){return function(_0x6e18e4){if(_0x6e18e4){return _0x6e18e4[_0xcc81('0x26')]()['then'](function(){_0x1b852a[_0xcc81('0x1c')](0xcc)[_0xcc81('0x1b')]();});}};}function handleEntityNotFound(_0x504aeb,_0x86e08f){return function(_0x5f0b75){if(!_0x5f0b75){_0x504aeb[_0xcc81('0x1a')](0x194);}return _0x5f0b75;};}function handleError(_0x58c8ec,_0xb4c939){_0xb4c939=_0xb4c939||0x1f4;return function(_0x73d413){logger[_0xcc81('0x27')](_0x73d413['stack']);if(_0x73d413[_0xcc81('0x28')]){delete _0x73d413[_0xcc81('0x28')];}_0x58c8ec['status'](_0xb4c939)['send'](_0x73d413);};}exports[_0xcc81('0x29')]=function(_0xb6ffe9,_0x5eb41d){var _0x455f46={},_0xdebe3b={},_0x2bf8ee={'count':0x0,'rows':[]};var _0x5b9843=_[_0xcc81('0x2a')](db[_0xcc81('0x2b')][_0xcc81('0x2c')],function(_0x4ab1f9){return{'name':_0x4ab1f9[_0xcc81('0x2d')],'type':_0x4ab1f9[_0xcc81('0x2e')]['key']};});_0xdebe3b[_0xcc81('0x2f')]=_[_0xcc81('0x2a')](_0x5b9843,_0xcc81('0x28'));_0xdebe3b[_0xcc81('0x30')]=_[_0xcc81('0x31')](_0xb6ffe9['query']);_0xdebe3b[_0xcc81('0x32')]=_[_0xcc81('0x33')](_0xdebe3b[_0xcc81('0x2f')],_0xdebe3b['query']);_0x455f46['attributes']=_[_0xcc81('0x33')](_0xdebe3b[_0xcc81('0x2f')],qs[_0xcc81('0x34')](_0xb6ffe9[_0xcc81('0x30')][_0xcc81('0x34')]));_0x455f46[_0xcc81('0x35')]=_0x455f46[_0xcc81('0x35')][_0xcc81('0x36')]?_0x455f46[_0xcc81('0x35')]:_0xdebe3b['model'];if(!_0xb6ffe9[_0xcc81('0x30')]['hasOwnProperty'](_0xcc81('0x37'))){_0x455f46['limit']=qs[_0xcc81('0x20')](_0xb6ffe9['query'][_0xcc81('0x20')]);_0x455f46[_0xcc81('0x1e')]=qs['offset'](_0xb6ffe9['query'][_0xcc81('0x1e')]);}_0x455f46[_0xcc81('0x38')]=qs[_0xcc81('0x39')](_0xb6ffe9['query']['sort']);_0x455f46['where']=qs[_0xcc81('0x32')](_[_0xcc81('0x3a')](_0xb6ffe9['query'],_0xdebe3b[_0xcc81('0x32')]),_0x5b9843);if(_0xb6ffe9['query'][_0xcc81('0x3b')]){_0x455f46[_0xcc81('0x3c')]=_[_0xcc81('0x3d')](_0x455f46[_0xcc81('0x3c')],{'$or':_[_0xcc81('0x2a')](_0x5b9843,function(_0x4c7204){if(_0x4c7204[_0xcc81('0x2e')]!==_0xcc81('0x3e')){var _0x4b14c2={};_0x4b14c2[_0x4c7204['name']]={'$like':'%'+_0xb6ffe9['query'][_0xcc81('0x3b')]+'%'};return _0x4b14c2;}})});}_0x455f46=_[_0xcc81('0x3d')]({},_0x455f46,_0xb6ffe9[_0xcc81('0x3f')]);var _0x44dce5={'where':_0x455f46[_0xcc81('0x3c')]};return db[_0xcc81('0x2b')][_0xcc81('0x21')](_0x44dce5)[_0xcc81('0x40')](function(_0x28ddcc){_0x2bf8ee[_0xcc81('0x21')]=_0x28ddcc;if(_0xb6ffe9['query'][_0xcc81('0x41')]){_0x455f46[_0xcc81('0x42')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x455f46);})['then'](function(_0x3f4753){_0x2bf8ee[_0xcc81('0x43')]=_0x3f4753;return _0x2bf8ee;})['then'](respondWithFilteredResult(_0x5eb41d,_0x455f46))[_0xcc81('0x44')](handleError(_0x5eb41d,null));};exports['show']=function(_0xa0ef01,_0x48b5eb){var _0x28fd18={'raw':!![],'where':{'id':_0xa0ef01['params']['id']}},_0x1c12c0={};_0x1c12c0['model']=_[_0xcc81('0x31')](db['FaxTransferReport'][_0xcc81('0x2c')]);_0x1c12c0['query']=_['keys'](_0xa0ef01[_0xcc81('0x30')]);_0x1c12c0[_0xcc81('0x32')]=_[_0xcc81('0x33')](_0x1c12c0['model'],_0x1c12c0[_0xcc81('0x30')]);_0x28fd18['attributes']=_[_0xcc81('0x33')](_0x1c12c0['model'],qs[_0xcc81('0x34')](_0xa0ef01[_0xcc81('0x30')]['fields']));_0x28fd18['attributes']=_0x28fd18[_0xcc81('0x35')]['length']?_0x28fd18['attributes']:_0x1c12c0['model'];if(_0xa0ef01[_0xcc81('0x30')]['includeAll']){_0x28fd18[_0xcc81('0x42')]=[{'all':!![]}];}_0x28fd18=_[_0xcc81('0x3d')]({},_0x28fd18,_0xa0ef01['options']);return db[_0xcc81('0x2b')][_0xcc81('0x45')](_0x28fd18)[_0xcc81('0x40')](handleEntityNotFound(_0x48b5eb,null))[_0xcc81('0x40')](respondWithResult(_0x48b5eb,null))[_0xcc81('0x44')](handleError(_0x48b5eb,null));};exports['create']=function(_0x46130e,_0x24b2c3){return db[_0xcc81('0x2b')][_0xcc81('0x46')](_0x46130e['body'],{})['then'](respondWithResult(_0x24b2c3,0xc9))[_0xcc81('0x44')](handleError(_0x24b2c3,null));};exports[_0xcc81('0x47')]=function(_0x16b069,_0x4e0832){if(_0x16b069[_0xcc81('0x48')]['id']){delete _0x16b069[_0xcc81('0x48')]['id'];}return db[_0xcc81('0x2b')][_0xcc81('0x45')]({'where':{'id':_0x16b069[_0xcc81('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e0832,null))[_0xcc81('0x40')](saveUpdates(_0x16b069[_0xcc81('0x48')],null))[_0xcc81('0x40')](respondWithResult(_0x4e0832,null))['catch'](handleError(_0x4e0832,null));};exports[_0xcc81('0x26')]=function(_0x2584aa,_0x2d2447){return db[_0xcc81('0x2b')][_0xcc81('0x45')]({'where':{'id':_0x2584aa[_0xcc81('0x49')]['id']}})[_0xcc81('0x40')](handleEntityNotFound(_0x2d2447,null))[_0xcc81('0x40')](removeEntity(_0x2d2447,null))[_0xcc81('0x44')](handleError(_0x2d2447,null));};exports[_0xcc81('0x4a')]=function(_0x6b18ae,_0x21c0ac){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0x21c0ac,null))[_0xcc81('0x44')](handleError(_0x21c0ac,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 8b8d14f..81cd42b 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 _0xf100=['../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf100,0x119));var _0x0f10=function(_0x3217bb,_0x26b8da){_0x3217bb=_0x3217bb-0x0;var _0x1091c5=_0xf100[_0x3217bb];return _0x1091c5;};'use strict';var _=require(_0x0f10('0x0'));var util=require(_0x0f10('0x1'));var logger=require(_0x0f10('0x2'))(_0x0f10('0x3'));var moment=require('moment');var BPromise=require(_0x0f10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f10('0x5'));var rimraf=require(_0x0f10('0x6'));var config=require(_0x0f10('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x0f10('0x8')]=function(_0x1f6361,_0x17f8c5){return _0x1f6361['define'](_0x0f10('0x9'),attributes,{'tableName':_0x0f10('0xa'),'paranoid':![],'indexes':[{'name':_0x0f10('0xb'),'fields':[_0x0f10('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1288=['../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x1288,0x1d4));var _0x8128=function(_0x3ccd9f,_0x1b2b46){_0x3ccd9f=_0x3ccd9f-0x0;var _0x273cb8=_0x1288[_0x3ccd9f];return _0x273cb8;};'use strict';var _=require(_0x8128('0x0'));var util=require(_0x8128('0x1'));var logger=require(_0x8128('0x2'))(_0x8128('0x3'));var moment=require(_0x8128('0x4'));var BPromise=require(_0x8128('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8128('0x6'));var rimraf=require(_0x8128('0x7'));var config=require(_0x8128('0x8'));var attributes=require(_0x8128('0x9'));module[_0x8128('0xa')]=function(_0x208b24,_0x4ba89d){return _0x208b24[_0x8128('0xb')]('FaxTransferReport',attributes,{'tableName':_0x8128('0xc'),'paranoid':![],'indexes':[{'name':_0x8128('0xd'),'fields':[_0x8128('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 146950f..9a197b7 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 _0x8d09=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','catch','util'];(function(_0x17d928,_0x15f099){var _0x2c812c=function(_0x5e42db){while(--_0x5e42db){_0x17d928['push'](_0x17d928['shift']());}};_0x2c812c(++_0x15f099);}(_0x8d09,0x83));var _0x98d0=function(_0xc48539,_0x4f5a61){_0xc48539=_0xc48539-0x0;var _0x17314a=_0x8d09[_0xc48539];return _0x17314a;};'use strict';var _=require('lodash');var util=require(_0x98d0('0x0'));var moment=require(_0x98d0('0x1'));var BPromise=require(_0x98d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98d0('0x3'));var db=require(_0x98d0('0x4'))['db'];var utils=require(_0x98d0('0x5'));var logger=require('../../config/logger')(_0x98d0('0x6'));var config=require('../../config/environment');var jayson=require(_0x98d0('0x7'));var client=jayson[_0x98d0('0x8')][_0x98d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5afe56,_0xc416aa,_0x394a08){return new BPromise(function(_0x524c6c,_0x3185d9){return client[_0x98d0('0xa')](_0x5afe56,_0x394a08)[_0x98d0('0xb')](function(_0x468ec0){logger[_0x98d0('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0xc416aa,_0x98d0('0xd'));logger[_0x98d0('0xe')](_0x98d0('0xf'),_0xc416aa,_0x98d0('0xd'),JSON[_0x98d0('0x10')](_0x468ec0));if(_0x468ec0['error']){if(_0x468ec0[_0x98d0('0x11')][_0x98d0('0x12')]===0x1f4){logger[_0x98d0('0x11')](_0x98d0('0x13'),_0xc416aa,_0x468ec0[_0x98d0('0x11')][_0x98d0('0x14')]);return _0x3185d9(_0x468ec0[_0x98d0('0x11')]['message']);}logger[_0x98d0('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xc416aa,_0x468ec0['error'][_0x98d0('0x14')]);return _0x524c6c(_0x468ec0[_0x98d0('0x11')][_0x98d0('0x14')]);}else{logger[_0x98d0('0xc')](_0x98d0('0x13'),_0xc416aa,'request\x20sent');_0x524c6c(_0x468ec0['result']['message']);}})[_0x98d0('0x15')](function(_0x1ba0be){logger[_0x98d0('0x11')](_0x98d0('0x13'),_0xc416aa,_0x1ba0be);_0x3185d9(_0x1ba0be);});});} \ No newline at end of file +var _0x0334=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x0334,0x177));var _0x4033=function(_0x307570,_0x486153){_0x307570=_0x307570-0x0;var _0x11d932=_0x0334[_0x307570];return _0x11d932;};'use strict';var _=require('lodash');var util=require(_0x4033('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4033('0x1'));var fs=require('fs');var Redis=require(_0x4033('0x2'));var db=require(_0x4033('0x3'))['db'];var utils=require(_0x4033('0x4'));var logger=require(_0x4033('0x5'))(_0x4033('0x6'));var config=require(_0x4033('0x7'));var jayson=require(_0x4033('0x8'));var client=jayson[_0x4033('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5335a8,_0x2d07bf,_0x496eff){return new BPromise(function(_0x51bc61,_0x160f3d){return client[_0x4033('0xa')](_0x5335a8,_0x496eff)[_0x4033('0xb')](function(_0x2497f9){logger[_0x4033('0xc')](_0x4033('0xd'),_0x2d07bf,_0x4033('0xe'));logger['debug'](_0x4033('0xf'),_0x2d07bf,'request\x20sent',JSON[_0x4033('0x10')](_0x2497f9));if(_0x2497f9[_0x4033('0x11')]){if(_0x2497f9['error'][_0x4033('0x12')]===0x1f4){logger[_0x4033('0x11')](_0x4033('0xd'),_0x2d07bf,_0x2497f9[_0x4033('0x11')][_0x4033('0x13')]);return _0x160f3d(_0x2497f9['error']['message']);}logger[_0x4033('0x11')](_0x4033('0xd'),_0x2d07bf,_0x2497f9[_0x4033('0x11')][_0x4033('0x13')]);return _0x51bc61(_0x2497f9['error'][_0x4033('0x13')]);}else{logger[_0x4033('0xc')](_0x4033('0xd'),_0x2d07bf,_0x4033('0xe'));_0x51bc61(_0x2497f9[_0x4033('0x14')][_0x4033('0x13')]);}})[_0x4033('0x15')](function(_0x5d7112){logger['error'](_0x4033('0xd'),_0x2d07bf,_0x5d7112);_0x160f3d(_0x5d7112);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 53989c9..dcf1e19 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 _0x257c=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x257c,0xab));var _0xc257=function(_0x174a4d,_0x203ae3){_0x174a4d=_0x174a4d-0x0;var _0x240fa1=_0x257c[_0x174a4d];return _0x240fa1;};'use strict';var multer=require(_0xc257('0x0'));var util=require('util');var path=require(_0xc257('0x1'));var timeout=require(_0xc257('0x2'));var express=require(_0xc257('0x3'));var router=express[_0xc257('0x4')]();var fs_extra=require(_0xc257('0x5'));var auth=require(_0xc257('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc257('0x7'));var controller=require('./faxTransferReport.controller');router[_0xc257('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc257('0x9'),auth[_0xc257('0xa')](),controller[_0xc257('0xb')]);router[_0xc257('0x8')](_0xc257('0xc'),auth['isAuthenticated'](),controller[_0xc257('0xd')]);router[_0xc257('0xe')]('/',auth[_0xc257('0xa')](),controller[_0xc257('0xf')]);router[_0xc257('0x10')]('/:id',auth[_0xc257('0xa')](),controller[_0xc257('0x11')]);router[_0xc257('0x12')](_0xc257('0xc'),auth[_0xc257('0xa')](),controller[_0xc257('0x13')]);module[_0xc257('0x14')]=router; \ No newline at end of file +var _0x0963=['/:id','show','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x48c1c7,_0x14851c){var _0x501a71=function(_0x414647){while(--_0x414647){_0x48c1c7['push'](_0x48c1c7['shift']());}};_0x501a71(++_0x14851c);}(_0x0963,0x182));var _0x3096=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x0963[_0x5b8b97];return _0x1fdf84;};'use strict';var multer=require('multer');var util=require(_0x3096('0x0'));var path=require(_0x3096('0x1'));var timeout=require(_0x3096('0x2'));var express=require(_0x3096('0x3'));var router=express[_0x3096('0x4')]();var fs_extra=require(_0x3096('0x5'));var auth=require(_0x3096('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3096('0x7'));var controller=require('./faxTransferReport.controller');router[_0x3096('0x8')]('/',auth['isAuthenticated'](),controller[_0x3096('0x9')]);router['get'](_0x3096('0xa'),auth[_0x3096('0xb')](),controller[_0x3096('0xc')]);router[_0x3096('0x8')](_0x3096('0xd'),auth[_0x3096('0xb')](),controller[_0x3096('0xe')]);router['post']('/',auth[_0x3096('0xb')](),controller['create']);router[_0x3096('0xf')](_0x3096('0xd'),auth[_0x3096('0xb')](),controller[_0x3096('0x10')]);router[_0x3096('0x11')]('/:id',auth[_0x3096('0xb')](),controller[_0x3096('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f375bf6..2a60266 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 _0xf3b8=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0xf3b8,0x1d7));var _0x8f3b=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xf3b8[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0x8f3b('0x0'));var util=require(_0x8f3b('0x1'));var path=require('path');var timeout=require(_0x8f3b('0x2'));var express=require('express');var router=express[_0x8f3b('0x3')]();var fs_extra=require(_0x8f3b('0x4'));var auth=require(_0x8f3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8f3b('0x6'));var controller=require('./intDeskAccount.controller');router[_0x8f3b('0x7')]('/',auth[_0x8f3b('0x8')](),controller[_0x8f3b('0x9')]);router[_0x8f3b('0x7')](_0x8f3b('0xa'),auth['isAuthenticated'](),controller[_0x8f3b('0xb')]);router[_0x8f3b('0x7')](_0x8f3b('0xc'),auth[_0x8f3b('0x8')](),controller[_0x8f3b('0xd')]);router[_0x8f3b('0x7')](_0x8f3b('0xe'),auth['isAuthenticated'](),controller[_0x8f3b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8f3b('0x10')]);router[_0x8f3b('0x11')](_0x8f3b('0xc'),auth['isAuthenticated'](),controller[_0x8f3b('0x12')]);router[_0x8f3b('0x13')](_0x8f3b('0xa'),auth[_0x8f3b('0x8')](),controller[_0x8f3b('0x14')]);router['delete'](_0x8f3b('0xa'),auth[_0x8f3b('0x8')](),controller[_0x8f3b('0x15')]);module[_0x8f3b('0x16')]=router; \ No newline at end of file +var _0x51ec=['Router','../../components/auth/service','get','index','/:id','show','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x19f000,_0x39ac54){var _0x81cee0=function(_0x1ea7b8){while(--_0x1ea7b8){_0x19f000['push'](_0x19f000['shift']());}};_0x81cee0(++_0x39ac54);}(_0x51ec,0x6a));var _0xc51e=function(_0x2cd1da,_0x51297f){_0x2cd1da=_0x2cd1da-0x0;var _0x404243=_0x51ec[_0x2cd1da];return _0x404243;};'use strict';var multer=require(_0xc51e('0x0'));var util=require(_0xc51e('0x1'));var path=require(_0xc51e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc51e('0x3'));var router=express[_0xc51e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc51e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xc51e('0x6')]('/',auth['isAuthenticated'](),controller[_0xc51e('0x7')]);router[_0xc51e('0x6')](_0xc51e('0x8'),auth['isAuthenticated'](),controller[_0xc51e('0x9')]);router[_0xc51e('0x6')]('/:id/configurations',auth[_0xc51e('0xa')](),controller[_0xc51e('0xb')]);router[_0xc51e('0x6')](_0xc51e('0xc'),auth[_0xc51e('0xa')](),controller[_0xc51e('0xd')]);router[_0xc51e('0xe')]('/',auth['isAuthenticated'](),controller[_0xc51e('0xf')]);router['post'](_0xc51e('0x10'),auth[_0xc51e('0xa')](),controller['addConfiguration']);router[_0xc51e('0x11')](_0xc51e('0x8'),auth[_0xc51e('0xa')](),controller[_0xc51e('0x12')]);router[_0xc51e('0x13')]('/:id',auth[_0xc51e('0xa')](),controller[_0xc51e('0x14')]);module[_0xc51e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index a9c0f7b..b740f60 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 _0x9247=['integrationTab','exports','STRING','ENUM','basic','newTab'];(function(_0x117360,_0x674a6b){var _0x2f8cfb=function(_0x29e54a){while(--_0x29e54a){_0x117360['push'](_0x117360['shift']());}};_0x2f8cfb(++_0x674a6b);}(_0x9247,0x16f));var _0x7924=function(_0x515992,_0x245981){_0x515992=_0x515992-0x0;var _0x29033c=_0x9247[_0x515992];return _0x29033c;};'use strict';var Sequelize=require('sequelize');module[_0x7924('0x0')]={'name':{'type':Sequelize[_0x7924('0x1')]},'description':{'type':Sequelize[_0x7924('0x1')]},'username':{'type':Sequelize[_0x7924('0x1')]},'remoteUri':{'type':Sequelize[_0x7924('0x1')]},'authType':{'type':Sequelize[_0x7924('0x2')](_0x7924('0x3')),'defaultValue':_0x7924('0x3')},'password':{'type':Sequelize[_0x7924('0x1')]},'consumerKey':{'type':Sequelize[_0x7924('0x1')]},'consumerSecret':{'type':Sequelize[_0x7924('0x1')]},'token':{'type':Sequelize[_0x7924('0x1')]},'tokenSecret':{'type':Sequelize[_0x7924('0x1')]},'serverUrl':{'type':Sequelize[_0x7924('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7924('0x2')]('integrationTab',_0x7924('0x4')),'defaultValue':_0x7924('0x5')}}; \ No newline at end of file +var _0x531f=['basic','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x531f,0x182));var _0xf531=function(_0x352b7c,_0xf3c28b){_0x352b7c=_0x352b7c-0x0;var _0x2f96ff=_0x531f[_0x352b7c];return _0x2f96ff;};'use strict';var Sequelize=require(_0xf531('0x0'));module[_0xf531('0x1')]={'name':{'type':Sequelize[_0xf531('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf531('0x2')]},'remoteUri':{'type':Sequelize[_0xf531('0x2')]},'authType':{'type':Sequelize[_0xf531('0x3')](_0xf531('0x4')),'defaultValue':_0xf531('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xf531('0x2')]},'consumerSecret':{'type':Sequelize[_0xf531('0x2')]},'token':{'type':Sequelize[_0xf531('0x2')]},'tokenSecret':{'type':Sequelize[_0xf531('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf531('0x3')]('integrationTab','newTab'),'defaultValue':_0xf531('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f825bf2..4eca622 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 _0x12b1=['%s:%s','username','toString','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','error','name','index','map','DeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','create','body','catch','find','getConfigurations','sort','addConfiguration','findOne','AccountId','channel','getDescriptions','DeskConfiguration','Subjects','Descriptions','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','substring','GET','format','application/json','basic','headers','Authorization','Basic\x20%s'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x12b1,0xed));var _0x112b=function(_0x3038c1,_0x1ea3a7){_0x3038c1=_0x3038c1-0x0;var _0x305853=_0x12b1[_0x3038c1];return _0x305853;};'use strict';var emlformat=require(_0x112b('0x0'));var rimraf=require(_0x112b('0x1'));var zipdir=require(_0x112b('0x2'));var jsonpatch=require(_0x112b('0x3'));var rp=require(_0x112b('0x4'));var moment=require(_0x112b('0x5'));var BPromise=require(_0x112b('0x6'));var Mustache=require(_0x112b('0x7'));var util=require('util');var path=require(_0x112b('0x8'));var sox=require('sox');var csv=require(_0x112b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x112b('0xa'));var _=require(_0x112b('0xb'));var squel=require(_0x112b('0xc'));var crypto=require(_0x112b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x112b('0x9'));var querystring=require(_0x112b('0xe'));var Papa=require(_0x112b('0xf'));var Redis=require(_0x112b('0x10'));var authService=require(_0x112b('0x11'));var qs=require(_0x112b('0x12'));var as=require(_0x112b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x112b('0x14'))(_0x112b('0x15'));var utils=require('../../config/utils');var config=require(_0x112b('0x16'));var licenseUtil=require(_0x112b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x112b('0x18'));function respondWithStatusCode(_0x3a8add,_0xc4a3d4){_0xc4a3d4=_0xc4a3d4||0xcc;return function(_0x497470){if(_0x497470){return _0x3a8add[_0x112b('0x19')](_0xc4a3d4);}return _0x3a8add[_0x112b('0x1a')](_0xc4a3d4)[_0x112b('0x1b')]();};}function respondWithResult(_0x3a4b63,_0xcd3a62){_0xcd3a62=_0xcd3a62||0xc8;return function(_0x53b5ad){if(_0x53b5ad){return _0x3a4b63[_0x112b('0x1a')](_0xcd3a62)['json'](_0x53b5ad);}};}function respondWithFilteredResult(_0x1179d0,_0x5abf36){return function(_0x108cb0){if(_0x108cb0){var _0x4c32c1=typeof _0x5abf36[_0x112b('0x1c')]===_0x112b('0x1d')&&typeof _0x5abf36['limit']===_0x112b('0x1d');var _0x34d873=_0x108cb0[_0x112b('0x1e')];var _0xafb96c=_0x4c32c1?0x0:_0x5abf36['offset'];var _0x48e90b=_0x4c32c1?_0x108cb0[_0x112b('0x1e')]:_0x5abf36[_0x112b('0x1c')]+_0x5abf36['limit'];var _0x31439b;if(_0x48e90b>=_0x34d873){_0x48e90b=_0x34d873;_0x31439b=0xc8;}else{_0x31439b=0xce;}_0x1179d0[_0x112b('0x1a')](_0x31439b);return _0x1179d0[_0x112b('0x1f')]('Content-Range',_0xafb96c+'-'+_0x48e90b+'/'+_0x34d873)[_0x112b('0x20')](_0x108cb0);}return null;};}function patchUpdates(_0x2892a8){return function(_0x343930){try{jsonpatch[_0x112b('0x21')](_0x343930,_0x2892a8,!![]);}catch(_0x22f07e){return BPromise[_0x112b('0x22')](_0x22f07e);}return _0x343930[_0x112b('0x23')]();};}function saveUpdates(_0x4cc3b5,_0x5e305a){return function(_0x3982eb){if(_0x3982eb){return _0x3982eb[_0x112b('0x24')](_0x4cc3b5)['then'](function(_0x5d46a8){return _0x5d46a8;});}return null;};}function removeEntity(_0x2d24a0,_0x2d3205){return function(_0x120b79){if(_0x120b79){return _0x120b79[_0x112b('0x25')]()[_0x112b('0x26')](function(){_0x2d24a0[_0x112b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x293ec1,_0x36a1ec){return function(_0x7e4d10){if(!_0x7e4d10){_0x293ec1[_0x112b('0x19')](0x194);}return _0x7e4d10;};}function handleError(_0x3d9374,_0x517356){_0x517356=_0x517356||0x1f4;return function(_0x12c369){logger[_0x112b('0x27')](_0x12c369['stack']);if(_0x12c369[_0x112b('0x28')]){delete _0x12c369[_0x112b('0x28')];}_0x3d9374[_0x112b('0x1a')](_0x517356)['send'](_0x12c369);};}exports[_0x112b('0x29')]=function(_0x4f4e59,_0x11b5a2){var _0x582891={},_0x5d8310={},_0x560140={'count':0x0,'rows':[]};var _0x52c3f8=_[_0x112b('0x2a')](db[_0x112b('0x2b')][_0x112b('0x2c')],function(_0x3b5120){return{'name':_0x3b5120[_0x112b('0x2d')],'type':_0x3b5120[_0x112b('0x2e')]['key']};});_0x5d8310[_0x112b('0x2f')]=_[_0x112b('0x2a')](_0x52c3f8,_0x112b('0x28'));_0x5d8310['query']=_[_0x112b('0x30')](_0x4f4e59[_0x112b('0x31')]);_0x5d8310[_0x112b('0x32')]=_[_0x112b('0x33')](_0x5d8310[_0x112b('0x2f')],_0x5d8310[_0x112b('0x31')]);_0x582891[_0x112b('0x34')]=_[_0x112b('0x33')](_0x5d8310[_0x112b('0x2f')],qs['fields'](_0x4f4e59[_0x112b('0x31')][_0x112b('0x35')]));_0x582891[_0x112b('0x34')]=_0x582891[_0x112b('0x34')]['length']?_0x582891['attributes']:_0x5d8310[_0x112b('0x2f')];if(!_0x4f4e59['query'][_0x112b('0x36')](_0x112b('0x37'))){_0x582891[_0x112b('0x38')]=qs['limit'](_0x4f4e59[_0x112b('0x31')][_0x112b('0x38')]);_0x582891['offset']=qs[_0x112b('0x1c')](_0x4f4e59['query'][_0x112b('0x1c')]);}_0x582891[_0x112b('0x39')]=qs['sort'](_0x4f4e59[_0x112b('0x31')]['sort']);_0x582891[_0x112b('0x3a')]=qs[_0x112b('0x32')](_[_0x112b('0x3b')](_0x4f4e59[_0x112b('0x31')],_0x5d8310[_0x112b('0x32')]),_0x52c3f8);if(_0x4f4e59['query'][_0x112b('0x3c')]){_0x582891[_0x112b('0x3a')]=_[_0x112b('0x3d')](_0x582891[_0x112b('0x3a')],{'$or':_[_0x112b('0x2a')](_0x52c3f8,function(_0x265b45){if(_0x265b45['type']!==_0x112b('0x3e')){var _0x925af2={};_0x925af2[_0x265b45['name']]={'$like':'%'+_0x4f4e59['query']['filter']+'%'};return _0x925af2;}})});}_0x582891=_[_0x112b('0x3d')]({},_0x582891,_0x4f4e59[_0x112b('0x3f')]);var _0x280a0e={'where':_0x582891[_0x112b('0x3a')]};return db[_0x112b('0x2b')][_0x112b('0x1e')](_0x280a0e)[_0x112b('0x26')](function(_0x4775f9){_0x560140['count']=_0x4775f9;if(_0x4f4e59[_0x112b('0x31')][_0x112b('0x40')]){_0x582891[_0x112b('0x41')]=[{'all':!![]}];}return db[_0x112b('0x2b')]['findAll'](_0x582891);})['then'](function(_0x485c67){_0x560140[_0x112b('0x42')]=_0x485c67;return _0x560140;})[_0x112b('0x26')](respondWithFilteredResult(_0x11b5a2,_0x582891))['catch'](handleError(_0x11b5a2,null));};exports[_0x112b('0x43')]=function(_0x4598a7,_0x539742){var _0x3c0db4={'raw':![],'where':{'id':_0x4598a7[_0x112b('0x44')]['id']}},_0x23e982={};_0x23e982[_0x112b('0x2f')]=_[_0x112b('0x30')](db[_0x112b('0x2b')][_0x112b('0x2c')]);_0x23e982['query']=_['keys'](_0x4598a7['query']);_0x23e982[_0x112b('0x32')]=_[_0x112b('0x33')](_0x23e982[_0x112b('0x2f')],_0x23e982['query']);_0x3c0db4[_0x112b('0x34')]=_[_0x112b('0x33')](_0x23e982[_0x112b('0x2f')],qs['fields'](_0x4598a7[_0x112b('0x31')][_0x112b('0x35')]));_0x3c0db4['attributes']=_0x3c0db4[_0x112b('0x34')][_0x112b('0x45')]?_0x3c0db4[_0x112b('0x34')]:_0x23e982[_0x112b('0x2f')];if(_0x4598a7[_0x112b('0x31')][_0x112b('0x40')]){_0x3c0db4[_0x112b('0x41')]=[{'all':!![]}];}_0x3c0db4=_[_0x112b('0x3d')]({},_0x3c0db4,_0x4598a7[_0x112b('0x3f')]);return db[_0x112b('0x2b')]['find'](_0x3c0db4)[_0x112b('0x26')](handleEntityNotFound(_0x539742,null))[_0x112b('0x26')](respondWithResult(_0x539742,null))['catch'](handleError(_0x539742,null));};exports[_0x112b('0x46')]=function(_0x459e4d,_0x538152){return db[_0x112b('0x2b')]['create'](_0x459e4d[_0x112b('0x47')],{})[_0x112b('0x26')](respondWithResult(_0x538152,0xc9))[_0x112b('0x48')](handleError(_0x538152,null));};exports[_0x112b('0x24')]=function(_0x44ce11,_0x137640){if(_0x44ce11[_0x112b('0x47')]['id']){delete _0x44ce11[_0x112b('0x47')]['id'];}return db['DeskAccount'][_0x112b('0x49')]({'where':{'id':_0x44ce11[_0x112b('0x44')]['id']}})[_0x112b('0x26')](handleEntityNotFound(_0x137640,null))['then'](saveUpdates(_0x44ce11[_0x112b('0x47')],null))[_0x112b('0x26')](respondWithResult(_0x137640,null))['catch'](handleError(_0x137640,null));};exports[_0x112b('0x25')]=function(_0x3fcda6,_0x5e17cf){return db[_0x112b('0x2b')][_0x112b('0x49')]({'where':{'id':_0x3fcda6[_0x112b('0x44')]['id']}})[_0x112b('0x26')](handleEntityNotFound(_0x5e17cf,null))[_0x112b('0x26')](removeEntity(_0x5e17cf,null))['catch'](handleError(_0x5e17cf,null));};exports[_0x112b('0x4a')]=function(_0x1c9af5,_0x90cdbb,_0x350090){var _0x399e5a={};var _0x29b121={};var _0x60f0af;var _0x32c499;return db[_0x112b('0x2b')]['findOne']({'where':{'id':_0x1c9af5[_0x112b('0x44')]['id']}})[_0x112b('0x26')](handleEntityNotFound(_0x90cdbb,null))['then'](function(_0x335c3d){if(_0x335c3d){_0x60f0af=_0x335c3d;_0x29b121['model']=_[_0x112b('0x30')](db['DeskConfiguration'][_0x112b('0x2c')]);_0x29b121[_0x112b('0x31')]=_[_0x112b('0x30')](_0x1c9af5[_0x112b('0x31')]);_0x29b121[_0x112b('0x32')]=_[_0x112b('0x33')](_0x29b121[_0x112b('0x2f')],_0x29b121[_0x112b('0x31')]);_0x399e5a['attributes']=_['intersection'](_0x29b121[_0x112b('0x2f')],qs[_0x112b('0x35')](_0x1c9af5[_0x112b('0x31')][_0x112b('0x35')]));_0x399e5a['attributes']=_0x399e5a[_0x112b('0x34')][_0x112b('0x45')]?_0x399e5a[_0x112b('0x34')]:_0x29b121[_0x112b('0x2f')];_0x399e5a[_0x112b('0x39')]=qs[_0x112b('0x4b')](_0x1c9af5[_0x112b('0x31')]['sort']);_0x399e5a['where']=qs[_0x112b('0x32')](_['pick'](_0x1c9af5[_0x112b('0x31')],_0x29b121[_0x112b('0x32')]));if(_0x1c9af5['query']['filter']){_0x399e5a['where']=_[_0x112b('0x3d')](_0x399e5a[_0x112b('0x3a')],{'$or':_[_0x112b('0x2a')](_0x399e5a[_0x112b('0x34')],function(_0x160780){var _0x4d3c86={};_0x4d3c86[_0x160780]={'$like':'%'+_0x1c9af5[_0x112b('0x31')][_0x112b('0x3c')]+'%'};return _0x4d3c86;})});}_0x399e5a=_[_0x112b('0x3d')]({},_0x399e5a,_0x1c9af5[_0x112b('0x3f')]);return _0x60f0af[_0x112b('0x4a')](_0x399e5a);}})[_0x112b('0x26')](function(_0x989051){if(_0x989051){_0x32c499=_0x989051[_0x112b('0x45')];if(!_0x1c9af5[_0x112b('0x31')][_0x112b('0x36')]('nolimit')){_0x399e5a['limit']=qs[_0x112b('0x38')](_0x1c9af5[_0x112b('0x31')][_0x112b('0x38')]);_0x399e5a[_0x112b('0x1c')]=qs['offset'](_0x1c9af5['query']['offset']);}return _0x60f0af[_0x112b('0x4a')](_0x399e5a);}})[_0x112b('0x26')](function(_0x11781a){if(_0x11781a){return _0x11781a?{'count':_0x32c499,'rows':_0x11781a}:null;}})[_0x112b('0x26')](respondWithResult(_0x90cdbb,null))[_0x112b('0x48')](handleError(_0x90cdbb,null));};exports[_0x112b('0x4c')]=function(_0x576e08,_0x51c035,_0x618e46){if(_0x576e08[_0x112b('0x47')]['id']){delete _0x576e08['body']['id'];}return db[_0x112b('0x2b')][_0x112b('0x4d')]({'where':{'id':_0x576e08[_0x112b('0x44')]['id']}})[_0x112b('0x26')](handleEntityNotFound(_0x51c035,null))[_0x112b('0x26')](function(_0x36d1e0){if(_0x36d1e0){_0x576e08[_0x112b('0x47')][_0x112b('0x4e')]=_0x36d1e0['id'];_0x576e08[_0x112b('0x47')]['Subjects']=integrations['getSubjects'](_0x576e08['body'][_0x112b('0x4f')],_0x576e08[_0x112b('0x47')]['type']);_0x576e08[_0x112b('0x47')]['Descriptions']=integrations[_0x112b('0x50')](_0x576e08[_0x112b('0x47')]['channel'],_0x576e08[_0x112b('0x47')][_0x112b('0x2e')]);return db[_0x112b('0x51')][_0x112b('0x46')](_0x576e08[_0x112b('0x47')],{'include':[{'model':db['DeskField'],'as':_0x112b('0x52')},{'model':db['DeskField'],'as':_0x112b('0x53')}]});}return null;})[_0x112b('0x26')](respondWithResult(_0x51c035,null))['catch'](handleError(_0x51c035,null));};exports[_0x112b('0x54')]=function(_0x4863ad,_0x2935ef,_0x56b425){var _0x538746=[{'name':'priority','label':_0x112b('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 _0x4acaec='';return db['DeskAccount'][_0x112b('0x4d')]({'where':{'id':_0x4863ad[_0x112b('0x44')]['id']},'attributes':['id',_0x112b('0x56'),_0x112b('0x57'),'username',_0x112b('0x58'),_0x112b('0x59'),_0x112b('0x5a'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x2935ef,null))['then'](function(_0x563e03){if(_0x563e03){_0x4acaec=_0x563e03[_0x112b('0x56')];var _0x3fbb62=_0x4acaec['slice'](-0x1);if(_0x3fbb62==='/'){_0x4acaec=_0x4acaec[_0x112b('0x5b')](0x0,_0x4acaec['lastIndexOf'](_0x3fbb62));}var _0x514709={'method':_0x112b('0x5c'),'uri':util[_0x112b('0x5d')]('%s/custom_fields',_0x4acaec),'headers':{'Content-Type':'application/json','Accept':_0x112b('0x5e')},'json':!![]};if(_0x563e03['authType']===_0x112b('0x5f')){_0x514709[_0x112b('0x60')][_0x112b('0x61')]=util[_0x112b('0x5d')](_0x112b('0x62'),new Buffer(util[_0x112b('0x5d')](_0x112b('0x63'),_0x563e03[_0x112b('0x64')],_0x563e03['password']))[_0x112b('0x65')](_0x112b('0x66')));}return rp(_0x514709)[_0x112b('0x26')](function(_0x3db47e){return _0x538746[_0x112b('0x67')](_[_0x112b('0x2a')](_0x3db47e[_0x112b('0x68')][_0x112b('0x69')],function(_0xdb9fbc){return{'id':_0xdb9fbc[_0x112b('0x28')],'name':_0xdb9fbc[_0x112b('0x28')],'type':_0xdb9fbc[_0x112b('0x2e')],'active':_0xdb9fbc['active'],'label':_0xdb9fbc[_0x112b('0x6a')],'custom':!![]};}));});}})[_0x112b('0x26')](function(_0x3b832a){return{'count':_0x3b832a[_0x112b('0x45')],'rows':_0x3b832a};})[_0x112b('0x26')](respondWithResult(_0x2935ef,null))[_0x112b('0x48')](function(_0x5e964c){var _0xf479df=_0x4863ad['query'][_0x112b('0x6b')]?0x1f4:_0x5e964c[_0x112b('0x6c')]||0x1f4;logger[_0x112b('0x27')](_0x112b('0x6d'),'getFields',_0xf479df,JSON[_0x112b('0x6e')](_0x5e964c));delete _0x5e964c[_0x112b('0x28')];if(_0xf479df===0x191){_0xf479df=0x190;}_0x2935ef[_0x112b('0x1a')](_0xf479df)[_0x112b('0x6f')](_0x4863ad[_0x112b('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5e964c[_0x112b('0x6c')]}:_0x5e964c);});}; \ No newline at end of file +var _0x9165=['username','toString','base64','concat','_embedded','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','json','apply','reject','save','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','limit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','find','create','update','body','getConfigurations','pick','options','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','DeskConfiguration','DeskField','Descriptions','getFields','priority','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','authType','basic','Authorization','%s:%s'];(function(_0x5cb990,_0x38831c){var _0x353fd2=function(_0x31c410){while(--_0x31c410){_0x5cb990['push'](_0x5cb990['shift']());}};_0x353fd2(++_0x38831c);}(_0x9165,0x16d));var _0x5916=function(_0x12c58c,_0x3e89f9){_0x12c58c=_0x12c58c-0x0;var _0x2ba83b=_0x9165[_0x12c58c];return _0x2ba83b;};'use strict';var emlformat=require(_0x5916('0x0'));var rimraf=require(_0x5916('0x1'));var zipdir=require(_0x5916('0x2'));var jsonpatch=require(_0x5916('0x3'));var rp=require(_0x5916('0x4'));var moment=require('moment');var BPromise=require(_0x5916('0x5'));var Mustache=require(_0x5916('0x6'));var util=require(_0x5916('0x7'));var path=require(_0x5916('0x8'));var sox=require(_0x5916('0x9'));var csv=require(_0x5916('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5916('0xb'));var _=require(_0x5916('0xc'));var squel=require(_0x5916('0xd'));var crypto=require(_0x5916('0xe'));var jsforce=require(_0x5916('0xf'));var deskjs=require(_0x5916('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5916('0x11'));var Papa=require('papaparse');var Redis=require(_0x5916('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5916('0x13'));var hardwareService=require(_0x5916('0x14'));var logger=require(_0x5916('0x15'))(_0x5916('0x16'));var utils=require(_0x5916('0x17'));var config=require(_0x5916('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5916('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1a8218,_0x2ea7c1){_0x2ea7c1=_0x2ea7c1||0xcc;return function(_0x5baf4f){if(_0x5baf4f){return _0x1a8218[_0x5916('0x1a')](_0x2ea7c1);}return _0x1a8218[_0x5916('0x1b')](_0x2ea7c1)[_0x5916('0x1c')]();};}function respondWithResult(_0x52798b,_0x192558){_0x192558=_0x192558||0xc8;return function(_0x458494){if(_0x458494){return _0x52798b['status'](_0x192558)['json'](_0x458494);}};}function respondWithFilteredResult(_0x520560,_0x2c47a4){return function(_0x4200fa){if(_0x4200fa){var _0x2b94e5=typeof _0x2c47a4[_0x5916('0x1d')]===_0x5916('0x1e')&&typeof _0x2c47a4['limit']===_0x5916('0x1e');var _0xb1b373=_0x4200fa[_0x5916('0x1f')];var _0x292fa5=_0x2b94e5?0x0:_0x2c47a4[_0x5916('0x1d')];var _0x106f8d=_0x2b94e5?_0x4200fa[_0x5916('0x1f')]:_0x2c47a4[_0x5916('0x1d')]+_0x2c47a4['limit'];var _0xb6c11c;if(_0x106f8d>=_0xb1b373){_0x106f8d=_0xb1b373;_0xb6c11c=0xc8;}else{_0xb6c11c=0xce;}_0x520560['status'](_0xb6c11c);return _0x520560['set']('Content-Range',_0x292fa5+'-'+_0x106f8d+'/'+_0xb1b373)[_0x5916('0x20')](_0x4200fa);}return null;};}function patchUpdates(_0x46693c){return function(_0x2eac88){try{jsonpatch[_0x5916('0x21')](_0x2eac88,_0x46693c,!![]);}catch(_0x31cb22){return BPromise[_0x5916('0x22')](_0x31cb22);}return _0x2eac88[_0x5916('0x23')]();};}function saveUpdates(_0x19f652,_0xb62e88){return function(_0x53b73f){if(_0x53b73f){return _0x53b73f['update'](_0x19f652)[_0x5916('0x24')](function(_0x132f0c){return _0x132f0c;});}return null;};}function removeEntity(_0x3a0149,_0x9d2c89){return function(_0x2ce958){if(_0x2ce958){return _0x2ce958[_0x5916('0x25')]()['then'](function(){_0x3a0149['status'](0xcc)[_0x5916('0x1c')]();});}};}function handleEntityNotFound(_0x5a0019,_0xca0536){return function(_0x283f18){if(!_0x283f18){_0x5a0019[_0x5916('0x1a')](0x194);}return _0x283f18;};}function handleError(_0x3d5744,_0x184bd2){_0x184bd2=_0x184bd2||0x1f4;return function(_0x743f91){logger['error'](_0x743f91[_0x5916('0x26')]);if(_0x743f91[_0x5916('0x27')]){delete _0x743f91[_0x5916('0x27')];}_0x3d5744[_0x5916('0x1b')](_0x184bd2)[_0x5916('0x28')](_0x743f91);};}exports[_0x5916('0x29')]=function(_0x59851d,_0x3ea6c2){var _0x29f240={},_0x22ae5b={},_0x58f651={'count':0x0,'rows':[]};var _0x46e499=_[_0x5916('0x2a')](db[_0x5916('0x2b')][_0x5916('0x2c')],function(_0x4d21a1){return{'name':_0x4d21a1[_0x5916('0x2d')],'type':_0x4d21a1[_0x5916('0x2e')][_0x5916('0x2f')]};});_0x22ae5b['model']=_[_0x5916('0x2a')](_0x46e499,_0x5916('0x27'));_0x22ae5b['query']=_[_0x5916('0x30')](_0x59851d[_0x5916('0x31')]);_0x22ae5b[_0x5916('0x32')]=_[_0x5916('0x33')](_0x22ae5b[_0x5916('0x34')],_0x22ae5b['query']);_0x29f240['attributes']=_[_0x5916('0x33')](_0x22ae5b[_0x5916('0x34')],qs['fields'](_0x59851d[_0x5916('0x31')]['fields']));_0x29f240['attributes']=_0x29f240[_0x5916('0x35')][_0x5916('0x36')]?_0x29f240['attributes']:_0x22ae5b['model'];if(!_0x59851d['query']['hasOwnProperty']('nolimit')){_0x29f240[_0x5916('0x37')]=qs['limit'](_0x59851d['query'][_0x5916('0x37')]);_0x29f240[_0x5916('0x1d')]=qs[_0x5916('0x1d')](_0x59851d[_0x5916('0x31')][_0x5916('0x1d')]);}_0x29f240[_0x5916('0x38')]=qs[_0x5916('0x39')](_0x59851d['query'][_0x5916('0x39')]);_0x29f240['where']=qs[_0x5916('0x32')](_['pick'](_0x59851d['query'],_0x22ae5b[_0x5916('0x32')]),_0x46e499);if(_0x59851d[_0x5916('0x31')][_0x5916('0x3a')]){_0x29f240[_0x5916('0x3b')]=_[_0x5916('0x3c')](_0x29f240['where'],{'$or':_['map'](_0x46e499,function(_0x3ad473){if(_0x3ad473[_0x5916('0x2e')]!==_0x5916('0x3d')){var _0x39b4bf={};_0x39b4bf[_0x3ad473['name']]={'$like':'%'+_0x59851d[_0x5916('0x31')][_0x5916('0x3a')]+'%'};return _0x39b4bf;}})});}_0x29f240=_[_0x5916('0x3c')]({},_0x29f240,_0x59851d['options']);var _0x4a0c4={'where':_0x29f240[_0x5916('0x3b')]};return db[_0x5916('0x2b')][_0x5916('0x1f')](_0x4a0c4)[_0x5916('0x24')](function(_0x2c5d83){_0x58f651[_0x5916('0x1f')]=_0x2c5d83;if(_0x59851d['query'][_0x5916('0x3e')]){_0x29f240[_0x5916('0x3f')]=[{'all':!![]}];}return db[_0x5916('0x2b')][_0x5916('0x40')](_0x29f240);})['then'](function(_0x397d96){_0x58f651['rows']=_0x397d96;return _0x58f651;})['then'](respondWithFilteredResult(_0x3ea6c2,_0x29f240))[_0x5916('0x41')](handleError(_0x3ea6c2,null));};exports[_0x5916('0x42')]=function(_0x5d0727,_0x4996a9){var _0x33f67a={'raw':![],'where':{'id':_0x5d0727[_0x5916('0x43')]['id']}},_0x2cde17={};_0x2cde17[_0x5916('0x34')]=_[_0x5916('0x30')](db[_0x5916('0x2b')][_0x5916('0x2c')]);_0x2cde17['query']=_[_0x5916('0x30')](_0x5d0727[_0x5916('0x31')]);_0x2cde17[_0x5916('0x32')]=_[_0x5916('0x33')](_0x2cde17[_0x5916('0x34')],_0x2cde17[_0x5916('0x31')]);_0x33f67a[_0x5916('0x35')]=_[_0x5916('0x33')](_0x2cde17[_0x5916('0x34')],qs[_0x5916('0x44')](_0x5d0727[_0x5916('0x31')][_0x5916('0x44')]));_0x33f67a[_0x5916('0x35')]=_0x33f67a[_0x5916('0x35')][_0x5916('0x36')]?_0x33f67a['attributes']:_0x2cde17[_0x5916('0x34')];if(_0x5d0727[_0x5916('0x31')][_0x5916('0x3e')]){_0x33f67a[_0x5916('0x3f')]=[{'all':!![]}];}_0x33f67a=_[_0x5916('0x3c')]({},_0x33f67a,_0x5d0727['options']);return db[_0x5916('0x2b')][_0x5916('0x45')](_0x33f67a)[_0x5916('0x24')](handleEntityNotFound(_0x4996a9,null))['then'](respondWithResult(_0x4996a9,null))[_0x5916('0x41')](handleError(_0x4996a9,null));};exports[_0x5916('0x46')]=function(_0x4da6f3,_0x38fb09){return db['DeskAccount'][_0x5916('0x46')](_0x4da6f3['body'],{})[_0x5916('0x24')](respondWithResult(_0x38fb09,0xc9))[_0x5916('0x41')](handleError(_0x38fb09,null));};exports[_0x5916('0x47')]=function(_0xab5c02,_0x2cab0d){if(_0xab5c02['body']['id']){delete _0xab5c02[_0x5916('0x48')]['id'];}return db[_0x5916('0x2b')][_0x5916('0x45')]({'where':{'id':_0xab5c02[_0x5916('0x43')]['id']}})[_0x5916('0x24')](handleEntityNotFound(_0x2cab0d,null))[_0x5916('0x24')](saveUpdates(_0xab5c02[_0x5916('0x48')],null))[_0x5916('0x24')](respondWithResult(_0x2cab0d,null))['catch'](handleError(_0x2cab0d,null));};exports[_0x5916('0x25')]=function(_0xed1039,_0x38af4f){return db[_0x5916('0x2b')][_0x5916('0x45')]({'where':{'id':_0xed1039[_0x5916('0x43')]['id']}})[_0x5916('0x24')](handleEntityNotFound(_0x38af4f,null))[_0x5916('0x24')](removeEntity(_0x38af4f,null))[_0x5916('0x41')](handleError(_0x38af4f,null));};exports[_0x5916('0x49')]=function(_0x4218be,_0x2c1140,_0x17ea63){var _0x187a01={};var _0xa9a222={};var _0x113800;var _0x5293e1;return db[_0x5916('0x2b')]['findOne']({'where':{'id':_0x4218be[_0x5916('0x43')]['id']}})[_0x5916('0x24')](handleEntityNotFound(_0x2c1140,null))[_0x5916('0x24')](function(_0x28313b){if(_0x28313b){_0x113800=_0x28313b;_0xa9a222[_0x5916('0x34')]=_[_0x5916('0x30')](db['DeskConfiguration']['rawAttributes']);_0xa9a222['query']=_[_0x5916('0x30')](_0x4218be[_0x5916('0x31')]);_0xa9a222['filters']=_[_0x5916('0x33')](_0xa9a222[_0x5916('0x34')],_0xa9a222[_0x5916('0x31')]);_0x187a01[_0x5916('0x35')]=_[_0x5916('0x33')](_0xa9a222[_0x5916('0x34')],qs[_0x5916('0x44')](_0x4218be[_0x5916('0x31')][_0x5916('0x44')]));_0x187a01['attributes']=_0x187a01[_0x5916('0x35')]['length']?_0x187a01[_0x5916('0x35')]:_0xa9a222[_0x5916('0x34')];_0x187a01[_0x5916('0x38')]=qs[_0x5916('0x39')](_0x4218be[_0x5916('0x31')][_0x5916('0x39')]);_0x187a01[_0x5916('0x3b')]=qs['filters'](_[_0x5916('0x4a')](_0x4218be['query'],_0xa9a222[_0x5916('0x32')]));if(_0x4218be[_0x5916('0x31')][_0x5916('0x3a')]){_0x187a01[_0x5916('0x3b')]=_[_0x5916('0x3c')](_0x187a01[_0x5916('0x3b')],{'$or':_[_0x5916('0x2a')](_0x187a01[_0x5916('0x35')],function(_0x55fe12){var _0x576d70={};_0x576d70[_0x55fe12]={'$like':'%'+_0x4218be[_0x5916('0x31')]['filter']+'%'};return _0x576d70;})});}_0x187a01=_[_0x5916('0x3c')]({},_0x187a01,_0x4218be[_0x5916('0x4b')]);return _0x113800[_0x5916('0x49')](_0x187a01);}})[_0x5916('0x24')](function(_0x2f1200){if(_0x2f1200){_0x5293e1=_0x2f1200[_0x5916('0x36')];if(!_0x4218be[_0x5916('0x31')]['hasOwnProperty'](_0x5916('0x4c'))){_0x187a01[_0x5916('0x37')]=qs['limit'](_0x4218be[_0x5916('0x31')][_0x5916('0x37')]);_0x187a01[_0x5916('0x1d')]=qs[_0x5916('0x1d')](_0x4218be[_0x5916('0x31')]['offset']);}return _0x113800[_0x5916('0x49')](_0x187a01);}})[_0x5916('0x24')](function(_0x1c75be){if(_0x1c75be){return _0x1c75be?{'count':_0x5293e1,'rows':_0x1c75be}:null;}})[_0x5916('0x24')](respondWithResult(_0x2c1140,null))[_0x5916('0x41')](handleError(_0x2c1140,null));};exports[_0x5916('0x4d')]=function(_0x4e3ad4,_0x22e13e,_0xd7cb92){if(_0x4e3ad4[_0x5916('0x48')]['id']){delete _0x4e3ad4[_0x5916('0x48')]['id'];}return db[_0x5916('0x2b')][_0x5916('0x4e')]({'where':{'id':_0x4e3ad4[_0x5916('0x43')]['id']}})['then'](handleEntityNotFound(_0x22e13e,null))['then'](function(_0x4f2c42){if(_0x4f2c42){_0x4e3ad4['body'][_0x5916('0x4f')]=_0x4f2c42['id'];_0x4e3ad4[_0x5916('0x48')][_0x5916('0x50')]=integrations['getSubjects'](_0x4e3ad4[_0x5916('0x48')][_0x5916('0x51')],_0x4e3ad4[_0x5916('0x48')][_0x5916('0x2e')]);_0x4e3ad4[_0x5916('0x48')]['Descriptions']=integrations[_0x5916('0x52')](_0x4e3ad4[_0x5916('0x48')][_0x5916('0x51')],_0x4e3ad4[_0x5916('0x48')][_0x5916('0x2e')]);return db[_0x5916('0x53')]['create'](_0x4e3ad4['body'],{'include':[{'model':db[_0x5916('0x54')],'as':_0x5916('0x50')},{'model':db[_0x5916('0x54')],'as':_0x5916('0x55')}]});}return null;})[_0x5916('0x24')](respondWithResult(_0x22e13e,null))['catch'](handleError(_0x22e13e,null));};exports[_0x5916('0x56')]=function(_0x8c5a45,_0x1bba47,_0x1ce8d0){var _0x5de9ec=[{'name':_0x5916('0x57'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4a97b1='';return db[_0x5916('0x2b')][_0x5916('0x4e')]({'where':{'id':_0x8c5a45[_0x5916('0x43')]['id']},'attributes':['id',_0x5916('0x58'),'authType','username',_0x5916('0x59'),_0x5916('0x5a'),_0x5916('0x5b'),_0x5916('0x5c'),_0x5916('0x5d')]})[_0x5916('0x24')](handleEntityNotFound(_0x1bba47,null))[_0x5916('0x24')](function(_0x18a5ea){if(_0x18a5ea){_0x4a97b1=_0x18a5ea[_0x5916('0x58')];var _0x344ce1=_0x4a97b1['slice'](-0x1);if(_0x344ce1==='/'){_0x4a97b1=_0x4a97b1[_0x5916('0x5e')](0x0,_0x4a97b1['lastIndexOf'](_0x344ce1));}var _0x2cda76={'method':_0x5916('0x5f'),'uri':util[_0x5916('0x60')](_0x5916('0x61'),_0x4a97b1),'headers':{'Content-Type':_0x5916('0x62'),'Accept':_0x5916('0x62')},'json':!![]};if(_0x18a5ea[_0x5916('0x63')]===_0x5916('0x64')){_0x2cda76['headers'][_0x5916('0x65')]=util['format']('Basic\x20%s',new Buffer(util[_0x5916('0x60')](_0x5916('0x66'),_0x18a5ea[_0x5916('0x67')],_0x18a5ea['password']))[_0x5916('0x68')](_0x5916('0x69')));}return rp(_0x2cda76)[_0x5916('0x24')](function(_0x48ae61){return _0x5de9ec[_0x5916('0x6a')](_[_0x5916('0x2a')](_0x48ae61[_0x5916('0x6b')][_0x5916('0x6c')],function(_0x32a32a){return{'id':_0x32a32a[_0x5916('0x27')],'name':_0x32a32a[_0x5916('0x27')],'type':_0x32a32a['type'],'active':_0x32a32a[_0x5916('0x6d')],'label':_0x32a32a[_0x5916('0x6e')],'custom':!![]};}));});}})[_0x5916('0x24')](function(_0x479d27){return{'count':_0x479d27['length'],'rows':_0x479d27};})[_0x5916('0x24')](respondWithResult(_0x1bba47,null))['catch'](function(_0x1a2d4e){var _0x14b5b9=_0x8c5a45[_0x5916('0x31')]['test']?0x1f4:_0x1a2d4e[_0x5916('0x6f')]||0x1f4;logger[_0x5916('0x70')](_0x5916('0x71'),_0x5916('0x56'),_0x14b5b9,JSON[_0x5916('0x72')](_0x1a2d4e));delete _0x1a2d4e['name'];if(_0x14b5b9===0x191){_0x14b5b9=0x190;}_0x1bba47[_0x5916('0x1b')](_0x14b5b9)['send'](_0x8c5a45['query'][_0x5916('0x73')]?{'message':_0x5916('0x74'),'statusCode':_0x1a2d4e[_0x5916('0x6f')]}:_0x1a2d4e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 018b84c..483f7f9 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 _0x20f0=['api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','int_desk_accounts','util','../../config/logger'];(function(_0x27bdb3,_0x3011af){var _0x31fd1d=function(_0x3deda4){while(--_0x3deda4){_0x27bdb3['push'](_0x27bdb3['shift']());}};_0x31fd1d(++_0x3011af);}(_0x20f0,0xf1));var _0x020f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x20f0[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require(_0x020f('0x0'));var logger=require(_0x020f('0x1'))(_0x020f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x020f('0x3'));var fs=require('fs');var path=require(_0x020f('0x4'));var rimraf=require(_0x020f('0x5'));var config=require(_0x020f('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x020f('0x7'));module['exports']=function(_0x5c0a9a,_0x2225e4){return _0x5c0a9a['define']('DeskAccount',attributes,{'tableName':_0x020f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08b0=['../../config/logger','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x25f62f,_0x474702){var _0x510417=function(_0x3bf5fe){while(--_0x3bf5fe){_0x25f62f['push'](_0x25f62f['shift']());}};_0x510417(++_0x474702);}(_0x08b0,0x16a));var _0x008b=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x08b0[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require('lodash');var util=require(_0x008b('0x0'));var logger=require(_0x008b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x008b('0x2'));var rp=require(_0x008b('0x3'));var fs=require('fs');var path=require(_0x008b('0x4'));var rimraf=require(_0x008b('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x008b('0x6'));module[_0x008b('0x7')]=function(_0x22c804,_0x2d5e9d){return _0x22c804[_0x008b('0x8')](_0x008b('0x9'),attributes,{'tableName':_0x008b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index aa7985e..13d0681 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 _0xbf39=['stringify','error','message','request\x20sent','result','GetDeskAccount','findAll','options','raw','where','attributes','include','model','map','ShowDeskAccount','DeskAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug'];(function(_0x406224,_0x21e9dc){var _0x528dfb=function(_0x4e428c){while(--_0x4e428c){_0x406224['push'](_0x406224['shift']());}};_0x528dfb(++_0x21e9dc);}(_0xbf39,0x188));var _0x9bf3=function(_0x2c1fce,_0x43b7d3){_0x2c1fce=_0x2c1fce-0x0;var _0x38b4c7=_0xbf39[_0x2c1fce];return _0x38b4c7;};'use strict';var _=require(_0x9bf3('0x0'));var util=require(_0x9bf3('0x1'));var moment=require(_0x9bf3('0x2'));var BPromise=require(_0x9bf3('0x3'));var rs=require(_0x9bf3('0x4'));var fs=require('fs');var Redis=require(_0x9bf3('0x5'));var db=require(_0x9bf3('0x6'))['db'];var utils=require(_0x9bf3('0x7'));var logger=require('../../config/logger')(_0x9bf3('0x8'));var config=require(_0x9bf3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9bf3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e3c3f,_0x5f3ad2,_0x5038da){return new BPromise(function(_0x3f08d3,_0x2624a2){return client[_0x9bf3('0xb')](_0x1e3c3f,_0x5038da)[_0x9bf3('0xc')](function(_0x227059){logger[_0x9bf3('0xd')](_0x9bf3('0xe'),_0x5f3ad2,'request\x20sent');logger[_0x9bf3('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5f3ad2,'request\x20sent',JSON[_0x9bf3('0x10')](_0x227059));if(_0x227059['error']){if(_0x227059[_0x9bf3('0x11')]['code']===0x1f4){logger[_0x9bf3('0x11')](_0x9bf3('0xe'),_0x5f3ad2,_0x227059[_0x9bf3('0x11')][_0x9bf3('0x12')]);return _0x2624a2(_0x227059[_0x9bf3('0x11')][_0x9bf3('0x12')]);}logger[_0x9bf3('0x11')](_0x9bf3('0xe'),_0x5f3ad2,_0x227059[_0x9bf3('0x11')][_0x9bf3('0x12')]);return _0x3f08d3(_0x227059[_0x9bf3('0x11')][_0x9bf3('0x12')]);}else{logger['info'](_0x9bf3('0xe'),_0x5f3ad2,_0x9bf3('0x13'));_0x3f08d3(_0x227059[_0x9bf3('0x14')]['message']);}})['catch'](function(_0x2a0f41){logger['error'](_0x9bf3('0xe'),_0x5f3ad2,_0x2a0f41);_0x2624a2(_0x2a0f41);});});}exports[_0x9bf3('0x15')]=function(_0x3d93f7){var _0x13ba55=this;return new Promise(function(_0x471c6b,_0x1b5df1){return db['DeskAccount'][_0x9bf3('0x16')]({'raw':_0x3d93f7[_0x9bf3('0x17')]?_0x3d93f7[_0x9bf3('0x17')][_0x9bf3('0x18')]===undefined?!![]:![]:!![],'where':_0x3d93f7[_0x9bf3('0x17')]?_0x3d93f7[_0x9bf3('0x17')][_0x9bf3('0x19')]||null:null,'attributes':_0x3d93f7[_0x9bf3('0x17')]?_0x3d93f7[_0x9bf3('0x17')][_0x9bf3('0x1a')]||null:null,'limit':_0x3d93f7[_0x9bf3('0x17')]?_0x3d93f7[_0x9bf3('0x17')]['limit']||null:null,'include':_0x3d93f7[_0x9bf3('0x17')]?_0x3d93f7[_0x9bf3('0x17')][_0x9bf3('0x1b')]?_['map'](_0x3d93f7[_0x9bf3('0x17')][_0x9bf3('0x1b')],function(_0x47a4e0){return{'model':db[_0x47a4e0[_0x9bf3('0x1c')]],'as':_0x47a4e0['as'],'attributes':_0x47a4e0[_0x9bf3('0x1a')],'include':_0x47a4e0[_0x9bf3('0x1b')]?_[_0x9bf3('0x1d')](_0x47a4e0[_0x9bf3('0x1b')],function(_0x2fd68a){return{'model':db[_0x2fd68a[_0x9bf3('0x1c')]],'as':_0x2fd68a['as'],'attributes':_0x2fd68a[_0x9bf3('0x1a')],'include':_0x2fd68a[_0x9bf3('0x1b')]?_[_0x9bf3('0x1d')](_0x2fd68a['include'],function(_0x50dcc7){return{'model':db[_0x50dcc7[_0x9bf3('0x1c')]],'as':_0x50dcc7['as'],'attributes':_0x50dcc7[_0x9bf3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9bf3('0xc')](function(_0x2ad48b){logger[_0x9bf3('0xd')](_0x9bf3('0x15'),_0x3d93f7);logger[_0x9bf3('0xf')](_0x9bf3('0x15'),_0x3d93f7,JSON[_0x9bf3('0x10')](_0x2ad48b));_0x471c6b(_0x2ad48b);})['catch'](function(_0x3645b8){logger[_0x9bf3('0x11')](_0x9bf3('0x15'),_0x3645b8[_0x9bf3('0x12')],_0x3d93f7);_0x1b5df1(_0x13ba55[_0x9bf3('0x11')](0x1f4,_0x3645b8[_0x9bf3('0x12')]));});});};exports[_0x9bf3('0x1e')]=function(_0xb2082b){var _0x38c31b=this;return new Promise(function(_0x31caf7,_0x4f2872){return db[_0x9bf3('0x1f')][_0x9bf3('0x20')]({'raw':_0xb2082b[_0x9bf3('0x17')]?_0xb2082b[_0x9bf3('0x17')][_0x9bf3('0x18')]===undefined?!![]:![]:!![],'where':_0xb2082b[_0x9bf3('0x17')]?_0xb2082b[_0x9bf3('0x17')][_0x9bf3('0x19')]||null:null,'attributes':_0xb2082b[_0x9bf3('0x17')]?_0xb2082b['options']['attributes']||null:null,'include':_0xb2082b[_0x9bf3('0x17')]?_0xb2082b['options'][_0x9bf3('0x1b')]?_['map'](_0xb2082b['options'][_0x9bf3('0x1b')],function(_0x55f61d){return{'model':db[_0x55f61d[_0x9bf3('0x1c')]],'as':_0x55f61d['as'],'attributes':_0x55f61d[_0x9bf3('0x1a')],'include':_0x55f61d[_0x9bf3('0x1b')]?_[_0x9bf3('0x1d')](_0x55f61d[_0x9bf3('0x1b')],function(_0x5990b6){return{'model':db[_0x5990b6[_0x9bf3('0x1c')]],'as':_0x5990b6['as'],'attributes':_0x5990b6['attributes'],'include':_0x5990b6['include']?_[_0x9bf3('0x1d')](_0x5990b6[_0x9bf3('0x1b')],function(_0x3351c1){return{'model':db[_0x3351c1[_0x9bf3('0x1c')]],'as':_0x3351c1['as'],'attributes':_0x3351c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bf3('0xc')](function(_0x44eaae){logger['info'](_0x9bf3('0x1e'),_0xb2082b);logger['debug']('ShowDeskAccount',_0xb2082b,JSON[_0x9bf3('0x10')](_0x44eaae));_0x31caf7(_0x44eaae);})[_0x9bf3('0x21')](function(_0xea939a){logger['error'](_0x9bf3('0x1e'),_0xea939a['message'],_0xb2082b);_0x4f2872(_0x38c31b[_0x9bf3('0x11')](0x1f4,_0xea939a[_0x9bf3('0x12')]));});});}; \ No newline at end of file +var _0xb9ac=['code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','then','ShowDeskAccount','find','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xb9ac,0xd6));var _0xcb9a=function(_0x472ac3,_0x7974cd){_0x472ac3=_0x472ac3-0x0;var _0x2a3c9c=_0xb9ac[_0x472ac3];return _0x2a3c9c;};'use strict';var _=require(_0xcb9a('0x0'));var util=require(_0xcb9a('0x1'));var moment=require(_0xcb9a('0x2'));var BPromise=require(_0xcb9a('0x3'));var rs=require(_0xcb9a('0x4'));var fs=require('fs');var Redis=require(_0xcb9a('0x5'));var db=require(_0xcb9a('0x6'))['db'];var utils=require(_0xcb9a('0x7'));var logger=require('../../config/logger')(_0xcb9a('0x8'));var config=require(_0xcb9a('0x9'));var jayson=require(_0xcb9a('0xa'));var client=jayson[_0xcb9a('0xb')][_0xcb9a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ff0f4,_0x30d1a5,_0xe8458a){return new BPromise(function(_0x5d1e2d,_0x29b4f9){return client[_0xcb9a('0xd')](_0x1ff0f4,_0xe8458a)['then'](function(_0x3011ab){logger[_0xcb9a('0xe')](_0xcb9a('0xf'),_0x30d1a5,'request\x20sent');logger[_0xcb9a('0x10')](_0xcb9a('0x11'),_0x30d1a5,_0xcb9a('0x12'),JSON['stringify'](_0x3011ab));if(_0x3011ab['error']){if(_0x3011ab[_0xcb9a('0x13')][_0xcb9a('0x14')]===0x1f4){logger[_0xcb9a('0x13')](_0xcb9a('0xf'),_0x30d1a5,_0x3011ab[_0xcb9a('0x13')]['message']);return _0x29b4f9(_0x3011ab[_0xcb9a('0x13')][_0xcb9a('0x15')]);}logger[_0xcb9a('0x13')](_0xcb9a('0xf'),_0x30d1a5,_0x3011ab[_0xcb9a('0x13')][_0xcb9a('0x15')]);return _0x5d1e2d(_0x3011ab[_0xcb9a('0x13')][_0xcb9a('0x15')]);}else{logger[_0xcb9a('0xe')](_0xcb9a('0xf'),_0x30d1a5,'request\x20sent');_0x5d1e2d(_0x3011ab[_0xcb9a('0x16')][_0xcb9a('0x15')]);}})[_0xcb9a('0x17')](function(_0x2dc8d1){logger[_0xcb9a('0x13')](_0xcb9a('0xf'),_0x30d1a5,_0x2dc8d1);_0x29b4f9(_0x2dc8d1);});});}exports[_0xcb9a('0x18')]=function(_0x36cf32){var _0x107338=this;return new Promise(function(_0x44cdc1,_0x4462ca){return db[_0xcb9a('0x19')][_0xcb9a('0x1a')]({'raw':_0x36cf32['options']?_0x36cf32['options']['raw']===undefined?!![]:![]:!![],'where':_0x36cf32[_0xcb9a('0x1b')]?_0x36cf32[_0xcb9a('0x1b')][_0xcb9a('0x1c')]||null:null,'attributes':_0x36cf32[_0xcb9a('0x1b')]?_0x36cf32[_0xcb9a('0x1b')][_0xcb9a('0x1d')]||null:null,'limit':_0x36cf32[_0xcb9a('0x1b')]?_0x36cf32[_0xcb9a('0x1b')][_0xcb9a('0x1e')]||null:null,'include':_0x36cf32[_0xcb9a('0x1b')]?_0x36cf32[_0xcb9a('0x1b')][_0xcb9a('0x1f')]?_[_0xcb9a('0x20')](_0x36cf32[_0xcb9a('0x1b')][_0xcb9a('0x1f')],function(_0x3deb6a){return{'model':db[_0x3deb6a['model']],'as':_0x3deb6a['as'],'attributes':_0x3deb6a[_0xcb9a('0x1d')],'include':_0x3deb6a[_0xcb9a('0x1f')]?_['map'](_0x3deb6a[_0xcb9a('0x1f')],function(_0x35ef56){return{'model':db[_0x35ef56[_0xcb9a('0x21')]],'as':_0x35ef56['as'],'attributes':_0x35ef56[_0xcb9a('0x1d')],'include':_0x35ef56[_0xcb9a('0x1f')]?_[_0xcb9a('0x20')](_0x35ef56[_0xcb9a('0x1f')],function(_0x47e982){return{'model':db[_0x47e982[_0xcb9a('0x21')]],'as':_0x47e982['as'],'attributes':_0x47e982['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb9a('0x22')](function(_0xa8dbb9){logger[_0xcb9a('0xe')]('GetDeskAccount',_0x36cf32);logger['debug'](_0xcb9a('0x18'),_0x36cf32,JSON['stringify'](_0xa8dbb9));_0x44cdc1(_0xa8dbb9);})[_0xcb9a('0x17')](function(_0x345a8f){logger[_0xcb9a('0x13')](_0xcb9a('0x18'),_0x345a8f['message'],_0x36cf32);_0x4462ca(_0x107338[_0xcb9a('0x13')](0x1f4,_0x345a8f[_0xcb9a('0x15')]));});});};exports[_0xcb9a('0x23')]=function(_0xf0599f){var _0x678295=this;return new Promise(function(_0x349867,_0x348fdf){return db[_0xcb9a('0x19')][_0xcb9a('0x24')]({'raw':_0xf0599f['options']?_0xf0599f[_0xcb9a('0x1b')][_0xcb9a('0x25')]===undefined?!![]:![]:!![],'where':_0xf0599f[_0xcb9a('0x1b')]?_0xf0599f[_0xcb9a('0x1b')][_0xcb9a('0x1c')]||null:null,'attributes':_0xf0599f[_0xcb9a('0x1b')]?_0xf0599f[_0xcb9a('0x1b')][_0xcb9a('0x1d')]||null:null,'include':_0xf0599f['options']?_0xf0599f['options'][_0xcb9a('0x1f')]?_[_0xcb9a('0x20')](_0xf0599f['options'][_0xcb9a('0x1f')],function(_0xaaecc4){return{'model':db[_0xaaecc4[_0xcb9a('0x21')]],'as':_0xaaecc4['as'],'attributes':_0xaaecc4[_0xcb9a('0x1d')],'include':_0xaaecc4[_0xcb9a('0x1f')]?_['map'](_0xaaecc4[_0xcb9a('0x1f')],function(_0x4b43ee){return{'model':db[_0x4b43ee['model']],'as':_0x4b43ee['as'],'attributes':_0x4b43ee[_0xcb9a('0x1d')],'include':_0x4b43ee[_0xcb9a('0x1f')]?_[_0xcb9a('0x20')](_0x4b43ee[_0xcb9a('0x1f')],function(_0x555f9d){return{'model':db[_0x555f9d[_0xcb9a('0x21')]],'as':_0x555f9d['as'],'attributes':_0x555f9d[_0xcb9a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcb9a('0x22')](function(_0x22cf14){logger['info'](_0xcb9a('0x23'),_0xf0599f);logger['debug']('ShowDeskAccount',_0xf0599f,JSON[_0xcb9a('0x26')](_0x22cf14));_0x349867(_0x22cf14);})[_0xcb9a('0x17')](function(_0x11eb5c){logger[_0xcb9a('0x13')](_0xcb9a('0x23'),_0x11eb5c[_0xcb9a('0x15')],_0xf0599f);_0x348fdf(_0x678295['error'](0x1f4,_0x11eb5c[_0xcb9a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index e82e3ad..e1cad3b 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x348c08,_0x1b7523){var _0x2b01d5=function(_0x179c2e){while(--_0x179c2e){_0x348c08['push'](_0x348c08['shift']());}};_0x2b01d5(++_0x1b7523);}(_0x34e8,0x12c));var _0x834e=function(_0x2ec069,_0x486765){_0x2ec069=_0x2ec069-0x0;var _0x475d74=_0x34e8[_0x2ec069];return _0x475d74;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x25f0d1,_0x4d42fc){var _0x2d78f1=function(_0x5e59ac){while(--_0x5e59ac){_0x25f0d1['push'](_0x25f0d1['shift']());}};_0x2d78f1(++_0x4d42fc);}(_0xedd9,0xfc));var _0x9edd=function(_0x6bb32a,_0x5151c0){_0x6bb32a=_0x6bb32a-0x0;var _0x1756ba=_0xedd9[_0x6bb32a];return _0x1756ba;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f937901..7620622 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 _0x094e=['sequelize','STRING'];(function(_0x47e0b7,_0x2c9138){var _0x2ff8d8=function(_0x4f1de3){while(--_0x4f1de3){_0x47e0b7['push'](_0x47e0b7['shift']());}};_0x2ff8d8(++_0x2c9138);}(_0x094e,0x164));var _0xe094=function(_0x28dc18,_0xb6f730){_0x28dc18=_0x28dc18-0x0;var _0x160917=_0x094e[_0x28dc18];return _0x160917;};'use strict';var Sequelize=require(_0xe094('0x0'));module['exports']={'name':{'type':Sequelize[_0xe094('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2d2=['sequelize','STRING'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0xb2d2,0x1e0));var _0x2b2d=function(_0x13907f,_0x231f60){_0x13907f=_0x13907f-0x0;var _0x4f1454=_0xb2d2[_0x13907f];return _0x4f1454;};'use strict';var Sequelize=require(_0x2b2d('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b2d('0x1')]},'description':{'type':Sequelize[_0x2b2d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c36c69b..4b18b5f 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 _0x203f=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','DeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','params','length','include','options','find','create','update','body','getFields','DeskField','pick','getSubjects','order','hasOwnProperty','getDescriptions','findOne','getTags','setTags','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x58cce1,_0x73eef2){var _0xa12b3a=function(_0x506b9c){while(--_0x506b9c){_0x58cce1['push'](_0x58cce1['shift']());}};_0xa12b3a(++_0x73eef2);}(_0x203f,0x92));var _0xf203=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x203f[_0x2932cf];return _0x1711dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf203('0x0'));var jsonpatch=require(_0xf203('0x1'));var rp=require(_0xf203('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf203('0x3'));var util=require('util');var path=require(_0xf203('0x4'));var sox=require(_0xf203('0x5'));var csv=require(_0xf203('0x6'));var ejs=require(_0xf203('0x7'));var fs=require('fs');var fs_extra=require(_0xf203('0x8'));var _=require('lodash');var squel=require(_0xf203('0x9'));var crypto=require('crypto');var jsforce=require(_0xf203('0xa'));var deskjs=require(_0xf203('0xb'));var toCsv=require(_0xf203('0x6'));var querystring=require(_0xf203('0xc'));var Papa=require('papaparse');var Redis=require(_0xf203('0xd'));var authService=require(_0xf203('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf203('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf203('0x10'));var utils=require(_0xf203('0x11'));var config=require(_0xf203('0x12'));var licenseUtil=require(_0xf203('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ceee5,_0x337174){_0x337174=_0x337174||0xcc;return function(_0x4b4fa8){if(_0x4b4fa8){return _0x5ceee5[_0xf203('0x14')](_0x337174);}return _0x5ceee5[_0xf203('0x15')](_0x337174)[_0xf203('0x16')]();};}function respondWithResult(_0x5ce4c0,_0x24e5b0){_0x24e5b0=_0x24e5b0||0xc8;return function(_0x47bcb9){if(_0x47bcb9){return _0x5ce4c0[_0xf203('0x15')](_0x24e5b0)[_0xf203('0x17')](_0x47bcb9);}};}function respondWithFilteredResult(_0x11e400,_0x1f08d8){return function(_0x59b438){if(_0x59b438){var _0x3d0ffb=typeof _0x1f08d8['offset']===_0xf203('0x18')&&typeof _0x1f08d8[_0xf203('0x19')]===_0xf203('0x18');var _0x5a055e=_0x59b438[_0xf203('0x1a')];var _0x5ae813=_0x3d0ffb?0x0:_0x1f08d8[_0xf203('0x1b')];var _0x20d623=_0x3d0ffb?_0x59b438[_0xf203('0x1a')]:_0x1f08d8[_0xf203('0x1b')]+_0x1f08d8['limit'];var _0x1633a4;if(_0x20d623>=_0x5a055e){_0x20d623=_0x5a055e;_0x1633a4=0xc8;}else{_0x1633a4=0xce;}_0x11e400[_0xf203('0x15')](_0x1633a4);return _0x11e400[_0xf203('0x1c')](_0xf203('0x1d'),_0x5ae813+'-'+_0x20d623+'/'+_0x5a055e)[_0xf203('0x17')](_0x59b438);}return null;};}function patchUpdates(_0x455f93){return function(_0x128e6e){try{jsonpatch[_0xf203('0x1e')](_0x128e6e,_0x455f93,!![]);}catch(_0x48fdb){return BPromise['reject'](_0x48fdb);}return _0x128e6e[_0xf203('0x1f')]();};}function saveUpdates(_0x2cb3d3,_0x2ead97){return function(_0x481d12){if(_0x481d12){return _0x481d12['update'](_0x2cb3d3)['then'](function(_0x41524a){return _0x41524a;});}return null;};}function removeEntity(_0x70d057,_0x4a1902){return function(_0x5c6039){if(_0x5c6039){return _0x5c6039[_0xf203('0x20')]()[_0xf203('0x21')](function(){_0x70d057['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35af68,_0x85a06c){return function(_0x3ab771){if(!_0x3ab771){_0x35af68['sendStatus'](0x194);}return _0x3ab771;};}function handleError(_0xdc4af8,_0x455735){_0x455735=_0x455735||0x1f4;return function(_0x1db230){logger[_0xf203('0x22')](_0x1db230[_0xf203('0x23')]);if(_0x1db230[_0xf203('0x24')]){delete _0x1db230[_0xf203('0x24')];}_0xdc4af8[_0xf203('0x15')](_0x455735)[_0xf203('0x25')](_0x1db230);};}exports[_0xf203('0x26')]=function(_0x44cf08,_0x5d9e7f){var _0x24d0c1={},_0x579b29={},_0x21e4c4={'count':0x0,'rows':[]};var _0x39e057=_['map'](db[_0xf203('0x27')][_0xf203('0x28')],function(_0x5587e9){return{'name':_0x5587e9['fieldName'],'type':_0x5587e9[_0xf203('0x29')][_0xf203('0x2a')]};});_0x579b29[_0xf203('0x2b')]=_[_0xf203('0x2c')](_0x39e057,'name');_0x579b29[_0xf203('0x2d')]=_[_0xf203('0x2e')](_0x44cf08[_0xf203('0x2d')]);_0x579b29[_0xf203('0x2f')]=_['intersection'](_0x579b29['model'],_0x579b29[_0xf203('0x2d')]);_0x24d0c1['attributes']=_[_0xf203('0x30')](_0x579b29['model'],qs[_0xf203('0x31')](_0x44cf08[_0xf203('0x2d')][_0xf203('0x31')]));_0x24d0c1['attributes']=_0x24d0c1[_0xf203('0x32')]['length']?_0x24d0c1[_0xf203('0x32')]:_0x579b29[_0xf203('0x2b')];if(!_0x44cf08['query']['hasOwnProperty'](_0xf203('0x33'))){_0x24d0c1[_0xf203('0x19')]=qs[_0xf203('0x19')](_0x44cf08['query'][_0xf203('0x19')]);_0x24d0c1['offset']=qs[_0xf203('0x1b')](_0x44cf08[_0xf203('0x2d')][_0xf203('0x1b')]);}_0x24d0c1['order']=qs[_0xf203('0x34')](_0x44cf08[_0xf203('0x2d')][_0xf203('0x34')]);_0x24d0c1[_0xf203('0x35')]=qs['filters'](_['pick'](_0x44cf08[_0xf203('0x2d')],_0x579b29[_0xf203('0x2f')]),_0x39e057);if(_0x44cf08[_0xf203('0x2d')][_0xf203('0x36')]){_0x24d0c1['where']=_[_0xf203('0x37')](_0x24d0c1[_0xf203('0x35')],{'$or':_['map'](_0x39e057,function(_0x4c0580){if(_0x4c0580['type']!==_0xf203('0x38')){var _0x12ba1e={};_0x12ba1e[_0x4c0580[_0xf203('0x24')]]={'$like':'%'+_0x44cf08[_0xf203('0x2d')][_0xf203('0x36')]+'%'};return _0x12ba1e;}})});}_0x24d0c1=_['merge']({},_0x24d0c1,_0x44cf08['options']);var _0x3a41c1={'where':_0x24d0c1[_0xf203('0x35')]};return db[_0xf203('0x27')][_0xf203('0x1a')](_0x3a41c1)[_0xf203('0x21')](function(_0x111b82){_0x21e4c4[_0xf203('0x1a')]=_0x111b82;if(_0x44cf08[_0xf203('0x2d')][_0xf203('0x39')]){_0x24d0c1['include']=[{'all':!![]}];}return db[_0xf203('0x27')]['findAll'](_0x24d0c1);})['then'](function(_0x60d099){_0x21e4c4[_0xf203('0x3a')]=_0x60d099;return _0x21e4c4;})[_0xf203('0x21')](respondWithFilteredResult(_0x5d9e7f,_0x24d0c1))[_0xf203('0x3b')](handleError(_0x5d9e7f,null));};exports['show']=function(_0x41e5c4,_0x5bd888){var _0x3025d8={'raw':![],'where':{'id':_0x41e5c4[_0xf203('0x3c')]['id']}},_0x335eb3={};_0x335eb3[_0xf203('0x2b')]=_[_0xf203('0x2e')](db[_0xf203('0x27')]['rawAttributes']);_0x335eb3['query']=_[_0xf203('0x2e')](_0x41e5c4[_0xf203('0x2d')]);_0x335eb3['filters']=_[_0xf203('0x30')](_0x335eb3[_0xf203('0x2b')],_0x335eb3['query']);_0x3025d8[_0xf203('0x32')]=_['intersection'](_0x335eb3[_0xf203('0x2b')],qs['fields'](_0x41e5c4[_0xf203('0x2d')][_0xf203('0x31')]));_0x3025d8[_0xf203('0x32')]=_0x3025d8['attributes'][_0xf203('0x3d')]?_0x3025d8[_0xf203('0x32')]:_0x335eb3[_0xf203('0x2b')];if(_0x41e5c4[_0xf203('0x2d')]['includeAll']){_0x3025d8[_0xf203('0x3e')]=[{'all':!![]}];}_0x3025d8=_[_0xf203('0x37')]({},_0x3025d8,_0x41e5c4[_0xf203('0x3f')]);return db[_0xf203('0x27')][_0xf203('0x40')](_0x3025d8)[_0xf203('0x21')](handleEntityNotFound(_0x5bd888,null))[_0xf203('0x21')](respondWithResult(_0x5bd888,null))[_0xf203('0x3b')](handleError(_0x5bd888,null));};exports[_0xf203('0x41')]=function(_0x1f4384,_0x46270a){return db[_0xf203('0x27')][_0xf203('0x41')](_0x1f4384['body'],{})['then'](respondWithResult(_0x46270a,0xc9))[_0xf203('0x3b')](handleError(_0x46270a,null));};exports[_0xf203('0x42')]=function(_0x4c386a,_0x671baa){if(_0x4c386a[_0xf203('0x43')]['id']){delete _0x4c386a['body']['id'];}return db[_0xf203('0x27')]['find']({'where':{'id':_0x4c386a['params']['id']}})['then'](handleEntityNotFound(_0x671baa,null))[_0xf203('0x21')](saveUpdates(_0x4c386a[_0xf203('0x43')],null))['then'](respondWithResult(_0x671baa,null))['catch'](handleError(_0x671baa,null));};exports['destroy']=function(_0x23db54,_0x58eee2){return db[_0xf203('0x27')][_0xf203('0x40')]({'where':{'id':_0x23db54['params']['id']}})[_0xf203('0x21')](handleEntityNotFound(_0x58eee2,null))[_0xf203('0x21')](removeEntity(_0x58eee2,null))[_0xf203('0x3b')](handleError(_0x58eee2,null));};exports[_0xf203('0x44')]=function(_0x3cf9a0,_0x3773e3,_0x43c095){var _0x4e7857={};var _0x3b2d3a={};var _0x7bab32;var _0x1202dd;return db[_0xf203('0x27')]['findOne']({'where':{'id':_0x3cf9a0[_0xf203('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3773e3,null))['then'](function(_0x2cbe04){if(_0x2cbe04){_0x7bab32=_0x2cbe04;_0x3b2d3a[_0xf203('0x2b')]=_[_0xf203('0x2e')](db[_0xf203('0x45')]['rawAttributes']);_0x3b2d3a['query']=_[_0xf203('0x2e')](_0x3cf9a0['query']);_0x3b2d3a['filters']=_[_0xf203('0x30')](_0x3b2d3a[_0xf203('0x2b')],_0x3b2d3a[_0xf203('0x2d')]);_0x4e7857[_0xf203('0x32')]=_[_0xf203('0x30')](_0x3b2d3a['model'],qs[_0xf203('0x31')](_0x3cf9a0['query'][_0xf203('0x31')]));_0x4e7857[_0xf203('0x32')]=_0x4e7857[_0xf203('0x32')][_0xf203('0x3d')]?_0x4e7857[_0xf203('0x32')]:_0x3b2d3a[_0xf203('0x2b')];_0x4e7857['order']=qs['sort'](_0x3cf9a0[_0xf203('0x2d')]['sort']);_0x4e7857[_0xf203('0x35')]=qs[_0xf203('0x2f')](_[_0xf203('0x46')](_0x3cf9a0[_0xf203('0x2d')],_0x3b2d3a[_0xf203('0x2f')]));if(_0x3cf9a0['query'][_0xf203('0x36')]){_0x4e7857['where']=_[_0xf203('0x37')](_0x4e7857[_0xf203('0x35')],{'$or':_[_0xf203('0x2c')](_0x4e7857['attributes'],function(_0x5a2f85){var _0x1faedb={};_0x1faedb[_0x5a2f85]={'$like':'%'+_0x3cf9a0[_0xf203('0x2d')][_0xf203('0x36')]+'%'};return _0x1faedb;})});}_0x4e7857=_[_0xf203('0x37')]({},_0x4e7857,_0x3cf9a0[_0xf203('0x3f')]);return _0x7bab32[_0xf203('0x44')](_0x4e7857);}})[_0xf203('0x21')](function(_0x4ca604){if(_0x4ca604){_0x1202dd=_0x4ca604[_0xf203('0x3d')];if(!_0x3cf9a0['query']['hasOwnProperty'](_0xf203('0x33'))){_0x4e7857[_0xf203('0x19')]=qs[_0xf203('0x19')](_0x3cf9a0[_0xf203('0x2d')]['limit']);_0x4e7857[_0xf203('0x1b')]=qs[_0xf203('0x1b')](_0x3cf9a0['query'][_0xf203('0x1b')]);}return _0x7bab32[_0xf203('0x44')](_0x4e7857);}})[_0xf203('0x21')](function(_0x1c1d3d){if(_0x1c1d3d){return _0x1c1d3d?{'count':_0x1202dd,'rows':_0x1c1d3d}:null;}})[_0xf203('0x21')](respondWithResult(_0x3773e3,null))['catch'](handleError(_0x3773e3,null));};exports[_0xf203('0x47')]=function(_0x37e153,_0x4494b9,_0x485a1a){var _0x1fec4a={};var _0x1647ec={};var _0x3edc64;var _0x16857c;return db[_0xf203('0x27')]['findOne']({'where':{'id':_0x37e153[_0xf203('0x3c')]['id']}})[_0xf203('0x21')](handleEntityNotFound(_0x4494b9,null))[_0xf203('0x21')](function(_0x463082){if(_0x463082){_0x3edc64=_0x463082;_0x1647ec[_0xf203('0x2b')]=_[_0xf203('0x2e')](db[_0xf203('0x45')][_0xf203('0x28')]);_0x1647ec[_0xf203('0x2d')]=_[_0xf203('0x2e')](_0x37e153[_0xf203('0x2d')]);_0x1647ec[_0xf203('0x2f')]=_[_0xf203('0x30')](_0x1647ec['model'],_0x1647ec['query']);_0x1fec4a[_0xf203('0x32')]=_[_0xf203('0x30')](_0x1647ec[_0xf203('0x2b')],qs[_0xf203('0x31')](_0x37e153[_0xf203('0x2d')][_0xf203('0x31')]));_0x1fec4a[_0xf203('0x32')]=_0x1fec4a[_0xf203('0x32')][_0xf203('0x3d')]?_0x1fec4a[_0xf203('0x32')]:_0x1647ec[_0xf203('0x2b')];_0x1fec4a[_0xf203('0x48')]=qs[_0xf203('0x34')](_0x37e153[_0xf203('0x2d')][_0xf203('0x34')]);_0x1fec4a['where']=qs[_0xf203('0x2f')](_['pick'](_0x37e153[_0xf203('0x2d')],_0x1647ec['filters']));if(_0x37e153[_0xf203('0x2d')][_0xf203('0x36')]){_0x1fec4a[_0xf203('0x35')]=_['merge'](_0x1fec4a[_0xf203('0x35')],{'$or':_[_0xf203('0x2c')](_0x1fec4a[_0xf203('0x32')],function(_0x3f6048){var _0xfbbd07={};_0xfbbd07[_0x3f6048]={'$like':'%'+_0x37e153[_0xf203('0x2d')][_0xf203('0x36')]+'%'};return _0xfbbd07;})});}_0x1fec4a=_['merge']({},_0x1fec4a,_0x37e153[_0xf203('0x3f')]);return _0x3edc64['getSubjects'](_0x1fec4a);}})[_0xf203('0x21')](function(_0x3b892b){if(_0x3b892b){_0x16857c=_0x3b892b[_0xf203('0x3d')];if(!_0x37e153[_0xf203('0x2d')][_0xf203('0x49')](_0xf203('0x33'))){_0x1fec4a[_0xf203('0x19')]=qs['limit'](_0x37e153['query'][_0xf203('0x19')]);_0x1fec4a['offset']=qs[_0xf203('0x1b')](_0x37e153[_0xf203('0x2d')][_0xf203('0x1b')]);}return _0x3edc64[_0xf203('0x47')](_0x1fec4a);}})['then'](function(_0x59dabd){if(_0x59dabd){return _0x59dabd?{'count':_0x16857c,'rows':_0x59dabd}:null;}})[_0xf203('0x21')](respondWithResult(_0x4494b9,null))[_0xf203('0x3b')](handleError(_0x4494b9,null));};exports[_0xf203('0x4a')]=function(_0x42e5b9,_0x556727,_0x401337){var _0x12cfac={};var _0x2cf740={};var _0x8332d2;var _0x2bc603;return db[_0xf203('0x27')][_0xf203('0x4b')]({'where':{'id':_0x42e5b9[_0xf203('0x3c')]['id']}})[_0xf203('0x21')](handleEntityNotFound(_0x556727,null))[_0xf203('0x21')](function(_0x3a4b03){if(_0x3a4b03){_0x8332d2=_0x3a4b03;_0x2cf740['model']=_[_0xf203('0x2e')](db[_0xf203('0x45')][_0xf203('0x28')]);_0x2cf740[_0xf203('0x2d')]=_[_0xf203('0x2e')](_0x42e5b9['query']);_0x2cf740['filters']=_[_0xf203('0x30')](_0x2cf740[_0xf203('0x2b')],_0x2cf740[_0xf203('0x2d')]);_0x12cfac[_0xf203('0x32')]=_['intersection'](_0x2cf740[_0xf203('0x2b')],qs['fields'](_0x42e5b9[_0xf203('0x2d')]['fields']));_0x12cfac['attributes']=_0x12cfac[_0xf203('0x32')][_0xf203('0x3d')]?_0x12cfac['attributes']:_0x2cf740[_0xf203('0x2b')];_0x12cfac[_0xf203('0x48')]=qs[_0xf203('0x34')](_0x42e5b9[_0xf203('0x2d')][_0xf203('0x34')]);_0x12cfac[_0xf203('0x35')]=qs['filters'](_['pick'](_0x42e5b9['query'],_0x2cf740[_0xf203('0x2f')]));if(_0x42e5b9[_0xf203('0x2d')][_0xf203('0x36')]){_0x12cfac['where']=_['merge'](_0x12cfac[_0xf203('0x35')],{'$or':_[_0xf203('0x2c')](_0x12cfac['attributes'],function(_0x12a3c2){var _0x328625={};_0x328625[_0x12a3c2]={'$like':'%'+_0x42e5b9['query'][_0xf203('0x36')]+'%'};return _0x328625;})});}_0x12cfac=_[_0xf203('0x37')]({},_0x12cfac,_0x42e5b9['options']);return _0x8332d2[_0xf203('0x4a')](_0x12cfac);}})[_0xf203('0x21')](function(_0x5efefb){if(_0x5efefb){_0x2bc603=_0x5efefb[_0xf203('0x3d')];if(!_0x42e5b9[_0xf203('0x2d')]['hasOwnProperty'](_0xf203('0x33'))){_0x12cfac[_0xf203('0x19')]=qs[_0xf203('0x19')](_0x42e5b9[_0xf203('0x2d')][_0xf203('0x19')]);_0x12cfac[_0xf203('0x1b')]=qs[_0xf203('0x1b')](_0x42e5b9['query']['offset']);}return _0x8332d2[_0xf203('0x4a')](_0x12cfac);}})['then'](function(_0x188481){if(_0x188481){return _0x188481?{'count':_0x2bc603,'rows':_0x188481}:null;}})['then'](respondWithResult(_0x556727,null))[_0xf203('0x3b')](handleError(_0x556727,null));};exports[_0xf203('0x4c')]=function(_0x210c5f,_0x321423,_0x1f9e4c){var _0x17f2a1={};var _0x39bf1a={};var _0x1ac792;var _0x3bb0b9;return db['DeskConfiguration'][_0xf203('0x4b')]({'where':{'id':_0x210c5f[_0xf203('0x3c')]['id']}})[_0xf203('0x21')](handleEntityNotFound(_0x321423,null))[_0xf203('0x21')](function(_0x52dd67){if(_0x52dd67){_0x1ac792=_0x52dd67;_0x39bf1a[_0xf203('0x2b')]=_[_0xf203('0x2e')](db['Tag'][_0xf203('0x28')]);_0x39bf1a[_0xf203('0x2d')]=_['keys'](_0x210c5f[_0xf203('0x2d')]);_0x39bf1a[_0xf203('0x2f')]=_['intersection'](_0x39bf1a[_0xf203('0x2b')],_0x39bf1a['query']);_0x17f2a1[_0xf203('0x32')]=_['intersection'](_0x39bf1a['model'],qs[_0xf203('0x31')](_0x210c5f[_0xf203('0x2d')][_0xf203('0x31')]));_0x17f2a1['attributes']=_0x17f2a1['attributes'][_0xf203('0x3d')]?_0x17f2a1[_0xf203('0x32')]:_0x39bf1a['model'];_0x17f2a1[_0xf203('0x48')]=qs[_0xf203('0x34')](_0x210c5f['query'][_0xf203('0x34')]);_0x17f2a1[_0xf203('0x35')]=qs['filters'](_[_0xf203('0x46')](_0x210c5f[_0xf203('0x2d')],_0x39bf1a[_0xf203('0x2f')]));if(_0x210c5f['query'][_0xf203('0x36')]){_0x17f2a1[_0xf203('0x35')]=_[_0xf203('0x37')](_0x17f2a1[_0xf203('0x35')],{'$or':_['map'](_0x17f2a1['attributes'],function(_0x18e487){var _0x20e673={};_0x20e673[_0x18e487]={'$like':'%'+_0x210c5f[_0xf203('0x2d')][_0xf203('0x36')]+'%'};return _0x20e673;})});}_0x17f2a1=_[_0xf203('0x37')]({},_0x17f2a1,_0x210c5f[_0xf203('0x3f')]);return _0x1ac792['getTags'](_0x17f2a1);}})['then'](function(_0x439a62){if(_0x439a62){_0x3bb0b9=_0x439a62[_0xf203('0x3d')];if(!_0x210c5f[_0xf203('0x2d')][_0xf203('0x49')](_0xf203('0x33'))){_0x17f2a1[_0xf203('0x19')]=qs['limit'](_0x210c5f[_0xf203('0x2d')][_0xf203('0x19')]);_0x17f2a1[_0xf203('0x1b')]=qs[_0xf203('0x1b')](_0x210c5f[_0xf203('0x2d')][_0xf203('0x1b')]);}return _0x1ac792[_0xf203('0x4c')](_0x17f2a1);}})['then'](function(_0x282408){if(_0x282408){return _0x282408?{'count':_0x3bb0b9,'rows':_0x282408}:null;}})[_0xf203('0x21')](respondWithResult(_0x321423,null))[_0xf203('0x3b')](handleError(_0x321423,null));};exports['setTags']=function(_0x21f0a5,_0x2fa2c3,_0x44738a){if(_0x21f0a5[_0xf203('0x43')]['id']){delete _0x21f0a5['body']['id'];}return db[_0xf203('0x27')][_0xf203('0x4b')]({'where':{'id':_0x21f0a5[_0xf203('0x3c')]['id']}})[_0xf203('0x21')](handleEntityNotFound(_0x2fa2c3,null))[_0xf203('0x21')](function(_0x714370){if(_0x714370){return _0x714370[_0xf203('0x4d')](_0x21f0a5[_0xf203('0x43')]['ids']||[]);}return null;})[_0xf203('0x21')](respondWithResult(_0x2fa2c3,null))[_0xf203('0x3b')](handleError(_0x2fa2c3,null));}; \ No newline at end of file +var _0x313a=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','apply','save','then','destroy','sendStatus','error','stack','name','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','update','params','getFields','findOne','DeskField','hasOwnProperty','getSubjects','nolimit','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x42e3b7,_0x4c2fc7){var _0x30ea64=function(_0x13ae5b){while(--_0x13ae5b){_0x42e3b7['push'](_0x42e3b7['shift']());}};_0x30ea64(++_0x4c2fc7);}(_0x313a,0x141));var _0xa313=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x313a[_0x3f2228];return _0x285ae4;};'use strict';var emlformat=require(_0xa313('0x0'));var rimraf=require(_0xa313('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa313('0x2'));var rp=require('request-promise');var moment=require(_0xa313('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa313('0x4'));var util=require(_0xa313('0x5'));var path=require(_0xa313('0x6'));var sox=require(_0xa313('0x7'));var csv=require(_0xa313('0x8'));var ejs=require(_0xa313('0x9'));var fs=require('fs');var fs_extra=require(_0xa313('0xa'));var _=require('lodash');var squel=require(_0xa313('0xb'));var crypto=require(_0xa313('0xc'));var jsforce=require(_0xa313('0xd'));var deskjs=require(_0xa313('0xe'));var toCsv=require(_0xa313('0x8'));var querystring=require(_0xa313('0xf'));var Papa=require(_0xa313('0x10'));var Redis=require(_0xa313('0x11'));var authService=require(_0xa313('0x12'));var qs=require(_0xa313('0x13'));var as=require(_0xa313('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa313('0x15'));var utils=require(_0xa313('0x16'));var config=require(_0xa313('0x17'));var licenseUtil=require(_0xa313('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c0e97,_0x5ba9af){_0x5ba9af=_0x5ba9af||0xcc;return function(_0x49cb5c){if(_0x49cb5c){return _0x2c0e97['sendStatus'](_0x5ba9af);}return _0x2c0e97[_0xa313('0x19')](_0x5ba9af)[_0xa313('0x1a')]();};}function respondWithResult(_0x2c8f25,_0x45c21e){_0x45c21e=_0x45c21e||0xc8;return function(_0x3d355e){if(_0x3d355e){return _0x2c8f25[_0xa313('0x19')](_0x45c21e)[_0xa313('0x1b')](_0x3d355e);}};}function respondWithFilteredResult(_0x1a01a9,_0x329f2f){return function(_0x310825){if(_0x310825){var _0x41d19a=typeof _0x329f2f['offset']===_0xa313('0x1c')&&typeof _0x329f2f['limit']==='undefined';var _0xb6fe9=_0x310825[_0xa313('0x1d')];var _0x474c65=_0x41d19a?0x0:_0x329f2f['offset'];var _0x2ec3fb=_0x41d19a?_0x310825[_0xa313('0x1d')]:_0x329f2f[_0xa313('0x1e')]+_0x329f2f[_0xa313('0x1f')];var _0x24f7d6;if(_0x2ec3fb>=_0xb6fe9){_0x2ec3fb=_0xb6fe9;_0x24f7d6=0xc8;}else{_0x24f7d6=0xce;}_0x1a01a9[_0xa313('0x19')](_0x24f7d6);return _0x1a01a9[_0xa313('0x20')]('Content-Range',_0x474c65+'-'+_0x2ec3fb+'/'+_0xb6fe9)[_0xa313('0x1b')](_0x310825);}return null;};}function patchUpdates(_0x3e0a90){return function(_0x595947){try{jsonpatch[_0xa313('0x21')](_0x595947,_0x3e0a90,!![]);}catch(_0x538ea7){return BPromise['reject'](_0x538ea7);}return _0x595947[_0xa313('0x22')]();};}function saveUpdates(_0x20b880,_0x32d648){return function(_0x326e3b){if(_0x326e3b){return _0x326e3b['update'](_0x20b880)[_0xa313('0x23')](function(_0x2f9144){return _0x2f9144;});}return null;};}function removeEntity(_0x106d88,_0x29f36d){return function(_0xcad990){if(_0xcad990){return _0xcad990[_0xa313('0x24')]()[_0xa313('0x23')](function(){_0x106d88[_0xa313('0x19')](0xcc)[_0xa313('0x1a')]();});}};}function handleEntityNotFound(_0x13a3c1,_0x423b13){return function(_0xa67c87){if(!_0xa67c87){_0x13a3c1[_0xa313('0x25')](0x194);}return _0xa67c87;};}function handleError(_0x35ed08,_0x4f01fd){_0x4f01fd=_0x4f01fd||0x1f4;return function(_0x18f39f){logger[_0xa313('0x26')](_0x18f39f[_0xa313('0x27')]);if(_0x18f39f[_0xa313('0x28')]){delete _0x18f39f[_0xa313('0x28')];}_0x35ed08[_0xa313('0x19')](_0x4f01fd)['send'](_0x18f39f);};}exports[_0xa313('0x29')]=function(_0x21b955,_0x461420){var _0xcb2d3={},_0x5843e7={},_0x4659ae={'count':0x0,'rows':[]};var _0x11717d=_[_0xa313('0x2a')](db[_0xa313('0x2b')]['rawAttributes'],function(_0x139577){return{'name':_0x139577[_0xa313('0x2c')],'type':_0x139577[_0xa313('0x2d')][_0xa313('0x2e')]};});_0x5843e7[_0xa313('0x2f')]=_['map'](_0x11717d,_0xa313('0x28'));_0x5843e7[_0xa313('0x30')]=_[_0xa313('0x31')](_0x21b955[_0xa313('0x30')]);_0x5843e7[_0xa313('0x32')]=_['intersection'](_0x5843e7[_0xa313('0x2f')],_0x5843e7[_0xa313('0x30')]);_0xcb2d3[_0xa313('0x33')]=_[_0xa313('0x34')](_0x5843e7['model'],qs[_0xa313('0x35')](_0x21b955[_0xa313('0x30')][_0xa313('0x35')]));_0xcb2d3[_0xa313('0x33')]=_0xcb2d3[_0xa313('0x33')][_0xa313('0x36')]?_0xcb2d3[_0xa313('0x33')]:_0x5843e7['model'];if(!_0x21b955['query']['hasOwnProperty']('nolimit')){_0xcb2d3['limit']=qs[_0xa313('0x1f')](_0x21b955[_0xa313('0x30')][_0xa313('0x1f')]);_0xcb2d3[_0xa313('0x1e')]=qs[_0xa313('0x1e')](_0x21b955[_0xa313('0x30')][_0xa313('0x1e')]);}_0xcb2d3[_0xa313('0x37')]=qs[_0xa313('0x38')](_0x21b955[_0xa313('0x30')][_0xa313('0x38')]);_0xcb2d3['where']=qs[_0xa313('0x32')](_[_0xa313('0x39')](_0x21b955[_0xa313('0x30')],_0x5843e7[_0xa313('0x32')]),_0x11717d);if(_0x21b955[_0xa313('0x30')][_0xa313('0x3a')]){_0xcb2d3[_0xa313('0x3b')]=_['merge'](_0xcb2d3['where'],{'$or':_[_0xa313('0x2a')](_0x11717d,function(_0x12353f){if(_0x12353f[_0xa313('0x2d')]!==_0xa313('0x3c')){var _0x4a9674={};_0x4a9674[_0x12353f[_0xa313('0x28')]]={'$like':'%'+_0x21b955[_0xa313('0x30')][_0xa313('0x3a')]+'%'};return _0x4a9674;}})});}_0xcb2d3=_[_0xa313('0x3d')]({},_0xcb2d3,_0x21b955[_0xa313('0x3e')]);var _0x4993fa={'where':_0xcb2d3[_0xa313('0x3b')]};return db[_0xa313('0x2b')]['count'](_0x4993fa)[_0xa313('0x23')](function(_0x8c9935){_0x4659ae[_0xa313('0x1d')]=_0x8c9935;if(_0x21b955[_0xa313('0x30')][_0xa313('0x3f')]){_0xcb2d3['include']=[{'all':!![]}];}return db[_0xa313('0x2b')][_0xa313('0x40')](_0xcb2d3);})[_0xa313('0x23')](function(_0x3b6ce2){_0x4659ae[_0xa313('0x41')]=_0x3b6ce2;return _0x4659ae;})[_0xa313('0x23')](respondWithFilteredResult(_0x461420,_0xcb2d3))[_0xa313('0x42')](handleError(_0x461420,null));};exports[_0xa313('0x43')]=function(_0x39661c,_0x9ad08f){var _0x2de2c8={'raw':![],'where':{'id':_0x39661c['params']['id']}},_0x3eb06c={};_0x3eb06c[_0xa313('0x2f')]=_[_0xa313('0x31')](db[_0xa313('0x2b')][_0xa313('0x44')]);_0x3eb06c[_0xa313('0x30')]=_[_0xa313('0x31')](_0x39661c[_0xa313('0x30')]);_0x3eb06c[_0xa313('0x32')]=_['intersection'](_0x3eb06c['model'],_0x3eb06c['query']);_0x2de2c8[_0xa313('0x33')]=_[_0xa313('0x34')](_0x3eb06c[_0xa313('0x2f')],qs[_0xa313('0x35')](_0x39661c['query'][_0xa313('0x35')]));_0x2de2c8[_0xa313('0x33')]=_0x2de2c8['attributes'][_0xa313('0x36')]?_0x2de2c8[_0xa313('0x33')]:_0x3eb06c['model'];if(_0x39661c[_0xa313('0x30')][_0xa313('0x3f')]){_0x2de2c8[_0xa313('0x45')]=[{'all':!![]}];}_0x2de2c8=_[_0xa313('0x3d')]({},_0x2de2c8,_0x39661c['options']);return db[_0xa313('0x2b')][_0xa313('0x46')](_0x2de2c8)['then'](handleEntityNotFound(_0x9ad08f,null))[_0xa313('0x23')](respondWithResult(_0x9ad08f,null))['catch'](handleError(_0x9ad08f,null));};exports[_0xa313('0x47')]=function(_0x2285a5,_0x20b827){return db[_0xa313('0x2b')][_0xa313('0x47')](_0x2285a5[_0xa313('0x48')],{})[_0xa313('0x23')](respondWithResult(_0x20b827,0xc9))[_0xa313('0x42')](handleError(_0x20b827,null));};exports[_0xa313('0x49')]=function(_0x1c1b84,_0x1ee8a1){if(_0x1c1b84[_0xa313('0x48')]['id']){delete _0x1c1b84[_0xa313('0x48')]['id'];}return db[_0xa313('0x2b')]['find']({'where':{'id':_0x1c1b84[_0xa313('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ee8a1,null))[_0xa313('0x23')](saveUpdates(_0x1c1b84[_0xa313('0x48')],null))[_0xa313('0x23')](respondWithResult(_0x1ee8a1,null))[_0xa313('0x42')](handleError(_0x1ee8a1,null));};exports[_0xa313('0x24')]=function(_0x59c3f2,_0x2800e8){return db[_0xa313('0x2b')][_0xa313('0x46')]({'where':{'id':_0x59c3f2[_0xa313('0x4a')]['id']}})[_0xa313('0x23')](handleEntityNotFound(_0x2800e8,null))['then'](removeEntity(_0x2800e8,null))[_0xa313('0x42')](handleError(_0x2800e8,null));};exports[_0xa313('0x4b')]=function(_0x1474bc,_0x40dcfe,_0x4a3446){var _0x3fa23f={};var _0x4c5dea={};var _0xc6dee9;var _0x22ad2d;return db[_0xa313('0x2b')][_0xa313('0x4c')]({'where':{'id':_0x1474bc[_0xa313('0x4a')]['id']}})[_0xa313('0x23')](handleEntityNotFound(_0x40dcfe,null))[_0xa313('0x23')](function(_0x7f29d1){if(_0x7f29d1){_0xc6dee9=_0x7f29d1;_0x4c5dea[_0xa313('0x2f')]=_['keys'](db[_0xa313('0x4d')][_0xa313('0x44')]);_0x4c5dea[_0xa313('0x30')]=_[_0xa313('0x31')](_0x1474bc[_0xa313('0x30')]);_0x4c5dea[_0xa313('0x32')]=_['intersection'](_0x4c5dea[_0xa313('0x2f')],_0x4c5dea['query']);_0x3fa23f[_0xa313('0x33')]=_[_0xa313('0x34')](_0x4c5dea[_0xa313('0x2f')],qs['fields'](_0x1474bc[_0xa313('0x30')]['fields']));_0x3fa23f[_0xa313('0x33')]=_0x3fa23f[_0xa313('0x33')]['length']?_0x3fa23f[_0xa313('0x33')]:_0x4c5dea[_0xa313('0x2f')];_0x3fa23f[_0xa313('0x37')]=qs['sort'](_0x1474bc[_0xa313('0x30')][_0xa313('0x38')]);_0x3fa23f[_0xa313('0x3b')]=qs[_0xa313('0x32')](_[_0xa313('0x39')](_0x1474bc[_0xa313('0x30')],_0x4c5dea[_0xa313('0x32')]));if(_0x1474bc[_0xa313('0x30')][_0xa313('0x3a')]){_0x3fa23f['where']=_[_0xa313('0x3d')](_0x3fa23f[_0xa313('0x3b')],{'$or':_['map'](_0x3fa23f['attributes'],function(_0x1b5804){var _0x5c5d14={};_0x5c5d14[_0x1b5804]={'$like':'%'+_0x1474bc[_0xa313('0x30')][_0xa313('0x3a')]+'%'};return _0x5c5d14;})});}_0x3fa23f=_[_0xa313('0x3d')]({},_0x3fa23f,_0x1474bc['options']);return _0xc6dee9[_0xa313('0x4b')](_0x3fa23f);}})['then'](function(_0x1fd1bb){if(_0x1fd1bb){_0x22ad2d=_0x1fd1bb[_0xa313('0x36')];if(!_0x1474bc[_0xa313('0x30')][_0xa313('0x4e')]('nolimit')){_0x3fa23f[_0xa313('0x1f')]=qs[_0xa313('0x1f')](_0x1474bc['query'][_0xa313('0x1f')]);_0x3fa23f['offset']=qs[_0xa313('0x1e')](_0x1474bc[_0xa313('0x30')][_0xa313('0x1e')]);}return _0xc6dee9['getFields'](_0x3fa23f);}})[_0xa313('0x23')](function(_0xf7e548){if(_0xf7e548){return _0xf7e548?{'count':_0x22ad2d,'rows':_0xf7e548}:null;}})[_0xa313('0x23')](respondWithResult(_0x40dcfe,null))['catch'](handleError(_0x40dcfe,null));};exports[_0xa313('0x4f')]=function(_0x29fa60,_0x2007f7,_0x4f6ffd){var _0x465b0b={};var _0x2c1a3={};var _0x1f522a;var _0x379371;return db[_0xa313('0x2b')][_0xa313('0x4c')]({'where':{'id':_0x29fa60['params']['id']}})['then'](handleEntityNotFound(_0x2007f7,null))['then'](function(_0x5a2ffb){if(_0x5a2ffb){_0x1f522a=_0x5a2ffb;_0x2c1a3[_0xa313('0x2f')]=_[_0xa313('0x31')](db['DeskField'][_0xa313('0x44')]);_0x2c1a3[_0xa313('0x30')]=_[_0xa313('0x31')](_0x29fa60[_0xa313('0x30')]);_0x2c1a3[_0xa313('0x32')]=_['intersection'](_0x2c1a3[_0xa313('0x2f')],_0x2c1a3[_0xa313('0x30')]);_0x465b0b[_0xa313('0x33')]=_[_0xa313('0x34')](_0x2c1a3[_0xa313('0x2f')],qs[_0xa313('0x35')](_0x29fa60[_0xa313('0x30')][_0xa313('0x35')]));_0x465b0b[_0xa313('0x33')]=_0x465b0b[_0xa313('0x33')][_0xa313('0x36')]?_0x465b0b[_0xa313('0x33')]:_0x2c1a3[_0xa313('0x2f')];_0x465b0b['order']=qs[_0xa313('0x38')](_0x29fa60['query']['sort']);_0x465b0b['where']=qs[_0xa313('0x32')](_[_0xa313('0x39')](_0x29fa60[_0xa313('0x30')],_0x2c1a3[_0xa313('0x32')]));if(_0x29fa60[_0xa313('0x30')][_0xa313('0x3a')]){_0x465b0b['where']=_[_0xa313('0x3d')](_0x465b0b[_0xa313('0x3b')],{'$or':_[_0xa313('0x2a')](_0x465b0b[_0xa313('0x33')],function(_0x8ba51){var _0x1b6373={};_0x1b6373[_0x8ba51]={'$like':'%'+_0x29fa60['query'][_0xa313('0x3a')]+'%'};return _0x1b6373;})});}_0x465b0b=_[_0xa313('0x3d')]({},_0x465b0b,_0x29fa60[_0xa313('0x3e')]);return _0x1f522a['getSubjects'](_0x465b0b);}})[_0xa313('0x23')](function(_0x52403e){if(_0x52403e){_0x379371=_0x52403e[_0xa313('0x36')];if(!_0x29fa60[_0xa313('0x30')][_0xa313('0x4e')](_0xa313('0x50'))){_0x465b0b['limit']=qs[_0xa313('0x1f')](_0x29fa60[_0xa313('0x30')][_0xa313('0x1f')]);_0x465b0b['offset']=qs[_0xa313('0x1e')](_0x29fa60[_0xa313('0x30')][_0xa313('0x1e')]);}return _0x1f522a[_0xa313('0x4f')](_0x465b0b);}})['then'](function(_0x3782df){if(_0x3782df){return _0x3782df?{'count':_0x379371,'rows':_0x3782df}:null;}})[_0xa313('0x23')](respondWithResult(_0x2007f7,null))[_0xa313('0x42')](handleError(_0x2007f7,null));};exports['getDescriptions']=function(_0x2cd737,_0x29f4af,_0x2b1c93){var _0x4e1533={};var _0x367b7b={};var _0x2d8147;var _0x585d92;return db[_0xa313('0x2b')][_0xa313('0x4c')]({'where':{'id':_0x2cd737['params']['id']}})[_0xa313('0x23')](handleEntityNotFound(_0x29f4af,null))[_0xa313('0x23')](function(_0x3c231f){if(_0x3c231f){_0x2d8147=_0x3c231f;_0x367b7b[_0xa313('0x2f')]=_[_0xa313('0x31')](db[_0xa313('0x4d')]['rawAttributes']);_0x367b7b['query']=_['keys'](_0x2cd737['query']);_0x367b7b['filters']=_[_0xa313('0x34')](_0x367b7b[_0xa313('0x2f')],_0x367b7b[_0xa313('0x30')]);_0x4e1533['attributes']=_[_0xa313('0x34')](_0x367b7b[_0xa313('0x2f')],qs[_0xa313('0x35')](_0x2cd737[_0xa313('0x30')][_0xa313('0x35')]));_0x4e1533['attributes']=_0x4e1533[_0xa313('0x33')][_0xa313('0x36')]?_0x4e1533[_0xa313('0x33')]:_0x367b7b[_0xa313('0x2f')];_0x4e1533[_0xa313('0x37')]=qs['sort'](_0x2cd737[_0xa313('0x30')][_0xa313('0x38')]);_0x4e1533[_0xa313('0x3b')]=qs[_0xa313('0x32')](_[_0xa313('0x39')](_0x2cd737[_0xa313('0x30')],_0x367b7b[_0xa313('0x32')]));if(_0x2cd737[_0xa313('0x30')]['filter']){_0x4e1533[_0xa313('0x3b')]=_[_0xa313('0x3d')](_0x4e1533[_0xa313('0x3b')],{'$or':_[_0xa313('0x2a')](_0x4e1533['attributes'],function(_0x5a7d76){var _0x3314c5={};_0x3314c5[_0x5a7d76]={'$like':'%'+_0x2cd737['query']['filter']+'%'};return _0x3314c5;})});}_0x4e1533=_['merge']({},_0x4e1533,_0x2cd737[_0xa313('0x3e')]);return _0x2d8147[_0xa313('0x51')](_0x4e1533);}})['then'](function(_0x45dfec){if(_0x45dfec){_0x585d92=_0x45dfec[_0xa313('0x36')];if(!_0x2cd737['query'][_0xa313('0x4e')](_0xa313('0x50'))){_0x4e1533[_0xa313('0x1f')]=qs['limit'](_0x2cd737[_0xa313('0x30')][_0xa313('0x1f')]);_0x4e1533[_0xa313('0x1e')]=qs[_0xa313('0x1e')](_0x2cd737['query'][_0xa313('0x1e')]);}return _0x2d8147[_0xa313('0x51')](_0x4e1533);}})[_0xa313('0x23')](function(_0x4f71c5){if(_0x4f71c5){return _0x4f71c5?{'count':_0x585d92,'rows':_0x4f71c5}:null;}})[_0xa313('0x23')](respondWithResult(_0x29f4af,null))[_0xa313('0x42')](handleError(_0x29f4af,null));};exports['getTags']=function(_0xf70525,_0x11855b,_0xed20dc){var _0x64f881={};var _0x159e4f={};var _0x3ad8a2;var _0x91711e;return db[_0xa313('0x2b')][_0xa313('0x4c')]({'where':{'id':_0xf70525[_0xa313('0x4a')]['id']}})[_0xa313('0x23')](handleEntityNotFound(_0x11855b,null))[_0xa313('0x23')](function(_0x27d715){if(_0x27d715){_0x3ad8a2=_0x27d715;_0x159e4f[_0xa313('0x2f')]=_['keys'](db['Tag'][_0xa313('0x44')]);_0x159e4f[_0xa313('0x30')]=_['keys'](_0xf70525['query']);_0x159e4f[_0xa313('0x32')]=_['intersection'](_0x159e4f[_0xa313('0x2f')],_0x159e4f[_0xa313('0x30')]);_0x64f881['attributes']=_[_0xa313('0x34')](_0x159e4f[_0xa313('0x2f')],qs['fields'](_0xf70525[_0xa313('0x30')][_0xa313('0x35')]));_0x64f881[_0xa313('0x33')]=_0x64f881[_0xa313('0x33')][_0xa313('0x36')]?_0x64f881['attributes']:_0x159e4f[_0xa313('0x2f')];_0x64f881[_0xa313('0x37')]=qs[_0xa313('0x38')](_0xf70525[_0xa313('0x30')][_0xa313('0x38')]);_0x64f881[_0xa313('0x3b')]=qs[_0xa313('0x32')](_['pick'](_0xf70525[_0xa313('0x30')],_0x159e4f[_0xa313('0x32')]));if(_0xf70525[_0xa313('0x30')][_0xa313('0x3a')]){_0x64f881['where']=_['merge'](_0x64f881[_0xa313('0x3b')],{'$or':_['map'](_0x64f881[_0xa313('0x33')],function(_0x4080a5){var _0x38cc79={};_0x38cc79[_0x4080a5]={'$like':'%'+_0xf70525[_0xa313('0x30')][_0xa313('0x3a')]+'%'};return _0x38cc79;})});}_0x64f881=_[_0xa313('0x3d')]({},_0x64f881,_0xf70525[_0xa313('0x3e')]);return _0x3ad8a2[_0xa313('0x52')](_0x64f881);}})[_0xa313('0x23')](function(_0x1ef875){if(_0x1ef875){_0x91711e=_0x1ef875['length'];if(!_0xf70525[_0xa313('0x30')][_0xa313('0x4e')]('nolimit')){_0x64f881[_0xa313('0x1f')]=qs[_0xa313('0x1f')](_0xf70525[_0xa313('0x30')][_0xa313('0x1f')]);_0x64f881[_0xa313('0x1e')]=qs[_0xa313('0x1e')](_0xf70525[_0xa313('0x30')][_0xa313('0x1e')]);}return _0x3ad8a2[_0xa313('0x52')](_0x64f881);}})[_0xa313('0x23')](function(_0x35fb22){if(_0x35fb22){return _0x35fb22?{'count':_0x91711e,'rows':_0x35fb22}:null;}})[_0xa313('0x23')](respondWithResult(_0x11855b,null))[_0xa313('0x42')](handleError(_0x11855b,null));};exports['setTags']=function(_0x2b536a,_0x3583b9,_0x184bd6){if(_0x2b536a[_0xa313('0x48')]['id']){delete _0x2b536a[_0xa313('0x48')]['id'];}return db[_0xa313('0x2b')][_0xa313('0x4c')]({'where':{'id':_0x2b536a['params']['id']}})['then'](handleEntityNotFound(_0x3583b9,null))[_0xa313('0x23')](function(_0x9307a5){if(_0x9307a5){return _0x9307a5[_0xa313('0x53')](_0x2b536a[_0xa313('0x48')][_0xa313('0x54')]||[]);}return null;})[_0xa313('0x23')](respondWithResult(_0x3583b9,null))[_0xa313('0x42')](handleError(_0x3583b9,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5099b91..3d41015 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 _0x0b3e=['define','DeskConfiguration','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x4553f2,_0xf8253c){var _0x3e12f4=function(_0x18269b){while(--_0x18269b){_0x4553f2['push'](_0x4553f2['shift']());}};_0x3e12f4(++_0xf8253c);}(_0x0b3e,0x14c));var _0xe0b3=function(_0x421dfd,_0x9eda46){_0x421dfd=_0x421dfd-0x0;var _0x450994=_0x0b3e[_0x421dfd];return _0x450994;};'use strict';var _=require(_0xe0b3('0x0'));var util=require('util');var logger=require(_0xe0b3('0x1'))('api');var moment=require(_0xe0b3('0x2'));var BPromise=require(_0xe0b3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0b3('0x4'));var rimraf=require(_0xe0b3('0x5'));var config=require(_0xe0b3('0x6'));var attributes=require(_0xe0b3('0x7'));module[_0xe0b3('0x8')]=function(_0x46eb92,_0x5c9322){return _0x46eb92[_0xe0b3('0x9')](_0xe0b3('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d57=['api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x283bc7,_0x2c19f3){var _0x2de01e=function(_0x21de28){while(--_0x21de28){_0x283bc7['push'](_0x283bc7['shift']());}};_0x2de01e(++_0x2c19f3);}(_0x8d57,0x1de));var _0x78d5=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x8d57[_0x368bba];return _0x409f8f;};'use strict';var _=require(_0x78d5('0x0'));var util=require(_0x78d5('0x1'));var logger=require(_0x78d5('0x2'))(_0x78d5('0x3'));var moment=require(_0x78d5('0x4'));var BPromise=require('bluebird');var rp=require(_0x78d5('0x5'));var fs=require('fs');var path=require(_0x78d5('0x6'));var rimraf=require(_0x78d5('0x7'));var config=require(_0x78d5('0x8'));var attributes=require(_0x78d5('0x9'));module[_0x78d5('0xa')]=function(_0x3fefcc,_0x17d1d5){return _0x3fefcc[_0x78d5('0xb')]('DeskConfiguration',attributes,{'tableName':_0x78d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 1a169f5..98409f9 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 _0xf9ae=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9ae,0x85));var _0xef9a=function(_0x3eed2e,_0xf9944){_0x3eed2e=_0x3eed2e-0x0;var _0x4eb95b=_0xf9ae[_0x3eed2e];return _0x4eb95b;};'use strict';var _=require(_0xef9a('0x0'));var util=require(_0xef9a('0x1'));var moment=require('moment');var BPromise=require(_0xef9a('0x2'));var rs=require(_0xef9a('0x3'));var fs=require('fs');var Redis=require(_0xef9a('0x4'));var db=require(_0xef9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef9a('0x6'))(_0xef9a('0x7'));var config=require('../../config/environment');var jayson=require(_0xef9a('0x8'));var client=jayson[_0xef9a('0x9')][_0xef9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d72d2,_0x3e1435,_0x387dd0){return new BPromise(function(_0x40afbc,_0x50025e){return client[_0xef9a('0xb')](_0x5d72d2,_0x387dd0)[_0xef9a('0xc')](function(_0x4c5623){logger[_0xef9a('0xd')](_0xef9a('0xe'),_0x3e1435,_0xef9a('0xf'));logger['debug'](_0xef9a('0x10'),_0x3e1435,'request\x20sent',JSON[_0xef9a('0x11')](_0x4c5623));if(_0x4c5623[_0xef9a('0x12')]){if(_0x4c5623[_0xef9a('0x12')][_0xef9a('0x13')]===0x1f4){logger['error'](_0xef9a('0xe'),_0x3e1435,_0x4c5623['error'][_0xef9a('0x14')]);return _0x50025e(_0x4c5623['error'][_0xef9a('0x14')]);}logger[_0xef9a('0x12')](_0xef9a('0xe'),_0x3e1435,_0x4c5623[_0xef9a('0x12')]['message']);return _0x40afbc(_0x4c5623[_0xef9a('0x12')][_0xef9a('0x14')]);}else{logger[_0xef9a('0xd')](_0xef9a('0xe'),_0x3e1435,_0xef9a('0xf'));_0x40afbc(_0x4c5623[_0xef9a('0x15')][_0xef9a('0x14')]);}})['catch'](function(_0x8b79f8){logger[_0xef9a('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3e1435,_0x8b79f8);_0x50025e(_0x8b79f8);});});} \ No newline at end of file +var _0x58c8=['request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34e5b6,_0x59f947){var _0x3ae77b=function(_0x2399e8){while(--_0x2399e8){_0x34e5b6['push'](_0x34e5b6['shift']());}};_0x3ae77b(++_0x59f947);}(_0x58c8,0x1d9));var _0x858c=function(_0x461a2a,_0xee0c4f){_0x461a2a=_0x461a2a-0x0;var _0x2e4b71=_0x58c8[_0x461a2a];return _0x2e4b71;};'use strict';var _=require('lodash');var util=require(_0x858c('0x0'));var moment=require('moment');var BPromise=require(_0x858c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x858c('0x2'));var db=require(_0x858c('0x3'))['db'];var utils=require(_0x858c('0x4'));var logger=require(_0x858c('0x5'))(_0x858c('0x6'));var config=require(_0x858c('0x7'));var jayson=require(_0x858c('0x8'));var client=jayson[_0x858c('0x9')][_0x858c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44ea8e,_0x505ba8,_0x54e592){return new BPromise(function(_0xa04765,_0x3d6b4c){return client[_0x858c('0xb')](_0x44ea8e,_0x54e592)[_0x858c('0xc')](function(_0x1a35ac){logger['info'](_0x858c('0xd'),_0x505ba8,'request\x20sent');logger[_0x858c('0xe')](_0x858c('0xf'),_0x505ba8,'request\x20sent',JSON[_0x858c('0x10')](_0x1a35ac));if(_0x1a35ac[_0x858c('0x11')]){if(_0x1a35ac[_0x858c('0x11')]['code']===0x1f4){logger['error'](_0x858c('0xd'),_0x505ba8,_0x1a35ac[_0x858c('0x11')]['message']);return _0x3d6b4c(_0x1a35ac[_0x858c('0x11')][_0x858c('0x12')]);}logger[_0x858c('0x11')](_0x858c('0xd'),_0x505ba8,_0x1a35ac[_0x858c('0x11')][_0x858c('0x12')]);return _0xa04765(_0x1a35ac[_0x858c('0x11')][_0x858c('0x12')]);}else{logger[_0x858c('0x13')](_0x858c('0xd'),_0x505ba8,_0x858c('0x14'));_0xa04765(_0x1a35ac['result'][_0x858c('0x12')]);}})[_0x858c('0x15')](function(_0x2ac60a){logger[_0x858c('0x11')](_0x858c('0xd'),_0x505ba8,_0x2ac60a);_0x3d6b4c(_0x2ac60a);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9bf22db..5e50408 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 _0x4390=['multer','util','path','connect-timeout','express','Router','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports'];(function(_0x265b14,_0x4e74a3){var _0x2972b0=function(_0xfd7d66){while(--_0xfd7d66){_0x265b14['push'](_0x265b14['shift']());}};_0x2972b0(++_0x4e74a3);}(_0x4390,0x88));var _0x0439=function(_0x24ba39,_0x1bb01d){_0x24ba39=_0x24ba39-0x0;var _0x46c5a5=_0x4390[_0x24ba39];return _0x46c5a5;};'use strict';var multer=require(_0x0439('0x0'));var util=require(_0x0439('0x1'));var path=require(_0x0439('0x2'));var timeout=require(_0x0439('0x3'));var express=require(_0x0439('0x4'));var router=express[_0x0439('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0439('0x6'));var controller=require(_0x0439('0x7'));router[_0x0439('0x8')]('/',auth[_0x0439('0x9')](),controller['index']);router[_0x0439('0x8')](_0x0439('0xa'),auth[_0x0439('0x9')](),controller['show']);router[_0x0439('0xb')]('/',auth[_0x0439('0x9')](),controller[_0x0439('0xc')]);router[_0x0439('0xd')](_0x0439('0xa'),auth[_0x0439('0x9')](),controller[_0x0439('0xe')]);router[_0x0439('0xf')](_0x0439('0xa'),auth[_0x0439('0x9')](),controller['destroy']);module[_0x0439('0x10')]=router; \ No newline at end of file +var _0xcd7f=['isAuthenticated','index','get','/:id','create','put','update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x8091fc,_0x1f7966){var _0x2a8bbd=function(_0x29c0d2){while(--_0x29c0d2){_0x8091fc['push'](_0x8091fc['shift']());}};_0x2a8bbd(++_0x1f7966);}(_0xcd7f,0x16e));var _0xfcd7=function(_0x37b168,_0x19afe7){_0x37b168=_0x37b168-0x0;var _0x572896=_0xcd7f[_0x37b168];return _0x572896;};'use strict';var multer=require(_0xfcd7('0x0'));var util=require(_0xfcd7('0x1'));var path=require(_0xfcd7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfcd7('0x3'));var auth=require(_0xfcd7('0x4'));var interaction=require(_0xfcd7('0x5'));var config=require(_0xfcd7('0x6'));var controller=require(_0xfcd7('0x7'));router['get']('/',auth[_0xfcd7('0x8')](),controller[_0xfcd7('0x9')]);router[_0xfcd7('0xa')](_0xfcd7('0xb'),auth[_0xfcd7('0x8')](),controller['show']);router['post']('/',auth[_0xfcd7('0x8')](),controller[_0xfcd7('0xc')]);router[_0xfcd7('0xd')](_0xfcd7('0xb'),auth[_0xfcd7('0x8')](),controller[_0xfcd7('0xe')]);router[_0xfcd7('0xf')](_0xfcd7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xfcd7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 473bd13..9e9b4ca 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 _0x0995=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x0995,0xb9));var _0x5099=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0995[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5099('0x0'));module[_0x5099('0x1')]={'type':{'type':Sequelize[_0x5099('0x2')](_0x5099('0x3'),_0x5099('0x4'),_0x5099('0x5'),'keyValue',_0x5099('0x6')),'defaultValue':_0x5099('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5099('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5099('0x4'),_0x5099('0x5'))},'keyContent':{'type':Sequelize[_0x5099('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5099('0x7')]},'customField':{'type':Sequelize[_0x5099('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd405=['variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xd405,0x76));var _0x5d40=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0xd405[_0x30c7c5];return _0x29e24e;};'use strict';var Sequelize=require(_0x5d40('0x0'));module[_0x5d40('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5d40('0x2'),_0x5d40('0x3'),_0x5d40('0x4'),_0x5d40('0x5')),'defaultValue':_0x5d40('0x6')},'content':{'type':Sequelize[_0x5d40('0x7')]},'key':{'type':Sequelize[_0x5d40('0x7')]},'keyType':{'type':Sequelize[_0x5d40('0x8')](_0x5d40('0x6'),_0x5d40('0x2'),_0x5d40('0x3'))},'keyContent':{'type':Sequelize[_0x5d40('0x7')]},'idField':{'type':Sequelize[_0x5d40('0x7')]},'nameField':{'type':Sequelize[_0x5d40('0x7')]},'customField':{'type':Sequelize[_0x5d40('0x9')],'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 a2cc459..936d46c 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 _0xb422=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','update','body','fast-json-patch','bluebird','util'];(function(_0x56e7e0,_0x4dd33b){var _0x2d8c1c=function(_0xf5785c){while(--_0xf5785c){_0x56e7e0['push'](_0x56e7e0['shift']());}};_0x2d8c1c(++_0x4dd33b);}(_0xb422,0x85));var _0x2b42=function(_0x463a03,_0x13914f){_0x463a03=_0x463a03-0x0;var _0x5baa30=_0xb422[_0x463a03];return _0x5baa30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b42('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b42('0x1'));var Mustache=require('mustache');var util=require(_0x2b42('0x2'));var path=require('path');var sox=require(_0x2b42('0x3'));var csv=require('to-csv');var ejs=require(_0x2b42('0x4'));var fs=require('fs');var fs_extra=require(_0x2b42('0x5'));var _=require(_0x2b42('0x6'));var squel=require('squel');var crypto=require(_0x2b42('0x7'));var jsforce=require(_0x2b42('0x8'));var deskjs=require(_0x2b42('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2b42('0xa'));var Redis=require('ioredis');var authService=require(_0x2b42('0xb'));var qs=require(_0x2b42('0xc'));var as=require(_0x2b42('0xd'));var hardwareService=require(_0x2b42('0xe'));var logger=require('../../config/logger')(_0x2b42('0xf'));var utils=require(_0x2b42('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2b42('0x11'));var db=require(_0x2b42('0x12'))['db'];function respondWithStatusCode(_0x22272e,_0x176efa){_0x176efa=_0x176efa||0xcc;return function(_0x4b8a04){if(_0x4b8a04){return _0x22272e['sendStatus'](_0x176efa);}return _0x22272e[_0x2b42('0x13')](_0x176efa)[_0x2b42('0x14')]();};}function respondWithResult(_0x5dec9a,_0x232c58){_0x232c58=_0x232c58||0xc8;return function(_0x17d103){if(_0x17d103){return _0x5dec9a[_0x2b42('0x13')](_0x232c58)[_0x2b42('0x15')](_0x17d103);}};}function respondWithFilteredResult(_0x4cb695,_0xc7e610){return function(_0x84b092){if(_0x84b092){var _0x1b93d5=typeof _0xc7e610[_0x2b42('0x16')]===_0x2b42('0x17')&&typeof _0xc7e610['limit']===_0x2b42('0x17');var _0x11fdec=_0x84b092[_0x2b42('0x18')];var _0x3e3426=_0x1b93d5?0x0:_0xc7e610[_0x2b42('0x16')];var _0x3ab83c=_0x1b93d5?_0x84b092[_0x2b42('0x18')]:_0xc7e610[_0x2b42('0x16')]+_0xc7e610['limit'];var _0x22b8d6;if(_0x3ab83c>=_0x11fdec){_0x3ab83c=_0x11fdec;_0x22b8d6=0xc8;}else{_0x22b8d6=0xce;}_0x4cb695[_0x2b42('0x13')](_0x22b8d6);return _0x4cb695['set'](_0x2b42('0x19'),_0x3e3426+'-'+_0x3ab83c+'/'+_0x11fdec)['json'](_0x84b092);}return null;};}function patchUpdates(_0x38d41c){return function(_0x13422a){try{jsonpatch[_0x2b42('0x1a')](_0x13422a,_0x38d41c,!![]);}catch(_0x50fd94){return BPromise['reject'](_0x50fd94);}return _0x13422a[_0x2b42('0x1b')]();};}function saveUpdates(_0x24061b,_0x24ac96){return function(_0x2ee957){if(_0x2ee957){return _0x2ee957['update'](_0x24061b)[_0x2b42('0x1c')](function(_0x355859){return _0x355859;});}return null;};}function removeEntity(_0x5063b6,_0x2b9531){return function(_0x2e9aa1){if(_0x2e9aa1){return _0x2e9aa1[_0x2b42('0x1d')]()[_0x2b42('0x1c')](function(){_0x5063b6[_0x2b42('0x13')](0xcc)[_0x2b42('0x14')]();});}};}function handleEntityNotFound(_0x5367f0,_0x20ee74){return function(_0x319692){if(!_0x319692){_0x5367f0[_0x2b42('0x1e')](0x194);}return _0x319692;};}function handleError(_0x256fc9,_0x1d37b9){_0x1d37b9=_0x1d37b9||0x1f4;return function(_0x807625){logger[_0x2b42('0x1f')](_0x807625[_0x2b42('0x20')]);if(_0x807625[_0x2b42('0x21')]){delete _0x807625[_0x2b42('0x21')];}_0x256fc9[_0x2b42('0x13')](_0x1d37b9)['send'](_0x807625);};}exports['index']=function(_0x162efa,_0xcb30f5){var _0x8293e2={},_0x352ef7={},_0x4b43b0={'count':0x0,'rows':[]};var _0x286223=_[_0x2b42('0x22')](db[_0x2b42('0x23')]['rawAttributes'],function(_0x5588ce){return{'name':_0x5588ce[_0x2b42('0x24')],'type':_0x5588ce[_0x2b42('0x25')][_0x2b42('0x26')]};});_0x352ef7[_0x2b42('0x27')]=_['map'](_0x286223,_0x2b42('0x21'));_0x352ef7[_0x2b42('0x28')]=_[_0x2b42('0x29')](_0x162efa['query']);_0x352ef7[_0x2b42('0x2a')]=_[_0x2b42('0x2b')](_0x352ef7[_0x2b42('0x27')],_0x352ef7[_0x2b42('0x28')]);_0x8293e2[_0x2b42('0x2c')]=_[_0x2b42('0x2b')](_0x352ef7[_0x2b42('0x27')],qs[_0x2b42('0x2d')](_0x162efa[_0x2b42('0x28')][_0x2b42('0x2d')]));_0x8293e2[_0x2b42('0x2c')]=_0x8293e2['attributes'][_0x2b42('0x2e')]?_0x8293e2['attributes']:_0x352ef7['model'];if(!_0x162efa[_0x2b42('0x28')][_0x2b42('0x2f')]('nolimit')){_0x8293e2['limit']=qs['limit'](_0x162efa[_0x2b42('0x28')][_0x2b42('0x30')]);_0x8293e2[_0x2b42('0x16')]=qs['offset'](_0x162efa[_0x2b42('0x28')][_0x2b42('0x16')]);}_0x8293e2['order']=qs['sort'](_0x162efa[_0x2b42('0x28')][_0x2b42('0x31')]);_0x8293e2[_0x2b42('0x32')]=qs['filters'](_[_0x2b42('0x33')](_0x162efa[_0x2b42('0x28')],_0x352ef7[_0x2b42('0x2a')]),_0x286223);if(_0x162efa[_0x2b42('0x28')][_0x2b42('0x34')]){_0x8293e2['where']=_[_0x2b42('0x35')](_0x8293e2[_0x2b42('0x32')],{'$or':_[_0x2b42('0x22')](_0x286223,function(_0x3971ee){if(_0x3971ee[_0x2b42('0x25')]!==_0x2b42('0x36')){var _0x45fb9f={};_0x45fb9f[_0x3971ee[_0x2b42('0x21')]]={'$like':'%'+_0x162efa[_0x2b42('0x28')][_0x2b42('0x34')]+'%'};return _0x45fb9f;}})});}_0x8293e2=_['merge']({},_0x8293e2,_0x162efa['options']);var _0x17b9b1={'where':_0x8293e2[_0x2b42('0x32')]};return db[_0x2b42('0x23')][_0x2b42('0x18')](_0x17b9b1)['then'](function(_0x1188d9){_0x4b43b0[_0x2b42('0x18')]=_0x1188d9;if(_0x162efa[_0x2b42('0x28')][_0x2b42('0x37')]){_0x8293e2[_0x2b42('0x38')]=[{'all':!![]}];}return db['DeskField'][_0x2b42('0x39')](_0x8293e2);})['then'](function(_0x35e745){_0x4b43b0[_0x2b42('0x3a')]=_0x35e745;return _0x4b43b0;})['then'](respondWithFilteredResult(_0xcb30f5,_0x8293e2))['catch'](handleError(_0xcb30f5,null));};exports[_0x2b42('0x3b')]=function(_0x10fad1,_0x4dc92e){var _0x5c525b={'raw':!![],'where':{'id':_0x10fad1[_0x2b42('0x3c')]['id']}},_0x3cc07e={};_0x3cc07e[_0x2b42('0x27')]=_[_0x2b42('0x29')](db[_0x2b42('0x23')][_0x2b42('0x3d')]);_0x3cc07e['query']=_[_0x2b42('0x29')](_0x10fad1[_0x2b42('0x28')]);_0x3cc07e['filters']=_[_0x2b42('0x2b')](_0x3cc07e[_0x2b42('0x27')],_0x3cc07e[_0x2b42('0x28')]);_0x5c525b[_0x2b42('0x2c')]=_[_0x2b42('0x2b')](_0x3cc07e[_0x2b42('0x27')],qs[_0x2b42('0x2d')](_0x10fad1[_0x2b42('0x28')][_0x2b42('0x2d')]));_0x5c525b[_0x2b42('0x2c')]=_0x5c525b[_0x2b42('0x2c')][_0x2b42('0x2e')]?_0x5c525b[_0x2b42('0x2c')]:_0x3cc07e[_0x2b42('0x27')];if(_0x10fad1[_0x2b42('0x28')]['includeAll']){_0x5c525b['include']=[{'all':!![]}];}_0x5c525b=_['merge']({},_0x5c525b,_0x10fad1[_0x2b42('0x3e')]);return db[_0x2b42('0x23')][_0x2b42('0x3f')](_0x5c525b)[_0x2b42('0x1c')](handleEntityNotFound(_0x4dc92e,null))[_0x2b42('0x1c')](respondWithResult(_0x4dc92e,null))[_0x2b42('0x40')](handleError(_0x4dc92e,null));};exports['create']=function(_0x11da42,_0x466e49){return db['DeskField'][_0x2b42('0x41')](_0x11da42['body'],{})[_0x2b42('0x1c')](respondWithResult(_0x466e49,0xc9))[_0x2b42('0x40')](handleError(_0x466e49,null));};exports[_0x2b42('0x42')]=function(_0x45fecd,_0x2890d2){if(_0x45fecd[_0x2b42('0x43')]['id']){delete _0x45fecd[_0x2b42('0x43')]['id'];}return db[_0x2b42('0x23')]['find']({'where':{'id':_0x45fecd[_0x2b42('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2890d2,null))[_0x2b42('0x1c')](saveUpdates(_0x45fecd[_0x2b42('0x43')],null))[_0x2b42('0x1c')](respondWithResult(_0x2890d2,null))['catch'](handleError(_0x2890d2,null));};exports[_0x2b42('0x1d')]=function(_0x3e09f3,_0x212b03){return db[_0x2b42('0x23')]['find']({'where':{'id':_0x3e09f3['params']['id']}})[_0x2b42('0x1c')](handleEntityNotFound(_0x212b03,null))[_0x2b42('0x1c')](removeEntity(_0x212b03,null))[_0x2b42('0x40')](handleError(_0x212b03,null));}; \ No newline at end of file +var _0x4b66=['body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filters','filter','where','merge','map','VIRTUAL','DeskField','includeAll','include','findAll','rows','show','params','keys','options','catch','create'];(function(_0x2d2cd2,_0x38c2bd){var _0x874c2b=function(_0x490010){while(--_0x490010){_0x2d2cd2['push'](_0x2d2cd2['shift']());}};_0x874c2b(++_0x38c2bd);}(_0x4b66,0x1dc));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x64b6('0x0'));var rimraf=require(_0x64b6('0x1'));var zipdir=require(_0x64b6('0x2'));var jsonpatch=require(_0x64b6('0x3'));var rp=require(_0x64b6('0x4'));var moment=require(_0x64b6('0x5'));var BPromise=require(_0x64b6('0x6'));var Mustache=require(_0x64b6('0x7'));var util=require(_0x64b6('0x8'));var path=require(_0x64b6('0x9'));var sox=require(_0x64b6('0xa'));var csv=require(_0x64b6('0xb'));var ejs=require(_0x64b6('0xc'));var fs=require('fs');var fs_extra=require(_0x64b6('0xd'));var _=require(_0x64b6('0xe'));var squel=require('squel');var crypto=require(_0x64b6('0xf'));var jsforce=require(_0x64b6('0x10'));var deskjs=require(_0x64b6('0x11'));var toCsv=require(_0x64b6('0xb'));var querystring=require('querystring');var Papa=require(_0x64b6('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x64b6('0x13'));var as=require(_0x64b6('0x14'));var hardwareService=require(_0x64b6('0x15'));var logger=require(_0x64b6('0x16'))(_0x64b6('0x17'));var utils=require(_0x64b6('0x18'));var config=require(_0x64b6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x64b6('0x1a'))['db'];function respondWithStatusCode(_0x29be4b,_0x20f974){_0x20f974=_0x20f974||0xcc;return function(_0x5e789f){if(_0x5e789f){return _0x29be4b[_0x64b6('0x1b')](_0x20f974);}return _0x29be4b[_0x64b6('0x1c')](_0x20f974)[_0x64b6('0x1d')]();};}function respondWithResult(_0x1e8bae,_0x37efb5){_0x37efb5=_0x37efb5||0xc8;return function(_0xe4ada7){if(_0xe4ada7){return _0x1e8bae['status'](_0x37efb5)[_0x64b6('0x1e')](_0xe4ada7);}};}function respondWithFilteredResult(_0x2121de,_0x5ddf35){return function(_0x4170f7){if(_0x4170f7){var _0x481038=typeof _0x5ddf35[_0x64b6('0x1f')]==='undefined'&&typeof _0x5ddf35[_0x64b6('0x20')]===_0x64b6('0x21');var _0x43d665=_0x4170f7[_0x64b6('0x22')];var _0x4c76f6=_0x481038?0x0:_0x5ddf35[_0x64b6('0x1f')];var _0x4ce14b=_0x481038?_0x4170f7['count']:_0x5ddf35[_0x64b6('0x1f')]+_0x5ddf35[_0x64b6('0x20')];var _0x448a41;if(_0x4ce14b>=_0x43d665){_0x4ce14b=_0x43d665;_0x448a41=0xc8;}else{_0x448a41=0xce;}_0x2121de[_0x64b6('0x1c')](_0x448a41);return _0x2121de[_0x64b6('0x23')](_0x64b6('0x24'),_0x4c76f6+'-'+_0x4ce14b+'/'+_0x43d665)[_0x64b6('0x1e')](_0x4170f7);}return null;};}function patchUpdates(_0x1235ab){return function(_0x556154){try{jsonpatch[_0x64b6('0x25')](_0x556154,_0x1235ab,!![]);}catch(_0x1b8b32){return BPromise[_0x64b6('0x26')](_0x1b8b32);}return _0x556154['save']();};}function saveUpdates(_0x189d93,_0x330d58){return function(_0x55fc8e){if(_0x55fc8e){return _0x55fc8e[_0x64b6('0x27')](_0x189d93)['then'](function(_0x1f5b4b){return _0x1f5b4b;});}return null;};}function removeEntity(_0x294a47,_0x20f6e9){return function(_0x43b404){if(_0x43b404){return _0x43b404[_0x64b6('0x28')]()[_0x64b6('0x29')](function(){_0x294a47[_0x64b6('0x1c')](0xcc)[_0x64b6('0x1d')]();});}};}function handleEntityNotFound(_0x3e41ec,_0x279f8f){return function(_0x283bc4){if(!_0x283bc4){_0x3e41ec[_0x64b6('0x1b')](0x194);}return _0x283bc4;};}function handleError(_0x27f4b4,_0x33f4d8){_0x33f4d8=_0x33f4d8||0x1f4;return function(_0x5f201e){logger[_0x64b6('0x2a')](_0x5f201e[_0x64b6('0x2b')]);if(_0x5f201e[_0x64b6('0x2c')]){delete _0x5f201e['name'];}_0x27f4b4['status'](_0x33f4d8)[_0x64b6('0x2d')](_0x5f201e);};}exports[_0x64b6('0x2e')]=function(_0x500b90,_0x32c0bc){var _0x4de096={},_0x4643de={},_0x134126={'count':0x0,'rows':[]};var _0x36b15f=_['map'](db['DeskField'][_0x64b6('0x2f')],function(_0x1e0952){return{'name':_0x1e0952['fieldName'],'type':_0x1e0952[_0x64b6('0x30')][_0x64b6('0x31')]};});_0x4643de[_0x64b6('0x32')]=_['map'](_0x36b15f,_0x64b6('0x2c'));_0x4643de[_0x64b6('0x33')]=_['keys'](_0x500b90[_0x64b6('0x33')]);_0x4643de['filters']=_[_0x64b6('0x34')](_0x4643de[_0x64b6('0x32')],_0x4643de[_0x64b6('0x33')]);_0x4de096[_0x64b6('0x35')]=_[_0x64b6('0x34')](_0x4643de[_0x64b6('0x32')],qs[_0x64b6('0x36')](_0x500b90[_0x64b6('0x33')][_0x64b6('0x36')]));_0x4de096[_0x64b6('0x35')]=_0x4de096[_0x64b6('0x35')][_0x64b6('0x37')]?_0x4de096[_0x64b6('0x35')]:_0x4643de[_0x64b6('0x32')];if(!_0x500b90[_0x64b6('0x33')][_0x64b6('0x38')](_0x64b6('0x39'))){_0x4de096[_0x64b6('0x20')]=qs['limit'](_0x500b90[_0x64b6('0x33')]['limit']);_0x4de096['offset']=qs[_0x64b6('0x1f')](_0x500b90[_0x64b6('0x33')][_0x64b6('0x1f')]);}_0x4de096[_0x64b6('0x3a')]=qs['sort'](_0x500b90[_0x64b6('0x33')]['sort']);_0x4de096['where']=qs['filters'](_[_0x64b6('0x3b')](_0x500b90[_0x64b6('0x33')],_0x4643de[_0x64b6('0x3c')]),_0x36b15f);if(_0x500b90[_0x64b6('0x33')][_0x64b6('0x3d')]){_0x4de096[_0x64b6('0x3e')]=_[_0x64b6('0x3f')](_0x4de096['where'],{'$or':_[_0x64b6('0x40')](_0x36b15f,function(_0x533b03){if(_0x533b03['type']!==_0x64b6('0x41')){var _0x3ee5e8={};_0x3ee5e8[_0x533b03['name']]={'$like':'%'+_0x500b90[_0x64b6('0x33')][_0x64b6('0x3d')]+'%'};return _0x3ee5e8;}})});}_0x4de096=_[_0x64b6('0x3f')]({},_0x4de096,_0x500b90['options']);var _0x3c7d6b={'where':_0x4de096[_0x64b6('0x3e')]};return db[_0x64b6('0x42')][_0x64b6('0x22')](_0x3c7d6b)['then'](function(_0x28e700){_0x134126['count']=_0x28e700;if(_0x500b90['query'][_0x64b6('0x43')]){_0x4de096[_0x64b6('0x44')]=[{'all':!![]}];}return db['DeskField'][_0x64b6('0x45')](_0x4de096);})[_0x64b6('0x29')](function(_0x4d3991){_0x134126[_0x64b6('0x46')]=_0x4d3991;return _0x134126;})[_0x64b6('0x29')](respondWithFilteredResult(_0x32c0bc,_0x4de096))['catch'](handleError(_0x32c0bc,null));};exports[_0x64b6('0x47')]=function(_0x411a19,_0x5131a9){var _0xf856ba={'raw':!![],'where':{'id':_0x411a19[_0x64b6('0x48')]['id']}},_0x144e6d={};_0x144e6d[_0x64b6('0x32')]=_[_0x64b6('0x49')](db[_0x64b6('0x42')][_0x64b6('0x2f')]);_0x144e6d[_0x64b6('0x33')]=_[_0x64b6('0x49')](_0x411a19[_0x64b6('0x33')]);_0x144e6d['filters']=_[_0x64b6('0x34')](_0x144e6d[_0x64b6('0x32')],_0x144e6d[_0x64b6('0x33')]);_0xf856ba[_0x64b6('0x35')]=_[_0x64b6('0x34')](_0x144e6d[_0x64b6('0x32')],qs[_0x64b6('0x36')](_0x411a19[_0x64b6('0x33')]['fields']));_0xf856ba[_0x64b6('0x35')]=_0xf856ba['attributes'][_0x64b6('0x37')]?_0xf856ba[_0x64b6('0x35')]:_0x144e6d[_0x64b6('0x32')];if(_0x411a19[_0x64b6('0x33')]['includeAll']){_0xf856ba[_0x64b6('0x44')]=[{'all':!![]}];}_0xf856ba=_[_0x64b6('0x3f')]({},_0xf856ba,_0x411a19[_0x64b6('0x4a')]);return db[_0x64b6('0x42')]['find'](_0xf856ba)[_0x64b6('0x29')](handleEntityNotFound(_0x5131a9,null))['then'](respondWithResult(_0x5131a9,null))[_0x64b6('0x4b')](handleError(_0x5131a9,null));};exports[_0x64b6('0x4c')]=function(_0x465758,_0x3e3862){return db[_0x64b6('0x42')][_0x64b6('0x4c')](_0x465758[_0x64b6('0x4d')],{})[_0x64b6('0x29')](respondWithResult(_0x3e3862,0xc9))[_0x64b6('0x4b')](handleError(_0x3e3862,null));};exports[_0x64b6('0x27')]=function(_0x16b13f,_0x40acac){if(_0x16b13f[_0x64b6('0x4d')]['id']){delete _0x16b13f['body']['id'];}return db[_0x64b6('0x42')][_0x64b6('0x4e')]({'where':{'id':_0x16b13f['params']['id']}})[_0x64b6('0x29')](handleEntityNotFound(_0x40acac,null))[_0x64b6('0x29')](saveUpdates(_0x16b13f[_0x64b6('0x4d')],null))[_0x64b6('0x29')](respondWithResult(_0x40acac,null))[_0x64b6('0x4b')](handleError(_0x40acac,null));};exports[_0x64b6('0x28')]=function(_0x38e741,_0x528641){return db[_0x64b6('0x42')][_0x64b6('0x4e')]({'where':{'id':_0x38e741['params']['id']}})[_0x64b6('0x29')](handleEntityNotFound(_0x528641,null))[_0x64b6('0x29')](removeEntity(_0x528641,null))['catch'](handleError(_0x528641,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index fc71085..e8cb22e 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 _0x5786=['rimraf','./intDeskField.attributes','exports','define','desk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1aeafe,_0x44104a){var _0x3d453c=function(_0x34f0ba){while(--_0x34f0ba){_0x1aeafe['push'](_0x1aeafe['shift']());}};_0x3d453c(++_0x44104a);}(_0x5786,0x1cd));var _0x6578=function(_0x5bf33a,_0x4ed7f8){_0x5bf33a=_0x5bf33a-0x0;var _0x699341=_0x5786[_0x5bf33a];return _0x699341;};'use strict';var _=require('lodash');var util=require(_0x6578('0x0'));var logger=require(_0x6578('0x1'))(_0x6578('0x2'));var moment=require(_0x6578('0x3'));var BPromise=require(_0x6578('0x4'));var rp=require(_0x6578('0x5'));var fs=require('fs');var path=require(_0x6578('0x6'));var rimraf=require(_0x6578('0x7'));var config=require('../../config/environment');var attributes=require(_0x6578('0x8'));module[_0x6578('0x9')]=function(_0x357e0a,_0x106775){return _0x357e0a[_0x6578('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x6578('0xb'),'fields':[_0x6578('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f02=['define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','../../config/logger','api','bluebird','../../config/environment','./intDeskField.attributes'];(function(_0x57267d,_0x44976d){var _0x2cab22=function(_0x2dac5e){while(--_0x2dac5e){_0x57267d['push'](_0x57267d['shift']());}};_0x2cab22(++_0x44976d);}(_0x2f02,0x14f));var _0x22f0=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0x2f02[_0x16ed87];return _0xc1a1d8;};'use strict';var _=require(_0x22f0('0x0'));var util=require('util');var logger=require(_0x22f0('0x1'))(_0x22f0('0x2'));var moment=require('moment');var BPromise=require(_0x22f0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x22f0('0x4'));var attributes=require(_0x22f0('0x5'));module['exports']=function(_0x21006d,_0x554c5c){return _0x21006d[_0x22f0('0x6')](_0x22f0('0x7'),attributes,{'tableName':_0x22f0('0x8'),'paranoid':![],'indexes':[{'name':_0x22f0('0x9'),'fields':[_0x22f0('0xa'),'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 76612c0..6e3a1ee 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 _0x3716=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','DeskField,\x20%s,\x20%s','result','catch'];(function(_0x2adbf8,_0x4afd45){var _0x4d8466=function(_0x1ea071){while(--_0x1ea071){_0x2adbf8['push'](_0x2adbf8['shift']());}};_0x4d8466(++_0x4afd45);}(_0x3716,0xb8));var _0x6371=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x3716[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x6371('0x0'));var util=require(_0x6371('0x1'));var moment=require('moment');var BPromise=require(_0x6371('0x2'));var rs=require(_0x6371('0x3'));var fs=require('fs');var Redis=require(_0x6371('0x4'));var db=require(_0x6371('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6371('0x6'))(_0x6371('0x7'));var config=require(_0x6371('0x8'));var jayson=require(_0x6371('0x9'));var client=jayson[_0x6371('0xa')][_0x6371('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36f11c,_0x309109,_0xf35a4a){return new BPromise(function(_0x181183,_0x523e84){return client['request'](_0x36f11c,_0xf35a4a)[_0x6371('0xc')](function(_0x52bc5c){logger[_0x6371('0xd')]('DeskField,\x20%s,\x20%s',_0x309109,'request\x20sent');logger[_0x6371('0xe')](_0x6371('0xf'),_0x309109,_0x6371('0x10'),JSON[_0x6371('0x11')](_0x52bc5c));if(_0x52bc5c['error']){if(_0x52bc5c['error']['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x309109,_0x52bc5c[_0x6371('0x12')][_0x6371('0x13')]);return _0x523e84(_0x52bc5c['error'][_0x6371('0x13')]);}logger[_0x6371('0x12')](_0x6371('0x14'),_0x309109,_0x52bc5c[_0x6371('0x12')]['message']);return _0x181183(_0x52bc5c['error'][_0x6371('0x13')]);}else{logger[_0x6371('0xd')](_0x6371('0x14'),_0x309109,'request\x20sent');_0x181183(_0x52bc5c[_0x6371('0x15')][_0x6371('0x13')]);}})[_0x6371('0x16')](function(_0x1c37bc){logger['error'](_0x6371('0x14'),_0x309109,_0x1c37bc);_0x523e84(_0x1c37bc);});});} \ No newline at end of file +var _0xb65c=['message','info','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x527b96,_0x51f7df){var _0x2ac7fd=function(_0x674375){while(--_0x674375){_0x527b96['push'](_0x527b96['shift']());}};_0x2ac7fd(++_0x51f7df);}(_0xb65c,0xf2));var _0xcb65=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0xb65c[_0x14cb58];return _0x5f097e;};'use strict';var _=require(_0xcb65('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb65('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb65('0x2'));var db=require(_0xcb65('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb65('0x4'))(_0xcb65('0x5'));var config=require(_0xcb65('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcb65('0x7')][_0xcb65('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17d218,_0x34198c,_0x282c2b){return new BPromise(function(_0xfce978,_0x35cf1d){return client[_0xcb65('0x9')](_0x17d218,_0x282c2b)[_0xcb65('0xa')](function(_0xe3ae28){logger['info'](_0xcb65('0xb'),_0x34198c,_0xcb65('0xc'));logger[_0xcb65('0xd')](_0xcb65('0xe'),_0x34198c,_0xcb65('0xc'),JSON[_0xcb65('0xf')](_0xe3ae28));if(_0xe3ae28[_0xcb65('0x10')]){if(_0xe3ae28[_0xcb65('0x10')][_0xcb65('0x11')]===0x1f4){logger['error'](_0xcb65('0xb'),_0x34198c,_0xe3ae28[_0xcb65('0x10')][_0xcb65('0x12')]);return _0x35cf1d(_0xe3ae28['error'][_0xcb65('0x12')]);}logger[_0xcb65('0x10')]('DeskField,\x20%s,\x20%s',_0x34198c,_0xe3ae28[_0xcb65('0x10')][_0xcb65('0x12')]);return _0xfce978(_0xe3ae28[_0xcb65('0x10')][_0xcb65('0x12')]);}else{logger[_0xcb65('0x13')](_0xcb65('0xb'),_0x34198c,_0xcb65('0xc'));_0xfce978(_0xe3ae28['result'][_0xcb65('0x12')]);}})['catch'](function(_0xa3a993){logger[_0xcb65('0x10')](_0xcb65('0xb'),_0x34198c,_0xa3a993);_0x35cf1d(_0xa3a993);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 7b60ce4..ae93211 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 _0x5760=['create','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x180ce8,_0x1038d7){var _0x559d77=function(_0x301148){while(--_0x301148){_0x180ce8['push'](_0x180ce8['shift']());}};_0x559d77(++_0x1038d7);}(_0x5760,0xce));var _0x0576=function(_0x25893e,_0x3bd3cd){_0x25893e=_0x25893e-0x0;var _0xf167b0=_0x5760[_0x25893e];return _0xf167b0;};'use strict';var multer=require(_0x0576('0x0'));var util=require('util');var path=require(_0x0576('0x1'));var timeout=require(_0x0576('0x2'));var express=require(_0x0576('0x3'));var router=express['Router']();var fs_extra=require(_0x0576('0x4'));var auth=require(_0x0576('0x5'));var interaction=require(_0x0576('0x6'));var config=require(_0x0576('0x7'));var controller=require(_0x0576('0x8'));router['get']('/',auth[_0x0576('0x9')](),controller[_0x0576('0xa')]);router[_0x0576('0xb')](_0x0576('0xc'),auth[_0x0576('0x9')](),controller[_0x0576('0xd')]);router[_0x0576('0xb')](_0x0576('0xe'),auth[_0x0576('0x9')](),controller[_0x0576('0xf')]);router[_0x0576('0xb')](_0x0576('0x10'),auth[_0x0576('0x9')](),controller[_0x0576('0x11')]);router[_0x0576('0x12')]('/',auth[_0x0576('0x9')](),controller[_0x0576('0x13')]);router[_0x0576('0x12')](_0x0576('0xe'),auth[_0x0576('0x9')](),controller[_0x0576('0x14')]);router['put'](_0x0576('0xc'),auth[_0x0576('0x9')](),controller[_0x0576('0x15')]);router[_0x0576('0x16')]('/:id',auth[_0x0576('0x9')](),controller[_0x0576('0x17')]);module[_0x0576('0x18')]=router; \ No newline at end of file +var _0xa6c8=['create','post','addConfiguration','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0xe8ce52,_0x1c422a){var _0x2c40f2=function(_0x76d223){while(--_0x76d223){_0xe8ce52['push'](_0xe8ce52['shift']());}};_0x2c40f2(++_0x1c422a);}(_0xa6c8,0xb5));var _0x8a6c=function(_0x32e802,_0x4c1299){_0x32e802=_0x32e802-0x0;var _0x20b1a5=_0xa6c8[_0x32e802];return _0x20b1a5;};'use strict';var multer=require(_0x8a6c('0x0'));var util=require(_0x8a6c('0x1'));var path=require(_0x8a6c('0x2'));var timeout=require(_0x8a6c('0x3'));var express=require(_0x8a6c('0x4'));var router=express[_0x8a6c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a6c('0x6'));var config=require(_0x8a6c('0x7'));var controller=require(_0x8a6c('0x8'));router[_0x8a6c('0x9')]('/',auth[_0x8a6c('0xa')](),controller['index']);router[_0x8a6c('0x9')](_0x8a6c('0xb'),auth[_0x8a6c('0xa')](),controller[_0x8a6c('0xc')]);router[_0x8a6c('0x9')](_0x8a6c('0xd'),auth['isAuthenticated'](),controller[_0x8a6c('0xe')]);router[_0x8a6c('0x9')](_0x8a6c('0xf'),auth[_0x8a6c('0xa')](),controller[_0x8a6c('0x10')]);router['post']('/',auth[_0x8a6c('0xa')](),controller[_0x8a6c('0x11')]);router[_0x8a6c('0x12')](_0x8a6c('0xd'),auth[_0x8a6c('0xa')](),controller[_0x8a6c('0x13')]);router['put'](_0x8a6c('0xb'),auth[_0x8a6c('0xa')](),controller['update']);router[_0x8a6c('0x14')]('/:id',auth[_0x8a6c('0xa')](),controller[_0x8a6c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b595ef7..1960240 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 _0x27c0=['exports','STRING','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x27c0,0xad));var _0x027c=function(_0x60cae4,_0x593d8c){_0x60cae4=_0x60cae4-0x0;var _0x14dfe4=_0x27c0[_0x60cae4];return _0x14dfe4;};'use strict';var Sequelize=require(_0x027c('0x0'));module[_0x027c('0x1')]={'name':{'type':Sequelize[_0x027c('0x2')]},'username':{'type':Sequelize[_0x027c('0x2')]},'password':{'type':Sequelize[_0x027c('0x2')]},'remoteUri':{'type':Sequelize[_0x027c('0x2')]},'tenantId':{'type':Sequelize[_0x027c('0x2')]},'clientId':{'type':Sequelize[_0x027c('0x2')]},'clientSecret':{'type':Sequelize[_0x027c('0x2')]},'serverUrl':{'type':Sequelize[_0x027c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f34=['exports','STRING','sequelize'];(function(_0x64b13e,_0x3431bd){var _0x4b79b3=function(_0x2e24af){while(--_0x2e24af){_0x64b13e['push'](_0x64b13e['shift']());}};_0x4b79b3(++_0x3431bd);}(_0x9f34,0x1c1));var _0x49f3=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x9f34[_0x224f65];return _0x3f921c;};'use strict';var Sequelize=require(_0x49f3('0x0'));module[_0x49f3('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x49f3('0x2')]},'password':{'type':Sequelize[_0x49f3('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x49f3('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x49f3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x49f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 274b486..7e2d88a 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 _0xd04b=['AccountId','channel','Descriptions','create','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','clientSecret','remoteUri','slice','substring','format','%s/api/data/v9.0/','POST','clientId','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','lastIndexOf','push','all','isNil','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Attributes(','Options','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','status','sendStatus','error','stack','name','send','Dynamics365Account','rawAttributes','type','key','map','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','options','body','find','params','getConfigurations','findOne','Dynamics365Configuration','addConfiguration'];(function(_0x22d8a6,_0x4383d6){var _0x1364e0=function(_0x8deee2){while(--_0x8deee2){_0x22d8a6['push'](_0x22d8a6['shift']());}};_0x1364e0(++_0x4383d6);}(_0xd04b,0x145));var _0xbd04=function(_0x48cefb,_0x36bffa){_0x48cefb=_0x48cefb-0x0;var _0x2f2881=_0xd04b[_0x48cefb];return _0x2f2881;};'use strict';var emlformat=require(_0xbd04('0x0'));var rimraf=require(_0xbd04('0x1'));var zipdir=require(_0xbd04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd04('0x3'));var moment=require('moment');var BPromise=require(_0xbd04('0x4'));var Mustache=require(_0xbd04('0x5'));var util=require(_0xbd04('0x6'));var path=require(_0xbd04('0x7'));var sox=require(_0xbd04('0x8'));var csv=require(_0xbd04('0x9'));var ejs=require(_0xbd04('0xa'));var fs=require('fs');var fs_extra=require(_0xbd04('0xb'));var _=require(_0xbd04('0xc'));var squel=require(_0xbd04('0xd'));var crypto=require(_0xbd04('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd04('0xf'));var toCsv=require(_0xbd04('0x9'));var querystring=require(_0xbd04('0x10'));var Papa=require(_0xbd04('0x11'));var Redis=require(_0xbd04('0x12'));var authService=require(_0xbd04('0x13'));var qs=require(_0xbd04('0x14'));var as=require(_0xbd04('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd04('0x16'))(_0xbd04('0x17'));var utils=require(_0xbd04('0x18'));var config=require(_0xbd04('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd04('0x1a'))['db'];var integrations=require(_0xbd04('0x1b'));function respondWithStatusCode(_0x8d337b,_0x57baa6){_0x57baa6=_0x57baa6||0xcc;return function(_0x48f257){if(_0x48f257){return _0x8d337b['sendStatus'](_0x57baa6);}return _0x8d337b['status'](_0x57baa6)[_0xbd04('0x1c')]();};}function respondWithResult(_0x291e94,_0x11e875){_0x11e875=_0x11e875||0xc8;return function(_0x4b6813){if(_0x4b6813){return _0x291e94['status'](_0x11e875)[_0xbd04('0x1d')](_0x4b6813);}};}function respondWithFilteredResult(_0x5d31e4,_0x2fe6bf){return function(_0x1b8bfc){if(_0x1b8bfc){var _0x5f4da1=typeof _0x2fe6bf['offset']==='undefined'&&typeof _0x2fe6bf[_0xbd04('0x1e')]===_0xbd04('0x1f');var _0x974adc=_0x1b8bfc[_0xbd04('0x20')];var _0x61161c=_0x5f4da1?0x0:_0x2fe6bf[_0xbd04('0x21')];var _0x48828f=_0x5f4da1?_0x1b8bfc['count']:_0x2fe6bf[_0xbd04('0x21')]+_0x2fe6bf[_0xbd04('0x1e')];var _0x499c23;if(_0x48828f>=_0x974adc){_0x48828f=_0x974adc;_0x499c23=0xc8;}else{_0x499c23=0xce;}_0x5d31e4['status'](_0x499c23);return _0x5d31e4['set'](_0xbd04('0x22'),_0x61161c+'-'+_0x48828f+'/'+_0x974adc)['json'](_0x1b8bfc);}return null;};}function patchUpdates(_0x3a9dea){return function(_0x4b5e90){try{jsonpatch[_0xbd04('0x23')](_0x4b5e90,_0x3a9dea,!![]);}catch(_0x330b06){return BPromise['reject'](_0x330b06);}return _0x4b5e90[_0xbd04('0x24')]();};}function saveUpdates(_0x270ce6,_0x5c7450){return function(_0x45ad2b){if(_0x45ad2b){return _0x45ad2b[_0xbd04('0x25')](_0x270ce6)[_0xbd04('0x26')](function(_0x457db8){return _0x457db8;});}return null;};}function removeEntity(_0x19d792,_0x5d880b){return function(_0x2ecadd){if(_0x2ecadd){return _0x2ecadd[_0xbd04('0x27')]()[_0xbd04('0x26')](function(){_0x19d792[_0xbd04('0x28')](0xcc)[_0xbd04('0x1c')]();});}};}function handleEntityNotFound(_0x527a2d,_0x37a10f){return function(_0x4d3917){if(!_0x4d3917){_0x527a2d[_0xbd04('0x29')](0x194);}return _0x4d3917;};}function handleError(_0x348416,_0x45923c){_0x45923c=_0x45923c||0x1f4;return function(_0x2eb172){logger[_0xbd04('0x2a')](_0x2eb172[_0xbd04('0x2b')]);if(_0x2eb172[_0xbd04('0x2c')]){delete _0x2eb172[_0xbd04('0x2c')];}_0x348416[_0xbd04('0x28')](_0x45923c)[_0xbd04('0x2d')](_0x2eb172);};}exports['index']=function(_0x57815b,_0x311374){var _0x2230f9={},_0xccbb8c={},_0x2f3947={'count':0x0,'rows':[]};var _0x1c322d=_['map'](db[_0xbd04('0x2e')][_0xbd04('0x2f')],function(_0x5c1dac){return{'name':_0x5c1dac['fieldName'],'type':_0x5c1dac[_0xbd04('0x30')][_0xbd04('0x31')]};});_0xccbb8c['model']=_[_0xbd04('0x32')](_0x1c322d,_0xbd04('0x2c'));_0xccbb8c['query']=_[_0xbd04('0x33')](_0x57815b[_0xbd04('0x34')]);_0xccbb8c[_0xbd04('0x35')]=_[_0xbd04('0x36')](_0xccbb8c['model'],_0xccbb8c[_0xbd04('0x34')]);_0x2230f9[_0xbd04('0x37')]=_[_0xbd04('0x36')](_0xccbb8c['model'],qs[_0xbd04('0x38')](_0x57815b[_0xbd04('0x34')][_0xbd04('0x38')]));_0x2230f9[_0xbd04('0x37')]=_0x2230f9[_0xbd04('0x37')][_0xbd04('0x39')]?_0x2230f9[_0xbd04('0x37')]:_0xccbb8c[_0xbd04('0x3a')];if(!_0x57815b[_0xbd04('0x34')][_0xbd04('0x3b')](_0xbd04('0x3c'))){_0x2230f9[_0xbd04('0x1e')]=qs[_0xbd04('0x1e')](_0x57815b['query'][_0xbd04('0x1e')]);_0x2230f9[_0xbd04('0x21')]=qs[_0xbd04('0x21')](_0x57815b[_0xbd04('0x34')][_0xbd04('0x21')]);}_0x2230f9[_0xbd04('0x3d')]=qs[_0xbd04('0x3e')](_0x57815b[_0xbd04('0x34')][_0xbd04('0x3e')]);_0x2230f9[_0xbd04('0x3f')]=qs['filters'](_[_0xbd04('0x40')](_0x57815b[_0xbd04('0x34')],_0xccbb8c[_0xbd04('0x35')]),_0x1c322d);if(_0x57815b[_0xbd04('0x34')][_0xbd04('0x41')]){_0x2230f9[_0xbd04('0x3f')]=_[_0xbd04('0x42')](_0x2230f9[_0xbd04('0x3f')],{'$or':_[_0xbd04('0x32')](_0x1c322d,function(_0x12f0ba){if(_0x12f0ba[_0xbd04('0x30')]!==_0xbd04('0x43')){var _0x512720={};_0x512720[_0x12f0ba[_0xbd04('0x2c')]]={'$like':'%'+_0x57815b['query'][_0xbd04('0x41')]+'%'};return _0x512720;}})});}_0x2230f9=_[_0xbd04('0x42')]({},_0x2230f9,_0x57815b['options']);var _0x5319c6={'where':_0x2230f9[_0xbd04('0x3f')]};return db['Dynamics365Account'][_0xbd04('0x20')](_0x5319c6)[_0xbd04('0x26')](function(_0x482c09){_0x2f3947[_0xbd04('0x20')]=_0x482c09;if(_0x57815b[_0xbd04('0x34')]['includeAll']){_0x2230f9[_0xbd04('0x44')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xbd04('0x45')](_0x2230f9);})[_0xbd04('0x26')](function(_0x4a14d6){_0x2f3947[_0xbd04('0x46')]=_0x4a14d6;return _0x2f3947;})['then'](respondWithFilteredResult(_0x311374,_0x2230f9))[_0xbd04('0x47')](handleError(_0x311374,null));};exports['show']=function(_0x3f3a2b,_0x1971fe){var _0x4d5873={'raw':![],'where':{'id':_0x3f3a2b['params']['id']}},_0x15f5df={};_0x15f5df['model']=_[_0xbd04('0x33')](db[_0xbd04('0x2e')]['rawAttributes']);_0x15f5df[_0xbd04('0x34')]=_['keys'](_0x3f3a2b[_0xbd04('0x34')]);_0x15f5df[_0xbd04('0x35')]=_[_0xbd04('0x36')](_0x15f5df[_0xbd04('0x3a')],_0x15f5df[_0xbd04('0x34')]);_0x4d5873[_0xbd04('0x37')]=_['intersection'](_0x15f5df[_0xbd04('0x3a')],qs['fields'](_0x3f3a2b[_0xbd04('0x34')][_0xbd04('0x38')]));_0x4d5873[_0xbd04('0x37')]=_0x4d5873[_0xbd04('0x37')][_0xbd04('0x39')]?_0x4d5873[_0xbd04('0x37')]:_0x15f5df[_0xbd04('0x3a')];if(_0x3f3a2b[_0xbd04('0x34')][_0xbd04('0x48')]){_0x4d5873[_0xbd04('0x44')]=[{'all':!![]}];}_0x4d5873=_[_0xbd04('0x42')]({},_0x4d5873,_0x3f3a2b[_0xbd04('0x49')]);return db[_0xbd04('0x2e')]['find'](_0x4d5873)[_0xbd04('0x26')](handleEntityNotFound(_0x1971fe,null))[_0xbd04('0x26')](respondWithResult(_0x1971fe,null))[_0xbd04('0x47')](handleError(_0x1971fe,null));};exports['create']=function(_0x5ced26,_0x4eeda9){return db[_0xbd04('0x2e')]['create'](_0x5ced26[_0xbd04('0x4a')],{})[_0xbd04('0x26')](respondWithResult(_0x4eeda9,0xc9))[_0xbd04('0x47')](handleError(_0x4eeda9,null));};exports['update']=function(_0xfafe46,_0x10ef54){if(_0xfafe46[_0xbd04('0x4a')]['id']){delete _0xfafe46[_0xbd04('0x4a')]['id'];}return db[_0xbd04('0x2e')]['find']({'where':{'id':_0xfafe46['params']['id']}})[_0xbd04('0x26')](handleEntityNotFound(_0x10ef54,null))[_0xbd04('0x26')](saveUpdates(_0xfafe46['body'],null))['then'](respondWithResult(_0x10ef54,null))[_0xbd04('0x47')](handleError(_0x10ef54,null));};exports[_0xbd04('0x27')]=function(_0x519c83,_0x1e9365){return db['Dynamics365Account'][_0xbd04('0x4b')]({'where':{'id':_0x519c83[_0xbd04('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e9365,null))[_0xbd04('0x26')](removeEntity(_0x1e9365,null))[_0xbd04('0x47')](handleError(_0x1e9365,null));};exports[_0xbd04('0x4d')]=function(_0xaf3ff4,_0x2b14a4,_0xb9dad8){var _0x2afe2e={};var _0x30a575={};var _0x22ee46;var _0x18f536;return db[_0xbd04('0x2e')][_0xbd04('0x4e')]({'where':{'id':_0xaf3ff4['params']['id']}})[_0xbd04('0x26')](handleEntityNotFound(_0x2b14a4,null))[_0xbd04('0x26')](function(_0x1f0ae0){if(_0x1f0ae0){_0x22ee46=_0x1f0ae0;_0x30a575[_0xbd04('0x3a')]=_['keys'](db[_0xbd04('0x4f')][_0xbd04('0x2f')]);_0x30a575[_0xbd04('0x34')]=_[_0xbd04('0x33')](_0xaf3ff4[_0xbd04('0x34')]);_0x30a575['filters']=_[_0xbd04('0x36')](_0x30a575['model'],_0x30a575['query']);_0x2afe2e[_0xbd04('0x37')]=_[_0xbd04('0x36')](_0x30a575['model'],qs['fields'](_0xaf3ff4[_0xbd04('0x34')][_0xbd04('0x38')]));_0x2afe2e[_0xbd04('0x37')]=_0x2afe2e[_0xbd04('0x37')][_0xbd04('0x39')]?_0x2afe2e[_0xbd04('0x37')]:_0x30a575[_0xbd04('0x3a')];_0x2afe2e[_0xbd04('0x3d')]=qs['sort'](_0xaf3ff4[_0xbd04('0x34')][_0xbd04('0x3e')]);_0x2afe2e['where']=qs['filters'](_['pick'](_0xaf3ff4[_0xbd04('0x34')],_0x30a575[_0xbd04('0x35')]));if(_0xaf3ff4['query'][_0xbd04('0x41')]){_0x2afe2e[_0xbd04('0x3f')]=_[_0xbd04('0x42')](_0x2afe2e[_0xbd04('0x3f')],{'$or':_[_0xbd04('0x32')](_0x2afe2e[_0xbd04('0x37')],function(_0x3ee684){var _0xbd262a={};_0xbd262a[_0x3ee684]={'$like':'%'+_0xaf3ff4[_0xbd04('0x34')]['filter']+'%'};return _0xbd262a;})});}_0x2afe2e=_[_0xbd04('0x42')]({},_0x2afe2e,_0xaf3ff4[_0xbd04('0x49')]);return _0x22ee46[_0xbd04('0x4d')](_0x2afe2e);}})[_0xbd04('0x26')](function(_0x3244fe){if(_0x3244fe){_0x18f536=_0x3244fe[_0xbd04('0x39')];if(!_0xaf3ff4['query'][_0xbd04('0x3b')](_0xbd04('0x3c'))){_0x2afe2e[_0xbd04('0x1e')]=qs[_0xbd04('0x1e')](_0xaf3ff4[_0xbd04('0x34')][_0xbd04('0x1e')]);_0x2afe2e['offset']=qs[_0xbd04('0x21')](_0xaf3ff4[_0xbd04('0x34')][_0xbd04('0x21')]);}return _0x22ee46[_0xbd04('0x4d')](_0x2afe2e);}})[_0xbd04('0x26')](function(_0x5615a2){if(_0x5615a2){return _0x5615a2?{'count':_0x18f536,'rows':_0x5615a2}:null;}})['then'](respondWithResult(_0x2b14a4,null))[_0xbd04('0x47')](handleError(_0x2b14a4,null));};exports[_0xbd04('0x50')]=function(_0x1caa2c,_0x45bce2,_0x56b6e8){if(_0x1caa2c['body']['id']){delete _0x1caa2c[_0xbd04('0x4a')]['id'];}return db[_0xbd04('0x2e')][_0xbd04('0x4e')]({'where':{'id':_0x1caa2c[_0xbd04('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45bce2,null))[_0xbd04('0x26')](function(_0x50fea4){if(_0x50fea4){_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x51')]=_0x50fea4['id'];_0x1caa2c[_0xbd04('0x4a')]['Subjects']=integrations['getSubjects'](_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x52')],_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x30')]);_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x53')]=integrations['getDescriptions'](_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x52')],_0x1caa2c[_0xbd04('0x4a')][_0xbd04('0x30')]);return db['Dynamics365Configuration'][_0xbd04('0x54')](_0x1caa2c[_0xbd04('0x4a')],{'include':[{'model':db[_0xbd04('0x55')],'as':'Subjects'},{'model':db[_0xbd04('0x55')],'as':_0xbd04('0x53')}]});}return null;})[_0xbd04('0x26')](respondWithResult(_0x45bce2,null))['catch'](handleError(_0x45bce2,null));};exports[_0xbd04('0x56')]=function(_0x46bfd5,_0x8daa4d,_0x4765a9){var _0x55de5d=_0x46bfd5[_0xbd04('0x34')][_0xbd04('0x57')];var _0x293006=_0x55de5d===_0xbd04('0x58')?'Incident':_0xbd04('0x59');var _0x3f5075='';var _0x5f4877='';var _0x4c9c30='';var _0x652c8='';var _0x1fd3a7='';var _0x5c592f='';var _0x19184f='';var _0x5bab18='';var _0x3eeb2d=[_0xbd04('0x5a'),'description','customerid','ownerid','caseorigincode','subject',_0xbd04('0x5b'),_0xbd04('0x5c'),'directioncode',_0xbd04('0x5d')];var _0x117ba4=[_0xbd04('0x5e'),_0xbd04('0x5f'),'actualserviceunits',_0xbd04('0x60'),_0xbd04('0x61'),_0xbd04('0x62'),_0xbd04('0x63'),_0xbd04('0x64'),_0xbd04('0x65'),'createdbyexternalpartyyominame',_0xbd04('0x66'),_0xbd04('0x67'),_0xbd04('0x68'),_0xbd04('0x69'),_0xbd04('0x6a'),_0xbd04('0x6b'),_0xbd04('0x6c'),_0xbd04('0x6d'),_0xbd04('0x6e'),'entitlementidname',_0xbd04('0x6f'),_0xbd04('0x70'),_0xbd04('0x71'),_0xbd04('0x72'),'firstresponsebykpiidname',_0xbd04('0x73'),_0xbd04('0x74'),'influencescore',_0xbd04('0x75'),_0xbd04('0x76'),_0xbd04('0x77'),_0xbd04('0x78'),_0xbd04('0x79'),_0xbd04('0x7a'),_0xbd04('0x7b'),_0xbd04('0x7c'),_0xbd04('0x7d'),'modifiedonbehalfbyyominame',_0xbd04('0x7e'),_0xbd04('0x7f'),_0xbd04('0x80'),_0xbd04('0x81'),_0xbd04('0x82'),'owneridname',_0xbd04('0x83'),'owneridyominame',_0xbd04('0x84'),'primarycontactidname',_0xbd04('0x85'),_0xbd04('0x86'),_0xbd04('0x87'),_0xbd04('0x88'),'resolveby','resolvebykpiidname','responseby',_0xbd04('0x89'),_0xbd04('0x8a'),_0xbd04('0x8b'),_0xbd04('0x8c'),_0xbd04('0x8d'),_0xbd04('0x8e'),_0xbd04('0x8f'),_0xbd04('0x90'),_0xbd04('0x91'),'ticketnumber',_0xbd04('0x92'),_0xbd04('0x93'),_0xbd04('0x94'),_0xbd04('0x95'),_0xbd04('0x96')];var _0x163767=_0x3eeb2d[_0xbd04('0x97')](_0x117ba4);return db['Dynamics365Account'][_0xbd04('0x4e')]({'where':{'id':_0x46bfd5[_0xbd04('0x4c')]['id']},'attributes':['id',_0xbd04('0x98'),'password','remoteUri','tenantId','clientId',_0xbd04('0x99')]})[_0xbd04('0x26')](handleEntityNotFound(_0x8daa4d,null))[_0xbd04('0x26')](function(_0x2a2678){if(_0x2a2678){_0x5bab18=_0x2a2678[_0xbd04('0x9a')];var _0x2109f1=_0x5bab18[_0xbd04('0x9b')](-0x1);if(_0x2109f1==='/'){_0x5bab18=_0x5bab18[_0xbd04('0x9c')](0x0,_0x5bab18['lastIndexOf'](_0x2109f1));}_0x19184f=util[_0xbd04('0x9d')](_0xbd04('0x9e'),_0x5bab18);var _0x4d2fee={'method':_0xbd04('0x9f'),'uri':'https://login.microsoftonline.com/'+_0x2a2678['tenantId']+'/oauth2/token','form':{'client_id':_0x2a2678[_0xbd04('0xa0')],'resource':_0x5bab18,'username':_0x2a2678['username'],'password':_0x2a2678[_0xbd04('0xa1')],'grant_type':_0xbd04('0xa1'),'client_secret':_0x2a2678[_0xbd04('0x99')]},'json':!![]};return rp(_0x4d2fee);}})[_0xbd04('0x26')](function(_0x1e5893){_0x5c592f=_0x1e5893[_0xbd04('0xa2')];var _0x39eb28={'method':_0xbd04('0xa3'),'uri':encodeURI(_0x19184f+_0xbd04('0xa4')+_0x293006+'\x27'),'headers':{'Authorization':_0xbd04('0xa5')+_0x5c592f,'If-None-Match':null,'OData-Version':_0xbd04('0xa6')},'json':!![]};return rp(_0x39eb28);})[_0xbd04('0x26')](function(_0x1a77cd){var _0x2f1d5c=_0x1a77cd['value'][0x0];var _0x2227d1=_0x2f1d5c[_0xbd04('0xa7')];var _0x32fa0f={'method':_0xbd04('0xa3'),'uri':_0x19184f+_0xbd04('0xa8')+_0x2227d1+_0xbd04('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x5c592f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32fa0f);})[_0xbd04('0x26')](function(_0x409f13){_0x3f5075=_0x409f13;_0x5f4877=_0x3f5075['Attributes'];_0x5f4877=_[_0xbd04('0xaa')](_0x5f4877,function(_0x59e888){return!_0x163767[_0xbd04('0xab')](_0x59e888[_0xbd04('0xac')]);});var _0x43c0e2=[];var _0x112046=[];_0x5f4877[_0xbd04('0xad')](function(_0x2c1781){if(_0x2c1781['@odata.type']){var _0x1c9f5f=_0x2c1781['@odata.type']['substring'](_0x2c1781['@odata.type'][_0xbd04('0xae')]('.')+0x1);if(_0x1c9f5f==='PicklistAttributeMetadata'){_0x43c0e2[_0xbd04('0xaf')](getSelectList(_0x19184f,_0x55de5d,_0x112046,_0x3f5075['MetadataId'],_0x2c1781[_0xbd04('0xa7')],_0x5c592f));}}});return Promise[_0xbd04('0xb0')](_0x43c0e2);})[_0xbd04('0x26')](function(_0x39f6ff){_0x4c9c30=_0x39f6ff[0x0];var _0x5e479f=[];var _0x469cd3=[];_0x5f4877['forEach'](function(_0x36c308){if(!_[_0xbd04('0xb1')](_0x36c308[_0xbd04('0xb2')])){var _0x182143=_0x36c308['@odata.type'][_0xbd04('0x9c')](_0x36c308['@odata.type']['lastIndexOf']('.')+0x1);if(_0x182143===_0xbd04('0xb3')){_0x5e479f['push'](getBooleanList(_0x19184f,_0x55de5d,_0x469cd3,_0x3f5075['MetadataId'],_0x36c308[_0xbd04('0xa7')],_0x5c592f));}}});return Promise[_0xbd04('0xb0')](_0x5e479f);})[_0xbd04('0x26')](function(_0x22d53a){_0x652c8=_0x22d53a[0x0];var _0x3f4369=[];var _0x124c9c=[];_0x5f4877['forEach'](function(_0xcd6e){if(_0xcd6e[_0xbd04('0xb2')]){var _0x33ad13=_0xcd6e[_0xbd04('0xb2')][_0xbd04('0x9c')](_0xcd6e['@odata.type'][_0xbd04('0xae')]('.')+0x1);if(_0x33ad13===_0xbd04('0xb4')||_0x33ad13==='DoubleAttributeMetadata'||_0x33ad13===_0xbd04('0xb5')||_0x33ad13==='IntegerAttributeMetadata'||_0x33ad13===_0xbd04('0xb6')||_0x33ad13===_0xbd04('0xb7')||_0x33ad13===_0xbd04('0xb8')||_0x33ad13===_0xbd04('0xb9')||_0x33ad13===_0xbd04('0xba')||_0x33ad13==='DecimalAttributeMetadata'){_0x3f4369[_0xbd04('0xaf')](getInputList(_0x19184f,_0x55de5d,_0x33ad13,_0x124c9c,_0x3f5075[_0xbd04('0xa7')],_0xcd6e[_0xbd04('0xa7')],_0x5c592f));}}});return Promise[_0xbd04('0xb0')](_0x3f4369);})[_0xbd04('0x26')](function(_0x2f2532){_0x1fd3a7=_0x2f2532[0x0];var _0x54f5de=_0x4c9c30[_0xbd04('0x97')](_0x652c8)[_0xbd04('0x97')](_0x1fd3a7);var _0x9f8fd0={'count':_0x54f5de[_0xbd04('0x39')],'rows':_0x54f5de};return _0x9f8fd0;})[_0xbd04('0x26')](respondWithResult(_0x8daa4d,null))[_0xbd04('0x47')](function(_0x4d25e1){var _0x2fa1e7=_0x46bfd5[_0xbd04('0x34')][_0xbd04('0xbb')]?0x1f4:_0x4d25e1['statusCode']||0x1f4;logger[_0xbd04('0x2a')](_0x4d25e1[_0xbd04('0x2b')]);delete _0x4d25e1[_0xbd04('0x2c')];if(_0x2fa1e7===0x191){_0x2fa1e7=0x190;}_0x8daa4d[_0xbd04('0x28')](_0x2fa1e7)[_0xbd04('0x2d')](_0x46bfd5[_0xbd04('0x34')]['test']?{'message':_0xbd04('0xbc'),'statusCode':_0x4d25e1[_0xbd04('0xbd')]}:_0x4d25e1);});};function getSelectList(_0x3a0ae2,_0x3dbe77,_0x4327a2,_0x43ca41,_0x52311d,_0x5ad828){var _0x4e2bf7={'method':'GET','uri':_0x3a0ae2+'EntityDefinitions('+_0x43ca41+_0xbd04('0xbe')+_0x52311d+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x5ad828,'If-None-Match':null,'OData-Version':_0xbd04('0xa6')},'json':!![]};return rp(_0x4e2bf7)[_0xbd04('0x26')](function(_0x2f81f8){var _0x55204d=[];var _0x4e1e8e=_0x2f81f8['OptionSet'][_0xbd04('0xbf')];_0x4e1e8e[_0xbd04('0xad')](function(_0x1839d0){_0x55204d['push']({'name':_0x1839d0['Label'][_0xbd04('0xc0')][_0xbd04('0xc1')],'value':String(_0x1839d0[_0xbd04('0xc2')])});});var _0x2cfb84={'id':_0x3dbe77+'_'+_0x2f81f8[_0xbd04('0xac')],'name':_0x2f81f8['DisplayName'][_0xbd04('0xc0')][_0xbd04('0xc1')],'custom':![],'options':_0x55204d};_0x4327a2[_0xbd04('0xaf')](_0x2cfb84);return _0x4327a2;});}function getBooleanList(_0x3ceca0,_0x8a082,_0x3041ef,_0x4ecf02,_0x5381b4,_0x663cff){var _0x106b63={'method':'GET','uri':_0x3ceca0+_0xbd04('0xa8')+_0x4ecf02+_0xbd04('0xbe')+_0x5381b4+_0xbd04('0xc3'),'headers':{'Authorization':'Bearer\x20'+_0x663cff,'If-None-Match':null,'OData-Version':_0xbd04('0xa6')},'json':!![]};return rp(_0x106b63)[_0xbd04('0x26')](function(_0xd7a318){var _0x372dd3=[];_0x372dd3['push']({'name':_0xd7a318[_0xbd04('0xc4')][_0xbd04('0xc5')][_0xbd04('0xc1')][_0xbd04('0xc0')]['Label'],'value':_0xbd04('0xc6')},{'name':_0xd7a318[_0xbd04('0xc4')][_0xbd04('0xc7')]['Label'][_0xbd04('0xc0')][_0xbd04('0xc1')],'value':_0xbd04('0xc8')});var _0x2b37cc={'id':_0x8a082+'_'+_0xd7a318['LogicalName'],'name':_0xd7a318[_0xbd04('0xc9')][_0xbd04('0xc0')][_0xbd04('0xc1')],'custom':![],'options':_0x372dd3};_0x3041ef['push'](_0x2b37cc);return _0x3041ef;});}function getInputList(_0x36079e,_0x4b1b3a,_0x511a1b,_0xef3d6,_0x3107c6,_0x3cb6b3,_0x1f0616){var _0x50f9c8={'method':_0xbd04('0xa3'),'uri':_0x36079e+'EntityDefinitions('+_0x3107c6+_0xbd04('0xbe')+_0x3cb6b3+_0xbd04('0xca')+_0x511a1b+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbd04('0xa5')+_0x1f0616,'If-None-Match':null,'OData-Version':_0xbd04('0xa6')},'json':!![]};return rp(_0x50f9c8)[_0xbd04('0x26')](function(_0x5c4f2e){var _0x24211a={'id':_0x4b1b3a+'_'+_0x5c4f2e['LogicalName'],'name':_0x5c4f2e[_0xbd04('0xc9')][_0xbd04('0xc0')]?_0x5c4f2e[_0xbd04('0xc9')][_0xbd04('0xc0')][_0xbd04('0xc1')]:_0x5c4f2e[_0xbd04('0xac')],'custom':![],'options':[]};_0xef3d6[_0xbd04('0xaf')](_0x24211a);return _0xef3d6;});} \ No newline at end of file +var _0x668b=['accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','username','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','error','name','map','Dynamics365Account','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','update','params','findOne','Dynamics365Configuration','order','pick','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','ownerid','subject','phonenumber','phonecall_activity_parties'];(function(_0x30108a,_0x230fe2){var _0xdb40c4=function(_0x5d0040){while(--_0x5d0040){_0x30108a['push'](_0x30108a['shift']());}};_0xdb40c4(++_0x230fe2);}(_0x668b,0x140));var _0xb668=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x668b[_0x3f88bc];return _0x4df1c4;};'use strict';var emlformat=require(_0xb668('0x0'));var rimraf=require(_0xb668('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb668('0x2'));var rp=require(_0xb668('0x3'));var moment=require('moment');var BPromise=require(_0xb668('0x4'));var Mustache=require('mustache');var util=require(_0xb668('0x5'));var path=require(_0xb668('0x6'));var sox=require(_0xb668('0x7'));var csv=require('to-csv');var ejs=require(_0xb668('0x8'));var fs=require('fs');var fs_extra=require(_0xb668('0x9'));var _=require(_0xb668('0xa'));var squel=require(_0xb668('0xb'));var crypto=require(_0xb668('0xc'));var jsforce=require(_0xb668('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb668('0xe'));var querystring=require(_0xb668('0xf'));var Papa=require(_0xb668('0x10'));var Redis=require(_0xb668('0x11'));var authService=require(_0xb668('0x12'));var qs=require(_0xb668('0x13'));var as=require(_0xb668('0x14'));var hardwareService=require(_0xb668('0x15'));var logger=require('../../config/logger')(_0xb668('0x16'));var utils=require(_0xb668('0x17'));var config=require(_0xb668('0x18'));var licenseUtil=require(_0xb668('0x19'));var db=require(_0xb668('0x1a'))['db'];var integrations=require(_0xb668('0x1b'));function respondWithStatusCode(_0x1d111a,_0x10ed24){_0x10ed24=_0x10ed24||0xcc;return function(_0x3e5be0){if(_0x3e5be0){return _0x1d111a[_0xb668('0x1c')](_0x10ed24);}return _0x1d111a[_0xb668('0x1d')](_0x10ed24)[_0xb668('0x1e')]();};}function respondWithResult(_0x3aed25,_0xd0450f){_0xd0450f=_0xd0450f||0xc8;return function(_0x2ec706){if(_0x2ec706){return _0x3aed25[_0xb668('0x1d')](_0xd0450f)[_0xb668('0x1f')](_0x2ec706);}};}function respondWithFilteredResult(_0x222cad,_0x4fa32a){return function(_0x4a755b){if(_0x4a755b){var _0xd3e39f=typeof _0x4fa32a[_0xb668('0x20')]==='undefined'&&typeof _0x4fa32a[_0xb668('0x21')]==='undefined';var _0x30742a=_0x4a755b[_0xb668('0x22')];var _0x5438ff=_0xd3e39f?0x0:_0x4fa32a[_0xb668('0x20')];var _0x18e9c1=_0xd3e39f?_0x4a755b['count']:_0x4fa32a[_0xb668('0x20')]+_0x4fa32a['limit'];var _0x12fb3f;if(_0x18e9c1>=_0x30742a){_0x18e9c1=_0x30742a;_0x12fb3f=0xc8;}else{_0x12fb3f=0xce;}_0x222cad[_0xb668('0x1d')](_0x12fb3f);return _0x222cad[_0xb668('0x23')](_0xb668('0x24'),_0x5438ff+'-'+_0x18e9c1+'/'+_0x30742a)['json'](_0x4a755b);}return null;};}function patchUpdates(_0x2b7f96){return function(_0xfe4595){try{jsonpatch[_0xb668('0x25')](_0xfe4595,_0x2b7f96,!![]);}catch(_0x52de83){return BPromise['reject'](_0x52de83);}return _0xfe4595[_0xb668('0x26')]();};}function saveUpdates(_0x1e5620,_0x517eee){return function(_0x61de4a){if(_0x61de4a){return _0x61de4a['update'](_0x1e5620)[_0xb668('0x27')](function(_0x4bd365){return _0x4bd365;});}return null;};}function removeEntity(_0x3f4745,_0x1e1c94){return function(_0x3f84c7){if(_0x3f84c7){return _0x3f84c7[_0xb668('0x28')]()[_0xb668('0x27')](function(){_0x3f4745[_0xb668('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23084d,_0x10d767){return function(_0x2ab8c2){if(!_0x2ab8c2){_0x23084d['sendStatus'](0x194);}return _0x2ab8c2;};}function handleError(_0x5e0cee,_0xe62fce){_0xe62fce=_0xe62fce||0x1f4;return function(_0x2a826d){logger[_0xb668('0x29')](_0x2a826d['stack']);if(_0x2a826d[_0xb668('0x2a')]){delete _0x2a826d[_0xb668('0x2a')];}_0x5e0cee[_0xb668('0x1d')](_0xe62fce)['send'](_0x2a826d);};}exports['index']=function(_0x12919c,_0x2619a4){var _0x589c58={},_0x2e5857={},_0x1791ff={'count':0x0,'rows':[]};var _0x26918a=_[_0xb668('0x2b')](db[_0xb668('0x2c')]['rawAttributes'],function(_0x138ee5){return{'name':_0x138ee5[_0xb668('0x2d')],'type':_0x138ee5['type'][_0xb668('0x2e')]};});_0x2e5857['model']=_[_0xb668('0x2b')](_0x26918a,_0xb668('0x2a'));_0x2e5857[_0xb668('0x2f')]=_[_0xb668('0x30')](_0x12919c[_0xb668('0x2f')]);_0x2e5857[_0xb668('0x31')]=_[_0xb668('0x32')](_0x2e5857[_0xb668('0x33')],_0x2e5857[_0xb668('0x2f')]);_0x589c58['attributes']=_[_0xb668('0x32')](_0x2e5857[_0xb668('0x33')],qs[_0xb668('0x34')](_0x12919c['query'][_0xb668('0x34')]));_0x589c58[_0xb668('0x35')]=_0x589c58[_0xb668('0x35')][_0xb668('0x36')]?_0x589c58['attributes']:_0x2e5857[_0xb668('0x33')];if(!_0x12919c[_0xb668('0x2f')][_0xb668('0x37')](_0xb668('0x38'))){_0x589c58[_0xb668('0x21')]=qs[_0xb668('0x21')](_0x12919c[_0xb668('0x2f')]['limit']);_0x589c58[_0xb668('0x20')]=qs[_0xb668('0x20')](_0x12919c['query'][_0xb668('0x20')]);}_0x589c58['order']=qs['sort'](_0x12919c[_0xb668('0x2f')][_0xb668('0x39')]);_0x589c58['where']=qs[_0xb668('0x31')](_['pick'](_0x12919c[_0xb668('0x2f')],_0x2e5857['filters']),_0x26918a);if(_0x12919c['query'][_0xb668('0x3a')]){_0x589c58[_0xb668('0x3b')]=_['merge'](_0x589c58['where'],{'$or':_[_0xb668('0x2b')](_0x26918a,function(_0x32bc61){if(_0x32bc61[_0xb668('0x3c')]!==_0xb668('0x3d')){var _0xdd79f5={};_0xdd79f5[_0x32bc61['name']]={'$like':'%'+_0x12919c['query'][_0xb668('0x3a')]+'%'};return _0xdd79f5;}})});}_0x589c58=_[_0xb668('0x3e')]({},_0x589c58,_0x12919c[_0xb668('0x3f')]);var _0x38d9c9={'where':_0x589c58[_0xb668('0x3b')]};return db[_0xb668('0x2c')]['count'](_0x38d9c9)['then'](function(_0x2715a4){_0x1791ff[_0xb668('0x22')]=_0x2715a4;if(_0x12919c[_0xb668('0x2f')][_0xb668('0x40')]){_0x589c58[_0xb668('0x41')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xb668('0x42')](_0x589c58);})[_0xb668('0x27')](function(_0x503b33){_0x1791ff[_0xb668('0x43')]=_0x503b33;return _0x1791ff;})[_0xb668('0x27')](respondWithFilteredResult(_0x2619a4,_0x589c58))[_0xb668('0x44')](handleError(_0x2619a4,null));};exports[_0xb668('0x45')]=function(_0x5273e8,_0x583a61){var _0x4b7192={'raw':![],'where':{'id':_0x5273e8['params']['id']}},_0x311c59={};_0x311c59['model']=_['keys'](db['Dynamics365Account'][_0xb668('0x46')]);_0x311c59['query']=_[_0xb668('0x30')](_0x5273e8[_0xb668('0x2f')]);_0x311c59[_0xb668('0x31')]=_[_0xb668('0x32')](_0x311c59[_0xb668('0x33')],_0x311c59['query']);_0x4b7192[_0xb668('0x35')]=_[_0xb668('0x32')](_0x311c59[_0xb668('0x33')],qs[_0xb668('0x34')](_0x5273e8[_0xb668('0x2f')][_0xb668('0x34')]));_0x4b7192[_0xb668('0x35')]=_0x4b7192[_0xb668('0x35')][_0xb668('0x36')]?_0x4b7192[_0xb668('0x35')]:_0x311c59[_0xb668('0x33')];if(_0x5273e8['query'][_0xb668('0x40')]){_0x4b7192[_0xb668('0x41')]=[{'all':!![]}];}_0x4b7192=_[_0xb668('0x3e')]({},_0x4b7192,_0x5273e8['options']);return db['Dynamics365Account'][_0xb668('0x47')](_0x4b7192)['then'](handleEntityNotFound(_0x583a61,null))[_0xb668('0x27')](respondWithResult(_0x583a61,null))['catch'](handleError(_0x583a61,null));};exports['create']=function(_0x4e2853,_0x470415){return db[_0xb668('0x2c')]['create'](_0x4e2853[_0xb668('0x48')],{})[_0xb668('0x27')](respondWithResult(_0x470415,0xc9))[_0xb668('0x44')](handleError(_0x470415,null));};exports[_0xb668('0x49')]=function(_0x16d06f,_0x36926a){if(_0x16d06f[_0xb668('0x48')]['id']){delete _0x16d06f[_0xb668('0x48')]['id'];}return db[_0xb668('0x2c')][_0xb668('0x47')]({'where':{'id':_0x16d06f['params']['id']}})[_0xb668('0x27')](handleEntityNotFound(_0x36926a,null))[_0xb668('0x27')](saveUpdates(_0x16d06f[_0xb668('0x48')],null))[_0xb668('0x27')](respondWithResult(_0x36926a,null))[_0xb668('0x44')](handleError(_0x36926a,null));};exports[_0xb668('0x28')]=function(_0x381694,_0x1bff79){return db[_0xb668('0x2c')]['find']({'where':{'id':_0x381694[_0xb668('0x4a')]['id']}})[_0xb668('0x27')](handleEntityNotFound(_0x1bff79,null))[_0xb668('0x27')](removeEntity(_0x1bff79,null))['catch'](handleError(_0x1bff79,null));};exports['getConfigurations']=function(_0x25c2a0,_0x3bab67,_0x36222a){var _0x577964={};var _0x17054f={};var _0x5ad4cd;var _0x51a5d3;return db[_0xb668('0x2c')][_0xb668('0x4b')]({'where':{'id':_0x25c2a0[_0xb668('0x4a')]['id']}})[_0xb668('0x27')](handleEntityNotFound(_0x3bab67,null))[_0xb668('0x27')](function(_0x42b306){if(_0x42b306){_0x5ad4cd=_0x42b306;_0x17054f[_0xb668('0x33')]=_[_0xb668('0x30')](db[_0xb668('0x4c')][_0xb668('0x46')]);_0x17054f[_0xb668('0x2f')]=_[_0xb668('0x30')](_0x25c2a0[_0xb668('0x2f')]);_0x17054f[_0xb668('0x31')]=_[_0xb668('0x32')](_0x17054f[_0xb668('0x33')],_0x17054f[_0xb668('0x2f')]);_0x577964[_0xb668('0x35')]=_[_0xb668('0x32')](_0x17054f[_0xb668('0x33')],qs[_0xb668('0x34')](_0x25c2a0[_0xb668('0x2f')][_0xb668('0x34')]));_0x577964[_0xb668('0x35')]=_0x577964[_0xb668('0x35')][_0xb668('0x36')]?_0x577964[_0xb668('0x35')]:_0x17054f[_0xb668('0x33')];_0x577964[_0xb668('0x4d')]=qs[_0xb668('0x39')](_0x25c2a0['query'][_0xb668('0x39')]);_0x577964[_0xb668('0x3b')]=qs[_0xb668('0x31')](_[_0xb668('0x4e')](_0x25c2a0[_0xb668('0x2f')],_0x17054f[_0xb668('0x31')]));if(_0x25c2a0[_0xb668('0x2f')][_0xb668('0x3a')]){_0x577964[_0xb668('0x3b')]=_[_0xb668('0x3e')](_0x577964[_0xb668('0x3b')],{'$or':_[_0xb668('0x2b')](_0x577964[_0xb668('0x35')],function(_0x4b88e5){var _0x263040={};_0x263040[_0x4b88e5]={'$like':'%'+_0x25c2a0[_0xb668('0x2f')]['filter']+'%'};return _0x263040;})});}_0x577964=_[_0xb668('0x3e')]({},_0x577964,_0x25c2a0[_0xb668('0x3f')]);return _0x5ad4cd['getConfigurations'](_0x577964);}})[_0xb668('0x27')](function(_0xd9be5b){if(_0xd9be5b){_0x51a5d3=_0xd9be5b['length'];if(!_0x25c2a0[_0xb668('0x2f')]['hasOwnProperty'](_0xb668('0x38'))){_0x577964[_0xb668('0x21')]=qs['limit'](_0x25c2a0[_0xb668('0x2f')][_0xb668('0x21')]);_0x577964[_0xb668('0x20')]=qs[_0xb668('0x20')](_0x25c2a0[_0xb668('0x2f')][_0xb668('0x20')]);}return _0x5ad4cd[_0xb668('0x4f')](_0x577964);}})[_0xb668('0x27')](function(_0x19a228){if(_0x19a228){return _0x19a228?{'count':_0x51a5d3,'rows':_0x19a228}:null;}})['then'](respondWithResult(_0x3bab67,null))[_0xb668('0x44')](handleError(_0x3bab67,null));};exports[_0xb668('0x50')]=function(_0x2382c9,_0x2497b7,_0xb759e6){if(_0x2382c9['body']['id']){delete _0x2382c9[_0xb668('0x48')]['id'];}return db[_0xb668('0x2c')][_0xb668('0x4b')]({'where':{'id':_0x2382c9['params']['id']}})[_0xb668('0x27')](handleEntityNotFound(_0x2497b7,null))[_0xb668('0x27')](function(_0x409c8b){if(_0x409c8b){_0x2382c9[_0xb668('0x48')]['AccountId']=_0x409c8b['id'];_0x2382c9[_0xb668('0x48')][_0xb668('0x51')]=integrations[_0xb668('0x52')](_0x2382c9['body'][_0xb668('0x53')],_0x2382c9[_0xb668('0x48')][_0xb668('0x3c')]);_0x2382c9[_0xb668('0x48')][_0xb668('0x54')]=integrations[_0xb668('0x55')](_0x2382c9[_0xb668('0x48')][_0xb668('0x53')],_0x2382c9[_0xb668('0x48')]['type']);return db[_0xb668('0x4c')]['create'](_0x2382c9[_0xb668('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0xb668('0x51')},{'model':db[_0xb668('0x56')],'as':_0xb668('0x54')}]});}return null;})['then'](respondWithResult(_0x2497b7,null))[_0xb668('0x44')](handleError(_0x2497b7,null));};exports[_0xb668('0x57')]=function(_0x3d68db,_0x35a005,_0x37ad99){var _0x3aa1b1=_0x3d68db[_0xb668('0x2f')][_0xb668('0x58')];var _0x3615ac=_0x3aa1b1===_0xb668('0x59')?_0xb668('0x5a'):_0xb668('0x5b');var _0xe04b6e='';var _0x14ac7d='';var _0x2f274b='';var _0x2521b8='';var _0x640d4c='';var _0x4260a9='';var _0x2abe06='';var _0x17324f='';var _0x4fff8b=[_0xb668('0x5c'),_0xb668('0x5d'),'customerid',_0xb668('0x5e'),'caseorigincode',_0xb668('0x5f'),_0xb668('0x60'),'regardingobjectid','directioncode',_0xb668('0x61')];var _0x47174a=[_0xb668('0x62'),'accountidyominame',_0xb668('0x63'),_0xb668('0x64'),_0xb668('0x65'),'contactidyominame',_0xb668('0x66'),_0xb668('0x67'),_0xb668('0x68'),_0xb668('0x69'),_0xb668('0x6a'),_0xb668('0x6b'),_0xb668('0x6c'),_0xb668('0x6d'),_0xb668('0x6e'),_0xb668('0x6f'),_0xb668('0x70'),'customeridyominame',_0xb668('0x71'),'entitlementidname','entityimage_timestamp',_0xb668('0x72'),_0xb668('0x73'),_0xb668('0x74'),_0xb668('0x75'),'followupby',_0xb668('0x76'),'influencescore',_0xb668('0x77'),_0xb668('0x78'),_0xb668('0x79'),'modifiedbyexternalpartyname',_0xb668('0x7a'),_0xb668('0x7b'),_0xb668('0x7c'),'modifiedon',_0xb668('0x7d'),_0xb668('0x7e'),_0xb668('0x7f'),_0xb668('0x80'),'numberofchildincidents',_0xb668('0x81'),_0xb668('0x82'),'owneridname',_0xb668('0x83'),'owneridyominame',_0xb668('0x84'),_0xb668('0x85'),_0xb668('0x86'),_0xb668('0x87'),_0xb668('0x88'),'productserialnumber','resolveby',_0xb668('0x89'),_0xb668('0x8a'),_0xb668('0x8b'),_0xb668('0x8c'),_0xb668('0x8d'),_0xb668('0x8e'),_0xb668('0x8f'),_0xb668('0x90'),_0xb668('0x91'),_0xb668('0x92'),_0xb668('0x93'),'ticketnumber',_0xb668('0x94'),_0xb668('0x95'),'traversedpath',_0xb668('0x96'),_0xb668('0x97')];var _0x1ddfd1=_0x4fff8b[_0xb668('0x98')](_0x47174a);return db[_0xb668('0x2c')][_0xb668('0x4b')]({'where':{'id':_0x3d68db[_0xb668('0x4a')]['id']},'attributes':['id','username',_0xb668('0x99'),'remoteUri',_0xb668('0x9a'),_0xb668('0x9b'),_0xb668('0x9c')]})[_0xb668('0x27')](handleEntityNotFound(_0x35a005,null))[_0xb668('0x27')](function(_0x5ba97d){if(_0x5ba97d){_0x17324f=_0x5ba97d[_0xb668('0x9d')];var _0x324066=_0x17324f[_0xb668('0x9e')](-0x1);if(_0x324066==='/'){_0x17324f=_0x17324f[_0xb668('0x9f')](0x0,_0x17324f[_0xb668('0xa0')](_0x324066));}_0x2abe06=util[_0xb668('0xa1')]('%s/api/data/v9.0/',_0x17324f);var _0x537a1c={'method':_0xb668('0xa2'),'uri':_0xb668('0xa3')+_0x5ba97d[_0xb668('0x9a')]+_0xb668('0xa4'),'form':{'client_id':_0x5ba97d[_0xb668('0x9b')],'resource':_0x17324f,'username':_0x5ba97d[_0xb668('0xa5')],'password':_0x5ba97d[_0xb668('0x99')],'grant_type':'password','client_secret':_0x5ba97d[_0xb668('0x9c')]},'json':!![]};return rp(_0x537a1c);}})[_0xb668('0x27')](function(_0x2c569d){_0x4260a9=_0x2c569d['access_token'];var _0x4641a0={'method':'GET','uri':encodeURI(_0x2abe06+_0xb668('0xa6')+_0x3615ac+'\x27'),'headers':{'Authorization':_0xb668('0xa7')+_0x4260a9,'If-None-Match':null,'OData-Version':_0xb668('0xa8')},'json':!![]};return rp(_0x4641a0);})[_0xb668('0x27')](function(_0xfd9cfd){var _0x1b5ba9=_0xfd9cfd[_0xb668('0xa9')][0x0];var _0x5d0749=_0x1b5ba9['MetadataId'];var _0x354d91={'method':_0xb668('0xaa'),'uri':_0x2abe06+_0xb668('0xab')+_0x5d0749+_0xb668('0xac'),'headers':{'Authorization':_0xb668('0xa7')+_0x4260a9,'If-None-Match':null,'OData-Version':_0xb668('0xa8')},'json':!![]};return rp(_0x354d91);})[_0xb668('0x27')](function(_0x293596){_0xe04b6e=_0x293596;_0x14ac7d=_0xe04b6e[_0xb668('0xad')];_0x14ac7d=_[_0xb668('0xae')](_0x14ac7d,function(_0x32ec00){return!_0x1ddfd1[_0xb668('0xaf')](_0x32ec00[_0xb668('0xb0')]);});var _0x58a898=[];var _0x1e7cbb=[];_0x14ac7d[_0xb668('0xb1')](function(_0x318c4e){if(_0x318c4e[_0xb668('0xb2')]){var _0x1bd67b=_0x318c4e[_0xb668('0xb2')][_0xb668('0x9f')](_0x318c4e[_0xb668('0xb2')]['lastIndexOf']('.')+0x1);if(_0x1bd67b===_0xb668('0xb3')){_0x58a898['push'](getSelectList(_0x2abe06,_0x3aa1b1,_0x1e7cbb,_0xe04b6e['MetadataId'],_0x318c4e[_0xb668('0xb4')],_0x4260a9));}}});return Promise[_0xb668('0xb5')](_0x58a898);})['then'](function(_0x442bc1){_0x2f274b=_0x442bc1[0x0];var _0x5e05de=[];var _0x162bc2=[];_0x14ac7d[_0xb668('0xb1')](function(_0xf9c1a6){if(!_['isNil'](_0xf9c1a6[_0xb668('0xb2')])){var _0x43aec8=_0xf9c1a6[_0xb668('0xb2')][_0xb668('0x9f')](_0xf9c1a6['@odata.type']['lastIndexOf']('.')+0x1);if(_0x43aec8===_0xb668('0xb6')){_0x5e05de[_0xb668('0xb7')](getBooleanList(_0x2abe06,_0x3aa1b1,_0x162bc2,_0xe04b6e['MetadataId'],_0xf9c1a6[_0xb668('0xb4')],_0x4260a9));}}});return Promise['all'](_0x5e05de);})[_0xb668('0x27')](function(_0x2f988c){_0x2521b8=_0x2f988c[0x0];var _0x102265=[];var _0x19d55e=[];_0x14ac7d['forEach'](function(_0x5ca3ad){if(_0x5ca3ad[_0xb668('0xb2')]){var _0x2ce192=_0x5ca3ad[_0xb668('0xb2')]['substring'](_0x5ca3ad[_0xb668('0xb2')][_0xb668('0xa0')]('.')+0x1);if(_0x2ce192===_0xb668('0xb8')||_0x2ce192==='DoubleAttributeMetadata'||_0x2ce192===_0xb668('0xb9')||_0x2ce192==='IntegerAttributeMetadata'||_0x2ce192===_0xb668('0xba')||_0x2ce192===_0xb668('0xbb')||_0x2ce192===_0xb668('0xbc')||_0x2ce192===_0xb668('0xbd')||_0x2ce192===_0xb668('0xbe')||_0x2ce192==='DecimalAttributeMetadata'){_0x102265['push'](getInputList(_0x2abe06,_0x3aa1b1,_0x2ce192,_0x19d55e,_0xe04b6e[_0xb668('0xb4')],_0x5ca3ad[_0xb668('0xb4')],_0x4260a9));}}});return Promise[_0xb668('0xb5')](_0x102265);})[_0xb668('0x27')](function(_0x5575bc){_0x640d4c=_0x5575bc[0x0];var _0x4a803e=_0x2f274b[_0xb668('0x98')](_0x2521b8)[_0xb668('0x98')](_0x640d4c);var _0x4e6d34={'count':_0x4a803e[_0xb668('0x36')],'rows':_0x4a803e};return _0x4e6d34;})[_0xb668('0x27')](respondWithResult(_0x35a005,null))[_0xb668('0x44')](function(_0xc24e77){var _0x2aeb1f=_0x3d68db[_0xb668('0x2f')][_0xb668('0xbf')]?0x1f4:_0xc24e77[_0xb668('0xc0')]||0x1f4;logger[_0xb668('0x29')](_0xc24e77[_0xb668('0xc1')]);delete _0xc24e77['name'];if(_0x2aeb1f===0x191){_0x2aeb1f=0x190;}_0x35a005[_0xb668('0x1d')](_0x2aeb1f)[_0xb668('0xc2')](_0x3d68db[_0xb668('0x2f')][_0xb668('0xbf')]?{'message':_0xb668('0xc3'),'statusCode':_0xc24e77[_0xb668('0xc0')]}:_0xc24e77);});};function getSelectList(_0x172abd,_0x40ec49,_0x2ca248,_0x1bbbad,_0x54eef6,_0x1a99aa){var _0x111501={'method':'GET','uri':_0x172abd+_0xb668('0xab')+_0x1bbbad+_0xb668('0xc4')+_0x54eef6+_0xb668('0xc5')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xb668('0xa7')+_0x1a99aa,'If-None-Match':null,'OData-Version':_0xb668('0xa8')},'json':!![]};return rp(_0x111501)['then'](function(_0x5bb65c){var _0x1bc373=[];var _0x3cb765=_0x5bb65c['OptionSet'][_0xb668('0xc6')];_0x3cb765['forEach'](function(_0x1a05b8){_0x1bc373['push']({'name':_0x1a05b8[_0xb668('0xc7')][_0xb668('0xc8')][_0xb668('0xc7')],'value':String(_0x1a05b8[_0xb668('0xc9')])});});var _0x47bf24={'id':_0x40ec49+'_'+_0x5bb65c[_0xb668('0xb0')],'name':_0x5bb65c[_0xb668('0xca')][_0xb668('0xc8')]['Label'],'custom':![],'options':_0x1bc373};_0x2ca248['push'](_0x47bf24);return _0x2ca248;});}function getBooleanList(_0x3db0d4,_0x3874f2,_0x306b03,_0x149084,_0x4cb72d,_0xbfd89d){var _0x2b9b93={'method':_0xb668('0xaa'),'uri':_0x3db0d4+'EntityDefinitions('+_0x149084+_0xb668('0xc4')+_0x4cb72d+_0xb668('0xcb'),'headers':{'Authorization':_0xb668('0xa7')+_0xbfd89d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b9b93)[_0xb668('0x27')](function(_0x2b85b0){var _0x3c39dc=[];_0x3c39dc[_0xb668('0xb7')]({'name':_0x2b85b0[_0xb668('0xcc')][_0xb668('0xcd')][_0xb668('0xc7')][_0xb668('0xc8')][_0xb668('0xc7')],'value':'true'},{'name':_0x2b85b0[_0xb668('0xcc')]['FalseOption'][_0xb668('0xc7')]['UserLocalizedLabel'][_0xb668('0xc7')],'value':_0xb668('0xce')});var _0x4059ce={'id':_0x3874f2+'_'+_0x2b85b0[_0xb668('0xb0')],'name':_0x2b85b0[_0xb668('0xca')][_0xb668('0xc8')][_0xb668('0xc7')],'custom':![],'options':_0x3c39dc};_0x306b03[_0xb668('0xb7')](_0x4059ce);return _0x306b03;});}function getInputList(_0x69ce96,_0x534662,_0x245b6a,_0x295ce6,_0x597160,_0x1d2219,_0x4fa5f7){var _0x34d80={'method':_0xb668('0xaa'),'uri':_0x69ce96+_0xb668('0xab')+_0x597160+')/Attributes('+_0x1d2219+_0xb668('0xcf')+_0x245b6a+_0xb668('0xd0'),'headers':{'Authorization':_0xb668('0xa7')+_0x4fa5f7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x34d80)['then'](function(_0xf98198){var _0x6d702c={'id':_0x534662+'_'+_0xf98198[_0xb668('0xb0')],'name':_0xf98198[_0xb668('0xca')][_0xb668('0xc8')]?_0xf98198[_0xb668('0xca')][_0xb668('0xc8')][_0xb668('0xc7')]:_0xf98198['LogicalName'],'custom':![],'options':[]};_0x295ce6[_0xb668('0xb7')](_0x6d702c);return _0x295ce6;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e4fdb25..4f65738 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x332166,_0x353c6f){var _0x20bb57=function(_0x7faf3){while(--_0x7faf3){_0x332166['push'](_0x332166['shift']());}};_0x20bb57(++_0x353c6f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x338206,_0x5d699e){var _0x451b57=function(_0x179955){while(--_0x179955){_0x338206['push'](_0x338206['shift']());}};_0x451b57(++_0x5d699e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'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 b1564cc..1a5647f 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 _0x5952=['../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','GetDynamics365Account','debug','find','ShowDynamics365Account','stringify','util','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x5952,0x192));var _0x2595=function(_0x537835,_0x305639){_0x537835=_0x537835-0x0;var _0x383e66=_0x5952[_0x537835];return _0x383e66;};'use strict';var _=require('lodash');var util=require(_0x2595('0x0'));var moment=require(_0x2595('0x1'));var BPromise=require(_0x2595('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2595('0x3'));var logger=require(_0x2595('0x4'))(_0x2595('0x5'));var config=require(_0x2595('0x6'));var jayson=require(_0x2595('0x7'));var client=jayson[_0x2595('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514743,_0x4a0a88,_0x54ec5f){return new BPromise(function(_0x3cc00b,_0x4bcbb8){return client[_0x2595('0x9')](_0x514743,_0x54ec5f)['then'](function(_0x2239e8){logger[_0x2595('0xa')](_0x2595('0xb'),_0x4a0a88,_0x2595('0xc'));logger['debug'](_0x2595('0xd'),_0x4a0a88,_0x2595('0xc'),JSON['stringify'](_0x2239e8));if(_0x2239e8['error']){if(_0x2239e8['error'][_0x2595('0xe')]===0x1f4){logger[_0x2595('0xf')](_0x2595('0xb'),_0x4a0a88,_0x2239e8['error']['message']);return _0x4bcbb8(_0x2239e8[_0x2595('0xf')][_0x2595('0x10')]);}logger[_0x2595('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x4a0a88,_0x2239e8[_0x2595('0xf')][_0x2595('0x10')]);return _0x3cc00b(_0x2239e8['error'][_0x2595('0x10')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x4a0a88,_0x2595('0xc'));_0x3cc00b(_0x2239e8[_0x2595('0x11')][_0x2595('0x10')]);}})[_0x2595('0x12')](function(_0x67db00){logger['error'](_0x2595('0xb'),_0x4a0a88,_0x67db00);_0x4bcbb8(_0x67db00);});});}exports['GetDynamics365Account']=function(_0x58b258){var _0x51fb5e=this;return new Promise(function(_0x1a78fd,_0x30a5ce){return db[_0x2595('0x13')][_0x2595('0x14')]({'raw':_0x58b258['options']?_0x58b258[_0x2595('0x15')][_0x2595('0x16')]===undefined?!![]:![]:!![],'where':_0x58b258[_0x2595('0x15')]?_0x58b258[_0x2595('0x15')][_0x2595('0x17')]||null:null,'attributes':_0x58b258['options']?_0x58b258[_0x2595('0x15')][_0x2595('0x18')]||null:null,'limit':_0x58b258[_0x2595('0x15')]?_0x58b258['options']['limit']||null:null,'include':_0x58b258[_0x2595('0x15')]?_0x58b258['options'][_0x2595('0x19')]?_[_0x2595('0x1a')](_0x58b258[_0x2595('0x15')][_0x2595('0x19')],function(_0x3b4bd2){return{'model':db[_0x3b4bd2[_0x2595('0x1b')]],'as':_0x3b4bd2['as'],'attributes':_0x3b4bd2['attributes'],'include':_0x3b4bd2[_0x2595('0x19')]?_[_0x2595('0x1a')](_0x3b4bd2['include'],function(_0x1e9c1d){return{'model':db[_0x1e9c1d[_0x2595('0x1b')]],'as':_0x1e9c1d['as'],'attributes':_0x1e9c1d[_0x2595('0x18')],'include':_0x1e9c1d[_0x2595('0x19')]?_['map'](_0x1e9c1d[_0x2595('0x19')],function(_0x145b19){return{'model':db[_0x145b19['model']],'as':_0x145b19['as'],'attributes':_0x145b19[_0x2595('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2595('0x1c')](function(_0x1237db){logger[_0x2595('0xa')](_0x2595('0x1d'),_0x58b258);logger[_0x2595('0x1e')](_0x2595('0x1d'),_0x58b258,JSON['stringify'](_0x1237db));_0x1a78fd(_0x1237db);})[_0x2595('0x12')](function(_0x22e8ca){logger['error'](_0x2595('0x1d'),_0x22e8ca[_0x2595('0x10')],_0x58b258);_0x30a5ce(_0x51fb5e[_0x2595('0xf')](0x1f4,_0x22e8ca[_0x2595('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x37cb97){var _0x4d798a=this;return new Promise(function(_0xef7072,_0x292df0){return db['Dynamics365Account'][_0x2595('0x1f')]({'raw':_0x37cb97['options']?_0x37cb97[_0x2595('0x15')][_0x2595('0x16')]===undefined?!![]:![]:!![],'where':_0x37cb97[_0x2595('0x15')]?_0x37cb97['options'][_0x2595('0x17')]||null:null,'attributes':_0x37cb97[_0x2595('0x15')]?_0x37cb97[_0x2595('0x15')][_0x2595('0x18')]||null:null,'include':_0x37cb97[_0x2595('0x15')]?_0x37cb97[_0x2595('0x15')]['include']?_[_0x2595('0x1a')](_0x37cb97[_0x2595('0x15')][_0x2595('0x19')],function(_0x583473){return{'model':db[_0x583473[_0x2595('0x1b')]],'as':_0x583473['as'],'attributes':_0x583473[_0x2595('0x18')],'include':_0x583473[_0x2595('0x19')]?_['map'](_0x583473[_0x2595('0x19')],function(_0x596519){return{'model':db[_0x596519[_0x2595('0x1b')]],'as':_0x596519['as'],'attributes':_0x596519[_0x2595('0x18')],'include':_0x596519[_0x2595('0x19')]?_[_0x2595('0x1a')](_0x596519[_0x2595('0x19')],function(_0x4f8790){return{'model':db[_0x4f8790[_0x2595('0x1b')]],'as':_0x4f8790['as'],'attributes':_0x4f8790[_0x2595('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa40f5e){logger[_0x2595('0xa')]('ShowDynamics365Account',_0x37cb97);logger['debug'](_0x2595('0x20'),_0x37cb97,JSON[_0x2595('0x21')](_0xa40f5e));_0xef7072(_0xa40f5e);})[_0x2595('0x12')](function(_0x319f55){logger[_0x2595('0xf')](_0x2595('0x20'),_0x319f55[_0x2595('0x10')],_0x37cb97);_0x292df0(_0x4d798a['error'](0x1f4,_0x319f55[_0x2595('0x10')]));});});}; \ No newline at end of file +var _0x8c15=['where','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Dynamics365Account','findAll','options'];(function(_0x1cbea3,_0x268023){var _0x40337c=function(_0x1464b6){while(--_0x1464b6){_0x1cbea3['push'](_0x1cbea3['shift']());}};_0x40337c(++_0x268023);}(_0x8c15,0x188));var _0x58c1=function(_0x5e09a0,_0x2c0a5f){_0x5e09a0=_0x5e09a0-0x0;var _0x223a7e=_0x8c15[_0x5e09a0];return _0x223a7e;};'use strict';var _=require(_0x58c1('0x0'));var util=require(_0x58c1('0x1'));var moment=require(_0x58c1('0x2'));var BPromise=require(_0x58c1('0x3'));var rs=require(_0x58c1('0x4'));var fs=require('fs');var Redis=require(_0x58c1('0x5'));var db=require(_0x58c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x58c1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x58c1('0x8')][_0x58c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x419db7,_0x1db483,_0x39ecc8){return new BPromise(function(_0x4e92a6,_0x269ecd){return client['request'](_0x419db7,_0x39ecc8)[_0x58c1('0xa')](function(_0x5bbceb){logger[_0x58c1('0xb')](_0x58c1('0xc'),_0x1db483,_0x58c1('0xd'));logger[_0x58c1('0xe')](_0x58c1('0xf'),_0x1db483,_0x58c1('0xd'),JSON[_0x58c1('0x10')](_0x5bbceb));if(_0x5bbceb[_0x58c1('0x11')]){if(_0x5bbceb[_0x58c1('0x11')][_0x58c1('0x12')]===0x1f4){logger[_0x58c1('0x11')](_0x58c1('0xc'),_0x1db483,_0x5bbceb['error'][_0x58c1('0x13')]);return _0x269ecd(_0x5bbceb[_0x58c1('0x11')][_0x58c1('0x13')]);}logger[_0x58c1('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x1db483,_0x5bbceb[_0x58c1('0x11')]['message']);return _0x4e92a6(_0x5bbceb[_0x58c1('0x11')]['message']);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1db483,'request\x20sent');_0x4e92a6(_0x5bbceb['result'][_0x58c1('0x13')]);}})[_0x58c1('0x14')](function(_0x340447){logger[_0x58c1('0x11')](_0x58c1('0xc'),_0x1db483,_0x340447);_0x269ecd(_0x340447);});});}exports['GetDynamics365Account']=function(_0xd83d64){var _0x19d806=this;return new Promise(function(_0x2c0ee0,_0x23cd1d){return db[_0x58c1('0x15')][_0x58c1('0x16')]({'raw':_0xd83d64[_0x58c1('0x17')]?_0xd83d64[_0x58c1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xd83d64[_0x58c1('0x17')]?_0xd83d64[_0x58c1('0x17')][_0x58c1('0x18')]||null:null,'attributes':_0xd83d64[_0x58c1('0x17')]?_0xd83d64[_0x58c1('0x17')][_0x58c1('0x19')]||null:null,'limit':_0xd83d64[_0x58c1('0x17')]?_0xd83d64['options']['limit']||null:null,'include':_0xd83d64[_0x58c1('0x17')]?_0xd83d64[_0x58c1('0x17')][_0x58c1('0x1a')]?_[_0x58c1('0x1b')](_0xd83d64[_0x58c1('0x17')][_0x58c1('0x1a')],function(_0x306ec5){return{'model':db[_0x306ec5[_0x58c1('0x1c')]],'as':_0x306ec5['as'],'attributes':_0x306ec5[_0x58c1('0x19')],'include':_0x306ec5['include']?_[_0x58c1('0x1b')](_0x306ec5['include'],function(_0x1a5e78){return{'model':db[_0x1a5e78[_0x58c1('0x1c')]],'as':_0x1a5e78['as'],'attributes':_0x1a5e78[_0x58c1('0x19')],'include':_0x1a5e78[_0x58c1('0x1a')]?_['map'](_0x1a5e78[_0x58c1('0x1a')],function(_0x5f43db){return{'model':db[_0x5f43db['model']],'as':_0x5f43db['as'],'attributes':_0x5f43db[_0x58c1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x58c1('0xa')](function(_0x2348bc){logger[_0x58c1('0xb')]('GetDynamics365Account',_0xd83d64);logger['debug'](_0x58c1('0x1d'),_0xd83d64,JSON[_0x58c1('0x10')](_0x2348bc));_0x2c0ee0(_0x2348bc);})[_0x58c1('0x14')](function(_0xe46185){logger[_0x58c1('0x11')](_0x58c1('0x1d'),_0xe46185[_0x58c1('0x13')],_0xd83d64);_0x23cd1d(_0x19d806[_0x58c1('0x11')](0x1f4,_0xe46185[_0x58c1('0x13')]));});});};exports[_0x58c1('0x1e')]=function(_0xfdbe96){var _0x47482e=this;return new Promise(function(_0x956b81,_0x281979){return db[_0x58c1('0x15')]['find']({'raw':_0xfdbe96[_0x58c1('0x17')]?_0xfdbe96['options'][_0x58c1('0x1f')]===undefined?!![]:![]:!![],'where':_0xfdbe96['options']?_0xfdbe96['options'][_0x58c1('0x18')]||null:null,'attributes':_0xfdbe96[_0x58c1('0x17')]?_0xfdbe96[_0x58c1('0x17')][_0x58c1('0x19')]||null:null,'include':_0xfdbe96[_0x58c1('0x17')]?_0xfdbe96[_0x58c1('0x17')][_0x58c1('0x1a')]?_[_0x58c1('0x1b')](_0xfdbe96[_0x58c1('0x17')][_0x58c1('0x1a')],function(_0x227a5a){return{'model':db[_0x227a5a['model']],'as':_0x227a5a['as'],'attributes':_0x227a5a[_0x58c1('0x19')],'include':_0x227a5a[_0x58c1('0x1a')]?_[_0x58c1('0x1b')](_0x227a5a[_0x58c1('0x1a')],function(_0xf26b4){return{'model':db[_0xf26b4['model']],'as':_0xf26b4['as'],'attributes':_0xf26b4[_0x58c1('0x19')],'include':_0xf26b4['include']?_[_0x58c1('0x1b')](_0xf26b4[_0x58c1('0x1a')],function(_0x597c88){return{'model':db[_0x597c88[_0x58c1('0x1c')]],'as':_0x597c88['as'],'attributes':_0x597c88['attributes']};}):[]};}):[]};}):[]:[]})[_0x58c1('0xa')](function(_0x15e715){logger[_0x58c1('0xb')](_0x58c1('0x1e'),_0xfdbe96);logger[_0x58c1('0xe')](_0x58c1('0x1e'),_0xfdbe96,JSON['stringify'](_0x15e715));_0x956b81(_0x15e715);})[_0x58c1('0x14')](function(_0x26340d){logger[_0x58c1('0x11')](_0x58c1('0x1e'),_0x26340d['message'],_0xfdbe96);_0x281979(_0x47482e[_0x58c1('0x11')](0x1f4,_0x26340d[_0x58c1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8e9c4fe..8d5b8f2 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 _0x5746=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0x5746,0x176));var _0x6574=function(_0x4ea7ac,_0x1cca07){_0x4ea7ac=_0x4ea7ac-0x0;var _0xd54278=_0x5746[_0x4ea7ac];return _0xd54278;};'use strict';var multer=require(_0x6574('0x0'));var util=require(_0x6574('0x1'));var path=require('path');var timeout=require(_0x6574('0x2'));var express=require('express');var router=express[_0x6574('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6574('0x4'));var config=require('../../config/environment');var controller=require(_0x6574('0x5'));router[_0x6574('0x6')]('/',auth[_0x6574('0x7')](),controller[_0x6574('0x8')]);router[_0x6574('0x6')](_0x6574('0x9'),auth[_0x6574('0x7')](),controller[_0x6574('0xa')]);router[_0x6574('0x6')](_0x6574('0xb'),auth[_0x6574('0x7')](),controller[_0x6574('0xc')]);router[_0x6574('0x6')](_0x6574('0xd'),auth[_0x6574('0x7')](),controller[_0x6574('0xe')]);router['get'](_0x6574('0xf'),auth[_0x6574('0x7')](),controller[_0x6574('0x10')]);router['post']('/',auth[_0x6574('0x7')](),controller[_0x6574('0x11')]);router[_0x6574('0x12')](_0x6574('0x9'),auth['isAuthenticated'](),controller[_0x6574('0x13')]);router[_0x6574('0x14')](_0x6574('0x9'),auth[_0x6574('0x7')](),controller[_0x6574('0x15')]);module[_0x6574('0x16')]=router; \ No newline at end of file +var _0xa962=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','delete'];(function(_0x1b4928,_0x2370fd){var _0x1e60bf=function(_0x23d942){while(--_0x23d942){_0x1b4928['push'](_0x1b4928['shift']());}};_0x1e60bf(++_0x2370fd);}(_0xa962,0xd1));var _0x2a96=function(_0x41a8f5,_0x2ab807){_0x41a8f5=_0x41a8f5-0x0;var _0x25fb25=_0xa962[_0x41a8f5];return _0x25fb25;};'use strict';var multer=require(_0x2a96('0x0'));var util=require(_0x2a96('0x1'));var path=require(_0x2a96('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a96('0x3'));var router=express[_0x2a96('0x4')]();var fs_extra=require(_0x2a96('0x5'));var auth=require(_0x2a96('0x6'));var interaction=require(_0x2a96('0x7'));var config=require('../../config/environment');var controller=require(_0x2a96('0x8'));router['get']('/',auth[_0x2a96('0x9')](),controller[_0x2a96('0xa')]);router[_0x2a96('0xb')](_0x2a96('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2a96('0xd'),auth[_0x2a96('0x9')](),controller[_0x2a96('0xe')]);router[_0x2a96('0xb')]('/:id/subjects',auth[_0x2a96('0x9')](),controller[_0x2a96('0xf')]);router['get'](_0x2a96('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x2a96('0x11')]('/',auth[_0x2a96('0x9')](),controller[_0x2a96('0x12')]);router[_0x2a96('0x13')](_0x2a96('0xc'),auth[_0x2a96('0x9')](),controller['update']);router[_0x2a96('0x14')](_0x2a96('0xc'),auth[_0x2a96('0x9')](),controller[_0x2a96('0x15')]);module[_0x2a96('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 dfccdc8..912e125 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 _0x3d53=['exports','STRING','ENUM','incident'];(function(_0x15fcd5,_0xb1972){var _0x49dde5=function(_0x5db433){while(--_0x5db433){_0x15fcd5['push'](_0x15fcd5['shift']());}};_0x49dde5(++_0xb1972);}(_0x3d53,0x140));var _0x33d5=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x3d53[_0x2a67fe];return _0x57e726;};'use strict';var Sequelize=require('sequelize');module[_0x33d5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x33d5('0x1')]},'ticketType':{'type':Sequelize[_0x33d5('0x2')](_0x33d5('0x3'),'phonecall'),'defaultValue':_0x33d5('0x3')}}; \ No newline at end of file +var _0x6bb7=['ENUM','incident','phonecall','sequelize','exports'];(function(_0x13c391,_0x147226){var _0x14d618=function(_0x375bb8){while(--_0x375bb8){_0x13c391['push'](_0x13c391['shift']());}};_0x14d618(++_0x147226);}(_0x6bb7,0x10c));var _0x76bb=function(_0x275de6,_0x4563ec){_0x275de6=_0x275de6-0x0;var _0x37261f=_0x6bb7[_0x275de6];return _0x37261f;};'use strict';var Sequelize=require(_0x76bb('0x0'));module[_0x76bb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x76bb('0x2')](_0x76bb('0x3'),_0x76bb('0x4')),'defaultValue':_0x76bb('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 91138b4..8061ef2 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 _0x839d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','include','rows','catch','params','rawAttributes','includeAll','find','create','body','Dynamics365Field','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x8abb66,_0xa4a47b){var _0x472e0b=function(_0x147f41){while(--_0x147f41){_0x8abb66['push'](_0x8abb66['shift']());}};_0x472e0b(++_0xa4a47b);}(_0x839d,0x1c7));var _0xd839=function(_0x6de642,_0x43808c){_0x6de642=_0x6de642-0x0;var _0x4f381f=_0x839d[_0x6de642];return _0x4f381f;};'use strict';var emlformat=require(_0xd839('0x0'));var rimraf=require(_0xd839('0x1'));var zipdir=require(_0xd839('0x2'));var jsonpatch=require(_0xd839('0x3'));var rp=require(_0xd839('0x4'));var moment=require(_0xd839('0x5'));var BPromise=require(_0xd839('0x6'));var Mustache=require(_0xd839('0x7'));var util=require(_0xd839('0x8'));var path=require(_0xd839('0x9'));var sox=require('sox');var csv=require(_0xd839('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd839('0xb'));var _=require(_0xd839('0xc'));var squel=require(_0xd839('0xd'));var crypto=require(_0xd839('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd839('0xf'));var toCsv=require(_0xd839('0xa'));var querystring=require(_0xd839('0x10'));var Papa=require('papaparse');var Redis=require(_0xd839('0x11'));var authService=require(_0xd839('0x12'));var qs=require(_0xd839('0x13'));var as=require(_0xd839('0x14'));var hardwareService=require(_0xd839('0x15'));var logger=require(_0xd839('0x16'))('api');var utils=require(_0xd839('0x17'));var config=require(_0xd839('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd839('0x19'))['db'];function respondWithStatusCode(_0x36c7d8,_0x19030f){_0x19030f=_0x19030f||0xcc;return function(_0x2c9a95){if(_0x2c9a95){return _0x36c7d8[_0xd839('0x1a')](_0x19030f);}return _0x36c7d8[_0xd839('0x1b')](_0x19030f)[_0xd839('0x1c')]();};}function respondWithResult(_0x377d30,_0x5a0445){_0x5a0445=_0x5a0445||0xc8;return function(_0x53a493){if(_0x53a493){return _0x377d30['status'](_0x5a0445)['json'](_0x53a493);}};}function respondWithFilteredResult(_0x176921,_0x5250a4){return function(_0x26e73d){if(_0x26e73d){var _0x1c5df4=typeof _0x5250a4[_0xd839('0x1d')]===_0xd839('0x1e')&&typeof _0x5250a4[_0xd839('0x1f')]===_0xd839('0x1e');var _0x19b316=_0x26e73d['count'];var _0x53a198=_0x1c5df4?0x0:_0x5250a4[_0xd839('0x1d')];var _0x22dde8=_0x1c5df4?_0x26e73d[_0xd839('0x20')]:_0x5250a4['offset']+_0x5250a4[_0xd839('0x1f')];var _0x1e1a99;if(_0x22dde8>=_0x19b316){_0x22dde8=_0x19b316;_0x1e1a99=0xc8;}else{_0x1e1a99=0xce;}_0x176921[_0xd839('0x1b')](_0x1e1a99);return _0x176921[_0xd839('0x21')](_0xd839('0x22'),_0x53a198+'-'+_0x22dde8+'/'+_0x19b316)[_0xd839('0x23')](_0x26e73d);}return null;};}function patchUpdates(_0x2464ae){return function(_0x21a074){try{jsonpatch[_0xd839('0x24')](_0x21a074,_0x2464ae,!![]);}catch(_0x156029){return BPromise[_0xd839('0x25')](_0x156029);}return _0x21a074['save']();};}function saveUpdates(_0x1303c7,_0x20bc72){return function(_0x4f6f74){if(_0x4f6f74){return _0x4f6f74['update'](_0x1303c7)[_0xd839('0x26')](function(_0x344d21){return _0x344d21;});}return null;};}function removeEntity(_0x8f2a0a,_0x2880a8){return function(_0x1e6f2c){if(_0x1e6f2c){return _0x1e6f2c[_0xd839('0x27')]()[_0xd839('0x26')](function(){_0x8f2a0a[_0xd839('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6659,_0x38fccf){return function(_0x4f432b){if(!_0x4f432b){_0x1c6659[_0xd839('0x1a')](0x194);}return _0x4f432b;};}function handleError(_0x25c560,_0x100a2b){_0x100a2b=_0x100a2b||0x1f4;return function(_0xa61e77){logger['error'](_0xa61e77[_0xd839('0x28')]);if(_0xa61e77[_0xd839('0x29')]){delete _0xa61e77['name'];}_0x25c560['status'](_0x100a2b)['send'](_0xa61e77);};}exports['index']=function(_0x196d2b,_0x32e0ca){var _0x58e64e={},_0x2965da={},_0x383e68={'count':0x0,'rows':[]};var _0xbcafe0=_[_0xd839('0x2a')](db['Dynamics365Configuration']['rawAttributes'],function(_0x50d7b9){return{'name':_0x50d7b9[_0xd839('0x2b')],'type':_0x50d7b9[_0xd839('0x2c')][_0xd839('0x2d')]};});_0x2965da[_0xd839('0x2e')]=_[_0xd839('0x2a')](_0xbcafe0,_0xd839('0x29'));_0x2965da[_0xd839('0x2f')]=_[_0xd839('0x30')](_0x196d2b[_0xd839('0x2f')]);_0x2965da['filters']=_[_0xd839('0x31')](_0x2965da[_0xd839('0x2e')],_0x2965da['query']);_0x58e64e['attributes']=_[_0xd839('0x31')](_0x2965da[_0xd839('0x2e')],qs[_0xd839('0x32')](_0x196d2b[_0xd839('0x2f')]['fields']));_0x58e64e[_0xd839('0x33')]=_0x58e64e[_0xd839('0x33')][_0xd839('0x34')]?_0x58e64e[_0xd839('0x33')]:_0x2965da[_0xd839('0x2e')];if(!_0x196d2b['query'][_0xd839('0x35')](_0xd839('0x36'))){_0x58e64e['limit']=qs[_0xd839('0x1f')](_0x196d2b[_0xd839('0x2f')][_0xd839('0x1f')]);_0x58e64e[_0xd839('0x1d')]=qs[_0xd839('0x1d')](_0x196d2b[_0xd839('0x2f')][_0xd839('0x1d')]);}_0x58e64e[_0xd839('0x37')]=qs['sort'](_0x196d2b['query'][_0xd839('0x38')]);_0x58e64e[_0xd839('0x39')]=qs[_0xd839('0x3a')](_[_0xd839('0x3b')](_0x196d2b[_0xd839('0x2f')],_0x2965da[_0xd839('0x3a')]),_0xbcafe0);if(_0x196d2b[_0xd839('0x2f')][_0xd839('0x3c')]){_0x58e64e[_0xd839('0x39')]=_[_0xd839('0x3d')](_0x58e64e[_0xd839('0x39')],{'$or':_[_0xd839('0x2a')](_0xbcafe0,function(_0x503e7e){if(_0x503e7e[_0xd839('0x2c')]!==_0xd839('0x3e')){var _0x465e0a={};_0x465e0a[_0x503e7e[_0xd839('0x29')]]={'$like':'%'+_0x196d2b[_0xd839('0x2f')][_0xd839('0x3c')]+'%'};return _0x465e0a;}})});}_0x58e64e=_[_0xd839('0x3d')]({},_0x58e64e,_0x196d2b[_0xd839('0x3f')]);var _0x25a150={'where':_0x58e64e[_0xd839('0x39')]};return db[_0xd839('0x40')][_0xd839('0x20')](_0x25a150)['then'](function(_0x24af99){_0x383e68[_0xd839('0x20')]=_0x24af99;if(_0x196d2b[_0xd839('0x2f')]['includeAll']){_0x58e64e[_0xd839('0x41')]=[{'all':!![]}];}return db[_0xd839('0x40')]['findAll'](_0x58e64e);})[_0xd839('0x26')](function(_0x140ed2){_0x383e68[_0xd839('0x42')]=_0x140ed2;return _0x383e68;})[_0xd839('0x26')](respondWithFilteredResult(_0x32e0ca,_0x58e64e))[_0xd839('0x43')](handleError(_0x32e0ca,null));};exports['show']=function(_0x423ca7,_0x421a6e){var _0x2def8a={'raw':![],'where':{'id':_0x423ca7[_0xd839('0x44')]['id']}},_0x3ad3f4={};_0x3ad3f4[_0xd839('0x2e')]=_[_0xd839('0x30')](db[_0xd839('0x40')][_0xd839('0x45')]);_0x3ad3f4[_0xd839('0x2f')]=_[_0xd839('0x30')](_0x423ca7[_0xd839('0x2f')]);_0x3ad3f4[_0xd839('0x3a')]=_[_0xd839('0x31')](_0x3ad3f4[_0xd839('0x2e')],_0x3ad3f4[_0xd839('0x2f')]);_0x2def8a[_0xd839('0x33')]=_[_0xd839('0x31')](_0x3ad3f4['model'],qs[_0xd839('0x32')](_0x423ca7['query'][_0xd839('0x32')]));_0x2def8a[_0xd839('0x33')]=_0x2def8a[_0xd839('0x33')][_0xd839('0x34')]?_0x2def8a['attributes']:_0x3ad3f4['model'];if(_0x423ca7[_0xd839('0x2f')][_0xd839('0x46')]){_0x2def8a[_0xd839('0x41')]=[{'all':!![]}];}_0x2def8a=_[_0xd839('0x3d')]({},_0x2def8a,_0x423ca7[_0xd839('0x3f')]);return db['Dynamics365Configuration'][_0xd839('0x47')](_0x2def8a)[_0xd839('0x26')](handleEntityNotFound(_0x421a6e,null))[_0xd839('0x26')](respondWithResult(_0x421a6e,null))['catch'](handleError(_0x421a6e,null));};exports[_0xd839('0x48')]=function(_0x43b0b1,_0x3759d3){return db[_0xd839('0x40')][_0xd839('0x48')](_0x43b0b1['body'],{})[_0xd839('0x26')](respondWithResult(_0x3759d3,0xc9))[_0xd839('0x43')](handleError(_0x3759d3,null));};exports['update']=function(_0x1a00b8,_0x12ea3c){if(_0x1a00b8[_0xd839('0x49')]['id']){delete _0x1a00b8[_0xd839('0x49')]['id'];}return db[_0xd839('0x40')][_0xd839('0x47')]({'where':{'id':_0x1a00b8[_0xd839('0x44')]['id']}})[_0xd839('0x26')](handleEntityNotFound(_0x12ea3c,null))[_0xd839('0x26')](saveUpdates(_0x1a00b8[_0xd839('0x49')],null))['then'](respondWithResult(_0x12ea3c,null))[_0xd839('0x43')](handleError(_0x12ea3c,null));};exports[_0xd839('0x27')]=function(_0x1376ab,_0x35edc9){return db[_0xd839('0x40')][_0xd839('0x47')]({'where':{'id':_0x1376ab['params']['id']}})[_0xd839('0x26')](handleEntityNotFound(_0x35edc9,null))[_0xd839('0x26')](removeEntity(_0x35edc9,null))['catch'](handleError(_0x35edc9,null));};exports['getFields']=function(_0x477169,_0x3249ed,_0x1a434f){var _0x3595fd={};var _0x17e3ce={};var _0x152483;var _0x2a0cce;return db[_0xd839('0x40')]['findOne']({'where':{'id':_0x477169[_0xd839('0x44')]['id']}})[_0xd839('0x26')](handleEntityNotFound(_0x3249ed,null))['then'](function(_0x3ffede){if(_0x3ffede){_0x152483=_0x3ffede;_0x17e3ce[_0xd839('0x2e')]=_[_0xd839('0x30')](db[_0xd839('0x4a')][_0xd839('0x45')]);_0x17e3ce[_0xd839('0x2f')]=_[_0xd839('0x30')](_0x477169[_0xd839('0x2f')]);_0x17e3ce[_0xd839('0x3a')]=_['intersection'](_0x17e3ce[_0xd839('0x2e')],_0x17e3ce[_0xd839('0x2f')]);_0x3595fd[_0xd839('0x33')]=_['intersection'](_0x17e3ce[_0xd839('0x2e')],qs['fields'](_0x477169['query']['fields']));_0x3595fd[_0xd839('0x33')]=_0x3595fd[_0xd839('0x33')][_0xd839('0x34')]?_0x3595fd[_0xd839('0x33')]:_0x17e3ce['model'];_0x3595fd[_0xd839('0x37')]=qs[_0xd839('0x38')](_0x477169['query'][_0xd839('0x38')]);_0x3595fd[_0xd839('0x39')]=qs[_0xd839('0x3a')](_[_0xd839('0x3b')](_0x477169[_0xd839('0x2f')],_0x17e3ce['filters']));if(_0x477169[_0xd839('0x2f')][_0xd839('0x3c')]){_0x3595fd[_0xd839('0x39')]=_[_0xd839('0x3d')](_0x3595fd[_0xd839('0x39')],{'$or':_[_0xd839('0x2a')](_0x3595fd[_0xd839('0x33')],function(_0x5a002c){var _0x2b7edd={};_0x2b7edd[_0x5a002c]={'$like':'%'+_0x477169[_0xd839('0x2f')][_0xd839('0x3c')]+'%'};return _0x2b7edd;})});}_0x3595fd=_[_0xd839('0x3d')]({},_0x3595fd,_0x477169[_0xd839('0x3f')]);return _0x152483[_0xd839('0x4b')](_0x3595fd);}})[_0xd839('0x26')](function(_0x4c2003){if(_0x4c2003){_0x2a0cce=_0x4c2003[_0xd839('0x34')];if(!_0x477169[_0xd839('0x2f')]['hasOwnProperty'](_0xd839('0x36'))){_0x3595fd[_0xd839('0x1f')]=qs[_0xd839('0x1f')](_0x477169[_0xd839('0x2f')][_0xd839('0x1f')]);_0x3595fd[_0xd839('0x1d')]=qs[_0xd839('0x1d')](_0x477169[_0xd839('0x2f')][_0xd839('0x1d')]);}return _0x152483['getFields'](_0x3595fd);}})[_0xd839('0x26')](function(_0x17cda3){if(_0x17cda3){return _0x17cda3?{'count':_0x2a0cce,'rows':_0x17cda3}:null;}})['then'](respondWithResult(_0x3249ed,null))[_0xd839('0x43')](handleError(_0x3249ed,null));};exports[_0xd839('0x4c')]=function(_0x1311d9,_0x52408e,_0x38703d){var _0x672fab={};var _0x2324e6={};var _0x1cb603;var _0x5c04dd;return db[_0xd839('0x40')][_0xd839('0x4d')]({'where':{'id':_0x1311d9['params']['id']}})[_0xd839('0x26')](handleEntityNotFound(_0x52408e,null))['then'](function(_0x574d74){if(_0x574d74){_0x1cb603=_0x574d74;_0x2324e6[_0xd839('0x2e')]=_[_0xd839('0x30')](db['Dynamics365Field'][_0xd839('0x45')]);_0x2324e6['query']=_[_0xd839('0x30')](_0x1311d9[_0xd839('0x2f')]);_0x2324e6[_0xd839('0x3a')]=_[_0xd839('0x31')](_0x2324e6[_0xd839('0x2e')],_0x2324e6[_0xd839('0x2f')]);_0x672fab[_0xd839('0x33')]=_[_0xd839('0x31')](_0x2324e6[_0xd839('0x2e')],qs['fields'](_0x1311d9['query']['fields']));_0x672fab[_0xd839('0x33')]=_0x672fab['attributes'][_0xd839('0x34')]?_0x672fab[_0xd839('0x33')]:_0x2324e6['model'];_0x672fab[_0xd839('0x37')]=qs['sort'](_0x1311d9['query'][_0xd839('0x38')]);_0x672fab['where']=qs[_0xd839('0x3a')](_['pick'](_0x1311d9[_0xd839('0x2f')],_0x2324e6[_0xd839('0x3a')]));if(_0x1311d9[_0xd839('0x2f')][_0xd839('0x3c')]){_0x672fab[_0xd839('0x39')]=_['merge'](_0x672fab['where'],{'$or':_['map'](_0x672fab[_0xd839('0x33')],function(_0x2b1784){var _0x49b2e0={};_0x49b2e0[_0x2b1784]={'$like':'%'+_0x1311d9[_0xd839('0x2f')]['filter']+'%'};return _0x49b2e0;})});}_0x672fab=_[_0xd839('0x3d')]({},_0x672fab,_0x1311d9[_0xd839('0x3f')]);return _0x1cb603[_0xd839('0x4c')](_0x672fab);}})[_0xd839('0x26')](function(_0x57f61a){if(_0x57f61a){_0x5c04dd=_0x57f61a[_0xd839('0x34')];if(!_0x1311d9['query'][_0xd839('0x35')]('nolimit')){_0x672fab['limit']=qs[_0xd839('0x1f')](_0x1311d9[_0xd839('0x2f')][_0xd839('0x1f')]);_0x672fab[_0xd839('0x1d')]=qs[_0xd839('0x1d')](_0x1311d9[_0xd839('0x2f')][_0xd839('0x1d')]);}return _0x1cb603[_0xd839('0x4c')](_0x672fab);}})[_0xd839('0x26')](function(_0x44be83){if(_0x44be83){return _0x44be83?{'count':_0x5c04dd,'rows':_0x44be83}:null;}})[_0xd839('0x26')](respondWithResult(_0x52408e,null))['catch'](handleError(_0x52408e,null));};exports['getDescriptions']=function(_0x4a947c,_0x2005bd,_0x2b9fb8){var _0xeafe84={};var _0x331b7e={};var _0x562198;var _0x59052e;return db[_0xd839('0x40')]['findOne']({'where':{'id':_0x4a947c[_0xd839('0x44')]['id']}})[_0xd839('0x26')](handleEntityNotFound(_0x2005bd,null))['then'](function(_0x1827e8){if(_0x1827e8){_0x562198=_0x1827e8;_0x331b7e['model']=_['keys'](db[_0xd839('0x4a')][_0xd839('0x45')]);_0x331b7e[_0xd839('0x2f')]=_['keys'](_0x4a947c[_0xd839('0x2f')]);_0x331b7e['filters']=_[_0xd839('0x31')](_0x331b7e[_0xd839('0x2e')],_0x331b7e[_0xd839('0x2f')]);_0xeafe84[_0xd839('0x33')]=_[_0xd839('0x31')](_0x331b7e[_0xd839('0x2e')],qs[_0xd839('0x32')](_0x4a947c[_0xd839('0x2f')]['fields']));_0xeafe84[_0xd839('0x33')]=_0xeafe84['attributes']['length']?_0xeafe84[_0xd839('0x33')]:_0x331b7e[_0xd839('0x2e')];_0xeafe84['order']=qs[_0xd839('0x38')](_0x4a947c['query'][_0xd839('0x38')]);_0xeafe84['where']=qs[_0xd839('0x3a')](_[_0xd839('0x3b')](_0x4a947c[_0xd839('0x2f')],_0x331b7e[_0xd839('0x3a')]));if(_0x4a947c[_0xd839('0x2f')][_0xd839('0x3c')]){_0xeafe84[_0xd839('0x39')]=_[_0xd839('0x3d')](_0xeafe84['where'],{'$or':_[_0xd839('0x2a')](_0xeafe84[_0xd839('0x33')],function(_0x289934){var _0x3ac6a0={};_0x3ac6a0[_0x289934]={'$like':'%'+_0x4a947c['query'][_0xd839('0x3c')]+'%'};return _0x3ac6a0;})});}_0xeafe84=_[_0xd839('0x3d')]({},_0xeafe84,_0x4a947c['options']);return _0x562198[_0xd839('0x4e')](_0xeafe84);}})[_0xd839('0x26')](function(_0x35b8e8){if(_0x35b8e8){_0x59052e=_0x35b8e8[_0xd839('0x34')];if(!_0x4a947c[_0xd839('0x2f')][_0xd839('0x35')](_0xd839('0x36'))){_0xeafe84['limit']=qs[_0xd839('0x1f')](_0x4a947c[_0xd839('0x2f')][_0xd839('0x1f')]);_0xeafe84[_0xd839('0x1d')]=qs[_0xd839('0x1d')](_0x4a947c['query'][_0xd839('0x1d')]);}return _0x562198[_0xd839('0x4e')](_0xeafe84);}})[_0xd839('0x26')](function(_0x52d502){if(_0x52d502){return _0x52d502?{'count':_0x59052e,'rows':_0x52d502}:null;}})[_0xd839('0x26')](respondWithResult(_0x2005bd,null))['catch'](handleError(_0x2005bd,null));}; \ No newline at end of file +var _0xc0c3=['count','offset','Content-Range','save','destroy','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','Dynamics365Field','merge','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','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','sendStatus','status','end','json','undefined','limit'];(function(_0x48ef0a,_0x32538c){var _0x4765ce=function(_0x43b36a){while(--_0x43b36a){_0x48ef0a['push'](_0x48ef0a['shift']());}};_0x4765ce(++_0x32538c);}(_0xc0c3,0xd8));var _0x3c0c=function(_0x1b6835,_0x541a5a){_0x1b6835=_0x1b6835-0x0;var _0x250b0e=_0xc0c3[_0x1b6835];return _0x250b0e;};'use strict';var emlformat=require(_0x3c0c('0x0'));var rimraf=require(_0x3c0c('0x1'));var zipdir=require(_0x3c0c('0x2'));var jsonpatch=require(_0x3c0c('0x3'));var rp=require(_0x3c0c('0x4'));var moment=require('moment');var BPromise=require(_0x3c0c('0x5'));var Mustache=require('mustache');var util=require(_0x3c0c('0x6'));var path=require(_0x3c0c('0x7'));var sox=require(_0x3c0c('0x8'));var csv=require('to-csv');var ejs=require(_0x3c0c('0x9'));var fs=require('fs');var fs_extra=require(_0x3c0c('0xa'));var _=require(_0x3c0c('0xb'));var squel=require(_0x3c0c('0xc'));var crypto=require(_0x3c0c('0xd'));var jsforce=require(_0x3c0c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c0c('0xf'));var querystring=require(_0x3c0c('0x10'));var Papa=require(_0x3c0c('0x11'));var Redis=require(_0x3c0c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3c0c('0x13'));var as=require(_0x3c0c('0x14'));var hardwareService=require(_0x3c0c('0x15'));var logger=require(_0x3c0c('0x16'))(_0x3c0c('0x17'));var utils=require(_0x3c0c('0x18'));var config=require(_0x3c0c('0x19'));var licenseUtil=require(_0x3c0c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c7d4,_0x2bbdba){_0x2bbdba=_0x2bbdba||0xcc;return function(_0x146f25){if(_0x146f25){return _0x15c7d4[_0x3c0c('0x1b')](_0x2bbdba);}return _0x15c7d4[_0x3c0c('0x1c')](_0x2bbdba)[_0x3c0c('0x1d')]();};}function respondWithResult(_0x32e8d6,_0x153f75){_0x153f75=_0x153f75||0xc8;return function(_0x5dd410){if(_0x5dd410){return _0x32e8d6[_0x3c0c('0x1c')](_0x153f75)[_0x3c0c('0x1e')](_0x5dd410);}};}function respondWithFilteredResult(_0x2ed5df,_0x369f74){return function(_0x37f1a8){if(_0x37f1a8){var _0x429ebc=typeof _0x369f74['offset']===_0x3c0c('0x1f')&&typeof _0x369f74[_0x3c0c('0x20')]===_0x3c0c('0x1f');var _0x1b11da=_0x37f1a8[_0x3c0c('0x21')];var _0x2a37fb=_0x429ebc?0x0:_0x369f74['offset'];var _0x4fc680=_0x429ebc?_0x37f1a8['count']:_0x369f74[_0x3c0c('0x22')]+_0x369f74[_0x3c0c('0x20')];var _0x1c6bc7;if(_0x4fc680>=_0x1b11da){_0x4fc680=_0x1b11da;_0x1c6bc7=0xc8;}else{_0x1c6bc7=0xce;}_0x2ed5df[_0x3c0c('0x1c')](_0x1c6bc7);return _0x2ed5df['set'](_0x3c0c('0x23'),_0x2a37fb+'-'+_0x4fc680+'/'+_0x1b11da)[_0x3c0c('0x1e')](_0x37f1a8);}return null;};}function patchUpdates(_0x28c66a){return function(_0x338de4){try{jsonpatch['apply'](_0x338de4,_0x28c66a,!![]);}catch(_0x59ca22){return BPromise['reject'](_0x59ca22);}return _0x338de4[_0x3c0c('0x24')]();};}function saveUpdates(_0x1f279a,_0x452596){return function(_0x39e9ab){if(_0x39e9ab){return _0x39e9ab['update'](_0x1f279a)['then'](function(_0x284799){return _0x284799;});}return null;};}function removeEntity(_0x96a839,_0x2d6709){return function(_0x57ccd4){if(_0x57ccd4){return _0x57ccd4[_0x3c0c('0x25')]()[_0x3c0c('0x26')](function(){_0x96a839[_0x3c0c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x80266a,_0x578632){return function(_0x38b518){if(!_0x38b518){_0x80266a[_0x3c0c('0x1b')](0x194);}return _0x38b518;};}function handleError(_0x1c29ce,_0x538042){_0x538042=_0x538042||0x1f4;return function(_0x3952c4){logger[_0x3c0c('0x27')](_0x3952c4[_0x3c0c('0x28')]);if(_0x3952c4['name']){delete _0x3952c4[_0x3c0c('0x29')];}_0x1c29ce[_0x3c0c('0x1c')](_0x538042)[_0x3c0c('0x2a')](_0x3952c4);};}exports[_0x3c0c('0x2b')]=function(_0x31755e,_0x4a01db){var _0x574cc8={},_0x5f2cb5={},_0x5dae79={'count':0x0,'rows':[]};var _0x45e1b4=_[_0x3c0c('0x2c')](db[_0x3c0c('0x2d')][_0x3c0c('0x2e')],function(_0x519622){return{'name':_0x519622[_0x3c0c('0x2f')],'type':_0x519622['type'][_0x3c0c('0x30')]};});_0x5f2cb5['model']=_[_0x3c0c('0x2c')](_0x45e1b4,_0x3c0c('0x29'));_0x5f2cb5['query']=_[_0x3c0c('0x31')](_0x31755e['query']);_0x5f2cb5[_0x3c0c('0x32')]=_[_0x3c0c('0x33')](_0x5f2cb5[_0x3c0c('0x34')],_0x5f2cb5[_0x3c0c('0x35')]);_0x574cc8['attributes']=_[_0x3c0c('0x33')](_0x5f2cb5[_0x3c0c('0x34')],qs['fields'](_0x31755e[_0x3c0c('0x35')][_0x3c0c('0x36')]));_0x574cc8['attributes']=_0x574cc8[_0x3c0c('0x37')][_0x3c0c('0x38')]?_0x574cc8[_0x3c0c('0x37')]:_0x5f2cb5[_0x3c0c('0x34')];if(!_0x31755e[_0x3c0c('0x35')]['hasOwnProperty'](_0x3c0c('0x39'))){_0x574cc8[_0x3c0c('0x20')]=qs[_0x3c0c('0x20')](_0x31755e[_0x3c0c('0x35')][_0x3c0c('0x20')]);_0x574cc8[_0x3c0c('0x22')]=qs[_0x3c0c('0x22')](_0x31755e[_0x3c0c('0x35')]['offset']);}_0x574cc8[_0x3c0c('0x3a')]=qs[_0x3c0c('0x3b')](_0x31755e[_0x3c0c('0x35')]['sort']);_0x574cc8[_0x3c0c('0x3c')]=qs[_0x3c0c('0x32')](_[_0x3c0c('0x3d')](_0x31755e[_0x3c0c('0x35')],_0x5f2cb5['filters']),_0x45e1b4);if(_0x31755e[_0x3c0c('0x35')]['filter']){_0x574cc8[_0x3c0c('0x3c')]=_['merge'](_0x574cc8[_0x3c0c('0x3c')],{'$or':_[_0x3c0c('0x2c')](_0x45e1b4,function(_0x10f767){if(_0x10f767[_0x3c0c('0x3e')]!==_0x3c0c('0x3f')){var _0xd70423={};_0xd70423[_0x10f767[_0x3c0c('0x29')]]={'$like':'%'+_0x31755e[_0x3c0c('0x35')][_0x3c0c('0x40')]+'%'};return _0xd70423;}})});}_0x574cc8=_['merge']({},_0x574cc8,_0x31755e[_0x3c0c('0x41')]);var _0x57129c={'where':_0x574cc8[_0x3c0c('0x3c')]};return db[_0x3c0c('0x2d')][_0x3c0c('0x21')](_0x57129c)[_0x3c0c('0x26')](function(_0x152502){_0x5dae79[_0x3c0c('0x21')]=_0x152502;if(_0x31755e['query']['includeAll']){_0x574cc8[_0x3c0c('0x42')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3c0c('0x43')](_0x574cc8);})['then'](function(_0xcdf033){_0x5dae79[_0x3c0c('0x44')]=_0xcdf033;return _0x5dae79;})[_0x3c0c('0x26')](respondWithFilteredResult(_0x4a01db,_0x574cc8))[_0x3c0c('0x45')](handleError(_0x4a01db,null));};exports[_0x3c0c('0x46')]=function(_0xfb2681,_0x4999ef){var _0x38cde8={'raw':![],'where':{'id':_0xfb2681[_0x3c0c('0x47')]['id']}},_0x4503e1={};_0x4503e1[_0x3c0c('0x34')]=_[_0x3c0c('0x31')](db['Dynamics365Configuration']['rawAttributes']);_0x4503e1[_0x3c0c('0x35')]=_[_0x3c0c('0x31')](_0xfb2681['query']);_0x4503e1[_0x3c0c('0x32')]=_['intersection'](_0x4503e1[_0x3c0c('0x34')],_0x4503e1[_0x3c0c('0x35')]);_0x38cde8[_0x3c0c('0x37')]=_[_0x3c0c('0x33')](_0x4503e1[_0x3c0c('0x34')],qs[_0x3c0c('0x36')](_0xfb2681['query'][_0x3c0c('0x36')]));_0x38cde8[_0x3c0c('0x37')]=_0x38cde8['attributes'][_0x3c0c('0x38')]?_0x38cde8[_0x3c0c('0x37')]:_0x4503e1[_0x3c0c('0x34')];if(_0xfb2681[_0x3c0c('0x35')]['includeAll']){_0x38cde8[_0x3c0c('0x42')]=[{'all':!![]}];}_0x38cde8=_['merge']({},_0x38cde8,_0xfb2681['options']);return db['Dynamics365Configuration'][_0x3c0c('0x48')](_0x38cde8)[_0x3c0c('0x26')](handleEntityNotFound(_0x4999ef,null))[_0x3c0c('0x26')](respondWithResult(_0x4999ef,null))['catch'](handleError(_0x4999ef,null));};exports[_0x3c0c('0x49')]=function(_0x3121e2,_0x3d1247){return db[_0x3c0c('0x2d')][_0x3c0c('0x49')](_0x3121e2[_0x3c0c('0x4a')],{})[_0x3c0c('0x26')](respondWithResult(_0x3d1247,0xc9))[_0x3c0c('0x45')](handleError(_0x3d1247,null));};exports[_0x3c0c('0x4b')]=function(_0x204099,_0x25fadd){if(_0x204099[_0x3c0c('0x4a')]['id']){delete _0x204099[_0x3c0c('0x4a')]['id'];}return db[_0x3c0c('0x2d')]['find']({'where':{'id':_0x204099[_0x3c0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x25fadd,null))[_0x3c0c('0x26')](saveUpdates(_0x204099[_0x3c0c('0x4a')],null))[_0x3c0c('0x26')](respondWithResult(_0x25fadd,null))[_0x3c0c('0x45')](handleError(_0x25fadd,null));};exports[_0x3c0c('0x25')]=function(_0x3160b7,_0x2ca64d){return db['Dynamics365Configuration']['find']({'where':{'id':_0x3160b7[_0x3c0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ca64d,null))[_0x3c0c('0x26')](removeEntity(_0x2ca64d,null))['catch'](handleError(_0x2ca64d,null));};exports[_0x3c0c('0x4c')]=function(_0x564581,_0x887004,_0x1594e6){var _0x47c956={};var _0x11c4d2={};var _0xdc3701;var _0xab8b42;return db[_0x3c0c('0x2d')][_0x3c0c('0x4d')]({'where':{'id':_0x564581['params']['id']}})['then'](handleEntityNotFound(_0x887004,null))[_0x3c0c('0x26')](function(_0x5e1167){if(_0x5e1167){_0xdc3701=_0x5e1167;_0x11c4d2[_0x3c0c('0x34')]=_['keys'](db[_0x3c0c('0x4e')][_0x3c0c('0x2e')]);_0x11c4d2[_0x3c0c('0x35')]=_['keys'](_0x564581[_0x3c0c('0x35')]);_0x11c4d2[_0x3c0c('0x32')]=_[_0x3c0c('0x33')](_0x11c4d2[_0x3c0c('0x34')],_0x11c4d2['query']);_0x47c956['attributes']=_[_0x3c0c('0x33')](_0x11c4d2[_0x3c0c('0x34')],qs['fields'](_0x564581[_0x3c0c('0x35')][_0x3c0c('0x36')]));_0x47c956[_0x3c0c('0x37')]=_0x47c956[_0x3c0c('0x37')]['length']?_0x47c956[_0x3c0c('0x37')]:_0x11c4d2['model'];_0x47c956[_0x3c0c('0x3a')]=qs[_0x3c0c('0x3b')](_0x564581['query']['sort']);_0x47c956[_0x3c0c('0x3c')]=qs[_0x3c0c('0x32')](_[_0x3c0c('0x3d')](_0x564581[_0x3c0c('0x35')],_0x11c4d2[_0x3c0c('0x32')]));if(_0x564581['query'][_0x3c0c('0x40')]){_0x47c956[_0x3c0c('0x3c')]=_[_0x3c0c('0x4f')](_0x47c956[_0x3c0c('0x3c')],{'$or':_[_0x3c0c('0x2c')](_0x47c956[_0x3c0c('0x37')],function(_0x3de7b7){var _0x41954f={};_0x41954f[_0x3de7b7]={'$like':'%'+_0x564581['query'][_0x3c0c('0x40')]+'%'};return _0x41954f;})});}_0x47c956=_[_0x3c0c('0x4f')]({},_0x47c956,_0x564581[_0x3c0c('0x41')]);return _0xdc3701[_0x3c0c('0x4c')](_0x47c956);}})['then'](function(_0x5d0750){if(_0x5d0750){_0xab8b42=_0x5d0750[_0x3c0c('0x38')];if(!_0x564581[_0x3c0c('0x35')][_0x3c0c('0x50')](_0x3c0c('0x39'))){_0x47c956[_0x3c0c('0x20')]=qs[_0x3c0c('0x20')](_0x564581[_0x3c0c('0x35')][_0x3c0c('0x20')]);_0x47c956[_0x3c0c('0x22')]=qs[_0x3c0c('0x22')](_0x564581[_0x3c0c('0x35')][_0x3c0c('0x22')]);}return _0xdc3701[_0x3c0c('0x4c')](_0x47c956);}})[_0x3c0c('0x26')](function(_0x2c19aa){if(_0x2c19aa){return _0x2c19aa?{'count':_0xab8b42,'rows':_0x2c19aa}:null;}})['then'](respondWithResult(_0x887004,null))[_0x3c0c('0x45')](handleError(_0x887004,null));};exports[_0x3c0c('0x51')]=function(_0x3d1e8a,_0x4bf67d,_0x44300){var _0x3f8754={};var _0x26145c={};var _0x4a6f38;var _0x2a4577;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x3d1e8a[_0x3c0c('0x47')]['id']}})[_0x3c0c('0x26')](handleEntityNotFound(_0x4bf67d,null))[_0x3c0c('0x26')](function(_0xc40228){if(_0xc40228){_0x4a6f38=_0xc40228;_0x26145c[_0x3c0c('0x34')]=_[_0x3c0c('0x31')](db[_0x3c0c('0x4e')][_0x3c0c('0x2e')]);_0x26145c['query']=_['keys'](_0x3d1e8a['query']);_0x26145c[_0x3c0c('0x32')]=_[_0x3c0c('0x33')](_0x26145c[_0x3c0c('0x34')],_0x26145c[_0x3c0c('0x35')]);_0x3f8754[_0x3c0c('0x37')]=_['intersection'](_0x26145c[_0x3c0c('0x34')],qs[_0x3c0c('0x36')](_0x3d1e8a['query']['fields']));_0x3f8754[_0x3c0c('0x37')]=_0x3f8754[_0x3c0c('0x37')][_0x3c0c('0x38')]?_0x3f8754[_0x3c0c('0x37')]:_0x26145c[_0x3c0c('0x34')];_0x3f8754[_0x3c0c('0x3a')]=qs['sort'](_0x3d1e8a[_0x3c0c('0x35')]['sort']);_0x3f8754['where']=qs[_0x3c0c('0x32')](_[_0x3c0c('0x3d')](_0x3d1e8a[_0x3c0c('0x35')],_0x26145c[_0x3c0c('0x32')]));if(_0x3d1e8a['query'][_0x3c0c('0x40')]){_0x3f8754['where']=_['merge'](_0x3f8754[_0x3c0c('0x3c')],{'$or':_['map'](_0x3f8754['attributes'],function(_0x20b583){var _0x36679e={};_0x36679e[_0x20b583]={'$like':'%'+_0x3d1e8a['query'][_0x3c0c('0x40')]+'%'};return _0x36679e;})});}_0x3f8754=_[_0x3c0c('0x4f')]({},_0x3f8754,_0x3d1e8a[_0x3c0c('0x41')]);return _0x4a6f38[_0x3c0c('0x51')](_0x3f8754);}})[_0x3c0c('0x26')](function(_0x3aea51){if(_0x3aea51){_0x2a4577=_0x3aea51[_0x3c0c('0x38')];if(!_0x3d1e8a[_0x3c0c('0x35')]['hasOwnProperty']('nolimit')){_0x3f8754[_0x3c0c('0x20')]=qs[_0x3c0c('0x20')](_0x3d1e8a[_0x3c0c('0x35')][_0x3c0c('0x20')]);_0x3f8754[_0x3c0c('0x22')]=qs[_0x3c0c('0x22')](_0x3d1e8a[_0x3c0c('0x35')][_0x3c0c('0x22')]);}return _0x4a6f38[_0x3c0c('0x51')](_0x3f8754);}})[_0x3c0c('0x26')](function(_0x28aa7a){if(_0x28aa7a){return _0x28aa7a?{'count':_0x2a4577,'rows':_0x28aa7a}:null;}})[_0x3c0c('0x26')](respondWithResult(_0x4bf67d,null))[_0x3c0c('0x45')](handleError(_0x4bf67d,null));};exports['getDescriptions']=function(_0x550f9a,_0x1584d2,_0x24e305){var _0x363470={};var _0x48ca04={};var _0x2ce22a;var _0x248f87;return db[_0x3c0c('0x2d')]['findOne']({'where':{'id':_0x550f9a[_0x3c0c('0x47')]['id']}})[_0x3c0c('0x26')](handleEntityNotFound(_0x1584d2,null))[_0x3c0c('0x26')](function(_0x2f388d){if(_0x2f388d){_0x2ce22a=_0x2f388d;_0x48ca04[_0x3c0c('0x34')]=_['keys'](db[_0x3c0c('0x4e')][_0x3c0c('0x2e')]);_0x48ca04[_0x3c0c('0x35')]=_[_0x3c0c('0x31')](_0x550f9a['query']);_0x48ca04[_0x3c0c('0x32')]=_[_0x3c0c('0x33')](_0x48ca04[_0x3c0c('0x34')],_0x48ca04['query']);_0x363470[_0x3c0c('0x37')]=_[_0x3c0c('0x33')](_0x48ca04[_0x3c0c('0x34')],qs['fields'](_0x550f9a[_0x3c0c('0x35')][_0x3c0c('0x36')]));_0x363470[_0x3c0c('0x37')]=_0x363470[_0x3c0c('0x37')][_0x3c0c('0x38')]?_0x363470['attributes']:_0x48ca04[_0x3c0c('0x34')];_0x363470['order']=qs['sort'](_0x550f9a['query'][_0x3c0c('0x3b')]);_0x363470['where']=qs[_0x3c0c('0x32')](_[_0x3c0c('0x3d')](_0x550f9a[_0x3c0c('0x35')],_0x48ca04[_0x3c0c('0x32')]));if(_0x550f9a[_0x3c0c('0x35')][_0x3c0c('0x40')]){_0x363470[_0x3c0c('0x3c')]=_[_0x3c0c('0x4f')](_0x363470[_0x3c0c('0x3c')],{'$or':_[_0x3c0c('0x2c')](_0x363470['attributes'],function(_0x442d32){var _0x2e551f={};_0x2e551f[_0x442d32]={'$like':'%'+_0x550f9a[_0x3c0c('0x35')]['filter']+'%'};return _0x2e551f;})});}_0x363470=_[_0x3c0c('0x4f')]({},_0x363470,_0x550f9a[_0x3c0c('0x41')]);return _0x2ce22a['getDescriptions'](_0x363470);}})['then'](function(_0x20647e){if(_0x20647e){_0x248f87=_0x20647e[_0x3c0c('0x38')];if(!_0x550f9a['query'][_0x3c0c('0x50')](_0x3c0c('0x39'))){_0x363470[_0x3c0c('0x20')]=qs['limit'](_0x550f9a[_0x3c0c('0x35')][_0x3c0c('0x20')]);_0x363470['offset']=qs['offset'](_0x550f9a[_0x3c0c('0x35')][_0x3c0c('0x22')]);}return _0x2ce22a[_0x3c0c('0x52')](_0x363470);}})[_0x3c0c('0x26')](function(_0x562b2c){if(_0x562b2c){return _0x562b2c?{'count':_0x248f87,'rows':_0x562b2c}:null;}})[_0x3c0c('0x26')](respondWithResult(_0x1584d2,null))[_0x3c0c('0x45')](handleError(_0x1584d2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 047787f..aaf4225 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 _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x187e48,_0x4a8cb8){var _0x4684a0=function(_0x53ff7d){while(--_0x53ff7d){_0x187e48['push'](_0x187e48['shift']());}};_0x4684a0(++_0x4a8cb8);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xb4e6[_0x576266];return _0x18234f;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x4070fe,_0x4f253b){var _0x430c8b=function(_0x408c31){while(--_0x408c31){_0x4070fe['push'](_0x4070fe['shift']());}};_0x430c8b(++_0x4f253b);}(_0x70e0,0x17b));var _0x070e=function(_0x522382,_0x1f8d81){_0x522382=_0x522382-0x0;var _0xfa7ae6=_0x70e0[_0x522382];return _0xfa7ae6;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'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 a63a202..11272d0 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 _0x679e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x679e,0xc0));var _0xe679=function(_0x2aff39,_0x3e33f4){_0x2aff39=_0x2aff39-0x0;var _0x11c030=_0x679e[_0x2aff39];return _0x11c030;};'use strict';var _=require(_0xe679('0x0'));var util=require(_0xe679('0x1'));var moment=require('moment');var BPromise=require(_0xe679('0x2'));var rs=require(_0xe679('0x3'));var fs=require('fs');var Redis=require(_0xe679('0x4'));var db=require(_0xe679('0x5'))['db'];var utils=require(_0xe679('0x6'));var logger=require(_0xe679('0x7'))(_0xe679('0x8'));var config=require(_0xe679('0x9'));var jayson=require(_0xe679('0xa'));var client=jayson[_0xe679('0xb')][_0xe679('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x352d75,_0x1b4f32,_0xb2332){return new BPromise(function(_0x303501,_0x4fa596){return client[_0xe679('0xd')](_0x352d75,_0xb2332)[_0xe679('0xe')](function(_0x51a7cb){logger['info'](_0xe679('0xf'),_0x1b4f32,_0xe679('0x10'));logger['debug'](_0xe679('0x11'),_0x1b4f32,'request\x20sent',JSON[_0xe679('0x12')](_0x51a7cb));if(_0x51a7cb[_0xe679('0x13')]){if(_0x51a7cb[_0xe679('0x13')][_0xe679('0x14')]===0x1f4){logger['error'](_0xe679('0xf'),_0x1b4f32,_0x51a7cb[_0xe679('0x13')][_0xe679('0x15')]);return _0x4fa596(_0x51a7cb[_0xe679('0x13')]['message']);}logger['error'](_0xe679('0xf'),_0x1b4f32,_0x51a7cb[_0xe679('0x13')]['message']);return _0x303501(_0x51a7cb['error'][_0xe679('0x15')]);}else{logger[_0xe679('0x16')](_0xe679('0xf'),_0x1b4f32,'request\x20sent');_0x303501(_0x51a7cb['result'][_0xe679('0x15')]);}})[_0xe679('0x17')](function(_0x3853b0){logger['error'](_0xe679('0xf'),_0x1b4f32,_0x3853b0);_0x4fa596(_0x3853b0);});});} \ No newline at end of file +var _0xf43c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1edd16,_0x698d50){var _0x3f552f=function(_0x3a9fde){while(--_0x3a9fde){_0x1edd16['push'](_0x1edd16['shift']());}};_0x3f552f(++_0x698d50);}(_0xf43c,0x8f));var _0xcf43=function(_0x3a54db,_0x1b63a5){_0x3a54db=_0x3a54db-0x0;var _0x17a3bd=_0xf43c[_0x3a54db];return _0x17a3bd;};'use strict';var _=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var moment=require(_0xcf43('0x2'));var BPromise=require(_0xcf43('0x3'));var rs=require(_0xcf43('0x4'));var fs=require('fs');var Redis=require(_0xcf43('0x5'));var db=require(_0xcf43('0x6'))['db'];var utils=require(_0xcf43('0x7'));var logger=require(_0xcf43('0x8'))(_0xcf43('0x9'));var config=require(_0xcf43('0xa'));var jayson=require(_0xcf43('0xb'));var client=jayson[_0xcf43('0xc')][_0xcf43('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x11287b,_0x22746a,_0x241dce){return new BPromise(function(_0x5a7a24,_0x1f1892){return client['request'](_0x11287b,_0x241dce)[_0xcf43('0xe')](function(_0x41b5fb){logger[_0xcf43('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x22746a,_0xcf43('0x10'));logger[_0xcf43('0x11')](_0xcf43('0x12'),_0x22746a,'request\x20sent',JSON[_0xcf43('0x13')](_0x41b5fb));if(_0x41b5fb['error']){if(_0x41b5fb[_0xcf43('0x14')][_0xcf43('0x15')]===0x1f4){logger[_0xcf43('0x14')](_0xcf43('0x16'),_0x22746a,_0x41b5fb[_0xcf43('0x14')][_0xcf43('0x17')]);return _0x1f1892(_0x41b5fb[_0xcf43('0x14')][_0xcf43('0x17')]);}logger[_0xcf43('0x14')](_0xcf43('0x16'),_0x22746a,_0x41b5fb[_0xcf43('0x14')]['message']);return _0x5a7a24(_0x41b5fb[_0xcf43('0x14')][_0xcf43('0x17')]);}else{logger[_0xcf43('0xf')](_0xcf43('0x16'),_0x22746a,_0xcf43('0x10'));_0x5a7a24(_0x41b5fb['result'][_0xcf43('0x17')]);}})[_0xcf43('0x18')](function(_0x1bea31){logger[_0xcf43('0x14')](_0xcf43('0x16'),_0x22746a,_0x1bea31);_0x1f1892(_0x1bea31);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 9101265..48597fb 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 _0x0a24=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0xa028ff,_0x1716ba){var _0x1f93cd=function(_0x522933){while(--_0x522933){_0xa028ff['push'](_0xa028ff['shift']());}};_0x1f93cd(++_0x1716ba);}(_0x0a24,0xda));var _0x40a2=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0x0a24[_0x482b06];return _0x404a0a;};'use strict';var multer=require(_0x40a2('0x0'));var util=require(_0x40a2('0x1'));var path=require(_0x40a2('0x2'));var timeout=require(_0x40a2('0x3'));var express=require(_0x40a2('0x4'));var router=express[_0x40a2('0x5')]();var fs_extra=require(_0x40a2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x40a2('0x7'));var controller=require(_0x40a2('0x8'));router[_0x40a2('0x9')]('/',auth[_0x40a2('0xa')](),controller[_0x40a2('0xb')]);router[_0x40a2('0x9')](_0x40a2('0xc'),auth[_0x40a2('0xa')](),controller[_0x40a2('0xd')]);router['post']('/',auth[_0x40a2('0xa')](),controller[_0x40a2('0xe')]);router['put']('/:id',auth[_0x40a2('0xa')](),controller[_0x40a2('0xf')]);router[_0x40a2('0x10')](_0x40a2('0xc'),auth[_0x40a2('0xa')](),controller['destroy']);module[_0x40a2('0x11')]=router; \ No newline at end of file +var _0x1e26=['multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','post','put','/:id','update','delete','destroy','exports'];(function(_0x14d2f9,_0x1c364c){var _0x1efb3f=function(_0x3f04c8){while(--_0x3f04c8){_0x14d2f9['push'](_0x14d2f9['shift']());}};_0x1efb3f(++_0x1c364c);}(_0x1e26,0xc6));var _0x61e2=function(_0x5b6112,_0x1d90bc){_0x5b6112=_0x5b6112-0x0;var _0x565126=_0x1e26[_0x5b6112];return _0x565126;};'use strict';var multer=require(_0x61e2('0x0'));var util=require(_0x61e2('0x1'));var path=require(_0x61e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x61e2('0x3'));var router=express['Router']();var fs_extra=require(_0x61e2('0x4'));var auth=require(_0x61e2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x61e2('0x6'));var controller=require(_0x61e2('0x7'));router['get']('/',auth[_0x61e2('0x8')](),controller[_0x61e2('0x9')]);router[_0x61e2('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x61e2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x61e2('0xc')](_0x61e2('0xd'),auth[_0x61e2('0x8')](),controller[_0x61e2('0xe')]);router[_0x61e2('0xf')](_0x61e2('0xd'),auth['isAuthenticated'](),controller[_0x61e2('0x10')]);module[_0x61e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 01fe27b..2fea363 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 _0x59cf=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x534d78,_0x508d3d){var _0x1b7c56=function(_0x34320f){while(--_0x34320f){_0x534d78['push'](_0x534d78['shift']());}};_0x1b7c56(++_0x508d3d);}(_0x59cf,0xf7));var _0xf59c=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x59cf[_0x51b1a5];return _0x15c738;};'use strict';var Sequelize=require(_0xf59c('0x0'));module[_0xf59c('0x1')]={'type':{'type':Sequelize[_0xf59c('0x2')](_0xf59c('0x3'),_0xf59c('0x4'),_0xf59c('0x5'),_0xf59c('0x6'),_0xf59c('0x7')),'defaultValue':_0xf59c('0x3')},'content':{'type':Sequelize[_0xf59c('0x8')]},'key':{'type':Sequelize[_0xf59c('0x8')]},'keyType':{'type':Sequelize[_0xf59c('0x2')]('string','variable',_0xf59c('0x5'))},'keyContent':{'type':Sequelize[_0xf59c('0x8')]},'idField':{'type':Sequelize[_0xf59c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf59c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf59c('0x8')]}}; \ No newline at end of file +var _0xf26c=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x9489cf,_0x4329d0){var _0x413264=function(_0xbd5d80){while(--_0xbd5d80){_0x9489cf['push'](_0x9489cf['shift']());}};_0x413264(++_0x4329d0);}(_0xf26c,0x130));var _0xcf26=function(_0x13f4b7,_0x483e98){_0x13f4b7=_0x13f4b7-0x0;var _0x7107c8=_0xf26c[_0x13f4b7];return _0x7107c8;};'use strict';var Sequelize=require(_0xcf26('0x0'));module[_0xcf26('0x1')]={'type':{'type':Sequelize[_0xcf26('0x2')](_0xcf26('0x3'),_0xcf26('0x4'),_0xcf26('0x5'),_0xcf26('0x6'),'picklist'),'defaultValue':_0xcf26('0x3')},'content':{'type':Sequelize[_0xcf26('0x7')]},'key':{'type':Sequelize[_0xcf26('0x7')]},'keyType':{'type':Sequelize[_0xcf26('0x2')](_0xcf26('0x3'),'variable',_0xcf26('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcf26('0x7')]},'nameField':{'type':Sequelize[_0xcf26('0x7')]},'customField':{'type':Sequelize[_0xcf26('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcf26('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ea7e221..cc90456 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 _0xd6d2=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','send','map','Dynamics365Field','type','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xd6d2,0x86));var _0x2d6d=function(_0x24317b,_0x2c8925){_0x24317b=_0x24317b-0x0;var _0x41d9e7=_0xd6d2[_0x24317b];return _0x41d9e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d6d('0x0'));var zipdir=require(_0x2d6d('0x1'));var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require(_0x2d6d('0x4'));var BPromise=require(_0x2d6d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d6d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d6d('0x7'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x8'));var _=require('lodash');var squel=require(_0x2d6d('0x9'));var crypto=require(_0x2d6d('0xa'));var jsforce=require(_0x2d6d('0xb'));var deskjs=require(_0x2d6d('0xc'));var toCsv=require(_0x2d6d('0xd'));var querystring=require(_0x2d6d('0xe'));var Papa=require(_0x2d6d('0xf'));var Redis=require(_0x2d6d('0x10'));var authService=require(_0x2d6d('0x11'));var qs=require(_0x2d6d('0x12'));var as=require(_0x2d6d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d6d('0x14'));var utils=require(_0x2d6d('0x15'));var config=require(_0x2d6d('0x16'));var licenseUtil=require(_0x2d6d('0x17'));var db=require(_0x2d6d('0x18'))['db'];function respondWithStatusCode(_0x87b011,_0x3a74f3){_0x3a74f3=_0x3a74f3||0xcc;return function(_0x439ab4){if(_0x439ab4){return _0x87b011[_0x2d6d('0x19')](_0x3a74f3);}return _0x87b011[_0x2d6d('0x1a')](_0x3a74f3)[_0x2d6d('0x1b')]();};}function respondWithResult(_0x5a0ffb,_0x14c15a){_0x14c15a=_0x14c15a||0xc8;return function(_0x19253d){if(_0x19253d){return _0x5a0ffb['status'](_0x14c15a)[_0x2d6d('0x1c')](_0x19253d);}};}function respondWithFilteredResult(_0x45b1c4,_0x36bc61){return function(_0x58d142){if(_0x58d142){var _0x2c8d3d=typeof _0x36bc61['offset']==='undefined'&&typeof _0x36bc61[_0x2d6d('0x1d')]===_0x2d6d('0x1e');var _0x3dc661=_0x58d142[_0x2d6d('0x1f')];var _0x5c94c3=_0x2c8d3d?0x0:_0x36bc61[_0x2d6d('0x20')];var _0x262cf4=_0x2c8d3d?_0x58d142['count']:_0x36bc61['offset']+_0x36bc61[_0x2d6d('0x1d')];var _0xa25a21;if(_0x262cf4>=_0x3dc661){_0x262cf4=_0x3dc661;_0xa25a21=0xc8;}else{_0xa25a21=0xce;}_0x45b1c4[_0x2d6d('0x1a')](_0xa25a21);return _0x45b1c4[_0x2d6d('0x21')](_0x2d6d('0x22'),_0x5c94c3+'-'+_0x262cf4+'/'+_0x3dc661)[_0x2d6d('0x1c')](_0x58d142);}return null;};}function patchUpdates(_0x33f191){return function(_0xe2eedc){try{jsonpatch[_0x2d6d('0x23')](_0xe2eedc,_0x33f191,!![]);}catch(_0x1c5a96){return BPromise[_0x2d6d('0x24')](_0x1c5a96);}return _0xe2eedc[_0x2d6d('0x25')]();};}function saveUpdates(_0x51ff54,_0x715ea5){return function(_0x1d97dd){if(_0x1d97dd){return _0x1d97dd['update'](_0x51ff54)[_0x2d6d('0x26')](function(_0x546636){return _0x546636;});}return null;};}function removeEntity(_0x2b1d4b,_0x2d332a){return function(_0x52ef58){if(_0x52ef58){return _0x52ef58[_0x2d6d('0x27')]()[_0x2d6d('0x26')](function(){_0x2b1d4b[_0x2d6d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f365,_0x4cee9e){return function(_0x320343){if(!_0x320343){_0x38f365[_0x2d6d('0x19')](0x194);}return _0x320343;};}function handleError(_0x1d21b0,_0x4be88c){_0x4be88c=_0x4be88c||0x1f4;return function(_0x2329de){logger['error'](_0x2329de[_0x2d6d('0x28')]);if(_0x2329de['name']){delete _0x2329de['name'];}_0x1d21b0[_0x2d6d('0x1a')](_0x4be88c)[_0x2d6d('0x29')](_0x2329de);};}exports['index']=function(_0x54c4e9,_0x53c081){var _0x4fc2ea={},_0x482840={},_0xa41723={'count':0x0,'rows':[]};var _0x528a1c=_[_0x2d6d('0x2a')](db[_0x2d6d('0x2b')]['rawAttributes'],function(_0x49f099){return{'name':_0x49f099['fieldName'],'type':_0x49f099[_0x2d6d('0x2c')][_0x2d6d('0x2d')]};});_0x482840[_0x2d6d('0x2e')]=_[_0x2d6d('0x2a')](_0x528a1c,_0x2d6d('0x2f'));_0x482840[_0x2d6d('0x30')]=_['keys'](_0x54c4e9['query']);_0x482840[_0x2d6d('0x31')]=_[_0x2d6d('0x32')](_0x482840[_0x2d6d('0x2e')],_0x482840[_0x2d6d('0x30')]);_0x4fc2ea['attributes']=_[_0x2d6d('0x32')](_0x482840['model'],qs[_0x2d6d('0x33')](_0x54c4e9[_0x2d6d('0x30')]['fields']));_0x4fc2ea[_0x2d6d('0x34')]=_0x4fc2ea[_0x2d6d('0x34')]['length']?_0x4fc2ea[_0x2d6d('0x34')]:_0x482840[_0x2d6d('0x2e')];if(!_0x54c4e9[_0x2d6d('0x30')][_0x2d6d('0x35')](_0x2d6d('0x36'))){_0x4fc2ea[_0x2d6d('0x1d')]=qs[_0x2d6d('0x1d')](_0x54c4e9[_0x2d6d('0x30')][_0x2d6d('0x1d')]);_0x4fc2ea[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x54c4e9[_0x2d6d('0x30')][_0x2d6d('0x20')]);}_0x4fc2ea[_0x2d6d('0x37')]=qs[_0x2d6d('0x38')](_0x54c4e9['query'][_0x2d6d('0x38')]);_0x4fc2ea[_0x2d6d('0x39')]=qs[_0x2d6d('0x31')](_[_0x2d6d('0x3a')](_0x54c4e9[_0x2d6d('0x30')],_0x482840[_0x2d6d('0x31')]),_0x528a1c);if(_0x54c4e9[_0x2d6d('0x30')][_0x2d6d('0x3b')]){_0x4fc2ea[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x4fc2ea['where'],{'$or':_['map'](_0x528a1c,function(_0xa13876){if(_0xa13876['type']!==_0x2d6d('0x3d')){var _0x3eed88={};_0x3eed88[_0xa13876[_0x2d6d('0x2f')]]={'$like':'%'+_0x54c4e9['query'][_0x2d6d('0x3b')]+'%'};return _0x3eed88;}})});}_0x4fc2ea=_['merge']({},_0x4fc2ea,_0x54c4e9[_0x2d6d('0x3e')]);var _0x43e908={'where':_0x4fc2ea[_0x2d6d('0x39')]};return db[_0x2d6d('0x2b')][_0x2d6d('0x1f')](_0x43e908)[_0x2d6d('0x26')](function(_0x4c1cec){_0xa41723[_0x2d6d('0x1f')]=_0x4c1cec;if(_0x54c4e9[_0x2d6d('0x30')][_0x2d6d('0x3f')]){_0x4fc2ea[_0x2d6d('0x40')]=[{'all':!![]}];}return db[_0x2d6d('0x2b')][_0x2d6d('0x41')](_0x4fc2ea);})[_0x2d6d('0x26')](function(_0x41fb8c){_0xa41723[_0x2d6d('0x42')]=_0x41fb8c;return _0xa41723;})['then'](respondWithFilteredResult(_0x53c081,_0x4fc2ea))['catch'](handleError(_0x53c081,null));};exports[_0x2d6d('0x43')]=function(_0x20ef1f,_0x15af30){var _0x344ad4={'raw':!![],'where':{'id':_0x20ef1f[_0x2d6d('0x44')]['id']}},_0x5e241d={};_0x5e241d[_0x2d6d('0x2e')]=_[_0x2d6d('0x45')](db[_0x2d6d('0x2b')][_0x2d6d('0x46')]);_0x5e241d[_0x2d6d('0x30')]=_['keys'](_0x20ef1f['query']);_0x5e241d['filters']=_[_0x2d6d('0x32')](_0x5e241d[_0x2d6d('0x2e')],_0x5e241d[_0x2d6d('0x30')]);_0x344ad4['attributes']=_[_0x2d6d('0x32')](_0x5e241d['model'],qs[_0x2d6d('0x33')](_0x20ef1f[_0x2d6d('0x30')][_0x2d6d('0x33')]));_0x344ad4['attributes']=_0x344ad4['attributes']['length']?_0x344ad4['attributes']:_0x5e241d['model'];if(_0x20ef1f['query'][_0x2d6d('0x3f')]){_0x344ad4[_0x2d6d('0x40')]=[{'all':!![]}];}_0x344ad4=_[_0x2d6d('0x3c')]({},_0x344ad4,_0x20ef1f[_0x2d6d('0x3e')]);return db[_0x2d6d('0x2b')][_0x2d6d('0x47')](_0x344ad4)[_0x2d6d('0x26')](handleEntityNotFound(_0x15af30,null))[_0x2d6d('0x26')](respondWithResult(_0x15af30,null))[_0x2d6d('0x48')](handleError(_0x15af30,null));};exports[_0x2d6d('0x49')]=function(_0x502585,_0x43e1f4){return db[_0x2d6d('0x2b')][_0x2d6d('0x49')](_0x502585[_0x2d6d('0x4a')],{})[_0x2d6d('0x26')](respondWithResult(_0x43e1f4,0xc9))[_0x2d6d('0x48')](handleError(_0x43e1f4,null));};exports[_0x2d6d('0x4b')]=function(_0x1d183e,_0x11ae62){if(_0x1d183e[_0x2d6d('0x4a')]['id']){delete _0x1d183e[_0x2d6d('0x4a')]['id'];}return db[_0x2d6d('0x2b')]['find']({'where':{'id':_0x1d183e[_0x2d6d('0x44')]['id']}})['then'](handleEntityNotFound(_0x11ae62,null))['then'](saveUpdates(_0x1d183e[_0x2d6d('0x4a')],null))['then'](respondWithResult(_0x11ae62,null))[_0x2d6d('0x48')](handleError(_0x11ae62,null));};exports[_0x2d6d('0x27')]=function(_0x597925,_0xf3cd1c){return db[_0x2d6d('0x2b')][_0x2d6d('0x47')]({'where':{'id':_0x597925[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x26')](handleEntityNotFound(_0xf3cd1c,null))[_0x2d6d('0x26')](removeEntity(_0xf3cd1c,null))[_0x2d6d('0x48')](handleError(_0xf3cd1c,null));}; \ No newline at end of file +var _0x21fb=['fieldName','model','keys','query','intersection','attributes','fields','nolimit','order','filters','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','send','map','Dynamics365Field','rawAttributes'];(function(_0x25f0ea,_0xd6d029){var _0x275268=function(_0x35492a){while(--_0x35492a){_0x25f0ea['push'](_0x25f0ea['shift']());}};_0x275268(++_0xd6d029);}(_0x21fb,0xe6));var _0xb21f=function(_0x26c1ff,_0x195e06){_0x26c1ff=_0x26c1ff-0x0;var _0x3dc051=_0x21fb[_0x26c1ff];return _0x3dc051;};'use strict';var emlformat=require(_0xb21f('0x0'));var rimraf=require(_0xb21f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb21f('0x2'));var BPromise=require(_0xb21f('0x3'));var Mustache=require(_0xb21f('0x4'));var util=require(_0xb21f('0x5'));var path=require(_0xb21f('0x6'));var sox=require(_0xb21f('0x7'));var csv=require(_0xb21f('0x8'));var ejs=require(_0xb21f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb21f('0xa'));var crypto=require(_0xb21f('0xb'));var jsforce=require(_0xb21f('0xc'));var deskjs=require(_0xb21f('0xd'));var toCsv=require(_0xb21f('0x8'));var querystring=require(_0xb21f('0xe'));var Papa=require('papaparse');var Redis=require(_0xb21f('0xf'));var authService=require(_0xb21f('0x10'));var qs=require(_0xb21f('0x11'));var as=require(_0xb21f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb21f('0x13'))(_0xb21f('0x14'));var utils=require('../../config/utils');var config=require(_0xb21f('0x15'));var licenseUtil=require(_0xb21f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52a002,_0x322e67){_0x322e67=_0x322e67||0xcc;return function(_0x328a48){if(_0x328a48){return _0x52a002[_0xb21f('0x17')](_0x322e67);}return _0x52a002['status'](_0x322e67)[_0xb21f('0x18')]();};}function respondWithResult(_0x5e2cd3,_0x372ace){_0x372ace=_0x372ace||0xc8;return function(_0x226787){if(_0x226787){return _0x5e2cd3[_0xb21f('0x19')](_0x372ace)['json'](_0x226787);}};}function respondWithFilteredResult(_0x1c21e0,_0x46440a){return function(_0x225b47){if(_0x225b47){var _0xc7a3b7=typeof _0x46440a[_0xb21f('0x1a')]===_0xb21f('0x1b')&&typeof _0x46440a[_0xb21f('0x1c')]===_0xb21f('0x1b');var _0x56db03=_0x225b47[_0xb21f('0x1d')];var _0x5f2ccd=_0xc7a3b7?0x0:_0x46440a[_0xb21f('0x1a')];var _0x22cd0f=_0xc7a3b7?_0x225b47[_0xb21f('0x1d')]:_0x46440a['offset']+_0x46440a[_0xb21f('0x1c')];var _0x1b4b0b;if(_0x22cd0f>=_0x56db03){_0x22cd0f=_0x56db03;_0x1b4b0b=0xc8;}else{_0x1b4b0b=0xce;}_0x1c21e0[_0xb21f('0x19')](_0x1b4b0b);return _0x1c21e0[_0xb21f('0x1e')](_0xb21f('0x1f'),_0x5f2ccd+'-'+_0x22cd0f+'/'+_0x56db03)['json'](_0x225b47);}return null;};}function patchUpdates(_0x2d2ab9){return function(_0x33e06b){try{jsonpatch[_0xb21f('0x20')](_0x33e06b,_0x2d2ab9,!![]);}catch(_0xba5f40){return BPromise['reject'](_0xba5f40);}return _0x33e06b['save']();};}function saveUpdates(_0x5846b5,_0x4c567){return function(_0x16cd45){if(_0x16cd45){return _0x16cd45[_0xb21f('0x21')](_0x5846b5)[_0xb21f('0x22')](function(_0x5f2e4c){return _0x5f2e4c;});}return null;};}function removeEntity(_0x481850,_0x21f5e3){return function(_0x1151bd){if(_0x1151bd){return _0x1151bd[_0xb21f('0x23')]()[_0xb21f('0x22')](function(){_0x481850[_0xb21f('0x19')](0xcc)[_0xb21f('0x18')]();});}};}function handleEntityNotFound(_0x438bda,_0x279a3c){return function(_0x44d53f){if(!_0x44d53f){_0x438bda['sendStatus'](0x194);}return _0x44d53f;};}function handleError(_0x1adbc4,_0x51af94){_0x51af94=_0x51af94||0x1f4;return function(_0x218a4b){logger[_0xb21f('0x24')](_0x218a4b['stack']);if(_0x218a4b[_0xb21f('0x25')]){delete _0x218a4b[_0xb21f('0x25')];}_0x1adbc4[_0xb21f('0x19')](_0x51af94)[_0xb21f('0x26')](_0x218a4b);};}exports['index']=function(_0x1df220,_0x192578){var _0x22f279={},_0x334735={},_0x5dd24a={'count':0x0,'rows':[]};var _0x1ce71b=_[_0xb21f('0x27')](db[_0xb21f('0x28')][_0xb21f('0x29')],function(_0x1a8b7b){return{'name':_0x1a8b7b[_0xb21f('0x2a')],'type':_0x1a8b7b['type']['key']};});_0x334735[_0xb21f('0x2b')]=_['map'](_0x1ce71b,_0xb21f('0x25'));_0x334735['query']=_[_0xb21f('0x2c')](_0x1df220[_0xb21f('0x2d')]);_0x334735['filters']=_[_0xb21f('0x2e')](_0x334735[_0xb21f('0x2b')],_0x334735[_0xb21f('0x2d')]);_0x22f279[_0xb21f('0x2f')]=_['intersection'](_0x334735[_0xb21f('0x2b')],qs[_0xb21f('0x30')](_0x1df220[_0xb21f('0x2d')][_0xb21f('0x30')]));_0x22f279[_0xb21f('0x2f')]=_0x22f279[_0xb21f('0x2f')]['length']?_0x22f279[_0xb21f('0x2f')]:_0x334735['model'];if(!_0x1df220[_0xb21f('0x2d')]['hasOwnProperty'](_0xb21f('0x31'))){_0x22f279['limit']=qs['limit'](_0x1df220[_0xb21f('0x2d')][_0xb21f('0x1c')]);_0x22f279[_0xb21f('0x1a')]=qs[_0xb21f('0x1a')](_0x1df220[_0xb21f('0x2d')][_0xb21f('0x1a')]);}_0x22f279[_0xb21f('0x32')]=qs['sort'](_0x1df220[_0xb21f('0x2d')]['sort']);_0x22f279['where']=qs[_0xb21f('0x33')](_['pick'](_0x1df220[_0xb21f('0x2d')],_0x334735[_0xb21f('0x33')]),_0x1ce71b);if(_0x1df220[_0xb21f('0x2d')]['filter']){_0x22f279[_0xb21f('0x34')]=_['merge'](_0x22f279[_0xb21f('0x34')],{'$or':_[_0xb21f('0x27')](_0x1ce71b,function(_0x5cfb91){if(_0x5cfb91[_0xb21f('0x35')]!==_0xb21f('0x36')){var _0x24042a={};_0x24042a[_0x5cfb91['name']]={'$like':'%'+_0x1df220[_0xb21f('0x2d')][_0xb21f('0x37')]+'%'};return _0x24042a;}})});}_0x22f279=_[_0xb21f('0x38')]({},_0x22f279,_0x1df220[_0xb21f('0x39')]);var _0x4d31da={'where':_0x22f279[_0xb21f('0x34')]};return db[_0xb21f('0x28')][_0xb21f('0x1d')](_0x4d31da)[_0xb21f('0x22')](function(_0x2c9001){_0x5dd24a[_0xb21f('0x1d')]=_0x2c9001;if(_0x1df220[_0xb21f('0x2d')][_0xb21f('0x3a')]){_0x22f279[_0xb21f('0x3b')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xb21f('0x3c')](_0x22f279);})['then'](function(_0x2db442){_0x5dd24a[_0xb21f('0x3d')]=_0x2db442;return _0x5dd24a;})[_0xb21f('0x22')](respondWithFilteredResult(_0x192578,_0x22f279))[_0xb21f('0x3e')](handleError(_0x192578,null));};exports[_0xb21f('0x3f')]=function(_0x4764c1,_0x46bf9b){var _0x50ec24={'raw':!![],'where':{'id':_0x4764c1[_0xb21f('0x40')]['id']}},_0x213925={};_0x213925[_0xb21f('0x2b')]=_[_0xb21f('0x2c')](db[_0xb21f('0x28')][_0xb21f('0x29')]);_0x213925[_0xb21f('0x2d')]=_[_0xb21f('0x2c')](_0x4764c1['query']);_0x213925['filters']=_[_0xb21f('0x2e')](_0x213925[_0xb21f('0x2b')],_0x213925[_0xb21f('0x2d')]);_0x50ec24[_0xb21f('0x2f')]=_[_0xb21f('0x2e')](_0x213925[_0xb21f('0x2b')],qs[_0xb21f('0x30')](_0x4764c1[_0xb21f('0x2d')][_0xb21f('0x30')]));_0x50ec24['attributes']=_0x50ec24[_0xb21f('0x2f')]['length']?_0x50ec24[_0xb21f('0x2f')]:_0x213925['model'];if(_0x4764c1['query']['includeAll']){_0x50ec24[_0xb21f('0x3b')]=[{'all':!![]}];}_0x50ec24=_[_0xb21f('0x38')]({},_0x50ec24,_0x4764c1[_0xb21f('0x39')]);return db['Dynamics365Field'][_0xb21f('0x41')](_0x50ec24)[_0xb21f('0x22')](handleEntityNotFound(_0x46bf9b,null))[_0xb21f('0x22')](respondWithResult(_0x46bf9b,null))['catch'](handleError(_0x46bf9b,null));};exports[_0xb21f('0x42')]=function(_0x4c40a0,_0x1d3ec7){return db[_0xb21f('0x28')]['create'](_0x4c40a0[_0xb21f('0x43')],{})['then'](respondWithResult(_0x1d3ec7,0xc9))[_0xb21f('0x3e')](handleError(_0x1d3ec7,null));};exports['update']=function(_0x10b451,_0x5f3411){if(_0x10b451[_0xb21f('0x43')]['id']){delete _0x10b451[_0xb21f('0x43')]['id'];}return db['Dynamics365Field'][_0xb21f('0x41')]({'where':{'id':_0x10b451['params']['id']}})['then'](handleEntityNotFound(_0x5f3411,null))[_0xb21f('0x22')](saveUpdates(_0x10b451[_0xb21f('0x43')],null))[_0xb21f('0x22')](respondWithResult(_0x5f3411,null))['catch'](handleError(_0x5f3411,null));};exports[_0xb21f('0x23')]=function(_0x28e5ea,_0x1d11a1){return db['Dynamics365Field'][_0xb21f('0x41')]({'where':{'id':_0x28e5ea[_0xb21f('0x40')]['id']}})[_0xb21f('0x22')](handleEntityNotFound(_0x1d11a1,null))[_0xb21f('0x22')](removeEntity(_0x1d11a1,null))[_0xb21f('0x3e')](handleError(_0x1d11a1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 34e1df6..c0ec1fd 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 _0xcb28=['dynamics365_unique_index','FieldId','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields'];(function(_0x140cb3,_0x183957){var _0x41c068=function(_0x17982d){while(--_0x17982d){_0x140cb3['push'](_0x140cb3['shift']());}};_0x41c068(++_0x183957);}(_0xcb28,0x120));var _0x8cb2=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xcb28[_0x1bf809];return _0x1caa4e;};'use strict';var _=require('lodash');var util=require(_0x8cb2('0x0'));var logger=require(_0x8cb2('0x1'))(_0x8cb2('0x2'));var moment=require(_0x8cb2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cb2('0x4'));var rimraf=require(_0x8cb2('0x5'));var config=require(_0x8cb2('0x6'));var attributes=require(_0x8cb2('0x7'));module[_0x8cb2('0x8')]=function(_0x1d6797,_0x53e5a4){return _0x1d6797['define'](_0x8cb2('0x9'),attributes,{'tableName':_0x8cb2('0xa'),'paranoid':![],'indexes':[{'name':_0x8cb2('0xb'),'fields':['idField',_0x8cb2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb62f=['moment','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','../../config/logger','api'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xb62f,0xe8));var _0xfb62=function(_0x431efc,_0x2ddaae){_0x431efc=_0x431efc-0x0;var _0x1ae349=_0xb62f[_0x431efc];return _0x1ae349;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb62('0x0'))(_0xfb62('0x1'));var moment=require(_0xfb62('0x2'));var BPromise=require(_0xfb62('0x3'));var rp=require(_0xfb62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb62('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb62('0x6'));module[_0xfb62('0x7')]=function(_0x3c3e3d,_0x2db008){return _0x3c3e3d[_0xfb62('0x8')](_0xfb62('0x9'),attributes,{'tableName':_0xfb62('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xfb62('0xb'),_0xfb62('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 7192570..592f54d 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 _0x44aa=['stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x44aa,0xf9));var _0xa44a=function(_0x86e5ee,_0x1d8bd5){_0x86e5ee=_0x86e5ee-0x0;var _0x3a2f43=_0x44aa[_0x86e5ee];return _0x3a2f43;};'use strict';var _=require(_0xa44a('0x0'));var util=require('util');var moment=require(_0xa44a('0x1'));var BPromise=require(_0xa44a('0x2'));var rs=require(_0xa44a('0x3'));var fs=require('fs');var Redis=require(_0xa44a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa44a('0x5'));var logger=require('../../config/logger')(_0xa44a('0x6'));var config=require(_0xa44a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa44a('0x8')][_0xa44a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a5e2,_0x5e1633,_0x52e3d9){return new BPromise(function(_0x2c0867,_0x2ba963){return client[_0xa44a('0xa')](_0x35a5e2,_0x52e3d9)[_0xa44a('0xb')](function(_0x404fb5){logger[_0xa44a('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5e1633,_0xa44a('0xd'));logger['debug'](_0xa44a('0xe'),_0x5e1633,_0xa44a('0xd'),JSON[_0xa44a('0xf')](_0x404fb5));if(_0x404fb5[_0xa44a('0x10')]){if(_0x404fb5['error'][_0xa44a('0x11')]===0x1f4){logger[_0xa44a('0x10')](_0xa44a('0x12'),_0x5e1633,_0x404fb5[_0xa44a('0x10')][_0xa44a('0x13')]);return _0x2ba963(_0x404fb5[_0xa44a('0x10')][_0xa44a('0x13')]);}logger[_0xa44a('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x5e1633,_0x404fb5[_0xa44a('0x10')][_0xa44a('0x13')]);return _0x2c0867(_0x404fb5[_0xa44a('0x10')]['message']);}else{logger['info'](_0xa44a('0x12'),_0x5e1633,_0xa44a('0xd'));_0x2c0867(_0x404fb5[_0xa44a('0x14')][_0xa44a('0x13')]);}})[_0xa44a('0x15')](function(_0x2e4c3f){logger[_0xa44a('0x10')](_0xa44a('0x12'),_0x5e1633,_0x2e4c3f);_0x2ba963(_0x2e4c3f);});});} \ No newline at end of file +var _0x081f=['../../config/logger','rpc','../../config/environment','client','request','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x081f,0x68));var _0xf081=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x081f[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0xf081('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf081('0x1'));var fs=require('fs');var Redis=require(_0xf081('0x2'));var db=require(_0xf081('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf081('0x4'))(_0xf081('0x5'));var config=require(_0xf081('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf081('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17da72,_0x273186,_0x3c9efa){return new BPromise(function(_0x2c0486,_0x491de0){return client[_0xf081('0x8')](_0x17da72,_0x3c9efa)['then'](function(_0x23e588){logger['info'](_0xf081('0x9'),_0x273186,_0xf081('0xa'));logger['debug'](_0xf081('0xb'),_0x273186,'request\x20sent',JSON[_0xf081('0xc')](_0x23e588));if(_0x23e588[_0xf081('0xd')]){if(_0x23e588['error'][_0xf081('0xe')]===0x1f4){logger['error'](_0xf081('0x9'),_0x273186,_0x23e588['error'][_0xf081('0xf')]);return _0x491de0(_0x23e588[_0xf081('0xd')][_0xf081('0xf')]);}logger[_0xf081('0xd')](_0xf081('0x9'),_0x273186,_0x23e588[_0xf081('0xd')][_0xf081('0xf')]);return _0x2c0486(_0x23e588[_0xf081('0xd')][_0xf081('0xf')]);}else{logger[_0xf081('0x10')](_0xf081('0x9'),_0x273186,_0xf081('0xa'));_0x2c0486(_0x23e588['result'][_0xf081('0xf')]);}})[_0xf081('0x11')](function(_0x3643ce){logger[_0xf081('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x273186,_0x3643ce);_0x491de0(_0x3643ce);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 08f4399..e2cc4f8 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 _0x949a=['../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','/:id','/:id/configurations','getConfigurations','get','/:id/fields','getFields','post','create','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2f08d9,_0x57ec33){var _0x2bfd42=function(_0x52f31a){while(--_0x52f31a){_0x2f08d9['push'](_0x2f08d9['shift']());}};_0x2bfd42(++_0x57ec33);}(_0x949a,0xd3));var _0xa949=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x949a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa949('0x0'));var timeout=require('connect-timeout');var express=require(_0xa949('0x1'));var router=express[_0xa949('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa949('0x3'));var interaction=require(_0xa949('0x4'));var config=require(_0xa949('0x5'));var controller=require(_0xa949('0x6'));router['get']('/',auth[_0xa949('0x7')](),controller['index']);router['get'](_0xa949('0x8'),auth[_0xa949('0x7')](),controller['show']);router['get'](_0xa949('0x9'),auth[_0xa949('0x7')](),controller[_0xa949('0xa')]);router[_0xa949('0xb')](_0xa949('0xc'),auth[_0xa949('0x7')](),controller[_0xa949('0xd')]);router[_0xa949('0xe')]('/',auth[_0xa949('0x7')](),controller[_0xa949('0xf')]);router[_0xa949('0xe')](_0xa949('0x9'),auth[_0xa949('0x7')](),controller['addConfiguration']);router['put'](_0xa949('0x8'),auth[_0xa949('0x7')](),controller['update']);router[_0xa949('0x10')](_0xa949('0x8'),auth[_0xa949('0x7')](),controller[_0xa949('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb82b=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x2fdfce,_0x299f93){var _0x32b652=function(_0x2fa8d9){while(--_0x2fa8d9){_0x2fdfce['push'](_0x2fdfce['shift']());}};_0x32b652(++_0x299f93);}(_0xb82b,0x7c));var _0xbb82=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb82b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xbb82('0x0'));var util=require(_0xbb82('0x1'));var path=require(_0xbb82('0x2'));var timeout=require(_0xbb82('0x3'));var express=require(_0xbb82('0x4'));var router=express[_0xbb82('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb82('0x6'));var interaction=require(_0xbb82('0x7'));var config=require(_0xbb82('0x8'));var controller=require(_0xbb82('0x9'));router[_0xbb82('0xa')]('/',auth[_0xbb82('0xb')](),controller[_0xbb82('0xc')]);router[_0xbb82('0xa')](_0xbb82('0xd'),auth[_0xbb82('0xb')](),controller[_0xbb82('0xe')]);router[_0xbb82('0xa')](_0xbb82('0xf'),auth[_0xbb82('0xb')](),controller[_0xbb82('0x10')]);router[_0xbb82('0xa')](_0xbb82('0x11'),auth[_0xbb82('0xb')](),controller['getFields']);router[_0xbb82('0x12')]('/',auth[_0xbb82('0xb')](),controller[_0xbb82('0x13')]);router[_0xbb82('0x12')](_0xbb82('0xf'),auth[_0xbb82('0xb')](),controller['addConfiguration']);router[_0xbb82('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbb82('0x15')]);router['delete'](_0xbb82('0xd'),auth[_0xbb82('0xb')](),controller[_0xbb82('0x16')]);module[_0xbb82('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3a1526e..29a81d6 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 _0x0598=['exports','STRING','sequelize'];(function(_0x3bf3f1,_0x5b8238){var _0x5a0c0c=function(_0x303fac){while(--_0x303fac){_0x3bf3f1['push'](_0x3bf3f1['shift']());}};_0x5a0c0c(++_0x5b8238);}(_0x0598,0x92));var _0x8059=function(_0x427d33,_0x140078){_0x427d33=_0x427d33-0x0;var _0x356eac=_0x0598[_0x427d33];return _0x356eac;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8059('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x8059('0x2')]},'remoteUri':{'type':Sequelize[_0x8059('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x486f8e,_0x52fb5f){var _0x528b66=function(_0x41f088){while(--_0x41f088){_0x486f8e['push'](_0x486f8e['shift']());}};_0x528b66(++_0x52fb5f);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1a689d,_0x243111){_0x1a689d=_0x1a689d-0x0;var _0xb2cd6b=_0xf4f4[_0x1a689d];return _0xb2cd6b;};'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 2e722ea..7f9c653 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 _0x282b=['test','statusCode','error','stringify','send','Wrong\x20credentials','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','FreshdeskAccount','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','FreshdeskConfiguration','map','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize'];(function(_0x32b7b9,_0x3c7d41){var _0x39ba00=function(_0x476c68){while(--_0x476c68){_0x32b7b9['push'](_0x32b7b9['shift']());}};_0x39ba00(++_0x3c7d41);}(_0x282b,0xec));var _0xb282=function(_0x567757,_0x5f2d25){_0x567757=_0x567757-0x0;var _0x1d9651=_0x282b[_0x567757];return _0x1d9651;};'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['FreshdeskAccount']['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['FreshdeskAccount'][_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('0x25')](handleEntityNotFound(_0x3c1579,null))[_0xb282('0x25')](function(_0x39859d){if(_0x39859d){_0x4ccef5=_0x39859d[_0xb282('0x53')];var _0x2d237e=_0x4ccef5[_0xb282('0x55')](-0x1);if(_0x2d237e==='/'){_0x4ccef5=_0x4ccef5['substring'](0x0,_0x4ccef5[_0xb282('0x56')](_0x2d237e));}return rp({'method':_0xb282('0x57'),'uri':util[_0xb282('0x58')](_0xb282('0x59'),_0x4ccef5,_0xb282('0x5a')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xb282('0x58')](_0xb282('0x5b'),_0x39859d[_0xb282('0x54')]))[_0xb282('0x5c')](_0xb282('0x5d')))},'json':!![]});}})[_0xb282('0x25')](function(_0x308050){if(_0x308050){var _0x4df661=['requester',_0xb282('0x5e'),_0xb282('0x5f'),'description','status',_0xb282('0x60'),_0xb282('0x61'),_0xb282('0x62'),_0xb282('0x63'),_0xb282('0x61'),_0xb282('0x64')];_[_0xb282('0x65')](_0x308050,function(_0x502447){return _0x4df661[_0xb282('0x66')](_0x502447[_0xb282('0x27')])||!_0x502447[_0xb282('0x67')]&&_0x502447[_0xb282('0x2c')]!==_0xb282('0x68')&&_0x502447[_0xb282('0x2c')]!==_0xb282('0x69');});return{'count':_0x308050[_0xb282('0x41')],'rows':_[_0xb282('0x49')](_0x308050,function(_0x222203){return{'id':_0x222203['name'],'name':_0x222203[_0xb282('0x6a')],'custom':!_0x222203[_0xb282('0x67')],'options':_0x222203[_0xb282('0x6b')]?_[_0xb282('0x49')](_0x222203[_0xb282('0x6b')],function(_0xb1394f){return{'name':_[_0xb282('0x6c')](_0xb1394f),'value':_0xb1394f};}):[]};})};}})[_0xb282('0x25')](respondWithResult(_0x3c1579,null))['catch'](function(_0x199c02){var _0x400f2a=_0x2eae62[_0xb282('0x2e')][_0xb282('0x6d')]?0x1f4:_0x199c02[_0xb282('0x6e')]||0x1f4;logger[_0xb282('0x6f')]('getFields,\x20%s,\x20%s,\x20%s',_0xb282('0x52'),_0x400f2a,JSON[_0xb282('0x70')](_0x199c02));delete _0x199c02[_0xb282('0x27')];if(_0x400f2a===0x191){_0x400f2a=0x190;}_0x3c1579['status'](_0x400f2a)[_0xb282('0x71')](_0x2eae62[_0xb282('0x2e')]['test']?{'message':_0xb282('0x72'),'statusCode':_0x199c02[_0xb282('0x6e')]}:_0x199c02);});}; \ No newline at end of file +var _0xbee3=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','reject','save','update','then','error','name','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','findOne','FreshdeskConfiguration','rawAttributes','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','request-promise','moment','mustache','util','path','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','../../config/utils'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xbee3,0xd5));var _0x3bee=function(_0x101999,_0x2d9547){_0x101999=_0x101999-0x0;var _0x107579=_0xbee3[_0x101999];return _0x107579;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];var integrations=require(_0x3bee('0x17'));function respondWithStatusCode(_0x6950d0,_0x410124){_0x410124=_0x410124||0xcc;return function(_0x459129){if(_0x459129){return _0x6950d0[_0x3bee('0x18')](_0x410124);}return _0x6950d0['status'](_0x410124)[_0x3bee('0x19')]();};}function respondWithResult(_0x33504d,_0x31ac52){_0x31ac52=_0x31ac52||0xc8;return function(_0x237110){if(_0x237110){return _0x33504d[_0x3bee('0x1a')](_0x31ac52)['json'](_0x237110);}};}function respondWithFilteredResult(_0x558436,_0x346767){return function(_0x515397){if(_0x515397){var _0x2cfba7=typeof _0x346767[_0x3bee('0x1b')]==='undefined'&&typeof _0x346767['limit']===_0x3bee('0x1c');var _0x36c5aa=_0x515397[_0x3bee('0x1d')];var _0x631ff8=_0x2cfba7?0x0:_0x346767['offset'];var _0x30a1de=_0x2cfba7?_0x515397[_0x3bee('0x1d')]:_0x346767[_0x3bee('0x1b')]+_0x346767[_0x3bee('0x1e')];var _0x33d812;if(_0x30a1de>=_0x36c5aa){_0x30a1de=_0x36c5aa;_0x33d812=0xc8;}else{_0x33d812=0xce;}_0x558436[_0x3bee('0x1a')](_0x33d812);return _0x558436[_0x3bee('0x1f')]('Content-Range',_0x631ff8+'-'+_0x30a1de+'/'+_0x36c5aa)['json'](_0x515397);}return null;};}function patchUpdates(_0x1afd0f){return function(_0x30bba2){try{jsonpatch['apply'](_0x30bba2,_0x1afd0f,!![]);}catch(_0x471027){return BPromise[_0x3bee('0x20')](_0x471027);}return _0x30bba2[_0x3bee('0x21')]();};}function saveUpdates(_0x179e62,_0x28c248){return function(_0x26e92e){if(_0x26e92e){return _0x26e92e[_0x3bee('0x22')](_0x179e62)['then'](function(_0x8ae4ca){return _0x8ae4ca;});}return null;};}function removeEntity(_0x1ed0c1,_0x1fed5a){return function(_0x3bb884){if(_0x3bb884){return _0x3bb884['destroy']()[_0x3bee('0x23')](function(){_0x1ed0c1[_0x3bee('0x1a')](0xcc)[_0x3bee('0x19')]();});}};}function handleEntityNotFound(_0x4b4cd4,_0x5ed022){return function(_0x13181e){if(!_0x13181e){_0x4b4cd4[_0x3bee('0x18')](0x194);}return _0x13181e;};}function handleError(_0x5341e2,_0x2c0e50){_0x2c0e50=_0x2c0e50||0x1f4;return function(_0x1b4ce0){logger[_0x3bee('0x24')](_0x1b4ce0['stack']);if(_0x1b4ce0[_0x3bee('0x25')]){delete _0x1b4ce0[_0x3bee('0x25')];}_0x5341e2[_0x3bee('0x1a')](_0x2c0e50)['send'](_0x1b4ce0);};}exports[_0x3bee('0x26')]=function(_0xf08fb3,_0x3a3d92){var _0x496abd={},_0x1115ed={},_0x24d523={'count':0x0,'rows':[]};var _0x27ed99=_[_0x3bee('0x27')](db[_0x3bee('0x28')]['rawAttributes'],function(_0x564e45){return{'name':_0x564e45[_0x3bee('0x29')],'type':_0x564e45[_0x3bee('0x2a')][_0x3bee('0x2b')]};});_0x1115ed[_0x3bee('0x2c')]=_['map'](_0x27ed99,'name');_0x1115ed[_0x3bee('0x2d')]=_[_0x3bee('0x2e')](_0xf08fb3['query']);_0x1115ed['filters']=_[_0x3bee('0x2f')](_0x1115ed[_0x3bee('0x2c')],_0x1115ed[_0x3bee('0x2d')]);_0x496abd[_0x3bee('0x30')]=_[_0x3bee('0x2f')](_0x1115ed[_0x3bee('0x2c')],qs[_0x3bee('0x31')](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x31')]));_0x496abd[_0x3bee('0x30')]=_0x496abd['attributes']['length']?_0x496abd[_0x3bee('0x30')]:_0x1115ed['model'];if(!_0xf08fb3['query'][_0x3bee('0x32')](_0x3bee('0x33'))){_0x496abd[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x1e')]);_0x496abd[_0x3bee('0x1b')]=qs[_0x3bee('0x1b')](_0xf08fb3['query'][_0x3bee('0x1b')]);}_0x496abd[_0x3bee('0x34')]=qs['sort'](_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x35')]);_0x496abd[_0x3bee('0x36')]=qs[_0x3bee('0x37')](_[_0x3bee('0x38')](_0xf08fb3['query'],_0x1115ed['filters']),_0x27ed99);if(_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x39')]){_0x496abd[_0x3bee('0x36')]=_[_0x3bee('0x3a')](_0x496abd[_0x3bee('0x36')],{'$or':_[_0x3bee('0x27')](_0x27ed99,function(_0x2c6ca3){if(_0x2c6ca3[_0x3bee('0x2a')]!==_0x3bee('0x3b')){var _0x2591f1={};_0x2591f1[_0x2c6ca3[_0x3bee('0x25')]]={'$like':'%'+_0xf08fb3[_0x3bee('0x2d')]['filter']+'%'};return _0x2591f1;}})});}_0x496abd=_[_0x3bee('0x3a')]({},_0x496abd,_0xf08fb3[_0x3bee('0x3c')]);var _0x25158b={'where':_0x496abd[_0x3bee('0x36')]};return db[_0x3bee('0x28')][_0x3bee('0x1d')](_0x25158b)[_0x3bee('0x23')](function(_0x6195a3){_0x24d523[_0x3bee('0x1d')]=_0x6195a3;if(_0xf08fb3[_0x3bee('0x2d')][_0x3bee('0x3d')]){_0x496abd[_0x3bee('0x3e')]=[{'all':!![]}];}return db[_0x3bee('0x28')]['findAll'](_0x496abd);})[_0x3bee('0x23')](function(_0x2f30d7){_0x24d523[_0x3bee('0x3f')]=_0x2f30d7;return _0x24d523;})[_0x3bee('0x23')](respondWithFilteredResult(_0x3a3d92,_0x496abd))[_0x3bee('0x40')](handleError(_0x3a3d92,null));};exports[_0x3bee('0x41')]=function(_0x13dd72,_0xd1140d){var _0x5d9e1b={'raw':![],'where':{'id':_0x13dd72[_0x3bee('0x42')]['id']}},_0x10a59d={};_0x10a59d[_0x3bee('0x2c')]=_['keys'](db[_0x3bee('0x28')]['rawAttributes']);_0x10a59d[_0x3bee('0x2d')]=_['keys'](_0x13dd72['query']);_0x10a59d[_0x3bee('0x37')]=_[_0x3bee('0x2f')](_0x10a59d[_0x3bee('0x2c')],_0x10a59d[_0x3bee('0x2d')]);_0x5d9e1b[_0x3bee('0x30')]=_['intersection'](_0x10a59d['model'],qs[_0x3bee('0x31')](_0x13dd72['query'][_0x3bee('0x31')]));_0x5d9e1b['attributes']=_0x5d9e1b[_0x3bee('0x30')]['length']?_0x5d9e1b[_0x3bee('0x30')]:_0x10a59d[_0x3bee('0x2c')];if(_0x13dd72[_0x3bee('0x2d')][_0x3bee('0x3d')]){_0x5d9e1b['include']=[{'all':!![]}];}_0x5d9e1b=_['merge']({},_0x5d9e1b,_0x13dd72[_0x3bee('0x3c')]);return db['FreshdeskAccount']['find'](_0x5d9e1b)['then'](handleEntityNotFound(_0xd1140d,null))[_0x3bee('0x23')](respondWithResult(_0xd1140d,null))['catch'](handleError(_0xd1140d,null));};exports[_0x3bee('0x43')]=function(_0x33d615,_0xd87fd2){return db['FreshdeskAccount'][_0x3bee('0x43')](_0x33d615['body'],{})[_0x3bee('0x23')](respondWithResult(_0xd87fd2,0xc9))['catch'](handleError(_0xd87fd2,null));};exports[_0x3bee('0x22')]=function(_0x16b096,_0x15a96a){if(_0x16b096['body']['id']){delete _0x16b096[_0x3bee('0x44')]['id'];}return db[_0x3bee('0x28')][_0x3bee('0x45')]({'where':{'id':_0x16b096['params']['id']}})['then'](handleEntityNotFound(_0x15a96a,null))[_0x3bee('0x23')](saveUpdates(_0x16b096[_0x3bee('0x44')],null))[_0x3bee('0x23')](respondWithResult(_0x15a96a,null))[_0x3bee('0x40')](handleError(_0x15a96a,null));};exports[_0x3bee('0x46')]=function(_0x21ab40,_0x4005a3){return db['FreshdeskAccount'][_0x3bee('0x45')]({'where':{'id':_0x21ab40[_0x3bee('0x42')]['id']}})['then'](handleEntityNotFound(_0x4005a3,null))['then'](removeEntity(_0x4005a3,null))[_0x3bee('0x40')](handleError(_0x4005a3,null));};exports['getConfigurations']=function(_0x1cb54e,_0x2162ce,_0x1f0f23){var _0x4fb836={};var _0x1a13fd={};var _0x3beac9;var _0x127cb8;return db['FreshdeskAccount'][_0x3bee('0x47')]({'where':{'id':_0x1cb54e[_0x3bee('0x42')]['id']}})['then'](handleEntityNotFound(_0x2162ce,null))[_0x3bee('0x23')](function(_0x14940e){if(_0x14940e){_0x3beac9=_0x14940e;_0x1a13fd['model']=_[_0x3bee('0x2e')](db[_0x3bee('0x48')][_0x3bee('0x49')]);_0x1a13fd[_0x3bee('0x2d')]=_[_0x3bee('0x2e')](_0x1cb54e[_0x3bee('0x2d')]);_0x1a13fd[_0x3bee('0x37')]=_[_0x3bee('0x2f')](_0x1a13fd['model'],_0x1a13fd['query']);_0x4fb836[_0x3bee('0x30')]=_['intersection'](_0x1a13fd[_0x3bee('0x2c')],qs[_0x3bee('0x31')](_0x1cb54e[_0x3bee('0x2d')]['fields']));_0x4fb836[_0x3bee('0x30')]=_0x4fb836[_0x3bee('0x30')][_0x3bee('0x4a')]?_0x4fb836['attributes']:_0x1a13fd[_0x3bee('0x2c')];_0x4fb836['order']=qs[_0x3bee('0x35')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x35')]);_0x4fb836['where']=qs[_0x3bee('0x37')](_[_0x3bee('0x38')](_0x1cb54e[_0x3bee('0x2d')],_0x1a13fd['filters']));if(_0x1cb54e['query'][_0x3bee('0x39')]){_0x4fb836[_0x3bee('0x36')]=_[_0x3bee('0x3a')](_0x4fb836['where'],{'$or':_['map'](_0x4fb836[_0x3bee('0x30')],function(_0x572fa6){var _0x5cd620={};_0x5cd620[_0x572fa6]={'$like':'%'+_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x39')]+'%'};return _0x5cd620;})});}_0x4fb836=_[_0x3bee('0x3a')]({},_0x4fb836,_0x1cb54e['options']);return _0x3beac9['getConfigurations'](_0x4fb836);}})[_0x3bee('0x23')](function(_0x1f4eb9){if(_0x1f4eb9){_0x127cb8=_0x1f4eb9['length'];if(!_0x1cb54e[_0x3bee('0x2d')]['hasOwnProperty'](_0x3bee('0x33'))){_0x4fb836[_0x3bee('0x1e')]=qs[_0x3bee('0x1e')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x1e')]);_0x4fb836[_0x3bee('0x1b')]=qs[_0x3bee('0x1b')](_0x1cb54e[_0x3bee('0x2d')][_0x3bee('0x1b')]);}return _0x3beac9[_0x3bee('0x4b')](_0x4fb836);}})[_0x3bee('0x23')](function(_0x5647c8){if(_0x5647c8){return _0x5647c8?{'count':_0x127cb8,'rows':_0x5647c8}:null;}})['then'](respondWithResult(_0x2162ce,null))['catch'](handleError(_0x2162ce,null));};exports[_0x3bee('0x4c')]=function(_0xb5a685,_0x4acba2,_0x9828ad){if(_0xb5a685['body']['id']){delete _0xb5a685[_0x3bee('0x44')]['id'];}return db[_0x3bee('0x28')]['findOne']({'where':{'id':_0xb5a685['params']['id']}})[_0x3bee('0x23')](handleEntityNotFound(_0x4acba2,null))[_0x3bee('0x23')](function(_0x20be01){if(_0x20be01){_0xb5a685['body'][_0x3bee('0x4d')]=_0x20be01['id'];_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4e')]=integrations['getSubjects'](_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4f')],_0xb5a685[_0x3bee('0x44')][_0x3bee('0x2a')]);_0xb5a685['body']['Descriptions']=integrations[_0x3bee('0x50')](_0xb5a685[_0x3bee('0x44')][_0x3bee('0x4f')],_0xb5a685[_0x3bee('0x44')][_0x3bee('0x2a')]);return db['FreshdeskConfiguration'][_0x3bee('0x43')](_0xb5a685['body'],{'include':[{'model':db[_0x3bee('0x51')],'as':_0x3bee('0x4e')},{'model':db[_0x3bee('0x51')],'as':_0x3bee('0x52')}]});}return null;})[_0x3bee('0x23')](respondWithResult(_0x4acba2,null))[_0x3bee('0x40')](handleError(_0x4acba2,null));};exports[_0x3bee('0x53')]=function(_0x4d52f3,_0x25f936,_0x28c16e){var _0x42045d='';return db[_0x3bee('0x28')]['findOne']({'where':{'id':_0x4d52f3[_0x3bee('0x42')]['id']},'attributes':['id',_0x3bee('0x54'),_0x3bee('0x55')]})[_0x3bee('0x23')](handleEntityNotFound(_0x25f936,null))[_0x3bee('0x23')](function(_0x2d71fa){if(_0x2d71fa){_0x42045d=_0x2d71fa[_0x3bee('0x54')];var _0x16c374=_0x42045d['slice'](-0x1);if(_0x16c374==='/'){_0x42045d=_0x42045d[_0x3bee('0x56')](0x0,_0x42045d[_0x3bee('0x57')](_0x16c374));}return rp({'method':_0x3bee('0x58'),'uri':util['format'](_0x3bee('0x59'),_0x42045d,_0x3bee('0x5a')),'headers':{'Authorization':util[_0x3bee('0x5b')](_0x3bee('0x5c'),new Buffer(util[_0x3bee('0x5b')](_0x3bee('0x5d'),_0x2d71fa[_0x3bee('0x55')]))[_0x3bee('0x5e')](_0x3bee('0x5f')))},'json':!![]});}})[_0x3bee('0x23')](function(_0x3f72f7){if(_0x3f72f7){var _0x387924=[_0x3bee('0x60'),_0x3bee('0x61'),_0x3bee('0x62'),_0x3bee('0x63'),_0x3bee('0x1a'),_0x3bee('0x64'),_0x3bee('0x65'),_0x3bee('0x66'),_0x3bee('0x67'),_0x3bee('0x65'),_0x3bee('0x68')];_[_0x3bee('0x69')](_0x3f72f7,function(_0x75ba50){return _0x387924['includes'](_0x75ba50[_0x3bee('0x25')])||!_0x75ba50[_0x3bee('0x6a')]&&_0x75ba50[_0x3bee('0x2a')]!==_0x3bee('0x6b')&&_0x75ba50[_0x3bee('0x2a')]!==_0x3bee('0x6c');});return{'count':_0x3f72f7[_0x3bee('0x4a')],'rows':_[_0x3bee('0x27')](_0x3f72f7,function(_0x11c6b0){return{'id':_0x11c6b0['name'],'name':_0x11c6b0[_0x3bee('0x6d')],'custom':!_0x11c6b0[_0x3bee('0x6a')],'options':_0x11c6b0['choices']?_[_0x3bee('0x27')](_0x11c6b0['choices'],function(_0x1c260a){return{'name':_[_0x3bee('0x6e')](_0x1c260a),'value':_0x1c260a};}):[]};})};}})[_0x3bee('0x23')](respondWithResult(_0x25f936,null))['catch'](function(_0x541484){var _0x29a2ea=_0x4d52f3[_0x3bee('0x2d')][_0x3bee('0x6f')]?0x1f4:_0x541484[_0x3bee('0x70')]||0x1f4;logger[_0x3bee('0x24')](_0x3bee('0x71'),_0x3bee('0x53'),_0x29a2ea,JSON[_0x3bee('0x72')](_0x541484));delete _0x541484['name'];if(_0x29a2ea===0x191){_0x29a2ea=0x190;}_0x25f936[_0x3bee('0x1a')](_0x29a2ea)[_0x3bee('0x73')](_0x4d52f3[_0x3bee('0x2d')][_0x3bee('0x6f')]?{'message':_0x3bee('0x74'),'statusCode':_0x541484[_0x3bee('0x70')]}:_0x541484);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c5e0ca7..9736163 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 _0xbf3e=['exports','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x40e186,_0x2ccc80){var _0x913afd=function(_0xe11092){while(--_0xe11092){_0x40e186['push'](_0x40e186['shift']());}};_0x913afd(++_0x2ccc80);}(_0xbf3e,0xd5));var _0xebf3=function(_0x78de6d,_0x29bff3){_0x78de6d=_0x78de6d-0x0;var _0x1f9f64=_0xbf3e[_0x78de6d];return _0x1f9f64;};'use strict';var _=require(_0xebf3('0x0'));var util=require(_0xebf3('0x1'));var logger=require(_0xebf3('0x2'))(_0xebf3('0x3'));var moment=require(_0xebf3('0x4'));var BPromise=require(_0xebf3('0x5'));var rp=require(_0xebf3('0x6'));var fs=require('fs');var path=require(_0xebf3('0x7'));var rimraf=require(_0xebf3('0x8'));var config=require('../../config/environment');var attributes=require(_0xebf3('0x9'));var integrations=require(_0xebf3('0xa'));module[_0xebf3('0xb')]=function(_0x196071,_0x159cd4){return _0x196071[_0xebf3('0xc')](_0xebf3('0xd'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62ec=['request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x25003a,_0x12249b){var _0x14cbd3=function(_0x5d97b3){while(--_0x5d97b3){_0x25003a['push'](_0x25003a['shift']());}};_0x14cbd3(++_0x12249b);}(_0x62ec,0x181));var _0xc62e=function(_0x23a081,_0x14d0cc){_0x23a081=_0x23a081-0x0;var _0x3ba8d2=_0x62ec[_0x23a081];return _0x3ba8d2;};'use strict';var _=require('lodash');var util=require(_0xc62e('0x0'));var logger=require(_0xc62e('0x1'))(_0xc62e('0x2'));var moment=require(_0xc62e('0x3'));var BPromise=require(_0xc62e('0x4'));var rp=require(_0xc62e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc62e('0x6'));var config=require(_0xc62e('0x7'));var attributes=require(_0xc62e('0x8'));var integrations=require(_0xc62e('0x9'));module[_0xc62e('0xa')]=function(_0x54547a,_0x57aa69){return _0x54547a[_0xc62e('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xc62e('0xc'),'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 b528068..262b069 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 _0x34f8=['where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34f8,0xbc));var _0x834f=function(_0x482141,_0xeac92f){_0x482141=_0x482141-0x0;var _0x5c83f3=_0x34f8[_0x482141];return _0x5c83f3;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var moment=require('moment');var BPromise=require(_0x834f('0x2'));var rs=require(_0x834f('0x3'));var fs=require('fs');var Redis=require(_0x834f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x834f('0x5'));var logger=require(_0x834f('0x6'))(_0x834f('0x7'));var config=require(_0x834f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x834f('0x9')][_0x834f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x341f3d,_0x22fb2,_0x559443){return new BPromise(function(_0x2ea0d6,_0x4f5627){return client[_0x834f('0xb')](_0x341f3d,_0x559443)[_0x834f('0xc')](function(_0x48b723){logger['info'](_0x834f('0xd'),_0x22fb2,_0x834f('0xe'));logger[_0x834f('0xf')](_0x834f('0x10'),_0x22fb2,_0x834f('0xe'),JSON[_0x834f('0x11')](_0x48b723));if(_0x48b723[_0x834f('0x12')]){if(_0x48b723['error'][_0x834f('0x13')]===0x1f4){logger[_0x834f('0x12')](_0x834f('0xd'),_0x22fb2,_0x48b723['error'][_0x834f('0x14')]);return _0x4f5627(_0x48b723[_0x834f('0x12')][_0x834f('0x14')]);}logger[_0x834f('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x22fb2,_0x48b723['error'][_0x834f('0x14')]);return _0x2ea0d6(_0x48b723['error'][_0x834f('0x14')]);}else{logger[_0x834f('0x15')](_0x834f('0xd'),_0x22fb2,_0x834f('0xe'));_0x2ea0d6(_0x48b723[_0x834f('0x16')][_0x834f('0x14')]);}})[_0x834f('0x17')](function(_0x2c5768){logger['error'](_0x834f('0xd'),_0x22fb2,_0x2c5768);_0x4f5627(_0x2c5768);});});}exports[_0x834f('0x18')]=function(_0x4eb572){var _0x3e8ff6=this;return new Promise(function(_0x2722e6,_0x7788a1){return db[_0x834f('0x19')]['findAll']({'raw':_0x4eb572[_0x834f('0x1a')]?_0x4eb572[_0x834f('0x1a')][_0x834f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4eb572[_0x834f('0x1a')]?_0x4eb572[_0x834f('0x1a')][_0x834f('0x1c')]||null:null,'attributes':_0x4eb572['options']?_0x4eb572[_0x834f('0x1a')][_0x834f('0x1d')]||null:null,'limit':_0x4eb572[_0x834f('0x1a')]?_0x4eb572[_0x834f('0x1a')][_0x834f('0x1e')]||null:null,'include':_0x4eb572[_0x834f('0x1a')]?_0x4eb572['options'][_0x834f('0x1f')]?_[_0x834f('0x20')](_0x4eb572[_0x834f('0x1a')][_0x834f('0x1f')],function(_0x48ba80){return{'model':db[_0x48ba80[_0x834f('0x21')]],'as':_0x48ba80['as'],'attributes':_0x48ba80[_0x834f('0x1d')],'include':_0x48ba80[_0x834f('0x1f')]?_['map'](_0x48ba80['include'],function(_0x4b9fb2){return{'model':db[_0x4b9fb2[_0x834f('0x21')]],'as':_0x4b9fb2['as'],'attributes':_0x4b9fb2[_0x834f('0x1d')],'include':_0x4b9fb2[_0x834f('0x1f')]?_[_0x834f('0x20')](_0x4b9fb2[_0x834f('0x1f')],function(_0x393b66){return{'model':db[_0x393b66[_0x834f('0x21')]],'as':_0x393b66['as'],'attributes':_0x393b66[_0x834f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x834f('0xc')](function(_0x459ab4){logger['info'](_0x834f('0x18'),_0x4eb572);logger['debug']('GetFreshdeskAccount',_0x4eb572,JSON[_0x834f('0x11')](_0x459ab4));_0x2722e6(_0x459ab4);})[_0x834f('0x17')](function(_0x449a14){logger['error']('GetFreshdeskAccount',_0x449a14[_0x834f('0x14')],_0x4eb572);_0x7788a1(_0x3e8ff6[_0x834f('0x12')](0x1f4,_0x449a14[_0x834f('0x14')]));});});};exports[_0x834f('0x22')]=function(_0x39398b){var _0x1d4396=this;return new Promise(function(_0x41111b,_0x4183ad){return db[_0x834f('0x19')][_0x834f('0x23')]({'raw':_0x39398b[_0x834f('0x1a')]?_0x39398b[_0x834f('0x1a')][_0x834f('0x1b')]===undefined?!![]:![]:!![],'where':_0x39398b[_0x834f('0x1a')]?_0x39398b['options'][_0x834f('0x1c')]||null:null,'attributes':_0x39398b[_0x834f('0x1a')]?_0x39398b[_0x834f('0x1a')][_0x834f('0x1d')]||null:null,'include':_0x39398b[_0x834f('0x1a')]?_0x39398b['options'][_0x834f('0x1f')]?_[_0x834f('0x20')](_0x39398b[_0x834f('0x1a')][_0x834f('0x1f')],function(_0x468b68){return{'model':db[_0x468b68['model']],'as':_0x468b68['as'],'attributes':_0x468b68[_0x834f('0x1d')],'include':_0x468b68[_0x834f('0x1f')]?_['map'](_0x468b68[_0x834f('0x1f')],function(_0xa1611){return{'model':db[_0xa1611['model']],'as':_0xa1611['as'],'attributes':_0xa1611['attributes'],'include':_0xa1611[_0x834f('0x1f')]?_[_0x834f('0x20')](_0xa1611[_0x834f('0x1f')],function(_0x266dfe){return{'model':db[_0x266dfe['model']],'as':_0x266dfe['as'],'attributes':_0x266dfe[_0x834f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x834f('0xc')](function(_0x3f355d){logger[_0x834f('0x15')](_0x834f('0x22'),_0x39398b);logger[_0x834f('0xf')](_0x834f('0x22'),_0x39398b,JSON[_0x834f('0x11')](_0x3f355d));_0x41111b(_0x3f355d);})[_0x834f('0x17')](function(_0x3f7a51){logger[_0x834f('0x12')](_0x834f('0x22'),_0x3f7a51[_0x834f('0x14')],_0x39398b);_0x4183ad(_0x1d4396['error'](0x1f4,_0x3f7a51[_0x834f('0x14')]));});});}; \ No newline at end of file +var _0xf0ba=['message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x7f9688,_0x279979){var _0x3fe336=function(_0x31a9ec){while(--_0x31a9ec){_0x7f9688['push'](_0x7f9688['shift']());}};_0x3fe336(++_0x279979);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var moment=require(_0xaf0b('0x2'));var BPromise=require(_0xaf0b('0x3'));var rs=require(_0xaf0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0b('0x5'))['db'];var utils=require(_0xaf0b('0x6'));var logger=require('../../config/logger')(_0xaf0b('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf0b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b32d,_0x1d260e,_0x17b6d5){return new BPromise(function(_0x3439d5,_0xd67a9){return client['request'](_0x53b32d,_0x17b6d5)[_0xaf0b('0x9')](function(_0x4242b1){logger[_0xaf0b('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x1d260e,_0xaf0b('0xb'));logger['debug'](_0xaf0b('0xc'),_0x1d260e,_0xaf0b('0xb'),JSON[_0xaf0b('0xd')](_0x4242b1));if(_0x4242b1['error']){if(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0xf')]===0x1f4){logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);return _0xd67a9(_0x4242b1['error'][_0xaf0b('0x11')]);}logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')]['message']);return _0x3439d5(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);}else{logger[_0xaf0b('0xa')](_0xaf0b('0x10'),_0x1d260e,_0xaf0b('0xb'));_0x3439d5(_0x4242b1[_0xaf0b('0x12')][_0xaf0b('0x11')]);}})[_0xaf0b('0x13')](function(_0x4885da){logger[_0xaf0b('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x1d260e,_0x4885da);_0xd67a9(_0x4885da);});});}exports[_0xaf0b('0x14')]=function(_0x1dd132){var _0x36b059=this;return new Promise(function(_0xbe0d1e,_0x3201ed){return db[_0xaf0b('0x15')][_0xaf0b('0x16')]({'raw':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x18')]===undefined?!![]:![]:!![],'where':_0x1dd132['options']?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x19')]||null:null,'attributes':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132['options'][_0xaf0b('0x1a')]||null:null,'limit':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132['options'][_0xaf0b('0x1b')]||null:null,'include':_0x1dd132[_0xaf0b('0x17')]?_0x1dd132[_0xaf0b('0x17')][_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x1dd132['options']['include'],function(_0x4541c5){return{'model':db[_0x4541c5[_0xaf0b('0x1e')]],'as':_0x4541c5['as'],'attributes':_0x4541c5[_0xaf0b('0x1a')],'include':_0x4541c5[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x4541c5[_0xaf0b('0x1c')],function(_0x234040){return{'model':db[_0x234040[_0xaf0b('0x1e')]],'as':_0x234040['as'],'attributes':_0x234040['attributes'],'include':_0x234040[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x234040[_0xaf0b('0x1c')],function(_0x51cb2f){return{'model':db[_0x51cb2f[_0xaf0b('0x1e')]],'as':_0x51cb2f['as'],'attributes':_0x51cb2f[_0xaf0b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a3e1b){logger['info'](_0xaf0b('0x14'),_0x1dd132);logger[_0xaf0b('0x1f')](_0xaf0b('0x14'),_0x1dd132,JSON['stringify'](_0x5a3e1b));_0xbe0d1e(_0x5a3e1b);})[_0xaf0b('0x13')](function(_0x674048){logger[_0xaf0b('0xe')](_0xaf0b('0x14'),_0x674048[_0xaf0b('0x11')],_0x1dd132);_0x3201ed(_0x36b059[_0xaf0b('0xe')](0x1f4,_0x674048[_0xaf0b('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x2860e){var _0x40f45d=this;return new Promise(function(_0x4beee6,_0x26af15){return db[_0xaf0b('0x15')][_0xaf0b('0x20')]({'raw':_0x2860e[_0xaf0b('0x17')]?_0x2860e[_0xaf0b('0x17')][_0xaf0b('0x18')]===undefined?!![]:![]:!![],'where':_0x2860e[_0xaf0b('0x17')]?_0x2860e[_0xaf0b('0x17')][_0xaf0b('0x19')]||null:null,'attributes':_0x2860e['options']?_0x2860e[_0xaf0b('0x17')]['attributes']||null:null,'include':_0x2860e['options']?_0x2860e['options'][_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x2860e[_0xaf0b('0x17')][_0xaf0b('0x1c')],function(_0x18da8d){return{'model':db[_0x18da8d[_0xaf0b('0x1e')]],'as':_0x18da8d['as'],'attributes':_0x18da8d['attributes'],'include':_0x18da8d[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x18da8d[_0xaf0b('0x1c')],function(_0x339142){return{'model':db[_0x339142[_0xaf0b('0x1e')]],'as':_0x339142['as'],'attributes':_0x339142[_0xaf0b('0x1a')],'include':_0x339142[_0xaf0b('0x1c')]?_[_0xaf0b('0x1d')](_0x339142[_0xaf0b('0x1c')],function(_0x39604e){return{'model':db[_0x39604e['model']],'as':_0x39604e['as'],'attributes':_0x39604e[_0xaf0b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ed4bd){logger['info'](_0xaf0b('0x21'),_0x2860e);logger['debug'](_0xaf0b('0x21'),_0x2860e,JSON[_0xaf0b('0xd')](_0x2ed4bd));_0x4beee6(_0x2ed4bd);})[_0xaf0b('0x13')](function(_0x24fcde){logger[_0xaf0b('0xe')](_0xaf0b('0x21'),_0x24fcde[_0xaf0b('0x11')],_0x2860e);_0x26af15(_0x40f45d['error'](0x1f4,_0x24fcde[_0xaf0b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0311d3d..77a404b 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 _0x25ae=['getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x1f719a,_0x3aceab){var _0x6995f8=function(_0x2c09fb){while(--_0x2c09fb){_0x1f719a['push'](_0x1f719a['shift']());}};_0x6995f8(++_0x3aceab);}(_0x25ae,0x164));var _0xe25a=function(_0x3957ff,_0x18ad93){_0x3957ff=_0x3957ff-0x0;var _0x2e4509=_0x25ae[_0x3957ff];return _0x2e4509;};'use strict';var multer=require(_0xe25a('0x0'));var util=require(_0xe25a('0x1'));var path=require(_0xe25a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe25a('0x3')]();var fs_extra=require(_0xe25a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe25a('0x5'));var config=require(_0xe25a('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xe25a('0x7')]('/',auth[_0xe25a('0x8')](),controller[_0xe25a('0x9')]);router[_0xe25a('0x7')](_0xe25a('0xa'),auth[_0xe25a('0x8')](),controller[_0xe25a('0xb')]);router[_0xe25a('0x7')]('/:id/fields',auth[_0xe25a('0x8')](),controller[_0xe25a('0xc')]);router[_0xe25a('0x7')]('/:id/subjects',auth[_0xe25a('0x8')](),controller[_0xe25a('0xd')]);router['get'](_0xe25a('0xe'),auth[_0xe25a('0x8')](),controller[_0xe25a('0xf')]);router[_0xe25a('0x7')]('/:id/tags',auth[_0xe25a('0x8')](),controller[_0xe25a('0x10')]);router[_0xe25a('0x11')]('/',auth[_0xe25a('0x8')](),controller[_0xe25a('0x12')]);router[_0xe25a('0x11')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xe25a('0x13')]('/:id',auth[_0xe25a('0x8')](),controller['update']);router[_0xe25a('0x14')](_0xe25a('0xa'),auth[_0xe25a('0x8')](),controller[_0xe25a('0x15')]);module[_0xe25a('0x16')]=router; \ No newline at end of file +var _0x73d8=['get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated'];(function(_0x554431,_0x12e87c){var _0x5c0cdc=function(_0x242687){while(--_0x242687){_0x554431['push'](_0x554431['shift']());}};_0x5c0cdc(++_0x12e87c);}(_0x73d8,0xbe));var _0x873d=function(_0x5174b1,_0x1ccc35){_0x5174b1=_0x5174b1-0x0;var _0x1d2233=_0x73d8[_0x5174b1];return _0x1d2233;};'use strict';var multer=require(_0x873d('0x0'));var util=require(_0x873d('0x1'));var path=require(_0x873d('0x2'));var timeout=require(_0x873d('0x3'));var express=require(_0x873d('0x4'));var router=express['Router']();var fs_extra=require(_0x873d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x873d('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x873d('0x7')](),controller['index']);router[_0x873d('0x8')](_0x873d('0x9'),auth[_0x873d('0x7')](),controller[_0x873d('0xa')]);router[_0x873d('0x8')](_0x873d('0xb'),auth[_0x873d('0x7')](),controller[_0x873d('0xc')]);router['get'](_0x873d('0xd'),auth[_0x873d('0x7')](),controller['getSubjects']);router[_0x873d('0x8')](_0x873d('0xe'),auth[_0x873d('0x7')](),controller[_0x873d('0xf')]);router['get'](_0x873d('0x10'),auth[_0x873d('0x7')](),controller[_0x873d('0x11')]);router[_0x873d('0x12')]('/',auth[_0x873d('0x7')](),controller['create']);router['post']('/:id/tags',auth[_0x873d('0x7')](),controller[_0x873d('0x13')]);router[_0x873d('0x14')](_0x873d('0x9'),auth[_0x873d('0x7')](),controller['update']);router['delete']('/:id',auth[_0x873d('0x7')](),controller['destroy']);module[_0x873d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index ba27d84..fd97822 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 _0xf9dd=['sequelize','exports','STRING'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xf9dd,0xa5));var _0xdf9d=function(_0x12a2f1,_0x51606b){_0x12a2f1=_0x12a2f1-0x0;var _0x2e7f0c=_0xf9dd[_0x12a2f1];return _0x2e7f0c;};'use strict';var Sequelize=require(_0xdf9d('0x0'));module[_0xdf9d('0x1')]={'name':{'type':Sequelize[_0xdf9d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8b19=['exports','STRING','sequelize'];(function(_0x2bc10d,_0x2c831f){var _0x504979=function(_0x12141d){while(--_0x12141d){_0x2bc10d['push'](_0x2bc10d['shift']());}};_0x504979(++_0x2c831f);}(_0x8b19,0xc8));var _0x98b1=function(_0xfd52d,_0x430bcf){_0xfd52d=_0xfd52d-0x0;var _0x2b269c=_0x8b19[_0xfd52d];return _0x2b269c;};'use strict';var Sequelize=require(_0x98b1('0x0'));module[_0x98b1('0x1')]={'name':{'type':Sequelize[_0x98b1('0x2')]},'description':{'type':Sequelize[_0x98b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index a857404..5ce6f6c 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 _0x2003=['body','destroy','getFields','findOne','FreshdeskField','order','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','moment','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/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','index','FreshdeskConfiguration','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0xf80e26,_0x341864){var _0x21a4db=function(_0x15e13a){while(--_0x15e13a){_0xf80e26['push'](_0xf80e26['shift']());}};_0x21a4db(++_0x341864);}(_0x2003,0xb3));var _0x3200=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x2003[_0x1f1e31];return _0x229b56;};'use strict';var emlformat=require(_0x3200('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3200('0x1'));var rp=require('request-promise');var moment=require(_0x3200('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3200('0x3'));var util=require(_0x3200('0x4'));var path=require('path');var sox=require(_0x3200('0x5'));var csv=require(_0x3200('0x6'));var ejs=require(_0x3200('0x7'));var fs=require('fs');var fs_extra=require(_0x3200('0x8'));var _=require(_0x3200('0x9'));var squel=require(_0x3200('0xa'));var crypto=require(_0x3200('0xb'));var jsforce=require(_0x3200('0xc'));var deskjs=require(_0x3200('0xd'));var toCsv=require(_0x3200('0x6'));var querystring=require(_0x3200('0xe'));var Papa=require(_0x3200('0xf'));var Redis=require('ioredis');var authService=require(_0x3200('0x10'));var qs=require(_0x3200('0x11'));var as=require(_0x3200('0x12'));var hardwareService=require(_0x3200('0x13'));var logger=require(_0x3200('0x14'))('api');var utils=require(_0x3200('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3200('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5af1d9,_0x350aed){_0x350aed=_0x350aed||0xcc;return function(_0x3d279e){if(_0x3d279e){return _0x5af1d9[_0x3200('0x17')](_0x350aed);}return _0x5af1d9[_0x3200('0x18')](_0x350aed)[_0x3200('0x19')]();};}function respondWithResult(_0x463afa,_0x394298){_0x394298=_0x394298||0xc8;return function(_0xf2ec52){if(_0xf2ec52){return _0x463afa[_0x3200('0x18')](_0x394298)['json'](_0xf2ec52);}};}function respondWithFilteredResult(_0x10c7a9,_0x34b111){return function(_0x47a47a){if(_0x47a47a){var _0x4eccbd=typeof _0x34b111[_0x3200('0x1a')]===_0x3200('0x1b')&&typeof _0x34b111[_0x3200('0x1c')]===_0x3200('0x1b');var _0x2f5802=_0x47a47a['count'];var _0x25bca7=_0x4eccbd?0x0:_0x34b111['offset'];var _0x4063ae=_0x4eccbd?_0x47a47a[_0x3200('0x1d')]:_0x34b111[_0x3200('0x1a')]+_0x34b111['limit'];var _0xaea1d;if(_0x4063ae>=_0x2f5802){_0x4063ae=_0x2f5802;_0xaea1d=0xc8;}else{_0xaea1d=0xce;}_0x10c7a9[_0x3200('0x18')](_0xaea1d);return _0x10c7a9[_0x3200('0x1e')](_0x3200('0x1f'),_0x25bca7+'-'+_0x4063ae+'/'+_0x2f5802)[_0x3200('0x20')](_0x47a47a);}return null;};}function patchUpdates(_0x5342c9){return function(_0x29b39d){try{jsonpatch[_0x3200('0x21')](_0x29b39d,_0x5342c9,!![]);}catch(_0xfc4786){return BPromise[_0x3200('0x22')](_0xfc4786);}return _0x29b39d[_0x3200('0x23')]();};}function saveUpdates(_0xbb9597,_0x5ab94c){return function(_0x3f2530){if(_0x3f2530){return _0x3f2530[_0x3200('0x24')](_0xbb9597)[_0x3200('0x25')](function(_0x5151cd){return _0x5151cd;});}return null;};}function removeEntity(_0x53cfc,_0xe7289b){return function(_0x5a0a86){if(_0x5a0a86){return _0x5a0a86['destroy']()[_0x3200('0x25')](function(){_0x53cfc[_0x3200('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x406328,_0x300ab5){return function(_0x4eb8e1){if(!_0x4eb8e1){_0x406328[_0x3200('0x17')](0x194);}return _0x4eb8e1;};}function handleError(_0x25e74a,_0x46b605){_0x46b605=_0x46b605||0x1f4;return function(_0x43db1c){logger['error'](_0x43db1c[_0x3200('0x26')]);if(_0x43db1c[_0x3200('0x27')]){delete _0x43db1c[_0x3200('0x27')];}_0x25e74a['status'](_0x46b605)['send'](_0x43db1c);};}exports[_0x3200('0x28')]=function(_0x873103,_0x10623f){var _0x961b47={},_0x3e9525={},_0x49d835={'count':0x0,'rows':[]};var _0x28efa6=_['map'](db[_0x3200('0x29')][_0x3200('0x2a')],function(_0x57251a){return{'name':_0x57251a['fieldName'],'type':_0x57251a[_0x3200('0x2b')][_0x3200('0x2c')]};});_0x3e9525['model']=_[_0x3200('0x2d')](_0x28efa6,'name');_0x3e9525[_0x3200('0x2e')]=_[_0x3200('0x2f')](_0x873103['query']);_0x3e9525[_0x3200('0x30')]=_[_0x3200('0x31')](_0x3e9525['model'],_0x3e9525['query']);_0x961b47['attributes']=_['intersection'](_0x3e9525[_0x3200('0x32')],qs['fields'](_0x873103[_0x3200('0x2e')][_0x3200('0x33')]));_0x961b47[_0x3200('0x34')]=_0x961b47[_0x3200('0x34')][_0x3200('0x35')]?_0x961b47['attributes']:_0x3e9525[_0x3200('0x32')];if(!_0x873103['query']['hasOwnProperty'](_0x3200('0x36'))){_0x961b47['limit']=qs[_0x3200('0x1c')](_0x873103[_0x3200('0x2e')][_0x3200('0x1c')]);_0x961b47[_0x3200('0x1a')]=qs[_0x3200('0x1a')](_0x873103[_0x3200('0x2e')]['offset']);}_0x961b47['order']=qs[_0x3200('0x37')](_0x873103[_0x3200('0x2e')]['sort']);_0x961b47[_0x3200('0x38')]=qs['filters'](_[_0x3200('0x39')](_0x873103[_0x3200('0x2e')],_0x3e9525[_0x3200('0x30')]),_0x28efa6);if(_0x873103['query'][_0x3200('0x3a')]){_0x961b47[_0x3200('0x38')]=_[_0x3200('0x3b')](_0x961b47[_0x3200('0x38')],{'$or':_[_0x3200('0x2d')](_0x28efa6,function(_0x4fca94){if(_0x4fca94[_0x3200('0x2b')]!==_0x3200('0x3c')){var _0x4fdb76={};_0x4fdb76[_0x4fca94[_0x3200('0x27')]]={'$like':'%'+_0x873103[_0x3200('0x2e')][_0x3200('0x3a')]+'%'};return _0x4fdb76;}})});}_0x961b47=_[_0x3200('0x3b')]({},_0x961b47,_0x873103[_0x3200('0x3d')]);var _0x5bf0ca={'where':_0x961b47[_0x3200('0x38')]};return db[_0x3200('0x29')][_0x3200('0x1d')](_0x5bf0ca)['then'](function(_0x55fbbd){_0x49d835[_0x3200('0x1d')]=_0x55fbbd;if(_0x873103[_0x3200('0x2e')][_0x3200('0x3e')]){_0x961b47[_0x3200('0x3f')]=[{'all':!![]}];}return db[_0x3200('0x29')][_0x3200('0x40')](_0x961b47);})[_0x3200('0x25')](function(_0x2d06ff){_0x49d835[_0x3200('0x41')]=_0x2d06ff;return _0x49d835;})[_0x3200('0x25')](respondWithFilteredResult(_0x10623f,_0x961b47))[_0x3200('0x42')](handleError(_0x10623f,null));};exports['show']=function(_0x1b3bc4,_0x408468){var _0x40eb7b={'raw':![],'where':{'id':_0x1b3bc4[_0x3200('0x43')]['id']}},_0x4f2acb={};_0x4f2acb[_0x3200('0x32')]=_[_0x3200('0x2f')](db[_0x3200('0x29')][_0x3200('0x2a')]);_0x4f2acb[_0x3200('0x2e')]=_['keys'](_0x1b3bc4['query']);_0x4f2acb[_0x3200('0x30')]=_[_0x3200('0x31')](_0x4f2acb[_0x3200('0x32')],_0x4f2acb['query']);_0x40eb7b['attributes']=_[_0x3200('0x31')](_0x4f2acb[_0x3200('0x32')],qs[_0x3200('0x33')](_0x1b3bc4[_0x3200('0x2e')][_0x3200('0x33')]));_0x40eb7b['attributes']=_0x40eb7b[_0x3200('0x34')][_0x3200('0x35')]?_0x40eb7b[_0x3200('0x34')]:_0x4f2acb[_0x3200('0x32')];if(_0x1b3bc4['query']['includeAll']){_0x40eb7b[_0x3200('0x3f')]=[{'all':!![]}];}_0x40eb7b=_[_0x3200('0x3b')]({},_0x40eb7b,_0x1b3bc4[_0x3200('0x3d')]);return db[_0x3200('0x29')][_0x3200('0x44')](_0x40eb7b)[_0x3200('0x25')](handleEntityNotFound(_0x408468,null))['then'](respondWithResult(_0x408468,null))['catch'](handleError(_0x408468,null));};exports[_0x3200('0x45')]=function(_0x378923,_0x430272){return db[_0x3200('0x29')]['create'](_0x378923[_0x3200('0x46')],{})[_0x3200('0x25')](respondWithResult(_0x430272,0xc9))['catch'](handleError(_0x430272,null));};exports[_0x3200('0x24')]=function(_0x32f701,_0x3a67b2){if(_0x32f701[_0x3200('0x46')]['id']){delete _0x32f701[_0x3200('0x46')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x32f701['params']['id']}})[_0x3200('0x25')](handleEntityNotFound(_0x3a67b2,null))['then'](saveUpdates(_0x32f701[_0x3200('0x46')],null))[_0x3200('0x25')](respondWithResult(_0x3a67b2,null))[_0x3200('0x42')](handleError(_0x3a67b2,null));};exports[_0x3200('0x47')]=function(_0x594c79,_0x5f373d){return db[_0x3200('0x29')][_0x3200('0x44')]({'where':{'id':_0x594c79['params']['id']}})[_0x3200('0x25')](handleEntityNotFound(_0x5f373d,null))[_0x3200('0x25')](removeEntity(_0x5f373d,null))[_0x3200('0x42')](handleError(_0x5f373d,null));};exports[_0x3200('0x48')]=function(_0x4a326b,_0x194291,_0x2dcd4f){var _0x3cd666={};var _0xf1ff94={};var _0x52b65f;var _0x56336b;return db[_0x3200('0x29')][_0x3200('0x49')]({'where':{'id':_0x4a326b[_0x3200('0x43')]['id']}})['then'](handleEntityNotFound(_0x194291,null))[_0x3200('0x25')](function(_0x1739a7){if(_0x1739a7){_0x52b65f=_0x1739a7;_0xf1ff94['model']=_[_0x3200('0x2f')](db[_0x3200('0x4a')][_0x3200('0x2a')]);_0xf1ff94[_0x3200('0x2e')]=_['keys'](_0x4a326b['query']);_0xf1ff94['filters']=_[_0x3200('0x31')](_0xf1ff94['model'],_0xf1ff94['query']);_0x3cd666[_0x3200('0x34')]=_['intersection'](_0xf1ff94[_0x3200('0x32')],qs['fields'](_0x4a326b[_0x3200('0x2e')][_0x3200('0x33')]));_0x3cd666['attributes']=_0x3cd666[_0x3200('0x34')][_0x3200('0x35')]?_0x3cd666['attributes']:_0xf1ff94[_0x3200('0x32')];_0x3cd666[_0x3200('0x4b')]=qs[_0x3200('0x37')](_0x4a326b['query'][_0x3200('0x37')]);_0x3cd666[_0x3200('0x38')]=qs[_0x3200('0x30')](_[_0x3200('0x39')](_0x4a326b[_0x3200('0x2e')],_0xf1ff94[_0x3200('0x30')]));if(_0x4a326b['query'][_0x3200('0x3a')]){_0x3cd666['where']=_[_0x3200('0x3b')](_0x3cd666[_0x3200('0x38')],{'$or':_['map'](_0x3cd666[_0x3200('0x34')],function(_0x22e29a){var _0xce570e={};_0xce570e[_0x22e29a]={'$like':'%'+_0x4a326b[_0x3200('0x2e')][_0x3200('0x3a')]+'%'};return _0xce570e;})});}_0x3cd666=_[_0x3200('0x3b')]({},_0x3cd666,_0x4a326b[_0x3200('0x3d')]);return _0x52b65f['getFields'](_0x3cd666);}})[_0x3200('0x25')](function(_0x1eb7a3){if(_0x1eb7a3){_0x56336b=_0x1eb7a3[_0x3200('0x35')];if(!_0x4a326b[_0x3200('0x2e')]['hasOwnProperty'](_0x3200('0x36'))){_0x3cd666['limit']=qs[_0x3200('0x1c')](_0x4a326b[_0x3200('0x2e')][_0x3200('0x1c')]);_0x3cd666[_0x3200('0x1a')]=qs[_0x3200('0x1a')](_0x4a326b[_0x3200('0x2e')][_0x3200('0x1a')]);}return _0x52b65f[_0x3200('0x48')](_0x3cd666);}})[_0x3200('0x25')](function(_0x410ebf){if(_0x410ebf){return _0x410ebf?{'count':_0x56336b,'rows':_0x410ebf}:null;}})[_0x3200('0x25')](respondWithResult(_0x194291,null))[_0x3200('0x42')](handleError(_0x194291,null));};exports['getSubjects']=function(_0x71911c,_0x282d87,_0x27cde6){var _0x8f1210={};var _0x534db9={};var _0x5b40b8;var _0x289b06;return db[_0x3200('0x29')]['findOne']({'where':{'id':_0x71911c[_0x3200('0x43')]['id']}})[_0x3200('0x25')](handleEntityNotFound(_0x282d87,null))[_0x3200('0x25')](function(_0x4f60cb){if(_0x4f60cb){_0x5b40b8=_0x4f60cb;_0x534db9[_0x3200('0x32')]=_[_0x3200('0x2f')](db[_0x3200('0x4a')][_0x3200('0x2a')]);_0x534db9[_0x3200('0x2e')]=_[_0x3200('0x2f')](_0x71911c[_0x3200('0x2e')]);_0x534db9[_0x3200('0x30')]=_['intersection'](_0x534db9['model'],_0x534db9[_0x3200('0x2e')]);_0x8f1210[_0x3200('0x34')]=_[_0x3200('0x31')](_0x534db9[_0x3200('0x32')],qs[_0x3200('0x33')](_0x71911c[_0x3200('0x2e')][_0x3200('0x33')]));_0x8f1210['attributes']=_0x8f1210[_0x3200('0x34')]['length']?_0x8f1210['attributes']:_0x534db9[_0x3200('0x32')];_0x8f1210['order']=qs[_0x3200('0x37')](_0x71911c['query'][_0x3200('0x37')]);_0x8f1210[_0x3200('0x38')]=qs[_0x3200('0x30')](_[_0x3200('0x39')](_0x71911c[_0x3200('0x2e')],_0x534db9['filters']));if(_0x71911c['query']['filter']){_0x8f1210[_0x3200('0x38')]=_[_0x3200('0x3b')](_0x8f1210[_0x3200('0x38')],{'$or':_[_0x3200('0x2d')](_0x8f1210[_0x3200('0x34')],function(_0x18f43b){var _0x30ca45={};_0x30ca45[_0x18f43b]={'$like':'%'+_0x71911c[_0x3200('0x2e')][_0x3200('0x3a')]+'%'};return _0x30ca45;})});}_0x8f1210=_['merge']({},_0x8f1210,_0x71911c[_0x3200('0x3d')]);return _0x5b40b8['getSubjects'](_0x8f1210);}})[_0x3200('0x25')](function(_0x54ed28){if(_0x54ed28){_0x289b06=_0x54ed28['length'];if(!_0x71911c['query'][_0x3200('0x4c')](_0x3200('0x36'))){_0x8f1210[_0x3200('0x1c')]=qs[_0x3200('0x1c')](_0x71911c['query'][_0x3200('0x1c')]);_0x8f1210['offset']=qs[_0x3200('0x1a')](_0x71911c[_0x3200('0x2e')][_0x3200('0x1a')]);}return _0x5b40b8[_0x3200('0x4d')](_0x8f1210);}})[_0x3200('0x25')](function(_0x22d554){if(_0x22d554){return _0x22d554?{'count':_0x289b06,'rows':_0x22d554}:null;}})[_0x3200('0x25')](respondWithResult(_0x282d87,null))[_0x3200('0x42')](handleError(_0x282d87,null));};exports[_0x3200('0x4e')]=function(_0x2cd118,_0x4ecfa7,_0x5e52ba){var _0x5713ec={};var _0x5023b2={};var _0x511b1a;var _0x338420;return db[_0x3200('0x29')]['findOne']({'where':{'id':_0x2cd118['params']['id']}})[_0x3200('0x25')](handleEntityNotFound(_0x4ecfa7,null))[_0x3200('0x25')](function(_0x500a7a){if(_0x500a7a){_0x511b1a=_0x500a7a;_0x5023b2[_0x3200('0x32')]=_[_0x3200('0x2f')](db[_0x3200('0x4a')][_0x3200('0x2a')]);_0x5023b2[_0x3200('0x2e')]=_[_0x3200('0x2f')](_0x2cd118[_0x3200('0x2e')]);_0x5023b2[_0x3200('0x30')]=_[_0x3200('0x31')](_0x5023b2['model'],_0x5023b2[_0x3200('0x2e')]);_0x5713ec[_0x3200('0x34')]=_[_0x3200('0x31')](_0x5023b2[_0x3200('0x32')],qs['fields'](_0x2cd118[_0x3200('0x2e')][_0x3200('0x33')]));_0x5713ec['attributes']=_0x5713ec[_0x3200('0x34')][_0x3200('0x35')]?_0x5713ec[_0x3200('0x34')]:_0x5023b2[_0x3200('0x32')];_0x5713ec['order']=qs[_0x3200('0x37')](_0x2cd118[_0x3200('0x2e')][_0x3200('0x37')]);_0x5713ec[_0x3200('0x38')]=qs[_0x3200('0x30')](_[_0x3200('0x39')](_0x2cd118['query'],_0x5023b2[_0x3200('0x30')]));if(_0x2cd118[_0x3200('0x2e')][_0x3200('0x3a')]){_0x5713ec[_0x3200('0x38')]=_[_0x3200('0x3b')](_0x5713ec[_0x3200('0x38')],{'$or':_[_0x3200('0x2d')](_0x5713ec['attributes'],function(_0x3d02d3){var _0x3fbb9d={};_0x3fbb9d[_0x3d02d3]={'$like':'%'+_0x2cd118[_0x3200('0x2e')][_0x3200('0x3a')]+'%'};return _0x3fbb9d;})});}_0x5713ec=_['merge']({},_0x5713ec,_0x2cd118[_0x3200('0x3d')]);return _0x511b1a['getDescriptions'](_0x5713ec);}})[_0x3200('0x25')](function(_0x109645){if(_0x109645){_0x338420=_0x109645[_0x3200('0x35')];if(!_0x2cd118[_0x3200('0x2e')][_0x3200('0x4c')]('nolimit')){_0x5713ec[_0x3200('0x1c')]=qs['limit'](_0x2cd118['query']['limit']);_0x5713ec[_0x3200('0x1a')]=qs[_0x3200('0x1a')](_0x2cd118[_0x3200('0x2e')]['offset']);}return _0x511b1a['getDescriptions'](_0x5713ec);}})[_0x3200('0x25')](function(_0x1289fb){if(_0x1289fb){return _0x1289fb?{'count':_0x338420,'rows':_0x1289fb}:null;}})[_0x3200('0x25')](respondWithResult(_0x4ecfa7,null))[_0x3200('0x42')](handleError(_0x4ecfa7,null));};exports[_0x3200('0x4f')]=function(_0x1cc6f3,_0x2b5e5a,_0x5997ae){var _0x4a5dd3={};var _0x3e04dc={};var _0x4150a6;var _0x1166b7;return db[_0x3200('0x29')][_0x3200('0x49')]({'where':{'id':_0x1cc6f3[_0x3200('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b5e5a,null))['then'](function(_0x3e85bc){if(_0x3e85bc){_0x4150a6=_0x3e85bc;_0x3e04dc[_0x3200('0x32')]=_[_0x3200('0x2f')](db[_0x3200('0x50')][_0x3200('0x2a')]);_0x3e04dc[_0x3200('0x2e')]=_[_0x3200('0x2f')](_0x1cc6f3[_0x3200('0x2e')]);_0x3e04dc[_0x3200('0x30')]=_['intersection'](_0x3e04dc[_0x3200('0x32')],_0x3e04dc[_0x3200('0x2e')]);_0x4a5dd3[_0x3200('0x34')]=_[_0x3200('0x31')](_0x3e04dc[_0x3200('0x32')],qs[_0x3200('0x33')](_0x1cc6f3['query'][_0x3200('0x33')]));_0x4a5dd3[_0x3200('0x34')]=_0x4a5dd3['attributes'][_0x3200('0x35')]?_0x4a5dd3[_0x3200('0x34')]:_0x3e04dc[_0x3200('0x32')];_0x4a5dd3[_0x3200('0x4b')]=qs['sort'](_0x1cc6f3[_0x3200('0x2e')][_0x3200('0x37')]);_0x4a5dd3[_0x3200('0x38')]=qs[_0x3200('0x30')](_[_0x3200('0x39')](_0x1cc6f3['query'],_0x3e04dc['filters']));if(_0x1cc6f3[_0x3200('0x2e')][_0x3200('0x3a')]){_0x4a5dd3[_0x3200('0x38')]=_[_0x3200('0x3b')](_0x4a5dd3[_0x3200('0x38')],{'$or':_['map'](_0x4a5dd3['attributes'],function(_0x25597d){var _0x225e89={};_0x225e89[_0x25597d]={'$like':'%'+_0x1cc6f3['query'][_0x3200('0x3a')]+'%'};return _0x225e89;})});}_0x4a5dd3=_[_0x3200('0x3b')]({},_0x4a5dd3,_0x1cc6f3[_0x3200('0x3d')]);return _0x4150a6[_0x3200('0x4f')](_0x4a5dd3);}})[_0x3200('0x25')](function(_0xee4d2){if(_0xee4d2){_0x1166b7=_0xee4d2[_0x3200('0x35')];if(!_0x1cc6f3['query']['hasOwnProperty'](_0x3200('0x36'))){_0x4a5dd3[_0x3200('0x1c')]=qs['limit'](_0x1cc6f3[_0x3200('0x2e')]['limit']);_0x4a5dd3['offset']=qs['offset'](_0x1cc6f3[_0x3200('0x2e')][_0x3200('0x1a')]);}return _0x4150a6[_0x3200('0x4f')](_0x4a5dd3);}})['then'](function(_0x101f5c){if(_0x101f5c){return _0x101f5c?{'count':_0x1166b7,'rows':_0x101f5c}:null;}})['then'](respondWithResult(_0x2b5e5a,null))[_0x3200('0x42')](handleError(_0x2b5e5a,null));};exports[_0x3200('0x51')]=function(_0xf28fee,_0x449d40,_0x22fbef){if(_0xf28fee[_0x3200('0x46')]['id']){delete _0xf28fee[_0x3200('0x46')]['id'];}return db[_0x3200('0x29')][_0x3200('0x49')]({'where':{'id':_0xf28fee[_0x3200('0x43')]['id']}})[_0x3200('0x25')](handleEntityNotFound(_0x449d40,null))[_0x3200('0x25')](function(_0x109b67){if(_0x109b67){return _0x109b67[_0x3200('0x51')](_0xf28fee[_0x3200('0x46')][_0x3200('0x52')]||[]);}return null;})[_0x3200('0x25')](respondWithResult(_0x449d40,null))['catch'](handleError(_0x449d40,null));}; \ No newline at end of file +var _0xaa47=['Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','catch','params','rawAttributes','create','body','update','find','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','getTags'];(function(_0xdcede,_0x1b3cb9){var _0x4e91cf=function(_0x201c04){while(--_0x201c04){_0xdcede['push'](_0xdcede['shift']());}};_0x4e91cf(++_0x1b3cb9);}(_0xaa47,0xb0));var _0x7aa4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaa47[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7aa4('0x0'));var rimraf=require(_0x7aa4('0x1'));var zipdir=require(_0x7aa4('0x2'));var jsonpatch=require(_0x7aa4('0x3'));var rp=require(_0x7aa4('0x4'));var moment=require(_0x7aa4('0x5'));var BPromise=require(_0x7aa4('0x6'));var Mustache=require(_0x7aa4('0x7'));var util=require(_0x7aa4('0x8'));var path=require('path');var sox=require(_0x7aa4('0x9'));var csv=require(_0x7aa4('0xa'));var ejs=require(_0x7aa4('0xb'));var fs=require('fs');var fs_extra=require(_0x7aa4('0xc'));var _=require('lodash');var squel=require(_0x7aa4('0xd'));var crypto=require(_0x7aa4('0xe'));var jsforce=require(_0x7aa4('0xf'));var deskjs=require(_0x7aa4('0x10'));var toCsv=require(_0x7aa4('0xa'));var querystring=require(_0x7aa4('0x11'));var Papa=require('papaparse');var Redis=require(_0x7aa4('0x12'));var authService=require(_0x7aa4('0x13'));var qs=require(_0x7aa4('0x14'));var as=require(_0x7aa4('0x15'));var hardwareService=require(_0x7aa4('0x16'));var logger=require(_0x7aa4('0x17'))(_0x7aa4('0x18'));var utils=require('../../config/utils');var config=require(_0x7aa4('0x19'));var licenseUtil=require(_0x7aa4('0x1a'));var db=require(_0x7aa4('0x1b'))['db'];function respondWithStatusCode(_0x410124,_0x52e2be){_0x52e2be=_0x52e2be||0xcc;return function(_0x293ba5){if(_0x293ba5){return _0x410124[_0x7aa4('0x1c')](_0x52e2be);}return _0x410124[_0x7aa4('0x1d')](_0x52e2be)[_0x7aa4('0x1e')]();};}function respondWithResult(_0x34db32,_0x3cf583){_0x3cf583=_0x3cf583||0xc8;return function(_0x4e76d9){if(_0x4e76d9){return _0x34db32[_0x7aa4('0x1d')](_0x3cf583)['json'](_0x4e76d9);}};}function respondWithFilteredResult(_0x3725c1,_0x17d8fa){return function(_0x11e3f9){if(_0x11e3f9){var _0x371382=typeof _0x17d8fa[_0x7aa4('0x1f')]===_0x7aa4('0x20')&&typeof _0x17d8fa[_0x7aa4('0x21')]===_0x7aa4('0x20');var _0x200f43=_0x11e3f9[_0x7aa4('0x22')];var _0x2f7723=_0x371382?0x0:_0x17d8fa['offset'];var _0xc9351f=_0x371382?_0x11e3f9[_0x7aa4('0x22')]:_0x17d8fa[_0x7aa4('0x1f')]+_0x17d8fa[_0x7aa4('0x21')];var _0xcd0acb;if(_0xc9351f>=_0x200f43){_0xc9351f=_0x200f43;_0xcd0acb=0xc8;}else{_0xcd0acb=0xce;}_0x3725c1[_0x7aa4('0x1d')](_0xcd0acb);return _0x3725c1[_0x7aa4('0x23')](_0x7aa4('0x24'),_0x2f7723+'-'+_0xc9351f+'/'+_0x200f43)[_0x7aa4('0x25')](_0x11e3f9);}return null;};}function patchUpdates(_0x169022){return function(_0x3d02ea){try{jsonpatch[_0x7aa4('0x26')](_0x3d02ea,_0x169022,!![]);}catch(_0x7f1fbf){return BPromise[_0x7aa4('0x27')](_0x7f1fbf);}return _0x3d02ea[_0x7aa4('0x28')]();};}function saveUpdates(_0x58c796,_0x23b45e){return function(_0x12cbde){if(_0x12cbde){return _0x12cbde['update'](_0x58c796)[_0x7aa4('0x29')](function(_0x32de83){return _0x32de83;});}return null;};}function removeEntity(_0x4fd8f8,_0x5888c8){return function(_0x2366fb){if(_0x2366fb){return _0x2366fb[_0x7aa4('0x2a')]()[_0x7aa4('0x29')](function(){_0x4fd8f8[_0x7aa4('0x1d')](0xcc)[_0x7aa4('0x1e')]();});}};}function handleEntityNotFound(_0x5071aa,_0xe93e8e){return function(_0x28c480){if(!_0x28c480){_0x5071aa[_0x7aa4('0x1c')](0x194);}return _0x28c480;};}function handleError(_0x5bb59c,_0x1313f5){_0x1313f5=_0x1313f5||0x1f4;return function(_0x58c116){logger['error'](_0x58c116[_0x7aa4('0x2b')]);if(_0x58c116['name']){delete _0x58c116[_0x7aa4('0x2c')];}_0x5bb59c[_0x7aa4('0x1d')](_0x1313f5)[_0x7aa4('0x2d')](_0x58c116);};}exports[_0x7aa4('0x2e')]=function(_0x50f408,_0x1698d3){var _0x2ddcb8={},_0x40f18a={},_0x5b4b96={'count':0x0,'rows':[]};var _0x9394e8=_[_0x7aa4('0x2f')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x22706c){return{'name':_0x22706c[_0x7aa4('0x30')],'type':_0x22706c[_0x7aa4('0x31')]['key']};});_0x40f18a[_0x7aa4('0x32')]=_[_0x7aa4('0x2f')](_0x9394e8,_0x7aa4('0x2c'));_0x40f18a[_0x7aa4('0x33')]=_[_0x7aa4('0x34')](_0x50f408[_0x7aa4('0x33')]);_0x40f18a['filters']=_[_0x7aa4('0x35')](_0x40f18a[_0x7aa4('0x32')],_0x40f18a[_0x7aa4('0x33')]);_0x2ddcb8[_0x7aa4('0x36')]=_[_0x7aa4('0x35')](_0x40f18a[_0x7aa4('0x32')],qs[_0x7aa4('0x37')](_0x50f408[_0x7aa4('0x33')][_0x7aa4('0x37')]));_0x2ddcb8[_0x7aa4('0x36')]=_0x2ddcb8[_0x7aa4('0x36')][_0x7aa4('0x38')]?_0x2ddcb8[_0x7aa4('0x36')]:_0x40f18a['model'];if(!_0x50f408[_0x7aa4('0x33')][_0x7aa4('0x39')](_0x7aa4('0x3a'))){_0x2ddcb8['limit']=qs[_0x7aa4('0x21')](_0x50f408[_0x7aa4('0x33')][_0x7aa4('0x21')]);_0x2ddcb8[_0x7aa4('0x1f')]=qs[_0x7aa4('0x1f')](_0x50f408[_0x7aa4('0x33')]['offset']);}_0x2ddcb8['order']=qs[_0x7aa4('0x3b')](_0x50f408['query'][_0x7aa4('0x3b')]);_0x2ddcb8[_0x7aa4('0x3c')]=qs[_0x7aa4('0x3d')](_[_0x7aa4('0x3e')](_0x50f408[_0x7aa4('0x33')],_0x40f18a[_0x7aa4('0x3d')]),_0x9394e8);if(_0x50f408[_0x7aa4('0x33')][_0x7aa4('0x3f')]){_0x2ddcb8[_0x7aa4('0x3c')]=_[_0x7aa4('0x40')](_0x2ddcb8[_0x7aa4('0x3c')],{'$or':_[_0x7aa4('0x2f')](_0x9394e8,function(_0x21cf53){if(_0x21cf53[_0x7aa4('0x31')]!==_0x7aa4('0x41')){var _0x5edc12={};_0x5edc12[_0x21cf53[_0x7aa4('0x2c')]]={'$like':'%'+_0x50f408['query']['filter']+'%'};return _0x5edc12;}})});}_0x2ddcb8=_[_0x7aa4('0x40')]({},_0x2ddcb8,_0x50f408[_0x7aa4('0x42')]);var _0x109130={'where':_0x2ddcb8['where']};return db[_0x7aa4('0x43')][_0x7aa4('0x22')](_0x109130)[_0x7aa4('0x29')](function(_0x3d8339){_0x5b4b96['count']=_0x3d8339;if(_0x50f408['query'][_0x7aa4('0x44')]){_0x2ddcb8[_0x7aa4('0x45')]=[{'all':!![]}];}return db[_0x7aa4('0x43')][_0x7aa4('0x46')](_0x2ddcb8);})[_0x7aa4('0x29')](function(_0x42db4e){_0x5b4b96['rows']=_0x42db4e;return _0x5b4b96;})[_0x7aa4('0x29')](respondWithFilteredResult(_0x1698d3,_0x2ddcb8))[_0x7aa4('0x47')](handleError(_0x1698d3,null));};exports['show']=function(_0x44985b,_0x499f83){var _0x165159={'raw':![],'where':{'id':_0x44985b[_0x7aa4('0x48')]['id']}},_0x4214c8={};_0x4214c8['model']=_['keys'](db[_0x7aa4('0x43')][_0x7aa4('0x49')]);_0x4214c8[_0x7aa4('0x33')]=_[_0x7aa4('0x34')](_0x44985b['query']);_0x4214c8[_0x7aa4('0x3d')]=_[_0x7aa4('0x35')](_0x4214c8[_0x7aa4('0x32')],_0x4214c8[_0x7aa4('0x33')]);_0x165159[_0x7aa4('0x36')]=_['intersection'](_0x4214c8[_0x7aa4('0x32')],qs[_0x7aa4('0x37')](_0x44985b[_0x7aa4('0x33')][_0x7aa4('0x37')]));_0x165159[_0x7aa4('0x36')]=_0x165159['attributes'][_0x7aa4('0x38')]?_0x165159[_0x7aa4('0x36')]:_0x4214c8[_0x7aa4('0x32')];if(_0x44985b[_0x7aa4('0x33')]['includeAll']){_0x165159['include']=[{'all':!![]}];}_0x165159=_['merge']({},_0x165159,_0x44985b[_0x7aa4('0x42')]);return db[_0x7aa4('0x43')]['find'](_0x165159)[_0x7aa4('0x29')](handleEntityNotFound(_0x499f83,null))[_0x7aa4('0x29')](respondWithResult(_0x499f83,null))[_0x7aa4('0x47')](handleError(_0x499f83,null));};exports[_0x7aa4('0x4a')]=function(_0x5cf578,_0x32a721){return db[_0x7aa4('0x43')][_0x7aa4('0x4a')](_0x5cf578[_0x7aa4('0x4b')],{})[_0x7aa4('0x29')](respondWithResult(_0x32a721,0xc9))[_0x7aa4('0x47')](handleError(_0x32a721,null));};exports[_0x7aa4('0x4c')]=function(_0x3b25ea,_0x16a2f4){if(_0x3b25ea[_0x7aa4('0x4b')]['id']){delete _0x3b25ea[_0x7aa4('0x4b')]['id'];}return db[_0x7aa4('0x43')][_0x7aa4('0x4d')]({'where':{'id':_0x3b25ea[_0x7aa4('0x48')]['id']}})['then'](handleEntityNotFound(_0x16a2f4,null))[_0x7aa4('0x29')](saveUpdates(_0x3b25ea[_0x7aa4('0x4b')],null))['then'](respondWithResult(_0x16a2f4,null))['catch'](handleError(_0x16a2f4,null));};exports[_0x7aa4('0x2a')]=function(_0x1ad8fe,_0x236957){return db[_0x7aa4('0x43')][_0x7aa4('0x4d')]({'where':{'id':_0x1ad8fe[_0x7aa4('0x48')]['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x236957,null))[_0x7aa4('0x29')](removeEntity(_0x236957,null))[_0x7aa4('0x47')](handleError(_0x236957,null));};exports['getFields']=function(_0x1f5371,_0x12e6b9,_0x29fb38){var _0x575ec3={};var _0x328d15={};var _0x1026d7;var _0x32fec3;return db[_0x7aa4('0x43')][_0x7aa4('0x4e')]({'where':{'id':_0x1f5371[_0x7aa4('0x48')]['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x12e6b9,null))['then'](function(_0x78fbce){if(_0x78fbce){_0x1026d7=_0x78fbce;_0x328d15['model']=_[_0x7aa4('0x34')](db[_0x7aa4('0x4f')]['rawAttributes']);_0x328d15['query']=_[_0x7aa4('0x34')](_0x1f5371['query']);_0x328d15[_0x7aa4('0x3d')]=_['intersection'](_0x328d15[_0x7aa4('0x32')],_0x328d15['query']);_0x575ec3['attributes']=_[_0x7aa4('0x35')](_0x328d15[_0x7aa4('0x32')],qs['fields'](_0x1f5371['query'][_0x7aa4('0x37')]));_0x575ec3[_0x7aa4('0x36')]=_0x575ec3[_0x7aa4('0x36')][_0x7aa4('0x38')]?_0x575ec3[_0x7aa4('0x36')]:_0x328d15[_0x7aa4('0x32')];_0x575ec3[_0x7aa4('0x50')]=qs[_0x7aa4('0x3b')](_0x1f5371['query']['sort']);_0x575ec3[_0x7aa4('0x3c')]=qs[_0x7aa4('0x3d')](_[_0x7aa4('0x3e')](_0x1f5371[_0x7aa4('0x33')],_0x328d15['filters']));if(_0x1f5371[_0x7aa4('0x33')][_0x7aa4('0x3f')]){_0x575ec3[_0x7aa4('0x3c')]=_[_0x7aa4('0x40')](_0x575ec3[_0x7aa4('0x3c')],{'$or':_[_0x7aa4('0x2f')](_0x575ec3[_0x7aa4('0x36')],function(_0x5c49fa){var _0x1d6159={};_0x1d6159[_0x5c49fa]={'$like':'%'+_0x1f5371[_0x7aa4('0x33')][_0x7aa4('0x3f')]+'%'};return _0x1d6159;})});}_0x575ec3=_[_0x7aa4('0x40')]({},_0x575ec3,_0x1f5371[_0x7aa4('0x42')]);return _0x1026d7[_0x7aa4('0x51')](_0x575ec3);}})['then'](function(_0x2340a8){if(_0x2340a8){_0x32fec3=_0x2340a8['length'];if(!_0x1f5371[_0x7aa4('0x33')][_0x7aa4('0x39')](_0x7aa4('0x3a'))){_0x575ec3[_0x7aa4('0x21')]=qs[_0x7aa4('0x21')](_0x1f5371[_0x7aa4('0x33')][_0x7aa4('0x21')]);_0x575ec3[_0x7aa4('0x1f')]=qs[_0x7aa4('0x1f')](_0x1f5371[_0x7aa4('0x33')][_0x7aa4('0x1f')]);}return _0x1026d7[_0x7aa4('0x51')](_0x575ec3);}})[_0x7aa4('0x29')](function(_0x500a2e){if(_0x500a2e){return _0x500a2e?{'count':_0x32fec3,'rows':_0x500a2e}:null;}})[_0x7aa4('0x29')](respondWithResult(_0x12e6b9,null))[_0x7aa4('0x47')](handleError(_0x12e6b9,null));};exports[_0x7aa4('0x52')]=function(_0x2ecaf2,_0x1c1e85,_0x5558df){var _0x107577={};var _0x52f52b={};var _0x5a3ea1;var _0x3c06d5;return db[_0x7aa4('0x43')][_0x7aa4('0x4e')]({'where':{'id':_0x2ecaf2[_0x7aa4('0x48')]['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x1c1e85,null))[_0x7aa4('0x29')](function(_0x3b4fdc){if(_0x3b4fdc){_0x5a3ea1=_0x3b4fdc;_0x52f52b[_0x7aa4('0x32')]=_[_0x7aa4('0x34')](db['FreshdeskField'][_0x7aa4('0x49')]);_0x52f52b['query']=_[_0x7aa4('0x34')](_0x2ecaf2['query']);_0x52f52b[_0x7aa4('0x3d')]=_[_0x7aa4('0x35')](_0x52f52b['model'],_0x52f52b[_0x7aa4('0x33')]);_0x107577['attributes']=_['intersection'](_0x52f52b['model'],qs['fields'](_0x2ecaf2[_0x7aa4('0x33')][_0x7aa4('0x37')]));_0x107577[_0x7aa4('0x36')]=_0x107577['attributes'][_0x7aa4('0x38')]?_0x107577[_0x7aa4('0x36')]:_0x52f52b[_0x7aa4('0x32')];_0x107577['order']=qs['sort'](_0x2ecaf2['query'][_0x7aa4('0x3b')]);_0x107577['where']=qs[_0x7aa4('0x3d')](_[_0x7aa4('0x3e')](_0x2ecaf2[_0x7aa4('0x33')],_0x52f52b['filters']));if(_0x2ecaf2[_0x7aa4('0x33')][_0x7aa4('0x3f')]){_0x107577[_0x7aa4('0x3c')]=_[_0x7aa4('0x40')](_0x107577[_0x7aa4('0x3c')],{'$or':_[_0x7aa4('0x2f')](_0x107577[_0x7aa4('0x36')],function(_0x343a86){var _0x36804f={};_0x36804f[_0x343a86]={'$like':'%'+_0x2ecaf2[_0x7aa4('0x33')]['filter']+'%'};return _0x36804f;})});}_0x107577=_[_0x7aa4('0x40')]({},_0x107577,_0x2ecaf2['options']);return _0x5a3ea1[_0x7aa4('0x52')](_0x107577);}})['then'](function(_0x5940f6){if(_0x5940f6){_0x3c06d5=_0x5940f6[_0x7aa4('0x38')];if(!_0x2ecaf2[_0x7aa4('0x33')]['hasOwnProperty'](_0x7aa4('0x3a'))){_0x107577[_0x7aa4('0x21')]=qs[_0x7aa4('0x21')](_0x2ecaf2[_0x7aa4('0x33')]['limit']);_0x107577[_0x7aa4('0x1f')]=qs['offset'](_0x2ecaf2[_0x7aa4('0x33')][_0x7aa4('0x1f')]);}return _0x5a3ea1[_0x7aa4('0x52')](_0x107577);}})[_0x7aa4('0x29')](function(_0x3f303c){if(_0x3f303c){return _0x3f303c?{'count':_0x3c06d5,'rows':_0x3f303c}:null;}})['then'](respondWithResult(_0x1c1e85,null))[_0x7aa4('0x47')](handleError(_0x1c1e85,null));};exports['getDescriptions']=function(_0x1b2e3c,_0x178a26,_0x542b28){var _0x35fef7={};var _0x6cb3d={};var _0xdb19a;var _0x1da6d3;return db[_0x7aa4('0x43')][_0x7aa4('0x4e')]({'where':{'id':_0x1b2e3c['params']['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x178a26,null))[_0x7aa4('0x29')](function(_0x532f73){if(_0x532f73){_0xdb19a=_0x532f73;_0x6cb3d[_0x7aa4('0x32')]=_[_0x7aa4('0x34')](db[_0x7aa4('0x4f')]['rawAttributes']);_0x6cb3d[_0x7aa4('0x33')]=_[_0x7aa4('0x34')](_0x1b2e3c[_0x7aa4('0x33')]);_0x6cb3d['filters']=_[_0x7aa4('0x35')](_0x6cb3d['model'],_0x6cb3d[_0x7aa4('0x33')]);_0x35fef7[_0x7aa4('0x36')]=_[_0x7aa4('0x35')](_0x6cb3d[_0x7aa4('0x32')],qs[_0x7aa4('0x37')](_0x1b2e3c['query'][_0x7aa4('0x37')]));_0x35fef7[_0x7aa4('0x36')]=_0x35fef7[_0x7aa4('0x36')]['length']?_0x35fef7[_0x7aa4('0x36')]:_0x6cb3d['model'];_0x35fef7[_0x7aa4('0x50')]=qs[_0x7aa4('0x3b')](_0x1b2e3c[_0x7aa4('0x33')][_0x7aa4('0x3b')]);_0x35fef7[_0x7aa4('0x3c')]=qs[_0x7aa4('0x3d')](_[_0x7aa4('0x3e')](_0x1b2e3c['query'],_0x6cb3d[_0x7aa4('0x3d')]));if(_0x1b2e3c[_0x7aa4('0x33')]['filter']){_0x35fef7[_0x7aa4('0x3c')]=_[_0x7aa4('0x40')](_0x35fef7[_0x7aa4('0x3c')],{'$or':_['map'](_0x35fef7[_0x7aa4('0x36')],function(_0x4b20b8){var _0x37f509={};_0x37f509[_0x4b20b8]={'$like':'%'+_0x1b2e3c['query'][_0x7aa4('0x3f')]+'%'};return _0x37f509;})});}_0x35fef7=_[_0x7aa4('0x40')]({},_0x35fef7,_0x1b2e3c[_0x7aa4('0x42')]);return _0xdb19a[_0x7aa4('0x53')](_0x35fef7);}})[_0x7aa4('0x29')](function(_0x51d7b6){if(_0x51d7b6){_0x1da6d3=_0x51d7b6[_0x7aa4('0x38')];if(!_0x1b2e3c[_0x7aa4('0x33')][_0x7aa4('0x39')]('nolimit')){_0x35fef7['limit']=qs[_0x7aa4('0x21')](_0x1b2e3c[_0x7aa4('0x33')][_0x7aa4('0x21')]);_0x35fef7[_0x7aa4('0x1f')]=qs[_0x7aa4('0x1f')](_0x1b2e3c[_0x7aa4('0x33')][_0x7aa4('0x1f')]);}return _0xdb19a[_0x7aa4('0x53')](_0x35fef7);}})[_0x7aa4('0x29')](function(_0x436d44){if(_0x436d44){return _0x436d44?{'count':_0x1da6d3,'rows':_0x436d44}:null;}})['then'](respondWithResult(_0x178a26,null))[_0x7aa4('0x47')](handleError(_0x178a26,null));};exports[_0x7aa4('0x54')]=function(_0x4e4490,_0x2279a1,_0x16b4b0){var _0x53b14c={};var _0x47400b={};var _0x37e45c;var _0x28dcfe;return db[_0x7aa4('0x43')][_0x7aa4('0x4e')]({'where':{'id':_0x4e4490[_0x7aa4('0x48')]['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x2279a1,null))['then'](function(_0x3060fc){if(_0x3060fc){_0x37e45c=_0x3060fc;_0x47400b[_0x7aa4('0x32')]=_[_0x7aa4('0x34')](db[_0x7aa4('0x55')]['rawAttributes']);_0x47400b[_0x7aa4('0x33')]=_[_0x7aa4('0x34')](_0x4e4490['query']);_0x47400b[_0x7aa4('0x3d')]=_['intersection'](_0x47400b['model'],_0x47400b[_0x7aa4('0x33')]);_0x53b14c[_0x7aa4('0x36')]=_[_0x7aa4('0x35')](_0x47400b[_0x7aa4('0x32')],qs[_0x7aa4('0x37')](_0x4e4490['query'][_0x7aa4('0x37')]));_0x53b14c['attributes']=_0x53b14c[_0x7aa4('0x36')][_0x7aa4('0x38')]?_0x53b14c[_0x7aa4('0x36')]:_0x47400b[_0x7aa4('0x32')];_0x53b14c[_0x7aa4('0x50')]=qs[_0x7aa4('0x3b')](_0x4e4490[_0x7aa4('0x33')][_0x7aa4('0x3b')]);_0x53b14c['where']=qs[_0x7aa4('0x3d')](_[_0x7aa4('0x3e')](_0x4e4490[_0x7aa4('0x33')],_0x47400b['filters']));if(_0x4e4490['query'][_0x7aa4('0x3f')]){_0x53b14c[_0x7aa4('0x3c')]=_[_0x7aa4('0x40')](_0x53b14c[_0x7aa4('0x3c')],{'$or':_['map'](_0x53b14c[_0x7aa4('0x36')],function(_0xfee40b){var _0x37c87b={};_0x37c87b[_0xfee40b]={'$like':'%'+_0x4e4490['query'][_0x7aa4('0x3f')]+'%'};return _0x37c87b;})});}_0x53b14c=_[_0x7aa4('0x40')]({},_0x53b14c,_0x4e4490[_0x7aa4('0x42')]);return _0x37e45c[_0x7aa4('0x54')](_0x53b14c);}})[_0x7aa4('0x29')](function(_0x170fc1){if(_0x170fc1){_0x28dcfe=_0x170fc1[_0x7aa4('0x38')];if(!_0x4e4490[_0x7aa4('0x33')]['hasOwnProperty'](_0x7aa4('0x3a'))){_0x53b14c[_0x7aa4('0x21')]=qs['limit'](_0x4e4490['query'][_0x7aa4('0x21')]);_0x53b14c['offset']=qs['offset'](_0x4e4490[_0x7aa4('0x33')][_0x7aa4('0x1f')]);}return _0x37e45c['getTags'](_0x53b14c);}})[_0x7aa4('0x29')](function(_0x194755){if(_0x194755){return _0x194755?{'count':_0x28dcfe,'rows':_0x194755}:null;}})['then'](respondWithResult(_0x2279a1,null))[_0x7aa4('0x47')](handleError(_0x2279a1,null));};exports[_0x7aa4('0x56')]=function(_0x5dfea9,_0x147ae2,_0x655c1b){if(_0x5dfea9[_0x7aa4('0x4b')]['id']){delete _0x5dfea9[_0x7aa4('0x4b')]['id'];}return db[_0x7aa4('0x43')][_0x7aa4('0x4e')]({'where':{'id':_0x5dfea9['params']['id']}})[_0x7aa4('0x29')](handleEntityNotFound(_0x147ae2,null))[_0x7aa4('0x29')](function(_0x9bbc3){if(_0x9bbc3){return _0x9bbc3['setTags'](_0x5dfea9[_0x7aa4('0x4b')]['ids']||[]);}return null;})[_0x7aa4('0x29')](respondWithResult(_0x147ae2,null))[_0x7aa4('0x47')](handleError(_0x147ae2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0f0161a..4253eb2 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 _0xa785=['./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x110641,_0x48cdcd){var _0x1d3a1a=function(_0x5c6877){while(--_0x5c6877){_0x110641['push'](_0x110641['shift']());}};_0x1d3a1a(++_0x48cdcd);}(_0xa785,0x8a));var _0x5a78=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xa785[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x5a78('0x0'));var logger=require(_0x5a78('0x1'))(_0x5a78('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5a78('0x3'));var fs=require('fs');var path=require(_0x5a78('0x4'));var rimraf=require(_0x5a78('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a78('0x6'));module['exports']=function(_0x13fd58,_0x3cd928){return _0x13fd58['define'](_0x5a78('0x7'),attributes,{'tableName':_0x5a78('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48b6=['api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x29c4c2,_0xdd07ff){var _0x1a14bd=function(_0x46ca1c){while(--_0x46ca1c){_0x29c4c2['push'](_0x29c4c2['shift']());}};_0x1a14bd(++_0xdd07ff);}(_0x48b6,0x64));var _0x648b=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x48b6[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x648b('0x0'));var moment=require(_0x648b('0x1'));var BPromise=require(_0x648b('0x2'));var rp=require(_0x648b('0x3'));var fs=require('fs');var path=require(_0x648b('0x4'));var rimraf=require(_0x648b('0x5'));var config=require('../../config/environment');var attributes=require(_0x648b('0x6'));module[_0x648b('0x7')]=function(_0x283c57,_0x4cf2d6){return _0x283c57[_0x648b('0x8')](_0x648b('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index c9197a1..ab6f5df 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 _0x2e0e=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x328d98,_0x4a34a3){var _0x188eb5=function(_0x3133dd){while(--_0x3133dd){_0x328d98['push'](_0x328d98['shift']());}};_0x188eb5(++_0x4a34a3);}(_0x2e0e,0x84));var _0xe2e0=function(_0x3e8a33,_0x5a504f){_0x3e8a33=_0x3e8a33-0x0;var _0x300d47=_0x2e0e[_0x3e8a33];return _0x300d47;};'use strict';var _=require(_0xe2e0('0x0'));var util=require('util');var moment=require(_0xe2e0('0x1'));var BPromise=require(_0xe2e0('0x2'));var rs=require(_0xe2e0('0x3'));var fs=require('fs');var Redis=require(_0xe2e0('0x4'));var db=require(_0xe2e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2e0('0x6'))('rpc');var config=require(_0xe2e0('0x7'));var jayson=require(_0xe2e0('0x8'));var client=jayson['client'][_0xe2e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f206c,_0x1d7e1d,_0x174149){return new BPromise(function(_0x1cbbc6,_0x5b32de){return client[_0xe2e0('0xa')](_0x4f206c,_0x174149)[_0xe2e0('0xb')](function(_0x38d65a){logger[_0xe2e0('0xc')](_0xe2e0('0xd'),_0x1d7e1d,_0xe2e0('0xe'));logger[_0xe2e0('0xf')](_0xe2e0('0x10'),_0x1d7e1d,_0xe2e0('0xe'),JSON[_0xe2e0('0x11')](_0x38d65a));if(_0x38d65a['error']){if(_0x38d65a[_0xe2e0('0x12')][_0xe2e0('0x13')]===0x1f4){logger[_0xe2e0('0x12')](_0xe2e0('0xd'),_0x1d7e1d,_0x38d65a[_0xe2e0('0x12')][_0xe2e0('0x14')]);return _0x5b32de(_0x38d65a['error'][_0xe2e0('0x14')]);}logger[_0xe2e0('0x12')](_0xe2e0('0xd'),_0x1d7e1d,_0x38d65a['error'][_0xe2e0('0x14')]);return _0x1cbbc6(_0x38d65a[_0xe2e0('0x12')][_0xe2e0('0x14')]);}else{logger[_0xe2e0('0xc')](_0xe2e0('0xd'),_0x1d7e1d,'request\x20sent');_0x1cbbc6(_0x38d65a[_0xe2e0('0x15')][_0xe2e0('0x14')]);}})[_0xe2e0('0x16')](function(_0x509696){logger[_0xe2e0('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1d7e1d,_0x509696);_0x5b32de(_0x509696);});});} \ No newline at end of file +var _0xf436=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x3206ab,_0x55af3b){var _0x17afc4=function(_0x4a3cfe){while(--_0x4a3cfe){_0x3206ab['push'](_0x3206ab['shift']());}};_0x17afc4(++_0x55af3b);}(_0xf436,0x83));var _0x6f43=function(_0xce77b2,_0x3e75a1){_0xce77b2=_0xce77b2-0x0;var _0x84ab88=_0xf436[_0xce77b2];return _0x84ab88;};'use strict';var _=require('lodash');var util=require(_0x6f43('0x0'));var moment=require(_0x6f43('0x1'));var BPromise=require(_0x6f43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f43('0x3'));var db=require(_0x6f43('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f43('0x5'))('rpc');var config=require(_0x6f43('0x6'));var jayson=require(_0x6f43('0x7'));var client=jayson[_0x6f43('0x8')][_0x6f43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54a1ef,_0x33513f,_0x271eca){return new BPromise(function(_0x3ede5c,_0x4557d6){return client[_0x6f43('0xa')](_0x54a1ef,_0x271eca)[_0x6f43('0xb')](function(_0x2b3c0b){logger[_0x6f43('0xc')](_0x6f43('0xd'),_0x33513f,_0x6f43('0xe'));logger[_0x6f43('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x33513f,_0x6f43('0xe'),JSON[_0x6f43('0x10')](_0x2b3c0b));if(_0x2b3c0b[_0x6f43('0x11')]){if(_0x2b3c0b[_0x6f43('0x11')][_0x6f43('0x12')]===0x1f4){logger[_0x6f43('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x33513f,_0x2b3c0b['error'][_0x6f43('0x13')]);return _0x4557d6(_0x2b3c0b[_0x6f43('0x11')][_0x6f43('0x13')]);}logger['error'](_0x6f43('0xd'),_0x33513f,_0x2b3c0b[_0x6f43('0x11')][_0x6f43('0x13')]);return _0x3ede5c(_0x2b3c0b[_0x6f43('0x11')][_0x6f43('0x13')]);}else{logger[_0x6f43('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x33513f,_0x6f43('0xe'));_0x3ede5c(_0x2b3c0b[_0x6f43('0x14')][_0x6f43('0x13')]);}})[_0x6f43('0x15')](function(_0xc66d51){logger['error'](_0x6f43('0xd'),_0x33513f,_0xc66d51);_0x4557d6(_0xc66d51);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 36dfd1b..5c2a334 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 _0x25bf=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','post','isAuthenticated','create','put','/:id','update'];(function(_0x1bd2a6,_0x45f0fc){var _0x525206=function(_0x3ae097){while(--_0x3ae097){_0x1bd2a6['push'](_0x1bd2a6['shift']());}};_0x525206(++_0x45f0fc);}(_0x25bf,0xe5));var _0xf25b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x25bf[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xf25b('0x0'));var util=require(_0xf25b('0x1'));var path=require(_0xf25b('0x2'));var timeout=require(_0xf25b('0x3'));var express=require(_0xf25b('0x4'));var router=express[_0xf25b('0x5')]();var fs_extra=require(_0xf25b('0x6'));var auth=require(_0xf25b('0x7'));var interaction=require(_0xf25b('0x8'));var config=require(_0xf25b('0x9'));var controller=require('./intFreshdeskField.controller');router[_0xf25b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf25b('0xb')]);router[_0xf25b('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf25b('0xc')]('/',auth[_0xf25b('0xd')](),controller[_0xf25b('0xe')]);router[_0xf25b('0xf')](_0xf25b('0x10'),auth[_0xf25b('0xd')](),controller[_0xf25b('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf25b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3b86=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get'];(function(_0x24fbc2,_0x307ebe){var _0x448c79=function(_0x132242){while(--_0x132242){_0x24fbc2['push'](_0x24fbc2['shift']());}};_0x448c79(++_0x307ebe);}(_0x3b86,0x1e4));var _0x63b8=function(_0x40eed7,_0x24e80a){_0x40eed7=_0x40eed7-0x0;var _0x11f03a=_0x3b86[_0x40eed7];return _0x11f03a;};'use strict';var multer=require(_0x63b8('0x0'));var util=require('util');var path=require(_0x63b8('0x1'));var timeout=require(_0x63b8('0x2'));var express=require(_0x63b8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x63b8('0x4'));var config=require(_0x63b8('0x5'));var controller=require(_0x63b8('0x6'));router['get']('/',auth[_0x63b8('0x7')](),controller[_0x63b8('0x8')]);router[_0x63b8('0x9')](_0x63b8('0xa'),auth[_0x63b8('0x7')](),controller[_0x63b8('0xb')]);router[_0x63b8('0xc')]('/',auth[_0x63b8('0x7')](),controller[_0x63b8('0xd')]);router[_0x63b8('0xe')](_0x63b8('0xa'),auth[_0x63b8('0x7')](),controller[_0x63b8('0xf')]);router[_0x63b8('0x10')](_0x63b8('0xa'),auth[_0x63b8('0x7')](),controller[_0x63b8('0x11')]);module[_0x63b8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index feac3d8..5befce3 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 _0x955d=['sequelize','exports','string','keyValue','STRING','ENUM','variable'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0x955d,0x173));var _0xd955=function(_0x2b4753,_0x3abaeb){_0x2b4753=_0x2b4753-0x0;var _0x54048d=_0x955d[_0x2b4753];return _0x54048d;};'use strict';var Sequelize=require(_0xd955('0x0'));module[_0xd955('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd955('0x2'),'variable','customVariable',_0xd955('0x3'),'picklist'),'defaultValue':_0xd955('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd955('0x4')]},'keyType':{'type':Sequelize[_0xd955('0x5')]('string',_0xd955('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd955('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd955('0x4')]}}; \ No newline at end of file +var _0x5fc6=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x1f8fe3,_0x3ecd11){var _0x4d7e3a=function(_0x4e90c0){while(--_0x4e90c0){_0x1f8fe3['push'](_0x1f8fe3['shift']());}};_0x4d7e3a(++_0x3ecd11);}(_0x5fc6,0x84));var _0x65fc=function(_0x52c62f,_0x3d34d9){_0x52c62f=_0x52c62f-0x0;var _0x1f11a5=_0x5fc6[_0x52c62f];return _0x1f11a5;};'use strict';var Sequelize=require(_0x65fc('0x0'));module[_0x65fc('0x1')]={'type':{'type':Sequelize[_0x65fc('0x2')](_0x65fc('0x3'),'variable',_0x65fc('0x4'),_0x65fc('0x5'),_0x65fc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x65fc('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x65fc('0x3'),_0x65fc('0x8'),_0x65fc('0x4'))},'keyContent':{'type':Sequelize[_0x65fc('0x7')]},'idField':{'type':Sequelize[_0x65fc('0x7')]},'nameField':{'type':Sequelize[_0x65fc('0x7')]},'customField':{'type':Sequelize[_0x65fc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x65fc('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 54b4903..1045b0e 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 _0x9f4d=['fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','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','set','reject','update','then','destroy','sendStatus','stack','name','FreshdeskField','rawAttributes'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x1e77ed,_0x5720c1){_0x1e77ed=_0x1e77ed-0x0;var _0x32ed55=_0x9f4d[_0x1e77ed];return _0x32ed55;};'use strict';var emlformat=require(_0xd9f4('0x0'));var rimraf=require(_0xd9f4('0x1'));var zipdir=require(_0xd9f4('0x2'));var jsonpatch=require(_0xd9f4('0x3'));var rp=require(_0xd9f4('0x4'));var moment=require(_0xd9f4('0x5'));var BPromise=require(_0xd9f4('0x6'));var Mustache=require(_0xd9f4('0x7'));var util=require(_0xd9f4('0x8'));var path=require('path');var sox=require(_0xd9f4('0x9'));var csv=require('to-csv');var ejs=require(_0xd9f4('0xa'));var fs=require('fs');var fs_extra=require(_0xd9f4('0xb'));var _=require(_0xd9f4('0xc'));var squel=require(_0xd9f4('0xd'));var crypto=require('crypto');var jsforce=require(_0xd9f4('0xe'));var deskjs=require(_0xd9f4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9f4('0x10'));var Papa=require('papaparse');var Redis=require(_0xd9f4('0x11'));var authService=require(_0xd9f4('0x12'));var qs=require(_0xd9f4('0x13'));var as=require(_0xd9f4('0x14'));var hardwareService=require(_0xd9f4('0x15'));var logger=require('../../config/logger')(_0xd9f4('0x16'));var utils=require(_0xd9f4('0x17'));var config=require(_0xd9f4('0x18'));var licenseUtil=require(_0xd9f4('0x19'));var db=require(_0xd9f4('0x1a'))['db'];function respondWithStatusCode(_0x104834,_0x26383d){_0x26383d=_0x26383d||0xcc;return function(_0x131804){if(_0x131804){return _0x104834['sendStatus'](_0x26383d);}return _0x104834[_0xd9f4('0x1b')](_0x26383d)[_0xd9f4('0x1c')]();};}function respondWithResult(_0x158cdd,_0xef7729){_0xef7729=_0xef7729||0xc8;return function(_0x8a035d){if(_0x8a035d){return _0x158cdd[_0xd9f4('0x1b')](_0xef7729)[_0xd9f4('0x1d')](_0x8a035d);}};}function respondWithFilteredResult(_0x12dcfb,_0x35f71c){return function(_0x2ca827){if(_0x2ca827){var _0xfd15a4=typeof _0x35f71c[_0xd9f4('0x1e')]===_0xd9f4('0x1f')&&typeof _0x35f71c['limit']==='undefined';var _0x48ecd3=_0x2ca827['count'];var _0x25a7fe=_0xfd15a4?0x0:_0x35f71c[_0xd9f4('0x1e')];var _0xc01934=_0xfd15a4?_0x2ca827['count']:_0x35f71c[_0xd9f4('0x1e')]+_0x35f71c[_0xd9f4('0x20')];var _0x17d097;if(_0xc01934>=_0x48ecd3){_0xc01934=_0x48ecd3;_0x17d097=0xc8;}else{_0x17d097=0xce;}_0x12dcfb['status'](_0x17d097);return _0x12dcfb[_0xd9f4('0x21')]('Content-Range',_0x25a7fe+'-'+_0xc01934+'/'+_0x48ecd3)[_0xd9f4('0x1d')](_0x2ca827);}return null;};}function patchUpdates(_0x93e8df){return function(_0x7ec2ce){try{jsonpatch['apply'](_0x7ec2ce,_0x93e8df,!![]);}catch(_0x138ca7){return BPromise[_0xd9f4('0x22')](_0x138ca7);}return _0x7ec2ce['save']();};}function saveUpdates(_0x4ec0b3,_0x7196ab){return function(_0x59c8f6){if(_0x59c8f6){return _0x59c8f6[_0xd9f4('0x23')](_0x4ec0b3)[_0xd9f4('0x24')](function(_0x818cd5){return _0x818cd5;});}return null;};}function removeEntity(_0x2a89b6,_0x101e86){return function(_0x33ddd6){if(_0x33ddd6){return _0x33ddd6[_0xd9f4('0x25')]()[_0xd9f4('0x24')](function(){_0x2a89b6[_0xd9f4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x770a2c,_0x1814eb){return function(_0x1fe43b){if(!_0x1fe43b){_0x770a2c[_0xd9f4('0x26')](0x194);}return _0x1fe43b;};}function handleError(_0x3a82dd,_0x2ed32c){_0x2ed32c=_0x2ed32c||0x1f4;return function(_0x12958b){logger['error'](_0x12958b[_0xd9f4('0x27')]);if(_0x12958b[_0xd9f4('0x28')]){delete _0x12958b[_0xd9f4('0x28')];}_0x3a82dd[_0xd9f4('0x1b')](_0x2ed32c)['send'](_0x12958b);};}exports['index']=function(_0x478bc6,_0x261903){var _0x4b453b={},_0x2ca69a={},_0x453a08={'count':0x0,'rows':[]};var _0x5c9ec7=_['map'](db[_0xd9f4('0x29')][_0xd9f4('0x2a')],function(_0x5f6cb9){return{'name':_0x5f6cb9[_0xd9f4('0x2b')],'type':_0x5f6cb9[_0xd9f4('0x2c')][_0xd9f4('0x2d')]};});_0x2ca69a[_0xd9f4('0x2e')]=_[_0xd9f4('0x2f')](_0x5c9ec7,_0xd9f4('0x28'));_0x2ca69a[_0xd9f4('0x30')]=_[_0xd9f4('0x31')](_0x478bc6[_0xd9f4('0x30')]);_0x2ca69a['filters']=_[_0xd9f4('0x32')](_0x2ca69a['model'],_0x2ca69a[_0xd9f4('0x30')]);_0x4b453b[_0xd9f4('0x33')]=_[_0xd9f4('0x32')](_0x2ca69a[_0xd9f4('0x2e')],qs[_0xd9f4('0x34')](_0x478bc6[_0xd9f4('0x30')][_0xd9f4('0x34')]));_0x4b453b[_0xd9f4('0x33')]=_0x4b453b[_0xd9f4('0x33')][_0xd9f4('0x35')]?_0x4b453b[_0xd9f4('0x33')]:_0x2ca69a[_0xd9f4('0x2e')];if(!_0x478bc6[_0xd9f4('0x30')]['hasOwnProperty']('nolimit')){_0x4b453b['limit']=qs[_0xd9f4('0x20')](_0x478bc6[_0xd9f4('0x30')][_0xd9f4('0x20')]);_0x4b453b[_0xd9f4('0x1e')]=qs[_0xd9f4('0x1e')](_0x478bc6[_0xd9f4('0x30')][_0xd9f4('0x1e')]);}_0x4b453b[_0xd9f4('0x36')]=qs[_0xd9f4('0x37')](_0x478bc6[_0xd9f4('0x30')][_0xd9f4('0x37')]);_0x4b453b['where']=qs['filters'](_[_0xd9f4('0x38')](_0x478bc6[_0xd9f4('0x30')],_0x2ca69a[_0xd9f4('0x39')]),_0x5c9ec7);if(_0x478bc6[_0xd9f4('0x30')][_0xd9f4('0x3a')]){_0x4b453b[_0xd9f4('0x3b')]=_[_0xd9f4('0x3c')](_0x4b453b[_0xd9f4('0x3b')],{'$or':_[_0xd9f4('0x2f')](_0x5c9ec7,function(_0x1ce168){if(_0x1ce168[_0xd9f4('0x2c')]!==_0xd9f4('0x3d')){var _0x60feec={};_0x60feec[_0x1ce168['name']]={'$like':'%'+_0x478bc6['query'][_0xd9f4('0x3a')]+'%'};return _0x60feec;}})});}_0x4b453b=_[_0xd9f4('0x3c')]({},_0x4b453b,_0x478bc6[_0xd9f4('0x3e')]);var _0xc8c7a3={'where':_0x4b453b[_0xd9f4('0x3b')]};return db['FreshdeskField'][_0xd9f4('0x3f')](_0xc8c7a3)[_0xd9f4('0x24')](function(_0x522393){_0x453a08[_0xd9f4('0x3f')]=_0x522393;if(_0x478bc6[_0xd9f4('0x30')]['includeAll']){_0x4b453b[_0xd9f4('0x40')]=[{'all':!![]}];}return db[_0xd9f4('0x29')][_0xd9f4('0x41')](_0x4b453b);})[_0xd9f4('0x24')](function(_0xfc7b6c){_0x453a08[_0xd9f4('0x42')]=_0xfc7b6c;return _0x453a08;})[_0xd9f4('0x24')](respondWithFilteredResult(_0x261903,_0x4b453b))[_0xd9f4('0x43')](handleError(_0x261903,null));};exports['show']=function(_0x14aa9e,_0x4ab27a){var _0x48e236={'raw':!![],'where':{'id':_0x14aa9e['params']['id']}},_0x353a01={};_0x353a01[_0xd9f4('0x2e')]=_[_0xd9f4('0x31')](db[_0xd9f4('0x29')][_0xd9f4('0x2a')]);_0x353a01[_0xd9f4('0x30')]=_[_0xd9f4('0x31')](_0x14aa9e[_0xd9f4('0x30')]);_0x353a01['filters']=_[_0xd9f4('0x32')](_0x353a01[_0xd9f4('0x2e')],_0x353a01['query']);_0x48e236[_0xd9f4('0x33')]=_[_0xd9f4('0x32')](_0x353a01[_0xd9f4('0x2e')],qs[_0xd9f4('0x34')](_0x14aa9e['query'][_0xd9f4('0x34')]));_0x48e236[_0xd9f4('0x33')]=_0x48e236[_0xd9f4('0x33')][_0xd9f4('0x35')]?_0x48e236[_0xd9f4('0x33')]:_0x353a01['model'];if(_0x14aa9e[_0xd9f4('0x30')][_0xd9f4('0x44')]){_0x48e236[_0xd9f4('0x40')]=[{'all':!![]}];}_0x48e236=_[_0xd9f4('0x3c')]({},_0x48e236,_0x14aa9e['options']);return db[_0xd9f4('0x29')][_0xd9f4('0x45')](_0x48e236)['then'](handleEntityNotFound(_0x4ab27a,null))[_0xd9f4('0x24')](respondWithResult(_0x4ab27a,null))[_0xd9f4('0x43')](handleError(_0x4ab27a,null));};exports[_0xd9f4('0x46')]=function(_0x4c7d99,_0xbedc3){return db[_0xd9f4('0x29')][_0xd9f4('0x46')](_0x4c7d99[_0xd9f4('0x47')],{})[_0xd9f4('0x24')](respondWithResult(_0xbedc3,0xc9))[_0xd9f4('0x43')](handleError(_0xbedc3,null));};exports[_0xd9f4('0x23')]=function(_0x254af2,_0x360248){if(_0x254af2[_0xd9f4('0x47')]['id']){delete _0x254af2[_0xd9f4('0x47')]['id'];}return db['FreshdeskField'][_0xd9f4('0x45')]({'where':{'id':_0x254af2[_0xd9f4('0x48')]['id']}})['then'](handleEntityNotFound(_0x360248,null))[_0xd9f4('0x24')](saveUpdates(_0x254af2[_0xd9f4('0x47')],null))[_0xd9f4('0x24')](respondWithResult(_0x360248,null))[_0xd9f4('0x43')](handleError(_0x360248,null));};exports[_0xd9f4('0x25')]=function(_0x37c1d9,_0x215df5){return db[_0xd9f4('0x29')][_0xd9f4('0x45')]({'where':{'id':_0x37c1d9['params']['id']}})['then'](handleEntityNotFound(_0x215df5,null))[_0xd9f4('0x24')](removeEntity(_0x215df5,null))[_0xd9f4('0x43')](handleError(_0x215df5,null));}; \ No newline at end of file +var _0xa9e0=['nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','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','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0xc036c7,_0x3a5607){var _0x6e358d=function(_0x124889){while(--_0x124889){_0xc036c7['push'](_0xc036c7['shift']());}};_0x6e358d(++_0x3a5607);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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['FreshdeskField'][_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));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 9c230dc..17d81a3 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 _0x18e6=['bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','FieldId','lodash','../../config/logger','api','moment'];(function(_0x3c989b,_0x53999a){var _0x1c68d2=function(_0x97255e){while(--_0x97255e){_0x3c989b['push'](_0x3c989b['shift']());}};_0x1c68d2(++_0x53999a);}(_0x18e6,0x14c));var _0x618e=function(_0x52b23d,_0x4e31f2){_0x52b23d=_0x52b23d-0x0;var _0x419bfd=_0x18e6[_0x52b23d];return _0x419bfd;};'use strict';var _=require(_0x618e('0x0'));var util=require('util');var logger=require(_0x618e('0x1'))(_0x618e('0x2'));var moment=require(_0x618e('0x3'));var BPromise=require(_0x618e('0x4'));var rp=require(_0x618e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x618e('0x6'));var attributes=require(_0x618e('0x7'));module[_0x618e('0x8')]=function(_0x5e2141,_0x4b2152){return _0x5e2141['define'](_0x618e('0x9'),attributes,{'tableName':_0x618e('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x618e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe23d=['exports','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xe23d,0x93));var _0xde23=function(_0x569b85,_0x221008){_0x569b85=_0x569b85-0x0;var _0x4b62e9=_0xe23d[_0x569b85];return _0x4b62e9;};'use strict';var _=require(_0xde23('0x0'));var util=require('util');var logger=require(_0xde23('0x1'))('api');var moment=require(_0xde23('0x2'));var BPromise=require(_0xde23('0x3'));var rp=require(_0xde23('0x4'));var fs=require('fs');var path=require(_0xde23('0x5'));var rimraf=require(_0xde23('0x6'));var config=require(_0xde23('0x7'));var attributes=require(_0xde23('0x8'));module[_0xde23('0x9')]=function(_0x1524c1,_0x503198){return _0x1524c1['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xde23('0xa'),'fields':[_0xde23('0xb'),_0xde23('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 581381d..2c8cbb0 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 _0x2fde=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1d7535,_0x1087e8){var _0x2b9329=function(_0x3a31a2){while(--_0x3a31a2){_0x1d7535['push'](_0x1d7535['shift']());}};_0x2b9329(++_0x1087e8);}(_0x2fde,0x8a));var _0xe2fd=function(_0x1fe295,_0x167f46){_0x1fe295=_0x1fe295-0x0;var _0x1fede9=_0x2fde[_0x1fe295];return _0x1fede9;};'use strict';var _=require(_0xe2fd('0x0'));var util=require(_0xe2fd('0x1'));var moment=require('moment');var BPromise=require(_0xe2fd('0x2'));var rs=require(_0xe2fd('0x3'));var fs=require('fs');var Redis=require(_0xe2fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe2fd('0x5'))('rpc');var config=require(_0xe2fd('0x6'));var jayson=require(_0xe2fd('0x7'));var client=jayson[_0xe2fd('0x8')][_0xe2fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32b5b4,_0x42fc14,_0x503588){return new BPromise(function(_0x4a35bb,_0x55a06d){return client[_0xe2fd('0xa')](_0x32b5b4,_0x503588)[_0xe2fd('0xb')](function(_0x3a7f60){logger['info'](_0xe2fd('0xc'),_0x42fc14,_0xe2fd('0xd'));logger['debug'](_0xe2fd('0xe'),_0x42fc14,_0xe2fd('0xd'),JSON['stringify'](_0x3a7f60));if(_0x3a7f60[_0xe2fd('0xf')]){if(_0x3a7f60[_0xe2fd('0xf')][_0xe2fd('0x10')]===0x1f4){logger['error'](_0xe2fd('0xc'),_0x42fc14,_0x3a7f60[_0xe2fd('0xf')][_0xe2fd('0x11')]);return _0x55a06d(_0x3a7f60['error'][_0xe2fd('0x11')]);}logger['error'](_0xe2fd('0xc'),_0x42fc14,_0x3a7f60[_0xe2fd('0xf')][_0xe2fd('0x11')]);return _0x4a35bb(_0x3a7f60['error'][_0xe2fd('0x11')]);}else{logger[_0xe2fd('0x12')](_0xe2fd('0xc'),_0x42fc14,'request\x20sent');_0x4a35bb(_0x3a7f60[_0xe2fd('0x13')][_0xe2fd('0x11')]);}})[_0xe2fd('0x14')](function(_0x2a5141){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x42fc14,_0x2a5141);_0x55a06d(_0x2a5141);});});} \ No newline at end of file +var _0xb1a3=['../../config/environment','jayson/promise','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb1a3,0x124));var _0x3b1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1a3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var moment=require('moment');var BPromise=require(_0x3b1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b1a('0x3'));var db=require(_0x3b1a('0x4'))['db'];var utils=require(_0x3b1a('0x5'));var logger=require(_0x3b1a('0x6'))(_0x3b1a('0x7'));var config=require(_0x3b1a('0x8'));var jayson=require(_0x3b1a('0x9'));var client=jayson['client'][_0x3b1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a661,_0x57376c,_0x4b500b){return new BPromise(function(_0x29a6b6,_0x1011a6){return client['request'](_0x13a661,_0x4b500b)[_0x3b1a('0xb')](function(_0x378a92){logger[_0x3b1a('0xc')](_0x3b1a('0xd'),_0x57376c,_0x3b1a('0xe'));logger[_0x3b1a('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x57376c,'request\x20sent',JSON['stringify'](_0x378a92));if(_0x378a92['error']){if(_0x378a92[_0x3b1a('0x10')]['code']===0x1f4){logger[_0x3b1a('0x10')](_0x3b1a('0xd'),_0x57376c,_0x378a92[_0x3b1a('0x10')]['message']);return _0x1011a6(_0x378a92[_0x3b1a('0x10')][_0x3b1a('0x11')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x57376c,_0x378a92[_0x3b1a('0x10')][_0x3b1a('0x11')]);return _0x29a6b6(_0x378a92['error']['message']);}else{logger[_0x3b1a('0xc')](_0x3b1a('0xd'),_0x57376c,_0x3b1a('0xe'));_0x29a6b6(_0x378a92[_0x3b1a('0x12')][_0x3b1a('0x11')]);}})[_0x3b1a('0x13')](function(_0x5da544){logger[_0x3b1a('0x10')](_0x3b1a('0xd'),_0x57376c,_0x5da544);_0x1011a6(_0x5da544);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 51a9d79..0fedbe6 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 _0xda3f=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x481f1d,_0x3c80c1){var _0x5e283=function(_0x2db1df){while(--_0x2db1df){_0x481f1d['push'](_0x481f1d['shift']());}};_0x5e283(++_0x3c80c1);}(_0xda3f,0xec));var _0xfda3=function(_0x274558,_0x4c9a47){_0x274558=_0x274558-0x0;var _0x540e38=_0xda3f[_0x274558];return _0x540e38;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intFreshsalesAccount.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')]('/',auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0xd')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['put'](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfda3('0x12')]=router; \ No newline at end of file +var _0x0abf=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x333436,_0x2bff2d){var _0x338bd1=function(_0x2f6b18){while(--_0x2f6b18){_0x333436['push'](_0x333436['shift']());}};_0x338bd1(++_0x2bff2d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0abf[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf0ab('0xe')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0xf')]);router[_0xf0ab('0xe')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x12'),auth['isAuthenticated'](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x15')]);module[_0xf0ab('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index acc0b7a..67d40de 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 _0x7096=['exports','STRING','username','remoteUri'];(function(_0x5cc532,_0x24c122){var _0x2efdd4=function(_0x32a9d1){while(--_0x32a9d1){_0x5cc532['push'](_0x5cc532['shift']());}};_0x2efdd4(++_0x24c122);}(_0x7096,0x10c));var _0x6709=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7096[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6709('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6709('0x2')},'apiKey':{'type':Sequelize[_0x6709('0x1')]},'remoteUri':{'type':Sequelize[_0x6709('0x1')],'unique':_0x6709('0x3')},'serverUrl':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x35fb83,_0x4be931){var _0x43ada0=function(_0x4bef4b){while(--_0x4bef4b){_0x35fb83['push'](_0x35fb83['shift']());}};_0x43ada0(++_0x4be931);}(_0x3a6d,0x143));var _0xd3a6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3a6d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3a6('0x2')]},'username':{'type':Sequelize[_0xd3a6('0x2')],'unique':_0xd3a6('0x3')},'apiKey':{'type':Sequelize[_0xd3a6('0x2')]},'remoteUri':{'type':Sequelize[_0xd3a6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd3a6('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 c124087..b4c1e5d 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 _0x620c=['nolimit','sort','pick','filter','merge','VIRTUAL','options','where','FreshsalesAccount','count','includeAll','include','findAll','rows','show','intersection','find','catch','body','params','getConfigurations','findOne','FreshsalesConfiguration','order','AccountId','Subjects','channel','Descriptions','create','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','length','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','fields','hasOwnProperty'];(function(_0x2e409e,_0x2d227e){var _0xe6e039=function(_0x47195d){while(--_0x47195d){_0x2e409e['push'](_0x2e409e['shift']());}};_0xe6e039(++_0x2d227e);}(_0x620c,0x1bd));var _0xc620=function(_0x5dfbda,_0x249b85){_0x5dfbda=_0x5dfbda-0x0;var _0xf6a18d=_0x620c[_0x5dfbda];return _0xf6a18d;};'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(_0xc620('0x0'));var moment=require(_0xc620('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xc620('0x2'));var util=require('util');var path=require(_0xc620('0x3'));var sox=require(_0xc620('0x4'));var csv=require(_0xc620('0x5'));var ejs=require(_0xc620('0x6'));var fs=require('fs');var fs_extra=require(_0xc620('0x7'));var _=require(_0xc620('0x8'));var squel=require(_0xc620('0x9'));var crypto=require(_0xc620('0xa'));var jsforce=require(_0xc620('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc620('0x5'));var querystring=require(_0xc620('0xc'));var Papa=require(_0xc620('0xd'));var Redis=require(_0xc620('0xe'));var authService=require(_0xc620('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc620('0x10'));var logger=require('../../config/logger')(_0xc620('0x11'));var utils=require('../../config/utils');var config=require(_0xc620('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc620('0x13'))['db'];var integrations=require(_0xc620('0x14'));function respondWithStatusCode(_0x498ea0,_0x55474c){_0x55474c=_0x55474c||0xcc;return function(_0x119dd8){if(_0x119dd8){return _0x498ea0[_0xc620('0x15')](_0x55474c);}return _0x498ea0[_0xc620('0x16')](_0x55474c)[_0xc620('0x17')]();};}function respondWithResult(_0x278503,_0x34ed65){_0x34ed65=_0x34ed65||0xc8;return function(_0x5524f8){if(_0x5524f8){return _0x278503['status'](_0x34ed65)['json'](_0x5524f8);}};}function respondWithFilteredResult(_0x4861e9,_0x4fb990){return function(_0x504a1c){if(_0x504a1c){var _0x263904=typeof _0x4fb990[_0xc620('0x18')]===_0xc620('0x19')&&typeof _0x4fb990[_0xc620('0x1a')]==='undefined';var _0x1a9af1=_0x504a1c['count'];var _0x4df0cf=_0x263904?0x0:_0x4fb990[_0xc620('0x18')];var _0x1a81cf=_0x263904?_0x504a1c['count']:_0x4fb990[_0xc620('0x18')]+_0x4fb990['limit'];var _0x52e79e;if(_0x1a81cf>=_0x1a9af1){_0x1a81cf=_0x1a9af1;_0x52e79e=0xc8;}else{_0x52e79e=0xce;}_0x4861e9['status'](_0x52e79e);return _0x4861e9[_0xc620('0x1b')](_0xc620('0x1c'),_0x4df0cf+'-'+_0x1a81cf+'/'+_0x1a9af1)[_0xc620('0x1d')](_0x504a1c);}return null;};}function patchUpdates(_0x8462b4){return function(_0x30160b){try{jsonpatch[_0xc620('0x1e')](_0x30160b,_0x8462b4,!![]);}catch(_0x46ab31){return BPromise['reject'](_0x46ab31);}return _0x30160b[_0xc620('0x1f')]();};}function saveUpdates(_0x46d5c2,_0x1207bc){return function(_0x3ea2ae){if(_0x3ea2ae){return _0x3ea2ae[_0xc620('0x20')](_0x46d5c2)[_0xc620('0x21')](function(_0x306882){return _0x306882;});}return null;};}function removeEntity(_0x15f391,_0x41e19a){return function(_0x3c961d){if(_0x3c961d){return _0x3c961d[_0xc620('0x22')]()[_0xc620('0x21')](function(){_0x15f391['status'](0xcc)[_0xc620('0x17')]();});}};}function handleEntityNotFound(_0x637b73,_0x33684c){return function(_0x363bed){if(!_0x363bed){_0x637b73[_0xc620('0x15')](0x194);}return _0x363bed;};}function handleError(_0x9b74b0,_0x4f7fa7){_0x4f7fa7=_0x4f7fa7||0x1f4;return function(_0x36dfd0){logger[_0xc620('0x23')](_0x36dfd0[_0xc620('0x24')]);if(_0x36dfd0['name']){delete _0x36dfd0[_0xc620('0x25')];}_0x9b74b0['status'](_0x4f7fa7)[_0xc620('0x26')](_0x36dfd0);};}exports['index']=function(_0x47db5c,_0x3f0f70){var _0xcdb784={},_0x2ef267={},_0x596748={'count':0x0,'rows':[]};var _0x2effdf=_['map'](db['FreshsalesAccount'][_0xc620('0x27')],function(_0x58e2dd){return{'name':_0x58e2dd[_0xc620('0x28')],'type':_0x58e2dd[_0xc620('0x29')]['key']};});_0x2ef267[_0xc620('0x2a')]=_[_0xc620('0x2b')](_0x2effdf,'name');_0x2ef267['query']=_[_0xc620('0x2c')](_0x47db5c[_0xc620('0x2d')]);_0x2ef267[_0xc620('0x2e')]=_['intersection'](_0x2ef267[_0xc620('0x2a')],_0x2ef267[_0xc620('0x2d')]);_0xcdb784[_0xc620('0x2f')]=_['intersection'](_0x2ef267[_0xc620('0x2a')],qs[_0xc620('0x30')](_0x47db5c[_0xc620('0x2d')][_0xc620('0x30')]));_0xcdb784[_0xc620('0x2f')]=_0xcdb784[_0xc620('0x2f')]['length']?_0xcdb784[_0xc620('0x2f')]:_0x2ef267[_0xc620('0x2a')];if(!_0x47db5c[_0xc620('0x2d')][_0xc620('0x31')](_0xc620('0x32'))){_0xcdb784[_0xc620('0x1a')]=qs['limit'](_0x47db5c[_0xc620('0x2d')]['limit']);_0xcdb784[_0xc620('0x18')]=qs[_0xc620('0x18')](_0x47db5c[_0xc620('0x2d')][_0xc620('0x18')]);}_0xcdb784['order']=qs[_0xc620('0x33')](_0x47db5c[_0xc620('0x2d')][_0xc620('0x33')]);_0xcdb784['where']=qs[_0xc620('0x2e')](_[_0xc620('0x34')](_0x47db5c[_0xc620('0x2d')],_0x2ef267[_0xc620('0x2e')]),_0x2effdf);if(_0x47db5c[_0xc620('0x2d')][_0xc620('0x35')]){_0xcdb784['where']=_[_0xc620('0x36')](_0xcdb784['where'],{'$or':_['map'](_0x2effdf,function(_0x597eb3){if(_0x597eb3[_0xc620('0x29')]!==_0xc620('0x37')){var _0x37f504={};_0x37f504[_0x597eb3['name']]={'$like':'%'+_0x47db5c[_0xc620('0x2d')][_0xc620('0x35')]+'%'};return _0x37f504;}})});}_0xcdb784=_[_0xc620('0x36')]({},_0xcdb784,_0x47db5c[_0xc620('0x38')]);var _0x996de5={'where':_0xcdb784[_0xc620('0x39')]};return db[_0xc620('0x3a')][_0xc620('0x3b')](_0x996de5)[_0xc620('0x21')](function(_0x3bcafc){_0x596748[_0xc620('0x3b')]=_0x3bcafc;if(_0x47db5c[_0xc620('0x2d')][_0xc620('0x3c')]){_0xcdb784[_0xc620('0x3d')]=[{'all':!![]}];}return db[_0xc620('0x3a')][_0xc620('0x3e')](_0xcdb784);})[_0xc620('0x21')](function(_0x2fbb5c){_0x596748[_0xc620('0x3f')]=_0x2fbb5c;return _0x596748;})[_0xc620('0x21')](respondWithFilteredResult(_0x3f0f70,_0xcdb784))['catch'](handleError(_0x3f0f70,null));};exports[_0xc620('0x40')]=function(_0x5d7073,_0x517468){var _0x488feb={'raw':![],'where':{'id':_0x5d7073['params']['id']}},_0x5cabe1={};_0x5cabe1['model']=_[_0xc620('0x2c')](db['FreshsalesAccount']['rawAttributes']);_0x5cabe1[_0xc620('0x2d')]=_[_0xc620('0x2c')](_0x5d7073[_0xc620('0x2d')]);_0x5cabe1[_0xc620('0x2e')]=_[_0xc620('0x41')](_0x5cabe1[_0xc620('0x2a')],_0x5cabe1[_0xc620('0x2d')]);_0x488feb[_0xc620('0x2f')]=_[_0xc620('0x41')](_0x5cabe1[_0xc620('0x2a')],qs[_0xc620('0x30')](_0x5d7073[_0xc620('0x2d')]['fields']));_0x488feb['attributes']=_0x488feb[_0xc620('0x2f')]['length']?_0x488feb[_0xc620('0x2f')]:_0x5cabe1[_0xc620('0x2a')];if(_0x5d7073[_0xc620('0x2d')][_0xc620('0x3c')]){_0x488feb[_0xc620('0x3d')]=[{'all':!![]}];}_0x488feb=_[_0xc620('0x36')]({},_0x488feb,_0x5d7073[_0xc620('0x38')]);return db[_0xc620('0x3a')][_0xc620('0x42')](_0x488feb)[_0xc620('0x21')](handleEntityNotFound(_0x517468,null))[_0xc620('0x21')](respondWithResult(_0x517468,null))[_0xc620('0x43')](handleError(_0x517468,null));};exports['create']=function(_0x551953,_0x522e4e){return db[_0xc620('0x3a')]['create'](_0x551953['body'],{})[_0xc620('0x21')](respondWithResult(_0x522e4e,0xc9))[_0xc620('0x43')](handleError(_0x522e4e,null));};exports[_0xc620('0x20')]=function(_0x242c26,_0x40a206){if(_0x242c26[_0xc620('0x44')]['id']){delete _0x242c26[_0xc620('0x44')]['id'];}return db[_0xc620('0x3a')][_0xc620('0x42')]({'where':{'id':_0x242c26[_0xc620('0x45')]['id']}})['then'](handleEntityNotFound(_0x40a206,null))[_0xc620('0x21')](saveUpdates(_0x242c26[_0xc620('0x44')],null))[_0xc620('0x21')](respondWithResult(_0x40a206,null))[_0xc620('0x43')](handleError(_0x40a206,null));};exports[_0xc620('0x22')]=function(_0x5f04cf,_0x5e352b){return db[_0xc620('0x3a')][_0xc620('0x42')]({'where':{'id':_0x5f04cf[_0xc620('0x45')]['id']}})[_0xc620('0x21')](handleEntityNotFound(_0x5e352b,null))[_0xc620('0x21')](removeEntity(_0x5e352b,null))['catch'](handleError(_0x5e352b,null));};exports[_0xc620('0x46')]=function(_0x1e3321,_0x1b6af3,_0x1df15c){var _0x28e5d1={};var _0x54bde8={};var _0x74bfe9;var _0x516117;return db[_0xc620('0x3a')][_0xc620('0x47')]({'where':{'id':_0x1e3321[_0xc620('0x45')]['id']}})[_0xc620('0x21')](handleEntityNotFound(_0x1b6af3,null))['then'](function(_0x1d932c){if(_0x1d932c){_0x74bfe9=_0x1d932c;_0x54bde8[_0xc620('0x2a')]=_[_0xc620('0x2c')](db[_0xc620('0x48')][_0xc620('0x27')]);_0x54bde8[_0xc620('0x2d')]=_[_0xc620('0x2c')](_0x1e3321[_0xc620('0x2d')]);_0x54bde8[_0xc620('0x2e')]=_[_0xc620('0x41')](_0x54bde8[_0xc620('0x2a')],_0x54bde8[_0xc620('0x2d')]);_0x28e5d1[_0xc620('0x2f')]=_[_0xc620('0x41')](_0x54bde8[_0xc620('0x2a')],qs[_0xc620('0x30')](_0x1e3321[_0xc620('0x2d')][_0xc620('0x30')]));_0x28e5d1[_0xc620('0x2f')]=_0x28e5d1[_0xc620('0x2f')]['length']?_0x28e5d1[_0xc620('0x2f')]:_0x54bde8[_0xc620('0x2a')];_0x28e5d1[_0xc620('0x49')]=qs[_0xc620('0x33')](_0x1e3321[_0xc620('0x2d')][_0xc620('0x33')]);_0x28e5d1[_0xc620('0x39')]=qs[_0xc620('0x2e')](_[_0xc620('0x34')](_0x1e3321['query'],_0x54bde8['filters']));if(_0x1e3321[_0xc620('0x2d')][_0xc620('0x35')]){_0x28e5d1[_0xc620('0x39')]=_[_0xc620('0x36')](_0x28e5d1[_0xc620('0x39')],{'$or':_[_0xc620('0x2b')](_0x28e5d1[_0xc620('0x2f')],function(_0xcfdb01){var _0x11dd01={};_0x11dd01[_0xcfdb01]={'$like':'%'+_0x1e3321['query']['filter']+'%'};return _0x11dd01;})});}_0x28e5d1=_[_0xc620('0x36')]({},_0x28e5d1,_0x1e3321[_0xc620('0x38')]);return _0x74bfe9[_0xc620('0x46')](_0x28e5d1);}})[_0xc620('0x21')](function(_0xeea6e7){if(_0xeea6e7){_0x516117=_0xeea6e7['length'];if(!_0x1e3321[_0xc620('0x2d')][_0xc620('0x31')](_0xc620('0x32'))){_0x28e5d1[_0xc620('0x1a')]=qs['limit'](_0x1e3321[_0xc620('0x2d')][_0xc620('0x1a')]);_0x28e5d1[_0xc620('0x18')]=qs[_0xc620('0x18')](_0x1e3321[_0xc620('0x2d')][_0xc620('0x18')]);}return _0x74bfe9[_0xc620('0x46')](_0x28e5d1);}})['then'](function(_0x138756){if(_0x138756){return _0x138756?{'count':_0x516117,'rows':_0x138756}:null;}})[_0xc620('0x21')](respondWithResult(_0x1b6af3,null))[_0xc620('0x43')](handleError(_0x1b6af3,null));};exports['addConfiguration']=function(_0x26ffc1,_0x152da2,_0x379386){if(_0x26ffc1[_0xc620('0x44')]['id']){delete _0x26ffc1[_0xc620('0x44')]['id'];}return db[_0xc620('0x3a')][_0xc620('0x47')]({'where':{'id':_0x26ffc1[_0xc620('0x45')]['id']}})['then'](handleEntityNotFound(_0x152da2,null))['then'](function(_0x8d7799){if(_0x8d7799){_0x26ffc1['body'][_0xc620('0x4a')]=_0x8d7799['id'];_0x26ffc1['body'][_0xc620('0x4b')]=integrations['getSubjects'](_0x26ffc1[_0xc620('0x44')][_0xc620('0x4c')],_0x26ffc1[_0xc620('0x44')]['type']);_0x26ffc1[_0xc620('0x44')][_0xc620('0x4d')]=integrations['getDescriptions'](_0x26ffc1[_0xc620('0x44')]['channel'],_0x26ffc1[_0xc620('0x44')][_0xc620('0x29')]);return db[_0xc620('0x48')][_0xc620('0x4e')](_0x26ffc1[_0xc620('0x44')],{'include':[{'model':db[_0xc620('0x4f')],'as':_0xc620('0x4b')},{'model':db[_0xc620('0x4f')],'as':'Descriptions'}]});}return null;})[_0xc620('0x21')](respondWithResult(_0x152da2,null))[_0xc620('0x43')](handleError(_0x152da2,null));};exports['getFields']=function(_0x195e2d,_0x129a3e,_0x13a1a9){var _0x59e3f3='';var _0x16641b='';return db[_0xc620('0x3a')]['findOne']({'where':{'id':_0x195e2d[_0xc620('0x45')]['id']},'attributes':['id',_0xc620('0x50'),'remoteUri',_0xc620('0x51')]})[_0xc620('0x21')](handleEntityNotFound(_0x129a3e,null))[_0xc620('0x21')](function(_0x578098){if(_0x578098){_0x16641b=_0x578098[_0xc620('0x50')];_0x59e3f3=_0x578098[_0xc620('0x52')];var _0x26c651=_0x578098[_0xc620('0x52')][_0xc620('0x53')](-0x1);if(_0x26c651==='/'){_0x59e3f3=_0x59e3f3[_0xc620('0x54')](0x0,_0x59e3f3[_0xc620('0x55')](_0x26c651));}return rp({'method':_0xc620('0x56'),'uri':util[_0xc620('0x57')](_0xc620('0x58'),_0x59e3f3,_0xc620('0x59')),'headers':{'Authorization':_0xc620('0x5a')+_0x578098[_0xc620('0x51')]},'json':!![]});}})['then'](function(_0x2dbfa8){if(_0x2dbfa8){var _0x3a4d41=_0x2dbfa8[_0xc620('0x5b')];var _0x1d0d79=![];var _0x1b4467=null;for(_0x1b4467=0x0;_0x1b4467<_0x3a4d41[_0xc620('0x5c')];_0x1b4467++){if(_0x3a4d41[_0x1b4467][_0xc620('0x5d')]===_0x16641b){_0x1d0d79=!![];}}if(_0x1d0d79){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc620('0x5e')});}}})[_0xc620('0x21')](respondWithResult(_0x129a3e,null))[_0xc620('0x43')](function(_0x1b8dff){var _0x292c2f=_0x195e2d['query'][_0xc620('0x5f')]?0x1f4:_0x1b8dff['statusCode']||0x1f4;logger['error'](_0xc620('0x60'),'getFields',_0x292c2f,JSON['stringify'](_0x1b8dff));delete _0x1b8dff[_0xc620('0x25')];if(_0x292c2f===0x191){_0x292c2f=0x190;}_0x129a3e[_0xc620('0x16')](_0x292c2f)[_0xc620('0x26')](_0x195e2d[_0xc620('0x2d')][_0xc620('0x5f')]?{'message':_0xc620('0x61'),'statusCode':_0x1b8dff[_0xc620('0x62')]}:_0x1b8dff);});}; \ No newline at end of file +var _0x2d9f=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','FreshsalesAccount','rawAttributes','fieldName','type','map','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','catch','show','includeAll','create','body','find','params','getConfigurations','findOne','FreshsalesConfiguration','pick','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','apiKey','users','email','Requested\x20Resource\x20not\x20Found','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x224ab0,_0x35895f){var _0x49aebf=function(_0x502487){while(--_0x502487){_0x224ab0['push'](_0x224ab0['shift']());}};_0x49aebf(++_0x35895f);}(_0x2d9f,0x126));var _0xf2d9=function(_0x1276cd,_0x581472){_0x1276cd=_0x1276cd-0x0;var _0x360707=_0x2d9f[_0x1276cd];return _0x360707;};'use strict';var emlformat=require(_0xf2d9('0x0'));var rimraf=require(_0xf2d9('0x1'));var zipdir=require(_0xf2d9('0x2'));var jsonpatch=require(_0xf2d9('0x3'));var rp=require(_0xf2d9('0x4'));var moment=require(_0xf2d9('0x5'));var BPromise=require(_0xf2d9('0x6'));var Mustache=require(_0xf2d9('0x7'));var util=require(_0xf2d9('0x8'));var path=require('path');var sox=require(_0xf2d9('0x9'));var csv=require(_0xf2d9('0xa'));var ejs=require(_0xf2d9('0xb'));var fs=require('fs');var fs_extra=require(_0xf2d9('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf2d9('0xd'));var jsforce=require(_0xf2d9('0xe'));var deskjs=require(_0xf2d9('0xf'));var toCsv=require(_0xf2d9('0xa'));var querystring=require('querystring');var Papa=require(_0xf2d9('0x10'));var Redis=require(_0xf2d9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf2d9('0x12'));var hardwareService=require(_0xf2d9('0x13'));var logger=require(_0xf2d9('0x14'))('api');var utils=require(_0xf2d9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf2d9('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf2d9('0x17'));function respondWithStatusCode(_0x25a20b,_0x4519e4){_0x4519e4=_0x4519e4||0xcc;return function(_0x1e1995){if(_0x1e1995){return _0x25a20b['sendStatus'](_0x4519e4);}return _0x25a20b[_0xf2d9('0x18')](_0x4519e4)[_0xf2d9('0x19')]();};}function respondWithResult(_0x322adb,_0x5e632c){_0x5e632c=_0x5e632c||0xc8;return function(_0x351f08){if(_0x351f08){return _0x322adb[_0xf2d9('0x18')](_0x5e632c)[_0xf2d9('0x1a')](_0x351f08);}};}function respondWithFilteredResult(_0x2dc7ed,_0x53405a){return function(_0x57ef72){if(_0x57ef72){var _0x3f7736=typeof _0x53405a[_0xf2d9('0x1b')]==='undefined'&&typeof _0x53405a[_0xf2d9('0x1c')]===_0xf2d9('0x1d');var _0x5325f3=_0x57ef72[_0xf2d9('0x1e')];var _0x28e972=_0x3f7736?0x0:_0x53405a[_0xf2d9('0x1b')];var _0x14ab70=_0x3f7736?_0x57ef72[_0xf2d9('0x1e')]:_0x53405a[_0xf2d9('0x1b')]+_0x53405a[_0xf2d9('0x1c')];var _0x3b5d45;if(_0x14ab70>=_0x5325f3){_0x14ab70=_0x5325f3;_0x3b5d45=0xc8;}else{_0x3b5d45=0xce;}_0x2dc7ed[_0xf2d9('0x18')](_0x3b5d45);return _0x2dc7ed[_0xf2d9('0x1f')](_0xf2d9('0x20'),_0x28e972+'-'+_0x14ab70+'/'+_0x5325f3)['json'](_0x57ef72);}return null;};}function patchUpdates(_0x367a0c){return function(_0x418281){try{jsonpatch[_0xf2d9('0x21')](_0x418281,_0x367a0c,!![]);}catch(_0x23f2cf){return BPromise[_0xf2d9('0x22')](_0x23f2cf);}return _0x418281[_0xf2d9('0x23')]();};}function saveUpdates(_0x583a30,_0xe7e7c0){return function(_0x5e5eeb){if(_0x5e5eeb){return _0x5e5eeb[_0xf2d9('0x24')](_0x583a30)[_0xf2d9('0x25')](function(_0x24938f){return _0x24938f;});}return null;};}function removeEntity(_0xd4b4a3,_0x34f56e){return function(_0x47304a){if(_0x47304a){return _0x47304a[_0xf2d9('0x26')]()[_0xf2d9('0x25')](function(){_0xd4b4a3[_0xf2d9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56d1ba,_0x41efec){return function(_0x47de02){if(!_0x47de02){_0x56d1ba[_0xf2d9('0x27')](0x194);}return _0x47de02;};}function handleError(_0x3a52bb,_0x285207){_0x285207=_0x285207||0x1f4;return function(_0x2962eb){logger['error'](_0x2962eb['stack']);if(_0x2962eb[_0xf2d9('0x28')]){delete _0x2962eb['name'];}_0x3a52bb[_0xf2d9('0x18')](_0x285207)['send'](_0x2962eb);};}exports[_0xf2d9('0x29')]=function(_0x131eb8,_0x381b3b){var _0x411904={},_0x23ff23={},_0x589a24={'count':0x0,'rows':[]};var _0xe52206=_['map'](db[_0xf2d9('0x2a')][_0xf2d9('0x2b')],function(_0x3d0bc3){return{'name':_0x3d0bc3[_0xf2d9('0x2c')],'type':_0x3d0bc3[_0xf2d9('0x2d')]['key']};});_0x23ff23['model']=_[_0xf2d9('0x2e')](_0xe52206,'name');_0x23ff23['query']=_[_0xf2d9('0x2f')](_0x131eb8[_0xf2d9('0x30')]);_0x23ff23['filters']=_['intersection'](_0x23ff23[_0xf2d9('0x31')],_0x23ff23[_0xf2d9('0x30')]);_0x411904['attributes']=_[_0xf2d9('0x32')](_0x23ff23[_0xf2d9('0x31')],qs[_0xf2d9('0x33')](_0x131eb8[_0xf2d9('0x30')][_0xf2d9('0x33')]));_0x411904[_0xf2d9('0x34')]=_0x411904[_0xf2d9('0x34')][_0xf2d9('0x35')]?_0x411904['attributes']:_0x23ff23['model'];if(!_0x131eb8[_0xf2d9('0x30')][_0xf2d9('0x36')](_0xf2d9('0x37'))){_0x411904[_0xf2d9('0x1c')]=qs[_0xf2d9('0x1c')](_0x131eb8[_0xf2d9('0x30')][_0xf2d9('0x1c')]);_0x411904['offset']=qs['offset'](_0x131eb8[_0xf2d9('0x30')][_0xf2d9('0x1b')]);}_0x411904[_0xf2d9('0x38')]=qs[_0xf2d9('0x39')](_0x131eb8['query'][_0xf2d9('0x39')]);_0x411904[_0xf2d9('0x3a')]=qs['filters'](_['pick'](_0x131eb8[_0xf2d9('0x30')],_0x23ff23[_0xf2d9('0x3b')]),_0xe52206);if(_0x131eb8['query']['filter']){_0x411904[_0xf2d9('0x3a')]=_[_0xf2d9('0x3c')](_0x411904[_0xf2d9('0x3a')],{'$or':_[_0xf2d9('0x2e')](_0xe52206,function(_0x3791d6){if(_0x3791d6[_0xf2d9('0x2d')]!=='VIRTUAL'){var _0x55fc35={};_0x55fc35[_0x3791d6[_0xf2d9('0x28')]]={'$like':'%'+_0x131eb8[_0xf2d9('0x30')][_0xf2d9('0x3d')]+'%'};return _0x55fc35;}})});}_0x411904=_[_0xf2d9('0x3c')]({},_0x411904,_0x131eb8[_0xf2d9('0x3e')]);var _0x3db4fd={'where':_0x411904[_0xf2d9('0x3a')]};return db[_0xf2d9('0x2a')][_0xf2d9('0x1e')](_0x3db4fd)['then'](function(_0x302801){_0x589a24[_0xf2d9('0x1e')]=_0x302801;if(_0x131eb8[_0xf2d9('0x30')]['includeAll']){_0x411904[_0xf2d9('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x411904);})[_0xf2d9('0x25')](function(_0xe017e8){_0x589a24[_0xf2d9('0x40')]=_0xe017e8;return _0x589a24;})['then'](respondWithFilteredResult(_0x381b3b,_0x411904))[_0xf2d9('0x41')](handleError(_0x381b3b,null));};exports[_0xf2d9('0x42')]=function(_0x27e264,_0x1d86e3){var _0x4781b5={'raw':![],'where':{'id':_0x27e264['params']['id']}},_0x19f1be={};_0x19f1be[_0xf2d9('0x31')]=_[_0xf2d9('0x2f')](db[_0xf2d9('0x2a')][_0xf2d9('0x2b')]);_0x19f1be[_0xf2d9('0x30')]=_[_0xf2d9('0x2f')](_0x27e264['query']);_0x19f1be[_0xf2d9('0x3b')]=_[_0xf2d9('0x32')](_0x19f1be[_0xf2d9('0x31')],_0x19f1be['query']);_0x4781b5[_0xf2d9('0x34')]=_['intersection'](_0x19f1be['model'],qs[_0xf2d9('0x33')](_0x27e264['query'][_0xf2d9('0x33')]));_0x4781b5[_0xf2d9('0x34')]=_0x4781b5[_0xf2d9('0x34')][_0xf2d9('0x35')]?_0x4781b5[_0xf2d9('0x34')]:_0x19f1be[_0xf2d9('0x31')];if(_0x27e264[_0xf2d9('0x30')][_0xf2d9('0x43')]){_0x4781b5[_0xf2d9('0x3f')]=[{'all':!![]}];}_0x4781b5=_[_0xf2d9('0x3c')]({},_0x4781b5,_0x27e264['options']);return db[_0xf2d9('0x2a')]['find'](_0x4781b5)[_0xf2d9('0x25')](handleEntityNotFound(_0x1d86e3,null))['then'](respondWithResult(_0x1d86e3,null))[_0xf2d9('0x41')](handleError(_0x1d86e3,null));};exports[_0xf2d9('0x44')]=function(_0x3414ab,_0x21c1ff){return db[_0xf2d9('0x2a')][_0xf2d9('0x44')](_0x3414ab[_0xf2d9('0x45')],{})[_0xf2d9('0x25')](respondWithResult(_0x21c1ff,0xc9))[_0xf2d9('0x41')](handleError(_0x21c1ff,null));};exports['update']=function(_0x136e77,_0x6977b8){if(_0x136e77[_0xf2d9('0x45')]['id']){delete _0x136e77[_0xf2d9('0x45')]['id'];}return db['FreshsalesAccount'][_0xf2d9('0x46')]({'where':{'id':_0x136e77[_0xf2d9('0x47')]['id']}})[_0xf2d9('0x25')](handleEntityNotFound(_0x6977b8,null))[_0xf2d9('0x25')](saveUpdates(_0x136e77[_0xf2d9('0x45')],null))[_0xf2d9('0x25')](respondWithResult(_0x6977b8,null))[_0xf2d9('0x41')](handleError(_0x6977b8,null));};exports[_0xf2d9('0x26')]=function(_0x5d693c,_0xb92455){return db[_0xf2d9('0x2a')][_0xf2d9('0x46')]({'where':{'id':_0x5d693c[_0xf2d9('0x47')]['id']}})[_0xf2d9('0x25')](handleEntityNotFound(_0xb92455,null))[_0xf2d9('0x25')](removeEntity(_0xb92455,null))[_0xf2d9('0x41')](handleError(_0xb92455,null));};exports[_0xf2d9('0x48')]=function(_0x44fd8e,_0x258b3c,_0xa56a2c){var _0x3a2d9e={};var _0x3b417b={};var _0x5c43c0;var _0x3bc517;return db[_0xf2d9('0x2a')][_0xf2d9('0x49')]({'where':{'id':_0x44fd8e[_0xf2d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x258b3c,null))[_0xf2d9('0x25')](function(_0x5a77f4){if(_0x5a77f4){_0x5c43c0=_0x5a77f4;_0x3b417b[_0xf2d9('0x31')]=_[_0xf2d9('0x2f')](db[_0xf2d9('0x4a')][_0xf2d9('0x2b')]);_0x3b417b[_0xf2d9('0x30')]=_[_0xf2d9('0x2f')](_0x44fd8e[_0xf2d9('0x30')]);_0x3b417b['filters']=_['intersection'](_0x3b417b[_0xf2d9('0x31')],_0x3b417b['query']);_0x3a2d9e[_0xf2d9('0x34')]=_[_0xf2d9('0x32')](_0x3b417b[_0xf2d9('0x31')],qs[_0xf2d9('0x33')](_0x44fd8e[_0xf2d9('0x30')][_0xf2d9('0x33')]));_0x3a2d9e[_0xf2d9('0x34')]=_0x3a2d9e[_0xf2d9('0x34')][_0xf2d9('0x35')]?_0x3a2d9e[_0xf2d9('0x34')]:_0x3b417b[_0xf2d9('0x31')];_0x3a2d9e['order']=qs[_0xf2d9('0x39')](_0x44fd8e[_0xf2d9('0x30')]['sort']);_0x3a2d9e[_0xf2d9('0x3a')]=qs[_0xf2d9('0x3b')](_[_0xf2d9('0x4b')](_0x44fd8e[_0xf2d9('0x30')],_0x3b417b[_0xf2d9('0x3b')]));if(_0x44fd8e[_0xf2d9('0x30')][_0xf2d9('0x3d')]){_0x3a2d9e[_0xf2d9('0x3a')]=_[_0xf2d9('0x3c')](_0x3a2d9e[_0xf2d9('0x3a')],{'$or':_[_0xf2d9('0x2e')](_0x3a2d9e[_0xf2d9('0x34')],function(_0x3b6ed1){var _0x3aacdd={};_0x3aacdd[_0x3b6ed1]={'$like':'%'+_0x44fd8e[_0xf2d9('0x30')][_0xf2d9('0x3d')]+'%'};return _0x3aacdd;})});}_0x3a2d9e=_[_0xf2d9('0x3c')]({},_0x3a2d9e,_0x44fd8e[_0xf2d9('0x3e')]);return _0x5c43c0['getConfigurations'](_0x3a2d9e);}})[_0xf2d9('0x25')](function(_0x3d7a53){if(_0x3d7a53){_0x3bc517=_0x3d7a53[_0xf2d9('0x35')];if(!_0x44fd8e[_0xf2d9('0x30')]['hasOwnProperty'](_0xf2d9('0x37'))){_0x3a2d9e[_0xf2d9('0x1c')]=qs[_0xf2d9('0x1c')](_0x44fd8e[_0xf2d9('0x30')][_0xf2d9('0x1c')]);_0x3a2d9e[_0xf2d9('0x1b')]=qs[_0xf2d9('0x1b')](_0x44fd8e[_0xf2d9('0x30')]['offset']);}return _0x5c43c0[_0xf2d9('0x48')](_0x3a2d9e);}})['then'](function(_0x3a0d3b){if(_0x3a0d3b){return _0x3a0d3b?{'count':_0x3bc517,'rows':_0x3a0d3b}:null;}})[_0xf2d9('0x25')](respondWithResult(_0x258b3c,null))[_0xf2d9('0x41')](handleError(_0x258b3c,null));};exports['addConfiguration']=function(_0x321b02,_0x50c7d7,_0x35dc74){if(_0x321b02[_0xf2d9('0x45')]['id']){delete _0x321b02[_0xf2d9('0x45')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x321b02[_0xf2d9('0x47')]['id']}})[_0xf2d9('0x25')](handleEntityNotFound(_0x50c7d7,null))[_0xf2d9('0x25')](function(_0x29617c){if(_0x29617c){_0x321b02[_0xf2d9('0x45')][_0xf2d9('0x4c')]=_0x29617c['id'];_0x321b02[_0xf2d9('0x45')]['Subjects']=integrations[_0xf2d9('0x4d')](_0x321b02[_0xf2d9('0x45')]['channel'],_0x321b02[_0xf2d9('0x45')][_0xf2d9('0x2d')]);_0x321b02[_0xf2d9('0x45')][_0xf2d9('0x4e')]=integrations[_0xf2d9('0x4f')](_0x321b02[_0xf2d9('0x45')][_0xf2d9('0x50')],_0x321b02['body'][_0xf2d9('0x2d')]);return db[_0xf2d9('0x4a')][_0xf2d9('0x44')](_0x321b02[_0xf2d9('0x45')],{'include':[{'model':db['FreshsalesField'],'as':_0xf2d9('0x51')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xf2d9('0x25')](respondWithResult(_0x50c7d7,null))[_0xf2d9('0x41')](handleError(_0x50c7d7,null));};exports[_0xf2d9('0x52')]=function(_0x25c9c1,_0x5956fd,_0x9a021f){var _0x57ab5e='';var _0xb72891='';return db[_0xf2d9('0x2a')]['findOne']({'where':{'id':_0x25c9c1[_0xf2d9('0x47')]['id']},'attributes':['id',_0xf2d9('0x53'),_0xf2d9('0x54'),'apiKey']})[_0xf2d9('0x25')](handleEntityNotFound(_0x5956fd,null))[_0xf2d9('0x25')](function(_0x3b2ef3){if(_0x3b2ef3){_0xb72891=_0x3b2ef3[_0xf2d9('0x53')];_0x57ab5e=_0x3b2ef3['remoteUri'];var _0x21de35=_0x3b2ef3[_0xf2d9('0x54')][_0xf2d9('0x55')](-0x1);if(_0x21de35==='/'){_0x57ab5e=_0x57ab5e[_0xf2d9('0x56')](0x0,_0x57ab5e[_0xf2d9('0x57')](_0x21de35));}return rp({'method':_0xf2d9('0x58'),'uri':util[_0xf2d9('0x59')](_0xf2d9('0x5a'),_0x57ab5e,_0xf2d9('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x3b2ef3[_0xf2d9('0x5c')]},'json':!![]});}})[_0xf2d9('0x25')](function(_0xe804b6){if(_0xe804b6){var _0x3100de=_0xe804b6[_0xf2d9('0x5d')];var _0x868351=![];var _0xbd0a5d=null;for(_0xbd0a5d=0x0;_0xbd0a5d<_0x3100de[_0xf2d9('0x35')];_0xbd0a5d++){if(_0x3100de[_0xbd0a5d][_0xf2d9('0x5e')]===_0xb72891){_0x868351=!![];}}if(_0x868351){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf2d9('0x5f')});}}})[_0xf2d9('0x25')](respondWithResult(_0x5956fd,null))[_0xf2d9('0x41')](function(_0x7f19df){var _0x1faa59=_0x25c9c1[_0xf2d9('0x30')]['test']?0x1f4:_0x7f19df['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xf2d9('0x52'),_0x1faa59,JSON['stringify'](_0x7f19df));delete _0x7f19df[_0xf2d9('0x28')];if(_0x1faa59===0x191){_0x1faa59=0x190;}_0x5956fd[_0xf2d9('0x18')](_0x1faa59)[_0xf2d9('0x60')](_0x25c9c1[_0xf2d9('0x30')][_0xf2d9('0x61')]?{'message':_0xf2d9('0x62'),'statusCode':_0x7f19df['statusCode']}:_0x7f19df);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0b86e7d..0a97340 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 _0xd943=['int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesAccount'];(function(_0x23a25c,_0x9c61dc){var _0x21d5a7=function(_0x4afa58){while(--_0x4afa58){_0x23a25c['push'](_0x23a25c['shift']());}};_0x21d5a7(++_0x9c61dc);}(_0xd943,0x15d));var _0x3d94=function(_0x4313ea,_0x84dec2){_0x4313ea=_0x4313ea-0x0;var _0x2c3b6c=_0xd943[_0x4313ea];return _0x2c3b6c;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3d94('0x9')]=function(_0x51cf1f,_0x54e81f){return _0x51cf1f['define'](_0x3d94('0xa'),attributes,{'tableName':_0x3d94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x2e62c1,_0x2469d5){var _0x123212=function(_0x3bcb98){while(--_0x3bcb98){_0x2e62c1['push'](_0x2e62c1['shift']());}};_0x123212(++_0x2469d5);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'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 e5b90c8..1eeb205 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 _0x27a0=['client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFreshsalesAccount','FreshsalesAccount','options','attributes','limit','include','map','model','then','catch','ShowFreshsalesAccount','find','raw','where','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x27a0,0xbf));var _0x027a=function(_0x2544ee,_0x45006b){_0x2544ee=_0x2544ee-0x0;var _0x1cc810=_0x27a0[_0x2544ee];return _0x1cc810;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('FreshsalesAccount,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});}exports[_0x027a('0x13')]=function(_0x826d19){var _0x1fb40b=this;return new Promise(function(_0x52125e,_0x282e70){return db[_0x027a('0x14')]['findAll']({'raw':_0x826d19['options']?_0x826d19[_0x027a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x826d19[_0x027a('0x15')]?_0x826d19['options']['where']||null:null,'attributes':_0x826d19['options']?_0x826d19['options'][_0x027a('0x16')]||null:null,'limit':_0x826d19[_0x027a('0x15')]?_0x826d19[_0x027a('0x15')][_0x027a('0x17')]||null:null,'include':_0x826d19['options']?_0x826d19[_0x027a('0x15')][_0x027a('0x18')]?_[_0x027a('0x19')](_0x826d19[_0x027a('0x15')][_0x027a('0x18')],function(_0x3bbd46){return{'model':db[_0x3bbd46['model']],'as':_0x3bbd46['as'],'attributes':_0x3bbd46[_0x027a('0x16')],'include':_0x3bbd46['include']?_[_0x027a('0x19')](_0x3bbd46[_0x027a('0x18')],function(_0x1b1a13){return{'model':db[_0x1b1a13[_0x027a('0x1a')]],'as':_0x1b1a13['as'],'attributes':_0x1b1a13['attributes'],'include':_0x1b1a13['include']?_[_0x027a('0x19')](_0x1b1a13[_0x027a('0x18')],function(_0x338141){return{'model':db[_0x338141[_0x027a('0x1a')]],'as':_0x338141['as'],'attributes':_0x338141['attributes']};}):[]};}):[]};}):[]:[]})[_0x027a('0x1b')](function(_0x55a8cd){logger[_0x027a('0xa')]('GetFreshsalesAccount',_0x826d19);logger[_0x027a('0xc')]('GetFreshsalesAccount',_0x826d19,JSON['stringify'](_0x55a8cd));_0x52125e(_0x55a8cd);})[_0x027a('0x1c')](function(_0x5782ac){logger['error'](_0x027a('0x13'),_0x5782ac['message'],_0x826d19);_0x282e70(_0x1fb40b[_0x027a('0x10')](0x1f4,_0x5782ac['message']));});});};exports[_0x027a('0x1d')]=function(_0xc99acc){var _0x4d9a29=this;return new Promise(function(_0xe4ea7d,_0x4b4ac4){return db[_0x027a('0x14')][_0x027a('0x1e')]({'raw':_0xc99acc[_0x027a('0x15')]?_0xc99acc[_0x027a('0x15')][_0x027a('0x1f')]===undefined?!![]:![]:!![],'where':_0xc99acc[_0x027a('0x15')]?_0xc99acc['options'][_0x027a('0x20')]||null:null,'attributes':_0xc99acc['options']?_0xc99acc[_0x027a('0x15')]['attributes']||null:null,'include':_0xc99acc[_0x027a('0x15')]?_0xc99acc[_0x027a('0x15')][_0x027a('0x18')]?_[_0x027a('0x19')](_0xc99acc[_0x027a('0x15')]['include'],function(_0x1274e1){return{'model':db[_0x1274e1[_0x027a('0x1a')]],'as':_0x1274e1['as'],'attributes':_0x1274e1[_0x027a('0x16')],'include':_0x1274e1[_0x027a('0x18')]?_[_0x027a('0x19')](_0x1274e1[_0x027a('0x18')],function(_0x1bc29f){return{'model':db[_0x1bc29f[_0x027a('0x1a')]],'as':_0x1bc29f['as'],'attributes':_0x1bc29f[_0x027a('0x16')],'include':_0x1bc29f[_0x027a('0x18')]?_[_0x027a('0x19')](_0x1bc29f['include'],function(_0x29dc8f){return{'model':db[_0x29dc8f[_0x027a('0x1a')]],'as':_0x29dc8f['as'],'attributes':_0x29dc8f[_0x027a('0x16')]};}):[]};}):[]};}):[]:[]})[_0x027a('0x1b')](function(_0x19b476){logger[_0x027a('0xa')](_0x027a('0x1d'),_0xc99acc);logger['debug'](_0x027a('0x1d'),_0xc99acc,JSON[_0x027a('0xf')](_0x19b476));_0xe4ea7d(_0x19b476);})[_0x027a('0x1c')](function(_0x5e9130){logger[_0x027a('0x10')]('ShowFreshsalesAccount',_0x5e9130[_0x027a('0x12')],_0xc99acc);_0x4b4ac4(_0x4d9a29[_0x027a('0x10')](0x1f4,_0x5e9130[_0x027a('0x12')]));});});}; \ No newline at end of file +var _0x9536=['code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9536,0x179));var _0x6953=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x9536[_0x256e32];return _0x464070;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')]({'raw':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1c')]||null:null,'attributes':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1d')]||null:null,'limit':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1e')]||null:null,'include':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')],function(_0x2a7f6a){return{'model':db[_0x2a7f6a['model']],'as':_0x2a7f6a['as'],'attributes':_0x2a7f6a['attributes'],'include':_0x2a7f6a['include']?_[_0x6953('0x20')](_0x2a7f6a[_0x6953('0x1f')],function(_0x550be4){return{'model':db[_0x550be4[_0x6953('0x21')]],'as':_0x550be4['as'],'attributes':_0x550be4['attributes'],'include':_0x550be4[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x550be4[_0x6953('0x1f')],function(_0x2cc01e){return{'model':db[_0x2cc01e[_0x6953('0x21')]],'as':_0x2cc01e['as'],'attributes':_0x2cc01e[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dd890){logger[_0x6953('0x15')]('GetFreshsalesAccount',_0x2da771);logger[_0x6953('0xf')]('GetFreshsalesAccount',_0x2da771,JSON[_0x6953('0x11')](_0x3dd890));_0x10858a(_0x3dd890);})[_0x6953('0x16')](function(_0x426c7c){logger['error'](_0x6953('0x17'),_0x426c7c[_0x6953('0x14')],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x426c7c['message']));});});};exports[_0x6953('0x22')]=function(_0x132a71){var _0x481c6a=this;return new Promise(function(_0x4d856d,_0xd80e42){return db[_0x6953('0x18')][_0x6953('0x23')]({'raw':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x132a71[_0x6953('0x1a')]?_0x132a71['options'][_0x6953('0x1c')]||null:null,'attributes':_0x132a71[_0x6953('0x1a')]?_0x132a71['options']['attributes']||null:null,'include':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x132a71[_0x6953('0x1a')]['include'],function(_0x4e95f1){return{'model':db[_0x4e95f1['model']],'as':_0x4e95f1['as'],'attributes':_0x4e95f1['attributes'],'include':_0x4e95f1[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x4e95f1[_0x6953('0x1f')],function(_0x11f316){return{'model':db[_0x11f316[_0x6953('0x21')]],'as':_0x11f316['as'],'attributes':_0x11f316[_0x6953('0x1d')],'include':_0x11f316['include']?_[_0x6953('0x20')](_0x11f316['include'],function(_0x199c67){return{'model':db[_0x199c67['model']],'as':_0x199c67['as'],'attributes':_0x199c67[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6953('0xc')](function(_0xd81149){logger[_0x6953('0x15')]('ShowFreshsalesAccount',_0x132a71);logger[_0x6953('0xf')](_0x6953('0x22'),_0x132a71,JSON[_0x6953('0x11')](_0xd81149));_0x4d856d(_0xd81149);})[_0x6953('0x16')](function(_0x40b6ea){logger[_0x6953('0x12')](_0x6953('0x22'),_0x40b6ea[_0x6953('0x14')],_0x132a71);_0xd80e42(_0x481c6a[_0x6953('0x12')](0x1f4,_0x40b6ea[_0x6953('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6613476..c0a74b3 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 _0xe226=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','show','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x10f060,_0x572eae){var _0x21e307=function(_0x4afdc4){while(--_0x4afdc4){_0x10f060['push'](_0x10f060['shift']());}};_0x21e307(++_0x572eae);}(_0xe226,0x192));var _0x6e22=function(_0x43041f,_0x3133fe){_0x43041f=_0x43041f-0x0;var _0x291070=_0xe226[_0x43041f];return _0x291070;};'use strict';var multer=require(_0x6e22('0x0'));var util=require(_0x6e22('0x1'));var path=require(_0x6e22('0x2'));var timeout=require(_0x6e22('0x3'));var express=require('express');var router=express[_0x6e22('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e22('0x5'));var interaction=require(_0x6e22('0x6'));var config=require(_0x6e22('0x7'));var controller=require(_0x6e22('0x8'));router[_0x6e22('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e22('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6e22('0xa')]);router['get']('/:id/subjects',auth[_0x6e22('0xb')](),controller[_0x6e22('0xc')]);router[_0x6e22('0x9')](_0x6e22('0xd'),auth[_0x6e22('0xb')](),controller[_0x6e22('0xe')]);router[_0x6e22('0x9')](_0x6e22('0xf'),auth[_0x6e22('0xb')](),controller[_0x6e22('0x10')]);router[_0x6e22('0x11')]('/',auth[_0x6e22('0xb')](),controller['create']);router[_0x6e22('0x12')](_0x6e22('0x13'),auth[_0x6e22('0xb')](),controller[_0x6e22('0x14')]);router[_0x6e22('0x15')](_0x6e22('0x13'),auth[_0x6e22('0xb')](),controller[_0x6e22('0x16')]);module[_0x6e22('0x17')]=router; \ No newline at end of file +var _0x419a=['../../components/interaction/service','./intFreshsalesConfiguration.controller','/:id','isAuthenticated','show','get','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5c7968,_0x4264c5){var _0x2eb335=function(_0x1061a0){while(--_0x1061a0){_0x5c7968['push'](_0x5c7968['shift']());}};_0x2eb335(++_0x4264c5);}(_0x419a,0x149));var _0xa419=function(_0xb09a5f,_0x3707b8){_0xb09a5f=_0xb09a5f-0x0;var _0x3de467=_0x419a[_0xb09a5f];return _0x3de467;};'use strict';var multer=require(_0xa419('0x0'));var util=require(_0xa419('0x1'));var path=require(_0xa419('0x2'));var timeout=require(_0xa419('0x3'));var express=require(_0xa419('0x4'));var router=express[_0xa419('0x5')]();var fs_extra=require(_0xa419('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa419('0x7'));var config=require('../../config/environment');var controller=require(_0xa419('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa419('0x9'),auth[_0xa419('0xa')](),controller[_0xa419('0xb')]);router[_0xa419('0xc')](_0xa419('0xd'),auth[_0xa419('0xa')](),controller[_0xa419('0xe')]);router[_0xa419('0xc')](_0xa419('0xf'),auth[_0xa419('0xa')](),controller['getDescriptions']);router[_0xa419('0xc')](_0xa419('0x10'),auth['isAuthenticated'](),controller[_0xa419('0x11')]);router['post']('/',auth[_0xa419('0xa')](),controller['create']);router[_0xa419('0x12')](_0xa419('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xa419('0x13')](_0xa419('0x9'),auth[_0xa419('0xa')](),controller[_0xa419('0x14')]);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 8f120eb..1cd449d 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 _0x1ad3=['sequelize','STRING'];(function(_0x1e9a3b,_0x5df0a3){var _0x143bd2=function(_0x471afe){while(--_0x471afe){_0x1e9a3b['push'](_0x1e9a3b['shift']());}};_0x143bd2(++_0x5df0a3);}(_0x1ad3,0x1be));var _0x31ad=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0x1ad3[_0x23f8c8];return _0x3dc718;};'use strict';var Sequelize=require(_0x31ad('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x31ad('0x1')]}}; \ No newline at end of file +var _0x892d=['sequelize','exports','STRING'];(function(_0x206362,_0x514923){var _0xfaa96d=function(_0x17c9df){while(--_0x17c9df){_0x206362['push'](_0x206362['shift']());}};_0xfaa96d(++_0x514923);}(_0x892d,0x75));var _0xd892=function(_0x3b3423,_0x5b0e18){_0x3b3423=_0x3b3423-0x0;var _0x4b2a96=_0x892d[_0x3b3423];return _0x4b2a96;};'use strict';var Sequelize=require(_0xd892('0x0'));module[_0xd892('0x1')]={'name':{'type':Sequelize[_0xd892('0x2')]},'description':{'type':Sequelize[_0xd892('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index f9357c7..1060981 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 _0x42be=['rows','params','include','merge','find','catch','create','body','getSubjects','findOne','pick','getDescriptions','getFields','FreshsalesField','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','findAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x42be,0xac));var _0xe42b=function(_0xe4fe90,_0x4eaad4){_0xe4fe90=_0xe4fe90-0x0;var _0xd4fe64=_0x42be[_0xe4fe90];return _0xd4fe64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe42b('0x0'));var zipdir=require(_0xe42b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe42b('0x2'));var moment=require('moment');var BPromise=require(_0xe42b('0x3'));var Mustache=require(_0xe42b('0x4'));var util=require(_0xe42b('0x5'));var path=require('path');var sox=require(_0xe42b('0x6'));var csv=require('to-csv');var ejs=require(_0xe42b('0x7'));var fs=require('fs');var fs_extra=require(_0xe42b('0x8'));var _=require(_0xe42b('0x9'));var squel=require(_0xe42b('0xa'));var crypto=require('crypto');var jsforce=require(_0xe42b('0xb'));var deskjs=require(_0xe42b('0xc'));var toCsv=require(_0xe42b('0xd'));var querystring=require(_0xe42b('0xe'));var Papa=require(_0xe42b('0xf'));var Redis=require(_0xe42b('0x10'));var authService=require(_0xe42b('0x11'));var qs=require(_0xe42b('0x12'));var as=require(_0xe42b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe42b('0x14'))(_0xe42b('0x15'));var utils=require('../../config/utils');var config=require(_0xe42b('0x16'));var licenseUtil=require(_0xe42b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf231cf,_0x5103ea){_0x5103ea=_0x5103ea||0xcc;return function(_0x4ccc36){if(_0x4ccc36){return _0xf231cf[_0xe42b('0x18')](_0x5103ea);}return _0xf231cf[_0xe42b('0x19')](_0x5103ea)[_0xe42b('0x1a')]();};}function respondWithResult(_0x1b1b99,_0x2d2d42){_0x2d2d42=_0x2d2d42||0xc8;return function(_0x1db445){if(_0x1db445){return _0x1b1b99[_0xe42b('0x19')](_0x2d2d42)[_0xe42b('0x1b')](_0x1db445);}};}function respondWithFilteredResult(_0x40ebb1,_0x24f244){return function(_0x12a2a4){if(_0x12a2a4){var _0x250f39=typeof _0x24f244[_0xe42b('0x1c')]===_0xe42b('0x1d')&&typeof _0x24f244['limit']==='undefined';var _0x3fc836=_0x12a2a4[_0xe42b('0x1e')];var _0x4b72c3=_0x250f39?0x0:_0x24f244[_0xe42b('0x1c')];var _0x36abe8=_0x250f39?_0x12a2a4[_0xe42b('0x1e')]:_0x24f244[_0xe42b('0x1c')]+_0x24f244[_0xe42b('0x1f')];var _0x51a7f0;if(_0x36abe8>=_0x3fc836){_0x36abe8=_0x3fc836;_0x51a7f0=0xc8;}else{_0x51a7f0=0xce;}_0x40ebb1[_0xe42b('0x19')](_0x51a7f0);return _0x40ebb1[_0xe42b('0x20')](_0xe42b('0x21'),_0x4b72c3+'-'+_0x36abe8+'/'+_0x3fc836)['json'](_0x12a2a4);}return null;};}function patchUpdates(_0x2b4f55){return function(_0x2da6a6){try{jsonpatch['apply'](_0x2da6a6,_0x2b4f55,!![]);}catch(_0x43b8b8){return BPromise['reject'](_0x43b8b8);}return _0x2da6a6[_0xe42b('0x22')]();};}function saveUpdates(_0x5317a3,_0xd9da25){return function(_0x32f221){if(_0x32f221){return _0x32f221[_0xe42b('0x23')](_0x5317a3)[_0xe42b('0x24')](function(_0x45f20a){return _0x45f20a;});}return null;};}function removeEntity(_0x493ea2,_0x59aa36){return function(_0x36d8c8){if(_0x36d8c8){return _0x36d8c8[_0xe42b('0x25')]()[_0xe42b('0x24')](function(){_0x493ea2[_0xe42b('0x19')](0xcc)[_0xe42b('0x1a')]();});}};}function handleEntityNotFound(_0x4cdd28,_0x43c17f){return function(_0x3fbf3f){if(!_0x3fbf3f){_0x4cdd28[_0xe42b('0x18')](0x194);}return _0x3fbf3f;};}function handleError(_0xb3293b,_0x355fe0){_0x355fe0=_0x355fe0||0x1f4;return function(_0x280ce7){logger[_0xe42b('0x26')](_0x280ce7[_0xe42b('0x27')]);if(_0x280ce7[_0xe42b('0x28')]){delete _0x280ce7['name'];}_0xb3293b[_0xe42b('0x19')](_0x355fe0)['send'](_0x280ce7);};}exports[_0xe42b('0x29')]=function(_0x3d7791,_0x3d3033){var _0x1cbbcd={},_0x128a2d={},_0x3b61e2={'count':0x0,'rows':[]};var _0x1129cc=_[_0xe42b('0x2a')](db[_0xe42b('0x2b')][_0xe42b('0x2c')],function(_0x3bac73){return{'name':_0x3bac73['fieldName'],'type':_0x3bac73[_0xe42b('0x2d')][_0xe42b('0x2e')]};});_0x128a2d[_0xe42b('0x2f')]=_[_0xe42b('0x2a')](_0x1129cc,_0xe42b('0x28'));_0x128a2d['query']=_[_0xe42b('0x30')](_0x3d7791[_0xe42b('0x31')]);_0x128a2d[_0xe42b('0x32')]=_[_0xe42b('0x33')](_0x128a2d[_0xe42b('0x2f')],_0x128a2d['query']);_0x1cbbcd[_0xe42b('0x34')]=_['intersection'](_0x128a2d[_0xe42b('0x2f')],qs[_0xe42b('0x35')](_0x3d7791['query'][_0xe42b('0x35')]));_0x1cbbcd[_0xe42b('0x34')]=_0x1cbbcd[_0xe42b('0x34')][_0xe42b('0x36')]?_0x1cbbcd[_0xe42b('0x34')]:_0x128a2d[_0xe42b('0x2f')];if(!_0x3d7791[_0xe42b('0x31')][_0xe42b('0x37')](_0xe42b('0x38'))){_0x1cbbcd[_0xe42b('0x1f')]=qs['limit'](_0x3d7791[_0xe42b('0x31')][_0xe42b('0x1f')]);_0x1cbbcd['offset']=qs[_0xe42b('0x1c')](_0x3d7791[_0xe42b('0x31')][_0xe42b('0x1c')]);}_0x1cbbcd[_0xe42b('0x39')]=qs['sort'](_0x3d7791['query'][_0xe42b('0x3a')]);_0x1cbbcd[_0xe42b('0x3b')]=qs[_0xe42b('0x32')](_['pick'](_0x3d7791[_0xe42b('0x31')],_0x128a2d[_0xe42b('0x32')]),_0x1129cc);if(_0x3d7791[_0xe42b('0x31')][_0xe42b('0x3c')]){_0x1cbbcd['where']=_['merge'](_0x1cbbcd['where'],{'$or':_['map'](_0x1129cc,function(_0x21a1f6){if(_0x21a1f6[_0xe42b('0x2d')]!==_0xe42b('0x3d')){var _0x3dcc4b={};_0x3dcc4b[_0x21a1f6[_0xe42b('0x28')]]={'$like':'%'+_0x3d7791['query'][_0xe42b('0x3c')]+'%'};return _0x3dcc4b;}})});}_0x1cbbcd=_['merge']({},_0x1cbbcd,_0x3d7791[_0xe42b('0x3e')]);var _0x51caba={'where':_0x1cbbcd['where']};return db[_0xe42b('0x2b')][_0xe42b('0x1e')](_0x51caba)[_0xe42b('0x24')](function(_0x3fadb3){_0x3b61e2[_0xe42b('0x1e')]=_0x3fadb3;if(_0x3d7791[_0xe42b('0x31')][_0xe42b('0x3f')]){_0x1cbbcd['include']=[{'all':!![]}];}return db[_0xe42b('0x2b')][_0xe42b('0x40')](_0x1cbbcd);})[_0xe42b('0x24')](function(_0x3087bd){_0x3b61e2[_0xe42b('0x41')]=_0x3087bd;return _0x3b61e2;})['then'](respondWithFilteredResult(_0x3d3033,_0x1cbbcd))['catch'](handleError(_0x3d3033,null));};exports['show']=function(_0x1b4191,_0x459652){var _0x29a60a={'raw':![],'where':{'id':_0x1b4191[_0xe42b('0x42')]['id']}},_0x1447c7={};_0x1447c7['model']=_[_0xe42b('0x30')](db[_0xe42b('0x2b')][_0xe42b('0x2c')]);_0x1447c7[_0xe42b('0x31')]=_[_0xe42b('0x30')](_0x1b4191[_0xe42b('0x31')]);_0x1447c7[_0xe42b('0x32')]=_['intersection'](_0x1447c7[_0xe42b('0x2f')],_0x1447c7['query']);_0x29a60a[_0xe42b('0x34')]=_[_0xe42b('0x33')](_0x1447c7[_0xe42b('0x2f')],qs[_0xe42b('0x35')](_0x1b4191[_0xe42b('0x31')]['fields']));_0x29a60a[_0xe42b('0x34')]=_0x29a60a[_0xe42b('0x34')][_0xe42b('0x36')]?_0x29a60a[_0xe42b('0x34')]:_0x1447c7[_0xe42b('0x2f')];if(_0x1b4191[_0xe42b('0x31')]['includeAll']){_0x29a60a[_0xe42b('0x43')]=[{'all':!![]}];}_0x29a60a=_[_0xe42b('0x44')]({},_0x29a60a,_0x1b4191[_0xe42b('0x3e')]);return db[_0xe42b('0x2b')][_0xe42b('0x45')](_0x29a60a)[_0xe42b('0x24')](handleEntityNotFound(_0x459652,null))[_0xe42b('0x24')](respondWithResult(_0x459652,null))[_0xe42b('0x46')](handleError(_0x459652,null));};exports[_0xe42b('0x47')]=function(_0x197cc3,_0x38dbb3){return db[_0xe42b('0x2b')]['create'](_0x197cc3[_0xe42b('0x48')],{})[_0xe42b('0x24')](respondWithResult(_0x38dbb3,0xc9))[_0xe42b('0x46')](handleError(_0x38dbb3,null));};exports['update']=function(_0x2c55ac,_0x15f419){if(_0x2c55ac[_0xe42b('0x48')]['id']){delete _0x2c55ac['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x2c55ac[_0xe42b('0x42')]['id']}})['then'](handleEntityNotFound(_0x15f419,null))['then'](saveUpdates(_0x2c55ac[_0xe42b('0x48')],null))[_0xe42b('0x24')](respondWithResult(_0x15f419,null))[_0xe42b('0x46')](handleError(_0x15f419,null));};exports[_0xe42b('0x25')]=function(_0xadbadc,_0x268655){return db[_0xe42b('0x2b')][_0xe42b('0x45')]({'where':{'id':_0xadbadc[_0xe42b('0x42')]['id']}})[_0xe42b('0x24')](handleEntityNotFound(_0x268655,null))[_0xe42b('0x24')](removeEntity(_0x268655,null))['catch'](handleError(_0x268655,null));};exports[_0xe42b('0x49')]=function(_0x56c245,_0x3b64b1,_0x227a03){var _0x38f1a8={};var _0x31909f={};var _0x2ac4fa;var _0x331127;return db[_0xe42b('0x2b')][_0xe42b('0x4a')]({'where':{'id':_0x56c245[_0xe42b('0x42')]['id']}})[_0xe42b('0x24')](handleEntityNotFound(_0x3b64b1,null))['then'](function(_0x16b5cd){if(_0x16b5cd){_0x2ac4fa=_0x16b5cd;_0x31909f[_0xe42b('0x2f')]=_[_0xe42b('0x30')](db['FreshsalesField'][_0xe42b('0x2c')]);_0x31909f[_0xe42b('0x31')]=_['keys'](_0x56c245[_0xe42b('0x31')]);_0x31909f[_0xe42b('0x32')]=_[_0xe42b('0x33')](_0x31909f[_0xe42b('0x2f')],_0x31909f['query']);_0x38f1a8[_0xe42b('0x34')]=_[_0xe42b('0x33')](_0x31909f[_0xe42b('0x2f')],qs[_0xe42b('0x35')](_0x56c245['query'][_0xe42b('0x35')]));_0x38f1a8['attributes']=_0x38f1a8[_0xe42b('0x34')]['length']?_0x38f1a8[_0xe42b('0x34')]:_0x31909f[_0xe42b('0x2f')];_0x38f1a8[_0xe42b('0x39')]=qs[_0xe42b('0x3a')](_0x56c245[_0xe42b('0x31')][_0xe42b('0x3a')]);_0x38f1a8[_0xe42b('0x3b')]=qs[_0xe42b('0x32')](_[_0xe42b('0x4b')](_0x56c245[_0xe42b('0x31')],_0x31909f[_0xe42b('0x32')]));if(_0x56c245[_0xe42b('0x31')]['filter']){_0x38f1a8['where']=_[_0xe42b('0x44')](_0x38f1a8[_0xe42b('0x3b')],{'$or':_[_0xe42b('0x2a')](_0x38f1a8[_0xe42b('0x34')],function(_0x5ed9d3){var _0x22de93={};_0x22de93[_0x5ed9d3]={'$like':'%'+_0x56c245[_0xe42b('0x31')][_0xe42b('0x3c')]+'%'};return _0x22de93;})});}_0x38f1a8=_[_0xe42b('0x44')]({},_0x38f1a8,_0x56c245[_0xe42b('0x3e')]);return _0x2ac4fa['getSubjects'](_0x38f1a8);}})['then'](function(_0x24f4ad){if(_0x24f4ad){_0x331127=_0x24f4ad[_0xe42b('0x36')];if(!_0x56c245[_0xe42b('0x31')][_0xe42b('0x37')]('nolimit')){_0x38f1a8['limit']=qs['limit'](_0x56c245['query'][_0xe42b('0x1f')]);_0x38f1a8[_0xe42b('0x1c')]=qs[_0xe42b('0x1c')](_0x56c245['query']['offset']);}return _0x2ac4fa['getSubjects'](_0x38f1a8);}})[_0xe42b('0x24')](function(_0x175162){if(_0x175162){return _0x175162?{'count':_0x331127,'rows':_0x175162}:null;}})[_0xe42b('0x24')](respondWithResult(_0x3b64b1,null))[_0xe42b('0x46')](handleError(_0x3b64b1,null));};exports[_0xe42b('0x4c')]=function(_0x5c65f0,_0x36e382,_0x1234ee){var _0xb15596={};var _0x146edf={};var _0x591ea8;var _0x43063e;return db[_0xe42b('0x2b')][_0xe42b('0x4a')]({'where':{'id':_0x5c65f0[_0xe42b('0x42')]['id']}})[_0xe42b('0x24')](handleEntityNotFound(_0x36e382,null))[_0xe42b('0x24')](function(_0x28fc29){if(_0x28fc29){_0x591ea8=_0x28fc29;_0x146edf[_0xe42b('0x2f')]=_[_0xe42b('0x30')](db['FreshsalesField'][_0xe42b('0x2c')]);_0x146edf[_0xe42b('0x31')]=_[_0xe42b('0x30')](_0x5c65f0[_0xe42b('0x31')]);_0x146edf[_0xe42b('0x32')]=_[_0xe42b('0x33')](_0x146edf[_0xe42b('0x2f')],_0x146edf['query']);_0xb15596[_0xe42b('0x34')]=_[_0xe42b('0x33')](_0x146edf['model'],qs[_0xe42b('0x35')](_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x35')]));_0xb15596[_0xe42b('0x34')]=_0xb15596['attributes']['length']?_0xb15596[_0xe42b('0x34')]:_0x146edf[_0xe42b('0x2f')];_0xb15596[_0xe42b('0x39')]=qs[_0xe42b('0x3a')](_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x3a')]);_0xb15596[_0xe42b('0x3b')]=qs['filters'](_['pick'](_0x5c65f0[_0xe42b('0x31')],_0x146edf[_0xe42b('0x32')]));if(_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x3c')]){_0xb15596[_0xe42b('0x3b')]=_[_0xe42b('0x44')](_0xb15596['where'],{'$or':_[_0xe42b('0x2a')](_0xb15596[_0xe42b('0x34')],function(_0x4d258b){var _0x2d20cc={};_0x2d20cc[_0x4d258b]={'$like':'%'+_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x3c')]+'%'};return _0x2d20cc;})});}_0xb15596=_[_0xe42b('0x44')]({},_0xb15596,_0x5c65f0[_0xe42b('0x3e')]);return _0x591ea8[_0xe42b('0x4c')](_0xb15596);}})['then'](function(_0x5c00ad){if(_0x5c00ad){_0x43063e=_0x5c00ad[_0xe42b('0x36')];if(!_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x37')](_0xe42b('0x38'))){_0xb15596[_0xe42b('0x1f')]=qs['limit'](_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x1f')]);_0xb15596[_0xe42b('0x1c')]=qs[_0xe42b('0x1c')](_0x5c65f0[_0xe42b('0x31')][_0xe42b('0x1c')]);}return _0x591ea8[_0xe42b('0x4c')](_0xb15596);}})[_0xe42b('0x24')](function(_0x3096f2){if(_0x3096f2){return _0x3096f2?{'count':_0x43063e,'rows':_0x3096f2}:null;}})[_0xe42b('0x24')](respondWithResult(_0x36e382,null))['catch'](handleError(_0x36e382,null));};exports[_0xe42b('0x4d')]=function(_0x3cafbe,_0x460344,_0x22deb8){var _0x2537d8={};var _0x430336={};var _0x384da8;var _0xd6f404;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3cafbe[_0xe42b('0x42')]['id']}})[_0xe42b('0x24')](handleEntityNotFound(_0x460344,null))[_0xe42b('0x24')](function(_0x4150b0){if(_0x4150b0){_0x384da8=_0x4150b0;_0x430336[_0xe42b('0x2f')]=_['keys'](db[_0xe42b('0x4e')][_0xe42b('0x2c')]);_0x430336['query']=_[_0xe42b('0x30')](_0x3cafbe[_0xe42b('0x31')]);_0x430336[_0xe42b('0x32')]=_[_0xe42b('0x33')](_0x430336[_0xe42b('0x2f')],_0x430336[_0xe42b('0x31')]);_0x2537d8[_0xe42b('0x34')]=_[_0xe42b('0x33')](_0x430336['model'],qs[_0xe42b('0x35')](_0x3cafbe[_0xe42b('0x31')][_0xe42b('0x35')]));_0x2537d8['attributes']=_0x2537d8[_0xe42b('0x34')][_0xe42b('0x36')]?_0x2537d8[_0xe42b('0x34')]:_0x430336[_0xe42b('0x2f')];_0x2537d8[_0xe42b('0x39')]=qs[_0xe42b('0x3a')](_0x3cafbe['query'][_0xe42b('0x3a')]);_0x2537d8['where']=qs[_0xe42b('0x32')](_['pick'](_0x3cafbe[_0xe42b('0x31')],_0x430336['filters']));if(_0x3cafbe[_0xe42b('0x31')][_0xe42b('0x3c')]){_0x2537d8[_0xe42b('0x3b')]=_[_0xe42b('0x44')](_0x2537d8[_0xe42b('0x3b')],{'$or':_[_0xe42b('0x2a')](_0x2537d8[_0xe42b('0x34')],function(_0x1b05d2){var _0x554eee={};_0x554eee[_0x1b05d2]={'$like':'%'+_0x3cafbe['query'][_0xe42b('0x3c')]+'%'};return _0x554eee;})});}_0x2537d8=_[_0xe42b('0x44')]({},_0x2537d8,_0x3cafbe['options']);return _0x384da8['getFields'](_0x2537d8);}})['then'](function(_0x3738b0){if(_0x3738b0){_0xd6f404=_0x3738b0[_0xe42b('0x36')];if(!_0x3cafbe[_0xe42b('0x31')][_0xe42b('0x37')](_0xe42b('0x38'))){_0x2537d8[_0xe42b('0x1f')]=qs[_0xe42b('0x1f')](_0x3cafbe[_0xe42b('0x31')][_0xe42b('0x1f')]);_0x2537d8[_0xe42b('0x1c')]=qs[_0xe42b('0x1c')](_0x3cafbe[_0xe42b('0x31')][_0xe42b('0x1c')]);}return _0x384da8['getFields'](_0x2537d8);}})[_0xe42b('0x24')](function(_0x5947b6){if(_0x5947b6){return _0x5947b6?{'count':_0xd6f404,'rows':_0x5947b6}:null;}})[_0xe42b('0x24')](respondWithResult(_0x460344,null))['catch'](handleError(_0x460344,null));}; \ No newline at end of file +var _0xe160=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','then','catch','show','params','model','rawAttributes','include','find','create','body','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x4045fa,_0x529e96){var _0x37a572=function(_0x48a848){while(--_0x48a848){_0x4045fa['push'](_0x4045fa['shift']());}};_0x37a572(++_0x529e96);}(_0xe160,0x176));var _0x0e16=function(_0x24f682,_0x1ff422){_0x24f682=_0x24f682-0x0;var _0x482fca=_0xe160[_0x24f682];return _0x482fca;};'use strict';var emlformat=require(_0x0e16('0x0'));var rimraf=require(_0x0e16('0x1'));var zipdir=require(_0x0e16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0e16('0x3'));var Mustache=require(_0x0e16('0x4'));var util=require(_0x0e16('0x5'));var path=require('path');var sox=require(_0x0e16('0x6'));var csv=require(_0x0e16('0x7'));var ejs=require(_0x0e16('0x8'));var fs=require('fs');var fs_extra=require(_0x0e16('0x9'));var _=require(_0x0e16('0xa'));var squel=require(_0x0e16('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e16('0xc'));var toCsv=require(_0x0e16('0x7'));var querystring=require('querystring');var Papa=require(_0x0e16('0xd'));var Redis=require(_0x0e16('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0e16('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e16('0x10'))(_0x0e16('0x11'));var utils=require(_0x0e16('0x12'));var config=require(_0x0e16('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e16('0x14'))['db'];function respondWithStatusCode(_0x587046,_0x46e24d){_0x46e24d=_0x46e24d||0xcc;return function(_0x2e401c){if(_0x2e401c){return _0x587046[_0x0e16('0x15')](_0x46e24d);}return _0x587046[_0x0e16('0x16')](_0x46e24d)[_0x0e16('0x17')]();};}function respondWithResult(_0x54fd0c,_0x11f23c){_0x11f23c=_0x11f23c||0xc8;return function(_0x3721bc){if(_0x3721bc){return _0x54fd0c[_0x0e16('0x16')](_0x11f23c)[_0x0e16('0x18')](_0x3721bc);}};}function respondWithFilteredResult(_0x17b704,_0x3b6d5f){return function(_0x4acbe9){if(_0x4acbe9){var _0x907389=typeof _0x3b6d5f[_0x0e16('0x19')]===_0x0e16('0x1a')&&typeof _0x3b6d5f[_0x0e16('0x1b')]===_0x0e16('0x1a');var _0x1be886=_0x4acbe9[_0x0e16('0x1c')];var _0x949318=_0x907389?0x0:_0x3b6d5f['offset'];var _0x505b27=_0x907389?_0x4acbe9[_0x0e16('0x1c')]:_0x3b6d5f['offset']+_0x3b6d5f[_0x0e16('0x1b')];var _0x18f7ac;if(_0x505b27>=_0x1be886){_0x505b27=_0x1be886;_0x18f7ac=0xc8;}else{_0x18f7ac=0xce;}_0x17b704[_0x0e16('0x16')](_0x18f7ac);return _0x17b704['set'](_0x0e16('0x1d'),_0x949318+'-'+_0x505b27+'/'+_0x1be886)[_0x0e16('0x18')](_0x4acbe9);}return null;};}function patchUpdates(_0x56b5a0){return function(_0x1e28b4){try{jsonpatch[_0x0e16('0x1e')](_0x1e28b4,_0x56b5a0,!![]);}catch(_0x1e89f7){return BPromise[_0x0e16('0x1f')](_0x1e89f7);}return _0x1e28b4[_0x0e16('0x20')]();};}function saveUpdates(_0x5be77b,_0x748f8c){return function(_0xd9356f){if(_0xd9356f){return _0xd9356f[_0x0e16('0x21')](_0x5be77b)['then'](function(_0x11f6c8){return _0x11f6c8;});}return null;};}function removeEntity(_0x138baf,_0x338279){return function(_0x59f2ce){if(_0x59f2ce){return _0x59f2ce[_0x0e16('0x22')]()['then'](function(){_0x138baf[_0x0e16('0x16')](0xcc)[_0x0e16('0x17')]();});}};}function handleEntityNotFound(_0x8f6312,_0x2c7569){return function(_0x1ccbe4){if(!_0x1ccbe4){_0x8f6312['sendStatus'](0x194);}return _0x1ccbe4;};}function handleError(_0x3859f1,_0x37f179){_0x37f179=_0x37f179||0x1f4;return function(_0x429eef){logger[_0x0e16('0x23')](_0x429eef[_0x0e16('0x24')]);if(_0x429eef['name']){delete _0x429eef[_0x0e16('0x25')];}_0x3859f1[_0x0e16('0x16')](_0x37f179)[_0x0e16('0x26')](_0x429eef);};}exports[_0x0e16('0x27')]=function(_0x55e692,_0x6ba0d5){var _0x5bd141={},_0x4b42cd={},_0x50cbf6={'count':0x0,'rows':[]};var _0x4f1f58=_[_0x0e16('0x28')](db[_0x0e16('0x29')]['rawAttributes'],function(_0x3504f7){return{'name':_0x3504f7[_0x0e16('0x2a')],'type':_0x3504f7[_0x0e16('0x2b')][_0x0e16('0x2c')]};});_0x4b42cd['model']=_[_0x0e16('0x28')](_0x4f1f58,_0x0e16('0x25'));_0x4b42cd[_0x0e16('0x2d')]=_[_0x0e16('0x2e')](_0x55e692[_0x0e16('0x2d')]);_0x4b42cd[_0x0e16('0x2f')]=_[_0x0e16('0x30')](_0x4b42cd['model'],_0x4b42cd['query']);_0x5bd141[_0x0e16('0x31')]=_[_0x0e16('0x30')](_0x4b42cd['model'],qs[_0x0e16('0x32')](_0x55e692[_0x0e16('0x2d')][_0x0e16('0x32')]));_0x5bd141['attributes']=_0x5bd141['attributes'][_0x0e16('0x33')]?_0x5bd141[_0x0e16('0x31')]:_0x4b42cd['model'];if(!_0x55e692[_0x0e16('0x2d')][_0x0e16('0x34')](_0x0e16('0x35'))){_0x5bd141[_0x0e16('0x1b')]=qs[_0x0e16('0x1b')](_0x55e692[_0x0e16('0x2d')][_0x0e16('0x1b')]);_0x5bd141[_0x0e16('0x19')]=qs[_0x0e16('0x19')](_0x55e692[_0x0e16('0x2d')][_0x0e16('0x19')]);}_0x5bd141[_0x0e16('0x36')]=qs[_0x0e16('0x37')](_0x55e692[_0x0e16('0x2d')][_0x0e16('0x37')]);_0x5bd141[_0x0e16('0x38')]=qs[_0x0e16('0x2f')](_['pick'](_0x55e692[_0x0e16('0x2d')],_0x4b42cd[_0x0e16('0x2f')]),_0x4f1f58);if(_0x55e692[_0x0e16('0x2d')][_0x0e16('0x39')]){_0x5bd141[_0x0e16('0x38')]=_[_0x0e16('0x3a')](_0x5bd141['where'],{'$or':_[_0x0e16('0x28')](_0x4f1f58,function(_0x389867){if(_0x389867[_0x0e16('0x2b')]!=='VIRTUAL'){var _0x29ec2e={};_0x29ec2e[_0x389867[_0x0e16('0x25')]]={'$like':'%'+_0x55e692['query']['filter']+'%'};return _0x29ec2e;}})});}_0x5bd141=_['merge']({},_0x5bd141,_0x55e692[_0x0e16('0x3b')]);var _0x3cea16={'where':_0x5bd141[_0x0e16('0x38')]};return db['FreshsalesConfiguration'][_0x0e16('0x1c')](_0x3cea16)['then'](function(_0x3f90f9){_0x50cbf6[_0x0e16('0x1c')]=_0x3f90f9;if(_0x55e692[_0x0e16('0x2d')][_0x0e16('0x3c')]){_0x5bd141['include']=[{'all':!![]}];}return db[_0x0e16('0x29')][_0x0e16('0x3d')](_0x5bd141);})[_0x0e16('0x3e')](function(_0x26adf7){_0x50cbf6['rows']=_0x26adf7;return _0x50cbf6;})[_0x0e16('0x3e')](respondWithFilteredResult(_0x6ba0d5,_0x5bd141))[_0x0e16('0x3f')](handleError(_0x6ba0d5,null));};exports[_0x0e16('0x40')]=function(_0x19055d,_0x2cab05){var _0x464799={'raw':![],'where':{'id':_0x19055d[_0x0e16('0x41')]['id']}},_0x4a92a3={};_0x4a92a3[_0x0e16('0x42')]=_[_0x0e16('0x2e')](db[_0x0e16('0x29')][_0x0e16('0x43')]);_0x4a92a3[_0x0e16('0x2d')]=_[_0x0e16('0x2e')](_0x19055d[_0x0e16('0x2d')]);_0x4a92a3[_0x0e16('0x2f')]=_[_0x0e16('0x30')](_0x4a92a3['model'],_0x4a92a3[_0x0e16('0x2d')]);_0x464799['attributes']=_[_0x0e16('0x30')](_0x4a92a3[_0x0e16('0x42')],qs[_0x0e16('0x32')](_0x19055d[_0x0e16('0x2d')][_0x0e16('0x32')]));_0x464799[_0x0e16('0x31')]=_0x464799[_0x0e16('0x31')][_0x0e16('0x33')]?_0x464799['attributes']:_0x4a92a3[_0x0e16('0x42')];if(_0x19055d[_0x0e16('0x2d')][_0x0e16('0x3c')]){_0x464799[_0x0e16('0x44')]=[{'all':!![]}];}_0x464799=_['merge']({},_0x464799,_0x19055d[_0x0e16('0x3b')]);return db[_0x0e16('0x29')][_0x0e16('0x45')](_0x464799)[_0x0e16('0x3e')](handleEntityNotFound(_0x2cab05,null))[_0x0e16('0x3e')](respondWithResult(_0x2cab05,null))[_0x0e16('0x3f')](handleError(_0x2cab05,null));};exports[_0x0e16('0x46')]=function(_0x6e8e8c,_0x89f1ae){return db[_0x0e16('0x29')]['create'](_0x6e8e8c[_0x0e16('0x47')],{})[_0x0e16('0x3e')](respondWithResult(_0x89f1ae,0xc9))[_0x0e16('0x3f')](handleError(_0x89f1ae,null));};exports[_0x0e16('0x21')]=function(_0x5c8dc1,_0x3f7a11){if(_0x5c8dc1[_0x0e16('0x47')]['id']){delete _0x5c8dc1[_0x0e16('0x47')]['id'];}return db[_0x0e16('0x29')][_0x0e16('0x45')]({'where':{'id':_0x5c8dc1['params']['id']}})[_0x0e16('0x3e')](handleEntityNotFound(_0x3f7a11,null))[_0x0e16('0x3e')](saveUpdates(_0x5c8dc1[_0x0e16('0x47')],null))[_0x0e16('0x3e')](respondWithResult(_0x3f7a11,null))[_0x0e16('0x3f')](handleError(_0x3f7a11,null));};exports[_0x0e16('0x22')]=function(_0x4ff323,_0x1d8b9a){return db[_0x0e16('0x29')][_0x0e16('0x45')]({'where':{'id':_0x4ff323['params']['id']}})[_0x0e16('0x3e')](handleEntityNotFound(_0x1d8b9a,null))['then'](removeEntity(_0x1d8b9a,null))['catch'](handleError(_0x1d8b9a,null));};exports[_0x0e16('0x48')]=function(_0x565069,_0x42081f,_0x6a6968){var _0x297948={};var _0x3bc813={};var _0xa19e03;var _0x182d4a;return db[_0x0e16('0x29')][_0x0e16('0x49')]({'where':{'id':_0x565069[_0x0e16('0x41')]['id']}})[_0x0e16('0x3e')](handleEntityNotFound(_0x42081f,null))[_0x0e16('0x3e')](function(_0x2fd0ed){if(_0x2fd0ed){_0xa19e03=_0x2fd0ed;_0x3bc813['model']=_[_0x0e16('0x2e')](db[_0x0e16('0x4a')][_0x0e16('0x43')]);_0x3bc813[_0x0e16('0x2d')]=_[_0x0e16('0x2e')](_0x565069['query']);_0x3bc813[_0x0e16('0x2f')]=_[_0x0e16('0x30')](_0x3bc813[_0x0e16('0x42')],_0x3bc813[_0x0e16('0x2d')]);_0x297948[_0x0e16('0x31')]=_[_0x0e16('0x30')](_0x3bc813['model'],qs[_0x0e16('0x32')](_0x565069[_0x0e16('0x2d')][_0x0e16('0x32')]));_0x297948[_0x0e16('0x31')]=_0x297948['attributes']['length']?_0x297948['attributes']:_0x3bc813['model'];_0x297948['order']=qs[_0x0e16('0x37')](_0x565069[_0x0e16('0x2d')]['sort']);_0x297948[_0x0e16('0x38')]=qs[_0x0e16('0x2f')](_[_0x0e16('0x4b')](_0x565069['query'],_0x3bc813[_0x0e16('0x2f')]));if(_0x565069[_0x0e16('0x2d')][_0x0e16('0x39')]){_0x297948['where']=_[_0x0e16('0x3a')](_0x297948['where'],{'$or':_[_0x0e16('0x28')](_0x297948[_0x0e16('0x31')],function(_0x5e57c4){var _0x18096b={};_0x18096b[_0x5e57c4]={'$like':'%'+_0x565069[_0x0e16('0x2d')]['filter']+'%'};return _0x18096b;})});}_0x297948=_[_0x0e16('0x3a')]({},_0x297948,_0x565069[_0x0e16('0x3b')]);return _0xa19e03['getSubjects'](_0x297948);}})['then'](function(_0x5f15ec){if(_0x5f15ec){_0x182d4a=_0x5f15ec['length'];if(!_0x565069['query'][_0x0e16('0x34')]('nolimit')){_0x297948[_0x0e16('0x1b')]=qs['limit'](_0x565069[_0x0e16('0x2d')][_0x0e16('0x1b')]);_0x297948[_0x0e16('0x19')]=qs[_0x0e16('0x19')](_0x565069[_0x0e16('0x2d')][_0x0e16('0x19')]);}return _0xa19e03['getSubjects'](_0x297948);}})[_0x0e16('0x3e')](function(_0x33319e){if(_0x33319e){return _0x33319e?{'count':_0x182d4a,'rows':_0x33319e}:null;}})['then'](respondWithResult(_0x42081f,null))['catch'](handleError(_0x42081f,null));};exports[_0x0e16('0x4c')]=function(_0xafd8f3,_0x550eac,_0x3b1f13){var _0x28b38b={};var _0x378a18={};var _0x196ff8;var _0x4c6ee9;return db[_0x0e16('0x29')][_0x0e16('0x49')]({'where':{'id':_0xafd8f3[_0x0e16('0x41')]['id']}})[_0x0e16('0x3e')](handleEntityNotFound(_0x550eac,null))[_0x0e16('0x3e')](function(_0x43c3af){if(_0x43c3af){_0x196ff8=_0x43c3af;_0x378a18[_0x0e16('0x42')]=_[_0x0e16('0x2e')](db[_0x0e16('0x4a')][_0x0e16('0x43')]);_0x378a18[_0x0e16('0x2d')]=_[_0x0e16('0x2e')](_0xafd8f3[_0x0e16('0x2d')]);_0x378a18[_0x0e16('0x2f')]=_['intersection'](_0x378a18[_0x0e16('0x42')],_0x378a18[_0x0e16('0x2d')]);_0x28b38b[_0x0e16('0x31')]=_[_0x0e16('0x30')](_0x378a18[_0x0e16('0x42')],qs[_0x0e16('0x32')](_0xafd8f3['query'][_0x0e16('0x32')]));_0x28b38b[_0x0e16('0x31')]=_0x28b38b[_0x0e16('0x31')]['length']?_0x28b38b[_0x0e16('0x31')]:_0x378a18[_0x0e16('0x42')];_0x28b38b[_0x0e16('0x36')]=qs['sort'](_0xafd8f3[_0x0e16('0x2d')][_0x0e16('0x37')]);_0x28b38b[_0x0e16('0x38')]=qs['filters'](_[_0x0e16('0x4b')](_0xafd8f3[_0x0e16('0x2d')],_0x378a18[_0x0e16('0x2f')]));if(_0xafd8f3[_0x0e16('0x2d')]['filter']){_0x28b38b[_0x0e16('0x38')]=_[_0x0e16('0x3a')](_0x28b38b[_0x0e16('0x38')],{'$or':_[_0x0e16('0x28')](_0x28b38b[_0x0e16('0x31')],function(_0x2bbaff){var _0x244cd1={};_0x244cd1[_0x2bbaff]={'$like':'%'+_0xafd8f3[_0x0e16('0x2d')][_0x0e16('0x39')]+'%'};return _0x244cd1;})});}_0x28b38b=_[_0x0e16('0x3a')]({},_0x28b38b,_0xafd8f3[_0x0e16('0x3b')]);return _0x196ff8['getDescriptions'](_0x28b38b);}})[_0x0e16('0x3e')](function(_0x15c324){if(_0x15c324){_0x4c6ee9=_0x15c324[_0x0e16('0x33')];if(!_0xafd8f3[_0x0e16('0x2d')][_0x0e16('0x34')]('nolimit')){_0x28b38b[_0x0e16('0x1b')]=qs[_0x0e16('0x1b')](_0xafd8f3[_0x0e16('0x2d')][_0x0e16('0x1b')]);_0x28b38b[_0x0e16('0x19')]=qs[_0x0e16('0x19')](_0xafd8f3[_0x0e16('0x2d')][_0x0e16('0x19')]);}return _0x196ff8[_0x0e16('0x4c')](_0x28b38b);}})[_0x0e16('0x3e')](function(_0x14a8b4){if(_0x14a8b4){return _0x14a8b4?{'count':_0x4c6ee9,'rows':_0x14a8b4}:null;}})[_0x0e16('0x3e')](respondWithResult(_0x550eac,null))[_0x0e16('0x3f')](handleError(_0x550eac,null));};exports[_0x0e16('0x4d')]=function(_0x449aac,_0xaa27e4,_0x37457e){var _0x31210d={};var _0x52de23={};var _0x250629;var _0x1706df;return db[_0x0e16('0x29')][_0x0e16('0x49')]({'where':{'id':_0x449aac['params']['id']}})[_0x0e16('0x3e')](handleEntityNotFound(_0xaa27e4,null))[_0x0e16('0x3e')](function(_0x2f0b4f){if(_0x2f0b4f){_0x250629=_0x2f0b4f;_0x52de23['model']=_[_0x0e16('0x2e')](db[_0x0e16('0x4a')][_0x0e16('0x43')]);_0x52de23[_0x0e16('0x2d')]=_['keys'](_0x449aac[_0x0e16('0x2d')]);_0x52de23[_0x0e16('0x2f')]=_['intersection'](_0x52de23[_0x0e16('0x42')],_0x52de23['query']);_0x31210d[_0x0e16('0x31')]=_[_0x0e16('0x30')](_0x52de23['model'],qs['fields'](_0x449aac[_0x0e16('0x2d')][_0x0e16('0x32')]));_0x31210d[_0x0e16('0x31')]=_0x31210d['attributes']['length']?_0x31210d['attributes']:_0x52de23[_0x0e16('0x42')];_0x31210d[_0x0e16('0x36')]=qs[_0x0e16('0x37')](_0x449aac['query'][_0x0e16('0x37')]);_0x31210d['where']=qs[_0x0e16('0x2f')](_['pick'](_0x449aac['query'],_0x52de23[_0x0e16('0x2f')]));if(_0x449aac[_0x0e16('0x2d')][_0x0e16('0x39')]){_0x31210d[_0x0e16('0x38')]=_[_0x0e16('0x3a')](_0x31210d[_0x0e16('0x38')],{'$or':_[_0x0e16('0x28')](_0x31210d[_0x0e16('0x31')],function(_0x34ed07){var _0x61d103={};_0x61d103[_0x34ed07]={'$like':'%'+_0x449aac[_0x0e16('0x2d')]['filter']+'%'};return _0x61d103;})});}_0x31210d=_['merge']({},_0x31210d,_0x449aac[_0x0e16('0x3b')]);return _0x250629[_0x0e16('0x4d')](_0x31210d);}})['then'](function(_0x1e742f){if(_0x1e742f){_0x1706df=_0x1e742f[_0x0e16('0x33')];if(!_0x449aac['query']['hasOwnProperty'](_0x0e16('0x35'))){_0x31210d['limit']=qs['limit'](_0x449aac[_0x0e16('0x2d')][_0x0e16('0x1b')]);_0x31210d[_0x0e16('0x19')]=qs[_0x0e16('0x19')](_0x449aac[_0x0e16('0x2d')]['offset']);}return _0x250629[_0x0e16('0x4d')](_0x31210d);}})[_0x0e16('0x3e')](function(_0x35c12f){if(_0x35c12f){return _0x35c12f?{'count':_0x1706df,'rows':_0x35c12f}:null;}})[_0x0e16('0x3e')](respondWithResult(_0xaa27e4,null))[_0x0e16('0x3f')](handleError(_0xaa27e4,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index f7c8929..7732ea3 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 _0xb8c3=['FreshsalesConfiguration','util','../../config/logger','api','moment','request-promise','path','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8c3,0x1f0));var _0x3b8c=function(_0x3ad721,_0x4b7de5){_0x3ad721=_0x3ad721-0x0;var _0x52b183=_0xb8c3[_0x3ad721];return _0x52b183;};'use strict';var _=require('lodash');var util=require(_0x3b8c('0x0'));var logger=require(_0x3b8c('0x1'))(_0x3b8c('0x2'));var moment=require(_0x3b8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b8c('0x4'));var fs=require('fs');var path=require(_0x3b8c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x3b8c('0x6')]=function(_0x167a77,_0x94c781){return _0x167a77[_0x3b8c('0x7')](_0x3b8c('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5753=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x4df69e,_0x5131d5){var _0x1f9041=function(_0x1e6288){while(--_0x1e6288){_0x4df69e['push'](_0x4df69e['shift']());}};_0x1f9041(++_0x5131d5);}(_0x5753,0xb2));var _0x3575=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5753[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3575('0x0'));var util=require(_0x3575('0x1'));var logger=require(_0x3575('0x2'))(_0x3575('0x3'));var moment=require(_0x3575('0x4'));var BPromise=require(_0x3575('0x5'));var rp=require(_0x3575('0x6'));var fs=require('fs');var path=require(_0x3575('0x7'));var rimraf=require(_0x3575('0x8'));var config=require(_0x3575('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x3575('0xa')]=function(_0x25529f,_0x1309c9){return _0x25529f[_0x3575('0xb')](_0x3575('0xc'),attributes,{'tableName':_0x3575('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 68d3508..f284906 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 _0x50db=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x1b2618,_0x1b1af3){var _0x37de91=function(_0xbbb3a5){while(--_0xbbb3a5){_0x1b2618['push'](_0x1b2618['shift']());}};_0x37de91(++_0x1b1af3);}(_0x50db,0x13c));var _0xb50d=function(_0x279dfb,_0x5ddaeb){_0x279dfb=_0x279dfb-0x0;var _0x927888=_0x50db[_0x279dfb];return _0x927888;};'use strict';var _=require(_0xb50d('0x0'));var util=require(_0xb50d('0x1'));var moment=require(_0xb50d('0x2'));var BPromise=require(_0xb50d('0x3'));var rs=require(_0xb50d('0x4'));var fs=require('fs');var Redis=require(_0xb50d('0x5'));var db=require(_0xb50d('0x6'))['db'];var utils=require(_0xb50d('0x7'));var logger=require('../../config/logger')(_0xb50d('0x8'));var config=require(_0xb50d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb50d('0xa')][_0xb50d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x355685,_0x20e987,_0x23e7ee){return new BPromise(function(_0x46d987,_0x2bc209){return client['request'](_0x355685,_0x23e7ee)['then'](function(_0x4692a0){logger[_0xb50d('0xc')](_0xb50d('0xd'),_0x20e987,_0xb50d('0xe'));logger['debug'](_0xb50d('0xf'),_0x20e987,_0xb50d('0xe'),JSON[_0xb50d('0x10')](_0x4692a0));if(_0x4692a0[_0xb50d('0x11')]){if(_0x4692a0[_0xb50d('0x11')]['code']===0x1f4){logger[_0xb50d('0x11')](_0xb50d('0xd'),_0x20e987,_0x4692a0['error'][_0xb50d('0x12')]);return _0x2bc209(_0x4692a0['error'][_0xb50d('0x12')]);}logger[_0xb50d('0x11')](_0xb50d('0xd'),_0x20e987,_0x4692a0[_0xb50d('0x11')][_0xb50d('0x12')]);return _0x46d987(_0x4692a0[_0xb50d('0x11')][_0xb50d('0x12')]);}else{logger[_0xb50d('0xc')](_0xb50d('0xd'),_0x20e987,_0xb50d('0xe'));_0x46d987(_0x4692a0[_0xb50d('0x13')][_0xb50d('0x12')]);}})['catch'](function(_0xf67131){logger[_0xb50d('0x11')](_0xb50d('0xd'),_0x20e987,_0xf67131);_0x2bc209(_0xf67131);});});} \ No newline at end of file +var _0x163b=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x49120f,_0x27ce4f){var _0x2521c0=function(_0x1368b6){while(--_0x1368b6){_0x49120f['push'](_0x49120f['shift']());}};_0x2521c0(++_0x27ce4f);}(_0x163b,0xa1));var _0xb163=function(_0x3c3324,_0x117301){_0x3c3324=_0x3c3324-0x0;var _0x5c942=_0x163b[_0x3c3324];return _0x5c942;};'use strict';var _=require('lodash');var util=require(_0xb163('0x0'));var moment=require(_0xb163('0x1'));var BPromise=require(_0xb163('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb163('0x3'));var db=require(_0xb163('0x4'))['db'];var utils=require(_0xb163('0x5'));var logger=require(_0xb163('0x6'))(_0xb163('0x7'));var config=require('../../config/environment');var jayson=require(_0xb163('0x8'));var client=jayson[_0xb163('0x9')][_0xb163('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a7ac,_0x26efd5,_0x16acf5){return new BPromise(function(_0x36e47a,_0x2dd376){return client[_0xb163('0xb')](_0x28a7ac,_0x16acf5)[_0xb163('0xc')](function(_0x9ca971){logger[_0xb163('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x26efd5,_0xb163('0xe'));logger[_0xb163('0xf')](_0xb163('0x10'),_0x26efd5,_0xb163('0xe'),JSON['stringify'](_0x9ca971));if(_0x9ca971['error']){if(_0x9ca971[_0xb163('0x11')][_0xb163('0x12')]===0x1f4){logger[_0xb163('0x11')](_0xb163('0x13'),_0x26efd5,_0x9ca971['error'][_0xb163('0x14')]);return _0x2dd376(_0x9ca971[_0xb163('0x11')][_0xb163('0x14')]);}logger[_0xb163('0x11')](_0xb163('0x13'),_0x26efd5,_0x9ca971[_0xb163('0x11')][_0xb163('0x14')]);return _0x36e47a(_0x9ca971[_0xb163('0x11')][_0xb163('0x14')]);}else{logger[_0xb163('0xd')](_0xb163('0x13'),_0x26efd5,_0xb163('0xe'));_0x36e47a(_0x9ca971['result']['message']);}})[_0xb163('0x15')](function(_0x7af8d0){logger[_0xb163('0x11')](_0xb163('0x13'),_0x26efd5,_0x7af8d0);_0x2dd376(_0x7af8d0);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 522421a..e6eccf7 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 _0xb48d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','create','/:id','destroy','multer','path'];(function(_0x5de7be,_0x51575a){var _0x21b73e=function(_0x2d12a1){while(--_0x2d12a1){_0x5de7be['push'](_0x5de7be['shift']());}};_0x21b73e(++_0x51575a);}(_0xb48d,0x194));var _0xdb48=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb48d[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0xdb48('0x0'));var util=require('util');var path=require(_0xdb48('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb48('0x2'));var router=express[_0xdb48('0x3')]();var fs_extra=require(_0xdb48('0x4'));var auth=require(_0xdb48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdb48('0x6'));var controller=require('./intFreshsalesField.controller');router[_0xdb48('0x7')]('/',auth[_0xdb48('0x8')](),controller[_0xdb48('0x9')]);router['get']('/:id',auth[_0xdb48('0x8')](),controller[_0xdb48('0xa')]);router['post']('/',auth[_0xdb48('0x8')](),controller[_0xdb48('0xb')]);router['put'](_0xdb48('0xc'),auth[_0xdb48('0x8')](),controller['update']);router['delete'](_0xdb48('0xc'),auth[_0xdb48('0x8')](),controller[_0xdb48('0xd')]);module['exports']=router; \ No newline at end of file +var _0x86f5=['delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x3104f7,_0x1ad291){var _0x4b52cc=function(_0x2c882e){while(--_0x2c882e){_0x3104f7['push'](_0x3104f7['shift']());}};_0x4b52cc(++_0x1ad291);}(_0x86f5,0x178));var _0x586f=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0x86f5[_0x49588f];return _0x41b293;};'use strict';var multer=require(_0x586f('0x0'));var util=require('util');var path=require(_0x586f('0x1'));var timeout=require(_0x586f('0x2'));var express=require('express');var router=express[_0x586f('0x3')]();var fs_extra=require(_0x586f('0x4'));var auth=require(_0x586f('0x5'));var interaction=require(_0x586f('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0x586f('0x7')]('/',auth[_0x586f('0x8')](),controller[_0x586f('0x9')]);router['get'](_0x586f('0xa'),auth[_0x586f('0x8')](),controller[_0x586f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x586f('0xc')]);router[_0x586f('0xd')](_0x586f('0xa'),auth[_0x586f('0x8')](),controller[_0x586f('0xe')]);router[_0x586f('0xf')](_0x586f('0xa'),auth['isAuthenticated'](),controller[_0x586f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index f0fd526..8aa2cac 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 _0x3513=['string','variable','picklist','STRING','customVariable','ENUM'];(function(_0x4eb58d,_0x4f21e7){var _0x1e6669=function(_0x1f7511){while(--_0x1f7511){_0x4eb58d['push'](_0x4eb58d['shift']());}};_0x1e6669(++_0x4f21e7);}(_0x3513,0x119));var _0x3351=function(_0x52e993,_0x2c72f1){_0x52e993=_0x52e993-0x0;var _0x518d41=_0x3513[_0x52e993];return _0x518d41;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3351('0x0')](_0x3351('0x1'),_0x3351('0x2'),'customVariable','keyValue',_0x3351('0x3')),'defaultValue':_0x3351('0x1')},'content':{'type':Sequelize[_0x3351('0x4')]},'key':{'type':Sequelize[_0x3351('0x4')]},'keyType':{'type':Sequelize[_0x3351('0x0')](_0x3351('0x1'),'variable',_0x3351('0x5'))},'keyContent':{'type':Sequelize[_0x3351('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3351('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x78e7=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x1f22ad,_0x347fd4){var _0xb98b18=function(_0x12e370){while(--_0x12e370){_0x1f22ad['push'](_0x1f22ad['shift']());}};_0xb98b18(++_0x347fd4);}(_0x78e7,0x17d));var _0x778e=function(_0x1ed676,_0x114563){_0x1ed676=_0x1ed676-0x0;var _0x2136a7=_0x78e7[_0x1ed676];return _0x2136a7;};'use strict';var Sequelize=require(_0x778e('0x0'));module[_0x778e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x778e('0x2'),_0x778e('0x3'),_0x778e('0x4'),_0x778e('0x5'),_0x778e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x778e('0x7')]},'keyType':{'type':Sequelize[_0x778e('0x8')](_0x778e('0x2'),_0x778e('0x3'),_0x778e('0x4'))},'keyContent':{'type':Sequelize[_0x778e('0x7')]},'idField':{'type':Sequelize[_0x778e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x778e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x778e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 93d805f..1dd0a97 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 _0xd345=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','type','merge','FreshsalesField','includeAll','findAll','rows','params','find','catch','create'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xd345,0x15f));var _0x5d34=function(_0x38250d,_0x5a2e9b){_0x38250d=_0x38250d-0x0;var _0x3a313b=_0xd345[_0x38250d];return _0x3a313b;};'use strict';var emlformat=require(_0x5d34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d34('0x1'));var jsonpatch=require(_0x5d34('0x2'));var rp=require(_0x5d34('0x3'));var moment=require(_0x5d34('0x4'));var BPromise=require(_0x5d34('0x5'));var Mustache=require(_0x5d34('0x6'));var util=require(_0x5d34('0x7'));var path=require('path');var sox=require(_0x5d34('0x8'));var csv=require(_0x5d34('0x9'));var ejs=require(_0x5d34('0xa'));var fs=require('fs');var fs_extra=require(_0x5d34('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5d34('0xc'));var jsforce=require(_0x5d34('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d34('0x9'));var querystring=require(_0x5d34('0xe'));var Papa=require(_0x5d34('0xf'));var Redis=require(_0x5d34('0x10'));var authService=require(_0x5d34('0x11'));var qs=require(_0x5d34('0x12'));var as=require(_0x5d34('0x13'));var hardwareService=require(_0x5d34('0x14'));var logger=require('../../config/logger')(_0x5d34('0x15'));var utils=require('../../config/utils');var config=require(_0x5d34('0x16'));var licenseUtil=require(_0x5d34('0x17'));var db=require(_0x5d34('0x18'))['db'];function respondWithStatusCode(_0x3ec45b,_0x4f9e57){_0x4f9e57=_0x4f9e57||0xcc;return function(_0x288bce){if(_0x288bce){return _0x3ec45b[_0x5d34('0x19')](_0x4f9e57);}return _0x3ec45b[_0x5d34('0x1a')](_0x4f9e57)[_0x5d34('0x1b')]();};}function respondWithResult(_0xee92e9,_0x257361){_0x257361=_0x257361||0xc8;return function(_0x4c13cd){if(_0x4c13cd){return _0xee92e9[_0x5d34('0x1a')](_0x257361)[_0x5d34('0x1c')](_0x4c13cd);}};}function respondWithFilteredResult(_0x220e70,_0x155cdf){return function(_0x58c2b6){if(_0x58c2b6){var _0x5adf96=typeof _0x155cdf[_0x5d34('0x1d')]==='undefined'&&typeof _0x155cdf[_0x5d34('0x1e')]==='undefined';var _0x2a8eff=_0x58c2b6[_0x5d34('0x1f')];var _0x423db4=_0x5adf96?0x0:_0x155cdf[_0x5d34('0x1d')];var _0x4853ef=_0x5adf96?_0x58c2b6[_0x5d34('0x1f')]:_0x155cdf[_0x5d34('0x1d')]+_0x155cdf[_0x5d34('0x1e')];var _0x383e99;if(_0x4853ef>=_0x2a8eff){_0x4853ef=_0x2a8eff;_0x383e99=0xc8;}else{_0x383e99=0xce;}_0x220e70['status'](_0x383e99);return _0x220e70[_0x5d34('0x20')](_0x5d34('0x21'),_0x423db4+'-'+_0x4853ef+'/'+_0x2a8eff)['json'](_0x58c2b6);}return null;};}function patchUpdates(_0x221b89){return function(_0x189d23){try{jsonpatch['apply'](_0x189d23,_0x221b89,!![]);}catch(_0x45ec34){return BPromise['reject'](_0x45ec34);}return _0x189d23[_0x5d34('0x22')]();};}function saveUpdates(_0x41ae7e,_0x825429){return function(_0x262457){if(_0x262457){return _0x262457[_0x5d34('0x23')](_0x41ae7e)[_0x5d34('0x24')](function(_0x363a7e){return _0x363a7e;});}return null;};}function removeEntity(_0x4257e0,_0x37b536){return function(_0x10f213){if(_0x10f213){return _0x10f213[_0x5d34('0x25')]()[_0x5d34('0x24')](function(){_0x4257e0[_0x5d34('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4bef,_0x16e4d3){return function(_0x5dfe5d){if(!_0x5dfe5d){_0x2a4bef[_0x5d34('0x19')](0x194);}return _0x5dfe5d;};}function handleError(_0x334b65,_0x3d89c5){_0x3d89c5=_0x3d89c5||0x1f4;return function(_0xc8b1c4){logger[_0x5d34('0x26')](_0xc8b1c4['stack']);if(_0xc8b1c4['name']){delete _0xc8b1c4[_0x5d34('0x27')];}_0x334b65[_0x5d34('0x1a')](_0x3d89c5)['send'](_0xc8b1c4);};}exports[_0x5d34('0x28')]=function(_0x387b35,_0x5c8828){var _0x157382={},_0x23eca9={},_0x4e5b5b={'count':0x0,'rows':[]};var _0x5aaede=_[_0x5d34('0x29')](db['FreshsalesField'][_0x5d34('0x2a')],function(_0x5d2492){return{'name':_0x5d2492[_0x5d34('0x2b')],'type':_0x5d2492['type'][_0x5d34('0x2c')]};});_0x23eca9[_0x5d34('0x2d')]=_[_0x5d34('0x29')](_0x5aaede,_0x5d34('0x27'));_0x23eca9[_0x5d34('0x2e')]=_[_0x5d34('0x2f')](_0x387b35[_0x5d34('0x2e')]);_0x23eca9['filters']=_['intersection'](_0x23eca9[_0x5d34('0x2d')],_0x23eca9['query']);_0x157382[_0x5d34('0x30')]=_[_0x5d34('0x31')](_0x23eca9[_0x5d34('0x2d')],qs[_0x5d34('0x32')](_0x387b35[_0x5d34('0x2e')][_0x5d34('0x32')]));_0x157382[_0x5d34('0x30')]=_0x157382[_0x5d34('0x30')][_0x5d34('0x33')]?_0x157382[_0x5d34('0x30')]:_0x23eca9['model'];if(!_0x387b35[_0x5d34('0x2e')][_0x5d34('0x34')]('nolimit')){_0x157382[_0x5d34('0x1e')]=qs[_0x5d34('0x1e')](_0x387b35['query']['limit']);_0x157382['offset']=qs['offset'](_0x387b35['query'][_0x5d34('0x1d')]);}_0x157382[_0x5d34('0x35')]=qs['sort'](_0x387b35['query'][_0x5d34('0x36')]);_0x157382['where']=qs['filters'](_[_0x5d34('0x37')](_0x387b35[_0x5d34('0x2e')],_0x23eca9[_0x5d34('0x38')]),_0x5aaede);if(_0x387b35[_0x5d34('0x2e')][_0x5d34('0x39')]){_0x157382[_0x5d34('0x3a')]=_['merge'](_0x157382[_0x5d34('0x3a')],{'$or':_['map'](_0x5aaede,function(_0x3c7b46){if(_0x3c7b46[_0x5d34('0x3b')]!=='VIRTUAL'){var _0x28a659={};_0x28a659[_0x3c7b46[_0x5d34('0x27')]]={'$like':'%'+_0x387b35[_0x5d34('0x2e')][_0x5d34('0x39')]+'%'};return _0x28a659;}})});}_0x157382=_[_0x5d34('0x3c')]({},_0x157382,_0x387b35['options']);var _0x2592c6={'where':_0x157382[_0x5d34('0x3a')]};return db[_0x5d34('0x3d')][_0x5d34('0x1f')](_0x2592c6)[_0x5d34('0x24')](function(_0x213765){_0x4e5b5b[_0x5d34('0x1f')]=_0x213765;if(_0x387b35[_0x5d34('0x2e')][_0x5d34('0x3e')]){_0x157382['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x5d34('0x3f')](_0x157382);})[_0x5d34('0x24')](function(_0x38c56b){_0x4e5b5b[_0x5d34('0x40')]=_0x38c56b;return _0x4e5b5b;})[_0x5d34('0x24')](respondWithFilteredResult(_0x5c8828,_0x157382))['catch'](handleError(_0x5c8828,null));};exports['show']=function(_0x4734f9,_0x4d8be4){var _0x2fde0e={'raw':!![],'where':{'id':_0x4734f9[_0x5d34('0x41')]['id']}},_0x30bd32={};_0x30bd32[_0x5d34('0x2d')]=_['keys'](db[_0x5d34('0x3d')][_0x5d34('0x2a')]);_0x30bd32[_0x5d34('0x2e')]=_[_0x5d34('0x2f')](_0x4734f9[_0x5d34('0x2e')]);_0x30bd32[_0x5d34('0x38')]=_[_0x5d34('0x31')](_0x30bd32['model'],_0x30bd32['query']);_0x2fde0e[_0x5d34('0x30')]=_['intersection'](_0x30bd32['model'],qs[_0x5d34('0x32')](_0x4734f9[_0x5d34('0x2e')][_0x5d34('0x32')]));_0x2fde0e[_0x5d34('0x30')]=_0x2fde0e[_0x5d34('0x30')][_0x5d34('0x33')]?_0x2fde0e[_0x5d34('0x30')]:_0x30bd32['model'];if(_0x4734f9[_0x5d34('0x2e')][_0x5d34('0x3e')]){_0x2fde0e['include']=[{'all':!![]}];}_0x2fde0e=_[_0x5d34('0x3c')]({},_0x2fde0e,_0x4734f9['options']);return db[_0x5d34('0x3d')][_0x5d34('0x42')](_0x2fde0e)[_0x5d34('0x24')](handleEntityNotFound(_0x4d8be4,null))[_0x5d34('0x24')](respondWithResult(_0x4d8be4,null))[_0x5d34('0x43')](handleError(_0x4d8be4,null));};exports[_0x5d34('0x44')]=function(_0x4462b8,_0x265a41){return db[_0x5d34('0x3d')][_0x5d34('0x44')](_0x4462b8['body'],{})[_0x5d34('0x24')](respondWithResult(_0x265a41,0xc9))[_0x5d34('0x43')](handleError(_0x265a41,null));};exports[_0x5d34('0x23')]=function(_0x48f6a3,_0x8de2de){if(_0x48f6a3[_0x5d34('0x45')]['id']){delete _0x48f6a3[_0x5d34('0x45')]['id'];}return db[_0x5d34('0x3d')][_0x5d34('0x42')]({'where':{'id':_0x48f6a3['params']['id']}})[_0x5d34('0x24')](handleEntityNotFound(_0x8de2de,null))[_0x5d34('0x24')](saveUpdates(_0x48f6a3['body'],null))[_0x5d34('0x24')](respondWithResult(_0x8de2de,null))[_0x5d34('0x43')](handleError(_0x8de2de,null));};exports[_0x5d34('0x25')]=function(_0x3a5637,_0x3361fd){return db['FreshsalesField']['find']({'where':{'id':_0x3a5637[_0x5d34('0x41')]['id']}})['then'](handleEntityNotFound(_0x3361fd,null))[_0x5d34('0x24')](removeEntity(_0x3361fd,null))[_0x5d34('0x43')](handleError(_0x3361fd,null));}; \ No newline at end of file +var _0x3d1f=['length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','FreshsalesField','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x166929,_0x5c9c88){var _0x13e835=function(_0x24904a){while(--_0x24904a){_0x166929['push'](_0x166929['shift']());}};_0x13e835(++_0x5c9c88);}(_0x3d1f,0xf6));var _0xf3d1=function(_0x22dee4,_0x2cf1a8){_0x22dee4=_0x22dee4-0x0;var _0x562166=_0x3d1f[_0x22dee4];return _0x562166;};'use strict';var emlformat=require(_0xf3d1('0x0'));var rimraf=require(_0xf3d1('0x1'));var zipdir=require(_0xf3d1('0x2'));var jsonpatch=require(_0xf3d1('0x3'));var rp=require(_0xf3d1('0x4'));var moment=require(_0xf3d1('0x5'));var BPromise=require(_0xf3d1('0x6'));var Mustache=require('mustache');var util=require(_0xf3d1('0x7'));var path=require(_0xf3d1('0x8'));var sox=require(_0xf3d1('0x9'));var csv=require('to-csv');var ejs=require(_0xf3d1('0xa'));var fs=require('fs');var fs_extra=require(_0xf3d1('0xb'));var _=require('lodash');var squel=require(_0xf3d1('0xc'));var crypto=require(_0xf3d1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf3d1('0xe'));var toCsv=require(_0xf3d1('0xf'));var querystring=require(_0xf3d1('0x10'));var Papa=require(_0xf3d1('0x11'));var Redis=require(_0xf3d1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf3d1('0x13'));var as=require(_0xf3d1('0x14'));var hardwareService=require(_0xf3d1('0x15'));var logger=require('../../config/logger')(_0xf3d1('0x16'));var utils=require('../../config/utils');var config=require(_0xf3d1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3d1('0x18'))['db'];function respondWithStatusCode(_0x2dcbbd,_0x23e1df){_0x23e1df=_0x23e1df||0xcc;return function(_0x2c4906){if(_0x2c4906){return _0x2dcbbd['sendStatus'](_0x23e1df);}return _0x2dcbbd['status'](_0x23e1df)[_0xf3d1('0x19')]();};}function respondWithResult(_0x20f040,_0x135753){_0x135753=_0x135753||0xc8;return function(_0x17db83){if(_0x17db83){return _0x20f040[_0xf3d1('0x1a')](_0x135753)['json'](_0x17db83);}};}function respondWithFilteredResult(_0x4113ca,_0x5bf9b5){return function(_0x543d32){if(_0x543d32){var _0x9a1bff=typeof _0x5bf9b5[_0xf3d1('0x1b')]===_0xf3d1('0x1c')&&typeof _0x5bf9b5[_0xf3d1('0x1d')]===_0xf3d1('0x1c');var _0x38b856=_0x543d32[_0xf3d1('0x1e')];var _0x4b03ed=_0x9a1bff?0x0:_0x5bf9b5['offset'];var _0x2f058c=_0x9a1bff?_0x543d32[_0xf3d1('0x1e')]:_0x5bf9b5[_0xf3d1('0x1b')]+_0x5bf9b5['limit'];var _0x2e43e0;if(_0x2f058c>=_0x38b856){_0x2f058c=_0x38b856;_0x2e43e0=0xc8;}else{_0x2e43e0=0xce;}_0x4113ca[_0xf3d1('0x1a')](_0x2e43e0);return _0x4113ca[_0xf3d1('0x1f')](_0xf3d1('0x20'),_0x4b03ed+'-'+_0x2f058c+'/'+_0x38b856)[_0xf3d1('0x21')](_0x543d32);}return null;};}function patchUpdates(_0x4d6c9a){return function(_0x1fe78c){try{jsonpatch['apply'](_0x1fe78c,_0x4d6c9a,!![]);}catch(_0x42ca09){return BPromise['reject'](_0x42ca09);}return _0x1fe78c[_0xf3d1('0x22')]();};}function saveUpdates(_0x3be49c,_0x479940){return function(_0x2076fc){if(_0x2076fc){return _0x2076fc[_0xf3d1('0x23')](_0x3be49c)['then'](function(_0x529b49){return _0x529b49;});}return null;};}function removeEntity(_0x38cd5c,_0x212491){return function(_0x59299c){if(_0x59299c){return _0x59299c[_0xf3d1('0x24')]()['then'](function(){_0x38cd5c[_0xf3d1('0x1a')](0xcc)[_0xf3d1('0x19')]();});}};}function handleEntityNotFound(_0x220013,_0x2bf135){return function(_0x4b53fc){if(!_0x4b53fc){_0x220013[_0xf3d1('0x25')](0x194);}return _0x4b53fc;};}function handleError(_0x54bc0b,_0x14d3ea){_0x14d3ea=_0x14d3ea||0x1f4;return function(_0x252e01){logger[_0xf3d1('0x26')](_0x252e01[_0xf3d1('0x27')]);if(_0x252e01['name']){delete _0x252e01['name'];}_0x54bc0b[_0xf3d1('0x1a')](_0x14d3ea)[_0xf3d1('0x28')](_0x252e01);};}exports[_0xf3d1('0x29')]=function(_0x2329f0,_0x8dcf5c){var _0xd76e67={},_0x55dd08={},_0x39a89d={'count':0x0,'rows':[]};var _0x281d19=_[_0xf3d1('0x2a')](db['FreshsalesField'][_0xf3d1('0x2b')],function(_0x41fee3){return{'name':_0x41fee3[_0xf3d1('0x2c')],'type':_0x41fee3[_0xf3d1('0x2d')][_0xf3d1('0x2e')]};});_0x55dd08[_0xf3d1('0x2f')]=_[_0xf3d1('0x2a')](_0x281d19,'name');_0x55dd08[_0xf3d1('0x30')]=_[_0xf3d1('0x31')](_0x2329f0['query']);_0x55dd08[_0xf3d1('0x32')]=_[_0xf3d1('0x33')](_0x55dd08[_0xf3d1('0x2f')],_0x55dd08[_0xf3d1('0x30')]);_0xd76e67['attributes']=_[_0xf3d1('0x33')](_0x55dd08[_0xf3d1('0x2f')],qs[_0xf3d1('0x34')](_0x2329f0[_0xf3d1('0x30')][_0xf3d1('0x34')]));_0xd76e67['attributes']=_0xd76e67[_0xf3d1('0x35')][_0xf3d1('0x36')]?_0xd76e67[_0xf3d1('0x35')]:_0x55dd08['model'];if(!_0x2329f0[_0xf3d1('0x30')][_0xf3d1('0x37')](_0xf3d1('0x38'))){_0xd76e67['limit']=qs['limit'](_0x2329f0['query']['limit']);_0xd76e67[_0xf3d1('0x1b')]=qs[_0xf3d1('0x1b')](_0x2329f0[_0xf3d1('0x30')][_0xf3d1('0x1b')]);}_0xd76e67[_0xf3d1('0x39')]=qs[_0xf3d1('0x3a')](_0x2329f0[_0xf3d1('0x30')][_0xf3d1('0x3a')]);_0xd76e67['where']=qs[_0xf3d1('0x32')](_[_0xf3d1('0x3b')](_0x2329f0[_0xf3d1('0x30')],_0x55dd08[_0xf3d1('0x32')]),_0x281d19);if(_0x2329f0[_0xf3d1('0x30')]['filter']){_0xd76e67[_0xf3d1('0x3c')]=_[_0xf3d1('0x3d')](_0xd76e67['where'],{'$or':_[_0xf3d1('0x2a')](_0x281d19,function(_0x514e54){if(_0x514e54[_0xf3d1('0x2d')]!=='VIRTUAL'){var _0x32db8a={};_0x32db8a[_0x514e54['name']]={'$like':'%'+_0x2329f0['query']['filter']+'%'};return _0x32db8a;}})});}_0xd76e67=_['merge']({},_0xd76e67,_0x2329f0[_0xf3d1('0x3e')]);var _0x24cc55={'where':_0xd76e67[_0xf3d1('0x3c')]};return db[_0xf3d1('0x3f')][_0xf3d1('0x1e')](_0x24cc55)[_0xf3d1('0x40')](function(_0x243f75){_0x39a89d['count']=_0x243f75;if(_0x2329f0[_0xf3d1('0x30')][_0xf3d1('0x41')]){_0xd76e67[_0xf3d1('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0xf3d1('0x43')](_0xd76e67);})[_0xf3d1('0x40')](function(_0x37dbff){_0x39a89d[_0xf3d1('0x44')]=_0x37dbff;return _0x39a89d;})[_0xf3d1('0x40')](respondWithFilteredResult(_0x8dcf5c,_0xd76e67))[_0xf3d1('0x45')](handleError(_0x8dcf5c,null));};exports[_0xf3d1('0x46')]=function(_0x3e7548,_0x333905){var _0x264828={'raw':!![],'where':{'id':_0x3e7548['params']['id']}},_0x323b61={};_0x323b61[_0xf3d1('0x2f')]=_['keys'](db[_0xf3d1('0x3f')][_0xf3d1('0x2b')]);_0x323b61[_0xf3d1('0x30')]=_[_0xf3d1('0x31')](_0x3e7548[_0xf3d1('0x30')]);_0x323b61['filters']=_[_0xf3d1('0x33')](_0x323b61['model'],_0x323b61[_0xf3d1('0x30')]);_0x264828[_0xf3d1('0x35')]=_[_0xf3d1('0x33')](_0x323b61[_0xf3d1('0x2f')],qs['fields'](_0x3e7548[_0xf3d1('0x30')][_0xf3d1('0x34')]));_0x264828[_0xf3d1('0x35')]=_0x264828[_0xf3d1('0x35')]['length']?_0x264828[_0xf3d1('0x35')]:_0x323b61[_0xf3d1('0x2f')];if(_0x3e7548[_0xf3d1('0x30')][_0xf3d1('0x41')]){_0x264828[_0xf3d1('0x42')]=[{'all':!![]}];}_0x264828=_[_0xf3d1('0x3d')]({},_0x264828,_0x3e7548[_0xf3d1('0x3e')]);return db[_0xf3d1('0x3f')][_0xf3d1('0x47')](_0x264828)[_0xf3d1('0x40')](handleEntityNotFound(_0x333905,null))[_0xf3d1('0x40')](respondWithResult(_0x333905,null))[_0xf3d1('0x45')](handleError(_0x333905,null));};exports['create']=function(_0x285352,_0x44dfd2){return db[_0xf3d1('0x3f')][_0xf3d1('0x48')](_0x285352['body'],{})[_0xf3d1('0x40')](respondWithResult(_0x44dfd2,0xc9))[_0xf3d1('0x45')](handleError(_0x44dfd2,null));};exports[_0xf3d1('0x23')]=function(_0x1567a6,_0x1c6d99){if(_0x1567a6['body']['id']){delete _0x1567a6[_0xf3d1('0x49')]['id'];}return db[_0xf3d1('0x3f')][_0xf3d1('0x47')]({'where':{'id':_0x1567a6[_0xf3d1('0x4a')]['id']}})[_0xf3d1('0x40')](handleEntityNotFound(_0x1c6d99,null))[_0xf3d1('0x40')](saveUpdates(_0x1567a6[_0xf3d1('0x49')],null))[_0xf3d1('0x40')](respondWithResult(_0x1c6d99,null))['catch'](handleError(_0x1c6d99,null));};exports[_0xf3d1('0x24')]=function(_0x26b5d4,_0x2ea689){return db[_0xf3d1('0x3f')][_0xf3d1('0x47')]({'where':{'id':_0x26b5d4['params']['id']}})['then'](handleEntityNotFound(_0x2ea689,null))['then'](removeEntity(_0x2ea689,null))['catch'](handleError(_0x2ea689,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 9d495d8..0a511c3 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 _0xba38=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x39e1fe,_0x3e4eb6){var _0x2c311c=function(_0x110468){while(--_0x110468){_0x39e1fe['push'](_0x39e1fe['shift']());}};_0x2c311c(++_0x3e4eb6);}(_0xba38,0x190));var _0x8ba3=function(_0x903337,_0x373c55){_0x903337=_0x903337-0x0;var _0x22b7cd=_0xba38[_0x903337];return _0x22b7cd;};'use strict';var _=require('lodash');var util=require(_0x8ba3('0x0'));var logger=require(_0x8ba3('0x1'))(_0x8ba3('0x2'));var moment=require('moment');var BPromise=require(_0x8ba3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ba3('0x4'));var rimraf=require(_0x8ba3('0x5'));var config=require(_0x8ba3('0x6'));var attributes=require(_0x8ba3('0x7'));module[_0x8ba3('0x8')]=function(_0x1d18b7,_0x3edeae){return _0x1d18b7[_0x8ba3('0x9')](_0x8ba3('0xa'),attributes,{'tableName':_0x8ba3('0xb'),'paranoid':![],'indexes':[{'name':_0x8ba3('0xc'),'fields':[_0x8ba3('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['exports','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3d309a,_0x1bca80){var _0x5248b9=function(_0x4fd715){while(--_0x4fd715){_0x3d309a['push'](_0x3d309a['shift']());}};_0x5248b9(++_0x1bca80);}(_0x8952,0x17e));var _0x2895=function(_0x52a5a7,_0x2ba613){_0x52a5a7=_0x52a5a7-0x0;var _0x395103=_0x8952[_0x52a5a7];return _0x395103;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('FreshsalesField',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb'),_0x2895('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 915a378..d970722 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 _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x36be38,_0x50b484){var _0x10a629=function(_0x23b8d2){while(--_0x23b8d2){_0x36be38['push'](_0x36be38['shift']());}};_0x10a629(++_0x50b484);}(_0x5d58,0x187));var _0x85d5=function(_0x19ac75,_0x3f3dd3){_0x19ac75=_0x19ac75-0x0;var _0x27e32c=_0x5d58[_0x19ac75];return _0x27e32c;};'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(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39ff5a,_0x59a24f){var _0xda9abc=function(_0x35efe2){while(--_0x35efe2){_0x39ff5a['push'](_0x39ff5a['shift']());}};_0xda9abc(++_0x59a24f);}(_0x5fab,0x177));var _0xb5fa=function(_0x5e81ea,_0x2c6893){_0x5e81ea=_0x5e81ea-0x0;var _0x4c19ed=_0x5fab[_0x5e81ea];return _0x4c19ed;};'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']('FreshsalesField,\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')]('FreshsalesField,\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']('FreshsalesField,\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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b40f028..881ac0d 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x459c5d,_0xa67134){var _0x349019=function(_0x36975f){while(--_0x36975f){_0x459c5d['push'](_0x459c5d['shift']());}};_0x349019(++_0xa67134);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x13d4cd,_0x365d0a){var _0x4b9245=function(_0x2b5c49){while(--_0x2b5c49){_0x13d4cd['push'](_0x13d4cd['shift']());}};_0x4b9245(++_0x365d0a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7b79eb8..e6c9097 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 _0x57ef=['ENUM','integrationTab','newTab','exports','STRING','username'];(function(_0x25352a,_0x1a9ea4){var _0x4b82d9=function(_0x47cb95){while(--_0x47cb95){_0x25352a['push'](_0x25352a['shift']());}};_0x4b82d9(++_0x1a9ea4);}(_0x57ef,0xdb));var _0xf57e=function(_0xc46146,_0x2c7b7a){_0xc46146=_0xc46146-0x0;var _0x922b70=_0x57ef[_0xc46146];return _0x922b70;};'use strict';var Sequelize=require('sequelize');module[_0xf57e('0x0')]={'name':{'type':Sequelize[_0xf57e('0x1')]},'description':{'type':Sequelize[_0xf57e('0x1')]},'username':{'type':Sequelize[_0xf57e('0x1')],'unique':_0xf57e('0x2')},'remoteUri':{'type':Sequelize[_0xf57e('0x1')]},'password':{'type':Sequelize[_0xf57e('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xf57e('0x1')]},'securityToken':{'type':Sequelize[_0xf57e('0x1')]},'serverUrl':{'type':Sequelize[_0xf57e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf57e('0x3')](_0xf57e('0x4'),_0xf57e('0x5')),'defaultValue':_0xf57e('0x4')}}; \ No newline at end of file +var _0x404d=['username','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x411d47,_0x30463c){var _0x24dd28=function(_0x25d103){while(--_0x25d103){_0x411d47['push'](_0x411d47['shift']());}};_0x24dd28(++_0x30463c);}(_0x404d,0x1e9));var _0xd404=function(_0x11b7d3,_0x20b869){_0x11b7d3=_0x11b7d3-0x0;var _0x1da1ee=_0x404d[_0x11b7d3];return _0x1da1ee;};'use strict';var Sequelize=require(_0xd404('0x0'));module[_0xd404('0x1')]={'name':{'type':Sequelize[_0xd404('0x2')]},'description':{'type':Sequelize[_0xd404('0x2')]},'username':{'type':Sequelize[_0xd404('0x2')],'unique':_0xd404('0x3')},'remoteUri':{'type':Sequelize[_0xd404('0x2')]},'password':{'type':Sequelize[_0xd404('0x2')]},'clientId':{'type':Sequelize[_0xd404('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xd404('0x2')]},'serverUrl':{'type':Sequelize[_0xd404('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd404('0x4'),_0xd404('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 60123af..f0cd340 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 _0xc8ca=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','create','body','catch','params','findOne','SalesforceConfiguration','fields','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','type','getFields','Task','clientId','clientSecret','username','password','remoteUri','slice','substring','lastIndexOf','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x292f84,_0x26ca99){var _0x324990=function(_0x25ccf9){while(--_0x25ccf9){_0x292f84['push'](_0x292f84['shift']());}};_0x324990(++_0x26ca99);}(_0xc8ca,0x68));var _0xac8c=function(_0xb8a324,_0x2ee9e6){_0xb8a324=_0xb8a324-0x0;var _0x2e970a=_0xc8ca[_0xb8a324];return _0x2e970a;};'use strict';var emlformat=require(_0xac8c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac8c('0x1'));var rp=require(_0xac8c('0x2'));var moment=require('moment');var BPromise=require(_0xac8c('0x3'));var Mustache=require(_0xac8c('0x4'));var util=require('util');var path=require(_0xac8c('0x5'));var sox=require(_0xac8c('0x6'));var csv=require('to-csv');var ejs=require(_0xac8c('0x7'));var fs=require('fs');var fs_extra=require(_0xac8c('0x8'));var _=require(_0xac8c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xac8c('0xa'));var toCsv=require(_0xac8c('0xb'));var querystring=require(_0xac8c('0xc'));var Papa=require(_0xac8c('0xd'));var Redis=require(_0xac8c('0xe'));var authService=require(_0xac8c('0xf'));var qs=require(_0xac8c('0x10'));var as=require(_0xac8c('0x11'));var hardwareService=require(_0xac8c('0x12'));var logger=require('../../config/logger')(_0xac8c('0x13'));var utils=require('../../config/utils');var config=require(_0xac8c('0x14'));var licenseUtil=require(_0xac8c('0x15'));var db=require(_0xac8c('0x16'))['db'];var integrations=require(_0xac8c('0x17'));function respondWithStatusCode(_0xdc1d84,_0x4a1a1d){_0x4a1a1d=_0x4a1a1d||0xcc;return function(_0x83afb6){if(_0x83afb6){return _0xdc1d84[_0xac8c('0x18')](_0x4a1a1d);}return _0xdc1d84[_0xac8c('0x19')](_0x4a1a1d)['end']();};}function respondWithResult(_0x1e6760,_0x6d6739){_0x6d6739=_0x6d6739||0xc8;return function(_0x976b18){if(_0x976b18){return _0x1e6760[_0xac8c('0x19')](_0x6d6739)[_0xac8c('0x1a')](_0x976b18);}};}function respondWithFilteredResult(_0x588f36,_0x35952f){return function(_0x850436){if(_0x850436){var _0x57337b=typeof _0x35952f[_0xac8c('0x1b')]===_0xac8c('0x1c')&&typeof _0x35952f[_0xac8c('0x1d')]==='undefined';var _0x135448=_0x850436[_0xac8c('0x1e')];var _0x312530=_0x57337b?0x0:_0x35952f[_0xac8c('0x1b')];var _0x2e021e=_0x57337b?_0x850436[_0xac8c('0x1e')]:_0x35952f[_0xac8c('0x1b')]+_0x35952f[_0xac8c('0x1d')];var _0x138c6e;if(_0x2e021e>=_0x135448){_0x2e021e=_0x135448;_0x138c6e=0xc8;}else{_0x138c6e=0xce;}_0x588f36[_0xac8c('0x19')](_0x138c6e);return _0x588f36[_0xac8c('0x1f')](_0xac8c('0x20'),_0x312530+'-'+_0x2e021e+'/'+_0x135448)[_0xac8c('0x1a')](_0x850436);}return null;};}function patchUpdates(_0x453249){return function(_0x39934b){try{jsonpatch[_0xac8c('0x21')](_0x39934b,_0x453249,!![]);}catch(_0x584f52){return BPromise[_0xac8c('0x22')](_0x584f52);}return _0x39934b[_0xac8c('0x23')]();};}function saveUpdates(_0x52395e,_0x594330){return function(_0x355038){if(_0x355038){return _0x355038[_0xac8c('0x24')](_0x52395e)[_0xac8c('0x25')](function(_0xda37e7){return _0xda37e7;});}return null;};}function removeEntity(_0x10ada9,_0x16a416){return function(_0xf431ac){if(_0xf431ac){return _0xf431ac[_0xac8c('0x26')]()['then'](function(){_0x10ada9[_0xac8c('0x19')](0xcc)[_0xac8c('0x27')]();});}};}function handleEntityNotFound(_0x2c9b51,_0x5ce84b){return function(_0x1b9020){if(!_0x1b9020){_0x2c9b51[_0xac8c('0x18')](0x194);}return _0x1b9020;};}function handleError(_0x16ed73,_0x33944f){_0x33944f=_0x33944f||0x1f4;return function(_0x2371b2){logger[_0xac8c('0x28')](_0x2371b2[_0xac8c('0x29')]);if(_0x2371b2['name']){delete _0x2371b2[_0xac8c('0x2a')];}_0x16ed73[_0xac8c('0x19')](_0x33944f)[_0xac8c('0x2b')](_0x2371b2);};}exports[_0xac8c('0x2c')]=function(_0x830e7f,_0x18a791){var _0x16a8fc={},_0x21f7dc={},_0x50d906={'count':0x0,'rows':[]};var _0x1f274e=_[_0xac8c('0x2d')](db[_0xac8c('0x2e')][_0xac8c('0x2f')],function(_0x410ff3){return{'name':_0x410ff3[_0xac8c('0x30')],'type':_0x410ff3['type'][_0xac8c('0x31')]};});_0x21f7dc[_0xac8c('0x32')]=_[_0xac8c('0x2d')](_0x1f274e,_0xac8c('0x2a'));_0x21f7dc[_0xac8c('0x33')]=_[_0xac8c('0x34')](_0x830e7f[_0xac8c('0x33')]);_0x21f7dc[_0xac8c('0x35')]=_['intersection'](_0x21f7dc['model'],_0x21f7dc[_0xac8c('0x33')]);_0x16a8fc[_0xac8c('0x36')]=_[_0xac8c('0x37')](_0x21f7dc[_0xac8c('0x32')],qs['fields'](_0x830e7f[_0xac8c('0x33')]['fields']));_0x16a8fc[_0xac8c('0x36')]=_0x16a8fc['attributes'][_0xac8c('0x38')]?_0x16a8fc[_0xac8c('0x36')]:_0x21f7dc[_0xac8c('0x32')];if(!_0x830e7f[_0xac8c('0x33')][_0xac8c('0x39')](_0xac8c('0x3a'))){_0x16a8fc['limit']=qs[_0xac8c('0x1d')](_0x830e7f[_0xac8c('0x33')][_0xac8c('0x1d')]);_0x16a8fc[_0xac8c('0x1b')]=qs[_0xac8c('0x1b')](_0x830e7f[_0xac8c('0x33')]['offset']);}_0x16a8fc[_0xac8c('0x3b')]=qs['sort'](_0x830e7f[_0xac8c('0x33')][_0xac8c('0x3c')]);_0x16a8fc['where']=qs[_0xac8c('0x35')](_[_0xac8c('0x3d')](_0x830e7f[_0xac8c('0x33')],_0x21f7dc[_0xac8c('0x35')]),_0x1f274e);if(_0x830e7f[_0xac8c('0x33')]['filter']){_0x16a8fc[_0xac8c('0x3e')]=_[_0xac8c('0x3f')](_0x16a8fc[_0xac8c('0x3e')],{'$or':_[_0xac8c('0x2d')](_0x1f274e,function(_0x198307){if(_0x198307['type']!==_0xac8c('0x40')){var _0x3e7627={};_0x3e7627[_0x198307[_0xac8c('0x2a')]]={'$like':'%'+_0x830e7f[_0xac8c('0x33')][_0xac8c('0x41')]+'%'};return _0x3e7627;}})});}_0x16a8fc=_[_0xac8c('0x3f')]({},_0x16a8fc,_0x830e7f[_0xac8c('0x42')]);var _0x6b29df={'where':_0x16a8fc[_0xac8c('0x3e')]};return db['SalesforceAccount'][_0xac8c('0x1e')](_0x6b29df)['then'](function(_0x4f8552){_0x50d906[_0xac8c('0x1e')]=_0x4f8552;if(_0x830e7f[_0xac8c('0x33')][_0xac8c('0x43')]){_0x16a8fc[_0xac8c('0x44')]=[{'all':!![]}];}return db[_0xac8c('0x2e')][_0xac8c('0x45')](_0x16a8fc);})['then'](function(_0xb95e96){_0x50d906[_0xac8c('0x46')]=_0xb95e96;return _0x50d906;})[_0xac8c('0x25')](respondWithFilteredResult(_0x18a791,_0x16a8fc))['catch'](handleError(_0x18a791,null));};exports['show']=function(_0x3d9ec8,_0x54857a){var _0x2e286b={'raw':![],'where':{'id':_0x3d9ec8['params']['id']}},_0x1f4cd7={};_0x1f4cd7['model']=_['keys'](db[_0xac8c('0x2e')][_0xac8c('0x2f')]);_0x1f4cd7['query']=_[_0xac8c('0x34')](_0x3d9ec8['query']);_0x1f4cd7[_0xac8c('0x35')]=_[_0xac8c('0x37')](_0x1f4cd7[_0xac8c('0x32')],_0x1f4cd7['query']);_0x2e286b[_0xac8c('0x36')]=_[_0xac8c('0x37')](_0x1f4cd7[_0xac8c('0x32')],qs['fields'](_0x3d9ec8[_0xac8c('0x33')]['fields']));_0x2e286b[_0xac8c('0x36')]=_0x2e286b[_0xac8c('0x36')][_0xac8c('0x38')]?_0x2e286b[_0xac8c('0x36')]:_0x1f4cd7[_0xac8c('0x32')];if(_0x3d9ec8['query'][_0xac8c('0x43')]){_0x2e286b['include']=[{'all':!![]}];}_0x2e286b=_['merge']({},_0x2e286b,_0x3d9ec8[_0xac8c('0x42')]);return db[_0xac8c('0x2e')][_0xac8c('0x47')](_0x2e286b)[_0xac8c('0x25')](handleEntityNotFound(_0x54857a,null))[_0xac8c('0x25')](respondWithResult(_0x54857a,null))['catch'](handleError(_0x54857a,null));};exports[_0xac8c('0x48')]=function(_0x110077,_0x3a92a2){return db['SalesforceAccount'][_0xac8c('0x48')](_0x110077[_0xac8c('0x49')],{})[_0xac8c('0x25')](respondWithResult(_0x3a92a2,0xc9))[_0xac8c('0x4a')](handleError(_0x3a92a2,null));};exports['update']=function(_0x4fe92f,_0x25855a){if(_0x4fe92f['body']['id']){delete _0x4fe92f['body']['id'];}return db[_0xac8c('0x2e')]['find']({'where':{'id':_0x4fe92f[_0xac8c('0x4b')]['id']}})[_0xac8c('0x25')](handleEntityNotFound(_0x25855a,null))[_0xac8c('0x25')](saveUpdates(_0x4fe92f[_0xac8c('0x49')],null))[_0xac8c('0x25')](respondWithResult(_0x25855a,null))[_0xac8c('0x4a')](handleError(_0x25855a,null));};exports['destroy']=function(_0x3792e6,_0x351309){return db[_0xac8c('0x2e')][_0xac8c('0x47')]({'where':{'id':_0x3792e6[_0xac8c('0x4b')]['id']}})[_0xac8c('0x25')](handleEntityNotFound(_0x351309,null))[_0xac8c('0x25')](removeEntity(_0x351309,null))['catch'](handleError(_0x351309,null));};exports['getConfigurations']=function(_0x49d959,_0x70cbfa,_0x2c005e){var _0x35b398={};var _0x143b74={};var _0x56aabf;var _0xa4baa4;return db[_0xac8c('0x2e')][_0xac8c('0x4c')]({'where':{'id':_0x49d959[_0xac8c('0x4b')]['id']}})[_0xac8c('0x25')](handleEntityNotFound(_0x70cbfa,null))[_0xac8c('0x25')](function(_0x282a8a){if(_0x282a8a){_0x56aabf=_0x282a8a;_0x143b74[_0xac8c('0x32')]=_[_0xac8c('0x34')](db[_0xac8c('0x4d')][_0xac8c('0x2f')]);_0x143b74['query']=_[_0xac8c('0x34')](_0x49d959[_0xac8c('0x33')]);_0x143b74[_0xac8c('0x35')]=_[_0xac8c('0x37')](_0x143b74[_0xac8c('0x32')],_0x143b74[_0xac8c('0x33')]);_0x35b398[_0xac8c('0x36')]=_[_0xac8c('0x37')](_0x143b74[_0xac8c('0x32')],qs[_0xac8c('0x4e')](_0x49d959['query'][_0xac8c('0x4e')]));_0x35b398[_0xac8c('0x36')]=_0x35b398[_0xac8c('0x36')][_0xac8c('0x38')]?_0x35b398['attributes']:_0x143b74[_0xac8c('0x32')];_0x35b398[_0xac8c('0x3b')]=qs[_0xac8c('0x3c')](_0x49d959[_0xac8c('0x33')][_0xac8c('0x3c')]);_0x35b398[_0xac8c('0x3e')]=qs[_0xac8c('0x35')](_[_0xac8c('0x3d')](_0x49d959[_0xac8c('0x33')],_0x143b74['filters']));if(_0x49d959[_0xac8c('0x33')][_0xac8c('0x41')]){_0x35b398[_0xac8c('0x3e')]=_[_0xac8c('0x3f')](_0x35b398['where'],{'$or':_[_0xac8c('0x2d')](_0x35b398[_0xac8c('0x36')],function(_0x51ae74){var _0x5eb0ad={};_0x5eb0ad[_0x51ae74]={'$like':'%'+_0x49d959['query'][_0xac8c('0x41')]+'%'};return _0x5eb0ad;})});}_0x35b398=_[_0xac8c('0x3f')]({},_0x35b398,_0x49d959['options']);return _0x56aabf[_0xac8c('0x4f')](_0x35b398);}})[_0xac8c('0x25')](function(_0x4b4bd6){if(_0x4b4bd6){_0xa4baa4=_0x4b4bd6[_0xac8c('0x38')];if(!_0x49d959[_0xac8c('0x33')][_0xac8c('0x39')](_0xac8c('0x3a'))){_0x35b398[_0xac8c('0x1d')]=qs[_0xac8c('0x1d')](_0x49d959[_0xac8c('0x33')][_0xac8c('0x1d')]);_0x35b398[_0xac8c('0x1b')]=qs['offset'](_0x49d959[_0xac8c('0x33')][_0xac8c('0x1b')]);}return _0x56aabf[_0xac8c('0x4f')](_0x35b398);}})[_0xac8c('0x25')](function(_0x1d94f0){if(_0x1d94f0){return _0x1d94f0?{'count':_0xa4baa4,'rows':_0x1d94f0}:null;}})['then'](respondWithResult(_0x70cbfa,null))[_0xac8c('0x4a')](handleError(_0x70cbfa,null));};exports[_0xac8c('0x50')]=function(_0x1ec10e,_0x3b8c32,_0x1351b1){if(_0x1ec10e[_0xac8c('0x49')]['id']){delete _0x1ec10e[_0xac8c('0x49')]['id'];}return db[_0xac8c('0x2e')][_0xac8c('0x4c')]({'where':{'id':_0x1ec10e[_0xac8c('0x4b')]['id']}})[_0xac8c('0x25')](handleEntityNotFound(_0x3b8c32,null))['then'](function(_0x3c5d7b){if(_0x3c5d7b){_0x1ec10e[_0xac8c('0x49')][_0xac8c('0x51')]=_0x3c5d7b['id'];_0x1ec10e[_0xac8c('0x49')]['Subjects']=integrations[_0xac8c('0x52')](_0x1ec10e[_0xac8c('0x49')][_0xac8c('0x53')],_0x1ec10e[_0xac8c('0x49')]['type']);_0x1ec10e[_0xac8c('0x49')][_0xac8c('0x54')]=integrations[_0xac8c('0x55')](_0x1ec10e[_0xac8c('0x49')]['channel'],_0x1ec10e[_0xac8c('0x49')][_0xac8c('0x56')]);return db[_0xac8c('0x4d')][_0xac8c('0x48')](_0x1ec10e[_0xac8c('0x49')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xac8c('0x54')}]});}return null;})['then'](respondWithResult(_0x3b8c32,null))[_0xac8c('0x4a')](handleError(_0x3b8c32,null));};exports[_0xac8c('0x57')]=function(_0x392c67,_0x2d8464,_0x3e2779){var _0x2fe4fe;var _0x544afa='';var _0x228f08=_0xac8c('0x58');return db[_0xac8c('0x2e')][_0xac8c('0x4c')]({'where':{'id':_0x392c67[_0xac8c('0x4b')]['id']},'attributes':['id','remoteUri',_0xac8c('0x59'),_0xac8c('0x5a'),_0xac8c('0x5b'),_0xac8c('0x5c'),'securityToken']})['then'](handleEntityNotFound(_0x2d8464,null))[_0xac8c('0x25')](function(_0x4c8ac1){if(_0x4c8ac1){_0x544afa=_0x4c8ac1[_0xac8c('0x5d')];var _0x2c1740=_0x544afa[_0xac8c('0x5e')](-0x1);if(_0x2c1740==='/'){_0x544afa=_0x544afa[_0xac8c('0x5f')](0x0,_0x544afa[_0xac8c('0x60')](_0x2c1740));}_0x2fe4fe=new jsforce['Connection']({'oauth2':{'loginUrl':_0x544afa,'clientId':_0x4c8ac1[_0xac8c('0x59')],'clientSecret':_0x4c8ac1[_0xac8c('0x5a')]}});return _0x2fe4fe['login'](_0x4c8ac1[_0xac8c('0x5b')],_0x4c8ac1[_0xac8c('0x5c')]['concat'](_0x4c8ac1['securityToken']));}})[_0xac8c('0x25')](function(_0x3f26f8){if(_0x3f26f8){if(!_[_0xac8c('0x61')](_0x392c67[_0xac8c('0x33')]['ticketType'])){_0x228f08=_0x392c67['query'][_0xac8c('0x62')];}return _0x2fe4fe['sobject'](_0x228f08)[_0xac8c('0x63')]();}})[_0xac8c('0x25')](function(_0x434209){var _0x1d4c56=[_0xac8c('0x64'),_0xac8c('0x65'),_0xac8c('0x66'),_0xac8c('0x67'),_0xac8c('0x68'),'Description'];var _0x34094b=[_0xac8c('0x69'),_0xac8c('0x6a'),_0xac8c('0x6b'),_0xac8c('0x6c'),_0xac8c('0x6d'),'textarea',_0xac8c('0x6e')];if(_0x434209){_[_0xac8c('0x6f')](_0x434209[_0xac8c('0x4e')],function(_0x3632fb){return _0x1d4c56[_0xac8c('0x70')](_0x3632fb[_0xac8c('0x2a')])||!_0x34094b[_0xac8c('0x70')](_0x3632fb['type']);});return{'count':_0x434209[_0xac8c('0x4e')][_0xac8c('0x38')],'rows':_['map'](_0x434209['fields'],function(_0x52d12d){return{'id':_0x52d12d['name'],'name':_0x52d12d[_0xac8c('0x71')],'custom':_0x52d12d[_0xac8c('0x72')],'options':_0x52d12d[_0xac8c('0x73')][_0xac8c('0x38')]>0x0?_[_0xac8c('0x2d')](_0x52d12d['picklistValues'],function(_0x20454b){return{'name':_0x20454b['label'],'value':_0x20454b[_0xac8c('0x74')]};}):_0x52d12d[_0xac8c('0x56')]=='boolean'?[{'name':_0xac8c('0x75'),'value':'true'},{'name':_0xac8c('0x76'),'value':_0xac8c('0x77')}]:[]};})};}})[_0xac8c('0x25')](respondWithResult(_0x2d8464,null))[_0xac8c('0x4a')](function(_0x1e80f4){var _0x457ea8=_0x392c67[_0xac8c('0x33')][_0xac8c('0x78')]?0x1f4:_0x1e80f4[_0xac8c('0x79')]||0x1f4;logger[_0xac8c('0x28')](_0xac8c('0x7a'),'getFields',_0x457ea8,JSON['stringify'](_0x1e80f4));delete _0x1e80f4['name'];if(_0x457ea8===0x191){_0x457ea8=0x190;}_0x2d8464[_0xac8c('0x19')](_0x457ea8)[_0xac8c('0x2b')](_0x392c67['query'][_0xac8c('0x78')]?{'message':_0xac8c('0x7b'),'statusCode':_0x1e80f4[_0xac8c('0x79')]}:_0x1e80f4);});}; \ No newline at end of file +var _0x96c9=['show','fields','find','body','destroy','getConfigurations','params','SalesforceConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SalesforceField','getFields','Task','clientId','username','password','remoteUri','lastIndexOf','Connection','clientSecret','login','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','email','textarea','remove','includes','label','custom','picklistValues','value','boolean','true','false','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch'];(function(_0x20eeb4,_0x8116a2){var _0x5af65c=function(_0x33baba){while(--_0x33baba){_0x20eeb4['push'](_0x20eeb4['shift']());}};_0x5af65c(++_0x8116a2);}(_0x96c9,0xb7));var _0x996c=function(_0x36b9fa,_0x3db22e){_0x36b9fa=_0x36b9fa-0x0;var _0x502a6c=_0x96c9[_0x36b9fa];return _0x502a6c;};'use strict';var emlformat=require(_0x996c('0x0'));var rimraf=require(_0x996c('0x1'));var zipdir=require(_0x996c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x996c('0x3'));var BPromise=require(_0x996c('0x4'));var Mustache=require('mustache');var util=require(_0x996c('0x5'));var path=require(_0x996c('0x6'));var sox=require(_0x996c('0x7'));var csv=require(_0x996c('0x8'));var ejs=require(_0x996c('0x9'));var fs=require('fs');var fs_extra=require(_0x996c('0xa'));var _=require('lodash');var squel=require(_0x996c('0xb'));var crypto=require('crypto');var jsforce=require(_0x996c('0xc'));var deskjs=require(_0x996c('0xd'));var toCsv=require(_0x996c('0x8'));var querystring=require(_0x996c('0xe'));var Papa=require(_0x996c('0xf'));var Redis=require(_0x996c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x996c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x996c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x996c('0x13'));var config=require(_0x996c('0x14'));var licenseUtil=require(_0x996c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x996c('0x16'));function respondWithStatusCode(_0x2510c8,_0x215d7f){_0x215d7f=_0x215d7f||0xcc;return function(_0x25b709){if(_0x25b709){return _0x2510c8[_0x996c('0x17')](_0x215d7f);}return _0x2510c8[_0x996c('0x18')](_0x215d7f)[_0x996c('0x19')]();};}function respondWithResult(_0x476ebd,_0x8cfab5){_0x8cfab5=_0x8cfab5||0xc8;return function(_0x49a8a2){if(_0x49a8a2){return _0x476ebd[_0x996c('0x18')](_0x8cfab5)[_0x996c('0x1a')](_0x49a8a2);}};}function respondWithFilteredResult(_0x1656b3,_0x4796b6){return function(_0x17d948){if(_0x17d948){var _0x2107c0=typeof _0x4796b6[_0x996c('0x1b')]===_0x996c('0x1c')&&typeof _0x4796b6['limit']===_0x996c('0x1c');var _0x26fb88=_0x17d948['count'];var _0x1b2b43=_0x2107c0?0x0:_0x4796b6['offset'];var _0x3cfa0f=_0x2107c0?_0x17d948[_0x996c('0x1d')]:_0x4796b6['offset']+_0x4796b6['limit'];var _0x1ea373;if(_0x3cfa0f>=_0x26fb88){_0x3cfa0f=_0x26fb88;_0x1ea373=0xc8;}else{_0x1ea373=0xce;}_0x1656b3['status'](_0x1ea373);return _0x1656b3[_0x996c('0x1e')](_0x996c('0x1f'),_0x1b2b43+'-'+_0x3cfa0f+'/'+_0x26fb88)[_0x996c('0x1a')](_0x17d948);}return null;};}function patchUpdates(_0x545bc9){return function(_0x474c57){try{jsonpatch[_0x996c('0x20')](_0x474c57,_0x545bc9,!![]);}catch(_0x37bff7){return BPromise[_0x996c('0x21')](_0x37bff7);}return _0x474c57[_0x996c('0x22')]();};}function saveUpdates(_0xd18334,_0x5380c6){return function(_0x2dad90){if(_0x2dad90){return _0x2dad90['update'](_0xd18334)[_0x996c('0x23')](function(_0x41875d){return _0x41875d;});}return null;};}function removeEntity(_0x45b0ea,_0x3d505d){return function(_0x2895e7){if(_0x2895e7){return _0x2895e7['destroy']()[_0x996c('0x23')](function(){_0x45b0ea[_0x996c('0x18')](0xcc)[_0x996c('0x19')]();});}};}function handleEntityNotFound(_0x39c556,_0x9cf1a){return function(_0x7097d){if(!_0x7097d){_0x39c556[_0x996c('0x17')](0x194);}return _0x7097d;};}function handleError(_0x4ddabf,_0x2f8cae){_0x2f8cae=_0x2f8cae||0x1f4;return function(_0x2aad18){logger[_0x996c('0x24')](_0x2aad18[_0x996c('0x25')]);if(_0x2aad18[_0x996c('0x26')]){delete _0x2aad18[_0x996c('0x26')];}_0x4ddabf['status'](_0x2f8cae)[_0x996c('0x27')](_0x2aad18);};}exports[_0x996c('0x28')]=function(_0x262f37,_0x531046){var _0x5aeda3={},_0x47049f={},_0x2fac85={'count':0x0,'rows':[]};var _0x37adcc=_['map'](db[_0x996c('0x29')][_0x996c('0x2a')],function(_0x355877){return{'name':_0x355877[_0x996c('0x2b')],'type':_0x355877[_0x996c('0x2c')]['key']};});_0x47049f[_0x996c('0x2d')]=_[_0x996c('0x2e')](_0x37adcc,'name');_0x47049f[_0x996c('0x2f')]=_[_0x996c('0x30')](_0x262f37['query']);_0x47049f[_0x996c('0x31')]=_['intersection'](_0x47049f[_0x996c('0x2d')],_0x47049f[_0x996c('0x2f')]);_0x5aeda3[_0x996c('0x32')]=_[_0x996c('0x33')](_0x47049f[_0x996c('0x2d')],qs['fields'](_0x262f37[_0x996c('0x2f')]['fields']));_0x5aeda3[_0x996c('0x32')]=_0x5aeda3[_0x996c('0x32')][_0x996c('0x34')]?_0x5aeda3[_0x996c('0x32')]:_0x47049f[_0x996c('0x2d')];if(!_0x262f37[_0x996c('0x2f')][_0x996c('0x35')](_0x996c('0x36'))){_0x5aeda3['limit']=qs[_0x996c('0x37')](_0x262f37[_0x996c('0x2f')][_0x996c('0x37')]);_0x5aeda3[_0x996c('0x1b')]=qs['offset'](_0x262f37['query'][_0x996c('0x1b')]);}_0x5aeda3[_0x996c('0x38')]=qs[_0x996c('0x39')](_0x262f37[_0x996c('0x2f')][_0x996c('0x39')]);_0x5aeda3['where']=qs[_0x996c('0x31')](_['pick'](_0x262f37[_0x996c('0x2f')],_0x47049f[_0x996c('0x31')]),_0x37adcc);if(_0x262f37['query'][_0x996c('0x3a')]){_0x5aeda3['where']=_['merge'](_0x5aeda3[_0x996c('0x3b')],{'$or':_['map'](_0x37adcc,function(_0x542ff8){if(_0x542ff8[_0x996c('0x2c')]!==_0x996c('0x3c')){var _0x5bc8e3={};_0x5bc8e3[_0x542ff8[_0x996c('0x26')]]={'$like':'%'+_0x262f37[_0x996c('0x2f')][_0x996c('0x3a')]+'%'};return _0x5bc8e3;}})});}_0x5aeda3=_[_0x996c('0x3d')]({},_0x5aeda3,_0x262f37[_0x996c('0x3e')]);var _0xd83fbc={'where':_0x5aeda3['where']};return db[_0x996c('0x29')]['count'](_0xd83fbc)[_0x996c('0x23')](function(_0x300570){_0x2fac85[_0x996c('0x1d')]=_0x300570;if(_0x262f37[_0x996c('0x2f')][_0x996c('0x3f')]){_0x5aeda3[_0x996c('0x40')]=[{'all':!![]}];}return db[_0x996c('0x29')]['findAll'](_0x5aeda3);})[_0x996c('0x23')](function(_0x2709fd){_0x2fac85[_0x996c('0x41')]=_0x2709fd;return _0x2fac85;})[_0x996c('0x23')](respondWithFilteredResult(_0x531046,_0x5aeda3))[_0x996c('0x42')](handleError(_0x531046,null));};exports[_0x996c('0x43')]=function(_0x4f3cca,_0x5f598a){var _0x524fa3={'raw':![],'where':{'id':_0x4f3cca['params']['id']}},_0x1f9a5f={};_0x1f9a5f[_0x996c('0x2d')]=_['keys'](db['SalesforceAccount'][_0x996c('0x2a')]);_0x1f9a5f[_0x996c('0x2f')]=_[_0x996c('0x30')](_0x4f3cca[_0x996c('0x2f')]);_0x1f9a5f['filters']=_[_0x996c('0x33')](_0x1f9a5f[_0x996c('0x2d')],_0x1f9a5f[_0x996c('0x2f')]);_0x524fa3['attributes']=_[_0x996c('0x33')](_0x1f9a5f[_0x996c('0x2d')],qs[_0x996c('0x44')](_0x4f3cca['query'][_0x996c('0x44')]));_0x524fa3[_0x996c('0x32')]=_0x524fa3[_0x996c('0x32')]['length']?_0x524fa3['attributes']:_0x1f9a5f[_0x996c('0x2d')];if(_0x4f3cca[_0x996c('0x2f')][_0x996c('0x3f')]){_0x524fa3['include']=[{'all':!![]}];}_0x524fa3=_[_0x996c('0x3d')]({},_0x524fa3,_0x4f3cca[_0x996c('0x3e')]);return db[_0x996c('0x29')][_0x996c('0x45')](_0x524fa3)['then'](handleEntityNotFound(_0x5f598a,null))[_0x996c('0x23')](respondWithResult(_0x5f598a,null))[_0x996c('0x42')](handleError(_0x5f598a,null));};exports['create']=function(_0x54f3f9,_0x406809){return db[_0x996c('0x29')]['create'](_0x54f3f9[_0x996c('0x46')],{})[_0x996c('0x23')](respondWithResult(_0x406809,0xc9))[_0x996c('0x42')](handleError(_0x406809,null));};exports['update']=function(_0x142119,_0x47695e){if(_0x142119[_0x996c('0x46')]['id']){delete _0x142119[_0x996c('0x46')]['id'];}return db['SalesforceAccount'][_0x996c('0x45')]({'where':{'id':_0x142119['params']['id']}})[_0x996c('0x23')](handleEntityNotFound(_0x47695e,null))[_0x996c('0x23')](saveUpdates(_0x142119['body'],null))['then'](respondWithResult(_0x47695e,null))[_0x996c('0x42')](handleError(_0x47695e,null));};exports[_0x996c('0x47')]=function(_0x534a8a,_0x5b8b85){return db[_0x996c('0x29')][_0x996c('0x45')]({'where':{'id':_0x534a8a['params']['id']}})[_0x996c('0x23')](handleEntityNotFound(_0x5b8b85,null))[_0x996c('0x23')](removeEntity(_0x5b8b85,null))[_0x996c('0x42')](handleError(_0x5b8b85,null));};exports[_0x996c('0x48')]=function(_0xd34923,_0x5750d4,_0x789623){var _0x4af6f0={};var _0x6e935c={};var _0x4fecba;var _0x2a72da;return db['SalesforceAccount']['findOne']({'where':{'id':_0xd34923[_0x996c('0x49')]['id']}})[_0x996c('0x23')](handleEntityNotFound(_0x5750d4,null))[_0x996c('0x23')](function(_0x14d5fa){if(_0x14d5fa){_0x4fecba=_0x14d5fa;_0x6e935c[_0x996c('0x2d')]=_[_0x996c('0x30')](db[_0x996c('0x4a')][_0x996c('0x2a')]);_0x6e935c[_0x996c('0x2f')]=_['keys'](_0xd34923[_0x996c('0x2f')]);_0x6e935c[_0x996c('0x31')]=_[_0x996c('0x33')](_0x6e935c[_0x996c('0x2d')],_0x6e935c[_0x996c('0x2f')]);_0x4af6f0[_0x996c('0x32')]=_[_0x996c('0x33')](_0x6e935c[_0x996c('0x2d')],qs['fields'](_0xd34923[_0x996c('0x2f')][_0x996c('0x44')]));_0x4af6f0[_0x996c('0x32')]=_0x4af6f0[_0x996c('0x32')][_0x996c('0x34')]?_0x4af6f0[_0x996c('0x32')]:_0x6e935c['model'];_0x4af6f0['order']=qs[_0x996c('0x39')](_0xd34923['query'][_0x996c('0x39')]);_0x4af6f0[_0x996c('0x3b')]=qs['filters'](_[_0x996c('0x4b')](_0xd34923[_0x996c('0x2f')],_0x6e935c['filters']));if(_0xd34923['query'][_0x996c('0x3a')]){_0x4af6f0[_0x996c('0x3b')]=_['merge'](_0x4af6f0[_0x996c('0x3b')],{'$or':_['map'](_0x4af6f0[_0x996c('0x32')],function(_0x481b59){var _0x2ea8bd={};_0x2ea8bd[_0x481b59]={'$like':'%'+_0xd34923[_0x996c('0x2f')]['filter']+'%'};return _0x2ea8bd;})});}_0x4af6f0=_[_0x996c('0x3d')]({},_0x4af6f0,_0xd34923[_0x996c('0x3e')]);return _0x4fecba[_0x996c('0x48')](_0x4af6f0);}})[_0x996c('0x23')](function(_0x499193){if(_0x499193){_0x2a72da=_0x499193[_0x996c('0x34')];if(!_0xd34923[_0x996c('0x2f')]['hasOwnProperty'](_0x996c('0x36'))){_0x4af6f0[_0x996c('0x37')]=qs[_0x996c('0x37')](_0xd34923[_0x996c('0x2f')][_0x996c('0x37')]);_0x4af6f0[_0x996c('0x1b')]=qs['offset'](_0xd34923[_0x996c('0x2f')][_0x996c('0x1b')]);}return _0x4fecba[_0x996c('0x48')](_0x4af6f0);}})['then'](function(_0x191c7e){if(_0x191c7e){return _0x191c7e?{'count':_0x2a72da,'rows':_0x191c7e}:null;}})['then'](respondWithResult(_0x5750d4,null))[_0x996c('0x42')](handleError(_0x5750d4,null));};exports[_0x996c('0x4c')]=function(_0x4e4885,_0x1b5cec,_0x26444a){if(_0x4e4885[_0x996c('0x46')]['id']){delete _0x4e4885[_0x996c('0x46')]['id'];}return db[_0x996c('0x29')][_0x996c('0x4d')]({'where':{'id':_0x4e4885[_0x996c('0x49')]['id']}})[_0x996c('0x23')](handleEntityNotFound(_0x1b5cec,null))[_0x996c('0x23')](function(_0x4dbc38){if(_0x4dbc38){_0x4e4885['body'][_0x996c('0x4e')]=_0x4dbc38['id'];_0x4e4885[_0x996c('0x46')][_0x996c('0x4f')]=integrations[_0x996c('0x50')](_0x4e4885[_0x996c('0x46')][_0x996c('0x51')],_0x4e4885['body'][_0x996c('0x2c')]);_0x4e4885[_0x996c('0x46')][_0x996c('0x52')]=integrations[_0x996c('0x53')](_0x4e4885[_0x996c('0x46')][_0x996c('0x51')],_0x4e4885['body']['type']);return db[_0x996c('0x4a')][_0x996c('0x54')](_0x4e4885[_0x996c('0x46')],{'include':[{'model':db[_0x996c('0x55')],'as':_0x996c('0x4f')},{'model':db['SalesforceField'],'as':_0x996c('0x52')}]});}return null;})['then'](respondWithResult(_0x1b5cec,null))[_0x996c('0x42')](handleError(_0x1b5cec,null));};exports[_0x996c('0x56')]=function(_0x1ce341,_0x1e8af8,_0x53479d){var _0x2b4dc8;var _0x2d8bb7='';var _0x4d7434=_0x996c('0x57');return db[_0x996c('0x29')][_0x996c('0x4d')]({'where':{'id':_0x1ce341['params']['id']},'attributes':['id','remoteUri',_0x996c('0x58'),'clientSecret',_0x996c('0x59'),_0x996c('0x5a'),'securityToken']})['then'](handleEntityNotFound(_0x1e8af8,null))[_0x996c('0x23')](function(_0x54a03f){if(_0x54a03f){_0x2d8bb7=_0x54a03f[_0x996c('0x5b')];var _0x12c3b8=_0x2d8bb7['slice'](-0x1);if(_0x12c3b8==='/'){_0x2d8bb7=_0x2d8bb7['substring'](0x0,_0x2d8bb7[_0x996c('0x5c')](_0x12c3b8));}_0x2b4dc8=new jsforce[(_0x996c('0x5d'))]({'oauth2':{'loginUrl':_0x2d8bb7,'clientId':_0x54a03f[_0x996c('0x58')],'clientSecret':_0x54a03f[_0x996c('0x5e')]}});return _0x2b4dc8[_0x996c('0x5f')](_0x54a03f[_0x996c('0x59')],_0x54a03f[_0x996c('0x5a')][_0x996c('0x60')](_0x54a03f[_0x996c('0x61')]));}})[_0x996c('0x23')](function(_0x32034a){if(_0x32034a){if(!_[_0x996c('0x62')](_0x1ce341[_0x996c('0x2f')][_0x996c('0x63')])){_0x4d7434=_0x1ce341[_0x996c('0x2f')][_0x996c('0x63')];}return _0x2b4dc8[_0x996c('0x64')](_0x4d7434)[_0x996c('0x65')]();}})[_0x996c('0x23')](function(_0x1ad5c2){var _0x196981=[_0x996c('0x66'),_0x996c('0x67'),_0x996c('0x68'),_0x996c('0x69'),_0x996c('0x6a'),'Description'];var _0x282672=[_0x996c('0x6b'),_0x996c('0x6c'),_0x996c('0x6d'),'boolean',_0x996c('0x6e'),_0x996c('0x6f'),'phone'];if(_0x1ad5c2){_[_0x996c('0x70')](_0x1ad5c2[_0x996c('0x44')],function(_0x559c3a){return _0x196981[_0x996c('0x71')](_0x559c3a[_0x996c('0x26')])||!_0x282672[_0x996c('0x71')](_0x559c3a[_0x996c('0x2c')]);});return{'count':_0x1ad5c2[_0x996c('0x44')][_0x996c('0x34')],'rows':_['map'](_0x1ad5c2[_0x996c('0x44')],function(_0x54a1c0){return{'id':_0x54a1c0[_0x996c('0x26')],'name':_0x54a1c0[_0x996c('0x72')],'custom':_0x54a1c0[_0x996c('0x73')],'options':_0x54a1c0[_0x996c('0x74')][_0x996c('0x34')]>0x0?_[_0x996c('0x2e')](_0x54a1c0['picklistValues'],function(_0x4b414e){return{'name':_0x4b414e[_0x996c('0x72')],'value':_0x4b414e[_0x996c('0x75')]};}):_0x54a1c0['type']==_0x996c('0x76')?[{'name':'True','value':_0x996c('0x77')},{'name':'False','value':_0x996c('0x78')}]:[]};})};}})[_0x996c('0x23')](respondWithResult(_0x1e8af8,null))[_0x996c('0x42')](function(_0x26fd4a){var _0x2e7da6=_0x1ce341[_0x996c('0x2f')][_0x996c('0x79')]?0x1f4:_0x26fd4a['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2e7da6,JSON[_0x996c('0x7a')](_0x26fd4a));delete _0x26fd4a[_0x996c('0x26')];if(_0x2e7da6===0x191){_0x2e7da6=0x190;}_0x1e8af8[_0x996c('0x18')](_0x2e7da6)[_0x996c('0x27')](_0x1ce341[_0x996c('0x2f')][_0x996c('0x79')]?{'message':_0x996c('0x7b'),'statusCode':_0x26fd4a[_0x996c('0x7c')]}:_0x26fd4a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6585418..825f689 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 _0xe189=['request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','api','moment','bluebird'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xe189,0x194));var _0x9e18=function(_0x4186e6,_0xdc2de2){_0x4186e6=_0x4186e6-0x0;var _0x583758=_0xe189[_0x4186e6];return _0x583758;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9e18('0x1'));var moment=require(_0x9e18('0x2'));var BPromise=require(_0x9e18('0x3'));var rp=require(_0x9e18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e18('0x5'));var attributes=require(_0x9e18('0x6'));var integrations=require(_0x9e18('0x7'));module[_0x9e18('0x8')]=function(_0x3e6881,_0x5e6097){return _0x3e6881[_0x9e18('0x9')](_0x9e18('0xa'),attributes,{'tableName':_0x9e18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf99=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x214068,_0x19918e){var _0x240a1c=function(_0x456a03){while(--_0x456a03){_0x214068['push'](_0x214068['shift']());}};_0x240a1c(++_0x19918e);}(_0xbf99,0x8e));var _0x9bf9=function(_0x20fae6,_0x3a71d5){_0x20fae6=_0x20fae6-0x0;var _0x1bcc89=_0xbf99[_0x20fae6];return _0x1bcc89;};'use strict';var _=require(_0x9bf9('0x0'));var util=require('util');var logger=require(_0x9bf9('0x1'))('api');var moment=require(_0x9bf9('0x2'));var BPromise=require(_0x9bf9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bf9('0x4'));var rimraf=require(_0x9bf9('0x5'));var config=require(_0x9bf9('0x6'));var attributes=require(_0x9bf9('0x7'));var integrations=require(_0x9bf9('0x8'));module[_0x9bf9('0x9')]=function(_0x43bff2,_0x1d8973){return _0x43bff2[_0x9bf9('0xa')](_0x9bf9('0xb'),attributes,{'tableName':_0x9bf9('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 1e1ddc1..0fea6bc 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 _0xbc5c=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowSalesforceAccount','find','catch','lodash','moment','bluebird'];(function(_0x11c6f1,_0x2ef889){var _0x25225a=function(_0x150ed1){while(--_0x150ed1){_0x11c6f1['push'](_0x11c6f1['shift']());}};_0x25225a(++_0x2ef889);}(_0xbc5c,0x115));var _0xcbc5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbc5c[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xcbc5('0x0'));var util=require('util');var moment=require(_0xcbc5('0x1'));var BPromise=require(_0xcbc5('0x2'));var rs=require(_0xcbc5('0x3'));var fs=require('fs');var Redis=require(_0xcbc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbc5('0x5'));var logger=require(_0xcbc5('0x6'))(_0xcbc5('0x7'));var config=require(_0xcbc5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbc5('0x9')][_0xcbc5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x145c35,_0x432070,_0x4c5fb7){return new BPromise(function(_0x2a5459,_0x1328be){return client[_0xcbc5('0xb')](_0x145c35,_0x4c5fb7)['then'](function(_0x4149ce){logger[_0xcbc5('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x432070,_0xcbc5('0xd'));logger['debug'](_0xcbc5('0xe'),_0x432070,_0xcbc5('0xd'),JSON[_0xcbc5('0xf')](_0x4149ce));if(_0x4149ce['error']){if(_0x4149ce[_0xcbc5('0x10')]['code']===0x1f4){logger['error'](_0xcbc5('0x11'),_0x432070,_0x4149ce['error'][_0xcbc5('0x12')]);return _0x1328be(_0x4149ce[_0xcbc5('0x10')]['message']);}logger['error'](_0xcbc5('0x11'),_0x432070,_0x4149ce['error']['message']);return _0x2a5459(_0x4149ce[_0xcbc5('0x10')]['message']);}else{logger[_0xcbc5('0xc')](_0xcbc5('0x11'),_0x432070,'request\x20sent');_0x2a5459(_0x4149ce['result'][_0xcbc5('0x12')]);}})['catch'](function(_0x465a6e){logger[_0xcbc5('0x10')](_0xcbc5('0x11'),_0x432070,_0x465a6e);_0x1328be(_0x465a6e);});});}exports[_0xcbc5('0x13')]=function(_0x1bc063){var _0x9069e5=this;return new Promise(function(_0x7f8a36,_0x31c515){return db[_0xcbc5('0x14')][_0xcbc5('0x15')]({'raw':_0x1bc063[_0xcbc5('0x16')]?_0x1bc063['options'][_0xcbc5('0x17')]===undefined?!![]:![]:!![],'where':_0x1bc063[_0xcbc5('0x16')]?_0x1bc063[_0xcbc5('0x16')][_0xcbc5('0x18')]||null:null,'attributes':_0x1bc063['options']?_0x1bc063['options'][_0xcbc5('0x19')]||null:null,'limit':_0x1bc063[_0xcbc5('0x16')]?_0x1bc063['options'][_0xcbc5('0x1a')]||null:null,'include':_0x1bc063[_0xcbc5('0x16')]?_0x1bc063['options'][_0xcbc5('0x1b')]?_[_0xcbc5('0x1c')](_0x1bc063[_0xcbc5('0x16')]['include'],function(_0x531330){return{'model':db[_0x531330['model']],'as':_0x531330['as'],'attributes':_0x531330['attributes'],'include':_0x531330[_0xcbc5('0x1b')]?_[_0xcbc5('0x1c')](_0x531330[_0xcbc5('0x1b')],function(_0x50bcba){return{'model':db[_0x50bcba['model']],'as':_0x50bcba['as'],'attributes':_0x50bcba[_0xcbc5('0x19')],'include':_0x50bcba[_0xcbc5('0x1b')]?_[_0xcbc5('0x1c')](_0x50bcba[_0xcbc5('0x1b')],function(_0x1ede9b){return{'model':db[_0x1ede9b[_0xcbc5('0x1d')]],'as':_0x1ede9b['as'],'attributes':_0x1ede9b['attributes']};}):[]};}):[]};}):[]:[]})[_0xcbc5('0x1e')](function(_0x1e7819){logger[_0xcbc5('0xc')](_0xcbc5('0x13'),_0x1bc063);logger[_0xcbc5('0x1f')](_0xcbc5('0x13'),_0x1bc063,JSON['stringify'](_0x1e7819));_0x7f8a36(_0x1e7819);})['catch'](function(_0x1b4f27){logger[_0xcbc5('0x10')]('GetSalesforceAccount',_0x1b4f27[_0xcbc5('0x12')],_0x1bc063);_0x31c515(_0x9069e5[_0xcbc5('0x10')](0x1f4,_0x1b4f27[_0xcbc5('0x12')]));});});};exports[_0xcbc5('0x20')]=function(_0x5a1e16){var _0x31471f=this;return new Promise(function(_0x50cc56,_0x13a1cc){return db['SalesforceAccount'][_0xcbc5('0x21')]({'raw':_0x5a1e16[_0xcbc5('0x16')]?_0x5a1e16[_0xcbc5('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5a1e16[_0xcbc5('0x16')]?_0x5a1e16['options']['where']||null:null,'attributes':_0x5a1e16[_0xcbc5('0x16')]?_0x5a1e16[_0xcbc5('0x16')][_0xcbc5('0x19')]||null:null,'include':_0x5a1e16[_0xcbc5('0x16')]?_0x5a1e16[_0xcbc5('0x16')][_0xcbc5('0x1b')]?_[_0xcbc5('0x1c')](_0x5a1e16[_0xcbc5('0x16')][_0xcbc5('0x1b')],function(_0x5ad3d5){return{'model':db[_0x5ad3d5[_0xcbc5('0x1d')]],'as':_0x5ad3d5['as'],'attributes':_0x5ad3d5['attributes'],'include':_0x5ad3d5[_0xcbc5('0x1b')]?_['map'](_0x5ad3d5[_0xcbc5('0x1b')],function(_0x3b14a4){return{'model':db[_0x3b14a4[_0xcbc5('0x1d')]],'as':_0x3b14a4['as'],'attributes':_0x3b14a4['attributes'],'include':_0x3b14a4[_0xcbc5('0x1b')]?_[_0xcbc5('0x1c')](_0x3b14a4['include'],function(_0x55f1c6){return{'model':db[_0x55f1c6[_0xcbc5('0x1d')]],'as':_0x55f1c6['as'],'attributes':_0x55f1c6[_0xcbc5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcbc5('0x1e')](function(_0xa87a8d){logger['info'](_0xcbc5('0x20'),_0x5a1e16);logger['debug'](_0xcbc5('0x20'),_0x5a1e16,JSON[_0xcbc5('0xf')](_0xa87a8d));_0x50cc56(_0xa87a8d);})[_0xcbc5('0x22')](function(_0x4c4e97){logger[_0xcbc5('0x10')](_0xcbc5('0x20'),_0x4c4e97['message'],_0x5a1e16);_0x13a1cc(_0x31471f[_0xcbc5('0x10')](0x1f4,_0x4c4e97[_0xcbc5('0x12')]));});});}; \ No newline at end of file +var _0x423c=['include','model','stringify','catch','ShowSalesforceAccount','lodash','util','ioredis','../../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','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','map'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x423c,0x68));var _0xc423=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x423c[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xc423('0x0'));var util=require(_0xc423('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc423('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc423('0x3'));var logger=require(_0xc423('0x4'))(_0xc423('0x5'));var config=require(_0xc423('0x6'));var jayson=require(_0xc423('0x7'));var client=jayson[_0xc423('0x8')][_0xc423('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a4da,_0x342f6b,_0x40f2af){return new BPromise(function(_0x11887e,_0x350b35){return client[_0xc423('0xa')](_0x35a4da,_0x40f2af)[_0xc423('0xb')](function(_0x14850a){logger[_0xc423('0xc')](_0xc423('0xd'),_0x342f6b,_0xc423('0xe'));logger[_0xc423('0xf')](_0xc423('0x10'),_0x342f6b,_0xc423('0xe'),JSON['stringify'](_0x14850a));if(_0x14850a[_0xc423('0x11')]){if(_0x14850a[_0xc423('0x11')]['code']===0x1f4){logger[_0xc423('0x11')](_0xc423('0xd'),_0x342f6b,_0x14850a[_0xc423('0x11')][_0xc423('0x12')]);return _0x350b35(_0x14850a[_0xc423('0x11')][_0xc423('0x12')]);}logger[_0xc423('0x11')](_0xc423('0xd'),_0x342f6b,_0x14850a[_0xc423('0x11')][_0xc423('0x12')]);return _0x11887e(_0x14850a[_0xc423('0x11')][_0xc423('0x12')]);}else{logger[_0xc423('0xc')](_0xc423('0xd'),_0x342f6b,_0xc423('0xe'));_0x11887e(_0x14850a[_0xc423('0x13')][_0xc423('0x12')]);}})['catch'](function(_0x194f3c){logger[_0xc423('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x342f6b,_0x194f3c);_0x350b35(_0x194f3c);});});}exports[_0xc423('0x14')]=function(_0x4e9e42){var _0x3f3881=this;return new Promise(function(_0x2587fe,_0x2cac58){return db[_0xc423('0x15')][_0xc423('0x16')]({'raw':_0x4e9e42[_0xc423('0x17')]?_0x4e9e42[_0xc423('0x17')][_0xc423('0x18')]===undefined?!![]:![]:!![],'where':_0x4e9e42['options']?_0x4e9e42[_0xc423('0x17')][_0xc423('0x19')]||null:null,'attributes':_0x4e9e42['options']?_0x4e9e42[_0xc423('0x17')][_0xc423('0x1a')]||null:null,'limit':_0x4e9e42[_0xc423('0x17')]?_0x4e9e42[_0xc423('0x17')]['limit']||null:null,'include':_0x4e9e42[_0xc423('0x17')]?_0x4e9e42[_0xc423('0x17')]['include']?_[_0xc423('0x1b')](_0x4e9e42[_0xc423('0x17')][_0xc423('0x1c')],function(_0x482a9b){return{'model':db[_0x482a9b[_0xc423('0x1d')]],'as':_0x482a9b['as'],'attributes':_0x482a9b[_0xc423('0x1a')],'include':_0x482a9b[_0xc423('0x1c')]?_[_0xc423('0x1b')](_0x482a9b[_0xc423('0x1c')],function(_0x55e457){return{'model':db[_0x55e457[_0xc423('0x1d')]],'as':_0x55e457['as'],'attributes':_0x55e457[_0xc423('0x1a')],'include':_0x55e457[_0xc423('0x1c')]?_[_0xc423('0x1b')](_0x55e457[_0xc423('0x1c')],function(_0x1e84d0){return{'model':db[_0x1e84d0[_0xc423('0x1d')]],'as':_0x1e84d0['as'],'attributes':_0x1e84d0[_0xc423('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc423('0xb')](function(_0x47ed96){logger['info'](_0xc423('0x14'),_0x4e9e42);logger[_0xc423('0xf')]('GetSalesforceAccount',_0x4e9e42,JSON[_0xc423('0x1e')](_0x47ed96));_0x2587fe(_0x47ed96);})[_0xc423('0x1f')](function(_0x3574d1){logger[_0xc423('0x11')]('GetSalesforceAccount',_0x3574d1[_0xc423('0x12')],_0x4e9e42);_0x2cac58(_0x3f3881['error'](0x1f4,_0x3574d1[_0xc423('0x12')]));});});};exports[_0xc423('0x20')]=function(_0x50bf47){var _0x1ad61d=this;return new Promise(function(_0x356a70,_0x59dc45){return db[_0xc423('0x15')]['find']({'raw':_0x50bf47['options']?_0x50bf47['options'][_0xc423('0x18')]===undefined?!![]:![]:!![],'where':_0x50bf47[_0xc423('0x17')]?_0x50bf47[_0xc423('0x17')][_0xc423('0x19')]||null:null,'attributes':_0x50bf47['options']?_0x50bf47[_0xc423('0x17')][_0xc423('0x1a')]||null:null,'include':_0x50bf47['options']?_0x50bf47[_0xc423('0x17')][_0xc423('0x1c')]?_[_0xc423('0x1b')](_0x50bf47[_0xc423('0x17')]['include'],function(_0x1c891b){return{'model':db[_0x1c891b[_0xc423('0x1d')]],'as':_0x1c891b['as'],'attributes':_0x1c891b['attributes'],'include':_0x1c891b[_0xc423('0x1c')]?_[_0xc423('0x1b')](_0x1c891b[_0xc423('0x1c')],function(_0x3d5ffd){return{'model':db[_0x3d5ffd['model']],'as':_0x3d5ffd['as'],'attributes':_0x3d5ffd[_0xc423('0x1a')],'include':_0x3d5ffd[_0xc423('0x1c')]?_[_0xc423('0x1b')](_0x3d5ffd[_0xc423('0x1c')],function(_0xb43357){return{'model':db[_0xb43357[_0xc423('0x1d')]],'as':_0xb43357['as'],'attributes':_0xb43357[_0xc423('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc423('0xb')](function(_0x18aff1){logger['info'](_0xc423('0x20'),_0x50bf47);logger[_0xc423('0xf')](_0xc423('0x20'),_0x50bf47,JSON[_0xc423('0x1e')](_0x18aff1));_0x356a70(_0x18aff1);})[_0xc423('0x1f')](function(_0x17032d){logger[_0xc423('0x11')](_0xc423('0x20'),_0x17032d[_0xc423('0x12')],_0x50bf47);_0x59dc45(_0x1ad61d[_0xc423('0x11')](0x1f4,_0x17032d[_0xc423('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 0a198a0..b45ec15 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x0b0e[_0x207811];return _0x170d56;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x34cbcb,_0x24e6c3){var _0x473349=function(_0x19584b){while(--_0x19584b){_0x34cbcb['push'](_0x34cbcb['shift']());}};_0x473349(++_0x24e6c3);}(_0xadb5,0xad));var _0x5adb=function(_0x1104fd,_0x481ecd){_0x1104fd=_0x1104fd-0x0;var _0x37ee00=_0xadb5[_0x1104fd];return _0x37ee00;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 85d8562..50cdd19 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 _0x7817=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','nothing','sequelize'];(function(_0xdde379,_0x112d6c){var _0x524284=function(_0x36421b){while(--_0x36421b){_0xdde379['push'](_0xdde379['shift']());}};_0x524284(++_0x112d6c);}(_0x7817,0x185));var _0x7781=function(_0x56d26d,_0x14e1e1){_0x56d26d=_0x56d26d-0x0;var _0x6bca55=_0x7817[_0x56d26d];return _0x6bca55;};'use strict';var Sequelize=require(_0x7781('0x0'));module[_0x7781('0x1')]={'name':{'type':Sequelize[_0x7781('0x2')]},'description':{'type':Sequelize[_0x7781('0x2')]},'ticketType':{'type':Sequelize[_0x7781('0x3')](_0x7781('0x4'),_0x7781('0x5')),'defaultValue':_0x7781('0x4')},'moduleSearch':{'type':Sequelize[_0x7781('0x3')](_0x7781('0x6'),_0x7781('0x7'),_0x7781('0x8'),'account_contact_lead','account'),'defaultValue':_0x7781('0x6')},'moduleCreate':{'type':Sequelize[_0x7781('0x3')](_0x7781('0x9'),_0x7781('0x7'),'lead','account'),'defaultValue':_0x7781('0x8')},'leadId':{'type':Sequelize[_0x7781('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x7781('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcb6a=['lead','account','sequelize','exports','STRING','Task','Case','ENUM','contact_lead','contact','account_contact_lead','nothing'];(function(_0x1a09f3,_0x55835f){var _0x4bf28c=function(_0x543041){while(--_0x543041){_0x1a09f3['push'](_0x1a09f3['shift']());}};_0x4bf28c(++_0x55835f);}(_0xcb6a,0x16a));var _0xacb6=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcb6a[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xacb6('0x0'));module[_0xacb6('0x1')]={'name':{'type':Sequelize[_0xacb6('0x2')]},'description':{'type':Sequelize[_0xacb6('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xacb6('0x3'),_0xacb6('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xacb6('0x5')](_0xacb6('0x6'),_0xacb6('0x7'),'lead',_0xacb6('0x8'),'account'),'defaultValue':_0xacb6('0x6')},'moduleCreate':{'type':Sequelize[_0xacb6('0x5')](_0xacb6('0x9'),_0xacb6('0x7'),_0xacb6('0xa'),_0xacb6('0xb')),'defaultValue':_0xacb6('0xa')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xacb6('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xacb6('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b5ec930..5d69d18 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 _0x8178=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','create','body','find','params','SalesforceField','rawAttributes','order','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x212bbf,_0x3aea75){var _0x2b17b6=function(_0x4f6808){while(--_0x4f6808){_0x212bbf['push'](_0x212bbf['shift']());}};_0x2b17b6(++_0x3aea75);}(_0x8178,0x8f));var _0x8817=function(_0x2c69f2,_0x5b0e39){_0x2c69f2=_0x2c69f2-0x0;var _0x2276a9=_0x8178[_0x2c69f2];return _0x2276a9;};'use strict';var emlformat=require(_0x8817('0x0'));var rimraf=require(_0x8817('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8817('0x2'));var rp=require(_0x8817('0x3'));var moment=require('moment');var BPromise=require(_0x8817('0x4'));var Mustache=require(_0x8817('0x5'));var util=require(_0x8817('0x6'));var path=require(_0x8817('0x7'));var sox=require('sox');var csv=require(_0x8817('0x8'));var ejs=require(_0x8817('0x9'));var fs=require('fs');var fs_extra=require(_0x8817('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8817('0xb'));var deskjs=require(_0x8817('0xc'));var toCsv=require(_0x8817('0x8'));var querystring=require(_0x8817('0xd'));var Papa=require(_0x8817('0xe'));var Redis=require(_0x8817('0xf'));var authService=require(_0x8817('0x10'));var qs=require(_0x8817('0x11'));var as=require(_0x8817('0x12'));var hardwareService=require(_0x8817('0x13'));var logger=require(_0x8817('0x14'))(_0x8817('0x15'));var utils=require(_0x8817('0x16'));var config=require(_0x8817('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8817('0x18'))['db'];function respondWithStatusCode(_0x1f3cd5,_0x1c45da){_0x1c45da=_0x1c45da||0xcc;return function(_0x3b606c){if(_0x3b606c){return _0x1f3cd5['sendStatus'](_0x1c45da);}return _0x1f3cd5[_0x8817('0x19')](_0x1c45da)['end']();};}function respondWithResult(_0x42e336,_0x5735ce){_0x5735ce=_0x5735ce||0xc8;return function(_0x2d8677){if(_0x2d8677){return _0x42e336[_0x8817('0x19')](_0x5735ce)[_0x8817('0x1a')](_0x2d8677);}};}function respondWithFilteredResult(_0x468388,_0x2c4823){return function(_0x35c775){if(_0x35c775){var _0x421f79=typeof _0x2c4823[_0x8817('0x1b')]==='undefined'&&typeof _0x2c4823[_0x8817('0x1c')]===_0x8817('0x1d');var _0x415e99=_0x35c775[_0x8817('0x1e')];var _0x1abb93=_0x421f79?0x0:_0x2c4823[_0x8817('0x1b')];var _0xf73f00=_0x421f79?_0x35c775[_0x8817('0x1e')]:_0x2c4823[_0x8817('0x1b')]+_0x2c4823[_0x8817('0x1c')];var _0x354adb;if(_0xf73f00>=_0x415e99){_0xf73f00=_0x415e99;_0x354adb=0xc8;}else{_0x354adb=0xce;}_0x468388[_0x8817('0x19')](_0x354adb);return _0x468388[_0x8817('0x1f')](_0x8817('0x20'),_0x1abb93+'-'+_0xf73f00+'/'+_0x415e99)['json'](_0x35c775);}return null;};}function patchUpdates(_0x99a8f2){return function(_0x33de6d){try{jsonpatch[_0x8817('0x21')](_0x33de6d,_0x99a8f2,!![]);}catch(_0x4a8e2c){return BPromise[_0x8817('0x22')](_0x4a8e2c);}return _0x33de6d[_0x8817('0x23')]();};}function saveUpdates(_0x2946e0,_0x30f476){return function(_0x3689e6){if(_0x3689e6){return _0x3689e6[_0x8817('0x24')](_0x2946e0)['then'](function(_0x7e04e0){return _0x7e04e0;});}return null;};}function removeEntity(_0x255656,_0x4c0e28){return function(_0x3801cd){if(_0x3801cd){return _0x3801cd[_0x8817('0x25')]()[_0x8817('0x26')](function(){_0x255656[_0x8817('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128202,_0x3252b8){return function(_0x2e8314){if(!_0x2e8314){_0x128202['sendStatus'](0x194);}return _0x2e8314;};}function handleError(_0x3fdf38,_0x4fa00c){_0x4fa00c=_0x4fa00c||0x1f4;return function(_0x23659d){logger[_0x8817('0x27')](_0x23659d[_0x8817('0x28')]);if(_0x23659d[_0x8817('0x29')]){delete _0x23659d[_0x8817('0x29')];}_0x3fdf38[_0x8817('0x19')](_0x4fa00c)['send'](_0x23659d);};}exports[_0x8817('0x2a')]=function(_0x3bb0b5,_0x27fa91){var _0xcc4da8={},_0x323b63={},_0x5393f8={'count':0x0,'rows':[]};var _0xa9f1cf=_[_0x8817('0x2b')](db['SalesforceConfiguration']['rawAttributes'],function(_0x104c39){return{'name':_0x104c39[_0x8817('0x2c')],'type':_0x104c39[_0x8817('0x2d')][_0x8817('0x2e')]};});_0x323b63[_0x8817('0x2f')]=_[_0x8817('0x2b')](_0xa9f1cf,_0x8817('0x29'));_0x323b63['query']=_[_0x8817('0x30')](_0x3bb0b5[_0x8817('0x31')]);_0x323b63[_0x8817('0x32')]=_['intersection'](_0x323b63['model'],_0x323b63[_0x8817('0x31')]);_0xcc4da8['attributes']=_[_0x8817('0x33')](_0x323b63[_0x8817('0x2f')],qs['fields'](_0x3bb0b5[_0x8817('0x31')][_0x8817('0x34')]));_0xcc4da8[_0x8817('0x35')]=_0xcc4da8[_0x8817('0x35')][_0x8817('0x36')]?_0xcc4da8['attributes']:_0x323b63[_0x8817('0x2f')];if(!_0x3bb0b5[_0x8817('0x31')]['hasOwnProperty'](_0x8817('0x37'))){_0xcc4da8[_0x8817('0x1c')]=qs['limit'](_0x3bb0b5['query'][_0x8817('0x1c')]);_0xcc4da8[_0x8817('0x1b')]=qs[_0x8817('0x1b')](_0x3bb0b5['query'][_0x8817('0x1b')]);}_0xcc4da8['order']=qs['sort'](_0x3bb0b5[_0x8817('0x31')][_0x8817('0x38')]);_0xcc4da8[_0x8817('0x39')]=qs[_0x8817('0x32')](_[_0x8817('0x3a')](_0x3bb0b5['query'],_0x323b63[_0x8817('0x32')]),_0xa9f1cf);if(_0x3bb0b5['query'][_0x8817('0x3b')]){_0xcc4da8[_0x8817('0x39')]=_['merge'](_0xcc4da8[_0x8817('0x39')],{'$or':_['map'](_0xa9f1cf,function(_0x44d528){if(_0x44d528['type']!==_0x8817('0x3c')){var _0x11f52d={};_0x11f52d[_0x44d528['name']]={'$like':'%'+_0x3bb0b5['query'][_0x8817('0x3b')]+'%'};return _0x11f52d;}})});}_0xcc4da8=_[_0x8817('0x3d')]({},_0xcc4da8,_0x3bb0b5[_0x8817('0x3e')]);var _0x52e64b={'where':_0xcc4da8[_0x8817('0x39')]};return db[_0x8817('0x3f')][_0x8817('0x1e')](_0x52e64b)[_0x8817('0x26')](function(_0xa0e516){_0x5393f8[_0x8817('0x1e')]=_0xa0e516;if(_0x3bb0b5[_0x8817('0x31')][_0x8817('0x40')]){_0xcc4da8[_0x8817('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x8817('0x42')](_0xcc4da8);})[_0x8817('0x26')](function(_0x4fb3c3){_0x5393f8[_0x8817('0x43')]=_0x4fb3c3;return _0x5393f8;})[_0x8817('0x26')](respondWithFilteredResult(_0x27fa91,_0xcc4da8))[_0x8817('0x44')](handleError(_0x27fa91,null));};exports[_0x8817('0x45')]=function(_0x5a1e24,_0x15b4c6){var _0x20ae95={'raw':![],'where':{'id':_0x5a1e24['params']['id']}},_0x149de9={};_0x149de9[_0x8817('0x2f')]=_[_0x8817('0x30')](db[_0x8817('0x3f')]['rawAttributes']);_0x149de9[_0x8817('0x31')]=_[_0x8817('0x30')](_0x5a1e24[_0x8817('0x31')]);_0x149de9[_0x8817('0x32')]=_[_0x8817('0x33')](_0x149de9[_0x8817('0x2f')],_0x149de9['query']);_0x20ae95['attributes']=_[_0x8817('0x33')](_0x149de9[_0x8817('0x2f')],qs[_0x8817('0x34')](_0x5a1e24[_0x8817('0x31')][_0x8817('0x34')]));_0x20ae95[_0x8817('0x35')]=_0x20ae95['attributes'][_0x8817('0x36')]?_0x20ae95[_0x8817('0x35')]:_0x149de9[_0x8817('0x2f')];if(_0x5a1e24[_0x8817('0x31')][_0x8817('0x40')]){_0x20ae95[_0x8817('0x41')]=[{'all':!![]}];}_0x20ae95=_[_0x8817('0x3d')]({},_0x20ae95,_0x5a1e24[_0x8817('0x3e')]);return db['SalesforceConfiguration']['find'](_0x20ae95)['then'](handleEntityNotFound(_0x15b4c6,null))['then'](respondWithResult(_0x15b4c6,null))['catch'](handleError(_0x15b4c6,null));};exports[_0x8817('0x46')]=function(_0x2fb736,_0x25a4f2){return db[_0x8817('0x3f')][_0x8817('0x46')](_0x2fb736[_0x8817('0x47')],{})['then'](respondWithResult(_0x25a4f2,0xc9))[_0x8817('0x44')](handleError(_0x25a4f2,null));};exports[_0x8817('0x24')]=function(_0xb040b7,_0x105901){if(_0xb040b7[_0x8817('0x47')]['id']){delete _0xb040b7[_0x8817('0x47')]['id'];}return db[_0x8817('0x3f')][_0x8817('0x48')]({'where':{'id':_0xb040b7['params']['id']}})[_0x8817('0x26')](handleEntityNotFound(_0x105901,null))[_0x8817('0x26')](saveUpdates(_0xb040b7['body'],null))[_0x8817('0x26')](respondWithResult(_0x105901,null))[_0x8817('0x44')](handleError(_0x105901,null));};exports[_0x8817('0x25')]=function(_0x3daff1,_0x2c6538){return db[_0x8817('0x3f')][_0x8817('0x48')]({'where':{'id':_0x3daff1['params']['id']}})[_0x8817('0x26')](handleEntityNotFound(_0x2c6538,null))[_0x8817('0x26')](removeEntity(_0x2c6538,null))[_0x8817('0x44')](handleError(_0x2c6538,null));};exports['getFields']=function(_0x2b8923,_0x3cdc34,_0x2bdb1c){var _0x40d79f={};var _0x1cd0f={};var _0x55f75d;var _0x453844;return db[_0x8817('0x3f')]['findOne']({'where':{'id':_0x2b8923[_0x8817('0x49')]['id']}})[_0x8817('0x26')](handleEntityNotFound(_0x3cdc34,null))['then'](function(_0xccf9d1){if(_0xccf9d1){_0x55f75d=_0xccf9d1;_0x1cd0f['model']=_[_0x8817('0x30')](db[_0x8817('0x4a')][_0x8817('0x4b')]);_0x1cd0f['query']=_[_0x8817('0x30')](_0x2b8923[_0x8817('0x31')]);_0x1cd0f[_0x8817('0x32')]=_[_0x8817('0x33')](_0x1cd0f['model'],_0x1cd0f[_0x8817('0x31')]);_0x40d79f['attributes']=_[_0x8817('0x33')](_0x1cd0f[_0x8817('0x2f')],qs[_0x8817('0x34')](_0x2b8923[_0x8817('0x31')]['fields']));_0x40d79f[_0x8817('0x35')]=_0x40d79f[_0x8817('0x35')][_0x8817('0x36')]?_0x40d79f['attributes']:_0x1cd0f['model'];_0x40d79f[_0x8817('0x4c')]=qs['sort'](_0x2b8923[_0x8817('0x31')][_0x8817('0x38')]);_0x40d79f['where']=qs[_0x8817('0x32')](_[_0x8817('0x3a')](_0x2b8923['query'],_0x1cd0f[_0x8817('0x32')]));if(_0x2b8923[_0x8817('0x31')][_0x8817('0x3b')]){_0x40d79f['where']=_['merge'](_0x40d79f['where'],{'$or':_[_0x8817('0x2b')](_0x40d79f[_0x8817('0x35')],function(_0xc11fcd){var _0x7c73d={};_0x7c73d[_0xc11fcd]={'$like':'%'+_0x2b8923[_0x8817('0x31')]['filter']+'%'};return _0x7c73d;})});}_0x40d79f=_[_0x8817('0x3d')]({},_0x40d79f,_0x2b8923[_0x8817('0x3e')]);return _0x55f75d[_0x8817('0x4d')](_0x40d79f);}})[_0x8817('0x26')](function(_0x53b1ec){if(_0x53b1ec){_0x453844=_0x53b1ec[_0x8817('0x36')];if(!_0x2b8923[_0x8817('0x31')][_0x8817('0x4e')](_0x8817('0x37'))){_0x40d79f['limit']=qs[_0x8817('0x1c')](_0x2b8923['query'][_0x8817('0x1c')]);_0x40d79f['offset']=qs[_0x8817('0x1b')](_0x2b8923[_0x8817('0x31')]['offset']);}return _0x55f75d[_0x8817('0x4d')](_0x40d79f);}})['then'](function(_0x3dbead){if(_0x3dbead){return _0x3dbead?{'count':_0x453844,'rows':_0x3dbead}:null;}})[_0x8817('0x26')](respondWithResult(_0x3cdc34,null))[_0x8817('0x44')](handleError(_0x3cdc34,null));};exports[_0x8817('0x4f')]=function(_0x1c444d,_0xd2d44,_0x48d696){var _0x222a41={};var _0x44d5aa={};var _0x1ba664;var _0x5c84b5;return db[_0x8817('0x3f')]['findOne']({'where':{'id':_0x1c444d[_0x8817('0x49')]['id']}})['then'](handleEntityNotFound(_0xd2d44,null))[_0x8817('0x26')](function(_0x2404a9){if(_0x2404a9){_0x1ba664=_0x2404a9;_0x44d5aa[_0x8817('0x2f')]=_[_0x8817('0x30')](db[_0x8817('0x4a')][_0x8817('0x4b')]);_0x44d5aa['query']=_[_0x8817('0x30')](_0x1c444d[_0x8817('0x31')]);_0x44d5aa[_0x8817('0x32')]=_[_0x8817('0x33')](_0x44d5aa['model'],_0x44d5aa[_0x8817('0x31')]);_0x222a41[_0x8817('0x35')]=_[_0x8817('0x33')](_0x44d5aa['model'],qs[_0x8817('0x34')](_0x1c444d[_0x8817('0x31')][_0x8817('0x34')]));_0x222a41[_0x8817('0x35')]=_0x222a41[_0x8817('0x35')][_0x8817('0x36')]?_0x222a41[_0x8817('0x35')]:_0x44d5aa[_0x8817('0x2f')];_0x222a41['order']=qs['sort'](_0x1c444d[_0x8817('0x31')]['sort']);_0x222a41[_0x8817('0x39')]=qs[_0x8817('0x32')](_[_0x8817('0x3a')](_0x1c444d[_0x8817('0x31')],_0x44d5aa[_0x8817('0x32')]));if(_0x1c444d[_0x8817('0x31')][_0x8817('0x3b')]){_0x222a41[_0x8817('0x39')]=_['merge'](_0x222a41[_0x8817('0x39')],{'$or':_[_0x8817('0x2b')](_0x222a41[_0x8817('0x35')],function(_0x323a96){var _0x30049d={};_0x30049d[_0x323a96]={'$like':'%'+_0x1c444d['query'][_0x8817('0x3b')]+'%'};return _0x30049d;})});}_0x222a41=_[_0x8817('0x3d')]({},_0x222a41,_0x1c444d[_0x8817('0x3e')]);return _0x1ba664[_0x8817('0x4f')](_0x222a41);}})[_0x8817('0x26')](function(_0x5e9122){if(_0x5e9122){_0x5c84b5=_0x5e9122[_0x8817('0x36')];if(!_0x1c444d[_0x8817('0x31')][_0x8817('0x4e')](_0x8817('0x37'))){_0x222a41[_0x8817('0x1c')]=qs[_0x8817('0x1c')](_0x1c444d[_0x8817('0x31')][_0x8817('0x1c')]);_0x222a41['offset']=qs[_0x8817('0x1b')](_0x1c444d['query'][_0x8817('0x1b')]);}return _0x1ba664['getSubjects'](_0x222a41);}})[_0x8817('0x26')](function(_0x11ea12){if(_0x11ea12){return _0x11ea12?{'count':_0x5c84b5,'rows':_0x11ea12}:null;}})['then'](respondWithResult(_0xd2d44,null))[_0x8817('0x44')](handleError(_0xd2d44,null));};exports[_0x8817('0x50')]=function(_0x4babbb,_0x20c382,_0x28c77d){var _0x4bc366={};var _0xfd04e1={};var _0x2d3f40;var _0x236270;return db[_0x8817('0x3f')]['findOne']({'where':{'id':_0x4babbb[_0x8817('0x49')]['id']}})[_0x8817('0x26')](handleEntityNotFound(_0x20c382,null))[_0x8817('0x26')](function(_0x377dc3){if(_0x377dc3){_0x2d3f40=_0x377dc3;_0xfd04e1[_0x8817('0x2f')]=_[_0x8817('0x30')](db[_0x8817('0x4a')][_0x8817('0x4b')]);_0xfd04e1[_0x8817('0x31')]=_[_0x8817('0x30')](_0x4babbb['query']);_0xfd04e1[_0x8817('0x32')]=_[_0x8817('0x33')](_0xfd04e1[_0x8817('0x2f')],_0xfd04e1['query']);_0x4bc366['attributes']=_['intersection'](_0xfd04e1[_0x8817('0x2f')],qs[_0x8817('0x34')](_0x4babbb[_0x8817('0x31')]['fields']));_0x4bc366['attributes']=_0x4bc366['attributes'][_0x8817('0x36')]?_0x4bc366[_0x8817('0x35')]:_0xfd04e1['model'];_0x4bc366[_0x8817('0x4c')]=qs[_0x8817('0x38')](_0x4babbb[_0x8817('0x31')][_0x8817('0x38')]);_0x4bc366[_0x8817('0x39')]=qs[_0x8817('0x32')](_['pick'](_0x4babbb[_0x8817('0x31')],_0xfd04e1[_0x8817('0x32')]));if(_0x4babbb[_0x8817('0x31')][_0x8817('0x3b')]){_0x4bc366['where']=_[_0x8817('0x3d')](_0x4bc366['where'],{'$or':_[_0x8817('0x2b')](_0x4bc366[_0x8817('0x35')],function(_0x5152aa){var _0x3d3775={};_0x3d3775[_0x5152aa]={'$like':'%'+_0x4babbb[_0x8817('0x31')][_0x8817('0x3b')]+'%'};return _0x3d3775;})});}_0x4bc366=_[_0x8817('0x3d')]({},_0x4bc366,_0x4babbb[_0x8817('0x3e')]);return _0x2d3f40[_0x8817('0x50')](_0x4bc366);}})[_0x8817('0x26')](function(_0x5b1485){if(_0x5b1485){_0x236270=_0x5b1485[_0x8817('0x36')];if(!_0x4babbb[_0x8817('0x31')][_0x8817('0x4e')](_0x8817('0x37'))){_0x4bc366[_0x8817('0x1c')]=qs[_0x8817('0x1c')](_0x4babbb[_0x8817('0x31')][_0x8817('0x1c')]);_0x4bc366['offset']=qs[_0x8817('0x1b')](_0x4babbb[_0x8817('0x31')][_0x8817('0x1b')]);}return _0x2d3f40[_0x8817('0x50')](_0x4bc366);}})[_0x8817('0x26')](function(_0x406ed6){if(_0x406ed6){return _0x406ed6?{'count':_0x236270,'rows':_0x406ed6}:null;}})[_0x8817('0x26')](respondWithResult(_0x20c382,null))[_0x8817('0x44')](handleError(_0x20c382,null));}; \ No newline at end of file +var _0xe0fb=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','params','keys','create','body','catch','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0xe0fb,0xa6));var _0xbe0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0fb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbe0f('0x0'));var rimraf=require(_0xbe0f('0x1'));var zipdir=require(_0xbe0f('0x2'));var jsonpatch=require(_0xbe0f('0x3'));var rp=require(_0xbe0f('0x4'));var moment=require(_0xbe0f('0x5'));var BPromise=require(_0xbe0f('0x6'));var Mustache=require(_0xbe0f('0x7'));var util=require(_0xbe0f('0x8'));var path=require('path');var sox=require(_0xbe0f('0x9'));var csv=require(_0xbe0f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe0f('0xb'));var _=require(_0xbe0f('0xc'));var squel=require(_0xbe0f('0xd'));var crypto=require(_0xbe0f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbe0f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbe0f('0x10'));var Papa=require(_0xbe0f('0x11'));var Redis=require(_0xbe0f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbe0f('0x13'));var as=require(_0xbe0f('0x14'));var hardwareService=require(_0xbe0f('0x15'));var logger=require(_0xbe0f('0x16'))(_0xbe0f('0x17'));var utils=require(_0xbe0f('0x18'));var config=require(_0xbe0f('0x19'));var licenseUtil=require(_0xbe0f('0x1a'));var db=require(_0xbe0f('0x1b'))['db'];function respondWithStatusCode(_0x367a5c,_0x102bf8){_0x102bf8=_0x102bf8||0xcc;return function(_0x48ce56){if(_0x48ce56){return _0x367a5c['sendStatus'](_0x102bf8);}return _0x367a5c[_0xbe0f('0x1c')](_0x102bf8)[_0xbe0f('0x1d')]();};}function respondWithResult(_0x31d789,_0x4eaa11){_0x4eaa11=_0x4eaa11||0xc8;return function(_0x5b600){if(_0x5b600){return _0x31d789[_0xbe0f('0x1c')](_0x4eaa11)[_0xbe0f('0x1e')](_0x5b600);}};}function respondWithFilteredResult(_0x7a6c8a,_0x33445e){return function(_0x2dd113){if(_0x2dd113){var _0x4ad7c4=typeof _0x33445e[_0xbe0f('0x1f')]===_0xbe0f('0x20')&&typeof _0x33445e[_0xbe0f('0x21')]===_0xbe0f('0x20');var _0xf1f2f7=_0x2dd113['count'];var _0x1c3d2e=_0x4ad7c4?0x0:_0x33445e[_0xbe0f('0x1f')];var _0x59a89e=_0x4ad7c4?_0x2dd113['count']:_0x33445e['offset']+_0x33445e['limit'];var _0x126197;if(_0x59a89e>=_0xf1f2f7){_0x59a89e=_0xf1f2f7;_0x126197=0xc8;}else{_0x126197=0xce;}_0x7a6c8a[_0xbe0f('0x1c')](_0x126197);return _0x7a6c8a[_0xbe0f('0x22')](_0xbe0f('0x23'),_0x1c3d2e+'-'+_0x59a89e+'/'+_0xf1f2f7)[_0xbe0f('0x1e')](_0x2dd113);}return null;};}function patchUpdates(_0x4fb3db){return function(_0x375af9){try{jsonpatch[_0xbe0f('0x24')](_0x375af9,_0x4fb3db,!![]);}catch(_0x1048e4){return BPromise[_0xbe0f('0x25')](_0x1048e4);}return _0x375af9[_0xbe0f('0x26')]();};}function saveUpdates(_0x38bedb,_0x406aba){return function(_0x2f52bf){if(_0x2f52bf){return _0x2f52bf[_0xbe0f('0x27')](_0x38bedb)['then'](function(_0x5c2dc3){return _0x5c2dc3;});}return null;};}function removeEntity(_0x5eec1f,_0x2f3dbd){return function(_0x1c43db){if(_0x1c43db){return _0x1c43db['destroy']()[_0xbe0f('0x28')](function(){_0x5eec1f[_0xbe0f('0x1c')](0xcc)[_0xbe0f('0x1d')]();});}};}function handleEntityNotFound(_0x320ba2,_0x5188fc){return function(_0xc0f619){if(!_0xc0f619){_0x320ba2[_0xbe0f('0x29')](0x194);}return _0xc0f619;};}function handleError(_0x49f9ec,_0x3c391e){_0x3c391e=_0x3c391e||0x1f4;return function(_0x4c664f){logger[_0xbe0f('0x2a')](_0x4c664f[_0xbe0f('0x2b')]);if(_0x4c664f[_0xbe0f('0x2c')]){delete _0x4c664f[_0xbe0f('0x2c')];}_0x49f9ec['status'](_0x3c391e)[_0xbe0f('0x2d')](_0x4c664f);};}exports['index']=function(_0x5eaf2e,_0x485260){var _0x302d83={},_0x30c26c={},_0x21856a={'count':0x0,'rows':[]};var _0x588ee7=_[_0xbe0f('0x2e')](db[_0xbe0f('0x2f')][_0xbe0f('0x30')],function(_0x5e5a35){return{'name':_0x5e5a35['fieldName'],'type':_0x5e5a35[_0xbe0f('0x31')][_0xbe0f('0x32')]};});_0x30c26c[_0xbe0f('0x33')]=_[_0xbe0f('0x2e')](_0x588ee7,_0xbe0f('0x2c'));_0x30c26c[_0xbe0f('0x34')]=_['keys'](_0x5eaf2e[_0xbe0f('0x34')]);_0x30c26c[_0xbe0f('0x35')]=_[_0xbe0f('0x36')](_0x30c26c['model'],_0x30c26c[_0xbe0f('0x34')]);_0x302d83[_0xbe0f('0x37')]=_[_0xbe0f('0x36')](_0x30c26c[_0xbe0f('0x33')],qs[_0xbe0f('0x38')](_0x5eaf2e[_0xbe0f('0x34')][_0xbe0f('0x38')]));_0x302d83['attributes']=_0x302d83[_0xbe0f('0x37')][_0xbe0f('0x39')]?_0x302d83['attributes']:_0x30c26c['model'];if(!_0x5eaf2e[_0xbe0f('0x34')][_0xbe0f('0x3a')]('nolimit')){_0x302d83[_0xbe0f('0x21')]=qs['limit'](_0x5eaf2e[_0xbe0f('0x34')]['limit']);_0x302d83['offset']=qs[_0xbe0f('0x1f')](_0x5eaf2e['query']['offset']);}_0x302d83[_0xbe0f('0x3b')]=qs[_0xbe0f('0x3c')](_0x5eaf2e[_0xbe0f('0x34')][_0xbe0f('0x3c')]);_0x302d83['where']=qs[_0xbe0f('0x35')](_[_0xbe0f('0x3d')](_0x5eaf2e[_0xbe0f('0x34')],_0x30c26c[_0xbe0f('0x35')]),_0x588ee7);if(_0x5eaf2e['query'][_0xbe0f('0x3e')]){_0x302d83['where']=_[_0xbe0f('0x3f')](_0x302d83['where'],{'$or':_[_0xbe0f('0x2e')](_0x588ee7,function(_0x411a6a){if(_0x411a6a[_0xbe0f('0x31')]!==_0xbe0f('0x40')){var _0x56121a={};_0x56121a[_0x411a6a[_0xbe0f('0x2c')]]={'$like':'%'+_0x5eaf2e[_0xbe0f('0x34')][_0xbe0f('0x3e')]+'%'};return _0x56121a;}})});}_0x302d83=_[_0xbe0f('0x3f')]({},_0x302d83,_0x5eaf2e[_0xbe0f('0x41')]);var _0x3751e1={'where':_0x302d83[_0xbe0f('0x42')]};return db[_0xbe0f('0x2f')][_0xbe0f('0x43')](_0x3751e1)['then'](function(_0x28a9ba){_0x21856a[_0xbe0f('0x43')]=_0x28a9ba;if(_0x5eaf2e[_0xbe0f('0x34')][_0xbe0f('0x44')]){_0x302d83[_0xbe0f('0x45')]=[{'all':!![]}];}return db[_0xbe0f('0x2f')][_0xbe0f('0x46')](_0x302d83);})['then'](function(_0x230b9a){_0x21856a[_0xbe0f('0x47')]=_0x230b9a;return _0x21856a;})[_0xbe0f('0x28')](respondWithFilteredResult(_0x485260,_0x302d83))['catch'](handleError(_0x485260,null));};exports['show']=function(_0x46c91a,_0x596f86){var _0x4e9d5e={'raw':![],'where':{'id':_0x46c91a[_0xbe0f('0x48')]['id']}},_0x191956={};_0x191956[_0xbe0f('0x33')]=_[_0xbe0f('0x49')](db[_0xbe0f('0x2f')][_0xbe0f('0x30')]);_0x191956[_0xbe0f('0x34')]=_[_0xbe0f('0x49')](_0x46c91a['query']);_0x191956['filters']=_[_0xbe0f('0x36')](_0x191956[_0xbe0f('0x33')],_0x191956[_0xbe0f('0x34')]);_0x4e9d5e['attributes']=_['intersection'](_0x191956['model'],qs[_0xbe0f('0x38')](_0x46c91a[_0xbe0f('0x34')][_0xbe0f('0x38')]));_0x4e9d5e['attributes']=_0x4e9d5e[_0xbe0f('0x37')][_0xbe0f('0x39')]?_0x4e9d5e[_0xbe0f('0x37')]:_0x191956[_0xbe0f('0x33')];if(_0x46c91a[_0xbe0f('0x34')][_0xbe0f('0x44')]){_0x4e9d5e['include']=[{'all':!![]}];}_0x4e9d5e=_[_0xbe0f('0x3f')]({},_0x4e9d5e,_0x46c91a['options']);return db[_0xbe0f('0x2f')]['find'](_0x4e9d5e)[_0xbe0f('0x28')](handleEntityNotFound(_0x596f86,null))['then'](respondWithResult(_0x596f86,null))['catch'](handleError(_0x596f86,null));};exports['create']=function(_0x6d052,_0x5e622a){return db[_0xbe0f('0x2f')][_0xbe0f('0x4a')](_0x6d052[_0xbe0f('0x4b')],{})[_0xbe0f('0x28')](respondWithResult(_0x5e622a,0xc9))[_0xbe0f('0x4c')](handleError(_0x5e622a,null));};exports[_0xbe0f('0x27')]=function(_0x18e6cb,_0x49277d){if(_0x18e6cb[_0xbe0f('0x4b')]['id']){delete _0x18e6cb['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x18e6cb[_0xbe0f('0x48')]['id']}})[_0xbe0f('0x28')](handleEntityNotFound(_0x49277d,null))['then'](saveUpdates(_0x18e6cb[_0xbe0f('0x4b')],null))[_0xbe0f('0x28')](respondWithResult(_0x49277d,null))[_0xbe0f('0x4c')](handleError(_0x49277d,null));};exports['destroy']=function(_0x5dc0c9,_0x31b53e){return db['SalesforceConfiguration']['find']({'where':{'id':_0x5dc0c9['params']['id']}})[_0xbe0f('0x28')](handleEntityNotFound(_0x31b53e,null))['then'](removeEntity(_0x31b53e,null))[_0xbe0f('0x4c')](handleError(_0x31b53e,null));};exports[_0xbe0f('0x4d')]=function(_0x37017f,_0x2075cb,_0x3b39ac){var _0xbf1cd5={};var _0x408154={};var _0x55777f;var _0x5164fa;return db[_0xbe0f('0x2f')][_0xbe0f('0x4e')]({'where':{'id':_0x37017f['params']['id']}})[_0xbe0f('0x28')](handleEntityNotFound(_0x2075cb,null))[_0xbe0f('0x28')](function(_0xb7715d){if(_0xb7715d){_0x55777f=_0xb7715d;_0x408154[_0xbe0f('0x33')]=_[_0xbe0f('0x49')](db[_0xbe0f('0x4f')][_0xbe0f('0x30')]);_0x408154[_0xbe0f('0x34')]=_[_0xbe0f('0x49')](_0x37017f['query']);_0x408154[_0xbe0f('0x35')]=_[_0xbe0f('0x36')](_0x408154[_0xbe0f('0x33')],_0x408154[_0xbe0f('0x34')]);_0xbf1cd5['attributes']=_[_0xbe0f('0x36')](_0x408154[_0xbe0f('0x33')],qs[_0xbe0f('0x38')](_0x37017f[_0xbe0f('0x34')][_0xbe0f('0x38')]));_0xbf1cd5[_0xbe0f('0x37')]=_0xbf1cd5[_0xbe0f('0x37')][_0xbe0f('0x39')]?_0xbf1cd5[_0xbe0f('0x37')]:_0x408154[_0xbe0f('0x33')];_0xbf1cd5[_0xbe0f('0x3b')]=qs[_0xbe0f('0x3c')](_0x37017f[_0xbe0f('0x34')]['sort']);_0xbf1cd5[_0xbe0f('0x42')]=qs[_0xbe0f('0x35')](_[_0xbe0f('0x3d')](_0x37017f[_0xbe0f('0x34')],_0x408154['filters']));if(_0x37017f[_0xbe0f('0x34')][_0xbe0f('0x3e')]){_0xbf1cd5[_0xbe0f('0x42')]=_[_0xbe0f('0x3f')](_0xbf1cd5[_0xbe0f('0x42')],{'$or':_[_0xbe0f('0x2e')](_0xbf1cd5['attributes'],function(_0x344f7c){var _0x52bc70={};_0x52bc70[_0x344f7c]={'$like':'%'+_0x37017f[_0xbe0f('0x34')][_0xbe0f('0x3e')]+'%'};return _0x52bc70;})});}_0xbf1cd5=_[_0xbe0f('0x3f')]({},_0xbf1cd5,_0x37017f[_0xbe0f('0x41')]);return _0x55777f['getFields'](_0xbf1cd5);}})[_0xbe0f('0x28')](function(_0x3b0916){if(_0x3b0916){_0x5164fa=_0x3b0916[_0xbe0f('0x39')];if(!_0x37017f[_0xbe0f('0x34')]['hasOwnProperty'](_0xbe0f('0x50'))){_0xbf1cd5[_0xbe0f('0x21')]=qs[_0xbe0f('0x21')](_0x37017f['query'][_0xbe0f('0x21')]);_0xbf1cd5['offset']=qs[_0xbe0f('0x1f')](_0x37017f[_0xbe0f('0x34')][_0xbe0f('0x1f')]);}return _0x55777f[_0xbe0f('0x4d')](_0xbf1cd5);}})[_0xbe0f('0x28')](function(_0x55a720){if(_0x55a720){return _0x55a720?{'count':_0x5164fa,'rows':_0x55a720}:null;}})[_0xbe0f('0x28')](respondWithResult(_0x2075cb,null))[_0xbe0f('0x4c')](handleError(_0x2075cb,null));};exports['getSubjects']=function(_0x313d85,_0x5bb86e,_0x1446f){var _0x165e5e={};var _0x7f9d5c={};var _0x10fc28;var _0x5299f1;return db[_0xbe0f('0x2f')][_0xbe0f('0x4e')]({'where':{'id':_0x313d85[_0xbe0f('0x48')]['id']}})[_0xbe0f('0x28')](handleEntityNotFound(_0x5bb86e,null))['then'](function(_0x5b18ba){if(_0x5b18ba){_0x10fc28=_0x5b18ba;_0x7f9d5c[_0xbe0f('0x33')]=_[_0xbe0f('0x49')](db[_0xbe0f('0x4f')]['rawAttributes']);_0x7f9d5c[_0xbe0f('0x34')]=_[_0xbe0f('0x49')](_0x313d85[_0xbe0f('0x34')]);_0x7f9d5c[_0xbe0f('0x35')]=_[_0xbe0f('0x36')](_0x7f9d5c[_0xbe0f('0x33')],_0x7f9d5c[_0xbe0f('0x34')]);_0x165e5e['attributes']=_['intersection'](_0x7f9d5c['model'],qs[_0xbe0f('0x38')](_0x313d85[_0xbe0f('0x34')][_0xbe0f('0x38')]));_0x165e5e[_0xbe0f('0x37')]=_0x165e5e[_0xbe0f('0x37')][_0xbe0f('0x39')]?_0x165e5e['attributes']:_0x7f9d5c[_0xbe0f('0x33')];_0x165e5e[_0xbe0f('0x3b')]=qs[_0xbe0f('0x3c')](_0x313d85[_0xbe0f('0x34')][_0xbe0f('0x3c')]);_0x165e5e['where']=qs[_0xbe0f('0x35')](_['pick'](_0x313d85[_0xbe0f('0x34')],_0x7f9d5c[_0xbe0f('0x35')]));if(_0x313d85[_0xbe0f('0x34')]['filter']){_0x165e5e[_0xbe0f('0x42')]=_[_0xbe0f('0x3f')](_0x165e5e[_0xbe0f('0x42')],{'$or':_[_0xbe0f('0x2e')](_0x165e5e['attributes'],function(_0x4a334a){var _0x3fc1ff={};_0x3fc1ff[_0x4a334a]={'$like':'%'+_0x313d85[_0xbe0f('0x34')][_0xbe0f('0x3e')]+'%'};return _0x3fc1ff;})});}_0x165e5e=_[_0xbe0f('0x3f')]({},_0x165e5e,_0x313d85[_0xbe0f('0x41')]);return _0x10fc28[_0xbe0f('0x51')](_0x165e5e);}})[_0xbe0f('0x28')](function(_0x20195f){if(_0x20195f){_0x5299f1=_0x20195f[_0xbe0f('0x39')];if(!_0x313d85[_0xbe0f('0x34')]['hasOwnProperty'](_0xbe0f('0x50'))){_0x165e5e['limit']=qs[_0xbe0f('0x21')](_0x313d85[_0xbe0f('0x34')][_0xbe0f('0x21')]);_0x165e5e[_0xbe0f('0x1f')]=qs[_0xbe0f('0x1f')](_0x313d85[_0xbe0f('0x34')][_0xbe0f('0x1f')]);}return _0x10fc28[_0xbe0f('0x51')](_0x165e5e);}})['then'](function(_0x34342f){if(_0x34342f){return _0x34342f?{'count':_0x5299f1,'rows':_0x34342f}:null;}})[_0xbe0f('0x28')](respondWithResult(_0x5bb86e,null))[_0xbe0f('0x4c')](handleError(_0x5bb86e,null));};exports[_0xbe0f('0x52')]=function(_0xbc53ea,_0x465f4d,_0x296051){var _0x4c2b84={};var _0x46e80b={};var _0x2acc28;var _0x26f088;return db['SalesforceConfiguration'][_0xbe0f('0x4e')]({'where':{'id':_0xbc53ea[_0xbe0f('0x48')]['id']}})['then'](handleEntityNotFound(_0x465f4d,null))['then'](function(_0x5c3c85){if(_0x5c3c85){_0x2acc28=_0x5c3c85;_0x46e80b[_0xbe0f('0x33')]=_['keys'](db[_0xbe0f('0x4f')]['rawAttributes']);_0x46e80b['query']=_['keys'](_0xbc53ea['query']);_0x46e80b[_0xbe0f('0x35')]=_[_0xbe0f('0x36')](_0x46e80b[_0xbe0f('0x33')],_0x46e80b[_0xbe0f('0x34')]);_0x4c2b84['attributes']=_[_0xbe0f('0x36')](_0x46e80b[_0xbe0f('0x33')],qs[_0xbe0f('0x38')](_0xbc53ea[_0xbe0f('0x34')]['fields']));_0x4c2b84[_0xbe0f('0x37')]=_0x4c2b84[_0xbe0f('0x37')]['length']?_0x4c2b84['attributes']:_0x46e80b[_0xbe0f('0x33')];_0x4c2b84[_0xbe0f('0x3b')]=qs[_0xbe0f('0x3c')](_0xbc53ea[_0xbe0f('0x34')][_0xbe0f('0x3c')]);_0x4c2b84['where']=qs['filters'](_[_0xbe0f('0x3d')](_0xbc53ea['query'],_0x46e80b[_0xbe0f('0x35')]));if(_0xbc53ea[_0xbe0f('0x34')][_0xbe0f('0x3e')]){_0x4c2b84[_0xbe0f('0x42')]=_[_0xbe0f('0x3f')](_0x4c2b84[_0xbe0f('0x42')],{'$or':_[_0xbe0f('0x2e')](_0x4c2b84['attributes'],function(_0x5c066d){var _0x13ed8f={};_0x13ed8f[_0x5c066d]={'$like':'%'+_0xbc53ea[_0xbe0f('0x34')][_0xbe0f('0x3e')]+'%'};return _0x13ed8f;})});}_0x4c2b84=_['merge']({},_0x4c2b84,_0xbc53ea[_0xbe0f('0x41')]);return _0x2acc28[_0xbe0f('0x52')](_0x4c2b84);}})['then'](function(_0x4a12f3){if(_0x4a12f3){_0x26f088=_0x4a12f3[_0xbe0f('0x39')];if(!_0xbc53ea[_0xbe0f('0x34')]['hasOwnProperty']('nolimit')){_0x4c2b84[_0xbe0f('0x21')]=qs['limit'](_0xbc53ea['query'][_0xbe0f('0x21')]);_0x4c2b84[_0xbe0f('0x1f')]=qs[_0xbe0f('0x1f')](_0xbc53ea[_0xbe0f('0x34')]['offset']);}return _0x2acc28['getDescriptions'](_0x4c2b84);}})[_0xbe0f('0x28')](function(_0x46b1e7){if(_0x46b1e7){return _0x46b1e7?{'count':_0x26f088,'rows':_0x46b1e7}:null;}})[_0xbe0f('0x28')](respondWithResult(_0x465f4d,null))['catch'](handleError(_0x465f4d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ae20222..0e65681 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 _0x8cb8=['./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8cb8,0x10b));var _0x88cb=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x8cb8[_0x1034ee];return _0x2922af;};'use strict';var _=require(_0x88cb('0x0'));var util=require(_0x88cb('0x1'));var logger=require(_0x88cb('0x2'))(_0x88cb('0x3'));var moment=require(_0x88cb('0x4'));var BPromise=require(_0x88cb('0x5'));var rp=require(_0x88cb('0x6'));var fs=require('fs');var path=require(_0x88cb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x88cb('0x8'));module['exports']=function(_0x19eb42,_0x641618){return _0x19eb42[_0x88cb('0x9')](_0x88cb('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb51d=['exports','define','SalesforceConfiguration','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4529d4,_0x5692d9){var _0x35a8f9=function(_0x59bfcb){while(--_0x59bfcb){_0x4529d4['push'](_0x4529d4['shift']());}};_0x35a8f9(++_0x5692d9);}(_0xb51d,0x184));var _0xdb51=function(_0xc07e33,_0x426df6){_0xc07e33=_0xc07e33-0x0;var _0x2c9ba7=_0xb51d[_0xc07e33];return _0x2c9ba7;};'use strict';var _=require(_0xdb51('0x0'));var util=require(_0xdb51('0x1'));var logger=require('../../config/logger')(_0xdb51('0x2'));var moment=require(_0xdb51('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb51('0x4'));var fs=require('fs');var path=require(_0xdb51('0x5'));var rimraf=require(_0xdb51('0x6'));var config=require(_0xdb51('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xdb51('0x8')]=function(_0x24cf80,_0x112748){return _0x24cf80[_0xdb51('0x9')](_0xdb51('0xa'),attributes,{'tableName':'int_salesforce_configurations','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 4ec21ce..8728d1a 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 _0xd059=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x24eb36,_0x47bb7b){var _0x4ae8ea=function(_0x24168e){while(--_0x24168e){_0x24eb36['push'](_0x24eb36['shift']());}};_0x4ae8ea(++_0x47bb7b);}(_0xd059,0x1a5));var _0x9d05=function(_0x544aad,_0x5b2b90){_0x544aad=_0x544aad-0x0;var _0x14c567=_0xd059[_0x544aad];return _0x14c567;};'use strict';var _=require(_0x9d05('0x0'));var util=require(_0x9d05('0x1'));var moment=require(_0x9d05('0x2'));var BPromise=require(_0x9d05('0x3'));var rs=require(_0x9d05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d05('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d05('0x6'))(_0x9d05('0x7'));var config=require(_0x9d05('0x8'));var jayson=require(_0x9d05('0x9'));var client=jayson[_0x9d05('0xa')][_0x9d05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3daba2,_0x1e67c3,_0x57f9fe){return new BPromise(function(_0x123dfe,_0x1ee0fd){return client[_0x9d05('0xc')](_0x3daba2,_0x57f9fe)['then'](function(_0x239ad0){logger[_0x9d05('0xd')](_0x9d05('0xe'),_0x1e67c3,_0x9d05('0xf'));logger[_0x9d05('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1e67c3,_0x9d05('0xf'),JSON[_0x9d05('0x11')](_0x239ad0));if(_0x239ad0[_0x9d05('0x12')]){if(_0x239ad0['error'][_0x9d05('0x13')]===0x1f4){logger['error'](_0x9d05('0xe'),_0x1e67c3,_0x239ad0[_0x9d05('0x12')][_0x9d05('0x14')]);return _0x1ee0fd(_0x239ad0[_0x9d05('0x12')][_0x9d05('0x14')]);}logger['error'](_0x9d05('0xe'),_0x1e67c3,_0x239ad0[_0x9d05('0x12')]['message']);return _0x123dfe(_0x239ad0[_0x9d05('0x12')][_0x9d05('0x14')]);}else{logger[_0x9d05('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1e67c3,_0x9d05('0xf'));_0x123dfe(_0x239ad0[_0x9d05('0x15')]['message']);}})[_0x9d05('0x16')](function(_0x37170a){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x1e67c3,_0x37170a);_0x1ee0fd(_0x37170a);});});} \ No newline at end of file +var _0x4253=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','request\x20sent'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x4253,0x15c));var _0x3425=function(_0x358580,_0xe130ea){_0x358580=_0x358580-0x0;var _0x3285ef=_0x4253[_0x358580];return _0x3285ef;};'use strict';var _=require('lodash');var util=require(_0x3425('0x0'));var moment=require(_0x3425('0x1'));var BPromise=require(_0x3425('0x2'));var rs=require(_0x3425('0x3'));var fs=require('fs');var Redis=require(_0x3425('0x4'));var db=require(_0x3425('0x5'))['db'];var utils=require(_0x3425('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3425('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55f681,_0x488fec,_0x21dfbf){return new BPromise(function(_0x2581b6,_0x17b5e4){return client[_0x3425('0x8')](_0x55f681,_0x21dfbf)[_0x3425('0x9')](function(_0x2d3632){logger[_0x3425('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x488fec,_0x3425('0xb'));logger[_0x3425('0xc')](_0x3425('0xd'),_0x488fec,_0x3425('0xb'),JSON[_0x3425('0xe')](_0x2d3632));if(_0x2d3632[_0x3425('0xf')]){if(_0x2d3632['error']['code']===0x1f4){logger[_0x3425('0xf')](_0x3425('0x10'),_0x488fec,_0x2d3632[_0x3425('0xf')][_0x3425('0x11')]);return _0x17b5e4(_0x2d3632[_0x3425('0xf')]['message']);}logger[_0x3425('0xf')](_0x3425('0x10'),_0x488fec,_0x2d3632['error'][_0x3425('0x11')]);return _0x2581b6(_0x2d3632['error']['message']);}else{logger[_0x3425('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x488fec,_0x3425('0xb'));_0x2581b6(_0x2d3632[_0x3425('0x12')][_0x3425('0x11')]);}})[_0x3425('0x13')](function(_0x18e0b1){logger['error'](_0x3425('0x10'),_0x488fec,_0x18e0b1);_0x17b5e4(_0x18e0b1);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index ba0127b..a9317a3 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 _0xdbc3=['index','get','/:id','put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2da7cb,_0x4c9ba2){var _0xfa4be=function(_0xbc3cbf){while(--_0xbc3cbf){_0x2da7cb['push'](_0x2da7cb['shift']());}};_0xfa4be(++_0x4c9ba2);}(_0xdbc3,0x1c0));var _0x3dbc=function(_0x361f8f,_0x506981){_0x361f8f=_0x361f8f-0x0;var _0x5c05de=_0xdbc3[_0x361f8f];return _0x5c05de;};'use strict';var multer=require(_0x3dbc('0x0'));var util=require(_0x3dbc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3dbc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3dbc('0x3'));var interaction=require(_0x3dbc('0x4'));var config=require(_0x3dbc('0x5'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x3dbc('0x6')](),controller[_0x3dbc('0x7')]);router[_0x3dbc('0x8')](_0x3dbc('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3dbc('0x6')](),controller['create']);router[_0x3dbc('0xa')](_0x3dbc('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3dbc('0xb')](_0x3dbc('0x9'),auth[_0x3dbc('0x6')](),controller['destroy']);module[_0x3dbc('0xc')]=router; \ No newline at end of file +var _0x4e95=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x33ca51,_0x224739){var _0x1531a5=function(_0x1bf73f){while(--_0x1bf73f){_0x33ca51['push'](_0x33ca51['shift']());}};_0x1531a5(++_0x224739);}(_0x4e95,0x154));var _0x54e9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4e95[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x54e9('0x0'));var util=require(_0x54e9('0x1'));var path=require(_0x54e9('0x2'));var timeout=require(_0x54e9('0x3'));var express=require(_0x54e9('0x4'));var router=express[_0x54e9('0x5')]();var fs_extra=require(_0x54e9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x54e9('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x54e9('0x8')]('/',auth[_0x54e9('0x9')](),controller[_0x54e9('0xa')]);router['get']('/:id',auth[_0x54e9('0x9')](),controller['show']);router[_0x54e9('0xb')]('/',auth[_0x54e9('0x9')](),controller[_0x54e9('0xc')]);router[_0x54e9('0xd')](_0x54e9('0xe'),auth[_0x54e9('0x9')](),controller[_0x54e9('0xf')]);router[_0x54e9('0x10')]('/:id',auth[_0x54e9('0x9')](),controller[_0x54e9('0x11')]);module[_0x54e9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0a29975..b0df921 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 _0x3319=['sequelize','ENUM','keyValue','picklist','STRING','string','customVariable'];(function(_0x5a4b2b,_0x210f4e){var _0x290f97=function(_0x30e5e9){while(--_0x30e5e9){_0x5a4b2b['push'](_0x5a4b2b['shift']());}};_0x290f97(++_0x210f4e);}(_0x3319,0x17a));var _0x9331=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x3319[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x9331('0x0'));module['exports']={'type':{'type':Sequelize[_0x9331('0x1')]('string','variable','customVariable',_0x9331('0x2'),_0x9331('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9331('0x4')]},'key':{'type':Sequelize[_0x9331('0x4')]},'keyType':{'type':Sequelize[_0x9331('0x1')](_0x9331('0x5'),'variable',_0x9331('0x6'))},'keyContent':{'type':Sequelize[_0x9331('0x4')]},'idField':{'type':Sequelize[_0x9331('0x4')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9594=['string','STRING','ENUM','variable','customVariable','keyValue','picklist'];(function(_0xee37f1,_0x189f43){var _0x37fd54=function(_0x3c8109){while(--_0x3c8109){_0xee37f1['push'](_0xee37f1['shift']());}};_0x37fd54(++_0x189f43);}(_0x9594,0x11a));var _0x4959=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x9594[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4959('0x0')]('string',_0x4959('0x1'),_0x4959('0x2'),_0x4959('0x3'),_0x4959('0x4')),'defaultValue':_0x4959('0x5')},'content':{'type':Sequelize[_0x4959('0x6')]},'key':{'type':Sequelize[_0x4959('0x6')]},'keyType':{'type':Sequelize[_0x4959('0x0')](_0x4959('0x5'),_0x4959('0x1'),_0x4959('0x2'))},'keyContent':{'type':Sequelize[_0x4959('0x6')]},'idField':{'type':Sequelize[_0x4959('0x6')]},'variableName':{'type':Sequelize[_0x4959('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 4f7dacd..1d2ebd7 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 _0x600c=['name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','stack'];(function(_0x31f7c5,_0x3bf428){var _0x19fabc=function(_0x268080){while(--_0x268080){_0x31f7c5['push'](_0x31f7c5['shift']());}};_0x19fabc(++_0x3bf428);}(_0x600c,0x198));var _0xc600=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x600c[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0xc600('0x0'));var rimraf=require(_0xc600('0x1'));var zipdir=require(_0xc600('0x2'));var jsonpatch=require(_0xc600('0x3'));var rp=require(_0xc600('0x4'));var moment=require(_0xc600('0x5'));var BPromise=require(_0xc600('0x6'));var Mustache=require(_0xc600('0x7'));var util=require('util');var path=require(_0xc600('0x8'));var sox=require(_0xc600('0x9'));var csv=require(_0xc600('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc600('0xb'));var _=require(_0xc600('0xc'));var squel=require(_0xc600('0xd'));var crypto=require(_0xc600('0xe'));var jsforce=require(_0xc600('0xf'));var deskjs=require(_0xc600('0x10'));var toCsv=require(_0xc600('0xa'));var querystring=require(_0xc600('0x11'));var Papa=require(_0xc600('0x12'));var Redis=require(_0xc600('0x13'));var authService=require(_0xc600('0x14'));var qs=require(_0xc600('0x15'));var as=require(_0xc600('0x16'));var hardwareService=require(_0xc600('0x17'));var logger=require(_0xc600('0x18'))('api');var utils=require(_0xc600('0x19'));var config=require(_0xc600('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc600('0x1b'))['db'];function respondWithStatusCode(_0x5e1c0c,_0x27915d){_0x27915d=_0x27915d||0xcc;return function(_0x1c3eb7){if(_0x1c3eb7){return _0x5e1c0c[_0xc600('0x1c')](_0x27915d);}return _0x5e1c0c['status'](_0x27915d)[_0xc600('0x1d')]();};}function respondWithResult(_0x49b35f,_0x2a41f9){_0x2a41f9=_0x2a41f9||0xc8;return function(_0x10bc0b){if(_0x10bc0b){return _0x49b35f[_0xc600('0x1e')](_0x2a41f9)[_0xc600('0x1f')](_0x10bc0b);}};}function respondWithFilteredResult(_0x5b7e8c,_0x18ed01){return function(_0x498e29){if(_0x498e29){var _0x5043a2=typeof _0x18ed01[_0xc600('0x20')]===_0xc600('0x21')&&typeof _0x18ed01[_0xc600('0x22')]===_0xc600('0x21');var _0x2c06a5=_0x498e29[_0xc600('0x23')];var _0x376edf=_0x5043a2?0x0:_0x18ed01[_0xc600('0x20')];var _0xca10bb=_0x5043a2?_0x498e29[_0xc600('0x23')]:_0x18ed01[_0xc600('0x20')]+_0x18ed01[_0xc600('0x22')];var _0x164978;if(_0xca10bb>=_0x2c06a5){_0xca10bb=_0x2c06a5;_0x164978=0xc8;}else{_0x164978=0xce;}_0x5b7e8c['status'](_0x164978);return _0x5b7e8c['set'](_0xc600('0x24'),_0x376edf+'-'+_0xca10bb+'/'+_0x2c06a5)[_0xc600('0x1f')](_0x498e29);}return null;};}function patchUpdates(_0x23f75a){return function(_0x303d90){try{jsonpatch['apply'](_0x303d90,_0x23f75a,!![]);}catch(_0x2d6662){return BPromise[_0xc600('0x25')](_0x2d6662);}return _0x303d90[_0xc600('0x26')]();};}function saveUpdates(_0x4c0f00,_0x26bf0d){return function(_0x5ed6bb){if(_0x5ed6bb){return _0x5ed6bb['update'](_0x4c0f00)[_0xc600('0x27')](function(_0x5c2139){return _0x5c2139;});}return null;};}function removeEntity(_0x17c147,_0x476c4c){return function(_0x157727){if(_0x157727){return _0x157727[_0xc600('0x28')]()[_0xc600('0x27')](function(){_0x17c147[_0xc600('0x1e')](0xcc)[_0xc600('0x1d')]();});}};}function handleEntityNotFound(_0x52d9d6,_0x1a1ff8){return function(_0x343cac){if(!_0x343cac){_0x52d9d6[_0xc600('0x1c')](0x194);}return _0x343cac;};}function handleError(_0x3e101a,_0x9d37c3){_0x9d37c3=_0x9d37c3||0x1f4;return function(_0x147003){logger['error'](_0x147003[_0xc600('0x29')]);if(_0x147003[_0xc600('0x2a')]){delete _0x147003[_0xc600('0x2a')];}_0x3e101a[_0xc600('0x1e')](_0x9d37c3)[_0xc600('0x2b')](_0x147003);};}exports[_0xc600('0x2c')]=function(_0x4e70e6,_0x4b0480){var _0x47ab7a={},_0x1e3fcd={},_0xb70f5c={'count':0x0,'rows':[]};var _0x56b266=_[_0xc600('0x2d')](db[_0xc600('0x2e')][_0xc600('0x2f')],function(_0x3e9ccf){return{'name':_0x3e9ccf[_0xc600('0x30')],'type':_0x3e9ccf[_0xc600('0x31')]['key']};});_0x1e3fcd[_0xc600('0x32')]=_[_0xc600('0x2d')](_0x56b266,_0xc600('0x2a'));_0x1e3fcd['query']=_[_0xc600('0x33')](_0x4e70e6[_0xc600('0x34')]);_0x1e3fcd['filters']=_[_0xc600('0x35')](_0x1e3fcd[_0xc600('0x32')],_0x1e3fcd['query']);_0x47ab7a['attributes']=_[_0xc600('0x35')](_0x1e3fcd['model'],qs[_0xc600('0x36')](_0x4e70e6[_0xc600('0x34')][_0xc600('0x36')]));_0x47ab7a[_0xc600('0x37')]=_0x47ab7a['attributes']['length']?_0x47ab7a[_0xc600('0x37')]:_0x1e3fcd[_0xc600('0x32')];if(!_0x4e70e6[_0xc600('0x34')]['hasOwnProperty'](_0xc600('0x38'))){_0x47ab7a[_0xc600('0x22')]=qs[_0xc600('0x22')](_0x4e70e6['query'][_0xc600('0x22')]);_0x47ab7a['offset']=qs[_0xc600('0x20')](_0x4e70e6[_0xc600('0x34')][_0xc600('0x20')]);}_0x47ab7a[_0xc600('0x39')]=qs[_0xc600('0x3a')](_0x4e70e6[_0xc600('0x34')][_0xc600('0x3a')]);_0x47ab7a[_0xc600('0x3b')]=qs[_0xc600('0x3c')](_[_0xc600('0x3d')](_0x4e70e6[_0xc600('0x34')],_0x1e3fcd[_0xc600('0x3c')]),_0x56b266);if(_0x4e70e6['query']['filter']){_0x47ab7a[_0xc600('0x3b')]=_[_0xc600('0x3e')](_0x47ab7a['where'],{'$or':_['map'](_0x56b266,function(_0x5b190f){if(_0x5b190f[_0xc600('0x31')]!=='VIRTUAL'){var _0x34d75f={};_0x34d75f[_0x5b190f[_0xc600('0x2a')]]={'$like':'%'+_0x4e70e6[_0xc600('0x34')]['filter']+'%'};return _0x34d75f;}})});}_0x47ab7a=_[_0xc600('0x3e')]({},_0x47ab7a,_0x4e70e6['options']);var _0x3569a6={'where':_0x47ab7a[_0xc600('0x3b')]};return db['SalesforceField'][_0xc600('0x23')](_0x3569a6)[_0xc600('0x27')](function(_0x199711){_0xb70f5c[_0xc600('0x23')]=_0x199711;if(_0x4e70e6[_0xc600('0x34')][_0xc600('0x3f')]){_0x47ab7a[_0xc600('0x40')]=[{'all':!![]}];}return db[_0xc600('0x2e')][_0xc600('0x41')](_0x47ab7a);})[_0xc600('0x27')](function(_0x152883){_0xb70f5c[_0xc600('0x42')]=_0x152883;return _0xb70f5c;})[_0xc600('0x27')](respondWithFilteredResult(_0x4b0480,_0x47ab7a))[_0xc600('0x43')](handleError(_0x4b0480,null));};exports[_0xc600('0x44')]=function(_0x41940a,_0x4f2d0b){var _0x3ebf19={'raw':!![],'where':{'id':_0x41940a[_0xc600('0x45')]['id']}},_0x5e7866={};_0x5e7866['model']=_['keys'](db['SalesforceField'][_0xc600('0x2f')]);_0x5e7866[_0xc600('0x34')]=_['keys'](_0x41940a['query']);_0x5e7866[_0xc600('0x3c')]=_[_0xc600('0x35')](_0x5e7866[_0xc600('0x32')],_0x5e7866[_0xc600('0x34')]);_0x3ebf19[_0xc600('0x37')]=_[_0xc600('0x35')](_0x5e7866['model'],qs['fields'](_0x41940a['query'][_0xc600('0x36')]));_0x3ebf19['attributes']=_0x3ebf19[_0xc600('0x37')][_0xc600('0x46')]?_0x3ebf19['attributes']:_0x5e7866[_0xc600('0x32')];if(_0x41940a[_0xc600('0x34')]['includeAll']){_0x3ebf19[_0xc600('0x40')]=[{'all':!![]}];}_0x3ebf19=_[_0xc600('0x3e')]({},_0x3ebf19,_0x41940a[_0xc600('0x47')]);return db['SalesforceField'][_0xc600('0x48')](_0x3ebf19)['then'](handleEntityNotFound(_0x4f2d0b,null))[_0xc600('0x27')](respondWithResult(_0x4f2d0b,null))[_0xc600('0x43')](handleError(_0x4f2d0b,null));};exports[_0xc600('0x49')]=function(_0x103d2b,_0x512061){return db['SalesforceField'][_0xc600('0x49')](_0x103d2b[_0xc600('0x4a')],{})[_0xc600('0x27')](respondWithResult(_0x512061,0xc9))[_0xc600('0x43')](handleError(_0x512061,null));};exports['update']=function(_0x4b4634,_0x441da2){if(_0x4b4634['body']['id']){delete _0x4b4634[_0xc600('0x4a')]['id'];}return db[_0xc600('0x2e')]['find']({'where':{'id':_0x4b4634[_0xc600('0x45')]['id']}})[_0xc600('0x27')](handleEntityNotFound(_0x441da2,null))[_0xc600('0x27')](saveUpdates(_0x4b4634[_0xc600('0x4a')],null))[_0xc600('0x27')](respondWithResult(_0x441da2,null))[_0xc600('0x43')](handleError(_0x441da2,null));};exports['destroy']=function(_0x45d159,_0x194a02){return db[_0xc600('0x2e')]['find']({'where':{'id':_0x45d159[_0xc600('0x45')]['id']}})[_0xc600('0x27')](handleEntityNotFound(_0x194a02,null))[_0xc600('0x27')](removeEntity(_0x194a02,null))[_0xc600('0x43')](handleError(_0x194a02,null));}; \ No newline at end of file +var _0x5dd6=['where','includeAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x5dd6,0x12e));var _0x65dd=function(_0x286c17,_0x51742e){_0x286c17=_0x286c17-0x0;var _0x52f89c=_0x5dd6[_0x286c17];return _0x52f89c;};'use strict';var emlformat=require(_0x65dd('0x0'));var rimraf=require(_0x65dd('0x1'));var zipdir=require(_0x65dd('0x2'));var jsonpatch=require(_0x65dd('0x3'));var rp=require('request-promise');var moment=require(_0x65dd('0x4'));var BPromise=require(_0x65dd('0x5'));var Mustache=require(_0x65dd('0x6'));var util=require(_0x65dd('0x7'));var path=require('path');var sox=require(_0x65dd('0x8'));var csv=require(_0x65dd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65dd('0xa'));var _=require(_0x65dd('0xb'));var squel=require(_0x65dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x65dd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x65dd('0x9'));var querystring=require(_0x65dd('0xe'));var Papa=require(_0x65dd('0xf'));var Redis=require('ioredis');var authService=require(_0x65dd('0x10'));var qs=require(_0x65dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65dd('0x12'));var utils=require(_0x65dd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x65dd('0x14'));var db=require(_0x65dd('0x15'))['db'];function respondWithStatusCode(_0x45044d,_0xd4abb1){_0xd4abb1=_0xd4abb1||0xcc;return function(_0x496c4e){if(_0x496c4e){return _0x45044d[_0x65dd('0x16')](_0xd4abb1);}return _0x45044d['status'](_0xd4abb1)[_0x65dd('0x17')]();};}function respondWithResult(_0x341c45,_0x1735d8){_0x1735d8=_0x1735d8||0xc8;return function(_0x4e10c7){if(_0x4e10c7){return _0x341c45['status'](_0x1735d8)[_0x65dd('0x18')](_0x4e10c7);}};}function respondWithFilteredResult(_0x5a5290,_0x2575e3){return function(_0x5d0dbe){if(_0x5d0dbe){var _0x4198b7=typeof _0x2575e3[_0x65dd('0x19')]===_0x65dd('0x1a')&&typeof _0x2575e3[_0x65dd('0x1b')]===_0x65dd('0x1a');var _0x1d85c5=_0x5d0dbe[_0x65dd('0x1c')];var _0x1e220c=_0x4198b7?0x0:_0x2575e3[_0x65dd('0x19')];var _0x5a9e9d=_0x4198b7?_0x5d0dbe[_0x65dd('0x1c')]:_0x2575e3[_0x65dd('0x19')]+_0x2575e3[_0x65dd('0x1b')];var _0x535b09;if(_0x5a9e9d>=_0x1d85c5){_0x5a9e9d=_0x1d85c5;_0x535b09=0xc8;}else{_0x535b09=0xce;}_0x5a5290[_0x65dd('0x1d')](_0x535b09);return _0x5a5290['set'](_0x65dd('0x1e'),_0x1e220c+'-'+_0x5a9e9d+'/'+_0x1d85c5)[_0x65dd('0x18')](_0x5d0dbe);}return null;};}function patchUpdates(_0x3be804){return function(_0x3049f5){try{jsonpatch[_0x65dd('0x1f')](_0x3049f5,_0x3be804,!![]);}catch(_0x16a23b){return BPromise[_0x65dd('0x20')](_0x16a23b);}return _0x3049f5[_0x65dd('0x21')]();};}function saveUpdates(_0x51c03a,_0x23d216){return function(_0x3f4514){if(_0x3f4514){return _0x3f4514[_0x65dd('0x22')](_0x51c03a)[_0x65dd('0x23')](function(_0x225915){return _0x225915;});}return null;};}function removeEntity(_0x3b3711,_0x499b60){return function(_0x1abe46){if(_0x1abe46){return _0x1abe46[_0x65dd('0x24')]()[_0x65dd('0x23')](function(){_0x3b3711[_0x65dd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x345614,_0x7bb017){return function(_0x2f028e){if(!_0x2f028e){_0x345614[_0x65dd('0x16')](0x194);}return _0x2f028e;};}function handleError(_0x15fc05,_0x5e83c7){_0x5e83c7=_0x5e83c7||0x1f4;return function(_0x5f3d94){logger[_0x65dd('0x25')](_0x5f3d94[_0x65dd('0x26')]);if(_0x5f3d94['name']){delete _0x5f3d94[_0x65dd('0x27')];}_0x15fc05['status'](_0x5e83c7)[_0x65dd('0x28')](_0x5f3d94);};}exports[_0x65dd('0x29')]=function(_0x523186,_0x2ead1a){var _0x67e6ca={},_0x4a391d={},_0x316da2={'count':0x0,'rows':[]};var _0x4491e6=_[_0x65dd('0x2a')](db[_0x65dd('0x2b')][_0x65dd('0x2c')],function(_0x2d6aa8){return{'name':_0x2d6aa8[_0x65dd('0x2d')],'type':_0x2d6aa8[_0x65dd('0x2e')]['key']};});_0x4a391d['model']=_['map'](_0x4491e6,_0x65dd('0x27'));_0x4a391d[_0x65dd('0x2f')]=_[_0x65dd('0x30')](_0x523186[_0x65dd('0x2f')]);_0x4a391d[_0x65dd('0x31')]=_['intersection'](_0x4a391d[_0x65dd('0x32')],_0x4a391d[_0x65dd('0x2f')]);_0x67e6ca[_0x65dd('0x33')]=_[_0x65dd('0x34')](_0x4a391d['model'],qs[_0x65dd('0x35')](_0x523186[_0x65dd('0x2f')][_0x65dd('0x35')]));_0x67e6ca[_0x65dd('0x33')]=_0x67e6ca[_0x65dd('0x33')]['length']?_0x67e6ca[_0x65dd('0x33')]:_0x4a391d[_0x65dd('0x32')];if(!_0x523186[_0x65dd('0x2f')][_0x65dd('0x36')](_0x65dd('0x37'))){_0x67e6ca['limit']=qs[_0x65dd('0x1b')](_0x523186[_0x65dd('0x2f')][_0x65dd('0x1b')]);_0x67e6ca[_0x65dd('0x19')]=qs['offset'](_0x523186[_0x65dd('0x2f')]['offset']);}_0x67e6ca[_0x65dd('0x38')]=qs[_0x65dd('0x39')](_0x523186[_0x65dd('0x2f')][_0x65dd('0x39')]);_0x67e6ca['where']=qs['filters'](_[_0x65dd('0x3a')](_0x523186['query'],_0x4a391d[_0x65dd('0x31')]),_0x4491e6);if(_0x523186[_0x65dd('0x2f')][_0x65dd('0x3b')]){_0x67e6ca['where']=_[_0x65dd('0x3c')](_0x67e6ca['where'],{'$or':_[_0x65dd('0x2a')](_0x4491e6,function(_0x2a7eb3){if(_0x2a7eb3['type']!==_0x65dd('0x3d')){var _0x616b0d={};_0x616b0d[_0x2a7eb3[_0x65dd('0x27')]]={'$like':'%'+_0x523186[_0x65dd('0x2f')][_0x65dd('0x3b')]+'%'};return _0x616b0d;}})});}_0x67e6ca=_[_0x65dd('0x3c')]({},_0x67e6ca,_0x523186[_0x65dd('0x3e')]);var _0x3aebbf={'where':_0x67e6ca[_0x65dd('0x3f')]};return db[_0x65dd('0x2b')][_0x65dd('0x1c')](_0x3aebbf)[_0x65dd('0x23')](function(_0x1ccf3a){_0x316da2[_0x65dd('0x1c')]=_0x1ccf3a;if(_0x523186[_0x65dd('0x2f')][_0x65dd('0x40')]){_0x67e6ca['include']=[{'all':!![]}];}return db[_0x65dd('0x2b')]['findAll'](_0x67e6ca);})[_0x65dd('0x23')](function(_0x55d57c){_0x316da2[_0x65dd('0x41')]=_0x55d57c;return _0x316da2;})[_0x65dd('0x23')](respondWithFilteredResult(_0x2ead1a,_0x67e6ca))[_0x65dd('0x42')](handleError(_0x2ead1a,null));};exports[_0x65dd('0x43')]=function(_0x1ccc27,_0x23fc78){var _0x1503b2={'raw':!![],'where':{'id':_0x1ccc27[_0x65dd('0x44')]['id']}},_0x6f5ceb={};_0x6f5ceb[_0x65dd('0x32')]=_[_0x65dd('0x30')](db['SalesforceField']['rawAttributes']);_0x6f5ceb[_0x65dd('0x2f')]=_[_0x65dd('0x30')](_0x1ccc27[_0x65dd('0x2f')]);_0x6f5ceb[_0x65dd('0x31')]=_[_0x65dd('0x34')](_0x6f5ceb[_0x65dd('0x32')],_0x6f5ceb[_0x65dd('0x2f')]);_0x1503b2[_0x65dd('0x33')]=_[_0x65dd('0x34')](_0x6f5ceb[_0x65dd('0x32')],qs['fields'](_0x1ccc27[_0x65dd('0x2f')][_0x65dd('0x35')]));_0x1503b2[_0x65dd('0x33')]=_0x1503b2[_0x65dd('0x33')]['length']?_0x1503b2[_0x65dd('0x33')]:_0x6f5ceb[_0x65dd('0x32')];if(_0x1ccc27[_0x65dd('0x2f')]['includeAll']){_0x1503b2[_0x65dd('0x45')]=[{'all':!![]}];}_0x1503b2=_[_0x65dd('0x3c')]({},_0x1503b2,_0x1ccc27['options']);return db[_0x65dd('0x2b')][_0x65dd('0x46')](_0x1503b2)['then'](handleEntityNotFound(_0x23fc78,null))[_0x65dd('0x23')](respondWithResult(_0x23fc78,null))[_0x65dd('0x42')](handleError(_0x23fc78,null));};exports[_0x65dd('0x47')]=function(_0x419c87,_0x2cdb1b){return db[_0x65dd('0x2b')][_0x65dd('0x47')](_0x419c87['body'],{})[_0x65dd('0x23')](respondWithResult(_0x2cdb1b,0xc9))[_0x65dd('0x42')](handleError(_0x2cdb1b,null));};exports[_0x65dd('0x22')]=function(_0x4b8316,_0x45c4a6){if(_0x4b8316[_0x65dd('0x48')]['id']){delete _0x4b8316[_0x65dd('0x48')]['id'];}return db[_0x65dd('0x2b')][_0x65dd('0x46')]({'where':{'id':_0x4b8316[_0x65dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x45c4a6,null))['then'](saveUpdates(_0x4b8316[_0x65dd('0x48')],null))[_0x65dd('0x23')](respondWithResult(_0x45c4a6,null))[_0x65dd('0x42')](handleError(_0x45c4a6,null));};exports['destroy']=function(_0x4d3436,_0x17b394){return db[_0x65dd('0x2b')][_0x65dd('0x46')]({'where':{'id':_0x4d3436[_0x65dd('0x44')]['id']}})[_0x65dd('0x23')](handleEntityNotFound(_0x17b394,null))[_0x65dd('0x23')](removeEntity(_0x17b394,null))[_0x65dd('0x42')](handleError(_0x17b394,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 065ec49..2a5aeb6 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 _0x6561=['./intSalesforceField.attributes','exports','salesforce_unique_index','FieldId','lodash','util','api','moment','request-promise','../../config/environment'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6561,0x9a));var _0x1656=function(_0xd92e0f,_0x4c28de){_0xd92e0f=_0xd92e0f-0x0;var _0x408a33=_0x6561[_0xd92e0f];return _0x408a33;};'use strict';var _=require(_0x1656('0x0'));var util=require(_0x1656('0x1'));var logger=require('../../config/logger')(_0x1656('0x2'));var moment=require(_0x1656('0x3'));var BPromise=require('bluebird');var rp=require(_0x1656('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1656('0x5'));var attributes=require(_0x1656('0x6'));module[_0x1656('0x7')]=function(_0x1ef26a,_0x4929b2){return _0x1ef26a['define']('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x1656('0x8'),'fields':['idField',_0x1656('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa365=['request-promise','path','rimraf','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','bluebird'];(function(_0x6e7f6b,_0x488bb3){var _0x346190=function(_0x3bfc4d){while(--_0x3bfc4d){_0x6e7f6b['push'](_0x6e7f6b['shift']());}};_0x346190(++_0x488bb3);}(_0xa365,0x6c));var _0x5a36=function(_0x512edc,_0x5e1c63){_0x512edc=_0x512edc-0x0;var _0x5063ec=_0xa365[_0x512edc];return _0x5063ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a36('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5a36('0x1'));var rp=require(_0x5a36('0x2'));var fs=require('fs');var path=require(_0x5a36('0x3'));var rimraf=require(_0x5a36('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x5a36('0x5')]=function(_0x20c50d,_0x203d60){return _0x20c50d['define'](_0x5a36('0x6'),attributes,{'tableName':_0x5a36('0x7'),'paranoid':![],'indexes':[{'name':_0x5a36('0x8'),'fields':[_0x5a36('0x9'),_0x5a36('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8b28083..3624325 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 _0x7474=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x26acda,_0xd2cbc){var _0x482b6f=function(_0x4a4a1a){while(--_0x4a4a1a){_0x26acda['push'](_0x26acda['shift']());}};_0x482b6f(++_0xd2cbc);}(_0x7474,0x73));var _0x4747=function(_0x65b0a5,_0x229602){_0x65b0a5=_0x65b0a5-0x0;var _0x454b36=_0x7474[_0x65b0a5];return _0x454b36;};'use strict';var _=require(_0x4747('0x0'));var util=require(_0x4747('0x1'));var moment=require(_0x4747('0x2'));var BPromise=require(_0x4747('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4747('0x4'));var db=require(_0x4747('0x5'))['db'];var utils=require(_0x4747('0x6'));var logger=require(_0x4747('0x7'))(_0x4747('0x8'));var config=require(_0x4747('0x9'));var jayson=require(_0x4747('0xa'));var client=jayson['client'][_0x4747('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1f79,_0x4c22f3,_0x127439){return new BPromise(function(_0x2e73c8,_0x334679){return client['request'](_0x4e1f79,_0x127439)[_0x4747('0xc')](function(_0x20011b){logger['info'](_0x4747('0xd'),_0x4c22f3,_0x4747('0xe'));logger[_0x4747('0xf')](_0x4747('0x10'),_0x4c22f3,_0x4747('0xe'),JSON[_0x4747('0x11')](_0x20011b));if(_0x20011b[_0x4747('0x12')]){if(_0x20011b[_0x4747('0x12')][_0x4747('0x13')]===0x1f4){logger[_0x4747('0x12')](_0x4747('0xd'),_0x4c22f3,_0x20011b[_0x4747('0x12')]['message']);return _0x334679(_0x20011b['error'][_0x4747('0x14')]);}logger[_0x4747('0x12')](_0x4747('0xd'),_0x4c22f3,_0x20011b[_0x4747('0x12')][_0x4747('0x14')]);return _0x2e73c8(_0x20011b[_0x4747('0x12')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x4c22f3,'request\x20sent');_0x2e73c8(_0x20011b[_0x4747('0x15')]['message']);}})[_0x4747('0x16')](function(_0x681854){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4c22f3,_0x681854);_0x334679(_0x681854);});});} \ No newline at end of file +var _0xc0ba=['request','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58e5d4,_0x1b41d6){var _0x53617b=function(_0x245b3e){while(--_0x245b3e){_0x58e5d4['push'](_0x58e5d4['shift']());}};_0x53617b(++_0x1b41d6);}(_0xc0ba,0xb4));var _0xac0b=function(_0x2c1841,_0x505204){_0x2c1841=_0x2c1841-0x0;var _0x28d148=_0xc0ba[_0x2c1841];return _0x28d148;};'use strict';var _=require(_0xac0b('0x0'));var util=require(_0xac0b('0x1'));var moment=require('moment');var BPromise=require(_0xac0b('0x2'));var rs=require(_0xac0b('0x3'));var fs=require('fs');var Redis=require(_0xac0b('0x4'));var db=require(_0xac0b('0x5'))['db'];var utils=require(_0xac0b('0x6'));var logger=require('../../config/logger')(_0xac0b('0x7'));var config=require(_0xac0b('0x8'));var jayson=require(_0xac0b('0x9'));var client=jayson[_0xac0b('0xa')][_0xac0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46faf4,_0x18f4e5,_0x1459b9){return new BPromise(function(_0x439038,_0xd82510){return client[_0xac0b('0xc')](_0x46faf4,_0x1459b9)['then'](function(_0x2bfae6){logger[_0xac0b('0xd')]('SalesforceField,\x20%s,\x20%s',_0x18f4e5,_0xac0b('0xe'));logger[_0xac0b('0xf')](_0xac0b('0x10'),_0x18f4e5,_0xac0b('0xe'),JSON[_0xac0b('0x11')](_0x2bfae6));if(_0x2bfae6[_0xac0b('0x12')]){if(_0x2bfae6['error'][_0xac0b('0x13')]===0x1f4){logger[_0xac0b('0x12')](_0xac0b('0x14'),_0x18f4e5,_0x2bfae6[_0xac0b('0x12')]['message']);return _0xd82510(_0x2bfae6[_0xac0b('0x12')][_0xac0b('0x15')]);}logger[_0xac0b('0x12')](_0xac0b('0x14'),_0x18f4e5,_0x2bfae6[_0xac0b('0x12')][_0xac0b('0x15')]);return _0x439038(_0x2bfae6[_0xac0b('0x12')]['message']);}else{logger[_0xac0b('0xd')]('SalesforceField,\x20%s,\x20%s',_0x18f4e5,'request\x20sent');_0x439038(_0x2bfae6[_0xac0b('0x16')][_0xac0b('0x15')]);}})[_0xac0b('0x17')](function(_0x2dd733){logger[_0xac0b('0x12')](_0xac0b('0x14'),_0x18f4e5,_0x2dd733);_0xd82510(_0x2dd733);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3d8e270..9481255 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 _0x08d0=['getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1ed388,_0x4c1474){var _0x356c7f=function(_0x19b7e1){while(--_0x19b7e1){_0x1ed388['push'](_0x1ed388['shift']());}};_0x356c7f(++_0x4c1474);}(_0x08d0,0x133));var _0x008d=function(_0x1e12b2,_0x203a9e){_0x1e12b2=_0x1e12b2-0x0;var _0x5c9b5f=_0x08d0[_0x1e12b2];return _0x5c9b5f;};'use strict';var multer=require(_0x008d('0x0'));var util=require(_0x008d('0x1'));var path=require(_0x008d('0x2'));var timeout=require('connect-timeout');var express=require(_0x008d('0x3'));var router=express[_0x008d('0x4')]();var fs_extra=require(_0x008d('0x5'));var auth=require(_0x008d('0x6'));var interaction=require(_0x008d('0x7'));var config=require(_0x008d('0x8'));var controller=require(_0x008d('0x9'));router['get']('/',auth[_0x008d('0xa')](),controller[_0x008d('0xb')]);router[_0x008d('0xc')](_0x008d('0xd'),auth[_0x008d('0xa')](),controller[_0x008d('0xe')]);router['get'](_0x008d('0xf'),auth[_0x008d('0xa')](),controller[_0x008d('0x10')]);router[_0x008d('0xc')](_0x008d('0x11'),auth[_0x008d('0xa')](),controller[_0x008d('0x12')]);router[_0x008d('0x13')]('/',auth[_0x008d('0xa')](),controller['create']);router['post'](_0x008d('0xf'),auth[_0x008d('0xa')](),controller[_0x008d('0x14')]);router[_0x008d('0x15')](_0x008d('0xd'),auth[_0x008d('0xa')](),controller['update']);router[_0x008d('0x16')](_0x008d('0xd'),auth[_0x008d('0xa')](),controller[_0x008d('0x17')]);module[_0x008d('0x18')]=router; \ No newline at end of file +var _0x51a1=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','post','update','delete','destroy','multer'];(function(_0x4217c4,_0x3755f4){var _0x1929ab=function(_0x4b74cd){while(--_0x4b74cd){_0x4217c4['push'](_0x4217c4['shift']());}};_0x1929ab(++_0x3755f4);}(_0x51a1,0x1b7));var _0x151a=function(_0x264537,_0x11cef2){_0x264537=_0x264537-0x0;var _0x572c34=_0x51a1[_0x264537];return _0x572c34;};'use strict';var multer=require(_0x151a('0x0'));var util=require(_0x151a('0x1'));var path=require('path');var timeout=require(_0x151a('0x2'));var express=require(_0x151a('0x3'));var router=express[_0x151a('0x4')]();var fs_extra=require(_0x151a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x151a('0x6'));var config=require(_0x151a('0x7'));var controller=require(_0x151a('0x8'));router['get']('/',auth[_0x151a('0x9')](),controller['index']);router['get'](_0x151a('0xa'),auth[_0x151a('0x9')](),controller[_0x151a('0xb')]);router[_0x151a('0xc')](_0x151a('0xd'),auth[_0x151a('0x9')](),controller[_0x151a('0xe')]);router[_0x151a('0xc')](_0x151a('0xf'),auth[_0x151a('0x9')](),controller['getFields']);router[_0x151a('0x10')]('/',auth[_0x151a('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0x151a('0x9')](),controller['addConfiguration']);router['put'](_0x151a('0xa'),auth[_0x151a('0x9')](),controller[_0x151a('0x11')]);router[_0x151a('0x12')](_0x151a('0xa'),auth['isAuthenticated'](),controller[_0x151a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 9237ab6..d6346c6 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 _0xb111=['username','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb111,0x189));var _0x1b11=function(_0x32689c,_0x1e5ad2){_0x32689c=_0x32689c-0x0;var _0xce38dd=_0xb111[_0x32689c];return _0xce38dd;};'use strict';var Sequelize=require(_0x1b11('0x0'));module[_0x1b11('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1b11('0x2')]},'username':{'type':Sequelize[_0x1b11('0x2')],'unique':_0x1b11('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1b11('0x2')]},'remoteUri':{'type':Sequelize[_0x1b11('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x1b11('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x71eb=['STRING','username','sequelize','exports'];(function(_0x1e2245,_0x87a7d0){var _0x8b5806=function(_0xd3ca5){while(--_0xd3ca5){_0x1e2245['push'](_0x1e2245['shift']());}};_0x8b5806(++_0x87a7d0);}(_0x71eb,0x1d2));var _0xb71e=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x71eb[_0x54eab6];return _0x1e7435;};'use strict';var Sequelize=require(_0xb71e('0x0'));module[_0xb71e('0x1')]={'name':{'type':Sequelize[_0xb71e('0x2')]},'description':{'type':Sequelize[_0xb71e('0x2')]},'username':{'type':Sequelize[_0xb71e('0x2')],'unique':_0xb71e('0x3')},'password':{'type':Sequelize[_0xb71e('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb71e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f2fb021..c7a32a7 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 _0x52e3=['offset','undefined','count','limit','set','json','reject','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','show','filters','fields','includeAll','options','find','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','category','parent','made_sla','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','work_end','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','description','calendar_duration','closed_by','parent_incident','sys_id','reopened_by','urgency','company','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','correlation_id','location','username','password','remoteUri','serverUrl','substring','%s/api/now/doc/table/schema/','format','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','forEach','internalType','label','assign','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','true','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x4791c6,_0x293adf){var _0x52b5d3=function(_0x172af3){while(--_0x172af3){_0x4791c6['push'](_0x4791c6['shift']());}};_0x52b5d3(++_0x293adf);}(_0x52e3,0x1f1));var _0x352e=function(_0x58b0e3,_0x90a544){_0x58b0e3=_0x58b0e3-0x0;var _0x2e7940=_0x52e3[_0x58b0e3];return _0x2e7940;};'use strict';var emlformat=require(_0x352e('0x0'));var rimraf=require(_0x352e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x352e('0x2'));var rp=require(_0x352e('0x3'));var moment=require(_0x352e('0x4'));var BPromise=require(_0x352e('0x5'));var Mustache=require(_0x352e('0x6'));var util=require(_0x352e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x352e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x352e('0x9'));var _=require('lodash');var squel=require(_0x352e('0xa'));var crypto=require(_0x352e('0xb'));var jsforce=require(_0x352e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x352e('0x8'));var querystring=require(_0x352e('0xd'));var Papa=require(_0x352e('0xe'));var Redis=require(_0x352e('0xf'));var authService=require(_0x352e('0x10'));var qs=require(_0x352e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x352e('0x12'))(_0x352e('0x13'));var utils=require(_0x352e('0x14'));var config=require(_0x352e('0x15'));var licenseUtil=require(_0x352e('0x16'));var db=require(_0x352e('0x17'))['db'];var integrations=require(_0x352e('0x18'));function respondWithStatusCode(_0x47c9ca,_0x20dbc9){_0x20dbc9=_0x20dbc9||0xcc;return function(_0x3c24e5){if(_0x3c24e5){return _0x47c9ca[_0x352e('0x19')](_0x20dbc9);}return _0x47c9ca[_0x352e('0x1a')](_0x20dbc9)[_0x352e('0x1b')]();};}function respondWithResult(_0x364766,_0x3efca0){_0x3efca0=_0x3efca0||0xc8;return function(_0x1d3217){if(_0x1d3217){return _0x364766[_0x352e('0x1a')](_0x3efca0)['json'](_0x1d3217);}};}function respondWithFilteredResult(_0x3aae32,_0x4c268b){return function(_0x4b6bdb){if(_0x4b6bdb){var _0x44fce0=typeof _0x4c268b[_0x352e('0x1c')]===_0x352e('0x1d')&&typeof _0x4c268b['limit']==='undefined';var _0x496a0f=_0x4b6bdb[_0x352e('0x1e')];var _0x2280ac=_0x44fce0?0x0:_0x4c268b[_0x352e('0x1c')];var _0x34974b=_0x44fce0?_0x4b6bdb[_0x352e('0x1e')]:_0x4c268b['offset']+_0x4c268b[_0x352e('0x1f')];var _0x6fb898;if(_0x34974b>=_0x496a0f){_0x34974b=_0x496a0f;_0x6fb898=0xc8;}else{_0x6fb898=0xce;}_0x3aae32[_0x352e('0x1a')](_0x6fb898);return _0x3aae32[_0x352e('0x20')]('Content-Range',_0x2280ac+'-'+_0x34974b+'/'+_0x496a0f)[_0x352e('0x21')](_0x4b6bdb);}return null;};}function patchUpdates(_0x56fb18){return function(_0x16a496){try{jsonpatch['apply'](_0x16a496,_0x56fb18,!![]);}catch(_0x3a21a3){return BPromise[_0x352e('0x22')](_0x3a21a3);}return _0x16a496['save']();};}function saveUpdates(_0x8dc9f2,_0x38520c){return function(_0xb61e4d){if(_0xb61e4d){return _0xb61e4d['update'](_0x8dc9f2)[_0x352e('0x23')](function(_0x31b772){return _0x31b772;});}return null;};}function removeEntity(_0x554777,_0x5d5c2d){return function(_0x103fe4){if(_0x103fe4){return _0x103fe4[_0x352e('0x24')]()[_0x352e('0x23')](function(){_0x554777[_0x352e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b6e15,_0x3b0e58){return function(_0x4fe308){if(!_0x4fe308){_0x3b6e15['sendStatus'](0x194);}return _0x4fe308;};}function handleError(_0xa6cc96,_0x35f685){_0x35f685=_0x35f685||0x1f4;return function(_0x528734){logger[_0x352e('0x25')](_0x528734[_0x352e('0x26')]);if(_0x528734['name']){delete _0x528734[_0x352e('0x27')];}_0xa6cc96[_0x352e('0x1a')](_0x35f685)[_0x352e('0x28')](_0x528734);};}exports[_0x352e('0x29')]=function(_0x49a7ce,_0x544c5e){var _0xd6b12b={},_0x1372b9={},_0x461fa6={'count':0x0,'rows':[]};var _0x1a4986=_[_0x352e('0x2a')](db[_0x352e('0x2b')][_0x352e('0x2c')],function(_0x8b183e){return{'name':_0x8b183e['fieldName'],'type':_0x8b183e[_0x352e('0x2d')]['key']};});_0x1372b9[_0x352e('0x2e')]=_['map'](_0x1a4986,_0x352e('0x27'));_0x1372b9[_0x352e('0x2f')]=_[_0x352e('0x30')](_0x49a7ce[_0x352e('0x2f')]);_0x1372b9['filters']=_[_0x352e('0x31')](_0x1372b9[_0x352e('0x2e')],_0x1372b9[_0x352e('0x2f')]);_0xd6b12b['attributes']=_[_0x352e('0x31')](_0x1372b9[_0x352e('0x2e')],qs['fields'](_0x49a7ce[_0x352e('0x2f')]['fields']));_0xd6b12b[_0x352e('0x32')]=_0xd6b12b[_0x352e('0x32')][_0x352e('0x33')]?_0xd6b12b[_0x352e('0x32')]:_0x1372b9[_0x352e('0x2e')];if(!_0x49a7ce[_0x352e('0x2f')][_0x352e('0x34')](_0x352e('0x35'))){_0xd6b12b[_0x352e('0x1f')]=qs['limit'](_0x49a7ce[_0x352e('0x2f')][_0x352e('0x1f')]);_0xd6b12b[_0x352e('0x1c')]=qs[_0x352e('0x1c')](_0x49a7ce['query'][_0x352e('0x1c')]);}_0xd6b12b[_0x352e('0x36')]=qs['sort'](_0x49a7ce[_0x352e('0x2f')][_0x352e('0x37')]);_0xd6b12b[_0x352e('0x38')]=qs['filters'](_[_0x352e('0x39')](_0x49a7ce['query'],_0x1372b9['filters']),_0x1a4986);if(_0x49a7ce[_0x352e('0x2f')]['filter']){_0xd6b12b[_0x352e('0x38')]=_[_0x352e('0x3a')](_0xd6b12b['where'],{'$or':_[_0x352e('0x2a')](_0x1a4986,function(_0x10be73){if(_0x10be73[_0x352e('0x2d')]!==_0x352e('0x3b')){var _0x2ec1b0={};_0x2ec1b0[_0x10be73[_0x352e('0x27')]]={'$like':'%'+_0x49a7ce[_0x352e('0x2f')][_0x352e('0x3c')]+'%'};return _0x2ec1b0;}})});}_0xd6b12b=_[_0x352e('0x3a')]({},_0xd6b12b,_0x49a7ce['options']);var _0xa1b08b={'where':_0xd6b12b[_0x352e('0x38')]};return db[_0x352e('0x2b')]['count'](_0xa1b08b)[_0x352e('0x23')](function(_0x3b7624){_0x461fa6['count']=_0x3b7624;if(_0x49a7ce[_0x352e('0x2f')]['includeAll']){_0xd6b12b[_0x352e('0x3d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x352e('0x3e')](_0xd6b12b);})[_0x352e('0x23')](function(_0x41093a){_0x461fa6['rows']=_0x41093a;return _0x461fa6;})[_0x352e('0x23')](respondWithFilteredResult(_0x544c5e,_0xd6b12b))[_0x352e('0x3f')](handleError(_0x544c5e,null));};exports[_0x352e('0x40')]=function(_0x49dc26,_0x3d1121){var _0x2ba7e1={'raw':![],'where':{'id':_0x49dc26['params']['id']}},_0x4ab2cb={};_0x4ab2cb[_0x352e('0x2e')]=_['keys'](db[_0x352e('0x2b')]['rawAttributes']);_0x4ab2cb[_0x352e('0x2f')]=_['keys'](_0x49dc26[_0x352e('0x2f')]);_0x4ab2cb[_0x352e('0x41')]=_[_0x352e('0x31')](_0x4ab2cb['model'],_0x4ab2cb[_0x352e('0x2f')]);_0x2ba7e1[_0x352e('0x32')]=_[_0x352e('0x31')](_0x4ab2cb[_0x352e('0x2e')],qs[_0x352e('0x42')](_0x49dc26['query'][_0x352e('0x42')]));_0x2ba7e1['attributes']=_0x2ba7e1['attributes'][_0x352e('0x33')]?_0x2ba7e1[_0x352e('0x32')]:_0x4ab2cb[_0x352e('0x2e')];if(_0x49dc26[_0x352e('0x2f')][_0x352e('0x43')]){_0x2ba7e1['include']=[{'all':!![]}];}_0x2ba7e1=_[_0x352e('0x3a')]({},_0x2ba7e1,_0x49dc26[_0x352e('0x44')]);return db[_0x352e('0x2b')][_0x352e('0x45')](_0x2ba7e1)[_0x352e('0x23')](handleEntityNotFound(_0x3d1121,null))['then'](respondWithResult(_0x3d1121,null))[_0x352e('0x3f')](handleError(_0x3d1121,null));};exports[_0x352e('0x46')]=function(_0x364eee,_0x47645c){return db[_0x352e('0x2b')][_0x352e('0x46')](_0x364eee[_0x352e('0x47')],{})['then'](respondWithResult(_0x47645c,0xc9))[_0x352e('0x3f')](handleError(_0x47645c,null));};exports[_0x352e('0x48')]=function(_0x2ab56a,_0x2cf000){if(_0x2ab56a['body']['id']){delete _0x2ab56a[_0x352e('0x47')]['id'];}return db[_0x352e('0x2b')][_0x352e('0x45')]({'where':{'id':_0x2ab56a[_0x352e('0x49')]['id']}})[_0x352e('0x23')](handleEntityNotFound(_0x2cf000,null))[_0x352e('0x23')](saveUpdates(_0x2ab56a[_0x352e('0x47')],null))[_0x352e('0x23')](respondWithResult(_0x2cf000,null))['catch'](handleError(_0x2cf000,null));};exports[_0x352e('0x24')]=function(_0x3071d3,_0x2ac4a7){return db[_0x352e('0x2b')][_0x352e('0x45')]({'where':{'id':_0x3071d3['params']['id']}})[_0x352e('0x23')](handleEntityNotFound(_0x2ac4a7,null))[_0x352e('0x23')](removeEntity(_0x2ac4a7,null))[_0x352e('0x3f')](handleError(_0x2ac4a7,null));};exports[_0x352e('0x4a')]=function(_0x492ca4,_0x4eb01d,_0x57aa70){var _0x166110={};var _0x3e2147={};var _0x5d4685;var _0x148631;return db[_0x352e('0x2b')][_0x352e('0x4b')]({'where':{'id':_0x492ca4[_0x352e('0x49')]['id']}})[_0x352e('0x23')](handleEntityNotFound(_0x4eb01d,null))[_0x352e('0x23')](function(_0x441386){if(_0x441386){_0x5d4685=_0x441386;_0x3e2147[_0x352e('0x2e')]=_[_0x352e('0x30')](db[_0x352e('0x4c')][_0x352e('0x2c')]);_0x3e2147[_0x352e('0x2f')]=_[_0x352e('0x30')](_0x492ca4['query']);_0x3e2147[_0x352e('0x41')]=_[_0x352e('0x31')](_0x3e2147[_0x352e('0x2e')],_0x3e2147[_0x352e('0x2f')]);_0x166110[_0x352e('0x32')]=_['intersection'](_0x3e2147[_0x352e('0x2e')],qs[_0x352e('0x42')](_0x492ca4[_0x352e('0x2f')][_0x352e('0x42')]));_0x166110['attributes']=_0x166110['attributes'][_0x352e('0x33')]?_0x166110[_0x352e('0x32')]:_0x3e2147[_0x352e('0x2e')];_0x166110[_0x352e('0x36')]=qs[_0x352e('0x37')](_0x492ca4[_0x352e('0x2f')][_0x352e('0x37')]);_0x166110[_0x352e('0x38')]=qs[_0x352e('0x41')](_[_0x352e('0x39')](_0x492ca4[_0x352e('0x2f')],_0x3e2147[_0x352e('0x41')]));if(_0x492ca4['query']['filter']){_0x166110[_0x352e('0x38')]=_['merge'](_0x166110['where'],{'$or':_[_0x352e('0x2a')](_0x166110[_0x352e('0x32')],function(_0xbe0959){var _0x33a8c4={};_0x33a8c4[_0xbe0959]={'$like':'%'+_0x492ca4[_0x352e('0x2f')]['filter']+'%'};return _0x33a8c4;})});}_0x166110=_[_0x352e('0x3a')]({},_0x166110,_0x492ca4[_0x352e('0x44')]);return _0x5d4685['getConfigurations'](_0x166110);}})[_0x352e('0x23')](function(_0x4dc005){if(_0x4dc005){_0x148631=_0x4dc005[_0x352e('0x33')];if(!_0x492ca4[_0x352e('0x2f')][_0x352e('0x34')](_0x352e('0x35'))){_0x166110[_0x352e('0x1f')]=qs[_0x352e('0x1f')](_0x492ca4[_0x352e('0x2f')][_0x352e('0x1f')]);_0x166110[_0x352e('0x1c')]=qs['offset'](_0x492ca4[_0x352e('0x2f')][_0x352e('0x1c')]);}return _0x5d4685[_0x352e('0x4a')](_0x166110);}})[_0x352e('0x23')](function(_0x22d852){if(_0x22d852){return _0x22d852?{'count':_0x148631,'rows':_0x22d852}:null;}})[_0x352e('0x23')](respondWithResult(_0x4eb01d,null))[_0x352e('0x3f')](handleError(_0x4eb01d,null));};exports['addConfiguration']=function(_0x473bef,_0x2b4e1a,_0x225aae){if(_0x473bef['body']['id']){delete _0x473bef[_0x352e('0x47')]['id'];}return db['ServicenowAccount'][_0x352e('0x4b')]({'where':{'id':_0x473bef[_0x352e('0x49')]['id']}})[_0x352e('0x23')](handleEntityNotFound(_0x2b4e1a,null))['then'](function(_0x39ea26){if(_0x39ea26){_0x473bef[_0x352e('0x47')][_0x352e('0x4d')]=_0x39ea26['id'];_0x473bef[_0x352e('0x47')][_0x352e('0x4e')]=integrations[_0x352e('0x4f')](_0x473bef['body'][_0x352e('0x50')],_0x473bef[_0x352e('0x47')][_0x352e('0x2d')]);_0x473bef[_0x352e('0x47')][_0x352e('0x51')]=integrations[_0x352e('0x52')](_0x473bef[_0x352e('0x47')][_0x352e('0x50')],_0x473bef[_0x352e('0x47')]['type']);return db[_0x352e('0x4c')][_0x352e('0x46')](_0x473bef[_0x352e('0x47')],{'include':[{'model':db[_0x352e('0x53')],'as':_0x352e('0x4e')},{'model':db[_0x352e('0x53')],'as':_0x352e('0x51')}]});}return null;})[_0x352e('0x23')](respondWithResult(_0x2b4e1a,null))[_0x352e('0x3f')](handleError(_0x2b4e1a,null));};exports[_0x352e('0x54')]=function(_0x98dd1a,_0x509cd5,_0x21de44){var _0xe873d9=['made_sla','hold_reason',_0x352e('0x55'),_0x352e('0x56'),_0x352e('0x57'),_0x352e('0x58'),_0x352e('0x59'),'severity',_0x352e('0x5a')];var _0x53f44f=[_0x352e('0x5b'),_0x352e('0x5c'),'caused_by','watch_list','upon_reject',_0x352e('0x5d'),_0x352e('0x5e'),'hold_reason',_0x352e('0x5f'),_0x352e('0x60'),_0x352e('0x61'),_0x352e('0x62'),_0x352e('0x63'),_0x352e('0x64'),'sys_created_on',_0x352e('0x65'),_0x352e('0x66'),_0x352e('0x67'),_0x352e('0x55'),_0x352e('0x36'),_0x352e('0x68'),_0x352e('0x69'),_0x352e('0x6a'),_0x352e('0x6b'),'impact',_0x352e('0x6c'),_0x352e('0x6d'),_0x352e('0x6e'),_0x352e('0x6f'),_0x352e('0x70'),_0x352e('0x71'),'time_worked',_0x352e('0x72'),'opened_at',_0x352e('0x73'),_0x352e('0x74'),_0x352e('0x75'),'reopened_time','resolved_at',_0x352e('0x76'),_0x352e('0x77'),_0x352e('0x56'),_0x352e('0x78'),_0x352e('0x79'),'close_code',_0x352e('0x7a'),_0x352e('0x7b'),_0x352e('0x7c'),'assignment_group',_0x352e('0x7d'),'additional_assignee_list',_0x352e('0x7e'),_0x352e('0x7f'),'notify','sys_class_name','close_notes',_0x352e('0x80'),'follow_up',_0x352e('0x81'),_0x352e('0x82'),'contact_type',_0x352e('0x83'),_0x352e('0x59'),_0x352e('0x84'),'problem_id',_0x352e('0x85'),'reassignment_count','activity_due','assigned_to','severity','comments',_0x352e('0x86'),_0x352e('0x87'),_0x352e('0x88'),_0x352e('0x89'),_0x352e('0x8a'),_0x352e('0x8b'),'sys_tags',_0x352e('0x8c'),'upon_approval',_0x352e('0x8d'),_0x352e('0x8e'),_0x352e('0x5a')];var _0x2db527='';var _0x431dac='';var _0x3f9791=[];var _0x53fce1='';var _0x3c0f6e='';var _0x5ed31d=[];var _0x5db6d0='';var _0x21d865='';var _0x187288={};var _0x5d424f='';return db['ServicenowAccount'][_0x352e('0x4b')]({'where':{'id':_0x98dd1a['params']['id']},'attributes':['id',_0x352e('0x8f'),_0x352e('0x90'),'email',_0x352e('0x91'),_0x352e('0x92')]})['then'](handleEntityNotFound(_0x509cd5,null))[_0x352e('0x23')](function(_0x5d7374){if(_0x5d7374){_0x5d424f=_0x5d7374[_0x352e('0x91')];var _0x4a7f11=_0x5d424f['slice'](-0x1);if(_0x4a7f11==='/'){_0x5d424f=_0x5d424f[_0x352e('0x93')](0x0,_0x5d424f['lastIndexOf'](_0x4a7f11));}_0x21d865=util['format'](_0x352e('0x94'),_0x5d424f);_0x5db6d0=util[_0x352e('0x95')]('%s/api/now/table/',_0x5d424f);_0x187288={'user':_0x5d7374[_0x352e('0x8f')],'pass':_0x5d7374[_0x352e('0x90')]};var _0x472bd6={'method':_0x352e('0x96'),'uri':_0x21d865+_0x352e('0x97'),'auth':_0x187288,'json':!![]};return rp(_0x472bd6);}})['then'](function(_0x463773){if(_0x463773[_0x352e('0x98')][_0x352e('0x33')]>0x0){_0x2db527=_0x463773[_0x352e('0x98')];}console['log'](_0x352e('0x99'),_0x2db527);_0x5ed31d=[];_0x431dac=Object['assign']([],_0x2db527);_['remove'](_0x431dac,function(_0x1521a7){return!_0xe873d9[_0x352e('0x9a')](_0x1521a7[_0x352e('0x27')]);});_0x431dac[_0x352e('0x9b')](function(_0x2ff67d){var _0xee8e9e=createFieldObject(_0x5db6d0,_0x187288,_0x2ff67d[_0x352e('0x9c')],_0x2ff67d['name'],_0x2ff67d[_0x352e('0x9d')],![]);_0x5ed31d['push'](_0xee8e9e);});return Promise['all'](_0x5ed31d);})['then'](function(_0x17b530){_0x3f9791=_0x17b530;_0x53fce1=Object[_0x352e('0x9e')]([],_0x2db527);console[_0x352e('0x9f')](_0x352e('0xa0'),_0x2db527);_[_0x352e('0xa1')](_0x53fce1,function(_0x292b04){return _0x53f44f[_0x352e('0x9a')](_0x292b04[_0x352e('0x27')]);});console[_0x352e('0x9f')](_0x352e('0xa2'),_0x53fce1);_0x5ed31d=[];_0x53fce1['forEach'](function(_0x47a244){var _0x5247a1=createFieldObject(_0x5db6d0,_0x187288,_0x47a244[_0x352e('0x9c')],_0x47a244[_0x352e('0x27')],_0x47a244[_0x352e('0x9d')],!![]);_0x5ed31d[_0x352e('0xa3')](_0x5247a1);});return Promise[_0x352e('0xa4')](_0x5ed31d);})[_0x352e('0x23')](function(_0x4b2c7b){_0x3c0f6e=_0x4b2c7b;var _0x5f0a11=_0x3f9791[_0x352e('0xa5')](_0x3c0f6e);return{'count':_0x5f0a11[_0x352e('0x33')],'rows':_0x5f0a11};})[_0x352e('0x23')](respondWithResult(_0x509cd5,null))['catch'](function(_0x41eed8){console[_0x352e('0x9f')](_0x352e('0xa6')+_0x41eed8);var _0x24df1d=_0x98dd1a['query'][_0x352e('0xa7')]?0x1f4:_0x41eed8['statusCode']||0x1f4;logger[_0x352e('0x25')](_0x41eed8[_0x352e('0x26')]);delete _0x41eed8[_0x352e('0x27')];if(_0x24df1d===0x191){_0x24df1d=0x190;}_0x509cd5[_0x352e('0x1a')](_0x24df1d)[_0x352e('0x28')](_0x98dd1a[_0x352e('0x2f')][_0x352e('0xa7')]?{'message':_0x352e('0xa8'),'statusCode':_0x41eed8[_0x352e('0xa9')]}:_0x41eed8);});};function createFieldObject(_0x427a46,_0x9e5752,_0x41c1a6,_0x14eee,_0x33cc14,_0x5c7a89){return new Promise(function(_0x377df1,_0x33073e){var _0x455ba8={'id':_0x14eee,'name':_0x33cc14,'custom':_0x5c7a89};if(_0x41c1a6===_0x352e('0xaa')){_0x455ba8[_0x352e('0x44')]=[{'name':'True','value':_0x352e('0xab')},{'name':'False','value':_0x352e('0xac')}];_0x377df1(_0x455ba8);}else{var _0x4b76ce={'method':_0x352e('0x96'),'uri':_0x427a46+_0x352e('0xad')+_0x14eee,'auth':_0x9e5752,'json':!![]};return rp(_0x4b76ce)[_0x352e('0x23')](function(_0x1c29d5){var _0x2ef862=[];if(_0x1c29d5[_0x352e('0x98')][_0x352e('0x33')]>0x0){_0x1c29d5[_0x352e('0x98')][_0x352e('0x9b')](function(_0xfc2071){if(_0xfc2071['inactive']===_0x352e('0xac')){var _0x438316={'name':_0xfc2071[_0x352e('0x9d')],'value':_0xfc2071[_0x352e('0xae')]};_0x2ef862[_0x352e('0xa3')](_0x438316);}});}_0x455ba8[_0x352e('0x44')]=_0x2ef862;if(_0x455ba8[_0x352e('0x44')][_0x352e('0x33')]>0x0){_0x377df1(_0x455ba8);}else{if(_0x5c7a89==![]){_0x377df1();}else{_0x377df1(_0x455ba8);}}});}});} \ No newline at end of file +var _0xd187=['stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','create','body','update','find','destroy','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','catch','getFields','made_sla','hold_reason','notify','severity','category','caused_by','watch_list','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','knowledge','calendar_stc','cmdb_ci','impact','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','approval_set','subcategory','work_notes','short_description','close_code','correlation_display','delivery_task','business_stc','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','False','false','inactive','value','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xd187,0x142));var _0x7d18=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd187[_0x3054be];return _0x3df150;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d18('0x0'));var zipdir=require(_0x7d18('0x1'));var jsonpatch=require(_0x7d18('0x2'));var rp=require(_0x7d18('0x3'));var moment=require(_0x7d18('0x4'));var BPromise=require(_0x7d18('0x5'));var Mustache=require(_0x7d18('0x6'));var util=require(_0x7d18('0x7'));var path=require(_0x7d18('0x8'));var sox=require(_0x7d18('0x9'));var csv=require(_0x7d18('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d18('0xb'));var _=require(_0x7d18('0xc'));var squel=require(_0x7d18('0xd'));var crypto=require(_0x7d18('0xe'));var jsforce=require(_0x7d18('0xf'));var deskjs=require(_0x7d18('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7d18('0x11'));var Papa=require(_0x7d18('0x12'));var Redis=require(_0x7d18('0x13'));var authService=require(_0x7d18('0x14'));var qs=require(_0x7d18('0x15'));var as=require(_0x7d18('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d18('0x17'))(_0x7d18('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d18('0x19'));var db=require(_0x7d18('0x1a'))['db'];var integrations=require(_0x7d18('0x1b'));function respondWithStatusCode(_0x51706c,_0xabdc23){_0xabdc23=_0xabdc23||0xcc;return function(_0x3899cf){if(_0x3899cf){return _0x51706c['sendStatus'](_0xabdc23);}return _0x51706c[_0x7d18('0x1c')](_0xabdc23)['end']();};}function respondWithResult(_0x2b20ea,_0x592aa9){_0x592aa9=_0x592aa9||0xc8;return function(_0x209215){if(_0x209215){return _0x2b20ea[_0x7d18('0x1c')](_0x592aa9)['json'](_0x209215);}};}function respondWithFilteredResult(_0xaf354a,_0x4bc6c6){return function(_0x2b5076){if(_0x2b5076){var _0x3ca110=typeof _0x4bc6c6[_0x7d18('0x1d')]===_0x7d18('0x1e')&&typeof _0x4bc6c6[_0x7d18('0x1f')]===_0x7d18('0x1e');var _0x4c2c90=_0x2b5076['count'];var _0x3a0a06=_0x3ca110?0x0:_0x4bc6c6[_0x7d18('0x1d')];var _0x1e9702=_0x3ca110?_0x2b5076[_0x7d18('0x20')]:_0x4bc6c6[_0x7d18('0x1d')]+_0x4bc6c6[_0x7d18('0x1f')];var _0x378ecc;if(_0x1e9702>=_0x4c2c90){_0x1e9702=_0x4c2c90;_0x378ecc=0xc8;}else{_0x378ecc=0xce;}_0xaf354a['status'](_0x378ecc);return _0xaf354a[_0x7d18('0x21')](_0x7d18('0x22'),_0x3a0a06+'-'+_0x1e9702+'/'+_0x4c2c90)['json'](_0x2b5076);}return null;};}function patchUpdates(_0x3925d0){return function(_0x3e6f5d){try{jsonpatch[_0x7d18('0x23')](_0x3e6f5d,_0x3925d0,!![]);}catch(_0x33a649){return BPromise[_0x7d18('0x24')](_0x33a649);}return _0x3e6f5d[_0x7d18('0x25')]();};}function saveUpdates(_0x304a09,_0x167c5d){return function(_0x494fdb){if(_0x494fdb){return _0x494fdb['update'](_0x304a09)[_0x7d18('0x26')](function(_0x4d41b6){return _0x4d41b6;});}return null;};}function removeEntity(_0xea5bad,_0x4a7096){return function(_0x36b8a6){if(_0x36b8a6){return _0x36b8a6['destroy']()[_0x7d18('0x26')](function(){_0xea5bad[_0x7d18('0x1c')](0xcc)[_0x7d18('0x27')]();});}};}function handleEntityNotFound(_0x12d857,_0x75bbd3){return function(_0x22d876){if(!_0x22d876){_0x12d857[_0x7d18('0x28')](0x194);}return _0x22d876;};}function handleError(_0x367103,_0x37915d){_0x37915d=_0x37915d||0x1f4;return function(_0x5592e6){logger[_0x7d18('0x29')](_0x5592e6[_0x7d18('0x2a')]);if(_0x5592e6['name']){delete _0x5592e6[_0x7d18('0x2b')];}_0x367103[_0x7d18('0x1c')](_0x37915d)[_0x7d18('0x2c')](_0x5592e6);};}exports[_0x7d18('0x2d')]=function(_0x265ab5,_0x5c7bde){var _0x2aeb75={},_0x1e546a={},_0x926c6a={'count':0x0,'rows':[]};var _0x2df946=_[_0x7d18('0x2e')](db[_0x7d18('0x2f')][_0x7d18('0x30')],function(_0x3862e8){return{'name':_0x3862e8[_0x7d18('0x31')],'type':_0x3862e8[_0x7d18('0x32')][_0x7d18('0x33')]};});_0x1e546a['model']=_[_0x7d18('0x2e')](_0x2df946,_0x7d18('0x2b'));_0x1e546a[_0x7d18('0x34')]=_['keys'](_0x265ab5[_0x7d18('0x34')]);_0x1e546a[_0x7d18('0x35')]=_['intersection'](_0x1e546a[_0x7d18('0x36')],_0x1e546a['query']);_0x2aeb75['attributes']=_[_0x7d18('0x37')](_0x1e546a[_0x7d18('0x36')],qs[_0x7d18('0x38')](_0x265ab5[_0x7d18('0x34')][_0x7d18('0x38')]));_0x2aeb75[_0x7d18('0x39')]=_0x2aeb75[_0x7d18('0x39')][_0x7d18('0x3a')]?_0x2aeb75[_0x7d18('0x39')]:_0x1e546a[_0x7d18('0x36')];if(!_0x265ab5['query'][_0x7d18('0x3b')]('nolimit')){_0x2aeb75[_0x7d18('0x1f')]=qs[_0x7d18('0x1f')](_0x265ab5[_0x7d18('0x34')][_0x7d18('0x1f')]);_0x2aeb75[_0x7d18('0x1d')]=qs[_0x7d18('0x1d')](_0x265ab5[_0x7d18('0x34')][_0x7d18('0x1d')]);}_0x2aeb75[_0x7d18('0x3c')]=qs[_0x7d18('0x3d')](_0x265ab5[_0x7d18('0x34')]['sort']);_0x2aeb75[_0x7d18('0x3e')]=qs[_0x7d18('0x35')](_[_0x7d18('0x3f')](_0x265ab5[_0x7d18('0x34')],_0x1e546a[_0x7d18('0x35')]),_0x2df946);if(_0x265ab5[_0x7d18('0x34')][_0x7d18('0x40')]){_0x2aeb75[_0x7d18('0x3e')]=_[_0x7d18('0x41')](_0x2aeb75[_0x7d18('0x3e')],{'$or':_['map'](_0x2df946,function(_0x362c8e){if(_0x362c8e['type']!==_0x7d18('0x42')){var _0x16513e={};_0x16513e[_0x362c8e[_0x7d18('0x2b')]]={'$like':'%'+_0x265ab5[_0x7d18('0x34')][_0x7d18('0x40')]+'%'};return _0x16513e;}})});}_0x2aeb75=_[_0x7d18('0x41')]({},_0x2aeb75,_0x265ab5[_0x7d18('0x43')]);var _0x5de459={'where':_0x2aeb75[_0x7d18('0x3e')]};return db[_0x7d18('0x2f')][_0x7d18('0x20')](_0x5de459)['then'](function(_0x28bf84){_0x926c6a[_0x7d18('0x20')]=_0x28bf84;if(_0x265ab5[_0x7d18('0x34')]['includeAll']){_0x2aeb75[_0x7d18('0x44')]=[{'all':!![]}];}return db[_0x7d18('0x2f')][_0x7d18('0x45')](_0x2aeb75);})[_0x7d18('0x26')](function(_0x2c9881){_0x926c6a[_0x7d18('0x46')]=_0x2c9881;return _0x926c6a;})['then'](respondWithFilteredResult(_0x5c7bde,_0x2aeb75))['catch'](handleError(_0x5c7bde,null));};exports[_0x7d18('0x47')]=function(_0x1cbcd2,_0x5b7ab6){var _0x14da8c={'raw':![],'where':{'id':_0x1cbcd2[_0x7d18('0x48')]['id']}},_0x304215={};_0x304215[_0x7d18('0x36')]=_[_0x7d18('0x49')](db[_0x7d18('0x2f')][_0x7d18('0x30')]);_0x304215['query']=_[_0x7d18('0x49')](_0x1cbcd2[_0x7d18('0x34')]);_0x304215[_0x7d18('0x35')]=_['intersection'](_0x304215[_0x7d18('0x36')],_0x304215[_0x7d18('0x34')]);_0x14da8c[_0x7d18('0x39')]=_[_0x7d18('0x37')](_0x304215[_0x7d18('0x36')],qs['fields'](_0x1cbcd2[_0x7d18('0x34')][_0x7d18('0x38')]));_0x14da8c[_0x7d18('0x39')]=_0x14da8c[_0x7d18('0x39')]['length']?_0x14da8c[_0x7d18('0x39')]:_0x304215[_0x7d18('0x36')];if(_0x1cbcd2[_0x7d18('0x34')][_0x7d18('0x4a')]){_0x14da8c['include']=[{'all':!![]}];}_0x14da8c=_[_0x7d18('0x41')]({},_0x14da8c,_0x1cbcd2['options']);return db['ServicenowAccount']['find'](_0x14da8c)[_0x7d18('0x26')](handleEntityNotFound(_0x5b7ab6,null))['then'](respondWithResult(_0x5b7ab6,null))['catch'](handleError(_0x5b7ab6,null));};exports[_0x7d18('0x4b')]=function(_0x41f3cb,_0x5533a5){return db['ServicenowAccount']['create'](_0x41f3cb[_0x7d18('0x4c')],{})[_0x7d18('0x26')](respondWithResult(_0x5533a5,0xc9))['catch'](handleError(_0x5533a5,null));};exports[_0x7d18('0x4d')]=function(_0x115cd5,_0x35b129){if(_0x115cd5[_0x7d18('0x4c')]['id']){delete _0x115cd5['body']['id'];}return db[_0x7d18('0x2f')][_0x7d18('0x4e')]({'where':{'id':_0x115cd5[_0x7d18('0x48')]['id']}})[_0x7d18('0x26')](handleEntityNotFound(_0x35b129,null))[_0x7d18('0x26')](saveUpdates(_0x115cd5['body'],null))[_0x7d18('0x26')](respondWithResult(_0x35b129,null))['catch'](handleError(_0x35b129,null));};exports[_0x7d18('0x4f')]=function(_0x478e06,_0x437a27){return db[_0x7d18('0x2f')]['find']({'where':{'id':_0x478e06[_0x7d18('0x48')]['id']}})[_0x7d18('0x26')](handleEntityNotFound(_0x437a27,null))[_0x7d18('0x26')](removeEntity(_0x437a27,null))['catch'](handleError(_0x437a27,null));};exports[_0x7d18('0x50')]=function(_0x3d5403,_0x18c894,_0x334ea5){var _0x3d80a3={};var _0x2a233d={};var _0x369521;var _0x1ee4a1;return db[_0x7d18('0x2f')]['findOne']({'where':{'id':_0x3d5403[_0x7d18('0x48')]['id']}})[_0x7d18('0x26')](handleEntityNotFound(_0x18c894,null))[_0x7d18('0x26')](function(_0x39c3b0){if(_0x39c3b0){_0x369521=_0x39c3b0;_0x2a233d[_0x7d18('0x36')]=_['keys'](db[_0x7d18('0x51')][_0x7d18('0x30')]);_0x2a233d[_0x7d18('0x34')]=_[_0x7d18('0x49')](_0x3d5403[_0x7d18('0x34')]);_0x2a233d[_0x7d18('0x35')]=_[_0x7d18('0x37')](_0x2a233d[_0x7d18('0x36')],_0x2a233d[_0x7d18('0x34')]);_0x3d80a3[_0x7d18('0x39')]=_[_0x7d18('0x37')](_0x2a233d[_0x7d18('0x36')],qs[_0x7d18('0x38')](_0x3d5403[_0x7d18('0x34')][_0x7d18('0x38')]));_0x3d80a3['attributes']=_0x3d80a3['attributes'][_0x7d18('0x3a')]?_0x3d80a3[_0x7d18('0x39')]:_0x2a233d['model'];_0x3d80a3[_0x7d18('0x3c')]=qs[_0x7d18('0x3d')](_0x3d5403[_0x7d18('0x34')]['sort']);_0x3d80a3[_0x7d18('0x3e')]=qs[_0x7d18('0x35')](_[_0x7d18('0x3f')](_0x3d5403[_0x7d18('0x34')],_0x2a233d[_0x7d18('0x35')]));if(_0x3d5403[_0x7d18('0x34')][_0x7d18('0x40')]){_0x3d80a3[_0x7d18('0x3e')]=_['merge'](_0x3d80a3[_0x7d18('0x3e')],{'$or':_[_0x7d18('0x2e')](_0x3d80a3['attributes'],function(_0x125f00){var _0x19789d={};_0x19789d[_0x125f00]={'$like':'%'+_0x3d5403['query']['filter']+'%'};return _0x19789d;})});}_0x3d80a3=_[_0x7d18('0x41')]({},_0x3d80a3,_0x3d5403['options']);return _0x369521[_0x7d18('0x50')](_0x3d80a3);}})['then'](function(_0x180006){if(_0x180006){_0x1ee4a1=_0x180006[_0x7d18('0x3a')];if(!_0x3d5403['query'][_0x7d18('0x3b')](_0x7d18('0x52'))){_0x3d80a3[_0x7d18('0x1f')]=qs[_0x7d18('0x1f')](_0x3d5403['query'][_0x7d18('0x1f')]);_0x3d80a3[_0x7d18('0x1d')]=qs['offset'](_0x3d5403[_0x7d18('0x34')][_0x7d18('0x1d')]);}return _0x369521[_0x7d18('0x50')](_0x3d80a3);}})[_0x7d18('0x26')](function(_0x1c1c74){if(_0x1c1c74){return _0x1c1c74?{'count':_0x1ee4a1,'rows':_0x1c1c74}:null;}})['then'](respondWithResult(_0x18c894,null))['catch'](handleError(_0x18c894,null));};exports[_0x7d18('0x53')]=function(_0x5e8690,_0x13b64f,_0x325ba9){if(_0x5e8690[_0x7d18('0x4c')]['id']){delete _0x5e8690[_0x7d18('0x4c')]['id'];}return db[_0x7d18('0x2f')][_0x7d18('0x54')]({'where':{'id':_0x5e8690[_0x7d18('0x48')]['id']}})[_0x7d18('0x26')](handleEntityNotFound(_0x13b64f,null))[_0x7d18('0x26')](function(_0x5f4572){if(_0x5f4572){_0x5e8690[_0x7d18('0x4c')][_0x7d18('0x55')]=_0x5f4572['id'];_0x5e8690[_0x7d18('0x4c')][_0x7d18('0x56')]=integrations[_0x7d18('0x57')](_0x5e8690[_0x7d18('0x4c')][_0x7d18('0x58')],_0x5e8690[_0x7d18('0x4c')]['type']);_0x5e8690[_0x7d18('0x4c')][_0x7d18('0x59')]=integrations[_0x7d18('0x5a')](_0x5e8690['body'][_0x7d18('0x58')],_0x5e8690[_0x7d18('0x4c')][_0x7d18('0x32')]);return db[_0x7d18('0x51')][_0x7d18('0x4b')](_0x5e8690[_0x7d18('0x4c')],{'include':[{'model':db[_0x7d18('0x5b')],'as':_0x7d18('0x56')},{'model':db[_0x7d18('0x5b')],'as':_0x7d18('0x59')}]});}return null;})[_0x7d18('0x26')](respondWithResult(_0x13b64f,null))[_0x7d18('0x5c')](handleError(_0x13b64f,null));};exports[_0x7d18('0x5d')]=function(_0xedf9e9,_0x33f3a7,_0x271f69){var _0x907306=[_0x7d18('0x5e'),_0x7d18('0x5f'),'knowledge','subcategory','close_code',_0x7d18('0x60'),'incident_state',_0x7d18('0x61'),_0x7d18('0x62')];var _0x54224b=['parent','made_sla',_0x7d18('0x63'),_0x7d18('0x64'),'upon_reject',_0x7d18('0x65'),'child_incidents',_0x7d18('0x5f'),_0x7d18('0x66'),_0x7d18('0x67'),_0x7d18('0x68'),_0x7d18('0x69'),_0x7d18('0x6a'),_0x7d18('0x6b'),_0x7d18('0x6c'),'sys_domain','state','sys_created_by',_0x7d18('0x6d'),'order',_0x7d18('0x6e'),'closed_at',_0x7d18('0x6f'),'delivery_plan',_0x7d18('0x70'),'active',_0x7d18('0x71'),_0x7d18('0x72'),_0x7d18('0x73'),'sys_domain_path',_0x7d18('0x74'),_0x7d18('0x75'),_0x7d18('0x76'),_0x7d18('0x77'),'business_duration','group_list','work_end','reopened_time','resolved_at','caller_id',_0x7d18('0x78'),_0x7d18('0x79'),_0x7d18('0x7a'),_0x7d18('0x7b'),_0x7d18('0x7c'),_0x7d18('0x7d'),_0x7d18('0x7e'),'work_start','assignment_group',_0x7d18('0x7f'),'additional_assignee_list',_0x7d18('0x80'),'calendar_duration',_0x7d18('0x60'),_0x7d18('0x81'),_0x7d18('0x82'),_0x7d18('0x83'),_0x7d18('0x84'),_0x7d18('0x85'),_0x7d18('0x86'),'contact_type',_0x7d18('0x87'),_0x7d18('0x88'),'urgency',_0x7d18('0x89'),_0x7d18('0x8a'),_0x7d18('0x8b'),'activity_due',_0x7d18('0x8c'),_0x7d18('0x61'),_0x7d18('0x8d'),'sla_due',_0x7d18('0x8e'),_0x7d18('0x8f'),_0x7d18('0x90'),'sys_mod_count','reopen_count',_0x7d18('0x91'),_0x7d18('0x92'),_0x7d18('0x93'),_0x7d18('0x94'),_0x7d18('0x95'),_0x7d18('0x62')];var _0x58cc95='';var _0x545a90='';var _0x289bf9=[];var _0x2df9e2='';var _0x326275='';var _0x3233db=[];var _0x7b4402='';var _0x3a99d9='';var _0x4480c6={};var _0xc4710='';return db[_0x7d18('0x2f')][_0x7d18('0x54')]({'where':{'id':_0xedf9e9[_0x7d18('0x48')]['id']},'attributes':['id',_0x7d18('0x96'),'password',_0x7d18('0x97'),_0x7d18('0x98'),_0x7d18('0x99')]})[_0x7d18('0x26')](handleEntityNotFound(_0x33f3a7,null))['then'](function(_0x13cbb7){if(_0x13cbb7){_0xc4710=_0x13cbb7[_0x7d18('0x98')];var _0x4b3f86=_0xc4710['slice'](-0x1);if(_0x4b3f86==='/'){_0xc4710=_0xc4710[_0x7d18('0x9a')](0x0,_0xc4710[_0x7d18('0x9b')](_0x4b3f86));}_0x3a99d9=util[_0x7d18('0x9c')](_0x7d18('0x9d'),_0xc4710);_0x7b4402=util[_0x7d18('0x9c')](_0x7d18('0x9e'),_0xc4710);_0x4480c6={'user':_0x13cbb7[_0x7d18('0x96')],'pass':_0x13cbb7['password']};var _0x47d012={'method':_0x7d18('0x9f'),'uri':_0x3a99d9+_0x7d18('0xa0'),'auth':_0x4480c6,'json':!![]};return rp(_0x47d012);}})['then'](function(_0x4ee5db){if(_0x4ee5db[_0x7d18('0xa1')][_0x7d18('0x3a')]>0x0){_0x58cc95=_0x4ee5db[_0x7d18('0xa1')];}console['log'](_0x7d18('0xa2'),_0x58cc95);_0x3233db=[];_0x545a90=Object[_0x7d18('0xa3')]([],_0x58cc95);_[_0x7d18('0xa4')](_0x545a90,function(_0x5c7eb8){return!_0x907306[_0x7d18('0xa5')](_0x5c7eb8[_0x7d18('0x2b')]);});_0x545a90['forEach'](function(_0x1640c1){var _0x38f9e9=createFieldObject(_0x7b4402,_0x4480c6,_0x1640c1[_0x7d18('0xa6')],_0x1640c1['name'],_0x1640c1[_0x7d18('0xa7')],![]);_0x3233db[_0x7d18('0xa8')](_0x38f9e9);});return Promise[_0x7d18('0xa9')](_0x3233db);})[_0x7d18('0x26')](function(_0x4e3baf){_0x289bf9=_0x4e3baf;_0x2df9e2=Object[_0x7d18('0xa3')]([],_0x58cc95);console[_0x7d18('0xaa')]('TCL:\x20_object',_0x58cc95);_[_0x7d18('0xa4')](_0x2df9e2,function(_0x35fd91){return _0x54224b[_0x7d18('0xa5')](_0x35fd91[_0x7d18('0x2b')]);});console[_0x7d18('0xaa')](_0x7d18('0xab'),_0x2df9e2);_0x3233db=[];_0x2df9e2['forEach'](function(_0x2200d0){var _0x1edee5=createFieldObject(_0x7b4402,_0x4480c6,_0x2200d0[_0x7d18('0xa6')],_0x2200d0[_0x7d18('0x2b')],_0x2200d0[_0x7d18('0xa7')],!![]);_0x3233db[_0x7d18('0xa8')](_0x1edee5);});return Promise[_0x7d18('0xa9')](_0x3233db);})['then'](function(_0x5d91f5){_0x326275=_0x5d91f5;var _0x2c229f=_0x289bf9[_0x7d18('0xac')](_0x326275);return{'count':_0x2c229f['length'],'rows':_0x2c229f};})[_0x7d18('0x26')](respondWithResult(_0x33f3a7,null))['catch'](function(_0x5733ee){console[_0x7d18('0xaa')](_0x7d18('0xad')+_0x5733ee);var _0x2b2fee=_0xedf9e9['query'][_0x7d18('0xae')]?0x1f4:_0x5733ee[_0x7d18('0xaf')]||0x1f4;logger[_0x7d18('0x29')](_0x5733ee[_0x7d18('0x2a')]);delete _0x5733ee[_0x7d18('0x2b')];if(_0x2b2fee===0x191){_0x2b2fee=0x190;}_0x33f3a7['status'](_0x2b2fee)[_0x7d18('0x2c')](_0xedf9e9[_0x7d18('0x34')][_0x7d18('0xae')]?{'message':_0x7d18('0xb0'),'statusCode':_0x5733ee[_0x7d18('0xaf')]}:_0x5733ee);});};function createFieldObject(_0x3d9bb6,_0x36cd7c,_0x467c2b,_0x2ee311,_0x1987ac,_0x354cfe){return new Promise(function(_0x32646a,_0x5435eb){var _0x49ad8d={'id':_0x2ee311,'name':_0x1987ac,'custom':_0x354cfe};if(_0x467c2b===_0x7d18('0xb1')){_0x49ad8d[_0x7d18('0x43')]=[{'name':'True','value':'true'},{'name':_0x7d18('0xb2'),'value':_0x7d18('0xb3')}];_0x32646a(_0x49ad8d);}else{var _0x25caff={'method':_0x7d18('0x9f'),'uri':_0x3d9bb6+'sys_choice?sysparm_query=name=incident^element='+_0x2ee311,'auth':_0x36cd7c,'json':!![]};return rp(_0x25caff)[_0x7d18('0x26')](function(_0x5c660d){var _0x117413=[];if(_0x5c660d[_0x7d18('0xa1')]['length']>0x0){_0x5c660d[_0x7d18('0xa1')]['forEach'](function(_0x4e6ff4){if(_0x4e6ff4[_0x7d18('0xb4')]==='false'){var _0x1acdfd={'name':_0x4e6ff4[_0x7d18('0xa7')],'value':_0x4e6ff4[_0x7d18('0xb5')]};_0x117413['push'](_0x1acdfd);}});}_0x49ad8d['options']=_0x117413;if(_0x49ad8d['options'][_0x7d18('0x3a')]>0x0){_0x32646a(_0x49ad8d);}else{if(_0x354cfe==![]){_0x32646a();}else{_0x32646a(_0x49ad8d);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7633f13..27b52b5 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 _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x26425a,_0x1b4d6f){var _0x12802a=function(_0x5db8a7){while(--_0x5db8a7){_0x26425a['push'](_0x26425a['shift']());}};_0x12802a(++_0x1b4d6f);}(_0xeff8,0x186));var _0x8eff=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xeff8[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x1a1f7d,_0x3dfcb1){var _0x189024=function(_0x3e30c3){while(--_0x3e30c3){_0x1a1f7d['push'](_0x1a1f7d['shift']());}};_0x189024(++_0x3dfcb1);}(_0xd8fb,0x99));var _0xbd8f=function(_0x6ac6ca,_0x51b438){_0x6ac6ca=_0x6ac6ca-0x0;var _0x33be07=_0xd8fb[_0x6ac6ca];return _0x33be07;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'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 fa8c247..929e759 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 _0x46fe=['result','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include','model','ShowServicenowAccount','ServicenowAccount','find','map','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x46fe,0x125));var _0xe46f=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0x46fe[_0x2fbcf6];return _0x3e7265;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe46f('0x0'));var BPromise=require(_0xe46f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe46f('0x2'));var db=require(_0xe46f('0x3'))['db'];var utils=require(_0xe46f('0x4'));var logger=require(_0xe46f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe46f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39061e,_0xc51c4f,_0x210565){return new BPromise(function(_0x31307c,_0xcbe1fe){return client[_0xe46f('0x7')](_0x39061e,_0x210565)[_0xe46f('0x8')](function(_0x535fe2){logger['info'](_0xe46f('0x9'),_0xc51c4f,_0xe46f('0xa'));logger[_0xe46f('0xb')](_0xe46f('0xc'),_0xc51c4f,_0xe46f('0xa'),JSON['stringify'](_0x535fe2));if(_0x535fe2['error']){if(_0x535fe2[_0xe46f('0xd')][_0xe46f('0xe')]===0x1f4){logger[_0xe46f('0xd')](_0xe46f('0x9'),_0xc51c4f,_0x535fe2[_0xe46f('0xd')]['message']);return _0xcbe1fe(_0x535fe2[_0xe46f('0xd')][_0xe46f('0xf')]);}logger[_0xe46f('0xd')](_0xe46f('0x9'),_0xc51c4f,_0x535fe2['error'][_0xe46f('0xf')]);return _0x31307c(_0x535fe2[_0xe46f('0xd')]['message']);}else{logger[_0xe46f('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xc51c4f,_0xe46f('0xa'));_0x31307c(_0x535fe2[_0xe46f('0x11')]['message']);}})[_0xe46f('0x12')](function(_0x4bf39d){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0xc51c4f,_0x4bf39d);_0xcbe1fe(_0x4bf39d);});});}exports[_0xe46f('0x13')]=function(_0x48ce73){var _0x49e56b=this;return new Promise(function(_0x4c1bdf,_0x7406ca){return db['ServicenowAccount'][_0xe46f('0x14')]({'raw':_0x48ce73[_0xe46f('0x15')]?_0x48ce73[_0xe46f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x48ce73[_0xe46f('0x15')]?_0x48ce73[_0xe46f('0x15')][_0xe46f('0x16')]||null:null,'attributes':_0x48ce73[_0xe46f('0x15')]?_0x48ce73['options'][_0xe46f('0x17')]||null:null,'limit':_0x48ce73[_0xe46f('0x15')]?_0x48ce73[_0xe46f('0x15')][_0xe46f('0x18')]||null:null,'include':_0x48ce73[_0xe46f('0x15')]?_0x48ce73[_0xe46f('0x15')][_0xe46f('0x19')]?_['map'](_0x48ce73[_0xe46f('0x15')][_0xe46f('0x19')],function(_0x49f68f){return{'model':db[_0x49f68f[_0xe46f('0x1a')]],'as':_0x49f68f['as'],'attributes':_0x49f68f[_0xe46f('0x17')],'include':_0x49f68f[_0xe46f('0x19')]?_['map'](_0x49f68f['include'],function(_0x1375c2){return{'model':db[_0x1375c2[_0xe46f('0x1a')]],'as':_0x1375c2['as'],'attributes':_0x1375c2[_0xe46f('0x17')],'include':_0x1375c2[_0xe46f('0x19')]?_['map'](_0x1375c2[_0xe46f('0x19')],function(_0x34ff06){return{'model':db[_0x34ff06['model']],'as':_0x34ff06['as'],'attributes':_0x34ff06[_0xe46f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21f9b8){logger[_0xe46f('0x10')](_0xe46f('0x13'),_0x48ce73);logger[_0xe46f('0xb')](_0xe46f('0x13'),_0x48ce73,JSON['stringify'](_0x21f9b8));_0x4c1bdf(_0x21f9b8);})[_0xe46f('0x12')](function(_0x7a5799){logger[_0xe46f('0xd')](_0xe46f('0x13'),_0x7a5799['message'],_0x48ce73);_0x7406ca(_0x49e56b[_0xe46f('0xd')](0x1f4,_0x7a5799[_0xe46f('0xf')]));});});};exports[_0xe46f('0x1b')]=function(_0x30ebd1){var _0x469883=this;return new Promise(function(_0x4823f0,_0x4afc01){return db[_0xe46f('0x1c')][_0xe46f('0x1d')]({'raw':_0x30ebd1[_0xe46f('0x15')]?_0x30ebd1[_0xe46f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x30ebd1['options']?_0x30ebd1[_0xe46f('0x15')]['where']||null:null,'attributes':_0x30ebd1[_0xe46f('0x15')]?_0x30ebd1[_0xe46f('0x15')]['attributes']||null:null,'include':_0x30ebd1[_0xe46f('0x15')]?_0x30ebd1[_0xe46f('0x15')][_0xe46f('0x19')]?_[_0xe46f('0x1e')](_0x30ebd1[_0xe46f('0x15')][_0xe46f('0x19')],function(_0x3626b3){return{'model':db[_0x3626b3[_0xe46f('0x1a')]],'as':_0x3626b3['as'],'attributes':_0x3626b3[_0xe46f('0x17')],'include':_0x3626b3[_0xe46f('0x19')]?_[_0xe46f('0x1e')](_0x3626b3[_0xe46f('0x19')],function(_0x4dc3d3){return{'model':db[_0x4dc3d3[_0xe46f('0x1a')]],'as':_0x4dc3d3['as'],'attributes':_0x4dc3d3[_0xe46f('0x17')],'include':_0x4dc3d3[_0xe46f('0x19')]?_[_0xe46f('0x1e')](_0x4dc3d3[_0xe46f('0x19')],function(_0x103409){return{'model':db[_0x103409[_0xe46f('0x1a')]],'as':_0x103409['as'],'attributes':_0x103409[_0xe46f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe46f('0x8')](function(_0x11b040){logger[_0xe46f('0x10')](_0xe46f('0x1b'),_0x30ebd1);logger[_0xe46f('0xb')](_0xe46f('0x1b'),_0x30ebd1,JSON['stringify'](_0x11b040));_0x4823f0(_0x11b040);})[_0xe46f('0x12')](function(_0x2e5851){logger[_0xe46f('0xd')]('ShowServicenowAccount',_0x2e5851['message'],_0x30ebd1);_0x4afc01(_0x469883[_0xe46f('0xd')](0x1f4,_0x2e5851[_0xe46f('0xf')]));});});}; \ No newline at end of file +var _0xacc3=['ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount'];(function(_0x5ede1a,_0x51e4d0){var _0x9b0761=function(_0x3cf50b){while(--_0x3cf50b){_0x5ede1a['push'](_0x5ede1a['shift']());}};_0x9b0761(++_0x51e4d0);}(_0xacc3,0xe4));var _0x3acc=function(_0x3da048,_0xdbcc23){_0x3da048=_0x3da048-0x0;var _0x3b3ea8=_0xacc3[_0x3da048];return _0x3b3ea8;};'use strict';var _=require(_0x3acc('0x0'));var util=require(_0x3acc('0x1'));var moment=require(_0x3acc('0x2'));var BPromise=require(_0x3acc('0x3'));var rs=require(_0x3acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3acc('0x5'));var logger=require(_0x3acc('0x6'))(_0x3acc('0x7'));var config=require(_0x3acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3acc('0x9')][_0x3acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a401a,_0x541c10,_0x3bc67e){return new BPromise(function(_0x355be4,_0x6eb762){return client[_0x3acc('0xb')](_0x4a401a,_0x3bc67e)[_0x3acc('0xc')](function(_0x385cc){logger[_0x3acc('0xd')](_0x3acc('0xe'),_0x541c10,_0x3acc('0xf'));logger[_0x3acc('0x10')](_0x3acc('0x11'),_0x541c10,_0x3acc('0xf'),JSON['stringify'](_0x385cc));if(_0x385cc[_0x3acc('0x12')]){if(_0x385cc['error'][_0x3acc('0x13')]===0x1f4){logger['error'](_0x3acc('0xe'),_0x541c10,_0x385cc['error']['message']);return _0x6eb762(_0x385cc[_0x3acc('0x12')][_0x3acc('0x14')]);}logger[_0x3acc('0x12')](_0x3acc('0xe'),_0x541c10,_0x385cc[_0x3acc('0x12')][_0x3acc('0x14')]);return _0x355be4(_0x385cc[_0x3acc('0x12')][_0x3acc('0x14')]);}else{logger[_0x3acc('0xd')](_0x3acc('0xe'),_0x541c10,_0x3acc('0xf'));_0x355be4(_0x385cc[_0x3acc('0x15')][_0x3acc('0x14')]);}})[_0x3acc('0x16')](function(_0x557f41){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x541c10,_0x557f41);_0x6eb762(_0x557f41);});});}exports[_0x3acc('0x17')]=function(_0x187c3e){var _0x50c73d=this;return new Promise(function(_0x443a49,_0x8f03da){return db[_0x3acc('0x18')][_0x3acc('0x19')]({'raw':_0x187c3e['options']?_0x187c3e[_0x3acc('0x1a')][_0x3acc('0x1b')]===undefined?!![]:![]:!![],'where':_0x187c3e[_0x3acc('0x1a')]?_0x187c3e[_0x3acc('0x1a')][_0x3acc('0x1c')]||null:null,'attributes':_0x187c3e[_0x3acc('0x1a')]?_0x187c3e[_0x3acc('0x1a')][_0x3acc('0x1d')]||null:null,'limit':_0x187c3e['options']?_0x187c3e[_0x3acc('0x1a')][_0x3acc('0x1e')]||null:null,'include':_0x187c3e[_0x3acc('0x1a')]?_0x187c3e[_0x3acc('0x1a')][_0x3acc('0x1f')]?_['map'](_0x187c3e['options'][_0x3acc('0x1f')],function(_0x2d6629){return{'model':db[_0x2d6629[_0x3acc('0x20')]],'as':_0x2d6629['as'],'attributes':_0x2d6629['attributes'],'include':_0x2d6629[_0x3acc('0x1f')]?_[_0x3acc('0x21')](_0x2d6629[_0x3acc('0x1f')],function(_0x99e052){return{'model':db[_0x99e052[_0x3acc('0x20')]],'as':_0x99e052['as'],'attributes':_0x99e052['attributes'],'include':_0x99e052[_0x3acc('0x1f')]?_['map'](_0x99e052[_0x3acc('0x1f')],function(_0xc1308a){return{'model':db[_0xc1308a[_0x3acc('0x20')]],'as':_0xc1308a['as'],'attributes':_0xc1308a[_0x3acc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3acc('0xc')](function(_0x45ba87){logger[_0x3acc('0xd')](_0x3acc('0x17'),_0x187c3e);logger[_0x3acc('0x10')](_0x3acc('0x17'),_0x187c3e,JSON[_0x3acc('0x22')](_0x45ba87));_0x443a49(_0x45ba87);})[_0x3acc('0x16')](function(_0x4b4e4a){logger[_0x3acc('0x12')](_0x3acc('0x17'),_0x4b4e4a[_0x3acc('0x14')],_0x187c3e);_0x8f03da(_0x50c73d[_0x3acc('0x12')](0x1f4,_0x4b4e4a[_0x3acc('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x2f2ea0){var _0x58ba3d=this;return new Promise(function(_0x38734c,_0x167adf){return db[_0x3acc('0x18')]['find']({'raw':_0x2f2ea0[_0x3acc('0x1a')]?_0x2f2ea0[_0x3acc('0x1a')][_0x3acc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f2ea0[_0x3acc('0x1a')]?_0x2f2ea0[_0x3acc('0x1a')][_0x3acc('0x1c')]||null:null,'attributes':_0x2f2ea0[_0x3acc('0x1a')]?_0x2f2ea0[_0x3acc('0x1a')][_0x3acc('0x1d')]||null:null,'include':_0x2f2ea0[_0x3acc('0x1a')]?_0x2f2ea0[_0x3acc('0x1a')]['include']?_[_0x3acc('0x21')](_0x2f2ea0['options']['include'],function(_0x39b574){return{'model':db[_0x39b574[_0x3acc('0x20')]],'as':_0x39b574['as'],'attributes':_0x39b574[_0x3acc('0x1d')],'include':_0x39b574[_0x3acc('0x1f')]?_['map'](_0x39b574['include'],function(_0x2ef2ca){return{'model':db[_0x2ef2ca['model']],'as':_0x2ef2ca['as'],'attributes':_0x2ef2ca[_0x3acc('0x1d')],'include':_0x2ef2ca[_0x3acc('0x1f')]?_[_0x3acc('0x21')](_0x2ef2ca['include'],function(_0x5a655a){return{'model':db[_0x5a655a[_0x3acc('0x20')]],'as':_0x5a655a['as'],'attributes':_0x5a655a[_0x3acc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3acc('0xc')](function(_0x183c29){logger[_0x3acc('0xd')](_0x3acc('0x23'),_0x2f2ea0);logger[_0x3acc('0x10')](_0x3acc('0x23'),_0x2f2ea0,JSON[_0x3acc('0x22')](_0x183c29));_0x38734c(_0x183c29);})[_0x3acc('0x16')](function(_0x4739b8){logger[_0x3acc('0x12')](_0x3acc('0x23'),_0x4739b8[_0x3acc('0x14')],_0x2f2ea0);_0x167adf(_0x58ba3d[_0x3acc('0x12')](0x1f4,_0x4739b8[_0x3acc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3d6f05f..54caad3 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 _0xe6b6=['/:id/fields','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x35eec2,_0x21ab9a){var _0x5dde4f=function(_0x232e61){while(--_0x232e61){_0x35eec2['push'](_0x35eec2['shift']());}};_0x5dde4f(++_0x21ab9a);}(_0xe6b6,0x140));var _0x6e6b=function(_0x4625c6,_0x3d30e3){_0x4625c6=_0x4625c6-0x0;var _0x2e651b=_0xe6b6[_0x4625c6];return _0x2e651b;};'use strict';var multer=require(_0x6e6b('0x0'));var util=require(_0x6e6b('0x1'));var path=require(_0x6e6b('0x2'));var timeout=require(_0x6e6b('0x3'));var express=require(_0x6e6b('0x4'));var router=express[_0x6e6b('0x5')]();var fs_extra=require(_0x6e6b('0x6'));var auth=require(_0x6e6b('0x7'));var interaction=require(_0x6e6b('0x8'));var config=require(_0x6e6b('0x9'));var controller=require(_0x6e6b('0xa'));router[_0x6e6b('0xb')]('/',auth[_0x6e6b('0xc')](),controller[_0x6e6b('0xd')]);router[_0x6e6b('0xb')](_0x6e6b('0xe'),auth[_0x6e6b('0xc')](),controller[_0x6e6b('0xf')]);router[_0x6e6b('0xb')](_0x6e6b('0x10'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x6e6b('0x11')]);router['get']('/:id/descriptions',auth[_0x6e6b('0xc')](),controller[_0x6e6b('0x12')]);router[_0x6e6b('0x13')]('/',auth[_0x6e6b('0xc')](),controller[_0x6e6b('0x14')]);router['put'](_0x6e6b('0xe'),auth[_0x6e6b('0xc')](),controller[_0x6e6b('0x15')]);router['delete'](_0x6e6b('0xe'),auth[_0x6e6b('0xc')](),controller[_0x6e6b('0x16')]);module[_0x6e6b('0x17')]=router; \ No newline at end of file +var _0xd60a=['getDescriptions','post','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x1e717a,_0x153fb6){var _0x4b4505=function(_0x1aba9d){while(--_0x1aba9d){_0x1e717a['push'](_0x1e717a['shift']());}};_0x4b4505(++_0x153fb6);}(_0xd60a,0x1e6));var _0xad60=function(_0x3f83e6,_0x44be52){_0x3f83e6=_0x3f83e6-0x0;var _0x677f0b=_0xd60a[_0x3f83e6];return _0x677f0b;};'use strict';var multer=require(_0xad60('0x0'));var util=require('util');var path=require(_0xad60('0x1'));var timeout=require(_0xad60('0x2'));var express=require('express');var router=express[_0xad60('0x3')]();var fs_extra=require(_0xad60('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad60('0x5'));var config=require(_0xad60('0x6'));var controller=require(_0xad60('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xad60('0x8')]);router[_0xad60('0x9')](_0xad60('0xa'),auth['isAuthenticated'](),controller[_0xad60('0xb')]);router[_0xad60('0x9')](_0xad60('0xc'),auth[_0xad60('0xd')](),controller[_0xad60('0xe')]);router['get'](_0xad60('0xf'),auth['isAuthenticated'](),controller[_0xad60('0x10')]);router[_0xad60('0x9')](_0xad60('0x11'),auth[_0xad60('0xd')](),controller[_0xad60('0x12')]);router[_0xad60('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xad60('0x14')](_0xad60('0xa'),auth[_0xad60('0xd')](),controller['update']);router[_0xad60('0x15')](_0xad60('0xa'),auth[_0xad60('0xd')](),controller[_0xad60('0x16')]);module[_0xad60('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 2c694bf..e77fe26 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 _0xfaf2=['STRING','sequelize'];(function(_0x16d0a2,_0x1fd929){var _0x282b34=function(_0x309e52){while(--_0x309e52){_0x16d0a2['push'](_0x16d0a2['shift']());}};_0x282b34(++_0x1fd929);}(_0xfaf2,0x10d));var _0x2faf=function(_0x5b05e9,_0x331d7d){_0x5b05e9=_0x5b05e9-0x0;var _0x3fad30=_0xfaf2[_0x5b05e9];return _0x3fad30;};'use strict';var Sequelize=require(_0x2faf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2faf('0x1')]}}; \ No newline at end of file +var _0xa855=['STRING','exports'];(function(_0x520789,_0x10e384){var _0x116df0=function(_0x9b004b){while(--_0x9b004b){_0x520789['push'](_0x520789['shift']());}};_0x116df0(++_0x10e384);}(_0xa855,0x1bd));var _0x5a85=function(_0x5718a2,_0x599cd1){_0x5718a2=_0x5718a2-0x0;var _0x5ac7d3=_0xa855[_0x5718a2];return _0x5ac7d3;};'use strict';var Sequelize=require('sequelize');module[_0x5a85('0x0')]={'name':{'type':Sequelize[_0x5a85('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index cf588ea..3ab81ae 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 _0x9c82=['end','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','length','find','create','body','getFields','findOne','ServicenowField','options','hasOwnProperty','getSubjects','getDescriptions','nolimit','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy'];(function(_0x117352,_0x15bccb){var _0x212dcf=function(_0x5118bb){while(--_0x5118bb){_0x117352['push'](_0x117352['shift']());}};_0x212dcf(++_0x15bccb);}(_0x9c82,0xc5));var _0x29c8=function(_0x5cbbb7,_0x35571c){_0x5cbbb7=_0x5cbbb7-0x0;var _0x462386=_0x9c82[_0x5cbbb7];return _0x462386;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29c8('0x0'));var zipdir=require(_0x29c8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x29c8('0x2'));var BPromise=require(_0x29c8('0x3'));var Mustache=require(_0x29c8('0x4'));var util=require('util');var path=require('path');var sox=require(_0x29c8('0x5'));var csv=require(_0x29c8('0x6'));var ejs=require(_0x29c8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29c8('0x8'));var squel=require(_0x29c8('0x9'));var crypto=require('crypto');var jsforce=require(_0x29c8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x29c8('0x6'));var querystring=require(_0x29c8('0xb'));var Papa=require(_0x29c8('0xc'));var Redis=require('ioredis');var authService=require(_0x29c8('0xd'));var qs=require(_0x29c8('0xe'));var as=require(_0x29c8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29c8('0x10'))(_0x29c8('0x11'));var utils=require('../../config/utils');var config=require(_0x29c8('0x12'));var licenseUtil=require(_0x29c8('0x13'));var db=require(_0x29c8('0x14'))['db'];function respondWithStatusCode(_0x3239b0,_0x1ae9d7){_0x1ae9d7=_0x1ae9d7||0xcc;return function(_0x1853f2){if(_0x1853f2){return _0x3239b0['sendStatus'](_0x1ae9d7);}return _0x3239b0[_0x29c8('0x15')](_0x1ae9d7)['end']();};}function respondWithResult(_0x3423ea,_0x199e86){_0x199e86=_0x199e86||0xc8;return function(_0x36712c){if(_0x36712c){return _0x3423ea[_0x29c8('0x15')](_0x199e86)[_0x29c8('0x16')](_0x36712c);}};}function respondWithFilteredResult(_0x4cf700,_0x3a82cd){return function(_0x4d14f6){if(_0x4d14f6){var _0x3d9c3c=typeof _0x3a82cd['offset']===_0x29c8('0x17')&&typeof _0x3a82cd[_0x29c8('0x18')]==='undefined';var _0x4ad71e=_0x4d14f6[_0x29c8('0x19')];var _0x273d09=_0x3d9c3c?0x0:_0x3a82cd[_0x29c8('0x1a')];var _0x11795f=_0x3d9c3c?_0x4d14f6[_0x29c8('0x19')]:_0x3a82cd[_0x29c8('0x1a')]+_0x3a82cd['limit'];var _0x4d1d9a;if(_0x11795f>=_0x4ad71e){_0x11795f=_0x4ad71e;_0x4d1d9a=0xc8;}else{_0x4d1d9a=0xce;}_0x4cf700[_0x29c8('0x15')](_0x4d1d9a);return _0x4cf700[_0x29c8('0x1b')](_0x29c8('0x1c'),_0x273d09+'-'+_0x11795f+'/'+_0x4ad71e)[_0x29c8('0x16')](_0x4d14f6);}return null;};}function patchUpdates(_0xfaa9b1){return function(_0x4b65ac){try{jsonpatch['apply'](_0x4b65ac,_0xfaa9b1,!![]);}catch(_0x17f798){return BPromise[_0x29c8('0x1d')](_0x17f798);}return _0x4b65ac[_0x29c8('0x1e')]();};}function saveUpdates(_0x1cba77,_0x5c8d7a){return function(_0x14d404){if(_0x14d404){return _0x14d404[_0x29c8('0x1f')](_0x1cba77)[_0x29c8('0x20')](function(_0xaa907b){return _0xaa907b;});}return null;};}function removeEntity(_0x5f486e,_0x4bc90a){return function(_0x3358f1){if(_0x3358f1){return _0x3358f1[_0x29c8('0x21')]()[_0x29c8('0x20')](function(){_0x5f486e['status'](0xcc)[_0x29c8('0x22')]();});}};}function handleEntityNotFound(_0x1dbac2,_0x49e922){return function(_0x3431fd){if(!_0x3431fd){_0x1dbac2['sendStatus'](0x194);}return _0x3431fd;};}function handleError(_0x3852d1,_0x160a93){_0x160a93=_0x160a93||0x1f4;return function(_0x241db3){logger[_0x29c8('0x23')](_0x241db3[_0x29c8('0x24')]);if(_0x241db3['name']){delete _0x241db3[_0x29c8('0x25')];}_0x3852d1[_0x29c8('0x15')](_0x160a93)[_0x29c8('0x26')](_0x241db3);};}exports['index']=function(_0x58a419,_0x72c721){var _0x55a007={},_0x3f19ed={},_0x451408={'count':0x0,'rows':[]};var _0x16c87c=_[_0x29c8('0x27')](db[_0x29c8('0x28')][_0x29c8('0x29')],function(_0x49a334){return{'name':_0x49a334[_0x29c8('0x2a')],'type':_0x49a334[_0x29c8('0x2b')][_0x29c8('0x2c')]};});_0x3f19ed[_0x29c8('0x2d')]=_[_0x29c8('0x27')](_0x16c87c,'name');_0x3f19ed[_0x29c8('0x2e')]=_[_0x29c8('0x2f')](_0x58a419[_0x29c8('0x2e')]);_0x3f19ed['filters']=_[_0x29c8('0x30')](_0x3f19ed['model'],_0x3f19ed[_0x29c8('0x2e')]);_0x55a007[_0x29c8('0x31')]=_[_0x29c8('0x30')](_0x3f19ed['model'],qs[_0x29c8('0x32')](_0x58a419[_0x29c8('0x2e')][_0x29c8('0x32')]));_0x55a007[_0x29c8('0x31')]=_0x55a007[_0x29c8('0x31')]['length']?_0x55a007[_0x29c8('0x31')]:_0x3f19ed[_0x29c8('0x2d')];if(!_0x58a419['query']['hasOwnProperty']('nolimit')){_0x55a007[_0x29c8('0x18')]=qs[_0x29c8('0x18')](_0x58a419[_0x29c8('0x2e')]['limit']);_0x55a007['offset']=qs['offset'](_0x58a419[_0x29c8('0x2e')]['offset']);}_0x55a007[_0x29c8('0x33')]=qs[_0x29c8('0x34')](_0x58a419['query'][_0x29c8('0x34')]);_0x55a007[_0x29c8('0x35')]=qs[_0x29c8('0x36')](_[_0x29c8('0x37')](_0x58a419[_0x29c8('0x2e')],_0x3f19ed['filters']),_0x16c87c);if(_0x58a419[_0x29c8('0x2e')][_0x29c8('0x38')]){_0x55a007[_0x29c8('0x35')]=_['merge'](_0x55a007['where'],{'$or':_[_0x29c8('0x27')](_0x16c87c,function(_0x145b1f){if(_0x145b1f[_0x29c8('0x2b')]!==_0x29c8('0x39')){var _0x52b391={};_0x52b391[_0x145b1f[_0x29c8('0x25')]]={'$like':'%'+_0x58a419['query']['filter']+'%'};return _0x52b391;}})});}_0x55a007=_[_0x29c8('0x3a')]({},_0x55a007,_0x58a419['options']);var _0x1cab73={'where':_0x55a007[_0x29c8('0x35')]};return db['ServicenowConfiguration'][_0x29c8('0x19')](_0x1cab73)['then'](function(_0x2c0ecc){_0x451408[_0x29c8('0x19')]=_0x2c0ecc;if(_0x58a419[_0x29c8('0x2e')][_0x29c8('0x3b')]){_0x55a007[_0x29c8('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x29c8('0x3d')](_0x55a007);})['then'](function(_0x194f4c){_0x451408[_0x29c8('0x3e')]=_0x194f4c;return _0x451408;})[_0x29c8('0x20')](respondWithFilteredResult(_0x72c721,_0x55a007))[_0x29c8('0x3f')](handleError(_0x72c721,null));};exports['show']=function(_0x335a47,_0x5cd6f9){var _0xd2678b={'raw':![],'where':{'id':_0x335a47[_0x29c8('0x40')]['id']}},_0x41a151={};_0x41a151[_0x29c8('0x2d')]=_['keys'](db[_0x29c8('0x28')][_0x29c8('0x29')]);_0x41a151[_0x29c8('0x2e')]=_[_0x29c8('0x2f')](_0x335a47[_0x29c8('0x2e')]);_0x41a151[_0x29c8('0x36')]=_[_0x29c8('0x30')](_0x41a151[_0x29c8('0x2d')],_0x41a151['query']);_0xd2678b[_0x29c8('0x31')]=_['intersection'](_0x41a151[_0x29c8('0x2d')],qs[_0x29c8('0x32')](_0x335a47['query']['fields']));_0xd2678b[_0x29c8('0x31')]=_0xd2678b[_0x29c8('0x31')][_0x29c8('0x41')]?_0xd2678b['attributes']:_0x41a151[_0x29c8('0x2d')];if(_0x335a47['query'][_0x29c8('0x3b')]){_0xd2678b[_0x29c8('0x3c')]=[{'all':!![]}];}_0xd2678b=_[_0x29c8('0x3a')]({},_0xd2678b,_0x335a47['options']);return db[_0x29c8('0x28')][_0x29c8('0x42')](_0xd2678b)['then'](handleEntityNotFound(_0x5cd6f9,null))[_0x29c8('0x20')](respondWithResult(_0x5cd6f9,null))[_0x29c8('0x3f')](handleError(_0x5cd6f9,null));};exports[_0x29c8('0x43')]=function(_0x472aaf,_0x3b4965){return db[_0x29c8('0x28')]['create'](_0x472aaf[_0x29c8('0x44')],{})[_0x29c8('0x20')](respondWithResult(_0x3b4965,0xc9))['catch'](handleError(_0x3b4965,null));};exports['update']=function(_0x5b6460,_0x170db9){if(_0x5b6460[_0x29c8('0x44')]['id']){delete _0x5b6460[_0x29c8('0x44')]['id'];}return db[_0x29c8('0x28')][_0x29c8('0x42')]({'where':{'id':_0x5b6460[_0x29c8('0x40')]['id']}})[_0x29c8('0x20')](handleEntityNotFound(_0x170db9,null))['then'](saveUpdates(_0x5b6460[_0x29c8('0x44')],null))['then'](respondWithResult(_0x170db9,null))[_0x29c8('0x3f')](handleError(_0x170db9,null));};exports[_0x29c8('0x21')]=function(_0x250351,_0x3bfa37){return db['ServicenowConfiguration'][_0x29c8('0x42')]({'where':{'id':_0x250351[_0x29c8('0x40')]['id']}})[_0x29c8('0x20')](handleEntityNotFound(_0x3bfa37,null))[_0x29c8('0x20')](removeEntity(_0x3bfa37,null))[_0x29c8('0x3f')](handleError(_0x3bfa37,null));};exports[_0x29c8('0x45')]=function(_0xac3b1f,_0x31da0a,_0x50fe13){var _0x20b9c2={};var _0x495a5f={};var _0x1355ec;var _0x3689ac;return db['ServicenowConfiguration'][_0x29c8('0x46')]({'where':{'id':_0xac3b1f['params']['id']}})[_0x29c8('0x20')](handleEntityNotFound(_0x31da0a,null))['then'](function(_0x5de7c7){if(_0x5de7c7){_0x1355ec=_0x5de7c7;_0x495a5f['model']=_[_0x29c8('0x2f')](db[_0x29c8('0x47')][_0x29c8('0x29')]);_0x495a5f[_0x29c8('0x2e')]=_['keys'](_0xac3b1f['query']);_0x495a5f[_0x29c8('0x36')]=_[_0x29c8('0x30')](_0x495a5f[_0x29c8('0x2d')],_0x495a5f[_0x29c8('0x2e')]);_0x20b9c2['attributes']=_[_0x29c8('0x30')](_0x495a5f['model'],qs[_0x29c8('0x32')](_0xac3b1f[_0x29c8('0x2e')]['fields']));_0x20b9c2[_0x29c8('0x31')]=_0x20b9c2['attributes'][_0x29c8('0x41')]?_0x20b9c2[_0x29c8('0x31')]:_0x495a5f[_0x29c8('0x2d')];_0x20b9c2[_0x29c8('0x33')]=qs[_0x29c8('0x34')](_0xac3b1f[_0x29c8('0x2e')]['sort']);_0x20b9c2[_0x29c8('0x35')]=qs[_0x29c8('0x36')](_[_0x29c8('0x37')](_0xac3b1f[_0x29c8('0x2e')],_0x495a5f[_0x29c8('0x36')]));if(_0xac3b1f[_0x29c8('0x2e')][_0x29c8('0x38')]){_0x20b9c2[_0x29c8('0x35')]=_[_0x29c8('0x3a')](_0x20b9c2[_0x29c8('0x35')],{'$or':_[_0x29c8('0x27')](_0x20b9c2['attributes'],function(_0x2a3b07){var _0x5f02e9={};_0x5f02e9[_0x2a3b07]={'$like':'%'+_0xac3b1f[_0x29c8('0x2e')]['filter']+'%'};return _0x5f02e9;})});}_0x20b9c2=_['merge']({},_0x20b9c2,_0xac3b1f[_0x29c8('0x48')]);return _0x1355ec[_0x29c8('0x45')](_0x20b9c2);}})['then'](function(_0x342785){if(_0x342785){_0x3689ac=_0x342785[_0x29c8('0x41')];if(!_0xac3b1f['query'][_0x29c8('0x49')]('nolimit')){_0x20b9c2['limit']=qs[_0x29c8('0x18')](_0xac3b1f[_0x29c8('0x2e')][_0x29c8('0x18')]);_0x20b9c2[_0x29c8('0x1a')]=qs['offset'](_0xac3b1f[_0x29c8('0x2e')][_0x29c8('0x1a')]);}return _0x1355ec[_0x29c8('0x45')](_0x20b9c2);}})[_0x29c8('0x20')](function(_0x39a5b0){if(_0x39a5b0){return _0x39a5b0?{'count':_0x3689ac,'rows':_0x39a5b0}:null;}})[_0x29c8('0x20')](respondWithResult(_0x31da0a,null))['catch'](handleError(_0x31da0a,null));};exports['getSubjects']=function(_0x2911b3,_0x563906,_0x42a88b){var _0x33871e={};var _0xb7ddac={};var _0x3434c9;var _0x5385cd;return db['ServicenowConfiguration'][_0x29c8('0x46')]({'where':{'id':_0x2911b3[_0x29c8('0x40')]['id']}})['then'](handleEntityNotFound(_0x563906,null))['then'](function(_0x1e167f){if(_0x1e167f){_0x3434c9=_0x1e167f;_0xb7ddac[_0x29c8('0x2d')]=_[_0x29c8('0x2f')](db[_0x29c8('0x47')][_0x29c8('0x29')]);_0xb7ddac[_0x29c8('0x2e')]=_[_0x29c8('0x2f')](_0x2911b3[_0x29c8('0x2e')]);_0xb7ddac[_0x29c8('0x36')]=_[_0x29c8('0x30')](_0xb7ddac[_0x29c8('0x2d')],_0xb7ddac['query']);_0x33871e[_0x29c8('0x31')]=_[_0x29c8('0x30')](_0xb7ddac[_0x29c8('0x2d')],qs[_0x29c8('0x32')](_0x2911b3[_0x29c8('0x2e')][_0x29c8('0x32')]));_0x33871e[_0x29c8('0x31')]=_0x33871e[_0x29c8('0x31')][_0x29c8('0x41')]?_0x33871e[_0x29c8('0x31')]:_0xb7ddac['model'];_0x33871e['order']=qs[_0x29c8('0x34')](_0x2911b3[_0x29c8('0x2e')][_0x29c8('0x34')]);_0x33871e[_0x29c8('0x35')]=qs[_0x29c8('0x36')](_[_0x29c8('0x37')](_0x2911b3[_0x29c8('0x2e')],_0xb7ddac[_0x29c8('0x36')]));if(_0x2911b3[_0x29c8('0x2e')][_0x29c8('0x38')]){_0x33871e[_0x29c8('0x35')]=_[_0x29c8('0x3a')](_0x33871e[_0x29c8('0x35')],{'$or':_[_0x29c8('0x27')](_0x33871e[_0x29c8('0x31')],function(_0x2cbc3b){var _0x57257a={};_0x57257a[_0x2cbc3b]={'$like':'%'+_0x2911b3[_0x29c8('0x2e')]['filter']+'%'};return _0x57257a;})});}_0x33871e=_[_0x29c8('0x3a')]({},_0x33871e,_0x2911b3[_0x29c8('0x48')]);return _0x3434c9[_0x29c8('0x4a')](_0x33871e);}})[_0x29c8('0x20')](function(_0xe17fee){if(_0xe17fee){_0x5385cd=_0xe17fee[_0x29c8('0x41')];if(!_0x2911b3[_0x29c8('0x2e')][_0x29c8('0x49')]('nolimit')){_0x33871e['limit']=qs[_0x29c8('0x18')](_0x2911b3[_0x29c8('0x2e')]['limit']);_0x33871e[_0x29c8('0x1a')]=qs[_0x29c8('0x1a')](_0x2911b3[_0x29c8('0x2e')][_0x29c8('0x1a')]);}return _0x3434c9[_0x29c8('0x4a')](_0x33871e);}})[_0x29c8('0x20')](function(_0x334863){if(_0x334863){return _0x334863?{'count':_0x5385cd,'rows':_0x334863}:null;}})['then'](respondWithResult(_0x563906,null))[_0x29c8('0x3f')](handleError(_0x563906,null));};exports['getDescriptions']=function(_0x1b628f,_0x18ccdf,_0x1faddb){var _0x361bac={};var _0x170c1b={};var _0x3575b5;var _0xd1c5ec;return db[_0x29c8('0x28')]['findOne']({'where':{'id':_0x1b628f['params']['id']}})[_0x29c8('0x20')](handleEntityNotFound(_0x18ccdf,null))[_0x29c8('0x20')](function(_0x5f2dc1){if(_0x5f2dc1){_0x3575b5=_0x5f2dc1;_0x170c1b[_0x29c8('0x2d')]=_[_0x29c8('0x2f')](db[_0x29c8('0x47')][_0x29c8('0x29')]);_0x170c1b[_0x29c8('0x2e')]=_['keys'](_0x1b628f[_0x29c8('0x2e')]);_0x170c1b[_0x29c8('0x36')]=_[_0x29c8('0x30')](_0x170c1b[_0x29c8('0x2d')],_0x170c1b[_0x29c8('0x2e')]);_0x361bac[_0x29c8('0x31')]=_[_0x29c8('0x30')](_0x170c1b['model'],qs[_0x29c8('0x32')](_0x1b628f[_0x29c8('0x2e')]['fields']));_0x361bac['attributes']=_0x361bac[_0x29c8('0x31')][_0x29c8('0x41')]?_0x361bac['attributes']:_0x170c1b['model'];_0x361bac[_0x29c8('0x33')]=qs[_0x29c8('0x34')](_0x1b628f[_0x29c8('0x2e')][_0x29c8('0x34')]);_0x361bac[_0x29c8('0x35')]=qs['filters'](_[_0x29c8('0x37')](_0x1b628f[_0x29c8('0x2e')],_0x170c1b[_0x29c8('0x36')]));if(_0x1b628f[_0x29c8('0x2e')][_0x29c8('0x38')]){_0x361bac[_0x29c8('0x35')]=_[_0x29c8('0x3a')](_0x361bac[_0x29c8('0x35')],{'$or':_['map'](_0x361bac['attributes'],function(_0x4718db){var _0x25aff4={};_0x25aff4[_0x4718db]={'$like':'%'+_0x1b628f[_0x29c8('0x2e')][_0x29c8('0x38')]+'%'};return _0x25aff4;})});}_0x361bac=_['merge']({},_0x361bac,_0x1b628f['options']);return _0x3575b5[_0x29c8('0x4b')](_0x361bac);}})[_0x29c8('0x20')](function(_0x220e22){if(_0x220e22){_0xd1c5ec=_0x220e22['length'];if(!_0x1b628f[_0x29c8('0x2e')][_0x29c8('0x49')](_0x29c8('0x4c'))){_0x361bac[_0x29c8('0x18')]=qs[_0x29c8('0x18')](_0x1b628f['query'][_0x29c8('0x18')]);_0x361bac['offset']=qs[_0x29c8('0x1a')](_0x1b628f[_0x29c8('0x2e')][_0x29c8('0x1a')]);}return _0x3575b5['getDescriptions'](_0x361bac);}})['then'](function(_0x165bb0){if(_0x165bb0){return _0x165bb0?{'count':_0xd1c5ec,'rows':_0x165bb0}:null;}})[_0x29c8('0x20')](respondWithResult(_0x18ccdf,null))[_0x29c8('0x3f')](handleError(_0x18ccdf,null));}; \ No newline at end of file +var _0x3118=['includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','findOne','getFields','ServicenowField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xe98589,_0x1b3c02){var _0x496299=function(_0x887dcb){while(--_0x887dcb){_0xe98589['push'](_0xe98589['shift']());}};_0x496299(++_0x1b3c02);}(_0x3118,0xbc));var _0x8311=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3118[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0x8311('0x0'));var rimraf=require(_0x8311('0x1'));var zipdir=require(_0x8311('0x2'));var jsonpatch=require(_0x8311('0x3'));var rp=require(_0x8311('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8311('0x5'));var path=require(_0x8311('0x6'));var sox=require(_0x8311('0x7'));var csv=require('to-csv');var ejs=require(_0x8311('0x8'));var fs=require('fs');var fs_extra=require(_0x8311('0x9'));var _=require(_0x8311('0xa'));var squel=require(_0x8311('0xb'));var crypto=require('crypto');var jsforce=require(_0x8311('0xc'));var deskjs=require(_0x8311('0xd'));var toCsv=require(_0x8311('0xe'));var querystring=require('querystring');var Papa=require(_0x8311('0xf'));var Redis=require(_0x8311('0x10'));var authService=require(_0x8311('0x11'));var qs=require(_0x8311('0x12'));var as=require(_0x8311('0x13'));var hardwareService=require(_0x8311('0x14'));var logger=require(_0x8311('0x15'))(_0x8311('0x16'));var utils=require(_0x8311('0x17'));var config=require(_0x8311('0x18'));var licenseUtil=require(_0x8311('0x19'));var db=require(_0x8311('0x1a'))['db'];function respondWithStatusCode(_0x3cd38f,_0x188c38){_0x188c38=_0x188c38||0xcc;return function(_0x593e3c){if(_0x593e3c){return _0x3cd38f[_0x8311('0x1b')](_0x188c38);}return _0x3cd38f[_0x8311('0x1c')](_0x188c38)[_0x8311('0x1d')]();};}function respondWithResult(_0x549b22,_0x3c3b77){_0x3c3b77=_0x3c3b77||0xc8;return function(_0x254faf){if(_0x254faf){return _0x549b22[_0x8311('0x1c')](_0x3c3b77)[_0x8311('0x1e')](_0x254faf);}};}function respondWithFilteredResult(_0x2d414e,_0xe67042){return function(_0x25fdbc){if(_0x25fdbc){var _0x16fccb=typeof _0xe67042[_0x8311('0x1f')]==='undefined'&&typeof _0xe67042[_0x8311('0x20')]===_0x8311('0x21');var _0xf4db5a=_0x25fdbc[_0x8311('0x22')];var _0x18cdb4=_0x16fccb?0x0:_0xe67042['offset'];var _0xbf41c8=_0x16fccb?_0x25fdbc[_0x8311('0x22')]:_0xe67042['offset']+_0xe67042[_0x8311('0x20')];var _0x13835e;if(_0xbf41c8>=_0xf4db5a){_0xbf41c8=_0xf4db5a;_0x13835e=0xc8;}else{_0x13835e=0xce;}_0x2d414e[_0x8311('0x1c')](_0x13835e);return _0x2d414e[_0x8311('0x23')](_0x8311('0x24'),_0x18cdb4+'-'+_0xbf41c8+'/'+_0xf4db5a)[_0x8311('0x1e')](_0x25fdbc);}return null;};}function patchUpdates(_0x54239){return function(_0x30056e){try{jsonpatch[_0x8311('0x25')](_0x30056e,_0x54239,!![]);}catch(_0x5dc7e4){return BPromise['reject'](_0x5dc7e4);}return _0x30056e[_0x8311('0x26')]();};}function saveUpdates(_0x7aeea3,_0x11f235){return function(_0x5c8053){if(_0x5c8053){return _0x5c8053[_0x8311('0x27')](_0x7aeea3)[_0x8311('0x28')](function(_0xef0be1){return _0xef0be1;});}return null;};}function removeEntity(_0x5381c9,_0x5def72){return function(_0x2be096){if(_0x2be096){return _0x2be096[_0x8311('0x29')]()[_0x8311('0x28')](function(){_0x5381c9['status'](0xcc)[_0x8311('0x1d')]();});}};}function handleEntityNotFound(_0x1485cc,_0x1650f3){return function(_0x43dab3){if(!_0x43dab3){_0x1485cc[_0x8311('0x1b')](0x194);}return _0x43dab3;};}function handleError(_0x26bb15,_0x1a963f){_0x1a963f=_0x1a963f||0x1f4;return function(_0x441a29){logger[_0x8311('0x2a')](_0x441a29[_0x8311('0x2b')]);if(_0x441a29[_0x8311('0x2c')]){delete _0x441a29[_0x8311('0x2c')];}_0x26bb15[_0x8311('0x1c')](_0x1a963f)[_0x8311('0x2d')](_0x441a29);};}exports[_0x8311('0x2e')]=function(_0x1a97c0,_0x10b2e0){var _0x13e873={},_0x35f0a8={},_0xe91a38={'count':0x0,'rows':[]};var _0x513353=_[_0x8311('0x2f')](db[_0x8311('0x30')]['rawAttributes'],function(_0x25c0a0){return{'name':_0x25c0a0['fieldName'],'type':_0x25c0a0[_0x8311('0x31')][_0x8311('0x32')]};});_0x35f0a8[_0x8311('0x33')]=_[_0x8311('0x2f')](_0x513353,_0x8311('0x2c'));_0x35f0a8[_0x8311('0x34')]=_['keys'](_0x1a97c0[_0x8311('0x34')]);_0x35f0a8[_0x8311('0x35')]=_[_0x8311('0x36')](_0x35f0a8[_0x8311('0x33')],_0x35f0a8[_0x8311('0x34')]);_0x13e873[_0x8311('0x37')]=_[_0x8311('0x36')](_0x35f0a8[_0x8311('0x33')],qs['fields'](_0x1a97c0['query'][_0x8311('0x38')]));_0x13e873[_0x8311('0x37')]=_0x13e873[_0x8311('0x37')][_0x8311('0x39')]?_0x13e873[_0x8311('0x37')]:_0x35f0a8[_0x8311('0x33')];if(!_0x1a97c0[_0x8311('0x34')][_0x8311('0x3a')]('nolimit')){_0x13e873['limit']=qs['limit'](_0x1a97c0['query']['limit']);_0x13e873[_0x8311('0x1f')]=qs[_0x8311('0x1f')](_0x1a97c0[_0x8311('0x34')][_0x8311('0x1f')]);}_0x13e873[_0x8311('0x3b')]=qs[_0x8311('0x3c')](_0x1a97c0[_0x8311('0x34')][_0x8311('0x3c')]);_0x13e873[_0x8311('0x3d')]=qs[_0x8311('0x35')](_[_0x8311('0x3e')](_0x1a97c0[_0x8311('0x34')],_0x35f0a8[_0x8311('0x35')]),_0x513353);if(_0x1a97c0[_0x8311('0x34')]['filter']){_0x13e873['where']=_[_0x8311('0x3f')](_0x13e873[_0x8311('0x3d')],{'$or':_[_0x8311('0x2f')](_0x513353,function(_0x585d39){if(_0x585d39[_0x8311('0x31')]!==_0x8311('0x40')){var _0x5458e9={};_0x5458e9[_0x585d39[_0x8311('0x2c')]]={'$like':'%'+_0x1a97c0[_0x8311('0x34')][_0x8311('0x41')]+'%'};return _0x5458e9;}})});}_0x13e873=_[_0x8311('0x3f')]({},_0x13e873,_0x1a97c0[_0x8311('0x42')]);var _0x213431={'where':_0x13e873[_0x8311('0x3d')]};return db['ServicenowConfiguration'][_0x8311('0x22')](_0x213431)[_0x8311('0x28')](function(_0x4f1267){_0xe91a38[_0x8311('0x22')]=_0x4f1267;if(_0x1a97c0[_0x8311('0x34')][_0x8311('0x43')]){_0x13e873[_0x8311('0x44')]=[{'all':!![]}];}return db[_0x8311('0x30')][_0x8311('0x45')](_0x13e873);})['then'](function(_0x3db91b){_0xe91a38[_0x8311('0x46')]=_0x3db91b;return _0xe91a38;})[_0x8311('0x28')](respondWithFilteredResult(_0x10b2e0,_0x13e873))[_0x8311('0x47')](handleError(_0x10b2e0,null));};exports[_0x8311('0x48')]=function(_0x5633af,_0xc5eca6){var _0x30ead9={'raw':![],'where':{'id':_0x5633af[_0x8311('0x49')]['id']}},_0x4b41f1={};_0x4b41f1[_0x8311('0x33')]=_[_0x8311('0x4a')](db[_0x8311('0x30')][_0x8311('0x4b')]);_0x4b41f1['query']=_[_0x8311('0x4a')](_0x5633af[_0x8311('0x34')]);_0x4b41f1[_0x8311('0x35')]=_[_0x8311('0x36')](_0x4b41f1[_0x8311('0x33')],_0x4b41f1[_0x8311('0x34')]);_0x30ead9[_0x8311('0x37')]=_[_0x8311('0x36')](_0x4b41f1[_0x8311('0x33')],qs[_0x8311('0x38')](_0x5633af[_0x8311('0x34')][_0x8311('0x38')]));_0x30ead9['attributes']=_0x30ead9[_0x8311('0x37')]['length']?_0x30ead9[_0x8311('0x37')]:_0x4b41f1[_0x8311('0x33')];if(_0x5633af[_0x8311('0x34')]['includeAll']){_0x30ead9[_0x8311('0x44')]=[{'all':!![]}];}_0x30ead9=_[_0x8311('0x3f')]({},_0x30ead9,_0x5633af[_0x8311('0x42')]);return db['ServicenowConfiguration'][_0x8311('0x4c')](_0x30ead9)[_0x8311('0x28')](handleEntityNotFound(_0xc5eca6,null))[_0x8311('0x28')](respondWithResult(_0xc5eca6,null))[_0x8311('0x47')](handleError(_0xc5eca6,null));};exports[_0x8311('0x4d')]=function(_0x44d013,_0x4d61d6){return db[_0x8311('0x30')]['create'](_0x44d013[_0x8311('0x4e')],{})[_0x8311('0x28')](respondWithResult(_0x4d61d6,0xc9))[_0x8311('0x47')](handleError(_0x4d61d6,null));};exports[_0x8311('0x27')]=function(_0x409754,_0x1de60c){if(_0x409754['body']['id']){delete _0x409754[_0x8311('0x4e')]['id'];}return db[_0x8311('0x30')]['find']({'where':{'id':_0x409754[_0x8311('0x49')]['id']}})[_0x8311('0x28')](handleEntityNotFound(_0x1de60c,null))[_0x8311('0x28')](saveUpdates(_0x409754['body'],null))[_0x8311('0x28')](respondWithResult(_0x1de60c,null))[_0x8311('0x47')](handleError(_0x1de60c,null));};exports['destroy']=function(_0x440bdd,_0x17eec6){return db[_0x8311('0x30')][_0x8311('0x4c')]({'where':{'id':_0x440bdd[_0x8311('0x49')]['id']}})[_0x8311('0x28')](handleEntityNotFound(_0x17eec6,null))['then'](removeEntity(_0x17eec6,null))['catch'](handleError(_0x17eec6,null));};exports['getFields']=function(_0x4127c5,_0xa35e18,_0x498cdd){var _0x189cc1={};var _0xca5a5e={};var _0x540098;var _0x1804df;return db[_0x8311('0x30')][_0x8311('0x4f')]({'where':{'id':_0x4127c5[_0x8311('0x49')]['id']}})[_0x8311('0x28')](handleEntityNotFound(_0xa35e18,null))[_0x8311('0x28')](function(_0x13732f){if(_0x13732f){_0x540098=_0x13732f;_0xca5a5e['model']=_[_0x8311('0x4a')](db['ServicenowField'][_0x8311('0x4b')]);_0xca5a5e[_0x8311('0x34')]=_['keys'](_0x4127c5[_0x8311('0x34')]);_0xca5a5e[_0x8311('0x35')]=_[_0x8311('0x36')](_0xca5a5e[_0x8311('0x33')],_0xca5a5e['query']);_0x189cc1[_0x8311('0x37')]=_[_0x8311('0x36')](_0xca5a5e['model'],qs[_0x8311('0x38')](_0x4127c5[_0x8311('0x34')][_0x8311('0x38')]));_0x189cc1['attributes']=_0x189cc1['attributes'][_0x8311('0x39')]?_0x189cc1[_0x8311('0x37')]:_0xca5a5e[_0x8311('0x33')];_0x189cc1['order']=qs[_0x8311('0x3c')](_0x4127c5[_0x8311('0x34')]['sort']);_0x189cc1['where']=qs['filters'](_['pick'](_0x4127c5[_0x8311('0x34')],_0xca5a5e['filters']));if(_0x4127c5[_0x8311('0x34')][_0x8311('0x41')]){_0x189cc1[_0x8311('0x3d')]=_[_0x8311('0x3f')](_0x189cc1[_0x8311('0x3d')],{'$or':_[_0x8311('0x2f')](_0x189cc1[_0x8311('0x37')],function(_0x53c05d){var _0x4779ca={};_0x4779ca[_0x53c05d]={'$like':'%'+_0x4127c5[_0x8311('0x34')][_0x8311('0x41')]+'%'};return _0x4779ca;})});}_0x189cc1=_['merge']({},_0x189cc1,_0x4127c5[_0x8311('0x42')]);return _0x540098[_0x8311('0x50')](_0x189cc1);}})[_0x8311('0x28')](function(_0x44c127){if(_0x44c127){_0x1804df=_0x44c127[_0x8311('0x39')];if(!_0x4127c5[_0x8311('0x34')][_0x8311('0x3a')]('nolimit')){_0x189cc1[_0x8311('0x20')]=qs[_0x8311('0x20')](_0x4127c5[_0x8311('0x34')]['limit']);_0x189cc1[_0x8311('0x1f')]=qs['offset'](_0x4127c5[_0x8311('0x34')]['offset']);}return _0x540098[_0x8311('0x50')](_0x189cc1);}})[_0x8311('0x28')](function(_0x42464b){if(_0x42464b){return _0x42464b?{'count':_0x1804df,'rows':_0x42464b}:null;}})[_0x8311('0x28')](respondWithResult(_0xa35e18,null))[_0x8311('0x47')](handleError(_0xa35e18,null));};exports['getSubjects']=function(_0x2fe4fc,_0x580e21,_0x83f282){var _0x2532f0={};var _0x57ba24={};var _0x4f7b37;var _0xac14e5;return db[_0x8311('0x30')][_0x8311('0x4f')]({'where':{'id':_0x2fe4fc[_0x8311('0x49')]['id']}})[_0x8311('0x28')](handleEntityNotFound(_0x580e21,null))[_0x8311('0x28')](function(_0x235335){if(_0x235335){_0x4f7b37=_0x235335;_0x57ba24[_0x8311('0x33')]=_[_0x8311('0x4a')](db[_0x8311('0x51')]['rawAttributes']);_0x57ba24[_0x8311('0x34')]=_['keys'](_0x2fe4fc[_0x8311('0x34')]);_0x57ba24[_0x8311('0x35')]=_['intersection'](_0x57ba24['model'],_0x57ba24[_0x8311('0x34')]);_0x2532f0[_0x8311('0x37')]=_[_0x8311('0x36')](_0x57ba24[_0x8311('0x33')],qs['fields'](_0x2fe4fc[_0x8311('0x34')][_0x8311('0x38')]));_0x2532f0[_0x8311('0x37')]=_0x2532f0['attributes']['length']?_0x2532f0['attributes']:_0x57ba24[_0x8311('0x33')];_0x2532f0['order']=qs[_0x8311('0x3c')](_0x2fe4fc[_0x8311('0x34')]['sort']);_0x2532f0['where']=qs[_0x8311('0x35')](_[_0x8311('0x3e')](_0x2fe4fc['query'],_0x57ba24[_0x8311('0x35')]));if(_0x2fe4fc['query']['filter']){_0x2532f0[_0x8311('0x3d')]=_[_0x8311('0x3f')](_0x2532f0[_0x8311('0x3d')],{'$or':_['map'](_0x2532f0[_0x8311('0x37')],function(_0x5273d8){var _0x2750e8={};_0x2750e8[_0x5273d8]={'$like':'%'+_0x2fe4fc[_0x8311('0x34')][_0x8311('0x41')]+'%'};return _0x2750e8;})});}_0x2532f0=_['merge']({},_0x2532f0,_0x2fe4fc['options']);return _0x4f7b37[_0x8311('0x52')](_0x2532f0);}})[_0x8311('0x28')](function(_0x46fb91){if(_0x46fb91){_0xac14e5=_0x46fb91[_0x8311('0x39')];if(!_0x2fe4fc[_0x8311('0x34')][_0x8311('0x3a')](_0x8311('0x53'))){_0x2532f0[_0x8311('0x20')]=qs[_0x8311('0x20')](_0x2fe4fc[_0x8311('0x34')][_0x8311('0x20')]);_0x2532f0[_0x8311('0x1f')]=qs[_0x8311('0x1f')](_0x2fe4fc[_0x8311('0x34')][_0x8311('0x1f')]);}return _0x4f7b37[_0x8311('0x52')](_0x2532f0);}})[_0x8311('0x28')](function(_0x3125ed){if(_0x3125ed){return _0x3125ed?{'count':_0xac14e5,'rows':_0x3125ed}:null;}})[_0x8311('0x28')](respondWithResult(_0x580e21,null))[_0x8311('0x47')](handleError(_0x580e21,null));};exports['getDescriptions']=function(_0x3fad52,_0x5d28ca,_0x1022dd){var _0x89df66={};var _0x517292={};var _0x2cc008;var _0x1e5eb7;return db[_0x8311('0x30')][_0x8311('0x4f')]({'where':{'id':_0x3fad52['params']['id']}})['then'](handleEntityNotFound(_0x5d28ca,null))[_0x8311('0x28')](function(_0x53778b){if(_0x53778b){_0x2cc008=_0x53778b;_0x517292['model']=_[_0x8311('0x4a')](db[_0x8311('0x51')][_0x8311('0x4b')]);_0x517292[_0x8311('0x34')]=_[_0x8311('0x4a')](_0x3fad52['query']);_0x517292[_0x8311('0x35')]=_[_0x8311('0x36')](_0x517292[_0x8311('0x33')],_0x517292[_0x8311('0x34')]);_0x89df66[_0x8311('0x37')]=_[_0x8311('0x36')](_0x517292[_0x8311('0x33')],qs[_0x8311('0x38')](_0x3fad52[_0x8311('0x34')][_0x8311('0x38')]));_0x89df66[_0x8311('0x37')]=_0x89df66[_0x8311('0x37')][_0x8311('0x39')]?_0x89df66['attributes']:_0x517292['model'];_0x89df66[_0x8311('0x3b')]=qs[_0x8311('0x3c')](_0x3fad52['query'][_0x8311('0x3c')]);_0x89df66[_0x8311('0x3d')]=qs[_0x8311('0x35')](_['pick'](_0x3fad52[_0x8311('0x34')],_0x517292[_0x8311('0x35')]));if(_0x3fad52['query'][_0x8311('0x41')]){_0x89df66[_0x8311('0x3d')]=_[_0x8311('0x3f')](_0x89df66[_0x8311('0x3d')],{'$or':_[_0x8311('0x2f')](_0x89df66[_0x8311('0x37')],function(_0x767e2a){var _0x351f0e={};_0x351f0e[_0x767e2a]={'$like':'%'+_0x3fad52['query'][_0x8311('0x41')]+'%'};return _0x351f0e;})});}_0x89df66=_[_0x8311('0x3f')]({},_0x89df66,_0x3fad52['options']);return _0x2cc008[_0x8311('0x54')](_0x89df66);}})[_0x8311('0x28')](function(_0x322e4e){if(_0x322e4e){_0x1e5eb7=_0x322e4e[_0x8311('0x39')];if(!_0x3fad52[_0x8311('0x34')][_0x8311('0x3a')](_0x8311('0x53'))){_0x89df66['limit']=qs['limit'](_0x3fad52[_0x8311('0x34')][_0x8311('0x20')]);_0x89df66[_0x8311('0x1f')]=qs[_0x8311('0x1f')](_0x3fad52[_0x8311('0x34')][_0x8311('0x1f')]);}return _0x2cc008['getDescriptions'](_0x89df66);}})[_0x8311('0x28')](function(_0x37c0fb){if(_0x37c0fb){return _0x37c0fb?{'count':_0x1e5eb7,'rows':_0x37c0fb}:null;}})[_0x8311('0x28')](respondWithResult(_0x5d28ca,null))[_0x8311('0x47')](handleError(_0x5d28ca,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index bd2b844..f8a4691 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 _0xab23=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xab23,0x1bc));var _0x3ab2=function(_0x3f42ba,_0x52f139){_0x3f42ba=_0x3f42ba-0x0;var _0x2a9e22=_0xab23[_0x3f42ba];return _0x2a9e22;};'use strict';var _=require(_0x3ab2('0x0'));var util=require(_0x3ab2('0x1'));var logger=require(_0x3ab2('0x2'))(_0x3ab2('0x3'));var moment=require(_0x3ab2('0x4'));var BPromise=require(_0x3ab2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ab2('0x6'));var rimraf=require(_0x3ab2('0x7'));var config=require(_0x3ab2('0x8'));var attributes=require(_0x3ab2('0x9'));module['exports']=function(_0x5222ba,_0x3445f2){return _0x5222ba['define']('ServicenowConfiguration',attributes,{'tableName':_0x3ab2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x317b=['util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x317b,0x1c7));var _0xb317=function(_0x2695d5,_0x4a51d9){_0x2695d5=_0x2695d5-0x0;var _0x10515f=_0x317b[_0x2695d5];return _0x10515f;};'use strict';var _=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var logger=require('../../config/logger')(_0xb317('0x2'));var moment=require(_0xb317('0x3'));var BPromise=require('bluebird');var rp=require(_0xb317('0x4'));var fs=require('fs');var path=require(_0xb317('0x5'));var rimraf=require(_0xb317('0x6'));var config=require(_0xb317('0x7'));var attributes=require(_0xb317('0x8'));module[_0xb317('0x9')]=function(_0x2904b8,_0x33ed9c){return _0x2904b8[_0xb317('0xa')](_0xb317('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 27b92b6..0cb3107 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 _0x1cfd=['jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x8f826d,_0x3b4969){var _0x5df792=function(_0x3c1fe0){while(--_0x3c1fe0){_0x8f826d['push'](_0x8f826d['shift']());}};_0x5df792(++_0x3b4969);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x377efb,_0x39a31b){_0x377efb=_0x377efb-0x0;var _0x4b982b=_0x1cfd[_0x377efb];return _0x4b982b;};'use strict';var _=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var moment=require(_0xd1cf('0x2'));var BPromise=require(_0xd1cf('0x3'));var rs=require(_0xd1cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1cf('0x5'))['db'];var utils=require(_0xd1cf('0x6'));var logger=require(_0xd1cf('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1cf('0x8'));var client=jayson[_0xd1cf('0x9')][_0xd1cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a4879,_0x1bf822,_0x123b1d){return new BPromise(function(_0x36e860,_0x2f74dd){return client['request'](_0x4a4879,_0x123b1d)[_0xd1cf('0xb')](function(_0x69e911){logger[_0xd1cf('0xc')](_0xd1cf('0xd'),_0x1bf822,_0xd1cf('0xe'));logger[_0xd1cf('0xf')](_0xd1cf('0x10'),_0x1bf822,'request\x20sent',JSON[_0xd1cf('0x11')](_0x69e911));if(_0x69e911[_0xd1cf('0x12')]){if(_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x13')]===0x1f4){logger[_0xd1cf('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1bf822,_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x14')]);return _0x2f74dd(_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x14')]);}logger[_0xd1cf('0x12')](_0xd1cf('0xd'),_0x1bf822,_0x69e911['error'][_0xd1cf('0x14')]);return _0x36e860(_0x69e911[_0xd1cf('0x12')]['message']);}else{logger[_0xd1cf('0xc')](_0xd1cf('0xd'),_0x1bf822,_0xd1cf('0xe'));_0x36e860(_0x69e911[_0xd1cf('0x15')][_0xd1cf('0x14')]);}})[_0xd1cf('0x16')](function(_0x3180bd){logger[_0xd1cf('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1bf822,_0x3180bd);_0x2f74dd(_0x3180bd);});});} \ No newline at end of file +var _0xf09e=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x94c30,_0x3416c8){var _0x159bb3=function(_0x546e3e){while(--_0x546e3e){_0x94c30['push'](_0x94c30['shift']());}};_0x159bb3(++_0x3416c8);}(_0xf09e,0x148));var _0xef09=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf09e[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef09('0x0'));var BPromise=require('bluebird');var rs=require(_0xef09('0x1'));var fs=require('fs');var Redis=require(_0xef09('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xef09('0x3'));var logger=require(_0xef09('0x4'))(_0xef09('0x5'));var config=require(_0xef09('0x6'));var jayson=require(_0xef09('0x7'));var client=jayson[_0xef09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c4ca8,_0x469f5d,_0x297a32){return new BPromise(function(_0x1ced66,_0x46f9e5){return client['request'](_0x1c4ca8,_0x297a32)[_0xef09('0x9')](function(_0x126952){logger[_0xef09('0xa')](_0xef09('0xb'),_0x469f5d,'request\x20sent');logger[_0xef09('0xc')](_0xef09('0xd'),_0x469f5d,_0xef09('0xe'),JSON[_0xef09('0xf')](_0x126952));if(_0x126952[_0xef09('0x10')]){if(_0x126952[_0xef09('0x10')]['code']===0x1f4){logger['error'](_0xef09('0xb'),_0x469f5d,_0x126952[_0xef09('0x10')]['message']);return _0x46f9e5(_0x126952['error'][_0xef09('0x11')]);}logger[_0xef09('0x10')](_0xef09('0xb'),_0x469f5d,_0x126952['error']['message']);return _0x1ced66(_0x126952[_0xef09('0x10')]['message']);}else{logger[_0xef09('0xa')](_0xef09('0xb'),_0x469f5d,'request\x20sent');_0x1ced66(_0x126952[_0xef09('0x12')][_0xef09('0x11')]);}})[_0xef09('0x13')](function(_0x1e7f5e){logger['error'](_0xef09('0xb'),_0x469f5d,_0x1e7f5e);_0x46f9e5(_0x1e7f5e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index aed2326..74e7f9d 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 _0x9dc0=['isAuthenticated','index','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x9dc0,0x1ed));var _0x09dc=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x9dc0[_0x156a0d];return _0x98a9ba;};'use strict';var multer=require(_0x09dc('0x0'));var util=require(_0x09dc('0x1'));var path=require(_0x09dc('0x2'));var timeout=require(_0x09dc('0x3'));var express=require(_0x09dc('0x4'));var router=express['Router']();var fs_extra=require(_0x09dc('0x5'));var auth=require(_0x09dc('0x6'));var interaction=require(_0x09dc('0x7'));var config=require(_0x09dc('0x8'));var controller=require(_0x09dc('0x9'));router[_0x09dc('0xa')]('/',auth[_0x09dc('0xb')](),controller[_0x09dc('0xc')]);router[_0x09dc('0xa')]('/:id',auth[_0x09dc('0xb')](),controller['show']);router['post']('/',auth[_0x09dc('0xb')](),controller[_0x09dc('0xd')]);router['put'](_0x09dc('0xe'),auth[_0x09dc('0xb')](),controller[_0x09dc('0xf')]);router[_0x09dc('0x10')](_0x09dc('0xe'),auth[_0x09dc('0xb')](),controller['destroy']);module[_0x09dc('0x11')]=router; \ No newline at end of file +var _0x5043=['/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','post','create','put'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5043,0x17b));var _0x3504=function(_0x445bd0,_0x2ae713){_0x445bd0=_0x445bd0-0x0;var _0x2159dc=_0x5043[_0x445bd0];return _0x2159dc;};'use strict';var multer=require(_0x3504('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3504('0x1'));var router=express[_0x3504('0x2')]();var fs_extra=require(_0x3504('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3504('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x3504('0x5')](),controller[_0x3504('0x6')]);router[_0x3504('0x7')]('/:id',auth[_0x3504('0x5')](),controller[_0x3504('0x8')]);router[_0x3504('0x9')]('/',auth['isAuthenticated'](),controller[_0x3504('0xa')]);router[_0x3504('0xb')](_0x3504('0xc'),auth[_0x3504('0x5')](),controller[_0x3504('0xd')]);router[_0x3504('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3504('0xf')]);module[_0x3504('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e36a054..9026cf3 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 _0xb54e=['keyValue','picklist','STRING','ENUM','string','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x361ecd,_0x32451e){var _0x31942f=function(_0x4fe2b5){while(--_0x4fe2b5){_0x361ecd['push'](_0x361ecd['shift']());}};_0x31942f(++_0x32451e);}(_0xb54e,0xa7));var _0xeb54=function(_0x4e9b03,_0x523457){_0x4e9b03=_0x4e9b03-0x0;var _0x2ca16a=_0xb54e[_0x4e9b03];return _0x2ca16a;};'use strict';var Sequelize=require(_0xeb54('0x0'));module[_0xeb54('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xeb54('0x2'),_0xeb54('0x3'),_0xeb54('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xeb54('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xeb54('0x6')](_0xeb54('0x7'),_0xeb54('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xeb54('0x5')]},'idField':{'type':Sequelize[_0xeb54('0x5')]},'nameField':{'type':Sequelize[_0xeb54('0x5')]},'customField':{'type':Sequelize[_0xeb54('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb54('0x5')]}}; \ No newline at end of file +var _0x6710=['string','customVariable','picklist','STRING','variable','BOOLEAN','ENUM'];(function(_0x1466a1,_0x5a89d2){var _0x22b1e9=function(_0x49059e){while(--_0x49059e){_0x1466a1['push'](_0x1466a1['shift']());}};_0x22b1e9(++_0x5a89d2);}(_0x6710,0x102));var _0x0671=function(_0x574b45,_0xd2171){_0x574b45=_0x574b45-0x0;var _0x58e9be=_0x6710[_0x574b45];return _0x58e9be;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0671('0x0')](_0x0671('0x1'),'variable',_0x0671('0x2'),'keyValue',_0x0671('0x3')),'defaultValue':_0x0671('0x1')},'content':{'type':Sequelize[_0x0671('0x4')]},'key':{'type':Sequelize[_0x0671('0x4')]},'keyType':{'type':Sequelize[_0x0671('0x0')]('string',_0x0671('0x5'),_0x0671('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0671('0x4')]},'nameField':{'type':Sequelize[_0x0671('0x4')]},'customField':{'type':Sequelize[_0x0671('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 33a96e2..946a07f 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 _0xded8=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','options','ServicenowField','include','rows','catch','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','request-promise','moment','util','path','sox'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0xded8,0x14d));var _0x8ded=function(_0x2d5ebc,_0x5e6f46){_0x2d5ebc=_0x2d5ebc-0x0;var _0x289733=_0xded8[_0x2d5ebc];return _0x289733;};'use strict';var emlformat=require(_0x8ded('0x0'));var rimraf=require(_0x8ded('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ded('0x2'));var moment=require(_0x8ded('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8ded('0x4'));var path=require(_0x8ded('0x5'));var sox=require(_0x8ded('0x6'));var csv=require(_0x8ded('0x7'));var ejs=require(_0x8ded('0x8'));var fs=require('fs');var fs_extra=require(_0x8ded('0x9'));var _=require('lodash');var squel=require(_0x8ded('0xa'));var crypto=require(_0x8ded('0xb'));var jsforce=require(_0x8ded('0xc'));var deskjs=require(_0x8ded('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ded('0xe'));var Redis=require(_0x8ded('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8ded('0x10'));var as=require(_0x8ded('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8ded('0x12'));var utils=require(_0x8ded('0x13'));var config=require(_0x8ded('0x14'));var licenseUtil=require(_0x8ded('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x348f18,_0x293c81){_0x293c81=_0x293c81||0xcc;return function(_0x39dabe){if(_0x39dabe){return _0x348f18[_0x8ded('0x16')](_0x293c81);}return _0x348f18[_0x8ded('0x17')](_0x293c81)[_0x8ded('0x18')]();};}function respondWithResult(_0x16f818,_0x103d25){_0x103d25=_0x103d25||0xc8;return function(_0x1283d9){if(_0x1283d9){return _0x16f818[_0x8ded('0x17')](_0x103d25)['json'](_0x1283d9);}};}function respondWithFilteredResult(_0x1bdf83,_0x551227){return function(_0x1eafa5){if(_0x1eafa5){var _0xa12663=typeof _0x551227[_0x8ded('0x19')]===_0x8ded('0x1a')&&typeof _0x551227[_0x8ded('0x1b')]===_0x8ded('0x1a');var _0x44b2cb=_0x1eafa5['count'];var _0x519ec4=_0xa12663?0x0:_0x551227[_0x8ded('0x19')];var _0x720f80=_0xa12663?_0x1eafa5[_0x8ded('0x1c')]:_0x551227[_0x8ded('0x19')]+_0x551227[_0x8ded('0x1b')];var _0x3133b5;if(_0x720f80>=_0x44b2cb){_0x720f80=_0x44b2cb;_0x3133b5=0xc8;}else{_0x3133b5=0xce;}_0x1bdf83[_0x8ded('0x17')](_0x3133b5);return _0x1bdf83['set'](_0x8ded('0x1d'),_0x519ec4+'-'+_0x720f80+'/'+_0x44b2cb)[_0x8ded('0x1e')](_0x1eafa5);}return null;};}function patchUpdates(_0x4b0bc2){return function(_0x4b6081){try{jsonpatch[_0x8ded('0x1f')](_0x4b6081,_0x4b0bc2,!![]);}catch(_0x3b6d57){return BPromise[_0x8ded('0x20')](_0x3b6d57);}return _0x4b6081['save']();};}function saveUpdates(_0x18eb0a,_0x3f6067){return function(_0x3f10d4){if(_0x3f10d4){return _0x3f10d4[_0x8ded('0x21')](_0x18eb0a)[_0x8ded('0x22')](function(_0x17c69e){return _0x17c69e;});}return null;};}function removeEntity(_0x52896f,_0x372763){return function(_0x1419f4){if(_0x1419f4){return _0x1419f4[_0x8ded('0x23')]()[_0x8ded('0x22')](function(){_0x52896f[_0x8ded('0x17')](0xcc)[_0x8ded('0x18')]();});}};}function handleEntityNotFound(_0x8b2397,_0x5a9b05){return function(_0x43f9ef){if(!_0x43f9ef){_0x8b2397['sendStatus'](0x194);}return _0x43f9ef;};}function handleError(_0x381488,_0x2d52c0){_0x2d52c0=_0x2d52c0||0x1f4;return function(_0x3e39b8){logger[_0x8ded('0x24')](_0x3e39b8[_0x8ded('0x25')]);if(_0x3e39b8['name']){delete _0x3e39b8[_0x8ded('0x26')];}_0x381488['status'](_0x2d52c0)[_0x8ded('0x27')](_0x3e39b8);};}exports['index']=function(_0x1d115a,_0x4b8cb1){var _0x33b6e4={},_0xe90ba0={},_0x1e6de8={'count':0x0,'rows':[]};var _0x3f4448=_[_0x8ded('0x28')](db['ServicenowField']['rawAttributes'],function(_0x4860cc){return{'name':_0x4860cc['fieldName'],'type':_0x4860cc['type'][_0x8ded('0x29')]};});_0xe90ba0['model']=_[_0x8ded('0x28')](_0x3f4448,_0x8ded('0x26'));_0xe90ba0[_0x8ded('0x2a')]=_[_0x8ded('0x2b')](_0x1d115a[_0x8ded('0x2a')]);_0xe90ba0[_0x8ded('0x2c')]=_[_0x8ded('0x2d')](_0xe90ba0['model'],_0xe90ba0['query']);_0x33b6e4[_0x8ded('0x2e')]=_['intersection'](_0xe90ba0[_0x8ded('0x2f')],qs[_0x8ded('0x30')](_0x1d115a[_0x8ded('0x2a')]['fields']));_0x33b6e4['attributes']=_0x33b6e4[_0x8ded('0x2e')][_0x8ded('0x31')]?_0x33b6e4[_0x8ded('0x2e')]:_0xe90ba0[_0x8ded('0x2f')];if(!_0x1d115a[_0x8ded('0x2a')][_0x8ded('0x32')]('nolimit')){_0x33b6e4[_0x8ded('0x1b')]=qs[_0x8ded('0x1b')](_0x1d115a['query'][_0x8ded('0x1b')]);_0x33b6e4[_0x8ded('0x19')]=qs[_0x8ded('0x19')](_0x1d115a[_0x8ded('0x2a')]['offset']);}_0x33b6e4[_0x8ded('0x33')]=qs[_0x8ded('0x34')](_0x1d115a[_0x8ded('0x2a')][_0x8ded('0x34')]);_0x33b6e4['where']=qs['filters'](_['pick'](_0x1d115a[_0x8ded('0x2a')],_0xe90ba0['filters']),_0x3f4448);if(_0x1d115a['query'][_0x8ded('0x35')]){_0x33b6e4[_0x8ded('0x36')]=_[_0x8ded('0x37')](_0x33b6e4[_0x8ded('0x36')],{'$or':_[_0x8ded('0x28')](_0x3f4448,function(_0x2a5672){if(_0x2a5672[_0x8ded('0x38')]!=='VIRTUAL'){var _0x566014={};_0x566014[_0x2a5672[_0x8ded('0x26')]]={'$like':'%'+_0x1d115a[_0x8ded('0x2a')][_0x8ded('0x35')]+'%'};return _0x566014;}})});}_0x33b6e4=_[_0x8ded('0x37')]({},_0x33b6e4,_0x1d115a[_0x8ded('0x39')]);var _0x44b5e2={'where':_0x33b6e4[_0x8ded('0x36')]};return db[_0x8ded('0x3a')][_0x8ded('0x1c')](_0x44b5e2)['then'](function(_0xaeea96){_0x1e6de8['count']=_0xaeea96;if(_0x1d115a['query']['includeAll']){_0x33b6e4[_0x8ded('0x3b')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x33b6e4);})['then'](function(_0x40a951){_0x1e6de8[_0x8ded('0x3c')]=_0x40a951;return _0x1e6de8;})[_0x8ded('0x22')](respondWithFilteredResult(_0x4b8cb1,_0x33b6e4))[_0x8ded('0x3d')](handleError(_0x4b8cb1,null));};exports['show']=function(_0x49a1b4,_0x20b458){var _0x3c271f={'raw':!![],'where':{'id':_0x49a1b4[_0x8ded('0x3e')]['id']}},_0x8ffc37={};_0x8ffc37[_0x8ded('0x2f')]=_[_0x8ded('0x2b')](db[_0x8ded('0x3a')][_0x8ded('0x3f')]);_0x8ffc37[_0x8ded('0x2a')]=_[_0x8ded('0x2b')](_0x49a1b4[_0x8ded('0x2a')]);_0x8ffc37[_0x8ded('0x2c')]=_[_0x8ded('0x2d')](_0x8ffc37[_0x8ded('0x2f')],_0x8ffc37[_0x8ded('0x2a')]);_0x3c271f[_0x8ded('0x2e')]=_[_0x8ded('0x2d')](_0x8ffc37[_0x8ded('0x2f')],qs['fields'](_0x49a1b4[_0x8ded('0x2a')]['fields']));_0x3c271f['attributes']=_0x3c271f[_0x8ded('0x2e')]['length']?_0x3c271f[_0x8ded('0x2e')]:_0x8ffc37[_0x8ded('0x2f')];if(_0x49a1b4['query'][_0x8ded('0x40')]){_0x3c271f['include']=[{'all':!![]}];}_0x3c271f=_[_0x8ded('0x37')]({},_0x3c271f,_0x49a1b4[_0x8ded('0x39')]);return db[_0x8ded('0x3a')][_0x8ded('0x41')](_0x3c271f)['then'](handleEntityNotFound(_0x20b458,null))[_0x8ded('0x22')](respondWithResult(_0x20b458,null))['catch'](handleError(_0x20b458,null));};exports[_0x8ded('0x42')]=function(_0x19c518,_0x151ba2){return db['ServicenowField']['create'](_0x19c518[_0x8ded('0x43')],{})[_0x8ded('0x22')](respondWithResult(_0x151ba2,0xc9))['catch'](handleError(_0x151ba2,null));};exports[_0x8ded('0x21')]=function(_0xf9cd71,_0x8ce61c){if(_0xf9cd71[_0x8ded('0x43')]['id']){delete _0xf9cd71[_0x8ded('0x43')]['id'];}return db[_0x8ded('0x3a')][_0x8ded('0x41')]({'where':{'id':_0xf9cd71[_0x8ded('0x3e')]['id']}})[_0x8ded('0x22')](handleEntityNotFound(_0x8ce61c,null))['then'](saveUpdates(_0xf9cd71[_0x8ded('0x43')],null))[_0x8ded('0x22')](respondWithResult(_0x8ce61c,null))[_0x8ded('0x3d')](handleError(_0x8ce61c,null));};exports[_0x8ded('0x23')]=function(_0xbf6c0,_0x42054a){return db[_0x8ded('0x3a')][_0x8ded('0x41')]({'where':{'id':_0xbf6c0[_0x8ded('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42054a,null))[_0x8ded('0x22')](removeEntity(_0x42054a,null))['catch'](handleError(_0x42054a,null));}; \ No newline at end of file +var _0x34d2=['merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','find','create','body','eml-format','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','update','then','destroy','error','stack','name','send','ServicenowField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','where','pick','filter'];(function(_0xf209d5,_0x1db7ac){var _0x24c84a=function(_0xba2cf){while(--_0xba2cf){_0xf209d5['push'](_0xf209d5['shift']());}};_0x24c84a(++_0x1db7ac);}(_0x34d2,0x1d4));var _0x234d=function(_0x1eaa06,_0x4b8355){_0x1eaa06=_0x1eaa06-0x0;var _0x231b56=_0x34d2[_0x1eaa06];return _0x231b56;};'use strict';var emlformat=require(_0x234d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x234d('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x234d('0x2'));var util=require('util');var path=require(_0x234d('0x3'));var sox=require(_0x234d('0x4'));var csv=require(_0x234d('0x5'));var ejs=require(_0x234d('0x6'));var fs=require('fs');var fs_extra=require(_0x234d('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x234d('0x8'));var jsforce=require(_0x234d('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x234d('0xa'));var authService=require(_0x234d('0xb'));var qs=require(_0x234d('0xc'));var as=require(_0x234d('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x234d('0xe'))(_0x234d('0xf'));var utils=require(_0x234d('0x10'));var config=require(_0x234d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x234d('0x12'))['db'];function respondWithStatusCode(_0x25ad38,_0x81c86c){_0x81c86c=_0x81c86c||0xcc;return function(_0x2ac601){if(_0x2ac601){return _0x25ad38[_0x234d('0x13')](_0x81c86c);}return _0x25ad38[_0x234d('0x14')](_0x81c86c)[_0x234d('0x15')]();};}function respondWithResult(_0x34d4fb,_0x5123d8){_0x5123d8=_0x5123d8||0xc8;return function(_0x5c7c4d){if(_0x5c7c4d){return _0x34d4fb[_0x234d('0x14')](_0x5123d8)[_0x234d('0x16')](_0x5c7c4d);}};}function respondWithFilteredResult(_0x3e1f01,_0x236d41){return function(_0x3d13a){if(_0x3d13a){var _0x2514ab=typeof _0x236d41[_0x234d('0x17')]==='undefined'&&typeof _0x236d41['limit']===_0x234d('0x18');var _0x18394b=_0x3d13a['count'];var _0x406b2b=_0x2514ab?0x0:_0x236d41[_0x234d('0x17')];var _0x2d23b3=_0x2514ab?_0x3d13a[_0x234d('0x19')]:_0x236d41[_0x234d('0x17')]+_0x236d41['limit'];var _0x18f80c;if(_0x2d23b3>=_0x18394b){_0x2d23b3=_0x18394b;_0x18f80c=0xc8;}else{_0x18f80c=0xce;}_0x3e1f01[_0x234d('0x14')](_0x18f80c);return _0x3e1f01[_0x234d('0x1a')]('Content-Range',_0x406b2b+'-'+_0x2d23b3+'/'+_0x18394b)[_0x234d('0x16')](_0x3d13a);}return null;};}function patchUpdates(_0x382aff){return function(_0x24bce){try{jsonpatch['apply'](_0x24bce,_0x382aff,!![]);}catch(_0x2a30cf){return BPromise['reject'](_0x2a30cf);}return _0x24bce['save']();};}function saveUpdates(_0x29dc2c,_0x13653b){return function(_0x439aa7){if(_0x439aa7){return _0x439aa7[_0x234d('0x1b')](_0x29dc2c)[_0x234d('0x1c')](function(_0x6bf3dd){return _0x6bf3dd;});}return null;};}function removeEntity(_0x1435b9,_0x3d0841){return function(_0x219f0a){if(_0x219f0a){return _0x219f0a[_0x234d('0x1d')]()[_0x234d('0x1c')](function(){_0x1435b9[_0x234d('0x14')](0xcc)[_0x234d('0x15')]();});}};}function handleEntityNotFound(_0x2603fe,_0x33480c){return function(_0x576009){if(!_0x576009){_0x2603fe[_0x234d('0x13')](0x194);}return _0x576009;};}function handleError(_0x21e6a7,_0x344c78){_0x344c78=_0x344c78||0x1f4;return function(_0x3bdb1c){logger[_0x234d('0x1e')](_0x3bdb1c[_0x234d('0x1f')]);if(_0x3bdb1c[_0x234d('0x20')]){delete _0x3bdb1c['name'];}_0x21e6a7[_0x234d('0x14')](_0x344c78)[_0x234d('0x21')](_0x3bdb1c);};}exports['index']=function(_0x4009c1,_0xb9d9cc){var _0x476e29={},_0x5c27b8={},_0x26ec03={'count':0x0,'rows':[]};var _0x381078=_['map'](db[_0x234d('0x22')][_0x234d('0x23')],function(_0x432cce){return{'name':_0x432cce['fieldName'],'type':_0x432cce[_0x234d('0x24')][_0x234d('0x25')]};});_0x5c27b8[_0x234d('0x26')]=_[_0x234d('0x27')](_0x381078,_0x234d('0x20'));_0x5c27b8[_0x234d('0x28')]=_[_0x234d('0x29')](_0x4009c1['query']);_0x5c27b8[_0x234d('0x2a')]=_[_0x234d('0x2b')](_0x5c27b8[_0x234d('0x26')],_0x5c27b8['query']);_0x476e29[_0x234d('0x2c')]=_[_0x234d('0x2b')](_0x5c27b8[_0x234d('0x26')],qs[_0x234d('0x2d')](_0x4009c1[_0x234d('0x28')][_0x234d('0x2d')]));_0x476e29[_0x234d('0x2c')]=_0x476e29[_0x234d('0x2c')]['length']?_0x476e29[_0x234d('0x2c')]:_0x5c27b8['model'];if(!_0x4009c1[_0x234d('0x28')]['hasOwnProperty'](_0x234d('0x2e'))){_0x476e29[_0x234d('0x2f')]=qs[_0x234d('0x2f')](_0x4009c1[_0x234d('0x28')]['limit']);_0x476e29[_0x234d('0x17')]=qs[_0x234d('0x17')](_0x4009c1['query'][_0x234d('0x17')]);}_0x476e29[_0x234d('0x30')]=qs['sort'](_0x4009c1[_0x234d('0x28')]['sort']);_0x476e29[_0x234d('0x31')]=qs[_0x234d('0x2a')](_[_0x234d('0x32')](_0x4009c1['query'],_0x5c27b8[_0x234d('0x2a')]),_0x381078);if(_0x4009c1[_0x234d('0x28')][_0x234d('0x33')]){_0x476e29[_0x234d('0x31')]=_[_0x234d('0x34')](_0x476e29[_0x234d('0x31')],{'$or':_['map'](_0x381078,function(_0x2000b3){if(_0x2000b3[_0x234d('0x24')]!==_0x234d('0x35')){var _0x6d8259={};_0x6d8259[_0x2000b3['name']]={'$like':'%'+_0x4009c1['query'][_0x234d('0x33')]+'%'};return _0x6d8259;}})});}_0x476e29=_[_0x234d('0x34')]({},_0x476e29,_0x4009c1['options']);var _0x5082de={'where':_0x476e29[_0x234d('0x31')]};return db[_0x234d('0x22')][_0x234d('0x19')](_0x5082de)['then'](function(_0x1f1a47){_0x26ec03[_0x234d('0x19')]=_0x1f1a47;if(_0x4009c1[_0x234d('0x28')][_0x234d('0x36')]){_0x476e29[_0x234d('0x37')]=[{'all':!![]}];}return db[_0x234d('0x22')][_0x234d('0x38')](_0x476e29);})[_0x234d('0x1c')](function(_0x220355){_0x26ec03['rows']=_0x220355;return _0x26ec03;})[_0x234d('0x1c')](respondWithFilteredResult(_0xb9d9cc,_0x476e29))[_0x234d('0x39')](handleError(_0xb9d9cc,null));};exports[_0x234d('0x3a')]=function(_0x57ed08,_0x14377b){var _0x4b423c={'raw':!![],'where':{'id':_0x57ed08[_0x234d('0x3b')]['id']}},_0x213484={};_0x213484[_0x234d('0x26')]=_[_0x234d('0x29')](db[_0x234d('0x22')]['rawAttributes']);_0x213484[_0x234d('0x28')]=_[_0x234d('0x29')](_0x57ed08[_0x234d('0x28')]);_0x213484[_0x234d('0x2a')]=_[_0x234d('0x2b')](_0x213484[_0x234d('0x26')],_0x213484['query']);_0x4b423c[_0x234d('0x2c')]=_[_0x234d('0x2b')](_0x213484[_0x234d('0x26')],qs[_0x234d('0x2d')](_0x57ed08[_0x234d('0x28')][_0x234d('0x2d')]));_0x4b423c[_0x234d('0x2c')]=_0x4b423c[_0x234d('0x2c')][_0x234d('0x3c')]?_0x4b423c['attributes']:_0x213484[_0x234d('0x26')];if(_0x57ed08['query']['includeAll']){_0x4b423c['include']=[{'all':!![]}];}_0x4b423c=_['merge']({},_0x4b423c,_0x57ed08[_0x234d('0x3d')]);return db[_0x234d('0x22')][_0x234d('0x3e')](_0x4b423c)[_0x234d('0x1c')](handleEntityNotFound(_0x14377b,null))[_0x234d('0x1c')](respondWithResult(_0x14377b,null))[_0x234d('0x39')](handleError(_0x14377b,null));};exports[_0x234d('0x3f')]=function(_0x37ad0b,_0x4547a2){return db['ServicenowField']['create'](_0x37ad0b[_0x234d('0x40')],{})[_0x234d('0x1c')](respondWithResult(_0x4547a2,0xc9))[_0x234d('0x39')](handleError(_0x4547a2,null));};exports[_0x234d('0x1b')]=function(_0x92093d,_0x3034f8){if(_0x92093d[_0x234d('0x40')]['id']){delete _0x92093d[_0x234d('0x40')]['id'];}return db[_0x234d('0x22')][_0x234d('0x3e')]({'where':{'id':_0x92093d[_0x234d('0x3b')]['id']}})[_0x234d('0x1c')](handleEntityNotFound(_0x3034f8,null))[_0x234d('0x1c')](saveUpdates(_0x92093d[_0x234d('0x40')],null))[_0x234d('0x1c')](respondWithResult(_0x3034f8,null))['catch'](handleError(_0x3034f8,null));};exports[_0x234d('0x1d')]=function(_0x2ac211,_0x1516b3){return db[_0x234d('0x22')][_0x234d('0x3e')]({'where':{'id':_0x2ac211[_0x234d('0x3b')]['id']}})[_0x234d('0x1c')](handleEntityNotFound(_0x1516b3,null))[_0x234d('0x1c')](removeEntity(_0x1516b3,null))[_0x234d('0x39')](handleError(_0x1516b3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3afe2ad..8b28bdc 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 _0xa1fa=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intServicenowField.attributes','define','ServicenowField','idField','FieldId'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0xa1fa,0x9c));var _0xaa1f=function(_0x34f693,_0x3dffca){_0x34f693=_0x34f693-0x0;var _0x3e9197=_0xa1fa[_0x34f693];return _0x3e9197;};'use strict';var _=require(_0xaa1f('0x0'));var util=require('util');var logger=require(_0xaa1f('0x1'))(_0xaa1f('0x2'));var moment=require(_0xaa1f('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa1f('0x4'));var fs=require('fs');var path=require(_0xaa1f('0x5'));var rimraf=require('rimraf');var config=require(_0xaa1f('0x6'));var attributes=require(_0xaa1f('0x7'));module['exports']=function(_0x4beb9a,_0x4f7d17){return _0x4beb9a[_0xaa1f('0x8')](_0xaa1f('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xaa1f('0xa'),_0xaa1f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6cc7=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x26e212,_0x4a91ff){var _0x5e3353=function(_0x13bd8d){while(--_0x13bd8d){_0x26e212['push'](_0x26e212['shift']());}};_0x5e3353(++_0x4a91ff);}(_0x6cc7,0xc5));var _0x76cc=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x6cc7[_0x30a31e];return _0x170879;};'use strict';var _=require(_0x76cc('0x0'));var util=require(_0x76cc('0x1'));var logger=require(_0x76cc('0x2'))(_0x76cc('0x3'));var moment=require(_0x76cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x76cc('0x5'));var fs=require('fs');var path=require(_0x76cc('0x6'));var rimraf=require('rimraf');var config=require(_0x76cc('0x7'));var attributes=require(_0x76cc('0x8'));module[_0x76cc('0x9')]=function(_0x180c65,_0x24e86d){return _0x180c65['define']('ServicenowField',attributes,{'tableName':_0x76cc('0xa'),'paranoid':![],'indexes':[{'name':_0x76cc('0xb'),'fields':[_0x76cc('0xc'),_0x76cc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index b58d087..011b02b 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1b89be,_0x55ceec){var _0x55f150=function(_0xbf29fb){while(--_0xbf29fb){_0x1b89be['push'](_0x1b89be['shift']());}};_0x55f150(++_0x55ceec);}(_0xf4eb,0xec));var _0xbf4e=function(_0xbec756,_0x345863){_0xbec756=_0xbec756-0x0;var _0x9bd770=_0xf4eb[_0xbec756];return _0x9bd770;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xda3f,0xec));var _0xfda3=function(_0x8f1320,_0x4a73e7){_0x8f1320=_0x8f1320-0x0;var _0x1ad3fa=_0xda3f[_0x8f1320];return _0x1ad3fa;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 22054c6..4bf487c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x41eb90,_0x10a7e4){var _0x5199ed=function(_0x1b6325){while(--_0x1b6325){_0x41eb90['push'](_0x41eb90['shift']());}};_0x5199ed(++_0x10a7e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xcbff5a,_0x6d6c75){var _0x57babd=function(_0x515403){while(--_0x515403){_0xcbff5a['push'](_0xcbff5a['shift']());}};_0x57babd(++_0x6d6c75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 8d07a58..9c08ced 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(_0x41fcef,_0x508f13){var _0x3e1346=function(_0x16a62e){while(--_0x16a62e){_0x41fcef['push'](_0x41fcef['shift']());}};_0x3e1346(++_0x508f13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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(_0x251e03,_0x47640c){var _0x1e5f16=function(_0x57a1c2){while(--_0x57a1c2){_0x251e03['push'](_0x251e03['shift']());}};_0x1e5f16(++_0x47640c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 3fcda76..6a3eead 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 _0xf3a6=['rawAttributes','intersection','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','parent_type','direction','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','catch'];(function(_0x5d09d5,_0x550022){var _0x226f63=function(_0x28cb72){while(--_0x28cb72){_0x5d09d5['push'](_0x5d09d5['shift']());}};_0x226f63(++_0x550022);}(_0xf3a6,0xa0));var _0x6f3a=function(_0xc7ed29,_0x515330){_0xc7ed29=_0xc7ed29-0x0;var _0xf8da19=_0xf3a6[_0xc7ed29];return _0xf8da19;};'use strict';var emlformat=require(_0x6f3a('0x0'));var rimraf=require(_0x6f3a('0x1'));var zipdir=require(_0x6f3a('0x2'));var jsonpatch=require(_0x6f3a('0x3'));var rp=require(_0x6f3a('0x4'));var moment=require(_0x6f3a('0x5'));var BPromise=require(_0x6f3a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f3a('0x7'));var sox=require(_0x6f3a('0x8'));var csv=require('to-csv');var ejs=require(_0x6f3a('0x9'));var fs=require('fs');var fs_extra=require(_0x6f3a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f3a('0xb'));var jsforce=require(_0x6f3a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6f3a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f3a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f3a('0xf'));var logger=require(_0x6f3a('0x10'))('api');var utils=require(_0x6f3a('0x11'));var config=require(_0x6f3a('0x12'));var licenseUtil=require(_0x6f3a('0x13'));var db=require(_0x6f3a('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x194c72,_0x4c8355){_0x4c8355=_0x4c8355||0xcc;return function(_0x32623f){if(_0x32623f){return _0x194c72[_0x6f3a('0x15')](_0x4c8355);}return _0x194c72[_0x6f3a('0x16')](_0x4c8355)[_0x6f3a('0x17')]();};}function respondWithResult(_0x155f1d,_0x4db26d){_0x4db26d=_0x4db26d||0xc8;return function(_0x4a140f){if(_0x4a140f){return _0x155f1d[_0x6f3a('0x16')](_0x4db26d)[_0x6f3a('0x18')](_0x4a140f);}};}function respondWithFilteredResult(_0x1be5b1,_0x3d46e0){return function(_0x22ec83){if(_0x22ec83){var _0x40a9df=typeof _0x3d46e0[_0x6f3a('0x19')]===_0x6f3a('0x1a')&&typeof _0x3d46e0[_0x6f3a('0x1b')]===_0x6f3a('0x1a');var _0x3d22b1=_0x22ec83[_0x6f3a('0x1c')];var _0x1ad5fb=_0x40a9df?0x0:_0x3d46e0[_0x6f3a('0x19')];var _0x296d01=_0x40a9df?_0x22ec83['count']:_0x3d46e0[_0x6f3a('0x19')]+_0x3d46e0['limit'];var _0x4540f1;if(_0x296d01>=_0x3d22b1){_0x296d01=_0x3d22b1;_0x4540f1=0xc8;}else{_0x4540f1=0xce;}_0x1be5b1[_0x6f3a('0x16')](_0x4540f1);return _0x1be5b1[_0x6f3a('0x1d')](_0x6f3a('0x1e'),_0x1ad5fb+'-'+_0x296d01+'/'+_0x3d22b1)['json'](_0x22ec83);}return null;};}function patchUpdates(_0x4375fa){return function(_0x1e7f1f){try{jsonpatch['apply'](_0x1e7f1f,_0x4375fa,!![]);}catch(_0x2ca0fc){return BPromise['reject'](_0x2ca0fc);}return _0x1e7f1f[_0x6f3a('0x1f')]();};}function saveUpdates(_0x564f46,_0x32ce5e){return function(_0x31dfcb){if(_0x31dfcb){return _0x31dfcb['update'](_0x564f46)[_0x6f3a('0x20')](function(_0x197a18){return _0x197a18;});}return null;};}function removeEntity(_0x46aa00,_0x2d51f7){return function(_0x5eec5d){if(_0x5eec5d){return _0x5eec5d[_0x6f3a('0x21')]()[_0x6f3a('0x20')](function(){_0x46aa00['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x431451,_0xffa48b){return function(_0x672955){if(!_0x672955){_0x431451[_0x6f3a('0x15')](0x194);}return _0x672955;};}function handleError(_0x97a0a1,_0x25d4a8){_0x25d4a8=_0x25d4a8||0x1f4;return function(_0x27cc07){logger[_0x6f3a('0x22')](_0x27cc07[_0x6f3a('0x23')]);if(_0x27cc07[_0x6f3a('0x24')]){delete _0x27cc07['name'];}_0x97a0a1[_0x6f3a('0x16')](_0x25d4a8)[_0x6f3a('0x25')](_0x27cc07);};}exports[_0x6f3a('0x26')]=function(_0x57f883,_0x591e3e){var _0x56aea5={},_0xdcba34={},_0xab4612={'count':0x0,'rows':[]};var _0x1b6451=_[_0x6f3a('0x27')](db[_0x6f3a('0x28')]['rawAttributes'],function(_0x2c395a){return{'name':_0x2c395a[_0x6f3a('0x29')],'type':_0x2c395a[_0x6f3a('0x2a')][_0x6f3a('0x2b')]};});_0xdcba34[_0x6f3a('0x2c')]=_[_0x6f3a('0x27')](_0x1b6451,_0x6f3a('0x24'));_0xdcba34[_0x6f3a('0x2d')]=_[_0x6f3a('0x2e')](_0x57f883[_0x6f3a('0x2d')]);_0xdcba34[_0x6f3a('0x2f')]=_['intersection'](_0xdcba34[_0x6f3a('0x2c')],_0xdcba34[_0x6f3a('0x2d')]);_0x56aea5[_0x6f3a('0x30')]=_['intersection'](_0xdcba34[_0x6f3a('0x2c')],qs[_0x6f3a('0x31')](_0x57f883[_0x6f3a('0x2d')][_0x6f3a('0x31')]));_0x56aea5[_0x6f3a('0x30')]=_0x56aea5[_0x6f3a('0x30')][_0x6f3a('0x32')]?_0x56aea5['attributes']:_0xdcba34[_0x6f3a('0x2c')];if(!_0x57f883[_0x6f3a('0x2d')][_0x6f3a('0x33')](_0x6f3a('0x34'))){_0x56aea5[_0x6f3a('0x1b')]=qs[_0x6f3a('0x1b')](_0x57f883['query'][_0x6f3a('0x1b')]);_0x56aea5[_0x6f3a('0x19')]=qs[_0x6f3a('0x19')](_0x57f883[_0x6f3a('0x2d')]['offset']);}_0x56aea5[_0x6f3a('0x35')]=qs[_0x6f3a('0x36')](_0x57f883[_0x6f3a('0x2d')]['sort']);_0x56aea5['where']=qs[_0x6f3a('0x2f')](_[_0x6f3a('0x37')](_0x57f883['query'],_0xdcba34[_0x6f3a('0x2f')]),_0x1b6451);if(_0x57f883[_0x6f3a('0x2d')][_0x6f3a('0x38')]){_0x56aea5[_0x6f3a('0x39')]=_[_0x6f3a('0x3a')](_0x56aea5['where'],{'$or':_['map'](_0x1b6451,function(_0xfb3897){if(_0xfb3897[_0x6f3a('0x2a')]!=='VIRTUAL'){var _0x5bb6b7={};_0x5bb6b7[_0xfb3897['name']]={'$like':'%'+_0x57f883[_0x6f3a('0x2d')][_0x6f3a('0x38')]+'%'};return _0x5bb6b7;}})});}_0x56aea5=_['merge']({},_0x56aea5,_0x57f883[_0x6f3a('0x3b')]);var _0x5051c9={'where':_0x56aea5['where']};return db['SugarcrmAccount'][_0x6f3a('0x1c')](_0x5051c9)[_0x6f3a('0x20')](function(_0x29d80d){_0xab4612[_0x6f3a('0x1c')]=_0x29d80d;if(_0x57f883[_0x6f3a('0x2d')]['includeAll']){_0x56aea5[_0x6f3a('0x3c')]=[{'all':!![]}];}return db[_0x6f3a('0x28')]['findAll'](_0x56aea5);})[_0x6f3a('0x20')](function(_0x11e321){_0xab4612['rows']=_0x11e321;return _0xab4612;})[_0x6f3a('0x20')](respondWithFilteredResult(_0x591e3e,_0x56aea5))[_0x6f3a('0x3d')](handleError(_0x591e3e,null));};exports['show']=function(_0x977859,_0x28b6f4){var _0x4c7201={'raw':![],'where':{'id':_0x977859['params']['id']}},_0x1f2360={};_0x1f2360[_0x6f3a('0x2c')]=_['keys'](db[_0x6f3a('0x28')][_0x6f3a('0x3e')]);_0x1f2360[_0x6f3a('0x2d')]=_[_0x6f3a('0x2e')](_0x977859[_0x6f3a('0x2d')]);_0x1f2360['filters']=_[_0x6f3a('0x3f')](_0x1f2360[_0x6f3a('0x2c')],_0x1f2360[_0x6f3a('0x2d')]);_0x4c7201[_0x6f3a('0x30')]=_[_0x6f3a('0x3f')](_0x1f2360[_0x6f3a('0x2c')],qs['fields'](_0x977859[_0x6f3a('0x2d')][_0x6f3a('0x31')]));_0x4c7201[_0x6f3a('0x30')]=_0x4c7201[_0x6f3a('0x30')]['length']?_0x4c7201[_0x6f3a('0x30')]:_0x1f2360[_0x6f3a('0x2c')];if(_0x977859[_0x6f3a('0x2d')]['includeAll']){_0x4c7201[_0x6f3a('0x3c')]=[{'all':!![]}];}_0x4c7201=_[_0x6f3a('0x3a')]({},_0x4c7201,_0x977859[_0x6f3a('0x3b')]);return db[_0x6f3a('0x28')][_0x6f3a('0x40')](_0x4c7201)['then'](handleEntityNotFound(_0x28b6f4,null))[_0x6f3a('0x20')](respondWithResult(_0x28b6f4,null))['catch'](handleError(_0x28b6f4,null));};exports['create']=function(_0x5a73b2,_0xb33a55){return db[_0x6f3a('0x28')][_0x6f3a('0x41')](_0x5a73b2[_0x6f3a('0x42')],{})[_0x6f3a('0x20')](respondWithResult(_0xb33a55,0xc9))[_0x6f3a('0x3d')](handleError(_0xb33a55,null));};exports['update']=function(_0x3698e5,_0x2d12ca){if(_0x3698e5['body']['id']){delete _0x3698e5[_0x6f3a('0x42')]['id'];}return db['SugarcrmAccount'][_0x6f3a('0x40')]({'where':{'id':_0x3698e5['params']['id']}})[_0x6f3a('0x20')](handleEntityNotFound(_0x2d12ca,null))[_0x6f3a('0x20')](saveUpdates(_0x3698e5['body'],null))[_0x6f3a('0x20')](respondWithResult(_0x2d12ca,null))['catch'](handleError(_0x2d12ca,null));};exports[_0x6f3a('0x21')]=function(_0x556d36,_0xdaea31){return db[_0x6f3a('0x28')]['find']({'where':{'id':_0x556d36[_0x6f3a('0x43')]['id']}})[_0x6f3a('0x20')](handleEntityNotFound(_0xdaea31,null))[_0x6f3a('0x20')](removeEntity(_0xdaea31,null))['catch'](handleError(_0xdaea31,null));};exports[_0x6f3a('0x44')]=function(_0x24545a,_0x27c082,_0x2c99e9){var _0x1e34d6={};var _0x51d78f={};var _0x41c631;var _0x4609d3;return db[_0x6f3a('0x28')][_0x6f3a('0x45')]({'where':{'id':_0x24545a[_0x6f3a('0x43')]['id']}})['then'](handleEntityNotFound(_0x27c082,null))[_0x6f3a('0x20')](function(_0x1b8eb4){if(_0x1b8eb4){_0x41c631=_0x1b8eb4;_0x51d78f[_0x6f3a('0x2c')]=_['keys'](db[_0x6f3a('0x46')][_0x6f3a('0x3e')]);_0x51d78f['query']=_[_0x6f3a('0x2e')](_0x24545a[_0x6f3a('0x2d')]);_0x51d78f[_0x6f3a('0x2f')]=_[_0x6f3a('0x3f')](_0x51d78f[_0x6f3a('0x2c')],_0x51d78f['query']);_0x1e34d6[_0x6f3a('0x30')]=_[_0x6f3a('0x3f')](_0x51d78f[_0x6f3a('0x2c')],qs[_0x6f3a('0x31')](_0x24545a['query'][_0x6f3a('0x31')]));_0x1e34d6[_0x6f3a('0x30')]=_0x1e34d6[_0x6f3a('0x30')][_0x6f3a('0x32')]?_0x1e34d6[_0x6f3a('0x30')]:_0x51d78f['model'];_0x1e34d6[_0x6f3a('0x35')]=qs[_0x6f3a('0x36')](_0x24545a['query'][_0x6f3a('0x36')]);_0x1e34d6[_0x6f3a('0x39')]=qs['filters'](_['pick'](_0x24545a[_0x6f3a('0x2d')],_0x51d78f[_0x6f3a('0x2f')]));if(_0x24545a['query'][_0x6f3a('0x38')]){_0x1e34d6[_0x6f3a('0x39')]=_[_0x6f3a('0x3a')](_0x1e34d6[_0x6f3a('0x39')],{'$or':_[_0x6f3a('0x27')](_0x1e34d6['attributes'],function(_0x417567){var _0x57b9fa={};_0x57b9fa[_0x417567]={'$like':'%'+_0x24545a['query']['filter']+'%'};return _0x57b9fa;})});}_0x1e34d6=_[_0x6f3a('0x3a')]({},_0x1e34d6,_0x24545a[_0x6f3a('0x3b')]);return _0x41c631[_0x6f3a('0x44')](_0x1e34d6);}})[_0x6f3a('0x20')](function(_0x51ef1f){if(_0x51ef1f){_0x4609d3=_0x51ef1f[_0x6f3a('0x32')];if(!_0x24545a[_0x6f3a('0x2d')][_0x6f3a('0x33')]('nolimit')){_0x1e34d6['limit']=qs[_0x6f3a('0x1b')](_0x24545a['query']['limit']);_0x1e34d6[_0x6f3a('0x19')]=qs['offset'](_0x24545a[_0x6f3a('0x2d')][_0x6f3a('0x19')]);}return _0x41c631[_0x6f3a('0x44')](_0x1e34d6);}})[_0x6f3a('0x20')](function(_0x14f027){if(_0x14f027){return _0x14f027?{'count':_0x4609d3,'rows':_0x14f027}:null;}})[_0x6f3a('0x20')](respondWithResult(_0x27c082,null))['catch'](handleError(_0x27c082,null));};exports[_0x6f3a('0x47')]=function(_0x2fb8f8,_0x445b9e,_0x4be14f){if(_0x2fb8f8[_0x6f3a('0x42')]['id']){delete _0x2fb8f8['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x2fb8f8[_0x6f3a('0x43')]['id']}})[_0x6f3a('0x20')](handleEntityNotFound(_0x445b9e,null))['then'](function(_0x1ba32e){if(_0x1ba32e){_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x48')]=_0x1ba32e['id'];_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x49')]=integrations[_0x6f3a('0x4a')](_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x4b')],_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x2a')]);_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x4c')]=integrations['getDescriptions'](_0x2fb8f8[_0x6f3a('0x42')][_0x6f3a('0x4b')],_0x2fb8f8['body'][_0x6f3a('0x2a')]);return db['SugarcrmConfiguration'][_0x6f3a('0x41')](_0x2fb8f8[_0x6f3a('0x42')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x6f3a('0x4c')}]});}return null;})[_0x6f3a('0x20')](respondWithResult(_0x445b9e,null))[_0x6f3a('0x3d')](handleError(_0x445b9e,null));};exports[_0x6f3a('0x4d')]=function(_0x5aea25,_0x3f22db,_0x4f982f){var _0x2cceca='';var _0x4070e=['id',_0x6f3a('0x24'),_0x6f3a('0x4e'),_0x6f3a('0x4f'),_0x6f3a('0x50'),'date_start',_0x6f3a('0x51'),'duration_minutes','parent_id',_0x6f3a('0x52'),'parent_name',_0x6f3a('0x53')];return db['SugarcrmAccount'][_0x6f3a('0x45')]({'where':{'id':_0x5aea25[_0x6f3a('0x43')]['id']},'attributes':['id','username',_0x6f3a('0x54'),_0x6f3a('0x55')]})[_0x6f3a('0x20')](handleEntityNotFound(_0x3f22db,null))[_0x6f3a('0x20')](function(_0x3b5e00){if(_0x3b5e00){_0x2cceca=_0x3b5e00[_0x6f3a('0x55')];var _0x37b48f=_0x2cceca[_0x6f3a('0x56')](-0x1);if(_0x37b48f==='/'){_0x2cceca=_0x2cceca['substring'](0x0,_0x2cceca[_0x6f3a('0x57')](_0x37b48f));}return rp({'method':_0x6f3a('0x58'),'uri':util[_0x6f3a('0x59')](_0x6f3a('0x5a'),_0x2cceca,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6f3a('0x5b'),'input_type':_0x6f3a('0x5c'),'response_type':_0x6f3a('0x5c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3b5e00[_0x6f3a('0x5d')],'password':_0x3b5e00[_0x6f3a('0x54')],'encryption':_0x6f3a('0x5e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x6f3a('0x20')](function(_0x568b59){if(_0x568b59&&_0x568b59[_0x6f3a('0x24')]!==_0x6f3a('0x5f')&&_0x568b59[_0x6f3a('0x24')]!==_0x6f3a('0x60')){return rp({'method':_0x6f3a('0x58'),'uri':util[_0x6f3a('0x59')]('%s%s',_0x2cceca,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6f3a('0x61'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x568b59['id'],'module_name':_0x6f3a('0x62')})}})[_0x6f3a('0x20')](function(_0x232a4d){if(_0x232a4d){var _0x376ce6=_['values'](_0x232a4d[_0x6f3a('0x63')]);_[_0x6f3a('0x64')](_0x376ce6,function(_0x4ed31c){return _0x4070e[_0x6f3a('0x65')](_0x4ed31c[_0x6f3a('0x24')]);});return{'count':_0x376ce6[_0x6f3a('0x32')],'rows':_[_0x6f3a('0x27')](_0x376ce6,function(_0x243c4a){return{'id':_0x243c4a['name'],'name':_0x243c4a[_0x6f3a('0x66')],'custom':_[_0x6f3a('0x67')](_0x243c4a[_0x6f3a('0x24')],'_c')?!![]:![],'options':_0x243c4a[_0x6f3a('0x3b')]?_[_0x6f3a('0x27')](_[_0x6f3a('0x68')](_0x243c4a[_0x6f3a('0x3b')]),function(_0x2f8b10){return{'name':_0x2f8b10[_0x6f3a('0x69')],'value':_0x2f8b10[_0x6f3a('0x24')]};}):[]};})};}})['then'](respondWithResult(_0x3f22db,null))[_0x6f3a('0x3d')](function(_0x546967){var _0x1610a2=_0x5aea25[_0x6f3a('0x2d')]['test']?0x1f4:_0x546967[_0x6f3a('0x6a')]||0x1f4;logger[_0x6f3a('0x22')](_0x6f3a('0x6b'),_0x6f3a('0x4d'),_0x1610a2,JSON[_0x6f3a('0x6c')](_0x546967));delete _0x546967[_0x6f3a('0x24')];if(_0x1610a2===0x191){_0x1610a2=0x190;}_0x3f22db[_0x6f3a('0x16')](_0x1610a2)[_0x6f3a('0x25')](_0x5aea25[_0x6f3a('0x2d')][_0x6f3a('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x546967[_0x6f3a('0x6a')]}:_0x546967);});}else{var _0x57bcda=0x1f4;_0x3f22db[_0x6f3a('0x16')](_0x57bcda)[_0x6f3a('0x25')]({'message':_0x6f3a('0x6e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0a64=['username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','SugarcrmAccount','includeAll','rows','catch','show','include','options','find','create','body','params','SugarcrmConfiguration','order','sort','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction'];(function(_0x51f527,_0x2b6d78){var _0x1a982e=function(_0x484fcf){while(--_0x484fcf){_0x51f527['push'](_0x51f527['shift']());}};_0x1a982e(++_0x2b6d78);}(_0x0a64,0x9a));var _0x40a6=function(_0x5c5532,_0x20527e){_0x5c5532=_0x5c5532-0x0;var _0x535544=_0x0a64[_0x5c5532];return _0x535544;};'use strict';var emlformat=require(_0x40a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x40a6('0x1'));var rp=require(_0x40a6('0x2'));var moment=require(_0x40a6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x40a6('0x4'));var sox=require('sox');var csv=require(_0x40a6('0x5'));var ejs=require(_0x40a6('0x6'));var fs=require('fs');var fs_extra=require(_0x40a6('0x7'));var _=require('lodash');var squel=require(_0x40a6('0x8'));var crypto=require(_0x40a6('0x9'));var jsforce=require(_0x40a6('0xa'));var deskjs=require(_0x40a6('0xb'));var toCsv=require(_0x40a6('0x5'));var querystring=require('querystring');var Papa=require(_0x40a6('0xc'));var Redis=require(_0x40a6('0xd'));var authService=require(_0x40a6('0xe'));var qs=require(_0x40a6('0xf'));var as=require(_0x40a6('0x10'));var hardwareService=require(_0x40a6('0x11'));var logger=require(_0x40a6('0x12'))(_0x40a6('0x13'));var utils=require(_0x40a6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x40a6('0x15'));var db=require(_0x40a6('0x16'))['db'];var integrations=require(_0x40a6('0x17'));function respondWithStatusCode(_0x242590,_0x4f4234){_0x4f4234=_0x4f4234||0xcc;return function(_0x5ad029){if(_0x5ad029){return _0x242590[_0x40a6('0x18')](_0x4f4234);}return _0x242590['status'](_0x4f4234)[_0x40a6('0x19')]();};}function respondWithResult(_0x99a6ba,_0x56ac52){_0x56ac52=_0x56ac52||0xc8;return function(_0x270b6b){if(_0x270b6b){return _0x99a6ba[_0x40a6('0x1a')](_0x56ac52)[_0x40a6('0x1b')](_0x270b6b);}};}function respondWithFilteredResult(_0x2a3269,_0x2f459a){return function(_0x1829cb){if(_0x1829cb){var _0x224bd0=typeof _0x2f459a[_0x40a6('0x1c')]==='undefined'&&typeof _0x2f459a[_0x40a6('0x1d')]===_0x40a6('0x1e');var _0x52a16c=_0x1829cb[_0x40a6('0x1f')];var _0x1528b5=_0x224bd0?0x0:_0x2f459a[_0x40a6('0x1c')];var _0x5c19bd=_0x224bd0?_0x1829cb[_0x40a6('0x1f')]:_0x2f459a[_0x40a6('0x1c')]+_0x2f459a[_0x40a6('0x1d')];var _0x4e24f8;if(_0x5c19bd>=_0x52a16c){_0x5c19bd=_0x52a16c;_0x4e24f8=0xc8;}else{_0x4e24f8=0xce;}_0x2a3269[_0x40a6('0x1a')](_0x4e24f8);return _0x2a3269[_0x40a6('0x20')](_0x40a6('0x21'),_0x1528b5+'-'+_0x5c19bd+'/'+_0x52a16c)[_0x40a6('0x1b')](_0x1829cb);}return null;};}function patchUpdates(_0x284320){return function(_0xed878d){try{jsonpatch[_0x40a6('0x22')](_0xed878d,_0x284320,!![]);}catch(_0x1aae31){return BPromise[_0x40a6('0x23')](_0x1aae31);}return _0xed878d['save']();};}function saveUpdates(_0x29aac6,_0x2af28a){return function(_0x18f3a3){if(_0x18f3a3){return _0x18f3a3[_0x40a6('0x24')](_0x29aac6)[_0x40a6('0x25')](function(_0x455840){return _0x455840;});}return null;};}function removeEntity(_0x217daf,_0xfec1eb){return function(_0x1cc8cc){if(_0x1cc8cc){return _0x1cc8cc[_0x40a6('0x26')]()['then'](function(){_0x217daf['status'](0xcc)[_0x40a6('0x19')]();});}};}function handleEntityNotFound(_0x34332b,_0x39cedb){return function(_0x3ad396){if(!_0x3ad396){_0x34332b[_0x40a6('0x18')](0x194);}return _0x3ad396;};}function handleError(_0x8249e3,_0x76d6ec){_0x76d6ec=_0x76d6ec||0x1f4;return function(_0x624aa4){logger['error'](_0x624aa4[_0x40a6('0x27')]);if(_0x624aa4[_0x40a6('0x28')]){delete _0x624aa4[_0x40a6('0x28')];}_0x8249e3['status'](_0x76d6ec)['send'](_0x624aa4);};}exports[_0x40a6('0x29')]=function(_0x5ef258,_0x7eec4e){var _0x5484f6={},_0x11f44e={},_0x478e45={'count':0x0,'rows':[]};var _0x4f833f=_[_0x40a6('0x2a')](db['SugarcrmAccount'][_0x40a6('0x2b')],function(_0x18c416){return{'name':_0x18c416['fieldName'],'type':_0x18c416[_0x40a6('0x2c')][_0x40a6('0x2d')]};});_0x11f44e[_0x40a6('0x2e')]=_[_0x40a6('0x2a')](_0x4f833f,'name');_0x11f44e[_0x40a6('0x2f')]=_[_0x40a6('0x30')](_0x5ef258[_0x40a6('0x2f')]);_0x11f44e[_0x40a6('0x31')]=_['intersection'](_0x11f44e[_0x40a6('0x2e')],_0x11f44e[_0x40a6('0x2f')]);_0x5484f6['attributes']=_[_0x40a6('0x32')](_0x11f44e[_0x40a6('0x2e')],qs['fields'](_0x5ef258['query'][_0x40a6('0x33')]));_0x5484f6[_0x40a6('0x34')]=_0x5484f6['attributes'][_0x40a6('0x35')]?_0x5484f6[_0x40a6('0x34')]:_0x11f44e['model'];if(!_0x5ef258[_0x40a6('0x2f')][_0x40a6('0x36')](_0x40a6('0x37'))){_0x5484f6[_0x40a6('0x1d')]=qs[_0x40a6('0x1d')](_0x5ef258[_0x40a6('0x2f')][_0x40a6('0x1d')]);_0x5484f6[_0x40a6('0x1c')]=qs[_0x40a6('0x1c')](_0x5ef258[_0x40a6('0x2f')][_0x40a6('0x1c')]);}_0x5484f6['order']=qs['sort'](_0x5ef258[_0x40a6('0x2f')]['sort']);_0x5484f6[_0x40a6('0x38')]=qs[_0x40a6('0x31')](_[_0x40a6('0x39')](_0x5ef258['query'],_0x11f44e[_0x40a6('0x31')]),_0x4f833f);if(_0x5ef258[_0x40a6('0x2f')][_0x40a6('0x3a')]){_0x5484f6[_0x40a6('0x38')]=_[_0x40a6('0x3b')](_0x5484f6['where'],{'$or':_[_0x40a6('0x2a')](_0x4f833f,function(_0x5cfc66){if(_0x5cfc66[_0x40a6('0x2c')]!==_0x40a6('0x3c')){var _0x360662={};_0x360662[_0x5cfc66['name']]={'$like':'%'+_0x5ef258['query']['filter']+'%'};return _0x360662;}})});}_0x5484f6=_[_0x40a6('0x3b')]({},_0x5484f6,_0x5ef258['options']);var _0x493288={'where':_0x5484f6['where']};return db[_0x40a6('0x3d')][_0x40a6('0x1f')](_0x493288)[_0x40a6('0x25')](function(_0x4483cb){_0x478e45[_0x40a6('0x1f')]=_0x4483cb;if(_0x5ef258[_0x40a6('0x2f')][_0x40a6('0x3e')]){_0x5484f6['include']=[{'all':!![]}];}return db[_0x40a6('0x3d')]['findAll'](_0x5484f6);})[_0x40a6('0x25')](function(_0x37c9be){_0x478e45[_0x40a6('0x3f')]=_0x37c9be;return _0x478e45;})[_0x40a6('0x25')](respondWithFilteredResult(_0x7eec4e,_0x5484f6))[_0x40a6('0x40')](handleError(_0x7eec4e,null));};exports[_0x40a6('0x41')]=function(_0x2b11f8,_0x1c4eeb){var _0x20b5d8={'raw':![],'where':{'id':_0x2b11f8['params']['id']}},_0x5ea192={};_0x5ea192[_0x40a6('0x2e')]=_[_0x40a6('0x30')](db[_0x40a6('0x3d')][_0x40a6('0x2b')]);_0x5ea192[_0x40a6('0x2f')]=_[_0x40a6('0x30')](_0x2b11f8[_0x40a6('0x2f')]);_0x5ea192[_0x40a6('0x31')]=_[_0x40a6('0x32')](_0x5ea192[_0x40a6('0x2e')],_0x5ea192[_0x40a6('0x2f')]);_0x20b5d8[_0x40a6('0x34')]=_[_0x40a6('0x32')](_0x5ea192[_0x40a6('0x2e')],qs[_0x40a6('0x33')](_0x2b11f8[_0x40a6('0x2f')]['fields']));_0x20b5d8[_0x40a6('0x34')]=_0x20b5d8[_0x40a6('0x34')][_0x40a6('0x35')]?_0x20b5d8[_0x40a6('0x34')]:_0x5ea192['model'];if(_0x2b11f8[_0x40a6('0x2f')][_0x40a6('0x3e')]){_0x20b5d8[_0x40a6('0x42')]=[{'all':!![]}];}_0x20b5d8=_[_0x40a6('0x3b')]({},_0x20b5d8,_0x2b11f8[_0x40a6('0x43')]);return db[_0x40a6('0x3d')][_0x40a6('0x44')](_0x20b5d8)['then'](handleEntityNotFound(_0x1c4eeb,null))[_0x40a6('0x25')](respondWithResult(_0x1c4eeb,null))[_0x40a6('0x40')](handleError(_0x1c4eeb,null));};exports[_0x40a6('0x45')]=function(_0x59d7d5,_0x17f07e){return db['SugarcrmAccount']['create'](_0x59d7d5[_0x40a6('0x46')],{})[_0x40a6('0x25')](respondWithResult(_0x17f07e,0xc9))[_0x40a6('0x40')](handleError(_0x17f07e,null));};exports['update']=function(_0x492858,_0x562d64){if(_0x492858[_0x40a6('0x46')]['id']){delete _0x492858[_0x40a6('0x46')]['id'];}return db[_0x40a6('0x3d')][_0x40a6('0x44')]({'where':{'id':_0x492858[_0x40a6('0x47')]['id']}})[_0x40a6('0x25')](handleEntityNotFound(_0x562d64,null))[_0x40a6('0x25')](saveUpdates(_0x492858[_0x40a6('0x46')],null))[_0x40a6('0x25')](respondWithResult(_0x562d64,null))['catch'](handleError(_0x562d64,null));};exports[_0x40a6('0x26')]=function(_0x2c344b,_0xf22028){return db['SugarcrmAccount']['find']({'where':{'id':_0x2c344b[_0x40a6('0x47')]['id']}})[_0x40a6('0x25')](handleEntityNotFound(_0xf22028,null))[_0x40a6('0x25')](removeEntity(_0xf22028,null))[_0x40a6('0x40')](handleError(_0xf22028,null));};exports['getConfigurations']=function(_0x4a5052,_0x5b6780,_0x339a3d){var _0x7a069d={};var _0x5dc019={};var _0x5c3199;var _0x3505f7;return db[_0x40a6('0x3d')]['findOne']({'where':{'id':_0x4a5052[_0x40a6('0x47')]['id']}})[_0x40a6('0x25')](handleEntityNotFound(_0x5b6780,null))[_0x40a6('0x25')](function(_0x497341){if(_0x497341){_0x5c3199=_0x497341;_0x5dc019[_0x40a6('0x2e')]=_[_0x40a6('0x30')](db[_0x40a6('0x48')][_0x40a6('0x2b')]);_0x5dc019['query']=_['keys'](_0x4a5052[_0x40a6('0x2f')]);_0x5dc019[_0x40a6('0x31')]=_[_0x40a6('0x32')](_0x5dc019['model'],_0x5dc019['query']);_0x7a069d[_0x40a6('0x34')]=_[_0x40a6('0x32')](_0x5dc019[_0x40a6('0x2e')],qs[_0x40a6('0x33')](_0x4a5052['query'][_0x40a6('0x33')]));_0x7a069d[_0x40a6('0x34')]=_0x7a069d['attributes'][_0x40a6('0x35')]?_0x7a069d[_0x40a6('0x34')]:_0x5dc019[_0x40a6('0x2e')];_0x7a069d[_0x40a6('0x49')]=qs[_0x40a6('0x4a')](_0x4a5052[_0x40a6('0x2f')][_0x40a6('0x4a')]);_0x7a069d['where']=qs['filters'](_[_0x40a6('0x39')](_0x4a5052[_0x40a6('0x2f')],_0x5dc019[_0x40a6('0x31')]));if(_0x4a5052[_0x40a6('0x2f')][_0x40a6('0x3a')]){_0x7a069d[_0x40a6('0x38')]=_[_0x40a6('0x3b')](_0x7a069d[_0x40a6('0x38')],{'$or':_[_0x40a6('0x2a')](_0x7a069d[_0x40a6('0x34')],function(_0x3e96f2){var _0x33c570={};_0x33c570[_0x3e96f2]={'$like':'%'+_0x4a5052['query'][_0x40a6('0x3a')]+'%'};return _0x33c570;})});}_0x7a069d=_[_0x40a6('0x3b')]({},_0x7a069d,_0x4a5052[_0x40a6('0x43')]);return _0x5c3199[_0x40a6('0x4b')](_0x7a069d);}})['then'](function(_0x8bb8c9){if(_0x8bb8c9){_0x3505f7=_0x8bb8c9[_0x40a6('0x35')];if(!_0x4a5052[_0x40a6('0x2f')][_0x40a6('0x36')](_0x40a6('0x37'))){_0x7a069d[_0x40a6('0x1d')]=qs['limit'](_0x4a5052['query']['limit']);_0x7a069d[_0x40a6('0x1c')]=qs[_0x40a6('0x1c')](_0x4a5052[_0x40a6('0x2f')][_0x40a6('0x1c')]);}return _0x5c3199['getConfigurations'](_0x7a069d);}})[_0x40a6('0x25')](function(_0x5004c4){if(_0x5004c4){return _0x5004c4?{'count':_0x3505f7,'rows':_0x5004c4}:null;}})[_0x40a6('0x25')](respondWithResult(_0x5b6780,null))[_0x40a6('0x40')](handleError(_0x5b6780,null));};exports[_0x40a6('0x4c')]=function(_0xaf3173,_0xfea527,_0x337f48){if(_0xaf3173[_0x40a6('0x46')]['id']){delete _0xaf3173['body']['id'];}return db['SugarcrmAccount'][_0x40a6('0x4d')]({'where':{'id':_0xaf3173[_0x40a6('0x47')]['id']}})[_0x40a6('0x25')](handleEntityNotFound(_0xfea527,null))[_0x40a6('0x25')](function(_0x5a6d1b){if(_0x5a6d1b){_0xaf3173[_0x40a6('0x46')][_0x40a6('0x4e')]=_0x5a6d1b['id'];_0xaf3173[_0x40a6('0x46')][_0x40a6('0x4f')]=integrations[_0x40a6('0x50')](_0xaf3173[_0x40a6('0x46')][_0x40a6('0x51')],_0xaf3173['body'][_0x40a6('0x2c')]);_0xaf3173[_0x40a6('0x46')]['Descriptions']=integrations[_0x40a6('0x52')](_0xaf3173[_0x40a6('0x46')][_0x40a6('0x51')],_0xaf3173[_0x40a6('0x46')][_0x40a6('0x2c')]);return db[_0x40a6('0x48')]['create'](_0xaf3173[_0x40a6('0x46')],{'include':[{'model':db[_0x40a6('0x53')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x40a6('0x54')}]});}return null;})[_0x40a6('0x25')](respondWithResult(_0xfea527,null))[_0x40a6('0x40')](handleError(_0xfea527,null));};exports[_0x40a6('0x55')]=function(_0x38d47f,_0x25376b,_0x14630e){var _0x5e35fb='';var _0x72069b=['id',_0x40a6('0x28'),'assigned_user_id',_0x40a6('0x56'),_0x40a6('0x57'),'date_start',_0x40a6('0x58'),_0x40a6('0x59'),_0x40a6('0x5a'),_0x40a6('0x5b'),_0x40a6('0x5c'),_0x40a6('0x5d')];return db[_0x40a6('0x3d')]['findOne']({'where':{'id':_0x38d47f[_0x40a6('0x47')]['id']},'attributes':['id',_0x40a6('0x5e'),_0x40a6('0x5f'),_0x40a6('0x60')]})[_0x40a6('0x25')](handleEntityNotFound(_0x25376b,null))[_0x40a6('0x25')](function(_0x3ff4d9){if(_0x3ff4d9){_0x5e35fb=_0x3ff4d9['remoteUri'];var _0x3d2d38=_0x5e35fb[_0x40a6('0x61')](-0x1);if(_0x3d2d38==='/'){_0x5e35fb=_0x5e35fb[_0x40a6('0x62')](0x0,_0x5e35fb[_0x40a6('0x63')](_0x3d2d38));}return rp({'method':_0x40a6('0x64'),'uri':util['format'](_0x40a6('0x65'),_0x5e35fb,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x40a6('0x66'),'input_type':'JSON','response_type':_0x40a6('0x67'),'rest_data':JSON[_0x40a6('0x68')]({'user_auth':{'user_name':_0x3ff4d9[_0x40a6('0x5e')],'password':_0x3ff4d9[_0x40a6('0x5f')],'encryption':_0x40a6('0x69')},'application':_0x40a6('0x6a')})}});}})[_0x40a6('0x25')](function(_0x1172ef){if(_0x1172ef&&_0x1172ef[_0x40a6('0x28')]!=='Invalid\x20Login'&&_0x1172ef[_0x40a6('0x28')]!==_0x40a6('0x6b')){return rp({'method':_0x40a6('0x64'),'uri':util[_0x40a6('0x6c')]('%s%s',_0x5e35fb,_0x40a6('0x6d')),'json':!![],'form':{'method':_0x40a6('0x6e'),'input_type':_0x40a6('0x67'),'response_type':_0x40a6('0x67'),'rest_data':JSON[_0x40a6('0x68')]({'session':_0x1172ef['id'],'module_name':_0x40a6('0x6f')})}})['then'](function(_0x4fa1a3){if(_0x4fa1a3){var _0x3d1c7d=_[_0x40a6('0x70')](_0x4fa1a3[_0x40a6('0x71')]);_[_0x40a6('0x72')](_0x3d1c7d,function(_0x53d177){return _0x72069b['includes'](_0x53d177[_0x40a6('0x28')]);});return{'count':_0x3d1c7d[_0x40a6('0x35')],'rows':_[_0x40a6('0x2a')](_0x3d1c7d,function(_0x30782a){return{'id':_0x30782a['name'],'name':_0x30782a[_0x40a6('0x73')],'custom':_[_0x40a6('0x74')](_0x30782a[_0x40a6('0x28')],'_c')?!![]:![],'options':_0x30782a[_0x40a6('0x43')]?_[_0x40a6('0x2a')](_[_0x40a6('0x70')](_0x30782a['options']),function(_0x4bf4db){return{'name':_0x4bf4db[_0x40a6('0x75')],'value':_0x4bf4db[_0x40a6('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x25376b,null))[_0x40a6('0x40')](function(_0x5ef9b1){var _0x226e29=_0x38d47f[_0x40a6('0x2f')][_0x40a6('0x76')]?0x1f4:_0x5ef9b1[_0x40a6('0x77')]||0x1f4;logger[_0x40a6('0x78')](_0x40a6('0x79'),_0x40a6('0x55'),_0x226e29,JSON[_0x40a6('0x68')](_0x5ef9b1));delete _0x5ef9b1['name'];if(_0x226e29===0x191){_0x226e29=0x190;}_0x25376b[_0x40a6('0x1a')](_0x226e29)['send'](_0x38d47f[_0x40a6('0x2f')][_0x40a6('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x5ef9b1[_0x40a6('0x77')]}:_0x5ef9b1);});}else{var _0x427936=0x1f4;_0x25376b[_0x40a6('0x1a')](_0x427936)[_0x40a6('0x7a')]({'message':_0x40a6('0x7b'),'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 05a1abf..0d24ca0 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 _0x242c=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x52d5d9,_0x24bc67){var _0x2507c4=function(_0x266b20){while(--_0x266b20){_0x52d5d9['push'](_0x52d5d9['shift']());}};_0x2507c4(++_0x24bc67);}(_0x242c,0xfb));var _0xc242=function(_0x2a7967,_0x54deef){_0x2a7967=_0x2a7967-0x0;var _0x195477=_0x242c[_0x2a7967];return _0x195477;};'use strict';var _=require(_0xc242('0x0'));var util=require(_0xc242('0x1'));var logger=require(_0xc242('0x2'))(_0xc242('0x3'));var moment=require(_0xc242('0x4'));var BPromise=require('bluebird');var rp=require(_0xc242('0x5'));var fs=require('fs');var path=require(_0xc242('0x6'));var rimraf=require(_0xc242('0x7'));var config=require(_0xc242('0x8'));var attributes=require(_0xc242('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xc242('0xa')]=function(_0x1cc0cd,_0x45bfe1){return _0x1cc0cd[_0xc242('0xb')](_0xc242('0xc'),attributes,{'tableName':_0xc242('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57a1=['../../config/logger','api','request-promise','../../config/environment','./intSugarcrmAccount.attributes','int_sugarcrm_accounts','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x57a1,0x148));var _0x157a=function(_0x2ec650,_0x24b011){_0x2ec650=_0x2ec650-0x0;var _0xdb00de=_0x57a1[_0x2ec650];return _0xdb00de;};'use strict';var _=require(_0x157a('0x0'));var util=require('util');var logger=require(_0x157a('0x1'))(_0x157a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x157a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x157a('0x4'));var attributes=require(_0x157a('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3e8960,_0x5749f9){return _0x3e8960['define']('SugarcrmAccount',attributes,{'tableName':_0x157a('0x6'),'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 66dbae1..8bd0dfd 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 _0x1141=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','map','model','include','ShowSugarcrmAccount','find','where','util','moment','bluebird','randomstring'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x1141,0xda));var _0x1114=function(_0x19cee7,_0x562ecb){_0x19cee7=_0x19cee7-0x0;var _0x45657b=_0x1141[_0x19cee7];return _0x45657b;};'use strict';var _=require('lodash');var util=require(_0x1114('0x0'));var moment=require(_0x1114('0x1'));var BPromise=require(_0x1114('0x2'));var rs=require(_0x1114('0x3'));var fs=require('fs');var Redis=require(_0x1114('0x4'));var db=require(_0x1114('0x5'))['db'];var utils=require(_0x1114('0x6'));var logger=require(_0x1114('0x7'))(_0x1114('0x8'));var config=require(_0x1114('0x9'));var jayson=require(_0x1114('0xa'));var client=jayson['client'][_0x1114('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543f2f,_0x2cafd3,_0xf4efd0){return new BPromise(function(_0x21c2af,_0x2b0dfa){return client[_0x1114('0xc')](_0x543f2f,_0xf4efd0)[_0x1114('0xd')](function(_0x1559b3){logger[_0x1114('0xe')](_0x1114('0xf'),_0x2cafd3,_0x1114('0x10'));logger[_0x1114('0x11')](_0x1114('0x12'),_0x2cafd3,_0x1114('0x10'),JSON[_0x1114('0x13')](_0x1559b3));if(_0x1559b3[_0x1114('0x14')]){if(_0x1559b3['error'][_0x1114('0x15')]===0x1f4){logger[_0x1114('0x14')](_0x1114('0xf'),_0x2cafd3,_0x1559b3[_0x1114('0x14')][_0x1114('0x16')]);return _0x2b0dfa(_0x1559b3[_0x1114('0x14')]['message']);}logger[_0x1114('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x2cafd3,_0x1559b3[_0x1114('0x14')]['message']);return _0x21c2af(_0x1559b3[_0x1114('0x14')][_0x1114('0x16')]);}else{logger[_0x1114('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x2cafd3,_0x1114('0x10'));_0x21c2af(_0x1559b3['result']['message']);}})[_0x1114('0x17')](function(_0x35acbe){logger[_0x1114('0x14')](_0x1114('0xf'),_0x2cafd3,_0x35acbe);_0x2b0dfa(_0x35acbe);});});}exports[_0x1114('0x18')]=function(_0x2c3370){var _0x30ca29=this;return new Promise(function(_0x2a3ddf,_0x3442eb){return db[_0x1114('0x19')][_0x1114('0x1a')]({'raw':_0x2c3370[_0x1114('0x1b')]?_0x2c3370['options'][_0x1114('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c3370[_0x1114('0x1b')]?_0x2c3370[_0x1114('0x1b')]['where']||null:null,'attributes':_0x2c3370[_0x1114('0x1b')]?_0x2c3370[_0x1114('0x1b')][_0x1114('0x1d')]||null:null,'limit':_0x2c3370[_0x1114('0x1b')]?_0x2c3370['options'][_0x1114('0x1e')]||null:null,'include':_0x2c3370[_0x1114('0x1b')]?_0x2c3370[_0x1114('0x1b')]['include']?_[_0x1114('0x1f')](_0x2c3370[_0x1114('0x1b')]['include'],function(_0x52e303){return{'model':db[_0x52e303[_0x1114('0x20')]],'as':_0x52e303['as'],'attributes':_0x52e303[_0x1114('0x1d')],'include':_0x52e303[_0x1114('0x21')]?_['map'](_0x52e303[_0x1114('0x21')],function(_0x108cd1){return{'model':db[_0x108cd1[_0x1114('0x20')]],'as':_0x108cd1['as'],'attributes':_0x108cd1[_0x1114('0x1d')],'include':_0x108cd1[_0x1114('0x21')]?_[_0x1114('0x1f')](_0x108cd1[_0x1114('0x21')],function(_0x1e9315){return{'model':db[_0x1e9315['model']],'as':_0x1e9315['as'],'attributes':_0x1e9315[_0x1114('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1114('0xd')](function(_0x5edb91){logger[_0x1114('0xe')](_0x1114('0x18'),_0x2c3370);logger[_0x1114('0x11')](_0x1114('0x18'),_0x2c3370,JSON[_0x1114('0x13')](_0x5edb91));_0x2a3ddf(_0x5edb91);})['catch'](function(_0x4c85bd){logger['error'](_0x1114('0x18'),_0x4c85bd[_0x1114('0x16')],_0x2c3370);_0x3442eb(_0x30ca29[_0x1114('0x14')](0x1f4,_0x4c85bd['message']));});});};exports[_0x1114('0x22')]=function(_0x32c669){var _0x5a2d64=this;return new Promise(function(_0x2bdd05,_0x31a482){return db[_0x1114('0x19')][_0x1114('0x23')]({'raw':_0x32c669[_0x1114('0x1b')]?_0x32c669[_0x1114('0x1b')][_0x1114('0x1c')]===undefined?!![]:![]:!![],'where':_0x32c669[_0x1114('0x1b')]?_0x32c669['options'][_0x1114('0x24')]||null:null,'attributes':_0x32c669[_0x1114('0x1b')]?_0x32c669[_0x1114('0x1b')][_0x1114('0x1d')]||null:null,'include':_0x32c669[_0x1114('0x1b')]?_0x32c669[_0x1114('0x1b')][_0x1114('0x21')]?_['map'](_0x32c669['options'][_0x1114('0x21')],function(_0x1ee963){return{'model':db[_0x1ee963[_0x1114('0x20')]],'as':_0x1ee963['as'],'attributes':_0x1ee963['attributes'],'include':_0x1ee963['include']?_[_0x1114('0x1f')](_0x1ee963[_0x1114('0x21')],function(_0x12157e){return{'model':db[_0x12157e['model']],'as':_0x12157e['as'],'attributes':_0x12157e[_0x1114('0x1d')],'include':_0x12157e[_0x1114('0x21')]?_['map'](_0x12157e['include'],function(_0x1421ac){return{'model':db[_0x1421ac['model']],'as':_0x1421ac['as'],'attributes':_0x1421ac[_0x1114('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eeb24){logger['info'](_0x1114('0x22'),_0x32c669);logger[_0x1114('0x11')](_0x1114('0x22'),_0x32c669,JSON[_0x1114('0x13')](_0x4eeb24));_0x2bdd05(_0x4eeb24);})[_0x1114('0x17')](function(_0x1ad046){logger[_0x1114('0x14')](_0x1114('0x22'),_0x1ad046[_0x1114('0x16')],_0x32c669);_0x31a482(_0x5a2d64[_0x1114('0x14')](0x1f4,_0x1ad046[_0x1114('0x16')]));});});}; \ No newline at end of file +var _0xaef9=['SugarcrmAccount,\x20%s,\x20%s','message','result','catch','options','where','attributes','limit','include','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','raw','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xaef9,0x190));var _0x9aef=function(_0x5190b7,_0x316467){_0x5190b7=_0x5190b7-0x0;var _0x150498=_0xaef9[_0x5190b7];return _0x150498;};'use strict';var _=require(_0x9aef('0x0'));var util=require(_0x9aef('0x1'));var moment=require('moment');var BPromise=require(_0x9aef('0x2'));var rs=require(_0x9aef('0x3'));var fs=require('fs');var Redis=require(_0x9aef('0x4'));var db=require(_0x9aef('0x5'))['db'];var utils=require(_0x9aef('0x6'));var logger=require(_0x9aef('0x7'))(_0x9aef('0x8'));var config=require(_0x9aef('0x9'));var jayson=require(_0x9aef('0xa'));var client=jayson[_0x9aef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3062,_0x49fda5,_0x1e62ce){return new BPromise(function(_0x342ae9,_0x4a6fce){return client[_0x9aef('0xc')](_0x4c3062,_0x1e62ce)[_0x9aef('0xd')](function(_0x10cc06){logger[_0x9aef('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x49fda5,_0x9aef('0xf'));logger[_0x9aef('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x49fda5,_0x9aef('0xf'),JSON[_0x9aef('0x11')](_0x10cc06));if(_0x10cc06[_0x9aef('0x12')]){if(_0x10cc06[_0x9aef('0x12')][_0x9aef('0x13')]===0x1f4){logger[_0x9aef('0x12')](_0x9aef('0x14'),_0x49fda5,_0x10cc06['error'][_0x9aef('0x15')]);return _0x4a6fce(_0x10cc06[_0x9aef('0x12')][_0x9aef('0x15')]);}logger[_0x9aef('0x12')](_0x9aef('0x14'),_0x49fda5,_0x10cc06['error'][_0x9aef('0x15')]);return _0x342ae9(_0x10cc06['error'][_0x9aef('0x15')]);}else{logger[_0x9aef('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x49fda5,_0x9aef('0xf'));_0x342ae9(_0x10cc06[_0x9aef('0x16')][_0x9aef('0x15')]);}})[_0x9aef('0x17')](function(_0x3423d1){logger[_0x9aef('0x12')](_0x9aef('0x14'),_0x49fda5,_0x3423d1);_0x4a6fce(_0x3423d1);});});}exports['GetSugarcrmAccount']=function(_0x2c49c8){var _0x54fd71=this;return new Promise(function(_0x1e9fb1,_0x2c26be){return db['SugarcrmAccount']['findAll']({'raw':_0x2c49c8[_0x9aef('0x18')]?_0x2c49c8[_0x9aef('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2c49c8['options']?_0x2c49c8[_0x9aef('0x18')][_0x9aef('0x19')]||null:null,'attributes':_0x2c49c8['options']?_0x2c49c8[_0x9aef('0x18')][_0x9aef('0x1a')]||null:null,'limit':_0x2c49c8['options']?_0x2c49c8['options'][_0x9aef('0x1b')]||null:null,'include':_0x2c49c8[_0x9aef('0x18')]?_0x2c49c8[_0x9aef('0x18')][_0x9aef('0x1c')]?_['map'](_0x2c49c8[_0x9aef('0x18')]['include'],function(_0x2f8eff){return{'model':db[_0x2f8eff[_0x9aef('0x1d')]],'as':_0x2f8eff['as'],'attributes':_0x2f8eff['attributes'],'include':_0x2f8eff[_0x9aef('0x1c')]?_['map'](_0x2f8eff[_0x9aef('0x1c')],function(_0x4afd69){return{'model':db[_0x4afd69[_0x9aef('0x1d')]],'as':_0x4afd69['as'],'attributes':_0x4afd69[_0x9aef('0x1a')],'include':_0x4afd69[_0x9aef('0x1c')]?_['map'](_0x4afd69[_0x9aef('0x1c')],function(_0x315f02){return{'model':db[_0x315f02[_0x9aef('0x1d')]],'as':_0x315f02['as'],'attributes':_0x315f02[_0x9aef('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac07c){logger[_0x9aef('0xe')]('GetSugarcrmAccount',_0x2c49c8);logger[_0x9aef('0x10')](_0x9aef('0x1e'),_0x2c49c8,JSON['stringify'](_0x4ac07c));_0x1e9fb1(_0x4ac07c);})['catch'](function(_0x4331dd){logger[_0x9aef('0x12')](_0x9aef('0x1e'),_0x4331dd[_0x9aef('0x15')],_0x2c49c8);_0x2c26be(_0x54fd71[_0x9aef('0x12')](0x1f4,_0x4331dd[_0x9aef('0x15')]));});});};exports[_0x9aef('0x1f')]=function(_0x146715){var _0x4960f7=this;return new Promise(function(_0x3b495d,_0x2b951f){return db['SugarcrmAccount'][_0x9aef('0x20')]({'raw':_0x146715['options']?_0x146715[_0x9aef('0x18')][_0x9aef('0x21')]===undefined?!![]:![]:!![],'where':_0x146715[_0x9aef('0x18')]?_0x146715[_0x9aef('0x18')][_0x9aef('0x19')]||null:null,'attributes':_0x146715[_0x9aef('0x18')]?_0x146715[_0x9aef('0x18')][_0x9aef('0x1a')]||null:null,'include':_0x146715['options']?_0x146715[_0x9aef('0x18')][_0x9aef('0x1c')]?_[_0x9aef('0x22')](_0x146715[_0x9aef('0x18')][_0x9aef('0x1c')],function(_0x4cd164){return{'model':db[_0x4cd164['model']],'as':_0x4cd164['as'],'attributes':_0x4cd164[_0x9aef('0x1a')],'include':_0x4cd164[_0x9aef('0x1c')]?_[_0x9aef('0x22')](_0x4cd164[_0x9aef('0x1c')],function(_0x1ec55f){return{'model':db[_0x1ec55f['model']],'as':_0x1ec55f['as'],'attributes':_0x1ec55f['attributes'],'include':_0x1ec55f[_0x9aef('0x1c')]?_[_0x9aef('0x22')](_0x1ec55f[_0x9aef('0x1c')],function(_0x1ac2db){return{'model':db[_0x1ac2db[_0x9aef('0x1d')]],'as':_0x1ac2db['as'],'attributes':_0x1ac2db[_0x9aef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9aef('0xd')](function(_0xa499b8){logger[_0x9aef('0xe')](_0x9aef('0x1f'),_0x146715);logger[_0x9aef('0x10')]('ShowSugarcrmAccount',_0x146715,JSON[_0x9aef('0x11')](_0xa499b8));_0x3b495d(_0xa499b8);})['catch'](function(_0xf1dc3f){logger[_0x9aef('0x12')](_0x9aef('0x1f'),_0xf1dc3f[_0x9aef('0x15')],_0x146715);_0x2b951f(_0x4960f7['error'](0x1f4,_0xf1dc3f[_0x9aef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 53569d6..18d92d3 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 _0x6f54=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','index','/:id','isAuthenticated','show','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f54,0xcf));var _0x46f5=function(_0x270393,_0x29650e){_0x270393=_0x270393-0x0;var _0x4ede29=_0x6f54[_0x270393];return _0x4ede29;};'use strict';var multer=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var path=require(_0x46f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x46f5('0x3')]();var fs_extra=require(_0x46f5('0x4'));var auth=require(_0x46f5('0x5'));var interaction=require(_0x46f5('0x6'));var config=require('../../config/environment');var controller=require(_0x46f5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x46f5('0x8')]);router['get'](_0x46f5('0x9'),auth[_0x46f5('0xa')](),controller[_0x46f5('0xb')]);router[_0x46f5('0xc')](_0x46f5('0xd'),auth[_0x46f5('0xa')](),controller[_0x46f5('0xe')]);router[_0x46f5('0xc')](_0x46f5('0xf'),auth[_0x46f5('0xa')](),controller[_0x46f5('0x10')]);router[_0x46f5('0xc')](_0x46f5('0x11'),auth[_0x46f5('0xa')](),controller['getDescriptions']);router[_0x46f5('0x12')]('/',auth[_0x46f5('0xa')](),controller[_0x46f5('0x13')]);router['put'](_0x46f5('0x9'),auth[_0x46f5('0xa')](),controller['update']);router[_0x46f5('0x14')](_0x46f5('0x9'),auth[_0x46f5('0xa')](),controller[_0x46f5('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb528=['getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x5ea3b1,_0x4b9391){var _0x437942=function(_0x2a0789){while(--_0x2a0789){_0x5ea3b1['push'](_0x5ea3b1['shift']());}};_0x437942(++_0x4b9391);}(_0xb528,0x18e));var _0x8b52=function(_0x448109,_0x571657){_0x448109=_0x448109-0x0;var _0x43d84f=_0xb528[_0x448109];return _0x43d84f;};'use strict';var multer=require(_0x8b52('0x0'));var util=require('util');var path=require(_0x8b52('0x1'));var timeout=require(_0x8b52('0x2'));var express=require('express');var router=express[_0x8b52('0x3')]();var fs_extra=require(_0x8b52('0x4'));var auth=require(_0x8b52('0x5'));var interaction=require(_0x8b52('0x6'));var config=require('../../config/environment');var controller=require(_0x8b52('0x7'));router[_0x8b52('0x8')]('/',auth[_0x8b52('0x9')](),controller[_0x8b52('0xa')]);router[_0x8b52('0x8')](_0x8b52('0xb'),auth['isAuthenticated'](),controller[_0x8b52('0xc')]);router[_0x8b52('0x8')](_0x8b52('0xd'),auth[_0x8b52('0x9')](),controller[_0x8b52('0xe')]);router[_0x8b52('0x8')](_0x8b52('0xf'),auth['isAuthenticated'](),controller[_0x8b52('0x10')]);router[_0x8b52('0x8')](_0x8b52('0x11'),auth[_0x8b52('0x9')](),controller[_0x8b52('0x12')]);router['post']('/',auth[_0x8b52('0x9')](),controller['create']);router[_0x8b52('0x13')](_0x8b52('0xb'),auth[_0x8b52('0x9')](),controller[_0x8b52('0x14')]);router[_0x8b52('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x8b52('0x16')]);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 290478c..e21150f 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 _0x696a=['STRING','exports'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x696a,0x131));var _0xa696=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x696a[_0x36c6eb];return _0x30675b;};'use strict';var Sequelize=require('sequelize');module[_0xa696('0x0')]={'name':{'type':Sequelize[_0xa696('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7e48=['STRING','exports'];(function(_0xbced40,_0x2fa5f0){var _0x230f2e=function(_0xc13c1c){while(--_0xc13c1c){_0xbced40['push'](_0xbced40['shift']());}};_0x230f2e(++_0x2fa5f0);}(_0x7e48,0xf3));var _0x87e4=function(_0x319000,_0x3712af){_0x319000=_0x319000-0x0;var _0x5a2761=_0x7e48[_0x319000];return _0x5a2761;};'use strict';var Sequelize=require('sequelize');module[_0x87e4('0x0')]={'name':{'type':Sequelize[_0x87e4('0x1')]},'description':{'type':Sequelize[_0x87e4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 12b0d46..daea5a6 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 _0x6ccc=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','update','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6ccc,0xdd));var _0xc6cc=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x6ccc[_0x2dea58];return _0x2b23c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6cc('0x0'));var zipdir=require(_0xc6cc('0x1'));var jsonpatch=require(_0xc6cc('0x2'));var rp=require(_0xc6cc('0x3'));var moment=require('moment');var BPromise=require(_0xc6cc('0x4'));var Mustache=require('mustache');var util=require(_0xc6cc('0x5'));var path=require(_0xc6cc('0x6'));var sox=require(_0xc6cc('0x7'));var csv=require(_0xc6cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6cc('0x9'));var _=require('lodash');var squel=require(_0xc6cc('0xa'));var crypto=require(_0xc6cc('0xb'));var jsforce=require(_0xc6cc('0xc'));var deskjs=require(_0xc6cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc6cc('0xe'));var authService=require(_0xc6cc('0xf'));var qs=require(_0xc6cc('0x10'));var as=require(_0xc6cc('0x11'));var hardwareService=require(_0xc6cc('0x12'));var logger=require(_0xc6cc('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc6cc('0x14'));var licenseUtil=require(_0xc6cc('0x15'));var db=require(_0xc6cc('0x16'))['db'];function respondWithStatusCode(_0x446180,_0xafee2e){_0xafee2e=_0xafee2e||0xcc;return function(_0x931c6){if(_0x931c6){return _0x446180[_0xc6cc('0x17')](_0xafee2e);}return _0x446180[_0xc6cc('0x18')](_0xafee2e)[_0xc6cc('0x19')]();};}function respondWithResult(_0x5d3542,_0x2db9e3){_0x2db9e3=_0x2db9e3||0xc8;return function(_0x2f1d76){if(_0x2f1d76){return _0x5d3542[_0xc6cc('0x18')](_0x2db9e3)[_0xc6cc('0x1a')](_0x2f1d76);}};}function respondWithFilteredResult(_0x12475d,_0x5e365c){return function(_0x32029f){if(_0x32029f){var _0x5dea5f=typeof _0x5e365c[_0xc6cc('0x1b')]===_0xc6cc('0x1c')&&typeof _0x5e365c['limit']===_0xc6cc('0x1c');var _0x82b1d=_0x32029f[_0xc6cc('0x1d')];var _0x122437=_0x5dea5f?0x0:_0x5e365c[_0xc6cc('0x1b')];var _0x199818=_0x5dea5f?_0x32029f[_0xc6cc('0x1d')]:_0x5e365c[_0xc6cc('0x1b')]+_0x5e365c[_0xc6cc('0x1e')];var _0x47d51a;if(_0x199818>=_0x82b1d){_0x199818=_0x82b1d;_0x47d51a=0xc8;}else{_0x47d51a=0xce;}_0x12475d[_0xc6cc('0x18')](_0x47d51a);return _0x12475d[_0xc6cc('0x1f')](_0xc6cc('0x20'),_0x122437+'-'+_0x199818+'/'+_0x82b1d)[_0xc6cc('0x1a')](_0x32029f);}return null;};}function patchUpdates(_0x4241cb){return function(_0x134028){try{jsonpatch[_0xc6cc('0x21')](_0x134028,_0x4241cb,!![]);}catch(_0x67e841){return BPromise['reject'](_0x67e841);}return _0x134028['save']();};}function saveUpdates(_0xae65bf,_0x469b4d){return function(_0x4ac6ab){if(_0x4ac6ab){return _0x4ac6ab['update'](_0xae65bf)[_0xc6cc('0x22')](function(_0x1cd683){return _0x1cd683;});}return null;};}function removeEntity(_0x102c6d,_0x3870fa){return function(_0x2b3fb7){if(_0x2b3fb7){return _0x2b3fb7[_0xc6cc('0x23')]()[_0xc6cc('0x22')](function(){_0x102c6d[_0xc6cc('0x18')](0xcc)[_0xc6cc('0x19')]();});}};}function handleEntityNotFound(_0x3c7c0c,_0x245b9d){return function(_0x43b494){if(!_0x43b494){_0x3c7c0c[_0xc6cc('0x17')](0x194);}return _0x43b494;};}function handleError(_0x5948c2,_0x37b162){_0x37b162=_0x37b162||0x1f4;return function(_0x4f582c){logger[_0xc6cc('0x24')](_0x4f582c[_0xc6cc('0x25')]);if(_0x4f582c[_0xc6cc('0x26')]){delete _0x4f582c[_0xc6cc('0x26')];}_0x5948c2[_0xc6cc('0x18')](_0x37b162)[_0xc6cc('0x27')](_0x4f582c);};}exports[_0xc6cc('0x28')]=function(_0x3fb457,_0xdda29a){var _0x4c3fe8={},_0x59cb56={},_0x74be43={'count':0x0,'rows':[]};var _0x4ff28a=_['map'](db[_0xc6cc('0x29')]['rawAttributes'],function(_0x4a2859){return{'name':_0x4a2859[_0xc6cc('0x2a')],'type':_0x4a2859[_0xc6cc('0x2b')][_0xc6cc('0x2c')]};});_0x59cb56[_0xc6cc('0x2d')]=_['map'](_0x4ff28a,_0xc6cc('0x26'));_0x59cb56[_0xc6cc('0x2e')]=_['keys'](_0x3fb457[_0xc6cc('0x2e')]);_0x59cb56['filters']=_[_0xc6cc('0x2f')](_0x59cb56['model'],_0x59cb56[_0xc6cc('0x2e')]);_0x4c3fe8[_0xc6cc('0x30')]=_['intersection'](_0x59cb56[_0xc6cc('0x2d')],qs['fields'](_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x31')]));_0x4c3fe8[_0xc6cc('0x30')]=_0x4c3fe8[_0xc6cc('0x30')][_0xc6cc('0x32')]?_0x4c3fe8[_0xc6cc('0x30')]:_0x59cb56[_0xc6cc('0x2d')];if(!_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x33')](_0xc6cc('0x34'))){_0x4c3fe8[_0xc6cc('0x1e')]=qs['limit'](_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x1e')]);_0x4c3fe8[_0xc6cc('0x1b')]=qs[_0xc6cc('0x1b')](_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x1b')]);}_0x4c3fe8[_0xc6cc('0x35')]=qs['sort'](_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x36')]);_0x4c3fe8[_0xc6cc('0x37')]=qs[_0xc6cc('0x38')](_[_0xc6cc('0x39')](_0x3fb457[_0xc6cc('0x2e')],_0x59cb56[_0xc6cc('0x38')]),_0x4ff28a);if(_0x3fb457[_0xc6cc('0x2e')][_0xc6cc('0x3a')]){_0x4c3fe8['where']=_['merge'](_0x4c3fe8[_0xc6cc('0x37')],{'$or':_[_0xc6cc('0x3b')](_0x4ff28a,function(_0x5a0eb5){if(_0x5a0eb5['type']!==_0xc6cc('0x3c')){var _0x4739d0={};_0x4739d0[_0x5a0eb5['name']]={'$like':'%'+_0x3fb457['query'][_0xc6cc('0x3a')]+'%'};return _0x4739d0;}})});}_0x4c3fe8=_[_0xc6cc('0x3d')]({},_0x4c3fe8,_0x3fb457[_0xc6cc('0x3e')]);var _0x35b9c9={'where':_0x4c3fe8['where']};return db['SugarcrmConfiguration'][_0xc6cc('0x1d')](_0x35b9c9)[_0xc6cc('0x22')](function(_0x2a9d3d){_0x74be43[_0xc6cc('0x1d')]=_0x2a9d3d;if(_0x3fb457['query']['includeAll']){_0x4c3fe8[_0xc6cc('0x3f')]=[{'all':!![]}];}return db[_0xc6cc('0x29')][_0xc6cc('0x40')](_0x4c3fe8);})['then'](function(_0x5b351a){_0x74be43[_0xc6cc('0x41')]=_0x5b351a;return _0x74be43;})[_0xc6cc('0x22')](respondWithFilteredResult(_0xdda29a,_0x4c3fe8))[_0xc6cc('0x42')](handleError(_0xdda29a,null));};exports[_0xc6cc('0x43')]=function(_0x328219,_0x2c293b){var _0x3170bd={'raw':![],'where':{'id':_0x328219[_0xc6cc('0x44')]['id']}},_0x5893a0={};_0x5893a0[_0xc6cc('0x2d')]=_['keys'](db[_0xc6cc('0x29')][_0xc6cc('0x45')]);_0x5893a0[_0xc6cc('0x2e')]=_[_0xc6cc('0x46')](_0x328219[_0xc6cc('0x2e')]);_0x5893a0[_0xc6cc('0x38')]=_[_0xc6cc('0x2f')](_0x5893a0[_0xc6cc('0x2d')],_0x5893a0['query']);_0x3170bd[_0xc6cc('0x30')]=_[_0xc6cc('0x2f')](_0x5893a0[_0xc6cc('0x2d')],qs[_0xc6cc('0x31')](_0x328219['query'][_0xc6cc('0x31')]));_0x3170bd[_0xc6cc('0x30')]=_0x3170bd[_0xc6cc('0x30')][_0xc6cc('0x32')]?_0x3170bd[_0xc6cc('0x30')]:_0x5893a0[_0xc6cc('0x2d')];if(_0x328219['query'][_0xc6cc('0x47')]){_0x3170bd[_0xc6cc('0x3f')]=[{'all':!![]}];}_0x3170bd=_[_0xc6cc('0x3d')]({},_0x3170bd,_0x328219['options']);return db[_0xc6cc('0x29')][_0xc6cc('0x48')](_0x3170bd)[_0xc6cc('0x22')](handleEntityNotFound(_0x2c293b,null))['then'](respondWithResult(_0x2c293b,null))[_0xc6cc('0x42')](handleError(_0x2c293b,null));};exports['create']=function(_0x505d6c,_0xf9aaaf){return db[_0xc6cc('0x29')][_0xc6cc('0x49')](_0x505d6c[_0xc6cc('0x4a')],{})[_0xc6cc('0x22')](respondWithResult(_0xf9aaaf,0xc9))[_0xc6cc('0x42')](handleError(_0xf9aaaf,null));};exports[_0xc6cc('0x4b')]=function(_0x1618ac,_0x51040e){if(_0x1618ac['body']['id']){delete _0x1618ac['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x1618ac['params']['id']}})[_0xc6cc('0x22')](handleEntityNotFound(_0x51040e,null))[_0xc6cc('0x22')](saveUpdates(_0x1618ac[_0xc6cc('0x4a')],null))['then'](respondWithResult(_0x51040e,null))[_0xc6cc('0x42')](handleError(_0x51040e,null));};exports[_0xc6cc('0x23')]=function(_0x242305,_0x2cf2bd){return db[_0xc6cc('0x29')][_0xc6cc('0x48')]({'where':{'id':_0x242305[_0xc6cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cf2bd,null))[_0xc6cc('0x22')](removeEntity(_0x2cf2bd,null))[_0xc6cc('0x42')](handleError(_0x2cf2bd,null));};exports[_0xc6cc('0x4c')]=function(_0x404296,_0x2c9a98,_0x3c9756){var _0x3bb831={};var _0x2fc3ca={};var _0x4b0258;var _0x523469;return db[_0xc6cc('0x29')][_0xc6cc('0x4d')]({'where':{'id':_0x404296[_0xc6cc('0x44')]['id']}})[_0xc6cc('0x22')](handleEntityNotFound(_0x2c9a98,null))[_0xc6cc('0x22')](function(_0x1e0e52){if(_0x1e0e52){_0x4b0258=_0x1e0e52;_0x2fc3ca['model']=_[_0xc6cc('0x46')](db[_0xc6cc('0x4e')][_0xc6cc('0x45')]);_0x2fc3ca[_0xc6cc('0x2e')]=_[_0xc6cc('0x46')](_0x404296[_0xc6cc('0x2e')]);_0x2fc3ca['filters']=_[_0xc6cc('0x2f')](_0x2fc3ca['model'],_0x2fc3ca[_0xc6cc('0x2e')]);_0x3bb831['attributes']=_[_0xc6cc('0x2f')](_0x2fc3ca[_0xc6cc('0x2d')],qs[_0xc6cc('0x31')](_0x404296[_0xc6cc('0x2e')][_0xc6cc('0x31')]));_0x3bb831['attributes']=_0x3bb831[_0xc6cc('0x30')][_0xc6cc('0x32')]?_0x3bb831['attributes']:_0x2fc3ca['model'];_0x3bb831['order']=qs[_0xc6cc('0x36')](_0x404296[_0xc6cc('0x2e')][_0xc6cc('0x36')]);_0x3bb831[_0xc6cc('0x37')]=qs['filters'](_['pick'](_0x404296[_0xc6cc('0x2e')],_0x2fc3ca[_0xc6cc('0x38')]));if(_0x404296[_0xc6cc('0x2e')]['filter']){_0x3bb831[_0xc6cc('0x37')]=_[_0xc6cc('0x3d')](_0x3bb831[_0xc6cc('0x37')],{'$or':_[_0xc6cc('0x3b')](_0x3bb831[_0xc6cc('0x30')],function(_0x27274f){var _0x5419cb={};_0x5419cb[_0x27274f]={'$like':'%'+_0x404296[_0xc6cc('0x2e')]['filter']+'%'};return _0x5419cb;})});}_0x3bb831=_[_0xc6cc('0x3d')]({},_0x3bb831,_0x404296[_0xc6cc('0x3e')]);return _0x4b0258['getFields'](_0x3bb831);}})[_0xc6cc('0x22')](function(_0x5a1b8f){if(_0x5a1b8f){_0x523469=_0x5a1b8f[_0xc6cc('0x32')];if(!_0x404296['query'][_0xc6cc('0x33')]('nolimit')){_0x3bb831[_0xc6cc('0x1e')]=qs[_0xc6cc('0x1e')](_0x404296[_0xc6cc('0x2e')][_0xc6cc('0x1e')]);_0x3bb831[_0xc6cc('0x1b')]=qs[_0xc6cc('0x1b')](_0x404296['query'][_0xc6cc('0x1b')]);}return _0x4b0258[_0xc6cc('0x4c')](_0x3bb831);}})[_0xc6cc('0x22')](function(_0x199939){if(_0x199939){return _0x199939?{'count':_0x523469,'rows':_0x199939}:null;}})['then'](respondWithResult(_0x2c9a98,null))[_0xc6cc('0x42')](handleError(_0x2c9a98,null));};exports['getSubjects']=function(_0x5161e2,_0xb5e350,_0x468cce){var _0x4cb2cb={};var _0x3000f2={};var _0x51c23d;var _0x3583e9;return db[_0xc6cc('0x29')][_0xc6cc('0x4d')]({'where':{'id':_0x5161e2['params']['id']}})['then'](handleEntityNotFound(_0xb5e350,null))[_0xc6cc('0x22')](function(_0x6cff7f){if(_0x6cff7f){_0x51c23d=_0x6cff7f;_0x3000f2[_0xc6cc('0x2d')]=_['keys'](db[_0xc6cc('0x4e')][_0xc6cc('0x45')]);_0x3000f2['query']=_['keys'](_0x5161e2[_0xc6cc('0x2e')]);_0x3000f2[_0xc6cc('0x38')]=_[_0xc6cc('0x2f')](_0x3000f2['model'],_0x3000f2[_0xc6cc('0x2e')]);_0x4cb2cb[_0xc6cc('0x30')]=_['intersection'](_0x3000f2['model'],qs[_0xc6cc('0x31')](_0x5161e2[_0xc6cc('0x2e')]['fields']));_0x4cb2cb[_0xc6cc('0x30')]=_0x4cb2cb['attributes'][_0xc6cc('0x32')]?_0x4cb2cb['attributes']:_0x3000f2[_0xc6cc('0x2d')];_0x4cb2cb[_0xc6cc('0x35')]=qs['sort'](_0x5161e2['query'][_0xc6cc('0x36')]);_0x4cb2cb[_0xc6cc('0x37')]=qs[_0xc6cc('0x38')](_[_0xc6cc('0x39')](_0x5161e2[_0xc6cc('0x2e')],_0x3000f2[_0xc6cc('0x38')]));if(_0x5161e2[_0xc6cc('0x2e')][_0xc6cc('0x3a')]){_0x4cb2cb['where']=_[_0xc6cc('0x3d')](_0x4cb2cb['where'],{'$or':_[_0xc6cc('0x3b')](_0x4cb2cb[_0xc6cc('0x30')],function(_0x3e12a6){var _0xcfcf38={};_0xcfcf38[_0x3e12a6]={'$like':'%'+_0x5161e2[_0xc6cc('0x2e')][_0xc6cc('0x3a')]+'%'};return _0xcfcf38;})});}_0x4cb2cb=_[_0xc6cc('0x3d')]({},_0x4cb2cb,_0x5161e2[_0xc6cc('0x3e')]);return _0x51c23d[_0xc6cc('0x4f')](_0x4cb2cb);}})['then'](function(_0x406aff){if(_0x406aff){_0x3583e9=_0x406aff[_0xc6cc('0x32')];if(!_0x5161e2[_0xc6cc('0x2e')]['hasOwnProperty'](_0xc6cc('0x34'))){_0x4cb2cb[_0xc6cc('0x1e')]=qs[_0xc6cc('0x1e')](_0x5161e2['query'][_0xc6cc('0x1e')]);_0x4cb2cb['offset']=qs[_0xc6cc('0x1b')](_0x5161e2[_0xc6cc('0x2e')][_0xc6cc('0x1b')]);}return _0x51c23d['getSubjects'](_0x4cb2cb);}})['then'](function(_0x10d889){if(_0x10d889){return _0x10d889?{'count':_0x3583e9,'rows':_0x10d889}:null;}})[_0xc6cc('0x22')](respondWithResult(_0xb5e350,null))[_0xc6cc('0x42')](handleError(_0xb5e350,null));};exports[_0xc6cc('0x50')]=function(_0x193e71,_0xac806e,_0x126535){var _0x1904c3={};var _0xf4c6e0={};var _0x3b041a;var _0x2d408a;return db[_0xc6cc('0x29')]['findOne']({'where':{'id':_0x193e71[_0xc6cc('0x44')]['id']}})[_0xc6cc('0x22')](handleEntityNotFound(_0xac806e,null))['then'](function(_0x33d52c){if(_0x33d52c){_0x3b041a=_0x33d52c;_0xf4c6e0[_0xc6cc('0x2d')]=_[_0xc6cc('0x46')](db[_0xc6cc('0x4e')][_0xc6cc('0x45')]);_0xf4c6e0[_0xc6cc('0x2e')]=_[_0xc6cc('0x46')](_0x193e71['query']);_0xf4c6e0[_0xc6cc('0x38')]=_[_0xc6cc('0x2f')](_0xf4c6e0[_0xc6cc('0x2d')],_0xf4c6e0['query']);_0x1904c3[_0xc6cc('0x30')]=_['intersection'](_0xf4c6e0[_0xc6cc('0x2d')],qs[_0xc6cc('0x31')](_0x193e71[_0xc6cc('0x2e')]['fields']));_0x1904c3[_0xc6cc('0x30')]=_0x1904c3[_0xc6cc('0x30')]['length']?_0x1904c3['attributes']:_0xf4c6e0[_0xc6cc('0x2d')];_0x1904c3[_0xc6cc('0x35')]=qs['sort'](_0x193e71[_0xc6cc('0x2e')][_0xc6cc('0x36')]);_0x1904c3[_0xc6cc('0x37')]=qs[_0xc6cc('0x38')](_[_0xc6cc('0x39')](_0x193e71[_0xc6cc('0x2e')],_0xf4c6e0[_0xc6cc('0x38')]));if(_0x193e71[_0xc6cc('0x2e')][_0xc6cc('0x3a')]){_0x1904c3['where']=_[_0xc6cc('0x3d')](_0x1904c3[_0xc6cc('0x37')],{'$or':_[_0xc6cc('0x3b')](_0x1904c3['attributes'],function(_0x5832db){var _0xdd7d5={};_0xdd7d5[_0x5832db]={'$like':'%'+_0x193e71[_0xc6cc('0x2e')][_0xc6cc('0x3a')]+'%'};return _0xdd7d5;})});}_0x1904c3=_['merge']({},_0x1904c3,_0x193e71[_0xc6cc('0x3e')]);return _0x3b041a[_0xc6cc('0x50')](_0x1904c3);}})[_0xc6cc('0x22')](function(_0x259d8b){if(_0x259d8b){_0x2d408a=_0x259d8b[_0xc6cc('0x32')];if(!_0x193e71[_0xc6cc('0x2e')][_0xc6cc('0x33')](_0xc6cc('0x34'))){_0x1904c3[_0xc6cc('0x1e')]=qs[_0xc6cc('0x1e')](_0x193e71['query'][_0xc6cc('0x1e')]);_0x1904c3[_0xc6cc('0x1b')]=qs[_0xc6cc('0x1b')](_0x193e71['query'][_0xc6cc('0x1b')]);}return _0x3b041a['getDescriptions'](_0x1904c3);}})['then'](function(_0x3fd926){if(_0x3fd926){return _0x3fd926?{'count':_0x2d408a,'rows':_0x3fd926}:null;}})['then'](respondWithResult(_0xac806e,null))[_0xc6cc('0x42')](handleError(_0xac806e,null));}; \ No newline at end of file +var _0xd372=['error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','SugarcrmConfiguration','findAll','catch','show','params','intersection','include','merge','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x19a3df,_0x262aab){var _0x31cf65=function(_0x8bad9d){while(--_0x8bad9d){_0x19a3df['push'](_0x19a3df['shift']());}};_0x31cf65(++_0x262aab);}(_0xd372,0x1c2));var _0x2d37=function(_0x587f58,_0x45dd1e){_0x587f58=_0x587f58-0x0;var _0x19f969=_0xd372[_0x587f58];return _0x19f969;};'use strict';var emlformat=require(_0x2d37('0x0'));var rimraf=require(_0x2d37('0x1'));var zipdir=require(_0x2d37('0x2'));var jsonpatch=require(_0x2d37('0x3'));var rp=require(_0x2d37('0x4'));var moment=require(_0x2d37('0x5'));var BPromise=require(_0x2d37('0x6'));var Mustache=require(_0x2d37('0x7'));var util=require(_0x2d37('0x8'));var path=require('path');var sox=require(_0x2d37('0x9'));var csv=require(_0x2d37('0xa'));var ejs=require(_0x2d37('0xb'));var fs=require('fs');var fs_extra=require(_0x2d37('0xc'));var _=require(_0x2d37('0xd'));var squel=require('squel');var crypto=require(_0x2d37('0xe'));var jsforce=require(_0x2d37('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2d37('0x10'));var Papa=require(_0x2d37('0x11'));var Redis=require(_0x2d37('0x12'));var authService=require(_0x2d37('0x13'));var qs=require(_0x2d37('0x14'));var as=require(_0x2d37('0x15'));var hardwareService=require(_0x2d37('0x16'));var logger=require(_0x2d37('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x2d37('0x18'));var licenseUtil=require(_0x2d37('0x19'));var db=require(_0x2d37('0x1a'))['db'];function respondWithStatusCode(_0x18054c,_0x255c93){_0x255c93=_0x255c93||0xcc;return function(_0x42f098){if(_0x42f098){return _0x18054c[_0x2d37('0x1b')](_0x255c93);}return _0x18054c[_0x2d37('0x1c')](_0x255c93)[_0x2d37('0x1d')]();};}function respondWithResult(_0x1f9a92,_0x26d244){_0x26d244=_0x26d244||0xc8;return function(_0x191fd0){if(_0x191fd0){return _0x1f9a92[_0x2d37('0x1c')](_0x26d244)[_0x2d37('0x1e')](_0x191fd0);}};}function respondWithFilteredResult(_0x120b0e,_0x122965){return function(_0x5b283f){if(_0x5b283f){var _0x2b55d2=typeof _0x122965[_0x2d37('0x1f')]===_0x2d37('0x20')&&typeof _0x122965[_0x2d37('0x21')]===_0x2d37('0x20');var _0x284316=_0x5b283f[_0x2d37('0x22')];var _0x21d857=_0x2b55d2?0x0:_0x122965[_0x2d37('0x1f')];var _0x5adff8=_0x2b55d2?_0x5b283f[_0x2d37('0x22')]:_0x122965[_0x2d37('0x1f')]+_0x122965[_0x2d37('0x21')];var _0x914a28;if(_0x5adff8>=_0x284316){_0x5adff8=_0x284316;_0x914a28=0xc8;}else{_0x914a28=0xce;}_0x120b0e[_0x2d37('0x1c')](_0x914a28);return _0x120b0e[_0x2d37('0x23')](_0x2d37('0x24'),_0x21d857+'-'+_0x5adff8+'/'+_0x284316)[_0x2d37('0x1e')](_0x5b283f);}return null;};}function patchUpdates(_0x193701){return function(_0x2c31c6){try{jsonpatch[_0x2d37('0x25')](_0x2c31c6,_0x193701,!![]);}catch(_0x59e359){return BPromise[_0x2d37('0x26')](_0x59e359);}return _0x2c31c6['save']();};}function saveUpdates(_0x9d5d36,_0x4faf80){return function(_0x427c61){if(_0x427c61){return _0x427c61[_0x2d37('0x27')](_0x9d5d36)[_0x2d37('0x28')](function(_0x4edd47){return _0x4edd47;});}return null;};}function removeEntity(_0x4a9b0f,_0x37ca14){return function(_0x191ef6){if(_0x191ef6){return _0x191ef6[_0x2d37('0x29')]()[_0x2d37('0x28')](function(){_0x4a9b0f[_0x2d37('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168966,_0x17fc9d){return function(_0xaa1e60){if(!_0xaa1e60){_0x168966[_0x2d37('0x1b')](0x194);}return _0xaa1e60;};}function handleError(_0x1a34cf,_0xde9bd1){_0xde9bd1=_0xde9bd1||0x1f4;return function(_0x26e6eb){logger[_0x2d37('0x2a')](_0x26e6eb[_0x2d37('0x2b')]);if(_0x26e6eb[_0x2d37('0x2c')]){delete _0x26e6eb[_0x2d37('0x2c')];}_0x1a34cf['status'](_0xde9bd1)[_0x2d37('0x2d')](_0x26e6eb);};}exports[_0x2d37('0x2e')]=function(_0x305eec,_0x2f2bb7){var _0x25fda0={},_0x593336={},_0x32fbaa={'count':0x0,'rows':[]};var _0x29dc8a=_[_0x2d37('0x2f')](db['SugarcrmConfiguration'][_0x2d37('0x30')],function(_0x2a6a9d){return{'name':_0x2a6a9d[_0x2d37('0x31')],'type':_0x2a6a9d['type'][_0x2d37('0x32')]};});_0x593336['model']=_[_0x2d37('0x2f')](_0x29dc8a,_0x2d37('0x2c'));_0x593336[_0x2d37('0x33')]=_[_0x2d37('0x34')](_0x305eec[_0x2d37('0x33')]);_0x593336['filters']=_['intersection'](_0x593336[_0x2d37('0x35')],_0x593336[_0x2d37('0x33')]);_0x25fda0[_0x2d37('0x36')]=_['intersection'](_0x593336[_0x2d37('0x35')],qs['fields'](_0x305eec['query'][_0x2d37('0x37')]));_0x25fda0[_0x2d37('0x36')]=_0x25fda0['attributes'][_0x2d37('0x38')]?_0x25fda0[_0x2d37('0x36')]:_0x593336[_0x2d37('0x35')];if(!_0x305eec[_0x2d37('0x33')][_0x2d37('0x39')](_0x2d37('0x3a'))){_0x25fda0[_0x2d37('0x21')]=qs[_0x2d37('0x21')](_0x305eec[_0x2d37('0x33')][_0x2d37('0x21')]);_0x25fda0[_0x2d37('0x1f')]=qs[_0x2d37('0x1f')](_0x305eec[_0x2d37('0x33')]['offset']);}_0x25fda0[_0x2d37('0x3b')]=qs[_0x2d37('0x3c')](_0x305eec[_0x2d37('0x33')][_0x2d37('0x3c')]);_0x25fda0[_0x2d37('0x3d')]=qs[_0x2d37('0x3e')](_[_0x2d37('0x3f')](_0x305eec[_0x2d37('0x33')],_0x593336['filters']),_0x29dc8a);if(_0x305eec[_0x2d37('0x33')][_0x2d37('0x40')]){_0x25fda0['where']=_['merge'](_0x25fda0['where'],{'$or':_[_0x2d37('0x2f')](_0x29dc8a,function(_0x71de0d){if(_0x71de0d['type']!=='VIRTUAL'){var _0x5862f1={};_0x5862f1[_0x71de0d[_0x2d37('0x2c')]]={'$like':'%'+_0x305eec[_0x2d37('0x33')][_0x2d37('0x40')]+'%'};return _0x5862f1;}})});}_0x25fda0=_['merge']({},_0x25fda0,_0x305eec[_0x2d37('0x41')]);var _0x2de21f={'where':_0x25fda0[_0x2d37('0x3d')]};return db['SugarcrmConfiguration'][_0x2d37('0x22')](_0x2de21f)[_0x2d37('0x28')](function(_0x2934c2){_0x32fbaa[_0x2d37('0x22')]=_0x2934c2;if(_0x305eec[_0x2d37('0x33')][_0x2d37('0x42')]){_0x25fda0['include']=[{'all':!![]}];}return db[_0x2d37('0x43')][_0x2d37('0x44')](_0x25fda0);})[_0x2d37('0x28')](function(_0x1d301e){_0x32fbaa['rows']=_0x1d301e;return _0x32fbaa;})['then'](respondWithFilteredResult(_0x2f2bb7,_0x25fda0))[_0x2d37('0x45')](handleError(_0x2f2bb7,null));};exports[_0x2d37('0x46')]=function(_0x45e211,_0x295747){var _0x4c4105={'raw':![],'where':{'id':_0x45e211[_0x2d37('0x47')]['id']}},_0x206cf7={};_0x206cf7[_0x2d37('0x35')]=_[_0x2d37('0x34')](db[_0x2d37('0x43')][_0x2d37('0x30')]);_0x206cf7['query']=_[_0x2d37('0x34')](_0x45e211['query']);_0x206cf7[_0x2d37('0x3e')]=_[_0x2d37('0x48')](_0x206cf7[_0x2d37('0x35')],_0x206cf7['query']);_0x4c4105[_0x2d37('0x36')]=_[_0x2d37('0x48')](_0x206cf7[_0x2d37('0x35')],qs[_0x2d37('0x37')](_0x45e211[_0x2d37('0x33')][_0x2d37('0x37')]));_0x4c4105[_0x2d37('0x36')]=_0x4c4105[_0x2d37('0x36')][_0x2d37('0x38')]?_0x4c4105[_0x2d37('0x36')]:_0x206cf7['model'];if(_0x45e211['query'][_0x2d37('0x42')]){_0x4c4105[_0x2d37('0x49')]=[{'all':!![]}];}_0x4c4105=_[_0x2d37('0x4a')]({},_0x4c4105,_0x45e211[_0x2d37('0x41')]);return db[_0x2d37('0x43')]['find'](_0x4c4105)[_0x2d37('0x28')](handleEntityNotFound(_0x295747,null))['then'](respondWithResult(_0x295747,null))['catch'](handleError(_0x295747,null));};exports[_0x2d37('0x4b')]=function(_0x299229,_0x463105){return db['SugarcrmConfiguration'][_0x2d37('0x4b')](_0x299229['body'],{})[_0x2d37('0x28')](respondWithResult(_0x463105,0xc9))['catch'](handleError(_0x463105,null));};exports[_0x2d37('0x27')]=function(_0x5f1898,_0x3314bc){if(_0x5f1898[_0x2d37('0x4c')]['id']){delete _0x5f1898['body']['id'];}return db[_0x2d37('0x43')]['find']({'where':{'id':_0x5f1898[_0x2d37('0x47')]['id']}})['then'](handleEntityNotFound(_0x3314bc,null))[_0x2d37('0x28')](saveUpdates(_0x5f1898[_0x2d37('0x4c')],null))[_0x2d37('0x28')](respondWithResult(_0x3314bc,null))[_0x2d37('0x45')](handleError(_0x3314bc,null));};exports[_0x2d37('0x29')]=function(_0x31d751,_0x523f14){return db[_0x2d37('0x43')]['find']({'where':{'id':_0x31d751['params']['id']}})[_0x2d37('0x28')](handleEntityNotFound(_0x523f14,null))[_0x2d37('0x28')](removeEntity(_0x523f14,null))[_0x2d37('0x45')](handleError(_0x523f14,null));};exports[_0x2d37('0x4d')]=function(_0x336e62,_0x46b6b5,_0x528243){var _0x24e683={};var _0x4b79dc={};var _0x1eb43a;var _0x3c346e;return db['SugarcrmConfiguration'][_0x2d37('0x4e')]({'where':{'id':_0x336e62['params']['id']}})[_0x2d37('0x28')](handleEntityNotFound(_0x46b6b5,null))[_0x2d37('0x28')](function(_0x47a4e1){if(_0x47a4e1){_0x1eb43a=_0x47a4e1;_0x4b79dc[_0x2d37('0x35')]=_[_0x2d37('0x34')](db[_0x2d37('0x4f')][_0x2d37('0x30')]);_0x4b79dc[_0x2d37('0x33')]=_[_0x2d37('0x34')](_0x336e62[_0x2d37('0x33')]);_0x4b79dc[_0x2d37('0x3e')]=_['intersection'](_0x4b79dc[_0x2d37('0x35')],_0x4b79dc[_0x2d37('0x33')]);_0x24e683['attributes']=_['intersection'](_0x4b79dc['model'],qs[_0x2d37('0x37')](_0x336e62[_0x2d37('0x33')][_0x2d37('0x37')]));_0x24e683[_0x2d37('0x36')]=_0x24e683[_0x2d37('0x36')]['length']?_0x24e683['attributes']:_0x4b79dc[_0x2d37('0x35')];_0x24e683[_0x2d37('0x3b')]=qs[_0x2d37('0x3c')](_0x336e62[_0x2d37('0x33')][_0x2d37('0x3c')]);_0x24e683['where']=qs[_0x2d37('0x3e')](_[_0x2d37('0x3f')](_0x336e62[_0x2d37('0x33')],_0x4b79dc[_0x2d37('0x3e')]));if(_0x336e62[_0x2d37('0x33')][_0x2d37('0x40')]){_0x24e683[_0x2d37('0x3d')]=_[_0x2d37('0x4a')](_0x24e683[_0x2d37('0x3d')],{'$or':_[_0x2d37('0x2f')](_0x24e683[_0x2d37('0x36')],function(_0x5acfa3){var _0x50ca0e={};_0x50ca0e[_0x5acfa3]={'$like':'%'+_0x336e62[_0x2d37('0x33')][_0x2d37('0x40')]+'%'};return _0x50ca0e;})});}_0x24e683=_[_0x2d37('0x4a')]({},_0x24e683,_0x336e62['options']);return _0x1eb43a[_0x2d37('0x4d')](_0x24e683);}})['then'](function(_0x52bec0){if(_0x52bec0){_0x3c346e=_0x52bec0[_0x2d37('0x38')];if(!_0x336e62['query'][_0x2d37('0x39')](_0x2d37('0x3a'))){_0x24e683[_0x2d37('0x21')]=qs[_0x2d37('0x21')](_0x336e62['query'][_0x2d37('0x21')]);_0x24e683[_0x2d37('0x1f')]=qs[_0x2d37('0x1f')](_0x336e62[_0x2d37('0x33')]['offset']);}return _0x1eb43a[_0x2d37('0x4d')](_0x24e683);}})[_0x2d37('0x28')](function(_0x2e1dad){if(_0x2e1dad){return _0x2e1dad?{'count':_0x3c346e,'rows':_0x2e1dad}:null;}})[_0x2d37('0x28')](respondWithResult(_0x46b6b5,null))[_0x2d37('0x45')](handleError(_0x46b6b5,null));};exports[_0x2d37('0x50')]=function(_0x1c27d0,_0xd4038f,_0x32e363){var _0x21c047={};var _0x44856e={};var _0x5e2c10;var _0x5800ca;return db[_0x2d37('0x43')][_0x2d37('0x4e')]({'where':{'id':_0x1c27d0[_0x2d37('0x47')]['id']}})['then'](handleEntityNotFound(_0xd4038f,null))[_0x2d37('0x28')](function(_0x4cd0d4){if(_0x4cd0d4){_0x5e2c10=_0x4cd0d4;_0x44856e[_0x2d37('0x35')]=_['keys'](db[_0x2d37('0x4f')][_0x2d37('0x30')]);_0x44856e[_0x2d37('0x33')]=_[_0x2d37('0x34')](_0x1c27d0['query']);_0x44856e[_0x2d37('0x3e')]=_[_0x2d37('0x48')](_0x44856e[_0x2d37('0x35')],_0x44856e['query']);_0x21c047[_0x2d37('0x36')]=_['intersection'](_0x44856e[_0x2d37('0x35')],qs['fields'](_0x1c27d0[_0x2d37('0x33')][_0x2d37('0x37')]));_0x21c047[_0x2d37('0x36')]=_0x21c047[_0x2d37('0x36')][_0x2d37('0x38')]?_0x21c047[_0x2d37('0x36')]:_0x44856e[_0x2d37('0x35')];_0x21c047[_0x2d37('0x3b')]=qs[_0x2d37('0x3c')](_0x1c27d0['query']['sort']);_0x21c047[_0x2d37('0x3d')]=qs[_0x2d37('0x3e')](_[_0x2d37('0x3f')](_0x1c27d0['query'],_0x44856e['filters']));if(_0x1c27d0[_0x2d37('0x33')][_0x2d37('0x40')]){_0x21c047[_0x2d37('0x3d')]=_['merge'](_0x21c047[_0x2d37('0x3d')],{'$or':_['map'](_0x21c047[_0x2d37('0x36')],function(_0x2d2de1){var _0x31dad8={};_0x31dad8[_0x2d2de1]={'$like':'%'+_0x1c27d0['query'][_0x2d37('0x40')]+'%'};return _0x31dad8;})});}_0x21c047=_[_0x2d37('0x4a')]({},_0x21c047,_0x1c27d0['options']);return _0x5e2c10['getSubjects'](_0x21c047);}})['then'](function(_0x3d6e60){if(_0x3d6e60){_0x5800ca=_0x3d6e60[_0x2d37('0x38')];if(!_0x1c27d0[_0x2d37('0x33')][_0x2d37('0x39')]('nolimit')){_0x21c047[_0x2d37('0x21')]=qs[_0x2d37('0x21')](_0x1c27d0[_0x2d37('0x33')][_0x2d37('0x21')]);_0x21c047[_0x2d37('0x1f')]=qs[_0x2d37('0x1f')](_0x1c27d0['query'][_0x2d37('0x1f')]);}return _0x5e2c10[_0x2d37('0x50')](_0x21c047);}})[_0x2d37('0x28')](function(_0x337c14){if(_0x337c14){return _0x337c14?{'count':_0x5800ca,'rows':_0x337c14}:null;}})['then'](respondWithResult(_0xd4038f,null))['catch'](handleError(_0xd4038f,null));};exports[_0x2d37('0x51')]=function(_0x2fa02d,_0x4348b1,_0x3b8206){var _0x7a9dcc={};var _0x190d66={};var _0x1bbd46;var _0x4cb204;return db[_0x2d37('0x43')][_0x2d37('0x4e')]({'where':{'id':_0x2fa02d[_0x2d37('0x47')]['id']}})[_0x2d37('0x28')](handleEntityNotFound(_0x4348b1,null))['then'](function(_0x31f2f6){if(_0x31f2f6){_0x1bbd46=_0x31f2f6;_0x190d66[_0x2d37('0x35')]=_['keys'](db['SugarcrmField'][_0x2d37('0x30')]);_0x190d66[_0x2d37('0x33')]=_[_0x2d37('0x34')](_0x2fa02d[_0x2d37('0x33')]);_0x190d66['filters']=_[_0x2d37('0x48')](_0x190d66[_0x2d37('0x35')],_0x190d66[_0x2d37('0x33')]);_0x7a9dcc['attributes']=_[_0x2d37('0x48')](_0x190d66[_0x2d37('0x35')],qs[_0x2d37('0x37')](_0x2fa02d['query'][_0x2d37('0x37')]));_0x7a9dcc[_0x2d37('0x36')]=_0x7a9dcc[_0x2d37('0x36')][_0x2d37('0x38')]?_0x7a9dcc[_0x2d37('0x36')]:_0x190d66[_0x2d37('0x35')];_0x7a9dcc[_0x2d37('0x3b')]=qs[_0x2d37('0x3c')](_0x2fa02d['query'][_0x2d37('0x3c')]);_0x7a9dcc['where']=qs[_0x2d37('0x3e')](_[_0x2d37('0x3f')](_0x2fa02d[_0x2d37('0x33')],_0x190d66['filters']));if(_0x2fa02d['query'][_0x2d37('0x40')]){_0x7a9dcc[_0x2d37('0x3d')]=_[_0x2d37('0x4a')](_0x7a9dcc[_0x2d37('0x3d')],{'$or':_['map'](_0x7a9dcc[_0x2d37('0x36')],function(_0x1edc09){var _0x1609c7={};_0x1609c7[_0x1edc09]={'$like':'%'+_0x2fa02d[_0x2d37('0x33')][_0x2d37('0x40')]+'%'};return _0x1609c7;})});}_0x7a9dcc=_[_0x2d37('0x4a')]({},_0x7a9dcc,_0x2fa02d[_0x2d37('0x41')]);return _0x1bbd46[_0x2d37('0x51')](_0x7a9dcc);}})[_0x2d37('0x28')](function(_0x5000da){if(_0x5000da){_0x4cb204=_0x5000da[_0x2d37('0x38')];if(!_0x2fa02d[_0x2d37('0x33')][_0x2d37('0x39')](_0x2d37('0x3a'))){_0x7a9dcc[_0x2d37('0x21')]=qs[_0x2d37('0x21')](_0x2fa02d[_0x2d37('0x33')][_0x2d37('0x21')]);_0x7a9dcc['offset']=qs['offset'](_0x2fa02d['query'][_0x2d37('0x1f')]);}return _0x1bbd46[_0x2d37('0x51')](_0x7a9dcc);}})[_0x2d37('0x28')](function(_0x12d288){if(_0x12d288){return _0x12d288?{'count':_0x4cb204,'rows':_0x12d288}:null;}})[_0x2d37('0x28')](respondWithResult(_0x4348b1,null))['catch'](handleError(_0x4348b1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 0c332d7..f5d1909 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 _0x333d=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2b9ac8,_0xf820cb){var _0x3ceea9=function(_0x407d34){while(--_0x407d34){_0x2b9ac8['push'](_0x2b9ac8['shift']());}};_0x3ceea9(++_0xf820cb);}(_0x333d,0x137));var _0xd333=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x333d[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0xd333('0x0'));var util=require(_0xd333('0x1'));var logger=require(_0xd333('0x2'))(_0xd333('0x3'));var moment=require(_0xd333('0x4'));var BPromise=require('bluebird');var rp=require(_0xd333('0x5'));var fs=require('fs');var path=require(_0xd333('0x6'));var rimraf=require(_0xd333('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xd333('0x8')]=function(_0x12d8ef,_0x57dd4d){return _0x12d8ef['define'](_0xd333('0x9'),attributes,{'tableName':_0xd333('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df9=['request-promise','path','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1273bb,_0x193a23){var _0x107662=function(_0x249be5){while(--_0x249be5){_0x1273bb['push'](_0x1273bb['shift']());}};_0x107662(++_0x193a23);}(_0x6df9,0x19e));var _0x96df=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6df9[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var logger=require(_0x96df('0x2'))(_0x96df('0x3'));var moment=require(_0x96df('0x4'));var BPromise=require(_0x96df('0x5'));var rp=require(_0x96df('0x6'));var fs=require('fs');var path=require(_0x96df('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x96df('0x8'));module[_0x96df('0x9')]=function(_0x480850,_0x549f0d){return _0x480850[_0x96df('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x96df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 860950e..a489aba 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 _0x64f0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0x64f0,0x144));var _0x064f=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x64f0[_0x5a7d41];return _0x98d8fa;};'use strict';var _=require(_0x064f('0x0'));var util=require(_0x064f('0x1'));var moment=require('moment');var BPromise=require(_0x064f('0x2'));var rs=require(_0x064f('0x3'));var fs=require('fs');var Redis=require(_0x064f('0x4'));var db=require(_0x064f('0x5'))['db'];var utils=require(_0x064f('0x6'));var logger=require(_0x064f('0x7'))('rpc');var config=require(_0x064f('0x8'));var jayson=require(_0x064f('0x9'));var client=jayson[_0x064f('0xa')][_0x064f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea541c,_0x1bda12,_0x4eed1a){return new BPromise(function(_0x29e88a,_0x779a7){return client[_0x064f('0xc')](_0xea541c,_0x4eed1a)[_0x064f('0xd')](function(_0x8244e3){logger['info'](_0x064f('0xe'),_0x1bda12,_0x064f('0xf'));logger[_0x064f('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1bda12,_0x064f('0xf'),JSON[_0x064f('0x11')](_0x8244e3));if(_0x8244e3['error']){if(_0x8244e3[_0x064f('0x12')][_0x064f('0x13')]===0x1f4){logger['error'](_0x064f('0xe'),_0x1bda12,_0x8244e3[_0x064f('0x12')][_0x064f('0x14')]);return _0x779a7(_0x8244e3[_0x064f('0x12')][_0x064f('0x14')]);}logger[_0x064f('0x12')](_0x064f('0xe'),_0x1bda12,_0x8244e3['error'][_0x064f('0x14')]);return _0x29e88a(_0x8244e3[_0x064f('0x12')]['message']);}else{logger['info'](_0x064f('0xe'),_0x1bda12,'request\x20sent');_0x29e88a(_0x8244e3[_0x064f('0x15')]['message']);}})['catch'](function(_0x162745){logger['error'](_0x064f('0xe'),_0x1bda12,_0x162745);_0x779a7(_0x162745);});});} \ No newline at end of file +var _0xa8be=['jayson/promise','client','request','then','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0x4f401e,_0x50f382){var _0xa5ad63=function(_0x552a6c){while(--_0x552a6c){_0x4f401e['push'](_0x4f401e['shift']());}};_0xa5ad63(++_0x50f382);}(_0xa8be,0x86));var _0xea8b=function(_0x4d5eca,_0x524a79){_0x4d5eca=_0x4d5eca-0x0;var _0x22d61d=_0xa8be[_0x4d5eca];return _0x22d61d;};'use strict';var _=require(_0xea8b('0x0'));var util=require(_0xea8b('0x1'));var moment=require(_0xea8b('0x2'));var BPromise=require('bluebird');var rs=require(_0xea8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea8b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xea8b('0x5'));var jayson=require(_0xea8b('0x6'));var client=jayson[_0xea8b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a13b5,_0x2b977a,_0x17a35e){return new BPromise(function(_0x2cb132,_0x3e575d){return client[_0xea8b('0x8')](_0x1a13b5,_0x17a35e)[_0xea8b('0x9')](function(_0x512d4d){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b977a,'request\x20sent');logger[_0xea8b('0xa')](_0xea8b('0xb'),_0x2b977a,_0xea8b('0xc'),JSON['stringify'](_0x512d4d));if(_0x512d4d[_0xea8b('0xd')]){if(_0x512d4d['error'][_0xea8b('0xe')]===0x1f4){logger[_0xea8b('0xd')](_0xea8b('0xf'),_0x2b977a,_0x512d4d[_0xea8b('0xd')][_0xea8b('0x10')]);return _0x3e575d(_0x512d4d[_0xea8b('0xd')][_0xea8b('0x10')]);}logger[_0xea8b('0xd')](_0xea8b('0xf'),_0x2b977a,_0x512d4d[_0xea8b('0xd')][_0xea8b('0x10')]);return _0x2cb132(_0x512d4d['error'][_0xea8b('0x10')]);}else{logger[_0xea8b('0x11')](_0xea8b('0xf'),_0x2b977a,_0xea8b('0xc'));_0x2cb132(_0x512d4d[_0xea8b('0x12')][_0xea8b('0x10')]);}})[_0xea8b('0x13')](function(_0x5620b4){logger[_0xea8b('0xd')](_0xea8b('0xf'),_0x2b977a,_0x5620b4);_0x3e575d(_0x5620b4);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e6588ef..b298e6f 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 _0xf0e5=['put','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xf0e5,0x1a2));var _0x5f0e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf0e5[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x5f0e('0x0'));var util=require(_0x5f0e('0x1'));var path=require('path');var timeout=require(_0x5f0e('0x2'));var express=require(_0x5f0e('0x3'));var router=express[_0x5f0e('0x4')]();var fs_extra=require(_0x5f0e('0x5'));var auth=require(_0x5f0e('0x6'));var interaction=require(_0x5f0e('0x7'));var config=require(_0x5f0e('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x5f0e('0x9')]('/',auth[_0x5f0e('0xa')](),controller[_0x5f0e('0xb')]);router[_0x5f0e('0x9')](_0x5f0e('0xc'),auth[_0x5f0e('0xa')](),controller[_0x5f0e('0xd')]);router['post']('/',auth[_0x5f0e('0xa')](),controller['create']);router[_0x5f0e('0xe')](_0x5f0e('0xc'),auth[_0x5f0e('0xa')](),controller['update']);router['delete'](_0x5f0e('0xc'),auth[_0x5f0e('0xa')](),controller[_0x5f0e('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3bc9=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','util'];(function(_0x22e9b1,_0x2b4689){var _0x1515e0=function(_0x4db38a){while(--_0x4db38a){_0x22e9b1['push'](_0x22e9b1['shift']());}};_0x1515e0(++_0x2b4689);}(_0x3bc9,0x143));var _0x93bc=function(_0x105595,_0xf44fe5){_0x105595=_0x105595-0x0;var _0x2535af=_0x3bc9[_0x105595];return _0x2535af;};'use strict';var multer=require('multer');var util=require(_0x93bc('0x0'));var path=require(_0x93bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x93bc('0x2'));var router=express['Router']();var fs_extra=require(_0x93bc('0x3'));var auth=require(_0x93bc('0x4'));var interaction=require(_0x93bc('0x5'));var config=require(_0x93bc('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x93bc('0x7')]('/',auth['isAuthenticated'](),controller[_0x93bc('0x8')]);router[_0x93bc('0x7')]('/:id',auth[_0x93bc('0x9')](),controller['show']);router[_0x93bc('0xa')]('/',auth[_0x93bc('0x9')](),controller[_0x93bc('0xb')]);router[_0x93bc('0xc')](_0x93bc('0xd'),auth['isAuthenticated'](),controller[_0x93bc('0xe')]);router[_0x93bc('0xf')](_0x93bc('0xd'),auth['isAuthenticated'](),controller[_0x93bc('0x10')]);module[_0x93bc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9561366..6c10671 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 _0x2c00=['BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable'];(function(_0x4c72a0,_0x5c7867){var _0x42ac21=function(_0x1d272d){while(--_0x1d272d){_0x4c72a0['push'](_0x4c72a0['shift']());}};_0x42ac21(++_0x5c7867);}(_0x2c00,0x79));var _0x02c0=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x2c00[_0x58eec7];return _0x25c5d3;};'use strict';var Sequelize=require(_0x02c0('0x0'));module[_0x02c0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x02c0('0x2'),'variable',_0x02c0('0x3'),_0x02c0('0x4'),_0x02c0('0x5')),'defaultValue':_0x02c0('0x2')},'content':{'type':Sequelize[_0x02c0('0x6')]},'key':{'type':Sequelize[_0x02c0('0x6')]},'keyType':{'type':Sequelize[_0x02c0('0x7')]('string',_0x02c0('0x8'),_0x02c0('0x3'))},'keyContent':{'type':Sequelize[_0x02c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x02c0('0x6')]},'customField':{'type':Sequelize[_0x02c0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02c0('0x6')]}}; \ No newline at end of file +var _0x55a0=['picklist','string','STRING','variable','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x55a0,0x11b));var _0x055a=function(_0x24c972,_0x5c0631){_0x24c972=_0x24c972-0x0;var _0xc8152c=_0x55a0[_0x24c972];return _0xc8152c;};'use strict';var Sequelize=require(_0x055a('0x0'));module[_0x055a('0x1')]={'type':{'type':Sequelize[_0x055a('0x2')]('string','variable',_0x055a('0x3'),_0x055a('0x4'),_0x055a('0x5')),'defaultValue':_0x055a('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x055a('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x055a('0x8'),_0x055a('0x3'))},'keyContent':{'type':Sequelize[_0x055a('0x7')]},'idField':{'type':Sequelize[_0x055a('0x7')]},'nameField':{'type':Sequelize[_0x055a('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c781757..2b6fa4c 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 _0x94c7=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x18029a,_0x104d32){var _0x198420=function(_0x5695a8){while(--_0x5695a8){_0x18029a['push'](_0x18029a['shift']());}};_0x198420(++_0x104d32);}(_0x94c7,0x1b9));var _0x794c=function(_0x306e42,_0x1639af){_0x306e42=_0x306e42-0x0;var _0xa0ff27=_0x94c7[_0x306e42];return _0xa0ff27;};'use strict';var emlformat=require(_0x794c('0x0'));var rimraf=require(_0x794c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x794c('0x2'));var BPromise=require(_0x794c('0x3'));var Mustache=require(_0x794c('0x4'));var util=require(_0x794c('0x5'));var path=require(_0x794c('0x6'));var sox=require(_0x794c('0x7'));var csv=require(_0x794c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x794c('0x9'));var _=require(_0x794c('0xa'));var squel=require(_0x794c('0xb'));var crypto=require(_0x794c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x794c('0xd'));var toCsv=require(_0x794c('0x8'));var querystring=require(_0x794c('0xe'));var Papa=require(_0x794c('0xf'));var Redis=require(_0x794c('0x10'));var authService=require(_0x794c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x794c('0x12'));var hardwareService=require(_0x794c('0x13'));var logger=require(_0x794c('0x14'))(_0x794c('0x15'));var utils=require(_0x794c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x794c('0x17'))['db'];function respondWithStatusCode(_0x38d42b,_0x39b68a){_0x39b68a=_0x39b68a||0xcc;return function(_0x30b851){if(_0x30b851){return _0x38d42b['sendStatus'](_0x39b68a);}return _0x38d42b['status'](_0x39b68a)['end']();};}function respondWithResult(_0x8d9d2c,_0x2771e3){_0x2771e3=_0x2771e3||0xc8;return function(_0x5209bd){if(_0x5209bd){return _0x8d9d2c['status'](_0x2771e3)[_0x794c('0x18')](_0x5209bd);}};}function respondWithFilteredResult(_0x34ff41,_0x423ddd){return function(_0x1e1425){if(_0x1e1425){var _0x385f24=typeof _0x423ddd[_0x794c('0x19')]===_0x794c('0x1a')&&typeof _0x423ddd[_0x794c('0x1b')]==='undefined';var _0x2ee738=_0x1e1425[_0x794c('0x1c')];var _0x217160=_0x385f24?0x0:_0x423ddd[_0x794c('0x19')];var _0x15f3ec=_0x385f24?_0x1e1425[_0x794c('0x1c')]:_0x423ddd[_0x794c('0x19')]+_0x423ddd[_0x794c('0x1b')];var _0xa42ce4;if(_0x15f3ec>=_0x2ee738){_0x15f3ec=_0x2ee738;_0xa42ce4=0xc8;}else{_0xa42ce4=0xce;}_0x34ff41[_0x794c('0x1d')](_0xa42ce4);return _0x34ff41['set'](_0x794c('0x1e'),_0x217160+'-'+_0x15f3ec+'/'+_0x2ee738)[_0x794c('0x18')](_0x1e1425);}return null;};}function patchUpdates(_0x37a9db){return function(_0x966827){try{jsonpatch[_0x794c('0x1f')](_0x966827,_0x37a9db,!![]);}catch(_0x2ca389){return BPromise[_0x794c('0x20')](_0x2ca389);}return _0x966827[_0x794c('0x21')]();};}function saveUpdates(_0x19bfb3,_0x4bf040){return function(_0x544e4b){if(_0x544e4b){return _0x544e4b[_0x794c('0x22')](_0x19bfb3)[_0x794c('0x23')](function(_0x415665){return _0x415665;});}return null;};}function removeEntity(_0x3bff74,_0x3587bc){return function(_0x11050f){if(_0x11050f){return _0x11050f[_0x794c('0x24')]()[_0x794c('0x23')](function(){_0x3bff74['status'](0xcc)[_0x794c('0x25')]();});}};}function handleEntityNotFound(_0x57d9ea,_0x47814f){return function(_0x1c1ac7){if(!_0x1c1ac7){_0x57d9ea['sendStatus'](0x194);}return _0x1c1ac7;};}function handleError(_0xa3ad40,_0x5e637f){_0x5e637f=_0x5e637f||0x1f4;return function(_0x41f316){logger['error'](_0x41f316[_0x794c('0x26')]);if(_0x41f316[_0x794c('0x27')]){delete _0x41f316[_0x794c('0x27')];}_0xa3ad40[_0x794c('0x1d')](_0x5e637f)[_0x794c('0x28')](_0x41f316);};}exports[_0x794c('0x29')]=function(_0x4ffb45,_0xb55e2e){var _0xb6b1da={},_0x8e5f91={},_0x53367f={'count':0x0,'rows':[]};var _0x310fa9=_[_0x794c('0x2a')](db['SugarcrmField'][_0x794c('0x2b')],function(_0x369d09){return{'name':_0x369d09[_0x794c('0x2c')],'type':_0x369d09[_0x794c('0x2d')][_0x794c('0x2e')]};});_0x8e5f91[_0x794c('0x2f')]=_[_0x794c('0x2a')](_0x310fa9,_0x794c('0x27'));_0x8e5f91[_0x794c('0x30')]=_[_0x794c('0x31')](_0x4ffb45[_0x794c('0x30')]);_0x8e5f91[_0x794c('0x32')]=_['intersection'](_0x8e5f91[_0x794c('0x2f')],_0x8e5f91[_0x794c('0x30')]);_0xb6b1da[_0x794c('0x33')]=_[_0x794c('0x34')](_0x8e5f91[_0x794c('0x2f')],qs[_0x794c('0x35')](_0x4ffb45[_0x794c('0x30')]['fields']));_0xb6b1da[_0x794c('0x33')]=_0xb6b1da[_0x794c('0x33')][_0x794c('0x36')]?_0xb6b1da[_0x794c('0x33')]:_0x8e5f91[_0x794c('0x2f')];if(!_0x4ffb45['query'][_0x794c('0x37')](_0x794c('0x38'))){_0xb6b1da[_0x794c('0x1b')]=qs[_0x794c('0x1b')](_0x4ffb45[_0x794c('0x30')][_0x794c('0x1b')]);_0xb6b1da[_0x794c('0x19')]=qs[_0x794c('0x19')](_0x4ffb45['query']['offset']);}_0xb6b1da[_0x794c('0x39')]=qs[_0x794c('0x3a')](_0x4ffb45[_0x794c('0x30')]['sort']);_0xb6b1da[_0x794c('0x3b')]=qs[_0x794c('0x32')](_[_0x794c('0x3c')](_0x4ffb45[_0x794c('0x30')],_0x8e5f91[_0x794c('0x32')]),_0x310fa9);if(_0x4ffb45[_0x794c('0x30')][_0x794c('0x3d')]){_0xb6b1da['where']=_[_0x794c('0x3e')](_0xb6b1da[_0x794c('0x3b')],{'$or':_[_0x794c('0x2a')](_0x310fa9,function(_0x3bcd16){if(_0x3bcd16[_0x794c('0x2d')]!==_0x794c('0x3f')){var _0x1c9c97={};_0x1c9c97[_0x3bcd16[_0x794c('0x27')]]={'$like':'%'+_0x4ffb45['query'][_0x794c('0x3d')]+'%'};return _0x1c9c97;}})});}_0xb6b1da=_[_0x794c('0x3e')]({},_0xb6b1da,_0x4ffb45[_0x794c('0x40')]);var _0x4b33f3={'where':_0xb6b1da[_0x794c('0x3b')]};return db[_0x794c('0x41')][_0x794c('0x1c')](_0x4b33f3)[_0x794c('0x23')](function(_0x411a4e){_0x53367f[_0x794c('0x1c')]=_0x411a4e;if(_0x4ffb45[_0x794c('0x30')][_0x794c('0x42')]){_0xb6b1da[_0x794c('0x43')]=[{'all':!![]}];}return db['SugarcrmField'][_0x794c('0x44')](_0xb6b1da);})[_0x794c('0x23')](function(_0x580d00){_0x53367f['rows']=_0x580d00;return _0x53367f;})[_0x794c('0x23')](respondWithFilteredResult(_0xb55e2e,_0xb6b1da))[_0x794c('0x45')](handleError(_0xb55e2e,null));};exports[_0x794c('0x46')]=function(_0x8d6c9c,_0x4bb959){var _0x3d4555={'raw':!![],'where':{'id':_0x8d6c9c[_0x794c('0x47')]['id']}},_0x13724={};_0x13724['model']=_[_0x794c('0x31')](db[_0x794c('0x41')]['rawAttributes']);_0x13724[_0x794c('0x30')]=_[_0x794c('0x31')](_0x8d6c9c[_0x794c('0x30')]);_0x13724['filters']=_[_0x794c('0x34')](_0x13724[_0x794c('0x2f')],_0x13724['query']);_0x3d4555[_0x794c('0x33')]=_['intersection'](_0x13724[_0x794c('0x2f')],qs[_0x794c('0x35')](_0x8d6c9c['query']['fields']));_0x3d4555['attributes']=_0x3d4555[_0x794c('0x33')][_0x794c('0x36')]?_0x3d4555['attributes']:_0x13724[_0x794c('0x2f')];if(_0x8d6c9c['query'][_0x794c('0x42')]){_0x3d4555[_0x794c('0x43')]=[{'all':!![]}];}_0x3d4555=_[_0x794c('0x3e')]({},_0x3d4555,_0x8d6c9c[_0x794c('0x40')]);return db['SugarcrmField'][_0x794c('0x48')](_0x3d4555)[_0x794c('0x23')](handleEntityNotFound(_0x4bb959,null))[_0x794c('0x23')](respondWithResult(_0x4bb959,null))[_0x794c('0x45')](handleError(_0x4bb959,null));};exports[_0x794c('0x49')]=function(_0x1d021e,_0x18b996){return db[_0x794c('0x41')][_0x794c('0x49')](_0x1d021e[_0x794c('0x4a')],{})[_0x794c('0x23')](respondWithResult(_0x18b996,0xc9))[_0x794c('0x45')](handleError(_0x18b996,null));};exports[_0x794c('0x22')]=function(_0x393b8f,_0x2ea5d2){if(_0x393b8f[_0x794c('0x4a')]['id']){delete _0x393b8f[_0x794c('0x4a')]['id'];}return db[_0x794c('0x41')][_0x794c('0x48')]({'where':{'id':_0x393b8f[_0x794c('0x47')]['id']}})[_0x794c('0x23')](handleEntityNotFound(_0x2ea5d2,null))[_0x794c('0x23')](saveUpdates(_0x393b8f['body'],null))[_0x794c('0x23')](respondWithResult(_0x2ea5d2,null))[_0x794c('0x45')](handleError(_0x2ea5d2,null));};exports[_0x794c('0x24')]=function(_0x25d12e,_0x45b53b){return db[_0x794c('0x41')][_0x794c('0x48')]({'where':{'id':_0x25d12e[_0x794c('0x47')]['id']}})[_0x794c('0x23')](handleEntityNotFound(_0x45b53b,null))[_0x794c('0x23')](removeEntity(_0x45b53b,null))['catch'](handleError(_0x45b53b,null));}; \ No newline at end of file +var _0x2946=['index','SugarcrmField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','stack','name','send'];(function(_0x5c4990,_0x5c7ee8){var _0x1462a7=function(_0xfb12a6){while(--_0xfb12a6){_0x5c4990['push'](_0x5c4990['shift']());}};_0x1462a7(++_0x5c7ee8);}(_0x2946,0x102));var _0x6294=function(_0x2d2d4a,_0x1ebfb3){_0x2d2d4a=_0x2d2d4a-0x0;var _0x3d3489=_0x2946[_0x2d2d4a];return _0x3d3489;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6294('0x0'));var jsonpatch=require(_0x6294('0x1'));var rp=require(_0x6294('0x2'));var moment=require(_0x6294('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6294('0x4'));var util=require(_0x6294('0x5'));var path=require(_0x6294('0x6'));var sox=require(_0x6294('0x7'));var csv=require(_0x6294('0x8'));var ejs=require(_0x6294('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6294('0xa'));var crypto=require(_0x6294('0xb'));var jsforce=require(_0x6294('0xc'));var deskjs=require(_0x6294('0xd'));var toCsv=require(_0x6294('0x8'));var querystring=require(_0x6294('0xe'));var Papa=require(_0x6294('0xf'));var Redis=require('ioredis');var authService=require(_0x6294('0x10'));var qs=require(_0x6294('0x11'));var as=require(_0x6294('0x12'));var hardwareService=require(_0x6294('0x13'));var logger=require(_0x6294('0x14'))(_0x6294('0x15'));var utils=require(_0x6294('0x16'));var config=require(_0x6294('0x17'));var licenseUtil=require(_0x6294('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59e61d,_0x5402f2){_0x5402f2=_0x5402f2||0xcc;return function(_0x3983f4){if(_0x3983f4){return _0x59e61d[_0x6294('0x19')](_0x5402f2);}return _0x59e61d['status'](_0x5402f2)['end']();};}function respondWithResult(_0x395b30,_0x3d7af0){_0x3d7af0=_0x3d7af0||0xc8;return function(_0xbfdf25){if(_0xbfdf25){return _0x395b30[_0x6294('0x1a')](_0x3d7af0)[_0x6294('0x1b')](_0xbfdf25);}};}function respondWithFilteredResult(_0x3f8c4c,_0x130d3c){return function(_0x5ef465){if(_0x5ef465){var _0x3f9fb9=typeof _0x130d3c[_0x6294('0x1c')]===_0x6294('0x1d')&&typeof _0x130d3c[_0x6294('0x1e')]===_0x6294('0x1d');var _0x75ee7b=_0x5ef465[_0x6294('0x1f')];var _0x122132=_0x3f9fb9?0x0:_0x130d3c[_0x6294('0x1c')];var _0x329667=_0x3f9fb9?_0x5ef465[_0x6294('0x1f')]:_0x130d3c['offset']+_0x130d3c[_0x6294('0x1e')];var _0x83035d;if(_0x329667>=_0x75ee7b){_0x329667=_0x75ee7b;_0x83035d=0xc8;}else{_0x83035d=0xce;}_0x3f8c4c['status'](_0x83035d);return _0x3f8c4c[_0x6294('0x20')](_0x6294('0x21'),_0x122132+'-'+_0x329667+'/'+_0x75ee7b)[_0x6294('0x1b')](_0x5ef465);}return null;};}function patchUpdates(_0x520039){return function(_0x2aa386){try{jsonpatch[_0x6294('0x22')](_0x2aa386,_0x520039,!![]);}catch(_0x370ed0){return BPromise['reject'](_0x370ed0);}return _0x2aa386['save']();};}function saveUpdates(_0x243f02,_0xc086c8){return function(_0x4cbc04){if(_0x4cbc04){return _0x4cbc04['update'](_0x243f02)[_0x6294('0x23')](function(_0x273fe5){return _0x273fe5;});}return null;};}function removeEntity(_0x24a47a,_0x1eeaa9){return function(_0x8614ce){if(_0x8614ce){return _0x8614ce[_0x6294('0x24')]()[_0x6294('0x23')](function(){_0x24a47a[_0x6294('0x1a')](0xcc)[_0x6294('0x25')]();});}};}function handleEntityNotFound(_0x4d0706,_0x2fef7d){return function(_0x5210e6){if(!_0x5210e6){_0x4d0706[_0x6294('0x19')](0x194);}return _0x5210e6;};}function handleError(_0x49ad66,_0x2a4974){_0x2a4974=_0x2a4974||0x1f4;return function(_0x11c406){logger[_0x6294('0x26')](_0x11c406[_0x6294('0x27')]);if(_0x11c406[_0x6294('0x28')]){delete _0x11c406[_0x6294('0x28')];}_0x49ad66[_0x6294('0x1a')](_0x2a4974)[_0x6294('0x29')](_0x11c406);};}exports[_0x6294('0x2a')]=function(_0x26966b,_0x5a2187){var _0x3e1821={},_0xe84274={},_0x28aba1={'count':0x0,'rows':[]};var _0x3e9f94=_['map'](db[_0x6294('0x2b')][_0x6294('0x2c')],function(_0xd0deff){return{'name':_0xd0deff['fieldName'],'type':_0xd0deff[_0x6294('0x2d')][_0x6294('0x2e')]};});_0xe84274[_0x6294('0x2f')]=_[_0x6294('0x30')](_0x3e9f94,_0x6294('0x28'));_0xe84274[_0x6294('0x31')]=_[_0x6294('0x32')](_0x26966b[_0x6294('0x31')]);_0xe84274[_0x6294('0x33')]=_[_0x6294('0x34')](_0xe84274[_0x6294('0x2f')],_0xe84274['query']);_0x3e1821[_0x6294('0x35')]=_[_0x6294('0x34')](_0xe84274[_0x6294('0x2f')],qs[_0x6294('0x36')](_0x26966b[_0x6294('0x31')][_0x6294('0x36')]));_0x3e1821[_0x6294('0x35')]=_0x3e1821[_0x6294('0x35')][_0x6294('0x37')]?_0x3e1821[_0x6294('0x35')]:_0xe84274[_0x6294('0x2f')];if(!_0x26966b[_0x6294('0x31')][_0x6294('0x38')](_0x6294('0x39'))){_0x3e1821[_0x6294('0x1e')]=qs['limit'](_0x26966b[_0x6294('0x31')][_0x6294('0x1e')]);_0x3e1821[_0x6294('0x1c')]=qs['offset'](_0x26966b[_0x6294('0x31')]['offset']);}_0x3e1821[_0x6294('0x3a')]=qs[_0x6294('0x3b')](_0x26966b[_0x6294('0x31')][_0x6294('0x3b')]);_0x3e1821[_0x6294('0x3c')]=qs['filters'](_[_0x6294('0x3d')](_0x26966b[_0x6294('0x31')],_0xe84274['filters']),_0x3e9f94);if(_0x26966b[_0x6294('0x31')][_0x6294('0x3e')]){_0x3e1821[_0x6294('0x3c')]=_[_0x6294('0x3f')](_0x3e1821['where'],{'$or':_[_0x6294('0x30')](_0x3e9f94,function(_0x5d3511){if(_0x5d3511[_0x6294('0x2d')]!==_0x6294('0x40')){var _0x7c7720={};_0x7c7720[_0x5d3511[_0x6294('0x28')]]={'$like':'%'+_0x26966b[_0x6294('0x31')][_0x6294('0x3e')]+'%'};return _0x7c7720;}})});}_0x3e1821=_[_0x6294('0x3f')]({},_0x3e1821,_0x26966b[_0x6294('0x41')]);var _0x3feaaf={'where':_0x3e1821[_0x6294('0x3c')]};return db[_0x6294('0x2b')][_0x6294('0x1f')](_0x3feaaf)['then'](function(_0x375ee2){_0x28aba1['count']=_0x375ee2;if(_0x26966b[_0x6294('0x31')][_0x6294('0x42')]){_0x3e1821['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x3e1821);})[_0x6294('0x23')](function(_0x5703ad){_0x28aba1[_0x6294('0x43')]=_0x5703ad;return _0x28aba1;})[_0x6294('0x23')](respondWithFilteredResult(_0x5a2187,_0x3e1821))[_0x6294('0x44')](handleError(_0x5a2187,null));};exports[_0x6294('0x45')]=function(_0x4cd425,_0x240616){var _0x1ed733={'raw':!![],'where':{'id':_0x4cd425[_0x6294('0x46')]['id']}},_0x4698b7={};_0x4698b7[_0x6294('0x2f')]=_[_0x6294('0x32')](db[_0x6294('0x2b')]['rawAttributes']);_0x4698b7[_0x6294('0x31')]=_[_0x6294('0x32')](_0x4cd425['query']);_0x4698b7['filters']=_['intersection'](_0x4698b7[_0x6294('0x2f')],_0x4698b7[_0x6294('0x31')]);_0x1ed733['attributes']=_[_0x6294('0x34')](_0x4698b7[_0x6294('0x2f')],qs[_0x6294('0x36')](_0x4cd425[_0x6294('0x31')][_0x6294('0x36')]));_0x1ed733['attributes']=_0x1ed733[_0x6294('0x35')][_0x6294('0x37')]?_0x1ed733[_0x6294('0x35')]:_0x4698b7[_0x6294('0x2f')];if(_0x4cd425['query'][_0x6294('0x42')]){_0x1ed733[_0x6294('0x47')]=[{'all':!![]}];}_0x1ed733=_[_0x6294('0x3f')]({},_0x1ed733,_0x4cd425[_0x6294('0x41')]);return db['SugarcrmField'][_0x6294('0x48')](_0x1ed733)[_0x6294('0x23')](handleEntityNotFound(_0x240616,null))[_0x6294('0x23')](respondWithResult(_0x240616,null))[_0x6294('0x44')](handleError(_0x240616,null));};exports[_0x6294('0x49')]=function(_0x1353be,_0x3ccace){return db['SugarcrmField'][_0x6294('0x49')](_0x1353be['body'],{})[_0x6294('0x23')](respondWithResult(_0x3ccace,0xc9))[_0x6294('0x44')](handleError(_0x3ccace,null));};exports['update']=function(_0x108a27,_0x456f17){if(_0x108a27[_0x6294('0x4a')]['id']){delete _0x108a27['body']['id'];}return db[_0x6294('0x2b')][_0x6294('0x48')]({'where':{'id':_0x108a27['params']['id']}})[_0x6294('0x23')](handleEntityNotFound(_0x456f17,null))['then'](saveUpdates(_0x108a27['body'],null))[_0x6294('0x23')](respondWithResult(_0x456f17,null))[_0x6294('0x44')](handleError(_0x456f17,null));};exports['destroy']=function(_0x5357a7,_0x3f6aad){return db['SugarcrmField'][_0x6294('0x48')]({'where':{'id':_0x5357a7[_0x6294('0x46')]['id']}})[_0x6294('0x23')](handleEntityNotFound(_0x3f6aad,null))[_0x6294('0x23')](removeEntity(_0x3f6aad,null))['catch'](handleError(_0x3f6aad,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1cf06bd..8829ab2 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 _0x67a0=['sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0x67a0,0x81));var _0x067a=function(_0x2322ba,_0xf3548a){_0x2322ba=_0x2322ba-0x0;var _0x54da3a=_0x67a0[_0x2322ba];return _0x54da3a;};'use strict';var _=require(_0x067a('0x0'));var util=require('util');var logger=require(_0x067a('0x1'))(_0x067a('0x2'));var moment=require('moment');var BPromise=require(_0x067a('0x3'));var rp=require(_0x067a('0x4'));var fs=require('fs');var path=require(_0x067a('0x5'));var rimraf=require('rimraf');var config=require(_0x067a('0x6'));var attributes=require(_0x067a('0x7'));module[_0x067a('0x8')]=function(_0x3bc35b,_0xb48d05){return _0x3bc35b[_0x067a('0x9')]('SugarcrmField',attributes,{'tableName':_0x067a('0xa'),'paranoid':![],'indexes':[{'name':_0x067a('0xb'),'fields':[_0x067a('0xc'),_0x067a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c7d=['path','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xfbbc6d,_0x4c1de5){var _0xb2fce7=function(_0x4842fd){while(--_0x4842fd){_0xfbbc6d['push'](_0xfbbc6d['shift']());}};_0xb2fce7(++_0x4c1de5);}(_0x7c7d,0x117));var _0xd7c7=function(_0x5514de,_0x466f11){_0x5514de=_0x5514de-0x0;var _0x59f56d=_0x7c7d[_0x5514de];return _0x59f56d;};'use strict';var _=require(_0xd7c7('0x0'));var util=require('util');var logger=require(_0xd7c7('0x1'))(_0xd7c7('0x2'));var moment=require(_0xd7c7('0x3'));var BPromise=require(_0xd7c7('0x4'));var rp=require(_0xd7c7('0x5'));var fs=require('fs');var path=require(_0xd7c7('0x6'));var rimraf=require('rimraf');var config=require(_0xd7c7('0x7'));var attributes=require(_0xd7c7('0x8'));module['exports']=function(_0x39c001,_0x17cbff){return _0x39c001[_0xd7c7('0x9')](_0xd7c7('0xa'),attributes,{'tableName':_0xd7c7('0xb'),'paranoid':![],'indexes':[{'name':_0xd7c7('0xc'),'fields':[_0xd7c7('0xd'),_0xd7c7('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index eab4b4d..de7bd9f 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 _0x4871=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x4871,0x1d4));var _0x1487=function(_0x7f6856,_0x51e8d6){_0x7f6856=_0x7f6856-0x0;var _0x30f8e9=_0x4871[_0x7f6856];return _0x30f8e9;};'use strict';var _=require(_0x1487('0x0'));var util=require(_0x1487('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1487('0x2'));var fs=require('fs');var Redis=require(_0x1487('0x3'));var db=require(_0x1487('0x4'))['db'];var utils=require(_0x1487('0x5'));var logger=require('../../config/logger')(_0x1487('0x6'));var config=require(_0x1487('0x7'));var jayson=require(_0x1487('0x8'));var client=jayson[_0x1487('0x9')][_0x1487('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c814b,_0x31bbb6,_0x5a0de2){return new BPromise(function(_0xa18512,_0x52231e){return client[_0x1487('0xb')](_0x2c814b,_0x5a0de2)[_0x1487('0xc')](function(_0x24f671){logger[_0x1487('0xd')](_0x1487('0xe'),_0x31bbb6,_0x1487('0xf'));logger[_0x1487('0x10')](_0x1487('0x11'),_0x31bbb6,_0x1487('0xf'),JSON['stringify'](_0x24f671));if(_0x24f671['error']){if(_0x24f671['error'][_0x1487('0x12')]===0x1f4){logger['error'](_0x1487('0xe'),_0x31bbb6,_0x24f671[_0x1487('0x13')][_0x1487('0x14')]);return _0x52231e(_0x24f671[_0x1487('0x13')][_0x1487('0x14')]);}logger[_0x1487('0x13')](_0x1487('0xe'),_0x31bbb6,_0x24f671[_0x1487('0x13')]['message']);return _0xa18512(_0x24f671[_0x1487('0x13')][_0x1487('0x14')]);}else{logger[_0x1487('0xd')](_0x1487('0xe'),_0x31bbb6,_0x1487('0xf'));_0xa18512(_0x24f671[_0x1487('0x15')]['message']);}})[_0x1487('0x16')](function(_0x4f22e0){logger[_0x1487('0x13')](_0x1487('0xe'),_0x31bbb6,_0x4f22e0);_0x52231e(_0x4f22e0);});});} \ No newline at end of file +var _0x1d6a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SugarcrmField,\x20%s,\x20%s','result','catch'];(function(_0x5c6d42,_0xd1e50a){var _0x24b058=function(_0x1f5414){while(--_0x1f5414){_0x5c6d42['push'](_0x5c6d42['shift']());}};_0x24b058(++_0xd1e50a);}(_0x1d6a,0x1a2));var _0xa1d6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1d6a[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0xa1d6('0x0'));var moment=require('moment');var BPromise=require(_0xa1d6('0x1'));var rs=require(_0xa1d6('0x2'));var fs=require('fs');var Redis=require(_0xa1d6('0x3'));var db=require(_0xa1d6('0x4'))['db'];var utils=require(_0xa1d6('0x5'));var logger=require(_0xa1d6('0x6'))(_0xa1d6('0x7'));var config=require(_0xa1d6('0x8'));var jayson=require(_0xa1d6('0x9'));var client=jayson['client'][_0xa1d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a6250,_0x1279a8,_0x112886){return new BPromise(function(_0x466a3e,_0xdabf57){return client[_0xa1d6('0xb')](_0x1a6250,_0x112886)['then'](function(_0x40130b){logger[_0xa1d6('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1279a8,'request\x20sent');logger[_0xa1d6('0xd')](_0xa1d6('0xe'),_0x1279a8,_0xa1d6('0xf'),JSON[_0xa1d6('0x10')](_0x40130b));if(_0x40130b[_0xa1d6('0x11')]){if(_0x40130b[_0xa1d6('0x11')]['code']===0x1f4){logger[_0xa1d6('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1279a8,_0x40130b[_0xa1d6('0x11')][_0xa1d6('0x12')]);return _0xdabf57(_0x40130b['error']['message']);}logger[_0xa1d6('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1279a8,_0x40130b[_0xa1d6('0x11')][_0xa1d6('0x12')]);return _0x466a3e(_0x40130b[_0xa1d6('0x11')][_0xa1d6('0x12')]);}else{logger[_0xa1d6('0xc')](_0xa1d6('0x13'),_0x1279a8,_0xa1d6('0xf'));_0x466a3e(_0x40130b[_0xa1d6('0x14')][_0xa1d6('0x12')]);}})[_0xa1d6('0x15')](function(_0xd09da5){logger[_0xa1d6('0x11')](_0xa1d6('0x13'),_0x1279a8,_0xd09da5);_0xdabf57(_0xd09da5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ca2f192..ab634e9 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 _0xe630=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xe630,0x149));var _0x0e63=function(_0x3585fb,_0x5df075){_0x3585fb=_0x3585fb-0x0;var _0x48fb79=_0xe630[_0x3585fb];return _0x48fb79;};'use strict';var multer=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var path=require('path');var timeout=require(_0x0e63('0x2'));var express=require(_0x0e63('0x3'));var router=express[_0x0e63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e63('0x5'));var interaction=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x0e63('0x8')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xa')]);router[_0x0e63('0x8')](_0x0e63('0xb'),auth['isAuthenticated'](),controller[_0x0e63('0xc')]);router[_0x0e63('0x8')](_0x0e63('0xd'),auth[_0x0e63('0x9')](),controller[_0x0e63('0xe')]);router[_0x0e63('0x8')](_0x0e63('0xf'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x10')]);router[_0x0e63('0x11')]('/',auth[_0x0e63('0x9')](),controller['create']);router[_0x0e63('0x11')](_0x0e63('0xd'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x12')]);router[_0x0e63('0x13')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x14')]);router[_0x0e63('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x0e63('0x16')]);module[_0x0e63('0x17')]=router; \ No newline at end of file +var _0xc9b7=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x4b33bf,_0x120fa0){var _0x9fd055=function(_0x43132d){while(--_0x43132d){_0x4b33bf['push'](_0x4b33bf['shift']());}};_0x9fd055(++_0x120fa0);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x530e0e,_0x54d536){_0x530e0e=_0x530e0e-0x0;var _0x2742fb=_0xc9b7[_0x530e0e];return _0x2742fb;};'use strict';var multer=require(_0x7c9b('0x0'));var util=require(_0x7c9b('0x1'));var path=require(_0x7c9b('0x2'));var timeout=require(_0x7c9b('0x3'));var express=require('express');var router=express[_0x7c9b('0x4')]();var fs_extra=require(_0x7c9b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c9b('0x6'));var config=require(_0x7c9b('0x7'));var controller=require(_0x7c9b('0x8'));router[_0x7c9b('0x9')]('/',auth[_0x7c9b('0xa')](),controller[_0x7c9b('0xb')]);router[_0x7c9b('0x9')](_0x7c9b('0xc'),auth[_0x7c9b('0xa')](),controller[_0x7c9b('0xd')]);router[_0x7c9b('0x9')](_0x7c9b('0xe'),auth[_0x7c9b('0xa')](),controller[_0x7c9b('0xf')]);router[_0x7c9b('0x9')](_0x7c9b('0x10'),auth[_0x7c9b('0xa')](),controller[_0x7c9b('0x11')]);router['post']('/',auth[_0x7c9b('0xa')](),controller[_0x7c9b('0x12')]);router[_0x7c9b('0x13')]('/:id/configurations',auth[_0x7c9b('0xa')](),controller['addConfiguration']);router[_0x7c9b('0x14')](_0x7c9b('0xc'),auth['isAuthenticated'](),controller[_0x7c9b('0x15')]);router[_0x7c9b('0x16')](_0x7c9b('0xc'),auth[_0x7c9b('0xa')](),controller['destroy']);module[_0x7c9b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index c3ed0fe..e23588e 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 _0xcef6=['STRING','HelpDesk'];(function(_0x56a103,_0x74e793){var _0x5c0d0b=function(_0x56a022){while(--_0x56a022){_0x56a103['push'](_0x56a103['shift']());}};_0x5c0d0b(++_0x74e793);}(_0xcef6,0x1cc));var _0x6cef=function(_0x5d04ee,_0x2a38ca){_0x5d04ee=_0x5d04ee-0x0;var _0x4a666a=_0xcef6[_0x5d04ee];return _0x4a666a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6cef('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6cef('0x0')],'allowNull':![],'defaultValue':_0x6cef('0x1')},'remoteUri':{'type':Sequelize[_0x6cef('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6cef('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6cef('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xfcbc=['STRING','HelpDesk','sequelize','exports'];(function(_0x1f404a,_0x5088b2){var _0x2cdcd5=function(_0xe30d8c){while(--_0xe30d8c){_0x1f404a['push'](_0x1f404a['shift']());}};_0x2cdcd5(++_0x5088b2);}(_0xfcbc,0x16a));var _0xcfcb=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0xfcbc[_0x2cc0b3];return _0x1667ef;};'use strict';var Sequelize=require(_0xcfcb('0x0'));module[_0xcfcb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcfcb('0x2')]},'username':{'type':Sequelize[_0xcfcb('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xcfcb('0x2')],'allowNull':![],'defaultValue':_0xcfcb('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xcfcb('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xcfcb('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 51d855e..d1578f7 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 _0x8970=['../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','filters','attributes','fields','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','merge','find','create','body','findOne','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','result','token','describe','sessionName','owner','includes','remove','editable','false','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8970,0x1ca));var _0x0897=function(_0xc73b09,_0x266bdf){_0xc73b09=_0xc73b09-0x0;var _0x42fcf5=_0x8970[_0xc73b09];return _0x42fcf5;};'use strict';var emlformat=require(_0x0897('0x0'));var rimraf=require(_0x0897('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0897('0x2'));var rp=require('request-promise');var moment=require(_0x0897('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0897('0x4'));var path=require(_0x0897('0x5'));var sox=require(_0x0897('0x6'));var csv=require(_0x0897('0x7'));var ejs=require(_0x0897('0x8'));var fs=require('fs');var fs_extra=require(_0x0897('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0897('0xa'));var jsforce=require(_0x0897('0xb'));var deskjs=require(_0x0897('0xc'));var toCsv=require(_0x0897('0x7'));var querystring=require(_0x0897('0xd'));var Papa=require(_0x0897('0xe'));var Redis=require(_0x0897('0xf'));var authService=require(_0x0897('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0897('0x11'));var hardwareService=require(_0x0897('0x12'));var logger=require(_0x0897('0x13'))(_0x0897('0x14'));var utils=require(_0x0897('0x15'));var config=require(_0x0897('0x16'));var licenseUtil=require(_0x0897('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0897('0x18'));function respondWithStatusCode(_0x444205,_0x3a6945){_0x3a6945=_0x3a6945||0xcc;return function(_0x1b28da){if(_0x1b28da){return _0x444205['sendStatus'](_0x3a6945);}return _0x444205[_0x0897('0x19')](_0x3a6945)[_0x0897('0x1a')]();};}function respondWithResult(_0x167dbe,_0x204cec){_0x204cec=_0x204cec||0xc8;return function(_0x1336b3){if(_0x1336b3){return _0x167dbe[_0x0897('0x19')](_0x204cec)['json'](_0x1336b3);}};}function respondWithFilteredResult(_0xe7658e,_0x2e6be7){return function(_0x5102e3){if(_0x5102e3){var _0x4e19b9=typeof _0x2e6be7[_0x0897('0x1b')]===_0x0897('0x1c')&&typeof _0x2e6be7[_0x0897('0x1d')]===_0x0897('0x1c');var _0x577df0=_0x5102e3[_0x0897('0x1e')];var _0x32e540=_0x4e19b9?0x0:_0x2e6be7[_0x0897('0x1b')];var _0x3b1894=_0x4e19b9?_0x5102e3['count']:_0x2e6be7['offset']+_0x2e6be7[_0x0897('0x1d')];var _0x6ba88f;if(_0x3b1894>=_0x577df0){_0x3b1894=_0x577df0;_0x6ba88f=0xc8;}else{_0x6ba88f=0xce;}_0xe7658e['status'](_0x6ba88f);return _0xe7658e['set']('Content-Range',_0x32e540+'-'+_0x3b1894+'/'+_0x577df0)[_0x0897('0x1f')](_0x5102e3);}return null;};}function patchUpdates(_0x2a6df6){return function(_0x3fd3db){try{jsonpatch[_0x0897('0x20')](_0x3fd3db,_0x2a6df6,!![]);}catch(_0x31c42b){return BPromise[_0x0897('0x21')](_0x31c42b);}return _0x3fd3db[_0x0897('0x22')]();};}function saveUpdates(_0x214cbd,_0x448cc0){return function(_0x226c09){if(_0x226c09){return _0x226c09[_0x0897('0x23')](_0x214cbd)[_0x0897('0x24')](function(_0x446219){return _0x446219;});}return null;};}function removeEntity(_0x46c813,_0x5bd129){return function(_0x900f29){if(_0x900f29){return _0x900f29[_0x0897('0x25')]()[_0x0897('0x24')](function(){_0x46c813[_0x0897('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x232dff,_0x664f46){return function(_0x5170b2){if(!_0x5170b2){_0x232dff['sendStatus'](0x194);}return _0x5170b2;};}function handleError(_0x435acf,_0x11db55){_0x11db55=_0x11db55||0x1f4;return function(_0x4cc494){logger[_0x0897('0x26')](_0x4cc494[_0x0897('0x27')]);if(_0x4cc494[_0x0897('0x28')]){delete _0x4cc494['name'];}_0x435acf[_0x0897('0x19')](_0x11db55)[_0x0897('0x29')](_0x4cc494);};}exports[_0x0897('0x2a')]=function(_0x16558a,_0x5db90c){var _0x27be44={},_0x5c7e59={},_0x1c0264={'count':0x0,'rows':[]};var _0x456703=_[_0x0897('0x2b')](db[_0x0897('0x2c')]['rawAttributes'],function(_0xc37cdf){return{'name':_0xc37cdf[_0x0897('0x2d')],'type':_0xc37cdf[_0x0897('0x2e')][_0x0897('0x2f')]};});_0x5c7e59[_0x0897('0x30')]=_[_0x0897('0x2b')](_0x456703,_0x0897('0x28'));_0x5c7e59['query']=_['keys'](_0x16558a[_0x0897('0x31')]);_0x5c7e59[_0x0897('0x32')]=_['intersection'](_0x5c7e59[_0x0897('0x30')],_0x5c7e59[_0x0897('0x31')]);_0x27be44[_0x0897('0x33')]=_['intersection'](_0x5c7e59['model'],qs[_0x0897('0x34')](_0x16558a['query'][_0x0897('0x34')]));_0x27be44['attributes']=_0x27be44[_0x0897('0x33')]['length']?_0x27be44[_0x0897('0x33')]:_0x5c7e59['model'];if(!_0x16558a['query']['hasOwnProperty']('nolimit')){_0x27be44[_0x0897('0x1d')]=qs[_0x0897('0x1d')](_0x16558a['query']['limit']);_0x27be44[_0x0897('0x1b')]=qs['offset'](_0x16558a[_0x0897('0x31')]['offset']);}_0x27be44[_0x0897('0x35')]=qs[_0x0897('0x36')](_0x16558a[_0x0897('0x31')][_0x0897('0x36')]);_0x27be44['where']=qs[_0x0897('0x32')](_['pick'](_0x16558a[_0x0897('0x31')],_0x5c7e59['filters']),_0x456703);if(_0x16558a['query'][_0x0897('0x37')]){_0x27be44[_0x0897('0x38')]=_['merge'](_0x27be44[_0x0897('0x38')],{'$or':_['map'](_0x456703,function(_0x5ec0e9){if(_0x5ec0e9[_0x0897('0x2e')]!==_0x0897('0x39')){var _0x365c95={};_0x365c95[_0x5ec0e9['name']]={'$like':'%'+_0x16558a[_0x0897('0x31')]['filter']+'%'};return _0x365c95;}})});}_0x27be44=_['merge']({},_0x27be44,_0x16558a[_0x0897('0x3a')]);var _0x540f3c={'where':_0x27be44[_0x0897('0x38')]};return db[_0x0897('0x2c')][_0x0897('0x1e')](_0x540f3c)[_0x0897('0x24')](function(_0x249651){_0x1c0264[_0x0897('0x1e')]=_0x249651;if(_0x16558a['query'][_0x0897('0x3b')]){_0x27be44[_0x0897('0x3c')]=[{'all':!![]}];}return db['VtigerAccount'][_0x0897('0x3d')](_0x27be44);})[_0x0897('0x24')](function(_0x574c99){_0x1c0264[_0x0897('0x3e')]=_0x574c99;return _0x1c0264;})['then'](respondWithFilteredResult(_0x5db90c,_0x27be44))[_0x0897('0x3f')](handleError(_0x5db90c,null));};exports[_0x0897('0x40')]=function(_0x249b4c,_0x350e0f){var _0x2e2ae9={'raw':![],'where':{'id':_0x249b4c[_0x0897('0x41')]['id']}},_0x2328ec={};_0x2328ec[_0x0897('0x30')]=_[_0x0897('0x42')](db[_0x0897('0x2c')]['rawAttributes']);_0x2328ec['query']=_[_0x0897('0x42')](_0x249b4c[_0x0897('0x31')]);_0x2328ec[_0x0897('0x32')]=_[_0x0897('0x43')](_0x2328ec[_0x0897('0x30')],_0x2328ec[_0x0897('0x31')]);_0x2e2ae9['attributes']=_[_0x0897('0x43')](_0x2328ec[_0x0897('0x30')],qs[_0x0897('0x34')](_0x249b4c[_0x0897('0x31')]['fields']));_0x2e2ae9[_0x0897('0x33')]=_0x2e2ae9[_0x0897('0x33')][_0x0897('0x44')]?_0x2e2ae9[_0x0897('0x33')]:_0x2328ec['model'];if(_0x249b4c[_0x0897('0x31')]['includeAll']){_0x2e2ae9[_0x0897('0x3c')]=[{'all':!![]}];}_0x2e2ae9=_[_0x0897('0x45')]({},_0x2e2ae9,_0x249b4c[_0x0897('0x3a')]);return db['VtigerAccount'][_0x0897('0x46')](_0x2e2ae9)['then'](handleEntityNotFound(_0x350e0f,null))[_0x0897('0x24')](respondWithResult(_0x350e0f,null))[_0x0897('0x3f')](handleError(_0x350e0f,null));};exports[_0x0897('0x47')]=function(_0x6c57c1,_0x50e66c){return db[_0x0897('0x2c')][_0x0897('0x47')](_0x6c57c1[_0x0897('0x48')],{})[_0x0897('0x24')](respondWithResult(_0x50e66c,0xc9))[_0x0897('0x3f')](handleError(_0x50e66c,null));};exports[_0x0897('0x23')]=function(_0x332036,_0x4e45a2){if(_0x332036['body']['id']){delete _0x332036[_0x0897('0x48')]['id'];}return db[_0x0897('0x2c')][_0x0897('0x46')]({'where':{'id':_0x332036['params']['id']}})[_0x0897('0x24')](handleEntityNotFound(_0x4e45a2,null))[_0x0897('0x24')](saveUpdates(_0x332036[_0x0897('0x48')],null))['then'](respondWithResult(_0x4e45a2,null))[_0x0897('0x3f')](handleError(_0x4e45a2,null));};exports['destroy']=function(_0x594147,_0x17551e){return db[_0x0897('0x2c')][_0x0897('0x46')]({'where':{'id':_0x594147[_0x0897('0x41')]['id']}})[_0x0897('0x24')](handleEntityNotFound(_0x17551e,null))[_0x0897('0x24')](removeEntity(_0x17551e,null))[_0x0897('0x3f')](handleError(_0x17551e,null));};exports['getConfigurations']=function(_0x31e41e,_0x5047a8,_0x1901d9){var _0x17a5bd={};var _0x405c59={};var _0x4c74c9;var _0x2919f0;return db['VtigerAccount'][_0x0897('0x49')]({'where':{'id':_0x31e41e['params']['id']}})[_0x0897('0x24')](handleEntityNotFound(_0x5047a8,null))[_0x0897('0x24')](function(_0x36ed28){if(_0x36ed28){_0x4c74c9=_0x36ed28;_0x405c59[_0x0897('0x30')]=_[_0x0897('0x42')](db['VtigerConfiguration']['rawAttributes']);_0x405c59['query']=_[_0x0897('0x42')](_0x31e41e[_0x0897('0x31')]);_0x405c59['filters']=_[_0x0897('0x43')](_0x405c59[_0x0897('0x30')],_0x405c59['query']);_0x17a5bd[_0x0897('0x33')]=_[_0x0897('0x43')](_0x405c59[_0x0897('0x30')],qs[_0x0897('0x34')](_0x31e41e[_0x0897('0x31')][_0x0897('0x34')]));_0x17a5bd[_0x0897('0x33')]=_0x17a5bd['attributes'][_0x0897('0x44')]?_0x17a5bd[_0x0897('0x33')]:_0x405c59[_0x0897('0x30')];_0x17a5bd[_0x0897('0x35')]=qs['sort'](_0x31e41e['query'][_0x0897('0x36')]);_0x17a5bd[_0x0897('0x38')]=qs[_0x0897('0x32')](_[_0x0897('0x4a')](_0x31e41e[_0x0897('0x31')],_0x405c59[_0x0897('0x32')]));if(_0x31e41e[_0x0897('0x31')]['filter']){_0x17a5bd[_0x0897('0x38')]=_[_0x0897('0x45')](_0x17a5bd[_0x0897('0x38')],{'$or':_[_0x0897('0x2b')](_0x17a5bd[_0x0897('0x33')],function(_0x5501ce){var _0x38a011={};_0x38a011[_0x5501ce]={'$like':'%'+_0x31e41e[_0x0897('0x31')][_0x0897('0x37')]+'%'};return _0x38a011;})});}_0x17a5bd=_['merge']({},_0x17a5bd,_0x31e41e[_0x0897('0x3a')]);return _0x4c74c9[_0x0897('0x4b')](_0x17a5bd);}})[_0x0897('0x24')](function(_0x3cf416){if(_0x3cf416){_0x2919f0=_0x3cf416[_0x0897('0x44')];if(!_0x31e41e[_0x0897('0x31')]['hasOwnProperty']('nolimit')){_0x17a5bd[_0x0897('0x1d')]=qs[_0x0897('0x1d')](_0x31e41e[_0x0897('0x31')][_0x0897('0x1d')]);_0x17a5bd['offset']=qs['offset'](_0x31e41e[_0x0897('0x31')]['offset']);}return _0x4c74c9[_0x0897('0x4b')](_0x17a5bd);}})[_0x0897('0x24')](function(_0xdf78e){if(_0xdf78e){return _0xdf78e?{'count':_0x2919f0,'rows':_0xdf78e}:null;}})[_0x0897('0x24')](respondWithResult(_0x5047a8,null))[_0x0897('0x3f')](handleError(_0x5047a8,null));};exports[_0x0897('0x4c')]=function(_0x517237,_0x39807d,_0x32c5af){if(_0x517237[_0x0897('0x48')]['id']){delete _0x517237[_0x0897('0x48')]['id'];}return db[_0x0897('0x2c')][_0x0897('0x49')]({'where':{'id':_0x517237[_0x0897('0x41')]['id']}})[_0x0897('0x24')](handleEntityNotFound(_0x39807d,null))[_0x0897('0x24')](function(_0x3cd15d){if(_0x3cd15d){_0x517237['body'][_0x0897('0x4d')]=_0x3cd15d['id'];_0x517237['body'][_0x0897('0x4e')]=integrations[_0x0897('0x4f')](_0x517237['body'][_0x0897('0x50')],_0x517237[_0x0897('0x48')][_0x0897('0x2e')]);_0x517237[_0x0897('0x48')][_0x0897('0x51')]=integrations[_0x0897('0x52')](_0x517237[_0x0897('0x48')][_0x0897('0x50')],_0x517237[_0x0897('0x48')][_0x0897('0x2e')]);return db[_0x0897('0x53')][_0x0897('0x47')](_0x517237['body'],{'include':[{'model':db[_0x0897('0x54')],'as':_0x0897('0x4e')},{'model':db[_0x0897('0x54')],'as':_0x0897('0x51')}]});}return null;})[_0x0897('0x24')](respondWithResult(_0x39807d,null))[_0x0897('0x3f')](handleError(_0x39807d,null));};var md5=require(_0x0897('0x55'));exports[_0x0897('0x56')]=function(_0x585df8,_0x2e6616,_0x2339e6){var _0xe4c0c=null;var _0x431051=null;var _0x107590=null;var _0x42197b=null;var _0x43a276='';return db[_0x0897('0x2c')][_0x0897('0x49')]({'where':{'id':_0x585df8[_0x0897('0x41')]['id']},'attributes':['id',_0x0897('0x28'),_0x0897('0x57'),_0x0897('0x58'),_0x0897('0x59'),_0x0897('0x5a'),_0x0897('0x5b'),'accessKey']})[_0x0897('0x24')](handleEntityNotFound(_0x2e6616,null))['then'](function(_0x6b8e9b){if(_0x6b8e9b){_0xe4c0c=_0x6b8e9b[_0x0897('0x57')];_0x431051=_0x6b8e9b[_0x0897('0x5c')];_0x107590=_0x6b8e9b['moduleName'];_0x43a276=_0x6b8e9b[_0x0897('0x5a')];var _0x3d83d8=_0x43a276[_0x0897('0x5d')](-0x1);if(_0x3d83d8==='/'){_0x43a276=_0x43a276[_0x0897('0x5e')](0x0,_0x43a276[_0x0897('0x5f')](_0x3d83d8));}_0x42197b=util[_0x0897('0x60')]('%s/webservice.php',_0x43a276);var _0x49bdc8={'method':_0x0897('0x61'),'uri':_0x42197b,'qs':{'operation':_0x0897('0x62'),'username':_0x6b8e9b['username']},'json':!![]};return rp(_0x49bdc8);}})[_0x0897('0x24')](function(_0x5ed63a){if(_0x5ed63a[_0x0897('0x63')]){var _0x5ddec4={'method':_0x0897('0x64'),'uri':_0x42197b,'form':{'operation':'login','username':_0xe4c0c,'accessKey':md5(_0x5ed63a[_0x0897('0x65')][_0x0897('0x66')]+_0x431051)},'json':!![]};return rp(_0x5ddec4);}})['then'](function(_0x190589){if(_0x190589['success']){var _0x5a529a={'method':'GET','uri':_0x42197b,'qs':{'operation':_0x0897('0x67'),'username':_0xe4c0c,'sessionName':_0x190589[_0x0897('0x65')][_0x0897('0x68')],'elementType':_0x107590},'json':!![]};return rp(_0x5a529a);}})[_0x0897('0x24')](function(_0x3edb14){if(_0x3edb14[_0x0897('0x63')]){var _0x57a79e=['autogenerated','reference',_0x0897('0x69')];_['remove'](_0x3edb14['result']['fields'],function(_0xa8a7e8){return _0x57a79e[_0x0897('0x6a')](_0xa8a7e8[_0x0897('0x2e')][_0x0897('0x28')]);});_[_0x0897('0x6b')](_0x3edb14[_0x0897('0x65')]['fields'],function(_0x54debd){return _0x54debd[_0x0897('0x6c')]===_0x0897('0x6d');});return{'count':_0x3edb14[_0x0897('0x65')][_0x0897('0x34')][_0x0897('0x44')],'rows':_[_0x0897('0x2b')](_0x3edb14[_0x0897('0x65')][_0x0897('0x34')],function(_0x11c74b){return{'id':_0x11c74b[_0x0897('0x28')],'name':_0x11c74b['label'],'custom':_['startsWith'](_0x11c74b[_0x0897('0x28')],_0x0897('0x6e'))?!![]:![],'options':_0x11c74b[_0x0897('0x2e')][_0x0897('0x28')]===_0x0897('0x6f')&&_0x11c74b[_0x0897('0x2e')][_0x0897('0x70')]['length']>0x0?_['map'](_0x11c74b[_0x0897('0x2e')][_0x0897('0x70')],function(_0x4d114c){return{'name':_0x4d114c['label'],'value':_0x4d114c[_0x0897('0x71')]};}):[]};})};}})[_0x0897('0x24')](respondWithResult(_0x2e6616,null))[_0x0897('0x3f')](function(_0x293781){console[_0x0897('0x72')]('vTiger\x20error:\x20'+_0x293781);var _0x152a98=_0x585df8[_0x0897('0x31')][_0x0897('0x73')]?0x1f4:_0x293781[_0x0897('0x74')]||0x1f4;logger[_0x0897('0x26')](_0x0897('0x75'),_0x0897('0x56'),_0x152a98,JSON[_0x0897('0x76')](_0x293781));delete _0x293781['name'];if(_0x152a98===0x191){_0x152a98=0x190;}_0x2e6616[_0x0897('0x19')](_0x152a98)['send'](_0x585df8[_0x0897('0x31')][_0x0897('0x73')]?{'message':_0x0897('0x77'),'statusCode':_0x293781[_0x0897('0x74')]}:_0x293781);});}; \ No newline at end of file +var _0x7b7d=['getFields','username','description','remoteUri','accessKey','moduleName','slice','substring','format','%s/webservice.php','GET','getchallenge','success','login','token','describe','result','reference','remove','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','send','map','VtigerAccount','rawAttributes','type','key','name','query','keys','filters','model','fields','attributes','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','find','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','VtigerField','Descriptions'];(function(_0x4575e3,_0x48ae07){var _0x12abfa=function(_0x140342){while(--_0x140342){_0x4575e3['push'](_0x4575e3['shift']());}};_0x12abfa(++_0x48ae07);}(_0x7b7d,0x184));var _0xd7b7=function(_0x343f65,_0x1aa57a){_0x343f65=_0x343f65-0x0;var _0x13e605=_0x7b7d[_0x343f65];return _0x13e605;};'use strict';var emlformat=require(_0xd7b7('0x0'));var rimraf=require(_0xd7b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7b7('0x2'));var rp=require(_0xd7b7('0x3'));var moment=require('moment');var BPromise=require(_0xd7b7('0x4'));var Mustache=require(_0xd7b7('0x5'));var util=require(_0xd7b7('0x6'));var path=require(_0xd7b7('0x7'));var sox=require(_0xd7b7('0x8'));var csv=require(_0xd7b7('0x9'));var ejs=require(_0xd7b7('0xa'));var fs=require('fs');var fs_extra=require(_0xd7b7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd7b7('0xc'));var toCsv=require(_0xd7b7('0x9'));var querystring=require(_0xd7b7('0xd'));var Papa=require(_0xd7b7('0xe'));var Redis=require(_0xd7b7('0xf'));var authService=require(_0xd7b7('0x10'));var qs=require(_0xd7b7('0x11'));var as=require(_0xd7b7('0x12'));var hardwareService=require(_0xd7b7('0x13'));var logger=require('../../config/logger')(_0xd7b7('0x14'));var utils=require('../../config/utils');var config=require(_0xd7b7('0x15'));var licenseUtil=require(_0xd7b7('0x16'));var db=require(_0xd7b7('0x17'))['db'];var integrations=require(_0xd7b7('0x18'));function respondWithStatusCode(_0x5cb4a8,_0x4012ec){_0x4012ec=_0x4012ec||0xcc;return function(_0x488d63){if(_0x488d63){return _0x5cb4a8['sendStatus'](_0x4012ec);}return _0x5cb4a8[_0xd7b7('0x19')](_0x4012ec)['end']();};}function respondWithResult(_0x12a18a,_0xdb46d8){_0xdb46d8=_0xdb46d8||0xc8;return function(_0xe057b3){if(_0xe057b3){return _0x12a18a[_0xd7b7('0x19')](_0xdb46d8)[_0xd7b7('0x1a')](_0xe057b3);}};}function respondWithFilteredResult(_0x3e9fb8,_0x5636ad){return function(_0x550b1c){if(_0x550b1c){var _0x1792ce=typeof _0x5636ad['offset']==='undefined'&&typeof _0x5636ad[_0xd7b7('0x1b')]===_0xd7b7('0x1c');var _0x13ad78=_0x550b1c[_0xd7b7('0x1d')];var _0x23ac2d=_0x1792ce?0x0:_0x5636ad[_0xd7b7('0x1e')];var _0x333e97=_0x1792ce?_0x550b1c[_0xd7b7('0x1d')]:_0x5636ad[_0xd7b7('0x1e')]+_0x5636ad[_0xd7b7('0x1b')];var _0x383533;if(_0x333e97>=_0x13ad78){_0x333e97=_0x13ad78;_0x383533=0xc8;}else{_0x383533=0xce;}_0x3e9fb8['status'](_0x383533);return _0x3e9fb8[_0xd7b7('0x1f')](_0xd7b7('0x20'),_0x23ac2d+'-'+_0x333e97+'/'+_0x13ad78)[_0xd7b7('0x1a')](_0x550b1c);}return null;};}function patchUpdates(_0x562592){return function(_0x4f93c3){try{jsonpatch[_0xd7b7('0x21')](_0x4f93c3,_0x562592,!![]);}catch(_0x21b69a){return BPromise[_0xd7b7('0x22')](_0x21b69a);}return _0x4f93c3[_0xd7b7('0x23')]();};}function saveUpdates(_0x5a301a,_0x42e5a1){return function(_0x3e017a){if(_0x3e017a){return _0x3e017a[_0xd7b7('0x24')](_0x5a301a)['then'](function(_0x386e08){return _0x386e08;});}return null;};}function removeEntity(_0x2567a9,_0x156a6b){return function(_0x1f6825){if(_0x1f6825){return _0x1f6825[_0xd7b7('0x25')]()[_0xd7b7('0x26')](function(){_0x2567a9[_0xd7b7('0x19')](0xcc)[_0xd7b7('0x27')]();});}};}function handleEntityNotFound(_0x360187,_0x427fee){return function(_0x112ea5){if(!_0x112ea5){_0x360187[_0xd7b7('0x28')](0x194);}return _0x112ea5;};}function handleError(_0x3f185a,_0x181272){_0x181272=_0x181272||0x1f4;return function(_0x22c2a6){logger[_0xd7b7('0x29')](_0x22c2a6[_0xd7b7('0x2a')]);if(_0x22c2a6['name']){delete _0x22c2a6['name'];}_0x3f185a[_0xd7b7('0x19')](_0x181272)[_0xd7b7('0x2b')](_0x22c2a6);};}exports['index']=function(_0x796b9b,_0x376924){var _0xab50f0={},_0x2fe517={},_0x956901={'count':0x0,'rows':[]};var _0x4cf8d6=_[_0xd7b7('0x2c')](db[_0xd7b7('0x2d')][_0xd7b7('0x2e')],function(_0x3f7ea5){return{'name':_0x3f7ea5['fieldName'],'type':_0x3f7ea5[_0xd7b7('0x2f')][_0xd7b7('0x30')]};});_0x2fe517['model']=_['map'](_0x4cf8d6,_0xd7b7('0x31'));_0x2fe517[_0xd7b7('0x32')]=_[_0xd7b7('0x33')](_0x796b9b[_0xd7b7('0x32')]);_0x2fe517[_0xd7b7('0x34')]=_['intersection'](_0x2fe517['model'],_0x2fe517['query']);_0xab50f0['attributes']=_['intersection'](_0x2fe517[_0xd7b7('0x35')],qs[_0xd7b7('0x36')](_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x36')]));_0xab50f0[_0xd7b7('0x37')]=_0xab50f0[_0xd7b7('0x37')]['length']?_0xab50f0[_0xd7b7('0x37')]:_0x2fe517[_0xd7b7('0x35')];if(!_0x796b9b['query']['hasOwnProperty']('nolimit')){_0xab50f0[_0xd7b7('0x1b')]=qs[_0xd7b7('0x1b')](_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x1b')]);_0xab50f0['offset']=qs[_0xd7b7('0x1e')](_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x1e')]);}_0xab50f0['order']=qs[_0xd7b7('0x38')](_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x38')]);_0xab50f0[_0xd7b7('0x39')]=qs['filters'](_[_0xd7b7('0x3a')](_0x796b9b[_0xd7b7('0x32')],_0x2fe517[_0xd7b7('0x34')]),_0x4cf8d6);if(_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x3b')]){_0xab50f0[_0xd7b7('0x39')]=_[_0xd7b7('0x3c')](_0xab50f0['where'],{'$or':_[_0xd7b7('0x2c')](_0x4cf8d6,function(_0x523641){if(_0x523641[_0xd7b7('0x2f')]!==_0xd7b7('0x3d')){var _0x513b14={};_0x513b14[_0x523641[_0xd7b7('0x31')]]={'$like':'%'+_0x796b9b[_0xd7b7('0x32')][_0xd7b7('0x3b')]+'%'};return _0x513b14;}})});}_0xab50f0=_[_0xd7b7('0x3c')]({},_0xab50f0,_0x796b9b[_0xd7b7('0x3e')]);var _0x225832={'where':_0xab50f0['where']};return db['VtigerAccount']['count'](_0x225832)[_0xd7b7('0x26')](function(_0x3ed787){_0x956901[_0xd7b7('0x1d')]=_0x3ed787;if(_0x796b9b['query'][_0xd7b7('0x3f')]){_0xab50f0[_0xd7b7('0x40')]=[{'all':!![]}];}return db[_0xd7b7('0x2d')][_0xd7b7('0x41')](_0xab50f0);})['then'](function(_0x3500e9){_0x956901[_0xd7b7('0x42')]=_0x3500e9;return _0x956901;})[_0xd7b7('0x26')](respondWithFilteredResult(_0x376924,_0xab50f0))[_0xd7b7('0x43')](handleError(_0x376924,null));};exports[_0xd7b7('0x44')]=function(_0xe3ad36,_0x4fdb98){var _0x2fb8a1={'raw':![],'where':{'id':_0xe3ad36[_0xd7b7('0x45')]['id']}},_0x20245e={};_0x20245e[_0xd7b7('0x35')]=_['keys'](db[_0xd7b7('0x2d')][_0xd7b7('0x2e')]);_0x20245e[_0xd7b7('0x32')]=_['keys'](_0xe3ad36[_0xd7b7('0x32')]);_0x20245e[_0xd7b7('0x34')]=_['intersection'](_0x20245e['model'],_0x20245e[_0xd7b7('0x32')]);_0x2fb8a1[_0xd7b7('0x37')]=_[_0xd7b7('0x46')](_0x20245e[_0xd7b7('0x35')],qs[_0xd7b7('0x36')](_0xe3ad36[_0xd7b7('0x32')][_0xd7b7('0x36')]));_0x2fb8a1[_0xd7b7('0x37')]=_0x2fb8a1['attributes'][_0xd7b7('0x47')]?_0x2fb8a1['attributes']:_0x20245e[_0xd7b7('0x35')];if(_0xe3ad36[_0xd7b7('0x32')][_0xd7b7('0x3f')]){_0x2fb8a1[_0xd7b7('0x40')]=[{'all':!![]}];}_0x2fb8a1=_['merge']({},_0x2fb8a1,_0xe3ad36[_0xd7b7('0x3e')]);return db[_0xd7b7('0x2d')]['find'](_0x2fb8a1)['then'](handleEntityNotFound(_0x4fdb98,null))[_0xd7b7('0x26')](respondWithResult(_0x4fdb98,null))[_0xd7b7('0x43')](handleError(_0x4fdb98,null));};exports[_0xd7b7('0x48')]=function(_0x17a0ee,_0x4aefa0){return db['VtigerAccount'][_0xd7b7('0x48')](_0x17a0ee[_0xd7b7('0x49')],{})[_0xd7b7('0x26')](respondWithResult(_0x4aefa0,0xc9))[_0xd7b7('0x43')](handleError(_0x4aefa0,null));};exports[_0xd7b7('0x24')]=function(_0x3124fb,_0x72edf){if(_0x3124fb['body']['id']){delete _0x3124fb[_0xd7b7('0x49')]['id'];}return db[_0xd7b7('0x2d')][_0xd7b7('0x4a')]({'where':{'id':_0x3124fb[_0xd7b7('0x45')]['id']}})[_0xd7b7('0x26')](handleEntityNotFound(_0x72edf,null))[_0xd7b7('0x26')](saveUpdates(_0x3124fb['body'],null))['then'](respondWithResult(_0x72edf,null))[_0xd7b7('0x43')](handleError(_0x72edf,null));};exports[_0xd7b7('0x25')]=function(_0x25126b,_0x34cd82){return db[_0xd7b7('0x2d')][_0xd7b7('0x4a')]({'where':{'id':_0x25126b[_0xd7b7('0x45')]['id']}})['then'](handleEntityNotFound(_0x34cd82,null))[_0xd7b7('0x26')](removeEntity(_0x34cd82,null))[_0xd7b7('0x43')](handleError(_0x34cd82,null));};exports[_0xd7b7('0x4b')]=function(_0x369ce6,_0x37f40d,_0x9180d5){var _0x3f6684={};var _0x121ba7={};var _0x207ef1;var _0x154ff2;return db[_0xd7b7('0x2d')][_0xd7b7('0x4c')]({'where':{'id':_0x369ce6['params']['id']}})[_0xd7b7('0x26')](handleEntityNotFound(_0x37f40d,null))[_0xd7b7('0x26')](function(_0x1a4a3f){if(_0x1a4a3f){_0x207ef1=_0x1a4a3f;_0x121ba7[_0xd7b7('0x35')]=_[_0xd7b7('0x33')](db[_0xd7b7('0x4d')][_0xd7b7('0x2e')]);_0x121ba7[_0xd7b7('0x32')]=_[_0xd7b7('0x33')](_0x369ce6[_0xd7b7('0x32')]);_0x121ba7[_0xd7b7('0x34')]=_[_0xd7b7('0x46')](_0x121ba7['model'],_0x121ba7[_0xd7b7('0x32')]);_0x3f6684[_0xd7b7('0x37')]=_[_0xd7b7('0x46')](_0x121ba7[_0xd7b7('0x35')],qs['fields'](_0x369ce6['query'][_0xd7b7('0x36')]));_0x3f6684['attributes']=_0x3f6684['attributes'][_0xd7b7('0x47')]?_0x3f6684[_0xd7b7('0x37')]:_0x121ba7[_0xd7b7('0x35')];_0x3f6684[_0xd7b7('0x4e')]=qs[_0xd7b7('0x38')](_0x369ce6[_0xd7b7('0x32')][_0xd7b7('0x38')]);_0x3f6684[_0xd7b7('0x39')]=qs[_0xd7b7('0x34')](_['pick'](_0x369ce6[_0xd7b7('0x32')],_0x121ba7[_0xd7b7('0x34')]));if(_0x369ce6[_0xd7b7('0x32')][_0xd7b7('0x3b')]){_0x3f6684[_0xd7b7('0x39')]=_[_0xd7b7('0x3c')](_0x3f6684['where'],{'$or':_[_0xd7b7('0x2c')](_0x3f6684['attributes'],function(_0x4dc72a){var _0x16f23b={};_0x16f23b[_0x4dc72a]={'$like':'%'+_0x369ce6[_0xd7b7('0x32')]['filter']+'%'};return _0x16f23b;})});}_0x3f6684=_[_0xd7b7('0x3c')]({},_0x3f6684,_0x369ce6['options']);return _0x207ef1[_0xd7b7('0x4b')](_0x3f6684);}})[_0xd7b7('0x26')](function(_0x2f28fe){if(_0x2f28fe){_0x154ff2=_0x2f28fe[_0xd7b7('0x47')];if(!_0x369ce6[_0xd7b7('0x32')][_0xd7b7('0x4f')](_0xd7b7('0x50'))){_0x3f6684[_0xd7b7('0x1b')]=qs[_0xd7b7('0x1b')](_0x369ce6[_0xd7b7('0x32')][_0xd7b7('0x1b')]);_0x3f6684[_0xd7b7('0x1e')]=qs[_0xd7b7('0x1e')](_0x369ce6[_0xd7b7('0x32')]['offset']);}return _0x207ef1[_0xd7b7('0x4b')](_0x3f6684);}})[_0xd7b7('0x26')](function(_0x121534){if(_0x121534){return _0x121534?{'count':_0x154ff2,'rows':_0x121534}:null;}})[_0xd7b7('0x26')](respondWithResult(_0x37f40d,null))[_0xd7b7('0x43')](handleError(_0x37f40d,null));};exports[_0xd7b7('0x51')]=function(_0x2f9cf7,_0x5d8ae8,_0x1836c4){if(_0x2f9cf7['body']['id']){delete _0x2f9cf7[_0xd7b7('0x49')]['id'];}return db['VtigerAccount'][_0xd7b7('0x4c')]({'where':{'id':_0x2f9cf7['params']['id']}})['then'](handleEntityNotFound(_0x5d8ae8,null))[_0xd7b7('0x26')](function(_0x30ae60){if(_0x30ae60){_0x2f9cf7[_0xd7b7('0x49')][_0xd7b7('0x52')]=_0x30ae60['id'];_0x2f9cf7[_0xd7b7('0x49')]['Subjects']=integrations[_0xd7b7('0x53')](_0x2f9cf7['body'][_0xd7b7('0x54')],_0x2f9cf7['body'][_0xd7b7('0x2f')]);_0x2f9cf7[_0xd7b7('0x49')]['Descriptions']=integrations[_0xd7b7('0x55')](_0x2f9cf7[_0xd7b7('0x49')][_0xd7b7('0x54')],_0x2f9cf7[_0xd7b7('0x49')][_0xd7b7('0x2f')]);return db['VtigerConfiguration'][_0xd7b7('0x48')](_0x2f9cf7[_0xd7b7('0x49')],{'include':[{'model':db[_0xd7b7('0x56')],'as':'Subjects'},{'model':db[_0xd7b7('0x56')],'as':_0xd7b7('0x57')}]});}return null;})[_0xd7b7('0x26')](respondWithResult(_0x5d8ae8,null))['catch'](handleError(_0x5d8ae8,null));};var md5=require('md5');exports[_0xd7b7('0x58')]=function(_0x278ae8,_0x32474f,_0x96b44a){var _0x16c389=null;var _0x246b9a=null;var _0xabe72e=null;var _0x370b0c=null;var _0x50606f='';return db[_0xd7b7('0x2d')][_0xd7b7('0x4c')]({'where':{'id':_0x278ae8[_0xd7b7('0x45')]['id']},'attributes':['id',_0xd7b7('0x31'),_0xd7b7('0x59'),_0xd7b7('0x5a'),'moduleName',_0xd7b7('0x5b'),'serverUrl',_0xd7b7('0x5c')]})[_0xd7b7('0x26')](handleEntityNotFound(_0x32474f,null))[_0xd7b7('0x26')](function(_0x353e49){if(_0x353e49){_0x16c389=_0x353e49[_0xd7b7('0x59')];_0x246b9a=_0x353e49[_0xd7b7('0x5c')];_0xabe72e=_0x353e49[_0xd7b7('0x5d')];_0x50606f=_0x353e49[_0xd7b7('0x5b')];var _0x4a634e=_0x50606f[_0xd7b7('0x5e')](-0x1);if(_0x4a634e==='/'){_0x50606f=_0x50606f[_0xd7b7('0x5f')](0x0,_0x50606f['lastIndexOf'](_0x4a634e));}_0x370b0c=util[_0xd7b7('0x60')](_0xd7b7('0x61'),_0x50606f);var _0x5d55e0={'method':_0xd7b7('0x62'),'uri':_0x370b0c,'qs':{'operation':_0xd7b7('0x63'),'username':_0x353e49[_0xd7b7('0x59')]},'json':!![]};return rp(_0x5d55e0);}})['then'](function(_0x51113c){if(_0x51113c[_0xd7b7('0x64')]){var _0x1d4301={'method':'POST','uri':_0x370b0c,'form':{'operation':_0xd7b7('0x65'),'username':_0x16c389,'accessKey':md5(_0x51113c['result'][_0xd7b7('0x66')]+_0x246b9a)},'json':!![]};return rp(_0x1d4301);}})[_0xd7b7('0x26')](function(_0x4cbc20){if(_0x4cbc20[_0xd7b7('0x64')]){var _0x418ea5={'method':_0xd7b7('0x62'),'uri':_0x370b0c,'qs':{'operation':_0xd7b7('0x67'),'username':_0x16c389,'sessionName':_0x4cbc20[_0xd7b7('0x68')]['sessionName'],'elementType':_0xabe72e},'json':!![]};return rp(_0x418ea5);}})[_0xd7b7('0x26')](function(_0x147a90){if(_0x147a90[_0xd7b7('0x64')]){var _0x5dff10=['autogenerated',_0xd7b7('0x69'),'owner'];_[_0xd7b7('0x6a')](_0x147a90[_0xd7b7('0x68')]['fields'],function(_0x16d851){return _0x5dff10['includes'](_0x16d851[_0xd7b7('0x2f')][_0xd7b7('0x31')]);});_[_0xd7b7('0x6a')](_0x147a90['result'][_0xd7b7('0x36')],function(_0x593e96){return _0x593e96['editable']===_0xd7b7('0x6b');});return{'count':_0x147a90[_0xd7b7('0x68')][_0xd7b7('0x36')][_0xd7b7('0x47')],'rows':_['map'](_0x147a90[_0xd7b7('0x68')]['fields'],function(_0x45990a){return{'id':_0x45990a[_0xd7b7('0x31')],'name':_0x45990a[_0xd7b7('0x6c')],'custom':_[_0xd7b7('0x6d')](_0x45990a[_0xd7b7('0x31')],_0xd7b7('0x6e'))?!![]:![],'options':_0x45990a[_0xd7b7('0x2f')][_0xd7b7('0x31')]==='picklist'&&_0x45990a['type'][_0xd7b7('0x6f')]['length']>0x0?_[_0xd7b7('0x2c')](_0x45990a['type'][_0xd7b7('0x6f')],function(_0x3a1316){return{'name':_0x3a1316[_0xd7b7('0x6c')],'value':_0x3a1316[_0xd7b7('0x70')]};}):[]};})};}})['then'](respondWithResult(_0x32474f,null))[_0xd7b7('0x43')](function(_0x544a2c){console[_0xd7b7('0x71')](_0xd7b7('0x72')+_0x544a2c);var _0x1bec9f=_0x278ae8[_0xd7b7('0x32')][_0xd7b7('0x73')]?0x1f4:_0x544a2c[_0xd7b7('0x74')]||0x1f4;logger[_0xd7b7('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd7b7('0x58'),_0x1bec9f,JSON[_0xd7b7('0x75')](_0x544a2c));delete _0x544a2c[_0xd7b7('0x31')];if(_0x1bec9f===0x191){_0x1bec9f=0x190;}_0x32474f[_0xd7b7('0x19')](_0x1bec9f)[_0xd7b7('0x2b')](_0x278ae8[_0xd7b7('0x32')][_0xd7b7('0x73')]?{'message':_0xd7b7('0x76'),'statusCode':_0x544a2c[_0xd7b7('0x74')]}:_0x544a2c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6a149b4..fe1ccdd 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 _0x4d32=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash'];(function(_0x5c98cc,_0x58190a){var _0x164644=function(_0x540bae){while(--_0x540bae){_0x5c98cc['push'](_0x5c98cc['shift']());}};_0x164644(++_0x58190a);}(_0x4d32,0x1b9));var _0x24d3=function(_0xb0ed0c,_0x1a1fb1){_0xb0ed0c=_0xb0ed0c-0x0;var _0x5d5356=_0x4d32[_0xb0ed0c];return _0x5d5356;};'use strict';var _=require(_0x24d3('0x0'));var util=require('util');var logger=require(_0x24d3('0x1'))('api');var moment=require(_0x24d3('0x2'));var BPromise=require(_0x24d3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24d3('0x4'));var rimraf=require(_0x24d3('0x5'));var config=require(_0x24d3('0x6'));var attributes=require(_0x24d3('0x7'));var integrations=require(_0x24d3('0x8'));module[_0x24d3('0x9')]=function(_0x142de2,_0x26afd8){return _0x142de2[_0x24d3('0xa')](_0x24d3('0xb'),attributes,{'tableName':_0x24d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x431b=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','moment'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x431b,0x176));var _0xb431=function(_0x7a0496,_0x3b4dbc){_0x7a0496=_0x7a0496-0x0;var _0x4d5a25=_0x431b[_0x7a0496];return _0x4d5a25;};'use strict';var _=require(_0xb431('0x0'));var util=require(_0xb431('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb431('0x2'));var BPromise=require(_0xb431('0x3'));var rp=require(_0xb431('0x4'));var fs=require('fs');var path=require(_0xb431('0x5'));var rimraf=require(_0xb431('0x6'));var config=require(_0xb431('0x7'));var attributes=require(_0xb431('0x8'));var integrations=require(_0xb431('0x9'));module[_0xb431('0xa')]=function(_0x757ef6,_0x4e2089){return _0x757ef6[_0xb431('0xb')]('VtigerAccount',attributes,{'tableName':_0xb431('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 cb89a8e..9a86139 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 _0xe605=['include','map','model','ShowVtigerAccount','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe605,0x92));var _0x5e60=function(_0x4d8dc7,_0x18c3a4){_0x4d8dc7=_0x4d8dc7-0x0;var _0x537a9b=_0xe605[_0x4d8dc7];return _0x537a9b;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')]({'raw':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'limit':_0x5c485d['options']?_0x5c485d[_0x5e60('0x19')]['limit']||null:null,'include':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')],function(_0x2636f1){return{'model':db[_0x2636f1['model']],'as':_0x2636f1['as'],'attributes':_0x2636f1[_0x5e60('0x1c')],'include':_0x2636f1[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2636f1['include'],function(_0x45cb62){return{'model':db[_0x45cb62[_0x5e60('0x1f')]],'as':_0x45cb62['as'],'attributes':_0x45cb62[_0x5e60('0x1c')],'include':_0x45cb62[_0x5e60('0x1d')]?_['map'](_0x45cb62[_0x5e60('0x1d')],function(_0x5712f7){return{'model':db[_0x5712f7[_0x5e60('0x1f')]],'as':_0x5712f7['as'],'attributes':_0x5712f7[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46691f){logger[_0x5e60('0xe')]('GetVtigerAccount',_0x5c485d);logger[_0x5e60('0x11')](_0x5e60('0x16'),_0x5c485d,JSON['stringify'](_0x46691f));_0x22d718(_0x46691f);})['catch'](function(_0x52f668){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x52f668[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x52f668[_0x5e60('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x168ce6){var _0x405461=this;return new Promise(function(_0x4d4b55,_0x11fc87){return db['VtigerAccount']['find']({'raw':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'include':_0x168ce6[_0x5e60('0x19')]?_0x168ce6['options'][_0x5e60('0x1d')]?_['map'](_0x168ce6['options'][_0x5e60('0x1d')],function(_0x317206){return{'model':db[_0x317206['model']],'as':_0x317206['as'],'attributes':_0x317206[_0x5e60('0x1c')],'include':_0x317206['include']?_[_0x5e60('0x1e')](_0x317206[_0x5e60('0x1d')],function(_0x2b2426){return{'model':db[_0x2b2426[_0x5e60('0x1f')]],'as':_0x2b2426['as'],'attributes':_0x2b2426[_0x5e60('0x1c')],'include':_0x2b2426[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2b2426[_0x5e60('0x1d')],function(_0x5b3aa5){return{'model':db[_0x5b3aa5[_0x5e60('0x1f')]],'as':_0x5b3aa5['as'],'attributes':_0x5b3aa5[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5e60('0xd')](function(_0x1a3782){logger[_0x5e60('0xe')](_0x5e60('0x20'),_0x168ce6);logger[_0x5e60('0x11')]('ShowVtigerAccount',_0x168ce6,JSON[_0x5e60('0x21')](_0x1a3782));_0x4d4b55(_0x1a3782);})[_0x5e60('0x22')](function(_0x4cba18){logger['error'](_0x5e60('0x20'),_0x4cba18[_0x5e60('0x14')],_0x168ce6);_0x11fc87(_0x405461[_0x5e60('0x12')](0x1f4,_0x4cba18[_0x5e60('0x14')]));});});}; \ No newline at end of file +var _0x9348=['http','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetVtigerAccount','catch','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x392394,_0x1f1255){var _0x41db22=function(_0x46d04d){while(--_0x46d04d){_0x392394['push'](_0x392394['shift']());}};_0x41db22(++_0x1f1255);}(_0x9348,0x10d));var _0x8934=function(_0x57f7e7,_0x5c43c6){_0x57f7e7=_0x57f7e7-0x0;var _0x5559d9=_0x9348[_0x57f7e7];return _0x5559d9;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['GetVtigerAccount']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')]({'raw':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x19')]===undefined?!![]:![]:!![],'where':_0x47f25e['options']?_0x47f25e[_0x8934('0x18')]['where']||null:null,'attributes':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1a')]||null:null,'limit':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1b')]||null:null,'include':_0x47f25e[_0x8934('0x18')]?_0x47f25e['options'][_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x47f25e[_0x8934('0x18')][_0x8934('0x1c')],function(_0x43b89a){return{'model':db[_0x43b89a['model']],'as':_0x43b89a['as'],'attributes':_0x43b89a[_0x8934('0x1a')],'include':_0x43b89a[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x43b89a['include'],function(_0x16cfc2){return{'model':db[_0x16cfc2['model']],'as':_0x16cfc2['as'],'attributes':_0x16cfc2[_0x8934('0x1a')],'include':_0x16cfc2[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x16cfc2['include'],function(_0x1fd5eb){return{'model':db[_0x1fd5eb[_0x8934('0x1e')]],'as':_0x1fd5eb['as'],'attributes':_0x1fd5eb[_0x8934('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x1f')](function(_0x4b5780){logger[_0x8934('0x14')](_0x8934('0x20'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x20'),_0x47f25e,JSON[_0x8934('0x10')](_0x4b5780));_0x2ff9ce(_0x4b5780);})[_0x8934('0x21')](function(_0x3f328a){logger[_0x8934('0x11')](_0x8934('0x20'),_0x3f328a[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed['error'](0x1f4,_0x3f328a[_0x8934('0x13')]));});});};exports[_0x8934('0x22')]=function(_0x54d28d){var _0x2aa18e=this;return new Promise(function(_0x3d60f9,_0x1a17b5){return db[_0x8934('0x16')]['find']({'raw':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')][_0x8934('0x19')]===undefined?!![]:![]:!![],'where':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')]['where']||null:null,'attributes':_0x54d28d[_0x8934('0x18')]?_0x54d28d['options']['attributes']||null:null,'include':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')][_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x54d28d['options'][_0x8934('0x1c')],function(_0x22aebe){return{'model':db[_0x22aebe[_0x8934('0x1e')]],'as':_0x22aebe['as'],'attributes':_0x22aebe[_0x8934('0x1a')],'include':_0x22aebe[_0x8934('0x1c')]?_['map'](_0x22aebe[_0x8934('0x1c')],function(_0x1ea0cd){return{'model':db[_0x1ea0cd['model']],'as':_0x1ea0cd['as'],'attributes':_0x1ea0cd['attributes'],'include':_0x1ea0cd[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x1ea0cd['include'],function(_0x519273){return{'model':db[_0x519273[_0x8934('0x1e')]],'as':_0x519273['as'],'attributes':_0x519273[_0x8934('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x1f')](function(_0x207ad4){logger[_0x8934('0x14')](_0x8934('0x22'),_0x54d28d);logger[_0x8934('0xd')](_0x8934('0x22'),_0x54d28d,JSON[_0x8934('0x10')](_0x207ad4));_0x3d60f9(_0x207ad4);})[_0x8934('0x21')](function(_0x46611c){logger['error'](_0x8934('0x22'),_0x46611c[_0x8934('0x13')],_0x54d28d);_0x1a17b5(_0x2aa18e['error'](0x1f4,_0x46611c[_0x8934('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 2e152d4..97f43e4 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 _0x6096=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','/:id','isAuthenticated'];(function(_0x40df2a,_0x3db29f){var _0x5d3334=function(_0x1c370b){while(--_0x1c370b){_0x40df2a['push'](_0x40df2a['shift']());}};_0x5d3334(++_0x3db29f);}(_0x6096,0xbb));var _0x6609=function(_0x4713b9,_0x4d89ca){_0x4713b9=_0x4713b9-0x0;var _0x200680=_0x6096[_0x4713b9];return _0x200680;};'use strict';var multer=require(_0x6609('0x0'));var util=require('util');var path=require(_0x6609('0x1'));var timeout=require('connect-timeout');var express=require(_0x6609('0x2'));var router=express[_0x6609('0x3')]();var fs_extra=require(_0x6609('0x4'));var auth=require(_0x6609('0x5'));var interaction=require(_0x6609('0x6'));var config=require('../../config/environment');var controller=require(_0x6609('0x7'));router[_0x6609('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6609('0x8')](_0x6609('0x9'),auth[_0x6609('0xa')](),controller['show']);router[_0x6609('0x8')](_0x6609('0xb'),auth[_0x6609('0xa')](),controller['getFields']);router[_0x6609('0x8')](_0x6609('0xc'),auth[_0x6609('0xa')](),controller[_0x6609('0xd')]);router['get'](_0x6609('0xe'),auth['isAuthenticated'](),controller[_0x6609('0xf')]);router[_0x6609('0x10')]('/',auth[_0x6609('0xa')](),controller[_0x6609('0x11')]);router['put'](_0x6609('0x9'),auth[_0x6609('0xa')](),controller[_0x6609('0x12')]);router[_0x6609('0x13')]('/:id',auth[_0x6609('0xa')](),controller[_0x6609('0x14')]);module[_0x6609('0x15')]=router; \ No newline at end of file +var _0xc10e=['connect-timeout','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy','multer','util','path'];(function(_0x2b03c2,_0x1e21dc){var _0x160b8e=function(_0x21e503){while(--_0x21e503){_0x2b03c2['push'](_0x2b03c2['shift']());}};_0x160b8e(++_0x1e21dc);}(_0xc10e,0x81));var _0xec10=function(_0x19fa06,_0x14dcc6){_0x19fa06=_0x19fa06-0x0;var _0x278075=_0xc10e[_0x19fa06];return _0x278075;};'use strict';var multer=require(_0xec10('0x0'));var util=require(_0xec10('0x1'));var path=require(_0xec10('0x2'));var timeout=require(_0xec10('0x3'));var express=require('express');var router=express[_0xec10('0x4')]();var fs_extra=require(_0xec10('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec10('0x6'));var config=require('../../config/environment');var controller=require(_0xec10('0x7'));router[_0xec10('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec10('0x8')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller[_0xec10('0xb')]);router['get'](_0xec10('0xc'),auth[_0xec10('0xa')](),controller[_0xec10('0xd')]);router[_0xec10('0x8')](_0xec10('0xe'),auth[_0xec10('0xa')](),controller[_0xec10('0xf')]);router[_0xec10('0x8')]('/:id/descriptions',auth[_0xec10('0xa')](),controller[_0xec10('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xec10('0x11')]);router[_0xec10('0x12')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller[_0xec10('0x13')]);router[_0xec10('0x14')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller[_0xec10('0x15')]);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 8eec380..e3f127a 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 _0x63df=['STRING','sequelize','exports'];(function(_0x1c1a68,_0x3ff826){var _0x319750=function(_0x415c36){while(--_0x415c36){_0x1c1a68['push'](_0x1c1a68['shift']());}};_0x319750(++_0x3ff826);}(_0x63df,0x1ed));var _0xf63d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x63df[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xf63d('0x0'));module[_0xf63d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf63d('0x2')]}}; \ No newline at end of file +var _0x1509=['exports','STRING','sequelize'];(function(_0x123f2c,_0x5295ba){var _0x580714=function(_0x19e207){while(--_0x19e207){_0x123f2c['push'](_0x123f2c['shift']());}};_0x580714(++_0x5295ba);}(_0x1509,0x173));var _0x9150=function(_0x2c5e96,_0x1442d2){_0x2c5e96=_0x2c5e96-0x0;var _0x2b6921=_0x1509[_0x2c5e96];return _0x2b6921;};'use strict';var Sequelize=require(_0x9150('0x0'));module[_0x9150('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9150('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 6b331f3..41fed5d 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 _0x0427=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','VtigerConfiguration','rows','catch','show','keys','includeAll','find','create','body','update','params','getFields','VtigerField','rawAttributes','length','getSubjects','findOne','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0427,0x137));var _0x7042=function(_0x2894a6,_0x381a84){_0x2894a6=_0x2894a6-0x0;var _0x5c9db1=_0x0427[_0x2894a6];return _0x5c9db1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7042('0x0'));var jsonpatch=require(_0x7042('0x1'));var rp=require('request-promise');var moment=require(_0x7042('0x2'));var BPromise=require(_0x7042('0x3'));var Mustache=require(_0x7042('0x4'));var util=require(_0x7042('0x5'));var path=require(_0x7042('0x6'));var sox=require(_0x7042('0x7'));var csv=require(_0x7042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7042('0x9'));var _=require(_0x7042('0xa'));var squel=require(_0x7042('0xb'));var crypto=require(_0x7042('0xc'));var jsforce=require(_0x7042('0xd'));var deskjs=require(_0x7042('0xe'));var toCsv=require(_0x7042('0x8'));var querystring=require(_0x7042('0xf'));var Papa=require(_0x7042('0x10'));var Redis=require('ioredis');var authService=require(_0x7042('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7042('0x12'));var utils=require('../../config/utils');var config=require(_0x7042('0x13'));var licenseUtil=require(_0x7042('0x14'));var db=require(_0x7042('0x15'))['db'];function respondWithStatusCode(_0x5629f2,_0x5c06f0){_0x5c06f0=_0x5c06f0||0xcc;return function(_0x292c4a){if(_0x292c4a){return _0x5629f2[_0x7042('0x16')](_0x5c06f0);}return _0x5629f2[_0x7042('0x17')](_0x5c06f0)[_0x7042('0x18')]();};}function respondWithResult(_0x25dfe5,_0xee4c2){_0xee4c2=_0xee4c2||0xc8;return function(_0x5def25){if(_0x5def25){return _0x25dfe5[_0x7042('0x17')](_0xee4c2)[_0x7042('0x19')](_0x5def25);}};}function respondWithFilteredResult(_0x6ed505,_0x5c1ef0){return function(_0x4c68c4){if(_0x4c68c4){var _0xc7e44e=typeof _0x5c1ef0['offset']===_0x7042('0x1a')&&typeof _0x5c1ef0['limit']==='undefined';var _0x28add7=_0x4c68c4[_0x7042('0x1b')];var _0x1e69aa=_0xc7e44e?0x0:_0x5c1ef0[_0x7042('0x1c')];var _0x6e18fb=_0xc7e44e?_0x4c68c4['count']:_0x5c1ef0[_0x7042('0x1c')]+_0x5c1ef0[_0x7042('0x1d')];var _0x34fda6;if(_0x6e18fb>=_0x28add7){_0x6e18fb=_0x28add7;_0x34fda6=0xc8;}else{_0x34fda6=0xce;}_0x6ed505[_0x7042('0x17')](_0x34fda6);return _0x6ed505[_0x7042('0x1e')]('Content-Range',_0x1e69aa+'-'+_0x6e18fb+'/'+_0x28add7)[_0x7042('0x19')](_0x4c68c4);}return null;};}function patchUpdates(_0x580f84){return function(_0x363f3c){try{jsonpatch['apply'](_0x363f3c,_0x580f84,!![]);}catch(_0x3b8203){return BPromise[_0x7042('0x1f')](_0x3b8203);}return _0x363f3c[_0x7042('0x20')]();};}function saveUpdates(_0x456dfc,_0x484c82){return function(_0x5a224b){if(_0x5a224b){return _0x5a224b['update'](_0x456dfc)[_0x7042('0x21')](function(_0x30a722){return _0x30a722;});}return null;};}function removeEntity(_0x3af8bc,_0x1949fe){return function(_0x48d529){if(_0x48d529){return _0x48d529[_0x7042('0x22')]()[_0x7042('0x21')](function(){_0x3af8bc[_0x7042('0x17')](0xcc)[_0x7042('0x18')]();});}};}function handleEntityNotFound(_0x459ff6,_0x54445b){return function(_0xc5fed3){if(!_0xc5fed3){_0x459ff6[_0x7042('0x16')](0x194);}return _0xc5fed3;};}function handleError(_0xf3c3f9,_0x1a05d1){_0x1a05d1=_0x1a05d1||0x1f4;return function(_0x2e4dbe){logger[_0x7042('0x23')](_0x2e4dbe[_0x7042('0x24')]);if(_0x2e4dbe[_0x7042('0x25')]){delete _0x2e4dbe[_0x7042('0x25')];}_0xf3c3f9[_0x7042('0x17')](_0x1a05d1)[_0x7042('0x26')](_0x2e4dbe);};}exports[_0x7042('0x27')]=function(_0x88c156,_0x1b6a29){var _0x101b89={},_0x3203f3={},_0x477972={'count':0x0,'rows':[]};var _0xa7461d=_[_0x7042('0x28')](db['VtigerConfiguration']['rawAttributes'],function(_0x37cf52){return{'name':_0x37cf52[_0x7042('0x29')],'type':_0x37cf52[_0x7042('0x2a')][_0x7042('0x2b')]};});_0x3203f3[_0x7042('0x2c')]=_[_0x7042('0x28')](_0xa7461d,_0x7042('0x25'));_0x3203f3['query']=_['keys'](_0x88c156[_0x7042('0x2d')]);_0x3203f3[_0x7042('0x2e')]=_['intersection'](_0x3203f3[_0x7042('0x2c')],_0x3203f3[_0x7042('0x2d')]);_0x101b89['attributes']=_[_0x7042('0x2f')](_0x3203f3[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x88c156[_0x7042('0x2d')][_0x7042('0x30')]));_0x101b89['attributes']=_0x101b89[_0x7042('0x31')]['length']?_0x101b89['attributes']:_0x3203f3[_0x7042('0x2c')];if(!_0x88c156['query'][_0x7042('0x32')](_0x7042('0x33'))){_0x101b89['limit']=qs[_0x7042('0x1d')](_0x88c156['query'][_0x7042('0x1d')]);_0x101b89[_0x7042('0x1c')]=qs[_0x7042('0x1c')](_0x88c156[_0x7042('0x2d')][_0x7042('0x1c')]);}_0x101b89[_0x7042('0x34')]=qs[_0x7042('0x35')](_0x88c156[_0x7042('0x2d')][_0x7042('0x35')]);_0x101b89['where']=qs[_0x7042('0x2e')](_[_0x7042('0x36')](_0x88c156[_0x7042('0x2d')],_0x3203f3['filters']),_0xa7461d);if(_0x88c156['query'][_0x7042('0x37')]){_0x101b89[_0x7042('0x38')]=_['merge'](_0x101b89[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0xa7461d,function(_0x349198){if(_0x349198[_0x7042('0x2a')]!==_0x7042('0x39')){var _0x3abd08={};_0x3abd08[_0x349198[_0x7042('0x25')]]={'$like':'%'+_0x88c156[_0x7042('0x2d')][_0x7042('0x37')]+'%'};return _0x3abd08;}})});}_0x101b89=_[_0x7042('0x3a')]({},_0x101b89,_0x88c156[_0x7042('0x3b')]);var _0x4232c2={'where':_0x101b89[_0x7042('0x38')]};return db['VtigerConfiguration']['count'](_0x4232c2)[_0x7042('0x21')](function(_0x43f372){_0x477972[_0x7042('0x1b')]=_0x43f372;if(_0x88c156[_0x7042('0x2d')]['includeAll']){_0x101b89[_0x7042('0x3c')]=[{'all':!![]}];}return db[_0x7042('0x3d')]['findAll'](_0x101b89);})['then'](function(_0x1f8e68){_0x477972[_0x7042('0x3e')]=_0x1f8e68;return _0x477972;})[_0x7042('0x21')](respondWithFilteredResult(_0x1b6a29,_0x101b89))[_0x7042('0x3f')](handleError(_0x1b6a29,null));};exports[_0x7042('0x40')]=function(_0x4a4e90,_0x5de476){var _0x2c8d2a={'raw':![],'where':{'id':_0x4a4e90['params']['id']}},_0x3897fc={};_0x3897fc[_0x7042('0x2c')]=_[_0x7042('0x41')](db[_0x7042('0x3d')]['rawAttributes']);_0x3897fc['query']=_[_0x7042('0x41')](_0x4a4e90[_0x7042('0x2d')]);_0x3897fc[_0x7042('0x2e')]=_['intersection'](_0x3897fc[_0x7042('0x2c')],_0x3897fc[_0x7042('0x2d')]);_0x2c8d2a['attributes']=_[_0x7042('0x2f')](_0x3897fc[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x4a4e90[_0x7042('0x2d')][_0x7042('0x30')]));_0x2c8d2a[_0x7042('0x31')]=_0x2c8d2a[_0x7042('0x31')]['length']?_0x2c8d2a[_0x7042('0x31')]:_0x3897fc[_0x7042('0x2c')];if(_0x4a4e90['query'][_0x7042('0x42')]){_0x2c8d2a[_0x7042('0x3c')]=[{'all':!![]}];}_0x2c8d2a=_[_0x7042('0x3a')]({},_0x2c8d2a,_0x4a4e90[_0x7042('0x3b')]);return db[_0x7042('0x3d')][_0x7042('0x43')](_0x2c8d2a)['then'](handleEntityNotFound(_0x5de476,null))['then'](respondWithResult(_0x5de476,null))['catch'](handleError(_0x5de476,null));};exports[_0x7042('0x44')]=function(_0x55ecfe,_0x4821d3){return db[_0x7042('0x3d')]['create'](_0x55ecfe[_0x7042('0x45')],{})[_0x7042('0x21')](respondWithResult(_0x4821d3,0xc9))[_0x7042('0x3f')](handleError(_0x4821d3,null));};exports[_0x7042('0x46')]=function(_0x1a22d5,_0x11e7ce){if(_0x1a22d5[_0x7042('0x45')]['id']){delete _0x1a22d5[_0x7042('0x45')]['id'];}return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x1a22d5[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x11e7ce,null))[_0x7042('0x21')](saveUpdates(_0x1a22d5['body'],null))[_0x7042('0x21')](respondWithResult(_0x11e7ce,null))[_0x7042('0x3f')](handleError(_0x11e7ce,null));};exports[_0x7042('0x22')]=function(_0x81b898,_0x3fcf0e){return db[_0x7042('0x3d')][_0x7042('0x43')]({'where':{'id':_0x81b898[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x3fcf0e,null))[_0x7042('0x21')](removeEntity(_0x3fcf0e,null))[_0x7042('0x3f')](handleError(_0x3fcf0e,null));};exports[_0x7042('0x48')]=function(_0x79f988,_0x4d1518,_0x388c5d){var _0x4b1bba={};var _0x2cb2da={};var _0x1a2b3a;var _0x418794;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x79f988[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x4d1518,null))[_0x7042('0x21')](function(_0x43fd19){if(_0x43fd19){_0x1a2b3a=_0x43fd19;_0x2cb2da['model']=_['keys'](db[_0x7042('0x49')][_0x7042('0x4a')]);_0x2cb2da['query']=_[_0x7042('0x41')](_0x79f988[_0x7042('0x2d')]);_0x2cb2da['filters']=_[_0x7042('0x2f')](_0x2cb2da[_0x7042('0x2c')],_0x2cb2da['query']);_0x4b1bba[_0x7042('0x31')]=_[_0x7042('0x2f')](_0x2cb2da[_0x7042('0x2c')],qs['fields'](_0x79f988[_0x7042('0x2d')][_0x7042('0x30')]));_0x4b1bba[_0x7042('0x31')]=_0x4b1bba[_0x7042('0x31')][_0x7042('0x4b')]?_0x4b1bba[_0x7042('0x31')]:_0x2cb2da[_0x7042('0x2c')];_0x4b1bba[_0x7042('0x34')]=qs[_0x7042('0x35')](_0x79f988[_0x7042('0x2d')][_0x7042('0x35')]);_0x4b1bba[_0x7042('0x38')]=qs['filters'](_[_0x7042('0x36')](_0x79f988[_0x7042('0x2d')],_0x2cb2da[_0x7042('0x2e')]));if(_0x79f988[_0x7042('0x2d')][_0x7042('0x37')]){_0x4b1bba[_0x7042('0x38')]=_['merge'](_0x4b1bba[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0x4b1bba[_0x7042('0x31')],function(_0x4ba034){var _0x13fb0e={};_0x13fb0e[_0x4ba034]={'$like':'%'+_0x79f988[_0x7042('0x2d')][_0x7042('0x37')]+'%'};return _0x13fb0e;})});}_0x4b1bba=_[_0x7042('0x3a')]({},_0x4b1bba,_0x79f988[_0x7042('0x3b')]);return _0x1a2b3a[_0x7042('0x48')](_0x4b1bba);}})[_0x7042('0x21')](function(_0x3c55e6){if(_0x3c55e6){_0x418794=_0x3c55e6['length'];if(!_0x79f988[_0x7042('0x2d')][_0x7042('0x32')](_0x7042('0x33'))){_0x4b1bba[_0x7042('0x1d')]=qs[_0x7042('0x1d')](_0x79f988[_0x7042('0x2d')][_0x7042('0x1d')]);_0x4b1bba['offset']=qs[_0x7042('0x1c')](_0x79f988['query'][_0x7042('0x1c')]);}return _0x1a2b3a[_0x7042('0x48')](_0x4b1bba);}})[_0x7042('0x21')](function(_0x8a0a9e){if(_0x8a0a9e){return _0x8a0a9e?{'count':_0x418794,'rows':_0x8a0a9e}:null;}})['then'](respondWithResult(_0x4d1518,null))['catch'](handleError(_0x4d1518,null));};exports[_0x7042('0x4c')]=function(_0x38a9bf,_0x4d07f2,_0x242abc){var _0x412142={};var _0x12df51={};var _0x195f08;var _0x336777;return db[_0x7042('0x3d')][_0x7042('0x4d')]({'where':{'id':_0x38a9bf[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x4d07f2,null))['then'](function(_0x2185f3){if(_0x2185f3){_0x195f08=_0x2185f3;_0x12df51[_0x7042('0x2c')]=_[_0x7042('0x41')](db[_0x7042('0x49')]['rawAttributes']);_0x12df51[_0x7042('0x2d')]=_['keys'](_0x38a9bf[_0x7042('0x2d')]);_0x12df51[_0x7042('0x2e')]=_['intersection'](_0x12df51['model'],_0x12df51[_0x7042('0x2d')]);_0x412142['attributes']=_[_0x7042('0x2f')](_0x12df51[_0x7042('0x2c')],qs[_0x7042('0x30')](_0x38a9bf['query']['fields']));_0x412142['attributes']=_0x412142[_0x7042('0x31')][_0x7042('0x4b')]?_0x412142['attributes']:_0x12df51[_0x7042('0x2c')];_0x412142[_0x7042('0x34')]=qs[_0x7042('0x35')](_0x38a9bf['query'][_0x7042('0x35')]);_0x412142[_0x7042('0x38')]=qs['filters'](_['pick'](_0x38a9bf[_0x7042('0x2d')],_0x12df51['filters']));if(_0x38a9bf['query'][_0x7042('0x37')]){_0x412142[_0x7042('0x38')]=_[_0x7042('0x3a')](_0x412142[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0x412142[_0x7042('0x31')],function(_0x473af8){var _0x1d8277={};_0x1d8277[_0x473af8]={'$like':'%'+_0x38a9bf['query']['filter']+'%'};return _0x1d8277;})});}_0x412142=_[_0x7042('0x3a')]({},_0x412142,_0x38a9bf[_0x7042('0x3b')]);return _0x195f08[_0x7042('0x4c')](_0x412142);}})['then'](function(_0x5671c2){if(_0x5671c2){_0x336777=_0x5671c2[_0x7042('0x4b')];if(!_0x38a9bf['query'][_0x7042('0x32')](_0x7042('0x33'))){_0x412142[_0x7042('0x1d')]=qs['limit'](_0x38a9bf[_0x7042('0x2d')][_0x7042('0x1d')]);_0x412142['offset']=qs[_0x7042('0x1c')](_0x38a9bf[_0x7042('0x2d')]['offset']);}return _0x195f08['getSubjects'](_0x412142);}})[_0x7042('0x21')](function(_0x33f827){if(_0x33f827){return _0x33f827?{'count':_0x336777,'rows':_0x33f827}:null;}})['then'](respondWithResult(_0x4d07f2,null))[_0x7042('0x3f')](handleError(_0x4d07f2,null));};exports[_0x7042('0x4e')]=function(_0x3e2833,_0x1fb3e9,_0x3fe844){var _0x8fd4ec={};var _0x21c587={};var _0x2c4d6f;var _0x36d2ac;return db[_0x7042('0x3d')]['findOne']({'where':{'id':_0x3e2833[_0x7042('0x47')]['id']}})[_0x7042('0x21')](handleEntityNotFound(_0x1fb3e9,null))[_0x7042('0x21')](function(_0x26707e){if(_0x26707e){_0x2c4d6f=_0x26707e;_0x21c587['model']=_[_0x7042('0x41')](db[_0x7042('0x49')][_0x7042('0x4a')]);_0x21c587[_0x7042('0x2d')]=_['keys'](_0x3e2833[_0x7042('0x2d')]);_0x21c587[_0x7042('0x2e')]=_[_0x7042('0x2f')](_0x21c587[_0x7042('0x2c')],_0x21c587[_0x7042('0x2d')]);_0x8fd4ec['attributes']=_['intersection'](_0x21c587[_0x7042('0x2c')],qs['fields'](_0x3e2833[_0x7042('0x2d')][_0x7042('0x30')]));_0x8fd4ec[_0x7042('0x31')]=_0x8fd4ec[_0x7042('0x31')][_0x7042('0x4b')]?_0x8fd4ec[_0x7042('0x31')]:_0x21c587['model'];_0x8fd4ec[_0x7042('0x34')]=qs['sort'](_0x3e2833[_0x7042('0x2d')][_0x7042('0x35')]);_0x8fd4ec['where']=qs[_0x7042('0x2e')](_[_0x7042('0x36')](_0x3e2833[_0x7042('0x2d')],_0x21c587[_0x7042('0x2e')]));if(_0x3e2833['query'][_0x7042('0x37')]){_0x8fd4ec[_0x7042('0x38')]=_[_0x7042('0x3a')](_0x8fd4ec[_0x7042('0x38')],{'$or':_[_0x7042('0x28')](_0x8fd4ec[_0x7042('0x31')],function(_0x43610e){var _0x356841={};_0x356841[_0x43610e]={'$like':'%'+_0x3e2833[_0x7042('0x2d')]['filter']+'%'};return _0x356841;})});}_0x8fd4ec=_[_0x7042('0x3a')]({},_0x8fd4ec,_0x3e2833[_0x7042('0x3b')]);return _0x2c4d6f[_0x7042('0x4e')](_0x8fd4ec);}})['then'](function(_0x41fafb){if(_0x41fafb){_0x36d2ac=_0x41fafb['length'];if(!_0x3e2833['query'][_0x7042('0x32')](_0x7042('0x33'))){_0x8fd4ec[_0x7042('0x1d')]=qs['limit'](_0x3e2833[_0x7042('0x2d')][_0x7042('0x1d')]);_0x8fd4ec[_0x7042('0x1c')]=qs['offset'](_0x3e2833[_0x7042('0x2d')][_0x7042('0x1c')]);}return _0x2c4d6f[_0x7042('0x4e')](_0x8fd4ec);}})[_0x7042('0x21')](function(_0x6e531f){if(_0x6e531f){return _0x6e531f?{'count':_0x36d2ac,'rows':_0x6e531f}:null;}})[_0x7042('0x21')](respondWithResult(_0x1fb3e9,null))[_0x7042('0x3f')](handleError(_0x1fb3e9,null));}; \ No newline at end of file +var _0xc543=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x174e99,_0x503ab4){var _0x1733ab=function(_0x16cb0e){while(--_0x16cb0e){_0x174e99['push'](_0x174e99['shift']());}};_0x1733ab(++_0x503ab4);}(_0xc543,0x139));var _0x3c54=function(_0x245b57,_0x420f33){_0x245b57=_0x245b57-0x0;var _0x1d07d9=_0xc543[_0x245b57];return _0x1d07d9;};'use strict';var emlformat=require(_0x3c54('0x0'));var rimraf=require(_0x3c54('0x1'));var zipdir=require(_0x3c54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c54('0x3'));var moment=require(_0x3c54('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3c54('0x5'));var util=require('util');var path=require(_0x3c54('0x6'));var sox=require(_0x3c54('0x7'));var csv=require('to-csv');var ejs=require(_0x3c54('0x8'));var fs=require('fs');var fs_extra=require(_0x3c54('0x9'));var _=require(_0x3c54('0xa'));var squel=require(_0x3c54('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c54('0xc'));var deskjs=require(_0x3c54('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3c54('0xe'));var Papa=require(_0x3c54('0xf'));var Redis=require(_0x3c54('0x10'));var authService=require(_0x3c54('0x11'));var qs=require(_0x3c54('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c54('0x13'));var logger=require(_0x3c54('0x14'))(_0x3c54('0x15'));var utils=require(_0x3c54('0x16'));var config=require(_0x3c54('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3a1c,_0x568f52){_0x568f52=_0x568f52||0xcc;return function(_0x1b8cfc){if(_0x1b8cfc){return _0x5b3a1c[_0x3c54('0x18')](_0x568f52);}return _0x5b3a1c[_0x3c54('0x19')](_0x568f52)[_0x3c54('0x1a')]();};}function respondWithResult(_0x2bd82f,_0x1af68f){_0x1af68f=_0x1af68f||0xc8;return function(_0x4952c8){if(_0x4952c8){return _0x2bd82f[_0x3c54('0x19')](_0x1af68f)[_0x3c54('0x1b')](_0x4952c8);}};}function respondWithFilteredResult(_0x505e34,_0x3b3e8f){return function(_0x4008a0){if(_0x4008a0){var _0x24f160=typeof _0x3b3e8f['offset']===_0x3c54('0x1c')&&typeof _0x3b3e8f[_0x3c54('0x1d')]===_0x3c54('0x1c');var _0x2dd70d=_0x4008a0['count'];var _0x16435e=_0x24f160?0x0:_0x3b3e8f['offset'];var _0x5198c6=_0x24f160?_0x4008a0['count']:_0x3b3e8f['offset']+_0x3b3e8f[_0x3c54('0x1d')];var _0x21af38;if(_0x5198c6>=_0x2dd70d){_0x5198c6=_0x2dd70d;_0x21af38=0xc8;}else{_0x21af38=0xce;}_0x505e34[_0x3c54('0x19')](_0x21af38);return _0x505e34['set'](_0x3c54('0x1e'),_0x16435e+'-'+_0x5198c6+'/'+_0x2dd70d)[_0x3c54('0x1b')](_0x4008a0);}return null;};}function patchUpdates(_0x4c62ff){return function(_0x35366d){try{jsonpatch[_0x3c54('0x1f')](_0x35366d,_0x4c62ff,!![]);}catch(_0x5a0236){return BPromise[_0x3c54('0x20')](_0x5a0236);}return _0x35366d[_0x3c54('0x21')]();};}function saveUpdates(_0x58a699,_0x4da3b6){return function(_0x2cc404){if(_0x2cc404){return _0x2cc404[_0x3c54('0x22')](_0x58a699)[_0x3c54('0x23')](function(_0x320324){return _0x320324;});}return null;};}function removeEntity(_0x4de386,_0x5c78f2){return function(_0xb900b9){if(_0xb900b9){return _0xb900b9[_0x3c54('0x24')]()[_0x3c54('0x23')](function(){_0x4de386['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4097ab,_0x4f04e2){return function(_0x4f7aea){if(!_0x4f7aea){_0x4097ab['sendStatus'](0x194);}return _0x4f7aea;};}function handleError(_0x38a4d8,_0x454b9b){_0x454b9b=_0x454b9b||0x1f4;return function(_0x2de792){logger[_0x3c54('0x25')](_0x2de792['stack']);if(_0x2de792[_0x3c54('0x26')]){delete _0x2de792[_0x3c54('0x26')];}_0x38a4d8[_0x3c54('0x19')](_0x454b9b)['send'](_0x2de792);};}exports[_0x3c54('0x27')]=function(_0x32a471,_0x7ef127){var _0x3571bb={},_0x6fb38={},_0x52b03a={'count':0x0,'rows':[]};var _0x46de6b=_[_0x3c54('0x28')](db[_0x3c54('0x29')][_0x3c54('0x2a')],function(_0x4c0c48){return{'name':_0x4c0c48[_0x3c54('0x2b')],'type':_0x4c0c48[_0x3c54('0x2c')][_0x3c54('0x2d')]};});_0x6fb38['model']=_['map'](_0x46de6b,_0x3c54('0x26'));_0x6fb38[_0x3c54('0x2e')]=_[_0x3c54('0x2f')](_0x32a471['query']);_0x6fb38[_0x3c54('0x30')]=_[_0x3c54('0x31')](_0x6fb38[_0x3c54('0x32')],_0x6fb38[_0x3c54('0x2e')]);_0x3571bb[_0x3c54('0x33')]=_[_0x3c54('0x31')](_0x6fb38['model'],qs[_0x3c54('0x34')](_0x32a471['query'][_0x3c54('0x34')]));_0x3571bb[_0x3c54('0x33')]=_0x3571bb[_0x3c54('0x33')][_0x3c54('0x35')]?_0x3571bb[_0x3c54('0x33')]:_0x6fb38['model'];if(!_0x32a471[_0x3c54('0x2e')][_0x3c54('0x36')](_0x3c54('0x37'))){_0x3571bb[_0x3c54('0x1d')]=qs[_0x3c54('0x1d')](_0x32a471[_0x3c54('0x2e')][_0x3c54('0x1d')]);_0x3571bb[_0x3c54('0x38')]=qs[_0x3c54('0x38')](_0x32a471[_0x3c54('0x2e')][_0x3c54('0x38')]);}_0x3571bb[_0x3c54('0x39')]=qs[_0x3c54('0x3a')](_0x32a471['query']['sort']);_0x3571bb['where']=qs[_0x3c54('0x30')](_[_0x3c54('0x3b')](_0x32a471[_0x3c54('0x2e')],_0x6fb38[_0x3c54('0x30')]),_0x46de6b);if(_0x32a471[_0x3c54('0x2e')][_0x3c54('0x3c')]){_0x3571bb[_0x3c54('0x3d')]=_[_0x3c54('0x3e')](_0x3571bb[_0x3c54('0x3d')],{'$or':_[_0x3c54('0x28')](_0x46de6b,function(_0xb86904){if(_0xb86904[_0x3c54('0x2c')]!==_0x3c54('0x3f')){var _0x3fc41e={};_0x3fc41e[_0xb86904[_0x3c54('0x26')]]={'$like':'%'+_0x32a471[_0x3c54('0x2e')]['filter']+'%'};return _0x3fc41e;}})});}_0x3571bb=_[_0x3c54('0x3e')]({},_0x3571bb,_0x32a471[_0x3c54('0x40')]);var _0x219deb={'where':_0x3571bb['where']};return db[_0x3c54('0x29')]['count'](_0x219deb)[_0x3c54('0x23')](function(_0x55c58b){_0x52b03a[_0x3c54('0x41')]=_0x55c58b;if(_0x32a471[_0x3c54('0x2e')][_0x3c54('0x42')]){_0x3571bb[_0x3c54('0x43')]=[{'all':!![]}];}return db[_0x3c54('0x29')][_0x3c54('0x44')](_0x3571bb);})[_0x3c54('0x23')](function(_0x56b663){_0x52b03a[_0x3c54('0x45')]=_0x56b663;return _0x52b03a;})[_0x3c54('0x23')](respondWithFilteredResult(_0x7ef127,_0x3571bb))[_0x3c54('0x46')](handleError(_0x7ef127,null));};exports[_0x3c54('0x47')]=function(_0x123084,_0x14ff03){var _0x52f21b={'raw':![],'where':{'id':_0x123084[_0x3c54('0x48')]['id']}},_0x1f4a4a={};_0x1f4a4a[_0x3c54('0x32')]=_[_0x3c54('0x2f')](db[_0x3c54('0x29')]['rawAttributes']);_0x1f4a4a[_0x3c54('0x2e')]=_[_0x3c54('0x2f')](_0x123084[_0x3c54('0x2e')]);_0x1f4a4a[_0x3c54('0x30')]=_[_0x3c54('0x31')](_0x1f4a4a[_0x3c54('0x32')],_0x1f4a4a['query']);_0x52f21b[_0x3c54('0x33')]=_[_0x3c54('0x31')](_0x1f4a4a[_0x3c54('0x32')],qs['fields'](_0x123084['query'][_0x3c54('0x34')]));_0x52f21b[_0x3c54('0x33')]=_0x52f21b[_0x3c54('0x33')][_0x3c54('0x35')]?_0x52f21b[_0x3c54('0x33')]:_0x1f4a4a[_0x3c54('0x32')];if(_0x123084[_0x3c54('0x2e')]['includeAll']){_0x52f21b['include']=[{'all':!![]}];}_0x52f21b=_[_0x3c54('0x3e')]({},_0x52f21b,_0x123084[_0x3c54('0x40')]);return db['VtigerConfiguration'][_0x3c54('0x49')](_0x52f21b)['then'](handleEntityNotFound(_0x14ff03,null))[_0x3c54('0x23')](respondWithResult(_0x14ff03,null))[_0x3c54('0x46')](handleError(_0x14ff03,null));};exports[_0x3c54('0x4a')]=function(_0x989f3b,_0x53fe8f){return db[_0x3c54('0x29')][_0x3c54('0x4a')](_0x989f3b[_0x3c54('0x4b')],{})[_0x3c54('0x23')](respondWithResult(_0x53fe8f,0xc9))['catch'](handleError(_0x53fe8f,null));};exports['update']=function(_0x47f25b,_0x4f24f0){if(_0x47f25b[_0x3c54('0x4b')]['id']){delete _0x47f25b[_0x3c54('0x4b')]['id'];}return db[_0x3c54('0x29')][_0x3c54('0x49')]({'where':{'id':_0x47f25b[_0x3c54('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f24f0,null))[_0x3c54('0x23')](saveUpdates(_0x47f25b[_0x3c54('0x4b')],null))[_0x3c54('0x23')](respondWithResult(_0x4f24f0,null))['catch'](handleError(_0x4f24f0,null));};exports[_0x3c54('0x24')]=function(_0x41d0c6,_0x2973b5){return db[_0x3c54('0x29')]['find']({'where':{'id':_0x41d0c6['params']['id']}})[_0x3c54('0x23')](handleEntityNotFound(_0x2973b5,null))[_0x3c54('0x23')](removeEntity(_0x2973b5,null))[_0x3c54('0x46')](handleError(_0x2973b5,null));};exports[_0x3c54('0x4c')]=function(_0x43f04f,_0x2be3ad,_0x3801b5){var _0xefaa5b={};var _0x4afdf4={};var _0x5b2eb1;var _0x484c1b;return db['VtigerConfiguration'][_0x3c54('0x4d')]({'where':{'id':_0x43f04f[_0x3c54('0x48')]['id']}})['then'](handleEntityNotFound(_0x2be3ad,null))[_0x3c54('0x23')](function(_0x126d4d){if(_0x126d4d){_0x5b2eb1=_0x126d4d;_0x4afdf4[_0x3c54('0x32')]=_[_0x3c54('0x2f')](db[_0x3c54('0x4e')][_0x3c54('0x2a')]);_0x4afdf4[_0x3c54('0x2e')]=_['keys'](_0x43f04f[_0x3c54('0x2e')]);_0x4afdf4['filters']=_['intersection'](_0x4afdf4[_0x3c54('0x32')],_0x4afdf4[_0x3c54('0x2e')]);_0xefaa5b[_0x3c54('0x33')]=_[_0x3c54('0x31')](_0x4afdf4[_0x3c54('0x32')],qs[_0x3c54('0x34')](_0x43f04f['query'][_0x3c54('0x34')]));_0xefaa5b[_0x3c54('0x33')]=_0xefaa5b[_0x3c54('0x33')][_0x3c54('0x35')]?_0xefaa5b[_0x3c54('0x33')]:_0x4afdf4[_0x3c54('0x32')];_0xefaa5b['order']=qs[_0x3c54('0x3a')](_0x43f04f['query'][_0x3c54('0x3a')]);_0xefaa5b[_0x3c54('0x3d')]=qs[_0x3c54('0x30')](_['pick'](_0x43f04f[_0x3c54('0x2e')],_0x4afdf4[_0x3c54('0x30')]));if(_0x43f04f['query'][_0x3c54('0x3c')]){_0xefaa5b[_0x3c54('0x3d')]=_[_0x3c54('0x3e')](_0xefaa5b[_0x3c54('0x3d')],{'$or':_[_0x3c54('0x28')](_0xefaa5b[_0x3c54('0x33')],function(_0x4c05f9){var _0x4db5b2={};_0x4db5b2[_0x4c05f9]={'$like':'%'+_0x43f04f['query'][_0x3c54('0x3c')]+'%'};return _0x4db5b2;})});}_0xefaa5b=_['merge']({},_0xefaa5b,_0x43f04f[_0x3c54('0x40')]);return _0x5b2eb1[_0x3c54('0x4c')](_0xefaa5b);}})[_0x3c54('0x23')](function(_0x3ac010){if(_0x3ac010){_0x484c1b=_0x3ac010[_0x3c54('0x35')];if(!_0x43f04f['query'][_0x3c54('0x36')](_0x3c54('0x37'))){_0xefaa5b[_0x3c54('0x1d')]=qs[_0x3c54('0x1d')](_0x43f04f[_0x3c54('0x2e')][_0x3c54('0x1d')]);_0xefaa5b[_0x3c54('0x38')]=qs[_0x3c54('0x38')](_0x43f04f[_0x3c54('0x2e')][_0x3c54('0x38')]);}return _0x5b2eb1[_0x3c54('0x4c')](_0xefaa5b);}})['then'](function(_0x36ef2f){if(_0x36ef2f){return _0x36ef2f?{'count':_0x484c1b,'rows':_0x36ef2f}:null;}})[_0x3c54('0x23')](respondWithResult(_0x2be3ad,null))[_0x3c54('0x46')](handleError(_0x2be3ad,null));};exports['getSubjects']=function(_0xaba1ed,_0x349fed,_0x4236dc){var _0x38c5db={};var _0x314919={};var _0x590c04;var _0x4612e4;return db[_0x3c54('0x29')][_0x3c54('0x4d')]({'where':{'id':_0xaba1ed['params']['id']}})[_0x3c54('0x23')](handleEntityNotFound(_0x349fed,null))[_0x3c54('0x23')](function(_0xebe29f){if(_0xebe29f){_0x590c04=_0xebe29f;_0x314919[_0x3c54('0x32')]=_[_0x3c54('0x2f')](db[_0x3c54('0x4e')][_0x3c54('0x2a')]);_0x314919[_0x3c54('0x2e')]=_[_0x3c54('0x2f')](_0xaba1ed[_0x3c54('0x2e')]);_0x314919[_0x3c54('0x30')]=_[_0x3c54('0x31')](_0x314919['model'],_0x314919[_0x3c54('0x2e')]);_0x38c5db[_0x3c54('0x33')]=_['intersection'](_0x314919[_0x3c54('0x32')],qs['fields'](_0xaba1ed[_0x3c54('0x2e')]['fields']));_0x38c5db['attributes']=_0x38c5db[_0x3c54('0x33')]['length']?_0x38c5db['attributes']:_0x314919[_0x3c54('0x32')];_0x38c5db['order']=qs[_0x3c54('0x3a')](_0xaba1ed['query'][_0x3c54('0x3a')]);_0x38c5db[_0x3c54('0x3d')]=qs[_0x3c54('0x30')](_[_0x3c54('0x3b')](_0xaba1ed['query'],_0x314919[_0x3c54('0x30')]));if(_0xaba1ed[_0x3c54('0x2e')][_0x3c54('0x3c')]){_0x38c5db[_0x3c54('0x3d')]=_[_0x3c54('0x3e')](_0x38c5db[_0x3c54('0x3d')],{'$or':_[_0x3c54('0x28')](_0x38c5db[_0x3c54('0x33')],function(_0x3f1bf2){var _0x2fd5e3={};_0x2fd5e3[_0x3f1bf2]={'$like':'%'+_0xaba1ed[_0x3c54('0x2e')][_0x3c54('0x3c')]+'%'};return _0x2fd5e3;})});}_0x38c5db=_[_0x3c54('0x3e')]({},_0x38c5db,_0xaba1ed[_0x3c54('0x40')]);return _0x590c04[_0x3c54('0x4f')](_0x38c5db);}})[_0x3c54('0x23')](function(_0x46ed51){if(_0x46ed51){_0x4612e4=_0x46ed51[_0x3c54('0x35')];if(!_0xaba1ed[_0x3c54('0x2e')][_0x3c54('0x36')](_0x3c54('0x37'))){_0x38c5db['limit']=qs[_0x3c54('0x1d')](_0xaba1ed[_0x3c54('0x2e')]['limit']);_0x38c5db[_0x3c54('0x38')]=qs[_0x3c54('0x38')](_0xaba1ed[_0x3c54('0x2e')][_0x3c54('0x38')]);}return _0x590c04[_0x3c54('0x4f')](_0x38c5db);}})[_0x3c54('0x23')](function(_0x273f97){if(_0x273f97){return _0x273f97?{'count':_0x4612e4,'rows':_0x273f97}:null;}})[_0x3c54('0x23')](respondWithResult(_0x349fed,null))['catch'](handleError(_0x349fed,null));};exports[_0x3c54('0x50')]=function(_0x172bad,_0x53b0f9,_0x460187){var _0x571799={};var _0x3efc17={};var _0x1cbe9d;var _0x30088a;return db[_0x3c54('0x29')]['findOne']({'where':{'id':_0x172bad['params']['id']}})['then'](handleEntityNotFound(_0x53b0f9,null))['then'](function(_0x9c8cd3){if(_0x9c8cd3){_0x1cbe9d=_0x9c8cd3;_0x3efc17[_0x3c54('0x32')]=_[_0x3c54('0x2f')](db[_0x3c54('0x4e')][_0x3c54('0x2a')]);_0x3efc17['query']=_['keys'](_0x172bad[_0x3c54('0x2e')]);_0x3efc17[_0x3c54('0x30')]=_[_0x3c54('0x31')](_0x3efc17[_0x3c54('0x32')],_0x3efc17[_0x3c54('0x2e')]);_0x571799[_0x3c54('0x33')]=_[_0x3c54('0x31')](_0x3efc17[_0x3c54('0x32')],qs['fields'](_0x172bad['query']['fields']));_0x571799[_0x3c54('0x33')]=_0x571799[_0x3c54('0x33')][_0x3c54('0x35')]?_0x571799[_0x3c54('0x33')]:_0x3efc17[_0x3c54('0x32')];_0x571799[_0x3c54('0x39')]=qs['sort'](_0x172bad[_0x3c54('0x2e')]['sort']);_0x571799[_0x3c54('0x3d')]=qs[_0x3c54('0x30')](_[_0x3c54('0x3b')](_0x172bad[_0x3c54('0x2e')],_0x3efc17[_0x3c54('0x30')]));if(_0x172bad[_0x3c54('0x2e')]['filter']){_0x571799[_0x3c54('0x3d')]=_[_0x3c54('0x3e')](_0x571799[_0x3c54('0x3d')],{'$or':_['map'](_0x571799[_0x3c54('0x33')],function(_0x19624b){var _0x2c9300={};_0x2c9300[_0x19624b]={'$like':'%'+_0x172bad[_0x3c54('0x2e')]['filter']+'%'};return _0x2c9300;})});}_0x571799=_[_0x3c54('0x3e')]({},_0x571799,_0x172bad[_0x3c54('0x40')]);return _0x1cbe9d[_0x3c54('0x50')](_0x571799);}})['then'](function(_0x2f44a0){if(_0x2f44a0){_0x30088a=_0x2f44a0[_0x3c54('0x35')];if(!_0x172bad[_0x3c54('0x2e')]['hasOwnProperty']('nolimit')){_0x571799[_0x3c54('0x1d')]=qs['limit'](_0x172bad[_0x3c54('0x2e')]['limit']);_0x571799[_0x3c54('0x38')]=qs['offset'](_0x172bad['query']['offset']);}return _0x1cbe9d['getDescriptions'](_0x571799);}})[_0x3c54('0x23')](function(_0x5e768d){if(_0x5e768d){return _0x5e768d?{'count':_0x30088a,'rows':_0x5e768d}:null;}})['then'](respondWithResult(_0x53b0f9,null))['catch'](handleError(_0x53b0f9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index cf07520..a973ea2 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 _0x30f2=['exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes'];(function(_0x372791,_0x37c573){var _0x19c83c=function(_0x3ec8cb){while(--_0x3ec8cb){_0x372791['push'](_0x372791['shift']());}};_0x19c83c(++_0x37c573);}(_0x30f2,0x16b));var _0x230f=function(_0x10571d,_0x1770ae){_0x10571d=_0x10571d-0x0;var _0x3905eb=_0x30f2[_0x10571d];return _0x3905eb;};'use strict';var _=require(_0x230f('0x0'));var util=require(_0x230f('0x1'));var logger=require(_0x230f('0x2'))(_0x230f('0x3'));var moment=require(_0x230f('0x4'));var BPromise=require(_0x230f('0x5'));var rp=require(_0x230f('0x6'));var fs=require('fs');var path=require(_0x230f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x230f('0x8'));module[_0x230f('0x9')]=function(_0x56169b,_0x1df64b){return _0x56169b[_0x230f('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x230f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8406=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x425699,_0x34558f){var _0x5341e9=function(_0x394ff7){while(--_0x394ff7){_0x425699['push'](_0x425699['shift']());}};_0x5341e9(++_0x34558f);}(_0x8406,0x79));var _0x6840=function(_0x36ffbb,_0x41215e){_0x36ffbb=_0x36ffbb-0x0;var _0x128e50=_0x8406[_0x36ffbb];return _0x128e50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6840('0x0'));var BPromise=require(_0x6840('0x1'));var rp=require(_0x6840('0x2'));var fs=require('fs');var path=require(_0x6840('0x3'));var rimraf=require(_0x6840('0x4'));var config=require(_0x6840('0x5'));var attributes=require(_0x6840('0x6'));module[_0x6840('0x7')]=function(_0x515b00,_0xbad66c){return _0x515b00[_0x6840('0x8')](_0x6840('0x9'),attributes,{'tableName':_0x6840('0xa'),'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 1b97664..c2bcbd2 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 _0x78ab=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment'];(function(_0x4b359c,_0x1987a9){var _0x5ac361=function(_0x31ab84){while(--_0x31ab84){_0x4b359c['push'](_0x4b359c['shift']());}};_0x5ac361(++_0x1987a9);}(_0x78ab,0xb7));var _0xb78a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x78ab[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xb78a('0x0'));var util=require(_0xb78a('0x1'));var moment=require(_0xb78a('0x2'));var BPromise=require(_0xb78a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb78a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb78a('0x5'));var config=require(_0xb78a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb78a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ad6be,_0x50342d,_0x1230e3){return new BPromise(function(_0x1a74aa,_0x5cee43){return client[_0xb78a('0x8')](_0x4ad6be,_0x1230e3)[_0xb78a('0x9')](function(_0x5e1992){logger[_0xb78a('0xa')](_0xb78a('0xb'),_0x50342d,_0xb78a('0xc'));logger[_0xb78a('0xd')](_0xb78a('0xe'),_0x50342d,_0xb78a('0xc'),JSON['stringify'](_0x5e1992));if(_0x5e1992['error']){if(_0x5e1992[_0xb78a('0xf')]['code']===0x1f4){logger[_0xb78a('0xf')](_0xb78a('0xb'),_0x50342d,_0x5e1992[_0xb78a('0xf')]['message']);return _0x5cee43(_0x5e1992[_0xb78a('0xf')][_0xb78a('0x10')]);}logger[_0xb78a('0xf')](_0xb78a('0xb'),_0x50342d,_0x5e1992['error'][_0xb78a('0x10')]);return _0x1a74aa(_0x5e1992['error'][_0xb78a('0x10')]);}else{logger[_0xb78a('0xa')](_0xb78a('0xb'),_0x50342d,_0xb78a('0xc'));_0x1a74aa(_0x5e1992[_0xb78a('0x11')][_0xb78a('0x10')]);}})[_0xb78a('0x12')](function(_0x24ea87){logger[_0xb78a('0xf')](_0xb78a('0xb'),_0x50342d,_0x24ea87);_0x5cee43(_0x24ea87);});});} \ No newline at end of file +var _0x91fe=['VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x91fe,0x1b5));var _0xe91f=function(_0x2b8d2f,_0x39314){_0x2b8d2f=_0x2b8d2f-0x0;var _0x1fba13=_0x91fe[_0x2b8d2f];return _0x1fba13;};'use strict';var _=require('lodash');var util=require(_0xe91f('0x0'));var moment=require(_0xe91f('0x1'));var BPromise=require(_0xe91f('0x2'));var rs=require(_0xe91f('0x3'));var fs=require('fs');var Redis=require(_0xe91f('0x4'));var db=require(_0xe91f('0x5'))['db'];var utils=require(_0xe91f('0x6'));var logger=require(_0xe91f('0x7'))(_0xe91f('0x8'));var config=require(_0xe91f('0x9'));var jayson=require(_0xe91f('0xa'));var client=jayson['client'][_0xe91f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32b41b,_0x1eb89c,_0xbfc174){return new BPromise(function(_0x5a8d4c,_0x290f2b){return client[_0xe91f('0xc')](_0x32b41b,_0xbfc174)['then'](function(_0x24d62e){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1eb89c,_0xe91f('0xd'));logger[_0xe91f('0xe')](_0xe91f('0xf'),_0x1eb89c,_0xe91f('0xd'),JSON[_0xe91f('0x10')](_0x24d62e));if(_0x24d62e[_0xe91f('0x11')]){if(_0x24d62e['error'][_0xe91f('0x12')]===0x1f4){logger[_0xe91f('0x11')](_0xe91f('0x13'),_0x1eb89c,_0x24d62e[_0xe91f('0x11')][_0xe91f('0x14')]);return _0x290f2b(_0x24d62e[_0xe91f('0x11')][_0xe91f('0x14')]);}logger[_0xe91f('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1eb89c,_0x24d62e[_0xe91f('0x11')]['message']);return _0x5a8d4c(_0x24d62e[_0xe91f('0x11')][_0xe91f('0x14')]);}else{logger[_0xe91f('0x15')](_0xe91f('0x13'),_0x1eb89c,_0xe91f('0xd'));_0x5a8d4c(_0x24d62e[_0xe91f('0x16')]['message']);}})[_0xe91f('0x17')](function(_0xc7fbc){logger[_0xe91f('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1eb89c,_0xc7fbc);_0x290f2b(_0xc7fbc);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 00a9f42..e7eb2bb 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 _0x62b8=['exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0x511695,_0x1ba5b1){var _0x573705=function(_0x2f6a4a){while(--_0x2f6a4a){_0x511695['push'](_0x511695['shift']());}};_0x573705(++_0x1ba5b1);}(_0x62b8,0x1dd));var _0x862b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x62b8[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0x862b('0x0'));var util=require(_0x862b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x862b('0x2'));var router=express['Router']();var fs_extra=require(_0x862b('0x3'));var auth=require(_0x862b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x862b('0x5'));var controller=require(_0x862b('0x6'));router[_0x862b('0x7')]('/',auth[_0x862b('0x8')](),controller[_0x862b('0x9')]);router['get'](_0x862b('0xa'),auth[_0x862b('0x8')](),controller['show']);router[_0x862b('0xb')]('/',auth[_0x862b('0x8')](),controller[_0x862b('0xc')]);router[_0x862b('0xd')](_0x862b('0xa'),auth['isAuthenticated'](),controller[_0x862b('0xe')]);router['delete'](_0x862b('0xa'),auth['isAuthenticated'](),controller[_0x862b('0xf')]);module[_0x862b('0x10')]=router; \ No newline at end of file +var _0x00d4=['/:id','show','post','create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x273bef,_0x295f4e){var _0x5c4125=function(_0xcc0481){while(--_0xcc0481){_0x273bef['push'](_0x273bef['shift']());}};_0x5c4125(++_0x295f4e);}(_0x00d4,0x86));var _0x400d=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x00d4[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x400d('0x0'));var util=require(_0x400d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x400d('0x2'));var router=express[_0x400d('0x3')]();var fs_extra=require(_0x400d('0x4'));var auth=require(_0x400d('0x5'));var interaction=require(_0x400d('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x400d('0x7')]('/',auth[_0x400d('0x8')](),controller[_0x400d('0x9')]);router[_0x400d('0x7')](_0x400d('0xa'),auth[_0x400d('0x8')](),controller[_0x400d('0xb')]);router[_0x400d('0xc')]('/',auth[_0x400d('0x8')](),controller[_0x400d('0xd')]);router[_0x400d('0xe')](_0x400d('0xa'),auth[_0x400d('0x8')](),controller[_0x400d('0xf')]);router['delete'](_0x400d('0xa'),auth[_0x400d('0x8')](),controller[_0x400d('0x10')]);module[_0x400d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index c5072b5..05f3bcf 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 _0x6318=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x27469b,_0x2b036c){var _0x1b9a5a=function(_0x34076){while(--_0x34076){_0x27469b['push'](_0x27469b['shift']());}};_0x1b9a5a(++_0x2b036c);}(_0x6318,0x1bc));var _0x8631=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x6318[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0x8631('0x0'));module[_0x8631('0x1')]={'type':{'type':Sequelize[_0x8631('0x2')]('string','variable',_0x8631('0x3'),_0x8631('0x4'),_0x8631('0x5')),'defaultValue':_0x8631('0x6')},'content':{'type':Sequelize[_0x8631('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8631('0x2')](_0x8631('0x6'),_0x8631('0x8'),_0x8631('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8631('0x7')]},'nameField':{'type':Sequelize[_0x8631('0x7')]},'customField':{'type':Sequelize[_0x8631('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef7c=['variable','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x58e900,_0x20877e){var _0x1f6d6a=function(_0x25f599){while(--_0x25f599){_0x58e900['push'](_0x58e900['shift']());}};_0x1f6d6a(++_0x20877e);}(_0xef7c,0xb6));var _0xcef7=function(_0x33959f,_0x4b4df3){_0x33959f=_0x33959f-0x0;var _0x456074=_0xef7c[_0x33959f];return _0x456074;};'use strict';var Sequelize=require(_0xcef7('0x0'));module['exports']={'type':{'type':Sequelize[_0xcef7('0x1')](_0xcef7('0x2'),'variable',_0xcef7('0x3'),_0xcef7('0x4'),_0xcef7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcef7('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcef7('0x1')](_0xcef7('0x2'),_0xcef7('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xcef7('0x6')]},'idField':{'type':Sequelize[_0xcef7('0x6')]},'nameField':{'type':Sequelize[_0xcef7('0x6')]},'customField':{'type':Sequelize[_0xcef7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcef7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c0cd558..ce5215d 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 _0x8130=['order','sort','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','includeAll','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2b20da,_0x337a7f){var _0x1450c8=function(_0x3417f1){while(--_0x3417f1){_0x2b20da['push'](_0x2b20da['shift']());}};_0x1450c8(++_0x337a7f);}(_0x8130,0xf7));var _0x0813=function(_0x1c1a47,_0x5a2db9){_0x1c1a47=_0x1c1a47-0x0;var _0x12fdcb=_0x8130[_0x1c1a47];return _0x12fdcb;};'use strict';var emlformat=require(_0x0813('0x0'));var rimraf=require(_0x0813('0x1'));var zipdir=require(_0x0813('0x2'));var jsonpatch=require(_0x0813('0x3'));var rp=require(_0x0813('0x4'));var moment=require(_0x0813('0x5'));var BPromise=require(_0x0813('0x6'));var Mustache=require(_0x0813('0x7'));var util=require(_0x0813('0x8'));var path=require(_0x0813('0x9'));var sox=require(_0x0813('0xa'));var csv=require(_0x0813('0xb'));var ejs=require(_0x0813('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0813('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0813('0xe'));var deskjs=require(_0x0813('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0813('0x10'));var Papa=require(_0x0813('0x11'));var Redis=require(_0x0813('0x12'));var authService=require(_0x0813('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0813('0x14'));var hardwareService=require(_0x0813('0x15'));var logger=require(_0x0813('0x16'))(_0x0813('0x17'));var utils=require('../../config/utils');var config=require(_0x0813('0x18'));var licenseUtil=require(_0x0813('0x19'));var db=require(_0x0813('0x1a'))['db'];function respondWithStatusCode(_0x2015a4,_0x59cf7f){_0x59cf7f=_0x59cf7f||0xcc;return function(_0x2a8b94){if(_0x2a8b94){return _0x2015a4[_0x0813('0x1b')](_0x59cf7f);}return _0x2015a4[_0x0813('0x1c')](_0x59cf7f)[_0x0813('0x1d')]();};}function respondWithResult(_0x4a02ab,_0x50d992){_0x50d992=_0x50d992||0xc8;return function(_0x29f488){if(_0x29f488){return _0x4a02ab[_0x0813('0x1c')](_0x50d992)[_0x0813('0x1e')](_0x29f488);}};}function respondWithFilteredResult(_0x57b739,_0x51c6d4){return function(_0x237d98){if(_0x237d98){var _0x16fc25=typeof _0x51c6d4[_0x0813('0x1f')]===_0x0813('0x20')&&typeof _0x51c6d4[_0x0813('0x21')]===_0x0813('0x20');var _0xa80c08=_0x237d98[_0x0813('0x22')];var _0x55bad4=_0x16fc25?0x0:_0x51c6d4['offset'];var _0x2fab15=_0x16fc25?_0x237d98[_0x0813('0x22')]:_0x51c6d4[_0x0813('0x1f')]+_0x51c6d4[_0x0813('0x21')];var _0x17b449;if(_0x2fab15>=_0xa80c08){_0x2fab15=_0xa80c08;_0x17b449=0xc8;}else{_0x17b449=0xce;}_0x57b739[_0x0813('0x1c')](_0x17b449);return _0x57b739[_0x0813('0x23')](_0x0813('0x24'),_0x55bad4+'-'+_0x2fab15+'/'+_0xa80c08)['json'](_0x237d98);}return null;};}function patchUpdates(_0x342d70){return function(_0x620caf){try{jsonpatch[_0x0813('0x25')](_0x620caf,_0x342d70,!![]);}catch(_0x54cb5a){return BPromise[_0x0813('0x26')](_0x54cb5a);}return _0x620caf['save']();};}function saveUpdates(_0x130588,_0x6dcee7){return function(_0x3286f4){if(_0x3286f4){return _0x3286f4[_0x0813('0x27')](_0x130588)[_0x0813('0x28')](function(_0x406b89){return _0x406b89;});}return null;};}function removeEntity(_0x523b7e,_0x3dbbe2){return function(_0x3453a8){if(_0x3453a8){return _0x3453a8[_0x0813('0x29')]()[_0x0813('0x28')](function(){_0x523b7e[_0x0813('0x1c')](0xcc)[_0x0813('0x1d')]();});}};}function handleEntityNotFound(_0x3a07d9,_0x55814e){return function(_0x3e9132){if(!_0x3e9132){_0x3a07d9[_0x0813('0x1b')](0x194);}return _0x3e9132;};}function handleError(_0x32c700,_0x232fdf){_0x232fdf=_0x232fdf||0x1f4;return function(_0x543c0b){logger[_0x0813('0x2a')](_0x543c0b[_0x0813('0x2b')]);if(_0x543c0b[_0x0813('0x2c')]){delete _0x543c0b['name'];}_0x32c700[_0x0813('0x1c')](_0x232fdf)['send'](_0x543c0b);};}exports[_0x0813('0x2d')]=function(_0x45fede,_0x15491b){var _0x4f49f1={},_0x5acefd={},_0x123f03={'count':0x0,'rows':[]};var _0x1d1b26=_[_0x0813('0x2e')](db[_0x0813('0x2f')][_0x0813('0x30')],function(_0x48a10a){return{'name':_0x48a10a[_0x0813('0x31')],'type':_0x48a10a[_0x0813('0x32')][_0x0813('0x33')]};});_0x5acefd[_0x0813('0x34')]=_[_0x0813('0x2e')](_0x1d1b26,_0x0813('0x2c'));_0x5acefd[_0x0813('0x35')]=_[_0x0813('0x36')](_0x45fede[_0x0813('0x35')]);_0x5acefd[_0x0813('0x37')]=_[_0x0813('0x38')](_0x5acefd[_0x0813('0x34')],_0x5acefd[_0x0813('0x35')]);_0x4f49f1[_0x0813('0x39')]=_[_0x0813('0x38')](_0x5acefd[_0x0813('0x34')],qs[_0x0813('0x3a')](_0x45fede[_0x0813('0x35')][_0x0813('0x3a')]));_0x4f49f1[_0x0813('0x39')]=_0x4f49f1[_0x0813('0x39')][_0x0813('0x3b')]?_0x4f49f1[_0x0813('0x39')]:_0x5acefd[_0x0813('0x34')];if(!_0x45fede[_0x0813('0x35')]['hasOwnProperty'](_0x0813('0x3c'))){_0x4f49f1[_0x0813('0x21')]=qs[_0x0813('0x21')](_0x45fede['query'][_0x0813('0x21')]);_0x4f49f1[_0x0813('0x1f')]=qs['offset'](_0x45fede[_0x0813('0x35')][_0x0813('0x1f')]);}_0x4f49f1[_0x0813('0x3d')]=qs[_0x0813('0x3e')](_0x45fede[_0x0813('0x35')]['sort']);_0x4f49f1['where']=qs[_0x0813('0x37')](_['pick'](_0x45fede[_0x0813('0x35')],_0x5acefd[_0x0813('0x37')]),_0x1d1b26);if(_0x45fede['query']['filter']){_0x4f49f1[_0x0813('0x3f')]=_[_0x0813('0x40')](_0x4f49f1[_0x0813('0x3f')],{'$or':_['map'](_0x1d1b26,function(_0x1d2bdc){if(_0x1d2bdc[_0x0813('0x32')]!==_0x0813('0x41')){var _0x164879={};_0x164879[_0x1d2bdc[_0x0813('0x2c')]]={'$like':'%'+_0x45fede[_0x0813('0x35')][_0x0813('0x42')]+'%'};return _0x164879;}})});}_0x4f49f1=_[_0x0813('0x40')]({},_0x4f49f1,_0x45fede[_0x0813('0x43')]);var _0x3b0b09={'where':_0x4f49f1['where']};return db['VtigerField']['count'](_0x3b0b09)[_0x0813('0x28')](function(_0xa30b19){_0x123f03[_0x0813('0x22')]=_0xa30b19;if(_0x45fede['query']['includeAll']){_0x4f49f1[_0x0813('0x44')]=[{'all':!![]}];}return db[_0x0813('0x2f')][_0x0813('0x45')](_0x4f49f1);})[_0x0813('0x28')](function(_0x2ab9ee){_0x123f03['rows']=_0x2ab9ee;return _0x123f03;})[_0x0813('0x28')](respondWithFilteredResult(_0x15491b,_0x4f49f1))[_0x0813('0x46')](handleError(_0x15491b,null));};exports[_0x0813('0x47')]=function(_0x32f609,_0x4992d5){var _0x55a9a7={'raw':!![],'where':{'id':_0x32f609['params']['id']}},_0x352aa6={};_0x352aa6[_0x0813('0x34')]=_[_0x0813('0x36')](db[_0x0813('0x2f')][_0x0813('0x30')]);_0x352aa6[_0x0813('0x35')]=_[_0x0813('0x36')](_0x32f609[_0x0813('0x35')]);_0x352aa6[_0x0813('0x37')]=_[_0x0813('0x38')](_0x352aa6[_0x0813('0x34')],_0x352aa6[_0x0813('0x35')]);_0x55a9a7[_0x0813('0x39')]=_[_0x0813('0x38')](_0x352aa6[_0x0813('0x34')],qs[_0x0813('0x3a')](_0x32f609[_0x0813('0x35')][_0x0813('0x3a')]));_0x55a9a7[_0x0813('0x39')]=_0x55a9a7[_0x0813('0x39')]['length']?_0x55a9a7[_0x0813('0x39')]:_0x352aa6[_0x0813('0x34')];if(_0x32f609[_0x0813('0x35')][_0x0813('0x48')]){_0x55a9a7['include']=[{'all':!![]}];}_0x55a9a7=_[_0x0813('0x40')]({},_0x55a9a7,_0x32f609[_0x0813('0x43')]);return db['VtigerField']['find'](_0x55a9a7)[_0x0813('0x28')](handleEntityNotFound(_0x4992d5,null))[_0x0813('0x28')](respondWithResult(_0x4992d5,null))[_0x0813('0x46')](handleError(_0x4992d5,null));};exports[_0x0813('0x49')]=function(_0x485c16,_0xea33eb){return db[_0x0813('0x2f')][_0x0813('0x49')](_0x485c16[_0x0813('0x4a')],{})[_0x0813('0x28')](respondWithResult(_0xea33eb,0xc9))['catch'](handleError(_0xea33eb,null));};exports[_0x0813('0x27')]=function(_0xcef8f4,_0x2d983e){if(_0xcef8f4[_0x0813('0x4a')]['id']){delete _0xcef8f4['body']['id'];}return db[_0x0813('0x2f')][_0x0813('0x4b')]({'where':{'id':_0xcef8f4[_0x0813('0x4c')]['id']}})[_0x0813('0x28')](handleEntityNotFound(_0x2d983e,null))[_0x0813('0x28')](saveUpdates(_0xcef8f4[_0x0813('0x4a')],null))[_0x0813('0x28')](respondWithResult(_0x2d983e,null))[_0x0813('0x46')](handleError(_0x2d983e,null));};exports[_0x0813('0x29')]=function(_0xa833a1,_0x355f8e){return db[_0x0813('0x2f')]['find']({'where':{'id':_0xa833a1[_0x0813('0x4c')]['id']}})[_0x0813('0x28')](handleEntityNotFound(_0x355f8e,null))[_0x0813('0x28')](removeEntity(_0x355f8e,null))['catch'](handleError(_0x355f8e,null));}; \ No newline at end of file +var _0x6651=['offset','undefined','count','limit','set','apply','save','update','then','end','error','stack','name','index','VtigerField','rawAttributes','fieldName','key','map','keys','filters','intersection','query','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x401a4d,_0x4bb835){var _0x1faaff=function(_0x57539e){while(--_0x57539e){_0x401a4d['push'](_0x401a4d['shift']());}};_0x1faaff(++_0x4bb835);}(_0x6651,0x1c4));var _0x1665=function(_0x4099d4,_0x38671e){_0x4099d4=_0x4099d4-0x0;var _0x4171b1=_0x6651[_0x4099d4];return _0x4171b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1665('0x0'));var zipdir=require(_0x1665('0x1'));var jsonpatch=require(_0x1665('0x2'));var rp=require('request-promise');var moment=require(_0x1665('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1665('0x4'));var path=require(_0x1665('0x5'));var sox=require(_0x1665('0x6'));var csv=require('to-csv');var ejs=require(_0x1665('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1665('0x8'));var crypto=require(_0x1665('0x9'));var jsforce=require(_0x1665('0xa'));var deskjs=require(_0x1665('0xb'));var toCsv=require(_0x1665('0xc'));var querystring=require(_0x1665('0xd'));var Papa=require(_0x1665('0xe'));var Redis=require(_0x1665('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1665('0x10'));var as=require(_0x1665('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1665('0x12'));var config=require(_0x1665('0x13'));var licenseUtil=require(_0x1665('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x580730,_0x232623){_0x232623=_0x232623||0xcc;return function(_0x13a31b){if(_0x13a31b){return _0x580730[_0x1665('0x15')](_0x232623);}return _0x580730[_0x1665('0x16')](_0x232623)['end']();};}function respondWithResult(_0x4aa5ac,_0x416d90){_0x416d90=_0x416d90||0xc8;return function(_0x2d1d3d){if(_0x2d1d3d){return _0x4aa5ac[_0x1665('0x16')](_0x416d90)[_0x1665('0x17')](_0x2d1d3d);}};}function respondWithFilteredResult(_0x50df12,_0x1fd2f6){return function(_0x5885e0){if(_0x5885e0){var _0x36822e=typeof _0x1fd2f6[_0x1665('0x18')]===_0x1665('0x19')&&typeof _0x1fd2f6['limit']===_0x1665('0x19');var _0x2c56c0=_0x5885e0['count'];var _0x3ec01e=_0x36822e?0x0:_0x1fd2f6[_0x1665('0x18')];var _0x2d54b7=_0x36822e?_0x5885e0[_0x1665('0x1a')]:_0x1fd2f6[_0x1665('0x18')]+_0x1fd2f6[_0x1665('0x1b')];var _0x47039b;if(_0x2d54b7>=_0x2c56c0){_0x2d54b7=_0x2c56c0;_0x47039b=0xc8;}else{_0x47039b=0xce;}_0x50df12[_0x1665('0x16')](_0x47039b);return _0x50df12[_0x1665('0x1c')]('Content-Range',_0x3ec01e+'-'+_0x2d54b7+'/'+_0x2c56c0)[_0x1665('0x17')](_0x5885e0);}return null;};}function patchUpdates(_0x115822){return function(_0x55d972){try{jsonpatch[_0x1665('0x1d')](_0x55d972,_0x115822,!![]);}catch(_0x39f75f){return BPromise['reject'](_0x39f75f);}return _0x55d972[_0x1665('0x1e')]();};}function saveUpdates(_0x440a28,_0x3427b5){return function(_0x408fff){if(_0x408fff){return _0x408fff[_0x1665('0x1f')](_0x440a28)['then'](function(_0x3b8ad4){return _0x3b8ad4;});}return null;};}function removeEntity(_0x2748f4,_0x593473){return function(_0x45ce9e){if(_0x45ce9e){return _0x45ce9e['destroy']()[_0x1665('0x20')](function(){_0x2748f4[_0x1665('0x16')](0xcc)[_0x1665('0x21')]();});}};}function handleEntityNotFound(_0x203625,_0x3dc5ce){return function(_0x12fb7e){if(!_0x12fb7e){_0x203625[_0x1665('0x15')](0x194);}return _0x12fb7e;};}function handleError(_0x3bd25f,_0x3cb06e){_0x3cb06e=_0x3cb06e||0x1f4;return function(_0x1dbc8c){logger[_0x1665('0x22')](_0x1dbc8c[_0x1665('0x23')]);if(_0x1dbc8c[_0x1665('0x24')]){delete _0x1dbc8c[_0x1665('0x24')];}_0x3bd25f[_0x1665('0x16')](_0x3cb06e)['send'](_0x1dbc8c);};}exports[_0x1665('0x25')]=function(_0x1b34bf,_0x2a643c){var _0x49e59d={},_0x31d498={},_0x553634={'count':0x0,'rows':[]};var _0x1e7507=_['map'](db[_0x1665('0x26')][_0x1665('0x27')],function(_0x39b9f2){return{'name':_0x39b9f2[_0x1665('0x28')],'type':_0x39b9f2['type'][_0x1665('0x29')]};});_0x31d498['model']=_[_0x1665('0x2a')](_0x1e7507,'name');_0x31d498['query']=_[_0x1665('0x2b')](_0x1b34bf['query']);_0x31d498[_0x1665('0x2c')]=_[_0x1665('0x2d')](_0x31d498['model'],_0x31d498[_0x1665('0x2e')]);_0x49e59d['attributes']=_['intersection'](_0x31d498[_0x1665('0x2f')],qs[_0x1665('0x30')](_0x1b34bf[_0x1665('0x2e')][_0x1665('0x30')]));_0x49e59d['attributes']=_0x49e59d[_0x1665('0x31')]['length']?_0x49e59d[_0x1665('0x31')]:_0x31d498[_0x1665('0x2f')];if(!_0x1b34bf['query'][_0x1665('0x32')](_0x1665('0x33'))){_0x49e59d['limit']=qs[_0x1665('0x1b')](_0x1b34bf[_0x1665('0x2e')]['limit']);_0x49e59d[_0x1665('0x18')]=qs[_0x1665('0x18')](_0x1b34bf[_0x1665('0x2e')]['offset']);}_0x49e59d['order']=qs[_0x1665('0x34')](_0x1b34bf[_0x1665('0x2e')]['sort']);_0x49e59d[_0x1665('0x35')]=qs[_0x1665('0x2c')](_[_0x1665('0x36')](_0x1b34bf[_0x1665('0x2e')],_0x31d498[_0x1665('0x2c')]),_0x1e7507);if(_0x1b34bf[_0x1665('0x2e')][_0x1665('0x37')]){_0x49e59d[_0x1665('0x35')]=_[_0x1665('0x38')](_0x49e59d[_0x1665('0x35')],{'$or':_['map'](_0x1e7507,function(_0x3f4a2e){if(_0x3f4a2e[_0x1665('0x39')]!=='VIRTUAL'){var _0x5ee8ef={};_0x5ee8ef[_0x3f4a2e['name']]={'$like':'%'+_0x1b34bf[_0x1665('0x2e')]['filter']+'%'};return _0x5ee8ef;}})});}_0x49e59d=_[_0x1665('0x38')]({},_0x49e59d,_0x1b34bf[_0x1665('0x3a')]);var _0x267d72={'where':_0x49e59d['where']};return db[_0x1665('0x26')]['count'](_0x267d72)[_0x1665('0x20')](function(_0x56f06f){_0x553634[_0x1665('0x1a')]=_0x56f06f;if(_0x1b34bf[_0x1665('0x2e')][_0x1665('0x3b')]){_0x49e59d[_0x1665('0x3c')]=[{'all':!![]}];}return db[_0x1665('0x26')][_0x1665('0x3d')](_0x49e59d);})[_0x1665('0x20')](function(_0x1ea11a){_0x553634['rows']=_0x1ea11a;return _0x553634;})[_0x1665('0x20')](respondWithFilteredResult(_0x2a643c,_0x49e59d))['catch'](handleError(_0x2a643c,null));};exports[_0x1665('0x3e')]=function(_0x11e3c7,_0x3c5d6b){var _0x59bab3={'raw':!![],'where':{'id':_0x11e3c7[_0x1665('0x3f')]['id']}},_0x112ced={};_0x112ced[_0x1665('0x2f')]=_['keys'](db[_0x1665('0x26')][_0x1665('0x27')]);_0x112ced[_0x1665('0x2e')]=_[_0x1665('0x2b')](_0x11e3c7[_0x1665('0x2e')]);_0x112ced[_0x1665('0x2c')]=_['intersection'](_0x112ced[_0x1665('0x2f')],_0x112ced[_0x1665('0x2e')]);_0x59bab3[_0x1665('0x31')]=_[_0x1665('0x2d')](_0x112ced['model'],qs[_0x1665('0x30')](_0x11e3c7[_0x1665('0x2e')]['fields']));_0x59bab3[_0x1665('0x31')]=_0x59bab3[_0x1665('0x31')]['length']?_0x59bab3['attributes']:_0x112ced['model'];if(_0x11e3c7[_0x1665('0x2e')]['includeAll']){_0x59bab3['include']=[{'all':!![]}];}_0x59bab3=_[_0x1665('0x38')]({},_0x59bab3,_0x11e3c7[_0x1665('0x3a')]);return db['VtigerField'][_0x1665('0x40')](_0x59bab3)[_0x1665('0x20')](handleEntityNotFound(_0x3c5d6b,null))[_0x1665('0x20')](respondWithResult(_0x3c5d6b,null))[_0x1665('0x41')](handleError(_0x3c5d6b,null));};exports['create']=function(_0x38dede,_0x4a0f1f){return db[_0x1665('0x26')][_0x1665('0x42')](_0x38dede[_0x1665('0x43')],{})['then'](respondWithResult(_0x4a0f1f,0xc9))[_0x1665('0x41')](handleError(_0x4a0f1f,null));};exports[_0x1665('0x1f')]=function(_0x3dd967,_0x39e051){if(_0x3dd967[_0x1665('0x43')]['id']){delete _0x3dd967[_0x1665('0x43')]['id'];}return db[_0x1665('0x26')]['find']({'where':{'id':_0x3dd967[_0x1665('0x3f')]['id']}})[_0x1665('0x20')](handleEntityNotFound(_0x39e051,null))[_0x1665('0x20')](saveUpdates(_0x3dd967['body'],null))[_0x1665('0x20')](respondWithResult(_0x39e051,null))[_0x1665('0x41')](handleError(_0x39e051,null));};exports['destroy']=function(_0x573116,_0x5f0d45){return db[_0x1665('0x26')][_0x1665('0x40')]({'where':{'id':_0x573116[_0x1665('0x3f')]['id']}})[_0x1665('0x20')](handleEntityNotFound(_0x5f0d45,null))['then'](removeEntity(_0x5f0d45,null))[_0x1665('0x41')](handleError(_0x5f0d45,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 886c99b..cdf0c6e 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 _0x2c1a=['api','moment','path','rimraf','../../config/environment','./intVtigerField.attributes','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x26390f,_0x5e1005){var _0x3d9d11=function(_0x3402e0){while(--_0x3402e0){_0x26390f['push'](_0x26390f['shift']());}};_0x3d9d11(++_0x5e1005);}(_0x2c1a,0x65));var _0xa2c1=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0x2c1a[_0x4d3a9b];return _0x1b5471;};'use strict';var _=require(_0xa2c1('0x0'));var util=require(_0xa2c1('0x1'));var logger=require(_0xa2c1('0x2'))(_0xa2c1('0x3'));var moment=require(_0xa2c1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2c1('0x5'));var rimraf=require(_0xa2c1('0x6'));var config=require(_0xa2c1('0x7'));var attributes=require(_0xa2c1('0x8'));module['exports']=function(_0x408a2a,_0x2beb6e){return _0x408a2a['define'](_0xa2c1('0x9'),attributes,{'tableName':_0xa2c1('0xa'),'paranoid':![],'indexes':[{'name':_0xa2c1('0xb'),'fields':['idField',_0xa2c1('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1347=['./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x1347,0xca));var _0x7134=function(_0xb400ce,_0x51e8dc){_0xb400ce=_0xb400ce-0x0;var _0x50b4bc=_0x1347[_0xb400ce];return _0x50b4bc;};'use strict';var _=require(_0x7134('0x0'));var util=require(_0x7134('0x1'));var logger=require(_0x7134('0x2'))(_0x7134('0x3'));var moment=require('moment');var BPromise=require(_0x7134('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7134('0x5'));var rimraf=require(_0x7134('0x6'));var config=require(_0x7134('0x7'));var attributes=require(_0x7134('0x8'));module[_0x7134('0x9')]=function(_0x250f66,_0x508507){return _0x250f66[_0x7134('0xa')]('VtigerField',attributes,{'tableName':_0x7134('0xb'),'paranoid':![],'indexes':[{'name':_0x7134('0xc'),'fields':[_0x7134('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 1af2b4b..6115107 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 _0xbc5b=['code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error'];(function(_0x1d3706,_0x43e0d7){var _0x8cffac=function(_0x14b461){while(--_0x14b461){_0x1d3706['push'](_0x1d3706['shift']());}};_0x8cffac(++_0x43e0d7);}(_0xbc5b,0x1d1));var _0xbbc5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbc5b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbbc5('0x0'));var util=require('util');var moment=require(_0xbbc5('0x1'));var BPromise=require(_0xbbc5('0x2'));var rs=require(_0xbbc5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbc5('0x4'))['db'];var utils=require(_0xbbc5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xbbc5('0x6'));var jayson=require(_0xbbc5('0x7'));var client=jayson[_0xbbc5('0x8')][_0xbbc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x106d74,_0x427ee5,_0x236974){return new BPromise(function(_0x2c65a3,_0x5907f8){return client[_0xbbc5('0xa')](_0x106d74,_0x236974)['then'](function(_0xd31e61){logger[_0xbbc5('0xb')]('VtigerField,\x20%s,\x20%s',_0x427ee5,_0xbbc5('0xc'));logger['debug'](_0xbbc5('0xd'),_0x427ee5,'request\x20sent',JSON['stringify'](_0xd31e61));if(_0xd31e61[_0xbbc5('0xe')]){if(_0xd31e61[_0xbbc5('0xe')][_0xbbc5('0xf')]===0x1f4){logger[_0xbbc5('0xe')](_0xbbc5('0x10'),_0x427ee5,_0xd31e61[_0xbbc5('0xe')][_0xbbc5('0x11')]);return _0x5907f8(_0xd31e61[_0xbbc5('0xe')][_0xbbc5('0x11')]);}logger[_0xbbc5('0xe')]('VtigerField,\x20%s,\x20%s',_0x427ee5,_0xd31e61[_0xbbc5('0xe')][_0xbbc5('0x11')]);return _0x2c65a3(_0xd31e61[_0xbbc5('0xe')][_0xbbc5('0x11')]);}else{logger[_0xbbc5('0xb')](_0xbbc5('0x10'),_0x427ee5,_0xbbc5('0xc'));_0x2c65a3(_0xd31e61[_0xbbc5('0x12')][_0xbbc5('0x11')]);}})[_0xbbc5('0x13')](function(_0x1ecbca){logger[_0xbbc5('0xe')]('VtigerField,\x20%s,\x20%s',_0x427ee5,_0x1ecbca);_0x5907f8(_0x1ecbca);});});} \ No newline at end of file +var _0xd206=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35fd12,_0x20a462){var _0x5e1177=function(_0x1740d9){while(--_0x1740d9){_0x35fd12['push'](_0x35fd12['shift']());}};_0x5e1177(++_0x20a462);}(_0xd206,0x94));var _0x6d20=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xd206[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0x6d20('0x0'));var moment=require(_0x6d20('0x1'));var BPromise=require(_0x6d20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d20('0x3'))['db'];var utils=require(_0x6d20('0x4'));var logger=require(_0x6d20('0x5'))(_0x6d20('0x6'));var config=require('../../config/environment');var jayson=require(_0x6d20('0x7'));var client=jayson[_0x6d20('0x8')][_0x6d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xea8f15,_0x2ea7f4,_0x2af037){return new BPromise(function(_0x25180b,_0x1c1d7c){return client[_0x6d20('0xa')](_0xea8f15,_0x2af037)['then'](function(_0x31f985){logger[_0x6d20('0xb')](_0x6d20('0xc'),_0x2ea7f4,_0x6d20('0xd'));logger[_0x6d20('0xe')](_0x6d20('0xf'),_0x2ea7f4,'request\x20sent',JSON[_0x6d20('0x10')](_0x31f985));if(_0x31f985[_0x6d20('0x11')]){if(_0x31f985[_0x6d20('0x11')][_0x6d20('0x12')]===0x1f4){logger[_0x6d20('0x11')](_0x6d20('0xc'),_0x2ea7f4,_0x31f985[_0x6d20('0x11')]['message']);return _0x1c1d7c(_0x31f985['error'][_0x6d20('0x13')]);}logger[_0x6d20('0x11')](_0x6d20('0xc'),_0x2ea7f4,_0x31f985['error'][_0x6d20('0x13')]);return _0x25180b(_0x31f985[_0x6d20('0x11')][_0x6d20('0x13')]);}else{logger[_0x6d20('0xb')](_0x6d20('0xc'),_0x2ea7f4,'request\x20sent');_0x25180b(_0x31f985['result']['message']);}})[_0x6d20('0x14')](function(_0x3c48ec){logger[_0x6d20('0x11')]('VtigerField,\x20%s,\x20%s',_0x2ea7f4,_0x3c48ec);_0x1c1d7c(_0x3c48ec);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0d9382c..c1d7cfd 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 _0x03ab=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy'];(function(_0x1f169d,_0x1b918e){var _0x30fefe=function(_0x1a8e62){while(--_0x1a8e62){_0x1f169d['push'](_0x1f169d['shift']());}};_0x30fefe(++_0x1b918e);}(_0x03ab,0x1e5));var _0xb03a=function(_0x5a54e,_0x44d18f){_0x5a54e=_0x5a54e-0x0;var _0x3c809d=_0x03ab[_0x5a54e];return _0x3c809d;};'use strict';var multer=require('multer');var util=require(_0xb03a('0x0'));var path=require(_0xb03a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb03a('0x2'));var router=express[_0xb03a('0x3')]();var fs_extra=require(_0xb03a('0x4'));var auth=require(_0xb03a('0x5'));var interaction=require(_0xb03a('0x6'));var config=require(_0xb03a('0x7'));var controller=require(_0xb03a('0x8'));router[_0xb03a('0x9')]('/',auth[_0xb03a('0xa')](),controller['index']);router['get'](_0xb03a('0xb'),auth[_0xb03a('0xa')](),controller['show']);router[_0xb03a('0x9')](_0xb03a('0xc'),auth[_0xb03a('0xa')](),controller[_0xb03a('0xd')]);router['get'](_0xb03a('0xe'),auth['isAuthenticated'](),controller[_0xb03a('0xf')]);router[_0xb03a('0x10')]('/',auth['isAuthenticated'](),controller[_0xb03a('0x11')]);router[_0xb03a('0x10')]('/:id/configurations',auth[_0xb03a('0xa')](),controller['addConfiguration']);router[_0xb03a('0x12')](_0xb03a('0xb'),auth[_0xb03a('0xa')](),controller['update']);router[_0xb03a('0x13')](_0xb03a('0xb'),auth[_0xb03a('0xa')](),controller[_0xb03a('0x14')]);module[_0xb03a('0x15')]=router; \ No newline at end of file +var _0x76cd=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','get','/:id','show','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x211606,_0x136ecd){var _0x1efd36=function(_0x572202){while(--_0x572202){_0x211606['push'](_0x211606['shift']());}};_0x1efd36(++_0x136ecd);}(_0x76cd,0x19d));var _0xd76c=function(_0x1147a7,_0xaf80c0){_0x1147a7=_0x1147a7-0x0;var _0x2f6109=_0x76cd[_0x1147a7];return _0x2f6109;};'use strict';var multer=require(_0xd76c('0x0'));var util=require(_0xd76c('0x1'));var path=require(_0xd76c('0x2'));var timeout=require(_0xd76c('0x3'));var express=require('express');var router=express[_0xd76c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd76c('0x5'));var interaction=require(_0xd76c('0x6'));var config=require(_0xd76c('0x7'));var controller=require(_0xd76c('0x8'));router['get']('/',auth[_0xd76c('0x9')](),controller['index']);router[_0xd76c('0xa')](_0xd76c('0xb'),auth[_0xd76c('0x9')](),controller[_0xd76c('0xc')]);router[_0xd76c('0xa')]('/:id/configurations',auth[_0xd76c('0x9')](),controller['getConfigurations']);router[_0xd76c('0xa')](_0xd76c('0xd'),auth[_0xd76c('0x9')](),controller['getFields']);router[_0xd76c('0xe')]('/',auth[_0xd76c('0x9')](),controller[_0xd76c('0xf')]);router['post'](_0xd76c('0x10'),auth[_0xd76c('0x9')](),controller[_0xd76c('0x11')]);router[_0xd76c('0x12')]('/:id',auth[_0xd76c('0x9')](),controller[_0xd76c('0x13')]);router[_0xd76c('0x14')](_0xd76c('0xb'),auth[_0xd76c('0x9')](),controller[_0xd76c('0x15')]);module[_0xd76c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 4d3e931..dbc7813 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 _0xdeb3=['newTab','exports','STRING','remoteUri','ENUM','token','integrationTab'];(function(_0x1f102d,_0x38971d){var _0x38c292=function(_0x59c555){while(--_0x59c555){_0x1f102d['push'](_0x1f102d['shift']());}};_0x38c292(++_0x38971d);}(_0xdeb3,0xb7));var _0x3deb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdeb3[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'name':{'type':Sequelize[_0x3deb('0x1')]},'description':{'type':Sequelize[_0x3deb('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x3deb('0x1')]},'token':{'type':Sequelize[_0x3deb('0x1')]},'remoteUri':{'type':Sequelize[_0x3deb('0x1')],'unique':_0x3deb('0x2')},'authType':{'type':Sequelize[_0x3deb('0x3')]('password',_0x3deb('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3deb('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3deb('0x5'),_0x3deb('0x6')),'defaultValue':_0x3deb('0x5')}}; \ No newline at end of file +var _0xaf5a=['username','ENUM','password','token','integrationTab','newTab','exports','STRING'];(function(_0x129d47,_0x265fe2){var _0x389b7c=function(_0x302ec0){while(--_0x302ec0){_0x129d47['push'](_0x129d47['shift']());}};_0x389b7c(++_0x265fe2);}(_0xaf5a,0x116));var _0xaaf5=function(_0x57eb2d,_0x5e4918){_0x57eb2d=_0x57eb2d-0x0;var _0xd8e18=_0xaf5a[_0x57eb2d];return _0xd8e18;};'use strict';var Sequelize=require('sequelize');module[_0xaaf5('0x0')]={'name':{'type':Sequelize[_0xaaf5('0x1')]},'description':{'type':Sequelize[_0xaaf5('0x1')]},'username':{'type':Sequelize[_0xaaf5('0x1')],'unique':_0xaaf5('0x2')},'password':{'type':Sequelize[_0xaaf5('0x1')]},'token':{'type':Sequelize[_0xaaf5('0x1')]},'remoteUri':{'type':Sequelize[_0xaaf5('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xaaf5('0x3')](_0xaaf5('0x4'),_0xaaf5('0x5')),'defaultValue':_0xaaf5('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xaaf5('0x6'),_0xaaf5('0x7')),'defaultValue':_0xaaf5('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 099ce91..527d944 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd914=['channel','ZendeskField','username','token','authType','remoteUri','substring','lastIndexOf','format','%s/%s','ticket_fields','password','headers','%s:%s','Basic\x20%s','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','group','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','pick','map','options','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd914,0x17f));var _0x4d91=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0xd914[_0x45161c];return _0x186581;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];var integrations=require(_0x4d91('0x1b'));function respondWithStatusCode(_0x318e0c,_0x4ea591){_0x4ea591=_0x4ea591||0xcc;return function(_0x577a69){if(_0x577a69){return _0x318e0c[_0x4d91('0x1c')](_0x4ea591);}return _0x318e0c[_0x4d91('0x1d')](_0x4ea591)[_0x4d91('0x1e')]();};}function respondWithResult(_0x3c9fd6,_0x33fbd4){_0x33fbd4=_0x33fbd4||0xc8;return function(_0x25bafc){if(_0x25bafc){return _0x3c9fd6[_0x4d91('0x1d')](_0x33fbd4)['json'](_0x25bafc);}};}function respondWithFilteredResult(_0x3a8ec9,_0x42631a){return function(_0x1e2ef7){if(_0x1e2ef7){var _0xb92681=typeof _0x42631a[_0x4d91('0x1f')]==='undefined'&&typeof _0x42631a[_0x4d91('0x20')]===_0x4d91('0x21');var _0x241564=_0x1e2ef7[_0x4d91('0x22')];var _0x4cfa40=_0xb92681?0x0:_0x42631a[_0x4d91('0x1f')];var _0x3b579b=_0xb92681?_0x1e2ef7[_0x4d91('0x22')]:_0x42631a['offset']+_0x42631a[_0x4d91('0x20')];var _0x127911;if(_0x3b579b>=_0x241564){_0x3b579b=_0x241564;_0x127911=0xc8;}else{_0x127911=0xce;}_0x3a8ec9[_0x4d91('0x1d')](_0x127911);return _0x3a8ec9[_0x4d91('0x23')](_0x4d91('0x24'),_0x4cfa40+'-'+_0x3b579b+'/'+_0x241564)[_0x4d91('0x25')](_0x1e2ef7);}return null;};}function patchUpdates(_0xc1d44f){return function(_0x193ca9){try{jsonpatch[_0x4d91('0x26')](_0x193ca9,_0xc1d44f,!![]);}catch(_0x226d85){return BPromise['reject'](_0x226d85);}return _0x193ca9[_0x4d91('0x27')]();};}function saveUpdates(_0x5f5236,_0x57913e){return function(_0x74a697){if(_0x74a697){return _0x74a697[_0x4d91('0x28')](_0x5f5236)[_0x4d91('0x29')](function(_0x9cb864){return _0x9cb864;});}return null;};}function removeEntity(_0x7d8cbf,_0x12b722){return function(_0x100cd4){if(_0x100cd4){return _0x100cd4[_0x4d91('0x2a')]()['then'](function(){_0x7d8cbf['status'](0xcc)[_0x4d91('0x1e')]();});}};}function handleEntityNotFound(_0x112923,_0x3bed98){return function(_0x45fc91){if(!_0x45fc91){_0x112923[_0x4d91('0x1c')](0x194);}return _0x45fc91;};}function handleError(_0x2c7d7a,_0x14bdb4){_0x14bdb4=_0x14bdb4||0x1f4;return function(_0x560966){logger[_0x4d91('0x2b')](_0x560966[_0x4d91('0x2c')]);if(_0x560966[_0x4d91('0x2d')]){delete _0x560966['name'];}_0x2c7d7a['status'](_0x14bdb4)[_0x4d91('0x2e')](_0x560966);};}exports[_0x4d91('0x2f')]=function(_0x5ed948,_0x50fe76){var _0x42d5a0={},_0x2d6981={},_0x43371e={'count':0x0,'rows':[]};var _0x17c7bc=_['map'](db[_0x4d91('0x30')][_0x4d91('0x31')],function(_0x468e95){return{'name':_0x468e95[_0x4d91('0x32')],'type':_0x468e95[_0x4d91('0x33')][_0x4d91('0x34')]};});_0x2d6981[_0x4d91('0x35')]=_['map'](_0x17c7bc,_0x4d91('0x2d'));_0x2d6981['query']=_['keys'](_0x5ed948[_0x4d91('0x36')]);_0x2d6981[_0x4d91('0x37')]=_['intersection'](_0x2d6981[_0x4d91('0x35')],_0x2d6981[_0x4d91('0x36')]);_0x42d5a0[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x2d6981[_0x4d91('0x35')],qs['fields'](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x42d5a0[_0x4d91('0x38')]=_0x42d5a0[_0x4d91('0x38')][_0x4d91('0x3b')]?_0x42d5a0[_0x4d91('0x38')]:_0x2d6981['model'];if(!_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3c')]('nolimit')){_0x42d5a0[_0x4d91('0x20')]=qs[_0x4d91('0x20')](_0x5ed948[_0x4d91('0x36')]['limit']);_0x42d5a0[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x1f')]);}_0x42d5a0['order']=qs[_0x4d91('0x3d')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x42d5a0[_0x4d91('0x3e')]=qs['filters'](_['pick'](_0x5ed948[_0x4d91('0x36')],_0x2d6981[_0x4d91('0x37')]),_0x17c7bc);if(_0x5ed948['query'][_0x4d91('0x3f')]){_0x42d5a0[_0x4d91('0x3e')]=_[_0x4d91('0x40')](_0x42d5a0[_0x4d91('0x3e')],{'$or':_['map'](_0x17c7bc,function(_0x2eb7c7){if(_0x2eb7c7[_0x4d91('0x33')]!=='VIRTUAL'){var _0x1ba6cd={};_0x1ba6cd[_0x2eb7c7['name']]={'$like':'%'+_0x5ed948[_0x4d91('0x36')]['filter']+'%'};return _0x1ba6cd;}})});}_0x42d5a0=_[_0x4d91('0x40')]({},_0x42d5a0,_0x5ed948['options']);var _0x24fc69={'where':_0x42d5a0[_0x4d91('0x3e')]};return db[_0x4d91('0x30')][_0x4d91('0x22')](_0x24fc69)['then'](function(_0x5bcc9b){_0x43371e[_0x4d91('0x22')]=_0x5bcc9b;if(_0x5ed948['query'][_0x4d91('0x41')]){_0x42d5a0[_0x4d91('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4d91('0x43')](_0x42d5a0);})[_0x4d91('0x29')](function(_0x14db37){_0x43371e[_0x4d91('0x44')]=_0x14db37;return _0x43371e;})[_0x4d91('0x29')](respondWithFilteredResult(_0x50fe76,_0x42d5a0))[_0x4d91('0x45')](handleError(_0x50fe76,null));};exports[_0x4d91('0x46')]=function(_0x4f6254,_0x1e4c6d){var _0x4c70af={'raw':![],'where':{'id':_0x4f6254[_0x4d91('0x47')]['id']}},_0x41c06a={};_0x41c06a[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x30')][_0x4d91('0x31')]);_0x41c06a['query']=_['keys'](_0x4f6254[_0x4d91('0x36')]);_0x41c06a[_0x4d91('0x37')]=_['intersection'](_0x41c06a[_0x4d91('0x35')],_0x41c06a[_0x4d91('0x36')]);_0x4c70af[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x41c06a[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x4f6254[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x4c70af[_0x4d91('0x38')]=_0x4c70af['attributes']['length']?_0x4c70af[_0x4d91('0x38')]:_0x41c06a['model'];if(_0x4f6254[_0x4d91('0x36')][_0x4d91('0x41')]){_0x4c70af[_0x4d91('0x42')]=[{'all':!![]}];}_0x4c70af=_[_0x4d91('0x40')]({},_0x4c70af,_0x4f6254['options']);return db[_0x4d91('0x30')]['find'](_0x4c70af)['then'](handleEntityNotFound(_0x1e4c6d,null))[_0x4d91('0x29')](respondWithResult(_0x1e4c6d,null))[_0x4d91('0x45')](handleError(_0x1e4c6d,null));};exports[_0x4d91('0x49')]=function(_0xa03d75,_0x1f91ec){return db[_0x4d91('0x30')]['create'](_0xa03d75[_0x4d91('0x4a')],{})[_0x4d91('0x29')](respondWithResult(_0x1f91ec,0xc9))[_0x4d91('0x45')](handleError(_0x1f91ec,null));};exports[_0x4d91('0x28')]=function(_0x106e5b,_0x44e9ec){if(_0x106e5b[_0x4d91('0x4a')]['id']){delete _0x106e5b[_0x4d91('0x4a')]['id'];}return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x106e5b[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x44e9ec,null))[_0x4d91('0x29')](saveUpdates(_0x106e5b['body'],null))[_0x4d91('0x29')](respondWithResult(_0x44e9ec,null))[_0x4d91('0x45')](handleError(_0x44e9ec,null));};exports[_0x4d91('0x2a')]=function(_0x386935,_0x436a3d){return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x386935[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x436a3d,null))[_0x4d91('0x29')](removeEntity(_0x436a3d,null))[_0x4d91('0x45')](handleError(_0x436a3d,null));};exports[_0x4d91('0x4c')]=function(_0x2bba43,_0x26ecd7,_0x19e57e){var _0x5765ce={};var _0x4aae23={};var _0x392cc3;var _0x2159e4;return db[_0x4d91('0x30')][_0x4d91('0x4d')]({'where':{'id':_0x2bba43[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x26ecd7,null))[_0x4d91('0x29')](function(_0x4138c5){if(_0x4138c5){_0x392cc3=_0x4138c5;_0x4aae23[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x4e')][_0x4d91('0x31')]);_0x4aae23[_0x4d91('0x36')]=_[_0x4d91('0x48')](_0x2bba43[_0x4d91('0x36')]);_0x4aae23[_0x4d91('0x37')]=_[_0x4d91('0x39')](_0x4aae23['model'],_0x4aae23['query']);_0x5765ce['attributes']=_[_0x4d91('0x39')](_0x4aae23[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x2bba43['query'][_0x4d91('0x3a')]));_0x5765ce[_0x4d91('0x38')]=_0x5765ce[_0x4d91('0x38')]['length']?_0x5765ce['attributes']:_0x4aae23['model'];_0x5765ce[_0x4d91('0x4f')]=qs[_0x4d91('0x3d')](_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x5765ce[_0x4d91('0x3e')]=qs['filters'](_[_0x4d91('0x50')](_0x2bba43[_0x4d91('0x36')],_0x4aae23['filters']));if(_0x2bba43['query'][_0x4d91('0x3f')]){_0x5765ce['where']=_[_0x4d91('0x40')](_0x5765ce[_0x4d91('0x3e')],{'$or':_[_0x4d91('0x51')](_0x5765ce['attributes'],function(_0x2e0bff){var _0x3d6c26={};_0x3d6c26[_0x2e0bff]={'$like':'%'+_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3f')]+'%'};return _0x3d6c26;})});}_0x5765ce=_[_0x4d91('0x40')]({},_0x5765ce,_0x2bba43[_0x4d91('0x52')]);return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})['then'](function(_0x533572){if(_0x533572){_0x2159e4=_0x533572['length'];if(!_0x2bba43['query'][_0x4d91('0x3c')](_0x4d91('0x53'))){_0x5765ce[_0x4d91('0x20')]=qs['limit'](_0x2bba43[_0x4d91('0x36')]['limit']);_0x5765ce[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x2bba43['query']['offset']);}return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})[_0x4d91('0x29')](function(_0x31150f){if(_0x31150f){return _0x31150f?{'count':_0x2159e4,'rows':_0x31150f}:null;}})[_0x4d91('0x29')](respondWithResult(_0x26ecd7,null))[_0x4d91('0x45')](handleError(_0x26ecd7,null));};exports[_0x4d91('0x54')]=function(_0x7a94e2,_0x42e550,_0xd384a9){if(_0x7a94e2[_0x4d91('0x4a')]['id']){delete _0x7a94e2['body']['id'];}return db['ZendeskAccount'][_0x4d91('0x4d')]({'where':{'id':_0x7a94e2[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x42e550,null))[_0x4d91('0x29')](function(_0x16ba26){if(_0x16ba26){_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x55')]=_0x16ba26['id'];_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x56')]=integrations['getSubjects'](_0x7a94e2['body']['channel'],_0x7a94e2['body'][_0x4d91('0x33')]);_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x57')]=integrations[_0x4d91('0x58')](_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x59')],_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x33')]);return db[_0x4d91('0x4e')][_0x4d91('0x49')](_0x7a94e2[_0x4d91('0x4a')],{'include':[{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x56')},{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x57')}]});}return null;})[_0x4d91('0x29')](respondWithResult(_0x42e550,null))[_0x4d91('0x45')](handleError(_0x42e550,null));};exports['getFields']=function(_0x4062c6,_0x1be4b1,_0xc4ef10){var _0x2e2105='';return db[_0x4d91('0x30')]['findOne']({'where':{'id':_0x4062c6[_0x4d91('0x47')]['id']},'attributes':['id',_0x4d91('0x5b'),'password',_0x4d91('0x5c'),_0x4d91('0x5d'),_0x4d91('0x5e')]})[_0x4d91('0x29')](handleEntityNotFound(_0x1be4b1,null))[_0x4d91('0x29')](function(_0x4bc5a0){if(_0x4bc5a0){_0x2e2105=_0x4bc5a0[_0x4d91('0x5e')];var _0x2a5bc0=_0x2e2105['slice'](-0x1);if(_0x2a5bc0==='/'){_0x2e2105=_0x2e2105[_0x4d91('0x5f')](0x0,_0x2e2105[_0x4d91('0x60')](_0x2a5bc0));}var _0xd94b29={'method':'GET','uri':util[_0x4d91('0x61')](_0x4d91('0x62'),_0x2e2105,_0x4d91('0x63')),'json':!![]};switch(_0x4bc5a0[_0x4d91('0x5d')]){case _0x4d91('0x64'):_0xd94b29[_0x4d91('0x65')]={'Authorization':util[_0x4d91('0x61')]('Basic\x20%s',new Buffer(util[_0x4d91('0x61')](_0x4d91('0x66'),_0x4bc5a0['username'],_0x4bc5a0[_0x4d91('0x64')]))['toString']('base64'))};break;case _0x4d91('0x5c'):_0xd94b29['headers']={'Authorization':util[_0x4d91('0x61')](_0x4d91('0x67'),new Buffer(util[_0x4d91('0x61')](_0x4d91('0x68'),_0x4bc5a0[_0x4d91('0x5b')],_0x4bc5a0[_0x4d91('0x5c')]))[_0x4d91('0x69')]('base64'))};break;default:throw new db['Sequelize'][(_0x4d91('0x6a'))](_0x4d91('0x6b'));}return rp(_0xd94b29);}})[_0x4d91('0x29')](function(_0x42164f){if(_0x42164f){var _0x1e3838=['subject','description',_0x4d91('0x6c'),'assignee'];_['remove'](_0x42164f[_0x4d91('0x63')],function(_0x54fea8){return _0x1e3838['includes'](_0x54fea8[_0x4d91('0x33')]);});return{'count':_0x42164f[_0x4d91('0x63')][_0x4d91('0x3b')],'rows':_['map'](_0x42164f['ticket_fields'],function(_0x52604d){return{'id':_0x52604d['id'],'name':_0x52604d[_0x4d91('0x6d')]>0x7?_0x52604d[_0x4d91('0x6e')]:_0x52604d[_0x4d91('0x33')],'custom':_0x52604d[_0x4d91('0x6d')]>0x7?!![]:![],'options':_0x52604d[_0x4d91('0x6f')]?_0x52604d[_0x4d91('0x6f')]:_0x52604d[_0x4d91('0x70')]?_0x52604d[_0x4d91('0x70')]:[]};})};}})[_0x4d91('0x29')](respondWithResult(_0x1be4b1,null))['catch'](function(_0xb9d1ff){var _0x579a9e=_0x4062c6['query'][_0x4d91('0x71')]?0x1f4:_0xb9d1ff[_0x4d91('0x72')]||0x1f4;logger[_0x4d91('0x2b')](_0x4d91('0x73'),'getFields',_0x579a9e,JSON[_0x4d91('0x74')](_0xb9d1ff));delete _0xb9d1ff[_0x4d91('0x2d')];if(_0x579a9e===0x191){_0x579a9e=0x190;}_0x1be4b1[_0x4d91('0x1d')](_0x579a9e)[_0x4d91('0x2e')](_0x4062c6[_0x4d91('0x36')][_0x4d91('0x71')]?{'message':_0x4d91('0x75'),'statusCode':_0xb9d1ff['statusCode']}:_0xb9d1ff);});}; \ No newline at end of file +var _0x6cb4=['getFields','username','password','token','authType','slice','substring','lastIndexOf','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','ZendeskAccount','include','findAll','catch','params','keys','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField'];(function(_0x1fb559,_0x10760c){var _0x16f0de=function(_0x6b7d3b){while(--_0x6b7d3b){_0x1fb559['push'](_0x1fb559['shift']());}};_0x16f0de(++_0x10760c);}(_0x6cb4,0xff));var _0x46cb=function(_0x508794,_0x20e88c){_0x508794=_0x508794-0x0;var _0x2df96a=_0x6cb4[_0x508794];return _0x2df96a;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];var integrations=require(_0x46cb('0x18'));function respondWithStatusCode(_0x1058a8,_0xf22158){_0xf22158=_0xf22158||0xcc;return function(_0x553440){if(_0x553440){return _0x1058a8[_0x46cb('0x19')](_0xf22158);}return _0x1058a8[_0x46cb('0x1a')](_0xf22158)[_0x46cb('0x1b')]();};}function respondWithResult(_0x3c0071,_0x1f7150){_0x1f7150=_0x1f7150||0xc8;return function(_0x32201f){if(_0x32201f){return _0x3c0071[_0x46cb('0x1a')](_0x1f7150)[_0x46cb('0x1c')](_0x32201f);}};}function respondWithFilteredResult(_0x37d368,_0x41e398){return function(_0x136215){if(_0x136215){var _0x5cdb4b=typeof _0x41e398[_0x46cb('0x1d')]==='undefined'&&typeof _0x41e398[_0x46cb('0x1e')]==='undefined';var _0x4e3d29=_0x136215['count'];var _0x1b6646=_0x5cdb4b?0x0:_0x41e398[_0x46cb('0x1d')];var _0x4df1f0=_0x5cdb4b?_0x136215[_0x46cb('0x1f')]:_0x41e398[_0x46cb('0x1d')]+_0x41e398[_0x46cb('0x1e')];var _0x264497;if(_0x4df1f0>=_0x4e3d29){_0x4df1f0=_0x4e3d29;_0x264497=0xc8;}else{_0x264497=0xce;}_0x37d368[_0x46cb('0x1a')](_0x264497);return _0x37d368[_0x46cb('0x20')](_0x46cb('0x21'),_0x1b6646+'-'+_0x4df1f0+'/'+_0x4e3d29)[_0x46cb('0x1c')](_0x136215);}return null;};}function patchUpdates(_0x46e541){return function(_0x21e72a){try{jsonpatch[_0x46cb('0x22')](_0x21e72a,_0x46e541,!![]);}catch(_0x188c28){return BPromise[_0x46cb('0x23')](_0x188c28);}return _0x21e72a[_0x46cb('0x24')]();};}function saveUpdates(_0x1fb467,_0x41ecd2){return function(_0xfbf576){if(_0xfbf576){return _0xfbf576[_0x46cb('0x25')](_0x1fb467)[_0x46cb('0x26')](function(_0x309e4b){return _0x309e4b;});}return null;};}function removeEntity(_0xadcad6,_0x40e0e5){return function(_0x5a1338){if(_0x5a1338){return _0x5a1338['destroy']()[_0x46cb('0x26')](function(){_0xadcad6[_0x46cb('0x1a')](0xcc)[_0x46cb('0x1b')]();});}};}function handleEntityNotFound(_0xe078a8,_0x6e6d9){return function(_0x589152){if(!_0x589152){_0xe078a8[_0x46cb('0x19')](0x194);}return _0x589152;};}function handleError(_0x578ffd,_0x495886){_0x495886=_0x495886||0x1f4;return function(_0x544465){logger[_0x46cb('0x27')](_0x544465[_0x46cb('0x28')]);if(_0x544465[_0x46cb('0x29')]){delete _0x544465[_0x46cb('0x29')];}_0x578ffd[_0x46cb('0x1a')](_0x495886)[_0x46cb('0x2a')](_0x544465);};}exports[_0x46cb('0x2b')]=function(_0x8c65b2,_0x2b846a){var _0x12e01e={},_0x4620ef={},_0x4a1517={'count':0x0,'rows':[]};var _0x1ce88f=_[_0x46cb('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x15f5cf){return{'name':_0x15f5cf['fieldName'],'type':_0x15f5cf[_0x46cb('0x2d')][_0x46cb('0x2e')]};});_0x4620ef[_0x46cb('0x2f')]=_[_0x46cb('0x2c')](_0x1ce88f,_0x46cb('0x29'));_0x4620ef[_0x46cb('0x30')]=_['keys'](_0x8c65b2[_0x46cb('0x30')]);_0x4620ef['filters']=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],_0x4620ef['query']);_0x12e01e[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x4620ef[_0x46cb('0x2f')],qs[_0x46cb('0x33')](_0x8c65b2[_0x46cb('0x30')]['fields']));_0x12e01e[_0x46cb('0x32')]=_0x12e01e['attributes'][_0x46cb('0x34')]?_0x12e01e[_0x46cb('0x32')]:_0x4620ef[_0x46cb('0x2f')];if(!_0x8c65b2['query'][_0x46cb('0x35')](_0x46cb('0x36'))){_0x12e01e['limit']=qs[_0x46cb('0x1e')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x12e01e[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x1d')]);}_0x12e01e[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x38')]);_0x12e01e['where']=qs['filters'](_['pick'](_0x8c65b2[_0x46cb('0x30')],_0x4620ef[_0x46cb('0x39')]),_0x1ce88f);if(_0x8c65b2[_0x46cb('0x30')][_0x46cb('0x3a')]){_0x12e01e[_0x46cb('0x3b')]=_[_0x46cb('0x3c')](_0x12e01e['where'],{'$or':_[_0x46cb('0x2c')](_0x1ce88f,function(_0x4ae944){if(_0x4ae944['type']!==_0x46cb('0x3d')){var _0x59bdb0={};_0x59bdb0[_0x4ae944['name']]={'$like':'%'+_0x8c65b2[_0x46cb('0x30')]['filter']+'%'};return _0x59bdb0;}})});}_0x12e01e=_['merge']({},_0x12e01e,_0x8c65b2[_0x46cb('0x3e')]);var _0x10017d={'where':_0x12e01e[_0x46cb('0x3b')]};return db[_0x46cb('0x3f')][_0x46cb('0x1f')](_0x10017d)[_0x46cb('0x26')](function(_0x21f9a6){_0x4a1517['count']=_0x21f9a6;if(_0x8c65b2[_0x46cb('0x30')]['includeAll']){_0x12e01e[_0x46cb('0x40')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x46cb('0x41')](_0x12e01e);})[_0x46cb('0x26')](function(_0x2445a2){_0x4a1517['rows']=_0x2445a2;return _0x4a1517;})[_0x46cb('0x26')](respondWithFilteredResult(_0x2b846a,_0x12e01e))[_0x46cb('0x42')](handleError(_0x2b846a,null));};exports['show']=function(_0x18be96,_0x3d0b83){var _0x1f67af={'raw':![],'where':{'id':_0x18be96[_0x46cb('0x43')]['id']}},_0x66e602={};_0x66e602['model']=_['keys'](db[_0x46cb('0x3f')]['rawAttributes']);_0x66e602[_0x46cb('0x30')]=_[_0x46cb('0x44')](_0x18be96['query']);_0x66e602[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x66e602[_0x46cb('0x2f')],_0x66e602['query']);_0x1f67af['attributes']=_['intersection'](_0x66e602['model'],qs[_0x46cb('0x33')](_0x18be96[_0x46cb('0x30')][_0x46cb('0x33')]));_0x1f67af[_0x46cb('0x32')]=_0x1f67af[_0x46cb('0x32')]['length']?_0x1f67af['attributes']:_0x66e602[_0x46cb('0x2f')];if(_0x18be96[_0x46cb('0x30')]['includeAll']){_0x1f67af[_0x46cb('0x40')]=[{'all':!![]}];}_0x1f67af=_[_0x46cb('0x3c')]({},_0x1f67af,_0x18be96[_0x46cb('0x3e')]);return db[_0x46cb('0x3f')][_0x46cb('0x45')](_0x1f67af)[_0x46cb('0x26')](handleEntityNotFound(_0x3d0b83,null))[_0x46cb('0x26')](respondWithResult(_0x3d0b83,null))['catch'](handleError(_0x3d0b83,null));};exports['create']=function(_0x449593,_0x52ed52){return db[_0x46cb('0x3f')][_0x46cb('0x46')](_0x449593[_0x46cb('0x47')],{})['then'](respondWithResult(_0x52ed52,0xc9))[_0x46cb('0x42')](handleError(_0x52ed52,null));};exports['update']=function(_0x5c02c9,_0x16c500){if(_0x5c02c9[_0x46cb('0x47')]['id']){delete _0x5c02c9[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x5c02c9[_0x46cb('0x43')]['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x16c500,null))['then'](saveUpdates(_0x5c02c9['body'],null))[_0x46cb('0x26')](respondWithResult(_0x16c500,null))[_0x46cb('0x42')](handleError(_0x16c500,null));};exports['destroy']=function(_0x34399d,_0x33ab2e){return db[_0x46cb('0x3f')][_0x46cb('0x45')]({'where':{'id':_0x34399d[_0x46cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x33ab2e,null))[_0x46cb('0x26')](removeEntity(_0x33ab2e,null))[_0x46cb('0x42')](handleError(_0x33ab2e,null));};exports[_0x46cb('0x48')]=function(_0x52d1a7,_0x1f5c71,_0x56ad38){var _0x48b994={};var _0x1e46cc={};var _0x2cfe6f;var _0x2fe0b1;return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x52d1a7['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x1f5c71,null))[_0x46cb('0x26')](function(_0x5701c0){if(_0x5701c0){_0x2cfe6f=_0x5701c0;_0x1e46cc['model']=_[_0x46cb('0x44')](db[_0x46cb('0x4a')][_0x46cb('0x4b')]);_0x1e46cc['query']=_[_0x46cb('0x44')](_0x52d1a7[_0x46cb('0x30')]);_0x1e46cc[_0x46cb('0x39')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],_0x1e46cc[_0x46cb('0x30')]);_0x48b994[_0x46cb('0x32')]=_[_0x46cb('0x31')](_0x1e46cc[_0x46cb('0x2f')],qs['fields'](_0x52d1a7[_0x46cb('0x30')]['fields']));_0x48b994[_0x46cb('0x32')]=_0x48b994[_0x46cb('0x32')][_0x46cb('0x34')]?_0x48b994[_0x46cb('0x32')]:_0x1e46cc['model'];_0x48b994[_0x46cb('0x37')]=qs[_0x46cb('0x38')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x38')]);_0x48b994[_0x46cb('0x3b')]=qs[_0x46cb('0x39')](_[_0x46cb('0x4c')](_0x52d1a7[_0x46cb('0x30')],_0x1e46cc['filters']));if(_0x52d1a7['query']['filter']){_0x48b994['where']=_[_0x46cb('0x3c')](_0x48b994[_0x46cb('0x3b')],{'$or':_['map'](_0x48b994[_0x46cb('0x32')],function(_0xfa28a8){var _0x10c3f9={};_0x10c3f9[_0xfa28a8]={'$like':'%'+_0x52d1a7['query']['filter']+'%'};return _0x10c3f9;})});}_0x48b994=_[_0x46cb('0x3c')]({},_0x48b994,_0x52d1a7['options']);return _0x2cfe6f[_0x46cb('0x48')](_0x48b994);}})[_0x46cb('0x26')](function(_0x1eb392){if(_0x1eb392){_0x2fe0b1=_0x1eb392[_0x46cb('0x34')];if(!_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x35')](_0x46cb('0x36'))){_0x48b994[_0x46cb('0x1e')]=qs[_0x46cb('0x1e')](_0x52d1a7[_0x46cb('0x30')][_0x46cb('0x1e')]);_0x48b994[_0x46cb('0x1d')]=qs[_0x46cb('0x1d')](_0x52d1a7['query'][_0x46cb('0x1d')]);}return _0x2cfe6f['getConfigurations'](_0x48b994);}})[_0x46cb('0x26')](function(_0x478ada){if(_0x478ada){return _0x478ada?{'count':_0x2fe0b1,'rows':_0x478ada}:null;}})[_0x46cb('0x26')](respondWithResult(_0x1f5c71,null))[_0x46cb('0x42')](handleError(_0x1f5c71,null));};exports[_0x46cb('0x4d')]=function(_0x3dc4bd,_0x656601,_0x598a41){if(_0x3dc4bd[_0x46cb('0x47')]['id']){delete _0x3dc4bd[_0x46cb('0x47')]['id'];}return db[_0x46cb('0x3f')][_0x46cb('0x49')]({'where':{'id':_0x3dc4bd['params']['id']}})[_0x46cb('0x26')](handleEntityNotFound(_0x656601,null))[_0x46cb('0x26')](function(_0x6dc790){if(_0x6dc790){_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x4e')]=_0x6dc790['id'];_0x3dc4bd['body'][_0x46cb('0x4f')]=integrations[_0x46cb('0x50')](_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x51')],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x52')]=integrations['getDescriptions'](_0x3dc4bd['body']['channel'],_0x3dc4bd[_0x46cb('0x47')][_0x46cb('0x2d')]);return db[_0x46cb('0x4a')][_0x46cb('0x46')](_0x3dc4bd[_0x46cb('0x47')],{'include':[{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x4f')},{'model':db[_0x46cb('0x53')],'as':_0x46cb('0x52')}]});}return null;})[_0x46cb('0x26')](respondWithResult(_0x656601,null))[_0x46cb('0x42')](handleError(_0x656601,null));};exports[_0x46cb('0x54')]=function(_0x140c96,_0x2ea5d0,_0x5c9f3c){var _0x2e23e4='';return db['ZendeskAccount'][_0x46cb('0x49')]({'where':{'id':_0x140c96['params']['id']},'attributes':['id',_0x46cb('0x55'),_0x46cb('0x56'),_0x46cb('0x57'),_0x46cb('0x58'),'remoteUri']})[_0x46cb('0x26')](handleEntityNotFound(_0x2ea5d0,null))[_0x46cb('0x26')](function(_0x55895a){if(_0x55895a){_0x2e23e4=_0x55895a['remoteUri'];var _0x473758=_0x2e23e4[_0x46cb('0x59')](-0x1);if(_0x473758==='/'){_0x2e23e4=_0x2e23e4[_0x46cb('0x5a')](0x0,_0x2e23e4[_0x46cb('0x5b')](_0x473758));}var _0x1ba6ae={'method':'GET','uri':util['format']('%s/%s',_0x2e23e4,_0x46cb('0x5c')),'json':!![]};switch(_0x55895a[_0x46cb('0x58')]){case _0x46cb('0x56'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util[_0x46cb('0x5e')](_0x46cb('0x60'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x56')]))[_0x46cb('0x61')]('base64'))};break;case _0x46cb('0x57'):_0x1ba6ae[_0x46cb('0x5d')]={'Authorization':util[_0x46cb('0x5e')](_0x46cb('0x5f'),new Buffer(util['format'](_0x46cb('0x62'),_0x55895a[_0x46cb('0x55')],_0x55895a[_0x46cb('0x57')]))[_0x46cb('0x61')]('base64'))};break;default:throw new db[(_0x46cb('0x63'))][(_0x46cb('0x64'))](_0x46cb('0x65'));}return rp(_0x1ba6ae);}})[_0x46cb('0x26')](function(_0x5eaad6){if(_0x5eaad6){var _0x5775dc=['subject',_0x46cb('0x66'),'group',_0x46cb('0x67')];_['remove'](_0x5eaad6[_0x46cb('0x5c')],function(_0x36a82b){return _0x5775dc[_0x46cb('0x68')](_0x36a82b[_0x46cb('0x2d')]);});return{'count':_0x5eaad6['ticket_fields'][_0x46cb('0x34')],'rows':_[_0x46cb('0x2c')](_0x5eaad6[_0x46cb('0x5c')],function(_0x468d1f){return{'id':_0x468d1f['id'],'name':_0x468d1f['position']>0x7?_0x468d1f['title']:_0x468d1f[_0x46cb('0x2d')],'custom':_0x468d1f[_0x46cb('0x69')]>0x7?!![]:![],'options':_0x468d1f[_0x46cb('0x6a')]?_0x468d1f[_0x46cb('0x6a')]:_0x468d1f[_0x46cb('0x6b')]?_0x468d1f[_0x46cb('0x6b')]:[]};})};}})['then'](respondWithResult(_0x2ea5d0,null))['catch'](function(_0x3089d7){var _0x53eb=_0x140c96['query'][_0x46cb('0x6c')]?0x1f4:_0x3089d7[_0x46cb('0x6d')]||0x1f4;logger[_0x46cb('0x27')](_0x46cb('0x6e'),_0x46cb('0x54'),_0x53eb,JSON[_0x46cb('0x6f')](_0x3089d7));delete _0x3089d7[_0x46cb('0x29')];if(_0x53eb===0x191){_0x53eb=0x190;}_0x2ea5d0['status'](_0x53eb)[_0x46cb('0x2a')](_0x140c96[_0x46cb('0x30')][_0x46cb('0x6c')]?{'message':_0x46cb('0x70'),'statusCode':_0x3089d7[_0x46cb('0x6d')]}:_0x3089d7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 3d95b68..f6535b9 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 _0xbd8c=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5e586f,_0x4d823e){var _0x430f35=function(_0xa2db18){while(--_0xa2db18){_0x5e586f['push'](_0x5e586f['shift']());}};_0x430f35(++_0x4d823e);}(_0xbd8c,0x1a7));var _0xcbd8=function(_0x57c276,_0x120d7e){_0x57c276=_0x57c276-0x0;var _0x3d13fe=_0xbd8c[_0x57c276];return _0x3d13fe;};'use strict';var _=require(_0xcbd8('0x0'));var util=require(_0xcbd8('0x1'));var logger=require(_0xcbd8('0x2'))(_0xcbd8('0x3'));var moment=require(_0xcbd8('0x4'));var BPromise=require(_0xcbd8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbd8('0x6'));var rimraf=require(_0xcbd8('0x7'));var config=require(_0xcbd8('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x110b76,_0x14e66f){return _0x110b76[_0xcbd8('0x9')](_0xcbd8('0xa'),attributes,{'tableName':_0xcbd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1b8=['./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','lodash','api','moment','bluebird','request-promise'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe1b8,0x190));var _0x8e1b=function(_0x166042,_0x200f72){_0x166042=_0x166042-0x0;var _0x40b2e2=_0xe1b8[_0x166042];return _0x40b2e2;};'use strict';var _=require(_0x8e1b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8e1b('0x1'));var moment=require(_0x8e1b('0x2'));var BPromise=require(_0x8e1b('0x3'));var rp=require(_0x8e1b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e1b('0x5'));var integrations=require(_0x8e1b('0x6'));module['exports']=function(_0x84ce46,_0x3250f4){return _0x84ce46[_0x8e1b('0x7')](_0x8e1b('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 6ceda2a..02b96ce 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 _0x64df=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','GetZendeskAccount','stringify','ShowZendeskAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2378c1,_0x45750a){var _0x57d92e=function(_0x18d392){while(--_0x18d392){_0x2378c1['push'](_0x2378c1['shift']());}};_0x57d92e(++_0x45750a);}(_0x64df,0x1f2));var _0xf64d=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0x64df[_0x1443eb];return _0x2b8810;};'use strict';var _=require(_0xf64d('0x0'));var util=require('util');var moment=require(_0xf64d('0x1'));var BPromise=require(_0xf64d('0x2'));var rs=require(_0xf64d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf64d('0x4'))['db'];var utils=require(_0xf64d('0x5'));var logger=require(_0xf64d('0x6'))(_0xf64d('0x7'));var config=require(_0xf64d('0x8'));var jayson=require(_0xf64d('0x9'));var client=jayson[_0xf64d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20e998,_0x39e153,_0x410630){return new BPromise(function(_0x182990,_0x5e36ba){return client[_0xf64d('0xb')](_0x20e998,_0x410630)['then'](function(_0x47e2c1){logger[_0xf64d('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x39e153,'request\x20sent');logger[_0xf64d('0xd')](_0xf64d('0xe'),_0x39e153,'request\x20sent',JSON['stringify'](_0x47e2c1));if(_0x47e2c1[_0xf64d('0xf')]){if(_0x47e2c1[_0xf64d('0xf')][_0xf64d('0x10')]===0x1f4){logger[_0xf64d('0xf')](_0xf64d('0x11'),_0x39e153,_0x47e2c1['error'][_0xf64d('0x12')]);return _0x5e36ba(_0x47e2c1['error']['message']);}logger['error'](_0xf64d('0x11'),_0x39e153,_0x47e2c1[_0xf64d('0xf')][_0xf64d('0x12')]);return _0x182990(_0x47e2c1[_0xf64d('0xf')]['message']);}else{logger[_0xf64d('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x39e153,_0xf64d('0x13'));_0x182990(_0x47e2c1[_0xf64d('0x14')][_0xf64d('0x12')]);}})[_0xf64d('0x15')](function(_0x2f1e05){logger['error'](_0xf64d('0x11'),_0x39e153,_0x2f1e05);_0x5e36ba(_0x2f1e05);});});}exports['GetZendeskAccount']=function(_0x240d4f){var _0xd602c2=this;return new Promise(function(_0x41241b,_0x1dec1e){return db[_0xf64d('0x16')][_0xf64d('0x17')]({'raw':_0x240d4f[_0xf64d('0x18')]?_0x240d4f[_0xf64d('0x18')][_0xf64d('0x19')]===undefined?!![]:![]:!![],'where':_0x240d4f[_0xf64d('0x18')]?_0x240d4f[_0xf64d('0x18')][_0xf64d('0x1a')]||null:null,'attributes':_0x240d4f['options']?_0x240d4f[_0xf64d('0x18')][_0xf64d('0x1b')]||null:null,'limit':_0x240d4f['options']?_0x240d4f['options']['limit']||null:null,'include':_0x240d4f[_0xf64d('0x18')]?_0x240d4f[_0xf64d('0x18')][_0xf64d('0x1c')]?_['map'](_0x240d4f['options'][_0xf64d('0x1c')],function(_0x27959a){return{'model':db[_0x27959a['model']],'as':_0x27959a['as'],'attributes':_0x27959a[_0xf64d('0x1b')],'include':_0x27959a[_0xf64d('0x1c')]?_[_0xf64d('0x1d')](_0x27959a[_0xf64d('0x1c')],function(_0x48240b){return{'model':db[_0x48240b[_0xf64d('0x1e')]],'as':_0x48240b['as'],'attributes':_0x48240b['attributes'],'include':_0x48240b[_0xf64d('0x1c')]?_[_0xf64d('0x1d')](_0x48240b[_0xf64d('0x1c')],function(_0x3b8824){return{'model':db[_0x3b8824[_0xf64d('0x1e')]],'as':_0x3b8824['as'],'attributes':_0x3b8824[_0xf64d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf64d('0x1f')](function(_0x2ba265){logger[_0xf64d('0xc')](_0xf64d('0x20'),_0x240d4f);logger['debug']('GetZendeskAccount',_0x240d4f,JSON[_0xf64d('0x21')](_0x2ba265));_0x41241b(_0x2ba265);})[_0xf64d('0x15')](function(_0x2eca49){logger['error']('GetZendeskAccount',_0x2eca49[_0xf64d('0x12')],_0x240d4f);_0x1dec1e(_0xd602c2[_0xf64d('0xf')](0x1f4,_0x2eca49[_0xf64d('0x12')]));});});};exports[_0xf64d('0x22')]=function(_0x28ff85){var _0x448aa0=this;return new Promise(function(_0x40b40f,_0x16672d){return db[_0xf64d('0x16')][_0xf64d('0x23')]({'raw':_0x28ff85[_0xf64d('0x18')]?_0x28ff85[_0xf64d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x28ff85[_0xf64d('0x18')]?_0x28ff85[_0xf64d('0x18')]['where']||null:null,'attributes':_0x28ff85['options']?_0x28ff85[_0xf64d('0x18')][_0xf64d('0x1b')]||null:null,'include':_0x28ff85[_0xf64d('0x18')]?_0x28ff85[_0xf64d('0x18')][_0xf64d('0x1c')]?_['map'](_0x28ff85['options'][_0xf64d('0x1c')],function(_0x3d1d08){return{'model':db[_0x3d1d08[_0xf64d('0x1e')]],'as':_0x3d1d08['as'],'attributes':_0x3d1d08['attributes'],'include':_0x3d1d08['include']?_[_0xf64d('0x1d')](_0x3d1d08[_0xf64d('0x1c')],function(_0x9760b1){return{'model':db[_0x9760b1['model']],'as':_0x9760b1['as'],'attributes':_0x9760b1[_0xf64d('0x1b')],'include':_0x9760b1[_0xf64d('0x1c')]?_[_0xf64d('0x1d')](_0x9760b1[_0xf64d('0x1c')],function(_0x437b97){return{'model':db[_0x437b97[_0xf64d('0x1e')]],'as':_0x437b97['as'],'attributes':_0x437b97[_0xf64d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35d329){logger[_0xf64d('0xc')](_0xf64d('0x22'),_0x28ff85);logger[_0xf64d('0xd')](_0xf64d('0x22'),_0x28ff85,JSON[_0xf64d('0x21')](_0x35d329));_0x40b40f(_0x35d329);})[_0xf64d('0x15')](function(_0x3b5eec){logger[_0xf64d('0xf')]('ShowZendeskAccount',_0x3b5eec[_0xf64d('0x12')],_0x28ff85);_0x16672d(_0x448aa0['error'](0x1f4,_0x3b5eec[_0xf64d('0x12')]));});});}; \ No newline at end of file +var _0x1658=['options','raw','where','limit','include','map','model','attributes','catch','ShowZendeskAccount','find','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetZendeskAccount','ZendeskAccount'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x1658,0x1da));var _0x8165=function(_0x123875,_0xa588ee){_0x123875=_0x123875-0x0;var _0x42c3e9=_0x1658[_0x123875];return _0x42c3e9;};'use strict';var _=require('lodash');var util=require(_0x8165('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8165('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8165('0x2'))['db'];var utils=require(_0x8165('0x3'));var logger=require(_0x8165('0x4'))(_0x8165('0x5'));var config=require(_0x8165('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8165('0x7')][_0x8165('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40e1f2,_0x14c4dc,_0x35f1a9){return new BPromise(function(_0x3fa0aa,_0x289509){return client[_0x8165('0x9')](_0x40e1f2,_0x35f1a9)[_0x8165('0xa')](function(_0xf4729f){logger[_0x8165('0xb')](_0x8165('0xc'),_0x14c4dc,_0x8165('0xd'));logger[_0x8165('0xe')](_0x8165('0xf'),_0x14c4dc,_0x8165('0xd'),JSON['stringify'](_0xf4729f));if(_0xf4729f[_0x8165('0x10')]){if(_0xf4729f[_0x8165('0x10')]['code']===0x1f4){logger[_0x8165('0x10')](_0x8165('0xc'),_0x14c4dc,_0xf4729f['error']['message']);return _0x289509(_0xf4729f[_0x8165('0x10')][_0x8165('0x11')]);}logger[_0x8165('0x10')](_0x8165('0xc'),_0x14c4dc,_0xf4729f[_0x8165('0x10')][_0x8165('0x11')]);return _0x3fa0aa(_0xf4729f[_0x8165('0x10')][_0x8165('0x11')]);}else{logger[_0x8165('0xb')](_0x8165('0xc'),_0x14c4dc,_0x8165('0xd'));_0x3fa0aa(_0xf4729f[_0x8165('0x12')][_0x8165('0x11')]);}})['catch'](function(_0x2cc6ea){logger[_0x8165('0x10')](_0x8165('0xc'),_0x14c4dc,_0x2cc6ea);_0x289509(_0x2cc6ea);});});}exports[_0x8165('0x13')]=function(_0x104e8b){var _0x3c5d03=this;return new Promise(function(_0x3eeadc,_0x57b682){return db[_0x8165('0x14')]['findAll']({'raw':_0x104e8b[_0x8165('0x15')]?_0x104e8b['options'][_0x8165('0x16')]===undefined?!![]:![]:!![],'where':_0x104e8b[_0x8165('0x15')]?_0x104e8b['options'][_0x8165('0x17')]||null:null,'attributes':_0x104e8b[_0x8165('0x15')]?_0x104e8b['options']['attributes']||null:null,'limit':_0x104e8b[_0x8165('0x15')]?_0x104e8b['options'][_0x8165('0x18')]||null:null,'include':_0x104e8b[_0x8165('0x15')]?_0x104e8b['options'][_0x8165('0x19')]?_[_0x8165('0x1a')](_0x104e8b[_0x8165('0x15')][_0x8165('0x19')],function(_0x3c7097){return{'model':db[_0x3c7097[_0x8165('0x1b')]],'as':_0x3c7097['as'],'attributes':_0x3c7097['attributes'],'include':_0x3c7097[_0x8165('0x19')]?_[_0x8165('0x1a')](_0x3c7097[_0x8165('0x19')],function(_0x56fd54){return{'model':db[_0x56fd54['model']],'as':_0x56fd54['as'],'attributes':_0x56fd54[_0x8165('0x1c')],'include':_0x56fd54[_0x8165('0x19')]?_[_0x8165('0x1a')](_0x56fd54[_0x8165('0x19')],function(_0x2fcf83){return{'model':db[_0x2fcf83[_0x8165('0x1b')]],'as':_0x2fcf83['as'],'attributes':_0x2fcf83[_0x8165('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8165('0xa')](function(_0x46b548){logger[_0x8165('0xb')](_0x8165('0x13'),_0x104e8b);logger[_0x8165('0xe')]('GetZendeskAccount',_0x104e8b,JSON['stringify'](_0x46b548));_0x3eeadc(_0x46b548);})[_0x8165('0x1d')](function(_0x5964e9){logger['error'](_0x8165('0x13'),_0x5964e9['message'],_0x104e8b);_0x57b682(_0x3c5d03['error'](0x1f4,_0x5964e9[_0x8165('0x11')]));});});};exports[_0x8165('0x1e')]=function(_0x53f0a1){var _0x4d23e4=this;return new Promise(function(_0x451b43,_0x446f26){return db[_0x8165('0x14')][_0x8165('0x1f')]({'raw':_0x53f0a1[_0x8165('0x15')]?_0x53f0a1[_0x8165('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x53f0a1[_0x8165('0x15')]?_0x53f0a1[_0x8165('0x15')]['where']||null:null,'attributes':_0x53f0a1[_0x8165('0x15')]?_0x53f0a1[_0x8165('0x15')]['attributes']||null:null,'include':_0x53f0a1[_0x8165('0x15')]?_0x53f0a1['options'][_0x8165('0x19')]?_[_0x8165('0x1a')](_0x53f0a1['options'][_0x8165('0x19')],function(_0x11eb16){return{'model':db[_0x11eb16[_0x8165('0x1b')]],'as':_0x11eb16['as'],'attributes':_0x11eb16[_0x8165('0x1c')],'include':_0x11eb16[_0x8165('0x19')]?_[_0x8165('0x1a')](_0x11eb16['include'],function(_0x273bef){return{'model':db[_0x273bef['model']],'as':_0x273bef['as'],'attributes':_0x273bef[_0x8165('0x1c')],'include':_0x273bef[_0x8165('0x19')]?_[_0x8165('0x1a')](_0x273bef[_0x8165('0x19')],function(_0x4f899c){return{'model':db[_0x4f899c['model']],'as':_0x4f899c['as'],'attributes':_0x4f899c[_0x8165('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8165('0xa')](function(_0x4b4879){logger[_0x8165('0xb')](_0x8165('0x1e'),_0x53f0a1);logger[_0x8165('0xe')](_0x8165('0x1e'),_0x53f0a1,JSON[_0x8165('0x20')](_0x4b4879));_0x451b43(_0x4b4879);})[_0x8165('0x1d')](function(_0x6c3c17){logger[_0x8165('0x10')](_0x8165('0x1e'),_0x6c3c17['message'],_0x53f0a1);_0x446f26(_0x4d23e4[_0x8165('0x10')](0x1f4,_0x6c3c17[_0x8165('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f89426a..ed7433e 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 _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x48e519,_0x47e9b1){var _0x17af1e=function(_0x68d35c){while(--_0x68d35c){_0x48e519['push'](_0x48e519['shift']());}};_0x17af1e(++_0x47e9b1);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x5eb8[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file +var _0x757a=['index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','setTags','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x5796a1,_0x59415f){var _0x418654=function(_0xb86215){while(--_0xb86215){_0x5796a1['push'](_0x5796a1['shift']());}};_0x418654(++_0x59415f);}(_0x757a,0xde));var _0xa757=function(_0x169ae4,_0x24015a){_0x169ae4=_0x169ae4-0x0;var _0x5a210b=_0x757a[_0x169ae4];return _0x5a210b;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getFields']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xa757('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa757('0x10')]);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x15')]);module[_0xa757('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5a8581b..ae426aa 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 _0xefa3=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefa3,0x9e));var _0x3efa=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xefa3[_0x456fb1];return _0x4083d6;};'use strict';var Sequelize=require(_0x3efa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3efa('0x1')]}}; \ No newline at end of file +var _0xdff9=['STRING'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xdff9,0x1c1));var _0x9dff=function(_0x393926,_0x4b81d1){_0x393926=_0x393926-0x0;var _0x4a1327=_0xdff9[_0x393926];return _0x4a1327;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9dff('0x0')]},'description':{'type':Sequelize[_0x9dff('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0fecd4f..934a1e5 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 _0x0418=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskConfiguration','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x250514,_0x389eda){var _0x59c25b=function(_0x3ad38b){while(--_0x3ad38b){_0x250514['push'](_0x250514['shift']());}};_0x59c25b(++_0x389eda);}(_0x0418,0x101));var _0x8041=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0418[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x8041('0x0'));var rimraf=require(_0x8041('0x1'));var zipdir=require(_0x8041('0x2'));var jsonpatch=require(_0x8041('0x3'));var rp=require(_0x8041('0x4'));var moment=require(_0x8041('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8041('0x6'));var util=require(_0x8041('0x7'));var path=require(_0x8041('0x8'));var sox=require(_0x8041('0x9'));var csv=require(_0x8041('0xa'));var ejs=require(_0x8041('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8041('0xc'));var squel=require(_0x8041('0xd'));var crypto=require(_0x8041('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8041('0xf'));var toCsv=require(_0x8041('0xa'));var querystring=require(_0x8041('0x10'));var Papa=require(_0x8041('0x11'));var Redis=require(_0x8041('0x12'));var authService=require(_0x8041('0x13'));var qs=require(_0x8041('0x14'));var as=require(_0x8041('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8041('0x16'))('api');var utils=require(_0x8041('0x17'));var config=require(_0x8041('0x18'));var licenseUtil=require(_0x8041('0x19'));var db=require(_0x8041('0x1a'))['db'];function respondWithStatusCode(_0x30b544,_0x39fb3b){_0x39fb3b=_0x39fb3b||0xcc;return function(_0x1a1873){if(_0x1a1873){return _0x30b544['sendStatus'](_0x39fb3b);}return _0x30b544['status'](_0x39fb3b)[_0x8041('0x1b')]();};}function respondWithResult(_0x47a149,_0x587d73){_0x587d73=_0x587d73||0xc8;return function(_0x4b710f){if(_0x4b710f){return _0x47a149[_0x8041('0x1c')](_0x587d73)[_0x8041('0x1d')](_0x4b710f);}};}function respondWithFilteredResult(_0x3f3aae,_0x4bc2c6){return function(_0x22555c){if(_0x22555c){var _0x2d5d27=typeof _0x4bc2c6[_0x8041('0x1e')]==='undefined'&&typeof _0x4bc2c6[_0x8041('0x1f')]==='undefined';var _0x3fab56=_0x22555c['count'];var _0x4ec769=_0x2d5d27?0x0:_0x4bc2c6[_0x8041('0x1e')];var _0x34edc2=_0x2d5d27?_0x22555c['count']:_0x4bc2c6['offset']+_0x4bc2c6['limit'];var _0x385af1;if(_0x34edc2>=_0x3fab56){_0x34edc2=_0x3fab56;_0x385af1=0xc8;}else{_0x385af1=0xce;}_0x3f3aae['status'](_0x385af1);return _0x3f3aae[_0x8041('0x20')](_0x8041('0x21'),_0x4ec769+'-'+_0x34edc2+'/'+_0x3fab56)[_0x8041('0x1d')](_0x22555c);}return null;};}function patchUpdates(_0x46da19){return function(_0x2c7ee0){try{jsonpatch[_0x8041('0x22')](_0x2c7ee0,_0x46da19,!![]);}catch(_0x762eee){return BPromise[_0x8041('0x23')](_0x762eee);}return _0x2c7ee0[_0x8041('0x24')]();};}function saveUpdates(_0x27c831,_0x4f1229){return function(_0x133946){if(_0x133946){return _0x133946[_0x8041('0x25')](_0x27c831)[_0x8041('0x26')](function(_0x258270){return _0x258270;});}return null;};}function removeEntity(_0xf6f05d,_0x33fd8b){return function(_0x10ea62){if(_0x10ea62){return _0x10ea62[_0x8041('0x27')]()[_0x8041('0x26')](function(){_0xf6f05d[_0x8041('0x1c')](0xcc)[_0x8041('0x1b')]();});}};}function handleEntityNotFound(_0xcca494,_0x3959b9){return function(_0x1008cd){if(!_0x1008cd){_0xcca494[_0x8041('0x28')](0x194);}return _0x1008cd;};}function handleError(_0x1b10b8,_0x55edb6){_0x55edb6=_0x55edb6||0x1f4;return function(_0x4db3ef){logger[_0x8041('0x29')](_0x4db3ef[_0x8041('0x2a')]);if(_0x4db3ef[_0x8041('0x2b')]){delete _0x4db3ef['name'];}_0x1b10b8[_0x8041('0x1c')](_0x55edb6)[_0x8041('0x2c')](_0x4db3ef);};}exports[_0x8041('0x2d')]=function(_0x343051,_0x5d8418){var _0x461e02={},_0x27dc5={},_0x470b2d={'count':0x0,'rows':[]};var _0x49648b=_['map'](db[_0x8041('0x2e')]['rawAttributes'],function(_0x5c71b1){return{'name':_0x5c71b1['fieldName'],'type':_0x5c71b1['type'][_0x8041('0x2f')]};});_0x27dc5[_0x8041('0x30')]=_[_0x8041('0x31')](_0x49648b,'name');_0x27dc5[_0x8041('0x32')]=_[_0x8041('0x33')](_0x343051[_0x8041('0x32')]);_0x27dc5['filters']=_['intersection'](_0x27dc5[_0x8041('0x30')],_0x27dc5[_0x8041('0x32')]);_0x461e02[_0x8041('0x34')]=_[_0x8041('0x35')](_0x27dc5[_0x8041('0x30')],qs['fields'](_0x343051[_0x8041('0x32')][_0x8041('0x36')]));_0x461e02['attributes']=_0x461e02['attributes'][_0x8041('0x37')]?_0x461e02[_0x8041('0x34')]:_0x27dc5[_0x8041('0x30')];if(!_0x343051[_0x8041('0x32')][_0x8041('0x38')](_0x8041('0x39'))){_0x461e02[_0x8041('0x1f')]=qs[_0x8041('0x1f')](_0x343051[_0x8041('0x32')][_0x8041('0x1f')]);_0x461e02[_0x8041('0x1e')]=qs['offset'](_0x343051[_0x8041('0x32')][_0x8041('0x1e')]);}_0x461e02[_0x8041('0x3a')]=qs[_0x8041('0x3b')](_0x343051[_0x8041('0x32')]['sort']);_0x461e02[_0x8041('0x3c')]=qs[_0x8041('0x3d')](_[_0x8041('0x3e')](_0x343051['query'],_0x27dc5[_0x8041('0x3d')]),_0x49648b);if(_0x343051[_0x8041('0x32')][_0x8041('0x3f')]){_0x461e02['where']=_[_0x8041('0x40')](_0x461e02['where'],{'$or':_[_0x8041('0x31')](_0x49648b,function(_0x5ce51c){if(_0x5ce51c[_0x8041('0x41')]!==_0x8041('0x42')){var _0x4c32d4={};_0x4c32d4[_0x5ce51c[_0x8041('0x2b')]]={'$like':'%'+_0x343051[_0x8041('0x32')]['filter']+'%'};return _0x4c32d4;}})});}_0x461e02=_[_0x8041('0x40')]({},_0x461e02,_0x343051[_0x8041('0x43')]);var _0x515763={'where':_0x461e02['where']};return db['ZendeskConfiguration'][_0x8041('0x44')](_0x515763)['then'](function(_0x410653){_0x470b2d[_0x8041('0x44')]=_0x410653;if(_0x343051[_0x8041('0x32')][_0x8041('0x45')]){_0x461e02[_0x8041('0x46')]=[{'all':!![]}];}return db[_0x8041('0x2e')]['findAll'](_0x461e02);})[_0x8041('0x26')](function(_0x5aad29){_0x470b2d['rows']=_0x5aad29;return _0x470b2d;})[_0x8041('0x26')](respondWithFilteredResult(_0x5d8418,_0x461e02))[_0x8041('0x47')](handleError(_0x5d8418,null));};exports[_0x8041('0x48')]=function(_0x48a47e,_0x17f531){var _0x25b1f4={'raw':![],'where':{'id':_0x48a47e[_0x8041('0x49')]['id']}},_0x52abb2={};_0x52abb2['model']=_[_0x8041('0x33')](db[_0x8041('0x2e')][_0x8041('0x4a')]);_0x52abb2[_0x8041('0x32')]=_[_0x8041('0x33')](_0x48a47e[_0x8041('0x32')]);_0x52abb2[_0x8041('0x3d')]=_[_0x8041('0x35')](_0x52abb2['model'],_0x52abb2[_0x8041('0x32')]);_0x25b1f4[_0x8041('0x34')]=_['intersection'](_0x52abb2[_0x8041('0x30')],qs[_0x8041('0x36')](_0x48a47e[_0x8041('0x32')][_0x8041('0x36')]));_0x25b1f4[_0x8041('0x34')]=_0x25b1f4[_0x8041('0x34')][_0x8041('0x37')]?_0x25b1f4['attributes']:_0x52abb2[_0x8041('0x30')];if(_0x48a47e[_0x8041('0x32')]['includeAll']){_0x25b1f4[_0x8041('0x46')]=[{'all':!![]}];}_0x25b1f4=_[_0x8041('0x40')]({},_0x25b1f4,_0x48a47e[_0x8041('0x43')]);return db[_0x8041('0x2e')][_0x8041('0x4b')](_0x25b1f4)[_0x8041('0x26')](handleEntityNotFound(_0x17f531,null))['then'](respondWithResult(_0x17f531,null))[_0x8041('0x47')](handleError(_0x17f531,null));};exports[_0x8041('0x4c')]=function(_0x4679cc,_0x1ac6d7){return db[_0x8041('0x2e')][_0x8041('0x4c')](_0x4679cc['body'],{})[_0x8041('0x26')](respondWithResult(_0x1ac6d7,0xc9))[_0x8041('0x47')](handleError(_0x1ac6d7,null));};exports[_0x8041('0x25')]=function(_0x1726cb,_0x6e8587){if(_0x1726cb[_0x8041('0x4d')]['id']){delete _0x1726cb[_0x8041('0x4d')]['id'];}return db[_0x8041('0x2e')][_0x8041('0x4b')]({'where':{'id':_0x1726cb[_0x8041('0x49')]['id']}})[_0x8041('0x26')](handleEntityNotFound(_0x6e8587,null))[_0x8041('0x26')](saveUpdates(_0x1726cb[_0x8041('0x4d')],null))['then'](respondWithResult(_0x6e8587,null))[_0x8041('0x47')](handleError(_0x6e8587,null));};exports[_0x8041('0x27')]=function(_0x42863d,_0x2714ed){return db[_0x8041('0x2e')][_0x8041('0x4b')]({'where':{'id':_0x42863d[_0x8041('0x49')]['id']}})[_0x8041('0x26')](handleEntityNotFound(_0x2714ed,null))[_0x8041('0x26')](removeEntity(_0x2714ed,null))[_0x8041('0x47')](handleError(_0x2714ed,null));};exports[_0x8041('0x4e')]=function(_0x33114f,_0x1db9fc,_0x48c9d2){var _0x163900={};var _0x34c248={};var _0x3dbf21;var _0x471e46;return db[_0x8041('0x2e')][_0x8041('0x4f')]({'where':{'id':_0x33114f['params']['id']}})[_0x8041('0x26')](handleEntityNotFound(_0x1db9fc,null))[_0x8041('0x26')](function(_0x45753f){if(_0x45753f){_0x3dbf21=_0x45753f;_0x34c248[_0x8041('0x30')]=_['keys'](db[_0x8041('0x50')][_0x8041('0x4a')]);_0x34c248['query']=_[_0x8041('0x33')](_0x33114f[_0x8041('0x32')]);_0x34c248[_0x8041('0x3d')]=_[_0x8041('0x35')](_0x34c248[_0x8041('0x30')],_0x34c248[_0x8041('0x32')]);_0x163900[_0x8041('0x34')]=_[_0x8041('0x35')](_0x34c248[_0x8041('0x30')],qs[_0x8041('0x36')](_0x33114f['query'][_0x8041('0x36')]));_0x163900['attributes']=_0x163900[_0x8041('0x34')][_0x8041('0x37')]?_0x163900[_0x8041('0x34')]:_0x34c248[_0x8041('0x30')];_0x163900[_0x8041('0x3a')]=qs[_0x8041('0x3b')](_0x33114f[_0x8041('0x32')][_0x8041('0x3b')]);_0x163900[_0x8041('0x3c')]=qs[_0x8041('0x3d')](_['pick'](_0x33114f[_0x8041('0x32')],_0x34c248['filters']));if(_0x33114f[_0x8041('0x32')][_0x8041('0x3f')]){_0x163900[_0x8041('0x3c')]=_[_0x8041('0x40')](_0x163900[_0x8041('0x3c')],{'$or':_[_0x8041('0x31')](_0x163900[_0x8041('0x34')],function(_0x2dc662){var _0x227b41={};_0x227b41[_0x2dc662]={'$like':'%'+_0x33114f[_0x8041('0x32')][_0x8041('0x3f')]+'%'};return _0x227b41;})});}_0x163900=_['merge']({},_0x163900,_0x33114f[_0x8041('0x43')]);return _0x3dbf21['getFields'](_0x163900);}})['then'](function(_0x4e4cca){if(_0x4e4cca){_0x471e46=_0x4e4cca['length'];if(!_0x33114f['query'][_0x8041('0x38')]('nolimit')){_0x163900[_0x8041('0x1f')]=qs[_0x8041('0x1f')](_0x33114f[_0x8041('0x32')][_0x8041('0x1f')]);_0x163900[_0x8041('0x1e')]=qs[_0x8041('0x1e')](_0x33114f[_0x8041('0x32')][_0x8041('0x1e')]);}return _0x3dbf21[_0x8041('0x4e')](_0x163900);}})['then'](function(_0x55217c){if(_0x55217c){return _0x55217c?{'count':_0x471e46,'rows':_0x55217c}:null;}})['then'](respondWithResult(_0x1db9fc,null))[_0x8041('0x47')](handleError(_0x1db9fc,null));};exports['getSubjects']=function(_0x393b18,_0x4acafb,_0x1ce454){var _0x544ceb={};var _0x119513={};var _0x3c25c2;var _0x46de59;return db[_0x8041('0x2e')][_0x8041('0x4f')]({'where':{'id':_0x393b18[_0x8041('0x49')]['id']}})[_0x8041('0x26')](handleEntityNotFound(_0x4acafb,null))[_0x8041('0x26')](function(_0x36e145){if(_0x36e145){_0x3c25c2=_0x36e145;_0x119513[_0x8041('0x30')]=_[_0x8041('0x33')](db[_0x8041('0x50')][_0x8041('0x4a')]);_0x119513[_0x8041('0x32')]=_[_0x8041('0x33')](_0x393b18[_0x8041('0x32')]);_0x119513[_0x8041('0x3d')]=_[_0x8041('0x35')](_0x119513[_0x8041('0x30')],_0x119513[_0x8041('0x32')]);_0x544ceb[_0x8041('0x34')]=_[_0x8041('0x35')](_0x119513[_0x8041('0x30')],qs['fields'](_0x393b18['query'][_0x8041('0x36')]));_0x544ceb[_0x8041('0x34')]=_0x544ceb[_0x8041('0x34')][_0x8041('0x37')]?_0x544ceb[_0x8041('0x34')]:_0x119513[_0x8041('0x30')];_0x544ceb[_0x8041('0x3a')]=qs[_0x8041('0x3b')](_0x393b18[_0x8041('0x32')][_0x8041('0x3b')]);_0x544ceb[_0x8041('0x3c')]=qs['filters'](_[_0x8041('0x3e')](_0x393b18[_0x8041('0x32')],_0x119513['filters']));if(_0x393b18[_0x8041('0x32')][_0x8041('0x3f')]){_0x544ceb[_0x8041('0x3c')]=_[_0x8041('0x40')](_0x544ceb['where'],{'$or':_[_0x8041('0x31')](_0x544ceb['attributes'],function(_0x31e2b3){var _0x3709e2={};_0x3709e2[_0x31e2b3]={'$like':'%'+_0x393b18['query'][_0x8041('0x3f')]+'%'};return _0x3709e2;})});}_0x544ceb=_[_0x8041('0x40')]({},_0x544ceb,_0x393b18[_0x8041('0x43')]);return _0x3c25c2[_0x8041('0x51')](_0x544ceb);}})['then'](function(_0x2512fd){if(_0x2512fd){_0x46de59=_0x2512fd['length'];if(!_0x393b18['query'][_0x8041('0x38')](_0x8041('0x39'))){_0x544ceb[_0x8041('0x1f')]=qs[_0x8041('0x1f')](_0x393b18[_0x8041('0x32')][_0x8041('0x1f')]);_0x544ceb[_0x8041('0x1e')]=qs[_0x8041('0x1e')](_0x393b18[_0x8041('0x32')][_0x8041('0x1e')]);}return _0x3c25c2[_0x8041('0x51')](_0x544ceb);}})[_0x8041('0x26')](function(_0x416d2d){if(_0x416d2d){return _0x416d2d?{'count':_0x46de59,'rows':_0x416d2d}:null;}})[_0x8041('0x26')](respondWithResult(_0x4acafb,null))[_0x8041('0x47')](handleError(_0x4acafb,null));};exports[_0x8041('0x52')]=function(_0x57f427,_0x5d3ea9,_0x5b8e8b){var _0x351981={};var _0x4c6dee={};var _0x31e54d;var _0x5b3917;return db[_0x8041('0x2e')][_0x8041('0x4f')]({'where':{'id':_0x57f427['params']['id']}})[_0x8041('0x26')](handleEntityNotFound(_0x5d3ea9,null))[_0x8041('0x26')](function(_0x5af738){if(_0x5af738){_0x31e54d=_0x5af738;_0x4c6dee[_0x8041('0x30')]=_[_0x8041('0x33')](db[_0x8041('0x50')][_0x8041('0x4a')]);_0x4c6dee[_0x8041('0x32')]=_[_0x8041('0x33')](_0x57f427[_0x8041('0x32')]);_0x4c6dee[_0x8041('0x3d')]=_[_0x8041('0x35')](_0x4c6dee['model'],_0x4c6dee[_0x8041('0x32')]);_0x351981[_0x8041('0x34')]=_[_0x8041('0x35')](_0x4c6dee[_0x8041('0x30')],qs[_0x8041('0x36')](_0x57f427[_0x8041('0x32')][_0x8041('0x36')]));_0x351981[_0x8041('0x34')]=_0x351981[_0x8041('0x34')]['length']?_0x351981[_0x8041('0x34')]:_0x4c6dee[_0x8041('0x30')];_0x351981[_0x8041('0x3a')]=qs[_0x8041('0x3b')](_0x57f427[_0x8041('0x32')][_0x8041('0x3b')]);_0x351981['where']=qs[_0x8041('0x3d')](_[_0x8041('0x3e')](_0x57f427['query'],_0x4c6dee['filters']));if(_0x57f427[_0x8041('0x32')][_0x8041('0x3f')]){_0x351981[_0x8041('0x3c')]=_[_0x8041('0x40')](_0x351981['where'],{'$or':_[_0x8041('0x31')](_0x351981[_0x8041('0x34')],function(_0x4b9bb4){var _0x3b1ef7={};_0x3b1ef7[_0x4b9bb4]={'$like':'%'+_0x57f427[_0x8041('0x32')][_0x8041('0x3f')]+'%'};return _0x3b1ef7;})});}_0x351981=_['merge']({},_0x351981,_0x57f427[_0x8041('0x43')]);return _0x31e54d['getDescriptions'](_0x351981);}})[_0x8041('0x26')](function(_0x21063b){if(_0x21063b){_0x5b3917=_0x21063b[_0x8041('0x37')];if(!_0x57f427[_0x8041('0x32')]['hasOwnProperty'](_0x8041('0x39'))){_0x351981[_0x8041('0x1f')]=qs[_0x8041('0x1f')](_0x57f427[_0x8041('0x32')][_0x8041('0x1f')]);_0x351981[_0x8041('0x1e')]=qs[_0x8041('0x1e')](_0x57f427['query'][_0x8041('0x1e')]);}return _0x31e54d[_0x8041('0x52')](_0x351981);}})['then'](function(_0x5bac1b){if(_0x5bac1b){return _0x5bac1b?{'count':_0x5b3917,'rows':_0x5bac1b}:null;}})[_0x8041('0x26')](respondWithResult(_0x5d3ea9,null))[_0x8041('0x47')](handleError(_0x5d3ea9,null));};exports[_0x8041('0x53')]=function(_0x1f8f6f,_0x4df145,_0x5384fe){var _0x464db3={};var _0x41501d={};var _0x1c0c70;var _0x3077f5;return db[_0x8041('0x2e')][_0x8041('0x4f')]({'where':{'id':_0x1f8f6f[_0x8041('0x49')]['id']}})['then'](handleEntityNotFound(_0x4df145,null))['then'](function(_0xa8cbe6){if(_0xa8cbe6){_0x1c0c70=_0xa8cbe6;_0x41501d[_0x8041('0x30')]=_[_0x8041('0x33')](db[_0x8041('0x54')]['rawAttributes']);_0x41501d[_0x8041('0x32')]=_[_0x8041('0x33')](_0x1f8f6f[_0x8041('0x32')]);_0x41501d[_0x8041('0x3d')]=_[_0x8041('0x35')](_0x41501d['model'],_0x41501d[_0x8041('0x32')]);_0x464db3[_0x8041('0x34')]=_[_0x8041('0x35')](_0x41501d['model'],qs[_0x8041('0x36')](_0x1f8f6f[_0x8041('0x32')][_0x8041('0x36')]));_0x464db3['attributes']=_0x464db3[_0x8041('0x34')][_0x8041('0x37')]?_0x464db3[_0x8041('0x34')]:_0x41501d[_0x8041('0x30')];_0x464db3['order']=qs[_0x8041('0x3b')](_0x1f8f6f['query']['sort']);_0x464db3['where']=qs['filters'](_['pick'](_0x1f8f6f[_0x8041('0x32')],_0x41501d[_0x8041('0x3d')]));if(_0x1f8f6f['query'][_0x8041('0x3f')]){_0x464db3[_0x8041('0x3c')]=_[_0x8041('0x40')](_0x464db3[_0x8041('0x3c')],{'$or':_['map'](_0x464db3[_0x8041('0x34')],function(_0x24fc4f){var _0x273896={};_0x273896[_0x24fc4f]={'$like':'%'+_0x1f8f6f[_0x8041('0x32')][_0x8041('0x3f')]+'%'};return _0x273896;})});}_0x464db3=_[_0x8041('0x40')]({},_0x464db3,_0x1f8f6f['options']);return _0x1c0c70[_0x8041('0x53')](_0x464db3);}})['then'](function(_0x75a023){if(_0x75a023){_0x3077f5=_0x75a023[_0x8041('0x37')];if(!_0x1f8f6f[_0x8041('0x32')]['hasOwnProperty'](_0x8041('0x39'))){_0x464db3[_0x8041('0x1f')]=qs[_0x8041('0x1f')](_0x1f8f6f[_0x8041('0x32')][_0x8041('0x1f')]);_0x464db3[_0x8041('0x1e')]=qs[_0x8041('0x1e')](_0x1f8f6f[_0x8041('0x32')]['offset']);}return _0x1c0c70[_0x8041('0x53')](_0x464db3);}})[_0x8041('0x26')](function(_0x16aec9){if(_0x16aec9){return _0x16aec9?{'count':_0x3077f5,'rows':_0x16aec9}:null;}})[_0x8041('0x26')](respondWithResult(_0x4df145,null))[_0x8041('0x47')](handleError(_0x4df145,null));};exports[_0x8041('0x55')]=function(_0x583511,_0x502f14,_0x21e4d8){if(_0x583511[_0x8041('0x4d')]['id']){delete _0x583511['body']['id'];}return db[_0x8041('0x2e')][_0x8041('0x4f')]({'where':{'id':_0x583511[_0x8041('0x49')]['id']}})['then'](handleEntityNotFound(_0x502f14,null))['then'](function(_0x4dd6e6){if(_0x4dd6e6){return _0x4dd6e6['setTags'](_0x583511[_0x8041('0x4d')][_0x8041('0x56')]||[]);}return null;})[_0x8041('0x26')](respondWithResult(_0x502f14,null))[_0x8041('0x47')](handleError(_0x502f14,null));}; \ No newline at end of file +var _0xdbcf=['order','sort','where','filters','pick','filter','merge','ZendeskConfiguration','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xdbcf,0x72));var _0xfdbc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdbcf[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xfdbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdbc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdbc('0x2'));var moment=require(_0xfdbc('0x3'));var BPromise=require(_0xfdbc('0x4'));var Mustache=require(_0xfdbc('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfdbc('0x6'));var csv=require(_0xfdbc('0x7'));var ejs=require(_0xfdbc('0x8'));var fs=require('fs');var fs_extra=require(_0xfdbc('0x9'));var _=require(_0xfdbc('0xa'));var squel=require(_0xfdbc('0xb'));var crypto=require('crypto');var jsforce=require(_0xfdbc('0xc'));var deskjs=require(_0xfdbc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfdbc('0xe'));var Papa=require(_0xfdbc('0xf'));var Redis=require(_0xfdbc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfdbc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdbc('0x12'));var logger=require(_0xfdbc('0x13'))(_0xfdbc('0x14'));var utils=require(_0xfdbc('0x15'));var config=require(_0xfdbc('0x16'));var licenseUtil=require(_0xfdbc('0x17'));var db=require(_0xfdbc('0x18'))['db'];function respondWithStatusCode(_0x541d53,_0x413d53){_0x413d53=_0x413d53||0xcc;return function(_0x5af8cd){if(_0x5af8cd){return _0x541d53[_0xfdbc('0x19')](_0x413d53);}return _0x541d53[_0xfdbc('0x1a')](_0x413d53)['end']();};}function respondWithResult(_0x20f2c1,_0x35cf6b){_0x35cf6b=_0x35cf6b||0xc8;return function(_0x3a1f40){if(_0x3a1f40){return _0x20f2c1[_0xfdbc('0x1a')](_0x35cf6b)[_0xfdbc('0x1b')](_0x3a1f40);}};}function respondWithFilteredResult(_0x2dca17,_0x4b4fa5){return function(_0x2520c1){if(_0x2520c1){var _0x40d768=typeof _0x4b4fa5[_0xfdbc('0x1c')]===_0xfdbc('0x1d')&&typeof _0x4b4fa5[_0xfdbc('0x1e')]==='undefined';var _0x5a7031=_0x2520c1[_0xfdbc('0x1f')];var _0x407105=_0x40d768?0x0:_0x4b4fa5['offset'];var _0x7568fc=_0x40d768?_0x2520c1[_0xfdbc('0x1f')]:_0x4b4fa5[_0xfdbc('0x1c')]+_0x4b4fa5['limit'];var _0x459d0a;if(_0x7568fc>=_0x5a7031){_0x7568fc=_0x5a7031;_0x459d0a=0xc8;}else{_0x459d0a=0xce;}_0x2dca17[_0xfdbc('0x1a')](_0x459d0a);return _0x2dca17['set'](_0xfdbc('0x20'),_0x407105+'-'+_0x7568fc+'/'+_0x5a7031)['json'](_0x2520c1);}return null;};}function patchUpdates(_0x5636c1){return function(_0xd13e96){try{jsonpatch[_0xfdbc('0x21')](_0xd13e96,_0x5636c1,!![]);}catch(_0x1a2ee){return BPromise[_0xfdbc('0x22')](_0x1a2ee);}return _0xd13e96[_0xfdbc('0x23')]();};}function saveUpdates(_0xc09d9b,_0x1f1a6e){return function(_0x47a751){if(_0x47a751){return _0x47a751[_0xfdbc('0x24')](_0xc09d9b)[_0xfdbc('0x25')](function(_0x3976e9){return _0x3976e9;});}return null;};}function removeEntity(_0x1229bf,_0x1eaf99){return function(_0x2f02c1){if(_0x2f02c1){return _0x2f02c1[_0xfdbc('0x26')]()[_0xfdbc('0x25')](function(){_0x1229bf['status'](0xcc)[_0xfdbc('0x27')]();});}};}function handleEntityNotFound(_0x23fc45,_0x3acaeb){return function(_0x205530){if(!_0x205530){_0x23fc45[_0xfdbc('0x19')](0x194);}return _0x205530;};}function handleError(_0x3dd936,_0x50272b){_0x50272b=_0x50272b||0x1f4;return function(_0x4b1b84){logger[_0xfdbc('0x28')](_0x4b1b84[_0xfdbc('0x29')]);if(_0x4b1b84[_0xfdbc('0x2a')]){delete _0x4b1b84[_0xfdbc('0x2a')];}_0x3dd936['status'](_0x50272b)[_0xfdbc('0x2b')](_0x4b1b84);};}exports[_0xfdbc('0x2c')]=function(_0xd3ad5b,_0xcfe458){var _0x90543={},_0x3cd677={},_0x4db8a9={'count':0x0,'rows':[]};var _0x59c6dc=_[_0xfdbc('0x2d')](db['ZendeskConfiguration'][_0xfdbc('0x2e')],function(_0x542543){return{'name':_0x542543['fieldName'],'type':_0x542543[_0xfdbc('0x2f')]['key']};});_0x3cd677[_0xfdbc('0x30')]=_[_0xfdbc('0x2d')](_0x59c6dc,_0xfdbc('0x2a'));_0x3cd677[_0xfdbc('0x31')]=_[_0xfdbc('0x32')](_0xd3ad5b[_0xfdbc('0x31')]);_0x3cd677['filters']=_[_0xfdbc('0x33')](_0x3cd677[_0xfdbc('0x30')],_0x3cd677['query']);_0x90543[_0xfdbc('0x34')]=_[_0xfdbc('0x33')](_0x3cd677[_0xfdbc('0x30')],qs['fields'](_0xd3ad5b[_0xfdbc('0x31')][_0xfdbc('0x35')]));_0x90543[_0xfdbc('0x34')]=_0x90543[_0xfdbc('0x34')]['length']?_0x90543['attributes']:_0x3cd677[_0xfdbc('0x30')];if(!_0xd3ad5b[_0xfdbc('0x31')][_0xfdbc('0x36')](_0xfdbc('0x37'))){_0x90543[_0xfdbc('0x1e')]=qs[_0xfdbc('0x1e')](_0xd3ad5b[_0xfdbc('0x31')][_0xfdbc('0x1e')]);_0x90543['offset']=qs['offset'](_0xd3ad5b[_0xfdbc('0x31')]['offset']);}_0x90543[_0xfdbc('0x38')]=qs[_0xfdbc('0x39')](_0xd3ad5b['query'][_0xfdbc('0x39')]);_0x90543[_0xfdbc('0x3a')]=qs[_0xfdbc('0x3b')](_[_0xfdbc('0x3c')](_0xd3ad5b['query'],_0x3cd677[_0xfdbc('0x3b')]),_0x59c6dc);if(_0xd3ad5b[_0xfdbc('0x31')][_0xfdbc('0x3d')]){_0x90543['where']=_[_0xfdbc('0x3e')](_0x90543[_0xfdbc('0x3a')],{'$or':_[_0xfdbc('0x2d')](_0x59c6dc,function(_0x57684a){if(_0x57684a[_0xfdbc('0x2f')]!=='VIRTUAL'){var _0x55fc7a={};_0x55fc7a[_0x57684a[_0xfdbc('0x2a')]]={'$like':'%'+_0xd3ad5b[_0xfdbc('0x31')]['filter']+'%'};return _0x55fc7a;}})});}_0x90543=_[_0xfdbc('0x3e')]({},_0x90543,_0xd3ad5b['options']);var _0x5db311={'where':_0x90543[_0xfdbc('0x3a')]};return db[_0xfdbc('0x3f')][_0xfdbc('0x1f')](_0x5db311)[_0xfdbc('0x25')](function(_0x5d4cb5){_0x4db8a9[_0xfdbc('0x1f')]=_0x5d4cb5;if(_0xd3ad5b['query'][_0xfdbc('0x40')]){_0x90543['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xfdbc('0x41')](_0x90543);})[_0xfdbc('0x25')](function(_0x5d2761){_0x4db8a9[_0xfdbc('0x42')]=_0x5d2761;return _0x4db8a9;})['then'](respondWithFilteredResult(_0xcfe458,_0x90543))[_0xfdbc('0x43')](handleError(_0xcfe458,null));};exports[_0xfdbc('0x44')]=function(_0x550a62,_0x20ca68){var _0x85e870={'raw':![],'where':{'id':_0x550a62[_0xfdbc('0x45')]['id']}},_0x789891={};_0x789891[_0xfdbc('0x30')]=_[_0xfdbc('0x32')](db[_0xfdbc('0x3f')]['rawAttributes']);_0x789891[_0xfdbc('0x31')]=_[_0xfdbc('0x32')](_0x550a62[_0xfdbc('0x31')]);_0x789891[_0xfdbc('0x3b')]=_[_0xfdbc('0x33')](_0x789891[_0xfdbc('0x30')],_0x789891['query']);_0x85e870[_0xfdbc('0x34')]=_[_0xfdbc('0x33')](_0x789891[_0xfdbc('0x30')],qs[_0xfdbc('0x35')](_0x550a62[_0xfdbc('0x31')][_0xfdbc('0x35')]));_0x85e870[_0xfdbc('0x34')]=_0x85e870[_0xfdbc('0x34')][_0xfdbc('0x46')]?_0x85e870[_0xfdbc('0x34')]:_0x789891[_0xfdbc('0x30')];if(_0x550a62[_0xfdbc('0x31')][_0xfdbc('0x40')]){_0x85e870[_0xfdbc('0x47')]=[{'all':!![]}];}_0x85e870=_['merge']({},_0x85e870,_0x550a62[_0xfdbc('0x48')]);return db[_0xfdbc('0x3f')][_0xfdbc('0x49')](_0x85e870)['then'](handleEntityNotFound(_0x20ca68,null))[_0xfdbc('0x25')](respondWithResult(_0x20ca68,null))[_0xfdbc('0x43')](handleError(_0x20ca68,null));};exports[_0xfdbc('0x4a')]=function(_0x1b4cd3,_0x332255){return db[_0xfdbc('0x3f')]['create'](_0x1b4cd3['body'],{})[_0xfdbc('0x25')](respondWithResult(_0x332255,0xc9))[_0xfdbc('0x43')](handleError(_0x332255,null));};exports[_0xfdbc('0x24')]=function(_0x5dbed0,_0x448efd){if(_0x5dbed0['body']['id']){delete _0x5dbed0[_0xfdbc('0x4b')]['id'];}return db['ZendeskConfiguration'][_0xfdbc('0x49')]({'where':{'id':_0x5dbed0['params']['id']}})['then'](handleEntityNotFound(_0x448efd,null))[_0xfdbc('0x25')](saveUpdates(_0x5dbed0[_0xfdbc('0x4b')],null))[_0xfdbc('0x25')](respondWithResult(_0x448efd,null))[_0xfdbc('0x43')](handleError(_0x448efd,null));};exports['destroy']=function(_0x16a462,_0x3d378e){return db[_0xfdbc('0x3f')][_0xfdbc('0x49')]({'where':{'id':_0x16a462[_0xfdbc('0x45')]['id']}})[_0xfdbc('0x25')](handleEntityNotFound(_0x3d378e,null))[_0xfdbc('0x25')](removeEntity(_0x3d378e,null))[_0xfdbc('0x43')](handleError(_0x3d378e,null));};exports[_0xfdbc('0x4c')]=function(_0x6973c4,_0x450894,_0x41a0c9){var _0x13b03c={};var _0x22f4bb={};var _0xf474db;var _0x1b648f;return db['ZendeskConfiguration'][_0xfdbc('0x4d')]({'where':{'id':_0x6973c4['params']['id']}})[_0xfdbc('0x25')](handleEntityNotFound(_0x450894,null))[_0xfdbc('0x25')](function(_0x4a1284){if(_0x4a1284){_0xf474db=_0x4a1284;_0x22f4bb[_0xfdbc('0x30')]=_[_0xfdbc('0x32')](db[_0xfdbc('0x4e')]['rawAttributes']);_0x22f4bb['query']=_['keys'](_0x6973c4[_0xfdbc('0x31')]);_0x22f4bb['filters']=_[_0xfdbc('0x33')](_0x22f4bb['model'],_0x22f4bb[_0xfdbc('0x31')]);_0x13b03c[_0xfdbc('0x34')]=_[_0xfdbc('0x33')](_0x22f4bb[_0xfdbc('0x30')],qs[_0xfdbc('0x35')](_0x6973c4['query'][_0xfdbc('0x35')]));_0x13b03c[_0xfdbc('0x34')]=_0x13b03c[_0xfdbc('0x34')][_0xfdbc('0x46')]?_0x13b03c['attributes']:_0x22f4bb[_0xfdbc('0x30')];_0x13b03c['order']=qs[_0xfdbc('0x39')](_0x6973c4[_0xfdbc('0x31')][_0xfdbc('0x39')]);_0x13b03c[_0xfdbc('0x3a')]=qs[_0xfdbc('0x3b')](_['pick'](_0x6973c4[_0xfdbc('0x31')],_0x22f4bb[_0xfdbc('0x3b')]));if(_0x6973c4[_0xfdbc('0x31')][_0xfdbc('0x3d')]){_0x13b03c[_0xfdbc('0x3a')]=_[_0xfdbc('0x3e')](_0x13b03c[_0xfdbc('0x3a')],{'$or':_['map'](_0x13b03c[_0xfdbc('0x34')],function(_0x31d7db){var _0x5a36e9={};_0x5a36e9[_0x31d7db]={'$like':'%'+_0x6973c4[_0xfdbc('0x31')][_0xfdbc('0x3d')]+'%'};return _0x5a36e9;})});}_0x13b03c=_['merge']({},_0x13b03c,_0x6973c4[_0xfdbc('0x48')]);return _0xf474db[_0xfdbc('0x4c')](_0x13b03c);}})[_0xfdbc('0x25')](function(_0x241169){if(_0x241169){_0x1b648f=_0x241169[_0xfdbc('0x46')];if(!_0x6973c4['query']['hasOwnProperty']('nolimit')){_0x13b03c[_0xfdbc('0x1e')]=qs[_0xfdbc('0x1e')](_0x6973c4['query']['limit']);_0x13b03c[_0xfdbc('0x1c')]=qs['offset'](_0x6973c4[_0xfdbc('0x31')][_0xfdbc('0x1c')]);}return _0xf474db[_0xfdbc('0x4c')](_0x13b03c);}})[_0xfdbc('0x25')](function(_0x174604){if(_0x174604){return _0x174604?{'count':_0x1b648f,'rows':_0x174604}:null;}})['then'](respondWithResult(_0x450894,null))[_0xfdbc('0x43')](handleError(_0x450894,null));};exports['getSubjects']=function(_0x1adcb5,_0x2c47fd,_0x2878fc){var _0xf90fee={};var _0x5689e4={};var _0x12509d;var _0x34b105;return db[_0xfdbc('0x3f')][_0xfdbc('0x4d')]({'where':{'id':_0x1adcb5[_0xfdbc('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c47fd,null))[_0xfdbc('0x25')](function(_0x392fa5){if(_0x392fa5){_0x12509d=_0x392fa5;_0x5689e4[_0xfdbc('0x30')]=_[_0xfdbc('0x32')](db[_0xfdbc('0x4e')][_0xfdbc('0x2e')]);_0x5689e4[_0xfdbc('0x31')]=_[_0xfdbc('0x32')](_0x1adcb5[_0xfdbc('0x31')]);_0x5689e4[_0xfdbc('0x3b')]=_[_0xfdbc('0x33')](_0x5689e4['model'],_0x5689e4[_0xfdbc('0x31')]);_0xf90fee[_0xfdbc('0x34')]=_[_0xfdbc('0x33')](_0x5689e4[_0xfdbc('0x30')],qs[_0xfdbc('0x35')](_0x1adcb5['query']['fields']));_0xf90fee[_0xfdbc('0x34')]=_0xf90fee[_0xfdbc('0x34')][_0xfdbc('0x46')]?_0xf90fee[_0xfdbc('0x34')]:_0x5689e4[_0xfdbc('0x30')];_0xf90fee['order']=qs[_0xfdbc('0x39')](_0x1adcb5[_0xfdbc('0x31')][_0xfdbc('0x39')]);_0xf90fee[_0xfdbc('0x3a')]=qs['filters'](_[_0xfdbc('0x3c')](_0x1adcb5['query'],_0x5689e4['filters']));if(_0x1adcb5['query'][_0xfdbc('0x3d')]){_0xf90fee[_0xfdbc('0x3a')]=_['merge'](_0xf90fee['where'],{'$or':_[_0xfdbc('0x2d')](_0xf90fee[_0xfdbc('0x34')],function(_0x41a8b8){var _0x3f6271={};_0x3f6271[_0x41a8b8]={'$like':'%'+_0x1adcb5['query'][_0xfdbc('0x3d')]+'%'};return _0x3f6271;})});}_0xf90fee=_[_0xfdbc('0x3e')]({},_0xf90fee,_0x1adcb5[_0xfdbc('0x48')]);return _0x12509d[_0xfdbc('0x4f')](_0xf90fee);}})['then'](function(_0x26e6ff){if(_0x26e6ff){_0x34b105=_0x26e6ff[_0xfdbc('0x46')];if(!_0x1adcb5[_0xfdbc('0x31')][_0xfdbc('0x36')](_0xfdbc('0x37'))){_0xf90fee[_0xfdbc('0x1e')]=qs[_0xfdbc('0x1e')](_0x1adcb5[_0xfdbc('0x31')][_0xfdbc('0x1e')]);_0xf90fee['offset']=qs[_0xfdbc('0x1c')](_0x1adcb5['query'][_0xfdbc('0x1c')]);}return _0x12509d['getSubjects'](_0xf90fee);}})[_0xfdbc('0x25')](function(_0x5ced85){if(_0x5ced85){return _0x5ced85?{'count':_0x34b105,'rows':_0x5ced85}:null;}})[_0xfdbc('0x25')](respondWithResult(_0x2c47fd,null))[_0xfdbc('0x43')](handleError(_0x2c47fd,null));};exports[_0xfdbc('0x50')]=function(_0x400be0,_0x409b26,_0x4021cd){var _0xecbc45={};var _0x4cfeb5={};var _0x473bc4;var _0x1a1465;return db[_0xfdbc('0x3f')]['findOne']({'where':{'id':_0x400be0[_0xfdbc('0x45')]['id']}})['then'](handleEntityNotFound(_0x409b26,null))['then'](function(_0x1ea429){if(_0x1ea429){_0x473bc4=_0x1ea429;_0x4cfeb5['model']=_[_0xfdbc('0x32')](db['ZendeskField']['rawAttributes']);_0x4cfeb5[_0xfdbc('0x31')]=_[_0xfdbc('0x32')](_0x400be0['query']);_0x4cfeb5['filters']=_['intersection'](_0x4cfeb5[_0xfdbc('0x30')],_0x4cfeb5[_0xfdbc('0x31')]);_0xecbc45['attributes']=_['intersection'](_0x4cfeb5[_0xfdbc('0x30')],qs[_0xfdbc('0x35')](_0x400be0[_0xfdbc('0x31')][_0xfdbc('0x35')]));_0xecbc45[_0xfdbc('0x34')]=_0xecbc45[_0xfdbc('0x34')][_0xfdbc('0x46')]?_0xecbc45[_0xfdbc('0x34')]:_0x4cfeb5[_0xfdbc('0x30')];_0xecbc45[_0xfdbc('0x38')]=qs[_0xfdbc('0x39')](_0x400be0[_0xfdbc('0x31')][_0xfdbc('0x39')]);_0xecbc45[_0xfdbc('0x3a')]=qs[_0xfdbc('0x3b')](_[_0xfdbc('0x3c')](_0x400be0[_0xfdbc('0x31')],_0x4cfeb5[_0xfdbc('0x3b')]));if(_0x400be0[_0xfdbc('0x31')]['filter']){_0xecbc45[_0xfdbc('0x3a')]=_[_0xfdbc('0x3e')](_0xecbc45[_0xfdbc('0x3a')],{'$or':_['map'](_0xecbc45['attributes'],function(_0x2d7c2c){var _0x3db314={};_0x3db314[_0x2d7c2c]={'$like':'%'+_0x400be0[_0xfdbc('0x31')]['filter']+'%'};return _0x3db314;})});}_0xecbc45=_['merge']({},_0xecbc45,_0x400be0[_0xfdbc('0x48')]);return _0x473bc4['getDescriptions'](_0xecbc45);}})['then'](function(_0x3a98be){if(_0x3a98be){_0x1a1465=_0x3a98be[_0xfdbc('0x46')];if(!_0x400be0[_0xfdbc('0x31')][_0xfdbc('0x36')]('nolimit')){_0xecbc45[_0xfdbc('0x1e')]=qs[_0xfdbc('0x1e')](_0x400be0['query'][_0xfdbc('0x1e')]);_0xecbc45[_0xfdbc('0x1c')]=qs[_0xfdbc('0x1c')](_0x400be0[_0xfdbc('0x31')][_0xfdbc('0x1c')]);}return _0x473bc4['getDescriptions'](_0xecbc45);}})[_0xfdbc('0x25')](function(_0x40d2c1){if(_0x40d2c1){return _0x40d2c1?{'count':_0x1a1465,'rows':_0x40d2c1}:null;}})[_0xfdbc('0x25')](respondWithResult(_0x409b26,null))[_0xfdbc('0x43')](handleError(_0x409b26,null));};exports[_0xfdbc('0x51')]=function(_0x14be43,_0x1716b2,_0x4cf388){var _0x195c4e={};var _0x2bc914={};var _0x58ec9a;var _0xdf4d77;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x14be43['params']['id']}})[_0xfdbc('0x25')](handleEntityNotFound(_0x1716b2,null))[_0xfdbc('0x25')](function(_0x54ae16){if(_0x54ae16){_0x58ec9a=_0x54ae16;_0x2bc914[_0xfdbc('0x30')]=_[_0xfdbc('0x32')](db[_0xfdbc('0x52')][_0xfdbc('0x2e')]);_0x2bc914['query']=_[_0xfdbc('0x32')](_0x14be43['query']);_0x2bc914[_0xfdbc('0x3b')]=_[_0xfdbc('0x33')](_0x2bc914[_0xfdbc('0x30')],_0x2bc914[_0xfdbc('0x31')]);_0x195c4e['attributes']=_[_0xfdbc('0x33')](_0x2bc914[_0xfdbc('0x30')],qs['fields'](_0x14be43[_0xfdbc('0x31')][_0xfdbc('0x35')]));_0x195c4e['attributes']=_0x195c4e['attributes'][_0xfdbc('0x46')]?_0x195c4e[_0xfdbc('0x34')]:_0x2bc914[_0xfdbc('0x30')];_0x195c4e[_0xfdbc('0x38')]=qs[_0xfdbc('0x39')](_0x14be43[_0xfdbc('0x31')][_0xfdbc('0x39')]);_0x195c4e[_0xfdbc('0x3a')]=qs[_0xfdbc('0x3b')](_[_0xfdbc('0x3c')](_0x14be43[_0xfdbc('0x31')],_0x2bc914[_0xfdbc('0x3b')]));if(_0x14be43[_0xfdbc('0x31')][_0xfdbc('0x3d')]){_0x195c4e[_0xfdbc('0x3a')]=_['merge'](_0x195c4e[_0xfdbc('0x3a')],{'$or':_[_0xfdbc('0x2d')](_0x195c4e[_0xfdbc('0x34')],function(_0x56362b){var _0x2e24d0={};_0x2e24d0[_0x56362b]={'$like':'%'+_0x14be43[_0xfdbc('0x31')][_0xfdbc('0x3d')]+'%'};return _0x2e24d0;})});}_0x195c4e=_[_0xfdbc('0x3e')]({},_0x195c4e,_0x14be43[_0xfdbc('0x48')]);return _0x58ec9a['getTags'](_0x195c4e);}})[_0xfdbc('0x25')](function(_0x305829){if(_0x305829){_0xdf4d77=_0x305829['length'];if(!_0x14be43['query'][_0xfdbc('0x36')](_0xfdbc('0x37'))){_0x195c4e['limit']=qs['limit'](_0x14be43[_0xfdbc('0x31')][_0xfdbc('0x1e')]);_0x195c4e[_0xfdbc('0x1c')]=qs[_0xfdbc('0x1c')](_0x14be43[_0xfdbc('0x31')]['offset']);}return _0x58ec9a[_0xfdbc('0x51')](_0x195c4e);}})['then'](function(_0x385a44){if(_0x385a44){return _0x385a44?{'count':_0xdf4d77,'rows':_0x385a44}:null;}})['then'](respondWithResult(_0x1716b2,null))[_0xfdbc('0x43')](handleError(_0x1716b2,null));};exports['setTags']=function(_0x435809,_0x17f190,_0x55bd68){if(_0x435809[_0xfdbc('0x4b')]['id']){delete _0x435809[_0xfdbc('0x4b')]['id'];}return db[_0xfdbc('0x3f')][_0xfdbc('0x4d')]({'where':{'id':_0x435809[_0xfdbc('0x45')]['id']}})[_0xfdbc('0x25')](handleEntityNotFound(_0x17f190,null))[_0xfdbc('0x25')](function(_0x364dc8){if(_0x364dc8){return _0x364dc8[_0xfdbc('0x53')](_0x435809[_0xfdbc('0x4b')][_0xfdbc('0x54')]||[]);}return null;})[_0xfdbc('0x25')](respondWithResult(_0x17f190,null))[_0xfdbc('0x43')](handleError(_0x17f190,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 8af3b04..4629351 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 _0x6cb4=['bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x86a7ac,_0x2ff628){var _0x52aa8b=function(_0x39598b){while(--_0x39598b){_0x86a7ac['push'](_0x86a7ac['shift']());}};_0x52aa8b(++_0x2ff628);}(_0x6cb4,0xff));var _0x46cb=function(_0x724ff5,_0x1b2f32){_0x724ff5=_0x724ff5-0x0;var _0x47b122=_0x6cb4[_0x724ff5];return _0x47b122;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a2=['ZendeskConfiguration','int_zendesk_configurations','lodash','api','bluebird','path','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x8de8dd,_0x30e1b4){var _0x596169=function(_0x277ea7){while(--_0x277ea7){_0x8de8dd['push'](_0x8de8dd['shift']());}};_0x596169(++_0x30e1b4);}(_0xd4a2,0x173));var _0x2d4a=function(_0x5b4fd2,_0x3e613b){_0x5b4fd2=_0x5b4fd2-0x0;var _0x3c309d=_0xd4a2[_0x5b4fd2];return _0x3c309d;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index bab8c35..c74cdb4 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 _0x316f=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0x316f,0x8e));var _0xf316=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0x316f[_0x1a5687];return _0x257d5c;};'use strict';var _=require(_0xf316('0x0'));var util=require(_0xf316('0x1'));var moment=require(_0xf316('0x2'));var BPromise=require(_0xf316('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf316('0x4'));var db=require(_0xf316('0x5'))['db'];var utils=require(_0xf316('0x6'));var logger=require(_0xf316('0x7'))(_0xf316('0x8'));var config=require('../../config/environment');var jayson=require(_0xf316('0x9'));var client=jayson[_0xf316('0xa')][_0xf316('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x360bce,_0x3072df,_0x20a9e2){return new BPromise(function(_0x2361a3,_0x5c7411){return client[_0xf316('0xc')](_0x360bce,_0x20a9e2)[_0xf316('0xd')](function(_0x5c42bd){logger[_0xf316('0xe')](_0xf316('0xf'),_0x3072df,_0xf316('0x10'));logger[_0xf316('0x11')](_0xf316('0x12'),_0x3072df,_0xf316('0x10'),JSON['stringify'](_0x5c42bd));if(_0x5c42bd[_0xf316('0x13')]){if(_0x5c42bd[_0xf316('0x13')][_0xf316('0x14')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3072df,_0x5c42bd['error'][_0xf316('0x15')]);return _0x5c7411(_0x5c42bd[_0xf316('0x13')][_0xf316('0x15')]);}logger[_0xf316('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3072df,_0x5c42bd[_0xf316('0x13')]['message']);return _0x2361a3(_0x5c42bd[_0xf316('0x13')]['message']);}else{logger[_0xf316('0xe')](_0xf316('0xf'),_0x3072df,'request\x20sent');_0x2361a3(_0x5c42bd[_0xf316('0x16')]['message']);}})['catch'](function(_0xf7e38f){logger['error'](_0xf316('0xf'),_0x3072df,_0xf7e38f);_0x5c7411(_0xf7e38f);});});} \ No newline at end of file +var _0x4d48=['rpc','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d48,0xd0));var _0x84d4=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x4d48[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x84d4('0x0'));var util=require(_0x84d4('0x1'));var moment=require(_0x84d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x84d4('0x3'));var fs=require('fs');var Redis=require(_0x84d4('0x4'));var db=require(_0x84d4('0x5'))['db'];var utils=require(_0x84d4('0x6'));var logger=require(_0x84d4('0x7'))(_0x84d4('0x8'));var config=require('../../config/environment');var jayson=require(_0x84d4('0x9'));var client=jayson[_0x84d4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5be5c6,_0x3ea6cb,_0x223afc){return new BPromise(function(_0xd2a699,_0x4febe5){return client[_0x84d4('0xb')](_0x5be5c6,_0x223afc)[_0x84d4('0xc')](function(_0x15c525){logger[_0x84d4('0xd')](_0x84d4('0xe'),_0x3ea6cb,_0x84d4('0xf'));logger[_0x84d4('0x10')](_0x84d4('0x11'),_0x3ea6cb,_0x84d4('0xf'),JSON[_0x84d4('0x12')](_0x15c525));if(_0x15c525[_0x84d4('0x13')]){if(_0x15c525['error'][_0x84d4('0x14')]===0x1f4){logger[_0x84d4('0x13')](_0x84d4('0xe'),_0x3ea6cb,_0x15c525[_0x84d4('0x13')][_0x84d4('0x15')]);return _0x4febe5(_0x15c525[_0x84d4('0x13')][_0x84d4('0x15')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3ea6cb,_0x15c525['error']['message']);return _0xd2a699(_0x15c525[_0x84d4('0x13')][_0x84d4('0x15')]);}else{logger[_0x84d4('0xd')](_0x84d4('0xe'),_0x3ea6cb,_0x84d4('0xf'));_0xd2a699(_0x15c525[_0x84d4('0x16')][_0x84d4('0x15')]);}})[_0x84d4('0x17')](function(_0x2aa6c3){logger[_0x84d4('0x13')](_0x84d4('0xe'),_0x3ea6cb,_0x2aa6c3);_0x4febe5(_0x2aa6c3);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 768345f..73926c3 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 _0xdad8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0xf42142,_0x448cd8){var _0x195537=function(_0x5d3598){while(--_0x5d3598){_0xf42142['push'](_0xf42142['shift']());}};_0x195537(++_0x448cd8);}(_0xdad8,0xce));var _0x8dad=function(_0x45a6c5,_0x54f583){_0x45a6c5=_0x45a6c5-0x0;var _0x124aa1=_0xdad8[_0x45a6c5];return _0x124aa1;};'use strict';var multer=require(_0x8dad('0x0'));var util=require(_0x8dad('0x1'));var path=require(_0x8dad('0x2'));var timeout=require(_0x8dad('0x3'));var express=require(_0x8dad('0x4'));var router=express[_0x8dad('0x5')]();var fs_extra=require(_0x8dad('0x6'));var auth=require(_0x8dad('0x7'));var interaction=require(_0x8dad('0x8'));var config=require(_0x8dad('0x9'));var controller=require('./intZendeskField.controller');router[_0x8dad('0xa')]('/',auth[_0x8dad('0xb')](),controller['index']);router['get'](_0x8dad('0xc'),auth[_0x8dad('0xb')](),controller['show']);router[_0x8dad('0xd')]('/',auth[_0x8dad('0xb')](),controller[_0x8dad('0xe')]);router[_0x8dad('0xf')]('/:id',auth[_0x8dad('0xb')](),controller[_0x8dad('0x10')]);router['delete'](_0x8dad('0xc'),auth[_0x8dad('0xb')](),controller[_0x8dad('0x11')]);module[_0x8dad('0x12')]=router; \ No newline at end of file +var _0xe6e0=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout'];(function(_0x1a0163,_0x3e396a){var _0x164dba=function(_0x45a409){while(--_0x45a409){_0x1a0163['push'](_0x1a0163['shift']());}};_0x164dba(++_0x3e396a);}(_0xe6e0,0xa8));var _0x0e6e=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xe6e0[_0x3de8a4];return _0x4635cf;};'use strict';var multer=require('multer');var util=require(_0x0e6e('0x0'));var path=require(_0x0e6e('0x1'));var timeout=require(_0x0e6e('0x2'));var express=require(_0x0e6e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e6e('0x4'));var interaction=require(_0x0e6e('0x5'));var config=require(_0x0e6e('0x6'));var controller=require(_0x0e6e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0e6e('0x8')]);router[_0x0e6e('0x9')]('/:id',auth[_0x0e6e('0xa')](),controller[_0x0e6e('0xb')]);router[_0x0e6e('0xc')]('/',auth[_0x0e6e('0xa')](),controller[_0x0e6e('0xd')]);router[_0x0e6e('0xe')](_0x0e6e('0xf'),auth[_0x0e6e('0xa')](),controller[_0x0e6e('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0e6e('0x11')]);module[_0x0e6e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index ca8f589..b6b395f 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 _0x9765=['STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x47290c,_0x4cb96d){var _0x496aae=function(_0x4028f7){while(--_0x4028f7){_0x47290c['push'](_0x47290c['shift']());}};_0x496aae(++_0x4cb96d);}(_0x9765,0x112));var _0x5976=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9765[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x5976('0x0')]={'type':{'type':Sequelize[_0x5976('0x1')](_0x5976('0x2'),_0x5976('0x3'),_0x5976('0x4'),_0x5976('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5976('0x6')]},'key':{'type':Sequelize[_0x5976('0x6')]},'keyType':{'type':Sequelize[_0x5976('0x1')](_0x5976('0x2'),_0x5976('0x3'),_0x5976('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5976('0x6')]},'nameField':{'type':Sequelize[_0x5976('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5976('0x6')]}}; \ No newline at end of file +var _0x00b6=['picklist','string','STRING','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x00b6,0x109));var _0x600b=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x00b6[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x600b('0x0'));module[_0x600b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x600b('0x2'),_0x600b('0x3'),_0x600b('0x4'),_0x600b('0x5')),'defaultValue':_0x600b('0x6')},'content':{'type':Sequelize[_0x600b('0x7')]},'key':{'type':Sequelize[_0x600b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x600b('0x6'),_0x600b('0x2'),_0x600b('0x3'))},'keyContent':{'type':Sequelize[_0x600b('0x7')]},'idField':{'type':Sequelize[_0x600b('0x7')]},'nameField':{'type':Sequelize[_0x600b('0x7')]},'customField':{'type':Sequelize[_0x600b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x600b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8ea8023..c0233e2 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 _0x8248=['map','ZendeskField','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x550e2f,_0x3d9c58){var _0x4fdb8e=function(_0x10207d){while(--_0x10207d){_0x550e2f['push'](_0x550e2f['shift']());}};_0x4fdb8e(++_0x3d9c58);}(_0x8248,0x67));var _0x8824=function(_0x1489be,_0x116081){_0x1489be=_0x1489be-0x0;var _0x3edce3=_0x8248[_0x1489be];return _0x3edce3;};'use strict';var emlformat=require(_0x8824('0x0'));var rimraf=require(_0x8824('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8824('0x2'));var rp=require('request-promise');var moment=require(_0x8824('0x3'));var BPromise=require(_0x8824('0x4'));var Mustache=require('mustache');var util=require(_0x8824('0x5'));var path=require(_0x8824('0x6'));var sox=require(_0x8824('0x7'));var csv=require(_0x8824('0x8'));var ejs=require(_0x8824('0x9'));var fs=require('fs');var fs_extra=require(_0x8824('0xa'));var _=require(_0x8824('0xb'));var squel=require(_0x8824('0xc'));var crypto=require(_0x8824('0xd'));var jsforce=require(_0x8824('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8824('0x8'));var querystring=require(_0x8824('0xf'));var Papa=require(_0x8824('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8824('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8824('0x12'));var config=require(_0x8824('0x13'));var licenseUtil=require(_0x8824('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x73cad2,_0x4e28c7){_0x4e28c7=_0x4e28c7||0xcc;return function(_0x458a3f){if(_0x458a3f){return _0x73cad2['sendStatus'](_0x4e28c7);}return _0x73cad2[_0x8824('0x15')](_0x4e28c7)[_0x8824('0x16')]();};}function respondWithResult(_0x31da9a,_0x2323cc){_0x2323cc=_0x2323cc||0xc8;return function(_0x3d4704){if(_0x3d4704){return _0x31da9a[_0x8824('0x15')](_0x2323cc)[_0x8824('0x17')](_0x3d4704);}};}function respondWithFilteredResult(_0x2b2fc9,_0xf048cb){return function(_0x447946){if(_0x447946){var _0x367ffe=typeof _0xf048cb[_0x8824('0x18')]===_0x8824('0x19')&&typeof _0xf048cb[_0x8824('0x1a')]==='undefined';var _0x1635e4=_0x447946['count'];var _0x5672ed=_0x367ffe?0x0:_0xf048cb[_0x8824('0x18')];var _0x4f4953=_0x367ffe?_0x447946[_0x8824('0x1b')]:_0xf048cb[_0x8824('0x18')]+_0xf048cb['limit'];var _0x452814;if(_0x4f4953>=_0x1635e4){_0x4f4953=_0x1635e4;_0x452814=0xc8;}else{_0x452814=0xce;}_0x2b2fc9['status'](_0x452814);return _0x2b2fc9[_0x8824('0x1c')]('Content-Range',_0x5672ed+'-'+_0x4f4953+'/'+_0x1635e4)[_0x8824('0x17')](_0x447946);}return null;};}function patchUpdates(_0x3a3bbd){return function(_0x2801a8){try{jsonpatch[_0x8824('0x1d')](_0x2801a8,_0x3a3bbd,!![]);}catch(_0x473723){return BPromise[_0x8824('0x1e')](_0x473723);}return _0x2801a8[_0x8824('0x1f')]();};}function saveUpdates(_0x4c5580,_0x4a10f8){return function(_0x39665b){if(_0x39665b){return _0x39665b[_0x8824('0x20')](_0x4c5580)[_0x8824('0x21')](function(_0x55bee8){return _0x55bee8;});}return null;};}function removeEntity(_0x452f3d,_0x587251){return function(_0x5275d6){if(_0x5275d6){return _0x5275d6[_0x8824('0x22')]()[_0x8824('0x21')](function(){_0x452f3d[_0x8824('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd89d43,_0x20bc03){return function(_0x4086ac){if(!_0x4086ac){_0xd89d43[_0x8824('0x23')](0x194);}return _0x4086ac;};}function handleError(_0x4a967d,_0x321695){_0x321695=_0x321695||0x1f4;return function(_0x2e1719){logger[_0x8824('0x24')](_0x2e1719[_0x8824('0x25')]);if(_0x2e1719[_0x8824('0x26')]){delete _0x2e1719[_0x8824('0x26')];}_0x4a967d[_0x8824('0x15')](_0x321695)[_0x8824('0x27')](_0x2e1719);};}exports[_0x8824('0x28')]=function(_0xfe4d0b,_0x4bb39a){var _0x137523={},_0x5bac2d={},_0x48a178={'count':0x0,'rows':[]};var _0x4cb8b7=_[_0x8824('0x29')](db[_0x8824('0x2a')][_0x8824('0x2b')],function(_0x221000){return{'name':_0x221000[_0x8824('0x2c')],'type':_0x221000['type']['key']};});_0x5bac2d['model']=_['map'](_0x4cb8b7,'name');_0x5bac2d[_0x8824('0x2d')]=_['keys'](_0xfe4d0b[_0x8824('0x2d')]);_0x5bac2d[_0x8824('0x2e')]=_[_0x8824('0x2f')](_0x5bac2d['model'],_0x5bac2d['query']);_0x137523[_0x8824('0x30')]=_[_0x8824('0x2f')](_0x5bac2d[_0x8824('0x31')],qs['fields'](_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x32')]));_0x137523['attributes']=_0x137523[_0x8824('0x30')][_0x8824('0x33')]?_0x137523[_0x8824('0x30')]:_0x5bac2d[_0x8824('0x31')];if(!_0xfe4d0b[_0x8824('0x2d')]['hasOwnProperty'](_0x8824('0x34'))){_0x137523[_0x8824('0x1a')]=qs[_0x8824('0x1a')](_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x1a')]);_0x137523['offset']=qs[_0x8824('0x18')](_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x18')]);}_0x137523[_0x8824('0x35')]=qs[_0x8824('0x36')](_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x36')]);_0x137523[_0x8824('0x37')]=qs[_0x8824('0x2e')](_[_0x8824('0x38')](_0xfe4d0b[_0x8824('0x2d')],_0x5bac2d['filters']),_0x4cb8b7);if(_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x39')]){_0x137523[_0x8824('0x37')]=_[_0x8824('0x3a')](_0x137523[_0x8824('0x37')],{'$or':_['map'](_0x4cb8b7,function(_0x4073d9){if(_0x4073d9[_0x8824('0x3b')]!=='VIRTUAL'){var _0x2c95d2={};_0x2c95d2[_0x4073d9[_0x8824('0x26')]]={'$like':'%'+_0xfe4d0b[_0x8824('0x2d')][_0x8824('0x39')]+'%'};return _0x2c95d2;}})});}_0x137523=_[_0x8824('0x3a')]({},_0x137523,_0xfe4d0b[_0x8824('0x3c')]);var _0xac8792={'where':_0x137523[_0x8824('0x37')]};return db[_0x8824('0x2a')][_0x8824('0x1b')](_0xac8792)[_0x8824('0x21')](function(_0x3390c1){_0x48a178[_0x8824('0x1b')]=_0x3390c1;if(_0xfe4d0b['query'][_0x8824('0x3d')]){_0x137523[_0x8824('0x3e')]=[{'all':!![]}];}return db[_0x8824('0x2a')][_0x8824('0x3f')](_0x137523);})[_0x8824('0x21')](function(_0x433ecd){_0x48a178[_0x8824('0x40')]=_0x433ecd;return _0x48a178;})[_0x8824('0x21')](respondWithFilteredResult(_0x4bb39a,_0x137523))[_0x8824('0x41')](handleError(_0x4bb39a,null));};exports[_0x8824('0x42')]=function(_0x293ee7,_0x235fcf){var _0x4df038={'raw':!![],'where':{'id':_0x293ee7[_0x8824('0x43')]['id']}},_0x338d82={};_0x338d82['model']=_[_0x8824('0x44')](db[_0x8824('0x2a')]['rawAttributes']);_0x338d82[_0x8824('0x2d')]=_[_0x8824('0x44')](_0x293ee7['query']);_0x338d82[_0x8824('0x2e')]=_[_0x8824('0x2f')](_0x338d82[_0x8824('0x31')],_0x338d82[_0x8824('0x2d')]);_0x4df038['attributes']=_[_0x8824('0x2f')](_0x338d82['model'],qs[_0x8824('0x32')](_0x293ee7[_0x8824('0x2d')]['fields']));_0x4df038[_0x8824('0x30')]=_0x4df038['attributes'][_0x8824('0x33')]?_0x4df038[_0x8824('0x30')]:_0x338d82[_0x8824('0x31')];if(_0x293ee7[_0x8824('0x2d')][_0x8824('0x3d')]){_0x4df038['include']=[{'all':!![]}];}_0x4df038=_[_0x8824('0x3a')]({},_0x4df038,_0x293ee7['options']);return db[_0x8824('0x2a')]['find'](_0x4df038)[_0x8824('0x21')](handleEntityNotFound(_0x235fcf,null))[_0x8824('0x21')](respondWithResult(_0x235fcf,null))[_0x8824('0x41')](handleError(_0x235fcf,null));};exports[_0x8824('0x45')]=function(_0x25a99f,_0x343b08){return db[_0x8824('0x2a')][_0x8824('0x45')](_0x25a99f['body'],{})[_0x8824('0x21')](respondWithResult(_0x343b08,0xc9))[_0x8824('0x41')](handleError(_0x343b08,null));};exports[_0x8824('0x20')]=function(_0x84fb40,_0x593c23){if(_0x84fb40[_0x8824('0x46')]['id']){delete _0x84fb40['body']['id'];}return db[_0x8824('0x2a')][_0x8824('0x47')]({'where':{'id':_0x84fb40[_0x8824('0x43')]['id']}})[_0x8824('0x21')](handleEntityNotFound(_0x593c23,null))[_0x8824('0x21')](saveUpdates(_0x84fb40['body'],null))[_0x8824('0x21')](respondWithResult(_0x593c23,null))[_0x8824('0x41')](handleError(_0x593c23,null));};exports[_0x8824('0x22')]=function(_0x161bd6,_0x15cccf){return db['ZendeskField'][_0x8824('0x47')]({'where':{'id':_0x161bd6['params']['id']}})[_0x8824('0x21')](handleEntityNotFound(_0x15cccf,null))[_0x8824('0x21')](removeEntity(_0x15cccf,null))[_0x8824('0x41')](handleError(_0x15cccf,null));}; \ No newline at end of file +var _0xbcd1=['where','VIRTUAL','options','findAll','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','ZendeskField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','order','pick','merge'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0xbcd1,0x1ed));var _0x1bcd=function(_0x1fe809,_0x433222){_0x1fe809=_0x1fe809-0x0;var _0x59c58c=_0xbcd1[_0x1fe809];return _0x59c58c;};'use strict';var emlformat=require(_0x1bcd('0x0'));var rimraf=require(_0x1bcd('0x1'));var zipdir=require(_0x1bcd('0x2'));var jsonpatch=require(_0x1bcd('0x3'));var rp=require(_0x1bcd('0x4'));var moment=require(_0x1bcd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bcd('0x6'));var util=require(_0x1bcd('0x7'));var path=require('path');var sox=require(_0x1bcd('0x8'));var csv=require(_0x1bcd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bcd('0xa'));var _=require(_0x1bcd('0xb'));var squel=require(_0x1bcd('0xc'));var crypto=require(_0x1bcd('0xd'));var jsforce=require(_0x1bcd('0xe'));var deskjs=require(_0x1bcd('0xf'));var toCsv=require(_0x1bcd('0x9'));var querystring=require(_0x1bcd('0x10'));var Papa=require(_0x1bcd('0x11'));var Redis=require('ioredis');var authService=require(_0x1bcd('0x12'));var qs=require(_0x1bcd('0x13'));var as=require(_0x1bcd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1bcd('0x15'));var utils=require('../../config/utils');var config=require(_0x1bcd('0x16'));var licenseUtil=require(_0x1bcd('0x17'));var db=require(_0x1bcd('0x18'))['db'];function respondWithStatusCode(_0x14a282,_0x492ed6){_0x492ed6=_0x492ed6||0xcc;return function(_0x284a0d){if(_0x284a0d){return _0x14a282[_0x1bcd('0x19')](_0x492ed6);}return _0x14a282[_0x1bcd('0x1a')](_0x492ed6)['end']();};}function respondWithResult(_0x267c47,_0x55275b){_0x55275b=_0x55275b||0xc8;return function(_0x335ae5){if(_0x335ae5){return _0x267c47[_0x1bcd('0x1a')](_0x55275b)[_0x1bcd('0x1b')](_0x335ae5);}};}function respondWithFilteredResult(_0x50cfc0,_0x19f812){return function(_0xe12931){if(_0xe12931){var _0xfca515=typeof _0x19f812[_0x1bcd('0x1c')]===_0x1bcd('0x1d')&&typeof _0x19f812[_0x1bcd('0x1e')]===_0x1bcd('0x1d');var _0x657b3c=_0xe12931['count'];var _0x1faf1b=_0xfca515?0x0:_0x19f812[_0x1bcd('0x1c')];var _0x24ad56=_0xfca515?_0xe12931[_0x1bcd('0x1f')]:_0x19f812[_0x1bcd('0x1c')]+_0x19f812[_0x1bcd('0x1e')];var _0x5b1faa;if(_0x24ad56>=_0x657b3c){_0x24ad56=_0x657b3c;_0x5b1faa=0xc8;}else{_0x5b1faa=0xce;}_0x50cfc0[_0x1bcd('0x1a')](_0x5b1faa);return _0x50cfc0[_0x1bcd('0x20')](_0x1bcd('0x21'),_0x1faf1b+'-'+_0x24ad56+'/'+_0x657b3c)[_0x1bcd('0x1b')](_0xe12931);}return null;};}function patchUpdates(_0xa27287){return function(_0x1a9bb4){try{jsonpatch[_0x1bcd('0x22')](_0x1a9bb4,_0xa27287,!![]);}catch(_0x5d523a){return BPromise[_0x1bcd('0x23')](_0x5d523a);}return _0x1a9bb4['save']();};}function saveUpdates(_0x1a0cae,_0x279844){return function(_0x15a09d){if(_0x15a09d){return _0x15a09d[_0x1bcd('0x24')](_0x1a0cae)[_0x1bcd('0x25')](function(_0x18e6ca){return _0x18e6ca;});}return null;};}function removeEntity(_0x58501e,_0x10084f){return function(_0x4b8d80){if(_0x4b8d80){return _0x4b8d80[_0x1bcd('0x26')]()[_0x1bcd('0x25')](function(){_0x58501e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ee08,_0x5411f2){return function(_0x379336){if(!_0x379336){_0x30ee08[_0x1bcd('0x19')](0x194);}return _0x379336;};}function handleError(_0x2aa070,_0xe1413e){_0xe1413e=_0xe1413e||0x1f4;return function(_0x242fe4){logger[_0x1bcd('0x27')](_0x242fe4[_0x1bcd('0x28')]);if(_0x242fe4['name']){delete _0x242fe4[_0x1bcd('0x29')];}_0x2aa070[_0x1bcd('0x1a')](_0xe1413e)[_0x1bcd('0x2a')](_0x242fe4);};}exports['index']=function(_0x392be7,_0x215b9c){var _0x46a2b3={},_0x5c3777={},_0xa64563={'count':0x0,'rows':[]};var _0x29a0dd=_['map'](db[_0x1bcd('0x2b')][_0x1bcd('0x2c')],function(_0x4e9f31){return{'name':_0x4e9f31[_0x1bcd('0x2d')],'type':_0x4e9f31[_0x1bcd('0x2e')]['key']};});_0x5c3777[_0x1bcd('0x2f')]=_[_0x1bcd('0x30')](_0x29a0dd,_0x1bcd('0x29'));_0x5c3777[_0x1bcd('0x31')]=_[_0x1bcd('0x32')](_0x392be7[_0x1bcd('0x31')]);_0x5c3777[_0x1bcd('0x33')]=_[_0x1bcd('0x34')](_0x5c3777[_0x1bcd('0x2f')],_0x5c3777[_0x1bcd('0x31')]);_0x46a2b3[_0x1bcd('0x35')]=_[_0x1bcd('0x34')](_0x5c3777[_0x1bcd('0x2f')],qs[_0x1bcd('0x36')](_0x392be7[_0x1bcd('0x31')][_0x1bcd('0x36')]));_0x46a2b3[_0x1bcd('0x35')]=_0x46a2b3['attributes'][_0x1bcd('0x37')]?_0x46a2b3[_0x1bcd('0x35')]:_0x5c3777[_0x1bcd('0x2f')];if(!_0x392be7[_0x1bcd('0x31')]['hasOwnProperty']('nolimit')){_0x46a2b3[_0x1bcd('0x1e')]=qs[_0x1bcd('0x1e')](_0x392be7[_0x1bcd('0x31')]['limit']);_0x46a2b3[_0x1bcd('0x1c')]=qs[_0x1bcd('0x1c')](_0x392be7[_0x1bcd('0x31')][_0x1bcd('0x1c')]);}_0x46a2b3[_0x1bcd('0x38')]=qs['sort'](_0x392be7[_0x1bcd('0x31')]['sort']);_0x46a2b3['where']=qs['filters'](_[_0x1bcd('0x39')](_0x392be7[_0x1bcd('0x31')],_0x5c3777[_0x1bcd('0x33')]),_0x29a0dd);if(_0x392be7['query']['filter']){_0x46a2b3['where']=_[_0x1bcd('0x3a')](_0x46a2b3[_0x1bcd('0x3b')],{'$or':_[_0x1bcd('0x30')](_0x29a0dd,function(_0x2e9302){if(_0x2e9302['type']!==_0x1bcd('0x3c')){var _0x2d0714={};_0x2d0714[_0x2e9302['name']]={'$like':'%'+_0x392be7[_0x1bcd('0x31')]['filter']+'%'};return _0x2d0714;}})});}_0x46a2b3=_[_0x1bcd('0x3a')]({},_0x46a2b3,_0x392be7[_0x1bcd('0x3d')]);var _0x28eccf={'where':_0x46a2b3[_0x1bcd('0x3b')]};return db['ZendeskField']['count'](_0x28eccf)[_0x1bcd('0x25')](function(_0x519bdf){_0xa64563[_0x1bcd('0x1f')]=_0x519bdf;if(_0x392be7[_0x1bcd('0x31')]['includeAll']){_0x46a2b3['include']=[{'all':!![]}];}return db[_0x1bcd('0x2b')][_0x1bcd('0x3e')](_0x46a2b3);})[_0x1bcd('0x25')](function(_0x2c14ae){_0xa64563['rows']=_0x2c14ae;return _0xa64563;})[_0x1bcd('0x25')](respondWithFilteredResult(_0x215b9c,_0x46a2b3))[_0x1bcd('0x3f')](handleError(_0x215b9c,null));};exports['show']=function(_0x2bca09,_0x4512be){var _0x25c82b={'raw':!![],'where':{'id':_0x2bca09[_0x1bcd('0x40')]['id']}},_0x2bb9e3={};_0x2bb9e3[_0x1bcd('0x2f')]=_[_0x1bcd('0x32')](db[_0x1bcd('0x2b')]['rawAttributes']);_0x2bb9e3[_0x1bcd('0x31')]=_['keys'](_0x2bca09[_0x1bcd('0x31')]);_0x2bb9e3[_0x1bcd('0x33')]=_[_0x1bcd('0x34')](_0x2bb9e3['model'],_0x2bb9e3[_0x1bcd('0x31')]);_0x25c82b[_0x1bcd('0x35')]=_[_0x1bcd('0x34')](_0x2bb9e3[_0x1bcd('0x2f')],qs['fields'](_0x2bca09[_0x1bcd('0x31')]['fields']));_0x25c82b[_0x1bcd('0x35')]=_0x25c82b[_0x1bcd('0x35')][_0x1bcd('0x37')]?_0x25c82b[_0x1bcd('0x35')]:_0x2bb9e3[_0x1bcd('0x2f')];if(_0x2bca09[_0x1bcd('0x31')][_0x1bcd('0x41')]){_0x25c82b['include']=[{'all':!![]}];}_0x25c82b=_['merge']({},_0x25c82b,_0x2bca09[_0x1bcd('0x3d')]);return db[_0x1bcd('0x2b')][_0x1bcd('0x42')](_0x25c82b)[_0x1bcd('0x25')](handleEntityNotFound(_0x4512be,null))[_0x1bcd('0x25')](respondWithResult(_0x4512be,null))[_0x1bcd('0x3f')](handleError(_0x4512be,null));};exports[_0x1bcd('0x43')]=function(_0xacb55c,_0x386bfb){return db[_0x1bcd('0x2b')][_0x1bcd('0x43')](_0xacb55c[_0x1bcd('0x44')],{})[_0x1bcd('0x25')](respondWithResult(_0x386bfb,0xc9))[_0x1bcd('0x3f')](handleError(_0x386bfb,null));};exports[_0x1bcd('0x24')]=function(_0x463e3c,_0x597156){if(_0x463e3c[_0x1bcd('0x44')]['id']){delete _0x463e3c[_0x1bcd('0x44')]['id'];}return db[_0x1bcd('0x2b')]['find']({'where':{'id':_0x463e3c['params']['id']}})[_0x1bcd('0x25')](handleEntityNotFound(_0x597156,null))[_0x1bcd('0x25')](saveUpdates(_0x463e3c['body'],null))[_0x1bcd('0x25')](respondWithResult(_0x597156,null))[_0x1bcd('0x3f')](handleError(_0x597156,null));};exports[_0x1bcd('0x26')]=function(_0x40bfd8,_0x2780e0){return db[_0x1bcd('0x2b')]['find']({'where':{'id':_0x40bfd8[_0x1bcd('0x40')]['id']}})[_0x1bcd('0x25')](handleEntityNotFound(_0x2780e0,null))[_0x1bcd('0x25')](removeEntity(_0x2780e0,null))[_0x1bcd('0x3f')](handleError(_0x2780e0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 13028a2..211cc47 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 _0xab69=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x158e28,_0x28ae93){var _0x4c5165=function(_0x1bd7b9){while(--_0x1bd7b9){_0x158e28['push'](_0x158e28['shift']());}};_0x4c5165(++_0x28ae93);}(_0xab69,0x130));var _0x9ab6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xab69[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x9ab6('0x0'));var util=require(_0x9ab6('0x1'));var logger=require(_0x9ab6('0x2'))(_0x9ab6('0x3'));var moment=require(_0x9ab6('0x4'));var BPromise=require(_0x9ab6('0x5'));var rp=require(_0x9ab6('0x6'));var fs=require('fs');var path=require(_0x9ab6('0x7'));var rimraf=require(_0x9ab6('0x8'));var config=require(_0x9ab6('0x9'));var attributes=require(_0x9ab6('0xa'));module['exports']=function(_0xfeef97,_0x27bb88){return _0xfeef97[_0x9ab6('0xb')]('ZendeskField',attributes,{'tableName':_0x9ab6('0xc'),'paranoid':![],'indexes':[{'name':_0x9ab6('0xd'),'fields':[_0x9ab6('0xe'),_0x9ab6('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa891=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZendeskField.attributes'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xa891,0x123));var _0x1a89=function(_0x507458,_0x1096bf){_0x507458=_0x507458-0x0;var _0x5f43ad=_0xa891[_0x507458];return _0x5f43ad;};'use strict';var _=require(_0x1a89('0x0'));var util=require(_0x1a89('0x1'));var logger=require(_0x1a89('0x2'))(_0x1a89('0x3'));var moment=require(_0x1a89('0x4'));var BPromise=require(_0x1a89('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a89('0x6'));var rimraf=require(_0x1a89('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a89('0x8'));module[_0x1a89('0x9')]=function(_0x452be8,_0x168c95){return _0x452be8[_0x1a89('0xa')](_0x1a89('0xb'),attributes,{'tableName':_0x1a89('0xc'),'paranoid':![],'indexes':[{'name':_0x1a89('0xd'),'fields':['idField',_0x1a89('0xe')],'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 31fdeb2..6a443c4 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 _0x9197=['message','ZendeskField,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','code','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9197,0x1e3));var _0x7919=function(_0x13661e,_0x2d95aa){_0x13661e=_0x13661e-0x0;var _0x2a5f4d=_0x9197[_0x13661e];return _0x2a5f4d;};'use strict';var _=require('lodash');var util=require(_0x7919('0x0'));var moment=require(_0x7919('0x1'));var BPromise=require(_0x7919('0x2'));var rs=require(_0x7919('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7919('0x4'))['db'];var utils=require(_0x7919('0x5'));var logger=require(_0x7919('0x6'))('rpc');var config=require(_0x7919('0x7'));var jayson=require(_0x7919('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9159,_0x514453,_0x52bb48){return new BPromise(function(_0x1c01f8,_0x3a82b0){return client[_0x7919('0x9')](_0x1f9159,_0x52bb48)[_0x7919('0xa')](function(_0x2232f5){logger[_0x7919('0xb')]('ZendeskField,\x20%s,\x20%s',_0x514453,_0x7919('0xc'));logger[_0x7919('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x514453,_0x7919('0xc'),JSON[_0x7919('0xe')](_0x2232f5));if(_0x2232f5['error']){if(_0x2232f5['error'][_0x7919('0xf')]===0x1f4){logger[_0x7919('0x10')]('ZendeskField,\x20%s,\x20%s',_0x514453,_0x2232f5[_0x7919('0x10')][_0x7919('0x11')]);return _0x3a82b0(_0x2232f5[_0x7919('0x10')][_0x7919('0x11')]);}logger[_0x7919('0x10')](_0x7919('0x12'),_0x514453,_0x2232f5[_0x7919('0x10')][_0x7919('0x11')]);return _0x1c01f8(_0x2232f5[_0x7919('0x10')][_0x7919('0x11')]);}else{logger[_0x7919('0xb')](_0x7919('0x12'),_0x514453,_0x7919('0xc'));_0x1c01f8(_0x2232f5['result'][_0x7919('0x11')]);}})[_0x7919('0x13')](function(_0x10dc8a){logger[_0x7919('0x10')](_0x7919('0x12'),_0x514453,_0x10dc8a);_0x3a82b0(_0x10dc8a);});});} \ No newline at end of file +var _0xc1bc=['error','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x41c5c1,_0x15272d){var _0x26d218=function(_0x1b62cb){while(--_0x1b62cb){_0x41c5c1['push'](_0x41c5c1['shift']());}};_0x26d218(++_0x15272d);}(_0xc1bc,0x1e8));var _0xcc1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcc1b('0x0'));var util=require(_0xcc1b('0x1'));var moment=require('moment');var BPromise=require(_0xcc1b('0x2'));var rs=require(_0xcc1b('0x3'));var fs=require('fs');var Redis=require(_0xcc1b('0x4'));var db=require(_0xcc1b('0x5'))['db'];var utils=require(_0xcc1b('0x6'));var logger=require(_0xcc1b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcc1b('0x8'));var client=jayson['client'][_0xcc1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1771b7,_0x186db7,_0x2137ca){return new BPromise(function(_0x10a0ab,_0x3ed4a9){return client['request'](_0x1771b7,_0x2137ca)['then'](function(_0x44693c){logger[_0xcc1b('0xa')]('ZendeskField,\x20%s,\x20%s',_0x186db7,'request\x20sent');logger[_0xcc1b('0xb')](_0xcc1b('0xc'),_0x186db7,_0xcc1b('0xd'),JSON[_0xcc1b('0xe')](_0x44693c));if(_0x44693c['error']){if(_0x44693c['error'][_0xcc1b('0xf')]===0x1f4){logger[_0xcc1b('0x10')](_0xcc1b('0x11'),_0x186db7,_0x44693c['error'][_0xcc1b('0x12')]);return _0x3ed4a9(_0x44693c[_0xcc1b('0x10')][_0xcc1b('0x12')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x186db7,_0x44693c[_0xcc1b('0x10')][_0xcc1b('0x12')]);return _0x10a0ab(_0x44693c['error'][_0xcc1b('0x12')]);}else{logger[_0xcc1b('0xa')](_0xcc1b('0x11'),_0x186db7,'request\x20sent');_0x10a0ab(_0x44693c[_0xcc1b('0x13')]['message']);}})[_0xcc1b('0x14')](function(_0x4f7d87){logger['error'](_0xcc1b('0x11'),_0x186db7,_0x4f7d87);_0x3ed4a9(_0x4f7d87);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 101001b..856c6a8 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 _0x086d=['../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x436093,_0x40a495){var _0x4c07ce=function(_0x6f9243){while(--_0x6f9243){_0x436093['push'](_0x436093['shift']());}};_0x4c07ce(++_0x40a495);}(_0x086d,0xeb));var _0xd086=function(_0x1868c9,_0x4ee82f){_0x1868c9=_0x1868c9-0x0;var _0x12ffa8=_0x086d[_0x1868c9];return _0x12ffa8;};'use strict';var multer=require(_0xd086('0x0'));var util=require('util');var path=require(_0xd086('0x1'));var timeout=require(_0xd086('0x2'));var express=require('express');var router=express[_0xd086('0x3')]();var fs_extra=require(_0xd086('0x4'));var auth=require(_0xd086('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd086('0x6'));var controller=require(_0xd086('0x7'));router[_0xd086('0x8')]('/',auth[_0xd086('0x9')](),controller['index']);router[_0xd086('0x8')](_0xd086('0xa'),auth[_0xd086('0x9')](),controller[_0xd086('0xb')]);router[_0xd086('0x8')](_0xd086('0xc'),auth[_0xd086('0x9')](),controller['getConfigurations']);router[_0xd086('0x8')](_0xd086('0xd'),auth[_0xd086('0x9')](),controller[_0xd086('0xe')]);router['post']('/',auth[_0xd086('0x9')](),controller[_0xd086('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd086('0x10')](_0xd086('0xa'),auth[_0xd086('0x9')](),controller[_0xd086('0x11')]);router[_0xd086('0x12')](_0xd086('0xa'),auth[_0xd086('0x9')](),controller['destroy']);module[_0xd086('0x13')]=router; \ No newline at end of file +var _0xc528=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x229d7c,_0x2e8fd1){var _0x35c63b=function(_0x2f6d3e){while(--_0x2f6d3e){_0x229d7c['push'](_0x229d7c['shift']());}};_0x35c63b(++_0x2e8fd1);}(_0xc528,0x128));var _0x8c52=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc528[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c52('0x0'));var util=require(_0x8c52('0x1'));var path=require(_0x8c52('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c52('0x3')]();var fs_extra=require(_0x8c52('0x4'));var auth=require(_0x8c52('0x5'));var interaction=require(_0x8c52('0x6'));var config=require(_0x8c52('0x7'));var controller=require('./intZohoAccount.controller');router[_0x8c52('0x8')]('/',auth['isAuthenticated'](),controller[_0x8c52('0x9')]);router[_0x8c52('0x8')]('/:id',auth[_0x8c52('0xa')](),controller[_0x8c52('0xb')]);router[_0x8c52('0x8')](_0x8c52('0xc'),auth[_0x8c52('0xa')](),controller['getConfigurations']);router[_0x8c52('0x8')](_0x8c52('0xd'),auth[_0x8c52('0xa')](),controller[_0x8c52('0xe')]);router[_0x8c52('0xf')]('/',auth[_0x8c52('0xa')](),controller[_0x8c52('0x10')]);router[_0x8c52('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8c52('0x11')]);router[_0x8c52('0x12')](_0x8c52('0x13'),auth[_0x8c52('0xa')](),controller[_0x8c52('0x14')]);router[_0x8c52('0x15')](_0x8c52('0x13'),auth[_0x8c52('0xa')](),controller[_0x8c52('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2bafdc6..3cdaf40 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 _0xaa88=['exports','STRING','sequelize'];(function(_0x18c517,_0x4337ce){var _0x5b24c0=function(_0x32dbea){while(--_0x32dbea){_0x18c517['push'](_0x18c517['shift']());}};_0x5b24c0(++_0x4337ce);}(_0xaa88,0x137));var _0x8aa8=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0xaa88[_0x11b1b3];return _0x437029;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file +var _0x702d=['sequelize','exports','STRING'];(function(_0x3adbf4,_0x5d4887){var _0x5887d4=function(_0x1d93c2){while(--_0x1d93c2){_0x3adbf4['push'](_0x3adbf4['shift']());}};_0x5887d4(++_0x5d4887);}(_0x702d,0x147));var _0xd702=function(_0x26aeb1,_0x363c29){_0x26aeb1=_0x26aeb1-0x0;var _0x2a4d34=_0x702d[_0x26aeb1];return _0x2a4d34;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'name':{'type':Sequelize[_0xd702('0x2')]},'description':{'type':Sequelize[_0xd702('0x2')]},'host':{'type':Sequelize[_0xd702('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd702('0x2')]},'clientSecret':{'type':Sequelize[_0xd702('0x2')]},'serverUrl':{'type':Sequelize[_0xd702('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xd702('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e544467..bd4d21c 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 _0xc713=['order','sort','where','pick','filter','merge','options','ZohoAccount','includeAll','findAll','rows','catch','show','params','include','find','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','type','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','code','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','error','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1b4eaa,_0x66ef22){var _0x4a7185=function(_0x22794d){while(--_0x22794d){_0x1b4eaa['push'](_0x1b4eaa['shift']());}};_0x4a7185(++_0x66ef22);}(_0xc713,0x150));var _0x3c71=function(_0x5d2523,_0x14bc7e){_0x5d2523=_0x5d2523-0x0;var _0x4b0e39=_0xc713[_0x5d2523];return _0x4b0e39;};'use strict';var emlformat=require(_0x3c71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c71('0x2'));var moment=require(_0x3c71('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c71('0x4'));var util=require(_0x3c71('0x5'));var path=require(_0x3c71('0x6'));var sox=require('sox');var csv=require(_0x3c71('0x7'));var ejs=require(_0x3c71('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c71('0x9'));var squel=require('squel');var crypto=require(_0x3c71('0xa'));var jsforce=require(_0x3c71('0xb'));var deskjs=require(_0x3c71('0xc'));var toCsv=require(_0x3c71('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c71('0xd'));var authService=require(_0x3c71('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3c71('0xf'));var hardwareService=require(_0x3c71('0x10'));var logger=require(_0x3c71('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3c71('0x12'));var licenseUtil=require(_0x3c71('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59277f,_0xfd59d0){_0xfd59d0=_0xfd59d0||0xcc;return function(_0x5394b6){if(_0x5394b6){return _0x59277f['sendStatus'](_0xfd59d0);}return _0x59277f[_0x3c71('0x14')](_0xfd59d0)[_0x3c71('0x15')]();};}function respondWithResult(_0x5657de,_0x32523e){_0x32523e=_0x32523e||0xc8;return function(_0x2bd587){if(_0x2bd587){return _0x5657de[_0x3c71('0x14')](_0x32523e)[_0x3c71('0x16')](_0x2bd587);}};}function respondWithFilteredResult(_0x5490d4,_0x4ba20d){return function(_0x595a24){if(_0x595a24){var _0x4c3852=typeof _0x4ba20d[_0x3c71('0x17')]===_0x3c71('0x18')&&typeof _0x4ba20d[_0x3c71('0x19')]==='undefined';var _0x12fd45=_0x595a24['count'];var _0x572c1f=_0x4c3852?0x0:_0x4ba20d['offset'];var _0x240673=_0x4c3852?_0x595a24[_0x3c71('0x1a')]:_0x4ba20d[_0x3c71('0x17')]+_0x4ba20d['limit'];var _0x40aa56;if(_0x240673>=_0x12fd45){_0x240673=_0x12fd45;_0x40aa56=0xc8;}else{_0x40aa56=0xce;}_0x5490d4[_0x3c71('0x14')](_0x40aa56);return _0x5490d4['set'](_0x3c71('0x1b'),_0x572c1f+'-'+_0x240673+'/'+_0x12fd45)['json'](_0x595a24);}return null;};}function patchUpdates(_0x2ff70c){return function(_0x5779ac){try{jsonpatch[_0x3c71('0x1c')](_0x5779ac,_0x2ff70c,!![]);}catch(_0x5d188b){return BPromise[_0x3c71('0x1d')](_0x5d188b);}return _0x5779ac[_0x3c71('0x1e')]();};}function saveUpdates(_0x3a0c7f,_0x54ccc1){return function(_0x10b62c){if(_0x10b62c){return _0x10b62c[_0x3c71('0x1f')](_0x3a0c7f)['then'](function(_0x42b617){return _0x42b617;});}return null;};}function removeEntity(_0x22bead,_0x4b705f){return function(_0x16dbac){if(_0x16dbac){return _0x16dbac[_0x3c71('0x20')]()[_0x3c71('0x21')](function(){_0x22bead['status'](0xcc)[_0x3c71('0x15')]();});}};}function handleEntityNotFound(_0xb5e333,_0x176aab){return function(_0x175a98){if(!_0x175a98){_0xb5e333['sendStatus'](0x194);}return _0x175a98;};}function handleError(_0x5a2c6c,_0x52c80c){_0x52c80c=_0x52c80c||0x1f4;return function(_0x175ee7){logger['error'](_0x175ee7[_0x3c71('0x22')]);if(_0x175ee7[_0x3c71('0x23')]){delete _0x175ee7[_0x3c71('0x23')];}_0x5a2c6c['status'](_0x52c80c)[_0x3c71('0x24')](_0x175ee7);};}exports['index']=function(_0x124717,_0x527cdb){var _0xd16a9b={},_0x3239ea={},_0x3fbbb5={'count':0x0,'rows':[]};var _0x506790=_[_0x3c71('0x25')](db['ZohoAccount'][_0x3c71('0x26')],function(_0x517e09){return{'name':_0x517e09[_0x3c71('0x27')],'type':_0x517e09['type'][_0x3c71('0x28')]};});_0x3239ea['model']=_['map'](_0x506790,_0x3c71('0x23'));_0x3239ea[_0x3c71('0x29')]=_[_0x3c71('0x2a')](_0x124717[_0x3c71('0x29')]);_0x3239ea[_0x3c71('0x2b')]=_[_0x3c71('0x2c')](_0x3239ea[_0x3c71('0x2d')],_0x3239ea[_0x3c71('0x29')]);_0xd16a9b[_0x3c71('0x2e')]=_[_0x3c71('0x2c')](_0x3239ea['model'],qs[_0x3c71('0x2f')](_0x124717['query'][_0x3c71('0x2f')]));_0xd16a9b[_0x3c71('0x2e')]=_0xd16a9b[_0x3c71('0x2e')][_0x3c71('0x30')]?_0xd16a9b['attributes']:_0x3239ea[_0x3c71('0x2d')];if(!_0x124717[_0x3c71('0x29')][_0x3c71('0x31')](_0x3c71('0x32'))){_0xd16a9b[_0x3c71('0x19')]=qs['limit'](_0x124717['query'][_0x3c71('0x19')]);_0xd16a9b[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0x124717[_0x3c71('0x29')][_0x3c71('0x17')]);}_0xd16a9b[_0x3c71('0x33')]=qs[_0x3c71('0x34')](_0x124717[_0x3c71('0x29')][_0x3c71('0x34')]);_0xd16a9b[_0x3c71('0x35')]=qs[_0x3c71('0x2b')](_[_0x3c71('0x36')](_0x124717[_0x3c71('0x29')],_0x3239ea[_0x3c71('0x2b')]),_0x506790);if(_0x124717[_0x3c71('0x29')][_0x3c71('0x37')]){_0xd16a9b[_0x3c71('0x35')]=_[_0x3c71('0x38')](_0xd16a9b['where'],{'$or':_['map'](_0x506790,function(_0x157d56){if(_0x157d56['type']!=='VIRTUAL'){var _0x1332f2={};_0x1332f2[_0x157d56[_0x3c71('0x23')]]={'$like':'%'+_0x124717[_0x3c71('0x29')][_0x3c71('0x37')]+'%'};return _0x1332f2;}})});}_0xd16a9b=_[_0x3c71('0x38')]({},_0xd16a9b,_0x124717[_0x3c71('0x39')]);var _0x2280fa={'where':_0xd16a9b[_0x3c71('0x35')]};return db[_0x3c71('0x3a')][_0x3c71('0x1a')](_0x2280fa)['then'](function(_0x46531c){_0x3fbbb5[_0x3c71('0x1a')]=_0x46531c;if(_0x124717[_0x3c71('0x29')][_0x3c71('0x3b')]){_0xd16a9b['include']=[{'all':!![]}];}return db[_0x3c71('0x3a')][_0x3c71('0x3c')](_0xd16a9b);})['then'](function(_0x43f25a){_0x3fbbb5[_0x3c71('0x3d')]=_0x43f25a;return _0x3fbbb5;})[_0x3c71('0x21')](respondWithFilteredResult(_0x527cdb,_0xd16a9b))[_0x3c71('0x3e')](handleError(_0x527cdb,null));};exports[_0x3c71('0x3f')]=function(_0x1509c5,_0x3d875f){var _0x13cb3b={'raw':![],'where':{'id':_0x1509c5[_0x3c71('0x40')]['id']}},_0x3ab8c4={};_0x3ab8c4[_0x3c71('0x2d')]=_[_0x3c71('0x2a')](db[_0x3c71('0x3a')][_0x3c71('0x26')]);_0x3ab8c4[_0x3c71('0x29')]=_[_0x3c71('0x2a')](_0x1509c5[_0x3c71('0x29')]);_0x3ab8c4['filters']=_['intersection'](_0x3ab8c4[_0x3c71('0x2d')],_0x3ab8c4[_0x3c71('0x29')]);_0x13cb3b[_0x3c71('0x2e')]=_[_0x3c71('0x2c')](_0x3ab8c4[_0x3c71('0x2d')],qs[_0x3c71('0x2f')](_0x1509c5[_0x3c71('0x29')][_0x3c71('0x2f')]));_0x13cb3b[_0x3c71('0x2e')]=_0x13cb3b[_0x3c71('0x2e')][_0x3c71('0x30')]?_0x13cb3b['attributes']:_0x3ab8c4[_0x3c71('0x2d')];if(_0x1509c5[_0x3c71('0x29')]['includeAll']){_0x13cb3b[_0x3c71('0x41')]=[{'all':!![]}];}_0x13cb3b=_['merge']({},_0x13cb3b,_0x1509c5[_0x3c71('0x39')]);return db[_0x3c71('0x3a')][_0x3c71('0x42')](_0x13cb3b)[_0x3c71('0x21')](handleEntityNotFound(_0x3d875f,null))[_0x3c71('0x21')](respondWithResult(_0x3d875f,null))[_0x3c71('0x3e')](handleError(_0x3d875f,null));};exports['create']=function(_0x13ec82,_0x25e32e){return db['ZohoAccount'][_0x3c71('0x43')](_0x13ec82[_0x3c71('0x44')],{})[_0x3c71('0x21')](respondWithResult(_0x25e32e,0xc9))[_0x3c71('0x3e')](handleError(_0x25e32e,null));};exports['update']=function(_0x1b5a0e,_0x4a5f85){if(_0x1b5a0e['body']['id']){delete _0x1b5a0e[_0x3c71('0x44')]['id'];}return db[_0x3c71('0x3a')][_0x3c71('0x42')]({'where':{'id':_0x1b5a0e[_0x3c71('0x40')]['id']}})[_0x3c71('0x21')](handleEntityNotFound(_0x4a5f85,null))[_0x3c71('0x21')](saveUpdates(_0x1b5a0e[_0x3c71('0x44')],null))[_0x3c71('0x21')](respondWithResult(_0x4a5f85,null))['catch'](handleError(_0x4a5f85,null));};exports[_0x3c71('0x20')]=function(_0x3c7ffa,_0x123036){return db['ZohoAccount'][_0x3c71('0x42')]({'where':{'id':_0x3c7ffa[_0x3c71('0x40')]['id']}})['then'](handleEntityNotFound(_0x123036,null))[_0x3c71('0x21')](removeEntity(_0x123036,null))[_0x3c71('0x3e')](handleError(_0x123036,null));};exports['getConfigurations']=function(_0xf9dba1,_0x245952,_0x330c32){var _0x12c09e={};var _0x307d14={};var _0x138e42;var _0x14abb7;return db[_0x3c71('0x3a')][_0x3c71('0x45')]({'where':{'id':_0xf9dba1[_0x3c71('0x40')]['id']}})[_0x3c71('0x21')](handleEntityNotFound(_0x245952,null))[_0x3c71('0x21')](function(_0x3afd10){if(_0x3afd10){_0x138e42=_0x3afd10;_0x307d14[_0x3c71('0x2d')]=_[_0x3c71('0x2a')](db[_0x3c71('0x46')]['rawAttributes']);_0x307d14[_0x3c71('0x29')]=_[_0x3c71('0x2a')](_0xf9dba1[_0x3c71('0x29')]);_0x307d14[_0x3c71('0x2b')]=_['intersection'](_0x307d14['model'],_0x307d14[_0x3c71('0x29')]);_0x12c09e[_0x3c71('0x2e')]=_[_0x3c71('0x2c')](_0x307d14[_0x3c71('0x2d')],qs[_0x3c71('0x2f')](_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x2f')]));_0x12c09e[_0x3c71('0x2e')]=_0x12c09e[_0x3c71('0x2e')][_0x3c71('0x30')]?_0x12c09e[_0x3c71('0x2e')]:_0x307d14[_0x3c71('0x2d')];_0x12c09e['order']=qs[_0x3c71('0x34')](_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x34')]);_0x12c09e['where']=qs[_0x3c71('0x2b')](_[_0x3c71('0x36')](_0xf9dba1[_0x3c71('0x29')],_0x307d14[_0x3c71('0x2b')]));if(_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x37')]){_0x12c09e[_0x3c71('0x35')]=_[_0x3c71('0x38')](_0x12c09e['where'],{'$or':_[_0x3c71('0x25')](_0x12c09e['attributes'],function(_0x53f809){var _0x11689b={};_0x11689b[_0x53f809]={'$like':'%'+_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x37')]+'%'};return _0x11689b;})});}_0x12c09e=_[_0x3c71('0x38')]({},_0x12c09e,_0xf9dba1[_0x3c71('0x39')]);return _0x138e42['getConfigurations'](_0x12c09e);}})[_0x3c71('0x21')](function(_0x5e6f6f){if(_0x5e6f6f){_0x14abb7=_0x5e6f6f[_0x3c71('0x30')];if(!_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x31')](_0x3c71('0x32'))){_0x12c09e['limit']=qs[_0x3c71('0x19')](_0xf9dba1['query'][_0x3c71('0x19')]);_0x12c09e[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0xf9dba1[_0x3c71('0x29')][_0x3c71('0x17')]);}return _0x138e42[_0x3c71('0x47')](_0x12c09e);}})['then'](function(_0x12ef5a){if(_0x12ef5a){return _0x12ef5a?{'count':_0x14abb7,'rows':_0x12ef5a}:null;}})[_0x3c71('0x21')](respondWithResult(_0x245952,null))[_0x3c71('0x3e')](handleError(_0x245952,null));};exports[_0x3c71('0x48')]=function(_0x203104,_0x2d622a,_0xc396e){if(_0x203104[_0x3c71('0x44')]['id']){delete _0x203104[_0x3c71('0x44')]['id'];}return db[_0x3c71('0x3a')][_0x3c71('0x45')]({'where':{'id':_0x203104[_0x3c71('0x40')]['id']}})[_0x3c71('0x21')](handleEntityNotFound(_0x2d622a,null))[_0x3c71('0x21')](function(_0xaf5f63){if(_0xaf5f63){_0x203104[_0x3c71('0x44')][_0x3c71('0x49')]=_0xaf5f63['id'];_0x203104[_0x3c71('0x44')][_0x3c71('0x4a')]=integrations['getSubjects'](_0x203104[_0x3c71('0x44')]['channel'],_0x203104[_0x3c71('0x44')][_0x3c71('0x4b')]);_0x203104[_0x3c71('0x44')]['Descriptions']=integrations['getDescriptions'](_0x203104[_0x3c71('0x44')][_0x3c71('0x4c')],_0x203104['body'][_0x3c71('0x4b')]);return db[_0x3c71('0x46')][_0x3c71('0x43')](_0x203104['body'],{'include':[{'model':db[_0x3c71('0x4d')],'as':_0x3c71('0x4a')},{'model':db[_0x3c71('0x4d')],'as':_0x3c71('0x4e')}]});}return null;})[_0x3c71('0x21')](respondWithResult(_0x2d622a,null))['catch'](handleError(_0x2d622a,null));};function getAccessToken(_0x4fabaf){return new Promise(function(_0x2dbbf5,_0x1cf2b5){var _0x11cb54;switch(_0x4fabaf[_0x3c71('0x4f')]){case'US':_0x11cb54=_0x3c71('0x50');break;case'AU':_0x11cb54=_0x3c71('0x51');break;case'EU':_0x11cb54=_0x3c71('0x52');break;case'IN':_0x11cb54=_0x3c71('0x53');break;case'CN':_0x11cb54=_0x3c71('0x54');break;default:_0x11cb54=_0x3c71('0x52');break;}var _0x42cc2f={'method':_0x3c71('0x55'),'uri':_0x11cb54+_0x3c71('0x56'),'qs':{'refresh_token':_0x4fabaf[_0x3c71('0x57')],'client_id':_0x4fabaf[_0x3c71('0x58')],'client_secret':_0x4fabaf[_0x3c71('0x59')],'grant_type':_0x3c71('0x5a')},'json':!![]};return rp(_0x42cc2f)['then'](function(_0x469b4f){if(_0x469b4f[_0x3c71('0x5b')]){_0x2dbbf5(_0x469b4f['access_token']);}else{_0x1cf2b5(_0x3c71('0x5c'));}})[_0x3c71('0x3e')](function(_0x2e2ace){_0x1cf2b5(_0x2e2ace);});});}exports[_0x3c71('0x5d')]=function(_0x14820b,_0x573a0a,_0x2a6d46){var _0x313d7c,_0x12cff1,_0x7dff0d,_0x4a95e5,_0x8fde8;return db[_0x3c71('0x3a')][_0x3c71('0x45')]({'where':{'id':_0x14820b[_0x3c71('0x40')]['id']},'attributes':['id','host',_0x3c71('0x4f'),'clientId',_0x3c71('0x59'),'serverUrl',_0x3c71('0x5e'),_0x3c71('0x57')]})[_0x3c71('0x21')](handleEntityNotFound(_0x573a0a,null))[_0x3c71('0x21')](function(_0x503d47){_0x8fde8=_0x503d47;_0x313d7c=_0x8fde8[_0x3c71('0x5f')];_0x12cff1=_0x313d7c===_0x3c71('0x60')?'eu':_0x3c71('0x61');_0x7dff0d=_0x8fde8[_0x3c71('0x62')];var _0x2e97cc=_0x7dff0d[_0x3c71('0x63')](-0x1);if(_0x2e97cc==='/'||_0x2e97cc==='\x5c'||_0x2e97cc===':'){_0x7dff0d=_0x7dff0d[_0x3c71('0x64')](0x0,_0x7dff0d[_0x3c71('0x65')](_0x2e97cc));}if(!_0x8fde8['refreshToken']){throw new Error(_0x3c71('0x66'));}return getAccessToken(_0x8fde8);})[_0x3c71('0x21')](function(_0x574e71){if(_0x574e71){return rp({'method':_0x3c71('0x67'),'uri':util[_0x3c71('0x68')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x12cff1),'qs':{'module':_0x3c71('0x69')},'headers':{'Authorization':_0x3c71('0x6a')+_0x574e71},'json':!![]});}})['then'](function(_0x14b14e){if(_0x14b14e){if(_0x14b14e['response']&&_0x14b14e['response'][_0x3c71('0x6b')]){throw new Error(_0x14b14e[_0x3c71('0x6c')]['error'][_0x3c71('0x6d')]);}var _0x58dc4b=[];var _0x586d01=[];var _0x4e8c19=[_0x3c71('0x6e'),_0x3c71('0x6f'),_0x3c71('0x70'),'WhoId',_0x3c71('0x71'),_0x3c71('0x72'),_0x3c71('0x73'),'Call_Type'];_0x586d01=_[_0x3c71('0x74')](_0x14b14e[_0x3c71('0x2f')],function(_0x4c59b7){return _0x4e8c19[_0x3c71('0x75')](_0x4c59b7['api_name']);});for(var _0x51d00f=0x0;_0x51d00f<_0x586d01[_0x3c71('0x30')];_0x51d00f++){if(_0x586d01[_0x51d00f][_0x3c71('0x76')]===![]){_0x58dc4b[_0x3c71('0x77')]({'id':_0x586d01[_0x51d00f]['id'],'name':_0x586d01[_0x51d00f][_0x3c71('0x78')],'custom':_0x586d01[_0x51d00f][_0x3c71('0x79')],'options':_0x586d01[_0x51d00f][_0x3c71('0x7a')]==='picklist'&&_0x586d01[_0x51d00f]['pick_list_values'][_0x3c71('0x30')]>-0x1?_[_0x3c71('0x25')](_0x586d01[_0x51d00f][_0x3c71('0x7b')],function(_0x8105a){return{'name':_0x8105a,'value':_0x8105a};}):[]});}}return{'count':_0x58dc4b['length'],'rows':_0x58dc4b};}else{return{'count':0x0,'rows':[]};}})[_0x3c71('0x21')](respondWithResult(_0x573a0a,null))[_0x3c71('0x3e')](function(_0x17805d){var _0x4e0488=_0x14820b[_0x3c71('0x29')][_0x3c71('0x7c')]?0x1f4:_0x17805d['statusCode']||0x1f4;logger[_0x3c71('0x6b')](_0x3c71('0x7d'),_0x3c71('0x5d'),_0x4e0488,JSON[_0x3c71('0x7e')](_0x17805d));delete _0x17805d[_0x3c71('0x23')];if(_0x4e0488===0x191){_0x4e0488=0x190;}_0x573a0a[_0x3c71('0x14')](_0x4e0488)['send'](_0x14820b[_0x3c71('0x29')][_0x3c71('0x7c')]?{'message':_0x3c71('0x7f'),'statusCode':_0x17805d[_0x3c71('0x80')]}:_0x17805d);});}; \ No newline at end of file +var _0x9324=['Owner','Call_Duration','Call_Result','Call_Start_Time','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','name','send','index','ZohoAccount','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','rawAttributes','fields','includeAll','find','create','body','catch','update','params','findOne','ZohoConfiguration','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','code','zoho.eu','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message'];(function(_0x3c2a6e,_0x1136b1){var _0x1795ad=function(_0x3979fb){while(--_0x3979fb){_0x3c2a6e['push'](_0x3c2a6e['shift']());}};_0x1795ad(++_0x1136b1);}(_0x9324,0x101));var _0x4932=function(_0x8e72b4,_0x3a8c7e){_0x8e72b4=_0x8e72b4-0x0;var _0x523ced=_0x9324[_0x8e72b4];return _0x523ced;};'use strict';var emlformat=require(_0x4932('0x0'));var rimraf=require(_0x4932('0x1'));var zipdir=require(_0x4932('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4932('0x3'));var BPromise=require(_0x4932('0x4'));var Mustache=require('mustache');var util=require(_0x4932('0x5'));var path=require('path');var sox=require(_0x4932('0x6'));var csv=require(_0x4932('0x7'));var ejs=require(_0x4932('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4932('0x9'));var squel=require(_0x4932('0xa'));var crypto=require(_0x4932('0xb'));var jsforce=require(_0x4932('0xc'));var deskjs=require(_0x4932('0xd'));var toCsv=require(_0x4932('0x7'));var querystring=require(_0x4932('0xe'));var Papa=require(_0x4932('0xf'));var Redis=require('ioredis');var authService=require(_0x4932('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4932('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4932('0x12'))('api');var utils=require(_0x4932('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4932('0x14'));var db=require(_0x4932('0x15'))['db'];var integrations=require(_0x4932('0x16'));function respondWithStatusCode(_0x29a34f,_0x590cc9){_0x590cc9=_0x590cc9||0xcc;return function(_0xbd480a){if(_0xbd480a){return _0x29a34f[_0x4932('0x17')](_0x590cc9);}return _0x29a34f[_0x4932('0x18')](_0x590cc9)['end']();};}function respondWithResult(_0x2cbb70,_0x5d82fe){_0x5d82fe=_0x5d82fe||0xc8;return function(_0xf1d838){if(_0xf1d838){return _0x2cbb70['status'](_0x5d82fe)['json'](_0xf1d838);}};}function respondWithFilteredResult(_0x254913,_0x38d1ae){return function(_0x1c3fc1){if(_0x1c3fc1){var _0x38bc8e=typeof _0x38d1ae[_0x4932('0x19')]===_0x4932('0x1a')&&typeof _0x38d1ae[_0x4932('0x1b')]==='undefined';var _0xb666cf=_0x1c3fc1[_0x4932('0x1c')];var _0x5ccabf=_0x38bc8e?0x0:_0x38d1ae[_0x4932('0x19')];var _0x23a0fd=_0x38bc8e?_0x1c3fc1[_0x4932('0x1c')]:_0x38d1ae[_0x4932('0x19')]+_0x38d1ae[_0x4932('0x1b')];var _0x352743;if(_0x23a0fd>=_0xb666cf){_0x23a0fd=_0xb666cf;_0x352743=0xc8;}else{_0x352743=0xce;}_0x254913[_0x4932('0x18')](_0x352743);return _0x254913[_0x4932('0x1d')](_0x4932('0x1e'),_0x5ccabf+'-'+_0x23a0fd+'/'+_0xb666cf)[_0x4932('0x1f')](_0x1c3fc1);}return null;};}function patchUpdates(_0x307271){return function(_0x5e9084){try{jsonpatch['apply'](_0x5e9084,_0x307271,!![]);}catch(_0x3f7b8d){return BPromise[_0x4932('0x20')](_0x3f7b8d);}return _0x5e9084[_0x4932('0x21')]();};}function saveUpdates(_0x11d6da,_0x29ed4b){return function(_0x41b6c0){if(_0x41b6c0){return _0x41b6c0['update'](_0x11d6da)['then'](function(_0x2751b4){return _0x2751b4;});}return null;};}function removeEntity(_0x2aec8d,_0x3094e4){return function(_0x2a8189){if(_0x2a8189){return _0x2a8189[_0x4932('0x22')]()[_0x4932('0x23')](function(){_0x2aec8d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3eae,_0x377ad3){return function(_0x4cf085){if(!_0x4cf085){_0x5b3eae[_0x4932('0x17')](0x194);}return _0x4cf085;};}function handleError(_0x8b9ccf,_0x3d5686){_0x3d5686=_0x3d5686||0x1f4;return function(_0x2cc7ad){logger[_0x4932('0x24')](_0x2cc7ad['stack']);if(_0x2cc7ad['name']){delete _0x2cc7ad[_0x4932('0x25')];}_0x8b9ccf['status'](_0x3d5686)[_0x4932('0x26')](_0x2cc7ad);};}exports[_0x4932('0x27')]=function(_0x44330d,_0xba8dc5){var _0x27f739={},_0x7dbfc3={},_0xc109bd={'count':0x0,'rows':[]};var _0x293415=_['map'](db[_0x4932('0x28')]['rawAttributes'],function(_0x49ddb9){return{'name':_0x49ddb9['fieldName'],'type':_0x49ddb9[_0x4932('0x29')]['key']};});_0x7dbfc3[_0x4932('0x2a')]=_[_0x4932('0x2b')](_0x293415,_0x4932('0x25'));_0x7dbfc3[_0x4932('0x2c')]=_[_0x4932('0x2d')](_0x44330d['query']);_0x7dbfc3[_0x4932('0x2e')]=_['intersection'](_0x7dbfc3[_0x4932('0x2a')],_0x7dbfc3['query']);_0x27f739['attributes']=_[_0x4932('0x2f')](_0x7dbfc3[_0x4932('0x2a')],qs['fields'](_0x44330d[_0x4932('0x2c')]['fields']));_0x27f739[_0x4932('0x30')]=_0x27f739[_0x4932('0x30')][_0x4932('0x31')]?_0x27f739[_0x4932('0x30')]:_0x7dbfc3[_0x4932('0x2a')];if(!_0x44330d['query'][_0x4932('0x32')](_0x4932('0x33'))){_0x27f739[_0x4932('0x1b')]=qs[_0x4932('0x1b')](_0x44330d[_0x4932('0x2c')]['limit']);_0x27f739[_0x4932('0x19')]=qs[_0x4932('0x19')](_0x44330d['query']['offset']);}_0x27f739[_0x4932('0x34')]=qs[_0x4932('0x35')](_0x44330d[_0x4932('0x2c')][_0x4932('0x35')]);_0x27f739[_0x4932('0x36')]=qs[_0x4932('0x2e')](_[_0x4932('0x37')](_0x44330d[_0x4932('0x2c')],_0x7dbfc3[_0x4932('0x2e')]),_0x293415);if(_0x44330d['query'][_0x4932('0x38')]){_0x27f739['where']=_[_0x4932('0x39')](_0x27f739['where'],{'$or':_[_0x4932('0x2b')](_0x293415,function(_0x9a8f5c){if(_0x9a8f5c[_0x4932('0x29')]!==_0x4932('0x3a')){var _0x2e8de3={};_0x2e8de3[_0x9a8f5c[_0x4932('0x25')]]={'$like':'%'+_0x44330d[_0x4932('0x2c')][_0x4932('0x38')]+'%'};return _0x2e8de3;}})});}_0x27f739=_[_0x4932('0x39')]({},_0x27f739,_0x44330d[_0x4932('0x3b')]);var _0x43aff3={'where':_0x27f739['where']};return db[_0x4932('0x28')]['count'](_0x43aff3)[_0x4932('0x23')](function(_0x22197a){_0xc109bd[_0x4932('0x1c')]=_0x22197a;if(_0x44330d[_0x4932('0x2c')]['includeAll']){_0x27f739[_0x4932('0x3c')]=[{'all':!![]}];}return db[_0x4932('0x28')][_0x4932('0x3d')](_0x27f739);})[_0x4932('0x23')](function(_0x1502d5){_0xc109bd['rows']=_0x1502d5;return _0xc109bd;})[_0x4932('0x23')](respondWithFilteredResult(_0xba8dc5,_0x27f739))['catch'](handleError(_0xba8dc5,null));};exports[_0x4932('0x3e')]=function(_0x265135,_0x39f5c3){var _0x3ca3df={'raw':![],'where':{'id':_0x265135['params']['id']}},_0x507f6f={};_0x507f6f[_0x4932('0x2a')]=_[_0x4932('0x2d')](db[_0x4932('0x28')][_0x4932('0x3f')]);_0x507f6f[_0x4932('0x2c')]=_[_0x4932('0x2d')](_0x265135[_0x4932('0x2c')]);_0x507f6f[_0x4932('0x2e')]=_[_0x4932('0x2f')](_0x507f6f[_0x4932('0x2a')],_0x507f6f[_0x4932('0x2c')]);_0x3ca3df[_0x4932('0x30')]=_[_0x4932('0x2f')](_0x507f6f['model'],qs[_0x4932('0x40')](_0x265135[_0x4932('0x2c')][_0x4932('0x40')]));_0x3ca3df[_0x4932('0x30')]=_0x3ca3df[_0x4932('0x30')][_0x4932('0x31')]?_0x3ca3df['attributes']:_0x507f6f[_0x4932('0x2a')];if(_0x265135[_0x4932('0x2c')][_0x4932('0x41')]){_0x3ca3df[_0x4932('0x3c')]=[{'all':!![]}];}_0x3ca3df=_[_0x4932('0x39')]({},_0x3ca3df,_0x265135[_0x4932('0x3b')]);return db[_0x4932('0x28')][_0x4932('0x42')](_0x3ca3df)[_0x4932('0x23')](handleEntityNotFound(_0x39f5c3,null))[_0x4932('0x23')](respondWithResult(_0x39f5c3,null))['catch'](handleError(_0x39f5c3,null));};exports[_0x4932('0x43')]=function(_0xe1011e,_0x4cf4ce){return db[_0x4932('0x28')][_0x4932('0x43')](_0xe1011e[_0x4932('0x44')],{})[_0x4932('0x23')](respondWithResult(_0x4cf4ce,0xc9))[_0x4932('0x45')](handleError(_0x4cf4ce,null));};exports[_0x4932('0x46')]=function(_0x908e6c,_0x5c5e48){if(_0x908e6c[_0x4932('0x44')]['id']){delete _0x908e6c[_0x4932('0x44')]['id'];}return db[_0x4932('0x28')][_0x4932('0x42')]({'where':{'id':_0x908e6c['params']['id']}})[_0x4932('0x23')](handleEntityNotFound(_0x5c5e48,null))['then'](saveUpdates(_0x908e6c[_0x4932('0x44')],null))[_0x4932('0x23')](respondWithResult(_0x5c5e48,null))[_0x4932('0x45')](handleError(_0x5c5e48,null));};exports[_0x4932('0x22')]=function(_0xfcd82,_0x6de13a){return db['ZohoAccount'][_0x4932('0x42')]({'where':{'id':_0xfcd82[_0x4932('0x47')]['id']}})[_0x4932('0x23')](handleEntityNotFound(_0x6de13a,null))[_0x4932('0x23')](removeEntity(_0x6de13a,null))['catch'](handleError(_0x6de13a,null));};exports['getConfigurations']=function(_0x400648,_0x5076b1,_0x56491c){var _0x3620fc={};var _0x39e109={};var _0x1a692e;var _0x21e08e;return db[_0x4932('0x28')][_0x4932('0x48')]({'where':{'id':_0x400648[_0x4932('0x47')]['id']}})[_0x4932('0x23')](handleEntityNotFound(_0x5076b1,null))[_0x4932('0x23')](function(_0xff37c3){if(_0xff37c3){_0x1a692e=_0xff37c3;_0x39e109[_0x4932('0x2a')]=_[_0x4932('0x2d')](db[_0x4932('0x49')][_0x4932('0x3f')]);_0x39e109[_0x4932('0x2c')]=_[_0x4932('0x2d')](_0x400648[_0x4932('0x2c')]);_0x39e109['filters']=_[_0x4932('0x2f')](_0x39e109[_0x4932('0x2a')],_0x39e109[_0x4932('0x2c')]);_0x3620fc['attributes']=_[_0x4932('0x2f')](_0x39e109[_0x4932('0x2a')],qs['fields'](_0x400648['query'][_0x4932('0x40')]));_0x3620fc[_0x4932('0x30')]=_0x3620fc[_0x4932('0x30')][_0x4932('0x31')]?_0x3620fc[_0x4932('0x30')]:_0x39e109[_0x4932('0x2a')];_0x3620fc[_0x4932('0x34')]=qs[_0x4932('0x35')](_0x400648[_0x4932('0x2c')][_0x4932('0x35')]);_0x3620fc['where']=qs[_0x4932('0x2e')](_[_0x4932('0x37')](_0x400648[_0x4932('0x2c')],_0x39e109['filters']));if(_0x400648[_0x4932('0x2c')][_0x4932('0x38')]){_0x3620fc['where']=_[_0x4932('0x39')](_0x3620fc[_0x4932('0x36')],{'$or':_[_0x4932('0x2b')](_0x3620fc[_0x4932('0x30')],function(_0x313084){var _0x32955e={};_0x32955e[_0x313084]={'$like':'%'+_0x400648['query']['filter']+'%'};return _0x32955e;})});}_0x3620fc=_[_0x4932('0x39')]({},_0x3620fc,_0x400648[_0x4932('0x3b')]);return _0x1a692e[_0x4932('0x4a')](_0x3620fc);}})['then'](function(_0x296aa9){if(_0x296aa9){_0x21e08e=_0x296aa9[_0x4932('0x31')];if(!_0x400648[_0x4932('0x2c')][_0x4932('0x32')](_0x4932('0x33'))){_0x3620fc['limit']=qs[_0x4932('0x1b')](_0x400648['query'][_0x4932('0x1b')]);_0x3620fc[_0x4932('0x19')]=qs['offset'](_0x400648['query']['offset']);}return _0x1a692e[_0x4932('0x4a')](_0x3620fc);}})[_0x4932('0x23')](function(_0x44d039){if(_0x44d039){return _0x44d039?{'count':_0x21e08e,'rows':_0x44d039}:null;}})[_0x4932('0x23')](respondWithResult(_0x5076b1,null))[_0x4932('0x45')](handleError(_0x5076b1,null));};exports['addConfiguration']=function(_0x348f72,_0x380d31,_0x341a67){if(_0x348f72['body']['id']){delete _0x348f72[_0x4932('0x44')]['id'];}return db[_0x4932('0x28')][_0x4932('0x48')]({'where':{'id':_0x348f72['params']['id']}})[_0x4932('0x23')](handleEntityNotFound(_0x380d31,null))['then'](function(_0x3f1271){if(_0x3f1271){_0x348f72['body']['AccountId']=_0x3f1271['id'];_0x348f72[_0x4932('0x44')][_0x4932('0x4b')]=integrations[_0x4932('0x4c')](_0x348f72['body'][_0x4932('0x4d')],_0x348f72['body'][_0x4932('0x29')]);_0x348f72[_0x4932('0x44')][_0x4932('0x4e')]=integrations[_0x4932('0x4f')](_0x348f72['body'][_0x4932('0x4d')],_0x348f72['body']['type']);return db[_0x4932('0x49')][_0x4932('0x43')](_0x348f72[_0x4932('0x44')],{'include':[{'model':db[_0x4932('0x50')],'as':_0x4932('0x4b')},{'model':db[_0x4932('0x50')],'as':_0x4932('0x4e')}]});}return null;})[_0x4932('0x23')](respondWithResult(_0x380d31,null))[_0x4932('0x45')](handleError(_0x380d31,null));};function getAccessToken(_0x5888a9){return new Promise(function(_0x4222e3,_0x13c739){var _0x4668f1;switch(_0x5888a9['zone']){case'US':_0x4668f1=_0x4932('0x51');break;case'AU':_0x4668f1='https://accounts.zoho.com.au';break;case'EU':_0x4668f1='https://accounts.zoho.eu';break;case'IN':_0x4668f1=_0x4932('0x52');break;case'CN':_0x4668f1=_0x4932('0x53');break;default:_0x4668f1='https://accounts.zoho.eu';break;}var _0x13d4ae={'method':_0x4932('0x54'),'uri':_0x4668f1+_0x4932('0x55'),'qs':{'refresh_token':_0x5888a9[_0x4932('0x56')],'client_id':_0x5888a9[_0x4932('0x57')],'client_secret':_0x5888a9[_0x4932('0x58')],'grant_type':_0x4932('0x59')},'json':!![]};return rp(_0x13d4ae)['then'](function(_0x2f0f44){if(_0x2f0f44[_0x4932('0x5a')]){_0x4222e3(_0x2f0f44['access_token']);}else{_0x13c739(_0x4932('0x5b'));}})[_0x4932('0x45')](function(_0x5962b5){_0x13c739(_0x5962b5);});});}exports['getFields']=function(_0x53bb76,_0x254b3d,_0x1b24fe){var _0xf5b4f0,_0x3b50ce,_0x3e2c14,_0x2303c4,_0x3063a0;return db['ZohoAccount'][_0x4932('0x48')]({'where':{'id':_0x53bb76['params']['id']},'attributes':['id',_0x4932('0x5c'),_0x4932('0x5d'),_0x4932('0x57'),'clientSecret',_0x4932('0x5e'),_0x4932('0x5f'),_0x4932('0x56')]})[_0x4932('0x23')](handleEntityNotFound(_0x254b3d,null))[_0x4932('0x23')](function(_0x12f800){_0x3063a0=_0x12f800;_0xf5b4f0=_0x3063a0[_0x4932('0x5c')];_0x3b50ce=_0xf5b4f0===_0x4932('0x60')?'eu':'com';_0x3e2c14=_0x3063a0[_0x4932('0x5e')];var _0x41567c=_0x3e2c14['slice'](-0x1);if(_0x41567c==='/'||_0x41567c==='\x5c'||_0x41567c===':'){_0x3e2c14=_0x3e2c14[_0x4932('0x61')](0x0,_0x3e2c14[_0x4932('0x62')](_0x41567c));}if(!_0x3063a0['refreshToken']){throw new Error(_0x4932('0x63'));}return getAccessToken(_0x3063a0);})[_0x4932('0x23')](function(_0xe47986){if(_0xe47986){return rp({'method':_0x4932('0x64'),'uri':util[_0x4932('0x65')](_0x4932('0x66'),_0x3b50ce),'qs':{'module':_0x4932('0x67')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xe47986},'json':!![]});}})[_0x4932('0x23')](function(_0x46b8ee){if(_0x46b8ee){if(_0x46b8ee[_0x4932('0x68')]&&_0x46b8ee[_0x4932('0x68')][_0x4932('0x24')]){throw new Error(_0x46b8ee['response'][_0x4932('0x24')][_0x4932('0x69')]);}var _0x3fa6d2=[];var _0x14d40a=[];var _0x36f601=[_0x4932('0x6a'),'Subject','Description','WhoId',_0x4932('0x6b'),_0x4932('0x6c'),_0x4932('0x6d'),'Call_Type'];_0x14d40a=_['remove'](_0x46b8ee['fields'],function(_0x36391c){return _0x36f601['includes'](_0x36391c['api_name']);});for(var _0x23555e=0x0;_0x23555e<_0x14d40a[_0x4932('0x31')];_0x23555e++){if(_0x14d40a[_0x23555e][_0x4932('0x6e')]===![]){_0x3fa6d2[_0x4932('0x6f')]({'id':_0x14d40a[_0x23555e]['id'],'name':_0x14d40a[_0x23555e][_0x4932('0x70')],'custom':_0x14d40a[_0x23555e][_0x4932('0x71')],'options':_0x14d40a[_0x23555e][_0x4932('0x72')]===_0x4932('0x73')&&_0x14d40a[_0x23555e][_0x4932('0x74')][_0x4932('0x31')]>-0x1?_[_0x4932('0x2b')](_0x14d40a[_0x23555e][_0x4932('0x74')],function(_0x42c44a){return{'name':_0x42c44a,'value':_0x42c44a};}):[]});}}return{'count':_0x3fa6d2['length'],'rows':_0x3fa6d2};}else{return{'count':0x0,'rows':[]};}})[_0x4932('0x23')](respondWithResult(_0x254b3d,null))[_0x4932('0x45')](function(_0x2e15c3){var _0x31d55e=_0x53bb76[_0x4932('0x2c')][_0x4932('0x75')]?0x1f4:_0x2e15c3[_0x4932('0x76')]||0x1f4;logger[_0x4932('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x4932('0x77'),_0x31d55e,JSON['stringify'](_0x2e15c3));delete _0x2e15c3[_0x4932('0x25')];if(_0x31d55e===0x191){_0x31d55e=0x190;}_0x254b3d[_0x4932('0x18')](_0x31d55e)[_0x4932('0x26')](_0x53bb76['query'][_0x4932('0x75')]?{'message':_0x4932('0x78'),'statusCode':_0x2e15c3[_0x4932('0x76')]}:_0x2e15c3);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c37b0df..f0bfc5d 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 _0x6fcc=['define','ZohoAccount','changed','zone','clientId','clientSecret','code','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','slice','POST','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x281cd3,_0x4a0e3b){var _0x3a6179=function(_0x5bcf89){while(--_0x5bcf89){_0x281cd3['push'](_0x281cd3['shift']());}};_0x3a6179(++_0x4a0e3b);}(_0x6fcc,0xf2));var _0xc6fc=function(_0x218e04,_0x1c52db){_0x218e04=_0x218e04-0x0;var _0xb251f4=_0x6fcc[_0x218e04];return _0xb251f4;};'use strict';var _=require('lodash');var util=require(_0xc6fc('0x0'));var logger=require(_0xc6fc('0x1'))(_0xc6fc('0x2'));var moment=require('moment');var BPromise=require(_0xc6fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6fc('0x4'));var rimraf=require(_0xc6fc('0x5'));var config=require(_0xc6fc('0x6'));var attributes=require(_0xc6fc('0x7'));var integrations=require(_0xc6fc('0x8'));module[_0xc6fc('0x9')]=function(_0x45ef9,_0x3d4ce0){return _0x45ef9[_0xc6fc('0xa')](_0xc6fc('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d842a,_0x5d35f9,_0x29ab7f){if(_0x1d842a[_0xc6fc('0xc')](_0xc6fc('0xd'))||_0x1d842a[_0xc6fc('0xc')]('serverUrl')||_0x1d842a[_0xc6fc('0xc')](_0xc6fc('0xe'))||_0x1d842a[_0xc6fc('0xc')](_0xc6fc('0xf'))||_0x1d842a[_0xc6fc('0xc')](_0xc6fc('0x10'))||_0x1d842a['changed'](_0xc6fc('0x11'))){var _0x262e0f,_0x4d9df5;_0x262e0f=_0x1d842a[_0xc6fc('0x12')];var _0x174a6b=_0x262e0f['slice'](-0x1);if(_0x174a6b==='/'||_0x174a6b==='\x5c'||_0x174a6b===':'){_0x262e0f=_0x262e0f[_0xc6fc('0x13')](0x0,_0x262e0f[_0xc6fc('0x14')](_0x174a6b));}switch(_0x1d842a['zone']){case'US':_0x4d9df5=_0xc6fc('0x15');break;case'AU':_0x4d9df5=_0xc6fc('0x16');break;case'IN':_0x4d9df5=_0xc6fc('0x17');break;case'CN':_0x4d9df5='https://accounts.zoho.com.cn';break;default:_0x4d9df5=_0xc6fc('0x18');break;}var _0x562bb8={'method':'POST','uri':_0x4d9df5+_0xc6fc('0x19'),'form':{'grant_type':_0xc6fc('0x1a'),'client_id':_0x1d842a[_0xc6fc('0xe')],'client_secret':_0x1d842a[_0xc6fc('0xf')],'redirect_uri':_0x1d842a[_0xc6fc('0x12')],'code':_0x1d842a['code']},'headers':{'Content-Type':_0xc6fc('0x1b')}};return rp(_0x562bb8)[_0xc6fc('0x1c')](function(_0x24d238){var _0x3543b4=JSON[_0xc6fc('0x1d')](_0x24d238);if(_0x3543b4[_0xc6fc('0x1e')]){_0x1d842a[_0xc6fc('0x1f')]=_0x3543b4['refresh_token'];logger[_0xc6fc('0x20')](util[_0xc6fc('0x21')](_0xc6fc('0x22'),_0x1d842a[_0xc6fc('0x23')],_0x1d842a['id']));}else{logger[_0xc6fc('0x24')](util[_0xc6fc('0x21')](_0xc6fc('0x25'),_0x1d842a['name'],_0x1d842a['id']),util['inspect'](_0x3543b4,{'showHidden':![],'depth':null}));}return _0x29ab7f(null,_0x5d35f9);})[_0xc6fc('0x26')](function(_0x258ef5){logger[_0xc6fc('0x24')](util[_0xc6fc('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1d842a['name'],_0x1d842a['id']),util[_0xc6fc('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x29ab7f(_0x258ef5);});}else{return _0x29ab7f(null,_0x5d35f9);}},'beforeUpdate':function(_0x3dc001,_0x1d101d,_0x59f58d){if(_0x3dc001['changed'](_0xc6fc('0xd'))||_0x3dc001[_0xc6fc('0xc')](_0xc6fc('0x12'))||_0x3dc001['changed'](_0xc6fc('0xe'))||_0x3dc001['changed'](_0xc6fc('0xf'))||_0x3dc001[_0xc6fc('0xc')](_0xc6fc('0x10'))||_0x3dc001['changed'](_0xc6fc('0x11'))){var _0xd8906f,_0x588d5d;_0xd8906f=_0x3dc001[_0xc6fc('0x12')];var _0x8c4be1=_0xd8906f[_0xc6fc('0x28')](-0x1);if(_0x8c4be1==='/'||_0x8c4be1==='\x5c'||_0x8c4be1===':'){_0xd8906f=_0xd8906f['substring'](0x0,_0xd8906f[_0xc6fc('0x14')](_0x8c4be1));}switch(_0x3dc001[_0xc6fc('0xd')]){case'US':_0x588d5d=_0xc6fc('0x15');break;case'AU':_0x588d5d=_0xc6fc('0x16');break;case'IN':_0x588d5d='https://accounts.zoho.in';break;case'CN':_0x588d5d='https://accounts.zoho.com.cn';break;default:_0x588d5d=_0xc6fc('0x18');break;}var _0x5094a6={'method':_0xc6fc('0x29'),'uri':_0x588d5d+_0xc6fc('0x19'),'form':{'grant_type':_0xc6fc('0x1a'),'client_id':_0x3dc001['clientId'],'client_secret':_0x3dc001[_0xc6fc('0xf')],'redirect_uri':_0x3dc001[_0xc6fc('0x12')],'code':_0x3dc001[_0xc6fc('0x10')]},'headers':{'Content-Type':_0xc6fc('0x1b')}};return rp(_0x5094a6)['then'](function(_0x4934a9){var _0x115e3b=JSON[_0xc6fc('0x1d')](_0x4934a9);if(_0x115e3b[_0xc6fc('0x1e')]){_0x3dc001[_0xc6fc('0x1f')]=_0x115e3b[_0xc6fc('0x1e')];logger['info'](util[_0xc6fc('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3dc001[_0xc6fc('0x23')],_0x3dc001['id']));}else{logger[_0xc6fc('0x24')](util[_0xc6fc('0x21')](_0xc6fc('0x25'),_0x3dc001[_0xc6fc('0x23')],_0x3dc001['id']),util['inspect'](_0x115e3b,{'showHidden':![],'depth':null}));}return _0x59f58d(null,_0x1d101d);})[_0xc6fc('0x26')](function(_0x41be51){logger[_0xc6fc('0x24')](util[_0xc6fc('0x21')](_0xc6fc('0x25'),_0x3dc001[_0xc6fc('0x23')],_0x3dc001['id']),util[_0xc6fc('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x59f58d(_0x41be51);});}else{return _0x59f58d(null,_0x1d101d);}}}});}; \ No newline at end of file +var _0x494d=['api','bluebird','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','error','inspect','refreshToken','info','catch','lodash','util'];(function(_0x4995d0,_0x56829c){var _0x2ed02c=function(_0x5bc4c0){while(--_0x5bc4c0){_0x4995d0['push'](_0x4995d0['shift']());}};_0x2ed02c(++_0x56829c);}(_0x494d,0x7c));var _0xd494=function(_0x3a87aa,_0x58353c){_0x3a87aa=_0x3a87aa-0x0;var _0x1e4f5f=_0x494d[_0x3a87aa];return _0x1e4f5f;};'use strict';var _=require(_0xd494('0x0'));var util=require(_0xd494('0x1'));var logger=require('../../config/logger')(_0xd494('0x2'));var moment=require('moment');var BPromise=require(_0xd494('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd494('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd494('0x5'));var integrations=require(_0xd494('0x6'));module[_0xd494('0x7')]=function(_0x46025e,_0x5c7e8a){return _0x46025e[_0xd494('0x8')](_0xd494('0x9'),attributes,{'tableName':_0xd494('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25f5ef,_0x5c8d86,_0x36e4c9){if(_0x25f5ef[_0xd494('0xb')]('zone')||_0x25f5ef[_0xd494('0xb')](_0xd494('0xc'))||_0x25f5ef['changed'](_0xd494('0xd'))||_0x25f5ef['changed'](_0xd494('0xe'))||_0x25f5ef['changed'](_0xd494('0xf'))||_0x25f5ef[_0xd494('0xb')](_0xd494('0x10'))){var _0xdb980e,_0x1e5783;_0xdb980e=_0x25f5ef[_0xd494('0xc')];var _0x3a68bc=_0xdb980e[_0xd494('0x11')](-0x1);if(_0x3a68bc==='/'||_0x3a68bc==='\x5c'||_0x3a68bc===':'){_0xdb980e=_0xdb980e[_0xd494('0x12')](0x0,_0xdb980e[_0xd494('0x13')](_0x3a68bc));}switch(_0x25f5ef[_0xd494('0x14')]){case'US':_0x1e5783=_0xd494('0x15');break;case'AU':_0x1e5783=_0xd494('0x16');break;case'IN':_0x1e5783=_0xd494('0x17');break;case'CN':_0x1e5783=_0xd494('0x18');break;default:_0x1e5783=_0xd494('0x19');break;}var _0x18a316={'method':_0xd494('0x1a'),'uri':_0x1e5783+_0xd494('0x1b'),'form':{'grant_type':_0xd494('0x1c'),'client_id':_0x25f5ef[_0xd494('0xd')],'client_secret':_0x25f5ef['clientSecret'],'redirect_uri':_0x25f5ef[_0xd494('0xc')],'code':_0x25f5ef[_0xd494('0xf')]},'headers':{'Content-Type':_0xd494('0x1d')}};return rp(_0x18a316)[_0xd494('0x1e')](function(_0x5bd9fe){var _0x39aecf=JSON[_0xd494('0x1f')](_0x5bd9fe);if(_0x39aecf['refresh_token']){_0x25f5ef['refreshToken']=_0x39aecf[_0xd494('0x20')];logger['info'](util[_0xd494('0x21')](_0xd494('0x22'),_0x25f5ef[_0xd494('0x23')],_0x25f5ef['id']));}else{logger['error'](util['format'](_0xd494('0x24'),_0x25f5ef[_0xd494('0x23')],_0x25f5ef['id']),util['inspect'](_0x39aecf,{'showHidden':![],'depth':null}));}return _0x36e4c9(null,_0x5c8d86);})['catch'](function(_0x44633c){logger[_0xd494('0x25')](util[_0xd494('0x21')](_0xd494('0x24'),_0x25f5ef[_0xd494('0x23')],_0x25f5ef['id']),util[_0xd494('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x36e4c9(_0x44633c);});}else{return _0x36e4c9(null,_0x5c8d86);}},'beforeUpdate':function(_0x2c52e4,_0x174936,_0x4c98b5){if(_0x2c52e4['changed'](_0xd494('0x14'))||_0x2c52e4[_0xd494('0xb')]('serverUrl')||_0x2c52e4[_0xd494('0xb')](_0xd494('0xd'))||_0x2c52e4['changed'](_0xd494('0xe'))||_0x2c52e4[_0xd494('0xb')]('code')||_0x2c52e4[_0xd494('0xb')](_0xd494('0x10'))){var _0x5a235c,_0x3aa6bd;_0x5a235c=_0x2c52e4[_0xd494('0xc')];var _0x3578a5=_0x5a235c[_0xd494('0x11')](-0x1);if(_0x3578a5==='/'||_0x3578a5==='\x5c'||_0x3578a5===':'){_0x5a235c=_0x5a235c[_0xd494('0x12')](0x0,_0x5a235c[_0xd494('0x13')](_0x3578a5));}switch(_0x2c52e4[_0xd494('0x14')]){case'US':_0x3aa6bd=_0xd494('0x15');break;case'AU':_0x3aa6bd='https://accounts.zoho.com.au';break;case'IN':_0x3aa6bd=_0xd494('0x17');break;case'CN':_0x3aa6bd=_0xd494('0x18');break;default:_0x3aa6bd=_0xd494('0x19');break;}var _0x46d47c={'method':_0xd494('0x1a'),'uri':_0x3aa6bd+_0xd494('0x1b'),'form':{'grant_type':_0xd494('0x1c'),'client_id':_0x2c52e4[_0xd494('0xd')],'client_secret':_0x2c52e4[_0xd494('0xe')],'redirect_uri':_0x2c52e4[_0xd494('0xc')],'code':_0x2c52e4['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x46d47c)['then'](function(_0x342778){var _0x121f35=JSON[_0xd494('0x1f')](_0x342778);if(_0x121f35[_0xd494('0x20')]){_0x2c52e4[_0xd494('0x27')]=_0x121f35[_0xd494('0x20')];logger[_0xd494('0x28')](util[_0xd494('0x21')](_0xd494('0x22'),_0x2c52e4[_0xd494('0x23')],_0x2c52e4['id']));}else{logger['error'](util[_0xd494('0x21')](_0xd494('0x24'),_0x2c52e4['name'],_0x2c52e4['id']),util[_0xd494('0x26')](_0x121f35,{'showHidden':![],'depth':null}));}return _0x4c98b5(null,_0x174936);})[_0xd494('0x29')](function(_0x51822e){logger[_0xd494('0x25')](util[_0xd494('0x21')](_0xd494('0x24'),_0x2c52e4['name'],_0x2c52e4['id']),util[_0xd494('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x4c98b5(_0x51822e);});}else{return _0x4c98b5(null,_0x174936);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 911c2b8..dcb84e2 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 _0xbf13=['then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','debug','find','ShowZohoAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbf13,0xe2));var _0x3bf1=function(_0x28ce3e,_0x2e6afe){_0x28ce3e=_0x28ce3e-0x0;var _0x479e76=_0xbf13[_0x28ce3e];return _0x479e76;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var moment=require(_0x3bf1('0x2'));var BPromise=require(_0x3bf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bf1('0x4'))['db'];var utils=require(_0x3bf1('0x5'));var logger=require('../../config/logger')(_0x3bf1('0x6'));var config=require(_0x3bf1('0x7'));var jayson=require(_0x3bf1('0x8'));var client=jayson[_0x3bf1('0x9')][_0x3bf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54eada,_0x4d9fa2,_0x4502c5){return new BPromise(function(_0x30bda1,_0x56eb60){return client[_0x3bf1('0xb')](_0x54eada,_0x4502c5)[_0x3bf1('0xc')](function(_0x28906a){logger[_0x3bf1('0xd')](_0x3bf1('0xe'),_0x4d9fa2,_0x3bf1('0xf'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4d9fa2,_0x3bf1('0xf'),JSON[_0x3bf1('0x10')](_0x28906a));if(_0x28906a['error']){if(_0x28906a[_0x3bf1('0x11')]['code']===0x1f4){logger[_0x3bf1('0x11')](_0x3bf1('0xe'),_0x4d9fa2,_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);return _0x56eb60(_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4d9fa2,_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);return _0x30bda1(_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);}else{logger[_0x3bf1('0xd')](_0x3bf1('0xe'),_0x4d9fa2,_0x3bf1('0xf'));_0x30bda1(_0x28906a[_0x3bf1('0x13')][_0x3bf1('0x12')]);}})[_0x3bf1('0x14')](function(_0x260440){logger[_0x3bf1('0x11')](_0x3bf1('0xe'),_0x4d9fa2,_0x260440);_0x56eb60(_0x260440);});});}exports[_0x3bf1('0x15')]=function(_0x5cf15b){var _0x50df9e=this;return new Promise(function(_0x96ad97,_0x2b6fe1){return db[_0x3bf1('0x16')]['findAll']({'raw':_0x5cf15b['options']?_0x5cf15b[_0x3bf1('0x17')][_0x3bf1('0x18')]===undefined?!![]:![]:!![],'where':_0x5cf15b[_0x3bf1('0x17')]?_0x5cf15b[_0x3bf1('0x17')][_0x3bf1('0x19')]||null:null,'attributes':_0x5cf15b[_0x3bf1('0x17')]?_0x5cf15b[_0x3bf1('0x17')][_0x3bf1('0x1a')]||null:null,'limit':_0x5cf15b[_0x3bf1('0x17')]?_0x5cf15b[_0x3bf1('0x17')][_0x3bf1('0x1b')]||null:null,'include':_0x5cf15b['options']?_0x5cf15b['options'][_0x3bf1('0x1c')]?_['map'](_0x5cf15b[_0x3bf1('0x17')]['include'],function(_0x58a2a6){return{'model':db[_0x58a2a6[_0x3bf1('0x1d')]],'as':_0x58a2a6['as'],'attributes':_0x58a2a6[_0x3bf1('0x1a')],'include':_0x58a2a6[_0x3bf1('0x1c')]?_[_0x3bf1('0x1e')](_0x58a2a6[_0x3bf1('0x1c')],function(_0x49bcb5){return{'model':db[_0x49bcb5[_0x3bf1('0x1d')]],'as':_0x49bcb5['as'],'attributes':_0x49bcb5['attributes'],'include':_0x49bcb5[_0x3bf1('0x1c')]?_[_0x3bf1('0x1e')](_0x49bcb5['include'],function(_0x4dc3ce){return{'model':db[_0x4dc3ce[_0x3bf1('0x1d')]],'as':_0x4dc3ce['as'],'attributes':_0x4dc3ce[_0x3bf1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3bf1('0xc')](function(_0x45b204){logger['info'](_0x3bf1('0x15'),_0x5cf15b);logger[_0x3bf1('0x1f')]('GetZohoAccount',_0x5cf15b,JSON[_0x3bf1('0x10')](_0x45b204));_0x96ad97(_0x45b204);})[_0x3bf1('0x14')](function(_0x3bad13){logger[_0x3bf1('0x11')](_0x3bf1('0x15'),_0x3bad13[_0x3bf1('0x12')],_0x5cf15b);_0x2b6fe1(_0x50df9e['error'](0x1f4,_0x3bad13[_0x3bf1('0x12')]));});});};exports['ShowZohoAccount']=function(_0x1c5e7b){var _0x4de023=this;return new Promise(function(_0x57be3c,_0x57c658){return db[_0x3bf1('0x16')][_0x3bf1('0x20')]({'raw':_0x1c5e7b[_0x3bf1('0x17')]?_0x1c5e7b['options'][_0x3bf1('0x18')]===undefined?!![]:![]:!![],'where':_0x1c5e7b[_0x3bf1('0x17')]?_0x1c5e7b[_0x3bf1('0x17')][_0x3bf1('0x19')]||null:null,'attributes':_0x1c5e7b[_0x3bf1('0x17')]?_0x1c5e7b['options']['attributes']||null:null,'include':_0x1c5e7b['options']?_0x1c5e7b[_0x3bf1('0x17')][_0x3bf1('0x1c')]?_['map'](_0x1c5e7b['options'][_0x3bf1('0x1c')],function(_0x26a8ce){return{'model':db[_0x26a8ce['model']],'as':_0x26a8ce['as'],'attributes':_0x26a8ce['attributes'],'include':_0x26a8ce['include']?_[_0x3bf1('0x1e')](_0x26a8ce[_0x3bf1('0x1c')],function(_0x501228){return{'model':db[_0x501228[_0x3bf1('0x1d')]],'as':_0x501228['as'],'attributes':_0x501228[_0x3bf1('0x1a')],'include':_0x501228[_0x3bf1('0x1c')]?_[_0x3bf1('0x1e')](_0x501228[_0x3bf1('0x1c')],function(_0x362a10){return{'model':db[_0x362a10[_0x3bf1('0x1d')]],'as':_0x362a10['as'],'attributes':_0x362a10[_0x3bf1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3bf1('0xc')](function(_0x495d0f){logger[_0x3bf1('0xd')]('ShowZohoAccount',_0x1c5e7b);logger[_0x3bf1('0x1f')](_0x3bf1('0x21'),_0x1c5e7b,JSON[_0x3bf1('0x10')](_0x495d0f));_0x57be3c(_0x495d0f);})[_0x3bf1('0x14')](function(_0x3ab1ba){logger[_0x3bf1('0x11')]('ShowZohoAccount',_0x3ab1ba[_0x3bf1('0x12')],_0x1c5e7b);_0x57c658(_0x4de023['error'](0x1f4,_0x3ab1ba[_0x3bf1('0x12')]));});});}; \ No newline at end of file +var _0xe9ef=['message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','debug','raw','ShowZohoAccount','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46a09e,_0x43b0d2){var _0x5a2807=function(_0xb19144){while(--_0xb19144){_0x46a09e['push'](_0x46a09e['shift']());}};_0x5a2807(++_0x43b0d2);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xe9ef[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var moment=require(_0xfe9e('0x1'));var BPromise=require(_0xfe9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9e('0x4'));var logger=require(_0xfe9e('0x5'))(_0xfe9e('0x6'));var config=require(_0xfe9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe9e('0x8')][_0xfe9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x493722,_0x539d85,_0x1ae09c){return new BPromise(function(_0x51d134,_0x4325a6){return client[_0xfe9e('0xa')](_0x493722,_0x1ae09c)[_0xfe9e('0xb')](function(_0x48cd0b){logger[_0xfe9e('0xc')](_0xfe9e('0xd'),_0x539d85,_0xfe9e('0xe'));logger['debug'](_0xfe9e('0xf'),_0x539d85,'request\x20sent',JSON[_0xfe9e('0x10')](_0x48cd0b));if(_0x48cd0b[_0xfe9e('0x11')]){if(_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x12')]===0x1f4){logger[_0xfe9e('0x11')](_0xfe9e('0xd'),_0x539d85,_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x13')]);return _0x4325a6(_0x48cd0b[_0xfe9e('0x11')]['message']);}logger[_0xfe9e('0x11')](_0xfe9e('0xd'),_0x539d85,_0x48cd0b['error'][_0xfe9e('0x13')]);return _0x51d134(_0x48cd0b[_0xfe9e('0x11')][_0xfe9e('0x13')]);}else{logger[_0xfe9e('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x539d85,'request\x20sent');_0x51d134(_0x48cd0b[_0xfe9e('0x14')][_0xfe9e('0x13')]);}})[_0xfe9e('0x15')](function(_0x30ad77){logger['error'](_0xfe9e('0xd'),_0x539d85,_0x30ad77);_0x4325a6(_0x30ad77);});});}exports[_0xfe9e('0x16')]=function(_0xdf0a3b){var _0x3e18bc=this;return new Promise(function(_0x495344,_0x299d8c){return db[_0xfe9e('0x17')][_0xfe9e('0x18')]({'raw':_0xdf0a3b[_0xfe9e('0x19')]?_0xdf0a3b[_0xfe9e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xdf0a3b['options']?_0xdf0a3b[_0xfe9e('0x19')][_0xfe9e('0x1a')]||null:null,'attributes':_0xdf0a3b[_0xfe9e('0x19')]?_0xdf0a3b[_0xfe9e('0x19')][_0xfe9e('0x1b')]||null:null,'limit':_0xdf0a3b[_0xfe9e('0x19')]?_0xdf0a3b[_0xfe9e('0x19')][_0xfe9e('0x1c')]||null:null,'include':_0xdf0a3b[_0xfe9e('0x19')]?_0xdf0a3b[_0xfe9e('0x19')][_0xfe9e('0x1d')]?_[_0xfe9e('0x1e')](_0xdf0a3b['options'][_0xfe9e('0x1d')],function(_0x269bcb){return{'model':db[_0x269bcb['model']],'as':_0x269bcb['as'],'attributes':_0x269bcb[_0xfe9e('0x1b')],'include':_0x269bcb['include']?_[_0xfe9e('0x1e')](_0x269bcb[_0xfe9e('0x1d')],function(_0x56308e){return{'model':db[_0x56308e[_0xfe9e('0x1f')]],'as':_0x56308e['as'],'attributes':_0x56308e[_0xfe9e('0x1b')],'include':_0x56308e[_0xfe9e('0x1d')]?_[_0xfe9e('0x1e')](_0x56308e[_0xfe9e('0x1d')],function(_0x42f89d){return{'model':db[_0x42f89d[_0xfe9e('0x1f')]],'as':_0x42f89d['as'],'attributes':_0x42f89d[_0xfe9e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfe9e('0xb')](function(_0x3f7228){logger[_0xfe9e('0xc')](_0xfe9e('0x16'),_0xdf0a3b);logger[_0xfe9e('0x20')]('GetZohoAccount',_0xdf0a3b,JSON['stringify'](_0x3f7228));_0x495344(_0x3f7228);})[_0xfe9e('0x15')](function(_0x116b50){logger[_0xfe9e('0x11')](_0xfe9e('0x16'),_0x116b50['message'],_0xdf0a3b);_0x299d8c(_0x3e18bc[_0xfe9e('0x11')](0x1f4,_0x116b50['message']));});});};exports['ShowZohoAccount']=function(_0x4fcc67){var _0x3a8829=this;return new Promise(function(_0x291a49,_0x130f57){return db['ZohoAccount']['find']({'raw':_0x4fcc67[_0xfe9e('0x19')]?_0x4fcc67[_0xfe9e('0x19')][_0xfe9e('0x21')]===undefined?!![]:![]:!![],'where':_0x4fcc67[_0xfe9e('0x19')]?_0x4fcc67[_0xfe9e('0x19')]['where']||null:null,'attributes':_0x4fcc67['options']?_0x4fcc67[_0xfe9e('0x19')][_0xfe9e('0x1b')]||null:null,'include':_0x4fcc67[_0xfe9e('0x19')]?_0x4fcc67[_0xfe9e('0x19')][_0xfe9e('0x1d')]?_[_0xfe9e('0x1e')](_0x4fcc67[_0xfe9e('0x19')][_0xfe9e('0x1d')],function(_0x4f5c40){return{'model':db[_0x4f5c40[_0xfe9e('0x1f')]],'as':_0x4f5c40['as'],'attributes':_0x4f5c40[_0xfe9e('0x1b')],'include':_0x4f5c40[_0xfe9e('0x1d')]?_['map'](_0x4f5c40[_0xfe9e('0x1d')],function(_0xfd3e47){return{'model':db[_0xfd3e47['model']],'as':_0xfd3e47['as'],'attributes':_0xfd3e47['attributes'],'include':_0xfd3e47[_0xfe9e('0x1d')]?_[_0xfe9e('0x1e')](_0xfd3e47[_0xfe9e('0x1d')],function(_0x31a933){return{'model':db[_0x31a933[_0xfe9e('0x1f')]],'as':_0x31a933['as'],'attributes':_0x31a933[_0xfe9e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfe9e('0xb')](function(_0x4d0947){logger['info'](_0xfe9e('0x22'),_0x4fcc67);logger[_0xfe9e('0x20')](_0xfe9e('0x22'),_0x4fcc67,JSON[_0xfe9e('0x10')](_0x4d0947));_0x291a49(_0x4d0947);})[_0xfe9e('0x15')](function(_0x334409){logger[_0xfe9e('0x11')]('ShowZohoAccount',_0x334409[_0xfe9e('0x13')],_0x4fcc67);_0x130f57(_0x3a8829['error'](0x1f4,_0x334409[_0xfe9e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9af2fae..333fb03 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 _0x677b=['/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create'];(function(_0x153546,_0x4f714a){var _0x41295=function(_0x32b2e1){while(--_0x32b2e1){_0x153546['push'](_0x153546['shift']());}};_0x41295(++_0x4f714a);}(_0x677b,0x82));var _0xb677=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x677b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xb677('0x0'));var util=require(_0xb677('0x1'));var path=require('path');var timeout=require(_0xb677('0x2'));var express=require(_0xb677('0x3'));var router=express[_0xb677('0x4')]();var fs_extra=require(_0xb677('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb677('0x6'));var controller=require(_0xb677('0x7'));router[_0xb677('0x8')]('/',auth[_0xb677('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb677('0xa')]);router[_0xb677('0x8')](_0xb677('0xb'),auth[_0xb677('0x9')](),controller[_0xb677('0xc')]);router[_0xb677('0x8')](_0xb677('0xd'),auth[_0xb677('0x9')](),controller[_0xb677('0xe')]);router['get'](_0xb677('0xf'),auth[_0xb677('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xb677('0x9')](),controller[_0xb677('0x10')]);router['put'](_0xb677('0x11'),auth['isAuthenticated'](),controller[_0xb677('0x12')]);router[_0xb677('0x13')](_0xb677('0x11'),auth[_0xb677('0x9')](),controller['destroy']);module[_0xb677('0x14')]=router; \ No newline at end of file +var _0xca9b=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xca9b,0x1e3));var _0xbca9=function(_0x165776,_0x1fc477){_0x165776=_0x165776-0x0;var _0x502f82=_0xca9b[_0x165776];return _0x502f82;};'use strict';var multer=require(_0xbca9('0x0'));var util=require(_0xbca9('0x1'));var path=require(_0xbca9('0x2'));var timeout=require(_0xbca9('0x3'));var express=require(_0xbca9('0x4'));var router=express[_0xbca9('0x5')]();var fs_extra=require(_0xbca9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbca9('0x7'));var config=require('../../config/environment');var controller=require(_0xbca9('0x8'));router['get']('/',auth[_0xbca9('0x9')](),controller[_0xbca9('0xa')]);router[_0xbca9('0xb')](_0xbca9('0xc'),auth[_0xbca9('0x9')](),controller[_0xbca9('0xd')]);router[_0xbca9('0xb')](_0xbca9('0xe'),auth[_0xbca9('0x9')](),controller[_0xbca9('0xf')]);router[_0xbca9('0xb')](_0xbca9('0x10'),auth[_0xbca9('0x9')](),controller[_0xbca9('0x11')]);router['get'](_0xbca9('0x12'),auth[_0xbca9('0x9')](),controller[_0xbca9('0x13')]);router[_0xbca9('0x14')]('/',auth['isAuthenticated'](),controller[_0xbca9('0x15')]);router[_0xbca9('0x16')]('/:id',auth[_0xbca9('0x9')](),controller[_0xbca9('0x17')]);router['delete'](_0xbca9('0xc'),auth[_0xbca9('0x9')](),controller[_0xbca9('0x18')]);module[_0xbca9('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 89269f2..ff1b42d 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 _0x214c=['contact_lead','sequelize','exports','STRING','lead','contact','nothing','ENUM'];(function(_0x299efe,_0x3576d3){var _0x433c12=function(_0x5420c6){while(--_0x5420c6){_0x299efe['push'](_0x299efe['shift']());}};_0x433c12(++_0x3576d3);}(_0x214c,0x169));var _0xc214=function(_0x200111,_0x548ed1){_0x200111=_0x200111-0x0;var _0x223060=_0x214c[_0x200111];return _0x223060;};'use strict';var Sequelize=require(_0xc214('0x0'));module[_0xc214('0x1')]={'name':{'type':Sequelize[_0xc214('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xc214('0x3'),_0xc214('0x4'),_0xc214('0x5')),'defaultValue':_0xc214('0x3')},'moduleSearch':{'type':Sequelize[_0xc214('0x6')](_0xc214('0x7'),_0xc214('0x4'),_0xc214('0x3')),'defaultValue':_0xc214('0x7')},'description':{'type':Sequelize[_0xc214('0x2')]}}; \ No newline at end of file +var _0x184a=['nothing','ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x2e72cb,_0x1f6be5){var _0x486166=function(_0x455bcc){while(--_0x455bcc){_0x2e72cb['push'](_0x2e72cb['shift']());}};_0x486166(++_0x1f6be5);}(_0x184a,0xdb));var _0xa184=function(_0x1f7e36,_0x4680ab){_0x1f7e36=_0x1f7e36-0x0;var _0x1a71f3=_0x184a[_0x1f7e36];return _0x1a71f3;};'use strict';var Sequelize=require(_0xa184('0x0'));module[_0xa184('0x1')]={'name':{'type':Sequelize[_0xa184('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xa184('0x3'),_0xa184('0x4'),_0xa184('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa184('0x6')](_0xa184('0x7'),_0xa184('0x4'),_0xa184('0x3')),'defaultValue':_0xa184('0x7')},'description':{'type':Sequelize[_0xa184('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1123677..db3a72e 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 _0x3895=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','destroy','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','then','include','findAll','rows','catch','show','includeAll','find','create','body','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5a0dec,_0x5b4855){var _0xff1429=function(_0x13128a){while(--_0x13128a){_0x5a0dec['push'](_0x5a0dec['shift']());}};_0xff1429(++_0x5b4855);}(_0x3895,0xd9));var _0x5389=function(_0x159f6c,_0x3f5415){_0x159f6c=_0x159f6c-0x0;var _0x58ef06=_0x3895[_0x159f6c];return _0x58ef06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5389('0x0'));var zipdir=require(_0x5389('0x1'));var jsonpatch=require(_0x5389('0x2'));var rp=require(_0x5389('0x3'));var moment=require('moment');var BPromise=require(_0x5389('0x4'));var Mustache=require(_0x5389('0x5'));var util=require(_0x5389('0x6'));var path=require(_0x5389('0x7'));var sox=require('sox');var csv=require(_0x5389('0x8'));var ejs=require(_0x5389('0x9'));var fs=require('fs');var fs_extra=require(_0x5389('0xa'));var _=require(_0x5389('0xb'));var squel=require('squel');var crypto=require(_0x5389('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5389('0xd'));var toCsv=require(_0x5389('0x8'));var querystring=require(_0x5389('0xe'));var Papa=require('papaparse');var Redis=require(_0x5389('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5389('0x10'));var as=require(_0x5389('0x11'));var hardwareService=require(_0x5389('0x12'));var logger=require(_0x5389('0x13'))(_0x5389('0x14'));var utils=require(_0x5389('0x15'));var config=require(_0x5389('0x16'));var licenseUtil=require(_0x5389('0x17'));var db=require(_0x5389('0x18'))['db'];function respondWithStatusCode(_0x3de9d0,_0x1ecac6){_0x1ecac6=_0x1ecac6||0xcc;return function(_0x311cd4){if(_0x311cd4){return _0x3de9d0[_0x5389('0x19')](_0x1ecac6);}return _0x3de9d0[_0x5389('0x1a')](_0x1ecac6)[_0x5389('0x1b')]();};}function respondWithResult(_0x50909a,_0x3b5e13){_0x3b5e13=_0x3b5e13||0xc8;return function(_0x3d3e8e){if(_0x3d3e8e){return _0x50909a['status'](_0x3b5e13)['json'](_0x3d3e8e);}};}function respondWithFilteredResult(_0xcb0212,_0x4878a6){return function(_0x2b2dbd){if(_0x2b2dbd){var _0x467bbe=typeof _0x4878a6['offset']===_0x5389('0x1c')&&typeof _0x4878a6[_0x5389('0x1d')]===_0x5389('0x1c');var _0x22332d=_0x2b2dbd[_0x5389('0x1e')];var _0x2355ab=_0x467bbe?0x0:_0x4878a6[_0x5389('0x1f')];var _0x9665c6=_0x467bbe?_0x2b2dbd[_0x5389('0x1e')]:_0x4878a6[_0x5389('0x1f')]+_0x4878a6[_0x5389('0x1d')];var _0x5d09ca;if(_0x9665c6>=_0x22332d){_0x9665c6=_0x22332d;_0x5d09ca=0xc8;}else{_0x5d09ca=0xce;}_0xcb0212[_0x5389('0x1a')](_0x5d09ca);return _0xcb0212[_0x5389('0x20')]('Content-Range',_0x2355ab+'-'+_0x9665c6+'/'+_0x22332d)['json'](_0x2b2dbd);}return null;};}function patchUpdates(_0x3ea7a8){return function(_0x3c3b0c){try{jsonpatch[_0x5389('0x21')](_0x3c3b0c,_0x3ea7a8,!![]);}catch(_0x53a833){return BPromise[_0x5389('0x22')](_0x53a833);}return _0x3c3b0c[_0x5389('0x23')]();};}function saveUpdates(_0x467682,_0x10c2b8){return function(_0x4fc118){if(_0x4fc118){return _0x4fc118[_0x5389('0x24')](_0x467682)['then'](function(_0x5948b5){return _0x5948b5;});}return null;};}function removeEntity(_0x348886,_0x883073){return function(_0x493f41){if(_0x493f41){return _0x493f41[_0x5389('0x25')]()['then'](function(){_0x348886[_0x5389('0x1a')](0xcc)[_0x5389('0x1b')]();});}};}function handleEntityNotFound(_0x3dec47,_0x515685){return function(_0x53ebf7){if(!_0x53ebf7){_0x3dec47[_0x5389('0x19')](0x194);}return _0x53ebf7;};}function handleError(_0x526f97,_0x17aca6){_0x17aca6=_0x17aca6||0x1f4;return function(_0x501c7f){logger['error'](_0x501c7f[_0x5389('0x26')]);if(_0x501c7f[_0x5389('0x27')]){delete _0x501c7f[_0x5389('0x27')];}_0x526f97[_0x5389('0x1a')](_0x17aca6)['send'](_0x501c7f);};}exports[_0x5389('0x28')]=function(_0x9a259c,_0x12be7e){var _0xb94a10={},_0x11107e={},_0x50554b={'count':0x0,'rows':[]};var _0x3bbcf3=_[_0x5389('0x29')](db[_0x5389('0x2a')][_0x5389('0x2b')],function(_0x419ff3){return{'name':_0x419ff3[_0x5389('0x2c')],'type':_0x419ff3['type'][_0x5389('0x2d')]};});_0x11107e['model']=_[_0x5389('0x29')](_0x3bbcf3,_0x5389('0x27'));_0x11107e[_0x5389('0x2e')]=_[_0x5389('0x2f')](_0x9a259c[_0x5389('0x2e')]);_0x11107e['filters']=_[_0x5389('0x30')](_0x11107e[_0x5389('0x31')],_0x11107e[_0x5389('0x2e')]);_0xb94a10['attributes']=_[_0x5389('0x30')](_0x11107e[_0x5389('0x31')],qs[_0x5389('0x32')](_0x9a259c['query']['fields']));_0xb94a10[_0x5389('0x33')]=_0xb94a10[_0x5389('0x33')][_0x5389('0x34')]?_0xb94a10['attributes']:_0x11107e[_0x5389('0x31')];if(!_0x9a259c['query'][_0x5389('0x35')](_0x5389('0x36'))){_0xb94a10[_0x5389('0x1d')]=qs[_0x5389('0x1d')](_0x9a259c[_0x5389('0x2e')][_0x5389('0x1d')]);_0xb94a10[_0x5389('0x1f')]=qs['offset'](_0x9a259c[_0x5389('0x2e')][_0x5389('0x1f')]);}_0xb94a10[_0x5389('0x37')]=qs['sort'](_0x9a259c[_0x5389('0x2e')][_0x5389('0x38')]);_0xb94a10[_0x5389('0x39')]=qs['filters'](_[_0x5389('0x3a')](_0x9a259c[_0x5389('0x2e')],_0x11107e[_0x5389('0x3b')]),_0x3bbcf3);if(_0x9a259c[_0x5389('0x2e')]['filter']){_0xb94a10[_0x5389('0x39')]=_[_0x5389('0x3c')](_0xb94a10[_0x5389('0x39')],{'$or':_[_0x5389('0x29')](_0x3bbcf3,function(_0x594589){if(_0x594589['type']!==_0x5389('0x3d')){var _0xe71fe4={};_0xe71fe4[_0x594589[_0x5389('0x27')]]={'$like':'%'+_0x9a259c[_0x5389('0x2e')][_0x5389('0x3e')]+'%'};return _0xe71fe4;}})});}_0xb94a10=_[_0x5389('0x3c')]({},_0xb94a10,_0x9a259c[_0x5389('0x3f')]);var _0x3efea1={'where':_0xb94a10[_0x5389('0x39')]};return db['ZohoConfiguration']['count'](_0x3efea1)[_0x5389('0x40')](function(_0x3346df){_0x50554b[_0x5389('0x1e')]=_0x3346df;if(_0x9a259c[_0x5389('0x2e')]['includeAll']){_0xb94a10[_0x5389('0x41')]=[{'all':!![]}];}return db[_0x5389('0x2a')][_0x5389('0x42')](_0xb94a10);})[_0x5389('0x40')](function(_0x2267cf){_0x50554b[_0x5389('0x43')]=_0x2267cf;return _0x50554b;})['then'](respondWithFilteredResult(_0x12be7e,_0xb94a10))[_0x5389('0x44')](handleError(_0x12be7e,null));};exports[_0x5389('0x45')]=function(_0x5d3208,_0x5ef4b5){var _0xbf2b7={'raw':![],'where':{'id':_0x5d3208['params']['id']}},_0x8340e8={};_0x8340e8[_0x5389('0x31')]=_[_0x5389('0x2f')](db['ZohoConfiguration'][_0x5389('0x2b')]);_0x8340e8[_0x5389('0x2e')]=_['keys'](_0x5d3208[_0x5389('0x2e')]);_0x8340e8[_0x5389('0x3b')]=_[_0x5389('0x30')](_0x8340e8[_0x5389('0x31')],_0x8340e8[_0x5389('0x2e')]);_0xbf2b7[_0x5389('0x33')]=_[_0x5389('0x30')](_0x8340e8['model'],qs['fields'](_0x5d3208[_0x5389('0x2e')][_0x5389('0x32')]));_0xbf2b7[_0x5389('0x33')]=_0xbf2b7['attributes'][_0x5389('0x34')]?_0xbf2b7[_0x5389('0x33')]:_0x8340e8['model'];if(_0x5d3208[_0x5389('0x2e')][_0x5389('0x46')]){_0xbf2b7['include']=[{'all':!![]}];}_0xbf2b7=_[_0x5389('0x3c')]({},_0xbf2b7,_0x5d3208[_0x5389('0x3f')]);return db['ZohoConfiguration'][_0x5389('0x47')](_0xbf2b7)[_0x5389('0x40')](handleEntityNotFound(_0x5ef4b5,null))['then'](respondWithResult(_0x5ef4b5,null))[_0x5389('0x44')](handleError(_0x5ef4b5,null));};exports[_0x5389('0x48')]=function(_0x5ad2b9,_0x184677){return db['ZohoConfiguration'][_0x5389('0x48')](_0x5ad2b9[_0x5389('0x49')],{})[_0x5389('0x40')](respondWithResult(_0x184677,0xc9))[_0x5389('0x44')](handleError(_0x184677,null));};exports['update']=function(_0x1780df,_0x350a4c){if(_0x1780df['body']['id']){delete _0x1780df[_0x5389('0x49')]['id'];}return db['ZohoConfiguration'][_0x5389('0x47')]({'where':{'id':_0x1780df[_0x5389('0x4a')]['id']}})['then'](handleEntityNotFound(_0x350a4c,null))['then'](saveUpdates(_0x1780df[_0x5389('0x49')],null))[_0x5389('0x40')](respondWithResult(_0x350a4c,null))[_0x5389('0x44')](handleError(_0x350a4c,null));};exports[_0x5389('0x25')]=function(_0x821034,_0x1a2163){return db[_0x5389('0x2a')]['find']({'where':{'id':_0x821034[_0x5389('0x4a')]['id']}})[_0x5389('0x40')](handleEntityNotFound(_0x1a2163,null))[_0x5389('0x40')](removeEntity(_0x1a2163,null))['catch'](handleError(_0x1a2163,null));};exports[_0x5389('0x4b')]=function(_0x317392,_0x22530c,_0x207984){var _0x1841a3={};var _0x18011f={};var _0x134338;var _0x121326;return db[_0x5389('0x2a')][_0x5389('0x4c')]({'where':{'id':_0x317392[_0x5389('0x4a')]['id']}})[_0x5389('0x40')](handleEntityNotFound(_0x22530c,null))['then'](function(_0xa64f7d){if(_0xa64f7d){_0x134338=_0xa64f7d;_0x18011f['model']=_[_0x5389('0x2f')](db[_0x5389('0x4d')]['rawAttributes']);_0x18011f[_0x5389('0x2e')]=_[_0x5389('0x2f')](_0x317392[_0x5389('0x2e')]);_0x18011f['filters']=_[_0x5389('0x30')](_0x18011f['model'],_0x18011f[_0x5389('0x2e')]);_0x1841a3['attributes']=_[_0x5389('0x30')](_0x18011f[_0x5389('0x31')],qs['fields'](_0x317392[_0x5389('0x2e')][_0x5389('0x32')]));_0x1841a3['attributes']=_0x1841a3[_0x5389('0x33')][_0x5389('0x34')]?_0x1841a3[_0x5389('0x33')]:_0x18011f['model'];_0x1841a3[_0x5389('0x37')]=qs[_0x5389('0x38')](_0x317392[_0x5389('0x2e')][_0x5389('0x38')]);_0x1841a3[_0x5389('0x39')]=qs[_0x5389('0x3b')](_['pick'](_0x317392[_0x5389('0x2e')],_0x18011f[_0x5389('0x3b')]));if(_0x317392[_0x5389('0x2e')][_0x5389('0x3e')]){_0x1841a3[_0x5389('0x39')]=_[_0x5389('0x3c')](_0x1841a3[_0x5389('0x39')],{'$or':_[_0x5389('0x29')](_0x1841a3[_0x5389('0x33')],function(_0x25e6d5){var _0x9fe5bf={};_0x9fe5bf[_0x25e6d5]={'$like':'%'+_0x317392[_0x5389('0x2e')][_0x5389('0x3e')]+'%'};return _0x9fe5bf;})});}_0x1841a3=_[_0x5389('0x3c')]({},_0x1841a3,_0x317392[_0x5389('0x3f')]);return _0x134338['getFields'](_0x1841a3);}})[_0x5389('0x40')](function(_0x11c5b6){if(_0x11c5b6){_0x121326=_0x11c5b6[_0x5389('0x34')];if(!_0x317392[_0x5389('0x2e')][_0x5389('0x35')](_0x5389('0x36'))){_0x1841a3['limit']=qs['limit'](_0x317392[_0x5389('0x2e')][_0x5389('0x1d')]);_0x1841a3[_0x5389('0x1f')]=qs[_0x5389('0x1f')](_0x317392[_0x5389('0x2e')][_0x5389('0x1f')]);}return _0x134338['getFields'](_0x1841a3);}})[_0x5389('0x40')](function(_0x57aa1e){if(_0x57aa1e){return _0x57aa1e?{'count':_0x121326,'rows':_0x57aa1e}:null;}})[_0x5389('0x40')](respondWithResult(_0x22530c,null))[_0x5389('0x44')](handleError(_0x22530c,null));};exports[_0x5389('0x4e')]=function(_0x1c596f,_0x25cb84,_0x40d1b2){var _0x3d6a83={};var _0x45a735={};var _0x27e5b2;var _0x5a6a06;return db[_0x5389('0x2a')][_0x5389('0x4c')]({'where':{'id':_0x1c596f[_0x5389('0x4a')]['id']}})[_0x5389('0x40')](handleEntityNotFound(_0x25cb84,null))[_0x5389('0x40')](function(_0x2165cf){if(_0x2165cf){_0x27e5b2=_0x2165cf;_0x45a735[_0x5389('0x31')]=_[_0x5389('0x2f')](db['ZohoField'][_0x5389('0x2b')]);_0x45a735[_0x5389('0x2e')]=_[_0x5389('0x2f')](_0x1c596f[_0x5389('0x2e')]);_0x45a735[_0x5389('0x3b')]=_[_0x5389('0x30')](_0x45a735['model'],_0x45a735[_0x5389('0x2e')]);_0x3d6a83['attributes']=_['intersection'](_0x45a735[_0x5389('0x31')],qs[_0x5389('0x32')](_0x1c596f[_0x5389('0x2e')][_0x5389('0x32')]));_0x3d6a83[_0x5389('0x33')]=_0x3d6a83[_0x5389('0x33')][_0x5389('0x34')]?_0x3d6a83[_0x5389('0x33')]:_0x45a735['model'];_0x3d6a83[_0x5389('0x37')]=qs[_0x5389('0x38')](_0x1c596f[_0x5389('0x2e')]['sort']);_0x3d6a83[_0x5389('0x39')]=qs[_0x5389('0x3b')](_['pick'](_0x1c596f[_0x5389('0x2e')],_0x45a735[_0x5389('0x3b')]));if(_0x1c596f['query']['filter']){_0x3d6a83[_0x5389('0x39')]=_['merge'](_0x3d6a83[_0x5389('0x39')],{'$or':_['map'](_0x3d6a83[_0x5389('0x33')],function(_0x46d0e8){var _0x16b55e={};_0x16b55e[_0x46d0e8]={'$like':'%'+_0x1c596f['query'][_0x5389('0x3e')]+'%'};return _0x16b55e;})});}_0x3d6a83=_[_0x5389('0x3c')]({},_0x3d6a83,_0x1c596f[_0x5389('0x3f')]);return _0x27e5b2['getSubjects'](_0x3d6a83);}})[_0x5389('0x40')](function(_0x270482){if(_0x270482){_0x5a6a06=_0x270482[_0x5389('0x34')];if(!_0x1c596f['query'][_0x5389('0x35')](_0x5389('0x36'))){_0x3d6a83[_0x5389('0x1d')]=qs[_0x5389('0x1d')](_0x1c596f[_0x5389('0x2e')][_0x5389('0x1d')]);_0x3d6a83[_0x5389('0x1f')]=qs[_0x5389('0x1f')](_0x1c596f[_0x5389('0x2e')][_0x5389('0x1f')]);}return _0x27e5b2[_0x5389('0x4e')](_0x3d6a83);}})[_0x5389('0x40')](function(_0x494da2){if(_0x494da2){return _0x494da2?{'count':_0x5a6a06,'rows':_0x494da2}:null;}})[_0x5389('0x40')](respondWithResult(_0x25cb84,null))[_0x5389('0x44')](handleError(_0x25cb84,null));};exports[_0x5389('0x4f')]=function(_0x39ad6a,_0x26e079,_0x241903){var _0x547dc8={};var _0x564d03={};var _0x1fff99;var _0x517f50;return db['ZohoConfiguration'][_0x5389('0x4c')]({'where':{'id':_0x39ad6a[_0x5389('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26e079,null))[_0x5389('0x40')](function(_0x24f693){if(_0x24f693){_0x1fff99=_0x24f693;_0x564d03[_0x5389('0x31')]=_[_0x5389('0x2f')](db[_0x5389('0x4d')]['rawAttributes']);_0x564d03[_0x5389('0x2e')]=_['keys'](_0x39ad6a[_0x5389('0x2e')]);_0x564d03[_0x5389('0x3b')]=_[_0x5389('0x30')](_0x564d03[_0x5389('0x31')],_0x564d03[_0x5389('0x2e')]);_0x547dc8[_0x5389('0x33')]=_['intersection'](_0x564d03['model'],qs[_0x5389('0x32')](_0x39ad6a[_0x5389('0x2e')][_0x5389('0x32')]));_0x547dc8[_0x5389('0x33')]=_0x547dc8['attributes'][_0x5389('0x34')]?_0x547dc8[_0x5389('0x33')]:_0x564d03[_0x5389('0x31')];_0x547dc8['order']=qs[_0x5389('0x38')](_0x39ad6a[_0x5389('0x2e')][_0x5389('0x38')]);_0x547dc8[_0x5389('0x39')]=qs[_0x5389('0x3b')](_[_0x5389('0x3a')](_0x39ad6a['query'],_0x564d03[_0x5389('0x3b')]));if(_0x39ad6a['query']['filter']){_0x547dc8[_0x5389('0x39')]=_[_0x5389('0x3c')](_0x547dc8[_0x5389('0x39')],{'$or':_['map'](_0x547dc8[_0x5389('0x33')],function(_0x250b8c){var _0x3fb932={};_0x3fb932[_0x250b8c]={'$like':'%'+_0x39ad6a['query'][_0x5389('0x3e')]+'%'};return _0x3fb932;})});}_0x547dc8=_[_0x5389('0x3c')]({},_0x547dc8,_0x39ad6a[_0x5389('0x3f')]);return _0x1fff99['getDescriptions'](_0x547dc8);}})[_0x5389('0x40')](function(_0x51bdf4){if(_0x51bdf4){_0x517f50=_0x51bdf4[_0x5389('0x34')];if(!_0x39ad6a[_0x5389('0x2e')][_0x5389('0x35')](_0x5389('0x36'))){_0x547dc8['limit']=qs[_0x5389('0x1d')](_0x39ad6a[_0x5389('0x2e')][_0x5389('0x1d')]);_0x547dc8[_0x5389('0x1f')]=qs[_0x5389('0x1f')](_0x39ad6a['query'][_0x5389('0x1f')]);}return _0x1fff99[_0x5389('0x4f')](_0x547dc8);}})[_0x5389('0x40')](function(_0x3483a1){if(_0x3483a1){return _0x3483a1?{'count':_0x517f50,'rows':_0x3483a1}:null;}})['then'](respondWithResult(_0x26e079,null))[_0x5389('0x44')](handleError(_0x26e079,null));}; \ No newline at end of file +var _0x0bd9=['then','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update'];(function(_0x578a13,_0x4b069f){var _0x325244=function(_0x4c6d41){while(--_0x4c6d41){_0x578a13['push'](_0x578a13['shift']());}};_0x325244(++_0x4b069f);}(_0x0bd9,0x75));var _0x90bd=function(_0x45bc3f,_0x234416){_0x45bc3f=_0x45bc3f-0x0;var _0x530329=_0x0bd9[_0x45bc3f];return _0x530329;};'use strict';var emlformat=require(_0x90bd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x90bd('0x1'));var rp=require(_0x90bd('0x2'));var moment=require(_0x90bd('0x3'));var BPromise=require(_0x90bd('0x4'));var Mustache=require(_0x90bd('0x5'));var util=require(_0x90bd('0x6'));var path=require(_0x90bd('0x7'));var sox=require(_0x90bd('0x8'));var csv=require(_0x90bd('0x9'));var ejs=require(_0x90bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x90bd('0xb'));var deskjs=require(_0x90bd('0xc'));var toCsv=require(_0x90bd('0x9'));var querystring=require(_0x90bd('0xd'));var Papa=require(_0x90bd('0xe'));var Redis=require('ioredis');var authService=require(_0x90bd('0xf'));var qs=require(_0x90bd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90bd('0x11'));var logger=require('../../config/logger')(_0x90bd('0x12'));var utils=require(_0x90bd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x90bd('0x14'));var db=require(_0x90bd('0x15'))['db'];function respondWithStatusCode(_0x1f01d6,_0x76e32){_0x76e32=_0x76e32||0xcc;return function(_0x154870){if(_0x154870){return _0x1f01d6[_0x90bd('0x16')](_0x76e32);}return _0x1f01d6[_0x90bd('0x17')](_0x76e32)[_0x90bd('0x18')]();};}function respondWithResult(_0x277512,_0x4aa29e){_0x4aa29e=_0x4aa29e||0xc8;return function(_0x42ea35){if(_0x42ea35){return _0x277512['status'](_0x4aa29e)[_0x90bd('0x19')](_0x42ea35);}};}function respondWithFilteredResult(_0x63e9db,_0x1b3fa0){return function(_0x48ace7){if(_0x48ace7){var _0x2f1bda=typeof _0x1b3fa0[_0x90bd('0x1a')]==='undefined'&&typeof _0x1b3fa0[_0x90bd('0x1b')]===_0x90bd('0x1c');var _0x58b289=_0x48ace7['count'];var _0x22a929=_0x2f1bda?0x0:_0x1b3fa0['offset'];var _0x280d83=_0x2f1bda?_0x48ace7[_0x90bd('0x1d')]:_0x1b3fa0['offset']+_0x1b3fa0['limit'];var _0x2bca27;if(_0x280d83>=_0x58b289){_0x280d83=_0x58b289;_0x2bca27=0xc8;}else{_0x2bca27=0xce;}_0x63e9db['status'](_0x2bca27);return _0x63e9db['set'](_0x90bd('0x1e'),_0x22a929+'-'+_0x280d83+'/'+_0x58b289)[_0x90bd('0x19')](_0x48ace7);}return null;};}function patchUpdates(_0x83b3f0){return function(_0x24569e){try{jsonpatch['apply'](_0x24569e,_0x83b3f0,!![]);}catch(_0x5d54d2){return BPromise[_0x90bd('0x1f')](_0x5d54d2);}return _0x24569e['save']();};}function saveUpdates(_0x2378f2,_0x1715a3){return function(_0x287855){if(_0x287855){return _0x287855[_0x90bd('0x20')](_0x2378f2)[_0x90bd('0x21')](function(_0x151254){return _0x151254;});}return null;};}function removeEntity(_0x189fbc,_0x1b73ce){return function(_0x2661ea){if(_0x2661ea){return _0x2661ea[_0x90bd('0x22')]()[_0x90bd('0x21')](function(){_0x189fbc[_0x90bd('0x17')](0xcc)[_0x90bd('0x18')]();});}};}function handleEntityNotFound(_0x31309f,_0x2933a0){return function(_0x16c453){if(!_0x16c453){_0x31309f[_0x90bd('0x16')](0x194);}return _0x16c453;};}function handleError(_0x3a4f3a,_0x242e61){_0x242e61=_0x242e61||0x1f4;return function(_0x467f6b){logger['error'](_0x467f6b[_0x90bd('0x23')]);if(_0x467f6b[_0x90bd('0x24')]){delete _0x467f6b[_0x90bd('0x24')];}_0x3a4f3a[_0x90bd('0x17')](_0x242e61)[_0x90bd('0x25')](_0x467f6b);};}exports[_0x90bd('0x26')]=function(_0x3543af,_0xea70bb){var _0xeebb2f={},_0x15a1ad={},_0x300052={'count':0x0,'rows':[]};var _0x159f87=_[_0x90bd('0x27')](db[_0x90bd('0x28')][_0x90bd('0x29')],function(_0x3403c7){return{'name':_0x3403c7['fieldName'],'type':_0x3403c7[_0x90bd('0x2a')]['key']};});_0x15a1ad[_0x90bd('0x2b')]=_['map'](_0x159f87,_0x90bd('0x24'));_0x15a1ad[_0x90bd('0x2c')]=_['keys'](_0x3543af['query']);_0x15a1ad[_0x90bd('0x2d')]=_[_0x90bd('0x2e')](_0x15a1ad[_0x90bd('0x2b')],_0x15a1ad['query']);_0xeebb2f[_0x90bd('0x2f')]=_['intersection'](_0x15a1ad[_0x90bd('0x2b')],qs[_0x90bd('0x30')](_0x3543af[_0x90bd('0x2c')][_0x90bd('0x30')]));_0xeebb2f[_0x90bd('0x2f')]=_0xeebb2f[_0x90bd('0x2f')][_0x90bd('0x31')]?_0xeebb2f[_0x90bd('0x2f')]:_0x15a1ad[_0x90bd('0x2b')];if(!_0x3543af[_0x90bd('0x2c')]['hasOwnProperty'](_0x90bd('0x32'))){_0xeebb2f['limit']=qs['limit'](_0x3543af[_0x90bd('0x2c')][_0x90bd('0x1b')]);_0xeebb2f[_0x90bd('0x1a')]=qs[_0x90bd('0x1a')](_0x3543af['query'][_0x90bd('0x1a')]);}_0xeebb2f[_0x90bd('0x33')]=qs[_0x90bd('0x34')](_0x3543af[_0x90bd('0x2c')][_0x90bd('0x34')]);_0xeebb2f['where']=qs[_0x90bd('0x2d')](_[_0x90bd('0x35')](_0x3543af[_0x90bd('0x2c')],_0x15a1ad[_0x90bd('0x2d')]),_0x159f87);if(_0x3543af['query'][_0x90bd('0x36')]){_0xeebb2f['where']=_[_0x90bd('0x37')](_0xeebb2f[_0x90bd('0x38')],{'$or':_[_0x90bd('0x27')](_0x159f87,function(_0x3c360e){if(_0x3c360e[_0x90bd('0x2a')]!==_0x90bd('0x39')){var _0x2c7d34={};_0x2c7d34[_0x3c360e[_0x90bd('0x24')]]={'$like':'%'+_0x3543af[_0x90bd('0x2c')][_0x90bd('0x36')]+'%'};return _0x2c7d34;}})});}_0xeebb2f=_['merge']({},_0xeebb2f,_0x3543af[_0x90bd('0x3a')]);var _0x40f6af={'where':_0xeebb2f[_0x90bd('0x38')]};return db[_0x90bd('0x28')][_0x90bd('0x1d')](_0x40f6af)[_0x90bd('0x21')](function(_0x2d363d){_0x300052[_0x90bd('0x1d')]=_0x2d363d;if(_0x3543af['query'][_0x90bd('0x3b')]){_0xeebb2f[_0x90bd('0x3c')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xeebb2f);})[_0x90bd('0x21')](function(_0xf1b0c){_0x300052[_0x90bd('0x3d')]=_0xf1b0c;return _0x300052;})[_0x90bd('0x21')](respondWithFilteredResult(_0xea70bb,_0xeebb2f))[_0x90bd('0x3e')](handleError(_0xea70bb,null));};exports[_0x90bd('0x3f')]=function(_0x7b344e,_0x432e43){var _0x4e7393={'raw':![],'where':{'id':_0x7b344e[_0x90bd('0x40')]['id']}},_0x290f98={};_0x290f98[_0x90bd('0x2b')]=_[_0x90bd('0x41')](db[_0x90bd('0x28')]['rawAttributes']);_0x290f98['query']=_[_0x90bd('0x41')](_0x7b344e['query']);_0x290f98['filters']=_[_0x90bd('0x2e')](_0x290f98[_0x90bd('0x2b')],_0x290f98[_0x90bd('0x2c')]);_0x4e7393['attributes']=_[_0x90bd('0x2e')](_0x290f98[_0x90bd('0x2b')],qs[_0x90bd('0x30')](_0x7b344e[_0x90bd('0x2c')][_0x90bd('0x30')]));_0x4e7393['attributes']=_0x4e7393[_0x90bd('0x2f')][_0x90bd('0x31')]?_0x4e7393[_0x90bd('0x2f')]:_0x290f98['model'];if(_0x7b344e[_0x90bd('0x2c')][_0x90bd('0x3b')]){_0x4e7393[_0x90bd('0x3c')]=[{'all':!![]}];}_0x4e7393=_['merge']({},_0x4e7393,_0x7b344e['options']);return db[_0x90bd('0x28')][_0x90bd('0x42')](_0x4e7393)['then'](handleEntityNotFound(_0x432e43,null))['then'](respondWithResult(_0x432e43,null))[_0x90bd('0x3e')](handleError(_0x432e43,null));};exports['create']=function(_0x5c4492,_0x4645f9){return db['ZohoConfiguration'][_0x90bd('0x43')](_0x5c4492[_0x90bd('0x44')],{})[_0x90bd('0x21')](respondWithResult(_0x4645f9,0xc9))[_0x90bd('0x3e')](handleError(_0x4645f9,null));};exports['update']=function(_0x288b58,_0x2f6508){if(_0x288b58['body']['id']){delete _0x288b58[_0x90bd('0x44')]['id'];}return db[_0x90bd('0x28')][_0x90bd('0x42')]({'where':{'id':_0x288b58[_0x90bd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f6508,null))[_0x90bd('0x21')](saveUpdates(_0x288b58['body'],null))[_0x90bd('0x21')](respondWithResult(_0x2f6508,null))['catch'](handleError(_0x2f6508,null));};exports[_0x90bd('0x22')]=function(_0x2404b9,_0x142d6c){return db['ZohoConfiguration']['find']({'where':{'id':_0x2404b9['params']['id']}})[_0x90bd('0x21')](handleEntityNotFound(_0x142d6c,null))[_0x90bd('0x21')](removeEntity(_0x142d6c,null))[_0x90bd('0x3e')](handleError(_0x142d6c,null));};exports[_0x90bd('0x45')]=function(_0x2ff061,_0x561c13,_0x45c18f){var _0x11a198={};var _0x45c476={};var _0x4f9459;var _0xe24ed2;return db[_0x90bd('0x28')][_0x90bd('0x46')]({'where':{'id':_0x2ff061[_0x90bd('0x40')]['id']}})[_0x90bd('0x21')](handleEntityNotFound(_0x561c13,null))[_0x90bd('0x21')](function(_0x5320e6){if(_0x5320e6){_0x4f9459=_0x5320e6;_0x45c476['model']=_['keys'](db[_0x90bd('0x47')][_0x90bd('0x29')]);_0x45c476[_0x90bd('0x2c')]=_[_0x90bd('0x41')](_0x2ff061[_0x90bd('0x2c')]);_0x45c476[_0x90bd('0x2d')]=_[_0x90bd('0x2e')](_0x45c476[_0x90bd('0x2b')],_0x45c476[_0x90bd('0x2c')]);_0x11a198[_0x90bd('0x2f')]=_[_0x90bd('0x2e')](_0x45c476['model'],qs[_0x90bd('0x30')](_0x2ff061[_0x90bd('0x2c')]['fields']));_0x11a198[_0x90bd('0x2f')]=_0x11a198['attributes']['length']?_0x11a198['attributes']:_0x45c476[_0x90bd('0x2b')];_0x11a198['order']=qs['sort'](_0x2ff061[_0x90bd('0x2c')]['sort']);_0x11a198[_0x90bd('0x38')]=qs[_0x90bd('0x2d')](_['pick'](_0x2ff061[_0x90bd('0x2c')],_0x45c476[_0x90bd('0x2d')]));if(_0x2ff061[_0x90bd('0x2c')][_0x90bd('0x36')]){_0x11a198[_0x90bd('0x38')]=_[_0x90bd('0x37')](_0x11a198[_0x90bd('0x38')],{'$or':_[_0x90bd('0x27')](_0x11a198[_0x90bd('0x2f')],function(_0x2024ad){var _0xf3af99={};_0xf3af99[_0x2024ad]={'$like':'%'+_0x2ff061['query']['filter']+'%'};return _0xf3af99;})});}_0x11a198=_['merge']({},_0x11a198,_0x2ff061[_0x90bd('0x3a')]);return _0x4f9459[_0x90bd('0x45')](_0x11a198);}})[_0x90bd('0x21')](function(_0x569801){if(_0x569801){_0xe24ed2=_0x569801[_0x90bd('0x31')];if(!_0x2ff061[_0x90bd('0x2c')][_0x90bd('0x48')](_0x90bd('0x32'))){_0x11a198[_0x90bd('0x1b')]=qs[_0x90bd('0x1b')](_0x2ff061['query'][_0x90bd('0x1b')]);_0x11a198[_0x90bd('0x1a')]=qs['offset'](_0x2ff061[_0x90bd('0x2c')][_0x90bd('0x1a')]);}return _0x4f9459[_0x90bd('0x45')](_0x11a198);}})[_0x90bd('0x21')](function(_0x1aa3f9){if(_0x1aa3f9){return _0x1aa3f9?{'count':_0xe24ed2,'rows':_0x1aa3f9}:null;}})[_0x90bd('0x21')](respondWithResult(_0x561c13,null))['catch'](handleError(_0x561c13,null));};exports[_0x90bd('0x49')]=function(_0x577fcc,_0xac99d8,_0x105267){var _0x3c540e={};var _0x541a78={};var _0x19ef75;var _0x804b79;return db[_0x90bd('0x28')]['findOne']({'where':{'id':_0x577fcc[_0x90bd('0x40')]['id']}})[_0x90bd('0x21')](handleEntityNotFound(_0xac99d8,null))[_0x90bd('0x21')](function(_0x5ed652){if(_0x5ed652){_0x19ef75=_0x5ed652;_0x541a78[_0x90bd('0x2b')]=_[_0x90bd('0x41')](db['ZohoField'][_0x90bd('0x29')]);_0x541a78[_0x90bd('0x2c')]=_['keys'](_0x577fcc[_0x90bd('0x2c')]);_0x541a78[_0x90bd('0x2d')]=_['intersection'](_0x541a78[_0x90bd('0x2b')],_0x541a78['query']);_0x3c540e['attributes']=_[_0x90bd('0x2e')](_0x541a78[_0x90bd('0x2b')],qs['fields'](_0x577fcc[_0x90bd('0x2c')][_0x90bd('0x30')]));_0x3c540e[_0x90bd('0x2f')]=_0x3c540e['attributes'][_0x90bd('0x31')]?_0x3c540e[_0x90bd('0x2f')]:_0x541a78[_0x90bd('0x2b')];_0x3c540e[_0x90bd('0x33')]=qs['sort'](_0x577fcc[_0x90bd('0x2c')][_0x90bd('0x34')]);_0x3c540e[_0x90bd('0x38')]=qs[_0x90bd('0x2d')](_[_0x90bd('0x35')](_0x577fcc[_0x90bd('0x2c')],_0x541a78[_0x90bd('0x2d')]));if(_0x577fcc[_0x90bd('0x2c')][_0x90bd('0x36')]){_0x3c540e['where']=_[_0x90bd('0x37')](_0x3c540e['where'],{'$or':_[_0x90bd('0x27')](_0x3c540e[_0x90bd('0x2f')],function(_0x338cc4){var _0x3d6c9a={};_0x3d6c9a[_0x338cc4]={'$like':'%'+_0x577fcc['query']['filter']+'%'};return _0x3d6c9a;})});}_0x3c540e=_['merge']({},_0x3c540e,_0x577fcc[_0x90bd('0x3a')]);return _0x19ef75[_0x90bd('0x49')](_0x3c540e);}})[_0x90bd('0x21')](function(_0xf5fa1f){if(_0xf5fa1f){_0x804b79=_0xf5fa1f[_0x90bd('0x31')];if(!_0x577fcc[_0x90bd('0x2c')][_0x90bd('0x48')](_0x90bd('0x32'))){_0x3c540e[_0x90bd('0x1b')]=qs['limit'](_0x577fcc[_0x90bd('0x2c')][_0x90bd('0x1b')]);_0x3c540e['offset']=qs['offset'](_0x577fcc[_0x90bd('0x2c')]['offset']);}return _0x19ef75[_0x90bd('0x49')](_0x3c540e);}})['then'](function(_0x190dd3){if(_0x190dd3){return _0x190dd3?{'count':_0x804b79,'rows':_0x190dd3}:null;}})[_0x90bd('0x21')](respondWithResult(_0xac99d8,null))[_0x90bd('0x3e')](handleError(_0xac99d8,null));};exports[_0x90bd('0x4a')]=function(_0x1bff11,_0x1317d1,_0xf98851){var _0x739476={};var _0x4da33b={};var _0x4a2803;var _0x93ace3;return db[_0x90bd('0x28')][_0x90bd('0x46')]({'where':{'id':_0x1bff11[_0x90bd('0x40')]['id']}})[_0x90bd('0x21')](handleEntityNotFound(_0x1317d1,null))[_0x90bd('0x21')](function(_0x517339){if(_0x517339){_0x4a2803=_0x517339;_0x4da33b[_0x90bd('0x2b')]=_[_0x90bd('0x41')](db[_0x90bd('0x47')]['rawAttributes']);_0x4da33b[_0x90bd('0x2c')]=_[_0x90bd('0x41')](_0x1bff11[_0x90bd('0x2c')]);_0x4da33b[_0x90bd('0x2d')]=_[_0x90bd('0x2e')](_0x4da33b['model'],_0x4da33b[_0x90bd('0x2c')]);_0x739476[_0x90bd('0x2f')]=_['intersection'](_0x4da33b[_0x90bd('0x2b')],qs[_0x90bd('0x30')](_0x1bff11[_0x90bd('0x2c')][_0x90bd('0x30')]));_0x739476[_0x90bd('0x2f')]=_0x739476[_0x90bd('0x2f')][_0x90bd('0x31')]?_0x739476[_0x90bd('0x2f')]:_0x4da33b['model'];_0x739476[_0x90bd('0x33')]=qs[_0x90bd('0x34')](_0x1bff11[_0x90bd('0x2c')]['sort']);_0x739476[_0x90bd('0x38')]=qs[_0x90bd('0x2d')](_[_0x90bd('0x35')](_0x1bff11[_0x90bd('0x2c')],_0x4da33b['filters']));if(_0x1bff11[_0x90bd('0x2c')][_0x90bd('0x36')]){_0x739476[_0x90bd('0x38')]=_[_0x90bd('0x37')](_0x739476[_0x90bd('0x38')],{'$or':_['map'](_0x739476[_0x90bd('0x2f')],function(_0x431499){var _0x1284ca={};_0x1284ca[_0x431499]={'$like':'%'+_0x1bff11['query'][_0x90bd('0x36')]+'%'};return _0x1284ca;})});}_0x739476=_[_0x90bd('0x37')]({},_0x739476,_0x1bff11[_0x90bd('0x3a')]);return _0x4a2803[_0x90bd('0x4a')](_0x739476);}})[_0x90bd('0x21')](function(_0x4f08da){if(_0x4f08da){_0x93ace3=_0x4f08da[_0x90bd('0x31')];if(!_0x1bff11[_0x90bd('0x2c')][_0x90bd('0x48')]('nolimit')){_0x739476[_0x90bd('0x1b')]=qs[_0x90bd('0x1b')](_0x1bff11[_0x90bd('0x2c')]['limit']);_0x739476[_0x90bd('0x1a')]=qs[_0x90bd('0x1a')](_0x1bff11[_0x90bd('0x2c')][_0x90bd('0x1a')]);}return _0x4a2803['getDescriptions'](_0x739476);}})[_0x90bd('0x21')](function(_0x32148b){if(_0x32148b){return _0x32148b?{'count':_0x93ace3,'rows':_0x32148b}:null;}})[_0x90bd('0x21')](respondWithResult(_0x1317d1,null))['catch'](handleError(_0x1317d1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 02832ab..7844a50 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 _0x6053=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger'];(function(_0x54cf2e,_0x22a2e1){var _0x20ffc7=function(_0x254de5){while(--_0x254de5){_0x54cf2e['push'](_0x54cf2e['shift']());}};_0x20ffc7(++_0x22a2e1);}(_0x6053,0x166));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3605('0x0'));var util=require('util');var logger=require(_0x3605('0x1'))(_0x3605('0x2'));var moment=require(_0x3605('0x3'));var BPromise=require('bluebird');var rp=require(_0x3605('0x4'));var fs=require('fs');var path=require(_0x3605('0x5'));var rimraf=require(_0x3605('0x6'));var config=require(_0x3605('0x7'));var attributes=require(_0x3605('0x8'));module['exports']=function(_0x10d421,_0x3d8032){return _0x10d421[_0x3605('0x9')](_0x3605('0xa'),attributes,{'tableName':_0x3605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c8e=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x227b09,_0x2ea7ae){var _0x5f3571=function(_0x5916ae){while(--_0x5916ae){_0x227b09['push'](_0x227b09['shift']());}};_0x5f3571(++_0x2ea7ae);}(_0x7c8e,0x8f));var _0xe7c8=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0x7c8e[_0x323419];return _0x4c0be7;};'use strict';var _=require(_0xe7c8('0x0'));var util=require(_0xe7c8('0x1'));var logger=require(_0xe7c8('0x2'))(_0xe7c8('0x3'));var moment=require(_0xe7c8('0x4'));var BPromise=require('bluebird');var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xe7c8('0x9')]=function(_0x329f1a,_0x599ed0){return _0x329f1a[_0xe7c8('0xa')](_0xe7c8('0xb'),attributes,{'tableName':_0xe7c8('0xc'),'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 c4065ae..b6876f8 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 _0xdc50=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x12a29f,_0x526ddb){var _0x1f1b9e=function(_0x35aef7){while(--_0x35aef7){_0x12a29f['push'](_0x12a29f['shift']());}};_0x1f1b9e(++_0x526ddb);}(_0xdc50,0x15f));var _0x0dc5=function(_0x2b334f,_0x350f95){_0x2b334f=_0x2b334f-0x0;var _0x5ccf57=_0xdc50[_0x2b334f];return _0x5ccf57;};'use strict';var _=require(_0x0dc5('0x0'));var util=require(_0x0dc5('0x1'));var moment=require(_0x0dc5('0x2'));var BPromise=require(_0x0dc5('0x3'));var rs=require(_0x0dc5('0x4'));var fs=require('fs');var Redis=require(_0x0dc5('0x5'));var db=require(_0x0dc5('0x6'))['db'];var utils=require(_0x0dc5('0x7'));var logger=require(_0x0dc5('0x8'))(_0x0dc5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0dc5('0xa')][_0x0dc5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22577b,_0x405a07,_0x4833b6){return new BPromise(function(_0x2d2c4b,_0x41f4f7){return client[_0x0dc5('0xc')](_0x22577b,_0x4833b6)['then'](function(_0x1bbfe6){logger[_0x0dc5('0xd')](_0x0dc5('0xe'),_0x405a07,_0x0dc5('0xf'));logger['debug'](_0x0dc5('0x10'),_0x405a07,'request\x20sent',JSON['stringify'](_0x1bbfe6));if(_0x1bbfe6[_0x0dc5('0x11')]){if(_0x1bbfe6[_0x0dc5('0x11')][_0x0dc5('0x12')]===0x1f4){logger[_0x0dc5('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x405a07,_0x1bbfe6[_0x0dc5('0x11')][_0x0dc5('0x13')]);return _0x41f4f7(_0x1bbfe6[_0x0dc5('0x11')][_0x0dc5('0x13')]);}logger[_0x0dc5('0x11')](_0x0dc5('0xe'),_0x405a07,_0x1bbfe6[_0x0dc5('0x11')][_0x0dc5('0x13')]);return _0x2d2c4b(_0x1bbfe6[_0x0dc5('0x11')]['message']);}else{logger[_0x0dc5('0xd')](_0x0dc5('0xe'),_0x405a07,'request\x20sent');_0x2d2c4b(_0x1bbfe6[_0x0dc5('0x14')][_0x0dc5('0x13')]);}})[_0x0dc5('0x15')](function(_0x5ec8e8){logger[_0x0dc5('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x405a07,_0x5ec8e8);_0x41f4f7(_0x5ec8e8);});});} \ No newline at end of file +var _0x9a5d=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1bd896,_0xe4e26a){var _0x3820e6=function(_0x387a07){while(--_0x387a07){_0x1bd896['push'](_0x1bd896['shift']());}};_0x3820e6(++_0xe4e26a);}(_0x9a5d,0xb0));var _0xd9a5=function(_0x3f8cfb,_0x433758){_0x3f8cfb=_0x3f8cfb-0x0;var _0x32ec50=_0x9a5d[_0x3f8cfb];return _0x32ec50;};'use strict';var _=require(_0xd9a5('0x0'));var util=require(_0xd9a5('0x1'));var moment=require(_0xd9a5('0x2'));var BPromise=require(_0xd9a5('0x3'));var rs=require(_0xd9a5('0x4'));var fs=require('fs');var Redis=require(_0xd9a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd9a5('0x6'))(_0xd9a5('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9a5('0x8'));var client=jayson[_0xd9a5('0x9')][_0xd9a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x90069b,_0x3b024c,_0x3669cc){return new BPromise(function(_0x278b69,_0x4d5b00){return client[_0xd9a5('0xb')](_0x90069b,_0x3669cc)[_0xd9a5('0xc')](function(_0x197d18){logger[_0xd9a5('0xd')](_0xd9a5('0xe'),_0x3b024c,_0xd9a5('0xf'));logger[_0xd9a5('0x10')](_0xd9a5('0x11'),_0x3b024c,_0xd9a5('0xf'),JSON[_0xd9a5('0x12')](_0x197d18));if(_0x197d18[_0xd9a5('0x13')]){if(_0x197d18[_0xd9a5('0x13')][_0xd9a5('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3b024c,_0x197d18[_0xd9a5('0x13')][_0xd9a5('0x15')]);return _0x4d5b00(_0x197d18[_0xd9a5('0x13')][_0xd9a5('0x15')]);}logger['error'](_0xd9a5('0xe'),_0x3b024c,_0x197d18['error'][_0xd9a5('0x15')]);return _0x278b69(_0x197d18[_0xd9a5('0x13')]['message']);}else{logger[_0xd9a5('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b024c,_0xd9a5('0xf'));_0x278b69(_0x197d18[_0xd9a5('0x16')][_0xd9a5('0x15')]);}})[_0xd9a5('0x17')](function(_0x32a3de){logger[_0xd9a5('0x13')](_0xd9a5('0xe'),_0x3b024c,_0x32a3de);_0x4d5b00(_0x32a3de);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index c0ccf3e..7f5b7b8 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 _0xf9c9=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','express'];(function(_0x140010,_0x4d7233){var _0x373bb8=function(_0x2b6291){while(--_0x2b6291){_0x140010['push'](_0x140010['shift']());}};_0x373bb8(++_0x4d7233);}(_0xf9c9,0xb0));var _0x9f9c=function(_0x2bf76a,_0xb01832){_0x2bf76a=_0x2bf76a-0x0;var _0x1ec759=_0xf9c9[_0x2bf76a];return _0x1ec759;};'use strict';var multer=require(_0x9f9c('0x0'));var util=require(_0x9f9c('0x1'));var path=require(_0x9f9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f9c('0x3'));var router=express[_0x9f9c('0x4')]();var fs_extra=require(_0x9f9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f9c('0x6'));var config=require(_0x9f9c('0x7'));var controller=require(_0x9f9c('0x8'));router[_0x9f9c('0x9')]('/',auth[_0x9f9c('0xa')](),controller[_0x9f9c('0xb')]);router[_0x9f9c('0x9')](_0x9f9c('0xc'),auth[_0x9f9c('0xa')](),controller[_0x9f9c('0xd')]);router[_0x9f9c('0xe')]('/',auth[_0x9f9c('0xa')](),controller[_0x9f9c('0xf')]);router['put']('/:id',auth[_0x9f9c('0xa')](),controller['update']);router['delete']('/:id',auth[_0x9f9c('0xa')](),controller[_0x9f9c('0x10')]);module[_0x9f9c('0x11')]=router; \ No newline at end of file +var _0x5086=['delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0xeead8a,_0x3d2400){var _0x24742c=function(_0x1e357a){while(--_0x1e357a){_0xeead8a['push'](_0xeead8a['shift']());}};_0x24742c(++_0x3d2400);}(_0x5086,0xfd));var _0x6508=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5086[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x6508('0x0'));var util=require(_0x6508('0x1'));var path=require(_0x6508('0x2'));var timeout=require(_0x6508('0x3'));var express=require('express');var router=express[_0x6508('0x4')]();var fs_extra=require(_0x6508('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6508('0x6'));var config=require(_0x6508('0x7'));var controller=require(_0x6508('0x8'));router[_0x6508('0x9')]('/',auth[_0x6508('0xa')](),controller[_0x6508('0xb')]);router['get'](_0x6508('0xc'),auth[_0x6508('0xa')](),controller[_0x6508('0xd')]);router[_0x6508('0xe')]('/',auth['isAuthenticated'](),controller[_0x6508('0xf')]);router[_0x6508('0x10')](_0x6508('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6508('0x11')](_0x6508('0xc'),auth['isAuthenticated'](),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 ac90365..4d4f7b3 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 _0xae88=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xae88,0x103));var _0x8ae8=function(_0x2a6d73,_0x15cf7d){_0x2a6d73=_0x2a6d73-0x0;var _0x3799c7=_0xae88[_0x2a6d73];return _0x3799c7;};'use strict';var Sequelize=require(_0x8ae8('0x0'));module[_0x8ae8('0x1')]={'type':{'type':Sequelize[_0x8ae8('0x2')]('string',_0x8ae8('0x3'),_0x8ae8('0x4'),_0x8ae8('0x5'),_0x8ae8('0x6')),'defaultValue':_0x8ae8('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8ae8('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8ae8('0x7'),_0x8ae8('0x3'),_0x8ae8('0x4'))},'keyContent':{'type':Sequelize[_0x8ae8('0x8')]},'idField':{'type':Sequelize[_0x8ae8('0x8')]},'nameField':{'type':Sequelize[_0x8ae8('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe125=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x46eeb3,_0x5ab43e){var _0x38df62=function(_0x12b6f5){while(--_0x12b6f5){_0x46eeb3['push'](_0x46eeb3['shift']());}};_0x38df62(++_0x5ab43e);}(_0xe125,0xa3));var _0x5e12=function(_0x23e05c,_0x4f6d8e){_0x23e05c=_0x23e05c-0x0;var _0x12eecd=_0xe125[_0x23e05c];return _0x12eecd;};'use strict';var Sequelize=require(_0x5e12('0x0'));module[_0x5e12('0x1')]={'type':{'type':Sequelize[_0x5e12('0x2')](_0x5e12('0x3'),_0x5e12('0x4'),_0x5e12('0x5'),_0x5e12('0x6'),_0x5e12('0x7')),'defaultValue':_0x5e12('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5e12('0x8')]},'keyType':{'type':Sequelize[_0x5e12('0x2')](_0x5e12('0x3'),_0x5e12('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5e12('0x8')]},'idField':{'type':Sequelize[_0x5e12('0x8')]},'nameField':{'type':Sequelize[_0x5e12('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e12('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2002d84..0d86785 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 _0xc3a1=['show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','ZohoField','includeAll','include','rows','catch'];(function(_0x31f04b,_0x38dbdf){var _0xb80dd=function(_0x5ef7ce){while(--_0x5ef7ce){_0x31f04b['push'](_0x31f04b['shift']());}};_0xb80dd(++_0x38dbdf);}(_0xc3a1,0xd9));var _0x1c3a=function(_0x13cbdf,_0x15b2f7){_0x13cbdf=_0x13cbdf-0x0;var _0x1044cf=_0xc3a1[_0x13cbdf];return _0x1044cf;};'use strict';var emlformat=require(_0x1c3a('0x0'));var rimraf=require(_0x1c3a('0x1'));var zipdir=require(_0x1c3a('0x2'));var jsonpatch=require(_0x1c3a('0x3'));var rp=require(_0x1c3a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c3a('0x5'));var path=require('path');var sox=require(_0x1c3a('0x6'));var csv=require(_0x1c3a('0x7'));var ejs=require(_0x1c3a('0x8'));var fs=require('fs');var fs_extra=require(_0x1c3a('0x9'));var _=require('lodash');var squel=require(_0x1c3a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1c3a('0xb'));var toCsv=require(_0x1c3a('0x7'));var querystring=require('querystring');var Papa=require(_0x1c3a('0xc'));var Redis=require(_0x1c3a('0xd'));var authService=require(_0x1c3a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1c3a('0xf'));var hardwareService=require(_0x1c3a('0x10'));var logger=require(_0x1c3a('0x11'))('api');var utils=require(_0x1c3a('0x12'));var config=require(_0x1c3a('0x13'));var licenseUtil=require(_0x1c3a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48dbf6,_0x1ef107){_0x1ef107=_0x1ef107||0xcc;return function(_0x4a1380){if(_0x4a1380){return _0x48dbf6[_0x1c3a('0x15')](_0x1ef107);}return _0x48dbf6[_0x1c3a('0x16')](_0x1ef107)[_0x1c3a('0x17')]();};}function respondWithResult(_0x4886f8,_0x173635){_0x173635=_0x173635||0xc8;return function(_0x22b7cc){if(_0x22b7cc){return _0x4886f8['status'](_0x173635)[_0x1c3a('0x18')](_0x22b7cc);}};}function respondWithFilteredResult(_0x47cd9b,_0xad2586){return function(_0xda7bb9){if(_0xda7bb9){var _0xd1dc85=typeof _0xad2586[_0x1c3a('0x19')]===_0x1c3a('0x1a')&&typeof _0xad2586[_0x1c3a('0x1b')]===_0x1c3a('0x1a');var _0x481161=_0xda7bb9[_0x1c3a('0x1c')];var _0x166dd6=_0xd1dc85?0x0:_0xad2586[_0x1c3a('0x19')];var _0x3a7b6a=_0xd1dc85?_0xda7bb9['count']:_0xad2586['offset']+_0xad2586['limit'];var _0xd72f01;if(_0x3a7b6a>=_0x481161){_0x3a7b6a=_0x481161;_0xd72f01=0xc8;}else{_0xd72f01=0xce;}_0x47cd9b[_0x1c3a('0x16')](_0xd72f01);return _0x47cd9b[_0x1c3a('0x1d')]('Content-Range',_0x166dd6+'-'+_0x3a7b6a+'/'+_0x481161)[_0x1c3a('0x18')](_0xda7bb9);}return null;};}function patchUpdates(_0x52e64f){return function(_0x127b50){try{jsonpatch['apply'](_0x127b50,_0x52e64f,!![]);}catch(_0xa57fc3){return BPromise[_0x1c3a('0x1e')](_0xa57fc3);}return _0x127b50[_0x1c3a('0x1f')]();};}function saveUpdates(_0x25bcad,_0x404bcc){return function(_0x30bd95){if(_0x30bd95){return _0x30bd95[_0x1c3a('0x20')](_0x25bcad)[_0x1c3a('0x21')](function(_0x537ace){return _0x537ace;});}return null;};}function removeEntity(_0x26cb4e,_0x991d72){return function(_0x193ffd){if(_0x193ffd){return _0x193ffd['destroy']()[_0x1c3a('0x21')](function(){_0x26cb4e[_0x1c3a('0x16')](0xcc)[_0x1c3a('0x17')]();});}};}function handleEntityNotFound(_0x2d2b54,_0x38211b){return function(_0x181a2e){if(!_0x181a2e){_0x2d2b54[_0x1c3a('0x15')](0x194);}return _0x181a2e;};}function handleError(_0x2645b5,_0x4f8dfb){_0x4f8dfb=_0x4f8dfb||0x1f4;return function(_0xe475ae){logger[_0x1c3a('0x22')](_0xe475ae['stack']);if(_0xe475ae[_0x1c3a('0x23')]){delete _0xe475ae[_0x1c3a('0x23')];}_0x2645b5[_0x1c3a('0x16')](_0x4f8dfb)[_0x1c3a('0x24')](_0xe475ae);};}exports[_0x1c3a('0x25')]=function(_0x37f535,_0x269fa8){var _0x524803={},_0x533451={},_0x49e87d={'count':0x0,'rows':[]};var _0x14f38c=_[_0x1c3a('0x26')](db['ZohoField']['rawAttributes'],function(_0x5a7665){return{'name':_0x5a7665[_0x1c3a('0x27')],'type':_0x5a7665[_0x1c3a('0x28')][_0x1c3a('0x29')]};});_0x533451['model']=_[_0x1c3a('0x26')](_0x14f38c,_0x1c3a('0x23'));_0x533451[_0x1c3a('0x2a')]=_['keys'](_0x37f535[_0x1c3a('0x2a')]);_0x533451[_0x1c3a('0x2b')]=_[_0x1c3a('0x2c')](_0x533451[_0x1c3a('0x2d')],_0x533451['query']);_0x524803['attributes']=_[_0x1c3a('0x2c')](_0x533451[_0x1c3a('0x2d')],qs['fields'](_0x37f535['query'][_0x1c3a('0x2e')]));_0x524803[_0x1c3a('0x2f')]=_0x524803['attributes'][_0x1c3a('0x30')]?_0x524803['attributes']:_0x533451[_0x1c3a('0x2d')];if(!_0x37f535[_0x1c3a('0x2a')][_0x1c3a('0x31')](_0x1c3a('0x32'))){_0x524803[_0x1c3a('0x1b')]=qs[_0x1c3a('0x1b')](_0x37f535[_0x1c3a('0x2a')]['limit']);_0x524803[_0x1c3a('0x19')]=qs['offset'](_0x37f535[_0x1c3a('0x2a')][_0x1c3a('0x19')]);}_0x524803[_0x1c3a('0x33')]=qs['sort'](_0x37f535[_0x1c3a('0x2a')][_0x1c3a('0x34')]);_0x524803['where']=qs['filters'](_[_0x1c3a('0x35')](_0x37f535[_0x1c3a('0x2a')],_0x533451[_0x1c3a('0x2b')]),_0x14f38c);if(_0x37f535['query'][_0x1c3a('0x36')]){_0x524803['where']=_[_0x1c3a('0x37')](_0x524803[_0x1c3a('0x38')],{'$or':_[_0x1c3a('0x26')](_0x14f38c,function(_0xb490c4){if(_0xb490c4['type']!==_0x1c3a('0x39')){var _0x4cc3c6={};_0x4cc3c6[_0xb490c4[_0x1c3a('0x23')]]={'$like':'%'+_0x37f535[_0x1c3a('0x2a')]['filter']+'%'};return _0x4cc3c6;}})});}_0x524803=_[_0x1c3a('0x37')]({},_0x524803,_0x37f535['options']);var _0x1ee740={'where':_0x524803['where']};return db[_0x1c3a('0x3a')][_0x1c3a('0x1c')](_0x1ee740)[_0x1c3a('0x21')](function(_0x58f3c6){_0x49e87d[_0x1c3a('0x1c')]=_0x58f3c6;if(_0x37f535[_0x1c3a('0x2a')][_0x1c3a('0x3b')]){_0x524803[_0x1c3a('0x3c')]=[{'all':!![]}];}return db[_0x1c3a('0x3a')]['findAll'](_0x524803);})[_0x1c3a('0x21')](function(_0xe44f15){_0x49e87d[_0x1c3a('0x3d')]=_0xe44f15;return _0x49e87d;})[_0x1c3a('0x21')](respondWithFilteredResult(_0x269fa8,_0x524803))[_0x1c3a('0x3e')](handleError(_0x269fa8,null));};exports[_0x1c3a('0x3f')]=function(_0x3dae16,_0x5af911){var _0x22ab3f={'raw':!![],'where':{'id':_0x3dae16[_0x1c3a('0x40')]['id']}},_0x5f1ab7={};_0x5f1ab7['model']=_[_0x1c3a('0x41')](db['ZohoField'][_0x1c3a('0x42')]);_0x5f1ab7['query']=_['keys'](_0x3dae16[_0x1c3a('0x2a')]);_0x5f1ab7[_0x1c3a('0x2b')]=_[_0x1c3a('0x2c')](_0x5f1ab7[_0x1c3a('0x2d')],_0x5f1ab7[_0x1c3a('0x2a')]);_0x22ab3f['attributes']=_[_0x1c3a('0x2c')](_0x5f1ab7['model'],qs[_0x1c3a('0x2e')](_0x3dae16[_0x1c3a('0x2a')][_0x1c3a('0x2e')]));_0x22ab3f['attributes']=_0x22ab3f[_0x1c3a('0x2f')][_0x1c3a('0x30')]?_0x22ab3f[_0x1c3a('0x2f')]:_0x5f1ab7[_0x1c3a('0x2d')];if(_0x3dae16[_0x1c3a('0x2a')]['includeAll']){_0x22ab3f[_0x1c3a('0x3c')]=[{'all':!![]}];}_0x22ab3f=_['merge']({},_0x22ab3f,_0x3dae16['options']);return db['ZohoField']['find'](_0x22ab3f)[_0x1c3a('0x21')](handleEntityNotFound(_0x5af911,null))[_0x1c3a('0x21')](respondWithResult(_0x5af911,null))[_0x1c3a('0x3e')](handleError(_0x5af911,null));};exports['create']=function(_0x498782,_0x4e5660){return db[_0x1c3a('0x3a')][_0x1c3a('0x43')](_0x498782[_0x1c3a('0x44')],{})[_0x1c3a('0x21')](respondWithResult(_0x4e5660,0xc9))[_0x1c3a('0x3e')](handleError(_0x4e5660,null));};exports[_0x1c3a('0x20')]=function(_0x53c26f,_0x178eda){if(_0x53c26f[_0x1c3a('0x44')]['id']){delete _0x53c26f['body']['id'];}return db[_0x1c3a('0x3a')][_0x1c3a('0x45')]({'where':{'id':_0x53c26f['params']['id']}})['then'](handleEntityNotFound(_0x178eda,null))[_0x1c3a('0x21')](saveUpdates(_0x53c26f[_0x1c3a('0x44')],null))[_0x1c3a('0x21')](respondWithResult(_0x178eda,null))[_0x1c3a('0x3e')](handleError(_0x178eda,null));};exports['destroy']=function(_0x1b45da,_0x4fb4cc){return db[_0x1c3a('0x3a')]['find']({'where':{'id':_0x1b45da[_0x1c3a('0x40')]['id']}})[_0x1c3a('0x21')](handleEntityNotFound(_0x4fb4cc,null))[_0x1c3a('0x21')](removeEntity(_0x4fb4cc,null))[_0x1c3a('0x3e')](handleError(_0x4fb4cc,null));}; \ No newline at end of file +var _0xec2b=['zip-dir','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','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','key','query','intersection','attributes','fields','length','model','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','eml-format','rimraf'];(function(_0xe9f5aa,_0x367b8b){var _0x410534=function(_0x15e505){while(--_0x15e505){_0xe9f5aa['push'](_0xe9f5aa['shift']());}};_0x410534(++_0x367b8b);}(_0xec2b,0x126));var _0xbec2=function(_0x2f8234,_0x153bd3){_0x2f8234=_0x2f8234-0x0;var _0x2e3653=_0xec2b[_0x2f8234];return _0x2e3653;};'use strict';var emlformat=require(_0xbec2('0x0'));var rimraf=require(_0xbec2('0x1'));var zipdir=require(_0xbec2('0x2'));var jsonpatch=require(_0xbec2('0x3'));var rp=require(_0xbec2('0x4'));var moment=require(_0xbec2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbec2('0x6'));var util=require(_0xbec2('0x7'));var path=require(_0xbec2('0x8'));var sox=require(_0xbec2('0x9'));var csv=require(_0xbec2('0xa'));var ejs=require(_0xbec2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbec2('0xc'));var crypto=require(_0xbec2('0xd'));var jsforce=require(_0xbec2('0xe'));var deskjs=require(_0xbec2('0xf'));var toCsv=require(_0xbec2('0xa'));var querystring=require(_0xbec2('0x10'));var Papa=require(_0xbec2('0x11'));var Redis=require(_0xbec2('0x12'));var authService=require(_0xbec2('0x13'));var qs=require(_0xbec2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbec2('0x15'));var utils=require(_0xbec2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbec2('0x17'));var db=require(_0xbec2('0x18'))['db'];function respondWithStatusCode(_0x358fe6,_0x4f512f){_0x4f512f=_0x4f512f||0xcc;return function(_0x3bd629){if(_0x3bd629){return _0x358fe6['sendStatus'](_0x4f512f);}return _0x358fe6[_0xbec2('0x19')](_0x4f512f)[_0xbec2('0x1a')]();};}function respondWithResult(_0x35d001,_0x2cd689){_0x2cd689=_0x2cd689||0xc8;return function(_0x10d66b){if(_0x10d66b){return _0x35d001[_0xbec2('0x19')](_0x2cd689)[_0xbec2('0x1b')](_0x10d66b);}};}function respondWithFilteredResult(_0x2f5306,_0x409f12){return function(_0xb86f73){if(_0xb86f73){var _0x3baed6=typeof _0x409f12['offset']===_0xbec2('0x1c')&&typeof _0x409f12[_0xbec2('0x1d')]===_0xbec2('0x1c');var _0xe3c356=_0xb86f73[_0xbec2('0x1e')];var _0x3891f1=_0x3baed6?0x0:_0x409f12[_0xbec2('0x1f')];var _0x2e7e88=_0x3baed6?_0xb86f73[_0xbec2('0x1e')]:_0x409f12[_0xbec2('0x1f')]+_0x409f12['limit'];var _0x375b35;if(_0x2e7e88>=_0xe3c356){_0x2e7e88=_0xe3c356;_0x375b35=0xc8;}else{_0x375b35=0xce;}_0x2f5306[_0xbec2('0x19')](_0x375b35);return _0x2f5306[_0xbec2('0x20')](_0xbec2('0x21'),_0x3891f1+'-'+_0x2e7e88+'/'+_0xe3c356)[_0xbec2('0x1b')](_0xb86f73);}return null;};}function patchUpdates(_0x1e4ee0){return function(_0x518f54){try{jsonpatch[_0xbec2('0x22')](_0x518f54,_0x1e4ee0,!![]);}catch(_0x410387){return BPromise[_0xbec2('0x23')](_0x410387);}return _0x518f54[_0xbec2('0x24')]();};}function saveUpdates(_0x3cb087,_0x2c134b){return function(_0x1a5bf4){if(_0x1a5bf4){return _0x1a5bf4[_0xbec2('0x25')](_0x3cb087)[_0xbec2('0x26')](function(_0x58b6e2){return _0x58b6e2;});}return null;};}function removeEntity(_0x3444e0,_0x127b87){return function(_0xa3f7f8){if(_0xa3f7f8){return _0xa3f7f8[_0xbec2('0x27')]()[_0xbec2('0x26')](function(){_0x3444e0['status'](0xcc)[_0xbec2('0x1a')]();});}};}function handleEntityNotFound(_0x3c965d,_0x17c084){return function(_0x33ae7b){if(!_0x33ae7b){_0x3c965d['sendStatus'](0x194);}return _0x33ae7b;};}function handleError(_0x4124a9,_0x169793){_0x169793=_0x169793||0x1f4;return function(_0x39c3c2){logger[_0xbec2('0x28')](_0x39c3c2[_0xbec2('0x29')]);if(_0x39c3c2['name']){delete _0x39c3c2[_0xbec2('0x2a')];}_0x4124a9['status'](_0x169793)[_0xbec2('0x2b')](_0x39c3c2);};}exports[_0xbec2('0x2c')]=function(_0x3359a4,_0x1ed435){var _0x367551={},_0x1ecfde={},_0x36960d={'count':0x0,'rows':[]};var _0x2f512f=_[_0xbec2('0x2d')](db[_0xbec2('0x2e')][_0xbec2('0x2f')],function(_0x4e718d){return{'name':_0x4e718d[_0xbec2('0x30')],'type':_0x4e718d['type'][_0xbec2('0x31')]};});_0x1ecfde['model']=_[_0xbec2('0x2d')](_0x2f512f,'name');_0x1ecfde[_0xbec2('0x32')]=_['keys'](_0x3359a4['query']);_0x1ecfde['filters']=_[_0xbec2('0x33')](_0x1ecfde['model'],_0x1ecfde['query']);_0x367551[_0xbec2('0x34')]=_[_0xbec2('0x33')](_0x1ecfde['model'],qs['fields'](_0x3359a4[_0xbec2('0x32')][_0xbec2('0x35')]));_0x367551[_0xbec2('0x34')]=_0x367551['attributes'][_0xbec2('0x36')]?_0x367551[_0xbec2('0x34')]:_0x1ecfde[_0xbec2('0x37')];if(!_0x3359a4['query']['hasOwnProperty']('nolimit')){_0x367551['limit']=qs[_0xbec2('0x1d')](_0x3359a4['query']['limit']);_0x367551[_0xbec2('0x1f')]=qs[_0xbec2('0x1f')](_0x3359a4[_0xbec2('0x32')][_0xbec2('0x1f')]);}_0x367551['order']=qs[_0xbec2('0x38')](_0x3359a4[_0xbec2('0x32')][_0xbec2('0x38')]);_0x367551[_0xbec2('0x39')]=qs['filters'](_[_0xbec2('0x3a')](_0x3359a4[_0xbec2('0x32')],_0x1ecfde[_0xbec2('0x3b')]),_0x2f512f);if(_0x3359a4['query'][_0xbec2('0x3c')]){_0x367551[_0xbec2('0x39')]=_[_0xbec2('0x3d')](_0x367551[_0xbec2('0x39')],{'$or':_[_0xbec2('0x2d')](_0x2f512f,function(_0x51c5e4){if(_0x51c5e4[_0xbec2('0x3e')]!==_0xbec2('0x3f')){var _0x227a79={};_0x227a79[_0x51c5e4[_0xbec2('0x2a')]]={'$like':'%'+_0x3359a4[_0xbec2('0x32')][_0xbec2('0x3c')]+'%'};return _0x227a79;}})});}_0x367551=_['merge']({},_0x367551,_0x3359a4[_0xbec2('0x40')]);var _0x15f29e={'where':_0x367551['where']};return db[_0xbec2('0x2e')][_0xbec2('0x1e')](_0x15f29e)[_0xbec2('0x26')](function(_0x2f98cd){_0x36960d[_0xbec2('0x1e')]=_0x2f98cd;if(_0x3359a4[_0xbec2('0x32')][_0xbec2('0x41')]){_0x367551[_0xbec2('0x42')]=[{'all':!![]}];}return db[_0xbec2('0x2e')][_0xbec2('0x43')](_0x367551);})['then'](function(_0x3d3774){_0x36960d['rows']=_0x3d3774;return _0x36960d;})[_0xbec2('0x26')](respondWithFilteredResult(_0x1ed435,_0x367551))[_0xbec2('0x44')](handleError(_0x1ed435,null));};exports['show']=function(_0x1ae04f,_0x1efdd2){var _0x18b0c8={'raw':!![],'where':{'id':_0x1ae04f[_0xbec2('0x45')]['id']}},_0x2023b9={};_0x2023b9['model']=_['keys'](db[_0xbec2('0x2e')][_0xbec2('0x2f')]);_0x2023b9['query']=_[_0xbec2('0x46')](_0x1ae04f[_0xbec2('0x32')]);_0x2023b9[_0xbec2('0x3b')]=_[_0xbec2('0x33')](_0x2023b9[_0xbec2('0x37')],_0x2023b9[_0xbec2('0x32')]);_0x18b0c8[_0xbec2('0x34')]=_[_0xbec2('0x33')](_0x2023b9[_0xbec2('0x37')],qs[_0xbec2('0x35')](_0x1ae04f[_0xbec2('0x32')][_0xbec2('0x35')]));_0x18b0c8['attributes']=_0x18b0c8[_0xbec2('0x34')][_0xbec2('0x36')]?_0x18b0c8[_0xbec2('0x34')]:_0x2023b9[_0xbec2('0x37')];if(_0x1ae04f[_0xbec2('0x32')][_0xbec2('0x41')]){_0x18b0c8['include']=[{'all':!![]}];}_0x18b0c8=_['merge']({},_0x18b0c8,_0x1ae04f[_0xbec2('0x40')]);return db[_0xbec2('0x2e')][_0xbec2('0x47')](_0x18b0c8)['then'](handleEntityNotFound(_0x1efdd2,null))[_0xbec2('0x26')](respondWithResult(_0x1efdd2,null))['catch'](handleError(_0x1efdd2,null));};exports[_0xbec2('0x48')]=function(_0x25c7c5,_0x16d127){return db[_0xbec2('0x2e')][_0xbec2('0x48')](_0x25c7c5[_0xbec2('0x49')],{})[_0xbec2('0x26')](respondWithResult(_0x16d127,0xc9))[_0xbec2('0x44')](handleError(_0x16d127,null));};exports[_0xbec2('0x25')]=function(_0x3b04e8,_0x187bd2){if(_0x3b04e8[_0xbec2('0x49')]['id']){delete _0x3b04e8[_0xbec2('0x49')]['id'];}return db[_0xbec2('0x2e')][_0xbec2('0x47')]({'where':{'id':_0x3b04e8[_0xbec2('0x45')]['id']}})[_0xbec2('0x26')](handleEntityNotFound(_0x187bd2,null))[_0xbec2('0x26')](saveUpdates(_0x3b04e8[_0xbec2('0x49')],null))[_0xbec2('0x26')](respondWithResult(_0x187bd2,null))['catch'](handleError(_0x187bd2,null));};exports[_0xbec2('0x27')]=function(_0x1c9df9,_0x16f209){return db[_0xbec2('0x2e')][_0xbec2('0x47')]({'where':{'id':_0x1c9df9[_0xbec2('0x45')]['id']}})['then'](handleEntityNotFound(_0x16f209,null))['then'](removeEntity(_0x16f209,null))['catch'](handleError(_0x16f209,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ec968b3..1ba114b 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 _0x32f4=['int_zoho_fields','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField'];(function(_0x4f8492,_0x1eec76){var _0x8c2e1f=function(_0x373e1b){while(--_0x373e1b){_0x4f8492['push'](_0x4f8492['shift']());}};_0x8c2e1f(++_0x1eec76);}(_0x32f4,0x154));var _0x432f=function(_0xc7c23,_0x1901b8){_0xc7c23=_0xc7c23-0x0;var _0x3f8daa=_0x32f4[_0xc7c23];return _0x3f8daa;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));module[_0x432f('0x9')]=function(_0x2f5f03,_0x5d8cc0){return _0x2f5f03['define'](_0x432f('0xa'),attributes,{'tableName':_0x432f('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x432f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa456,0x142));var _0x6a45=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xa456[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));module[_0x6a45('0x9')]=function(_0x14da6b,_0x4dfbfa){return _0x14da6b[_0x6a45('0xa')](_0x6a45('0xb'),attributes,{'tableName':_0x6a45('0xc'),'paranoid':![],'indexes':[{'name':_0x6a45('0xd'),'fields':[_0x6a45('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 58b36b2..acce813 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 _0x14e7=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x14e7,0xcf));var _0x714e=function(_0x2fc1ce,_0x1a26d5){_0x2fc1ce=_0x2fc1ce-0x0;var _0x2b41df=_0x14e7[_0x2fc1ce];return _0x2b41df;};'use strict';var _=require(_0x714e('0x0'));var util=require(_0x714e('0x1'));var moment=require(_0x714e('0x2'));var BPromise=require(_0x714e('0x3'));var rs=require(_0x714e('0x4'));var fs=require('fs');var Redis=require(_0x714e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x714e('0x6'));var logger=require(_0x714e('0x7'))(_0x714e('0x8'));var config=require(_0x714e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x714e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37df85,_0x3dc19a,_0x5b16a6){return new BPromise(function(_0x4653dd,_0x3daa0d){return client[_0x714e('0xb')](_0x37df85,_0x5b16a6)[_0x714e('0xc')](function(_0xccfb45){logger[_0x714e('0xd')](_0x714e('0xe'),_0x3dc19a,_0x714e('0xf'));logger[_0x714e('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x3dc19a,_0x714e('0xf'),JSON['stringify'](_0xccfb45));if(_0xccfb45['error']){if(_0xccfb45[_0x714e('0x11')][_0x714e('0x12')]===0x1f4){logger[_0x714e('0x11')](_0x714e('0xe'),_0x3dc19a,_0xccfb45[_0x714e('0x11')][_0x714e('0x13')]);return _0x3daa0d(_0xccfb45[_0x714e('0x11')]['message']);}logger[_0x714e('0x11')](_0x714e('0xe'),_0x3dc19a,_0xccfb45['error'][_0x714e('0x13')]);return _0x4653dd(_0xccfb45['error'][_0x714e('0x13')]);}else{logger[_0x714e('0xd')](_0x714e('0xe'),_0x3dc19a,_0x714e('0xf'));_0x4653dd(_0xccfb45[_0x714e('0x14')][_0x714e('0x13')]);}})['catch'](function(_0x2b83a6){logger[_0x714e('0x11')](_0x714e('0xe'),_0x3dc19a,_0x2b83a6);_0x3daa0d(_0x2b83a6);});});} \ No newline at end of file +var _0xda4e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xda4e,0x80));var _0xeda4=function(_0x8caccc,_0x3c6f52){_0x8caccc=_0x8caccc-0x0;var _0xb8f408=_0xda4e[_0x8caccc];return _0xb8f408;};'use strict';var _=require(_0xeda4('0x0'));var util=require(_0xeda4('0x1'));var moment=require(_0xeda4('0x2'));var BPromise=require(_0xeda4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeda4('0x4'));var logger=require(_0xeda4('0x5'))(_0xeda4('0x6'));var config=require(_0xeda4('0x7'));var jayson=require(_0xeda4('0x8'));var client=jayson[_0xeda4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12e6e8,_0x40a50c,_0x1753e2){return new BPromise(function(_0xf13d29,_0x53b581){return client[_0xeda4('0xa')](_0x12e6e8,_0x1753e2)[_0xeda4('0xb')](function(_0x224c0e){logger[_0xeda4('0xc')](_0xeda4('0xd'),_0x40a50c,'request\x20sent');logger[_0xeda4('0xe')](_0xeda4('0xf'),_0x40a50c,'request\x20sent',JSON[_0xeda4('0x10')](_0x224c0e));if(_0x224c0e[_0xeda4('0x11')]){if(_0x224c0e[_0xeda4('0x11')]['code']===0x1f4){logger[_0xeda4('0x11')]('ZohoField,\x20%s,\x20%s',_0x40a50c,_0x224c0e[_0xeda4('0x11')][_0xeda4('0x12')]);return _0x53b581(_0x224c0e[_0xeda4('0x11')][_0xeda4('0x12')]);}logger[_0xeda4('0x11')](_0xeda4('0xd'),_0x40a50c,_0x224c0e[_0xeda4('0x11')][_0xeda4('0x12')]);return _0xf13d29(_0x224c0e[_0xeda4('0x11')][_0xeda4('0x12')]);}else{logger['info'](_0xeda4('0xd'),_0x40a50c,_0xeda4('0x13'));_0xf13d29(_0x224c0e[_0xeda4('0x14')][_0xeda4('0x12')]);}})[_0xeda4('0x15')](function(_0xa63d6a){logger['error'](_0xeda4('0xd'),_0x40a50c,_0xa63d6a);_0x53b581(_0xa63d6a);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 40a7067..43a8b15 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5592ac,_0x33327e){var _0x47f30c=function(_0x30cb57){while(--_0x30cb57){_0x5592ac['push'](_0x5592ac['shift']());}};_0x47f30c(++_0x33327e);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4361b2,_0x2a9b5d){var _0x3a17b7=function(_0xda75e0){while(--_0xda75e0){_0x4361b2['push'](_0x4361b2['shift']());}};_0x3a17b7(++_0x2a9b5d);}(_0xe706,0xa3));var _0x6e70=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xe706[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c56c8d2..7146f2b 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 _0x765f=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x3779fa,_0x18fb47){var _0x1a6b9d=function(_0x5e5f79){while(--_0x5e5f79){_0x3779fa['push'](_0x3779fa['shift']());}};_0x1a6b9d(++_0x18fb47);}(_0x765f,0x1b1));var _0xf765=function(_0x2a5836,_0x346c70){_0x2a5836=_0x2a5836-0x0;var _0x5b7a67=_0x765f[_0x2a5836];return _0x5b7a67;};'use strict';var Sequelize=require('sequelize');module[_0xf765('0x0')]={'name':{'type':Sequelize[_0xf765('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xf765('0x1')],'allowNull':![],'unique':_0xf765('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xf765('0x3')},'filename':{'type':Sequelize[_0xf765('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf765('0x1')]},'size':{'type':Sequelize[_0xf765('0x4')]},'active':{'type':Sequelize[_0xf765('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xf765('0x1')]},'state':{'type':Sequelize[_0xf765('0x1')],'unique':_0xf765('0x6')},'description':{'type':Sequelize[_0xf765('0x1')]},'title':{'type':Sequelize[_0xf765('0x1')]},'remoteUri':{'type':Sequelize[_0xf765('0x1')]},'link':{'type':Sequelize[_0xf765('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x8aec=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x8aec,0x1a6));var _0xc8ae=function(_0x29a023,_0xa0a9f1){_0x29a023=_0x29a023-0x0;var _0x445924=_0x8aec[_0x29a023];return _0x445924;};'use strict';var Sequelize=require(_0xc8ae('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8ae('0x1')],'allowNull':![],'unique':_0xc8ae('0x2')},'version':{'type':Sequelize[_0xc8ae('0x1')],'allowNull':![],'unique':_0xc8ae('0x2')},'main':{'type':Sequelize[_0xc8ae('0x1')],'defaultValue':_0xc8ae('0x3')},'filename':{'type':Sequelize[_0xc8ae('0x1')]},'path':{'type':Sequelize[_0xc8ae('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xc8ae('0x4')]},'active':{'type':Sequelize[_0xc8ae('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xc8ae('0x1')]},'logo':{'type':Sequelize[_0xc8ae('0x1')]},'state':{'type':Sequelize[_0xc8ae('0x1')],'unique':_0xc8ae('0x6')},'description':{'type':Sequelize[_0xc8ae('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8ae('0x1')]},'link':{'type':Sequelize[_0xc8ae('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7f3448b..3b59e9b 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 _0x687b=['order','sort','where','filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3bb0d4,_0xe492ec){var _0x269be3=function(_0x3fc0af){while(--_0x3fc0af){_0x3bb0d4['push'](_0x3bb0d4['shift']());}};_0x269be3(++_0xe492ec);}(_0x687b,0x14a));var _0xb687=function(_0x3530d0,_0x4dfb47){_0x3530d0=_0x3530d0-0x0;var _0x2165c6=_0x687b[_0x3530d0];return _0x2165c6;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['Integration'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['Integration']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));}; \ No newline at end of file +var _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x66fa,0x117));var _0xa66f=function(_0x37d893,_0x93d093){_0x37d893=_0x37d893-0x0;var _0x28762a=_0x66fa[_0x37d893];return _0x28762a;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8dbbeaa..11df951 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 _0xed5c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integration.attributes','Integration','integrations','util'];(function(_0x3c6d6e,_0x51b2bc){var _0x10c052=function(_0x13f4ee){while(--_0x13f4ee){_0x3c6d6e['push'](_0x3c6d6e['shift']());}};_0x10c052(++_0x51b2bc);}(_0xed5c,0x175));var _0xced5=function(_0x996519,_0x4afa60){_0x996519=_0x996519-0x0;var _0xde4902=_0xed5c[_0x996519];return _0xde4902;};'use strict';var _=require('lodash');var util=require(_0xced5('0x0'));var logger=require(_0xced5('0x1'))(_0xced5('0x2'));var moment=require(_0xced5('0x3'));var BPromise=require(_0xced5('0x4'));var rp=require(_0xced5('0x5'));var fs=require('fs');var path=require(_0xced5('0x6'));var rimraf=require(_0xced5('0x7'));var config=require('../../config/environment');var attributes=require(_0xced5('0x8'));module['exports']=function(_0x9dbf6d,_0x596c5b){return _0x9dbf6d['define'](_0xced5('0x9'),attributes,{'tableName':_0xced5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fa7=['lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./integration.attributes','integrations'];(function(_0x269465,_0x282da4){var _0x2417f3=function(_0x5de0c5){while(--_0x5de0c5){_0x269465['push'](_0x269465['shift']());}};_0x2417f3(++_0x282da4);}(_0x2fa7,0x148));var _0x72fa=function(_0x4305ec,_0x2ae1be){_0x4305ec=_0x4305ec-0x0;var _0xf1146a=_0x2fa7[_0x4305ec];return _0xf1146a;};'use strict';var _=require(_0x72fa('0x0'));var util=require('util');var logger=require(_0x72fa('0x1'))('api');var moment=require('moment');var BPromise=require(_0x72fa('0x2'));var rp=require(_0x72fa('0x3'));var fs=require('fs');var path=require(_0x72fa('0x4'));var rimraf=require('rimraf');var config=require(_0x72fa('0x5'));var attributes=require(_0x72fa('0x6'));module['exports']=function(_0x5622ab,_0x2b929e){return _0x5622ab['define']('Integration',attributes,{'tableName':_0x72fa('0x7'),'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 248cfcd..05f8005 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5dadc0,_0x58a3b6){var _0x4e6709=function(_0x102917){while(--_0x102917){_0x5dadc0['push'](_0x5dadc0['shift']());}};_0x4e6709(++_0x58a3b6);}(_0xdb28,0x106));var _0x8db2=function(_0x144940,_0x4f0f85){_0x144940=_0x144940-0x0;var _0x4d0515=_0xdb28[_0x144940];return _0x4d0515;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x108179,_0x22d8d7){var _0x3775c2=function(_0x46636a){while(--_0x46636a){_0x108179['push'](_0x108179['shift']());}};_0x3775c2(++_0x22d8d7);}(_0x955f,0x1eb));var _0xf955=function(_0x3e4387,_0x58a7d6){_0x3e4387=_0x3e4387-0x0;var _0x6b6a99=_0x955f[_0x3e4387];return _0x6b6a99;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 29d03f7..3d7c1e0 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 _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x517cef,_0x1106b7){var _0x198fc1=function(_0x4d1c39){while(--_0x4d1c39){_0x517cef['push'](_0x517cef['shift']());}};_0x198fc1(++_0x1106b7);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2d9820,_0x28c727){_0x2d9820=_0x2d9820-0x0;var _0x30916f=_0xc6ac[_0x2d9820];return _0x30916f;};'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('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x32e914,_0xd23d0d){var _0x1dc496=function(_0xbc86b){while(--_0xbc86b){_0x32e914['push'](_0x32e914['shift']());}};_0x1dc496(++_0xd23d0d);}(_0x5fab,0x177));var _0xb5fa=function(_0x168794,_0x2abf4a){_0x168794=_0x168794-0x0;var _0x5451d7=_0x5fab[_0x168794];return _0x5451d7;};'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('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e10e73e..58c693f 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 _0x0776=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x533db8,_0x267df3){var _0x549d36=function(_0x239602){while(--_0x239602){_0x533db8['push'](_0x533db8['shift']());}};_0x549d36(++_0x267df3);}(_0x0776,0x1c5));var _0x6077=function(_0x1e896e,_0x32d09e){_0x1e896e=_0x1e896e-0x0;var _0x59e126=_0x0776[_0x1e896e];return _0x59e126;};'use strict';var Sequelize=require(_0x6077('0x0'));module[_0x6077('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x6077('0x2')]},'exitStatus':{'type':Sequelize[_0x6077('0x2')]},'ticketId':{'type':Sequelize[_0x6077('0x2')]},'integrationId':{'type':Sequelize[_0x6077('0x3')]},'contacts':{'type':Sequelize[_0x6077('0x2')]},'uniqueid':{'type':Sequelize[_0x6077('0x2')]},'calleridnum':{'type':Sequelize[_0x6077('0x2')]},'calleridname':{'type':Sequelize[_0x6077('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6077('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6077('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6077('0x4')]},'holdtime':{'type':Sequelize[_0x6077('0x3')]},'agentcomplete':{'type':Sequelize[_0x6077('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6077('0x4')]},'talktime':{'type':Sequelize[_0x6077('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6077('0x3')]},'reason':{'type':Sequelize[_0x6077('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6077('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6077('0x2')]},'channel':{'type':Sequelize[_0x6077('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6077('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6077('0x2')]},'connectedlinename':{'type':Sequelize[_0x6077('0x2')]},'language':{'type':Sequelize[_0x6077('0x2')]},'accountcode':{'type':Sequelize[_0x6077('0x2')]},'context':{'type':Sequelize[_0x6077('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6077('0x2')]},'destchannel':{'type':Sequelize[_0x6077('0x2')]},'destchannelstate':{'type':Sequelize[_0x6077('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6077('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6077('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6077('0x2')]},'destlanguage':{'type':Sequelize[_0x6077('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6077('0x2')]},'destexten':{'type':Sequelize[_0x6077('0x2')]},'destpriority':{'type':Sequelize[_0x6077('0x2')]},'destuniqueid':{'type':Sequelize[_0x6077('0x2')]},'messageId':{'type':Sequelize[_0x6077('0x2')]},'inReplyTo':{'type':Sequelize[_0x6077('0x2')]},'subject':{'type':Sequelize[_0x6077('0x2')]},'from':{'type':Sequelize[_0x6077('0x2')]},'to':{'type':Sequelize[_0x6077('0x2')]},'cc':{'type':Sequelize[_0x6077('0x2')]},'attachment':{'type':Sequelize[_0x6077('0x6')]},'html':{'type':Sequelize[_0x6077('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x6077('0x7')](_0x6077('0x8'),_0x6077('0x9'),_0x6077('0xa'),_0x6077('0xb'))},'url':{'type':Sequelize[_0x6077('0x2')]},'app':{'type':Sequelize[_0x6077('0x2')]},'appdata':{'type':Sequelize[_0x6077('0x2')]},'projectId':{'type':Sequelize[_0x6077('0x3')]}}; \ No newline at end of file +var _0x9853=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9853,0x14b));var _0x3985=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x9853[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require('sequelize');module[_0x3985('0x0')]={'integration':{'type':Sequelize[_0x3985('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x3985('0x1')]},'integrationId':{'type':Sequelize[_0x3985('0x2')]},'contacts':{'type':Sequelize[_0x3985('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3985('0x1')]},'calleridname':{'type':Sequelize[_0x3985('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3985('0x1')]},'membername':{'type':Sequelize[_0x3985('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3985('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3985('0x3')]},'talktime':{'type':Sequelize[_0x3985('0x2')]},'agentacw':{'type':Sequelize[_0x3985('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3985('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3985('0x3')]},'agentdump':{'type':Sequelize[_0x3985('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3985('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3985('0x1')]},'channelstate':{'type':Sequelize[_0x3985('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3985('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3985('0x1')]},'connectedlinename':{'type':Sequelize[_0x3985('0x1')]},'language':{'type':Sequelize[_0x3985('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3985('0x1')]},'priority':{'type':Sequelize[_0x3985('0x1')]},'destchannel':{'type':Sequelize[_0x3985('0x1')]},'destchannelstate':{'type':Sequelize[_0x3985('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3985('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3985('0x1')]},'destcalleridname':{'type':Sequelize[_0x3985('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x3985('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x3985('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3985('0x1')]},'destpriority':{'type':Sequelize[_0x3985('0x1')]},'destuniqueid':{'type':Sequelize[_0x3985('0x1')]},'messageId':{'type':Sequelize[_0x3985('0x1')]},'inReplyTo':{'type':Sequelize[_0x3985('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x3985('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x3985('0x5')]},'html':{'type':Sequelize[_0x3985('0x5')]},'text':{'type':Sequelize[_0x3985('0x5')]},'status':{'type':Sequelize[_0x3985('0x6')](_0x3985('0x7'),'SENDING',_0x3985('0x8'),_0x3985('0x9'))},'url':{'type':Sequelize[_0x3985('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x3985('0x1')]},'projectId':{'type':Sequelize[_0x3985('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d6ce7fc..2ea0cbc 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 _0x6a99=['to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','apply','reject','save','update','then','end','error','name','send','index','IntegrationReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x57fbad,_0x4e3dcb){var _0x21fa8c=function(_0x5fcb87){while(--_0x5fcb87){_0x57fbad['push'](_0x57fbad['shift']());}};_0x21fa8c(++_0x4e3dcb);}(_0x6a99,0x16a));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x96a9('0x0'));var rimraf=require(_0x96a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x96a9('0x2'));var moment=require(_0x96a9('0x3'));var BPromise=require(_0x96a9('0x4'));var Mustache=require(_0x96a9('0x5'));var util=require(_0x96a9('0x6'));var path=require('path');var sox=require(_0x96a9('0x7'));var csv=require(_0x96a9('0x8'));var ejs=require(_0x96a9('0x9'));var fs=require('fs');var fs_extra=require(_0x96a9('0xa'));var _=require(_0x96a9('0xb'));var squel=require(_0x96a9('0xc'));var crypto=require(_0x96a9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96a9('0xe'));var Papa=require(_0x96a9('0xf'));var Redis=require('ioredis');var authService=require(_0x96a9('0x10'));var qs=require(_0x96a9('0x11'));var as=require(_0x96a9('0x12'));var hardwareService=require(_0x96a9('0x13'));var logger=require(_0x96a9('0x14'))(_0x96a9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x96a9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x348a8c,_0x58f2ac){_0x58f2ac=_0x58f2ac||0xcc;return function(_0x9db504){if(_0x9db504){return _0x348a8c[_0x96a9('0x17')](_0x58f2ac);}return _0x348a8c[_0x96a9('0x18')](_0x58f2ac)['end']();};}function respondWithResult(_0x41064d,_0x2699e8){_0x2699e8=_0x2699e8||0xc8;return function(_0x56d3ca){if(_0x56d3ca){return _0x41064d[_0x96a9('0x18')](_0x2699e8)['json'](_0x56d3ca);}};}function respondWithFilteredResult(_0x2ed7d7,_0x39ed38){return function(_0x336aa7){if(_0x336aa7){var _0x4b15a4=typeof _0x39ed38['offset']===_0x96a9('0x19')&&typeof _0x39ed38[_0x96a9('0x1a')]===_0x96a9('0x19');var _0x19bf17=_0x336aa7[_0x96a9('0x1b')];var _0x3aced5=_0x4b15a4?0x0:_0x39ed38[_0x96a9('0x1c')];var _0x1fc73e=_0x4b15a4?_0x336aa7[_0x96a9('0x1b')]:_0x39ed38[_0x96a9('0x1c')]+_0x39ed38[_0x96a9('0x1a')];var _0x4ddc37;if(_0x1fc73e>=_0x19bf17){_0x1fc73e=_0x19bf17;_0x4ddc37=0xc8;}else{_0x4ddc37=0xce;}_0x2ed7d7['status'](_0x4ddc37);return _0x2ed7d7[_0x96a9('0x1d')]('Content-Range',_0x3aced5+'-'+_0x1fc73e+'/'+_0x19bf17)['json'](_0x336aa7);}return null;};}function patchUpdates(_0x1b5e3d){return function(_0x50925b){try{jsonpatch[_0x96a9('0x1e')](_0x50925b,_0x1b5e3d,!![]);}catch(_0x24d335){return BPromise[_0x96a9('0x1f')](_0x24d335);}return _0x50925b[_0x96a9('0x20')]();};}function saveUpdates(_0x52e2d1,_0x35747e){return function(_0x43be2c){if(_0x43be2c){return _0x43be2c[_0x96a9('0x21')](_0x52e2d1)['then'](function(_0x1aceb3){return _0x1aceb3;});}return null;};}function removeEntity(_0x2bbfed,_0x1e2dd3){return function(_0x12a3c2){if(_0x12a3c2){return _0x12a3c2['destroy']()[_0x96a9('0x22')](function(){_0x2bbfed['status'](0xcc)[_0x96a9('0x23')]();});}};}function handleEntityNotFound(_0xd73cbc,_0x21a13b){return function(_0x4dbdbf){if(!_0x4dbdbf){_0xd73cbc[_0x96a9('0x17')](0x194);}return _0x4dbdbf;};}function handleError(_0x420e58,_0x1f4c98){_0x1f4c98=_0x1f4c98||0x1f4;return function(_0x2bbe11){logger[_0x96a9('0x24')](_0x2bbe11['stack']);if(_0x2bbe11[_0x96a9('0x25')]){delete _0x2bbe11[_0x96a9('0x25')];}_0x420e58[_0x96a9('0x18')](_0x1f4c98)[_0x96a9('0x26')](_0x2bbe11);};}exports[_0x96a9('0x27')]=function(_0x5b04a8,_0x5280f0){var _0x442591={},_0x659103={},_0x230cf4={'count':0x0,'rows':[]};var _0xafb6a9=_['map'](db[_0x96a9('0x28')]['rawAttributes'],function(_0x57e29d){return{'name':_0x57e29d[_0x96a9('0x29')],'type':_0x57e29d[_0x96a9('0x2a')][_0x96a9('0x2b')]};});_0x659103[_0x96a9('0x2c')]=_[_0x96a9('0x2d')](_0xafb6a9,_0x96a9('0x25'));_0x659103[_0x96a9('0x2e')]=_[_0x96a9('0x2f')](_0x5b04a8[_0x96a9('0x2e')]);_0x659103['filters']=_[_0x96a9('0x30')](_0x659103[_0x96a9('0x2c')],_0x659103['query']);_0x442591[_0x96a9('0x31')]=_[_0x96a9('0x30')](_0x659103[_0x96a9('0x2c')],qs[_0x96a9('0x32')](_0x5b04a8['query'][_0x96a9('0x32')]));_0x442591[_0x96a9('0x31')]=_0x442591[_0x96a9('0x31')][_0x96a9('0x33')]?_0x442591[_0x96a9('0x31')]:_0x659103[_0x96a9('0x2c')];if(!_0x5b04a8[_0x96a9('0x2e')][_0x96a9('0x34')](_0x96a9('0x35'))){_0x442591[_0x96a9('0x1a')]=qs[_0x96a9('0x1a')](_0x5b04a8[_0x96a9('0x2e')][_0x96a9('0x1a')]);_0x442591[_0x96a9('0x1c')]=qs[_0x96a9('0x1c')](_0x5b04a8['query'][_0x96a9('0x1c')]);}_0x442591['order']=qs[_0x96a9('0x36')](_0x5b04a8[_0x96a9('0x2e')]['sort']);_0x442591['where']=qs[_0x96a9('0x37')](_[_0x96a9('0x38')](_0x5b04a8['query'],_0x659103[_0x96a9('0x37')]),_0xafb6a9);if(_0x5b04a8[_0x96a9('0x2e')][_0x96a9('0x39')]){_0x442591['where']=_[_0x96a9('0x3a')](_0x442591[_0x96a9('0x3b')],{'$or':_[_0x96a9('0x2d')](_0xafb6a9,function(_0x165f5a){if(_0x165f5a['type']!=='VIRTUAL'){var _0x56e2e9={};_0x56e2e9[_0x165f5a[_0x96a9('0x25')]]={'$like':'%'+_0x5b04a8[_0x96a9('0x2e')]['filter']+'%'};return _0x56e2e9;}})});}_0x442591=_[_0x96a9('0x3a')]({},_0x442591,_0x5b04a8['options']);var _0x4b6dfc={'where':_0x442591[_0x96a9('0x3b')]};return db[_0x96a9('0x28')][_0x96a9('0x1b')](_0x4b6dfc)['then'](function(_0x24ed3d){_0x230cf4[_0x96a9('0x1b')]=_0x24ed3d;if(_0x5b04a8['query'][_0x96a9('0x3c')]){_0x442591[_0x96a9('0x3d')]=[{'all':!![]}];}return db[_0x96a9('0x28')][_0x96a9('0x3e')](_0x442591);})[_0x96a9('0x22')](function(_0x253341){_0x230cf4[_0x96a9('0x3f')]=_0x253341;return _0x230cf4;})[_0x96a9('0x22')](respondWithFilteredResult(_0x5280f0,_0x442591))[_0x96a9('0x40')](handleError(_0x5280f0,null));};exports[_0x96a9('0x41')]=function(_0x825fc6,_0x3f21af){var _0x54cf11={'raw':![],'where':{'id':_0x825fc6[_0x96a9('0x42')]['id']}},_0x5f5d9b={};_0x5f5d9b[_0x96a9('0x2c')]=_[_0x96a9('0x2f')](db['IntegrationReport'][_0x96a9('0x43')]);_0x5f5d9b['query']=_['keys'](_0x825fc6[_0x96a9('0x2e')]);_0x5f5d9b[_0x96a9('0x37')]=_[_0x96a9('0x30')](_0x5f5d9b[_0x96a9('0x2c')],_0x5f5d9b['query']);_0x54cf11[_0x96a9('0x31')]=_['intersection'](_0x5f5d9b[_0x96a9('0x2c')],qs[_0x96a9('0x32')](_0x825fc6['query']['fields']));_0x54cf11[_0x96a9('0x31')]=_0x54cf11['attributes'][_0x96a9('0x33')]?_0x54cf11[_0x96a9('0x31')]:_0x5f5d9b[_0x96a9('0x2c')];if(_0x825fc6[_0x96a9('0x2e')][_0x96a9('0x3c')]){_0x54cf11[_0x96a9('0x3d')]=[{'all':!![]}];}_0x54cf11=_[_0x96a9('0x3a')]({},_0x54cf11,_0x825fc6[_0x96a9('0x44')]);return db[_0x96a9('0x28')]['find'](_0x54cf11)['then'](handleEntityNotFound(_0x3f21af,null))['then'](respondWithResult(_0x3f21af,null))[_0x96a9('0x40')](handleError(_0x3f21af,null));};exports[_0x96a9('0x45')]=function(_0x34d2e1,_0x235dfc){return db[_0x96a9('0x28')][_0x96a9('0x45')](_0x34d2e1['body'],{})[_0x96a9('0x22')](respondWithResult(_0x235dfc,0xc9))[_0x96a9('0x40')](handleError(_0x235dfc,null));};exports['update']=function(_0x107e37,_0x23f686){if(_0x107e37[_0x96a9('0x46')]['id']){delete _0x107e37[_0x96a9('0x46')]['id'];}return db[_0x96a9('0x28')][_0x96a9('0x47')]({'where':{'id':_0x107e37['params']['id']}})[_0x96a9('0x22')](handleEntityNotFound(_0x23f686,null))[_0x96a9('0x22')](saveUpdates(_0x107e37[_0x96a9('0x46')],null))[_0x96a9('0x22')](respondWithResult(_0x23f686,null))[_0x96a9('0x40')](handleError(_0x23f686,null));};exports[_0x96a9('0x48')]=function(_0x274aeb,_0x366b0a){return db[_0x96a9('0x28')][_0x96a9('0x47')]({'where':{'id':_0x274aeb['params']['id']}})[_0x96a9('0x22')](handleEntityNotFound(_0x366b0a,null))[_0x96a9('0x22')](removeEntity(_0x366b0a,null))[_0x96a9('0x40')](handleError(_0x366b0a,null));};exports['describe']=function(_0x4c223f,_0x51e2f3){return db[_0x96a9('0x28')][_0x96a9('0x49')]()[_0x96a9('0x22')](respondWithResult(_0x51e2f3,null))[_0x96a9('0x40')](handleError(_0x51e2f3,null));}; \ No newline at end of file +var _0xac40=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','fieldName','type'];(function(_0x494a42,_0x1f2103){var _0x254792=function(_0x5f1c1d){while(--_0x5f1c1d){_0x494a42['push'](_0x494a42['shift']());}};_0x254792(++_0x1f2103);}(_0xac40,0x1e8));var _0x0ac4=function(_0xb19b07,_0x3a91e1){_0xb19b07=_0xb19b07-0x0;var _0x246e7c=_0xac40[_0xb19b07];return _0x246e7c;};'use strict';var emlformat=require(_0x0ac4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ac4('0x1'));var jsonpatch=require(_0x0ac4('0x2'));var rp=require(_0x0ac4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0ac4('0x4'));var util=require(_0x0ac4('0x5'));var path=require(_0x0ac4('0x6'));var sox=require(_0x0ac4('0x7'));var csv=require(_0x0ac4('0x8'));var ejs=require(_0x0ac4('0x9'));var fs=require('fs');var fs_extra=require(_0x0ac4('0xa'));var _=require(_0x0ac4('0xb'));var squel=require(_0x0ac4('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ac4('0xd'));var deskjs=require(_0x0ac4('0xe'));var toCsv=require(_0x0ac4('0x8'));var querystring=require(_0x0ac4('0xf'));var Papa=require('papaparse');var Redis=require(_0x0ac4('0x10'));var authService=require(_0x0ac4('0x11'));var qs=require(_0x0ac4('0x12'));var as=require(_0x0ac4('0x13'));var hardwareService=require(_0x0ac4('0x14'));var logger=require(_0x0ac4('0x15'))(_0x0ac4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ac4('0x17'));var db=require(_0x0ac4('0x18'))['db'];function respondWithStatusCode(_0xf9f008,_0x5e5535){_0x5e5535=_0x5e5535||0xcc;return function(_0x564324){if(_0x564324){return _0xf9f008['sendStatus'](_0x5e5535);}return _0xf9f008['status'](_0x5e5535)[_0x0ac4('0x19')]();};}function respondWithResult(_0x488160,_0x4b2642){_0x4b2642=_0x4b2642||0xc8;return function(_0x188a13){if(_0x188a13){return _0x488160['status'](_0x4b2642)[_0x0ac4('0x1a')](_0x188a13);}};}function respondWithFilteredResult(_0x440698,_0x51dad9){return function(_0x53dfa5){if(_0x53dfa5){var _0x5d4f24=typeof _0x51dad9[_0x0ac4('0x1b')]===_0x0ac4('0x1c')&&typeof _0x51dad9[_0x0ac4('0x1d')]===_0x0ac4('0x1c');var _0x15e69c=_0x53dfa5[_0x0ac4('0x1e')];var _0x2722f1=_0x5d4f24?0x0:_0x51dad9['offset'];var _0x22b6bb=_0x5d4f24?_0x53dfa5[_0x0ac4('0x1e')]:_0x51dad9['offset']+_0x51dad9[_0x0ac4('0x1d')];var _0x4eee11;if(_0x22b6bb>=_0x15e69c){_0x22b6bb=_0x15e69c;_0x4eee11=0xc8;}else{_0x4eee11=0xce;}_0x440698[_0x0ac4('0x1f')](_0x4eee11);return _0x440698[_0x0ac4('0x20')](_0x0ac4('0x21'),_0x2722f1+'-'+_0x22b6bb+'/'+_0x15e69c)[_0x0ac4('0x1a')](_0x53dfa5);}return null;};}function patchUpdates(_0x383e83){return function(_0x202561){try{jsonpatch[_0x0ac4('0x22')](_0x202561,_0x383e83,!![]);}catch(_0x13fc95){return BPromise['reject'](_0x13fc95);}return _0x202561['save']();};}function saveUpdates(_0x204fec,_0x404ce6){return function(_0x5a32d5){if(_0x5a32d5){return _0x5a32d5[_0x0ac4('0x23')](_0x204fec)[_0x0ac4('0x24')](function(_0x1e7aab){return _0x1e7aab;});}return null;};}function removeEntity(_0x28cffa,_0x63b002){return function(_0x284802){if(_0x284802){return _0x284802[_0x0ac4('0x25')]()[_0x0ac4('0x24')](function(){_0x28cffa['status'](0xcc)[_0x0ac4('0x19')]();});}};}function handleEntityNotFound(_0x34ee2a,_0x267273){return function(_0x47de2b){if(!_0x47de2b){_0x34ee2a[_0x0ac4('0x26')](0x194);}return _0x47de2b;};}function handleError(_0x1ff51f,_0x35ce33){_0x35ce33=_0x35ce33||0x1f4;return function(_0x1d1882){logger[_0x0ac4('0x27')](_0x1d1882[_0x0ac4('0x28')]);if(_0x1d1882['name']){delete _0x1d1882[_0x0ac4('0x29')];}_0x1ff51f[_0x0ac4('0x1f')](_0x35ce33)['send'](_0x1d1882);};}exports['index']=function(_0x43b3b2,_0x321c39){var _0x5eceb3={},_0x4cbaaa={},_0xcc1af4={'count':0x0,'rows':[]};var _0x3950f9=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x2affae){return{'name':_0x2affae[_0x0ac4('0x2a')],'type':_0x2affae[_0x0ac4('0x2b')][_0x0ac4('0x2c')]};});_0x4cbaaa['model']=_[_0x0ac4('0x2d')](_0x3950f9,_0x0ac4('0x29'));_0x4cbaaa[_0x0ac4('0x2e')]=_[_0x0ac4('0x2f')](_0x43b3b2[_0x0ac4('0x2e')]);_0x4cbaaa[_0x0ac4('0x30')]=_[_0x0ac4('0x31')](_0x4cbaaa[_0x0ac4('0x32')],_0x4cbaaa[_0x0ac4('0x2e')]);_0x5eceb3[_0x0ac4('0x33')]=_[_0x0ac4('0x31')](_0x4cbaaa[_0x0ac4('0x32')],qs[_0x0ac4('0x34')](_0x43b3b2[_0x0ac4('0x2e')]['fields']));_0x5eceb3['attributes']=_0x5eceb3[_0x0ac4('0x33')][_0x0ac4('0x35')]?_0x5eceb3[_0x0ac4('0x33')]:_0x4cbaaa[_0x0ac4('0x32')];if(!_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x36')](_0x0ac4('0x37'))){_0x5eceb3['limit']=qs[_0x0ac4('0x1d')](_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x1d')]);_0x5eceb3[_0x0ac4('0x1b')]=qs[_0x0ac4('0x1b')](_0x43b3b2['query'][_0x0ac4('0x1b')]);}_0x5eceb3[_0x0ac4('0x38')]=qs['sort'](_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x39')]);_0x5eceb3[_0x0ac4('0x3a')]=qs[_0x0ac4('0x30')](_[_0x0ac4('0x3b')](_0x43b3b2[_0x0ac4('0x2e')],_0x4cbaaa[_0x0ac4('0x30')]),_0x3950f9);if(_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x3c')]){_0x5eceb3['where']=_[_0x0ac4('0x3d')](_0x5eceb3['where'],{'$or':_[_0x0ac4('0x2d')](_0x3950f9,function(_0x1891eb){if(_0x1891eb[_0x0ac4('0x2b')]!==_0x0ac4('0x3e')){var _0x3177b6={};_0x3177b6[_0x1891eb['name']]={'$like':'%'+_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x3c')]+'%'};return _0x3177b6;}})});}_0x5eceb3=_[_0x0ac4('0x3d')]({},_0x5eceb3,_0x43b3b2[_0x0ac4('0x3f')]);var _0x5b25af={'where':_0x5eceb3[_0x0ac4('0x3a')]};return db[_0x0ac4('0x40')]['count'](_0x5b25af)[_0x0ac4('0x24')](function(_0x32e1fb){_0xcc1af4[_0x0ac4('0x1e')]=_0x32e1fb;if(_0x43b3b2[_0x0ac4('0x2e')][_0x0ac4('0x41')]){_0x5eceb3[_0x0ac4('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0ac4('0x43')](_0x5eceb3);})[_0x0ac4('0x24')](function(_0x14bd06){_0xcc1af4['rows']=_0x14bd06;return _0xcc1af4;})[_0x0ac4('0x24')](respondWithFilteredResult(_0x321c39,_0x5eceb3))[_0x0ac4('0x44')](handleError(_0x321c39,null));};exports[_0x0ac4('0x45')]=function(_0x21e03d,_0x186229){var _0x390fdc={'raw':![],'where':{'id':_0x21e03d['params']['id']}},_0x59b6d8={};_0x59b6d8[_0x0ac4('0x32')]=_[_0x0ac4('0x2f')](db[_0x0ac4('0x40')][_0x0ac4('0x46')]);_0x59b6d8[_0x0ac4('0x2e')]=_[_0x0ac4('0x2f')](_0x21e03d['query']);_0x59b6d8[_0x0ac4('0x30')]=_[_0x0ac4('0x31')](_0x59b6d8[_0x0ac4('0x32')],_0x59b6d8[_0x0ac4('0x2e')]);_0x390fdc[_0x0ac4('0x33')]=_[_0x0ac4('0x31')](_0x59b6d8['model'],qs[_0x0ac4('0x34')](_0x21e03d[_0x0ac4('0x2e')][_0x0ac4('0x34')]));_0x390fdc[_0x0ac4('0x33')]=_0x390fdc[_0x0ac4('0x33')][_0x0ac4('0x35')]?_0x390fdc[_0x0ac4('0x33')]:_0x59b6d8[_0x0ac4('0x32')];if(_0x21e03d[_0x0ac4('0x2e')][_0x0ac4('0x41')]){_0x390fdc['include']=[{'all':!![]}];}_0x390fdc=_['merge']({},_0x390fdc,_0x21e03d[_0x0ac4('0x3f')]);return db[_0x0ac4('0x40')]['find'](_0x390fdc)[_0x0ac4('0x24')](handleEntityNotFound(_0x186229,null))[_0x0ac4('0x24')](respondWithResult(_0x186229,null))[_0x0ac4('0x44')](handleError(_0x186229,null));};exports['create']=function(_0x52676c,_0x49c9b6){return db[_0x0ac4('0x40')][_0x0ac4('0x47')](_0x52676c[_0x0ac4('0x48')],{})['then'](respondWithResult(_0x49c9b6,0xc9))[_0x0ac4('0x44')](handleError(_0x49c9b6,null));};exports[_0x0ac4('0x23')]=function(_0x491121,_0x35104c){if(_0x491121['body']['id']){delete _0x491121[_0x0ac4('0x48')]['id'];}return db[_0x0ac4('0x40')]['find']({'where':{'id':_0x491121['params']['id']}})[_0x0ac4('0x24')](handleEntityNotFound(_0x35104c,null))[_0x0ac4('0x24')](saveUpdates(_0x491121[_0x0ac4('0x48')],null))[_0x0ac4('0x24')](respondWithResult(_0x35104c,null))[_0x0ac4('0x44')](handleError(_0x35104c,null));};exports['destroy']=function(_0x2c8065,_0xe4d790){return db['IntegrationReport'][_0x0ac4('0x49')]({'where':{'id':_0x2c8065[_0x0ac4('0x4a')]['id']}})[_0x0ac4('0x24')](handleEntityNotFound(_0xe4d790,null))[_0x0ac4('0x24')](removeEntity(_0xe4d790,null))['catch'](handleError(_0xe4d790,null));};exports[_0x0ac4('0x4b')]=function(_0x3cca47,_0x53f32f){return db[_0x0ac4('0x40')][_0x0ac4('0x4b')]()[_0x0ac4('0x24')](respondWithResult(_0x53f32f,null))[_0x0ac4('0x44')](handleError(_0x53f32f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 05888d9..8c334ef 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 _0x3a63=['./integrationReport.attributes','exports','IntegrationReport','report_integration','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3a63,0x10c));var _0x33a6=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x3a63[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x33a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33a6('0x1'));var moment=require(_0x33a6('0x2'));var BPromise=require('bluebird');var rp=require(_0x33a6('0x3'));var fs=require('fs');var path=require(_0x33a6('0x4'));var rimraf=require(_0x33a6('0x5'));var config=require(_0x33a6('0x6'));var attributes=require(_0x33a6('0x7'));module[_0x33a6('0x8')]=function(_0x56f6f2,_0xd644b6){return _0x56f6f2['define'](_0x33a6('0x9'),attributes,{'tableName':_0x33a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab3a=['api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','lodash','util','../../config/logger'];(function(_0x374a3,_0x451296){var _0x38f7ad=function(_0x36c903){while(--_0x36c903){_0x374a3['push'](_0x374a3['shift']());}};_0x38f7ad(++_0x451296);}(_0xab3a,0x7f));var _0xaab3=function(_0x389b48,_0x2a1760){_0x389b48=_0x389b48-0x0;var _0x1cc751=_0xab3a[_0x389b48];return _0x1cc751;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var logger=require(_0xaab3('0x2'))(_0xaab3('0x3'));var moment=require(_0xaab3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaab3('0x5'));var rimraf=require(_0xaab3('0x6'));var config=require(_0xaab3('0x7'));var attributes=require(_0xaab3('0x8'));module['exports']=function(_0x353448,_0x43fc98){return _0x353448['define'](_0xaab3('0x9'),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 46b2b66..20ae416 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'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')]('IntegrationReport,\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);});});} \ No newline at end of file +var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3bdf1b,_0x2b1f6d){var _0x5618f9=function(_0x108a60){while(--_0x108a60){_0x3bdf1b['push'](_0x3bdf1b['shift']());}};_0x5618f9(++_0x2b1f6d);}(_0x326f,0xd1));var _0xf326=function(_0x5a1fac,_0x5e30b6){_0x5a1fac=_0x5a1fac-0x0;var _0x2d6836=_0x326f[_0x5a1fac];return _0x2d6836;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 4242568..eaeb266 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 _0x4d61=['addIntervals','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many'];(function(_0xdf05e9,_0x4a0eaa){var _0x359b53=function(_0x34d527){while(--_0x34d527){_0xdf05e9['push'](_0xdf05e9['shift']());}};_0x359b53(++_0x4a0eaa);}(_0x4d61,0x147));var _0x14d6=function(_0x49036e,_0x1eed49){_0x49036e=_0x49036e-0x0;var _0xb21daf=_0x4d61[_0x49036e];return _0xb21daf;};'use strict';var multer=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var path=require(_0x14d6('0x2'));var timeout=require(_0x14d6('0x3'));var express=require(_0x14d6('0x4'));var router=express[_0x14d6('0x5')]();var fs_extra=require(_0x14d6('0x6'));var auth=require(_0x14d6('0x7'));var interaction=require(_0x14d6('0x8'));var config=require('../../config/environment');var controller=require(_0x14d6('0x9'));router[_0x14d6('0xa')]('/',auth[_0x14d6('0xb')](),controller[_0x14d6('0xc')]);router[_0x14d6('0xa')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['show']);router[_0x14d6('0xa')]('/:id/sub_intervals',auth[_0x14d6('0xb')](),controller['getIntervals']);router[_0x14d6('0xe')]('/',auth[_0x14d6('0xb')](),controller['create']);router[_0x14d6('0xe')](_0x14d6('0xf'),auth[_0x14d6('0xb')](),controller[_0x14d6('0x10')]);router[_0x14d6('0xe')](_0x14d6('0x11'),auth[_0x14d6('0xb')](),controller[_0x14d6('0x12')]);router[_0x14d6('0x13')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['update']);router[_0x14d6('0x14')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller[_0x14d6('0x15')]);module[_0x14d6('0x16')]=router; \ No newline at end of file +var _0xe132=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','addIntervals','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1bd76a,_0x5e467a){var _0x548d7e=function(_0x3c1b1a){while(--_0x3c1b1a){_0x1bd76a['push'](_0x1bd76a['shift']());}};_0x548d7e(++_0x5e467a);}(_0xe132,0x162));var _0x2e13=function(_0xac8efd,_0x5e14c7){_0xac8efd=_0xac8efd-0x0;var _0x5bef7b=_0xe132[_0xac8efd];return _0x5bef7b;};'use strict';var multer=require(_0x2e13('0x0'));var util=require('util');var path=require(_0x2e13('0x1'));var timeout=require(_0x2e13('0x2'));var express=require(_0x2e13('0x3'));var router=express[_0x2e13('0x4')]();var fs_extra=require(_0x2e13('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var controller=require('./interval.controller');router['get']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0x9')]);router[_0x2e13('0xa')](_0x2e13('0xb'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xc')]);router[_0x2e13('0xa')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xe')]);router['post']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0xf')]);router[_0x2e13('0x10')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x11')]);router[_0x2e13('0x10')]('/:id/sub_intervals/create_many',auth[_0x2e13('0x8')](),controller[_0x2e13('0x12')]);router[_0x2e13('0x13')](_0x2e13('0xb'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x14')]);router[_0x2e13('0x15')]('/:id',auth[_0x2e13('0x8')](),controller[_0x2e13('0x16')]);module[_0x2e13('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 0c5cc40..ad1b3ff 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 _0x25a1=['exports','STRING','sequelize'];(function(_0x24a560,_0x3085a4){var _0x1aa520=function(_0x257392){while(--_0x257392){_0x24a560['push'](_0x24a560['shift']());}};_0x1aa520(++_0x3085a4);}(_0x25a1,0x1ca));var _0x125a=function(_0x1b57f5,_0x1bf64d){_0x1b57f5=_0x1b57f5-0x0;var _0x264be0=_0x25a1[_0x1b57f5];return _0x264be0;};'use strict';var Sequelize=require(_0x125a('0x0'));module[_0x125a('0x1')]={'name':{'type':Sequelize[_0x125a('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x125a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xab84=['sequelize','exports','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xab84,0x1b6));var _0x4ab8=function(_0x2a99ab,_0x3a324b){_0x2a99ab=_0x2a99ab-0x0;var _0x4affc7=_0xab84[_0x2a99ab];return _0x4affc7;};'use strict';var Sequelize=require(_0x4ab8('0x0'));module[_0x4ab8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ab8('0x2')]},'interval':{'type':Sequelize[_0x4ab8('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 f9add56..63267f9 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 _0x3149=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','offset','undefined','limit','count','set','apply','save','update','then','get','UserProfileResource','destroy','end','error','name','send','index','map','Interval','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1d46c7,_0x5ebda6){var _0x2a328f=function(_0x3725a8){while(--_0x3725a8){_0x1d46c7['push'](_0x1d46c7['shift']());}};_0x2a328f(++_0x5ebda6);}(_0x3149,0xf5));var _0x9314=function(_0x927dc8,_0x95f32b){_0x927dc8=_0x927dc8-0x0;var _0x48d23b=_0x3149[_0x927dc8];return _0x48d23b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9314('0x0'));var zipdir=require(_0x9314('0x1'));var jsonpatch=require(_0x9314('0x2'));var rp=require(_0x9314('0x3'));var moment=require(_0x9314('0x4'));var BPromise=require(_0x9314('0x5'));var Mustache=require('mustache');var util=require(_0x9314('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9314('0x7'));var _=require(_0x9314('0x8'));var squel=require(_0x9314('0x9'));var crypto=require(_0x9314('0xa'));var jsforce=require(_0x9314('0xb'));var deskjs=require(_0x9314('0xc'));var toCsv=require(_0x9314('0xd'));var querystring=require(_0x9314('0xe'));var Papa=require(_0x9314('0xf'));var Redis=require(_0x9314('0x10'));var authService=require(_0x9314('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9314('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9314('0x13'))(_0x9314('0x14'));var utils=require(_0x9314('0x15'));var config=require(_0x9314('0x16'));var licenseUtil=require(_0x9314('0x17'));var db=require(_0x9314('0x18'))['db'];var extensions=require(_0x9314('0x19'));function respondWithStatusCode(_0xf813fd,_0x2e9cd1){_0x2e9cd1=_0x2e9cd1||0xcc;return function(_0x447225){if(_0x447225){return _0xf813fd['sendStatus'](_0x2e9cd1);}return _0xf813fd[_0x9314('0x1a')](_0x2e9cd1)['end']();};}function respondWithResult(_0x146345,_0x391864){_0x391864=_0x391864||0xc8;return function(_0x392368){if(_0x392368){return _0x146345['status'](_0x391864)['json'](_0x392368);}};}function respondWithFilteredResult(_0x1f60bf,_0x9d51d){return function(_0x551343){if(_0x551343){var _0xb97c47=typeof _0x9d51d[_0x9314('0x1b')]===_0x9314('0x1c')&&typeof _0x9d51d[_0x9314('0x1d')]==='undefined';var _0x1fac12=_0x551343[_0x9314('0x1e')];var _0x1454d2=_0xb97c47?0x0:_0x9d51d['offset'];var _0xeb45c8=_0xb97c47?_0x551343[_0x9314('0x1e')]:_0x9d51d[_0x9314('0x1b')]+_0x9d51d[_0x9314('0x1d')];var _0x19238e;if(_0xeb45c8>=_0x1fac12){_0xeb45c8=_0x1fac12;_0x19238e=0xc8;}else{_0x19238e=0xce;}_0x1f60bf[_0x9314('0x1a')](_0x19238e);return _0x1f60bf[_0x9314('0x1f')]('Content-Range',_0x1454d2+'-'+_0xeb45c8+'/'+_0x1fac12)['json'](_0x551343);}return null;};}function patchUpdates(_0x353c4e){return function(_0x284315){try{jsonpatch[_0x9314('0x20')](_0x284315,_0x353c4e,!![]);}catch(_0x572112){return BPromise['reject'](_0x572112);}return _0x284315[_0x9314('0x21')]();};}function saveUpdates(_0x3c3f97,_0x44809c){return function(_0x127ede){if(_0x127ede){return _0x127ede[_0x9314('0x22')](_0x3c3f97)[_0x9314('0x23')](function(_0x436819){return _0x436819;});}return null;};}function removeEntity(_0x5348e7,_0x2cd4f3){return function(_0x1ca5be){if(_0x1ca5be){return _0x1ca5be['destroy']()['then'](function(){var _0x205276=_0x1ca5be[_0x9314('0x24')]({'plain':!![]});var _0x38b59b='Intervals';return db[_0x9314('0x25')][_0x9314('0x26')]({'where':{'type':_0x38b59b,'resourceId':_0x205276['id']}})[_0x9314('0x23')](function(){return _0x1ca5be;});})['then'](function(){_0x5348e7[_0x9314('0x1a')](0xcc)[_0x9314('0x27')]();});}};}function handleEntityNotFound(_0x542ff8,_0x3e24fe){return function(_0x21e52c){if(!_0x21e52c){_0x542ff8['sendStatus'](0x194);}return _0x21e52c;};}function handleError(_0x17e333,_0x36ea34){_0x36ea34=_0x36ea34||0x1f4;return function(_0x94848a){logger[_0x9314('0x28')](_0x94848a['stack']);if(_0x94848a['name']){delete _0x94848a[_0x9314('0x29')];}_0x17e333[_0x9314('0x1a')](_0x36ea34)[_0x9314('0x2a')](_0x94848a);};}exports[_0x9314('0x2b')]=function(_0x2d362e,_0x2ad4b5){var _0x4469be={},_0x5731dc={},_0x4f5ee1={'count':0x0,'rows':[]};var _0x4c129a=_[_0x9314('0x2c')](db[_0x9314('0x2d')]['rawAttributes'],function(_0x399a19){return{'name':_0x399a19[_0x9314('0x2e')],'type':_0x399a19[_0x9314('0x2f')][_0x9314('0x30')]};});_0x5731dc['model']=_[_0x9314('0x2c')](_0x4c129a,_0x9314('0x29'));_0x5731dc[_0x9314('0x31')]=_['keys'](_0x2d362e[_0x9314('0x31')]);_0x5731dc[_0x9314('0x32')]=_['intersection'](_0x5731dc[_0x9314('0x33')],_0x5731dc['query']);_0x4469be['attributes']=_[_0x9314('0x34')](_0x5731dc[_0x9314('0x33')],qs[_0x9314('0x35')](_0x2d362e[_0x9314('0x31')]['fields']));_0x4469be[_0x9314('0x36')]=_0x4469be[_0x9314('0x36')][_0x9314('0x37')]?_0x4469be['attributes']:_0x5731dc[_0x9314('0x33')];if(!_0x2d362e[_0x9314('0x31')]['hasOwnProperty']('nolimit')){_0x4469be[_0x9314('0x1d')]=qs[_0x9314('0x1d')](_0x2d362e[_0x9314('0x31')][_0x9314('0x1d')]);_0x4469be[_0x9314('0x1b')]=qs[_0x9314('0x1b')](_0x2d362e[_0x9314('0x31')][_0x9314('0x1b')]);}_0x4469be['order']=qs[_0x9314('0x38')](_0x2d362e[_0x9314('0x31')][_0x9314('0x38')]);_0x4469be['where']=qs[_0x9314('0x32')](_[_0x9314('0x39')](_0x2d362e[_0x9314('0x31')],_0x5731dc['filters']),_0x4c129a);if(_0x2d362e[_0x9314('0x31')][_0x9314('0x3a')]){_0x4469be[_0x9314('0x3b')]=_[_0x9314('0x3c')](_0x4469be[_0x9314('0x3b')],{'$or':_[_0x9314('0x2c')](_0x4c129a,function(_0x536751){if(_0x536751[_0x9314('0x2f')]!=='VIRTUAL'){var _0x367081={};_0x367081[_0x536751['name']]={'$like':'%'+_0x2d362e['query'][_0x9314('0x3a')]+'%'};return _0x367081;}})});}_0x4469be=_[_0x9314('0x3c')]({},_0x4469be,_0x2d362e[_0x9314('0x3d')]);var _0x53ba1e={'where':_0x4469be[_0x9314('0x3b')]};return db['Interval'][_0x9314('0x1e')](_0x53ba1e)[_0x9314('0x23')](function(_0x31132e){_0x4f5ee1[_0x9314('0x1e')]=_0x31132e;if(_0x2d362e['query'][_0x9314('0x3e')]){_0x4469be[_0x9314('0x3f')]=[{'all':!![]}];}return db[_0x9314('0x2d')][_0x9314('0x40')](_0x4469be);})[_0x9314('0x23')](function(_0x214ead){_0x4f5ee1['rows']=_0x214ead;return _0x4f5ee1;})[_0x9314('0x23')](respondWithFilteredResult(_0x2ad4b5,_0x4469be))[_0x9314('0x41')](handleError(_0x2ad4b5,null));};exports['show']=function(_0x104487,_0x53b093){var _0x565dae={'raw':!![],'where':{'id':_0x104487[_0x9314('0x42')]['id']}},_0x48ef8e={};_0x48ef8e[_0x9314('0x33')]=_[_0x9314('0x43')](db[_0x9314('0x2d')]['rawAttributes']);_0x48ef8e[_0x9314('0x31')]=_['keys'](_0x104487['query']);_0x48ef8e['filters']=_[_0x9314('0x34')](_0x48ef8e[_0x9314('0x33')],_0x48ef8e[_0x9314('0x31')]);_0x565dae[_0x9314('0x36')]=_[_0x9314('0x34')](_0x48ef8e['model'],qs[_0x9314('0x35')](_0x104487[_0x9314('0x31')][_0x9314('0x35')]));_0x565dae[_0x9314('0x36')]=_0x565dae['attributes'][_0x9314('0x37')]?_0x565dae[_0x9314('0x36')]:_0x48ef8e['model'];if(_0x104487[_0x9314('0x31')][_0x9314('0x3e')]){_0x565dae[_0x9314('0x3f')]=[{'all':!![]}];}_0x565dae=_['merge']({},_0x565dae,_0x104487[_0x9314('0x3d')]);return db['Interval']['find'](_0x565dae)[_0x9314('0x23')](handleEntityNotFound(_0x53b093,null))[_0x9314('0x23')](respondWithResult(_0x53b093,null))[_0x9314('0x41')](handleError(_0x53b093,null));};exports[_0x9314('0x44')]=function(_0x3230b8,_0x36557d){return db[_0x9314('0x2d')]['create'](_0x3230b8[_0x9314('0x45')],{})[_0x9314('0x23')](function(_0x11f372){var _0x47bf5c=_0x3230b8[_0x9314('0x46')][_0x9314('0x24')]({'plain':!![]});if(!_0x47bf5c)throw new Error(_0x9314('0x47'));if(_0x47bf5c[_0x9314('0x48')]===_0x9314('0x46')){var _0x31bfc2=_0x11f372[_0x9314('0x24')]({'plain':!![]});var _0x22c0ac='Intervals';return db[_0x9314('0x49')][_0x9314('0x4a')]({'where':{'name':_0x22c0ac,'userProfileId':_0x47bf5c[_0x9314('0x4b')]},'raw':!![]})['then'](function(_0x521b7e){if(_0x521b7e&&_0x521b7e[_0x9314('0x4c')]===0x0){return db[_0x9314('0x25')][_0x9314('0x44')]({'name':_0x31bfc2[_0x9314('0x29')],'resourceId':_0x31bfc2['id'],'type':_0x521b7e['name'],'sectionId':_0x521b7e['id']},{})['then'](function(){return _0x11f372;});}else{return _0x11f372;}})[_0x9314('0x41')](function(_0x43093e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43093e);throw _0x43093e;});}return _0x11f372;})[_0x9314('0x23')](respondWithResult(_0x36557d,0xc9))[_0x9314('0x41')](handleError(_0x36557d,null));};exports[_0x9314('0x22')]=function(_0x389580,_0x29a350){if(_0x389580['body']['id']){delete _0x389580['body']['id'];}return db[_0x9314('0x2d')][_0x9314('0x4a')]({'where':{'id':_0x389580['params']['id']}})[_0x9314('0x23')](handleEntityNotFound(_0x29a350,null))['then'](saveUpdates(_0x389580[_0x9314('0x45')],null))[_0x9314('0x23')](respondWithResult(_0x29a350,null))[_0x9314('0x41')](handleError(_0x29a350,null));};exports['destroy']=function(_0x52f469,_0x5663af){return db[_0x9314('0x2d')]['find']({'where':{'id':_0x52f469[_0x9314('0x42')]['id']}})['then'](handleEntityNotFound(_0x5663af,null))[_0x9314('0x23')](removeEntity(_0x5663af,null))[_0x9314('0x41')](handleError(_0x5663af,null));};exports[_0x9314('0x4d')]=function(_0x81cbf0,_0x3af1f8,_0x116fac){if(_0x81cbf0[_0x9314('0x45')]['id']){delete _0x81cbf0[_0x9314('0x45')]['id'];}return db[_0x9314('0x2d')][_0x9314('0x4a')]({'where':{'id':_0x81cbf0[_0x9314('0x42')]['id']}})['then'](handleEntityNotFound(_0x3af1f8,null))[_0x9314('0x23')](function(_0x9e8fe3){if(_0x9e8fe3){_0x81cbf0[_0x9314('0x45')][_0x9314('0x4e')]=_0x9e8fe3['id'];return db['Interval'][_0x9314('0x44')](_0x81cbf0['body']);}})['then'](respondWithResult(_0x3af1f8,null))[_0x9314('0x41')](handleError(_0x3af1f8,null));};exports[_0x9314('0x4f')]=function(_0x34b0c9,_0x412ed9,_0x3577f3){var _0x2445bf={};var _0x203b62={};var _0x14a5a7;var _0x39b18f;return db[_0x9314('0x2d')][_0x9314('0x50')]({'where':{'id':_0x34b0c9[_0x9314('0x42')]['id']}})[_0x9314('0x23')](handleEntityNotFound(_0x412ed9,null))['then'](function(_0x5a6192){if(_0x5a6192){_0x14a5a7=_0x5a6192;_0x203b62[_0x9314('0x33')]=_[_0x9314('0x43')](db[_0x9314('0x2d')]['rawAttributes']);_0x203b62['query']=_[_0x9314('0x43')](_0x34b0c9[_0x9314('0x31')]);_0x203b62[_0x9314('0x32')]=_[_0x9314('0x34')](_0x203b62['model'],_0x203b62['query']);_0x2445bf[_0x9314('0x36')]=_['intersection'](_0x203b62[_0x9314('0x33')],qs['fields'](_0x34b0c9[_0x9314('0x31')][_0x9314('0x35')]));_0x2445bf[_0x9314('0x36')]=_0x2445bf[_0x9314('0x36')]['length']?_0x2445bf[_0x9314('0x36')]:_0x203b62[_0x9314('0x33')];_0x2445bf[_0x9314('0x51')]=qs[_0x9314('0x38')](_0x34b0c9[_0x9314('0x31')][_0x9314('0x38')]);_0x2445bf[_0x9314('0x3b')]=qs['filters'](_[_0x9314('0x39')](_0x34b0c9[_0x9314('0x31')],_0x203b62['filters']));if(_0x34b0c9[_0x9314('0x31')][_0x9314('0x3a')]){_0x2445bf[_0x9314('0x3b')]=_[_0x9314('0x3c')](_0x2445bf[_0x9314('0x3b')],{'$or':_['map'](_0x2445bf[_0x9314('0x36')],function(_0x4ba18f){var _0x4839cf={};_0x4839cf[_0x4ba18f]={'$like':'%'+_0x34b0c9[_0x9314('0x31')][_0x9314('0x3a')]+'%'};return _0x4839cf;})});}_0x2445bf=_['merge']({},_0x2445bf,_0x34b0c9[_0x9314('0x3d')]);return _0x14a5a7[_0x9314('0x4f')](_0x2445bf);}})[_0x9314('0x23')](function(_0x4d85e1){if(_0x4d85e1){_0x39b18f=_0x4d85e1[_0x9314('0x37')];if(!_0x34b0c9['query'][_0x9314('0x52')](_0x9314('0x53'))){_0x2445bf[_0x9314('0x1d')]=qs['limit'](_0x34b0c9[_0x9314('0x31')][_0x9314('0x1d')]);_0x2445bf['offset']=qs[_0x9314('0x1b')](_0x34b0c9[_0x9314('0x31')][_0x9314('0x1b')]);}return _0x14a5a7[_0x9314('0x4f')](_0x2445bf);}})['then'](function(_0x391757){if(_0x391757){return _0x391757?{'count':_0x39b18f,'rows':_0x391757}:null;}})['then'](respondWithResult(_0x412ed9,null))[_0x9314('0x41')](handleError(_0x412ed9,null));};exports[_0x9314('0x54')]=function(_0x55555a,_0x5dcb2a,_0x22da9c){return db[_0x9314('0x2d')][_0x9314('0x50')]({'where':{'id':_0x55555a['params']['id']}})[_0x9314('0x23')](handleEntityNotFound(_0x5dcb2a,null))['then'](function(_0x483caa){if(_0x483caa){return db[_0x9314('0x55')][_0x9314('0x56')](function(_0x87c73d){return db[_0x9314('0x2d')][_0x9314('0x26')]({'where':{'IntervalId':_0x55555a['params']['id']},'transaction':_0x87c73d})[_0x9314('0x23')](function(_0x4d2ca1){var _0x491f7b=_[_0x9314('0x2c')](_0x55555a['body'],function(_0x58b38b){delete _0x58b38b['id'];_0x58b38b['IntervalId']=_0x55555a[_0x9314('0x42')]['id'];return _0x58b38b;});return db[_0x9314('0x2d')][_0x9314('0x57')](_0x491f7b,{'transaction':_0x87c73d});});})['then'](function(){return db[_0x9314('0x2d')][_0x9314('0x40')]({'where':{'IntervalId':_0x55555a[_0x9314('0x42')]['id']}});});}})[_0x9314('0x23')](respondWithResult(_0x5dcb2a,null))['catch'](handleError(_0x5dcb2a,null));}; \ No newline at end of file +var _0xcb7c=['fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','stack','name','map','Interval','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Intervals','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','keys','nolimit','sequelize','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x3305d0,_0x507603){var _0xafe404=function(_0xbf4220){while(--_0xbf4220){_0x3305d0['push'](_0x3305d0['shift']());}};_0xafe404(++_0x507603);}(_0xcb7c,0xed));var _0xccb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb7c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xccb7('0x0'));var jsonpatch=require(_0xccb7('0x1'));var rp=require('request-promise');var moment=require(_0xccb7('0x2'));var BPromise=require(_0xccb7('0x3'));var Mustache=require(_0xccb7('0x4'));var util=require(_0xccb7('0x5'));var path=require(_0xccb7('0x6'));var sox=require('sox');var csv=require(_0xccb7('0x7'));var ejs=require(_0xccb7('0x8'));var fs=require('fs');var fs_extra=require(_0xccb7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xccb7('0xa'));var deskjs=require(_0xccb7('0xb'));var toCsv=require(_0xccb7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xccb7('0xc'));var authService=require(_0xccb7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xccb7('0xe'));var hardwareService=require(_0xccb7('0xf'));var logger=require(_0xccb7('0x10'))(_0xccb7('0x11'));var utils=require(_0xccb7('0x12'));var config=require(_0xccb7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb7('0x14'))['db'];var extensions=require(_0xccb7('0x15'));function respondWithStatusCode(_0x314c0d,_0x10f754){_0x10f754=_0x10f754||0xcc;return function(_0x470ec0){if(_0x470ec0){return _0x314c0d[_0xccb7('0x16')](_0x10f754);}return _0x314c0d['status'](_0x10f754)[_0xccb7('0x17')]();};}function respondWithResult(_0x380546,_0x400d6f){_0x400d6f=_0x400d6f||0xc8;return function(_0x5bfda9){if(_0x5bfda9){return _0x380546[_0xccb7('0x18')](_0x400d6f)[_0xccb7('0x19')](_0x5bfda9);}};}function respondWithFilteredResult(_0x28bd9b,_0x238b85){return function(_0xabf21){if(_0xabf21){var _0x136c61=typeof _0x238b85[_0xccb7('0x1a')]===_0xccb7('0x1b')&&typeof _0x238b85[_0xccb7('0x1c')]===_0xccb7('0x1b');var _0x152a97=_0xabf21[_0xccb7('0x1d')];var _0x4c4f37=_0x136c61?0x0:_0x238b85[_0xccb7('0x1a')];var _0x2f6f08=_0x136c61?_0xabf21[_0xccb7('0x1d')]:_0x238b85[_0xccb7('0x1a')]+_0x238b85['limit'];var _0x467b10;if(_0x2f6f08>=_0x152a97){_0x2f6f08=_0x152a97;_0x467b10=0xc8;}else{_0x467b10=0xce;}_0x28bd9b['status'](_0x467b10);return _0x28bd9b[_0xccb7('0x1e')](_0xccb7('0x1f'),_0x4c4f37+'-'+_0x2f6f08+'/'+_0x152a97)[_0xccb7('0x19')](_0xabf21);}return null;};}function patchUpdates(_0x340837){return function(_0x5b5cdc){try{jsonpatch['apply'](_0x5b5cdc,_0x340837,!![]);}catch(_0x5c872e){return BPromise[_0xccb7('0x20')](_0x5c872e);}return _0x5b5cdc[_0xccb7('0x21')]();};}function saveUpdates(_0x2057c4,_0x959a1f){return function(_0x22e8af){if(_0x22e8af){return _0x22e8af[_0xccb7('0x22')](_0x2057c4)[_0xccb7('0x23')](function(_0xbb897b){return _0xbb897b;});}return null;};}function removeEntity(_0x595332,_0x55d903){return function(_0x2f0403){if(_0x2f0403){return _0x2f0403[_0xccb7('0x24')]()[_0xccb7('0x23')](function(){var _0x93fcd8=_0x2f0403['get']({'plain':!![]});var _0x10d28c='Intervals';return db[_0xccb7('0x25')]['destroy']({'where':{'type':_0x10d28c,'resourceId':_0x93fcd8['id']}})[_0xccb7('0x23')](function(){return _0x2f0403;});})[_0xccb7('0x23')](function(){_0x595332[_0xccb7('0x18')](0xcc)[_0xccb7('0x17')]();});}};}function handleEntityNotFound(_0x5b9c7c,_0x22488c){return function(_0x4a40e9){if(!_0x4a40e9){_0x5b9c7c[_0xccb7('0x16')](0x194);}return _0x4a40e9;};}function handleError(_0x17e82b,_0xbab554){_0xbab554=_0xbab554||0x1f4;return function(_0x68f549){logger['error'](_0x68f549[_0xccb7('0x26')]);if(_0x68f549[_0xccb7('0x27')]){delete _0x68f549[_0xccb7('0x27')];}_0x17e82b[_0xccb7('0x18')](_0xbab554)['send'](_0x68f549);};}exports['index']=function(_0x1d80db,_0xddf5a0){var _0x3f4512={},_0x3f1232={},_0x5c8eea={'count':0x0,'rows':[]};var _0xf2dda2=_[_0xccb7('0x28')](db[_0xccb7('0x29')][_0xccb7('0x2a')],function(_0x4a8836){return{'name':_0x4a8836[_0xccb7('0x2b')],'type':_0x4a8836['type']['key']};});_0x3f1232[_0xccb7('0x2c')]=_[_0xccb7('0x28')](_0xf2dda2,_0xccb7('0x27'));_0x3f1232[_0xccb7('0x2d')]=_['keys'](_0x1d80db['query']);_0x3f1232[_0xccb7('0x2e')]=_[_0xccb7('0x2f')](_0x3f1232[_0xccb7('0x2c')],_0x3f1232[_0xccb7('0x2d')]);_0x3f4512[_0xccb7('0x30')]=_[_0xccb7('0x2f')](_0x3f1232[_0xccb7('0x2c')],qs['fields'](_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x31')]));_0x3f4512[_0xccb7('0x30')]=_0x3f4512[_0xccb7('0x30')][_0xccb7('0x32')]?_0x3f4512['attributes']:_0x3f1232['model'];if(!_0x1d80db['query'][_0xccb7('0x33')]('nolimit')){_0x3f4512[_0xccb7('0x1c')]=qs['limit'](_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x1c')]);_0x3f4512['offset']=qs[_0xccb7('0x1a')](_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x1a')]);}_0x3f4512[_0xccb7('0x34')]=qs['sort'](_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x35')]);_0x3f4512['where']=qs['filters'](_[_0xccb7('0x36')](_0x1d80db[_0xccb7('0x2d')],_0x3f1232[_0xccb7('0x2e')]),_0xf2dda2);if(_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x37')]){_0x3f4512[_0xccb7('0x38')]=_['merge'](_0x3f4512['where'],{'$or':_['map'](_0xf2dda2,function(_0x555b2d){if(_0x555b2d[_0xccb7('0x39')]!=='VIRTUAL'){var _0x259bd6={};_0x259bd6[_0x555b2d['name']]={'$like':'%'+_0x1d80db[_0xccb7('0x2d')]['filter']+'%'};return _0x259bd6;}})});}_0x3f4512=_[_0xccb7('0x3a')]({},_0x3f4512,_0x1d80db[_0xccb7('0x3b')]);var _0xc3dac3={'where':_0x3f4512[_0xccb7('0x38')]};return db['Interval'][_0xccb7('0x1d')](_0xc3dac3)['then'](function(_0x161088){_0x5c8eea[_0xccb7('0x1d')]=_0x161088;if(_0x1d80db[_0xccb7('0x2d')][_0xccb7('0x3c')]){_0x3f4512[_0xccb7('0x3d')]=[{'all':!![]}];}return db[_0xccb7('0x29')][_0xccb7('0x3e')](_0x3f4512);})[_0xccb7('0x23')](function(_0x4f4d43){_0x5c8eea[_0xccb7('0x3f')]=_0x4f4d43;return _0x5c8eea;})['then'](respondWithFilteredResult(_0xddf5a0,_0x3f4512))[_0xccb7('0x40')](handleError(_0xddf5a0,null));};exports['show']=function(_0x40483a,_0x1f0c4a){var _0x5e54df={'raw':!![],'where':{'id':_0x40483a[_0xccb7('0x41')]['id']}},_0x13613a={};_0x13613a[_0xccb7('0x2c')]=_['keys'](db['Interval'][_0xccb7('0x2a')]);_0x13613a[_0xccb7('0x2d')]=_['keys'](_0x40483a[_0xccb7('0x2d')]);_0x13613a[_0xccb7('0x2e')]=_['intersection'](_0x13613a[_0xccb7('0x2c')],_0x13613a[_0xccb7('0x2d')]);_0x5e54df[_0xccb7('0x30')]=_[_0xccb7('0x2f')](_0x13613a[_0xccb7('0x2c')],qs[_0xccb7('0x31')](_0x40483a[_0xccb7('0x2d')][_0xccb7('0x31')]));_0x5e54df[_0xccb7('0x30')]=_0x5e54df[_0xccb7('0x30')][_0xccb7('0x32')]?_0x5e54df['attributes']:_0x13613a[_0xccb7('0x2c')];if(_0x40483a[_0xccb7('0x2d')][_0xccb7('0x3c')]){_0x5e54df[_0xccb7('0x3d')]=[{'all':!![]}];}_0x5e54df=_[_0xccb7('0x3a')]({},_0x5e54df,_0x40483a[_0xccb7('0x3b')]);return db['Interval'][_0xccb7('0x42')](_0x5e54df)[_0xccb7('0x23')](handleEntityNotFound(_0x1f0c4a,null))[_0xccb7('0x23')](respondWithResult(_0x1f0c4a,null))[_0xccb7('0x40')](handleError(_0x1f0c4a,null));};exports[_0xccb7('0x43')]=function(_0x5258ea,_0x55587d){return db[_0xccb7('0x29')][_0xccb7('0x43')](_0x5258ea[_0xccb7('0x44')],{})['then'](function(_0xeb7199){var _0x7cba07=_0x5258ea[_0xccb7('0x45')][_0xccb7('0x46')]({'plain':!![]});if(!_0x7cba07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7cba07['role']===_0xccb7('0x45')){var _0x567424=_0xeb7199[_0xccb7('0x46')]({'plain':!![]});var _0x18f166=_0xccb7('0x47');return db[_0xccb7('0x48')]['find']({'where':{'name':_0x18f166,'userProfileId':_0x7cba07['userProfileId']},'raw':!![]})[_0xccb7('0x23')](function(_0x4ce14d){if(_0x4ce14d&&_0x4ce14d[_0xccb7('0x49')]===0x0){return db[_0xccb7('0x25')][_0xccb7('0x43')]({'name':_0x567424[_0xccb7('0x27')],'resourceId':_0x567424['id'],'type':_0x4ce14d[_0xccb7('0x27')],'sectionId':_0x4ce14d['id']},{})[_0xccb7('0x23')](function(){return _0xeb7199;});}else{return _0xeb7199;}})[_0xccb7('0x40')](function(_0x17e1ab){logger[_0xccb7('0x4a')](_0xccb7('0x4b'),_0x17e1ab);throw _0x17e1ab;});}return _0xeb7199;})[_0xccb7('0x23')](respondWithResult(_0x55587d,0xc9))[_0xccb7('0x40')](handleError(_0x55587d,null));};exports[_0xccb7('0x22')]=function(_0x329508,_0x935dbb){if(_0x329508[_0xccb7('0x44')]['id']){delete _0x329508['body']['id'];}return db[_0xccb7('0x29')][_0xccb7('0x42')]({'where':{'id':_0x329508[_0xccb7('0x41')]['id']}})['then'](handleEntityNotFound(_0x935dbb,null))[_0xccb7('0x23')](saveUpdates(_0x329508[_0xccb7('0x44')],null))[_0xccb7('0x23')](respondWithResult(_0x935dbb,null))[_0xccb7('0x40')](handleError(_0x935dbb,null));};exports['destroy']=function(_0x5aa325,_0x3fa4c3){return db['Interval'][_0xccb7('0x42')]({'where':{'id':_0x5aa325['params']['id']}})[_0xccb7('0x23')](handleEntityNotFound(_0x3fa4c3,null))[_0xccb7('0x23')](removeEntity(_0x3fa4c3,null))['catch'](handleError(_0x3fa4c3,null));};exports[_0xccb7('0x4c')]=function(_0x16ff2a,_0x4051cb,_0x5aba23){if(_0x16ff2a[_0xccb7('0x44')]['id']){delete _0x16ff2a[_0xccb7('0x44')]['id'];}return db[_0xccb7('0x29')][_0xccb7('0x42')]({'where':{'id':_0x16ff2a[_0xccb7('0x41')]['id']}})[_0xccb7('0x23')](handleEntityNotFound(_0x4051cb,null))[_0xccb7('0x23')](function(_0x2c7d6d){if(_0x2c7d6d){_0x16ff2a[_0xccb7('0x44')]['IntervalId']=_0x2c7d6d['id'];return db[_0xccb7('0x29')][_0xccb7('0x43')](_0x16ff2a[_0xccb7('0x44')]);}})[_0xccb7('0x23')](respondWithResult(_0x4051cb,null))[_0xccb7('0x40')](handleError(_0x4051cb,null));};exports[_0xccb7('0x4d')]=function(_0x33b5d6,_0x337cab,_0x59d036){var _0x33e93e={};var _0x27e9f3={};var _0x1fbb8b;var _0x428b6a;return db['Interval'][_0xccb7('0x4e')]({'where':{'id':_0x33b5d6['params']['id']}})[_0xccb7('0x23')](handleEntityNotFound(_0x337cab,null))[_0xccb7('0x23')](function(_0x1e8b75){if(_0x1e8b75){_0x1fbb8b=_0x1e8b75;_0x27e9f3[_0xccb7('0x2c')]=_[_0xccb7('0x4f')](db[_0xccb7('0x29')][_0xccb7('0x2a')]);_0x27e9f3[_0xccb7('0x2d')]=_['keys'](_0x33b5d6['query']);_0x27e9f3[_0xccb7('0x2e')]=_[_0xccb7('0x2f')](_0x27e9f3['model'],_0x27e9f3[_0xccb7('0x2d')]);_0x33e93e[_0xccb7('0x30')]=_[_0xccb7('0x2f')](_0x27e9f3[_0xccb7('0x2c')],qs[_0xccb7('0x31')](_0x33b5d6[_0xccb7('0x2d')]['fields']));_0x33e93e[_0xccb7('0x30')]=_0x33e93e[_0xccb7('0x30')]['length']?_0x33e93e[_0xccb7('0x30')]:_0x27e9f3[_0xccb7('0x2c')];_0x33e93e[_0xccb7('0x34')]=qs[_0xccb7('0x35')](_0x33b5d6[_0xccb7('0x2d')]['sort']);_0x33e93e[_0xccb7('0x38')]=qs[_0xccb7('0x2e')](_[_0xccb7('0x36')](_0x33b5d6[_0xccb7('0x2d')],_0x27e9f3[_0xccb7('0x2e')]));if(_0x33b5d6[_0xccb7('0x2d')]['filter']){_0x33e93e[_0xccb7('0x38')]=_[_0xccb7('0x3a')](_0x33e93e[_0xccb7('0x38')],{'$or':_[_0xccb7('0x28')](_0x33e93e[_0xccb7('0x30')],function(_0x424fa0){var _0x5037c3={};_0x5037c3[_0x424fa0]={'$like':'%'+_0x33b5d6[_0xccb7('0x2d')][_0xccb7('0x37')]+'%'};return _0x5037c3;})});}_0x33e93e=_[_0xccb7('0x3a')]({},_0x33e93e,_0x33b5d6['options']);return _0x1fbb8b[_0xccb7('0x4d')](_0x33e93e);}})[_0xccb7('0x23')](function(_0x236fe9){if(_0x236fe9){_0x428b6a=_0x236fe9[_0xccb7('0x32')];if(!_0x33b5d6[_0xccb7('0x2d')][_0xccb7('0x33')](_0xccb7('0x50'))){_0x33e93e[_0xccb7('0x1c')]=qs['limit'](_0x33b5d6['query'][_0xccb7('0x1c')]);_0x33e93e[_0xccb7('0x1a')]=qs[_0xccb7('0x1a')](_0x33b5d6[_0xccb7('0x2d')]['offset']);}return _0x1fbb8b['getIntervals'](_0x33e93e);}})[_0xccb7('0x23')](function(_0x3e0f72){if(_0x3e0f72){return _0x3e0f72?{'count':_0x428b6a,'rows':_0x3e0f72}:null;}})[_0xccb7('0x23')](respondWithResult(_0x337cab,null))[_0xccb7('0x40')](handleError(_0x337cab,null));};exports['addIntervals']=function(_0x115ab9,_0x311bf6,_0x4630a3){return db[_0xccb7('0x29')][_0xccb7('0x4e')]({'where':{'id':_0x115ab9[_0xccb7('0x41')]['id']}})[_0xccb7('0x23')](handleEntityNotFound(_0x311bf6,null))[_0xccb7('0x23')](function(_0x1443b7){if(_0x1443b7){return db[_0xccb7('0x51')]['transaction'](function(_0x405667){return db[_0xccb7('0x29')][_0xccb7('0x24')]({'where':{'IntervalId':_0x115ab9[_0xccb7('0x41')]['id']},'transaction':_0x405667})[_0xccb7('0x23')](function(_0x3c8da6){var _0x2133f5=_[_0xccb7('0x28')](_0x115ab9[_0xccb7('0x44')],function(_0x19a130){delete _0x19a130['id'];_0x19a130['IntervalId']=_0x115ab9[_0xccb7('0x41')]['id'];return _0x19a130;});return db[_0xccb7('0x29')]['bulkCreate'](_0x2133f5,{'transaction':_0x405667});});})['then'](function(){return db[_0xccb7('0x29')]['findAll']({'where':{'IntervalId':_0x115ab9[_0xccb7('0x41')]['id']}});});}})[_0xccb7('0x23')](respondWithResult(_0x311bf6,null))[_0xccb7('0x40')](handleError(_0x311bf6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 1688e96..25d516f 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 _0xcf10=['tools_intervals','rewrite','lodash','../../config/logger','moment','request-promise','path','rimraf','./interval.attributes','exports','define'];(function(_0x513f85,_0x22c91e){var _0x5600b8=function(_0x4bc65e){while(--_0x4bc65e){_0x513f85['push'](_0x513f85['shift']());}};_0x5600b8(++_0x22c91e);}(_0xcf10,0xc8));var _0x0cf1=function(_0xfbac0b,_0x20b38b){_0xfbac0b=_0xfbac0b-0x0;var _0x14e054=_0xcf10[_0xfbac0b];return _0x14e054;};'use strict';var _=require(_0x0cf1('0x0'));var util=require('util');var logger=require(_0x0cf1('0x1'))('api');var moment=require(_0x0cf1('0x2'));var BPromise=require('bluebird');var rp=require(_0x0cf1('0x3'));var fs=require('fs');var path=require(_0x0cf1('0x4'));var rimraf=require(_0x0cf1('0x5'));var config=require('../../config/environment');var attributes=require(_0x0cf1('0x6'));var extensions=require('../../components/extensions/rewrite');module[_0x0cf1('0x7')]=function(_0x2d3d3f,_0x8519dd){return _0x2d3d3f[_0x0cf1('0x8')]('Interval',attributes,{'tableName':_0x0cf1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eb029,_0x215bbc){extensions['rewrite'](_0x2d3d3f,_0x3eb029);},'afterBulkCreate':function(_0x1a22e5,_0x1270c3,_0x309b52){_0x309b52();extensions[_0x0cf1('0xa')](_0x2d3d3f,_0x1a22e5[0x0]);},'afterUpdate':function(_0x28a966,_0x11b1c){extensions[_0x0cf1('0xa')](_0x2d3d3f,_0x28a966);},'afterDestroy':function(_0x37bf58,_0xf2176a){extensions['rewrite'](_0x2d3d3f,_0x37bf58);}}});}; \ No newline at end of file +var _0x70fc=['api','moment','bluebird','request-promise','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger'];(function(_0x4b7a14,_0x30e3b7){var _0x4f1177=function(_0x3c3eb9){while(--_0x3c3eb9){_0x4b7a14['push'](_0x4b7a14['shift']());}};_0x4f1177(++_0x30e3b7);}(_0x70fc,0x13c));var _0xc70f=function(_0x1bff31,_0x21e050){_0x1bff31=_0x1bff31-0x0;var _0x30453c=_0x70fc[_0x1bff31];return _0x30453c;};'use strict';var _=require(_0xc70f('0x0'));var util=require(_0xc70f('0x1'));var logger=require(_0xc70f('0x2'))(_0xc70f('0x3'));var moment=require(_0xc70f('0x4'));var BPromise=require(_0xc70f('0x5'));var rp=require(_0xc70f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x2349ae,_0x55614d){return _0x2349ae[_0xc70f('0x7')](_0xc70f('0x8'),attributes,{'tableName':_0xc70f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e5c3,_0x51c23c){extensions['rewrite'](_0x2349ae,_0x49e5c3);},'afterBulkCreate':function(_0x11489e,_0x21e4e1,_0xbb8e8e){_0xbb8e8e();extensions[_0xc70f('0xa')](_0x2349ae,_0x11489e[0x0]);},'afterUpdate':function(_0x34faef,_0xbe3e7c){extensions[_0xc70f('0xa')](_0x2349ae,_0x34faef);},'afterDestroy':function(_0x291620,_0x55ca31){extensions[_0xc70f('0xa')](_0x2349ae,_0x291620);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 813434b..8771af3 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(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_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);});});}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 b96f9a5..c7dd16a 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x1151f6,_0x428f14){var _0x5df5c5=function(_0x26daeb){while(--_0x26daeb){_0x1151f6['push'](_0x1151f6['shift']());}};_0x5df5c5(++_0x428f14);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b0966,_0x3fc4ca){_0x3b0966=_0x3b0966-0x0;var _0x18e6b0=_0x5f2f[_0x3b0966];return _0x18e6b0;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44e4e1,_0x5637b2){_0x44e4e1=_0x44e4e1-0x0;var _0x300cd2=_0x0b0e[_0x44e4e1];return _0x300cd2;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 9092033..15b2e01 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 _0x6ab0=['customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','setEncoding','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','api','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','email','fields','oldToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ab0,0x1ab));var _0x06ab=function(_0x3d1f47,_0x1b5066){_0x3d1f47=_0x3d1f47-0x0;var _0x41efdf=_0x6ab0[_0x3d1f47];return _0x41efdf;};'use strict';var BPromise=require(_0x06ab('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x06ab('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x570ed7,_0x3c0932){var _0x1d9a17={'fields':{'project':{'key':_0x570ed7[_0x06ab('0x2')]||_0x06ab('0x3')},'summary':(_0x570ed7[_0x06ab('0x4')]||'Report')+_0x06ab('0x5')+_0x570ed7['ip'],'description':_0x570ed7[_0x06ab('0x6')]||JSON[_0x06ab('0x7')](_0x570ed7),'issuetype':{'name':_0x570ed7[_0x06ab('0x8')]||_0x06ab('0x9')}}};_0x1d9a17['fields']['customfield_11500']=_0x570ed7[_0x06ab('0xa')];_0x1d9a17[_0x06ab('0xb')]['customfield_11501']=_0x570ed7[_0x06ab('0xc')];_0x1d9a17[_0x06ab('0xb')][_0x06ab('0xd')]=_0x570ed7[_0x06ab('0xe')];_0x1d9a17[_0x06ab('0xb')][_0x06ab('0xf')]=_0x570ed7[_0x06ab('0x10')];_0x1d9a17[_0x06ab('0xb')][_0x06ab('0x11')]=_0x570ed7['reason'];_0x1d9a17[_0x06ab('0xb')][_0x06ab('0x12')]=_0x570ed7['ip'];var _0x23d444={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x06ab('0x13'),'method':_0x06ab('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x06ab('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x06ab('0x16')](_0x06ab('0x17'))}};var _0x3418ea=JSON['stringify'](_0x1d9a17);var _0x271e23=https['request'](_0x23d444,function(_0x3b7cf5){_0x3b7cf5[_0x06ab('0x18')]('utf8');var _0x1e7e46='';_0x3b7cf5['on']('data',function(_0x1fc4b6){_0x1e7e46+=_0x1fc4b6;});_0x3b7cf5['on'](_0x06ab('0x19'),function(){if(_0x3c0932){return _0x3c0932[_0x06ab('0x1a')](_0x3b7cf5['statusCode'])[_0x06ab('0x1b')](JSON[_0x06ab('0x1c')](_0x1e7e46));}});});_0x271e23['on'](_0x06ab('0x1d'),function(_0x2bd69e){if(_0x3c0932){return _0x3c0932['status'](0x1f4)[_0x06ab('0x1b')]({'errors':[{'message':_0x06ab('0x1e'),'type':_0x06ab('0x1f')}]});}});_0x271e23[_0x06ab('0x20')](_0x3418ea);_0x271e23['end']();}exports[_0x06ab('0x21')]=openIssue;exports[_0x06ab('0x22')]=function(_0x14b391,_0x1af48b){_0x14b391[_0x06ab('0x23')]['ip']=_0x14b391[_0x06ab('0x24')][_0x06ab('0x25')]||_0x14b391['connection'][_0x06ab('0x26')]||_0x14b391[_0x06ab('0x27')]['remoteAddress']||_0x14b391['connection'][_0x06ab('0x27')][_0x06ab('0x26')];return openIssue(_0x14b391[_0x06ab('0x23')],_0x1af48b);}; \ No newline at end of file +var _0x3d1c=['end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x3d1c,0x17e));var _0xc3d1=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x3d1c[_0x59d89e];return _0x554e93;};'use strict';var BPromise=require('bluebird');var https=require(_0xc3d1('0x0'));var logger=require(_0xc3d1('0x1'))(_0xc3d1('0x2'));var USERNAME=_0xc3d1('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3307c9,_0x273704){var _0x9ba0b7={'fields':{'project':{'key':_0x3307c9[_0xc3d1('0x4')]||_0xc3d1('0x5')},'summary':(_0x3307c9[_0xc3d1('0x6')]||_0xc3d1('0x7'))+_0xc3d1('0x8')+_0x3307c9['ip'],'description':_0x3307c9[_0xc3d1('0x9')]||JSON[_0xc3d1('0xa')](_0x3307c9),'issuetype':{'name':_0x3307c9[_0xc3d1('0xb')]||'Bug'}}};_0x9ba0b7[_0xc3d1('0xc')][_0xc3d1('0xd')]=_0x3307c9[_0xc3d1('0xe')];_0x9ba0b7[_0xc3d1('0xc')][_0xc3d1('0xf')]=_0x3307c9['oldToken'];_0x9ba0b7[_0xc3d1('0xc')][_0xc3d1('0x10')]=_0x3307c9[_0xc3d1('0x11')];_0x9ba0b7['fields'][_0xc3d1('0x12')]=_0x3307c9[_0xc3d1('0x13')];_0x9ba0b7[_0xc3d1('0xc')][_0xc3d1('0x14')]=_0x3307c9[_0xc3d1('0x15')];_0x9ba0b7['fields'][_0xc3d1('0x16')]=_0x3307c9['ip'];var _0x500893={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc3d1('0x17'),'method':_0xc3d1('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xc3d1('0x19'),'Authorization':_0xc3d1('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xc3d1('0x1b')](_0xc3d1('0x1c'))}};var _0x5e029f=JSON['stringify'](_0x9ba0b7);var _0x269df7=https[_0xc3d1('0x1d')](_0x500893,function(_0x53c46a){_0x53c46a[_0xc3d1('0x1e')]('utf8');var _0x2c8a62='';_0x53c46a['on'](_0xc3d1('0x1f'),function(_0x1bde4a){_0x2c8a62+=_0x1bde4a;});_0x53c46a['on'](_0xc3d1('0x20'),function(){if(_0x273704){return _0x273704[_0xc3d1('0x21')](_0x53c46a['statusCode'])[_0xc3d1('0x22')](JSON[_0xc3d1('0x23')](_0x2c8a62));}});});_0x269df7['on']('error',function(_0x43ca7f){if(_0x273704){return _0x273704[_0xc3d1('0x21')](0x1f4)[_0xc3d1('0x22')]({'errors':[{'message':_0xc3d1('0x24'),'type':_0xc3d1('0x25')}]});}});_0x269df7[_0xc3d1('0x26')](_0x5e029f);_0x269df7[_0xc3d1('0x20')]();}exports['openIssue']=openIssue;exports[_0xc3d1('0x27')]=function(_0x328bb2,_0x319217){_0x328bb2[_0xc3d1('0x28')]['ip']=_0x328bb2[_0xc3d1('0x29')][_0xc3d1('0x2a')]||_0x328bb2[_0xc3d1('0x2b')][_0xc3d1('0x2c')]||_0x328bb2[_0xc3d1('0x2d')][_0xc3d1('0x2c')]||_0x328bb2['connection'][_0xc3d1('0x2d')][_0xc3d1('0x2c')];return openIssue(_0x328bb2[_0xc3d1('0x28')],_0x319217);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 986998e..fda5906 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 _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(_0x114d03,_0x37adb1){var _0x13e979=function(_0x264408){while(--_0x264408){_0x114d03['push'](_0x114d03['shift']());}};_0x13e979(++_0x37adb1);}(_0xb821,0xa7));var _0x1b82=function(_0x2a714f,_0x5e63ea){_0x2a714f=_0x2a714f-0x0;var _0x306c6d=_0xb821[_0x2a714f];return _0x306c6d;};'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 +var _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2fca66,_0x56d80c){var _0x4622e7=function(_0x4a2e07){while(--_0x4a2e07){_0x2fca66['push'](_0x2fca66['shift']());}};_0x4622e7(++_0x56d80c);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1c4d94,_0x3536a4){_0x1c4d94=_0x1c4d94-0x0;var _0x3acec1=_0x5ff3[_0x1c4d94];return _0x3acec1;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d58654d..6c7a8f2 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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1f984c,_0x469223){_0x1f984c=_0x1f984c-0x0;var _0x3a1002=_0x7a54[_0x1f984c];return _0x3a1002;};'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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x28a8e4,_0x5a67bc){_0x28a8e4=_0x28a8e4-0x0;var _0xc65db=_0x7a54[_0x28a8e4];return _0xc65db;};'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 7fd1b67..7792750 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 _0xa751=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x3093fe,_0x5a0cff){var _0x31517d=function(_0x4a6eba){while(--_0x4a6eba){_0x3093fe['push'](_0x3093fe['shift']());}};_0x31517d(++_0x5a0cff);}(_0xa751,0x175));var _0x1a75=function(_0xc3b924,_0x1b4a69){_0xc3b924=_0xc3b924-0x0;var _0x325071=_0xa751[_0xc3b924];return _0x325071;};'use strict';var emlformat=require(_0x1a75('0x0'));var rimraf=require(_0x1a75('0x1'));var zipdir=require(_0x1a75('0x2'));var jsonpatch=require(_0x1a75('0x3'));var rp=require('request-promise');var moment=require(_0x1a75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a75('0x5'));var util=require(_0x1a75('0x6'));var path=require(_0x1a75('0x7'));var sox=require('sox');var csv=require(_0x1a75('0x8'));var ejs=require(_0x1a75('0x9'));var fs=require('fs');var fs_extra=require(_0x1a75('0xa'));var _=require(_0x1a75('0xb'));var squel=require(_0x1a75('0xc'));var crypto=require(_0x1a75('0xd'));var jsforce=require(_0x1a75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a75('0xf'));var Redis=require(_0x1a75('0x10'));var authService=require(_0x1a75('0x11'));var qs=require(_0x1a75('0x12'));var as=require(_0x1a75('0x13'));var hardwareService=require(_0x1a75('0x14'));var logger=require(_0x1a75('0x15'))(_0x1a75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a75('0x17'))['db'];function respondWithStatusCode(_0x24e8dc,_0xae1af0){_0xae1af0=_0xae1af0||0xcc;return function(_0x1220e4){if(_0x1220e4){return _0x24e8dc['sendStatus'](_0xae1af0);}return _0x24e8dc['status'](_0xae1af0)[_0x1a75('0x18')]();};}function respondWithResult(_0xf4a616,_0x48577b){_0x48577b=_0x48577b||0xc8;return function(_0x1c84d3){if(_0x1c84d3){return _0xf4a616[_0x1a75('0x19')](_0x48577b)['json'](_0x1c84d3);}};}function respondWithFilteredResult(_0x1f3c38,_0xb4a245){return function(_0x15a1ec){if(_0x15a1ec){var _0x5883df=typeof _0xb4a245['offset']==='undefined'&&typeof _0xb4a245[_0x1a75('0x1a')]===_0x1a75('0x1b');var _0x2b6f3d=_0x15a1ec[_0x1a75('0x1c')];var _0x1b1af2=_0x5883df?0x0:_0xb4a245[_0x1a75('0x1d')];var _0x47f384=_0x5883df?_0x15a1ec[_0x1a75('0x1c')]:_0xb4a245['offset']+_0xb4a245['limit'];var _0x42df2c;if(_0x47f384>=_0x2b6f3d){_0x47f384=_0x2b6f3d;_0x42df2c=0xc8;}else{_0x42df2c=0xce;}_0x1f3c38[_0x1a75('0x19')](_0x42df2c);return _0x1f3c38['set'](_0x1a75('0x1e'),_0x1b1af2+'-'+_0x47f384+'/'+_0x2b6f3d)['json'](_0x15a1ec);}return null;};}function patchUpdates(_0x4699c9){return function(_0x3e3549){try{jsonpatch[_0x1a75('0x1f')](_0x3e3549,_0x4699c9,!![]);}catch(_0x340750){return BPromise[_0x1a75('0x20')](_0x340750);}return _0x3e3549[_0x1a75('0x21')]();};}function saveUpdates(_0x5a0ad7,_0x3ed5e9){return function(_0x4dc595){if(_0x4dc595){return _0x4dc595[_0x1a75('0x22')](_0x5a0ad7)[_0x1a75('0x23')](function(_0x320413){return _0x320413;});}return null;};}function removeEntity(_0x59e3da,_0x443ff8){return function(_0x5e6617){if(_0x5e6617){return _0x5e6617[_0x1a75('0x24')]()[_0x1a75('0x23')](function(){_0x59e3da[_0x1a75('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fe9fe,_0x126f40){return function(_0x4dec82){if(!_0x4dec82){_0x9fe9fe[_0x1a75('0x25')](0x194);}return _0x4dec82;};}function handleError(_0x399dae,_0x5a6acc){_0x5a6acc=_0x5a6acc||0x1f4;return function(_0x168e06){logger[_0x1a75('0x26')](_0x168e06[_0x1a75('0x27')]);if(_0x168e06[_0x1a75('0x28')]){delete _0x168e06['name'];}_0x399dae[_0x1a75('0x19')](_0x5a6acc)[_0x1a75('0x29')](_0x168e06);};}exports[_0x1a75('0x2a')]=function(_0x2f5ac9,_0xf33870){var _0x9e66b9={},_0x3b6e1d={},_0x38e885={'count':0x0,'rows':[]};var _0x5518ed=_['map'](db[_0x1a75('0x2b')][_0x1a75('0x2c')],function(_0x1a0359){return{'name':_0x1a0359[_0x1a75('0x2d')],'type':_0x1a0359[_0x1a75('0x2e')][_0x1a75('0x2f')]};});_0x3b6e1d[_0x1a75('0x30')]=_[_0x1a75('0x31')](_0x5518ed,'name');_0x3b6e1d['query']=_['keys'](_0x2f5ac9[_0x1a75('0x32')]);_0x3b6e1d[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x3b6e1d[_0x1a75('0x30')],_0x3b6e1d['query']);_0x9e66b9['attributes']=_['intersection'](_0x3b6e1d[_0x1a75('0x30')],qs[_0x1a75('0x35')](_0x2f5ac9['query']['fields']));_0x9e66b9[_0x1a75('0x36')]=_0x9e66b9['attributes'][_0x1a75('0x37')]?_0x9e66b9[_0x1a75('0x36')]:_0x3b6e1d[_0x1a75('0x30')];if(!_0x2f5ac9['query']['hasOwnProperty'](_0x1a75('0x38'))){_0x9e66b9[_0x1a75('0x1a')]=qs[_0x1a75('0x1a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1a')]);_0x9e66b9[_0x1a75('0x1d')]=qs[_0x1a75('0x1d')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1d')]);}_0x9e66b9[_0x1a75('0x39')]=qs[_0x1a75('0x3a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3a')]);_0x9e66b9[_0x1a75('0x3b')]=qs[_0x1a75('0x33')](_[_0x1a75('0x3c')](_0x2f5ac9['query'],_0x3b6e1d[_0x1a75('0x33')]),_0x5518ed);if(_0x2f5ac9['query']['filter']){_0x9e66b9[_0x1a75('0x3b')]=_[_0x1a75('0x3d')](_0x9e66b9[_0x1a75('0x3b')],{'$or':_[_0x1a75('0x31')](_0x5518ed,function(_0x2842d4){if(_0x2842d4['type']!==_0x1a75('0x3e')){var _0xc88c40={};_0xc88c40[_0x2842d4[_0x1a75('0x28')]]={'$like':'%'+_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3f')]+'%'};return _0xc88c40;}})});}_0x9e66b9=_['merge']({},_0x9e66b9,_0x2f5ac9[_0x1a75('0x40')]);var _0x481bfe={'where':_0x9e66b9[_0x1a75('0x3b')]};return db[_0x1a75('0x2b')][_0x1a75('0x1c')](_0x481bfe)[_0x1a75('0x23')](function(_0x269ed6){_0x38e885[_0x1a75('0x1c')]=_0x269ed6;if(_0x2f5ac9[_0x1a75('0x32')]['includeAll']){_0x9e66b9['include']=[{'all':!![]}];}return db[_0x1a75('0x2b')]['findAll'](_0x9e66b9);})[_0x1a75('0x23')](function(_0x14abcf){_0x38e885[_0x1a75('0x41')]=_0x14abcf;return _0x38e885;})['then'](respondWithFilteredResult(_0xf33870,_0x9e66b9))[_0x1a75('0x42')](handleError(_0xf33870,null));};exports[_0x1a75('0x43')]=function(_0x21bfae,_0x5a2c51){var _0x292cbc={'raw':!![],'where':{'id':_0x21bfae[_0x1a75('0x44')]['id']}},_0x15fe49={};_0x15fe49[_0x1a75('0x30')]=_[_0x1a75('0x45')](db[_0x1a75('0x2b')][_0x1a75('0x2c')]);_0x15fe49['query']=_[_0x1a75('0x45')](_0x21bfae[_0x1a75('0x32')]);_0x15fe49[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x15fe49[_0x1a75('0x30')],_0x15fe49['query']);_0x292cbc[_0x1a75('0x36')]=_[_0x1a75('0x34')](_0x15fe49['model'],qs[_0x1a75('0x35')](_0x21bfae['query'][_0x1a75('0x35')]));_0x292cbc['attributes']=_0x292cbc[_0x1a75('0x36')][_0x1a75('0x37')]?_0x292cbc[_0x1a75('0x36')]:_0x15fe49[_0x1a75('0x30')];if(_0x21bfae[_0x1a75('0x32')][_0x1a75('0x46')]){_0x292cbc[_0x1a75('0x47')]=[{'all':!![]}];}_0x292cbc=_['merge']({},_0x292cbc,_0x21bfae[_0x1a75('0x40')]);return db['JscriptyAnswerReport'][_0x1a75('0x48')](_0x292cbc)[_0x1a75('0x23')](handleEntityNotFound(_0x5a2c51,null))[_0x1a75('0x23')](respondWithResult(_0x5a2c51,null))[_0x1a75('0x42')](handleError(_0x5a2c51,null));};exports[_0x1a75('0x49')]=function(_0x1bf8a0,_0x2cfacf){return db[_0x1a75('0x2b')]['create'](_0x1bf8a0[_0x1a75('0x4a')],{})[_0x1a75('0x23')](respondWithResult(_0x2cfacf,0xc9))[_0x1a75('0x42')](handleError(_0x2cfacf,null));};exports[_0x1a75('0x22')]=function(_0x385382,_0x1b76d){if(_0x385382[_0x1a75('0x4a')]['id']){delete _0x385382[_0x1a75('0x4a')]['id'];}return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0x385382[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1b76d,null))[_0x1a75('0x23')](saveUpdates(_0x385382[_0x1a75('0x4a')],null))[_0x1a75('0x23')](respondWithResult(_0x1b76d,null))['catch'](handleError(_0x1b76d,null));};exports[_0x1a75('0x24')]=function(_0xa20c25,_0x1ae0cb){return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0xa20c25[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1ae0cb,null))[_0x1a75('0x23')](removeEntity(_0x1ae0cb,null))['catch'](handleError(_0x1ae0cb,null));};exports[_0x1a75('0x4b')]=function(_0x5f44e3,_0x40e643){return db[_0x1a75('0x2b')][_0x1a75('0x4b')]()['then'](respondWithResult(_0x40e643,null))['catch'](handleError(_0x40e643,null));}; \ No newline at end of file +var _0x81d4=['sort','where','filters','pick','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','catch','show','keys','create','update','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','set','json','apply','reject','then','destroy','sendStatus','error','stack','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0x10e668,_0xf9e51a){var _0x1c643e=function(_0x16d58d){while(--_0x16d58d){_0x10e668['push'](_0x10e668['shift']());}};_0x1c643e(++_0xf9e51a);}(_0x81d4,0x197));var _0x481d=function(_0x2a1afa,_0x32aa31){_0x2a1afa=_0x2a1afa-0x0;var _0x31b875=_0x81d4[_0x2a1afa];return _0x31b875;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x481d('0x0'));var zipdir=require(_0x481d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x481d('0x2'));var moment=require(_0x481d('0x3'));var BPromise=require(_0x481d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x481d('0x5'));var sox=require(_0x481d('0x6'));var csv=require(_0x481d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x481d('0x8'));var _=require(_0x481d('0x9'));var squel=require(_0x481d('0xa'));var crypto=require(_0x481d('0xb'));var jsforce=require(_0x481d('0xc'));var deskjs=require(_0x481d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x481d('0xe'));var Papa=require(_0x481d('0xf'));var Redis=require(_0x481d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x481d('0x11'));var as=require(_0x481d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x481d('0x13'))(_0x481d('0x14'));var utils=require(_0x481d('0x15'));var config=require(_0x481d('0x16'));var licenseUtil=require(_0x481d('0x17'));var db=require(_0x481d('0x18'))['db'];function respondWithStatusCode(_0x9c7a08,_0x4e33fc){_0x4e33fc=_0x4e33fc||0xcc;return function(_0x3a751f){if(_0x3a751f){return _0x9c7a08['sendStatus'](_0x4e33fc);}return _0x9c7a08['status'](_0x4e33fc)[_0x481d('0x19')]();};}function respondWithResult(_0x18bd93,_0x2f32c8){_0x2f32c8=_0x2f32c8||0xc8;return function(_0x5cbe7e){if(_0x5cbe7e){return _0x18bd93[_0x481d('0x1a')](_0x2f32c8)['json'](_0x5cbe7e);}};}function respondWithFilteredResult(_0x1e3df6,_0x15bba7){return function(_0x222f72){if(_0x222f72){var _0x1bda12=typeof _0x15bba7[_0x481d('0x1b')]==='undefined'&&typeof _0x15bba7[_0x481d('0x1c')]===_0x481d('0x1d');var _0x3e2a27=_0x222f72['count'];var _0x21e2a5=_0x1bda12?0x0:_0x15bba7['offset'];var _0x3ef7c6=_0x1bda12?_0x222f72['count']:_0x15bba7[_0x481d('0x1b')]+_0x15bba7['limit'];var _0x30ef03;if(_0x3ef7c6>=_0x3e2a27){_0x3ef7c6=_0x3e2a27;_0x30ef03=0xc8;}else{_0x30ef03=0xce;}_0x1e3df6['status'](_0x30ef03);return _0x1e3df6[_0x481d('0x1e')]('Content-Range',_0x21e2a5+'-'+_0x3ef7c6+'/'+_0x3e2a27)[_0x481d('0x1f')](_0x222f72);}return null;};}function patchUpdates(_0x41a4de){return function(_0x4d56ea){try{jsonpatch[_0x481d('0x20')](_0x4d56ea,_0x41a4de,!![]);}catch(_0x3856b3){return BPromise[_0x481d('0x21')](_0x3856b3);}return _0x4d56ea['save']();};}function saveUpdates(_0x45745b,_0x4ab1e8){return function(_0x560b33){if(_0x560b33){return _0x560b33['update'](_0x45745b)[_0x481d('0x22')](function(_0x5a81e6){return _0x5a81e6;});}return null;};}function removeEntity(_0x53ff79,_0x280586){return function(_0x237c02){if(_0x237c02){return _0x237c02[_0x481d('0x23')]()['then'](function(){_0x53ff79[_0x481d('0x1a')](0xcc)[_0x481d('0x19')]();});}};}function handleEntityNotFound(_0x51e3a,_0x3cc630){return function(_0x485de5){if(!_0x485de5){_0x51e3a[_0x481d('0x24')](0x194);}return _0x485de5;};}function handleError(_0xd5145,_0x4adf1f){_0x4adf1f=_0x4adf1f||0x1f4;return function(_0x371cbe){logger[_0x481d('0x25')](_0x371cbe[_0x481d('0x26')]);if(_0x371cbe['name']){delete _0x371cbe['name'];}_0xd5145[_0x481d('0x1a')](_0x4adf1f)[_0x481d('0x27')](_0x371cbe);};}exports['index']=function(_0x55bf9c,_0x2ab9dc){var _0x15cb55={},_0x495fbb={},_0xe8060f={'count':0x0,'rows':[]};var _0x4170a1=_[_0x481d('0x28')](db[_0x481d('0x29')][_0x481d('0x2a')],function(_0x36bf9f){return{'name':_0x36bf9f[_0x481d('0x2b')],'type':_0x36bf9f[_0x481d('0x2c')][_0x481d('0x2d')]};});_0x495fbb['model']=_[_0x481d('0x28')](_0x4170a1,'name');_0x495fbb['query']=_['keys'](_0x55bf9c[_0x481d('0x2e')]);_0x495fbb['filters']=_[_0x481d('0x2f')](_0x495fbb['model'],_0x495fbb[_0x481d('0x2e')]);_0x15cb55[_0x481d('0x30')]=_[_0x481d('0x2f')](_0x495fbb[_0x481d('0x31')],qs[_0x481d('0x32')](_0x55bf9c[_0x481d('0x2e')][_0x481d('0x32')]));_0x15cb55[_0x481d('0x30')]=_0x15cb55[_0x481d('0x30')][_0x481d('0x33')]?_0x15cb55[_0x481d('0x30')]:_0x495fbb[_0x481d('0x31')];if(!_0x55bf9c[_0x481d('0x2e')][_0x481d('0x34')](_0x481d('0x35'))){_0x15cb55['limit']=qs[_0x481d('0x1c')](_0x55bf9c[_0x481d('0x2e')][_0x481d('0x1c')]);_0x15cb55[_0x481d('0x1b')]=qs[_0x481d('0x1b')](_0x55bf9c[_0x481d('0x2e')][_0x481d('0x1b')]);}_0x15cb55[_0x481d('0x36')]=qs['sort'](_0x55bf9c[_0x481d('0x2e')][_0x481d('0x37')]);_0x15cb55[_0x481d('0x38')]=qs[_0x481d('0x39')](_[_0x481d('0x3a')](_0x55bf9c['query'],_0x495fbb['filters']),_0x4170a1);if(_0x55bf9c[_0x481d('0x2e')]['filter']){_0x15cb55[_0x481d('0x38')]=_[_0x481d('0x3b')](_0x15cb55[_0x481d('0x38')],{'$or':_[_0x481d('0x28')](_0x4170a1,function(_0x463a44){if(_0x463a44[_0x481d('0x2c')]!==_0x481d('0x3c')){var _0x166c93={};_0x166c93[_0x463a44[_0x481d('0x3d')]]={'$like':'%'+_0x55bf9c['query']['filter']+'%'};return _0x166c93;}})});}_0x15cb55=_[_0x481d('0x3b')]({},_0x15cb55,_0x55bf9c[_0x481d('0x3e')]);var _0x4f69f1={'where':_0x15cb55[_0x481d('0x38')]};return db[_0x481d('0x29')]['count'](_0x4f69f1)[_0x481d('0x22')](function(_0x2e0db1){_0xe8060f[_0x481d('0x3f')]=_0x2e0db1;if(_0x55bf9c[_0x481d('0x2e')][_0x481d('0x40')]){_0x15cb55[_0x481d('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x481d('0x42')](_0x15cb55);})[_0x481d('0x22')](function(_0x128185){_0xe8060f[_0x481d('0x43')]=_0x128185;return _0xe8060f;})['then'](respondWithFilteredResult(_0x2ab9dc,_0x15cb55))[_0x481d('0x44')](handleError(_0x2ab9dc,null));};exports[_0x481d('0x45')]=function(_0x23ccc0,_0x3f3009){var _0x55a8a0={'raw':!![],'where':{'id':_0x23ccc0['params']['id']}},_0x2669b9={};_0x2669b9[_0x481d('0x31')]=_[_0x481d('0x46')](db[_0x481d('0x29')][_0x481d('0x2a')]);_0x2669b9[_0x481d('0x2e')]=_[_0x481d('0x46')](_0x23ccc0[_0x481d('0x2e')]);_0x2669b9[_0x481d('0x39')]=_['intersection'](_0x2669b9[_0x481d('0x31')],_0x2669b9[_0x481d('0x2e')]);_0x55a8a0[_0x481d('0x30')]=_[_0x481d('0x2f')](_0x2669b9['model'],qs[_0x481d('0x32')](_0x23ccc0[_0x481d('0x2e')][_0x481d('0x32')]));_0x55a8a0[_0x481d('0x30')]=_0x55a8a0[_0x481d('0x30')][_0x481d('0x33')]?_0x55a8a0[_0x481d('0x30')]:_0x2669b9[_0x481d('0x31')];if(_0x23ccc0[_0x481d('0x2e')][_0x481d('0x40')]){_0x55a8a0[_0x481d('0x41')]=[{'all':!![]}];}_0x55a8a0=_[_0x481d('0x3b')]({},_0x55a8a0,_0x23ccc0[_0x481d('0x3e')]);return db[_0x481d('0x29')]['find'](_0x55a8a0)['then'](handleEntityNotFound(_0x3f3009,null))[_0x481d('0x22')](respondWithResult(_0x3f3009,null))[_0x481d('0x44')](handleError(_0x3f3009,null));};exports[_0x481d('0x47')]=function(_0x24e38a,_0x4f7eed){return db[_0x481d('0x29')][_0x481d('0x47')](_0x24e38a['body'],{})[_0x481d('0x22')](respondWithResult(_0x4f7eed,0xc9))[_0x481d('0x44')](handleError(_0x4f7eed,null));};exports[_0x481d('0x48')]=function(_0x3075c5,_0x4d6bf9){if(_0x3075c5['body']['id']){delete _0x3075c5[_0x481d('0x49')]['id'];}return db[_0x481d('0x29')][_0x481d('0x4a')]({'where':{'id':_0x3075c5[_0x481d('0x4b')]['id']}})[_0x481d('0x22')](handleEntityNotFound(_0x4d6bf9,null))[_0x481d('0x22')](saveUpdates(_0x3075c5[_0x481d('0x49')],null))[_0x481d('0x22')](respondWithResult(_0x4d6bf9,null))[_0x481d('0x44')](handleError(_0x4d6bf9,null));};exports['destroy']=function(_0x48b270,_0x586631){return db[_0x481d('0x29')][_0x481d('0x4a')]({'where':{'id':_0x48b270[_0x481d('0x4b')]['id']}})[_0x481d('0x22')](handleEntityNotFound(_0x586631,null))[_0x481d('0x22')](removeEntity(_0x586631,null))[_0x481d('0x44')](handleError(_0x586631,null));};exports[_0x481d('0x4c')]=function(_0x5c0022,_0x455273){return db[_0x481d('0x29')][_0x481d('0x4c')]()[_0x481d('0x22')](respondWithResult(_0x455273,null))[_0x481d('0x44')](handleError(_0x455273,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 86e74ec..ffd37d9 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 _0xad61=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x22eeae,_0x4984f2){var _0x3b9c11=function(_0x1c0a28){while(--_0x1c0a28){_0x22eeae['push'](_0x22eeae['shift']());}};_0x3b9c11(++_0x4984f2);}(_0xad61,0x85));var _0x1ad6=function(_0x773203,_0x2d3f74){_0x773203=_0x773203-0x0;var _0x4a7d22=_0xad61[_0x773203];return _0x4a7d22;};'use strict';var _=require(_0x1ad6('0x0'));var util=require(_0x1ad6('0x1'));var logger=require(_0x1ad6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1ad6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ad6('0x4'));var rimraf=require(_0x1ad6('0x5'));var config=require(_0x1ad6('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x5b31fc,_0x588a8b){return _0x5b31fc[_0x1ad6('0x7')](_0x1ad6('0x8'),attributes,{'tableName':_0x1ad6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5445=['util','../../config/logger','api','bluebird','path','rimraf','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0xb1428b,_0xf66cf4){var _0x58f132=function(_0x5e9228){while(--_0x5e9228){_0xb1428b['push'](_0xb1428b['shift']());}};_0x58f132(++_0xf66cf4);}(_0x5445,0x87));var _0x5544=function(_0xa261f5,_0x37ed4e){_0xa261f5=_0xa261f5-0x0;var _0x4a889b=_0x5445[_0xa261f5];return _0x4a889b;};'use strict';var _=require('lodash');var util=require(_0x5544('0x0'));var logger=require(_0x5544('0x1'))(_0x5544('0x2'));var moment=require('moment');var BPromise=require(_0x5544('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5544('0x4'));var rimraf=require(_0x5544('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x1fc6de,_0x1d71a2){return _0x1fc6de[_0x5544('0x6')](_0x5544('0x7'),attributes,{'tableName':_0x5544('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 06d3a71..a680fbb 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 _0x1580=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x166f70,_0x482794){var _0x439994=function(_0x16cbce){while(--_0x16cbce){_0x166f70['push'](_0x166f70['shift']());}};_0x439994(++_0x482794);}(_0x1580,0x93));var _0x0158=function(_0x290343,_0x36c848){_0x290343=_0x290343-0x0;var _0x211bcd=_0x1580[_0x290343];return _0x211bcd;};'use strict';var _=require(_0x0158('0x0'));var util=require(_0x0158('0x1'));var moment=require(_0x0158('0x2'));var BPromise=require(_0x0158('0x3'));var rs=require(_0x0158('0x4'));var fs=require('fs');var Redis=require(_0x0158('0x5'));var db=require(_0x0158('0x6'))['db'];var utils=require(_0x0158('0x7'));var logger=require('../../config/logger')(_0x0158('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0158('0x9')][_0x0158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31bb47,_0x1d23ae,_0x197989){return new BPromise(function(_0x51c96b,_0x200ebb){return client[_0x0158('0xb')](_0x31bb47,_0x197989)['then'](function(_0x2d21f7){logger[_0x0158('0xc')](_0x0158('0xd'),_0x1d23ae,_0x0158('0xe'));logger[_0x0158('0xf')](_0x0158('0x10'),_0x1d23ae,_0x0158('0xe'),JSON[_0x0158('0x11')](_0x2d21f7));if(_0x2d21f7[_0x0158('0x12')]){if(_0x2d21f7[_0x0158('0x12')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1d23ae,_0x2d21f7[_0x0158('0x12')][_0x0158('0x13')]);return _0x200ebb(_0x2d21f7[_0x0158('0x12')][_0x0158('0x13')]);}logger[_0x0158('0x12')](_0x0158('0xd'),_0x1d23ae,_0x2d21f7[_0x0158('0x12')][_0x0158('0x13')]);return _0x51c96b(_0x2d21f7[_0x0158('0x12')][_0x0158('0x13')]);}else{logger[_0x0158('0xc')](_0x0158('0xd'),_0x1d23ae,_0x0158('0xe'));_0x51c96b(_0x2d21f7[_0x0158('0x14')][_0x0158('0x13')]);}})['catch'](function(_0x18c8c4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1d23ae,_0x18c8c4);_0x200ebb(_0x18c8c4);});});} \ No newline at end of file +var _0xff45=['message','request\x20sent','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x330296,_0x11cd68){var _0x38919c=function(_0x183999){while(--_0x183999){_0x330296['push'](_0x330296['shift']());}};_0x38919c(++_0x11cd68);}(_0xff45,0x16b));var _0x5ff4=function(_0x25206c,_0xdc8ea5){_0x25206c=_0x25206c-0x0;var _0x21820e=_0xff45[_0x25206c];return _0x21820e;};'use strict';var _=require('lodash');var util=require(_0x5ff4('0x0'));var moment=require(_0x5ff4('0x1'));var BPromise=require(_0x5ff4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ff4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ff4('0x4'));var logger=require('../../config/logger')(_0x5ff4('0x5'));var config=require(_0x5ff4('0x6'));var jayson=require(_0x5ff4('0x7'));var client=jayson[_0x5ff4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58a54a,_0x11f117,_0x46dd4d){return new BPromise(function(_0x26946e,_0xb52da9){return client[_0x5ff4('0x9')](_0x58a54a,_0x46dd4d)[_0x5ff4('0xa')](function(_0x152da7){logger[_0x5ff4('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x11f117,'request\x20sent');logger['debug'](_0x5ff4('0xc'),_0x11f117,'request\x20sent',JSON[_0x5ff4('0xd')](_0x152da7));if(_0x152da7[_0x5ff4('0xe')]){if(_0x152da7[_0x5ff4('0xe')][_0x5ff4('0xf')]===0x1f4){logger['error'](_0x5ff4('0x10'),_0x11f117,_0x152da7[_0x5ff4('0xe')][_0x5ff4('0x11')]);return _0xb52da9(_0x152da7[_0x5ff4('0xe')][_0x5ff4('0x11')]);}logger[_0x5ff4('0xe')](_0x5ff4('0x10'),_0x11f117,_0x152da7[_0x5ff4('0xe')][_0x5ff4('0x11')]);return _0x26946e(_0x152da7[_0x5ff4('0xe')][_0x5ff4('0x11')]);}else{logger[_0x5ff4('0xb')](_0x5ff4('0x10'),_0x11f117,_0x5ff4('0x12'));_0x26946e(_0x152da7['result'][_0x5ff4('0x11')]);}})['catch'](function(_0x34c1d2){logger[_0x5ff4('0xe')](_0x5ff4('0x10'),_0x11f117,_0x34c1d2);_0xb52da9(_0x34c1d2);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8b4fbea..19587bc 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 _0x833d=['getSessions','/:id/answers','/:id/summary','post','create','clone','put','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x833d,0x8c));var _0xd833=function(_0x42f602,_0x4e9b42){_0x42f602=_0x42f602-0x0;var _0x13e363=_0x833d[_0x42f602];return _0x13e363;};'use strict';var multer=require('multer');var util=require(_0xd833('0x0'));var path=require(_0xd833('0x1'));var timeout=require(_0xd833('0x2'));var express=require(_0xd833('0x3'));var router=express[_0xd833('0x4')]();var fs_extra=require(_0xd833('0x5'));var auth=require(_0xd833('0x6'));var interaction=require(_0xd833('0x7'));var config=require('../../config/environment');var controller=require(_0xd833('0x8'));router[_0xd833('0x9')]('/',auth[_0xd833('0xa')](),controller[_0xd833('0xb')]);router[_0xd833('0x9')](_0xd833('0xc'),auth['isAuthenticated'](),controller[_0xd833('0xd')]);router[_0xd833('0x9')]('/:id/sessions',auth[_0xd833('0xa')](),controller[_0xd833('0xe')]);router[_0xd833('0x9')](_0xd833('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xd833('0x9')](_0xd833('0x10'),auth[_0xd833('0xa')](),timeout('30s'),controller['getSummary']);router[_0xd833('0x11')]('/',auth[_0xd833('0xa')](),controller[_0xd833('0x12')]);router['post']('/:id/clone',auth[_0xd833('0xa')](),controller[_0xd833('0x13')]);router[_0xd833('0x14')](_0xd833('0xc'),auth[_0xd833('0xa')](),controller['update']);router[_0xd833('0x15')](_0xd833('0xc'),auth[_0xd833('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b2b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','create','/:id/clone','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x2b2b,0x1d8));var _0xb2b2=function(_0x400e1f,_0x93bfb6){_0x400e1f=_0x400e1f-0x0;var _0x18dc0e=_0x2b2b[_0x400e1f];return _0x18dc0e;};'use strict';var multer=require('multer');var util=require(_0xb2b2('0x0'));var path=require(_0xb2b2('0x1'));var timeout=require(_0xb2b2('0x2'));var express=require(_0xb2b2('0x3'));var router=express[_0xb2b2('0x4')]();var fs_extra=require(_0xb2b2('0x5'));var auth=require(_0xb2b2('0x6'));var interaction=require(_0xb2b2('0x7'));var config=require('../../config/environment');var controller=require(_0xb2b2('0x8'));router[_0xb2b2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb2b2('0x9')](_0xb2b2('0xa'),auth[_0xb2b2('0xb')](),controller[_0xb2b2('0xc')]);router[_0xb2b2('0x9')](_0xb2b2('0xd'),auth[_0xb2b2('0xb')](),controller[_0xb2b2('0xe')]);router[_0xb2b2('0x9')](_0xb2b2('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xb2b2('0x9')](_0xb2b2('0x10'),auth[_0xb2b2('0xb')](),timeout(_0xb2b2('0x11')),controller[_0xb2b2('0x12')]);router['post']('/',auth[_0xb2b2('0xb')](),controller[_0xb2b2('0x13')]);router['post'](_0xb2b2('0x14'),auth[_0xb2b2('0xb')](),controller['clone']);router[_0xb2b2('0x15')]('/:id',auth[_0xb2b2('0xb')](),controller[_0xb2b2('0x16')]);router[_0xb2b2('0x17')](_0xb2b2('0xa'),auth[_0xb2b2('0xb')](),controller[_0xb2b2('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c078c88..293ef65 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 _0x6da1=['TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x5579f2,_0x1d2737){var _0x1425d7=function(_0xc1728a){while(--_0xc1728a){_0x5579f2['push'](_0x5579f2['shift']());}};_0x1425d7(++_0x1d2737);}(_0x6da1,0x102));var _0x16da=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x6da1[_0x5517c0];return _0x33803b;};'use strict';var Sequelize=require(_0x16da('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x16da('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x16da('0x1')]},'formData':{'type':Sequelize[_0x16da('0x2')](_0x16da('0x3')),'set':function(_0x1d7718){if(_[_0x16da('0x4')](_0x1d7718)){this[_0x16da('0x5')]('formData',JSON[_0x16da('0x6')](_0x1d7718));}else if(_[_0x16da('0x7')](_0x1d7718)){this[_0x16da('0x5')]('formData',_0x1d7718);}else{this['setDataValue'](_0x16da('0x8'),util[_0x16da('0x9')](_0x16da('0xa'),this[_0x16da('0xb')]('name')||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x16da('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x16da('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x5af2=['lodash','STRING','name','TEXT','long','isObjectLike','formData','stringify','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5af2,0x1e9));var _0x25af=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x5af2[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x25af('0x0'));var _=require(_0x25af('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x25af('0x2')],'unique':_0x25af('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x25af('0x4')](_0x25af('0x5')),'set':function(_0x339364){if(_[_0x25af('0x6')](_0x339364)){this['setDataValue'](_0x25af('0x7'),JSON[_0x25af('0x8')](_0x339364));}else if(_['isString'](_0x339364)){this[_0x25af('0x9')](_0x25af('0x7'),_0x339364);}else{this[_0x25af('0x9')](_0x25af('0x7'),util[_0x25af('0xa')](_0x25af('0xb'),this['getDataValue'](_0x25af('0x3'))||'',this['getDataValue'](_0x25af('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x25af('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x25af('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index ed902d6..4e98780 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 _0x1beb=['isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','merge','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','params','omit','createdAt','findOne','JscriptySessionReport','order','ProjectId','findAll','JscriptyAnswerReport','pick','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x1beb,0x165));var _0xb1be=function(_0x2486ed,_0x10d0d8){_0x2486ed=_0x2486ed-0x0;var _0x450e84=_0x1beb[_0x2486ed];return _0x450e84;};'use strict';var emlformat=require(_0xb1be('0x0'));var rimraf=require(_0xb1be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1be('0x2'));var rp=require(_0xb1be('0x3'));var moment=require(_0xb1be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1be('0x5'));var util=require(_0xb1be('0x6'));var path=require('path');var sox=require(_0xb1be('0x7'));var csv=require(_0xb1be('0x8'));var ejs=require(_0xb1be('0x9'));var fs=require('fs');var fs_extra=require(_0xb1be('0xa'));var _=require(_0xb1be('0xb'));var squel=require(_0xb1be('0xc'));var crypto=require(_0xb1be('0xd'));var jsforce=require(_0xb1be('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb1be('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb1be('0xf'));var authService=require(_0xb1be('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1be('0x11'));var logger=require(_0xb1be('0x12'))('api');var utils=require(_0xb1be('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb1be('0x14'));var db=require(_0xb1be('0x15'))['db'];function respondWithStatusCode(_0x5eb9a7,_0x276ef4){_0x276ef4=_0x276ef4||0xcc;return function(_0x33fd7e){if(_0x33fd7e){return _0x5eb9a7[_0xb1be('0x16')](_0x276ef4);}return _0x5eb9a7[_0xb1be('0x17')](_0x276ef4)[_0xb1be('0x18')]();};}function respondWithResult(_0x1b28d6,_0xe9afab){_0xe9afab=_0xe9afab||0xc8;return function(_0x3772d3){if(_0x3772d3){return _0x1b28d6['status'](_0xe9afab)[_0xb1be('0x19')](_0x3772d3);}};}function respondWithFilteredResult(_0x5399b0,_0x361954){return function(_0x386c28){if(_0x386c28){var _0x172e74=typeof _0x361954[_0xb1be('0x1a')]===_0xb1be('0x1b')&&typeof _0x361954['limit']==='undefined';var _0x213c9d=_0x386c28[_0xb1be('0x1c')];var _0x2bad8f=_0x172e74?0x0:_0x361954['offset'];var _0x157b8a=_0x172e74?_0x386c28['count']:_0x361954[_0xb1be('0x1a')]+_0x361954[_0xb1be('0x1d')];var _0x58ceff;if(_0x157b8a>=_0x213c9d){_0x157b8a=_0x213c9d;_0x58ceff=0xc8;}else{_0x58ceff=0xce;}_0x5399b0[_0xb1be('0x17')](_0x58ceff);return _0x5399b0[_0xb1be('0x1e')]('Content-Range',_0x2bad8f+'-'+_0x157b8a+'/'+_0x213c9d)[_0xb1be('0x19')](_0x386c28);}return null;};}function patchUpdates(_0x453530){return function(_0x9fa059){try{jsonpatch['apply'](_0x9fa059,_0x453530,!![]);}catch(_0x36d7bf){return BPromise[_0xb1be('0x1f')](_0x36d7bf);}return _0x9fa059['save']();};}function saveUpdates(_0x362768,_0x35c456){return function(_0x57cf28){if(_0x57cf28){return _0x57cf28[_0xb1be('0x20')](_0x362768)[_0xb1be('0x21')](function(_0x36f72d){return _0x36f72d;});}return null;};}function removeEntity(_0x55bd24,_0x372a6c){return function(_0x5de89c){if(_0x5de89c){return _0x5de89c['destroy']()[_0xb1be('0x21')](function(){var _0x5194d2=_0x5de89c[_0xb1be('0x22')]({'plain':!![]});var _0x281c25=_0xb1be('0x23');return db[_0xb1be('0x24')][_0xb1be('0x25')]({'where':{'type':_0x281c25,'resourceId':_0x5194d2['id']}})['then'](function(){return _0x5de89c;});})[_0xb1be('0x21')](function(){_0x55bd24[_0xb1be('0x17')](0xcc)[_0xb1be('0x18')]();});}};}function handleEntityNotFound(_0x53da29,_0x3ef2b2){return function(_0x339adc){if(!_0x339adc){_0x53da29[_0xb1be('0x16')](0x194);}return _0x339adc;};}function handleError(_0x5000eb,_0x585e89){_0x585e89=_0x585e89||0x1f4;return function(_0x1129d5){logger[_0xb1be('0x26')](_0x1129d5[_0xb1be('0x27')]);if(_0x1129d5[_0xb1be('0x28')]){delete _0x1129d5['name'];}_0x5000eb[_0xb1be('0x17')](_0x585e89)[_0xb1be('0x29')](_0x1129d5);};}exports[_0xb1be('0x2a')]=function(_0x59b7ae,_0x188fe1){var _0x49b160={},_0x12d4f2={},_0x2c4c1d={'count':0x0,'rows':[]};var _0x1cbe07=_[_0xb1be('0x2b')](db['JscriptyProject'][_0xb1be('0x2c')],function(_0x5494b8){return{'name':_0x5494b8[_0xb1be('0x2d')],'type':_0x5494b8[_0xb1be('0x2e')][_0xb1be('0x2f')]};});_0x12d4f2['model']=_[_0xb1be('0x2b')](_0x1cbe07,_0xb1be('0x28'));_0x12d4f2['query']=_[_0xb1be('0x30')](_0x59b7ae[_0xb1be('0x31')]);_0x12d4f2['filters']=_[_0xb1be('0x32')](_0x12d4f2[_0xb1be('0x33')],_0x12d4f2['query']);_0x49b160['attributes']=_['intersection'](_0x12d4f2[_0xb1be('0x33')],qs[_0xb1be('0x34')](_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x34')]));_0x49b160[_0xb1be('0x35')]=_0x49b160[_0xb1be('0x35')][_0xb1be('0x36')]?_0x49b160[_0xb1be('0x35')]:_0x12d4f2[_0xb1be('0x33')];if(!_0x59b7ae['query'][_0xb1be('0x37')](_0xb1be('0x38'))){_0x49b160[_0xb1be('0x1d')]=qs[_0xb1be('0x1d')](_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x1d')]);_0x49b160[_0xb1be('0x1a')]=qs['offset'](_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x1a')]);}_0x49b160['order']=qs[_0xb1be('0x39')](_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x39')]);_0x49b160[_0xb1be('0x3a')]=qs[_0xb1be('0x3b')](_['pick'](_0x59b7ae['query'],_0x12d4f2['filters']),_0x1cbe07);if(_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x3c')]){_0x49b160[_0xb1be('0x3a')]=_['merge'](_0x49b160[_0xb1be('0x3a')],{'$or':_[_0xb1be('0x2b')](_0x1cbe07,function(_0x3b884e){if(_0x3b884e['type']!==_0xb1be('0x3d')){var _0x3fe2cf={};_0x3fe2cf[_0x3b884e[_0xb1be('0x28')]]={'$like':'%'+_0x59b7ae['query']['filter']+'%'};return _0x3fe2cf;}})});}_0x49b160=_['merge']({},_0x49b160,_0x59b7ae[_0xb1be('0x3e')]);var _0x50b0bc={'where':_0x49b160[_0xb1be('0x3a')]};return db[_0xb1be('0x3f')]['count'](_0x50b0bc)[_0xb1be('0x21')](function(_0x193c73){_0x2c4c1d[_0xb1be('0x1c')]=_0x193c73;if(_0x59b7ae[_0xb1be('0x31')][_0xb1be('0x40')]){_0x49b160[_0xb1be('0x41')]=[{'all':!![]}];}return db[_0xb1be('0x3f')]['findAll'](_0x49b160);})[_0xb1be('0x21')](function(_0x125ee7){_0x2c4c1d[_0xb1be('0x42')]=_0x125ee7;return _0x2c4c1d;})[_0xb1be('0x21')](respondWithFilteredResult(_0x188fe1,_0x49b160))[_0xb1be('0x43')](handleError(_0x188fe1,null));};exports['show']=function(_0x2b3836,_0x17ff51){var _0x116509={'raw':![],'where':{'id':_0x2b3836['params']['id']}},_0x38794e={};_0x38794e[_0xb1be('0x33')]=_['keys'](db[_0xb1be('0x3f')][_0xb1be('0x2c')]);_0x38794e[_0xb1be('0x31')]=_[_0xb1be('0x30')](_0x2b3836[_0xb1be('0x31')]);_0x38794e['filters']=_[_0xb1be('0x32')](_0x38794e['model'],_0x38794e[_0xb1be('0x31')]);_0x116509[_0xb1be('0x35')]=_[_0xb1be('0x32')](_0x38794e[_0xb1be('0x33')],qs['fields'](_0x2b3836[_0xb1be('0x31')][_0xb1be('0x34')]));_0x116509[_0xb1be('0x35')]=_0x116509[_0xb1be('0x35')]['length']?_0x116509['attributes']:_0x38794e[_0xb1be('0x33')];if(_0x2b3836['query']['includeAll']){_0x116509[_0xb1be('0x41')]=[{'all':!![]}];}_0x116509=_[_0xb1be('0x44')]({},_0x116509,_0x2b3836[_0xb1be('0x3e')]);return db[_0xb1be('0x3f')][_0xb1be('0x45')](_0x116509)[_0xb1be('0x21')](handleEntityNotFound(_0x17ff51,null))['then'](respondWithResult(_0x17ff51,null))[_0xb1be('0x43')](handleError(_0x17ff51,null));};exports[_0xb1be('0x46')]=function(_0x23f03f,_0x425257){return db['JscriptyProject']['create'](_0x23f03f[_0xb1be('0x47')],{})[_0xb1be('0x21')](function(_0x4abd1b){var _0x1db7ed=_0x23f03f[_0xb1be('0x48')]['get']({'plain':!![]});if(!_0x1db7ed)throw new Error(_0xb1be('0x49'));if(_0x1db7ed[_0xb1be('0x4a')]===_0xb1be('0x48')){var _0x2fcf8a=_0x4abd1b['get']({'plain':!![]});var _0x298cf3=_0xb1be('0x23');return db[_0xb1be('0x4b')][_0xb1be('0x45')]({'where':{'name':_0x298cf3,'userProfileId':_0x1db7ed[_0xb1be('0x4c')]},'raw':!![]})['then'](function(_0x584f54){if(_0x584f54&&_0x584f54[_0xb1be('0x4d')]===0x0){return db['UserProfileResource'][_0xb1be('0x46')]({'name':_0x2fcf8a[_0xb1be('0x28')],'resourceId':_0x2fcf8a['id'],'type':_0x584f54[_0xb1be('0x28')],'sectionId':_0x584f54['id']},{})[_0xb1be('0x21')](function(){return _0x4abd1b;});}else{return _0x4abd1b;}})[_0xb1be('0x43')](function(_0x44a47a){logger[_0xb1be('0x26')](_0xb1be('0x4e'),_0x44a47a);throw _0x44a47a;});}return _0x4abd1b;})[_0xb1be('0x21')](respondWithResult(_0x425257,0xc9))[_0xb1be('0x43')](handleError(_0x425257,null));};exports['clone']=function(_0x196eb0,_0x1f3531){var _0x540014={'where':{'id':_0x196eb0[_0xb1be('0x4f')]['id']}},_0x1ace00={};_0x1ace00[_0xb1be('0x33')]=_[_0xb1be('0x30')](db[_0xb1be('0x3f')][_0xb1be('0x2c')]);_0x540014[_0xb1be('0x35')]=_[_0xb1be('0x32')](_0x1ace00[_0xb1be('0x33')],qs[_0xb1be('0x34')](_0x196eb0[_0xb1be('0x31')]['fields']));_0x540014[_0xb1be('0x35')]=_0x540014['attributes'][_0xb1be('0x36')]?_0x540014[_0xb1be('0x35')]:_0x1ace00[_0xb1be('0x33')];if(_0x196eb0[_0xb1be('0x31')][_0xb1be('0x40')]){_0x540014[_0xb1be('0x41')]=[{'all':!![]}];}_0x540014=_[_0xb1be('0x44')]({},_0x540014,_0x196eb0[_0xb1be('0x3e')]);return db[_0xb1be('0x3f')][_0xb1be('0x45')](_0x540014)[_0xb1be('0x21')](handleEntityNotFound(_0x1f3531,null))['then'](function(_0x5bf6fe){if(_0x5bf6fe){var _0xce9df7=_0x5bf6fe[_0xb1be('0x22')]({'plain':!![]});_0xce9df7=qs[_0xb1be('0x50')](_0xce9df7,['id',_0xb1be('0x51'),'updatedAt']);_0x196eb0['body']=_['omit'](_0x196eb0[_0xb1be('0x47')],['id',_0xb1be('0x51'),'updatedAt']);return db[_0xb1be('0x3f')][_0xb1be('0x46')](_[_0xb1be('0x44')](_0xce9df7,_0x196eb0[_0xb1be('0x47')]),{'include':_0x196eb0[_0xb1be('0x31')][_0xb1be('0x40')]?[{'all':!![]}]:undefined})[_0xb1be('0x21')](function(_0x43ddc5){var _0x21edbe=_0x196eb0[_0xb1be('0x48')][_0xb1be('0x22')]({'plain':!![]});if(!_0x21edbe)throw new Error(_0xb1be('0x49'));if(_0x21edbe[_0xb1be('0x4a')]==='user'){var _0x393977=_0x43ddc5['get']({'plain':!![]});var _0x3fce0f=_0xb1be('0x23');return db[_0xb1be('0x4b')][_0xb1be('0x45')]({'where':{'name':_0x3fce0f,'userProfileId':_0x21edbe['userProfileId']},'raw':!![]})['then'](function(_0x48d91d){if(_0x48d91d&&_0x48d91d[_0xb1be('0x4d')]===0x0){return db[_0xb1be('0x24')][_0xb1be('0x46')]({'name':_0x393977[_0xb1be('0x28')],'resourceId':_0x393977['id'],'type':_0x48d91d[_0xb1be('0x28')],'sectionId':_0x48d91d['id']},{})[_0xb1be('0x21')](function(){return _0x43ddc5;});}else{return _0x43ddc5;}})[_0xb1be('0x43')](function(_0x44341e){logger['error'](_0xb1be('0x4e'),_0x44341e);throw _0x44341e;});}return _0x43ddc5;});}})['then'](respondWithResult(_0x1f3531,0xc9))[_0xb1be('0x43')](handleError(_0x1f3531,null));};exports[_0xb1be('0x20')]=function(_0x189286,_0xc3316c){if(_0x189286[_0xb1be('0x47')]['id']){delete _0x189286[_0xb1be('0x47')]['id'];}return db[_0xb1be('0x3f')][_0xb1be('0x45')]({'where':{'id':_0x189286[_0xb1be('0x4f')]['id']}})[_0xb1be('0x21')](handleEntityNotFound(_0xc3316c,null))[_0xb1be('0x21')](saveUpdates(_0x189286[_0xb1be('0x47')],null))[_0xb1be('0x21')](respondWithResult(_0xc3316c,null))['catch'](handleError(_0xc3316c,null));};exports[_0xb1be('0x25')]=function(_0x3d4a1b,_0x18e7c5){return db['JscriptyProject'][_0xb1be('0x45')]({'where':{'id':_0x3d4a1b[_0xb1be('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18e7c5,null))['then'](removeEntity(_0x18e7c5,null))[_0xb1be('0x43')](handleError(_0x18e7c5,null));};exports['getSessions']=function(_0xbea274,_0x169fa7,_0x5e750a){var _0xc4202b={'raw':!![],'where':{}};var _0x585bff={};var _0x47e061={'count':0x0,'rows':[]};return db[_0xb1be('0x3f')][_0xb1be('0x52')]({'where':{'id':_0xbea274[_0xb1be('0x4f')]['id']}})[_0xb1be('0x21')](handleEntityNotFound(_0x169fa7,null))[_0xb1be('0x21')](function(_0x21e088){if(_0x21e088){_0x585bff['model']=_[_0xb1be('0x30')](db[_0xb1be('0x53')][_0xb1be('0x2c')]);_0x585bff[_0xb1be('0x31')]=_[_0xb1be('0x30')](_0xbea274[_0xb1be('0x31')]);_0x585bff[_0xb1be('0x3b')]=_[_0xb1be('0x32')](_0x585bff[_0xb1be('0x33')],_0x585bff[_0xb1be('0x31')]);_0xc4202b[_0xb1be('0x35')]=_['intersection'](_0x585bff['model'],qs[_0xb1be('0x34')](_0xbea274[_0xb1be('0x31')]['fields']));_0xc4202b[_0xb1be('0x35')]=_0xc4202b[_0xb1be('0x35')][_0xb1be('0x36')]?_0xc4202b[_0xb1be('0x35')]:_0x585bff[_0xb1be('0x33')];if(!_0xbea274[_0xb1be('0x31')][_0xb1be('0x37')](_0xb1be('0x38'))){_0xc4202b[_0xb1be('0x1d')]=qs[_0xb1be('0x1d')](_0xbea274[_0xb1be('0x31')][_0xb1be('0x1d')]);_0xc4202b['offset']=qs['offset'](_0xbea274[_0xb1be('0x31')][_0xb1be('0x1a')]);}_0xc4202b[_0xb1be('0x54')]=qs[_0xb1be('0x39')](_0xbea274[_0xb1be('0x31')][_0xb1be('0x39')]);_0xc4202b['where']=qs['filters'](_['pick'](_0xbea274['query'],_0x585bff[_0xb1be('0x3b')]));_0xc4202b[_0xb1be('0x3a')][_0xb1be('0x55')]=_0x21e088['id'];if(_0xbea274['query'][_0xb1be('0x3c')]){_0xc4202b['where']=_[_0xb1be('0x44')](_0xc4202b[_0xb1be('0x3a')],{'$or':_[_0xb1be('0x2b')](_0xc4202b[_0xb1be('0x35')],function(_0x1b3023){var _0x3315da={};_0x3315da[_0x1b3023]={'$like':'%'+_0xbea274[_0xb1be('0x31')][_0xb1be('0x3c')]+'%'};return _0x3315da;})});}_0xc4202b=_[_0xb1be('0x44')]({},_0xc4202b,_0xbea274[_0xb1be('0x3e')]);return db['JscriptySessionReport'][_0xb1be('0x1c')]({'where':_0xc4202b[_0xb1be('0x3a')]})['then'](function(_0x12d3b8){_0x47e061['count']=_0x12d3b8;if(_0xbea274[_0xb1be('0x31')][_0xb1be('0x40')]){_0xc4202b[_0xb1be('0x41')]=[{'all':!![]}];}return db[_0xb1be('0x53')][_0xb1be('0x56')](_0xc4202b);})[_0xb1be('0x21')](function(_0x59afc2){_0x47e061[_0xb1be('0x42')]=_0x59afc2;return _0x47e061;});}})[_0xb1be('0x21')](respondWithFilteredResult(_0x169fa7,_0xc4202b))[_0xb1be('0x43')](handleError(_0x169fa7,null));};exports['getAnswers']=function(_0xd9ff0a,_0x5a91bb,_0x5e1a89){var _0x137c24={'raw':!![],'where':{}};var _0x527237={};var _0x1657a6={'count':0x0,'rows':[]};return db[_0xb1be('0x3f')][_0xb1be('0x52')]({'where':{'id':_0xd9ff0a[_0xb1be('0x4f')]['id']}})[_0xb1be('0x21')](handleEntityNotFound(_0x5a91bb,null))[_0xb1be('0x21')](function(_0x1f0d48){if(_0x1f0d48){_0x527237['model']=_[_0xb1be('0x30')](db[_0xb1be('0x57')]['rawAttributes']);_0x527237[_0xb1be('0x31')]=_[_0xb1be('0x30')](_0xd9ff0a[_0xb1be('0x31')]);_0x527237[_0xb1be('0x3b')]=_[_0xb1be('0x32')](_0x527237[_0xb1be('0x33')],_0x527237[_0xb1be('0x31')]);_0x137c24['attributes']=_['intersection'](_0x527237['model'],qs[_0xb1be('0x34')](_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x34')]));_0x137c24['attributes']=_0x137c24[_0xb1be('0x35')][_0xb1be('0x36')]?_0x137c24[_0xb1be('0x35')]:_0x527237[_0xb1be('0x33')];if(!_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x37')](_0xb1be('0x38'))){_0x137c24[_0xb1be('0x1d')]=qs['limit'](_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x1d')]);_0x137c24[_0xb1be('0x1a')]=qs[_0xb1be('0x1a')](_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x1a')]);}_0x137c24[_0xb1be('0x54')]=qs[_0xb1be('0x39')](_0xd9ff0a[_0xb1be('0x31')]['sort']);_0x137c24[_0xb1be('0x3a')]=qs[_0xb1be('0x3b')](_[_0xb1be('0x58')](_0xd9ff0a[_0xb1be('0x31')],_0x527237[_0xb1be('0x3b')]));_0x137c24[_0xb1be('0x3a')]['ProjectId']=_0x1f0d48['id'];if(_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x3c')]){_0x137c24[_0xb1be('0x3a')]=_[_0xb1be('0x44')](_0x137c24[_0xb1be('0x3a')],{'$or':_[_0xb1be('0x2b')](_0x137c24[_0xb1be('0x35')],function(_0x4351eb){var _0x10d65b={};_0x10d65b[_0x4351eb]={'$like':'%'+_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x3c')]+'%'};return _0x10d65b;})});}_0x137c24=_['merge']({},_0x137c24,_0xd9ff0a[_0xb1be('0x3e')]);return db[_0xb1be('0x57')]['count']({'where':_0x137c24[_0xb1be('0x3a')]})[_0xb1be('0x21')](function(_0x3d6816){_0x1657a6[_0xb1be('0x1c')]=_0x3d6816;if(_0xd9ff0a[_0xb1be('0x31')][_0xb1be('0x40')]){_0x137c24['include']=[{'all':!![]}];}return db[_0xb1be('0x57')][_0xb1be('0x56')](_0x137c24);})[_0xb1be('0x21')](function(_0x5dd376){_0x1657a6[_0xb1be('0x42')]=_0x5dd376;return _0x1657a6;});}})[_0xb1be('0x21')](respondWithFilteredResult(_0x5a91bb,_0x137c24))[_0xb1be('0x43')](handleError(_0x5a91bb,null));};function char(_0x25e703){return _0xb1be('0x59')===typeof _0x25e703?String[_0xb1be('0x5a')][_0xb1be('0x5b')](null,arguments):_0x25e703;}function needsEncapsulation(_0x44d184){return!!_0x44d184&&(_0x44d184[_0xb1be('0x5c')]()[_0xb1be('0x5d')](char(0xd))>=0x0||_0x44d184[_0xb1be('0x5c')]()['indexOf'](char(0xa))>=0x0||_0x44d184[_0xb1be('0x5c')]()[_0xb1be('0x5d')](char(0x2c))>=0x0||_0x44d184['toString']()[_0xb1be('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4a7ad9){var _0x2fb7d6=char(0x22),_0x578ae8='\x5c'+char(0x22),_0x32ac9e=_0x4a7ad9[_0xb1be('0x5c')]()[_0xb1be('0x5e')](new RegExp(_0x2fb7d6,'g'),_0x578ae8);return _0x2fb7d6+_0x32ac9e+_0x2fb7d6;}exports[_0xb1be('0x5f')]=function(_0x4231cb,_0x44edae,_0x1ac1e6){var _0xe75b2c,_0x1184bc;var _0x45a26f={'where':{'ProjectId':_0x4231cb['params']['id']}};if(_0x4231cb[_0xb1be('0x31')][_0xb1be('0x60')]){_0x45a26f[_0xb1be('0x3a')][_0xb1be('0x61')]=JSON[_0xb1be('0x62')](_0x4231cb[_0xb1be('0x31')][_0xb1be('0x60')]);}return db['JscriptySessionReport'][_0xb1be('0x56')](_0x45a26f)[_0xb1be('0x21')](handleEntityNotFound(_0x44edae,null))[_0xb1be('0x21')](function(_0x257324){if(_0x257324){_0xe75b2c=_0x257324;return db[_0xb1be('0x63')][_0xb1be('0x56')]({'where':{'SessionId':{'$in':_[_0xb1be('0x2b')](_0xe75b2c,'id')},'ProjectId':_0x4231cb['params']['id']},'order':_0xb1be('0x64')});}})[_0xb1be('0x21')](handleEntityNotFound(_0x44edae,null))[_0xb1be('0x21')](function(_0x51c4c3){if(_0x51c4c3){_0x1184bc=_0x51c4c3;var _0x1ecdbc={};for(var _0x4939c4=0x0,_0x3ae879=_0x1184bc['length'];_0x4939c4<_0x3ae879;_0x4939c4++){if(!_0x1ecdbc[_0xb1be('0x37')](_0x1184bc[_0x4939c4][_0xb1be('0x65')])){_0x1ecdbc[_0x1184bc[_0x4939c4][_0xb1be('0x65')]]=needsEncapsulation(_0x1184bc[_0x4939c4]['question'])?encapsulate(_0x1184bc[_0x4939c4][_0xb1be('0x66')]):_0x1184bc[_0x4939c4][_0xb1be('0x66')];}}var _0x4684fe=[],_0x1ae3c0={};for(var _0x483102=0x0,_0x5b1f65=_0xe75b2c['length'];_0x483102<_0x5b1f65;_0x483102++){_0x1ae3c0={'ProjectId':_0x4231cb[_0xb1be('0x4f')]['id'],'SessionId':_0xe75b2c[_0x483102]['id'],'StartTime':moment(_0xe75b2c[_0x483102][_0xb1be('0x61')])[_0xb1be('0x67')](_0xb1be('0x68'))};for(var _0xec5743=0x0,_0x17c726=_0x1184bc[_0xb1be('0x36')];_0xec5743<_0x17c726;_0xec5743++){if(_0x1184bc[_0xec5743][_0xb1be('0x69')]==_0xe75b2c[_0x483102]['id']&&_0x1ecdbc[_0xb1be('0x37')](_0x1184bc[_0xec5743]['questionId'])){_0x1ae3c0[_0x1ecdbc[_0x1184bc[_0xec5743][_0xb1be('0x65')]]]=_0x1184bc[_0xec5743]['answer'];}}for(var _0x2d1b38 in _0x1ecdbc){if(!_0x1ae3c0[_0xb1be('0x37')](_0x1ecdbc[_0x2d1b38])){_0x1ae3c0[_0x1ecdbc[_0x2d1b38]]=null;}}_0x4684fe[_0xb1be('0x6a')](_0x1ae3c0);}return _0x4684fe;}})[_0xb1be('0x21')](function(_0x49b35f){if(!_[_0xb1be('0x6b')](_0x49b35f)){var _0x50ded8=toCsv(_0x49b35f);var _0x4eedde=Date[_0xb1be('0x6c')]();fs[_0xb1be('0x6d')](util['format'](_0xb1be('0x6e'),_0x4231cb[_0xb1be('0x4f')]['id'],_0x4eedde),_0x50ded8);_0x44edae[_0xb1be('0x6f')](_0xb1be('0x70'),_0xb1be('0x71')+util[_0xb1be('0x67')](_0xb1be('0x72'),_0x4231cb[_0xb1be('0x4f')]['id'],_0x4eedde));_0x44edae[_0xb1be('0x6f')](_0xb1be('0x73'),'text/csv');return _0x44edae['download'](util[_0xb1be('0x67')](_0xb1be('0x6e'),_0x4231cb[_0xb1be('0x4f')]['id'],_0x4eedde));}else{return _0x44edae['sendStatus'](0xcc);}})[_0xb1be('0x43')](handleError(_0x44edae,null));}; \ No newline at end of file +var _0xb50d=['writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','status','error','name','send','map','JscriptyProject','rawAttributes','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','length','includeAll','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','role','Projects','userProfileId','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now'];(function(_0x183b0d,_0x42fdad){var _0x5e536c=function(_0x3c5aa2){while(--_0x3c5aa2){_0x183b0d['push'](_0x183b0d['shift']());}};_0x5e536c(++_0x42fdad);}(_0xb50d,0xf5));var _0xdb50=function(_0x2f2009,_0x307372){_0x2f2009=_0x2f2009-0x0;var _0x31890a=_0xb50d[_0x2f2009];return _0x31890a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdb50('0x0'));var jsonpatch=require(_0xdb50('0x1'));var rp=require('request-promise');var moment=require(_0xdb50('0x2'));var BPromise=require(_0xdb50('0x3'));var Mustache=require(_0xdb50('0x4'));var util=require(_0xdb50('0x5'));var path=require(_0xdb50('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb50('0x7'));var fs=require('fs');var fs_extra=require(_0xdb50('0x8'));var _=require(_0xdb50('0x9'));var squel=require(_0xdb50('0xa'));var crypto=require(_0xdb50('0xb'));var jsforce=require(_0xdb50('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdb50('0xd'));var querystring=require(_0xdb50('0xe'));var Papa=require(_0xdb50('0xf'));var Redis=require(_0xdb50('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdb50('0x11'));var as=require(_0xdb50('0x12'));var hardwareService=require(_0xdb50('0x13'));var logger=require(_0xdb50('0x14'))(_0xdb50('0x15'));var utils=require(_0xdb50('0x16'));var config=require(_0xdb50('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb50('0x18'))['db'];function respondWithStatusCode(_0x596a55,_0x3ebb35){_0x3ebb35=_0x3ebb35||0xcc;return function(_0x1562a4){if(_0x1562a4){return _0x596a55[_0xdb50('0x19')](_0x3ebb35);}return _0x596a55['status'](_0x3ebb35)[_0xdb50('0x1a')]();};}function respondWithResult(_0x16d3df,_0x300721){_0x300721=_0x300721||0xc8;return function(_0x36255b){if(_0x36255b){return _0x16d3df['status'](_0x300721)[_0xdb50('0x1b')](_0x36255b);}};}function respondWithFilteredResult(_0x1208d2,_0x121994){return function(_0x36309f){if(_0x36309f){var _0x39c721=typeof _0x121994[_0xdb50('0x1c')]==='undefined'&&typeof _0x121994[_0xdb50('0x1d')]===_0xdb50('0x1e');var _0x4cb978=_0x36309f['count'];var _0x44cab0=_0x39c721?0x0:_0x121994[_0xdb50('0x1c')];var _0x4498cc=_0x39c721?_0x36309f[_0xdb50('0x1f')]:_0x121994['offset']+_0x121994['limit'];var _0x66a8b9;if(_0x4498cc>=_0x4cb978){_0x4498cc=_0x4cb978;_0x66a8b9=0xc8;}else{_0x66a8b9=0xce;}_0x1208d2['status'](_0x66a8b9);return _0x1208d2[_0xdb50('0x20')](_0xdb50('0x21'),_0x44cab0+'-'+_0x4498cc+'/'+_0x4cb978)['json'](_0x36309f);}return null;};}function patchUpdates(_0xfe3b37){return function(_0x959138){try{jsonpatch[_0xdb50('0x22')](_0x959138,_0xfe3b37,!![]);}catch(_0x1f46f7){return BPromise[_0xdb50('0x23')](_0x1f46f7);}return _0x959138['save']();};}function saveUpdates(_0x7fe381,_0x32d012){return function(_0x3abfc2){if(_0x3abfc2){return _0x3abfc2[_0xdb50('0x24')](_0x7fe381)[_0xdb50('0x25')](function(_0x1c1b1d){return _0x1c1b1d;});}return null;};}function removeEntity(_0x1c0e9a,_0x5afc0a){return function(_0x46e4a3){if(_0x46e4a3){return _0x46e4a3[_0xdb50('0x26')]()[_0xdb50('0x25')](function(){var _0x319802=_0x46e4a3[_0xdb50('0x27')]({'plain':!![]});var _0x54dd8a='Projects';return db[_0xdb50('0x28')][_0xdb50('0x26')]({'where':{'type':_0x54dd8a,'resourceId':_0x319802['id']}})[_0xdb50('0x25')](function(){return _0x46e4a3;});})[_0xdb50('0x25')](function(){_0x1c0e9a[_0xdb50('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2320ca,_0x1bb3ef){return function(_0x1e6b00){if(!_0x1e6b00){_0x2320ca[_0xdb50('0x19')](0x194);}return _0x1e6b00;};}function handleError(_0x3fe065,_0x10fa54){_0x10fa54=_0x10fa54||0x1f4;return function(_0x21bb49){logger[_0xdb50('0x2a')](_0x21bb49['stack']);if(_0x21bb49['name']){delete _0x21bb49[_0xdb50('0x2b')];}_0x3fe065['status'](_0x10fa54)[_0xdb50('0x2c')](_0x21bb49);};}exports['index']=function(_0x33dfe4,_0x52ed49){var _0x2616f6={},_0x5b2d5e={},_0x408b0b={'count':0x0,'rows':[]};var _0x40f9e7=_[_0xdb50('0x2d')](db[_0xdb50('0x2e')][_0xdb50('0x2f')],function(_0xb28adb){return{'name':_0xb28adb['fieldName'],'type':_0xb28adb['type'][_0xdb50('0x30')]};});_0x5b2d5e['model']=_[_0xdb50('0x2d')](_0x40f9e7,'name');_0x5b2d5e[_0xdb50('0x31')]=_['keys'](_0x33dfe4[_0xdb50('0x31')]);_0x5b2d5e['filters']=_[_0xdb50('0x32')](_0x5b2d5e[_0xdb50('0x33')],_0x5b2d5e[_0xdb50('0x31')]);_0x2616f6[_0xdb50('0x34')]=_[_0xdb50('0x32')](_0x5b2d5e[_0xdb50('0x33')],qs['fields'](_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x35')]));_0x2616f6[_0xdb50('0x34')]=_0x2616f6['attributes']['length']?_0x2616f6[_0xdb50('0x34')]:_0x5b2d5e[_0xdb50('0x33')];if(!_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x36')](_0xdb50('0x37'))){_0x2616f6[_0xdb50('0x1d')]=qs[_0xdb50('0x1d')](_0x33dfe4['query'][_0xdb50('0x1d')]);_0x2616f6[_0xdb50('0x1c')]=qs[_0xdb50('0x1c')](_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x1c')]);}_0x2616f6[_0xdb50('0x38')]=qs['sort'](_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x39')]);_0x2616f6[_0xdb50('0x3a')]=qs[_0xdb50('0x3b')](_[_0xdb50('0x3c')](_0x33dfe4[_0xdb50('0x31')],_0x5b2d5e[_0xdb50('0x3b')]),_0x40f9e7);if(_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x3d')]){_0x2616f6['where']=_['merge'](_0x2616f6[_0xdb50('0x3a')],{'$or':_[_0xdb50('0x2d')](_0x40f9e7,function(_0x2ce25f){if(_0x2ce25f[_0xdb50('0x3e')]!==_0xdb50('0x3f')){var _0x52ec13={};_0x52ec13[_0x2ce25f[_0xdb50('0x2b')]]={'$like':'%'+_0x33dfe4[_0xdb50('0x31')][_0xdb50('0x3d')]+'%'};return _0x52ec13;}})});}_0x2616f6=_[_0xdb50('0x40')]({},_0x2616f6,_0x33dfe4['options']);var _0x54f5c2={'where':_0x2616f6[_0xdb50('0x3a')]};return db[_0xdb50('0x2e')][_0xdb50('0x1f')](_0x54f5c2)[_0xdb50('0x25')](function(_0x6a3e8c){_0x408b0b[_0xdb50('0x1f')]=_0x6a3e8c;if(_0x33dfe4['query']['includeAll']){_0x2616f6[_0xdb50('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0xdb50('0x42')](_0x2616f6);})['then'](function(_0xe15bd8){_0x408b0b[_0xdb50('0x43')]=_0xe15bd8;return _0x408b0b;})['then'](respondWithFilteredResult(_0x52ed49,_0x2616f6))[_0xdb50('0x44')](handleError(_0x52ed49,null));};exports[_0xdb50('0x45')]=function(_0x3e95b0,_0x4436b3){var _0x36775a={'raw':![],'where':{'id':_0x3e95b0[_0xdb50('0x46')]['id']}},_0x2b434b={};_0x2b434b[_0xdb50('0x33')]=_['keys'](db[_0xdb50('0x2e')]['rawAttributes']);_0x2b434b[_0xdb50('0x31')]=_[_0xdb50('0x47')](_0x3e95b0[_0xdb50('0x31')]);_0x2b434b['filters']=_[_0xdb50('0x32')](_0x2b434b[_0xdb50('0x33')],_0x2b434b[_0xdb50('0x31')]);_0x36775a['attributes']=_['intersection'](_0x2b434b[_0xdb50('0x33')],qs[_0xdb50('0x35')](_0x3e95b0[_0xdb50('0x31')][_0xdb50('0x35')]));_0x36775a[_0xdb50('0x34')]=_0x36775a[_0xdb50('0x34')][_0xdb50('0x48')]?_0x36775a[_0xdb50('0x34')]:_0x2b434b[_0xdb50('0x33')];if(_0x3e95b0['query'][_0xdb50('0x49')]){_0x36775a[_0xdb50('0x41')]=[{'all':!![]}];}_0x36775a=_['merge']({},_0x36775a,_0x3e95b0[_0xdb50('0x4a')]);return db[_0xdb50('0x2e')]['find'](_0x36775a)[_0xdb50('0x25')](handleEntityNotFound(_0x4436b3,null))[_0xdb50('0x25')](respondWithResult(_0x4436b3,null))[_0xdb50('0x44')](handleError(_0x4436b3,null));};exports['create']=function(_0x21ae7f,_0x5701b6){return db['JscriptyProject']['create'](_0x21ae7f['body'],{})[_0xdb50('0x25')](function(_0x526439){var _0x2b01ec=_0x21ae7f[_0xdb50('0x4b')]['get']({'plain':!![]});if(!_0x2b01ec)throw new Error(_0xdb50('0x4c'));if(_0x2b01ec['role']==='user'){var _0x5b1cda=_0x526439[_0xdb50('0x27')]({'plain':!![]});var _0x456882='Projects';return db['UserProfileSection'][_0xdb50('0x4d')]({'where':{'name':_0x456882,'userProfileId':_0x2b01ec['userProfileId']},'raw':!![]})[_0xdb50('0x25')](function(_0x3f3a52){if(_0x3f3a52&&_0x3f3a52[_0xdb50('0x4e')]===0x0){return db[_0xdb50('0x28')][_0xdb50('0x4f')]({'name':_0x5b1cda['name'],'resourceId':_0x5b1cda['id'],'type':_0x3f3a52['name'],'sectionId':_0x3f3a52['id']},{})[_0xdb50('0x25')](function(){return _0x526439;});}else{return _0x526439;}})[_0xdb50('0x44')](function(_0x319f40){logger['error'](_0xdb50('0x50'),_0x319f40);throw _0x319f40;});}return _0x526439;})[_0xdb50('0x25')](respondWithResult(_0x5701b6,0xc9))[_0xdb50('0x44')](handleError(_0x5701b6,null));};exports['clone']=function(_0x20890f,_0x10ee54){var _0x3d3d17={'where':{'id':_0x20890f[_0xdb50('0x46')]['id']}},_0x29279b={};_0x29279b['model']=_[_0xdb50('0x47')](db['JscriptyProject'][_0xdb50('0x2f')]);_0x3d3d17[_0xdb50('0x34')]=_['intersection'](_0x29279b[_0xdb50('0x33')],qs[_0xdb50('0x35')](_0x20890f['query'][_0xdb50('0x35')]));_0x3d3d17[_0xdb50('0x34')]=_0x3d3d17[_0xdb50('0x34')][_0xdb50('0x48')]?_0x3d3d17['attributes']:_0x29279b[_0xdb50('0x33')];if(_0x20890f[_0xdb50('0x31')]['includeAll']){_0x3d3d17[_0xdb50('0x41')]=[{'all':!![]}];}_0x3d3d17=_[_0xdb50('0x40')]({},_0x3d3d17,_0x20890f[_0xdb50('0x4a')]);return db['JscriptyProject'][_0xdb50('0x4d')](_0x3d3d17)[_0xdb50('0x25')](handleEntityNotFound(_0x10ee54,null))[_0xdb50('0x25')](function(_0x3b0bbc){if(_0x3b0bbc){var _0x3630eb=_0x3b0bbc[_0xdb50('0x27')]({'plain':!![]});_0x3630eb=qs[_0xdb50('0x51')](_0x3630eb,['id','createdAt',_0xdb50('0x52')]);_0x20890f[_0xdb50('0x53')]=_[_0xdb50('0x51')](_0x20890f[_0xdb50('0x53')],['id','createdAt',_0xdb50('0x52')]);return db[_0xdb50('0x2e')][_0xdb50('0x4f')](_[_0xdb50('0x40')](_0x3630eb,_0x20890f[_0xdb50('0x53')]),{'include':_0x20890f[_0xdb50('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x549a1e){var _0x5eab00=_0x20890f[_0xdb50('0x4b')][_0xdb50('0x27')]({'plain':!![]});if(!_0x5eab00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5eab00[_0xdb50('0x54')]===_0xdb50('0x4b')){var _0x60af71=_0x549a1e['get']({'plain':!![]});var _0x5d573b=_0xdb50('0x55');return db['UserProfileSection'][_0xdb50('0x4d')]({'where':{'name':_0x5d573b,'userProfileId':_0x5eab00[_0xdb50('0x56')]},'raw':!![]})[_0xdb50('0x25')](function(_0x4f16d6){if(_0x4f16d6&&_0x4f16d6[_0xdb50('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x60af71['name'],'resourceId':_0x60af71['id'],'type':_0x4f16d6[_0xdb50('0x2b')],'sectionId':_0x4f16d6['id']},{})['then'](function(){return _0x549a1e;});}else{return _0x549a1e;}})[_0xdb50('0x44')](function(_0x2e01cd){logger[_0xdb50('0x2a')](_0xdb50('0x50'),_0x2e01cd);throw _0x2e01cd;});}return _0x549a1e;});}})[_0xdb50('0x25')](respondWithResult(_0x10ee54,0xc9))[_0xdb50('0x44')](handleError(_0x10ee54,null));};exports[_0xdb50('0x24')]=function(_0x43c883,_0x1dc26e){if(_0x43c883['body']['id']){delete _0x43c883[_0xdb50('0x53')]['id'];}return db['JscriptyProject'][_0xdb50('0x4d')]({'where':{'id':_0x43c883[_0xdb50('0x46')]['id']}})[_0xdb50('0x25')](handleEntityNotFound(_0x1dc26e,null))[_0xdb50('0x25')](saveUpdates(_0x43c883[_0xdb50('0x53')],null))[_0xdb50('0x25')](respondWithResult(_0x1dc26e,null))[_0xdb50('0x44')](handleError(_0x1dc26e,null));};exports[_0xdb50('0x26')]=function(_0x25abc3,_0x4a0b1b){return db['JscriptyProject'][_0xdb50('0x4d')]({'where':{'id':_0x25abc3[_0xdb50('0x46')]['id']}})[_0xdb50('0x25')](handleEntityNotFound(_0x4a0b1b,null))[_0xdb50('0x25')](removeEntity(_0x4a0b1b,null))[_0xdb50('0x44')](handleError(_0x4a0b1b,null));};exports['getSessions']=function(_0x18df7a,_0x13821d,_0x39565d){var _0x4c1b0d={'raw':!![],'where':{}};var _0x333e6e={};var _0x582f73={'count':0x0,'rows':[]};return db[_0xdb50('0x2e')][_0xdb50('0x57')]({'where':{'id':_0x18df7a[_0xdb50('0x46')]['id']}})[_0xdb50('0x25')](handleEntityNotFound(_0x13821d,null))[_0xdb50('0x25')](function(_0x4a5d77){if(_0x4a5d77){_0x333e6e[_0xdb50('0x33')]=_['keys'](db[_0xdb50('0x58')][_0xdb50('0x2f')]);_0x333e6e['query']=_[_0xdb50('0x47')](_0x18df7a[_0xdb50('0x31')]);_0x333e6e[_0xdb50('0x3b')]=_['intersection'](_0x333e6e[_0xdb50('0x33')],_0x333e6e[_0xdb50('0x31')]);_0x4c1b0d[_0xdb50('0x34')]=_[_0xdb50('0x32')](_0x333e6e[_0xdb50('0x33')],qs[_0xdb50('0x35')](_0x18df7a['query'][_0xdb50('0x35')]));_0x4c1b0d[_0xdb50('0x34')]=_0x4c1b0d[_0xdb50('0x34')]['length']?_0x4c1b0d['attributes']:_0x333e6e[_0xdb50('0x33')];if(!_0x18df7a[_0xdb50('0x31')][_0xdb50('0x36')]('nolimit')){_0x4c1b0d['limit']=qs[_0xdb50('0x1d')](_0x18df7a['query']['limit']);_0x4c1b0d['offset']=qs[_0xdb50('0x1c')](_0x18df7a[_0xdb50('0x31')][_0xdb50('0x1c')]);}_0x4c1b0d[_0xdb50('0x38')]=qs['sort'](_0x18df7a[_0xdb50('0x31')][_0xdb50('0x39')]);_0x4c1b0d['where']=qs[_0xdb50('0x3b')](_['pick'](_0x18df7a[_0xdb50('0x31')],_0x333e6e['filters']));_0x4c1b0d[_0xdb50('0x3a')][_0xdb50('0x59')]=_0x4a5d77['id'];if(_0x18df7a[_0xdb50('0x31')][_0xdb50('0x3d')]){_0x4c1b0d[_0xdb50('0x3a')]=_[_0xdb50('0x40')](_0x4c1b0d[_0xdb50('0x3a')],{'$or':_[_0xdb50('0x2d')](_0x4c1b0d[_0xdb50('0x34')],function(_0x223328){var _0x3d8c20={};_0x3d8c20[_0x223328]={'$like':'%'+_0x18df7a[_0xdb50('0x31')]['filter']+'%'};return _0x3d8c20;})});}_0x4c1b0d=_[_0xdb50('0x40')]({},_0x4c1b0d,_0x18df7a[_0xdb50('0x4a')]);return db[_0xdb50('0x58')][_0xdb50('0x1f')]({'where':_0x4c1b0d['where']})[_0xdb50('0x25')](function(_0x75cc7b){_0x582f73[_0xdb50('0x1f')]=_0x75cc7b;if(_0x18df7a[_0xdb50('0x31')][_0xdb50('0x49')]){_0x4c1b0d[_0xdb50('0x41')]=[{'all':!![]}];}return db[_0xdb50('0x58')][_0xdb50('0x42')](_0x4c1b0d);})[_0xdb50('0x25')](function(_0x11d975){_0x582f73[_0xdb50('0x43')]=_0x11d975;return _0x582f73;});}})['then'](respondWithFilteredResult(_0x13821d,_0x4c1b0d))[_0xdb50('0x44')](handleError(_0x13821d,null));};exports[_0xdb50('0x5a')]=function(_0x19d951,_0x162c1b,_0xc92351){var _0x3adfd8={'raw':!![],'where':{}};var _0x39e0b7={};var _0x221706={'count':0x0,'rows':[]};return db[_0xdb50('0x2e')]['findOne']({'where':{'id':_0x19d951[_0xdb50('0x46')]['id']}})['then'](handleEntityNotFound(_0x162c1b,null))['then'](function(_0xab1260){if(_0xab1260){_0x39e0b7[_0xdb50('0x33')]=_[_0xdb50('0x47')](db['JscriptyAnswerReport'][_0xdb50('0x2f')]);_0x39e0b7[_0xdb50('0x31')]=_[_0xdb50('0x47')](_0x19d951['query']);_0x39e0b7[_0xdb50('0x3b')]=_[_0xdb50('0x32')](_0x39e0b7[_0xdb50('0x33')],_0x39e0b7['query']);_0x3adfd8[_0xdb50('0x34')]=_[_0xdb50('0x32')](_0x39e0b7[_0xdb50('0x33')],qs[_0xdb50('0x35')](_0x19d951['query'][_0xdb50('0x35')]));_0x3adfd8[_0xdb50('0x34')]=_0x3adfd8[_0xdb50('0x34')][_0xdb50('0x48')]?_0x3adfd8[_0xdb50('0x34')]:_0x39e0b7[_0xdb50('0x33')];if(!_0x19d951[_0xdb50('0x31')][_0xdb50('0x36')](_0xdb50('0x37'))){_0x3adfd8[_0xdb50('0x1d')]=qs[_0xdb50('0x1d')](_0x19d951[_0xdb50('0x31')][_0xdb50('0x1d')]);_0x3adfd8[_0xdb50('0x1c')]=qs[_0xdb50('0x1c')](_0x19d951[_0xdb50('0x31')][_0xdb50('0x1c')]);}_0x3adfd8['order']=qs[_0xdb50('0x39')](_0x19d951[_0xdb50('0x31')][_0xdb50('0x39')]);_0x3adfd8[_0xdb50('0x3a')]=qs['filters'](_[_0xdb50('0x3c')](_0x19d951[_0xdb50('0x31')],_0x39e0b7[_0xdb50('0x3b')]));_0x3adfd8['where'][_0xdb50('0x59')]=_0xab1260['id'];if(_0x19d951[_0xdb50('0x31')][_0xdb50('0x3d')]){_0x3adfd8[_0xdb50('0x3a')]=_[_0xdb50('0x40')](_0x3adfd8[_0xdb50('0x3a')],{'$or':_[_0xdb50('0x2d')](_0x3adfd8[_0xdb50('0x34')],function(_0xb06a2e){var _0x5c2972={};_0x5c2972[_0xb06a2e]={'$like':'%'+_0x19d951[_0xdb50('0x31')]['filter']+'%'};return _0x5c2972;})});}_0x3adfd8=_[_0xdb50('0x40')]({},_0x3adfd8,_0x19d951['options']);return db['JscriptyAnswerReport'][_0xdb50('0x1f')]({'where':_0x3adfd8['where']})[_0xdb50('0x25')](function(_0x5384eb){_0x221706[_0xdb50('0x1f')]=_0x5384eb;if(_0x19d951['query']['includeAll']){_0x3adfd8[_0xdb50('0x41')]=[{'all':!![]}];}return db[_0xdb50('0x5b')][_0xdb50('0x42')](_0x3adfd8);})['then'](function(_0x23a031){_0x221706[_0xdb50('0x43')]=_0x23a031;return _0x221706;});}})[_0xdb50('0x25')](respondWithFilteredResult(_0x162c1b,_0x3adfd8))[_0xdb50('0x44')](handleError(_0x162c1b,null));};function char(_0x2aa4b6){return _0xdb50('0x5c')===typeof _0x2aa4b6?String[_0xdb50('0x5d')][_0xdb50('0x22')](null,arguments):_0x2aa4b6;}function needsEncapsulation(_0x5823f7){return!!_0x5823f7&&(_0x5823f7[_0xdb50('0x5e')]()[_0xdb50('0x5f')](char(0xd))>=0x0||_0x5823f7['toString']()[_0xdb50('0x5f')](char(0xa))>=0x0||_0x5823f7[_0xdb50('0x5e')]()[_0xdb50('0x5f')](char(0x2c))>=0x0||_0x5823f7['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x2c8b92){var _0x508f5d=char(0x22),_0x43ab6c='\x5c'+char(0x22),_0x505145=_0x2c8b92[_0xdb50('0x5e')]()['replace'](new RegExp(_0x508f5d,'g'),_0x43ab6c);return _0x508f5d+_0x505145+_0x508f5d;}exports[_0xdb50('0x60')]=function(_0x2dea11,_0x34ecba,_0x204df8){var _0x3bf3d3,_0x5ab02c;var _0x5ce8c4={'where':{'ProjectId':_0x2dea11['params']['id']}};if(_0x2dea11[_0xdb50('0x31')]['startTime']){_0x5ce8c4[_0xdb50('0x3a')][_0xdb50('0x61')]=JSON[_0xdb50('0x62')](_0x2dea11['query'][_0xdb50('0x63')]);}return db[_0xdb50('0x58')][_0xdb50('0x42')](_0x5ce8c4)['then'](handleEntityNotFound(_0x34ecba,null))[_0xdb50('0x25')](function(_0x1cf833){if(_0x1cf833){_0x3bf3d3=_0x1cf833;return db[_0xdb50('0x64')][_0xdb50('0x42')]({'where':{'SessionId':{'$in':_[_0xdb50('0x2d')](_0x3bf3d3,'id')},'ProjectId':_0x2dea11[_0xdb50('0x46')]['id']},'order':_0xdb50('0x65')});}})[_0xdb50('0x25')](handleEntityNotFound(_0x34ecba,null))['then'](function(_0x158a8f){if(_0x158a8f){_0x5ab02c=_0x158a8f;var _0x6d4d5b={};for(var _0x40f7aa=0x0,_0x6895b2=_0x5ab02c[_0xdb50('0x48')];_0x40f7aa<_0x6895b2;_0x40f7aa++){if(!_0x6d4d5b[_0xdb50('0x36')](_0x5ab02c[_0x40f7aa][_0xdb50('0x66')])){_0x6d4d5b[_0x5ab02c[_0x40f7aa][_0xdb50('0x66')]]=needsEncapsulation(_0x5ab02c[_0x40f7aa][_0xdb50('0x67')])?encapsulate(_0x5ab02c[_0x40f7aa]['question']):_0x5ab02c[_0x40f7aa][_0xdb50('0x67')];}}var _0x1932d0=[],_0xf8d127={};for(var _0x16168a=0x0,_0x436a35=_0x3bf3d3[_0xdb50('0x48')];_0x16168a<_0x436a35;_0x16168a++){_0xf8d127={'ProjectId':_0x2dea11['params']['id'],'SessionId':_0x3bf3d3[_0x16168a]['id'],'StartTime':moment(_0x3bf3d3[_0x16168a][_0xdb50('0x61')])[_0xdb50('0x68')](_0xdb50('0x69'))};for(var _0x3a6e39=0x0,_0xba03f8=_0x5ab02c[_0xdb50('0x48')];_0x3a6e39<_0xba03f8;_0x3a6e39++){if(_0x5ab02c[_0x3a6e39]['SessionId']==_0x3bf3d3[_0x16168a]['id']&&_0x6d4d5b[_0xdb50('0x36')](_0x5ab02c[_0x3a6e39][_0xdb50('0x66')])){_0xf8d127[_0x6d4d5b[_0x5ab02c[_0x3a6e39][_0xdb50('0x66')]]]=_0x5ab02c[_0x3a6e39]['answer'];}}for(var _0x46de79 in _0x6d4d5b){if(!_0xf8d127['hasOwnProperty'](_0x6d4d5b[_0x46de79])){_0xf8d127[_0x6d4d5b[_0x46de79]]=null;}}_0x1932d0[_0xdb50('0x6a')](_0xf8d127);}return _0x1932d0;}})['then'](function(_0x4181f2){if(!_[_0xdb50('0x6b')](_0x4181f2)){var _0x151633=toCsv(_0x4181f2);var _0x32c0de=Date[_0xdb50('0x6c')]();fs[_0xdb50('0x6d')](util[_0xdb50('0x68')](_0xdb50('0x6e'),_0x2dea11[_0xdb50('0x46')]['id'],_0x32c0de),_0x151633);_0x34ecba[_0xdb50('0x6f')](_0xdb50('0x70'),_0xdb50('0x71')+util['format'](_0xdb50('0x72'),_0x2dea11[_0xdb50('0x46')]['id'],_0x32c0de));_0x34ecba['setHeader'](_0xdb50('0x73'),_0xdb50('0x74'));return _0x34ecba[_0xdb50('0x75')](util[_0xdb50('0x68')](_0xdb50('0x6e'),_0x2dea11[_0xdb50('0x46')]['id'],_0x32c0de));}else{return _0x34ecba[_0xdb50('0x19')](0xcc);}})[_0xdb50('0x44')](handleError(_0x34ecba,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 8d3880d..3d0e226 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 _0xf185=['define','JscriptyProject','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x530865,_0x32f9a3){var _0x458a4f=function(_0x41b754){while(--_0x41b754){_0x530865['push'](_0x530865['shift']());}};_0x458a4f(++_0x32f9a3);}(_0xf185,0x1be));var _0x5f18=function(_0x3fe944,_0x5356e9){_0x3fe944=_0x3fe944-0x0;var _0x1bc66c=_0xf185[_0x3fe944];return _0x1bc66c;};'use strict';var _=require(_0x5f18('0x0'));var util=require('util');var logger=require(_0x5f18('0x1'))(_0x5f18('0x2'));var moment=require(_0x5f18('0x3'));var BPromise=require(_0x5f18('0x4'));var rp=require(_0x5f18('0x5'));var fs=require('fs');var path=require(_0x5f18('0x6'));var rimraf=require('rimraf');var config=require(_0x5f18('0x7'));var attributes=require(_0x5f18('0x8'));module[_0x5f18('0x9')]=function(_0x1cac08,_0x5b7cc5){return _0x1cac08[_0x5f18('0xa')](_0x5f18('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2975=['JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyProject.attributes','exports','define'];(function(_0x2ca44f,_0x187d2c){var _0x59a266=function(_0xd5a8b6){while(--_0xd5a8b6){_0x2ca44f['push'](_0x2ca44f['shift']());}};_0x59a266(++_0x187d2c);}(_0x2975,0x1c5));var _0x5297=function(_0x6dee22,_0x1595db){_0x6dee22=_0x6dee22-0x0;var _0x5e5e1a=_0x2975[_0x6dee22];return _0x5e5e1a;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'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 4867edb..27f925f 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x575993,_0x452ba8){var _0x4ddeda=function(_0x165e56){while(--_0x165e56){_0x575993['push'](_0x575993['shift']());}};_0x4ddeda(++_0x452ba8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0xed6ed0,_0x28e1ad){var _0x20a428=function(_0x5b2603){while(--_0x5b2603){_0xed6ed0['push'](_0xed6ed0['shift']());}};_0x20a428(++_0x28e1ad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6ff621d..ae92981 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 _0x9c4c=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1327f7,_0x574202){var _0xa7a00c=function(_0x4cfe0b){while(--_0x4cfe0b){_0x1327f7['push'](_0x1327f7['shift']());}};_0xa7a00c(++_0x574202);}(_0x9c4c,0xf6));var _0xc9c4=function(_0x2d45d7,_0x4a339a){_0x2d45d7=_0x2d45d7-0x0;var _0x576939=_0x9c4c[_0x2d45d7];return _0x576939;};'use strict';var multer=require('multer');var util=require(_0xc9c4('0x0'));var path=require(_0xc9c4('0x1'));var timeout=require(_0xc9c4('0x2'));var express=require(_0xc9c4('0x3'));var router=express[_0xc9c4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc9c4('0x5'));var config=require(_0xc9c4('0x6'));var controller=require(_0xc9c4('0x7'));router[_0xc9c4('0x8')]('/',auth[_0xc9c4('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc9c4('0xa'),auth[_0xc9c4('0x9')](),controller[_0xc9c4('0xb')]);router[_0xc9c4('0xc')]('/',auth[_0xc9c4('0x9')](),controller['create']);router[_0xc9c4('0xd')]('/:id',auth[_0xc9c4('0x9')](),controller[_0xc9c4('0xe')]);router[_0xc9c4('0xf')](_0xc9c4('0xa'),auth[_0xc9c4('0x9')](),controller[_0xc9c4('0x10')]);module[_0xc9c4('0x11')]=router; \ No newline at end of file +var _0x6f7d=['put','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post','create'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x6f7d,0x1a5));var _0xd6f7=function(_0x494ee1,_0x1f18e1){_0x494ee1=_0x494ee1-0x0;var _0x1e0057=_0x6f7d[_0x494ee1];return _0x1e0057;};'use strict';var multer=require(_0xd6f7('0x0'));var util=require(_0xd6f7('0x1'));var path=require(_0xd6f7('0x2'));var timeout=require(_0xd6f7('0x3'));var express=require(_0xd6f7('0x4'));var router=express['Router']();var fs_extra=require(_0xd6f7('0x5'));var auth=require(_0xd6f7('0x6'));var interaction=require(_0xd6f7('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0xd6f7('0x8')](),controller[_0xd6f7('0x9')]);router[_0xd6f7('0xa')](_0xd6f7('0xb'),auth[_0xd6f7('0x8')](),controller[_0xd6f7('0xc')]);router[_0xd6f7('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd6f7('0xd')]);router[_0xd6f7('0xe')]('/',auth[_0xd6f7('0x8')](),controller[_0xd6f7('0xf')]);router[_0xd6f7('0x10')](_0xd6f7('0x11'),auth[_0xd6f7('0x8')](),controller['update']);router['delete'](_0xd6f7('0x11'),auth['isAuthenticated'](),controller[_0xd6f7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 7615f31..f27a78c 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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef021,_0x25912d){_0x4ef021=_0x4ef021-0x0;var _0xb1c550=_0x7a54[_0x4ef021];return _0xb1c550;};'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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x592bf4,_0x3a93fd){_0x592bf4=_0x592bf4-0x0;var _0x16b516=_0x7a54[_0x592bf4];return _0x16b516;};'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 88c6a6b..cb37dbb 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 _0xcdd8=['filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','JscriptyQuestionReport','count','includeAll','include','catch','show','params','keys','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x225a57,_0x3e66d4){var _0x4ad8fd=function(_0x1ce840){while(--_0x1ce840){_0x225a57['push'](_0x225a57['shift']());}};_0x4ad8fd(++_0x3e66d4);}(_0xcdd8,0x69));var _0x8cdd=function(_0xa8e653,_0xb66e98){_0xa8e653=_0xa8e653-0x0;var _0x21f31a=_0xcdd8[_0xa8e653];return _0x21f31a;};'use strict';var emlformat=require(_0x8cdd('0x0'));var rimraf=require(_0x8cdd('0x1'));var zipdir=require(_0x8cdd('0x2'));var jsonpatch=require(_0x8cdd('0x3'));var rp=require('request-promise');var moment=require(_0x8cdd('0x4'));var BPromise=require(_0x8cdd('0x5'));var Mustache=require('mustache');var util=require(_0x8cdd('0x6'));var path=require(_0x8cdd('0x7'));var sox=require(_0x8cdd('0x8'));var csv=require(_0x8cdd('0x9'));var ejs=require(_0x8cdd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8cdd('0xb'));var crypto=require(_0x8cdd('0xc'));var jsforce=require(_0x8cdd('0xd'));var deskjs=require(_0x8cdd('0xe'));var toCsv=require(_0x8cdd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8cdd('0xf'));var qs=require(_0x8cdd('0x10'));var as=require(_0x8cdd('0x11'));var hardwareService=require(_0x8cdd('0x12'));var logger=require(_0x8cdd('0x13'))('api');var utils=require(_0x8cdd('0x14'));var config=require(_0x8cdd('0x15'));var licenseUtil=require(_0x8cdd('0x16'));var db=require(_0x8cdd('0x17'))['db'];function respondWithStatusCode(_0x595cb2,_0x2e7281){_0x2e7281=_0x2e7281||0xcc;return function(_0x347183){if(_0x347183){return _0x595cb2[_0x8cdd('0x18')](_0x2e7281);}return _0x595cb2[_0x8cdd('0x19')](_0x2e7281)[_0x8cdd('0x1a')]();};}function respondWithResult(_0x210528,_0x5aaff9){_0x5aaff9=_0x5aaff9||0xc8;return function(_0x7c2aab){if(_0x7c2aab){return _0x210528[_0x8cdd('0x19')](_0x5aaff9)['json'](_0x7c2aab);}};}function respondWithFilteredResult(_0x380516,_0x3ef80f){return function(_0x57dd07){if(_0x57dd07){var _0x629de6=typeof _0x3ef80f[_0x8cdd('0x1b')]===_0x8cdd('0x1c')&&typeof _0x3ef80f[_0x8cdd('0x1d')]==='undefined';var _0x5bead7=_0x57dd07['count'];var _0x2756a5=_0x629de6?0x0:_0x3ef80f['offset'];var _0x4fd630=_0x629de6?_0x57dd07['count']:_0x3ef80f[_0x8cdd('0x1b')]+_0x3ef80f[_0x8cdd('0x1d')];var _0x5b8970;if(_0x4fd630>=_0x5bead7){_0x4fd630=_0x5bead7;_0x5b8970=0xc8;}else{_0x5b8970=0xce;}_0x380516[_0x8cdd('0x19')](_0x5b8970);return _0x380516[_0x8cdd('0x1e')](_0x8cdd('0x1f'),_0x2756a5+'-'+_0x4fd630+'/'+_0x5bead7)['json'](_0x57dd07);}return null;};}function patchUpdates(_0x285db3){return function(_0x20629b){try{jsonpatch[_0x8cdd('0x20')](_0x20629b,_0x285db3,!![]);}catch(_0x3cfb25){return BPromise[_0x8cdd('0x21')](_0x3cfb25);}return _0x20629b['save']();};}function saveUpdates(_0x54ec35,_0x3496e0){return function(_0x5919c2){if(_0x5919c2){return _0x5919c2['update'](_0x54ec35)[_0x8cdd('0x22')](function(_0x2e451b){return _0x2e451b;});}return null;};}function removeEntity(_0x492010,_0x22c108){return function(_0x17613d){if(_0x17613d){return _0x17613d[_0x8cdd('0x23')]()[_0x8cdd('0x22')](function(){_0x492010['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40209e,_0x102e61){return function(_0x4abebd){if(!_0x4abebd){_0x40209e[_0x8cdd('0x18')](0x194);}return _0x4abebd;};}function handleError(_0x3cfcb5,_0x41e86c){_0x41e86c=_0x41e86c||0x1f4;return function(_0x3ee506){logger[_0x8cdd('0x24')](_0x3ee506[_0x8cdd('0x25')]);if(_0x3ee506[_0x8cdd('0x26')]){delete _0x3ee506[_0x8cdd('0x26')];}_0x3cfcb5['status'](_0x41e86c)[_0x8cdd('0x27')](_0x3ee506);};}exports[_0x8cdd('0x28')]=function(_0x2fbb92,_0x2fb3ec){var _0x177070={},_0x46c40a={},_0x20c8f6={'count':0x0,'rows':[]};var _0x43a4cc=_[_0x8cdd('0x29')](db['JscriptyQuestionReport'][_0x8cdd('0x2a')],function(_0x1d1d29){return{'name':_0x1d1d29[_0x8cdd('0x2b')],'type':_0x1d1d29[_0x8cdd('0x2c')][_0x8cdd('0x2d')]};});_0x46c40a[_0x8cdd('0x2e')]=_['map'](_0x43a4cc,_0x8cdd('0x26'));_0x46c40a['query']=_['keys'](_0x2fbb92['query']);_0x46c40a[_0x8cdd('0x2f')]=_[_0x8cdd('0x30')](_0x46c40a[_0x8cdd('0x2e')],_0x46c40a[_0x8cdd('0x31')]);_0x177070['attributes']=_[_0x8cdd('0x30')](_0x46c40a['model'],qs[_0x8cdd('0x32')](_0x2fbb92[_0x8cdd('0x31')][_0x8cdd('0x32')]));_0x177070['attributes']=_0x177070[_0x8cdd('0x33')][_0x8cdd('0x34')]?_0x177070[_0x8cdd('0x33')]:_0x46c40a[_0x8cdd('0x2e')];if(!_0x2fbb92['query'][_0x8cdd('0x35')](_0x8cdd('0x36'))){_0x177070[_0x8cdd('0x1d')]=qs[_0x8cdd('0x1d')](_0x2fbb92[_0x8cdd('0x31')]['limit']);_0x177070['offset']=qs[_0x8cdd('0x1b')](_0x2fbb92[_0x8cdd('0x31')]['offset']);}_0x177070[_0x8cdd('0x37')]=qs[_0x8cdd('0x38')](_0x2fbb92['query'][_0x8cdd('0x38')]);_0x177070['where']=qs['filters'](_[_0x8cdd('0x39')](_0x2fbb92[_0x8cdd('0x31')],_0x46c40a[_0x8cdd('0x2f')]),_0x43a4cc);if(_0x2fbb92['query'][_0x8cdd('0x3a')]){_0x177070['where']=_[_0x8cdd('0x3b')](_0x177070[_0x8cdd('0x3c')],{'$or':_[_0x8cdd('0x29')](_0x43a4cc,function(_0x4351af){if(_0x4351af['type']!==_0x8cdd('0x3d')){var _0x17e23f={};_0x17e23f[_0x4351af[_0x8cdd('0x26')]]={'$like':'%'+_0x2fbb92['query'][_0x8cdd('0x3a')]+'%'};return _0x17e23f;}})});}_0x177070=_['merge']({},_0x177070,_0x2fbb92[_0x8cdd('0x3e')]);var _0x154069={'where':_0x177070['where']};return db[_0x8cdd('0x3f')][_0x8cdd('0x40')](_0x154069)[_0x8cdd('0x22')](function(_0x1de4e6){_0x20c8f6['count']=_0x1de4e6;if(_0x2fbb92[_0x8cdd('0x31')][_0x8cdd('0x41')]){_0x177070[_0x8cdd('0x42')]=[{'all':!![]}];}return db[_0x8cdd('0x3f')]['findAll'](_0x177070);})[_0x8cdd('0x22')](function(_0x64d9ce){_0x20c8f6['rows']=_0x64d9ce;return _0x20c8f6;})[_0x8cdd('0x22')](respondWithFilteredResult(_0x2fb3ec,_0x177070))[_0x8cdd('0x43')](handleError(_0x2fb3ec,null));};exports[_0x8cdd('0x44')]=function(_0x357359,_0xd5aefe){var _0x2d3781={'raw':!![],'where':{'id':_0x357359[_0x8cdd('0x45')]['id']}},_0x23cdc4={};_0x23cdc4[_0x8cdd('0x2e')]=_[_0x8cdd('0x46')](db['JscriptyQuestionReport'][_0x8cdd('0x2a')]);_0x23cdc4[_0x8cdd('0x31')]=_[_0x8cdd('0x46')](_0x357359['query']);_0x23cdc4['filters']=_[_0x8cdd('0x30')](_0x23cdc4[_0x8cdd('0x2e')],_0x23cdc4[_0x8cdd('0x31')]);_0x2d3781['attributes']=_[_0x8cdd('0x30')](_0x23cdc4[_0x8cdd('0x2e')],qs[_0x8cdd('0x32')](_0x357359[_0x8cdd('0x31')][_0x8cdd('0x32')]));_0x2d3781[_0x8cdd('0x33')]=_0x2d3781[_0x8cdd('0x33')]['length']?_0x2d3781['attributes']:_0x23cdc4[_0x8cdd('0x2e')];if(_0x357359[_0x8cdd('0x31')][_0x8cdd('0x41')]){_0x2d3781[_0x8cdd('0x42')]=[{'all':!![]}];}_0x2d3781=_[_0x8cdd('0x3b')]({},_0x2d3781,_0x357359[_0x8cdd('0x3e')]);return db[_0x8cdd('0x3f')][_0x8cdd('0x47')](_0x2d3781)[_0x8cdd('0x22')](handleEntityNotFound(_0xd5aefe,null))['then'](respondWithResult(_0xd5aefe,null))[_0x8cdd('0x43')](handleError(_0xd5aefe,null));};exports[_0x8cdd('0x48')]=function(_0x11bda5,_0x5e611b){return db[_0x8cdd('0x3f')][_0x8cdd('0x48')](_0x11bda5['body'],{})['then'](respondWithResult(_0x5e611b,0xc9))[_0x8cdd('0x43')](handleError(_0x5e611b,null));};exports[_0x8cdd('0x49')]=function(_0x544fa2,_0x4b04e3){if(_0x544fa2[_0x8cdd('0x4a')]['id']){delete _0x544fa2[_0x8cdd('0x4a')]['id'];}return db[_0x8cdd('0x3f')][_0x8cdd('0x47')]({'where':{'id':_0x544fa2[_0x8cdd('0x45')]['id']}})[_0x8cdd('0x22')](handleEntityNotFound(_0x4b04e3,null))[_0x8cdd('0x22')](saveUpdates(_0x544fa2['body'],null))[_0x8cdd('0x22')](respondWithResult(_0x4b04e3,null))['catch'](handleError(_0x4b04e3,null));};exports[_0x8cdd('0x23')]=function(_0x1ce6a2,_0x5a489e){return db['JscriptyQuestionReport'][_0x8cdd('0x47')]({'where':{'id':_0x1ce6a2[_0x8cdd('0x45')]['id']}})[_0x8cdd('0x22')](handleEntityNotFound(_0x5a489e,null))[_0x8cdd('0x22')](removeEntity(_0x5a489e,null))['catch'](handleError(_0x5a489e,null));};exports[_0x8cdd('0x4b')]=function(_0x44cd95,_0x38a1eb){return db[_0x8cdd('0x3f')][_0x8cdd('0x4b')]()['then'](respondWithResult(_0x38a1eb,null))[_0x8cdd('0x43')](handleError(_0x38a1eb,null));}; \ No newline at end of file +var _0x3d86=['describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d86,0x173));var _0x63d8=function(_0x3fdccd,_0x15f05a){_0x3fdccd=_0x3fdccd-0x0;var _0x251a58=_0x3d86[_0x3fdccd];return _0x251a58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63d8('0x0'));var zipdir=require(_0x63d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63d8('0x2'));var moment=require(_0x63d8('0x3'));var BPromise=require(_0x63d8('0x4'));var Mustache=require(_0x63d8('0x5'));var util=require(_0x63d8('0x6'));var path=require(_0x63d8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63d8('0x8'));var fs=require('fs');var fs_extra=require(_0x63d8('0x9'));var _=require('lodash');var squel=require(_0x63d8('0xa'));var crypto=require(_0x63d8('0xb'));var jsforce=require(_0x63d8('0xc'));var deskjs=require(_0x63d8('0xd'));var toCsv=require(_0x63d8('0xe'));var querystring=require(_0x63d8('0xf'));var Papa=require(_0x63d8('0x10'));var Redis=require(_0x63d8('0x11'));var authService=require(_0x63d8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x63d8('0x13'));var hardwareService=require(_0x63d8('0x14'));var logger=require(_0x63d8('0x15'))(_0x63d8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x63d8('0x17'));var db=require(_0x63d8('0x18'))['db'];function respondWithStatusCode(_0x54fec5,_0x3a91c5){_0x3a91c5=_0x3a91c5||0xcc;return function(_0x22b045){if(_0x22b045){return _0x54fec5['sendStatus'](_0x3a91c5);}return _0x54fec5[_0x63d8('0x19')](_0x3a91c5)[_0x63d8('0x1a')]();};}function respondWithResult(_0x3dea8c,_0x5d0caf){_0x5d0caf=_0x5d0caf||0xc8;return function(_0x2e98c6){if(_0x2e98c6){return _0x3dea8c[_0x63d8('0x19')](_0x5d0caf)[_0x63d8('0x1b')](_0x2e98c6);}};}function respondWithFilteredResult(_0x4d17d7,_0x2e0f40){return function(_0x5e0fa8){if(_0x5e0fa8){var _0x3a63b8=typeof _0x2e0f40['offset']===_0x63d8('0x1c')&&typeof _0x2e0f40[_0x63d8('0x1d')]==='undefined';var _0x5c274d=_0x5e0fa8[_0x63d8('0x1e')];var _0x235573=_0x3a63b8?0x0:_0x2e0f40[_0x63d8('0x1f')];var _0x2586e5=_0x3a63b8?_0x5e0fa8[_0x63d8('0x1e')]:_0x2e0f40[_0x63d8('0x1f')]+_0x2e0f40['limit'];var _0xe255ff;if(_0x2586e5>=_0x5c274d){_0x2586e5=_0x5c274d;_0xe255ff=0xc8;}else{_0xe255ff=0xce;}_0x4d17d7['status'](_0xe255ff);return _0x4d17d7[_0x63d8('0x20')](_0x63d8('0x21'),_0x235573+'-'+_0x2586e5+'/'+_0x5c274d)[_0x63d8('0x1b')](_0x5e0fa8);}return null;};}function patchUpdates(_0x3130d8){return function(_0x270d98){try{jsonpatch[_0x63d8('0x22')](_0x270d98,_0x3130d8,!![]);}catch(_0x19fec8){return BPromise['reject'](_0x19fec8);}return _0x270d98[_0x63d8('0x23')]();};}function saveUpdates(_0xa93db5,_0x53c491){return function(_0x3cb6c4){if(_0x3cb6c4){return _0x3cb6c4[_0x63d8('0x24')](_0xa93db5)['then'](function(_0x16cf69){return _0x16cf69;});}return null;};}function removeEntity(_0xa6ca27,_0x4297b1){return function(_0x4bc814){if(_0x4bc814){return _0x4bc814['destroy']()[_0x63d8('0x25')](function(){_0xa6ca27[_0x63d8('0x19')](0xcc)[_0x63d8('0x1a')]();});}};}function handleEntityNotFound(_0x1deda4,_0x37cc0a){return function(_0x232258){if(!_0x232258){_0x1deda4[_0x63d8('0x26')](0x194);}return _0x232258;};}function handleError(_0x219ffb,_0x483467){_0x483467=_0x483467||0x1f4;return function(_0x3f80cb){logger[_0x63d8('0x27')](_0x3f80cb['stack']);if(_0x3f80cb[_0x63d8('0x28')]){delete _0x3f80cb[_0x63d8('0x28')];}_0x219ffb[_0x63d8('0x19')](_0x483467)[_0x63d8('0x29')](_0x3f80cb);};}exports[_0x63d8('0x2a')]=function(_0x18f245,_0x2c3103){var _0x4abebd={},_0x2fdc8d={},_0x1d34a3={'count':0x0,'rows':[]};var _0x12930c=_[_0x63d8('0x2b')](db[_0x63d8('0x2c')][_0x63d8('0x2d')],function(_0x38dce7){return{'name':_0x38dce7['fieldName'],'type':_0x38dce7[_0x63d8('0x2e')][_0x63d8('0x2f')]};});_0x2fdc8d[_0x63d8('0x30')]=_[_0x63d8('0x2b')](_0x12930c,_0x63d8('0x28'));_0x2fdc8d['query']=_[_0x63d8('0x31')](_0x18f245[_0x63d8('0x32')]);_0x2fdc8d[_0x63d8('0x33')]=_['intersection'](_0x2fdc8d[_0x63d8('0x30')],_0x2fdc8d[_0x63d8('0x32')]);_0x4abebd['attributes']=_['intersection'](_0x2fdc8d['model'],qs[_0x63d8('0x34')](_0x18f245['query']['fields']));_0x4abebd['attributes']=_0x4abebd[_0x63d8('0x35')][_0x63d8('0x36')]?_0x4abebd['attributes']:_0x2fdc8d['model'];if(!_0x18f245['query'][_0x63d8('0x37')](_0x63d8('0x38'))){_0x4abebd[_0x63d8('0x1d')]=qs[_0x63d8('0x1d')](_0x18f245[_0x63d8('0x32')]['limit']);_0x4abebd[_0x63d8('0x1f')]=qs['offset'](_0x18f245[_0x63d8('0x32')][_0x63d8('0x1f')]);}_0x4abebd[_0x63d8('0x39')]=qs[_0x63d8('0x3a')](_0x18f245['query'][_0x63d8('0x3a')]);_0x4abebd[_0x63d8('0x3b')]=qs[_0x63d8('0x33')](_['pick'](_0x18f245[_0x63d8('0x32')],_0x2fdc8d[_0x63d8('0x33')]),_0x12930c);if(_0x18f245[_0x63d8('0x32')][_0x63d8('0x3c')]){_0x4abebd[_0x63d8('0x3b')]=_['merge'](_0x4abebd[_0x63d8('0x3b')],{'$or':_[_0x63d8('0x2b')](_0x12930c,function(_0x53564c){if(_0x53564c[_0x63d8('0x2e')]!=='VIRTUAL'){var _0x550d96={};_0x550d96[_0x53564c[_0x63d8('0x28')]]={'$like':'%'+_0x18f245[_0x63d8('0x32')]['filter']+'%'};return _0x550d96;}})});}_0x4abebd=_[_0x63d8('0x3d')]({},_0x4abebd,_0x18f245[_0x63d8('0x3e')]);var _0xef87f1={'where':_0x4abebd['where']};return db[_0x63d8('0x2c')][_0x63d8('0x1e')](_0xef87f1)[_0x63d8('0x25')](function(_0x1adf9d){_0x1d34a3[_0x63d8('0x1e')]=_0x1adf9d;if(_0x18f245['query'][_0x63d8('0x3f')]){_0x4abebd[_0x63d8('0x40')]=[{'all':!![]}];}return db[_0x63d8('0x2c')][_0x63d8('0x41')](_0x4abebd);})[_0x63d8('0x25')](function(_0x41d3be){_0x1d34a3['rows']=_0x41d3be;return _0x1d34a3;})[_0x63d8('0x25')](respondWithFilteredResult(_0x2c3103,_0x4abebd))[_0x63d8('0x42')](handleError(_0x2c3103,null));};exports[_0x63d8('0x43')]=function(_0x4b42b6,_0x24f6f0){var _0x2e44b1={'raw':!![],'where':{'id':_0x4b42b6[_0x63d8('0x44')]['id']}},_0x110a70={};_0x110a70['model']=_['keys'](db['JscriptyQuestionReport'][_0x63d8('0x2d')]);_0x110a70['query']=_[_0x63d8('0x31')](_0x4b42b6[_0x63d8('0x32')]);_0x110a70[_0x63d8('0x33')]=_[_0x63d8('0x45')](_0x110a70[_0x63d8('0x30')],_0x110a70[_0x63d8('0x32')]);_0x2e44b1['attributes']=_[_0x63d8('0x45')](_0x110a70['model'],qs[_0x63d8('0x34')](_0x4b42b6['query'][_0x63d8('0x34')]));_0x2e44b1[_0x63d8('0x35')]=_0x2e44b1['attributes'][_0x63d8('0x36')]?_0x2e44b1[_0x63d8('0x35')]:_0x110a70[_0x63d8('0x30')];if(_0x4b42b6[_0x63d8('0x32')][_0x63d8('0x3f')]){_0x2e44b1[_0x63d8('0x40')]=[{'all':!![]}];}_0x2e44b1=_['merge']({},_0x2e44b1,_0x4b42b6[_0x63d8('0x3e')]);return db[_0x63d8('0x2c')][_0x63d8('0x46')](_0x2e44b1)[_0x63d8('0x25')](handleEntityNotFound(_0x24f6f0,null))['then'](respondWithResult(_0x24f6f0,null))[_0x63d8('0x42')](handleError(_0x24f6f0,null));};exports['create']=function(_0x7403a9,_0x5cb1f7){return db[_0x63d8('0x2c')][_0x63d8('0x47')](_0x7403a9[_0x63d8('0x48')],{})[_0x63d8('0x25')](respondWithResult(_0x5cb1f7,0xc9))['catch'](handleError(_0x5cb1f7,null));};exports[_0x63d8('0x24')]=function(_0x4f489c,_0x4c88bc){if(_0x4f489c['body']['id']){delete _0x4f489c[_0x63d8('0x48')]['id'];}return db[_0x63d8('0x2c')][_0x63d8('0x46')]({'where':{'id':_0x4f489c['params']['id']}})[_0x63d8('0x25')](handleEntityNotFound(_0x4c88bc,null))['then'](saveUpdates(_0x4f489c[_0x63d8('0x48')],null))['then'](respondWithResult(_0x4c88bc,null))[_0x63d8('0x42')](handleError(_0x4c88bc,null));};exports['destroy']=function(_0x411c51,_0x292c17){return db[_0x63d8('0x2c')]['find']({'where':{'id':_0x411c51['params']['id']}})[_0x63d8('0x25')](handleEntityNotFound(_0x292c17,null))[_0x63d8('0x25')](removeEntity(_0x292c17,null))[_0x63d8('0x42')](handleError(_0x292c17,null));};exports[_0x63d8('0x49')]=function(_0x54242e,_0x43a4d6){return db[_0x63d8('0x2c')][_0x63d8('0x49')]()['then'](respondWithResult(_0x43a4d6,null))[_0x63d8('0x42')](handleError(_0x43a4d6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 62ad3f0..962a37c 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 _0x1f4d=['request-promise','path','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird'];(function(_0x1af2fd,_0xe1be5c){var _0x132392=function(_0x3f8131){while(--_0x3f8131){_0x1af2fd['push'](_0x1af2fd['shift']());}};_0x132392(++_0xe1be5c);}(_0x1f4d,0xf7));var _0xd1f4=function(_0x9c8839,_0x3ca6bc){_0x9c8839=_0x9c8839-0x0;var _0x52b9c8=_0x1f4d[_0x9c8839];return _0x52b9c8;};'use strict';var _=require(_0xd1f4('0x0'));var util=require(_0xd1f4('0x1'));var logger=require(_0xd1f4('0x2'))(_0xd1f4('0x3'));var moment=require('moment');var BPromise=require(_0xd1f4('0x4'));var rp=require(_0xd1f4('0x5'));var fs=require('fs');var path=require(_0xd1f4('0x6'));var rimraf=require('rimraf');var config=require(_0xd1f4('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xd1f4('0x8')]=function(_0x287225,_0x357e64){return _0x287225[_0xd1f4('0x9')](_0xd1f4('0xa'),attributes,{'tableName':_0xd1f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45d=['lodash','../../config/logger','api','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x2d9d7c,_0x3800ea){var _0x1bb972=function(_0x3b81e3){while(--_0x3b81e3){_0x2d9d7c['push'](_0x2d9d7c['shift']());}};_0x1bb972(++_0x3800ea);}(_0xf45d,0x144));var _0xdf45=function(_0x3566ab,_0xb56604){_0x3566ab=_0x3566ab-0x0;var _0x432092=_0xf45d[_0x3566ab];return _0x432092;};'use strict';var _=require(_0xdf45('0x0'));var util=require('util');var logger=require(_0xdf45('0x1'))(_0xdf45('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdf45('0x3'));var config=require(_0xdf45('0x4'));var attributes=require(_0xdf45('0x5'));module['exports']=function(_0x574f21,_0x432f55){return _0x574f21[_0xdf45('0x6')](_0xdf45('0x7'),attributes,{'tableName':_0xdf45('0x8'),'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 a566284..93a5c0f 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 _0xea4e=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2542fc,_0x262c59){var _0x5a84e9=function(_0x2d7b62){while(--_0x2d7b62){_0x2542fc['push'](_0x2542fc['shift']());}};_0x5a84e9(++_0x262c59);}(_0xea4e,0xdf));var _0xeea4=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xea4e[_0x5eef05];return _0x56d4b8;};'use strict';var _=require('lodash');var util=require(_0xeea4('0x0'));var moment=require(_0xeea4('0x1'));var BPromise=require(_0xeea4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeea4('0x3'));var db=require(_0xeea4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeea4('0x5'));var config=require('../../config/environment');var jayson=require(_0xeea4('0x6'));var client=jayson[_0xeea4('0x7')][_0xeea4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x212ef3,_0x315689,_0xda53b3){return new BPromise(function(_0x3c2d1f,_0x5cb0c3){return client[_0xeea4('0x9')](_0x212ef3,_0xda53b3)[_0xeea4('0xa')](function(_0x7adca1){logger[_0xeea4('0xb')](_0xeea4('0xc'),_0x315689,'request\x20sent');logger[_0xeea4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x315689,_0xeea4('0xe'),JSON[_0xeea4('0xf')](_0x7adca1));if(_0x7adca1[_0xeea4('0x10')]){if(_0x7adca1[_0xeea4('0x10')]['code']===0x1f4){logger[_0xeea4('0x10')](_0xeea4('0xc'),_0x315689,_0x7adca1[_0xeea4('0x10')][_0xeea4('0x11')]);return _0x5cb0c3(_0x7adca1['error'][_0xeea4('0x11')]);}logger['error'](_0xeea4('0xc'),_0x315689,_0x7adca1['error'][_0xeea4('0x11')]);return _0x3c2d1f(_0x7adca1[_0xeea4('0x10')][_0xeea4('0x11')]);}else{logger['info'](_0xeea4('0xc'),_0x315689,_0xeea4('0xe'));_0x3c2d1f(_0x7adca1[_0xeea4('0x12')][_0xeea4('0x11')]);}})[_0xeea4('0x13')](function(_0x795c21){logger[_0xeea4('0x10')](_0xeea4('0xc'),_0x315689,_0x795c21);_0x5cb0c3(_0x795c21);});});} \ No newline at end of file +var _0xfe85=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xfe85,0x106));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5fe8('0x0'));var util=require(_0x5fe8('0x1'));var moment=require('moment');var BPromise=require(_0x5fe8('0x2'));var rs=require(_0x5fe8('0x3'));var fs=require('fs');var Redis=require(_0x5fe8('0x4'));var db=require(_0x5fe8('0x5'))['db'];var utils=require(_0x5fe8('0x6'));var logger=require(_0x5fe8('0x7'))('rpc');var config=require(_0x5fe8('0x8'));var jayson=require(_0x5fe8('0x9'));var client=jayson[_0x5fe8('0xa')][_0x5fe8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fcf39,_0x11646f,_0x1e4af7){return new BPromise(function(_0xc9aab3,_0x3a353f){return client['request'](_0x3fcf39,_0x1e4af7)[_0x5fe8('0xc')](function(_0x198e12){logger[_0x5fe8('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11646f,_0x5fe8('0xe'));logger[_0x5fe8('0xf')](_0x5fe8('0x10'),_0x11646f,_0x5fe8('0xe'),JSON[_0x5fe8('0x11')](_0x198e12));if(_0x198e12[_0x5fe8('0x12')]){if(_0x198e12[_0x5fe8('0x12')]['code']===0x1f4){logger[_0x5fe8('0x12')](_0x5fe8('0x13'),_0x11646f,_0x198e12[_0x5fe8('0x12')][_0x5fe8('0x14')]);return _0x3a353f(_0x198e12[_0x5fe8('0x12')]['message']);}logger[_0x5fe8('0x12')](_0x5fe8('0x13'),_0x11646f,_0x198e12[_0x5fe8('0x12')][_0x5fe8('0x14')]);return _0xc9aab3(_0x198e12[_0x5fe8('0x12')][_0x5fe8('0x14')]);}else{logger[_0x5fe8('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11646f,_0x5fe8('0xe'));_0xc9aab3(_0x198e12[_0x5fe8('0x15')][_0x5fe8('0x14')]);}})[_0x5fe8('0x16')](function(_0x15d607){logger[_0x5fe8('0x12')](_0x5fe8('0x13'),_0x11646f,_0x15d607);_0x3a353f(_0x15d607);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 134f314..af65b62 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 _0x6457=['/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x6457,0x14e));var _0x7645=function(_0x5d968b,_0x504f2c){_0x5d968b=_0x5d968b-0x0;var _0x1c4b2f=_0x6457[_0x5d968b];return _0x1c4b2f;};'use strict';var multer=require(_0x7645('0x0'));var util=require(_0x7645('0x1'));var path=require(_0x7645('0x2'));var timeout=require('connect-timeout');var express=require(_0x7645('0x3'));var router=express[_0x7645('0x4')]();var fs_extra=require(_0x7645('0x5'));var auth=require(_0x7645('0x6'));var interaction=require(_0x7645('0x7'));var config=require(_0x7645('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0x7645('0x9')]('/',auth['isAuthenticated'](),controller[_0x7645('0xa')]);router[_0x7645('0x9')](_0x7645('0xb'),auth[_0x7645('0xc')](),controller[_0x7645('0xd')]);router[_0x7645('0x9')](_0x7645('0xe'),auth['isAuthenticated'](),controller[_0x7645('0xf')]);router[_0x7645('0x9')](_0x7645('0x10'),auth['isAuthenticated'](),controller[_0x7645('0x11')]);router[_0x7645('0x12')]('/',auth[_0x7645('0xc')](),controller[_0x7645('0x13')]);router[_0x7645('0x14')](_0x7645('0xe'),auth[_0x7645('0xc')](),controller[_0x7645('0x15')]);router[_0x7645('0x16')](_0x7645('0xe'),auth[_0x7645('0xc')](),controller[_0x7645('0x17')]);module[_0x7645('0x18')]=router; \ No newline at end of file +var _0x779c=['get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','./jscriptySessionReport.controller'];(function(_0xd27ded,_0x1164e2){var _0x5ef850=function(_0x582e7d){while(--_0x582e7d){_0xd27ded['push'](_0xd27ded['shift']());}};_0x5ef850(++_0x1164e2);}(_0x779c,0x14a));var _0xc779=function(_0x6afe38,_0x5a86ed){_0x6afe38=_0x6afe38-0x0;var _0x162cb9=_0x779c[_0x6afe38];return _0x162cb9;};'use strict';var multer=require(_0xc779('0x0'));var util=require(_0xc779('0x1'));var path=require('path');var timeout=require(_0xc779('0x2'));var express=require(_0xc779('0x3'));var router=express['Router']();var fs_extra=require(_0xc779('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc779('0x5'));router[_0xc779('0x6')]('/',auth[_0xc779('0x7')](),controller[_0xc779('0x8')]);router[_0xc779('0x6')](_0xc779('0x9'),auth[_0xc779('0x7')](),controller['describe']);router[_0xc779('0x6')](_0xc779('0xa'),auth[_0xc779('0x7')](),controller[_0xc779('0xb')]);router['get'](_0xc779('0xc'),auth['isAuthenticated'](),controller[_0xc779('0xd')]);router[_0xc779('0xe')]('/',auth['isAuthenticated'](),controller[_0xc779('0xf')]);router[_0xc779('0x10')](_0xc779('0xa'),auth[_0xc779('0x7')](),controller[_0xc779('0x11')]);router[_0xc779('0x12')](_0xc779('0xa'),auth[_0xc779('0x7')](),controller[_0xc779('0x13')]);module[_0xc779('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7b54418..0657caf 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 _0x5a8a=['setDataValue','starttime','endtime','format','STRING','moment','sequelize','DATE'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5a8a,0x19d));var _0xa5a8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5a8a[_0x432682];return _0x463d05;};'use strict';var moment=require(_0xa5a8('0x0'));var Sequelize=require(_0xa5a8('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xa5a8('0x2')],'set':function(_0x4983a4){this[_0xa5a8('0x3')](_0xa5a8('0x4'),_0x4983a4);this[_0xa5a8('0x3')](_0xa5a8('0x5'),moment()[_0xa5a8('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xa5a8('0x2')]},'membername':{'type':Sequelize[_0xa5a8('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa5a8('0x7')]},'uniqueid':{'type':Sequelize[_0xa5a8('0x7')]},'calleridname':{'type':Sequelize[_0xa5a8('0x7')]},'calleridnum':{'type':Sequelize[_0xa5a8('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x25d3=['YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','exports','setDataValue','endtime','format'];(function(_0x425435,_0x183569){var _0x5c3713=function(_0x3e9f90){while(--_0x3e9f90){_0x425435['push'](_0x425435['shift']());}};_0x5c3713(++_0x183569);}(_0x25d3,0x194));var _0x325d=function(_0xd4269e,_0x16428a){_0xd4269e=_0xd4269e-0x0;var _0x255c0a=_0x25d3[_0xd4269e];return _0x255c0a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x325d('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3455e3){this[_0x325d('0x1')]('starttime',_0x3455e3);this['setDataValue'](_0x325d('0x2'),moment()[_0x325d('0x3')](_0x325d('0x4')));}},'endtime':{'type':Sequelize[_0x325d('0x5')]},'membername':{'type':Sequelize[_0x325d('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x325d('0x6')]},'uniqueid':{'type':Sequelize[_0x325d('0x6')]},'calleridname':{'type':Sequelize[_0x325d('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x325d('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 50a0d71..99312a9 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 _0x3d25=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','JscriptyQuestionReport','pick','SessionId','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','apply','reject','save','update','destroy','then','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x5f5777,_0x577d6a){var _0x110317=function(_0x2dc5d7){while(--_0x2dc5d7){_0x5f5777['push'](_0x5f5777['shift']());}};_0x110317(++_0x577d6a);}(_0x3d25,0x1e0));var _0x53d2=function(_0x45bc3f,_0x234416){_0x45bc3f=_0x45bc3f-0x0;var _0x530329=_0x3d25[_0x45bc3f];return _0x530329;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x53d2('0x0'));var rp=require(_0x53d2('0x1'));var moment=require(_0x53d2('0x2'));var BPromise=require(_0x53d2('0x3'));var Mustache=require(_0x53d2('0x4'));var util=require(_0x53d2('0x5'));var path=require(_0x53d2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53d2('0x8'));var deskjs=require(_0x53d2('0x9'));var toCsv=require(_0x53d2('0xa'));var querystring=require('querystring');var Papa=require(_0x53d2('0xb'));var Redis=require(_0x53d2('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x53d2('0xd'));var as=require(_0x53d2('0xe'));var hardwareService=require(_0x53d2('0xf'));var logger=require(_0x53d2('0x10'))(_0x53d2('0x11'));var utils=require(_0x53d2('0x12'));var config=require(_0x53d2('0x13'));var licenseUtil=require(_0x53d2('0x14'));var db=require(_0x53d2('0x15'))['db'];function respondWithStatusCode(_0x31a599,_0x46cf09){_0x46cf09=_0x46cf09||0xcc;return function(_0x26dfbb){if(_0x26dfbb){return _0x31a599[_0x53d2('0x16')](_0x46cf09);}return _0x31a599['status'](_0x46cf09)[_0x53d2('0x17')]();};}function respondWithResult(_0x5539fd,_0x267145){_0x267145=_0x267145||0xc8;return function(_0xd766a8){if(_0xd766a8){return _0x5539fd['status'](_0x267145)[_0x53d2('0x18')](_0xd766a8);}};}function respondWithFilteredResult(_0x265921,_0x54eacb){return function(_0x170e21){if(_0x170e21){var _0x5491ef=typeof _0x54eacb[_0x53d2('0x19')]==='undefined'&&typeof _0x54eacb['limit']===_0x53d2('0x1a');var _0x4aa73e=_0x170e21[_0x53d2('0x1b')];var _0x38e684=_0x5491ef?0x0:_0x54eacb[_0x53d2('0x19')];var _0x1e9f52=_0x5491ef?_0x170e21[_0x53d2('0x1b')]:_0x54eacb['offset']+_0x54eacb[_0x53d2('0x1c')];var _0x54ee41;if(_0x1e9f52>=_0x4aa73e){_0x1e9f52=_0x4aa73e;_0x54ee41=0xc8;}else{_0x54ee41=0xce;}_0x265921[_0x53d2('0x1d')](_0x54ee41);return _0x265921['set']('Content-Range',_0x38e684+'-'+_0x1e9f52+'/'+_0x4aa73e)[_0x53d2('0x18')](_0x170e21);}return null;};}function patchUpdates(_0x106a65){return function(_0xfca310){try{jsonpatch[_0x53d2('0x1e')](_0xfca310,_0x106a65,!![]);}catch(_0x349c88){return BPromise[_0x53d2('0x1f')](_0x349c88);}return _0xfca310[_0x53d2('0x20')]();};}function saveUpdates(_0xa99c20,_0x4e4245){return function(_0xd7c3e7){if(_0xd7c3e7){return _0xd7c3e7[_0x53d2('0x21')](_0xa99c20)['then'](function(_0x2e683b){return _0x2e683b;});}return null;};}function removeEntity(_0x579cc3,_0x4e364b){return function(_0x2aecd5){if(_0x2aecd5){return _0x2aecd5[_0x53d2('0x22')]()[_0x53d2('0x23')](function(){_0x579cc3[_0x53d2('0x1d')](0xcc)[_0x53d2('0x17')]();});}};}function handleEntityNotFound(_0x24f017,_0x3cb77d){return function(_0x5379df){if(!_0x5379df){_0x24f017[_0x53d2('0x16')](0x194);}return _0x5379df;};}function handleError(_0x2ef85c,_0x5929e7){_0x5929e7=_0x5929e7||0x1f4;return function(_0x32eb86){logger[_0x53d2('0x24')](_0x32eb86['stack']);if(_0x32eb86[_0x53d2('0x25')]){delete _0x32eb86[_0x53d2('0x25')];}_0x2ef85c['status'](_0x5929e7)[_0x53d2('0x26')](_0x32eb86);};}exports[_0x53d2('0x27')]=function(_0x14ac43,_0x452aa2){var _0x1cd678={},_0x279856={},_0x3d9270={'count':0x0,'rows':[]};var _0x5354c9=_[_0x53d2('0x28')](db[_0x53d2('0x29')][_0x53d2('0x2a')],function(_0x4c0a4f){return{'name':_0x4c0a4f[_0x53d2('0x2b')],'type':_0x4c0a4f[_0x53d2('0x2c')]['key']};});_0x279856[_0x53d2('0x2d')]=_[_0x53d2('0x28')](_0x5354c9,_0x53d2('0x25'));_0x279856['query']=_[_0x53d2('0x2e')](_0x14ac43['query']);_0x279856[_0x53d2('0x2f')]=_['intersection'](_0x279856['model'],_0x279856['query']);_0x1cd678['attributes']=_[_0x53d2('0x30')](_0x279856[_0x53d2('0x2d')],qs[_0x53d2('0x31')](_0x14ac43[_0x53d2('0x32')]['fields']));_0x1cd678[_0x53d2('0x33')]=_0x1cd678[_0x53d2('0x33')][_0x53d2('0x34')]?_0x1cd678['attributes']:_0x279856[_0x53d2('0x2d')];if(!_0x14ac43[_0x53d2('0x32')][_0x53d2('0x35')](_0x53d2('0x36'))){_0x1cd678['limit']=qs[_0x53d2('0x1c')](_0x14ac43[_0x53d2('0x32')][_0x53d2('0x1c')]);_0x1cd678['offset']=qs[_0x53d2('0x19')](_0x14ac43['query'][_0x53d2('0x19')]);}_0x1cd678[_0x53d2('0x37')]=qs[_0x53d2('0x38')](_0x14ac43[_0x53d2('0x32')][_0x53d2('0x38')]);_0x1cd678[_0x53d2('0x39')]=qs[_0x53d2('0x2f')](_['pick'](_0x14ac43[_0x53d2('0x32')],_0x279856[_0x53d2('0x2f')]),_0x5354c9);if(_0x14ac43['query'][_0x53d2('0x3a')]){_0x1cd678[_0x53d2('0x39')]=_[_0x53d2('0x3b')](_0x1cd678[_0x53d2('0x39')],{'$or':_[_0x53d2('0x28')](_0x5354c9,function(_0x1f3971){if(_0x1f3971['type']!==_0x53d2('0x3c')){var _0x55c90c={};_0x55c90c[_0x1f3971['name']]={'$like':'%'+_0x14ac43[_0x53d2('0x32')]['filter']+'%'};return _0x55c90c;}})});}_0x1cd678=_['merge']({},_0x1cd678,_0x14ac43[_0x53d2('0x3d')]);var _0x5e9960={'where':_0x1cd678[_0x53d2('0x39')]};return db[_0x53d2('0x29')][_0x53d2('0x1b')](_0x5e9960)[_0x53d2('0x23')](function(_0x412a3e){_0x3d9270[_0x53d2('0x1b')]=_0x412a3e;if(_0x14ac43['query'][_0x53d2('0x3e')]){_0x1cd678[_0x53d2('0x3f')]=[{'all':!![]}];}return db[_0x53d2('0x29')][_0x53d2('0x40')](_0x1cd678);})['then'](function(_0x4d202c){_0x3d9270[_0x53d2('0x41')]=_0x4d202c;return _0x3d9270;})[_0x53d2('0x23')](respondWithFilteredResult(_0x452aa2,_0x1cd678))[_0x53d2('0x42')](handleError(_0x452aa2,null));};exports[_0x53d2('0x43')]=function(_0x2dab8f,_0x5be482){var _0x4ff9cb={'raw':!![],'where':{'id':_0x2dab8f[_0x53d2('0x44')]['id']}},_0x5a2ea9={};_0x5a2ea9[_0x53d2('0x2d')]=_[_0x53d2('0x2e')](db[_0x53d2('0x29')]['rawAttributes']);_0x5a2ea9['query']=_[_0x53d2('0x2e')](_0x2dab8f['query']);_0x5a2ea9[_0x53d2('0x2f')]=_[_0x53d2('0x30')](_0x5a2ea9[_0x53d2('0x2d')],_0x5a2ea9[_0x53d2('0x32')]);_0x4ff9cb[_0x53d2('0x33')]=_['intersection'](_0x5a2ea9[_0x53d2('0x2d')],qs['fields'](_0x2dab8f['query']['fields']));_0x4ff9cb[_0x53d2('0x33')]=_0x4ff9cb['attributes'][_0x53d2('0x34')]?_0x4ff9cb[_0x53d2('0x33')]:_0x5a2ea9[_0x53d2('0x2d')];if(_0x2dab8f[_0x53d2('0x32')]['includeAll']){_0x4ff9cb[_0x53d2('0x3f')]=[{'all':!![]}];}_0x4ff9cb=_['merge']({},_0x4ff9cb,_0x2dab8f['options']);return db[_0x53d2('0x29')][_0x53d2('0x45')](_0x4ff9cb)[_0x53d2('0x23')](handleEntityNotFound(_0x5be482,null))[_0x53d2('0x23')](respondWithResult(_0x5be482,null))[_0x53d2('0x42')](handleError(_0x5be482,null));};exports['create']=function(_0x1e63e6,_0x5dde1f){return db[_0x53d2('0x29')][_0x53d2('0x46')](_0x1e63e6[_0x53d2('0x47')],{})[_0x53d2('0x23')](respondWithResult(_0x5dde1f,0xc9))[_0x53d2('0x42')](handleError(_0x5dde1f,null));};exports['update']=function(_0x3141df,_0x36abd5){if(_0x3141df[_0x53d2('0x47')]['id']){delete _0x3141df['body']['id'];}return db[_0x53d2('0x29')][_0x53d2('0x45')]({'where':{'id':_0x3141df[_0x53d2('0x44')]['id']}})[_0x53d2('0x23')](handleEntityNotFound(_0x36abd5,null))['then'](saveUpdates(_0x3141df['body'],null))[_0x53d2('0x23')](respondWithResult(_0x36abd5,null))['catch'](handleError(_0x36abd5,null));};exports['destroy']=function(_0x44e163,_0x29f415){return db[_0x53d2('0x29')]['find']({'where':{'id':_0x44e163['params']['id']}})[_0x53d2('0x23')](handleEntityNotFound(_0x29f415,null))[_0x53d2('0x23')](removeEntity(_0x29f415,null))[_0x53d2('0x42')](handleError(_0x29f415,null));};exports[_0x53d2('0x48')]=function(_0x4d34d7,_0x127431){return db[_0x53d2('0x29')][_0x53d2('0x48')]()['then'](respondWithResult(_0x127431,null))[_0x53d2('0x42')](handleError(_0x127431,null));};exports[_0x53d2('0x49')]=function(_0x3f7092,_0x354870,_0x3fc8a5){var _0x56abd7={'raw':!![],'where':{}};var _0x23c03e={};var _0x19b8a4={'count':0x0,'rows':[]};return db[_0x53d2('0x29')]['findOne']({'where':{'id':_0x3f7092[_0x53d2('0x44')]['id']}})['then'](handleEntityNotFound(_0x354870,null))[_0x53d2('0x23')](function(_0x174548){if(_0x174548){_0x23c03e[_0x53d2('0x2d')]=_['keys'](db[_0x53d2('0x4a')][_0x53d2('0x2a')]);_0x23c03e[_0x53d2('0x32')]=_[_0x53d2('0x2e')](_0x3f7092[_0x53d2('0x32')]);_0x23c03e[_0x53d2('0x2f')]=_[_0x53d2('0x30')](_0x23c03e[_0x53d2('0x2d')],_0x23c03e[_0x53d2('0x32')]);_0x56abd7[_0x53d2('0x33')]=_[_0x53d2('0x30')](_0x23c03e[_0x53d2('0x2d')],qs[_0x53d2('0x31')](_0x3f7092['query'][_0x53d2('0x31')]));_0x56abd7[_0x53d2('0x33')]=_0x56abd7[_0x53d2('0x33')]['length']?_0x56abd7[_0x53d2('0x33')]:_0x23c03e[_0x53d2('0x2d')];if(!_0x3f7092[_0x53d2('0x32')][_0x53d2('0x35')](_0x53d2('0x36'))){_0x56abd7['limit']=qs[_0x53d2('0x1c')](_0x3f7092[_0x53d2('0x32')][_0x53d2('0x1c')]);_0x56abd7[_0x53d2('0x19')]=qs[_0x53d2('0x19')](_0x3f7092[_0x53d2('0x32')]['offset']);}_0x56abd7[_0x53d2('0x37')]=qs['sort'](_0x3f7092[_0x53d2('0x32')][_0x53d2('0x38')]);_0x56abd7[_0x53d2('0x39')]=qs[_0x53d2('0x2f')](_[_0x53d2('0x4b')](_0x3f7092[_0x53d2('0x32')],_0x23c03e[_0x53d2('0x2f')]));_0x56abd7['where'][_0x53d2('0x4c')]=_0x174548['id'];if(_0x3f7092[_0x53d2('0x32')]['filter']){_0x56abd7['where']=_[_0x53d2('0x3b')](_0x56abd7[_0x53d2('0x39')],{'$or':_[_0x53d2('0x28')](_0x56abd7[_0x53d2('0x33')],function(_0x5508a8){var _0x5c3ccd={};_0x5c3ccd[_0x5508a8]={'$like':'%'+_0x3f7092[_0x53d2('0x32')][_0x53d2('0x3a')]+'%'};return _0x5c3ccd;})});}_0x56abd7=_[_0x53d2('0x3b')]({},_0x56abd7,_0x3f7092[_0x53d2('0x3d')]);return db[_0x53d2('0x4a')]['count']({'where':_0x56abd7[_0x53d2('0x39')]})[_0x53d2('0x23')](function(_0x42b38d){_0x19b8a4[_0x53d2('0x1b')]=_0x42b38d;if(_0x3f7092['query']['includeAll']){_0x56abd7[_0x53d2('0x3f')]=[{'all':!![]}];}return db[_0x53d2('0x4a')]['findAll'](_0x56abd7);})[_0x53d2('0x23')](function(_0x313a47){_0x19b8a4['rows']=_0x313a47;return _0x19b8a4;});}})[_0x53d2('0x23')](respondWithFilteredResult(_0x354870,_0x56abd7))['catch'](handleError(_0x354870,null));}; \ No newline at end of file +var _0xc102=['rows','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','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','JscriptySessionReport','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','filters','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes'];(function(_0x485e18,_0x3cf9d2){var _0x39d516=function(_0x26e718){while(--_0x26e718){_0x485e18['push'](_0x485e18['shift']());}};_0x39d516(++_0x3cf9d2);}(_0xc102,0xf7));var _0x2c10=function(_0x14e776,_0x5928b0){_0x14e776=_0x14e776-0x0;var _0x2a3e66=_0xc102[_0x14e776];return _0x2a3e66;};'use strict';var emlformat=require(_0x2c10('0x0'));var rimraf=require(_0x2c10('0x1'));var zipdir=require(_0x2c10('0x2'));var jsonpatch=require(_0x2c10('0x3'));var rp=require(_0x2c10('0x4'));var moment=require(_0x2c10('0x5'));var BPromise=require(_0x2c10('0x6'));var Mustache=require(_0x2c10('0x7'));var util=require('util');var path=require(_0x2c10('0x8'));var sox=require(_0x2c10('0x9'));var csv=require(_0x2c10('0xa'));var ejs=require(_0x2c10('0xb'));var fs=require('fs');var fs_extra=require(_0x2c10('0xc'));var _=require(_0x2c10('0xd'));var squel=require(_0x2c10('0xe'));var crypto=require('crypto');var jsforce=require(_0x2c10('0xf'));var deskjs=require(_0x2c10('0x10'));var toCsv=require(_0x2c10('0xa'));var querystring=require(_0x2c10('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c10('0x12'));var qs=require(_0x2c10('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c10('0x14'))(_0x2c10('0x15'));var utils=require(_0x2c10('0x16'));var config=require(_0x2c10('0x17'));var licenseUtil=require(_0x2c10('0x18'));var db=require(_0x2c10('0x19'))['db'];function respondWithStatusCode(_0x571beb,_0x216a1f){_0x216a1f=_0x216a1f||0xcc;return function(_0x35195a){if(_0x35195a){return _0x571beb[_0x2c10('0x1a')](_0x216a1f);}return _0x571beb[_0x2c10('0x1b')](_0x216a1f)['end']();};}function respondWithResult(_0x4b1873,_0x2cd83e){_0x2cd83e=_0x2cd83e||0xc8;return function(_0x1af041){if(_0x1af041){return _0x4b1873[_0x2c10('0x1b')](_0x2cd83e)[_0x2c10('0x1c')](_0x1af041);}};}function respondWithFilteredResult(_0xb995b1,_0x39343b){return function(_0x6bb408){if(_0x6bb408){var _0x5f73c9=typeof _0x39343b[_0x2c10('0x1d')]==='undefined'&&typeof _0x39343b[_0x2c10('0x1e')]==='undefined';var _0x58b7bc=_0x6bb408[_0x2c10('0x1f')];var _0x21047b=_0x5f73c9?0x0:_0x39343b[_0x2c10('0x1d')];var _0x28d9f0=_0x5f73c9?_0x6bb408[_0x2c10('0x1f')]:_0x39343b[_0x2c10('0x1d')]+_0x39343b[_0x2c10('0x1e')];var _0xdc3159;if(_0x28d9f0>=_0x58b7bc){_0x28d9f0=_0x58b7bc;_0xdc3159=0xc8;}else{_0xdc3159=0xce;}_0xb995b1[_0x2c10('0x1b')](_0xdc3159);return _0xb995b1[_0x2c10('0x20')](_0x2c10('0x21'),_0x21047b+'-'+_0x28d9f0+'/'+_0x58b7bc)[_0x2c10('0x1c')](_0x6bb408);}return null;};}function patchUpdates(_0x48a035){return function(_0x1f6b26){try{jsonpatch[_0x2c10('0x22')](_0x1f6b26,_0x48a035,!![]);}catch(_0x545f46){return BPromise[_0x2c10('0x23')](_0x545f46);}return _0x1f6b26[_0x2c10('0x24')]();};}function saveUpdates(_0x27fb64,_0x484498){return function(_0xc4040a){if(_0xc4040a){return _0xc4040a[_0x2c10('0x25')](_0x27fb64)[_0x2c10('0x26')](function(_0x3666c6){return _0x3666c6;});}return null;};}function removeEntity(_0x14867e,_0x43bb51){return function(_0x208eb6){if(_0x208eb6){return _0x208eb6[_0x2c10('0x27')]()[_0x2c10('0x26')](function(){_0x14867e[_0x2c10('0x1b')](0xcc)[_0x2c10('0x28')]();});}};}function handleEntityNotFound(_0x50e281,_0x5a608b){return function(_0x3dbcb4){if(!_0x3dbcb4){_0x50e281[_0x2c10('0x1a')](0x194);}return _0x3dbcb4;};}function handleError(_0x22a977,_0x17a1ac){_0x17a1ac=_0x17a1ac||0x1f4;return function(_0x14457e){logger[_0x2c10('0x29')](_0x14457e[_0x2c10('0x2a')]);if(_0x14457e[_0x2c10('0x2b')]){delete _0x14457e['name'];}_0x22a977[_0x2c10('0x1b')](_0x17a1ac)[_0x2c10('0x2c')](_0x14457e);};}exports[_0x2c10('0x2d')]=function(_0x2c9468,_0x5471b5){var _0x4937a3={},_0x35e0a9={},_0x5c4cef={'count':0x0,'rows':[]};var _0x4c784d=_['map'](db[_0x2c10('0x2e')]['rawAttributes'],function(_0x3d0f13){return{'name':_0x3d0f13['fieldName'],'type':_0x3d0f13[_0x2c10('0x2f')][_0x2c10('0x30')]};});_0x35e0a9[_0x2c10('0x31')]=_[_0x2c10('0x32')](_0x4c784d,_0x2c10('0x2b'));_0x35e0a9[_0x2c10('0x33')]=_['keys'](_0x2c9468[_0x2c10('0x33')]);_0x35e0a9['filters']=_[_0x2c10('0x34')](_0x35e0a9[_0x2c10('0x31')],_0x35e0a9[_0x2c10('0x33')]);_0x4937a3['attributes']=_[_0x2c10('0x34')](_0x35e0a9[_0x2c10('0x31')],qs[_0x2c10('0x35')](_0x2c9468[_0x2c10('0x33')][_0x2c10('0x35')]));_0x4937a3[_0x2c10('0x36')]=_0x4937a3[_0x2c10('0x36')][_0x2c10('0x37')]?_0x4937a3[_0x2c10('0x36')]:_0x35e0a9[_0x2c10('0x31')];if(!_0x2c9468[_0x2c10('0x33')][_0x2c10('0x38')](_0x2c10('0x39'))){_0x4937a3[_0x2c10('0x1e')]=qs[_0x2c10('0x1e')](_0x2c9468[_0x2c10('0x33')][_0x2c10('0x1e')]);_0x4937a3['offset']=qs['offset'](_0x2c9468['query'][_0x2c10('0x1d')]);}_0x4937a3[_0x2c10('0x3a')]=qs[_0x2c10('0x3b')](_0x2c9468[_0x2c10('0x33')]['sort']);_0x4937a3[_0x2c10('0x3c')]=qs['filters'](_[_0x2c10('0x3d')](_0x2c9468[_0x2c10('0x33')],_0x35e0a9['filters']),_0x4c784d);if(_0x2c9468[_0x2c10('0x33')][_0x2c10('0x3e')]){_0x4937a3[_0x2c10('0x3c')]=_[_0x2c10('0x3f')](_0x4937a3[_0x2c10('0x3c')],{'$or':_['map'](_0x4c784d,function(_0x21fd46){if(_0x21fd46[_0x2c10('0x2f')]!==_0x2c10('0x40')){var _0x30a19f={};_0x30a19f[_0x21fd46['name']]={'$like':'%'+_0x2c9468[_0x2c10('0x33')][_0x2c10('0x3e')]+'%'};return _0x30a19f;}})});}_0x4937a3=_[_0x2c10('0x3f')]({},_0x4937a3,_0x2c9468[_0x2c10('0x41')]);var _0x165055={'where':_0x4937a3['where']};return db[_0x2c10('0x2e')][_0x2c10('0x1f')](_0x165055)[_0x2c10('0x26')](function(_0x1988fa){_0x5c4cef[_0x2c10('0x1f')]=_0x1988fa;if(_0x2c9468[_0x2c10('0x33')][_0x2c10('0x42')]){_0x4937a3[_0x2c10('0x43')]=[{'all':!![]}];}return db[_0x2c10('0x2e')][_0x2c10('0x44')](_0x4937a3);})[_0x2c10('0x26')](function(_0x31b687){_0x5c4cef['rows']=_0x31b687;return _0x5c4cef;})[_0x2c10('0x26')](respondWithFilteredResult(_0x5471b5,_0x4937a3))[_0x2c10('0x45')](handleError(_0x5471b5,null));};exports['show']=function(_0x29a214,_0x23857f){var _0x188033={'raw':!![],'where':{'id':_0x29a214[_0x2c10('0x46')]['id']}},_0x5f0538={};_0x5f0538[_0x2c10('0x31')]=_[_0x2c10('0x47')](db[_0x2c10('0x2e')]['rawAttributes']);_0x5f0538[_0x2c10('0x33')]=_[_0x2c10('0x47')](_0x29a214['query']);_0x5f0538[_0x2c10('0x48')]=_['intersection'](_0x5f0538[_0x2c10('0x31')],_0x5f0538[_0x2c10('0x33')]);_0x188033[_0x2c10('0x36')]=_[_0x2c10('0x34')](_0x5f0538[_0x2c10('0x31')],qs[_0x2c10('0x35')](_0x29a214[_0x2c10('0x33')][_0x2c10('0x35')]));_0x188033[_0x2c10('0x36')]=_0x188033['attributes'][_0x2c10('0x37')]?_0x188033['attributes']:_0x5f0538[_0x2c10('0x31')];if(_0x29a214[_0x2c10('0x33')][_0x2c10('0x42')]){_0x188033[_0x2c10('0x43')]=[{'all':!![]}];}_0x188033=_[_0x2c10('0x3f')]({},_0x188033,_0x29a214[_0x2c10('0x41')]);return db[_0x2c10('0x2e')][_0x2c10('0x49')](_0x188033)[_0x2c10('0x26')](handleEntityNotFound(_0x23857f,null))[_0x2c10('0x26')](respondWithResult(_0x23857f,null))['catch'](handleError(_0x23857f,null));};exports[_0x2c10('0x4a')]=function(_0x3b95fe,_0x3d3a37){return db['JscriptySessionReport'][_0x2c10('0x4a')](_0x3b95fe[_0x2c10('0x4b')],{})[_0x2c10('0x26')](respondWithResult(_0x3d3a37,0xc9))[_0x2c10('0x45')](handleError(_0x3d3a37,null));};exports[_0x2c10('0x25')]=function(_0x18eeaa,_0x49adc2){if(_0x18eeaa[_0x2c10('0x4b')]['id']){delete _0x18eeaa['body']['id'];}return db['JscriptySessionReport'][_0x2c10('0x49')]({'where':{'id':_0x18eeaa[_0x2c10('0x46')]['id']}})[_0x2c10('0x26')](handleEntityNotFound(_0x49adc2,null))[_0x2c10('0x26')](saveUpdates(_0x18eeaa[_0x2c10('0x4b')],null))['then'](respondWithResult(_0x49adc2,null))[_0x2c10('0x45')](handleError(_0x49adc2,null));};exports[_0x2c10('0x27')]=function(_0x4e8224,_0x7a54f0){return db['JscriptySessionReport'][_0x2c10('0x49')]({'where':{'id':_0x4e8224['params']['id']}})['then'](handleEntityNotFound(_0x7a54f0,null))[_0x2c10('0x26')](removeEntity(_0x7a54f0,null))[_0x2c10('0x45')](handleError(_0x7a54f0,null));};exports[_0x2c10('0x4c')]=function(_0x19ce6a,_0x170e6a){return db[_0x2c10('0x2e')][_0x2c10('0x4c')]()[_0x2c10('0x26')](respondWithResult(_0x170e6a,null))['catch'](handleError(_0x170e6a,null));};exports[_0x2c10('0x4d')]=function(_0x56dc73,_0x41b9dd,_0x3dc154){var _0x240b90={'raw':!![],'where':{}};var _0xb9a8f4={};var _0x48e365={'count':0x0,'rows':[]};return db[_0x2c10('0x2e')][_0x2c10('0x4e')]({'where':{'id':_0x56dc73[_0x2c10('0x46')]['id']}})[_0x2c10('0x26')](handleEntityNotFound(_0x41b9dd,null))[_0x2c10('0x26')](function(_0x292dcd){if(_0x292dcd){_0xb9a8f4['model']=_[_0x2c10('0x47')](db[_0x2c10('0x4f')][_0x2c10('0x50')]);_0xb9a8f4[_0x2c10('0x33')]=_[_0x2c10('0x47')](_0x56dc73[_0x2c10('0x33')]);_0xb9a8f4['filters']=_[_0x2c10('0x34')](_0xb9a8f4[_0x2c10('0x31')],_0xb9a8f4[_0x2c10('0x33')]);_0x240b90[_0x2c10('0x36')]=_[_0x2c10('0x34')](_0xb9a8f4[_0x2c10('0x31')],qs['fields'](_0x56dc73[_0x2c10('0x33')][_0x2c10('0x35')]));_0x240b90['attributes']=_0x240b90[_0x2c10('0x36')]['length']?_0x240b90[_0x2c10('0x36')]:_0xb9a8f4[_0x2c10('0x31')];if(!_0x56dc73['query'][_0x2c10('0x38')](_0x2c10('0x39'))){_0x240b90[_0x2c10('0x1e')]=qs[_0x2c10('0x1e')](_0x56dc73[_0x2c10('0x33')][_0x2c10('0x1e')]);_0x240b90[_0x2c10('0x1d')]=qs['offset'](_0x56dc73[_0x2c10('0x33')]['offset']);}_0x240b90[_0x2c10('0x3a')]=qs[_0x2c10('0x3b')](_0x56dc73[_0x2c10('0x33')]['sort']);_0x240b90['where']=qs['filters'](_[_0x2c10('0x3d')](_0x56dc73['query'],_0xb9a8f4['filters']));_0x240b90['where']['SessionId']=_0x292dcd['id'];if(_0x56dc73[_0x2c10('0x33')][_0x2c10('0x3e')]){_0x240b90[_0x2c10('0x3c')]=_['merge'](_0x240b90['where'],{'$or':_[_0x2c10('0x32')](_0x240b90['attributes'],function(_0x4c6f90){var _0xe7d31f={};_0xe7d31f[_0x4c6f90]={'$like':'%'+_0x56dc73['query'][_0x2c10('0x3e')]+'%'};return _0xe7d31f;})});}_0x240b90=_[_0x2c10('0x3f')]({},_0x240b90,_0x56dc73[_0x2c10('0x41')]);return db[_0x2c10('0x4f')][_0x2c10('0x1f')]({'where':_0x240b90[_0x2c10('0x3c')]})[_0x2c10('0x26')](function(_0x1719b3){_0x48e365['count']=_0x1719b3;if(_0x56dc73[_0x2c10('0x33')][_0x2c10('0x42')]){_0x240b90[_0x2c10('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x2c10('0x44')](_0x240b90);})[_0x2c10('0x26')](function(_0x53f54f){_0x48e365[_0x2c10('0x51')]=_0x53f54f;return _0x48e365;});}})['then'](respondWithFilteredResult(_0x41b9dd,_0x240b90))['catch'](handleError(_0x41b9dd,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c0f475e..db96948 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 _0x81c6=['JscriptySessionReport','util','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x18c11f,_0x58c569){var _0x10e9d6=function(_0x7b7848){while(--_0x7b7848){_0x18c11f['push'](_0x18c11f['shift']());}};_0x10e9d6(++_0x58c569);}(_0x81c6,0x1d5));var _0x681c=function(_0x23d160,_0x15e4dc){_0x23d160=_0x23d160-0x0;var _0x5df430=_0x81c6[_0x23d160];return _0x5df430;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3baf=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x3baf,0xf7));var _0xf3ba=function(_0x392ca0,_0x41916f){_0x392ca0=_0x392ca0-0x0;var _0x289124=_0x3baf[_0x392ca0];return _0x289124;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var fs=require('fs');var path=require(_0xf3ba('0x7'));var rimraf=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var attributes=require(_0xf3ba('0xa'));module[_0xf3ba('0xb')]=function(_0x475268,_0x2e6df2){return _0x475268[_0xf3ba('0xc')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','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 3101eab..a47db28 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 _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0xe0e9ad,_0x5af9cf){var _0x1ae462=function(_0x3883af){while(--_0x3883af){_0xe0e9ad['push'](_0xe0e9ad['shift']());}};_0x1ae462(++_0x5af9cf);}(_0x8aad,0x146));var _0xd8aa=function(_0xe8e3c,_0x3ead2d){_0xe8e3c=_0xe8e3c-0x0;var _0x5d3fc1=_0x8aad[_0xe8e3c];return _0x5d3fc1;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x221140,_0x42bc3a){var _0x2e9286=function(_0xa1d870){while(--_0xa1d870){_0x221140['push'](_0x221140['shift']());}};_0x2e9286(++_0x42bc3a);}(_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')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 860f3c9..97fddc7 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 _0x394e=['./license.controller','get','index','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x394e,0x88));var _0xe394=function(_0x264659,_0x197677){_0x264659=_0x264659-0x0;var _0x1ac1a9=_0x394e[_0x264659];return _0x1ac1a9;};'use strict';var multer=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var path=require('path');var timeout=require(_0xe394('0x2'));var express=require(_0xe394('0x3'));var router=express[_0xe394('0x4')]();var fs_extra=require(_0xe394('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var controller=require(_0xe394('0x8'));router[_0xe394('0x9')]('/',controller[_0xe394('0xa')]);router[_0xe394('0xb')](_0xe394('0xc'),auth[_0xe394('0xd')](),controller[_0xe394('0xe')]);module[_0xe394('0xf')]=router; \ No newline at end of file +var _0x3f47=['/:id','isAuthenticated','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','put'];(function(_0x4ef724,_0x2eaa8f){var _0x16b426=function(_0x2c336b){while(--_0x2c336b){_0x4ef724['push'](_0x4ef724['shift']());}};_0x16b426(++_0x2eaa8f);}(_0x3f47,0x10e));var _0x73f4=function(_0x31dda1,_0x5de0b3){_0x31dda1=_0x31dda1-0x0;var _0x14445a=_0x3f47[_0x31dda1];return _0x14445a;};'use strict';var multer=require(_0x73f4('0x0'));var util=require(_0x73f4('0x1'));var path=require('path');var timeout=require(_0x73f4('0x2'));var express=require('express');var router=express[_0x73f4('0x3')]();var fs_extra=require(_0x73f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73f4('0x5'));var config=require(_0x73f4('0x6'));var controller=require(_0x73f4('0x7'));router[_0x73f4('0x8')]('/',controller['index']);router[_0x73f4('0x9')](_0x73f4('0xa'),auth[_0x73f4('0xb')](),controller[_0x73f4('0xc')]);module[_0x73f4('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index ef310eb..d539c3b 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 _0x62f4=['STRING','sequelize','TEXT'];(function(_0x46f2e5,_0x2f8ae6){var _0x5e8c34=function(_0x254a70){while(--_0x254a70){_0x46f2e5['push'](_0x46f2e5['shift']());}};_0x5e8c34(++_0x2f8ae6);}(_0x62f4,0xc4));var _0x462f=function(_0x1ab6c5,_0x42c96f){_0x1ab6c5=_0x1ab6c5-0x0;var _0x2c222d=_0x62f4[_0x1ab6c5];return _0x2c222d;};'use strict';var Sequelize=require(_0x462f('0x0'));module['exports']={'license':{'type':Sequelize[_0x462f('0x1')]},'data1':{'type':Sequelize[_0x462f('0x2')]},'data2':{'type':Sequelize[_0x462f('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8afd=['TEXT','STRING','INTEGER','sequelize'];(function(_0x4bfaeb,_0x41005d){var _0x4b582d=function(_0x2a97cc){while(--_0x2a97cc){_0x4bfaeb['push'](_0x4bfaeb['shift']());}};_0x4b582d(++_0x41005d);}(_0x8afd,0x103));var _0xd8af=function(_0x2d9cd9,_0x2d9cd7){_0x2d9cd9=_0x2d9cd9-0x0;var _0x139835=_0x8afd[_0x2d9cd9];return _0x139835;};'use strict';var Sequelize=require(_0xd8af('0x0'));module['exports']={'license':{'type':Sequelize[_0xd8af('0x1')]},'data1':{'type':Sequelize[_0xd8af('0x2')]},'data2':{'type':Sequelize[_0xd8af('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd8af('0x3')],'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 1099350..3eed6ab 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 _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x472f91,_0x2c1349){var _0x10e363=function(_0x172f90){while(--_0x172f90){_0x472f91['push'](_0x472f91['shift']());}};_0x10e363(++_0x2c1349);}(_0xabce,0x103));var _0xeabc=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xabce[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));}; \ No newline at end of file +var _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x42cc58,_0x5a4760){var _0x5ca9cb=function(_0xf46e9b){while(--_0xf46e9b){_0x42cc58['push'](_0x42cc58['shift']());}};_0x5ca9cb(++_0x5a4760);}(_0x7a54,0x106));var _0x47a5=function(_0x35c164,_0x6b2630){_0x35c164=_0x35c164-0x0;var _0x4e9dc6=_0x7a54[_0x35c164];return _0x4e9dc6;};'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);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e60f728..381ce8e 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 _0x1133=['util','api','request-promise','path','rimraf','../../config/environment','exports','define','License','license','lodash'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0x1133,0xfc));var _0x3113=function(_0x1706aa,_0x38137e){_0x1706aa=_0x1706aa-0x0;var _0x5e9431=_0x1133[_0x1706aa];return _0x5e9431;};'use strict';var _=require(_0x3113('0x0'));var util=require(_0x3113('0x1'));var logger=require('../../config/logger')(_0x3113('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3113('0x3'));var fs=require('fs');var path=require(_0x3113('0x4'));var rimraf=require(_0x3113('0x5'));var config=require(_0x3113('0x6'));var attributes=require('./license.attributes');module[_0x3113('0x7')]=function(_0x3ef1fa,_0x1f8936){return _0x3ef1fa[_0x3113('0x8')](_0x3113('0x9'),attributes,{'tableName':_0x3113('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5d8=['moment','bluebird','request-promise','path','rimraf','define','License','lodash'];(function(_0x290fb0,_0x1ce971){var _0x2cbd11=function(_0x69c411){while(--_0x69c411){_0x290fb0['push'](_0x290fb0['shift']());}};_0x2cbd11(++_0x1ce971);}(_0xc5d8,0x117));var _0x8c5d=function(_0x223a7c,_0x11ebdc){_0x223a7c=_0x223a7c-0x0;var _0x22e78a=_0xc5d8[_0x223a7c];return _0x22e78a;};'use strict';var _=require(_0x8c5d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8c5d('0x1'));var BPromise=require(_0x8c5d('0x2'));var rp=require(_0x8c5d('0x3'));var fs=require('fs');var path=require(_0x8c5d('0x4'));var rimraf=require(_0x8c5d('0x5'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x2fa477,_0x3aa9b1){return _0x2fa477[_0x8c5d('0x6')](_0x8c5d('0x7'),attributes,{'tableName':'license','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 3de3a21..318143e 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 _0xf3b7=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','License,\x20%s,\x20%s','message'];(function(_0x321ff5,_0x4aa227){var _0x370a32=function(_0x1b2d06){while(--_0x1b2d06){_0x321ff5['push'](_0x321ff5['shift']());}};_0x370a32(++_0x4aa227);}(_0xf3b7,0x144));var _0x7f3b=function(_0x9ace85,_0x405e2d){_0x9ace85=_0x9ace85-0x0;var _0x51e80b=_0xf3b7[_0x9ace85];return _0x51e80b;};'use strict';var _=require(_0x7f3b('0x0'));var util=require(_0x7f3b('0x1'));var moment=require(_0x7f3b('0x2'));var BPromise=require(_0x7f3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f3b('0x4'))['db'];var utils=require(_0x7f3b('0x5'));var logger=require(_0x7f3b('0x6'))(_0x7f3b('0x7'));var config=require(_0x7f3b('0x8'));var jayson=require(_0x7f3b('0x9'));var client=jayson['client'][_0x7f3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29acab,_0x231e55,_0x50c68c){return new BPromise(function(_0x123113,_0x2cefd0){return client[_0x7f3b('0xb')](_0x29acab,_0x50c68c)[_0x7f3b('0xc')](function(_0x5518a8){logger[_0x7f3b('0xd')]('License,\x20%s,\x20%s',_0x231e55,'request\x20sent');logger[_0x7f3b('0xe')](_0x7f3b('0xf'),_0x231e55,_0x7f3b('0x10'),JSON['stringify'](_0x5518a8));if(_0x5518a8['error']){if(_0x5518a8[_0x7f3b('0x11')][_0x7f3b('0x12')]===0x1f4){logger[_0x7f3b('0x11')](_0x7f3b('0x13'),_0x231e55,_0x5518a8[_0x7f3b('0x11')][_0x7f3b('0x14')]);return _0x2cefd0(_0x5518a8[_0x7f3b('0x11')][_0x7f3b('0x14')]);}logger[_0x7f3b('0x11')](_0x7f3b('0x13'),_0x231e55,_0x5518a8[_0x7f3b('0x11')][_0x7f3b('0x14')]);return _0x123113(_0x5518a8['error'][_0x7f3b('0x14')]);}else{logger[_0x7f3b('0xd')](_0x7f3b('0x13'),_0x231e55,_0x7f3b('0x10'));_0x123113(_0x5518a8[_0x7f3b('0x15')][_0x7f3b('0x14')]);}})[_0x7f3b('0x16')](function(_0x431457){logger[_0x7f3b('0x11')](_0x7f3b('0x13'),_0x231e55,_0x431457);_0x2cefd0(_0x431457);});});} \ No newline at end of file +var _0x615d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x430ba3,_0x5e4bf5){var _0x18f158=function(_0x5e0dae){while(--_0x5e0dae){_0x430ba3['push'](_0x430ba3['shift']());}};_0x18f158(++_0x5e4bf5);}(_0x615d,0x8e));var _0xd615=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x615d[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0xd615('0x0'));var util=require(_0xd615('0x1'));var moment=require(_0xd615('0x2'));var BPromise=require(_0xd615('0x3'));var rs=require(_0xd615('0x4'));var fs=require('fs');var Redis=require(_0xd615('0x5'));var db=require(_0xd615('0x6'))['db'];var utils=require(_0xd615('0x7'));var logger=require(_0xd615('0x8'))(_0xd615('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd615('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53caff,_0x1dd555,_0x27b0eb){return new BPromise(function(_0x3a92bf,_0x2d3f5b){return client['request'](_0x53caff,_0x27b0eb)[_0xd615('0xb')](function(_0xd49990){logger[_0xd615('0xc')](_0xd615('0xd'),_0x1dd555,'request\x20sent');logger['debug'](_0xd615('0xe'),_0x1dd555,_0xd615('0xf'),JSON[_0xd615('0x10')](_0xd49990));if(_0xd49990[_0xd615('0x11')]){if(_0xd49990[_0xd615('0x11')][_0xd615('0x12')]===0x1f4){logger['error'](_0xd615('0xd'),_0x1dd555,_0xd49990[_0xd615('0x11')]['message']);return _0x2d3f5b(_0xd49990['error'][_0xd615('0x13')]);}logger[_0xd615('0x11')](_0xd615('0xd'),_0x1dd555,_0xd49990[_0xd615('0x11')][_0xd615('0x13')]);return _0x3a92bf(_0xd49990[_0xd615('0x11')][_0xd615('0x13')]);}else{logger[_0xd615('0xc')](_0xd615('0xd'),_0x1dd555,_0xd615('0xf'));_0x3a92bf(_0xd49990['result'][_0xd615('0x13')]);}})[_0xd615('0x14')](function(_0x23cdfd){logger[_0xd615('0x11')]('License,\x20%s,\x20%s',_0x1dd555,_0x23cdfd);_0x2d3f5b(_0x23cdfd);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 71d55ec..d64a15e 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 _0x918e=['removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/dispositions','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','addDisposition','/:id/canned_answers','addAnswer','post','/:id/in_servers','addImap','addSmtp','addInteraction','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap'];(function(_0x57b194,_0x5742aa){var _0x53c12=function(_0x3befc5){while(--_0x3befc5){_0x57b194['push'](_0x57b194['shift']());}};_0x53c12(++_0x5742aa);}(_0x918e,0x17b));var _0xe918=function(_0x45e635,_0x376349){_0x45e635=_0x45e635-0x0;var _0x32e70e=_0x918e[_0x45e635];return _0x32e70e;};'use strict';var multer=require(_0xe918('0x0'));var util=require(_0xe918('0x1'));var path=require(_0xe918('0x2'));var timeout=require(_0xe918('0x3'));var express=require(_0xe918('0x4'));var router=express[_0xe918('0x5')]();var fs_extra=require(_0xe918('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe918('0x7'));var config=require(_0xe918('0x8'));var controller=require('./mailAccount.controller');router[_0xe918('0x9')]('/',auth[_0xe918('0xa')](),controller[_0xe918('0xb')]);router[_0xe918('0x9')](_0xe918('0xc'),auth[_0xe918('0xa')](),controller['describe']);router[_0xe918('0x9')]('/:id',auth[_0xe918('0xa')](),controller[_0xe918('0xd')]);router[_0xe918('0x9')](_0xe918('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe918('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe918('0xf')]);router[_0xe918('0x9')]('/:id/in_servers',auth[_0xe918('0xa')](),controller[_0xe918('0x10')]);router[_0xe918('0x9')](_0xe918('0x11'),auth[_0xe918('0xa')](),controller[_0xe918('0x12')]);router[_0xe918('0x9')](_0xe918('0x13'),auth[_0xe918('0xa')](),controller[_0xe918('0x14')]);router['get'](_0xe918('0x15'),auth[_0xe918('0xa')](),controller[_0xe918('0x16')]);router[_0xe918('0x9')](_0xe918('0x17'),auth[_0xe918('0xa')](),controller[_0xe918('0x18')]);router[_0xe918('0x9')]('/:id/verify',auth[_0xe918('0xa')](),controller['verifySmtp']);router[_0xe918('0x9')](_0xe918('0x19'),auth['isAuthenticated'](),controller[_0xe918('0x1a')]);router['post']('/:id/dispositions',auth[_0xe918('0xa')](),controller[_0xe918('0x1b')]);router['post'](_0xe918('0x1c'),auth['isAuthenticated'](),controller[_0xe918('0x1d')]);router[_0xe918('0x1e')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe918('0x1e')](_0xe918('0x1f'),auth[_0xe918('0xa')](),controller[_0xe918('0x20')]);router[_0xe918('0x1e')](_0xe918('0x11'),auth['isAuthenticated'](),controller[_0xe918('0x21')]);router[_0xe918('0x1e')]('/:id/interactions',auth[_0xe918('0xa')](),controller[_0xe918('0x22')]);router[_0xe918('0x1e')](_0xe918('0x15'),auth[_0xe918('0xa')](),controller['addApplications']);router['post']('/:id/send',auth[_0xe918('0xa')](),controller[_0xe918('0x23')]);router['post'](_0xe918('0x19'),auth[_0xe918('0xa')](),controller[_0xe918('0x24')]);router[_0xe918('0x25')](_0xe918('0x26'),auth['isAuthenticated'](),controller[_0xe918('0x27')]);router[_0xe918('0x28')]('/:id/dispositions',auth[_0xe918('0xa')](),controller[_0xe918('0x29')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe918('0x2a')]);router[_0xe918('0x28')]('/:id/in_servers',auth[_0xe918('0xa')](),controller[_0xe918('0x2b')]);router['delete'](_0xe918('0x11'),auth[_0xe918('0xa')](),controller[_0xe918('0x2c')]);router['delete'](_0xe918('0x26'),auth['isAuthenticated'](),controller['destroy']);router[_0xe918('0x28')](_0xe918('0x19'),auth[_0xe918('0xa')](),controller[_0xe918('0x2d')]);module[_0xe918('0x2e')]=router; \ No newline at end of file +var _0x4b36=['addSmtp','addInteraction','addApplications','send','/:id/users','addAgents','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','addDisposition','post','addAnswer','create','addImap','/:id/out_servers'];(function(_0x515307,_0x2afe3b){var _0x30aaad=function(_0x1adf4e){while(--_0x1adf4e){_0x515307['push'](_0x515307['shift']());}};_0x30aaad(++_0x2afe3b);}(_0x4b36,0x1e1));var _0x64b3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x4b36[_0x2aec52];return _0x3b8835;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x64b3('0x0'));var timeout=require(_0x64b3('0x1'));var express=require(_0x64b3('0x2'));var router=express[_0x64b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x64b3('0x4'));var interaction=require(_0x64b3('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x64b3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x64b3('0x6')](_0x64b3('0x7'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x9')]);router[_0x64b3('0x6')](_0x64b3('0xa'),auth[_0x64b3('0x8')](),controller['show']);router[_0x64b3('0x6')](_0x64b3('0xb'),auth[_0x64b3('0x8')](),controller['getDispositions']);router[_0x64b3('0x6')](_0x64b3('0xc'),auth[_0x64b3('0x8')](),controller['getAnswers']);router[_0x64b3('0x6')](_0x64b3('0xd'),auth[_0x64b3('0x8')](),controller[_0x64b3('0xe')]);router[_0x64b3('0x6')]('/:id/out_servers',auth[_0x64b3('0x8')](),controller['getSmtp']);router[_0x64b3('0x6')](_0x64b3('0xf'),auth[_0x64b3('0x8')](),controller['getInteractions']);router['get'](_0x64b3('0x10'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x11')]);router[_0x64b3('0x6')](_0x64b3('0x12'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x13')]);router[_0x64b3('0x6')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0x64b3('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post'](_0x64b3('0xb'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x14')]);router[_0x64b3('0x15')](_0x64b3('0xc'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x16')]);router[_0x64b3('0x15')]('/',auth['isAuthenticated'](),controller[_0x64b3('0x17')]);router[_0x64b3('0x15')](_0x64b3('0xd'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x18')]);router[_0x64b3('0x15')](_0x64b3('0x19'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x1a')]);router[_0x64b3('0x15')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x64b3('0x1b')]);router['post'](_0x64b3('0x10'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x1c')]);router[_0x64b3('0x15')]('/:id/send',auth['isAuthenticated'](),controller[_0x64b3('0x1d')]);router[_0x64b3('0x15')](_0x64b3('0x1e'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x1f')]);router['put'](_0x64b3('0xa'),auth[_0x64b3('0x8')](),controller['update']);router[_0x64b3('0x20')](_0x64b3('0xb'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x21')]);router[_0x64b3('0x20')]('/:id/canned_answers',auth[_0x64b3('0x8')](),controller[_0x64b3('0x22')]);router[_0x64b3('0x20')]('/:id/in_servers',auth[_0x64b3('0x8')](),controller[_0x64b3('0x23')]);router[_0x64b3('0x20')]('/:id/out_servers',auth[_0x64b3('0x8')](),controller[_0x64b3('0x24')]);router[_0x64b3('0x20')](_0x64b3('0xa'),auth[_0x64b3('0x8')](),controller[_0x64b3('0x25')]);router[_0x64b3('0x20')](_0x64b3('0x1e'),auth['isAuthenticated'](),controller[_0x64b3('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2d68194..11381ac 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 _0x66fa=['sequelize','exports','STRING','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'];(function(_0x5ce074,_0x383b63){var _0x231c06=function(_0x3e36e5){while(--_0x3e36e5){_0x5ce074['push'](_0x5ce074['shift']());}};_0x231c06(++_0x383b63);}(_0x66fa,0x168));var _0xa66f=function(_0x208806,_0x43eda7){_0x208806=_0x208806-0x0;var _0x3ccd2b=_0x66fa[_0x208806];return _0x3ccd2b;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'description':{'type':Sequelize[_0xa66f('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa66f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa66f('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xa66f('0x4')]},'markAsUnread':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa66f('0x2')],'allowNull':![],'defaultValue':_0xa66f('0x5')},'fontSize':{'type':Sequelize[_0xa66f('0x6')](0x2)[_0xa66f('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa66f('0x4')],'defaultValue':function(){return _0xa66f('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa66f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa66f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa66f('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa66f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![],'comment':_0xa66f('0xa'),'set':function(_0x42f064){if(!_0x42f064)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa66f('0xb')]('mandatoryDisposition',_0x42f064);}}}; \ No newline at end of file +var _0x4b84=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','BOOLEAN','STRING','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER'];(function(_0x424f49,_0x10ed6b){var _0x44cde1=function(_0x3ce371){while(--_0x3ce371){_0x424f49['push'](_0x424f49['shift']());}};_0x44cde1(++_0x10ed6b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x4b84[_0x420f2a];return _0x28f802;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x44b8('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x44b8('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x44b8('0x4')]},'markAsUnread':{'type':Sequelize[_0x44b8('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x44b8('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x44b8('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x44b8('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x44b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44b8('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x44b8('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x44b8('0x2')],'defaultValue':![],'comment':_0x44b8('0x9'),'set':function(_0x9b6048){if(!_0x9b6048)this[_0x44b8('0xa')](_0x44b8('0xb'),null);this[_0x44b8('0xa')]('mandatoryDisposition',_0x9b6048);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f64123b..e338dd2 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 _0x6156=['removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','color','tag','sequelize','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','split','format','inlineCss','true','CmList','Contacts','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','SendMail','sendMail','List\x20not\x20found','List','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','secure','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','ids','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','MailAccounts','end','sendStatus','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','map','MailAccount','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','show','params','mandatoryDispositionPause','rawAttributes','includeAll','options','body','find','update','describe','addDisposition','Disposition','create','getDispositions','length','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','findAll','rows','removeAnswers','email','ListId','isNil','active','cauthentication','user','cuser','password','pass','cpassword','authentication','port','host','service','cservice','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6156,0x1dd));var _0x6615=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6156[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x6615('0x0'));var rimraf=require(_0x6615('0x1'));var zipdir=require(_0x6615('0x2'));var jsonpatch=require(_0x6615('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6615('0x4'));var Mustache=require(_0x6615('0x5'));var util=require('util');var path=require(_0x6615('0x6'));var sox=require(_0x6615('0x7'));var csv=require(_0x6615('0x8'));var ejs=require(_0x6615('0x9'));var fs=require('fs');var fs_extra=require(_0x6615('0xa'));var _=require(_0x6615('0xb'));var squel=require(_0x6615('0xc'));var crypto=require(_0x6615('0xd'));var jsforce=require(_0x6615('0xe'));var deskjs=require(_0x6615('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6615('0x10'));var Papa=require(_0x6615('0x11'));var htmlToText=require(_0x6615('0x12'));var juice=require(_0x6615('0x13'));var Redis=require(_0x6615('0x14'));var authService=require(_0x6615('0x15'));var qs=require(_0x6615('0x16'));var as=require(_0x6615('0x17'));var hardwareService=require(_0x6615('0x18'));var logger=require(_0x6615('0x19'))(_0x6615('0x1a'));var utils=require(_0x6615('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x6615('0x1c'));var db=require(_0x6615('0x1d'))['db'];config[_0x6615('0x1e')]=_[_0x6615('0x1f')](config[_0x6615('0x1e')],{'host':_0x6615('0x20'),'port':0x18eb});var socket=require(_0x6615('0x21'))(new Redis(config[_0x6615('0x1e')]));require('./mailAccount.socket')[_0x6615('0x22')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6615('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x596740,_0x1978af,_0xcb8d,_0x187665){return new BPromise(function(_0xda1fa9,_0x2a8998){var _0x5ccc17=_0x187665||client;return _0x5ccc17[_0x6615('0x24')](_0x596740,_0xcb8d)[_0x6615('0x25')](function(_0x57c66c){logger[_0x6615('0x26')](_0x6615('0x27'),_0x1978af,'request\x20sent');logger[_0x6615('0x28')](_0x6615('0x29'),_0x1978af,_0x6615('0x2a'),JSON[_0x6615('0x2b')](_0x57c66c));if(_0x57c66c[_0x6615('0x2c')]){if(_0x57c66c[_0x6615('0x2c')][_0x6615('0x2d')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1978af,_0x57c66c['error']['message']);return _0x2a8998(_0x57c66c['error'][_0x6615('0x2e')]);}logger[_0x6615('0x2c')](_0x6615('0x27'),_0x1978af,_0x57c66c[_0x6615('0x2c')][_0x6615('0x2e')]);return _0xda1fa9(_0x57c66c[_0x6615('0x2c')][_0x6615('0x2e')]);}else{logger[_0x6615('0x26')](_0x6615('0x27'),_0x1978af,_0x6615('0x2a'));_0xda1fa9(_0x57c66c[_0x6615('0x2f')]['message']);}})[_0x6615('0x30')](function(_0x252de6){logger[_0x6615('0x2c')]('MailAccount,\x20%s,\x20%s',_0x1978af,_0x252de6);_0x2a8998(_0x252de6);});});}function respondWithStatusCode(_0x147537,_0x362ef4){_0x362ef4=_0x362ef4||0xcc;return function(_0x40ea65){if(_0x40ea65){return _0x147537['sendStatus'](_0x362ef4);}return _0x147537[_0x6615('0x31')](_0x362ef4)['end']();};}function respondWithResult(_0x4383b2,_0x1d58d2){_0x1d58d2=_0x1d58d2||0xc8;return function(_0x7b8716){if(_0x7b8716){return _0x4383b2[_0x6615('0x31')](_0x1d58d2)['json'](_0x7b8716);}};}function respondWithFilteredResult(_0x20b2ed,_0x2c880d){return function(_0x300bbe){if(_0x300bbe){var _0x377765=typeof _0x2c880d[_0x6615('0x32')]===_0x6615('0x33')&&typeof _0x2c880d[_0x6615('0x34')]===_0x6615('0x33');var _0x33835e=_0x300bbe[_0x6615('0x35')];var _0x542ebc=_0x377765?0x0:_0x2c880d[_0x6615('0x32')];var _0x3e4888=_0x377765?_0x300bbe[_0x6615('0x35')]:_0x2c880d[_0x6615('0x32')]+_0x2c880d[_0x6615('0x34')];var _0x207e77;if(_0x3e4888>=_0x33835e){_0x3e4888=_0x33835e;_0x207e77=0xc8;}else{_0x207e77=0xce;}_0x20b2ed['status'](_0x207e77);return _0x20b2ed[_0x6615('0x36')](_0x6615('0x37'),_0x542ebc+'-'+_0x3e4888+'/'+_0x33835e)[_0x6615('0x38')](_0x300bbe);}return null;};}function patchUpdates(_0x4921e5){return function(_0x5b4d7b){try{jsonpatch[_0x6615('0x39')](_0x5b4d7b,_0x4921e5,!![]);}catch(_0x31b243){return BPromise[_0x6615('0x3a')](_0x31b243);}return _0x5b4d7b[_0x6615('0x3b')]();};}function saveUpdates(_0x45c756,_0x35a958){return function(_0x4928a6){if(_0x4928a6){return _0x4928a6['update'](_0x45c756)[_0x6615('0x25')](function(_0x235cc0){return _0x235cc0;});}return null;};}function removeEntity(_0x4cb12d,_0xff210){return function(_0x173624){if(_0x173624){return _0x173624[_0x6615('0x3c')]()[_0x6615('0x25')](function(){var _0x4adfcd=_0x173624['get']({'plain':!![]});var _0x5c5f73=_0x6615('0x3d');return db['UserProfileResource'][_0x6615('0x3c')]({'where':{'type':_0x5c5f73,'resourceId':_0x4adfcd['id']}})[_0x6615('0x25')](function(){return _0x173624;});})[_0x6615('0x25')](function(){_0x4cb12d[_0x6615('0x31')](0xcc)[_0x6615('0x3e')]();});}};}function handleEntityNotFound(_0x545ea8,_0x5965f9){return function(_0x4882e4){if(!_0x4882e4){_0x545ea8[_0x6615('0x3f')](0x194);}return _0x4882e4;};}function handleError(_0x3fa132,_0x5b02a6){_0x5b02a6=_0x5b02a6||0x1f4;return function(_0x1df610){logger[_0x6615('0x2c')](_0x1df610[_0x6615('0x40')]);if(_0x1df610[_0x6615('0x41')]){delete _0x1df610[_0x6615('0x41')];}_0x3fa132[_0x6615('0x31')](_0x5b02a6)['send'](_0x1df610);};}exports[_0x6615('0x42')]=function(_0x43766f,_0x212952){var _0x43a7e9={'include':[{'model':db[_0x6615('0x43')],'as':_0x6615('0x44')},{'model':db[_0x6615('0x45')],'as':_0x6615('0x46')},{'model':db[_0x6615('0x47')],'as':'mandatoryDispositionPause'}]},_0x44b142={},_0x60539f={'count':0x0,'rows':[]};var _0x522b79=_[_0x6615('0x48')](db[_0x6615('0x49')]['rawAttributes'],function(_0x34ce1c){return{'name':_0x34ce1c['fieldName'],'type':_0x34ce1c[_0x6615('0x4a')][_0x6615('0x4b')]};});_0x44b142[_0x6615('0x4c')]=_[_0x6615('0x48')](_0x522b79,_0x6615('0x41'));_0x44b142[_0x6615('0x4d')]=_[_0x6615('0x4e')](_0x43766f[_0x6615('0x4d')]);_0x44b142[_0x6615('0x4f')]=_[_0x6615('0x50')](_0x44b142[_0x6615('0x4c')],_0x44b142[_0x6615('0x4d')]);_0x43a7e9[_0x6615('0x51')]=_[_0x6615('0x50')](_0x44b142['model'],qs[_0x6615('0x52')](_0x43766f[_0x6615('0x4d')]['fields']));_0x43a7e9[_0x6615('0x51')]=_0x43a7e9[_0x6615('0x51')]['length']?_0x43a7e9['attributes']:_0x44b142[_0x6615('0x4c')];if(!_0x43766f[_0x6615('0x4d')]['hasOwnProperty'](_0x6615('0x53'))){_0x43a7e9[_0x6615('0x34')]=qs[_0x6615('0x34')](_0x43766f[_0x6615('0x4d')][_0x6615('0x34')]);_0x43a7e9[_0x6615('0x32')]=qs['offset'](_0x43766f[_0x6615('0x4d')][_0x6615('0x32')]);}_0x43a7e9[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x43766f[_0x6615('0x4d')][_0x6615('0x55')]);_0x43a7e9[_0x6615('0x56')]=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x43766f['query'],_0x44b142['filters']),_0x522b79);if(_0x43766f[_0x6615('0x4d')][_0x6615('0x58')]){_0x43a7e9['where']=_[_0x6615('0x59')](_0x43a7e9[_0x6615('0x56')],{'$or':_['map'](_0x522b79,function(_0x29f019){if(_0x29f019[_0x6615('0x4a')]!==_0x6615('0x5a')){var _0x5dc093={};_0x5dc093[_0x29f019[_0x6615('0x41')]]={'$like':'%'+_0x43766f[_0x6615('0x4d')]['filter']+'%'};return _0x5dc093;}})});}_0x43a7e9=_[_0x6615('0x59')]({},_0x43a7e9,_0x43766f['options']);var _0x1e5639={'where':_0x43a7e9[_0x6615('0x56')]};return db['MailAccount'][_0x6615('0x35')](_0x1e5639)[_0x6615('0x25')](function(_0x5890b8){_0x60539f['count']=_0x5890b8;if(_0x43766f[_0x6615('0x4d')]['includeAll']){_0x43a7e9[_0x6615('0x5b')]=[{'all':!![]}];}return db[_0x6615('0x49')]['findAll'](_0x43a7e9);})[_0x6615('0x25')](function(_0x6e6eca){_0x60539f['rows']=_0x6e6eca;return _0x60539f;})[_0x6615('0x25')](respondWithFilteredResult(_0x212952,_0x43a7e9))['catch'](handleError(_0x212952,null));};exports[_0x6615('0x5c')]=function(_0x165af5,_0x24091e){var _0xdfb7f8={'raw':![],'where':{'id':_0x165af5[_0x6615('0x5d')]['id']},'include':[{'model':db[_0x6615('0x43')],'as':_0x6615('0x44')},{'model':db[_0x6615('0x45')],'as':'Smtp'},{'model':db['Pause'],'as':_0x6615('0x5e')}]},_0x38c810={};_0x38c810[_0x6615('0x4c')]=_[_0x6615('0x4e')](db[_0x6615('0x49')][_0x6615('0x5f')]);_0x38c810[_0x6615('0x4d')]=_[_0x6615('0x4e')](_0x165af5[_0x6615('0x4d')]);_0x38c810['filters']=_[_0x6615('0x50')](_0x38c810[_0x6615('0x4c')],_0x38c810['query']);_0xdfb7f8[_0x6615('0x51')]=_[_0x6615('0x50')](_0x38c810[_0x6615('0x4c')],qs[_0x6615('0x52')](_0x165af5[_0x6615('0x4d')][_0x6615('0x52')]));_0xdfb7f8[_0x6615('0x51')]=_0xdfb7f8['attributes']['length']?_0xdfb7f8[_0x6615('0x51')]:_0x38c810[_0x6615('0x4c')];if(_0x165af5[_0x6615('0x4d')][_0x6615('0x60')]){_0xdfb7f8[_0x6615('0x5b')]=[{'all':!![]}];}_0xdfb7f8=_['merge']({},_0xdfb7f8,_0x165af5[_0x6615('0x61')]);return db['MailAccount']['find'](_0xdfb7f8)[_0x6615('0x25')](handleEntityNotFound(_0x24091e,null))[_0x6615('0x25')](respondWithResult(_0x24091e,null))[_0x6615('0x30')](handleError(_0x24091e,null));};exports['update']=function(_0x369b7e,_0x22b88e){if(_0x369b7e[_0x6615('0x62')]['id']){delete _0x369b7e['body']['id'];}return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x369b7e[_0x6615('0x5d')]['id']},'include':[{'model':db[_0x6615('0x43')],'as':_0x6615('0x44')},{'model':db[_0x6615('0x45')],'as':_0x6615('0x46')},{'model':db['Pause'],'as':_0x6615('0x5e')}]})[_0x6615('0x25')](handleEntityNotFound(_0x22b88e,null))[_0x6615('0x25')](saveUpdates(_0x369b7e[_0x6615('0x62')],null))[_0x6615('0x25')](function(_0x1d58d7){if(_0x1d58d7&&_0x369b7e[_0x6615('0x62')][_0x6615('0x44')]){return db[_0x6615('0x43')][_0x6615('0x64')](_0x369b7e[_0x6615('0x62')][_0x6615('0x44')],{'where':{'MailAccountId':_0x1d58d7['id']}})[_0x6615('0x25')](function(){return _0x1d58d7;});}return _0x1d58d7;})[_0x6615('0x25')](function(_0x7dd67d){if(_0x7dd67d&&_0x369b7e['body'][_0x6615('0x46')]){return db['MailServerOut'][_0x6615('0x64')](_0x369b7e[_0x6615('0x62')]['Smtp'],{'where':{'MailAccountId':_0x7dd67d['id']}})[_0x6615('0x25')](function(){return _0x7dd67d;});}return _0x7dd67d;})[_0x6615('0x25')](respondWithResult(_0x22b88e,null))[_0x6615('0x30')](handleError(_0x22b88e,null));};exports['describe']=function(_0x41cb37,_0x23b6f5){return db[_0x6615('0x49')][_0x6615('0x65')]()[_0x6615('0x25')](respondWithResult(_0x23b6f5,null))[_0x6615('0x30')](handleError(_0x23b6f5,null));};exports[_0x6615('0x66')]=function(_0x1ab720,_0x7aac9a,_0x3b705d){if(_0x1ab720[_0x6615('0x62')]['id']){delete _0x1ab720[_0x6615('0x62')]['id'];}return db[_0x6615('0x49')]['find']({'where':{'id':_0x1ab720[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x7aac9a,null))['then'](function(_0x32692e){if(_0x32692e){_0x1ab720[_0x6615('0x62')]['MailAccountId']=_0x32692e['id'];return db[_0x6615('0x67')][_0x6615('0x68')](_0x1ab720[_0x6615('0x62')]);}})['then'](respondWithResult(_0x7aac9a,null))[_0x6615('0x30')](handleError(_0x7aac9a,null));};exports[_0x6615('0x69')]=function(_0x573852,_0x4bd03b,_0x502795){var _0x3dbef0={'raw':![],'where':{}};var _0x41d98d={};var _0xe4838c={'count':0x0,'rows':[]};return db[_0x6615('0x49')]['findOne']({'where':{'id':_0x573852[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x4bd03b,null))[_0x6615('0x25')](function(_0x3b1e83){if(_0x3b1e83){_0x41d98d[_0x6615('0x4c')]=_[_0x6615('0x4e')](db['Disposition'][_0x6615('0x5f')]);_0x41d98d[_0x6615('0x4d')]=_[_0x6615('0x4e')](_0x573852[_0x6615('0x4d')]);_0x41d98d['filters']=_[_0x6615('0x50')](_0x41d98d[_0x6615('0x4c')],_0x41d98d[_0x6615('0x4d')]);_0x3dbef0[_0x6615('0x51')]=_[_0x6615('0x50')](_0x41d98d[_0x6615('0x4c')],qs[_0x6615('0x52')](_0x573852[_0x6615('0x4d')][_0x6615('0x52')]));_0x3dbef0[_0x6615('0x51')]=_0x3dbef0[_0x6615('0x51')][_0x6615('0x6a')]?_0x3dbef0[_0x6615('0x51')]:_0x41d98d[_0x6615('0x4c')];if(!_0x573852[_0x6615('0x4d')]['hasOwnProperty']('nolimit')){_0x3dbef0[_0x6615('0x34')]=qs[_0x6615('0x34')](_0x573852['query'][_0x6615('0x34')]);_0x3dbef0[_0x6615('0x32')]=qs[_0x6615('0x32')](_0x573852[_0x6615('0x4d')][_0x6615('0x32')]);}_0x3dbef0['order']=qs[_0x6615('0x55')](_0x573852[_0x6615('0x4d')][_0x6615('0x55')]);_0x3dbef0[_0x6615('0x56')]=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x573852[_0x6615('0x4d')],_0x41d98d[_0x6615('0x4f')]));_0x3dbef0[_0x6615('0x56')][_0x6615('0x6b')]=_0x3b1e83['id'];if(_0x573852[_0x6615('0x4d')][_0x6615('0x58')]){_0x3dbef0[_0x6615('0x56')]=_[_0x6615('0x59')](_0x3dbef0[_0x6615('0x56')],{'$or':_[_0x6615('0x48')](_0x3dbef0[_0x6615('0x51')],function(_0x5d575f){var _0x49bcbe={};_0x49bcbe[_0x5d575f]={'$like':'%'+_0x573852[_0x6615('0x4d')][_0x6615('0x58')]+'%'};return _0x49bcbe;})});}_0x3dbef0=_[_0x6615('0x59')]({},_0x3dbef0,_0x573852[_0x6615('0x61')]);return db[_0x6615('0x67')][_0x6615('0x35')]({'where':_0x3dbef0['where']})[_0x6615('0x25')](function(_0x47ff28){_0xe4838c[_0x6615('0x35')]=_0x47ff28;if(_0x573852['query'][_0x6615('0x60')]){_0x3dbef0[_0x6615('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3dbef0);})['then'](function(_0x3acefb){_0xe4838c['rows']=_0x3acefb;return _0xe4838c;});}})['then'](respondWithFilteredResult(_0x4bd03b,_0x3dbef0))[_0x6615('0x30')](handleError(_0x4bd03b,null));};exports[_0x6615('0x6c')]=function(_0x4601e1,_0x466476,_0x36ca44){return db[_0x6615('0x49')]['find']({'where':{'id':_0x4601e1['params']['id']}})['then'](handleEntityNotFound(_0x466476,null))['then'](function(_0x46893d){if(_0x46893d){return _0x46893d[_0x6615('0x6c')](_0x4601e1[_0x6615('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x466476,null))[_0x6615('0x30')](handleError(_0x466476,null));};exports[_0x6615('0x6d')]=function(_0x5703af,_0x546fe8,_0x1c1463){if(_0x5703af[_0x6615('0x62')]['id']){delete _0x5703af[_0x6615('0x62')]['id'];}return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x5703af[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x546fe8,null))[_0x6615('0x25')](function(_0x3aa81d){if(_0x3aa81d){_0x5703af[_0x6615('0x62')][_0x6615('0x6b')]=_0x3aa81d['id'];return db[_0x6615('0x6e')][_0x6615('0x68')](_0x5703af[_0x6615('0x62')]);}})['then'](respondWithResult(_0x546fe8,null))[_0x6615('0x30')](handleError(_0x546fe8,null));};exports[_0x6615('0x6f')]=function(_0x49103a,_0x3c9380,_0x4b87c1){var _0x480dea={'raw':![],'where':{}};var _0x4b314c={};var _0x436051={'count':0x0,'rows':[]};return db[_0x6615('0x49')][_0x6615('0x70')]({'where':{'id':_0x49103a[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x3c9380,null))['then'](function(_0x41392c){if(_0x41392c){_0x4b314c[_0x6615('0x4c')]=_['keys'](db[_0x6615('0x6e')][_0x6615('0x5f')]);_0x4b314c[_0x6615('0x4d')]=_['keys'](_0x49103a[_0x6615('0x4d')]);_0x4b314c['filters']=_[_0x6615('0x50')](_0x4b314c[_0x6615('0x4c')],_0x4b314c[_0x6615('0x4d')]);_0x480dea[_0x6615('0x51')]=_[_0x6615('0x50')](_0x4b314c['model'],qs['fields'](_0x49103a[_0x6615('0x4d')][_0x6615('0x52')]));_0x480dea['attributes']=_0x480dea['attributes'][_0x6615('0x6a')]?_0x480dea[_0x6615('0x51')]:_0x4b314c[_0x6615('0x4c')];if(!_0x49103a[_0x6615('0x4d')][_0x6615('0x71')](_0x6615('0x53'))){_0x480dea[_0x6615('0x34')]=qs[_0x6615('0x34')](_0x49103a[_0x6615('0x4d')]['limit']);_0x480dea[_0x6615('0x32')]=qs[_0x6615('0x32')](_0x49103a[_0x6615('0x4d')][_0x6615('0x32')]);}_0x480dea[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x49103a[_0x6615('0x4d')][_0x6615('0x55')]);_0x480dea['where']=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x49103a[_0x6615('0x4d')],_0x4b314c[_0x6615('0x4f')]));_0x480dea[_0x6615('0x56')][_0x6615('0x6b')]=_0x41392c['id'];if(_0x49103a[_0x6615('0x4d')][_0x6615('0x58')]){_0x480dea[_0x6615('0x56')]=_[_0x6615('0x59')](_0x480dea[_0x6615('0x56')],{'$or':_[_0x6615('0x48')](_0x480dea['attributes'],function(_0x217d2d){var _0x4a2b80={};_0x4a2b80[_0x217d2d]={'$like':'%'+_0x49103a[_0x6615('0x4d')][_0x6615('0x58')]+'%'};return _0x4a2b80;})});}_0x480dea=_[_0x6615('0x59')]({},_0x480dea,_0x49103a['options']);return db[_0x6615('0x6e')][_0x6615('0x35')]({'where':_0x480dea[_0x6615('0x56')]})[_0x6615('0x25')](function(_0x15257e){_0x436051[_0x6615('0x35')]=_0x15257e;if(_0x49103a[_0x6615('0x4d')]['includeAll']){_0x480dea[_0x6615('0x5b')]=[{'all':!![]}];}return db[_0x6615('0x6e')][_0x6615('0x72')](_0x480dea);})[_0x6615('0x25')](function(_0xdf1783){_0x436051[_0x6615('0x73')]=_0xdf1783;return _0x436051;});}})['then'](respondWithFilteredResult(_0x3c9380,_0x480dea))['catch'](handleError(_0x3c9380,null));};exports['removeAnswers']=function(_0x3f1aee,_0x45083e,_0x29f953){return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x3f1aee['params']['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x45083e,null))[_0x6615('0x25')](function(_0x565f93){if(_0x565f93){return _0x565f93[_0x6615('0x74')](_0x3f1aee[_0x6615('0x4d')]['ids']);}})[_0x6615('0x25')](respondWithStatusCode(_0x45083e,null))['catch'](handleError(_0x45083e,null));};exports[_0x6615('0x68')]=function(_0x2cdabc,_0x437ecf){var _0x1fd785={'name':_0x2cdabc['body'][_0x6615('0x41')],'key':_0x2cdabc[_0x6615('0x62')]['key'],'email':_0x2cdabc[_0x6615('0x62')][_0x6615('0x75')],'ListId':_0x2cdabc[_0x6615('0x62')][_0x6615('0x76')],'active':!_[_0x6615('0x77')](_0x2cdabc[_0x6615('0x62')][_0x6615('0x78')])?_0x2cdabc[_0x6615('0x62')][_0x6615('0x78')]:!![],'description':_0x2cdabc[_0x6615('0x62')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x6615('0x77')](_0x2cdabc['body']['cservice'])){if(_0x2cdabc[_0x6615('0x62')][_0x6615('0x79')]){_0x1fd785['Imap'][_0x6615('0x7a')]=_0x1fd785[_0x6615('0x46')][_0x6615('0x7a')]=_0x2cdabc['body'][_0x6615('0x7b')];_0x1fd785[_0x6615('0x44')][_0x6615('0x7c')]=_0x1fd785[_0x6615('0x46')][_0x6615('0x7d')]=_0x2cdabc[_0x6615('0x62')][_0x6615('0x7e')];}else{_0x1fd785[_0x6615('0x44')][_0x6615('0x7f')]=_0x1fd785['Smtp'][_0x6615('0x7f')]=![];}_0x1fd785['Imap']['host']=_0x2cdabc[_0x6615('0x62')]['Imap']['host'];_0x1fd785[_0x6615('0x44')][_0x6615('0x80')]=_0x2cdabc[_0x6615('0x62')][_0x6615('0x44')][_0x6615('0x80')];_0x1fd785[_0x6615('0x46')][_0x6615('0x81')]=_0x2cdabc['body']['Smtp'][_0x6615('0x81')];_0x1fd785[_0x6615('0x46')][_0x6615('0x80')]=_0x2cdabc[_0x6615('0x62')][_0x6615('0x46')][_0x6615('0x80')];}else{_0x1fd785['Imap'][_0x6615('0x82')]=_0x1fd785['Smtp'][_0x6615('0x82')]=_0x2cdabc[_0x6615('0x62')][_0x6615('0x83')];_0x1fd785[_0x6615('0x44')][_0x6615('0x7a')]=_0x1fd785[_0x6615('0x46')][_0x6615('0x7a')]=_0x2cdabc[_0x6615('0x62')][_0x6615('0x7b')];_0x1fd785['Imap'][_0x6615('0x7c')]=_0x1fd785['Smtp']['pass']=_0x2cdabc['body'][_0x6615('0x7e')];}return db[_0x6615('0x49')][_0x6615('0x68')](_0x1fd785,{'include':[{'model':db[_0x6615('0x45')],'as':_0x6615('0x46')},{'model':db[_0x6615('0x43')],'as':_0x6615('0x44')}]})['then'](function(_0x53b2f4){var _0xf5ca3a=_0x2cdabc[_0x6615('0x7a')][_0x6615('0x84')]({'plain':!![]});if(!_0xf5ca3a)throw new Error(_0x6615('0x85'));if(_0xf5ca3a[_0x6615('0x86')]===_0x6615('0x7a')){var _0x30faea=_0x53b2f4[_0x6615('0x84')]({'plain':!![]});return db[_0x6615('0x87')]['find']({'where':{'name':_0x6615('0x3d'),'userProfileId':_0xf5ca3a[_0x6615('0x88')]},'raw':!![]})[_0x6615('0x25')](function(_0x4f5c22){if(_0x4f5c22&&_0x4f5c22[_0x6615('0x89')]===0x0){return db[_0x6615('0x8a')][_0x6615('0x68')]({'name':_0x30faea['name'],'resourceId':_0x30faea['id'],'type':_0x4f5c22[_0x6615('0x41')],'sectionId':_0x4f5c22['id']},{})[_0x6615('0x25')](function(){return _0x53b2f4;});}else{return _0x53b2f4;}})['catch'](function(_0x56583f){logger['error'](_0x6615('0x8b'),_0x56583f);throw _0x56583f;});}return _0x53b2f4;})[_0x6615('0x25')](respondWithResult(_0x437ecf,0xc9))[_0x6615('0x30')](handleError(_0x437ecf,null));};exports[_0x6615('0x8c')]=function(_0x18d4e1,_0x434f17,_0x2b7e77){return db['MailAccount']['findOne']({'where':{'id':_0x18d4e1[_0x6615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x434f17,null))['then'](function(_0x5d0f0c){if(_0x5d0f0c){return _0x5d0f0c['getImap']();}return null;})[_0x6615('0x25')](respondWithResult(_0x434f17,null))['catch'](handleError(_0x434f17,null));};exports['addImap']=function(_0x1746da,_0xf76bf2,_0x45421b){if(_0x1746da['body']['id']){delete _0x1746da['body']['id'];}return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x1746da[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0xf76bf2,null))[_0x6615('0x25')](function(_0x25e42c){if(_0x25e42c){_0x1746da['body'][_0x6615('0x6b')]=_0x25e42c['id'];return db[_0x6615('0x43')][_0x6615('0x68')](_0x1746da[_0x6615('0x62')]);}})[_0x6615('0x25')](respondWithResult(_0xf76bf2,null))['catch'](handleError(_0xf76bf2,null));};exports[_0x6615('0x8d')]=function(_0x46cd76,_0x4881ba,_0xa47845){return db['MailAccount']['findOne']({'where':{'id':_0x46cd76[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x4881ba,null))[_0x6615('0x25')](function(_0x4acf0b){if(_0x4acf0b){return _0x4acf0b[_0x6615('0x8e')](null);}return null;})[_0x6615('0x25')](respondWithStatusCode(_0x4881ba,null))[_0x6615('0x30')](handleError(_0x4881ba,null));};exports[_0x6615('0x8f')]=function(_0x29228d,_0x54c00d,_0x4be45d){return db['MailAccount'][_0x6615('0x70')]({'where':{'id':_0x29228d['params']['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x54c00d,null))[_0x6615('0x25')](function(_0xcb62ec){if(_0xcb62ec){return _0xcb62ec[_0x6615('0x8f')]();}return null;})[_0x6615('0x25')](respondWithResult(_0x54c00d,null))[_0x6615('0x30')](handleError(_0x54c00d,null));};exports[_0x6615('0x90')]=function(_0x12ba3c,_0x58c41a,_0xd85167){if(_0x12ba3c[_0x6615('0x62')]['id']){delete _0x12ba3c[_0x6615('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x12ba3c[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x58c41a,null))[_0x6615('0x25')](function(_0xbf3fde){if(_0xbf3fde){_0x12ba3c[_0x6615('0x62')]['MailAccountId']=_0xbf3fde['id'];return db[_0x6615('0x45')][_0x6615('0x68')](_0x12ba3c['body']);}})['then'](respondWithResult(_0x58c41a,null))[_0x6615('0x30')](handleError(_0x58c41a,null));};exports[_0x6615('0x91')]=function(_0x564c6b,_0x1e6b8d,_0x2c32f2){return db[_0x6615('0x49')]['findOne']({'where':{'id':_0x564c6b[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x1e6b8d,null))[_0x6615('0x25')](function(_0x4531cd){if(_0x4531cd){return _0x4531cd[_0x6615('0x92')](null);}return null;})[_0x6615('0x25')](respondWithStatusCode(_0x1e6b8d,null))['catch'](handleError(_0x1e6b8d,null));};exports[_0x6615('0x93')]=function(_0x42fe6c,_0x32b279,_0xd6cb30){return db[_0x6615('0x94')]['find']({'where':{'id':_0x42fe6c[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x32b279,null))[_0x6615('0x25')](function(_0x745099){if(_0x745099){return _0x745099[_0x6615('0x93')](_0x42fe6c[_0x6615('0x62')]['ids'],_[_0x6615('0x95')](_0x42fe6c[_0x6615('0x62')],['ids','id'])||{});}})[_0x6615('0x25')](respondWithResult(_0x32b279,null))['catch'](handleError(_0x32b279,null));};exports[_0x6615('0x96')]=function(_0x3ad6f0,_0x2e96b3,_0x2b664f){var _0x4bcdc7={'raw':![],'where':{}};var _0x3f1def={};var _0x20862f={'count':0x0,'rows':[]};return db[_0x6615('0x49')][_0x6615('0x70')]({'where':{'id':_0x3ad6f0[_0x6615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e96b3,null))[_0x6615('0x25')](function(_0x559bbd){if(_0x559bbd){_0x3f1def[_0x6615('0x4c')]=_['keys'](db[_0x6615('0x94')]['rawAttributes']);_0x3f1def[_0x6615('0x4d')]=_[_0x6615('0x4e')](_0x3ad6f0[_0x6615('0x4d')]);_0x3f1def[_0x6615('0x4f')]=_[_0x6615('0x50')](_0x3f1def[_0x6615('0x4c')],_0x3f1def['query']);_0x4bcdc7[_0x6615('0x51')]=_[_0x6615('0x50')](_0x3f1def[_0x6615('0x4c')],qs['fields'](_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x52')]));_0x4bcdc7['attributes']=_0x4bcdc7['attributes'][_0x6615('0x6a')]?_0x4bcdc7[_0x6615('0x51')]:_0x3f1def[_0x6615('0x4c')];if(!_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x71')](_0x6615('0x53'))){_0x4bcdc7[_0x6615('0x34')]=qs['limit'](_0x3ad6f0['query']['limit']);_0x4bcdc7[_0x6615('0x32')]=qs[_0x6615('0x32')](_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x32')]);}_0x4bcdc7[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x3ad6f0['query']['sort']);_0x4bcdc7[_0x6615('0x56')]=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x3ad6f0[_0x6615('0x4d')],_0x3f1def[_0x6615('0x4f')]));_0x4bcdc7[_0x6615('0x56')][_0x6615('0x6b')]=_0x559bbd['id'];if(_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x58')]){_0x4bcdc7[_0x6615('0x56')]=_[_0x6615('0x59')](_0x4bcdc7[_0x6615('0x56')],{'$or':_[_0x6615('0x48')](_0x4bcdc7[_0x6615('0x51')],function(_0x12bb23){var _0x41cbc3={};_0x41cbc3[_0x12bb23]={'$like':'%'+_0x3ad6f0['query'][_0x6615('0x58')]+'%'};return _0x41cbc3;})});}_0x4bcdc7=_[_0x6615('0x59')]({},_0x4bcdc7,_0x3ad6f0['options']);return db[_0x6615('0x94')]['count']({'where':_0x4bcdc7['where']})['then'](function(_0x4775f3){_0x20862f[_0x6615('0x35')]=_0x4775f3;if(_0x3ad6f0['query'][_0x6615('0x60')]){_0x4bcdc7[_0x6615('0x5b')]=[{'model':db[_0x6615('0x97')],'as':_0x6615('0x98'),'required':![]},{'model':db[_0x6615('0x99')],'as':'Owner','attributes':[_0x6615('0x41'),_0x6615('0x9a'),_0x6615('0x9b')],'required':![]},{'model':db[_0x6615('0x9c')],'as':'Tags','attributes':['id',_0x6615('0x41'),_0x6615('0x9d')],'where':_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x9e')]?{'id':_0x3ad6f0['query'][_0x6615('0x9e')]}:undefined,'required':_0x3ad6f0[_0x6615('0x4d')][_0x6615('0x9e')]?!![]:![]}];}return db[_0x6615('0x94')][_0x6615('0x72')](_0x4bcdc7);})['then'](function(_0x4560e9){_0x20862f[_0x6615('0x73')]=_0x4560e9;return _0x20862f;});}})['then'](respondWithFilteredResult(_0x2e96b3,_0x4bcdc7))[_0x6615('0x30')](handleError(_0x2e96b3,null));};exports['addApplications']=function addApplications(_0x2e5bc8,_0x479511){var _0x2aca11=_0x2e5bc8[_0x6615('0x5d')]['id'];var _0x45b895=_0x2e5bc8[_0x6615('0x62')];var _0x518bd0=0xc8;var _0x5b38fc=null;return db[_0x6615('0x9f')]['transaction']({'isolationLevel':db['sequelize'][_0x6615('0xa0')]['ISOLATION_LEVELS'][_0x6615('0xa1')]},function(_0x572761){return db[_0x6615('0x49')][_0x6615('0x70')]({'where':{'id':_0x2aca11},'transaction':_0x572761})[_0x6615('0x25')](function(_0x4fe1b5){if(_0x4fe1b5){return db[_0x6615('0xa2')][_0x6615('0x3c')]({'where':{'MailAccountId':_0x2aca11},'transaction':_0x572761})[_0x6615('0x25')](function(){var _0x38ba9a=_[_0x6615('0x48')](_0x45b895,function(_0x375e46){_0x375e46[_0x6615('0x6b')]=_0x2aca11;return _0x375e46;});return db['MailApplication']['bulkCreate'](_0x38ba9a,{'transaction':_0x572761});});}else{_0x518bd0=0x194;_0x5b38fc=[];}});})[_0x6615('0x25')](function(){if(_0x518bd0!==0x194){return db[_0x6615('0xa2')][_0x6615('0xa3')]({'where':{'MailAccountId':_0x2aca11},'order':_0x6615('0xa4')})[_0x6615('0x25')](function(_0xb289be){_0x5b38fc=_0xb289be;});}})['catch'](function(_0x18caf0){_0x518bd0=0x1f4;logger['error'](_0x18caf0[_0x6615('0x40')]);if(_0x18caf0['name']){delete _0x18caf0[_0x6615('0x41')];}_0x5b38fc=_0x18caf0;})[_0x6615('0xa5')](function(){if(_0x5b38fc===null){_0x479511[_0x6615('0x3f')](_0x518bd0);}else{if(_0x518bd0===0x1f4){_0x479511[_0x6615('0x31')](_0x518bd0)[_0x6615('0xa6')](_0x5b38fc);}else{_0x479511[_0x6615('0x31')](_0x518bd0)[_0x6615('0x38')](_0x5b38fc);}}});};exports['getApplications']=function(_0x37b420,_0x40ea7c,_0x1d702e){var _0x361710={};var _0x552b6b={};var _0x4986ab;var _0x3e19e7;return db[_0x6615('0x49')]['findOne']({'where':{'id':_0x37b420[_0x6615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x40ea7c,null))['then'](function(_0x4cc87b){if(_0x4cc87b){_0x4986ab=_0x4cc87b;_0x552b6b[_0x6615('0x4c')]=_[_0x6615('0x4e')](db[_0x6615('0xa2')]['rawAttributes']);_0x552b6b[_0x6615('0x4d')]=_['keys'](_0x37b420[_0x6615('0x4d')]);_0x552b6b[_0x6615('0x4f')]=_['intersection'](_0x552b6b[_0x6615('0x4c')],_0x552b6b[_0x6615('0x4d')]);_0x361710['attributes']=_[_0x6615('0x50')](_0x552b6b[_0x6615('0x4c')],qs[_0x6615('0x52')](_0x37b420['query']['fields']));_0x361710[_0x6615('0x51')]=_0x361710[_0x6615('0x51')][_0x6615('0x6a')]?_0x361710['attributes']:_0x552b6b[_0x6615('0x4c')];_0x361710[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x37b420['query'][_0x6615('0x55')]);_0x361710[_0x6615('0x56')]=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x37b420['query'],_0x552b6b[_0x6615('0x4f')]));if(_0x37b420[_0x6615('0x4d')][_0x6615('0x58')]){_0x361710[_0x6615('0x56')]=_[_0x6615('0x59')](_0x361710[_0x6615('0x56')],{'$or':_[_0x6615('0x48')](_0x361710['attributes'],function(_0x5d4666){var _0x19a22d={};_0x19a22d[_0x5d4666]={'$like':'%'+_0x37b420[_0x6615('0x4d')][_0x6615('0x58')]+'%'};return _0x19a22d;})});}_0x361710=_[_0x6615('0x59')]({},_0x361710,_0x37b420[_0x6615('0x61')]);return _0x4986ab[_0x6615('0xa7')](_0x361710);}})[_0x6615('0x25')](function(_0x5289ce){if(_0x5289ce){_0x3e19e7=_0x5289ce['length'];if(!_0x37b420[_0x6615('0x4d')][_0x6615('0x71')](_0x6615('0x53'))){_0x361710[_0x6615('0x34')]=qs[_0x6615('0x34')](_0x37b420[_0x6615('0x4d')][_0x6615('0x34')]);_0x361710['offset']=qs[_0x6615('0x32')](_0x37b420[_0x6615('0x4d')][_0x6615('0x32')]);}return _0x4986ab['getApplications'](_0x361710);}})[_0x6615('0x25')](function(_0x591179){if(_0x591179){return _0x591179?{'count':_0x3e19e7,'rows':_0x591179}:null;}})[_0x6615('0x25')](respondWithResult(_0x40ea7c,null))['catch'](handleError(_0x40ea7c,null));};exports['getMessages']=function(_0x47b41e,_0x2e79f3,_0x5965a8){var _0x3914be={'raw':!![],'where':{}};var _0x55f87a={};var _0x59aa35={'count':0x0,'rows':[]};return db[_0x6615('0x49')][_0x6615('0x70')]({'where':{'id':_0x47b41e[_0x6615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e79f3,null))[_0x6615('0x25')](function(_0x58aae0){if(_0x58aae0){_0x55f87a[_0x6615('0x4c')]=_[_0x6615('0x4e')](db[_0x6615('0xa8')][_0x6615('0x5f')]);_0x55f87a['query']=_[_0x6615('0x4e')](_0x47b41e[_0x6615('0x4d')]);_0x55f87a[_0x6615('0x4f')]=_[_0x6615('0x50')](_0x55f87a[_0x6615('0x4c')],_0x55f87a['query']);_0x3914be[_0x6615('0x51')]=_[_0x6615('0x50')](_0x55f87a['model'],qs[_0x6615('0x52')](_0x47b41e[_0x6615('0x4d')]['fields']));_0x3914be[_0x6615('0x51')]=_0x3914be[_0x6615('0x51')][_0x6615('0x6a')]?_0x3914be[_0x6615('0x51')]:_0x55f87a[_0x6615('0x4c')];if(!_0x47b41e[_0x6615('0x4d')][_0x6615('0x71')](_0x6615('0x53'))){_0x3914be[_0x6615('0x34')]=qs[_0x6615('0x34')](_0x47b41e['query'][_0x6615('0x34')]);_0x3914be[_0x6615('0x32')]=qs[_0x6615('0x32')](_0x47b41e['query'][_0x6615('0x32')]);}_0x3914be[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x47b41e['query'][_0x6615('0x55')]);_0x3914be[_0x6615('0x56')]=qs[_0x6615('0x4f')](_['pick'](_0x47b41e[_0x6615('0x4d')],_0x55f87a['filters']));_0x3914be[_0x6615('0x56')][_0x6615('0x6b')]=_0x58aae0['id'];if(_0x47b41e['query']['filter']){_0x3914be[_0x6615('0x56')]=_[_0x6615('0x59')](_0x3914be['where'],{'$or':_[_0x6615('0x48')](_0x3914be[_0x6615('0x51')],function(_0x298385){var _0x3bbd59={};_0x3bbd59[_0x298385]={'$like':'%'+_0x47b41e[_0x6615('0x4d')][_0x6615('0x58')]+'%'};return _0x3bbd59;})});}if(_0x47b41e[_0x6615('0x4d')][_0x6615('0xa9')]){var _0x465748=_0x47b41e[_0x6615('0x4d')]['$gte'][_0x6615('0xaa')](',');var _0x323bcd={};_0x323bcd[_0x465748[0x0]]={'$gte':moment(_0x465748[0x1])[_0x6615('0xab')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3914be[_0x6615('0x56')]=_['merge'](_0x3914be[_0x6615('0x56')],_0x323bcd);}_0x3914be=_['merge']({},_0x3914be,_0x47b41e[_0x6615('0x61')]);return db[_0x6615('0xa8')][_0x6615('0x35')]({'where':_0x3914be['where']})[_0x6615('0x25')](function(_0x3d97fc){_0x59aa35['count']=_0x3d97fc;if(_0x47b41e['query'][_0x6615('0x60')]){_0x3914be['include']=[{'all':!![]}];}return db[_0x6615('0xa8')][_0x6615('0x72')](_0x3914be);})[_0x6615('0x25')](function(_0x183a1e){if(_0x47b41e[_0x6615('0x4d')][_0x6615('0xac')]===_0x6615('0xad')){for(var _0x353cc7=0x0;_0x353cc7<_0x183a1e[_0x6615('0x6a')];_0x353cc7++){_0x183a1e[_0x353cc7]['body']=juice(_0x183a1e[_0x353cc7][_0x6615('0x62')]);}}_0x59aa35[_0x6615('0x73')]=_0x183a1e;return _0x59aa35;});}})['then'](respondWithFilteredResult(_0x2e79f3,_0x3914be))[_0x6615('0x30')](handleError(_0x2e79f3,null));};exports[_0x6615('0xa6')]=function(_0x53b3f6,_0x5195b3,_0x2caa7a){var _0x2ca3a4,_0x291073={},_0x10e65a;if(_0x53b3f6[_0x6615('0x62')]['to']){_0x10e65a=_0x53b3f6[_0x6615('0x62')]['to'][_0x6615('0xaa')](',')[0x0];}return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x53b3f6[_0x6615('0x5d')]['id']},'include':[{'model':db[_0x6615('0xae')],'as':'List','include':[{'model':db['CmContact'],'as':_0x6615('0xaf'),'where':{'email':_0x10e65a},'limit':0x1,'order':[['updatedAt',_0x6615('0xb0')]]}]},{'model':db[_0x6615('0x45')],'as':_0x6615('0x46'),'raw':!![]}]})[_0x6615('0x25')](handleEntityNotFound(_0x5195b3,null))[_0x6615('0x25')](function(_0x4a3dd7){if(_0x4a3dd7){_0x2ca3a4=_0x4a3dd7;if(_0x4a3dd7[_0x6615('0x46')]){if(_['isNil'](_0x53b3f6[_0x6615('0x62')][_0x6615('0xb1')])){_0x53b3f6[_0x6615('0x62')][_0x6615('0xb1')]=util[_0x6615('0xab')](_0x6615('0xb2'),_0x4a3dd7[_0x6615('0x41')],_0x4a3dd7['email']||_0x4a3dd7[_0x6615('0x46')][_0x6615('0x7a')]);}if(_0x53b3f6[_0x6615('0x62')][_0x6615('0xb3')]&&_0x53b3f6['body'][_0x6615('0xb3')][_0x6615('0x6a')]){for(var _0x39ae8c=0x0;_0x39ae8c<_0x53b3f6[_0x6615('0x62')]['attachments']['length'];_0x39ae8c+=0x1){_0x53b3f6[_0x6615('0x62')][_0x6615('0xb3')][_0x39ae8c]={'filename':_0x53b3f6[_0x6615('0x62')][_0x6615('0xb3')][_0x39ae8c][_0x6615('0x41')],'path':path[_0x6615('0xb4')](config['root'],_0x6615('0xb5'),_0x53b3f6[_0x6615('0x62')]['attachments'][_0x39ae8c][_0x6615('0xb6')])};}}var _0x58d541={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4a3dd7['Smtp'][_0x6615('0x82')])){if(_0x4a3dd7['Smtp'][_0x6615('0x7f')]){_0x58d541[_0x6615('0xb7')]={'user':_0x4a3dd7['Smtp'][_0x6615('0x7a')],'pass':_0x4a3dd7[_0x6615('0x46')][_0x6615('0x7d')]};}_0x58d541[_0x6615('0x81')]=_0x4a3dd7[_0x6615('0x46')][_0x6615('0x81')];_0x58d541['port']=_0x4a3dd7[_0x6615('0x46')]['port'];_0x58d541['secure']=_0x4a3dd7[_0x6615('0x46')]['secure'];}else{_0x58d541[_0x6615('0x82')]=_0x4a3dd7['Smtp']['service'];_0x58d541[_0x6615('0xb7')]={'user':_0x4a3dd7[_0x6615('0x46')][_0x6615('0x7a')],'pass':_0x4a3dd7[_0x6615('0x46')][_0x6615('0x7d')]};}return respondWithRpcPromise(_0x6615('0xb8'),_0x6615('0xb9'),{'account':_0x58d541,'message':_0x53b3f6[_0x6615('0x62')]});}else{throw new Error(_0x6615('0xba'));}}})[_0x6615('0x25')](function(_0x1bab9a){if(_0x1bab9a){_0x291073=_0x1bab9a;if(_0x2ca3a4[_0x6615('0xbb')]){if(_0x2ca3a4[_0x6615('0xbb')][_0x6615('0xaf')][_0x6615('0x6a')]){return _0x2ca3a4[_0x6615('0xbb')][_0x6615('0xaf')][0x0];}else{return db[_0x6615('0x97')]['create'](_[_0x6615('0x1f')](_0x53b3f6[_0x6615('0x62')],{'firstName':_0x53b3f6[_0x6615('0x62')]['to'],'email':_0x53b3f6[_0x6615('0x62')]['to'],'phone':_0x53b3f6[_0x6615('0x62')]['to'],'ListId':_0x2ca3a4[_0x6615('0x76')]}));}}else{throw new Error(_0x6615('0xba'));}}})['then'](function(_0x2a5ab3){if(_0x2a5ab3){var _0x2afe21={'UserId':_0x53b3f6[_0x6615('0x7a')]['id'],'ContactId':_0x2a5ab3['id'],'MailAccountId':_0x2ca3a4['id'],'inReplyTo':_0x291073[_0x6615('0xbc')],'to':_0x53b3f6[_0x6615('0x62')][_0x6615('0xb1')],'cc':_0x53b3f6[_0x6615('0x62')]['cc'],'subject':_0x53b3f6[_0x6615('0x62')]['subject'],'attach':_0x53b3f6[_0x6615('0x62')][_0x6615('0xbd')],'firstMsgDirection':_0x6615('0xbe'),'lastMsgAt':moment()[_0x6615('0xab')](_0x6615('0xbf')),'lastMsgDirection':_0x6615('0xbe'),'Messages':[_[_0x6615('0x59')](_0x53b3f6[_0x6615('0x62')],{'messageId':_0x291073[_0x6615('0xbc')],'sentAt':moment()[_0x6615('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2ca3a4['id'],'UserId':_0x53b3f6[_0x6615('0x7a')]['id'],'ContactId':_0x2a5ab3['id']})]};if(_0x53b3f6[_0x6615('0x62')][_0x6615('0xc0')]){_0x2afe21=_[_0x6615('0x59')](_0x2afe21,_0x53b3f6[_0x6615('0x62')][_0x6615('0xc0')]);}return db[_0x6615('0x94')][_0x6615('0x68')](_0x2afe21,{'include':[{'model':db[_0x6615('0xa8')],'as':'Messages'}]});}})[_0x6615('0x25')](respondWithResult(_0x5195b3,null))[_0x6615('0x30')](handleError(_0x5195b3,null));};exports['verifySmtp']=function(_0x1ebced,_0x24323e,_0x3b59f3){return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x1ebced[_0x6615('0x5d')]['id']},'include':[{'model':db[_0x6615('0x45')],'as':_0x6615('0x46'),'raw':!![]}]})[_0x6615('0x25')](handleEntityNotFound(_0x24323e,null))[_0x6615('0x25')](function(_0x5ec4d4){if(_0x5ec4d4&&_0x5ec4d4[_0x6615('0x46')]){var _0x476cba={'id':_0x5ec4d4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5ec4d4['Smtp'][_0x6615('0x82')]){_0x476cba[_0x6615('0x82')]=_0x5ec4d4[_0x6615('0x46')][_0x6615('0x82')];}else{_0x476cba[_0x6615('0x81')]=_0x5ec4d4[_0x6615('0x46')][_0x6615('0x81')];_0x476cba[_0x6615('0x80')]=_0x5ec4d4['Smtp'][_0x6615('0x80')];_0x476cba[_0x6615('0xc1')]=_0x5ec4d4[_0x6615('0x46')]['secure'];}if(_0x5ec4d4[_0x6615('0x46')][_0x6615('0x7f')]){_0x476cba[_0x6615('0xb7')]={'user':_0x5ec4d4[_0x6615('0x46')][_0x6615('0x7a')],'pass':_0x5ec4d4[_0x6615('0x46')]['pass']};}return respondWithRpcPromise(_0x6615('0xc2'),_0x6615('0xc3'),{'account':_0x476cba});}})[_0x6615('0x25')](respondWithResult(_0x24323e,null))[_0x6615('0x30')](handleError(_0x24323e,null));};exports[_0x6615('0x3c')]=function(_0x1b4066,_0x321abb){return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x1b4066[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x321abb,null))[_0x6615('0x25')](function(_0x39a3cf){if(_0x39a3cf&&_0x39a3cf[_0x6615('0x82')]){throw new db['Sequelize'][(_0x6615('0xc4'))](_0x6615('0xc5'));}return _0x39a3cf;})['then'](removeEntity(_0x321abb,null))[_0x6615('0x30')](handleError(_0x321abb,null));};exports['addAgents']=function(_0x5333af,_0x39b30f,_0x13e768){return db[_0x6615('0x49')][_0x6615('0x63')]({'where':{'id':_0x5333af[_0x6615('0x5d')]['id']}})['then'](handleEntityNotFound(_0x39b30f,null))[_0x6615('0x25')](function(_0x4daced){if(_0x4daced){return _0x4daced['addAgents'](_0x5333af[_0x6615('0x62')][_0x6615('0xc6')],_[_0x6615('0x95')](_0x5333af[_0x6615('0x62')],['ids','id'])||{})[_0x6615('0xc7')](function(_0x4fff16){for(var _0x51c794=0x0;_0x51c794<_0x5333af[_0x6615('0x62')][_0x6615('0xc6')][_0x6615('0x6a')];_0x51c794+=0x1){socket['emit'](_0x6615('0xc8'),{'UserId':Number(_0x5333af[_0x6615('0x62')]['ids'][_0x51c794]),'MailAccountId':Number(_0x5333af[_0x6615('0x5d')]['id'])});}return _0x4fff16;});}})['then'](respondWithResult(_0x39b30f,null))[_0x6615('0x30')](handleError(_0x39b30f,null));};exports[_0x6615('0xc9')]=function(_0x2db232,_0x25fae1,_0x13863d){return db['MailAccount'][_0x6615('0x63')]({'where':{'id':_0x2db232[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0x25fae1,null))[_0x6615('0x25')](function(_0x4358a1){if(_0x4358a1){return _0x4358a1[_0x6615('0xc9')](_0x2db232[_0x6615('0x4d')][_0x6615('0xc6')])['then'](function(){if(_[_0x6615('0xca')](_0x2db232[_0x6615('0x4d')][_0x6615('0xc6')])){for(var _0x4f4e46=0x0;_0x4f4e46<_0x2db232[_0x6615('0x4d')][_0x6615('0xc6')]['length'];_0x4f4e46+=0x1){socket[_0x6615('0xcb')](_0x6615('0xcc'),{'UserId':Number(_0x2db232[_0x6615('0x4d')][_0x6615('0xc6')][_0x4f4e46]),'MailAccountId':Number(_0x2db232[_0x6615('0x5d')]['id'])});}}else{socket[_0x6615('0xcb')]('userMailAccount:remove',{'UserId':Number(_0x2db232[_0x6615('0x4d')][_0x6615('0xc6')]),'MailAccountId':Number(_0x2db232[_0x6615('0x5d')]['id'])});}});}})[_0x6615('0x25')](respondWithStatusCode(_0x25fae1,null))['catch'](handleError(_0x25fae1,null));};exports['getAgents']=function(_0x1bd15a,_0xcd1a68,_0x2f78ac){var _0x32a800={};var _0x59b173={};var _0x3e584b;var _0x24d068;return db['MailAccount'][_0x6615('0x70')]({'where':{'id':_0x1bd15a[_0x6615('0x5d')]['id']}})[_0x6615('0x25')](handleEntityNotFound(_0xcd1a68,null))[_0x6615('0x25')](function(_0x336d1c){if(_0x336d1c){_0x3e584b=_0x336d1c;_0x59b173[_0x6615('0x4c')]=_[_0x6615('0x4e')](db[_0x6615('0x99')][_0x6615('0x5f')]);_0x59b173[_0x6615('0x4d')]=_['keys'](_0x1bd15a[_0x6615('0x4d')]);_0x59b173['filters']=_[_0x6615('0x50')](_0x59b173[_0x6615('0x4c')],_0x59b173[_0x6615('0x4d')]);_0x32a800[_0x6615('0x51')]=_['intersection'](_0x59b173[_0x6615('0x4c')],qs[_0x6615('0x52')](_0x1bd15a['query'][_0x6615('0x52')]));_0x32a800[_0x6615('0x51')]=_0x32a800['attributes'][_0x6615('0x6a')]?_0x32a800['attributes']:_0x59b173[_0x6615('0x4c')];_0x32a800[_0x6615('0x54')]=qs[_0x6615('0x55')](_0x1bd15a['query'][_0x6615('0x55')]);_0x32a800[_0x6615('0x56')]=qs[_0x6615('0x4f')](_[_0x6615('0x57')](_0x1bd15a[_0x6615('0x4d')],_0x59b173[_0x6615('0x4f')]));if(_0x1bd15a[_0x6615('0x4d')][_0x6615('0x58')]){_0x32a800[_0x6615('0x56')]=_[_0x6615('0x59')](_0x32a800[_0x6615('0x56')],{'$or':_[_0x6615('0x48')](_0x32a800[_0x6615('0x51')],function(_0x3151bd){var _0x37b065={};_0x37b065[_0x3151bd]={'$like':'%'+_0x1bd15a['query']['filter']+'%'};return _0x37b065;})});}_0x32a800=_['merge']({},_0x32a800,_0x1bd15a[_0x6615('0x61')]);return _0x3e584b[_0x6615('0xcd')](_0x32a800);}})['then'](function(_0x3b3e8f){if(_0x3b3e8f){_0x24d068=_0x3b3e8f[_0x6615('0x6a')];if(!_0x1bd15a[_0x6615('0x4d')][_0x6615('0x71')](_0x6615('0x53'))){_0x32a800['limit']=qs['limit'](_0x1bd15a[_0x6615('0x4d')]['limit']);_0x32a800[_0x6615('0x32')]=qs[_0x6615('0x32')](_0x1bd15a[_0x6615('0x4d')]['offset']);}return _0x3e584b[_0x6615('0xcd')](_0x32a800);}})['then'](function(_0x4ab9cb){if(_0x4ab9cb){return _0x4ab9cb?{'count':_0x24d068,'rows':_0x4ab9cb}:null;}})[_0x6615('0x25')](respondWithResult(_0xcd1a68,null))['catch'](handleError(_0xcd1a68,null));}; \ No newline at end of file +var _0xb264=['destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','params','MailServerIn','filters','options','find','body','describe','Disposition','create','getDispositions','findOne','hasOwnProperty','filter','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','MailAccountId','removeAnswers','key','isNil','active','description','cservice','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','pass','secure','auth','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','html-to-text','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x76ed10,_0x256a32){var _0xab1ee1=function(_0x3439cf){while(--_0x3439cf){_0x76ed10['push'](_0x76ed10['shift']());}};_0xab1ee1(++_0x256a32);}(_0xb264,0x88));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b26('0x0'));var rimraf=require(_0x4b26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b26('0x2'));var rp=require(_0x4b26('0x3'));var moment=require(_0x4b26('0x4'));var BPromise=require(_0x4b26('0x5'));var Mustache=require(_0x4b26('0x6'));var util=require(_0x4b26('0x7'));var path=require('path');var sox=require(_0x4b26('0x8'));var csv=require(_0x4b26('0x9'));var ejs=require(_0x4b26('0xa'));var fs=require('fs');var fs_extra=require(_0x4b26('0xb'));var _=require('lodash');var squel=require(_0x4b26('0xc'));var crypto=require(_0x4b26('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b26('0x9'));var querystring=require('querystring');var Papa=require(_0x4b26('0xe'));var htmlToText=require(_0x4b26('0xf'));var juice=require('juice');var Redis=require(_0x4b26('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4b26('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b26('0x12'));var logger=require(_0x4b26('0x13'))(_0x4b26('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b26('0x15'));var db=require('../../mysqldb')['db'];config[_0x4b26('0x16')]=_[_0x4b26('0x17')](config[_0x4b26('0x16')],{'host':_0x4b26('0x18'),'port':0x18eb});var socket=require(_0x4b26('0x19'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x4b26('0x1a')](socket);var jayson=require(_0x4b26('0x1b'));var client=jayson[_0x4b26('0x1c')][_0x4b26('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x36ce2b,_0xac8b02,_0x5a50ca,_0x371434){return new BPromise(function(_0x50d078,_0x50f9b4){var _0x347e46=_0x371434||client;return _0x347e46[_0x4b26('0x1e')](_0x36ce2b,_0x5a50ca)[_0x4b26('0x1f')](function(_0x4dc559){logger[_0x4b26('0x20')](_0x4b26('0x21'),_0xac8b02,'request\x20sent');logger[_0x4b26('0x22')](_0x4b26('0x23'),_0xac8b02,'request\x20sent',JSON[_0x4b26('0x24')](_0x4dc559));if(_0x4dc559[_0x4b26('0x25')]){if(_0x4dc559['error'][_0x4b26('0x26')]===0x1f4){logger[_0x4b26('0x25')](_0x4b26('0x21'),_0xac8b02,_0x4dc559[_0x4b26('0x25')][_0x4b26('0x27')]);return _0x50f9b4(_0x4dc559[_0x4b26('0x25')]['message']);}logger[_0x4b26('0x25')](_0x4b26('0x21'),_0xac8b02,_0x4dc559[_0x4b26('0x25')]['message']);return _0x50d078(_0x4dc559[_0x4b26('0x25')]['message']);}else{logger[_0x4b26('0x20')](_0x4b26('0x21'),_0xac8b02,_0x4b26('0x28'));_0x50d078(_0x4dc559['result']['message']);}})[_0x4b26('0x29')](function(_0x439b82){logger[_0x4b26('0x25')]('MailAccount,\x20%s,\x20%s',_0xac8b02,_0x439b82);_0x50f9b4(_0x439b82);});});}function respondWithStatusCode(_0x4c809c,_0x212188){_0x212188=_0x212188||0xcc;return function(_0x4f7576){if(_0x4f7576){return _0x4c809c[_0x4b26('0x2a')](_0x212188);}return _0x4c809c[_0x4b26('0x2b')](_0x212188)[_0x4b26('0x2c')]();};}function respondWithResult(_0x48b21f,_0x386740){_0x386740=_0x386740||0xc8;return function(_0x35e108){if(_0x35e108){return _0x48b21f[_0x4b26('0x2b')](_0x386740)[_0x4b26('0x2d')](_0x35e108);}};}function respondWithFilteredResult(_0x2090f1,_0x3477b1){return function(_0x19cfac){if(_0x19cfac){var _0xb01942=typeof _0x3477b1[_0x4b26('0x2e')]===_0x4b26('0x2f')&&typeof _0x3477b1[_0x4b26('0x30')]===_0x4b26('0x2f');var _0x3ef061=_0x19cfac[_0x4b26('0x31')];var _0x2f88cd=_0xb01942?0x0:_0x3477b1[_0x4b26('0x2e')];var _0x15f1e1=_0xb01942?_0x19cfac[_0x4b26('0x31')]:_0x3477b1[_0x4b26('0x2e')]+_0x3477b1[_0x4b26('0x30')];var _0x17b318;if(_0x15f1e1>=_0x3ef061){_0x15f1e1=_0x3ef061;_0x17b318=0xc8;}else{_0x17b318=0xce;}_0x2090f1[_0x4b26('0x2b')](_0x17b318);return _0x2090f1[_0x4b26('0x32')]('Content-Range',_0x2f88cd+'-'+_0x15f1e1+'/'+_0x3ef061)[_0x4b26('0x2d')](_0x19cfac);}return null;};}function patchUpdates(_0x1b01cc){return function(_0x5bf98c){try{jsonpatch[_0x4b26('0x33')](_0x5bf98c,_0x1b01cc,!![]);}catch(_0x19fb59){return BPromise[_0x4b26('0x34')](_0x19fb59);}return _0x5bf98c[_0x4b26('0x35')]();};}function saveUpdates(_0x2a2b45,_0x36a2fa){return function(_0x33fdf6){if(_0x33fdf6){return _0x33fdf6[_0x4b26('0x36')](_0x2a2b45)['then'](function(_0x1dba4e){return _0x1dba4e;});}return null;};}function removeEntity(_0x4fa7d4,_0x58b8f1){return function(_0x50ada2){if(_0x50ada2){return _0x50ada2[_0x4b26('0x37')]()['then'](function(){var _0x36ad44=_0x50ada2[_0x4b26('0x38')]({'plain':!![]});var _0x3991b2=_0x4b26('0x39');return db[_0x4b26('0x3a')][_0x4b26('0x37')]({'where':{'type':_0x3991b2,'resourceId':_0x36ad44['id']}})[_0x4b26('0x1f')](function(){return _0x50ada2;});})['then'](function(){_0x4fa7d4[_0x4b26('0x2b')](0xcc)[_0x4b26('0x2c')]();});}};}function handleEntityNotFound(_0x5a4bf7,_0x218e3d){return function(_0x39a566){if(!_0x39a566){_0x5a4bf7[_0x4b26('0x2a')](0x194);}return _0x39a566;};}function handleError(_0x49606d,_0x43618b){_0x43618b=_0x43618b||0x1f4;return function(_0x1ebdbf){logger[_0x4b26('0x25')](_0x1ebdbf[_0x4b26('0x3b')]);if(_0x1ebdbf[_0x4b26('0x3c')]){delete _0x1ebdbf['name'];}_0x49606d['status'](_0x43618b)[_0x4b26('0x3d')](_0x1ebdbf);};}exports[_0x4b26('0x3e')]=function(_0x2cea34,_0x2f8fba){var _0x3f2597={'include':[{'model':db['MailServerIn'],'as':_0x4b26('0x3f')},{'model':db[_0x4b26('0x40')],'as':_0x4b26('0x41')},{'model':db[_0x4b26('0x42')],'as':_0x4b26('0x43')}]},_0x356b48={},_0x5730bf={'count':0x0,'rows':[]};var _0x4579de=_[_0x4b26('0x44')](db[_0x4b26('0x45')][_0x4b26('0x46')],function(_0x222aa5){return{'name':_0x222aa5[_0x4b26('0x47')],'type':_0x222aa5['type']['key']};});_0x356b48['model']=_[_0x4b26('0x44')](_0x4579de,'name');_0x356b48[_0x4b26('0x48')]=_[_0x4b26('0x49')](_0x2cea34[_0x4b26('0x48')]);_0x356b48['filters']=_['intersection'](_0x356b48[_0x4b26('0x4a')],_0x356b48['query']);_0x3f2597[_0x4b26('0x4b')]=_[_0x4b26('0x4c')](_0x356b48['model'],qs['fields'](_0x2cea34[_0x4b26('0x48')][_0x4b26('0x4d')]));_0x3f2597[_0x4b26('0x4b')]=_0x3f2597[_0x4b26('0x4b')][_0x4b26('0x4e')]?_0x3f2597['attributes']:_0x356b48['model'];if(!_0x2cea34[_0x4b26('0x48')]['hasOwnProperty'](_0x4b26('0x4f'))){_0x3f2597[_0x4b26('0x30')]=qs[_0x4b26('0x30')](_0x2cea34[_0x4b26('0x48')][_0x4b26('0x30')]);_0x3f2597[_0x4b26('0x2e')]=qs['offset'](_0x2cea34['query']['offset']);}_0x3f2597[_0x4b26('0x50')]=qs[_0x4b26('0x51')](_0x2cea34['query']['sort']);_0x3f2597[_0x4b26('0x52')]=qs['filters'](_[_0x4b26('0x53')](_0x2cea34['query'],_0x356b48['filters']),_0x4579de);if(_0x2cea34[_0x4b26('0x48')]['filter']){_0x3f2597['where']=_[_0x4b26('0x54')](_0x3f2597[_0x4b26('0x52')],{'$or':_[_0x4b26('0x44')](_0x4579de,function(_0x5c4d96){if(_0x5c4d96['type']!=='VIRTUAL'){var _0x3ed056={};_0x3ed056[_0x5c4d96[_0x4b26('0x3c')]]={'$like':'%'+_0x2cea34[_0x4b26('0x48')]['filter']+'%'};return _0x3ed056;}})});}_0x3f2597=_[_0x4b26('0x54')]({},_0x3f2597,_0x2cea34['options']);var _0x49c4f8={'where':_0x3f2597[_0x4b26('0x52')]};return db[_0x4b26('0x45')][_0x4b26('0x31')](_0x49c4f8)[_0x4b26('0x1f')](function(_0x5e2a4f){_0x5730bf[_0x4b26('0x31')]=_0x5e2a4f;if(_0x2cea34['query'][_0x4b26('0x55')]){_0x3f2597[_0x4b26('0x56')]=[{'all':!![]}];}return db[_0x4b26('0x45')][_0x4b26('0x57')](_0x3f2597);})[_0x4b26('0x1f')](function(_0x170ef4){_0x5730bf['rows']=_0x170ef4;return _0x5730bf;})[_0x4b26('0x1f')](respondWithFilteredResult(_0x2f8fba,_0x3f2597))['catch'](handleError(_0x2f8fba,null));};exports['show']=function(_0xc9403f,_0x1b53c5){var _0x5d25e3={'raw':![],'where':{'id':_0xc9403f[_0x4b26('0x58')]['id']},'include':[{'model':db[_0x4b26('0x59')],'as':'Imap'},{'model':db[_0x4b26('0x40')],'as':_0x4b26('0x41')},{'model':db[_0x4b26('0x42')],'as':'mandatoryDispositionPause'}]},_0x4da11d={};_0x4da11d['model']=_[_0x4b26('0x49')](db[_0x4b26('0x45')]['rawAttributes']);_0x4da11d[_0x4b26('0x48')]=_[_0x4b26('0x49')](_0xc9403f['query']);_0x4da11d[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x4da11d[_0x4b26('0x4a')],_0x4da11d[_0x4b26('0x48')]);_0x5d25e3['attributes']=_[_0x4b26('0x4c')](_0x4da11d[_0x4b26('0x4a')],qs[_0x4b26('0x4d')](_0xc9403f['query']['fields']));_0x5d25e3['attributes']=_0x5d25e3[_0x4b26('0x4b')]['length']?_0x5d25e3[_0x4b26('0x4b')]:_0x4da11d[_0x4b26('0x4a')];if(_0xc9403f['query'][_0x4b26('0x55')]){_0x5d25e3[_0x4b26('0x56')]=[{'all':!![]}];}_0x5d25e3=_['merge']({},_0x5d25e3,_0xc9403f[_0x4b26('0x5b')]);return db[_0x4b26('0x45')][_0x4b26('0x5c')](_0x5d25e3)[_0x4b26('0x1f')](handleEntityNotFound(_0x1b53c5,null))[_0x4b26('0x1f')](respondWithResult(_0x1b53c5,null))['catch'](handleError(_0x1b53c5,null));};exports[_0x4b26('0x36')]=function(_0x3c449b,_0x4a5900){if(_0x3c449b[_0x4b26('0x5d')]['id']){delete _0x3c449b['body']['id'];}return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x3c449b[_0x4b26('0x58')]['id']},'include':[{'model':db[_0x4b26('0x59')],'as':_0x4b26('0x3f')},{'model':db[_0x4b26('0x40')],'as':_0x4b26('0x41')},{'model':db[_0x4b26('0x42')],'as':_0x4b26('0x43')}]})[_0x4b26('0x1f')](handleEntityNotFound(_0x4a5900,null))[_0x4b26('0x1f')](saveUpdates(_0x3c449b[_0x4b26('0x5d')],null))[_0x4b26('0x1f')](function(_0x2638ea){if(_0x2638ea&&_0x3c449b[_0x4b26('0x5d')][_0x4b26('0x3f')]){return db['MailServerIn']['update'](_0x3c449b['body'][_0x4b26('0x3f')],{'where':{'MailAccountId':_0x2638ea['id']}})[_0x4b26('0x1f')](function(){return _0x2638ea;});}return _0x2638ea;})[_0x4b26('0x1f')](function(_0x58991c){if(_0x58991c&&_0x3c449b['body'][_0x4b26('0x41')]){return db[_0x4b26('0x40')]['update'](_0x3c449b['body'][_0x4b26('0x41')],{'where':{'MailAccountId':_0x58991c['id']}})[_0x4b26('0x1f')](function(){return _0x58991c;});}return _0x58991c;})[_0x4b26('0x1f')](respondWithResult(_0x4a5900,null))['catch'](handleError(_0x4a5900,null));};exports[_0x4b26('0x5e')]=function(_0x357670,_0xf99923){return db[_0x4b26('0x45')][_0x4b26('0x5e')]()[_0x4b26('0x1f')](respondWithResult(_0xf99923,null))['catch'](handleError(_0xf99923,null));};exports['addDisposition']=function(_0x5f50ba,_0x5501d7,_0x290b53){if(_0x5f50ba[_0x4b26('0x5d')]['id']){delete _0x5f50ba[_0x4b26('0x5d')]['id'];}return db[_0x4b26('0x45')]['find']({'where':{'id':_0x5f50ba[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x5501d7,null))[_0x4b26('0x1f')](function(_0x544497){if(_0x544497){_0x5f50ba['body']['MailAccountId']=_0x544497['id'];return db[_0x4b26('0x5f')][_0x4b26('0x60')](_0x5f50ba[_0x4b26('0x5d')]);}})[_0x4b26('0x1f')](respondWithResult(_0x5501d7,null))[_0x4b26('0x29')](handleError(_0x5501d7,null));};exports[_0x4b26('0x61')]=function(_0x457882,_0x4f2e28,_0x4e3fd4){var _0x477fda={'raw':![],'where':{}};var _0x41f4d9={};var _0x27788e={'count':0x0,'rows':[]};return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x457882[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x4f2e28,null))['then'](function(_0x161a71){if(_0x161a71){_0x41f4d9[_0x4b26('0x4a')]=_[_0x4b26('0x49')](db[_0x4b26('0x5f')]['rawAttributes']);_0x41f4d9[_0x4b26('0x48')]=_[_0x4b26('0x49')](_0x457882['query']);_0x41f4d9[_0x4b26('0x5a')]=_['intersection'](_0x41f4d9[_0x4b26('0x4a')],_0x41f4d9[_0x4b26('0x48')]);_0x477fda[_0x4b26('0x4b')]=_[_0x4b26('0x4c')](_0x41f4d9[_0x4b26('0x4a')],qs[_0x4b26('0x4d')](_0x457882['query'][_0x4b26('0x4d')]));_0x477fda[_0x4b26('0x4b')]=_0x477fda[_0x4b26('0x4b')][_0x4b26('0x4e')]?_0x477fda[_0x4b26('0x4b')]:_0x41f4d9['model'];if(!_0x457882[_0x4b26('0x48')][_0x4b26('0x63')](_0x4b26('0x4f'))){_0x477fda[_0x4b26('0x30')]=qs[_0x4b26('0x30')](_0x457882[_0x4b26('0x48')][_0x4b26('0x30')]);_0x477fda[_0x4b26('0x2e')]=qs['offset'](_0x457882[_0x4b26('0x48')][_0x4b26('0x2e')]);}_0x477fda['order']=qs[_0x4b26('0x51')](_0x457882['query']['sort']);_0x477fda[_0x4b26('0x52')]=qs[_0x4b26('0x5a')](_[_0x4b26('0x53')](_0x457882['query'],_0x41f4d9['filters']));_0x477fda[_0x4b26('0x52')]['MailAccountId']=_0x161a71['id'];if(_0x457882[_0x4b26('0x48')][_0x4b26('0x64')]){_0x477fda['where']=_[_0x4b26('0x54')](_0x477fda[_0x4b26('0x52')],{'$or':_[_0x4b26('0x44')](_0x477fda[_0x4b26('0x4b')],function(_0x9dec){var _0x572a2f={};_0x572a2f[_0x9dec]={'$like':'%'+_0x457882[_0x4b26('0x48')]['filter']+'%'};return _0x572a2f;})});}_0x477fda=_[_0x4b26('0x54')]({},_0x477fda,_0x457882[_0x4b26('0x5b')]);return db[_0x4b26('0x5f')][_0x4b26('0x31')]({'where':_0x477fda[_0x4b26('0x52')]})['then'](function(_0x58f606){_0x27788e[_0x4b26('0x31')]=_0x58f606;if(_0x457882[_0x4b26('0x48')][_0x4b26('0x55')]){_0x477fda[_0x4b26('0x56')]=[{'all':!![]}];}return db[_0x4b26('0x5f')]['findAll'](_0x477fda);})['then'](function(_0x2ed70f){_0x27788e[_0x4b26('0x65')]=_0x2ed70f;return _0x27788e;});}})[_0x4b26('0x1f')](respondWithFilteredResult(_0x4f2e28,_0x477fda))[_0x4b26('0x29')](handleError(_0x4f2e28,null));};exports[_0x4b26('0x66')]=function(_0x459ed1,_0x1064e3,_0x56ed37){return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x459ed1['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x1064e3,null))[_0x4b26('0x1f')](function(_0x12ffa6){if(_0x12ffa6){return _0x12ffa6['removeDispositions'](_0x459ed1[_0x4b26('0x48')][_0x4b26('0x67')]);}})[_0x4b26('0x1f')](respondWithStatusCode(_0x1064e3,null))[_0x4b26('0x29')](handleError(_0x1064e3,null));};exports[_0x4b26('0x68')]=function(_0x55982c,_0x4aa960,_0x397d26){if(_0x55982c[_0x4b26('0x5d')]['id']){delete _0x55982c[_0x4b26('0x5d')]['id'];}return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x55982c[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x4aa960,null))[_0x4b26('0x1f')](function(_0x1ffc49){if(_0x1ffc49){_0x55982c[_0x4b26('0x5d')]['MailAccountId']=_0x1ffc49['id'];return db[_0x4b26('0x69')]['create'](_0x55982c[_0x4b26('0x5d')]);}})[_0x4b26('0x1f')](respondWithResult(_0x4aa960,null))[_0x4b26('0x29')](handleError(_0x4aa960,null));};exports[_0x4b26('0x6a')]=function(_0x4a9e36,_0x448b32,_0x3f0284){var _0x3c9a21={'raw':![],'where':{}};var _0x3c51c7={};var _0x5e7971={'count':0x0,'rows':[]};return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x4a9e36[_0x4b26('0x58')]['id']}})['then'](handleEntityNotFound(_0x448b32,null))[_0x4b26('0x1f')](function(_0x1d27c5){if(_0x1d27c5){_0x3c51c7[_0x4b26('0x4a')]=_[_0x4b26('0x49')](db['CannedAnswer'][_0x4b26('0x46')]);_0x3c51c7[_0x4b26('0x48')]=_[_0x4b26('0x49')](_0x4a9e36[_0x4b26('0x48')]);_0x3c51c7[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x3c51c7['model'],_0x3c51c7[_0x4b26('0x48')]);_0x3c9a21[_0x4b26('0x4b')]=_[_0x4b26('0x4c')](_0x3c51c7[_0x4b26('0x4a')],qs[_0x4b26('0x4d')](_0x4a9e36[_0x4b26('0x48')]['fields']));_0x3c9a21[_0x4b26('0x4b')]=_0x3c9a21[_0x4b26('0x4b')][_0x4b26('0x4e')]?_0x3c9a21['attributes']:_0x3c51c7['model'];if(!_0x4a9e36[_0x4b26('0x48')]['hasOwnProperty'](_0x4b26('0x4f'))){_0x3c9a21[_0x4b26('0x30')]=qs[_0x4b26('0x30')](_0x4a9e36[_0x4b26('0x48')][_0x4b26('0x30')]);_0x3c9a21[_0x4b26('0x2e')]=qs[_0x4b26('0x2e')](_0x4a9e36[_0x4b26('0x48')]['offset']);}_0x3c9a21['order']=qs[_0x4b26('0x51')](_0x4a9e36['query'][_0x4b26('0x51')]);_0x3c9a21['where']=qs[_0x4b26('0x5a')](_[_0x4b26('0x53')](_0x4a9e36[_0x4b26('0x48')],_0x3c51c7[_0x4b26('0x5a')]));_0x3c9a21[_0x4b26('0x52')][_0x4b26('0x6b')]=_0x1d27c5['id'];if(_0x4a9e36[_0x4b26('0x48')][_0x4b26('0x64')]){_0x3c9a21[_0x4b26('0x52')]=_[_0x4b26('0x54')](_0x3c9a21['where'],{'$or':_[_0x4b26('0x44')](_0x3c9a21[_0x4b26('0x4b')],function(_0x346e7c){var _0x2823bb={};_0x2823bb[_0x346e7c]={'$like':'%'+_0x4a9e36[_0x4b26('0x48')]['filter']+'%'};return _0x2823bb;})});}_0x3c9a21=_[_0x4b26('0x54')]({},_0x3c9a21,_0x4a9e36[_0x4b26('0x5b')]);return db[_0x4b26('0x69')][_0x4b26('0x31')]({'where':_0x3c9a21[_0x4b26('0x52')]})['then'](function(_0x17c9ad){_0x5e7971[_0x4b26('0x31')]=_0x17c9ad;if(_0x4a9e36[_0x4b26('0x48')][_0x4b26('0x55')]){_0x3c9a21['include']=[{'all':!![]}];}return db[_0x4b26('0x69')][_0x4b26('0x57')](_0x3c9a21);})[_0x4b26('0x1f')](function(_0x5ebdd5){_0x5e7971[_0x4b26('0x65')]=_0x5ebdd5;return _0x5e7971;});}})[_0x4b26('0x1f')](respondWithFilteredResult(_0x448b32,_0x3c9a21))['catch'](handleError(_0x448b32,null));};exports['removeAnswers']=function(_0x53242c,_0x59dde,_0x109553){return db['MailAccount'][_0x4b26('0x5c')]({'where':{'id':_0x53242c['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x59dde,null))[_0x4b26('0x1f')](function(_0x4b98c8){if(_0x4b98c8){return _0x4b98c8[_0x4b26('0x6c')](_0x53242c['query'][_0x4b26('0x67')]);}})[_0x4b26('0x1f')](respondWithStatusCode(_0x59dde,null))[_0x4b26('0x29')](handleError(_0x59dde,null));};exports[_0x4b26('0x60')]=function(_0x5d74bb,_0xc00dea){var _0x454938={'name':_0x5d74bb['body'][_0x4b26('0x3c')],'key':_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x6d')],'email':_0x5d74bb['body']['email'],'ListId':_0x5d74bb[_0x4b26('0x5d')]['ListId'],'active':!_[_0x4b26('0x6e')](_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x6f')])?_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x6f')]:!![],'description':_0x5d74bb['body'][_0x4b26('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x4b26('0x6e')](_0x5d74bb['body'][_0x4b26('0x71')])){if(_0x5d74bb['body'][_0x4b26('0x72')]){_0x454938[_0x4b26('0x3f')][_0x4b26('0x73')]=_0x454938[_0x4b26('0x41')][_0x4b26('0x73')]=_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x74')];_0x454938[_0x4b26('0x3f')][_0x4b26('0x75')]=_0x454938[_0x4b26('0x41')]['pass']=_0x5d74bb['body'][_0x4b26('0x76')];}else{_0x454938[_0x4b26('0x3f')][_0x4b26('0x77')]=_0x454938[_0x4b26('0x41')][_0x4b26('0x77')]=![];}_0x454938[_0x4b26('0x3f')][_0x4b26('0x78')]=_0x5d74bb['body']['Imap'][_0x4b26('0x78')];_0x454938[_0x4b26('0x3f')][_0x4b26('0x79')]=_0x5d74bb['body'][_0x4b26('0x3f')][_0x4b26('0x79')];_0x454938[_0x4b26('0x41')][_0x4b26('0x78')]=_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x41')][_0x4b26('0x78')];_0x454938[_0x4b26('0x41')][_0x4b26('0x79')]=_0x5d74bb['body'][_0x4b26('0x41')][_0x4b26('0x79')];}else{_0x454938['Imap']['service']=_0x454938[_0x4b26('0x41')][_0x4b26('0x7a')]=_0x5d74bb[_0x4b26('0x5d')][_0x4b26('0x71')];_0x454938[_0x4b26('0x3f')][_0x4b26('0x73')]=_0x454938['Smtp'][_0x4b26('0x73')]=_0x5d74bb['body']['cuser'];_0x454938['Imap']['password']=_0x454938[_0x4b26('0x41')]['pass']=_0x5d74bb[_0x4b26('0x5d')]['cpassword'];}return db[_0x4b26('0x45')][_0x4b26('0x60')](_0x454938,{'include':[{'model':db['MailServerOut'],'as':_0x4b26('0x41')},{'model':db[_0x4b26('0x59')],'as':'Imap'}]})[_0x4b26('0x1f')](function(_0x21890e){var _0x5db2e1=_0x5d74bb[_0x4b26('0x73')][_0x4b26('0x38')]({'plain':!![]});if(!_0x5db2e1)throw new Error(_0x4b26('0x7b'));if(_0x5db2e1[_0x4b26('0x7c')]===_0x4b26('0x73')){var _0x1a82a3=_0x21890e[_0x4b26('0x38')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4b26('0x39'),'userProfileId':_0x5db2e1[_0x4b26('0x7d')]},'raw':!![]})[_0x4b26('0x1f')](function(_0x11e880){if(_0x11e880&&_0x11e880[_0x4b26('0x7e')]===0x0){return db[_0x4b26('0x3a')][_0x4b26('0x60')]({'name':_0x1a82a3['name'],'resourceId':_0x1a82a3['id'],'type':_0x11e880[_0x4b26('0x3c')],'sectionId':_0x11e880['id']},{})[_0x4b26('0x1f')](function(){return _0x21890e;});}else{return _0x21890e;}})[_0x4b26('0x29')](function(_0x29257b){logger[_0x4b26('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29257b);throw _0x29257b;});}return _0x21890e;})[_0x4b26('0x1f')](respondWithResult(_0xc00dea,0xc9))[_0x4b26('0x29')](handleError(_0xc00dea,null));};exports[_0x4b26('0x7f')]=function(_0x27c4d0,_0x355b13,_0x28d016){return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x27c4d0[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x355b13,null))[_0x4b26('0x1f')](function(_0x426432){if(_0x426432){return _0x426432[_0x4b26('0x7f')]();}return null;})[_0x4b26('0x1f')](respondWithResult(_0x355b13,null))[_0x4b26('0x29')](handleError(_0x355b13,null));};exports[_0x4b26('0x80')]=function(_0x22a4fc,_0x3877d1,_0x4fa2a9){if(_0x22a4fc[_0x4b26('0x5d')]['id']){delete _0x22a4fc['body']['id'];}return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x22a4fc['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x3877d1,null))[_0x4b26('0x1f')](function(_0x420600){if(_0x420600){_0x22a4fc[_0x4b26('0x5d')][_0x4b26('0x6b')]=_0x420600['id'];return db[_0x4b26('0x59')][_0x4b26('0x60')](_0x22a4fc[_0x4b26('0x5d')]);}})['then'](respondWithResult(_0x3877d1,null))[_0x4b26('0x29')](handleError(_0x3877d1,null));};exports['removeImap']=function(_0x3d3626,_0x2ae003,_0x288d81){return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x3d3626['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x2ae003,null))['then'](function(_0x2d439c){if(_0x2d439c){return _0x2d439c[_0x4b26('0x81')](null);}return null;})[_0x4b26('0x1f')](respondWithStatusCode(_0x2ae003,null))[_0x4b26('0x29')](handleError(_0x2ae003,null));};exports[_0x4b26('0x82')]=function(_0x131314,_0x2c30f0,_0x264716){return db['MailAccount'][_0x4b26('0x62')]({'where':{'id':_0x131314[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x2c30f0,null))[_0x4b26('0x1f')](function(_0x298b11){if(_0x298b11){return _0x298b11[_0x4b26('0x82')]();}return null;})[_0x4b26('0x1f')](respondWithResult(_0x2c30f0,null))['catch'](handleError(_0x2c30f0,null));};exports[_0x4b26('0x83')]=function(_0x4b64b6,_0x2dee26,_0x1843d9){if(_0x4b64b6[_0x4b26('0x5d')]['id']){delete _0x4b64b6[_0x4b26('0x5d')]['id'];}return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x4b64b6[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x2dee26,null))[_0x4b26('0x1f')](function(_0x2ea616){if(_0x2ea616){_0x4b64b6[_0x4b26('0x5d')][_0x4b26('0x6b')]=_0x2ea616['id'];return db[_0x4b26('0x40')][_0x4b26('0x60')](_0x4b64b6[_0x4b26('0x5d')]);}})[_0x4b26('0x1f')](respondWithResult(_0x2dee26,null))['catch'](handleError(_0x2dee26,null));};exports['removeSmtp']=function(_0x102442,_0x1a563a,_0x2940ba){return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x102442['params']['id']}})['then'](handleEntityNotFound(_0x1a563a,null))[_0x4b26('0x1f')](function(_0x12bac2){if(_0x12bac2){return _0x12bac2[_0x4b26('0x84')](null);}return null;})[_0x4b26('0x1f')](respondWithStatusCode(_0x1a563a,null))[_0x4b26('0x29')](handleError(_0x1a563a,null));};exports[_0x4b26('0x85')]=function(_0x44c35f,_0x18f7d1,_0x34ae12){return db[_0x4b26('0x86')][_0x4b26('0x5c')]({'where':{'id':_0x44c35f[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x18f7d1,null))[_0x4b26('0x1f')](function(_0x3bd8f4){if(_0x3bd8f4){return _0x3bd8f4[_0x4b26('0x85')](_0x44c35f[_0x4b26('0x5d')][_0x4b26('0x67')],_[_0x4b26('0x87')](_0x44c35f[_0x4b26('0x5d')],[_0x4b26('0x67'),'id'])||{});}})[_0x4b26('0x1f')](respondWithResult(_0x18f7d1,null))[_0x4b26('0x29')](handleError(_0x18f7d1,null));};exports[_0x4b26('0x88')]=function(_0x271ad4,_0x21f975,_0x22b58d){var _0x3b1037={'raw':![],'where':{}};var _0x43d820={};var _0x4e6441={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x271ad4[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x21f975,null))[_0x4b26('0x1f')](function(_0x4def5b){if(_0x4def5b){_0x43d820[_0x4b26('0x4a')]=_[_0x4b26('0x49')](db['MailInteraction'][_0x4b26('0x46')]);_0x43d820['query']=_[_0x4b26('0x49')](_0x271ad4[_0x4b26('0x48')]);_0x43d820[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x43d820[_0x4b26('0x4a')],_0x43d820[_0x4b26('0x48')]);_0x3b1037[_0x4b26('0x4b')]=_[_0x4b26('0x4c')](_0x43d820['model'],qs['fields'](_0x271ad4[_0x4b26('0x48')][_0x4b26('0x4d')]));_0x3b1037[_0x4b26('0x4b')]=_0x3b1037[_0x4b26('0x4b')]['length']?_0x3b1037[_0x4b26('0x4b')]:_0x43d820['model'];if(!_0x271ad4[_0x4b26('0x48')][_0x4b26('0x63')]('nolimit')){_0x3b1037[_0x4b26('0x30')]=qs[_0x4b26('0x30')](_0x271ad4['query'][_0x4b26('0x30')]);_0x3b1037[_0x4b26('0x2e')]=qs[_0x4b26('0x2e')](_0x271ad4[_0x4b26('0x48')][_0x4b26('0x2e')]);}_0x3b1037[_0x4b26('0x50')]=qs['sort'](_0x271ad4['query'][_0x4b26('0x51')]);_0x3b1037['where']=qs[_0x4b26('0x5a')](_[_0x4b26('0x53')](_0x271ad4[_0x4b26('0x48')],_0x43d820['filters']));_0x3b1037[_0x4b26('0x52')][_0x4b26('0x6b')]=_0x4def5b['id'];if(_0x271ad4['query'][_0x4b26('0x64')]){_0x3b1037['where']=_[_0x4b26('0x54')](_0x3b1037['where'],{'$or':_[_0x4b26('0x44')](_0x3b1037[_0x4b26('0x4b')],function(_0x474452){var _0x4aab47={};_0x4aab47[_0x474452]={'$like':'%'+_0x271ad4[_0x4b26('0x48')][_0x4b26('0x64')]+'%'};return _0x4aab47;})});}_0x3b1037=_[_0x4b26('0x54')]({},_0x3b1037,_0x271ad4['options']);return db['MailInteraction'][_0x4b26('0x31')]({'where':_0x3b1037[_0x4b26('0x52')]})[_0x4b26('0x1f')](function(_0x208152){_0x4e6441[_0x4b26('0x31')]=_0x208152;if(_0x271ad4[_0x4b26('0x48')][_0x4b26('0x55')]){_0x3b1037['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4b26('0x89')],'as':_0x4b26('0x8a'),'attributes':['name',_0x4b26('0x8b'),_0x4b26('0x8c')],'required':![]},{'model':db[_0x4b26('0x8d')],'as':'Tags','attributes':['id',_0x4b26('0x3c'),'color'],'where':_0x271ad4[_0x4b26('0x48')][_0x4b26('0x8e')]?{'id':_0x271ad4[_0x4b26('0x48')][_0x4b26('0x8e')]}:undefined,'required':_0x271ad4[_0x4b26('0x48')][_0x4b26('0x8e')]?!![]:![]}];}return db[_0x4b26('0x86')]['findAll'](_0x3b1037);})[_0x4b26('0x1f')](function(_0x57e0dd){_0x4e6441[_0x4b26('0x65')]=_0x57e0dd;return _0x4e6441;});}})['then'](respondWithFilteredResult(_0x21f975,_0x3b1037))[_0x4b26('0x29')](handleError(_0x21f975,null));};exports[_0x4b26('0x8f')]=function addApplications(_0x31033f,_0x14c203){var _0x2139e5=_0x31033f[_0x4b26('0x58')]['id'];var _0x3db2c2=_0x31033f[_0x4b26('0x5d')];var _0x1b4ed1=0xc8;var _0x3427ba=null;return db['sequelize'][_0x4b26('0x90')]({'isolationLevel':db[_0x4b26('0x91')]['Transaction'][_0x4b26('0x92')][_0x4b26('0x93')]},function(_0x227708){return db[_0x4b26('0x45')]['findOne']({'where':{'id':_0x2139e5},'transaction':_0x227708})['then'](function(_0x2b7703){if(_0x2b7703){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x2139e5},'transaction':_0x227708})[_0x4b26('0x1f')](function(){var _0x2aaff0=_['map'](_0x3db2c2,function(_0x2d403d){_0x2d403d['MailAccountId']=_0x2139e5;return _0x2d403d;});return db[_0x4b26('0x94')][_0x4b26('0x95')](_0x2aaff0,{'transaction':_0x227708});});}else{_0x1b4ed1=0x194;_0x3427ba=[];}});})[_0x4b26('0x1f')](function(){if(_0x1b4ed1!==0x194){return db[_0x4b26('0x94')][_0x4b26('0x96')]({'where':{'MailAccountId':_0x2139e5},'order':'priority'})['then'](function(_0xa59941){_0x3427ba=_0xa59941;});}})['catch'](function(_0x22dc0e){_0x1b4ed1=0x1f4;logger[_0x4b26('0x25')](_0x22dc0e[_0x4b26('0x3b')]);if(_0x22dc0e[_0x4b26('0x3c')]){delete _0x22dc0e[_0x4b26('0x3c')];}_0x3427ba=_0x22dc0e;})[_0x4b26('0x97')](function(){if(_0x3427ba===null){_0x14c203[_0x4b26('0x2a')](_0x1b4ed1);}else{if(_0x1b4ed1===0x1f4){_0x14c203[_0x4b26('0x2b')](_0x1b4ed1)['send'](_0x3427ba);}else{_0x14c203[_0x4b26('0x2b')](_0x1b4ed1)[_0x4b26('0x2d')](_0x3427ba);}}});};exports[_0x4b26('0x98')]=function(_0x4d5903,_0x1c41a4,_0x1b9ff1){var _0x5c1226={};var _0x4adb47={};var _0x5666e4;var _0x17626f;return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x4d5903['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x1c41a4,null))[_0x4b26('0x1f')](function(_0x135f35){if(_0x135f35){_0x5666e4=_0x135f35;_0x4adb47[_0x4b26('0x4a')]=_[_0x4b26('0x49')](db['MailApplication'][_0x4b26('0x46')]);_0x4adb47['query']=_[_0x4b26('0x49')](_0x4d5903[_0x4b26('0x48')]);_0x4adb47[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x4adb47[_0x4b26('0x4a')],_0x4adb47[_0x4b26('0x48')]);_0x5c1226['attributes']=_['intersection'](_0x4adb47[_0x4b26('0x4a')],qs[_0x4b26('0x4d')](_0x4d5903[_0x4b26('0x48')]['fields']));_0x5c1226[_0x4b26('0x4b')]=_0x5c1226['attributes']['length']?_0x5c1226['attributes']:_0x4adb47[_0x4b26('0x4a')];_0x5c1226[_0x4b26('0x50')]=qs[_0x4b26('0x51')](_0x4d5903[_0x4b26('0x48')][_0x4b26('0x51')]);_0x5c1226[_0x4b26('0x52')]=qs[_0x4b26('0x5a')](_[_0x4b26('0x53')](_0x4d5903[_0x4b26('0x48')],_0x4adb47[_0x4b26('0x5a')]));if(_0x4d5903[_0x4b26('0x48')][_0x4b26('0x64')]){_0x5c1226['where']=_[_0x4b26('0x54')](_0x5c1226[_0x4b26('0x52')],{'$or':_[_0x4b26('0x44')](_0x5c1226[_0x4b26('0x4b')],function(_0x592ec1){var _0x4e03d4={};_0x4e03d4[_0x592ec1]={'$like':'%'+_0x4d5903[_0x4b26('0x48')]['filter']+'%'};return _0x4e03d4;})});}_0x5c1226=_[_0x4b26('0x54')]({},_0x5c1226,_0x4d5903[_0x4b26('0x5b')]);return _0x5666e4[_0x4b26('0x98')](_0x5c1226);}})[_0x4b26('0x1f')](function(_0x102548){if(_0x102548){_0x17626f=_0x102548['length'];if(!_0x4d5903[_0x4b26('0x48')][_0x4b26('0x63')](_0x4b26('0x4f'))){_0x5c1226[_0x4b26('0x30')]=qs['limit'](_0x4d5903['query'][_0x4b26('0x30')]);_0x5c1226[_0x4b26('0x2e')]=qs[_0x4b26('0x2e')](_0x4d5903[_0x4b26('0x48')][_0x4b26('0x2e')]);}return _0x5666e4[_0x4b26('0x98')](_0x5c1226);}})[_0x4b26('0x1f')](function(_0xb36448){if(_0xb36448){return _0xb36448?{'count':_0x17626f,'rows':_0xb36448}:null;}})[_0x4b26('0x1f')](respondWithResult(_0x1c41a4,null))[_0x4b26('0x29')](handleError(_0x1c41a4,null));};exports['getMessages']=function(_0x406f03,_0x15185c,_0x5330aa){var _0x8d1833={'raw':!![],'where':{}};var _0x56a184={};var _0x4218c7={'count':0x0,'rows':[]};return db[_0x4b26('0x45')]['findOne']({'where':{'id':_0x406f03[_0x4b26('0x58')]['id']}})['then'](handleEntityNotFound(_0x15185c,null))[_0x4b26('0x1f')](function(_0x23da31){if(_0x23da31){_0x56a184[_0x4b26('0x4a')]=_[_0x4b26('0x49')](db[_0x4b26('0x99')][_0x4b26('0x46')]);_0x56a184[_0x4b26('0x48')]=_[_0x4b26('0x49')](_0x406f03[_0x4b26('0x48')]);_0x56a184[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x56a184['model'],_0x56a184['query']);_0x8d1833['attributes']=_[_0x4b26('0x4c')](_0x56a184['model'],qs[_0x4b26('0x4d')](_0x406f03[_0x4b26('0x48')]['fields']));_0x8d1833[_0x4b26('0x4b')]=_0x8d1833[_0x4b26('0x4b')][_0x4b26('0x4e')]?_0x8d1833[_0x4b26('0x4b')]:_0x56a184['model'];if(!_0x406f03[_0x4b26('0x48')][_0x4b26('0x63')](_0x4b26('0x4f'))){_0x8d1833[_0x4b26('0x30')]=qs['limit'](_0x406f03[_0x4b26('0x48')][_0x4b26('0x30')]);_0x8d1833[_0x4b26('0x2e')]=qs[_0x4b26('0x2e')](_0x406f03[_0x4b26('0x48')][_0x4b26('0x2e')]);}_0x8d1833[_0x4b26('0x50')]=qs[_0x4b26('0x51')](_0x406f03['query'][_0x4b26('0x51')]);_0x8d1833[_0x4b26('0x52')]=qs[_0x4b26('0x5a')](_['pick'](_0x406f03[_0x4b26('0x48')],_0x56a184['filters']));_0x8d1833[_0x4b26('0x52')][_0x4b26('0x6b')]=_0x23da31['id'];if(_0x406f03[_0x4b26('0x48')][_0x4b26('0x64')]){_0x8d1833[_0x4b26('0x52')]=_[_0x4b26('0x54')](_0x8d1833[_0x4b26('0x52')],{'$or':_[_0x4b26('0x44')](_0x8d1833['attributes'],function(_0x24da84){var _0x54e337={};_0x54e337[_0x24da84]={'$like':'%'+_0x406f03[_0x4b26('0x48')][_0x4b26('0x64')]+'%'};return _0x54e337;})});}if(_0x406f03[_0x4b26('0x48')][_0x4b26('0x9a')]){var _0x5a0724=_0x406f03[_0x4b26('0x48')][_0x4b26('0x9a')][_0x4b26('0x9b')](',');var _0x890e1b={};_0x890e1b[_0x5a0724[0x0]]={'$gte':moment(_0x5a0724[0x1])[_0x4b26('0x9c')](_0x4b26('0x9d'))};_0x8d1833[_0x4b26('0x52')]=_[_0x4b26('0x54')](_0x8d1833[_0x4b26('0x52')],_0x890e1b);}_0x8d1833=_[_0x4b26('0x54')]({},_0x8d1833,_0x406f03[_0x4b26('0x5b')]);return db['MailMessage'][_0x4b26('0x31')]({'where':_0x8d1833['where']})[_0x4b26('0x1f')](function(_0x3d685c){_0x4218c7['count']=_0x3d685c;if(_0x406f03[_0x4b26('0x48')][_0x4b26('0x55')]){_0x8d1833['include']=[{'all':!![]}];}return db[_0x4b26('0x99')][_0x4b26('0x57')](_0x8d1833);})[_0x4b26('0x1f')](function(_0x223b7a){if(_0x406f03[_0x4b26('0x48')]['inlineCss']===_0x4b26('0x9e')){for(var _0x11afba=0x0;_0x11afba<_0x223b7a['length'];_0x11afba++){_0x223b7a[_0x11afba][_0x4b26('0x5d')]=juice(_0x223b7a[_0x11afba]['body']);}}_0x4218c7[_0x4b26('0x65')]=_0x223b7a;return _0x4218c7;});}})[_0x4b26('0x1f')](respondWithFilteredResult(_0x15185c,_0x8d1833))['catch'](handleError(_0x15185c,null));};exports[_0x4b26('0x3d')]=function(_0xf588c5,_0x5b28cb,_0x1df30b){var _0x5dc381,_0x2e427a={},_0x1c8289;if(_0xf588c5[_0x4b26('0x5d')]['to']){_0x1c8289=_0xf588c5[_0x4b26('0x5d')]['to'][_0x4b26('0x9b')](',')[0x0];}return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0xf588c5[_0x4b26('0x58')]['id']},'include':[{'model':db[_0x4b26('0x9f')],'as':_0x4b26('0xa0'),'include':[{'model':db['CmContact'],'as':_0x4b26('0xa1'),'where':{'email':_0x1c8289},'limit':0x1,'order':[[_0x4b26('0xa2'),_0x4b26('0xa3')]]}]},{'model':db[_0x4b26('0x40')],'as':_0x4b26('0x41'),'raw':!![]}]})[_0x4b26('0x1f')](handleEntityNotFound(_0x5b28cb,null))[_0x4b26('0x1f')](function(_0x211872){if(_0x211872){_0x5dc381=_0x211872;if(_0x211872['Smtp']){if(_[_0x4b26('0x6e')](_0xf588c5['body'][_0x4b26('0xa4')])){_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa4')]=util[_0x4b26('0x9c')]('%s\x20<%s>',_0x211872['name'],_0x211872['email']||_0x211872['Smtp'][_0x4b26('0x73')]);}if(_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa5')]&&_0xf588c5['body'][_0x4b26('0xa5')][_0x4b26('0x4e')]){for(var _0x267684=0x0;_0x267684<_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa5')][_0x4b26('0x4e')];_0x267684+=0x1){_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa5')][_0x267684]={'filename':_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa5')][_0x267684][_0x4b26('0x3c')],'path':path[_0x4b26('0xa6')](config[_0x4b26('0xa7')],_0x4b26('0xa8'),_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa5')][_0x267684][_0x4b26('0xa9')])};}}var _0xb8c51a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x211872['Smtp']['service'])){if(_0x211872[_0x4b26('0x41')]['authentication']){_0xb8c51a['auth']={'user':_0x211872['Smtp'][_0x4b26('0x73')],'pass':_0x211872[_0x4b26('0x41')][_0x4b26('0xaa')]};}_0xb8c51a[_0x4b26('0x78')]=_0x211872['Smtp'][_0x4b26('0x78')];_0xb8c51a[_0x4b26('0x79')]=_0x211872[_0x4b26('0x41')]['port'];_0xb8c51a[_0x4b26('0xab')]=_0x211872[_0x4b26('0x41')][_0x4b26('0xab')];}else{_0xb8c51a[_0x4b26('0x7a')]=_0x211872['Smtp'][_0x4b26('0x7a')];_0xb8c51a[_0x4b26('0xac')]={'user':_0x211872['Smtp'][_0x4b26('0x73')],'pass':_0x211872['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0x4b26('0xad'),{'account':_0xb8c51a,'message':_0xf588c5[_0x4b26('0x5d')]});}else{throw new Error(_0x4b26('0xae'));}}})[_0x4b26('0x1f')](function(_0x434351){if(_0x434351){_0x2e427a=_0x434351;if(_0x5dc381[_0x4b26('0xa0')]){if(_0x5dc381[_0x4b26('0xa0')][_0x4b26('0xa1')][_0x4b26('0x4e')]){return _0x5dc381[_0x4b26('0xa0')][_0x4b26('0xa1')][0x0];}else{return db['CmContact'][_0x4b26('0x60')](_[_0x4b26('0x17')](_0xf588c5[_0x4b26('0x5d')],{'firstName':_0xf588c5[_0x4b26('0x5d')]['to'],'email':_0xf588c5[_0x4b26('0x5d')]['to'],'phone':_0xf588c5[_0x4b26('0x5d')]['to'],'ListId':_0x5dc381[_0x4b26('0xaf')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x4b26('0x1f')](function(_0x22215b){if(_0x22215b){var _0x2aa2ff={'UserId':_0xf588c5[_0x4b26('0x73')]['id'],'ContactId':_0x22215b['id'],'MailAccountId':_0x5dc381['id'],'inReplyTo':_0x2e427a[_0x4b26('0xb0')],'to':_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xa4')],'cc':_0xf588c5[_0x4b26('0x5d')]['cc'],'subject':_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xb1')],'attach':_0xf588c5['body'][_0x4b26('0xb2')],'firstMsgDirection':_0x4b26('0xb3'),'lastMsgAt':moment()[_0x4b26('0x9c')](_0x4b26('0x9d')),'lastMsgDirection':_0x4b26('0xb3'),'Messages':[_[_0x4b26('0x54')](_0xf588c5[_0x4b26('0x5d')],{'messageId':_0x2e427a[_0x4b26('0xb0')],'sentAt':moment()['format'](_0x4b26('0x9d')),'read':!![],'MailAccountId':_0x5dc381['id'],'UserId':_0xf588c5[_0x4b26('0x73')]['id'],'ContactId':_0x22215b['id']})]};if(_0xf588c5[_0x4b26('0x5d')][_0x4b26('0xb4')]){_0x2aa2ff=_[_0x4b26('0x54')](_0x2aa2ff,_0xf588c5['body'][_0x4b26('0xb4')]);}return db[_0x4b26('0x86')][_0x4b26('0x60')](_0x2aa2ff,{'include':[{'model':db[_0x4b26('0x99')],'as':'Messages'}]});}})[_0x4b26('0x1f')](respondWithResult(_0x5b28cb,null))[_0x4b26('0x29')](handleError(_0x5b28cb,null));};exports[_0x4b26('0xb5')]=function(_0x13afcd,_0x5326b3,_0x5f391c){return db[_0x4b26('0x45')]['find']({'where':{'id':_0x13afcd[_0x4b26('0x58')]['id']},'include':[{'model':db[_0x4b26('0x40')],'as':_0x4b26('0x41'),'raw':!![]}]})[_0x4b26('0x1f')](handleEntityNotFound(_0x5326b3,null))[_0x4b26('0x1f')](function(_0x4b705b){if(_0x4b705b&&_0x4b705b['Smtp']){var _0x594926={'id':_0x4b705b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4b705b[_0x4b26('0x41')][_0x4b26('0x7a')]){_0x594926[_0x4b26('0x7a')]=_0x4b705b[_0x4b26('0x41')][_0x4b26('0x7a')];}else{_0x594926[_0x4b26('0x78')]=_0x4b705b['Smtp'][_0x4b26('0x78')];_0x594926['port']=_0x4b705b[_0x4b26('0x41')][_0x4b26('0x79')];_0x594926['secure']=_0x4b705b[_0x4b26('0x41')]['secure'];}if(_0x4b705b[_0x4b26('0x41')]['authentication']){_0x594926[_0x4b26('0xac')]={'user':_0x4b705b[_0x4b26('0x41')]['user'],'pass':_0x4b705b['Smtp'][_0x4b26('0xaa')]};}return respondWithRpcPromise('VerifySmtp',_0x4b26('0xb5'),{'account':_0x594926});}})[_0x4b26('0x1f')](respondWithResult(_0x5326b3,null))[_0x4b26('0x29')](handleError(_0x5326b3,null));};exports['destroy']=function(_0x21bd1a,_0x28200f){return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x21bd1a['params']['id']}})['then'](handleEntityNotFound(_0x28200f,null))['then'](function(_0x2cef56){if(_0x2cef56&&_0x2cef56[_0x4b26('0x7a')]){throw new db[(_0x4b26('0xb6'))][(_0x4b26('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2cef56;})['then'](removeEntity(_0x28200f,null))[_0x4b26('0x29')](handleError(_0x28200f,null));};exports['addAgents']=function(_0x577b1d,_0x4c2dbe,_0x2e468a){return db['MailAccount'][_0x4b26('0x5c')]({'where':{'id':_0x577b1d['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x4c2dbe,null))['then'](function(_0x3f1fa4){if(_0x3f1fa4){return _0x3f1fa4[_0x4b26('0xb8')](_0x577b1d['body'][_0x4b26('0x67')],_[_0x4b26('0x87')](_0x577b1d['body'],[_0x4b26('0x67'),'id'])||{})[_0x4b26('0xb9')](function(_0x2d8c69){for(var _0x2f41e5=0x0;_0x2f41e5<_0x577b1d[_0x4b26('0x5d')][_0x4b26('0x67')][_0x4b26('0x4e')];_0x2f41e5+=0x1){socket[_0x4b26('0xba')](_0x4b26('0xbb'),{'UserId':Number(_0x577b1d[_0x4b26('0x5d')][_0x4b26('0x67')][_0x2f41e5]),'MailAccountId':Number(_0x577b1d['params']['id'])});}return _0x2d8c69;});}})['then'](respondWithResult(_0x4c2dbe,null))[_0x4b26('0x29')](handleError(_0x4c2dbe,null));};exports['removeAgents']=function(_0x51601a,_0xea1d8b,_0x61da16){return db[_0x4b26('0x45')][_0x4b26('0x5c')]({'where':{'id':_0x51601a[_0x4b26('0x58')]['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0xea1d8b,null))[_0x4b26('0x1f')](function(_0x59d671){if(_0x59d671){return _0x59d671['removeAgents'](_0x51601a[_0x4b26('0x48')][_0x4b26('0x67')])[_0x4b26('0x1f')](function(){if(_[_0x4b26('0xbc')](_0x51601a[_0x4b26('0x48')]['ids'])){for(var _0x20addc=0x0;_0x20addc<_0x51601a[_0x4b26('0x48')]['ids'][_0x4b26('0x4e')];_0x20addc+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x51601a[_0x4b26('0x48')][_0x4b26('0x67')][_0x20addc]),'MailAccountId':Number(_0x51601a[_0x4b26('0x58')]['id'])});}}else{socket[_0x4b26('0xba')](_0x4b26('0xbd'),{'UserId':Number(_0x51601a['query'][_0x4b26('0x67')]),'MailAccountId':Number(_0x51601a[_0x4b26('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0xea1d8b,null))[_0x4b26('0x29')](handleError(_0xea1d8b,null));};exports['getAgents']=function(_0x3a8e20,_0x682949,_0x1f1d4f){var _0x47f79a={};var _0x84a11f={};var _0x597cab;var _0x10d8c1;return db[_0x4b26('0x45')][_0x4b26('0x62')]({'where':{'id':_0x3a8e20['params']['id']}})[_0x4b26('0x1f')](handleEntityNotFound(_0x682949,null))[_0x4b26('0x1f')](function(_0x53718a){if(_0x53718a){_0x597cab=_0x53718a;_0x84a11f[_0x4b26('0x4a')]=_['keys'](db['User'][_0x4b26('0x46')]);_0x84a11f['query']=_['keys'](_0x3a8e20['query']);_0x84a11f[_0x4b26('0x5a')]=_[_0x4b26('0x4c')](_0x84a11f[_0x4b26('0x4a')],_0x84a11f['query']);_0x47f79a[_0x4b26('0x4b')]=_[_0x4b26('0x4c')](_0x84a11f[_0x4b26('0x4a')],qs[_0x4b26('0x4d')](_0x3a8e20[_0x4b26('0x48')]['fields']));_0x47f79a[_0x4b26('0x4b')]=_0x47f79a['attributes'][_0x4b26('0x4e')]?_0x47f79a[_0x4b26('0x4b')]:_0x84a11f[_0x4b26('0x4a')];_0x47f79a[_0x4b26('0x50')]=qs[_0x4b26('0x51')](_0x3a8e20[_0x4b26('0x48')][_0x4b26('0x51')]);_0x47f79a[_0x4b26('0x52')]=qs['filters'](_[_0x4b26('0x53')](_0x3a8e20[_0x4b26('0x48')],_0x84a11f[_0x4b26('0x5a')]));if(_0x3a8e20['query'][_0x4b26('0x64')]){_0x47f79a['where']=_[_0x4b26('0x54')](_0x47f79a[_0x4b26('0x52')],{'$or':_['map'](_0x47f79a['attributes'],function(_0x99b373){var _0x2cdb63={};_0x2cdb63[_0x99b373]={'$like':'%'+_0x3a8e20['query'][_0x4b26('0x64')]+'%'};return _0x2cdb63;})});}_0x47f79a=_['merge']({},_0x47f79a,_0x3a8e20[_0x4b26('0x5b')]);return _0x597cab['getAgents'](_0x47f79a);}})['then'](function(_0x19b117){if(_0x19b117){_0x10d8c1=_0x19b117['length'];if(!_0x3a8e20[_0x4b26('0x48')]['hasOwnProperty']('nolimit')){_0x47f79a['limit']=qs['limit'](_0x3a8e20[_0x4b26('0x48')][_0x4b26('0x30')]);_0x47f79a[_0x4b26('0x2e')]=qs['offset'](_0x3a8e20[_0x4b26('0x48')][_0x4b26('0x2e')]);}return _0x597cab[_0x4b26('0xbe')](_0x47f79a);}})['then'](function(_0x4731a4){if(_0x4731a4){return _0x4731a4?{'count':_0x10d8c1,'rows':_0x4731a4}:null;}})['then'](respondWithResult(_0x682949,null))[_0x4b26('0x29')](handleError(_0x682949,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 4394b8d..e00e796 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 _0x5458=['../../mysqldb','MailAccount','save','update','emit','hasOwnProperty','hook','events'];(function(_0x20b793,_0x258dc7){var _0x204535=function(_0x56a8c6){while(--_0x56a8c6){_0x20b793['push'](_0x20b793['shift']());}};_0x204535(++_0x258dc7);}(_0x5458,0x1c7));var _0x8545=function(_0x179f07,_0x4763dc){_0x179f07=_0x179f07-0x0;var _0x12d6d1=_0x5458[_0x179f07];return _0x12d6d1;};'use strict';var EventEmitter=require(_0x8545('0x0'));var MailAccount=require(_0x8545('0x1'))['db'][_0x8545('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8545('0x3'),'afterUpdate':_0x8545('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35d361){return function(_0x1d3a7b,_0x31e7cf,_0x4dee65){MailAccountEvents[_0x8545('0x5')](_0x35d361+':'+_0x1d3a7b['id'],_0x1d3a7b);MailAccountEvents[_0x8545('0x5')](_0x35d361,_0x1d3a7b);_0x4dee65(null);};}for(var e in events){if(events[_0x8545('0x6')](e)){var event=events[e];MailAccount[_0x8545('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xcd92=['../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x262fef,_0x4a8a3a){var _0x4f795c=function(_0x5973df){while(--_0x5973df){_0x262fef['push'](_0x262fef['shift']());}};_0x4f795c(++_0x4a8a3a);}(_0xcd92,0x1c2));var _0x2cd9=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xcd92[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x2cd9('0x0'))['db'][_0x2cd9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2cd9('0x2')](0x0);var events={'afterCreate':_0x2cd9('0x3'),'afterUpdate':'update','afterDestroy':_0x2cd9('0x4')};function emitEvent(_0xe22474){return function(_0x487cee,_0x380077,_0x540015){MailAccountEvents[_0x2cd9('0x5')](_0xe22474+':'+_0x487cee['id'],_0x487cee);MailAccountEvents[_0x2cd9('0x5')](_0xe22474,_0x487cee);_0x540015(null);};}for(var e in events){if(events[_0x2cd9('0x6')](e)){var event=events[e];MailAccount[_0x2cd9('0x7')](e,emitEvent(event));}}module[_0x2cd9('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 b374f32..1e9fd57 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 _0x3b0c=['path','../../config/environment','./mailAccount.attributes','define','MailAccount','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2d3a72,_0x3e591d){var _0x5f2a1c=function(_0x184948){while(--_0x184948){_0x2d3a72['push'](_0x2d3a72['shift']());}};_0x5f2a1c(++_0x3e591d);}(_0x3b0c,0xcd));var _0xc3b0=function(_0x5c0fc4,_0x1b114a){_0x5c0fc4=_0x5c0fc4-0x0;var _0x975db6=_0x3b0c[_0x5c0fc4];return _0x975db6;};'use strict';var _=require('lodash');var util=require(_0xc3b0('0x0'));var logger=require(_0xc3b0('0x1'))(_0xc3b0('0x2'));var moment=require('moment');var BPromise=require(_0xc3b0('0x3'));var rp=require(_0xc3b0('0x4'));var fs=require('fs');var path=require(_0xc3b0('0x5'));var rimraf=require('rimraf');var config=require(_0xc3b0('0x6'));var attributes=require(_0xc3b0('0x7'));module['exports']=function(_0x5e253c,_0x56f630){return _0x5e253c[_0xc3b0('0x8')](_0xc3b0('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x980b=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x2594f5,_0x32c9b6){var _0x404765=function(_0x10dafe){while(--_0x10dafe){_0x2594f5['push'](_0x2594f5['shift']());}};_0x404765(++_0x32c9b6);}(_0x980b,0x17a));var _0xb980=function(_0x52ace0,_0x223adb){_0x52ace0=_0x52ace0-0x0;var _0x1c95bb=_0x980b[_0x52ace0];return _0x1c95bb;};'use strict';var _=require(_0xb980('0x0'));var util=require('util');var logger=require(_0xb980('0x1'))(_0xb980('0x2'));var moment=require(_0xb980('0x3'));var BPromise=require(_0xb980('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb980('0x5'));var rimraf=require(_0xb980('0x6'));var config=require(_0xb980('0x7'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x160047,_0x548464){return _0x160047[_0xb980('0x8')]('MailAccount',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 8ef23dc..04487a4 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 _0x4701=['agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','CmContact','MailServerOut','Smtp','get','Applications','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','Contacts','List\x20not\x20found','contact','messageId','generate','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','create','attachments','originTo','bcc','ChatWebsiteId','Attachment','Attachments','UserId','User','name','unshift'];(function(_0x2ccf68,_0x1d41df){var _0x2793f7=function(_0x3351af){while(--_0x3351af){_0x2ccf68['push'](_0x2ccf68['shift']());}};_0x2793f7(++_0x1d41df);}(_0x4701,0x145));var _0x1470=function(_0x968110,_0x9c78e5){_0x968110=_0x968110-0x0;var _0x311eb7=_0x4701[_0x968110];return _0x311eb7;};'use strict';var _=require(_0x1470('0x0'));var util=require(_0x1470('0x1'));var moment=require(_0x1470('0x2'));var BPromise=require(_0x1470('0x3'));var rs=require(_0x1470('0x4'));var fs=require('fs');var Redis=require(_0x1470('0x5'));var db=require(_0x1470('0x6'))['db'];var utils=require(_0x1470('0x7'));var logger=require(_0x1470('0x8'))(_0x1470('0x9'));var config=require('../../config/environment');var jayson=require(_0x1470('0xa'));var client=jayson[_0x1470('0xb')][_0x1470('0xc')]({'port':0x232c});config[_0x1470('0xd')]=_[_0x1470('0xe')](config[_0x1470('0xd')],{'host':_0x1470('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1470('0xd')]));require(_0x1470('0x10'))[_0x1470('0x11')](socket);function respondWithRpcPromise(_0x3b183c,_0x17c061,_0x229e90){return new BPromise(function(_0x77e2a6,_0x2b3506){return client[_0x1470('0x12')](_0x3b183c,_0x229e90)[_0x1470('0x13')](function(_0x169859){logger[_0x1470('0x14')](_0x1470('0x15'),_0x17c061,_0x1470('0x16'));logger['debug'](_0x1470('0x17'),_0x17c061,_0x1470('0x16'),JSON[_0x1470('0x18')](_0x169859));if(_0x169859['error']){if(_0x169859[_0x1470('0x19')][_0x1470('0x1a')]===0x1f4){logger[_0x1470('0x19')](_0x1470('0x15'),_0x17c061,_0x169859[_0x1470('0x19')][_0x1470('0x1b')]);return _0x2b3506(_0x169859['error'][_0x1470('0x1b')]);}logger[_0x1470('0x19')]('MailAccount,\x20%s,\x20%s',_0x17c061,_0x169859[_0x1470('0x19')][_0x1470('0x1b')]);return _0x77e2a6(_0x169859[_0x1470('0x19')][_0x1470('0x1b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x17c061,_0x1470('0x16'));_0x77e2a6(_0x169859[_0x1470('0x1c')][_0x1470('0x1b')]);}})[_0x1470('0x1d')](function(_0x5e32c6){logger[_0x1470('0x19')](_0x1470('0x15'),_0x17c061,_0x5e32c6);_0x2b3506(_0x5e32c6);});});}exports[_0x1470('0x1e')]=function(_0x23b14e){var _0x3d0441=this;return new Promise(function(_0x72a1ae,_0x26992d){return db[_0x1470('0x1f')]['findAll']({'raw':_0x23b14e[_0x1470('0x20')]?_0x23b14e[_0x1470('0x20')][_0x1470('0x21')]===undefined?!![]:![]:!![],'where':_0x23b14e[_0x1470('0x20')]?_0x23b14e['options'][_0x1470('0x22')]||null:null,'attributes':_0x23b14e[_0x1470('0x20')]?_0x23b14e[_0x1470('0x20')][_0x1470('0x23')]||null:null,'limit':_0x23b14e['options']?_0x23b14e[_0x1470('0x20')][_0x1470('0x24')]||null:null,'include':_0x23b14e['options']?_0x23b14e[_0x1470('0x20')][_0x1470('0x25')]?_[_0x1470('0x26')](_0x23b14e[_0x1470('0x20')][_0x1470('0x25')],function(_0x318b4c){return{'model':db[_0x318b4c['model']],'as':_0x318b4c['as'],'attributes':_0x318b4c['attributes'],'include':_0x318b4c['include']?_[_0x1470('0x26')](_0x318b4c[_0x1470('0x25')],function(_0x5bc040){return{'model':db[_0x5bc040[_0x1470('0x27')]],'as':_0x5bc040['as'],'attributes':_0x5bc040[_0x1470('0x23')],'include':_0x5bc040[_0x1470('0x25')]?_[_0x1470('0x26')](_0x5bc040[_0x1470('0x25')],function(_0x2eea2e){return{'model':db[_0x2eea2e['model']],'as':_0x2eea2e['as'],'attributes':_0x2eea2e[_0x1470('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1470('0x13')](function(_0x41c8b4){logger[_0x1470('0x14')](_0x1470('0x1e'),_0x23b14e);logger[_0x1470('0x28')](_0x1470('0x1e'),_0x23b14e,JSON[_0x1470('0x18')](_0x41c8b4));_0x72a1ae(_0x41c8b4);})['catch'](function(_0x5b31b4){logger['error'](_0x1470('0x1e'),_0x5b31b4[_0x1470('0x1b')],_0x23b14e);_0x26992d(_0x3d0441[_0x1470('0x19')](0x1f4,_0x5b31b4[_0x1470('0x1b')]));});});};exports[_0x1470('0x29')]=function(_0x4198b8){var _0xe9d187=this;return new Promise(function(_0x470620,_0x145f40){return db[_0x1470('0x1f')][_0x1470('0x2a')]({'raw':_0x4198b8[_0x1470('0x20')]?_0x4198b8[_0x1470('0x20')][_0x1470('0x21')]===undefined?!![]:![]:!![],'where':_0x4198b8[_0x1470('0x20')]?_0x4198b8[_0x1470('0x20')][_0x1470('0x22')]||null:null,'attributes':_0x4198b8[_0x1470('0x20')]?_0x4198b8[_0x1470('0x20')][_0x1470('0x23')]||null:null,'include':_0x4198b8[_0x1470('0x20')]?_0x4198b8[_0x1470('0x20')][_0x1470('0x25')]?_[_0x1470('0x26')](_0x4198b8[_0x1470('0x20')][_0x1470('0x25')],function(_0x1ad9a6){return{'model':db[_0x1ad9a6[_0x1470('0x27')]],'as':_0x1ad9a6['as'],'attributes':_0x1ad9a6[_0x1470('0x23')],'include':_0x1ad9a6[_0x1470('0x25')]?_[_0x1470('0x26')](_0x1ad9a6[_0x1470('0x25')],function(_0x6b1037){return{'model':db[_0x6b1037['model']],'as':_0x6b1037['as'],'attributes':_0x6b1037[_0x1470('0x23')],'include':_0x6b1037[_0x1470('0x25')]?_['map'](_0x6b1037[_0x1470('0x25')],function(_0x483628){return{'model':db[_0x483628['model']],'as':_0x483628['as'],'attributes':_0x483628[_0x1470('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1470('0x13')](function(_0x50999e){logger[_0x1470('0x14')]('ShowMailAccount',_0x4198b8);logger[_0x1470('0x28')](_0x1470('0x29'),_0x4198b8,JSON[_0x1470('0x18')](_0x50999e));_0x470620(_0x50999e);})['catch'](function(_0x388f37){logger[_0x1470('0x19')](_0x1470('0x29'),_0x388f37[_0x1470('0x1b')],_0x4198b8);_0x145f40(_0xe9d187[_0x1470('0x19')](0x1f4,_0x388f37[_0x1470('0x1b')]));});});};exports[_0x1470('0x2b')]=function(_0x41f8af){var _0x3e8966=this;return new Promise(function(_0xaa6110,_0x7ab3cf){var _0x358268={'body':_0x41f8af[_0x1470('0x2c')],'channel':_0x1470('0x2d')};var _0x486456=_['difference'](_[_0x1470('0x2e')](db['CmContact'][_0x1470('0x2f')]),[_0x1470('0x30'),_0x1470('0x31'),_0x1470('0x32'),_0x1470('0x33')]);var _0x25291f=![];if(_0x41f8af['body']['id']){delete _0x41f8af[_0x1470('0x2c')]['id'];}if(_[_0x1470('0x34')](_0x41f8af[_0x1470('0x2c')][_0x1470('0x35')])){return _0x7ab3cf(_0x3e8966['error'](0x1f4,_0x1470('0x36')));}if(_[_0x1470('0x34')](_0x41f8af[_0x1470('0x2c')][_0x1470('0x2c')])||_0x41f8af['body']['body']===''){return _0x7ab3cf(_0x3e8966[_0x1470('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1470('0x34')](_0x41f8af[_0x1470('0x2c')][_0x1470('0x37')])){return _0x7ab3cf(_0x3e8966[_0x1470('0x19')](0x1f4,_0x1470('0x38')+_0x486456));}if(!_[_0x1470('0x39')](_0x486456,_0x41f8af[_0x1470('0x2c')][_0x1470('0x37')])){return _0x7ab3cf(_0x3e8966[_0x1470('0x19')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x486456));}var _0x4d8195={};_0x4d8195[_0x41f8af[_0x1470('0x2c')][_0x1470('0x37')]]=_0x41f8af[_0x1470('0x2c')][_0x1470('0x35')];return db[_0x1470('0x1f')][_0x1470('0x2a')]({'where':{'id':_0x41f8af[_0x1470('0x3a')]['id']},'include':[{'model':db[_0x1470('0x3b')],'as':_0x1470('0x3c'),'include':[{'model':db[_0x1470('0x3d')],'as':'Contacts','where':_0x4d8195,'limit':0x1,'order':[[_0x1470('0x31'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x1470('0x3e')],'as':_0x1470('0x3f')}]})[_0x1470('0x13')](function(_0x2a02f3){if(_0x2a02f3&&_0x2a02f3[_0x1470('0x3c')]){var _0x579271=_0x2a02f3[_0x1470('0x40')]({'plain':!![]});_0x358268[_0x1470('0x3a')]=_['omit'](_0x579271,[_0x1470('0x41'),_0x1470('0x3c')]);_0x358268[_0x1470('0x42')]=_0x579271['Applications'];_0x358268[_0x1470('0x43')]=_0x579271[_0x1470('0x3c')];_0x358268['applications']=_[_0x1470('0x44')](_0x358268[_0x1470('0x42')],[_0x1470('0x45')],[_0x1470('0x46')]);if(_0x358268[_0x1470('0x3a')]&&_0x358268[_0x1470('0x3a')]['autoclose']){_0x358268[_0x1470('0x42')][_0x1470('0x47')]({'id':0x0,'priority':_0x358268[_0x1470('0x42')][_0x1470('0x48')]+0x1,'app':_0x1470('0x49'),'appdata':_0x1470('0x4a'),'interval':_0x1470('0x4b')});}if(_0x358268[_0x1470('0x3a')][_0x1470('0x41')]){delete _0x358268[_0x1470('0x3a')][_0x1470('0x41')];}if(_0x358268[_0x1470('0x3a')]['List']){delete _0x358268[_0x1470('0x3a')]['List'];}if(_0x579271[_0x1470('0x3c')][_0x1470('0x4c')][_0x1470('0x48')]){return _0x579271[_0x1470('0x3c')][_0x1470('0x4c')][0x0];}var _0x1b0232=_[_0x1470('0xe')](_0x41f8af[_0x1470('0x2c')],{'firstName':_0x41f8af[_0x1470('0x2c')]['from'],'ListId':_0x579271[_0x1470('0x33')]});_0x1b0232[_0x41f8af[_0x1470('0x2c')][_0x1470('0x37')]]=_0x41f8af[_0x1470('0x2c')]['from'];return db[_0x1470('0x3d')]['create'](_0x1b0232);}else{throw new Error(_0x1470('0x4d'));}})[_0x1470('0x13')](function(_0x510bdf){_0x358268[_0x1470('0x4e')]=_0x510bdf;if(_0x510bdf){if(!_0x41f8af['body'][_0x1470('0x1b')][_0x1470('0x4f')]){_0x41f8af['body'][_0x1470('0x1b')]['messageId']=rs[_0x1470('0x50')]()+'\x20'+_0x41f8af['body'][_0x1470('0x1b')][_0x1470('0x35')];}var _0x3046aa={'ContactId':_0x510bdf['id'],'MailAccountId':_0x41f8af[_0x1470('0x3a')]['id'],'inReplyTo':_0x41f8af[_0x1470('0x2c')]['message'][_0x1470('0x4f')],'to':_0x41f8af['body'][_0x1470('0x1b')]['from'],'cc':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')]['cc'],'subject':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x51')],'attach':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')]['attach'],'lastMsgAt':moment()[_0x1470('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1470('0x2a')]({'where':{'closed':![],'MailAccountId':_0x41f8af[_0x1470('0x3a')]['id']},'include':[{'model':db[_0x1470('0x53')],'as':_0x1470('0x54'),'attributes':['messageId'],'where':{'messageId':_0x41f8af[_0x1470('0x2c')]['message'][_0x1470('0x55')]}}]})[_0x1470('0x13')](function(_0x5dedc7){if(_0x5dedc7){return[_0x5dedc7,![]];}return db[_0x1470('0x56')]['create'](_0x3046aa)[_0x1470('0x13')](function(_0x530672){return[_0x530672,!![]];});});}else{throw new Error(_0x1470('0x57'));}})['spread'](function(_0x3a6e8f,_0x1df713){if(_0x3a6e8f){_0x25291f=_0x1df713;if(!_0x1df713){return _0x3a6e8f['update']({'inReplyTo':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x4f')],'to':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x35')],'cc':_0x41f8af['body'][_0x1470('0x1b')]['cc'],'subject':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')]['subject'],'attach':_0x3a6e8f['attach']?_0x3a6e8f[_0x1470('0x58')]:_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x58')],'substatus':null,'substatusAt':moment()[_0x1470('0x52')](_0x1470('0x59')),'lastMsgAt':moment()[_0x1470('0x52')](_0x1470('0x59')),'lastMsgDirection':'in'});}else{return _0x3a6e8f;}}})['then'](function(_0x281587){_0x358268[_0x1470('0x5a')]=_0x281587[_0x1470('0x40')]({'plain':!![]});_0x358268[_0x1470('0x5a')][_0x1470('0x5b')]=_0x25291f;return db[_0x1470('0x53')][_0x1470('0x5c')]({'body':_0x41f8af['body']['body'],'MailAccountId':_0x41f8af['account']['id'],'MailInteractionId':_0x281587['id'],'direction':'in','ContactId':_0x358268[_0x1470('0x4e')]['id'],'messageId':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x4f')],'from':_0x41f8af[_0x1470('0x2c')]['message'][_0x1470('0x35')],'to':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')]['to'],'cc':_0x41f8af['body']['message']['cc'],'subject':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x51')],'attach':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x58')],'Attachments':_0x41f8af[_0x1470('0x2c')]['message'][_0x1470('0x5d')],'originTo':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x5e')],'originCc':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')]['originCc'],'bcc':_0x41f8af[_0x1470('0x2c')][_0x1470('0x1b')][_0x1470('0x5f')],'ChatWebsiteId':_0x41f8af[_0x1470('0x2c')]['message'][_0x1470('0x60')]||null,'originChannel':_0x41f8af['body'][_0x1470('0x1b')]['originChannel']||'Email','ChatOfflineMessageId':_0x41f8af['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x1470('0x61')],'as':_0x1470('0x62')}]});})[_0x1470('0x13')](function(_0x307eb7){_0x358268[_0x1470('0x1b')]=_0x307eb7;if(_0x358268[_0x1470('0x5a')][_0x1470('0x63')]){return db[_0x1470('0x64')][_0x1470('0x2a')]({'attributes':['id',_0x1470('0x65')],'where':{'id':_0x358268['interaction'][_0x1470('0x63')]}})['then'](function(_0x46d64b){if(_0x46d64b){_0x358268[_0x1470('0x42')][_0x1470('0x66')]({'id':0x0,'priority':0x0,'app':_0x1470('0x67'),'appdata':_0x46d64b['name']+','+(_0x358268['account'][_0x1470('0x68')]||0xa),'interval':_0x1470('0x4b')});}return respondWithRpcPromise(_0x1470('0x69'),_0x1470('0x6a'),_0x358268);});}return respondWithRpcPromise(_0x1470('0x69'),_0x1470('0x6a'),_0x358268);})[_0x1470('0x13')](function(_0x5e480c){_0xaa6110(_0x5e480c);})[_0x1470('0x1d')](function(_0x27b891){_0x7ab3cf(_0x3e8966[_0x1470('0x19')](0x1f4,_0x27b891[_0x1470('0x1b')]));});});}; \ No newline at end of file +var _0x42db=['applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachments','User','UserId','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','options','raw','attributes','limit','include','map','model','stringify','find','ShowMailAccount','debug','NotifyMailAccount','mail','keys','CmContact','rawAttributes','createdAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','updatedAt','Applications','get','account'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42db,0x86));var _0xb42d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x42db[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb42d('0x0'));var util=require(_0xb42d('0x1'));var moment=require(_0xb42d('0x2'));var BPromise=require('bluebird');var rs=require(_0xb42d('0x3'));var fs=require('fs');var Redis=require(_0xb42d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb42d('0x5'));var logger=require(_0xb42d('0x6'))(_0xb42d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb42d('0x8'));var client=jayson[_0xb42d('0x9')]['http']({'port':0x232c});config[_0xb42d('0xa')]=_[_0xb42d('0xb')](config[_0xb42d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb42d('0xc'))(new Redis(config['redis']));require(_0xb42d('0xd'))[_0xb42d('0xe')](socket);function respondWithRpcPromise(_0x3754b1,_0x5ba844,_0x1df396){return new BPromise(function(_0x5ba2af,_0x1a18dd){return client[_0xb42d('0xf')](_0x3754b1,_0x1df396)[_0xb42d('0x10')](function(_0x26db31){logger['info'](_0xb42d('0x11'),_0x5ba844,_0xb42d('0x12'));logger['debug'](_0xb42d('0x13'),_0x5ba844,_0xb42d('0x12'),JSON['stringify'](_0x26db31));if(_0x26db31['error']){if(_0x26db31[_0xb42d('0x14')][_0xb42d('0x15')]===0x1f4){logger['error'](_0xb42d('0x11'),_0x5ba844,_0x26db31[_0xb42d('0x14')][_0xb42d('0x16')]);return _0x1a18dd(_0x26db31[_0xb42d('0x14')][_0xb42d('0x16')]);}logger[_0xb42d('0x14')](_0xb42d('0x11'),_0x5ba844,_0x26db31['error'][_0xb42d('0x16')]);return _0x5ba2af(_0x26db31['error'][_0xb42d('0x16')]);}else{logger[_0xb42d('0x17')]('MailAccount,\x20%s,\x20%s',_0x5ba844,_0xb42d('0x12'));_0x5ba2af(_0x26db31[_0xb42d('0x18')]['message']);}})[_0xb42d('0x19')](function(_0x396085){logger[_0xb42d('0x14')](_0xb42d('0x11'),_0x5ba844,_0x396085);_0x1a18dd(_0x396085);});});}exports['GetMailAccount']=function(_0x2ba2d2){var _0x5d5ced=this;return new Promise(function(_0x4aa578,_0x572861){return db[_0xb42d('0x1a')]['findAll']({'raw':_0x2ba2d2[_0xb42d('0x1b')]?_0x2ba2d2[_0xb42d('0x1b')][_0xb42d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ba2d2[_0xb42d('0x1b')]?_0x2ba2d2[_0xb42d('0x1b')]['where']||null:null,'attributes':_0x2ba2d2[_0xb42d('0x1b')]?_0x2ba2d2[_0xb42d('0x1b')][_0xb42d('0x1d')]||null:null,'limit':_0x2ba2d2['options']?_0x2ba2d2[_0xb42d('0x1b')][_0xb42d('0x1e')]||null:null,'include':_0x2ba2d2[_0xb42d('0x1b')]?_0x2ba2d2[_0xb42d('0x1b')][_0xb42d('0x1f')]?_['map'](_0x2ba2d2['options'][_0xb42d('0x1f')],function(_0x1095e0){return{'model':db[_0x1095e0['model']],'as':_0x1095e0['as'],'attributes':_0x1095e0['attributes'],'include':_0x1095e0['include']?_[_0xb42d('0x20')](_0x1095e0[_0xb42d('0x1f')],function(_0x3241e3){return{'model':db[_0x3241e3[_0xb42d('0x21')]],'as':_0x3241e3['as'],'attributes':_0x3241e3[_0xb42d('0x1d')],'include':_0x3241e3[_0xb42d('0x1f')]?_[_0xb42d('0x20')](_0x3241e3[_0xb42d('0x1f')],function(_0x4c37fc){return{'model':db[_0x4c37fc[_0xb42d('0x21')]],'as':_0x4c37fc['as'],'attributes':_0x4c37fc[_0xb42d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb42d('0x10')](function(_0x3d883e){logger[_0xb42d('0x17')]('GetMailAccount',_0x2ba2d2);logger['debug']('GetMailAccount',_0x2ba2d2,JSON[_0xb42d('0x22')](_0x3d883e));_0x4aa578(_0x3d883e);})[_0xb42d('0x19')](function(_0x498a76){logger[_0xb42d('0x14')]('GetMailAccount',_0x498a76[_0xb42d('0x16')],_0x2ba2d2);_0x572861(_0x5d5ced[_0xb42d('0x14')](0x1f4,_0x498a76[_0xb42d('0x16')]));});});};exports['ShowMailAccount']=function(_0x1f4017){var _0x5c0e45=this;return new Promise(function(_0x54f7ed,_0x31e449){return db[_0xb42d('0x1a')][_0xb42d('0x23')]({'raw':_0x1f4017[_0xb42d('0x1b')]?_0x1f4017[_0xb42d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1f4017['options']?_0x1f4017[_0xb42d('0x1b')]['where']||null:null,'attributes':_0x1f4017[_0xb42d('0x1b')]?_0x1f4017[_0xb42d('0x1b')][_0xb42d('0x1d')]||null:null,'include':_0x1f4017[_0xb42d('0x1b')]?_0x1f4017[_0xb42d('0x1b')][_0xb42d('0x1f')]?_['map'](_0x1f4017[_0xb42d('0x1b')]['include'],function(_0x209476){return{'model':db[_0x209476['model']],'as':_0x209476['as'],'attributes':_0x209476[_0xb42d('0x1d')],'include':_0x209476['include']?_['map'](_0x209476[_0xb42d('0x1f')],function(_0x4704c5){return{'model':db[_0x4704c5['model']],'as':_0x4704c5['as'],'attributes':_0x4704c5['attributes'],'include':_0x4704c5[_0xb42d('0x1f')]?_[_0xb42d('0x20')](_0x4704c5[_0xb42d('0x1f')],function(_0xa70a4f){return{'model':db[_0xa70a4f['model']],'as':_0xa70a4f['as'],'attributes':_0xa70a4f[_0xb42d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5699bd){logger[_0xb42d('0x17')](_0xb42d('0x24'),_0x1f4017);logger[_0xb42d('0x25')]('ShowMailAccount',_0x1f4017,JSON[_0xb42d('0x22')](_0x5699bd));_0x54f7ed(_0x5699bd);})[_0xb42d('0x19')](function(_0x31ab4c){logger['error'](_0xb42d('0x24'),_0x31ab4c[_0xb42d('0x16')],_0x1f4017);_0x31e449(_0x5c0e45[_0xb42d('0x14')](0x1f4,_0x31ab4c[_0xb42d('0x16')]));});});};exports[_0xb42d('0x26')]=function(_0x5d4523){var _0x465dbc=this;return new Promise(function(_0x43c421,_0x20a5ef){var _0x714a5e={'body':_0x5d4523['body'],'channel':_0xb42d('0x27')};var _0x405272=_['difference'](_[_0xb42d('0x28')](db[_0xb42d('0x29')][_0xb42d('0x2a')]),[_0xb42d('0x2b'),'updatedAt',_0xb42d('0x2c'),'ListId']);var _0x5270d=![];if(_0x5d4523[_0xb42d('0x2d')]['id']){delete _0x5d4523[_0xb42d('0x2d')]['id'];}if(_[_0xb42d('0x2e')](_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x2f')])){return _0x20a5ef(_0x465dbc[_0xb42d('0x14')](0x1f4,_0xb42d('0x30')));}if(_[_0xb42d('0x2e')](_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x2d')])||_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x2d')]===''){return _0x20a5ef(_0x465dbc[_0xb42d('0x14')](0x1f4,_0xb42d('0x31')));}if(_['isNil'](_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x32')])){return _0x20a5ef(_0x465dbc[_0xb42d('0x14')](0x1f4,_0xb42d('0x33')+_0x405272));}if(!_[_0xb42d('0x34')](_0x405272,_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x32')])){return _0x20a5ef(_0x465dbc['error'](0x1f4,_0xb42d('0x35')+_0x405272));}var _0x2e8407={};_0x2e8407[_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x32')]]=_0x5d4523[_0xb42d('0x2d')]['from'];return db[_0xb42d('0x1a')][_0xb42d('0x23')]({'where':{'id':_0x5d4523['account']['id']},'include':[{'model':db[_0xb42d('0x36')],'as':_0xb42d('0x37'),'include':[{'model':db[_0xb42d('0x29')],'as':'Contacts','where':_0x2e8407,'limit':0x1,'order':[[_0xb42d('0x38'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xb42d('0x39')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xb42d('0x10')](function(_0x17ee02){if(_0x17ee02&&_0x17ee02['List']){var _0x2f4018=_0x17ee02[_0xb42d('0x3a')]({'plain':!![]});_0x714a5e[_0xb42d('0x3b')]=_['omit'](_0x2f4018,[_0xb42d('0x39'),'List']);_0x714a5e[_0xb42d('0x3c')]=_0x2f4018[_0xb42d('0x39')];_0x714a5e[_0xb42d('0x3d')]=_0x2f4018[_0xb42d('0x37')];_0x714a5e[_0xb42d('0x3c')]=_[_0xb42d('0x3e')](_0x714a5e[_0xb42d('0x3c')],[_0xb42d('0x3f')],[_0xb42d('0x40')]);if(_0x714a5e['account']&&_0x714a5e[_0xb42d('0x3b')][_0xb42d('0x41')]){_0x714a5e['applications'][_0xb42d('0x42')]({'id':0x0,'priority':_0x714a5e[_0xb42d('0x3c')]['length']+0x1,'app':_0xb42d('0x43'),'appdata':_0xb42d('0x41'),'interval':_0xb42d('0x44')});}if(_0x714a5e[_0xb42d('0x3b')][_0xb42d('0x39')]){delete _0x714a5e[_0xb42d('0x3b')]['Applications'];}if(_0x714a5e['account'][_0xb42d('0x37')]){delete _0x714a5e[_0xb42d('0x3b')]['List'];}if(_0x2f4018[_0xb42d('0x37')][_0xb42d('0x45')]['length']){return _0x2f4018['List'][_0xb42d('0x45')][0x0];}var _0x9181b4=_['defaults'](_0x5d4523[_0xb42d('0x2d')],{'firstName':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x2f')],'ListId':_0x2f4018['ListId']});_0x9181b4[_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x32')]]=_0x5d4523[_0xb42d('0x2d')]['from'];return db[_0xb42d('0x29')][_0xb42d('0x46')](_0x9181b4);}else{throw new Error(_0xb42d('0x47'));}})[_0xb42d('0x10')](function(_0x5d6712){_0x714a5e['contact']=_0x5d6712;if(_0x5d6712){if(!_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x48')]){_0x5d4523[_0xb42d('0x2d')]['message']['messageId']=rs[_0xb42d('0x49')]()+'\x20'+_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x2f')];}var _0x1bd1fe={'ContactId':_0x5d6712['id'],'MailAccountId':_0x5d4523['account']['id'],'inReplyTo':_0x5d4523['body'][_0xb42d('0x16')]['messageId'],'to':_0x5d4523[_0xb42d('0x2d')]['message'][_0xb42d('0x2f')],'cc':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['cc'],'subject':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['subject'],'attach':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x4a')],'lastMsgAt':moment()[_0xb42d('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xb42d('0x4c')][_0xb42d('0x23')]({'where':{'closed':![],'MailAccountId':_0x5d4523['account']['id']},'include':[{'model':db[_0xb42d('0x4d')],'as':_0xb42d('0x4e'),'attributes':[_0xb42d('0x48')],'where':{'messageId':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x4f')]}}]})[_0xb42d('0x10')](function(_0x3a630c){if(_0x3a630c){return[_0x3a630c,![]];}return db['MailInteraction'][_0xb42d('0x46')](_0x1bd1fe)[_0xb42d('0x10')](function(_0x717924){return[_0x717924,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb42d('0x50')](function(_0x3ddab4,_0x14bbf8){if(_0x3ddab4){_0x5270d=_0x14bbf8;if(!_0x14bbf8){return _0x3ddab4[_0xb42d('0x51')]({'inReplyTo':_0x5d4523['body'][_0xb42d('0x16')][_0xb42d('0x48')],'to':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['from'],'cc':_0x5d4523[_0xb42d('0x2d')]['message']['cc'],'subject':_0x5d4523['body'][_0xb42d('0x16')]['subject'],'attach':_0x3ddab4[_0xb42d('0x4a')]?_0x3ddab4[_0xb42d('0x4a')]:_0x5d4523['body'][_0xb42d('0x16')][_0xb42d('0x4a')],'substatus':null,'substatusAt':moment()['format'](_0xb42d('0x52')),'lastMsgAt':moment()['format'](_0xb42d('0x52')),'lastMsgDirection':'in'});}else{return _0x3ddab4;}}})['then'](function(_0x5b0ce5){_0x714a5e[_0xb42d('0x53')]=_0x5b0ce5[_0xb42d('0x3a')]({'plain':!![]});_0x714a5e['interaction'][_0xb42d('0x54')]=_0x5270d;return db[_0xb42d('0x4d')][_0xb42d('0x46')]({'body':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x2d')],'MailAccountId':_0x5d4523['account']['id'],'MailInteractionId':_0x5b0ce5['id'],'direction':'in','ContactId':_0x714a5e['contact']['id'],'messageId':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x48')],'from':_0x5d4523[_0xb42d('0x2d')]['message'][_0xb42d('0x2f')],'to':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['to'],'cc':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['cc'],'subject':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')]['subject'],'attach':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x4a')],'Attachments':_0x5d4523[_0xb42d('0x2d')]['message'][_0xb42d('0x55')],'originTo':_0x5d4523['body'][_0xb42d('0x16')][_0xb42d('0x56')],'originCc':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x57')],'bcc':_0x5d4523['body'][_0xb42d('0x16')][_0xb42d('0x58')],'ChatWebsiteId':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x59')]||null,'originChannel':_0x5d4523[_0xb42d('0x2d')]['message'][_0xb42d('0x5a')]||'Email','ChatOfflineMessageId':_0x5d4523[_0xb42d('0x2d')][_0xb42d('0x16')][_0xb42d('0x5b')]||null},{'include':[{'model':db['Attachment'],'as':_0xb42d('0x5c')}]});})[_0xb42d('0x10')](function(_0x649fb1){_0x714a5e[_0xb42d('0x16')]=_0x649fb1;if(_0x714a5e['interaction']['UserId']){return db[_0xb42d('0x5d')][_0xb42d('0x23')]({'attributes':['id','name'],'where':{'id':_0x714a5e['interaction'][_0xb42d('0x5e')]}})[_0xb42d('0x10')](function(_0x48e559){if(_0x48e559){_0x714a5e[_0xb42d('0x3c')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x48e559['name']+','+(_0x714a5e[_0xb42d('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb42d('0x5f'),_0xb42d('0x60'),_0x714a5e);});}return respondWithRpcPromise(_0xb42d('0x5f'),'startRouting',_0x714a5e);})[_0xb42d('0x10')](function(_0x2413e2){_0x43c421(_0x2413e2);})[_0xb42d('0x19')](function(_0x106066){_0x20a5ef(_0x465dbc[_0xb42d('0x14')](0x1f4,_0x106066[_0xb42d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c714f8e..581ff4f 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 _0xc92d=['length','mailAccount:','save','remove','update','emit','removeListener'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc92d,0x198));var _0xdc92=function(_0x5aa3a6,_0x37dbaa){_0x5aa3a6=_0x5aa3a6-0x0;var _0x220f18=_0xc92d[_0x5aa3a6];return _0x220f18;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xdc92('0x0'),_0xdc92('0x1'),_0xdc92('0x2')];function createListener(_0x125365,_0x22f4ed){return function(_0x4a9c7f){_0x22f4ed[_0xdc92('0x3')](_0x125365,_0x4a9c7f);};}function removeListener(_0x4de463,_0x453ca0){return function(){MailAccountEvents[_0xdc92('0x4')](_0x4de463,_0x453ca0);};}exports['register']=function(_0x187dfa){for(var _0x562ec0=0x0,_0x2bd39e=events[_0xdc92('0x5')];_0x562ec0<_0x2bd39e;_0x562ec0++){var _0x119da7=events[_0x562ec0];var _0xaf3072=createListener(_0xdc92('0x6')+_0x119da7,_0x187dfa);MailAccountEvents['on'](_0x119da7,_0xaf3072);}}; \ No newline at end of file +var _0x2bbb=['length','mailAccount:','./mailAccount.events','save','update','emit','removeListener'];(function(_0x35463f,_0x10ab94){var _0x32791f=function(_0x290a76){while(--_0x290a76){_0x35463f['push'](_0x35463f['shift']());}};_0x32791f(++_0x10ab94);}(_0x2bbb,0x159));var _0xb2bb=function(_0x29230d,_0x44bacb){_0x29230d=_0x29230d-0x0;var _0x42bfbe=_0x2bbb[_0x29230d];return _0x42bfbe;};'use strict';var MailAccountEvents=require(_0xb2bb('0x0'));var events=[_0xb2bb('0x1'),'remove',_0xb2bb('0x2')];function createListener(_0x4a1336,_0x4d80c7){return function(_0x491cd4){_0x4d80c7[_0xb2bb('0x3')](_0x4a1336,_0x491cd4);};}function removeListener(_0x5328f2,_0x5d0796){return function(){MailAccountEvents[_0xb2bb('0x4')](_0x5328f2,_0x5d0796);};}exports['register']=function(_0xea2830){for(var _0x5cc5ce=0x0,_0x385da5=events[_0xb2bb('0x5')];_0x5cc5ce<_0x385da5;_0x5cc5ce++){var _0x46f4d9=events[_0x5cc5ce];var _0xcd4302=createListener(_0xb2bb('0x6')+_0x46f4d9,_0xea2830);MailAccountEvents['on'](_0x46f4d9,_0xcd4302);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 320ed33..9e4508e 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 _0xe2f0=['put','update','delete','isAuthenticated','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/:id','show'];(function(_0x4159b6,_0x160b2c){var _0x288756=function(_0x1df2bd){while(--_0x1df2bd){_0x4159b6['push'](_0x4159b6['shift']());}};_0x288756(++_0x160b2c);}(_0xe2f0,0x1c8));var _0x0e2f=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0xe2f0[_0x153738];return _0x3028d9;};'use strict';var multer=require(_0x0e2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0e2f('0x1'));var express=require(_0x0e2f('0x2'));var router=express[_0x0e2f('0x3')]();var fs_extra=require(_0x0e2f('0x4'));var auth=require(_0x0e2f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x0e2f('0x6')](_0x0e2f('0x7'),auth['isAuthenticated'](),controller[_0x0e2f('0x8')]);router[_0x0e2f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0e2f('0xa')]);router[_0x0e2f('0xb')](_0x0e2f('0x7'),auth[_0x0e2f('0xc')](),controller[_0x0e2f('0xd')]);module[_0x0e2f('0xe')]=router; \ No newline at end of file +var _0xaefe=['../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ed652,_0x531731){var _0x3c0826=function(_0xc89ce7){while(--_0xc89ce7){_0x5ed652['push'](_0x5ed652['shift']());}};_0x3c0826(++_0x531731);}(_0xaefe,0x64));var _0xeaef=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xaefe[_0x416cdc];return _0x1931ce;};'use strict';var multer=require(_0xeaef('0x0'));var util=require(_0xeaef('0x1'));var path=require(_0xeaef('0x2'));var timeout=require(_0xeaef('0x3'));var express=require('express');var router=express[_0xeaef('0x4')]();var fs_extra=require(_0xeaef('0x5'));var auth=require(_0xeaef('0x6'));var interaction=require(_0xeaef('0x7'));var config=require(_0xeaef('0x8'));var controller=require(_0xeaef('0x9'));router[_0xeaef('0xa')](_0xeaef('0xb'),auth[_0xeaef('0xc')](),controller[_0xeaef('0xd')]);router[_0xeaef('0xe')](_0xeaef('0xb'),auth[_0xeaef('0xc')](),controller[_0xeaef('0xf')]);router['delete'](_0xeaef('0xb'),auth['isAuthenticated'](),controller[_0xeaef('0x10')]);module[_0xeaef('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index c766027..2b3f202 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 _0x3d63=['sequelize','INTEGER','STRING','*,*,*,*'];(function(_0x34fb60,_0x3618df){var _0x29fd41=function(_0x405e48){while(--_0x405e48){_0x34fb60['push'](_0x34fb60['shift']());}};_0x29fd41(++_0x3618df);}(_0x3d63,0x134));var _0x33d6=function(_0x281c80,_0x25c747){_0x281c80=_0x281c80-0x0;var _0x312392=_0x3d63[_0x281c80];return _0x312392;};'use strict';var Sequelize=require(_0x33d6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x33d6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x33d6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x33d6('0x2')],'defaultValue':_0x33d6('0x3')}}; \ No newline at end of file +var _0xbc9a=['*,*,*,*','sequelize','INTEGER','noop','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc9a,0x1e1));var _0xabc9=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xbc9a[_0x59befa];return _0x1dd63d;};'use strict';var Sequelize=require(_0xabc9('0x0'));module['exports']={'priority':{'type':Sequelize[_0xabc9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xabc9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xabc9('0x3')]},'interval':{'type':Sequelize[_0xabc9('0x3')],'defaultValue':_0xabc9('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 862b5ea..aa64344 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x165271,_0x3ecf75){var _0x1f5022=function(_0x2f75ca){while(--_0x2f75ca){_0x165271['push'](_0x165271['shift']());}};_0x1f5022(++_0x3ecf75);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2e0a1a,_0x22e89f){_0x2e0a1a=_0x2e0a1a-0x0;var _0x227e00=_0x9bde[_0x2e0a1a];return _0x227e00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x20cbfc,_0x43434b){var _0x4380b5=function(_0x4bb623){while(--_0x4bb623){_0x20cbfc['push'](_0x20cbfc['shift']());}};_0x4380b5(++_0x43434b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 259d4d4..1cbcbcc 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 _0x13a6=['define','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x51031f,_0x495c1d){var _0x8a5c89=function(_0x46e326){while(--_0x46e326){_0x51031f['push'](_0x51031f['shift']());}};_0x8a5c89(++_0x495c1d);}(_0x13a6,0xd3));var _0x613a=function(_0x62f454,_0x50218f){_0x62f454=_0x62f454-0x0;var _0x1fb34a=_0x13a6[_0x62f454];return _0x1fb34a;};'use strict';var _=require(_0x613a('0x0'));var util=require(_0x613a('0x1'));var logger=require(_0x613a('0x2'))(_0x613a('0x3'));var moment=require(_0x613a('0x4'));var BPromise=require('bluebird');var rp=require(_0x613a('0x5'));var fs=require('fs');var path=require(_0x613a('0x6'));var rimraf=require(_0x613a('0x7'));var config=require(_0x613a('0x8'));var attributes=require(_0x613a('0x9'));module['exports']=function(_0x3ff43c,_0x175de2){return _0x3ff43c[_0x613a('0xa')]('MailApplication',attributes,{'tableName':_0x613a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x613a('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x576f=['bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x576f,0xaf));var _0xf576=function(_0x18ffb2,_0x2869a1){_0x18ffb2=_0x18ffb2-0x0;var _0x1a2f01=_0x576f[_0x18ffb2];return _0x1a2f01;};'use strict';var _=require(_0xf576('0x0'));var util=require(_0xf576('0x1'));var logger=require(_0xf576('0x2'))(_0xf576('0x3'));var moment=require(_0xf576('0x4'));var BPromise=require(_0xf576('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf576('0x6'));var rimraf=require(_0xf576('0x7'));var config=require(_0xf576('0x8'));var attributes=require(_0xf576('0x9'));module[_0xf576('0xa')]=function(_0x50eee7,_0x4bc862){return _0x50eee7['define'](_0xf576('0xb'),attributes,{'tableName':_0xf576('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf576('0xd'),'collate':_0xf576('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 682f376..0d25d81 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 _0x59c7=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','options','where','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x373e8e,_0x6bb6d9){var _0x453d22=function(_0x5dd3ba){while(--_0x5dd3ba){_0x373e8e['push'](_0x373e8e['shift']());}};_0x453d22(++_0x6bb6d9);}(_0x59c7,0x1e7));var _0x759c=function(_0x1cf447,_0x4446f6){_0x1cf447=_0x1cf447-0x0;var _0x2d80e8=_0x59c7[_0x1cf447];return _0x2d80e8;};'use strict';var _=require(_0x759c('0x0'));var util=require(_0x759c('0x1'));var moment=require(_0x759c('0x2'));var BPromise=require(_0x759c('0x3'));var rs=require(_0x759c('0x4'));var fs=require('fs');var Redis=require(_0x759c('0x5'));var db=require(_0x759c('0x6'))['db'];var utils=require(_0x759c('0x7'));var logger=require('../../config/logger')(_0x759c('0x8'));var config=require(_0x759c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x759c('0xa')][_0x759c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45ec4a,_0x3f36c9,_0x391ad0){return new BPromise(function(_0x376b0e,_0x5626e5){return client[_0x759c('0xc')](_0x45ec4a,_0x391ad0)[_0x759c('0xd')](function(_0x5171ef){logger[_0x759c('0xe')](_0x759c('0xf'),_0x3f36c9,'request\x20sent');logger[_0x759c('0x10')](_0x759c('0x11'),_0x3f36c9,_0x759c('0x12'),JSON[_0x759c('0x13')](_0x5171ef));if(_0x5171ef[_0x759c('0x14')]){if(_0x5171ef[_0x759c('0x14')]['code']===0x1f4){logger[_0x759c('0x14')](_0x759c('0xf'),_0x3f36c9,_0x5171ef[_0x759c('0x14')][_0x759c('0x15')]);return _0x5626e5(_0x5171ef[_0x759c('0x14')][_0x759c('0x15')]);}logger[_0x759c('0x14')]('MailApplication,\x20%s,\x20%s',_0x3f36c9,_0x5171ef[_0x759c('0x14')]['message']);return _0x376b0e(_0x5171ef[_0x759c('0x14')]['message']);}else{logger[_0x759c('0xe')](_0x759c('0xf'),_0x3f36c9,'request\x20sent');_0x376b0e(_0x5171ef[_0x759c('0x16')][_0x759c('0x15')]);}})[_0x759c('0x17')](function(_0x3e02e5){logger[_0x759c('0x14')]('MailApplication,\x20%s,\x20%s',_0x3f36c9,_0x3e02e5);_0x5626e5(_0x3e02e5);});});}exports[_0x759c('0x18')]=function(_0x3a4f26){var _0x26ed57=this;return new Promise(function(_0x140d22,_0x2eff40){return db[_0x759c('0x19')]['update'](_0x3a4f26['body'],{'raw':_0x3a4f26[_0x759c('0x1a')]?_0x3a4f26['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4f26[_0x759c('0x1a')]?_0x3a4f26['options'][_0x759c('0x1b')]||null:null,'attributes':_0x3a4f26['options']?_0x3a4f26['options']['attributes']||null:null,'limit':_0x3a4f26[_0x759c('0x1a')]?_0x3a4f26['options'][_0x759c('0x1c')]||null:null})['then'](function(_0x5897b3){logger['info'](_0x759c('0x18'),_0x3a4f26);logger[_0x759c('0x10')](_0x759c('0x18'),_0x3a4f26,JSON[_0x759c('0x13')](_0x5897b3));_0x140d22(_0x5897b3);})[_0x759c('0x17')](function(_0x229a09){logger[_0x759c('0x14')](_0x759c('0x18'),_0x229a09[_0x759c('0x15')],_0x3a4f26);_0x2eff40(_0x26ed57[_0x759c('0x14')](0x1f4,_0x229a09[_0x759c('0x15')]));});});}; \ No newline at end of file +var _0xc4c4=['limit','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','options','raw','where'];(function(_0x141e20,_0x566604){var _0x280a81=function(_0x3ce20e){while(--_0x3ce20e){_0x141e20['push'](_0x141e20['shift']());}};_0x280a81(++_0x566604);}(_0xc4c4,0x12d));var _0x4c4c=function(_0x452fde,_0x339a5f){_0x452fde=_0x452fde-0x0;var _0x36ecee=_0xc4c4[_0x452fde];return _0x36ecee;};'use strict';var _=require(_0x4c4c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4c4c('0x1'));var rs=require(_0x4c4c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c4c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c4c('0x4'))('rpc');var config=require(_0x4c4c('0x5'));var jayson=require(_0x4c4c('0x6'));var client=jayson['client'][_0x4c4c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27f53f,_0x48e040,_0x2af959){return new BPromise(function(_0xaaabf8,_0x3db5e2){return client['request'](_0x27f53f,_0x2af959)[_0x4c4c('0x8')](function(_0x788ba4){logger[_0x4c4c('0x9')](_0x4c4c('0xa'),_0x48e040,_0x4c4c('0xb'));logger[_0x4c4c('0xc')](_0x4c4c('0xd'),_0x48e040,_0x4c4c('0xb'),JSON['stringify'](_0x788ba4));if(_0x788ba4[_0x4c4c('0xe')]){if(_0x788ba4['error'][_0x4c4c('0xf')]===0x1f4){logger[_0x4c4c('0xe')](_0x4c4c('0xa'),_0x48e040,_0x788ba4[_0x4c4c('0xe')][_0x4c4c('0x10')]);return _0x3db5e2(_0x788ba4[_0x4c4c('0xe')][_0x4c4c('0x10')]);}logger[_0x4c4c('0xe')]('MailApplication,\x20%s,\x20%s',_0x48e040,_0x788ba4[_0x4c4c('0xe')]['message']);return _0xaaabf8(_0x788ba4[_0x4c4c('0xe')][_0x4c4c('0x10')]);}else{logger[_0x4c4c('0x9')](_0x4c4c('0xa'),_0x48e040,_0x4c4c('0xb'));_0xaaabf8(_0x788ba4[_0x4c4c('0x11')]['message']);}})[_0x4c4c('0x12')](function(_0x4e5437){logger[_0x4c4c('0xe')]('MailApplication,\x20%s,\x20%s',_0x48e040,_0x4e5437);_0x3db5e2(_0x4e5437);});});}exports[_0x4c4c('0x13')]=function(_0x2f31e3){var _0x59f67b=this;return new Promise(function(_0x14a269,_0x183c18){return db[_0x4c4c('0x14')]['update'](_0x2f31e3['body'],{'raw':_0x2f31e3[_0x4c4c('0x15')]?_0x2f31e3[_0x4c4c('0x15')][_0x4c4c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f31e3[_0x4c4c('0x15')]?_0x2f31e3[_0x4c4c('0x15')][_0x4c4c('0x17')]||null:null,'attributes':_0x2f31e3[_0x4c4c('0x15')]?_0x2f31e3[_0x4c4c('0x15')]['attributes']||null:null,'limit':_0x2f31e3[_0x4c4c('0x15')]?_0x2f31e3[_0x4c4c('0x15')][_0x4c4c('0x18')]||null:null})['then'](function(_0x375f3b){logger['info'](_0x4c4c('0x13'),_0x2f31e3);logger[_0x4c4c('0xc')](_0x4c4c('0x13'),_0x2f31e3,JSON['stringify'](_0x375f3b));_0x14a269(_0x375f3b);})[_0x4c4c('0x12')](function(_0x248214){logger[_0x4c4c('0xe')]('UpdateMailApplication',_0x248214['message'],_0x2f31e3);_0x183c18(_0x59f67b[_0x4c4c('0xe')](0x1f4,_0x248214['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2e8787f..edc0d5e 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 _0x9363=['../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','mail','mailinteraction:update','update','destroy','delete','removeTags','exports','Router'];(function(_0x18dbbc,_0x4036b2){var _0x23c487=function(_0x8aba93){while(--_0x8aba93){_0x18dbbc['push'](_0x18dbbc['shift']());}};_0x23c487(++_0x4036b2);}(_0x9363,0x89));var _0x3936=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x9363[_0x53f897];return _0x6879f8;};'use strict';var express=require('express');var router=express[_0x3936('0x0')]();var auth=require(_0x3936('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x3936('0x2'));router[_0x3936('0x3')]('/',auth[_0x3936('0x4')](),controller['index']);router[_0x3936('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x3936('0x5')]);router['get'](_0x3936('0x6'),auth[_0x3936('0x4')](),controller['show']);router[_0x3936('0x3')](_0x3936('0x7'),auth[_0x3936('0x4')](),controller[_0x3936('0x8')]);router['get'](_0x3936('0x9'),auth['isAuthenticated'](),controller['download']);router[_0x3936('0xa')]('/',auth[_0x3936('0x4')](),controller['create']);router[_0x3936('0xa')](_0x3936('0x7'),auth[_0x3936('0x4')](),controller[_0x3936('0xb')]);router[_0x3936('0xa')](_0x3936('0xc'),auth[_0x3936('0x4')](),interaction[_0x3936('0xd')]('mail',_0x3936('0xe')),controller[_0x3936('0xf')]);router['put'](_0x3936('0x6'),auth[_0x3936('0x4')](),interaction[_0x3936('0xd')](_0x3936('0x10'),_0x3936('0x11')),controller[_0x3936('0x12')]);router['delete'](_0x3936('0x6'),auth[_0x3936('0x4')](),interaction[_0x3936('0xd')](_0x3936('0x10'),'mailinteraction:destroy'),controller[_0x3936('0x13')]);router[_0x3936('0x14')](_0x3936('0xc'),auth[_0x3936('0x4')](),controller[_0x3936('0x15')]);module[_0x3936('0x16')]=router; \ No newline at end of file +var _0x742d=['/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe'];(function(_0x4bf5ec,_0x333deb){var _0x128359=function(_0x10415b){while(--_0x10415b){_0x4bf5ec['push'](_0x4bf5ec['shift']());}};_0x128359(++_0x333deb);}(_0x742d,0x67));var _0xd742=function(_0x1f34cf,_0x485319){_0x1f34cf=_0x1f34cf-0x0;var _0x2e53f7=_0x742d[_0x1f34cf];return _0x2e53f7;};'use strict';var express=require(_0xd742('0x0'));var router=express[_0xd742('0x1')]();var auth=require(_0xd742('0x2'));var interaction=require(_0xd742('0x3'));var controller=require(_0xd742('0x4'));router[_0xd742('0x5')]('/',auth[_0xd742('0x6')](),controller[_0xd742('0x7')]);router[_0xd742('0x5')]('/describe',auth[_0xd742('0x6')](),controller[_0xd742('0x8')]);router[_0xd742('0x5')](_0xd742('0x9'),auth['isAuthenticated'](),controller[_0xd742('0xa')]);router[_0xd742('0x5')](_0xd742('0xb'),auth[_0xd742('0x6')](),controller[_0xd742('0xc')]);router['get']('/:id/download',auth[_0xd742('0x6')](),controller['download']);router[_0xd742('0xd')]('/',auth[_0xd742('0x6')](),controller[_0xd742('0xe')]);router['post'](_0xd742('0xb'),auth['isAuthenticated'](),controller[_0xd742('0xf')]);router[_0xd742('0xd')](_0xd742('0x10'),auth[_0xd742('0x6')](),interaction['tracked'](_0xd742('0x11'),_0xd742('0x12')),controller[_0xd742('0x13')]);router[_0xd742('0x14')]('/:id',auth[_0xd742('0x6')](),interaction[_0xd742('0x15')](_0xd742('0x11'),_0xd742('0x16')),controller[_0xd742('0x17')]);router[_0xd742('0x18')]('/:id',auth[_0xd742('0x6')](),interaction[_0xd742('0x15')](_0xd742('0x11'),'mailinteraction:destroy'),controller[_0xd742('0x19')]);router[_0xd742('0x18')](_0xd742('0x10'),auth[_0xd742('0x6')](),controller[_0xd742('0x1a')]);module[_0xd742('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 93ef18f..3b7e3eb 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 _0xe04d=['ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe04d,0x1ce));var _0xde04=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xe04d[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0xde04('0x0'));var iconv=require(_0xde04('0x1'));module[_0xde04('0x2')]={'closed':{'type':Sequelize[_0xde04('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xde04('0x4')]},'disposition':{'type':Sequelize[_0xde04('0x5')]},'secondDisposition':{'type':Sequelize[_0xde04('0x5')]},'thirdDisposition':{'type':Sequelize[_0xde04('0x5')]},'note':{'type':Sequelize[_0xde04('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xde04('0x6')](_0xde04('0x7'))},'subject':{'type':Sequelize[_0xde04('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xde04('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xde04('0x8')]('in',_0xde04('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xde04('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xde04('0x8')]('in',_0xde04('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xde04('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4ff6=['DATE','STRING','TEXT','long','out','iconv','exports','BOOLEAN'];(function(_0x7b989e,_0xad32cd){var _0x3f6e77=function(_0x1b3348){while(--_0x1b3348){_0x7b989e['push'](_0x7b989e['shift']());}};_0x3f6e77(++_0xad32cd);}(_0x4ff6,0xd5));var _0x64ff=function(_0x40f1be,_0x76dfc9){_0x40f1be=_0x40f1be-0x0;var _0x3a6c1c=_0x4ff6[_0x40f1be];return _0x3a6c1c;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x64ff('0x0'));module[_0x64ff('0x1')]={'closed':{'type':Sequelize[_0x64ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x64ff('0x3')]},'disposition':{'type':Sequelize[_0x64ff('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x64ff('0x4')]},'note':{'type':Sequelize[_0x64ff('0x4')]},'inReplyTo':{'type':Sequelize[_0x64ff('0x4')](0x1fe)},'to':{'type':Sequelize[_0x64ff('0x4')]},'cc':{'type':Sequelize[_0x64ff('0x5')](_0x64ff('0x6'))},'subject':{'type':Sequelize[_0x64ff('0x5')]()},'attach':{'type':Sequelize[_0x64ff('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x64ff('0x3')]},'substatus':{'type':Sequelize[_0x64ff('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x64ff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x64ff('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x64ff('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x64ff('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 0bb145e..e4cabd8 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 _0x1330=['c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','push','rows','show','params','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','setTags','spread','findAll','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','mkdirSync','each','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','download','unlinkSync','eml-format','rimraf','moment','bluebird','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','json','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','MailMessage','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1330,0x12d));var _0x0133=function(_0x58c654,_0x56f774){_0x58c654=_0x58c654-0x0;var _0x1b1164=_0x1330[_0x58c654];return _0x1b1164;};'use strict';var emlformat=require(_0x0133('0x0'));var rimraf=require(_0x0133('0x1'));var zipdir=require('zip-dir');var moment=require(_0x0133('0x2'));var BPromise=require(_0x0133('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x0133('0x4'));var squel=require(_0x0133('0x5'));var juice=require(_0x0133('0x6'));var Redis=require(_0x0133('0x7'));var qs=require(_0x0133('0x8'));var as=require(_0x0133('0x9'));var logger=require(_0x0133('0xa'))(_0x0133('0xb'));var config=require(_0x0133('0xc'));var db=require(_0x0133('0xd'))['db'];var htmlEntities=require(_0x0133('0xe'));config[_0x0133('0xf')]=_[_0x0133('0x10')](config[_0x0133('0xf')],{'host':_0x0133('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0133('0xf')]));require(_0x0133('0x12'))[_0x0133('0x13')](socket);function respondWithStatusCode(_0x4aa405,_0x59fd0a){_0x59fd0a=_0x59fd0a||0xcc;return function(_0x1c184d){if(_0x1c184d){return _0x4aa405[_0x0133('0x14')](_0x59fd0a);}return _0x4aa405[_0x0133('0x15')](_0x59fd0a)[_0x0133('0x16')]();};}function respondWithResult(_0x28db71,_0x36a6da){_0x36a6da=_0x36a6da||0xc8;return function(_0x36babc){if(_0x36babc){return _0x28db71[_0x0133('0x15')](_0x36a6da)['json'](_0x36babc);}};}function respondWithFilteredResult(_0x597dce,_0x131e53){return function(_0x4f7288){if(_0x4f7288){var _0x2f37a0=typeof _0x131e53['offset']==='undefined'&&typeof _0x131e53[_0x0133('0x17')]===_0x0133('0x18');var _0x10e2c=_0x4f7288[_0x0133('0x19')];var _0x351579=_0x2f37a0?0x0:_0x131e53[_0x0133('0x1a')];var _0xeb5380=_0x2f37a0?_0x4f7288['count']:_0x131e53['offset']+_0x131e53[_0x0133('0x17')];var _0x2a5148;if(_0xeb5380>=_0x10e2c){_0xeb5380=_0x10e2c;_0x2a5148=0xc8;}else{_0x2a5148=0xce;}_0x597dce[_0x0133('0x15')](_0x2a5148);return _0x597dce[_0x0133('0x1b')]('Content-Range',_0x351579+'-'+_0xeb5380+'/'+_0x10e2c)[_0x0133('0x1c')](_0x4f7288);}return null;};}function saveUpdates(_0x260f86){return function(_0x29b3fb){if(_0x29b3fb){return _0x29b3fb[_0x0133('0x1d')](_0x260f86)['then'](function(_0x336118){return _0x336118;});}return null;};}function removeEntity(_0xd9d621){return function(_0x231fd7){if(_0x231fd7){return _0x231fd7[_0x0133('0x1e')]()[_0x0133('0x1f')](function(){_0xd9d621[_0x0133('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ffa9){return function(_0x54a5b4){if(!_0x54a5b4){_0x54ffa9[_0x0133('0x14')](0x194);}return _0x54a5b4;};}function handleError(_0x2dc038,_0x512898){_0x512898=_0x512898||0x1f4;return function(_0x4cc2c3){logger[_0x0133('0x20')](_0x4cc2c3[_0x0133('0x21')]);if(_0x4cc2c3['name']){delete _0x4cc2c3[_0x0133('0x22')];}_0x2dc038['status'](_0x512898)[_0x0133('0x23')](_0x4cc2c3);};}function getInteractionUsers(_0x359e5c,_0x5618b8){return new BPromise(function(_0x4dc98e,_0x107a00){try{if(_0x5618b8[_0x359e5c['id']]){_0x359e5c[_0x0133('0x24')]=_[_0x0133('0x25')](_0x5618b8[_0x359e5c['id']],function(_0x29fb7e){return{'id':_0x29fb7e['id'],'fullname':_0x29fb7e[_0x0133('0x26')]};});}}catch(_0x54d7dc){_0x107a00(_0x54d7dc);}_0x4dc98e(_0x359e5c);});}function getInteractionTags(_0x3204eb,_0xa98fd5){return new BPromise(function(_0x5d72c7,_0x3ed704){try{if(_0x3204eb[_0x0133('0x27')]){_0x3204eb[_0x0133('0x28')]=[];_0x3204eb[_0x0133('0x27')]['split'](',')[_0x0133('0x29')](function(_0x5e66be){_0x3204eb[_0x0133('0x28')]['push'](_0xa98fd5[_0x5e66be]);});}delete _0x3204eb[_0x0133('0x27')];}catch(_0x107a2f){_0x3ed704(_0x107a2f);}_0x5d72c7(_0x3204eb);});}function getLastMessageText(_0x19286b){return new BPromise(function(_0x514b97,_0x1262f2){return db[_0x0133('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x19286b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0133('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0133('0x2c'),'raw':!![]})['then'](function(_0x945c6f){if(_0x945c6f&&_0x945c6f[_0x0133('0x2d')]){_0x19286b[_0x0133('0x2e')]=_[_0x0133('0x2f')](_0x945c6f[_0x0133('0x2d')]);}_0x514b97(_0x19286b);})[_0x0133('0x30')](function(_0x5e0859){_0x1262f2(_0x5e0859);});});}function updateMailInteraction(_0x7a222d,_0x40d860,_0x4fce51,_0x1c6dbf){return new BPromise(function(_0x1b3a19,_0x1bb2da){return getInteractionUsers(_0x7a222d,_0x4fce51)[_0x0133('0x1f')](function(_0x28f439){return getInteractionTags(_0x28f439,_0x40d860);})[_0x0133('0x1f')](function(_0x35859f){if(_0x1c6dbf){_0x1b3a19(getLastMessageText(_0x35859f));}else{_0x1b3a19(_0x35859f);}})[_0x0133('0x30')](function(_0x501723){_0x1bb2da(_0x501723);});});}exports[_0x0133('0x31')]=function(_0x3008b0,_0x535a1d){var _0x181b7e={},_0x36b7fa={},_0x92e8f4={'count':0x0,'rows':[]};var _0x2339a1=_[_0x0133('0x25')](db[_0x0133('0x32')][_0x0133('0x33')],function(_0x3a71a8){return{'name':_0x3a71a8[_0x0133('0x34')],'type':_0x3a71a8['type'][_0x0133('0x35')]};});_0x36b7fa[_0x0133('0x36')]=_[_0x0133('0x25')](_0x2339a1,_0x0133('0x22'));_0x36b7fa['query']=_[_0x0133('0x37')](_0x3008b0[_0x0133('0x38')]);_0x36b7fa['filters']=_[_0x0133('0x39')](_0x36b7fa[_0x0133('0x36')],_0x36b7fa[_0x0133('0x38')]);_0x181b7e[_0x0133('0x3a')]=_[_0x0133('0x39')](_0x36b7fa[_0x0133('0x36')],qs[_0x0133('0x3b')](_0x3008b0['query'][_0x0133('0x3b')]));_0x181b7e[_0x0133('0x3a')]=_0x181b7e[_0x0133('0x3a')][_0x0133('0x3c')]?_0x181b7e[_0x0133('0x3a')]:_0x36b7fa[_0x0133('0x36')];if(!_0x3008b0[_0x0133('0x38')][_0x0133('0x3d')]('nolimit')){_0x181b7e['limit']=qs[_0x0133('0x17')](_0x3008b0[_0x0133('0x38')][_0x0133('0x17')]);_0x181b7e[_0x0133('0x1a')]=qs[_0x0133('0x1a')](_0x3008b0['query'][_0x0133('0x1a')]);}_0x181b7e[_0x0133('0x3e')]=qs[_0x0133('0x3f')](_0x3008b0['query']['sort']);_0x181b7e[_0x0133('0x40')]=qs[_0x0133('0x41')](_[_0x0133('0x42')](_0x3008b0['query'],_0x36b7fa[_0x0133('0x41')]),_0x2339a1);var _0x18e2db=[];var _0xf38bf0=squel[_0x0133('0x43')]()[_0x0133('0x44')]('id')[_0x0133('0x44')]('name')['field']('color')[_0x0133('0x45')](_0x0133('0x46'));var _0x55445b=squel['select']()[_0x0133('0x44')](_0x0133('0x47'))[_0x0133('0x44')](_0x0133('0x48'))[_0x0133('0x44')](_0x0133('0x49'))[_0x0133('0x45')](_0x0133('0x4a'),'ui')['left_join'](_0x0133('0x4b'),'u',_0x0133('0x4c'));var _0x33fd30=squel[_0x0133('0x43')]()[_0x0133('0x45')](_0x0133('0x4d'),'i')[_0x0133('0x4e')](_0x0133('0x4f'),'c',_0x0133('0x50'))[_0x0133('0x4e')](_0x0133('0x4b'),'o',_0x0133('0x51'))[_0x0133('0x4e')](_0x0133('0x52'),'a','a.id\x20=\x20i.MailAccountId')[_0x0133('0x4e')](_0x0133('0x53'),'me',_0x0133('0x54'))[_0x0133('0x4e')]('mail_interaction_has_tags','it',_0x0133('0x55'))['left_join'](_0x0133('0x46'),'t','t.id\x20=\x20it.TagId');var _0x4d5977=squel[_0x0133('0x56')]();var _0x5d2b0d=[];var _0x247fdf=squel[_0x0133('0x56')]();var _0x214391;if(_0x3008b0[_0x0133('0x38')][_0x0133('0x57')]){_0x214391=as[_0x0133('0x58')](_0x3008b0['query'][_0x0133('0x57')]);var _0x4efe4a=_0x214391[_0x0133('0x59')];for(var _0xabbd70=0x0;_0xabbd70<_0x214391[_0x0133('0x5a')]['length'];_0xabbd70++){var _0x12b6e0=_0x214391[_0x0133('0x5a')][_0xabbd70];var _0x3addb5='i';var _0x2f7975=_[_0x0133('0x5b')](_0x2339a1,[_0x0133('0x22'),_0x12b6e0['field']]);if(!_0x2f7975){switch(_0x12b6e0['field']){case _0x0133('0x5c'):if(_0x12b6e0[_0x0133('0x5d')]==0x1){_0x33fd30[_0x0133('0x5e')]('`'+_0x12b6e0[_0x0133('0x44')]+_0x0133('0x5f'));}else{_0x33fd30[_0x0133('0x5e')]('`'+_0x12b6e0[_0x0133('0x44')]+_0x0133('0x60'));}break;case'Contact':if(_0x12b6e0[_0x0133('0x61')]===_0x0133('0x62')){if(_0x12b6e0[_0x0133('0x5d')][_0x0133('0x63')]('\x20')['length']>0x1){_0x4d5977[_0x4efe4a](_0x0133('0x64'),qs[_0x0133('0x65')](_0x12b6e0[_0x0133('0x5d')]),null);}else{var _0x3d3011='%'+_0x12b6e0[_0x0133('0x5d')]+'%';_0x4d5977[_0x4efe4a](_0x0133('0x66'),_0x3d3011,_0x3d3011,_0x3d3011);}}else{_0x2f7975=_[_0x0133('0x5b')](_0x2339a1,[_0x0133('0x22'),_0x0133('0x67')]);_0x12b6e0['field']=_0x0133('0x67');_0x3b3c4=as[_0x0133('0x68')](_0x3addb5,_0x2f7975[_0x0133('0x69')],_0x12b6e0);_0x4d5977[_0x4efe4a](_0x3b3c4[_0x0133('0x6a')],_0x3b3c4['value'][_0x0133('0x6b')],_0x3b3c4['value'][_0x0133('0x16')]);}break;case _0x0133('0x6c'):var _0x11c856=_0x12b6e0[_0x0133('0x5d')]['split'](',')[_0x0133('0x25')](function(_0x50dc7f){return Number(_0x50dc7f);});_0x11c856[_0x0133('0x29')](function(_0x10dab9){_0x247fdf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10dab9+',%');});_0x5d2b0d=_[_0x0133('0x6d')](_0x5d2b0d,_0x11c856);break;case _0x0133('0x6e'):if(_0x12b6e0[_0x0133('0x61')]===_0x0133('0x62')){_0x4d5977[_0x4efe4a](_0x0133('0x6f'),'%'+_0x12b6e0['value']+'%',null);}else{_0x2f7975=_[_0x0133('0x5b')](_0x2339a1,[_0x0133('0x22'),_0x0133('0x70')]);_0x12b6e0[_0x0133('0x44')]=_0x0133('0x70');_0x3b3c4=as['buildExpression'](_0x3addb5,_0x2f7975[_0x0133('0x69')],_0x12b6e0);_0x4d5977[_0x4efe4a](_0x3b3c4[_0x0133('0x6a')],_0x3b3c4['value']['start'],_0x3b3c4['value'][_0x0133('0x16')]);}break;case'plainBody':_0x3b3c4=as['buildExpression']('me',null,_0x12b6e0);_0x4d5977[_0x4efe4a](_0x3b3c4['text'],_0x3b3c4[_0x0133('0x5d')][_0x0133('0x6b')],_0x3b3c4['value'][_0x0133('0x16')]);break;}}else{var _0x3b3c4=as[_0x0133('0x68')](_0x3addb5,_0x2f7975[_0x0133('0x69')],_0x12b6e0);_0x4d5977[_0x4efe4a](_0x3b3c4['text'],_0x3b3c4[_0x0133('0x5d')][_0x0133('0x6b')],_0x3b3c4['value'][_0x0133('0x16')]);}}}else{var _0x4656a8=_(_0x3008b0[_0x0133('0x38')])['keys']()[_0x0133('0x25')](function(_0x519a47){return _[_0x0133('0x71')](_0x2339a1,[_0x0133('0x22'),_0x519a47])?_0x519a47:undefined;})[_0x0133('0x72')]()[_0x0133('0x5d')]();if(!_[_0x0133('0x73')](_0x4656a8)){_0x4656a8[_0x0133('0x29')](function(_0x522088){if(_0x522088===_0x0133('0x74')){_0x33fd30[_0x0133('0x40')](_0x0133('0x75'),[]['concat'](_0x3008b0[_0x0133('0x38')][_0x522088]));}else if(_0x522088===_0x0133('0x76')){var _0x1ac4d3=JSON[_0x0133('0x77')](_0x3008b0[_0x0133('0x38')][_0x522088])['$gte'];var _0x10cd8e=JSON['parse'](_0x3008b0[_0x0133('0x38')][_0x522088])[_0x0133('0x78')];_0x33fd30['where'](_0x0133('0x79'),_0x1ac4d3,_0x10cd8e);}else{if(_0x3008b0['query'][_0x522088]==='null'){_0x33fd30[_0x0133('0x40')]('i.'+_0x522088+_0x0133('0x7a'));}else{_0x33fd30['where']('i.'+_0x522088+_0x0133('0x7b'),_0x3008b0['query'][_0x522088]);}}});}if(_0x3008b0[_0x0133('0x38')][_0x0133('0x7c')]){if(_0x3008b0[_0x0133('0x38')][_0x0133('0x7c')]==0x1){_0x33fd30[_0x0133('0x5e')](_0x0133('0x7d'));}else{_0x33fd30['having'](_0x0133('0x7e'));}}if(_0x3008b0[_0x0133('0x38')]['tag']){_0x5d2b0d=_[_0x0133('0x7f')](_0x3008b0[_0x0133('0x38')][_0x0133('0x80')])?_0x3008b0[_0x0133('0x38')][_0x0133('0x80')]:new Array(_0x3008b0[_0x0133('0x38')][_0x0133('0x80')]);_0x5d2b0d['forEach'](function(_0x1c070f){_0x247fdf['or'](_0x0133('0x81'),'%,'+_0x1c070f+',%');});}if(_0x3008b0[_0x0133('0x38')][_0x0133('0x82')]){var _0x45f709=_0x3008b0['query'][_0x0133('0x82')]['replace']('\x5c','\x5c\x5c')[_0x0133('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x45f709)){_0x4d5977['or'](_0x0133('0x84'),_0x45f709+'%');}else if(qs['isEmail'](_0x45f709)){_0x4d5977['or'](_0x0133('0x85'),_0x45f709+'%');}else{_0x4d5977['or'](_0x0133('0x86'),qs[_0x0133('0x65')](_0x45f709))['or'](_0x0133('0x87'),qs['getFullTextValue'](_0x45f709));}}}_0x33fd30['where'](_0x4d5977);_0x33fd30[_0x0133('0x88')](_0x0133('0x89'));var _0x172207={'type':db[_0x0133('0x8a')][_0x0133('0x8b')][_0x0133('0x8c')],'raw':!![]};var _0x31b8d1=_0x33fd30['clone']();_0x31b8d1['field'](_0x0133('0x89'));_0x31b8d1[_0x0133('0x44')](_0x0133('0x8d'),_0x0133('0x5c'));if(_0x181b7e['order']){_0x181b7e['order']['forEach'](function(_0x7e07f5){var _0x15398e=_0x7e07f5[0x0]===_0x0133('0x8e')?_0x7e07f5[0x0]:'i.'+_0x7e07f5[0x0];_0x33fd30[_0x0133('0x3e')](_0x15398e,_0x7e07f5[0x1]===_0x0133('0x8f')?![]:!![]);});}if(!_[_0x0133('0x73')](_0x5d2b0d)){_0x33fd30[_0x0133('0x5e')](_0x247fdf);_0x31b8d1[_0x0133('0x40')](_0x0133('0x90'),_0x5d2b0d);}BPromise[_0x0133('0x91')]()[_0x0133('0x1f')](function(){if(!_0x214391){if(_0x3008b0[_0x0133('0x38')][_0x0133('0x74')])return;_0x31b8d1[_0x0133('0x40')](_0x0133('0x92'));_0x33fd30[_0x0133('0x40')](_0x0133('0x92'));return;}if(_0x3008b0[_0x0133('0x93')][_0x0133('0x94')]!=='agent')return;return _0x3008b0['user'][_0x0133('0x95')]({'attributes':['id'],'raw':!![]})[_0x0133('0x1f')](function(_0x296c38){if(_[_0x0133('0x73')](_0x296c38)){_0x31b8d1[_0x0133('0x40')](_0x0133('0x96'));_0x33fd30[_0x0133('0x40')](_0x0133('0x96'));}else{_0x31b8d1[_0x0133('0x40')](_0x0133('0x75'),_[_0x0133('0x25')](_0x296c38,'id'));_0x33fd30['where'](_0x0133('0x75'),_['map'](_0x296c38,'id'));}});})[_0x0133('0x1f')](function(){if(_0x3008b0[_0x0133('0x93')]['role']===_0x0133('0x97')&&!_0x214391&&!_0x3008b0[_0x0133('0x38')][_0x0133('0x74')])return[];return db[_0x0133('0x98')][_0x0133('0x38')](_0x31b8d1[_0x0133('0x99')](),_0x172207);})[_0x0133('0x1f')](function(_0x2ebdd7){_0x92e8f4[_0x0133('0x19')]=_0x2ebdd7[_0x0133('0x3c')];if(_0x92e8f4[_0x0133('0x19')]===0x0)return[];return db['sequelize']['query'](_0xf38bf0[_0x0133('0x99')](),_0x172207)[_0x0133('0x1f')](function(_0x1163db){_0x18e2db=_[_0x0133('0x9a')](_0x1163db,'id');_0x172207=_['merge'](_0x172207,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3008b0[_0x0133('0x38')][_0x0133('0x3b')]){_0x181b7e['attributes']['forEach'](function(_0x3cffe9){_0x33fd30[_0x0133('0x44')]('i.'+_0x3cffe9);});}else{_0x33fd30[_0x0133('0x44')](_0x0133('0x8d'),_0x0133('0x5c'));_0x33fd30[_0x0133('0x44')](_0x0133('0x9b'),_0x0133('0x9c'));_0x33fd30[_0x0133('0x44')]('a.mandatoryDisposition',_0x0133('0x9d'));_0x33fd30[_0x0133('0x44')]('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',_0x0133('0x8e'));_0x33fd30['field']('i.id');_0x33fd30[_0x0133('0x44')](_0x0133('0x9e'));_0x33fd30['field'](_0x0133('0x9f'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa0'));_0x33fd30[_0x0133('0x44')]('i.closedAt');_0x33fd30[_0x0133('0x44')]('i.attach');_0x33fd30[_0x0133('0x44')]('i.lastMsgAt');_0x33fd30[_0x0133('0x44')](_0x0133('0xa1'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa2'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa3'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa4'));_0x33fd30['field'](_0x0133('0xa5'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa6'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa7'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa8'));_0x33fd30[_0x0133('0x44')](_0x0133('0xa9'));_0x33fd30[_0x0133('0x44')](_0x0133('0xaa'));_0x33fd30[_0x0133('0x44')](_0x0133('0xab'),_0x0133('0xac'));_0x33fd30[_0x0133('0x44')](_0x0133('0xad'),_0x0133('0xae'));_0x33fd30[_0x0133('0x44')](_0x0133('0xaf'),_0x0133('0xb0'));_0x33fd30['field'](_0x0133('0xb1'),_0x0133('0xb2'));_0x33fd30['field'](_0x0133('0xb3'),_0x0133('0xb4'));_0x33fd30[_0x0133('0x44')](_0x0133('0xb5'),_0x0133('0xb6'));_0x33fd30[_0x0133('0x44')](_0x0133('0xb7'),_0x0133('0xb8'));_0x33fd30[_0x0133('0x44')]('o.internal','Owner.internal');_0x33fd30[_0x0133('0x44')](_0x0133('0xb9'),'TagIds');}if(_0x181b7e[_0x0133('0x17')])_0x33fd30[_0x0133('0x17')](_0x181b7e[_0x0133('0x17')]);if(_0x181b7e[_0x0133('0x1a')])_0x33fd30['offset'](_0x181b7e[_0x0133('0x1a')]);return db['sequelize'][_0x0133('0x38')](_0x33fd30[_0x0133('0x99')](),_0x172207);})[_0x0133('0x1f')](function(_0x50ce34){if(_0x50ce34['length']>0x0)_0x55445b['where'](_0x0133('0xba'),_[_0x0133('0x25')](_0x50ce34,'id'));return db['sequelize']['query'](_0x55445b[_0x0133('0x99')](),_0x172207)['then'](function(_0x451e1f){var _0x34c7fc=_[_0x0133('0xbb')](_0x451e1f,_0x0133('0xbc'));var _0x33a550=[];return db[_0x0133('0xbd')][_0x0133('0xbe')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x0133('0x1f')](function(_0x2ff6ae){var _0x1abe5e=_0x2ff6ae[_0x0133('0xbf')];_0x50ce34[_0x0133('0x29')](function(_0x409e43){_0x33a550[_0x0133('0xc0')](updateMailInteraction(_0x409e43,_0x18e2db,_0x34c7fc,_0x1abe5e));});return BPromise['all'](_0x33a550);});});});})['then'](function(_0x2d9449){_0x92e8f4[_0x0133('0xc1')]=_0x2d9449;return _0x92e8f4;})[_0x0133('0x1f')](respondWithFilteredResult(_0x535a1d,_0x181b7e))[_0x0133('0x30')](handleError(_0x535a1d,null));};exports[_0x0133('0xc2')]=function(_0x58c56c,_0x71e346){var _0x472d17={'raw':![],'where':{'id':_0x58c56c[_0x0133('0xc3')]['id']}},_0x46e21e={};_0x46e21e[_0x0133('0x36')]=_[_0x0133('0x37')](db[_0x0133('0x32')]['rawAttributes']);_0x46e21e['query']=_[_0x0133('0x37')](_0x58c56c['query']);_0x46e21e[_0x0133('0x41')]=_[_0x0133('0x39')](_0x46e21e[_0x0133('0x36')],_0x46e21e[_0x0133('0x38')]);_0x472d17[_0x0133('0x3a')]=_[_0x0133('0x39')](_0x46e21e[_0x0133('0x36')],qs['fields'](_0x58c56c[_0x0133('0x38')][_0x0133('0x3b')]));_0x472d17['attributes']=_0x472d17[_0x0133('0x3a')][_0x0133('0x3c')]?_0x472d17['attributes']:_0x46e21e['model'];if(_0x58c56c[_0x0133('0x38')]['includeAll']){_0x472d17[_0x0133('0xc4')]=[{'all':!![]}];}_0x472d17=_[_0x0133('0xc5')]({},_0x472d17,_0x58c56c[_0x0133('0xc6')]);return db[_0x0133('0x32')][_0x0133('0x5b')](_0x472d17)[_0x0133('0x1f')](handleEntityNotFound(_0x71e346,null))['then'](respondWithResult(_0x71e346,null))['catch'](handleError(_0x71e346,null));};exports[_0x0133('0xc7')]=function(_0x3f7d0c,_0x163a0c){return db[_0x0133('0x32')][_0x0133('0xc7')](_0x3f7d0c['body'],{})['then'](respondWithResult(_0x163a0c,0xc9))[_0x0133('0x30')](handleError(_0x163a0c,null));};exports[_0x0133('0x1d')]=function(_0x51f74d,_0x205cf2){if(_0x51f74d['body']['id']){delete _0x51f74d[_0x0133('0xc8')]['id'];}return db[_0x0133('0x32')][_0x0133('0x5b')]({'where':{'id':_0x51f74d[_0x0133('0xc3')]['id']}})['then'](handleEntityNotFound(_0x205cf2,null))['then'](saveUpdates(_0x51f74d[_0x0133('0xc8')],null))[_0x0133('0x1f')](respondWithResult(_0x205cf2,null))[_0x0133('0x30')](handleError(_0x205cf2,null));};exports['destroy']=function(_0x2f8bef,_0x27d221){return db[_0x0133('0x32')][_0x0133('0x5b')]({'where':{'id':_0x2f8bef['params']['id']}})[_0x0133('0x1f')](handleEntityNotFound(_0x27d221,null))[_0x0133('0x1f')](removeEntity(_0x27d221,null))[_0x0133('0x30')](handleError(_0x27d221,null));};exports[_0x0133('0xc9')]=function(_0x45c175,_0x5020ed){return db[_0x0133('0x32')][_0x0133('0xc9')]()[_0x0133('0x1f')](respondWithResult(_0x5020ed,null))[_0x0133('0x30')](handleError(_0x5020ed,null));};exports['addMessage']=function(_0xbe6fac,_0x3484ba){return db[_0x0133('0x2a')][_0x0133('0x5b')]({'where':{'id':_0xbe6fac[_0x0133('0xc3')]['id']}})['then'](handleEntityNotFound(_0x3484ba,null))['then'](function(_0x3e0979){if(_0x3e0979){return _0x3e0979[_0x0133('0xca')](_0xbe6fac[_0x0133('0xc8')][_0x0133('0xcb')],_[_0x0133('0xcc')](_0xbe6fac['body'],['ids','id'])||{});}})[_0x0133('0x1f')](respondWithResult(_0x3484ba,null))[_0x0133('0x30')](handleError(_0x3484ba,null));};exports[_0x0133('0xcd')]=function(_0x12c3ee,_0xf585db){var _0x49c9bf={'raw':![],'where':{}};var _0x9992d9={};var _0x1d6c73={'count':0x0,'rows':[]};return db[_0x0133('0x32')][_0x0133('0xbe')]({'where':{'id':_0x12c3ee[_0x0133('0xc3')]['id']}})[_0x0133('0x1f')](handleEntityNotFound(_0xf585db,null))[_0x0133('0x1f')](function(_0x7764ee){if(_0x7764ee){_0x9992d9[_0x0133('0x36')]=_[_0x0133('0x37')](db['MailMessage'][_0x0133('0x33')]);_0x9992d9[_0x0133('0x38')]=_[_0x0133('0x37')](_0x12c3ee[_0x0133('0x38')]);_0x9992d9[_0x0133('0x41')]=_['intersection'](_0x9992d9[_0x0133('0x36')],_0x9992d9[_0x0133('0x38')]);_0x49c9bf[_0x0133('0x3a')]=_[_0x0133('0x39')](_0x9992d9[_0x0133('0x36')],qs[_0x0133('0x3b')](_0x12c3ee[_0x0133('0x38')]['fields']));_0x49c9bf[_0x0133('0x3a')]=_0x49c9bf[_0x0133('0x3a')]['length']?_0x49c9bf['attributes']:_0x9992d9[_0x0133('0x36')];if(!_0x12c3ee['query'][_0x0133('0x3d')](_0x0133('0xce'))){_0x49c9bf[_0x0133('0x17')]=qs['limit'](_0x12c3ee['query'][_0x0133('0x17')]);_0x49c9bf[_0x0133('0x1a')]=qs[_0x0133('0x1a')](_0x12c3ee[_0x0133('0x38')][_0x0133('0x1a')]);}_0x49c9bf['order']=qs['sort'](_0x12c3ee[_0x0133('0x38')][_0x0133('0x3f')]);_0x49c9bf['where']=qs[_0x0133('0x41')](_[_0x0133('0x42')](_0x12c3ee[_0x0133('0x38')],_0x9992d9[_0x0133('0x41')]));_0x49c9bf[_0x0133('0x40')][_0x0133('0xbc')]=_0x7764ee['id'];if(_0x12c3ee[_0x0133('0x38')][_0x0133('0x82')]){_0x49c9bf[_0x0133('0x40')]=_['merge'](_0x49c9bf[_0x0133('0x40')],{'$or':_[_0x0133('0x25')](_0x49c9bf[_0x0133('0x3a')],function(_0x466354){var _0x18fe78={};_0x18fe78[_0x466354]={'$like':'%'+_0x12c3ee[_0x0133('0x38')][_0x0133('0x82')]+'%'};return _0x18fe78;})});}if(_0x12c3ee[_0x0133('0x38')][_0x0133('0xcf')]){var _0x1ec149=_0x12c3ee['query']['$gte'][_0x0133('0x63')](',');var _0x2d7a9f={};_0x2d7a9f[_0x1ec149[0x0]]={'$gte':moment(_0x1ec149[0x1])['format'](_0x0133('0xd0'))};_0x49c9bf['where']=_['merge'](_0x49c9bf['where'],_0x2d7a9f);}_0x49c9bf=_[_0x0133('0xc5')]({},_0x49c9bf,_0x12c3ee[_0x0133('0xc6')]);return db[_0x0133('0x2a')][_0x0133('0x19')]({'where':_0x49c9bf[_0x0133('0x40')]})['then'](function(_0x2c700a){_0x1d6c73[_0x0133('0x19')]=_0x2c700a;if(_0x12c3ee[_0x0133('0x38')][_0x0133('0xd1')]){_0x49c9bf['include']=[{'all':!![]}];}return db[_0x0133('0x2a')]['findAll'](_0x49c9bf);})[_0x0133('0x1f')](function(_0x25ac5e){if(_0x12c3ee['query'][_0x0133('0xd2')]===_0x0133('0xd3')){for(var _0x25848e=0x0;_0x25848e<_0x25ac5e[_0x0133('0x3c')];_0x25848e++){_0x25ac5e[_0x25848e][_0x0133('0xc8')]=juice(_0x25ac5e[_0x25848e][_0x0133('0xc8')]);}}_0x1d6c73[_0x0133('0xc1')]=_0x25ac5e;return _0x1d6c73;});}})[_0x0133('0x1f')](respondWithFilteredResult(_0xf585db,_0x49c9bf))[_0x0133('0x30')](handleError(_0xf585db,null));};exports['addTags']=function(_0x4186af,_0x4902bd){return db['MailInteraction'][_0x0133('0x5b')]({'where':{'id':_0x4186af[_0x0133('0xc3')]['id']}})[_0x0133('0x1f')](handleEntityNotFound(_0x4902bd,null))[_0x0133('0x1f')](function(_0x24dcf9){if(_0x24dcf9){return _0x24dcf9[_0x0133('0xd4')](_0x4186af[_0x0133('0xc8')]['ids'],_['omit'](_0x4186af['body'],[_0x0133('0xcb'),'id'])||{})[_0x0133('0xd5')](function(){return db[_0x0133('0x6c')][_0x0133('0xd6')]({'attributes':['id','name','color'],'where':{'id':_0x4186af[_0x0133('0xc8')][_0x0133('0xcb')]}});})[_0x0133('0x1f')](function(_0x1594be){socket[_0x0133('0xd7')](_0x0133('0xd8'),{'id':Number(_0x4186af[_0x0133('0xc3')]['id']),'tags':_0x1594be||[]});return{'id':Number(_0x4186af['params']['id']),'tags':_0x1594be||[]};});}})[_0x0133('0x1f')](respondWithResult(_0x4902bd,null))[_0x0133('0x30')](handleError(_0x4902bd,null));};exports[_0x0133('0xd9')]=function(_0x2e44d8,_0x472880){return db[_0x0133('0x32')][_0x0133('0x5b')]({'where':{'id':_0x2e44d8[_0x0133('0xc3')]['id']}})['then'](handleEntityNotFound(_0x472880,null))[_0x0133('0x1f')](function(_0x2ea1dd){if(_0x2ea1dd){return _0x2ea1dd[_0x0133('0xd9')](_0x2e44d8[_0x0133('0x38')][_0x0133('0xcb')]);}})[_0x0133('0x1f')](respondWithStatusCode(_0x472880,null))[_0x0133('0x30')](handleError(_0x472880,null));};exports['download']=function(_0xfd35ab,_0x2f1388){var _0x6f5495=moment()[_0x0133('0xda')]()[_0x0133('0x99')]();var _0x3093e0=path[_0x0133('0xdb')](config[_0x0133('0xdc')],_0x0133('0xdd'),_0x0133('0xde'),'tmp');var _0x46d52e=path[_0x0133('0xdb')](config['root'],_0x0133('0xdd'),_0x0133('0xde'),_0x0133('0xdf'));var _0x5c2ebb=path[_0x0133('0xdb')](_0x3093e0,_0x6f5495);var _0x196b84=util['format'](_0x0133('0xe0'),_0xfd35ab[_0x0133('0xc3')]['id'],_0x6f5495);var _0x3f4055=path[_0x0133('0xdb')](_0x3093e0,_0x196b84);var _0x3dc91b=[];if(_0xfd35ab['query'][_0x0133('0xdf')]){_0x3dc91b['push']({'model':db[_0x0133('0xe1')],'as':_0x0133('0xe2'),'raw':!![]});}var _0x25afd0=[{'model':db[_0x0133('0x2a')],'as':_0x0133('0xe3'),'attributes':['id',_0x0133('0xc8'),_0x0133('0x45'),'to','cc','bcc',_0x0133('0xe4'),_0x0133('0x76')],'where':{'secret':![]},'order':qs[_0x0133('0x3f')]('id'),'include':_0x3dc91b}];return db[_0x0133('0x32')]['find']({'where':{'id':_0xfd35ab[_0x0133('0xc3')]['id']},'include':_0x25afd0})[_0x0133('0x1f')](handleEntityNotFound(_0x2f1388,null))['then'](function(_0x44db86){if(_0x44db86&&_0x44db86[_0x0133('0xe3')]){var _0x5b25c9=_0x44db86[_0x0133('0xe5')]({'plain':!![]});fs[_0x0133('0xe6')](_0x5c2ebb);return BPromise[_0x0133('0xe7')](_0x5b25c9[_0x0133('0xe3')],function(_0x88cfe3,_0x17b245){var _0x55d0d6={'from':_0x88cfe3[_0x0133('0x45')],'to':_0x88cfe3['to'],'subject':_0x88cfe3[_0x0133('0xe4')],'html':htmlEntities['decode'](_0x88cfe3['body']),'headers':{'Date':moment(_0x88cfe3['createdAt'])[_0x0133('0xe8')](_0x0133('0xe9'))},'attachments':[]};if(_0x88cfe3['cc']){_0x55d0d6[_0x0133('0xea')]['Cc']=_0x88cfe3['cc'];}if(_0x88cfe3[_0x0133('0xeb')]){_0x55d0d6['headers'][_0x0133('0xec')]=_0x88cfe3[_0x0133('0xeb')];}return new BPromise(function(_0x313153,_0x4acb95){if(_0x88cfe3[_0x0133('0xe2')]){for(var _0x4e38a3=0x0;_0x4e38a3<_0x88cfe3['Attachments'][_0x0133('0x3c')];_0x4e38a3++){var _0x296e1d=_0x88cfe3[_0x0133('0xe2')][_0x4e38a3];var _0x1e756b=path['join'](_0x46d52e,_0x296e1d['basename']);if(fs[_0x0133('0xed')](_0x1e756b)){_0x55d0d6[_0x0133('0xdf')][_0x0133('0xc0')]({'name':_0x296e1d[_0x0133('0x22')],'contentType':_0x296e1d[_0x0133('0x69')],'data':fs['readFileSync'](_0x1e756b)});}}}emlformat['build'](_0x55d0d6,function(_0x3b3f7f,_0x3be6e0){if(_0x3b3f7f)return _0x4acb95(_0x3b3f7f);fs['writeFileSync'](path[_0x0133('0xdb')](_0x5c2ebb,util[_0x0133('0xe8')]('message%d.eml',_0x17b245)),_0x3be6e0);return _0x313153(_0x3be6e0);});});})[_0x0133('0x1f')](function(){return new BPromise(function(_0x5442b2,_0x23082b){zipdir(_0x5c2ebb,{'saveTo':_0x3f4055},function(_0x1e2660,_0x2acd11){if(_0x1e2660)return _0x23082b(_0x1e2660);return _0x5442b2(_0x2acd11);});})['then'](function(){return new BPromise(function(_0x5e1cd6,_0x221a26){rimraf(_0x5c2ebb,function(_0x5e6a79){if(_0x5e6a79)_0x221a26(_0x5e6a79);return _0x5e1cd6();});});})[_0x0133('0x1f')](function(){return _0x2f1388[_0x0133('0xee')](_0x3f4055,_0x196b84,function(_0x1bd931){if(!_0x1bd931)fs[_0x0133('0xef')](_0x3f4055);});});});}else{return _0x2f1388[_0x0133('0x14')](0xc8);}})[_0x0133('0x30')](handleError(_0x2f1388,null));}; \ No newline at end of file +var _0xf61c=['where','pick','filters','select','field','tools_tags','u.id','u.fullname','ui.MailInteractionId','from','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','keyBy','merge','unreadMessages','a.key','Account.key','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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','groupBy','enableEmailPreview','push','all','rows','show','params','MailInteraction','includeAll','create','body','addMessage','ids','getMessages','findOne','format','options','include','findAll','true','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','unix','root','server','files','attachments','join','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','offset','undefined','count','set','update','then','end','sendStatus','error','stack','name','send','Users','Tags','split','forEach','MailMessage','out','plainBody','lastMsgText','trimStart','catch','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf61c,0xa6));var _0xcf61=function(_0x5cd242,_0x5cf89a){_0x5cd242=_0x5cd242-0x0;var _0x5725da=_0xf61c[_0x5cd242];return _0x5725da;};'use strict';var emlformat=require(_0xcf61('0x0'));var rimraf=require(_0xcf61('0x1'));var zipdir=require(_0xcf61('0x2'));var moment=require(_0xcf61('0x3'));var BPromise=require(_0xcf61('0x4'));var util=require(_0xcf61('0x5'));var path=require(_0xcf61('0x6'));var fs=require('fs');var _=require(_0xcf61('0x7'));var squel=require(_0xcf61('0x8'));var juice=require(_0xcf61('0x9'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xcf61('0xa'));var logger=require(_0xcf61('0xb'))(_0xcf61('0xc'));var config=require(_0xcf61('0xd'));var db=require(_0xcf61('0xe'))['db'];var htmlEntities=require(_0xcf61('0xf'));config[_0xcf61('0x10')]=_[_0xcf61('0x11')](config[_0xcf61('0x10')],{'host':_0xcf61('0x12'),'port':0x18eb});var socket=require(_0xcf61('0x13'))(new Redis(config[_0xcf61('0x10')]));require(_0xcf61('0x14'))[_0xcf61('0x15')](socket);function respondWithStatusCode(_0x592ed7,_0x5485d8){_0x5485d8=_0x5485d8||0xcc;return function(_0x396478){if(_0x396478){return _0x592ed7['sendStatus'](_0x5485d8);}return _0x592ed7[_0xcf61('0x16')](_0x5485d8)['end']();};}function respondWithResult(_0x27c057,_0x3d3b18){_0x3d3b18=_0x3d3b18||0xc8;return function(_0x39c3e1){if(_0x39c3e1){return _0x27c057[_0xcf61('0x16')](_0x3d3b18)[_0xcf61('0x17')](_0x39c3e1);}};}function respondWithFilteredResult(_0x2a049c,_0x52d697){return function(_0x3c01e3){if(_0x3c01e3){var _0x3fd366=typeof _0x52d697[_0xcf61('0x18')]===_0xcf61('0x19')&&typeof _0x52d697['limit']===_0xcf61('0x19');var _0x25c56=_0x3c01e3[_0xcf61('0x1a')];var _0x34f952=_0x3fd366?0x0:_0x52d697[_0xcf61('0x18')];var _0x4d8eb7=_0x3fd366?_0x3c01e3[_0xcf61('0x1a')]:_0x52d697[_0xcf61('0x18')]+_0x52d697['limit'];var _0x260ef7;if(_0x4d8eb7>=_0x25c56){_0x4d8eb7=_0x25c56;_0x260ef7=0xc8;}else{_0x260ef7=0xce;}_0x2a049c[_0xcf61('0x16')](_0x260ef7);return _0x2a049c[_0xcf61('0x1b')]('Content-Range',_0x34f952+'-'+_0x4d8eb7+'/'+_0x25c56)[_0xcf61('0x17')](_0x3c01e3);}return null;};}function saveUpdates(_0xd344fa){return function(_0x5e5147){if(_0x5e5147){return _0x5e5147[_0xcf61('0x1c')](_0xd344fa)[_0xcf61('0x1d')](function(_0x3e03df){return _0x3e03df;});}return null;};}function removeEntity(_0x30744f){return function(_0x44cce2){if(_0x44cce2){return _0x44cce2['destroy']()[_0xcf61('0x1d')](function(){_0x30744f[_0xcf61('0x16')](0xcc)[_0xcf61('0x1e')]();});}};}function handleEntityNotFound(_0x138ec7){return function(_0x2aef25){if(!_0x2aef25){_0x138ec7[_0xcf61('0x1f')](0x194);}return _0x2aef25;};}function handleError(_0x167ab4,_0x2f009f){_0x2f009f=_0x2f009f||0x1f4;return function(_0x33503f){logger[_0xcf61('0x20')](_0x33503f[_0xcf61('0x21')]);if(_0x33503f[_0xcf61('0x22')]){delete _0x33503f[_0xcf61('0x22')];}_0x167ab4[_0xcf61('0x16')](_0x2f009f)[_0xcf61('0x23')](_0x33503f);};}function getInteractionUsers(_0x51f9fe,_0x203a1a){return new BPromise(function(_0x1d7aab,_0x2644bc){try{if(_0x203a1a[_0x51f9fe['id']]){_0x51f9fe[_0xcf61('0x24')]=_['map'](_0x203a1a[_0x51f9fe['id']],function(_0x31a343){return{'id':_0x31a343['id'],'fullname':_0x31a343['fullname']};});}}catch(_0x1ac572){_0x2644bc(_0x1ac572);}_0x1d7aab(_0x51f9fe);});}function getInteractionTags(_0x3467eb,_0x9f0a72){return new BPromise(function(_0x52aae0,_0x1a7211){try{if(_0x3467eb['TagIds']){_0x3467eb[_0xcf61('0x25')]=[];_0x3467eb['TagIds'][_0xcf61('0x26')](',')[_0xcf61('0x27')](function(_0x4043c1){_0x3467eb[_0xcf61('0x25')]['push'](_0x9f0a72[_0x4043c1]);});}delete _0x3467eb['TagIds'];}catch(_0xdf44af){_0x1a7211(_0xdf44af);}_0x52aae0(_0x3467eb);});}function getLastMessageText(_0x122b7b){return new BPromise(function(_0x442693,_0x4feefa){return db[_0xcf61('0x28')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x122b7b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xcf61('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xcf61('0x2a')],'order':'-id','raw':!![]})[_0xcf61('0x1d')](function(_0x1c568b){if(_0x1c568b&&_0x1c568b[_0xcf61('0x2a')]){_0x122b7b[_0xcf61('0x2b')]=_[_0xcf61('0x2c')](_0x1c568b[_0xcf61('0x2a')]);}_0x442693(_0x122b7b);})[_0xcf61('0x2d')](function(_0x58bc60){_0x4feefa(_0x58bc60);});});}function updateMailInteraction(_0x13936d,_0x457f8f,_0xac8e72,_0x11e0a6){return new BPromise(function(_0x82a04a,_0x47bc02){return getInteractionUsers(_0x13936d,_0xac8e72)[_0xcf61('0x1d')](function(_0x3e817e){return getInteractionTags(_0x3e817e,_0x457f8f);})[_0xcf61('0x1d')](function(_0x362b23){if(_0x11e0a6){_0x82a04a(getLastMessageText(_0x362b23));}else{_0x82a04a(_0x362b23);}})['catch'](function(_0x4199fc){_0x47bc02(_0x4199fc);});});}exports[_0xcf61('0x2e')]=function(_0x1dc19b,_0x145698){var _0x421b9f={},_0x3e8783={},_0x3608cd={'count':0x0,'rows':[]};var _0x4ca9c5=_[_0xcf61('0x2f')](db['MailInteraction'][_0xcf61('0x30')],function(_0x16851d){return{'name':_0x16851d[_0xcf61('0x31')],'type':_0x16851d['type'][_0xcf61('0x32')]};});_0x3e8783['model']=_['map'](_0x4ca9c5,_0xcf61('0x22'));_0x3e8783[_0xcf61('0x33')]=_[_0xcf61('0x34')](_0x1dc19b[_0xcf61('0x33')]);_0x3e8783['filters']=_[_0xcf61('0x35')](_0x3e8783[_0xcf61('0x36')],_0x3e8783['query']);_0x421b9f[_0xcf61('0x37')]=_[_0xcf61('0x35')](_0x3e8783[_0xcf61('0x36')],qs[_0xcf61('0x38')](_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x38')]));_0x421b9f[_0xcf61('0x37')]=_0x421b9f['attributes'][_0xcf61('0x39')]?_0x421b9f[_0xcf61('0x37')]:_0x3e8783['model'];if(!_0x1dc19b['query'][_0xcf61('0x3a')](_0xcf61('0x3b'))){_0x421b9f[_0xcf61('0x3c')]=qs[_0xcf61('0x3c')](_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x3c')]);_0x421b9f['offset']=qs[_0xcf61('0x18')](_0x1dc19b['query'][_0xcf61('0x18')]);}_0x421b9f['order']=qs[_0xcf61('0x3d')](_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x3d')]);_0x421b9f[_0xcf61('0x3e')]=qs['filters'](_[_0xcf61('0x3f')](_0x1dc19b[_0xcf61('0x33')],_0x3e8783[_0xcf61('0x40')]),_0x4ca9c5);var _0x7c4e50=[];var _0x193861=squel[_0xcf61('0x41')]()[_0xcf61('0x42')]('id')['field']('name')[_0xcf61('0x42')]('color')['from'](_0xcf61('0x43'));var _0x283b8d=squel[_0xcf61('0x41')]()[_0xcf61('0x42')](_0xcf61('0x44'))[_0xcf61('0x42')](_0xcf61('0x45'))[_0xcf61('0x42')](_0xcf61('0x46'))[_0xcf61('0x47')]('user_has_mail_interactions','ui')['left_join']('users','u',_0xcf61('0x48'));var _0x971b9a=squel[_0xcf61('0x41')]()['from'](_0xcf61('0x49'),'i')[_0xcf61('0x4a')](_0xcf61('0x4b'),'c',_0xcf61('0x4c'))[_0xcf61('0x4a')]('users','o',_0xcf61('0x4d'))['left_join'](_0xcf61('0x4e'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0xcf61('0x4f'),'me',_0xcf61('0x50'))[_0xcf61('0x4a')]('mail_interaction_has_tags','it',_0xcf61('0x51'))[_0xcf61('0x4a')](_0xcf61('0x43'),'t','t.id\x20=\x20it.TagId');var _0x2a74fe=squel[_0xcf61('0x52')]();var _0x4acf2a=[];var _0xf61cfc=squel['expr']();var _0x545f29;if(_0x1dc19b['query'][_0xcf61('0x53')]){_0x545f29=as[_0xcf61('0x54')](_0x1dc19b[_0xcf61('0x33')]['search']);var _0x3a5f83=_0x545f29[_0xcf61('0x55')];for(var _0x6eb0a6=0x0;_0x6eb0a6<_0x545f29['conditions'][_0xcf61('0x39')];_0x6eb0a6++){var _0x469179=_0x545f29[_0xcf61('0x56')][_0x6eb0a6];var _0x39461c='i';var _0xdd4b59=_[_0xcf61('0x57')](_0x4ca9c5,[_0xcf61('0x22'),_0x469179[_0xcf61('0x42')]]);if(!_0xdd4b59){switch(_0x469179['field']){case'unreadMessages':if(_0x469179[_0xcf61('0x58')]==0x1){_0x971b9a[_0xcf61('0x59')]('`'+_0x469179[_0xcf61('0x42')]+_0xcf61('0x5a'));}else{_0x971b9a[_0xcf61('0x59')]('`'+_0x469179[_0xcf61('0x42')]+_0xcf61('0x5b'));}break;case'Contact':if(_0x469179['operator']===_0xcf61('0x5c')){if(_0x469179[_0xcf61('0x58')]['split']('\x20')[_0xcf61('0x39')]>0x1){_0x2a74fe[_0x3a5f83](_0xcf61('0x5d'),qs[_0xcf61('0x5e')](_0x469179[_0xcf61('0x58')]),null);}else{var _0xe75ef9='%'+_0x469179[_0xcf61('0x58')]+'%';_0x2a74fe[_0x3a5f83]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xe75ef9,_0xe75ef9,_0xe75ef9);}}else{_0xdd4b59=_[_0xcf61('0x57')](_0x4ca9c5,[_0xcf61('0x22'),_0xcf61('0x5f')]);_0x469179[_0xcf61('0x42')]='ContactId';_0x564521=as[_0xcf61('0x60')](_0x39461c,_0xdd4b59[_0xcf61('0x61')],_0x469179);_0x2a74fe[_0x3a5f83](_0x564521[_0xcf61('0x62')],_0x564521['value']['start'],_0x564521[_0xcf61('0x58')][_0xcf61('0x1e')]);}break;case _0xcf61('0x63'):var _0xd85ae4=_0x469179[_0xcf61('0x58')][_0xcf61('0x26')](',')['map'](function(_0x2ed044){return Number(_0x2ed044);});_0xd85ae4['forEach'](function(_0x43338c){_0xf61cfc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x43338c+',%');});_0x4acf2a=_[_0xcf61('0x64')](_0x4acf2a,_0xd85ae4);break;case _0xcf61('0x65'):if(_0x469179[_0xcf61('0x66')]===_0xcf61('0x5c')){_0x2a74fe[_0x3a5f83](_0xcf61('0x67'),'%'+_0x469179[_0xcf61('0x58')]+'%',null);}else{_0xdd4b59=_[_0xcf61('0x57')](_0x4ca9c5,[_0xcf61('0x22'),_0xcf61('0x68')]);_0x469179[_0xcf61('0x42')]=_0xcf61('0x68');_0x564521=as[_0xcf61('0x60')](_0x39461c,_0xdd4b59[_0xcf61('0x61')],_0x469179);_0x2a74fe[_0x3a5f83](_0x564521[_0xcf61('0x62')],_0x564521[_0xcf61('0x58')][_0xcf61('0x69')],_0x564521['value']['end']);}break;case _0xcf61('0x2a'):_0x564521=as[_0xcf61('0x60')]('me',null,_0x469179);_0x2a74fe[_0x3a5f83](_0x564521[_0xcf61('0x62')],_0x564521[_0xcf61('0x58')][_0xcf61('0x69')],_0x564521['value']['end']);break;}}else{var _0x564521=as[_0xcf61('0x60')](_0x39461c,_0xdd4b59['type'],_0x469179);_0x2a74fe[_0x3a5f83](_0x564521[_0xcf61('0x62')],_0x564521[_0xcf61('0x58')][_0xcf61('0x69')],_0x564521['value'][_0xcf61('0x1e')]);}}}else{var _0x1460fb=_(_0x1dc19b[_0xcf61('0x33')])[_0xcf61('0x34')]()[_0xcf61('0x2f')](function(_0x2d9b1e){return _[_0xcf61('0x6a')](_0x4ca9c5,[_0xcf61('0x22'),_0x2d9b1e])?_0x2d9b1e:undefined;})[_0xcf61('0x6b')]()['value']();if(!_[_0xcf61('0x6c')](_0x1460fb)){_0x1460fb[_0xcf61('0x27')](function(_0x26de8f){if(_0x26de8f===_0xcf61('0x6d')){_0x971b9a[_0xcf61('0x3e')](_0xcf61('0x6e'),[]['concat'](_0x1dc19b[_0xcf61('0x33')][_0x26de8f]));}else if(_0x26de8f===_0xcf61('0x6f')){var _0x3b0f0c=JSON['parse'](_0x1dc19b[_0xcf61('0x33')][_0x26de8f])[_0xcf61('0x70')];var _0x31d961=JSON[_0xcf61('0x71')](_0x1dc19b[_0xcf61('0x33')][_0x26de8f])[_0xcf61('0x72')];_0x971b9a['where'](_0xcf61('0x73'),_0x3b0f0c,_0x31d961);}else{if(_0x1dc19b[_0xcf61('0x33')][_0x26de8f]==='null'){_0x971b9a[_0xcf61('0x3e')]('i.'+_0x26de8f+_0xcf61('0x74'));}else{_0x971b9a['where']('i.'+_0x26de8f+_0xcf61('0x75'),_0x1dc19b[_0xcf61('0x33')][_0x26de8f]);}}});}if(_0x1dc19b[_0xcf61('0x33')]['read']){if(_0x1dc19b['query'][_0xcf61('0x76')]==0x1){_0x971b9a['having'](_0xcf61('0x77'));}else{_0x971b9a[_0xcf61('0x59')](_0xcf61('0x78'));}}if(_0x1dc19b['query'][_0xcf61('0x79')]){_0x4acf2a=_[_0xcf61('0x7a')](_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x79')])?_0x1dc19b['query'][_0xcf61('0x79')]:new Array(_0x1dc19b[_0xcf61('0x33')]['tag']);_0x4acf2a['forEach'](function(_0x4d60a9){_0xf61cfc['or'](_0xcf61('0x7b'),'%,'+_0x4d60a9+',%');});}if(_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x7c')]){var _0x309e18=_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x7c')][_0xcf61('0x7d')]('\x5c','\x5c\x5c')[_0xcf61('0x7d')](/'/g,'\x27\x27');if(qs[_0xcf61('0x7e')](_0x309e18)){_0x2a74fe['or'](_0xcf61('0x7f'),_0x309e18+'%');}else if(qs[_0xcf61('0x80')](_0x309e18)){_0x2a74fe['or'](_0xcf61('0x81'),_0x309e18+'%');}else{_0x2a74fe['or'](_0xcf61('0x82'),qs[_0xcf61('0x5e')](_0x309e18))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcf61('0x5e')](_0x309e18));}}}_0x971b9a[_0xcf61('0x3e')](_0x2a74fe);_0x971b9a['group'](_0xcf61('0x83'));var _0x51280a={'type':db[_0xcf61('0x84')]['QueryTypes'][_0xcf61('0x85')],'raw':!![]};var _0x1c0555=_0x971b9a['clone']();_0x1c0555[_0xcf61('0x42')](_0xcf61('0x83'));_0x1c0555[_0xcf61('0x42')](_0xcf61('0x86'),'unreadMessages');if(_0x421b9f[_0xcf61('0x87')]){_0x421b9f[_0xcf61('0x87')]['forEach'](function(_0x1c01a6){var _0x290c9d=_0x1c01a6[0x0]==='contactName'?_0x1c01a6[0x0]:'i.'+_0x1c01a6[0x0];_0x971b9a[_0xcf61('0x87')](_0x290c9d,_0x1c01a6[0x1]===_0xcf61('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x4acf2a)){_0x971b9a['having'](_0xf61cfc);_0x1c0555[_0xcf61('0x3e')]('t.id\x20IN\x20?',_0x4acf2a);}BPromise[_0xcf61('0x89')]()['then'](function(){if(!_0x545f29){if(_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x6d')])return;_0x1c0555['where'](_0xcf61('0x8a'));_0x971b9a[_0xcf61('0x3e')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1dc19b[_0xcf61('0x8b')]['role']!=='agent')return;return _0x1dc19b['user'][_0xcf61('0x8c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x638977){if(_['isEmpty'](_0x638977)){_0x1c0555['where'](_0xcf61('0x8d'));_0x971b9a[_0xcf61('0x3e')](_0xcf61('0x8d'));}else{_0x1c0555[_0xcf61('0x3e')]('i.MailAccountId\x20IN\x20?',_[_0xcf61('0x2f')](_0x638977,'id'));_0x971b9a[_0xcf61('0x3e')](_0xcf61('0x6e'),_[_0xcf61('0x2f')](_0x638977,'id'));}});})['then'](function(){if(_0x1dc19b['user']['role']===_0xcf61('0x8e')&&!_0x545f29&&!_0x1dc19b[_0xcf61('0x33')][_0xcf61('0x6d')])return[];return db['sequelize']['query'](_0x1c0555[_0xcf61('0x8f')](),_0x51280a);})[_0xcf61('0x1d')](function(_0x2c348d){_0x3608cd[_0xcf61('0x1a')]=_0x2c348d[_0xcf61('0x39')];if(_0x3608cd[_0xcf61('0x1a')]===0x0)return[];return db['sequelize'][_0xcf61('0x33')](_0x193861[_0xcf61('0x8f')](),_0x51280a)['then'](function(_0x57d596){_0x7c4e50=_[_0xcf61('0x90')](_0x57d596,'id');_0x51280a=_[_0xcf61('0x91')](_0x51280a,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1dc19b['query']['fields']){_0x421b9f[_0xcf61('0x37')][_0xcf61('0x27')](function(_0x5b2777){_0x971b9a[_0xcf61('0x42')]('i.'+_0x5b2777);});}else{_0x971b9a[_0xcf61('0x42')](_0xcf61('0x86'),_0xcf61('0x92'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x93'),_0xcf61('0x94'));_0x971b9a[_0xcf61('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x971b9a[_0xcf61('0x42')](_0xcf61('0x95'),_0xcf61('0x96'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x83'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x97'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x98'));_0x971b9a['field'](_0xcf61('0x99'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9a'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9b'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9c'));_0x971b9a[_0xcf61('0x42')]('i.lastMsgDirection');_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9d'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9e'));_0x971b9a['field']('i.secondDisposition');_0x971b9a[_0xcf61('0x42')](_0xcf61('0x9f'));_0x971b9a['field'](_0xcf61('0xa0'));_0x971b9a[_0xcf61('0x42')]('i.to');_0x971b9a[_0xcf61('0x42')]('i.ContactId');_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa1'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa2'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa3'),_0xcf61('0xa4'));_0x971b9a['field']('c.lastName','Contact.lastName');_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa5'),_0xcf61('0xa6'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa7'),_0xcf61('0xa8'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xa9'),_0xcf61('0xaa'));_0x971b9a[_0xcf61('0x42')]('c.fax','Contact.fax');_0x971b9a[_0xcf61('0x42')](_0xcf61('0xab'),_0xcf61('0xac'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xad'),_0xcf61('0xae'));_0x971b9a[_0xcf61('0x42')](_0xcf61('0xaf'),_0xcf61('0xb0'));}if(_0x421b9f['limit'])_0x971b9a['limit'](_0x421b9f['limit']);if(_0x421b9f[_0xcf61('0x18')])_0x971b9a['offset'](_0x421b9f[_0xcf61('0x18')]);return db[_0xcf61('0xb1')][_0xcf61('0x33')](_0x971b9a[_0xcf61('0x8f')](),_0x51280a);})[_0xcf61('0x1d')](function(_0x1e0e09){if(_0x1e0e09[_0xcf61('0x39')]>0x0)_0x283b8d[_0xcf61('0x3e')]('ui.MailInteractionId\x20IN\x20?',_[_0xcf61('0x2f')](_0x1e0e09,'id'));return db[_0xcf61('0xb1')][_0xcf61('0x33')](_0x283b8d[_0xcf61('0x8f')](),_0x51280a)['then'](function(_0x4cb36a){var _0x48eaa5=_[_0xcf61('0xb2')](_0x4cb36a,'MailInteractionId');var _0x3d53ee=[];return db['Setting']['findOne']({'attributes':[_0xcf61('0xb3')],'raw':!![]})[_0xcf61('0x1d')](function(_0x72696e){var _0x3bf123=_0x72696e[_0xcf61('0xb3')];_0x1e0e09[_0xcf61('0x27')](function(_0x17f6f6){_0x3d53ee[_0xcf61('0xb4')](updateMailInteraction(_0x17f6f6,_0x7c4e50,_0x48eaa5,_0x3bf123));});return BPromise[_0xcf61('0xb5')](_0x3d53ee);});});});})['then'](function(_0x3edd73){_0x3608cd[_0xcf61('0xb6')]=_0x3edd73;return _0x3608cd;})['then'](respondWithFilteredResult(_0x145698,_0x421b9f))[_0xcf61('0x2d')](handleError(_0x145698,null));};exports[_0xcf61('0xb7')]=function(_0x2d0e90,_0x439c77){var _0x2b0293={'raw':![],'where':{'id':_0x2d0e90[_0xcf61('0xb8')]['id']}},_0x5e511c={};_0x5e511c[_0xcf61('0x36')]=_['keys'](db[_0xcf61('0xb9')][_0xcf61('0x30')]);_0x5e511c['query']=_[_0xcf61('0x34')](_0x2d0e90[_0xcf61('0x33')]);_0x5e511c['filters']=_[_0xcf61('0x35')](_0x5e511c[_0xcf61('0x36')],_0x5e511c[_0xcf61('0x33')]);_0x2b0293[_0xcf61('0x37')]=_[_0xcf61('0x35')](_0x5e511c[_0xcf61('0x36')],qs[_0xcf61('0x38')](_0x2d0e90[_0xcf61('0x33')][_0xcf61('0x38')]));_0x2b0293['attributes']=_0x2b0293[_0xcf61('0x37')][_0xcf61('0x39')]?_0x2b0293[_0xcf61('0x37')]:_0x5e511c[_0xcf61('0x36')];if(_0x2d0e90[_0xcf61('0x33')][_0xcf61('0xba')]){_0x2b0293['include']=[{'all':!![]}];}_0x2b0293=_[_0xcf61('0x91')]({},_0x2b0293,_0x2d0e90['options']);return db['MailInteraction']['find'](_0x2b0293)[_0xcf61('0x1d')](handleEntityNotFound(_0x439c77,null))[_0xcf61('0x1d')](respondWithResult(_0x439c77,null))[_0xcf61('0x2d')](handleError(_0x439c77,null));};exports['create']=function(_0x58c258,_0x85e29b){return db[_0xcf61('0xb9')][_0xcf61('0xbb')](_0x58c258[_0xcf61('0xbc')],{})[_0xcf61('0x1d')](respondWithResult(_0x85e29b,0xc9))[_0xcf61('0x2d')](handleError(_0x85e29b,null));};exports[_0xcf61('0x1c')]=function(_0x2f68f0,_0x3ab963){if(_0x2f68f0[_0xcf61('0xbc')]['id']){delete _0x2f68f0[_0xcf61('0xbc')]['id'];}return db[_0xcf61('0xb9')]['find']({'where':{'id':_0x2f68f0[_0xcf61('0xb8')]['id']}})['then'](handleEntityNotFound(_0x3ab963,null))[_0xcf61('0x1d')](saveUpdates(_0x2f68f0[_0xcf61('0xbc')],null))['then'](respondWithResult(_0x3ab963,null))['catch'](handleError(_0x3ab963,null));};exports['destroy']=function(_0x5ce157,_0x3acb4b){return db[_0xcf61('0xb9')][_0xcf61('0x57')]({'where':{'id':_0x5ce157[_0xcf61('0xb8')]['id']}})[_0xcf61('0x1d')](handleEntityNotFound(_0x3acb4b,null))[_0xcf61('0x1d')](removeEntity(_0x3acb4b,null))[_0xcf61('0x2d')](handleError(_0x3acb4b,null));};exports['describe']=function(_0x4cbee4,_0x48360d){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x48360d,null))[_0xcf61('0x2d')](handleError(_0x48360d,null));};exports['addMessage']=function(_0x46cbf0,_0x102715){return db['MailMessage'][_0xcf61('0x57')]({'where':{'id':_0x46cbf0[_0xcf61('0xb8')]['id']}})[_0xcf61('0x1d')](handleEntityNotFound(_0x102715,null))['then'](function(_0x10d355){if(_0x10d355){return _0x10d355[_0xcf61('0xbd')](_0x46cbf0['body'][_0xcf61('0xbe')],_['omit'](_0x46cbf0[_0xcf61('0xbc')],[_0xcf61('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x102715,null))[_0xcf61('0x2d')](handleError(_0x102715,null));};exports[_0xcf61('0xbf')]=function(_0x199047,_0x4c87c9){var _0x23a92a={'raw':![],'where':{}};var _0x3a34be={};var _0x4c6297={'count':0x0,'rows':[]};return db[_0xcf61('0xb9')][_0xcf61('0xc0')]({'where':{'id':_0x199047[_0xcf61('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4c87c9,null))['then'](function(_0x19b808){if(_0x19b808){_0x3a34be[_0xcf61('0x36')]=_[_0xcf61('0x34')](db[_0xcf61('0x28')][_0xcf61('0x30')]);_0x3a34be[_0xcf61('0x33')]=_[_0xcf61('0x34')](_0x199047[_0xcf61('0x33')]);_0x3a34be[_0xcf61('0x40')]=_[_0xcf61('0x35')](_0x3a34be['model'],_0x3a34be[_0xcf61('0x33')]);_0x23a92a[_0xcf61('0x37')]=_['intersection'](_0x3a34be[_0xcf61('0x36')],qs[_0xcf61('0x38')](_0x199047[_0xcf61('0x33')][_0xcf61('0x38')]));_0x23a92a[_0xcf61('0x37')]=_0x23a92a[_0xcf61('0x37')][_0xcf61('0x39')]?_0x23a92a[_0xcf61('0x37')]:_0x3a34be[_0xcf61('0x36')];if(!_0x199047[_0xcf61('0x33')]['hasOwnProperty'](_0xcf61('0x3b'))){_0x23a92a[_0xcf61('0x3c')]=qs[_0xcf61('0x3c')](_0x199047[_0xcf61('0x33')]['limit']);_0x23a92a['offset']=qs['offset'](_0x199047['query'][_0xcf61('0x18')]);}_0x23a92a[_0xcf61('0x87')]=qs['sort'](_0x199047['query'][_0xcf61('0x3d')]);_0x23a92a[_0xcf61('0x3e')]=qs[_0xcf61('0x40')](_[_0xcf61('0x3f')](_0x199047[_0xcf61('0x33')],_0x3a34be[_0xcf61('0x40')]));_0x23a92a[_0xcf61('0x3e')]['MailInteractionId']=_0x19b808['id'];if(_0x199047[_0xcf61('0x33')][_0xcf61('0x7c')]){_0x23a92a[_0xcf61('0x3e')]=_['merge'](_0x23a92a['where'],{'$or':_['map'](_0x23a92a[_0xcf61('0x37')],function(_0x274692){var _0xcde744={};_0xcde744[_0x274692]={'$like':'%'+_0x199047[_0xcf61('0x33')]['filter']+'%'};return _0xcde744;})});}if(_0x199047[_0xcf61('0x33')][_0xcf61('0x70')]){var _0xb1af84=_0x199047['query'][_0xcf61('0x70')][_0xcf61('0x26')](',');var _0x3ce065={};_0x3ce065[_0xb1af84[0x0]]={'$gte':moment(_0xb1af84[0x1])[_0xcf61('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x23a92a[_0xcf61('0x3e')]=_['merge'](_0x23a92a[_0xcf61('0x3e')],_0x3ce065);}_0x23a92a=_[_0xcf61('0x91')]({},_0x23a92a,_0x199047[_0xcf61('0xc2')]);return db['MailMessage'][_0xcf61('0x1a')]({'where':_0x23a92a[_0xcf61('0x3e')]})[_0xcf61('0x1d')](function(_0xe42a80){_0x4c6297[_0xcf61('0x1a')]=_0xe42a80;if(_0x199047['query']['includeAll']){_0x23a92a[_0xcf61('0xc3')]=[{'all':!![]}];}return db['MailMessage'][_0xcf61('0xc4')](_0x23a92a);})['then'](function(_0x175681){if(_0x199047[_0xcf61('0x33')]['inlineCss']===_0xcf61('0xc5')){for(var _0x5151b0=0x0;_0x5151b0<_0x175681[_0xcf61('0x39')];_0x5151b0++){_0x175681[_0x5151b0][_0xcf61('0xbc')]=juice(_0x175681[_0x5151b0][_0xcf61('0xbc')]);}}_0x4c6297['rows']=_0x175681;return _0x4c6297;});}})[_0xcf61('0x1d')](respondWithFilteredResult(_0x4c87c9,_0x23a92a))[_0xcf61('0x2d')](handleError(_0x4c87c9,null));};exports[_0xcf61('0xc6')]=function(_0x4feb5c,_0x3647b1){return db['MailInteraction']['find']({'where':{'id':_0x4feb5c[_0xcf61('0xb8')]['id']}})[_0xcf61('0x1d')](handleEntityNotFound(_0x3647b1,null))[_0xcf61('0x1d')](function(_0x3bc9d6){if(_0x3bc9d6){return _0x3bc9d6[_0xcf61('0xc7')](_0x4feb5c[_0xcf61('0xbc')][_0xcf61('0xbe')],_['omit'](_0x4feb5c[_0xcf61('0xbc')],[_0xcf61('0xbe'),'id'])||{})[_0xcf61('0xc8')](function(){return db[_0xcf61('0x63')][_0xcf61('0xc4')]({'attributes':['id',_0xcf61('0x22'),'color'],'where':{'id':_0x4feb5c[_0xcf61('0xbc')][_0xcf61('0xbe')]}});})[_0xcf61('0x1d')](function(_0x1f1884){socket['emit'](_0xcf61('0xc9'),{'id':Number(_0x4feb5c[_0xcf61('0xb8')]['id']),'tags':_0x1f1884||[]});return{'id':Number(_0x4feb5c[_0xcf61('0xb8')]['id']),'tags':_0x1f1884||[]};});}})[_0xcf61('0x1d')](respondWithResult(_0x3647b1,null))[_0xcf61('0x2d')](handleError(_0x3647b1,null));};exports[_0xcf61('0xca')]=function(_0x138a99,_0x40af34){return db[_0xcf61('0xb9')]['find']({'where':{'id':_0x138a99[_0xcf61('0xb8')]['id']}})['then'](handleEntityNotFound(_0x40af34,null))['then'](function(_0x1b95a9){if(_0x1b95a9){return _0x1b95a9[_0xcf61('0xca')](_0x138a99['query']['ids']);}})[_0xcf61('0x1d')](respondWithStatusCode(_0x40af34,null))[_0xcf61('0x2d')](handleError(_0x40af34,null));};exports[_0xcf61('0xcb')]=function(_0x198228,_0x5c5909){var _0x1a3c67=moment()[_0xcf61('0xcc')]()['toString']();var _0x394a13=path['join'](config[_0xcf61('0xcd')],_0xcf61('0xce'),'files','tmp');var _0x30e46c=path['join'](config[_0xcf61('0xcd')],_0xcf61('0xce'),_0xcf61('0xcf'),_0xcf61('0xd0'));var _0x2b58dd=path[_0xcf61('0xd1')](_0x394a13,_0x1a3c67);var _0x43af8b=util[_0xcf61('0xc1')](_0xcf61('0xd2'),_0x198228[_0xcf61('0xb8')]['id'],_0x1a3c67);var _0x192153=path[_0xcf61('0xd1')](_0x394a13,_0x43af8b);var _0x2da309=[];if(_0x198228[_0xcf61('0x33')][_0xcf61('0xd0')]){_0x2da309[_0xcf61('0xb4')]({'model':db[_0xcf61('0xd3')],'as':_0xcf61('0xd4'),'raw':!![]});}var _0x3a4ab3=[{'model':db[_0xcf61('0x28')],'as':_0xcf61('0xd5'),'attributes':['id',_0xcf61('0xbc'),'from','to','cc',_0xcf61('0xd6'),_0xcf61('0xd7'),_0xcf61('0x6f')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x2da309}];return db['MailInteraction'][_0xcf61('0x57')]({'where':{'id':_0x198228['params']['id']},'include':_0x3a4ab3})[_0xcf61('0x1d')](handleEntityNotFound(_0x5c5909,null))[_0xcf61('0x1d')](function(_0xbbfefb){if(_0xbbfefb&&_0xbbfefb[_0xcf61('0xd5')]){var _0x3998d5=_0xbbfefb[_0xcf61('0xd8')]({'plain':!![]});fs[_0xcf61('0xd9')](_0x2b58dd);return BPromise[_0xcf61('0xda')](_0x3998d5['Messages'],function(_0x58b810,_0x528d4f){var _0x527966={'from':_0x58b810[_0xcf61('0x47')],'to':_0x58b810['to'],'subject':_0x58b810[_0xcf61('0xd7')],'html':htmlEntities[_0xcf61('0xdb')](_0x58b810['body']),'headers':{'Date':moment(_0x58b810[_0xcf61('0x6f')])[_0xcf61('0xc1')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x58b810['cc']){_0x527966[_0xcf61('0xdc')]['Cc']=_0x58b810['cc'];}if(_0x58b810[_0xcf61('0xd6')]){_0x527966[_0xcf61('0xdc')][_0xcf61('0xdd')]=_0x58b810[_0xcf61('0xd6')];}return new BPromise(function(_0x1f2710,_0x2f0699){if(_0x58b810[_0xcf61('0xd4')]){for(var _0x4edc9e=0x0;_0x4edc9e<_0x58b810['Attachments'][_0xcf61('0x39')];_0x4edc9e++){var _0x3acfc6=_0x58b810[_0xcf61('0xd4')][_0x4edc9e];var _0x15ac0c=path['join'](_0x30e46c,_0x3acfc6[_0xcf61('0xde')]);if(fs['existsSync'](_0x15ac0c)){_0x527966[_0xcf61('0xd0')][_0xcf61('0xb4')]({'name':_0x3acfc6['name'],'contentType':_0x3acfc6[_0xcf61('0x61')],'data':fs[_0xcf61('0xdf')](_0x15ac0c)});}}}emlformat[_0xcf61('0xe0')](_0x527966,function(_0x502a2e,_0x454994){if(_0x502a2e)return _0x2f0699(_0x502a2e);fs[_0xcf61('0xe1')](path[_0xcf61('0xd1')](_0x2b58dd,util[_0xcf61('0xc1')](_0xcf61('0xe2'),_0x528d4f)),_0x454994);return _0x1f2710(_0x454994);});});})[_0xcf61('0x1d')](function(){return new BPromise(function(_0xf97f20,_0x5991ef){zipdir(_0x2b58dd,{'saveTo':_0x192153},function(_0x5ae44a,_0x45cfb2){if(_0x5ae44a)return _0x5991ef(_0x5ae44a);return _0xf97f20(_0x45cfb2);});})[_0xcf61('0x1d')](function(){return new BPromise(function(_0x3637a8,_0x44ef52){rimraf(_0x2b58dd,function(_0x4e16d1){if(_0x4e16d1)_0x44ef52(_0x4e16d1);return _0x3637a8();});});})[_0xcf61('0x1d')](function(){return _0x5c5909[_0xcf61('0xcb')](_0x192153,_0x43af8b,function(_0x1fe08a){if(!_0x1fe08a)fs[_0xcf61('0xe3')](_0x192153);});});});}else{return _0x5c5909['sendStatus'](0xc8);}})[_0xcf61('0x2d')](handleError(_0x5c5909,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ccc5ad2..1962701 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 _0x4f2d=['MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','hook','exports','events','../../mysqldb'];(function(_0x5a9288,_0x13ff0d){var _0x3e6455=function(_0x5337df){while(--_0x5337df){_0x5a9288['push'](_0x5a9288['shift']());}};_0x3e6455(++_0x13ff0d);}(_0x4f2d,0xa8));var _0xd4f2=function(_0x1ed31f,_0x2e3826){_0x1ed31f=_0x1ed31f-0x0;var _0x20d5df=_0x4f2d[_0x1ed31f];return _0x20d5df;};'use strict';var EventEmitter=require(_0xd4f2('0x0'));var MailInteraction=require(_0xd4f2('0x1'))['db'][_0xd4f2('0x2')];var MailMessage=require(_0xd4f2('0x1'))['db'][_0xd4f2('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd4f2('0x4')](0x0);var events={'afterCreate':_0xd4f2('0x5'),'afterUpdate':_0xd4f2('0x6'),'afterDestroy':_0xd4f2('0x7')};function emitEvent(_0xd20ef8){return function(_0x3111e7,_0x18ab13,_0x36dc1b){_0x3111e7['getUsers']({'attributes':['id'],'raw':!![]})[_0xd4f2('0x8')](function(_0x34dbc6){_0x3111e7[_0xd4f2('0x9')](_0xd4f2('0xa'),_0x34dbc6[_0xd4f2('0xb')](function(_0x2a10c8){return{'id':_0x2a10c8['id']};}));return MailMessage[_0xd4f2('0xc')]({'where':{'MailInteractionId':_0x3111e7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd4f2('0x8')](function(_0x5d98cb){_0x3111e7[_0xd4f2('0x9')](_0xd4f2('0xd'),_0x5d98cb['length']);MailInteractionEvents[_0xd4f2('0xe')](_0xd20ef8+':'+_0x3111e7['id'],_0x3111e7);MailInteractionEvents['emit'](_0xd20ef8,_0x3111e7);_0x36dc1b(null);})['catch'](_0x36dc1b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xd4f2('0xf')](e,emitEvent(event));}}module[_0xd4f2('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xe8d2=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xe8d2,0x80));var _0x2e8d=function(_0x191277,_0x1db9b5){_0x191277=_0x191277-0x0;var _0x282861=_0xe8d2[_0x191277];return _0x282861;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x2e8d('0x0')];var MailMessage=require(_0x2e8d('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2e8d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e8d('0x3'),'afterDestroy':_0x2e8d('0x4')};function emitEvent(_0x10f552){return function(_0x57e7d1,_0x2fb048,_0x51501a){_0x57e7d1[_0x2e8d('0x5')]({'attributes':['id'],'raw':!![]})[_0x2e8d('0x6')](function(_0x160f34){_0x57e7d1[_0x2e8d('0x7')](_0x2e8d('0x8'),_0x160f34[_0x2e8d('0x9')](function(_0x2deb29){return{'id':_0x2deb29['id']};}));return MailMessage[_0x2e8d('0xa')]({'where':{'MailInteractionId':_0x57e7d1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x9ba237){_0x57e7d1[_0x2e8d('0x7')](_0x2e8d('0xb'),_0x9ba237['length']);MailInteractionEvents[_0x2e8d('0xc')](_0x10f552+':'+_0x57e7d1['id'],_0x57e7d1);MailInteractionEvents[_0x2e8d('0xc')](_0x10f552,_0x57e7d1);_0x51501a(null);})[_0x2e8d('0xd')](_0x51501a(null));};}for(var e in events){if(events[_0x2e8d('0xe')](e)){var event=events[e];MailInteraction[_0x2e8d('0xf')](e,emitEvent(event));}}module[_0x2e8d('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 36a32ba..b2617d5 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 _0x6309=['MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x6309,0x88));var _0x9630=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x6309[_0x35d4e9];return _0x5c2770;};'use strict';var _=require(_0x9630('0x0'));var util=require(_0x9630('0x1'));var logger=require(_0x9630('0x2'))(_0x9630('0x3'));var moment=require(_0x9630('0x4'));var BPromise=require(_0x9630('0x5'));var rp=require(_0x9630('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9630('0x7'));var config=require(_0x9630('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x9630('0x9')]=function(_0x1635bf,_0x3353f1){return _0x1635bf['define']('MailInteraction',attributes,{'tableName':_0x9630('0xa'),'paranoid':![],'indexes':[{'name':_0x9630('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d6219,_0x5734d5,_0x220faf){if(_0x5d6219[_0x9630('0xc')]){_0x5d6219[_0x9630('0xd')]=moment()[_0x9630('0xe')](_0x9630('0xf'));}if(_0x5d6219[_0x9630('0x10')]){_0x5d6219[_0x9630('0x11')]=moment()['format'](_0x9630('0xf'));}_0x220faf(null,_0x5734d5);},'beforeUpdate':function(_0x135949,_0xbd94a5,_0xb5c999){if(_0x135949[_0x9630('0x12')](_0x9630('0xc'))){_0x135949[_0x9630('0xd')]=_0x135949[_0x9630('0xc')]?moment()[_0x9630('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x135949[_0x9630('0x12')](_0x9630('0x10'))){_0x135949[_0x9630('0x11')]=moment()[_0x9630('0xe')](_0x9630('0xf'));_0x135949[_0x9630('0xc')]=null;_0x135949[_0x9630('0xd')]=null;}_0xb5c999(null,_0x135949);},'afterUpdate':function(_0x157286,_0x5dcc14,_0x78fb7b){var _0x1aac54=_0x1635bf[_0x9630('0x13')];var _0x3fed51=_0x157286['get']({'plain':!![]});if(_0x3fed51[_0x9630('0x10')]){return _0x1aac54[_0x9630('0x14')][_0x9630('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3fed51['id']}})[_0x9630('0x16')](function(){_0x78fb7b();})[_0x9630('0x17')](function(_0x36e65a){_0x78fb7b(_0x36e65a);});}else{_0x78fb7b();}}},'charset':_0x9630('0x18'),'collate':_0x9630('0x19')});}; \ No newline at end of file +var _0xd5a9=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','FULLTEXT','substatus'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xd5a9,0x1a7));var _0x9d5a=function(_0x5ccda6,_0x3f53f0){_0x5ccda6=_0x5ccda6-0x0;var _0x363ea2=_0xd5a9[_0x5ccda6];return _0x363ea2;};'use strict';var _=require(_0x9d5a('0x0'));var util=require(_0x9d5a('0x1'));var logger=require(_0x9d5a('0x2'))(_0x9d5a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d5a('0x4'));var fs=require('fs');var path=require(_0x9d5a('0x5'));var rimraf=require(_0x9d5a('0x6'));var config=require(_0x9d5a('0x7'));var attributes=require(_0x9d5a('0x8'));module[_0x9d5a('0x9')]=function(_0x4b4941,_0xd445bc){return _0x4b4941[_0x9d5a('0xa')]('MailInteraction',attributes,{'tableName':_0x9d5a('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x9d5a('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c9a10,_0x3b4508,_0x1f1abf){if(_0x5c9a10[_0x9d5a('0xd')]){_0x5c9a10[_0x9d5a('0xe')]=moment()[_0x9d5a('0xf')](_0x9d5a('0x10'));}if(_0x5c9a10[_0x9d5a('0x11')]){_0x5c9a10[_0x9d5a('0x12')]=moment()[_0x9d5a('0xf')](_0x9d5a('0x10'));}_0x1f1abf(null,_0x3b4508);},'beforeUpdate':function(_0x31ce85,_0x596aa0,_0x247479){if(_0x31ce85[_0x9d5a('0x13')]('substatus')){_0x31ce85['substatusAt']=_0x31ce85[_0x9d5a('0xd')]?moment()['format'](_0x9d5a('0x10')):null;}if(_0x31ce85[_0x9d5a('0x13')]('closed')){_0x31ce85['closedAt']=moment()[_0x9d5a('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x31ce85[_0x9d5a('0xd')]=null;_0x31ce85[_0x9d5a('0xe')]=null;}_0x247479(null,_0x31ce85);},'afterUpdate':function(_0x2c6bde,_0x208cda,_0x3bceb7){var _0x5240cd=_0x4b4941[_0x9d5a('0x14')];var _0x207a53=_0x2c6bde['get']({'plain':!![]});if(_0x207a53[_0x9d5a('0x11')]){return _0x5240cd['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x207a53['id']}})['then'](function(){_0x3bceb7();})[_0x9d5a('0x15')](function(_0x800c2b){_0x3bceb7(_0x800c2b);});}else{_0x3bceb7();}}},'charset':'utf8mb4','collate':_0x9d5a('0x16')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index d1f586c..71010b3 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 _0x14e4=['catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1dc24d,_0x541fa4){var _0x5d7fb2=function(_0x7ccd26){while(--_0x7ccd26){_0x1dc24d['push'](_0x1dc24d['shift']());}};_0x5d7fb2(++_0x541fa4);}(_0x14e4,0x144));var _0x414e=function(_0x27eb24,_0x1f6465){_0x27eb24=_0x27eb24-0x0;var _0x49e183=_0x14e4[_0x27eb24];return _0x49e183;};'use strict';var _=require(_0x414e('0x0'));var util=require(_0x414e('0x1'));var moment=require(_0x414e('0x2'));var BPromise=require(_0x414e('0x3'));var rs=require(_0x414e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x414e('0x5'))['db'];var utils=require(_0x414e('0x6'));var logger=require(_0x414e('0x7'))(_0x414e('0x8'));var config=require('../../config/environment');var jayson=require(_0x414e('0x9'));var client=jayson[_0x414e('0xa')][_0x414e('0xb')]({'port':0x232a});config['redis']=_[_0x414e('0xc')](config[_0x414e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x414e('0xe'))(new Redis(config['redis']));require(_0x414e('0xf'))[_0x414e('0x10')](socket);function respondWithRpcPromise(_0x335be7,_0x33be53,_0x1acf63){return new BPromise(function(_0x4762db,_0x19a850){return client[_0x414e('0x11')](_0x335be7,_0x1acf63)[_0x414e('0x12')](function(_0x16cf1c){logger[_0x414e('0x13')](_0x414e('0x14'),_0x33be53,'request\x20sent');logger[_0x414e('0x15')](_0x414e('0x16'),_0x33be53,_0x414e('0x17'),JSON[_0x414e('0x18')](_0x16cf1c));if(_0x16cf1c[_0x414e('0x19')]){if(_0x16cf1c[_0x414e('0x19')][_0x414e('0x1a')]===0x1f4){logger['error'](_0x414e('0x14'),_0x33be53,_0x16cf1c[_0x414e('0x19')][_0x414e('0x1b')]);return _0x19a850(_0x16cf1c[_0x414e('0x19')]['message']);}logger[_0x414e('0x19')]('MailInteraction,\x20%s,\x20%s',_0x33be53,_0x16cf1c['error'][_0x414e('0x1b')]);return _0x4762db(_0x16cf1c[_0x414e('0x19')][_0x414e('0x1b')]);}else{logger[_0x414e('0x13')](_0x414e('0x14'),_0x33be53,_0x414e('0x17'));_0x4762db(_0x16cf1c['result'][_0x414e('0x1b')]);}})[_0x414e('0x1c')](function(_0x29639b){logger[_0x414e('0x19')](_0x414e('0x14'),_0x33be53,_0x29639b);_0x19a850(_0x29639b);});});}exports[_0x414e('0x1d')]=function(_0x364f93){var _0x233f04=this;return new Promise(function(_0x5db6ae,_0x11dd15){return db['MailInteraction'][_0x414e('0x1e')](_0x364f93[_0x414e('0x1f')],{'raw':_0x364f93[_0x414e('0x20')]?_0x364f93[_0x414e('0x20')][_0x414e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x364f93[_0x414e('0x20')]?_0x364f93['options'][_0x414e('0x22')]||null:null,'attributes':_0x364f93[_0x414e('0x20')]?_0x364f93[_0x414e('0x20')][_0x414e('0x23')]||null:null,'limit':_0x364f93[_0x414e('0x20')]?_0x364f93['options'][_0x414e('0x24')]||null:null})['then'](function(_0x3bf25c){logger[_0x414e('0x13')](_0x414e('0x1d'),_0x364f93);logger['debug']('UpdateMailInteraction',_0x364f93,JSON[_0x414e('0x18')](_0x3bf25c));_0x5db6ae(_0x3bf25c);})['catch'](function(_0x101c81){logger['error'](_0x414e('0x1d'),_0x101c81['message'],_0x364f93);_0x11dd15(_0x233f04['error'](0x1f4,_0x101c81[_0x414e('0x1b')]));});});};exports[_0x414e('0x25')]=function(_0x44c0f4){return new Promise(function(_0x32aba8,_0x50ee9f){return db['MailInteraction'][_0x414e('0x26')]({'where':_0x44c0f4['options']?_0x44c0f4[_0x414e('0x20')][_0x414e('0x22')]||null:null})[_0x414e('0x12')](function(_0x5bf54d){if(_0x5bf54d){return _0x5bf54d[_0x414e('0x27')](_0x44c0f4[_0x414e('0x1f')][_0x414e('0x28')],_[_0x414e('0x29')](_0x44c0f4[_0x414e('0x1f')],[_0x414e('0x28'),'id'])||{});}})[_0x414e('0x2a')](function(_0x2ddce4){logger['info'](_0x414e('0x2b'),_0x44c0f4);logger[_0x414e('0x15')]('AddTags',_0x44c0f4,JSON[_0x414e('0x18')](_0x2ddce4));_0x32aba8(_0x2ddce4);})['catch'](function(_0x258c88){logger[_0x414e('0x19')](_0x414e('0x2b'),_0x258c88[_0x414e('0x1b')],_0x44c0f4);_0x50ee9f(_this[_0x414e('0x19')](0x1f4,_0x258c88[_0x414e('0x1b')]));});});}; \ No newline at end of file +var _0xf8fa=['redis','defaults','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','MailInteraction','update','body','options','raw','where','attributes','limit','then','UpdateMailInteraction','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x386814,_0x5d4190){var _0x2548d2=function(_0x447278){while(--_0x447278){_0x386814['push'](_0x386814['shift']());}};_0x2548d2(++_0x5d4190);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x27c156,_0x14ce9b){_0x27c156=_0x27c156-0x0;var _0x4a94af=_0xf8fa[_0x27c156];return _0x4a94af;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var moment=require(_0xaf8f('0x1'));var BPromise=require(_0xaf8f('0x2'));var rs=require(_0xaf8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf8f('0x5'))(_0xaf8f('0x6'));var config=require(_0xaf8f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf8f('0x8')][_0xaf8f('0x9')]({'port':0x232a});config[_0xaf8f('0xa')]=_[_0xaf8f('0xb')](config[_0xaf8f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaf8f('0xc'))[_0xaf8f('0xd')](socket);function respondWithRpcPromise(_0x3b51c3,_0x3376b2,_0x2f375d){return new BPromise(function(_0x328c7b,_0x4c3c07){return client[_0xaf8f('0xe')](_0x3b51c3,_0x2f375d)['then'](function(_0x2d2ad0){logger[_0xaf8f('0xf')](_0xaf8f('0x10'),_0x3376b2,_0xaf8f('0x11'));logger[_0xaf8f('0x12')](_0xaf8f('0x13'),_0x3376b2,_0xaf8f('0x11'),JSON[_0xaf8f('0x14')](_0x2d2ad0));if(_0x2d2ad0['error']){if(_0x2d2ad0['error'][_0xaf8f('0x15')]===0x1f4){logger[_0xaf8f('0x16')](_0xaf8f('0x10'),_0x3376b2,_0x2d2ad0[_0xaf8f('0x16')][_0xaf8f('0x17')]);return _0x4c3c07(_0x2d2ad0[_0xaf8f('0x16')][_0xaf8f('0x17')]);}logger[_0xaf8f('0x16')](_0xaf8f('0x10'),_0x3376b2,_0x2d2ad0[_0xaf8f('0x16')][_0xaf8f('0x17')]);return _0x328c7b(_0x2d2ad0['error'][_0xaf8f('0x17')]);}else{logger['info'](_0xaf8f('0x10'),_0x3376b2,_0xaf8f('0x11'));_0x328c7b(_0x2d2ad0['result'][_0xaf8f('0x17')]);}})[_0xaf8f('0x18')](function(_0x1df079){logger[_0xaf8f('0x16')](_0xaf8f('0x10'),_0x3376b2,_0x1df079);_0x4c3c07(_0x1df079);});});}exports['UpdateMailInteraction']=function(_0x1b8f7d){var _0xa9c349=this;return new Promise(function(_0x3bec71,_0x54c9a6){return db[_0xaf8f('0x19')][_0xaf8f('0x1a')](_0x1b8f7d[_0xaf8f('0x1b')],{'raw':_0x1b8f7d[_0xaf8f('0x1c')]?_0x1b8f7d[_0xaf8f('0x1c')][_0xaf8f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b8f7d[_0xaf8f('0x1c')]?_0x1b8f7d['options'][_0xaf8f('0x1e')]||null:null,'attributes':_0x1b8f7d[_0xaf8f('0x1c')]?_0x1b8f7d[_0xaf8f('0x1c')][_0xaf8f('0x1f')]||null:null,'limit':_0x1b8f7d[_0xaf8f('0x1c')]?_0x1b8f7d['options'][_0xaf8f('0x20')]||null:null})[_0xaf8f('0x21')](function(_0x4e75df){logger[_0xaf8f('0xf')]('UpdateMailInteraction',_0x1b8f7d);logger['debug'](_0xaf8f('0x22'),_0x1b8f7d,JSON['stringify'](_0x4e75df));_0x3bec71(_0x4e75df);})[_0xaf8f('0x18')](function(_0x1213b3){logger['error'](_0xaf8f('0x22'),_0x1213b3[_0xaf8f('0x17')],_0x1b8f7d);_0x54c9a6(_0xa9c349['error'](0x1f4,_0x1213b3[_0xaf8f('0x17')]));});});};exports[_0xaf8f('0x23')]=function(_0x566389){return new Promise(function(_0xd8b9db,_0x18dc27){return db[_0xaf8f('0x19')][_0xaf8f('0x24')]({'where':_0x566389['options']?_0x566389[_0xaf8f('0x1c')][_0xaf8f('0x1e')]||null:null})[_0xaf8f('0x21')](function(_0x52041a){if(_0x52041a){return _0x52041a['addTags'](_0x566389[_0xaf8f('0x1b')][_0xaf8f('0x25')],_[_0xaf8f('0x26')](_0x566389[_0xaf8f('0x1b')],['ids','id'])||{});}})[_0xaf8f('0x27')](function(_0x3754f4){logger[_0xaf8f('0xf')](_0xaf8f('0x28'),_0x566389);logger[_0xaf8f('0x12')](_0xaf8f('0x28'),_0x566389,JSON[_0xaf8f('0x14')](_0x3754f4));_0xd8b9db(_0x3754f4);})[_0xaf8f('0x18')](function(_0x336323){logger[_0xaf8f('0x16')]('AddTags',_0x336323[_0xaf8f('0x17')],_0x566389);_0x18dc27(_this[_0xaf8f('0x16')](0x1f4,_0x336323[_0xaf8f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5234d42..4c603c5 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 _0xfd56=['mailInteraction:','./mailInteraction.events','save','update','emit','register'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xfd56,0x1e7));var _0x6fd5=function(_0x410190,_0x24dc21){_0x410190=_0x410190-0x0;var _0x5a981f=_0xfd56[_0x410190];return _0x5a981f;};'use strict';var MailInteractionEvents=require(_0x6fd5('0x0'));var events=[_0x6fd5('0x1'),'remove',_0x6fd5('0x2')];function createListener(_0x3e439c,_0x52b493){return function(_0xab576a){_0x52b493[_0x6fd5('0x3')](_0x3e439c,_0xab576a);};}function removeListener(_0x10fdd1,_0x5cc61a){return function(){MailInteractionEvents['removeListener'](_0x10fdd1,_0x5cc61a);};}exports[_0x6fd5('0x4')]=function(_0x591bbd){for(var _0x574479=0x0,_0x2d9dde=events['length'];_0x574479<_0x2d9dde;_0x574479++){var _0x2dde54=events[_0x574479];var _0x2eb398=createListener(_0x6fd5('0x5')+_0x2dde54,_0x591bbd);MailInteractionEvents['on'](_0x2dde54,_0x2eb398);}}; \ No newline at end of file +var _0x5e1d=['mailInteraction:','./mailInteraction.events','update','removeListener','length'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0x5e1d,0x191));var _0xd5e1=function(_0x1c7b33,_0x381cc5){_0x1c7b33=_0x1c7b33-0x0;var _0x154be0=_0x5e1d[_0x1c7b33];return _0x154be0;};'use strict';var MailInteractionEvents=require(_0xd5e1('0x0'));var events=['save','remove',_0xd5e1('0x1')];function createListener(_0x3f3e4c,_0x4dc2d9){return function(_0x6538ed){_0x4dc2d9['emit'](_0x3f3e4c,_0x6538ed);};}function removeListener(_0x533dc2,_0x22917d){return function(){MailInteractionEvents[_0xd5e1('0x2')](_0x533dc2,_0x22917d);};}exports['register']=function(_0x30553b){for(var _0x3b18a3=0x0,_0x3e2b5c=events[_0xd5e1('0x3')];_0x3b18a3<_0x3e2b5c;_0x3b18a3++){var _0x3310d7=events[_0x3b18a3];var _0x515a46=createListener(_0xd5e1('0x4')+_0x3310d7,_0x30553b);MailInteractionEvents['on'](_0x3310d7,_0x515a46);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 26b8864..a2e78a6 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 _0x97a2=['get','isAuthenticated','index','/describe','/:id','show','/:id/download','tracked','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x115303,_0x47d05f){var _0x1e695f=function(_0x2dbdf2){while(--_0x2dbdf2){_0x115303['push'](_0x115303['shift']());}};_0x1e695f(++_0x47d05f);}(_0x97a2,0x1b1));var _0x297a=function(_0x2b8189,_0xb90e23){_0x2b8189=_0x2b8189-0x0;var _0x2dc101=_0x97a2[_0x2b8189];return _0x2dc101;};'use strict';var multer=require(_0x297a('0x0'));var util=require('util');var path=require(_0x297a('0x1'));var timeout=require(_0x297a('0x2'));var express=require(_0x297a('0x3'));var router=express[_0x297a('0x4')]();var fs_extra=require(_0x297a('0x5'));var auth=require(_0x297a('0x6'));var interaction=require(_0x297a('0x7'));var config=require(_0x297a('0x8'));var controller=require('./mailMessage.controller');router[_0x297a('0x9')]('/',auth[_0x297a('0xa')](),controller[_0x297a('0xb')]);router[_0x297a('0x9')](_0x297a('0xc'),auth[_0x297a('0xa')](),controller['describe']);router[_0x297a('0x9')](_0x297a('0xd'),auth[_0x297a('0xa')](),controller[_0x297a('0xe')]);router[_0x297a('0x9')](_0x297a('0xf'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x297a('0xa')](),interaction[_0x297a('0x10')](_0x297a('0x11'),_0x297a('0x12')),controller['create']);router[_0x297a('0x13')](_0x297a('0xd'),auth[_0x297a('0xa')](),controller[_0x297a('0x14')]);router[_0x297a('0x13')](_0x297a('0x15'),auth[_0x297a('0xa')](),controller['accept']);router['put'](_0x297a('0x16'),auth['isAuthenticated'](),controller[_0x297a('0x17')]);router[_0x297a('0x18')]('/:id',auth[_0x297a('0xa')](),controller[_0x297a('0x19')]);module['exports']=router; \ No newline at end of file +var _0xc577=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','multer','connect-timeout','express','Router','fs-extra'];(function(_0x39bc06,_0x18d7ff){var _0x131143=function(_0x254f7f){while(--_0x254f7f){_0x39bc06['push'](_0x39bc06['shift']());}};_0x131143(++_0x18d7ff);}(_0xc577,0x172));var _0x7c57=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0xc577[_0x30fdf9];return _0x3c43bb;};'use strict';var multer=require(_0x7c57('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7c57('0x1'));var express=require(_0x7c57('0x2'));var router=express[_0x7c57('0x3')]();var fs_extra=require(_0x7c57('0x4'));var auth=require(_0x7c57('0x5'));var interaction=require(_0x7c57('0x6'));var config=require(_0x7c57('0x7'));var controller=require('./mailMessage.controller');router[_0x7c57('0x8')]('/',auth[_0x7c57('0x9')](),controller[_0x7c57('0xa')]);router[_0x7c57('0x8')](_0x7c57('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7c57('0xc'),auth['isAuthenticated'](),controller[_0x7c57('0xd')]);router[_0x7c57('0x8')](_0x7c57('0xe'),auth[_0x7c57('0x9')](),controller['download']);router[_0x7c57('0xf')]('/',auth[_0x7c57('0x9')](),interaction['tracked'](_0x7c57('0x10'),_0x7c57('0x11')),controller[_0x7c57('0x12')]);router[_0x7c57('0x13')](_0x7c57('0xc'),auth[_0x7c57('0x9')](),controller[_0x7c57('0x14')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x7c57('0x15')]);router[_0x7c57('0x13')](_0x7c57('0x16'),auth[_0x7c57('0x9')](),controller[_0x7c57('0x17')]);router[_0x7c57('0x18')](_0x7c57('0xc'),auth[_0x7c57('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index bfae554..63682b1 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 _0x5527=['BOOLEAN','out','STRING','DATE','long','ENUM','Email','sequelize','lodash','exports','TEXT','medium'];(function(_0x4a8eca,_0x5960c6){var _0xe67da5=function(_0x4c89ab){while(--_0x4c89ab){_0x4a8eca['push'](_0x4a8eca['shift']());}};_0xe67da5(++_0x5960c6);}(_0x5527,0x13f));var _0x7552=function(_0x22e22f,_0x4b43c5){_0x22e22f=_0x22e22f-0x0;var _0x41a005=_0x5527[_0x22e22f];return _0x41a005;};'use strict';var Sequelize=require(_0x7552('0x0'));var _=require(_0x7552('0x1'));module[_0x7552('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7552('0x3')](_0x7552('0x4'))},'read':{'type':Sequelize[_0x7552('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7552('0x6')),'defaultValue':_0x7552('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7552('0x7')](0x1fe)},'from':{'type':Sequelize[_0x7552('0x7')]},'to':{'type':Sequelize[_0x7552('0x3')]('long')},'cc':{'type':Sequelize[_0x7552('0x3')]('long')},'bcc':{'type':Sequelize[_0x7552('0x3')]('long')},'subject':{'type':Sequelize[_0x7552('0x3')]},'sentAt':{'type':Sequelize[_0x7552('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7552('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7552('0x8')]},'originTo':{'type':Sequelize[_0x7552('0x3')]('long')},'originCc':{'type':Sequelize[_0x7552('0x3')](_0x7552('0x9'))},'originChannel':{'type':Sequelize[_0x7552('0xa')](_0x7552('0xb'),'Chat'),'defaultValue':_0x7552('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xa9ed=['out','STRING','long','INTEGER','DATE','ENUM','Email','sequelize','lodash','TEXT','medium','BOOLEAN'];(function(_0x18826a,_0x49063e){var _0x5e01a9=function(_0x2d4b1b){while(--_0x2d4b1b){_0x18826a['push'](_0x18826a['shift']());}};_0x5e01a9(++_0x49063e);}(_0xa9ed,0x11b));var _0xda9e=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xa9ed[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require(_0xda9e('0x0'));var _=require(_0xda9e('0x1'));module['exports']={'body':{'type':Sequelize[_0xda9e('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xda9e('0x2')](_0xda9e('0x3'))},'read':{'type':Sequelize[_0xda9e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xda9e('0x5')),'defaultValue':_0xda9e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xda9e('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xda9e('0x7'))},'cc':{'type':Sequelize['TEXT'](_0xda9e('0x7'))},'bcc':{'type':Sequelize[_0xda9e('0x2')](_0xda9e('0x7'))},'subject':{'type':Sequelize[_0xda9e('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xda9e('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xda9e('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xda9e('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xda9e('0x7'))},'originCc':{'type':Sequelize[_0xda9e('0x2')](_0xda9e('0x7'))},'originChannel':{'type':Sequelize[_0xda9e('0xa')](_0xda9e('0xb'),'Chat'),'defaultValue':_0xda9e('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e12b382..8397246 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 _0xf223=['json','update','destroy','end','sendStatus','name','send','MailMessage','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','create','out','secret','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','CmContact','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','interface','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','SIP/%s','motionChannel','download','unix','toString','files','tmp','server','message-%s.eml','bcc','createdAt','Attachments','from','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','eml-format','moment','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','status','offset','undefined','limit','count','Content-Range'];(function(_0x530e78,_0x34b3c2){var _0x50ab0c=function(_0x32389d){while(--_0x32389d){_0x530e78['push'](_0x530e78['shift']());}};_0x50ab0c(++_0x34b3c2);}(_0xf223,0x7c));var _0x3f22=function(_0x387357,_0x1c560c){_0x387357=_0x387357-0x0;var _0x5a1a42=_0xf223[_0x387357];return _0x5a1a42;};'use strict';var emlformat=require(_0x3f22('0x0'));var moment=require(_0x3f22('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x3f22('0x2'));var fs=require('fs');var _=require(_0x3f22('0x3'));var Redis=require(_0x3f22('0x4'));var htmlToText=require(_0x3f22('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f22('0x6'))(_0x3f22('0x7'));var interaction_log=require('../../config/logger')(_0x3f22('0x8'));var config=require(_0x3f22('0x9'));var db=require(_0x3f22('0xa'))['db'];config[_0x3f22('0xb')]=_[_0x3f22('0xc')](config[_0x3f22('0xb')],{'host':_0x3f22('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f22('0xb')]));var htmlEntities=require('html-entities');require(_0x3f22('0xe'))[_0x3f22('0xf')](socket);var jayson=require(_0x3f22('0x10'));var client=jayson[_0x3f22('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x3f22('0x11')][_0x3f22('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x3f22('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x1a7147,_0x7cb57c,_0x1b831c,_0x3f881e){return new BPromise(function(_0x19b9de,_0xe39e27){var _0x37a3b0=_0x3f881e||client;return _0x37a3b0[_0x3f22('0x13')](_0x1a7147,_0x1b831c)[_0x3f22('0x14')](function(_0x4bd43f){logger[_0x3f22('0x15')](_0x3f22('0x16'),_0x7cb57c,_0x3f22('0x17'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x7cb57c,_0x3f22('0x17'),JSON[_0x3f22('0x18')](_0x4bd43f));if(_0x4bd43f['error']){if(_0x4bd43f[_0x3f22('0x19')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x7cb57c,_0x4bd43f[_0x3f22('0x19')][_0x3f22('0x1a')]);return _0xe39e27(_0x4bd43f[_0x3f22('0x19')][_0x3f22('0x1a')]);}logger[_0x3f22('0x19')]('MailMessage,\x20%s,\x20%s',_0x7cb57c,_0x4bd43f[_0x3f22('0x19')][_0x3f22('0x1a')]);return _0x19b9de(_0x4bd43f[_0x3f22('0x19')][_0x3f22('0x1a')]);}else{logger[_0x3f22('0x15')](_0x3f22('0x16'),_0x7cb57c,_0x3f22('0x17'));_0x19b9de(_0x4bd43f['result'][_0x3f22('0x1a')]);}})['catch'](function(_0x5e4804){logger[_0x3f22('0x19')](_0x3f22('0x16'),_0x7cb57c,_0x5e4804);_0xe39e27(_0x5e4804);});});}function respondWithResult(_0x584533,_0x4f8348){_0x4f8348=_0x4f8348||0xc8;return function(_0x98461d){if(_0x98461d){return _0x584533[_0x3f22('0x1b')](_0x4f8348)['json'](_0x98461d);}};}function respondWithFilteredResult(_0x1476ad,_0x2dae58){return function(_0x1f165e){if(_0x1f165e){var _0x5d39fd=typeof _0x2dae58[_0x3f22('0x1c')]===_0x3f22('0x1d')&&typeof _0x2dae58[_0x3f22('0x1e')]===_0x3f22('0x1d');var _0x3c7c88=_0x1f165e[_0x3f22('0x1f')];var _0x379071=_0x5d39fd?0x0:_0x2dae58[_0x3f22('0x1c')];var _0x567bb1=_0x5d39fd?_0x1f165e[_0x3f22('0x1f')]:_0x2dae58[_0x3f22('0x1c')]+_0x2dae58[_0x3f22('0x1e')];var _0x498985;if(_0x567bb1>=_0x3c7c88){_0x567bb1=_0x3c7c88;_0x498985=0xc8;}else{_0x498985=0xce;}_0x1476ad['status'](_0x498985);return _0x1476ad['set'](_0x3f22('0x20'),_0x379071+'-'+_0x567bb1+'/'+_0x3c7c88)[_0x3f22('0x21')](_0x1f165e);}return null;};}function saveUpdates(_0x526032){return function(_0x194852){if(_0x194852){return _0x194852[_0x3f22('0x22')](_0x526032)[_0x3f22('0x14')](function(_0x4df068){return _0x4df068;});}return null;};}function removeEntity(_0x147089){return function(_0x5bf0ef){if(_0x5bf0ef){return _0x5bf0ef[_0x3f22('0x23')]()['then'](function(){_0x147089['status'](0xcc)[_0x3f22('0x24')]();});}};}function handleEntityNotFound(_0x1167ca){return function(_0x4eee04){if(!_0x4eee04){_0x1167ca[_0x3f22('0x25')](0x194);}return _0x4eee04;};}function handleError(_0x23d0ba,_0x12a8da){_0x12a8da=_0x12a8da||0x1f4;return function(_0x2ae5cf){logger[_0x3f22('0x19')](_0x2ae5cf['stack']);if(_0x2ae5cf[_0x3f22('0x26')]){delete _0x2ae5cf[_0x3f22('0x26')];}_0x23d0ba[_0x3f22('0x1b')](_0x12a8da)[_0x3f22('0x27')](_0x2ae5cf);};}exports['index']=function(_0x57e096,_0x395215){var _0xf8a764={},_0x2e129a={},_0x124c61={'count':0x0,'rows':[]};var _0xa22375=_['map'](db[_0x3f22('0x28')]['rawAttributes'],function(_0x2b9de4){return{'name':_0x2b9de4[_0x3f22('0x29')],'type':_0x2b9de4['type']['key']};});_0x2e129a[_0x3f22('0x2a')]=_[_0x3f22('0x2b')](_0xa22375,_0x3f22('0x26'));_0x2e129a[_0x3f22('0x2c')]=_[_0x3f22('0x2d')](_0x57e096[_0x3f22('0x2c')]);_0x2e129a[_0x3f22('0x2e')]=_[_0x3f22('0x2f')](_0x2e129a['model'],_0x2e129a[_0x3f22('0x2c')]);_0xf8a764[_0x3f22('0x30')]=_[_0x3f22('0x2f')](_0x2e129a[_0x3f22('0x2a')],qs[_0x3f22('0x31')](_0x57e096[_0x3f22('0x2c')][_0x3f22('0x31')]));_0xf8a764[_0x3f22('0x30')]=_0xf8a764[_0x3f22('0x30')][_0x3f22('0x32')]?_0xf8a764[_0x3f22('0x30')]:_0x2e129a[_0x3f22('0x2a')];if(!_0x57e096[_0x3f22('0x2c')][_0x3f22('0x33')](_0x3f22('0x34'))){_0xf8a764[_0x3f22('0x1e')]=qs[_0x3f22('0x1e')](_0x57e096[_0x3f22('0x2c')][_0x3f22('0x1e')]);_0xf8a764[_0x3f22('0x1c')]=qs['offset'](_0x57e096[_0x3f22('0x2c')][_0x3f22('0x1c')]);}_0xf8a764[_0x3f22('0x35')]=qs[_0x3f22('0x36')](_0x57e096[_0x3f22('0x2c')]['sort']);_0xf8a764[_0x3f22('0x37')]=qs['filters'](_[_0x3f22('0x38')](_0x57e096[_0x3f22('0x2c')],_0x2e129a['filters']),_0xa22375);if(_0x57e096['query'][_0x3f22('0x39')]){_0xf8a764['where']=_['merge'](_0xf8a764['where'],{'$or':_['map'](_0xa22375,function(_0x55a161){if(_0x55a161[_0x3f22('0x3a')]!==_0x3f22('0x3b')){var _0x12302d={};_0x12302d[_0x55a161[_0x3f22('0x26')]]={'$like':'%'+_0x57e096[_0x3f22('0x2c')]['filter']+'%'};return _0x12302d;}})});}_0xf8a764=_['merge']({},_0xf8a764,_0x57e096[_0x3f22('0x3c')]);var _0x231e93={'where':_0xf8a764[_0x3f22('0x37')]};return db[_0x3f22('0x28')][_0x3f22('0x1f')](_0x231e93)[_0x3f22('0x14')](function(_0x3bedba){_0x124c61[_0x3f22('0x1f')]=_0x3bedba;if(_0x57e096[_0x3f22('0x2c')][_0x3f22('0x3d')]){_0xf8a764[_0x3f22('0x3e')]=[{'all':!![]}];}return db['MailMessage'][_0x3f22('0x3f')](_0xf8a764);})['then'](function(_0x2c7b9d){_0x124c61[_0x3f22('0x40')]=_0x2c7b9d;return _0x124c61;})['then'](respondWithFilteredResult(_0x395215,_0xf8a764))['catch'](handleError(_0x395215,null));};exports[_0x3f22('0x41')]=function(_0x5b6050,_0x24efd4){var _0x5bb1de={'raw':!![],'where':{'id':_0x5b6050[_0x3f22('0x42')]['id']}},_0x31f848={};_0x31f848[_0x3f22('0x2a')]=_[_0x3f22('0x2d')](db[_0x3f22('0x28')]['rawAttributes']);_0x31f848[_0x3f22('0x2c')]=_[_0x3f22('0x2d')](_0x5b6050[_0x3f22('0x2c')]);_0x31f848['filters']=_[_0x3f22('0x2f')](_0x31f848[_0x3f22('0x2a')],_0x31f848[_0x3f22('0x2c')]);_0x5bb1de[_0x3f22('0x30')]=_['intersection'](_0x31f848['model'],qs['fields'](_0x5b6050[_0x3f22('0x2c')][_0x3f22('0x31')]));_0x5bb1de[_0x3f22('0x30')]=_0x5bb1de[_0x3f22('0x30')]['length']?_0x5bb1de[_0x3f22('0x30')]:_0x31f848[_0x3f22('0x2a')];if(_0x5b6050[_0x3f22('0x2c')][_0x3f22('0x3d')]){_0x5bb1de[_0x3f22('0x3e')]=[{'all':!![]}];}_0x5bb1de=_['merge']({},_0x5bb1de,_0x5b6050['options']);return db[_0x3f22('0x28')][_0x3f22('0x43')](_0x5bb1de)[_0x3f22('0x14')](handleEntityNotFound(_0x24efd4,null))['then'](respondWithResult(_0x24efd4,null))[_0x3f22('0x44')](handleError(_0x24efd4,null));};exports['update']=function(_0x58d0e3,_0x29464c){if(_0x58d0e3[_0x3f22('0x45')]['id']){delete _0x58d0e3[_0x3f22('0x45')]['id'];}return db['MailMessage'][_0x3f22('0x43')]({'where':{'id':_0x58d0e3[_0x3f22('0x42')]['id']}})['then'](handleEntityNotFound(_0x29464c,null))['then'](saveUpdates(_0x58d0e3[_0x3f22('0x45')],null))[_0x3f22('0x14')](respondWithResult(_0x29464c,null))[_0x3f22('0x44')](handleError(_0x29464c,null));};exports[_0x3f22('0x23')]=function(_0x2a9605,_0x5e92a1){return db[_0x3f22('0x28')][_0x3f22('0x43')]({'where':{'id':_0x2a9605[_0x3f22('0x42')]['id']}})[_0x3f22('0x14')](handleEntityNotFound(_0x5e92a1,null))[_0x3f22('0x14')](removeEntity(_0x5e92a1,null))['catch'](handleError(_0x5e92a1,null));};exports[_0x3f22('0x46')]=function(_0x4c2813,_0x2bf078){return db['MailMessage'][_0x3f22('0x46')]()[_0x3f22('0x14')](respondWithResult(_0x2bf078,null))[_0x3f22('0x44')](handleError(_0x2bf078,null));};exports[_0x3f22('0x47')]=function(_0x415e9e,_0x5c2807){return db['MailMessage'][_0x3f22('0x47')](_0x415e9e[_0x3f22('0x45')])[_0x3f22('0x14')](function(_0x3ac931){if(_0x3ac931){if(_0x3ac931['direction']===_0x3f22('0x48')&&!_0x3ac931[_0x3f22('0x49')]){var _0x4ebc95,_0x13a7ea,_0x280a06;if(_0x415e9e[_0x3f22('0x45')]['to']){_0x13a7ea=_0x415e9e[_0x3f22('0x45')]['to']['split'](',')[0x0];}return db[_0x3f22('0x4a')][_0x3f22('0x4b')]({'where':{'id':_0x3ac931[_0x3f22('0x4c')]},'include':[{'model':db[_0x3f22('0x4d')],'as':_0x3f22('0x4e'),'include':[{'model':db['CmContact'],'as':_0x3f22('0x4f'),'where':{'email':_0x13a7ea},'limit':0x1,'order':[[_0x3f22('0x50'),_0x3f22('0x51')]]}]},{'model':db[_0x3f22('0x52')],'as':'Smtp','raw':!![]}]})[_0x3f22('0x14')](function(_0xef1bea){_0x4ebc95=_0xef1bea;if(_0x4ebc95&&_0x4ebc95[_0x3f22('0x53')]){var _0xfa414c={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x54')])){_0xfa414c['host']=_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x55')];_0xfa414c[_0x3f22('0x56')]=_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x56')];_0xfa414c['secure']=_0x4ebc95['Smtp'][_0x3f22('0x57')];if(_0x4ebc95['Smtp'][_0x3f22('0x58')]){_0xfa414c[_0x3f22('0x59')]={'user':_0x4ebc95['Smtp'][_0x3f22('0x5a')],'pass':_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x5b')]};}}else{_0xfa414c[_0x3f22('0x54')]=_0x4ebc95['Smtp']['service'];_0xfa414c[_0x3f22('0x59')]={'user':_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x5a')],'pass':_0x4ebc95[_0x3f22('0x53')][_0x3f22('0x5b')]};_0xfa414c[_0x3f22('0x57')]=_0x4ebc95[_0x3f22('0x53')]['secure'];}if(_0x415e9e[_0x3f22('0x45')][_0x3f22('0x5c')]&&_0x415e9e['body']['attachments'][_0x3f22('0x32')]){for(var _0x53e682=0x0;_0x53e682<_0x415e9e[_0x3f22('0x45')][_0x3f22('0x5c')][_0x3f22('0x32')];_0x53e682+=0x1){_0x415e9e[_0x3f22('0x45')][_0x3f22('0x5c')][_0x53e682]={'filename':_0x415e9e[_0x3f22('0x45')][_0x3f22('0x5c')][_0x53e682]['name'],'path':path[_0x3f22('0x5d')](config['root'],_0x3f22('0x5e'),_0x415e9e['body'][_0x3f22('0x5c')][_0x53e682]['basename'])};}}_0x280a06={'account':_0xfa414c,'message':_0x415e9e['body']};return;}})['then'](function(){if(_0x4ebc95['List']){if(_0x4ebc95[_0x3f22('0x4e')][_0x3f22('0x4f')][_0x3f22('0x32')]){return _0x4ebc95[_0x3f22('0x4e')][_0x3f22('0x4f')][0x0];}else{return db[_0x3f22('0x5f')][_0x3f22('0x47')](_[_0x3f22('0xc')](_0x415e9e[_0x3f22('0x45')],{'firstName':_0x415e9e[_0x3f22('0x45')]['to'],'email':_0x415e9e['body']['to'],'phone':_0x415e9e[_0x3f22('0x45')]['to'],'ListId':_0x4ebc95[_0x3f22('0x60')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x3f22('0x14')](function(){if(_0x280a06){return respondWithRpcPromise(_0x3f22('0x61'),_0x3f22('0x62'),_0x280a06,client9003)[_0x3f22('0x14')](function(_0x12a3c0){return _0x3ac931[_0x3f22('0x22')]({'read':!![],'messageId':_0x12a3c0[_0x3f22('0x63')],'sentAt':moment()[_0x3f22('0x64')](_0x3f22('0x65'))});})[_0x3f22('0x44')](function(_0x43f495){logger[_0x3f22('0x19')]('%s',JSON[_0x3f22('0x18')](_0x43f495));return _0x3ac931;});}return _0x3ac931;});}return _0x3ac931;}})[_0x3f22('0x14')](respondWithResult(_0x5c2807,0xc9))[_0x3f22('0x44')](handleError(_0x5c2807,null));};exports[_0x3f22('0x66')]=function(_0x2c5772,_0x211f99){var _0x1a4495={'agent':{},'channel':_0x3f22('0x67')};if(_0x2c5772[_0x3f22('0x45')]['id']){delete _0x2c5772[_0x3f22('0x45')]['id'];}_0x2c5772[_0x3f22('0x45')][_0x3f22('0x68')]=!![];_0x2c5772[_0x3f22('0x45')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c5772[_0x3f22('0x45')][_0x3f22('0x69')]=_0x2c5772['body'][_0x3f22('0x69')]||_0x2c5772['user']['id'];_0x1a4495[_0x3f22('0x6a')]['id']=_0x2c5772[_0x3f22('0x45')][_0x3f22('0x69')];return db[_0x3f22('0x28')][_0x3f22('0x43')]({'where':{'id':_0x2c5772['params']['id'],'UserId':null}})[_0x3f22('0x14')](handleEntityNotFound(_0x211f99,null))['then'](saveUpdates(_0x2c5772['body'],null))[_0x3f22('0x14')](function(_0x3c8ccf){if(_0x3c8ccf){_0x1a4495[_0x3f22('0x1a')]=_0x3c8ccf[_0x3f22('0x6b')]({'plain':!![]});return db[_0x3f22('0x6c')]['find']({'where':{'id':_0x3c8ccf[_0x3f22('0x6d')]}});}return null;})[_0x3f22('0x14')](handleEntityNotFound(_0x211f99,null))[_0x3f22('0x14')](function(_0x5935ab){if(_0x5935ab){return _0x5935ab[_0x3f22('0x22')]({'UserId':_0x2c5772[_0x3f22('0x45')]['UserId'],'read1stAt':_[_0x3f22('0x6e')](_0x5935ab[_0x3f22('0x6f')])?moment()[_0x3f22('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3f22('0x14')](function(_0x3e24c9){if(_0x3e24c9){_0x1a4495['interaction']=_0x3e24c9['get']({'plain':!![]});interaction_log[_0x3f22('0x15')](_0x3f22('0x70'),_0x2c5772[_0x3f22('0x5a')]['id'],_0x2c5772[_0x3f22('0x5a')]['name'],_0x2c5772[_0x3f22('0x5a')][_0x3f22('0x71')],_0x1a4495[_0x3f22('0x72')]['id'],_0x2c5772[_0x3f22('0x45')]?JSON['stringify'](_0x2c5772['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x3f22('0x73'),_0x1a4495);}return null;})[_0x3f22('0x14')](function(_0x537be3){var _0x30acc2=_0x3f22('0x74')+_0x537be3['message'][_0x3f22('0x75')];return db[_0x3f22('0x76')][_0x3f22('0x2c')](_0x30acc2,{'type':db[_0x3f22('0x77')]['QueryTypes'][_0x3f22('0x78')],'raw':!![]})[_0x3f22('0x14')](function(_0x53753d){return _0x53753d;});})[_0x3f22('0x14')](function(_0x3c9c32){if(_0x3c9c32){_0x1a4495['message'][_0x3f22('0x79')]=_0x3c9c32[0x0];if(!_0x2c5772[_0x3f22('0x45')]['UserId'])return;return db[_0x3f22('0x7a')][_0x3f22('0x43')]({'where':{'id':_0x2c5772[_0x3f22('0x45')]['UserId'],'role':_0x3f22('0x6a')},'attributes':['id',_0x3f22('0x26'),'fullname',_0x3f22('0x7b'),_0x3f22('0x7c')],'raw':!![]});}return null;})[_0x3f22('0x14')](function(_0x19ba42){if(!_0x19ba42)return null;_0x1a4495['message']['agent']=_0x19ba42;return _0x1a4495;})[_0x3f22('0x14')](function(_0x163328){if(_0x163328){if(_0x2c5772[_0x3f22('0x45')]['manual']){_0x1a4495[_0x3f22('0x1a')][_0x3f22('0x7d')]=util[_0x3f22('0x64')]('SIP/%s',_0x2c5772['user'][_0x3f22('0x26')]);_0x1a4495[_0x3f22('0x1a')][_0x3f22('0x7e')]=_0x1a4495[_0x3f22('0x7e')];_0x1a4495['message']['motionChannel']=_0x1a4495[_0x3f22('0x7e')];_0x1a4495['message'][_0x3f22('0x7f')]=_0x3f22('0x66');_0x1a4495[_0x3f22('0x1a')]['body']=htmlToText[_0x3f22('0x80')](_0x1a4495[_0x3f22('0x1a')][_0x3f22('0x45')]);return respondWithRpcPromise(_0x3f22('0x81'),'EventManager',{'event':_0x3f22('0x82'),'message':_0x1a4495[_0x3f22('0x1a')]},client9002)[_0x3f22('0x14')](function(){return _0x1a4495;});}return _0x1a4495;}return null;})[_0x3f22('0x14')](respondWithResult(_0x211f99,null))[_0x3f22('0x44')](handleError(_0x211f99,null));};exports[_0x3f22('0x83')]=function(_0x5b0389,_0x5d2ec4){var _0x4ac8fd={'agent':{},'channel':_0x3f22('0x67')};if(_0x5b0389[_0x3f22('0x45')]['id']){delete _0x5b0389[_0x3f22('0x45')]['id'];}_0x5b0389[_0x3f22('0x45')][_0x3f22('0x69')]=_0x5b0389[_0x3f22('0x45')][_0x3f22('0x69')]||_0x5b0389[_0x3f22('0x5a')]['id'];_0x4ac8fd[_0x3f22('0x6a')]['id']=_0x5b0389[_0x3f22('0x45')][_0x3f22('0x69')];return db[_0x3f22('0x28')]['find']({'where':{'id':_0x5b0389[_0x3f22('0x42')]['id'],'UserId':null}})[_0x3f22('0x14')](handleEntityNotFound(_0x5d2ec4,null))[_0x3f22('0x14')](function(_0x592b19){if(_0x592b19){_0x4ac8fd[_0x3f22('0x1a')]=_0x592b19[_0x3f22('0x6b')]({'plain':!![]});return db[_0x3f22('0x6c')]['find']({'where':{'id':_0x592b19['MailInteractionId']}});}return null;})[_0x3f22('0x14')](handleEntityNotFound(_0x5d2ec4,null))['then'](function(_0x3826af){if(_0x3826af){_0x4ac8fd[_0x3f22('0x72')]=_0x3826af[_0x3f22('0x6b')]({'plain':!![]});interaction_log[_0x3f22('0x15')](_0x3f22('0x84'),_0x5b0389[_0x3f22('0x5a')]['id'],_0x5b0389['user'][_0x3f22('0x26')],_0x5b0389[_0x3f22('0x5a')][_0x3f22('0x71')],_0x4ac8fd['interaction']['id'],_0x5b0389[_0x3f22('0x45')]?JSON[_0x3f22('0x18')](_0x5b0389[_0x3f22('0x45')]):'null');return respondWithRpcPromise(_0x3f22('0x85'),_0x3f22('0x86'),_0x4ac8fd);}return null;})['then'](function(_0x473d5d){var _0x38fa10=_0x3f22('0x74')+_0x473d5d['message'][_0x3f22('0x75')];return db['sequelize'][_0x3f22('0x2c')](_0x38fa10,{'type':db[_0x3f22('0x77')]['QueryTypes'][_0x3f22('0x78')],'raw':!![]})[_0x3f22('0x14')](function(_0x4b3bc4){return _0x4b3bc4;});})[_0x3f22('0x14')](function(_0x2329e7){if(_0x2329e7){_0x4ac8fd[_0x3f22('0x1a')][_0x3f22('0x79')]=_0x2329e7[0x0];if(!_0x5b0389['body'][_0x3f22('0x69')])return;return db[_0x3f22('0x7a')][_0x3f22('0x43')]({'where':{'id':_0x5b0389['body'][_0x3f22('0x69')],'role':_0x3f22('0x6a')},'attributes':['id',_0x3f22('0x26'),_0x3f22('0x87'),_0x3f22('0x7b'),_0x3f22('0x7c')],'raw':!![]});}return null;})[_0x3f22('0x14')](function(_0x45b9d6){if(!_0x45b9d6)return null;_0x4ac8fd[_0x3f22('0x1a')][_0x3f22('0x6a')]=_0x45b9d6;return _0x4ac8fd;})['then'](function(_0x4e1a31){if(_0x4e1a31){_0x4e1a31[_0x3f22('0x1a')][_0x3f22('0x7d')]=util[_0x3f22('0x64')](_0x3f22('0x88'),_0x5b0389[_0x3f22('0x5a')][_0x3f22('0x26')]);_0x4e1a31[_0x3f22('0x1a')][_0x3f22('0x7e')]=_0x4ac8fd['channel'];_0x4e1a31[_0x3f22('0x1a')][_0x3f22('0x89')]=_0x4ac8fd[_0x3f22('0x7e')];_0x4e1a31['message'][_0x3f22('0x7f')]=_0x3f22('0x83');_0x4e1a31[_0x3f22('0x1a')][_0x3f22('0x45')]=htmlToText[_0x3f22('0x80')](_0x4ac8fd[_0x3f22('0x1a')]['body']);respondWithRpcPromise(_0x3f22('0x81'),_0x3f22('0x81'),{'event':'rejectmessage','message':_0x4e1a31[_0x3f22('0x1a')]},client9002);return _0x4ac8fd;}return null;})[_0x3f22('0x14')](respondWithResult(_0x5d2ec4,null))[_0x3f22('0x44')](handleError(_0x5d2ec4,null));};exports[_0x3f22('0x8a')]=function(_0x5da9ec,_0x444edb){var _0x5eaef8=moment()[_0x3f22('0x8b')]()[_0x3f22('0x8c')]();var _0x41bfdb=path[_0x3f22('0x5d')](config['root'],'server',_0x3f22('0x8d'),_0x3f22('0x8e'));var _0x4812d3=path[_0x3f22('0x5d')](config['root'],_0x3f22('0x8f'),_0x3f22('0x8d'),_0x3f22('0x5c'));var _0x12fb03=util[_0x3f22('0x64')](_0x3f22('0x90'),_0x5eaef8);return db[_0x3f22('0x28')]['find']({'where':{'id':_0x5da9ec[_0x3f22('0x42')]['id']},'attributes':['id',_0x3f22('0x45'),'from','to','cc',_0x3f22('0x91'),'subject',_0x3f22('0x92')],'include':_0x5da9ec[_0x3f22('0x2c')][_0x3f22('0x5c')]?[{'model':db['Attachment'],'as':_0x3f22('0x93')}]:undefined})[_0x3f22('0x14')](handleEntityNotFound(_0x444edb,null))[_0x3f22('0x14')](function(_0x110b21){if(_0x110b21){var _0x1c61ea=_0x110b21;var _0x161935={'from':_0x1c61ea[_0x3f22('0x94')],'to':_0x1c61ea['to'],'subject':_0x1c61ea['subject'],'html':htmlEntities['decode'](_0x1c61ea[_0x3f22('0x45')]),'headers':{'Date':moment(_0x1c61ea['createdAt'])[_0x3f22('0x64')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x110b21['cc']){_0x161935[_0x3f22('0x95')]['Cc']=_0x110b21['cc'];}if(_0x110b21[_0x3f22('0x91')]){_0x161935[_0x3f22('0x95')][_0x3f22('0x96')]=_0x110b21[_0x3f22('0x91')];}return new BPromise(function(_0x512f20,_0x1dd31a){if(_0x110b21[_0x3f22('0x93')]){for(var _0x440094=0x0;_0x440094<_0x110b21['Attachments']['length'];_0x440094++){var _0x440e7c=_0x110b21['Attachments'][_0x440094];var _0x77e13c=path[_0x3f22('0x5d')](_0x4812d3,_0x440e7c[_0x3f22('0x97')]);if(fs[_0x3f22('0x98')](_0x77e13c)){_0x161935[_0x3f22('0x5c')][_0x3f22('0x99')]({'name':_0x440e7c[_0x3f22('0x26')],'contentType':_0x440e7c[_0x3f22('0x3a')],'data':fs[_0x3f22('0x9a')](_0x77e13c)});}}}emlformat[_0x3f22('0x9b')](_0x161935,function(_0x229ce0,_0x4d0a3c){if(_0x229ce0)return _0x1dd31a(_0x229ce0);fs[_0x3f22('0x9c')](path['join'](_0x41bfdb,_0x12fb03),_0x4d0a3c);return _0x512f20(_0x4d0a3c);});});}})[_0x3f22('0x14')](function(_0x5e6184){if(_0x5e6184){return _0x444edb[_0x3f22('0x8a')](path[_0x3f22('0x5d')](_0x41bfdb,_0x12fb03),_0x12fb03,function(_0x3a278d){if(!_0x3a278d)fs['unlinkSync'](path['join'](_0x41bfdb,_0x12fb03));});}})[_0x3f22('0x44')](handleError(_0x444edb,null));}; \ No newline at end of file +var _0x8d8b=['moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','json','undefined','limit','count','offset','status','set','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','MailMessage','findAll','rows','params','keys','includeAll','find','body','describe','create','direction','secret','split','MailAccount','findOne','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','pass','attachments','join','server/files/attachments','basename','List','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','user','agent','UserId','get','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','MailInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','rejectmessage','unix','toString','root','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x8d8b,0xa7));var _0xb8d8=function(_0x6d487d,_0xdc38d2){_0x6d487d=_0x6d487d-0x0;var _0x4d1752=_0x8d8b[_0x6d487d];return _0x4d1752;};'use strict';var emlformat=require('eml-format');var moment=require(_0xb8d8('0x0'));var BPromise=require(_0xb8d8('0x1'));var util=require(_0xb8d8('0x2'));var path=require(_0xb8d8('0x3'));var fs=require('fs');var _=require(_0xb8d8('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xb8d8('0x5'));var qs=require(_0xb8d8('0x6'));var logger=require('../../config/logger')(_0xb8d8('0x7'));var interaction_log=require(_0xb8d8('0x8'))(_0xb8d8('0x9'));var config=require(_0xb8d8('0xa'));var db=require('../../mysqldb')['db'];config[_0xb8d8('0xb')]=_[_0xb8d8('0xc')](config[_0xb8d8('0xb')],{'host':_0xb8d8('0xd'),'port':0x18eb});var socket=require(_0xb8d8('0xe'))(new Redis(config[_0xb8d8('0xb')]));var htmlEntities=require(_0xb8d8('0xf'));require(_0xb8d8('0x10'))[_0xb8d8('0x11')](socket);var jayson=require(_0xb8d8('0x12'));var client=jayson[_0xb8d8('0x13')]['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0xb8d8('0x13')][_0xb8d8('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x3d97fe,_0x157647,_0x3ba02e,_0x4909a5){return new BPromise(function(_0x1a804b,_0x41e8b0){var _0x3b30a6=_0x4909a5||client;return _0x3b30a6[_0xb8d8('0x15')](_0x3d97fe,_0x3ba02e)[_0xb8d8('0x16')](function(_0x1f04b1){logger[_0xb8d8('0x17')]('MailMessage,\x20%s,\x20%s',_0x157647,_0xb8d8('0x18'));logger[_0xb8d8('0x19')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x157647,'request\x20sent',JSON[_0xb8d8('0x1a')](_0x1f04b1));if(_0x1f04b1[_0xb8d8('0x1b')]){if(_0x1f04b1[_0xb8d8('0x1b')][_0xb8d8('0x1c')]===0x1f4){logger[_0xb8d8('0x1b')](_0xb8d8('0x1d'),_0x157647,_0x1f04b1['error'][_0xb8d8('0x1e')]);return _0x41e8b0(_0x1f04b1[_0xb8d8('0x1b')][_0xb8d8('0x1e')]);}logger[_0xb8d8('0x1b')]('MailMessage,\x20%s,\x20%s',_0x157647,_0x1f04b1['error'][_0xb8d8('0x1e')]);return _0x1a804b(_0x1f04b1[_0xb8d8('0x1b')][_0xb8d8('0x1e')]);}else{logger[_0xb8d8('0x17')](_0xb8d8('0x1d'),_0x157647,_0xb8d8('0x18'));_0x1a804b(_0x1f04b1[_0xb8d8('0x1f')][_0xb8d8('0x1e')]);}})[_0xb8d8('0x20')](function(_0x57d370){logger['error'](_0xb8d8('0x1d'),_0x157647,_0x57d370);_0x41e8b0(_0x57d370);});});}function respondWithResult(_0x404232,_0x1c3dd6){_0x1c3dd6=_0x1c3dd6||0xc8;return function(_0x46c17e){if(_0x46c17e){return _0x404232['status'](_0x1c3dd6)[_0xb8d8('0x21')](_0x46c17e);}};}function respondWithFilteredResult(_0x5bcba0,_0x14934d){return function(_0x437768){if(_0x437768){var _0x20006c=typeof _0x14934d['offset']===_0xb8d8('0x22')&&typeof _0x14934d[_0xb8d8('0x23')]==='undefined';var _0x19e80c=_0x437768[_0xb8d8('0x24')];var _0x3a8006=_0x20006c?0x0:_0x14934d[_0xb8d8('0x25')];var _0x50293b=_0x20006c?_0x437768['count']:_0x14934d[_0xb8d8('0x25')]+_0x14934d[_0xb8d8('0x23')];var _0x8abe1f;if(_0x50293b>=_0x19e80c){_0x50293b=_0x19e80c;_0x8abe1f=0xc8;}else{_0x8abe1f=0xce;}_0x5bcba0[_0xb8d8('0x26')](_0x8abe1f);return _0x5bcba0[_0xb8d8('0x27')]('Content-Range',_0x3a8006+'-'+_0x50293b+'/'+_0x19e80c)[_0xb8d8('0x21')](_0x437768);}return null;};}function saveUpdates(_0x1e6aa7){return function(_0x113cfa){if(_0x113cfa){return _0x113cfa[_0xb8d8('0x28')](_0x1e6aa7)['then'](function(_0x5d6929){return _0x5d6929;});}return null;};}function removeEntity(_0x1faf8f){return function(_0x418867){if(_0x418867){return _0x418867[_0xb8d8('0x29')]()[_0xb8d8('0x16')](function(){_0x1faf8f[_0xb8d8('0x26')](0xcc)[_0xb8d8('0x2a')]();});}};}function handleEntityNotFound(_0x7bea3f){return function(_0x3abbdf){if(!_0x3abbdf){_0x7bea3f[_0xb8d8('0x2b')](0x194);}return _0x3abbdf;};}function handleError(_0x2bb42b,_0x1beada){_0x1beada=_0x1beada||0x1f4;return function(_0x11fd96){logger[_0xb8d8('0x1b')](_0x11fd96[_0xb8d8('0x2c')]);if(_0x11fd96[_0xb8d8('0x2d')]){delete _0x11fd96[_0xb8d8('0x2d')];}_0x2bb42b['status'](_0x1beada)[_0xb8d8('0x2e')](_0x11fd96);};}exports[_0xb8d8('0x2f')]=function(_0x239ff5,_0x214d0c){var _0x331c69={},_0x23ad10={},_0x48bced={'count':0x0,'rows':[]};var _0x1836a=_[_0xb8d8('0x30')](db['MailMessage'][_0xb8d8('0x31')],function(_0x39d7a1){return{'name':_0x39d7a1['fieldName'],'type':_0x39d7a1[_0xb8d8('0x32')][_0xb8d8('0x33')]};});_0x23ad10[_0xb8d8('0x34')]=_[_0xb8d8('0x30')](_0x1836a,_0xb8d8('0x2d'));_0x23ad10[_0xb8d8('0x35')]=_['keys'](_0x239ff5[_0xb8d8('0x35')]);_0x23ad10[_0xb8d8('0x36')]=_[_0xb8d8('0x37')](_0x23ad10['model'],_0x23ad10[_0xb8d8('0x35')]);_0x331c69[_0xb8d8('0x38')]=_[_0xb8d8('0x37')](_0x23ad10[_0xb8d8('0x34')],qs['fields'](_0x239ff5['query'][_0xb8d8('0x39')]));_0x331c69[_0xb8d8('0x38')]=_0x331c69[_0xb8d8('0x38')][_0xb8d8('0x3a')]?_0x331c69[_0xb8d8('0x38')]:_0x23ad10[_0xb8d8('0x34')];if(!_0x239ff5['query'][_0xb8d8('0x3b')](_0xb8d8('0x3c'))){_0x331c69[_0xb8d8('0x23')]=qs[_0xb8d8('0x23')](_0x239ff5[_0xb8d8('0x35')][_0xb8d8('0x23')]);_0x331c69[_0xb8d8('0x25')]=qs[_0xb8d8('0x25')](_0x239ff5[_0xb8d8('0x35')]['offset']);}_0x331c69[_0xb8d8('0x3d')]=qs['sort'](_0x239ff5[_0xb8d8('0x35')][_0xb8d8('0x3e')]);_0x331c69[_0xb8d8('0x3f')]=qs[_0xb8d8('0x36')](_[_0xb8d8('0x40')](_0x239ff5[_0xb8d8('0x35')],_0x23ad10['filters']),_0x1836a);if(_0x239ff5[_0xb8d8('0x35')][_0xb8d8('0x41')]){_0x331c69['where']=_['merge'](_0x331c69[_0xb8d8('0x3f')],{'$or':_[_0xb8d8('0x30')](_0x1836a,function(_0x38e132){if(_0x38e132['type']!==_0xb8d8('0x42')){var _0x1b0aa8={};_0x1b0aa8[_0x38e132[_0xb8d8('0x2d')]]={'$like':'%'+_0x239ff5['query'][_0xb8d8('0x41')]+'%'};return _0x1b0aa8;}})});}_0x331c69=_[_0xb8d8('0x43')]({},_0x331c69,_0x239ff5[_0xb8d8('0x44')]);var _0x1d4707={'where':_0x331c69[_0xb8d8('0x3f')]};return db['MailMessage'][_0xb8d8('0x24')](_0x1d4707)['then'](function(_0x4f8102){_0x48bced['count']=_0x4f8102;if(_0x239ff5[_0xb8d8('0x35')]['includeAll']){_0x331c69[_0xb8d8('0x45')]=[{'all':!![]}];}return db[_0xb8d8('0x46')][_0xb8d8('0x47')](_0x331c69);})['then'](function(_0x4a4794){_0x48bced[_0xb8d8('0x48')]=_0x4a4794;return _0x48bced;})['then'](respondWithFilteredResult(_0x214d0c,_0x331c69))[_0xb8d8('0x20')](handleError(_0x214d0c,null));};exports['show']=function(_0x5cb12a,_0x3bbafe){var _0x5a342a={'raw':!![],'where':{'id':_0x5cb12a[_0xb8d8('0x49')]['id']}},_0x167b35={};_0x167b35[_0xb8d8('0x34')]=_[_0xb8d8('0x4a')](db[_0xb8d8('0x46')][_0xb8d8('0x31')]);_0x167b35[_0xb8d8('0x35')]=_[_0xb8d8('0x4a')](_0x5cb12a[_0xb8d8('0x35')]);_0x167b35[_0xb8d8('0x36')]=_['intersection'](_0x167b35[_0xb8d8('0x34')],_0x167b35[_0xb8d8('0x35')]);_0x5a342a[_0xb8d8('0x38')]=_[_0xb8d8('0x37')](_0x167b35[_0xb8d8('0x34')],qs[_0xb8d8('0x39')](_0x5cb12a[_0xb8d8('0x35')][_0xb8d8('0x39')]));_0x5a342a[_0xb8d8('0x38')]=_0x5a342a[_0xb8d8('0x38')][_0xb8d8('0x3a')]?_0x5a342a[_0xb8d8('0x38')]:_0x167b35[_0xb8d8('0x34')];if(_0x5cb12a[_0xb8d8('0x35')][_0xb8d8('0x4b')]){_0x5a342a[_0xb8d8('0x45')]=[{'all':!![]}];}_0x5a342a=_['merge']({},_0x5a342a,_0x5cb12a[_0xb8d8('0x44')]);return db[_0xb8d8('0x46')][_0xb8d8('0x4c')](_0x5a342a)['then'](handleEntityNotFound(_0x3bbafe,null))[_0xb8d8('0x16')](respondWithResult(_0x3bbafe,null))['catch'](handleError(_0x3bbafe,null));};exports[_0xb8d8('0x28')]=function(_0x3bcb91,_0x4a4da1){if(_0x3bcb91['body']['id']){delete _0x3bcb91[_0xb8d8('0x4d')]['id'];}return db[_0xb8d8('0x46')][_0xb8d8('0x4c')]({'where':{'id':_0x3bcb91[_0xb8d8('0x49')]['id']}})[_0xb8d8('0x16')](handleEntityNotFound(_0x4a4da1,null))[_0xb8d8('0x16')](saveUpdates(_0x3bcb91[_0xb8d8('0x4d')],null))[_0xb8d8('0x16')](respondWithResult(_0x4a4da1,null))[_0xb8d8('0x20')](handleError(_0x4a4da1,null));};exports['destroy']=function(_0x400ace,_0x50feb8){return db['MailMessage']['find']({'where':{'id':_0x400ace[_0xb8d8('0x49')]['id']}})[_0xb8d8('0x16')](handleEntityNotFound(_0x50feb8,null))[_0xb8d8('0x16')](removeEntity(_0x50feb8,null))[_0xb8d8('0x20')](handleError(_0x50feb8,null));};exports[_0xb8d8('0x4e')]=function(_0x575450,_0x55cd25){return db[_0xb8d8('0x46')][_0xb8d8('0x4e')]()['then'](respondWithResult(_0x55cd25,null))[_0xb8d8('0x20')](handleError(_0x55cd25,null));};exports[_0xb8d8('0x4f')]=function(_0x2a1198,_0x787ea8){return db[_0xb8d8('0x46')][_0xb8d8('0x4f')](_0x2a1198[_0xb8d8('0x4d')])[_0xb8d8('0x16')](function(_0x44d874){if(_0x44d874){if(_0x44d874[_0xb8d8('0x50')]==='out'&&!_0x44d874[_0xb8d8('0x51')]){var _0x3b84a9,_0x4dcf63,_0x3340ea;if(_0x2a1198[_0xb8d8('0x4d')]['to']){_0x4dcf63=_0x2a1198['body']['to'][_0xb8d8('0x52')](',')[0x0];}return db[_0xb8d8('0x53')][_0xb8d8('0x54')]({'where':{'id':_0x44d874['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb8d8('0x55')],'as':_0xb8d8('0x56'),'where':{'email':_0x4dcf63},'limit':0x1,'order':[[_0xb8d8('0x57'),_0xb8d8('0x58')]]}]},{'model':db[_0xb8d8('0x59')],'as':_0xb8d8('0x5a'),'raw':!![]}]})[_0xb8d8('0x16')](function(_0x829a8f){_0x3b84a9=_0x829a8f;if(_0x3b84a9&&_0x3b84a9['Smtp']){var _0x217cb4={'tls':{'rejectUnauthorized':![]}};if(_[_0xb8d8('0x5b')](_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x5c')])){_0x217cb4[_0xb8d8('0x5d')]=_0x3b84a9[_0xb8d8('0x5a')]['host'];_0x217cb4['port']=_0x3b84a9['Smtp'][_0xb8d8('0x5e')];_0x217cb4[_0xb8d8('0x5f')]=_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x5f')];if(_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x60')]){_0x217cb4[_0xb8d8('0x61')]={'user':_0x3b84a9['Smtp']['user'],'pass':_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x62')]};}}else{_0x217cb4[_0xb8d8('0x5c')]=_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x5c')];_0x217cb4[_0xb8d8('0x61')]={'user':_0x3b84a9['Smtp']['user'],'pass':_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x62')]};_0x217cb4[_0xb8d8('0x5f')]=_0x3b84a9[_0xb8d8('0x5a')][_0xb8d8('0x5f')];}if(_0x2a1198[_0xb8d8('0x4d')][_0xb8d8('0x63')]&&_0x2a1198[_0xb8d8('0x4d')][_0xb8d8('0x63')][_0xb8d8('0x3a')]){for(var _0x591507=0x0;_0x591507<_0x2a1198['body']['attachments'][_0xb8d8('0x3a')];_0x591507+=0x1){_0x2a1198[_0xb8d8('0x4d')][_0xb8d8('0x63')][_0x591507]={'filename':_0x2a1198['body']['attachments'][_0x591507][_0xb8d8('0x2d')],'path':path[_0xb8d8('0x64')](config['root'],_0xb8d8('0x65'),_0x2a1198[_0xb8d8('0x4d')]['attachments'][_0x591507][_0xb8d8('0x66')])};}}_0x3340ea={'account':_0x217cb4,'message':_0x2a1198[_0xb8d8('0x4d')]};return;}})[_0xb8d8('0x16')](function(){if(_0x3b84a9['List']){if(_0x3b84a9[_0xb8d8('0x67')][_0xb8d8('0x56')]['length']){return _0x3b84a9[_0xb8d8('0x67')][_0xb8d8('0x56')][0x0];}else{return db[_0xb8d8('0x55')][_0xb8d8('0x4f')](_[_0xb8d8('0xc')](_0x2a1198[_0xb8d8('0x4d')],{'firstName':_0x2a1198[_0xb8d8('0x4d')]['to'],'email':_0x2a1198[_0xb8d8('0x4d')]['to'],'phone':_0x2a1198['body']['to'],'ListId':_0x3b84a9['ListId']}));}}else{throw new Error(_0xb8d8('0x68'));}})[_0xb8d8('0x16')](function(){if(_0x3340ea){return respondWithRpcPromise(_0xb8d8('0x69'),_0xb8d8('0x6a'),_0x3340ea,client9003)['then'](function(_0x32505f){return _0x44d874['update']({'read':!![],'messageId':_0x32505f[_0xb8d8('0x6b')],'sentAt':moment()['format'](_0xb8d8('0x6c'))});})[_0xb8d8('0x20')](function(_0x254ce4){logger[_0xb8d8('0x1b')]('%s',JSON[_0xb8d8('0x1a')](_0x254ce4));return _0x44d874;});}return _0x44d874;});}return _0x44d874;}})[_0xb8d8('0x16')](respondWithResult(_0x787ea8,0xc9))[_0xb8d8('0x20')](handleError(_0x787ea8,null));};exports[_0xb8d8('0x6d')]=function(_0xa3b089,_0x335381){var _0x260bdf={'agent':{},'channel':'mail'};if(_0xa3b089[_0xb8d8('0x4d')]['id']){delete _0xa3b089[_0xb8d8('0x4d')]['id'];}_0xa3b089[_0xb8d8('0x4d')]['read']=!![];_0xa3b089[_0xb8d8('0x4d')][_0xb8d8('0x6e')]=moment()['format'](_0xb8d8('0x6c'));_0xa3b089[_0xb8d8('0x4d')]['UserId']=_0xa3b089[_0xb8d8('0x4d')]['UserId']||_0xa3b089[_0xb8d8('0x6f')]['id'];_0x260bdf[_0xb8d8('0x70')]['id']=_0xa3b089[_0xb8d8('0x4d')][_0xb8d8('0x71')];return db[_0xb8d8('0x46')][_0xb8d8('0x4c')]({'where':{'id':_0xa3b089[_0xb8d8('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x335381,null))['then'](saveUpdates(_0xa3b089[_0xb8d8('0x4d')],null))[_0xb8d8('0x16')](function(_0x300e68){if(_0x300e68){_0x260bdf[_0xb8d8('0x1e')]=_0x300e68[_0xb8d8('0x72')]({'plain':!![]});return db['MailInteraction'][_0xb8d8('0x4c')]({'where':{'id':_0x300e68['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x335381,null))[_0xb8d8('0x16')](function(_0x2eabd0){if(_0x2eabd0){return _0x2eabd0[_0xb8d8('0x28')]({'UserId':_0xa3b089[_0xb8d8('0x4d')]['UserId'],'read1stAt':_[_0xb8d8('0x5b')](_0x2eabd0['read1stAt'])?moment()[_0xb8d8('0x73')](_0xb8d8('0x6c')):undefined});}return null;})[_0xb8d8('0x16')](function(_0x46c064){if(_0x46c064){_0x260bdf[_0xb8d8('0x74')]=_0x46c064[_0xb8d8('0x72')]({'plain':!![]});interaction_log[_0xb8d8('0x17')](_0xb8d8('0x75'),_0xa3b089['user']['id'],_0xa3b089[_0xb8d8('0x6f')][_0xb8d8('0x2d')],_0xa3b089[_0xb8d8('0x6f')][_0xb8d8('0x76')],_0x260bdf[_0xb8d8('0x74')]['id'],_0xa3b089['body']?JSON[_0xb8d8('0x1a')](_0xa3b089[_0xb8d8('0x4d')]):_0xb8d8('0x77'));return respondWithRpcPromise(_0xb8d8('0x78'),'acceptMessage',_0x260bdf);}return null;})[_0xb8d8('0x16')](function(_0xac0cc6){var _0x234d95='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xac0cc6[_0xb8d8('0x1e')]['ContactId'];return db[_0xb8d8('0x79')][_0xb8d8('0x35')](_0x234d95,{'type':db['Sequelize'][_0xb8d8('0x7a')][_0xb8d8('0x7b')],'raw':!![]})['then'](function(_0xeb1f8e){return _0xeb1f8e;});})['then'](function(_0x44ba03){if(_0x44ba03){_0x260bdf[_0xb8d8('0x1e')][_0xb8d8('0x7c')]=_0x44ba03[0x0];if(!_0xa3b089[_0xb8d8('0x4d')]['UserId'])return;return db[_0xb8d8('0x7d')][_0xb8d8('0x4c')]({'where':{'id':_0xa3b089[_0xb8d8('0x4d')]['UserId'],'role':_0xb8d8('0x70')},'attributes':['id',_0xb8d8('0x2d'),_0xb8d8('0x7e'),_0xb8d8('0x7f'),_0xb8d8('0x80')],'raw':!![]});}return null;})[_0xb8d8('0x16')](function(_0x297074){if(!_0x297074)return null;_0x260bdf['message'][_0xb8d8('0x70')]=_0x297074;return _0x260bdf;})['then'](function(_0xe654dd){if(_0xe654dd){if(_0xa3b089['body'][_0xb8d8('0x81')]){_0x260bdf[_0xb8d8('0x1e')][_0xb8d8('0x82')]=util[_0xb8d8('0x73')]('SIP/%s',_0xa3b089[_0xb8d8('0x6f')]['name']);_0x260bdf[_0xb8d8('0x1e')][_0xb8d8('0x83')]=_0x260bdf[_0xb8d8('0x83')];_0x260bdf[_0xb8d8('0x1e')][_0xb8d8('0x84')]=_0x260bdf[_0xb8d8('0x83')];_0x260bdf['message'][_0xb8d8('0x85')]=_0xb8d8('0x6d');_0x260bdf['message'][_0xb8d8('0x4d')]=htmlToText[_0xb8d8('0x86')](_0x260bdf['message'][_0xb8d8('0x4d')]);return respondWithRpcPromise('EventManager',_0xb8d8('0x87'),{'event':_0xb8d8('0x88'),'message':_0x260bdf[_0xb8d8('0x1e')]},client9002)['then'](function(){return _0x260bdf;});}return _0x260bdf;}return null;})[_0xb8d8('0x16')](respondWithResult(_0x335381,null))[_0xb8d8('0x20')](handleError(_0x335381,null));};exports[_0xb8d8('0x89')]=function(_0x21179d,_0xadb514){var _0x20c9b8={'agent':{},'channel':_0xb8d8('0x8a')};if(_0x21179d['body']['id']){delete _0x21179d['body']['id'];}_0x21179d[_0xb8d8('0x4d')][_0xb8d8('0x71')]=_0x21179d[_0xb8d8('0x4d')]['UserId']||_0x21179d[_0xb8d8('0x6f')]['id'];_0x20c9b8[_0xb8d8('0x70')]['id']=_0x21179d['body'][_0xb8d8('0x71')];return db['MailMessage'][_0xb8d8('0x4c')]({'where':{'id':_0x21179d[_0xb8d8('0x49')]['id'],'UserId':null}})[_0xb8d8('0x16')](handleEntityNotFound(_0xadb514,null))[_0xb8d8('0x16')](function(_0x11b09a){if(_0x11b09a){_0x20c9b8['message']=_0x11b09a[_0xb8d8('0x72')]({'plain':!![]});return db[_0xb8d8('0x8b')][_0xb8d8('0x4c')]({'where':{'id':_0x11b09a[_0xb8d8('0x8c')]}});}return null;})['then'](handleEntityNotFound(_0xadb514,null))[_0xb8d8('0x16')](function(_0x347d2a){if(_0x347d2a){_0x20c9b8[_0xb8d8('0x74')]=_0x347d2a[_0xb8d8('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21179d[_0xb8d8('0x6f')]['id'],_0x21179d['user'][_0xb8d8('0x2d')],_0x21179d[_0xb8d8('0x6f')][_0xb8d8('0x76')],_0x20c9b8[_0xb8d8('0x74')]['id'],_0x21179d[_0xb8d8('0x4d')]?JSON[_0xb8d8('0x1a')](_0x21179d['body']):'null');return respondWithRpcPromise(_0xb8d8('0x8d'),_0xb8d8('0x8e'),_0x20c9b8);}return null;})['then'](function(_0x5db7a7){var _0x4630ab=_0xb8d8('0x8f')+_0x5db7a7['message'][_0xb8d8('0x90')];return db[_0xb8d8('0x79')][_0xb8d8('0x35')](_0x4630ab,{'type':db[_0xb8d8('0x91')][_0xb8d8('0x7a')][_0xb8d8('0x7b')],'raw':!![]})[_0xb8d8('0x16')](function(_0xcd4318){return _0xcd4318;});})[_0xb8d8('0x16')](function(_0x2e1696){if(_0x2e1696){_0x20c9b8[_0xb8d8('0x1e')][_0xb8d8('0x7c')]=_0x2e1696[0x0];if(!_0x21179d['body']['UserId'])return;return db[_0xb8d8('0x7d')][_0xb8d8('0x4c')]({'where':{'id':_0x21179d[_0xb8d8('0x4d')][_0xb8d8('0x71')],'role':_0xb8d8('0x70')},'attributes':['id','name',_0xb8d8('0x7e'),'email',_0xb8d8('0x80')],'raw':!![]});}return null;})[_0xb8d8('0x16')](function(_0x348f25){if(!_0x348f25)return null;_0x20c9b8[_0xb8d8('0x1e')][_0xb8d8('0x70')]=_0x348f25;return _0x20c9b8;})['then'](function(_0x69e907){if(_0x69e907){_0x69e907[_0xb8d8('0x1e')][_0xb8d8('0x82')]=util['format']('SIP/%s',_0x21179d['user'][_0xb8d8('0x2d')]);_0x69e907[_0xb8d8('0x1e')][_0xb8d8('0x83')]=_0x20c9b8[_0xb8d8('0x83')];_0x69e907[_0xb8d8('0x1e')][_0xb8d8('0x84')]=_0x20c9b8[_0xb8d8('0x83')];_0x69e907[_0xb8d8('0x1e')][_0xb8d8('0x85')]=_0xb8d8('0x89');_0x69e907[_0xb8d8('0x1e')][_0xb8d8('0x4d')]=htmlToText[_0xb8d8('0x86')](_0x20c9b8['message'][_0xb8d8('0x4d')]);respondWithRpcPromise(_0xb8d8('0x87'),_0xb8d8('0x87'),{'event':_0xb8d8('0x92'),'message':_0x69e907[_0xb8d8('0x1e')]},client9002);return _0x20c9b8;}return null;})[_0xb8d8('0x16')](respondWithResult(_0xadb514,null))['catch'](handleError(_0xadb514,null));};exports['download']=function(_0x4db364,_0x588cd5){var _0x2f2673=moment()[_0xb8d8('0x93')]()[_0xb8d8('0x94')]();var _0x1e6073=path['join'](config[_0xb8d8('0x95')],_0xb8d8('0x96'),_0xb8d8('0x97'),'tmp');var _0x218244=path[_0xb8d8('0x64')](config[_0xb8d8('0x95')],_0xb8d8('0x96'),'files',_0xb8d8('0x63'));var _0x3d4a7d=util['format'](_0xb8d8('0x98'),_0x2f2673);return db[_0xb8d8('0x46')][_0xb8d8('0x4c')]({'where':{'id':_0x4db364[_0xb8d8('0x49')]['id']},'attributes':['id',_0xb8d8('0x4d'),_0xb8d8('0x99'),'to','cc',_0xb8d8('0x9a'),_0xb8d8('0x9b'),_0xb8d8('0x9c')],'include':_0x4db364[_0xb8d8('0x35')][_0xb8d8('0x63')]?[{'model':db[_0xb8d8('0x9d')],'as':_0xb8d8('0x9e')}]:undefined})[_0xb8d8('0x16')](handleEntityNotFound(_0x588cd5,null))[_0xb8d8('0x16')](function(_0x55383c){if(_0x55383c){var _0x29c8de=_0x55383c;var _0x3e4772={'from':_0x29c8de[_0xb8d8('0x99')],'to':_0x29c8de['to'],'subject':_0x29c8de[_0xb8d8('0x9b')],'html':htmlEntities['decode'](_0x29c8de[_0xb8d8('0x4d')]),'headers':{'Date':moment(_0x29c8de[_0xb8d8('0x9c')])[_0xb8d8('0x73')](_0xb8d8('0x9f'))},'attachments':[]};if(_0x55383c['cc']){_0x3e4772[_0xb8d8('0xa0')]['Cc']=_0x55383c['cc'];}if(_0x55383c[_0xb8d8('0x9a')]){_0x3e4772['headers'][_0xb8d8('0xa1')]=_0x55383c[_0xb8d8('0x9a')];}return new BPromise(function(_0x26594a,_0x428c81){if(_0x55383c[_0xb8d8('0x9e')]){for(var _0x458a64=0x0;_0x458a64<_0x55383c[_0xb8d8('0x9e')]['length'];_0x458a64++){var _0x43d567=_0x55383c[_0xb8d8('0x9e')][_0x458a64];var _0x1ad06d=path[_0xb8d8('0x64')](_0x218244,_0x43d567[_0xb8d8('0x66')]);if(fs[_0xb8d8('0xa2')](_0x1ad06d)){_0x3e4772[_0xb8d8('0x63')][_0xb8d8('0xa3')]({'name':_0x43d567[_0xb8d8('0x2d')],'contentType':_0x43d567[_0xb8d8('0x32')],'data':fs[_0xb8d8('0xa4')](_0x1ad06d)});}}}emlformat[_0xb8d8('0xa5')](_0x3e4772,function(_0xed44b6,_0x32a9dc){if(_0xed44b6)return _0x428c81(_0xed44b6);fs[_0xb8d8('0xa6')](path[_0xb8d8('0x64')](_0x1e6073,_0x3d4a7d),_0x32a9dc);return _0x26594a(_0x32a9dc);});});}})['then'](function(_0x3304f7){if(_0x3304f7){return _0x588cd5['download'](path[_0xb8d8('0x64')](_0x1e6073,_0x3d4a7d),_0x3d4a7d,function(_0x248ebd){if(!_0x248ebd)fs['unlinkSync'](path[_0xb8d8('0x64')](_0x1e6073,_0x3d4a7d));});}})[_0xb8d8('0x20')](handleError(_0x588cd5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 591f1aa..ddf17f0 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 _0x3f23=['../../mysqldb','MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3f23,0x17a));var _0x33f2=function(_0x4784fb,_0xd52a18){_0x4784fb=_0x4784fb-0x0;var _0x164fb7=_0x3f23[_0x4784fb];return _0x164fb7;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x33f2('0x0'))['db'][_0x33f2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x33f2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x33f2('0x3'),'afterDestroy':_0x33f2('0x4')};function emitEvent(_0x3812cb){return function(_0x358099,_0x4e2b21,_0x188335){MailMessageEvents[_0x33f2('0x5')](_0x3812cb+':'+_0x358099['id'],_0x358099);MailMessageEvents[_0x33f2('0x5')](_0x3812cb,_0x358099);_0x188335(null);};}for(var e in events){if(events[_0x33f2('0x6')](e)){var event=events[e];MailMessage[_0x33f2('0x7')](e,emitEvent(event));}}module[_0x33f2('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x0572=['emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x227e07,_0x4be783){var _0x188dd3=function(_0x3c632a){while(--_0x3c632a){_0x227e07['push'](_0x227e07['shift']());}};_0x188dd3(++_0x4be783);}(_0x0572,0xc0));var _0x2057=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0572[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x2057('0x0'))['db'][_0x2057('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2057('0x2')](0x0);var events={'afterCreate':_0x2057('0x3'),'afterUpdate':_0x2057('0x4'),'afterDestroy':_0x2057('0x5')};function emitEvent(_0x58b228){return function(_0x5b01a6,_0x48828c,_0x487e8f){MailMessageEvents[_0x2057('0x6')](_0x58b228+':'+_0x5b01a6['id'],_0x5b01a6);MailMessageEvents['emit'](_0x58b228,_0x5b01a6);_0x487e8f(null);};}for(var e in events){if(events[_0x2057('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x2057('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7023472..8772768 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 _0x8e16=['createdAt','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','FULLTEXT','body','plainBody','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','then'];(function(_0x5f41a8,_0x19c20d){var _0x5092c6=function(_0x300d15){while(--_0x300d15){_0x5f41a8['push'](_0x5f41a8['shift']());}};_0x5092c6(++_0x19c20d);}(_0x8e16,0x197));var _0x68e1=function(_0x175462,_0x4ab9c3){_0x175462=_0x175462-0x0;var _0x4ce7b1=_0x8e16[_0x175462];return _0x4ce7b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x68e1('0x0'))(_0x68e1('0x1'));var moment=require(_0x68e1('0x2'));var BPromise=require(_0x68e1('0x3'));var rp=require(_0x68e1('0x4'));var htmlToText=require(_0x68e1('0x5'));var fs=require('fs');var path=require(_0x68e1('0x6'));var rimraf=require(_0x68e1('0x7'));var config=require(_0x68e1('0x8'));var attributes=require(_0x68e1('0x9'));module['exports']=function(_0x3e7d0d,_0x20c4a0){return _0x3e7d0d['define'](_0x68e1('0xa'),attributes,{'tableName':_0x68e1('0xb'),'paranoid':![],'indexes':[{'name':_0x68e1('0xc'),'fields':[_0x68e1('0xc')]},{'name':_0x68e1('0xd'),'fields':['plainBody','subject'],'type':_0x68e1('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x36df20,_0x140c7f,_0x46a44f){if(_0x36df20[_0x68e1('0xf')]){_0x36df20[_0x68e1('0x10')]=htmlToText[_0x68e1('0x11')](_0x36df20[_0x68e1('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x46a44f(null,_0x140c7f);},'afterCreate':function(_0x29fab6,_0x440d3e,_0x26eab4){var _0x3ed61c=_0x3e7d0d[_0x68e1('0x12')];var _0x42547a=_0x29fab6['get']({'plain':!![]});if(_0x42547a[_0x68e1('0x13')][_0x68e1('0x14')]()==='in'||_0x42547a[_0x68e1('0x13')][_0x68e1('0x14')]()===_0x68e1('0x15')&&!_0x42547a[_0x68e1('0x16')]&&!_[_0x68e1('0x17')](_0x42547a[_0x68e1('0x18')])){_0x3ed61c[_0x68e1('0x19')]['findOne']({'where':{'id':_0x42547a['MailInteractionId']}})[_0x68e1('0x1a')](function(_0x26b7fd){if(_0x26b7fd){_0x26b7fd['update']({'lastMsgAt':_0x42547a[_0x68e1('0x1b')],'lastMsgDirection':_0x42547a['direction'][_0x68e1('0x14')]()});}})['catch'](function(_0xef8c28){console[_0x68e1('0x1c')](_0xef8c28);});}_0x26eab4();}},'charset':_0x68e1('0x1d'),'collate':_0x68e1('0x1e')});}; \ No newline at end of file +var _0xe9ce=['exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes'];(function(_0x76ccf7,_0x17e8be){var _0x3fd492=function(_0x29f911){while(--_0x29f911){_0x76ccf7['push'](_0x76ccf7['shift']());}};_0x3fd492(++_0x17e8be);}(_0xe9ce,0x155));var _0xee9c=function(_0x349e22,_0x5db7ea){_0x349e22=_0x349e22-0x0;var _0x4f5032=_0xe9ce[_0x349e22];return _0x4f5032;};'use strict';var _=require('lodash');var util=require(_0xee9c('0x0'));var logger=require(_0xee9c('0x1'))(_0xee9c('0x2'));var moment=require('moment');var BPromise=require(_0xee9c('0x3'));var rp=require(_0xee9c('0x4'));var htmlToText=require(_0xee9c('0x5'));var fs=require('fs');var path=require(_0xee9c('0x6'));var rimraf=require(_0xee9c('0x7'));var config=require('../../config/environment');var attributes=require(_0xee9c('0x8'));module[_0xee9c('0x9')]=function(_0x524c44,_0x9db754){return _0x524c44[_0xee9c('0xa')](_0xee9c('0xb'),attributes,{'tableName':_0xee9c('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xee9c('0xd')]},{'name':_0xee9c('0xe'),'fields':[_0xee9c('0xf'),_0xee9c('0x10')],'type':_0xee9c('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d589b,_0x200722,_0x4a5417){if(_0x3d589b[_0xee9c('0x12')]){_0x3d589b[_0xee9c('0xf')]=htmlToText['fromString'](_0x3d589b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4a5417(null,_0x200722);},'afterCreate':function(_0x14c74e,_0x2fe3a1,_0x3f8cae){var _0x568cd8=_0x524c44[_0xee9c('0x13')];var _0x20e508=_0x14c74e[_0xee9c('0x14')]({'plain':!![]});if(_0x20e508[_0xee9c('0x15')][_0xee9c('0x16')]()==='in'||_0x20e508[_0xee9c('0x15')]['toLowerCase']()===_0xee9c('0x17')&&!_0x20e508[_0xee9c('0x18')]&&!_[_0xee9c('0x19')](_0x20e508[_0xee9c('0x1a')])){_0x568cd8['MailInteraction']['findOne']({'where':{'id':_0x20e508[_0xee9c('0x1b')]}})[_0xee9c('0x1c')](function(_0x286fde){if(_0x286fde){_0x286fde[_0xee9c('0x1d')]({'lastMsgAt':_0x20e508[_0xee9c('0x1e')],'lastMsgDirection':_0x20e508[_0xee9c('0x15')]['toLowerCase']()});}})[_0xee9c('0x1f')](function(_0x5e1f5d){console[_0xee9c('0x20')](_0x5e1f5d);});}_0x3f8cae();}},'charset':_0xee9c('0x21'),'collate':_0xee9c('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 03d5c47..c0baa0c 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateMailMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ba6d5,_0x241a95){var _0x486b68=function(_0x3d82b6){while(--_0x3d82b6){_0x1ba6d5['push'](_0x1ba6d5['shift']());}};_0x486b68(++_0x241a95);}(_0x5eb8,0xb0));var _0x85eb=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x5eb8[_0x15876a];return _0xbd900f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./mailMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateMailMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['MailMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateMailMessage',_0x24cf28);logger['debug']('CreateMailMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0x7880=['redis','defaults','localhost','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailMessage','create','body','options','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5c9c41,_0x10e953){var _0x1ced02=function(_0x52aef9){while(--_0x52aef9){_0x5c9c41['push'](_0x5c9c41['shift']());}};_0x1ced02(++_0x10e953);}(_0x7880,0x1f4));var _0x0788=function(_0x446186,_0x116e31){_0x446186=_0x446186-0x0;var _0x63b564=_0x7880[_0x446186];return _0x63b564;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});config[_0x0788('0xc')]=_[_0x0788('0xd')](config[_0x0788('0xc')],{'host':_0x0788('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0788('0xc')]));require('./mailMessage.socket')[_0x0788('0xf')](socket);function respondWithRpcPromise(_0x53b2f2,_0x433c26,_0x3c6d18){return new BPromise(function(_0x1f9ff6,_0xee8670){return client[_0x0788('0x10')](_0x53b2f2,_0x3c6d18)['then'](function(_0x1920b3){logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,_0x0788('0x13'));logger[_0x0788('0x14')](_0x0788('0x15'),_0x433c26,_0x0788('0x13'),JSON['stringify'](_0x1920b3));if(_0x1920b3[_0x0788('0x16')]){if(_0x1920b3[_0x0788('0x16')][_0x0788('0x17')]===0x1f4){logger[_0x0788('0x16')]('MailMessage,\x20%s,\x20%s',_0x433c26,_0x1920b3[_0x0788('0x16')]['message']);return _0xee8670(_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);}logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);return _0x1f9ff6(_0x1920b3['error']['message']);}else{logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,'request\x20sent');_0x1f9ff6(_0x1920b3[_0x0788('0x19')][_0x0788('0x18')]);}})[_0x0788('0x1a')](function(_0x52c339){logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x52c339);_0xee8670(_0x52c339);});});}exports['CreateMailMessage']=function(_0x11ea01){var _0x5173d6=this;return new Promise(function(_0x7d0869,_0x48bc5f){return db[_0x0788('0x1b')][_0x0788('0x1c')](_0x11ea01[_0x0788('0x1d')],{'raw':_0x11ea01[_0x0788('0x1e')]?_0x11ea01[_0x0788('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2270d4){logger[_0x0788('0x11')](_0x0788('0x1f'),_0x11ea01);logger[_0x0788('0x14')]('CreateMailMessage',_0x11ea01,JSON['stringify'](_0x2270d4));_0x7d0869(_0x2270d4);})[_0x0788('0x1a')](function(_0x18cc33){logger[_0x0788('0x16')]('CreateMailMessage',_0x18cc33['message'],_0x11ea01);_0x48bc5f(_0x5173d6[_0x0788('0x16')](0x1f4,_0x18cc33[_0x0788('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c02097e..d21274e 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 _0xaba0=['removeListener','register','length','mailMessage:','save','remove','update','emit'];(function(_0x4cee11,_0xbe9073){var _0x330547=function(_0x45e145){while(--_0x45e145){_0x4cee11['push'](_0x4cee11['shift']());}};_0x330547(++_0xbe9073);}(_0xaba0,0x64));var _0x0aba=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xaba0[_0x6131cd];return _0x47e916;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x0aba('0x0'),_0x0aba('0x1'),_0x0aba('0x2')];function createListener(_0x36effd,_0x4c5340){return function(_0x19cb2c){_0x4c5340[_0x0aba('0x3')](_0x36effd,_0x19cb2c);};}function removeListener(_0x2736e2,_0x1f0235){return function(){MailMessageEvents[_0x0aba('0x4')](_0x2736e2,_0x1f0235);};}exports[_0x0aba('0x5')]=function(_0x52c8b1){for(var _0x1a9fd5=0x0,_0x521bf1=events[_0x0aba('0x6')];_0x1a9fd5<_0x521bf1;_0x1a9fd5++){var _0x587537=events[_0x1a9fd5];var _0x24c1e5=createListener(_0x0aba('0x7')+_0x587537,_0x52c8b1);MailMessageEvents['on'](_0x587537,_0x24c1e5);}}; \ No newline at end of file +var _0x4d22=['length','mailMessage:','remove','update','removeListener','register'];(function(_0x5c454f,_0x528c45){var _0x173585=function(_0x2c78bd){while(--_0x2c78bd){_0x5c454f['push'](_0x5c454f['shift']());}};_0x173585(++_0x528c45);}(_0x4d22,0x1ac));var _0x24d2=function(_0x18a794,_0x335c63){_0x18a794=_0x18a794-0x0;var _0x4fadaa=_0x4d22[_0x18a794];return _0x4fadaa;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x24d2('0x0'),_0x24d2('0x1')];function createListener(_0x41103b,_0x5ce32f){return function(_0x5267ae){_0x5ce32f['emit'](_0x41103b,_0x5267ae);};}function removeListener(_0x3d1771,_0x239b0d){return function(){MailMessageEvents[_0x24d2('0x2')](_0x3d1771,_0x239b0d);};}exports[_0x24d2('0x3')]=function(_0x1e9e3d){for(var _0x263327=0x0,_0x46dde8=events[_0x24d2('0x4')];_0x263327<_0x46dde8;_0x263327++){var _0x38b5fc=events[_0x263327];var _0x29e110=createListener(_0x24d2('0x5')+_0x38b5fc,_0x1e9e3d);MailMessageEvents['on'](_0x38b5fc,_0x29e110);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c3eef52..eaf17e9 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 _0xb06e=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','show','/:id/members'];(function(_0x210cc5,_0x225e82){var _0x128ff6=function(_0x393fbb){while(--_0x393fbb){_0x210cc5['push'](_0x210cc5['shift']());}};_0x128ff6(++_0x225e82);}(_0xb06e,0x1e1));var _0xeb06=function(_0xf74a9f,_0x483e3b){_0xf74a9f=_0xf74a9f-0x0;var _0x53b807=_0xb06e[_0xf74a9f];return _0x53b807;};'use strict';var multer=require(_0xeb06('0x0'));var util=require(_0xeb06('0x1'));var path=require(_0xeb06('0x2'));var timeout=require(_0xeb06('0x3'));var express=require(_0xeb06('0x4'));var router=express[_0xeb06('0x5')]();var fs_extra=require(_0xeb06('0x6'));var auth=require(_0xeb06('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xeb06('0x8'));var controller=require(_0xeb06('0x9'));router[_0xeb06('0xa')]('/',auth[_0xeb06('0xb')](),controller['index']);router[_0xeb06('0xa')](_0xeb06('0xc'),auth[_0xeb06('0xb')](),controller['describe']);router['get']('/:id',auth[_0xeb06('0xb')](),controller[_0xeb06('0xd')]);router[_0xeb06('0xa')](_0xeb06('0xe'),auth[_0xeb06('0xb')](),controller[_0xeb06('0xf')]);router[_0xeb06('0xa')](_0xeb06('0x10'),auth[_0xeb06('0xb')](),controller[_0xeb06('0x11')]);router[_0xeb06('0xa')](_0xeb06('0x12'),auth['isAuthenticated'](),controller[_0xeb06('0x13')]);router[_0xeb06('0x14')]('/',auth[_0xeb06('0xb')](),controller[_0xeb06('0x15')]);router[_0xeb06('0x14')]('/:id/teams',auth[_0xeb06('0xb')](),controller[_0xeb06('0x16')]);router[_0xeb06('0x14')](_0xeb06('0x12'),auth['isAuthenticated'](),controller[_0xeb06('0x17')]);router['put'](_0xeb06('0x18'),auth[_0xeb06('0xb')](),controller[_0xeb06('0x19')]);router['delete'](_0xeb06('0x18'),auth['isAuthenticated'](),controller[_0xeb06('0x1a')]);router[_0xeb06('0x1b')](_0xeb06('0x10'),auth[_0xeb06('0xb')](),controller[_0xeb06('0x1c')]);router['delete'](_0xeb06('0x12'),auth[_0xeb06('0xb')](),controller[_0xeb06('0x1d')]);module[_0xeb06('0x1e')]=router; \ No newline at end of file +var _0x29da=['/:id/members','/:id/users','getAgents','post','create','addTeams','addAgents','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x37ec13,_0xe9ad20){var _0x4cd3df=function(_0x2f7616){while(--_0x2f7616){_0x37ec13['push'](_0x37ec13['shift']());}};_0x4cd3df(++_0xe9ad20);}(_0x29da,0xc9));var _0xa29d=function(_0x4ff6d3,_0x203fbd){_0x4ff6d3=_0x4ff6d3-0x0;var _0x57c0ae=_0x29da[_0x4ff6d3];return _0x57c0ae;};'use strict';var multer=require(_0xa29d('0x0'));var util=require(_0xa29d('0x1'));var path=require(_0xa29d('0x2'));var timeout=require(_0xa29d('0x3'));var express=require(_0xa29d('0x4'));var router=express['Router']();var fs_extra=require(_0xa29d('0x5'));var auth=require(_0xa29d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa29d('0x7'));router['get']('/',auth[_0xa29d('0x8')](),controller[_0xa29d('0x9')]);router[_0xa29d('0xa')](_0xa29d('0xb'),auth[_0xa29d('0x8')](),controller[_0xa29d('0xc')]);router[_0xa29d('0xa')](_0xa29d('0xd'),auth[_0xa29d('0x8')](),controller[_0xa29d('0xe')]);router[_0xa29d('0xa')](_0xa29d('0xf'),auth[_0xa29d('0x8')](),controller['getMembers']);router[_0xa29d('0xa')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xa29d('0xa')](_0xa29d('0x10'),auth[_0xa29d('0x8')](),controller[_0xa29d('0x11')]);router[_0xa29d('0x12')]('/',auth['isAuthenticated'](),controller[_0xa29d('0x13')]);router[_0xa29d('0x12')]('/:id/teams',auth[_0xa29d('0x8')](),controller[_0xa29d('0x14')]);router[_0xa29d('0x12')]('/:id/users',auth[_0xa29d('0x8')](),controller[_0xa29d('0x15')]);router['put'](_0xa29d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa29d('0x16')](_0xa29d('0xd'),auth[_0xa29d('0x8')](),controller['destroy']);router[_0xa29d('0x16')](_0xa29d('0x17'),auth[_0xa29d('0x8')](),controller[_0xa29d('0x18')]);router[_0xa29d('0x16')]('/:id/users',auth[_0xa29d('0x8')](),controller[_0xa29d('0x19')]);module[_0xa29d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 071c6af..3a5490d 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 _0xc15f=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x355b97,_0x53b83a){var _0x3c41dd=function(_0x1c9eba){while(--_0x1c9eba){_0x355b97['push'](_0x355b97['shift']());}};_0x3c41dd(++_0x53b83a);}(_0xc15f,0x1af));var _0xfc15=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xc15f[_0xcf4569];return _0x7fef;};'use strict';var Sequelize=require('sequelize');module[_0xfc15('0x0')]={'name':{'type':Sequelize[_0xfc15('0x1')],'unique':_0xfc15('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfc15('0x1')]},'timeout':{'type':Sequelize[_0xfc15('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfc15('0x4')](_0xfc15('0x5'),_0xfc15('0x6'),_0xfc15('0x7'))}}; \ No newline at end of file +var _0xe8a6=['exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x5b9c24,_0x5ef250){var _0x15d754=function(_0x43bf09){while(--_0x43bf09){_0x5b9c24['push'](_0x5b9c24['shift']());}};_0x15d754(++_0x5ef250);}(_0xe8a6,0x181));var _0x6e8a=function(_0x4e61c0,_0x193ad3){_0x4e61c0=_0x4e61c0-0x0;var _0x1effd4=_0xe8a6[_0x4e61c0];return _0x1effd4;};'use strict';var Sequelize=require('sequelize');module[_0x6e8a('0x0')]={'name':{'type':Sequelize[_0x6e8a('0x1')],'unique':_0x6e8a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6e8a('0x1')]},'timeout':{'type':Sequelize[_0x6e8a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6e8a('0x4')]('rrmemory',_0x6e8a('0x5'),_0x6e8a('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index cd9c613..e4a0cd6 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 _0x5fa1=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','update','then','destroy','get','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','find','userProfileId'];(function(_0x29cce9,_0x3dfc12){var _0x535ed7=function(_0xe01105){while(--_0xe01105){_0x29cce9['push'](_0x29cce9['shift']());}};_0x535ed7(++_0x3dfc12);}(_0x5fa1,0xcb));var _0x15fa=function(_0x452e01,_0x5c6899){_0x452e01=_0x452e01-0x0;var _0x11e205=_0x5fa1[_0x452e01];return _0x11e205;};'use strict';var emlformat=require(_0x15fa('0x0'));var rimraf=require(_0x15fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x15fa('0x2'));var moment=require(_0x15fa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x15fa('0x4'));var util=require(_0x15fa('0x5'));var path=require(_0x15fa('0x6'));var sox=require(_0x15fa('0x7'));var csv=require(_0x15fa('0x8'));var ejs=require(_0x15fa('0x9'));var fs=require('fs');var fs_extra=require(_0x15fa('0xa'));var _=require(_0x15fa('0xb'));var squel=require(_0x15fa('0xc'));var crypto=require('crypto');var jsforce=require(_0x15fa('0xd'));var deskjs=require(_0x15fa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x15fa('0xf'));var Papa=require(_0x15fa('0x10'));var Redis=require(_0x15fa('0x11'));var authService=require(_0x15fa('0x12'));var qs=require(_0x15fa('0x13'));var as=require(_0x15fa('0x14'));var hardwareService=require(_0x15fa('0x15'));var logger=require(_0x15fa('0x16'))(_0x15fa('0x17'));var utils=require('../../config/utils');var config=require(_0x15fa('0x18'));var licenseUtil=require(_0x15fa('0x19'));var db=require(_0x15fa('0x1a'))['db'];config[_0x15fa('0x1b')]=_[_0x15fa('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x15fa('0x1d'))(new Redis(config[_0x15fa('0x1b')]));require(_0x15fa('0x1e'))[_0x15fa('0x1f')](socket);function respondWithStatusCode(_0x12c879,_0x24fb71){_0x24fb71=_0x24fb71||0xcc;return function(_0x404d29){if(_0x404d29){return _0x12c879[_0x15fa('0x20')](_0x24fb71);}return _0x12c879[_0x15fa('0x21')](_0x24fb71)['end']();};}function respondWithResult(_0x22067b,_0x2d9d5f){_0x2d9d5f=_0x2d9d5f||0xc8;return function(_0x24be32){if(_0x24be32){return _0x22067b[_0x15fa('0x21')](_0x2d9d5f)['json'](_0x24be32);}};}function respondWithFilteredResult(_0xc8dbb4,_0x40bda8){return function(_0x4d067f){if(_0x4d067f){var _0x3f11ac=typeof _0x40bda8[_0x15fa('0x22')]===_0x15fa('0x23')&&typeof _0x40bda8['limit']===_0x15fa('0x23');var _0x5b4b3e=_0x4d067f['count'];var _0x55edc1=_0x3f11ac?0x0:_0x40bda8['offset'];var _0x4dfd3f=_0x3f11ac?_0x4d067f[_0x15fa('0x24')]:_0x40bda8[_0x15fa('0x22')]+_0x40bda8['limit'];var _0x310ad6;if(_0x4dfd3f>=_0x5b4b3e){_0x4dfd3f=_0x5b4b3e;_0x310ad6=0xc8;}else{_0x310ad6=0xce;}_0xc8dbb4[_0x15fa('0x21')](_0x310ad6);return _0xc8dbb4[_0x15fa('0x25')](_0x15fa('0x26'),_0x55edc1+'-'+_0x4dfd3f+'/'+_0x5b4b3e)[_0x15fa('0x27')](_0x4d067f);}return null;};}function patchUpdates(_0x2a55a3){return function(_0x5985aa){try{jsonpatch['apply'](_0x5985aa,_0x2a55a3,!![]);}catch(_0x4a5b54){return BPromise[_0x15fa('0x28')](_0x4a5b54);}return _0x5985aa['save']();};}function saveUpdates(_0x174065,_0x26ea95){return function(_0x1c8427){if(_0x1c8427){return _0x1c8427[_0x15fa('0x29')](_0x174065)[_0x15fa('0x2a')](function(_0x5d08f8){return _0x5d08f8;});}return null;};}function removeEntity(_0x8bcf4e,_0xdbee40){return function(_0x3ea2a6){if(_0x3ea2a6){return _0x3ea2a6[_0x15fa('0x2b')]()[_0x15fa('0x2a')](function(){var _0x4b3f73=_0x3ea2a6[_0x15fa('0x2c')]({'plain':!![]});var _0xd49d83='MailQueues';return db['UserProfileResource'][_0x15fa('0x2b')]({'where':{'type':_0xd49d83,'resourceId':_0x4b3f73['id']}})[_0x15fa('0x2a')](function(){return _0x3ea2a6;});})['then'](function(){_0x8bcf4e[_0x15fa('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a734,_0x47afde){return function(_0x185d7e){if(!_0x185d7e){_0x21a734[_0x15fa('0x20')](0x194);}return _0x185d7e;};}function handleError(_0x13e66f,_0x9d2de7){_0x9d2de7=_0x9d2de7||0x1f4;return function(_0x10bb63){logger[_0x15fa('0x2d')](_0x10bb63[_0x15fa('0x2e')]);if(_0x10bb63[_0x15fa('0x2f')]){delete _0x10bb63[_0x15fa('0x2f')];}_0x13e66f[_0x15fa('0x21')](_0x9d2de7)[_0x15fa('0x30')](_0x10bb63);};}exports[_0x15fa('0x31')]=function(_0x565ded,_0x197f2a){var _0x5d2327={},_0x435bf5={},_0x4aa9ae={'count':0x0,'rows':[]};var _0x53b315=_['map'](db[_0x15fa('0x32')][_0x15fa('0x33')],function(_0x2b8a9d){return{'name':_0x2b8a9d[_0x15fa('0x34')],'type':_0x2b8a9d[_0x15fa('0x35')][_0x15fa('0x36')]};});_0x435bf5['model']=_[_0x15fa('0x37')](_0x53b315,_0x15fa('0x2f'));_0x435bf5[_0x15fa('0x38')]=_[_0x15fa('0x39')](_0x565ded[_0x15fa('0x38')]);_0x435bf5[_0x15fa('0x3a')]=_['intersection'](_0x435bf5[_0x15fa('0x3b')],_0x435bf5['query']);_0x5d2327[_0x15fa('0x3c')]=_[_0x15fa('0x3d')](_0x435bf5[_0x15fa('0x3b')],qs[_0x15fa('0x3e')](_0x565ded[_0x15fa('0x38')]['fields']));_0x5d2327[_0x15fa('0x3c')]=_0x5d2327[_0x15fa('0x3c')][_0x15fa('0x3f')]?_0x5d2327['attributes']:_0x435bf5['model'];if(!_0x565ded[_0x15fa('0x38')][_0x15fa('0x40')](_0x15fa('0x41'))){_0x5d2327[_0x15fa('0x42')]=qs[_0x15fa('0x42')](_0x565ded['query'][_0x15fa('0x42')]);_0x5d2327[_0x15fa('0x22')]=qs['offset'](_0x565ded[_0x15fa('0x38')][_0x15fa('0x22')]);}_0x5d2327[_0x15fa('0x43')]=qs['sort'](_0x565ded['query'][_0x15fa('0x44')]);_0x5d2327[_0x15fa('0x45')]=qs[_0x15fa('0x3a')](_[_0x15fa('0x46')](_0x565ded['query'],_0x435bf5[_0x15fa('0x3a')]),_0x53b315);if(_0x565ded['query'][_0x15fa('0x47')]){_0x5d2327[_0x15fa('0x45')]=_[_0x15fa('0x48')](_0x5d2327[_0x15fa('0x45')],{'$or':_[_0x15fa('0x37')](_0x53b315,function(_0x1b21ba){if(_0x1b21ba['type']!==_0x15fa('0x49')){var _0x2e4066={};_0x2e4066[_0x1b21ba[_0x15fa('0x2f')]]={'$like':'%'+_0x565ded[_0x15fa('0x38')][_0x15fa('0x47')]+'%'};return _0x2e4066;}})});}_0x5d2327=_[_0x15fa('0x48')]({},_0x5d2327,_0x565ded['options']);var _0x4d0906={'where':_0x5d2327[_0x15fa('0x45')]};return db[_0x15fa('0x32')][_0x15fa('0x24')](_0x4d0906)[_0x15fa('0x2a')](function(_0x513069){_0x4aa9ae[_0x15fa('0x24')]=_0x513069;if(_0x565ded[_0x15fa('0x38')][_0x15fa('0x4a')]){_0x5d2327[_0x15fa('0x4b')]=[{'all':!![]}];}return db[_0x15fa('0x32')][_0x15fa('0x4c')](_0x5d2327);})['then'](function(_0x58a6a4){_0x4aa9ae[_0x15fa('0x4d')]=_0x58a6a4;return _0x4aa9ae;})['then'](respondWithFilteredResult(_0x197f2a,_0x5d2327))['catch'](handleError(_0x197f2a,null));};exports[_0x15fa('0x4e')]=function(_0x288074,_0x52acdd){var _0x500240={'raw':!![],'where':{'id':_0x288074[_0x15fa('0x4f')]['id']}},_0x4b6a88={};_0x4b6a88[_0x15fa('0x3b')]=_[_0x15fa('0x39')](db[_0x15fa('0x32')]['rawAttributes']);_0x4b6a88['query']=_[_0x15fa('0x39')](_0x288074[_0x15fa('0x38')]);_0x4b6a88['filters']=_['intersection'](_0x4b6a88[_0x15fa('0x3b')],_0x4b6a88[_0x15fa('0x38')]);_0x500240[_0x15fa('0x3c')]=_[_0x15fa('0x3d')](_0x4b6a88[_0x15fa('0x3b')],qs[_0x15fa('0x3e')](_0x288074[_0x15fa('0x38')][_0x15fa('0x3e')]));_0x500240['attributes']=_0x500240['attributes'][_0x15fa('0x3f')]?_0x500240[_0x15fa('0x3c')]:_0x4b6a88[_0x15fa('0x3b')];if(_0x288074[_0x15fa('0x38')][_0x15fa('0x4a')]){_0x500240[_0x15fa('0x4b')]=[{'all':!![]}];}_0x500240=_[_0x15fa('0x48')]({},_0x500240,_0x288074[_0x15fa('0x50')]);return db[_0x15fa('0x32')]['find'](_0x500240)[_0x15fa('0x2a')](handleEntityNotFound(_0x52acdd,null))['then'](respondWithResult(_0x52acdd,null))[_0x15fa('0x51')](handleError(_0x52acdd,null));};exports[_0x15fa('0x52')]=function(_0x4df137,_0x3462d5){return db['MailQueue'][_0x15fa('0x52')](_0x4df137[_0x15fa('0x53')],{})[_0x15fa('0x2a')](function(_0x4eadca){var _0x271eb0=_0x4df137['user'][_0x15fa('0x2c')]({'plain':!![]});if(!_0x271eb0)throw new Error(_0x15fa('0x54'));if(_0x271eb0[_0x15fa('0x55')]===_0x15fa('0x56')){var _0xb2ed59=_0x4eadca[_0x15fa('0x2c')]({'plain':!![]});var _0x2238dd=_0x15fa('0x57');return db[_0x15fa('0x58')][_0x15fa('0x59')]({'where':{'name':_0x2238dd,'userProfileId':_0x271eb0[_0x15fa('0x5a')]},'raw':!![]})['then'](function(_0x2fa338){if(_0x2fa338&&_0x2fa338[_0x15fa('0x5b')]===0x0){return db['UserProfileResource'][_0x15fa('0x52')]({'name':_0xb2ed59[_0x15fa('0x2f')],'resourceId':_0xb2ed59['id'],'type':_0x2fa338[_0x15fa('0x2f')],'sectionId':_0x2fa338['id']},{})['then'](function(){return _0x4eadca;});}else{return _0x4eadca;}})[_0x15fa('0x51')](function(_0x28b8b2){logger[_0x15fa('0x2d')](_0x15fa('0x5c'),_0x28b8b2);throw _0x28b8b2;});}return _0x4eadca;})[_0x15fa('0x2a')](respondWithResult(_0x3462d5,0xc9))['catch'](handleError(_0x3462d5,null));};exports[_0x15fa('0x29')]=function(_0x2d817b,_0x40073a){if(_0x2d817b[_0x15fa('0x53')]['id']){delete _0x2d817b[_0x15fa('0x53')]['id'];}return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x2d817b[_0x15fa('0x4f')]['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x40073a,null))[_0x15fa('0x2a')](saveUpdates(_0x2d817b[_0x15fa('0x53')],null))[_0x15fa('0x2a')](respondWithResult(_0x40073a,null))[_0x15fa('0x51')](handleError(_0x40073a,null));};exports[_0x15fa('0x2b')]=function(_0x464707,_0x5582b5){return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x464707[_0x15fa('0x4f')]['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x5582b5,null))['then'](removeEntity(_0x5582b5,null))[_0x15fa('0x51')](handleError(_0x5582b5,null));};exports['describe']=function(_0x54c6bc,_0x4b8e66){return db[_0x15fa('0x32')]['describe']()[_0x15fa('0x2a')](respondWithResult(_0x4b8e66,null))[_0x15fa('0x51')](handleError(_0x4b8e66,null));};exports[_0x15fa('0x5d')]=function(_0x58bd3f,_0x1440d7,_0x3c4eb1){var _0x266528={'raw':!![],'where':{}},_0x264726={},_0x52ec83;return db['MailQueue'][_0x15fa('0x5e')]({'where':{'id':_0x58bd3f['params']['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x1440d7,null))[_0x15fa('0x2a')](function(_0x3c117a){if(_0x3c117a){_0x52ec83=_0x3c117a[_0x15fa('0x2c')]({'plain':!![]});_0x264726['model']=_[_0x15fa('0x39')](db[_0x15fa('0x5f')][_0x15fa('0x33')]);_0x264726['query']=_[_0x15fa('0x39')](_0x58bd3f[_0x15fa('0x38')]);_0x264726['filters']=_[_0x15fa('0x3d')](_0x264726[_0x15fa('0x3b')],_0x264726[_0x15fa('0x38')]);_0x266528[_0x15fa('0x3c')]=_[_0x15fa('0x3d')](_0x264726[_0x15fa('0x3b')],qs[_0x15fa('0x3e')](_0x58bd3f[_0x15fa('0x38')][_0x15fa('0x3e')]));_0x266528['attributes']=_0x266528[_0x15fa('0x3c')][_0x15fa('0x3f')]?_0x266528[_0x15fa('0x3c')]:_0x264726['model'];if(!_0x58bd3f['query'][_0x15fa('0x40')](_0x15fa('0x41'))){_0x266528['limit']=qs[_0x15fa('0x42')](_0x58bd3f[_0x15fa('0x38')][_0x15fa('0x42')]);_0x266528[_0x15fa('0x22')]=qs[_0x15fa('0x22')](_0x58bd3f['query'][_0x15fa('0x22')]);}_0x266528[_0x15fa('0x43')]=qs[_0x15fa('0x44')](_0x58bd3f['query']['sort']);_0x266528['where']=qs[_0x15fa('0x3a')](_['pick'](_0x58bd3f[_0x15fa('0x38')],_0x264726['filters']));_0x266528[_0x15fa('0x45')][_0x15fa('0x60')]=_0x3c117a['id'];if(_0x58bd3f[_0x15fa('0x38')][_0x15fa('0x47')]){_0x266528[_0x15fa('0x45')]=_[_0x15fa('0x48')](_0x266528['where'],{'$or':_[_0x15fa('0x37')](_0x266528[_0x15fa('0x3c')],function(_0x445a6a){var _0x40d6e8={};_0x40d6e8[_0x445a6a]={'$like':'%'+_0x58bd3f['query'][_0x15fa('0x47')]+'%'};return _0x40d6e8;})});}_0x266528=_[_0x15fa('0x48')]({},_0x266528,_0x58bd3f[_0x15fa('0x50')]);return db['UserMailQueue'][_0x15fa('0x4c')](_0x266528);}})[_0x15fa('0x2a')](function(_0x173248){if(_0x173248){return db[_0x15fa('0x61')][_0x15fa('0x62')]({'where':{'id':_[_0x15fa('0x37')](_0x173248,_0x15fa('0x63')),'role':'agent'},'attributes':['id',_0x15fa('0x2f'),'mailPause',_0x15fa('0x64'),_0x15fa('0x65')]});}})[_0x15fa('0x2a')](function(_0xd9f601){if(_0xd9f601){return{'count':_0xd9f601[_0x15fa('0x24')],'rows':_[_0x15fa('0x37')](_0xd9f601[_0x15fa('0x4d')],function(_0x54dc7c){return{'membername':_0x54dc7c[_0x15fa('0x2f')],'UserId':_0x54dc7c['id'],'queue_name':_0x52ec83[_0x15fa('0x2f')],'MailQueueId':_0x52ec83['id'],'interface':util[_0x15fa('0x66')](_0x15fa('0x67'),_0x15fa('0x68'),_0x54dc7c[_0x15fa('0x2f')]),'penalty':0x0,'paused':_0x54dc7c[_0x15fa('0x69')],'createdAt':_0x54dc7c[_0x15fa('0x65')],'updatedAt':_0x54dc7c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x15fa('0x2a')](respondWithFilteredResult(_0x1440d7,_0x266528))['catch'](handleError(_0x1440d7,null));};exports[_0x15fa('0x6a')]=function(_0x574a0a,_0xf18bf1,_0x332aa0){var _0x1eda7e={};var _0x454f06={};var _0x3d09d4;var _0x3301ef;return db[_0x15fa('0x32')]['findOne']({'where':{'id':_0x574a0a[_0x15fa('0x4f')]['id']}})['then'](handleEntityNotFound(_0xf18bf1,null))[_0x15fa('0x2a')](function(_0x5c915e){if(_0x5c915e){_0x3d09d4=_0x5c915e;_0x454f06[_0x15fa('0x3b')]=_[_0x15fa('0x39')](db[_0x15fa('0x6b')][_0x15fa('0x33')]);_0x454f06['query']=_[_0x15fa('0x39')](_0x574a0a['query']);_0x454f06['filters']=_[_0x15fa('0x3d')](_0x454f06['model'],_0x454f06[_0x15fa('0x38')]);_0x1eda7e[_0x15fa('0x3c')]=_['intersection'](_0x454f06[_0x15fa('0x3b')],qs[_0x15fa('0x3e')](_0x574a0a[_0x15fa('0x38')]['fields']));_0x1eda7e[_0x15fa('0x3c')]=_0x1eda7e[_0x15fa('0x3c')][_0x15fa('0x3f')]?_0x1eda7e[_0x15fa('0x3c')]:_0x454f06[_0x15fa('0x3b')];_0x1eda7e[_0x15fa('0x43')]=qs[_0x15fa('0x44')](_0x574a0a[_0x15fa('0x38')][_0x15fa('0x44')]);_0x1eda7e[_0x15fa('0x45')]=qs[_0x15fa('0x3a')](_['pick'](_0x574a0a[_0x15fa('0x38')],_0x454f06['filters']));if(_0x574a0a[_0x15fa('0x38')][_0x15fa('0x47')]){_0x1eda7e['where']=_['merge'](_0x1eda7e[_0x15fa('0x45')],{'$or':_[_0x15fa('0x37')](_0x1eda7e[_0x15fa('0x3c')],function(_0x33b659){var _0x155a84={};_0x155a84[_0x33b659]={'$like':'%'+_0x574a0a[_0x15fa('0x38')][_0x15fa('0x47')]+'%'};return _0x155a84;})});}_0x1eda7e=_['merge']({},_0x1eda7e,_0x574a0a[_0x15fa('0x50')]);return _0x3d09d4['getTeams'](_0x1eda7e);}})[_0x15fa('0x2a')](function(_0x47f9d0){if(_0x47f9d0){_0x3301ef=_0x47f9d0[_0x15fa('0x3f')];if(!_0x574a0a[_0x15fa('0x38')]['hasOwnProperty'](_0x15fa('0x41'))){_0x1eda7e[_0x15fa('0x42')]=qs['limit'](_0x574a0a[_0x15fa('0x38')][_0x15fa('0x42')]);_0x1eda7e[_0x15fa('0x22')]=qs[_0x15fa('0x22')](_0x574a0a[_0x15fa('0x38')]['offset']);}return _0x3d09d4[_0x15fa('0x6a')](_0x1eda7e);}})[_0x15fa('0x2a')](function(_0x5ce4ed){if(_0x5ce4ed){return _0x5ce4ed?{'count':_0x3301ef,'rows':_0x5ce4ed}:null;}})[_0x15fa('0x2a')](respondWithResult(_0xf18bf1,null))['catch'](handleError(_0xf18bf1,null));};exports['addTeams']=function(_0x157e92,_0x38711d,_0x152bbc){var _0x40266b=_0x157e92['body'][_0x15fa('0x6c')];return db['Team'][_0x15fa('0x4c')]({'where':{'id':_0x40266b},'attributes':['id'],'include':[{'model':db[_0x15fa('0x61')],'as':_0x15fa('0x6d'),'attributes':['id',_0x15fa('0x2f'),_0x15fa('0x6e'),_0x15fa('0x6f'),_0x15fa('0x70')],'raw':!![]}]})[_0x15fa('0x2a')](function(_0x12d364){if(_0x12d364){var _0x2c7018=_[_0x15fa('0x71')](_0x12d364,function(_0x2e751e){var _0x342089=_0x2e751e[_0x15fa('0x2c')]({'plain':!![]});return _0x342089['Agents'];});return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x157e92[_0x15fa('0x4f')]['id']}})[_0x15fa('0x2a')](function(_0x428529){return db[_0x15fa('0x72')][_0x15fa('0x73')](function(_0x5c81ec){return _0x428529['addTeams'](_0x40266b,{'transaction':_0x5c81ec})[_0x15fa('0x2a')](function(){return BPromise[_0x15fa('0x74')](_0x2c7018,function(_0x5baee1){return db[_0x15fa('0x5f')][_0x15fa('0x75')]({'where':{'UserId':_0x5baee1['id'],'MailQueueId':_0x157e92[_0x15fa('0x4f')]['id']},'transaction':_0x5c81ec});});})[_0x15fa('0x2a')](function(){_0x2c7018[_0x15fa('0x76')](function(_0x4f7767){socket['emit'](_0x15fa('0x77'),{'UserId':_0x4f7767['id'],'MailQueueId':_0x428529['id']});});});});});}})[_0x15fa('0x2a')](respondWithStatusCode(_0x38711d,null))[_0x15fa('0x51')](handleError(_0x38711d,null));};exports[_0x15fa('0x78')]=function(_0x12d460,_0x2a44dd,_0xa02d6c){return db[_0x15fa('0x6b')][_0x15fa('0x4c')]({'where':{'id':_0x12d460['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x15fa('0x61')],'as':_0x15fa('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x15fa('0x2a')](handleEntityNotFound(_0x2a44dd,null))['then'](function(_0x455a6f){var _0x52e0da=_['map'](_0x455a6f,'id');var _0x3bb40e=[];var _0x26f435=[];var _0x1c7e81=squel[_0x15fa('0x79')]();_0x1c7e81[_0x15fa('0x7a')](_0x15fa('0x7b'))[_0x15fa('0x7c')](_0x15fa('0x7d'),'tq')[_0x15fa('0x7e')](_0x15fa('0x7f'),'ut',_0x15fa('0x80'))['where']('MailQueueId\x20=\x20?',_0x12d460[_0x15fa('0x4f')]['id']);for(var _0x26a0a6=0x0;_0x26a0a6<_0x455a6f[_0x15fa('0x3f')];_0x26a0a6+=0x1){let _0x546db7=_0x455a6f[_0x26a0a6];for(var _0x17a6d9=0x0;_0x17a6d9<_0x546db7[_0x15fa('0x6d')][_0x15fa('0x3f')];_0x17a6d9+=0x1){let _0x1957c1=_0x546db7[_0x15fa('0x6d')][_0x17a6d9];var _0xf63879=_0x1c7e81[_0x15fa('0x81')]();_0xf63879[_0x15fa('0x45')](_0x15fa('0x82'),_0x1957c1['id']);_0x26f435[_0x15fa('0x83')](db['sequelize'][_0x15fa('0x38')](_0xf63879['toString'](),{'type':db['sequelize'][_0x15fa('0x84')][_0x15fa('0x85')]})['then'](function(_0x1ec76d){if(_0x1ec76d[_0x15fa('0x3f')]===0x1){return _0x1957c1['id'];}else{var _0x198b8a=_['every'](_[_0x15fa('0x37')](_0x1ec76d,_0x15fa('0x86')),function(_0x4cf1cb){return _[_0x15fa('0x87')](_0x52e0da,_0x4cf1cb);});if(_0x198b8a){return _0x1957c1['id'];}}}));}}return BPromise['all'](_0x26f435)[_0x15fa('0x2a')](function(_0x29faef){_0x3bb40e=_(_0x3bb40e)[_0x15fa('0x88')](_0x29faef)[_0x15fa('0x89')]()[_0x15fa('0x8a')]();return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x12d460['params']['id']}})['then'](function(_0x331304){return db[_0x15fa('0x72')][_0x15fa('0x73')](function(_0x41e53c){return _0x331304[_0x15fa('0x78')](_0x12d460[_0x15fa('0x38')][_0x15fa('0x6c')],{'transaction':_0x41e53c})[_0x15fa('0x2a')](function(){if(!_[_0x15fa('0x8b')](_0x3bb40e)){return _0x331304[_0x15fa('0x8c')](_0x3bb40e,{'transaction':_0x41e53c});}})[_0x15fa('0x2a')](function(){_0x3bb40e[_0x15fa('0x76')](function(_0x11c753){socket[_0x15fa('0x8d')](_0x15fa('0x8e'),{'UserId':_0x11c753,'MailQueueId':_0x331304['id']});});});});});});})[_0x15fa('0x2a')](respondWithStatusCode(_0x2a44dd,null))[_0x15fa('0x51')](handleError(_0x2a44dd,null));};exports['addAgents']=function(_0x50e551,_0x5556b7,_0x11bb84){return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x50e551['params']['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x5556b7,null))[_0x15fa('0x2a')](function(_0xba9a18){if(_0xba9a18){return _0xba9a18[_0x15fa('0x8f')](_0x50e551[_0x15fa('0x53')][_0x15fa('0x6c')],_['omit'](_0x50e551['body'],[_0x15fa('0x6c'),'id'])||{})[_0x15fa('0x90')](function(_0x1f7a81){for(var _0x58f94f=0x0;_0x58f94f<_0x50e551[_0x15fa('0x53')]['ids'][_0x15fa('0x3f')];_0x58f94f+=0x1){socket[_0x15fa('0x8d')](_0x15fa('0x77'),{'UserId':Number(_0x50e551[_0x15fa('0x53')][_0x15fa('0x6c')][_0x58f94f]),'MailQueueId':Number(_0x50e551[_0x15fa('0x4f')]['id'])});}return _0x1f7a81;});}})['then'](respondWithResult(_0x5556b7,null))[_0x15fa('0x51')](handleError(_0x5556b7,null));};exports[_0x15fa('0x8c')]=function(_0x499c22,_0x2f26d2,_0x4c646b){return db[_0x15fa('0x32')][_0x15fa('0x59')]({'where':{'id':_0x499c22[_0x15fa('0x4f')]['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x2f26d2,null))[_0x15fa('0x2a')](function(_0x266255){if(_0x266255){return _0x266255[_0x15fa('0x8c')](_0x499c22[_0x15fa('0x38')][_0x15fa('0x6c')])[_0x15fa('0x2a')](function(){if(_[_0x15fa('0x91')](_0x499c22[_0x15fa('0x38')][_0x15fa('0x6c')])){for(var _0x4fab7f=0x0;_0x4fab7f<_0x499c22[_0x15fa('0x38')]['ids']['length'];_0x4fab7f+=0x1){socket[_0x15fa('0x8d')]('userMailQueue:remove',{'UserId':Number(_0x499c22[_0x15fa('0x38')][_0x15fa('0x6c')][_0x4fab7f]),'MailQueueId':Number(_0x499c22[_0x15fa('0x4f')]['id'])});}}else{socket[_0x15fa('0x8d')](_0x15fa('0x8e'),{'UserId':Number(_0x499c22[_0x15fa('0x38')][_0x15fa('0x6c')]),'MailQueueId':Number(_0x499c22[_0x15fa('0x4f')]['id'])});}});}})[_0x15fa('0x2a')](respondWithStatusCode(_0x2f26d2,null))[_0x15fa('0x51')](handleError(_0x2f26d2,null));};exports[_0x15fa('0x92')]=function(_0x5c5ee0,_0x2a4988,_0x349617){var _0x278fd8={};var _0x2beb9a={};var _0x366033;var _0x261133;return db[_0x15fa('0x32')][_0x15fa('0x5e')]({'where':{'id':_0x5c5ee0[_0x15fa('0x4f')]['id']}})[_0x15fa('0x2a')](handleEntityNotFound(_0x2a4988,null))[_0x15fa('0x2a')](function(_0x1e937e){if(_0x1e937e){_0x366033=_0x1e937e;_0x2beb9a[_0x15fa('0x3b')]=_[_0x15fa('0x39')](db['User']['rawAttributes']);_0x2beb9a[_0x15fa('0x38')]=_[_0x15fa('0x39')](_0x5c5ee0[_0x15fa('0x38')]);_0x2beb9a['filters']=_[_0x15fa('0x3d')](_0x2beb9a[_0x15fa('0x3b')],_0x2beb9a['query']);_0x278fd8[_0x15fa('0x3c')]=_[_0x15fa('0x3d')](_0x2beb9a[_0x15fa('0x3b')],qs[_0x15fa('0x3e')](_0x5c5ee0[_0x15fa('0x38')][_0x15fa('0x3e')]));_0x278fd8[_0x15fa('0x3c')]=_0x278fd8['attributes'][_0x15fa('0x3f')]?_0x278fd8[_0x15fa('0x3c')]:_0x2beb9a[_0x15fa('0x3b')];_0x278fd8[_0x15fa('0x43')]=qs['sort'](_0x5c5ee0[_0x15fa('0x38')][_0x15fa('0x44')]);_0x278fd8['where']=qs[_0x15fa('0x3a')](_[_0x15fa('0x46')](_0x5c5ee0[_0x15fa('0x38')],_0x2beb9a[_0x15fa('0x3a')]));if(_0x5c5ee0[_0x15fa('0x38')][_0x15fa('0x47')]){_0x278fd8[_0x15fa('0x45')]=_[_0x15fa('0x48')](_0x278fd8[_0x15fa('0x45')],{'$or':_[_0x15fa('0x37')](_0x278fd8[_0x15fa('0x3c')],function(_0x3a37cf){var _0x4c3a5f={};_0x4c3a5f[_0x3a37cf]={'$like':'%'+_0x5c5ee0[_0x15fa('0x38')][_0x15fa('0x47')]+'%'};return _0x4c3a5f;})});}_0x278fd8=_[_0x15fa('0x48')]({},_0x278fd8,_0x5c5ee0[_0x15fa('0x50')]);return _0x366033[_0x15fa('0x92')](_0x278fd8);}})[_0x15fa('0x2a')](function(_0x43e543){if(_0x43e543){_0x261133=_0x43e543[_0x15fa('0x3f')];if(!_0x5c5ee0['query'][_0x15fa('0x40')]('nolimit')){_0x278fd8['limit']=qs['limit'](_0x5c5ee0['query'][_0x15fa('0x42')]);_0x278fd8[_0x15fa('0x22')]=qs['offset'](_0x5c5ee0[_0x15fa('0x38')]['offset']);}return _0x366033[_0x15fa('0x92')](_0x278fd8);}})[_0x15fa('0x2a')](function(_0x2476df){if(_0x2476df){return _0x2476df?{'count':_0x261133,'rows':_0x2476df}:null;}})['then'](respondWithResult(_0x2a4988,null))[_0x15fa('0x51')](handleError(_0x2a4988,null));}; \ No newline at end of file +var _0xbe02=['User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','findOne','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userMailQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','role','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','length','order','sort','MailQueueId'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xbe02,0x146));var _0x2be0=function(_0xa4a96a,_0x2752d3){_0xa4a96a=_0xa4a96a-0x0;var _0x58db53=_0xbe02[_0xa4a96a];return _0x58db53;};'use strict';var emlformat=require(_0x2be0('0x0'));var rimraf=require(_0x2be0('0x1'));var zipdir=require(_0x2be0('0x2'));var jsonpatch=require(_0x2be0('0x3'));var rp=require('request-promise');var moment=require(_0x2be0('0x4'));var BPromise=require(_0x2be0('0x5'));var Mustache=require(_0x2be0('0x6'));var util=require(_0x2be0('0x7'));var path=require(_0x2be0('0x8'));var sox=require(_0x2be0('0x9'));var csv=require(_0x2be0('0xa'));var ejs=require(_0x2be0('0xb'));var fs=require('fs');var fs_extra=require(_0x2be0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2be0('0xd'));var jsforce=require(_0x2be0('0xe'));var deskjs=require(_0x2be0('0xf'));var toCsv=require(_0x2be0('0xa'));var querystring=require(_0x2be0('0x10'));var Papa=require(_0x2be0('0x11'));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('../../config/license/hardware');var logger=require('../../config/logger')(_0x2be0('0x12'));var utils=require(_0x2be0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2be0('0x14'));var db=require(_0x2be0('0x15'))['db'];config[_0x2be0('0x16')]=_[_0x2be0('0x17')](config[_0x2be0('0x16')],{'host':_0x2be0('0x18'),'port':0x18eb});var socket=require(_0x2be0('0x19'))(new Redis(config[_0x2be0('0x16')]));require(_0x2be0('0x1a'))[_0x2be0('0x1b')](socket);function respondWithStatusCode(_0x54e9f2,_0x2d14d6){_0x2d14d6=_0x2d14d6||0xcc;return function(_0x422a66){if(_0x422a66){return _0x54e9f2['sendStatus'](_0x2d14d6);}return _0x54e9f2[_0x2be0('0x1c')](_0x2d14d6)[_0x2be0('0x1d')]();};}function respondWithResult(_0x5bcbc5,_0x334070){_0x334070=_0x334070||0xc8;return function(_0x30d623){if(_0x30d623){return _0x5bcbc5[_0x2be0('0x1c')](_0x334070)[_0x2be0('0x1e')](_0x30d623);}};}function respondWithFilteredResult(_0x1d4e04,_0x1ae700){return function(_0x48d386){if(_0x48d386){var _0x415894=typeof _0x1ae700[_0x2be0('0x1f')]===_0x2be0('0x20')&&typeof _0x1ae700[_0x2be0('0x21')]===_0x2be0('0x20');var _0x361f25=_0x48d386[_0x2be0('0x22')];var _0xfbd5fd=_0x415894?0x0:_0x1ae700[_0x2be0('0x1f')];var _0x3bf2ba=_0x415894?_0x48d386['count']:_0x1ae700['offset']+_0x1ae700[_0x2be0('0x21')];var _0x53445b;if(_0x3bf2ba>=_0x361f25){_0x3bf2ba=_0x361f25;_0x53445b=0xc8;}else{_0x53445b=0xce;}_0x1d4e04['status'](_0x53445b);return _0x1d4e04[_0x2be0('0x23')](_0x2be0('0x24'),_0xfbd5fd+'-'+_0x3bf2ba+'/'+_0x361f25)[_0x2be0('0x1e')](_0x48d386);}return null;};}function patchUpdates(_0x2b3f88){return function(_0x22f400){try{jsonpatch[_0x2be0('0x25')](_0x22f400,_0x2b3f88,!![]);}catch(_0x105fa6){return BPromise[_0x2be0('0x26')](_0x105fa6);}return _0x22f400['save']();};}function saveUpdates(_0x2f44f7,_0x498c62){return function(_0x5e7fd2){if(_0x5e7fd2){return _0x5e7fd2[_0x2be0('0x27')](_0x2f44f7)[_0x2be0('0x28')](function(_0x166aa1){return _0x166aa1;});}return null;};}function removeEntity(_0x336cde,_0x3fb87f){return function(_0x4b5f21){if(_0x4b5f21){return _0x4b5f21[_0x2be0('0x29')]()['then'](function(){var _0x1c24be=_0x4b5f21[_0x2be0('0x2a')]({'plain':!![]});var _0x559a66='MailQueues';return db[_0x2be0('0x2b')][_0x2be0('0x29')]({'where':{'type':_0x559a66,'resourceId':_0x1c24be['id']}})['then'](function(){return _0x4b5f21;});})[_0x2be0('0x28')](function(){_0x336cde[_0x2be0('0x1c')](0xcc)[_0x2be0('0x1d')]();});}};}function handleEntityNotFound(_0x439888,_0x3b97c0){return function(_0x4184e4){if(!_0x4184e4){_0x439888[_0x2be0('0x2c')](0x194);}return _0x4184e4;};}function handleError(_0x58846a,_0x39df5d){_0x39df5d=_0x39df5d||0x1f4;return function(_0x4d2ad6){logger[_0x2be0('0x2d')](_0x4d2ad6[_0x2be0('0x2e')]);if(_0x4d2ad6[_0x2be0('0x2f')]){delete _0x4d2ad6[_0x2be0('0x2f')];}_0x58846a[_0x2be0('0x1c')](_0x39df5d)[_0x2be0('0x30')](_0x4d2ad6);};}exports[_0x2be0('0x31')]=function(_0x5191e6,_0x121e5b){var _0x13d260={},_0x68fa79={},_0x18b252={'count':0x0,'rows':[]};var _0x101114=_['map'](db[_0x2be0('0x32')][_0x2be0('0x33')],function(_0x32a85e){return{'name':_0x32a85e[_0x2be0('0x34')],'type':_0x32a85e[_0x2be0('0x35')]['key']};});_0x68fa79['model']=_[_0x2be0('0x36')](_0x101114,_0x2be0('0x2f'));_0x68fa79[_0x2be0('0x37')]=_['keys'](_0x5191e6['query']);_0x68fa79['filters']=_[_0x2be0('0x38')](_0x68fa79[_0x2be0('0x39')],_0x68fa79[_0x2be0('0x37')]);_0x13d260[_0x2be0('0x3a')]=_[_0x2be0('0x38')](_0x68fa79[_0x2be0('0x39')],qs[_0x2be0('0x3b')](_0x5191e6[_0x2be0('0x37')][_0x2be0('0x3b')]));_0x13d260[_0x2be0('0x3a')]=_0x13d260[_0x2be0('0x3a')]['length']?_0x13d260[_0x2be0('0x3a')]:_0x68fa79[_0x2be0('0x39')];if(!_0x5191e6[_0x2be0('0x37')][_0x2be0('0x3c')](_0x2be0('0x3d'))){_0x13d260['limit']=qs[_0x2be0('0x21')](_0x5191e6[_0x2be0('0x37')][_0x2be0('0x21')]);_0x13d260['offset']=qs[_0x2be0('0x1f')](_0x5191e6['query'][_0x2be0('0x1f')]);}_0x13d260['order']=qs['sort'](_0x5191e6[_0x2be0('0x37')]['sort']);_0x13d260[_0x2be0('0x3e')]=qs['filters'](_[_0x2be0('0x3f')](_0x5191e6['query'],_0x68fa79[_0x2be0('0x40')]),_0x101114);if(_0x5191e6[_0x2be0('0x37')][_0x2be0('0x41')]){_0x13d260['where']=_[_0x2be0('0x42')](_0x13d260['where'],{'$or':_[_0x2be0('0x36')](_0x101114,function(_0x1a031d){if(_0x1a031d[_0x2be0('0x35')]!==_0x2be0('0x43')){var _0x3668f4={};_0x3668f4[_0x1a031d[_0x2be0('0x2f')]]={'$like':'%'+_0x5191e6[_0x2be0('0x37')][_0x2be0('0x41')]+'%'};return _0x3668f4;}})});}_0x13d260=_[_0x2be0('0x42')]({},_0x13d260,_0x5191e6[_0x2be0('0x44')]);var _0xa1f755={'where':_0x13d260[_0x2be0('0x3e')]};return db[_0x2be0('0x32')][_0x2be0('0x22')](_0xa1f755)[_0x2be0('0x28')](function(_0x4a49df){_0x18b252[_0x2be0('0x22')]=_0x4a49df;if(_0x5191e6['query'][_0x2be0('0x45')]){_0x13d260[_0x2be0('0x46')]=[{'all':!![]}];}return db[_0x2be0('0x32')][_0x2be0('0x47')](_0x13d260);})[_0x2be0('0x28')](function(_0x35eea1){_0x18b252[_0x2be0('0x48')]=_0x35eea1;return _0x18b252;})['then'](respondWithFilteredResult(_0x121e5b,_0x13d260))[_0x2be0('0x49')](handleError(_0x121e5b,null));};exports[_0x2be0('0x4a')]=function(_0x2befef,_0x3becae){var _0x3e6609={'raw':!![],'where':{'id':_0x2befef[_0x2be0('0x4b')]['id']}},_0x4c4345={};_0x4c4345['model']=_[_0x2be0('0x4c')](db[_0x2be0('0x32')][_0x2be0('0x33')]);_0x4c4345[_0x2be0('0x37')]=_[_0x2be0('0x4c')](_0x2befef[_0x2be0('0x37')]);_0x4c4345['filters']=_[_0x2be0('0x38')](_0x4c4345['model'],_0x4c4345[_0x2be0('0x37')]);_0x3e6609[_0x2be0('0x3a')]=_['intersection'](_0x4c4345[_0x2be0('0x39')],qs[_0x2be0('0x3b')](_0x2befef[_0x2be0('0x37')][_0x2be0('0x3b')]));_0x3e6609[_0x2be0('0x3a')]=_0x3e6609['attributes']['length']?_0x3e6609[_0x2be0('0x3a')]:_0x4c4345[_0x2be0('0x39')];if(_0x2befef['query']['includeAll']){_0x3e6609[_0x2be0('0x46')]=[{'all':!![]}];}_0x3e6609=_[_0x2be0('0x42')]({},_0x3e6609,_0x2befef[_0x2be0('0x44')]);return db[_0x2be0('0x32')]['find'](_0x3e6609)[_0x2be0('0x28')](handleEntityNotFound(_0x3becae,null))[_0x2be0('0x28')](respondWithResult(_0x3becae,null))[_0x2be0('0x49')](handleError(_0x3becae,null));};exports[_0x2be0('0x4d')]=function(_0x38aeae,_0x36ac93){return db[_0x2be0('0x32')]['create'](_0x38aeae[_0x2be0('0x4e')],{})[_0x2be0('0x28')](function(_0x52dd0c){var _0x24a2aa=_0x38aeae[_0x2be0('0x4f')][_0x2be0('0x2a')]({'plain':!![]});if(!_0x24a2aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24a2aa[_0x2be0('0x50')]===_0x2be0('0x4f')){var _0x1cd530=_0x52dd0c[_0x2be0('0x2a')]({'plain':!![]});var _0x10685c=_0x2be0('0x51');return db[_0x2be0('0x52')][_0x2be0('0x53')]({'where':{'name':_0x10685c,'userProfileId':_0x24a2aa[_0x2be0('0x54')]},'raw':!![]})['then'](function(_0x2d586f){if(_0x2d586f&&_0x2d586f[_0x2be0('0x55')]===0x0){return db[_0x2be0('0x2b')][_0x2be0('0x4d')]({'name':_0x1cd530['name'],'resourceId':_0x1cd530['id'],'type':_0x2d586f[_0x2be0('0x2f')],'sectionId':_0x2d586f['id']},{})['then'](function(){return _0x52dd0c;});}else{return _0x52dd0c;}})[_0x2be0('0x49')](function(_0x1a3a64){logger['error'](_0x2be0('0x56'),_0x1a3a64);throw _0x1a3a64;});}return _0x52dd0c;})['then'](respondWithResult(_0x36ac93,0xc9))[_0x2be0('0x49')](handleError(_0x36ac93,null));};exports[_0x2be0('0x27')]=function(_0x4bed1f,_0xa641d7){if(_0x4bed1f[_0x2be0('0x4e')]['id']){delete _0x4bed1f[_0x2be0('0x4e')]['id'];}return db[_0x2be0('0x32')][_0x2be0('0x53')]({'where':{'id':_0x4bed1f[_0x2be0('0x4b')]['id']}})[_0x2be0('0x28')](handleEntityNotFound(_0xa641d7,null))[_0x2be0('0x28')](saveUpdates(_0x4bed1f[_0x2be0('0x4e')],null))['then'](respondWithResult(_0xa641d7,null))[_0x2be0('0x49')](handleError(_0xa641d7,null));};exports[_0x2be0('0x29')]=function(_0x2cffff,_0x576a58){return db[_0x2be0('0x32')][_0x2be0('0x53')]({'where':{'id':_0x2cffff[_0x2be0('0x4b')]['id']}})[_0x2be0('0x28')](handleEntityNotFound(_0x576a58,null))[_0x2be0('0x28')](removeEntity(_0x576a58,null))[_0x2be0('0x49')](handleError(_0x576a58,null));};exports[_0x2be0('0x57')]=function(_0x4c3e21,_0x43e76a){return db[_0x2be0('0x32')][_0x2be0('0x57')]()[_0x2be0('0x28')](respondWithResult(_0x43e76a,null))[_0x2be0('0x49')](handleError(_0x43e76a,null));};exports[_0x2be0('0x58')]=function(_0x4eccce,_0xc60d86,_0x5619ab){var _0x49705f={'raw':!![],'where':{}},_0x2d2e79={},_0x3c1967;return db[_0x2be0('0x32')]['findOne']({'where':{'id':_0x4eccce[_0x2be0('0x4b')]['id']}})[_0x2be0('0x28')](handleEntityNotFound(_0xc60d86,null))[_0x2be0('0x28')](function(_0x27c51d){if(_0x27c51d){_0x3c1967=_0x27c51d[_0x2be0('0x2a')]({'plain':!![]});_0x2d2e79['model']=_[_0x2be0('0x4c')](db[_0x2be0('0x59')][_0x2be0('0x33')]);_0x2d2e79[_0x2be0('0x37')]=_[_0x2be0('0x4c')](_0x4eccce[_0x2be0('0x37')]);_0x2d2e79[_0x2be0('0x40')]=_[_0x2be0('0x38')](_0x2d2e79[_0x2be0('0x39')],_0x2d2e79[_0x2be0('0x37')]);_0x49705f[_0x2be0('0x3a')]=_['intersection'](_0x2d2e79[_0x2be0('0x39')],qs[_0x2be0('0x3b')](_0x4eccce['query'][_0x2be0('0x3b')]));_0x49705f[_0x2be0('0x3a')]=_0x49705f[_0x2be0('0x3a')][_0x2be0('0x5a')]?_0x49705f[_0x2be0('0x3a')]:_0x2d2e79['model'];if(!_0x4eccce['query'][_0x2be0('0x3c')](_0x2be0('0x3d'))){_0x49705f[_0x2be0('0x21')]=qs['limit'](_0x4eccce[_0x2be0('0x37')][_0x2be0('0x21')]);_0x49705f[_0x2be0('0x1f')]=qs[_0x2be0('0x1f')](_0x4eccce[_0x2be0('0x37')][_0x2be0('0x1f')]);}_0x49705f[_0x2be0('0x5b')]=qs[_0x2be0('0x5c')](_0x4eccce[_0x2be0('0x37')][_0x2be0('0x5c')]);_0x49705f[_0x2be0('0x3e')]=qs[_0x2be0('0x40')](_[_0x2be0('0x3f')](_0x4eccce[_0x2be0('0x37')],_0x2d2e79['filters']));_0x49705f[_0x2be0('0x3e')][_0x2be0('0x5d')]=_0x27c51d['id'];if(_0x4eccce[_0x2be0('0x37')][_0x2be0('0x41')]){_0x49705f['where']=_['merge'](_0x49705f[_0x2be0('0x3e')],{'$or':_[_0x2be0('0x36')](_0x49705f[_0x2be0('0x3a')],function(_0x199a8b){var _0x54c778={};_0x54c778[_0x199a8b]={'$like':'%'+_0x4eccce[_0x2be0('0x37')][_0x2be0('0x41')]+'%'};return _0x54c778;})});}_0x49705f=_['merge']({},_0x49705f,_0x4eccce[_0x2be0('0x44')]);return db[_0x2be0('0x59')][_0x2be0('0x47')](_0x49705f);}})[_0x2be0('0x28')](function(_0x2c7c27){if(_0x2c7c27){return db[_0x2be0('0x5e')][_0x2be0('0x5f')]({'where':{'id':_['map'](_0x2c7c27,_0x2be0('0x60')),'role':_0x2be0('0x61')},'attributes':['id',_0x2be0('0x2f'),_0x2be0('0x62'),_0x2be0('0x63'),_0x2be0('0x64')]});}})['then'](function(_0x5b8156){if(_0x5b8156){return{'count':_0x5b8156['count'],'rows':_[_0x2be0('0x36')](_0x5b8156['rows'],function(_0x2a7c67){return{'membername':_0x2a7c67[_0x2be0('0x2f')],'UserId':_0x2a7c67['id'],'queue_name':_0x3c1967['name'],'MailQueueId':_0x3c1967['id'],'interface':util[_0x2be0('0x65')](_0x2be0('0x66'),'SIP',_0x2a7c67[_0x2be0('0x2f')]),'penalty':0x0,'paused':_0x2a7c67[_0x2be0('0x62')],'createdAt':_0x2a7c67[_0x2be0('0x64')],'updatedAt':_0x2a7c67[_0x2be0('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2be0('0x28')](respondWithFilteredResult(_0xc60d86,_0x49705f))[_0x2be0('0x49')](handleError(_0xc60d86,null));};exports['getTeams']=function(_0x2ffce0,_0x1587c,_0x2b1a48){var _0x1a5a7d={};var _0x2b295f={};var _0x2af460;var _0x1219e2;return db[_0x2be0('0x32')][_0x2be0('0x67')]({'where':{'id':_0x2ffce0[_0x2be0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1587c,null))[_0x2be0('0x28')](function(_0x2443a1){if(_0x2443a1){_0x2af460=_0x2443a1;_0x2b295f['model']=_[_0x2be0('0x4c')](db['Team'][_0x2be0('0x33')]);_0x2b295f[_0x2be0('0x37')]=_[_0x2be0('0x4c')](_0x2ffce0[_0x2be0('0x37')]);_0x2b295f[_0x2be0('0x40')]=_[_0x2be0('0x38')](_0x2b295f[_0x2be0('0x39')],_0x2b295f['query']);_0x1a5a7d['attributes']=_[_0x2be0('0x38')](_0x2b295f['model'],qs[_0x2be0('0x3b')](_0x2ffce0[_0x2be0('0x37')][_0x2be0('0x3b')]));_0x1a5a7d[_0x2be0('0x3a')]=_0x1a5a7d[_0x2be0('0x3a')][_0x2be0('0x5a')]?_0x1a5a7d[_0x2be0('0x3a')]:_0x2b295f[_0x2be0('0x39')];_0x1a5a7d['order']=qs[_0x2be0('0x5c')](_0x2ffce0[_0x2be0('0x37')][_0x2be0('0x5c')]);_0x1a5a7d[_0x2be0('0x3e')]=qs[_0x2be0('0x40')](_[_0x2be0('0x3f')](_0x2ffce0['query'],_0x2b295f[_0x2be0('0x40')]));if(_0x2ffce0['query'][_0x2be0('0x41')]){_0x1a5a7d[_0x2be0('0x3e')]=_[_0x2be0('0x42')](_0x1a5a7d['where'],{'$or':_[_0x2be0('0x36')](_0x1a5a7d['attributes'],function(_0x1e0916){var _0xfe066c={};_0xfe066c[_0x1e0916]={'$like':'%'+_0x2ffce0[_0x2be0('0x37')][_0x2be0('0x41')]+'%'};return _0xfe066c;})});}_0x1a5a7d=_[_0x2be0('0x42')]({},_0x1a5a7d,_0x2ffce0[_0x2be0('0x44')]);return _0x2af460['getTeams'](_0x1a5a7d);}})[_0x2be0('0x28')](function(_0x232cfb){if(_0x232cfb){_0x1219e2=_0x232cfb[_0x2be0('0x5a')];if(!_0x2ffce0['query'][_0x2be0('0x3c')](_0x2be0('0x3d'))){_0x1a5a7d['limit']=qs['limit'](_0x2ffce0[_0x2be0('0x37')][_0x2be0('0x21')]);_0x1a5a7d[_0x2be0('0x1f')]=qs['offset'](_0x2ffce0[_0x2be0('0x37')][_0x2be0('0x1f')]);}return _0x2af460['getTeams'](_0x1a5a7d);}})[_0x2be0('0x28')](function(_0x435f5d){if(_0x435f5d){return _0x435f5d?{'count':_0x1219e2,'rows':_0x435f5d}:null;}})[_0x2be0('0x28')](respondWithResult(_0x1587c,null))[_0x2be0('0x49')](handleError(_0x1587c,null));};exports['addTeams']=function(_0x18743b,_0x54b276,_0x22d3c8){var _0x42bc1d=_0x18743b[_0x2be0('0x4e')]['ids'];return db[_0x2be0('0x68')][_0x2be0('0x47')]({'where':{'id':_0x42bc1d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2be0('0x69'),'attributes':['id',_0x2be0('0x2f'),'online',_0x2be0('0x6a'),_0x2be0('0x6b')],'raw':!![]}]})[_0x2be0('0x28')](function(_0x514661){if(_0x514661){var _0x521317=_[_0x2be0('0x6c')](_0x514661,function(_0x10e31f){var _0x5af235=_0x10e31f[_0x2be0('0x2a')]({'plain':!![]});return _0x5af235[_0x2be0('0x69')];});return db[_0x2be0('0x32')][_0x2be0('0x53')]({'where':{'id':_0x18743b['params']['id']}})['then'](function(_0x507172){return db[_0x2be0('0x6d')][_0x2be0('0x6e')](function(_0x49b33c){return _0x507172[_0x2be0('0x6f')](_0x42bc1d,{'transaction':_0x49b33c})[_0x2be0('0x28')](function(){return BPromise['each'](_0x521317,function(_0x29df3a){return db[_0x2be0('0x59')][_0x2be0('0x70')]({'where':{'UserId':_0x29df3a['id'],'MailQueueId':_0x18743b['params']['id']},'transaction':_0x49b33c});});})[_0x2be0('0x28')](function(){_0x521317['forEach'](function(_0x1afa9d){socket[_0x2be0('0x71')](_0x2be0('0x72'),{'UserId':_0x1afa9d['id'],'MailQueueId':_0x507172['id']});});});});});}})[_0x2be0('0x28')](respondWithStatusCode(_0x54b276,null))[_0x2be0('0x49')](handleError(_0x54b276,null));};exports[_0x2be0('0x73')]=function(_0x20bcc3,_0x1316da,_0x56b27b){return db[_0x2be0('0x68')][_0x2be0('0x47')]({'where':{'id':_0x20bcc3[_0x2be0('0x37')][_0x2be0('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2be0('0x69'),'attributes':['id'],'raw':!![]}]})[_0x2be0('0x28')](handleEntityNotFound(_0x1316da,null))[_0x2be0('0x28')](function(_0x4db0e4){var _0x5a65db=_['map'](_0x4db0e4,'id');var _0x11bba8=[];var _0x36bd13=[];var _0x422dea=squel['select']();_0x422dea[_0x2be0('0x75')](_0x2be0('0x76'))[_0x2be0('0x77')](_0x2be0('0x78'),'tq')['join'](_0x2be0('0x79'),'ut',_0x2be0('0x7a'))[_0x2be0('0x3e')](_0x2be0('0x7b'),_0x20bcc3[_0x2be0('0x4b')]['id']);for(var _0x143c9c=0x0;_0x143c9c<_0x4db0e4[_0x2be0('0x5a')];_0x143c9c+=0x1){let _0x127c32=_0x4db0e4[_0x143c9c];for(var _0x284adf=0x0;_0x284adf<_0x127c32['Agents']['length'];_0x284adf+=0x1){let _0x2568fb=_0x127c32['Agents'][_0x284adf];var _0x4d6cb8=_0x422dea['clone']();_0x4d6cb8['where']('ut.UserId\x20=\x20?',_0x2568fb['id']);_0x36bd13['push'](db[_0x2be0('0x6d')][_0x2be0('0x37')](_0x4d6cb8[_0x2be0('0x7c')](),{'type':db['sequelize'][_0x2be0('0x7d')][_0x2be0('0x7e')]})['then'](function(_0x5b2ed3){if(_0x5b2ed3[_0x2be0('0x5a')]===0x1){return _0x2568fb['id'];}else{var _0x27dca5=_['every'](_[_0x2be0('0x36')](_0x5b2ed3,_0x2be0('0x7f')),function(_0x57d8aa){return _[_0x2be0('0x80')](_0x5a65db,_0x57d8aa);});if(_0x27dca5){return _0x2568fb['id'];}}}));}}return BPromise[_0x2be0('0x81')](_0x36bd13)[_0x2be0('0x28')](function(_0x47d62c){_0x11bba8=_(_0x11bba8)[_0x2be0('0x82')](_0x47d62c)[_0x2be0('0x83')]()[_0x2be0('0x84')]();return db['MailQueue'][_0x2be0('0x53')]({'where':{'id':_0x20bcc3['params']['id']}})[_0x2be0('0x28')](function(_0x5f42d1){return db[_0x2be0('0x6d')]['transaction'](function(_0xdc6140){return _0x5f42d1[_0x2be0('0x73')](_0x20bcc3[_0x2be0('0x37')][_0x2be0('0x74')],{'transaction':_0xdc6140})[_0x2be0('0x28')](function(){if(!_[_0x2be0('0x85')](_0x11bba8)){return _0x5f42d1[_0x2be0('0x86')](_0x11bba8,{'transaction':_0xdc6140});}})[_0x2be0('0x28')](function(){_0x11bba8[_0x2be0('0x87')](function(_0x214dbb){socket[_0x2be0('0x71')](_0x2be0('0x88'),{'UserId':_0x214dbb,'MailQueueId':_0x5f42d1['id']});});});});});});})[_0x2be0('0x28')](respondWithStatusCode(_0x1316da,null))[_0x2be0('0x49')](handleError(_0x1316da,null));};exports[_0x2be0('0x89')]=function(_0x396f2b,_0x9affdc,_0x50b403){return db['MailQueue'][_0x2be0('0x53')]({'where':{'id':_0x396f2b['params']['id']}})[_0x2be0('0x28')](handleEntityNotFound(_0x9affdc,null))[_0x2be0('0x28')](function(_0x54d820){if(_0x54d820){return _0x54d820[_0x2be0('0x89')](_0x396f2b[_0x2be0('0x4e')][_0x2be0('0x74')],_['omit'](_0x396f2b['body'],[_0x2be0('0x74'),'id'])||{})[_0x2be0('0x8a')](function(_0x4cc18){for(var _0x1d3ecc=0x0;_0x1d3ecc<_0x396f2b[_0x2be0('0x4e')][_0x2be0('0x74')][_0x2be0('0x5a')];_0x1d3ecc+=0x1){socket['emit'](_0x2be0('0x72'),{'UserId':Number(_0x396f2b[_0x2be0('0x4e')][_0x2be0('0x74')][_0x1d3ecc]),'MailQueueId':Number(_0x396f2b[_0x2be0('0x4b')]['id'])});}return _0x4cc18;});}})[_0x2be0('0x28')](respondWithResult(_0x9affdc,null))[_0x2be0('0x49')](handleError(_0x9affdc,null));};exports[_0x2be0('0x86')]=function(_0x2911be,_0x22c1cb,_0x39454a){return db[_0x2be0('0x32')][_0x2be0('0x53')]({'where':{'id':_0x2911be[_0x2be0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22c1cb,null))[_0x2be0('0x28')](function(_0x3481de){if(_0x3481de){return _0x3481de[_0x2be0('0x86')](_0x2911be['query'][_0x2be0('0x74')])['then'](function(){if(_['isArray'](_0x2911be[_0x2be0('0x37')][_0x2be0('0x74')])){for(var _0x48b2ca=0x0;_0x48b2ca<_0x2911be[_0x2be0('0x37')]['ids'][_0x2be0('0x5a')];_0x48b2ca+=0x1){socket['emit'](_0x2be0('0x88'),{'UserId':Number(_0x2911be[_0x2be0('0x37')]['ids'][_0x48b2ca]),'MailQueueId':Number(_0x2911be['params']['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x2911be['query'][_0x2be0('0x74')]),'MailQueueId':Number(_0x2911be[_0x2be0('0x4b')]['id'])});}});}})[_0x2be0('0x28')](respondWithStatusCode(_0x22c1cb,null))[_0x2be0('0x49')](handleError(_0x22c1cb,null));};exports[_0x2be0('0x8b')]=function(_0x727db2,_0x22af59,_0x2844a2){var _0x5d301c={};var _0x193fd1={};var _0x59f389;var _0x1febe2;return db['MailQueue']['findOne']({'where':{'id':_0x727db2[_0x2be0('0x4b')]['id']}})[_0x2be0('0x28')](handleEntityNotFound(_0x22af59,null))[_0x2be0('0x28')](function(_0x1d2e90){if(_0x1d2e90){_0x59f389=_0x1d2e90;_0x193fd1[_0x2be0('0x39')]=_[_0x2be0('0x4c')](db[_0x2be0('0x5e')][_0x2be0('0x33')]);_0x193fd1[_0x2be0('0x37')]=_[_0x2be0('0x4c')](_0x727db2[_0x2be0('0x37')]);_0x193fd1['filters']=_[_0x2be0('0x38')](_0x193fd1['model'],_0x193fd1['query']);_0x5d301c['attributes']=_['intersection'](_0x193fd1['model'],qs[_0x2be0('0x3b')](_0x727db2[_0x2be0('0x37')]['fields']));_0x5d301c[_0x2be0('0x3a')]=_0x5d301c[_0x2be0('0x3a')][_0x2be0('0x5a')]?_0x5d301c[_0x2be0('0x3a')]:_0x193fd1[_0x2be0('0x39')];_0x5d301c['order']=qs[_0x2be0('0x5c')](_0x727db2[_0x2be0('0x37')]['sort']);_0x5d301c[_0x2be0('0x3e')]=qs['filters'](_[_0x2be0('0x3f')](_0x727db2[_0x2be0('0x37')],_0x193fd1['filters']));if(_0x727db2[_0x2be0('0x37')]['filter']){_0x5d301c[_0x2be0('0x3e')]=_[_0x2be0('0x42')](_0x5d301c['where'],{'$or':_[_0x2be0('0x36')](_0x5d301c[_0x2be0('0x3a')],function(_0x187da7){var _0x12220f={};_0x12220f[_0x187da7]={'$like':'%'+_0x727db2[_0x2be0('0x37')][_0x2be0('0x41')]+'%'};return _0x12220f;})});}_0x5d301c=_['merge']({},_0x5d301c,_0x727db2['options']);return _0x59f389[_0x2be0('0x8b')](_0x5d301c);}})[_0x2be0('0x28')](function(_0x53a041){if(_0x53a041){_0x1febe2=_0x53a041['length'];if(!_0x727db2[_0x2be0('0x37')][_0x2be0('0x3c')](_0x2be0('0x3d'))){_0x5d301c['limit']=qs[_0x2be0('0x21')](_0x727db2['query'][_0x2be0('0x21')]);_0x5d301c[_0x2be0('0x1f')]=qs[_0x2be0('0x1f')](_0x727db2[_0x2be0('0x37')][_0x2be0('0x1f')]);}return _0x59f389[_0x2be0('0x8b')](_0x5d301c);}})['then'](function(_0x11be59){if(_0x11be59){return _0x11be59?{'count':_0x1febe2,'rows':_0x11be59}:null;}})['then'](respondWithResult(_0x22af59,null))['catch'](handleError(_0x22af59,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f8d1498..b249ed6 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 _0x415f=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x1ab459,_0x4b2402){var _0x4df14c=function(_0x671b81){while(--_0x671b81){_0x1ab459['push'](_0x1ab459['shift']());}};_0x4df14c(++_0x4b2402);}(_0x415f,0x99));var _0xf415=function(_0x1a1e45,_0x5a7504){_0x1a1e45=_0x1a1e45-0x0;var _0x4270d0=_0x415f[_0x1a1e45];return _0x4270d0;};'use strict';var EventEmitter=require(_0xf415('0x0'));var MailQueue=require(_0xf415('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf415('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf415('0x3')};function emitEvent(_0x1cfb1a){return function(_0x1d8267,_0x4c579e,_0x468118){MailQueueEvents[_0xf415('0x4')](_0x1cfb1a+':'+_0x1d8267['id'],_0x1d8267);MailQueueEvents[_0xf415('0x4')](_0x1cfb1a,_0x1d8267);_0x468118(null);};}for(var e in events){if(events[_0xf415('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xf415('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x21b9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21b9,0x9c));var _0x921b=function(_0x436813,_0x4119de){_0x436813=_0x436813-0x0;var _0x5350c8=_0x21b9[_0x436813];return _0x5350c8;};'use strict';var EventEmitter=require(_0x921b('0x0'));var MailQueue=require(_0x921b('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x921b('0x2')](0x0);var events={'afterCreate':_0x921b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a080d){return function(_0x335a80,_0x4ba0cf,_0x359d98){MailQueueEvents['emit'](_0x1a080d+':'+_0x335a80['id'],_0x335a80);MailQueueEvents[_0x921b('0x4')](_0x1a080d,_0x335a80);_0x359d98(null);};}for(var e in events){if(events[_0x921b('0x5')](e)){var event=events[e];MailQueue[_0x921b('0x6')](e,emitEvent(event));}}module[_0x921b('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 8f096dd..d1eec91 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 _0xc560=['bluebird','path','rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','../../config/logger'];(function(_0xeb10d1,_0x2a981f){var _0x17cd8f=function(_0xee6f74){while(--_0xee6f74){_0xeb10d1['push'](_0xeb10d1['shift']());}};_0x17cd8f(++_0x2a981f);}(_0xc560,0xe4));var _0x0c56=function(_0x406cc0,_0x224994){_0x406cc0=_0x406cc0-0x0;var _0x3e8aaf=_0xc560[_0x406cc0];return _0x3e8aaf;};'use strict';var _=require(_0x0c56('0x0'));var util=require('util');var logger=require(_0x0c56('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0c56('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c56('0x3'));var rimraf=require(_0x0c56('0x4'));var config=require(_0x0c56('0x5'));var attributes=require('./mailQueue.attributes');module[_0x0c56('0x6')]=function(_0x39a640,_0x49c312){return _0x39a640[_0x0c56('0x7')](_0x0c56('0x8'),attributes,{'tableName':_0x0c56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x147f=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x147f,0x10d));var _0xf147=function(_0x2ef8dd,_0x2181f5){_0x2ef8dd=_0x2ef8dd-0x0;var _0x192357=_0x147f[_0x2ef8dd];return _0x192357;};'use strict';var _=require(_0xf147('0x0'));var util=require(_0xf147('0x1'));var logger=require(_0xf147('0x2'))(_0xf147('0x3'));var moment=require('moment');var BPromise=require(_0xf147('0x4'));var rp=require(_0xf147('0x5'));var fs=require('fs');var path=require(_0xf147('0x6'));var rimraf=require('rimraf');var config=require(_0xf147('0x7'));var attributes=require(_0xf147('0x8'));module[_0xf147('0x9')]=function(_0x3a8266,_0x31acd2){return _0x3a8266[_0xf147('0xa')](_0xf147('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 0d312b8..842086a 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 _0x9bb4=['result','GetMailQueue','MailQueue','options','where','include','model','attributes','map','then','catch','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x9bb4,0xd5));var _0x49bb=function(_0x14544f,_0x47b658){_0x14544f=_0x14544f-0x0;var _0x25a237=_0x9bb4[_0x14544f];return _0x25a237;};'use strict';var _=require(_0x49bb('0x0'));var util=require(_0x49bb('0x1'));var moment=require(_0x49bb('0x2'));var BPromise=require(_0x49bb('0x3'));var rs=require(_0x49bb('0x4'));var fs=require('fs');var Redis=require(_0x49bb('0x5'));var db=require(_0x49bb('0x6'))['db'];var utils=require(_0x49bb('0x7'));var logger=require(_0x49bb('0x8'))('rpc');var config=require(_0x49bb('0x9'));var jayson=require(_0x49bb('0xa'));var client=jayson[_0x49bb('0xb')][_0x49bb('0xc')]({'port':0x232a});config['redis']=_[_0x49bb('0xd')](config[_0x49bb('0xe')],{'host':_0x49bb('0xf'),'port':0x18eb});var socket=require(_0x49bb('0x10'))(new Redis(config[_0x49bb('0xe')]));require('./mailQueue.socket')[_0x49bb('0x11')](socket);function respondWithRpcPromise(_0x4d6ec7,_0x245b5e,_0x1708d4){return new BPromise(function(_0x561e59,_0x2de0ba){return client['request'](_0x4d6ec7,_0x1708d4)['then'](function(_0x50ad46){logger['info'](_0x49bb('0x12'),_0x245b5e,_0x49bb('0x13'));logger[_0x49bb('0x14')](_0x49bb('0x15'),_0x245b5e,_0x49bb('0x13'),JSON[_0x49bb('0x16')](_0x50ad46));if(_0x50ad46[_0x49bb('0x17')]){if(_0x50ad46[_0x49bb('0x17')][_0x49bb('0x18')]===0x1f4){logger['error'](_0x49bb('0x12'),_0x245b5e,_0x50ad46['error'][_0x49bb('0x19')]);return _0x2de0ba(_0x50ad46[_0x49bb('0x17')][_0x49bb('0x19')]);}logger[_0x49bb('0x17')](_0x49bb('0x12'),_0x245b5e,_0x50ad46[_0x49bb('0x17')][_0x49bb('0x19')]);return _0x561e59(_0x50ad46[_0x49bb('0x17')]['message']);}else{logger[_0x49bb('0x1a')](_0x49bb('0x12'),_0x245b5e,'request\x20sent');_0x561e59(_0x50ad46[_0x49bb('0x1b')][_0x49bb('0x19')]);}})['catch'](function(_0x381eed){logger[_0x49bb('0x17')]('MailQueue,\x20%s,\x20%s',_0x245b5e,_0x381eed);_0x2de0ba(_0x381eed);});});}exports[_0x49bb('0x1c')]=function(_0x8ea413){var _0x586085=this;return new Promise(function(_0xc1d3bb,_0x5387ed){return db[_0x49bb('0x1d')]['findAll']({'raw':_0x8ea413['options']?_0x8ea413[_0x49bb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x8ea413['options']?_0x8ea413[_0x49bb('0x1e')][_0x49bb('0x1f')]||null:null,'attributes':_0x8ea413[_0x49bb('0x1e')]?_0x8ea413[_0x49bb('0x1e')]['attributes']||null:null,'limit':_0x8ea413['options']?_0x8ea413['options']['limit']||null:null,'include':_0x8ea413['options']?_0x8ea413[_0x49bb('0x1e')]['include']?_['map'](_0x8ea413[_0x49bb('0x1e')][_0x49bb('0x20')],function(_0x341bd9){return{'model':db[_0x341bd9[_0x49bb('0x21')]],'as':_0x341bd9['as'],'attributes':_0x341bd9[_0x49bb('0x22')],'include':_0x341bd9['include']?_[_0x49bb('0x23')](_0x341bd9[_0x49bb('0x20')],function(_0x1a6afb){return{'model':db[_0x1a6afb[_0x49bb('0x21')]],'as':_0x1a6afb['as'],'attributes':_0x1a6afb['attributes'],'include':_0x1a6afb[_0x49bb('0x20')]?_[_0x49bb('0x23')](_0x1a6afb[_0x49bb('0x20')],function(_0x47540c){return{'model':db[_0x47540c['model']],'as':_0x47540c['as'],'attributes':_0x47540c[_0x49bb('0x22')]};}):[]};}):[]};}):[]:[]})[_0x49bb('0x24')](function(_0x3ab8a8){logger[_0x49bb('0x1a')]('GetMailQueue',_0x8ea413);logger[_0x49bb('0x14')](_0x49bb('0x1c'),_0x8ea413,JSON['stringify'](_0x3ab8a8));_0xc1d3bb(_0x3ab8a8);})[_0x49bb('0x25')](function(_0x56b65b){logger[_0x49bb('0x17')](_0x49bb('0x1c'),_0x56b65b['message'],_0x8ea413);_0x5387ed(_0x586085[_0x49bb('0x17')](0x1f4,_0x56b65b[_0x49bb('0x19')]));});});};exports['ShowMailQueue']=function(_0x28629f){var _0x6f2294=this;return new Promise(function(_0x14af93,_0x3993c0){return db[_0x49bb('0x1d')][_0x49bb('0x26')]({'raw':_0x28629f[_0x49bb('0x1e')]?_0x28629f[_0x49bb('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x28629f[_0x49bb('0x1e')]?_0x28629f[_0x49bb('0x1e')][_0x49bb('0x1f')]||null:null,'attributes':_0x28629f[_0x49bb('0x1e')]?_0x28629f['options'][_0x49bb('0x22')]||null:null,'include':_0x28629f['options']?_0x28629f[_0x49bb('0x1e')]['include']?_[_0x49bb('0x23')](_0x28629f['options'][_0x49bb('0x20')],function(_0x1a24f3){return{'model':db[_0x1a24f3['model']],'as':_0x1a24f3['as'],'attributes':_0x1a24f3['attributes'],'include':_0x1a24f3['include']?_['map'](_0x1a24f3['include'],function(_0x26cc95){return{'model':db[_0x26cc95[_0x49bb('0x21')]],'as':_0x26cc95['as'],'attributes':_0x26cc95[_0x49bb('0x22')],'include':_0x26cc95[_0x49bb('0x20')]?_[_0x49bb('0x23')](_0x26cc95[_0x49bb('0x20')],function(_0x1025c5){return{'model':db[_0x1025c5['model']],'as':_0x1025c5['as'],'attributes':_0x1025c5['attributes']};}):[]};}):[]};}):[]:[]})[_0x49bb('0x24')](function(_0xd98017){logger['info'](_0x49bb('0x27'),_0x28629f);logger[_0x49bb('0x14')]('ShowMailQueue',_0x28629f,JSON['stringify'](_0xd98017));_0x14af93(_0xd98017);})[_0x49bb('0x25')](function(_0x50e7de){logger[_0x49bb('0x17')](_0x49bb('0x27'),_0x50e7de[_0x49bb('0x19')],_0x28629f);_0x3993c0(_0x6f2294[_0x49bb('0x17')](0x1f4,_0x50e7de[_0x49bb('0x19')]));});});}; \ No newline at end of file +var _0x6a11=['rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailQueue','options','where','attributes','include','map','model','GetMailQueue','debug','ShowMailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6a11,0xc0));var _0x16a1=function(_0x4c1e6b,_0x462e31){_0x4c1e6b=_0x4c1e6b-0x0;var _0x37791f=_0x6a11[_0x4c1e6b];return _0x37791f;};'use strict';var _=require(_0x16a1('0x0'));var util=require('util');var moment=require(_0x16a1('0x1'));var BPromise=require(_0x16a1('0x2'));var rs=require(_0x16a1('0x3'));var fs=require('fs');var Redis=require(_0x16a1('0x4'));var db=require(_0x16a1('0x5'))['db'];var utils=require(_0x16a1('0x6'));var logger=require(_0x16a1('0x7'))(_0x16a1('0x8'));var config=require('../../config/environment');var jayson=require(_0x16a1('0x9'));var client=jayson[_0x16a1('0xa')]['http']({'port':0x232a});config[_0x16a1('0xb')]=_[_0x16a1('0xc')](config[_0x16a1('0xb')],{'host':_0x16a1('0xd'),'port':0x18eb});var socket=require(_0x16a1('0xe'))(new Redis(config['redis']));require(_0x16a1('0xf'))[_0x16a1('0x10')](socket);function respondWithRpcPromise(_0x13d53d,_0x24cc16,_0x5a32f6){return new BPromise(function(_0x1bd59e,_0x2203fc){return client[_0x16a1('0x11')](_0x13d53d,_0x5a32f6)[_0x16a1('0x12')](function(_0x5356cc){logger['info'](_0x16a1('0x13'),_0x24cc16,_0x16a1('0x14'));logger['debug'](_0x16a1('0x15'),_0x24cc16,_0x16a1('0x14'),JSON[_0x16a1('0x16')](_0x5356cc));if(_0x5356cc[_0x16a1('0x17')]){if(_0x5356cc['error'][_0x16a1('0x18')]===0x1f4){logger[_0x16a1('0x17')](_0x16a1('0x13'),_0x24cc16,_0x5356cc['error'][_0x16a1('0x19')]);return _0x2203fc(_0x5356cc[_0x16a1('0x17')]['message']);}logger[_0x16a1('0x17')]('MailQueue,\x20%s,\x20%s',_0x24cc16,_0x5356cc['error']['message']);return _0x1bd59e(_0x5356cc['error'][_0x16a1('0x19')]);}else{logger[_0x16a1('0x1a')]('MailQueue,\x20%s,\x20%s',_0x24cc16,'request\x20sent');_0x1bd59e(_0x5356cc[_0x16a1('0x1b')][_0x16a1('0x19')]);}})[_0x16a1('0x1c')](function(_0x17f8fe){logger['error']('MailQueue,\x20%s,\x20%s',_0x24cc16,_0x17f8fe);_0x2203fc(_0x17f8fe);});});}exports['GetMailQueue']=function(_0xed52cd){var _0xb4e575=this;return new Promise(function(_0x2ddd63,_0x4a9a94){return db[_0x16a1('0x1d')]['findAll']({'raw':_0xed52cd[_0x16a1('0x1e')]?_0xed52cd[_0x16a1('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xed52cd[_0x16a1('0x1e')]?_0xed52cd[_0x16a1('0x1e')][_0x16a1('0x1f')]||null:null,'attributes':_0xed52cd[_0x16a1('0x1e')]?_0xed52cd['options'][_0x16a1('0x20')]||null:null,'limit':_0xed52cd[_0x16a1('0x1e')]?_0xed52cd['options']['limit']||null:null,'include':_0xed52cd['options']?_0xed52cd[_0x16a1('0x1e')][_0x16a1('0x21')]?_[_0x16a1('0x22')](_0xed52cd[_0x16a1('0x1e')]['include'],function(_0x5483c7){return{'model':db[_0x5483c7[_0x16a1('0x23')]],'as':_0x5483c7['as'],'attributes':_0x5483c7['attributes'],'include':_0x5483c7['include']?_['map'](_0x5483c7[_0x16a1('0x21')],function(_0x2eea88){return{'model':db[_0x2eea88[_0x16a1('0x23')]],'as':_0x2eea88['as'],'attributes':_0x2eea88[_0x16a1('0x20')],'include':_0x2eea88[_0x16a1('0x21')]?_[_0x16a1('0x22')](_0x2eea88[_0x16a1('0x21')],function(_0x185cf4){return{'model':db[_0x185cf4['model']],'as':_0x185cf4['as'],'attributes':_0x185cf4[_0x16a1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x16a1('0x12')](function(_0x416582){logger[_0x16a1('0x1a')](_0x16a1('0x24'),_0xed52cd);logger[_0x16a1('0x25')](_0x16a1('0x24'),_0xed52cd,JSON[_0x16a1('0x16')](_0x416582));_0x2ddd63(_0x416582);})['catch'](function(_0x40078c){logger['error'](_0x16a1('0x24'),_0x40078c[_0x16a1('0x19')],_0xed52cd);_0x4a9a94(_0xb4e575[_0x16a1('0x17')](0x1f4,_0x40078c['message']));});});};exports[_0x16a1('0x26')]=function(_0x134794){var _0x335df9=this;return new Promise(function(_0x4f0ff1,_0x445463){return db[_0x16a1('0x1d')][_0x16a1('0x27')]({'raw':_0x134794[_0x16a1('0x1e')]?_0x134794[_0x16a1('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x134794[_0x16a1('0x1e')]?_0x134794['options'][_0x16a1('0x1f')]||null:null,'attributes':_0x134794[_0x16a1('0x1e')]?_0x134794[_0x16a1('0x1e')][_0x16a1('0x20')]||null:null,'include':_0x134794[_0x16a1('0x1e')]?_0x134794[_0x16a1('0x1e')][_0x16a1('0x21')]?_['map'](_0x134794[_0x16a1('0x1e')][_0x16a1('0x21')],function(_0x10f042){return{'model':db[_0x10f042['model']],'as':_0x10f042['as'],'attributes':_0x10f042[_0x16a1('0x20')],'include':_0x10f042[_0x16a1('0x21')]?_['map'](_0x10f042['include'],function(_0x1d4de3){return{'model':db[_0x1d4de3[_0x16a1('0x23')]],'as':_0x1d4de3['as'],'attributes':_0x1d4de3[_0x16a1('0x20')],'include':_0x1d4de3['include']?_[_0x16a1('0x22')](_0x1d4de3[_0x16a1('0x21')],function(_0x56cdf2){return{'model':db[_0x56cdf2[_0x16a1('0x23')]],'as':_0x56cdf2['as'],'attributes':_0x56cdf2[_0x16a1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x16a1('0x12')](function(_0x304b80){logger[_0x16a1('0x1a')]('ShowMailQueue',_0x134794);logger[_0x16a1('0x25')]('ShowMailQueue',_0x134794,JSON['stringify'](_0x304b80));_0x4f0ff1(_0x304b80);})['catch'](function(_0x22fe41){logger[_0x16a1('0x17')](_0x16a1('0x26'),_0x22fe41[_0x16a1('0x19')],_0x134794);_0x445463(_0x335df9[_0x16a1('0x17')](0x1f4,_0x22fe41[_0x16a1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 367493c..e4ad98c 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 _0xf12a=['length','mailQueue:','./mailQueue.events','save','remove','update','register'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xf12a,0x8e));var _0xaf12=function(_0x292688,_0x4ed5d4){_0x292688=_0x292688-0x0;var _0x12f117=_0xf12a[_0x292688];return _0x12f117;};'use strict';var MailQueueEvents=require(_0xaf12('0x0'));var events=[_0xaf12('0x1'),_0xaf12('0x2'),_0xaf12('0x3')];function createListener(_0x38e2c1,_0x205455){return function(_0x193278){_0x205455['emit'](_0x38e2c1,_0x193278);};}function removeListener(_0x5b7b5b,_0x1b1d82){return function(){MailQueueEvents['removeListener'](_0x5b7b5b,_0x1b1d82);};}exports[_0xaf12('0x4')]=function(_0x581be3){for(var _0x17c0c8=0x0,_0x581819=events[_0xaf12('0x5')];_0x17c0c8<_0x581819;_0x17c0c8++){var _0x418c64=events[_0x17c0c8];var _0x3b6626=createListener(_0xaf12('0x6')+_0x418c64,_0x581be3);MailQueueEvents['on'](_0x418c64,_0x3b6626);}}; \ No newline at end of file +var _0x0be2=['update','removeListener','register','length','mailQueue:','remove'];(function(_0xcb56d2,_0x18c194){var _0x57bed4=function(_0x194ed8){while(--_0x194ed8){_0xcb56d2['push'](_0xcb56d2['shift']());}};_0x57bed4(++_0x18c194);}(_0x0be2,0x8f));var _0x20be=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0be2[_0x4792c8];return _0x35edb1;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x20be('0x0'),_0x20be('0x1')];function createListener(_0x43cfea,_0x9e9d5b){return function(_0x1168c4){_0x9e9d5b['emit'](_0x43cfea,_0x1168c4);};}function removeListener(_0xbc9bff,_0x5de6ce){return function(){MailQueueEvents[_0x20be('0x2')](_0xbc9bff,_0x5de6ce);};}exports[_0x20be('0x3')]=function(_0x14f8c2){for(var _0x2c5262=0x0,_0x494951=events[_0x20be('0x4')];_0x2c5262<_0x494951;_0x2c5262++){var _0x3bd3f4=events[_0x2c5262];var _0x16e122=createListener(_0x20be('0x5')+_0x3bd3f4,_0x14f8c2);MailQueueEvents['on'](_0x3bd3f4,_0x16e122);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7c24486..dda89ec 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 _0xeff2=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x31be8f,_0x27f909){var _0x248860=function(_0x4de002){while(--_0x4de002){_0x31be8f['push'](_0x31be8f['shift']());}};_0x248860(++_0x27f909);}(_0xeff2,0x1a0));var _0x2eff=function(_0x450907,_0x446cb9){_0x450907=_0x450907-0x0;var _0x1242a5=_0xeff2[_0x450907];return _0x1242a5;};'use strict';var multer=require(_0x2eff('0x0'));var util=require(_0x2eff('0x1'));var path=require(_0x2eff('0x2'));var timeout=require(_0x2eff('0x3'));var express=require(_0x2eff('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2eff('0x5'));var interaction=require(_0x2eff('0x6'));var config=require(_0x2eff('0x7'));var controller=require(_0x2eff('0x8'));router[_0x2eff('0x9')]('/',auth[_0x2eff('0xa')](),controller[_0x2eff('0xb')]);router['get'](_0x2eff('0xc'),auth[_0x2eff('0xa')](),controller[_0x2eff('0xd')]);router[_0x2eff('0x9')](_0x2eff('0xe'),auth['isAuthenticated'](),controller[_0x2eff('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2eff('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2eff('0x11')](_0x2eff('0xe'),auth['isAuthenticated'](),controller[_0x2eff('0x12')]);module[_0x2eff('0x13')]=router; \ No newline at end of file +var _0x8447=['./mailQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x13a8c3,_0x1fc14b){var _0x5b62a5=function(_0x2e7fcf){while(--_0x2e7fcf){_0x13a8c3['push'](_0x13a8c3['shift']());}};_0x5b62a5(++_0x1fc14b);}(_0x8447,0xfa));var _0x7844=function(_0x2563b5,_0x572e07){_0x2563b5=_0x2563b5-0x0;var _0x4f8155=_0x8447[_0x2563b5];return _0x4f8155;};'use strict';var multer=require(_0x7844('0x0'));var util=require(_0x7844('0x1'));var path=require(_0x7844('0x2'));var timeout=require(_0x7844('0x3'));var express=require(_0x7844('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7844('0x5'));router[_0x7844('0x6')]('/',auth[_0x7844('0x7')](),controller[_0x7844('0x8')]);router['get'](_0x7844('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x7844('0x6')]('/:id',auth[_0x7844('0x7')](),controller[_0x7844('0xa')]);router[_0x7844('0xb')]('/',auth[_0x7844('0x7')](),controller[_0x7844('0xc')]);router['put'](_0x7844('0xd'),auth[_0x7844('0x7')](),controller[_0x7844('0xe')]);router[_0x7844('0xf')](_0x7844('0xd'),auth['isAuthenticated'](),controller[_0x7844('0x10')]);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 64dd64c..3a37eca 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 _0x45fd=['sequelize','exports','STRING','DATE'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x45fd,0xa4));var _0xd45f=function(_0x4ae524,_0x5b869d){_0x4ae524=_0x4ae524-0x0;var _0x54ebd3=_0x45fd[_0x4ae524];return _0x54ebd3;};'use strict';var moment=require('moment');var Sequelize=require(_0xd45f('0x0'));module[_0xd45f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd45f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd45f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd45f('0x3')]},'reason':{'type':Sequelize[_0xd45f('0x2')]}}; \ No newline at end of file +var _0x91c6=['moment','STRING','DATE'];(function(_0x318f46,_0x3ed5a9){var _0x125f88=function(_0x388844){while(--_0x388844){_0x318f46['push'](_0x318f46['shift']());}};_0x125f88(++_0x3ed5a9);}(_0x91c6,0xf9));var _0x691c=function(_0x1303c8,_0x1b6777){_0x1303c8=_0x1303c8-0x0;var _0x224caa=_0x91c6[_0x1303c8];return _0x224caa;};'use strict';var moment=require(_0x691c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x691c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x691c('0x1')]},'joinAt':{'type':Sequelize[_0x691c('0x2')]},'leaveAt':{'type':Sequelize[_0x691c('0x2')]},'acceptAt':{'type':Sequelize[_0x691c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x691c('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 49adf6b..8ef4655 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 _0x6343=['VIRTUAL','options','MailQueueReport','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x6343,0x168));var _0x3634=function(_0x1b69e7,_0x69f428){_0x1b69e7=_0x1b69e7-0x0;var _0x263ee3=_0x6343[_0x1b69e7];return _0x263ee3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['MailQueueReport'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':!![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['MailQueueReport'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','MailQueueReport','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','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','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x1623,0xab));var _0x3162=function(_0x54c9de,_0x33ffcb){_0x54c9de=_0x54c9de-0x0;var _0x24afe9=_0x1623[_0x54c9de];return _0x24afe9;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['MailQueueReport'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['MailQueueReport'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 9300dd0..0fd6aeb 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 _0x7f94=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x7f94,0x65));var _0x47f9=function(_0x4828a1,_0xa71f0c){_0x4828a1=_0x4828a1-0x0;var _0x9e2ffd=_0x7f94[_0x4828a1];return _0x9e2ffd;};'use strict';var _=require(_0x47f9('0x0'));var util=require('util');var logger=require(_0x47f9('0x1'))(_0x47f9('0x2'));var moment=require(_0x47f9('0x3'));var BPromise=require(_0x47f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47f9('0x5'));var rimraf=require(_0x47f9('0x6'));var config=require(_0x47f9('0x7'));var attributes=require(_0x47f9('0x8'));module[_0x47f9('0x9')]=function(_0xfba0ba,_0x386d8f){return _0xfba0ba['define'](_0x47f9('0xa'),attributes,{'tableName':_0x47f9('0xb'),'paranoid':![],'indexes':[{'name':_0x47f9('0xc'),'fields':[_0x47f9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f59=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x2b6f54,_0xca757c){var _0x3f0ab7=function(_0xada643){while(--_0xada643){_0x2b6f54['push'](_0x2b6f54['shift']());}};_0x3f0ab7(++_0xca757c);}(_0x7f59,0x12e));var _0x97f5=function(_0x5cf945,_0x1722aa){_0x5cf945=_0x5cf945-0x0;var _0x4a09ce=_0x7f59[_0x5cf945];return _0x4a09ce;};'use strict';var _=require(_0x97f5('0x0'));var util=require(_0x97f5('0x1'));var logger=require('../../config/logger')(_0x97f5('0x2'));var moment=require(_0x97f5('0x3'));var BPromise=require(_0x97f5('0x4'));var rp=require(_0x97f5('0x5'));var fs=require('fs');var path=require(_0x97f5('0x6'));var rimraf=require(_0x97f5('0x7'));var config=require(_0x97f5('0x8'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x498110,_0x5d7027){return _0x498110[_0x97f5('0x9')](_0x97f5('0xa'),attributes,{'tableName':_0x97f5('0xb'),'paranoid':![],'indexes':[{'name':_0x97f5('0xc'),'fields':[_0x97f5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 5c44b4f..ce5d360 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x8a092,_0x175c11){var _0x39bbec=function(_0x4b13c8){while(--_0x4b13c8){_0x8a092['push'](_0x8a092['shift']());}};_0x39bbec(++_0x175c11);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0xf9fa79,_0xcb6d65){var _0xb868a6=function(_0x22481c){while(--_0x22481c){_0xf9fa79['push'](_0xf9fa79['shift']());}};_0xb868a6(++_0xcb6d65);}(_0xdb28,0x106));var _0x8db2=function(_0x35456c,_0xb56142){_0x35456c=_0x35456c-0x0;var _0x4a14ac=_0xdb28[_0x35456c];return _0x4a14ac;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cbf6122..11e983f 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3f761d,_0x5d907d){var _0x49d6e3=function(_0x39ab43){while(--_0x39ab43){_0x3f761d['push'](_0x3f761d['shift']());}};_0x49d6e3(++_0x5d907d);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5c63bc,_0x51c676){var _0x62604=function(_0x5ac8d7){while(--_0x5ac8d7){_0x5c63bc['push'](_0x5c63bc['shift']());}};_0x62604(++_0x51c676);}(_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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8a30aa1..f7934a7 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 _0xab40=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x4e11fb,_0x4cd66c){var _0x6a4a3d=function(_0x58d9d2){while(--_0x58d9d2){_0x4e11fb['push'](_0x4e11fb['shift']());}};_0x6a4a3d(++_0x4cd66c);}(_0xab40,0xcd));var _0x0ab4=function(_0x146910,_0x2552da){_0x146910=_0x146910-0x0;var _0x44a6c8=_0xab40[_0x146910];return _0x44a6c8;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x0ab4('0x2')]},'password':{'type':Sequelize[_0x0ab4('0x2')]},'port':{'type':Sequelize[_0x0ab4('0x3')]},'tls':{'type':Sequelize[_0x0ab4('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0ab4('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0ab4('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe1e3=['exports','STRING','BOOLEAN','INBOX','INTEGER','sequelize'];(function(_0x5d3d39,_0x5ed8a1){var _0x2de363=function(_0x450907){while(--_0x450907){_0x5d3d39['push'](_0x5d3d39['shift']());}};_0x2de363(++_0x5ed8a1);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4e8448,_0x3f1844){_0x4e8448=_0x4e8448-0x0;var _0x2bf6b5=_0xe1e3[_0x4e8448];return _0x2bf6b5;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3e1e('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3e1e('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3e1e('0x2')],'defaultValue':_0x3e1e('0x4')},'connTimeout':{'type':Sequelize[_0x3e1e('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3e1e('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3e1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7e74e89..ed765c5 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 _0x1d80=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','util','moment'];(function(_0x401900,_0x504206){var _0x241cfb=function(_0x4dc931){while(--_0x4dc931){_0x401900['push'](_0x401900['shift']());}};_0x241cfb(++_0x504206);}(_0x1d80,0x105));var _0x01d8=function(_0x3d962b,_0x4c7d80){_0x3d962b=_0x3d962b-0x0;var _0x4cdc0e=_0x1d80[_0x3d962b];return _0x4cdc0e;};'use strict';var _=require(_0x01d8('0x0'));var util=require(_0x01d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01d8('0x2'));var BPromise=require(_0x01d8('0x3'));var rp=require(_0x01d8('0x4'));var fs=require('fs');var path=require(_0x01d8('0x5'));var rimraf=require(_0x01d8('0x6'));var config=require(_0x01d8('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x01d8('0x8')]=function(_0x3bb03c,_0x25c7c8){return _0x3bb03c[_0x01d8('0x9')](_0x01d8('0xa'),attributes,{'tableName':_0x01d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b45=['request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','bluebird'];(function(_0x36de9b,_0x5b9e9c){var _0x4baf2f=function(_0x229aa7){while(--_0x229aa7){_0x36de9b['push'](_0x36de9b['shift']());}};_0x4baf2f(++_0x5b9e9c);}(_0x5b45,0x17d));var _0x55b4=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x5b45[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var logger=require(_0x55b4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x55b4('0x3'));var rp=require(_0x55b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55b4('0x5'));var config=require('../../config/environment');var attributes=require(_0x55b4('0x6'));module[_0x55b4('0x7')]=function(_0x27c11f,_0x53ef03){return _0x27c11f[_0x55b4('0x8')](_0x55b4('0x9'),attributes,{'tableName':_0x55b4('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 a598ea7..f47a1b9 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 _0x8d79=['debug','error','message','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','map','include','model','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x54d50f,_0x14a8b0){var _0x54245e=function(_0x212efb){while(--_0x212efb){_0x54d50f['push'](_0x54d50f['shift']());}};_0x54245e(++_0x14a8b0);}(_0x8d79,0x10a));var _0x98d7=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x8d79[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x98d7('0x0'));var util=require(_0x98d7('0x1'));var moment=require(_0x98d7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98d7('0x3'));var db=require(_0x98d7('0x4'))['db'];var utils=require(_0x98d7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x98d7('0x6'));var client=jayson[_0x98d7('0x7')][_0x98d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4344,_0x5e041d,_0x448a6d){return new BPromise(function(_0x53faf2,_0x38b639){return client[_0x98d7('0x9')](_0x2d4344,_0x448a6d)[_0x98d7('0xa')](function(_0x37f0de){logger[_0x98d7('0xb')](_0x98d7('0xc'),_0x5e041d,_0x98d7('0xd'));logger[_0x98d7('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5e041d,'request\x20sent',JSON['stringify'](_0x37f0de));if(_0x37f0de[_0x98d7('0xf')]){if(_0x37f0de[_0x98d7('0xf')]['code']===0x1f4){logger['error'](_0x98d7('0xc'),_0x5e041d,_0x37f0de[_0x98d7('0xf')][_0x98d7('0x10')]);return _0x38b639(_0x37f0de[_0x98d7('0xf')][_0x98d7('0x10')]);}logger['error'](_0x98d7('0xc'),_0x5e041d,_0x37f0de['error'][_0x98d7('0x10')]);return _0x53faf2(_0x37f0de['error'][_0x98d7('0x10')]);}else{logger[_0x98d7('0xb')](_0x98d7('0xc'),_0x5e041d,'request\x20sent');_0x53faf2(_0x37f0de['result']['message']);}})[_0x98d7('0x11')](function(_0x26cbae){logger[_0x98d7('0xf')]('MailServerIn,\x20%s,\x20%s',_0x5e041d,_0x26cbae);_0x38b639(_0x26cbae);});});}exports[_0x98d7('0x12')]=function(_0x917429){var _0x4133ce=this;return new Promise(function(_0x4e6997,_0x5114c2){return db[_0x98d7('0x13')]['findAll']({'raw':_0x917429[_0x98d7('0x14')]?_0x917429[_0x98d7('0x14')][_0x98d7('0x15')]===undefined?!![]:![]:!![],'where':_0x917429[_0x98d7('0x14')]?_0x917429[_0x98d7('0x14')][_0x98d7('0x16')]||null:null,'attributes':_0x917429[_0x98d7('0x14')]?_0x917429[_0x98d7('0x14')][_0x98d7('0x17')]||null:null,'limit':_0x917429['options']?_0x917429[_0x98d7('0x14')]['limit']||null:null,'include':_0x917429[_0x98d7('0x14')]?_0x917429[_0x98d7('0x14')]['include']?_[_0x98d7('0x18')](_0x917429[_0x98d7('0x14')][_0x98d7('0x19')],function(_0x342e8f){return{'model':db[_0x342e8f[_0x98d7('0x1a')]],'as':_0x342e8f['as'],'attributes':_0x342e8f[_0x98d7('0x17')],'include':_0x342e8f[_0x98d7('0x19')]?_[_0x98d7('0x18')](_0x342e8f['include'],function(_0x1ba70e){return{'model':db[_0x1ba70e[_0x98d7('0x1a')]],'as':_0x1ba70e['as'],'attributes':_0x1ba70e[_0x98d7('0x17')],'include':_0x1ba70e[_0x98d7('0x19')]?_[_0x98d7('0x18')](_0x1ba70e[_0x98d7('0x19')],function(_0x3810c3){return{'model':db[_0x3810c3[_0x98d7('0x1a')]],'as':_0x3810c3['as'],'attributes':_0x3810c3[_0x98d7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x98d7('0xa')](function(_0xea4f31){logger[_0x98d7('0xb')]('GetMailServerIn',_0x917429);logger['debug'](_0x98d7('0x12'),_0x917429,JSON[_0x98d7('0x1b')](_0xea4f31));_0x4e6997(_0xea4f31);})['catch'](function(_0x12f3d1){logger[_0x98d7('0xf')](_0x98d7('0x12'),_0x12f3d1[_0x98d7('0x10')],_0x917429);_0x5114c2(_0x4133ce[_0x98d7('0xf')](0x1f4,_0x12f3d1['message']));});});}; \ No newline at end of file +var _0x50c1=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x1ea16f,_0x2ff6c3){var _0x47a86b=function(_0xc6fec3){while(--_0xc6fec3){_0x1ea16f['push'](_0x1ea16f['shift']());}};_0x47a86b(++_0x2ff6c3);}(_0x50c1,0x1a5));var _0x150c=function(_0x1611f9,_0x4d8c40){_0x1611f9=_0x1611f9-0x0;var _0x56cc2c=_0x50c1[_0x1611f9];return _0x56cc2c;};'use strict';var _=require(_0x150c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x150c('0x1'));var rs=require(_0x150c('0x2'));var fs=require('fs');var Redis=require(_0x150c('0x3'));var db=require(_0x150c('0x4'))['db'];var utils=require(_0x150c('0x5'));var logger=require(_0x150c('0x6'))(_0x150c('0x7'));var config=require(_0x150c('0x8'));var jayson=require(_0x150c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x367215,_0x55833c,_0x5b10b4){return new BPromise(function(_0xb16344,_0x2c8053){return client[_0x150c('0xa')](_0x367215,_0x5b10b4)[_0x150c('0xb')](function(_0x17b609){logger[_0x150c('0xc')](_0x150c('0xd'),_0x55833c,_0x150c('0xe'));logger[_0x150c('0xf')](_0x150c('0x10'),_0x55833c,'request\x20sent',JSON[_0x150c('0x11')](_0x17b609));if(_0x17b609[_0x150c('0x12')]){if(_0x17b609[_0x150c('0x12')]['code']===0x1f4){logger[_0x150c('0x12')]('MailServerIn,\x20%s,\x20%s',_0x55833c,_0x17b609['error'][_0x150c('0x13')]);return _0x2c8053(_0x17b609[_0x150c('0x12')][_0x150c('0x13')]);}logger[_0x150c('0x12')](_0x150c('0xd'),_0x55833c,_0x17b609[_0x150c('0x12')][_0x150c('0x13')]);return _0xb16344(_0x17b609[_0x150c('0x12')][_0x150c('0x13')]);}else{logger[_0x150c('0xc')](_0x150c('0xd'),_0x55833c,_0x150c('0xe'));_0xb16344(_0x17b609['result'][_0x150c('0x13')]);}})['catch'](function(_0x338759){logger['error']('MailServerIn,\x20%s,\x20%s',_0x55833c,_0x338759);_0x2c8053(_0x338759);});});}exports[_0x150c('0x14')]=function(_0x40c0d0){var _0x1a98e6=this;return new Promise(function(_0x3c5a84,_0x53cc31){return db[_0x150c('0x15')][_0x150c('0x16')]({'raw':_0x40c0d0[_0x150c('0x17')]?_0x40c0d0[_0x150c('0x17')][_0x150c('0x18')]===undefined?!![]:![]:!![],'where':_0x40c0d0[_0x150c('0x17')]?_0x40c0d0['options'][_0x150c('0x19')]||null:null,'attributes':_0x40c0d0[_0x150c('0x17')]?_0x40c0d0['options'][_0x150c('0x1a')]||null:null,'limit':_0x40c0d0['options']?_0x40c0d0[_0x150c('0x17')][_0x150c('0x1b')]||null:null,'include':_0x40c0d0[_0x150c('0x17')]?_0x40c0d0[_0x150c('0x17')][_0x150c('0x1c')]?_['map'](_0x40c0d0[_0x150c('0x17')][_0x150c('0x1c')],function(_0x332173){return{'model':db[_0x332173[_0x150c('0x1d')]],'as':_0x332173['as'],'attributes':_0x332173[_0x150c('0x1a')],'include':_0x332173[_0x150c('0x1c')]?_[_0x150c('0x1e')](_0x332173[_0x150c('0x1c')],function(_0x3b1ce6){return{'model':db[_0x3b1ce6['model']],'as':_0x3b1ce6['as'],'attributes':_0x3b1ce6['attributes'],'include':_0x3b1ce6[_0x150c('0x1c')]?_[_0x150c('0x1e')](_0x3b1ce6[_0x150c('0x1c')],function(_0x5daf46){return{'model':db[_0x5daf46['model']],'as':_0x5daf46['as'],'attributes':_0x5daf46[_0x150c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x150c('0xb')](function(_0x11571a){logger[_0x150c('0xc')](_0x150c('0x14'),_0x40c0d0);logger[_0x150c('0xf')](_0x150c('0x14'),_0x40c0d0,JSON['stringify'](_0x11571a));_0x3c5a84(_0x11571a);})['catch'](function(_0xbf4922){logger[_0x150c('0x12')](_0x150c('0x14'),_0xbf4922[_0x150c('0x13')],_0x40c0d0);_0x53cc31(_0x1a98e6['error'](0x1f4,_0xbf4922['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 9c1668b..87596fa 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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x1e6772,_0x2081c1){_0x1e6772=_0x1e6772-0x0;var _0x3d9bdc=_0x7a54[_0x1e6772];return _0x3d9bdc;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 3607f9d..ddfd42f 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 _0x5344=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x2e2b80,_0x180dff){var _0x40b409=function(_0x81897e){while(--_0x81897e){_0x2e2b80['push'](_0x2e2b80['shift']());}};_0x40b409(++_0x180dff);}(_0x5344,0x1b0));var _0x4534=function(_0x3e91a0,_0x957f02){_0x3e91a0=_0x3e91a0-0x0;var _0x341fed=_0x5344[_0x3e91a0];return _0x341fed;};'use strict';var Sequelize=require(_0x4534('0x0'));module[_0x4534('0x1')]={'description':{'type':Sequelize[_0x4534('0x2')]},'host':{'type':Sequelize[_0x4534('0x2')]},'user':{'type':Sequelize[_0x4534('0x2')]},'pass':{'type':Sequelize[_0x4534('0x2')]},'port':{'type':Sequelize[_0x4534('0x3')]},'secure':{'type':Sequelize[_0x4534('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4534('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xca03=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x556c31,_0x27f18a){var _0x954887=function(_0x58be32){while(--_0x58be32){_0x556c31['push'](_0x556c31['shift']());}};_0x954887(++_0x27f18a);}(_0xca03,0x1f2));var _0x3ca0=function(_0x1d5398,_0x2d1e7d){_0x1d5398=_0x1d5398-0x0;var _0x500606=_0xca03[_0x1d5398];return _0x500606;};'use strict';var Sequelize=require(_0x3ca0('0x0'));module[_0x3ca0('0x1')]={'description':{'type':Sequelize[_0x3ca0('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x3ca0('0x2')]},'port':{'type':Sequelize[_0x3ca0('0x3')]},'secure':{'type':Sequelize[_0x3ca0('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3ca0('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 4a56f3e..f79fcd8 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 _0xb12e=['length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','MailServerOut','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','index','fieldName','type','model','map','query','filters','attributes','intersection','fields'];(function(_0x320363,_0x11d07f){var _0x5d0c5a=function(_0x3c5d90){while(--_0x3c5d90){_0x320363['push'](_0x320363['shift']());}};_0x5d0c5a(++_0x11d07f);}(_0xb12e,0x1c0));var _0xeb12=function(_0x408721,_0x31df20){_0x408721=_0x408721-0x0;var _0x2e965e=_0xb12e[_0x408721];return _0x2e965e;};'use strict';var emlformat=require(_0xeb12('0x0'));var rimraf=require(_0xeb12('0x1'));var zipdir=require(_0xeb12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb12('0x3'));var moment=require(_0xeb12('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb12('0x5'));var util=require(_0xeb12('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeb12('0x7'));var fs=require('fs');var fs_extra=require(_0xeb12('0x8'));var _=require(_0xeb12('0x9'));var squel=require('squel');var crypto=require(_0xeb12('0xa'));var jsforce=require(_0xeb12('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb12('0xc'));var Papa=require(_0xeb12('0xd'));var Redis=require(_0xeb12('0xe'));var authService=require(_0xeb12('0xf'));var qs=require(_0xeb12('0x10'));var as=require(_0xeb12('0x11'));var hardwareService=require(_0xeb12('0x12'));var logger=require('../../config/logger')(_0xeb12('0x13'));var utils=require('../../config/utils');var config=require(_0xeb12('0x14'));var licenseUtil=require(_0xeb12('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1619bf,_0x25f45b){_0x25f45b=_0x25f45b||0xcc;return function(_0x36a2af){if(_0x36a2af){return _0x1619bf[_0xeb12('0x16')](_0x25f45b);}return _0x1619bf['status'](_0x25f45b)[_0xeb12('0x17')]();};}function respondWithResult(_0x3f466f,_0x92c80d){_0x92c80d=_0x92c80d||0xc8;return function(_0x504076){if(_0x504076){return _0x3f466f[_0xeb12('0x18')](_0x92c80d)[_0xeb12('0x19')](_0x504076);}};}function respondWithFilteredResult(_0x258d0e,_0x529f03){return function(_0x28d9c4){if(_0x28d9c4){var _0x30bec0=typeof _0x529f03[_0xeb12('0x1a')]===_0xeb12('0x1b')&&typeof _0x529f03[_0xeb12('0x1c')]===_0xeb12('0x1b');var _0x2fc347=_0x28d9c4[_0xeb12('0x1d')];var _0x4e7381=_0x30bec0?0x0:_0x529f03[_0xeb12('0x1a')];var _0x51807b=_0x30bec0?_0x28d9c4['count']:_0x529f03[_0xeb12('0x1a')]+_0x529f03[_0xeb12('0x1c')];var _0x1a9512;if(_0x51807b>=_0x2fc347){_0x51807b=_0x2fc347;_0x1a9512=0xc8;}else{_0x1a9512=0xce;}_0x258d0e[_0xeb12('0x18')](_0x1a9512);return _0x258d0e[_0xeb12('0x1e')]('Content-Range',_0x4e7381+'-'+_0x51807b+'/'+_0x2fc347)[_0xeb12('0x19')](_0x28d9c4);}return null;};}function patchUpdates(_0xf533b3){return function(_0x5d6789){try{jsonpatch['apply'](_0x5d6789,_0xf533b3,!![]);}catch(_0x5b2553){return BPromise[_0xeb12('0x1f')](_0x5b2553);}return _0x5d6789[_0xeb12('0x20')]();};}function saveUpdates(_0xbed1b2,_0xebbe18){return function(_0x4dc11c){if(_0x4dc11c){return _0x4dc11c[_0xeb12('0x21')](_0xbed1b2)[_0xeb12('0x22')](function(_0x3bea72){return _0x3bea72;});}return null;};}function removeEntity(_0x192945,_0x1a000e){return function(_0x37afd7){if(_0x37afd7){return _0x37afd7['destroy']()[_0xeb12('0x22')](function(){_0x192945[_0xeb12('0x18')](0xcc)[_0xeb12('0x17')]();});}};}function handleEntityNotFound(_0x1fcd42,_0x1ed2d1){return function(_0xd7ba0e){if(!_0xd7ba0e){_0x1fcd42[_0xeb12('0x16')](0x194);}return _0xd7ba0e;};}function handleError(_0x40a8f6,_0x3eb925){_0x3eb925=_0x3eb925||0x1f4;return function(_0x178532){logger[_0xeb12('0x23')](_0x178532[_0xeb12('0x24')]);if(_0x178532['name']){delete _0x178532[_0xeb12('0x25')];}_0x40a8f6[_0xeb12('0x18')](_0x3eb925)[_0xeb12('0x26')](_0x178532);};}exports[_0xeb12('0x27')]=function(_0x508dea,_0x816215){var _0x3a94e1={},_0x3d0762={},_0x56e5cc={'count':0x0,'rows':[]};var _0x1ae7bf=_['map'](db['MailServerOut']['rawAttributes'],function(_0x4539f2){return{'name':_0x4539f2[_0xeb12('0x28')],'type':_0x4539f2[_0xeb12('0x29')]['key']};});_0x3d0762[_0xeb12('0x2a')]=_[_0xeb12('0x2b')](_0x1ae7bf,_0xeb12('0x25'));_0x3d0762['query']=_['keys'](_0x508dea[_0xeb12('0x2c')]);_0x3d0762[_0xeb12('0x2d')]=_['intersection'](_0x3d0762[_0xeb12('0x2a')],_0x3d0762['query']);_0x3a94e1[_0xeb12('0x2e')]=_[_0xeb12('0x2f')](_0x3d0762[_0xeb12('0x2a')],qs['fields'](_0x508dea[_0xeb12('0x2c')][_0xeb12('0x30')]));_0x3a94e1['attributes']=_0x3a94e1['attributes'][_0xeb12('0x31')]?_0x3a94e1[_0xeb12('0x2e')]:_0x3d0762['model'];if(!_0x508dea[_0xeb12('0x2c')][_0xeb12('0x32')](_0xeb12('0x33'))){_0x3a94e1[_0xeb12('0x1c')]=qs['limit'](_0x508dea['query'][_0xeb12('0x1c')]);_0x3a94e1['offset']=qs[_0xeb12('0x1a')](_0x508dea[_0xeb12('0x2c')][_0xeb12('0x1a')]);}_0x3a94e1['order']=qs[_0xeb12('0x34')](_0x508dea[_0xeb12('0x2c')][_0xeb12('0x34')]);_0x3a94e1[_0xeb12('0x35')]=qs[_0xeb12('0x2d')](_[_0xeb12('0x36')](_0x508dea['query'],_0x3d0762[_0xeb12('0x2d')]),_0x1ae7bf);if(_0x508dea[_0xeb12('0x2c')][_0xeb12('0x37')]){_0x3a94e1[_0xeb12('0x35')]=_['merge'](_0x3a94e1[_0xeb12('0x35')],{'$or':_['map'](_0x1ae7bf,function(_0xf1bec4){if(_0xf1bec4[_0xeb12('0x29')]!==_0xeb12('0x38')){var _0x1477aa={};_0x1477aa[_0xf1bec4[_0xeb12('0x25')]]={'$like':'%'+_0x508dea[_0xeb12('0x2c')][_0xeb12('0x37')]+'%'};return _0x1477aa;}})});}_0x3a94e1=_[_0xeb12('0x39')]({},_0x3a94e1,_0x508dea[_0xeb12('0x3a')]);var _0x2cafdf={'where':_0x3a94e1['where']};return db[_0xeb12('0x3b')][_0xeb12('0x1d')](_0x2cafdf)[_0xeb12('0x22')](function(_0x5033d2){_0x56e5cc[_0xeb12('0x1d')]=_0x5033d2;if(_0x508dea[_0xeb12('0x2c')][_0xeb12('0x3c')]){_0x3a94e1['include']=[{'all':!![]}];}return db[_0xeb12('0x3b')][_0xeb12('0x3d')](_0x3a94e1);})[_0xeb12('0x22')](function(_0x148a27){_0x56e5cc[_0xeb12('0x3e')]=_0x148a27;return _0x56e5cc;})['then'](respondWithFilteredResult(_0x816215,_0x3a94e1))[_0xeb12('0x3f')](handleError(_0x816215,null));};exports[_0xeb12('0x40')]=function(_0x4433e2,_0x264914){var _0x5789bf={'raw':!![],'where':{'id':_0x4433e2[_0xeb12('0x41')]['id']}},_0x27e844={};_0x27e844[_0xeb12('0x2a')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x27e844[_0xeb12('0x2c')]=_[_0xeb12('0x42')](_0x4433e2[_0xeb12('0x2c')]);_0x27e844['filters']=_['intersection'](_0x27e844['model'],_0x27e844['query']);_0x5789bf[_0xeb12('0x2e')]=_['intersection'](_0x27e844[_0xeb12('0x2a')],qs['fields'](_0x4433e2[_0xeb12('0x2c')][_0xeb12('0x30')]));_0x5789bf[_0xeb12('0x2e')]=_0x5789bf[_0xeb12('0x2e')][_0xeb12('0x31')]?_0x5789bf['attributes']:_0x27e844[_0xeb12('0x2a')];if(_0x4433e2[_0xeb12('0x2c')][_0xeb12('0x3c')]){_0x5789bf[_0xeb12('0x43')]=[{'all':!![]}];}_0x5789bf=_[_0xeb12('0x39')]({},_0x5789bf,_0x4433e2[_0xeb12('0x3a')]);return db[_0xeb12('0x3b')][_0xeb12('0x44')](_0x5789bf)[_0xeb12('0x22')](handleEntityNotFound(_0x264914,null))['then'](respondWithResult(_0x264914,null))[_0xeb12('0x3f')](handleError(_0x264914,null));};exports['create']=function(_0x435735,_0x391778){return db[_0xeb12('0x3b')][_0xeb12('0x45')](_0x435735['body'],{})[_0xeb12('0x22')](respondWithResult(_0x391778,0xc9))[_0xeb12('0x3f')](handleError(_0x391778,null));};exports[_0xeb12('0x21')]=function(_0x2f7bb5,_0x3b230e){if(_0x2f7bb5[_0xeb12('0x46')]['id']){delete _0x2f7bb5[_0xeb12('0x46')]['id'];}return db[_0xeb12('0x3b')][_0xeb12('0x44')]({'where':{'id':_0x2f7bb5['params']['id']}})[_0xeb12('0x22')](handleEntityNotFound(_0x3b230e,null))[_0xeb12('0x22')](saveUpdates(_0x2f7bb5[_0xeb12('0x46')],null))[_0xeb12('0x22')](respondWithResult(_0x3b230e,null))[_0xeb12('0x3f')](handleError(_0x3b230e,null));};exports['destroy']=function(_0xa883a1,_0x5d3a58){return db['MailServerOut'][_0xeb12('0x44')]({'where':{'id':_0xa883a1[_0xeb12('0x41')]['id']}})[_0xeb12('0x22')](handleEntityNotFound(_0x5d3a58,null))[_0xeb12('0x22')](removeEntity(_0x5d3a58,null))[_0xeb12('0x3f')](handleError(_0x5d3a58,null));}; \ No newline at end of file +var _0x9f3b=['includeAll','findAll','rows','show','params','intersection','include','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x50c599,_0x21de75){var _0x245ca1=function(_0x3a1de8){while(--_0x3a1de8){_0x50c599['push'](_0x50c599['shift']());}};_0x245ca1(++_0x21de75);}(_0x9f3b,0x192));var _0xb9f3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9f3b[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0xb9f3('0x0'));var rimraf=require(_0xb9f3('0x1'));var zipdir=require(_0xb9f3('0x2'));var jsonpatch=require(_0xb9f3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9f3('0x4'));var Mustache=require(_0xb9f3('0x5'));var util=require(_0xb9f3('0x6'));var path=require(_0xb9f3('0x7'));var sox=require(_0xb9f3('0x8'));var csv=require(_0xb9f3('0x9'));var ejs=require(_0xb9f3('0xa'));var fs=require('fs');var fs_extra=require(_0xb9f3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb9f3('0xc'));var jsforce=require(_0xb9f3('0xd'));var deskjs=require(_0xb9f3('0xe'));var toCsv=require(_0xb9f3('0x9'));var querystring=require('querystring');var Papa=require(_0xb9f3('0xf'));var Redis=require('ioredis');var authService=require(_0xb9f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb9f3('0x11'));var hardwareService=require(_0xb9f3('0x12'));var logger=require(_0xb9f3('0x13'))(_0xb9f3('0x14'));var utils=require('../../config/utils');var config=require(_0xb9f3('0x15'));var licenseUtil=require(_0xb9f3('0x16'));var db=require(_0xb9f3('0x17'))['db'];function respondWithStatusCode(_0x4e3c14,_0x4cd879){_0x4cd879=_0x4cd879||0xcc;return function(_0x744e51){if(_0x744e51){return _0x4e3c14[_0xb9f3('0x18')](_0x4cd879);}return _0x4e3c14[_0xb9f3('0x19')](_0x4cd879)[_0xb9f3('0x1a')]();};}function respondWithResult(_0x4f2b2c,_0x27c690){_0x27c690=_0x27c690||0xc8;return function(_0x5ae356){if(_0x5ae356){return _0x4f2b2c[_0xb9f3('0x19')](_0x27c690)[_0xb9f3('0x1b')](_0x5ae356);}};}function respondWithFilteredResult(_0x545bed,_0x47aee8){return function(_0x454989){if(_0x454989){var _0x3fdd00=typeof _0x47aee8[_0xb9f3('0x1c')]==='undefined'&&typeof _0x47aee8['limit']===_0xb9f3('0x1d');var _0x11c1f3=_0x454989[_0xb9f3('0x1e')];var _0x1dacf7=_0x3fdd00?0x0:_0x47aee8[_0xb9f3('0x1c')];var _0x552040=_0x3fdd00?_0x454989[_0xb9f3('0x1e')]:_0x47aee8['offset']+_0x47aee8[_0xb9f3('0x1f')];var _0x330509;if(_0x552040>=_0x11c1f3){_0x552040=_0x11c1f3;_0x330509=0xc8;}else{_0x330509=0xce;}_0x545bed[_0xb9f3('0x19')](_0x330509);return _0x545bed[_0xb9f3('0x20')](_0xb9f3('0x21'),_0x1dacf7+'-'+_0x552040+'/'+_0x11c1f3)[_0xb9f3('0x1b')](_0x454989);}return null;};}function patchUpdates(_0x423ca1){return function(_0x53595a){try{jsonpatch[_0xb9f3('0x22')](_0x53595a,_0x423ca1,!![]);}catch(_0x230d5f){return BPromise[_0xb9f3('0x23')](_0x230d5f);}return _0x53595a[_0xb9f3('0x24')]();};}function saveUpdates(_0xc4fc2f,_0x3bde89){return function(_0x4bf2f1){if(_0x4bf2f1){return _0x4bf2f1['update'](_0xc4fc2f)[_0xb9f3('0x25')](function(_0x39b484){return _0x39b484;});}return null;};}function removeEntity(_0x3e36f4,_0x217238){return function(_0x3b9a9c){if(_0x3b9a9c){return _0x3b9a9c[_0xb9f3('0x26')]()['then'](function(){_0x3e36f4[_0xb9f3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcac8,_0x23f58e){return function(_0x30b6d0){if(!_0x30b6d0){_0x1bcac8['sendStatus'](0x194);}return _0x30b6d0;};}function handleError(_0x225c8b,_0x5c8a80){_0x5c8a80=_0x5c8a80||0x1f4;return function(_0x1860e2){logger[_0xb9f3('0x27')](_0x1860e2[_0xb9f3('0x28')]);if(_0x1860e2[_0xb9f3('0x29')]){delete _0x1860e2['name'];}_0x225c8b[_0xb9f3('0x19')](_0x5c8a80)[_0xb9f3('0x2a')](_0x1860e2);};}exports[_0xb9f3('0x2b')]=function(_0x20d554,_0x382cfe){var _0x23a372={},_0x52c730={},_0x2bf977={'count':0x0,'rows':[]};var _0x48e1be=_[_0xb9f3('0x2c')](db[_0xb9f3('0x2d')][_0xb9f3('0x2e')],function(_0x35200d){return{'name':_0x35200d['fieldName'],'type':_0x35200d[_0xb9f3('0x2f')][_0xb9f3('0x30')]};});_0x52c730[_0xb9f3('0x31')]=_[_0xb9f3('0x2c')](_0x48e1be,_0xb9f3('0x29'));_0x52c730[_0xb9f3('0x32')]=_[_0xb9f3('0x33')](_0x20d554[_0xb9f3('0x32')]);_0x52c730[_0xb9f3('0x34')]=_['intersection'](_0x52c730[_0xb9f3('0x31')],_0x52c730['query']);_0x23a372[_0xb9f3('0x35')]=_['intersection'](_0x52c730[_0xb9f3('0x31')],qs[_0xb9f3('0x36')](_0x20d554[_0xb9f3('0x32')][_0xb9f3('0x36')]));_0x23a372[_0xb9f3('0x35')]=_0x23a372[_0xb9f3('0x35')][_0xb9f3('0x37')]?_0x23a372[_0xb9f3('0x35')]:_0x52c730[_0xb9f3('0x31')];if(!_0x20d554[_0xb9f3('0x32')][_0xb9f3('0x38')](_0xb9f3('0x39'))){_0x23a372[_0xb9f3('0x1f')]=qs['limit'](_0x20d554[_0xb9f3('0x32')][_0xb9f3('0x1f')]);_0x23a372[_0xb9f3('0x1c')]=qs[_0xb9f3('0x1c')](_0x20d554[_0xb9f3('0x32')][_0xb9f3('0x1c')]);}_0x23a372[_0xb9f3('0x3a')]=qs[_0xb9f3('0x3b')](_0x20d554['query'][_0xb9f3('0x3b')]);_0x23a372[_0xb9f3('0x3c')]=qs[_0xb9f3('0x34')](_[_0xb9f3('0x3d')](_0x20d554[_0xb9f3('0x32')],_0x52c730[_0xb9f3('0x34')]),_0x48e1be);if(_0x20d554[_0xb9f3('0x32')][_0xb9f3('0x3e')]){_0x23a372['where']=_[_0xb9f3('0x3f')](_0x23a372[_0xb9f3('0x3c')],{'$or':_[_0xb9f3('0x2c')](_0x48e1be,function(_0x43cacc){if(_0x43cacc[_0xb9f3('0x2f')]!==_0xb9f3('0x40')){var _0x5bf17f={};_0x5bf17f[_0x43cacc[_0xb9f3('0x29')]]={'$like':'%'+_0x20d554['query']['filter']+'%'};return _0x5bf17f;}})});}_0x23a372=_[_0xb9f3('0x3f')]({},_0x23a372,_0x20d554[_0xb9f3('0x41')]);var _0x1b863e={'where':_0x23a372[_0xb9f3('0x3c')]};return db[_0xb9f3('0x2d')]['count'](_0x1b863e)[_0xb9f3('0x25')](function(_0x37bdb1){_0x2bf977['count']=_0x37bdb1;if(_0x20d554['query'][_0xb9f3('0x42')]){_0x23a372['include']=[{'all':!![]}];}return db[_0xb9f3('0x2d')][_0xb9f3('0x43')](_0x23a372);})['then'](function(_0xb5dd3a){_0x2bf977[_0xb9f3('0x44')]=_0xb5dd3a;return _0x2bf977;})[_0xb9f3('0x25')](respondWithFilteredResult(_0x382cfe,_0x23a372))['catch'](handleError(_0x382cfe,null));};exports[_0xb9f3('0x45')]=function(_0x2042fc,_0x3997ba){var _0xcf81c5={'raw':!![],'where':{'id':_0x2042fc[_0xb9f3('0x46')]['id']}},_0xbee84d={};_0xbee84d['model']=_[_0xb9f3('0x33')](db['MailServerOut'][_0xb9f3('0x2e')]);_0xbee84d[_0xb9f3('0x32')]=_['keys'](_0x2042fc[_0xb9f3('0x32')]);_0xbee84d['filters']=_['intersection'](_0xbee84d['model'],_0xbee84d[_0xb9f3('0x32')]);_0xcf81c5[_0xb9f3('0x35')]=_[_0xb9f3('0x47')](_0xbee84d[_0xb9f3('0x31')],qs[_0xb9f3('0x36')](_0x2042fc[_0xb9f3('0x32')][_0xb9f3('0x36')]));_0xcf81c5[_0xb9f3('0x35')]=_0xcf81c5['attributes'][_0xb9f3('0x37')]?_0xcf81c5[_0xb9f3('0x35')]:_0xbee84d[_0xb9f3('0x31')];if(_0x2042fc[_0xb9f3('0x32')][_0xb9f3('0x42')]){_0xcf81c5[_0xb9f3('0x48')]=[{'all':!![]}];}_0xcf81c5=_[_0xb9f3('0x3f')]({},_0xcf81c5,_0x2042fc[_0xb9f3('0x41')]);return db[_0xb9f3('0x2d')][_0xb9f3('0x49')](_0xcf81c5)[_0xb9f3('0x25')](handleEntityNotFound(_0x3997ba,null))['then'](respondWithResult(_0x3997ba,null))['catch'](handleError(_0x3997ba,null));};exports[_0xb9f3('0x4a')]=function(_0x2bf3ba,_0x245425){return db[_0xb9f3('0x2d')][_0xb9f3('0x4a')](_0x2bf3ba[_0xb9f3('0x4b')],{})['then'](respondWithResult(_0x245425,0xc9))[_0xb9f3('0x4c')](handleError(_0x245425,null));};exports[_0xb9f3('0x4d')]=function(_0x20600c,_0x4a2210){if(_0x20600c[_0xb9f3('0x4b')]['id']){delete _0x20600c['body']['id'];}return db['MailServerOut'][_0xb9f3('0x49')]({'where':{'id':_0x20600c[_0xb9f3('0x46')]['id']}})[_0xb9f3('0x25')](handleEntityNotFound(_0x4a2210,null))['then'](saveUpdates(_0x20600c[_0xb9f3('0x4b')],null))[_0xb9f3('0x25')](respondWithResult(_0x4a2210,null))[_0xb9f3('0x4c')](handleError(_0x4a2210,null));};exports[_0xb9f3('0x26')]=function(_0x3aa46c,_0x3786d8){return db[_0xb9f3('0x2d')]['find']({'where':{'id':_0x3aa46c[_0xb9f3('0x46')]['id']}})[_0xb9f3('0x25')](handleEntityNotFound(_0x3786d8,null))[_0xb9f3('0x25')](removeEntity(_0x3786d8,null))['catch'](handleError(_0x3786d8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ea1c44d..b18c318 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 _0xcf3d=['bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','moment'];(function(_0x1b4058,_0x210dba){var _0x132a2f=function(_0xd6c3fd){while(--_0xd6c3fd){_0x1b4058['push'](_0x1b4058['shift']());}};_0x132a2f(++_0x210dba);}(_0xcf3d,0x15d));var _0xdcf3=function(_0x39bddb,_0x178ad7){_0x39bddb=_0x39bddb-0x0;var _0x24613b=_0xcf3d[_0x39bddb];return _0x24613b;};'use strict';var _=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdcf3('0x2'));var BPromise=require(_0xdcf3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcf3('0x4'));var rimraf=require(_0xdcf3('0x5'));var config=require(_0xdcf3('0x6'));var attributes=require(_0xdcf3('0x7'));module[_0xdcf3('0x8')]=function(_0x4c5dcb,_0x10e8b1){return _0x4c5dcb['define'](_0xdcf3('0x9'),attributes,{'tableName':_0xdcf3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7a0=['request-promise','path','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf7a0,0x11b));var _0x0f7a=function(_0x145863,_0x2b369a){_0x145863=_0x145863-0x0;var _0x391f51=_0xf7a0[_0x145863];return _0x391f51;};'use strict';var _=require(_0x0f7a('0x0'));var util=require('util');var logger=require(_0x0f7a('0x1'))(_0x0f7a('0x2'));var moment=require(_0x0f7a('0x3'));var BPromise=require(_0x0f7a('0x4'));var rp=require(_0x0f7a('0x5'));var fs=require('fs');var path=require(_0x0f7a('0x6'));var rimraf=require('rimraf');var config=require(_0x0f7a('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x0f7a('0x8')]=function(_0x1d8ecc,_0x9bf074){return _0x1d8ecc[_0x0f7a('0x9')](_0x0f7a('0xa'),attributes,{'tableName':_0x0f7a('0xb'),'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 e45dc55..ba599c4 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x1efbb0,_0x5d8ddc){_0x1efbb0=_0x1efbb0-0x0;var _0x4ed53f=_0x7a54[_0x1efbb0];return _0x4ed53f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3e5378,_0x2a5f6e){var _0xbbf176=function(_0x1a5581){while(--_0x1a5581){_0x3e5378['push'](_0x3e5378['shift']());}};_0xbbf176(++_0x2a5f6e);}(_0x2ef3,0xba));var _0x32ef=function(_0x37e0ee,_0x38cb97){_0x37e0ee=_0x37e0ee-0x0;var _0x4c7284=_0x2ef3[_0x37e0ee];return _0x4c7284;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c9564d4..13ba93d 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 _0xee98=['/:id','post','create','put','update','delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe'];(function(_0x49dee1,_0x5933bf){var _0x3e3c00=function(_0x499db4){while(--_0x499db4){_0x49dee1['push'](_0x49dee1['shift']());}};_0x3e3c00(++_0x5933bf);}(_0xee98,0x148));var _0x8ee9=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xee98[_0x1a9204];return _0x17ca68;};'use strict';var multer=require(_0x8ee9('0x0'));var util=require('util');var path=require(_0x8ee9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ee9('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x8ee9('0x3'));var controller=require(_0x8ee9('0x4'));router[_0x8ee9('0x5')]('/',auth[_0x8ee9('0x6')](),controller['index']);router[_0x8ee9('0x5')](_0x8ee9('0x7'),auth[_0x8ee9('0x6')](),controller['describe']);router[_0x8ee9('0x5')](_0x8ee9('0x8'),auth[_0x8ee9('0x6')](),controller['show']);router[_0x8ee9('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ee9('0xa')]);router[_0x8ee9('0xb')](_0x8ee9('0x8'),auth['isAuthenticated'](),controller[_0x8ee9('0xc')]);router[_0x8ee9('0xd')]('/:id',auth[_0x8ee9('0x6')](),controller[_0x8ee9('0xe')]);module[_0x8ee9('0xf')]=router; \ No newline at end of file +var _0x9ddc=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util'];(function(_0x5720d1,_0x37f0fb){var _0x25cd3e=function(_0x2ec3b8){while(--_0x2ec3b8){_0x5720d1['push'](_0x5720d1['shift']());}};_0x25cd3e(++_0x37f0fb);}(_0x9ddc,0x75));var _0xc9dd=function(_0xfd8575,_0x218fc4){_0xfd8575=_0xfd8575-0x0;var _0x96f1f0=_0x9ddc[_0xfd8575];return _0x96f1f0;};'use strict';var multer=require(_0xc9dd('0x0'));var util=require(_0xc9dd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9dd('0x2'));var router=express[_0xc9dd('0x3')]();var fs_extra=require(_0xc9dd('0x4'));var auth=require(_0xc9dd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9dd('0x6'));var controller=require(_0xc9dd('0x7'));router[_0xc9dd('0x8')]('/',auth[_0xc9dd('0x9')](),controller['index']);router[_0xc9dd('0x8')]('/describe',auth[_0xc9dd('0x9')](),controller['describe']);router[_0xc9dd('0x8')](_0xc9dd('0xa'),auth[_0xc9dd('0x9')](),controller[_0xc9dd('0xb')]);router[_0xc9dd('0xc')]('/',auth[_0xc9dd('0x9')](),controller['create']);router[_0xc9dd('0xd')](_0xc9dd('0xa'),auth['isAuthenticated'](),controller[_0xc9dd('0xe')]);router['delete'](_0xc9dd('0xa'),auth[_0xc9dd('0x9')](),controller[_0xc9dd('0xf')]);module[_0xc9dd('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c433bbd..d24898f 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 _0xd046=['exports','STRING','name'];(function(_0x576139,_0x4d401d){var _0x3519cc=function(_0x45c718){while(--_0x45c718){_0x576139['push'](_0x576139['shift']());}};_0x3519cc(++_0x4d401d);}(_0xd046,0x129));var _0x6d04=function(_0x204cdd,_0x5d50bc){_0x204cdd=_0x204cdd-0x0;var _0x48e952=_0xd046[_0x204cdd];return _0x48e952;};'use strict';var Sequelize=require('sequelize');module[_0x6d04('0x0')]={'name':{'type':Sequelize[_0x6d04('0x1')],'unique':_0x6d04('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x11e5=['name','sequelize','STRING'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x11e5,0x8b));var _0x511e=function(_0x52dbd1,_0xe46f69){_0x52dbd1=_0x52dbd1-0x0;var _0x58c76a=_0x11e5[_0x52dbd1];return _0x58c76a;};'use strict';var Sequelize=require(_0x511e('0x0'));module['exports']={'name':{'type':Sequelize[_0x511e('0x1')],'unique':_0x511e('0x2'),'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 c5b2862..0693996 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 _0xd3a7=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','length','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','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','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','MailSubstatus','rawAttributes','type','key','map','keys','query','filters','intersection','fields','attributes','model'];(function(_0x2a77c0,_0x5c4939){var _0x2d3506=function(_0xa497ef){while(--_0xa497ef){_0x2a77c0['push'](_0x2a77c0['shift']());}};_0x2d3506(++_0x5c4939);}(_0xd3a7,0xfe));var _0x7d3a=function(_0x3a29ea,_0x5713d4){_0x3a29ea=_0x3a29ea-0x0;var _0x46783e=_0xd3a7[_0x3a29ea];return _0x46783e;};'use strict';var emlformat=require(_0x7d3a('0x0'));var rimraf=require(_0x7d3a('0x1'));var zipdir=require(_0x7d3a('0x2'));var jsonpatch=require(_0x7d3a('0x3'));var rp=require('request-promise');var moment=require(_0x7d3a('0x4'));var BPromise=require(_0x7d3a('0x5'));var Mustache=require(_0x7d3a('0x6'));var util=require('util');var path=require(_0x7d3a('0x7'));var sox=require(_0x7d3a('0x8'));var csv=require(_0x7d3a('0x9'));var ejs=require(_0x7d3a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3a('0xb'));var squel=require(_0x7d3a('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d3a('0xd'));var deskjs=require(_0x7d3a('0xe'));var toCsv=require(_0x7d3a('0x9'));var querystring=require(_0x7d3a('0xf'));var Papa=require(_0x7d3a('0x10'));var Redis=require(_0x7d3a('0x11'));var authService=require(_0x7d3a('0x12'));var qs=require(_0x7d3a('0x13'));var as=require(_0x7d3a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d3a('0x15'))('api');var utils=require(_0x7d3a('0x16'));var config=require(_0x7d3a('0x17'));var licenseUtil=require(_0x7d3a('0x18'));var db=require(_0x7d3a('0x19'))['db'];function respondWithStatusCode(_0x51122c,_0xa595f9){_0xa595f9=_0xa595f9||0xcc;return function(_0x105c13){if(_0x105c13){return _0x51122c[_0x7d3a('0x1a')](_0xa595f9);}return _0x51122c[_0x7d3a('0x1b')](_0xa595f9)[_0x7d3a('0x1c')]();};}function respondWithResult(_0x3d4f77,_0xe76be0){_0xe76be0=_0xe76be0||0xc8;return function(_0x338348){if(_0x338348){return _0x3d4f77[_0x7d3a('0x1b')](_0xe76be0)['json'](_0x338348);}};}function respondWithFilteredResult(_0x5c507f,_0x296072){return function(_0x38f15f){if(_0x38f15f){var _0x49fb2c=typeof _0x296072[_0x7d3a('0x1d')]==='undefined'&&typeof _0x296072[_0x7d3a('0x1e')]===_0x7d3a('0x1f');var _0x26655c=_0x38f15f[_0x7d3a('0x20')];var _0x257e04=_0x49fb2c?0x0:_0x296072[_0x7d3a('0x1d')];var _0x5f13b2=_0x49fb2c?_0x38f15f[_0x7d3a('0x20')]:_0x296072[_0x7d3a('0x1d')]+_0x296072['limit'];var _0x3ca979;if(_0x5f13b2>=_0x26655c){_0x5f13b2=_0x26655c;_0x3ca979=0xc8;}else{_0x3ca979=0xce;}_0x5c507f[_0x7d3a('0x1b')](_0x3ca979);return _0x5c507f[_0x7d3a('0x21')](_0x7d3a('0x22'),_0x257e04+'-'+_0x5f13b2+'/'+_0x26655c)[_0x7d3a('0x23')](_0x38f15f);}return null;};}function patchUpdates(_0x475799){return function(_0xd754c1){try{jsonpatch[_0x7d3a('0x24')](_0xd754c1,_0x475799,!![]);}catch(_0x174b7c){return BPromise[_0x7d3a('0x25')](_0x174b7c);}return _0xd754c1[_0x7d3a('0x26')]();};}function saveUpdates(_0x1b4a5d,_0x330ffb){return function(_0x2f3217){if(_0x2f3217){return _0x2f3217[_0x7d3a('0x27')](_0x1b4a5d)['then'](function(_0x587ca4){return _0x587ca4;});}return null;};}function removeEntity(_0x316981,_0x2345f3){return function(_0x4c4e2c){if(_0x4c4e2c){return _0x4c4e2c[_0x7d3a('0x28')]()[_0x7d3a('0x29')](function(){_0x316981[_0x7d3a('0x1b')](0xcc)[_0x7d3a('0x1c')]();});}};}function handleEntityNotFound(_0x24eec8,_0x35c174){return function(_0x3d787c){if(!_0x3d787c){_0x24eec8[_0x7d3a('0x1a')](0x194);}return _0x3d787c;};}function handleError(_0x3a3023,_0x5e8881){_0x5e8881=_0x5e8881||0x1f4;return function(_0x108bf6){logger['error'](_0x108bf6[_0x7d3a('0x2a')]);if(_0x108bf6[_0x7d3a('0x2b')]){delete _0x108bf6[_0x7d3a('0x2b')];}_0x3a3023[_0x7d3a('0x1b')](_0x5e8881)[_0x7d3a('0x2c')](_0x108bf6);};}exports[_0x7d3a('0x2d')]=function(_0x418319,_0x36523f){var _0x1fef26={},_0x10995d={},_0x44169b={'count':0x0,'rows':[]};var _0x24fe40=_['map'](db[_0x7d3a('0x2e')][_0x7d3a('0x2f')],function(_0x5e841e){return{'name':_0x5e841e['fieldName'],'type':_0x5e841e[_0x7d3a('0x30')][_0x7d3a('0x31')]};});_0x10995d['model']=_[_0x7d3a('0x32')](_0x24fe40,_0x7d3a('0x2b'));_0x10995d['query']=_[_0x7d3a('0x33')](_0x418319[_0x7d3a('0x34')]);_0x10995d[_0x7d3a('0x35')]=_[_0x7d3a('0x36')](_0x10995d['model'],_0x10995d[_0x7d3a('0x34')]);_0x1fef26['attributes']=_['intersection'](_0x10995d['model'],qs[_0x7d3a('0x37')](_0x418319[_0x7d3a('0x34')][_0x7d3a('0x37')]));_0x1fef26[_0x7d3a('0x38')]=_0x1fef26[_0x7d3a('0x38')]['length']?_0x1fef26['attributes']:_0x10995d[_0x7d3a('0x39')];if(!_0x418319['query'][_0x7d3a('0x3a')](_0x7d3a('0x3b'))){_0x1fef26[_0x7d3a('0x1e')]=qs[_0x7d3a('0x1e')](_0x418319[_0x7d3a('0x34')][_0x7d3a('0x1e')]);_0x1fef26[_0x7d3a('0x1d')]=qs[_0x7d3a('0x1d')](_0x418319[_0x7d3a('0x34')][_0x7d3a('0x1d')]);}_0x1fef26[_0x7d3a('0x3c')]=qs[_0x7d3a('0x3d')](_0x418319[_0x7d3a('0x34')]['sort']);_0x1fef26[_0x7d3a('0x3e')]=qs[_0x7d3a('0x35')](_[_0x7d3a('0x3f')](_0x418319[_0x7d3a('0x34')],_0x10995d[_0x7d3a('0x35')]),_0x24fe40);if(_0x418319['query']['filter']){_0x1fef26[_0x7d3a('0x3e')]=_[_0x7d3a('0x40')](_0x1fef26[_0x7d3a('0x3e')],{'$or':_['map'](_0x24fe40,function(_0x33574d){if(_0x33574d[_0x7d3a('0x30')]!==_0x7d3a('0x41')){var _0x3c932f={};_0x3c932f[_0x33574d[_0x7d3a('0x2b')]]={'$like':'%'+_0x418319[_0x7d3a('0x34')][_0x7d3a('0x42')]+'%'};return _0x3c932f;}})});}_0x1fef26=_[_0x7d3a('0x40')]({},_0x1fef26,_0x418319['options']);var _0x16dac8={'where':_0x1fef26['where']};return db['MailSubstatus']['count'](_0x16dac8)[_0x7d3a('0x29')](function(_0x388235){_0x44169b[_0x7d3a('0x20')]=_0x388235;if(_0x418319['query'][_0x7d3a('0x43')]){_0x1fef26[_0x7d3a('0x44')]=[{'all':!![]}];}return db[_0x7d3a('0x2e')]['findAll'](_0x1fef26);})[_0x7d3a('0x29')](function(_0x3229ab){_0x44169b['rows']=_0x3229ab;return _0x44169b;})['then'](respondWithFilteredResult(_0x36523f,_0x1fef26))[_0x7d3a('0x45')](handleError(_0x36523f,null));};exports[_0x7d3a('0x46')]=function(_0x3d2e84,_0x3cf7aa){var _0x2f5572={'raw':!![],'where':{'id':_0x3d2e84[_0x7d3a('0x47')]['id']}},_0x42dc6e={};_0x42dc6e[_0x7d3a('0x39')]=_[_0x7d3a('0x33')](db['MailSubstatus']['rawAttributes']);_0x42dc6e['query']=_[_0x7d3a('0x33')](_0x3d2e84[_0x7d3a('0x34')]);_0x42dc6e[_0x7d3a('0x35')]=_['intersection'](_0x42dc6e[_0x7d3a('0x39')],_0x42dc6e[_0x7d3a('0x34')]);_0x2f5572[_0x7d3a('0x38')]=_[_0x7d3a('0x36')](_0x42dc6e[_0x7d3a('0x39')],qs[_0x7d3a('0x37')](_0x3d2e84[_0x7d3a('0x34')][_0x7d3a('0x37')]));_0x2f5572[_0x7d3a('0x38')]=_0x2f5572[_0x7d3a('0x38')][_0x7d3a('0x48')]?_0x2f5572[_0x7d3a('0x38')]:_0x42dc6e['model'];if(_0x3d2e84[_0x7d3a('0x34')][_0x7d3a('0x43')]){_0x2f5572[_0x7d3a('0x44')]=[{'all':!![]}];}_0x2f5572=_['merge']({},_0x2f5572,_0x3d2e84[_0x7d3a('0x49')]);return db[_0x7d3a('0x2e')]['find'](_0x2f5572)['then'](handleEntityNotFound(_0x3cf7aa,null))[_0x7d3a('0x29')](respondWithResult(_0x3cf7aa,null))[_0x7d3a('0x45')](handleError(_0x3cf7aa,null));};exports['create']=function(_0x5d42af,_0x4bce35){return db[_0x7d3a('0x2e')][_0x7d3a('0x4a')](_0x5d42af[_0x7d3a('0x4b')],{})[_0x7d3a('0x29')](respondWithResult(_0x4bce35,0xc9))[_0x7d3a('0x45')](handleError(_0x4bce35,null));};exports[_0x7d3a('0x27')]=function(_0x1bd79c,_0x4a5fbd){if(_0x1bd79c[_0x7d3a('0x4b')]['id']){delete _0x1bd79c[_0x7d3a('0x4b')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x1bd79c[_0x7d3a('0x47')]['id']}})[_0x7d3a('0x29')](handleEntityNotFound(_0x4a5fbd,null))[_0x7d3a('0x29')](saveUpdates(_0x1bd79c['body'],null))[_0x7d3a('0x29')](respondWithResult(_0x4a5fbd,null))[_0x7d3a('0x45')](handleError(_0x4a5fbd,null));};exports[_0x7d3a('0x28')]=function(_0x193a7b,_0x3cb743){return db[_0x7d3a('0x2e')][_0x7d3a('0x4c')]({'where':{'id':_0x193a7b[_0x7d3a('0x47')]['id']}})[_0x7d3a('0x29')](handleEntityNotFound(_0x3cb743,null))[_0x7d3a('0x29')](removeEntity(_0x3cb743,null))[_0x7d3a('0x45')](handleError(_0x3cb743,null));};exports[_0x7d3a('0x4d')]=function(_0x37241a,_0x2d213a){return db[_0x7d3a('0x2e')]['describe']()[_0x7d3a('0x29')](respondWithResult(_0x2d213a,null))[_0x7d3a('0x45')](handleError(_0x2d213a,null));}; \ No newline at end of file +var _0x336a=['body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x336a,0xa3));var _0xa336=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x336a[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0xa336('0x0'));var rimraf=require(_0xa336('0x1'));var zipdir=require(_0xa336('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa336('0x3'));var moment=require(_0xa336('0x4'));var BPromise=require(_0xa336('0x5'));var Mustache=require('mustache');var util=require(_0xa336('0x6'));var path=require(_0xa336('0x7'));var sox=require(_0xa336('0x8'));var csv=require(_0xa336('0x9'));var ejs=require(_0xa336('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa336('0xb'));var squel=require(_0xa336('0xc'));var crypto=require(_0xa336('0xd'));var jsforce=require(_0xa336('0xe'));var deskjs=require(_0xa336('0xf'));var toCsv=require(_0xa336('0x9'));var querystring=require(_0xa336('0x10'));var Papa=require(_0xa336('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa336('0x12'));var as=require(_0xa336('0x13'));var hardwareService=require(_0xa336('0x14'));var logger=require(_0xa336('0x15'))(_0xa336('0x16'));var utils=require(_0xa336('0x17'));var config=require(_0xa336('0x18'));var licenseUtil=require(_0xa336('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ece16,_0x3d6114){_0x3d6114=_0x3d6114||0xcc;return function(_0x350900){if(_0x350900){return _0x1ece16[_0xa336('0x1a')](_0x3d6114);}return _0x1ece16['status'](_0x3d6114)['end']();};}function respondWithResult(_0x2da83c,_0x3f8f4e){_0x3f8f4e=_0x3f8f4e||0xc8;return function(_0xbdece9){if(_0xbdece9){return _0x2da83c[_0xa336('0x1b')](_0x3f8f4e)[_0xa336('0x1c')](_0xbdece9);}};}function respondWithFilteredResult(_0x186957,_0x382e2f){return function(_0x478b72){if(_0x478b72){var _0x2af4e8=typeof _0x382e2f[_0xa336('0x1d')]===_0xa336('0x1e')&&typeof _0x382e2f['limit']==='undefined';var _0x35a614=_0x478b72[_0xa336('0x1f')];var _0x30b5cc=_0x2af4e8?0x0:_0x382e2f[_0xa336('0x1d')];var _0x303861=_0x2af4e8?_0x478b72[_0xa336('0x1f')]:_0x382e2f[_0xa336('0x1d')]+_0x382e2f[_0xa336('0x20')];var _0x2accbc;if(_0x303861>=_0x35a614){_0x303861=_0x35a614;_0x2accbc=0xc8;}else{_0x2accbc=0xce;}_0x186957[_0xa336('0x1b')](_0x2accbc);return _0x186957[_0xa336('0x21')](_0xa336('0x22'),_0x30b5cc+'-'+_0x303861+'/'+_0x35a614)[_0xa336('0x1c')](_0x478b72);}return null;};}function patchUpdates(_0x53360d){return function(_0x2eddb9){try{jsonpatch[_0xa336('0x23')](_0x2eddb9,_0x53360d,!![]);}catch(_0x4c1e1d){return BPromise[_0xa336('0x24')](_0x4c1e1d);}return _0x2eddb9[_0xa336('0x25')]();};}function saveUpdates(_0x1625e4,_0x2b2dca){return function(_0x22fd23){if(_0x22fd23){return _0x22fd23[_0xa336('0x26')](_0x1625e4)[_0xa336('0x27')](function(_0x498b67){return _0x498b67;});}return null;};}function removeEntity(_0x4d5567,_0x50e3fb){return function(_0x50bd0f){if(_0x50bd0f){return _0x50bd0f['destroy']()[_0xa336('0x27')](function(){_0x4d5567[_0xa336('0x1b')](0xcc)[_0xa336('0x28')]();});}};}function handleEntityNotFound(_0xd0854b,_0x3c4e8f){return function(_0x1451b2){if(!_0x1451b2){_0xd0854b[_0xa336('0x1a')](0x194);}return _0x1451b2;};}function handleError(_0x144de8,_0x4170b2){_0x4170b2=_0x4170b2||0x1f4;return function(_0x13b593){logger[_0xa336('0x29')](_0x13b593['stack']);if(_0x13b593[_0xa336('0x2a')]){delete _0x13b593[_0xa336('0x2a')];}_0x144de8[_0xa336('0x1b')](_0x4170b2)[_0xa336('0x2b')](_0x13b593);};}exports[_0xa336('0x2c')]=function(_0xdde74c,_0x1b6a18){var _0x2916be={},_0x45c7f2={},_0x1df68d={'count':0x0,'rows':[]};var _0x7f5d00=_[_0xa336('0x2d')](db[_0xa336('0x2e')][_0xa336('0x2f')],function(_0x5c1a4f){return{'name':_0x5c1a4f['fieldName'],'type':_0x5c1a4f[_0xa336('0x30')][_0xa336('0x31')]};});_0x45c7f2[_0xa336('0x32')]=_['map'](_0x7f5d00,_0xa336('0x2a'));_0x45c7f2['query']=_[_0xa336('0x33')](_0xdde74c[_0xa336('0x34')]);_0x45c7f2[_0xa336('0x35')]=_['intersection'](_0x45c7f2[_0xa336('0x32')],_0x45c7f2[_0xa336('0x34')]);_0x2916be[_0xa336('0x36')]=_[_0xa336('0x37')](_0x45c7f2['model'],qs[_0xa336('0x38')](_0xdde74c[_0xa336('0x34')][_0xa336('0x38')]));_0x2916be[_0xa336('0x36')]=_0x2916be[_0xa336('0x36')][_0xa336('0x39')]?_0x2916be['attributes']:_0x45c7f2[_0xa336('0x32')];if(!_0xdde74c['query'][_0xa336('0x3a')](_0xa336('0x3b'))){_0x2916be['limit']=qs[_0xa336('0x20')](_0xdde74c['query'][_0xa336('0x20')]);_0x2916be[_0xa336('0x1d')]=qs[_0xa336('0x1d')](_0xdde74c[_0xa336('0x34')]['offset']);}_0x2916be[_0xa336('0x3c')]=qs[_0xa336('0x3d')](_0xdde74c[_0xa336('0x34')]['sort']);_0x2916be[_0xa336('0x3e')]=qs[_0xa336('0x35')](_[_0xa336('0x3f')](_0xdde74c[_0xa336('0x34')],_0x45c7f2[_0xa336('0x35')]),_0x7f5d00);if(_0xdde74c[_0xa336('0x34')][_0xa336('0x40')]){_0x2916be[_0xa336('0x3e')]=_[_0xa336('0x41')](_0x2916be[_0xa336('0x3e')],{'$or':_['map'](_0x7f5d00,function(_0x2d93c7){if(_0x2d93c7[_0xa336('0x30')]!==_0xa336('0x42')){var _0x581bf1={};_0x581bf1[_0x2d93c7[_0xa336('0x2a')]]={'$like':'%'+_0xdde74c['query'][_0xa336('0x40')]+'%'};return _0x581bf1;}})});}_0x2916be=_['merge']({},_0x2916be,_0xdde74c[_0xa336('0x43')]);var _0x2020bb={'where':_0x2916be['where']};return db[_0xa336('0x2e')][_0xa336('0x1f')](_0x2020bb)[_0xa336('0x27')](function(_0x1d05a6){_0x1df68d[_0xa336('0x1f')]=_0x1d05a6;if(_0xdde74c['query'][_0xa336('0x44')]){_0x2916be[_0xa336('0x45')]=[{'all':!![]}];}return db[_0xa336('0x2e')][_0xa336('0x46')](_0x2916be);})['then'](function(_0x861049){_0x1df68d[_0xa336('0x47')]=_0x861049;return _0x1df68d;})[_0xa336('0x27')](respondWithFilteredResult(_0x1b6a18,_0x2916be))['catch'](handleError(_0x1b6a18,null));};exports[_0xa336('0x48')]=function(_0x4d096e,_0x53abda){var _0x57c72c={'raw':!![],'where':{'id':_0x4d096e[_0xa336('0x49')]['id']}},_0x377cc1={};_0x377cc1[_0xa336('0x32')]=_['keys'](db[_0xa336('0x2e')][_0xa336('0x2f')]);_0x377cc1[_0xa336('0x34')]=_[_0xa336('0x33')](_0x4d096e[_0xa336('0x34')]);_0x377cc1[_0xa336('0x35')]=_[_0xa336('0x37')](_0x377cc1[_0xa336('0x32')],_0x377cc1[_0xa336('0x34')]);_0x57c72c[_0xa336('0x36')]=_['intersection'](_0x377cc1['model'],qs[_0xa336('0x38')](_0x4d096e[_0xa336('0x34')][_0xa336('0x38')]));_0x57c72c[_0xa336('0x36')]=_0x57c72c[_0xa336('0x36')][_0xa336('0x39')]?_0x57c72c['attributes']:_0x377cc1[_0xa336('0x32')];if(_0x4d096e[_0xa336('0x34')]['includeAll']){_0x57c72c[_0xa336('0x45')]=[{'all':!![]}];}_0x57c72c=_[_0xa336('0x41')]({},_0x57c72c,_0x4d096e[_0xa336('0x43')]);return db[_0xa336('0x2e')][_0xa336('0x4a')](_0x57c72c)['then'](handleEntityNotFound(_0x53abda,null))[_0xa336('0x27')](respondWithResult(_0x53abda,null))[_0xa336('0x4b')](handleError(_0x53abda,null));};exports['create']=function(_0x564dee,_0x51992c){return db[_0xa336('0x2e')][_0xa336('0x4c')](_0x564dee[_0xa336('0x4d')],{})[_0xa336('0x27')](respondWithResult(_0x51992c,0xc9))[_0xa336('0x4b')](handleError(_0x51992c,null));};exports[_0xa336('0x26')]=function(_0xeda1d1,_0x118b93){if(_0xeda1d1[_0xa336('0x4d')]['id']){delete _0xeda1d1[_0xa336('0x4d')]['id'];}return db[_0xa336('0x2e')]['find']({'where':{'id':_0xeda1d1['params']['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x118b93,null))[_0xa336('0x27')](saveUpdates(_0xeda1d1[_0xa336('0x4d')],null))['then'](respondWithResult(_0x118b93,null))[_0xa336('0x4b')](handleError(_0x118b93,null));};exports[_0xa336('0x4e')]=function(_0x52f4f0,_0x52afcb){return db[_0xa336('0x2e')][_0xa336('0x4a')]({'where':{'id':_0x52f4f0[_0xa336('0x49')]['id']}})[_0xa336('0x27')](handleEntityNotFound(_0x52afcb,null))[_0xa336('0x27')](removeEntity(_0x52afcb,null))[_0xa336('0x4b')](handleError(_0x52afcb,null));};exports[_0xa336('0x4f')]=function(_0x1d6e05,_0x23038c){return db[_0xa336('0x2e')][_0xa336('0x4f')]()[_0xa336('0x27')](respondWithResult(_0x23038c,null))[_0xa336('0x4b')](handleError(_0x23038c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 515d952..239e3f9 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 _0xe776=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xe776,0x8e));var _0x6e77=function(_0xc40090,_0x200790){_0xc40090=_0xc40090-0x0;var _0x32409f=_0xe776[_0xc40090];return _0x32409f;};'use strict';var _=require(_0x6e77('0x0'));var util=require(_0x6e77('0x1'));var logger=require(_0x6e77('0x2'))('api');var moment=require(_0x6e77('0x3'));var BPromise=require(_0x6e77('0x4'));var rp=require(_0x6e77('0x5'));var fs=require('fs');var path=require(_0x6e77('0x6'));var rimraf=require(_0x6e77('0x7'));var config=require(_0x6e77('0x8'));var attributes=require(_0x6e77('0x9'));module[_0x6e77('0xa')]=function(_0x1a13fe,_0xb8cbe9){return _0x1a13fe['define'](_0x6e77('0xb'),attributes,{'tableName':_0x6e77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dad=['../../config/logger','moment','path','rimraf','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash','util'];(function(_0xbd3df3,_0x2197b0){var _0x4936d9=function(_0x467b30){while(--_0x467b30){_0xbd3df3['push'](_0xbd3df3['shift']());}};_0x4936d9(++_0x2197b0);}(_0x2dad,0x148));var _0xd2da=function(_0x1d3888,_0x3c13dc){_0x1d3888=_0x1d3888-0x0;var _0x37378f=_0x2dad[_0x1d3888];return _0x37378f;};'use strict';var _=require(_0xd2da('0x0'));var util=require(_0xd2da('0x1'));var logger=require(_0xd2da('0x2'))('api');var moment=require(_0xd2da('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2da('0x4'));var rimraf=require(_0xd2da('0x5'));var config=require('../../config/environment');var attributes=require(_0xd2da('0x6'));module[_0xd2da('0x7')]=function(_0x115bf4,_0x4daec9){return _0x115bf4['define'](_0xd2da('0x8'),attributes,{'tableName':_0xd2da('0x9'),'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 18be70c..debf485 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 _0x0040=['catch','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x75267d,_0x5d286c){var _0x21ccec=function(_0x1a3c1f){while(--_0x1a3c1f){_0x75267d['push'](_0x75267d['shift']());}};_0x21ccec(++_0x5d286c);}(_0x0040,0x157));var _0x0004=function(_0x1e203a,_0x397111){_0x1e203a=_0x1e203a-0x0;var _0x2a5006=_0x0040[_0x1e203a];return _0x2a5006;};'use strict';var _=require('lodash');var util=require(_0x0004('0x0'));var moment=require('moment');var BPromise=require(_0x0004('0x1'));var rs=require(_0x0004('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0004('0x3'));var logger=require(_0x0004('0x4'))('rpc');var config=require(_0x0004('0x5'));var jayson=require(_0x0004('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7917dc,_0x14addb,_0x15d518){return new BPromise(function(_0x56b42a,_0x1ee4bf){return client['request'](_0x7917dc,_0x15d518)['then'](function(_0x448c88){logger[_0x0004('0x7')](_0x0004('0x8'),_0x14addb,_0x0004('0x9'));logger[_0x0004('0xa')](_0x0004('0xb'),_0x14addb,_0x0004('0x9'),JSON[_0x0004('0xc')](_0x448c88));if(_0x448c88['error']){if(_0x448c88[_0x0004('0xd')][_0x0004('0xe')]===0x1f4){logger[_0x0004('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x14addb,_0x448c88[_0x0004('0xd')]['message']);return _0x1ee4bf(_0x448c88[_0x0004('0xd')]['message']);}logger[_0x0004('0xd')](_0x0004('0x8'),_0x14addb,_0x448c88[_0x0004('0xd')][_0x0004('0xf')]);return _0x56b42a(_0x448c88[_0x0004('0xd')][_0x0004('0xf')]);}else{logger[_0x0004('0x7')](_0x0004('0x8'),_0x14addb,_0x0004('0x9'));_0x56b42a(_0x448c88[_0x0004('0x10')]['message']);}})[_0x0004('0x11')](function(_0x4593f7){logger['error'](_0x0004('0x8'),_0x14addb,_0x4593f7);_0x1ee4bf(_0x4593f7);});});} \ No newline at end of file +var _0xee16=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x32b113,_0x1a52bc){var _0x3ad606=function(_0x5903e7){while(--_0x5903e7){_0x32b113['push'](_0x32b113['shift']());}};_0x3ad606(++_0x1a52bc);}(_0xee16,0x187));var _0x6ee1=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xee16[_0x211bc3];return _0x34c9a2;};'use strict';var _=require('lodash');var util=require(_0x6ee1('0x0'));var moment=require(_0x6ee1('0x1'));var BPromise=require(_0x6ee1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ee1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ee1('0x4'));var logger=require('../../config/logger')(_0x6ee1('0x5'));var config=require(_0x6ee1('0x6'));var jayson=require(_0x6ee1('0x7'));var client=jayson[_0x6ee1('0x8')][_0x6ee1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2170aa,_0x5199df,_0x379dee){return new BPromise(function(_0x153954,_0x250f51){return client[_0x6ee1('0xa')](_0x2170aa,_0x379dee)[_0x6ee1('0xb')](function(_0x387cf0){logger[_0x6ee1('0xc')](_0x6ee1('0xd'),_0x5199df,'request\x20sent');logger[_0x6ee1('0xe')](_0x6ee1('0xf'),_0x5199df,_0x6ee1('0x10'),JSON[_0x6ee1('0x11')](_0x387cf0));if(_0x387cf0['error']){if(_0x387cf0[_0x6ee1('0x12')][_0x6ee1('0x13')]===0x1f4){logger[_0x6ee1('0x12')](_0x6ee1('0xd'),_0x5199df,_0x387cf0[_0x6ee1('0x12')][_0x6ee1('0x14')]);return _0x250f51(_0x387cf0['error'][_0x6ee1('0x14')]);}logger[_0x6ee1('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x5199df,_0x387cf0['error']['message']);return _0x153954(_0x387cf0['error'][_0x6ee1('0x14')]);}else{logger[_0x6ee1('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x5199df,'request\x20sent');_0x153954(_0x387cf0['result']['message']);}})[_0x6ee1('0x15')](function(_0x52d7f1){logger['error'](_0x6ee1('0xd'),_0x5199df,_0x52d7f1);_0x250f51(_0x52d7f1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index af8e7c0..59ba82f 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 _0xe0ad=['./mailTransferReport.controller','index','get','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xe0ad,0xca));var _0xde0a=function(_0x42e69d,_0x6d3830){_0x42e69d=_0x42e69d-0x0;var _0xc8000d=_0xe0ad[_0x42e69d];return _0xc8000d;};'use strict';var multer=require(_0xde0a('0x0'));var util=require(_0xde0a('0x1'));var path=require(_0xde0a('0x2'));var timeout=require(_0xde0a('0x3'));var express=require('express');var router=express[_0xde0a('0x4')]();var fs_extra=require(_0xde0a('0x5'));var auth=require(_0xde0a('0x6'));var interaction=require(_0xde0a('0x7'));var config=require('../../config/environment');var controller=require(_0xde0a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xde0a('0x9')]);router[_0xde0a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xde0a('0xb')]);router[_0xde0a('0xa')](_0xde0a('0xc'),auth[_0xde0a('0xd')](),controller[_0xde0a('0xe')]);router[_0xde0a('0xf')]('/',auth[_0xde0a('0xd')](),controller['create']);router[_0xde0a('0x10')](_0xde0a('0xc'),auth[_0xde0a('0xd')](),controller[_0xde0a('0x11')]);router[_0xde0a('0x12')]('/:id',auth[_0xde0a('0xd')](),controller[_0xde0a('0x13')]);module[_0xde0a('0x14')]=router; \ No newline at end of file +var _0xea75=['delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea75,0x167));var _0x5ea7=function(_0x10f99f,_0x8421b9){_0x10f99f=_0x10f99f-0x0;var _0x29ed0f=_0xea75[_0x10f99f];return _0x29ed0f;};'use strict';var multer=require('multer');var util=require(_0x5ea7('0x0'));var path=require(_0x5ea7('0x1'));var timeout=require(_0x5ea7('0x2'));var express=require('express');var router=express[_0x5ea7('0x3')]();var fs_extra=require(_0x5ea7('0x4'));var auth=require(_0x5ea7('0x5'));var interaction=require(_0x5ea7('0x6'));var config=require('../../config/environment');var controller=require(_0x5ea7('0x7'));router[_0x5ea7('0x8')]('/',auth[_0x5ea7('0x9')](),controller['index']);router[_0x5ea7('0x8')](_0x5ea7('0xa'),auth[_0x5ea7('0x9')](),controller[_0x5ea7('0xb')]);router['get'](_0x5ea7('0xc'),auth[_0x5ea7('0x9')](),controller[_0x5ea7('0xd')]);router[_0x5ea7('0xe')]('/',auth[_0x5ea7('0x9')](),controller['create']);router['put'](_0x5ea7('0xc'),auth[_0x5ea7('0x9')](),controller['update']);router[_0x5ea7('0xf')]('/:id',auth[_0x5ea7('0x9')](),controller['destroy']);module[_0x5ea7('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 99e9e86..db89507 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5193a6,_0x406718){var _0x37d331=function(_0x13ec2a){while(--_0x13ec2a){_0x5193a6['push'](_0x5193a6['shift']());}};_0x37d331(++_0x406718);}(_0x70e0,0x17b));var _0x070e=function(_0x3a4376,_0x1268d0){_0x3a4376=_0x3a4376-0x0;var _0x23b383=_0x70e0[_0x3a4376];return _0x23b383;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x460a0e,_0x15fcf8){var _0x4fcfba=function(_0x743ca9){while(--_0x743ca9){_0x460a0e['push'](_0x460a0e['shift']());}};_0x4fcfba(++_0x15fcf8);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fbccd,_0x1aeae6){_0x1fbccd=_0x1fbccd-0x0;var _0x32d534=_0xedd9[_0x1fbccd];return _0x32d534;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 85fca03..ec5c3a0 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 _0x01be=['fieldName','type','key','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','attributes','find','create','body','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','MailTransferReport','rawAttributes'];(function(_0x3f5896,_0x8873d){var _0x5c4b2e=function(_0x2e0dc4){while(--_0x2e0dc4){_0x3f5896['push'](_0x3f5896['shift']());}};_0x5c4b2e(++_0x8873d);}(_0x01be,0x105));var _0xe01b=function(_0x48cc9e,_0x558d7f){_0x48cc9e=_0x48cc9e-0x0;var _0x3ff206=_0x01be[_0x48cc9e];return _0x3ff206;};'use strict';var emlformat=require(_0xe01b('0x0'));var rimraf=require(_0xe01b('0x1'));var zipdir=require(_0xe01b('0x2'));var jsonpatch=require(_0xe01b('0x3'));var rp=require(_0xe01b('0x4'));var moment=require(_0xe01b('0x5'));var BPromise=require(_0xe01b('0x6'));var Mustache=require(_0xe01b('0x7'));var util=require('util');var path=require(_0xe01b('0x8'));var sox=require(_0xe01b('0x9'));var csv=require(_0xe01b('0xa'));var ejs=require(_0xe01b('0xb'));var fs=require('fs');var fs_extra=require(_0xe01b('0xc'));var _=require(_0xe01b('0xd'));var squel=require('squel');var crypto=require(_0xe01b('0xe'));var jsforce=require(_0xe01b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe01b('0xa'));var querystring=require(_0xe01b('0x10'));var Papa=require('papaparse');var Redis=require(_0xe01b('0x11'));var authService=require(_0xe01b('0x12'));var qs=require(_0xe01b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe01b('0x14'))(_0xe01b('0x15'));var utils=require(_0xe01b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe01b('0x17'));var db=require(_0xe01b('0x18'))['db'];function respondWithStatusCode(_0x3a70bb,_0x3f18fd){_0x3f18fd=_0x3f18fd||0xcc;return function(_0x5b2d18){if(_0x5b2d18){return _0x3a70bb[_0xe01b('0x19')](_0x3f18fd);}return _0x3a70bb[_0xe01b('0x1a')](_0x3f18fd)[_0xe01b('0x1b')]();};}function respondWithResult(_0x33fe93,_0x1a6f88){_0x1a6f88=_0x1a6f88||0xc8;return function(_0x4df404){if(_0x4df404){return _0x33fe93['status'](_0x1a6f88)[_0xe01b('0x1c')](_0x4df404);}};}function respondWithFilteredResult(_0x25bc9f,_0x1c0933){return function(_0x55bf36){if(_0x55bf36){var _0x56e284=typeof _0x1c0933[_0xe01b('0x1d')]===_0xe01b('0x1e')&&typeof _0x1c0933[_0xe01b('0x1f')]==='undefined';var _0x17cd8e=_0x55bf36[_0xe01b('0x20')];var _0x315519=_0x56e284?0x0:_0x1c0933[_0xe01b('0x1d')];var _0x3c1224=_0x56e284?_0x55bf36[_0xe01b('0x20')]:_0x1c0933[_0xe01b('0x1d')]+_0x1c0933['limit'];var _0x2c396b;if(_0x3c1224>=_0x17cd8e){_0x3c1224=_0x17cd8e;_0x2c396b=0xc8;}else{_0x2c396b=0xce;}_0x25bc9f['status'](_0x2c396b);return _0x25bc9f[_0xe01b('0x21')](_0xe01b('0x22'),_0x315519+'-'+_0x3c1224+'/'+_0x17cd8e)[_0xe01b('0x1c')](_0x55bf36);}return null;};}function patchUpdates(_0x195902){return function(_0x47eb63){try{jsonpatch[_0xe01b('0x23')](_0x47eb63,_0x195902,!![]);}catch(_0x415cb5){return BPromise[_0xe01b('0x24')](_0x415cb5);}return _0x47eb63[_0xe01b('0x25')]();};}function saveUpdates(_0x2644dc,_0x404aaa){return function(_0x48ce15){if(_0x48ce15){return _0x48ce15[_0xe01b('0x26')](_0x2644dc)[_0xe01b('0x27')](function(_0x477ddb){return _0x477ddb;});}return null;};}function removeEntity(_0x2cd400,_0x2f4fb0){return function(_0x268972){if(_0x268972){return _0x268972[_0xe01b('0x28')]()['then'](function(){_0x2cd400[_0xe01b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d62e,_0x5af0a4){return function(_0x919906){if(!_0x919906){_0x42d62e[_0xe01b('0x19')](0x194);}return _0x919906;};}function handleError(_0x3b8391,_0x5efb3b){_0x5efb3b=_0x5efb3b||0x1f4;return function(_0x3b322a){logger['error'](_0x3b322a['stack']);if(_0x3b322a[_0xe01b('0x29')]){delete _0x3b322a[_0xe01b('0x29')];}_0x3b8391['status'](_0x5efb3b)[_0xe01b('0x2a')](_0x3b322a);};}exports[_0xe01b('0x2b')]=function(_0x3f7d2a,_0x4361da){var _0x1a48f6={},_0x15799e={},_0x530f3b={'count':0x0,'rows':[]};var _0x17e1d1=_[_0xe01b('0x2c')](db[_0xe01b('0x2d')][_0xe01b('0x2e')],function(_0x5f2a6c){return{'name':_0x5f2a6c[_0xe01b('0x2f')],'type':_0x5f2a6c[_0xe01b('0x30')][_0xe01b('0x31')]};});_0x15799e[_0xe01b('0x32')]=_[_0xe01b('0x2c')](_0x17e1d1,_0xe01b('0x29'));_0x15799e[_0xe01b('0x33')]=_[_0xe01b('0x34')](_0x3f7d2a[_0xe01b('0x33')]);_0x15799e['filters']=_[_0xe01b('0x35')](_0x15799e[_0xe01b('0x32')],_0x15799e[_0xe01b('0x33')]);_0x1a48f6['attributes']=_[_0xe01b('0x35')](_0x15799e['model'],qs[_0xe01b('0x36')](_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x36')]));_0x1a48f6['attributes']=_0x1a48f6['attributes'][_0xe01b('0x37')]?_0x1a48f6['attributes']:_0x15799e['model'];if(!_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x38')](_0xe01b('0x39'))){_0x1a48f6['limit']=qs[_0xe01b('0x1f')](_0x3f7d2a[_0xe01b('0x33')]['limit']);_0x1a48f6[_0xe01b('0x1d')]=qs[_0xe01b('0x1d')](_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x1d')]);}_0x1a48f6[_0xe01b('0x3a')]=qs['sort'](_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x3b')]);_0x1a48f6[_0xe01b('0x3c')]=qs[_0xe01b('0x3d')](_['pick'](_0x3f7d2a[_0xe01b('0x33')],_0x15799e[_0xe01b('0x3d')]),_0x17e1d1);if(_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x3e')]){_0x1a48f6[_0xe01b('0x3c')]=_[_0xe01b('0x3f')](_0x1a48f6['where'],{'$or':_[_0xe01b('0x2c')](_0x17e1d1,function(_0xb95bcc){if(_0xb95bcc[_0xe01b('0x30')]!==_0xe01b('0x40')){var _0x110340={};_0x110340[_0xb95bcc[_0xe01b('0x29')]]={'$like':'%'+_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x3e')]+'%'};return _0x110340;}})});}_0x1a48f6=_['merge']({},_0x1a48f6,_0x3f7d2a[_0xe01b('0x41')]);var _0x56eefd={'where':_0x1a48f6[_0xe01b('0x3c')]};return db['MailTransferReport'][_0xe01b('0x20')](_0x56eefd)['then'](function(_0x386135){_0x530f3b[_0xe01b('0x20')]=_0x386135;if(_0x3f7d2a[_0xe01b('0x33')][_0xe01b('0x42')]){_0x1a48f6[_0xe01b('0x43')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x1a48f6);})[_0xe01b('0x27')](function(_0x18958d){_0x530f3b[_0xe01b('0x44')]=_0x18958d;return _0x530f3b;})[_0xe01b('0x27')](respondWithFilteredResult(_0x4361da,_0x1a48f6))[_0xe01b('0x45')](handleError(_0x4361da,null));};exports[_0xe01b('0x46')]=function(_0xf25619,_0x4a8a01){var _0x38cea2={'raw':!![],'where':{'id':_0xf25619['params']['id']}},_0x2e4ef1={};_0x2e4ef1[_0xe01b('0x32')]=_[_0xe01b('0x34')](db[_0xe01b('0x2d')][_0xe01b('0x2e')]);_0x2e4ef1[_0xe01b('0x33')]=_[_0xe01b('0x34')](_0xf25619[_0xe01b('0x33')]);_0x2e4ef1[_0xe01b('0x3d')]=_[_0xe01b('0x35')](_0x2e4ef1[_0xe01b('0x32')],_0x2e4ef1[_0xe01b('0x33')]);_0x38cea2['attributes']=_[_0xe01b('0x35')](_0x2e4ef1[_0xe01b('0x32')],qs[_0xe01b('0x36')](_0xf25619[_0xe01b('0x33')][_0xe01b('0x36')]));_0x38cea2[_0xe01b('0x47')]=_0x38cea2[_0xe01b('0x47')]['length']?_0x38cea2[_0xe01b('0x47')]:_0x2e4ef1[_0xe01b('0x32')];if(_0xf25619[_0xe01b('0x33')]['includeAll']){_0x38cea2[_0xe01b('0x43')]=[{'all':!![]}];}_0x38cea2=_[_0xe01b('0x3f')]({},_0x38cea2,_0xf25619['options']);return db[_0xe01b('0x2d')][_0xe01b('0x48')](_0x38cea2)[_0xe01b('0x27')](handleEntityNotFound(_0x4a8a01,null))[_0xe01b('0x27')](respondWithResult(_0x4a8a01,null))['catch'](handleError(_0x4a8a01,null));};exports[_0xe01b('0x49')]=function(_0x47dcca,_0x4f33a2){return db[_0xe01b('0x2d')][_0xe01b('0x49')](_0x47dcca[_0xe01b('0x4a')],{})[_0xe01b('0x27')](respondWithResult(_0x4f33a2,0xc9))[_0xe01b('0x45')](handleError(_0x4f33a2,null));};exports[_0xe01b('0x26')]=function(_0x3dddf9,_0x46309f){if(_0x3dddf9['body']['id']){delete _0x3dddf9['body']['id'];}return db['MailTransferReport'][_0xe01b('0x48')]({'where':{'id':_0x3dddf9[_0xe01b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46309f,null))['then'](saveUpdates(_0x3dddf9[_0xe01b('0x4a')],null))[_0xe01b('0x27')](respondWithResult(_0x46309f,null))[_0xe01b('0x45')](handleError(_0x46309f,null));};exports[_0xe01b('0x28')]=function(_0x291018,_0x2b6029){return db[_0xe01b('0x2d')][_0xe01b('0x48')]({'where':{'id':_0x291018['params']['id']}})['then'](handleEntityNotFound(_0x2b6029,null))[_0xe01b('0x27')](removeEntity(_0x2b6029,null))[_0xe01b('0x45')](handleError(_0x2b6029,null));};exports['describe']=function(_0x450b36,_0x21a6e8){return db['MailTransferReport'][_0xe01b('0x4c')]()[_0xe01b('0x27')](respondWithResult(_0x21a6e8,null))[_0xe01b('0x45')](handleError(_0x21a6e8,null));}; \ No newline at end of file +var _0x2f59=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0xe5b1b2,_0x24fb5d){var _0x324399=function(_0x175aa3){while(--_0x175aa3){_0xe5b1b2['push'](_0xe5b1b2['shift']());}};_0x324399(++_0x24fb5d);}(_0x2f59,0x177));var _0x92f5=function(_0x50edb7,_0x44caf8){_0x50edb7=_0x50edb7-0x0;var _0x15548a=_0x2f59[_0x50edb7];return _0x15548a;};'use strict';var emlformat=require(_0x92f5('0x0'));var rimraf=require(_0x92f5('0x1'));var zipdir=require(_0x92f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92f5('0x3'));var moment=require(_0x92f5('0x4'));var BPromise=require(_0x92f5('0x5'));var Mustache=require(_0x92f5('0x6'));var util=require(_0x92f5('0x7'));var path=require(_0x92f5('0x8'));var sox=require(_0x92f5('0x9'));var csv=require(_0x92f5('0xa'));var ejs=require(_0x92f5('0xb'));var fs=require('fs');var fs_extra=require(_0x92f5('0xc'));var _=require('lodash');var squel=require(_0x92f5('0xd'));var crypto=require(_0x92f5('0xe'));var jsforce=require(_0x92f5('0xf'));var deskjs=require(_0x92f5('0x10'));var toCsv=require(_0x92f5('0xa'));var querystring=require(_0x92f5('0x11'));var Papa=require(_0x92f5('0x12'));var Redis=require('ioredis');var authService=require(_0x92f5('0x13'));var qs=require(_0x92f5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92f5('0x15'));var logger=require(_0x92f5('0x16'))('api');var utils=require(_0x92f5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92f5('0x18'))['db'];function respondWithStatusCode(_0x5a8e35,_0x4c9734){_0x4c9734=_0x4c9734||0xcc;return function(_0xbabcd4){if(_0xbabcd4){return _0x5a8e35[_0x92f5('0x19')](_0x4c9734);}return _0x5a8e35[_0x92f5('0x1a')](_0x4c9734)['end']();};}function respondWithResult(_0x159547,_0x18e062){_0x18e062=_0x18e062||0xc8;return function(_0x456fe1){if(_0x456fe1){return _0x159547['status'](_0x18e062)[_0x92f5('0x1b')](_0x456fe1);}};}function respondWithFilteredResult(_0x1e64fd,_0x45e548){return function(_0x3f64c0){if(_0x3f64c0){var _0x43d04b=typeof _0x45e548[_0x92f5('0x1c')]==='undefined'&&typeof _0x45e548[_0x92f5('0x1d')]===_0x92f5('0x1e');var _0x34b091=_0x3f64c0['count'];var _0x45e027=_0x43d04b?0x0:_0x45e548[_0x92f5('0x1c')];var _0x472e6e=_0x43d04b?_0x3f64c0[_0x92f5('0x1f')]:_0x45e548[_0x92f5('0x1c')]+_0x45e548['limit'];var _0x2577d9;if(_0x472e6e>=_0x34b091){_0x472e6e=_0x34b091;_0x2577d9=0xc8;}else{_0x2577d9=0xce;}_0x1e64fd['status'](_0x2577d9);return _0x1e64fd['set'](_0x92f5('0x20'),_0x45e027+'-'+_0x472e6e+'/'+_0x34b091)[_0x92f5('0x1b')](_0x3f64c0);}return null;};}function patchUpdates(_0x5139af){return function(_0x20ac73){try{jsonpatch[_0x92f5('0x21')](_0x20ac73,_0x5139af,!![]);}catch(_0x5a8dde){return BPromise[_0x92f5('0x22')](_0x5a8dde);}return _0x20ac73[_0x92f5('0x23')]();};}function saveUpdates(_0x104208,_0x44d426){return function(_0x1d9c74){if(_0x1d9c74){return _0x1d9c74[_0x92f5('0x24')](_0x104208)['then'](function(_0x560047){return _0x560047;});}return null;};}function removeEntity(_0x46e3ba,_0x105453){return function(_0x1a4996){if(_0x1a4996){return _0x1a4996[_0x92f5('0x25')]()[_0x92f5('0x26')](function(){_0x46e3ba[_0x92f5('0x1a')](0xcc)[_0x92f5('0x27')]();});}};}function handleEntityNotFound(_0x34f3ca,_0x5ae168){return function(_0x3e13a3){if(!_0x3e13a3){_0x34f3ca['sendStatus'](0x194);}return _0x3e13a3;};}function handleError(_0x5d5d9e,_0x1d1690){_0x1d1690=_0x1d1690||0x1f4;return function(_0x4aef49){logger[_0x92f5('0x28')](_0x4aef49[_0x92f5('0x29')]);if(_0x4aef49[_0x92f5('0x2a')]){delete _0x4aef49[_0x92f5('0x2a')];}_0x5d5d9e[_0x92f5('0x1a')](_0x1d1690)[_0x92f5('0x2b')](_0x4aef49);};}exports[_0x92f5('0x2c')]=function(_0x3ed54e,_0x2c3470){var _0x4cecc3={},_0x26c176={},_0x24ddbc={'count':0x0,'rows':[]};var _0x568b98=_[_0x92f5('0x2d')](db[_0x92f5('0x2e')][_0x92f5('0x2f')],function(_0x417681){return{'name':_0x417681[_0x92f5('0x30')],'type':_0x417681[_0x92f5('0x31')]['key']};});_0x26c176[_0x92f5('0x32')]=_[_0x92f5('0x2d')](_0x568b98,_0x92f5('0x2a'));_0x26c176[_0x92f5('0x33')]=_[_0x92f5('0x34')](_0x3ed54e[_0x92f5('0x33')]);_0x26c176[_0x92f5('0x35')]=_[_0x92f5('0x36')](_0x26c176[_0x92f5('0x32')],_0x26c176[_0x92f5('0x33')]);_0x4cecc3['attributes']=_[_0x92f5('0x36')](_0x26c176[_0x92f5('0x32')],qs[_0x92f5('0x37')](_0x3ed54e[_0x92f5('0x33')][_0x92f5('0x37')]));_0x4cecc3['attributes']=_0x4cecc3[_0x92f5('0x38')][_0x92f5('0x39')]?_0x4cecc3[_0x92f5('0x38')]:_0x26c176[_0x92f5('0x32')];if(!_0x3ed54e['query'][_0x92f5('0x3a')](_0x92f5('0x3b'))){_0x4cecc3['limit']=qs[_0x92f5('0x1d')](_0x3ed54e[_0x92f5('0x33')][_0x92f5('0x1d')]);_0x4cecc3['offset']=qs[_0x92f5('0x1c')](_0x3ed54e[_0x92f5('0x33')][_0x92f5('0x1c')]);}_0x4cecc3[_0x92f5('0x3c')]=qs[_0x92f5('0x3d')](_0x3ed54e['query'][_0x92f5('0x3d')]);_0x4cecc3['where']=qs['filters'](_['pick'](_0x3ed54e[_0x92f5('0x33')],_0x26c176[_0x92f5('0x35')]),_0x568b98);if(_0x3ed54e[_0x92f5('0x33')][_0x92f5('0x3e')]){_0x4cecc3['where']=_[_0x92f5('0x3f')](_0x4cecc3['where'],{'$or':_[_0x92f5('0x2d')](_0x568b98,function(_0x2cd667){if(_0x2cd667[_0x92f5('0x31')]!==_0x92f5('0x40')){var _0x4530e9={};_0x4530e9[_0x2cd667[_0x92f5('0x2a')]]={'$like':'%'+_0x3ed54e['query'][_0x92f5('0x3e')]+'%'};return _0x4530e9;}})});}_0x4cecc3=_[_0x92f5('0x3f')]({},_0x4cecc3,_0x3ed54e['options']);var _0x137925={'where':_0x4cecc3[_0x92f5('0x41')]};return db[_0x92f5('0x2e')]['count'](_0x137925)[_0x92f5('0x26')](function(_0x4fb53e){_0x24ddbc[_0x92f5('0x1f')]=_0x4fb53e;if(_0x3ed54e[_0x92f5('0x33')][_0x92f5('0x42')]){_0x4cecc3[_0x92f5('0x43')]=[{'all':!![]}];}return db[_0x92f5('0x2e')][_0x92f5('0x44')](_0x4cecc3);})[_0x92f5('0x26')](function(_0x39c97f){_0x24ddbc[_0x92f5('0x45')]=_0x39c97f;return _0x24ddbc;})[_0x92f5('0x26')](respondWithFilteredResult(_0x2c3470,_0x4cecc3))[_0x92f5('0x46')](handleError(_0x2c3470,null));};exports[_0x92f5('0x47')]=function(_0x4de11c,_0x2088e2){var _0xccf0a5={'raw':!![],'where':{'id':_0x4de11c[_0x92f5('0x48')]['id']}},_0x419c14={};_0x419c14['model']=_[_0x92f5('0x34')](db[_0x92f5('0x2e')][_0x92f5('0x2f')]);_0x419c14[_0x92f5('0x33')]=_[_0x92f5('0x34')](_0x4de11c[_0x92f5('0x33')]);_0x419c14[_0x92f5('0x35')]=_[_0x92f5('0x36')](_0x419c14[_0x92f5('0x32')],_0x419c14['query']);_0xccf0a5[_0x92f5('0x38')]=_['intersection'](_0x419c14[_0x92f5('0x32')],qs[_0x92f5('0x37')](_0x4de11c[_0x92f5('0x33')][_0x92f5('0x37')]));_0xccf0a5[_0x92f5('0x38')]=_0xccf0a5[_0x92f5('0x38')][_0x92f5('0x39')]?_0xccf0a5['attributes']:_0x419c14['model'];if(_0x4de11c[_0x92f5('0x33')]['includeAll']){_0xccf0a5[_0x92f5('0x43')]=[{'all':!![]}];}_0xccf0a5=_[_0x92f5('0x3f')]({},_0xccf0a5,_0x4de11c[_0x92f5('0x49')]);return db[_0x92f5('0x2e')][_0x92f5('0x4a')](_0xccf0a5)[_0x92f5('0x26')](handleEntityNotFound(_0x2088e2,null))[_0x92f5('0x26')](respondWithResult(_0x2088e2,null))['catch'](handleError(_0x2088e2,null));};exports[_0x92f5('0x4b')]=function(_0x3461d2,_0x268e02){return db[_0x92f5('0x2e')]['create'](_0x3461d2[_0x92f5('0x4c')],{})[_0x92f5('0x26')](respondWithResult(_0x268e02,0xc9))['catch'](handleError(_0x268e02,null));};exports['update']=function(_0x27ba10,_0x222c00){if(_0x27ba10[_0x92f5('0x4c')]['id']){delete _0x27ba10[_0x92f5('0x4c')]['id'];}return db[_0x92f5('0x2e')][_0x92f5('0x4a')]({'where':{'id':_0x27ba10[_0x92f5('0x48')]['id']}})[_0x92f5('0x26')](handleEntityNotFound(_0x222c00,null))[_0x92f5('0x26')](saveUpdates(_0x27ba10[_0x92f5('0x4c')],null))[_0x92f5('0x26')](respondWithResult(_0x222c00,null))[_0x92f5('0x46')](handleError(_0x222c00,null));};exports[_0x92f5('0x25')]=function(_0x5016f0,_0x5cd884){return db['MailTransferReport']['find']({'where':{'id':_0x5016f0[_0x92f5('0x48')]['id']}})[_0x92f5('0x26')](handleEntityNotFound(_0x5cd884,null))[_0x92f5('0x26')](removeEntity(_0x5cd884,null))['catch'](handleError(_0x5cd884,null));};exports[_0x92f5('0x4d')]=function(_0x3fbd9f,_0x5797f2){return db['MailTransferReport'][_0x92f5('0x4d')]()['then'](respondWithResult(_0x5797f2,null))['catch'](handleError(_0x5797f2,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 574ad75..7005dc4 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 _0xd51f=['api','moment','request-promise','path','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','lodash','util'];(function(_0x34756e,_0x3c036a){var _0x365e63=function(_0xc96601){while(--_0xc96601){_0x34756e['push'](_0x34756e['shift']());}};_0x365e63(++_0x3c036a);}(_0xd51f,0xf0));var _0xfd51=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd51f[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var logger=require('../../config/logger')(_0xfd51('0x2'));var moment=require(_0xfd51('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd51('0x4'));var fs=require('fs');var path=require(_0xfd51('0x5'));var rimraf=require('rimraf');var config=require(_0xfd51('0x6'));var attributes=require(_0xfd51('0x7'));module['exports']=function(_0x3e3517,_0x3a2cd4){return _0x3e3517['define'](_0xfd51('0x8'),attributes,{'tableName':_0xfd51('0x9'),'paranoid':![],'indexes':[{'name':_0xfd51('0xa'),'fields':[_0xfd51('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x150322,_0x2199fb){var _0x606a08=function(_0x22cace){while(--_0x22cace){_0x150322['push'](_0x150322['shift']());}};_0x606a08(++_0x2199fb);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x52e5fe,_0x49524f){_0x52e5fe=_0x52e5fe-0x0;var _0x38e894=_0xdbf5[_0x52e5fe];return _0x38e894;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5dbf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index bafd303..19aa496 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 _0x1c50=['stringify','error','code','message','result','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x1c50,0x16e));var _0x01c5=function(_0x537927,_0xf9443f){_0x537927=_0x537927-0x0;var _0x5622b1=_0x1c50[_0x537927];return _0x5622b1;};'use strict';var _=require(_0x01c5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01c5('0x1'));var db=require(_0x01c5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x01c5('0x3'))(_0x01c5('0x4'));var config=require(_0x01c5('0x5'));var jayson=require(_0x01c5('0x6'));var client=jayson[_0x01c5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x300be3,_0x262580,_0x55f995){return new BPromise(function(_0x48d5b5,_0x5ad557){return client[_0x01c5('0x8')](_0x300be3,_0x55f995)[_0x01c5('0x9')](function(_0x42655b){logger[_0x01c5('0xa')](_0x01c5('0xb'),_0x262580,_0x01c5('0xc'));logger['debug'](_0x01c5('0xd'),_0x262580,_0x01c5('0xc'),JSON[_0x01c5('0xe')](_0x42655b));if(_0x42655b[_0x01c5('0xf')]){if(_0x42655b[_0x01c5('0xf')][_0x01c5('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x262580,_0x42655b[_0x01c5('0xf')][_0x01c5('0x11')]);return _0x5ad557(_0x42655b['error'][_0x01c5('0x11')]);}logger[_0x01c5('0xf')](_0x01c5('0xb'),_0x262580,_0x42655b[_0x01c5('0xf')]['message']);return _0x48d5b5(_0x42655b[_0x01c5('0xf')][_0x01c5('0x11')]);}else{logger[_0x01c5('0xa')](_0x01c5('0xb'),_0x262580,_0x01c5('0xc'));_0x48d5b5(_0x42655b[_0x01c5('0x12')][_0x01c5('0x11')]);}})['catch'](function(_0x539000){logger['error'](_0x01c5('0xb'),_0x262580,_0x539000);_0x5ad557(_0x539000);});});} \ No newline at end of file +var _0x57e6=['then','info','debug','request\x20sent','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','http','request'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x57e6,0xc8));var _0x657e=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x57e6[_0x216008];return _0x4d384f;};'use strict';var _=require(_0x657e('0x0'));var util=require(_0x657e('0x1'));var moment=require(_0x657e('0x2'));var BPromise=require(_0x657e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x657e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x657e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x657e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x657e('0x7')][_0x657e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3afbf7,_0x473fa6,_0x3fe08e){return new BPromise(function(_0x313487,_0x456efa){return client[_0x657e('0x9')](_0x3afbf7,_0x3fe08e)[_0x657e('0xa')](function(_0x19820e){logger[_0x657e('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x473fa6,'request\x20sent');logger[_0x657e('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x473fa6,_0x657e('0xd'),JSON[_0x657e('0xe')](_0x19820e));if(_0x19820e['error']){if(_0x19820e[_0x657e('0xf')][_0x657e('0x10')]===0x1f4){logger[_0x657e('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x473fa6,_0x19820e[_0x657e('0xf')][_0x657e('0x11')]);return _0x456efa(_0x19820e['error'][_0x657e('0x11')]);}logger[_0x657e('0xf')](_0x657e('0x12'),_0x473fa6,_0x19820e['error'][_0x657e('0x11')]);return _0x313487(_0x19820e[_0x657e('0xf')][_0x657e('0x11')]);}else{logger[_0x657e('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x473fa6,'request\x20sent');_0x313487(_0x19820e[_0x657e('0x13')][_0x657e('0x11')]);}})[_0x657e('0x14')](function(_0x3907f2){logger[_0x657e('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x473fa6,_0x3907f2);_0x456efa(_0x3907f2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 1fc2d2e..caf759a 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 _0x3699=['index','get','describe','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3699,0x1c9));var _0x9369=function(_0x33d8d4,_0x9f0c30){_0x33d8d4=_0x33d8d4-0x0;var _0x4c4d94=_0x3699[_0x33d8d4];return _0x4c4d94;};'use strict';var multer=require(_0x9369('0x0'));var util=require(_0x9369('0x1'));var path=require(_0x9369('0x2'));var timeout=require(_0x9369('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9369('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9369('0x5'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router['get']('/',auth[_0x9369('0x6')](),controller[_0x9369('0x7')]);router[_0x9369('0x8')]('/describe',auth[_0x9369('0x6')](),controller[_0x9369('0x9')]);router[_0x9369('0x8')](_0x9369('0xa'),auth['isAuthenticated'](),controller[_0x9369('0xb')]);router['post']('/',auth[_0x9369('0x6')](),controller[_0x9369('0xc')]);router['put'](_0x9369('0xa'),auth[_0x9369('0x6')](),controller['update']);router[_0x9369('0xd')](_0x9369('0xa'),auth['isAuthenticated'](),controller[_0x9369('0xe')]);module[_0x9369('0xf')]=router; \ No newline at end of file +var _0x9614=['../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','describe','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3701fb,_0x38c6ee){var _0x3aabf6=function(_0x88059c){while(--_0x88059c){_0x3701fb['push'](_0x3701fb['shift']());}};_0x3aabf6(++_0x38c6ee);}(_0x9614,0xf0));var _0x4961=function(_0x418305,_0xcf9d75){_0x418305=_0x418305-0x0;var _0x39a433=_0x9614[_0x418305];return _0x39a433;};'use strict';var multer=require(_0x4961('0x0'));var util=require(_0x4961('0x1'));var path=require(_0x4961('0x2'));var timeout=require('connect-timeout');var express=require(_0x4961('0x3'));var router=express[_0x4961('0x4')]();var fs_extra=require(_0x4961('0x5'));var auth=require(_0x4961('0x6'));var interaction=require(_0x4961('0x7'));var config=require(_0x4961('0x8'));var controller=require(_0x4961('0x9'));router['get']('/',auth[_0x4961('0xa')](),controller[_0x4961('0xb')]);router['get']('/describe',auth[_0x4961('0xa')](),controller[_0x4961('0xc')]);router['get']('/:id',auth[_0x4961('0xa')](),controller['show']);router['post']('/',auth[_0x4961('0xa')](),controller['create']);router[_0x4961('0xd')](_0x4961('0xe'),auth[_0x4961('0xa')](),controller[_0x4961('0xf')]);router[_0x4961('0x10')](_0x4961('0xe'),auth[_0x4961('0xa')](),controller[_0x4961('0x11')]);module[_0x4961('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ddaf45e..0344170 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 _0x639a=['INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x639a,0xec));var _0xa639=function(_0x6e3386,_0x5f5c1b){_0x6e3386=_0x6e3386-0x0;var _0x443df1=_0x639a[_0x6e3386];return _0x443df1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa639('0x0'));module[_0xa639('0x1')]={'channel':{'type':Sequelize[_0xa639('0x2')]},'membername':{'type':Sequelize[_0xa639('0x2')]},'interface':{'type':Sequelize[_0xa639('0x2')]},'type':{'type':Sequelize[_0xa639('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xa639('0x3')},'duration':{'type':Sequelize[_0xa639('0x4')]},'enterAt':{'type':Sequelize[_0xa639('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0xa1931a){var _0x21aca9=moment(_0xa1931a);var _0x29d2e4=moment(this[_0xa639('0x6')]('enterAt'));var _0xfb7f17=_0x21aca9[_0xa639('0x7')](_0x29d2e4,_0xa639('0x8'));this[_0xa639('0x9')](_0xa639('0xa'),_0xa1931a);this[_0xa639('0x9')](_0xa639('0xb'),_0xfb7f17||null);}},'data1':{'type':Sequelize[_0xa639('0x2')],'comment':_0xa639('0xc')},'data2':{'type':Sequelize[_0xa639('0x2')],'comment':_0xa639('0xd')},'data3':{'type':Sequelize[_0xa639('0x2')],'comment':_0xa639('0xe')},'data4':{'type':Sequelize[_0xa639('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xa639('0x2')]},'internal':{'type':Sequelize[_0xa639('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3ce4=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x3ce4,0xcb));var _0x43ce=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3ce4[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x43ce('0x0'));var moment=require('moment');module[_0x43ce('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x43ce('0x2')]},'interface':{'type':Sequelize[_0x43ce('0x2')]},'type':{'type':Sequelize[_0x43ce('0x2')],'defaultValue':_0x43ce('0x3'),'comment':_0x43ce('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x43ce('0x5')]},'exitAt':{'type':Sequelize[_0x43ce('0x5')],'set':function(_0x563597){var _0x1412d1=moment(_0x563597);var _0x51e29b=moment(this[_0x43ce('0x6')](_0x43ce('0x7')));var _0x189654=_0x1412d1[_0x43ce('0x8')](_0x51e29b,'seconds');this[_0x43ce('0x9')](_0x43ce('0xa'),_0x563597);this[_0x43ce('0x9')](_0x43ce('0xb'),_0x189654||null);}},'data1':{'type':Sequelize[_0x43ce('0x2')],'comment':_0x43ce('0xc')},'data2':{'type':Sequelize[_0x43ce('0x2')],'comment':_0x43ce('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x43ce('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x43ce('0xf')},'data5':{'type':Sequelize[_0x43ce('0x2')],'comment':_0x43ce('0x10')},'role':{'type':Sequelize[_0x43ce('0x2')]},'internal':{'type':Sequelize[_0x43ce('0x11')]},'uniqueid':{'type':Sequelize[_0x43ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 2d9bd3b..afedccc 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(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x3e74,0x175));var _0x43e7=function(_0xb0c0b9,_0x2a0d1d){_0xb0c0b9=_0xb0c0b9-0x0;var _0x12c1ca=_0x3e74[_0xb0c0b9];return _0x12c1ca;};'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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x4ba653,_0x4ecebd){var _0x1c7eae=function(_0x1aa385){while(--_0x1aa385){_0x4ba653['push'](_0x4ba653['shift']());}};_0x1c7eae(++_0x4ecebd);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 625fc05..0a08b92 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 _0x39c4=['rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','membername','interface','lodash','api','moment','request-promise','path'];(function(_0x4d7c80,_0x2af89b){var _0x24fcb6=function(_0x3cc104){while(--_0x3cc104){_0x4d7c80['push'](_0x4d7c80['shift']());}};_0x24fcb6(++_0x2af89b);}(_0x39c4,0xdf));var _0x439c=function(_0xdcce44,_0x53d035){_0xdcce44=_0xdcce44-0x0;var _0x54ca1b=_0x39c4[_0xdcce44];return _0x54ca1b;};'use strict';var _=require(_0x439c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require('bluebird');var rp=require(_0x439c('0x3'));var fs=require('fs');var path=require(_0x439c('0x4'));var rimraf=require(_0x439c('0x5'));var config=require(_0x439c('0x6'));var attributes=require(_0x439c('0x7'));module['exports']=function(_0x13d2e4,_0x23a055){return _0x13d2e4[_0x439c('0x8')](_0x439c('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x439c('0xa'),_0x439c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0984=['request-promise','path','../../config/environment','./memberReport.attributes','exports','define','membername','interface','lodash','util','../../config/logger','moment','bluebird'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x0984,0xff));var _0x4098=function(_0x2eec39,_0x24b14d){_0x2eec39=_0x2eec39-0x0;var _0x429715=_0x0984[_0x2eec39];return _0x429715;};'use strict';var _=require(_0x4098('0x0'));var util=require(_0x4098('0x1'));var logger=require(_0x4098('0x2'))('api');var moment=require(_0x4098('0x3'));var BPromise=require(_0x4098('0x4'));var rp=require(_0x4098('0x5'));var fs=require('fs');var path=require(_0x4098('0x6'));var rimraf=require('rimraf');var config=require(_0x4098('0x7'));var attributes=require(_0x4098('0x8'));module[_0x4098('0x9')]=function(_0x316399,_0x4991a5){return _0x316399[_0x4098('0xa')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x4098('0xb'),_0x4098('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index a7417ae..d2695d9 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 _0x4fb4=['rpc','../../config/environment','jayson/promise','client','http','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','findAll','options','where','attributes','include','map','model','raw','CreateMemberReport','update','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xad8646,_0x376bbb){var _0x240032=function(_0x507c9a){while(--_0x507c9a){_0xad8646['push'](_0xad8646['shift']());}};_0x240032(++_0x376bbb);}(_0x4fb4,0x190));var _0x44fb=function(_0x4fbbd3,_0x11ddb5){_0x4fbbd3=_0x4fbbd3-0x0;var _0x27427f=_0x4fb4[_0x4fbbd3];return _0x27427f;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var moment=require(_0x44fb('0x1'));var BPromise=require(_0x44fb('0x2'));var rs=require(_0x44fb('0x3'));var fs=require('fs');var Redis=require(_0x44fb('0x4'));var db=require(_0x44fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44fb('0x6'))(_0x44fb('0x7'));var config=require(_0x44fb('0x8'));var jayson=require(_0x44fb('0x9'));var client=jayson[_0x44fb('0xa')][_0x44fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464af5,_0x2a4d75,_0x59aa6d){return new BPromise(function(_0x87f716,_0xd4ead0){return client['request'](_0x464af5,_0x59aa6d)[_0x44fb('0xc')](function(_0x3d9002){logger[_0x44fb('0xd')](_0x44fb('0xe'),_0x2a4d75,_0x44fb('0xf'));logger[_0x44fb('0x10')](_0x44fb('0x11'),_0x2a4d75,_0x44fb('0xf'),JSON[_0x44fb('0x12')](_0x3d9002));if(_0x3d9002[_0x44fb('0x13')]){if(_0x3d9002['error'][_0x44fb('0x14')]===0x1f4){logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x3d9002[_0x44fb('0x13')][_0x44fb('0x15')]);return _0xd4ead0(_0x3d9002['error'][_0x44fb('0x15')]);}logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x3d9002[_0x44fb('0x13')][_0x44fb('0x15')]);return _0x87f716(_0x3d9002['error'][_0x44fb('0x15')]);}else{logger[_0x44fb('0xd')](_0x44fb('0xe'),_0x2a4d75,_0x44fb('0xf'));_0x87f716(_0x3d9002[_0x44fb('0x16')][_0x44fb('0x15')]);}})[_0x44fb('0x17')](function(_0x585559){logger[_0x44fb('0x13')](_0x44fb('0xe'),_0x2a4d75,_0x585559);_0xd4ead0(_0x585559);});});}exports[_0x44fb('0x18')]=function(_0x13cf75){var _0x65f887=this;return new Promise(function(_0x22c2eb,_0x19409a){return db[_0x44fb('0x19')][_0x44fb('0x1a')]({'raw':_0x13cf75[_0x44fb('0x1b')]?_0x13cf75['options']['raw']===undefined?!![]:![]:!![],'where':_0x13cf75['options']?_0x13cf75[_0x44fb('0x1b')][_0x44fb('0x1c')]||null:null,'attributes':_0x13cf75[_0x44fb('0x1b')]?_0x13cf75['options'][_0x44fb('0x1d')]||null:null,'limit':_0x13cf75[_0x44fb('0x1b')]?_0x13cf75[_0x44fb('0x1b')]['limit']||null:null,'include':_0x13cf75['options']?_0x13cf75[_0x44fb('0x1b')][_0x44fb('0x1e')]?_[_0x44fb('0x1f')](_0x13cf75['options'][_0x44fb('0x1e')],function(_0x3563a6){return{'model':db[_0x3563a6[_0x44fb('0x20')]],'as':_0x3563a6['as'],'attributes':_0x3563a6['attributes'],'include':_0x3563a6['include']?_[_0x44fb('0x1f')](_0x3563a6[_0x44fb('0x1e')],function(_0x1c831e){return{'model':db[_0x1c831e[_0x44fb('0x20')]],'as':_0x1c831e['as'],'attributes':_0x1c831e['attributes'],'include':_0x1c831e[_0x44fb('0x1e')]?_[_0x44fb('0x1f')](_0x1c831e['include'],function(_0x5b6ce5){return{'model':db[_0x5b6ce5[_0x44fb('0x20')]],'as':_0x5b6ce5['as'],'attributes':_0x5b6ce5[_0x44fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x44fb('0xc')](function(_0x1f5d4c){logger[_0x44fb('0xd')](_0x44fb('0x18'),_0x13cf75);logger[_0x44fb('0x10')](_0x44fb('0x18'),_0x13cf75,JSON[_0x44fb('0x12')](_0x1f5d4c));_0x22c2eb(_0x1f5d4c);})['catch'](function(_0x48eb7d){logger['error'](_0x44fb('0x18'),_0x48eb7d['message'],_0x13cf75);_0x19409a(_0x65f887[_0x44fb('0x13')](0x1f4,_0x48eb7d[_0x44fb('0x15')]));});});};exports['CreateMemberReport']=function(_0x212b10){var _0x262aa1=this;return new Promise(function(_0xca9051,_0x1b13bb){return db[_0x44fb('0x19')]['create'](_0x212b10['body'],{'raw':_0x212b10[_0x44fb('0x1b')]?_0x212b10['options'][_0x44fb('0x21')]===undefined?!![]:![]:!![]})[_0x44fb('0xc')](function(_0x15aa21){logger[_0x44fb('0xd')](_0x44fb('0x22'),_0x212b10);logger[_0x44fb('0x10')](_0x44fb('0x22'),_0x212b10,JSON[_0x44fb('0x12')](_0x15aa21));_0xca9051(_0x15aa21);})[_0x44fb('0x17')](function(_0x112b5e){logger[_0x44fb('0x13')](_0x44fb('0x22'),_0x112b5e[_0x44fb('0x15')],_0x212b10);_0x1b13bb(_0x262aa1[_0x44fb('0x13')](0x1f4,_0x112b5e[_0x44fb('0x15')]));});});};exports['UpdateMemberReport']=function(_0x5ec419){var _0x47b858=this;return new Promise(function(_0xcc146c,_0x765284){return db[_0x44fb('0x19')][_0x44fb('0x23')](_0x5ec419['body'],{'raw':_0x5ec419[_0x44fb('0x1b')]?_0x5ec419[_0x44fb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec419[_0x44fb('0x1b')]?_0x5ec419['options'][_0x44fb('0x1c')]||null:null,'attributes':_0x5ec419['options']?_0x5ec419[_0x44fb('0x1b')]['attributes']||null:null,'limit':_0x5ec419[_0x44fb('0x1b')]?_0x5ec419['options']['limit']||null:null})[_0x44fb('0xc')](function(_0x43cc77){logger[_0x44fb('0xd')](_0x44fb('0x24'),_0x5ec419);logger[_0x44fb('0x10')](_0x44fb('0x24'),_0x5ec419,JSON[_0x44fb('0x12')](_0x43cc77));_0xcc146c(_0x43cc77);})[_0x44fb('0x17')](function(_0xb96aa4){logger[_0x44fb('0x13')]('UpdateMemberReport',_0xb96aa4[_0x44fb('0x15')],_0x5ec419);_0x765284(_0x47b858[_0x44fb('0x13')](0x1f4,_0xb96aa4[_0x44fb('0x15')]));});});}; \ No newline at end of file +var _0xb2f1=['GetMemberReport','MemberReport','options','raw','where','attributes','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3703c1,_0x501e50){var _0x4cd2d2=function(_0x35cea1){while(--_0x35cea1){_0x3703c1['push'](_0x3703c1['shift']());}};_0x4cd2d2(++_0x501e50);}(_0xb2f1,0xee));var _0x1b2f=function(_0x28393b,_0x48ae14){_0x28393b=_0x28393b-0x0;var _0x18c836=_0xb2f1[_0x28393b];return _0x18c836;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require('moment');var BPromise=require(_0x1b2f('0x2'));var rs=require(_0x1b2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x4'))['db'];var utils=require(_0x1b2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b2f('0x6'));var jayson=require(_0x1b2f('0x7'));var client=jayson[_0x1b2f('0x8')][_0x1b2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57eed1,_0x532834,_0x12a0bf){return new BPromise(function(_0x28a081,_0x5627d3){return client[_0x1b2f('0xa')](_0x57eed1,_0x12a0bf)[_0x1b2f('0xb')](function(_0x5acb30){logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,_0x1b2f('0xe'));logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x532834,_0x1b2f('0xe'),JSON[_0x1b2f('0x11')](_0x5acb30));if(_0x5acb30['error']){if(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x13')]===0x1f4){logger[_0x1b2f('0x12')]('MemberReport,\x20%s,\x20%s',_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x5627d3(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}logger[_0x1b2f('0x12')](_0x1b2f('0xd'),_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x28a081(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}else{logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,'request\x20sent');_0x28a081(_0x5acb30['result'][_0x1b2f('0x14')]);}})['catch'](function(_0x4cdc0d){logger['error'](_0x1b2f('0xd'),_0x532834,_0x4cdc0d);_0x5627d3(_0x4cdc0d);});});}exports[_0x1b2f('0x15')]=function(_0x5528de){var _0x498928=this;return new Promise(function(_0x382594,_0x4a195a){return db[_0x1b2f('0x16')]['findAll']({'raw':_0x5528de[_0x1b2f('0x17')]?_0x5528de[_0x1b2f('0x17')][_0x1b2f('0x18')]===undefined?!![]:![]:!![],'where':_0x5528de[_0x1b2f('0x17')]?_0x5528de[_0x1b2f('0x17')][_0x1b2f('0x19')]||null:null,'attributes':_0x5528de[_0x1b2f('0x17')]?_0x5528de[_0x1b2f('0x17')][_0x1b2f('0x1a')]||null:null,'limit':_0x5528de['options']?_0x5528de[_0x1b2f('0x17')]['limit']||null:null,'include':_0x5528de[_0x1b2f('0x17')]?_0x5528de[_0x1b2f('0x17')][_0x1b2f('0x1b')]?_[_0x1b2f('0x1c')](_0x5528de['options'][_0x1b2f('0x1b')],function(_0x829d0f){return{'model':db[_0x829d0f[_0x1b2f('0x1d')]],'as':_0x829d0f['as'],'attributes':_0x829d0f[_0x1b2f('0x1a')],'include':_0x829d0f['include']?_[_0x1b2f('0x1c')](_0x829d0f[_0x1b2f('0x1b')],function(_0x569493){return{'model':db[_0x569493[_0x1b2f('0x1d')]],'as':_0x569493['as'],'attributes':_0x569493['attributes'],'include':_0x569493['include']?_[_0x1b2f('0x1c')](_0x569493[_0x1b2f('0x1b')],function(_0x36a413){return{'model':db[_0x36a413[_0x1b2f('0x1d')]],'as':_0x36a413['as'],'attributes':_0x36a413[_0x1b2f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x172ad5){logger[_0x1b2f('0xc')](_0x1b2f('0x15'),_0x5528de);logger[_0x1b2f('0xf')]('GetMemberReport',_0x5528de,JSON['stringify'](_0x172ad5));_0x382594(_0x172ad5);})[_0x1b2f('0x1e')](function(_0x40bde4){logger[_0x1b2f('0x12')](_0x1b2f('0x15'),_0x40bde4[_0x1b2f('0x14')],_0x5528de);_0x4a195a(_0x498928['error'](0x1f4,_0x40bde4['message']));});});};exports[_0x1b2f('0x1f')]=function(_0x13e55e){var _0x5d9d94=this;return new Promise(function(_0x41649b,_0x3b76e2){return db[_0x1b2f('0x16')][_0x1b2f('0x20')](_0x13e55e[_0x1b2f('0x21')],{'raw':_0x13e55e[_0x1b2f('0x17')]?_0x13e55e['options'][_0x1b2f('0x18')]===undefined?!![]:![]:!![]})[_0x1b2f('0xb')](function(_0x17dd37){logger[_0x1b2f('0xc')](_0x1b2f('0x1f'),_0x13e55e);logger[_0x1b2f('0xf')](_0x1b2f('0x1f'),_0x13e55e,JSON[_0x1b2f('0x11')](_0x17dd37));_0x41649b(_0x17dd37);})[_0x1b2f('0x1e')](function(_0xc6ed69){logger[_0x1b2f('0x12')](_0x1b2f('0x1f'),_0xc6ed69[_0x1b2f('0x14')],_0x13e55e);_0x3b76e2(_0x5d9d94['error'](0x1f4,_0xc6ed69[_0x1b2f('0x14')]));});});};exports[_0x1b2f('0x22')]=function(_0x2e3b66){var _0x58c25b=this;return new Promise(function(_0x53f8ca,_0x28c0bd){return db[_0x1b2f('0x16')][_0x1b2f('0x23')](_0x2e3b66[_0x1b2f('0x21')],{'raw':_0x2e3b66[_0x1b2f('0x17')]?_0x2e3b66[_0x1b2f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e3b66['options']?_0x2e3b66[_0x1b2f('0x17')][_0x1b2f('0x19')]||null:null,'attributes':_0x2e3b66[_0x1b2f('0x17')]?_0x2e3b66[_0x1b2f('0x17')][_0x1b2f('0x1a')]||null:null,'limit':_0x2e3b66['options']?_0x2e3b66[_0x1b2f('0x17')][_0x1b2f('0x24')]||null:null})['then'](function(_0x413d3e){logger[_0x1b2f('0xc')](_0x1b2f('0x22'),_0x2e3b66);logger['debug']('UpdateMemberReport',_0x2e3b66,JSON[_0x1b2f('0x11')](_0x413d3e));_0x53f8ca(_0x413d3e);})[_0x1b2f('0x1e')](function(_0x5a2b7e){logger[_0x1b2f('0x12')]('UpdateMemberReport',_0x5a2b7e[_0x1b2f('0x14')],_0x2e3b66);_0x28c0bd(_0x58c25b['error'](0x1f4,_0x5a2b7e['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6624cd9..befca48 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 _0xb190=['util','path','connect-timeout','Router','../../components/auth/service','get','index','exports','multer'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb190,0xce));var _0x0b19=function(_0x5a68ba,_0x29927a){_0x5a68ba=_0x5a68ba-0x0;var _0x14e92f=_0xb190[_0x5a68ba];return _0x14e92f;};'use strict';var multer=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var path=require(_0x0b19('0x2'));var timeout=require(_0x0b19('0x3'));var express=require('express');var router=express[_0x0b19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b19('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x0b19('0x6')]('/',controller[_0x0b19('0x7')]);module[_0x0b19('0x8')]=router; \ No newline at end of file +var _0x04ad=['./migration.controller','get','index','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x04ad,0x1d2));var _0xd04a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x04ad[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd04a('0x0'));var timeout=require(_0xd04a('0x1'));var express=require(_0xd04a('0x2'));var router=express[_0xd04a('0x3')]();var fs_extra=require(_0xd04a('0x4'));var auth=require(_0xd04a('0x5'));var interaction=require(_0xd04a('0x6'));var config=require('../../config/environment');var controller=require(_0xd04a('0x7'));router[_0xd04a('0x8')]('/',controller[_0xd04a('0x9')]);module[_0xd04a('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 0293a0f..8ff9893 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 _0xa892=['STRING','version'];(function(_0x23b009,_0xc96d27){var _0x37cd21=function(_0x52c4de){while(--_0x52c4de){_0x23b009['push'](_0x23b009['shift']());}};_0x37cd21(++_0xc96d27);}(_0xa892,0x154));var _0x2a89=function(_0x4e75cf,_0x1ff526){_0x4e75cf=_0x4e75cf-0x0;var _0x4fb151=_0xa892[_0x4e75cf];return _0x4fb151;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x2a89('0x0')],'unique':_0x2a89('0x1')}}; \ No newline at end of file +var _0x7ac0=['STRING','sequelize','exports'];(function(_0x51126e,_0xbc3afd){var _0xdc3f13=function(_0x407c9f){while(--_0x407c9f){_0x51126e['push'](_0x51126e['shift']());}};_0xdc3f13(++_0xbc3afd);}(_0x7ac0,0x1d8));var _0x07ac=function(_0x3ba08e,_0x4f4747){_0x3ba08e=_0x3ba08e-0x0;var _0x3693b9=_0x7ac0[_0x3ba08e];return _0x3693b9;};'use strict';var Sequelize=require(_0x07ac('0x0'));module[_0x07ac('0x1')]={'version':{'type':Sequelize[_0x07ac('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0e8b41d..a1f4542 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 _0xb2f3=['limit','Content-Range','json','apply','save','update','then','end','error','stack','name','map','Migration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','zip-dir','moment','mustache','util','sox','ejs','fs-extra','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','sendStatus','status','offset','count'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xb2f3,0x1b9));var _0x3b2f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xb2f3[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b2f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b2f('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x3b2f('0x2'));var util=require(_0x3b2f('0x3'));var path=require('path');var sox=require(_0x3b2f('0x4'));var csv=require('to-csv');var ejs=require(_0x3b2f('0x5'));var fs=require('fs');var fs_extra=require(_0x3b2f('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3b2f('0x7'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b2f('0x8'));var authService=require(_0x3b2f('0x9'));var qs=require(_0x3b2f('0xa'));var as=require(_0x3b2f('0xb'));var hardwareService=require(_0x3b2f('0xc'));var logger=require(_0x3b2f('0xd'))(_0x3b2f('0xe'));var utils=require(_0x3b2f('0xf'));var config=require(_0x3b2f('0x10'));var licenseUtil=require(_0x3b2f('0x11'));var db=require(_0x3b2f('0x12'))['db'];function respondWithStatusCode(_0x3b736e,_0x2f755f){_0x2f755f=_0x2f755f||0xcc;return function(_0x47172a){if(_0x47172a){return _0x3b736e[_0x3b2f('0x13')](_0x2f755f);}return _0x3b736e[_0x3b2f('0x14')](_0x2f755f)['end']();};}function respondWithResult(_0x29639c,_0x3e46e1){_0x3e46e1=_0x3e46e1||0xc8;return function(_0x57cd66){if(_0x57cd66){return _0x29639c[_0x3b2f('0x14')](_0x3e46e1)['json'](_0x57cd66);}};}function respondWithFilteredResult(_0x204f6c,_0x59d8bb){return function(_0x3e7bab){if(_0x3e7bab){var _0x51cd15=typeof _0x59d8bb[_0x3b2f('0x15')]==='undefined'&&typeof _0x59d8bb['limit']==='undefined';var _0x500624=_0x3e7bab[_0x3b2f('0x16')];var _0x565243=_0x51cd15?0x0:_0x59d8bb[_0x3b2f('0x15')];var _0x38c1c9=_0x51cd15?_0x3e7bab[_0x3b2f('0x16')]:_0x59d8bb[_0x3b2f('0x15')]+_0x59d8bb[_0x3b2f('0x17')];var _0x786332;if(_0x38c1c9>=_0x500624){_0x38c1c9=_0x500624;_0x786332=0xc8;}else{_0x786332=0xce;}_0x204f6c['status'](_0x786332);return _0x204f6c['set'](_0x3b2f('0x18'),_0x565243+'-'+_0x38c1c9+'/'+_0x500624)[_0x3b2f('0x19')](_0x3e7bab);}return null;};}function patchUpdates(_0x2fd0f1){return function(_0x5de36c){try{jsonpatch[_0x3b2f('0x1a')](_0x5de36c,_0x2fd0f1,!![]);}catch(_0x7bcb77){return BPromise['reject'](_0x7bcb77);}return _0x5de36c[_0x3b2f('0x1b')]();};}function saveUpdates(_0x5c9ec4,_0x5c5016){return function(_0x384665){if(_0x384665){return _0x384665[_0x3b2f('0x1c')](_0x5c9ec4)[_0x3b2f('0x1d')](function(_0x1f0f63){return _0x1f0f63;});}return null;};}function removeEntity(_0x4a1449,_0xa72a9a){return function(_0x4317c9){if(_0x4317c9){return _0x4317c9['destroy']()[_0x3b2f('0x1d')](function(){_0x4a1449[_0x3b2f('0x14')](0xcc)[_0x3b2f('0x1e')]();});}};}function handleEntityNotFound(_0xad997e,_0x23cc8c){return function(_0x2ff163){if(!_0x2ff163){_0xad997e[_0x3b2f('0x13')](0x194);}return _0x2ff163;};}function handleError(_0x173395,_0x53b558){_0x53b558=_0x53b558||0x1f4;return function(_0x23a2d3){logger[_0x3b2f('0x1f')](_0x23a2d3[_0x3b2f('0x20')]);if(_0x23a2d3[_0x3b2f('0x21')]){delete _0x23a2d3[_0x3b2f('0x21')];}_0x173395[_0x3b2f('0x14')](_0x53b558)['send'](_0x23a2d3);};}exports['index']=function(_0x55b5d4,_0xfedba1){var _0x3b9510={},_0x5dfcf3={},_0x475799={'count':0x0,'rows':[]};var _0x97f209=_[_0x3b2f('0x22')](db[_0x3b2f('0x23')][_0x3b2f('0x24')],function(_0x118a9e){return{'name':_0x118a9e[_0x3b2f('0x25')],'type':_0x118a9e[_0x3b2f('0x26')]['key']};});_0x5dfcf3[_0x3b2f('0x27')]=_[_0x3b2f('0x22')](_0x97f209,_0x3b2f('0x21'));_0x5dfcf3[_0x3b2f('0x28')]=_['keys'](_0x55b5d4['query']);_0x5dfcf3['filters']=_[_0x3b2f('0x29')](_0x5dfcf3['model'],_0x5dfcf3[_0x3b2f('0x28')]);_0x3b9510[_0x3b2f('0x2a')]=_[_0x3b2f('0x29')](_0x5dfcf3[_0x3b2f('0x27')],qs[_0x3b2f('0x2b')](_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x2b')]));_0x3b9510[_0x3b2f('0x2a')]=_0x3b9510[_0x3b2f('0x2a')][_0x3b2f('0x2c')]?_0x3b9510[_0x3b2f('0x2a')]:_0x5dfcf3[_0x3b2f('0x27')];if(!_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x2d')](_0x3b2f('0x2e'))){_0x3b9510[_0x3b2f('0x17')]=qs[_0x3b2f('0x17')](_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x17')]);_0x3b9510[_0x3b2f('0x15')]=qs[_0x3b2f('0x15')](_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x15')]);}_0x3b9510[_0x3b2f('0x2f')]=qs[_0x3b2f('0x30')](_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x30')]);_0x3b9510['where']=qs['filters'](_['pick'](_0x55b5d4[_0x3b2f('0x28')],_0x5dfcf3[_0x3b2f('0x31')]),_0x97f209);if(_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x32')]){_0x3b9510[_0x3b2f('0x33')]=_[_0x3b2f('0x34')](_0x3b9510['where'],{'$or':_[_0x3b2f('0x22')](_0x97f209,function(_0x5aaa15){if(_0x5aaa15[_0x3b2f('0x26')]!=='VIRTUAL'){var _0x5ef373={};_0x5ef373[_0x5aaa15['name']]={'$like':'%'+_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x32')]+'%'};return _0x5ef373;}})});}_0x3b9510=_[_0x3b2f('0x34')]({},_0x3b9510,_0x55b5d4[_0x3b2f('0x35')]);var _0x4ab31c={'where':_0x3b9510[_0x3b2f('0x33')]};return db[_0x3b2f('0x23')]['count'](_0x4ab31c)[_0x3b2f('0x1d')](function(_0x4eddea){_0x475799[_0x3b2f('0x16')]=_0x4eddea;if(_0x55b5d4[_0x3b2f('0x28')][_0x3b2f('0x36')]){_0x3b9510[_0x3b2f('0x37')]=[{'all':!![]}];}return db[_0x3b2f('0x23')]['findAll'](_0x3b9510);})[_0x3b2f('0x1d')](function(_0x58c5b5){_0x475799[_0x3b2f('0x38')]=_0x58c5b5;return _0x475799;})[_0x3b2f('0x1d')](respondWithFilteredResult(_0xfedba1,_0x3b9510))[_0x3b2f('0x39')](handleError(_0xfedba1,null));}; \ No newline at end of file +var _0x78bc=['to-csv','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','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','Migration','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1132c7,_0x4a733d){var _0x56b032=function(_0x1dbd92){while(--_0x1dbd92){_0x1132c7['push'](_0x1132c7['shift']());}};_0x56b032(++_0x4a733d);}(_0x78bc,0xd8));var _0xc78b=function(_0x54ffbe,_0x871d26){_0x54ffbe=_0x54ffbe-0x0;var _0x492913=_0x78bc[_0x54ffbe];return _0x492913;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc78b('0x0'));var zipdir=require(_0xc78b('0x1'));var jsonpatch=require(_0xc78b('0x2'));var rp=require(_0xc78b('0x3'));var moment=require(_0xc78b('0x4'));var BPromise=require(_0xc78b('0x5'));var Mustache=require(_0xc78b('0x6'));var util=require(_0xc78b('0x7'));var path=require(_0xc78b('0x8'));var sox=require('sox');var csv=require(_0xc78b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc78b('0xa'));var _=require(_0xc78b('0xb'));var squel=require(_0xc78b('0xc'));var crypto=require(_0xc78b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc78b('0xe'));var toCsv=require(_0xc78b('0x9'));var querystring=require(_0xc78b('0xf'));var Papa=require('papaparse');var Redis=require(_0xc78b('0x10'));var authService=require(_0xc78b('0x11'));var qs=require(_0xc78b('0x12'));var as=require(_0xc78b('0x13'));var hardwareService=require(_0xc78b('0x14'));var logger=require(_0xc78b('0x15'))(_0xc78b('0x16'));var utils=require('../../config/utils');var config=require(_0xc78b('0x17'));var licenseUtil=require(_0xc78b('0x18'));var db=require(_0xc78b('0x19'))['db'];function respondWithStatusCode(_0x3e31ab,_0x5535ed){_0x5535ed=_0x5535ed||0xcc;return function(_0x36500e){if(_0x36500e){return _0x3e31ab[_0xc78b('0x1a')](_0x5535ed);}return _0x3e31ab[_0xc78b('0x1b')](_0x5535ed)['end']();};}function respondWithResult(_0x2745e4,_0x400a2c){_0x400a2c=_0x400a2c||0xc8;return function(_0x3f0e94){if(_0x3f0e94){return _0x2745e4[_0xc78b('0x1b')](_0x400a2c)[_0xc78b('0x1c')](_0x3f0e94);}};}function respondWithFilteredResult(_0x1664c9,_0x1ca16b){return function(_0x3b4bf9){if(_0x3b4bf9){var _0x55f487=typeof _0x1ca16b['offset']===_0xc78b('0x1d')&&typeof _0x1ca16b[_0xc78b('0x1e')]==='undefined';var _0x44c160=_0x3b4bf9[_0xc78b('0x1f')];var _0x5f47ce=_0x55f487?0x0:_0x1ca16b['offset'];var _0x5bb3ad=_0x55f487?_0x3b4bf9['count']:_0x1ca16b[_0xc78b('0x20')]+_0x1ca16b[_0xc78b('0x1e')];var _0x1944a8;if(_0x5bb3ad>=_0x44c160){_0x5bb3ad=_0x44c160;_0x1944a8=0xc8;}else{_0x1944a8=0xce;}_0x1664c9[_0xc78b('0x1b')](_0x1944a8);return _0x1664c9[_0xc78b('0x21')](_0xc78b('0x22'),_0x5f47ce+'-'+_0x5bb3ad+'/'+_0x44c160)[_0xc78b('0x1c')](_0x3b4bf9);}return null;};}function patchUpdates(_0x253684){return function(_0x47ed60){try{jsonpatch[_0xc78b('0x23')](_0x47ed60,_0x253684,!![]);}catch(_0xee9b5e){return BPromise[_0xc78b('0x24')](_0xee9b5e);}return _0x47ed60[_0xc78b('0x25')]();};}function saveUpdates(_0x1a771d,_0x31654e){return function(_0xbc4932){if(_0xbc4932){return _0xbc4932[_0xc78b('0x26')](_0x1a771d)[_0xc78b('0x27')](function(_0x4e6a11){return _0x4e6a11;});}return null;};}function removeEntity(_0x2d01e3,_0xe423ea){return function(_0x235ee1){if(_0x235ee1){return _0x235ee1[_0xc78b('0x28')]()[_0xc78b('0x27')](function(){_0x2d01e3[_0xc78b('0x1b')](0xcc)[_0xc78b('0x29')]();});}};}function handleEntityNotFound(_0x5f465a,_0x2eba72){return function(_0x1c942e){if(!_0x1c942e){_0x5f465a[_0xc78b('0x1a')](0x194);}return _0x1c942e;};}function handleError(_0x1a8510,_0x54dbf0){_0x54dbf0=_0x54dbf0||0x1f4;return function(_0x21d983){logger[_0xc78b('0x2a')](_0x21d983[_0xc78b('0x2b')]);if(_0x21d983[_0xc78b('0x2c')]){delete _0x21d983[_0xc78b('0x2c')];}_0x1a8510['status'](_0x54dbf0)['send'](_0x21d983);};}exports[_0xc78b('0x2d')]=function(_0x1320b9,_0x2ffbce){var _0x3ab2ac={},_0x1a7a4c={},_0x1ef27b={'count':0x0,'rows':[]};var _0x306305=_['map'](db['Migration'][_0xc78b('0x2e')],function(_0x1cf3e0){return{'name':_0x1cf3e0[_0xc78b('0x2f')],'type':_0x1cf3e0[_0xc78b('0x30')][_0xc78b('0x31')]};});_0x1a7a4c[_0xc78b('0x32')]=_[_0xc78b('0x33')](_0x306305,_0xc78b('0x2c'));_0x1a7a4c['query']=_[_0xc78b('0x34')](_0x1320b9['query']);_0x1a7a4c[_0xc78b('0x35')]=_['intersection'](_0x1a7a4c[_0xc78b('0x32')],_0x1a7a4c[_0xc78b('0x36')]);_0x3ab2ac[_0xc78b('0x37')]=_[_0xc78b('0x38')](_0x1a7a4c[_0xc78b('0x32')],qs[_0xc78b('0x39')](_0x1320b9[_0xc78b('0x36')][_0xc78b('0x39')]));_0x3ab2ac[_0xc78b('0x37')]=_0x3ab2ac['attributes'][_0xc78b('0x3a')]?_0x3ab2ac['attributes']:_0x1a7a4c[_0xc78b('0x32')];if(!_0x1320b9[_0xc78b('0x36')][_0xc78b('0x3b')](_0xc78b('0x3c'))){_0x3ab2ac[_0xc78b('0x1e')]=qs[_0xc78b('0x1e')](_0x1320b9[_0xc78b('0x36')][_0xc78b('0x1e')]);_0x3ab2ac[_0xc78b('0x20')]=qs[_0xc78b('0x20')](_0x1320b9['query'][_0xc78b('0x20')]);}_0x3ab2ac[_0xc78b('0x3d')]=qs[_0xc78b('0x3e')](_0x1320b9[_0xc78b('0x36')][_0xc78b('0x3e')]);_0x3ab2ac['where']=qs['filters'](_[_0xc78b('0x3f')](_0x1320b9[_0xc78b('0x36')],_0x1a7a4c[_0xc78b('0x35')]),_0x306305);if(_0x1320b9[_0xc78b('0x36')][_0xc78b('0x40')]){_0x3ab2ac[_0xc78b('0x41')]=_[_0xc78b('0x42')](_0x3ab2ac[_0xc78b('0x41')],{'$or':_[_0xc78b('0x33')](_0x306305,function(_0x449db4){if(_0x449db4['type']!==_0xc78b('0x43')){var _0x5b83c3={};_0x5b83c3[_0x449db4[_0xc78b('0x2c')]]={'$like':'%'+_0x1320b9[_0xc78b('0x36')][_0xc78b('0x40')]+'%'};return _0x5b83c3;}})});}_0x3ab2ac=_[_0xc78b('0x42')]({},_0x3ab2ac,_0x1320b9[_0xc78b('0x44')]);var _0x575cd2={'where':_0x3ab2ac[_0xc78b('0x41')]};return db['Migration']['count'](_0x575cd2)[_0xc78b('0x27')](function(_0x3c0989){_0x1ef27b[_0xc78b('0x1f')]=_0x3c0989;if(_0x1320b9[_0xc78b('0x36')][_0xc78b('0x45')]){_0x3ab2ac[_0xc78b('0x46')]=[{'all':!![]}];}return db[_0xc78b('0x47')][_0xc78b('0x48')](_0x3ab2ac);})[_0xc78b('0x27')](function(_0x29e259){_0x1ef27b[_0xc78b('0x49')]=_0x29e259;return _0x1ef27b;})[_0xc78b('0x27')](respondWithFilteredResult(_0x2ffbce,_0x3ab2ac))[_0xc78b('0x4a')](handleError(_0x2ffbce,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8e1af68..33320c1 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 _0xf9ba=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','Migration','util'];(function(_0x332005,_0x24edf1){var _0x4393e1=function(_0x352f93){while(--_0x352f93){_0x332005['push'](_0x332005['shift']());}};_0x4393e1(++_0x24edf1);}(_0xf9ba,0x121));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xaf9b('0x0'));var logger=require(_0xaf9b('0x1'))(_0xaf9b('0x2'));var moment=require(_0xaf9b('0x3'));var BPromise=require(_0xaf9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf9b('0x5'));var rimraf=require(_0xaf9b('0x6'));var config=require(_0xaf9b('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x51fd1f,_0x3e2155){return _0x51fd1f[_0xaf9b('0x8')](_0xaf9b('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc54c=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x2225ab,_0x31051d){var _0x2c42df=function(_0x250a19){while(--_0x250a19){_0x2225ab['push'](_0x2225ab['shift']());}};_0x2c42df(++_0x31051d);}(_0xc54c,0x145));var _0xcc54=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xc54c[_0x30d87a];return _0x48f64b;};'use strict';var _=require(_0xcc54('0x0'));var util=require(_0xcc54('0x1'));var logger=require('../../config/logger')(_0xcc54('0x2'));var moment=require(_0xcc54('0x3'));var BPromise=require(_0xcc54('0x4'));var rp=require(_0xcc54('0x5'));var fs=require('fs');var path=require(_0xcc54('0x6'));var rimraf=require(_0xcc54('0x7'));var config=require(_0xcc54('0x8'));var attributes=require(_0xcc54('0x9'));module[_0xcc54('0xa')]=function(_0x40b8a3,_0x174546){return _0x40b8a3[_0xcc54('0xb')](_0xcc54('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index fffcce2..e1952a5 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 _0x89e8=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0xb4a27,_0x1bbc8e){var _0x164ada=function(_0x460f36){while(--_0x460f36){_0xb4a27['push'](_0xb4a27['shift']());}};_0x164ada(++_0x1bbc8e);}(_0x89e8,0x74));var _0x889e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x89e8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Migration,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Migration,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});} \ No newline at end of file +var _0x30fe=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x30fe,0x149));var _0xe30f=function(_0x54b568,_0x42e347){_0x54b568=_0x54b568-0x0;var _0x2420bf=_0x30fe[_0x54b568];return _0x2420bf;};'use strict';var _=require('lodash');var util=require(_0xe30f('0x0'));var moment=require('moment');var BPromise=require(_0xe30f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe30f('0x2'));var db=require(_0xe30f('0x3'))['db'];var utils=require(_0xe30f('0x4'));var logger=require(_0xe30f('0x5'))(_0xe30f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe30f('0x7'));var client=jayson[_0xe30f('0x8')][_0xe30f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x346a51,_0x442a51,_0x3af889){return new BPromise(function(_0x2f94d2,_0x2243f2){return client[_0xe30f('0xa')](_0x346a51,_0x3af889)[_0xe30f('0xb')](function(_0x5ab6b8){logger[_0xe30f('0xc')](_0xe30f('0xd'),_0x442a51,'request\x20sent');logger[_0xe30f('0xe')](_0xe30f('0xf'),_0x442a51,_0xe30f('0x10'),JSON[_0xe30f('0x11')](_0x5ab6b8));if(_0x5ab6b8['error']){if(_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x13')]===0x1f4){logger[_0xe30f('0x12')]('Migration,\x20%s,\x20%s',_0x442a51,_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x14')]);return _0x2243f2(_0x5ab6b8[_0xe30f('0x12')]['message']);}logger[_0xe30f('0x12')](_0xe30f('0xd'),_0x442a51,_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x14')]);return _0x2f94d2(_0x5ab6b8['error']['message']);}else{logger['info'](_0xe30f('0xd'),_0x442a51,_0xe30f('0x10'));_0x2f94d2(_0x5ab6b8[_0xe30f('0x15')][_0xe30f('0x14')]);}})['catch'](function(_0x1f19bf){logger['error'](_0xe30f('0xd'),_0x442a51,_0x1f19bf);_0x2243f2(_0x1f19bf);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 94a4794..a128124 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 _0xad40=['get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x14e787,_0x8d6c2e){var _0x46d289=function(_0x2b6ab3){while(--_0x2b6ab3){_0x14e787['push'](_0x14e787['shift']());}};_0x46d289(++_0x8d6c2e);}(_0xad40,0xfa));var _0x0ad4=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xad40[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0ad4('0x0'));var util=require(_0x0ad4('0x1'));var path=require(_0x0ad4('0x2'));var timeout=require(_0x0ad4('0x3'));var express=require('express');var router=express[_0x0ad4('0x4')]();var fs_extra=require(_0x0ad4('0x5'));var auth=require(_0x0ad4('0x6'));var interaction=require(_0x0ad4('0x7'));var config=require(_0x0ad4('0x8'));var controller=require(_0x0ad4('0x9'));router[_0x0ad4('0xa')]('/',auth['isAuthenticated'](),controller[_0x0ad4('0xb')]);router[_0x0ad4('0xa')](_0x0ad4('0xc'),auth[_0x0ad4('0xd')](),controller[_0x0ad4('0xe')]);router[_0x0ad4('0xf')]('/',auth[_0x0ad4('0xd')](),controller['create']);router[_0x0ad4('0x10')](_0x0ad4('0xc'),auth[_0x0ad4('0xd')](),controller[_0x0ad4('0x11')]);router[_0x0ad4('0x12')](_0x0ad4('0xc'),auth[_0x0ad4('0xd')](),controller['destroy']);module[_0x0ad4('0x13')]=router; \ No newline at end of file +var _0x631c=['/:id','isAuthenticated','create','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','index'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x631c,0x1b6));var _0xc631=function(_0x32e4c4,_0xc2259c){_0x32e4c4=_0x32e4c4-0x0;var _0x47ba5f=_0x631c[_0x32e4c4];return _0x47ba5f;};'use strict';var multer=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var path=require('path');var timeout=require(_0xc631('0x2'));var express=require(_0xc631('0x3'));var router=express['Router']();var fs_extra=require(_0xc631('0x4'));var auth=require(_0xc631('0x5'));var interaction=require(_0xc631('0x6'));var config=require('../../config/environment');var controller=require(_0xc631('0x7'));router[_0xc631('0x8')]('/',auth['isAuthenticated'](),controller[_0xc631('0x9')]);router['get'](_0xc631('0xa'),auth[_0xc631('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc631('0xc')]);router['put'](_0xc631('0xa'),auth[_0xc631('0xb')](),controller[_0xc631('0xd')]);router['delete'](_0xc631('0xa'),auth[_0xc631('0xb')](),controller[_0xc631('0xe')]);module[_0xc631('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 0825fcb..e12cf15 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 _0x4c16=['localnet','externip','stun','turn','STRING','sequelize','ENUM'];(function(_0x2e7048,_0x551590){var _0x789806=function(_0xcebf0){while(--_0xcebf0){_0x2e7048['push'](_0x2e7048['shift']());}};_0x789806(++_0x551590);}(_0x4c16,0x163));var _0x64c1=function(_0x23dda5,_0x221860){_0x23dda5=_0x23dda5-0x0;var _0x32c24e=_0x4c16[_0x23dda5];return _0x32c24e;};'use strict';var Sequelize=require(_0x64c1('0x0'));module['exports']={'type':{'type':Sequelize[_0x64c1('0x1')](_0x64c1('0x2'),_0x64c1('0x3'),_0x64c1('0x4'),_0x64c1('0x5'))},'value':{'type':Sequelize[_0x64c1('0x6')]},'username':{'type':Sequelize[_0x64c1('0x6')]},'password':{'type':Sequelize[_0x64c1('0x6')]}}; \ No newline at end of file +var _0x3bbd=['STRING','sequelize','exports','ENUM','localnet','externip','turn'];(function(_0x152547,_0x23189c){var _0x1f828d=function(_0xdff426){while(--_0xdff426){_0x152547['push'](_0x152547['shift']());}};_0x1f828d(++_0x23189c);}(_0x3bbd,0x158));var _0xd3bb=function(_0x3e2f27,_0x241f9d){_0x3e2f27=_0x3e2f27-0x0;var _0x5f076f=_0x3bbd[_0x3e2f27];return _0x5f076f;};'use strict';var Sequelize=require(_0xd3bb('0x0'));module[_0xd3bb('0x1')]={'type':{'type':Sequelize[_0xd3bb('0x2')](_0xd3bb('0x3'),_0xd3bb('0x4'),'stun',_0xd3bb('0x5'))},'value':{'type':Sequelize[_0xd3bb('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd3bb('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d7d95ee..ffccdcd 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 _0x3b36=['status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','sendStatus','stack','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Network','find','catch','sequelize','create','body','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','join','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','transaction','chan_sip.so','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3b36,0x181));var _0x63b3=function(_0x41992d,_0x12e9e1){_0x41992d=_0x41992d-0x0;var _0x9d5d29=_0x3b36[_0x41992d];return _0x9d5d29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63b3('0x1'));var rp=require(_0x63b3('0x2'));var moment=require(_0x63b3('0x3'));var BPromise=require(_0x63b3('0x4'));var Mustache=require(_0x63b3('0x5'));var util=require(_0x63b3('0x6'));var path=require(_0x63b3('0x7'));var sox=require(_0x63b3('0x8'));var csv=require(_0x63b3('0x9'));var ejs=require(_0x63b3('0xa'));var fs=require('fs');var fs_extra=require(_0x63b3('0xb'));var _=require(_0x63b3('0xc'));var squel=require(_0x63b3('0xd'));var crypto=require(_0x63b3('0xe'));var jsforce=require(_0x63b3('0xf'));var deskjs=require(_0x63b3('0x10'));var toCsv=require(_0x63b3('0x9'));var querystring=require(_0x63b3('0x11'));var Papa=require(_0x63b3('0x12'));var Redis=require('ioredis');var authService=require(_0x63b3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x63b3('0x14'));var hardwareService=require(_0x63b3('0x15'));var logger=require(_0x63b3('0x16'))(_0x63b3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x63b3('0x18'));var db=require(_0x63b3('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x63b3('0x1a')][_0x63b3('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1198f2,_0x31340b,_0x5f4623,_0x3ab666){return new BPromise(function(_0x566f33,_0x348bcc){var _0x16aecc=_0x3ab666||client;return _0x16aecc[_0x63b3('0x1c')](_0x1198f2,_0x5f4623)[_0x63b3('0x1d')](function(_0x343a54){logger[_0x63b3('0x1e')]('Network,\x20%s,\x20%s',_0x31340b,'request\x20sent');logger[_0x63b3('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x31340b,_0x63b3('0x20'),JSON[_0x63b3('0x21')](_0x343a54));if(_0x343a54['error']){if(_0x343a54[_0x63b3('0x22')][_0x63b3('0x23')]===0x1f4){logger[_0x63b3('0x22')](_0x63b3('0x24'),_0x31340b,_0x343a54[_0x63b3('0x22')][_0x63b3('0x25')]);return _0x348bcc(_0x343a54[_0x63b3('0x22')]['message']);}logger[_0x63b3('0x22')](_0x63b3('0x24'),_0x31340b,_0x343a54['error'][_0x63b3('0x25')]);return _0x566f33(_0x343a54[_0x63b3('0x22')][_0x63b3('0x25')]);}else{logger[_0x63b3('0x1e')](_0x63b3('0x24'),_0x31340b,_0x63b3('0x20'));_0x566f33(_0x343a54[_0x63b3('0x26')][_0x63b3('0x25')]);}})['catch'](function(_0x328fc1){logger[_0x63b3('0x22')](_0x63b3('0x24'),_0x31340b,_0x328fc1);_0x348bcc(_0x328fc1);});});}function respondWithStatusCode(_0x175a6a,_0x1778fe){_0x1778fe=_0x1778fe||0xcc;return function(_0x4248bb){if(_0x4248bb){return _0x175a6a['sendStatus'](_0x1778fe);}return _0x175a6a[_0x63b3('0x27')](_0x1778fe)[_0x63b3('0x28')]();};}function respondWithResult(_0x34f8aa,_0x53fc34){_0x53fc34=_0x53fc34||0xc8;return function(_0x26a53e){if(_0x26a53e){return _0x34f8aa['status'](_0x53fc34)[_0x63b3('0x29')](_0x26a53e);}};}function respondWithFilteredResult(_0x89efa2,_0xfc946f){return function(_0x130451){if(_0x130451){var _0x243089=typeof _0xfc946f[_0x63b3('0x2a')]===_0x63b3('0x2b')&&typeof _0xfc946f[_0x63b3('0x2c')]==='undefined';var _0xbcc84a=_0x130451[_0x63b3('0x2d')];var _0x1153e2=_0x243089?0x0:_0xfc946f[_0x63b3('0x2a')];var _0x383a78=_0x243089?_0x130451[_0x63b3('0x2d')]:_0xfc946f[_0x63b3('0x2a')]+_0xfc946f[_0x63b3('0x2c')];var _0x1c0d0d;if(_0x383a78>=_0xbcc84a){_0x383a78=_0xbcc84a;_0x1c0d0d=0xc8;}else{_0x1c0d0d=0xce;}_0x89efa2[_0x63b3('0x27')](_0x1c0d0d);return _0x89efa2['set']('Content-Range',_0x1153e2+'-'+_0x383a78+'/'+_0xbcc84a)['json'](_0x130451);}return null;};}function patchUpdates(_0x296347){return function(_0xb4bc6){try{jsonpatch[_0x63b3('0x2e')](_0xb4bc6,_0x296347,!![]);}catch(_0x46943e){return BPromise[_0x63b3('0x2f')](_0x46943e);}return _0xb4bc6[_0x63b3('0x30')]();};}function saveUpdates(_0xf878c2,_0x3065dd){return function(_0x123d44){if(_0x123d44){return _0x123d44[_0x63b3('0x31')](_0xf878c2)[_0x63b3('0x1d')](function(_0x15600f){return _0x15600f;});}return null;};}function removeEntity(_0x3843d4,_0x42adf9){return function(_0x12e8f9){if(_0x12e8f9){return _0x12e8f9[_0x63b3('0x32')]()[_0x63b3('0x1d')](function(){_0x3843d4[_0x63b3('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24eae9,_0xd56332){return function(_0xcc544c){if(!_0xcc544c){_0x24eae9[_0x63b3('0x33')](0x194);}return _0xcc544c;};}function handleError(_0x35d54d,_0x3f5383){_0x3f5383=_0x3f5383||0x1f4;return function(_0x1340b6){logger[_0x63b3('0x22')](_0x1340b6[_0x63b3('0x34')]);if(_0x1340b6['name']){delete _0x1340b6['name'];}_0x35d54d[_0x63b3('0x27')](_0x3f5383)['send'](_0x1340b6);};}exports[_0x63b3('0x35')]=function(_0x1dfe7e,_0xbf6117){var _0x453626={},_0x37546f={},_0x36dfd7={'count':0x0,'rows':[]};var _0xffcd1e=_[_0x63b3('0x36')](db['Network'][_0x63b3('0x37')],function(_0x4273dc){return{'name':_0x4273dc[_0x63b3('0x38')],'type':_0x4273dc[_0x63b3('0x39')]['key']};});_0x37546f[_0x63b3('0x3a')]=_[_0x63b3('0x36')](_0xffcd1e,'name');_0x37546f[_0x63b3('0x3b')]=_[_0x63b3('0x3c')](_0x1dfe7e[_0x63b3('0x3b')]);_0x37546f[_0x63b3('0x3d')]=_[_0x63b3('0x3e')](_0x37546f[_0x63b3('0x3a')],_0x37546f[_0x63b3('0x3b')]);_0x453626[_0x63b3('0x3f')]=_['intersection'](_0x37546f[_0x63b3('0x3a')],qs[_0x63b3('0x40')](_0x1dfe7e[_0x63b3('0x3b')][_0x63b3('0x40')]));_0x453626[_0x63b3('0x3f')]=_0x453626[_0x63b3('0x3f')][_0x63b3('0x41')]?_0x453626['attributes']:_0x37546f[_0x63b3('0x3a')];if(!_0x1dfe7e[_0x63b3('0x3b')]['hasOwnProperty']('nolimit')){_0x453626[_0x63b3('0x2c')]=qs[_0x63b3('0x2c')](_0x1dfe7e[_0x63b3('0x3b')]['limit']);_0x453626['offset']=qs['offset'](_0x1dfe7e[_0x63b3('0x3b')][_0x63b3('0x2a')]);}_0x453626[_0x63b3('0x42')]=qs['sort'](_0x1dfe7e[_0x63b3('0x3b')][_0x63b3('0x43')]);_0x453626['where']=qs['filters'](_['pick'](_0x1dfe7e[_0x63b3('0x3b')],_0x37546f['filters']),_0xffcd1e);if(_0x1dfe7e[_0x63b3('0x3b')][_0x63b3('0x44')]){_0x453626[_0x63b3('0x45')]=_['merge'](_0x453626['where'],{'$or':_[_0x63b3('0x36')](_0xffcd1e,function(_0x43553c){if(_0x43553c[_0x63b3('0x39')]!==_0x63b3('0x46')){var _0x34c6bd={};_0x34c6bd[_0x43553c['name']]={'$like':'%'+_0x1dfe7e[_0x63b3('0x3b')][_0x63b3('0x44')]+'%'};return _0x34c6bd;}})});}_0x453626=_[_0x63b3('0x47')]({},_0x453626,_0x1dfe7e[_0x63b3('0x48')]);var _0x3c8170={'where':_0x453626[_0x63b3('0x45')]};return db['Network'][_0x63b3('0x2d')](_0x3c8170)[_0x63b3('0x1d')](function(_0x3827de){_0x36dfd7['count']=_0x3827de;if(_0x1dfe7e['query'][_0x63b3('0x49')]){_0x453626[_0x63b3('0x4a')]=[{'all':!![]}];}return db['Network'][_0x63b3('0x4b')](_0x453626);})[_0x63b3('0x1d')](function(_0x32e88e){_0x36dfd7[_0x63b3('0x4c')]=_0x32e88e;return _0x36dfd7;})[_0x63b3('0x1d')](respondWithFilteredResult(_0xbf6117,_0x453626))['catch'](handleError(_0xbf6117,null));};exports[_0x63b3('0x4d')]=function(_0x141617,_0x11e2d9){var _0x7e8064={'raw':!![],'where':{'id':_0x141617[_0x63b3('0x4e')]['id']}},_0x125796={};_0x125796[_0x63b3('0x3a')]=_[_0x63b3('0x3c')](db[_0x63b3('0x4f')][_0x63b3('0x37')]);_0x125796['query']=_['keys'](_0x141617[_0x63b3('0x3b')]);_0x125796['filters']=_['intersection'](_0x125796[_0x63b3('0x3a')],_0x125796[_0x63b3('0x3b')]);_0x7e8064[_0x63b3('0x3f')]=_[_0x63b3('0x3e')](_0x125796[_0x63b3('0x3a')],qs[_0x63b3('0x40')](_0x141617[_0x63b3('0x3b')][_0x63b3('0x40')]));_0x7e8064[_0x63b3('0x3f')]=_0x7e8064['attributes'][_0x63b3('0x41')]?_0x7e8064['attributes']:_0x125796['model'];if(_0x141617[_0x63b3('0x3b')][_0x63b3('0x49')]){_0x7e8064[_0x63b3('0x4a')]=[{'all':!![]}];}_0x7e8064=_[_0x63b3('0x47')]({},_0x7e8064,_0x141617[_0x63b3('0x48')]);return db[_0x63b3('0x4f')][_0x63b3('0x50')](_0x7e8064)[_0x63b3('0x1d')](handleEntityNotFound(_0x11e2d9,null))['then'](respondWithResult(_0x11e2d9,null))[_0x63b3('0x51')](handleError(_0x11e2d9,null));};exports['create']=function(_0x522c79,_0x40360d,_0x34166f){var _0x4aff6a;return db[_0x63b3('0x52')]['transaction'](function(_0x2cdf12){return db[_0x63b3('0x4f')][_0x63b3('0x53')](_0x522c79[_0x63b3('0x54')],{'raw':!![]})['then'](function(_0x1fe29f){_0x4aff6a=_0x1fe29f;return db[_0x63b3('0x4f')][_0x63b3('0x4b')]({'where':{'type':_0x522c79[_0x63b3('0x54')]['type']},'raw':!![]});})[_0x63b3('0x1d')](function(_0x116093){if(_0x4aff6a[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x56')){var _0x19c810=fs['readFileSync'](path['join'](config['root'],_0x63b3('0x57')),_0x63b3('0x58'));var _0xe52004=ejs[_0x63b3('0x59')](_0x19c810,{'networks':_0x116093||[]});fs[_0x63b3('0x5a')](_0x63b3('0x5b'),_0xe52004);return respondWithRpcPromise(_0x63b3('0x5c'),_0x63b3('0x53'),{'module':_0x63b3('0x5d')});}else if(_0x4aff6a[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x5e')){var _0x249abc=fs[_0x63b3('0x5f')](path['join'](config[_0x63b3('0x60')],_0x63b3('0x61')),_0x63b3('0x58'));var _0x38eaaf=ejs['render'](_0x249abc,{'networks':_0x116093||[]});fs[_0x63b3('0x5a')](_0x63b3('0x62'),_0x38eaaf);return respondWithRpcPromise('Reload','create',{'module':_0x63b3('0x5d')});}else{var _0x11cd95=fs[_0x63b3('0x5f')](path[_0x63b3('0x63')](config[_0x63b3('0x60')],_0x63b3('0x64')),_0x63b3('0x58'));var _0x57b1d4=ejs[_0x63b3('0x59')](_0x11cd95,{'networks':_0x116093||[]});fs[_0x63b3('0x5a')](util[_0x63b3('0x65')](_0x63b3('0x66'),_0x522c79[_0x63b3('0x54')][_0x63b3('0x39')][_0x63b3('0x67')]()),_0x57b1d4);return respondWithRpcPromise(_0x63b3('0x5c'),_0x63b3('0x53'),{'module':'chan_sip.so'});}return null;})[_0x63b3('0x1d')](function(){return _0x4aff6a;});})[_0x63b3('0x1d')](respondWithResult(_0x40360d,0xc9))[_0x63b3('0x51')](handleError(_0x40360d,null));};exports['update']=function(_0x1aad8f,_0x171f14,_0xf2c311){var _0x1fb035;return db[_0x63b3('0x52')][_0x63b3('0x68')](function(_0x3a7247){return db[_0x63b3('0x4f')][_0x63b3('0x50')]({'where':{'id':_0x1aad8f[_0x63b3('0x4e')]['id']}})[_0x63b3('0x1d')](handleEntityNotFound(_0x171f14,null))['then'](saveUpdates(_0x1aad8f[_0x63b3('0x54')],null))[_0x63b3('0x1d')](function(_0xca84c8){if(_0xca84c8){_0x1fb035=_0xca84c8;return db[_0x63b3('0x4f')][_0x63b3('0x4b')]({'where':{'type':_0x1fb035[_0x63b3('0x39')]},'raw':!![]});}return null;})[_0x63b3('0x1d')](function(_0xce6ec7){if(_0x1fb035[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x56')){var _0x468169=fs[_0x63b3('0x5f')](path['join'](config['root'],_0x63b3('0x57')),'utf8');var _0x1b9a1f=ejs['render'](_0x468169,{'networks':_0xce6ec7||[]});fs['writeFileSync'](_0x63b3('0x5b'),_0x1b9a1f);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else if(_0x1fb035[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x5e')){var _0x509924=fs['readFileSync'](path[_0x63b3('0x63')](config[_0x63b3('0x60')],_0x63b3('0x61')),'utf8');var _0x2368e9=ejs['render'](_0x509924,{'networks':_0xce6ec7||[]});fs[_0x63b3('0x5a')](_0x63b3('0x62'),_0x2368e9);return respondWithRpcPromise(_0x63b3('0x5c'),_0x63b3('0x31'),{'module':_0x63b3('0x5d')});}else{var _0x1102dd=fs['readFileSync'](path['join'](config['root'],_0x63b3('0x64')),_0x63b3('0x58'));var _0x2d36e5=ejs[_0x63b3('0x59')](_0x1102dd,{'networks':_0xce6ec7||[]});fs['writeFileSync'](util[_0x63b3('0x65')](_0x63b3('0x66'),_0x1aad8f[_0x63b3('0x54')]['type']['toLowerCase']()),_0x2d36e5);return respondWithRpcPromise(_0x63b3('0x5c'),_0x63b3('0x31'),{'module':_0x63b3('0x69')});}return null;})[_0x63b3('0x1d')](function(_0x4c7bf2){if(_0x4c7bf2){return _0x1fb035;}return null;});})[_0x63b3('0x1d')](respondWithResult(_0x171f14,null))[_0x63b3('0x51')](handleError(_0x171f14,null));};exports['destroy']=function(_0x26d3d0,_0x714a04,_0x5a444f){var _0x3d5d39;return db[_0x63b3('0x4f')]['find']({'where':{'id':_0x26d3d0[_0x63b3('0x4e')]['id']}})['then'](function(_0x449141){_0x3d5d39=_0x449141;return _0x449141;})[_0x63b3('0x1d')](handleEntityNotFound(_0x714a04,null))[_0x63b3('0x1d')](removeEntity(_0x714a04,null))['then'](function(){if(_0x3d5d39){return db[_0x63b3('0x4f')][_0x63b3('0x4b')]({'where':{'type':_0x3d5d39[_0x63b3('0x39')]},'raw':!![]});}})['then'](function(_0x1b15aa){if(_0x3d5d39[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x56')){var _0x35c77c=fs[_0x63b3('0x5f')](path[_0x63b3('0x63')](config['root'],_0x63b3('0x57')),_0x63b3('0x58'));var _0x4cdf46=ejs[_0x63b3('0x59')](_0x35c77c,{'networks':_0x1b15aa||[]});fs[_0x63b3('0x5a')](_0x63b3('0x5b'),_0x4cdf46);return respondWithRpcPromise(_0x63b3('0x5c'),_0x63b3('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x3d5d39[_0x63b3('0x39')][_0x63b3('0x55')]()==_0x63b3('0x5e')){var _0x1716e8=fs[_0x63b3('0x5f')](path[_0x63b3('0x63')](config[_0x63b3('0x60')],'server/files/templates/turn_multiple.ejs'),_0x63b3('0x58'));var _0x1236a8=ejs['render'](_0x1716e8,{'networks':_0x1b15aa||[]});fs[_0x63b3('0x5a')](_0x63b3('0x62'),_0x1236a8);return respondWithRpcPromise('Reload',_0x63b3('0x32'),{'module':_0x63b3('0x5d')});}else{var _0xaeb81b=fs[_0x63b3('0x5f')](path[_0x63b3('0x63')](config[_0x63b3('0x60')],_0x63b3('0x64')),_0x63b3('0x58'));var _0x424760=ejs[_0x63b3('0x59')](_0xaeb81b,{'networks':_0x1b15aa||[]});fs[_0x63b3('0x5a')](util[_0x63b3('0x65')](_0x63b3('0x66'),_0x26d3d0[_0x63b3('0x54')][_0x63b3('0x39')][_0x63b3('0x67')]()),_0x424760);return respondWithRpcPromise('Reload','destroy',{'module':_0x63b3('0x69')});}return null;})[_0x63b3('0x51')](handleError(_0x714a04,null));}; \ No newline at end of file +var _0xf8ba=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','filters','intersection','fields','attributes','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','rows','show','params','keys','length','create','transaction','body','toUpperCase','STUN','join','utf8','render','writeFileSync','Reload','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','toLowerCase','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x1dcea6,_0x311cc6){var _0xcbd902=function(_0x3022a8){while(--_0x3022a8){_0x1dcea6['push'](_0x1dcea6['shift']());}};_0xcbd902(++_0x311cc6);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x13b9d0,_0x14c45d){_0x13b9d0=_0x13b9d0-0x0;var _0x1e8b94=_0xf8ba[_0x13b9d0];return _0x1e8b94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf8b('0x0'));var zipdir=require(_0xaf8b('0x1'));var jsonpatch=require(_0xaf8b('0x2'));var rp=require('request-promise');var moment=require(_0xaf8b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaf8b('0x4'));var util=require(_0xaf8b('0x5'));var path=require(_0xaf8b('0x6'));var sox=require(_0xaf8b('0x7'));var csv=require(_0xaf8b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf8b('0x9'));var _=require(_0xaf8b('0xa'));var squel=require(_0xaf8b('0xb'));var crypto=require(_0xaf8b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaf8b('0xd'));var toCsv=require(_0xaf8b('0x8'));var querystring=require('querystring');var Papa=require(_0xaf8b('0xe'));var Redis=require(_0xaf8b('0xf'));var authService=require(_0xaf8b('0x10'));var qs=require(_0xaf8b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf8b('0x12'))('api');var utils=require(_0xaf8b('0x13'));var config=require(_0xaf8b('0x14'));var licenseUtil=require(_0xaf8b('0x15'));var db=require(_0xaf8b('0x16'))['db'];var jayson=require(_0xaf8b('0x17'));var client=jayson[_0xaf8b('0x18')][_0xaf8b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x141b5f,_0x15bb70,_0x262253,_0x124f8d){return new BPromise(function(_0x267298,_0x28a5fe){var _0x47e89c=_0x124f8d||client;return _0x47e89c[_0xaf8b('0x1a')](_0x141b5f,_0x262253)[_0xaf8b('0x1b')](function(_0x35303d){logger[_0xaf8b('0x1c')]('Network,\x20%s,\x20%s',_0x15bb70,_0xaf8b('0x1d'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x15bb70,_0xaf8b('0x1d'),JSON[_0xaf8b('0x1e')](_0x35303d));if(_0x35303d[_0xaf8b('0x1f')]){if(_0x35303d[_0xaf8b('0x1f')]['code']===0x1f4){logger['error'](_0xaf8b('0x20'),_0x15bb70,_0x35303d[_0xaf8b('0x1f')][_0xaf8b('0x21')]);return _0x28a5fe(_0x35303d[_0xaf8b('0x1f')]['message']);}logger[_0xaf8b('0x1f')](_0xaf8b('0x20'),_0x15bb70,_0x35303d[_0xaf8b('0x1f')][_0xaf8b('0x21')]);return _0x267298(_0x35303d[_0xaf8b('0x1f')][_0xaf8b('0x21')]);}else{logger[_0xaf8b('0x1c')](_0xaf8b('0x20'),_0x15bb70,'request\x20sent');_0x267298(_0x35303d[_0xaf8b('0x22')][_0xaf8b('0x21')]);}})[_0xaf8b('0x23')](function(_0x3d0f7a){logger['error'](_0xaf8b('0x20'),_0x15bb70,_0x3d0f7a);_0x28a5fe(_0x3d0f7a);});});}function respondWithStatusCode(_0x2e36d1,_0x318192){_0x318192=_0x318192||0xcc;return function(_0xdcf194){if(_0xdcf194){return _0x2e36d1[_0xaf8b('0x24')](_0x318192);}return _0x2e36d1[_0xaf8b('0x25')](_0x318192)['end']();};}function respondWithResult(_0x327f28,_0x1412ea){_0x1412ea=_0x1412ea||0xc8;return function(_0x2dbbb9){if(_0x2dbbb9){return _0x327f28['status'](_0x1412ea)[_0xaf8b('0x26')](_0x2dbbb9);}};}function respondWithFilteredResult(_0x423585,_0x8af0a0){return function(_0x22975c){if(_0x22975c){var _0x3150b5=typeof _0x8af0a0[_0xaf8b('0x27')]===_0xaf8b('0x28')&&typeof _0x8af0a0[_0xaf8b('0x29')]==='undefined';var _0x42319f=_0x22975c[_0xaf8b('0x2a')];var _0x28115d=_0x3150b5?0x0:_0x8af0a0[_0xaf8b('0x27')];var _0x44a0c5=_0x3150b5?_0x22975c[_0xaf8b('0x2a')]:_0x8af0a0[_0xaf8b('0x27')]+_0x8af0a0[_0xaf8b('0x29')];var _0x11ac57;if(_0x44a0c5>=_0x42319f){_0x44a0c5=_0x42319f;_0x11ac57=0xc8;}else{_0x11ac57=0xce;}_0x423585['status'](_0x11ac57);return _0x423585[_0xaf8b('0x2b')](_0xaf8b('0x2c'),_0x28115d+'-'+_0x44a0c5+'/'+_0x42319f)['json'](_0x22975c);}return null;};}function patchUpdates(_0x57770a){return function(_0x224370){try{jsonpatch[_0xaf8b('0x2d')](_0x224370,_0x57770a,!![]);}catch(_0x41b5af){return BPromise[_0xaf8b('0x2e')](_0x41b5af);}return _0x224370[_0xaf8b('0x2f')]();};}function saveUpdates(_0x5d2c08,_0xe495b4){return function(_0x43502f){if(_0x43502f){return _0x43502f[_0xaf8b('0x30')](_0x5d2c08)[_0xaf8b('0x1b')](function(_0x111390){return _0x111390;});}return null;};}function removeEntity(_0x30815c,_0x57903f){return function(_0x31d778){if(_0x31d778){return _0x31d778[_0xaf8b('0x31')]()[_0xaf8b('0x1b')](function(){_0x30815c[_0xaf8b('0x25')](0xcc)[_0xaf8b('0x32')]();});}};}function handleEntityNotFound(_0x32445d,_0x2150c7){return function(_0x511816){if(!_0x511816){_0x32445d[_0xaf8b('0x24')](0x194);}return _0x511816;};}function handleError(_0xf18054,_0x360d64){_0x360d64=_0x360d64||0x1f4;return function(_0xa887d8){logger['error'](_0xa887d8[_0xaf8b('0x33')]);if(_0xa887d8[_0xaf8b('0x34')]){delete _0xa887d8['name'];}_0xf18054[_0xaf8b('0x25')](_0x360d64)[_0xaf8b('0x35')](_0xa887d8);};}exports['index']=function(_0x1bf3ca,_0x158c54){var _0x581463={},_0x3aa752={},_0x1d1b27={'count':0x0,'rows':[]};var _0x39a043=_[_0xaf8b('0x36')](db['Network'][_0xaf8b('0x37')],function(_0x3e3ee1){return{'name':_0x3e3ee1[_0xaf8b('0x38')],'type':_0x3e3ee1[_0xaf8b('0x39')][_0xaf8b('0x3a')]};});_0x3aa752[_0xaf8b('0x3b')]=_[_0xaf8b('0x36')](_0x39a043,_0xaf8b('0x34'));_0x3aa752['query']=_['keys'](_0x1bf3ca['query']);_0x3aa752[_0xaf8b('0x3c')]=_[_0xaf8b('0x3d')](_0x3aa752['model'],_0x3aa752['query']);_0x581463['attributes']=_['intersection'](_0x3aa752[_0xaf8b('0x3b')],qs[_0xaf8b('0x3e')](_0x1bf3ca['query'][_0xaf8b('0x3e')]));_0x581463['attributes']=_0x581463[_0xaf8b('0x3f')]['length']?_0x581463[_0xaf8b('0x3f')]:_0x3aa752['model'];if(!_0x1bf3ca[_0xaf8b('0x40')][_0xaf8b('0x41')](_0xaf8b('0x42'))){_0x581463['limit']=qs['limit'](_0x1bf3ca[_0xaf8b('0x40')]['limit']);_0x581463[_0xaf8b('0x27')]=qs['offset'](_0x1bf3ca[_0xaf8b('0x40')][_0xaf8b('0x27')]);}_0x581463[_0xaf8b('0x43')]=qs[_0xaf8b('0x44')](_0x1bf3ca[_0xaf8b('0x40')][_0xaf8b('0x44')]);_0x581463[_0xaf8b('0x45')]=qs[_0xaf8b('0x3c')](_[_0xaf8b('0x46')](_0x1bf3ca[_0xaf8b('0x40')],_0x3aa752[_0xaf8b('0x3c')]),_0x39a043);if(_0x1bf3ca[_0xaf8b('0x40')][_0xaf8b('0x47')]){_0x581463[_0xaf8b('0x45')]=_[_0xaf8b('0x48')](_0x581463[_0xaf8b('0x45')],{'$or':_['map'](_0x39a043,function(_0x201c9b){if(_0x201c9b[_0xaf8b('0x39')]!==_0xaf8b('0x49')){var _0x47188a={};_0x47188a[_0x201c9b['name']]={'$like':'%'+_0x1bf3ca['query'][_0xaf8b('0x47')]+'%'};return _0x47188a;}})});}_0x581463=_[_0xaf8b('0x48')]({},_0x581463,_0x1bf3ca[_0xaf8b('0x4a')]);var _0x57875b={'where':_0x581463[_0xaf8b('0x45')]};return db[_0xaf8b('0x4b')][_0xaf8b('0x2a')](_0x57875b)[_0xaf8b('0x1b')](function(_0x53fb20){_0x1d1b27[_0xaf8b('0x2a')]=_0x53fb20;if(_0x1bf3ca['query'][_0xaf8b('0x4c')]){_0x581463[_0xaf8b('0x4d')]=[{'all':!![]}];}return db[_0xaf8b('0x4b')][_0xaf8b('0x4e')](_0x581463);})[_0xaf8b('0x1b')](function(_0x556aed){_0x1d1b27[_0xaf8b('0x4f')]=_0x556aed;return _0x1d1b27;})[_0xaf8b('0x1b')](respondWithFilteredResult(_0x158c54,_0x581463))['catch'](handleError(_0x158c54,null));};exports[_0xaf8b('0x50')]=function(_0xee52f2,_0x1d0062){var _0xf0f6a0={'raw':!![],'where':{'id':_0xee52f2[_0xaf8b('0x51')]['id']}},_0x49ca2f={};_0x49ca2f[_0xaf8b('0x3b')]=_[_0xaf8b('0x52')](db[_0xaf8b('0x4b')][_0xaf8b('0x37')]);_0x49ca2f[_0xaf8b('0x40')]=_['keys'](_0xee52f2[_0xaf8b('0x40')]);_0x49ca2f['filters']=_[_0xaf8b('0x3d')](_0x49ca2f['model'],_0x49ca2f['query']);_0xf0f6a0['attributes']=_['intersection'](_0x49ca2f[_0xaf8b('0x3b')],qs[_0xaf8b('0x3e')](_0xee52f2[_0xaf8b('0x40')][_0xaf8b('0x3e')]));_0xf0f6a0[_0xaf8b('0x3f')]=_0xf0f6a0[_0xaf8b('0x3f')][_0xaf8b('0x53')]?_0xf0f6a0[_0xaf8b('0x3f')]:_0x49ca2f[_0xaf8b('0x3b')];if(_0xee52f2[_0xaf8b('0x40')][_0xaf8b('0x4c')]){_0xf0f6a0[_0xaf8b('0x4d')]=[{'all':!![]}];}_0xf0f6a0=_[_0xaf8b('0x48')]({},_0xf0f6a0,_0xee52f2[_0xaf8b('0x4a')]);return db[_0xaf8b('0x4b')]['find'](_0xf0f6a0)[_0xaf8b('0x1b')](handleEntityNotFound(_0x1d0062,null))[_0xaf8b('0x1b')](respondWithResult(_0x1d0062,null))['catch'](handleError(_0x1d0062,null));};exports[_0xaf8b('0x54')]=function(_0x51a3a7,_0x1fa912,_0x4a4e16){var _0x5f0810;return db['sequelize'][_0xaf8b('0x55')](function(_0x3a4c10){return db[_0xaf8b('0x4b')][_0xaf8b('0x54')](_0x51a3a7[_0xaf8b('0x56')],{'raw':!![]})[_0xaf8b('0x1b')](function(_0x9cee77){_0x5f0810=_0x9cee77;return db[_0xaf8b('0x4b')][_0xaf8b('0x4e')]({'where':{'type':_0x51a3a7[_0xaf8b('0x56')][_0xaf8b('0x39')]},'raw':!![]});})[_0xaf8b('0x1b')](function(_0x2cab36){if(_0x5f0810[_0xaf8b('0x39')][_0xaf8b('0x57')]()==_0xaf8b('0x58')){var _0x25edbb=fs['readFileSync'](path[_0xaf8b('0x59')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xaf8b('0x5a'));var _0x219524=ejs[_0xaf8b('0x5b')](_0x25edbb,{'networks':_0x2cab36||[]});fs[_0xaf8b('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x219524);return respondWithRpcPromise(_0xaf8b('0x5d'),'create',{'module':'res_stun_monitor.so'});}else if(_0x5f0810['type'][_0xaf8b('0x57')]()==_0xaf8b('0x5e')){var _0x2e8a6f=fs[_0xaf8b('0x5f')](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],_0xaf8b('0x61')),'utf8');var _0x384bf3=ejs['render'](_0x2e8a6f,{'networks':_0x2cab36||[]});fs[_0xaf8b('0x5c')](_0xaf8b('0x62'),_0x384bf3);return respondWithRpcPromise(_0xaf8b('0x5d'),_0xaf8b('0x54'),{'module':_0xaf8b('0x63')});}else{var _0x50954c=fs[_0xaf8b('0x5f')](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],_0xaf8b('0x64')),_0xaf8b('0x5a'));var _0xe7cc6d=ejs['render'](_0x50954c,{'networks':_0x2cab36||[]});fs[_0xaf8b('0x5c')](util[_0xaf8b('0x65')](_0xaf8b('0x66'),_0x51a3a7[_0xaf8b('0x56')]['type']['toLowerCase']()),_0xe7cc6d);return respondWithRpcPromise(_0xaf8b('0x5d'),_0xaf8b('0x54'),{'module':_0xaf8b('0x67')});}return null;})['then'](function(){return _0x5f0810;});})[_0xaf8b('0x1b')](respondWithResult(_0x1fa912,0xc9))['catch'](handleError(_0x1fa912,null));};exports[_0xaf8b('0x30')]=function(_0x56b3ab,_0x5c489f,_0xfb0aed){var _0x3cfcd5;return db['sequelize']['transaction'](function(_0x355192){return db[_0xaf8b('0x4b')][_0xaf8b('0x68')]({'where':{'id':_0x56b3ab['params']['id']}})[_0xaf8b('0x1b')](handleEntityNotFound(_0x5c489f,null))[_0xaf8b('0x1b')](saveUpdates(_0x56b3ab['body'],null))['then'](function(_0x763b1a){if(_0x763b1a){_0x3cfcd5=_0x763b1a;return db[_0xaf8b('0x4b')][_0xaf8b('0x4e')]({'where':{'type':_0x3cfcd5[_0xaf8b('0x39')]},'raw':!![]});}return null;})[_0xaf8b('0x1b')](function(_0x4fc526){if(_0x3cfcd5['type']['toUpperCase']()==_0xaf8b('0x58')){var _0x3aaad1=fs[_0xaf8b('0x5f')](path[_0xaf8b('0x59')](config['root'],_0xaf8b('0x69')),'utf8');var _0x12fcdf=ejs[_0xaf8b('0x5b')](_0x3aaad1,{'networks':_0x4fc526||[]});fs[_0xaf8b('0x5c')](_0xaf8b('0x6a'),_0x12fcdf);return respondWithRpcPromise(_0xaf8b('0x5d'),'update',{'module':'res_stun_monitor.so'});}else if(_0x3cfcd5[_0xaf8b('0x39')][_0xaf8b('0x57')]()=='TURN'){var _0x5e503d=fs['readFileSync'](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x43fc21=ejs['render'](_0x5e503d,{'networks':_0x4fc526||[]});fs[_0xaf8b('0x5c')](_0xaf8b('0x62'),_0x43fc21);return respondWithRpcPromise(_0xaf8b('0x5d'),_0xaf8b('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x4a1e44=fs['readFileSync'](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],_0xaf8b('0x64')),_0xaf8b('0x5a'));var _0x514d8d=ejs['render'](_0x4a1e44,{'networks':_0x4fc526||[]});fs[_0xaf8b('0x5c')](util['format'](_0xaf8b('0x66'),_0x56b3ab['body'][_0xaf8b('0x39')]['toLowerCase']()),_0x514d8d);return respondWithRpcPromise('Reload',_0xaf8b('0x30'),{'module':_0xaf8b('0x67')});}return null;})[_0xaf8b('0x1b')](function(_0x3a54b8){if(_0x3a54b8){return _0x3cfcd5;}return null;});})[_0xaf8b('0x1b')](respondWithResult(_0x5c489f,null))[_0xaf8b('0x23')](handleError(_0x5c489f,null));};exports[_0xaf8b('0x31')]=function(_0x44d91c,_0x28bc55,_0x2b4cbc){var _0x3ee804;return db[_0xaf8b('0x4b')][_0xaf8b('0x68')]({'where':{'id':_0x44d91c[_0xaf8b('0x51')]['id']}})[_0xaf8b('0x1b')](function(_0x33458d){_0x3ee804=_0x33458d;return _0x33458d;})[_0xaf8b('0x1b')](handleEntityNotFound(_0x28bc55,null))[_0xaf8b('0x1b')](removeEntity(_0x28bc55,null))[_0xaf8b('0x1b')](function(){if(_0x3ee804){return db['Network'][_0xaf8b('0x4e')]({'where':{'type':_0x3ee804[_0xaf8b('0x39')]},'raw':!![]});}})['then'](function(_0x5d75b5){if(_0x3ee804['type']['toUpperCase']()=='STUN'){var _0x37b3dd=fs[_0xaf8b('0x5f')](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],'server/files/templates/stun_multiple.ejs'),_0xaf8b('0x5a'));var _0x37ff1b=ejs['render'](_0x37b3dd,{'networks':_0x5d75b5||[]});fs[_0xaf8b('0x5c')](_0xaf8b('0x6a'),_0x37ff1b);return respondWithRpcPromise(_0xaf8b('0x5d'),_0xaf8b('0x31'),{'module':_0xaf8b('0x63')});}else if(_0x3ee804[_0xaf8b('0x39')][_0xaf8b('0x57')]()=='TURN'){var _0x20192b=fs[_0xaf8b('0x5f')](path['join'](config[_0xaf8b('0x60')],_0xaf8b('0x61')),_0xaf8b('0x5a'));var _0xb2ed39=ejs[_0xaf8b('0x5b')](_0x20192b,{'networks':_0x5d75b5||[]});fs['writeFileSync'](_0xaf8b('0x62'),_0xb2ed39);return respondWithRpcPromise(_0xaf8b('0x5d'),_0xaf8b('0x31'),{'module':_0xaf8b('0x63')});}else{var _0x5e5cf3=fs[_0xaf8b('0x5f')](path[_0xaf8b('0x59')](config[_0xaf8b('0x60')],_0xaf8b('0x64')),_0xaf8b('0x5a'));var _0xb3b7a3=ejs[_0xaf8b('0x5b')](_0x5e5cf3,{'networks':_0x5d75b5||[]});fs[_0xaf8b('0x5c')](util[_0xaf8b('0x65')](_0xaf8b('0x66'),_0x44d91c[_0xaf8b('0x56')][_0xaf8b('0x39')][_0xaf8b('0x6b')]()),_0xb3b7a3);return respondWithRpcPromise('Reload',_0xaf8b('0x31'),{'module':'chan_sip.so'});}return null;})[_0xaf8b('0x23')](handleError(_0x28bc55,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 0659d2b..8e06bc3 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 _0xf290=['Network','network','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1c39d7,_0x241835){var _0x52f255=function(_0x64caf7){while(--_0x64caf7){_0x1c39d7['push'](_0x1c39d7['shift']());}};_0x52f255(++_0x241835);}(_0xf290,0xde));var _0x0f29=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xf290[_0x334f9a];return _0x2b219d;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var logger=require('../../config/logger')(_0x0f29('0x1'));var moment=require('moment');var BPromise=require(_0x0f29('0x2'));var rp=require(_0x0f29('0x3'));var fs=require('fs');var path=require(_0x0f29('0x4'));var rimraf=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var attributes=require('./network.attributes');module[_0x0f29('0x7')]=function(_0x4911fb,_0x2d5350){return _0x4911fb[_0x0f29('0x8')](_0x0f29('0x9'),attributes,{'tableName':_0x0f29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Network','network','../../config/logger','api'];(function(_0x3d3ae9,_0x334c52){var _0x31b364=function(_0x6aa61c){while(--_0x6aa61c){_0x3d3ae9['push'](_0x3d3ae9['shift']());}};_0x31b364(++_0x334c52);}(_0x1339,0x1ed));var _0x9133=function(_0x5c37b1,_0x51dfa8){_0x5c37b1=_0x5c37b1-0x0;var _0x23589b=_0x1339[_0x5c37b1];return _0x23589b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./network.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 861708d..1e31886 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(_0x5316b9,_0x1aae1e){_0x5316b9=_0x5316b9-0x0;var _0x25bf20=_0x7a54[_0x5316b9];return _0x25bf20;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xc5dfdf,_0x1af75b){var _0x49d885=function(_0x524cad){while(--_0x524cad){_0xc5dfdf['push'](_0xc5dfdf['shift']());}};_0x49d885(++_0x1af75b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 491f10c..b83295a 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 _0x01cb=['isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getAgents','post','create','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4b87a3,_0x3a698c){var _0x334112=function(_0x3e8fb0){while(--_0x3e8fb0){_0x4b87a3['push'](_0x4b87a3['shift']());}};_0x334112(++_0x3a698c);}(_0x01cb,0x14d));var _0xb01c=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x01cb[_0x22e47a];return _0x15a12a;};'use strict';var multer=require(_0xb01c('0x0'));var util=require(_0xb01c('0x1'));var path=require(_0xb01c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb01c('0x3'));var router=express['Router']();var fs_extra=require(_0xb01c('0x4'));var auth=require(_0xb01c('0x5'));var interaction=require(_0xb01c('0x6'));var config=require(_0xb01c('0x7'));var controller=require('./openchannelAccount.controller');router[_0xb01c('0x8')]('/',auth[_0xb01c('0x9')](),controller[_0xb01c('0xa')]);router[_0xb01c('0x8')]('/describe',auth[_0xb01c('0x9')](),controller[_0xb01c('0xb')]);router['get']('/:id',auth[_0xb01c('0x9')](),controller[_0xb01c('0xc')]);router[_0xb01c('0x8')](_0xb01c('0xd'),auth[_0xb01c('0x9')](),controller[_0xb01c('0xe')]);router[_0xb01c('0x8')](_0xb01c('0xf'),auth[_0xb01c('0x9')](),controller['getAnswers']);router[_0xb01c('0x8')](_0xb01c('0x10'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x11')]);router[_0xb01c('0x8')](_0xb01c('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xb01c('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xb01c('0x13')]);router[_0xb01c('0x14')]('/',auth[_0xb01c('0x9')](),controller[_0xb01c('0x15')]);router[_0xb01c('0x14')](_0xb01c('0xd'),auth[_0xb01c('0x9')](),controller['addDisposition']);router[_0xb01c('0x14')]('/:id/canned_answers',auth[_0xb01c('0x9')](),controller['addAnswer']);router[_0xb01c('0x14')](_0xb01c('0x16'),controller[_0xb01c('0x17')]);router[_0xb01c('0x14')](_0xb01c('0x10'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x18')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xb01c('0x19')]);router[_0xb01c('0x14')](_0xb01c('0x1a'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x1b')]);router[_0xb01c('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xb01c('0x1d')]);router[_0xb01c('0x1e')](_0xb01c('0x1f'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x20')]);router[_0xb01c('0x1e')]('/:id/dispositions',auth[_0xb01c('0x9')](),controller[_0xb01c('0x21')]);router[_0xb01c('0x1e')](_0xb01c('0xf'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x22')]);router[_0xb01c('0x1e')](_0xb01c('0x23'),auth[_0xb01c('0x9')](),controller[_0xb01c('0x24')]);module[_0xb01c('0x25')]=router; \ No newline at end of file +var _0x5876=['/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x5876,0x73));var _0x6587=function(_0x37f8ad,_0x5c3a37){_0x37f8ad=_0x37f8ad-0x0;var _0x12bd86=_0x5876[_0x37f8ad];return _0x12bd86;};'use strict';var multer=require(_0x6587('0x0'));var util=require('util');var path=require(_0x6587('0x1'));var timeout=require(_0x6587('0x2'));var express=require(_0x6587('0x3'));var router=express[_0x6587('0x4')]();var fs_extra=require(_0x6587('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6587('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x6587('0x7')](),controller['index']);router[_0x6587('0x8')](_0x6587('0x9'),auth[_0x6587('0x7')](),controller['describe']);router[_0x6587('0x8')](_0x6587('0xa'),auth['isAuthenticated'](),controller[_0x6587('0xb')]);router['get'](_0x6587('0xc'),auth[_0x6587('0x7')](),controller[_0x6587('0xd')]);router[_0x6587('0x8')](_0x6587('0xe'),auth[_0x6587('0x7')](),controller[_0x6587('0xf')]);router[_0x6587('0x8')]('/:id/applications',auth[_0x6587('0x7')](),controller[_0x6587('0x10')]);router[_0x6587('0x8')](_0x6587('0x11'),auth['isAuthenticated'](),controller[_0x6587('0x12')]);router[_0x6587('0x8')](_0x6587('0x13'),auth[_0x6587('0x7')](),controller['getAgents']);router[_0x6587('0x14')]('/',auth[_0x6587('0x7')](),controller[_0x6587('0x15')]);router['post'](_0x6587('0xc'),auth[_0x6587('0x7')](),controller['addDisposition']);router[_0x6587('0x14')](_0x6587('0xe'),auth[_0x6587('0x7')](),controller[_0x6587('0x16')]);router[_0x6587('0x14')](_0x6587('0x17'),controller[_0x6587('0x18')]);router[_0x6587('0x14')](_0x6587('0x19'),auth[_0x6587('0x7')](),controller[_0x6587('0x1a')]);router[_0x6587('0x14')]('/:id/users',auth[_0x6587('0x7')](),controller[_0x6587('0x1b')]);router[_0x6587('0x14')](_0x6587('0x1c'),auth[_0x6587('0x7')](),controller['send']);router['put'](_0x6587('0xa'),auth[_0x6587('0x7')](),controller[_0x6587('0x1d')]);router[_0x6587('0x1e')](_0x6587('0xa'),auth[_0x6587('0x7')](),controller['destroy']);router[_0x6587('0x1e')](_0x6587('0xc'),auth[_0x6587('0x7')](),controller[_0x6587('0x1f')]);router[_0x6587('0x1e')](_0x6587('0xe'),auth[_0x6587('0x7')](),controller[_0x6587('0x20')]);router[_0x6587('0x1e')]('/:id/users',auth[_0x6587('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 80d8370..5668b79 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 _0xbb95=['STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x200d3d,_0xd42086){var _0x4f30f1=function(_0x44e185){while(--_0x44e185){_0x200d3d['push'](_0x200d3d['shift']());}};_0x4f30f1(++_0xd42086);}(_0xbb95,0x12a));var _0x5bb9=function(_0x19c882,_0x32fe6a){_0x19c882=_0x19c882-0x0;var _0x15a997=_0xbb95[_0x19c882];return _0x15a997;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5bb9('0x0'));module[_0x5bb9('0x1')]={'name':{'type':Sequelize[_0x5bb9('0x2')],'unique':_0x5bb9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5bb9('0x2')]},'token':{'type':Sequelize[_0x5bb9('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x5bb9('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5bb9('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5bb9('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5bb9('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5bb9('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5bb9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bb9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bb9('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bb9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bb9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x5bb9('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5bb9('0x5')],'defaultValue':![],'comment':_0x5bb9('0x8'),'set':function(_0x4632c5){if(!_0x4632c5)this[_0x5bb9('0x9')](_0x5bb9('0xa'),null);this[_0x5bb9('0x9')](_0x5bb9('0xb'),_0x4632c5);}}}; \ No newline at end of file +var _0xa07b=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x12773c,_0xd61c00){var _0x2f1b82=function(_0x3012d6){while(--_0x3012d6){_0x12773c['push'](_0x12773c['shift']());}};_0x2f1b82(++_0xd61c00);}(_0xa07b,0x89));var _0xba07=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa07b[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xba07('0x0'));var rs=require(_0xba07('0x1'));module[_0xba07('0x2')]={'name':{'type':Sequelize[_0xba07('0x3')],'unique':_0xba07('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xba07('0x3')]},'token':{'type':Sequelize[_0xba07('0x3')],'defaultValue':function(){return rs[_0xba07('0x5')]();}},'replyUri':{'type':Sequelize[_0xba07('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xba07('0x6')],'defaultValue':function(){return _0xba07('0x7');}},'notificationSound':{'type':Sequelize[_0xba07('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xba07('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xba07('0x9')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xba07('0x8')],'defaultValue':![],'comment':_0xba07('0xa'),'set':function(_0x37c280){if(!_0x37c280)this['setDataValue'](_0xba07('0xb'),null);this[_0xba07('0xc')]('mandatoryDisposition',_0x37c280);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b50e749..ebe6e20 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 _0x5196=['messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','agent','startRouting','Start','EventManager','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','Contact','Tag','Tags','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','destroy','then','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','ListId','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','CmList','List','Contacts','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5196,0xd7));var _0x6519=function(_0x3822f1,_0x42aa55){_0x3822f1=_0x3822f1-0x0;var _0x3b1270=_0x5196[_0x3822f1];return _0x3b1270;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6519('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6519('0x1'));var rp=require(_0x6519('0x2'));var moment=require(_0x6519('0x3'));var BPromise=require(_0x6519('0x4'));var Mustache=require(_0x6519('0x5'));var util=require(_0x6519('0x6'));var path=require(_0x6519('0x7'));var sox=require(_0x6519('0x8'));var csv=require(_0x6519('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6519('0xa'));var _=require(_0x6519('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6519('0xc'));var deskjs=require(_0x6519('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6519('0xe'));var Papa=require(_0x6519('0xf'));var Redis=require(_0x6519('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6519('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6519('0x12'));var logger=require(_0x6519('0x13'))(_0x6519('0x14'));var utils=require(_0x6519('0x15'));var config=require(_0x6519('0x16'));var licenseUtil=require(_0x6519('0x17'));var db=require('../../mysqldb')['db'];config[_0x6519('0x18')]=_[_0x6519('0x19')](config[_0x6519('0x18')],{'host':_0x6519('0x1a'),'port':0x18eb});var socket=require(_0x6519('0x1b'))(new Redis(config['redis']));require(_0x6519('0x1c'))[_0x6519('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6519('0x1e')][_0x6519('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x6519('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x262e60,_0x1491b5,_0x5a6163,_0x129b88){return new BPromise(function(_0x55eee2,_0x3b20b9){var _0x16b078=_0x129b88||client;return _0x16b078[_0x6519('0x20')](_0x262e60,_0x5a6163)['then'](function(_0x4ccb2c){logger['info'](_0x6519('0x21'),_0x1491b5,'request\x20sent');logger['debug'](_0x6519('0x22'),_0x1491b5,_0x6519('0x23'),JSON[_0x6519('0x24')](_0x4ccb2c));if(_0x4ccb2c['error']){if(_0x4ccb2c[_0x6519('0x25')][_0x6519('0x26')]===0x1f4){logger['error'](_0x6519('0x21'),_0x1491b5,_0x4ccb2c[_0x6519('0x25')][_0x6519('0x27')]);return _0x3b20b9(_0x4ccb2c['error']['message']);}logger[_0x6519('0x25')](_0x6519('0x21'),_0x1491b5,_0x4ccb2c['error'][_0x6519('0x27')]);return _0x55eee2(_0x4ccb2c[_0x6519('0x25')][_0x6519('0x27')]);}else{logger[_0x6519('0x28')](_0x6519('0x21'),_0x1491b5,'request\x20sent');_0x55eee2(_0x4ccb2c['result']['message']);}})[_0x6519('0x29')](function(_0x13ea8b){logger[_0x6519('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x1491b5,_0x13ea8b);_0x3b20b9(_0x13ea8b);});});}function respondWithStatusCode(_0x205457,_0xc12bc1){_0xc12bc1=_0xc12bc1||0xcc;return function(_0x104d9f){if(_0x104d9f){return _0x205457[_0x6519('0x2a')](_0xc12bc1);}return _0x205457[_0x6519('0x2b')](_0xc12bc1)[_0x6519('0x2c')]();};}function respondWithResult(_0x175127,_0x5e5109){_0x5e5109=_0x5e5109||0xc8;return function(_0x1b6e2c){if(_0x1b6e2c){return _0x175127[_0x6519('0x2b')](_0x5e5109)['json'](_0x1b6e2c);}};}function respondWithFilteredResult(_0x56c20b,_0x4d278a){return function(_0x399012){if(_0x399012){var _0x3ed42a=typeof _0x4d278a[_0x6519('0x2d')]===_0x6519('0x2e')&&typeof _0x4d278a[_0x6519('0x2f')]===_0x6519('0x2e');var _0x1b597b=_0x399012[_0x6519('0x30')];var _0x5d2fc7=_0x3ed42a?0x0:_0x4d278a['offset'];var _0x14d8b0=_0x3ed42a?_0x399012[_0x6519('0x30')]:_0x4d278a[_0x6519('0x2d')]+_0x4d278a['limit'];var _0x596a7d;if(_0x14d8b0>=_0x1b597b){_0x14d8b0=_0x1b597b;_0x596a7d=0xc8;}else{_0x596a7d=0xce;}_0x56c20b[_0x6519('0x2b')](_0x596a7d);return _0x56c20b['set']('Content-Range',_0x5d2fc7+'-'+_0x14d8b0+'/'+_0x1b597b)[_0x6519('0x31')](_0x399012);}return null;};}function patchUpdates(_0xcb7828){return function(_0x367eb2){try{jsonpatch[_0x6519('0x32')](_0x367eb2,_0xcb7828,!![]);}catch(_0x1a4221){return BPromise['reject'](_0x1a4221);}return _0x367eb2[_0x6519('0x33')]();};}function saveUpdates(_0x406662,_0x426cc1){return function(_0x459910){if(_0x459910){return _0x459910[_0x6519('0x34')](_0x406662)['then'](function(_0x5a5aae){return _0x5a5aae;});}return null;};}function removeEntity(_0x3c77a5,_0x7746b0){return function(_0x37b6a6){if(_0x37b6a6){return _0x37b6a6[_0x6519('0x35')]()[_0x6519('0x36')](function(){var _0x2e9ffe=_0x37b6a6[_0x6519('0x37')]({'plain':!![]});var _0x963630=_0x6519('0x38');return db['UserProfileResource'][_0x6519('0x35')]({'where':{'type':_0x963630,'resourceId':_0x2e9ffe['id']}})[_0x6519('0x36')](function(){return _0x37b6a6;});})[_0x6519('0x36')](function(){_0x3c77a5[_0x6519('0x2b')](0xcc)[_0x6519('0x2c')]();});}};}function handleEntityNotFound(_0xde44f2,_0xe947f0){return function(_0x53965a){if(!_0x53965a){_0xde44f2[_0x6519('0x2a')](0x194);}return _0x53965a;};}function handleError(_0x188c89,_0x5645fb){_0x5645fb=_0x5645fb||0x1f4;return function(_0x220c88){logger['error'](_0x220c88[_0x6519('0x39')]);if(_0x220c88['name']){delete _0x220c88[_0x6519('0x3a')];}_0x188c89[_0x6519('0x2b')](_0x5645fb)[_0x6519('0x3b')](_0x220c88);};}exports[_0x6519('0x3c')]=function(_0xea3599,_0x3c51fa){var _0x2a747e={'include':[{'model':db[_0x6519('0x3d')],'as':_0x6519('0x3e')}]},_0x800457={},_0x5ab387={'count':0x0,'rows':[]};var _0x422d76=_[_0x6519('0x3f')](db[_0x6519('0x40')]['rawAttributes'],function(_0x322ac3){return{'name':_0x322ac3[_0x6519('0x41')],'type':_0x322ac3['type']['key']};});_0x800457['model']=_[_0x6519('0x3f')](_0x422d76,_0x6519('0x3a'));_0x800457[_0x6519('0x42')]=_[_0x6519('0x43')](_0xea3599[_0x6519('0x42')]);_0x800457[_0x6519('0x44')]=_[_0x6519('0x45')](_0x800457[_0x6519('0x46')],_0x800457['query']);_0x2a747e[_0x6519('0x47')]=_[_0x6519('0x45')](_0x800457[_0x6519('0x46')],qs[_0x6519('0x48')](_0xea3599[_0x6519('0x42')][_0x6519('0x48')]));_0x2a747e[_0x6519('0x47')]=_0x2a747e['attributes'][_0x6519('0x49')]?_0x2a747e['attributes']:_0x800457[_0x6519('0x46')];if(!_0xea3599['query']['hasOwnProperty'](_0x6519('0x4a'))){_0x2a747e['limit']=qs[_0x6519('0x2f')](_0xea3599['query']['limit']);_0x2a747e[_0x6519('0x2d')]=qs[_0x6519('0x2d')](_0xea3599[_0x6519('0x42')][_0x6519('0x2d')]);}_0x2a747e[_0x6519('0x4b')]=qs[_0x6519('0x4c')](_0xea3599[_0x6519('0x42')][_0x6519('0x4c')]);_0x2a747e[_0x6519('0x4d')]=qs[_0x6519('0x44')](_[_0x6519('0x4e')](_0xea3599[_0x6519('0x42')],_0x800457[_0x6519('0x44')]),_0x422d76);if(_0xea3599[_0x6519('0x42')]['filter']){_0x2a747e[_0x6519('0x4d')]=_[_0x6519('0x4f')](_0x2a747e['where'],{'$or':_[_0x6519('0x3f')](_0x422d76,function(_0x4ee0dc){if(_0x4ee0dc['type']!=='VIRTUAL'){var _0x54c9ef={};_0x54c9ef[_0x4ee0dc[_0x6519('0x3a')]]={'$like':'%'+_0xea3599[_0x6519('0x42')][_0x6519('0x50')]+'%'};return _0x54c9ef;}})});}_0x2a747e=_[_0x6519('0x4f')]({},_0x2a747e,_0xea3599[_0x6519('0x51')]);var _0x2bc4c0={'where':_0x2a747e[_0x6519('0x4d')]};return db['OpenchannelAccount'][_0x6519('0x30')](_0x2bc4c0)['then'](function(_0x214227){_0x5ab387['count']=_0x214227;if(_0xea3599[_0x6519('0x42')][_0x6519('0x52')]){_0x2a747e[_0x6519('0x53')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x6519('0x54')](_0x2a747e);})[_0x6519('0x36')](function(_0x32f924){_0x5ab387[_0x6519('0x55')]=_0x32f924;return _0x5ab387;})[_0x6519('0x36')](respondWithFilteredResult(_0x3c51fa,_0x2a747e))['catch'](handleError(_0x3c51fa,null));};exports[_0x6519('0x56')]=function(_0x356073,_0x3805e9){var _0x36fbd9={'raw':![],'where':{'id':_0x356073['params']['id']},'include':[{'model':db[_0x6519('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2cdf9d={};_0x2cdf9d[_0x6519('0x46')]=_[_0x6519('0x43')](db[_0x6519('0x40')][_0x6519('0x57')]);_0x2cdf9d[_0x6519('0x42')]=_['keys'](_0x356073['query']);_0x2cdf9d[_0x6519('0x44')]=_[_0x6519('0x45')](_0x2cdf9d[_0x6519('0x46')],_0x2cdf9d['query']);_0x36fbd9[_0x6519('0x47')]=_[_0x6519('0x45')](_0x2cdf9d[_0x6519('0x46')],qs[_0x6519('0x48')](_0x356073[_0x6519('0x42')][_0x6519('0x48')]));_0x36fbd9[_0x6519('0x47')]=_0x36fbd9['attributes']['length']?_0x36fbd9['attributes']:_0x2cdf9d['model'];if(_0x356073[_0x6519('0x42')]['includeAll']){_0x36fbd9['include']=[{'all':!![]}];}_0x36fbd9=_[_0x6519('0x4f')]({},_0x36fbd9,_0x356073[_0x6519('0x51')]);return db[_0x6519('0x40')][_0x6519('0x58')](_0x36fbd9)[_0x6519('0x36')](handleEntityNotFound(_0x3805e9,null))[_0x6519('0x36')](respondWithResult(_0x3805e9,null))[_0x6519('0x29')](handleError(_0x3805e9,null));};exports['create']=function(_0x37f57b,_0x1e60a1){return db['OpenchannelAccount'][_0x6519('0x59')](_0x37f57b[_0x6519('0x5a')],{})[_0x6519('0x36')](function(_0x13160c){var _0x45fe87=_0x37f57b[_0x6519('0x5b')]['get']({'plain':!![]});if(!_0x45fe87)throw new Error(_0x6519('0x5c'));if(_0x45fe87[_0x6519('0x5d')]==='user'){var _0x9a8221=_0x13160c[_0x6519('0x37')]({'plain':!![]});var _0x2c0add=_0x6519('0x38');return db[_0x6519('0x5e')][_0x6519('0x58')]({'where':{'name':_0x2c0add,'userProfileId':_0x45fe87['userProfileId']},'raw':!![]})[_0x6519('0x36')](function(_0x16d077){if(_0x16d077&&_0x16d077[_0x6519('0x5f')]===0x0){return db[_0x6519('0x60')][_0x6519('0x59')]({'name':_0x9a8221['name'],'resourceId':_0x9a8221['id'],'type':_0x16d077[_0x6519('0x3a')],'sectionId':_0x16d077['id']},{})[_0x6519('0x36')](function(){return _0x13160c;});}else{return _0x13160c;}})['catch'](function(_0x2f917a){logger[_0x6519('0x25')](_0x6519('0x61'),_0x2f917a);throw _0x2f917a;});}return _0x13160c;})[_0x6519('0x36')](respondWithResult(_0x1e60a1,0xc9))[_0x6519('0x29')](handleError(_0x1e60a1,null));};exports[_0x6519('0x34')]=function(_0x41214e,_0x51021a){if(_0x41214e[_0x6519('0x5a')]['id']){delete _0x41214e['body']['id'];}return db[_0x6519('0x40')]['find']({'where':{'id':_0x41214e[_0x6519('0x62')]['id']},'include':[{'model':db[_0x6519('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x6519('0x36')](handleEntityNotFound(_0x51021a,null))[_0x6519('0x36')](saveUpdates(_0x41214e[_0x6519('0x5a')],null))[_0x6519('0x36')](respondWithResult(_0x51021a,null))[_0x6519('0x29')](handleError(_0x51021a,null));};exports['destroy']=function(_0x32949d,_0x37233d){return db['OpenchannelAccount'][_0x6519('0x58')]({'where':{'id':_0x32949d['params']['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x37233d,null))[_0x6519('0x36')](removeEntity(_0x37233d,null))[_0x6519('0x29')](handleError(_0x37233d,null));};exports[_0x6519('0x63')]=function(_0xd6df90,_0x282d7f){return db[_0x6519('0x40')]['describe']()['then'](respondWithResult(_0x282d7f,null))[_0x6519('0x29')](handleError(_0x282d7f,null));};exports[_0x6519('0x64')]=function(_0x350569,_0x497ecb,_0x27fd59){if(_0x350569['body']['id']){delete _0x350569[_0x6519('0x5a')]['id'];}return db['OpenchannelAccount'][_0x6519('0x58')]({'where':{'id':_0x350569[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x497ecb,null))['then'](function(_0x498777){if(_0x498777){_0x350569[_0x6519('0x5a')][_0x6519('0x65')]=_0x498777['id'];return db[_0x6519('0x66')]['create'](_0x350569[_0x6519('0x5a')]);}})[_0x6519('0x36')](respondWithResult(_0x497ecb,null))['catch'](handleError(_0x497ecb,null));};exports[_0x6519('0x67')]=function(_0x48e976,_0x2484e5,_0x18e260){var _0xb9cb34={'raw':![],'where':{}};var _0x494600={};var _0x54ca6b={'count':0x0,'rows':[]};return db[_0x6519('0x40')][_0x6519('0x68')]({'where':{'id':_0x48e976[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x2484e5,null))[_0x6519('0x36')](function(_0x466e56){if(_0x466e56){_0x494600['model']=_[_0x6519('0x43')](db[_0x6519('0x66')][_0x6519('0x57')]);_0x494600[_0x6519('0x42')]=_['keys'](_0x48e976['query']);_0x494600[_0x6519('0x44')]=_[_0x6519('0x45')](_0x494600[_0x6519('0x46')],_0x494600[_0x6519('0x42')]);_0xb9cb34[_0x6519('0x47')]=_[_0x6519('0x45')](_0x494600[_0x6519('0x46')],qs[_0x6519('0x48')](_0x48e976[_0x6519('0x42')]['fields']));_0xb9cb34[_0x6519('0x47')]=_0xb9cb34[_0x6519('0x47')][_0x6519('0x49')]?_0xb9cb34[_0x6519('0x47')]:_0x494600[_0x6519('0x46')];if(!_0x48e976[_0x6519('0x42')][_0x6519('0x69')](_0x6519('0x4a'))){_0xb9cb34[_0x6519('0x2f')]=qs[_0x6519('0x2f')](_0x48e976[_0x6519('0x42')][_0x6519('0x2f')]);_0xb9cb34['offset']=qs[_0x6519('0x2d')](_0x48e976['query'][_0x6519('0x2d')]);}_0xb9cb34[_0x6519('0x4b')]=qs[_0x6519('0x4c')](_0x48e976[_0x6519('0x42')][_0x6519('0x4c')]);_0xb9cb34[_0x6519('0x4d')]=qs['filters'](_['pick'](_0x48e976[_0x6519('0x42')],_0x494600[_0x6519('0x44')]));_0xb9cb34[_0x6519('0x4d')][_0x6519('0x65')]=_0x466e56['id'];if(_0x48e976[_0x6519('0x42')][_0x6519('0x50')]){_0xb9cb34[_0x6519('0x4d')]=_[_0x6519('0x4f')](_0xb9cb34[_0x6519('0x4d')],{'$or':_[_0x6519('0x3f')](_0xb9cb34[_0x6519('0x47')],function(_0x563f0f){var _0x539188={};_0x539188[_0x563f0f]={'$like':'%'+_0x48e976[_0x6519('0x42')][_0x6519('0x50')]+'%'};return _0x539188;})});}_0xb9cb34=_[_0x6519('0x4f')]({},_0xb9cb34,_0x48e976[_0x6519('0x51')]);return db[_0x6519('0x66')][_0x6519('0x30')]({'where':_0xb9cb34[_0x6519('0x4d')]})[_0x6519('0x36')](function(_0x2f65a9){_0x54ca6b[_0x6519('0x30')]=_0x2f65a9;if(_0x48e976[_0x6519('0x42')][_0x6519('0x52')]){_0xb9cb34[_0x6519('0x53')]=[{'all':!![]}];}return db[_0x6519('0x66')][_0x6519('0x54')](_0xb9cb34);})[_0x6519('0x36')](function(_0x90aab5){_0x54ca6b[_0x6519('0x55')]=_0x90aab5;return _0x54ca6b;});}})[_0x6519('0x36')](respondWithFilteredResult(_0x2484e5,_0xb9cb34))[_0x6519('0x29')](handleError(_0x2484e5,null));};exports[_0x6519('0x6a')]=function(_0x34b867,_0x2a909e,_0x12c61a){return db[_0x6519('0x40')][_0x6519('0x58')]({'where':{'id':_0x34b867[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x2a909e,null))[_0x6519('0x36')](function(_0x55c44d){if(_0x55c44d){return _0x55c44d['removeDispositions'](_0x34b867['query'][_0x6519('0x6b')]);}})['then'](respondWithStatusCode(_0x2a909e,null))[_0x6519('0x29')](handleError(_0x2a909e,null));};exports[_0x6519('0x6c')]=function(_0x3e19f4,_0x458dff,_0x575c08){if(_0x3e19f4['body']['id']){delete _0x3e19f4['body']['id'];}return db[_0x6519('0x40')][_0x6519('0x58')]({'where':{'id':_0x3e19f4[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x458dff,null))[_0x6519('0x36')](function(_0x8b09ad){if(_0x8b09ad){_0x3e19f4[_0x6519('0x5a')][_0x6519('0x65')]=_0x8b09ad['id'];return db[_0x6519('0x6d')][_0x6519('0x59')](_0x3e19f4[_0x6519('0x5a')]);}})[_0x6519('0x36')](respondWithResult(_0x458dff,null))[_0x6519('0x29')](handleError(_0x458dff,null));};exports[_0x6519('0x6e')]=function(_0x4737af,_0x44fe61,_0x22cddd){var _0x180a93={'raw':![],'where':{}};var _0xbf2e4a={};var _0x59074f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6519('0x68')]({'where':{'id':_0x4737af[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x44fe61,null))['then'](function(_0xd34428){if(_0xd34428){_0xbf2e4a[_0x6519('0x46')]=_[_0x6519('0x43')](db[_0x6519('0x6d')][_0x6519('0x57')]);_0xbf2e4a['query']=_[_0x6519('0x43')](_0x4737af[_0x6519('0x42')]);_0xbf2e4a[_0x6519('0x44')]=_[_0x6519('0x45')](_0xbf2e4a[_0x6519('0x46')],_0xbf2e4a[_0x6519('0x42')]);_0x180a93[_0x6519('0x47')]=_[_0x6519('0x45')](_0xbf2e4a[_0x6519('0x46')],qs['fields'](_0x4737af[_0x6519('0x42')][_0x6519('0x48')]));_0x180a93[_0x6519('0x47')]=_0x180a93['attributes']['length']?_0x180a93['attributes']:_0xbf2e4a[_0x6519('0x46')];if(!_0x4737af[_0x6519('0x42')]['hasOwnProperty'](_0x6519('0x4a'))){_0x180a93[_0x6519('0x2f')]=qs['limit'](_0x4737af[_0x6519('0x42')][_0x6519('0x2f')]);_0x180a93[_0x6519('0x2d')]=qs[_0x6519('0x2d')](_0x4737af[_0x6519('0x42')][_0x6519('0x2d')]);}_0x180a93['order']=qs[_0x6519('0x4c')](_0x4737af[_0x6519('0x42')][_0x6519('0x4c')]);_0x180a93[_0x6519('0x4d')]=qs[_0x6519('0x44')](_['pick'](_0x4737af[_0x6519('0x42')],_0xbf2e4a['filters']));_0x180a93[_0x6519('0x4d')]['OpenchannelAccountId']=_0xd34428['id'];if(_0x4737af[_0x6519('0x42')][_0x6519('0x50')]){_0x180a93['where']=_[_0x6519('0x4f')](_0x180a93['where'],{'$or':_[_0x6519('0x3f')](_0x180a93[_0x6519('0x47')],function(_0x35de46){var _0x1d79d2={};_0x1d79d2[_0x35de46]={'$like':'%'+_0x4737af[_0x6519('0x42')]['filter']+'%'};return _0x1d79d2;})});}_0x180a93=_['merge']({},_0x180a93,_0x4737af['options']);return db[_0x6519('0x6d')]['count']({'where':_0x180a93['where']})[_0x6519('0x36')](function(_0x412309){_0x59074f[_0x6519('0x30')]=_0x412309;if(_0x4737af[_0x6519('0x42')][_0x6519('0x52')]){_0x180a93['include']=[{'all':!![]}];}return db[_0x6519('0x6d')]['findAll'](_0x180a93);})[_0x6519('0x36')](function(_0x3e99ba){_0x59074f[_0x6519('0x55')]=_0x3e99ba;return _0x59074f;});}})['then'](respondWithFilteredResult(_0x44fe61,_0x180a93))['catch'](handleError(_0x44fe61,null));};exports[_0x6519('0x6f')]=function(_0x3aa68d,_0x258fad,_0x637544){return db['OpenchannelAccount'][_0x6519('0x58')]({'where':{'id':_0x3aa68d[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x258fad,null))['then'](function(_0x27ac3a){if(_0x27ac3a){return _0x27ac3a[_0x6519('0x6f')](_0x3aa68d['query']['ids']);}})['then'](respondWithStatusCode(_0x258fad,null))[_0x6519('0x29')](handleError(_0x258fad,null));};exports[_0x6519('0x70')]=function(_0x1f4989,_0x43cbe7,_0x354e94){var _0x4f4870={'body':_0x1f4989[_0x6519('0x5a')],'channel':_0x6519('0x71')};var _0x1a6735=[];var _0x4d2b9e=[];var _0x40ccaa={};var _0x2f13f1=![];return db[_0x6519('0x72')][_0x6519('0x63')]()[_0x6519('0x36')](function(_0x6982ca){if(!_0x6982ca){throw new db[(_0x6519('0x73'))][(_0x6519('0x74'))](_0x6519('0x75'));}_0x1a6735=_[_0x6519('0x76')](_['keys'](_0x6982ca),['createdAt',_0x6519('0x77')]);_0x4d2b9e=_[_0x6519('0x76')](_[_0x6519('0x43')](_0x6982ca),['createdAt','updatedAt','CompanyId',_0x6519('0x78')]);if(_0x1f4989['body']['id']){delete _0x1f4989[_0x6519('0x5a')]['id'];}if(_[_0x6519('0x79')](_0x1f4989[_0x6519('0x5a')]['from'])){throw new db[(_0x6519('0x73'))][(_0x6519('0x74'))](_0x6519('0x7a'));}if(_[_0x6519('0x79')](_0x1f4989[_0x6519('0x5a')][_0x6519('0x5a')])||_0x1f4989[_0x6519('0x5a')][_0x6519('0x5a')]===''){throw new db[(_0x6519('0x73'))]['ValidationError'](_0x6519('0x7b'));}if(_[_0x6519('0x79')](_0x1f4989[_0x6519('0x5a')][_0x6519('0x7c')])){throw new db[(_0x6519('0x73'))][(_0x6519('0x74'))](_0x6519('0x7d')+_0x4d2b9e);}if(!_[_0x6519('0x7e')](_0x4d2b9e,_0x1f4989['body']['mapKey'])){throw new db['Sequelize'][(_0x6519('0x74'))](_0x6519('0x7f')+_0x4d2b9e);}_0x40ccaa[_0x1f4989[_0x6519('0x5a')][_0x6519('0x7c')]]=_0x1f4989[_0x6519('0x5a')][_0x6519('0x80')];})[_0x6519('0x36')](function(){return db['OpenchannelAccount'][_0x6519('0x58')]({'where':{'id':_0x1f4989[_0x6519('0x62')]['id']},'include':[{'model':db[_0x6519('0x81')],'as':_0x6519('0x82'),'include':[{'model':db['CmContact'],'as':_0x6519('0x83'),'where':_0x40ccaa,'limit':0x1,'order':[[_0x6519('0x77'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x6519('0x84')}]});})[_0x6519('0x36')](handleEntityNotFound(_0x43cbe7,null))[_0x6519('0x36')](function(_0x19503b){if(_0x19503b&&_0x19503b[_0x6519('0x82')]){_0x4f4870[_0x6519('0x85')]=_0x19503b;_0x4f4870[_0x6519('0x86')]=_0x19503b[_0x6519('0x84')];_0x4f4870[_0x6519('0x87')]=_0x19503b['List'];_0x4f4870[_0x6519('0x86')]=_[_0x6519('0x88')](_0x4f4870[_0x6519('0x86')],[_0x6519('0x89')],[_0x6519('0x8a')]);if(_0x4f4870[_0x6519('0x85')][_0x6519('0x84')]){delete _0x4f4870[_0x6519('0x85')][_0x6519('0x84')];}if(_0x4f4870[_0x6519('0x85')][_0x6519('0x82')]&&_0x4f4870[_0x6519('0x85')][_0x6519('0x82')][_0x6519('0x83')][_0x6519('0x49')]){return _0x4f4870[_0x6519('0x85')][_0x6519('0x82')][_0x6519('0x83')][0x0];}var _0x4b636e=_['defaults'](_0x1f4989[_0x6519('0x5a')],{'firstName':_0x1f4989['body'][_0x6519('0x80')],'ListId':_0x19503b[_0x6519('0x78')]});_0x4b636e[_0x1f4989['body'][_0x6519('0x7c')]]=_0x1f4989['body'][_0x6519('0x80')];return db[_0x6519('0x72')][_0x6519('0x59')](_0x4b636e,{'fields':_0x1a6735,'raw':!![]});}})['then'](handleEntityNotFound(_0x43cbe7,null))['then'](function(_0x2117e1){_0x4f4870[_0x6519('0x8b')]=_0x2117e1;if(_0x2117e1){var _0x4ef3a9={'ContactId':_0x2117e1['id'],'OpenchannelAccountId':_0x1f4989['params']['id'],'from':(_0x2117e1[_0x6519('0x8c')]||'')+'\x20'+(_0x2117e1[_0x6519('0x8d')]||'')};var _0x2d1519={'OpenchannelAccountId':_0x1f4989[_0x6519('0x62')]['id'],'closed':![]};if(_0x1f4989[_0x6519('0x5a')][_0x6519('0x8e')]){_0x2d1519[_0x6519('0x8e')]=_0x1f4989['body']['threadId'];return db[_0x6519('0x8f')][_0x6519('0x58')]({'where':_0x2d1519})[_0x6519('0x36')](function(_0x1f91dd){if(_0x1f91dd){return[_0x1f91dd,![]];}_0x4ef3a9[_0x6519('0x8e')]=_0x1f4989[_0x6519('0x5a')][_0x6519('0x8e')];_0x4ef3a9[_0x6519('0x90')]=_0x1f4989[_0x6519('0x5a')][_0x6519('0x90')];return db[_0x6519('0x8f')][_0x6519('0x59')](_0x4ef3a9)['then'](function(_0x196588){return[_0x196588,!![]];});});}else{_0x2d1519[_0x6519('0x8e')]=null;}_0x2d1519[_0x6519('0x91')]=_0x2117e1['id'];return db[_0x6519('0x8f')][_0x6519('0x58')]({'where':_0x2d1519})['then'](function(_0x4985c0){if(_0x4985c0){return[_0x4985c0,![]];}return db[_0x6519('0x8f')][_0x6519('0x59')](_0x4ef3a9)[_0x6519('0x36')](function(_0x1804e1){return[_0x1804e1,!![]];});});}})[_0x6519('0x92')](function(_0x1425cd,_0x60cca){if(_0x1425cd){_0x2f13f1=_0x60cca;if(!_0x60cca){var _0x4dadbf={'from':(_0x4f4870[_0x6519('0x8b')][_0x6519('0x8c')]||'')+'\x20'+(_0x4f4870[_0x6519('0x8b')]['lastName']||'')};if(_0x1f4989[_0x6519('0x5a')][_0x6519('0x8e')]&&_0x1f4989[_0x6519('0x5a')][_0x6519('0x93')]&&_0x1f4989[_0x6519('0x5a')][_0x6519('0x8e')]!=_0x1f4989[_0x6519('0x5a')][_0x6519('0x93')]){_0x4dadbf[_0x6519('0x8e')]=_0x1f4989[_0x6519('0x5a')][_0x6519('0x93')];}return _0x1425cd[_0x6519('0x34')](_0x4dadbf);}else{return _0x1425cd;}}})[_0x6519('0x36')](function(_0x5598c8){_0x4f4870[_0x6519('0x94')]=_0x5598c8['get']({'plain':!![]});_0x4f4870[_0x6519('0x94')][_0x6519('0x95')]=_0x2f13f1;if(_0x4f4870['interaction'][_0x6519('0x95')]){if(_0x4f4870[_0x6519('0x85')][_0x6519('0x96')]){_0x4f4870[_0x6519('0x86')][_0x6519('0x97')]({'id':0x0,'priority':_0x4f4870[_0x6519('0x86')][_0x6519('0x49')]+0x1,'app':_0x6519('0x98'),'appdata':_0x6519('0x99'),'interval':_0x6519('0x9a')});}}return db['OpenchannelMessage']['create']({'body':_0x1f4989[_0x6519('0x5a')]['body'],'OpenchannelAccountId':_0x1f4989[_0x6519('0x62')]['id'],'OpenchannelInteractionId':_0x5598c8['id'],'direction':'in','ContactId':_0x4f4870[_0x6519('0x8b')]['id'],'AttachmentId':_0x1f4989[_0x6519('0x5a')][_0x6519('0x9b')]});})['then'](function(_0x20cafc){_0x4f4870[_0x6519('0x27')]=_0x20cafc;if(_0x4f4870['interaction']['UserId']){return db[_0x6519('0x9c')]['find']({'attributes':['id',_0x6519('0x3a')],'where':{'id':_0x4f4870[_0x6519('0x94')][_0x6519('0x9d')]}})[_0x6519('0x36')](function(_0x260709){if(_0x260709){_0x4f4870[_0x6519('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6519('0x9e'),'appdata':_0x260709[_0x6519('0x3a')]+','+(_0x4f4870[_0x6519('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0x6519('0x9a')});_0x4f4870['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x6519('0x9f'),_0x4f4870);});}return respondWithRpcPromise(_0x6519('0xa0'),_0x6519('0x9f'),_0x4f4870);})[_0x6519('0x36')](function(_0xbaeee8){respondWithRpcPromise('EventManager',_0x6519('0xa1'),{'event':_0x6519('0x70'),'message':_0xbaeee8},client9002);return _0xbaeee8;})['then'](respondWithResult(_0x43cbe7,null))[_0x6519('0x29')](handleError(_0x43cbe7,null));};exports['addApplications']=function(_0x35228f,_0x1735f3,_0x577ca2){return db[_0x6519('0x40')][_0x6519('0x68')]({'where':{'id':_0x35228f[_0x6519('0x62')]['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x1735f3,null))[_0x6519('0x36')](function(_0x610468){if(_0x610468){return db[_0x6519('0xa2')][_0x6519('0xa3')](function(_0x1a22e5){return db[_0x6519('0xa4')][_0x6519('0x35')]({'where':{'OpenchannelAccountId':_0x35228f['params']['id']},'transaction':_0x1a22e5})[_0x6519('0x36')](function(_0x1ae8f0){var _0x292320=_[_0x6519('0x3f')](_0x35228f[_0x6519('0x5a')],function(_0x206a29){_0x206a29[_0x6519('0x65')]=_0x35228f[_0x6519('0x62')]['id'];return _0x206a29;});return db[_0x6519('0xa4')][_0x6519('0xa5')](_0x292320,{'transaction':_0x1a22e5});});})[_0x6519('0x36')](function(){return db[_0x6519('0xa4')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x35228f['params']['id']},'order':_0x6519('0x89')});});}})[_0x6519('0x36')](respondWithResult(_0x1735f3,null))[_0x6519('0x29')](handleError(_0x1735f3,null));};exports[_0x6519('0xa6')]=function(_0x6ff7d6,_0x5606e7,_0x142760){var _0x527194={};var _0xec6af5={};var _0x745ff8;var _0x304e6c;return db[_0x6519('0x40')][_0x6519('0x68')]({'where':{'id':_0x6ff7d6[_0x6519('0x62')]['id']}})['then'](handleEntityNotFound(_0x5606e7,null))[_0x6519('0x36')](function(_0x25e831){if(_0x25e831){_0x745ff8=_0x25e831;_0xec6af5[_0x6519('0x46')]=_[_0x6519('0x43')](db[_0x6519('0xa4')][_0x6519('0x57')]);_0xec6af5[_0x6519('0x42')]=_[_0x6519('0x43')](_0x6ff7d6[_0x6519('0x42')]);_0xec6af5[_0x6519('0x44')]=_[_0x6519('0x45')](_0xec6af5[_0x6519('0x46')],_0xec6af5[_0x6519('0x42')]);_0x527194[_0x6519('0x47')]=_[_0x6519('0x45')](_0xec6af5[_0x6519('0x46')],qs[_0x6519('0x48')](_0x6ff7d6[_0x6519('0x42')][_0x6519('0x48')]));_0x527194[_0x6519('0x47')]=_0x527194[_0x6519('0x47')][_0x6519('0x49')]?_0x527194[_0x6519('0x47')]:_0xec6af5[_0x6519('0x46')];_0x527194[_0x6519('0x4b')]=qs[_0x6519('0x4c')](_0x6ff7d6[_0x6519('0x42')][_0x6519('0x4c')]);_0x527194['where']=qs['filters'](_[_0x6519('0x4e')](_0x6ff7d6[_0x6519('0x42')],_0xec6af5[_0x6519('0x44')]));if(_0x6ff7d6[_0x6519('0x42')][_0x6519('0x50')]){_0x527194[_0x6519('0x4d')]=_[_0x6519('0x4f')](_0x527194['where'],{'$or':_['map'](_0x527194[_0x6519('0x47')],function(_0x3cff75){var _0x3c3894={};_0x3c3894[_0x3cff75]={'$like':'%'+_0x6ff7d6[_0x6519('0x42')]['filter']+'%'};return _0x3c3894;})});}_0x527194=_[_0x6519('0x4f')]({},_0x527194,_0x6ff7d6[_0x6519('0x51')]);return _0x745ff8[_0x6519('0xa6')](_0x527194);}})[_0x6519('0x36')](function(_0x243bd9){if(_0x243bd9){_0x304e6c=_0x243bd9['length'];if(!_0x6ff7d6[_0x6519('0x42')]['hasOwnProperty']('nolimit')){_0x527194[_0x6519('0x2f')]=qs[_0x6519('0x2f')](_0x6ff7d6[_0x6519('0x42')][_0x6519('0x2f')]);_0x527194[_0x6519('0x2d')]=qs[_0x6519('0x2d')](_0x6ff7d6['query'][_0x6519('0x2d')]);}return _0x745ff8['getApplications'](_0x527194);}})[_0x6519('0x36')](function(_0x493c30){if(_0x493c30){return _0x493c30?{'count':_0x304e6c,'rows':_0x493c30}:null;}})[_0x6519('0x36')](respondWithResult(_0x5606e7,null))[_0x6519('0x29')](handleError(_0x5606e7,null));};exports['getInteractions']=function(_0x24575d,_0x47a746,_0x5ee638){var _0x38aa3c={'raw':![],'where':{}};var _0xa6be14={};var _0xd989d6={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6519('0x68')]({'where':{'id':_0x24575d[_0x6519('0x62')]['id']}})['then'](handleEntityNotFound(_0x47a746,null))['then'](function(_0x579914){if(_0x579914){_0xa6be14[_0x6519('0x46')]=_[_0x6519('0x43')](db[_0x6519('0x8f')]['rawAttributes']);_0xa6be14['query']=_[_0x6519('0x43')](_0x24575d[_0x6519('0x42')]);_0xa6be14[_0x6519('0x44')]=_['intersection'](_0xa6be14[_0x6519('0x46')],_0xa6be14[_0x6519('0x42')]);_0x38aa3c[_0x6519('0x47')]=_[_0x6519('0x45')](_0xa6be14[_0x6519('0x46')],qs[_0x6519('0x48')](_0x24575d[_0x6519('0x42')][_0x6519('0x48')]));_0x38aa3c[_0x6519('0x47')]=_0x38aa3c['attributes']['length']?_0x38aa3c[_0x6519('0x47')]:_0xa6be14['model'];if(!_0x24575d[_0x6519('0x42')]['hasOwnProperty'](_0x6519('0x4a'))){_0x38aa3c['limit']=qs[_0x6519('0x2f')](_0x24575d[_0x6519('0x42')]['limit']);_0x38aa3c[_0x6519('0x2d')]=qs[_0x6519('0x2d')](_0x24575d[_0x6519('0x42')][_0x6519('0x2d')]);}_0x38aa3c[_0x6519('0x4b')]=qs[_0x6519('0x4c')](_0x24575d[_0x6519('0x42')][_0x6519('0x4c')]);_0x38aa3c[_0x6519('0x4d')]=qs[_0x6519('0x44')](_[_0x6519('0x4e')](_0x24575d[_0x6519('0x42')],_0xa6be14['filters']));_0x38aa3c['where'][_0x6519('0x65')]=_0x579914['id'];if(_0x24575d[_0x6519('0x42')][_0x6519('0x50')]){_0x38aa3c[_0x6519('0x4d')]=_[_0x6519('0x4f')](_0x38aa3c['where'],{'$or':_[_0x6519('0x3f')](_0x38aa3c[_0x6519('0x47')],function(_0x4bc8ae){var _0xb7898a={};_0xb7898a[_0x4bc8ae]={'$like':'%'+_0x24575d[_0x6519('0x42')][_0x6519('0x50')]+'%'};return _0xb7898a;})});}_0x38aa3c=_['merge']({},_0x38aa3c,_0x24575d[_0x6519('0x51')]);return db[_0x6519('0x8f')][_0x6519('0x30')]({'where':_0x38aa3c[_0x6519('0x4d')]})['then'](function(_0x5b6817){_0xd989d6[_0x6519('0x30')]=_0x5b6817;if(_0x24575d[_0x6519('0x42')][_0x6519('0x52')]){_0x38aa3c[_0x6519('0x53')]=[{'model':db[_0x6519('0x72')],'as':_0x6519('0xa7'),'required':![]},{'model':db[_0x6519('0x9c')],'as':'Owner','attributes':[_0x6519('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0x6519('0xa8')],'as':_0x6519('0xa9'),'attributes':['id',_0x6519('0x3a'),'color'],'where':_0x24575d[_0x6519('0x42')][_0x6519('0xaa')]?{'id':_0x24575d[_0x6519('0x42')][_0x6519('0xaa')]}:undefined,'required':_0x24575d[_0x6519('0x42')][_0x6519('0xaa')]?!![]:![]}];}return db[_0x6519('0x8f')]['findAll'](_0x38aa3c);})[_0x6519('0x36')](function(_0x2b73c1){_0xd989d6[_0x6519('0x55')]=_0x2b73c1;return _0xd989d6;});}})[_0x6519('0x36')](respondWithFilteredResult(_0x47a746,_0x38aa3c))[_0x6519('0x29')](handleError(_0x47a746,null));};exports['addAgents']=function(_0x54f045,_0x272e05,_0x49e022){return db[_0x6519('0x40')][_0x6519('0x58')]({'where':{'id':_0x54f045['params']['id']}})[_0x6519('0x36')](handleEntityNotFound(_0x272e05,null))[_0x6519('0x36')](function(_0xc8feb5){if(_0xc8feb5){return _0xc8feb5[_0x6519('0xab')](_0x54f045[_0x6519('0x5a')][_0x6519('0x6b')],_['omit'](_0x54f045[_0x6519('0x5a')],['ids','id'])||{})[_0x6519('0x92')](function(_0x555d37){for(var _0x47eb04=0x0;_0x47eb04<_0x54f045[_0x6519('0x5a')][_0x6519('0x6b')][_0x6519('0x49')];_0x47eb04+=0x1){socket[_0x6519('0xac')]('userOpenchannelAccount:save',{'UserId':Number(_0x54f045[_0x6519('0x5a')]['ids'][_0x47eb04]),'OpenchannelAccountId':Number(_0x54f045[_0x6519('0x62')]['id'])});}return _0x555d37;});}})[_0x6519('0x36')](respondWithResult(_0x272e05,null))[_0x6519('0x29')](handleError(_0x272e05,null));};exports['removeAgents']=function(_0x4c713f,_0x543d88,_0x2b1834){return db[_0x6519('0x40')]['find']({'where':{'id':_0x4c713f[_0x6519('0x62')]['id']}})['then'](handleEntityNotFound(_0x543d88,null))[_0x6519('0x36')](function(_0x196078){if(_0x196078){return _0x196078[_0x6519('0xad')](_0x4c713f['query'][_0x6519('0x6b')])[_0x6519('0x36')](function(){if(_[_0x6519('0xae')](_0x4c713f[_0x6519('0x42')][_0x6519('0x6b')])){for(var _0x273605=0x0;_0x273605<_0x4c713f[_0x6519('0x42')][_0x6519('0x6b')][_0x6519('0x49')];_0x273605+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4c713f[_0x6519('0x42')][_0x6519('0x6b')][_0x273605]),'OpenchannelAccountId':Number(_0x4c713f['params']['id'])});}}else{socket[_0x6519('0xac')](_0x6519('0xaf'),{'UserId':Number(_0x4c713f[_0x6519('0x42')][_0x6519('0x6b')]),'OpenchannelAccountId':Number(_0x4c713f['params']['id'])});}});}})[_0x6519('0x36')](respondWithStatusCode(_0x543d88,null))[_0x6519('0x29')](handleError(_0x543d88,null));};exports[_0x6519('0xb0')]=function(_0x3f30f3,_0x1d1aa4,_0x402160){var _0x463e54={};var _0x1a4a39={};var _0x2a9711;var _0x505fb8;return db[_0x6519('0x40')][_0x6519('0x68')]({'where':{'id':_0x3f30f3[_0x6519('0x62')]['id']}})['then'](handleEntityNotFound(_0x1d1aa4,null))['then'](function(_0x2b8a84){if(_0x2b8a84){_0x2a9711=_0x2b8a84;_0x1a4a39[_0x6519('0x46')]=_[_0x6519('0x43')](db['User'][_0x6519('0x57')]);_0x1a4a39['query']=_[_0x6519('0x43')](_0x3f30f3['query']);_0x1a4a39[_0x6519('0x44')]=_[_0x6519('0x45')](_0x1a4a39[_0x6519('0x46')],_0x1a4a39[_0x6519('0x42')]);_0x463e54[_0x6519('0x47')]=_['intersection'](_0x1a4a39['model'],qs[_0x6519('0x48')](_0x3f30f3[_0x6519('0x42')][_0x6519('0x48')]));_0x463e54[_0x6519('0x47')]=_0x463e54[_0x6519('0x47')][_0x6519('0x49')]?_0x463e54['attributes']:_0x1a4a39['model'];_0x463e54[_0x6519('0x4b')]=qs[_0x6519('0x4c')](_0x3f30f3['query'][_0x6519('0x4c')]);_0x463e54[_0x6519('0x4d')]=qs[_0x6519('0x44')](_[_0x6519('0x4e')](_0x3f30f3[_0x6519('0x42')],_0x1a4a39['filters']));if(_0x3f30f3[_0x6519('0x42')][_0x6519('0x50')]){_0x463e54[_0x6519('0x4d')]=_[_0x6519('0x4f')](_0x463e54['where'],{'$or':_[_0x6519('0x3f')](_0x463e54[_0x6519('0x47')],function(_0x5dcee3){var _0x9da2d1={};_0x9da2d1[_0x5dcee3]={'$like':'%'+_0x3f30f3[_0x6519('0x42')][_0x6519('0x50')]+'%'};return _0x9da2d1;})});}_0x463e54=_[_0x6519('0x4f')]({},_0x463e54,_0x3f30f3['options']);return _0x2a9711[_0x6519('0xb0')](_0x463e54);}})[_0x6519('0x36')](function(_0x141e84){if(_0x141e84){_0x505fb8=_0x141e84[_0x6519('0x49')];if(!_0x3f30f3[_0x6519('0x42')][_0x6519('0x69')](_0x6519('0x4a'))){_0x463e54[_0x6519('0x2f')]=qs[_0x6519('0x2f')](_0x3f30f3[_0x6519('0x42')][_0x6519('0x2f')]);_0x463e54['offset']=qs[_0x6519('0x2d')](_0x3f30f3['query'][_0x6519('0x2d')]);}return _0x2a9711[_0x6519('0xb0')](_0x463e54);}})[_0x6519('0x36')](function(_0x1ca758){if(_0x1ca758){return _0x1ca758?{'count':_0x505fb8,'rows':_0x1ca758}:null;}})[_0x6519('0x36')](respondWithResult(_0x1d1aa4,null))[_0x6519('0x29')](handleError(_0x1d1aa4,null));};exports[_0x6519('0x3b')]=function(_0x21dc84,_0x348069,_0x42e190){var _0x1d282f,_0xcf6e92,_0x11d163;if(_['isNil'](_0x21dc84[_0x6519('0x5a')][_0x6519('0x5a')])||_0x21dc84[_0x6519('0x5a')][_0x6519('0x5a')]===''){throw new db['Sequelize'][(_0x6519('0x74'))](_0x6519('0x7b'));}if(_[_0x6519('0x79')](_0x21dc84[_0x6519('0x5a')]['to'])){}_0x1d282f=_0x21dc84[_0x6519('0x5a')]['to'];return db[_0x6519('0x40')][_0x6519('0x68')]({'where':{'id':_0x21dc84['params']['id']}})['then'](handleEntityNotFound(_0x348069,null))[_0x6519('0x36')](function(_0x53ae48){if(_0x53ae48){return db[_0x6519('0x40')][_0x6519('0x58')]({'where':{'id':_0x53ae48['id']},'include':[{'model':db[_0x6519('0x81')],'as':_0x6519('0x82'),'include':[{'model':db[_0x6519('0x72')],'as':_0x6519('0x83'),'where':{[_0x53ae48[_0x6519('0x7c')]]:_0x1d282f},'limit':0x1,'order':[[_0x6519('0x77'),'DESC']]}]}]})[_0x6519('0x36')](handleEntityNotFound(_0x348069,null))['then'](function(_0x102046){if(_0x102046&&_0x102046[_0x6519('0x82')]){_0xcf6e92=_0x102046[_0x6519('0x37')]({'plain':!![]});if(_0xcf6e92['List']&&_0xcf6e92[_0x6519('0x82')][_0x6519('0x83')][_0x6519('0x49')]){return _0xcf6e92[_0x6519('0x82')][_0x6519('0x83')][0x0];}return db[_0x6519('0x72')][_0x6519('0x59')](_[_0x6519('0x19')](_0x21dc84[_0x6519('0x5a')],{'firstName':_0x1d282f,[_0x102046[_0x6519('0x7c')]]:_0x1d282f,'phone':_0x1d282f,'ListId':_0xcf6e92['ListId']}));}})['then'](handleEntityNotFound(_0x348069,null))['then'](function(_0x4469b6){if(_0x4469b6){_0x11d163=_0x4469b6;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x11d163['id'],'closed':![],'OpenchannelAccountId':_0xcf6e92['id']}})[_0x6519('0x36')](function(_0x56f351){if(_0x56f351){return[_0x56f351,![]];}return db[_0x6519('0x8f')][_0x6519('0x59')]({'UserId':_0x21dc84[_0x6519('0x5b')]['id'],'ContactId':_0x11d163['id'],'OpenchannelAccountId':_0xcf6e92['id'],'lastMsgDirection':_0x6519('0xb1'),'Messages':[_['merge'](_0x21dc84[_0x6519('0x5a')],{'read':![],'body':_0x21dc84[_0x6519('0x5a')][_0x6519('0x5a')],'OpenchannelAccountId':_0xcf6e92['id'],'UserId':_0x21dc84[_0x6519('0x5b')]['id'],'ContactId':_0x11d163['id']})]},{'include':[{'model':db[_0x6519('0xb2')],'as':_0x6519('0xb3')}]})['then'](function(_0x53b329){return[_0x53b329,!![]];});});}})[_0x6519('0x92')](function(_0xae6782,_0x331977){if(_0x331977){return _0xae6782;}return db[_0x6519('0xb2')][_0x6519('0x59')](_[_0x6519('0x4f')](_0x21dc84[_0x6519('0x5a')],{'read':![],'body':_0x21dc84['body'][_0x6519('0x5a')],'OpenchannelAccountId':_0xcf6e92['id'],'OpenchannelInteractionId':_0xae6782['id'],'UserId':_0x21dc84[_0x6519('0x5b')]['id'],'ContactId':_0x11d163['id']}))[_0x6519('0x36')](function(_0xaddc67){_0xae6782['dataValues'][_0x6519('0xb3')]=[];_0xae6782[_0x6519('0xb4')][_0x6519('0xb3')][_0x6519('0x97')](_0xaddc67[_0x6519('0xb4')]);return _0xae6782;});});}})[_0x6519('0x36')](respondWithResult(_0x348069,null))[_0x6519('0x29')](handleError(_0x348069,null));}; \ No newline at end of file +var _0xab51=['Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','OpenchannelAccounts','sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelAccount','includeAll','include','rows','show','params','mandatoryDispositionPause','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','destroy','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','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','from','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','bulkCreate','getApplications','fullname','internal','Tag','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xab51,0x172));var _0x1ab5=function(_0x1b0370,_0x1d0d02){_0x1b0370=_0x1b0370-0x0;var _0x2cec59=_0xab51[_0x1b0370];return _0x2cec59;};'use strict';var emlformat=require(_0x1ab5('0x0'));var rimraf=require(_0x1ab5('0x1'));var zipdir=require(_0x1ab5('0x2'));var jsonpatch=require(_0x1ab5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1ab5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ab5('0x5'));var fs=require('fs');var fs_extra=require(_0x1ab5('0x6'));var _=require(_0x1ab5('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1ab5('0x8'));var deskjs=require(_0x1ab5('0x9'));var toCsv=require(_0x1ab5('0xa'));var querystring=require(_0x1ab5('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ab5('0xc'));var qs=require(_0x1ab5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ab5('0xe'));var logger=require(_0x1ab5('0xf'))(_0x1ab5('0x10'));var utils=require('../../config/utils');var config=require(_0x1ab5('0x11'));var licenseUtil=require(_0x1ab5('0x12'));var db=require(_0x1ab5('0x13'))['db'];config[_0x1ab5('0x14')]=_[_0x1ab5('0x15')](config['redis'],{'host':_0x1ab5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ab5('0x14')]));require(_0x1ab5('0x17'))[_0x1ab5('0x18')](socket);var jayson=require(_0x1ab5('0x19'));var client=jayson['client'][_0x1ab5('0x1a')]({'port':0x232c});var client9002=jayson[_0x1ab5('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4757e2,_0x30e534,_0x2ddfc0,_0x1c1d77){return new BPromise(function(_0x3b55d6,_0x29c981){var _0x101200=_0x1c1d77||client;return _0x101200[_0x1ab5('0x1c')](_0x4757e2,_0x2ddfc0)[_0x1ab5('0x1d')](function(_0x27ab75){logger[_0x1ab5('0x1e')](_0x1ab5('0x1f'),_0x30e534,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x30e534,_0x1ab5('0x20'),JSON[_0x1ab5('0x21')](_0x27ab75));if(_0x27ab75[_0x1ab5('0x22')]){if(_0x27ab75[_0x1ab5('0x22')]['code']===0x1f4){logger[_0x1ab5('0x22')](_0x1ab5('0x1f'),_0x30e534,_0x27ab75[_0x1ab5('0x22')][_0x1ab5('0x23')]);return _0x29c981(_0x27ab75[_0x1ab5('0x22')]['message']);}logger[_0x1ab5('0x22')](_0x1ab5('0x1f'),_0x30e534,_0x27ab75[_0x1ab5('0x22')][_0x1ab5('0x23')]);return _0x3b55d6(_0x27ab75[_0x1ab5('0x22')][_0x1ab5('0x23')]);}else{logger[_0x1ab5('0x1e')](_0x1ab5('0x1f'),_0x30e534,_0x1ab5('0x20'));_0x3b55d6(_0x27ab75[_0x1ab5('0x24')][_0x1ab5('0x23')]);}})[_0x1ab5('0x25')](function(_0x44ecef){logger[_0x1ab5('0x22')](_0x1ab5('0x1f'),_0x30e534,_0x44ecef);_0x29c981(_0x44ecef);});});}function respondWithStatusCode(_0xbcb3f8,_0x5f1ed9){_0x5f1ed9=_0x5f1ed9||0xcc;return function(_0x4d8ae1){if(_0x4d8ae1){return _0xbcb3f8['sendStatus'](_0x5f1ed9);}return _0xbcb3f8[_0x1ab5('0x26')](_0x5f1ed9)[_0x1ab5('0x27')]();};}function respondWithResult(_0x46126c,_0x4e1037){_0x4e1037=_0x4e1037||0xc8;return function(_0x285e5d){if(_0x285e5d){return _0x46126c[_0x1ab5('0x26')](_0x4e1037)['json'](_0x285e5d);}};}function respondWithFilteredResult(_0x55aed7,_0x37e7ae){return function(_0x51a69c){if(_0x51a69c){var _0x21fdfd=typeof _0x37e7ae[_0x1ab5('0x28')]===_0x1ab5('0x29')&&typeof _0x37e7ae[_0x1ab5('0x2a')]===_0x1ab5('0x29');var _0x19b351=_0x51a69c[_0x1ab5('0x2b')];var _0x3677e8=_0x21fdfd?0x0:_0x37e7ae[_0x1ab5('0x28')];var _0x5c6ac1=_0x21fdfd?_0x51a69c[_0x1ab5('0x2b')]:_0x37e7ae['offset']+_0x37e7ae[_0x1ab5('0x2a')];var _0x277a3d;if(_0x5c6ac1>=_0x19b351){_0x5c6ac1=_0x19b351;_0x277a3d=0xc8;}else{_0x277a3d=0xce;}_0x55aed7['status'](_0x277a3d);return _0x55aed7[_0x1ab5('0x2c')](_0x1ab5('0x2d'),_0x3677e8+'-'+_0x5c6ac1+'/'+_0x19b351)['json'](_0x51a69c);}return null;};}function patchUpdates(_0x4a2f6d){return function(_0x273c0d){try{jsonpatch[_0x1ab5('0x2e')](_0x273c0d,_0x4a2f6d,!![]);}catch(_0x26bec9){return BPromise['reject'](_0x26bec9);}return _0x273c0d['save']();};}function saveUpdates(_0x2745a7,_0x34f7e9){return function(_0x43c118){if(_0x43c118){return _0x43c118[_0x1ab5('0x2f')](_0x2745a7)[_0x1ab5('0x1d')](function(_0x376507){return _0x376507;});}return null;};}function removeEntity(_0x46b530,_0x5ab9de){return function(_0x4320bf){if(_0x4320bf){return _0x4320bf['destroy']()[_0x1ab5('0x1d')](function(){var _0x1bcc38=_0x4320bf['get']({'plain':!![]});var _0x44eb80=_0x1ab5('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x44eb80,'resourceId':_0x1bcc38['id']}})['then'](function(){return _0x4320bf;});})[_0x1ab5('0x1d')](function(){_0x46b530['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ec24f,_0x27e7d4){return function(_0x10147e){if(!_0x10147e){_0x3ec24f[_0x1ab5('0x31')](0x194);}return _0x10147e;};}function handleError(_0x238acf,_0x4f78b4){_0x4f78b4=_0x4f78b4||0x1f4;return function(_0x342c94){logger['error'](_0x342c94['stack']);if(_0x342c94[_0x1ab5('0x32')]){delete _0x342c94[_0x1ab5('0x32')];}_0x238acf[_0x1ab5('0x26')](_0x4f78b4)[_0x1ab5('0x33')](_0x342c94);};}exports[_0x1ab5('0x34')]=function(_0x5b9d12,_0xd69fa5){var _0x4fa6af={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2872ad={},_0x3543c2={'count':0x0,'rows':[]};var _0x209c76=_[_0x1ab5('0x35')](db['OpenchannelAccount'][_0x1ab5('0x36')],function(_0x5a185d){return{'name':_0x5a185d[_0x1ab5('0x37')],'type':_0x5a185d[_0x1ab5('0x38')]['key']};});_0x2872ad[_0x1ab5('0x39')]=_[_0x1ab5('0x35')](_0x209c76,'name');_0x2872ad[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x5b9d12[_0x1ab5('0x3a')]);_0x2872ad[_0x1ab5('0x3c')]=_[_0x1ab5('0x3d')](_0x2872ad[_0x1ab5('0x39')],_0x2872ad[_0x1ab5('0x3a')]);_0x4fa6af['attributes']=_['intersection'](_0x2872ad[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0x4fa6af[_0x1ab5('0x3f')]=_0x4fa6af['attributes'][_0x1ab5('0x40')]?_0x4fa6af['attributes']:_0x2872ad['model'];if(!_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x41')](_0x1ab5('0x42'))){_0x4fa6af[_0x1ab5('0x2a')]=qs['limit'](_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x2a')]);_0x4fa6af['offset']=qs['offset'](_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x28')]);}_0x4fa6af[_0x1ab5('0x43')]=qs[_0x1ab5('0x44')](_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x44')]);_0x4fa6af[_0x1ab5('0x45')]=qs[_0x1ab5('0x3c')](_[_0x1ab5('0x46')](_0x5b9d12[_0x1ab5('0x3a')],_0x2872ad[_0x1ab5('0x3c')]),_0x209c76);if(_0x5b9d12['query'][_0x1ab5('0x47')]){_0x4fa6af[_0x1ab5('0x45')]=_[_0x1ab5('0x48')](_0x4fa6af[_0x1ab5('0x45')],{'$or':_[_0x1ab5('0x35')](_0x209c76,function(_0x357e40){if(_0x357e40[_0x1ab5('0x38')]!=='VIRTUAL'){var _0xd31fdd={};_0xd31fdd[_0x357e40['name']]={'$like':'%'+_0x5b9d12[_0x1ab5('0x3a')][_0x1ab5('0x47')]+'%'};return _0xd31fdd;}})});}_0x4fa6af=_[_0x1ab5('0x48')]({},_0x4fa6af,_0x5b9d12[_0x1ab5('0x49')]);var _0x148972={'where':_0x4fa6af[_0x1ab5('0x45')]};return db[_0x1ab5('0x4a')]['count'](_0x148972)['then'](function(_0x363105){_0x3543c2[_0x1ab5('0x2b')]=_0x363105;if(_0x5b9d12['query'][_0x1ab5('0x4b')]){_0x4fa6af[_0x1ab5('0x4c')]=[{'all':!![]}];}return db[_0x1ab5('0x4a')]['findAll'](_0x4fa6af);})[_0x1ab5('0x1d')](function(_0x59d1eb){_0x3543c2[_0x1ab5('0x4d')]=_0x59d1eb;return _0x3543c2;})[_0x1ab5('0x1d')](respondWithFilteredResult(_0xd69fa5,_0x4fa6af))[_0x1ab5('0x25')](handleError(_0xd69fa5,null));};exports[_0x1ab5('0x4e')]=function(_0x2b204d,_0x23a1d5){var _0x3ccbdd={'raw':![],'where':{'id':_0x2b204d[_0x1ab5('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x1ab5('0x50')}]},_0x186b25={};_0x186b25[_0x1ab5('0x39')]=_[_0x1ab5('0x3b')](db[_0x1ab5('0x4a')][_0x1ab5('0x36')]);_0x186b25[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x2b204d[_0x1ab5('0x3a')]);_0x186b25['filters']=_[_0x1ab5('0x3d')](_0x186b25[_0x1ab5('0x39')],_0x186b25['query']);_0x3ccbdd[_0x1ab5('0x3f')]=_[_0x1ab5('0x3d')](_0x186b25[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x2b204d['query'][_0x1ab5('0x3e')]));_0x3ccbdd[_0x1ab5('0x3f')]=_0x3ccbdd[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0x3ccbdd[_0x1ab5('0x3f')]:_0x186b25[_0x1ab5('0x39')];if(_0x2b204d['query'][_0x1ab5('0x4b')]){_0x3ccbdd['include']=[{'all':!![]}];}_0x3ccbdd=_[_0x1ab5('0x48')]({},_0x3ccbdd,_0x2b204d['options']);return db['OpenchannelAccount']['find'](_0x3ccbdd)['then'](handleEntityNotFound(_0x23a1d5,null))[_0x1ab5('0x1d')](respondWithResult(_0x23a1d5,null))[_0x1ab5('0x25')](handleError(_0x23a1d5,null));};exports['create']=function(_0x41809d,_0x72c69d){return db[_0x1ab5('0x4a')][_0x1ab5('0x51')](_0x41809d[_0x1ab5('0x52')],{})['then'](function(_0x2c74e2){var _0x70f9a6=_0x41809d['user'][_0x1ab5('0x53')]({'plain':!![]});if(!_0x70f9a6)throw new Error(_0x1ab5('0x54'));if(_0x70f9a6[_0x1ab5('0x55')]===_0x1ab5('0x56')){var _0x55be5c=_0x2c74e2[_0x1ab5('0x53')]({'plain':!![]});var _0x3e3835=_0x1ab5('0x30');return db[_0x1ab5('0x57')][_0x1ab5('0x58')]({'where':{'name':_0x3e3835,'userProfileId':_0x70f9a6['userProfileId']},'raw':!![]})[_0x1ab5('0x1d')](function(_0x4694e3){if(_0x4694e3&&_0x4694e3[_0x1ab5('0x59')]===0x0){return db[_0x1ab5('0x5a')][_0x1ab5('0x51')]({'name':_0x55be5c[_0x1ab5('0x32')],'resourceId':_0x55be5c['id'],'type':_0x4694e3[_0x1ab5('0x32')],'sectionId':_0x4694e3['id']},{})[_0x1ab5('0x1d')](function(){return _0x2c74e2;});}else{return _0x2c74e2;}})[_0x1ab5('0x25')](function(_0x2a1e4c){logger['error'](_0x1ab5('0x5b'),_0x2a1e4c);throw _0x2a1e4c;});}return _0x2c74e2;})[_0x1ab5('0x1d')](respondWithResult(_0x72c69d,0xc9))['catch'](handleError(_0x72c69d,null));};exports[_0x1ab5('0x2f')]=function(_0x1e3237,_0x3318e4){if(_0x1e3237[_0x1ab5('0x52')]['id']){delete _0x1e3237[_0x1ab5('0x52')]['id'];}return db[_0x1ab5('0x4a')]['find']({'where':{'id':_0x1e3237[_0x1ab5('0x4f')]['id']},'include':[{'model':db[_0x1ab5('0x5c')],'as':_0x1ab5('0x50')}]})['then'](handleEntityNotFound(_0x3318e4,null))['then'](saveUpdates(_0x1e3237[_0x1ab5('0x52')],null))[_0x1ab5('0x1d')](respondWithResult(_0x3318e4,null))[_0x1ab5('0x25')](handleError(_0x3318e4,null));};exports[_0x1ab5('0x5d')]=function(_0x2149cf,_0x203c20){return db['OpenchannelAccount'][_0x1ab5('0x58')]({'where':{'id':_0x2149cf[_0x1ab5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x203c20,null))[_0x1ab5('0x1d')](removeEntity(_0x203c20,null))[_0x1ab5('0x25')](handleError(_0x203c20,null));};exports['describe']=function(_0x172803,_0x17e254){return db[_0x1ab5('0x4a')][_0x1ab5('0x5e')]()[_0x1ab5('0x1d')](respondWithResult(_0x17e254,null))[_0x1ab5('0x25')](handleError(_0x17e254,null));};exports[_0x1ab5('0x5f')]=function(_0x3b0ad2,_0x13617f,_0x3d2d18){if(_0x3b0ad2[_0x1ab5('0x52')]['id']){delete _0x3b0ad2[_0x1ab5('0x52')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3b0ad2[_0x1ab5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x13617f,null))[_0x1ab5('0x1d')](function(_0x1475d1){if(_0x1475d1){_0x3b0ad2[_0x1ab5('0x52')][_0x1ab5('0x60')]=_0x1475d1['id'];return db['Disposition']['create'](_0x3b0ad2['body']);}})[_0x1ab5('0x1d')](respondWithResult(_0x13617f,null))['catch'](handleError(_0x13617f,null));};exports[_0x1ab5('0x61')]=function(_0x477480,_0x4a2386,_0x26aaa6){var _0xfc04d1={'raw':![],'where':{}};var _0x3e4722={};var _0x4a95f9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1ab5('0x62')]({'where':{'id':_0x477480['params']['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x4a2386,null))[_0x1ab5('0x1d')](function(_0x7daf85){if(_0x7daf85){_0x3e4722[_0x1ab5('0x39')]=_[_0x1ab5('0x3b')](db[_0x1ab5('0x63')][_0x1ab5('0x36')]);_0x3e4722['query']=_[_0x1ab5('0x3b')](_0x477480[_0x1ab5('0x3a')]);_0x3e4722['filters']=_[_0x1ab5('0x3d')](_0x3e4722[_0x1ab5('0x39')],_0x3e4722[_0x1ab5('0x3a')]);_0xfc04d1[_0x1ab5('0x3f')]=_[_0x1ab5('0x3d')](_0x3e4722[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x477480[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0xfc04d1[_0x1ab5('0x3f')]=_0xfc04d1[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0xfc04d1['attributes']:_0x3e4722['model'];if(!_0x477480[_0x1ab5('0x3a')][_0x1ab5('0x41')](_0x1ab5('0x42'))){_0xfc04d1['limit']=qs[_0x1ab5('0x2a')](_0x477480[_0x1ab5('0x3a')]['limit']);_0xfc04d1[_0x1ab5('0x28')]=qs['offset'](_0x477480[_0x1ab5('0x3a')]['offset']);}_0xfc04d1[_0x1ab5('0x43')]=qs[_0x1ab5('0x44')](_0x477480[_0x1ab5('0x3a')][_0x1ab5('0x44')]);_0xfc04d1[_0x1ab5('0x45')]=qs['filters'](_[_0x1ab5('0x46')](_0x477480[_0x1ab5('0x3a')],_0x3e4722[_0x1ab5('0x3c')]));_0xfc04d1['where'][_0x1ab5('0x60')]=_0x7daf85['id'];if(_0x477480[_0x1ab5('0x3a')]['filter']){_0xfc04d1['where']=_[_0x1ab5('0x48')](_0xfc04d1[_0x1ab5('0x45')],{'$or':_[_0x1ab5('0x35')](_0xfc04d1[_0x1ab5('0x3f')],function(_0x4a7945){var _0x5b02a4={};_0x5b02a4[_0x4a7945]={'$like':'%'+_0x477480[_0x1ab5('0x3a')]['filter']+'%'};return _0x5b02a4;})});}_0xfc04d1=_[_0x1ab5('0x48')]({},_0xfc04d1,_0x477480['options']);return db[_0x1ab5('0x63')][_0x1ab5('0x2b')]({'where':_0xfc04d1[_0x1ab5('0x45')]})[_0x1ab5('0x1d')](function(_0x451fc8){_0x4a95f9[_0x1ab5('0x2b')]=_0x451fc8;if(_0x477480[_0x1ab5('0x3a')][_0x1ab5('0x4b')]){_0xfc04d1[_0x1ab5('0x4c')]=[{'all':!![]}];}return db[_0x1ab5('0x63')][_0x1ab5('0x64')](_0xfc04d1);})[_0x1ab5('0x1d')](function(_0x2ef5e1){_0x4a95f9[_0x1ab5('0x4d')]=_0x2ef5e1;return _0x4a95f9;});}})[_0x1ab5('0x1d')](respondWithFilteredResult(_0x4a2386,_0xfc04d1))[_0x1ab5('0x25')](handleError(_0x4a2386,null));};exports[_0x1ab5('0x65')]=function(_0x31b853,_0x5776ab,_0x284420){return db['OpenchannelAccount'][_0x1ab5('0x58')]({'where':{'id':_0x31b853[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x5776ab,null))[_0x1ab5('0x1d')](function(_0x2a413){if(_0x2a413){return _0x2a413[_0x1ab5('0x65')](_0x31b853[_0x1ab5('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x5776ab,null))[_0x1ab5('0x25')](handleError(_0x5776ab,null));};exports[_0x1ab5('0x66')]=function(_0x2a42ae,_0x432424,_0x2740f1){if(_0x2a42ae[_0x1ab5('0x52')]['id']){delete _0x2a42ae['body']['id'];}return db[_0x1ab5('0x4a')][_0x1ab5('0x58')]({'where':{'id':_0x2a42ae['params']['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x432424,null))[_0x1ab5('0x1d')](function(_0x3f78e3){if(_0x3f78e3){_0x2a42ae[_0x1ab5('0x52')]['OpenchannelAccountId']=_0x3f78e3['id'];return db[_0x1ab5('0x67')][_0x1ab5('0x51')](_0x2a42ae[_0x1ab5('0x52')]);}})[_0x1ab5('0x1d')](respondWithResult(_0x432424,null))[_0x1ab5('0x25')](handleError(_0x432424,null));};exports[_0x1ab5('0x68')]=function(_0x1aa708,_0x422dcf,_0x236698){var _0xf3f86b={'raw':![],'where':{}};var _0x18675c={};var _0xe56ed4={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1aa708[_0x1ab5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x422dcf,null))[_0x1ab5('0x1d')](function(_0x201952){if(_0x201952){_0x18675c[_0x1ab5('0x39')]=_[_0x1ab5('0x3b')](db['CannedAnswer'][_0x1ab5('0x36')]);_0x18675c[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x1aa708[_0x1ab5('0x3a')]);_0x18675c['filters']=_[_0x1ab5('0x3d')](_0x18675c[_0x1ab5('0x39')],_0x18675c['query']);_0xf3f86b['attributes']=_[_0x1ab5('0x3d')](_0x18675c[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x1aa708[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0xf3f86b[_0x1ab5('0x3f')]=_0xf3f86b[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0xf3f86b[_0x1ab5('0x3f')]:_0x18675c[_0x1ab5('0x39')];if(!_0x1aa708[_0x1ab5('0x3a')][_0x1ab5('0x41')]('nolimit')){_0xf3f86b['limit']=qs[_0x1ab5('0x2a')](_0x1aa708['query'][_0x1ab5('0x2a')]);_0xf3f86b[_0x1ab5('0x28')]=qs[_0x1ab5('0x28')](_0x1aa708[_0x1ab5('0x3a')][_0x1ab5('0x28')]);}_0xf3f86b[_0x1ab5('0x43')]=qs[_0x1ab5('0x44')](_0x1aa708['query'][_0x1ab5('0x44')]);_0xf3f86b[_0x1ab5('0x45')]=qs[_0x1ab5('0x3c')](_[_0x1ab5('0x46')](_0x1aa708[_0x1ab5('0x3a')],_0x18675c['filters']));_0xf3f86b['where'][_0x1ab5('0x60')]=_0x201952['id'];if(_0x1aa708[_0x1ab5('0x3a')]['filter']){_0xf3f86b[_0x1ab5('0x45')]=_[_0x1ab5('0x48')](_0xf3f86b['where'],{'$or':_['map'](_0xf3f86b['attributes'],function(_0x26452d){var _0x13961f={};_0x13961f[_0x26452d]={'$like':'%'+_0x1aa708['query'][_0x1ab5('0x47')]+'%'};return _0x13961f;})});}_0xf3f86b=_[_0x1ab5('0x48')]({},_0xf3f86b,_0x1aa708[_0x1ab5('0x49')]);return db['CannedAnswer'][_0x1ab5('0x2b')]({'where':_0xf3f86b['where']})['then'](function(_0x4d0047){_0xe56ed4[_0x1ab5('0x2b')]=_0x4d0047;if(_0x1aa708['query'][_0x1ab5('0x4b')]){_0xf3f86b['include']=[{'all':!![]}];}return db[_0x1ab5('0x67')]['findAll'](_0xf3f86b);})[_0x1ab5('0x1d')](function(_0x181d8b){_0xe56ed4[_0x1ab5('0x4d')]=_0x181d8b;return _0xe56ed4;});}})[_0x1ab5('0x1d')](respondWithFilteredResult(_0x422dcf,_0xf3f86b))[_0x1ab5('0x25')](handleError(_0x422dcf,null));};exports[_0x1ab5('0x69')]=function(_0x573a8a,_0x47ffc6,_0x168313){return db['OpenchannelAccount'][_0x1ab5('0x58')]({'where':{'id':_0x573a8a[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x47ffc6,null))[_0x1ab5('0x1d')](function(_0x3758dc){if(_0x3758dc){return _0x3758dc[_0x1ab5('0x69')](_0x573a8a[_0x1ab5('0x3a')][_0x1ab5('0x6a')]);}})['then'](respondWithStatusCode(_0x47ffc6,null))[_0x1ab5('0x25')](handleError(_0x47ffc6,null));};exports['notify']=function(_0x4496a5,_0x3c3153,_0x5e964b){var _0x4dca68={'body':_0x4496a5['body'],'channel':_0x1ab5('0x6b')};var _0x35054b=[];var _0x505178=[];var _0x2aa6ec={};var _0x3a17bf=![];return db[_0x1ab5('0x6c')][_0x1ab5('0x5e')]()[_0x1ab5('0x1d')](function(_0x208467){if(!_0x208467){throw new db[(_0x1ab5('0x6d'))]['ValidationError'](_0x1ab5('0x6e'));}_0x35054b=_[_0x1ab5('0x6f')](_[_0x1ab5('0x3b')](_0x208467),['createdAt',_0x1ab5('0x70')]);_0x505178=_['difference'](_[_0x1ab5('0x3b')](_0x208467),[_0x1ab5('0x71'),_0x1ab5('0x70'),_0x1ab5('0x72'),_0x1ab5('0x73')]);if(_0x4496a5[_0x1ab5('0x52')]['id']){delete _0x4496a5['body']['id'];}if(_['isNil'](_0x4496a5['body']['from'])){throw new db['Sequelize'][(_0x1ab5('0x74'))](_0x1ab5('0x75'));}if(_[_0x1ab5('0x76')](_0x4496a5[_0x1ab5('0x52')]['body'])||_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x52')]===''){throw new db[(_0x1ab5('0x6d'))][(_0x1ab5('0x74'))](_0x1ab5('0x77'));}if(_['isNil'](_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x78')])){throw new db['Sequelize']['ValidationError'](_0x1ab5('0x79')+_0x505178);}if(!_[_0x1ab5('0x7a')](_0x505178,_0x4496a5['body'][_0x1ab5('0x78')])){throw new db[(_0x1ab5('0x6d'))][(_0x1ab5('0x74'))](_0x1ab5('0x7b')+_0x505178);}_0x2aa6ec[_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x78')]]=_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x7c')];})[_0x1ab5('0x1d')](function(){return db[_0x1ab5('0x4a')][_0x1ab5('0x58')]({'where':{'id':_0x4496a5[_0x1ab5('0x4f')]['id']},'include':[{'model':db[_0x1ab5('0x7d')],'as':_0x1ab5('0x7e'),'include':[{'model':db[_0x1ab5('0x6c')],'as':_0x1ab5('0x7f'),'where':_0x2aa6ec,'limit':0x1,'order':[[_0x1ab5('0x70'),'DESC']]}]},{'model':db[_0x1ab5('0x80')],'as':_0x1ab5('0x81')}]});})['then'](handleEntityNotFound(_0x3c3153,null))[_0x1ab5('0x1d')](function(_0x2c6dd9){if(_0x2c6dd9&&_0x2c6dd9[_0x1ab5('0x7e')]){_0x4dca68[_0x1ab5('0x82')]=_0x2c6dd9;_0x4dca68[_0x1ab5('0x83')]=_0x2c6dd9[_0x1ab5('0x81')];_0x4dca68[_0x1ab5('0x84')]=_0x2c6dd9[_0x1ab5('0x7e')];_0x4dca68[_0x1ab5('0x83')]=_[_0x1ab5('0x85')](_0x4dca68[_0x1ab5('0x83')],[_0x1ab5('0x86')],[_0x1ab5('0x87')]);if(_0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x81')]){delete _0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x81')];}if(_0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x7e')]&&_0x4dca68['account'][_0x1ab5('0x7e')][_0x1ab5('0x7f')][_0x1ab5('0x40')]){return _0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x7e')][_0x1ab5('0x7f')][0x0];}var _0x4bb340=_['defaults'](_0x4496a5[_0x1ab5('0x52')],{'firstName':_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x7c')],'ListId':_0x2c6dd9[_0x1ab5('0x73')]});_0x4bb340[_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x78')]]=_0x4496a5['body'][_0x1ab5('0x7c')];return db[_0x1ab5('0x6c')][_0x1ab5('0x51')](_0x4bb340,{'fields':_0x35054b,'raw':!![]});}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x3c3153,null))[_0x1ab5('0x1d')](function(_0x893c37){_0x4dca68['contact']=_0x893c37;if(_0x893c37){var _0x44bf59={'ContactId':_0x893c37['id'],'OpenchannelAccountId':_0x4496a5[_0x1ab5('0x4f')]['id'],'from':(_0x893c37[_0x1ab5('0x88')]||'')+'\x20'+(_0x893c37[_0x1ab5('0x89')]||'')};var _0x137843={'OpenchannelAccountId':_0x4496a5[_0x1ab5('0x4f')]['id'],'closed':![]};if(_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8a')]){_0x137843['threadId']=_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8a')];return db[_0x1ab5('0x8b')][_0x1ab5('0x58')]({'where':_0x137843})[_0x1ab5('0x1d')](function(_0x33ec53){if(_0x33ec53){return[_0x33ec53,![]];}_0x44bf59[_0x1ab5('0x8a')]=_0x4496a5[_0x1ab5('0x52')]['threadId'];_0x44bf59[_0x1ab5('0x8c')]=_0x4496a5['body']['externalUrl'];return db['OpenchannelInteraction'][_0x1ab5('0x51')](_0x44bf59)[_0x1ab5('0x1d')](function(_0x156b8d){return[_0x156b8d,!![]];});});}else{_0x137843[_0x1ab5('0x8a')]=null;}_0x137843['ContactId']=_0x893c37['id'];return db[_0x1ab5('0x8b')]['find']({'where':_0x137843})[_0x1ab5('0x1d')](function(_0x1bd5e3){if(_0x1bd5e3){return[_0x1bd5e3,![]];}return db[_0x1ab5('0x8b')][_0x1ab5('0x51')](_0x44bf59)[_0x1ab5('0x1d')](function(_0x175c54){return[_0x175c54,!![]];});});}})['spread'](function(_0x2da07e,_0x5e0db0){if(_0x2da07e){_0x3a17bf=_0x5e0db0;if(!_0x5e0db0){var _0x191a57={'from':(_0x4dca68[_0x1ab5('0x8d')][_0x1ab5('0x88')]||'')+'\x20'+(_0x4dca68[_0x1ab5('0x8d')][_0x1ab5('0x89')]||'')};if(_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8a')]&&_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8e')]&&_0x4496a5['body'][_0x1ab5('0x8a')]!=_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8e')]){_0x191a57[_0x1ab5('0x8a')]=_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x8e')];}return _0x2da07e[_0x1ab5('0x2f')](_0x191a57);}else{return _0x2da07e;}}})['then'](function(_0x54e813){_0x4dca68[_0x1ab5('0x8f')]=_0x54e813[_0x1ab5('0x53')]({'plain':!![]});_0x4dca68['interaction']['created']=_0x3a17bf;if(_0x4dca68[_0x1ab5('0x8f')][_0x1ab5('0x90')]){if(_0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x91')]){_0x4dca68[_0x1ab5('0x83')][_0x1ab5('0x92')]({'id':0x0,'priority':_0x4dca68[_0x1ab5('0x83')]['length']+0x1,'app':'close','appdata':_0x1ab5('0x93'),'interval':_0x1ab5('0x94')});}}return db[_0x1ab5('0x95')][_0x1ab5('0x51')]({'body':_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x52')],'OpenchannelAccountId':_0x4496a5[_0x1ab5('0x4f')]['id'],'OpenchannelInteractionId':_0x54e813['id'],'direction':'in','ContactId':_0x4dca68['contact']['id'],'AttachmentId':_0x4496a5[_0x1ab5('0x52')][_0x1ab5('0x96')]});})['then'](function(_0x2ddd32){_0x4dca68[_0x1ab5('0x23')]=_0x2ddd32;if(_0x4dca68[_0x1ab5('0x8f')][_0x1ab5('0x97')]){return db[_0x1ab5('0x98')][_0x1ab5('0x58')]({'attributes':['id',_0x1ab5('0x32')],'where':{'id':_0x4dca68['interaction'][_0x1ab5('0x97')]}})['then'](function(_0x22c410){if(_0x22c410){_0x4dca68['applications'][_0x1ab5('0x99')]({'id':0x0,'priority':0x0,'app':_0x1ab5('0x9a'),'appdata':_0x22c410[_0x1ab5('0x32')]+','+(_0x4dca68[_0x1ab5('0x82')][_0x1ab5('0x9b')]||0xa),'interval':_0x1ab5('0x94')});_0x4dca68[_0x1ab5('0x9c')]=![];}return respondWithRpcPromise(_0x1ab5('0x9d'),_0x1ab5('0x9e'),_0x4dca68);});}return respondWithRpcPromise(_0x1ab5('0x9d'),_0x1ab5('0x9e'),_0x4dca68);})['then'](function(_0x3b559d){respondWithRpcPromise('EventManager',_0x1ab5('0x9f'),{'event':_0x1ab5('0xa0'),'message':_0x3b559d},client9002);return _0x3b559d;})[_0x1ab5('0x1d')](respondWithResult(_0x3c3153,null))[_0x1ab5('0x25')](handleError(_0x3c3153,null));};exports[_0x1ab5('0xa1')]=function(_0xb28de4,_0xb6b168,_0x1b3b16){return db[_0x1ab5('0x4a')][_0x1ab5('0x62')]({'where':{'id':_0xb28de4[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0xb6b168,null))['then'](function(_0x5e9fa9){if(_0x5e9fa9){return db[_0x1ab5('0xa2')][_0x1ab5('0xa3')](function(_0x4d2e9c){return db[_0x1ab5('0x80')][_0x1ab5('0x5d')]({'where':{'OpenchannelAccountId':_0xb28de4[_0x1ab5('0x4f')]['id']},'transaction':_0x4d2e9c})[_0x1ab5('0x1d')](function(_0xf6138b){var _0x263463=_[_0x1ab5('0x35')](_0xb28de4[_0x1ab5('0x52')],function(_0x465790){_0x465790[_0x1ab5('0x60')]=_0xb28de4['params']['id'];return _0x465790;});return db['OpenchannelApplication'][_0x1ab5('0xa4')](_0x263463,{'transaction':_0x4d2e9c});});})[_0x1ab5('0x1d')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0xb28de4['params']['id']},'order':'priority'});});}})[_0x1ab5('0x1d')](respondWithResult(_0xb6b168,null))['catch'](handleError(_0xb6b168,null));};exports[_0x1ab5('0xa5')]=function(_0x1e4225,_0x3d10ce,_0x51f16e){var _0x4b5f33={};var _0x1fcbd4={};var _0x52acfb;var _0x365a56;return db[_0x1ab5('0x4a')][_0x1ab5('0x62')]({'where':{'id':_0x1e4225[_0x1ab5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d10ce,null))[_0x1ab5('0x1d')](function(_0x146018){if(_0x146018){_0x52acfb=_0x146018;_0x1fcbd4[_0x1ab5('0x39')]=_['keys'](db['OpenchannelApplication'][_0x1ab5('0x36')]);_0x1fcbd4[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x1e4225['query']);_0x1fcbd4['filters']=_['intersection'](_0x1fcbd4[_0x1ab5('0x39')],_0x1fcbd4[_0x1ab5('0x3a')]);_0x4b5f33[_0x1ab5('0x3f')]=_[_0x1ab5('0x3d')](_0x1fcbd4[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x1e4225[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0x4b5f33[_0x1ab5('0x3f')]=_0x4b5f33[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0x4b5f33[_0x1ab5('0x3f')]:_0x1fcbd4[_0x1ab5('0x39')];_0x4b5f33[_0x1ab5('0x43')]=qs['sort'](_0x1e4225[_0x1ab5('0x3a')][_0x1ab5('0x44')]);_0x4b5f33[_0x1ab5('0x45')]=qs[_0x1ab5('0x3c')](_[_0x1ab5('0x46')](_0x1e4225['query'],_0x1fcbd4[_0x1ab5('0x3c')]));if(_0x1e4225['query']['filter']){_0x4b5f33[_0x1ab5('0x45')]=_[_0x1ab5('0x48')](_0x4b5f33['where'],{'$or':_[_0x1ab5('0x35')](_0x4b5f33[_0x1ab5('0x3f')],function(_0x50f877){var _0x1241c5={};_0x1241c5[_0x50f877]={'$like':'%'+_0x1e4225[_0x1ab5('0x3a')][_0x1ab5('0x47')]+'%'};return _0x1241c5;})});}_0x4b5f33=_['merge']({},_0x4b5f33,_0x1e4225[_0x1ab5('0x49')]);return _0x52acfb['getApplications'](_0x4b5f33);}})[_0x1ab5('0x1d')](function(_0x5b8fbc){if(_0x5b8fbc){_0x365a56=_0x5b8fbc[_0x1ab5('0x40')];if(!_0x1e4225['query'][_0x1ab5('0x41')](_0x1ab5('0x42'))){_0x4b5f33[_0x1ab5('0x2a')]=qs['limit'](_0x1e4225['query'][_0x1ab5('0x2a')]);_0x4b5f33['offset']=qs[_0x1ab5('0x28')](_0x1e4225[_0x1ab5('0x3a')][_0x1ab5('0x28')]);}return _0x52acfb[_0x1ab5('0xa5')](_0x4b5f33);}})[_0x1ab5('0x1d')](function(_0x2afd59){if(_0x2afd59){return _0x2afd59?{'count':_0x365a56,'rows':_0x2afd59}:null;}})[_0x1ab5('0x1d')](respondWithResult(_0x3d10ce,null))[_0x1ab5('0x25')](handleError(_0x3d10ce,null));};exports['getInteractions']=function(_0x1c9f61,_0x2bf604,_0x204e8e){var _0x318163={'raw':![],'where':{}};var _0x20cecc={};var _0x2b6019={'count':0x0,'rows':[]};return db[_0x1ab5('0x4a')]['findOne']({'where':{'id':_0x1c9f61[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x2bf604,null))[_0x1ab5('0x1d')](function(_0x2c7054){if(_0x2c7054){_0x20cecc[_0x1ab5('0x39')]=_[_0x1ab5('0x3b')](db[_0x1ab5('0x8b')][_0x1ab5('0x36')]);_0x20cecc[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x1c9f61[_0x1ab5('0x3a')]);_0x20cecc[_0x1ab5('0x3c')]=_[_0x1ab5('0x3d')](_0x20cecc[_0x1ab5('0x39')],_0x20cecc[_0x1ab5('0x3a')]);_0x318163[_0x1ab5('0x3f')]=_[_0x1ab5('0x3d')](_0x20cecc[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0x318163[_0x1ab5('0x3f')]=_0x318163[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0x318163[_0x1ab5('0x3f')]:_0x20cecc['model'];if(!_0x1c9f61['query'][_0x1ab5('0x41')](_0x1ab5('0x42'))){_0x318163[_0x1ab5('0x2a')]=qs['limit'](_0x1c9f61['query'][_0x1ab5('0x2a')]);_0x318163['offset']=qs['offset'](_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0x28')]);}_0x318163[_0x1ab5('0x43')]=qs['sort'](_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0x44')]);_0x318163['where']=qs[_0x1ab5('0x3c')](_[_0x1ab5('0x46')](_0x1c9f61['query'],_0x20cecc[_0x1ab5('0x3c')]));_0x318163[_0x1ab5('0x45')][_0x1ab5('0x60')]=_0x2c7054['id'];if(_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0x47')]){_0x318163['where']=_[_0x1ab5('0x48')](_0x318163[_0x1ab5('0x45')],{'$or':_[_0x1ab5('0x35')](_0x318163[_0x1ab5('0x3f')],function(_0x54f750){var _0x1f1bb3={};_0x1f1bb3[_0x54f750]={'$like':'%'+_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0x47')]+'%'};return _0x1f1bb3;})});}_0x318163=_[_0x1ab5('0x48')]({},_0x318163,_0x1c9f61[_0x1ab5('0x49')]);return db[_0x1ab5('0x8b')][_0x1ab5('0x2b')]({'where':_0x318163[_0x1ab5('0x45')]})[_0x1ab5('0x1d')](function(_0x5c2414){_0x2b6019['count']=_0x5c2414;if(_0x1c9f61['query'][_0x1ab5('0x4b')]){_0x318163[_0x1ab5('0x4c')]=[{'model':db[_0x1ab5('0x6c')],'as':'Contact','required':![]},{'model':db[_0x1ab5('0x98')],'as':'Owner','attributes':[_0x1ab5('0x32'),_0x1ab5('0xa6'),_0x1ab5('0xa7')],'required':![]},{'model':db[_0x1ab5('0xa8')],'as':_0x1ab5('0xa9'),'attributes':['id',_0x1ab5('0x32'),'color'],'where':_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0xaa')]?{'id':_0x1c9f61[_0x1ab5('0x3a')][_0x1ab5('0xaa')]}:undefined,'required':_0x1c9f61[_0x1ab5('0x3a')]['tag']?!![]:![]}];}return db[_0x1ab5('0x8b')][_0x1ab5('0x64')](_0x318163);})['then'](function(_0x3fd5d8){_0x2b6019['rows']=_0x3fd5d8;return _0x2b6019;});}})['then'](respondWithFilteredResult(_0x2bf604,_0x318163))['catch'](handleError(_0x2bf604,null));};exports['addAgents']=function(_0xbf437c,_0x5c9dc8,_0xcc75bb){return db[_0x1ab5('0x4a')][_0x1ab5('0x58')]({'where':{'id':_0xbf437c[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x5c9dc8,null))[_0x1ab5('0x1d')](function(_0x294692){if(_0x294692){return _0x294692[_0x1ab5('0xab')](_0xbf437c[_0x1ab5('0x52')][_0x1ab5('0x6a')],_[_0x1ab5('0xac')](_0xbf437c[_0x1ab5('0x52')],[_0x1ab5('0x6a'),'id'])||{})[_0x1ab5('0xad')](function(_0x2bd456){for(var _0x1893ed=0x0;_0x1893ed<_0xbf437c[_0x1ab5('0x52')]['ids'][_0x1ab5('0x40')];_0x1893ed+=0x1){socket[_0x1ab5('0xae')](_0x1ab5('0xaf'),{'UserId':Number(_0xbf437c[_0x1ab5('0x52')][_0x1ab5('0x6a')][_0x1893ed]),'OpenchannelAccountId':Number(_0xbf437c[_0x1ab5('0x4f')]['id'])});}return _0x2bd456;});}})[_0x1ab5('0x1d')](respondWithResult(_0x5c9dc8,null))[_0x1ab5('0x25')](handleError(_0x5c9dc8,null));};exports[_0x1ab5('0xb0')]=function(_0x39f2b3,_0x6e9f0c,_0xe519c7){return db[_0x1ab5('0x4a')][_0x1ab5('0x58')]({'where':{'id':_0x39f2b3['params']['id']}})['then'](handleEntityNotFound(_0x6e9f0c,null))[_0x1ab5('0x1d')](function(_0x281a82){if(_0x281a82){return _0x281a82[_0x1ab5('0xb0')](_0x39f2b3[_0x1ab5('0x3a')][_0x1ab5('0x6a')])['then'](function(){if(_[_0x1ab5('0xb1')](_0x39f2b3[_0x1ab5('0x3a')][_0x1ab5('0x6a')])){for(var _0x4ebd50=0x0;_0x4ebd50<_0x39f2b3[_0x1ab5('0x3a')]['ids'][_0x1ab5('0x40')];_0x4ebd50+=0x1){socket[_0x1ab5('0xae')](_0x1ab5('0xb2'),{'UserId':Number(_0x39f2b3['query']['ids'][_0x4ebd50]),'OpenchannelAccountId':Number(_0x39f2b3['params']['id'])});}}else{socket[_0x1ab5('0xae')](_0x1ab5('0xb2'),{'UserId':Number(_0x39f2b3[_0x1ab5('0x3a')][_0x1ab5('0x6a')]),'OpenchannelAccountId':Number(_0x39f2b3['params']['id'])});}});}})[_0x1ab5('0x1d')](respondWithStatusCode(_0x6e9f0c,null))[_0x1ab5('0x25')](handleError(_0x6e9f0c,null));};exports['getAgents']=function(_0x13da6b,_0xc0ec2a,_0x306509){var _0x705133={};var _0x49dc06={};var _0x432cb1;var _0x2d4d8d;return db[_0x1ab5('0x4a')]['findOne']({'where':{'id':_0x13da6b[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0xc0ec2a,null))['then'](function(_0x58292c){if(_0x58292c){_0x432cb1=_0x58292c;_0x49dc06['model']=_[_0x1ab5('0x3b')](db['User']['rawAttributes']);_0x49dc06[_0x1ab5('0x3a')]=_[_0x1ab5('0x3b')](_0x13da6b[_0x1ab5('0x3a')]);_0x49dc06[_0x1ab5('0x3c')]=_['intersection'](_0x49dc06[_0x1ab5('0x39')],_0x49dc06['query']);_0x705133[_0x1ab5('0x3f')]=_['intersection'](_0x49dc06[_0x1ab5('0x39')],qs[_0x1ab5('0x3e')](_0x13da6b[_0x1ab5('0x3a')][_0x1ab5('0x3e')]));_0x705133[_0x1ab5('0x3f')]=_0x705133[_0x1ab5('0x3f')][_0x1ab5('0x40')]?_0x705133[_0x1ab5('0x3f')]:_0x49dc06[_0x1ab5('0x39')];_0x705133[_0x1ab5('0x43')]=qs['sort'](_0x13da6b[_0x1ab5('0x3a')]['sort']);_0x705133[_0x1ab5('0x45')]=qs[_0x1ab5('0x3c')](_[_0x1ab5('0x46')](_0x13da6b[_0x1ab5('0x3a')],_0x49dc06[_0x1ab5('0x3c')]));if(_0x13da6b['query'][_0x1ab5('0x47')]){_0x705133['where']=_[_0x1ab5('0x48')](_0x705133[_0x1ab5('0x45')],{'$or':_[_0x1ab5('0x35')](_0x705133[_0x1ab5('0x3f')],function(_0x3c864e){var _0x706a14={};_0x706a14[_0x3c864e]={'$like':'%'+_0x13da6b[_0x1ab5('0x3a')][_0x1ab5('0x47')]+'%'};return _0x706a14;})});}_0x705133=_[_0x1ab5('0x48')]({},_0x705133,_0x13da6b[_0x1ab5('0x49')]);return _0x432cb1[_0x1ab5('0xb3')](_0x705133);}})[_0x1ab5('0x1d')](function(_0x31cc57){if(_0x31cc57){_0x2d4d8d=_0x31cc57['length'];if(!_0x13da6b[_0x1ab5('0x3a')][_0x1ab5('0x41')](_0x1ab5('0x42'))){_0x705133[_0x1ab5('0x2a')]=qs[_0x1ab5('0x2a')](_0x13da6b[_0x1ab5('0x3a')][_0x1ab5('0x2a')]);_0x705133[_0x1ab5('0x28')]=qs[_0x1ab5('0x28')](_0x13da6b['query'][_0x1ab5('0x28')]);}return _0x432cb1[_0x1ab5('0xb3')](_0x705133);}})[_0x1ab5('0x1d')](function(_0x420981){if(_0x420981){return _0x420981?{'count':_0x2d4d8d,'rows':_0x420981}:null;}})[_0x1ab5('0x1d')](respondWithResult(_0xc0ec2a,null))[_0x1ab5('0x25')](handleError(_0xc0ec2a,null));};exports[_0x1ab5('0x33')]=function(_0x119400,_0x1b3322,_0x9ee834){var _0x5ea713,_0x3f4265,_0x299bcf;if(_[_0x1ab5('0x76')](_0x119400[_0x1ab5('0x52')][_0x1ab5('0x52')])||_0x119400[_0x1ab5('0x52')][_0x1ab5('0x52')]===''){throw new db[(_0x1ab5('0x6d'))][(_0x1ab5('0x74'))](_0x1ab5('0x77'));}if(_[_0x1ab5('0x76')](_0x119400[_0x1ab5('0x52')]['to'])){}_0x5ea713=_0x119400[_0x1ab5('0x52')]['to'];return db[_0x1ab5('0x4a')][_0x1ab5('0x62')]({'where':{'id':_0x119400[_0x1ab5('0x4f')]['id']}})[_0x1ab5('0x1d')](handleEntityNotFound(_0x1b3322,null))[_0x1ab5('0x1d')](function(_0x1093a1){if(_0x1093a1){return db['OpenchannelAccount']['find']({'where':{'id':_0x1093a1['id']},'include':[{'model':db[_0x1ab5('0x7d')],'as':_0x1ab5('0x7e'),'include':[{'model':db[_0x1ab5('0x6c')],'as':_0x1ab5('0x7f'),'where':{[_0x1093a1[_0x1ab5('0x78')]]:_0x5ea713},'limit':0x1,'order':[[_0x1ab5('0x70'),_0x1ab5('0xb4')]]}]}]})[_0x1ab5('0x1d')](handleEntityNotFound(_0x1b3322,null))[_0x1ab5('0x1d')](function(_0x142b8a){if(_0x142b8a&&_0x142b8a['List']){_0x3f4265=_0x142b8a[_0x1ab5('0x53')]({'plain':!![]});if(_0x3f4265[_0x1ab5('0x7e')]&&_0x3f4265[_0x1ab5('0x7e')][_0x1ab5('0x7f')][_0x1ab5('0x40')]){return _0x3f4265[_0x1ab5('0x7e')]['Contacts'][0x0];}return db['CmContact'][_0x1ab5('0x51')](_[_0x1ab5('0x15')](_0x119400[_0x1ab5('0x52')],{'firstName':_0x5ea713,[_0x142b8a[_0x1ab5('0x78')]]:_0x5ea713,'phone':_0x5ea713,'ListId':_0x3f4265[_0x1ab5('0x73')]}));}})['then'](handleEntityNotFound(_0x1b3322,null))[_0x1ab5('0x1d')](function(_0x596731){if(_0x596731){_0x299bcf=_0x596731;return db[_0x1ab5('0x8b')][_0x1ab5('0x58')]({'where':{'ContactId':_0x299bcf['id'],'closed':![],'OpenchannelAccountId':_0x3f4265['id']}})['then'](function(_0x45fa83){if(_0x45fa83){return[_0x45fa83,![]];}return db[_0x1ab5('0x8b')]['create']({'UserId':_0x119400[_0x1ab5('0x56')]['id'],'ContactId':_0x299bcf['id'],'OpenchannelAccountId':_0x3f4265['id'],'lastMsgDirection':_0x1ab5('0xb5'),'Messages':[_[_0x1ab5('0x48')](_0x119400[_0x1ab5('0x52')],{'read':![],'body':_0x119400[_0x1ab5('0x52')]['body'],'OpenchannelAccountId':_0x3f4265['id'],'UserId':_0x119400['user']['id'],'ContactId':_0x299bcf['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x1ab5('0xb6')}]})[_0x1ab5('0x1d')](function(_0x21f860){return[_0x21f860,!![]];});});}})[_0x1ab5('0xad')](function(_0x2e34da,_0x262203){if(_0x262203){return _0x2e34da;}return db[_0x1ab5('0x95')][_0x1ab5('0x51')](_[_0x1ab5('0x48')](_0x119400[_0x1ab5('0x52')],{'read':![],'body':_0x119400[_0x1ab5('0x52')][_0x1ab5('0x52')],'OpenchannelAccountId':_0x3f4265['id'],'OpenchannelInteractionId':_0x2e34da['id'],'UserId':_0x119400[_0x1ab5('0x56')]['id'],'ContactId':_0x299bcf['id']}))[_0x1ab5('0x1d')](function(_0xe5f103){_0x2e34da['dataValues'][_0x1ab5('0xb6')]=[];_0x2e34da[_0x1ab5('0xb7')][_0x1ab5('0xb6')][_0x1ab5('0x92')](_0xe5f103['dataValues']);return _0x2e34da;});});}})[_0x1ab5('0x1d')](respondWithResult(_0x1b3322,null))[_0x1ab5('0x25')](handleError(_0x1b3322,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e46e6fc..ce2f8dc 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 _0xb4e6=['update','remove','emit','hook','events','OpenchannelAccount','setMaxListeners','save'];(function(_0x5c758d,_0x3bbadb){var _0x516580=function(_0x114392){while(--_0x114392){_0x5c758d['push'](_0x5c758d['shift']());}};_0x516580(++_0x3bbadb);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xb4e6[_0x382c73];return _0x1dd0bf;};'use strict';var EventEmitter=require(_0x6b4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x6b4e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6b4e('0x2')](0x0);var events={'afterCreate':_0x6b4e('0x3'),'afterUpdate':_0x6b4e('0x4'),'afterDestroy':_0x6b4e('0x5')};function emitEvent(_0x31e8ad){return function(_0x1929b8,_0x52313b,_0x40da90){OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad+':'+_0x1929b8['id'],_0x1929b8);OpenchannelAccountEvents[_0x6b4e('0x6')](_0x31e8ad,_0x1929b8);_0x40da90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x6b4e('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 03a891f..704bac3 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(_0x2dbdcd,_0x2289d4){var _0xfb4915=function(_0x289c29){while(--_0x289c29){_0x2dbdcd['push'](_0x2dbdcd['shift']());}};_0xfb4915(++_0x2289d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x162ab6,_0x163dcb){var _0x14c8b3=function(_0x26668c){while(--_0x26668c){_0x162ab6['push'](_0x162ab6['shift']());}};_0x14c8b3(++_0x163dcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 698446b..1374214 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 _0x7be1=['../../config/logger','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x7be1,0x165));var _0x17be=function(_0x57bfad,_0x5126cc){_0x57bfad=_0x57bfad-0x0;var _0x5d8e2f=_0x7be1[_0x57bfad];return _0x5d8e2f;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});config['redis']=_[_0x17be('0xa')](config[_0x17be('0xb')],{'host':_0x17be('0xc'),'port':0x18eb});var socket=require(_0x17be('0xd'))(new Redis(config[_0x17be('0xb')]));require(_0x17be('0xe'))['register'](socket);function respondWithRpcPromise(_0x41e383,_0x589cdb,_0x3d23c3){return new BPromise(function(_0x2c276e,_0x520a49){return client[_0x17be('0xf')](_0x41e383,_0x3d23c3)[_0x17be('0x10')](function(_0x1ee322){logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));logger['debug'](_0x17be('0x13'),_0x589cdb,'request\x20sent',JSON[_0x17be('0x14')](_0x1ee322));if(_0x1ee322[_0x17be('0x15')]){if(_0x1ee322[_0x17be('0x15')][_0x17be('0x16')]===0x1f4){logger[_0x17be('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x1ee322[_0x17be('0x15')]['message']);return _0x520a49(_0x1ee322['error'][_0x17be('0x17')]);}logger['error'](_0x17be('0x18'),_0x589cdb,_0x1ee322['error'][_0x17be('0x17')]);return _0x2c276e(_0x1ee322[_0x17be('0x15')]['message']);}else{logger[_0x17be('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x589cdb,_0x17be('0x12'));_0x2c276e(_0x1ee322['result'][_0x17be('0x17')]);}})[_0x17be('0x19')](function(_0x416f81){logger[_0x17be('0x15')](_0x17be('0x18'),_0x589cdb,_0x416f81);_0x520a49(_0x416f81);});});} \ No newline at end of file +var _0x8b29=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0xf01a76,_0x2e242e){var _0x3ecc8c=function(_0x3d56c0){while(--_0x3d56c0){_0xf01a76['push'](_0xf01a76['shift']());}};_0x3ecc8c(++_0x2e242e);}(_0x8b29,0xbe));var _0x98b2=function(_0x22737a,_0x18a457){_0x22737a=_0x22737a-0x0;var _0x4ef51e=_0x8b29[_0x22737a];return _0x4ef51e;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});config[_0x98b2('0x9')]=_[_0x98b2('0xa')](config[_0x98b2('0x9')],{'host':_0x98b2('0xb'),'port':0x18eb});var socket=require(_0x98b2('0xc'))(new Redis(config[_0x98b2('0x9')]));require(_0x98b2('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a17e,_0x599bf5,_0x14e049){return new BPromise(function(_0x39617c,_0x22c6c4){return client[_0x98b2('0xe')](_0x48a17e,_0x14e049)[_0x98b2('0xf')](function(_0x54b03c){logger[_0x98b2('0x10')](_0x98b2('0x11'),_0x599bf5,'request\x20sent');logger[_0x98b2('0x12')](_0x98b2('0x13'),_0x599bf5,_0x98b2('0x14'),JSON['stringify'](_0x54b03c));if(_0x54b03c['error']){if(_0x54b03c[_0x98b2('0x15')]['code']===0x1f4){logger[_0x98b2('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x599bf5,_0x54b03c['error']['message']);return _0x22c6c4(_0x54b03c[_0x98b2('0x15')][_0x98b2('0x16')]);}logger[_0x98b2('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x599bf5,_0x54b03c['error']['message']);return _0x39617c(_0x54b03c[_0x98b2('0x15')][_0x98b2('0x16')]);}else{logger[_0x98b2('0x10')](_0x98b2('0x11'),_0x599bf5,'request\x20sent');_0x39617c(_0x54b03c[_0x98b2('0x17')]['message']);}})[_0x98b2('0x18')](function(_0x4931f4){logger[_0x98b2('0x15')](_0x98b2('0x11'),_0x599bf5,_0x4931f4);_0x22c6c4(_0x4931f4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 90a66b8..d4e745a 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 _0x65f4=['length','openchannelAccount:','remove','update','emit','register'];(function(_0x2ed4d8,_0x5a79bd){var _0x5306a3=function(_0x1d998a){while(--_0x1d998a){_0x2ed4d8['push'](_0x2ed4d8['shift']());}};_0x5306a3(++_0x5a79bd);}(_0x65f4,0x19a));var _0x465f=function(_0xcdfbbb,_0x26e0b9){_0xcdfbbb=_0xcdfbbb-0x0;var _0x267924=_0x65f4[_0xcdfbbb];return _0x267924;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x465f('0x0'),_0x465f('0x1')];function createListener(_0x34f1ce,_0x59c7cb){return function(_0x584451){_0x59c7cb[_0x465f('0x2')](_0x34f1ce,_0x584451);};}function removeListener(_0x3bf967,_0x307a2b){return function(){OpenchannelAccountEvents['removeListener'](_0x3bf967,_0x307a2b);};}exports[_0x465f('0x3')]=function(_0xe5a9bd){for(var _0x44d697=0x0,_0x553ce9=events[_0x465f('0x4')];_0x44d697<_0x553ce9;_0x44d697++){var _0x5e26ea=events[_0x44d697];var _0x523ca1=createListener(_0x465f('0x5')+_0x5e26ea,_0xe5a9bd);OpenchannelAccountEvents['on'](_0x5e26ea,_0x523ca1);}}; \ No newline at end of file +var _0x22fb=['remove','emit','removeListener','register','length','openchannelAccount:'];(function(_0x211437,_0x51e225){var _0x560ecc=function(_0x5827a7){while(--_0x5827a7){_0x211437['push'](_0x211437['shift']());}};_0x560ecc(++_0x51e225);}(_0x22fb,0x192));var _0xb22f=function(_0x18ca22,_0x58f758){_0x18ca22=_0x18ca22-0x0;var _0x1ff4fe=_0x22fb[_0x18ca22];return _0x1ff4fe;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){OpenchannelAccountEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);OpenchannelAccountEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 109d7f1..e03d072 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 _0x01f4=['delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x58ef39,_0x4d0505){var _0x2b4b1a=function(_0xeadce5){while(--_0xeadce5){_0x58ef39['push'](_0x58ef39['shift']());}};_0x2b4b1a(++_0x4d0505);}(_0x01f4,0x73));var _0x401f=function(_0x5f4d2b,_0xd32256){_0x5f4d2b=_0x5f4d2b-0x0;var _0x297978=_0x01f4[_0x5f4d2b];return _0x297978;};'use strict';var multer=require(_0x401f('0x0'));var util=require('util');var path=require(_0x401f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x401f('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x401f('0x3'));var controller=require(_0x401f('0x4'));router[_0x401f('0x5')]('/',auth[_0x401f('0x6')](),controller['index']);router[_0x401f('0x5')](_0x401f('0x7'),auth[_0x401f('0x6')](),controller[_0x401f('0x8')]);router[_0x401f('0x9')]('/',auth[_0x401f('0x6')](),controller[_0x401f('0xa')]);router[_0x401f('0xb')](_0x401f('0x7'),auth[_0x401f('0x6')](),controller[_0x401f('0xc')]);router[_0x401f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x401f('0xe')]);module[_0x401f('0xf')]=router; \ No newline at end of file +var _0x25b8=['show','post','create','put','/:id','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x4b136a,_0xa8310c){var _0x51a36b=function(_0x35970e){while(--_0x35970e){_0x4b136a['push'](_0x4b136a['shift']());}};_0x51a36b(++_0xa8310c);}(_0x25b8,0xc9));var _0x825b=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x25b8[_0x4eec9b];return _0x2e3849;};'use strict';var multer=require('multer');var util=require(_0x825b('0x0'));var path=require(_0x825b('0x1'));var timeout=require('connect-timeout');var express=require(_0x825b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x825b('0x3'));var interaction=require(_0x825b('0x4'));var config=require('../../config/environment');var controller=require(_0x825b('0x5'));router[_0x825b('0x6')]('/',auth[_0x825b('0x7')](),controller[_0x825b('0x8')]);router[_0x825b('0x6')]('/:id',auth[_0x825b('0x7')](),controller[_0x825b('0x9')]);router[_0x825b('0xa')]('/',auth[_0x825b('0x7')](),controller[_0x825b('0xb')]);router[_0x825b('0xc')](_0x825b('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x825b('0x7')](),controller[_0x825b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4c205e6..00cb7b0 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 _0xb579=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xc963f2,_0x3de322){var _0x352905=function(_0x14b6c3){while(--_0x14b6c3){_0xc963f2['push'](_0xc963f2['shift']());}};_0x352905(++_0x3de322);}(_0xb579,0x169));var _0x9b57=function(_0x1f347e,_0xb506e5){_0x1f347e=_0x1f347e-0x0;var _0x437a3a=_0xb579[_0x1f347e];return _0x437a3a;};'use strict';var Sequelize=require(_0x9b57('0x0'));module[_0x9b57('0x1')]={'priority':{'type':Sequelize[_0x9b57('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9b57('0x3')],'allowNull':![],'defaultValue':_0x9b57('0x4')},'appdata':{'type':Sequelize[_0x9b57('0x5')]()},'description':{'type':Sequelize[_0x9b57('0x3')]},'interval':{'type':Sequelize[_0x9b57('0x3')],'defaultValue':_0x9b57('0x6')}}; \ No newline at end of file +var _0xddf9=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0xddf9,0x1b9));var _0x9ddf=function(_0x3a60bc,_0x4dcfb8){_0x3a60bc=_0x3a60bc-0x0;var _0x2064ff=_0xddf9[_0x3a60bc];return _0x2064ff;};'use strict';var Sequelize=require(_0x9ddf('0x0'));module[_0x9ddf('0x1')]={'priority':{'type':Sequelize[_0x9ddf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9ddf('0x3')],'allowNull':![],'defaultValue':_0x9ddf('0x4')},'appdata':{'type':Sequelize[_0x9ddf('0x5')]()},'description':{'type':Sequelize[_0x9ddf('0x3')]},'interval':{'type':Sequelize[_0x9ddf('0x3')],'defaultValue':_0x9ddf('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index c561866..24d91dd 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 _0xe444=['../../config/environment','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','OpenchannelApplication','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4c4ed5,_0x34c268){var _0x5118e6=function(_0x1ee1fe){while(--_0x1ee1fe){_0x4c4ed5['push'](_0x4c4ed5['shift']());}};_0x5118e6(++_0x34c268);}(_0xe444,0x1af));var _0x4e44=function(_0x5d0339,_0x43b4b6){_0x5d0339=_0x5d0339-0x0;var _0x4f0272=_0xe444[_0x5d0339];return _0x4f0272;};'use strict';var emlformat=require(_0x4e44('0x0'));var rimraf=require(_0x4e44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4e44('0x2'));var moment=require(_0x4e44('0x3'));var BPromise=require(_0x4e44('0x4'));var Mustache=require(_0x4e44('0x5'));var util=require(_0x4e44('0x6'));var path=require(_0x4e44('0x7'));var sox=require(_0x4e44('0x8'));var csv=require(_0x4e44('0x9'));var ejs=require(_0x4e44('0xa'));var fs=require('fs');var fs_extra=require(_0x4e44('0xb'));var _=require(_0x4e44('0xc'));var squel=require(_0x4e44('0xd'));var crypto=require(_0x4e44('0xe'));var jsforce=require(_0x4e44('0xf'));var deskjs=require(_0x4e44('0x10'));var toCsv=require(_0x4e44('0x9'));var querystring=require(_0x4e44('0x11'));var Papa=require(_0x4e44('0x12'));var Redis=require(_0x4e44('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4e44('0x14'));var as=require(_0x4e44('0x15'));var hardwareService=require(_0x4e44('0x16'));var logger=require(_0x4e44('0x17'))(_0x4e44('0x18'));var utils=require('../../config/utils');var config=require(_0x4e44('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363944,_0x1b1dbf){_0x1b1dbf=_0x1b1dbf||0xcc;return function(_0x4d739e){if(_0x4d739e){return _0x363944[_0x4e44('0x1a')](_0x1b1dbf);}return _0x363944['status'](_0x1b1dbf)[_0x4e44('0x1b')]();};}function respondWithResult(_0x2fe12f,_0x94da25){_0x94da25=_0x94da25||0xc8;return function(_0xfc3387){if(_0xfc3387){return _0x2fe12f[_0x4e44('0x1c')](_0x94da25)[_0x4e44('0x1d')](_0xfc3387);}};}function respondWithFilteredResult(_0x2f3697,_0x76c318){return function(_0x32d2d8){if(_0x32d2d8){var _0x16dcc3=typeof _0x76c318[_0x4e44('0x1e')]===_0x4e44('0x1f')&&typeof _0x76c318['limit']===_0x4e44('0x1f');var _0x184a9c=_0x32d2d8[_0x4e44('0x20')];var _0x30d060=_0x16dcc3?0x0:_0x76c318[_0x4e44('0x1e')];var _0x25d9f5=_0x16dcc3?_0x32d2d8[_0x4e44('0x20')]:_0x76c318[_0x4e44('0x1e')]+_0x76c318['limit'];var _0x1e8cc3;if(_0x25d9f5>=_0x184a9c){_0x25d9f5=_0x184a9c;_0x1e8cc3=0xc8;}else{_0x1e8cc3=0xce;}_0x2f3697[_0x4e44('0x1c')](_0x1e8cc3);return _0x2f3697[_0x4e44('0x21')](_0x4e44('0x22'),_0x30d060+'-'+_0x25d9f5+'/'+_0x184a9c)[_0x4e44('0x1d')](_0x32d2d8);}return null;};}function patchUpdates(_0x36b040){return function(_0x1d6ee4){try{jsonpatch[_0x4e44('0x23')](_0x1d6ee4,_0x36b040,!![]);}catch(_0x4d9f9d){return BPromise[_0x4e44('0x24')](_0x4d9f9d);}return _0x1d6ee4[_0x4e44('0x25')]();};}function saveUpdates(_0x527246,_0x51ccc3){return function(_0x517027){if(_0x517027){return _0x517027[_0x4e44('0x26')](_0x527246)['then'](function(_0x251b9d){return _0x251b9d;});}return null;};}function removeEntity(_0xdd7bda,_0x1bd4f0){return function(_0x1dcb35){if(_0x1dcb35){return _0x1dcb35[_0x4e44('0x27')]()[_0x4e44('0x28')](function(){_0xdd7bda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ab0a8,_0x2913c7){return function(_0x57addd){if(!_0x57addd){_0x2ab0a8[_0x4e44('0x1a')](0x194);}return _0x57addd;};}function handleError(_0x1db9be,_0x37e858){_0x37e858=_0x37e858||0x1f4;return function(_0x28f03e){logger[_0x4e44('0x29')](_0x28f03e[_0x4e44('0x2a')]);if(_0x28f03e[_0x4e44('0x2b')]){delete _0x28f03e['name'];}_0x1db9be[_0x4e44('0x1c')](_0x37e858)[_0x4e44('0x2c')](_0x28f03e);};}exports[_0x4e44('0x2d')]=function(_0x18935f,_0x26a639){var _0x40c2ff={},_0x403117={},_0x3baa68={'count':0x0,'rows':[]};var _0x37b665=_[_0x4e44('0x2e')](db[_0x4e44('0x2f')]['rawAttributes'],function(_0x124226){return{'name':_0x124226['fieldName'],'type':_0x124226[_0x4e44('0x30')][_0x4e44('0x31')]};});_0x403117['model']=_['map'](_0x37b665,_0x4e44('0x2b'));_0x403117['query']=_[_0x4e44('0x32')](_0x18935f[_0x4e44('0x33')]);_0x403117[_0x4e44('0x34')]=_[_0x4e44('0x35')](_0x403117[_0x4e44('0x36')],_0x403117[_0x4e44('0x33')]);_0x40c2ff['attributes']=_['intersection'](_0x403117['model'],qs['fields'](_0x18935f['query'][_0x4e44('0x37')]));_0x40c2ff[_0x4e44('0x38')]=_0x40c2ff['attributes'][_0x4e44('0x39')]?_0x40c2ff['attributes']:_0x403117['model'];if(!_0x18935f[_0x4e44('0x33')][_0x4e44('0x3a')]('nolimit')){_0x40c2ff[_0x4e44('0x3b')]=qs[_0x4e44('0x3b')](_0x18935f[_0x4e44('0x33')][_0x4e44('0x3b')]);_0x40c2ff[_0x4e44('0x1e')]=qs['offset'](_0x18935f['query']['offset']);}_0x40c2ff['order']=qs['sort'](_0x18935f[_0x4e44('0x33')][_0x4e44('0x3c')]);_0x40c2ff[_0x4e44('0x3d')]=qs[_0x4e44('0x34')](_['pick'](_0x18935f[_0x4e44('0x33')],_0x403117[_0x4e44('0x34')]),_0x37b665);if(_0x18935f[_0x4e44('0x33')]['filter']){_0x40c2ff[_0x4e44('0x3d')]=_[_0x4e44('0x3e')](_0x40c2ff[_0x4e44('0x3d')],{'$or':_[_0x4e44('0x2e')](_0x37b665,function(_0x5a0b2a){if(_0x5a0b2a[_0x4e44('0x30')]!==_0x4e44('0x3f')){var _0x3436da={};_0x3436da[_0x5a0b2a[_0x4e44('0x2b')]]={'$like':'%'+_0x18935f['query'][_0x4e44('0x40')]+'%'};return _0x3436da;}})});}_0x40c2ff=_[_0x4e44('0x3e')]({},_0x40c2ff,_0x18935f['options']);var _0x4578f6={'where':_0x40c2ff[_0x4e44('0x3d')]};return db[_0x4e44('0x2f')][_0x4e44('0x20')](_0x4578f6)[_0x4e44('0x28')](function(_0x5f3b7a){_0x3baa68[_0x4e44('0x20')]=_0x5f3b7a;if(_0x18935f[_0x4e44('0x33')]['includeAll']){_0x40c2ff[_0x4e44('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x4e44('0x42')](_0x40c2ff);})['then'](function(_0xb6efdc){_0x3baa68[_0x4e44('0x43')]=_0xb6efdc;return _0x3baa68;})['then'](respondWithFilteredResult(_0x26a639,_0x40c2ff))[_0x4e44('0x44')](handleError(_0x26a639,null));};exports[_0x4e44('0x45')]=function(_0x5ebfb3,_0x4dd38c){var _0x26e294={'raw':!![],'where':{'id':_0x5ebfb3['params']['id']}},_0x2c3dc5={};_0x2c3dc5[_0x4e44('0x36')]=_[_0x4e44('0x32')](db['OpenchannelApplication']['rawAttributes']);_0x2c3dc5['query']=_['keys'](_0x5ebfb3[_0x4e44('0x33')]);_0x2c3dc5[_0x4e44('0x34')]=_[_0x4e44('0x35')](_0x2c3dc5[_0x4e44('0x36')],_0x2c3dc5[_0x4e44('0x33')]);_0x26e294[_0x4e44('0x38')]=_[_0x4e44('0x35')](_0x2c3dc5['model'],qs[_0x4e44('0x37')](_0x5ebfb3[_0x4e44('0x33')][_0x4e44('0x37')]));_0x26e294[_0x4e44('0x38')]=_0x26e294[_0x4e44('0x38')][_0x4e44('0x39')]?_0x26e294[_0x4e44('0x38')]:_0x2c3dc5[_0x4e44('0x36')];if(_0x5ebfb3[_0x4e44('0x33')][_0x4e44('0x46')]){_0x26e294[_0x4e44('0x41')]=[{'all':!![]}];}_0x26e294=_[_0x4e44('0x3e')]({},_0x26e294,_0x5ebfb3[_0x4e44('0x47')]);return db[_0x4e44('0x2f')][_0x4e44('0x48')](_0x26e294)[_0x4e44('0x28')](handleEntityNotFound(_0x4dd38c,null))['then'](respondWithResult(_0x4dd38c,null))[_0x4e44('0x44')](handleError(_0x4dd38c,null));};exports['create']=function(_0x438b9f,_0x36b5a1){return db[_0x4e44('0x2f')][_0x4e44('0x49')](_0x438b9f[_0x4e44('0x4a')],{})[_0x4e44('0x28')](respondWithResult(_0x36b5a1,0xc9))['catch'](handleError(_0x36b5a1,null));};exports['update']=function(_0x3e5703,_0x5e979a){if(_0x3e5703[_0x4e44('0x4a')]['id']){delete _0x3e5703[_0x4e44('0x4a')]['id'];}return db[_0x4e44('0x2f')]['find']({'where':{'id':_0x3e5703[_0x4e44('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e979a,null))[_0x4e44('0x28')](saveUpdates(_0x3e5703[_0x4e44('0x4a')],null))[_0x4e44('0x28')](respondWithResult(_0x5e979a,null))[_0x4e44('0x44')](handleError(_0x5e979a,null));};exports[_0x4e44('0x27')]=function(_0x54d87a,_0x4d814f){return db[_0x4e44('0x2f')]['find']({'where':{'id':_0x54d87a[_0x4e44('0x4b')]['id']}})[_0x4e44('0x28')](handleEntityNotFound(_0x4d814f,null))[_0x4e44('0x28')](removeEntity(_0x4d814f,null))[_0x4e44('0x44')](handleError(_0x4d814f,null));}; \ No newline at end of file +var _0x3ef9=['key','model','keys','query','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','fields','include','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3ef9,0x191));var _0x93ef=function(_0xc7ed1e,_0x36f998){_0xc7ed1e=_0xc7ed1e-0x0;var _0x9c31cc=_0x3ef9[_0xc7ed1e];return _0x9c31cc;};'use strict';var emlformat=require(_0x93ef('0x0'));var rimraf=require(_0x93ef('0x1'));var zipdir=require(_0x93ef('0x2'));var jsonpatch=require(_0x93ef('0x3'));var rp=require(_0x93ef('0x4'));var moment=require(_0x93ef('0x5'));var BPromise=require(_0x93ef('0x6'));var Mustache=require('mustache');var util=require(_0x93ef('0x7'));var path=require(_0x93ef('0x8'));var sox=require(_0x93ef('0x9'));var csv=require('to-csv');var ejs=require(_0x93ef('0xa'));var fs=require('fs');var fs_extra=require(_0x93ef('0xb'));var _=require(_0x93ef('0xc'));var squel=require(_0x93ef('0xd'));var crypto=require(_0x93ef('0xe'));var jsforce=require(_0x93ef('0xf'));var deskjs=require(_0x93ef('0x10'));var toCsv=require(_0x93ef('0x11'));var querystring=require(_0x93ef('0x12'));var Papa=require(_0x93ef('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ef('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93ef('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x93ef('0x16'));var licenseUtil=require(_0x93ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5635ef,_0x3353df){_0x3353df=_0x3353df||0xcc;return function(_0x4be616){if(_0x4be616){return _0x5635ef[_0x93ef('0x18')](_0x3353df);}return _0x5635ef[_0x93ef('0x19')](_0x3353df)[_0x93ef('0x1a')]();};}function respondWithResult(_0x50f883,_0x5e14d1){_0x5e14d1=_0x5e14d1||0xc8;return function(_0x4fd466){if(_0x4fd466){return _0x50f883[_0x93ef('0x19')](_0x5e14d1)[_0x93ef('0x1b')](_0x4fd466);}};}function respondWithFilteredResult(_0x3d999c,_0x29b401){return function(_0xbe2378){if(_0xbe2378){var _0x1a2fe1=typeof _0x29b401[_0x93ef('0x1c')]===_0x93ef('0x1d')&&typeof _0x29b401['limit']==='undefined';var _0x52d8f2=_0xbe2378[_0x93ef('0x1e')];var _0x13d84a=_0x1a2fe1?0x0:_0x29b401[_0x93ef('0x1c')];var _0x5042ed=_0x1a2fe1?_0xbe2378[_0x93ef('0x1e')]:_0x29b401[_0x93ef('0x1c')]+_0x29b401[_0x93ef('0x1f')];var _0x161fe0;if(_0x5042ed>=_0x52d8f2){_0x5042ed=_0x52d8f2;_0x161fe0=0xc8;}else{_0x161fe0=0xce;}_0x3d999c[_0x93ef('0x19')](_0x161fe0);return _0x3d999c[_0x93ef('0x20')](_0x93ef('0x21'),_0x13d84a+'-'+_0x5042ed+'/'+_0x52d8f2)[_0x93ef('0x1b')](_0xbe2378);}return null;};}function patchUpdates(_0x2eff67){return function(_0x46ced9){try{jsonpatch[_0x93ef('0x22')](_0x46ced9,_0x2eff67,!![]);}catch(_0x3a544a){return BPromise[_0x93ef('0x23')](_0x3a544a);}return _0x46ced9[_0x93ef('0x24')]();};}function saveUpdates(_0x5de385,_0x59ac3d){return function(_0x475508){if(_0x475508){return _0x475508[_0x93ef('0x25')](_0x5de385)[_0x93ef('0x26')](function(_0xc1544b){return _0xc1544b;});}return null;};}function removeEntity(_0x491d9e,_0x906679){return function(_0x33ed26){if(_0x33ed26){return _0x33ed26[_0x93ef('0x27')]()[_0x93ef('0x26')](function(){_0x491d9e[_0x93ef('0x19')](0xcc)[_0x93ef('0x1a')]();});}};}function handleEntityNotFound(_0x5eeeb9,_0x3c0698){return function(_0x3ed04b){if(!_0x3ed04b){_0x5eeeb9[_0x93ef('0x18')](0x194);}return _0x3ed04b;};}function handleError(_0x35158a,_0x57b898){_0x57b898=_0x57b898||0x1f4;return function(_0x8a72b0){logger[_0x93ef('0x28')](_0x8a72b0[_0x93ef('0x29')]);if(_0x8a72b0[_0x93ef('0x2a')]){delete _0x8a72b0[_0x93ef('0x2a')];}_0x35158a[_0x93ef('0x19')](_0x57b898)[_0x93ef('0x2b')](_0x8a72b0);};}exports[_0x93ef('0x2c')]=function(_0x58bed6,_0x4f9057){var _0x29c0ce={},_0xb3bb24={},_0x5a3c8c={'count':0x0,'rows':[]};var _0x5899fd=_[_0x93ef('0x2d')](db[_0x93ef('0x2e')][_0x93ef('0x2f')],function(_0x71d3f){return{'name':_0x71d3f['fieldName'],'type':_0x71d3f[_0x93ef('0x30')][_0x93ef('0x31')]};});_0xb3bb24[_0x93ef('0x32')]=_[_0x93ef('0x2d')](_0x5899fd,_0x93ef('0x2a'));_0xb3bb24['query']=_[_0x93ef('0x33')](_0x58bed6[_0x93ef('0x34')]);_0xb3bb24[_0x93ef('0x35')]=_[_0x93ef('0x36')](_0xb3bb24[_0x93ef('0x32')],_0xb3bb24['query']);_0x29c0ce[_0x93ef('0x37')]=_['intersection'](_0xb3bb24[_0x93ef('0x32')],qs['fields'](_0x58bed6[_0x93ef('0x34')]['fields']));_0x29c0ce[_0x93ef('0x37')]=_0x29c0ce[_0x93ef('0x37')]['length']?_0x29c0ce[_0x93ef('0x37')]:_0xb3bb24[_0x93ef('0x32')];if(!_0x58bed6[_0x93ef('0x34')]['hasOwnProperty'](_0x93ef('0x38'))){_0x29c0ce['limit']=qs['limit'](_0x58bed6['query'][_0x93ef('0x1f')]);_0x29c0ce[_0x93ef('0x1c')]=qs[_0x93ef('0x1c')](_0x58bed6[_0x93ef('0x34')][_0x93ef('0x1c')]);}_0x29c0ce['order']=qs[_0x93ef('0x39')](_0x58bed6[_0x93ef('0x34')][_0x93ef('0x39')]);_0x29c0ce[_0x93ef('0x3a')]=qs['filters'](_[_0x93ef('0x3b')](_0x58bed6[_0x93ef('0x34')],_0xb3bb24[_0x93ef('0x35')]),_0x5899fd);if(_0x58bed6[_0x93ef('0x34')][_0x93ef('0x3c')]){_0x29c0ce[_0x93ef('0x3a')]=_[_0x93ef('0x3d')](_0x29c0ce[_0x93ef('0x3a')],{'$or':_[_0x93ef('0x2d')](_0x5899fd,function(_0x10151c){if(_0x10151c[_0x93ef('0x30')]!==_0x93ef('0x3e')){var _0xe1013b={};_0xe1013b[_0x10151c[_0x93ef('0x2a')]]={'$like':'%'+_0x58bed6[_0x93ef('0x34')][_0x93ef('0x3c')]+'%'};return _0xe1013b;}})});}_0x29c0ce=_[_0x93ef('0x3d')]({},_0x29c0ce,_0x58bed6['options']);var _0x4bd83a={'where':_0x29c0ce[_0x93ef('0x3a')]};return db['OpenchannelApplication'][_0x93ef('0x1e')](_0x4bd83a)[_0x93ef('0x26')](function(_0x29fdd1){_0x5a3c8c[_0x93ef('0x1e')]=_0x29fdd1;if(_0x58bed6['query'][_0x93ef('0x3f')]){_0x29c0ce['include']=[{'all':!![]}];}return db[_0x93ef('0x2e')][_0x93ef('0x40')](_0x29c0ce);})[_0x93ef('0x26')](function(_0x5db77f){_0x5a3c8c[_0x93ef('0x41')]=_0x5db77f;return _0x5a3c8c;})[_0x93ef('0x26')](respondWithFilteredResult(_0x4f9057,_0x29c0ce))['catch'](handleError(_0x4f9057,null));};exports[_0x93ef('0x42')]=function(_0x5ce065,_0x31eb6e){var _0x19ea71={'raw':!![],'where':{'id':_0x5ce065['params']['id']}},_0x4ca485={};_0x4ca485['model']=_[_0x93ef('0x33')](db[_0x93ef('0x2e')][_0x93ef('0x2f')]);_0x4ca485['query']=_[_0x93ef('0x33')](_0x5ce065[_0x93ef('0x34')]);_0x4ca485['filters']=_[_0x93ef('0x36')](_0x4ca485[_0x93ef('0x32')],_0x4ca485['query']);_0x19ea71[_0x93ef('0x37')]=_[_0x93ef('0x36')](_0x4ca485['model'],qs[_0x93ef('0x43')](_0x5ce065[_0x93ef('0x34')][_0x93ef('0x43')]));_0x19ea71[_0x93ef('0x37')]=_0x19ea71[_0x93ef('0x37')]['length']?_0x19ea71[_0x93ef('0x37')]:_0x4ca485['model'];if(_0x5ce065['query']['includeAll']){_0x19ea71[_0x93ef('0x44')]=[{'all':!![]}];}_0x19ea71=_[_0x93ef('0x3d')]({},_0x19ea71,_0x5ce065[_0x93ef('0x45')]);return db[_0x93ef('0x2e')][_0x93ef('0x46')](_0x19ea71)['then'](handleEntityNotFound(_0x31eb6e,null))[_0x93ef('0x26')](respondWithResult(_0x31eb6e,null))[_0x93ef('0x47')](handleError(_0x31eb6e,null));};exports['create']=function(_0x3eb953,_0x2bc9ad){return db[_0x93ef('0x2e')][_0x93ef('0x48')](_0x3eb953[_0x93ef('0x49')],{})[_0x93ef('0x26')](respondWithResult(_0x2bc9ad,0xc9))[_0x93ef('0x47')](handleError(_0x2bc9ad,null));};exports[_0x93ef('0x25')]=function(_0x22e535,_0x5ed0e2){if(_0x22e535[_0x93ef('0x49')]['id']){delete _0x22e535['body']['id'];}return db[_0x93ef('0x2e')][_0x93ef('0x46')]({'where':{'id':_0x22e535[_0x93ef('0x4a')]['id']}})[_0x93ef('0x26')](handleEntityNotFound(_0x5ed0e2,null))[_0x93ef('0x26')](saveUpdates(_0x22e535[_0x93ef('0x49')],null))[_0x93ef('0x26')](respondWithResult(_0x5ed0e2,null))[_0x93ef('0x47')](handleError(_0x5ed0e2,null));};exports[_0x93ef('0x27')]=function(_0x561b96,_0x37da85){return db[_0x93ef('0x2e')][_0x93ef('0x46')]({'where':{'id':_0x561b96[_0x93ef('0x4a')]['id']}})[_0x93ef('0x26')](handleEntityNotFound(_0x37da85,null))['then'](removeEntity(_0x37da85,null))[_0x93ef('0x47')](handleError(_0x37da85,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 67c0379..fd8172e 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 _0x9db9=['bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x56a7cf,_0x57011f){var _0xfc19e3=function(_0x2cfb3e){while(--_0x2cfb3e){_0x56a7cf['push'](_0x56a7cf['shift']());}};_0xfc19e3(++_0x57011f);}(_0x9db9,0x140));var _0x99db=function(_0x1568b8,_0x543f3f){_0x1568b8=_0x1568b8-0x0;var _0x1182bd=_0x9db9[_0x1568b8];return _0x1182bd;};'use strict';var _=require(_0x99db('0x0'));var util=require(_0x99db('0x1'));var logger=require(_0x99db('0x2'))(_0x99db('0x3'));var moment=require(_0x99db('0x4'));var BPromise=require(_0x99db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99db('0x6'));var rimraf=require(_0x99db('0x7'));var config=require(_0x99db('0x8'));var attributes=require(_0x99db('0x9'));module[_0x99db('0xa')]=function(_0xc8a127,_0x3605a3){return _0xc8a127[_0x99db('0xb')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99db('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x21c2=['../../config/environment','exports','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x515099,_0x46bdbd){var _0x26e0a7=function(_0x47df3b){while(--_0x47df3b){_0x515099['push'](_0x515099['shift']());}};_0x26e0a7(++_0x46bdbd);}(_0x21c2,0xb9));var _0x221c=function(_0x37c32c,_0x1d1c35){_0x37c32c=_0x37c32c-0x0;var _0x20c37d=_0x21c2[_0x37c32c];return _0x20c37d;};'use strict';var _=require(_0x221c('0x0'));var util=require(_0x221c('0x1'));var logger=require(_0x221c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x221c('0x3'));var rp=require(_0x221c('0x4'));var fs=require('fs');var path=require(_0x221c('0x5'));var rimraf=require(_0x221c('0x6'));var config=require(_0x221c('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x221c('0x8')]=function(_0x4a5695,_0x52e6af){return _0x4a5695['define']('OpenchannelApplication',attributes,{'tableName':_0x221c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x221c('0xa'),'collate':_0x221c('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b9dbcf1..23c50b9 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 _0xd913=['info','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit'];(function(_0x41099e,_0xc94991){var _0x5a6c5d=function(_0x1f6ace){while(--_0x1f6ace){_0x41099e['push'](_0x41099e['shift']());}};_0x5a6c5d(++_0xc94991);}(_0xd913,0x107));var _0x3d91=function(_0x37b83f,_0x29a8f7){_0x37b83f=_0x37b83f-0x0;var _0x1fbac1=_0xd913[_0x37b83f];return _0x1fbac1;};'use strict';var _=require(_0x3d91('0x0'));var util=require(_0x3d91('0x1'));var moment=require(_0x3d91('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d91('0x4'))['db'];var utils=require(_0x3d91('0x5'));var logger=require('../../config/logger')(_0x3d91('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d91('0x7'));var client=jayson[_0x3d91('0x8')][_0x3d91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x106f8d,_0x43b6d2,_0xd151d4){return new BPromise(function(_0x3225ed,_0x5de3a2){return client[_0x3d91('0xa')](_0x106f8d,_0xd151d4)[_0x3d91('0xb')](function(_0x16634a){logger['info'](_0x3d91('0xc'),_0x43b6d2,_0x3d91('0xd'));logger[_0x3d91('0xe')](_0x3d91('0xf'),_0x43b6d2,'request\x20sent',JSON['stringify'](_0x16634a));if(_0x16634a[_0x3d91('0x10')]){if(_0x16634a[_0x3d91('0x10')]['code']===0x1f4){logger[_0x3d91('0x10')](_0x3d91('0xc'),_0x43b6d2,_0x16634a[_0x3d91('0x10')][_0x3d91('0x11')]);return _0x5de3a2(_0x16634a[_0x3d91('0x10')][_0x3d91('0x11')]);}logger['error'](_0x3d91('0xc'),_0x43b6d2,_0x16634a[_0x3d91('0x10')][_0x3d91('0x11')]);return _0x3225ed(_0x16634a[_0x3d91('0x10')][_0x3d91('0x11')]);}else{logger['info'](_0x3d91('0xc'),_0x43b6d2,_0x3d91('0xd'));_0x3225ed(_0x16634a['result']['message']);}})[_0x3d91('0x12')](function(_0x2b6fe1){logger[_0x3d91('0x10')](_0x3d91('0xc'),_0x43b6d2,_0x2b6fe1);_0x5de3a2(_0x2b6fe1);});});}exports[_0x3d91('0x13')]=function(_0x5791ca){var _0x48905c=this;return new Promise(function(_0x13b9f8,_0x2a07b1){return db[_0x3d91('0x14')][_0x3d91('0x15')](_0x5791ca[_0x3d91('0x16')],{'raw':_0x5791ca[_0x3d91('0x17')]?_0x5791ca['options'][_0x3d91('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5791ca[_0x3d91('0x17')]?_0x5791ca[_0x3d91('0x17')][_0x3d91('0x19')]||null:null,'attributes':_0x5791ca[_0x3d91('0x17')]?_0x5791ca['options']['attributes']||null:null,'limit':_0x5791ca[_0x3d91('0x17')]?_0x5791ca['options'][_0x3d91('0x1a')]||null:null})['then'](function(_0xcad7be){logger[_0x3d91('0x1b')](_0x3d91('0x13'),_0x5791ca);logger[_0x3d91('0xe')](_0x3d91('0x13'),_0x5791ca,JSON[_0x3d91('0x1c')](_0xcad7be));_0x13b9f8(_0xcad7be);})[_0x3d91('0x12')](function(_0x161570){logger[_0x3d91('0x10')](_0x3d91('0x13'),_0x161570[_0x3d91('0x11')],_0x5791ca);_0x2a07b1(_0x48905c[_0x3d91('0x10')](0x1f4,_0x161570[_0x3d91('0x11')]));});});}; \ No newline at end of file +var _0x0d0a=['UpdateOpenchannelApplication','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','update','options','raw','where','limit','then','debug'];(function(_0x4eda73,_0x58be8a){var _0x3c8c69=function(_0x567dee){while(--_0x567dee){_0x4eda73['push'](_0x4eda73['shift']());}};_0x3c8c69(++_0x58be8a);}(_0x0d0a,0x146));var _0xa0d0=function(_0xffb2f4,_0x28b1dd){_0xffb2f4=_0xffb2f4-0x0;var _0x1e57ef=_0x0d0a[_0xffb2f4];return _0x1e57ef;};'use strict';var _=require('lodash');var util=require(_0xa0d0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0d0('0x1'));var fs=require('fs');var Redis=require(_0xa0d0('0x2'));var db=require(_0xa0d0('0x3'))['db'];var utils=require(_0xa0d0('0x4'));var logger=require('../../config/logger')(_0xa0d0('0x5'));var config=require(_0xa0d0('0x6'));var jayson=require(_0xa0d0('0x7'));var client=jayson[_0xa0d0('0x8')][_0xa0d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1418f0,_0x393128,_0x29907c){return new BPromise(function(_0x4e77a2,_0xf21360){return client[_0xa0d0('0xa')](_0x1418f0,_0x29907c)['then'](function(_0x4c846a){logger[_0xa0d0('0xb')](_0xa0d0('0xc'),_0x393128,_0xa0d0('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x393128,_0xa0d0('0xd'),JSON[_0xa0d0('0xe')](_0x4c846a));if(_0x4c846a[_0xa0d0('0xf')]){if(_0x4c846a['error'][_0xa0d0('0x10')]===0x1f4){logger[_0xa0d0('0xf')](_0xa0d0('0xc'),_0x393128,_0x4c846a['error'][_0xa0d0('0x11')]);return _0xf21360(_0x4c846a[_0xa0d0('0xf')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x393128,_0x4c846a['error']['message']);return _0x4e77a2(_0x4c846a[_0xa0d0('0xf')][_0xa0d0('0x11')]);}else{logger[_0xa0d0('0xb')](_0xa0d0('0xc'),_0x393128,_0xa0d0('0xd'));_0x4e77a2(_0x4c846a['result']['message']);}})['catch'](function(_0xf79916){logger[_0xa0d0('0xf')](_0xa0d0('0xc'),_0x393128,_0xf79916);_0xf21360(_0xf79916);});});}exports['UpdateOpenchannelApplication']=function(_0x267dab){var _0x928c4b=this;return new Promise(function(_0x2e883b,_0x2d35ab){return db['OpenchannelApplication'][_0xa0d0('0x12')](_0x267dab['body'],{'raw':_0x267dab[_0xa0d0('0x13')]?_0x267dab['options'][_0xa0d0('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267dab['options']?_0x267dab[_0xa0d0('0x13')][_0xa0d0('0x15')]||null:null,'attributes':_0x267dab['options']?_0x267dab['options']['attributes']||null:null,'limit':_0x267dab[_0xa0d0('0x13')]?_0x267dab[_0xa0d0('0x13')][_0xa0d0('0x16')]||null:null})[_0xa0d0('0x17')](function(_0x1b9f22){logger[_0xa0d0('0xb')]('UpdateOpenchannelApplication',_0x267dab);logger[_0xa0d0('0x18')](_0xa0d0('0x19'),_0x267dab,JSON[_0xa0d0('0xe')](_0x1b9f22));_0x2e883b(_0x1b9f22);})[_0xa0d0('0x1a')](function(_0x104d3f){logger['error'](_0xa0d0('0x19'),_0x104d3f[_0xa0d0('0x11')],_0x267dab);_0x2d35ab(_0x928c4b[_0xa0d0('0xf')](0x1f4,_0x104d3f[_0xa0d0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c066fa5..adb91a7 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 _0x36b7=['getMessages','/:id/download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages'];(function(_0x1f0043,_0x110542){var _0x190f46=function(_0x4648b6){while(--_0x4648b6){_0x1f0043['push'](_0x1f0043['shift']());}};_0x190f46(++_0x110542);}(_0x36b7,0x99));var _0x736b=function(_0x141104,_0x27051a){_0x141104=_0x141104-0x0;var _0x5a084a=_0x36b7[_0x141104];return _0x5a084a;};'use strict';var multer=require('multer');var util=require(_0x736b('0x0'));var path=require('path');var timeout=require(_0x736b('0x1'));var express=require(_0x736b('0x2'));var router=express[_0x736b('0x3')]();var fs_extra=require(_0x736b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x736b('0x5'));var controller=require(_0x736b('0x6'));router[_0x736b('0x7')]('/',auth['isAuthenticated'](),controller[_0x736b('0x8')]);router[_0x736b('0x7')](_0x736b('0x9'),auth[_0x736b('0xa')](),controller[_0x736b('0xb')]);router[_0x736b('0x7')](_0x736b('0xc'),auth[_0x736b('0xa')](),controller[_0x736b('0xd')]);router[_0x736b('0x7')](_0x736b('0xe'),auth[_0x736b('0xa')](),controller[_0x736b('0xf')]);router[_0x736b('0x7')](_0x736b('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x736b('0x11')]('/',auth[_0x736b('0xa')](),controller['create']);router[_0x736b('0x11')]('/:id/messages',auth[_0x736b('0xa')](),controller['addMessage']);router[_0x736b('0x11')](_0x736b('0x12'),auth[_0x736b('0xa')](),interaction[_0x736b('0x13')](_0x736b('0x14'),_0x736b('0x15')),controller['addTags']);router[_0x736b('0x16')](_0x736b('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x736b('0x17')),controller[_0x736b('0x18')]);router['delete']('/:id',auth[_0x736b('0xa')](),interaction[_0x736b('0x13')](_0x736b('0x14'),_0x736b('0x19')),controller['destroy']);router[_0x736b('0x1a')]('/:id/tags',auth[_0x736b('0xa')](),controller['removeTags']);module[_0x736b('0x1b')]=router; \ No newline at end of file +var _0x539e=['../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','getMessages','download','post','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x539e,0xad));var _0xe539=function(_0x2b59b1,_0x46c17c){_0x2b59b1=_0x2b59b1-0x0;var _0x4a44bb=_0x539e[_0x2b59b1];return _0x4a44bb;};'use strict';var multer=require(_0xe539('0x0'));var util=require(_0xe539('0x1'));var path=require(_0xe539('0x2'));var timeout=require(_0xe539('0x3'));var express=require(_0xe539('0x4'));var router=express['Router']();var fs_extra=require(_0xe539('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe539('0x6'));var config=require(_0xe539('0x7'));var controller=require(_0xe539('0x8'));router[_0xe539('0x9')]('/',auth['isAuthenticated'](),controller[_0xe539('0xa')]);router[_0xe539('0x9')](_0xe539('0xb'),auth[_0xe539('0xc')](),controller['describe']);router[_0xe539('0x9')](_0xe539('0xd'),auth[_0xe539('0xc')](),controller[_0xe539('0xe')]);router[_0xe539('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe539('0xf')]);router[_0xe539('0x9')]('/:id/download',auth[_0xe539('0xc')](),controller[_0xe539('0x10')]);router[_0xe539('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe539('0x11')](_0xe539('0x12'),auth[_0xe539('0xc')](),controller['addMessage']);router[_0xe539('0x11')](_0xe539('0x13'),auth[_0xe539('0xc')](),interaction[_0xe539('0x14')](_0xe539('0x15'),_0xe539('0x16')),controller[_0xe539('0x17')]);router[_0xe539('0x18')](_0xe539('0xd'),auth[_0xe539('0xc')](),interaction[_0xe539('0x14')](_0xe539('0x15'),'openchannelinteraction:update'),controller[_0xe539('0x19')]);router[_0xe539('0x1a')](_0xe539('0xd'),auth['isAuthenticated'](),interaction[_0xe539('0x14')](_0xe539('0x15'),_0xe539('0x1b')),controller[_0xe539('0x1c')]);router[_0xe539('0x1a')](_0xe539('0x13'),auth['isAuthenticated'](),controller[_0xe539('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4013d81..ab99fc1 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 _0x9a19=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9a19,0x114));var _0x99a1=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9a19[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'closed':{'type':Sequelize[_0x99a1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x99a1('0x3')]},'secondDisposition':{'type':Sequelize[_0x99a1('0x3')]},'thirdDisposition':{'type':Sequelize[_0x99a1('0x3')]},'note':{'type':Sequelize[_0x99a1('0x3')]},'read1stAt':{'type':Sequelize[_0x99a1('0x4')]},'threadId':{'type':Sequelize[_0x99a1('0x3')]},'externalUrl':{'type':Sequelize[_0x99a1('0x3')]},'lastMsgAt':{'type':Sequelize[_0x99a1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x99a1('0x5')]('in',_0x99a1('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x99a1('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xde9f=['sequelize','exports','DATE','STRING','BOOLEAN'];(function(_0x140004,_0x5a30a7){var _0x370efd=function(_0x311632){while(--_0x311632){_0x140004['push'](_0x140004['shift']());}};_0x370efd(++_0x5a30a7);}(_0xde9f,0x16d));var _0xfde9=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xde9f[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0xfde9('0x0'));module[_0xfde9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfde9('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfde9('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfde9('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xfde9('0x2')]},'threadId':{'type':Sequelize[_0xfde9('0x3')]},'externalUrl':{'type':Sequelize[_0xfde9('0x3')]},'lastMsgAt':{'type':Sequelize[_0xfde9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xfde9('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index dffd70f..5f8cd0d 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 _0x549a=['ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelInteraction.socket','register','status','offset','limit','count','json','apply','reject','save','update','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','forEach','push','catch','index','OpenchannelInteraction','fieldName','type','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','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','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','split','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','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\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)','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','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','OpenchannelInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','options','create','describe','addMessage','ids','findOne','OpenchannelMessage','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','CmContact','firstName','Attachment','direction','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','format','closedAt','disposition','threadId','Private','Messages','basename','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','transcript-','log','err','unlinkSync','sendStatus','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x36cb2e,_0x17ecf5){var _0x2769d0=function(_0x278e58){while(--_0x278e58){_0x36cb2e['push'](_0x36cb2e['shift']());}};_0x2769d0(++_0x17ecf5);}(_0x549a,0x1c1));var _0xa549=function(_0x79c1e1,_0x9dfd45){_0x79c1e1=_0x79c1e1-0x0;var _0x2ed1d0=_0x549a[_0x79c1e1];return _0x2ed1d0;};'use strict';var emlformat=require(_0xa549('0x0'));var rimraf=require(_0xa549('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa549('0x2'));var moment=require(_0xa549('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa549('0x4'));var util=require(_0xa549('0x5'));var path=require('path');var sox=require(_0xa549('0x6'));var csv=require('to-csv');var ejs=require(_0xa549('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa549('0x8'));var crypto=require(_0xa549('0x9'));var jsforce=require(_0xa549('0xa'));var deskjs=require(_0xa549('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa549('0xc'));var Redis=require(_0xa549('0xd'));var authService=require(_0xa549('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa549('0xf'))('api');var utils=require(_0xa549('0x10'));var config=require(_0xa549('0x11'));var licenseUtil=require(_0xa549('0x12'));var db=require(_0xa549('0x13'))['db'];config[_0xa549('0x14')]=_['defaults'](config[_0xa549('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa549('0x15'))[_0xa549('0x16')](socket);function respondWithStatusCode(_0x17cba0,_0x10b1f7){_0x10b1f7=_0x10b1f7||0xcc;return function(_0x182d09){if(_0x182d09){return _0x17cba0['sendStatus'](_0x10b1f7);}return _0x17cba0[_0xa549('0x17')](_0x10b1f7)['end']();};}function respondWithResult(_0x35f863,_0x34b090){_0x34b090=_0x34b090||0xc8;return function(_0x5addd2){if(_0x5addd2){return _0x35f863[_0xa549('0x17')](_0x34b090)['json'](_0x5addd2);}};}function respondWithFilteredResult(_0x145866,_0x59a073){return function(_0x49d517){if(_0x49d517){var _0x2bfddd=typeof _0x59a073[_0xa549('0x18')]==='undefined'&&typeof _0x59a073[_0xa549('0x19')]==='undefined';var _0x4431cb=_0x49d517['count'];var _0x57ac78=_0x2bfddd?0x0:_0x59a073['offset'];var _0x50647b=_0x2bfddd?_0x49d517[_0xa549('0x1a')]:_0x59a073[_0xa549('0x18')]+_0x59a073[_0xa549('0x19')];var _0x59a384;if(_0x50647b>=_0x4431cb){_0x50647b=_0x4431cb;_0x59a384=0xc8;}else{_0x59a384=0xce;}_0x145866[_0xa549('0x17')](_0x59a384);return _0x145866['set']('Content-Range',_0x57ac78+'-'+_0x50647b+'/'+_0x4431cb)[_0xa549('0x1b')](_0x49d517);}return null;};}function patchUpdates(_0x270081){return function(_0x5e7a70){try{jsonpatch[_0xa549('0x1c')](_0x5e7a70,_0x270081,!![]);}catch(_0x3069d8){return BPromise[_0xa549('0x1d')](_0x3069d8);}return _0x5e7a70[_0xa549('0x1e')]();};}function saveUpdates(_0xebcc4c,_0x4e449e){return function(_0xd45e11){if(_0xd45e11){return _0xd45e11[_0xa549('0x1f')](_0xebcc4c)[_0xa549('0x20')](function(_0x383a53){return _0x383a53;});}return null;};}function removeEntity(_0x7464d6,_0xea1b51){return function(_0x25b3a1){if(_0x25b3a1){return _0x25b3a1[_0xa549('0x21')]()['then'](function(){_0x7464d6[_0xa549('0x17')](0xcc)[_0xa549('0x22')]();});}};}function handleEntityNotFound(_0x19711e,_0x41f788){return function(_0x1e02d6){if(!_0x1e02d6){_0x19711e['sendStatus'](0x194);}return _0x1e02d6;};}function handleError(_0x1ef686,_0x46d217){_0x46d217=_0x46d217||0x1f4;return function(_0x45004c){logger['error'](_0x45004c[_0xa549('0x23')]);if(_0x45004c[_0xa549('0x24')]){delete _0x45004c['name'];}_0x1ef686[_0xa549('0x17')](_0x46d217)[_0xa549('0x25')](_0x45004c);};}function getInteractionUsers(_0x571412,_0x38b645){return new BPromise(function(_0x34b363,_0x59bd72){try{if(_0x38b645[_0x571412['id']]){_0x571412[_0xa549('0x26')]=_[_0xa549('0x27')](_0x38b645[_0x571412['id']],function(_0x2226f8){return{'id':_0x2226f8['id'],'fullname':_0x2226f8[_0xa549('0x28')]};});}}catch(_0x139a30){_0x59bd72(_0x139a30);}_0x34b363(_0x571412);});}function getInteractionTags(_0x298ff4,_0x1e482a){return new BPromise(function(_0x249209,_0x22ee6c){try{if(_0x298ff4[_0xa549('0x29')]){_0x298ff4['Tags']=[];_0x298ff4[_0xa549('0x29')]['split'](',')[_0xa549('0x2a')](function(_0x45ef5e){_0x298ff4['Tags'][_0xa549('0x2b')](_0x1e482a[_0x45ef5e]);});}delete _0x298ff4[_0xa549('0x29')];}catch(_0x3bb317){_0x22ee6c(_0x3bb317);}_0x249209(_0x298ff4);});}function updateOpenchannelInteraction(_0x3cc83e,_0x419885,_0xfe14bf){return new BPromise(function(_0x49824e,_0x4c2dbc){return getInteractionUsers(_0x3cc83e,_0xfe14bf)[_0xa549('0x20')](function(_0x1dabbb){return getInteractionTags(_0x1dabbb,_0x419885);})[_0xa549('0x20')](function(_0x35a24d){_0x49824e(_0x35a24d);})[_0xa549('0x2c')](function(_0x53dff4){_0x4c2dbc(_0x53dff4);});});}exports[_0xa549('0x2d')]=function(_0x2ba5b1,_0x298b9d){var _0x2a94c4={},_0x544e88={},_0x40c4a0={'count':0x0,'rows':[]};var _0x5352b5=_[_0xa549('0x27')](db[_0xa549('0x2e')]['rawAttributes'],function(_0x1d374c){return{'name':_0x1d374c[_0xa549('0x2f')],'type':_0x1d374c[_0xa549('0x30')]['key']};});_0x544e88[_0xa549('0x31')]=_[_0xa549('0x27')](_0x5352b5,'name');_0x544e88['query']=_['keys'](_0x2ba5b1['query']);_0x544e88[_0xa549('0x32')]=_['intersection'](_0x544e88[_0xa549('0x31')],_0x544e88[_0xa549('0x33')]);_0x2a94c4[_0xa549('0x34')]=_[_0xa549('0x35')](_0x544e88[_0xa549('0x31')],qs['fields'](_0x2ba5b1[_0xa549('0x33')][_0xa549('0x36')]));_0x2a94c4[_0xa549('0x34')]=_0x2a94c4[_0xa549('0x34')][_0xa549('0x37')]?_0x2a94c4[_0xa549('0x34')]:_0x544e88[_0xa549('0x31')];if(!_0x2ba5b1['query'][_0xa549('0x38')](_0xa549('0x39'))){_0x2a94c4[_0xa549('0x19')]=qs[_0xa549('0x19')](_0x2ba5b1[_0xa549('0x33')][_0xa549('0x19')]);_0x2a94c4[_0xa549('0x18')]=qs[_0xa549('0x18')](_0x2ba5b1['query'][_0xa549('0x18')]);}_0x2a94c4['order']=qs[_0xa549('0x3a')](_0x2ba5b1[_0xa549('0x33')][_0xa549('0x3a')]);_0x2a94c4[_0xa549('0x3b')]=qs['filters'](_[_0xa549('0x3c')](_0x2ba5b1[_0xa549('0x33')],_0x544e88['filters']),_0x5352b5);var _0x1adf9c=[];var _0x2f0af7=squel[_0xa549('0x3d')]()[_0xa549('0x3e')]('id')[_0xa549('0x3e')](_0xa549('0x24'))['field'](_0xa549('0x3f'))[_0xa549('0x40')](_0xa549('0x41'));var _0x11d6e4=squel[_0xa549('0x3d')]()[_0xa549('0x3e')](_0xa549('0x42'))[_0xa549('0x3e')](_0xa549('0x43'))[_0xa549('0x3e')](_0xa549('0x44'))[_0xa549('0x40')](_0xa549('0x45'),'ui')[_0xa549('0x46')]('users','u',_0xa549('0x47'));var _0x3332ee=squel[_0xa549('0x3d')]()['from'](_0xa549('0x48'),'i')[_0xa549('0x46')]('cm_contacts','c',_0xa549('0x49'))[_0xa549('0x46')]('users','o',_0xa549('0x4a'))['left_join'](_0xa549('0x4b'),'a',_0xa549('0x4c'))[_0xa549('0x46')](_0xa549('0x4d'),'me',_0xa549('0x4e'))['left_join']('openchannel_interaction_has_tags','it',_0xa549('0x4f'))[_0xa549('0x46')](_0xa549('0x41'),'t',_0xa549('0x50'));var _0x24d491=squel['expr']();var _0x5af6f7=[];var _0x3836c5=squel[_0xa549('0x51')]();var _0x552e4a;if(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x52')]){_0x552e4a=as['parseSearch'](_0x2ba5b1[_0xa549('0x33')][_0xa549('0x52')]);var _0x1bcc1d=_0x552e4a[_0xa549('0x53')];for(var _0x56310a=0x0;_0x56310a<_0x552e4a[_0xa549('0x54')][_0xa549('0x37')];_0x56310a++){var _0x36bbe4=_0x552e4a[_0xa549('0x54')][_0x56310a];var _0x1459a3='i';var _0x4e1423=_[_0xa549('0x55')](_0x5352b5,[_0xa549('0x24'),_0x36bbe4[_0xa549('0x3e')]]);if(!_0x4e1423){switch(_0x36bbe4[_0xa549('0x3e')]){case _0xa549('0x56'):if(_0x36bbe4[_0xa549('0x57')]==0x1){_0x3332ee[_0xa549('0x58')]('`'+_0x36bbe4[_0xa549('0x3e')]+_0xa549('0x59'));}else{_0x3332ee['having']('`'+_0x36bbe4['field']+_0xa549('0x5a'));}break;case _0xa549('0x5b'):if(_0x36bbe4[_0xa549('0x5c')]===_0xa549('0x5d')){if(_0x36bbe4[_0xa549('0x57')]['split']('\x20')[_0xa549('0x37')]>0x1){_0x24d491[_0x1bcc1d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa549('0x5e')](_0x36bbe4[_0xa549('0x57')]),null);}else{var _0x5005aa='%'+_0x36bbe4[_0xa549('0x57')]+'%';_0x24d491[_0x1bcc1d](_0xa549('0x5f'),_0x5005aa,_0x5005aa,_0x5005aa);}}else{_0x4e1423=_['find'](_0x5352b5,[_0xa549('0x24'),_0xa549('0x60')]);_0x36bbe4['field']=_0xa549('0x60');_0x533aee=as[_0xa549('0x61')](_0x1459a3,_0x4e1423[_0xa549('0x30')],_0x36bbe4);_0x24d491[_0x1bcc1d](_0x533aee[_0xa549('0x62')],_0x533aee[_0xa549('0x57')][_0xa549('0x63')],_0x533aee[_0xa549('0x57')]['end']);}break;case _0xa549('0x64'):var _0x31b2a8=_0x36bbe4[_0xa549('0x57')][_0xa549('0x65')](',')[_0xa549('0x27')](function(_0x50fac5){return Number(_0x50fac5);});_0x31b2a8[_0xa549('0x2a')](function(_0x4bc685){_0x3836c5['or'](_0xa549('0x66'),'%,'+_0x4bc685+',%');});_0x5af6f7=_[_0xa549('0x67')](_0x5af6f7,_0x31b2a8);break;case _0xa549('0x68'):if(_0x36bbe4[_0xa549('0x5c')]===_0xa549('0x5d')){_0x24d491[_0x1bcc1d](_0xa549('0x69'),'%'+_0x36bbe4['value']+'%',null);}else{_0x4e1423=_[_0xa549('0x55')](_0x5352b5,[_0xa549('0x24'),_0xa549('0x6a')]);_0x36bbe4[_0xa549('0x3e')]='UserId';_0x533aee=as[_0xa549('0x61')](_0x1459a3,_0x4e1423[_0xa549('0x30')],_0x36bbe4);_0x24d491[_0x1bcc1d](_0x533aee['text'],_0x533aee[_0xa549('0x57')][_0xa549('0x63')],_0x533aee[_0xa549('0x57')][_0xa549('0x22')]);}break;case _0xa549('0x6b'):_0x533aee=as[_0xa549('0x61')]('me',null,_0x36bbe4);_0x24d491[_0x1bcc1d](_0x533aee[_0xa549('0x62')],_0x533aee[_0xa549('0x57')][_0xa549('0x63')],_0x533aee[_0xa549('0x57')]['end']);break;}}else{var _0x533aee=as[_0xa549('0x61')](_0x1459a3,_0x4e1423['type'],_0x36bbe4);_0x24d491[_0x1bcc1d](_0x533aee[_0xa549('0x62')],_0x533aee[_0xa549('0x57')][_0xa549('0x63')],_0x533aee[_0xa549('0x57')][_0xa549('0x22')]);}}}else{var _0xfa884=_(_0x2ba5b1[_0xa549('0x33')])[_0xa549('0x6c')]()[_0xa549('0x27')](function(_0x3837a1){return _[_0xa549('0x6d')](_0x5352b5,[_0xa549('0x24'),_0x3837a1])?_0x3837a1:undefined;})[_0xa549('0x6e')]()[_0xa549('0x57')]();if(!_[_0xa549('0x6f')](_0xfa884)){_0xfa884['forEach'](function(_0x2f3af4){if(_0x2f3af4===_0xa549('0x70')){_0x3332ee[_0xa549('0x3b')](_0xa549('0x71'),[][_0xa549('0x72')](_0x2ba5b1[_0xa549('0x33')][_0x2f3af4]));}else if(_0x2f3af4===_0xa549('0x73')){var _0x163216=JSON[_0xa549('0x74')](_0x2ba5b1[_0xa549('0x33')][_0x2f3af4])[_0xa549('0x75')];var _0x559eef=JSON[_0xa549('0x74')](_0x2ba5b1['query'][_0x2f3af4])[_0xa549('0x76')];_0x3332ee['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x163216,_0x559eef);}else{if(_0x2ba5b1[_0xa549('0x33')][_0x2f3af4]===_0xa549('0x77')){_0x3332ee['where']('i.'+_0x2f3af4+_0xa549('0x78'));}else{_0x3332ee['where']('i.'+_0x2f3af4+'\x20=\x20?',_0x2ba5b1[_0xa549('0x33')][_0x2f3af4]);}}});}if(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x79')]){if(_0x2ba5b1['query'][_0xa549('0x79')]==0x1){_0x3332ee[_0xa549('0x58')](_0xa549('0x7a'));}else{_0x3332ee[_0xa549('0x58')]('`unreadMessages`\x20>\x200');}}if(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x7b')]){_0x5af6f7=_[_0xa549('0x7c')](_0x2ba5b1[_0xa549('0x33')][_0xa549('0x7b')])?_0x2ba5b1[_0xa549('0x33')]['tag']:new Array(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x7b')]);_0x5af6f7[_0xa549('0x2a')](function(_0x7cefe9){_0x3836c5['or'](_0xa549('0x66'),'%,'+_0x7cefe9+',%');});}if(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x7d')]){var _0x111392=_0x2ba5b1['query'][_0xa549('0x7d')]['replace']('\x5c','\x5c\x5c')[_0xa549('0x7e')](/'/g,'\x27\x27');if(qs[_0xa549('0x7f')](_0x111392)){_0x24d491['or'](_0xa549('0x80'),_0x111392+'%');}else{_0x24d491['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x111392))['or'](_0xa549('0x81'),_0x111392+'%')['or'](_0xa549('0x82'),_0x111392+'%');}}}_0x3332ee[_0xa549('0x3b')](_0x24d491);_0x3332ee[_0xa549('0x83')](_0xa549('0x84'));var _0x807383={'type':db[_0xa549('0x85')][_0xa549('0x86')][_0xa549('0x87')],'raw':!![]};var _0x2ca4b1=_0x3332ee[_0xa549('0x88')]();_0x2ca4b1['field'](_0xa549('0x84'));_0x2ca4b1[_0xa549('0x3e')](_0xa549('0x89'),_0xa549('0x56'));if(_0x2a94c4['order']){_0x2a94c4[_0xa549('0x8a')][_0xa549('0x2a')](function(_0x43edab){var _0x35148b=_0x43edab[0x0]===_0xa549('0x8b')?_0x43edab[0x0]:'i.'+_0x43edab[0x0];_0x3332ee['order'](_0x35148b,_0x43edab[0x1]===_0xa549('0x8c')?![]:!![]);});}if(!_[_0xa549('0x6f')](_0x5af6f7)){_0x3332ee[_0xa549('0x58')](_0x3836c5);_0x2ca4b1['where']('t.id\x20IN\x20?',_0x5af6f7);}BPromise[_0xa549('0x8d')]()[_0xa549('0x20')](function(){if(!_0x552e4a){if(_0x2ba5b1[_0xa549('0x33')][_0xa549('0x70')])return;_0x2ca4b1[_0xa549('0x3b')](_0xa549('0x8e'));_0x3332ee[_0xa549('0x3b')](_0xa549('0x8e'));return;}if(_0x2ba5b1[_0xa549('0x8f')][_0xa549('0x90')]!==_0xa549('0x91'))return;return _0x2ba5b1[_0xa549('0x8f')][_0xa549('0x92')]({'attributes':['id'],'raw':!![]})[_0xa549('0x20')](function(_0x567319){if(_[_0xa549('0x6f')](_0x567319)){_0x2ca4b1['where'](_0xa549('0x93'));_0x3332ee['where'](_0xa549('0x93'));}else{_0x2ca4b1[_0xa549('0x3b')](_0xa549('0x71'),_[_0xa549('0x27')](_0x567319,'id'));_0x3332ee[_0xa549('0x3b')](_0xa549('0x71'),_['map'](_0x567319,'id'));}});})[_0xa549('0x20')](function(){if(_0x2ba5b1[_0xa549('0x8f')][_0xa549('0x90')]===_0xa549('0x91')&&!_0x552e4a&&!_0x2ba5b1[_0xa549('0x33')][_0xa549('0x70')])return[];return db['sequelize'][_0xa549('0x33')](_0x2ca4b1['toString'](),_0x807383);})[_0xa549('0x20')](function(_0x101703){_0x40c4a0[_0xa549('0x1a')]=_0x101703[_0xa549('0x37')];if(_0x40c4a0[_0xa549('0x1a')]===0x0)return[];return db[_0xa549('0x94')]['query'](_0x2f0af7[_0xa549('0x95')](),_0x807383)[_0xa549('0x20')](function(_0x36de29){_0x1adf9c=_['keyBy'](_0x36de29,'id');_0x807383=_['merge'](_0x807383,{'model':db[_0xa549('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ba5b1['query']['fields']){_0x2a94c4[_0xa549('0x34')][_0xa549('0x2a')](function(_0x5f5793){_0x3332ee[_0xa549('0x3e')]('i.'+_0x5f5793);});}else{_0x3332ee['field'](_0xa549('0x89'),_0xa549('0x56'));_0x3332ee[_0xa549('0x3e')](_0xa549('0x96'),'Account.key');_0x3332ee[_0xa549('0x3e')](_0xa549('0x97'),_0xa549('0x98'));_0x3332ee[_0xa549('0x3e')]('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',_0xa549('0x8b'));_0x3332ee[_0xa549('0x3e')](_0xa549('0x99'));_0x3332ee['field']('c.firstName',_0xa549('0x9a'));_0x3332ee['field'](_0xa549('0x9b'),_0xa549('0x9c'));_0x3332ee[_0xa549('0x3e')](_0xa549('0x9d'),_0xa549('0x9e'));_0x3332ee[_0xa549('0x3e')](_0xa549('0x9f'),'Contact.phone');_0x3332ee['field'](_0xa549('0xa0'),'Contact.mobile');_0x3332ee[_0xa549('0x3e')](_0xa549('0xa1'),'Contact.fax');_0x3332ee[_0xa549('0x3e')](_0xa549('0xa2'),_0xa549('0xa3'));_0x3332ee['field'](_0xa549('0xa4'),_0xa549('0xa5'));_0x3332ee['field'](_0xa549('0xa6'),_0xa549('0x29'));}if(_0x2a94c4[_0xa549('0x19')])_0x3332ee['limit'](_0x2a94c4[_0xa549('0x19')]);if(_0x2a94c4[_0xa549('0x18')])_0x3332ee['offset'](_0x2a94c4[_0xa549('0x18')]);return db['sequelize'][_0xa549('0x33')](_0x3332ee[_0xa549('0x95')](),_0x807383);})[_0xa549('0x20')](function(_0x3d2db9){if(_0x3d2db9['length']>0x0)_0x11d6e4[_0xa549('0x3b')](_0xa549('0xa7'),_['map'](_0x3d2db9,'id'));return db['sequelize'][_0xa549('0x33')](_0x11d6e4[_0xa549('0x95')](),_0x807383)[_0xa549('0x20')](function(_0x1a787b){var _0x54ab66=_[_0xa549('0xa8')](_0x1a787b,_0xa549('0xa9'));var _0x227ade=[];_0x3d2db9['forEach'](function(_0x228839){_0x227ade['push'](updateOpenchannelInteraction(_0x228839,_0x1adf9c,_0x54ab66));});return BPromise[_0xa549('0xaa')](_0x227ade);});});})[_0xa549('0x20')](function(_0xd3bfa3){_0x40c4a0[_0xa549('0xab')]=_0xd3bfa3;return _0x40c4a0;})['then'](respondWithFilteredResult(_0x298b9d,_0x2a94c4))[_0xa549('0x2c')](handleError(_0x298b9d,null));};exports[_0xa549('0xac')]=function(_0x11d1f5,_0x538715){var _0x301274={};if(_0x11d1f5[_0xa549('0x33')][_0xa549('0x30')]&&_0x11d1f5[_0xa549('0x33')]['type']==='from'){_0x301274['from']=_0x11d1f5[_0xa549('0xad')]['id'];}else{_0x301274['id']=_0x11d1f5['params']['id'];}var _0x5e90ff={'raw':![],'where':_0x301274},_0x1641ac={};_0x1641ac[_0xa549('0x31')]=_[_0xa549('0x6c')](db[_0xa549('0x2e')][_0xa549('0xae')]);_0x1641ac[_0xa549('0x33')]=_['keys'](_0x11d1f5[_0xa549('0x33')]);_0x1641ac[_0xa549('0x32')]=_[_0xa549('0x35')](_0x1641ac[_0xa549('0x31')],_0x1641ac[_0xa549('0x33')]);_0x5e90ff['attributes']=_[_0xa549('0x35')](_0x1641ac['model'],qs[_0xa549('0x36')](_0x11d1f5['query'][_0xa549('0x36')]));_0x5e90ff['attributes']=_0x5e90ff[_0xa549('0x34')]['length']?_0x5e90ff[_0xa549('0x34')]:_0x1641ac['model'];if(_0x11d1f5[_0xa549('0x33')][_0xa549('0xaf')]){_0x5e90ff[_0xa549('0xb0')]=[{'all':!![]}];}_0x5e90ff=_[_0xa549('0xb1')]({},_0x5e90ff,_0x11d1f5[_0xa549('0xb2')]);return db[_0xa549('0x2e')][_0xa549('0x55')](_0x5e90ff)['then'](handleEntityNotFound(_0x538715,null))[_0xa549('0x20')](respondWithResult(_0x538715,null))[_0xa549('0x2c')](handleError(_0x538715,null));};exports[_0xa549('0xb3')]=function(_0x2e8b7e,_0x20f270){return db[_0xa549('0x2e')][_0xa549('0xb3')](_0x2e8b7e['body'],{})['then'](respondWithResult(_0x20f270,0xc9))[_0xa549('0x2c')](handleError(_0x20f270,null));};exports[_0xa549('0x1f')]=function(_0x21824b,_0x1975a6){if(_0x21824b[_0xa549('0x6b')]['id']){delete _0x21824b[_0xa549('0x6b')]['id'];}return db[_0xa549('0x2e')]['find']({'where':{'id':_0x21824b[_0xa549('0xad')]['id']}})['then'](handleEntityNotFound(_0x1975a6,null))['then'](saveUpdates(_0x21824b[_0xa549('0x6b')],null))[_0xa549('0x20')](respondWithResult(_0x1975a6,null))['catch'](handleError(_0x1975a6,null));};exports['destroy']=function(_0x454798,_0x3aa872){return db[_0xa549('0x2e')]['find']({'where':{'id':_0x454798[_0xa549('0xad')]['id']}})[_0xa549('0x20')](handleEntityNotFound(_0x3aa872,null))[_0xa549('0x20')](removeEntity(_0x3aa872,null))['catch'](handleError(_0x3aa872,null));};exports[_0xa549('0xb4')]=function(_0x50e7bb,_0x46459d){return db[_0xa549('0x2e')]['describe']()[_0xa549('0x20')](respondWithResult(_0x46459d,null))['catch'](handleError(_0x46459d,null));};exports[_0xa549('0xb5')]=function(_0x50a2fd,_0x24341c,_0x3da4c9){return db['OpenchannelMessage'][_0xa549('0x55')]({'where':{'id':_0x50a2fd['params']['id']}})[_0xa549('0x20')](handleEntityNotFound(_0x24341c,null))[_0xa549('0x20')](function(_0x336172){if(_0x336172){return _0x336172['addMessage'](_0x50a2fd[_0xa549('0x6b')][_0xa549('0xb6')],_['omit'](_0x50a2fd[_0xa549('0x6b')],[_0xa549('0xb6'),'id'])||{});}})[_0xa549('0x20')](respondWithResult(_0x24341c,null))[_0xa549('0x2c')](handleError(_0x24341c,null));};exports['getMessages']=function(_0x5a1896,_0x5593c1,_0x2e562d){var _0x497814={'raw':![],'where':{}};var _0xbd1d69={};var _0x606534={'count':0x0,'rows':[]};return db[_0xa549('0x2e')][_0xa549('0xb7')]({'where':{'id':_0x5a1896[_0xa549('0xad')]['id']}})[_0xa549('0x20')](handleEntityNotFound(_0x5593c1,null))[_0xa549('0x20')](function(_0x2157b5){if(_0x2157b5){_0xbd1d69['model']=_[_0xa549('0x6c')](db[_0xa549('0xb8')]['rawAttributes']);_0xbd1d69[_0xa549('0x33')]=_[_0xa549('0x6c')](_0x5a1896[_0xa549('0x33')]);_0xbd1d69[_0xa549('0x32')]=_['intersection'](_0xbd1d69['model'],_0xbd1d69[_0xa549('0x33')]);_0x497814[_0xa549('0x34')]=_[_0xa549('0x35')](_0xbd1d69[_0xa549('0x31')],qs['fields'](_0x5a1896[_0xa549('0x33')][_0xa549('0x36')]));_0x497814['attributes']=_0x497814[_0xa549('0x34')][_0xa549('0x37')]?_0x497814['attributes']:_0xbd1d69[_0xa549('0x31')];if(!_0x5a1896[_0xa549('0x33')][_0xa549('0x38')](_0xa549('0x39'))){_0x497814[_0xa549('0x19')]=qs['limit'](_0x5a1896[_0xa549('0x33')][_0xa549('0x19')]);_0x497814['offset']=qs['offset'](_0x5a1896[_0xa549('0x33')][_0xa549('0x18')]);}_0x497814[_0xa549('0x8a')]=qs['sort'](_0x5a1896['query']['sort']);_0x497814[_0xa549('0x3b')]=qs[_0xa549('0x32')](_[_0xa549('0x3c')](_0x5a1896[_0xa549('0x33')],_0xbd1d69[_0xa549('0x32')]));_0x497814[_0xa549('0x3b')][_0xa549('0xa9')]=_0x2157b5['id'];if(_0x5a1896[_0xa549('0x33')][_0xa549('0x7d')]){_0x497814[_0xa549('0x3b')]=_[_0xa549('0xb1')](_0x497814[_0xa549('0x3b')],{'$or':_[_0xa549('0x27')](_0x497814[_0xa549('0x34')],function(_0x420d75){var _0x5397e4={};_0x5397e4[_0x420d75]={'$like':'%'+_0x5a1896[_0xa549('0x33')][_0xa549('0x7d')]+'%'};return _0x5397e4;})});}if(_0x5a1896[_0xa549('0x33')][_0xa549('0x75')]){var _0x42075f=_0x5a1896[_0xa549('0x33')][_0xa549('0x75')][_0xa549('0x65')](',');var _0x2b27ea={};_0x2b27ea[_0x42075f[0x0]]={'$gte':moment(_0x42075f[0x1])['format'](_0xa549('0xb9'))};_0x497814[_0xa549('0x3b')]=_[_0xa549('0xb1')](_0x497814[_0xa549('0x3b')],_0x2b27ea);}_0x497814=_[_0xa549('0xb1')]({},_0x497814,_0x5a1896[_0xa549('0xb2')]);return db[_0xa549('0xb8')][_0xa549('0x1a')]({'where':_0x497814[_0xa549('0x3b')]})[_0xa549('0x20')](function(_0x353913){_0x606534[_0xa549('0x1a')]=_0x353913;if(_0x5a1896['query'][_0xa549('0xaf')]){_0x497814[_0xa549('0xb0')]=[{'all':!![]}];}return db[_0xa549('0xb8')][_0xa549('0xba')](_0x497814);})[_0xa549('0x20')](function(_0x47dd03){_0x606534[_0xa549('0xab')]=_0x47dd03;return _0x606534;});}})[_0xa549('0x20')](respondWithFilteredResult(_0x5593c1,_0x497814))[_0xa549('0x2c')](handleError(_0x5593c1,null));};exports[_0xa549('0xbb')]=function(_0x56c77a,_0x1d11d4,_0x3f5807){return db[_0xa549('0x2e')][_0xa549('0x55')]({'where':{'id':_0x56c77a[_0xa549('0xad')]['id']}})[_0xa549('0x20')](handleEntityNotFound(_0x1d11d4,null))['then'](function(_0x954dd9){if(_0x954dd9){return _0x954dd9[_0xa549('0xbc')](_0x56c77a[_0xa549('0x6b')][_0xa549('0xb6')],_['omit'](_0x56c77a['body'],[_0xa549('0xb6'),'id'])||{})[_0xa549('0xbd')](function(){return db['Tag'][_0xa549('0xba')]({'attributes':['id',_0xa549('0x24'),_0xa549('0x3f')],'where':{'id':_0x56c77a[_0xa549('0x6b')][_0xa549('0xb6')]}});})[_0xa549('0x20')](function(_0x519fa0){socket[_0xa549('0xbe')]('openchannelInteractionTags:save',{'id':Number(_0x56c77a['params']['id']),'tags':_0x519fa0||[]});return{'id':Number(_0x56c77a['params']['id']),'tags':_0x519fa0||[]};});}})[_0xa549('0x20')](respondWithResult(_0x1d11d4,null))[_0xa549('0x2c')](handleError(_0x1d11d4,null));};exports[_0xa549('0xbf')]=function(_0x4b9509,_0x504346,_0x4479f8){return db[_0xa549('0x2e')][_0xa549('0x55')]({'where':{'id':_0x4b9509[_0xa549('0xad')]['id']}})[_0xa549('0x20')](handleEntityNotFound(_0x504346,null))[_0xa549('0x20')](function(_0x22fec4){if(_0x22fec4){return _0x22fec4[_0xa549('0xbf')](_0x4b9509[_0xa549('0x33')][_0xa549('0xb6')]);}})[_0xa549('0x20')](respondWithStatusCode(_0x504346,null))['catch'](handleError(_0x504346,null));};exports[_0xa549('0xc0')]=function(_0x15ede4,_0x5b1cf9){var _0xe1201c=moment()[_0xa549('0xc1')]()[_0xa549('0x95')]();var _0x952263=path['join'](config[_0xa549('0xc2')],_0xa549('0xc3'),_0xa549('0xc4'),_0xa549('0xc5'));var _0x32dd79=path[_0xa549('0xc6')](config[_0xa549('0xc2')],'server',_0xa549('0xc4'),'attachments');var _0x2a887a=path[_0xa549('0xc6')](_0x952263,_0xe1201c);var _0x6060d8=util['format'](_0xa549('0xc7'),_0x15ede4['params']['id'],_0xe1201c);var _0x1dc18d=path['join'](_0x952263,_0x6060d8);var _0x387af9=[];_0x387af9[_0xa549('0x2b')]({'model':db[_0xa549('0x68')],'as':'User','attributes':['id',_0xa549('0x28')],'raw':!![]});_0x387af9[_0xa549('0x2b')]({'model':db[_0xa549('0xc8')],'as':_0xa549('0x5b'),'attributes':['id',_0xa549('0xc9'),'lastName'],'raw':!![]});if(_0x15ede4[_0xa549('0x33')]['attachments']){_0x387af9[_0xa549('0x2b')]({'model':db[_0xa549('0xca')],'as':_0xa549('0xca'),'raw':!![]});}var _0x2e130a=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body','createdAt',_0xa549('0xcb'),_0xa549('0xcc'),_0xa549('0x79')],'include':_0x387af9}];_0x2e130a[_0xa549('0x2b')]({'model':db[_0xa549('0xcd')],'as':_0xa549('0xce'),'attributes':['id',_0xa549('0x24')]});_0x2e130a[_0xa549('0x2b')]({'model':db['User'],'as':'Owner','attributes':['id',_0xa549('0x28')]});return db[_0xa549('0x2e')]['find']({'where':{'id':_0x15ede4[_0xa549('0xad')]['id']},'include':_0x2e130a})['then'](handleEntityNotFound(_0x5b1cf9,null))['then'](function(_0x518d13){if(_0x518d13){var _0x1d1146=_0x518d13[_0xa549('0xcf')]({'plain':!![]});fs[_0xa549('0xd0')](_0x2a887a);var _0x15911b={'channel':_0xa549('0xd1'),'account':_0x1d1146[_0xa549('0xce')][_0xa549('0x24')],'agent':_0x1d1146['Owner']?_0x1d1146[_0xa549('0xd2')][_0xa549('0x28')]:_0xa549('0xd3'),'createdAt':moment(_0x1d1146[_0xa549('0x73')])[_0xa549('0xd4')](_0xa549('0xb9'))[_0xa549('0x95')](),'closedAt':_0x1d1146['closed']?moment(_0x1d1146[_0xa549('0xd5')])[_0xa549('0xd4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa549('0x95')]():'','disposition':_0x1d1146[_0xa549('0xd6')],'visibility':_0x1d1146[_0xa549('0xd7')]?'Public':_0xa549('0xd8'),'messages':_(_0x1d1146[_0xa549('0xd9')])[_0xa549('0x7d')]({'secret':![]})[_0xa549('0x27')](function(_0x3ff6b5){if(_0x3ff6b5[_0xa549('0xca')]){var _0xc29684=path[_0xa549('0xc6')](_0x32dd79,_0x3ff6b5[_0xa549('0xca')][_0xa549('0xda')]);if(fs[_0xa549('0xdb')](_0xc29684)){fs[_0xa549('0xdc')](_0xc29684)['pipe'](fs[_0xa549('0xdd')](path[_0xa549('0xc6')](_0x2a887a,_0x3ff6b5[_0xa549('0xca')][_0xa549('0xda')])));}}return{'date':moment(_0x3ff6b5[_0xa549('0x73')])['format'](_0xa549('0xb9'))[_0xa549('0x95')](),'sender':_0x3ff6b5['direction']===_0xa549('0xde')?_0x3ff6b5['User']?_0x3ff6b5[_0xa549('0x68')][_0xa549('0x28')]:'System':_0x3ff6b5['Contact'][_0xa549('0xc9')]+(_0x3ff6b5[_0xa549('0x5b')][_0xa549('0xdf')]?'\x20'+_0x3ff6b5[_0xa549('0x5b')]['lastName']:''),'body':_0x3ff6b5[_0xa549('0xca')]?_0x3ff6b5[_0xa549('0xca')][_0xa549('0xda')]:_0x3ff6b5[_0xa549('0x6b')],'direction':_0x3ff6b5[_0xa549('0xcb')]==='out'?'A':'C','secret':_0x3ff6b5[_0xa549('0xcc')],'read':_0x3ff6b5[_0xa549('0x79')],'attachment':_0x3ff6b5[_0xa549('0xca')]};})['value']()};return ejs[_0xa549('0xe0')](path[_0xa549('0xc6')](config[_0xa549('0xc2')],_0xa549('0xc3'),_0xa549('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x15911b})['then'](function(_0x572205){var _0x4242ae=path[_0xa549('0xc6')](_0x2a887a,_0xa549('0xe2')+_0x1d1146['id']+'-'+_0xe1201c+'.pdf');var _0x22f4d9={'path':_0x4242ae,'channel':_0xa549('0xd1'),'interactionId':_0x1d1146['id']};return pdf['createPdfFromHTML'](_0x572205,_0x22f4d9);})[_0xa549('0x20')](function(){return new BPromise(function(_0x5f52ae,_0x1b64ca){zipdir(_0x2a887a,{'saveTo':_0x1dc18d},function(_0x372df2,_0x1f72fe){if(_0x372df2)return _0x1b64ca(_0x372df2);return _0x5f52ae(_0x1f72fe);});})[_0xa549('0x20')](function(){return new BPromise(function(_0x948e54,_0x40b7d0){rimraf(_0x2a887a,function(_0x14efd4){if(_0x14efd4)_0x40b7d0(_0x14efd4);return _0x948e54();});});})['then'](function(){return _0x5b1cf9['download'](_0x1dc18d,_0x6060d8,function(_0x4e535c){if(_0x4e535c){console[_0xa549('0xe3')](_0xa549('0xe4'),_0x4e535c);}else{fs[_0xa549('0xe5')](_0x1dc18d);}});});});}else{return _0x5b1cf9[_0xa549('0xe6')](0xc8);}})[_0xa549('0x2c')](handleError(_0x5b1cf9,null));}; \ No newline at end of file +var _0x6892=['from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','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','Sequelize','QueryTypes','unreadMessages','order','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','all','rows','show','params','include','merge','create','update','destroy','addMessage','OpenchannelMessage','ids','getMessages','findOne','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','omit','findAll','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','join','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','Account','Owner','get','Openchannel','N.A.','closedAt','disposition','threadId','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','name','send','Users','map','fullname','split','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','field','color'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0x6892,0x191));var _0x2689=function(_0x1bc0ea,_0x1a3bd2){_0x1bc0ea=_0x1bc0ea-0x0;var _0x5ad0c9=_0x6892[_0x1bc0ea];return _0x5ad0c9;};'use strict';var emlformat=require(_0x2689('0x0'));var rimraf=require(_0x2689('0x1'));var zipdir=require(_0x2689('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2689('0x3'));var moment=require(_0x2689('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2689('0x5'));var util=require(_0x2689('0x6'));var path=require('path');var sox=require(_0x2689('0x7'));var csv=require(_0x2689('0x8'));var ejs=require(_0x2689('0x9'));var fs=require('fs');var fs_extra=require(_0x2689('0xa'));var _=require('lodash');var squel=require(_0x2689('0xb'));var crypto=require(_0x2689('0xc'));var jsforce=require(_0x2689('0xd'));var deskjs=require(_0x2689('0xe'));var toCsv=require(_0x2689('0x8'));var querystring=require(_0x2689('0xf'));var Papa=require('papaparse');var Redis=require(_0x2689('0x10'));var authService=require(_0x2689('0x11'));var qs=require(_0x2689('0x12'));var as=require(_0x2689('0x13'));var pdf=require(_0x2689('0x14'));var hardwareService=require(_0x2689('0x15'));var logger=require(_0x2689('0x16'))(_0x2689('0x17'));var utils=require(_0x2689('0x18'));var config=require(_0x2689('0x19'));var licenseUtil=require(_0x2689('0x1a'));var db=require(_0x2689('0x1b'))['db'];config[_0x2689('0x1c')]=_['defaults'](config[_0x2689('0x1c')],{'host':_0x2689('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2689('0x1e'))[_0x2689('0x1f')](socket);function respondWithStatusCode(_0x28d4bd,_0x48794c){_0x48794c=_0x48794c||0xcc;return function(_0x6a3bb5){if(_0x6a3bb5){return _0x28d4bd[_0x2689('0x20')](_0x48794c);}return _0x28d4bd[_0x2689('0x21')](_0x48794c)[_0x2689('0x22')]();};}function respondWithResult(_0x587fd3,_0x4d0c0f){_0x4d0c0f=_0x4d0c0f||0xc8;return function(_0x2831dd){if(_0x2831dd){return _0x587fd3[_0x2689('0x21')](_0x4d0c0f)[_0x2689('0x23')](_0x2831dd);}};}function respondWithFilteredResult(_0x2fcd40,_0x463247){return function(_0x35a608){if(_0x35a608){var _0x5052cd=typeof _0x463247[_0x2689('0x24')]==='undefined'&&typeof _0x463247[_0x2689('0x25')]===_0x2689('0x26');var _0x2b3de3=_0x35a608[_0x2689('0x27')];var _0x54ce0c=_0x5052cd?0x0:_0x463247[_0x2689('0x24')];var _0x14bc2b=_0x5052cd?_0x35a608['count']:_0x463247[_0x2689('0x24')]+_0x463247[_0x2689('0x25')];var _0x1b47a0;if(_0x14bc2b>=_0x2b3de3){_0x14bc2b=_0x2b3de3;_0x1b47a0=0xc8;}else{_0x1b47a0=0xce;}_0x2fcd40[_0x2689('0x21')](_0x1b47a0);return _0x2fcd40[_0x2689('0x28')](_0x2689('0x29'),_0x54ce0c+'-'+_0x14bc2b+'/'+_0x2b3de3)['json'](_0x35a608);}return null;};}function patchUpdates(_0x32b686){return function(_0x164699){try{jsonpatch[_0x2689('0x2a')](_0x164699,_0x32b686,!![]);}catch(_0x446f08){return BPromise[_0x2689('0x2b')](_0x446f08);}return _0x164699[_0x2689('0x2c')]();};}function saveUpdates(_0xc3a978,_0x5c6a56){return function(_0x371805){if(_0x371805){return _0x371805['update'](_0xc3a978)[_0x2689('0x2d')](function(_0x285991){return _0x285991;});}return null;};}function removeEntity(_0x20b61e,_0x1543b7){return function(_0x16d24d){if(_0x16d24d){return _0x16d24d['destroy']()[_0x2689('0x2d')](function(){_0x20b61e['status'](0xcc)[_0x2689('0x22')]();});}};}function handleEntityNotFound(_0x46e125,_0x1249ab){return function(_0x20521c){if(!_0x20521c){_0x46e125[_0x2689('0x20')](0x194);}return _0x20521c;};}function handleError(_0x4512ba,_0x386058){_0x386058=_0x386058||0x1f4;return function(_0x3a41ea){logger[_0x2689('0x2e')](_0x3a41ea['stack']);if(_0x3a41ea[_0x2689('0x2f')]){delete _0x3a41ea[_0x2689('0x2f')];}_0x4512ba[_0x2689('0x21')](_0x386058)[_0x2689('0x30')](_0x3a41ea);};}function getInteractionUsers(_0x465115,_0x1257d9){return new BPromise(function(_0x2cb1e7,_0x1a91e6){try{if(_0x1257d9[_0x465115['id']]){_0x465115[_0x2689('0x31')]=_[_0x2689('0x32')](_0x1257d9[_0x465115['id']],function(_0x59a35b){return{'id':_0x59a35b['id'],'fullname':_0x59a35b[_0x2689('0x33')]};});}}catch(_0x5ce22b){_0x1a91e6(_0x5ce22b);}_0x2cb1e7(_0x465115);});}function getInteractionTags(_0x4ca9d4,_0x1fb77a){return new BPromise(function(_0x177de4,_0x18f0d3){try{if(_0x4ca9d4['TagIds']){_0x4ca9d4['Tags']=[];_0x4ca9d4['TagIds'][_0x2689('0x34')](',')['forEach'](function(_0x16bca8){_0x4ca9d4['Tags'][_0x2689('0x35')](_0x1fb77a[_0x16bca8]);});}delete _0x4ca9d4['TagIds'];}catch(_0x4be186){_0x18f0d3(_0x4be186);}_0x177de4(_0x4ca9d4);});}function updateOpenchannelInteraction(_0x540f00,_0x4ca838,_0x4c16cb){return new BPromise(function(_0x5d98d6,_0x3af29a){return getInteractionUsers(_0x540f00,_0x4c16cb)['then'](function(_0x4ff0ed){return getInteractionTags(_0x4ff0ed,_0x4ca838);})[_0x2689('0x2d')](function(_0x3603f2){_0x5d98d6(_0x3603f2);})[_0x2689('0x36')](function(_0x5df7e2){_0x3af29a(_0x5df7e2);});});}exports[_0x2689('0x37')]=function(_0x3bf3b9,_0x12a849){var _0x357b25={},_0x53d93e={},_0x5586bf={'count':0x0,'rows':[]};var _0x3e6cfc=_['map'](db[_0x2689('0x38')][_0x2689('0x39')],function(_0x289921){return{'name':_0x289921[_0x2689('0x3a')],'type':_0x289921[_0x2689('0x3b')][_0x2689('0x3c')]};});_0x53d93e[_0x2689('0x3d')]=_[_0x2689('0x32')](_0x3e6cfc,_0x2689('0x2f'));_0x53d93e[_0x2689('0x3e')]=_[_0x2689('0x3f')](_0x3bf3b9['query']);_0x53d93e[_0x2689('0x40')]=_['intersection'](_0x53d93e[_0x2689('0x3d')],_0x53d93e[_0x2689('0x3e')]);_0x357b25['attributes']=_[_0x2689('0x41')](_0x53d93e['model'],qs[_0x2689('0x42')](_0x3bf3b9['query'][_0x2689('0x42')]));_0x357b25['attributes']=_0x357b25['attributes'][_0x2689('0x43')]?_0x357b25[_0x2689('0x44')]:_0x53d93e[_0x2689('0x3d')];if(!_0x3bf3b9['query'][_0x2689('0x45')](_0x2689('0x46'))){_0x357b25[_0x2689('0x25')]=qs[_0x2689('0x25')](_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x25')]);_0x357b25['offset']=qs[_0x2689('0x24')](_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x24')]);}_0x357b25['order']=qs[_0x2689('0x47')](_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x47')]);_0x357b25[_0x2689('0x48')]=qs['filters'](_['pick'](_0x3bf3b9[_0x2689('0x3e')],_0x53d93e['filters']),_0x3e6cfc);var _0x205ea8=[];var _0x5f54b5=squel['select']()[_0x2689('0x49')]('id')[_0x2689('0x49')](_0x2689('0x2f'))[_0x2689('0x49')](_0x2689('0x4a'))[_0x2689('0x4b')]('tools_tags');var _0x478be1=squel['select']()[_0x2689('0x49')](_0x2689('0x4c'))[_0x2689('0x49')](_0x2689('0x4d'))[_0x2689('0x49')](_0x2689('0x4e'))['from'](_0x2689('0x4f'),'ui')['left_join'](_0x2689('0x50'),'u',_0x2689('0x51'));var _0x83e9e0=squel['select']()[_0x2689('0x4b')](_0x2689('0x52'),'i')[_0x2689('0x53')](_0x2689('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2689('0x53')](_0x2689('0x50'),'o',_0x2689('0x55'))[_0x2689('0x53')](_0x2689('0x56'),'a',_0x2689('0x57'))['left_join'](_0x2689('0x58'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x2689('0x59'),'it',_0x2689('0x5a'))[_0x2689('0x53')]('tools_tags','t',_0x2689('0x5b'));var _0x145fcd=squel[_0x2689('0x5c')]();var _0x21048f=[];var _0x26c8c9=squel['expr']();var _0x3e2453;if(_0x3bf3b9['query'][_0x2689('0x5d')]){_0x3e2453=as[_0x2689('0x5e')](_0x3bf3b9[_0x2689('0x3e')]['search']);var _0x443c40=_0x3e2453[_0x2689('0x5f')];for(var _0x2732a8=0x0;_0x2732a8<_0x3e2453[_0x2689('0x60')][_0x2689('0x43')];_0x2732a8++){var _0x22e219=_0x3e2453['conditions'][_0x2732a8];var _0x41fc0e='i';var _0x3322b9=_['find'](_0x3e6cfc,[_0x2689('0x2f'),_0x22e219[_0x2689('0x49')]]);if(!_0x3322b9){switch(_0x22e219[_0x2689('0x49')]){case'unreadMessages':if(_0x22e219[_0x2689('0x61')]==0x1){_0x83e9e0[_0x2689('0x62')]('`'+_0x22e219[_0x2689('0x49')]+_0x2689('0x63'));}else{_0x83e9e0[_0x2689('0x62')]('`'+_0x22e219[_0x2689('0x49')]+_0x2689('0x64'));}break;case _0x2689('0x65'):if(_0x22e219[_0x2689('0x66')]===_0x2689('0x67')){if(_0x22e219[_0x2689('0x61')][_0x2689('0x34')]('\x20')[_0x2689('0x43')]>0x1){_0x145fcd[_0x443c40](_0x2689('0x68'),qs[_0x2689('0x69')](_0x22e219['value']),null);}else{var _0x3fcc34='%'+_0x22e219[_0x2689('0x61')]+'%';_0x145fcd[_0x443c40](_0x2689('0x6a'),_0x3fcc34,_0x3fcc34,_0x3fcc34);}}else{_0x3322b9=_[_0x2689('0x6b')](_0x3e6cfc,['name','ContactId']);_0x22e219[_0x2689('0x49')]=_0x2689('0x6c');_0x1d986d=as[_0x2689('0x6d')](_0x41fc0e,_0x3322b9['type'],_0x22e219);_0x145fcd[_0x443c40](_0x1d986d[_0x2689('0x6e')],_0x1d986d[_0x2689('0x61')][_0x2689('0x6f')],_0x1d986d['value'][_0x2689('0x22')]);}break;case _0x2689('0x70'):var _0x6dedca=_0x22e219[_0x2689('0x61')]['split'](',')[_0x2689('0x32')](function(_0x5a5d12){return Number(_0x5a5d12);});_0x6dedca[_0x2689('0x71')](function(_0x21862e){_0x26c8c9['or'](_0x2689('0x72'),'%,'+_0x21862e+',%');});_0x21048f=_[_0x2689('0x73')](_0x21048f,_0x6dedca);break;case _0x2689('0x74'):if(_0x22e219[_0x2689('0x66')]===_0x2689('0x67')){_0x145fcd[_0x443c40](_0x2689('0x75'),'%'+_0x22e219['value']+'%',null);}else{_0x3322b9=_[_0x2689('0x6b')](_0x3e6cfc,['name',_0x2689('0x76')]);_0x22e219['field']=_0x2689('0x76');_0x1d986d=as['buildExpression'](_0x41fc0e,_0x3322b9[_0x2689('0x3b')],_0x22e219);_0x145fcd[_0x443c40](_0x1d986d['text'],_0x1d986d['value'][_0x2689('0x6f')],_0x1d986d[_0x2689('0x61')][_0x2689('0x22')]);}break;case _0x2689('0x77'):_0x1d986d=as[_0x2689('0x6d')]('me',null,_0x22e219);_0x145fcd[_0x443c40](_0x1d986d[_0x2689('0x6e')],_0x1d986d[_0x2689('0x61')][_0x2689('0x6f')],_0x1d986d[_0x2689('0x61')][_0x2689('0x22')]);break;}}else{var _0x1d986d=as['buildExpression'](_0x41fc0e,_0x3322b9[_0x2689('0x3b')],_0x22e219);_0x145fcd[_0x443c40](_0x1d986d[_0x2689('0x6e')],_0x1d986d[_0x2689('0x61')][_0x2689('0x6f')],_0x1d986d[_0x2689('0x61')][_0x2689('0x22')]);}}}else{var _0x55580e=_(_0x3bf3b9[_0x2689('0x3e')])[_0x2689('0x3f')]()[_0x2689('0x32')](function(_0x4f102e){return _[_0x2689('0x78')](_0x3e6cfc,['name',_0x4f102e])?_0x4f102e:undefined;})[_0x2689('0x79')]()[_0x2689('0x61')]();if(!_[_0x2689('0x7a')](_0x55580e)){_0x55580e['forEach'](function(_0x42f2a4){if(_0x42f2a4===_0x2689('0x7b')){_0x83e9e0['where'](_0x2689('0x7c'),[][_0x2689('0x7d')](_0x3bf3b9[_0x2689('0x3e')][_0x42f2a4]));}else if(_0x42f2a4===_0x2689('0x7e')){var _0x192393=JSON[_0x2689('0x7f')](_0x3bf3b9[_0x2689('0x3e')][_0x42f2a4])[_0x2689('0x80')];var _0x2dc4a5=JSON['parse'](_0x3bf3b9[_0x2689('0x3e')][_0x42f2a4])[_0x2689('0x81')];_0x83e9e0['where'](_0x2689('0x82'),_0x192393,_0x2dc4a5);}else{if(_0x3bf3b9[_0x2689('0x3e')][_0x42f2a4]==='null'){_0x83e9e0[_0x2689('0x48')]('i.'+_0x42f2a4+_0x2689('0x83'));}else{_0x83e9e0[_0x2689('0x48')]('i.'+_0x42f2a4+'\x20=\x20?',_0x3bf3b9[_0x2689('0x3e')][_0x42f2a4]);}}});}if(_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x84')]){if(_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x84')]==0x1){_0x83e9e0[_0x2689('0x62')](_0x2689('0x85'));}else{_0x83e9e0[_0x2689('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x86')]){_0x21048f=_[_0x2689('0x87')](_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x86')])?_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x86')]:new Array(_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x86')]);_0x21048f[_0x2689('0x71')](function(_0x50623c){_0x26c8c9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x50623c+',%');});}if(_0x3bf3b9[_0x2689('0x3e')]['filter']){var _0x11ca20=_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x88')][_0x2689('0x89')]('\x5c','\x5c\x5c')[_0x2689('0x89')](/'/g,'\x27\x27');if(qs[_0x2689('0x8a')](_0x11ca20)){_0x145fcd['or']('i.id\x20LIKE\x20?',_0x11ca20+'%');}else{_0x145fcd['or'](_0x2689('0x8b'),qs[_0x2689('0x69')](_0x11ca20))['or'](_0x2689('0x8c'),_0x11ca20+'%')['or'](_0x2689('0x8d'),_0x11ca20+'%');}}}_0x83e9e0[_0x2689('0x48')](_0x145fcd);_0x83e9e0[_0x2689('0x8e')]('i.id');var _0x307cdf={'type':db[_0x2689('0x8f')][_0x2689('0x90')]['SELECT'],'raw':!![]};var _0x1df337=_0x83e9e0['clone']();_0x1df337[_0x2689('0x49')]('i.id');_0x1df337[_0x2689('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2689('0x91'));if(_0x357b25[_0x2689('0x92')]){_0x357b25['order']['forEach'](function(_0x50680f){var _0x56c7ea=_0x50680f[0x0]===_0x2689('0x93')?_0x50680f[0x0]:'i.'+_0x50680f[0x0];_0x83e9e0[_0x2689('0x92')](_0x56c7ea,_0x50680f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2689('0x7a')](_0x21048f)){_0x83e9e0['having'](_0x26c8c9);_0x1df337['where'](_0x2689('0x94'),_0x21048f);}BPromise[_0x2689('0x95')]()[_0x2689('0x2d')](function(){if(!_0x3e2453){if(_0x3bf3b9['query'][_0x2689('0x7b')])return;_0x1df337[_0x2689('0x48')](_0x2689('0x96'));_0x83e9e0['where'](_0x2689('0x96'));return;}if(_0x3bf3b9['user'][_0x2689('0x97')]!==_0x2689('0x98'))return;return _0x3bf3b9[_0x2689('0x99')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3da4c4){if(_[_0x2689('0x7a')](_0x3da4c4)){_0x1df337[_0x2689('0x48')](_0x2689('0x9a'));_0x83e9e0[_0x2689('0x48')](_0x2689('0x9a'));}else{_0x1df337[_0x2689('0x48')](_0x2689('0x7c'),_[_0x2689('0x32')](_0x3da4c4,'id'));_0x83e9e0[_0x2689('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x3da4c4,'id'));}});})[_0x2689('0x2d')](function(){if(_0x3bf3b9[_0x2689('0x99')][_0x2689('0x97')]===_0x2689('0x98')&&!_0x3e2453&&!_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x7b')])return[];return db[_0x2689('0x9b')][_0x2689('0x3e')](_0x1df337['toString'](),_0x307cdf);})[_0x2689('0x2d')](function(_0xff0616){_0x5586bf[_0x2689('0x27')]=_0xff0616[_0x2689('0x43')];if(_0x5586bf[_0x2689('0x27')]===0x0)return[];return db[_0x2689('0x9b')][_0x2689('0x3e')](_0x5f54b5[_0x2689('0x9c')](),_0x307cdf)[_0x2689('0x2d')](function(_0x22e085){_0x205ea8=_[_0x2689('0x9d')](_0x22e085,'id');_0x307cdf=_['merge'](_0x307cdf,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3bf3b9[_0x2689('0x3e')][_0x2689('0x42')]){_0x357b25['attributes'][_0x2689('0x71')](function(_0x5cfacc){_0x83e9e0[_0x2689('0x49')]('i.'+_0x5cfacc);});}else{_0x83e9e0['field'](_0x2689('0x9e'),_0x2689('0x91'));_0x83e9e0[_0x2689('0x49')](_0x2689('0x9f'),'Account.key');_0x83e9e0[_0x2689('0x49')](_0x2689('0xa0'),_0x2689('0xa1'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xa2'),_0x2689('0x93'));_0x83e9e0[_0x2689('0x49')]('i.*');_0x83e9e0[_0x2689('0x49')]('c.firstName',_0x2689('0xa3'));_0x83e9e0[_0x2689('0x49')]('c.lastName',_0x2689('0xa4'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xa5'),_0x2689('0xa6'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xa7'),_0x2689('0xa8'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xa9'),_0x2689('0xaa'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xab'),_0x2689('0xac'));_0x83e9e0[_0x2689('0x49')]('o.fullname',_0x2689('0xad'));_0x83e9e0[_0x2689('0x49')](_0x2689('0xae'),'Owner.internal');_0x83e9e0['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2689('0xaf'));}if(_0x357b25[_0x2689('0x25')])_0x83e9e0['limit'](_0x357b25[_0x2689('0x25')]);if(_0x357b25[_0x2689('0x24')])_0x83e9e0[_0x2689('0x24')](_0x357b25[_0x2689('0x24')]);return db['sequelize'][_0x2689('0x3e')](_0x83e9e0['toString'](),_0x307cdf);})[_0x2689('0x2d')](function(_0x14ff67){if(_0x14ff67[_0x2689('0x43')]>0x0)_0x478be1[_0x2689('0x48')](_0x2689('0xb0'),_[_0x2689('0x32')](_0x14ff67,'id'));return db[_0x2689('0x9b')][_0x2689('0x3e')](_0x478be1['toString'](),_0x307cdf)[_0x2689('0x2d')](function(_0x48b159){var _0xaea267=_['groupBy'](_0x48b159,'OpenchannelInteractionId');var _0x43a0d0=[];_0x14ff67[_0x2689('0x71')](function(_0x371668){_0x43a0d0[_0x2689('0x35')](updateOpenchannelInteraction(_0x371668,_0x205ea8,_0xaea267));});return BPromise[_0x2689('0xb1')](_0x43a0d0);});});})['then'](function(_0x223193){_0x5586bf[_0x2689('0xb2')]=_0x223193;return _0x5586bf;})[_0x2689('0x2d')](respondWithFilteredResult(_0x12a849,_0x357b25))[_0x2689('0x36')](handleError(_0x12a849,null));};exports[_0x2689('0xb3')]=function(_0x29f4cd,_0x5246f0){var _0x3a7cfb={};if(_0x29f4cd[_0x2689('0x3e')][_0x2689('0x3b')]&&_0x29f4cd['query'][_0x2689('0x3b')]===_0x2689('0x4b')){_0x3a7cfb[_0x2689('0x4b')]=_0x29f4cd[_0x2689('0xb4')]['id'];}else{_0x3a7cfb['id']=_0x29f4cd[_0x2689('0xb4')]['id'];}var _0x429cc5={'raw':![],'where':_0x3a7cfb},_0x2fc177={};_0x2fc177['model']=_['keys'](db['OpenchannelInteraction'][_0x2689('0x39')]);_0x2fc177[_0x2689('0x3e')]=_[_0x2689('0x3f')](_0x29f4cd[_0x2689('0x3e')]);_0x2fc177[_0x2689('0x40')]=_[_0x2689('0x41')](_0x2fc177[_0x2689('0x3d')],_0x2fc177['query']);_0x429cc5['attributes']=_[_0x2689('0x41')](_0x2fc177[_0x2689('0x3d')],qs[_0x2689('0x42')](_0x29f4cd['query'][_0x2689('0x42')]));_0x429cc5[_0x2689('0x44')]=_0x429cc5[_0x2689('0x44')][_0x2689('0x43')]?_0x429cc5['attributes']:_0x2fc177[_0x2689('0x3d')];if(_0x29f4cd[_0x2689('0x3e')]['includeAll']){_0x429cc5[_0x2689('0xb5')]=[{'all':!![]}];}_0x429cc5=_[_0x2689('0xb6')]({},_0x429cc5,_0x29f4cd['options']);return db[_0x2689('0x38')][_0x2689('0x6b')](_0x429cc5)['then'](handleEntityNotFound(_0x5246f0,null))[_0x2689('0x2d')](respondWithResult(_0x5246f0,null))[_0x2689('0x36')](handleError(_0x5246f0,null));};exports[_0x2689('0xb7')]=function(_0x3c951b,_0x4d7483){return db[_0x2689('0x38')][_0x2689('0xb7')](_0x3c951b[_0x2689('0x77')],{})[_0x2689('0x2d')](respondWithResult(_0x4d7483,0xc9))[_0x2689('0x36')](handleError(_0x4d7483,null));};exports[_0x2689('0xb8')]=function(_0x515fd7,_0x24e2d4){if(_0x515fd7['body']['id']){delete _0x515fd7['body']['id'];}return db[_0x2689('0x38')]['find']({'where':{'id':_0x515fd7['params']['id']}})['then'](handleEntityNotFound(_0x24e2d4,null))[_0x2689('0x2d')](saveUpdates(_0x515fd7['body'],null))[_0x2689('0x2d')](respondWithResult(_0x24e2d4,null))[_0x2689('0x36')](handleError(_0x24e2d4,null));};exports[_0x2689('0xb9')]=function(_0x2d00ee,_0x444ce3){return db[_0x2689('0x38')][_0x2689('0x6b')]({'where':{'id':_0x2d00ee[_0x2689('0xb4')]['id']}})[_0x2689('0x2d')](handleEntityNotFound(_0x444ce3,null))[_0x2689('0x2d')](removeEntity(_0x444ce3,null))[_0x2689('0x36')](handleError(_0x444ce3,null));};exports['describe']=function(_0x55631c,_0x700619){return db[_0x2689('0x38')]['describe']()[_0x2689('0x2d')](respondWithResult(_0x700619,null))[_0x2689('0x36')](handleError(_0x700619,null));};exports[_0x2689('0xba')]=function(_0x4fe625,_0x47b7a3,_0x386d8c){return db[_0x2689('0xbb')]['find']({'where':{'id':_0x4fe625[_0x2689('0xb4')]['id']}})[_0x2689('0x2d')](handleEntityNotFound(_0x47b7a3,null))[_0x2689('0x2d')](function(_0x3fbd5c){if(_0x3fbd5c){return _0x3fbd5c[_0x2689('0xba')](_0x4fe625[_0x2689('0x77')]['ids'],_['omit'](_0x4fe625[_0x2689('0x77')],[_0x2689('0xbc'),'id'])||{});}})[_0x2689('0x2d')](respondWithResult(_0x47b7a3,null))[_0x2689('0x36')](handleError(_0x47b7a3,null));};exports[_0x2689('0xbd')]=function(_0x2fc393,_0x57d390,_0x1c627a){var _0x192ad7={'raw':![],'where':{}};var _0x1abc6a={};var _0x1eddba={'count':0x0,'rows':[]};return db[_0x2689('0x38')][_0x2689('0xbe')]({'where':{'id':_0x2fc393[_0x2689('0xb4')]['id']}})[_0x2689('0x2d')](handleEntityNotFound(_0x57d390,null))[_0x2689('0x2d')](function(_0x3a9792){if(_0x3a9792){_0x1abc6a[_0x2689('0x3d')]=_['keys'](db['OpenchannelMessage'][_0x2689('0x39')]);_0x1abc6a['query']=_['keys'](_0x2fc393['query']);_0x1abc6a[_0x2689('0x40')]=_['intersection'](_0x1abc6a[_0x2689('0x3d')],_0x1abc6a['query']);_0x192ad7[_0x2689('0x44')]=_[_0x2689('0x41')](_0x1abc6a[_0x2689('0x3d')],qs['fields'](_0x2fc393['query']['fields']));_0x192ad7[_0x2689('0x44')]=_0x192ad7[_0x2689('0x44')][_0x2689('0x43')]?_0x192ad7[_0x2689('0x44')]:_0x1abc6a['model'];if(!_0x2fc393[_0x2689('0x3e')][_0x2689('0x45')](_0x2689('0x46'))){_0x192ad7[_0x2689('0x25')]=qs[_0x2689('0x25')](_0x2fc393[_0x2689('0x3e')][_0x2689('0x25')]);_0x192ad7['offset']=qs['offset'](_0x2fc393['query'][_0x2689('0x24')]);}_0x192ad7[_0x2689('0x92')]=qs[_0x2689('0x47')](_0x2fc393[_0x2689('0x3e')]['sort']);_0x192ad7[_0x2689('0x48')]=qs[_0x2689('0x40')](_[_0x2689('0xbf')](_0x2fc393['query'],_0x1abc6a[_0x2689('0x40')]));_0x192ad7[_0x2689('0x48')][_0x2689('0xc0')]=_0x3a9792['id'];if(_0x2fc393[_0x2689('0x3e')]['filter']){_0x192ad7[_0x2689('0x48')]=_[_0x2689('0xb6')](_0x192ad7[_0x2689('0x48')],{'$or':_[_0x2689('0x32')](_0x192ad7['attributes'],function(_0x4ba27d){var _0x293f80={};_0x293f80[_0x4ba27d]={'$like':'%'+_0x2fc393[_0x2689('0x3e')][_0x2689('0x88')]+'%'};return _0x293f80;})});}if(_0x2fc393['query'][_0x2689('0x80')]){var _0xde4aa9=_0x2fc393[_0x2689('0x3e')]['$gte'][_0x2689('0x34')](',');var _0x7af9e1={};_0x7af9e1[_0xde4aa9[0x0]]={'$gte':moment(_0xde4aa9[0x1])[_0x2689('0xc1')](_0x2689('0xc2'))};_0x192ad7[_0x2689('0x48')]=_[_0x2689('0xb6')](_0x192ad7[_0x2689('0x48')],_0x7af9e1);}_0x192ad7=_[_0x2689('0xb6')]({},_0x192ad7,_0x2fc393[_0x2689('0xc3')]);return db[_0x2689('0xbb')][_0x2689('0x27')]({'where':_0x192ad7[_0x2689('0x48')]})[_0x2689('0x2d')](function(_0x22db9b){_0x1eddba[_0x2689('0x27')]=_0x22db9b;if(_0x2fc393[_0x2689('0x3e')][_0x2689('0xc4')]){_0x192ad7[_0x2689('0xb5')]=[{'all':!![]}];}return db[_0x2689('0xbb')]['findAll'](_0x192ad7);})[_0x2689('0x2d')](function(_0x57c9de){_0x1eddba['rows']=_0x57c9de;return _0x1eddba;});}})[_0x2689('0x2d')](respondWithFilteredResult(_0x57d390,_0x192ad7))['catch'](handleError(_0x57d390,null));};exports[_0x2689('0xc5')]=function(_0x2860aa,_0x4b21a2,_0x1c8e8e){return db[_0x2689('0x38')][_0x2689('0x6b')]({'where':{'id':_0x2860aa[_0x2689('0xb4')]['id']}})[_0x2689('0x2d')](handleEntityNotFound(_0x4b21a2,null))['then'](function(_0x1d355f){if(_0x1d355f){return _0x1d355f[_0x2689('0xc6')](_0x2860aa['body'][_0x2689('0xbc')],_[_0x2689('0xc7')](_0x2860aa[_0x2689('0x77')],[_0x2689('0xbc'),'id'])||{})['spread'](function(){return db[_0x2689('0x70')][_0x2689('0xc8')]({'attributes':['id',_0x2689('0x2f'),'color'],'where':{'id':_0x2860aa[_0x2689('0x77')]['ids']}});})[_0x2689('0x2d')](function(_0x587d36){socket['emit'](_0x2689('0xc9'),{'id':Number(_0x2860aa[_0x2689('0xb4')]['id']),'tags':_0x587d36||[]});return{'id':Number(_0x2860aa[_0x2689('0xb4')]['id']),'tags':_0x587d36||[]};});}})[_0x2689('0x2d')](respondWithResult(_0x4b21a2,null))['catch'](handleError(_0x4b21a2,null));};exports[_0x2689('0xca')]=function(_0x191c6c,_0x5f84fb,_0x1be89b){return db[_0x2689('0x38')][_0x2689('0x6b')]({'where':{'id':_0x191c6c[_0x2689('0xb4')]['id']}})[_0x2689('0x2d')](handleEntityNotFound(_0x5f84fb,null))[_0x2689('0x2d')](function(_0x2a7529){if(_0x2a7529){return _0x2a7529[_0x2689('0xca')](_0x191c6c[_0x2689('0x3e')][_0x2689('0xbc')]);}})[_0x2689('0x2d')](respondWithStatusCode(_0x5f84fb,null))['catch'](handleError(_0x5f84fb,null));};exports[_0x2689('0xcb')]=function(_0x44e268,_0x5bba6a){var _0x56b89a=moment()[_0x2689('0xcc')]()[_0x2689('0x9c')]();var _0x1f9fb1=path['join'](config[_0x2689('0xcd')],_0x2689('0xce'),_0x2689('0xcf'),'tmp');var _0x3af94c=path[_0x2689('0xd0')](config['root'],_0x2689('0xce'),_0x2689('0xcf'),'attachments');var _0x1e8a9f=path[_0x2689('0xd0')](_0x1f9fb1,_0x56b89a);var _0x2bcbe2=util[_0x2689('0xc1')](_0x2689('0xd1'),_0x44e268[_0x2689('0xb4')]['id'],_0x56b89a);var _0x234e3f=path[_0x2689('0xd0')](_0x1f9fb1,_0x2bcbe2);var _0x60042e=[];_0x60042e['push']({'model':db[_0x2689('0x74')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x60042e[_0x2689('0x35')]({'model':db[_0x2689('0xd2')],'as':_0x2689('0x65'),'attributes':['id',_0x2689('0xd3'),_0x2689('0xd4')],'raw':!![]});if(_0x44e268[_0x2689('0x3e')][_0x2689('0xd5')]){_0x60042e[_0x2689('0x35')]({'model':db['Attachment'],'as':_0x2689('0xd6'),'raw':!![]});}var _0x5dfa71=[{'model':db['OpenchannelMessage'],'as':_0x2689('0xd7'),'attributes':['id',_0x2689('0x77'),_0x2689('0x7e'),_0x2689('0xd8'),'secret',_0x2689('0x84')],'include':_0x60042e}];_0x5dfa71[_0x2689('0x35')]({'model':db['OpenchannelAccount'],'as':_0x2689('0xd9'),'attributes':['id',_0x2689('0x2f')]});_0x5dfa71[_0x2689('0x35')]({'model':db[_0x2689('0x74')],'as':_0x2689('0xda'),'attributes':['id',_0x2689('0x33')]});return db[_0x2689('0x38')][_0x2689('0x6b')]({'where':{'id':_0x44e268[_0x2689('0xb4')]['id']},'include':_0x5dfa71})[_0x2689('0x2d')](handleEntityNotFound(_0x5bba6a,null))[_0x2689('0x2d')](function(_0x266334){if(_0x266334){var _0x54f2f9=_0x266334[_0x2689('0xdb')]({'plain':!![]});fs['mkdirSync'](_0x1e8a9f);var _0x37d022={'channel':_0x2689('0xdc'),'account':_0x54f2f9[_0x2689('0xd9')][_0x2689('0x2f')],'agent':_0x54f2f9[_0x2689('0xda')]?_0x54f2f9['Owner']['fullname']:_0x2689('0xdd'),'createdAt':moment(_0x54f2f9['createdAt'])['format'](_0x2689('0xc2'))['toString'](),'closedAt':_0x54f2f9['closed']?moment(_0x54f2f9[_0x2689('0xde')])['format'](_0x2689('0xc2'))[_0x2689('0x9c')]():'','disposition':_0x54f2f9[_0x2689('0xdf')],'visibility':_0x54f2f9[_0x2689('0xe0')]?'Public':'Private','messages':_(_0x54f2f9[_0x2689('0xd7')])[_0x2689('0x88')]({'secret':![]})[_0x2689('0x32')](function(_0x50287f){if(_0x50287f[_0x2689('0xd6')]){var _0x5d8162=path['join'](_0x3af94c,_0x50287f[_0x2689('0xd6')][_0x2689('0xe1')]);if(fs[_0x2689('0xe2')](_0x5d8162)){fs['createReadStream'](_0x5d8162)[_0x2689('0xe3')](fs[_0x2689('0xe4')](path['join'](_0x1e8a9f,_0x50287f[_0x2689('0xd6')]['basename'])));}}return{'date':moment(_0x50287f[_0x2689('0x7e')])[_0x2689('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2689('0x9c')](),'sender':_0x50287f[_0x2689('0xd8')]===_0x2689('0xe5')?_0x50287f[_0x2689('0x74')]?_0x50287f[_0x2689('0x74')]['fullname']:_0x2689('0xe6'):_0x50287f[_0x2689('0x65')][_0x2689('0xd3')]+(_0x50287f[_0x2689('0x65')][_0x2689('0xd4')]?'\x20'+_0x50287f[_0x2689('0x65')][_0x2689('0xd4')]:''),'body':_0x50287f[_0x2689('0xd6')]?_0x50287f['Attachment'][_0x2689('0xe1')]:_0x50287f['body'],'direction':_0x50287f[_0x2689('0xd8')]===_0x2689('0xe5')?'A':'C','secret':_0x50287f['secret'],'read':_0x50287f[_0x2689('0x84')],'attachment':_0x50287f['Attachment']};})['value']()};return ejs[_0x2689('0xe7')](path[_0x2689('0xd0')](config[_0x2689('0xcd')],_0x2689('0xce'),_0x2689('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x37d022})[_0x2689('0x2d')](function(_0x102476){var _0x5f571c=path[_0x2689('0xd0')](_0x1e8a9f,_0x2689('0xe9')+_0x54f2f9['id']+'-'+_0x56b89a+_0x2689('0xea'));var _0x55dfaf={'path':_0x5f571c,'channel':'Openchannel','interactionId':_0x54f2f9['id']};return pdf[_0x2689('0xeb')](_0x102476,_0x55dfaf);})[_0x2689('0x2d')](function(){return new BPromise(function(_0x50280c,_0x292295){zipdir(_0x1e8a9f,{'saveTo':_0x234e3f},function(_0x41864a,_0x3ab437){if(_0x41864a)return _0x292295(_0x41864a);return _0x50280c(_0x3ab437);});})[_0x2689('0x2d')](function(){return new BPromise(function(_0x1f8b14,_0x4a3ca5){rimraf(_0x1e8a9f,function(_0x24d64b){if(_0x24d64b)_0x4a3ca5(_0x24d64b);return _0x1f8b14();});});})['then'](function(){return _0x5bba6a[_0x2689('0xcb')](_0x234e3f,_0x2bcbe2,function(_0x2eefda){if(_0x2eefda){console['log'](_0x2689('0xec'),_0x2eefda);}else{fs[_0x2689('0xed')](_0x234e3f);}});});});}else{return _0x5bba6a[_0x2689('0x20')](0xc8);}})[_0x2689('0x36')](handleError(_0x5bba6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index b4d4c8e..6899838 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 _0x7531=['unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x6e76c2,_0x35c6fd){var _0x51c19a=function(_0x3297f8){while(--_0x3297f8){_0x6e76c2['push'](_0x6e76c2['shift']());}};_0x51c19a(++_0x35c6fd);}(_0x7531,0xea));var _0x1753=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7531[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x1753('0x0'))['db'][_0x1753('0x1')];var OpenchannelMessage=require(_0x1753('0x0'))['db'][_0x1753('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1753('0x3')](0x0);var events={'afterCreate':_0x1753('0x4'),'afterUpdate':_0x1753('0x5'),'afterDestroy':_0x1753('0x6')};function emitEvent(_0x11d397){return function(_0x318646,_0x33df90,_0xb27516){_0x318646[_0x1753('0x7')]({'attributes':['id'],'raw':!![]})[_0x1753('0x8')](function(_0x5ce872){_0x318646[_0x1753('0x9')](_0x1753('0xa'),_0x5ce872[_0x1753('0xb')](function(_0x412152){return{'id':_0x412152['id']};}));return OpenchannelMessage[_0x1753('0xc')]({'where':{'OpenchannelInteractionId':_0x318646['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2ea4e2){_0x318646[_0x1753('0x9')](_0x1753('0xd'),_0x2ea4e2[_0x1753('0xe')]);OpenchannelInteractionEvents[_0x1753('0xf')](_0x11d397+':'+_0x318646['id'],_0x318646);OpenchannelInteractionEvents['emit'](_0x11d397,_0x318646);_0xb27516(null);})['catch'](_0xb27516(null));};}for(var e in events){if(events[_0x1753('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x1753('0x11')](e,emitEvent(event));}}module[_0x1753('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xdb7e=['setDataValue','length','emit','catch','hasOwnProperty','hook','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdb7e,0x1f4));var _0xedb7=function(_0x498dee,_0x194da0){_0x498dee=_0x498dee-0x0;var _0xf5d173=_0xdb7e[_0x498dee];return _0xf5d173;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xedb7('0x0')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xedb7('0x1')](0x0);var events={'afterCreate':_0xedb7('0x2'),'afterUpdate':_0xedb7('0x3'),'afterDestroy':_0xedb7('0x4')};function emitEvent(_0xc6a1df){return function(_0x39bd33,_0x4afdf5,_0x3e0e12){_0x39bd33[_0xedb7('0x5')]({'attributes':['id'],'raw':!![]})[_0xedb7('0x6')](function(_0x3c21d3){_0x39bd33[_0xedb7('0x7')]('Users',_0x3c21d3['map'](function(_0xd41cb4){return{'id':_0xd41cb4['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x39bd33['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x179a1f){_0x39bd33[_0xedb7('0x7')]('unreadMessages',_0x179a1f[_0xedb7('0x8')]);OpenchannelInteractionEvents[_0xedb7('0x9')](_0xc6a1df+':'+_0x39bd33['id'],_0x39bd33);OpenchannelInteractionEvents[_0xedb7('0x9')](_0xc6a1df,_0x39bd33);_0x3e0e12(null);})[_0xedb7('0xa')](_0x3e0e12(null));};}for(var e in events){if(events[_0xedb7('0xb')](e)){var event=events[e];OpenchannelInteraction[_0xedb7('0xc')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 02d3759..e2d21e9 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 _0x8e7c=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23a7d2,_0x1f5d70){var _0x36020f=function(_0x2d07e6){while(--_0x2d07e6){_0x23a7d2['push'](_0x23a7d2['shift']());}};_0x36020f(++_0x1f5d70);}(_0x8e7c,0x90));var _0xc8e7=function(_0x1235d2,_0x404d33){_0x1235d2=_0x1235d2-0x0;var _0x5b0fdd=_0x8e7c[_0x1235d2];return _0x5b0fdd;};'use strict';var _=require(_0xc8e7('0x0'));var util=require(_0xc8e7('0x1'));var logger=require(_0xc8e7('0x2'))(_0xc8e7('0x3'));var moment=require(_0xc8e7('0x4'));var BPromise=require(_0xc8e7('0x5'));var rp=require(_0xc8e7('0x6'));var fs=require('fs');var path=require(_0xc8e7('0x7'));var rimraf=require('rimraf');var config=require(_0xc8e7('0x8'));var attributes=require(_0xc8e7('0x9'));module[_0xc8e7('0xa')]=function(_0xd50521,_0x497ee6){return _0xd50521[_0xc8e7('0xb')](_0xc8e7('0xc'),attributes,{'tableName':_0xc8e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8e7('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x138231,_0x77e25b,_0x428989){if(_0x138231['changed'](_0xc8e7('0xf'))){_0x138231[_0xc8e7('0x10')]=moment()[_0xc8e7('0x11')](_0xc8e7('0x12'));}_0x428989(null,_0x138231);}}});}; \ No newline at end of file +var _0xf6c3=['request-promise','../../config/environment','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x357b81,_0x4c2c28){var _0x3b4053=function(_0x3f4436){while(--_0x3f4436){_0x357b81['push'](_0x357b81['shift']());}};_0x3b4053(++_0x4c2c28);}(_0xf6c3,0x9a));var _0x3f6c=function(_0x2f31bc,_0x4787ba){_0x2f31bc=_0x2f31bc-0x0;var _0x24eaac=_0xf6c3[_0x2f31bc];return _0x24eaac;};'use strict';var _=require(_0x3f6c('0x0'));var util=require(_0x3f6c('0x1'));var logger=require(_0x3f6c('0x2'))(_0x3f6c('0x3'));var moment=require(_0x3f6c('0x4'));var BPromise=require(_0x3f6c('0x5'));var rp=require(_0x3f6c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3f6c('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x34d1bc,_0xf90661){return _0x34d1bc[_0x3f6c('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x3f6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f6c('0xa'),'collate':_0x3f6c('0xb'),'hooks':{'beforeUpdate':function(_0x256288,_0x1756d8,_0x51c469){if(_0x256288['changed'](_0x3f6c('0xc'))){_0x256288[_0x3f6c('0xd')]=moment()[_0x3f6c('0xe')](_0x3f6c('0xf'));}_0x51c469(null,_0x256288);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e098786..76c79b2 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 _0x9600=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','find','addTags','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4692d2,_0x3a396b){var _0x341a51=function(_0x136724){while(--_0x136724){_0x4692d2['push'](_0x4692d2['shift']());}};_0x341a51(++_0x3a396b);}(_0x9600,0xea));var _0x0960=function(_0x5310b2,_0x8658a1){_0x5310b2=_0x5310b2-0x0;var _0x1cbe58=_0x9600[_0x5310b2];return _0x1cbe58;};'use strict';var _=require(_0x0960('0x0'));var util=require('util');var moment=require(_0x0960('0x1'));var BPromise=require('bluebird');var rs=require(_0x0960('0x2'));var fs=require('fs');var Redis=require(_0x0960('0x3'));var db=require(_0x0960('0x4'))['db'];var utils=require(_0x0960('0x5'));var logger=require('../../config/logger')(_0x0960('0x6'));var config=require(_0x0960('0x7'));var jayson=require(_0x0960('0x8'));var client=jayson[_0x0960('0x9')][_0x0960('0xa')]({'port':0x232a});config[_0x0960('0xb')]=_[_0x0960('0xc')](config[_0x0960('0xb')],{'host':_0x0960('0xd'),'port':0x18eb});var socket=require(_0x0960('0xe'))(new Redis(config[_0x0960('0xb')]));require(_0x0960('0xf'))[_0x0960('0x10')](socket);function respondWithRpcPromise(_0x481167,_0xbccd66,_0x31a1d1){return new BPromise(function(_0xa557b9,_0x464501){return client['request'](_0x481167,_0x31a1d1)[_0x0960('0x11')](function(_0x58a83e){logger[_0x0960('0x12')](_0x0960('0x13'),_0xbccd66,'request\x20sent');logger[_0x0960('0x14')](_0x0960('0x15'),_0xbccd66,_0x0960('0x16'),JSON[_0x0960('0x17')](_0x58a83e));if(_0x58a83e[_0x0960('0x18')]){if(_0x58a83e[_0x0960('0x18')][_0x0960('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0xbccd66,_0x58a83e[_0x0960('0x18')]['message']);return _0x464501(_0x58a83e['error'][_0x0960('0x1a')]);}logger[_0x0960('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0xbccd66,_0x58a83e[_0x0960('0x18')]['message']);return _0xa557b9(_0x58a83e[_0x0960('0x18')][_0x0960('0x1a')]);}else{logger[_0x0960('0x12')](_0x0960('0x13'),_0xbccd66,_0x0960('0x16'));_0xa557b9(_0x58a83e['result']['message']);}})[_0x0960('0x1b')](function(_0x3dc699){logger[_0x0960('0x18')](_0x0960('0x13'),_0xbccd66,_0x3dc699);_0x464501(_0x3dc699);});});}exports[_0x0960('0x1c')]=function(_0x123bd7){var _0x34bfbb=this;return new Promise(function(_0x42232e,_0x76f312){return db['OpenchannelInteraction'][_0x0960('0x1d')](_0x123bd7[_0x0960('0x1e')],{'raw':_0x123bd7[_0x0960('0x1f')]?_0x123bd7['options'][_0x0960('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x123bd7[_0x0960('0x1f')]?_0x123bd7[_0x0960('0x1f')][_0x0960('0x21')]||null:null,'attributes':_0x123bd7['options']?_0x123bd7['options'][_0x0960('0x22')]||null:null,'limit':_0x123bd7[_0x0960('0x1f')]?_0x123bd7['options'][_0x0960('0x23')]||null:null})['then'](function(_0x2590a1){logger[_0x0960('0x12')](_0x0960('0x1c'),_0x123bd7);logger['debug'](_0x0960('0x1c'),_0x123bd7,JSON[_0x0960('0x17')](_0x2590a1));_0x42232e(_0x2590a1);})['catch'](function(_0x59bc0e){logger[_0x0960('0x18')]('UpdateOpenchannelInteraction',_0x59bc0e[_0x0960('0x1a')],_0x123bd7);_0x76f312(_0x34bfbb[_0x0960('0x18')](0x1f4,_0x59bc0e[_0x0960('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x136b95){return new Promise(function(_0x4e8be0,_0x4ea667){return db['OpenchannelInteraction'][_0x0960('0x24')]({'where':_0x136b95[_0x0960('0x1f')]?_0x136b95[_0x0960('0x1f')][_0x0960('0x21')]||null:null})[_0x0960('0x11')](function(_0x2cdcf0){if(_0x2cdcf0){return _0x2cdcf0[_0x0960('0x25')](_0x136b95['body']['ids'],_[_0x0960('0x26')](_0x136b95[_0x0960('0x1e')],['ids','id'])||{});}})['spread'](function(_0x3e0fca){logger[_0x0960('0x12')](_0x0960('0x27'),_0x136b95);logger[_0x0960('0x14')]('AddTags',_0x136b95,JSON[_0x0960('0x17')](_0x3e0fca));_0x4e8be0(_0x3e0fca);})[_0x0960('0x1b')](function(_0x185df3){logger[_0x0960('0x18')](_0x0960('0x27'),_0x185df3[_0x0960('0x1a')],_0x136b95);_0x4ea667(_this[_0x0960('0x18')](0x1f4,_0x185df3['message']));});});}; \ No newline at end of file +var _0xe2a3=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','UpdateOpenchannelInteraction','update','body','options','raw','where','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','rpc','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe2a3,0x1ad));var _0x3e2a=function(_0x6ab30c,_0x2c713b){_0x6ab30c=_0x6ab30c-0x0;var _0x36e953=_0xe2a3[_0x6ab30c];return _0x36e953;};'use strict';var _=require(_0x3e2a('0x0'));var util=require(_0x3e2a('0x1'));var moment=require('moment');var BPromise=require(_0x3e2a('0x2'));var rs=require(_0x3e2a('0x3'));var fs=require('fs');var Redis=require(_0x3e2a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e2a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e2a('0x6')][_0x3e2a('0x7')]({'port':0x232a});config[_0x3e2a('0x8')]=_['defaults'](config[_0x3e2a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e2a('0x9'))(new Redis(config[_0x3e2a('0x8')]));require(_0x3e2a('0xa'))[_0x3e2a('0xb')](socket);function respondWithRpcPromise(_0x51cbd,_0x380427,_0x25dbc2){return new BPromise(function(_0x3a683d,_0x1e18c7){return client[_0x3e2a('0xc')](_0x51cbd,_0x25dbc2)[_0x3e2a('0xd')](function(_0x204e51){logger['info'](_0x3e2a('0xe'),_0x380427,'request\x20sent');logger[_0x3e2a('0xf')](_0x3e2a('0x10'),_0x380427,_0x3e2a('0x11'),JSON[_0x3e2a('0x12')](_0x204e51));if(_0x204e51[_0x3e2a('0x13')]){if(_0x204e51['error']['code']===0x1f4){logger[_0x3e2a('0x13')](_0x3e2a('0xe'),_0x380427,_0x204e51[_0x3e2a('0x13')][_0x3e2a('0x14')]);return _0x1e18c7(_0x204e51['error'][_0x3e2a('0x14')]);}logger[_0x3e2a('0x13')](_0x3e2a('0xe'),_0x380427,_0x204e51[_0x3e2a('0x13')][_0x3e2a('0x14')]);return _0x3a683d(_0x204e51[_0x3e2a('0x13')][_0x3e2a('0x14')]);}else{logger[_0x3e2a('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x380427,'request\x20sent');_0x3a683d(_0x204e51[_0x3e2a('0x16')][_0x3e2a('0x14')]);}})['catch'](function(_0x580b66){logger[_0x3e2a('0x13')](_0x3e2a('0xe'),_0x380427,_0x580b66);_0x1e18c7(_0x580b66);});});}exports[_0x3e2a('0x17')]=function(_0x2401fc){var _0x15f880=this;return new Promise(function(_0x5aefb4,_0x1eb2cd){return db['OpenchannelInteraction'][_0x3e2a('0x18')](_0x2401fc[_0x3e2a('0x19')],{'raw':_0x2401fc[_0x3e2a('0x1a')]?_0x2401fc[_0x3e2a('0x1a')][_0x3e2a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2401fc[_0x3e2a('0x1a')]?_0x2401fc[_0x3e2a('0x1a')][_0x3e2a('0x1c')]||null:null,'attributes':_0x2401fc[_0x3e2a('0x1a')]?_0x2401fc[_0x3e2a('0x1a')]['attributes']||null:null,'limit':_0x2401fc[_0x3e2a('0x1a')]?_0x2401fc[_0x3e2a('0x1a')]['limit']||null:null})[_0x3e2a('0xd')](function(_0x2c3f6e){logger[_0x3e2a('0x15')](_0x3e2a('0x17'),_0x2401fc);logger[_0x3e2a('0xf')](_0x3e2a('0x17'),_0x2401fc,JSON[_0x3e2a('0x12')](_0x2c3f6e));_0x5aefb4(_0x2c3f6e);})[_0x3e2a('0x1d')](function(_0x38d20f){logger['error']('UpdateOpenchannelInteraction',_0x38d20f[_0x3e2a('0x14')],_0x2401fc);_0x1eb2cd(_0x15f880[_0x3e2a('0x13')](0x1f4,_0x38d20f[_0x3e2a('0x14')]));});});};exports[_0x3e2a('0x1e')]=function(_0xbc85e1){return new Promise(function(_0x5db91b,_0x172512){return db[_0x3e2a('0x1f')][_0x3e2a('0x20')]({'where':_0xbc85e1[_0x3e2a('0x1a')]?_0xbc85e1[_0x3e2a('0x1a')]['where']||null:null})['then'](function(_0xe22aed){if(_0xe22aed){return _0xe22aed[_0x3e2a('0x21')](_0xbc85e1[_0x3e2a('0x19')][_0x3e2a('0x22')],_['omit'](_0xbc85e1[_0x3e2a('0x19')],['ids','id'])||{});}})[_0x3e2a('0x23')](function(_0x28a9ac){logger['info'](_0x3e2a('0x24'),_0xbc85e1);logger[_0x3e2a('0xf')](_0x3e2a('0x24'),_0xbc85e1,JSON[_0x3e2a('0x12')](_0x28a9ac));_0x5db91b(_0x28a9ac);})['catch'](function(_0x161b56){logger['error'](_0x3e2a('0x24'),_0x161b56['message'],_0xbc85e1);_0x172512(_this['error'](0x1f4,_0x161b56[_0x3e2a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 9f154e8..660f8ab 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 _0x12bc=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x1fbeaf,_0x256fbd){var _0x13daa3=function(_0x295348){while(--_0x295348){_0x1fbeaf['push'](_0x1fbeaf['shift']());}};_0x13daa3(++_0x256fbd);}(_0x12bc,0x1ea));var _0xc12b=function(_0x5541f3,_0x266df7){_0x5541f3=_0x5541f3-0x0;var _0xe30f20=_0x12bc[_0x5541f3];return _0xe30f20;};'use strict';var OpenchannelInteractionEvents=require(_0xc12b('0x0'));var events=[_0xc12b('0x1'),_0xc12b('0x2'),_0xc12b('0x3')];function createListener(_0xce22a8,_0x16de9e){return function(_0x48fcde){_0x16de9e[_0xc12b('0x4')](_0xce22a8,_0x48fcde);};}function removeListener(_0x35d7e0,_0x4da85){return function(){OpenchannelInteractionEvents[_0xc12b('0x5')](_0x35d7e0,_0x4da85);};}exports[_0xc12b('0x6')]=function(_0x4f4a54){for(var _0x3bdcd1=0x0,_0x14a9f6=events[_0xc12b('0x7')];_0x3bdcd1<_0x14a9f6;_0x3bdcd1++){var _0x538b31=events[_0x3bdcd1];var _0x351a81=createListener(_0xc12b('0x8')+_0x538b31,_0x4f4a54);OpenchannelInteractionEvents['on'](_0x538b31,_0x351a81);}}; \ No newline at end of file +var _0x5264=['./openchannelInteraction.events','save','remove','update','emit','register','openchannelInteraction:'];(function(_0x19d8ea,_0x6d5425){var _0x565b43=function(_0x349913){while(--_0x349913){_0x19d8ea['push'](_0x19d8ea['shift']());}};_0x565b43(++_0x6d5425);}(_0x5264,0xf5));var _0x4526=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5264[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelInteractionEvents=require(_0x4526('0x0'));var events=[_0x4526('0x1'),_0x4526('0x2'),_0x4526('0x3')];function createListener(_0x37bd34,_0x4a490a){return function(_0x5832bb){_0x4a490a[_0x4526('0x4')](_0x37bd34,_0x5832bb);};}function removeListener(_0x1bc0e9,_0x4d5af4){return function(){OpenchannelInteractionEvents['removeListener'](_0x1bc0e9,_0x4d5af4);};}exports[_0x4526('0x5')]=function(_0x428341){for(var _0xd831a8=0x0,_0x424202=events['length'];_0xd831a8<_0x424202;_0xd831a8++){var _0x1bd2c7=events[_0xd831a8];var _0xa35536=createListener(_0x4526('0x6')+_0x1bd2c7,_0x428341);OpenchannelInteractionEvents['on'](_0x1bd2c7,_0xa35536);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3b95f14..ef32f3b 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x39443c,_0x25bf1f){var _0x39a016=function(_0x352fc3){while(--_0x352fc3){_0x39443c['push'](_0x39443c['shift']());}};_0x39a016(++_0x25bf1f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_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 5fe7268..6ba48ad 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 _0x3ee7=['ENUM','out','DATE','STRING','TEXT','exports','BOOLEAN'];(function(_0x11a577,_0xcfd0be){var _0xe48c08=function(_0x5bebc7){while(--_0x5bebc7){_0x11a577['push'](_0x11a577['shift']());}};_0xe48c08(++_0xcfd0be);}(_0x3ee7,0x98));var _0x73ee=function(_0x32d456,_0x44b805){_0x32d456=_0x32d456-0x0;var _0x34f70d=_0x3ee7[_0x32d456];return _0x34f70d;};'use strict';var Sequelize=require('sequelize');module[_0x73ee('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x73ee('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x73ee('0x2')]('in',_0x73ee('0x3')),'defaultValue':_0x73ee('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x73ee('0x4')]},'providerName':{'type':Sequelize[_0x73ee('0x5')]},'providerResponse':{'type':Sequelize[_0x73ee('0x6')]}}; \ No newline at end of file +var _0x282b=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x96a64a,_0x1c67ee){var _0xb5ed85=function(_0x129744){while(--_0x129744){_0x96a64a['push'](_0x96a64a['shift']());}};_0xb5ed85(++_0x1c67ee);}(_0x282b,0xec));var _0xb282=function(_0x801e09,_0x26e149){_0x801e09=_0x801e09-0x0;var _0x1c6605=_0x282b[_0x801e09];return _0x1c6605;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'body':{'type':Sequelize[_0xb282('0x2')](_0xb282('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb282('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb282('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb282('0x6')]},'providerName':{'type':Sequelize[_0xb282('0x7')]},'providerResponse':{'type':Sequelize[_0xb282('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2f6e0bb..5ab9973 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 _0x188f=['pick','filter','where','merge','VIRTUAL','options','include','includeAll','find','create','body','params','destroy','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','get','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interaction','rejectMessage','ContactId','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x188f,0x1a5));var _0xf188=function(_0x30f96,_0x42fa7d){_0x30f96=_0x30f96-0x0;var _0x1ba510=_0x188f[_0x30f96];return _0x1ba510;};'use strict';var emlformat=require(_0xf188('0x0'));var rimraf=require(_0xf188('0x1'));var zipdir=require(_0xf188('0x2'));var jsonpatch=require(_0xf188('0x3'));var rp=require(_0xf188('0x4'));var moment=require(_0xf188('0x5'));var BPromise=require(_0xf188('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf188('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf188('0x8'));var fs=require('fs');var fs_extra=require(_0xf188('0x9'));var _=require(_0xf188('0xa'));var squel=require(_0xf188('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf188('0xc'));var Papa=require(_0xf188('0xd'));var Redis=require('ioredis');var authService=require(_0xf188('0xe'));var qs=require(_0xf188('0xf'));var as=require(_0xf188('0x10'));var hardwareService=require(_0xf188('0x11'));var logger=require(_0xf188('0x12'))(_0xf188('0x13'));var utils=require(_0xf188('0x14'));var config=require(_0xf188('0x15'));var licenseUtil=require(_0xf188('0x16'));var db=require('../../mysqldb')['db'];config[_0xf188('0x17')]=_[_0xf188('0x18')](config['redis'],{'host':_0xf188('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf188('0x17')]));require(_0xf188('0x1a'))[_0xf188('0x1b')](socket);var jayson=require(_0xf188('0x1c'));var client=jayson[_0xf188('0x1d')][_0xf188('0x1e')]({'port':0x232c});var client9002=jayson[_0xf188('0x1d')][_0xf188('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x510c02,_0x14893c,_0x7fb0b,_0x284363){return new BPromise(function(_0x10cf99,_0x1c0b93){var _0x415a5f=_0x284363||client;return _0x415a5f[_0xf188('0x1f')](_0x510c02,_0x7fb0b)['then'](function(_0xbf4bbf){logger['info'](_0xf188('0x20'),_0x14893c,_0xf188('0x21'));logger['debug'](_0xf188('0x22'),_0x14893c,_0xf188('0x21'),JSON[_0xf188('0x23')](_0xbf4bbf));if(_0xbf4bbf[_0xf188('0x24')]){if(_0xbf4bbf[_0xf188('0x24')][_0xf188('0x25')]===0x1f4){logger[_0xf188('0x24')](_0xf188('0x20'),_0x14893c,_0xbf4bbf[_0xf188('0x24')][_0xf188('0x26')]);return _0x1c0b93(_0xbf4bbf['error'][_0xf188('0x26')]);}logger[_0xf188('0x24')](_0xf188('0x20'),_0x14893c,_0xbf4bbf[_0xf188('0x24')][_0xf188('0x26')]);return _0x10cf99(_0xbf4bbf['error']['message']);}else{logger[_0xf188('0x27')](_0xf188('0x20'),_0x14893c,'request\x20sent');_0x10cf99(_0xbf4bbf[_0xf188('0x28')][_0xf188('0x26')]);}})[_0xf188('0x29')](function(_0x1aacbc){logger[_0xf188('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x14893c,_0x1aacbc);_0x1c0b93(_0x1aacbc);});});}function respondWithStatusCode(_0x2d91ab,_0x2a38b7){_0x2a38b7=_0x2a38b7||0xcc;return function(_0x161b7c){if(_0x161b7c){return _0x2d91ab[_0xf188('0x2a')](_0x2a38b7);}return _0x2d91ab[_0xf188('0x2b')](_0x2a38b7)[_0xf188('0x2c')]();};}function respondWithResult(_0x318566,_0x45c62a){_0x45c62a=_0x45c62a||0xc8;return function(_0x2eeb66){if(_0x2eeb66){return _0x318566[_0xf188('0x2b')](_0x45c62a)['json'](_0x2eeb66);}};}function respondWithFilteredResult(_0x536b6b,_0x490dee){return function(_0xaeef08){if(_0xaeef08){var _0x4c1daf=typeof _0x490dee[_0xf188('0x2d')]===_0xf188('0x2e')&&typeof _0x490dee[_0xf188('0x2f')]===_0xf188('0x2e');var _0x10623f=_0xaeef08[_0xf188('0x30')];var _0xe676bb=_0x4c1daf?0x0:_0x490dee['offset'];var _0x3d8429=_0x4c1daf?_0xaeef08[_0xf188('0x30')]:_0x490dee['offset']+_0x490dee[_0xf188('0x2f')];var _0x21d45d;if(_0x3d8429>=_0x10623f){_0x3d8429=_0x10623f;_0x21d45d=0xc8;}else{_0x21d45d=0xce;}_0x536b6b[_0xf188('0x2b')](_0x21d45d);return _0x536b6b[_0xf188('0x31')]('Content-Range',_0xe676bb+'-'+_0x3d8429+'/'+_0x10623f)[_0xf188('0x32')](_0xaeef08);}return null;};}function patchUpdates(_0x2c8fff){return function(_0xcd94cf){try{jsonpatch[_0xf188('0x33')](_0xcd94cf,_0x2c8fff,!![]);}catch(_0x212e49){return BPromise[_0xf188('0x34')](_0x212e49);}return _0xcd94cf[_0xf188('0x35')]();};}function saveUpdates(_0x3f337b,_0xcf3206){return function(_0x27f1fc){if(_0x27f1fc){return _0x27f1fc['update'](_0x3f337b)[_0xf188('0x36')](function(_0x55fcd9){return _0x55fcd9;});}return null;};}function removeEntity(_0x349448,_0x36a26b){return function(_0x544d20){if(_0x544d20){return _0x544d20['destroy']()[_0xf188('0x36')](function(){_0x349448[_0xf188('0x2b')](0xcc)[_0xf188('0x2c')]();});}};}function handleEntityNotFound(_0x35df26,_0x3fb092){return function(_0x4d5cf4){if(!_0x4d5cf4){_0x35df26[_0xf188('0x2a')](0x194);}return _0x4d5cf4;};}function handleError(_0x353011,_0x4b305a){_0x4b305a=_0x4b305a||0x1f4;return function(_0x4606a0){logger[_0xf188('0x24')](_0x4606a0[_0xf188('0x37')]);if(_0x4606a0['name']){delete _0x4606a0[_0xf188('0x38')];}_0x353011[_0xf188('0x2b')](_0x4b305a)[_0xf188('0x39')](_0x4606a0);};}exports[_0xf188('0x3a')]=function(_0x44d03d,_0x160589){var _0x494624={},_0x140241={},_0x137968={'count':0x0,'rows':[]};var _0x13f665=_['map'](db[_0xf188('0x3b')][_0xf188('0x3c')],function(_0x1430d4){return{'name':_0x1430d4[_0xf188('0x3d')],'type':_0x1430d4[_0xf188('0x3e')][_0xf188('0x3f')]};});_0x140241['model']=_[_0xf188('0x40')](_0x13f665,_0xf188('0x38'));_0x140241[_0xf188('0x41')]=_[_0xf188('0x42')](_0x44d03d[_0xf188('0x41')]);_0x140241[_0xf188('0x43')]=_['intersection'](_0x140241[_0xf188('0x44')],_0x140241['query']);_0x494624[_0xf188('0x45')]=_[_0xf188('0x46')](_0x140241[_0xf188('0x44')],qs['fields'](_0x44d03d[_0xf188('0x41')][_0xf188('0x47')]));_0x494624[_0xf188('0x45')]=_0x494624[_0xf188('0x45')][_0xf188('0x48')]?_0x494624[_0xf188('0x45')]:_0x140241['model'];if(!_0x44d03d[_0xf188('0x41')][_0xf188('0x49')]('nolimit')){_0x494624[_0xf188('0x2f')]=qs['limit'](_0x44d03d[_0xf188('0x41')][_0xf188('0x2f')]);_0x494624['offset']=qs['offset'](_0x44d03d[_0xf188('0x41')][_0xf188('0x2d')]);}_0x494624['order']=qs['sort'](_0x44d03d[_0xf188('0x41')][_0xf188('0x4a')]);_0x494624['where']=qs[_0xf188('0x43')](_[_0xf188('0x4b')](_0x44d03d['query'],_0x140241[_0xf188('0x43')]),_0x13f665);if(_0x44d03d[_0xf188('0x41')][_0xf188('0x4c')]){_0x494624[_0xf188('0x4d')]=_[_0xf188('0x4e')](_0x494624[_0xf188('0x4d')],{'$or':_[_0xf188('0x40')](_0x13f665,function(_0x3a1944){if(_0x3a1944[_0xf188('0x3e')]!==_0xf188('0x4f')){var _0x34a4ec={};_0x34a4ec[_0x3a1944['name']]={'$like':'%'+_0x44d03d[_0xf188('0x41')][_0xf188('0x4c')]+'%'};return _0x34a4ec;}})});}_0x494624=_['merge']({},_0x494624,_0x44d03d[_0xf188('0x50')]);var _0x2eff34={'where':_0x494624[_0xf188('0x4d')]};return db[_0xf188('0x3b')][_0xf188('0x30')](_0x2eff34)['then'](function(_0x27d0de){_0x137968[_0xf188('0x30')]=_0x27d0de;if(_0x44d03d[_0xf188('0x41')]['includeAll']){_0x494624[_0xf188('0x51')]=[{'all':!![]}];}return db[_0xf188('0x3b')]['findAll'](_0x494624);})[_0xf188('0x36')](function(_0x1861e3){_0x137968['rows']=_0x1861e3;return _0x137968;})[_0xf188('0x36')](respondWithFilteredResult(_0x160589,_0x494624))['catch'](handleError(_0x160589,null));};exports['show']=function(_0x44489a,_0x4caff5){var _0x4dc845={'raw':!![],'where':{'id':_0x44489a['params']['id']}},_0x2536a8={};_0x2536a8[_0xf188('0x44')]=_['keys'](db[_0xf188('0x3b')]['rawAttributes']);_0x2536a8['query']=_['keys'](_0x44489a[_0xf188('0x41')]);_0x2536a8[_0xf188('0x43')]=_[_0xf188('0x46')](_0x2536a8['model'],_0x2536a8[_0xf188('0x41')]);_0x4dc845[_0xf188('0x45')]=_[_0xf188('0x46')](_0x2536a8[_0xf188('0x44')],qs[_0xf188('0x47')](_0x44489a[_0xf188('0x41')][_0xf188('0x47')]));_0x4dc845[_0xf188('0x45')]=_0x4dc845[_0xf188('0x45')]['length']?_0x4dc845[_0xf188('0x45')]:_0x2536a8[_0xf188('0x44')];if(_0x44489a[_0xf188('0x41')][_0xf188('0x52')]){_0x4dc845[_0xf188('0x51')]=[{'all':!![]}];}_0x4dc845=_[_0xf188('0x4e')]({},_0x4dc845,_0x44489a['options']);return db[_0xf188('0x3b')][_0xf188('0x53')](_0x4dc845)['then'](handleEntityNotFound(_0x4caff5,null))[_0xf188('0x36')](respondWithResult(_0x4caff5,null))['catch'](handleError(_0x4caff5,null));};exports[_0xf188('0x54')]=function(_0x2e1cb,_0x576e4a){return db[_0xf188('0x3b')]['create'](_0x2e1cb['body'],{})[_0xf188('0x36')](respondWithResult(_0x576e4a,0xc9))[_0xf188('0x29')](handleError(_0x576e4a,null));};exports['update']=function(_0x211a5e,_0x4b21b2){if(_0x211a5e[_0xf188('0x55')]['id']){delete _0x211a5e[_0xf188('0x55')]['id'];}return db[_0xf188('0x3b')][_0xf188('0x53')]({'where':{'id':_0x211a5e[_0xf188('0x56')]['id']}})[_0xf188('0x36')](handleEntityNotFound(_0x4b21b2,null))[_0xf188('0x36')](saveUpdates(_0x211a5e['body'],null))['then'](respondWithResult(_0x4b21b2,null))[_0xf188('0x29')](handleError(_0x4b21b2,null));};exports[_0xf188('0x57')]=function(_0x5a96d8,_0xe25131){return db[_0xf188('0x3b')][_0xf188('0x53')]({'where':{'id':_0x5a96d8[_0xf188('0x56')]['id']}})[_0xf188('0x36')](handleEntityNotFound(_0xe25131,null))[_0xf188('0x36')](removeEntity(_0xe25131,null))[_0xf188('0x29')](handleError(_0xe25131,null));};exports['describe']=function(_0x133ce5,_0x7fdf92){return db['OpenchannelMessage']['describe']()[_0xf188('0x36')](respondWithResult(_0x7fdf92,null))['catch'](handleError(_0x7fdf92,null));};var interaction_log=require(_0xf188('0x12'))(_0xf188('0x58'));exports[_0xf188('0x59')]=function(_0x46fb32,_0x1ef345,_0x4829bf){var _0x2da497={'agent':{},'channel':_0xf188('0x5a')};if(_0x46fb32[_0xf188('0x55')]['id']){delete _0x46fb32[_0xf188('0x55')]['id'];}_0x46fb32[_0xf188('0x55')][_0xf188('0x5b')]=!![];_0x46fb32[_0xf188('0x55')][_0xf188('0x5c')]=moment()[_0xf188('0x5d')](_0xf188('0x5e'));_0x46fb32['body']['UserId']=_0x46fb32['body'][_0xf188('0x5f')]||_0x46fb32[_0xf188('0x60')]['id'];_0x2da497[_0xf188('0x61')]['id']=_0x46fb32[_0xf188('0x55')][_0xf188('0x5f')];return db[_0xf188('0x3b')][_0xf188('0x53')]({'where':{'id':_0x46fb32[_0xf188('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ef345,null))[_0xf188('0x36')](saveUpdates(_0x46fb32['body'],null))[_0xf188('0x36')](function(_0xa00b58){if(_0xa00b58){_0x2da497['message']=_0xa00b58['get']({'plain':!![]});return db[_0xf188('0x62')][_0xf188('0x53')]({'where':{'id':_0xa00b58[_0xf188('0x63')]}});}return null;})[_0xf188('0x36')](handleEntityNotFound(_0x1ef345,null))[_0xf188('0x36')](function(_0x5d8f8e){if(_0x5d8f8e){return _0x5d8f8e['update']({'UserId':_0x46fb32[_0xf188('0x55')]['UserId'],'read1stAt':_['isNil'](_0x5d8f8e[_0xf188('0x64')])?moment()[_0xf188('0x5d')](_0xf188('0x5e')):undefined});}return null;})[_0xf188('0x36')](function(_0x3a9cbb){if(_0x3a9cbb){_0x2da497['interaction']=_0x3a9cbb[_0xf188('0x65')]({'plain':!![]});interaction_log[_0xf188('0x27')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46fb32[_0xf188('0x60')]['id'],_0x46fb32[_0xf188('0x60')][_0xf188('0x38')],_0x46fb32['user'][_0xf188('0x66')],_0x2da497['interaction']['id'],_0x46fb32[_0xf188('0x55')]?JSON['stringify'](_0x46fb32[_0xf188('0x55')]):_0xf188('0x67'));return respondWithRpcPromise('AcceptMessage',_0xf188('0x68'),_0x2da497);}return null;})[_0xf188('0x36')](function(_0x4493e1){var _0x5f0ff3=_0xf188('0x69')+_0x4493e1['message']['ContactId'];return db[_0xf188('0x6a')][_0xf188('0x41')](_0x5f0ff3,{'type':db[_0xf188('0x6b')]['QueryTypes'][_0xf188('0x6c')],'raw':!![]})['then'](function(_0x1a2892){return _0x1a2892;});})['then'](function(_0x46e216){if(_0x46e216){_0x2da497['message'][_0xf188('0x6d')]=_0x46e216[0x0];if(!_0x46fb32[_0xf188('0x55')][_0xf188('0x5f')])return;return db[_0xf188('0x6e')][_0xf188('0x53')]({'where':{'id':_0x46fb32[_0xf188('0x55')][_0xf188('0x5f')],'role':_0xf188('0x61')},'attributes':['id',_0xf188('0x38'),_0xf188('0x6f'),_0xf188('0x70'),_0xf188('0x71')],'raw':!![]});}return null;})[_0xf188('0x36')](function(_0x5dbff0){if(!_0x5dbff0)return null;_0x2da497[_0xf188('0x26')][_0xf188('0x61')]=_0x5dbff0;return _0x2da497;})[_0xf188('0x36')](function(_0x2b3d5e){if(_0x2b3d5e){if(_0x46fb32[_0xf188('0x55')]['manual']){_0x2da497[_0xf188('0x26')][_0xf188('0x72')]=util[_0xf188('0x5d')](_0xf188('0x73'),_0x46fb32[_0xf188('0x60')][_0xf188('0x38')]);_0x2da497[_0xf188('0x26')][_0xf188('0x74')]=_0x2da497[_0xf188('0x74')];_0x2da497['message'][_0xf188('0x75')]=_0x2da497[_0xf188('0x74')];_0x2da497['message']['event']='accept';return respondWithRpcPromise(_0xf188('0x76'),'EventManager',{'event':_0xf188('0x77'),'message':_0x2da497[_0xf188('0x26')]},client9002)[_0xf188('0x36')](function(){return _0x2da497;});}return _0x2da497;}return null;})['then'](respondWithResult(_0x1ef345,null))[_0xf188('0x29')](handleError(_0x1ef345,null));};var interaction_log=require(_0xf188('0x12'))('openchannel-interactions');exports[_0xf188('0x34')]=function(_0x54bc1a,_0x554f4f,_0x579d76){var _0x23682f={'agent':{},'channel':_0xf188('0x5a')};if(_0x54bc1a['body']['id']){delete _0x54bc1a[_0xf188('0x55')]['id'];}_0x54bc1a[_0xf188('0x55')]['UserId']=_0x54bc1a[_0xf188('0x55')][_0xf188('0x5f')]||_0x54bc1a[_0xf188('0x60')]['id'];_0x23682f[_0xf188('0x61')]['id']=_0x54bc1a[_0xf188('0x55')][_0xf188('0x5f')];return db['OpenchannelMessage'][_0xf188('0x53')]({'where':{'id':_0x54bc1a[_0xf188('0x56')]['id'],'UserId':null}})[_0xf188('0x36')](handleEntityNotFound(_0x554f4f,null))[_0xf188('0x36')](function(_0x3fc0ec){if(_0x3fc0ec){_0x23682f[_0xf188('0x26')]=_0x3fc0ec[_0xf188('0x65')]({'plain':!![]});return db[_0xf188('0x62')][_0xf188('0x53')]({'where':{'id':_0x3fc0ec[_0xf188('0x63')]}});}return null;})[_0xf188('0x36')](handleEntityNotFound(_0x554f4f,null))['then'](function(_0x5a4bd7){if(_0x5a4bd7){_0x23682f[_0xf188('0x78')]=_0x5a4bd7['get']({'plain':!![]});interaction_log[_0xf188('0x27')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54bc1a[_0xf188('0x60')]['id'],_0x54bc1a[_0xf188('0x60')][_0xf188('0x38')],_0x54bc1a['user']['role'],_0x23682f['interaction']['id'],_0x54bc1a['body']?JSON[_0xf188('0x23')](_0x54bc1a[_0xf188('0x55')]):_0xf188('0x67'));return respondWithRpcPromise('RejectMessage',_0xf188('0x79'),_0x23682f);}return null;})[_0xf188('0x36')](function(_0x470941){var _0x7c8fbf=_0xf188('0x69')+_0x470941[_0xf188('0x26')][_0xf188('0x7a')];return db['sequelize'][_0xf188('0x41')](_0x7c8fbf,{'type':db[_0xf188('0x6b')]['QueryTypes'][_0xf188('0x6c')],'raw':!![]})[_0xf188('0x36')](function(_0x4fd807){return _0x4fd807;});})['then'](function(_0x448646){if(_0x448646){_0x23682f[_0xf188('0x26')]['contact']=_0x448646[0x0];if(!_0x54bc1a[_0xf188('0x55')]['UserId'])return;return db[_0xf188('0x6e')][_0xf188('0x53')]({'where':{'id':_0x54bc1a['body']['UserId'],'role':_0xf188('0x61')},'attributes':['id','name',_0xf188('0x6f'),_0xf188('0x70'),_0xf188('0x71')],'raw':!![]});}return null;})['then'](function(_0x90aa2d){if(!_0x90aa2d)return null;_0x23682f[_0xf188('0x26')]['agent']=_0x90aa2d;return _0x23682f;})[_0xf188('0x36')](function(_0x155c60){if(_0x155c60){_0x155c60[_0xf188('0x26')][_0xf188('0x72')]=util['format'](_0xf188('0x73'),_0x54bc1a['user'][_0xf188('0x38')]);_0x155c60[_0xf188('0x26')]['channel']=_0x23682f[_0xf188('0x74')];_0x155c60[_0xf188('0x26')][_0xf188('0x75')]=_0x23682f[_0xf188('0x74')];_0x155c60[_0xf188('0x26')][_0xf188('0x7b')]='reject';respondWithRpcPromise(_0xf188('0x76'),_0xf188('0x76'),{'event':'rejectmessage','message':_0x155c60[_0xf188('0x26')]},client9002);return _0x23682f;}return null;})['then'](respondWithResult(_0x554f4f,null))['catch'](handleError(_0x554f4f,null));}; \ No newline at end of file +var _0x1d5f=['EventManager','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','fullname','rejectmessage','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelMessage','includeAll','findAll','rows','catch','params','keys','include','create','body','update','destroy','describe','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','find','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','agent','manual','interface','SIP/%s','channel','accept'];(function(_0x32b615,_0x2a8b55){var _0x63f41a=function(_0x152604){while(--_0x152604){_0x32b615['push'](_0x32b615['shift']());}};_0x63f41a(++_0x2a8b55);}(_0x1d5f,0x8a));var _0xf1d5=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0x1d5f[_0x2a18b7];return _0x45e74e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1d5('0x0'));var zipdir=require(_0xf1d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1d5('0x2'));var moment=require('moment');var BPromise=require(_0xf1d5('0x3'));var Mustache=require(_0xf1d5('0x4'));var util=require(_0xf1d5('0x5'));var path=require(_0xf1d5('0x6'));var sox=require(_0xf1d5('0x7'));var csv=require(_0xf1d5('0x8'));var ejs=require(_0xf1d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf1d5('0xa'));var crypto=require('crypto');var jsforce=require(_0xf1d5('0xb'));var deskjs=require(_0xf1d5('0xc'));var toCsv=require(_0xf1d5('0x8'));var querystring=require(_0xf1d5('0xd'));var Papa=require(_0xf1d5('0xe'));var Redis=require(_0xf1d5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf1d5('0x10'));var as=require(_0xf1d5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d5('0x12'))(_0xf1d5('0x13'));var utils=require(_0xf1d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf1d5('0x15'));var db=require('../../mysqldb')['db'];config[_0xf1d5('0x16')]=_[_0xf1d5('0x17')](config[_0xf1d5('0x16')],{'host':_0xf1d5('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf1d5('0x19'))[_0xf1d5('0x1a')](socket);var jayson=require(_0xf1d5('0x1b'));var client=jayson[_0xf1d5('0x1c')][_0xf1d5('0x1d')]({'port':0x232c});var client9002=jayson[_0xf1d5('0x1c')][_0xf1d5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2d1be8,_0x50b7ee,_0x2a84be,_0xc2b9e){return new BPromise(function(_0x2725e8,_0x2d9d29){var _0x1a6ebf=_0xc2b9e||client;return _0x1a6ebf[_0xf1d5('0x1e')](_0x2d1be8,_0x2a84be)[_0xf1d5('0x1f')](function(_0x1b6f27){logger[_0xf1d5('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x50b7ee,_0xf1d5('0x21'));logger[_0xf1d5('0x22')](_0xf1d5('0x23'),_0x50b7ee,'request\x20sent',JSON['stringify'](_0x1b6f27));if(_0x1b6f27[_0xf1d5('0x24')]){if(_0x1b6f27[_0xf1d5('0x24')][_0xf1d5('0x25')]===0x1f4){logger[_0xf1d5('0x24')](_0xf1d5('0x26'),_0x50b7ee,_0x1b6f27[_0xf1d5('0x24')][_0xf1d5('0x27')]);return _0x2d9d29(_0x1b6f27['error'][_0xf1d5('0x27')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x50b7ee,_0x1b6f27[_0xf1d5('0x24')]['message']);return _0x2725e8(_0x1b6f27[_0xf1d5('0x24')][_0xf1d5('0x27')]);}else{logger[_0xf1d5('0x20')](_0xf1d5('0x26'),_0x50b7ee,'request\x20sent');_0x2725e8(_0x1b6f27[_0xf1d5('0x28')]['message']);}})['catch'](function(_0x24f7b6){logger[_0xf1d5('0x24')](_0xf1d5('0x26'),_0x50b7ee,_0x24f7b6);_0x2d9d29(_0x24f7b6);});});}function respondWithStatusCode(_0x4bfc2a,_0x261043){_0x261043=_0x261043||0xcc;return function(_0x49c05d){if(_0x49c05d){return _0x4bfc2a[_0xf1d5('0x29')](_0x261043);}return _0x4bfc2a[_0xf1d5('0x2a')](_0x261043)[_0xf1d5('0x2b')]();};}function respondWithResult(_0x612720,_0x4d8b95){_0x4d8b95=_0x4d8b95||0xc8;return function(_0x44bb4b){if(_0x44bb4b){return _0x612720[_0xf1d5('0x2a')](_0x4d8b95)[_0xf1d5('0x2c')](_0x44bb4b);}};}function respondWithFilteredResult(_0x429b34,_0x18e4f0){return function(_0x37cf62){if(_0x37cf62){var _0x2b74b0=typeof _0x18e4f0['offset']===_0xf1d5('0x2d')&&typeof _0x18e4f0[_0xf1d5('0x2e')]===_0xf1d5('0x2d');var _0x273f0b=_0x37cf62[_0xf1d5('0x2f')];var _0x2a310c=_0x2b74b0?0x0:_0x18e4f0[_0xf1d5('0x30')];var _0x376191=_0x2b74b0?_0x37cf62[_0xf1d5('0x2f')]:_0x18e4f0[_0xf1d5('0x30')]+_0x18e4f0[_0xf1d5('0x2e')];var _0x79026a;if(_0x376191>=_0x273f0b){_0x376191=_0x273f0b;_0x79026a=0xc8;}else{_0x79026a=0xce;}_0x429b34['status'](_0x79026a);return _0x429b34[_0xf1d5('0x31')](_0xf1d5('0x32'),_0x2a310c+'-'+_0x376191+'/'+_0x273f0b)[_0xf1d5('0x2c')](_0x37cf62);}return null;};}function patchUpdates(_0xdff713){return function(_0x5cb09c){try{jsonpatch[_0xf1d5('0x33')](_0x5cb09c,_0xdff713,!![]);}catch(_0x4f2d36){return BPromise[_0xf1d5('0x34')](_0x4f2d36);}return _0x5cb09c[_0xf1d5('0x35')]();};}function saveUpdates(_0xd63be9,_0x5981e7){return function(_0x356649){if(_0x356649){return _0x356649['update'](_0xd63be9)[_0xf1d5('0x1f')](function(_0x4661da){return _0x4661da;});}return null;};}function removeEntity(_0x4df02,_0xd4fd4d){return function(_0x4f417e){if(_0x4f417e){return _0x4f417e['destroy']()[_0xf1d5('0x1f')](function(){_0x4df02[_0xf1d5('0x2a')](0xcc)[_0xf1d5('0x2b')]();});}};}function handleEntityNotFound(_0x301109,_0x55c691){return function(_0x219287){if(!_0x219287){_0x301109[_0xf1d5('0x29')](0x194);}return _0x219287;};}function handleError(_0x429351,_0x1cb8ed){_0x1cb8ed=_0x1cb8ed||0x1f4;return function(_0x4d5ac4){logger['error'](_0x4d5ac4[_0xf1d5('0x36')]);if(_0x4d5ac4[_0xf1d5('0x37')]){delete _0x4d5ac4[_0xf1d5('0x37')];}_0x429351['status'](_0x1cb8ed)[_0xf1d5('0x38')](_0x4d5ac4);};}exports[_0xf1d5('0x39')]=function(_0x1fea60,_0x4c61ce){var _0x4e552f={},_0x44733c={},_0x209f0f={'count':0x0,'rows':[]};var _0x2a8bcd=_[_0xf1d5('0x3a')](db['OpenchannelMessage'][_0xf1d5('0x3b')],function(_0x3ace36){return{'name':_0x3ace36[_0xf1d5('0x3c')],'type':_0x3ace36[_0xf1d5('0x3d')][_0xf1d5('0x3e')]};});_0x44733c[_0xf1d5('0x3f')]=_[_0xf1d5('0x3a')](_0x2a8bcd,_0xf1d5('0x37'));_0x44733c[_0xf1d5('0x40')]=_['keys'](_0x1fea60['query']);_0x44733c[_0xf1d5('0x41')]=_['intersection'](_0x44733c['model'],_0x44733c[_0xf1d5('0x40')]);_0x4e552f[_0xf1d5('0x42')]=_[_0xf1d5('0x43')](_0x44733c[_0xf1d5('0x3f')],qs[_0xf1d5('0x44')](_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x44')]));_0x4e552f['attributes']=_0x4e552f['attributes'][_0xf1d5('0x45')]?_0x4e552f[_0xf1d5('0x42')]:_0x44733c['model'];if(!_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x46')](_0xf1d5('0x47'))){_0x4e552f[_0xf1d5('0x2e')]=qs[_0xf1d5('0x2e')](_0x1fea60['query']['limit']);_0x4e552f[_0xf1d5('0x30')]=qs[_0xf1d5('0x30')](_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x30')]);}_0x4e552f[_0xf1d5('0x48')]=qs[_0xf1d5('0x49')](_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x49')]);_0x4e552f[_0xf1d5('0x4a')]=qs[_0xf1d5('0x41')](_[_0xf1d5('0x4b')](_0x1fea60[_0xf1d5('0x40')],_0x44733c['filters']),_0x2a8bcd);if(_0x1fea60['query']['filter']){_0x4e552f[_0xf1d5('0x4a')]=_[_0xf1d5('0x4c')](_0x4e552f[_0xf1d5('0x4a')],{'$or':_['map'](_0x2a8bcd,function(_0x4e182c){if(_0x4e182c[_0xf1d5('0x3d')]!==_0xf1d5('0x4d')){var _0xa0b005={};_0xa0b005[_0x4e182c[_0xf1d5('0x37')]]={'$like':'%'+_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x4e')]+'%'};return _0xa0b005;}})});}_0x4e552f=_[_0xf1d5('0x4c')]({},_0x4e552f,_0x1fea60[_0xf1d5('0x4f')]);var _0xbf665d={'where':_0x4e552f['where']};return db[_0xf1d5('0x50')][_0xf1d5('0x2f')](_0xbf665d)[_0xf1d5('0x1f')](function(_0x3b5d78){_0x209f0f[_0xf1d5('0x2f')]=_0x3b5d78;if(_0x1fea60[_0xf1d5('0x40')][_0xf1d5('0x51')]){_0x4e552f['include']=[{'all':!![]}];}return db[_0xf1d5('0x50')][_0xf1d5('0x52')](_0x4e552f);})['then'](function(_0x1c3f5a){_0x209f0f[_0xf1d5('0x53')]=_0x1c3f5a;return _0x209f0f;})[_0xf1d5('0x1f')](respondWithFilteredResult(_0x4c61ce,_0x4e552f))[_0xf1d5('0x54')](handleError(_0x4c61ce,null));};exports['show']=function(_0x50434a,_0x5a6156){var _0x8c3263={'raw':!![],'where':{'id':_0x50434a[_0xf1d5('0x55')]['id']}},_0x23e7a3={};_0x23e7a3[_0xf1d5('0x3f')]=_[_0xf1d5('0x56')](db['OpenchannelMessage']['rawAttributes']);_0x23e7a3['query']=_[_0xf1d5('0x56')](_0x50434a['query']);_0x23e7a3[_0xf1d5('0x41')]=_[_0xf1d5('0x43')](_0x23e7a3['model'],_0x23e7a3[_0xf1d5('0x40')]);_0x8c3263[_0xf1d5('0x42')]=_[_0xf1d5('0x43')](_0x23e7a3[_0xf1d5('0x3f')],qs[_0xf1d5('0x44')](_0x50434a[_0xf1d5('0x40')][_0xf1d5('0x44')]));_0x8c3263['attributes']=_0x8c3263['attributes'][_0xf1d5('0x45')]?_0x8c3263[_0xf1d5('0x42')]:_0x23e7a3['model'];if(_0x50434a[_0xf1d5('0x40')][_0xf1d5('0x51')]){_0x8c3263[_0xf1d5('0x57')]=[{'all':!![]}];}_0x8c3263=_['merge']({},_0x8c3263,_0x50434a[_0xf1d5('0x4f')]);return db['OpenchannelMessage']['find'](_0x8c3263)[_0xf1d5('0x1f')](handleEntityNotFound(_0x5a6156,null))[_0xf1d5('0x1f')](respondWithResult(_0x5a6156,null))[_0xf1d5('0x54')](handleError(_0x5a6156,null));};exports[_0xf1d5('0x58')]=function(_0x391170,_0x17fc5c){return db[_0xf1d5('0x50')][_0xf1d5('0x58')](_0x391170[_0xf1d5('0x59')],{})[_0xf1d5('0x1f')](respondWithResult(_0x17fc5c,0xc9))[_0xf1d5('0x54')](handleError(_0x17fc5c,null));};exports[_0xf1d5('0x5a')]=function(_0x518fbe,_0x47a0a8){if(_0x518fbe[_0xf1d5('0x59')]['id']){delete _0x518fbe[_0xf1d5('0x59')]['id'];}return db[_0xf1d5('0x50')]['find']({'where':{'id':_0x518fbe['params']['id']}})['then'](handleEntityNotFound(_0x47a0a8,null))[_0xf1d5('0x1f')](saveUpdates(_0x518fbe[_0xf1d5('0x59')],null))[_0xf1d5('0x1f')](respondWithResult(_0x47a0a8,null))['catch'](handleError(_0x47a0a8,null));};exports[_0xf1d5('0x5b')]=function(_0x245f3e,_0x1a4e65){return db[_0xf1d5('0x50')]['find']({'where':{'id':_0x245f3e['params']['id']}})[_0xf1d5('0x1f')](handleEntityNotFound(_0x1a4e65,null))[_0xf1d5('0x1f')](removeEntity(_0x1a4e65,null))['catch'](handleError(_0x1a4e65,null));};exports[_0xf1d5('0x5c')]=function(_0x7c33c,_0x3704dd){return db[_0xf1d5('0x50')][_0xf1d5('0x5c')]()['then'](respondWithResult(_0x3704dd,null))['catch'](handleError(_0x3704dd,null));};var interaction_log=require(_0xf1d5('0x12'))('openchannel-interactions');exports['accept']=function(_0x38282f,_0xb96952,_0x4c1273){var _0x596022={'agent':{},'channel':_0xf1d5('0x5d')};if(_0x38282f[_0xf1d5('0x59')]['id']){delete _0x38282f[_0xf1d5('0x59')]['id'];}_0x38282f['body']['read']=!![];_0x38282f[_0xf1d5('0x59')]['readAt']=moment()[_0xf1d5('0x5e')](_0xf1d5('0x5f'));_0x38282f[_0xf1d5('0x59')]['UserId']=_0x38282f[_0xf1d5('0x59')]['UserId']||_0x38282f['user']['id'];_0x596022['agent']['id']=_0x38282f['body'][_0xf1d5('0x60')];return db['OpenchannelMessage'][_0xf1d5('0x61')]({'where':{'id':_0x38282f[_0xf1d5('0x55')]['id'],'UserId':null}})[_0xf1d5('0x1f')](handleEntityNotFound(_0xb96952,null))[_0xf1d5('0x1f')](saveUpdates(_0x38282f[_0xf1d5('0x59')],null))[_0xf1d5('0x1f')](function(_0x30aea9){if(_0x30aea9){_0x596022[_0xf1d5('0x27')]=_0x30aea9[_0xf1d5('0x62')]({'plain':!![]});return db[_0xf1d5('0x63')]['find']({'where':{'id':_0x30aea9[_0xf1d5('0x64')]}});}return null;})['then'](handleEntityNotFound(_0xb96952,null))[_0xf1d5('0x1f')](function(_0x576241){if(_0x576241){return _0x576241[_0xf1d5('0x5a')]({'UserId':_0x38282f[_0xf1d5('0x59')]['UserId'],'read1stAt':_['isNil'](_0x576241[_0xf1d5('0x65')])?moment()['format'](_0xf1d5('0x5f')):undefined});}return null;})[_0xf1d5('0x1f')](function(_0x28571c){if(_0x28571c){_0x596022[_0xf1d5('0x66')]=_0x28571c[_0xf1d5('0x62')]({'plain':!![]});interaction_log[_0xf1d5('0x20')](_0xf1d5('0x67'),_0x38282f[_0xf1d5('0x68')]['id'],_0x38282f['user'][_0xf1d5('0x37')],_0x38282f[_0xf1d5('0x68')][_0xf1d5('0x69')],_0x596022[_0xf1d5('0x66')]['id'],_0x38282f['body']?JSON['stringify'](_0x38282f['body']):_0xf1d5('0x6a'));return respondWithRpcPromise(_0xf1d5('0x6b'),_0xf1d5('0x6c'),_0x596022);}return null;})['then'](function(_0x525935){var _0x1c4f99=_0xf1d5('0x6d')+_0x525935[_0xf1d5('0x27')][_0xf1d5('0x6e')];return db[_0xf1d5('0x6f')]['query'](_0x1c4f99,{'type':db[_0xf1d5('0x70')]['QueryTypes'][_0xf1d5('0x71')],'raw':!![]})[_0xf1d5('0x1f')](function(_0x4dc4bc){return _0x4dc4bc;});})[_0xf1d5('0x1f')](function(_0x3758dd){if(_0x3758dd){_0x596022['message'][_0xf1d5('0x72')]=_0x3758dd[0x0];if(!_0x38282f[_0xf1d5('0x59')][_0xf1d5('0x60')])return;return db[_0xf1d5('0x73')]['find']({'where':{'id':_0x38282f[_0xf1d5('0x59')][_0xf1d5('0x60')],'role':'agent'},'attributes':['id',_0xf1d5('0x37'),'fullname',_0xf1d5('0x74'),_0xf1d5('0x75')],'raw':!![]});}return null;})[_0xf1d5('0x1f')](function(_0x577e7c){if(!_0x577e7c)return null;_0x596022[_0xf1d5('0x27')][_0xf1d5('0x76')]=_0x577e7c;return _0x596022;})['then'](function(_0x5443fe){if(_0x5443fe){if(_0x38282f[_0xf1d5('0x59')][_0xf1d5('0x77')]){_0x596022[_0xf1d5('0x27')][_0xf1d5('0x78')]=util[_0xf1d5('0x5e')](_0xf1d5('0x79'),_0x38282f['user'][_0xf1d5('0x37')]);_0x596022[_0xf1d5('0x27')][_0xf1d5('0x7a')]=_0x596022[_0xf1d5('0x7a')];_0x596022[_0xf1d5('0x27')]['motionChannel']=_0x596022[_0xf1d5('0x7a')];_0x596022[_0xf1d5('0x27')]['event']=_0xf1d5('0x7b');return respondWithRpcPromise(_0xf1d5('0x7c'),_0xf1d5('0x7c'),{'event':'acceptmessage','message':_0x596022['message']},client9002)[_0xf1d5('0x1f')](function(){return _0x596022;});}return _0x596022;}return null;})[_0xf1d5('0x1f')](respondWithResult(_0xb96952,null))[_0xf1d5('0x54')](handleError(_0xb96952,null));};var interaction_log=require(_0xf1d5('0x12'))(_0xf1d5('0x7d'));exports['reject']=function(_0x2e50be,_0x5512e8,_0x4478e5){var _0x48c429={'agent':{},'channel':'openchannel'};if(_0x2e50be[_0xf1d5('0x59')]['id']){delete _0x2e50be['body']['id'];}_0x2e50be[_0xf1d5('0x59')]['UserId']=_0x2e50be[_0xf1d5('0x59')][_0xf1d5('0x60')]||_0x2e50be['user']['id'];_0x48c429['agent']['id']=_0x2e50be[_0xf1d5('0x59')]['UserId'];return db['OpenchannelMessage'][_0xf1d5('0x61')]({'where':{'id':_0x2e50be['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5512e8,null))[_0xf1d5('0x1f')](function(_0xe8d5d){if(_0xe8d5d){_0x48c429[_0xf1d5('0x27')]=_0xe8d5d[_0xf1d5('0x62')]({'plain':!![]});return db[_0xf1d5('0x63')][_0xf1d5('0x61')]({'where':{'id':_0xe8d5d[_0xf1d5('0x64')]}});}return null;})[_0xf1d5('0x1f')](handleEntityNotFound(_0x5512e8,null))[_0xf1d5('0x1f')](function(_0x4eb91e){if(_0x4eb91e){_0x48c429[_0xf1d5('0x66')]=_0x4eb91e[_0xf1d5('0x62')]({'plain':!![]});interaction_log[_0xf1d5('0x20')](_0xf1d5('0x7e'),_0x2e50be[_0xf1d5('0x68')]['id'],_0x2e50be['user'][_0xf1d5('0x37')],_0x2e50be[_0xf1d5('0x68')]['role'],_0x48c429[_0xf1d5('0x66')]['id'],_0x2e50be[_0xf1d5('0x59')]?JSON[_0xf1d5('0x7f')](_0x2e50be[_0xf1d5('0x59')]):_0xf1d5('0x6a'));return respondWithRpcPromise('RejectMessage',_0xf1d5('0x80'),_0x48c429);}return null;})[_0xf1d5('0x1f')](function(_0x54b2f2){var _0x30c3be='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54b2f2['message'][_0xf1d5('0x6e')];return db[_0xf1d5('0x6f')][_0xf1d5('0x40')](_0x30c3be,{'type':db[_0xf1d5('0x70')]['QueryTypes'][_0xf1d5('0x71')],'raw':!![]})[_0xf1d5('0x1f')](function(_0x55a716){return _0x55a716;});})[_0xf1d5('0x1f')](function(_0x179ff7){if(_0x179ff7){_0x48c429[_0xf1d5('0x27')][_0xf1d5('0x72')]=_0x179ff7[0x0];if(!_0x2e50be[_0xf1d5('0x59')]['UserId'])return;return db['User'][_0xf1d5('0x61')]({'where':{'id':_0x2e50be[_0xf1d5('0x59')][_0xf1d5('0x60')],'role':_0xf1d5('0x76')},'attributes':['id',_0xf1d5('0x37'),_0xf1d5('0x81'),_0xf1d5('0x74'),_0xf1d5('0x75')],'raw':!![]});}return null;})[_0xf1d5('0x1f')](function(_0x4db5de){if(!_0x4db5de)return null;_0x48c429[_0xf1d5('0x27')]['agent']=_0x4db5de;return _0x48c429;})[_0xf1d5('0x1f')](function(_0x2918f2){if(_0x2918f2){_0x2918f2['message']['interface']=util[_0xf1d5('0x5e')](_0xf1d5('0x79'),_0x2e50be[_0xf1d5('0x68')]['name']);_0x2918f2['message'][_0xf1d5('0x7a')]=_0x48c429[_0xf1d5('0x7a')];_0x2918f2['message']['motionChannel']=_0x48c429['channel'];_0x2918f2['message']['event']=_0xf1d5('0x34');respondWithRpcPromise(_0xf1d5('0x7c'),_0xf1d5('0x7c'),{'event':_0xf1d5('0x82'),'message':_0x2918f2[_0xf1d5('0x27')]},client9002);return _0x48c429;}return null;})[_0xf1d5('0x1f')](respondWithResult(_0x5512e8,null))[_0xf1d5('0x54')](handleError(_0x5512e8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f45363e..eb63851 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 _0xe458=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x280ff0,_0x5969c4){var _0x3494b6=function(_0x839e59){while(--_0x839e59){_0x280ff0['push'](_0x280ff0['shift']());}};_0x3494b6(++_0x5969c4);}(_0xe458,0x6c));var _0x8e45=function(_0x272f6b,_0x592336){_0x272f6b=_0x272f6b-0x0;var _0x4deb3b=_0xe458[_0x272f6b];return _0x4deb3b;};'use strict';var EventEmitter=require(_0x8e45('0x0'));var OpenchannelMessage=require(_0x8e45('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8e45('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e45('0x3'),'afterDestroy':_0x8e45('0x4')};function emitEvent(_0x942c83){return function(_0x236d56,_0x517d7e,_0x499820){OpenchannelMessageEvents['emit'](_0x942c83+':'+_0x236d56['id'],_0x236d56);OpenchannelMessageEvents[_0x8e45('0x5')](_0x942c83,_0x236d56);_0x499820(null);};}for(var e in events){if(events[_0x8e45('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8e45('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x8f7a=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x9388c8,_0x2cdf84){var _0x6f1d3a=function(_0x6a3073){while(--_0x6a3073){_0x9388c8['push'](_0x9388c8['shift']());}};_0x6f1d3a(++_0x2cdf84);}(_0x8f7a,0xc7));var _0xa8f7=function(_0x1604b0,_0x48d196){_0x1604b0=_0x1604b0-0x0;var _0xf7ee7e=_0x8f7a[_0x1604b0];return _0xf7ee7e;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xa8f7('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa8f7('0x1')](0x0);var events={'afterCreate':_0xa8f7('0x2'),'afterUpdate':_0xa8f7('0x3'),'afterDestroy':_0xa8f7('0x4')};function emitEvent(_0x4a87e2){return function(_0x3ec3c2,_0x5c6007,_0x12dfd9){OpenchannelMessageEvents[_0xa8f7('0x5')](_0x4a87e2+':'+_0x3ec3c2['id'],_0x3ec3c2);OpenchannelMessageEvents[_0xa8f7('0x5')](_0x4a87e2,_0x3ec3c2);_0x12dfd9(null);};}for(var e in events){if(events[_0xa8f7('0x6')](e)){var event=events[e];OpenchannelMessage[_0xa8f7('0x7')](e,emitEvent(event));}}module[_0xa8f7('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 8d42361..1785baa 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 _0x1a85=['openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','OpenchannelMessage'];(function(_0x4531ce,_0x45026c){var _0x2505f0=function(_0x3d744c){while(--_0x3d744c){_0x4531ce['push'](_0x4531ce['shift']());}};_0x2505f0(++_0x45026c);}(_0x1a85,0x178));var _0x51a8=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x1a85[_0xa2049b];return _0x2fd615;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x51a8('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56e1b4,_0x39e06a,_0x2f276b){var _0x1a476d=_0x4b76a8[_0x51a8('0xa')];var _0x418f06=_0x56e1b4[_0x51a8('0xb')]({'plain':!![]});if(_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()==='in'||_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]&&!_[_0x51a8('0x10')](_0x418f06[_0x51a8('0x11')])){_0x1a476d[_0x51a8('0x12')][_0x51a8('0x13')]({'where':{'id':_0x418f06[_0x51a8('0x14')]}})['then'](function(_0x461f5c){if(_0x461f5c){_0x461f5c[_0x51a8('0x15')]({'lastMsgAt':_0x418f06[_0x51a8('0x16')],'lastMsgDirection':_0x418f06['direction'][_0x51a8('0xd')]()});}})['catch'](function(_0x10584b){console[_0x51a8('0x17')](_0x10584b);});}if(_0x418f06[_0x51a8('0xc')]===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]){var _0x3e0603;_0x1a476d[_0x51a8('0x18')]['describe']()[_0x51a8('0x19')](function(_0x45a433){return _0x1a476d[_0x51a8('0x1a')][_0x51a8('0x1b')]({'where':{'id':_0x418f06[_0x51a8('0x1c')]},'include':[{'model':_0x1a476d[_0x51a8('0x12')],'as':'Interactions','where':{'id':_0x418f06[_0x51a8('0x14')]},'limit':0x1,'include':[{'model':_0x1a476d[_0x51a8('0x18')],'as':_0x51a8('0x1d'),'attributes':_[_0x51a8('0x1e')](_0x45a433)}]}]});})[_0x51a8('0x19')](function(_0x3bc044){_0x3e0603=_0x3bc044[_0x51a8('0xb')]({'plain':!![]});if(_0x3e0603&&_0x3e0603[_0x51a8('0x1f')]){logger['info'](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x21')](_0x51a8('0x22'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0x3e0603[_0x51a8('0x23')]&&_0x3e0603['Interactions'][_0x51a8('0x24')]){_0x418f06['Interaction']=_['omit'](_0x3e0603[_0x51a8('0x23')][0x0],'Contact');_0x418f06[_0x51a8('0x1d')]=_0x3e0603[_0x51a8('0x23')][0x0][_0x51a8('0x1d')];}var _0x39e06a={'method':_0x51a8('0x25'),'uri':encodeURI(_0x3e0603[_0x51a8('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x39e06a[_0x51a8('0x26')]){case _0x51a8('0x27'):_0x39e06a['qs']=_0x418f06;break;case'POST':_0x39e06a[_0x51a8('0x9')]=_0x418f06;break;}return rp(_0x39e06a)[_0x51a8('0x19')](function(_0xca5746){logger[_0x51a8('0x28')](_0x51a8('0x20'),_0x51a8('0x29'),util[_0x51a8('0x21')](_0x51a8('0x2a'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]&&_0xca5746[_0x51a8('0x9')]['threadId']!=_0x418f06[_0x51a8('0x2c')]['threadId']){return _0x1a476d[_0x51a8('0x12')][_0x51a8('0x15')]({'threadId':_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]},{'logging':!![],'where':{'id':_0x418f06[_0x51a8('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x56e1b4[_0x51a8('0x15')]({'read':!![]});})['catch'](function(_0x41c4de){logger[_0x51a8('0x17')](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x2d')](_0x41c4de,{'showHidden':![],'depth':null}));_0x2f276b();});}else{_0x2f276b();}})['finally'](function(){_0x2f276b();});}else{_0x2f276b();}}},'charset':_0x51a8('0x2e'),'collate':_0x51a8('0x2f')});}; \ No newline at end of file +var _0xb7e7=['../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','then','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','method','GET','POST','OpenchannelMessage,\x20%s,\x20%s','threadId','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x4f2c61,_0x694f45){var _0xd80185=function(_0x28723f){while(--_0x28723f){_0x4f2c61['push'](_0x4f2c61['shift']());}};_0xd80185(++_0x694f45);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0xa')],'type':_0x7b7e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1647e5,_0x148964,_0x26bb8d){var _0x242e70=_0x53ed64['models'];var _0x299519=_0x1647e5[_0x7b7e('0xc')]({'plain':!![]});if(_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()==='in'||_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()===_0x7b7e('0xf')&&!_0x299519[_0x7b7e('0x10')]&&!_[_0x7b7e('0x11')](_0x299519['UserId'])){_0x242e70[_0x7b7e('0x12')][_0x7b7e('0x13')]({'where':{'id':_0x299519['OpenchannelInteractionId']}})[_0x7b7e('0x14')](function(_0x5976ac){if(_0x5976ac){_0x5976ac['update']({'lastMsgAt':_0x299519[_0x7b7e('0x15')],'lastMsgDirection':_0x299519[_0x7b7e('0xd')][_0x7b7e('0xe')]()});}})[_0x7b7e('0x16')](function(_0x3d2fb2){console['error'](_0x3d2fb2);});}if(_0x299519['direction']===_0x7b7e('0xf')&&!_0x299519[_0x7b7e('0x10')]){var _0x27f999;_0x242e70[_0x7b7e('0x17')][_0x7b7e('0x18')]()[_0x7b7e('0x14')](function(_0x242368){return _0x242e70[_0x7b7e('0x19')][_0x7b7e('0x1a')]({'where':{'id':_0x299519[_0x7b7e('0x1b')]},'include':[{'model':_0x242e70[_0x7b7e('0x12')],'as':_0x7b7e('0x1c'),'where':{'id':_0x299519[_0x7b7e('0x1d')]},'limit':0x1,'include':[{'model':_0x242e70[_0x7b7e('0x17')],'as':_0x7b7e('0x1e'),'attributes':_[_0x7b7e('0x1f')](_0x242368)}]}]});})[_0x7b7e('0x14')](function(_0x49eddb){_0x27f999=_0x49eddb[_0x7b7e('0xc')]({'plain':!![]});if(_0x27f999&&_0x27f999[_0x7b7e('0x20')]){logger[_0x7b7e('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x7b7e('0x22'),util[_0x7b7e('0x23')](_0x7b7e('0x24'),_0x299519['id'],_0x27f999[_0x7b7e('0x20')]));if(_0x27f999[_0x7b7e('0x1c')]&&_0x27f999[_0x7b7e('0x1c')][_0x7b7e('0x25')]){_0x299519[_0x7b7e('0x26')]=_['omit'](_0x27f999['Interactions'][0x0],'Contact');_0x299519[_0x7b7e('0x1e')]=_0x27f999[_0x7b7e('0x1c')][0x0][_0x7b7e('0x1e')];}var _0x148964={'method':'POST','uri':encodeURI(_0x27f999['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x148964[_0x7b7e('0x27')]){case _0x7b7e('0x28'):_0x148964['qs']=_0x299519;break;case _0x7b7e('0x29'):_0x148964[_0x7b7e('0xa')]=_0x299519;break;}return rp(_0x148964)[_0x7b7e('0x14')](function(_0x48fad1){logger[_0x7b7e('0x21')](_0x7b7e('0x2a'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x299519['id'],_0x27f999[_0x7b7e('0x20')]));if(_0x48fad1[_0x7b7e('0xa')]['threadId']&&_0x48fad1[_0x7b7e('0xa')]['threadId']!=_0x299519[_0x7b7e('0x26')][_0x7b7e('0x2b')]){return _0x242e70[_0x7b7e('0x12')]['update']({'threadId':_0x48fad1[_0x7b7e('0xa')][_0x7b7e('0x2b')]},{'logging':!![],'where':{'id':_0x299519[_0x7b7e('0x26')]['id']}});}else{return;}})[_0x7b7e('0x14')](function(){return _0x1647e5[_0x7b7e('0x2c')]({'read':!![]});})['catch'](function(_0x41af57){logger['error'](_0x7b7e('0x2a'),_0x7b7e('0x22'),util[_0x7b7e('0x2d')](_0x41af57,{'showHidden':![],'depth':null}));_0x26bb8d();});}else{_0x26bb8d();}})[_0x7b7e('0x2e')](function(){_0x26bb8d();});}else{_0x26bb8d();}}},'charset':_0x7b7e('0x2f'),'collate':_0x7b7e('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6a3f0cf..3ffe0c2 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x208d39,_0x318d89){var _0x3e4f4b=function(_0xade65b){while(--_0xade65b){_0x208d39['push'](_0x208d39['shift']());}};_0x3e4f4b(++_0x318d89);}(_0x1261,0x144));var _0x1126=function(_0x26659f,_0x32f426){_0x26659f=_0x26659f-0x0;var _0x42667f=_0x1261[_0x26659f];return _0x42667f;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +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(_0x25938d,_0x4b88de){var _0x1a6c00=function(_0x5e0c5b){while(--_0x5e0c5b){_0x25938d['push'](_0x25938d['shift']());}};_0x1a6c00(++_0x4b88de);}(_0x7a54,0x106));var _0x47a5=function(_0x797883,_0x504d3f){_0x797883=_0x797883-0x0;var _0x471283=_0x7a54[_0x797883];return _0x471283;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 5deb811..8b1a221 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 _0x278f=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener'];(function(_0x51d4bd,_0x347b82){var _0x760d10=function(_0x3d9006){while(--_0x3d9006){_0x51d4bd['push'](_0x51d4bd['shift']());}};_0x760d10(++_0x347b82);}(_0x278f,0x12b));var _0xf278=function(_0xe8bada,_0x214fa0){_0xe8bada=_0xe8bada-0x0;var _0x16977a=_0x278f[_0xe8bada];return _0x16977a;};'use strict';var OpenchannelMessageEvents=require(_0xf278('0x0'));var events=[_0xf278('0x1'),'remove',_0xf278('0x2')];function createListener(_0x5188ff,_0x1807d9){return function(_0x4334ec){_0x1807d9[_0xf278('0x3')](_0x5188ff,_0x4334ec);};}function removeListener(_0x2fe4f2,_0x37e217){return function(){OpenchannelMessageEvents[_0xf278('0x4')](_0x2fe4f2,_0x37e217);};}exports[_0xf278('0x5')]=function(_0x4dfe3f){for(var _0x27c658=0x0,_0x89e73e=events[_0xf278('0x6')];_0x27c658<_0x89e73e;_0x27c658++){var _0x2ace34=events[_0x27c658];var _0x5b5a6f=createListener(_0xf278('0x7')+_0x2ace34,_0x4dfe3f);OpenchannelMessageEvents['on'](_0x2ace34,_0x5b5a6f);}}; \ No newline at end of file +var _0xbc5a=['register','length','openchannelMessage:','save','remove','update','emit','removeListener'];(function(_0x56e063,_0x453233){var _0x766fcf=function(_0x59415a){while(--_0x59415a){_0x56e063['push'](_0x56e063['shift']());}};_0x766fcf(++_0x453233);}(_0xbc5a,0x193));var _0xabc5=function(_0x35a9a7,_0x5e8c7f){_0x35a9a7=_0x35a9a7-0x0;var _0x142c13=_0xbc5a[_0x35a9a7];return _0x142c13;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xabc5('0x0'),_0xabc5('0x1'),_0xabc5('0x2')];function createListener(_0x4c8331,_0x53ea6f){return function(_0x4b00aa){_0x53ea6f[_0xabc5('0x3')](_0x4c8331,_0x4b00aa);};}function removeListener(_0x585158,_0x10493d){return function(){OpenchannelMessageEvents[_0xabc5('0x4')](_0x585158,_0x10493d);};}exports[_0xabc5('0x5')]=function(_0x398341){for(var _0x4cc38c=0x0,_0x46546d=events[_0xabc5('0x6')];_0x4cc38c<_0x46546d;_0x4cc38c++){var _0x4822aa=events[_0x4cc38c];var _0x5deb67=createListener(_0xabc5('0x7')+_0x4822aa,_0x398341);OpenchannelMessageEvents['on'](_0x4822aa,_0x5deb67);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 68abaa7..4164783 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 _0xfa50=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x3194bb,_0x294f71){var _0x5d9ce0=function(_0x54a0b4){while(--_0x54a0b4){_0x3194bb['push'](_0x3194bb['shift']());}};_0x5d9ce0(++_0x294f71);}(_0xfa50,0x1ce));var _0x0fa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0fa5('0x0'));var util=require(_0x0fa5('0x1'));var path=require(_0x0fa5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0fa5('0x3'));var router=express[_0x0fa5('0x4')]();var fs_extra=require(_0x0fa5('0x5'));var auth=require(_0x0fa5('0x6'));var interaction=require(_0x0fa5('0x7'));var config=require(_0x0fa5('0x8'));var controller=require(_0x0fa5('0x9'));router[_0x0fa5('0xa')]('/',auth[_0x0fa5('0xb')](),controller[_0x0fa5('0xc')]);router[_0x0fa5('0xa')](_0x0fa5('0xd'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0xe')]);router['get'](_0x0fa5('0xf'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x10')]);router[_0x0fa5('0xa')](_0x0fa5('0x11'),auth['isAuthenticated'](),controller[_0x0fa5('0x12')]);router[_0x0fa5('0xa')](_0x0fa5('0x13'),auth['isAuthenticated'](),controller[_0x0fa5('0x14')]);router['get'](_0x0fa5('0x15'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x16')]);router['post']('/',auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x17')]);router[_0x0fa5('0x18')](_0x0fa5('0x13'),auth[_0x0fa5('0xb')](),controller['addTeams']);router['post'](_0x0fa5('0x15'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x19')]);router[_0x0fa5('0x1a')](_0x0fa5('0xf'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x1b')]);router[_0x0fa5('0x1c')](_0x0fa5('0xf'),auth['isAuthenticated'](),controller[_0x0fa5('0x1d')]);router[_0x0fa5('0x1c')](_0x0fa5('0x13'),auth[_0x0fa5('0xb')](),controller[_0x0fa5('0x1e')]);router[_0x0fa5('0x1c')]('/:id/users',auth[_0x0fa5('0xb')](),controller['removeAgents']);module[_0x0fa5('0x1f')]=router; \ No newline at end of file +var _0xc65b=['getMembers','/:id/teams','getTeams','getAgents','post','/:id/users','addAgents','update','destroy','removeTeams','delete','removeAgents','exports','util','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc65b,0x136));var _0xbc65=function(_0x460358,_0x45d45e){_0x460358=_0x460358-0x0;var _0x2e6a60=_0xc65b[_0x460358];return _0x2e6a60;};'use strict';var multer=require('multer');var util=require(_0xbc65('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc65('0x1'));var router=express[_0xbc65('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc65('0x3'));var config=require(_0xbc65('0x4'));var controller=require(_0xbc65('0x5'));router[_0xbc65('0x6')]('/',auth[_0xbc65('0x7')](),controller[_0xbc65('0x8')]);router[_0xbc65('0x6')](_0xbc65('0x9'),auth[_0xbc65('0x7')](),controller[_0xbc65('0xa')]);router['get'](_0xbc65('0xb'),auth[_0xbc65('0x7')](),controller[_0xbc65('0xc')]);router[_0xbc65('0x6')](_0xbc65('0xd'),auth['isAuthenticated'](),controller[_0xbc65('0xe')]);router[_0xbc65('0x6')](_0xbc65('0xf'),auth[_0xbc65('0x7')](),controller[_0xbc65('0x10')]);router[_0xbc65('0x6')]('/:id/users',auth[_0xbc65('0x7')](),controller[_0xbc65('0x11')]);router[_0xbc65('0x12')]('/',auth[_0xbc65('0x7')](),controller['create']);router[_0xbc65('0x12')]('/:id/teams',auth[_0xbc65('0x7')](),controller['addTeams']);router[_0xbc65('0x12')](_0xbc65('0x13'),auth['isAuthenticated'](),controller[_0xbc65('0x14')]);router['put'](_0xbc65('0xb'),auth[_0xbc65('0x7')](),controller[_0xbc65('0x15')]);router['delete'](_0xbc65('0xb'),auth[_0xbc65('0x7')](),controller[_0xbc65('0x16')]);router['delete'](_0xbc65('0xf'),auth[_0xbc65('0x7')](),controller[_0xbc65('0x17')]);router[_0xbc65('0x18')](_0xbc65('0x13'),auth[_0xbc65('0x7')](),controller[_0xbc65('0x19')]);module[_0xbc65('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index ffc4cc9..c89f945 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 _0xe6ef=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x48397f,_0x378caa){var _0x2cfe6b=function(_0x499ef5){while(--_0x499ef5){_0x48397f['push'](_0x48397f['shift']());}};_0x2cfe6b(++_0x378caa);}(_0xe6ef,0x113));var _0xfe6e=function(_0x1dece9,_0x2cd405){_0x1dece9=_0x1dece9-0x0;var _0x449378=_0xe6ef[_0x1dece9];return _0x449378;};'use strict';var Sequelize=require(_0xfe6e('0x0'));module[_0xfe6e('0x1')]={'name':{'type':Sequelize[_0xfe6e('0x2')],'unique':_0xfe6e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfe6e('0x2')]},'timeout':{'type':Sequelize[_0xfe6e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfe6e('0x5')](_0xfe6e('0x6'),_0xfe6e('0x7'),_0xfe6e('0x8'))}}; \ No newline at end of file +var _0x0a00=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x5a6578,_0x2b3915){var _0x5ebfdf=function(_0x1956ea){while(--_0x1956ea){_0x5a6578['push'](_0x5a6578['shift']());}};_0x5ebfdf(++_0x2b3915);}(_0x0a00,0x1b6));var _0x00a0=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x0a00[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x00a0('0x0'));module['exports']={'name':{'type':Sequelize[_0x00a0('0x1')],'unique':_0x00a0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x00a0('0x3')](_0x00a0('0x4'),_0x00a0('0x5'),_0x00a0('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0bb80fc..d5b9fbd 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 _0x4b6c=['addTeams','ids','Agents','online','interface','flatMap','sequelize','each','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','describe','getMembers','findOne','UserOpenchannelQueue','sort','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','%s/%s','SIP','createdAt','Team','order','getTeams'];(function(_0x509771,_0x3b6a5d){var _0x1ed8fe=function(_0x23d971){while(--_0x23d971){_0x509771['push'](_0x509771['shift']());}};_0x1ed8fe(++_0x3b6a5d);}(_0x4b6c,0xad));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc4b6('0x0'));var rimraf=require(_0xc4b6('0x1'));var zipdir=require(_0xc4b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4b6('0x3'));var moment=require(_0xc4b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4b6('0x5'));var util=require(_0xc4b6('0x6'));var path=require(_0xc4b6('0x7'));var sox=require(_0xc4b6('0x8'));var csv=require('to-csv');var ejs=require(_0xc4b6('0x9'));var fs=require('fs');var fs_extra=require(_0xc4b6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc4b6('0xb'));var deskjs=require(_0xc4b6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4b6('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc4b6('0xe'));var hardwareService=require(_0xc4b6('0xf'));var logger=require(_0xc4b6('0x10'))(_0xc4b6('0x11'));var utils=require('../../config/utils');var config=require(_0xc4b6('0x12'));var licenseUtil=require(_0xc4b6('0x13'));var db=require(_0xc4b6('0x14'))['db'];config[_0xc4b6('0x15')]=_['defaults'](config[_0xc4b6('0x15')],{'host':_0xc4b6('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4b6('0x15')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x290d5d,_0x25bff3){_0x25bff3=_0x25bff3||0xcc;return function(_0x3dbe29){if(_0x3dbe29){return _0x290d5d[_0xc4b6('0x17')](_0x25bff3);}return _0x290d5d[_0xc4b6('0x18')](_0x25bff3)[_0xc4b6('0x19')]();};}function respondWithResult(_0x35a423,_0x4a4411){_0x4a4411=_0x4a4411||0xc8;return function(_0x1afd2f){if(_0x1afd2f){return _0x35a423['status'](_0x4a4411)[_0xc4b6('0x1a')](_0x1afd2f);}};}function respondWithFilteredResult(_0x1a17ba,_0x292b20){return function(_0xd36b20){if(_0xd36b20){var _0x4afee8=typeof _0x292b20[_0xc4b6('0x1b')]===_0xc4b6('0x1c')&&typeof _0x292b20[_0xc4b6('0x1d')]===_0xc4b6('0x1c');var _0x5098f5=_0xd36b20[_0xc4b6('0x1e')];var _0x2385ab=_0x4afee8?0x0:_0x292b20['offset'];var _0x210ede=_0x4afee8?_0xd36b20['count']:_0x292b20['offset']+_0x292b20[_0xc4b6('0x1d')];var _0x2b86a8;if(_0x210ede>=_0x5098f5){_0x210ede=_0x5098f5;_0x2b86a8=0xc8;}else{_0x2b86a8=0xce;}_0x1a17ba[_0xc4b6('0x18')](_0x2b86a8);return _0x1a17ba[_0xc4b6('0x1f')](_0xc4b6('0x20'),_0x2385ab+'-'+_0x210ede+'/'+_0x5098f5)['json'](_0xd36b20);}return null;};}function patchUpdates(_0x15c256){return function(_0x5a3b2d){try{jsonpatch['apply'](_0x5a3b2d,_0x15c256,!![]);}catch(_0x2c230b){return BPromise['reject'](_0x2c230b);}return _0x5a3b2d['save']();};}function saveUpdates(_0x7e7775,_0x222ab3){return function(_0x4c5f21){if(_0x4c5f21){return _0x4c5f21[_0xc4b6('0x21')](_0x7e7775)[_0xc4b6('0x22')](function(_0x427bc1){return _0x427bc1;});}return null;};}function removeEntity(_0x316e85,_0x3da38a){return function(_0x37c4b7){if(_0x37c4b7){return _0x37c4b7[_0xc4b6('0x23')]()['then'](function(){var _0x4d94aa=_0x37c4b7[_0xc4b6('0x24')]({'plain':!![]});var _0x5ac25e=_0xc4b6('0x25');return db[_0xc4b6('0x26')]['destroy']({'where':{'type':_0x5ac25e,'resourceId':_0x4d94aa['id']}})[_0xc4b6('0x22')](function(){return _0x37c4b7;});})['then'](function(){_0x316e85[_0xc4b6('0x18')](0xcc)[_0xc4b6('0x19')]();});}};}function handleEntityNotFound(_0x1972ee,_0x2398e1){return function(_0x1e81fd){if(!_0x1e81fd){_0x1972ee['sendStatus'](0x194);}return _0x1e81fd;};}function handleError(_0x37f0f4,_0x7b0b9b){_0x7b0b9b=_0x7b0b9b||0x1f4;return function(_0xdfe868){logger[_0xc4b6('0x27')](_0xdfe868[_0xc4b6('0x28')]);if(_0xdfe868[_0xc4b6('0x29')]){delete _0xdfe868[_0xc4b6('0x29')];}_0x37f0f4[_0xc4b6('0x18')](_0x7b0b9b)[_0xc4b6('0x2a')](_0xdfe868);};}exports['index']=function(_0x21290e,_0x165d62){var _0x3100e1={},_0x35ed02={},_0x497980={'count':0x0,'rows':[]};var _0x1f24dc=_[_0xc4b6('0x2b')](db[_0xc4b6('0x2c')][_0xc4b6('0x2d')],function(_0x5ad644){return{'name':_0x5ad644[_0xc4b6('0x2e')],'type':_0x5ad644[_0xc4b6('0x2f')][_0xc4b6('0x30')]};});_0x35ed02[_0xc4b6('0x31')]=_['map'](_0x1f24dc,_0xc4b6('0x29'));_0x35ed02[_0xc4b6('0x32')]=_[_0xc4b6('0x33')](_0x21290e[_0xc4b6('0x32')]);_0x35ed02['filters']=_[_0xc4b6('0x34')](_0x35ed02[_0xc4b6('0x31')],_0x35ed02[_0xc4b6('0x32')]);_0x3100e1[_0xc4b6('0x35')]=_['intersection'](_0x35ed02[_0xc4b6('0x31')],qs[_0xc4b6('0x36')](_0x21290e[_0xc4b6('0x32')][_0xc4b6('0x36')]));_0x3100e1[_0xc4b6('0x35')]=_0x3100e1[_0xc4b6('0x35')][_0xc4b6('0x37')]?_0x3100e1[_0xc4b6('0x35')]:_0x35ed02[_0xc4b6('0x31')];if(!_0x21290e[_0xc4b6('0x32')][_0xc4b6('0x38')]('nolimit')){_0x3100e1[_0xc4b6('0x1d')]=qs[_0xc4b6('0x1d')](_0x21290e[_0xc4b6('0x32')]['limit']);_0x3100e1[_0xc4b6('0x1b')]=qs['offset'](_0x21290e['query'][_0xc4b6('0x1b')]);}_0x3100e1['order']=qs['sort'](_0x21290e['query']['sort']);_0x3100e1[_0xc4b6('0x39')]=qs[_0xc4b6('0x3a')](_[_0xc4b6('0x3b')](_0x21290e['query'],_0x35ed02[_0xc4b6('0x3a')]),_0x1f24dc);if(_0x21290e[_0xc4b6('0x32')][_0xc4b6('0x3c')]){_0x3100e1[_0xc4b6('0x39')]=_[_0xc4b6('0x3d')](_0x3100e1[_0xc4b6('0x39')],{'$or':_['map'](_0x1f24dc,function(_0x18bb48){if(_0x18bb48['type']!==_0xc4b6('0x3e')){var _0x58cf86={};_0x58cf86[_0x18bb48['name']]={'$like':'%'+_0x21290e[_0xc4b6('0x32')]['filter']+'%'};return _0x58cf86;}})});}_0x3100e1=_[_0xc4b6('0x3d')]({},_0x3100e1,_0x21290e['options']);var _0x15edbc={'where':_0x3100e1[_0xc4b6('0x39')]};return db[_0xc4b6('0x2c')][_0xc4b6('0x1e')](_0x15edbc)[_0xc4b6('0x22')](function(_0x9f2661){_0x497980[_0xc4b6('0x1e')]=_0x9f2661;if(_0x21290e[_0xc4b6('0x32')][_0xc4b6('0x3f')]){_0x3100e1[_0xc4b6('0x40')]=[{'all':!![]}];}return db[_0xc4b6('0x2c')][_0xc4b6('0x41')](_0x3100e1);})[_0xc4b6('0x22')](function(_0x5a849c){_0x497980[_0xc4b6('0x42')]=_0x5a849c;return _0x497980;})[_0xc4b6('0x22')](respondWithFilteredResult(_0x165d62,_0x3100e1))['catch'](handleError(_0x165d62,null));};exports[_0xc4b6('0x43')]=function(_0x3f111e,_0x3cbcd2){var _0x30023b={'raw':!![],'where':{'id':_0x3f111e[_0xc4b6('0x44')]['id']}},_0x4cd4f1={};_0x4cd4f1[_0xc4b6('0x31')]=_[_0xc4b6('0x33')](db[_0xc4b6('0x2c')]['rawAttributes']);_0x4cd4f1[_0xc4b6('0x32')]=_['keys'](_0x3f111e[_0xc4b6('0x32')]);_0x4cd4f1[_0xc4b6('0x3a')]=_['intersection'](_0x4cd4f1[_0xc4b6('0x31')],_0x4cd4f1[_0xc4b6('0x32')]);_0x30023b[_0xc4b6('0x35')]=_[_0xc4b6('0x34')](_0x4cd4f1[_0xc4b6('0x31')],qs['fields'](_0x3f111e[_0xc4b6('0x32')][_0xc4b6('0x36')]));_0x30023b['attributes']=_0x30023b[_0xc4b6('0x35')]['length']?_0x30023b[_0xc4b6('0x35')]:_0x4cd4f1['model'];if(_0x3f111e[_0xc4b6('0x32')][_0xc4b6('0x3f')]){_0x30023b['include']=[{'all':!![]}];}_0x30023b=_[_0xc4b6('0x3d')]({},_0x30023b,_0x3f111e[_0xc4b6('0x45')]);return db[_0xc4b6('0x2c')][_0xc4b6('0x46')](_0x30023b)[_0xc4b6('0x22')](handleEntityNotFound(_0x3cbcd2,null))[_0xc4b6('0x22')](respondWithResult(_0x3cbcd2,null))[_0xc4b6('0x47')](handleError(_0x3cbcd2,null));};exports['create']=function(_0x4e0cd9,_0x45142b){return db[_0xc4b6('0x2c')][_0xc4b6('0x48')](_0x4e0cd9['body'],{})['then'](function(_0x4a8b4a){var _0x40007f=_0x4e0cd9[_0xc4b6('0x49')][_0xc4b6('0x24')]({'plain':!![]});if(!_0x40007f)throw new Error(_0xc4b6('0x4a'));if(_0x40007f['role']===_0xc4b6('0x49')){var _0x261ba5=_0x4a8b4a[_0xc4b6('0x24')]({'plain':!![]});var _0x4f6cdf=_0xc4b6('0x25');return db[_0xc4b6('0x4b')][_0xc4b6('0x46')]({'where':{'name':_0x4f6cdf,'userProfileId':_0x40007f['userProfileId']},'raw':!![]})[_0xc4b6('0x22')](function(_0x21d1fd){if(_0x21d1fd&&_0x21d1fd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x261ba5['name'],'resourceId':_0x261ba5['id'],'type':_0x21d1fd['name'],'sectionId':_0x21d1fd['id']},{})['then'](function(){return _0x4a8b4a;});}else{return _0x4a8b4a;}})[_0xc4b6('0x47')](function(_0x662135){logger[_0xc4b6('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x662135);throw _0x662135;});}return _0x4a8b4a;})[_0xc4b6('0x22')](respondWithResult(_0x45142b,0xc9))['catch'](handleError(_0x45142b,null));};exports[_0xc4b6('0x21')]=function(_0x8f61b3,_0x2375cd){if(_0x8f61b3[_0xc4b6('0x4c')]['id']){delete _0x8f61b3[_0xc4b6('0x4c')]['id'];}return db[_0xc4b6('0x2c')][_0xc4b6('0x46')]({'where':{'id':_0x8f61b3[_0xc4b6('0x44')]['id']}})[_0xc4b6('0x22')](handleEntityNotFound(_0x2375cd,null))[_0xc4b6('0x22')](saveUpdates(_0x8f61b3[_0xc4b6('0x4c')],null))['then'](respondWithResult(_0x2375cd,null))[_0xc4b6('0x47')](handleError(_0x2375cd,null));};exports[_0xc4b6('0x23')]=function(_0x5ce13d,_0x2df898){return db['OpenchannelQueue'][_0xc4b6('0x46')]({'where':{'id':_0x5ce13d[_0xc4b6('0x44')]['id']}})[_0xc4b6('0x22')](handleEntityNotFound(_0x2df898,null))[_0xc4b6('0x22')](removeEntity(_0x2df898,null))[_0xc4b6('0x47')](handleError(_0x2df898,null));};exports[_0xc4b6('0x4d')]=function(_0x4cbdcb,_0x5e8531){return db[_0xc4b6('0x2c')][_0xc4b6('0x4d')]()[_0xc4b6('0x22')](respondWithResult(_0x5e8531,null))['catch'](handleError(_0x5e8531,null));};exports[_0xc4b6('0x4e')]=function(_0x57c943,_0x18f8e2,_0x25836a){var _0x3b79ac={'raw':!![],'where':{}},_0x489e76={},_0x4fc400;return db['OpenchannelQueue'][_0xc4b6('0x4f')]({'where':{'id':_0x57c943[_0xc4b6('0x44')]['id']}})[_0xc4b6('0x22')](handleEntityNotFound(_0x18f8e2,null))[_0xc4b6('0x22')](function(_0x51dca2){if(_0x51dca2){_0x4fc400=_0x51dca2[_0xc4b6('0x24')]({'plain':!![]});_0x489e76[_0xc4b6('0x31')]=_[_0xc4b6('0x33')](db[_0xc4b6('0x50')][_0xc4b6('0x2d')]);_0x489e76[_0xc4b6('0x32')]=_['keys'](_0x57c943['query']);_0x489e76[_0xc4b6('0x3a')]=_['intersection'](_0x489e76[_0xc4b6('0x31')],_0x489e76[_0xc4b6('0x32')]);_0x3b79ac[_0xc4b6('0x35')]=_[_0xc4b6('0x34')](_0x489e76['model'],qs[_0xc4b6('0x36')](_0x57c943[_0xc4b6('0x32')][_0xc4b6('0x36')]));_0x3b79ac[_0xc4b6('0x35')]=_0x3b79ac[_0xc4b6('0x35')][_0xc4b6('0x37')]?_0x3b79ac['attributes']:_0x489e76[_0xc4b6('0x31')];if(!_0x57c943[_0xc4b6('0x32')]['hasOwnProperty']('nolimit')){_0x3b79ac[_0xc4b6('0x1d')]=qs[_0xc4b6('0x1d')](_0x57c943[_0xc4b6('0x32')]['limit']);_0x3b79ac[_0xc4b6('0x1b')]=qs['offset'](_0x57c943[_0xc4b6('0x32')][_0xc4b6('0x1b')]);}_0x3b79ac['order']=qs[_0xc4b6('0x51')](_0x57c943[_0xc4b6('0x32')]['sort']);_0x3b79ac[_0xc4b6('0x39')]=qs['filters'](_[_0xc4b6('0x3b')](_0x57c943[_0xc4b6('0x32')],_0x489e76[_0xc4b6('0x3a')]));_0x3b79ac[_0xc4b6('0x39')][_0xc4b6('0x52')]=_0x51dca2['id'];if(_0x57c943[_0xc4b6('0x32')][_0xc4b6('0x3c')]){_0x3b79ac[_0xc4b6('0x39')]=_[_0xc4b6('0x3d')](_0x3b79ac['where'],{'$or':_[_0xc4b6('0x2b')](_0x3b79ac[_0xc4b6('0x35')],function(_0x42d512){var _0x31b0b6={};_0x31b0b6[_0x42d512]={'$like':'%'+_0x57c943[_0xc4b6('0x32')][_0xc4b6('0x3c')]+'%'};return _0x31b0b6;})});}_0x3b79ac=_[_0xc4b6('0x3d')]({},_0x3b79ac,_0x57c943[_0xc4b6('0x45')]);return db[_0xc4b6('0x50')][_0xc4b6('0x41')](_0x3b79ac);}})[_0xc4b6('0x22')](function(_0x13847a){if(_0x13847a){return db[_0xc4b6('0x53')][_0xc4b6('0x54')]({'where':{'id':_[_0xc4b6('0x2b')](_0x13847a,_0xc4b6('0x55')),'role':_0xc4b6('0x56')},'attributes':['id','name',_0xc4b6('0x57'),_0xc4b6('0x58'),'createdAt']});}})[_0xc4b6('0x22')](function(_0x3a9677){if(_0x3a9677){return{'count':_0x3a9677['count'],'rows':_[_0xc4b6('0x2b')](_0x3a9677[_0xc4b6('0x42')],function(_0x5ac48c){return{'membername':_0x5ac48c['name'],'UserId':_0x5ac48c['id'],'queue_name':_0x4fc400[_0xc4b6('0x29')],'OpenchannelQueueId':_0x4fc400['id'],'interface':util['format'](_0xc4b6('0x59'),_0xc4b6('0x5a'),_0x5ac48c[_0xc4b6('0x29')]),'penalty':0x0,'paused':_0x5ac48c[_0xc4b6('0x57')],'createdAt':_0x5ac48c[_0xc4b6('0x5b')],'updatedAt':_0x5ac48c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc4b6('0x22')](respondWithFilteredResult(_0x18f8e2,_0x3b79ac))['catch'](handleError(_0x18f8e2,null));};exports['getTeams']=function(_0x14341d,_0x2f6c79,_0x5cc349){var _0x211bf6={};var _0x38960c={};var _0x318814;var _0x21bc3d;return db[_0xc4b6('0x2c')][_0xc4b6('0x4f')]({'where':{'id':_0x14341d['params']['id']}})['then'](handleEntityNotFound(_0x2f6c79,null))['then'](function(_0x36833b){if(_0x36833b){_0x318814=_0x36833b;_0x38960c[_0xc4b6('0x31')]=_[_0xc4b6('0x33')](db[_0xc4b6('0x5c')][_0xc4b6('0x2d')]);_0x38960c[_0xc4b6('0x32')]=_[_0xc4b6('0x33')](_0x14341d[_0xc4b6('0x32')]);_0x38960c['filters']=_[_0xc4b6('0x34')](_0x38960c[_0xc4b6('0x31')],_0x38960c[_0xc4b6('0x32')]);_0x211bf6[_0xc4b6('0x35')]=_[_0xc4b6('0x34')](_0x38960c[_0xc4b6('0x31')],qs['fields'](_0x14341d[_0xc4b6('0x32')][_0xc4b6('0x36')]));_0x211bf6[_0xc4b6('0x35')]=_0x211bf6[_0xc4b6('0x35')]['length']?_0x211bf6['attributes']:_0x38960c[_0xc4b6('0x31')];_0x211bf6[_0xc4b6('0x5d')]=qs[_0xc4b6('0x51')](_0x14341d[_0xc4b6('0x32')][_0xc4b6('0x51')]);_0x211bf6[_0xc4b6('0x39')]=qs[_0xc4b6('0x3a')](_[_0xc4b6('0x3b')](_0x14341d[_0xc4b6('0x32')],_0x38960c['filters']));if(_0x14341d[_0xc4b6('0x32')][_0xc4b6('0x3c')]){_0x211bf6[_0xc4b6('0x39')]=_[_0xc4b6('0x3d')](_0x211bf6[_0xc4b6('0x39')],{'$or':_[_0xc4b6('0x2b')](_0x211bf6[_0xc4b6('0x35')],function(_0x15763a){var _0x4e3492={};_0x4e3492[_0x15763a]={'$like':'%'+_0x14341d[_0xc4b6('0x32')][_0xc4b6('0x3c')]+'%'};return _0x4e3492;})});}_0x211bf6=_[_0xc4b6('0x3d')]({},_0x211bf6,_0x14341d[_0xc4b6('0x45')]);return _0x318814[_0xc4b6('0x5e')](_0x211bf6);}})[_0xc4b6('0x22')](function(_0x4656e4){if(_0x4656e4){_0x21bc3d=_0x4656e4['length'];if(!_0x14341d[_0xc4b6('0x32')]['hasOwnProperty']('nolimit')){_0x211bf6['limit']=qs['limit'](_0x14341d['query'][_0xc4b6('0x1d')]);_0x211bf6[_0xc4b6('0x1b')]=qs['offset'](_0x14341d[_0xc4b6('0x32')]['offset']);}return _0x318814['getTeams'](_0x211bf6);}})[_0xc4b6('0x22')](function(_0x1ae2c1){if(_0x1ae2c1){return _0x1ae2c1?{'count':_0x21bc3d,'rows':_0x1ae2c1}:null;}})['then'](respondWithResult(_0x2f6c79,null))[_0xc4b6('0x47')](handleError(_0x2f6c79,null));};exports[_0xc4b6('0x5f')]=function(_0x582527,_0x3acd7d,_0x55ef11){var _0xe8f111=_0x582527['body'][_0xc4b6('0x60')];return db['Team'][_0xc4b6('0x41')]({'where':{'id':_0xe8f111},'attributes':['id'],'include':[{'model':db[_0xc4b6('0x53')],'as':_0xc4b6('0x61'),'attributes':['id','name',_0xc4b6('0x62'),'voicePause',_0xc4b6('0x63')],'raw':!![]}]})[_0xc4b6('0x22')](function(_0x4ed447){if(_0x4ed447){var _0x5d0afd=_[_0xc4b6('0x64')](_0x4ed447,function(_0x2ebcde){var _0x119af0=_0x2ebcde['get']({'plain':!![]});return _0x119af0[_0xc4b6('0x61')];});return db[_0xc4b6('0x2c')][_0xc4b6('0x46')]({'where':{'id':_0x582527[_0xc4b6('0x44')]['id']}})[_0xc4b6('0x22')](function(_0xb1f735){return db[_0xc4b6('0x65')]['transaction'](function(_0x4a7846){return _0xb1f735[_0xc4b6('0x5f')](_0xe8f111,{'transaction':_0x4a7846})[_0xc4b6('0x22')](function(){return BPromise[_0xc4b6('0x66')](_0x5d0afd,function(_0x189e09){return db[_0xc4b6('0x50')]['findOrCreate']({'where':{'UserId':_0x189e09['id'],'OpenchannelQueueId':_0x582527[_0xc4b6('0x44')]['id']},'transaction':_0x4a7846});});})[_0xc4b6('0x22')](function(){_0x5d0afd[_0xc4b6('0x67')](function(_0x1dfe66){socket[_0xc4b6('0x68')](_0xc4b6('0x69'),{'UserId':_0x1dfe66['id'],'OpenchannelQueueId':_0xb1f735['id']});});});});});}})[_0xc4b6('0x22')](respondWithStatusCode(_0x3acd7d,null))[_0xc4b6('0x47')](handleError(_0x3acd7d,null));};exports['removeTeams']=function(_0x76aa7b,_0x5c9711,_0x349305){return db[_0xc4b6('0x5c')][_0xc4b6('0x41')]({'where':{'id':_0x76aa7b[_0xc4b6('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc4b6('0x53')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc4b6('0x22')](handleEntityNotFound(_0x5c9711,null))[_0xc4b6('0x22')](function(_0x5973e7){var _0x978809=_[_0xc4b6('0x2b')](_0x5973e7,'id');var _0x1fb424=[];var _0x12ee15=[];var _0x2fa801=squel[_0xc4b6('0x6a')]();_0x2fa801[_0xc4b6('0x6b')](_0xc4b6('0x6c'))[_0xc4b6('0x6d')](_0xc4b6('0x6e'),'tq')[_0xc4b6('0x6f')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc4b6('0x39')](_0xc4b6('0x70'),_0x76aa7b['params']['id']);for(var _0x12fa7d=0x0;_0x12fa7d<_0x5973e7['length'];_0x12fa7d+=0x1){let _0x1c7785=_0x5973e7[_0x12fa7d];for(var _0x1a39e8=0x0;_0x1a39e8<_0x1c7785[_0xc4b6('0x61')][_0xc4b6('0x37')];_0x1a39e8+=0x1){let _0x544377=_0x1c7785['Agents'][_0x1a39e8];var _0x56c228=_0x2fa801[_0xc4b6('0x71')]();_0x56c228[_0xc4b6('0x39')](_0xc4b6('0x72'),_0x544377['id']);_0x12ee15[_0xc4b6('0x73')](db[_0xc4b6('0x65')]['query'](_0x56c228['toString'](),{'type':db[_0xc4b6('0x65')][_0xc4b6('0x74')][_0xc4b6('0x75')]})[_0xc4b6('0x22')](function(_0x185487){if(_0x185487[_0xc4b6('0x37')]===0x1){return _0x544377['id'];}else{var _0x2d4c2c=_[_0xc4b6('0x76')](_['map'](_0x185487,'TeamId'),function(_0x4ceafc){return _[_0xc4b6('0x77')](_0x978809,_0x4ceafc);});if(_0x2d4c2c){return _0x544377['id'];}}}));}}return BPromise[_0xc4b6('0x78')](_0x12ee15)[_0xc4b6('0x22')](function(_0x417512){_0x1fb424=_(_0x1fb424)[_0xc4b6('0x79')](_0x417512)[_0xc4b6('0x7a')]()[_0xc4b6('0x7b')]();return db[_0xc4b6('0x2c')][_0xc4b6('0x46')]({'where':{'id':_0x76aa7b[_0xc4b6('0x44')]['id']}})['then'](function(_0x8c6b7){return db['sequelize'][_0xc4b6('0x7c')](function(_0x27345d){return _0x8c6b7[_0xc4b6('0x7d')](_0x76aa7b[_0xc4b6('0x32')][_0xc4b6('0x60')],{'transaction':_0x27345d})[_0xc4b6('0x22')](function(){if(!_[_0xc4b6('0x7e')](_0x1fb424)){return _0x8c6b7['removeAgents'](_0x1fb424,{'transaction':_0x27345d});}})[_0xc4b6('0x22')](function(){_0x1fb424[_0xc4b6('0x67')](function(_0x713647){socket[_0xc4b6('0x68')](_0xc4b6('0x7f'),{'UserId':_0x713647,'OpenchannelQueueId':_0x8c6b7['id']});});});});});});})[_0xc4b6('0x22')](respondWithStatusCode(_0x5c9711,null))['catch'](handleError(_0x5c9711,null));};exports['addAgents']=function(_0xdbeae,_0x4ff4af,_0x1d0e7d){return db[_0xc4b6('0x2c')][_0xc4b6('0x46')]({'where':{'id':_0xdbeae[_0xc4b6('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ff4af,null))[_0xc4b6('0x22')](function(_0x211169){if(_0x211169){return _0x211169[_0xc4b6('0x80')](_0xdbeae['body'][_0xc4b6('0x60')],_[_0xc4b6('0x81')](_0xdbeae[_0xc4b6('0x4c')],[_0xc4b6('0x60'),'id'])||{})[_0xc4b6('0x82')](function(_0x23b7b5){for(var _0x54d7e3=0x0;_0x54d7e3<_0xdbeae['body']['ids']['length'];_0x54d7e3+=0x1){socket[_0xc4b6('0x68')](_0xc4b6('0x69'),{'UserId':Number(_0xdbeae[_0xc4b6('0x4c')][_0xc4b6('0x60')][_0x54d7e3]),'OpenchannelQueueId':Number(_0xdbeae[_0xc4b6('0x44')]['id'])});}return _0x23b7b5;});}})[_0xc4b6('0x22')](respondWithResult(_0x4ff4af,null))[_0xc4b6('0x47')](handleError(_0x4ff4af,null));};exports[_0xc4b6('0x83')]=function(_0xd0cc75,_0xee45ac,_0x10cc46){return db[_0xc4b6('0x2c')][_0xc4b6('0x46')]({'where':{'id':_0xd0cc75[_0xc4b6('0x44')]['id']}})['then'](handleEntityNotFound(_0xee45ac,null))['then'](function(_0x3e4836){if(_0x3e4836){return _0x3e4836[_0xc4b6('0x83')](_0xd0cc75[_0xc4b6('0x32')][_0xc4b6('0x60')])[_0xc4b6('0x22')](function(){if(_[_0xc4b6('0x84')](_0xd0cc75[_0xc4b6('0x32')]['ids'])){for(var _0x45595a=0x0;_0x45595a<_0xd0cc75[_0xc4b6('0x32')]['ids'][_0xc4b6('0x37')];_0x45595a+=0x1){socket[_0xc4b6('0x68')](_0xc4b6('0x7f'),{'UserId':Number(_0xd0cc75[_0xc4b6('0x32')][_0xc4b6('0x60')][_0x45595a]),'OpenchannelQueueId':Number(_0xd0cc75[_0xc4b6('0x44')]['id'])});}}else{socket[_0xc4b6('0x68')](_0xc4b6('0x7f'),{'UserId':Number(_0xd0cc75['query'][_0xc4b6('0x60')]),'OpenchannelQueueId':Number(_0xd0cc75[_0xc4b6('0x44')]['id'])});}});}})[_0xc4b6('0x22')](respondWithStatusCode(_0xee45ac,null))[_0xc4b6('0x47')](handleError(_0xee45ac,null));};exports[_0xc4b6('0x85')]=function(_0x2b89dd,_0x3147a0,_0x2d3fd7){var _0x83ac82={};var _0x354ca5={};var _0x5dc468;var _0x607995;return db[_0xc4b6('0x2c')]['findOne']({'where':{'id':_0x2b89dd[_0xc4b6('0x44')]['id']}})['then'](handleEntityNotFound(_0x3147a0,null))[_0xc4b6('0x22')](function(_0x36edfa){if(_0x36edfa){_0x5dc468=_0x36edfa;_0x354ca5[_0xc4b6('0x31')]=_[_0xc4b6('0x33')](db[_0xc4b6('0x53')][_0xc4b6('0x2d')]);_0x354ca5['query']=_[_0xc4b6('0x33')](_0x2b89dd['query']);_0x354ca5[_0xc4b6('0x3a')]=_[_0xc4b6('0x34')](_0x354ca5[_0xc4b6('0x31')],_0x354ca5[_0xc4b6('0x32')]);_0x83ac82[_0xc4b6('0x35')]=_[_0xc4b6('0x34')](_0x354ca5[_0xc4b6('0x31')],qs[_0xc4b6('0x36')](_0x2b89dd['query'][_0xc4b6('0x36')]));_0x83ac82[_0xc4b6('0x35')]=_0x83ac82[_0xc4b6('0x35')][_0xc4b6('0x37')]?_0x83ac82[_0xc4b6('0x35')]:_0x354ca5[_0xc4b6('0x31')];_0x83ac82[_0xc4b6('0x5d')]=qs[_0xc4b6('0x51')](_0x2b89dd[_0xc4b6('0x32')][_0xc4b6('0x51')]);_0x83ac82[_0xc4b6('0x39')]=qs[_0xc4b6('0x3a')](_[_0xc4b6('0x3b')](_0x2b89dd['query'],_0x354ca5[_0xc4b6('0x3a')]));if(_0x2b89dd[_0xc4b6('0x32')]['filter']){_0x83ac82['where']=_[_0xc4b6('0x3d')](_0x83ac82[_0xc4b6('0x39')],{'$or':_[_0xc4b6('0x2b')](_0x83ac82['attributes'],function(_0x251b5e){var _0x53645f={};_0x53645f[_0x251b5e]={'$like':'%'+_0x2b89dd[_0xc4b6('0x32')][_0xc4b6('0x3c')]+'%'};return _0x53645f;})});}_0x83ac82=_[_0xc4b6('0x3d')]({},_0x83ac82,_0x2b89dd['options']);return _0x5dc468[_0xc4b6('0x85')](_0x83ac82);}})[_0xc4b6('0x22')](function(_0x398677){if(_0x398677){_0x607995=_0x398677[_0xc4b6('0x37')];if(!_0x2b89dd[_0xc4b6('0x32')][_0xc4b6('0x38')]('nolimit')){_0x83ac82[_0xc4b6('0x1d')]=qs['limit'](_0x2b89dd[_0xc4b6('0x32')]['limit']);_0x83ac82[_0xc4b6('0x1b')]=qs[_0xc4b6('0x1b')](_0x2b89dd[_0xc4b6('0x32')][_0xc4b6('0x1b')]);}return _0x5dc468[_0xc4b6('0x85')](_0x83ac82);}})[_0xc4b6('0x22')](function(_0x237350){if(_0x237350){return _0x237350?{'count':_0x607995,'rows':_0x237350}:null;}})[_0xc4b6('0x22')](respondWithResult(_0x3147a0,null))[_0xc4b6('0x47')](handleError(_0x3147a0,null));}; \ No newline at end of file +var _0x5077=['ids','online','flatMap','Agents','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','send','index','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','nolimit','order','sort','where','merge','map','name','options','OpenchannelQueue','count','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','rows','format','updatedAt','getTeams','findOne','Team','filter','hasOwnProperty','addTeams'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0x5077,0xb2));var _0x7507=function(_0x51fc8e,_0x264367){_0x51fc8e=_0x51fc8e-0x0;var _0x121276=_0x5077[_0x51fc8e];return _0x121276;};'use strict';var emlformat=require(_0x7507('0x0'));var rimraf=require(_0x7507('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7507('0x2'));var rp=require(_0x7507('0x3'));var moment=require(_0x7507('0x4'));var BPromise=require(_0x7507('0x5'));var Mustache=require(_0x7507('0x6'));var util=require(_0x7507('0x7'));var path=require(_0x7507('0x8'));var sox=require('sox');var csv=require(_0x7507('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7507('0xa'));var _=require(_0x7507('0xb'));var squel=require(_0x7507('0xc'));var crypto=require(_0x7507('0xd'));var jsforce=require(_0x7507('0xe'));var deskjs=require(_0x7507('0xf'));var toCsv=require(_0x7507('0x9'));var querystring=require(_0x7507('0x10'));var Papa=require(_0x7507('0x11'));var Redis=require(_0x7507('0x12'));var authService=require(_0x7507('0x13'));var qs=require(_0x7507('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7507('0x15'));var logger=require('../../config/logger')(_0x7507('0x16'));var utils=require(_0x7507('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7507('0x18'));var db=require(_0x7507('0x19'))['db'];config[_0x7507('0x1a')]=_[_0x7507('0x1b')](config[_0x7507('0x1a')],{'host':_0x7507('0x1c'),'port':0x18eb});var socket=require(_0x7507('0x1d'))(new Redis(config['redis']));require(_0x7507('0x1e'))[_0x7507('0x1f')](socket);function respondWithStatusCode(_0x39b5b1,_0x50fb66){_0x50fb66=_0x50fb66||0xcc;return function(_0x28e042){if(_0x28e042){return _0x39b5b1[_0x7507('0x20')](_0x50fb66);}return _0x39b5b1[_0x7507('0x21')](_0x50fb66)[_0x7507('0x22')]();};}function respondWithResult(_0x5490c8,_0x1ca2ba){_0x1ca2ba=_0x1ca2ba||0xc8;return function(_0x53f8e4){if(_0x53f8e4){return _0x5490c8[_0x7507('0x21')](_0x1ca2ba)[_0x7507('0x23')](_0x53f8e4);}};}function respondWithFilteredResult(_0x2ed811,_0x346bbf){return function(_0x12107f){if(_0x12107f){var _0x30892a=typeof _0x346bbf[_0x7507('0x24')]===_0x7507('0x25')&&typeof _0x346bbf[_0x7507('0x26')]==='undefined';var _0x299676=_0x12107f['count'];var _0x492057=_0x30892a?0x0:_0x346bbf['offset'];var _0x4020b3=_0x30892a?_0x12107f['count']:_0x346bbf[_0x7507('0x24')]+_0x346bbf[_0x7507('0x26')];var _0x421eb0;if(_0x4020b3>=_0x299676){_0x4020b3=_0x299676;_0x421eb0=0xc8;}else{_0x421eb0=0xce;}_0x2ed811['status'](_0x421eb0);return _0x2ed811[_0x7507('0x27')](_0x7507('0x28'),_0x492057+'-'+_0x4020b3+'/'+_0x299676)['json'](_0x12107f);}return null;};}function patchUpdates(_0x2ead78){return function(_0x6a5b7b){try{jsonpatch[_0x7507('0x29')](_0x6a5b7b,_0x2ead78,!![]);}catch(_0x2dc51d){return BPromise[_0x7507('0x2a')](_0x2dc51d);}return _0x6a5b7b[_0x7507('0x2b')]();};}function saveUpdates(_0x118259,_0x2b2e6d){return function(_0x1d6070){if(_0x1d6070){return _0x1d6070[_0x7507('0x2c')](_0x118259)[_0x7507('0x2d')](function(_0x58f699){return _0x58f699;});}return null;};}function removeEntity(_0x38820a,_0x4ea117){return function(_0x2bf7a3){if(_0x2bf7a3){return _0x2bf7a3['destroy']()[_0x7507('0x2d')](function(){var _0x25722c=_0x2bf7a3[_0x7507('0x2e')]({'plain':!![]});var _0x78cdf0=_0x7507('0x2f');return db[_0x7507('0x30')][_0x7507('0x31')]({'where':{'type':_0x78cdf0,'resourceId':_0x25722c['id']}})['then'](function(){return _0x2bf7a3;});})[_0x7507('0x2d')](function(){_0x38820a['status'](0xcc)[_0x7507('0x22')]();});}};}function handleEntityNotFound(_0xb14722,_0xac2e6c){return function(_0x30f1d6){if(!_0x30f1d6){_0xb14722[_0x7507('0x20')](0x194);}return _0x30f1d6;};}function handleError(_0x37b158,_0x540792){_0x540792=_0x540792||0x1f4;return function(_0xc98cc9){logger[_0x7507('0x32')](_0xc98cc9[_0x7507('0x33')]);if(_0xc98cc9['name']){delete _0xc98cc9['name'];}_0x37b158[_0x7507('0x21')](_0x540792)[_0x7507('0x34')](_0xc98cc9);};}exports[_0x7507('0x35')]=function(_0x4c6d0e,_0x43b163){var _0x120d63={},_0x211bb4={},_0x9d08aa={'count':0x0,'rows':[]};var _0x560abf=_['map'](db['OpenchannelQueue'][_0x7507('0x36')],function(_0x416817){return{'name':_0x416817[_0x7507('0x37')],'type':_0x416817[_0x7507('0x38')]['key']};});_0x211bb4[_0x7507('0x39')]=_['map'](_0x560abf,'name');_0x211bb4[_0x7507('0x3a')]=_['keys'](_0x4c6d0e[_0x7507('0x3a')]);_0x211bb4[_0x7507('0x3b')]=_['intersection'](_0x211bb4[_0x7507('0x39')],_0x211bb4['query']);_0x120d63[_0x7507('0x3c')]=_['intersection'](_0x211bb4['model'],qs[_0x7507('0x3d')](_0x4c6d0e['query'][_0x7507('0x3d')]));_0x120d63[_0x7507('0x3c')]=_0x120d63[_0x7507('0x3c')][_0x7507('0x3e')]?_0x120d63[_0x7507('0x3c')]:_0x211bb4[_0x7507('0x39')];if(!_0x4c6d0e[_0x7507('0x3a')]['hasOwnProperty'](_0x7507('0x3f'))){_0x120d63[_0x7507('0x26')]=qs['limit'](_0x4c6d0e[_0x7507('0x3a')]['limit']);_0x120d63[_0x7507('0x24')]=qs['offset'](_0x4c6d0e[_0x7507('0x3a')][_0x7507('0x24')]);}_0x120d63[_0x7507('0x40')]=qs[_0x7507('0x41')](_0x4c6d0e[_0x7507('0x3a')][_0x7507('0x41')]);_0x120d63[_0x7507('0x42')]=qs['filters'](_['pick'](_0x4c6d0e[_0x7507('0x3a')],_0x211bb4[_0x7507('0x3b')]),_0x560abf);if(_0x4c6d0e[_0x7507('0x3a')]['filter']){_0x120d63[_0x7507('0x42')]=_[_0x7507('0x43')](_0x120d63[_0x7507('0x42')],{'$or':_[_0x7507('0x44')](_0x560abf,function(_0x5b3035){if(_0x5b3035[_0x7507('0x38')]!=='VIRTUAL'){var _0x5f5ac9={};_0x5f5ac9[_0x5b3035[_0x7507('0x45')]]={'$like':'%'+_0x4c6d0e[_0x7507('0x3a')]['filter']+'%'};return _0x5f5ac9;}})});}_0x120d63=_[_0x7507('0x43')]({},_0x120d63,_0x4c6d0e[_0x7507('0x46')]);var _0x4cdeca={'where':_0x120d63[_0x7507('0x42')]};return db[_0x7507('0x47')]['count'](_0x4cdeca)[_0x7507('0x2d')](function(_0x10ee1c){_0x9d08aa[_0x7507('0x48')]=_0x10ee1c;if(_0x4c6d0e[_0x7507('0x3a')][_0x7507('0x49')]){_0x120d63[_0x7507('0x4a')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x7507('0x4b')](_0x120d63);})[_0x7507('0x2d')](function(_0x1f9970){_0x9d08aa['rows']=_0x1f9970;return _0x9d08aa;})[_0x7507('0x2d')](respondWithFilteredResult(_0x43b163,_0x120d63))[_0x7507('0x4c')](handleError(_0x43b163,null));};exports[_0x7507('0x4d')]=function(_0x50dc9b,_0xdf075){var _0x2f12a5={'raw':!![],'where':{'id':_0x50dc9b[_0x7507('0x4e')]['id']}},_0x5c9c56={};_0x5c9c56[_0x7507('0x39')]=_[_0x7507('0x4f')](db[_0x7507('0x47')][_0x7507('0x36')]);_0x5c9c56['query']=_[_0x7507('0x4f')](_0x50dc9b['query']);_0x5c9c56[_0x7507('0x3b')]=_[_0x7507('0x50')](_0x5c9c56['model'],_0x5c9c56['query']);_0x2f12a5[_0x7507('0x3c')]=_[_0x7507('0x50')](_0x5c9c56['model'],qs['fields'](_0x50dc9b['query'][_0x7507('0x3d')]));_0x2f12a5[_0x7507('0x3c')]=_0x2f12a5[_0x7507('0x3c')][_0x7507('0x3e')]?_0x2f12a5[_0x7507('0x3c')]:_0x5c9c56[_0x7507('0x39')];if(_0x50dc9b['query'][_0x7507('0x49')]){_0x2f12a5[_0x7507('0x4a')]=[{'all':!![]}];}_0x2f12a5=_[_0x7507('0x43')]({},_0x2f12a5,_0x50dc9b['options']);return db[_0x7507('0x47')][_0x7507('0x51')](_0x2f12a5)[_0x7507('0x2d')](handleEntityNotFound(_0xdf075,null))[_0x7507('0x2d')](respondWithResult(_0xdf075,null))[_0x7507('0x4c')](handleError(_0xdf075,null));};exports[_0x7507('0x52')]=function(_0x15a995,_0x406640){return db['OpenchannelQueue'][_0x7507('0x52')](_0x15a995['body'],{})['then'](function(_0x1fc955){var _0x2fe1a6=_0x15a995[_0x7507('0x53')]['get']({'plain':!![]});if(!_0x2fe1a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fe1a6['role']===_0x7507('0x53')){var _0x4c55a4=_0x1fc955[_0x7507('0x2e')]({'plain':!![]});var _0x1543fa=_0x7507('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x1543fa,'userProfileId':_0x2fe1a6['userProfileId']},'raw':!![]})[_0x7507('0x2d')](function(_0x48cee9){if(_0x48cee9&&_0x48cee9['autoAssociation']===0x0){return db[_0x7507('0x30')][_0x7507('0x52')]({'name':_0x4c55a4[_0x7507('0x45')],'resourceId':_0x4c55a4['id'],'type':_0x48cee9[_0x7507('0x45')],'sectionId':_0x48cee9['id']},{})[_0x7507('0x2d')](function(){return _0x1fc955;});}else{return _0x1fc955;}})['catch'](function(_0x43bbad){logger[_0x7507('0x32')](_0x7507('0x54'),_0x43bbad);throw _0x43bbad;});}return _0x1fc955;})[_0x7507('0x2d')](respondWithResult(_0x406640,0xc9))['catch'](handleError(_0x406640,null));};exports[_0x7507('0x2c')]=function(_0x194e1e,_0x5b61ca){if(_0x194e1e[_0x7507('0x55')]['id']){delete _0x194e1e[_0x7507('0x55')]['id'];}return db[_0x7507('0x47')]['find']({'where':{'id':_0x194e1e[_0x7507('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b61ca,null))['then'](saveUpdates(_0x194e1e[_0x7507('0x55')],null))['then'](respondWithResult(_0x5b61ca,null))['catch'](handleError(_0x5b61ca,null));};exports[_0x7507('0x31')]=function(_0x2a27e9,_0x1465a2){return db[_0x7507('0x47')][_0x7507('0x51')]({'where':{'id':_0x2a27e9[_0x7507('0x4e')]['id']}})[_0x7507('0x2d')](handleEntityNotFound(_0x1465a2,null))[_0x7507('0x2d')](removeEntity(_0x1465a2,null))[_0x7507('0x4c')](handleError(_0x1465a2,null));};exports[_0x7507('0x56')]=function(_0x58880d,_0x205b76){return db['OpenchannelQueue'][_0x7507('0x56')]()['then'](respondWithResult(_0x205b76,null))[_0x7507('0x4c')](handleError(_0x205b76,null));};exports['getMembers']=function(_0x14f1ef,_0x40bdea,_0x2f3051){var _0x41cb57={'raw':!![],'where':{}},_0x3e8a5b={},_0x394adb;return db[_0x7507('0x47')]['findOne']({'where':{'id':_0x14f1ef[_0x7507('0x4e')]['id']}})[_0x7507('0x2d')](handleEntityNotFound(_0x40bdea,null))[_0x7507('0x2d')](function(_0x107dab){if(_0x107dab){_0x394adb=_0x107dab[_0x7507('0x2e')]({'plain':!![]});_0x3e8a5b[_0x7507('0x39')]=_[_0x7507('0x4f')](db[_0x7507('0x57')][_0x7507('0x36')]);_0x3e8a5b[_0x7507('0x3a')]=_[_0x7507('0x4f')](_0x14f1ef['query']);_0x3e8a5b['filters']=_[_0x7507('0x50')](_0x3e8a5b[_0x7507('0x39')],_0x3e8a5b['query']);_0x41cb57['attributes']=_[_0x7507('0x50')](_0x3e8a5b['model'],qs['fields'](_0x14f1ef[_0x7507('0x3a')][_0x7507('0x3d')]));_0x41cb57['attributes']=_0x41cb57[_0x7507('0x3c')][_0x7507('0x3e')]?_0x41cb57[_0x7507('0x3c')]:_0x3e8a5b[_0x7507('0x39')];if(!_0x14f1ef['query']['hasOwnProperty']('nolimit')){_0x41cb57['limit']=qs[_0x7507('0x26')](_0x14f1ef[_0x7507('0x3a')][_0x7507('0x26')]);_0x41cb57[_0x7507('0x24')]=qs[_0x7507('0x24')](_0x14f1ef['query'][_0x7507('0x24')]);}_0x41cb57[_0x7507('0x40')]=qs[_0x7507('0x41')](_0x14f1ef[_0x7507('0x3a')]['sort']);_0x41cb57[_0x7507('0x42')]=qs[_0x7507('0x3b')](_[_0x7507('0x58')](_0x14f1ef[_0x7507('0x3a')],_0x3e8a5b[_0x7507('0x3b')]));_0x41cb57['where'][_0x7507('0x59')]=_0x107dab['id'];if(_0x14f1ef['query']['filter']){_0x41cb57[_0x7507('0x42')]=_[_0x7507('0x43')](_0x41cb57[_0x7507('0x42')],{'$or':_[_0x7507('0x44')](_0x41cb57[_0x7507('0x3c')],function(_0x2654f5){var _0x6e58b1={};_0x6e58b1[_0x2654f5]={'$like':'%'+_0x14f1ef[_0x7507('0x3a')]['filter']+'%'};return _0x6e58b1;})});}_0x41cb57=_['merge']({},_0x41cb57,_0x14f1ef['options']);return db[_0x7507('0x57')][_0x7507('0x4b')](_0x41cb57);}})['then'](function(_0x30039a){if(_0x30039a){return db[_0x7507('0x5a')][_0x7507('0x5b')]({'where':{'id':_['map'](_0x30039a,_0x7507('0x5c')),'role':'agent'},'attributes':['id',_0x7507('0x45'),_0x7507('0x5d'),'updatedAt',_0x7507('0x5e')]});}})[_0x7507('0x2d')](function(_0x56160e){if(_0x56160e){return{'count':_0x56160e[_0x7507('0x48')],'rows':_['map'](_0x56160e[_0x7507('0x5f')],function(_0x4adea8){return{'membername':_0x4adea8[_0x7507('0x45')],'UserId':_0x4adea8['id'],'queue_name':_0x394adb[_0x7507('0x45')],'OpenchannelQueueId':_0x394adb['id'],'interface':util[_0x7507('0x60')]('%s/%s','SIP',_0x4adea8[_0x7507('0x45')]),'penalty':0x0,'paused':_0x4adea8[_0x7507('0x5d')],'createdAt':_0x4adea8[_0x7507('0x5e')],'updatedAt':_0x4adea8[_0x7507('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7507('0x2d')](respondWithFilteredResult(_0x40bdea,_0x41cb57))[_0x7507('0x4c')](handleError(_0x40bdea,null));};exports[_0x7507('0x62')]=function(_0x188626,_0xc27c1a,_0x5dbb75){var _0x57009e={};var _0x203d6c={};var _0x34d7b1;var _0x121f53;return db[_0x7507('0x47')][_0x7507('0x63')]({'where':{'id':_0x188626[_0x7507('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc27c1a,null))[_0x7507('0x2d')](function(_0x211240){if(_0x211240){_0x34d7b1=_0x211240;_0x203d6c[_0x7507('0x39')]=_[_0x7507('0x4f')](db[_0x7507('0x64')][_0x7507('0x36')]);_0x203d6c[_0x7507('0x3a')]=_[_0x7507('0x4f')](_0x188626[_0x7507('0x3a')]);_0x203d6c['filters']=_[_0x7507('0x50')](_0x203d6c[_0x7507('0x39')],_0x203d6c['query']);_0x57009e['attributes']=_[_0x7507('0x50')](_0x203d6c[_0x7507('0x39')],qs[_0x7507('0x3d')](_0x188626[_0x7507('0x3a')][_0x7507('0x3d')]));_0x57009e[_0x7507('0x3c')]=_0x57009e[_0x7507('0x3c')]['length']?_0x57009e['attributes']:_0x203d6c[_0x7507('0x39')];_0x57009e[_0x7507('0x40')]=qs[_0x7507('0x41')](_0x188626[_0x7507('0x3a')][_0x7507('0x41')]);_0x57009e[_0x7507('0x42')]=qs['filters'](_['pick'](_0x188626[_0x7507('0x3a')],_0x203d6c['filters']));if(_0x188626[_0x7507('0x3a')][_0x7507('0x65')]){_0x57009e[_0x7507('0x42')]=_[_0x7507('0x43')](_0x57009e['where'],{'$or':_[_0x7507('0x44')](_0x57009e['attributes'],function(_0x2df775){var _0x1b5782={};_0x1b5782[_0x2df775]={'$like':'%'+_0x188626['query'][_0x7507('0x65')]+'%'};return _0x1b5782;})});}_0x57009e=_[_0x7507('0x43')]({},_0x57009e,_0x188626[_0x7507('0x46')]);return _0x34d7b1[_0x7507('0x62')](_0x57009e);}})[_0x7507('0x2d')](function(_0x194e39){if(_0x194e39){_0x121f53=_0x194e39[_0x7507('0x3e')];if(!_0x188626[_0x7507('0x3a')][_0x7507('0x66')](_0x7507('0x3f'))){_0x57009e[_0x7507('0x26')]=qs[_0x7507('0x26')](_0x188626[_0x7507('0x3a')][_0x7507('0x26')]);_0x57009e[_0x7507('0x24')]=qs[_0x7507('0x24')](_0x188626[_0x7507('0x3a')][_0x7507('0x24')]);}return _0x34d7b1[_0x7507('0x62')](_0x57009e);}})['then'](function(_0x536924){if(_0x536924){return _0x536924?{'count':_0x121f53,'rows':_0x536924}:null;}})[_0x7507('0x2d')](respondWithResult(_0xc27c1a,null))['catch'](handleError(_0xc27c1a,null));};exports[_0x7507('0x67')]=function(_0x4f652b,_0x464eb1,_0x5b2b28){var _0x31836a=_0x4f652b[_0x7507('0x55')][_0x7507('0x68')];return db['Team']['findAll']({'where':{'id':_0x31836a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7507('0x45'),_0x7507('0x69'),'voicePause','interface'],'raw':!![]}]})[_0x7507('0x2d')](function(_0x5789bf){if(_0x5789bf){var _0x306d0f=_[_0x7507('0x6a')](_0x5789bf,function(_0x47f703){var _0x34a3e6=_0x47f703[_0x7507('0x2e')]({'plain':!![]});return _0x34a3e6[_0x7507('0x6b')];});return db[_0x7507('0x47')][_0x7507('0x51')]({'where':{'id':_0x4f652b[_0x7507('0x4e')]['id']}})['then'](function(_0x520891){return db['sequelize'][_0x7507('0x6c')](function(_0x3ca3e3){return _0x520891['addTeams'](_0x31836a,{'transaction':_0x3ca3e3})[_0x7507('0x2d')](function(){return BPromise[_0x7507('0x6d')](_0x306d0f,function(_0xc29fd9){return db['UserOpenchannelQueue'][_0x7507('0x6e')]({'where':{'UserId':_0xc29fd9['id'],'OpenchannelQueueId':_0x4f652b[_0x7507('0x4e')]['id']},'transaction':_0x3ca3e3});});})['then'](function(){_0x306d0f['forEach'](function(_0x12d62a){socket[_0x7507('0x6f')](_0x7507('0x70'),{'UserId':_0x12d62a['id'],'OpenchannelQueueId':_0x520891['id']});});});});});}})[_0x7507('0x2d')](respondWithStatusCode(_0x464eb1,null))[_0x7507('0x4c')](handleError(_0x464eb1,null));};exports[_0x7507('0x71')]=function(_0x289143,_0x2ad2c1,_0x1145df){return db[_0x7507('0x64')][_0x7507('0x4b')]({'where':{'id':_0x289143[_0x7507('0x3a')][_0x7507('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7507('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x7507('0x2d')](handleEntityNotFound(_0x2ad2c1,null))[_0x7507('0x2d')](function(_0x5b74ae){var _0x4af29c=_[_0x7507('0x44')](_0x5b74ae,'id');var _0x45f4dc=[];var _0x36681e=[];var _0x5595d=squel[_0x7507('0x72')]();_0x5595d[_0x7507('0x73')](_0x7507('0x74'))[_0x7507('0x75')]('team_has_openchannel_queues','tq')[_0x7507('0x76')]('user_has_teams','ut',_0x7507('0x77'))[_0x7507('0x42')](_0x7507('0x78'),_0x289143[_0x7507('0x4e')]['id']);for(var _0x1fee10=0x0;_0x1fee10<_0x5b74ae[_0x7507('0x3e')];_0x1fee10+=0x1){let _0x2aed42=_0x5b74ae[_0x1fee10];for(var _0x4b626c=0x0;_0x4b626c<_0x2aed42[_0x7507('0x6b')][_0x7507('0x3e')];_0x4b626c+=0x1){let _0x43e3c5=_0x2aed42[_0x7507('0x6b')][_0x4b626c];var _0x562681=_0x5595d[_0x7507('0x79')]();_0x562681['where']('ut.UserId\x20=\x20?',_0x43e3c5['id']);_0x36681e[_0x7507('0x7a')](db[_0x7507('0x7b')][_0x7507('0x3a')](_0x562681[_0x7507('0x7c')](),{'type':db[_0x7507('0x7b')][_0x7507('0x7d')][_0x7507('0x7e')]})[_0x7507('0x2d')](function(_0x42b1c1){if(_0x42b1c1[_0x7507('0x3e')]===0x1){return _0x43e3c5['id'];}else{var _0x28336e=_[_0x7507('0x7f')](_[_0x7507('0x44')](_0x42b1c1,_0x7507('0x80')),function(_0x3c6c2e){return _['includes'](_0x4af29c,_0x3c6c2e);});if(_0x28336e){return _0x43e3c5['id'];}}}));}}return BPromise[_0x7507('0x81')](_0x36681e)[_0x7507('0x2d')](function(_0x4f138d){_0x45f4dc=_(_0x45f4dc)[_0x7507('0x82')](_0x4f138d)[_0x7507('0x83')]()[_0x7507('0x84')]();return db[_0x7507('0x47')][_0x7507('0x51')]({'where':{'id':_0x289143[_0x7507('0x4e')]['id']}})[_0x7507('0x2d')](function(_0x44faa8){return db[_0x7507('0x7b')][_0x7507('0x6c')](function(_0x4daecf){return _0x44faa8['removeTeams'](_0x289143[_0x7507('0x3a')][_0x7507('0x68')],{'transaction':_0x4daecf})[_0x7507('0x2d')](function(){if(!_[_0x7507('0x85')](_0x45f4dc)){return _0x44faa8[_0x7507('0x86')](_0x45f4dc,{'transaction':_0x4daecf});}})[_0x7507('0x2d')](function(){_0x45f4dc[_0x7507('0x87')](function(_0x52efef){socket[_0x7507('0x6f')](_0x7507('0x88'),{'UserId':_0x52efef,'OpenchannelQueueId':_0x44faa8['id']});});});});});});})[_0x7507('0x2d')](respondWithStatusCode(_0x2ad2c1,null))[_0x7507('0x4c')](handleError(_0x2ad2c1,null));};exports[_0x7507('0x89')]=function(_0xac511c,_0x318f25,_0x17b60a){return db[_0x7507('0x47')][_0x7507('0x51')]({'where':{'id':_0xac511c[_0x7507('0x4e')]['id']}})['then'](handleEntityNotFound(_0x318f25,null))[_0x7507('0x2d')](function(_0x152612){if(_0x152612){return _0x152612[_0x7507('0x89')](_0xac511c[_0x7507('0x55')][_0x7507('0x68')],_['omit'](_0xac511c[_0x7507('0x55')],[_0x7507('0x68'),'id'])||{})[_0x7507('0x8a')](function(_0x471861){for(var _0x7b823=0x0;_0x7b823<_0xac511c[_0x7507('0x55')][_0x7507('0x68')][_0x7507('0x3e')];_0x7b823+=0x1){socket[_0x7507('0x6f')]('userOpenchannelQueue:save',{'UserId':Number(_0xac511c[_0x7507('0x55')][_0x7507('0x68')][_0x7b823]),'OpenchannelQueueId':Number(_0xac511c['params']['id'])});}return _0x471861;});}})[_0x7507('0x2d')](respondWithResult(_0x318f25,null))[_0x7507('0x4c')](handleError(_0x318f25,null));};exports[_0x7507('0x86')]=function(_0x112bc6,_0x2a2583,_0xbc8c7b){return db[_0x7507('0x47')]['find']({'where':{'id':_0x112bc6['params']['id']}})[_0x7507('0x2d')](handleEntityNotFound(_0x2a2583,null))[_0x7507('0x2d')](function(_0x13e26a){if(_0x13e26a){return _0x13e26a[_0x7507('0x86')](_0x112bc6[_0x7507('0x3a')][_0x7507('0x68')])[_0x7507('0x2d')](function(){if(_[_0x7507('0x8b')](_0x112bc6[_0x7507('0x3a')][_0x7507('0x68')])){for(var _0x257304=0x0;_0x257304<_0x112bc6[_0x7507('0x3a')][_0x7507('0x68')][_0x7507('0x3e')];_0x257304+=0x1){socket[_0x7507('0x6f')](_0x7507('0x88'),{'UserId':Number(_0x112bc6[_0x7507('0x3a')][_0x7507('0x68')][_0x257304]),'OpenchannelQueueId':Number(_0x112bc6[_0x7507('0x4e')]['id'])});}}else{socket[_0x7507('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x112bc6[_0x7507('0x3a')]['ids']),'OpenchannelQueueId':Number(_0x112bc6[_0x7507('0x4e')]['id'])});}});}})[_0x7507('0x2d')](respondWithStatusCode(_0x2a2583,null))[_0x7507('0x4c')](handleError(_0x2a2583,null));};exports[_0x7507('0x8c')]=function(_0x5d8bb2,_0x1e9c36,_0x246641){var _0x493b7c={};var _0x12122f={};var _0x536e30;var _0x727818;return db[_0x7507('0x47')][_0x7507('0x63')]({'where':{'id':_0x5d8bb2[_0x7507('0x4e')]['id']}})[_0x7507('0x2d')](handleEntityNotFound(_0x1e9c36,null))['then'](function(_0x3e7d40){if(_0x3e7d40){_0x536e30=_0x3e7d40;_0x12122f['model']=_['keys'](db[_0x7507('0x5a')][_0x7507('0x36')]);_0x12122f['query']=_[_0x7507('0x4f')](_0x5d8bb2[_0x7507('0x3a')]);_0x12122f[_0x7507('0x3b')]=_[_0x7507('0x50')](_0x12122f['model'],_0x12122f[_0x7507('0x3a')]);_0x493b7c[_0x7507('0x3c')]=_[_0x7507('0x50')](_0x12122f[_0x7507('0x39')],qs[_0x7507('0x3d')](_0x5d8bb2[_0x7507('0x3a')][_0x7507('0x3d')]));_0x493b7c[_0x7507('0x3c')]=_0x493b7c[_0x7507('0x3c')][_0x7507('0x3e')]?_0x493b7c[_0x7507('0x3c')]:_0x12122f[_0x7507('0x39')];_0x493b7c[_0x7507('0x40')]=qs[_0x7507('0x41')](_0x5d8bb2[_0x7507('0x3a')]['sort']);_0x493b7c[_0x7507('0x42')]=qs[_0x7507('0x3b')](_[_0x7507('0x58')](_0x5d8bb2[_0x7507('0x3a')],_0x12122f[_0x7507('0x3b')]));if(_0x5d8bb2['query'][_0x7507('0x65')]){_0x493b7c[_0x7507('0x42')]=_['merge'](_0x493b7c[_0x7507('0x42')],{'$or':_[_0x7507('0x44')](_0x493b7c['attributes'],function(_0x1dd947){var _0x146630={};_0x146630[_0x1dd947]={'$like':'%'+_0x5d8bb2[_0x7507('0x3a')][_0x7507('0x65')]+'%'};return _0x146630;})});}_0x493b7c=_[_0x7507('0x43')]({},_0x493b7c,_0x5d8bb2[_0x7507('0x46')]);return _0x536e30[_0x7507('0x8c')](_0x493b7c);}})[_0x7507('0x2d')](function(_0x5d44cf){if(_0x5d44cf){_0x727818=_0x5d44cf['length'];if(!_0x5d8bb2[_0x7507('0x3a')][_0x7507('0x66')]('nolimit')){_0x493b7c[_0x7507('0x26')]=qs[_0x7507('0x26')](_0x5d8bb2[_0x7507('0x3a')][_0x7507('0x26')]);_0x493b7c['offset']=qs[_0x7507('0x24')](_0x5d8bb2['query'][_0x7507('0x24')]);}return _0x536e30[_0x7507('0x8c')](_0x493b7c);}})[_0x7507('0x2d')](function(_0x2d2e9b){if(_0x2d2e9b){return _0x2d2e9b?{'count':_0x727818,'rows':_0x2d2e9b}:null;}})[_0x7507('0x2d')](respondWithResult(_0x1e9c36,null))['catch'](handleError(_0x1e9c36,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e7aded5..5b30ad1 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 _0x1717=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1da6be,_0x5d4e33){var _0x1264cf=function(_0x65beb4){while(--_0x65beb4){_0x1da6be['push'](_0x1da6be['shift']());}};_0x1264cf(++_0x5d4e33);}(_0x1717,0xa6));var _0x7171=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x1717[_0x44039a];return _0x525de5;};'use strict';var EventEmitter=require(_0x7171('0x0'));var OpenchannelQueue=require(_0x7171('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7171('0x2')](0x0);var events={'afterCreate':_0x7171('0x3'),'afterUpdate':_0x7171('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa9ef6b){return function(_0x38ab9c,_0x48c9ec,_0x41515b){OpenchannelQueueEvents[_0x7171('0x5')](_0xa9ef6b+':'+_0x38ab9c['id'],_0x38ab9c);OpenchannelQueueEvents['emit'](_0xa9ef6b,_0x38ab9c);_0x41515b(null);};}for(var e in events){if(events[_0x7171('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7171('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x7052=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x46ab1c,_0x46e561){var _0x3fb929=function(_0xa5f65e){while(--_0xa5f65e){_0x46ab1c['push'](_0x46ab1c['shift']());}};_0x3fb929(++_0x46e561);}(_0x7052,0x162));var _0x2705=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x7052[_0x284506];return _0x1e9ee5;};'use strict';var EventEmitter=require(_0x2705('0x0'));var OpenchannelQueue=require(_0x2705('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2705('0x2')](0x0);var events={'afterCreate':_0x2705('0x3'),'afterUpdate':_0x2705('0x4'),'afterDestroy':_0x2705('0x5')};function emitEvent(_0x1a4d49){return function(_0x31243b,_0x423c5a,_0x540e95){OpenchannelQueueEvents[_0x2705('0x6')](_0x1a4d49+':'+_0x31243b['id'],_0x31243b);OpenchannelQueueEvents[_0x2705('0x6')](_0x1a4d49,_0x31243b);_0x540e95(null);};}for(var e in events){if(events[_0x2705('0x7')](e)){var event=events[e];OpenchannelQueue[_0x2705('0x8')](e,emitEvent(event));}}module[_0x2705('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 476706d..e53508f 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 _0x83a5=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x83221c,_0x3975ef){var _0x2fa1fc=function(_0x26d691){while(--_0x26d691){_0x83221c['push'](_0x83221c['shift']());}};_0x2fa1fc(++_0x3975ef);}(_0x83a5,0x6c));var _0x583a=function(_0x2cef62,_0x5e7680){_0x2cef62=_0x2cef62-0x0;var _0x3c25a9=_0x83a5[_0x2cef62];return _0x3c25a9;};'use strict';var _=require(_0x583a('0x0'));var util=require(_0x583a('0x1'));var logger=require(_0x583a('0x2'))('api');var moment=require(_0x583a('0x3'));var BPromise=require(_0x583a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x583a('0x5'));var rimraf=require(_0x583a('0x6'));var config=require(_0x583a('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x583a('0x8')]=function(_0x1ca1ca,_0x46b3a4){return _0x1ca1ca['define'](_0x583a('0x9'),attributes,{'tableName':_0x583a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f8d=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x40a9a0,_0x1d531b){var _0x2538d2=function(_0x68ad3){while(--_0x68ad3){_0x40a9a0['push'](_0x40a9a0['shift']());}};_0x2538d2(++_0x1d531b);}(_0x1f8d,0x8c));var _0xd1f8=function(_0x3f355d,_0x2260f8){_0x3f355d=_0x3f355d-0x0;var _0x194418=_0x1f8d[_0x3f355d];return _0x194418;};'use strict';var _=require(_0xd1f8('0x0'));var util=require(_0xd1f8('0x1'));var logger=require(_0xd1f8('0x2'))(_0xd1f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd1f8('0x4'));var fs=require('fs');var path=require(_0xd1f8('0x5'));var rimraf=require(_0xd1f8('0x6'));var config=require(_0xd1f8('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xd1f8('0x8')]=function(_0x4fe41f,_0x385c3f){return _0x4fe41f[_0xd1f8('0x9')](_0xd1f8('0xa'),attributes,{'tableName':_0xd1f8('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 6c89a5b..ed8a687 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 _0x40dc=['OpenchannelQueue','findAll','options','raw','attributes','include','map','model','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetOpenchannelQueue'];(function(_0x187783,_0x523c06){var _0x20cfcd=function(_0x53a715){while(--_0x53a715){_0x187783['push'](_0x187783['shift']());}};_0x20cfcd(++_0x523c06);}(_0x40dc,0xaf));var _0xc40d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc40d('0x0'));var util=require(_0xc40d('0x1'));var moment=require(_0xc40d('0x2'));var BPromise=require(_0xc40d('0x3'));var rs=require(_0xc40d('0x4'));var fs=require('fs');var Redis=require(_0xc40d('0x5'));var db=require(_0xc40d('0x6'))['db'];var utils=require(_0xc40d('0x7'));var logger=require(_0xc40d('0x8'))(_0xc40d('0x9'));var config=require(_0xc40d('0xa'));var jayson=require(_0xc40d('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xc40d('0xc')]=_[_0xc40d('0xd')](config[_0xc40d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc40d('0xe'))(new Redis(config[_0xc40d('0xc')]));require(_0xc40d('0xf'))[_0xc40d('0x10')](socket);function respondWithRpcPromise(_0x3ba2d3,_0x39ce30,_0x2914d0){return new BPromise(function(_0x3ab8a4,_0x89dd3){return client[_0xc40d('0x11')](_0x3ba2d3,_0x2914d0)[_0xc40d('0x12')](function(_0x124054){logger['info'](_0xc40d('0x13'),_0x39ce30,'request\x20sent');logger[_0xc40d('0x14')](_0xc40d('0x15'),_0x39ce30,_0xc40d('0x16'),JSON[_0xc40d('0x17')](_0x124054));if(_0x124054['error']){if(_0x124054[_0xc40d('0x18')][_0xc40d('0x19')]===0x1f4){logger['error'](_0xc40d('0x13'),_0x39ce30,_0x124054[_0xc40d('0x18')]['message']);return _0x89dd3(_0x124054[_0xc40d('0x18')][_0xc40d('0x1a')]);}logger[_0xc40d('0x18')](_0xc40d('0x13'),_0x39ce30,_0x124054[_0xc40d('0x18')][_0xc40d('0x1a')]);return _0x3ab8a4(_0x124054[_0xc40d('0x18')][_0xc40d('0x1a')]);}else{logger[_0xc40d('0x1b')](_0xc40d('0x13'),_0x39ce30,'request\x20sent');_0x3ab8a4(_0x124054['result'][_0xc40d('0x1a')]);}})[_0xc40d('0x1c')](function(_0x341081){logger['error'](_0xc40d('0x13'),_0x39ce30,_0x341081);_0x89dd3(_0x341081);});});}exports[_0xc40d('0x1d')]=function(_0x18fd2b){var _0x5eb64c=this;return new Promise(function(_0x26298d,_0xb76a23){return db[_0xc40d('0x1e')][_0xc40d('0x1f')]({'raw':_0x18fd2b[_0xc40d('0x20')]?_0x18fd2b['options'][_0xc40d('0x21')]===undefined?!![]:![]:!![],'where':_0x18fd2b[_0xc40d('0x20')]?_0x18fd2b['options']['where']||null:null,'attributes':_0x18fd2b[_0xc40d('0x20')]?_0x18fd2b[_0xc40d('0x20')][_0xc40d('0x22')]||null:null,'limit':_0x18fd2b[_0xc40d('0x20')]?_0x18fd2b[_0xc40d('0x20')]['limit']||null:null,'include':_0x18fd2b[_0xc40d('0x20')]?_0x18fd2b[_0xc40d('0x20')][_0xc40d('0x23')]?_[_0xc40d('0x24')](_0x18fd2b['options'][_0xc40d('0x23')],function(_0x1eb3bb){return{'model':db[_0x1eb3bb[_0xc40d('0x25')]],'as':_0x1eb3bb['as'],'attributes':_0x1eb3bb[_0xc40d('0x22')],'include':_0x1eb3bb[_0xc40d('0x23')]?_[_0xc40d('0x24')](_0x1eb3bb['include'],function(_0x321ef5){return{'model':db[_0x321ef5[_0xc40d('0x25')]],'as':_0x321ef5['as'],'attributes':_0x321ef5['attributes'],'include':_0x321ef5[_0xc40d('0x23')]?_[_0xc40d('0x24')](_0x321ef5[_0xc40d('0x23')],function(_0x37ea8b){return{'model':db[_0x37ea8b[_0xc40d('0x25')]],'as':_0x37ea8b['as'],'attributes':_0x37ea8b[_0xc40d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc40d('0x12')](function(_0x3b95c4){logger[_0xc40d('0x1b')]('GetOpenchannelQueue',_0x18fd2b);logger[_0xc40d('0x14')](_0xc40d('0x1d'),_0x18fd2b,JSON[_0xc40d('0x17')](_0x3b95c4));_0x26298d(_0x3b95c4);})[_0xc40d('0x1c')](function(_0x1fccff){logger[_0xc40d('0x18')](_0xc40d('0x1d'),_0x1fccff['message'],_0x18fd2b);_0xb76a23(_0x5eb64c['error'](0x1f4,_0x1fccff[_0xc40d('0x1a')]));});});};exports[_0xc40d('0x26')]=function(_0x29a212){var _0x49d000=this;return new Promise(function(_0x7c540f,_0x2220e8){return db[_0xc40d('0x1e')][_0xc40d('0x27')]({'raw':_0x29a212['options']?_0x29a212[_0xc40d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x29a212[_0xc40d('0x20')]?_0x29a212[_0xc40d('0x20')][_0xc40d('0x28')]||null:null,'attributes':_0x29a212[_0xc40d('0x20')]?_0x29a212['options'][_0xc40d('0x22')]||null:null,'include':_0x29a212[_0xc40d('0x20')]?_0x29a212[_0xc40d('0x20')][_0xc40d('0x23')]?_[_0xc40d('0x24')](_0x29a212[_0xc40d('0x20')][_0xc40d('0x23')],function(_0x2d6873){return{'model':db[_0x2d6873['model']],'as':_0x2d6873['as'],'attributes':_0x2d6873[_0xc40d('0x22')],'include':_0x2d6873[_0xc40d('0x23')]?_[_0xc40d('0x24')](_0x2d6873['include'],function(_0xde3396){return{'model':db[_0xde3396[_0xc40d('0x25')]],'as':_0xde3396['as'],'attributes':_0xde3396[_0xc40d('0x22')],'include':_0xde3396[_0xc40d('0x23')]?_[_0xc40d('0x24')](_0xde3396[_0xc40d('0x23')],function(_0x46b5e4){return{'model':db[_0x46b5e4[_0xc40d('0x25')]],'as':_0x46b5e4['as'],'attributes':_0x46b5e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc40d('0x12')](function(_0x5c2f14){logger[_0xc40d('0x1b')]('ShowOpenchannelQueue',_0x29a212);logger[_0xc40d('0x14')](_0xc40d('0x26'),_0x29a212,JSON['stringify'](_0x5c2f14));_0x7c540f(_0x5c2f14);})[_0xc40d('0x1c')](function(_0xe6ed82){logger[_0xc40d('0x18')](_0xc40d('0x26'),_0xe6ed82['message'],_0x29a212);_0x2220e8(_0x49d000['error'](0x1f4,_0xe6ed82[_0xc40d('0x1a')]));});});}; \ No newline at end of file +var _0x18e1=['include','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','attributes','limit','model'];(function(_0x52d4ad,_0x25e611){var _0x34a767=function(_0x1f3daa){while(--_0x1f3daa){_0x52d4ad['push'](_0x52d4ad['shift']());}};_0x34a767(++_0x25e611);}(_0x18e1,0x1be));var _0x118e=function(_0x3ff326,_0x44bbf6){_0x3ff326=_0x3ff326-0x0;var _0x3d44f7=_0x18e1[_0x3ff326];return _0x3d44f7;};'use strict';var _=require(_0x118e('0x0'));var util=require(_0x118e('0x1'));var moment=require(_0x118e('0x2'));var BPromise=require(_0x118e('0x3'));var rs=require(_0x118e('0x4'));var fs=require('fs');var Redis=require(_0x118e('0x5'));var db=require(_0x118e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x118e('0x7'))('rpc');var config=require(_0x118e('0x8'));var jayson=require(_0x118e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x118e('0xa')]=_[_0x118e('0xb')](config['redis'],{'host':_0x118e('0xc'),'port':0x18eb});var socket=require(_0x118e('0xd'))(new Redis(config[_0x118e('0xa')]));require(_0x118e('0xe'))[_0x118e('0xf')](socket);function respondWithRpcPromise(_0x120c93,_0x3c57d0,_0x3a2798){return new BPromise(function(_0x28a071,_0xbfa25b){return client[_0x118e('0x10')](_0x120c93,_0x3a2798)[_0x118e('0x11')](function(_0x4a78d7){logger[_0x118e('0x12')](_0x118e('0x13'),_0x3c57d0,'request\x20sent');logger[_0x118e('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3c57d0,_0x118e('0x15'),JSON[_0x118e('0x16')](_0x4a78d7));if(_0x4a78d7[_0x118e('0x17')]){if(_0x4a78d7[_0x118e('0x17')][_0x118e('0x18')]===0x1f4){logger['error'](_0x118e('0x13'),_0x3c57d0,_0x4a78d7['error'][_0x118e('0x19')]);return _0xbfa25b(_0x4a78d7[_0x118e('0x17')][_0x118e('0x19')]);}logger['error'](_0x118e('0x13'),_0x3c57d0,_0x4a78d7[_0x118e('0x17')]['message']);return _0x28a071(_0x4a78d7[_0x118e('0x17')][_0x118e('0x19')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x3c57d0,_0x118e('0x15'));_0x28a071(_0x4a78d7[_0x118e('0x1a')][_0x118e('0x19')]);}})[_0x118e('0x1b')](function(_0x50af9b){logger[_0x118e('0x17')](_0x118e('0x13'),_0x3c57d0,_0x50af9b);_0xbfa25b(_0x50af9b);});});}exports['GetOpenchannelQueue']=function(_0x330a4e){var _0x3f65f4=this;return new Promise(function(_0x22f5f6,_0x3657bb){return db[_0x118e('0x1c')][_0x118e('0x1d')]({'raw':_0x330a4e[_0x118e('0x1e')]?_0x330a4e[_0x118e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x330a4e[_0x118e('0x1e')]?_0x330a4e[_0x118e('0x1e')]['where']||null:null,'attributes':_0x330a4e[_0x118e('0x1e')]?_0x330a4e[_0x118e('0x1e')][_0x118e('0x1f')]||null:null,'limit':_0x330a4e[_0x118e('0x1e')]?_0x330a4e[_0x118e('0x1e')][_0x118e('0x20')]||null:null,'include':_0x330a4e[_0x118e('0x1e')]?_0x330a4e[_0x118e('0x1e')]['include']?_['map'](_0x330a4e['options']['include'],function(_0x1a66d4){return{'model':db[_0x1a66d4[_0x118e('0x21')]],'as':_0x1a66d4['as'],'attributes':_0x1a66d4[_0x118e('0x1f')],'include':_0x1a66d4[_0x118e('0x22')]?_[_0x118e('0x23')](_0x1a66d4['include'],function(_0x171532){return{'model':db[_0x171532['model']],'as':_0x171532['as'],'attributes':_0x171532['attributes'],'include':_0x171532[_0x118e('0x22')]?_[_0x118e('0x23')](_0x171532[_0x118e('0x22')],function(_0x1cc722){return{'model':db[_0x1cc722[_0x118e('0x21')]],'as':_0x1cc722['as'],'attributes':_0x1cc722[_0x118e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x118e('0x11')](function(_0x2ef968){logger[_0x118e('0x12')]('GetOpenchannelQueue',_0x330a4e);logger[_0x118e('0x14')](_0x118e('0x24'),_0x330a4e,JSON[_0x118e('0x16')](_0x2ef968));_0x22f5f6(_0x2ef968);})['catch'](function(_0x42dd80){logger[_0x118e('0x17')](_0x118e('0x24'),_0x42dd80[_0x118e('0x19')],_0x330a4e);_0x3657bb(_0x3f65f4[_0x118e('0x17')](0x1f4,_0x42dd80['message']));});});};exports[_0x118e('0x25')]=function(_0x59f359){var _0x169fd5=this;return new Promise(function(_0x2dc9a0,_0x3f3732){return db[_0x118e('0x1c')][_0x118e('0x26')]({'raw':_0x59f359[_0x118e('0x1e')]?_0x59f359[_0x118e('0x1e')][_0x118e('0x27')]===undefined?!![]:![]:!![],'where':_0x59f359['options']?_0x59f359[_0x118e('0x1e')]['where']||null:null,'attributes':_0x59f359[_0x118e('0x1e')]?_0x59f359[_0x118e('0x1e')][_0x118e('0x1f')]||null:null,'include':_0x59f359[_0x118e('0x1e')]?_0x59f359[_0x118e('0x1e')][_0x118e('0x22')]?_[_0x118e('0x23')](_0x59f359[_0x118e('0x1e')][_0x118e('0x22')],function(_0x44907a){return{'model':db[_0x44907a[_0x118e('0x21')]],'as':_0x44907a['as'],'attributes':_0x44907a[_0x118e('0x1f')],'include':_0x44907a[_0x118e('0x22')]?_[_0x118e('0x23')](_0x44907a[_0x118e('0x22')],function(_0x5ecc3b){return{'model':db[_0x5ecc3b[_0x118e('0x21')]],'as':_0x5ecc3b['as'],'attributes':_0x5ecc3b[_0x118e('0x1f')],'include':_0x5ecc3b[_0x118e('0x22')]?_[_0x118e('0x23')](_0x5ecc3b[_0x118e('0x22')],function(_0x15cb99){return{'model':db[_0x15cb99[_0x118e('0x21')]],'as':_0x15cb99['as'],'attributes':_0x15cb99[_0x118e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2df7){logger['info'](_0x118e('0x25'),_0x59f359);logger['debug'](_0x118e('0x25'),_0x59f359,JSON[_0x118e('0x16')](_0x2c2df7));_0x2dc9a0(_0x2c2df7);})[_0x118e('0x1b')](function(_0x576740){logger[_0x118e('0x17')](_0x118e('0x25'),_0x576740[_0x118e('0x19')],_0x59f359);_0x3f3732(_0x169fd5[_0x118e('0x17')](0x1f4,_0x576740[_0x118e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index bfd39eb..af6ef53 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 _0x4faa=['emit','register','length','./openchannelQueue.events','save'];(function(_0x2d8c37,_0x3976c1){var _0x2093dd=function(_0xfa783b){while(--_0xfa783b){_0x2d8c37['push'](_0x2d8c37['shift']());}};_0x2093dd(++_0x3976c1);}(_0x4faa,0x8f));var _0xa4fa=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4faa[_0xa1e3e3];return _0xc980e9;};'use strict';var OpenchannelQueueEvents=require(_0xa4fa('0x0'));var events=[_0xa4fa('0x1'),'remove','update'];function createListener(_0x51cdcd,_0x31bfa5){return function(_0x5e8738){_0x31bfa5[_0xa4fa('0x2')](_0x51cdcd,_0x5e8738);};}function removeListener(_0x3f38f6,_0x81af73){return function(){OpenchannelQueueEvents['removeListener'](_0x3f38f6,_0x81af73);};}exports[_0xa4fa('0x3')]=function(_0x144da4){for(var _0x3c045e=0x0,_0x46223b=events[_0xa4fa('0x4')];_0x3c045e<_0x46223b;_0x3c045e++){var _0x30f5eb=events[_0x3c045e];var _0x1c4b00=createListener('openchannelQueue:'+_0x30f5eb,_0x144da4);OpenchannelQueueEvents['on'](_0x30f5eb,_0x1c4b00);}}; \ No newline at end of file +var _0xa7da=['update','removeListener','length','./openchannelQueue.events','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa7da,0x15c));var _0xaa7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7da[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelQueueEvents=require(_0xaa7d('0x0'));var events=[_0xaa7d('0x1'),'remove',_0xaa7d('0x2')];function createListener(_0x49d49a,_0x226272){return function(_0xe56597){_0x226272['emit'](_0x49d49a,_0xe56597);};}function removeListener(_0x28d051,_0x1e6513){return function(){OpenchannelQueueEvents[_0xaa7d('0x3')](_0x28d051,_0x1e6513);};}exports['register']=function(_0x24a032){for(var _0x3c9620=0x0,_0x1966e3=events[_0xaa7d('0x4')];_0x3c9620<_0x1966e3;_0x3c9620++){var _0xf9d684=events[_0x3c9620];var _0x507e78=createListener('openchannelQueue:'+_0xf9d684,_0x24a032);OpenchannelQueueEvents['on'](_0xf9d684,_0x507e78);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 9618d2f..267986a 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 _0x1009=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','delete'];(function(_0xb4d947,_0x16b719){var _0x8c85d0=function(_0x2cb6fc){while(--_0x2cb6fc){_0xb4d947['push'](_0xb4d947['shift']());}};_0x8c85d0(++_0x16b719);}(_0x1009,0x152));var _0x9100=function(_0x20bfd0,_0x3a861a){_0x20bfd0=_0x20bfd0-0x0;var _0x584abe=_0x1009[_0x20bfd0];return _0x584abe;};'use strict';var multer=require('multer');var util=require(_0x9100('0x0'));var path=require(_0x9100('0x1'));var timeout=require(_0x9100('0x2'));var express=require(_0x9100('0x3'));var router=express[_0x9100('0x4')]();var fs_extra=require(_0x9100('0x5'));var auth=require(_0x9100('0x6'));var interaction=require(_0x9100('0x7'));var config=require(_0x9100('0x8'));var controller=require(_0x9100('0x9'));router[_0x9100('0xa')]('/',auth[_0x9100('0xb')](),controller['index']);router['get'](_0x9100('0xc'),auth[_0x9100('0xb')](),controller[_0x9100('0xd')]);router['get'](_0x9100('0xe'),auth['isAuthenticated'](),controller[_0x9100('0xf')]);router[_0x9100('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x9100('0xb')](),controller[_0x9100('0x11')]);router[_0x9100('0x12')](_0x9100('0xe'),auth['isAuthenticated'](),controller[_0x9100('0x13')]);module[_0x9100('0x14')]=router; \ No newline at end of file +var _0xaf24=['put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x128de4,_0x511592){var _0x167659=function(_0x5d4b6d){while(--_0x5d4b6d){_0x128de4['push'](_0x128de4['shift']());}};_0x167659(++_0x511592);}(_0xaf24,0xc1));var _0x4af2=function(_0x26cd41,_0x5238e8){_0x26cd41=_0x26cd41-0x0;var _0x20735b=_0xaf24[_0x26cd41];return _0x20735b;};'use strict';var multer=require(_0x4af2('0x0'));var util=require(_0x4af2('0x1'));var path=require(_0x4af2('0x2'));var timeout=require(_0x4af2('0x3'));var express=require('express');var router=express[_0x4af2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4af2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4af2('0x6'));var controller=require(_0x4af2('0x7'));router['get']('/',auth[_0x4af2('0x8')](),controller[_0x4af2('0x9')]);router[_0x4af2('0xa')](_0x4af2('0xb'),auth[_0x4af2('0x8')](),controller[_0x4af2('0xc')]);router[_0x4af2('0xa')](_0x4af2('0xd'),auth[_0x4af2('0x8')](),controller[_0x4af2('0xe')]);router[_0x4af2('0xf')]('/',auth['isAuthenticated'](),controller[_0x4af2('0x10')]);router[_0x4af2('0x11')](_0x4af2('0xd'),auth[_0x4af2('0x8')](),controller['update']);router[_0x4af2('0x12')]('/:id',auth[_0x4af2('0x8')](),controller[_0x4af2('0x13')]);module[_0x4af2('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 bcddf8d..02634c2 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 _0x9fba=['exports','STRING','DATE','moment'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x9fba,0x11f));var _0xa9fb=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9fba[_0x334841];return _0x5beb4b;};'use strict';var moment=require(_0xa9fb('0x0'));var Sequelize=require('sequelize');module[_0xa9fb('0x1')]={'uniqueid':{'type':Sequelize[_0xa9fb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa9fb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa9fb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa9fb('0x2')]}}; \ No newline at end of file +var _0x15a5=['DATE','moment','exports','STRING'];(function(_0x4cf177,_0x28618b){var _0x93aefc=function(_0x6a7079){while(--_0x6a7079){_0x4cf177['push'](_0x4cf177['shift']());}};_0x93aefc(++_0x28618b);}(_0x15a5,0x1e5));var _0x515a=function(_0x1afc16,_0x307071){_0x1afc16=_0x1afc16-0x0;var _0x51781c=_0x15a5[_0x1afc16];return _0x51781c;};'use strict';var moment=require(_0x515a('0x0'));var Sequelize=require('sequelize');module[_0x515a('0x1')]={'uniqueid':{'type':Sequelize[_0x515a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x515a('0x2')]},'joinAt':{'type':Sequelize[_0x515a('0x3')]},'leaveAt':{'type':Sequelize[_0x515a('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x515a('0x3')]},'reason':{'type':Sequelize[_0x515a('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index f8da80a..b306fd6 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 _0x98bc=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','json','offset','limit','undefined','count','status','set','Content-Range','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','order','sort','where','filter','merge','options','OpenchannelQueueReport','includeAll','include','rows','catch','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x98bc,0x15b));var _0xc98b=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x98bc[_0x1d558c];return _0x15767d;};'use strict';var emlformat=require(_0xc98b('0x0'));var rimraf=require(_0xc98b('0x1'));var zipdir=require(_0xc98b('0x2'));var jsonpatch=require(_0xc98b('0x3'));var rp=require(_0xc98b('0x4'));var moment=require(_0xc98b('0x5'));var BPromise=require(_0xc98b('0x6'));var Mustache=require(_0xc98b('0x7'));var util=require('util');var path=require(_0xc98b('0x8'));var sox=require(_0xc98b('0x9'));var csv=require('to-csv');var ejs=require(_0xc98b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc98b('0xb'));var squel=require(_0xc98b('0xc'));var crypto=require(_0xc98b('0xd'));var jsforce=require(_0xc98b('0xe'));var deskjs=require(_0xc98b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc98b('0x10'));var Redis=require('ioredis');var authService=require(_0xc98b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc98b('0x12'));var logger=require(_0xc98b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc98b('0x14'));var licenseUtil=require(_0xc98b('0x15'));var db=require(_0xc98b('0x16'))['db'];function respondWithStatusCode(_0x3a4ff7,_0x4b289c){_0x4b289c=_0x4b289c||0xcc;return function(_0x8449b8){if(_0x8449b8){return _0x3a4ff7['sendStatus'](_0x4b289c);}return _0x3a4ff7['status'](_0x4b289c)['end']();};}function respondWithResult(_0x5610b4,_0x45af53){_0x45af53=_0x45af53||0xc8;return function(_0x129138){if(_0x129138){return _0x5610b4['status'](_0x45af53)[_0xc98b('0x17')](_0x129138);}};}function respondWithFilteredResult(_0x4b16e4,_0x5cad73){return function(_0x1234b2){if(_0x1234b2){var _0x23c172=typeof _0x5cad73[_0xc98b('0x18')]==='undefined'&&typeof _0x5cad73[_0xc98b('0x19')]===_0xc98b('0x1a');var _0xa61f65=_0x1234b2[_0xc98b('0x1b')];var _0x21d261=_0x23c172?0x0:_0x5cad73['offset'];var _0x1b1783=_0x23c172?_0x1234b2['count']:_0x5cad73[_0xc98b('0x18')]+_0x5cad73[_0xc98b('0x19')];var _0x589da3;if(_0x1b1783>=_0xa61f65){_0x1b1783=_0xa61f65;_0x589da3=0xc8;}else{_0x589da3=0xce;}_0x4b16e4[_0xc98b('0x1c')](_0x589da3);return _0x4b16e4[_0xc98b('0x1d')](_0xc98b('0x1e'),_0x21d261+'-'+_0x1b1783+'/'+_0xa61f65)[_0xc98b('0x17')](_0x1234b2);}return null;};}function patchUpdates(_0x18bb1d){return function(_0xc8562c){try{jsonpatch['apply'](_0xc8562c,_0x18bb1d,!![]);}catch(_0x10e9be){return BPromise[_0xc98b('0x1f')](_0x10e9be);}return _0xc8562c['save']();};}function saveUpdates(_0x5ce65e,_0xf4fea){return function(_0x3a3677){if(_0x3a3677){return _0x3a3677[_0xc98b('0x20')](_0x5ce65e)[_0xc98b('0x21')](function(_0x127b08){return _0x127b08;});}return null;};}function removeEntity(_0xc93be5,_0x314cdb){return function(_0x2c4d58){if(_0x2c4d58){return _0x2c4d58[_0xc98b('0x22')]()[_0xc98b('0x21')](function(){_0xc93be5[_0xc98b('0x1c')](0xcc)[_0xc98b('0x23')]();});}};}function handleEntityNotFound(_0x2fc4b0,_0x142016){return function(_0x265bfe){if(!_0x265bfe){_0x2fc4b0[_0xc98b('0x24')](0x194);}return _0x265bfe;};}function handleError(_0x4f4826,_0x3b5f00){_0x3b5f00=_0x3b5f00||0x1f4;return function(_0x94c4ae){logger[_0xc98b('0x25')](_0x94c4ae[_0xc98b('0x26')]);if(_0x94c4ae[_0xc98b('0x27')]){delete _0x94c4ae['name'];}_0x4f4826[_0xc98b('0x1c')](_0x3b5f00)[_0xc98b('0x28')](_0x94c4ae);};}exports['index']=function(_0x3f4aca,_0x1f53da){var _0x52763d={},_0x12ba8d={},_0x54566f={'count':0x0,'rows':[]};var _0x49fdc5=_[_0xc98b('0x29')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x595db0){return{'name':_0x595db0[_0xc98b('0x2a')],'type':_0x595db0[_0xc98b('0x2b')][_0xc98b('0x2c')]};});_0x12ba8d[_0xc98b('0x2d')]=_['map'](_0x49fdc5,_0xc98b('0x27'));_0x12ba8d[_0xc98b('0x2e')]=_[_0xc98b('0x2f')](_0x3f4aca['query']);_0x12ba8d[_0xc98b('0x30')]=_['intersection'](_0x12ba8d[_0xc98b('0x2d')],_0x12ba8d[_0xc98b('0x2e')]);_0x52763d[_0xc98b('0x31')]=_['intersection'](_0x12ba8d[_0xc98b('0x2d')],qs[_0xc98b('0x32')](_0x3f4aca['query'][_0xc98b('0x32')]));_0x52763d[_0xc98b('0x31')]=_0x52763d[_0xc98b('0x31')][_0xc98b('0x33')]?_0x52763d[_0xc98b('0x31')]:_0x12ba8d['model'];if(!_0x3f4aca[_0xc98b('0x2e')]['hasOwnProperty']('nolimit')){_0x52763d['limit']=qs[_0xc98b('0x19')](_0x3f4aca[_0xc98b('0x2e')][_0xc98b('0x19')]);_0x52763d[_0xc98b('0x18')]=qs[_0xc98b('0x18')](_0x3f4aca[_0xc98b('0x2e')][_0xc98b('0x18')]);}_0x52763d[_0xc98b('0x34')]=qs[_0xc98b('0x35')](_0x3f4aca['query']['sort']);_0x52763d[_0xc98b('0x36')]=qs[_0xc98b('0x30')](_['pick'](_0x3f4aca[_0xc98b('0x2e')],_0x12ba8d[_0xc98b('0x30')]),_0x49fdc5);if(_0x3f4aca['query'][_0xc98b('0x37')]){_0x52763d['where']=_[_0xc98b('0x38')](_0x52763d[_0xc98b('0x36')],{'$or':_[_0xc98b('0x29')](_0x49fdc5,function(_0x549ab8){if(_0x549ab8[_0xc98b('0x2b')]!=='VIRTUAL'){var _0x2839ba={};_0x2839ba[_0x549ab8[_0xc98b('0x27')]]={'$like':'%'+_0x3f4aca[_0xc98b('0x2e')]['filter']+'%'};return _0x2839ba;}})});}_0x52763d=_[_0xc98b('0x38')]({},_0x52763d,_0x3f4aca[_0xc98b('0x39')]);var _0xba15c5={'where':_0x52763d[_0xc98b('0x36')]};return db[_0xc98b('0x3a')][_0xc98b('0x1b')](_0xba15c5)[_0xc98b('0x21')](function(_0x26605c){_0x54566f[_0xc98b('0x1b')]=_0x26605c;if(_0x3f4aca['query'][_0xc98b('0x3b')]){_0x52763d[_0xc98b('0x3c')]=[{'all':!![]}];}return db[_0xc98b('0x3a')]['findAll'](_0x52763d);})[_0xc98b('0x21')](function(_0x1f78db){_0x54566f[_0xc98b('0x3d')]=_0x1f78db;return _0x54566f;})[_0xc98b('0x21')](respondWithFilteredResult(_0x1f53da,_0x52763d))[_0xc98b('0x3e')](handleError(_0x1f53da,null));};exports['show']=function(_0x4e43ae,_0xad53a){var _0x340747={'raw':!![],'where':{'id':_0x4e43ae[_0xc98b('0x3f')]['id']}},_0x3dabdf={};_0x3dabdf[_0xc98b('0x2d')]=_[_0xc98b('0x2f')](db[_0xc98b('0x3a')][_0xc98b('0x40')]);_0x3dabdf[_0xc98b('0x2e')]=_[_0xc98b('0x2f')](_0x4e43ae[_0xc98b('0x2e')]);_0x3dabdf[_0xc98b('0x30')]=_['intersection'](_0x3dabdf[_0xc98b('0x2d')],_0x3dabdf[_0xc98b('0x2e')]);_0x340747[_0xc98b('0x31')]=_[_0xc98b('0x41')](_0x3dabdf[_0xc98b('0x2d')],qs[_0xc98b('0x32')](_0x4e43ae['query'][_0xc98b('0x32')]));_0x340747[_0xc98b('0x31')]=_0x340747['attributes'][_0xc98b('0x33')]?_0x340747[_0xc98b('0x31')]:_0x3dabdf['model'];if(_0x4e43ae['query'][_0xc98b('0x3b')]){_0x340747[_0xc98b('0x3c')]=[{'all':!![]}];}_0x340747=_['merge']({},_0x340747,_0x4e43ae['options']);return db['OpenchannelQueueReport']['find'](_0x340747)[_0xc98b('0x21')](handleEntityNotFound(_0xad53a,null))[_0xc98b('0x21')](respondWithResult(_0xad53a,null))[_0xc98b('0x3e')](handleError(_0xad53a,null));};exports[_0xc98b('0x42')]=function(_0xc05d44,_0x3d56e9){return db['OpenchannelQueueReport'][_0xc98b('0x42')](_0xc05d44['body'],{})[_0xc98b('0x21')](respondWithResult(_0x3d56e9,0xc9))[_0xc98b('0x3e')](handleError(_0x3d56e9,null));};exports[_0xc98b('0x20')]=function(_0x35b48f,_0x533031){if(_0x35b48f[_0xc98b('0x43')]['id']){delete _0x35b48f[_0xc98b('0x43')]['id'];}return db[_0xc98b('0x3a')][_0xc98b('0x44')]({'where':{'id':_0x35b48f[_0xc98b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x533031,null))['then'](saveUpdates(_0x35b48f[_0xc98b('0x43')],null))[_0xc98b('0x21')](respondWithResult(_0x533031,null))[_0xc98b('0x3e')](handleError(_0x533031,null));};exports['destroy']=function(_0x53d904,_0x5bb01d){return db[_0xc98b('0x3a')][_0xc98b('0x44')]({'where':{'id':_0x53d904[_0xc98b('0x3f')]['id']}})[_0xc98b('0x21')](handleEntityNotFound(_0x5bb01d,null))['then'](removeEntity(_0x5bb01d,null))[_0xc98b('0x3e')](handleError(_0x5bb01d,null));};exports[_0xc98b('0x45')]=function(_0x267c08,_0x4c1764){return db[_0xc98b('0x3a')][_0xc98b('0x45')]()[_0xc98b('0x21')](respondWithResult(_0x4c1764,null))[_0xc98b('0x3e')](handleError(_0x4c1764,null));}; \ No newline at end of file +var _0x35d1=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','params','options','create','body','find','describe'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x35d1,0xd5));var _0x135d=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x35d1[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x135d('0x0'));var zipdir=require(_0x135d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x135d('0x2'));var moment=require('moment');var BPromise=require(_0x135d('0x3'));var Mustache=require('mustache');var util=require(_0x135d('0x4'));var path=require(_0x135d('0x5'));var sox=require(_0x135d('0x6'));var csv=require(_0x135d('0x7'));var ejs=require(_0x135d('0x8'));var fs=require('fs');var fs_extra=require(_0x135d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x135d('0xa'));var jsforce=require(_0x135d('0xb'));var deskjs=require(_0x135d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x135d('0xd'));var Papa=require('papaparse');var Redis=require(_0x135d('0xe'));var authService=require(_0x135d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x135d('0x10'));var logger=require(_0x135d('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x135d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405aa2,_0x864a3f){_0x864a3f=_0x864a3f||0xcc;return function(_0x39c431){if(_0x39c431){return _0x405aa2['sendStatus'](_0x864a3f);}return _0x405aa2[_0x135d('0x13')](_0x864a3f)[_0x135d('0x14')]();};}function respondWithResult(_0x201061,_0x153622){_0x153622=_0x153622||0xc8;return function(_0x332173){if(_0x332173){return _0x201061[_0x135d('0x13')](_0x153622)['json'](_0x332173);}};}function respondWithFilteredResult(_0x57fdd4,_0x247823){return function(_0x327931){if(_0x327931){var _0x510f6d=typeof _0x247823[_0x135d('0x15')]==='undefined'&&typeof _0x247823['limit']===_0x135d('0x16');var _0x201f35=_0x327931[_0x135d('0x17')];var _0x9ddc80=_0x510f6d?0x0:_0x247823[_0x135d('0x15')];var _0x2a1342=_0x510f6d?_0x327931[_0x135d('0x17')]:_0x247823[_0x135d('0x15')]+_0x247823['limit'];var _0x583bda;if(_0x2a1342>=_0x201f35){_0x2a1342=_0x201f35;_0x583bda=0xc8;}else{_0x583bda=0xce;}_0x57fdd4[_0x135d('0x13')](_0x583bda);return _0x57fdd4[_0x135d('0x18')](_0x135d('0x19'),_0x9ddc80+'-'+_0x2a1342+'/'+_0x201f35)[_0x135d('0x1a')](_0x327931);}return null;};}function patchUpdates(_0x1bd722){return function(_0x215ade){try{jsonpatch[_0x135d('0x1b')](_0x215ade,_0x1bd722,!![]);}catch(_0xf854b3){return BPromise[_0x135d('0x1c')](_0xf854b3);}return _0x215ade[_0x135d('0x1d')]();};}function saveUpdates(_0x51d5e6,_0x4bc060){return function(_0x4db629){if(_0x4db629){return _0x4db629[_0x135d('0x1e')](_0x51d5e6)['then'](function(_0x5dfcad){return _0x5dfcad;});}return null;};}function removeEntity(_0x48647a,_0x46b3c3){return function(_0x33dfe3){if(_0x33dfe3){return _0x33dfe3[_0x135d('0x1f')]()['then'](function(){_0x48647a[_0x135d('0x13')](0xcc)[_0x135d('0x14')]();});}};}function handleEntityNotFound(_0x3185cc,_0x1c4e4b){return function(_0x4ef59e){if(!_0x4ef59e){_0x3185cc['sendStatus'](0x194);}return _0x4ef59e;};}function handleError(_0x466efe,_0x297d94){_0x297d94=_0x297d94||0x1f4;return function(_0x38cc62){logger[_0x135d('0x20')](_0x38cc62[_0x135d('0x21')]);if(_0x38cc62[_0x135d('0x22')]){delete _0x38cc62[_0x135d('0x22')];}_0x466efe['status'](_0x297d94)['send'](_0x38cc62);};}exports[_0x135d('0x23')]=function(_0x34e66f,_0x191a9c){var _0x17ffbb={},_0x439720={},_0x5d8df5={'count':0x0,'rows':[]};var _0xfb8316=_[_0x135d('0x24')](db[_0x135d('0x25')][_0x135d('0x26')],function(_0x319f3b){return{'name':_0x319f3b[_0x135d('0x27')],'type':_0x319f3b[_0x135d('0x28')][_0x135d('0x29')]};});_0x439720[_0x135d('0x2a')]=_['map'](_0xfb8316,'name');_0x439720[_0x135d('0x2b')]=_[_0x135d('0x2c')](_0x34e66f['query']);_0x439720[_0x135d('0x2d')]=_[_0x135d('0x2e')](_0x439720['model'],_0x439720['query']);_0x17ffbb['attributes']=_[_0x135d('0x2e')](_0x439720[_0x135d('0x2a')],qs[_0x135d('0x2f')](_0x34e66f[_0x135d('0x2b')][_0x135d('0x2f')]));_0x17ffbb[_0x135d('0x30')]=_0x17ffbb[_0x135d('0x30')][_0x135d('0x31')]?_0x17ffbb['attributes']:_0x439720['model'];if(!_0x34e66f[_0x135d('0x2b')][_0x135d('0x32')](_0x135d('0x33'))){_0x17ffbb[_0x135d('0x34')]=qs[_0x135d('0x34')](_0x34e66f['query'][_0x135d('0x34')]);_0x17ffbb[_0x135d('0x15')]=qs['offset'](_0x34e66f[_0x135d('0x2b')][_0x135d('0x15')]);}_0x17ffbb[_0x135d('0x35')]=qs[_0x135d('0x36')](_0x34e66f[_0x135d('0x2b')][_0x135d('0x36')]);_0x17ffbb[_0x135d('0x37')]=qs['filters'](_['pick'](_0x34e66f[_0x135d('0x2b')],_0x439720[_0x135d('0x2d')]),_0xfb8316);if(_0x34e66f[_0x135d('0x2b')][_0x135d('0x38')]){_0x17ffbb[_0x135d('0x37')]=_[_0x135d('0x39')](_0x17ffbb['where'],{'$or':_[_0x135d('0x24')](_0xfb8316,function(_0x5e80ae){if(_0x5e80ae[_0x135d('0x28')]!==_0x135d('0x3a')){var _0xbfaeca={};_0xbfaeca[_0x5e80ae[_0x135d('0x22')]]={'$like':'%'+_0x34e66f[_0x135d('0x2b')]['filter']+'%'};return _0xbfaeca;}})});}_0x17ffbb=_[_0x135d('0x39')]({},_0x17ffbb,_0x34e66f['options']);var _0x398dbb={'where':_0x17ffbb[_0x135d('0x37')]};return db[_0x135d('0x25')][_0x135d('0x17')](_0x398dbb)[_0x135d('0x3b')](function(_0x27b54e){_0x5d8df5[_0x135d('0x17')]=_0x27b54e;if(_0x34e66f[_0x135d('0x2b')][_0x135d('0x3c')]){_0x17ffbb[_0x135d('0x3d')]=[{'all':!![]}];}return db[_0x135d('0x25')][_0x135d('0x3e')](_0x17ffbb);})[_0x135d('0x3b')](function(_0x5674b3){_0x5d8df5['rows']=_0x5674b3;return _0x5d8df5;})[_0x135d('0x3b')](respondWithFilteredResult(_0x191a9c,_0x17ffbb))[_0x135d('0x3f')](handleError(_0x191a9c,null));};exports[_0x135d('0x40')]=function(_0x4ebefe,_0x166930){var _0x445a8c={'raw':!![],'where':{'id':_0x4ebefe[_0x135d('0x41')]['id']}},_0x32e861={};_0x32e861[_0x135d('0x2a')]=_[_0x135d('0x2c')](db[_0x135d('0x25')][_0x135d('0x26')]);_0x32e861['query']=_[_0x135d('0x2c')](_0x4ebefe[_0x135d('0x2b')]);_0x32e861[_0x135d('0x2d')]=_[_0x135d('0x2e')](_0x32e861['model'],_0x32e861[_0x135d('0x2b')]);_0x445a8c[_0x135d('0x30')]=_[_0x135d('0x2e')](_0x32e861[_0x135d('0x2a')],qs[_0x135d('0x2f')](_0x4ebefe['query'][_0x135d('0x2f')]));_0x445a8c[_0x135d('0x30')]=_0x445a8c[_0x135d('0x30')][_0x135d('0x31')]?_0x445a8c[_0x135d('0x30')]:_0x32e861[_0x135d('0x2a')];if(_0x4ebefe[_0x135d('0x2b')][_0x135d('0x3c')]){_0x445a8c[_0x135d('0x3d')]=[{'all':!![]}];}_0x445a8c=_[_0x135d('0x39')]({},_0x445a8c,_0x4ebefe[_0x135d('0x42')]);return db['OpenchannelQueueReport']['find'](_0x445a8c)[_0x135d('0x3b')](handleEntityNotFound(_0x166930,null))[_0x135d('0x3b')](respondWithResult(_0x166930,null))['catch'](handleError(_0x166930,null));};exports[_0x135d('0x43')]=function(_0x23e8a0,_0x23043c){return db[_0x135d('0x25')][_0x135d('0x43')](_0x23e8a0[_0x135d('0x44')],{})['then'](respondWithResult(_0x23043c,0xc9))[_0x135d('0x3f')](handleError(_0x23043c,null));};exports[_0x135d('0x1e')]=function(_0x23a320,_0x363ad7){if(_0x23a320[_0x135d('0x44')]['id']){delete _0x23a320[_0x135d('0x44')]['id'];}return db[_0x135d('0x25')][_0x135d('0x45')]({'where':{'id':_0x23a320['params']['id']}})[_0x135d('0x3b')](handleEntityNotFound(_0x363ad7,null))['then'](saveUpdates(_0x23a320['body'],null))['then'](respondWithResult(_0x363ad7,null))['catch'](handleError(_0x363ad7,null));};exports[_0x135d('0x1f')]=function(_0x23913a,_0x4b6671){return db[_0x135d('0x25')][_0x135d('0x45')]({'where':{'id':_0x23913a[_0x135d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b6671,null))[_0x135d('0x3b')](removeEntity(_0x4b6671,null))[_0x135d('0x3f')](handleError(_0x4b6671,null));};exports[_0x135d('0x46')]=function(_0x583a89,_0x79bb02){return db[_0x135d('0x25')][_0x135d('0x46')]()[_0x135d('0x3b')](respondWithResult(_0x79bb02,null))[_0x135d('0x3f')](handleError(_0x79bb02,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6ea6130..1cc45b5 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2bcc1d,_0x101e28){var _0xa89608=function(_0x39e168){while(--_0x39e168){_0x2bcc1d['push'](_0x2bcc1d['shift']());}};_0xa89608(++_0x101e28);}(_0xe14b,0x93));var _0xbe14=function(_0x5097da,_0x4029c9){_0x5097da=_0x5097da-0x0;var _0x144590=_0xe14b[_0x5097da];return _0x144590;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1f01c7,_0x5223f7){var _0x64b349=function(_0x232d88){while(--_0x232d88){_0x1f01c7['push'](_0x1f01c7['shift']());}};_0x64b349(++_0x5223f7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index e04f7d2..8a11272 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 _0xaa5e=['UpdateOpenchannelQueueReport','update','body','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','debug','catch'];(function(_0x497934,_0x185d41){var _0x3156d9=function(_0x3d7cce){while(--_0x3d7cce){_0x497934['push'](_0x497934['shift']());}};_0x3156d9(++_0x185d41);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x32cf79,_0x4b166c){_0x32cf79=_0x32cf79-0x0;var _0x1119e4=_0xaa5e[_0x32cf79];return _0x1119e4;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});}exports['CreateOpenchannelQueueReport']=function(_0x1877a6){var _0x50256a=this;return new Promise(function(_0x222da7,_0x85fb44){return db[_0xeaa5('0x14')][_0xeaa5('0x15')](_0x1877a6['body'],{'raw':_0x1877a6[_0xeaa5('0x16')]?_0x1877a6[_0xeaa5('0x16')][_0xeaa5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x11ace2){logger[_0xeaa5('0x13')](_0xeaa5('0x18'),_0x1877a6);logger[_0xeaa5('0x19')](_0xeaa5('0x18'),_0x1877a6,JSON['stringify'](_0x11ace2));_0x222da7(_0x11ace2);})[_0xeaa5('0x1a')](function(_0x5f2d83){logger[_0xeaa5('0x10')](_0xeaa5('0x18'),_0x5f2d83[_0xeaa5('0x12')],_0x1877a6);_0x85fb44(_0x50256a[_0xeaa5('0x10')](0x1f4,_0x5f2d83[_0xeaa5('0x12')]));});});};exports[_0xeaa5('0x1b')]=function(_0x355dbd){var _0xee844c=this;return new Promise(function(_0xebce8c,_0x2c4003){return db[_0xeaa5('0x14')][_0xeaa5('0x1c')](_0x355dbd[_0xeaa5('0x1d')],{'raw':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['where']||null:null,'attributes':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')][_0xeaa5('0x1e')]||null:null,'limit':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['limit']||null:null})[_0xeaa5('0x1f')](function(_0x592fe1){logger[_0xeaa5('0x13')](_0xeaa5('0x1b'),_0x355dbd);logger[_0xeaa5('0x19')](_0xeaa5('0x1b'),_0x355dbd,JSON[_0xeaa5('0xf')](_0x592fe1));_0xebce8c(_0x592fe1);})[_0xeaa5('0x1a')](function(_0x5121b6){logger[_0xeaa5('0x10')](_0xeaa5('0x1b'),_0x5121b6['message'],_0x355dbd);_0x2c4003(_0xee844c[_0xeaa5('0x10')](0x1f4,_0x5121b6['message']));});});}; \ No newline at end of file +var _0x1c7c=['raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x42234e,_0x238236){var _0xd8e64c=function(_0x4093b8){while(--_0x4093b8){_0x42234e['push'](_0x42234e['shift']());}};_0xd8e64c(++_0x238236);}(_0x1c7c,0x164));var _0xc1c7=function(_0xa67c04,_0x5cb0b5){_0xa67c04=_0xa67c04-0x0;var _0x538b65=_0x1c7c[_0xa67c04];return _0x538b65;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')](_0xb42702[_0xc1c7('0x1b')],{'raw':_0xb42702[_0xc1c7('0x1c')]?_0xb42702['options'][_0xc1c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e7e4a){logger[_0xc1c7('0xe')]('CreateOpenchannelQueueReport',_0xb42702);logger['debug'](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x5e7e4a));_0x2e93e5(_0x5e7e4a);})[_0xc1c7('0x17')](function(_0x4c6b34){logger[_0xc1c7('0x13')](_0xc1c7('0x18'),_0x4c6b34[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x4c6b34[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x1e')]=function(_0x3180fd){var _0x120168=this;return new Promise(function(_0x22b654,_0x1540c1){return db[_0xc1c7('0x19')][_0xc1c7('0x1f')](_0x3180fd[_0xc1c7('0x1b')],{'raw':_0x3180fd[_0xc1c7('0x1c')]?_0x3180fd[_0xc1c7('0x1c')][_0xc1c7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3180fd['options']?_0x3180fd[_0xc1c7('0x1c')][_0xc1c7('0x20')]||null:null,'attributes':_0x3180fd['options']?_0x3180fd['options'][_0xc1c7('0x21')]||null:null,'limit':_0x3180fd['options']?_0x3180fd['options'][_0xc1c7('0x22')]||null:null})[_0xc1c7('0xd')](function(_0x46d045){logger[_0xc1c7('0xe')](_0xc1c7('0x1e'),_0x3180fd);logger['debug']('UpdateOpenchannelQueueReport',_0x3180fd,JSON[_0xc1c7('0x12')](_0x46d045));_0x22b654(_0x46d045);})[_0xc1c7('0x17')](function(_0x9a0ab3){logger[_0xc1c7('0x13')](_0xc1c7('0x1e'),_0x9a0ab3['message'],_0x3180fd);_0x1540c1(_0x120168['error'](0x1f4,_0x9a0ab3[_0xc1c7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 2d495a8..13ae874 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 _0xee4d=['destroy','util','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','get','/describe','/:id','show','update'];(function(_0x10c96d,_0x4b7a53){var _0x58e63e=function(_0x403f54){while(--_0x403f54){_0x10c96d['push'](_0x10c96d['shift']());}};_0x58e63e(++_0x4b7a53);}(_0xee4d,0x16d));var _0xdee4=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xee4d[_0x28aea5];return _0x6a55f9;};'use strict';var multer=require('multer');var util=require(_0xdee4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdee4('0x1'));var router=express[_0xdee4('0x2')]();var fs_extra=require(_0xdee4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdee4('0x4'));var config=require('../../config/environment');var controller=require(_0xdee4('0x5'));router['get']('/',auth[_0xdee4('0x6')](),controller['index']);router[_0xdee4('0x7')](_0xdee4('0x8'),auth[_0xdee4('0x6')](),controller['describe']);router[_0xdee4('0x7')](_0xdee4('0x9'),auth[_0xdee4('0x6')](),controller[_0xdee4('0xa')]);router['post']('/',auth[_0xdee4('0x6')](),controller['create']);router['put'](_0xdee4('0x9'),auth[_0xdee4('0x6')](),controller[_0xdee4('0xb')]);router['delete'](_0xdee4('0x9'),auth['isAuthenticated'](),controller[_0xdee4('0xc')]);module['exports']=router; \ No newline at end of file +var _0xa071=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1297dc,_0x3720b5){var _0x4c7a70=function(_0x2d74cb){while(--_0x2d74cb){_0x1297dc['push'](_0x1297dc['shift']());}};_0x4c7a70(++_0x3720b5);}(_0xa071,0xca));var _0x1a07=function(_0x2bf2eb,_0x1aafeb){_0x2bf2eb=_0x2bf2eb-0x0;var _0x660889=_0xa071[_0x2bf2eb];return _0x660889;};'use strict';var multer=require(_0x1a07('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1a07('0x1'));var router=express[_0x1a07('0x2')]();var fs_extra=require(_0x1a07('0x3'));var auth=require(_0x1a07('0x4'));var interaction=require(_0x1a07('0x5'));var config=require(_0x1a07('0x6'));var controller=require(_0x1a07('0x7'));router[_0x1a07('0x8')]('/',auth[_0x1a07('0x9')](),controller[_0x1a07('0xa')]);router['get'](_0x1a07('0xb'),auth[_0x1a07('0x9')](),controller[_0x1a07('0xc')]);router[_0x1a07('0x8')](_0x1a07('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1a07('0xe')]('/',auth['isAuthenticated'](),controller[_0x1a07('0xf')]);router['put'](_0x1a07('0xd'),auth[_0x1a07('0x9')](),controller['update']);router[_0x1a07('0x10')](_0x1a07('0xd'),auth['isAuthenticated'](),controller[_0x1a07('0x11')]);module[_0x1a07('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d4f2598..edf1f17 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5eca6f,_0x76ec15){var _0x4c34b7=function(_0x52cbe1){while(--_0x52cbe1){_0x5eca6f['push'](_0x5eca6f['shift']());}};_0x4c34b7(++_0x76ec15);}(_0x008c,0x188));var _0xc008=function(_0x30c83b,_0x1773d9){_0x30c83b=_0x30c83b-0x0;var _0x14bbc9=_0x008c[_0x30c83b];return _0x14bbc9;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x563af1,_0x37924c){var _0x58fccb=function(_0x509595){while(--_0x509595){_0x563af1['push'](_0x563af1['shift']());}};_0x58fccb(++_0x37924c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 39c475d..af16a9a 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 _0x177e=['describe','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','save','then','destroy','end','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','map','keys','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','length','include','catch','create','body','find'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x177e,0xd0));var _0xe177=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x177e[_0x321bb2];return _0x9c12ed;};'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('bluebird');var Mustache=require(_0xe177('0x0'));var util=require(_0xe177('0x1'));var path=require(_0xe177('0x2'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe177('0x3'));var fs=require('fs');var fs_extra=require(_0xe177('0x4'));var _=require(_0xe177('0x5'));var squel=require('squel');var crypto=require(_0xe177('0x6'));var jsforce=require(_0xe177('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xe177('0x8'));var querystring=require(_0xe177('0x9'));var Papa=require(_0xe177('0xa'));var Redis=require(_0xe177('0xb'));var authService=require(_0xe177('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xe177('0xd'));var hardwareService=require(_0xe177('0xe'));var logger=require(_0xe177('0xf'))(_0xe177('0x10'));var utils=require('../../config/utils');var config=require(_0xe177('0x11'));var licenseUtil=require(_0xe177('0x12'));var db=require(_0xe177('0x13'))['db'];function respondWithStatusCode(_0x1b73e8,_0x41117a){_0x41117a=_0x41117a||0xcc;return function(_0x12c669){if(_0x12c669){return _0x1b73e8[_0xe177('0x14')](_0x41117a);}return _0x1b73e8['status'](_0x41117a)['end']();};}function respondWithResult(_0x1ced00,_0x460a93){_0x460a93=_0x460a93||0xc8;return function(_0x2fa50e){if(_0x2fa50e){return _0x1ced00['status'](_0x460a93)[_0xe177('0x15')](_0x2fa50e);}};}function respondWithFilteredResult(_0x22c4bc,_0xf3ed3b){return function(_0x38d4b5){if(_0x38d4b5){var _0x61eb22=typeof _0xf3ed3b[_0xe177('0x16')]==='undefined'&&typeof _0xf3ed3b['limit']===_0xe177('0x17');var _0x590996=_0x38d4b5['count'];var _0x5c3cb6=_0x61eb22?0x0:_0xf3ed3b[_0xe177('0x16')];var _0x59cf0a=_0x61eb22?_0x38d4b5[_0xe177('0x18')]:_0xf3ed3b['offset']+_0xf3ed3b[_0xe177('0x19')];var _0x5a3c8b;if(_0x59cf0a>=_0x590996){_0x59cf0a=_0x590996;_0x5a3c8b=0xc8;}else{_0x5a3c8b=0xce;}_0x22c4bc[_0xe177('0x1a')](_0x5a3c8b);return _0x22c4bc[_0xe177('0x1b')]('Content-Range',_0x5c3cb6+'-'+_0x59cf0a+'/'+_0x590996)[_0xe177('0x15')](_0x38d4b5);}return null;};}function patchUpdates(_0x501cb7){return function(_0x13ee03){try{jsonpatch['apply'](_0x13ee03,_0x501cb7,!![]);}catch(_0x3bf72b){return BPromise['reject'](_0x3bf72b);}return _0x13ee03[_0xe177('0x1c')]();};}function saveUpdates(_0x8fa793,_0x390e45){return function(_0x53c458){if(_0x53c458){return _0x53c458['update'](_0x8fa793)[_0xe177('0x1d')](function(_0x155027){return _0x155027;});}return null;};}function removeEntity(_0x2c124d,_0xdbf075){return function(_0xf82a62){if(_0xf82a62){return _0xf82a62[_0xe177('0x1e')]()[_0xe177('0x1d')](function(){_0x2c124d[_0xe177('0x1a')](0xcc)[_0xe177('0x1f')]();});}};}function handleEntityNotFound(_0x1125e4,_0x10c1ce){return function(_0x15c191){if(!_0x15c191){_0x1125e4[_0xe177('0x14')](0x194);}return _0x15c191;};}function handleError(_0x1501dc,_0x5d3c39){_0x5d3c39=_0x5d3c39||0x1f4;return function(_0x5a8957){logger['error'](_0x5a8957[_0xe177('0x20')]);if(_0x5a8957[_0xe177('0x21')]){delete _0x5a8957['name'];}_0x1501dc['status'](_0x5d3c39)[_0xe177('0x22')](_0x5a8957);};}exports[_0xe177('0x23')]=function(_0x1c519b,_0x59d9f6){var _0x493df2={},_0xf6995b={},_0x1466ab={'count':0x0,'rows':[]};var _0x126d92=_['map'](db[_0xe177('0x24')][_0xe177('0x25')],function(_0x582d1b){return{'name':_0x582d1b[_0xe177('0x26')],'type':_0x582d1b['type'][_0xe177('0x27')]};});_0xf6995b[_0xe177('0x28')]=_[_0xe177('0x29')](_0x126d92,_0xe177('0x21'));_0xf6995b['query']=_[_0xe177('0x2a')](_0x1c519b[_0xe177('0x2b')]);_0xf6995b['filters']=_['intersection'](_0xf6995b['model'],_0xf6995b['query']);_0x493df2[_0xe177('0x2c')]=_['intersection'](_0xf6995b[_0xe177('0x28')],qs[_0xe177('0x2d')](_0x1c519b[_0xe177('0x2b')][_0xe177('0x2d')]));_0x493df2[_0xe177('0x2c')]=_0x493df2['attributes']['length']?_0x493df2[_0xe177('0x2c')]:_0xf6995b[_0xe177('0x28')];if(!_0x1c519b['query'][_0xe177('0x2e')]('nolimit')){_0x493df2[_0xe177('0x19')]=qs['limit'](_0x1c519b[_0xe177('0x2b')]['limit']);_0x493df2[_0xe177('0x16')]=qs[_0xe177('0x16')](_0x1c519b['query'][_0xe177('0x16')]);}_0x493df2[_0xe177('0x2f')]=qs[_0xe177('0x30')](_0x1c519b[_0xe177('0x2b')][_0xe177('0x30')]);_0x493df2[_0xe177('0x31')]=qs[_0xe177('0x32')](_[_0xe177('0x33')](_0x1c519b['query'],_0xf6995b[_0xe177('0x32')]),_0x126d92);if(_0x1c519b['query'][_0xe177('0x34')]){_0x493df2['where']=_[_0xe177('0x35')](_0x493df2[_0xe177('0x31')],{'$or':_[_0xe177('0x29')](_0x126d92,function(_0x2ecfbc){if(_0x2ecfbc['type']!==_0xe177('0x36')){var _0x173841={};_0x173841[_0x2ecfbc[_0xe177('0x21')]]={'$like':'%'+_0x1c519b[_0xe177('0x2b')][_0xe177('0x34')]+'%'};return _0x173841;}})});}_0x493df2=_['merge']({},_0x493df2,_0x1c519b[_0xe177('0x37')]);var _0x5d7129={'where':_0x493df2[_0xe177('0x31')]};return db[_0xe177('0x24')][_0xe177('0x18')](_0x5d7129)[_0xe177('0x1d')](function(_0x3f3489){_0x1466ab[_0xe177('0x18')]=_0x3f3489;if(_0x1c519b['query'][_0xe177('0x38')]){_0x493df2['include']=[{'all':!![]}];}return db[_0xe177('0x24')][_0xe177('0x39')](_0x493df2);})[_0xe177('0x1d')](function(_0x58a004){_0x1466ab[_0xe177('0x3a')]=_0x58a004;return _0x1466ab;})[_0xe177('0x1d')](respondWithFilteredResult(_0x59d9f6,_0x493df2))['catch'](handleError(_0x59d9f6,null));};exports[_0xe177('0x3b')]=function(_0x2d4ef5,_0x96d91c){var _0x224580={'raw':!![],'where':{'id':_0x2d4ef5[_0xe177('0x3c')]['id']}},_0x2e4adf={};_0x2e4adf[_0xe177('0x28')]=_[_0xe177('0x2a')](db['OpenchannelTransferReport'][_0xe177('0x25')]);_0x2e4adf[_0xe177('0x2b')]=_['keys'](_0x2d4ef5[_0xe177('0x2b')]);_0x2e4adf[_0xe177('0x32')]=_[_0xe177('0x3d')](_0x2e4adf[_0xe177('0x28')],_0x2e4adf[_0xe177('0x2b')]);_0x224580[_0xe177('0x2c')]=_[_0xe177('0x3d')](_0x2e4adf[_0xe177('0x28')],qs[_0xe177('0x2d')](_0x2d4ef5[_0xe177('0x2b')][_0xe177('0x2d')]));_0x224580[_0xe177('0x2c')]=_0x224580['attributes'][_0xe177('0x3e')]?_0x224580[_0xe177('0x2c')]:_0x2e4adf['model'];if(_0x2d4ef5[_0xe177('0x2b')][_0xe177('0x38')]){_0x224580[_0xe177('0x3f')]=[{'all':!![]}];}_0x224580=_['merge']({},_0x224580,_0x2d4ef5[_0xe177('0x37')]);return db[_0xe177('0x24')]['find'](_0x224580)['then'](handleEntityNotFound(_0x96d91c,null))['then'](respondWithResult(_0x96d91c,null))[_0xe177('0x40')](handleError(_0x96d91c,null));};exports[_0xe177('0x41')]=function(_0x1ab147,_0x55e089){return db['OpenchannelTransferReport'][_0xe177('0x41')](_0x1ab147[_0xe177('0x42')],{})[_0xe177('0x1d')](respondWithResult(_0x55e089,0xc9))[_0xe177('0x40')](handleError(_0x55e089,null));};exports['update']=function(_0x4d6eb2,_0x5ddf05){if(_0x4d6eb2[_0xe177('0x42')]['id']){delete _0x4d6eb2['body']['id'];}return db[_0xe177('0x24')]['find']({'where':{'id':_0x4d6eb2['params']['id']}})['then'](handleEntityNotFound(_0x5ddf05,null))[_0xe177('0x1d')](saveUpdates(_0x4d6eb2['body'],null))[_0xe177('0x1d')](respondWithResult(_0x5ddf05,null))[_0xe177('0x40')](handleError(_0x5ddf05,null));};exports[_0xe177('0x1e')]=function(_0x45645b,_0x2650e3){return db[_0xe177('0x24')][_0xe177('0x43')]({'where':{'id':_0x45645b[_0xe177('0x3c')]['id']}})[_0xe177('0x1d')](handleEntityNotFound(_0x2650e3,null))[_0xe177('0x1d')](removeEntity(_0x2650e3,null))[_0xe177('0x40')](handleError(_0x2650e3,null));};exports['describe']=function(_0x5a9a39,_0x8d57a6){return db[_0xe177('0x24')][_0xe177('0x44')]()[_0xe177('0x1d')](respondWithResult(_0x8d57a6,null))['catch'](handleError(_0x8d57a6,null));}; \ No newline at end of file +var _0x57c9=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','then','include','rows','catch','show','params','includeAll','merge','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName'];(function(_0x58f621,_0x53e2f9){var _0x162f92=function(_0x5e3be0){while(--_0x5e3be0){_0x58f621['push'](_0x58f621['shift']());}};_0x162f92(++_0x53e2f9);}(_0x57c9,0x18b));var _0x957c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x57c9[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x957c('0x0'));var zipdir=require(_0x957c('0x1'));var jsonpatch=require(_0x957c('0x2'));var rp=require(_0x957c('0x3'));var moment=require('moment');var BPromise=require(_0x957c('0x4'));var Mustache=require(_0x957c('0x5'));var util=require(_0x957c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x957c('0x7'));var ejs=require(_0x957c('0x8'));var fs=require('fs');var fs_extra=require(_0x957c('0x9'));var _=require(_0x957c('0xa'));var squel=require(_0x957c('0xb'));var crypto=require(_0x957c('0xc'));var jsforce=require(_0x957c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x957c('0x7'));var querystring=require(_0x957c('0xe'));var Papa=require(_0x957c('0xf'));var Redis=require('ioredis');var authService=require(_0x957c('0x10'));var qs=require(_0x957c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x957c('0x12'));var logger=require('../../config/logger')(_0x957c('0x13'));var utils=require(_0x957c('0x14'));var config=require(_0x957c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x957c('0x16'))['db'];function respondWithStatusCode(_0x67a268,_0x2d80d7){_0x2d80d7=_0x2d80d7||0xcc;return function(_0x2f74b2){if(_0x2f74b2){return _0x67a268[_0x957c('0x17')](_0x2d80d7);}return _0x67a268['status'](_0x2d80d7)[_0x957c('0x18')]();};}function respondWithResult(_0x47da98,_0x440239){_0x440239=_0x440239||0xc8;return function(_0x2d691e){if(_0x2d691e){return _0x47da98[_0x957c('0x19')](_0x440239)[_0x957c('0x1a')](_0x2d691e);}};}function respondWithFilteredResult(_0x10323e,_0x3f65e1){return function(_0x3c213d){if(_0x3c213d){var _0x4337b1=typeof _0x3f65e1['offset']===_0x957c('0x1b')&&typeof _0x3f65e1['limit']===_0x957c('0x1b');var _0x8628c=_0x3c213d[_0x957c('0x1c')];var _0x24504f=_0x4337b1?0x0:_0x3f65e1[_0x957c('0x1d')];var _0x1e8796=_0x4337b1?_0x3c213d['count']:_0x3f65e1[_0x957c('0x1d')]+_0x3f65e1[_0x957c('0x1e')];var _0x2a4f25;if(_0x1e8796>=_0x8628c){_0x1e8796=_0x8628c;_0x2a4f25=0xc8;}else{_0x2a4f25=0xce;}_0x10323e[_0x957c('0x19')](_0x2a4f25);return _0x10323e[_0x957c('0x1f')](_0x957c('0x20'),_0x24504f+'-'+_0x1e8796+'/'+_0x8628c)[_0x957c('0x1a')](_0x3c213d);}return null;};}function patchUpdates(_0x32d6ed){return function(_0x903259){try{jsonpatch['apply'](_0x903259,_0x32d6ed,!![]);}catch(_0xd97920){return BPromise['reject'](_0xd97920);}return _0x903259[_0x957c('0x21')]();};}function saveUpdates(_0x2520af,_0x436c86){return function(_0x415d1f){if(_0x415d1f){return _0x415d1f[_0x957c('0x22')](_0x2520af)['then'](function(_0x315a29){return _0x315a29;});}return null;};}function removeEntity(_0x30315f,_0x1dbe92){return function(_0x318982){if(_0x318982){return _0x318982['destroy']()['then'](function(){_0x30315f[_0x957c('0x19')](0xcc)[_0x957c('0x18')]();});}};}function handleEntityNotFound(_0x49bf86,_0x2edf97){return function(_0x570e70){if(!_0x570e70){_0x49bf86[_0x957c('0x17')](0x194);}return _0x570e70;};}function handleError(_0x59ddf3,_0x3978ec){_0x3978ec=_0x3978ec||0x1f4;return function(_0x1a0f80){logger[_0x957c('0x23')](_0x1a0f80[_0x957c('0x24')]);if(_0x1a0f80[_0x957c('0x25')]){delete _0x1a0f80[_0x957c('0x25')];}_0x59ddf3['status'](_0x3978ec)[_0x957c('0x26')](_0x1a0f80);};}exports['index']=function(_0x19dbfd,_0xb952ce){var _0xd4d30b={},_0x59a3ce={},_0x3e2bfc={'count':0x0,'rows':[]};var _0x405528=_[_0x957c('0x27')](db[_0x957c('0x28')][_0x957c('0x29')],function(_0x63f815){return{'name':_0x63f815[_0x957c('0x2a')],'type':_0x63f815[_0x957c('0x2b')][_0x957c('0x2c')]};});_0x59a3ce[_0x957c('0x2d')]=_[_0x957c('0x27')](_0x405528,'name');_0x59a3ce[_0x957c('0x2e')]=_[_0x957c('0x2f')](_0x19dbfd[_0x957c('0x2e')]);_0x59a3ce[_0x957c('0x30')]=_[_0x957c('0x31')](_0x59a3ce[_0x957c('0x2d')],_0x59a3ce[_0x957c('0x2e')]);_0xd4d30b[_0x957c('0x32')]=_[_0x957c('0x31')](_0x59a3ce[_0x957c('0x2d')],qs[_0x957c('0x33')](_0x19dbfd[_0x957c('0x2e')][_0x957c('0x33')]));_0xd4d30b[_0x957c('0x32')]=_0xd4d30b['attributes'][_0x957c('0x34')]?_0xd4d30b['attributes']:_0x59a3ce[_0x957c('0x2d')];if(!_0x19dbfd['query'][_0x957c('0x35')](_0x957c('0x36'))){_0xd4d30b[_0x957c('0x1e')]=qs[_0x957c('0x1e')](_0x19dbfd[_0x957c('0x2e')]['limit']);_0xd4d30b[_0x957c('0x1d')]=qs['offset'](_0x19dbfd[_0x957c('0x2e')][_0x957c('0x1d')]);}_0xd4d30b[_0x957c('0x37')]=qs[_0x957c('0x38')](_0x19dbfd[_0x957c('0x2e')][_0x957c('0x38')]);_0xd4d30b[_0x957c('0x39')]=qs[_0x957c('0x30')](_[_0x957c('0x3a')](_0x19dbfd[_0x957c('0x2e')],_0x59a3ce['filters']),_0x405528);if(_0x19dbfd[_0x957c('0x2e')]['filter']){_0xd4d30b[_0x957c('0x39')]=_['merge'](_0xd4d30b[_0x957c('0x39')],{'$or':_[_0x957c('0x27')](_0x405528,function(_0x29e976){if(_0x29e976[_0x957c('0x2b')]!==_0x957c('0x3b')){var _0x466974={};_0x466974[_0x29e976['name']]={'$like':'%'+_0x19dbfd[_0x957c('0x2e')]['filter']+'%'};return _0x466974;}})});}_0xd4d30b=_['merge']({},_0xd4d30b,_0x19dbfd[_0x957c('0x3c')]);var _0x5beebe={'where':_0xd4d30b[_0x957c('0x39')]};return db['OpenchannelTransferReport'][_0x957c('0x1c')](_0x5beebe)[_0x957c('0x3d')](function(_0x502dc5){_0x3e2bfc[_0x957c('0x1c')]=_0x502dc5;if(_0x19dbfd[_0x957c('0x2e')]['includeAll']){_0xd4d30b[_0x957c('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0xd4d30b);})[_0x957c('0x3d')](function(_0x5ea1b8){_0x3e2bfc[_0x957c('0x3f')]=_0x5ea1b8;return _0x3e2bfc;})[_0x957c('0x3d')](respondWithFilteredResult(_0xb952ce,_0xd4d30b))[_0x957c('0x40')](handleError(_0xb952ce,null));};exports[_0x957c('0x41')]=function(_0x39be5e,_0x31e3b8){var _0x5bba6b={'raw':!![],'where':{'id':_0x39be5e[_0x957c('0x42')]['id']}},_0x42c408={};_0x42c408[_0x957c('0x2d')]=_['keys'](db['OpenchannelTransferReport'][_0x957c('0x29')]);_0x42c408[_0x957c('0x2e')]=_[_0x957c('0x2f')](_0x39be5e[_0x957c('0x2e')]);_0x42c408[_0x957c('0x30')]=_[_0x957c('0x31')](_0x42c408[_0x957c('0x2d')],_0x42c408[_0x957c('0x2e')]);_0x5bba6b[_0x957c('0x32')]=_[_0x957c('0x31')](_0x42c408[_0x957c('0x2d')],qs['fields'](_0x39be5e[_0x957c('0x2e')][_0x957c('0x33')]));_0x5bba6b[_0x957c('0x32')]=_0x5bba6b[_0x957c('0x32')][_0x957c('0x34')]?_0x5bba6b[_0x957c('0x32')]:_0x42c408[_0x957c('0x2d')];if(_0x39be5e[_0x957c('0x2e')][_0x957c('0x43')]){_0x5bba6b[_0x957c('0x3e')]=[{'all':!![]}];}_0x5bba6b=_[_0x957c('0x44')]({},_0x5bba6b,_0x39be5e[_0x957c('0x3c')]);return db[_0x957c('0x28')]['find'](_0x5bba6b)[_0x957c('0x3d')](handleEntityNotFound(_0x31e3b8,null))['then'](respondWithResult(_0x31e3b8,null))['catch'](handleError(_0x31e3b8,null));};exports[_0x957c('0x45')]=function(_0x1c08c0,_0x482578){return db[_0x957c('0x28')][_0x957c('0x45')](_0x1c08c0[_0x957c('0x46')],{})[_0x957c('0x3d')](respondWithResult(_0x482578,0xc9))['catch'](handleError(_0x482578,null));};exports[_0x957c('0x22')]=function(_0x8d0296,_0x15f913){if(_0x8d0296[_0x957c('0x46')]['id']){delete _0x8d0296[_0x957c('0x46')]['id'];}return db[_0x957c('0x28')][_0x957c('0x47')]({'where':{'id':_0x8d0296[_0x957c('0x42')]['id']}})[_0x957c('0x3d')](handleEntityNotFound(_0x15f913,null))[_0x957c('0x3d')](saveUpdates(_0x8d0296[_0x957c('0x46')],null))[_0x957c('0x3d')](respondWithResult(_0x15f913,null))[_0x957c('0x40')](handleError(_0x15f913,null));};exports[_0x957c('0x48')]=function(_0xe24723,_0x13ec3a){return db[_0x957c('0x28')]['find']({'where':{'id':_0xe24723['params']['id']}})[_0x957c('0x3d')](handleEntityNotFound(_0x13ec3a,null))[_0x957c('0x3d')](removeEntity(_0x13ec3a,null))[_0x957c('0x40')](handleError(_0x13ec3a,null));};exports['describe']=function(_0x35ae0f,_0x328e9b){return db[_0x957c('0x28')]['describe']()['then'](respondWithResult(_0x328e9b,null))[_0x957c('0x40')](handleError(_0x328e9b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4529358..a06c095 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 _0x8a47=['../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x8a47,0x68));var _0x78a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a47[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x78a4('0x0'));var util=require('util');var logger=require(_0x78a4('0x1'))(_0x78a4('0x2'));var moment=require(_0x78a4('0x3'));var BPromise=require(_0x78a4('0x4'));var rp=require(_0x78a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x78a4('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x78a4('0x7')]=function(_0x2dc2a5,_0x17e719){return _0x2dc2a5['define'](_0x78a4('0x8'),attributes,{'tableName':_0x78a4('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x78a4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bdd=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0bdd,0x17e));var _0xd0bd=function(_0x426e99,_0x2ec5fd){_0x426e99=_0x426e99-0x0;var _0x421bd2=_0x0bdd[_0x426e99];return _0x421bd2;};'use strict';var _=require(_0xd0bd('0x0'));var util=require(_0xd0bd('0x1'));var logger=require(_0xd0bd('0x2'))(_0xd0bd('0x3'));var moment=require(_0xd0bd('0x4'));var BPromise=require(_0xd0bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0bd('0x6'));var rimraf=require(_0xd0bd('0x7'));var config=require(_0xd0bd('0x8'));var attributes=require(_0xd0bd('0x9'));module['exports']=function(_0x16d448,_0x48a7c8){return _0x16d448[_0xd0bd('0xa')](_0xd0bd('0xb'),attributes,{'tableName':_0xd0bd('0xc'),'paranoid':![],'indexes':[{'name':_0xd0bd('0xd'),'fields':[_0xd0bd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index cdf8a9c..300052c 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 _0x1a28=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5c859f,_0x142f72){var _0x5455f2=function(_0x3d3d42){while(--_0x3d3d42){_0x5c859f['push'](_0x5c859f['shift']());}};_0x5455f2(++_0x142f72);}(_0x1a28,0x10e));var _0x81a2=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1a28[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var moment=require(_0x81a2('0x2'));var BPromise=require(_0x81a2('0x3'));var rs=require(_0x81a2('0x4'));var fs=require('fs');var Redis=require(_0x81a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x81a2('0x6'))(_0x81a2('0x7'));var config=require(_0x81a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81a2('0x9')][_0x81a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597932,_0x1aa420,_0x2aa66f){return new BPromise(function(_0x453392,_0x4672ce){return client[_0x81a2('0xb')](_0x597932,_0x2aa66f)[_0x81a2('0xc')](function(_0x3f36f5){logger[_0x81a2('0xd')](_0x81a2('0xe'),_0x1aa420,'request\x20sent');logger[_0x81a2('0xf')](_0x81a2('0x10'),_0x1aa420,_0x81a2('0x11'),JSON[_0x81a2('0x12')](_0x3f36f5));if(_0x3f36f5[_0x81a2('0x13')]){if(_0x3f36f5['error'][_0x81a2('0x14')]===0x1f4){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);return _0x4672ce(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}logger[_0x81a2('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1aa420,_0x3f36f5[_0x81a2('0x13')]['message']);return _0x453392(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}else{logger['info'](_0x81a2('0xe'),_0x1aa420,'request\x20sent');_0x453392(_0x3f36f5[_0x81a2('0x16')][_0x81a2('0x15')]);}})[_0x81a2('0x17')](function(_0x7da352){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x7da352);_0x4672ce(_0x7da352);});});} \ No newline at end of file +var _0x0e17=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x0e17,0xd6));var _0x70e1=function(_0x3c6bf2,_0x3d3b3f){_0x3c6bf2=_0x3c6bf2-0x0;var _0x26edf4=_0x0e17[_0x3c6bf2];return _0x26edf4;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var moment=require(_0x70e1('0x2'));var BPromise=require(_0x70e1('0x3'));var rs=require(_0x70e1('0x4'));var fs=require('fs');var Redis=require(_0x70e1('0x5'));var db=require(_0x70e1('0x6'))['db'];var utils=require(_0x70e1('0x7'));var logger=require(_0x70e1('0x8'))(_0x70e1('0x9'));var config=require(_0x70e1('0xa'));var jayson=require(_0x70e1('0xb'));var client=jayson['client'][_0x70e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a2ad,_0x191d53,_0x27f310){return new BPromise(function(_0x26218a,_0x2c45c3){return client['request'](_0x16a2ad,_0x27f310)['then'](function(_0xfe25b1){logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));logger['debug'](_0x70e1('0xf'),_0x191d53,_0x70e1('0xe'),JSON['stringify'](_0xfe25b1));if(_0xfe25b1[_0x70e1('0x10')]){if(_0xfe25b1['error'][_0x70e1('0x11')]===0x1f4){logger['error'](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x2c45c3(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x26218a(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}else{logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));_0x26218a(_0xfe25b1[_0x70e1('0x13')][_0x70e1('0x12')]);}})[_0x70e1('0x14')](function(_0xc18a09){logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xc18a09);_0x2c45c3(_0xc18a09);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index dd24c6d..3ec9b04 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 _0xe40d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3f1fdc,_0x39133b){var _0x20850e=function(_0x57cb70){while(--_0x57cb70){_0x3f1fdc['push'](_0x3f1fdc['shift']());}};_0x20850e(++_0x39133b);}(_0xe40d,0x133));var _0xde40=function(_0x5627c4,_0x3edefb){_0x5627c4=_0x5627c4-0x0;var _0x57923e=_0xe40d[_0x5627c4];return _0x57923e;};'use strict';var multer=require(_0xde40('0x0'));var util=require(_0xde40('0x1'));var path=require(_0xde40('0x2'));var timeout=require(_0xde40('0x3'));var express=require(_0xde40('0x4'));var router=express[_0xde40('0x5')]();var fs_extra=require(_0xde40('0x6'));var auth=require(_0xde40('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xde40('0x8'));var controller=require(_0xde40('0x9'));router[_0xde40('0xa')]('/',auth['isAuthenticated'](),controller[_0xde40('0xb')]);router[_0xde40('0xa')](_0xde40('0xc'),auth[_0xde40('0xd')](),controller[_0xde40('0xe')]);router[_0xde40('0xf')]('/',auth['isAuthenticated'](),controller[_0xde40('0x10')]);router[_0xde40('0x11')](_0xde40('0xc'),auth[_0xde40('0xd')](),controller[_0xde40('0x12')]);router[_0xde40('0x13')](_0xde40('0xc'),auth['isAuthenticated'](),controller[_0xde40('0x14')]);module[_0xde40('0x15')]=router; \ No newline at end of file +var _0x9cbb=['put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x9cbb,0x103));var _0xb9cb=function(_0x13d481,_0x17bc03){_0x13d481=_0x13d481-0x0;var _0x11de99=_0x9cbb[_0x13d481];return _0x11de99;};'use strict';var multer=require(_0xb9cb('0x0'));var util=require(_0xb9cb('0x1'));var path=require(_0xb9cb('0x2'));var timeout=require(_0xb9cb('0x3'));var express=require(_0xb9cb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb9cb('0x5'));var config=require(_0xb9cb('0x6'));var controller=require('./pause.controller');router['get']('/',auth[_0xb9cb('0x7')](),controller[_0xb9cb('0x8')]);router[_0xb9cb('0x9')](_0xb9cb('0xa'),auth[_0xb9cb('0x7')](),controller[_0xb9cb('0xb')]);router['post']('/',auth[_0xb9cb('0x7')](),controller[_0xb9cb('0xc')]);router[_0xb9cb('0xd')](_0xb9cb('0xa'),auth[_0xb9cb('0x7')](),controller[_0xb9cb('0xe')]);router[_0xb9cb('0xf')](_0xb9cb('0xa'),auth[_0xb9cb('0x7')](),controller[_0xb9cb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index dbc2e5b..ad17ffb 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 _0x041a=['name','exports'];(function(_0x193585,_0x1bff48){var _0x12309d=function(_0x1681fd){while(--_0x1681fd){_0x193585['push'](_0x193585['shift']());}};_0x12309d(++_0x1bff48);}(_0x041a,0x111));var _0xa041=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0x041a[_0x12309b];return _0x482e4d;};'use strict';var Sequelize=require('sequelize');module[_0xa041('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa041('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f7a=['sequelize','exports','name','STRING'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9f7a,0xbc));var _0xa9f7=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x9f7a[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0xa9f7('0x0'));module[_0xa9f7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa9f7('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa9f7('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c6f1ee5..58d7a1a 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 _0x1d8b=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','get','Pauses','UserProfileResource','sendStatus','error','name','send','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','includeAll','include','Pause','findAll','rows','catch','show','options'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1d8b,0xa5));var _0xb1d8=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x1d8b[_0x1b7368];return _0x25d54c;};'use strict';var emlformat=require(_0xb1d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1d8('0x1'));var jsonpatch=require(_0xb1d8('0x2'));var rp=require(_0xb1d8('0x3'));var moment=require(_0xb1d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb1d8('0x5'));var util=require(_0xb1d8('0x6'));var path=require(_0xb1d8('0x7'));var sox=require(_0xb1d8('0x8'));var csv=require(_0xb1d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1d8('0xa'));var _=require('lodash');var squel=require(_0xb1d8('0xb'));var crypto=require(_0xb1d8('0xc'));var jsforce=require(_0xb1d8('0xd'));var deskjs=require(_0xb1d8('0xe'));var toCsv=require(_0xb1d8('0x9'));var querystring=require(_0xb1d8('0xf'));var Papa=require(_0xb1d8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb1d8('0x11'));var as=require(_0xb1d8('0x12'));var hardwareService=require(_0xb1d8('0x13'));var logger=require('../../config/logger')(_0xb1d8('0x14'));var utils=require(_0xb1d8('0x15'));var config=require(_0xb1d8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1d8('0x17'))['db'];function respondWithStatusCode(_0x5b09d8,_0x33304b){_0x33304b=_0x33304b||0xcc;return function(_0x121376){if(_0x121376){return _0x5b09d8['sendStatus'](_0x33304b);}return _0x5b09d8[_0xb1d8('0x18')](_0x33304b)[_0xb1d8('0x19')]();};}function respondWithResult(_0x50630f,_0x4df25e){_0x4df25e=_0x4df25e||0xc8;return function(_0x3ec4b9){if(_0x3ec4b9){return _0x50630f['status'](_0x4df25e)['json'](_0x3ec4b9);}};}function respondWithFilteredResult(_0x393101,_0x431c09){return function(_0x4b3b57){if(_0x4b3b57){var _0x5015d7=typeof _0x431c09[_0xb1d8('0x1a')]==='undefined'&&typeof _0x431c09[_0xb1d8('0x1b')]==='undefined';var _0x1d502b=_0x4b3b57[_0xb1d8('0x1c')];var _0x12324f=_0x5015d7?0x0:_0x431c09['offset'];var _0xc82df0=_0x5015d7?_0x4b3b57[_0xb1d8('0x1c')]:_0x431c09[_0xb1d8('0x1a')]+_0x431c09[_0xb1d8('0x1b')];var _0x369859;if(_0xc82df0>=_0x1d502b){_0xc82df0=_0x1d502b;_0x369859=0xc8;}else{_0x369859=0xce;}_0x393101['status'](_0x369859);return _0x393101[_0xb1d8('0x1d')](_0xb1d8('0x1e'),_0x12324f+'-'+_0xc82df0+'/'+_0x1d502b)[_0xb1d8('0x1f')](_0x4b3b57);}return null;};}function patchUpdates(_0x11847e){return function(_0x55fdc3){try{jsonpatch[_0xb1d8('0x20')](_0x55fdc3,_0x11847e,!![]);}catch(_0x48bd6a){return BPromise['reject'](_0x48bd6a);}return _0x55fdc3[_0xb1d8('0x21')]();};}function saveUpdates(_0x4f9846,_0x3a3e3f){return function(_0x1113eb){if(_0x1113eb){return _0x1113eb[_0xb1d8('0x22')](_0x4f9846)[_0xb1d8('0x23')](function(_0x156c04){return _0x156c04;});}return null;};}function removeEntity(_0x370337,_0x40a1ec){return function(_0x38ed98){if(_0x38ed98){return _0x38ed98['destroy']()[_0xb1d8('0x23')](function(){var _0xdadf2d=_0x38ed98[_0xb1d8('0x24')]({'plain':!![]});var _0xcb5aca=_0xb1d8('0x25');return db[_0xb1d8('0x26')]['destroy']({'where':{'type':_0xcb5aca,'resourceId':_0xdadf2d['id']}})[_0xb1d8('0x23')](function(){return _0x38ed98;});})[_0xb1d8('0x23')](function(){_0x370337[_0xb1d8('0x18')](0xcc)[_0xb1d8('0x19')]();});}};}function handleEntityNotFound(_0x26b85b,_0x15f2f7){return function(_0x377650){if(!_0x377650){_0x26b85b[_0xb1d8('0x27')](0x194);}return _0x377650;};}function handleError(_0x11c792,_0x439f08){_0x439f08=_0x439f08||0x1f4;return function(_0x3203b3){logger[_0xb1d8('0x28')](_0x3203b3['stack']);if(_0x3203b3[_0xb1d8('0x29')]){delete _0x3203b3[_0xb1d8('0x29')];}_0x11c792['status'](_0x439f08)[_0xb1d8('0x2a')](_0x3203b3);};}exports['index']=function(_0x58f8c0,_0x34924a){var _0xd9e69a={},_0x2933bf={},_0x2d1232={'count':0x0,'rows':[]};var _0xf7b905=_[_0xb1d8('0x2b')](db['Pause']['rawAttributes'],function(_0x56061a){return{'name':_0x56061a['fieldName'],'type':_0x56061a[_0xb1d8('0x2c')][_0xb1d8('0x2d')]};});_0x2933bf[_0xb1d8('0x2e')]=_[_0xb1d8('0x2b')](_0xf7b905,'name');_0x2933bf[_0xb1d8('0x2f')]=_[_0xb1d8('0x30')](_0x58f8c0[_0xb1d8('0x2f')]);_0x2933bf['filters']=_[_0xb1d8('0x31')](_0x2933bf['model'],_0x2933bf[_0xb1d8('0x2f')]);_0xd9e69a[_0xb1d8('0x32')]=_['intersection'](_0x2933bf[_0xb1d8('0x2e')],qs[_0xb1d8('0x33')](_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x33')]));_0xd9e69a[_0xb1d8('0x32')]=_0xd9e69a[_0xb1d8('0x32')][_0xb1d8('0x34')]?_0xd9e69a[_0xb1d8('0x32')]:_0x2933bf[_0xb1d8('0x2e')];if(!_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x35')](_0xb1d8('0x36'))){_0xd9e69a['limit']=qs[_0xb1d8('0x1b')](_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x1b')]);_0xd9e69a[_0xb1d8('0x1a')]=qs[_0xb1d8('0x1a')](_0x58f8c0['query'][_0xb1d8('0x1a')]);}_0xd9e69a['order']=qs['sort'](_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x37')]);_0xd9e69a['where']=qs[_0xb1d8('0x38')](_[_0xb1d8('0x39')](_0x58f8c0[_0xb1d8('0x2f')],_0x2933bf[_0xb1d8('0x38')]),_0xf7b905);if(_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x3a')]){_0xd9e69a[_0xb1d8('0x3b')]=_[_0xb1d8('0x3c')](_0xd9e69a[_0xb1d8('0x3b')],{'$or':_[_0xb1d8('0x2b')](_0xf7b905,function(_0x3cfda6){if(_0x3cfda6[_0xb1d8('0x2c')]!=='VIRTUAL'){var _0x44088b={};_0x44088b[_0x3cfda6[_0xb1d8('0x29')]]={'$like':'%'+_0x58f8c0['query']['filter']+'%'};return _0x44088b;}})});}_0xd9e69a=_['merge']({},_0xd9e69a,_0x58f8c0['options']);var _0x2bf79d={'where':_0xd9e69a[_0xb1d8('0x3b')]};return db['Pause']['count'](_0x2bf79d)['then'](function(_0x3f68f3){_0x2d1232[_0xb1d8('0x1c')]=_0x3f68f3;if(_0x58f8c0[_0xb1d8('0x2f')][_0xb1d8('0x3d')]){_0xd9e69a[_0xb1d8('0x3e')]=[{'all':!![]}];}return db[_0xb1d8('0x3f')][_0xb1d8('0x40')](_0xd9e69a);})['then'](function(_0x4b059c){_0x2d1232[_0xb1d8('0x41')]=_0x4b059c;return _0x2d1232;})[_0xb1d8('0x23')](respondWithFilteredResult(_0x34924a,_0xd9e69a))[_0xb1d8('0x42')](handleError(_0x34924a,null));};exports[_0xb1d8('0x43')]=function(_0x1748f5,_0x47ac99){var _0x5703df={'raw':!![],'where':{'id':_0x1748f5['params']['id']}},_0x593311={};_0x593311['model']=_[_0xb1d8('0x30')](db['Pause']['rawAttributes']);_0x593311[_0xb1d8('0x2f')]=_[_0xb1d8('0x30')](_0x1748f5[_0xb1d8('0x2f')]);_0x593311[_0xb1d8('0x38')]=_[_0xb1d8('0x31')](_0x593311[_0xb1d8('0x2e')],_0x593311[_0xb1d8('0x2f')]);_0x5703df[_0xb1d8('0x32')]=_[_0xb1d8('0x31')](_0x593311[_0xb1d8('0x2e')],qs['fields'](_0x1748f5[_0xb1d8('0x2f')][_0xb1d8('0x33')]));_0x5703df[_0xb1d8('0x32')]=_0x5703df['attributes']['length']?_0x5703df[_0xb1d8('0x32')]:_0x593311[_0xb1d8('0x2e')];if(_0x1748f5[_0xb1d8('0x2f')][_0xb1d8('0x3d')]){_0x5703df[_0xb1d8('0x3e')]=[{'all':!![]}];}_0x5703df=_[_0xb1d8('0x3c')]({},_0x5703df,_0x1748f5[_0xb1d8('0x44')]);return db['Pause'][_0xb1d8('0x45')](_0x5703df)[_0xb1d8('0x23')](handleEntityNotFound(_0x47ac99,null))[_0xb1d8('0x23')](respondWithResult(_0x47ac99,null))[_0xb1d8('0x42')](handleError(_0x47ac99,null));};exports[_0xb1d8('0x46')]=function(_0x24a6c1,_0x789395){return db['Pause'][_0xb1d8('0x46')](_0x24a6c1[_0xb1d8('0x47')],{})[_0xb1d8('0x23')](function(_0x5c2290){var _0xe7a89e=_0x24a6c1[_0xb1d8('0x48')][_0xb1d8('0x24')]({'plain':!![]});if(!_0xe7a89e)throw new Error(_0xb1d8('0x49'));if(_0xe7a89e[_0xb1d8('0x4a')]==='user'){var _0x30d5d3=_0x5c2290[_0xb1d8('0x24')]({'plain':!![]});var _0x1a1ef3='Pauses';return db['UserProfileSection'][_0xb1d8('0x45')]({'where':{'name':_0x1a1ef3,'userProfileId':_0xe7a89e['userProfileId']},'raw':!![]})['then'](function(_0x517275){if(_0x517275&&_0x517275[_0xb1d8('0x4b')]===0x0){return db['UserProfileResource'][_0xb1d8('0x46')]({'name':_0x30d5d3[_0xb1d8('0x29')],'resourceId':_0x30d5d3['id'],'type':_0x517275[_0xb1d8('0x29')],'sectionId':_0x517275['id']},{})[_0xb1d8('0x23')](function(){return _0x5c2290;});}else{return _0x5c2290;}})['catch'](function(_0x2a6c1c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a6c1c);throw _0x2a6c1c;});}return _0x5c2290;})[_0xb1d8('0x23')](respondWithResult(_0x789395,0xc9))[_0xb1d8('0x42')](handleError(_0x789395,null));};exports[_0xb1d8('0x22')]=function(_0x5ab1d5,_0x219078){if(_0x5ab1d5[_0xb1d8('0x47')]['id']){delete _0x5ab1d5[_0xb1d8('0x47')]['id'];}return db[_0xb1d8('0x3f')][_0xb1d8('0x45')]({'where':{'id':_0x5ab1d5[_0xb1d8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x219078,null))[_0xb1d8('0x23')](saveUpdates(_0x5ab1d5[_0xb1d8('0x47')],null))[_0xb1d8('0x23')](respondWithResult(_0x219078,null))[_0xb1d8('0x42')](handleError(_0x219078,null));};exports[_0xb1d8('0x4d')]=function(_0x1f9c3d,_0x201038){return db[_0xb1d8('0x3f')][_0xb1d8('0x45')]({'where':{'id':_0x1f9c3d[_0xb1d8('0x4c')]['id']}})[_0xb1d8('0x23')](handleEntityNotFound(_0x201038,null))[_0xb1d8('0x23')](removeEntity(_0x201038,null))[_0xb1d8('0x42')](handleError(_0x201038,null));}; \ No newline at end of file +var _0xec71=['apply','reject','save','update','then','destroy','Pauses','UserProfileResource','name','index','map','Pause','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json'];(function(_0x1c6845,_0x4f8848){var _0x456716=function(_0x270a37){while(--_0x270a37){_0x1c6845['push'](_0x1c6845['shift']());}};_0x456716(++_0x4f8848);}(_0xec71,0xd3));var _0x1ec7=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xec71[_0x359bbe];return _0x1b3353;};'use strict';var emlformat=require(_0x1ec7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1ec7('0x1'));var moment=require(_0x1ec7('0x2'));var BPromise=require(_0x1ec7('0x3'));var Mustache=require(_0x1ec7('0x4'));var util=require(_0x1ec7('0x5'));var path=require(_0x1ec7('0x6'));var sox=require(_0x1ec7('0x7'));var csv=require('to-csv');var ejs=require(_0x1ec7('0x8'));var fs=require('fs');var fs_extra=require(_0x1ec7('0x9'));var _=require('lodash');var squel=require(_0x1ec7('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ec7('0xb'));var toCsv=require(_0x1ec7('0xc'));var querystring=require('querystring');var Papa=require(_0x1ec7('0xd'));var Redis=require(_0x1ec7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ec7('0xf'));var hardwareService=require(_0x1ec7('0x10'));var logger=require(_0x1ec7('0x11'))('api');var utils=require(_0x1ec7('0x12'));var config=require(_0x1ec7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ec7('0x14'))['db'];function respondWithStatusCode(_0x3cc880,_0x2f6727){_0x2f6727=_0x2f6727||0xcc;return function(_0x4b1fe0){if(_0x4b1fe0){return _0x3cc880[_0x1ec7('0x15')](_0x2f6727);}return _0x3cc880[_0x1ec7('0x16')](_0x2f6727)['end']();};}function respondWithResult(_0x2d3213,_0x45a71d){_0x45a71d=_0x45a71d||0xc8;return function(_0x222ec4){if(_0x222ec4){return _0x2d3213[_0x1ec7('0x16')](_0x45a71d)['json'](_0x222ec4);}};}function respondWithFilteredResult(_0x59eb39,_0x5af007){return function(_0x4e9973){if(_0x4e9973){var _0xd8a923=typeof _0x5af007[_0x1ec7('0x17')]===_0x1ec7('0x18')&&typeof _0x5af007[_0x1ec7('0x19')]===_0x1ec7('0x18');var _0x1f0341=_0x4e9973[_0x1ec7('0x1a')];var _0x4f0151=_0xd8a923?0x0:_0x5af007[_0x1ec7('0x17')];var _0x3f0d2a=_0xd8a923?_0x4e9973[_0x1ec7('0x1a')]:_0x5af007[_0x1ec7('0x17')]+_0x5af007[_0x1ec7('0x19')];var _0x337f95;if(_0x3f0d2a>=_0x1f0341){_0x3f0d2a=_0x1f0341;_0x337f95=0xc8;}else{_0x337f95=0xce;}_0x59eb39[_0x1ec7('0x16')](_0x337f95);return _0x59eb39[_0x1ec7('0x1b')]('Content-Range',_0x4f0151+'-'+_0x3f0d2a+'/'+_0x1f0341)[_0x1ec7('0x1c')](_0x4e9973);}return null;};}function patchUpdates(_0x3ac40c){return function(_0x3337ca){try{jsonpatch[_0x1ec7('0x1d')](_0x3337ca,_0x3ac40c,!![]);}catch(_0x581e2b){return BPromise[_0x1ec7('0x1e')](_0x581e2b);}return _0x3337ca[_0x1ec7('0x1f')]();};}function saveUpdates(_0xda7aa9,_0x6f1a80){return function(_0x1f805e){if(_0x1f805e){return _0x1f805e[_0x1ec7('0x20')](_0xda7aa9)[_0x1ec7('0x21')](function(_0x3f162d){return _0x3f162d;});}return null;};}function removeEntity(_0x1a0efa,_0x1513d2){return function(_0x89e29c){if(_0x89e29c){return _0x89e29c[_0x1ec7('0x22')]()['then'](function(){var _0xd996eb=_0x89e29c['get']({'plain':!![]});var _0x27826d=_0x1ec7('0x23');return db[_0x1ec7('0x24')][_0x1ec7('0x22')]({'where':{'type':_0x27826d,'resourceId':_0xd996eb['id']}})[_0x1ec7('0x21')](function(){return _0x89e29c;});})[_0x1ec7('0x21')](function(){_0x1a0efa[_0x1ec7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3461e7,_0x519ada){return function(_0x55ec87){if(!_0x55ec87){_0x3461e7[_0x1ec7('0x15')](0x194);}return _0x55ec87;};}function handleError(_0x37a96e,_0x1aa1f2){_0x1aa1f2=_0x1aa1f2||0x1f4;return function(_0x45dc09){logger['error'](_0x45dc09['stack']);if(_0x45dc09[_0x1ec7('0x25')]){delete _0x45dc09[_0x1ec7('0x25')];}_0x37a96e[_0x1ec7('0x16')](_0x1aa1f2)['send'](_0x45dc09);};}exports[_0x1ec7('0x26')]=function(_0x2b7e2d,_0x35ab5e){var _0x2175a9={},_0x285d7d={},_0x3fd595={'count':0x0,'rows':[]};var _0x4d2500=_[_0x1ec7('0x27')](db[_0x1ec7('0x28')][_0x1ec7('0x29')],function(_0x3053f6){return{'name':_0x3053f6[_0x1ec7('0x2a')],'type':_0x3053f6[_0x1ec7('0x2b')][_0x1ec7('0x2c')]};});_0x285d7d[_0x1ec7('0x2d')]=_[_0x1ec7('0x27')](_0x4d2500,_0x1ec7('0x25'));_0x285d7d[_0x1ec7('0x2e')]=_['keys'](_0x2b7e2d[_0x1ec7('0x2e')]);_0x285d7d[_0x1ec7('0x2f')]=_['intersection'](_0x285d7d[_0x1ec7('0x2d')],_0x285d7d[_0x1ec7('0x2e')]);_0x2175a9[_0x1ec7('0x30')]=_[_0x1ec7('0x31')](_0x285d7d[_0x1ec7('0x2d')],qs[_0x1ec7('0x32')](_0x2b7e2d[_0x1ec7('0x2e')][_0x1ec7('0x32')]));_0x2175a9[_0x1ec7('0x30')]=_0x2175a9[_0x1ec7('0x30')]['length']?_0x2175a9[_0x1ec7('0x30')]:_0x285d7d[_0x1ec7('0x2d')];if(!_0x2b7e2d['query'][_0x1ec7('0x33')](_0x1ec7('0x34'))){_0x2175a9[_0x1ec7('0x19')]=qs[_0x1ec7('0x19')](_0x2b7e2d[_0x1ec7('0x2e')][_0x1ec7('0x19')]);_0x2175a9[_0x1ec7('0x17')]=qs[_0x1ec7('0x17')](_0x2b7e2d[_0x1ec7('0x2e')]['offset']);}_0x2175a9['order']=qs[_0x1ec7('0x35')](_0x2b7e2d[_0x1ec7('0x2e')][_0x1ec7('0x35')]);_0x2175a9[_0x1ec7('0x36')]=qs[_0x1ec7('0x2f')](_[_0x1ec7('0x37')](_0x2b7e2d[_0x1ec7('0x2e')],_0x285d7d[_0x1ec7('0x2f')]),_0x4d2500);if(_0x2b7e2d['query'][_0x1ec7('0x38')]){_0x2175a9[_0x1ec7('0x36')]=_['merge'](_0x2175a9[_0x1ec7('0x36')],{'$or':_[_0x1ec7('0x27')](_0x4d2500,function(_0x37048f){if(_0x37048f['type']!==_0x1ec7('0x39')){var _0x3661cc={};_0x3661cc[_0x37048f[_0x1ec7('0x25')]]={'$like':'%'+_0x2b7e2d[_0x1ec7('0x2e')]['filter']+'%'};return _0x3661cc;}})});}_0x2175a9=_[_0x1ec7('0x3a')]({},_0x2175a9,_0x2b7e2d[_0x1ec7('0x3b')]);var _0xc5c2b2={'where':_0x2175a9[_0x1ec7('0x36')]};return db[_0x1ec7('0x28')]['count'](_0xc5c2b2)[_0x1ec7('0x21')](function(_0x39f2ff){_0x3fd595[_0x1ec7('0x1a')]=_0x39f2ff;if(_0x2b7e2d[_0x1ec7('0x2e')][_0x1ec7('0x3c')]){_0x2175a9['include']=[{'all':!![]}];}return db[_0x1ec7('0x28')][_0x1ec7('0x3d')](_0x2175a9);})['then'](function(_0x1919cd){_0x3fd595[_0x1ec7('0x3e')]=_0x1919cd;return _0x3fd595;})[_0x1ec7('0x21')](respondWithFilteredResult(_0x35ab5e,_0x2175a9))[_0x1ec7('0x3f')](handleError(_0x35ab5e,null));};exports[_0x1ec7('0x40')]=function(_0x3c2f72,_0x5e67e1){var _0x2183c7={'raw':!![],'where':{'id':_0x3c2f72[_0x1ec7('0x41')]['id']}},_0x2e35fc={};_0x2e35fc[_0x1ec7('0x2d')]=_['keys'](db[_0x1ec7('0x28')][_0x1ec7('0x29')]);_0x2e35fc[_0x1ec7('0x2e')]=_[_0x1ec7('0x42')](_0x3c2f72[_0x1ec7('0x2e')]);_0x2e35fc[_0x1ec7('0x2f')]=_[_0x1ec7('0x31')](_0x2e35fc[_0x1ec7('0x2d')],_0x2e35fc['query']);_0x2183c7['attributes']=_[_0x1ec7('0x31')](_0x2e35fc[_0x1ec7('0x2d')],qs[_0x1ec7('0x32')](_0x3c2f72[_0x1ec7('0x2e')]['fields']));_0x2183c7['attributes']=_0x2183c7[_0x1ec7('0x30')]['length']?_0x2183c7['attributes']:_0x2e35fc[_0x1ec7('0x2d')];if(_0x3c2f72[_0x1ec7('0x2e')]['includeAll']){_0x2183c7[_0x1ec7('0x43')]=[{'all':!![]}];}_0x2183c7=_[_0x1ec7('0x3a')]({},_0x2183c7,_0x3c2f72[_0x1ec7('0x3b')]);return db[_0x1ec7('0x28')][_0x1ec7('0x44')](_0x2183c7)[_0x1ec7('0x21')](handleEntityNotFound(_0x5e67e1,null))[_0x1ec7('0x21')](respondWithResult(_0x5e67e1,null))['catch'](handleError(_0x5e67e1,null));};exports[_0x1ec7('0x45')]=function(_0x15750a,_0x13a8a9){return db[_0x1ec7('0x28')][_0x1ec7('0x45')](_0x15750a[_0x1ec7('0x46')],{})[_0x1ec7('0x21')](function(_0x2bbe1c){var _0x2ccd09=_0x15750a['user'][_0x1ec7('0x47')]({'plain':!![]});if(!_0x2ccd09)throw new Error(_0x1ec7('0x48'));if(_0x2ccd09[_0x1ec7('0x49')]===_0x1ec7('0x4a')){var _0x5ef256=_0x2bbe1c['get']({'plain':!![]});var _0x5acf88=_0x1ec7('0x23');return db[_0x1ec7('0x4b')][_0x1ec7('0x44')]({'where':{'name':_0x5acf88,'userProfileId':_0x2ccd09[_0x1ec7('0x4c')]},'raw':!![]})[_0x1ec7('0x21')](function(_0x47f2ee){if(_0x47f2ee&&_0x47f2ee[_0x1ec7('0x4d')]===0x0){return db[_0x1ec7('0x24')][_0x1ec7('0x45')]({'name':_0x5ef256['name'],'resourceId':_0x5ef256['id'],'type':_0x47f2ee[_0x1ec7('0x25')],'sectionId':_0x47f2ee['id']},{})[_0x1ec7('0x21')](function(){return _0x2bbe1c;});}else{return _0x2bbe1c;}})[_0x1ec7('0x3f')](function(_0x1f796c){logger[_0x1ec7('0x4e')](_0x1ec7('0x4f'),_0x1f796c);throw _0x1f796c;});}return _0x2bbe1c;})['then'](respondWithResult(_0x13a8a9,0xc9))[_0x1ec7('0x3f')](handleError(_0x13a8a9,null));};exports[_0x1ec7('0x20')]=function(_0x3a9b03,_0x4b7db5){if(_0x3a9b03[_0x1ec7('0x46')]['id']){delete _0x3a9b03[_0x1ec7('0x46')]['id'];}return db[_0x1ec7('0x28')][_0x1ec7('0x44')]({'where':{'id':_0x3a9b03[_0x1ec7('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b7db5,null))[_0x1ec7('0x21')](saveUpdates(_0x3a9b03['body'],null))[_0x1ec7('0x21')](respondWithResult(_0x4b7db5,null))['catch'](handleError(_0x4b7db5,null));};exports['destroy']=function(_0x3100a0,_0xb2f4ce){return db[_0x1ec7('0x28')]['find']({'where':{'id':_0x3100a0[_0x1ec7('0x41')]['id']}})[_0x1ec7('0x21')](handleEntityNotFound(_0xb2f4ce,null))[_0x1ec7('0x21')](removeEntity(_0xb2f4ce,null))['catch'](handleError(_0xb2f4ce,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d97934c..7241ab2 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x72d61b,_0x265116){var _0x4d7593=function(_0x244500){while(--_0x244500){_0x72d61b['push'](_0x72d61b['shift']());}};_0x4d7593(++_0x265116);}(_0x53ec,0x192));var _0xc53e=function(_0x1daaa4,_0x2a13f8){_0x1daaa4=_0x1daaa4-0x0;var _0x4d6a11=_0x53ec[_0x1daaa4];return _0x4d6a11;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x475f57,_0x57ff45){var _0x5a12d2=function(_0x413c45){while(--_0x413c45){_0x475f57['push'](_0x475f57['shift']());}};_0x5a12d2(++_0x57ff45);}(_0x814b,0x1a2));var _0xb814=function(_0x43e97d,_0x56a06b){_0x43e97d=_0x43e97d-0x0;var _0x424cd9=_0x814b[_0x43e97d];return _0x424cd9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index faa074b..44198af 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4aa6be,_0x2d5b51){var _0x2ce341=function(_0x38c52e){while(--_0x38c52e){_0x4aa6be['push'](_0x4aa6be['shift']());}};_0x2ce341(++_0x2d5b51);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ba88a,_0x30b1d8){_0x1ba88a=_0x1ba88a-0x0;var _0x5d0fe7=_0xb10b[_0x1ba88a];return _0x5d0fe7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x3d15ed,_0x28083a){var _0x5b7941=function(_0x776143){while(--_0x776143){_0x3d15ed['push'](_0x3d15ed['shift']());}};_0x5b7941(++_0x28083a);}(_0xb10b,0x12a));var _0xbb10=function(_0x7ee493,_0x2cc2cb){_0x7ee493=_0x7ee493-0x0;var _0x1f2c25=_0xb10b[_0x7ee493];return _0x1f2c25;};'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 327502c..d1e8860 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 _0x4b19=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','webhookGet','/:id','show','isAuthenticated','download','diskStorage','root','server/files/plugins','originalname','replace','basename','post','single','file','/webhook','webhookPost','put','update','delete','multer'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x4b19,0x195));var _0x94b1=function(_0x5e2654,_0x458a2b){_0x5e2654=_0x5e2654-0x0;var _0x4780aa=_0x4b19[_0x5e2654];return _0x4780aa;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/webhook',controller[_0x94b1('0xa')]);router[_0x94b1('0x8')](_0x94b1('0xb'),auth['isAuthenticated'](),controller[_0x94b1('0xc')]);router['get']('/:id/download',auth[_0x94b1('0xd')](),controller[_0x94b1('0xe')]);var upload=multer({'storage':multer[_0x94b1('0xf')]({'destination':function(_0x8ddf47,_0x162995,_0x3aeb91){_0x3aeb91(null,path['join'](config[_0x94b1('0x10')],_0x94b1('0x11')));},'filename':function(_0x340a29,_0x2b378c,_0x5cbf96){_0x2b378c['originalname']=_0x2b378c[_0x94b1('0x12')][_0x94b1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cbf96(null,util['format']('%s-%s%s',path[_0x94b1('0x14')](_0x2b378c[_0x94b1('0x12')],path['extname'](_0x2b378c[_0x94b1('0x12')])),Date['now'](),path['extname'](_0x2b378c[_0x94b1('0x12')])));}})});router[_0x94b1('0x15')]('/',upload[_0x94b1('0x16')](_0x94b1('0x17')),controller['upload']);router[_0x94b1('0x15')](_0x94b1('0x18'),controller[_0x94b1('0x19')]);router[_0x94b1('0x1a')](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1b')]);router['delete'](_0x94b1('0xb'),auth[_0x94b1('0xd')](),controller[_0x94b1('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x04de=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','/webhook','webhookGet','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','webhookPost'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x04de,0x107));var _0xe04d=function(_0x2c1081,_0x30fb06){_0x2c1081=_0x2c1081-0x0;var _0x42bb5c=_0x04de[_0x2c1081];return _0x42bb5c;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),controller[_0xe04d('0xc')]);router[_0xe04d('0xd')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x10')]);router[_0xe04d('0xd')](_0xe04d('0x11'),auth['isAuthenticated'](),controller[_0xe04d('0x12')]);var upload=multer({'storage':multer[_0xe04d('0x13')]({'destination':function(_0x2576b2,_0x30c46b,_0xad5c34){_0xad5c34(null,path[_0xe04d('0x14')](config[_0xe04d('0x15')],_0xe04d('0x16')));},'filename':function(_0x3ccdc8,_0x53f59a,_0x8bf2d2){_0x53f59a[_0xe04d('0x17')]=_0x53f59a[_0xe04d('0x17')][_0xe04d('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8bf2d2(null,util[_0xe04d('0x19')](_0xe04d('0x1a'),path[_0xe04d('0x1b')](_0x53f59a[_0xe04d('0x17')],path[_0xe04d('0x1c')](_0x53f59a[_0xe04d('0x17')])),Date[_0xe04d('0x1d')](),path[_0xe04d('0x1c')](_0x53f59a['originalname'])));}})});router[_0xe04d('0x1e')]('/',upload['single'](_0xe04d('0x1f')),controller['upload']);router[_0xe04d('0x1e')](_0xe04d('0xb'),controller[_0xe04d('0x20')]);router[_0xe04d('0x21')](_0xe04d('0xe'),auth[_0xe04d('0xf')](),controller[_0xe04d('0x22')]);router[_0xe04d('0x23')](_0xe04d('0xe'),auth['isAuthenticated'](),controller[_0xe04d('0x23')]);module[_0xe04d('0x24')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 543a293..4c6d7df 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 _0x4674=['TEXT','STRING','BOOLEAN','adminOnly','agentOnly','never','always','sequelize','ENUM','html','script'];(function(_0x2d7b77,_0x2476df){var _0x3e96ae=function(_0x44b916){while(--_0x44b916){_0x2d7b77['push'](_0x2d7b77['shift']());}};_0x3e96ae(++_0x2476df);}(_0x4674,0xcd));var _0x4467=function(_0x9e7ab5,_0x70b863){_0x9e7ab5=_0x9e7ab5-0x0;var _0x1d7ecb=_0x4674[_0x9e7ab5];return _0x1d7ecb;};'use strict';var Sequelize=require(_0x4467('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4467('0x1')](_0x4467('0x2'),_0x4467('0x3'))},'description':{'type':Sequelize[_0x4467('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x4467('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4467('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x4467('0x1')](_0x4467('0x7'),_0x4467('0x8'),'always',_0x4467('0x9')),'defaultValue':_0x4467('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x4467('0x5')]},'adminUrl':{'type':Sequelize[_0x4467('0x5')]},'agentUrl':{'type':Sequelize[_0x4467('0x5')]},'scriptName':{'type':Sequelize[_0x4467('0x5')]},'scriptPath':{'type':Sequelize[_0x4467('0x5')]}}; \ No newline at end of file +var _0xd59e=['html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','sequelize','exports','STRING','ENUM'];(function(_0x1a2acd,_0x3ee6ad){var _0x1ff1c3=function(_0xed4b13){while(--_0xed4b13){_0x1a2acd['push'](_0x1a2acd['shift']());}};_0x1ff1c3(++_0x3ee6ad);}(_0xd59e,0x8c));var _0xed59=function(_0x317a69,_0x4bf779){_0x317a69=_0x317a69-0x0;var _0x519f78=_0xd59e[_0x317a69];return _0x519f78;};'use strict';var Sequelize=require(_0xed59('0x0'));module[_0xed59('0x1')]={'name':{'type':Sequelize[_0xed59('0x2')]},'type':{'type':Sequelize[_0xed59('0x3')](_0xed59('0x4'),_0xed59('0x5'))},'description':{'type':Sequelize[_0xed59('0x6')]},'version':{'type':Sequelize[_0xed59('0x6')]},'path':{'type':Sequelize[_0xed59('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xed59('0x7')],'defaultValue':0x0,'comment':_0xed59('0x8')},'sidebar':{'type':Sequelize[_0xed59('0x3')](_0xed59('0x9'),_0xed59('0xa'),_0xed59('0xb'),'never'),'defaultValue':_0xed59('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xed59('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xed59('0x2')]},'scriptPath':{'type':Sequelize[_0xed59('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 81e675d..2329b1c 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 _0xdac4=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Plugin','rows','catch','params','includeAll','include','find','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','type','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','user','UserProfileSection','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-type','set','endsWith','statusCode','webhookPost','method','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdac4,0x1c9));var _0x4dac=function(_0x352354,_0x37d9d0){_0x352354=_0x352354-0x0;var _0x36553e=_0xdac4[_0x352354];return _0x36553e;};'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(_0x4dac('0x0'));var moment=require(_0x4dac('0x1'));var BPromise=require(_0x4dac('0x2'));var Mustache=require(_0x4dac('0x3'));var util=require(_0x4dac('0x4'));var path=require(_0x4dac('0x5'));var sox=require(_0x4dac('0x6'));var csv=require(_0x4dac('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dac('0x8'));var _=require(_0x4dac('0x9'));var squel=require(_0x4dac('0xa'));var crypto=require('crypto');var jsforce=require(_0x4dac('0xb'));var deskjs=require(_0x4dac('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4dac('0xd'));var Papa=require(_0x4dac('0xe'));var extract=require(_0x4dac('0xf'));var rimraf=require(_0x4dac('0x10'));var archiver=require('archiver');var Redis=require(_0x4dac('0x11'));var authService=require(_0x4dac('0x12'));var qs=require(_0x4dac('0x13'));var as=require(_0x4dac('0x14'));var hardwareService=require(_0x4dac('0x15'));var logger=require(_0x4dac('0x16'))(_0x4dac('0x17'));var utils=require(_0x4dac('0x18'));var config=require(_0x4dac('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4dac('0x1a')]=_[_0x4dac('0x1b')](config[_0x4dac('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4dac('0x1c'))(new Redis(config[_0x4dac('0x1a')]));require(_0x4dac('0x1d'))[_0x4dac('0x1e')](socket);function respondWithStatusCode(_0x32d1df,_0x20fee5){_0x20fee5=_0x20fee5||0xcc;return function(_0x4ab887){if(_0x4ab887){return _0x32d1df[_0x4dac('0x1f')](_0x20fee5);}return _0x32d1df[_0x4dac('0x20')](_0x20fee5)[_0x4dac('0x21')]();};}function respondWithResult(_0x4108fa,_0x1e4210){_0x1e4210=_0x1e4210||0xc8;return function(_0x13dca4){if(_0x13dca4){return _0x4108fa[_0x4dac('0x20')](_0x1e4210)[_0x4dac('0x22')](_0x13dca4);}};}function respondWithFilteredResult(_0x35e607,_0x4b0d6f){return function(_0x5b690e){if(_0x5b690e){var _0x1375fe=typeof _0x4b0d6f[_0x4dac('0x23')]===_0x4dac('0x24')&&typeof _0x4b0d6f['limit']===_0x4dac('0x24');var _0x342610=_0x5b690e[_0x4dac('0x25')];var _0x28c30e=_0x1375fe?0x0:_0x4b0d6f[_0x4dac('0x23')];var _0x21acac=_0x1375fe?_0x5b690e[_0x4dac('0x25')]:_0x4b0d6f[_0x4dac('0x23')]+_0x4b0d6f[_0x4dac('0x26')];var _0x53ef9f;if(_0x21acac>=_0x342610){_0x21acac=_0x342610;_0x53ef9f=0xc8;}else{_0x53ef9f=0xce;}_0x35e607['status'](_0x53ef9f);return _0x35e607['set'](_0x4dac('0x27'),_0x28c30e+'-'+_0x21acac+'/'+_0x342610)[_0x4dac('0x22')](_0x5b690e);}return null;};}function patchUpdates(_0x4fac2d){return function(_0x8f50ce){try{jsonpatch[_0x4dac('0x28')](_0x8f50ce,_0x4fac2d,!![]);}catch(_0x14a8af){return BPromise[_0x4dac('0x29')](_0x14a8af);}return _0x8f50ce['save']();};}function saveUpdates(_0xcf7487,_0x3bd5cf){return function(_0x187727){if(_0x187727){return _0x187727[_0x4dac('0x2a')](_0xcf7487)[_0x4dac('0x2b')](function(_0x5e1b76){return _0x5e1b76;});}return null;};}function removeEntity(_0xc7a516,_0x372476){return function(_0x5b413d){if(_0x5b413d){return _0x5b413d[_0x4dac('0x2c')]()[_0x4dac('0x2b')](function(){var _0x5991f9=_0x5b413d[_0x4dac('0x2d')]({'plain':!![]});var _0x2b50cf=_0x4dac('0x2e');return db[_0x4dac('0x2f')][_0x4dac('0x2c')]({'where':{'type':_0x2b50cf,'resourceId':_0x5991f9['id']}})[_0x4dac('0x2b')](function(){return _0x5b413d;});})[_0x4dac('0x2b')](function(){_0xc7a516[_0x4dac('0x20')](0xcc)[_0x4dac('0x21')]();});}};}function handleEntityNotFound(_0x4761dd,_0x8dbb1b){return function(_0x50db5a){if(!_0x50db5a){_0x4761dd[_0x4dac('0x1f')](0x194);}return _0x50db5a;};}function handleError(_0x20a191,_0x1a4a71){_0x1a4a71=_0x1a4a71||0x1f4;return function(_0x56e894){logger[_0x4dac('0x30')](_0x56e894[_0x4dac('0x31')]);if(_0x56e894[_0x4dac('0x32')]){delete _0x56e894['name'];}_0x20a191[_0x4dac('0x20')](_0x1a4a71)[_0x4dac('0x33')](_0x56e894);};}exports['index']=function(_0x4cfcd4,_0x1543c1){var _0x85fabe={},_0x4e4a4e={},_0x1aaa49={'count':0x0,'rows':[]};var _0x104d95=_[_0x4dac('0x34')](db['Plugin'][_0x4dac('0x35')],function(_0xe1c4ec){return{'name':_0xe1c4ec[_0x4dac('0x36')],'type':_0xe1c4ec['type'][_0x4dac('0x37')]};});_0x4e4a4e[_0x4dac('0x38')]=_[_0x4dac('0x34')](_0x104d95,_0x4dac('0x32'));_0x4e4a4e[_0x4dac('0x39')]=_[_0x4dac('0x3a')](_0x4cfcd4[_0x4dac('0x39')]);_0x4e4a4e[_0x4dac('0x3b')]=_[_0x4dac('0x3c')](_0x4e4a4e['model'],_0x4e4a4e['query']);_0x85fabe[_0x4dac('0x3d')]=_['intersection'](_0x4e4a4e[_0x4dac('0x38')],qs[_0x4dac('0x3e')](_0x4cfcd4[_0x4dac('0x39')]['fields']));_0x85fabe['attributes']=_0x85fabe[_0x4dac('0x3d')][_0x4dac('0x3f')]?_0x85fabe[_0x4dac('0x3d')]:_0x4e4a4e[_0x4dac('0x38')];if(!_0x4cfcd4[_0x4dac('0x39')][_0x4dac('0x40')](_0x4dac('0x41'))){_0x85fabe[_0x4dac('0x26')]=qs['limit'](_0x4cfcd4[_0x4dac('0x39')][_0x4dac('0x26')]);_0x85fabe[_0x4dac('0x23')]=qs[_0x4dac('0x23')](_0x4cfcd4[_0x4dac('0x39')][_0x4dac('0x23')]);}_0x85fabe['order']=qs[_0x4dac('0x42')](_0x4cfcd4[_0x4dac('0x39')][_0x4dac('0x42')]);_0x85fabe['where']=qs[_0x4dac('0x3b')](_[_0x4dac('0x43')](_0x4cfcd4[_0x4dac('0x39')],_0x4e4a4e['filters']),_0x104d95);if(_0x4cfcd4[_0x4dac('0x39')][_0x4dac('0x44')]){_0x85fabe[_0x4dac('0x45')]=_[_0x4dac('0x46')](_0x85fabe[_0x4dac('0x45')],{'$or':_[_0x4dac('0x34')](_0x104d95,function(_0x4b4517){if(_0x4b4517['type']!==_0x4dac('0x47')){var _0x3f705d={};_0x3f705d[_0x4b4517[_0x4dac('0x32')]]={'$like':'%'+_0x4cfcd4[_0x4dac('0x39')]['filter']+'%'};return _0x3f705d;}})});}_0x85fabe=_['merge']({},_0x85fabe,_0x4cfcd4[_0x4dac('0x48')]);var _0x1a5eae={'where':_0x85fabe[_0x4dac('0x45')]};return db['Plugin'][_0x4dac('0x25')](_0x1a5eae)[_0x4dac('0x2b')](function(_0x3da21a){_0x1aaa49[_0x4dac('0x25')]=_0x3da21a;if(_0x4cfcd4[_0x4dac('0x39')]['includeAll']){_0x85fabe['include']=[{'all':!![]}];}return db[_0x4dac('0x49')]['findAll'](_0x85fabe);})[_0x4dac('0x2b')](function(_0x4b080e){_0x1aaa49[_0x4dac('0x4a')]=_0x4b080e;return _0x1aaa49;})[_0x4dac('0x2b')](respondWithFilteredResult(_0x1543c1,_0x85fabe))[_0x4dac('0x4b')](handleError(_0x1543c1,null));};exports['show']=function(_0x3f93e3,_0x4fcebe){var _0x2d2adc={'raw':!![],'where':{'id':_0x3f93e3[_0x4dac('0x4c')]['id']}},_0x27a76c={};_0x27a76c[_0x4dac('0x38')]=_[_0x4dac('0x3a')](db[_0x4dac('0x49')][_0x4dac('0x35')]);_0x27a76c[_0x4dac('0x39')]=_[_0x4dac('0x3a')](_0x3f93e3[_0x4dac('0x39')]);_0x27a76c[_0x4dac('0x3b')]=_[_0x4dac('0x3c')](_0x27a76c['model'],_0x27a76c[_0x4dac('0x39')]);_0x2d2adc[_0x4dac('0x3d')]=_[_0x4dac('0x3c')](_0x27a76c[_0x4dac('0x38')],qs[_0x4dac('0x3e')](_0x3f93e3[_0x4dac('0x39')][_0x4dac('0x3e')]));_0x2d2adc['attributes']=_0x2d2adc[_0x4dac('0x3d')][_0x4dac('0x3f')]?_0x2d2adc[_0x4dac('0x3d')]:_0x27a76c[_0x4dac('0x38')];if(_0x3f93e3[_0x4dac('0x39')][_0x4dac('0x4d')]){_0x2d2adc[_0x4dac('0x4e')]=[{'all':!![]}];}_0x2d2adc=_[_0x4dac('0x46')]({},_0x2d2adc,_0x3f93e3[_0x4dac('0x48')]);return db['Plugin'][_0x4dac('0x4f')](_0x2d2adc)['then'](handleEntityNotFound(_0x4fcebe,null))['then'](respondWithResult(_0x4fcebe,null))[_0x4dac('0x4b')](handleError(_0x4fcebe,null));};exports[_0x4dac('0x50')]=function(_0x4fd60f,_0x17bda1,_0x554524){return db[_0x4dac('0x49')][_0x4dac('0x4f')]({'where':{'id':_0x4fd60f[_0x4dac('0x4c')]['id']},'attributes':[_0x4dac('0x32'),_0x4dac('0x5')],'raw':!![]})[_0x4dac('0x2b')](handleEntityNotFound(_0x17bda1,null))[_0x4dac('0x2b')](function(_0x1b2d78){if(_0x1b2d78){var _0x41f326=path['join'](config[_0x4dac('0x51')],_0x4dac('0x52'),util[_0x4dac('0x53')](_0x4dac('0x54'),path[_0x4dac('0x55')](_0x1b2d78[_0x4dac('0x5')])));var _0x186e94=fs[_0x4dac('0x56')](_0x41f326);var _0x1d8244=archiver(_0x4dac('0x57'),{'zlib':{'level':0x9}});_0x1d8244['on'](_0x4dac('0x58'),function(_0x19ab91){if(_0x19ab91['code']==='ENOENT'){logger[_0x4dac('0x30')](_0x19ab91);}else{throw new db[(_0x4dac('0x59'))]['Error'](_0x4dac('0x5a'));}});_0x1d8244['on']('error',function(_0x38dee0){throw new db[(_0x4dac('0x59'))][(_0x4dac('0x5b'))](_0x4dac('0x5a'));});_0x1d8244[_0x4dac('0x5c')](_0x186e94);_0x1d8244[_0x4dac('0x5d')](_0x4dac('0x5e'),{'cwd':path[_0x4dac('0x5f')](config[_0x4dac('0x51')],_0x4dac('0x52'),path[_0x4dac('0x60')](_0x1b2d78[_0x4dac('0x5')])),'ignore':[path[_0x4dac('0x5f')](path[_0x4dac('0x55')](_0x1b2d78[_0x4dac('0x5')]),_0x4dac('0x61')),path[_0x4dac('0x5f')](path['basename'](_0x1b2d78[_0x4dac('0x5')]),_0x4dac('0x62'))],'nodir':!![]})[_0x4dac('0x63')]();_0x186e94['on'](_0x4dac('0x64'),function(){if(!fs[_0x4dac('0x65')](_0x41f326)){throw new db['Sequelize'][(_0x4dac('0x5b'))](_0x4dac('0x66'));}return _0x17bda1['download'](_0x41f326,util['format'](_0x4dac('0x54'),path[_0x4dac('0x55')](_0x1b2d78[_0x4dac('0x5')])),function(_0x433e25){if(_0x433e25){throw new db[(_0x4dac('0x59'))][(_0x4dac('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x4dac('0x67')](_0x41f326);logger[_0x4dac('0x68')](_0x4dac('0x69'));logger[_0x4dac('0x68')](_0x4dac('0x6a'));});});}return null;})['catch'](handleError(_0x17bda1,null));};exports[_0x4dac('0x6b')]=function(_0x536112,_0xcd0a5a,_0x2a0066){var _0x23166f=path[_0x4dac('0x55')](_0x536112[_0x4dac('0x6c')][_0x4dac('0x6d')],path[_0x4dac('0x6e')](_0x536112[_0x4dac('0x6c')][_0x4dac('0x6d')]));var _0x59d9aa=path[_0x4dac('0x5f')](config[_0x4dac('0x51')],'server/files/plugins',_0x536112['file'][_0x4dac('0x6d')]);var _0x1b9de1=path['join'](config[_0x4dac('0x51')],_0x4dac('0x52'),_0x23166f);logger[_0x4dac('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x59d9aa);logger[_0x4dac('0x68')](_0x4dac('0x6f'),_0x1b9de1);try{fs[_0x4dac('0x70')](_0x59d9aa,parseInt(_0x4dac('0x71'),0x8));extract(_0x59d9aa,{'dir':_0x1b9de1},function(_0x3be095){if(_0x3be095){logger[_0x4dac('0x30')](_0x3be095);handleError(_0x3be095,!![]);};var _0x1c3902=fs[_0x4dac('0x72')](_0x1b9de1);if(_0x1c3902[_0x4dac('0x3f')]>0x1){removeReferences(_0x59d9aa,_0x1b9de1);logger['error'](_0x4dac('0x73'));return _0x2a0066(new Error(_0x4dac('0x73')));}var _0x451c24=fs[_0x4dac('0x74')](path['join'](_0x1b9de1,_0x1c3902[0x0]));if(_0x451c24[_0x4dac('0x75')]()){removeReferences(_0x59d9aa,_0x1b9de1);logger[_0x4dac('0x30')](_0x4dac('0x73'));return _0x2a0066(new Error(_0x4dac('0x73')));}if(_0x451c24[_0x4dac('0x76')]()){var _0x20d8cb=fs[_0x4dac('0x72')](path[_0x4dac('0x5f')](_0x1b9de1,_0x1c3902[0x0]));if(_0x20d8cb[_0x4dac('0x3f')]===0x0){removeReferences(_0x59d9aa,_0x1b9de1);logger[_0x4dac('0x30')]('Invalid\x20plugin\x20structure');return _0x2a0066(new Error('Invalid\x20plugin\x20structure'));}var _0x18f5eb=_0x20d8cb[_0x4dac('0x77')](function(_0x44c85c){return _0x44c85c===_0x4dac('0x78');});if(!_0x18f5eb){return _0x2a0066(new Error('Plugin\x20manifest\x20missing'));}var _0x1acbd6=fs[_0x4dac('0x79')](path[_0x4dac('0x5f')](_0x1b9de1,_0x1c3902[0x0],_0x4dac('0x78')));var _0x20aaf7=JSON[_0x4dac('0x7a')](_0x1acbd6);if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x32')]){return _0x2a0066(new Error(_0x4dac('0x7b')));}if('undefined'==typeof _0x20aaf7['type']){return _0x2a0066(new Error(_0x4dac('0x7c')));}if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7d')]){return _0x2a0066(new Error(_0x4dac('0x7e')));}if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7f')]){return _0x2a0066(new Error(_0x4dac('0x80')));}if(_0x20aaf7['type']===_0x4dac('0x81')){if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')]){return _0x2a0066(new Error(_0x4dac('0x83')));}if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')][_0x4dac('0x84')]&&_0x4dac('0x24')==typeof _0x20aaf7['parameters']['views'][_0x4dac('0x85')]){return _0x2a0066(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x20aaf7['type']==='script'){if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x86')]){return _0x2a0066(new Error(_0x4dac('0x87')));}if(_0x4dac('0x24')==typeof _0x20aaf7[_0x4dac('0x7f')]['scriptPath']){return _0x2a0066(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2a0066(new Error(_0x4dac('0x88')));}var _0x3d16eb=_0x20aaf7['name'];var _0xdd7ea6=_0x20aaf7['description'];var _0x2c9c3a=_0x20aaf7[_0x4dac('0x89')];var _0x4b6d0d=_0x20aaf7[_0x4dac('0x8a')]?_0x20aaf7[_0x4dac('0x8a')]:_0x4dac('0x8b');var _0x1d6d38=_0x20aaf7[_0x4dac('0x8c')]?_0x20aaf7[_0x4dac('0x8c')]:_0x4dac('0x8d');var _0x4ff202='';var _0x33b5c1='';var _0x1878ec='';var _0x43cf8c='';var _0x6997ab=_0x20aaf7['version'];if(_0x2c9c3a==='html'){if(_0x4dac('0x24')!=typeof _0x20aaf7[_0x4dac('0x7f')]['views'][_0x4dac('0x84')]){var _0x20f94b=_0x20aaf7[_0x4dac('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x20f94b)){_0x4ff202=path[_0x4dac('0x5f')](_0x4dac('0x8e'),_0x23166f,_0x1c3902[0x0],_0x20f94b);}else{_0x4ff202=_0x20f94b;}}else{logger[_0x4dac('0x68')](_0x4dac('0x8f'));}if(_0x4dac('0x24')!=typeof _0x20aaf7[_0x4dac('0x7f')]['views'][_0x4dac('0x85')]){var _0x3b6d42=_0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')][_0x4dac('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4dac('0x90')](_0x3b6d42)){_0x33b5c1=path[_0x4dac('0x5f')](_0x4dac('0x8e'),_0x23166f,_0x1c3902[0x0],_0x3b6d42);}else{_0x33b5c1=_0x3b6d42;}}else{logger[_0x4dac('0x68')](_0x4dac('0x91'));}}else if(_0x2c9c3a===_0x4dac('0x92')){_0x1878ec=_0x20aaf7[_0x4dac('0x7f')]['scriptName'];_0x43cf8c=_0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x93')];if('undefined'!=typeof _0x20aaf7[_0x4dac('0x7f')]['views']){if('undefined'!=typeof _0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')]['admin']){var _0x20f94b=_0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')][_0x4dac('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x4dac('0x90')](_0x20f94b)){_0x4ff202=path[_0x4dac('0x5f')]('plugins',_0x23166f,_0x1c3902[0x0],_0x20f94b);}else{_0x4ff202=_0x20f94b;}}if(_0x4dac('0x24')!=typeof _0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')]['agent']){var _0x3b6d42=_0x20aaf7[_0x4dac('0x7f')][_0x4dac('0x82')][_0x4dac('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4dac('0x90')](_0x3b6d42)){_0x33b5c1=path['join'](_0x4dac('0x8e'),_0x23166f,_0x1c3902[0x0],_0x3b6d42);}else{_0x33b5c1=_0x3b6d42;}}}}var _0xd6fcb7={'name':_0x3d16eb,'description':_0xdd7ea6,'path':path['join'](_0x23166f,_0x1c3902[0x0]),'type':_0x2c9c3a,'sidebar':_0x4b6d0d,'icon':_0x1d6d38,'adminUrl':_0x4ff202,'agentUrl':_0x33b5c1,'scriptName':_0x1878ec,'scriptPath':_0x43cf8c,'version':_0x6997ab};removeReferences(_0x59d9aa,null);return db['Plugin'][_0x4dac('0x94')](_0xd6fcb7)[_0x4dac('0x2b')](function(_0x40b6f6){var _0x3ca1a9={'role':_0x536112[_0x4dac('0x95')][_0x4dac('0x96')],'userProfileId':_0x536112[_0x4dac('0x95')][_0x4dac('0x97')]};if(!_0x3ca1a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ca1a9[_0x4dac('0x96')]===_0x4dac('0x98')){var _0x590f79=_0x40b6f6[_0x4dac('0x2d')]({'plain':!![]});return db[_0x4dac('0x99')][_0x4dac('0x4f')]({'where':{'name':_0x4dac('0x2e'),'userProfileId':_0x3ca1a9[_0x4dac('0x97')]},'raw':!![]})[_0x4dac('0x2b')](function(_0x4ac97b){if(_0x4ac97b&&_0x4ac97b['autoAssociation']===0x0){return db[_0x4dac('0x2f')][_0x4dac('0x94')]({'name':_0x590f79[_0x4dac('0x32')],'resourceId':_0x590f79['id'],'type':_0x4ac97b[_0x4dac('0x32')],'sectionId':_0x4ac97b['id']},{})[_0x4dac('0x2b')](function(){return _0x40b6f6;});}else{return _0x40b6f6;}})[_0x4dac('0x4b')](function(_0x97cdfa){logger[_0x4dac('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97cdfa);throw _0x97cdfa;});}return _0x40b6f6;})[_0x4dac('0x2b')](respondWithResult(_0xcd0a5a,null))[_0x4dac('0x4b')](handleError(_0xcd0a5a,null));}});}catch(_0x2fe0dd){_0xcd0a5a[_0x4dac('0x20')](0x1f4)['send'](_0x2fe0dd);}};function removeReferences(_0x1ec5a0,_0x15d5cb){try{if(_0x1ec5a0){fs['unlinkSync'](_0x1ec5a0);logger[_0x4dac('0x68')](_0x4dac('0x9a'));}if(_0x15d5cb){rimraf(_0x15d5cb,function(){});logger[_0x4dac('0x68')](_0x4dac('0x9b'));}}catch(_0x33fbe6){logger['error'](_0x33fbe6);}}exports[_0x4dac('0x2a')]=function(_0x14d142,_0x457f62,_0xa3bac6){return db[_0x4dac('0x49')]['find']({'where':{'id':_0x14d142[_0x4dac('0x4c')]['id']}})[_0x4dac('0x2b')](handleEntityNotFound(_0x457f62,null))[_0x4dac('0x2b')](saveUpdates(_0x14d142[_0x4dac('0x95')],null))[_0x4dac('0x2b')](respondWithResult(_0x457f62,null))['catch'](handleError(_0x457f62,null));};exports[_0x4dac('0x9c')]=function(_0xcd26c2,_0xfa2fcb,_0x4bf360){return db[_0x4dac('0x49')][_0x4dac('0x4f')]({'where':{'id':_0xcd26c2['params']['id']}})['then'](function(_0xb3c95a){if(_0xb3c95a){return _0xb3c95a[_0x4dac('0x2c')]();}})['then'](function(_0x2cf0d2){rimraf(path[_0x4dac('0x5f')](config['root'],_0x4dac('0x52'),path[_0x4dac('0x60')](_0x2cf0d2[_0x4dac('0x5')])),function(){});return _0x2cf0d2;})['then'](handleEntityNotFound(_0xfa2fcb,null))[_0x4dac('0x2b')](respondWithStatusCode(_0xfa2fcb,null))[_0x4dac('0x4b')](handleError(_0xfa2fcb,null));};exports[_0x4dac('0x9d')]=function(_0x2b7fb8,_0x3c39d8,_0x4cfb32){return BPromise[_0x4dac('0x9e')]()[_0x4dac('0x2b')](function(){if(!_0x2b7fb8['query']['path']){throw new Error(_0x4dac('0x9f'));}if(!_0x2b7fb8[_0x4dac('0x39')][_0x4dac('0xa0')]){throw new Error(_0x4dac('0xa1'));}var _0x18d203=_0x2b7fb8[_0x4dac('0x39')][_0x4dac('0xa2')]?_0x2b7fb8[_0x4dac('0x39')]['hostname']+':'+_0x2b7fb8[_0x4dac('0x39')][_0x4dac('0xa0')]:_0x4dac('0xa3')+_0x2b7fb8[_0x4dac('0x39')]['port'];var _0x337932=_0x2b7fb8['query'][_0x4dac('0x22')]?_0x2b7fb8[_0x4dac('0x39')]['json']:!![];var _0x3ddb4a=_0x2b7fb8[_0x4dac('0x39')][_0x4dac('0xa4')]?_0x2b7fb8[_0x4dac('0x39')][_0x4dac('0xa4')]:null;var _0x4a324a={'method':_0x2b7fb8['method'],'uri':util[_0x4dac('0x53')](_0x4dac('0xa5'),_0x18d203,_0x2b7fb8['query'][_0x4dac('0x5')]),'json':_0x337932,'resolveWithFullResponse':!![],'encoding':_0x3ddb4a,'qs':_0x2b7fb8['query']};if(_0x2b7fb8['headers']){_0x4a324a[_0x4dac('0xa6')]=_0x2b7fb8['headers'];if(_0x4a324a[_0x4dac('0xa6')]['content-length']){delete _0x4a324a[_0x4dac('0xa6')]['content-length'];}}if(_0x4a324a[_0x4dac('0xa6')][_0x4dac('0xa7')]){delete _0x4a324a[_0x4dac('0xa6')][_0x4dac('0xa7')];}return rp(_0x4a324a);})[_0x4dac('0x2b')](function(_0x21690f){if(_0x21690f){_0x3c39d8[_0x4dac('0xa8')](_0x21690f['headers']);logger[_0x4dac('0x68')](_0x21690f[_0x4dac('0x95')]);if(_[_0x4dac('0xa9')](_0x2b7fb8['query'][_0x4dac('0x5')],_0x4dac('0x50'))&&_0x21690f['statusCode']==0x1f4){return _0x3c39d8['sendStatus'](_0x21690f['statusCode']);}else{return _0x3c39d8[_0x4dac('0x20')](_0x21690f[_0x4dac('0xaa')])[_0x4dac('0x33')](_0x21690f['body']);}}else{return _0x3c39d8[_0x4dac('0x1f')](0xc8);}})[_0x4dac('0x4b')](handleError(_0x3c39d8,null));};exports[_0x4dac('0xab')]=function(_0x2794bb,_0x23afdb,_0x336047){return BPromise[_0x4dac('0x9e')]()['then'](function(){if(!_0x2794bb['query'][_0x4dac('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2794bb[_0x4dac('0x39')][_0x4dac('0xa0')]){throw new Error(_0x4dac('0xa1'));}var _0x3741d3=_0x2794bb['query'][_0x4dac('0xa2')]?_0x2794bb[_0x4dac('0x39')][_0x4dac('0xa2')]+':'+_0x2794bb['query']['port']:_0x4dac('0xa3')+_0x2794bb[_0x4dac('0x39')][_0x4dac('0xa0')];var _0x1d545d=_0x2794bb[_0x4dac('0x39')][_0x4dac('0x22')]?_0x2794bb[_0x4dac('0x39')][_0x4dac('0x22')]:!![];var _0x6e7d25=_0x2794bb[_0x4dac('0x39')][_0x4dac('0xa4')]?_0x2794bb[_0x4dac('0x39')][_0x4dac('0xa4')]:null;var _0x4dce03={'method':_0x2794bb[_0x4dac('0xac')],'uri':util[_0x4dac('0x53')]('%s%s',_0x3741d3,_0x2794bb[_0x4dac('0x39')][_0x4dac('0x5')]),'json':_0x1d545d,'resolveWithFullResponse':!![],'encoding':_0x6e7d25,'body':_0x2794bb['body']};if(_0x2794bb[_0x4dac('0xa6')]){_0x4dce03[_0x4dac('0xa6')]=_0x2794bb[_0x4dac('0xa6')];if(_0x4dce03[_0x4dac('0xa6')]['content-length']){delete _0x4dce03['headers']['content-length'];}}if(_0x4dce03[_0x4dac('0xa6')][_0x4dac('0xa7')]){delete _0x4dce03[_0x4dac('0xa6')]['content-type'];}return rp(_0x4dce03);})[_0x4dac('0x2b')](function(_0x80958a){if(_0x80958a){_0x23afdb[_0x4dac('0xa8')](_0x80958a[_0x4dac('0xa6')]);logger['info'](_0x80958a[_0x4dac('0x95')]);return _0x23afdb[_0x4dac('0x20')](_0x80958a[_0x4dac('0xaa')])[_0x4dac('0x33')](_0x80958a[_0x4dac('0x95')]);}else{return _0x23afdb[_0x4dac('0x1f')](0xc8);}})['catch'](handleError(_0x23afdb,null));}; \ No newline at end of file +var _0x1e02=['Extracted\x20folder\x20removed','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','body','resolve','http://localhost:','content-type','eml-format','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','script','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed'];(function(_0x21fccf,_0x3fe4ba){var _0x4b14ac=function(_0xb751a2){while(--_0xb751a2){_0x21fccf['push'](_0x21fccf['shift']());}};_0x4b14ac(++_0x3fe4ba);}(_0x1e02,0xc4));var _0x21e0=function(_0x194c09,_0x12125e){_0x194c09=_0x194c09-0x0;var _0x1b1a11=_0x1e02[_0x194c09];return _0x1b1a11;};'use strict';var emlformat=require(_0x21e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21e0('0x2'));var moment=require(_0x21e0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x21e0('0x4'));var util=require(_0x21e0('0x5'));var path=require(_0x21e0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21e0('0x7'));var fs=require('fs');var fs_extra=require(_0x21e0('0x8'));var _=require(_0x21e0('0x9'));var squel=require(_0x21e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x21e0('0xb'));var deskjs=require(_0x21e0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x21e0('0xd'));var Papa=require(_0x21e0('0xe'));var extract=require(_0x21e0('0xf'));var rimraf=require(_0x21e0('0x10'));var archiver=require(_0x21e0('0x11'));var Redis=require(_0x21e0('0x12'));var authService=require(_0x21e0('0x13'));var qs=require(_0x21e0('0x14'));var as=require(_0x21e0('0x15'));var hardwareService=require(_0x21e0('0x16'));var logger=require(_0x21e0('0x17'))(_0x21e0('0x18'));var utils=require(_0x21e0('0x19'));var config=require(_0x21e0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x21e0('0x1b'))['db'];config[_0x21e0('0x1c')]=_[_0x21e0('0x1d')](config[_0x21e0('0x1c')],{'host':_0x21e0('0x1e'),'port':0x18eb});var socket=require(_0x21e0('0x1f'))(new Redis(config[_0x21e0('0x1c')]));require(_0x21e0('0x20'))[_0x21e0('0x21')](socket);function respondWithStatusCode(_0x50711c,_0x115819){_0x115819=_0x115819||0xcc;return function(_0x1b1e04){if(_0x1b1e04){return _0x50711c[_0x21e0('0x22')](_0x115819);}return _0x50711c[_0x21e0('0x23')](_0x115819)[_0x21e0('0x24')]();};}function respondWithResult(_0x3025d8,_0x30460c){_0x30460c=_0x30460c||0xc8;return function(_0x5dc466){if(_0x5dc466){return _0x3025d8[_0x21e0('0x23')](_0x30460c)[_0x21e0('0x25')](_0x5dc466);}};}function respondWithFilteredResult(_0x46578b,_0x5045e8){return function(_0x172aee){if(_0x172aee){var _0x40484d=typeof _0x5045e8[_0x21e0('0x26')]==='undefined'&&typeof _0x5045e8[_0x21e0('0x27')]==='undefined';var _0x5b0302=_0x172aee[_0x21e0('0x28')];var _0x751ffd=_0x40484d?0x0:_0x5045e8[_0x21e0('0x26')];var _0x10253a=_0x40484d?_0x172aee['count']:_0x5045e8[_0x21e0('0x26')]+_0x5045e8[_0x21e0('0x27')];var _0x3d41ed;if(_0x10253a>=_0x5b0302){_0x10253a=_0x5b0302;_0x3d41ed=0xc8;}else{_0x3d41ed=0xce;}_0x46578b[_0x21e0('0x23')](_0x3d41ed);return _0x46578b[_0x21e0('0x29')](_0x21e0('0x2a'),_0x751ffd+'-'+_0x10253a+'/'+_0x5b0302)[_0x21e0('0x25')](_0x172aee);}return null;};}function patchUpdates(_0x34cbda){return function(_0x218c53){try{jsonpatch[_0x21e0('0x2b')](_0x218c53,_0x34cbda,!![]);}catch(_0x36a500){return BPromise['reject'](_0x36a500);}return _0x218c53[_0x21e0('0x2c')]();};}function saveUpdates(_0x33cffb,_0x2f26c2){return function(_0x3c299f){if(_0x3c299f){return _0x3c299f[_0x21e0('0x2d')](_0x33cffb)['then'](function(_0x14d03f){return _0x14d03f;});}return null;};}function removeEntity(_0x19afd9,_0x276073){return function(_0x5628f0){if(_0x5628f0){return _0x5628f0[_0x21e0('0x2e')]()['then'](function(){var _0xa0e64a=_0x5628f0[_0x21e0('0x2f')]({'plain':!![]});var _0x400999='Plugins';return db[_0x21e0('0x30')]['destroy']({'where':{'type':_0x400999,'resourceId':_0xa0e64a['id']}})[_0x21e0('0x31')](function(){return _0x5628f0;});})[_0x21e0('0x31')](function(){_0x19afd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x227dd5,_0x225814){return function(_0x1cf5f4){if(!_0x1cf5f4){_0x227dd5[_0x21e0('0x22')](0x194);}return _0x1cf5f4;};}function handleError(_0x5ae9b6,_0x4c142f){_0x4c142f=_0x4c142f||0x1f4;return function(_0x33eb02){logger[_0x21e0('0x32')](_0x33eb02[_0x21e0('0x33')]);if(_0x33eb02[_0x21e0('0x34')]){delete _0x33eb02[_0x21e0('0x34')];}_0x5ae9b6[_0x21e0('0x23')](_0x4c142f)['send'](_0x33eb02);};}exports[_0x21e0('0x35')]=function(_0xd7315d,_0x36433e){var _0x550454={},_0x3fba43={},_0x3583e3={'count':0x0,'rows':[]};var _0x253b60=_[_0x21e0('0x36')](db[_0x21e0('0x37')][_0x21e0('0x38')],function(_0x590223){return{'name':_0x590223[_0x21e0('0x39')],'type':_0x590223[_0x21e0('0x3a')][_0x21e0('0x3b')]};});_0x3fba43[_0x21e0('0x3c')]=_[_0x21e0('0x36')](_0x253b60,_0x21e0('0x34'));_0x3fba43[_0x21e0('0x3d')]=_[_0x21e0('0x3e')](_0xd7315d[_0x21e0('0x3d')]);_0x3fba43['filters']=_[_0x21e0('0x3f')](_0x3fba43[_0x21e0('0x3c')],_0x3fba43[_0x21e0('0x3d')]);_0x550454[_0x21e0('0x40')]=_['intersection'](_0x3fba43[_0x21e0('0x3c')],qs['fields'](_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x41')]));_0x550454['attributes']=_0x550454[_0x21e0('0x40')][_0x21e0('0x42')]?_0x550454['attributes']:_0x3fba43['model'];if(!_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x43')](_0x21e0('0x44'))){_0x550454['limit']=qs[_0x21e0('0x27')](_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x27')]);_0x550454[_0x21e0('0x26')]=qs[_0x21e0('0x26')](_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x26')]);}_0x550454[_0x21e0('0x45')]=qs['sort'](_0xd7315d[_0x21e0('0x3d')]['sort']);_0x550454['where']=qs[_0x21e0('0x46')](_['pick'](_0xd7315d[_0x21e0('0x3d')],_0x3fba43[_0x21e0('0x46')]),_0x253b60);if(_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x47')]){_0x550454[_0x21e0('0x48')]=_[_0x21e0('0x49')](_0x550454[_0x21e0('0x48')],{'$or':_[_0x21e0('0x36')](_0x253b60,function(_0x3fb4c0){if(_0x3fb4c0[_0x21e0('0x3a')]!==_0x21e0('0x4a')){var _0x16f77e={};_0x16f77e[_0x3fb4c0[_0x21e0('0x34')]]={'$like':'%'+_0xd7315d[_0x21e0('0x3d')][_0x21e0('0x47')]+'%'};return _0x16f77e;}})});}_0x550454=_['merge']({},_0x550454,_0xd7315d[_0x21e0('0x4b')]);var _0x3d3480={'where':_0x550454['where']};return db[_0x21e0('0x37')]['count'](_0x3d3480)['then'](function(_0x58afa3){_0x3583e3[_0x21e0('0x28')]=_0x58afa3;if(_0xd7315d['query'][_0x21e0('0x4c')]){_0x550454[_0x21e0('0x4d')]=[{'all':!![]}];}return db['Plugin'][_0x21e0('0x4e')](_0x550454);})[_0x21e0('0x31')](function(_0x18ed54){_0x3583e3['rows']=_0x18ed54;return _0x3583e3;})[_0x21e0('0x31')](respondWithFilteredResult(_0x36433e,_0x550454))[_0x21e0('0x4f')](handleError(_0x36433e,null));};exports[_0x21e0('0x50')]=function(_0x580e3d,_0x29c882){var _0x37a563={'raw':!![],'where':{'id':_0x580e3d['params']['id']}},_0x32ad9b={};_0x32ad9b['model']=_[_0x21e0('0x3e')](db[_0x21e0('0x37')]['rawAttributes']);_0x32ad9b[_0x21e0('0x3d')]=_[_0x21e0('0x3e')](_0x580e3d['query']);_0x32ad9b[_0x21e0('0x46')]=_[_0x21e0('0x3f')](_0x32ad9b[_0x21e0('0x3c')],_0x32ad9b[_0x21e0('0x3d')]);_0x37a563['attributes']=_[_0x21e0('0x3f')](_0x32ad9b[_0x21e0('0x3c')],qs['fields'](_0x580e3d[_0x21e0('0x3d')][_0x21e0('0x41')]));_0x37a563[_0x21e0('0x40')]=_0x37a563[_0x21e0('0x40')][_0x21e0('0x42')]?_0x37a563[_0x21e0('0x40')]:_0x32ad9b[_0x21e0('0x3c')];if(_0x580e3d['query'][_0x21e0('0x4c')]){_0x37a563[_0x21e0('0x4d')]=[{'all':!![]}];}_0x37a563=_[_0x21e0('0x49')]({},_0x37a563,_0x580e3d[_0x21e0('0x4b')]);return db['Plugin'][_0x21e0('0x51')](_0x37a563)['then'](handleEntityNotFound(_0x29c882,null))[_0x21e0('0x31')](respondWithResult(_0x29c882,null))[_0x21e0('0x4f')](handleError(_0x29c882,null));};exports[_0x21e0('0x52')]=function(_0x2f5759,_0x8f6229,_0x3c3330){return db[_0x21e0('0x37')][_0x21e0('0x51')]({'where':{'id':_0x2f5759[_0x21e0('0x53')]['id']},'attributes':[_0x21e0('0x34'),_0x21e0('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x8f6229,null))['then'](function(_0x3d4a35){if(_0x3d4a35){var _0x4b033a=path[_0x21e0('0x54')](config[_0x21e0('0x55')],_0x21e0('0x56'),util[_0x21e0('0x57')](_0x21e0('0x58'),path[_0x21e0('0x59')](_0x3d4a35['path'])));var _0x4592d8=fs['createWriteStream'](_0x4b033a);var _0x2c796e=archiver('zip',{'zlib':{'level':0x9}});_0x2c796e['on'](_0x21e0('0x5a'),function(_0x4edc21){if(_0x4edc21[_0x21e0('0x5b')]===_0x21e0('0x5c')){logger['error'](_0x4edc21);}else{throw new db[(_0x21e0('0x5d'))][(_0x21e0('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2c796e['on'](_0x21e0('0x32'),function(_0xc111dc){throw new db[(_0x21e0('0x5d'))][(_0x21e0('0x5e'))](_0x21e0('0x5f'));});_0x2c796e[_0x21e0('0x60')](_0x4592d8);_0x2c796e[_0x21e0('0x61')]('**/*',{'cwd':path[_0x21e0('0x54')](config['root'],'server/files/plugins',path['dirname'](_0x3d4a35[_0x21e0('0x6')])),'ignore':[path['join'](path[_0x21e0('0x59')](_0x3d4a35[_0x21e0('0x6')]),_0x21e0('0x62')),path['join'](path['basename'](_0x3d4a35['path']),_0x21e0('0x63'))],'nodir':!![]})['finalize']();_0x4592d8['on'](_0x21e0('0x64'),function(){if(!fs[_0x21e0('0x65')](_0x4b033a)){throw new db[(_0x21e0('0x5d'))][(_0x21e0('0x5e'))](_0x21e0('0x66'));}return _0x8f6229[_0x21e0('0x52')](_0x4b033a,util[_0x21e0('0x57')](_0x21e0('0x58'),path[_0x21e0('0x59')](_0x3d4a35[_0x21e0('0x6')])),function(_0x5c6c03){if(_0x5c6c03){throw new db[(_0x21e0('0x5d'))][(_0x21e0('0x5e'))](_0x21e0('0x67'));}fs['unlinkSync'](_0x4b033a);logger[_0x21e0('0x68')](_0x21e0('0x69'));logger['info'](_0x21e0('0x6a'));});});}return null;})[_0x21e0('0x4f')](handleError(_0x8f6229,null));};exports[_0x21e0('0x6b')]=function(_0x1c7a52,_0x4371af,_0x43ed4a){var _0x4a83a5=path[_0x21e0('0x59')](_0x1c7a52[_0x21e0('0x6c')]['filename'],path[_0x21e0('0x6d')](_0x1c7a52[_0x21e0('0x6c')]['filename']));var _0x5b3e0d=path[_0x21e0('0x54')](config[_0x21e0('0x55')],_0x21e0('0x56'),_0x1c7a52['file'][_0x21e0('0x6e')]);var _0x1b14e5=path[_0x21e0('0x54')](config['root'],_0x21e0('0x56'),_0x4a83a5);logger[_0x21e0('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x5b3e0d);logger[_0x21e0('0x68')](_0x21e0('0x6f'),_0x1b14e5);try{fs[_0x21e0('0x70')](_0x5b3e0d,parseInt('0777',0x8));extract(_0x5b3e0d,{'dir':_0x1b14e5},function(_0x3f54af){if(_0x3f54af){logger[_0x21e0('0x32')](_0x3f54af);handleError(_0x3f54af,!![]);};var _0x3a089f=fs[_0x21e0('0x71')](_0x1b14e5);if(_0x3a089f[_0x21e0('0x42')]>0x1){removeReferences(_0x5b3e0d,_0x1b14e5);logger[_0x21e0('0x32')](_0x21e0('0x72'));return _0x43ed4a(new Error('Invalid\x20plugin\x20structure'));}var _0x12c5ad=fs['lstatSync'](path[_0x21e0('0x54')](_0x1b14e5,_0x3a089f[0x0]));if(_0x12c5ad[_0x21e0('0x73')]()){removeReferences(_0x5b3e0d,_0x1b14e5);logger[_0x21e0('0x32')](_0x21e0('0x72'));return _0x43ed4a(new Error(_0x21e0('0x72')));}if(_0x12c5ad['isDirectory']()){var _0x5bb2da=fs[_0x21e0('0x71')](path[_0x21e0('0x54')](_0x1b14e5,_0x3a089f[0x0]));if(_0x5bb2da[_0x21e0('0x42')]===0x0){removeReferences(_0x5b3e0d,_0x1b14e5);logger[_0x21e0('0x32')](_0x21e0('0x72'));return _0x43ed4a(new Error(_0x21e0('0x72')));}var _0x49c2a0=_0x5bb2da[_0x21e0('0x74')](function(_0x5cbc40){return _0x5cbc40===_0x21e0('0x75');});if(!_0x49c2a0){return _0x43ed4a(new Error(_0x21e0('0x76')));}var _0x5cc029=fs[_0x21e0('0x77')](path[_0x21e0('0x54')](_0x1b14e5,_0x3a089f[0x0],'manifest.json'));var _0xf62b4c=JSON[_0x21e0('0x78')](_0x5cc029);if(_0x21e0('0x79')==typeof _0xf62b4c['name']){return _0x43ed4a(new Error(_0x21e0('0x7a')));}if(_0x21e0('0x79')==typeof _0xf62b4c[_0x21e0('0x3a')]){return _0x43ed4a(new Error(_0x21e0('0x7b')));}if(_0x21e0('0x79')==typeof _0xf62b4c[_0x21e0('0x7c')]){return _0x43ed4a(new Error(_0x21e0('0x7d')));}if(_0x21e0('0x79')==typeof _0xf62b4c['parameters']){return _0x43ed4a(new Error(_0x21e0('0x7e')));}if(_0xf62b4c['type']==='html'){if(_0x21e0('0x79')==typeof _0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')]){return _0x43ed4a(new Error(_0x21e0('0x81')));}if(_0x21e0('0x79')==typeof _0xf62b4c['parameters'][_0x21e0('0x80')][_0x21e0('0x82')]&&'undefined'==typeof _0xf62b4c[_0x21e0('0x7f')]['views']['agent']){return _0x43ed4a(new Error(_0x21e0('0x83')));}}else if(_0xf62b4c[_0x21e0('0x3a')]==='script'){if(_0x21e0('0x79')==typeof _0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x84')]){return _0x43ed4a(new Error(_0x21e0('0x85')));}if(_0x21e0('0x79')==typeof _0xf62b4c['parameters'][_0x21e0('0x86')]){return _0x43ed4a(new Error(_0x21e0('0x87')));}}else{return _0x43ed4a(new Error(_0x21e0('0x88')));}var _0x22a80b=_0xf62b4c[_0x21e0('0x34')];var _0x44eca9=_0xf62b4c[_0x21e0('0x89')];var _0x5352fa=_0xf62b4c[_0x21e0('0x3a')];var _0x101512=_0xf62b4c[_0x21e0('0x8a')]?_0xf62b4c[_0x21e0('0x8a')]:_0x21e0('0x8b');var _0x36ace9=_0xf62b4c['icon']?_0xf62b4c[_0x21e0('0x8c')]:_0x21e0('0x8d');var _0x2a4143='';var _0x3ecadd='';var _0x20f708='';var _0x5df390='';var _0x58135f=_0xf62b4c[_0x21e0('0x7c')];if(_0x5352fa===_0x21e0('0x8e')){if(_0x21e0('0x79')!=typeof _0xf62b4c[_0x21e0('0x7f')]['views'][_0x21e0('0x82')]){var _0x3c6f32=_0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')][_0x21e0('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x21e0('0x8f')](_0x3c6f32)){_0x2a4143=path[_0x21e0('0x54')]('plugins',_0x4a83a5,_0x3a089f[0x0],_0x3c6f32);}else{_0x2a4143=_0x3c6f32;}}else{logger[_0x21e0('0x68')](_0x21e0('0x90'));}if(_0x21e0('0x79')!=typeof _0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')][_0x21e0('0x91')]){var _0x3704d8=_0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x21e0('0x8f')](_0x3704d8)){_0x3ecadd=path[_0x21e0('0x54')](_0x21e0('0x92'),_0x4a83a5,_0x3a089f[0x0],_0x3704d8);}else{_0x3ecadd=_0x3704d8;}}else{logger[_0x21e0('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5352fa===_0x21e0('0x93')){_0x20f708=_0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x84')];_0x5df390=_0xf62b4c[_0x21e0('0x7f')]['scriptPath'];if('undefined'!=typeof _0xf62b4c[_0x21e0('0x7f')]['views']){if('undefined'!=typeof _0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')]['admin']){var _0x3c6f32=_0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')][_0x21e0('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3c6f32)){_0x2a4143=path[_0x21e0('0x54')]('plugins',_0x4a83a5,_0x3a089f[0x0],_0x3c6f32);}else{_0x2a4143=_0x3c6f32;}}if('undefined'!=typeof _0xf62b4c[_0x21e0('0x7f')][_0x21e0('0x80')][_0x21e0('0x91')]){var _0x3704d8=_0xf62b4c[_0x21e0('0x7f')]['views'][_0x21e0('0x91')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3704d8)){_0x3ecadd=path[_0x21e0('0x54')]('plugins',_0x4a83a5,_0x3a089f[0x0],_0x3704d8);}else{_0x3ecadd=_0x3704d8;}}}}var _0x900213={'name':_0x22a80b,'description':_0x44eca9,'path':path[_0x21e0('0x54')](_0x4a83a5,_0x3a089f[0x0]),'type':_0x5352fa,'sidebar':_0x101512,'icon':_0x36ace9,'adminUrl':_0x2a4143,'agentUrl':_0x3ecadd,'scriptName':_0x20f708,'scriptPath':_0x5df390,'version':_0x58135f};removeReferences(_0x5b3e0d,null);return db[_0x21e0('0x37')]['create'](_0x900213)['then'](function(_0xf53f20){var _0x5e42d1={'role':_0x1c7a52['body'][_0x21e0('0x94')],'userProfileId':_0x1c7a52['body']['userProfileId']};if(!_0x5e42d1)throw new Error(_0x21e0('0x95'));if(_0x5e42d1[_0x21e0('0x94')]===_0x21e0('0x96')){var _0x548b9f=_0xf53f20[_0x21e0('0x2f')]({'plain':!![]});return db[_0x21e0('0x97')][_0x21e0('0x51')]({'where':{'name':_0x21e0('0x98'),'userProfileId':_0x5e42d1[_0x21e0('0x99')]},'raw':!![]})[_0x21e0('0x31')](function(_0x49b1b5){if(_0x49b1b5&&_0x49b1b5[_0x21e0('0x9a')]===0x0){return db[_0x21e0('0x30')][_0x21e0('0x9b')]({'name':_0x548b9f[_0x21e0('0x34')],'resourceId':_0x548b9f['id'],'type':_0x49b1b5[_0x21e0('0x34')],'sectionId':_0x49b1b5['id']},{})['then'](function(){return _0xf53f20;});}else{return _0xf53f20;}})[_0x21e0('0x4f')](function(_0x63c302){logger[_0x21e0('0x32')](_0x21e0('0x9c'),_0x63c302);throw _0x63c302;});}return _0xf53f20;})[_0x21e0('0x31')](respondWithResult(_0x4371af,null))[_0x21e0('0x4f')](handleError(_0x4371af,null));}});}catch(_0x437fe1){_0x4371af[_0x21e0('0x23')](0x1f4)[_0x21e0('0x9d')](_0x437fe1);}};function removeReferences(_0x4f955e,_0xaea467){try{if(_0x4f955e){fs[_0x21e0('0x9e')](_0x4f955e);logger[_0x21e0('0x68')](_0x21e0('0x9f'));}if(_0xaea467){rimraf(_0xaea467,function(){});logger[_0x21e0('0x68')](_0x21e0('0xa0'));}}catch(_0x11a155){logger[_0x21e0('0x32')](_0x11a155);}}exports['update']=function(_0x19ca72,_0x1f4355,_0x44b744){return db['Plugin'][_0x21e0('0x51')]({'where':{'id':_0x19ca72[_0x21e0('0x53')]['id']}})[_0x21e0('0x31')](handleEntityNotFound(_0x1f4355,null))[_0x21e0('0x31')](saveUpdates(_0x19ca72['body'],null))['then'](respondWithResult(_0x1f4355,null))['catch'](handleError(_0x1f4355,null));};exports['delete']=function(_0x1a9243,_0x1aaacb,_0x1d0d10){return db['Plugin'][_0x21e0('0x51')]({'where':{'id':_0x1a9243[_0x21e0('0x53')]['id']}})[_0x21e0('0x31')](function(_0x2bfd94){if(_0x2bfd94){return _0x2bfd94[_0x21e0('0x2e')]();}})[_0x21e0('0x31')](function(_0x456471){rimraf(path[_0x21e0('0x54')](config[_0x21e0('0x55')],'server/files/plugins',path[_0x21e0('0xa1')](_0x456471[_0x21e0('0x6')])),function(){});return _0x456471;})[_0x21e0('0x31')](handleEntityNotFound(_0x1aaacb,null))[_0x21e0('0x31')](respondWithStatusCode(_0x1aaacb,null))[_0x21e0('0x4f')](handleError(_0x1aaacb,null));};exports[_0x21e0('0xa2')]=function(_0x1ca560,_0x34de29,_0x2c6e2e){return BPromise['resolve']()[_0x21e0('0x31')](function(){if(!_0x1ca560['query'][_0x21e0('0x6')]){throw new Error(_0x21e0('0xa3'));}if(!_0x1ca560[_0x21e0('0x3d')][_0x21e0('0xa4')]){throw new Error(_0x21e0('0xa5'));}var _0x1d9a1a=_0x1ca560[_0x21e0('0x3d')][_0x21e0('0xa6')]?_0x1ca560[_0x21e0('0x3d')][_0x21e0('0xa6')]+':'+_0x1ca560['query'][_0x21e0('0xa4')]:'http://localhost:'+_0x1ca560[_0x21e0('0x3d')][_0x21e0('0xa4')];var _0x26e463=_0x1ca560[_0x21e0('0x3d')][_0x21e0('0x25')]?_0x1ca560[_0x21e0('0x3d')][_0x21e0('0x25')]:!![];var _0x3cb985=_0x1ca560[_0x21e0('0x3d')][_0x21e0('0xa7')]?_0x1ca560[_0x21e0('0x3d')]['encoding']:null;var _0x26ba7c={'method':_0x1ca560[_0x21e0('0xa8')],'uri':util[_0x21e0('0x57')](_0x21e0('0xa9'),_0x1d9a1a,_0x1ca560[_0x21e0('0x3d')]['path']),'json':_0x26e463,'resolveWithFullResponse':!![],'encoding':_0x3cb985,'qs':_0x1ca560[_0x21e0('0x3d')]};if(_0x1ca560[_0x21e0('0xaa')]){_0x26ba7c[_0x21e0('0xaa')]=_0x1ca560[_0x21e0('0xaa')];if(_0x26ba7c[_0x21e0('0xaa')][_0x21e0('0xab')]){delete _0x26ba7c[_0x21e0('0xaa')]['content-length'];}}if(_0x26ba7c[_0x21e0('0xaa')]['content-type']){delete _0x26ba7c[_0x21e0('0xaa')]['content-type'];}return rp(_0x26ba7c);})[_0x21e0('0x31')](function(_0x4f91ce){if(_0x4f91ce){_0x34de29[_0x21e0('0x29')](_0x4f91ce[_0x21e0('0xaa')]);logger[_0x21e0('0x68')](_0x4f91ce['body']);if(_[_0x21e0('0xac')](_0x1ca560[_0x21e0('0x3d')]['path'],_0x21e0('0x52'))&&_0x4f91ce[_0x21e0('0xad')]==0x1f4){return _0x34de29[_0x21e0('0x22')](_0x4f91ce[_0x21e0('0xad')]);}else{return _0x34de29['status'](_0x4f91ce['statusCode'])[_0x21e0('0x9d')](_0x4f91ce[_0x21e0('0xae')]);}}else{return _0x34de29['sendStatus'](0xc8);}})[_0x21e0('0x4f')](handleError(_0x34de29,null));};exports['webhookPost']=function(_0x5190f8,_0x41974a,_0x4ac3dd){return BPromise[_0x21e0('0xaf')]()[_0x21e0('0x31')](function(){if(!_0x5190f8[_0x21e0('0x3d')]['path']){throw new Error(_0x21e0('0xa3'));}if(!_0x5190f8[_0x21e0('0x3d')]['port']){throw new Error(_0x21e0('0xa5'));}var _0x6b472=_0x5190f8[_0x21e0('0x3d')][_0x21e0('0xa6')]?_0x5190f8[_0x21e0('0x3d')][_0x21e0('0xa6')]+':'+_0x5190f8['query'][_0x21e0('0xa4')]:_0x21e0('0xb0')+_0x5190f8[_0x21e0('0x3d')][_0x21e0('0xa4')];var _0x663934=_0x5190f8[_0x21e0('0x3d')][_0x21e0('0x25')]?_0x5190f8[_0x21e0('0x3d')][_0x21e0('0x25')]:!![];var _0x3d501c=_0x5190f8[_0x21e0('0x3d')][_0x21e0('0xa7')]?_0x5190f8[_0x21e0('0x3d')][_0x21e0('0xa7')]:null;var _0x471248={'method':_0x5190f8[_0x21e0('0xa8')],'uri':util[_0x21e0('0x57')](_0x21e0('0xa9'),_0x6b472,_0x5190f8[_0x21e0('0x3d')][_0x21e0('0x6')]),'json':_0x663934,'resolveWithFullResponse':!![],'encoding':_0x3d501c,'body':_0x5190f8[_0x21e0('0xae')]};if(_0x5190f8['headers']){_0x471248[_0x21e0('0xaa')]=_0x5190f8[_0x21e0('0xaa')];if(_0x471248['headers']['content-length']){delete _0x471248[_0x21e0('0xaa')][_0x21e0('0xab')];}}if(_0x471248[_0x21e0('0xaa')][_0x21e0('0xb1')]){delete _0x471248[_0x21e0('0xaa')][_0x21e0('0xb1')];}return rp(_0x471248);})['then'](function(_0x1023bc){if(_0x1023bc){_0x41974a[_0x21e0('0x29')](_0x1023bc[_0x21e0('0xaa')]);logger['info'](_0x1023bc[_0x21e0('0xae')]);return _0x41974a['status'](_0x1023bc[_0x21e0('0xad')])[_0x21e0('0x9d')](_0x1023bc[_0x21e0('0xae')]);}else{return _0x41974a[_0x21e0('0x22')](0xc8);}})[_0x21e0('0x4f')](handleError(_0x41974a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 52a8eb1..c6d03ef 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 _0x0b3d=['Plugin','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x15023f,_0x342b87){var _0x1d3400=function(_0x4408ac){while(--_0x4408ac){_0x15023f['push'](_0x15023f['shift']());}};_0x1d3400(++_0x342b87);}(_0x0b3d,0x76));var _0xd0b3=function(_0x18bf17,_0x32626e){_0x18bf17=_0x18bf17-0x0;var _0x7c4e02=_0x0b3d[_0x18bf17];return _0x7c4e02;};'use strict';var EventEmitter=require(_0xd0b3('0x0'));var Plugin=require('../../mysqldb')['db'][_0xd0b3('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd0b3('0x2'),'afterUpdate':'update','afterDestroy':_0xd0b3('0x3')};function emitEvent(_0x4edc24){return function(_0x372f08,_0x50faaa,_0x371869){PluginEvents[_0xd0b3('0x4')](_0x4edc24+':'+_0x372f08['id'],_0x372f08);PluginEvents['emit'](_0x4edc24,_0x372f08);_0x371869(null);};}for(var e in events){if(events[_0xd0b3('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xd0b3('0x6')]=PluginEvents; \ No newline at end of file +var _0xc029=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x40e57a,_0x2d3135){var _0x247f97=function(_0x35da1f){while(--_0x35da1f){_0x40e57a['push'](_0x40e57a['shift']());}};_0x247f97(++_0x2d3135);}(_0xc029,0x1df));var _0x9c02=function(_0x270e46,_0x122174){_0x270e46=_0x270e46-0x0;var _0x18ca4e=_0xc029[_0x270e46];return _0x18ca4e;};'use strict';var EventEmitter=require(_0x9c02('0x0'));var Plugin=require(_0x9c02('0x1'))['db'][_0x9c02('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9c02('0x3')](0x0);var events={'afterCreate':_0x9c02('0x4'),'afterUpdate':_0x9c02('0x5'),'afterDestroy':_0x9c02('0x6')};function emitEvent(_0x291f30){return function(_0x39c897,_0x2a96cd,_0x283c37){PluginEvents[_0x9c02('0x7')](_0x291f30+':'+_0x39c897['id'],_0x39c897);PluginEvents[_0x9c02('0x7')](_0x291f30,_0x39c897);_0x283c37(null);};}for(var e in events){if(events[_0x9c02('0x8')](e)){var event=events[e];Plugin[_0x9c02('0x9')](e,emitEvent(event));}}module[_0x9c02('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c99c42c..30d87c8 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 _0x2b44=['../../config/environment','./plugin.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x16e864,_0x53692b){var _0x385160=function(_0x565215){while(--_0x565215){_0x16e864['push'](_0x16e864['shift']());}};_0x385160(++_0x53692b);}(_0x2b44,0x122));var _0x42b4=function(_0xf318ee,_0x335ff1){_0xf318ee=_0xf318ee-0x0;var _0x1f613f=_0x2b44[_0xf318ee];return _0x1f613f;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require(_0x42b4('0x2'))(_0x42b4('0x3'));var moment=require(_0x42b4('0x4'));var BPromise=require(_0x42b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var attributes=require(_0x42b4('0x8'));module[_0x42b4('0x9')]=function(_0x4cc6c5,_0xe54897){return _0x4cc6c5[_0x42b4('0xa')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ee0=['api','moment','bluebird','request-promise','path','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x5ee0,0x17e));var _0x05ee=function(_0x3d170f,_0x29c8a4){_0x3d170f=_0x3d170f-0x0;var _0x36f2fd=_0x5ee0[_0x3d170f];return _0x36f2fd;};'use strict';var _=require(_0x05ee('0x0'));var util=require(_0x05ee('0x1'));var logger=require(_0x05ee('0x2'))(_0x05ee('0x3'));var moment=require(_0x05ee('0x4'));var BPromise=require(_0x05ee('0x5'));var rp=require(_0x05ee('0x6'));var fs=require('fs');var path=require(_0x05ee('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x530802,_0x32fd61){return _0x530802[_0x05ee('0x8')](_0x05ee('0x9'),attributes,{'tableName':_0x05ee('0xa'),'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 a7a53e5..fdeb901 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 _0xa18a=['request','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','Plugin,\x20%s,\x20%s','catch','CreatePlugin','Plugin','create','body','options','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','localhost','socket.io-emitter','./plugin.socket','register'];(function(_0x8b2271,_0x2f7364){var _0x5cfb4e=function(_0xf6ebb2){while(--_0xf6ebb2){_0x8b2271['push'](_0x8b2271['shift']());}};_0x5cfb4e(++_0x2f7364);}(_0xa18a,0x13c));var _0xaa18=function(_0x3747f1,_0x3e5372){_0x3747f1=_0x3747f1-0x0;var _0x421f36=_0xa18a[_0x3747f1];return _0x421f36;};'use strict';var _=require(_0xaa18('0x0'));var util=require('util');var moment=require(_0xaa18('0x1'));var BPromise=require(_0xaa18('0x2'));var rs=require(_0xaa18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa18('0x4'))['db'];var utils=require(_0xaa18('0x5'));var logger=require(_0xaa18('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa18('0x7'));var client=jayson[_0xaa18('0x8')]['http']({'port':0x232a});config['redis']=_[_0xaa18('0x9')](config['redis'],{'host':_0xaa18('0xa'),'port':0x18eb});var socket=require(_0xaa18('0xb'))(new Redis(config['redis']));require(_0xaa18('0xc'))[_0xaa18('0xd')](socket);function respondWithRpcPromise(_0x5b8d8f,_0x117136,_0x11c41d){return new BPromise(function(_0x32ec0b,_0x538c59){return client[_0xaa18('0xe')](_0x5b8d8f,_0x11c41d)['then'](function(_0x22ad91){logger[_0xaa18('0xf')]('Plugin,\x20%s,\x20%s',_0x117136,_0xaa18('0x10'));logger[_0xaa18('0x11')](_0xaa18('0x12'),_0x117136,_0xaa18('0x10'),JSON[_0xaa18('0x13')](_0x22ad91));if(_0x22ad91[_0xaa18('0x14')]){if(_0x22ad91[_0xaa18('0x14')]['code']===0x1f4){logger[_0xaa18('0x14')]('Plugin,\x20%s,\x20%s',_0x117136,_0x22ad91[_0xaa18('0x14')][_0xaa18('0x15')]);return _0x538c59(_0x22ad91['error'][_0xaa18('0x15')]);}logger[_0xaa18('0x14')](_0xaa18('0x16'),_0x117136,_0x22ad91[_0xaa18('0x14')]['message']);return _0x32ec0b(_0x22ad91[_0xaa18('0x14')]['message']);}else{logger[_0xaa18('0xf')]('Plugin,\x20%s,\x20%s',_0x117136,_0xaa18('0x10'));_0x32ec0b(_0x22ad91['result'][_0xaa18('0x15')]);}})[_0xaa18('0x17')](function(_0x5e02dd){logger[_0xaa18('0x14')](_0xaa18('0x16'),_0x117136,_0x5e02dd);_0x538c59(_0x5e02dd);});});}exports[_0xaa18('0x18')]=function(_0x4f111c){var _0x565935=this;return new Promise(function(_0x4eb25e,_0x2e070b){return db[_0xaa18('0x19')][_0xaa18('0x1a')](_0x4f111c[_0xaa18('0x1b')],{'raw':_0x4f111c[_0xaa18('0x1c')]?_0x4f111c[_0xaa18('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xaa18('0x1d')](function(_0x175abc){logger['info'](_0xaa18('0x18'),_0x4f111c);logger['debug'](_0xaa18('0x18'),_0x4f111c,JSON['stringify'](_0x175abc));_0x4eb25e(_0x175abc);})[_0xaa18('0x17')](function(_0x4c8782){logger['error'](_0xaa18('0x18'),_0x4c8782[_0xaa18('0x15')],_0x4f111c);_0x2e070b(_0x565935[_0xaa18('0x14')](0x1f4,_0x4c8782[_0xaa18('0x15')]));});});}; \ No newline at end of file +var _0x3ffd=['defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x3ffd,0x9c));var _0xd3ff=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x3ffd[_0x18a79d];return _0x4f8848;};'use strict';var _=require('lodash');var util=require(_0xd3ff('0x0'));var moment=require(_0xd3ff('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3ff('0x2'));var fs=require('fs');var Redis=require(_0xd3ff('0x3'));var db=require(_0xd3ff('0x4'))['db'];var utils=require(_0xd3ff('0x5'));var logger=require(_0xd3ff('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd3ff('0x7'));var client=jayson[_0xd3ff('0x8')]['http']({'port':0x232a});config['redis']=_[_0xd3ff('0x9')](config[_0xd3ff('0xa')],{'host':_0xd3ff('0xb'),'port':0x18eb});var socket=require(_0xd3ff('0xc'))(new Redis(config['redis']));require(_0xd3ff('0xd'))[_0xd3ff('0xe')](socket);function respondWithRpcPromise(_0x2226ad,_0x166234,_0x1fbda6){return new BPromise(function(_0x503dbb,_0x3dfcb9){return client[_0xd3ff('0xf')](_0x2226ad,_0x1fbda6)[_0xd3ff('0x10')](function(_0xea25fd){logger[_0xd3ff('0x11')](_0xd3ff('0x12'),_0x166234,_0xd3ff('0x13'));logger[_0xd3ff('0x14')](_0xd3ff('0x15'),_0x166234,_0xd3ff('0x13'),JSON['stringify'](_0xea25fd));if(_0xea25fd[_0xd3ff('0x16')]){if(_0xea25fd[_0xd3ff('0x16')][_0xd3ff('0x17')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x166234,_0xea25fd['error'][_0xd3ff('0x18')]);return _0x3dfcb9(_0xea25fd['error']['message']);}logger['error'](_0xd3ff('0x12'),_0x166234,_0xea25fd[_0xd3ff('0x16')][_0xd3ff('0x18')]);return _0x503dbb(_0xea25fd[_0xd3ff('0x16')][_0xd3ff('0x18')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x166234,_0xd3ff('0x13'));_0x503dbb(_0xea25fd[_0xd3ff('0x19')][_0xd3ff('0x18')]);}})[_0xd3ff('0x1a')](function(_0x3c6789){logger[_0xd3ff('0x16')](_0xd3ff('0x12'),_0x166234,_0x3c6789);_0x3dfcb9(_0x3c6789);});});}exports[_0xd3ff('0x1b')]=function(_0x53ea4f){var _0x5039cc=this;return new Promise(function(_0x5bce36,_0x10b12d){return db[_0xd3ff('0x1c')][_0xd3ff('0x1d')](_0x53ea4f['body'],{'raw':_0x53ea4f[_0xd3ff('0x1e')]?_0x53ea4f[_0xd3ff('0x1e')][_0xd3ff('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xf2e4a0){logger[_0xd3ff('0x11')]('CreatePlugin',_0x53ea4f);logger[_0xd3ff('0x14')](_0xd3ff('0x1b'),_0x53ea4f,JSON[_0xd3ff('0x20')](_0xf2e4a0));_0x5bce36(_0xf2e4a0);})['catch'](function(_0x5635c0){logger[_0xd3ff('0x16')]('CreatePlugin',_0x5635c0[_0xd3ff('0x18')],_0x53ea4f);_0x10b12d(_0x5039cc[_0xd3ff('0x16')](0x1f4,_0x5635c0['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 22c472c..24309ca 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 _0x2990=['./plugin.events','save','remove','update','emit','register','plugin:'];(function(_0xf17da4,_0x38d993){var _0x411e22=function(_0x21b509){while(--_0x21b509){_0xf17da4['push'](_0xf17da4['shift']());}};_0x411e22(++_0x38d993);}(_0x2990,0x16c));var _0x0299=function(_0x4b5de3,_0x28118a){_0x4b5de3=_0x4b5de3-0x0;var _0x44e503=_0x2990[_0x4b5de3];return _0x44e503;};'use strict';var PluginEvents=require(_0x0299('0x0'));var events=[_0x0299('0x1'),_0x0299('0x2'),_0x0299('0x3')];function createListener(_0x479f05,_0x4fe1d6){return function(_0x17bada){_0x4fe1d6[_0x0299('0x4')](_0x479f05,_0x17bada);};}function removeListener(_0x17e524,_0x4faa27){return function(){PluginEvents['removeListener'](_0x17e524,_0x4faa27);};}exports[_0x0299('0x5')]=function(_0x1103d7){for(var _0x51c8c9=0x0,_0x5751b3=events['length'];_0x51c8c9<_0x5751b3;_0x51c8c9++){var _0x54a9d4=events[_0x51c8c9];var _0x1f0877=createListener(_0x0299('0x6')+_0x54a9d4,_0x1103d7);PluginEvents['on'](_0x54a9d4,_0x1f0877);}}; \ No newline at end of file +var _0x15cf=['./plugin.events','save','remove','update','register','length','plugin:'];(function(_0x16ef65,_0x28cce1){var _0x3ecbdb=function(_0x1670f7){while(--_0x1670f7){_0x16ef65['push'](_0x16ef65['shift']());}};_0x3ecbdb(++_0x28cce1);}(_0x15cf,0x11f));var _0xf15c=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x15cf[_0x16ea87];return _0x6e7b1c;};'use strict';var PluginEvents=require(_0xf15c('0x0'));var events=[_0xf15c('0x1'),_0xf15c('0x2'),_0xf15c('0x3')];function createListener(_0x147160,_0x315010){return function(_0x5efed6){_0x315010['emit'](_0x147160,_0x5efed6);};}function removeListener(_0x4c68a1,_0x245334){return function(){PluginEvents['removeListener'](_0x4c68a1,_0x245334);};}exports[_0xf15c('0x4')]=function(_0x1d0ce3){for(var _0x143aa1=0x0,_0x43ada1=events[_0xf15c('0x5')];_0x143aa1<_0x43ada1;_0x143aa1++){var _0x52fc1b=events[_0x143aa1];var _0x5aa2c2=createListener(_0xf15c('0x6')+_0x52fc1b,_0x1d0ce3);PluginEvents['on'](_0x52fc1b,_0x5aa2c2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 78199fc..fe09242 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(_0x55d821,_0x2736af){var _0x1a1e34=function(_0x28edd2){while(--_0x28edd2){_0x55d821['push'](_0x55d821['shift']());}};_0x1a1e34(++_0x2736af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x5cda92,_0x53897d){var _0x395468=function(_0x2d0133){while(--_0x2d0133){_0x5cda92['push'](_0x5cda92['shift']());}};_0x395468(++_0x53897d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 606ced3..3ffd537 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 _0x2bc6=['json','error','stack','name','send','npm\x20install','info','then','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','bluebird','status'];(function(_0x4f1af9,_0xc95c63){var _0x11a60e=function(_0x19de7f){while(--_0x19de7f){_0x4f1af9['push'](_0x4f1af9['shift']());}};_0x11a60e(++_0xc95c63);}(_0x2bc6,0x163));var _0x62bc=function(_0x35909c,_0x27fa56){_0x35909c=_0x35909c-0x0;var _0x45abd5=_0x2bc6[_0x35909c];return _0x45abd5;};'use strict';var _=require(_0x62bc('0x0'));var pm2=require(_0x62bc('0x1'));var logger=require(_0x62bc('0x2'))('api');var path=require('path');var exec=require('child_process')['exec'];var BPromise=require(_0x62bc('0x3'));function handleEntityNotFound(_0x576608,_0x2a1959){return function(_0x2b12de){if(!_0x2b12de){_0x576608['sendStatus'](0x194);;}return _0x2b12de;};}function respondWithResult(_0x3cce26,_0x450cb6){_0x450cb6=_0x450cb6||0xc8;return function(_0x40af10){if(_0x40af10){return _0x3cce26[_0x62bc('0x4')](_0x450cb6)[_0x62bc('0x5')](_0x40af10);}return null;};}function handleError(_0x3f625c,_0x5bedeb){_0x5bedeb=_0x5bedeb||0x1f4;return function(_0x441722){logger[_0x62bc('0x6')](_0x441722[_0x62bc('0x7')]);if(_0x441722[_0x62bc('0x8')]){delete _0x441722['name'];}_0x3f625c[_0x62bc('0x4')](_0x5bedeb)[_0x62bc('0x9')](_0x441722);};}function execChildProcess(){return new BPromise(function(_0x1e3a57,_0x546acc){exec(_0x62bc('0xa'),function(_0x22e6c8,_0x256784,_0x444910){logger[_0x62bc('0xb')](_0x256784);logger[_0x62bc('0xb')](_0x444910);if(_0x22e6c8){logger[_0x62bc('0x6')](_0x22e6c8);return _0x546acc(_0x22e6c8);}return _0x1e3a57(_0x256784);});});}exports['index']=function(_0x2a96ae,_0x28390b){return pm2['list']()[_0x62bc('0xc')](function(_0x10230f){if(_0x10230f){var _0xc14ac9=_['reject'](_0x10230f,function(_0x263424){return _0x263424[_0x62bc('0x8')]==='express'||_0x263424['name']===_0x62bc('0xd');});return{'rows':_0xc14ac9,'count':_0xc14ac9[_0x62bc('0xe')]};}return null;})['then'](respondWithResult(_0x28390b,null))[_0x62bc('0xf')](handleError(_0x28390b,null));};exports[_0x62bc('0x10')]=function(_0xc1211c,_0x1e2405){return pm2[_0x62bc('0x11')](_0xc1211c[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x1e2405,null))[_0x62bc('0xc')](handleEntityNotFound(_0x1e2405,null))[_0x62bc('0xf')](handleError(_0x1e2405,null));};exports['create']=function(_0x5dd6f0,_0x2b2e5f){if(_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')]&&_0x5dd6f0['body'][_0x62bc('0x14')]){var _0x495f99=path[_0x62bc('0x15')](__dirname,_0x62bc('0x16'),_0x5dd6f0[_0x62bc('0x13')]['script']);var _0x3b8644=process[_0x62bc('0x17')]();process[_0x62bc('0x18')](path[_0x62bc('0x19')](_0x495f99));return execChildProcess()[_0x62bc('0xc')](function(_0x3b2eb0){process['chdir'](_0x3b8644);return pm2[_0x62bc('0x1a')]({'name':_0x5dd6f0[_0x62bc('0x13')][_0x62bc('0x8')],'script':_0x495f99});})[_0x62bc('0xc')](function(_0x117ebc){pm2['dump']();return _0x117ebc[0x0];})['then'](respondWithResult(_0x2b2e5f,0xc9))[_0x62bc('0xf')](handleError(_0x2b2e5f,null));}else{return _0x2b2e5f['status'](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('0x1b')});}};exports[_0x62bc('0x1c')]=function(_0x4a72d6,_0x3d55df){if(_0x4a72d6[_0x62bc('0x13')]['id']){delete _0x4a72d6[_0x62bc('0x13')]['id'];}var _0x5c03ac={'online':'restart','stopped':_0x62bc('0x1d')};if(_0x5c03ac[_0x62bc('0x1e')](_0x4a72d6[_0x62bc('0x13')]['status'])){return pm2[_0x5c03ac[_0x4a72d6[_0x62bc('0x13')][_0x62bc('0x4')]]](_0x4a72d6[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](respondWithResult(_0x3d55df,0xc8))['catch'](handleError(_0x3d55df,null));}else{return _0x3d55df[_0x62bc('0x4')](0x1f4)['send']({'message':_0x62bc('0x1f')});}};exports[_0x62bc('0x20')]=function(_0x32048f,_0x2dd7fd){if(_0x32048f[_0x62bc('0x13')]['id']){delete _0x32048f[_0x62bc('0x13')]['id'];}if(_0x32048f[_0x62bc('0x12')]['id']){return pm2[_0x62bc('0x21')](_0x32048f[_0x62bc('0x12')]['id'])[_0x62bc('0xc')](function(_0x156f95){pm2[_0x62bc('0x22')]();return _0x156f95[0x0];})[_0x62bc('0xc')](respondWithResult(_0x2dd7fd,null))[_0x62bc('0xf')](handleError(_0x2dd7fd,null));}else{return _0x2dd7fd[_0x62bc('0x4')](0x1f4)[_0x62bc('0x9')]({'message':_0x62bc('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(_0x2389d9,_0x5dccc4){var _0x63468e=function(_0x26b411){while(--_0x26b411){_0x2389d9['push'](_0x2389d9['shift']());}};_0x63468e(++_0x5dccc4);}(_0x2e54,0x1dd));var _0x42e5=function(_0x47988b,_0xbacd7b){_0x47988b=_0x47988b-0x0;var _0x15f614=_0x2e54[_0x47988b];return _0x15f614;};'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 afd8732..c66e473 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 _0x5acc=['exports','express','Router','get','/queues','isAuthenticated'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x5acc,0x1ed));var _0xc5ac=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5acc[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0xc5ac('0x0'));var router=express[_0xc5ac('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xc5ac('0x2')](_0xc5ac('0x3'),auth[_0xc5ac('0x4')](),controller['getQueues']);module[_0xc5ac('0x5')]=router; \ No newline at end of file +var _0xb16f=['isAuthenticated','exports','Router','../../components/auth/service','./realtime.controller','/queues'];(function(_0x2a7d88,_0x655229){var _0x26a5bb=function(_0x1f96e1){while(--_0x1f96e1){_0x2a7d88['push'](_0x2a7d88['shift']());}};_0x26a5bb(++_0x655229);}(_0xb16f,0x1c4));var _0xfb16=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0xb16f[_0x3fc97b];return _0x3a0c82;};'use strict';var express=require('express');var router=express[_0xfb16('0x0')]();var auth=require(_0xfb16('0x1'));var controller=require(_0xfb16('0x2'));router['get'](_0xfb16('0x3'),auth[_0xfb16('0x4')](),controller['getQueues']);module[_0xfb16('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 26dabb0..dcb02dd 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 _0x24fe=['talking','outbound','push','pTalking','originated','message','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','get','agents','paused','loggedInDb','find','merge','pick','filter','queue','length','busy','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','QueueId','getQueues','mail','chat','openchannel','fax','resolve','includes','query','channel','toLowerCase','Invalid\x20channel','map','rawAttributes','fieldName','user','userProfileId','type','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','rows','all','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','undefined','offset','count','status','set','Content-Range','json','error','name','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting'];(function(_0x5354f1,_0x4109e5){var _0x22fd1b=function(_0x15d674){while(--_0x15d674){_0x5354f1['push'](_0x5354f1['shift']());}};_0x22fd1b(++_0x4109e5);}(_0x24fe,0x10b));var _0xe24f=function(_0x160c3d,_0x2eb120){_0x160c3d=_0x160c3d-0x0;var _0x4fa3cb=_0x24fe[_0x160c3d];return _0x4fa3cb;};'use strict';var util=require(_0xe24f('0x0'));var _=require('lodash');var jayson=require(_0xe24f('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xe24f('0x2'))(_0xe24f('0x3'));var db=require(_0xe24f('0x4'))['db'];var amiClient=jayson[_0xe24f('0x5')][_0xe24f('0x6')]({'port':0x232a});var routingClient=jayson[_0xe24f('0x5')][_0xe24f('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2d19ae,_0x2ca94f){return function(_0x14dac4){if(_0x14dac4){var _0x84be7b=typeof _0x2ca94f['offset']===_0xe24f('0x7')&&typeof _0x2ca94f['limit']===_0xe24f('0x7');var _0x52ce43=_0x14dac4['count'];var _0x5c853d=_0x84be7b?0x0:_0x2ca94f[_0xe24f('0x8')];var _0x182bcc=_0x84be7b?_0x14dac4[_0xe24f('0x9')]:_0x2ca94f['offset']+_0x2ca94f['limit'];var _0x3cbc14;if(_0x182bcc>=_0x52ce43){_0x182bcc=_0x52ce43;_0x3cbc14=0xc8;}else{_0x3cbc14=0xce;}_0x2d19ae[_0xe24f('0xa')](_0x3cbc14);return _0x2d19ae[_0xe24f('0xb')](_0xe24f('0xc'),_0x5c853d+'-'+_0x182bcc+'/'+_0x52ce43)[_0xe24f('0xd')](_0x14dac4);}return null;};}function handleError(_0x41878a,_0x845b6){_0x845b6=_0x845b6||0x1f4;return function(_0x4ed874){logger[_0xe24f('0xe')](_0x4ed874['stack']);if(_0x4ed874[_0xe24f('0xf')]){delete _0x4ed874[_0xe24f('0xf')];}_0x41878a['status'](_0x845b6)[_0xe24f('0x10')](_0x4ed874);};}function getRealtimeAgents(){return new Promise(function(_0x5e03b4,_0x4970a5){return amiClient['request'](_0xe24f('0x11'),{})[_0xe24f('0x12')](function(_0x156b9e){if(_0x156b9e[_0xe24f('0xe')])throw new Error(_0xe24f('0x13'));var _0x42a12b=_0x156b9e[_0xe24f('0x14')];return routingClient[_0xe24f('0x15')](_0xe24f('0x11'),{})['then'](function(_0xe3b800){if(_0xe3b800[_0xe24f('0xe')])throw new Error(_0xe24f('0x16'));var _0xde8979=_0xe3b800[_0xe24f('0x14')];return _0x5e03b4(_['merge']({},_0x42a12b,_0xde8979));});})['catch'](function(_0x3a62a4){_0x4970a5(_0x3a62a4);});});}function getRealtimeQueues(_0x4a972f,_0x1b6fa5){return new Promise(function(_0x5e9a5b,_0x636fee){var _0x139ca7=_0x1b6fa5===_0xe24f('0x17')?amiClient:routingClient;return _0x139ca7[_0xe24f('0x15')](_[_0xe24f('0x18')](_0x1b6fa5)+'Queues',_0x4a972f)[_0xe24f('0x12')](function(_0x2eb6aa){if(_0x2eb6aa[_0xe24f('0xe')])throw new Error(util[_0xe24f('0x19')](_0xe24f('0x1a'),_0x1b6fa5));return _0x5e9a5b(_0x2eb6aa[_0xe24f('0x14')]);})[_0xe24f('0x1b')](function(_0x26a294){_0x636fee(_0x26a294);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1cf950,_0x2dc098){return amiClient[_0xe24f('0x15')](_0xe24f('0x1c'),{})['then'](function(_0x25985f){if(_0x25985f[_0xe24f('0xe')])throw new Error(_0xe24f('0x1d'));return _0x1cf950(_0x25985f[_0xe24f('0x14')]);})['catch'](function(_0x539e84){_0x2dc098(_0x539e84);});});}function initializeQueues(_0x801a08,_0x27bbdc,_0x47becf,_0x275468){var _0x41ad0b=[_0xe24f('0x1e'),_0xe24f('0x1f'),_0xe24f('0x20'),_0xe24f('0x21'),'paused'];if(_0x47becf===_0xe24f('0x17')&&_0x275468===_0xe24f('0x22')){_0x41ad0b[_0xe24f('0x23')](_0xe24f('0x24'),_0xe24f('0x25'),_0xe24f('0x26'),'dialActive','dialMethod','Trunk',_0xe24f('0x27'),_0xe24f('0x28'),_0xe24f('0x29'),_0xe24f('0x2a'),_0xe24f('0x2b'),_0xe24f('0x2c'),_0xe24f('0x2d'),'dialPredictiveIntervalMaxThreshold',_0xe24f('0x2e'),'predictiveIntervalAvailable',_0xe24f('0x2f'),_0xe24f('0x30'),'predictiveIntervalDroppedCallsTimeout',_0xe24f('0x31'),_0xe24f('0x32'),'predictiveIntervalAvgTalktime');}return _0x801a08['map'](function(_0x18a77f){var _0x4845cd=_0x18a77f[_0xe24f('0x33')]({'plain':!![]});_0x4845cd[_0xe24f('0x34')]=[];_0x4845cd[_0xe24f('0x35')]=0x0;_0x4845cd[_0xe24f('0x36')]=0x0;_0x4845cd['loggedIn']=0x0;_0x4845cd['available']=0x0;_0x4845cd[_0xe24f('0x20')]=0x0;if(_0x47becf===_0xe24f('0x17')){_0x4845cd[_0xe24f('0x21')]=0x0;_0x4845cd['busy']=0x0;if(_0x275468===_0xe24f('0x22')){_0x4845cd['pTalking']=0x0;_0x4845cd[_0xe24f('0x25')]=0x0;}}var _0x223ed3=_[_0xe24f('0x37')](_0x27bbdc,['id',_0x4845cd['id']]);if(_0x223ed3)_[_0xe24f('0x38')](_0x4845cd,_[_0xe24f('0x39')](_0x223ed3,_0x41ad0b));return _0x4845cd;});}function updateAgentVoiceStatus(_0x24bc42,_0x589554,_0x4904f7){var _0x1c5439=_[_0xe24f('0x3a')](_0x4904f7,[_0xe24f('0x3b'),_0x589554[_0xe24f('0xf')]]);if(_0x1c5439[_0xe24f('0x3c')]===0x0)return _0x24bc42[_0xe24f('0x3d')]=!![];if(_[_0xe24f('0x3e')](_0x1c5439,[_0xe24f('0x3f'),_0x24bc42[_0xe24f('0x40')][_0xe24f('0x41')]()]))return _0x24bc42[_0xe24f('0x21')]=!![];if(!_0x24bc42[_0xe24f('0x21')])return _0x24bc42[_0xe24f('0x3d')]=!![];}function getVoiceQueueAgents(_0x5f1c73,_0x5a368d,_0x2e22d0,_0x50a7b6){var _0x202280=_[_0xe24f('0x37')](_0x5a368d,['id',_0x5f1c73['id']]);if(!_0x202280)return _0x5f1c73;return _0x202280[_0xe24f('0x42')]({'raw':!![]})[_0xe24f('0x12')](function(_0x2d6f39){for(var _0x1cfda1=0x0;_0x1cfda1<_0x2d6f39[_0xe24f('0x3c')];_0x1cfda1++){var _0x356cba=_['find'](_0x2e22d0,['id',_0x2d6f39[_0x1cfda1][_0xe24f('0x43')]]);if(!_0x356cba){_0x356cba={'id':_0x2d6f39[_0x1cfda1][_0xe24f('0x43')],'name':_0x2d6f39[_0x1cfda1][_0xe24f('0x43')],'accountcode':'','online':![]};}var _0x108895={'id':_0x356cba['id'],'name':_0x356cba[_0xe24f('0xf')],'internal':_0x356cba[_0xe24f('0x44')],'online':Boolean(_0x356cba[_0xe24f('0x45')]),'paused':Boolean(_0x2d6f39[_0x1cfda1][_0xe24f('0x35')])};if(_0x356cba[_0xe24f('0x46')]===_0xe24f('0x21'))updateAgentVoiceStatus(_0x108895,_0x5f1c73,_0x50a7b6);if(_0x108895['online'])_0x5f1c73[_0xe24f('0x36')]++;if(_0x108895[_0xe24f('0x3d')])_0x5f1c73[_0xe24f('0x3d')]++;if(_0x108895[_0xe24f('0x35')]&&!_0x108895[_0xe24f('0x3d')]&&!_0x108895[_0xe24f('0x21')])_0x5f1c73['paused']++;_0x5f1c73[_0xe24f('0x34')]['push'](_0x108895);}return _0x5f1c73;});}function getQueueAgents(_0x4c57e5,_0x3c44d0,_0x3f1e74){var _0x31ddee=_0xe24f('0x47')+_[_0xe24f('0x18')](_0x3f1e74)+_0xe24f('0x48');var _0x26eca7=_0x3f1e74+_0xe24f('0x49');return db[_0x31ddee][_0xe24f('0x4a')]({'where':{[_[_0xe24f('0x18')](_0x3f1e74)+_0xe24f('0x4b')]:_0x4c57e5['id']},'raw':!![]})[_0xe24f('0x12')](function(_0x2f3a9d){for(var _0x1615ef=0x0;_0x1615ef<_0x2f3a9d[_0xe24f('0x3c')];_0x1615ef++){var _0xb39016=_[_0xe24f('0x37')](_0x3c44d0,['id',_0x2f3a9d[_0x1615ef]['UserId']]);if(!_0xb39016){_0xb39016={'id':_0x2f3a9d[_0x1615ef]['UserId'],'name':_0x2f3a9d[_0x1615ef][_0xe24f('0x43')],'online':![],['pauseField']:![]};}var _0x5146c7={'id':_0xb39016['id'],'name':_0xb39016[_0xe24f('0xf')],'online':Boolean(_0xb39016[_0xe24f('0x45')]),'paused':Boolean(_0xb39016[_0x26eca7])};if(_0x5146c7['online'])_0x4c57e5[_0xe24f('0x36')]++;_0x4c57e5['agents'][_0xe24f('0x23')](_0x5146c7);}return _0x4c57e5;});}exports[_0xe24f('0x4c')]=function(_0x846ca9,_0x417623){var _0x1671ac=[_0xe24f('0x4d'),_0xe24f('0x4e'),'sms',_0xe24f('0x4f'),_0xe24f('0x50'),'whatsapp','voice'];var _0x5ed1fb={'count':0x0,'rows':[]},_0x39cd67={},_0x50b13f,_0x29079c,_0x2bc37e,_0x5f7054,_0x383dc5;Promise[_0xe24f('0x51')]()['then'](function(){if(_0x846ca9['query']['channel']){if(!_[_0xe24f('0x52')](_0x1671ac,_0x846ca9[_0xe24f('0x53')][_0xe24f('0x54')][_0xe24f('0x55')]()))throw new Error(_0xe24f('0x56'));_0x50b13f=_0x846ca9[_0xe24f('0x53')]['channel'][_0xe24f('0x55')]();}var _0x2ac282=_[_0xe24f('0x18')](_0x50b13f)+_0xe24f('0x48');var _0x156cfb=_[_0xe24f('0x57')](db[_0x2ac282][_0xe24f('0x58')],function(_0x1f3f9a){return{'name':_0x1f3f9a[_0xe24f('0x59')],'type':_0x1f3f9a['type']['key']};});_0x39cd67=qs['getOptions'](_0x156cfb,_0x846ca9);if(_0x846ca9[_0xe24f('0x5a')]['role']===_0xe24f('0x5a')){var _0x24afb6={'params':{'id':_0x846ca9['user'][_0xe24f('0x5b')]},'query':{'section':_0x50b13f===_0xe24f('0x17')&&_0x846ca9[_0xe24f('0x53')][_0xe24f('0x5c')]===_0xe24f('0x22')?_0xe24f('0x5d'):_[_0xe24f('0x18')](_0x50b13f)+_0xe24f('0x5e'),'type':_0x846ca9['query'][_0xe24f('0x5c')],'nolimit':!![],'sort':_0xe24f('0xf'),'filter':_0x846ca9['query'][_0xe24f('0x3a')]}};return db[_0xe24f('0x5f')][_0xe24f('0x60')](_0x24afb6);}return db[_0x2ac282][_0xe24f('0x61')](_0x39cd67);})[_0xe24f('0x12')](function(_0x9d402d){_0x5ed1fb[_0xe24f('0x9')]=_0x9d402d[_0xe24f('0x9')];_0x29079c=_0x9d402d[_0xe24f('0x62')];return getRealtimeQueues(_0x846ca9,_0x50b13f);})[_0xe24f('0x12')](function(_0x2de16c){_0x5f7054=_0x2de16c[_0xe24f('0x62')];return getRealtimeAgents();})[_0xe24f('0x12')](function(_0x177461){_0x2bc37e=_0x177461['rows'];if(_0x50b13f!=_0xe24f('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0xe24f('0x12')](function(_0x4fbcaa){_0x383dc5=_0x4fbcaa?_0x4fbcaa[_0xe24f('0x62')]:[];return initializeQueues(_0x29079c,_0x5f7054,_0x50b13f,_0x846ca9[_0xe24f('0x53')][_0xe24f('0x5c')]);})['then'](function(_0x3fe80c){var _0x300b75=_0x3fe80c[_0xe24f('0x57')](function(_0x3f3f48){if(_0x50b13f===_0xe24f('0x17'))return getVoiceQueueAgents(_0x3f3f48,_0x29079c,_0x2bc37e,_0x383dc5);else return getQueueAgents(_0x3f3f48,_0x2bc37e,_0x50b13f);});return Promise[_0xe24f('0x63')](_0x300b75);})[_0xe24f('0x12')](function(_0x16182c){_0x5ed1fb[_0xe24f('0x62')]=_0x16182c;return _0x5ed1fb;})[_0xe24f('0x12')](respondWithFilteredResult(_0x417623,_0x39cd67))[_0xe24f('0x1b')](handleError(_0x417623,null));}; \ No newline at end of file +var _0x5f28=['connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','startCase','Queue','Pause','findAll','QueueId','mail','chat','sms','openchannel','fax','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','map','rawAttributes','fieldName','type','user','role','userProfileId','QueueCampaigns','getResources','findAndCountAll','rows','all','util','lodash','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','set','stack','name','status','send','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','paused','outbound','push','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','waiting','talking','pTalking','originated','merge','pick','filter','queue','length','busy','some'];(function(_0x5267d7,_0x576a6e){var _0x583d1f=function(_0xa7633b){while(--_0xa7633b){_0x5267d7['push'](_0x5267d7['shift']());}};_0x583d1f(++_0x576a6e);}(_0x5f28,0x8c));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x85f2('0x0'));var _=require(_0x85f2('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x85f2('0x2'))('api');var db=require(_0x85f2('0x3'))['db'];var amiClient=jayson[_0x85f2('0x4')][_0x85f2('0x5')]({'port':0x232a});var routingClient=jayson[_0x85f2('0x4')][_0x85f2('0x5')]({'port':0x232c});function respondWithFilteredResult(_0xbe09c9,_0x169bfe){return function(_0x5f0f06){if(_0x5f0f06){var _0x3e0428=typeof _0x169bfe[_0x85f2('0x6')]===_0x85f2('0x7')&&typeof _0x169bfe[_0x85f2('0x8')]===_0x85f2('0x7');var _0x260d40=_0x5f0f06[_0x85f2('0x9')];var _0x16a81a=_0x3e0428?0x0:_0x169bfe[_0x85f2('0x6')];var _0x33841e=_0x3e0428?_0x5f0f06[_0x85f2('0x9')]:_0x169bfe[_0x85f2('0x6')]+_0x169bfe['limit'];var _0x54ffac;if(_0x33841e>=_0x260d40){_0x33841e=_0x260d40;_0x54ffac=0xc8;}else{_0x54ffac=0xce;}_0xbe09c9['status'](_0x54ffac);return _0xbe09c9[_0x85f2('0xa')]('Content-Range',_0x16a81a+'-'+_0x33841e+'/'+_0x260d40)['json'](_0x5f0f06);}return null;};}function handleError(_0x439e01,_0x137a50){_0x137a50=_0x137a50||0x1f4;return function(_0x547eee){logger['error'](_0x547eee[_0x85f2('0xb')]);if(_0x547eee[_0x85f2('0xc')]){delete _0x547eee[_0x85f2('0xc')];}_0x439e01[_0x85f2('0xd')](_0x137a50)[_0x85f2('0xe')](_0x547eee);};}function getRealtimeAgents(){return new Promise(function(_0x3ad08a,_0x93289e){return amiClient[_0x85f2('0xf')]('Agents',{})[_0x85f2('0x10')](function(_0x512940){if(_0x512940['error'])throw new Error(_0x85f2('0x11'));var _0x585afb=_0x512940[_0x85f2('0x12')];return routingClient[_0x85f2('0xf')](_0x85f2('0x13'),{})[_0x85f2('0x10')](function(_0x237e3a){if(_0x237e3a[_0x85f2('0x14')])throw new Error(_0x85f2('0x15'));var _0x5454bc=_0x237e3a[_0x85f2('0x12')];return _0x3ad08a(_['merge']({},_0x585afb,_0x5454bc));});})[_0x85f2('0x16')](function(_0x299445){_0x93289e(_0x299445);});});}function getRealtimeQueues(_0x4f8a6d,_0x48e403){return new Promise(function(_0x1c33a6,_0x36297a){var _0x38815b=_0x48e403===_0x85f2('0x17')?amiClient:routingClient;return _0x38815b[_0x85f2('0xf')](_['startCase'](_0x48e403)+_0x85f2('0x18'),_0x4f8a6d)[_0x85f2('0x10')](function(_0x300d3b){if(_0x300d3b[_0x85f2('0x14')])throw new Error(util['format'](_0x85f2('0x19'),_0x48e403));return _0x1c33a6(_0x300d3b[_0x85f2('0x12')]);})[_0x85f2('0x16')](function(_0x35dfa3){_0x36297a(_0x35dfa3);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x14b30f,_0x1c568c){return amiClient[_0x85f2('0xf')](_0x85f2('0x1a'),{})[_0x85f2('0x10')](function(_0x93099){if(_0x93099['error'])throw new Error(_0x85f2('0x1b'));return _0x14b30f(_0x93099[_0x85f2('0x12')]);})[_0x85f2('0x16')](function(_0x2564c2){_0x1c568c(_0x2564c2);});});}function initializeQueues(_0x2474cf,_0x4828c7,_0x3d7ea5,_0x554ab5){var _0x31fd62=[_0x85f2('0x1c'),_0x85f2('0x1d'),'waiting','talking',_0x85f2('0x1e')];if(_0x3d7ea5===_0x85f2('0x17')&&_0x554ab5===_0x85f2('0x1f')){_0x31fd62[_0x85f2('0x20')]('pTalking','originated','message',_0x85f2('0x21'),_0x85f2('0x22'),_0x85f2('0x23'),_0x85f2('0x24'),_0x85f2('0x25'),'erlangCalls',_0x85f2('0x26'),_0x85f2('0x27'),'erlangBusyFactor',_0x85f2('0x28'),_0x85f2('0x29'),_0x85f2('0x2a'),_0x85f2('0x2b'),_0x85f2('0x2c'),_0x85f2('0x2d'),_0x85f2('0x2e'),_0x85f2('0x2f'),_0x85f2('0x30'),_0x85f2('0x31'));}return _0x2474cf['map'](function(_0x3c5647){var _0x20ba6c=_0x3c5647[_0x85f2('0x32')]({'plain':!![]});_0x20ba6c[_0x85f2('0x33')]=[];_0x20ba6c[_0x85f2('0x1e')]=0x0;_0x20ba6c[_0x85f2('0x34')]=0x0;_0x20ba6c[_0x85f2('0x1c')]=0x0;_0x20ba6c[_0x85f2('0x1d')]=0x0;_0x20ba6c[_0x85f2('0x35')]=0x0;if(_0x3d7ea5===_0x85f2('0x17')){_0x20ba6c[_0x85f2('0x36')]=0x0;_0x20ba6c['busy']=0x0;if(_0x554ab5===_0x85f2('0x1f')){_0x20ba6c[_0x85f2('0x37')]=0x0;_0x20ba6c[_0x85f2('0x38')]=0x0;}}var _0x533aea=_['find'](_0x4828c7,['id',_0x20ba6c['id']]);if(_0x533aea)_[_0x85f2('0x39')](_0x20ba6c,_[_0x85f2('0x3a')](_0x533aea,_0x31fd62));return _0x20ba6c;});}function updateAgentVoiceStatus(_0x5911c2,_0x3120f0,_0x4461b9){var _0x1d7e5e=_[_0x85f2('0x3b')](_0x4461b9,[_0x85f2('0x3c'),_0x3120f0['name']]);if(_0x1d7e5e[_0x85f2('0x3d')]===0x0)return _0x5911c2[_0x85f2('0x3e')]=!![];if(_[_0x85f2('0x3f')](_0x1d7e5e,[_0x85f2('0x40'),_0x5911c2[_0x85f2('0x41')][_0x85f2('0x42')]()]))return _0x5911c2[_0x85f2('0x36')]=!![];if(!_0x5911c2[_0x85f2('0x36')])return _0x5911c2[_0x85f2('0x3e')]=!![];}function getVoiceQueueAgents(_0x39898f,_0x371484,_0xd10c3b,_0x509778){var _0x54f227=_[_0x85f2('0x43')](_0x371484,['id',_0x39898f['id']]);if(!_0x54f227)return _0x39898f;return _0x54f227[_0x85f2('0x44')]({'raw':!![]})[_0x85f2('0x10')](function(_0x17ad35){for(var _0x3a636e=0x0;_0x3a636e<_0x17ad35[_0x85f2('0x3d')];_0x3a636e++){var _0x24e7ec=_['find'](_0xd10c3b,['id',_0x17ad35[_0x3a636e]['UserId']]);if(!_0x24e7ec){_0x24e7ec={'id':_0x17ad35[_0x3a636e]['UserId'],'name':_0x17ad35[_0x3a636e][_0x85f2('0x45')],'accountcode':'','online':![]};}var _0x15eef7={'id':_0x24e7ec['id'],'name':_0x24e7ec[_0x85f2('0xc')],'internal':_0x24e7ec[_0x85f2('0x46')],'online':Boolean(_0x24e7ec[_0x85f2('0x47')]),'paused':Boolean(_0x17ad35[_0x3a636e][_0x85f2('0x1e')])};if(_0x24e7ec[_0x85f2('0x48')]==='talking')updateAgentVoiceStatus(_0x15eef7,_0x39898f,_0x509778);if(_0x15eef7[_0x85f2('0x47')])_0x39898f[_0x85f2('0x34')]++;if(_0x15eef7['busy'])_0x39898f[_0x85f2('0x3e')]++;if(_0x15eef7['paused']&&!_0x15eef7[_0x85f2('0x3e')]&&!_0x15eef7[_0x85f2('0x36')])_0x39898f[_0x85f2('0x1e')]++;_0x39898f[_0x85f2('0x33')][_0x85f2('0x20')](_0x15eef7);}return _0x39898f;});}function getQueueAgents(_0x51d76c,_0x263964,_0x135241){var _0x4dedab=_0x85f2('0x49')+_[_0x85f2('0x4a')](_0x135241)+_0x85f2('0x4b');var _0x481683=_0x135241+_0x85f2('0x4c');return db[_0x4dedab][_0x85f2('0x4d')]({'where':{[_[_0x85f2('0x4a')](_0x135241)+_0x85f2('0x4e')]:_0x51d76c['id']},'raw':!![]})['then'](function(_0x367c96){for(var _0x3230ad=0x0;_0x3230ad<_0x367c96[_0x85f2('0x3d')];_0x3230ad++){var _0x12c4ca=_[_0x85f2('0x43')](_0x263964,['id',_0x367c96[_0x3230ad][_0x85f2('0x45')]]);if(!_0x12c4ca){_0x12c4ca={'id':_0x367c96[_0x3230ad][_0x85f2('0x45')],'name':_0x367c96[_0x3230ad][_0x85f2('0x45')],'online':![],['pauseField']:![]};}var _0x23e9d8={'id':_0x12c4ca['id'],'name':_0x12c4ca['name'],'online':Boolean(_0x12c4ca[_0x85f2('0x47')]),'paused':Boolean(_0x12c4ca[_0x481683])};if(_0x23e9d8[_0x85f2('0x47')])_0x51d76c['loggedInDb']++;_0x51d76c[_0x85f2('0x33')][_0x85f2('0x20')](_0x23e9d8);}return _0x51d76c;});}exports['getQueues']=function(_0x3a0060,_0x827c76){var _0x3a6cad=[_0x85f2('0x4f'),_0x85f2('0x50'),_0x85f2('0x51'),_0x85f2('0x52'),_0x85f2('0x53'),'whatsapp',_0x85f2('0x17')];var _0x303f83={'count':0x0,'rows':[]},_0x3060c7={},_0x213d75,_0x1c4541,_0xa0da0c,_0x126894,_0x48bcc1;Promise[_0x85f2('0x54')]()[_0x85f2('0x10')](function(){if(_0x3a0060[_0x85f2('0x55')][_0x85f2('0x56')]){if(!_[_0x85f2('0x57')](_0x3a6cad,_0x3a0060[_0x85f2('0x55')][_0x85f2('0x56')][_0x85f2('0x58')]()))throw new Error(_0x85f2('0x59'));_0x213d75=_0x3a0060[_0x85f2('0x55')][_0x85f2('0x56')][_0x85f2('0x58')]();}var _0x3187ab=_[_0x85f2('0x4a')](_0x213d75)+_0x85f2('0x4b');var _0x5092df=_[_0x85f2('0x5a')](db[_0x3187ab][_0x85f2('0x5b')],function(_0x372d6c){return{'name':_0x372d6c[_0x85f2('0x5c')],'type':_0x372d6c[_0x85f2('0x5d')]['key']};});_0x3060c7=qs['getOptions'](_0x5092df,_0x3a0060);if(_0x3a0060[_0x85f2('0x5e')][_0x85f2('0x5f')]==='user'){var _0x112831={'params':{'id':_0x3a0060['user'][_0x85f2('0x60')]},'query':{'section':_0x213d75===_0x85f2('0x17')&&_0x3a0060[_0x85f2('0x55')][_0x85f2('0x5d')]==='outbound'?_0x85f2('0x61'):_[_0x85f2('0x4a')](_0x213d75)+'Queues','type':_0x3a0060['query']['type'],'nolimit':!![],'sort':_0x85f2('0xc'),'filter':_0x3a0060[_0x85f2('0x55')]['filter']}};return db['UserProfile'][_0x85f2('0x62')](_0x112831);}return db[_0x3187ab][_0x85f2('0x63')](_0x3060c7);})[_0x85f2('0x10')](function(_0x2c27eb){_0x303f83[_0x85f2('0x9')]=_0x2c27eb[_0x85f2('0x9')];_0x1c4541=_0x2c27eb[_0x85f2('0x64')];return getRealtimeQueues(_0x3a0060,_0x213d75);})[_0x85f2('0x10')](function(_0x5a516a){_0x126894=_0x5a516a[_0x85f2('0x64')];return getRealtimeAgents();})[_0x85f2('0x10')](function(_0x18e1fc){_0xa0da0c=_0x18e1fc['rows'];if(_0x213d75!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x85f2('0x10')](function(_0x475c0c){_0x48bcc1=_0x475c0c?_0x475c0c[_0x85f2('0x64')]:[];return initializeQueues(_0x1c4541,_0x126894,_0x213d75,_0x3a0060[_0x85f2('0x55')][_0x85f2('0x5d')]);})['then'](function(_0x4f8323){var _0x56e9d1=_0x4f8323['map'](function(_0x166c46){if(_0x213d75===_0x85f2('0x17'))return getVoiceQueueAgents(_0x166c46,_0x1c4541,_0xa0da0c,_0x48bcc1);else return getQueueAgents(_0x166c46,_0xa0da0c,_0x213d75);});return Promise[_0x85f2('0x65')](_0x56e9d1);})[_0x85f2('0x10')](function(_0x41734f){_0x303f83[_0x85f2('0x64')]=_0x41734f;return _0x303f83;})[_0x85f2('0x10')](respondWithFilteredResult(_0x827c76,_0x3060c7))['catch'](handleError(_0x827c76,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index cf962aa..54bd713 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3973da,_0x3e8345){var _0x455279=function(_0x5efe40){while(--_0x5efe40){_0x3973da['push'](_0x3973da['shift']());}};_0x455279(++_0x3e8345);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x48b651,_0x124903){var _0x1f4b54=function(_0x487ebd){while(--_0x487ebd){_0x48b651['push'](_0x48b651['shift']());}};_0x1f4b54(++_0x124903);}(_0xe706,0xa3));var _0x6e70=function(_0x362ad7,_0x948800){_0x362ad7=_0x362ad7-0x0;var _0x54703b=_0xe706[_0x362ad7];return _0x54703b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c032fad..ca973c0 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 _0xed54=['exports','INTEGER','STRING','DATE'];(function(_0x6ca047,_0x24d941){var _0x23e656=function(_0x3af335){while(--_0x3af335){_0x6ca047['push'](_0x6ca047['shift']());}};_0x23e656(++_0x24d941);}(_0xed54,0xfc));var _0x4ed5=function(_0xa07c97,_0x3fabb6){_0xa07c97=_0xa07c97-0x0;var _0x242cc6=_0xed54[_0xa07c97];return _0x242cc6;};'use strict';var Sequelize=require('sequelize');module[_0x4ed5('0x0')]={'state':{'type':Sequelize[_0x4ed5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4ed5('0x2')]},'scheduledat':{'type':Sequelize[_0x4ed5('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4ed5('0x3')]},'responsetime':{'type':Sequelize[_0x4ed5('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4ed5('0x2')]},'membername':{'type':Sequelize[_0x4ed5('0x2')]}}; \ No newline at end of file +var _0x2086=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x2c1b9c,_0x4ef876){var _0x1afbcd=function(_0xe1ab26){while(--_0xe1ab26){_0x2c1b9c['push'](_0x2c1b9c['shift']());}};_0x1afbcd(++_0x4ef876);}(_0x2086,0x124));var _0x6208=function(_0x53d780,_0xbbef30){_0x53d780=_0x53d780-0x0;var _0x8ebcdb=_0x2086[_0x53d780];return _0x8ebcdb;};'use strict';var Sequelize=require(_0x6208('0x0'));module[_0x6208('0x1')]={'state':{'type':Sequelize[_0x6208('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6208('0x3')]},'scheduledat':{'type':Sequelize[_0x6208('0x4')]},'uniqueid':{'type':Sequelize[_0x6208('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6208('0x4')]},'ringtime':{'type':Sequelize[_0x6208('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6208('0x3')]},'membername':{'type':Sequelize[_0x6208('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c8879f7..a0b6926 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 _0xe358=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','ReportAgentPreview','lodash'];(function(_0xb5fc3e,_0x234703){var _0x2efc3c=function(_0x4e4e44){while(--_0x4e4e44){_0xb5fc3e['push'](_0xb5fc3e['shift']());}};_0x2efc3c(++_0x234703);}(_0xe358,0x19d));var _0x8e35=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0xe358[_0x41382c];return _0x4da35b;};'use strict';var _=require(_0x8e35('0x0'));var util=require('util');var logger=require(_0x8e35('0x1'))(_0x8e35('0x2'));var moment=require('moment');var BPromise=require(_0x8e35('0x3'));var rp=require(_0x8e35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e35('0x5'));var config=require(_0x8e35('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x8e35('0x7')]=function(_0x246e34,_0x404fdb){return _0x246e34['define'](_0x8e35('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x611f=['ReportAgentPreview','report_agent_preview','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','define'];(function(_0x3bc9f8,_0x4930e1){var _0x1de4a1=function(_0x4e4be7){while(--_0x4e4be7){_0x3bc9f8['push'](_0x3bc9f8['shift']());}};_0x1de4a1(++_0x4930e1);}(_0x611f,0x162));var _0xf611=function(_0x16cf18,_0x248d91){_0x16cf18=_0x16cf18-0x0;var _0xe9f480=_0x611f[_0x16cf18];return _0xe9f480;};'use strict';var _=require('lodash');var util=require(_0xf611('0x0'));var logger=require(_0xf611('0x1'))('api');var moment=require(_0xf611('0x2'));var BPromise=require(_0xf611('0x3'));var rp=require(_0xf611('0x4'));var fs=require('fs');var path=require(_0xf611('0x5'));var rimraf=require(_0xf611('0x6'));var config=require('../../config/environment');var attributes=require(_0xf611('0x7'));module['exports']=function(_0x693976,_0x513e3c){return _0x693976[_0xf611('0x8')](_0xf611('0x9'),attributes,{'tableName':_0xf611('0xa'),'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 b85ffa9..3e2523d 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 _0x7240=['request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x27e633,_0x43f7bb){var _0x4110ad=function(_0x3e41f8){while(--_0x3e41f8){_0x27e633['push'](_0x27e633['shift']());}};_0x4110ad(++_0x43f7bb);}(_0x7240,0xc7));var _0x0724=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x7240[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x0724('0x0'));var util=require(_0x0724('0x1'));var moment=require(_0x0724('0x2'));var BPromise=require(_0x0724('0x3'));var rs=require(_0x0724('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0724('0x5'))['db'];var utils=require(_0x0724('0x6'));var logger=require(_0x0724('0x7'))(_0x0724('0x8'));var config=require(_0x0724('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0724('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443381,_0xdc8811,_0x681adb){return new BPromise(function(_0x43db95,_0x3271cf){return client[_0x0724('0xb')](_0x443381,_0x681adb)[_0x0724('0xc')](function(_0x2481b2){logger[_0x0724('0xd')](_0x0724('0xe'),_0xdc8811,_0x0724('0xf'));logger[_0x0724('0x10')](_0x0724('0x11'),_0xdc8811,_0x0724('0xf'),JSON['stringify'](_0x2481b2));if(_0x2481b2[_0x0724('0x12')]){if(_0x2481b2[_0x0724('0x12')][_0x0724('0x13')]===0x1f4){logger[_0x0724('0x12')](_0x0724('0xe'),_0xdc8811,_0x2481b2[_0x0724('0x12')][_0x0724('0x14')]);return _0x3271cf(_0x2481b2[_0x0724('0x12')]['message']);}logger[_0x0724('0x12')](_0x0724('0xe'),_0xdc8811,_0x2481b2['error'][_0x0724('0x14')]);return _0x43db95(_0x2481b2[_0x0724('0x12')]['message']);}else{logger[_0x0724('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0xdc8811,_0x0724('0xf'));_0x43db95(_0x2481b2[_0x0724('0x15')][_0x0724('0x14')]);}})[_0x0724('0x16')](function(_0x24b361){logger[_0x0724('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xdc8811,_0x24b361);_0x3271cf(_0x24b361);});});}exports[_0x0724('0x17')]=function(_0x4fe863){var _0x1b3fd9=this;return new Promise(function(_0x55288c,_0x369c4e){return db[_0x0724('0x18')][_0x0724('0x19')](_0x4fe863[_0x0724('0x1a')],{'raw':_0x4fe863[_0x0724('0x1b')]?_0x4fe863[_0x0724('0x1b')][_0x0724('0x1c')]===undefined?!![]:![]:!![]})[_0x0724('0xc')](function(_0x220065){logger[_0x0724('0xd')](_0x0724('0x17'),_0x4fe863);logger[_0x0724('0x10')](_0x0724('0x17'),_0x4fe863,JSON[_0x0724('0x1d')](_0x220065));_0x55288c(_0x220065);})[_0x0724('0x16')](function(_0x2ba6ef){logger[_0x0724('0x12')]('CreateReportAgentPreview',_0x2ba6ef[_0x0724('0x14')],_0x4fe863);_0x369c4e(_0x1b3fd9['error'](0x1f4,_0x2ba6ef[_0x0724('0x14')]));});});}; \ No newline at end of file +var _0x8307=['result','catch','CreateReportAgentPreview','create','options','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message'];(function(_0x348860,_0x4531f6){var _0x2fc2ad=function(_0x3b449f){while(--_0x3b449f){_0x348860['push'](_0x348860['shift']());}};_0x2fc2ad(++_0x4531f6);}(_0x8307,0x78));var _0x7830=function(_0x1212b7,_0x30408f){_0x1212b7=_0x1212b7-0x0;var _0x4f75ce=_0x8307[_0x1212b7];return _0x4f75ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7830('0x0'));var BPromise=require(_0x7830('0x1'));var rs=require(_0x7830('0x2'));var fs=require('fs');var Redis=require(_0x7830('0x3'));var db=require(_0x7830('0x4'))['db'];var utils=require(_0x7830('0x5'));var logger=require('../../config/logger')(_0x7830('0x6'));var config=require(_0x7830('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7830('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x120a7e,_0x5eefad,_0x47b48e){return new BPromise(function(_0x360489,_0x1cef3d){return client[_0x7830('0x9')](_0x120a7e,_0x47b48e)['then'](function(_0x1b9b59){logger[_0x7830('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x5eefad,_0x7830('0xb'));logger[_0x7830('0xc')](_0x7830('0xd'),_0x5eefad,_0x7830('0xb'),JSON[_0x7830('0xe')](_0x1b9b59));if(_0x1b9b59[_0x7830('0xf')]){if(_0x1b9b59[_0x7830('0xf')]['code']===0x1f4){logger['error'](_0x7830('0x10'),_0x5eefad,_0x1b9b59[_0x7830('0xf')][_0x7830('0x11')]);return _0x1cef3d(_0x1b9b59[_0x7830('0xf')][_0x7830('0x11')]);}logger[_0x7830('0xf')](_0x7830('0x10'),_0x5eefad,_0x1b9b59[_0x7830('0xf')][_0x7830('0x11')]);return _0x360489(_0x1b9b59[_0x7830('0xf')][_0x7830('0x11')]);}else{logger[_0x7830('0xa')](_0x7830('0x10'),_0x5eefad,'request\x20sent');_0x360489(_0x1b9b59[_0x7830('0x12')][_0x7830('0x11')]);}})[_0x7830('0x13')](function(_0x4572f1){logger[_0x7830('0xf')](_0x7830('0x10'),_0x5eefad,_0x4572f1);_0x1cef3d(_0x4572f1);});});}exports[_0x7830('0x14')]=function(_0x4ecca9){var _0x187305=this;return new Promise(function(_0x1584bc,_0xca4ac7){return db['ReportAgentPreview'][_0x7830('0x15')](_0x4ecca9['body'],{'raw':_0x4ecca9[_0x7830('0x16')]?_0x4ecca9['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x381378){logger[_0x7830('0xa')](_0x7830('0x14'),_0x4ecca9);logger[_0x7830('0xc')](_0x7830('0x14'),_0x4ecca9,JSON[_0x7830('0xe')](_0x381378));_0x1584bc(_0x381378);})[_0x7830('0x13')](function(_0xa0a570){logger[_0x7830('0xf')]('CreateReportAgentPreview',_0xa0a570[_0x7830('0x11')],_0x4ecca9);_0xca4ac7(_0x187305['error'](0x1f4,_0xa0a570[_0x7830('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 87fb351..a9e602f 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 _0xfe37=['/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','isAuthenticated','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xfe37,0xe5));var _0x7fe3=function(_0x4e0242,_0x16dd06){_0x4e0242=_0x4e0242-0x0;var _0x3a2eed=_0xfe37[_0x4e0242];return _0x3a2eed;};'use strict';var multer=require(_0x7fe3('0x0'));var util=require(_0x7fe3('0x1'));var path=require('path');var express=require('express');var router=express[_0x7fe3('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0x7fe3('0x3'));router[_0x7fe3('0x4')](_0x7fe3('0x5'),auth['isAuthenticated'](),controller[_0x7fe3('0x6')]);router[_0x7fe3('0x4')](_0x7fe3('0x7'),auth['isAuthenticated'](),controller[_0x7fe3('0x8')]);router[_0x7fe3('0x4')](_0x7fe3('0x9'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x7fe3('0x4')](_0x7fe3('0xa'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x7fe3('0x4')](_0x7fe3('0xb'),auth['isAuthenticated'](),controller[_0x7fe3('0xc')]);router[_0x7fe3('0x4')](_0x7fe3('0xd'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0xf')]);router[_0x7fe3('0x4')](_0x7fe3('0x10'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x11')]);router[_0x7fe3('0x4')](_0x7fe3('0x12'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x13')]);router[_0x7fe3('0x4')](_0x7fe3('0x14'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x15')]);router[_0x7fe3('0x4')]('/whatsapp/queues',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x16')]);router[_0x7fe3('0x4')](_0x7fe3('0x17'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x18')]);router['get'](_0x7fe3('0x19'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x7fe3('0x4')](_0x7fe3('0x1a'),auth['isAuthenticated'](),controller[_0x7fe3('0x1b')]);router[_0x7fe3('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x7fe3('0xe')](),controller['voiceQueuesChannel']);router['get'](_0x7fe3('0x1c'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x1d')]);router['get'](_0x7fe3('0x1e'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x7fe3('0x4')](_0x7fe3('0x1f'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x20')]);router[_0x7fe3('0x21')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x7fe3('0x22')]);router[_0x7fe3('0x4')]('/outbound',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x23')]);router[_0x7fe3('0x4')](_0x7fe3('0x24'),auth['isAuthenticated'](),controller[_0x7fe3('0x25')]);router[_0x7fe3('0x4')](_0x7fe3('0x26'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x27')]);router[_0x7fe3('0x21')](_0x7fe3('0x28'),auth['isAuthenticated'](),controller[_0x7fe3('0x29')]);router[_0x7fe3('0x4')]('/telephones',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x2a')]);router[_0x7fe3('0x4')](_0x7fe3('0x2b'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x2c')]);router['get'](_0x7fe3('0x2d'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x2e')]);router[_0x7fe3('0x4')](_0x7fe3('0x2f'),auth[_0x7fe3('0xe')](),controller['faxAccounts']);router[_0x7fe3('0x4')](_0x7fe3('0x30'),auth['isAuthenticated'](),controller[_0x7fe3('0x31')]);router['get'](_0x7fe3('0x32'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x33')]);router[_0x7fe3('0x4')](_0x7fe3('0x34'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x35')]);router[_0x7fe3('0x4')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x7fe3('0x36')]);router[_0x7fe3('0x4')](_0x7fe3('0x37'),auth['isAuthenticated'](),controller[_0x7fe3('0x38')]);router[_0x7fe3('0x4')]('/whatsapp/queues/waitinginteractions',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x39')]);router['get'](_0x7fe3('0x3a'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x3b')]);router[_0x7fe3('0x3c')](_0x7fe3('0x3d'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x3e')](_0x7fe3('0x3f')));router['get'](_0x7fe3('0x40'),auth[_0x7fe3('0xe')](),controller['showMailQueues']);router[_0x7fe3('0x3c')](_0x7fe3('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x7fe3('0x42')));router[_0x7fe3('0x4')](_0x7fe3('0x43'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x44')]);router[_0x7fe3('0x3c')]('/fax/queues/:id/notify',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x3e')](_0x7fe3('0x45')));router['get']('/fax/queues/:id',auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x46')]);router[_0x7fe3('0x3c')](_0x7fe3('0x47'),auth['isAuthenticated'](),controller[_0x7fe3('0x3e')](_0x7fe3('0x48')));router['get'](_0x7fe3('0x49'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x4a')]);router[_0x7fe3('0x3c')](_0x7fe3('0x4b'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x3e')](_0x7fe3('0x4c')));router['post'](_0x7fe3('0x4d'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x3e')](_0x7fe3('0x4e')));router['get'](_0x7fe3('0x4f'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x50')]);router[_0x7fe3('0x4')](_0x7fe3('0x51'),auth[_0x7fe3('0xe')](),controller[_0x7fe3('0x52')]);router['post'](_0x7fe3('0x53'),auth[_0x7fe3('0xe')](),controller['agentNotify']);module[_0x7fe3('0x54')]=router; \ No newline at end of file +var _0x13eb=['smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','showMailQueues','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues'];(function(_0x1f96f5,_0x101fa4){var _0x3617c9=function(_0x401058){while(--_0x401058){_0x1f96f5['push'](_0x1f96f5['shift']());}};_0x3617c9(++_0x101fa4);}(_0x13eb,0x8f));var _0xb13e=function(_0x301755,_0xd69dc3){_0x301755=_0x301755-0x0;var _0x2dac9a=_0x13eb[_0x301755];return _0x2dac9a;};'use strict';var multer=require(_0xb13e('0x0'));var util=require(_0xb13e('0x1'));var path=require('path');var express=require(_0xb13e('0x2'));var router=express[_0xb13e('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xb13e('0x4'));router[_0xb13e('0x5')](_0xb13e('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xb13e('0x5')](_0xb13e('0x7'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x9')]);router[_0xb13e('0x5')](_0xb13e('0xa'),auth['isAuthenticated'](),controller[_0xb13e('0xb')]);router[_0xb13e('0x5')]('/voice/queues',auth[_0xb13e('0x8')](),controller[_0xb13e('0xc')]);router[_0xb13e('0x5')](_0xb13e('0xd'),auth[_0xb13e('0x8')](),controller[_0xb13e('0xe')]);router[_0xb13e('0x5')](_0xb13e('0xf'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x10')]);router['get'](_0xb13e('0x11'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x12')]);router[_0xb13e('0x5')]('/openchannel/queues',auth[_0xb13e('0x8')](),controller[_0xb13e('0x13')]);router[_0xb13e('0x5')](_0xb13e('0x14'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x15')]);router[_0xb13e('0x5')](_0xb13e('0x16'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x17')]);router[_0xb13e('0x5')](_0xb13e('0x18'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x19')]);router[_0xb13e('0x5')](_0xb13e('0x1a'),auth[_0xb13e('0x8')](),controller['voiceQueuesPreview']);router[_0xb13e('0x5')](_0xb13e('0x1b'),auth['isAuthenticated'](),controller[_0xb13e('0x1c')]);router[_0xb13e('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xb13e('0x8')](),controller[_0xb13e('0x1d')]);router[_0xb13e('0x5')](_0xb13e('0x1e'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x1f')]);router[_0xb13e('0x5')](_0xb13e('0x20'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x21')]);router[_0xb13e('0x5')](_0xb13e('0x22'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x23')]);router[_0xb13e('0x24')](_0xb13e('0x22'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x25')]);router[_0xb13e('0x5')](_0xb13e('0x26'),auth[_0xb13e('0x8')](),controller['outbound']);router[_0xb13e('0x5')](_0xb13e('0x27'),auth[_0xb13e('0x8')](),controller['outboundChannels']);router[_0xb13e('0x5')](_0xb13e('0x28'),auth[_0xb13e('0x8')](),controller['agents']);router[_0xb13e('0x24')](_0xb13e('0x29'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x2a')]);router['get'](_0xb13e('0x2b'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x2c')]);router[_0xb13e('0x5')]('/trunks',auth[_0xb13e('0x8')](),controller[_0xb13e('0x2d')]);router[_0xb13e('0x5')](_0xb13e('0x2e'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x2f')]);router[_0xb13e('0x5')](_0xb13e('0x30'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x31')]);router[_0xb13e('0x5')](_0xb13e('0x32'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x33')]);router['get'](_0xb13e('0x34'),auth[_0xb13e('0x8')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xb13e('0x35'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x36')]);router[_0xb13e('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xb13e('0x8')](),controller[_0xb13e('0x37')]);router['get'](_0xb13e('0x38'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x39')]);router[_0xb13e('0x5')](_0xb13e('0x3a'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x3b')]);router[_0xb13e('0x5')](_0xb13e('0x3c'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x3d')]);router[_0xb13e('0x3e')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xb13e('0x3f')]('mail'));router[_0xb13e('0x5')]('/mail/queues/:id',auth[_0xb13e('0x8')](),controller[_0xb13e('0x40')]);router[_0xb13e('0x3e')]('/chat/queues/:id/notify',auth[_0xb13e('0x8')](),controller[_0xb13e('0x3f')]('chat'));router['get'](_0xb13e('0x41'),auth[_0xb13e('0x8')](),controller['showChatQueues']);router[_0xb13e('0x3e')](_0xb13e('0x42'),auth['isAuthenticated'](),controller[_0xb13e('0x3f')](_0xb13e('0x43')));router[_0xb13e('0x5')](_0xb13e('0x44'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x45')]);router['post']('/openchannel/queues/:id/notify',auth[_0xb13e('0x8')](),controller[_0xb13e('0x3f')](_0xb13e('0x46')));router[_0xb13e('0x5')](_0xb13e('0x47'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xb13e('0x3e')](_0xb13e('0x48'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x3f')](_0xb13e('0x49')));router[_0xb13e('0x3e')](_0xb13e('0x4a'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x3f')](_0xb13e('0x4b')));router[_0xb13e('0x5')](_0xb13e('0x4c'),auth['isAuthenticated'](),controller[_0xb13e('0x4d')]);router[_0xb13e('0x5')]('/whatsapp/queues/:id',auth[_0xb13e('0x8')](),controller[_0xb13e('0x4e')]);router[_0xb13e('0x3e')](_0xb13e('0x4f'),auth[_0xb13e('0x8')](),controller[_0xb13e('0x50')]);module[_0xb13e('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1c0c605..61a0720 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 _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x515f78,_0x3b69be){var _0x506f6c=function(_0x14da41){while(--_0x14da41){_0x515f78['push'](_0x515f78['shift']());}};_0x506f6c(++_0x3b69be);}(_0x55ca,0x126));var _0xa55c=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x55ca[_0x13ac10];return _0x28eda2;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));}; \ No newline at end of file +var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x38e928,_0x1c637a){var _0x59ede0=function(_0x11a8f6){while(--_0x11a8f6){_0x38e928['push'](_0x38e928['shift']());}};_0x59ede0(++_0x1c637a);}(_0x2d17,0x17e));var _0x72d1=function(_0x18ed76,_0x4cf0c2){_0x18ed76=_0x18ed76-0x0;var _0x29ab90=_0x2d17[_0x18ed76];return _0x29ab90;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 399d254..9504950 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 _0x04f0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','index','get','/:id','isAuthenticated','show','/:id/run','run','post','create','put','destroy','exports','multer','util','path'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x04f0,0xb1));var _0x004f=function(_0x3b8730,_0x52de55){_0x3b8730=_0x3b8730-0x0;var _0x429444=_0x04f0[_0x3b8730];return _0x429444;};'use strict';var multer=require(_0x004f('0x0'));var util=require(_0x004f('0x1'));var path=require(_0x004f('0x2'));var timeout=require(_0x004f('0x3'));var express=require('express');var router=express[_0x004f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x004f('0x5'));var interaction=require(_0x004f('0x6'));var config=require('../../config/environment');var controller=require(_0x004f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x004f('0x8')]);router[_0x004f('0x9')](_0x004f('0xa'),auth[_0x004f('0xb')](),controller[_0x004f('0xc')]);router['get'](_0x004f('0xd'),auth[_0x004f('0xb')](),controller[_0x004f('0xe')]);router[_0x004f('0xf')]('/',auth[_0x004f('0xb')](),controller[_0x004f('0x10')]);router[_0x004f('0x11')](_0x004f('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x004f('0x12')]);module[_0x004f('0x13')]=router; \ No newline at end of file +var _0xea04=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','delete','destroy','exports'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0xea04,0x17c));var _0x4ea0=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0xea04[_0x21d36e];return _0x4cc307;};'use strict';var multer=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var path=require(_0x4ea0('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ea0('0x3'));var router=express[_0x4ea0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ea0('0x5'));var interaction=require(_0x4ea0('0x6'));var config=require('../../config/environment');var controller=require(_0x4ea0('0x7'));router[_0x4ea0('0x8')]('/',auth[_0x4ea0('0x9')](),controller[_0x4ea0('0xa')]);router[_0x4ea0('0x8')](_0x4ea0('0xb'),auth['isAuthenticated'](),controller[_0x4ea0('0xc')]);router['get'](_0x4ea0('0xd'),auth[_0x4ea0('0x9')](),controller[_0x4ea0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4ea0('0xf')]);router[_0x4ea0('0x10')]('/:id',auth[_0x4ea0('0x9')](),controller['update']);router[_0x4ea0('0x11')](_0x4ea0('0xb'),auth['isAuthenticated'](),controller[_0x4ea0('0x12')]);module[_0x4ea0('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 8d682ed..67cf71a 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 _0xf0e1=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','minutes','pdf','xlsx','csv','custom','default','TEXT','exports'];(function(_0x164671,_0x27362a){var _0x2d74a2=function(_0x3b4bd2){while(--_0x3b4bd2){_0x164671['push'](_0x164671['shift']());}};_0x2d74a2(++_0x27362a);}(_0xf0e1,0xfb));var _0x1f0e=function(_0x471a85,_0x239e8d){_0x471a85=_0x471a85-0x0;var _0x5f2039=_0xf0e1[_0x471a85];return _0x5f2039;};'use strict';var Sequelize=require('sequelize');module[_0x1f0e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1f0e('0x1')]},'active':{'type':Sequelize[_0x1f0e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1f0e('0x1')],'allowNull':![],'defaultValue':_0x1f0e('0x3')},'startAt':{'type':Sequelize[_0x1f0e('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1f0e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1f0e('0x6')](_0x1f0e('0x7'),_0x1f0e('0x8'),'months',_0x1f0e('0x9'),_0x1f0e('0xa'),'hours',_0x1f0e('0xb')),'allowNull':![],'defaultValue':_0x1f0e('0xa')},'output':{'type':Sequelize[_0x1f0e('0x6')]('csv',_0x1f0e('0xc'),_0x1f0e('0xd')),'allowNull':![],'defaultValue':_0x1f0e('0xe')},'type':{'type':Sequelize[_0x1f0e('0x6')](_0x1f0e('0xf'),_0x1f0e('0x10')),'allowNull':![],'defaultValue':_0x1f0e('0xf')},'sendMail':{'type':Sequelize[_0x1f0e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1f0e('0x1')]},'cc':{'type':Sequelize[_0x1f0e('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x1f0e('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9391=['weeks','minutes','days','csv','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months'];(function(_0x1c6b22,_0xb6ac5a){var _0x1377d2=function(_0x3707b6){while(--_0x3707b6){_0x1c6b22['push'](_0x1c6b22['shift']());}};_0x1377d2(++_0xb6ac5a);}(_0x9391,0xf2));var _0x1939=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9391[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x1939('0x0')]={'name':{'type':Sequelize[_0x1939('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1939('0x1')]},'active':{'type':Sequelize[_0x1939('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1939('0x1')],'allowNull':![],'defaultValue':_0x1939('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x1939('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1939('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1939('0x6')](_0x1939('0x7'),_0x1939('0x8'),_0x1939('0x9'),_0x1939('0xa'),'days','hours',_0x1939('0xb')),'allowNull':![],'defaultValue':_0x1939('0xc')},'output':{'type':Sequelize[_0x1939('0x6')](_0x1939('0xd'),'pdf',_0x1939('0xe')),'allowNull':![],'defaultValue':_0x1939('0xd')},'type':{'type':Sequelize['ENUM'](_0x1939('0xf'),_0x1939('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x1939('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1939('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x1939('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 357ec29..9dcd652 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 _0x3a1d=['body','user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','rimraf','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','Content-Range','apply','reject','save','destroy','then','get','Scheduler','UserProfileResource','end','sendStatus','stack','name','send','Schedule','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','create'];(function(_0x3e2a23,_0x6c980){var _0x281753=function(_0x4a3a6b){while(--_0x4a3a6b){_0x3e2a23['push'](_0x3e2a23['shift']());}};_0x281753(++_0x6c980);}(_0x3a1d,0xb0));var _0xd3a1=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x3a1d[_0x50e7e0];return _0x1a0307;};'use strict';var emlformat=require(_0xd3a1('0x0'));var rimraf=require(_0xd3a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd3a1('0x2'));var moment=require(_0xd3a1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd3a1('0x4'));var path=require('path');var sox=require(_0xd3a1('0x5'));var csv=require(_0xd3a1('0x6'));var ejs=require(_0xd3a1('0x7'));var fs=require('fs');var fs_extra=require(_0xd3a1('0x8'));var _=require(_0xd3a1('0x9'));var squel=require(_0xd3a1('0xa'));var crypto=require('crypto');var jsforce=require(_0xd3a1('0xb'));var deskjs=require(_0xd3a1('0xc'));var toCsv=require(_0xd3a1('0x6'));var querystring=require(_0xd3a1('0xd'));var Papa=require('papaparse');var Redis=require(_0xd3a1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd3a1('0xf'));var hardwareService=require(_0xd3a1('0x10'));var logger=require(_0xd3a1('0x11'))('api');var utils=require(_0xd3a1('0x12'));var config=require(_0xd3a1('0x13'));var licenseUtil=require(_0xd3a1('0x14'));var db=require(_0xd3a1('0x15'))['db'];function respondWithStatusCode(_0x15bcf7,_0xeecd09){_0xeecd09=_0xeecd09||0xcc;return function(_0x5c7f50){if(_0x5c7f50){return _0x15bcf7['sendStatus'](_0xeecd09);}return _0x15bcf7[_0xd3a1('0x16')](_0xeecd09)['end']();};}function respondWithResult(_0x4db497,_0x413137){_0x413137=_0x413137||0xc8;return function(_0x3da4e1){if(_0x3da4e1){return _0x4db497['status'](_0x413137)[_0xd3a1('0x17')](_0x3da4e1);}};}function respondWithFilteredResult(_0x35ac74,_0x4b12cf){return function(_0x4c11a0){if(_0x4c11a0){var _0x575f6f=typeof _0x4b12cf[_0xd3a1('0x18')]===_0xd3a1('0x19')&&typeof _0x4b12cf[_0xd3a1('0x1a')]==='undefined';var _0x40586f=_0x4c11a0['count'];var _0x1b0836=_0x575f6f?0x0:_0x4b12cf[_0xd3a1('0x18')];var _0x42fac9=_0x575f6f?_0x4c11a0['count']:_0x4b12cf[_0xd3a1('0x18')]+_0x4b12cf[_0xd3a1('0x1a')];var _0x33acf4;if(_0x42fac9>=_0x40586f){_0x42fac9=_0x40586f;_0x33acf4=0xc8;}else{_0x33acf4=0xce;}_0x35ac74['status'](_0x33acf4);return _0x35ac74['set'](_0xd3a1('0x1b'),_0x1b0836+'-'+_0x42fac9+'/'+_0x40586f)['json'](_0x4c11a0);}return null;};}function patchUpdates(_0x555ba3){return function(_0x3ac4a2){try{jsonpatch[_0xd3a1('0x1c')](_0x3ac4a2,_0x555ba3,!![]);}catch(_0x31237d){return BPromise[_0xd3a1('0x1d')](_0x31237d);}return _0x3ac4a2[_0xd3a1('0x1e')]();};}function saveUpdates(_0x288647,_0x10ab04){return function(_0x589599){if(_0x589599){return _0x589599['update'](_0x288647)['then'](function(_0x21bec8){return _0x21bec8;});}return null;};}function removeEntity(_0x19c536,_0xcf3473){return function(_0x14e6de){if(_0x14e6de){return _0x14e6de[_0xd3a1('0x1f')]()[_0xd3a1('0x20')](function(){var _0xd40266=_0x14e6de[_0xd3a1('0x21')]({'plain':!![]});var _0x516a55=_0xd3a1('0x22');return db[_0xd3a1('0x23')]['destroy']({'where':{'type':_0x516a55,'resourceId':_0xd40266['id']}})[_0xd3a1('0x20')](function(){return _0x14e6de;});})[_0xd3a1('0x20')](function(){_0x19c536[_0xd3a1('0x16')](0xcc)[_0xd3a1('0x24')]();});}};}function handleEntityNotFound(_0x20e8c9,_0x4237a4){return function(_0x51a26e){if(!_0x51a26e){_0x20e8c9[_0xd3a1('0x25')](0x194);}return _0x51a26e;};}function handleError(_0x3c598a,_0x332816){_0x332816=_0x332816||0x1f4;return function(_0x11f4fb){logger['error'](_0x11f4fb[_0xd3a1('0x26')]);if(_0x11f4fb[_0xd3a1('0x27')]){delete _0x11f4fb[_0xd3a1('0x27')];}_0x3c598a['status'](_0x332816)[_0xd3a1('0x28')](_0x11f4fb);};}exports['index']=function(_0x1e012e,_0x4c0bd1){var _0x2d1cde={},_0x4d03f5={},_0x37b8c3={'count':0x0,'rows':[]};var _0x24e2f6=_['map'](db[_0xd3a1('0x29')][_0xd3a1('0x2a')],function(_0x3a07c0){return{'name':_0x3a07c0[_0xd3a1('0x2b')],'type':_0x3a07c0['type'][_0xd3a1('0x2c')]};});_0x4d03f5[_0xd3a1('0x2d')]=_[_0xd3a1('0x2e')](_0x24e2f6,_0xd3a1('0x27'));_0x4d03f5[_0xd3a1('0x2f')]=_['keys'](_0x1e012e[_0xd3a1('0x2f')]);_0x4d03f5[_0xd3a1('0x30')]=_[_0xd3a1('0x31')](_0x4d03f5[_0xd3a1('0x2d')],_0x4d03f5[_0xd3a1('0x2f')]);_0x2d1cde[_0xd3a1('0x32')]=_[_0xd3a1('0x31')](_0x4d03f5[_0xd3a1('0x2d')],qs[_0xd3a1('0x33')](_0x1e012e['query'][_0xd3a1('0x33')]));_0x2d1cde[_0xd3a1('0x32')]=_0x2d1cde[_0xd3a1('0x32')][_0xd3a1('0x34')]?_0x2d1cde[_0xd3a1('0x32')]:_0x4d03f5['model'];if(!_0x1e012e[_0xd3a1('0x2f')][_0xd3a1('0x35')](_0xd3a1('0x36'))){_0x2d1cde[_0xd3a1('0x1a')]=qs[_0xd3a1('0x1a')](_0x1e012e[_0xd3a1('0x2f')][_0xd3a1('0x1a')]);_0x2d1cde['offset']=qs['offset'](_0x1e012e['query'][_0xd3a1('0x18')]);}_0x2d1cde[_0xd3a1('0x37')]=qs[_0xd3a1('0x38')](_0x1e012e[_0xd3a1('0x2f')][_0xd3a1('0x38')]);_0x2d1cde['where']=qs[_0xd3a1('0x30')](_[_0xd3a1('0x39')](_0x1e012e['query'],_0x4d03f5[_0xd3a1('0x30')]),_0x24e2f6);if(_0x1e012e[_0xd3a1('0x2f')]['filter']){_0x2d1cde[_0xd3a1('0x3a')]=_[_0xd3a1('0x3b')](_0x2d1cde['where'],{'$or':_['map'](_0x24e2f6,function(_0x494982){if(_0x494982[_0xd3a1('0x3c')]!==_0xd3a1('0x3d')){var _0x56b940={};_0x56b940[_0x494982[_0xd3a1('0x27')]]={'$like':'%'+_0x1e012e[_0xd3a1('0x2f')]['filter']+'%'};return _0x56b940;}})});}_0x2d1cde=_[_0xd3a1('0x3b')]({},_0x2d1cde,_0x1e012e[_0xd3a1('0x3e')]);var _0x4dadd6={'where':_0x2d1cde[_0xd3a1('0x3a')]};return db[_0xd3a1('0x29')][_0xd3a1('0x3f')](_0x4dadd6)[_0xd3a1('0x20')](function(_0x18c883){_0x37b8c3['count']=_0x18c883;if(_0x1e012e[_0xd3a1('0x2f')][_0xd3a1('0x40')]){_0x2d1cde[_0xd3a1('0x41')]=[{'all':!![]}];}return db[_0xd3a1('0x29')][_0xd3a1('0x42')](_0x2d1cde);})['then'](function(_0x516cb6){_0x37b8c3[_0xd3a1('0x43')]=_0x516cb6;return _0x37b8c3;})[_0xd3a1('0x20')](respondWithFilteredResult(_0x4c0bd1,_0x2d1cde))[_0xd3a1('0x44')](handleError(_0x4c0bd1,null));};exports[_0xd3a1('0x45')]=function(_0x433664,_0x10d13a){var _0x4c5c6c={'raw':![],'where':{'id':_0x433664[_0xd3a1('0x46')]['id']}},_0x587fae={};_0x587fae[_0xd3a1('0x2d')]=_[_0xd3a1('0x47')](db['Schedule']['rawAttributes']);_0x587fae['query']=_[_0xd3a1('0x47')](_0x433664[_0xd3a1('0x2f')]);_0x587fae[_0xd3a1('0x30')]=_['intersection'](_0x587fae[_0xd3a1('0x2d')],_0x587fae[_0xd3a1('0x2f')]);_0x4c5c6c[_0xd3a1('0x32')]=_['intersection'](_0x587fae[_0xd3a1('0x2d')],qs[_0xd3a1('0x33')](_0x433664[_0xd3a1('0x2f')][_0xd3a1('0x33')]));_0x4c5c6c['attributes']=_0x4c5c6c['attributes']['length']?_0x4c5c6c[_0xd3a1('0x32')]:_0x587fae['model'];if(_0x433664[_0xd3a1('0x2f')][_0xd3a1('0x40')]){_0x4c5c6c[_0xd3a1('0x41')]=[{'all':!![]}];}_0x4c5c6c=_[_0xd3a1('0x3b')]({},_0x4c5c6c,_0x433664[_0xd3a1('0x3e')]);return db[_0xd3a1('0x29')]['find'](_0x4c5c6c)['then'](handleEntityNotFound(_0x10d13a,null))['then'](respondWithResult(_0x10d13a,null))[_0xd3a1('0x44')](handleError(_0x10d13a,null));};exports[_0xd3a1('0x48')]=function(_0x47c877,_0x1b4490){return db[_0xd3a1('0x29')][_0xd3a1('0x48')](_0x47c877[_0xd3a1('0x49')],{})['then'](function(_0x2e35d6){var _0x4c4456=_0x47c877[_0xd3a1('0x4a')][_0xd3a1('0x21')]({'plain':!![]});if(!_0x4c4456)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c4456[_0xd3a1('0x4b')]==='user'){var _0x111d3a=_0x2e35d6[_0xd3a1('0x21')]({'plain':!![]});var _0x1b6c84=_0xd3a1('0x22');return db[_0xd3a1('0x4c')][_0xd3a1('0x4d')]({'where':{'name':_0x1b6c84,'userProfileId':_0x4c4456[_0xd3a1('0x4e')]},'raw':!![]})[_0xd3a1('0x20')](function(_0x3692f1){if(_0x3692f1&&_0x3692f1[_0xd3a1('0x4f')]===0x0){return db[_0xd3a1('0x23')][_0xd3a1('0x48')]({'name':_0x111d3a[_0xd3a1('0x27')],'resourceId':_0x111d3a['id'],'type':_0x3692f1[_0xd3a1('0x27')],'sectionId':_0x3692f1['id']},{})[_0xd3a1('0x20')](function(){return _0x2e35d6;});}else{return _0x2e35d6;}})[_0xd3a1('0x44')](function(_0x1ce324){logger[_0xd3a1('0x50')](_0xd3a1('0x51'),_0x1ce324);throw _0x1ce324;});}return _0x2e35d6;})[_0xd3a1('0x20')](respondWithResult(_0x1b4490,0xc9))[_0xd3a1('0x44')](handleError(_0x1b4490,null));};exports['update']=function(_0x5d055f,_0x176295){if(_0x5d055f['body']['id']){delete _0x5d055f[_0xd3a1('0x49')]['id'];}return db[_0xd3a1('0x29')]['find']({'where':{'id':_0x5d055f[_0xd3a1('0x46')]['id']}})[_0xd3a1('0x20')](handleEntityNotFound(_0x176295,null))[_0xd3a1('0x20')](saveUpdates(_0x5d055f['body'],null))['then'](respondWithResult(_0x176295,null))[_0xd3a1('0x44')](handleError(_0x176295,null));};exports[_0xd3a1('0x1f')]=function(_0x18f178,_0x3e631f){return db[_0xd3a1('0x29')][_0xd3a1('0x4d')]({'where':{'id':_0x18f178['params']['id']}})[_0xd3a1('0x20')](handleEntityNotFound(_0x3e631f,null))[_0xd3a1('0x20')](removeEntity(_0x3e631f,null))[_0xd3a1('0x44')](handleError(_0x3e631f,null));};exports['run']=function(_0x24a9f0,_0xc4f06a,_0x48f1c1){var _0x4ffb55=require(_0xd3a1('0x52'));return db['Schedule'][_0xd3a1('0x4d')]({'where':{'id':_0x24a9f0[_0xd3a1('0x46')]['id']},'raw':!![]})[_0xd3a1('0x20')](handleEntityNotFound(_0xc4f06a,null))[_0xd3a1('0x20')](function(){_0x4ffb55['run'](_0x24a9f0['params']['id']);})[_0xd3a1('0x20')](respondWithStatusCode(_0xc4f06a,null))[_0xd3a1('0x44')](handleError(_0xc4f06a,null));}; \ No newline at end of file +var _0x1dbb=['index','map','Schedule','rawAttributes','fieldName','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','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','sendStatus','status','end','offset','undefined','limit','count','json','update','then','destroy','get','Scheduler','UserProfileResource','error','stack'];(function(_0x3971f5,_0x29a961){var _0x5ebf82=function(_0x2b110e){while(--_0x2b110e){_0x3971f5['push'](_0x3971f5['shift']());}};_0x5ebf82(++_0x29a961);}(_0x1dbb,0xd3));var _0xb1db=function(_0x5a9e62,_0x1d8abb){_0x5a9e62=_0x5a9e62-0x0;var _0x2964bf=_0x1dbb[_0x5a9e62];return _0x2964bf;};'use strict';var emlformat=require(_0xb1db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1db('0x1'));var rp=require('request-promise');var moment=require(_0xb1db('0x2'));var BPromise=require(_0xb1db('0x3'));var Mustache=require(_0xb1db('0x4'));var util=require(_0xb1db('0x5'));var path=require(_0xb1db('0x6'));var sox=require('sox');var csv=require(_0xb1db('0x7'));var ejs=require(_0xb1db('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1db('0x9'));var squel=require(_0xb1db('0xa'));var crypto=require(_0xb1db('0xb'));var jsforce=require(_0xb1db('0xc'));var deskjs=require(_0xb1db('0xd'));var toCsv=require(_0xb1db('0x7'));var querystring=require('querystring');var Papa=require(_0xb1db('0xe'));var Redis=require(_0xb1db('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb1db('0x10'));var as=require(_0xb1db('0x11'));var hardwareService=require(_0xb1db('0x12'));var logger=require(_0xb1db('0x13'))(_0xb1db('0x14'));var utils=require(_0xb1db('0x15'));var config=require(_0xb1db('0x16'));var licenseUtil=require(_0xb1db('0x17'));var db=require(_0xb1db('0x18'))['db'];function respondWithStatusCode(_0x28d40b,_0x7180bc){_0x7180bc=_0x7180bc||0xcc;return function(_0x1b48b0){if(_0x1b48b0){return _0x28d40b[_0xb1db('0x19')](_0x7180bc);}return _0x28d40b[_0xb1db('0x1a')](_0x7180bc)[_0xb1db('0x1b')]();};}function respondWithResult(_0x344692,_0x10e41d){_0x10e41d=_0x10e41d||0xc8;return function(_0x4d6396){if(_0x4d6396){return _0x344692[_0xb1db('0x1a')](_0x10e41d)['json'](_0x4d6396);}};}function respondWithFilteredResult(_0x514acb,_0x320be3){return function(_0x4ada86){if(_0x4ada86){var _0x1762c1=typeof _0x320be3[_0xb1db('0x1c')]===_0xb1db('0x1d')&&typeof _0x320be3[_0xb1db('0x1e')]===_0xb1db('0x1d');var _0x4b080d=_0x4ada86[_0xb1db('0x1f')];var _0x401594=_0x1762c1?0x0:_0x320be3[_0xb1db('0x1c')];var _0x562af6=_0x1762c1?_0x4ada86[_0xb1db('0x1f')]:_0x320be3[_0xb1db('0x1c')]+_0x320be3[_0xb1db('0x1e')];var _0x3cf92f;if(_0x562af6>=_0x4b080d){_0x562af6=_0x4b080d;_0x3cf92f=0xc8;}else{_0x3cf92f=0xce;}_0x514acb[_0xb1db('0x1a')](_0x3cf92f);return _0x514acb['set']('Content-Range',_0x401594+'-'+_0x562af6+'/'+_0x4b080d)[_0xb1db('0x20')](_0x4ada86);}return null;};}function patchUpdates(_0x418cce){return function(_0x5681f6){try{jsonpatch['apply'](_0x5681f6,_0x418cce,!![]);}catch(_0x35c5b4){return BPromise['reject'](_0x35c5b4);}return _0x5681f6['save']();};}function saveUpdates(_0x39f58d,_0x11d0a8){return function(_0x228b74){if(_0x228b74){return _0x228b74[_0xb1db('0x21')](_0x39f58d)[_0xb1db('0x22')](function(_0x3fcb03){return _0x3fcb03;});}return null;};}function removeEntity(_0x237c65,_0x2e15bc){return function(_0x16b730){if(_0x16b730){return _0x16b730[_0xb1db('0x23')]()[_0xb1db('0x22')](function(){var _0x87430c=_0x16b730[_0xb1db('0x24')]({'plain':!![]});var _0x1813e4=_0xb1db('0x25');return db[_0xb1db('0x26')][_0xb1db('0x23')]({'where':{'type':_0x1813e4,'resourceId':_0x87430c['id']}})[_0xb1db('0x22')](function(){return _0x16b730;});})['then'](function(){_0x237c65[_0xb1db('0x1a')](0xcc)[_0xb1db('0x1b')]();});}};}function handleEntityNotFound(_0x56c507,_0x526c70){return function(_0x2f30bf){if(!_0x2f30bf){_0x56c507[_0xb1db('0x19')](0x194);}return _0x2f30bf;};}function handleError(_0x3cb0ea,_0x5bf957){_0x5bf957=_0x5bf957||0x1f4;return function(_0x3582d7){logger[_0xb1db('0x27')](_0x3582d7[_0xb1db('0x28')]);if(_0x3582d7['name']){delete _0x3582d7['name'];}_0x3cb0ea[_0xb1db('0x1a')](_0x5bf957)['send'](_0x3582d7);};}exports[_0xb1db('0x29')]=function(_0x564833,_0x44e772){var _0x1ce4ac={},_0x2b6216={},_0x40198c={'count':0x0,'rows':[]};var _0x2c4c95=_[_0xb1db('0x2a')](db[_0xb1db('0x2b')][_0xb1db('0x2c')],function(_0xcf1656){return{'name':_0xcf1656[_0xb1db('0x2d')],'type':_0xcf1656['type'][_0xb1db('0x2e')]};});_0x2b6216['model']=_[_0xb1db('0x2a')](_0x2c4c95,_0xb1db('0x2f'));_0x2b6216[_0xb1db('0x30')]=_[_0xb1db('0x31')](_0x564833[_0xb1db('0x30')]);_0x2b6216[_0xb1db('0x32')]=_[_0xb1db('0x33')](_0x2b6216[_0xb1db('0x34')],_0x2b6216[_0xb1db('0x30')]);_0x1ce4ac[_0xb1db('0x35')]=_[_0xb1db('0x33')](_0x2b6216[_0xb1db('0x34')],qs[_0xb1db('0x36')](_0x564833[_0xb1db('0x30')][_0xb1db('0x36')]));_0x1ce4ac['attributes']=_0x1ce4ac[_0xb1db('0x35')][_0xb1db('0x37')]?_0x1ce4ac[_0xb1db('0x35')]:_0x2b6216[_0xb1db('0x34')];if(!_0x564833[_0xb1db('0x30')][_0xb1db('0x38')](_0xb1db('0x39'))){_0x1ce4ac['limit']=qs['limit'](_0x564833[_0xb1db('0x30')][_0xb1db('0x1e')]);_0x1ce4ac[_0xb1db('0x1c')]=qs[_0xb1db('0x1c')](_0x564833['query']['offset']);}_0x1ce4ac[_0xb1db('0x3a')]=qs[_0xb1db('0x3b')](_0x564833[_0xb1db('0x30')]['sort']);_0x1ce4ac['where']=qs[_0xb1db('0x32')](_[_0xb1db('0x3c')](_0x564833[_0xb1db('0x30')],_0x2b6216[_0xb1db('0x32')]),_0x2c4c95);if(_0x564833[_0xb1db('0x30')][_0xb1db('0x3d')]){_0x1ce4ac[_0xb1db('0x3e')]=_['merge'](_0x1ce4ac[_0xb1db('0x3e')],{'$or':_['map'](_0x2c4c95,function(_0x507f44){if(_0x507f44[_0xb1db('0x3f')]!==_0xb1db('0x40')){var _0xda9c92={};_0xda9c92[_0x507f44[_0xb1db('0x2f')]]={'$like':'%'+_0x564833['query'][_0xb1db('0x3d')]+'%'};return _0xda9c92;}})});}_0x1ce4ac=_[_0xb1db('0x41')]({},_0x1ce4ac,_0x564833[_0xb1db('0x42')]);var _0x38da77={'where':_0x1ce4ac['where']};return db[_0xb1db('0x2b')][_0xb1db('0x1f')](_0x38da77)['then'](function(_0x203340){_0x40198c['count']=_0x203340;if(_0x564833['query']['includeAll']){_0x1ce4ac[_0xb1db('0x43')]=[{'all':!![]}];}return db[_0xb1db('0x2b')][_0xb1db('0x44')](_0x1ce4ac);})[_0xb1db('0x22')](function(_0xd8232f){_0x40198c[_0xb1db('0x45')]=_0xd8232f;return _0x40198c;})[_0xb1db('0x22')](respondWithFilteredResult(_0x44e772,_0x1ce4ac))[_0xb1db('0x46')](handleError(_0x44e772,null));};exports[_0xb1db('0x47')]=function(_0xb0a22d,_0x10a85c){var _0x58ddd8={'raw':![],'where':{'id':_0xb0a22d[_0xb1db('0x48')]['id']}},_0x4cd361={};_0x4cd361[_0xb1db('0x34')]=_[_0xb1db('0x31')](db[_0xb1db('0x2b')][_0xb1db('0x2c')]);_0x4cd361[_0xb1db('0x30')]=_['keys'](_0xb0a22d[_0xb1db('0x30')]);_0x4cd361[_0xb1db('0x32')]=_[_0xb1db('0x33')](_0x4cd361[_0xb1db('0x34')],_0x4cd361[_0xb1db('0x30')]);_0x58ddd8[_0xb1db('0x35')]=_['intersection'](_0x4cd361[_0xb1db('0x34')],qs['fields'](_0xb0a22d[_0xb1db('0x30')]['fields']));_0x58ddd8[_0xb1db('0x35')]=_0x58ddd8['attributes']['length']?_0x58ddd8['attributes']:_0x4cd361[_0xb1db('0x34')];if(_0xb0a22d[_0xb1db('0x30')][_0xb1db('0x49')]){_0x58ddd8[_0xb1db('0x43')]=[{'all':!![]}];}_0x58ddd8=_[_0xb1db('0x41')]({},_0x58ddd8,_0xb0a22d['options']);return db['Schedule']['find'](_0x58ddd8)[_0xb1db('0x22')](handleEntityNotFound(_0x10a85c,null))['then'](respondWithResult(_0x10a85c,null))[_0xb1db('0x46')](handleError(_0x10a85c,null));};exports[_0xb1db('0x4a')]=function(_0x4c3f16,_0x30b4db){return db['Schedule'][_0xb1db('0x4a')](_0x4c3f16[_0xb1db('0x4b')],{})[_0xb1db('0x22')](function(_0x4a0efc){var _0x355ab2=_0x4c3f16[_0xb1db('0x4c')]['get']({'plain':!![]});if(!_0x355ab2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x355ab2[_0xb1db('0x4d')]===_0xb1db('0x4c')){var _0x543442=_0x4a0efc['get']({'plain':!![]});var _0x194ec4=_0xb1db('0x25');return db[_0xb1db('0x4e')][_0xb1db('0x4f')]({'where':{'name':_0x194ec4,'userProfileId':_0x355ab2[_0xb1db('0x50')]},'raw':!![]})['then'](function(_0x39a414){if(_0x39a414&&_0x39a414[_0xb1db('0x51')]===0x0){return db[_0xb1db('0x26')]['create']({'name':_0x543442[_0xb1db('0x2f')],'resourceId':_0x543442['id'],'type':_0x39a414[_0xb1db('0x2f')],'sectionId':_0x39a414['id']},{})['then'](function(){return _0x4a0efc;});}else{return _0x4a0efc;}})[_0xb1db('0x46')](function(_0x17093e){logger[_0xb1db('0x27')](_0xb1db('0x52'),_0x17093e);throw _0x17093e;});}return _0x4a0efc;})['then'](respondWithResult(_0x30b4db,0xc9))[_0xb1db('0x46')](handleError(_0x30b4db,null));};exports[_0xb1db('0x21')]=function(_0x4f2d0c,_0x1a0f67){if(_0x4f2d0c[_0xb1db('0x4b')]['id']){delete _0x4f2d0c[_0xb1db('0x4b')]['id'];}return db[_0xb1db('0x2b')]['find']({'where':{'id':_0x4f2d0c[_0xb1db('0x48')]['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x1a0f67,null))['then'](saveUpdates(_0x4f2d0c[_0xb1db('0x4b')],null))['then'](respondWithResult(_0x1a0f67,null))[_0xb1db('0x46')](handleError(_0x1a0f67,null));};exports['destroy']=function(_0x12fd95,_0xfebe6d){return db['Schedule'][_0xb1db('0x4f')]({'where':{'id':_0x12fd95['params']['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0xfebe6d,null))[_0xb1db('0x22')](removeEntity(_0xfebe6d,null))['catch'](handleError(_0xfebe6d,null));};exports[_0xb1db('0x53')]=function(_0x2d1af8,_0xc62a82,_0x2cb815){var _0x1924a8=require('../../config/schedule');return db[_0xb1db('0x2b')][_0xb1db('0x4f')]({'where':{'id':_0x2d1af8[_0xb1db('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc62a82,null))['then'](function(){_0x1924a8[_0xb1db('0x53')](_0x2d1af8[_0xb1db('0x48')]['id']);})[_0xb1db('0x22')](respondWithStatusCode(_0xc62a82,null))['catch'](handleError(_0xc62a82,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f856446..2f486a3 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 _0xc4ba=['../../config/logger','api','moment','bluebird','path','../../config/environment','./schedule.attributes','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ba,0xfb));var _0xac4b=function(_0x132a9a,_0x4da489){_0x132a9a=_0x132a9a-0x0;var _0x9dd201=_0xc4ba[_0x132a9a];return _0x9dd201;};'use strict';var _=require(_0xac4b('0x0'));var util=require('util');var logger=require(_0xac4b('0x1'))(_0xac4b('0x2'));var moment=require(_0xac4b('0x3'));var BPromise=require(_0xac4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac4b('0x5'));var rimraf=require('rimraf');var config=require(_0xac4b('0x6'));var attributes=require(_0xac4b('0x7'));module[_0xac4b('0x8')]=function(_0x2104a7,_0x4ff2e7){return _0x2104a7['define']('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c8c=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4bf8ca,_0x1f6333){var _0x181a12=function(_0x1da78b){while(--_0x1da78b){_0x4bf8ca['push'](_0x4bf8ca['shift']());}};_0x181a12(++_0x1f6333);}(_0x1c8c,0xaf));var _0xc1c8=function(_0x287f4c,_0x56f996){_0x287f4c=_0x287f4c-0x0;var _0x5e5db0=_0x1c8c[_0x287f4c];return _0x5e5db0;};'use strict';var _=require(_0xc1c8('0x0'));var util=require('util');var logger=require(_0xc1c8('0x1'))(_0xc1c8('0x2'));var moment=require(_0xc1c8('0x3'));var BPromise=require(_0xc1c8('0x4'));var rp=require(_0xc1c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1c8('0x6'));var config=require(_0xc1c8('0x7'));var attributes=require(_0xc1c8('0x8'));module[_0xc1c8('0x9')]=function(_0x5209af,_0x3e46c9){return _0x5209af[_0xc1c8('0xa')](_0xc1c8('0xb'),attributes,{'tableName':_0xc1c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index c11baec..432753c 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 _0x5206=['jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x291b24,_0x1c27e6){var _0x26bb43=function(_0x1cfe0f){while(--_0x1cfe0f){_0x291b24['push'](_0x291b24['shift']());}};_0x26bb43(++_0x1c27e6);}(_0x5206,0xc7));var _0x6520=function(_0x4017a3,_0x4cf6da){_0x4017a3=_0x4017a3-0x0;var _0x3c603a=_0x5206[_0x4017a3];return _0x3c603a;};'use strict';var _=require(_0x6520('0x0'));var util=require(_0x6520('0x1'));var moment=require('moment');var BPromise=require(_0x6520('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6520('0x3'));var db=require(_0x6520('0x4'))['db'];var utils=require(_0x6520('0x5'));var logger=require('../../config/logger')(_0x6520('0x6'));var config=require(_0x6520('0x7'));var jayson=require(_0x6520('0x8'));var client=jayson[_0x6520('0x9')][_0x6520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4825ca,_0x667abd,_0x455295){return new BPromise(function(_0x11f1f6,_0x252beb){return client[_0x6520('0xb')](_0x4825ca,_0x455295)[_0x6520('0xc')](function(_0x1c4f5e){logger[_0x6520('0xd')](_0x6520('0xe'),_0x667abd,'request\x20sent');logger[_0x6520('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x667abd,_0x6520('0x10'),JSON[_0x6520('0x11')](_0x1c4f5e));if(_0x1c4f5e[_0x6520('0x12')]){if(_0x1c4f5e[_0x6520('0x12')][_0x6520('0x13')]===0x1f4){logger[_0x6520('0x12')](_0x6520('0xe'),_0x667abd,_0x1c4f5e[_0x6520('0x12')][_0x6520('0x14')]);return _0x252beb(_0x1c4f5e[_0x6520('0x12')][_0x6520('0x14')]);}logger['error'](_0x6520('0xe'),_0x667abd,_0x1c4f5e[_0x6520('0x12')][_0x6520('0x14')]);return _0x11f1f6(_0x1c4f5e[_0x6520('0x12')]['message']);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x667abd,'request\x20sent');_0x11f1f6(_0x1c4f5e[_0x6520('0x15')][_0x6520('0x14')]);}})[_0x6520('0x16')](function(_0x1fa03c){logger[_0x6520('0x12')](_0x6520('0xe'),_0x667abd,_0x1fa03c);_0x252beb(_0x1fa03c);});});} \ No newline at end of file +var _0x820e=['message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x820e,0x17e));var _0xe820=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x820e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe820('0x0'));var util=require(_0xe820('0x1'));var moment=require('moment');var BPromise=require(_0xe820('0x2'));var rs=require(_0xe820('0x3'));var fs=require('fs');var Redis=require(_0xe820('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe820('0x5'))('rpc');var config=require(_0xe820('0x6'));var jayson=require(_0xe820('0x7'));var client=jayson[_0xe820('0x8')][_0xe820('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e23b7,_0x5b847b,_0x1b16b9){return new BPromise(function(_0x5b7c80,_0x30abda){return client[_0xe820('0xa')](_0x4e23b7,_0x1b16b9)[_0xe820('0xb')](function(_0x2731f1){logger[_0xe820('0xc')](_0xe820('0xd'),_0x5b847b,_0xe820('0xe'));logger[_0xe820('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5b847b,_0xe820('0xe'),JSON[_0xe820('0x10')](_0x2731f1));if(_0x2731f1[_0xe820('0x11')]){if(_0x2731f1[_0xe820('0x11')]['code']===0x1f4){logger[_0xe820('0x11')](_0xe820('0xd'),_0x5b847b,_0x2731f1[_0xe820('0x11')]['message']);return _0x30abda(_0x2731f1[_0xe820('0x11')][_0xe820('0x12')]);}logger['error'](_0xe820('0xd'),_0x5b847b,_0x2731f1['error']['message']);return _0x5b7c80(_0x2731f1[_0xe820('0x11')]['message']);}else{logger[_0xe820('0xc')](_0xe820('0xd'),_0x5b847b,_0xe820('0xe'));_0x5b7c80(_0x2731f1[_0xe820('0x13')][_0xe820('0x12')]);}})['catch'](function(_0x12d340){logger[_0xe820('0x11')](_0xe820('0xd'),_0x5b847b,_0x12d340);_0x30abda(_0x12d340);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ac49812..946d674 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 _0x613c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x2ca99d,_0xb8fb38){var _0x3f9ced=function(_0x3202b9){while(--_0x3202b9){_0x2ca99d['push'](_0x2ca99d['shift']());}};_0x3f9ced(++_0xb8fb38);}(_0x613c,0xd9));var _0xc613=function(_0x3bb8dc,_0x35b8e7){_0x3bb8dc=_0x3bb8dc-0x0;var _0xef7793=_0x613c[_0x3bb8dc];return _0xef7793;};'use strict';var multer=require(_0xc613('0x0'));var util=require(_0xc613('0x1'));var path=require('path');var timeout=require(_0xc613('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc613('0x3'));var auth=require(_0xc613('0x4'));var interaction=require(_0xc613('0x5'));var config=require(_0xc613('0x6'));var controller=require('./screenRecording.controller');router[_0xc613('0x7')]('/',auth[_0xc613('0x8')](),controller[_0xc613('0x9')]);router[_0xc613('0x7')]('/describe',auth[_0xc613('0x8')](),controller[_0xc613('0xa')]);router[_0xc613('0x7')](_0xc613('0xb'),auth[_0xc613('0x8')](),controller[_0xc613('0xc')]);router['get'](_0xc613('0xd'),auth[_0xc613('0x8')](),controller['download']);router[_0xc613('0xe')]('/',auth['isAuthenticated'](),controller[_0xc613('0xf')]);router[_0xc613('0x10')](_0xc613('0xb'),auth[_0xc613('0x8')](),controller[_0xc613('0x11')]);router['delete'](_0xc613('0xb'),auth[_0xc613('0x8')](),controller[_0xc613('0x12')]);module[_0xc613('0x13')]=router; \ No newline at end of file +var _0xce72=['post','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','/describe','describe','/:id','show','download'];(function(_0x17f065,_0xce5deb){var _0x1e6acb=function(_0x361052){while(--_0x361052){_0x17f065['push'](_0x17f065['shift']());}};_0x1e6acb(++_0xce5deb);}(_0xce72,0x112));var _0x2ce7=function(_0x29a0b8,_0x238391){_0x29a0b8=_0x29a0b8-0x0;var _0x3451dd=_0xce72[_0x29a0b8];return _0x3451dd;};'use strict';var multer=require('multer');var util=require(_0x2ce7('0x0'));var path=require(_0x2ce7('0x1'));var timeout=require(_0x2ce7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ce7('0x3'));var auth=require(_0x2ce7('0x4'));var interaction=require(_0x2ce7('0x5'));var config=require('../../config/environment');var controller=require(_0x2ce7('0x6'));router['get']('/',auth[_0x2ce7('0x7')](),controller[_0x2ce7('0x8')]);router['get'](_0x2ce7('0x9'),auth[_0x2ce7('0x7')](),controller[_0x2ce7('0xa')]);router['get'](_0x2ce7('0xb'),auth[_0x2ce7('0x7')](),controller[_0x2ce7('0xc')]);router['get']('/:id/download',auth[_0x2ce7('0x7')](),controller[_0x2ce7('0xd')]);router[_0x2ce7('0xe')]('/',auth[_0x2ce7('0x7')](),controller['create']);router['put'](_0x2ce7('0xb'),auth[_0x2ce7('0x7')](),controller[_0x2ce7('0xf')]);router[_0x2ce7('0x10')]('/:id',auth[_0x2ce7('0x7')](),controller[_0x2ce7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 7c8c902..8ea57d5 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 _0xa7b5=['DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration'];(function(_0x424896,_0x174978){var _0x62ace2=function(_0x57d5d){while(--_0x57d5d){_0x424896['push'](_0x424896['shift']());}};_0x62ace2(++_0x174978);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x4c6320,_0x3f623b){_0x4c6320=_0x4c6320-0x0;var _0x16e49e=_0xa7b5[_0x4c6320];return _0x16e49e;};'use strict';var Sequelize=require(_0x5a7b('0x0'));var moment=require('moment');var path=require(_0x5a7b('0x1'));var config=require('../../config/environment');module[_0x5a7b('0x2')]={'format':{'type':Sequelize[_0x5a7b('0x3')],'get':function(){return this[_0x5a7b('0x4')](_0x5a7b('0x5'))?path[_0x5a7b('0x6')](this[_0x5a7b('0x4')](_0x5a7b('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x5a7b('0x7')]},'channel':{'type':Sequelize[_0x5a7b('0x7')]},'value':{'type':Sequelize[_0x5a7b('0x7')],'set':function(_0x1f8f95){var _0x493ae6=_0x1f8f95[_0x5a7b('0x8')](/\\/g,'/');this[_0x5a7b('0x9')](_0x5a7b('0x5'),_0x493ae6);}},'rating':{'type':Sequelize[_0x5a7b('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5a7b('0xa')],'set':function(_0x4070ee){this['setDataValue']('startedAt',moment()[_0x5a7b('0xb')](_0x4070ee,'ms'));this['setDataValue'](_0x5a7b('0xc'),moment());this[_0x5a7b('0x9')](_0x5a7b('0xd'),_0x4070ee);}},'startedAt':{'type':Sequelize[_0x5a7b('0xe')],'get':function(){return moment(this[_0x5a7b('0x4')](_0x5a7b('0xf')))[_0x5a7b('0x10')](_0x5a7b('0x11'))[_0x5a7b('0x12')]();}},'closedAt':{'type':Sequelize[_0x5a7b('0xe')],'get':function(){return moment(this[_0x5a7b('0x4')]('closedAt'))[_0x5a7b('0x10')](_0x5a7b('0x11'))[_0x5a7b('0x12')]();}},'createdAt':{'type':Sequelize[_0x5a7b('0xe')],'get':function(){return moment(this['getDataValue'](_0x5a7b('0x13')))[_0x5a7b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x5a7b('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x5a7b('0x4')]('updatedAt'))[_0x5a7b('0x10')](_0x5a7b('0x11'))[_0x5a7b('0x12')]();}}}; \ No newline at end of file +var _0x6efe=['closedAt','duration','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','INTEGER','setDataValue','subtract'];(function(_0x3fc75a,_0x1a125c){var _0x1d3083=function(_0x27ee51){while(--_0x27ee51){_0x3fc75a['push'](_0x3fc75a['shift']());}};_0x1d3083(++_0x1a125c);}(_0x6efe,0xc6));var _0xe6ef=function(_0x30fa75,_0x4e78df){_0x30fa75=_0x30fa75-0x0;var _0x5d6401=_0x6efe[_0x30fa75];return _0x5d6401;};'use strict';var Sequelize=require(_0xe6ef('0x0'));var moment=require(_0xe6ef('0x1'));var path=require(_0xe6ef('0x2'));var config=require(_0xe6ef('0x3'));module[_0xe6ef('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xe6ef('0x5'))?path[_0xe6ef('0x6')](this[_0xe6ef('0x7')](_0xe6ef('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xe6ef('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe6ef('0x8')],'set':function(_0x422e13){var _0x599b6c=_0x422e13['replace'](/\\/g,'/');this['setDataValue'](_0xe6ef('0x5'),_0x599b6c);}},'rating':{'type':Sequelize[_0xe6ef('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe6ef('0x9')],'set':function(_0x4fca2f){this[_0xe6ef('0xa')]('startedAt',moment()[_0xe6ef('0xb')](_0x4fca2f,'ms'));this[_0xe6ef('0xa')](_0xe6ef('0xc'),moment());this[_0xe6ef('0xa')](_0xe6ef('0xd'),_0x4fca2f);}},'startedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0xf')))['format'](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}},'closedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')]('closedAt'))[_0xe6ef('0x12')]('MM-DD-YYYY\x20HH:mm')[_0xe6ef('0x11')]();}},'createdAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0x13')))[_0xe6ef('0x12')](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}},'updatedAt':{'type':Sequelize[_0xe6ef('0xe')],'get':function(){return moment(this[_0xe6ef('0x7')](_0xe6ef('0x14')))[_0xe6ef('0x12')](_0xe6ef('0x10'))[_0xe6ef('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 137dabb..52f26bb 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 _0xe5b3=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','order','where','filters','filter','merge','options','include','findAll','rows','catch','show','create','body','duration','createdAt','closedAt','value','find','params','describe','download','uniqueid','join','%s.cypher','existsSync','root','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','send','Not\x20found','destroy','Entity\x20not\x20found'];(function(_0x57e892,_0x250c61){var _0xcdbd4f=function(_0x4102d8){while(--_0x4102d8){_0x57e892['push'](_0x57e892['shift']());}};_0xcdbd4f(++_0x250c61);}(_0xe5b3,0x133));var _0x3e5b=function(_0x389388,_0x2f7044){_0x389388=_0x389388-0x0;var _0x42fe24=_0xe5b3[_0x389388];return _0x42fe24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x31')](_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29')),[_0x3e5b('0x32')]);_0x10d2ed['query']=_[_0x3e5b('0x33')](_0x1f6473['query']);_0x10d2ed['filters']=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],_0x10d2ed['query']);_0x475b39[_0x3e5b('0x35')]=_[_0x3e5b('0x34')](_0x10d2ed[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x475b39[_0x3e5b('0x35')]=_0x475b39[_0x3e5b('0x35')][_0x3e5b('0x38')]?_0x475b39[_0x3e5b('0x35')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x37')]['hasOwnProperty'](_0x3e5b('0x39'))){_0x475b39[_0x3e5b('0x1e')]=qs['limit'](_0x1f6473['query'][_0x3e5b('0x1e')]);_0x475b39['offset']=qs[_0x3e5b('0x20')](_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x3a')]=qs['sort'](_0x1f6473[_0x3e5b('0x37')]['sort']);_0x475b39[_0x3e5b('0x3b')]=qs['filters'](_['pick'](_0x1f6473['query'],_0x10d2ed[_0x3e5b('0x3c')]),_0x307091);if(_0x1f6473[_0x3e5b('0x37')][_0x3e5b('0x3d')]){_0x475b39[_0x3e5b('0x3b')]=_[_0x3e5b('0x3e')](_0x475b39[_0x3e5b('0x3b')],{'$or':_['map'](_0x307091,function(_0x5d0c59){if(_0x5d0c59['type']!=='VIRTUAL'){var _0x5f0271={};_0x5f0271[_0x5d0c59['name']]={'$like':'%'+_0x1f6473['query'][_0x3e5b('0x3d')]+'%'};return _0x5f0271;}})});}_0x475b39=_[_0x3e5b('0x3e')]({},_0x475b39,_0x1f6473[_0x3e5b('0x3f')]);var _0x1aafd5={'where':_0x475b39[_0x3e5b('0x3b')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x1aafd5)[_0x3e5b('0x27')](function(_0x222d0f){_0x3cfaf6[_0x3e5b('0x1f')]=_0x222d0f;if(_0x1f6473[_0x3e5b('0x37')]['includeAll']){_0x475b39[_0x3e5b('0x40')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')][_0x3e5b('0x41')](_0x475b39);})[_0x3e5b('0x27')](function(_0xa262e0){_0x3cfaf6[_0x3e5b('0x42')]=_0xa262e0;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x43')](handleError(_0x1296ec,null));};exports[_0x3e5b('0x44')]=function(_0x39da3f,_0x13c8d5){var _0x559056={'raw':![],'where':{'id':_0x39da3f['params']['id']}},_0x598ab4={};_0x598ab4['model']=_[_0x3e5b('0x33')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x598ab4[_0x3e5b('0x37')]=_[_0x3e5b('0x33')](_0x39da3f[_0x3e5b('0x37')]);_0x598ab4[_0x3e5b('0x3c')]=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],_0x598ab4[_0x3e5b('0x37')]);_0x559056['attributes']=_[_0x3e5b('0x34')](_0x598ab4[_0x3e5b('0x30')],qs[_0x3e5b('0x36')](_0x39da3f[_0x3e5b('0x37')][_0x3e5b('0x36')]));_0x559056['attributes']=_0x559056['attributes']['length']?_0x559056[_0x3e5b('0x35')]:_0x598ab4[_0x3e5b('0x30')];if(_0x39da3f[_0x3e5b('0x37')]['includeAll']){_0x559056['include']=[{'all':!![]}];}_0x559056=_[_0x3e5b('0x3e')]({},_0x559056,_0x39da3f[_0x3e5b('0x3f')]);return db[_0x3e5b('0x2c')]['find'](_0x559056)['then'](handleEntityNotFound(_0x13c8d5,null))[_0x3e5b('0x27')](respondWithResult(_0x13c8d5,null))['catch'](handleError(_0x13c8d5,null));};exports[_0x3e5b('0x45')]=function(_0x3379a1,_0x3f5835){return db[_0x3e5b('0x2c')][_0x3e5b('0x45')](_0x3379a1[_0x3e5b('0x46')],{})[_0x3e5b('0x27')](respondWithResult(_0x3f5835,0xc9))[_0x3e5b('0x43')](handleError(_0x3f5835,null));};exports[_0x3e5b('0x26')]=function(_0x4a2ae1,_0x223185){if(_0x4a2ae1['body']['id']){delete _0x4a2ae1[_0x3e5b('0x46')]['id'];}delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x47')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x48')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x49')];delete _0x4a2ae1[_0x3e5b('0x46')][_0x3e5b('0x4a')];return db[_0x3e5b('0x2c')][_0x3e5b('0x4b')]({'where':{'id':_0x4a2ae1[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x223185,null))['then'](saveUpdates(_0x4a2ae1[_0x3e5b('0x46')],null))[_0x3e5b('0x27')](respondWithResult(_0x223185,null))[_0x3e5b('0x43')](handleError(_0x223185,null));};exports[_0x3e5b('0x4d')]=function(_0x16c9f9,_0x2cecd3){return db['ScreenRecording'][_0x3e5b('0x4d')]()[_0x3e5b('0x27')](respondWithResult(_0x2cecd3,null))[_0x3e5b('0x43')](handleError(_0x2cecd3,null));};exports[_0x3e5b('0x4e')]=function(_0x3f8646,_0x449d0f,_0x216600){var _0x437430=require('../../components/encryptor');var _0x1e6403=![];var _0x5e702f={};if(_0x3f8646['query'][_0x3e5b('0x2e')]&&_0x3f8646['query'][_0x3e5b('0x2e')]===_0x3e5b('0x4f')){_0x5e702f[_0x3e5b('0x4f')]=_0x3f8646[_0x3e5b('0x4c')]['id'];}else{_0x5e702f['id']=_0x3f8646['params']['id'];}return db['ScreenRecording']['find']({'where':_0x5e702f,'attributes':['id','value'],'raw':!![]})[_0x3e5b('0x27')](handleEntityNotFound(_0x449d0f,null))[_0x3e5b('0x27')](function(_0x1ea02a){if(_0x1ea02a){var _0x4149c8=path[_0x3e5b('0x50')](config['root'],'server/files/screen_recordings',_0x1ea02a[_0x3e5b('0x4a')]);var _0x1b0b32=util[_0x3e5b('0x32')](_0x3e5b('0x51'),_0x4149c8);if(fs[_0x3e5b('0x52')](_0x1b0b32)){_0x1e6403=!![];return _0x437430['decryptFile'](_0x1b0b32,_0x4149c8,config['secrets']['recording'])['then'](function(){return _0x1ea02a;});}return _0x1ea02a;}})[_0x3e5b('0x27')](function(_0x3e3115){if(_0x3e3115){var _0x3088d4=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x3e3115[_0x3e5b('0x4a')]);if(!fs[_0x3e5b('0x52')](_0x3088d4)){throw new db['Sequelize'][(_0x3e5b('0x55'))](_0x3e5b('0x56'));}if(_0x3e3115[_0x3e5b('0x57')]){return _0x449d0f[_0x3e5b('0x4e')](_0x3088d4,_0x3e3115[_0x3e5b('0x57')]+path['extname'](_0x3088d4),function(){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}else{return _0x449d0f['download'](_0x3088d4,function(_0x45ca16){if(_0x1e6403){fs[_0x3e5b('0x58')](_0x3088d4);}});}}})['catch'](function(_0x4a7d8e){if(_0x4a7d8e['message']===_0x3e5b('0x56')){_0x449d0f['status'](0x194)[_0x3e5b('0x59')](_0x3e5b('0x5a'));}else{return handleError(_0x449d0f,null);}});};exports[_0x3e5b('0x5b')]=function(_0x40197c,_0x14f187){return db['ScreenRecording']['find']({'where':{'id':_0x40197c[_0x3e5b('0x4c')]['id']}})[_0x3e5b('0x27')](function(_0x3f7f71){if(_['isNil'](_0x3f7f71)){throw new ReferenceError(_0x3e5b('0x5c'));}return _0x3f7f71;})[_0x3e5b('0x27')](function(_0x32a42f){var _0x1c9526=path[_0x3e5b('0x50')](config[_0x3e5b('0x53')],_0x3e5b('0x54'),_0x32a42f[_0x3e5b('0x4a')]);logger[_0x3e5b('0x5d')](_0x3e5b('0x5e'),_0x1c9526);if(!_[_0x3e5b('0x5f')](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger[_0x3e5b('0x5d')](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs[_0x3e5b('0x62')](_0x1c9526);}_0x1c9526=_0x1c9526+_0x3e5b('0x63');if(!_['isNil'](_0x32a42f[_0x3e5b('0x4a')])&&fs[_0x3e5b('0x52')](_0x1c9526)){logger['info'](_0x3e5b('0x60')+_0x1c9526+_0x3e5b('0x61'));fs['unlinkSync'](_0x1c9526);}return _0x32a42f;})['then'](function(_0x4f67d1){if(!_0x4f67d1)throw new InternalError();return _0x4f67d1[_0x3e5b('0x5b')]();})[_0x3e5b('0x27')](function(){_0x14f187['status'](0xcc)[_0x3e5b('0x1a')]();})[_0x3e5b('0x43')](handleError(_0x14f187,null));}; \ No newline at end of file +var _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x116e6d,_0xfb2e54){var _0x133a99=function(_0x4c32e0){while(--_0x4c32e0){_0x116e6d['push'](_0x116e6d['shift']());}};_0x133a99(++_0xfb2e54);}(_0xb458,0x103));var _0x8b45=function(_0x5303b9,_0x5c548){_0x5303b9=_0x5303b9-0x0;var _0x455125=_0xb458[_0x5303b9];return _0x455125;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index b77807a..1d48474 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 _0x2d39=['moment','bluebird','request-promise','path','exports','define','screen_recordings','interactionid','lodash','util','api'];(function(_0x419593,_0x26836b){var _0x387cc4=function(_0x11d96e){while(--_0x11d96e){_0x419593['push'](_0x419593['shift']());}};_0x387cc4(++_0x26836b);}(_0x2d39,0xd9));var _0x92d3=function(_0x38e278,_0x346263){_0x38e278=_0x38e278-0x0;var _0x48a4bc=_0x2d39[_0x38e278];return _0x48a4bc;};'use strict';var _=require(_0x92d3('0x0'));var util=require(_0x92d3('0x1'));var logger=require('../../config/logger')(_0x92d3('0x2'));var moment=require(_0x92d3('0x3'));var BPromise=require(_0x92d3('0x4'));var rp=require(_0x92d3('0x5'));var fs=require('fs');var path=require(_0x92d3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x92d3('0x7')]=function(_0x505459,_0x37131b){return _0x505459[_0x92d3('0x8')]('ScreenRecording',attributes,{'tableName':_0x92d3('0x9'),'paranoid':![],'indexes':[{'name':_0x92d3('0xa'),'fields':[_0x92d3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08b8=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x08b8,0xc9));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x808b('0x0'));var util=require(_0x808b('0x1'));var logger=require('../../config/logger')(_0x808b('0x2'));var moment=require(_0x808b('0x3'));var BPromise=require(_0x808b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x808b('0x5'));var rimraf=require('rimraf');var config=require(_0x808b('0x6'));var attributes=require(_0x808b('0x7'));module[_0x808b('0x8')]=function(_0x3762c0,_0xfbb6d5){return _0x3762c0[_0x808b('0x9')](_0x808b('0xa'),attributes,{'tableName':_0x808b('0xb'),'paranoid':![],'indexes':[{'name':_0x808b('0xc'),'fields':[_0x808b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index c95fa15..4dc2656 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 _0x01ee=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash'];(function(_0x1525ee,_0x5c3b3a){var _0x43beda=function(_0x45f968){while(--_0x45f968){_0x1525ee['push'](_0x1525ee['shift']());}};_0x43beda(++_0x5c3b3a);}(_0x01ee,0xd1));var _0xe01e=function(_0x5e315e,_0xe5b411){_0x5e315e=_0x5e315e-0x0;var _0x15acdb=_0x01ee[_0x5e315e];return _0x15acdb;};'use strict';var _=require(_0xe01e('0x0'));var util=require(_0xe01e('0x1'));var moment=require('moment');var BPromise=require(_0xe01e('0x2'));var rs=require(_0xe01e('0x3'));var fs=require('fs');var Redis=require(_0xe01e('0x4'));var db=require(_0xe01e('0x5'))['db'];var utils=require(_0xe01e('0x6'));var logger=require(_0xe01e('0x7'))(_0xe01e('0x8'));var config=require(_0xe01e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe01e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x64da61,_0x4ca84e,_0x48f1b7){return new BPromise(function(_0x4bd226,_0x32f6e1){return client[_0xe01e('0xb')](_0x64da61,_0x48f1b7)[_0xe01e('0xc')](function(_0x489336){logger[_0xe01e('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4ca84e,'request\x20sent');logger[_0xe01e('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4ca84e,'request\x20sent',JSON['stringify'](_0x489336));if(_0x489336['error']){if(_0x489336[_0xe01e('0xf')][_0xe01e('0x10')]===0x1f4){logger[_0xe01e('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x4ca84e,_0x489336[_0xe01e('0xf')]['message']);return _0x32f6e1(_0x489336[_0xe01e('0xf')][_0xe01e('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4ca84e,_0x489336['error'][_0xe01e('0x11')]);return _0x4bd226(_0x489336[_0xe01e('0xf')][_0xe01e('0x11')]);}else{logger[_0xe01e('0xd')](_0xe01e('0x12'),_0x4ca84e,'request\x20sent');_0x4bd226(_0x489336[_0xe01e('0x13')][_0xe01e('0x11')]);}})[_0xe01e('0x14')](function(_0x8f6fa7){logger[_0xe01e('0xf')](_0xe01e('0x12'),_0x4ca84e,_0x8f6fa7);_0x32f6e1(_0x8f6fa7);});});} \ No newline at end of file +var _0xd308=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','error','ScreenRecording,\x20%s,\x20%s','message','info','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x501933,_0x5d767b){var _0x59e5d5=function(_0x169e4d){while(--_0x169e4d){_0x501933['push'](_0x501933['shift']());}};_0x59e5d5(++_0x5d767b);}(_0xd308,0xf2));var _0x8d30=function(_0x5ba6cc,_0x580284){_0x5ba6cc=_0x5ba6cc-0x0;var _0x558a40=_0xd308[_0x5ba6cc];return _0x558a40;};'use strict';var _=require('lodash');var util=require(_0x8d30('0x0'));var moment=require('moment');var BPromise=require(_0x8d30('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d30('0x2'));var db=require(_0x8d30('0x3'))['db'];var utils=require(_0x8d30('0x4'));var logger=require(_0x8d30('0x5'))(_0x8d30('0x6'));var config=require(_0x8d30('0x7'));var jayson=require(_0x8d30('0x8'));var client=jayson[_0x8d30('0x9')][_0x8d30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40826f,_0x383f74,_0x2e5b3d){return new BPromise(function(_0x24fa02,_0x356afa){return client[_0x8d30('0xb')](_0x40826f,_0x2e5b3d)['then'](function(_0x1545b2){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x383f74,'request\x20sent');logger[_0x8d30('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x383f74,_0x8d30('0xd'),JSON['stringify'](_0x1545b2));if(_0x1545b2[_0x8d30('0xe')]){if(_0x1545b2['error']['code']===0x1f4){logger[_0x8d30('0xe')](_0x8d30('0xf'),_0x383f74,_0x1545b2[_0x8d30('0xe')][_0x8d30('0x10')]);return _0x356afa(_0x1545b2[_0x8d30('0xe')][_0x8d30('0x10')]);}logger[_0x8d30('0xe')](_0x8d30('0xf'),_0x383f74,_0x1545b2[_0x8d30('0xe')][_0x8d30('0x10')]);return _0x24fa02(_0x1545b2[_0x8d30('0xe')][_0x8d30('0x10')]);}else{logger[_0x8d30('0x11')](_0x8d30('0xf'),_0x383f74,_0x8d30('0xd'));_0x24fa02(_0x1545b2['result'][_0x8d30('0x10')]);}})[_0x8d30('0x12')](function(_0x300f09){logger[_0x8d30('0xe')](_0x8d30('0xf'),_0x383f74,_0x300f09);_0x356afa(_0x300f09);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0e20d27..ae55ab6 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 _0xabb7=['addPreferred','favicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','join','logologin','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xabb7,0xe1));var _0x7abb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xabb7[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x7abb('0x0'));var util=require(_0x7abb('0x1'));var path=require(_0x7abb('0x2'));var timeout=require(_0x7abb('0x3'));var express=require(_0x7abb('0x4'));var router=express[_0x7abb('0x5')]();var fs_extra=require(_0x7abb('0x6'));var auth=require(_0x7abb('0x7'));var interaction=require(_0x7abb('0x8'));var config=require(_0x7abb('0x9'));var controller=require(_0x7abb('0xa'));router['get']('/',auth[_0x7abb('0xb')](),controller[_0x7abb('0xc')]);router[_0x7abb('0xd')](_0x7abb('0xe'),controller[_0x7abb('0xf')]);router[_0x7abb('0xd')](_0x7abb('0x10'),controller['show']);router[_0x7abb('0xd')](_0x7abb('0x11'),controller[_0x7abb('0x12')]);router['get'](_0x7abb('0x13'),controller[_0x7abb('0x14')]);router[_0x7abb('0xd')](_0x7abb('0x15'),controller['gdpr']);router[_0x7abb('0xd')](_0x7abb('0x16'),controller[_0x7abb('0x17')]);router[_0x7abb('0xd')](_0x7abb('0x18'),controller[_0x7abb('0x19')]);var upload=multer({'storage':multer[_0x7abb('0x1a')]({'destination':function(_0x435f9c,_0x4e10d7,_0x46fe47){_0x46fe47(null,path['join'](config[_0x7abb('0x1b')],_0x7abb('0x1c')));},'filename':function(_0x2a1345,_0x3facdd,_0x22e95f){_0x22e95f(null,util[_0x7abb('0x1d')](_0x7abb('0x1e'),_0x7abb('0x1f'),path[_0x7abb('0x20')](_0x3facdd[_0x7abb('0x21')])));}})});router['post'](_0x7abb('0x11'),upload[_0x7abb('0x22')](_0x7abb('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0x7abb('0x1a')]({'destination':function(_0x107251,_0x7bd13d,_0x8d1b44){_0x8d1b44(null,path[_0x7abb('0x24')](config['root'],_0x7abb('0x1c')));},'filename':function(_0x18c51e,_0x287476,_0x3fb5e9){_0x3fb5e9(null,util[_0x7abb('0x1d')](_0x7abb('0x1e'),_0x7abb('0x25'),path[_0x7abb('0x20')](_0x287476[_0x7abb('0x21')])));}})});router[_0x7abb('0x26')]('/:id/logo_login',upload['single']('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x7abb('0x1a')]({'destination':function(_0x8a39a1,_0x2a6b92,_0x493137){_0x493137(null,path[_0x7abb('0x24')](config[_0x7abb('0x1b')],_0x7abb('0x1c')));},'filename':function(_0x2ce0d4,_0x2b814c,_0x47955b){_0x47955b(null,util[_0x7abb('0x1d')](_0x7abb('0x1e'),'preferred',path[_0x7abb('0x20')](_0x2b814c['originalname'])));}})});router[_0x7abb('0x26')]('/:id/preferred',upload[_0x7abb('0x22')](_0x7abb('0x23')),controller[_0x7abb('0x27')]);var upload=multer({'storage':multer[_0x7abb('0x1a')]({'destination':function(_0x84897b,_0x2259ab,_0x1609d5){_0x1609d5(null,path[_0x7abb('0x24')](config[_0x7abb('0x1b')],_0x7abb('0x1c')));},'filename':function(_0x5069a9,_0x67c909,_0x197259){_0x197259(null,util['format'](_0x7abb('0x1e'),_0x7abb('0x28'),path[_0x7abb('0x20')](_0x67c909['originalname'])));}})});router['post']('/:id/favicon',upload[_0x7abb('0x22')](_0x7abb('0x23')),controller['addFavicon']);router[_0x7abb('0x29')](_0x7abb('0x10'),auth[_0x7abb('0xb')](),controller[_0x7abb('0x2a')]);module[_0x7abb('0x2b')]=router; \ No newline at end of file +var _0x3bf2=['/:id','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','extname','originalname','single','file','addLogo','format','logologin','post','addLogoLogin','%s%s','addPreferred','favicon','/:id/favicon','put'];(function(_0x1a87bd,_0x92c48a){var _0xc82a94=function(_0x1aca0e){while(--_0x1aca0e){_0x1a87bd['push'](_0x1a87bd['shift']());}};_0xc82a94(++_0x92c48a);}(_0x3bf2,0x169));var _0x23bf=function(_0x185133,_0x29a472){_0x185133=_0x185133-0x0;var _0x862f7f=_0x3bf2[_0x185133];return _0x862f7f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23bf('0x0'));var timeout=require('connect-timeout');var express=require(_0x23bf('0x1'));var router=express[_0x23bf('0x2')]();var fs_extra=require(_0x23bf('0x3'));var auth=require(_0x23bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23bf('0x5'));var controller=require(_0x23bf('0x6'));router[_0x23bf('0x7')]('/',auth[_0x23bf('0x8')](),controller[_0x23bf('0x9')]);router[_0x23bf('0x7')](_0x23bf('0xa'),controller[_0x23bf('0xb')]);router[_0x23bf('0x7')]('/:id',controller[_0x23bf('0xc')]);router[_0x23bf('0x7')](_0x23bf('0xd'),controller['getLogo']);router[_0x23bf('0x7')](_0x23bf('0xe'),controller[_0x23bf('0xf')]);router[_0x23bf('0x7')](_0x23bf('0x10'),controller[_0x23bf('0x11')]);router['get'](_0x23bf('0x12'),controller[_0x23bf('0x13')]);router[_0x23bf('0x7')]('/:id/favicon',controller[_0x23bf('0x14')]);var upload=multer({'storage':multer[_0x23bf('0x15')]({'destination':function(_0x538f26,_0x38b346,_0xeb3583){_0xeb3583(null,path[_0x23bf('0x16')](config[_0x23bf('0x17')],_0x23bf('0x18')));},'filename':function(_0x1b95ff,_0x2f2cdd,_0x37e590){_0x37e590(null,util['format']('%s%s','logo',path[_0x23bf('0x19')](_0x2f2cdd[_0x23bf('0x1a')])));}})});router['post'](_0x23bf('0xd'),upload[_0x23bf('0x1b')](_0x23bf('0x1c')),controller[_0x23bf('0x1d')]);var upload=multer({'storage':multer[_0x23bf('0x15')]({'destination':function(_0x5099ce,_0x2cf532,_0x1ae218){_0x1ae218(null,path['join'](config[_0x23bf('0x17')],'server/files/images/logos/'));},'filename':function(_0x463c41,_0x386925,_0x430f53){_0x430f53(null,util[_0x23bf('0x1e')]('%s%s',_0x23bf('0x1f'),path['extname'](_0x386925[_0x23bf('0x1a')])));}})});router[_0x23bf('0x20')](_0x23bf('0xe'),upload[_0x23bf('0x1b')]('file'),controller[_0x23bf('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a9b72,_0xd0a752,_0x1b40da){_0x1b40da(null,path['join'](config['root'],_0x23bf('0x18')));},'filename':function(_0x4791b6,_0x4e7783,_0x10705b){_0x10705b(null,util['format'](_0x23bf('0x22'),'preferred',path[_0x23bf('0x19')](_0x4e7783[_0x23bf('0x1a')])));}})});router[_0x23bf('0x20')](_0x23bf('0x12'),upload['single']('file'),controller[_0x23bf('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ddc24,_0x4172d7,_0x20430d){_0x20430d(null,path['join'](config['root'],_0x23bf('0x18')));},'filename':function(_0x127d61,_0x4b7b56,_0x32dd1b){_0x32dd1b(null,util[_0x23bf('0x1e')]('%s%s',_0x23bf('0x24'),path[_0x23bf('0x19')](_0x4b7b56['originalname'])));}})});router[_0x23bf('0x20')](_0x23bf('0x25'),upload[_0x23bf('0x1b')](_0x23bf('0x1c')),controller['addFavicon']);router[_0x23bf('0x26')](_0x23bf('0x27'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index eed720c..d13a4a2 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 _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0xadb5,0xad));var _0x5adb=function(_0x169f5c,_0x345a65){_0x169f5c=_0x169f5c-0x0;var _0x12d10e=_0xadb5[_0x169f5c];return _0x12d10e;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x4b3c7e,_0x58aef9){var _0x3015af=function(_0x12e3f7){while(--_0x12e3f7){_0x4b3c7e['push'](_0x4b3c7e['shift']());}};_0x3015af(++_0x58aef9);}(_0x1261,0x144));var _0x1126=function(_0x20629d,_0x1a6757){_0x20629d=_0x20629d-0x0;var _0x4ca950=_0x1261[_0x20629d];return _0x4ca950;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('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 811a4a4..5d6f56a 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 _0xa43d=['fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','upperFirst','custom','toLower','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','default','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','format','rimraf','zip-dir'];(function(_0x458848,_0x2dcecd){var _0x20469e=function(_0x41de26){while(--_0x41de26){_0x458848['push'](_0x458848['shift']());}};_0x20469e(++_0x2dcecd);}(_0xa43d,0x172));var _0xda43=function(_0x3abdf8,_0x1d1aef){_0x3abdf8=_0x3abdf8-0x0;var _0xd62e3d=_0xa43d[_0x3abdf8];return _0xd62e3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda43('0x0'));var zipdir=require(_0xda43('0x1'));var jsonpatch=require(_0xda43('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda43('0x3'));var Mustache=require('mustache');var util=require(_0xda43('0x4'));var path=require('path');var sox=require(_0xda43('0x5'));var csv=require(_0xda43('0x6'));var ejs=require(_0xda43('0x7'));var fs=require('fs');var fs_extra=require(_0xda43('0x8'));var _=require(_0xda43('0x9'));var squel=require(_0xda43('0xa'));var crypto=require(_0xda43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda43('0xc'));var toCsv=require(_0xda43('0x6'));var querystring=require(_0xda43('0xd'));var Papa=require(_0xda43('0xe'));var Redis=require(_0xda43('0xf'));var authService=require(_0xda43('0x10'));var qs=require(_0xda43('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda43('0x12'));var logger=require(_0xda43('0x13'))(_0xda43('0x14'));var utils=require('../../config/utils');var config=require(_0xda43('0x15'));var licenseUtil=require(_0xda43('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xda43('0x17'));var client=jayson[_0xda43('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eab98,_0x4cc92e,_0x3af04b,_0x8b4a0f){return new BPromise(function(_0x13908b,_0x3b240b){var _0x1a7ae3=_0x8b4a0f||client;return _0x1a7ae3[_0xda43('0x19')](_0x3eab98,_0x3af04b)[_0xda43('0x1a')](function(_0x16e8fe){logger[_0xda43('0x1b')](_0xda43('0x1c'),_0x4cc92e,_0xda43('0x1d'));logger[_0xda43('0x1e')](_0xda43('0x1f'),_0x4cc92e,_0xda43('0x1d'),JSON[_0xda43('0x20')](_0x16e8fe));if(_0x16e8fe[_0xda43('0x21')]){if(_0x16e8fe['error'][_0xda43('0x22')]===0x1f4){logger[_0xda43('0x21')]('Setting,\x20%s,\x20%s',_0x4cc92e,_0x16e8fe[_0xda43('0x21')]['message']);return _0x3b240b(_0x16e8fe['error'][_0xda43('0x23')]);}logger[_0xda43('0x21')]('Setting,\x20%s,\x20%s',_0x4cc92e,_0x16e8fe[_0xda43('0x21')][_0xda43('0x23')]);return _0x13908b(_0x16e8fe[_0xda43('0x21')][_0xda43('0x23')]);}else{logger[_0xda43('0x1b')]('Setting,\x20%s,\x20%s',_0x4cc92e,_0xda43('0x1d'));_0x13908b(_0x16e8fe[_0xda43('0x24')][_0xda43('0x23')]);}})[_0xda43('0x25')](function(_0x471b78){logger[_0xda43('0x21')](_0xda43('0x1c'),_0x4cc92e,_0x471b78);_0x3b240b(_0x471b78);});});}function respondWithStatusCode(_0x16a3f8,_0xac4bf1){_0xac4bf1=_0xac4bf1||0xcc;return function(_0x514925){if(_0x514925){return _0x16a3f8['sendStatus'](_0xac4bf1);}return _0x16a3f8[_0xda43('0x26')](_0xac4bf1)['end']();};}function respondWithResult(_0x5512b2,_0x1b22ba){_0x1b22ba=_0x1b22ba||0xc8;return function(_0x3439b3){if(_0x3439b3){return _0x5512b2[_0xda43('0x26')](_0x1b22ba)[_0xda43('0x27')](_0x3439b3);}};}function respondWithFilteredResult(_0x22dcb8,_0x29db73){return function(_0x3c8d86){if(_0x3c8d86){var _0x25a604=typeof _0x29db73[_0xda43('0x28')]===_0xda43('0x29')&&typeof _0x29db73[_0xda43('0x2a')]===_0xda43('0x29');var _0x5eeb9f=_0x3c8d86[_0xda43('0x2b')];var _0xf956e4=_0x25a604?0x0:_0x29db73[_0xda43('0x28')];var _0x3c0b7e=_0x25a604?_0x3c8d86['count']:_0x29db73[_0xda43('0x28')]+_0x29db73['limit'];var _0x5bde8f;if(_0x3c0b7e>=_0x5eeb9f){_0x3c0b7e=_0x5eeb9f;_0x5bde8f=0xc8;}else{_0x5bde8f=0xce;}_0x22dcb8['status'](_0x5bde8f);return _0x22dcb8['set'](_0xda43('0x2c'),_0xf956e4+'-'+_0x3c0b7e+'/'+_0x5eeb9f)[_0xda43('0x27')](_0x3c8d86);}return null;};}function patchUpdates(_0x400ddf){return function(_0xd1bc55){try{jsonpatch[_0xda43('0x2d')](_0xd1bc55,_0x400ddf,!![]);}catch(_0x49ff55){return BPromise[_0xda43('0x2e')](_0x49ff55);}return _0xd1bc55[_0xda43('0x2f')]();};}function saveUpdates(_0x5cd84c,_0x5e1776){return function(_0x19c5ee){if(_0x19c5ee){return _0x19c5ee[_0xda43('0x30')](_0x5cd84c)[_0xda43('0x1a')](function(_0x154420){return _0x154420;});}return null;};}function removeEntity(_0x5702c7,_0x492b23){return function(_0x28c315){if(_0x28c315){return _0x28c315[_0xda43('0x31')]()[_0xda43('0x1a')](function(){_0x5702c7[_0xda43('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ddcb2,_0x52284a){return function(_0x4e4479){if(!_0x4e4479){_0x2ddcb2[_0xda43('0x32')](0x194);}return _0x4e4479;};}function handleError(_0x5abd34,_0x113a96){_0x113a96=_0x113a96||0x1f4;return function(_0x514730){logger[_0xda43('0x21')](_0x514730[_0xda43('0x33')]);if(_0x514730[_0xda43('0x34')]){delete _0x514730[_0xda43('0x34')];}_0x5abd34['status'](_0x113a96)[_0xda43('0x35')](_0x514730);};}exports[_0xda43('0x36')]=function(_0x3a7c06,_0x5aa18a){var _0x3a76dd={},_0x3ffd03={},_0x1dbdea={'count':0x0,'rows':[]};var _0x402025=_[_0xda43('0x37')](db[_0xda43('0x38')][_0xda43('0x39')],function(_0x38eda0){return{'name':_0x38eda0[_0xda43('0x3a')],'type':_0x38eda0['type'][_0xda43('0x3b')]};});_0x3ffd03[_0xda43('0x3c')]=_[_0xda43('0x37')](_0x402025,_0xda43('0x34'));_0x3ffd03[_0xda43('0x3d')]=_[_0xda43('0x3e')](_0x3a7c06[_0xda43('0x3d')]);_0x3ffd03[_0xda43('0x3f')]=_['intersection'](_0x3ffd03['model'],_0x3ffd03[_0xda43('0x3d')]);_0x3a76dd[_0xda43('0x40')]=_[_0xda43('0x41')](_0x3ffd03[_0xda43('0x3c')],qs[_0xda43('0x42')](_0x3a7c06['query']['fields']));_0x3a76dd['attributes']=_0x3a76dd['attributes'][_0xda43('0x43')]?_0x3a76dd[_0xda43('0x40')]:_0x3ffd03[_0xda43('0x3c')];if(!_0x3a7c06[_0xda43('0x3d')][_0xda43('0x44')]('nolimit')){_0x3a76dd['limit']=qs[_0xda43('0x2a')](_0x3a7c06[_0xda43('0x3d')]['limit']);_0x3a76dd[_0xda43('0x28')]=qs[_0xda43('0x28')](_0x3a7c06['query'][_0xda43('0x28')]);}_0x3a76dd[_0xda43('0x45')]=qs[_0xda43('0x46')](_0x3a7c06[_0xda43('0x3d')][_0xda43('0x46')]);_0x3a76dd['where']=qs[_0xda43('0x3f')](_[_0xda43('0x47')](_0x3a7c06[_0xda43('0x3d')],_0x3ffd03[_0xda43('0x3f')]),_0x402025);if(_0x3a7c06['query'][_0xda43('0x48')]){_0x3a76dd[_0xda43('0x49')]=_[_0xda43('0x4a')](_0x3a76dd[_0xda43('0x49')],{'$or':_[_0xda43('0x37')](_0x402025,function(_0x104e3b){if(_0x104e3b[_0xda43('0x4b')]!==_0xda43('0x4c')){var _0xe6fdf0={};_0xe6fdf0[_0x104e3b['name']]={'$like':'%'+_0x3a7c06[_0xda43('0x3d')]['filter']+'%'};return _0xe6fdf0;}})});}_0x3a76dd=_['merge']({},_0x3a76dd,_0x3a7c06['options']);var _0x16b0e0={'where':_0x3a76dd[_0xda43('0x49')]};return db[_0xda43('0x38')][_0xda43('0x2b')](_0x16b0e0)[_0xda43('0x1a')](function(_0x557966){_0x1dbdea[_0xda43('0x2b')]=_0x557966;if(_0x3a7c06[_0xda43('0x3d')][_0xda43('0x4d')]){_0x3a76dd[_0xda43('0x4e')]=[{'all':!![]}];}return db[_0xda43('0x38')][_0xda43('0x4f')](_0x3a76dd);})[_0xda43('0x1a')](function(_0x1b7566){_0x1dbdea[_0xda43('0x50')]=_0x1b7566;return _0x1dbdea;})[_0xda43('0x1a')](respondWithFilteredResult(_0x5aa18a,_0x3a76dd))[_0xda43('0x25')](handleError(_0x5aa18a,null));};exports[_0xda43('0x51')]=function(_0x15a0a8,_0x1c8013){var _0x17ca65={'raw':![],'where':{'id':_0x15a0a8[_0xda43('0x52')]['id']}},_0x2768b6={};_0x2768b6[_0xda43('0x3c')]=_[_0xda43('0x3e')](db[_0xda43('0x38')][_0xda43('0x39')]);_0x2768b6[_0xda43('0x3d')]=_[_0xda43('0x3e')](_0x15a0a8['query']);_0x2768b6[_0xda43('0x3f')]=_[_0xda43('0x41')](_0x2768b6[_0xda43('0x3c')],_0x2768b6[_0xda43('0x3d')]);_0x17ca65[_0xda43('0x40')]=_['intersection'](_0x2768b6[_0xda43('0x3c')],qs[_0xda43('0x42')](_0x15a0a8[_0xda43('0x3d')]['fields']));_0x17ca65['attributes']=_0x17ca65['attributes'][_0xda43('0x43')]?_0x17ca65[_0xda43('0x40')]:_0x2768b6['model'];if(_0x15a0a8[_0xda43('0x3d')][_0xda43('0x4d')]){_0x17ca65[_0xda43('0x4e')]=[{'all':!![]}];}_0x17ca65=_['merge']({},_0x17ca65,_0x15a0a8[_0xda43('0x53')]);return db[_0xda43('0x38')][_0xda43('0x54')](_0x17ca65)[_0xda43('0x1a')](handleEntityNotFound(_0x1c8013,null))['then'](respondWithResult(_0x1c8013,null))['catch'](handleError(_0x1c8013,null));};exports['update']=function(_0x44d8ea,_0x300bf2){if(_0x44d8ea[_0xda43('0x55')]['id']){delete _0x44d8ea[_0xda43('0x55')]['id'];}return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0x44d8ea[_0xda43('0x52')]['id']}})['then'](handleEntityNotFound(_0x300bf2,null))['then'](saveUpdates(_0x44d8ea[_0xda43('0x55')],null))[_0xda43('0x1a')](respondWithResult(_0x300bf2,null))[_0xda43('0x25')](handleError(_0x300bf2,null));};exports[_0xda43('0x56')]=function(_0x3ab665,_0x2f05a3,_0x36a927){if(_0x3ab665[_0xda43('0x57')]&&_0x3ab665[_0xda43('0x57')]['filename']){_0x3ab665['body'][_0xda43('0x58')]=_0x3ab665['file'][_0xda43('0x59')];}return db['Setting'][_0xda43('0x54')]({'where':{'id':_0x3ab665['params']['id']}})[_0xda43('0x1a')](handleEntityNotFound(_0x2f05a3,null))[_0xda43('0x1a')](saveUpdates(_0x3ab665[_0xda43('0x55')],null))[_0xda43('0x1a')](respondWithResult(_0x2f05a3,null))[_0xda43('0x25')](handleError(_0x2f05a3,null));};exports[_0xda43('0x5a')]=function(_0x5149b6,_0x2a65fc,_0x1109c7){if(_0x5149b6[_0xda43('0x57')]&&_0x5149b6[_0xda43('0x57')][_0xda43('0x59')]){_0x5149b6[_0xda43('0x55')][_0xda43('0x5b')]=_0x5149b6[_0xda43('0x57')][_0xda43('0x59')];}return db['Setting']['find']({'where':{'id':_0x5149b6[_0xda43('0x52')]['id']}})[_0xda43('0x1a')](handleEntityNotFound(_0x2a65fc,null))[_0xda43('0x1a')](saveUpdates(_0x5149b6[_0xda43('0x55')],null))['then'](respondWithResult(_0x2a65fc,null))['catch'](handleError(_0x2a65fc,null));};var utilLicense=require(_0xda43('0x16'));exports[_0xda43('0x5c')]=function(_0x47b9f6,_0x4c3bc5,_0x1295a9){var _0x3d84dd='server/files/images/logos';var _0xb28f66={'custom':![]};return utilLicense[_0xda43('0x5d')]()[_0xda43('0x1a')](function(_0x205673){if(_0x205673){_0xb28f66=_0x205673;}return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0x47b9f6[_0xda43('0x52')]['id']},'attributes':[_0xda43('0x58'),_0xda43('0x5b'),_0xda43('0x5e'),_0xda43('0x5f'),_0xda43('0x60'),_0xda43('0x61'),_0xda43('0x62'),_0xda43('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x4c3bc5,null))['then'](function(_0x37ac4b){if(_0x37ac4b){var _0x15d2c0=_0x37ac4b['logo']&&fs[_0xda43('0x64')](path[_0xda43('0x65')](config['root'],_0x3d84dd,_['toLower'](_0x37ac4b[_0xda43('0x58')])))?path[_0xda43('0x65')](config[_0xda43('0x66')],_0x3d84dd,_['toLower'](_0x37ac4b[_0xda43('0x58')])):path['join'](config[_0xda43('0x66')],_0x3d84dd,_['toLower']('default_logo.svg'));var _0x3e91bc='default'+_[_0xda43('0x67')](_0xda43('0x58'));if(_0x37ac4b[_0x3e91bc]||!_0xb28f66[_0xda43('0x68')]){_0x15d2c0=path[_0xda43('0x65')](config[_0xda43('0x66')],_0x3d84dd,_[_0xda43('0x69')](_0xda43('0x6a')));}if(!fs['existsSync'](_0x15d2c0)){throw new db[(_0xda43('0x6b'))][(_0xda43('0x6c'))](_[_0xda43('0x67')](_0xda43('0x58'))+_0xda43('0x6d'));}return _0x4c3bc5[_0xda43('0x6e')](_0x15d2c0);}})[_0xda43('0x25')](handleError(_0x4c3bc5,null));};var utilLicense=require(_0xda43('0x16'));exports['getLogoLogin']=function(_0x5d285f,_0x4aef7b,_0x5977c3){var _0xb54ece=_0xda43('0x6f');var _0x230204={'custom':![]};return utilLicense[_0xda43('0x5d')]()['then'](function(_0x11d1b9){if(_0x11d1b9){_0x230204=_0x11d1b9;}return db['Setting'][_0xda43('0x54')]({'where':{'id':_0x5d285f['params']['id']},'attributes':[_0xda43('0x58'),'loginLogo','preferred','favicon',_0xda43('0x60'),_0xda43('0x61'),_0xda43('0x62'),_0xda43('0x63')],'raw':!![]});})[_0xda43('0x1a')](handleEntityNotFound(_0x4aef7b,null))[_0xda43('0x1a')](function(_0x405ce6){if(_0x405ce6){var _0x5234f4=_0x405ce6[_0xda43('0x5b')]&&fs[_0xda43('0x64')](path['join'](config[_0xda43('0x66')],_0xb54ece,_[_0xda43('0x69')](_0x405ce6[_0xda43('0x5b')])))?path[_0xda43('0x65')](config[_0xda43('0x66')],_0xb54ece,_['toLower'](_0x405ce6[_0xda43('0x5b')])):path[_0xda43('0x65')](config[_0xda43('0x66')],_0xb54ece,_[_0xda43('0x69')]('default_loginLogo.svg'));var _0x3bfb93=_0xda43('0x70')+_['upperFirst'](_0xda43('0x5b'));if(_0x405ce6[_0x3bfb93]||!_0x230204[_0xda43('0x68')]){_0x5234f4=path['join'](config['root'],_0xb54ece,_[_0xda43('0x69')](_0xda43('0x71')));}if(!fs['existsSync'](_0x5234f4)){throw new db[(_0xda43('0x6b'))][(_0xda43('0x6c'))](_[_0xda43('0x67')](_0xda43('0x5b'))+_0xda43('0x6d'));}return _0x4aef7b[_0xda43('0x6e')](_0x5234f4);}})[_0xda43('0x25')](handleError(_0x4aef7b,null));};exports['gdpr']=function(_0x2a65d6,_0xa83db6){return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0x2a65d6[_0xda43('0x52')]['id']},'attributes':[_0xda43('0x72')]})['then'](respondWithResult(_0xa83db6,null))[_0xda43('0x25')](handleError(_0xa83db6,null));};exports[_0xda43('0x73')]=function(_0x3dca0b,_0x42182a,_0x1eeefb){if(_0x3dca0b[_0xda43('0x57')]&&_0x3dca0b[_0xda43('0x57')]['filename']){_0x3dca0b[_0xda43('0x55')]['preferred']=_0x3dca0b['file']['filename'];}return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0x3dca0b[_0xda43('0x52')]['id']}})[_0xda43('0x1a')](handleEntityNotFound(_0x42182a,null))[_0xda43('0x1a')](saveUpdates(_0x3dca0b['body'],null))[_0xda43('0x1a')](respondWithResult(_0x42182a,null))[_0xda43('0x25')](handleError(_0x42182a,null));};var utilLicense=require('../../config/license/util');exports[_0xda43('0x74')]=function(_0x1510de,_0x5f139f,_0x2aadfb){var _0x1d6d71=_0xda43('0x6f');var _0x2f06d4={'custom':![]};return utilLicense[_0xda43('0x5d')]()[_0xda43('0x1a')](function(_0x11d935){if(_0x11d935){_0x2f06d4=_0x11d935;}return db['Setting'][_0xda43('0x54')]({'where':{'id':_0x1510de[_0xda43('0x52')]['id']},'attributes':[_0xda43('0x58'),_0xda43('0x5b'),_0xda43('0x5e'),_0xda43('0x5f'),_0xda43('0x60'),_0xda43('0x61'),_0xda43('0x62'),'defaultFavicon'],'raw':!![]});})[_0xda43('0x1a')](handleEntityNotFound(_0x5f139f,null))['then'](function(_0x27a632){if(_0x27a632){var _0x2dd021=_0x27a632[_0xda43('0x5e')]&&fs[_0xda43('0x64')](path['join'](config[_0xda43('0x66')],_0x1d6d71,_['toLower'](_0x27a632[_0xda43('0x5e')])))?path[_0xda43('0x65')](config[_0xda43('0x66')],_0x1d6d71,_[_0xda43('0x69')](_0x27a632[_0xda43('0x5e')])):path[_0xda43('0x65')](config[_0xda43('0x66')],_0x1d6d71,_[_0xda43('0x69')](_0xda43('0x75')));var _0x5dcef6=_0xda43('0x70')+_[_0xda43('0x67')](_0xda43('0x5e'));if(_0x27a632[_0x5dcef6]||!_0x2f06d4[_0xda43('0x68')]||!_0x2f06d4[_0xda43('0x5e')]){_0x2dd021=path[_0xda43('0x65')](config[_0xda43('0x66')],_0x1d6d71,_[_0xda43('0x69')]('default_preferred.png'));}if(!fs[_0xda43('0x64')](_0x2dd021)){throw new db['Sequelize']['ValidationError'](_[_0xda43('0x67')](_0xda43('0x5e'))+_0xda43('0x6d'));}return _0x5f139f[_0xda43('0x6e')](_0x2dd021);}})['catch'](handleError(_0x5f139f,null));};exports[_0xda43('0x76')]=function(_0x4011a7,_0x2f7647,_0x318ff4){if(_0x4011a7[_0xda43('0x57')]&&_0x4011a7[_0xda43('0x57')][_0xda43('0x59')]){_0x4011a7['body'][_0xda43('0x5f')]=_0x4011a7[_0xda43('0x57')][_0xda43('0x59')];}return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0x4011a7[_0xda43('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f7647,null))[_0xda43('0x1a')](saveUpdates(_0x4011a7[_0xda43('0x55')],null))[_0xda43('0x1a')](respondWithResult(_0x2f7647,null))[_0xda43('0x25')](handleError(_0x2f7647,null));};var utilLicense=require('../../config/license/util');exports[_0xda43('0x77')]=function(_0xc26635,_0x5acca8,_0x136199){var _0x565633=_0xda43('0x6f');var _0x3b218f={'custom':![]};return utilLicense[_0xda43('0x5d')]()[_0xda43('0x1a')](function(_0x2d7ce7){if(_0x2d7ce7){_0x3b218f=_0x2d7ce7;}return db[_0xda43('0x38')][_0xda43('0x54')]({'where':{'id':_0xc26635[_0xda43('0x52')]['id']},'attributes':['logo',_0xda43('0x5b'),_0xda43('0x5e'),'favicon','defaultLogo',_0xda43('0x61'),'defaultPreferred',_0xda43('0x63')],'raw':!![]});})[_0xda43('0x1a')](handleEntityNotFound(_0x5acca8,null))['then'](function(_0x150019){if(_0x150019){var _0x4e9d62=_0x150019[_0xda43('0x5f')]&&fs['existsSync'](path[_0xda43('0x65')](config[_0xda43('0x66')],_0x565633,_[_0xda43('0x69')](_0x150019[_0xda43('0x5f')])))?path[_0xda43('0x65')](config[_0xda43('0x66')],_0x565633,_[_0xda43('0x69')](_0x150019[_0xda43('0x5f')])):path['join'](config[_0xda43('0x66')],_0x565633,_[_0xda43('0x69')]('default_favicon.ico'));var _0x3bb3bb=_0xda43('0x70')+_[_0xda43('0x67')](_0xda43('0x5f'));if(_0x150019[_0x3bb3bb]||!_0x3b218f[_0xda43('0x68')]){_0x4e9d62=path[_0xda43('0x65')](config[_0xda43('0x66')],_0x565633,_['toLower'](_0xda43('0x78')));}if(!fs[_0xda43('0x64')](_0x4e9d62)){throw new db[(_0xda43('0x6b'))][(_0xda43('0x6c'))](_[_0xda43('0x67')](_0xda43('0x5f'))+_0xda43('0x6d'));}return _0x5acca8[_0xda43('0x6e')](_0x4e9d62);}})[_0xda43('0x25')](handleError(_0x5acca8,null));};exports[_0xda43('0x79')]=function(_0x2182b9,_0x25bb06){var _0x3fa763={'offset':moment()['utcOffset']()};_0x3fa763[_0xda43('0x7a')]=moment()['utcOffset'](_0x3fa763['offset'])[_0xda43('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x25bb06[_0xda43('0x26')](0xc8)[_0xda43('0x35')](_0x3fa763);}; \ No newline at end of file +var _0x2fda=['favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','default','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','Setting','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','body','params','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred'];(function(_0x24afea,_0x24bb04){var _0x499c84=function(_0x45882c){while(--_0x45882c){_0x24afea['push'](_0x24afea['shift']());}};_0x499c84(++_0x24bb04);}(_0x2fda,0x186));var _0xa2fd=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x2fda[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0xa2fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2fd('0x1'));var rp=require(_0xa2fd('0x2'));var moment=require(_0xa2fd('0x3'));var BPromise=require(_0xa2fd('0x4'));var Mustache=require(_0xa2fd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa2fd('0x6'));var ejs=require(_0xa2fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2fd('0x8'));var squel=require(_0xa2fd('0x9'));var crypto=require(_0xa2fd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa2fd('0xb'));var toCsv=require(_0xa2fd('0x6'));var querystring=require(_0xa2fd('0xc'));var Papa=require(_0xa2fd('0xd'));var Redis=require(_0xa2fd('0xe'));var authService=require(_0xa2fd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2fd('0x10'))('api');var utils=require(_0xa2fd('0x11'));var config=require(_0xa2fd('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xa2fd('0x13'));var client=jayson[_0xa2fd('0x14')][_0xa2fd('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x325f35,_0x2e9eb8,_0x3cff47,_0x51f176){return new BPromise(function(_0x4e0a72,_0x3a1708){var _0x4c75e5=_0x51f176||client;return _0x4c75e5[_0xa2fd('0x16')](_0x325f35,_0x3cff47)['then'](function(_0xcf45fb){logger[_0xa2fd('0x17')](_0xa2fd('0x18'),_0x2e9eb8,_0xa2fd('0x19'));logger['debug'](_0xa2fd('0x1a'),_0x2e9eb8,_0xa2fd('0x19'),JSON[_0xa2fd('0x1b')](_0xcf45fb));if(_0xcf45fb[_0xa2fd('0x1c')]){if(_0xcf45fb[_0xa2fd('0x1c')]['code']===0x1f4){logger[_0xa2fd('0x1c')](_0xa2fd('0x18'),_0x2e9eb8,_0xcf45fb[_0xa2fd('0x1c')][_0xa2fd('0x1d')]);return _0x3a1708(_0xcf45fb[_0xa2fd('0x1c')][_0xa2fd('0x1d')]);}logger[_0xa2fd('0x1c')](_0xa2fd('0x18'),_0x2e9eb8,_0xcf45fb[_0xa2fd('0x1c')][_0xa2fd('0x1d')]);return _0x4e0a72(_0xcf45fb[_0xa2fd('0x1c')]['message']);}else{logger[_0xa2fd('0x17')](_0xa2fd('0x18'),_0x2e9eb8,_0xa2fd('0x19'));_0x4e0a72(_0xcf45fb[_0xa2fd('0x1e')][_0xa2fd('0x1d')]);}})['catch'](function(_0x40e0f8){logger[_0xa2fd('0x1c')](_0xa2fd('0x18'),_0x2e9eb8,_0x40e0f8);_0x3a1708(_0x40e0f8);});});}function respondWithStatusCode(_0x2f9744,_0x3e2110){_0x3e2110=_0x3e2110||0xcc;return function(_0x1e111a){if(_0x1e111a){return _0x2f9744[_0xa2fd('0x1f')](_0x3e2110);}return _0x2f9744[_0xa2fd('0x20')](_0x3e2110)[_0xa2fd('0x21')]();};}function respondWithResult(_0x5c09bb,_0x3c551d){_0x3c551d=_0x3c551d||0xc8;return function(_0x44b155){if(_0x44b155){return _0x5c09bb[_0xa2fd('0x20')](_0x3c551d)['json'](_0x44b155);}};}function respondWithFilteredResult(_0x4e44ff,_0x20041e){return function(_0x113739){if(_0x113739){var _0x30539d=typeof _0x20041e[_0xa2fd('0x22')]==='undefined'&&typeof _0x20041e['limit']===_0xa2fd('0x23');var _0x164366=_0x113739[_0xa2fd('0x24')];var _0x800876=_0x30539d?0x0:_0x20041e[_0xa2fd('0x22')];var _0x26b042=_0x30539d?_0x113739['count']:_0x20041e[_0xa2fd('0x22')]+_0x20041e[_0xa2fd('0x25')];var _0x1dda7b;if(_0x26b042>=_0x164366){_0x26b042=_0x164366;_0x1dda7b=0xc8;}else{_0x1dda7b=0xce;}_0x4e44ff[_0xa2fd('0x20')](_0x1dda7b);return _0x4e44ff[_0xa2fd('0x26')](_0xa2fd('0x27'),_0x800876+'-'+_0x26b042+'/'+_0x164366)['json'](_0x113739);}return null;};}function patchUpdates(_0x346bfd){return function(_0x21c9cd){try{jsonpatch[_0xa2fd('0x28')](_0x21c9cd,_0x346bfd,!![]);}catch(_0x2ad79d){return BPromise[_0xa2fd('0x29')](_0x2ad79d);}return _0x21c9cd[_0xa2fd('0x2a')]();};}function saveUpdates(_0x357f09,_0x408f73){return function(_0x578cb6){if(_0x578cb6){return _0x578cb6[_0xa2fd('0x2b')](_0x357f09)[_0xa2fd('0x2c')](function(_0x1b9b57){return _0x1b9b57;});}return null;};}function removeEntity(_0x310777,_0x4ee3fd){return function(_0x4ac90d){if(_0x4ac90d){return _0x4ac90d['destroy']()[_0xa2fd('0x2c')](function(){_0x310777['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x207d06,_0x38016f){return function(_0x4df62a){if(!_0x4df62a){_0x207d06[_0xa2fd('0x1f')](0x194);}return _0x4df62a;};}function handleError(_0x3f4417,_0x2600c1){_0x2600c1=_0x2600c1||0x1f4;return function(_0x5bee76){logger[_0xa2fd('0x1c')](_0x5bee76[_0xa2fd('0x2d')]);if(_0x5bee76[_0xa2fd('0x2e')]){delete _0x5bee76[_0xa2fd('0x2e')];}_0x3f4417[_0xa2fd('0x20')](_0x2600c1)['send'](_0x5bee76);};}exports[_0xa2fd('0x2f')]=function(_0x98a5c3,_0x96e2e4){var _0x2a0bd1={},_0x2fae82={},_0x578577={'count':0x0,'rows':[]};var _0x10aaa2=_['map'](db[_0xa2fd('0x30')][_0xa2fd('0x31')],function(_0x5b1b55){return{'name':_0x5b1b55[_0xa2fd('0x32')],'type':_0x5b1b55['type']['key']};});_0x2fae82[_0xa2fd('0x33')]=_[_0xa2fd('0x34')](_0x10aaa2,'name');_0x2fae82[_0xa2fd('0x35')]=_['keys'](_0x98a5c3[_0xa2fd('0x35')]);_0x2fae82[_0xa2fd('0x36')]=_[_0xa2fd('0x37')](_0x2fae82['model'],_0x2fae82[_0xa2fd('0x35')]);_0x2a0bd1[_0xa2fd('0x38')]=_[_0xa2fd('0x37')](_0x2fae82['model'],qs[_0xa2fd('0x39')](_0x98a5c3[_0xa2fd('0x35')]['fields']));_0x2a0bd1[_0xa2fd('0x38')]=_0x2a0bd1[_0xa2fd('0x38')][_0xa2fd('0x3a')]?_0x2a0bd1[_0xa2fd('0x38')]:_0x2fae82[_0xa2fd('0x33')];if(!_0x98a5c3['query'][_0xa2fd('0x3b')](_0xa2fd('0x3c'))){_0x2a0bd1[_0xa2fd('0x25')]=qs[_0xa2fd('0x25')](_0x98a5c3['query'][_0xa2fd('0x25')]);_0x2a0bd1[_0xa2fd('0x22')]=qs[_0xa2fd('0x22')](_0x98a5c3[_0xa2fd('0x35')][_0xa2fd('0x22')]);}_0x2a0bd1[_0xa2fd('0x3d')]=qs[_0xa2fd('0x3e')](_0x98a5c3[_0xa2fd('0x35')]['sort']);_0x2a0bd1[_0xa2fd('0x3f')]=qs['filters'](_['pick'](_0x98a5c3['query'],_0x2fae82[_0xa2fd('0x36')]),_0x10aaa2);if(_0x98a5c3['query'][_0xa2fd('0x40')]){_0x2a0bd1['where']=_['merge'](_0x2a0bd1[_0xa2fd('0x3f')],{'$or':_[_0xa2fd('0x34')](_0x10aaa2,function(_0x589606){if(_0x589606['type']!==_0xa2fd('0x41')){var _0x46e216={};_0x46e216[_0x589606['name']]={'$like':'%'+_0x98a5c3['query'][_0xa2fd('0x40')]+'%'};return _0x46e216;}})});}_0x2a0bd1=_[_0xa2fd('0x42')]({},_0x2a0bd1,_0x98a5c3[_0xa2fd('0x43')]);var _0x3ed87e={'where':_0x2a0bd1[_0xa2fd('0x3f')]};return db[_0xa2fd('0x30')]['count'](_0x3ed87e)[_0xa2fd('0x2c')](function(_0x43798a){_0x578577[_0xa2fd('0x24')]=_0x43798a;if(_0x98a5c3[_0xa2fd('0x35')][_0xa2fd('0x44')]){_0x2a0bd1[_0xa2fd('0x45')]=[{'all':!![]}];}return db[_0xa2fd('0x30')][_0xa2fd('0x46')](_0x2a0bd1);})['then'](function(_0x513b58){_0x578577[_0xa2fd('0x47')]=_0x513b58;return _0x578577;})[_0xa2fd('0x2c')](respondWithFilteredResult(_0x96e2e4,_0x2a0bd1))[_0xa2fd('0x48')](handleError(_0x96e2e4,null));};exports[_0xa2fd('0x49')]=function(_0x54522c,_0x368131){var _0x3cfc33={'raw':![],'where':{'id':_0x54522c['params']['id']}},_0x29366e={};_0x29366e[_0xa2fd('0x33')]=_['keys'](db['Setting'][_0xa2fd('0x31')]);_0x29366e[_0xa2fd('0x35')]=_[_0xa2fd('0x4a')](_0x54522c['query']);_0x29366e[_0xa2fd('0x36')]=_[_0xa2fd('0x37')](_0x29366e[_0xa2fd('0x33')],_0x29366e[_0xa2fd('0x35')]);_0x3cfc33[_0xa2fd('0x38')]=_['intersection'](_0x29366e['model'],qs[_0xa2fd('0x39')](_0x54522c[_0xa2fd('0x35')]['fields']));_0x3cfc33[_0xa2fd('0x38')]=_0x3cfc33[_0xa2fd('0x38')][_0xa2fd('0x3a')]?_0x3cfc33[_0xa2fd('0x38')]:_0x29366e[_0xa2fd('0x33')];if(_0x54522c['query']['includeAll']){_0x3cfc33[_0xa2fd('0x45')]=[{'all':!![]}];}_0x3cfc33=_[_0xa2fd('0x42')]({},_0x3cfc33,_0x54522c[_0xa2fd('0x43')]);return db[_0xa2fd('0x30')][_0xa2fd('0x4b')](_0x3cfc33)['then'](handleEntityNotFound(_0x368131,null))['then'](respondWithResult(_0x368131,null))[_0xa2fd('0x48')](handleError(_0x368131,null));};exports[_0xa2fd('0x2b')]=function(_0x4a260c,_0x1ba7b7){if(_0x4a260c[_0xa2fd('0x4c')]['id']){delete _0x4a260c[_0xa2fd('0x4c')]['id'];}return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x4a260c[_0xa2fd('0x4d')]['id']}})[_0xa2fd('0x2c')](handleEntityNotFound(_0x1ba7b7,null))[_0xa2fd('0x2c')](saveUpdates(_0x4a260c[_0xa2fd('0x4c')],null))[_0xa2fd('0x2c')](respondWithResult(_0x1ba7b7,null))[_0xa2fd('0x48')](handleError(_0x1ba7b7,null));};exports['addLogo']=function(_0x2af0aa,_0x1ee688,_0x1585b0){if(_0x2af0aa[_0xa2fd('0x4e')]&&_0x2af0aa[_0xa2fd('0x4e')][_0xa2fd('0x4f')]){_0x2af0aa[_0xa2fd('0x4c')][_0xa2fd('0x50')]=_0x2af0aa[_0xa2fd('0x4e')][_0xa2fd('0x4f')];}return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x2af0aa[_0xa2fd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ee688,null))[_0xa2fd('0x2c')](saveUpdates(_0x2af0aa['body'],null))[_0xa2fd('0x2c')](respondWithResult(_0x1ee688,null))['catch'](handleError(_0x1ee688,null));};exports[_0xa2fd('0x51')]=function(_0x470c71,_0x35f522,_0x35b400){if(_0x470c71[_0xa2fd('0x4e')]&&_0x470c71['file'][_0xa2fd('0x4f')]){_0x470c71['body'][_0xa2fd('0x52')]=_0x470c71['file'][_0xa2fd('0x4f')];}return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x470c71['params']['id']}})[_0xa2fd('0x2c')](handleEntityNotFound(_0x35f522,null))[_0xa2fd('0x2c')](saveUpdates(_0x470c71[_0xa2fd('0x4c')],null))[_0xa2fd('0x2c')](respondWithResult(_0x35f522,null))[_0xa2fd('0x48')](handleError(_0x35f522,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x162605,_0x41765f,_0x550743){var _0x5b49d5=_0xa2fd('0x53');var _0x3caa72={'custom':![]};return utilLicense[_0xa2fd('0x54')]()[_0xa2fd('0x2c')](function(_0xb92047){if(_0xb92047){_0x3caa72=_0xb92047;}return db[_0xa2fd('0x30')]['find']({'where':{'id':_0x162605[_0xa2fd('0x4d')]['id']},'attributes':[_0xa2fd('0x50'),_0xa2fd('0x52'),_0xa2fd('0x55'),_0xa2fd('0x56'),_0xa2fd('0x57'),_0xa2fd('0x58'),_0xa2fd('0x59'),_0xa2fd('0x5a')],'raw':!![]});})[_0xa2fd('0x2c')](handleEntityNotFound(_0x41765f,null))[_0xa2fd('0x2c')](function(_0x6648d6){if(_0x6648d6){var _0x55eb11=_0x6648d6[_0xa2fd('0x50')]&&fs[_0xa2fd('0x5b')](path[_0xa2fd('0x5c')](config['root'],_0x5b49d5,_[_0xa2fd('0x5d')](_0x6648d6[_0xa2fd('0x50')])))?path['join'](config[_0xa2fd('0x5e')],_0x5b49d5,_[_0xa2fd('0x5d')](_0x6648d6[_0xa2fd('0x50')])):path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x5b49d5,_[_0xa2fd('0x5d')](_0xa2fd('0x5f')));var _0x41f996='default'+_[_0xa2fd('0x60')](_0xa2fd('0x50'));if(_0x6648d6[_0x41f996]||!_0x3caa72[_0xa2fd('0x61')]){_0x55eb11=path[_0xa2fd('0x5c')](config['root'],_0x5b49d5,_['toLower']('default_logo.svg'));}if(!fs[_0xa2fd('0x5b')](_0x55eb11)){throw new db[(_0xa2fd('0x62'))][(_0xa2fd('0x63'))](_['upperFirst'](_0xa2fd('0x50'))+_0xa2fd('0x64'));}return _0x41765f['download'](_0x55eb11);}})[_0xa2fd('0x48')](handleError(_0x41765f,null));};var utilLicense=require(_0xa2fd('0x65'));exports[_0xa2fd('0x66')]=function(_0x46cd21,_0x501ebe,_0x1637ba){var _0x3e9b5e=_0xa2fd('0x53');var _0x3ab5c5={'custom':![]};return utilLicense[_0xa2fd('0x54')]()[_0xa2fd('0x2c')](function(_0x5ef99a){if(_0x5ef99a){_0x3ab5c5=_0x5ef99a;}return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x46cd21[_0xa2fd('0x4d')]['id']},'attributes':['logo','loginLogo',_0xa2fd('0x55'),_0xa2fd('0x56'),_0xa2fd('0x57'),_0xa2fd('0x58'),_0xa2fd('0x59'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x501ebe,null))[_0xa2fd('0x2c')](function(_0x5f5a75){if(_0x5f5a75){var _0x247d64=_0x5f5a75[_0xa2fd('0x52')]&&fs[_0xa2fd('0x5b')](path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x3e9b5e,_['toLower'](_0x5f5a75[_0xa2fd('0x52')])))?path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x3e9b5e,_[_0xa2fd('0x5d')](_0x5f5a75['loginLogo'])):path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x3e9b5e,_[_0xa2fd('0x5d')](_0xa2fd('0x67')));var _0x2a7ca3='default'+_[_0xa2fd('0x60')](_0xa2fd('0x52'));if(_0x5f5a75[_0x2a7ca3]||!_0x3ab5c5['custom']){_0x247d64=path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x3e9b5e,_[_0xa2fd('0x5d')](_0xa2fd('0x67')));}if(!fs[_0xa2fd('0x5b')](_0x247d64)){throw new db[(_0xa2fd('0x62'))][(_0xa2fd('0x63'))](_['upperFirst']('loginLogo')+'\x20not\x20found');}return _0x501ebe[_0xa2fd('0x68')](_0x247d64);}})[_0xa2fd('0x48')](handleError(_0x501ebe,null));};exports[_0xa2fd('0x69')]=function(_0x19d006,_0x96c8b3){return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x19d006[_0xa2fd('0x4d')]['id']},'attributes':[_0xa2fd('0x6a')]})[_0xa2fd('0x2c')](respondWithResult(_0x96c8b3,null))[_0xa2fd('0x48')](handleError(_0x96c8b3,null));};exports[_0xa2fd('0x6b')]=function(_0x1fc3cc,_0x3846e2,_0x547714){if(_0x1fc3cc['file']&&_0x1fc3cc[_0xa2fd('0x4e')][_0xa2fd('0x4f')]){_0x1fc3cc['body']['preferred']=_0x1fc3cc[_0xa2fd('0x4e')]['filename'];}return db['Setting'][_0xa2fd('0x4b')]({'where':{'id':_0x1fc3cc[_0xa2fd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3846e2,null))[_0xa2fd('0x2c')](saveUpdates(_0x1fc3cc[_0xa2fd('0x4c')],null))[_0xa2fd('0x2c')](respondWithResult(_0x3846e2,null))[_0xa2fd('0x48')](handleError(_0x3846e2,null));};var utilLicense=require(_0xa2fd('0x65'));exports[_0xa2fd('0x6c')]=function(_0x1f98fc,_0x1ab5d5,_0x5aef08){var _0x43ed20=_0xa2fd('0x53');var _0x4e10ad={'custom':![]};return utilLicense[_0xa2fd('0x54')]()['then'](function(_0x39979a){if(_0x39979a){_0x4e10ad=_0x39979a;}return db['Setting'][_0xa2fd('0x4b')]({'where':{'id':_0x1f98fc[_0xa2fd('0x4d')]['id']},'attributes':[_0xa2fd('0x50'),'loginLogo',_0xa2fd('0x55'),'favicon',_0xa2fd('0x57'),_0xa2fd('0x58'),_0xa2fd('0x59'),_0xa2fd('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x1ab5d5,null))[_0xa2fd('0x2c')](function(_0x10d049){if(_0x10d049){var _0x4584f7=_0x10d049[_0xa2fd('0x55')]&&fs[_0xa2fd('0x5b')](path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x43ed20,_[_0xa2fd('0x5d')](_0x10d049[_0xa2fd('0x55')])))?path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x43ed20,_[_0xa2fd('0x5d')](_0x10d049[_0xa2fd('0x55')])):path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x43ed20,_['toLower'](_0xa2fd('0x6d')));var _0x3913a0='default'+_[_0xa2fd('0x60')]('preferred');if(_0x10d049[_0x3913a0]||!_0x4e10ad[_0xa2fd('0x61')]||!_0x4e10ad[_0xa2fd('0x55')]){_0x4584f7=path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x43ed20,_[_0xa2fd('0x5d')]('default_preferred.png'));}if(!fs[_0xa2fd('0x5b')](_0x4584f7)){throw new db['Sequelize'][(_0xa2fd('0x63'))](_[_0xa2fd('0x60')]('preferred')+_0xa2fd('0x64'));}return _0x1ab5d5[_0xa2fd('0x68')](_0x4584f7);}})[_0xa2fd('0x48')](handleError(_0x1ab5d5,null));};exports[_0xa2fd('0x6e')]=function(_0x34de2d,_0x916a94,_0x4f93e5){if(_0x34de2d[_0xa2fd('0x4e')]&&_0x34de2d[_0xa2fd('0x4e')][_0xa2fd('0x4f')]){_0x34de2d[_0xa2fd('0x4c')][_0xa2fd('0x56')]=_0x34de2d[_0xa2fd('0x4e')][_0xa2fd('0x4f')];}return db['Setting'][_0xa2fd('0x4b')]({'where':{'id':_0x34de2d[_0xa2fd('0x4d')]['id']}})[_0xa2fd('0x2c')](handleEntityNotFound(_0x916a94,null))[_0xa2fd('0x2c')](saveUpdates(_0x34de2d['body'],null))[_0xa2fd('0x2c')](respondWithResult(_0x916a94,null))[_0xa2fd('0x48')](handleError(_0x916a94,null));};var utilLicense=require(_0xa2fd('0x65'));exports[_0xa2fd('0x6f')]=function(_0x14a44a,_0x26bb94,_0x4abd80){var _0x41ff87='server/files/images/logos';var _0x496cd9={'custom':![]};return utilLicense[_0xa2fd('0x54')]()[_0xa2fd('0x2c')](function(_0x44bbf3){if(_0x44bbf3){_0x496cd9=_0x44bbf3;}return db[_0xa2fd('0x30')][_0xa2fd('0x4b')]({'where':{'id':_0x14a44a[_0xa2fd('0x4d')]['id']},'attributes':[_0xa2fd('0x50'),_0xa2fd('0x52'),'preferred',_0xa2fd('0x56'),'defaultLogo',_0xa2fd('0x58'),_0xa2fd('0x59'),_0xa2fd('0x5a')],'raw':!![]});})[_0xa2fd('0x2c')](handleEntityNotFound(_0x26bb94,null))['then'](function(_0x5b0ad5){if(_0x5b0ad5){var _0x1022c4=_0x5b0ad5[_0xa2fd('0x56')]&&fs[_0xa2fd('0x5b')](path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x41ff87,_[_0xa2fd('0x5d')](_0x5b0ad5['favicon'])))?path['join'](config['root'],_0x41ff87,_['toLower'](_0x5b0ad5[_0xa2fd('0x56')])):path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x41ff87,_['toLower'](_0xa2fd('0x70')));var _0x100d6d=_0xa2fd('0x71')+_[_0xa2fd('0x60')](_0xa2fd('0x56'));if(_0x5b0ad5[_0x100d6d]||!_0x496cd9['custom']){_0x1022c4=path[_0xa2fd('0x5c')](config[_0xa2fd('0x5e')],_0x41ff87,_[_0xa2fd('0x5d')]('default_favicon.ico'));}if(!fs[_0xa2fd('0x5b')](_0x1022c4)){throw new db[(_0xa2fd('0x62'))][(_0xa2fd('0x63'))](_[_0xa2fd('0x60')](_0xa2fd('0x56'))+_0xa2fd('0x64'));}return _0x26bb94[_0xa2fd('0x68')](_0x1022c4);}})[_0xa2fd('0x48')](handleError(_0x26bb94,null));};exports['getDate']=function(_0x5e782e,_0x1bd495){var _0x5e249e={'offset':moment()[_0xa2fd('0x72')]()};_0x5e249e[_0xa2fd('0x73')]=moment()[_0xa2fd('0x72')](_0x5e249e[_0xa2fd('0x22')])[_0xa2fd('0x74')](_0xa2fd('0x75'));return _0x1bd495[_0xa2fd('0x20')](0xc8)[_0xa2fd('0x76')](_0x5e249e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 02c2274..65acfab 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x55ca,0x126));var _0xa55c=function(_0x513254,_0x1305ca){_0x513254=_0x513254-0x0;var _0x384c92=_0x55ca[_0x513254];return _0x384c92;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0x008c,0x188));var _0xc008=function(_0x3c9c4d,_0x1a2ef0){_0x3c9c4d=_0x3c9c4d-0x0;var _0x189ec2=_0x008c[_0x3c9c4d];return _0x189ec2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index e48dc15..03f700a 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 _0x16c5=['request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','ShowSetting','Setting','options','where','attributes','include','map','model','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3694af,_0x2a4dd3){var _0x4118e0=function(_0x4e93d8){while(--_0x4e93d8){_0x3694af['push'](_0x3694af['shift']());}};_0x4118e0(++_0x2a4dd3);}(_0x16c5,0x1c3));var _0x516c=function(_0x1e5f9c,_0x315418){_0x1e5f9c=_0x1e5f9c-0x0;var _0x286a62=_0x16c5[_0x1e5f9c];return _0x286a62;};'use strict';var _=require(_0x516c('0x0'));var util=require(_0x516c('0x1'));var moment=require(_0x516c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x516c('0x3'));var db=require(_0x516c('0x4'))['db'];var utils=require(_0x516c('0x5'));var logger=require(_0x516c('0x6'))(_0x516c('0x7'));var config=require(_0x516c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x516c('0x9')][_0x516c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1764a7,_0x2b430f,_0x22bae2){return new BPromise(function(_0x5f3c1d,_0x15b768){return client[_0x516c('0xb')](_0x1764a7,_0x22bae2)[_0x516c('0xc')](function(_0x44bead){logger[_0x516c('0xd')]('Setting,\x20%s,\x20%s',_0x2b430f,_0x516c('0xe'));logger['debug'](_0x516c('0xf'),_0x2b430f,_0x516c('0xe'),JSON[_0x516c('0x10')](_0x44bead));if(_0x44bead[_0x516c('0x11')]){if(_0x44bead[_0x516c('0x11')]['code']===0x1f4){logger[_0x516c('0x11')]('Setting,\x20%s,\x20%s',_0x2b430f,_0x44bead['error'][_0x516c('0x12')]);return _0x15b768(_0x44bead[_0x516c('0x11')]['message']);}logger[_0x516c('0x11')](_0x516c('0x13'),_0x2b430f,_0x44bead[_0x516c('0x11')][_0x516c('0x12')]);return _0x5f3c1d(_0x44bead[_0x516c('0x11')][_0x516c('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x2b430f,_0x516c('0xe'));_0x5f3c1d(_0x44bead[_0x516c('0x14')][_0x516c('0x12')]);}})[_0x516c('0x15')](function(_0x2864ac){logger['error'](_0x516c('0x13'),_0x2b430f,_0x2864ac);_0x15b768(_0x2864ac);});});}exports[_0x516c('0x16')]=function(_0x527b5c){var _0x32f64f=this;return new Promise(function(_0x4db17d,_0x27a7dc){return db[_0x516c('0x17')]['find']({'raw':_0x527b5c[_0x516c('0x18')]?_0x527b5c[_0x516c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x527b5c[_0x516c('0x18')]?_0x527b5c[_0x516c('0x18')][_0x516c('0x19')]||null:null,'attributes':_0x527b5c[_0x516c('0x18')]?_0x527b5c['options'][_0x516c('0x1a')]||null:null,'include':_0x527b5c[_0x516c('0x18')]?_0x527b5c[_0x516c('0x18')][_0x516c('0x1b')]?_[_0x516c('0x1c')](_0x527b5c[_0x516c('0x18')][_0x516c('0x1b')],function(_0x1c79a0){return{'model':db[_0x1c79a0[_0x516c('0x1d')]],'as':_0x1c79a0['as'],'attributes':_0x1c79a0[_0x516c('0x1a')],'include':_0x1c79a0['include']?_[_0x516c('0x1c')](_0x1c79a0['include'],function(_0x128da9){return{'model':db[_0x128da9[_0x516c('0x1d')]],'as':_0x128da9['as'],'attributes':_0x128da9[_0x516c('0x1a')],'include':_0x128da9[_0x516c('0x1b')]?_[_0x516c('0x1c')](_0x128da9[_0x516c('0x1b')],function(_0x38d08b){return{'model':db[_0x38d08b[_0x516c('0x1d')]],'as':_0x38d08b['as'],'attributes':_0x38d08b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18e8e9){logger[_0x516c('0xd')]('ShowSetting',_0x527b5c);logger[_0x516c('0x1e')](_0x516c('0x16'),_0x527b5c,JSON[_0x516c('0x10')](_0x18e8e9));_0x4db17d(_0x18e8e9);})[_0x516c('0x15')](function(_0x56343f){logger[_0x516c('0x11')](_0x516c('0x16'),_0x56343f[_0x516c('0x12')],_0x527b5c);_0x27a7dc(_0x32f64f[_0x516c('0x11')](0x1f4,_0x56343f[_0x516c('0x12')]));});});}; \ No newline at end of file +var _0xb809=['ShowSetting','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','find','options','raw','include','model','attributes','map','then'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xb809,0x1e2));var _0x9b80=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xb809[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0x9b80('0x0'));var util=require(_0x9b80('0x1'));var moment=require(_0x9b80('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b80('0x3'));var fs=require('fs');var Redis=require(_0x9b80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b80('0x5'));var logger=require('../../config/logger')(_0x9b80('0x6'));var config=require(_0x9b80('0x7'));var jayson=require(_0x9b80('0x8'));var client=jayson[_0x9b80('0x9')][_0x9b80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x355e9f,_0x147cf4,_0x3558e0){return new BPromise(function(_0x85940e,_0x257376){return client[_0x9b80('0xb')](_0x355e9f,_0x3558e0)['then'](function(_0x46f0dc){logger[_0x9b80('0xc')](_0x9b80('0xd'),_0x147cf4,_0x9b80('0xe'));logger['debug'](_0x9b80('0xf'),_0x147cf4,_0x9b80('0xe'),JSON['stringify'](_0x46f0dc));if(_0x46f0dc[_0x9b80('0x10')]){if(_0x46f0dc[_0x9b80('0x10')][_0x9b80('0x11')]===0x1f4){logger[_0x9b80('0x10')](_0x9b80('0xd'),_0x147cf4,_0x46f0dc['error'][_0x9b80('0x12')]);return _0x257376(_0x46f0dc[_0x9b80('0x10')][_0x9b80('0x12')]);}logger[_0x9b80('0x10')]('Setting,\x20%s,\x20%s',_0x147cf4,_0x46f0dc[_0x9b80('0x10')][_0x9b80('0x12')]);return _0x85940e(_0x46f0dc['error']['message']);}else{logger[_0x9b80('0xc')]('Setting,\x20%s,\x20%s',_0x147cf4,_0x9b80('0xe'));_0x85940e(_0x46f0dc['result']['message']);}})[_0x9b80('0x13')](function(_0x5dffff){logger['error'](_0x9b80('0xd'),_0x147cf4,_0x5dffff);_0x257376(_0x5dffff);});});}exports['ShowSetting']=function(_0x361ea5){var _0x2937df=this;return new Promise(function(_0x3ab76f,_0x4bcb61){return db['Setting'][_0x9b80('0x14')]({'raw':_0x361ea5[_0x9b80('0x15')]?_0x361ea5[_0x9b80('0x15')][_0x9b80('0x16')]===undefined?!![]:![]:!![],'where':_0x361ea5[_0x9b80('0x15')]?_0x361ea5[_0x9b80('0x15')]['where']||null:null,'attributes':_0x361ea5[_0x9b80('0x15')]?_0x361ea5[_0x9b80('0x15')]['attributes']||null:null,'include':_0x361ea5[_0x9b80('0x15')]?_0x361ea5[_0x9b80('0x15')][_0x9b80('0x17')]?_['map'](_0x361ea5[_0x9b80('0x15')][_0x9b80('0x17')],function(_0x1fb7d7){return{'model':db[_0x1fb7d7[_0x9b80('0x18')]],'as':_0x1fb7d7['as'],'attributes':_0x1fb7d7[_0x9b80('0x19')],'include':_0x1fb7d7[_0x9b80('0x17')]?_[_0x9b80('0x1a')](_0x1fb7d7['include'],function(_0x1c5a6e){return{'model':db[_0x1c5a6e[_0x9b80('0x18')]],'as':_0x1c5a6e['as'],'attributes':_0x1c5a6e[_0x9b80('0x19')],'include':_0x1c5a6e[_0x9b80('0x17')]?_[_0x9b80('0x1a')](_0x1c5a6e[_0x9b80('0x17')],function(_0x264591){return{'model':db[_0x264591[_0x9b80('0x18')]],'as':_0x264591['as'],'attributes':_0x264591[_0x9b80('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9b80('0x1b')](function(_0x26d991){logger[_0x9b80('0xc')](_0x9b80('0x1c'),_0x361ea5);logger[_0x9b80('0x1d')](_0x9b80('0x1c'),_0x361ea5,JSON['stringify'](_0x26d991));_0x3ab76f(_0x26d991);})['catch'](function(_0x1bb359){logger[_0x9b80('0x10')](_0x9b80('0x1c'),_0x1bb359[_0x9b80('0x12')],_0x361ea5);_0x4bcb61(_0x2937df['error'](0x1f4,_0x1bb359[_0x9b80('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e5b98da..547dfef 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4f6959,_0x116ca1){_0x4f6959=_0x4f6959-0x0;var _0x33d978=_0x1cb9[_0x4f6959];return _0x33d978;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'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['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 627fc11..4e6ef88 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 _0x4cd9=['clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate','ENUM','twilio','skebby','connectel'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x4cd9,0x111));var _0x94cd=function(_0x4bde1e,_0x2b957e){_0x4bde1e=_0x4bde1e-0x0;var _0x787b7=_0x4cd9[_0x4bde1e];return _0x787b7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x94cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x94cd('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x94cd('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x94cd('0x2')]();}},'phone':{'type':Sequelize[_0x94cd('0x1')]},'type':{'type':Sequelize[_0x94cd('0x3')](_0x94cd('0x4'),_0x94cd('0x5'),_0x94cd('0x6'),_0x94cd('0x7'),_0x94cd('0x8'),_0x94cd('0x9'),_0x94cd('0xa'),_0x94cd('0xb'),_0x94cd('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0x94cd('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x94cd('0x1')]},'smsMethod':{'type':Sequelize[_0x94cd('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x94cd('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x94cd('0x1')]},'applicationId':{'type':Sequelize[_0x94cd('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x94cd('0x1')]},'deliveryReport':{'type':Sequelize[_0x94cd('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x94cd('0x1')]},'notificationTemplate':{'type':Sequelize[_0x94cd('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x94cd('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94cd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x94cd('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x94cd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x94cd('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94cd('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x94cd('0xd')],'defaultValue':![],'comment':_0x94cd('0x10'),'set':function(_0x405b57){if(!_0x405b57)this[_0x94cd('0x11')](_0x94cd('0x12'),null);this['setDataValue'](_0x94cd('0x13'),_0x405b57);}}}; \ No newline at end of file +var _0x03d3=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2af965,_0x248cba){var _0x4d1db0=function(_0x26e7eb){while(--_0x26e7eb){_0x2af965['push'](_0x2af965['shift']());}};_0x4d1db0(++_0x248cba);}(_0x03d3,0xd2));var _0x303d=function(_0x3d5aa,_0x3ee846){_0x3d5aa=_0x3d5aa-0x0;var _0x570dad=_0x03d3[_0x3d5aa];return _0x570dad;};'use strict';var Sequelize=require(_0x303d('0x0'));var rs=require('randomstring');module[_0x303d('0x1')]={'name':{'type':Sequelize[_0x303d('0x2')],'unique':_0x303d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x303d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x303d('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x303d('0x4')]();}},'phone':{'type':Sequelize[_0x303d('0x2')]},'type':{'type':Sequelize['ENUM'](_0x303d('0x5'),_0x303d('0x6'),_0x303d('0x7'),_0x303d('0x8'),_0x303d('0x9'),_0x303d('0xa'),_0x303d('0xb'),_0x303d('0xc'),_0x303d('0xd'),_0x303d('0xe'))},'accountSid':{'type':Sequelize[_0x303d('0x2')]},'authId':{'type':Sequelize[_0x303d('0x2')]},'authToken':{'type':Sequelize[_0x303d('0x2')]},'smsMethod':{'type':Sequelize[_0x303d('0xf')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x303d('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x303d('0x2')]},'accountId':{'type':Sequelize[_0x303d('0x2')]},'senderString':{'type':Sequelize[_0x303d('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x303d('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x303d('0x10');}},'notificationSound':{'type':Sequelize[_0x303d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x303d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x303d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x303d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x303d('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x303d('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x303d('0x12')],'comment':_0x303d('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x303d('0x11')],'defaultValue':![],'comment':_0x303d('0x14'),'set':function(_0x5c09f0){if(!_0x5c09f0)this[_0x303d('0x15')](_0x303d('0x16'),null);this[_0x303d('0x15')]('mandatoryDisposition',_0x5c09f0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c436920..94d4b43 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 _0x1ff2=['Contact','Owner','fullname','internal','Tag','Tags','tag','List','DESC','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','clicksend','status_code','groupName','intelepeer','redif','DELIVERED','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','rows','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','type','from','Body','messageId','MessageSid','skebby','text','connectel','message_id','plivo','From','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Sequelize','CmList','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions'];(function(_0x1c0317,_0xe5db44){var _0x4b1632=function(_0x57ef03){while(--_0x57ef03){_0x1c0317['push'](_0x1c0317['shift']());}};_0x4b1632(++_0xe5db44);}(_0x1ff2,0x1eb));var _0x21ff=function(_0x2156ce,_0x54b939){_0x2156ce=_0x2156ce-0x0;var _0x38914b=_0x1ff2[_0x2156ce];return _0x38914b;};'use strict';var emlformat=require(_0x21ff('0x0'));var rimraf=require(_0x21ff('0x1'));var zipdir=require(_0x21ff('0x2'));var jsonpatch=require(_0x21ff('0x3'));var rp=require(_0x21ff('0x4'));var moment=require(_0x21ff('0x5'));var BPromise=require(_0x21ff('0x6'));var Mustache=require(_0x21ff('0x7'));var util=require(_0x21ff('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21ff('0x9'));var fs=require('fs');var fs_extra=require(_0x21ff('0xa'));var _=require(_0x21ff('0xb'));var squel=require(_0x21ff('0xc'));var crypto=require(_0x21ff('0xd'));var jsforce=require(_0x21ff('0xe'));var deskjs=require(_0x21ff('0xf'));var toCsv=require(_0x21ff('0x10'));var querystring=require('querystring');var Papa=require(_0x21ff('0x11'));var Redis=require(_0x21ff('0x12'));var authService=require(_0x21ff('0x13'));var qs=require(_0x21ff('0x14'));var as=require(_0x21ff('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21ff('0x16'))(_0x21ff('0x17'));var utils=require(_0x21ff('0x18'));var config=require(_0x21ff('0x19'));var licenseUtil=require(_0x21ff('0x1a'));var db=require(_0x21ff('0x1b'))['db'];config[_0x21ff('0x1c')]=_[_0x21ff('0x1d')](config[_0x21ff('0x1c')],{'host':_0x21ff('0x1e'),'port':0x18eb});var socket=require(_0x21ff('0x1f'))(new Redis(config[_0x21ff('0x1c')]));require(_0x21ff('0x20'))[_0x21ff('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x21ff('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x29d0fd,_0x2b3836,_0x5e3e4a,_0xe5088f){return new BPromise(function(_0x4735d9,_0x35f367){var _0x37e11a=_0xe5088f||client;return _0x37e11a['request'](_0x29d0fd,_0x5e3e4a)['then'](function(_0x51ea06){logger[_0x21ff('0x23')](_0x21ff('0x24'),_0x2b3836,_0x21ff('0x25'));logger[_0x21ff('0x26')](_0x21ff('0x27'),_0x2b3836,_0x21ff('0x25'),JSON['stringify'](_0x51ea06));if(_0x51ea06[_0x21ff('0x28')]){if(_0x51ea06[_0x21ff('0x28')][_0x21ff('0x29')]===0x1f4){logger[_0x21ff('0x28')](_0x21ff('0x24'),_0x2b3836,_0x51ea06['error'][_0x21ff('0x2a')]);return _0x35f367(_0x51ea06['error'][_0x21ff('0x2a')]);}logger[_0x21ff('0x28')](_0x21ff('0x24'),_0x2b3836,_0x51ea06[_0x21ff('0x28')][_0x21ff('0x2a')]);return _0x4735d9(_0x51ea06[_0x21ff('0x28')][_0x21ff('0x2a')]);}else{logger[_0x21ff('0x23')](_0x21ff('0x24'),_0x2b3836,'request\x20sent');_0x4735d9(_0x51ea06[_0x21ff('0x2b')]['message']);}})[_0x21ff('0x2c')](function(_0x1c9cf9){logger[_0x21ff('0x28')](_0x21ff('0x24'),_0x2b3836,_0x1c9cf9);_0x35f367(_0x1c9cf9);});});}function respondWithStatusCode(_0x3066fe,_0x4b5871){_0x4b5871=_0x4b5871||0xcc;return function(_0x89508b){if(_0x89508b){return _0x3066fe[_0x21ff('0x2d')](_0x4b5871);}return _0x3066fe['status'](_0x4b5871)[_0x21ff('0x2e')]();};}function respondWithResult(_0x4901fd,_0x5d2260){_0x5d2260=_0x5d2260||0xc8;return function(_0xc792b0){if(_0xc792b0){return _0x4901fd[_0x21ff('0x2f')](_0x5d2260)[_0x21ff('0x30')](_0xc792b0);}};}function respondWithFilteredResult(_0x4ad55d,_0x4ef297){return function(_0x5b2329){if(_0x5b2329){var _0x2f80e1=typeof _0x4ef297[_0x21ff('0x31')]===_0x21ff('0x32')&&typeof _0x4ef297[_0x21ff('0x33')]==='undefined';var _0x2a492f=_0x5b2329[_0x21ff('0x34')];var _0xde0b43=_0x2f80e1?0x0:_0x4ef297[_0x21ff('0x31')];var _0x11dbd8=_0x2f80e1?_0x5b2329['count']:_0x4ef297[_0x21ff('0x31')]+_0x4ef297[_0x21ff('0x33')];var _0xda08b4;if(_0x11dbd8>=_0x2a492f){_0x11dbd8=_0x2a492f;_0xda08b4=0xc8;}else{_0xda08b4=0xce;}_0x4ad55d['status'](_0xda08b4);return _0x4ad55d[_0x21ff('0x35')](_0x21ff('0x36'),_0xde0b43+'-'+_0x11dbd8+'/'+_0x2a492f)[_0x21ff('0x30')](_0x5b2329);}return null;};}function patchUpdates(_0x1d5b89){return function(_0x194c05){try{jsonpatch['apply'](_0x194c05,_0x1d5b89,!![]);}catch(_0x156c7e){return BPromise[_0x21ff('0x37')](_0x156c7e);}return _0x194c05['save']();};}function saveUpdates(_0x358118,_0x4f180a){return function(_0x5d6890){if(_0x5d6890){return _0x5d6890[_0x21ff('0x38')](_0x358118)[_0x21ff('0x39')](function(_0x5731e1){return _0x5731e1;});}return null;};}function removeEntity(_0x56d565,_0x1d4227){return function(_0x4f0f4e){if(_0x4f0f4e){return _0x4f0f4e[_0x21ff('0x3a')]()['then'](function(){var _0x5d070a=_0x4f0f4e[_0x21ff('0x3b')]({'plain':!![]});var _0x1d8652='SmsAccounts';return db['UserProfileResource'][_0x21ff('0x3a')]({'where':{'type':_0x1d8652,'resourceId':_0x5d070a['id']}})[_0x21ff('0x39')](function(){return _0x4f0f4e;});})['then'](function(){_0x56d565[_0x21ff('0x2f')](0xcc)[_0x21ff('0x2e')]();});}};}function handleEntityNotFound(_0x43f063,_0x291265){return function(_0x2283b6){if(!_0x2283b6){_0x43f063['sendStatus'](0x194);}return _0x2283b6;};}function handleError(_0xbca21b,_0x34fc8a){_0x34fc8a=_0x34fc8a||0x1f4;return function(_0x51bfec){logger[_0x21ff('0x28')](_0x51bfec[_0x21ff('0x3c')]);if(_0x51bfec[_0x21ff('0x3d')]){delete _0x51bfec[_0x21ff('0x3d')];}_0xbca21b[_0x21ff('0x2f')](_0x34fc8a)[_0x21ff('0x3e')](_0x51bfec);};}exports[_0x21ff('0x3f')]=function(_0x1fd3f9,_0x3a6558){var _0x552b21={'include':[{'model':db[_0x21ff('0x40')],'as':_0x21ff('0x41')}]},_0x9a9d93={},_0x122ea9={'count':0x0,'rows':[]};var _0x4d7c3e=_[_0x21ff('0x42')](db[_0x21ff('0x43')][_0x21ff('0x44')],function(_0x3189cc){return{'name':_0x3189cc['fieldName'],'type':_0x3189cc['type']['key']};});_0x9a9d93[_0x21ff('0x45')]=_[_0x21ff('0x42')](_0x4d7c3e,_0x21ff('0x3d'));_0x9a9d93[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x1fd3f9[_0x21ff('0x46')]);_0x9a9d93['filters']=_['intersection'](_0x9a9d93['model'],_0x9a9d93[_0x21ff('0x46')]);_0x552b21[_0x21ff('0x48')]=_['intersection'](_0x9a9d93[_0x21ff('0x45')],qs[_0x21ff('0x49')](_0x1fd3f9[_0x21ff('0x46')][_0x21ff('0x49')]));_0x552b21[_0x21ff('0x48')]=_0x552b21[_0x21ff('0x48')][_0x21ff('0x4a')]?_0x552b21['attributes']:_0x9a9d93['model'];if(!_0x1fd3f9['query'][_0x21ff('0x4b')](_0x21ff('0x4c'))){_0x552b21['limit']=qs[_0x21ff('0x33')](_0x1fd3f9[_0x21ff('0x46')][_0x21ff('0x33')]);_0x552b21['offset']=qs[_0x21ff('0x31')](_0x1fd3f9[_0x21ff('0x46')]['offset']);}_0x552b21[_0x21ff('0x4d')]=qs['sort'](_0x1fd3f9[_0x21ff('0x46')][_0x21ff('0x4e')]);_0x552b21[_0x21ff('0x4f')]=qs[_0x21ff('0x50')](_['pick'](_0x1fd3f9[_0x21ff('0x46')],_0x9a9d93[_0x21ff('0x50')]),_0x4d7c3e);if(_0x1fd3f9['query']['filter']){_0x552b21[_0x21ff('0x4f')]=_[_0x21ff('0x51')](_0x552b21[_0x21ff('0x4f')],{'$or':_[_0x21ff('0x42')](_0x4d7c3e,function(_0x219ac9){if(_0x219ac9['type']!==_0x21ff('0x52')){var _0x2a69a6={};_0x2a69a6[_0x219ac9[_0x21ff('0x3d')]]={'$like':'%'+_0x1fd3f9[_0x21ff('0x46')][_0x21ff('0x53')]+'%'};return _0x2a69a6;}})});}_0x552b21=_[_0x21ff('0x51')]({},_0x552b21,_0x1fd3f9[_0x21ff('0x54')]);var _0x1f682e={'where':_0x552b21[_0x21ff('0x4f')]};return db[_0x21ff('0x43')]['count'](_0x1f682e)[_0x21ff('0x39')](function(_0xb98703){_0x122ea9[_0x21ff('0x34')]=_0xb98703;if(_0x1fd3f9[_0x21ff('0x46')][_0x21ff('0x55')]){_0x552b21['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x552b21);})['then'](function(_0x35ff86){_0x122ea9[_0x21ff('0x56')]=_0x35ff86;return _0x122ea9;})[_0x21ff('0x39')](respondWithFilteredResult(_0x3a6558,_0x552b21))[_0x21ff('0x2c')](handleError(_0x3a6558,null));};exports[_0x21ff('0x57')]=function(_0x40e9b7,_0x534e79){var _0x1cc9fb={'raw':![],'where':{'id':_0x40e9b7[_0x21ff('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x21ff('0x41')}]},_0x54cd21={};_0x54cd21[_0x21ff('0x45')]=_[_0x21ff('0x47')](db[_0x21ff('0x43')]['rawAttributes']);_0x54cd21[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x40e9b7['query']);_0x54cd21['filters']=_[_0x21ff('0x59')](_0x54cd21[_0x21ff('0x45')],_0x54cd21[_0x21ff('0x46')]);_0x1cc9fb[_0x21ff('0x48')]=_['intersection'](_0x54cd21[_0x21ff('0x45')],qs[_0x21ff('0x49')](_0x40e9b7['query'][_0x21ff('0x49')]));_0x1cc9fb['attributes']=_0x1cc9fb[_0x21ff('0x48')][_0x21ff('0x4a')]?_0x1cc9fb['attributes']:_0x54cd21[_0x21ff('0x45')];if(_0x40e9b7[_0x21ff('0x46')]['includeAll']){_0x1cc9fb['include']=[{'all':!![]}];}_0x1cc9fb=_[_0x21ff('0x51')]({},_0x1cc9fb,_0x40e9b7['options']);return db[_0x21ff('0x43')][_0x21ff('0x5a')](_0x1cc9fb)[_0x21ff('0x39')](handleEntityNotFound(_0x534e79,null))[_0x21ff('0x39')](respondWithResult(_0x534e79,null))['catch'](handleError(_0x534e79,null));};exports['create']=function(_0x39a3fe,_0x431dc3){return db[_0x21ff('0x43')][_0x21ff('0x5b')](_0x39a3fe[_0x21ff('0x5c')],{})[_0x21ff('0x39')](function(_0x13c114){var _0x256439=_0x39a3fe[_0x21ff('0x5d')][_0x21ff('0x3b')]({'plain':!![]});if(!_0x256439)throw new Error(_0x21ff('0x5e'));if(_0x256439[_0x21ff('0x5f')]===_0x21ff('0x5d')){var _0x52addf=_0x13c114[_0x21ff('0x3b')]({'plain':!![]});var _0x21e4ed=_0x21ff('0x60');return db[_0x21ff('0x61')][_0x21ff('0x5a')]({'where':{'name':_0x21e4ed,'userProfileId':_0x256439[_0x21ff('0x62')]},'raw':!![]})[_0x21ff('0x39')](function(_0xbea1e2){if(_0xbea1e2&&_0xbea1e2[_0x21ff('0x63')]===0x0){return db[_0x21ff('0x64')][_0x21ff('0x5b')]({'name':_0x52addf[_0x21ff('0x3d')],'resourceId':_0x52addf['id'],'type':_0xbea1e2[_0x21ff('0x3d')],'sectionId':_0xbea1e2['id']},{})['then'](function(){return _0x13c114;});}else{return _0x13c114;}})[_0x21ff('0x2c')](function(_0x57f397){logger['error'](_0x21ff('0x65'),_0x57f397);throw _0x57f397;});}return _0x13c114;})['then'](respondWithResult(_0x431dc3,0xc9))['catch'](handleError(_0x431dc3,null));};exports[_0x21ff('0x38')]=function(_0x4db540,_0x497c54){if(_0x4db540['body']['id']){delete _0x4db540[_0x21ff('0x5c')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4db540[_0x21ff('0x58')]['id']},'include':[{'model':db[_0x21ff('0x40')],'as':_0x21ff('0x41')}]})[_0x21ff('0x39')](handleEntityNotFound(_0x497c54,null))[_0x21ff('0x39')](saveUpdates(_0x4db540['body'],null))[_0x21ff('0x39')](respondWithResult(_0x497c54,null))[_0x21ff('0x2c')](handleError(_0x497c54,null));};exports[_0x21ff('0x3a')]=function(_0xcd23c,_0x5cdd78){return db['SmsAccount']['find']({'where':{'id':_0xcd23c['params']['id']}})['then'](handleEntityNotFound(_0x5cdd78,null))[_0x21ff('0x39')](removeEntity(_0x5cdd78,null))[_0x21ff('0x2c')](handleError(_0x5cdd78,null));};exports['describe']=function(_0x474932,_0x57480c){return db[_0x21ff('0x43')][_0x21ff('0x66')]()[_0x21ff('0x39')](respondWithResult(_0x57480c,null))[_0x21ff('0x2c')](handleError(_0x57480c,null));};exports[_0x21ff('0x67')]=function(_0x3e3304,_0x55501d,_0x3e1471){if(_0x3e3304[_0x21ff('0x5c')]['id']){delete _0x3e3304[_0x21ff('0x5c')]['id'];}return db[_0x21ff('0x43')][_0x21ff('0x5a')]({'where':{'id':_0x3e3304[_0x21ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x55501d,null))['then'](function(_0x53fe45){if(_0x53fe45){_0x3e3304[_0x21ff('0x5c')][_0x21ff('0x68')]=_0x53fe45['id'];return db[_0x21ff('0x69')]['create'](_0x3e3304['body']);}})['then'](respondWithResult(_0x55501d,null))[_0x21ff('0x2c')](handleError(_0x55501d,null));};exports[_0x21ff('0x6a')]=function(_0x1c893a,_0x3b8cd1,_0x13a1c7){var _0x4b89a7={'raw':![],'where':{}};var _0x5d5d19={};var _0x31e9a2={'count':0x0,'rows':[]};return db[_0x21ff('0x43')][_0x21ff('0x6b')]({'where':{'id':_0x1c893a['params']['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x3b8cd1,null))[_0x21ff('0x39')](function(_0x50fa53){if(_0x50fa53){_0x5d5d19['model']=_[_0x21ff('0x47')](db[_0x21ff('0x69')]['rawAttributes']);_0x5d5d19[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x1c893a[_0x21ff('0x46')]);_0x5d5d19[_0x21ff('0x50')]=_[_0x21ff('0x59')](_0x5d5d19[_0x21ff('0x45')],_0x5d5d19['query']);_0x4b89a7[_0x21ff('0x48')]=_['intersection'](_0x5d5d19[_0x21ff('0x45')],qs['fields'](_0x1c893a[_0x21ff('0x46')][_0x21ff('0x49')]));_0x4b89a7[_0x21ff('0x48')]=_0x4b89a7[_0x21ff('0x48')]['length']?_0x4b89a7[_0x21ff('0x48')]:_0x5d5d19[_0x21ff('0x45')];if(!_0x1c893a[_0x21ff('0x46')][_0x21ff('0x4b')](_0x21ff('0x4c'))){_0x4b89a7[_0x21ff('0x33')]=qs['limit'](_0x1c893a['query'][_0x21ff('0x33')]);_0x4b89a7[_0x21ff('0x31')]=qs[_0x21ff('0x31')](_0x1c893a[_0x21ff('0x46')][_0x21ff('0x31')]);}_0x4b89a7[_0x21ff('0x4d')]=qs[_0x21ff('0x4e')](_0x1c893a[_0x21ff('0x46')][_0x21ff('0x4e')]);_0x4b89a7[_0x21ff('0x4f')]=qs[_0x21ff('0x50')](_['pick'](_0x1c893a['query'],_0x5d5d19[_0x21ff('0x50')]));_0x4b89a7[_0x21ff('0x4f')][_0x21ff('0x68')]=_0x50fa53['id'];if(_0x1c893a[_0x21ff('0x46')]['filter']){_0x4b89a7['where']=_[_0x21ff('0x51')](_0x4b89a7[_0x21ff('0x4f')],{'$or':_['map'](_0x4b89a7['attributes'],function(_0x376a40){var _0x518737={};_0x518737[_0x376a40]={'$like':'%'+_0x1c893a[_0x21ff('0x46')][_0x21ff('0x53')]+'%'};return _0x518737;})});}_0x4b89a7=_['merge']({},_0x4b89a7,_0x1c893a[_0x21ff('0x54')]);return db['Disposition'][_0x21ff('0x34')]({'where':_0x4b89a7[_0x21ff('0x4f')]})[_0x21ff('0x39')](function(_0x1ee9dd){_0x31e9a2['count']=_0x1ee9dd;if(_0x1c893a[_0x21ff('0x46')]['includeAll']){_0x4b89a7[_0x21ff('0x6c')]=[{'all':!![]}];}return db[_0x21ff('0x69')]['findAll'](_0x4b89a7);})[_0x21ff('0x39')](function(_0xb333c7){_0x31e9a2['rows']=_0xb333c7;return _0x31e9a2;});}})[_0x21ff('0x39')](respondWithFilteredResult(_0x3b8cd1,_0x4b89a7))[_0x21ff('0x2c')](handleError(_0x3b8cd1,null));};exports['removeDispositions']=function(_0x413f38,_0x4f1436,_0x52daa3){return db[_0x21ff('0x43')]['find']({'where':{'id':_0x413f38[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x4f1436,null))[_0x21ff('0x39')](function(_0x1414c2){if(_0x1414c2){return _0x1414c2[_0x21ff('0x6d')](_0x413f38[_0x21ff('0x46')][_0x21ff('0x6e')]);}})[_0x21ff('0x39')](respondWithStatusCode(_0x4f1436,null))[_0x21ff('0x2c')](handleError(_0x4f1436,null));};exports[_0x21ff('0x6f')]=function(_0x3a4c3c,_0x5c0801,_0x13f55e){if(_0x3a4c3c['body']['id']){delete _0x3a4c3c[_0x21ff('0x5c')]['id'];}return db[_0x21ff('0x43')]['find']({'where':{'id':_0x3a4c3c[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x5c0801,null))[_0x21ff('0x39')](function(_0x202b10){if(_0x202b10){_0x3a4c3c['body'][_0x21ff('0x68')]=_0x202b10['id'];return db[_0x21ff('0x70')][_0x21ff('0x5b')](_0x3a4c3c[_0x21ff('0x5c')]);}})[_0x21ff('0x39')](respondWithResult(_0x5c0801,null))['catch'](handleError(_0x5c0801,null));};exports[_0x21ff('0x71')]=function(_0x4f9939,_0x299d1b,_0x14a140){var _0x259e82={'raw':![],'where':{}};var _0x282415={};var _0x495400={'count':0x0,'rows':[]};return db[_0x21ff('0x43')]['findOne']({'where':{'id':_0x4f9939[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x299d1b,null))[_0x21ff('0x39')](function(_0x33dd8c){if(_0x33dd8c){_0x282415['model']=_['keys'](db[_0x21ff('0x70')][_0x21ff('0x44')]);_0x282415[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x4f9939[_0x21ff('0x46')]);_0x282415[_0x21ff('0x50')]=_['intersection'](_0x282415[_0x21ff('0x45')],_0x282415['query']);_0x259e82[_0x21ff('0x48')]=_[_0x21ff('0x59')](_0x282415[_0x21ff('0x45')],qs[_0x21ff('0x49')](_0x4f9939[_0x21ff('0x46')][_0x21ff('0x49')]));_0x259e82[_0x21ff('0x48')]=_0x259e82['attributes'][_0x21ff('0x4a')]?_0x259e82[_0x21ff('0x48')]:_0x282415[_0x21ff('0x45')];if(!_0x4f9939[_0x21ff('0x46')][_0x21ff('0x4b')](_0x21ff('0x4c'))){_0x259e82[_0x21ff('0x33')]=qs[_0x21ff('0x33')](_0x4f9939[_0x21ff('0x46')][_0x21ff('0x33')]);_0x259e82[_0x21ff('0x31')]=qs[_0x21ff('0x31')](_0x4f9939[_0x21ff('0x46')][_0x21ff('0x31')]);}_0x259e82[_0x21ff('0x4d')]=qs[_0x21ff('0x4e')](_0x4f9939[_0x21ff('0x46')][_0x21ff('0x4e')]);_0x259e82['where']=qs['filters'](_[_0x21ff('0x72')](_0x4f9939['query'],_0x282415[_0x21ff('0x50')]));_0x259e82[_0x21ff('0x4f')]['SmsAccountId']=_0x33dd8c['id'];if(_0x4f9939[_0x21ff('0x46')][_0x21ff('0x53')]){_0x259e82['where']=_[_0x21ff('0x51')](_0x259e82['where'],{'$or':_[_0x21ff('0x42')](_0x259e82[_0x21ff('0x48')],function(_0x5984a2){var _0x252dad={};_0x252dad[_0x5984a2]={'$like':'%'+_0x4f9939[_0x21ff('0x46')][_0x21ff('0x53')]+'%'};return _0x252dad;})});}_0x259e82=_[_0x21ff('0x51')]({},_0x259e82,_0x4f9939['options']);return db[_0x21ff('0x70')][_0x21ff('0x34')]({'where':_0x259e82['where']})['then'](function(_0x256b5f){_0x495400[_0x21ff('0x34')]=_0x256b5f;if(_0x4f9939[_0x21ff('0x46')][_0x21ff('0x55')]){_0x259e82[_0x21ff('0x6c')]=[{'all':!![]}];}return db[_0x21ff('0x70')]['findAll'](_0x259e82);})[_0x21ff('0x39')](function(_0x26a840){_0x495400[_0x21ff('0x56')]=_0x26a840;return _0x495400;});}})[_0x21ff('0x39')](respondWithFilteredResult(_0x299d1b,_0x259e82))['catch'](handleError(_0x299d1b,null));};exports['removeAnswers']=function(_0x2710ce,_0x3ae77f,_0x5066b3){return db[_0x21ff('0x43')]['find']({'where':{'id':_0x2710ce[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x3ae77f,null))['then'](function(_0x256645){if(_0x256645){return _0x256645[_0x21ff('0x73')](_0x2710ce['query'][_0x21ff('0x6e')]);}})[_0x21ff('0x39')](respondWithStatusCode(_0x3ae77f,null))[_0x21ff('0x2c')](handleError(_0x3ae77f,null));};exports[_0x21ff('0x74')]=function(_0x1f6370,_0x3bbacc,_0x4a8998){var _0x3f8683={'channel':_0x21ff('0x75')};var _0x4aad39=[];var _0x52220b=[];var _0x37b04f={};return db[_0x21ff('0x43')]['find']({'where':{'id':_0x1f6370['params']['id']},'include':[{'model':db[_0x21ff('0x76')],'as':'Applications'}]})[_0x21ff('0x39')](handleEntityNotFound(_0x3bbacc,null))[_0x21ff('0x39')](function(_0x50139c){_0x3f8683[_0x21ff('0x77')]=_0x50139c;_0x3f8683[_0x21ff('0x78')]=_[_0x21ff('0x79')](_0x50139c[_0x21ff('0x7a')],[_0x21ff('0x7b')],[_0x21ff('0x7c')]);if(_0x3f8683[_0x21ff('0x77')][_0x21ff('0x7a')]){delete _0x3f8683[_0x21ff('0x77')][_0x21ff('0x7a')];}return db[_0x21ff('0x7d')][_0x21ff('0x66')]();})[_0x21ff('0x39')](function(_0x2a8ff1){if(!_0x2a8ff1){throw new db['Sequelize'][(_0x21ff('0x7e'))]('no\x20available\x20attributes');}_0x4aad39=_['difference'](_[_0x21ff('0x47')](_0x2a8ff1),[_0x21ff('0x7f'),_0x21ff('0x80')]);_0x52220b=_[_0x21ff('0x81')](_[_0x21ff('0x47')](_0x2a8ff1),[_0x21ff('0x7f'),'updatedAt',_0x21ff('0x82'),_0x21ff('0x83')]);_0x3f8683['body']={'mapKey':_0x21ff('0x84')};if(_0x3f8683[_0x21ff('0x77')][_0x21ff('0x85')]){switch(_0x3f8683['account'][_0x21ff('0x85')]){case'twilio':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')]=_0x1f6370['body']['From'];_0x3f8683['body'][_0x21ff('0x5c')]=_0x1f6370['body'][_0x21ff('0x87')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')]=_0x1f6370['body'][_0x21ff('0x89')];break;case _0x21ff('0x8a'):_0x3f8683['body'][_0x21ff('0x86')]='+'+_0x1f6370['body']['sender'];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x8b')];break;case _0x21ff('0x8c'):_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x86')];_0x3f8683[_0x21ff('0x5c')]['body']=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x2a')];break;case'clicksend':_0x3f8683[_0x21ff('0x5c')]['from']=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x86')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]=_0x1f6370[_0x21ff('0x5c')]['body'];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x8d')];break;case _0x21ff('0x8e'):_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x8f')];_0x3f8683['body'][_0x21ff('0x5c')]=_0x1f6370[_0x21ff('0x5c')]['Text'];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x90')];break;case _0x21ff('0x91'):_0x3f8683[_0x21ff('0x5c')]['from']='+'+_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x92')][0x0][_0x21ff('0x86')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]=_0x1f6370['body']['results'][0x0][_0x21ff('0x8b')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')]=_0x1f6370['body'][_0x21ff('0x92')][0x0][_0x21ff('0x88')];break;case _0x21ff('0x93'):_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')]=_0x1f6370[_0x21ff('0x5c')]['originatingAddress'];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x94')][_0x21ff('0x2a')];break;case _0x21ff('0x95'):_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')]=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x96')];_0x3f8683['body'][_0x21ff('0x5c')]=_0x1f6370['body'][_0x21ff('0x8b')];_0x3f8683['body']['messageId']=_0x1f6370[_0x21ff('0x5c')][_0x21ff('0x97')];break;case _0x21ff('0x98'):_0x3f8683[_0x21ff('0x5c')]['messageId']=_0x1f6370[_0x21ff('0x5c')][0x0]['message']['id'];_0x3f8683[_0x21ff('0x5c')]['from']=_0x1f6370[_0x21ff('0x5c')][0x0][_0x21ff('0x2a')][_0x21ff('0x86')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]=_0x1f6370[_0x21ff('0x5c')][0x0][_0x21ff('0x2a')]['text'];break;case'intelepeer':_0x3f8683[_0x21ff('0x5c')]['from']=_0x1f6370[_0x21ff('0x5c')]['from'];_0x3f8683['body'][_0x21ff('0x5c')]=_0x1f6370['body'][_0x21ff('0x2a')];_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')]=_0x1f6370['body'][_0x21ff('0x99')];break;}}if(_0x3f8683[_0x21ff('0x5c')]['id']){delete _0x3f8683[_0x21ff('0x5c')]['id'];}if(_[_0x21ff('0x9a')](_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')])){throw new db['Sequelize']['ValidationError'](_0x21ff('0x9b'));}if(_[_0x21ff('0x9a')](_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')])||_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')]===''){throw new db['Sequelize'][(_0x21ff('0x7e'))](_0x21ff('0x9c'));}if(_['isNil'](_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x9d')])){throw new db['Sequelize'][(_0x21ff('0x7e'))](_0x21ff('0x9e')+_0x52220b);}if(!_[_0x21ff('0x9f')](_0x52220b,_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x9d')])){throw new db[(_0x21ff('0xa0'))][(_0x21ff('0x7e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x52220b);}_0x37b04f[_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x9d')]]=_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')];return db[_0x21ff('0xa1')]['find']({'where':{'id':_0x3f8683[_0x21ff('0x77')]['ListId']},'include':[{'model':db[_0x21ff('0x7d')],'as':_0x21ff('0xa2'),'where':_0x37b04f,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x3bbacc,null))['then'](function(_0x5420de){if(_0x5420de){_0x3f8683[_0x21ff('0xa3')]=_[_0x21ff('0xa4')](_0x5420de,[_0x21ff('0xa2')]);if(_0x5420de['Contacts']['length']){return _0x5420de['Contacts'][0x0];}var _0x298bfa=_[_0x21ff('0x1d')](_0x3f8683[_0x21ff('0x5c')],{'firstName':_0x3f8683[_0x21ff('0x5c')]['from'],'ListId':_0x5420de['id']});_0x298bfa[_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x9d')]]=_0x3f8683['body']['from'];return db[_0x21ff('0x7d')][_0x21ff('0x5b')](_0x298bfa,{'fields':_0x4aad39,'raw':!![]});}})[_0x21ff('0x39')](handleEntityNotFound(_0x3bbacc,null))['then'](function(_0x54a9b8){if(_0x54a9b8){_0x3f8683[_0x21ff('0xa5')]=_0x54a9b8;var _0x44524f={'ContactId':_0x54a9b8['id'],'phone':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')],'SmsAccountId':_0x1f6370['params']['id']};var _0x355903={'ContactId':_0x54a9b8['id'],'SmsAccountId':_0x1f6370[_0x21ff('0x58')]['id'],'closed':![]};return db[_0x21ff('0xa6')]['find']({'where':_0x355903})[_0x21ff('0x39')](function(_0x15dbff){if(_0x15dbff){return[_0x15dbff,![]];}return db[_0x21ff('0xa6')]['create'](_0x44524f)['then'](function(_0x1dcf1c){return[_0x1dcf1c,!![]];});});}})['spread'](function(_0x4ad4a3,_0x296b9c){_0x3f8683[_0x21ff('0xa7')]=_0x4ad4a3[_0x21ff('0x3b')]({'plain':!![]});_0x3f8683[_0x21ff('0xa7')][_0x21ff('0xa8')]=![];if(_0x296b9c){if(_0x3f8683[_0x21ff('0x77')][_0x21ff('0xa9')]){_0x3f8683[_0x21ff('0x78')]['push']({'id':0x0,'priority':_0x3f8683['applications'][_0x21ff('0x4a')]+0x1,'app':_0x21ff('0xaa'),'appdata':_0x21ff('0xab'),'interval':_0x21ff('0xac')});}_0x3f8683['interaction'][_0x21ff('0xa8')]=!![];}return db[_0x21ff('0xad')][_0x21ff('0x5b')]({'phone':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x86')],'messageId':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x88')],'body':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0x5c')],'SmsAccountId':_0x1f6370[_0x21ff('0x58')]['id'],'SmsInteractionId':_0x4ad4a3['id'],'direction':'in','ContactId':_0x4ad4a3[_0x21ff('0xae')],'AttachmentId':_0x3f8683[_0x21ff('0x5c')][_0x21ff('0xaf')]});})[_0x21ff('0x39')](function(_0x4f6397){_0x3f8683[_0x21ff('0x2a')]=_0x4f6397;if(_0x3f8683[_0x21ff('0xa7')][_0x21ff('0xb0')]){return db[_0x21ff('0xb1')]['find']({'attributes':['id',_0x21ff('0x3d')],'where':{'id':_0x3f8683['interaction'][_0x21ff('0xb0')]}})['then'](function(_0x4ec553){if(_0x4ec553){_0x3f8683[_0x21ff('0x78')][_0x21ff('0xb2')]({'id':0x0,'priority':0x0,'app':_0x21ff('0xb3'),'appdata':_0x4ec553[_0x21ff('0x3d')]+','+(_0x3f8683['account']['waitForTheAssignedAgent']||0xa),'interval':_0x21ff('0xac')});}return respondWithRpcPromise(_0x21ff('0xb4'),_0x21ff('0xb5'),_0x3f8683);});}return respondWithRpcPromise('Start',_0x21ff('0xb5'),_0x3f8683);})[_0x21ff('0x39')](function(_0x39c5da){if(_0x39c5da){var _0xd09bbd=0xc8;var _0x4b00b0=_0x21ff('0xb6');logger[_0x21ff('0x23')](_0x21ff('0x27'),_0x4b00b0,_0xd09bbd,_0x21ff('0xb7'));logger[_0x21ff('0x26')](_0x21ff('0xb8'),_0x4b00b0,_0xd09bbd,_0x21ff('0xb7'),JSON['stringify'](_0x39c5da));if(_0x3f8683['account'][_0x21ff('0x85')]===_0x21ff('0xb9')){return _0x3bbacc['status'](_0xd09bbd)['set']('Content-Type',_0x21ff('0xba'))[_0x21ff('0x3e')]('\x0a');}else{return _0x3bbacc['status'](_0xd09bbd)[_0x21ff('0x30')](_0x39c5da);}}})[_0x21ff('0x2c')](handleError(_0x3bbacc,null));};exports[_0x21ff('0xbb')]=function(_0x3d563b,_0x244315,_0x56979a){return db['SmsAccount']['findOne']({'where':{'id':_0x3d563b[_0x21ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x244315,null))['then'](function(_0x3fc3c0){if(_0x3fc3c0){return db[_0x21ff('0xbc')]['transaction'](function(_0x230a47){return db['SmsApplication'][_0x21ff('0x3a')]({'where':{'SmsAccountId':_0x3d563b['params']['id']},'transaction':_0x230a47})[_0x21ff('0x39')](function(_0x55b917){var _0x27eeaf=_[_0x21ff('0x42')](_0x3d563b['body'],function(_0x346264){_0x346264['SmsAccountId']=_0x3d563b[_0x21ff('0x58')]['id'];return _0x346264;});return db['SmsApplication'][_0x21ff('0xbd')](_0x27eeaf,{'transaction':_0x230a47});});})[_0x21ff('0x39')](function(){return db[_0x21ff('0x76')][_0x21ff('0xbe')]({'where':{'SmsAccountId':_0x3d563b['params']['id']},'order':_0x21ff('0x7b')});});}})['then'](respondWithResult(_0x244315,null))[_0x21ff('0x2c')](handleError(_0x244315,null));};exports[_0x21ff('0xbf')]=function(_0x50da79,_0x469e3d,_0x507f9f){var _0x28de38={};var _0x1c57ba={};var _0x3318b6;var _0x32146b;return db['SmsAccount']['findOne']({'where':{'id':_0x50da79['params']['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x469e3d,null))[_0x21ff('0x39')](function(_0x549231){if(_0x549231){_0x3318b6=_0x549231;_0x1c57ba[_0x21ff('0x45')]=_[_0x21ff('0x47')](db[_0x21ff('0x76')][_0x21ff('0x44')]);_0x1c57ba[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x50da79[_0x21ff('0x46')]);_0x1c57ba[_0x21ff('0x50')]=_['intersection'](_0x1c57ba[_0x21ff('0x45')],_0x1c57ba['query']);_0x28de38['attributes']=_[_0x21ff('0x59')](_0x1c57ba[_0x21ff('0x45')],qs[_0x21ff('0x49')](_0x50da79[_0x21ff('0x46')][_0x21ff('0x49')]));_0x28de38[_0x21ff('0x48')]=_0x28de38[_0x21ff('0x48')][_0x21ff('0x4a')]?_0x28de38['attributes']:_0x1c57ba['model'];_0x28de38[_0x21ff('0x4d')]=qs[_0x21ff('0x4e')](_0x50da79[_0x21ff('0x46')][_0x21ff('0x4e')]);_0x28de38[_0x21ff('0x4f')]=qs[_0x21ff('0x50')](_[_0x21ff('0x72')](_0x50da79[_0x21ff('0x46')],_0x1c57ba[_0x21ff('0x50')]));if(_0x50da79[_0x21ff('0x46')][_0x21ff('0x53')]){_0x28de38[_0x21ff('0x4f')]=_[_0x21ff('0x51')](_0x28de38[_0x21ff('0x4f')],{'$or':_[_0x21ff('0x42')](_0x28de38[_0x21ff('0x48')],function(_0x418142){var _0x2d2673={};_0x2d2673[_0x418142]={'$like':'%'+_0x50da79[_0x21ff('0x46')]['filter']+'%'};return _0x2d2673;})});}_0x28de38=_[_0x21ff('0x51')]({},_0x28de38,_0x50da79[_0x21ff('0x54')]);return _0x3318b6['getApplications'](_0x28de38);}})[_0x21ff('0x39')](function(_0x40500a){if(_0x40500a){_0x32146b=_0x40500a[_0x21ff('0x4a')];if(!_0x50da79[_0x21ff('0x46')][_0x21ff('0x4b')](_0x21ff('0x4c'))){_0x28de38['limit']=qs[_0x21ff('0x33')](_0x50da79[_0x21ff('0x46')][_0x21ff('0x33')]);_0x28de38[_0x21ff('0x31')]=qs['offset'](_0x50da79[_0x21ff('0x46')]['offset']);}return _0x3318b6[_0x21ff('0xbf')](_0x28de38);}})[_0x21ff('0x39')](function(_0x1b461a){if(_0x1b461a){return _0x1b461a?{'count':_0x32146b,'rows':_0x1b461a}:null;}})['then'](respondWithResult(_0x469e3d,null))[_0x21ff('0x2c')](handleError(_0x469e3d,null));};exports[_0x21ff('0xc0')]=function(_0x1e4b43,_0x3c32a8,_0x23856f){var _0x3d657a={'raw':![],'where':{}};var _0x5180c2={};var _0x5c8b82={'count':0x0,'rows':[]};return db[_0x21ff('0x43')]['findOne']({'where':{'id':_0x1e4b43[_0x21ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c32a8,null))['then'](function(_0x467125){if(_0x467125){_0x5180c2[_0x21ff('0x45')]=_['keys'](db[_0x21ff('0xa6')][_0x21ff('0x44')]);_0x5180c2[_0x21ff('0x46')]=_[_0x21ff('0x47')](_0x1e4b43[_0x21ff('0x46')]);_0x5180c2[_0x21ff('0x50')]=_[_0x21ff('0x59')](_0x5180c2['model'],_0x5180c2['query']);_0x3d657a[_0x21ff('0x48')]=_[_0x21ff('0x59')](_0x5180c2['model'],qs[_0x21ff('0x49')](_0x1e4b43[_0x21ff('0x46')][_0x21ff('0x49')]));_0x3d657a[_0x21ff('0x48')]=_0x3d657a[_0x21ff('0x48')][_0x21ff('0x4a')]?_0x3d657a[_0x21ff('0x48')]:_0x5180c2[_0x21ff('0x45')];if(!_0x1e4b43['query']['hasOwnProperty'](_0x21ff('0x4c'))){_0x3d657a[_0x21ff('0x33')]=qs[_0x21ff('0x33')](_0x1e4b43[_0x21ff('0x46')][_0x21ff('0x33')]);_0x3d657a[_0x21ff('0x31')]=qs[_0x21ff('0x31')](_0x1e4b43['query'][_0x21ff('0x31')]);}_0x3d657a[_0x21ff('0x4d')]=qs[_0x21ff('0x4e')](_0x1e4b43['query'][_0x21ff('0x4e')]);_0x3d657a[_0x21ff('0x4f')]=qs['filters'](_[_0x21ff('0x72')](_0x1e4b43[_0x21ff('0x46')],_0x5180c2[_0x21ff('0x50')]));_0x3d657a[_0x21ff('0x4f')][_0x21ff('0x68')]=_0x467125['id'];if(_0x1e4b43['query']['filter']){_0x3d657a[_0x21ff('0x4f')]=_[_0x21ff('0x51')](_0x3d657a[_0x21ff('0x4f')],{'$or':_[_0x21ff('0x42')](_0x3d657a[_0x21ff('0x48')],function(_0x207051){var _0x4a1007={};_0x4a1007[_0x207051]={'$like':'%'+_0x1e4b43[_0x21ff('0x46')]['filter']+'%'};return _0x4a1007;})});}_0x3d657a=_[_0x21ff('0x51')]({},_0x3d657a,_0x1e4b43[_0x21ff('0x54')]);return db[_0x21ff('0xa6')][_0x21ff('0x34')]({'where':_0x3d657a[_0x21ff('0x4f')]})[_0x21ff('0x39')](function(_0xf25c17){_0x5c8b82[_0x21ff('0x34')]=_0xf25c17;if(_0x1e4b43[_0x21ff('0x46')][_0x21ff('0x55')]){_0x3d657a['include']=[{'model':db[_0x21ff('0x7d')],'as':_0x21ff('0xc1'),'required':![]},{'model':db[_0x21ff('0xb1')],'as':_0x21ff('0xc2'),'attributes':[_0x21ff('0x3d'),_0x21ff('0xc3'),_0x21ff('0xc4')],'required':![]},{'model':db[_0x21ff('0xc5')],'as':_0x21ff('0xc6'),'attributes':['id','name','color'],'where':_0x1e4b43['query'][_0x21ff('0xc7')]?{'id':_0x1e4b43[_0x21ff('0x46')][_0x21ff('0xc7')]}:undefined,'required':_0x1e4b43['query'][_0x21ff('0xc7')]?!![]:![]}];}return db[_0x21ff('0xa6')]['findAll'](_0x3d657a);})[_0x21ff('0x39')](function(_0x5547ef){_0x5c8b82[_0x21ff('0x56')]=_0x5547ef;return _0x5c8b82;});}})[_0x21ff('0x39')](respondWithFilteredResult(_0x3c32a8,_0x3d657a))[_0x21ff('0x2c')](handleError(_0x3c32a8,null));};exports['send']=function(_0x32f254,_0x28910f,_0x174263){var _0x1b0e7e,_0x39e556,_0x254bac;if(_[_0x21ff('0x9a')](_0x32f254['body'][_0x21ff('0x5c')])||_0x32f254[_0x21ff('0x5c')]['body']===''){throw new db['Sequelize'][(_0x21ff('0x7e'))](_0x21ff('0x9c'));}if(_[_0x21ff('0x9a')](_0x32f254['body']['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x1b0e7e=_0x32f254[_0x21ff('0x5c')]['to'];return db[_0x21ff('0x43')]['find']({'where':{'id':_0x32f254[_0x21ff('0x58')]['id']},'include':[{'model':db[_0x21ff('0xa1')],'as':_0x21ff('0xc8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1b0e7e},'limit':0x1,'order':[['updatedAt',_0x21ff('0xc9')]]}]}]})[_0x21ff('0x39')](handleEntityNotFound(_0x28910f,null))[_0x21ff('0x39')](function(_0x4868e5){if(_0x4868e5&&_0x4868e5['List']){_0x39e556=_0x4868e5[_0x21ff('0x3b')]({'plain':!![]});if(_0x39e556[_0x21ff('0xc8')]&&_0x39e556[_0x21ff('0xc8')][_0x21ff('0xa2')][_0x21ff('0x4a')]){return _0x39e556[_0x21ff('0xc8')][_0x21ff('0xa2')][0x0];}return db[_0x21ff('0x7d')][_0x21ff('0x5b')](_[_0x21ff('0x1d')](_0x32f254[_0x21ff('0x5c')],{'firstName':_0x1b0e7e,'mobile':_0x1b0e7e,'phone':_0x1b0e7e,'ListId':_0x39e556[_0x21ff('0x83')]}));}})[_0x21ff('0x39')](handleEntityNotFound(_0x28910f,null))[_0x21ff('0x39')](function(_0x433886){if(_0x433886){_0x254bac=_0x433886;return db['SmsInteraction']['find']({'where':{'ContactId':_0x254bac['id'],'closed':![],'SmsAccountId':_0x39e556['id']}})[_0x21ff('0x39')](function(_0xd9178d){if(_0xd9178d){return[_0xd9178d,![]];}return db[_0x21ff('0xa6')]['create']({'UserId':_0x32f254[_0x21ff('0x5d')]['id'],'ContactId':_0x254bac['id'],'SmsAccountId':_0x39e556['id'],'phone':_0x1b0e7e,'firstMsgDirection':'out','Messages':[_[_0x21ff('0x51')](_0x32f254[_0x21ff('0x5c')],{'read':![],'body':_0x32f254[_0x21ff('0x5c')][_0x21ff('0x5c')],'phone':_0x1b0e7e,'SmsAccountId':_0x39e556['id'],'UserId':_0x32f254['user']['id'],'ContactId':_0x254bac['id']})]},{'include':[{'model':db[_0x21ff('0xad')],'as':_0x21ff('0xca')}]})[_0x21ff('0x39')](function(_0xe6322e){return[_0xe6322e,!![]];});});}})[_0x21ff('0xcb')](function(_0x1b33f4,_0x210fc3){if(_0x210fc3){return _0x1b33f4;}return db['SmsMessage'][_0x21ff('0x5b')](_['merge'](_0x32f254[_0x21ff('0x5c')],{'read':![],'body':_0x32f254[_0x21ff('0x5c')][_0x21ff('0x5c')],'phone':_0x1b0e7e,'SmsAccountId':_0x39e556['id'],'SmsInteractionId':_0x1b33f4['id'],'UserId':_0x32f254[_0x21ff('0x5d')]['id'],'ContactId':_0x254bac['id']}))[_0x21ff('0x39')](function(_0x129caf){_0x1b33f4[_0x21ff('0xcc')]['Messages']=[];_0x1b33f4[_0x21ff('0xcc')][_0x21ff('0xca')]['push'](_0x129caf[_0x21ff('0xcc')]);return _0x1b33f4;});})[_0x21ff('0x39')](respondWithResult(_0x28910f,null))[_0x21ff('0x2c')](handleError(_0x28910f,null));};exports[_0x21ff('0x2f')]=function(_0x17b1ef,_0x143fb4,_0x5dfea7){if(_0x17b1ef[_0x21ff('0x5c')]['id']){delete _0x17b1ef[_0x21ff('0x5c')]['id'];}var _0x505502,_0x118370,_0xaf74c8;return db[_0x21ff('0x43')][_0x21ff('0x5a')]({'where':{'id':_0x17b1ef[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x143fb4,null))[_0x21ff('0x39')](function(_0x53dbbb){if(_0x53dbbb){_0xaf74c8=_0x53dbbb;logger[_0x21ff('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x21ff('0xcd'),_0x53dbbb['type'],util[_0x21ff('0xce')](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));switch(_0x53dbbb[_0x21ff('0x85')]){case _0x21ff('0x8a'):if(_0x17b1ef[_0x21ff('0x5c')]['skebby_dispatch_id']&&_0x17b1ef[_0x21ff('0x5c')]['status']){_0x118370=_0x17b1ef['body'][_0x21ff('0x2f')];return db[_0x21ff('0xad')]['find']({'where':{'messageId':_0x17b1ef['body'][_0x21ff('0xcf')]}});}break;case'connectel':if(_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0xd0')]&&_0x17b1ef[_0x21ff('0x5c')]['statusInt']){_0x118370=_0x17b1ef[_0x21ff('0x5c')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x17b1ef['body']['requestid']}});}break;case _0x21ff('0xd1'):if(_0x17b1ef['body'][_0x21ff('0x8d')]&&_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0xd2')]){_0x118370=_0x17b1ef['body'][_0x21ff('0xd2')];return db[_0x21ff('0xad')][_0x21ff('0x5a')]({'where':{'messageId':_0x17b1ef[_0x21ff('0x5c')]['message_id']}});}break;case'infobip':var _0x1977da=_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x92')][0x0];if(_0x1977da[_0x21ff('0x88')]&&_0x1977da[_0x21ff('0x2f')][_0x21ff('0xd3')]==='DELIVERED'){_0x118370=_0x1977da[_0x21ff('0x2f')]['groupName'];return db[_0x21ff('0xad')][_0x21ff('0x5a')]({'where':{'messageId':_0x1977da['messageId']}});}break;case _0x21ff('0x95'):if(_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x88')]&&_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x2f')]){_0x118370=_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x2f')];return db[_0x21ff('0xad')][_0x21ff('0x5a')]({'where':{'messageId':_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x88')]}});}break;case _0x21ff('0x98'):if(_0x17b1ef['body'][0x0][_0x21ff('0x2a')]['id']){_0x118370=_0x17b1ef[_0x21ff('0x5c')][0x0][_0x21ff('0x85')];return db['SmsMessage'][_0x21ff('0x5a')]({'where':{'messageId':_0x17b1ef[_0x21ff('0x5c')][0x0][_0x21ff('0x2a')]['id']}});}break;case _0x21ff('0xd4'):if(_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0xd5')]&&_0x17b1ef['body'][_0x21ff('0x2f')]){_0x118370=_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x2f')];return db[_0x21ff('0xad')][_0x21ff('0x5a')]({'where':{'messageId':_0x17b1ef[_0x21ff('0x5c')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x143fb4,null))[_0x21ff('0x39')](function(_0x464e85){if(_0x464e85){_0x505502=_0x464e85;switch(_0xaf74c8[_0x21ff('0x85')]){case _0x21ff('0x8a'):if(_0x118370===_0x21ff('0xd6')){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger['error'](_0x21ff('0x27'),_0x21ff('0x2f'),_0x21ff('0x8a'),util[_0x21ff('0xce')](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x21ff('0x8c'):if(_0x118370==='1'){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger[_0x21ff('0x28')](_0x21ff('0x27'),_0x21ff('0x2f'),'skebby',util['inspect'](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x21ff('0xd1'):if(!_0x17b1ef['body'][_0x21ff('0xd7')]&&_0x118370>=0xc8&&_0x118370<=0xce){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger['error'](_0x21ff('0x27'),_0x21ff('0x2f'),_0x21ff('0xd1'),util['inspect'](_0x17b1ef['body'],{'showHidden':![],'depth':null}));}break;case _0x21ff('0x91'):var _0xad8246=_0x17b1ef[_0x21ff('0x5c')][_0x21ff('0x92')][0x0];if(_0xad8246[_0x21ff('0x2f')]['groupName']===_0x21ff('0xd6')){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger[_0x21ff('0x28')](_0x21ff('0x27'),_0x21ff('0x2f'),'infobip',util[_0x21ff('0xce')](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x21ff('0x95'):if(_0x118370=='DELIVERED_TO_GATEWAY'||_0x118370==_0x21ff('0xd8')){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger[_0x21ff('0x28')](_0x21ff('0x27'),_0x21ff('0x2f'),_0x21ff('0x95'),util[_0x21ff('0xce')](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x21ff('0x98'):if(_0x118370==_0x21ff('0xd9')){return _0x505502[_0x21ff('0x38')]({'read':!![]});}else{logger[_0x21ff('0x28')](_0x21ff('0x27'),'status',_0x21ff('0x98'),util['inspect'](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x21ff('0xd4'):if(_0x118370===_0x21ff('0xda')||_0x118370==='ACCEPTD'){return _0x505502['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x21ff('0x2f'),_0x21ff('0xd4'),util[_0x21ff('0xce')](_0x17b1ef[_0x21ff('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x505502;}})['then'](respondWithResult(_0x143fb4,null))[_0x21ff('0x2c')](handleError(_0x143fb4,null));};exports['statusGet']=function(_0x133b2a,_0x18e687,_0x1d25c3){var _0x43ff04,_0x47f075,_0x2f442e;return db[_0x21ff('0x43')][_0x21ff('0x5a')]({'where':{'id':_0x133b2a[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x18e687,null))[_0x21ff('0x39')](function(_0x2ffc73){if(_0x2ffc73){_0x2f442e=_0x2ffc73;logger[_0x21ff('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x21ff('0x2f'),_0x21ff('0xcd'),_0x2ffc73[_0x21ff('0x85')],util[_0x21ff('0xce')](_0x133b2a[_0x21ff('0x46')],{'showHidden':![],'depth':null}));switch(_0x2ffc73['type']){case _0x21ff('0x93'):if(_0x133b2a['query'][_0x21ff('0xdb')]&&_0x133b2a[_0x21ff('0x46')]['state']){_0x47f075=_0x133b2a['query'][_0x21ff('0xdc')];return db[_0x21ff('0xad')][_0x21ff('0x5a')]({'where':{'messageId':_0x133b2a['query'][_0x21ff('0xdb')]}});}break;}}})[_0x21ff('0x39')](handleEntityNotFound(_0x18e687,null))[_0x21ff('0x39')](function(_0x1494a6){if(_0x1494a6){_0x43ff04=_0x1494a6;switch(_0x2f442e[_0x21ff('0x85')]){case'csc':if(_0x47f075==='2'||_0x47f075==='6'){return _0x43ff04['update']({'read':!![]});}else{logger[_0x21ff('0x28')](_0x21ff('0x27'),_0x21ff('0x2f'),_0x21ff('0x93'),util[_0x21ff('0xce')](_0x133b2a[_0x21ff('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x43ff04;}})['then'](respondWithResult(_0x18e687,null))[_0x21ff('0x2c')](handleError(_0x18e687,null));};exports[_0x21ff('0xdd')]=function(_0x405956,_0x4beddb,_0x1c05dc){return db[_0x21ff('0x43')]['find']({'where':{'id':_0x405956[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x4beddb,null))[_0x21ff('0x39')](function(_0x5437ef){if(_0x5437ef){return _0x5437ef[_0x21ff('0xdd')](_0x405956[_0x21ff('0x5c')][_0x21ff('0x6e')],_[_0x21ff('0xa4')](_0x405956[_0x21ff('0x5c')],[_0x21ff('0x6e'),'id'])||{})[_0x21ff('0xcb')](function(_0x28f338){for(var _0x4f21f5=0x0;_0x4f21f5<_0x405956['body'][_0x21ff('0x6e')]['length'];_0x4f21f5+=0x1){socket[_0x21ff('0xde')](_0x21ff('0xdf'),{'UserId':Number(_0x405956[_0x21ff('0x5c')]['ids'][_0x4f21f5]),'SmsAccountId':Number(_0x405956[_0x21ff('0x58')]['id'])});}return _0x28f338;});}})['then'](respondWithResult(_0x4beddb,null))['catch'](handleError(_0x4beddb,null));};exports[_0x21ff('0xe0')]=function(_0x2cb7be,_0x3d97a0,_0x4c4cfb){return db['SmsAccount'][_0x21ff('0x5a')]({'where':{'id':_0x2cb7be[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x3d97a0,null))[_0x21ff('0x39')](function(_0xdab702){if(_0xdab702){return _0xdab702[_0x21ff('0xe0')](_0x2cb7be[_0x21ff('0x46')][_0x21ff('0x6e')])[_0x21ff('0x39')](function(){if(_[_0x21ff('0xe1')](_0x2cb7be[_0x21ff('0x46')][_0x21ff('0x6e')])){for(var _0xa3ccab=0x0;_0xa3ccab<_0x2cb7be[_0x21ff('0x46')][_0x21ff('0x6e')]['length'];_0xa3ccab+=0x1){socket['emit'](_0x21ff('0xe2'),{'UserId':Number(_0x2cb7be['query'][_0x21ff('0x6e')][_0xa3ccab]),'SmsAccountId':Number(_0x2cb7be[_0x21ff('0x58')]['id'])});}}else{socket['emit'](_0x21ff('0xe2'),{'UserId':Number(_0x2cb7be[_0x21ff('0x46')][_0x21ff('0x6e')]),'SmsAccountId':Number(_0x2cb7be[_0x21ff('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d97a0,null))[_0x21ff('0x2c')](handleError(_0x3d97a0,null));};exports['getAgents']=function(_0xd587d5,_0x47db9e,_0x13f692){var _0x3fe703={};var _0x5997c4={};var _0x34c867;var _0x7431c0;return db[_0x21ff('0x43')][_0x21ff('0x6b')]({'where':{'id':_0xd587d5[_0x21ff('0x58')]['id']}})[_0x21ff('0x39')](handleEntityNotFound(_0x47db9e,null))['then'](function(_0x37c4ba){if(_0x37c4ba){_0x34c867=_0x37c4ba;_0x5997c4[_0x21ff('0x45')]=_[_0x21ff('0x47')](db[_0x21ff('0xb1')][_0x21ff('0x44')]);_0x5997c4[_0x21ff('0x46')]=_['keys'](_0xd587d5[_0x21ff('0x46')]);_0x5997c4[_0x21ff('0x50')]=_['intersection'](_0x5997c4[_0x21ff('0x45')],_0x5997c4['query']);_0x3fe703['attributes']=_[_0x21ff('0x59')](_0x5997c4[_0x21ff('0x45')],qs[_0x21ff('0x49')](_0xd587d5[_0x21ff('0x46')][_0x21ff('0x49')]));_0x3fe703[_0x21ff('0x48')]=_0x3fe703[_0x21ff('0x48')][_0x21ff('0x4a')]?_0x3fe703[_0x21ff('0x48')]:_0x5997c4[_0x21ff('0x45')];_0x3fe703[_0x21ff('0x4d')]=qs[_0x21ff('0x4e')](_0xd587d5['query'][_0x21ff('0x4e')]);_0x3fe703['where']=qs[_0x21ff('0x50')](_[_0x21ff('0x72')](_0xd587d5['query'],_0x5997c4['filters']));if(_0xd587d5[_0x21ff('0x46')][_0x21ff('0x53')]){_0x3fe703[_0x21ff('0x4f')]=_['merge'](_0x3fe703[_0x21ff('0x4f')],{'$or':_['map'](_0x3fe703[_0x21ff('0x48')],function(_0x30858e){var _0x1a58b5={};_0x1a58b5[_0x30858e]={'$like':'%'+_0xd587d5[_0x21ff('0x46')][_0x21ff('0x53')]+'%'};return _0x1a58b5;})});}_0x3fe703=_[_0x21ff('0x51')]({},_0x3fe703,_0xd587d5[_0x21ff('0x54')]);return _0x34c867[_0x21ff('0xe3')](_0x3fe703);}})[_0x21ff('0x39')](function(_0x2b0fb3){if(_0x2b0fb3){_0x7431c0=_0x2b0fb3[_0x21ff('0x4a')];if(!_0xd587d5[_0x21ff('0x46')][_0x21ff('0x4b')](_0x21ff('0x4c'))){_0x3fe703[_0x21ff('0x33')]=qs[_0x21ff('0x33')](_0xd587d5[_0x21ff('0x46')]['limit']);_0x3fe703[_0x21ff('0x31')]=qs[_0x21ff('0x31')](_0xd587d5['query'][_0x21ff('0x31')]);}return _0x34c867[_0x21ff('0xe3')](_0x3fe703);}})[_0x21ff('0x39')](function(_0x1b5efd){if(_0x1b5efd){return _0x1b5efd?{'count':_0x7431c0,'rows':_0x1b5efd}:null;}})[_0x21ff('0x39')](respondWithResult(_0x47db9e,null))[_0x21ff('0x2c')](handleError(_0x47db9e,null));}; \ No newline at end of file +var _0xb4be=['key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','from','From','Body','messageId','MessageSid','sender','text','connectel','clicksend','message_id','Text','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','bandwidth','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','updatedAt','DESC','list','omit','CmContact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','\x0a','addApplications','transaction','SmsApplication','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../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','register','jayson/promise','client','http','then','info','request\x20sent','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','SmsAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type'];(function(_0x565675,_0x1e467c){var _0x468999=function(_0x5a7d56){while(--_0x5a7d56){_0x565675['push'](_0x565675['shift']());}};_0x468999(++_0x1e467c);}(_0xb4be,0x181));var _0xeb4b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb4be[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb4b('0x0'));var zipdir=require(_0xeb4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeb4b('0x2'));var BPromise=require(_0xeb4b('0x3'));var Mustache=require(_0xeb4b('0x4'));var util=require(_0xeb4b('0x5'));var path=require(_0xeb4b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeb4b('0x7'));var fs=require('fs');var fs_extra=require(_0xeb4b('0x8'));var _=require(_0xeb4b('0x9'));var squel=require('squel');var crypto=require(_0xeb4b('0xa'));var jsforce=require(_0xeb4b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb4b('0xc'));var querystring=require('querystring');var Papa=require(_0xeb4b('0xd'));var Redis=require('ioredis');var authService=require(_0xeb4b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xeb4b('0xf'));var hardwareService=require(_0xeb4b('0x10'));var logger=require(_0xeb4b('0x11'))(_0xeb4b('0x12'));var utils=require(_0xeb4b('0x13'));var config=require(_0xeb4b('0x14'));var licenseUtil=require(_0xeb4b('0x15'));var db=require(_0xeb4b('0x16'))['db'];config[_0xeb4b('0x17')]=_[_0xeb4b('0x18')](config[_0xeb4b('0x17')],{'host':_0xeb4b('0x19'),'port':0x18eb});var socket=require(_0xeb4b('0x1a'))(new Redis(config[_0xeb4b('0x17')]));require('./smsAccount.socket')[_0xeb4b('0x1b')](socket);var jayson=require(_0xeb4b('0x1c'));var client=jayson[_0xeb4b('0x1d')][_0xeb4b('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x183cfe,_0x32ee07,_0x5b825b,_0x464b90){return new BPromise(function(_0x2ad790,_0x58085b){var _0x12e0b6=_0x464b90||client;return _0x12e0b6['request'](_0x183cfe,_0x5b825b)[_0xeb4b('0x1f')](function(_0x369df9){logger[_0xeb4b('0x20')]('SmsAccount,\x20%s,\x20%s',_0x32ee07,_0xeb4b('0x21'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x32ee07,'request\x20sent',JSON[_0xeb4b('0x22')](_0x369df9));if(_0x369df9['error']){if(_0x369df9[_0xeb4b('0x23')]['code']===0x1f4){logger[_0xeb4b('0x23')](_0xeb4b('0x24'),_0x32ee07,_0x369df9['error'][_0xeb4b('0x25')]);return _0x58085b(_0x369df9[_0xeb4b('0x23')]['message']);}logger[_0xeb4b('0x23')](_0xeb4b('0x24'),_0x32ee07,_0x369df9[_0xeb4b('0x23')][_0xeb4b('0x25')]);return _0x2ad790(_0x369df9[_0xeb4b('0x23')][_0xeb4b('0x25')]);}else{logger[_0xeb4b('0x20')]('SmsAccount,\x20%s,\x20%s',_0x32ee07,_0xeb4b('0x21'));_0x2ad790(_0x369df9[_0xeb4b('0x26')][_0xeb4b('0x25')]);}})[_0xeb4b('0x27')](function(_0x555a52){logger[_0xeb4b('0x23')](_0xeb4b('0x24'),_0x32ee07,_0x555a52);_0x58085b(_0x555a52);});});}function respondWithStatusCode(_0x69d039,_0x5bb1f8){_0x5bb1f8=_0x5bb1f8||0xcc;return function(_0x37a406){if(_0x37a406){return _0x69d039[_0xeb4b('0x28')](_0x5bb1f8);}return _0x69d039[_0xeb4b('0x29')](_0x5bb1f8)['end']();};}function respondWithResult(_0x54499f,_0x488e4f){_0x488e4f=_0x488e4f||0xc8;return function(_0x55f94d){if(_0x55f94d){return _0x54499f[_0xeb4b('0x29')](_0x488e4f)[_0xeb4b('0x2a')](_0x55f94d);}};}function respondWithFilteredResult(_0x1f3e3a,_0x32b180){return function(_0x3f54da){if(_0x3f54da){var _0x456d4=typeof _0x32b180[_0xeb4b('0x2b')]===_0xeb4b('0x2c')&&typeof _0x32b180[_0xeb4b('0x2d')]==='undefined';var _0x16b470=_0x3f54da['count'];var _0x3ca7db=_0x456d4?0x0:_0x32b180['offset'];var _0x28d707=_0x456d4?_0x3f54da[_0xeb4b('0x2e')]:_0x32b180[_0xeb4b('0x2b')]+_0x32b180[_0xeb4b('0x2d')];var _0x3b92c8;if(_0x28d707>=_0x16b470){_0x28d707=_0x16b470;_0x3b92c8=0xc8;}else{_0x3b92c8=0xce;}_0x1f3e3a[_0xeb4b('0x29')](_0x3b92c8);return _0x1f3e3a['set'](_0xeb4b('0x2f'),_0x3ca7db+'-'+_0x28d707+'/'+_0x16b470)[_0xeb4b('0x2a')](_0x3f54da);}return null;};}function patchUpdates(_0x181005){return function(_0x4c5051){try{jsonpatch[_0xeb4b('0x30')](_0x4c5051,_0x181005,!![]);}catch(_0x413ef7){return BPromise[_0xeb4b('0x31')](_0x413ef7);}return _0x4c5051[_0xeb4b('0x32')]();};}function saveUpdates(_0x491e44,_0x22700b){return function(_0x31f95c){if(_0x31f95c){return _0x31f95c['update'](_0x491e44)[_0xeb4b('0x1f')](function(_0x59fd54){return _0x59fd54;});}return null;};}function removeEntity(_0x1088ba,_0x2790c5){return function(_0x18a499){if(_0x18a499){return _0x18a499['destroy']()[_0xeb4b('0x1f')](function(){var _0x54070e=_0x18a499['get']({'plain':!![]});var _0x271712=_0xeb4b('0x33');return db[_0xeb4b('0x34')][_0xeb4b('0x35')]({'where':{'type':_0x271712,'resourceId':_0x54070e['id']}})[_0xeb4b('0x1f')](function(){return _0x18a499;});})[_0xeb4b('0x1f')](function(){_0x1088ba[_0xeb4b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78a9b2,_0x391e11){return function(_0x378d30){if(!_0x378d30){_0x78a9b2[_0xeb4b('0x28')](0x194);}return _0x378d30;};}function handleError(_0x27b45a,_0x567016){_0x567016=_0x567016||0x1f4;return function(_0x50fbd6){logger[_0xeb4b('0x23')](_0x50fbd6[_0xeb4b('0x36')]);if(_0x50fbd6[_0xeb4b('0x37')]){delete _0x50fbd6[_0xeb4b('0x37')];}_0x27b45a[_0xeb4b('0x29')](_0x567016)[_0xeb4b('0x38')](_0x50fbd6);};}exports['index']=function(_0x4e57ed,_0x4c8f30){var _0x13b6ac={'include':[{'model':db[_0xeb4b('0x39')],'as':_0xeb4b('0x3a')}]},_0x5676ba={},_0x4c76b4={'count':0x0,'rows':[]};var _0x3512c8=_['map'](db[_0xeb4b('0x3b')][_0xeb4b('0x3c')],function(_0x52369a){return{'name':_0x52369a[_0xeb4b('0x3d')],'type':_0x52369a[_0xeb4b('0x3e')][_0xeb4b('0x3f')]};});_0x5676ba[_0xeb4b('0x40')]=_[_0xeb4b('0x41')](_0x3512c8,_0xeb4b('0x37'));_0x5676ba['query']=_['keys'](_0x4e57ed[_0xeb4b('0x42')]);_0x5676ba[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x5676ba[_0xeb4b('0x40')],_0x5676ba[_0xeb4b('0x42')]);_0x13b6ac[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x5676ba[_0xeb4b('0x40')],qs[_0xeb4b('0x46')](_0x4e57ed['query'][_0xeb4b('0x46')]));_0x13b6ac[_0xeb4b('0x45')]=_0x13b6ac[_0xeb4b('0x45')][_0xeb4b('0x47')]?_0x13b6ac['attributes']:_0x5676ba[_0xeb4b('0x40')];if(!_0x4e57ed['query'][_0xeb4b('0x48')](_0xeb4b('0x49'))){_0x13b6ac[_0xeb4b('0x2d')]=qs[_0xeb4b('0x2d')](_0x4e57ed[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x13b6ac[_0xeb4b('0x2b')]=qs[_0xeb4b('0x2b')](_0x4e57ed['query'][_0xeb4b('0x2b')]);}_0x13b6ac['order']=qs[_0xeb4b('0x4a')](_0x4e57ed[_0xeb4b('0x42')]['sort']);_0x13b6ac['where']=qs[_0xeb4b('0x43')](_['pick'](_0x4e57ed[_0xeb4b('0x42')],_0x5676ba['filters']),_0x3512c8);if(_0x4e57ed[_0xeb4b('0x42')]['filter']){_0x13b6ac[_0xeb4b('0x4b')]=_[_0xeb4b('0x4c')](_0x13b6ac[_0xeb4b('0x4b')],{'$or':_['map'](_0x3512c8,function(_0x2d7477){if(_0x2d7477[_0xeb4b('0x3e')]!==_0xeb4b('0x4d')){var _0x21109d={};_0x21109d[_0x2d7477['name']]={'$like':'%'+_0x4e57ed[_0xeb4b('0x42')][_0xeb4b('0x4e')]+'%'};return _0x21109d;}})});}_0x13b6ac=_[_0xeb4b('0x4c')]({},_0x13b6ac,_0x4e57ed[_0xeb4b('0x4f')]);var _0x451060={'where':_0x13b6ac[_0xeb4b('0x4b')]};return db['SmsAccount'][_0xeb4b('0x2e')](_0x451060)['then'](function(_0x31ecb9){_0x4c76b4[_0xeb4b('0x2e')]=_0x31ecb9;if(_0x4e57ed[_0xeb4b('0x42')]['includeAll']){_0x13b6ac[_0xeb4b('0x50')]=[{'all':!![]}];}return db[_0xeb4b('0x3b')][_0xeb4b('0x51')](_0x13b6ac);})[_0xeb4b('0x1f')](function(_0x2f638d){_0x4c76b4[_0xeb4b('0x52')]=_0x2f638d;return _0x4c76b4;})['then'](respondWithFilteredResult(_0x4c8f30,_0x13b6ac))['catch'](handleError(_0x4c8f30,null));};exports[_0xeb4b('0x53')]=function(_0x2a9001,_0x467b98){var _0x559688={'raw':![],'where':{'id':_0x2a9001[_0xeb4b('0x54')]['id']},'include':[{'model':db[_0xeb4b('0x39')],'as':_0xeb4b('0x3a')}]},_0x4119d8={};_0x4119d8[_0xeb4b('0x40')]=_[_0xeb4b('0x55')](db['SmsAccount'][_0xeb4b('0x3c')]);_0x4119d8[_0xeb4b('0x42')]=_[_0xeb4b('0x55')](_0x2a9001[_0xeb4b('0x42')]);_0x4119d8[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x4119d8[_0xeb4b('0x40')],_0x4119d8['query']);_0x559688[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x4119d8[_0xeb4b('0x40')],qs[_0xeb4b('0x46')](_0x2a9001[_0xeb4b('0x42')][_0xeb4b('0x46')]));_0x559688[_0xeb4b('0x45')]=_0x559688[_0xeb4b('0x45')][_0xeb4b('0x47')]?_0x559688[_0xeb4b('0x45')]:_0x4119d8[_0xeb4b('0x40')];if(_0x2a9001['query'][_0xeb4b('0x56')]){_0x559688[_0xeb4b('0x50')]=[{'all':!![]}];}_0x559688=_[_0xeb4b('0x4c')]({},_0x559688,_0x2a9001[_0xeb4b('0x4f')]);return db['SmsAccount']['find'](_0x559688)[_0xeb4b('0x1f')](handleEntityNotFound(_0x467b98,null))[_0xeb4b('0x1f')](respondWithResult(_0x467b98,null))[_0xeb4b('0x27')](handleError(_0x467b98,null));};exports[_0xeb4b('0x57')]=function(_0x269516,_0x3072cf){return db[_0xeb4b('0x3b')][_0xeb4b('0x57')](_0x269516['body'],{})['then'](function(_0x263334){var _0x41106f=_0x269516[_0xeb4b('0x58')][_0xeb4b('0x59')]({'plain':!![]});if(!_0x41106f)throw new Error(_0xeb4b('0x5a'));if(_0x41106f[_0xeb4b('0x5b')]==='user'){var _0x126303=_0x263334[_0xeb4b('0x59')]({'plain':!![]});var _0x541ec0='SmsAccounts';return db[_0xeb4b('0x5c')][_0xeb4b('0x5d')]({'where':{'name':_0x541ec0,'userProfileId':_0x41106f['userProfileId']},'raw':!![]})[_0xeb4b('0x1f')](function(_0xe1d6a0){if(_0xe1d6a0&&_0xe1d6a0[_0xeb4b('0x5e')]===0x0){return db[_0xeb4b('0x34')][_0xeb4b('0x57')]({'name':_0x126303[_0xeb4b('0x37')],'resourceId':_0x126303['id'],'type':_0xe1d6a0[_0xeb4b('0x37')],'sectionId':_0xe1d6a0['id']},{})['then'](function(){return _0x263334;});}else{return _0x263334;}})['catch'](function(_0x10441a){logger[_0xeb4b('0x23')](_0xeb4b('0x5f'),_0x10441a);throw _0x10441a;});}return _0x263334;})[_0xeb4b('0x1f')](respondWithResult(_0x3072cf,0xc9))[_0xeb4b('0x27')](handleError(_0x3072cf,null));};exports[_0xeb4b('0x60')]=function(_0xd47120,_0x19c2a9){if(_0xd47120[_0xeb4b('0x61')]['id']){delete _0xd47120['body']['id'];}return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0xd47120['params']['id']},'include':[{'model':db[_0xeb4b('0x39')],'as':_0xeb4b('0x3a')}]})[_0xeb4b('0x1f')](handleEntityNotFound(_0x19c2a9,null))[_0xeb4b('0x1f')](saveUpdates(_0xd47120[_0xeb4b('0x61')],null))[_0xeb4b('0x1f')](respondWithResult(_0x19c2a9,null))[_0xeb4b('0x27')](handleError(_0x19c2a9,null));};exports['destroy']=function(_0x4ebc61,_0x57fb5e){return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x4ebc61[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x57fb5e,null))[_0xeb4b('0x1f')](removeEntity(_0x57fb5e,null))['catch'](handleError(_0x57fb5e,null));};exports[_0xeb4b('0x62')]=function(_0x116e0a,_0x143853){return db['SmsAccount'][_0xeb4b('0x62')]()[_0xeb4b('0x1f')](respondWithResult(_0x143853,null))[_0xeb4b('0x27')](handleError(_0x143853,null));};exports[_0xeb4b('0x63')]=function(_0x1cbcb1,_0x51854c,_0x397029){if(_0x1cbcb1[_0xeb4b('0x61')]['id']){delete _0x1cbcb1[_0xeb4b('0x61')]['id'];}return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x1cbcb1[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x51854c,null))[_0xeb4b('0x1f')](function(_0x3fca23){if(_0x3fca23){_0x1cbcb1[_0xeb4b('0x61')][_0xeb4b('0x64')]=_0x3fca23['id'];return db['Disposition']['create'](_0x1cbcb1[_0xeb4b('0x61')]);}})['then'](respondWithResult(_0x51854c,null))[_0xeb4b('0x27')](handleError(_0x51854c,null));};exports[_0xeb4b('0x65')]=function(_0x14a6ae,_0x55cb1d,_0x16e8b6){var _0x525f6a={'raw':![],'where':{}};var _0x1bbf04={};var _0x10d85e={'count':0x0,'rows':[]};return db[_0xeb4b('0x3b')][_0xeb4b('0x66')]({'where':{'id':_0x14a6ae[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x55cb1d,null))['then'](function(_0x5cce9f){if(_0x5cce9f){_0x1bbf04['model']=_['keys'](db[_0xeb4b('0x67')]['rawAttributes']);_0x1bbf04['query']=_[_0xeb4b('0x55')](_0x14a6ae[_0xeb4b('0x42')]);_0x1bbf04[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x1bbf04[_0xeb4b('0x40')],_0x1bbf04[_0xeb4b('0x42')]);_0x525f6a[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x1bbf04[_0xeb4b('0x40')],qs['fields'](_0x14a6ae['query'][_0xeb4b('0x46')]));_0x525f6a[_0xeb4b('0x45')]=_0x525f6a[_0xeb4b('0x45')][_0xeb4b('0x47')]?_0x525f6a[_0xeb4b('0x45')]:_0x1bbf04[_0xeb4b('0x40')];if(!_0x14a6ae['query']['hasOwnProperty'](_0xeb4b('0x49'))){_0x525f6a[_0xeb4b('0x2d')]=qs[_0xeb4b('0x2d')](_0x14a6ae[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x525f6a['offset']=qs[_0xeb4b('0x2b')](_0x14a6ae[_0xeb4b('0x42')][_0xeb4b('0x2b')]);}_0x525f6a['order']=qs[_0xeb4b('0x4a')](_0x14a6ae[_0xeb4b('0x42')]['sort']);_0x525f6a[_0xeb4b('0x4b')]=qs[_0xeb4b('0x43')](_[_0xeb4b('0x68')](_0x14a6ae['query'],_0x1bbf04['filters']));_0x525f6a['where'][_0xeb4b('0x64')]=_0x5cce9f['id'];if(_0x14a6ae['query'][_0xeb4b('0x4e')]){_0x525f6a[_0xeb4b('0x4b')]=_['merge'](_0x525f6a[_0xeb4b('0x4b')],{'$or':_[_0xeb4b('0x41')](_0x525f6a['attributes'],function(_0xf6eeea){var _0x374f4c={};_0x374f4c[_0xf6eeea]={'$like':'%'+_0x14a6ae[_0xeb4b('0x42')]['filter']+'%'};return _0x374f4c;})});}_0x525f6a=_[_0xeb4b('0x4c')]({},_0x525f6a,_0x14a6ae[_0xeb4b('0x4f')]);return db['Disposition'][_0xeb4b('0x2e')]({'where':_0x525f6a[_0xeb4b('0x4b')]})[_0xeb4b('0x1f')](function(_0x2dac34){_0x10d85e[_0xeb4b('0x2e')]=_0x2dac34;if(_0x14a6ae[_0xeb4b('0x42')][_0xeb4b('0x56')]){_0x525f6a[_0xeb4b('0x50')]=[{'all':!![]}];}return db[_0xeb4b('0x67')][_0xeb4b('0x51')](_0x525f6a);})[_0xeb4b('0x1f')](function(_0x317091){_0x10d85e[_0xeb4b('0x52')]=_0x317091;return _0x10d85e;});}})[_0xeb4b('0x1f')](respondWithFilteredResult(_0x55cb1d,_0x525f6a))[_0xeb4b('0x27')](handleError(_0x55cb1d,null));};exports[_0xeb4b('0x69')]=function(_0x1e8c47,_0x4ad51f,_0x3a9049){return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x1e8c47[_0xeb4b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ad51f,null))[_0xeb4b('0x1f')](function(_0x5eb022){if(_0x5eb022){return _0x5eb022[_0xeb4b('0x69')](_0x1e8c47['query'][_0xeb4b('0x6a')]);}})[_0xeb4b('0x1f')](respondWithStatusCode(_0x4ad51f,null))[_0xeb4b('0x27')](handleError(_0x4ad51f,null));};exports[_0xeb4b('0x6b')]=function(_0xb2f5cc,_0x1d28e0,_0x1e45e8){if(_0xb2f5cc['body']['id']){delete _0xb2f5cc[_0xeb4b('0x61')]['id'];}return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0xb2f5cc[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x1d28e0,null))[_0xeb4b('0x1f')](function(_0x4673aa){if(_0x4673aa){_0xb2f5cc[_0xeb4b('0x61')][_0xeb4b('0x64')]=_0x4673aa['id'];return db[_0xeb4b('0x6c')][_0xeb4b('0x57')](_0xb2f5cc[_0xeb4b('0x61')]);}})[_0xeb4b('0x1f')](respondWithResult(_0x1d28e0,null))[_0xeb4b('0x27')](handleError(_0x1d28e0,null));};exports[_0xeb4b('0x6d')]=function(_0x5cf501,_0x39520c,_0x4f10e0){var _0x5dcfd4={'raw':![],'where':{}};var _0x50dd71={};var _0x285762={'count':0x0,'rows':[]};return db[_0xeb4b('0x3b')][_0xeb4b('0x66')]({'where':{'id':_0x5cf501[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x39520c,null))[_0xeb4b('0x1f')](function(_0xb82122){if(_0xb82122){_0x50dd71[_0xeb4b('0x40')]=_[_0xeb4b('0x55')](db[_0xeb4b('0x6c')][_0xeb4b('0x3c')]);_0x50dd71[_0xeb4b('0x42')]=_['keys'](_0x5cf501[_0xeb4b('0x42')]);_0x50dd71[_0xeb4b('0x43')]=_['intersection'](_0x50dd71[_0xeb4b('0x40')],_0x50dd71[_0xeb4b('0x42')]);_0x5dcfd4[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x50dd71[_0xeb4b('0x40')],qs[_0xeb4b('0x46')](_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x46')]));_0x5dcfd4[_0xeb4b('0x45')]=_0x5dcfd4[_0xeb4b('0x45')][_0xeb4b('0x47')]?_0x5dcfd4[_0xeb4b('0x45')]:_0x50dd71[_0xeb4b('0x40')];if(!_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x48')](_0xeb4b('0x49'))){_0x5dcfd4[_0xeb4b('0x2d')]=qs['limit'](_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x5dcfd4[_0xeb4b('0x2b')]=qs[_0xeb4b('0x2b')](_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x2b')]);}_0x5dcfd4[_0xeb4b('0x6e')]=qs[_0xeb4b('0x4a')](_0x5cf501[_0xeb4b('0x42')]['sort']);_0x5dcfd4['where']=qs[_0xeb4b('0x43')](_[_0xeb4b('0x68')](_0x5cf501[_0xeb4b('0x42')],_0x50dd71[_0xeb4b('0x43')]));_0x5dcfd4[_0xeb4b('0x4b')][_0xeb4b('0x64')]=_0xb82122['id'];if(_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x4e')]){_0x5dcfd4[_0xeb4b('0x4b')]=_[_0xeb4b('0x4c')](_0x5dcfd4['where'],{'$or':_[_0xeb4b('0x41')](_0x5dcfd4['attributes'],function(_0xe2a7bb){var _0x3565a7={};_0x3565a7[_0xe2a7bb]={'$like':'%'+_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x4e')]+'%'};return _0x3565a7;})});}_0x5dcfd4=_[_0xeb4b('0x4c')]({},_0x5dcfd4,_0x5cf501[_0xeb4b('0x4f')]);return db[_0xeb4b('0x6c')]['count']({'where':_0x5dcfd4['where']})[_0xeb4b('0x1f')](function(_0x361ea1){_0x285762[_0xeb4b('0x2e')]=_0x361ea1;if(_0x5cf501[_0xeb4b('0x42')][_0xeb4b('0x56')]){_0x5dcfd4[_0xeb4b('0x50')]=[{'all':!![]}];}return db[_0xeb4b('0x6c')][_0xeb4b('0x51')](_0x5dcfd4);})[_0xeb4b('0x1f')](function(_0x20084f){_0x285762['rows']=_0x20084f;return _0x285762;});}})[_0xeb4b('0x1f')](respondWithFilteredResult(_0x39520c,_0x5dcfd4))[_0xeb4b('0x27')](handleError(_0x39520c,null));};exports[_0xeb4b('0x6f')]=function(_0x9c7d3a,_0x527eec,_0x1e76d1){return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x9c7d3a[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x527eec,null))['then'](function(_0x171132){if(_0x171132){return _0x171132[_0xeb4b('0x6f')](_0x9c7d3a[_0xeb4b('0x42')][_0xeb4b('0x6a')]);}})[_0xeb4b('0x1f')](respondWithStatusCode(_0x527eec,null))[_0xeb4b('0x27')](handleError(_0x527eec,null));};exports[_0xeb4b('0x70')]=function(_0x2d845c,_0x57b1fd,_0x88871a){var _0x2dba20={'channel':_0xeb4b('0x71')};var _0xe558f=[];var _0x139ed2=[];var _0x1acfb2={};return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x2d845c[_0xeb4b('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xeb4b('0x72')}]})[_0xeb4b('0x1f')](handleEntityNotFound(_0x57b1fd,null))[_0xeb4b('0x1f')](function(_0x4ef5a3){_0x2dba20[_0xeb4b('0x73')]=_0x4ef5a3;_0x2dba20[_0xeb4b('0x74')]=_[_0xeb4b('0x75')](_0x4ef5a3[_0xeb4b('0x72')],[_0xeb4b('0x76')],[_0xeb4b('0x77')]);if(_0x2dba20[_0xeb4b('0x73')]['Applications']){delete _0x2dba20['account']['Applications'];}return db['CmContact'][_0xeb4b('0x62')]();})[_0xeb4b('0x1f')](function(_0x54a3e9){if(!_0x54a3e9){throw new db[(_0xeb4b('0x78'))][(_0xeb4b('0x79'))](_0xeb4b('0x7a'));}_0xe558f=_[_0xeb4b('0x7b')](_[_0xeb4b('0x55')](_0x54a3e9),[_0xeb4b('0x7c'),'updatedAt']);_0x139ed2=_[_0xeb4b('0x7b')](_[_0xeb4b('0x55')](_0x54a3e9),[_0xeb4b('0x7c'),'updatedAt','CompanyId',_0xeb4b('0x7d')]);_0x2dba20[_0xeb4b('0x61')]={'mapKey':'mobile'};if(_0x2dba20['account']['type']){switch(_0x2dba20[_0xeb4b('0x73')][_0xeb4b('0x3e')]){case'twilio':_0x2dba20['body'][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x7f')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x61')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x80')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x81')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x82')];break;case'skebby':_0x2dba20['body'][_0xeb4b('0x7e')]='+'+_0x2d845c['body'][_0xeb4b('0x83')];_0x2dba20[_0xeb4b('0x61')]['body']=_0x2d845c['body'][_0xeb4b('0x84')];break;case _0xeb4b('0x85'):_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x7e')];_0x2dba20['body']['body']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x25')];break;case _0xeb4b('0x86'):_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')]['from'];_0x2dba20[_0xeb4b('0x61')]['body']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x61')];_0x2dba20['body'][_0xeb4b('0x81')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x87')];break;case'plivo':_0x2dba20[_0xeb4b('0x61')]['from']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x7f')];_0x2dba20['body'][_0xeb4b('0x61')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x88')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x81')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x89')];break;case'infobip':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')]='+'+_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x8a')][0x0][_0xeb4b('0x7e')];_0x2dba20['body'][_0xeb4b('0x61')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x8a')][0x0][_0xeb4b('0x84')];_0x2dba20['body']['messageId']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x8a')][0x0][_0xeb4b('0x81')];break;case _0xeb4b('0x8b'):_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x8c')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x61')]=_0x2d845c[_0xeb4b('0x61')]['segmentedMessage'][_0xeb4b('0x25')];break;case _0xeb4b('0x8d'):_0x2dba20[_0xeb4b('0x61')]['from']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x8e')];_0x2dba20[_0xeb4b('0x61')]['body']=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x84')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x81')]=_0x2d845c[_0xeb4b('0x61')]['replyMessageId'];break;case _0xeb4b('0x8f'):_0x2dba20[_0xeb4b('0x61')]['messageId']=_0x2d845c[_0xeb4b('0x61')][0x0][_0xeb4b('0x25')]['id'];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')][0x0][_0xeb4b('0x25')][_0xeb4b('0x7e')];_0x2dba20['body'][_0xeb4b('0x61')]=_0x2d845c[_0xeb4b('0x61')][0x0][_0xeb4b('0x25')]['text'];break;case'intelepeer':_0x2dba20['body'][_0xeb4b('0x7e')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x7e')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x61')]=_0x2d845c['body'][_0xeb4b('0x25')];_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x81')]=_0x2d845c[_0xeb4b('0x61')][_0xeb4b('0x90')];break;}}if(_0x2dba20['body']['id']){delete _0x2dba20[_0xeb4b('0x61')]['id'];}if(_[_0xeb4b('0x91')](_0x2dba20['body'][_0xeb4b('0x7e')])){throw new db[(_0xeb4b('0x78'))][(_0xeb4b('0x79'))](_0xeb4b('0x92'));}if(_[_0xeb4b('0x91')](_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x61')])||_0x2dba20['body'][_0xeb4b('0x61')]===''){throw new db[(_0xeb4b('0x78'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeb4b('0x91')](_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x93')])){throw new db[(_0xeb4b('0x78'))][(_0xeb4b('0x79'))](_0xeb4b('0x94')+_0x139ed2);}if(!_[_0xeb4b('0x95')](_0x139ed2,_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x93')])){throw new db[(_0xeb4b('0x78'))][(_0xeb4b('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x139ed2);}_0x1acfb2[_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x93')]]=_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')];return db[_0xeb4b('0x96')][_0xeb4b('0x5d')]({'where':{'id':_0x2dba20[_0xeb4b('0x73')][_0xeb4b('0x7d')]},'include':[{'model':db['CmContact'],'as':_0xeb4b('0x97'),'where':_0x1acfb2,'limit':0x1,'order':[[_0xeb4b('0x98'),_0xeb4b('0x99')]]}]});})[_0xeb4b('0x1f')](handleEntityNotFound(_0x57b1fd,null))[_0xeb4b('0x1f')](function(_0xc59619){if(_0xc59619){_0x2dba20[_0xeb4b('0x9a')]=_[_0xeb4b('0x9b')](_0xc59619,[_0xeb4b('0x97')]);if(_0xc59619[_0xeb4b('0x97')]['length']){return _0xc59619[_0xeb4b('0x97')][0x0];}var _0x56c087=_[_0xeb4b('0x18')](_0x2dba20[_0xeb4b('0x61')],{'firstName':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')],'ListId':_0xc59619['id']});_0x56c087[_0x2dba20[_0xeb4b('0x61')]['mapKey']]=_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')];return db[_0xeb4b('0x9c')][_0xeb4b('0x57')](_0x56c087,{'fields':_0xe558f,'raw':!![]});}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x57b1fd,null))['then'](function(_0x400fca){if(_0x400fca){_0x2dba20['contact']=_0x400fca;var _0x5b9c5e={'ContactId':_0x400fca['id'],'phone':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x7e')],'SmsAccountId':_0x2d845c['params']['id']};var _0x5d5e76={'ContactId':_0x400fca['id'],'SmsAccountId':_0x2d845c[_0xeb4b('0x54')]['id'],'closed':![]};return db[_0xeb4b('0x9d')][_0xeb4b('0x5d')]({'where':_0x5d5e76})[_0xeb4b('0x1f')](function(_0x30eda0){if(_0x30eda0){return[_0x30eda0,![]];}return db[_0xeb4b('0x9d')][_0xeb4b('0x57')](_0x5b9c5e)[_0xeb4b('0x1f')](function(_0x594d2d){return[_0x594d2d,!![]];});});}})[_0xeb4b('0x9e')](function(_0x11c3f4,_0x11ad50){_0x2dba20[_0xeb4b('0x9f')]=_0x11c3f4['get']({'plain':!![]});_0x2dba20[_0xeb4b('0x9f')][_0xeb4b('0xa0')]=![];if(_0x11ad50){if(_0x2dba20[_0xeb4b('0x73')][_0xeb4b('0xa1')]){_0x2dba20[_0xeb4b('0x74')][_0xeb4b('0xa2')]({'id':0x0,'priority':_0x2dba20['applications'][_0xeb4b('0x47')]+0x1,'app':_0xeb4b('0xa3'),'appdata':_0xeb4b('0xa4'),'interval':_0xeb4b('0xa5')});}_0x2dba20[_0xeb4b('0x9f')][_0xeb4b('0xa0')]=!![];}return db[_0xeb4b('0xa6')]['create']({'phone':_0x2dba20[_0xeb4b('0x61')]['from'],'messageId':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x81')],'body':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0x61')],'SmsAccountId':_0x2d845c[_0xeb4b('0x54')]['id'],'SmsInteractionId':_0x11c3f4['id'],'direction':'in','ContactId':_0x11c3f4['ContactId'],'AttachmentId':_0x2dba20[_0xeb4b('0x61')][_0xeb4b('0xa7')]});})[_0xeb4b('0x1f')](function(_0x59ff11){_0x2dba20[_0xeb4b('0x25')]=_0x59ff11;if(_0x2dba20[_0xeb4b('0x9f')][_0xeb4b('0xa8')]){return db[_0xeb4b('0xa9')]['find']({'attributes':['id',_0xeb4b('0x37')],'where':{'id':_0x2dba20[_0xeb4b('0x9f')][_0xeb4b('0xa8')]}})[_0xeb4b('0x1f')](function(_0x2603fd){if(_0x2603fd){_0x2dba20[_0xeb4b('0x74')][_0xeb4b('0xaa')]({'id':0x0,'priority':0x0,'app':_0xeb4b('0xab'),'appdata':_0x2603fd[_0xeb4b('0x37')]+','+(_0x2dba20[_0xeb4b('0x73')][_0xeb4b('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xeb4b('0xad'),_0xeb4b('0xae'),_0x2dba20);});}return respondWithRpcPromise(_0xeb4b('0xad'),_0xeb4b('0xae'),_0x2dba20);})[_0xeb4b('0x1f')](function(_0x468693){if(_0x468693){var _0x10e52e=0xc8;var _0xd20602='receiveMessage';logger[_0xeb4b('0x20')](_0xeb4b('0xaf'),_0xd20602,_0x10e52e,_0xeb4b('0xb0'));logger[_0xeb4b('0xb1')](_0xeb4b('0xb2'),_0xd20602,_0x10e52e,'entity\x20found',JSON[_0xeb4b('0x22')](_0x468693));if(_0x2dba20[_0xeb4b('0x73')][_0xeb4b('0x3e')]===_0xeb4b('0xb3')){return _0x57b1fd[_0xeb4b('0x29')](_0x10e52e)[_0xeb4b('0xb4')](_0xeb4b('0xb5'),_0xeb4b('0xb6'))[_0xeb4b('0x38')](_0xeb4b('0xb7'));}else{return _0x57b1fd[_0xeb4b('0x29')](_0x10e52e)[_0xeb4b('0x2a')](_0x468693);}}})[_0xeb4b('0x27')](handleError(_0x57b1fd,null));};exports[_0xeb4b('0xb8')]=function(_0x394ed6,_0x396bc5,_0x18d34b){return db[_0xeb4b('0x3b')][_0xeb4b('0x66')]({'where':{'id':_0x394ed6[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x396bc5,null))[_0xeb4b('0x1f')](function(_0x38a85b){if(_0x38a85b){return db['sequelize'][_0xeb4b('0xb9')](function(_0x21518f){return db[_0xeb4b('0xba')][_0xeb4b('0x35')]({'where':{'SmsAccountId':_0x394ed6[_0xeb4b('0x54')]['id']},'transaction':_0x21518f})[_0xeb4b('0x1f')](function(_0x2c047a){var _0x32c7aa=_[_0xeb4b('0x41')](_0x394ed6[_0xeb4b('0x61')],function(_0x5795ef){_0x5795ef['SmsAccountId']=_0x394ed6[_0xeb4b('0x54')]['id'];return _0x5795ef;});return db[_0xeb4b('0xba')]['bulkCreate'](_0x32c7aa,{'transaction':_0x21518f});});})[_0xeb4b('0x1f')](function(){return db['SmsApplication'][_0xeb4b('0xbb')]({'where':{'SmsAccountId':_0x394ed6[_0xeb4b('0x54')]['id']},'order':'priority'});});}})[_0xeb4b('0x1f')](respondWithResult(_0x396bc5,null))[_0xeb4b('0x27')](handleError(_0x396bc5,null));};exports[_0xeb4b('0xbc')]=function(_0x2b9a39,_0x2f1540,_0x5025d8){var _0x1422aa={};var _0x44a20d={};var _0x497f0b;var _0x31016b;return db['SmsAccount'][_0xeb4b('0x66')]({'where':{'id':_0x2b9a39['params']['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x2f1540,null))[_0xeb4b('0x1f')](function(_0x2ae934){if(_0x2ae934){_0x497f0b=_0x2ae934;_0x44a20d[_0xeb4b('0x40')]=_[_0xeb4b('0x55')](db['SmsApplication']['rawAttributes']);_0x44a20d['query']=_[_0xeb4b('0x55')](_0x2b9a39['query']);_0x44a20d[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x44a20d[_0xeb4b('0x40')],_0x44a20d[_0xeb4b('0x42')]);_0x1422aa[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x44a20d['model'],qs[_0xeb4b('0x46')](_0x2b9a39['query'][_0xeb4b('0x46')]));_0x1422aa[_0xeb4b('0x45')]=_0x1422aa[_0xeb4b('0x45')]['length']?_0x1422aa[_0xeb4b('0x45')]:_0x44a20d['model'];_0x1422aa[_0xeb4b('0x6e')]=qs['sort'](_0x2b9a39[_0xeb4b('0x42')][_0xeb4b('0x4a')]);_0x1422aa[_0xeb4b('0x4b')]=qs[_0xeb4b('0x43')](_['pick'](_0x2b9a39[_0xeb4b('0x42')],_0x44a20d['filters']));if(_0x2b9a39[_0xeb4b('0x42')]['filter']){_0x1422aa[_0xeb4b('0x4b')]=_[_0xeb4b('0x4c')](_0x1422aa[_0xeb4b('0x4b')],{'$or':_[_0xeb4b('0x41')](_0x1422aa[_0xeb4b('0x45')],function(_0x1c53be){var _0x5af05c={};_0x5af05c[_0x1c53be]={'$like':'%'+_0x2b9a39['query'][_0xeb4b('0x4e')]+'%'};return _0x5af05c;})});}_0x1422aa=_[_0xeb4b('0x4c')]({},_0x1422aa,_0x2b9a39['options']);return _0x497f0b[_0xeb4b('0xbc')](_0x1422aa);}})[_0xeb4b('0x1f')](function(_0x7c6df5){if(_0x7c6df5){_0x31016b=_0x7c6df5[_0xeb4b('0x47')];if(!_0x2b9a39[_0xeb4b('0x42')]['hasOwnProperty'](_0xeb4b('0x49'))){_0x1422aa['limit']=qs[_0xeb4b('0x2d')](_0x2b9a39[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x1422aa[_0xeb4b('0x2b')]=qs[_0xeb4b('0x2b')](_0x2b9a39[_0xeb4b('0x42')]['offset']);}return _0x497f0b[_0xeb4b('0xbc')](_0x1422aa);}})[_0xeb4b('0x1f')](function(_0x123a2a){if(_0x123a2a){return _0x123a2a?{'count':_0x31016b,'rows':_0x123a2a}:null;}})[_0xeb4b('0x1f')](respondWithResult(_0x2f1540,null))[_0xeb4b('0x27')](handleError(_0x2f1540,null));};exports[_0xeb4b('0xbd')]=function(_0x546f7a,_0x41ecb5,_0xab5b71){var _0x36ab5e={'raw':![],'where':{}};var _0x58574a={};var _0x11fe26={'count':0x0,'rows':[]};return db['SmsAccount'][_0xeb4b('0x66')]({'where':{'id':_0x546f7a[_0xeb4b('0x54')]['id']}})['then'](handleEntityNotFound(_0x41ecb5,null))[_0xeb4b('0x1f')](function(_0x2b32a0){if(_0x2b32a0){_0x58574a[_0xeb4b('0x40')]=_['keys'](db[_0xeb4b('0x9d')]['rawAttributes']);_0x58574a[_0xeb4b('0x42')]=_[_0xeb4b('0x55')](_0x546f7a[_0xeb4b('0x42')]);_0x58574a[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x58574a[_0xeb4b('0x40')],_0x58574a[_0xeb4b('0x42')]);_0x36ab5e[_0xeb4b('0x45')]=_[_0xeb4b('0x44')](_0x58574a['model'],qs[_0xeb4b('0x46')](_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x46')]));_0x36ab5e[_0xeb4b('0x45')]=_0x36ab5e['attributes']['length']?_0x36ab5e[_0xeb4b('0x45')]:_0x58574a[_0xeb4b('0x40')];if(!_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x48')](_0xeb4b('0x49'))){_0x36ab5e[_0xeb4b('0x2d')]=qs['limit'](_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x36ab5e['offset']=qs[_0xeb4b('0x2b')](_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x2b')]);}_0x36ab5e[_0xeb4b('0x6e')]=qs['sort'](_0x546f7a['query'][_0xeb4b('0x4a')]);_0x36ab5e[_0xeb4b('0x4b')]=qs[_0xeb4b('0x43')](_[_0xeb4b('0x68')](_0x546f7a[_0xeb4b('0x42')],_0x58574a['filters']));_0x36ab5e['where'][_0xeb4b('0x64')]=_0x2b32a0['id'];if(_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x4e')]){_0x36ab5e['where']=_[_0xeb4b('0x4c')](_0x36ab5e[_0xeb4b('0x4b')],{'$or':_['map'](_0x36ab5e[_0xeb4b('0x45')],function(_0x4acb04){var _0x17dad5={};_0x17dad5[_0x4acb04]={'$like':'%'+_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0x4e')]+'%'};return _0x17dad5;})});}_0x36ab5e=_[_0xeb4b('0x4c')]({},_0x36ab5e,_0x546f7a[_0xeb4b('0x4f')]);return db[_0xeb4b('0x9d')]['count']({'where':_0x36ab5e[_0xeb4b('0x4b')]})['then'](function(_0x2635cf){_0x11fe26[_0xeb4b('0x2e')]=_0x2635cf;if(_0x546f7a['query'][_0xeb4b('0x56')]){_0x36ab5e[_0xeb4b('0x50')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xeb4b('0xbe'),'attributes':[_0xeb4b('0x37'),_0xeb4b('0xbf'),_0xeb4b('0xc0')],'required':![]},{'model':db[_0xeb4b('0xc1')],'as':_0xeb4b('0xc2'),'attributes':['id',_0xeb4b('0x37'),'color'],'where':_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0xc3')]?{'id':_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0xc3')]}:undefined,'required':_0x546f7a[_0xeb4b('0x42')][_0xeb4b('0xc3')]?!![]:![]}];}return db[_0xeb4b('0x9d')][_0xeb4b('0x51')](_0x36ab5e);})[_0xeb4b('0x1f')](function(_0x2c5255){_0x11fe26[_0xeb4b('0x52')]=_0x2c5255;return _0x11fe26;});}})['then'](respondWithFilteredResult(_0x41ecb5,_0x36ab5e))[_0xeb4b('0x27')](handleError(_0x41ecb5,null));};exports[_0xeb4b('0x38')]=function(_0x22a551,_0x357694,_0x5c10c7){var _0x246a96,_0x2ea160,_0x8899df;if(_[_0xeb4b('0x91')](_0x22a551['body']['body'])||_0x22a551[_0xeb4b('0x61')][_0xeb4b('0x61')]===''){throw new db['Sequelize'][(_0xeb4b('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeb4b('0x91')](_0x22a551['body']['to'])){throw new db['Sequelize']['ValidationError'](_0xeb4b('0xc4'));}_0x246a96=_0x22a551[_0xeb4b('0x61')]['to'];return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x22a551[_0xeb4b('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0xeb4b('0xc5'),'include':[{'model':db[_0xeb4b('0x9c')],'as':_0xeb4b('0x97'),'where':{'mobile':_0x246a96},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xeb4b('0x1f')](handleEntityNotFound(_0x357694,null))['then'](function(_0x532171){if(_0x532171&&_0x532171[_0xeb4b('0xc5')]){_0x2ea160=_0x532171['get']({'plain':!![]});if(_0x2ea160['List']&&_0x2ea160['List'][_0xeb4b('0x97')][_0xeb4b('0x47')]){return _0x2ea160[_0xeb4b('0xc5')][_0xeb4b('0x97')][0x0];}return db[_0xeb4b('0x9c')][_0xeb4b('0x57')](_[_0xeb4b('0x18')](_0x22a551[_0xeb4b('0x61')],{'firstName':_0x246a96,'mobile':_0x246a96,'phone':_0x246a96,'ListId':_0x2ea160[_0xeb4b('0x7d')]}));}})['then'](handleEntityNotFound(_0x357694,null))[_0xeb4b('0x1f')](function(_0x49976f){if(_0x49976f){_0x8899df=_0x49976f;return db[_0xeb4b('0x9d')][_0xeb4b('0x5d')]({'where':{'ContactId':_0x8899df['id'],'closed':![],'SmsAccountId':_0x2ea160['id']}})[_0xeb4b('0x1f')](function(_0xff83c1){if(_0xff83c1){return[_0xff83c1,![]];}return db[_0xeb4b('0x9d')]['create']({'UserId':_0x22a551[_0xeb4b('0x58')]['id'],'ContactId':_0x8899df['id'],'SmsAccountId':_0x2ea160['id'],'phone':_0x246a96,'firstMsgDirection':_0xeb4b('0xc6'),'Messages':[_[_0xeb4b('0x4c')](_0x22a551[_0xeb4b('0x61')],{'read':![],'body':_0x22a551[_0xeb4b('0x61')]['body'],'phone':_0x246a96,'SmsAccountId':_0x2ea160['id'],'UserId':_0x22a551[_0xeb4b('0x58')]['id'],'ContactId':_0x8899df['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xeb4b('0xc7')}]})['then'](function(_0x72a1c2){return[_0x72a1c2,!![]];});});}})[_0xeb4b('0x9e')](function(_0x182e50,_0x2a2666){if(_0x2a2666){return _0x182e50;}return db[_0xeb4b('0xa6')]['create'](_[_0xeb4b('0x4c')](_0x22a551[_0xeb4b('0x61')],{'read':![],'body':_0x22a551[_0xeb4b('0x61')][_0xeb4b('0x61')],'phone':_0x246a96,'SmsAccountId':_0x2ea160['id'],'SmsInteractionId':_0x182e50['id'],'UserId':_0x22a551['user']['id'],'ContactId':_0x8899df['id']}))[_0xeb4b('0x1f')](function(_0x53b139){_0x182e50[_0xeb4b('0xc8')]['Messages']=[];_0x182e50[_0xeb4b('0xc8')][_0xeb4b('0xc7')]['push'](_0x53b139[_0xeb4b('0xc8')]);return _0x182e50;});})[_0xeb4b('0x1f')](respondWithResult(_0x357694,null))[_0xeb4b('0x27')](handleError(_0x357694,null));};exports[_0xeb4b('0x29')]=function(_0x574fb6,_0x1892f4,_0x729f63){if(_0x574fb6['body']['id']){delete _0x574fb6[_0xeb4b('0x61')]['id'];}var _0x21f593,_0x169d55,_0x2b3fee;return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0x574fb6[_0xeb4b('0x54')]['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x1892f4,null))[_0xeb4b('0x1f')](function(_0x42a1e8){if(_0x42a1e8){_0x2b3fee=_0x42a1e8;logger[_0xeb4b('0xb1')](_0xeb4b('0xaf'),_0xeb4b('0x29'),_0xeb4b('0xc9'),_0x42a1e8[_0xeb4b('0x3e')],util[_0xeb4b('0xca')](_0x574fb6[_0xeb4b('0x61')],{'showHidden':![],'depth':null}));switch(_0x42a1e8['type']){case _0xeb4b('0xcb'):if(_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xcc')]&&_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x29')]){_0x169d55=_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x29')];return db[_0xeb4b('0xa6')][_0xeb4b('0x5d')]({'where':{'messageId':_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xcc')]}});}break;case'connectel':if(_0x574fb6[_0xeb4b('0x61')]['requestid']&&_0x574fb6['body'][_0xeb4b('0xcd')]){_0x169d55=_0x574fb6['body'][_0xeb4b('0xcd')];return db[_0xeb4b('0xa6')][_0xeb4b('0x5d')]({'where':{'messageId':_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xce')]}});}break;case _0xeb4b('0x86'):if(_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x87')]&&_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xcf')]){_0x169d55=_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xcf')];return db[_0xeb4b('0xa6')]['find']({'where':{'messageId':_0x574fb6['body']['message_id']}});}break;case'infobip':var _0x4120df=_0x574fb6['body'][_0xeb4b('0x8a')][0x0];if(_0x4120df[_0xeb4b('0x81')]&&_0x4120df[_0xeb4b('0x29')][_0xeb4b('0xd0')]===_0xeb4b('0xd1')){_0x169d55=_0x4120df[_0xeb4b('0x29')]['groupName'];return db['SmsMessage'][_0xeb4b('0x5d')]({'where':{'messageId':_0x4120df['messageId']}});}break;case _0xeb4b('0x8d'):if(_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x81')]&&_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x29')]){_0x169d55=_0x574fb6['body'][_0xeb4b('0x29')];return db[_0xeb4b('0xa6')][_0xeb4b('0x5d')]({'where':{'messageId':_0x574fb6['body'][_0xeb4b('0x81')]}});}break;case'bandwidth':if(_0x574fb6[_0xeb4b('0x61')][0x0][_0xeb4b('0x25')]['id']){_0x169d55=_0x574fb6[_0xeb4b('0x61')][0x0][_0xeb4b('0x3e')];return db['SmsMessage'][_0xeb4b('0x5d')]({'where':{'messageId':_0x574fb6[_0xeb4b('0x61')][0x0][_0xeb4b('0x25')]['id']}});}break;case'intelepeer':if(_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xd2')]&&_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x29')]){_0x169d55=_0x574fb6[_0xeb4b('0x61')]['status'];return db['SmsMessage'][_0xeb4b('0x5d')]({'where':{'messageId':_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0xd2')]}});}break;}}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x1892f4,null))[_0xeb4b('0x1f')](function(_0xb953d6){if(_0xb953d6){_0x21f593=_0xb953d6;switch(_0x2b3fee[_0xeb4b('0x3e')]){case _0xeb4b('0xcb'):if(_0x169d55===_0xeb4b('0xd1')){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeb4b('0x29'),'skebby',util['inspect'](_0x574fb6[_0xeb4b('0x61')],{'showHidden':![],'depth':null}));}break;case _0xeb4b('0x85'):if(_0x169d55==='1'){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')](_0xeb4b('0xaf'),_0xeb4b('0x29'),_0xeb4b('0xcb'),util[_0xeb4b('0xca')](_0x574fb6['body'],{'showHidden':![],'depth':null}));}break;case _0xeb4b('0x86'):if(!_0x574fb6['body'][_0xeb4b('0xd3')]&&_0x169d55>=0xc8&&_0x169d55<=0xce){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')](_0xeb4b('0xaf'),_0xeb4b('0x29'),_0xeb4b('0x86'),util[_0xeb4b('0xca')](_0x574fb6[_0xeb4b('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x18d9a0=_0x574fb6[_0xeb4b('0x61')][_0xeb4b('0x8a')][0x0];if(_0x18d9a0[_0xeb4b('0x29')][_0xeb4b('0xd0')]===_0xeb4b('0xd1')){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeb4b('0x29'),_0xeb4b('0xd4'),util[_0xeb4b('0xca')](_0x574fb6[_0xeb4b('0x61')],{'showHidden':![],'depth':null}));}break;case _0xeb4b('0x8d'):if(_0x169d55==_0xeb4b('0xd5')||_0x169d55==_0xeb4b('0xd6')){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clickatell',util[_0xeb4b('0xca')](_0x574fb6['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x169d55=='message-delivered'){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeb4b('0x29'),_0xeb4b('0x8f'),util['inspect'](_0x574fb6['body'],{'showHidden':![],'depth':null}));}break;case _0xeb4b('0xd7'):if(_0x169d55==='DELIVRD'||_0x169d55==='ACCEPTD'){return _0x21f593[_0xeb4b('0x60')]({'read':!![]});}else{logger['error'](_0xeb4b('0xaf'),_0xeb4b('0x29'),_0xeb4b('0xd7'),util[_0xeb4b('0xca')](_0x574fb6[_0xeb4b('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x21f593;}})['then'](respondWithResult(_0x1892f4,null))[_0xeb4b('0x27')](handleError(_0x1892f4,null));};exports['statusGet']=function(_0x7f3539,_0x40f18c,_0x20079d){var _0x4adda0,_0x517935,_0x187e98;return db['SmsAccount']['find']({'where':{'id':_0x7f3539['params']['id']}})['then'](handleEntityNotFound(_0x40f18c,null))['then'](function(_0x597ae8){if(_0x597ae8){_0x187e98=_0x597ae8;logger[_0xeb4b('0xb1')](_0xeb4b('0xaf'),'status','received\x20delivery\x20report\x20from',_0x597ae8[_0xeb4b('0x3e')],util['inspect'](_0x7f3539[_0xeb4b('0x42')],{'showHidden':![],'depth':null}));switch(_0x597ae8[_0xeb4b('0x3e')]){case _0xeb4b('0x8b'):if(_0x7f3539[_0xeb4b('0x42')][_0xeb4b('0xd8')]&&_0x7f3539['query'][_0xeb4b('0xd9')]){_0x517935=_0x7f3539[_0xeb4b('0x42')][_0xeb4b('0xd9')];return db[_0xeb4b('0xa6')][_0xeb4b('0x5d')]({'where':{'messageId':_0x7f3539['query'][_0xeb4b('0xd8')]}});}break;}}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x40f18c,null))['then'](function(_0x33c779){if(_0x33c779){_0x4adda0=_0x33c779;switch(_0x187e98[_0xeb4b('0x3e')]){case'csc':if(_0x517935==='2'||_0x517935==='6'){return _0x4adda0[_0xeb4b('0x60')]({'read':!![]});}else{logger[_0xeb4b('0x23')](_0xeb4b('0xaf'),_0xeb4b('0x29'),_0xeb4b('0x8b'),util[_0xeb4b('0xca')](_0x7f3539[_0xeb4b('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x4adda0;}})[_0xeb4b('0x1f')](respondWithResult(_0x40f18c,null))[_0xeb4b('0x27')](handleError(_0x40f18c,null));};exports[_0xeb4b('0xda')]=function(_0x119431,_0x4b83d7,_0x57d042){return db[_0xeb4b('0x3b')]['find']({'where':{'id':_0x119431['params']['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x4b83d7,null))[_0xeb4b('0x1f')](function(_0x32ac06){if(_0x32ac06){return _0x32ac06[_0xeb4b('0xda')](_0x119431[_0xeb4b('0x61')][_0xeb4b('0x6a')],_['omit'](_0x119431[_0xeb4b('0x61')],[_0xeb4b('0x6a'),'id'])||{})[_0xeb4b('0x9e')](function(_0x296e77){for(var _0x4769e4=0x0;_0x4769e4<_0x119431[_0xeb4b('0x61')][_0xeb4b('0x6a')][_0xeb4b('0x47')];_0x4769e4+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x119431[_0xeb4b('0x61')][_0xeb4b('0x6a')][_0x4769e4]),'SmsAccountId':Number(_0x119431[_0xeb4b('0x54')]['id'])});}return _0x296e77;});}})[_0xeb4b('0x1f')](respondWithResult(_0x4b83d7,null))[_0xeb4b('0x27')](handleError(_0x4b83d7,null));};exports[_0xeb4b('0xdb')]=function(_0xd5ac8a,_0x135ff3,_0x73501c){return db[_0xeb4b('0x3b')][_0xeb4b('0x5d')]({'where':{'id':_0xd5ac8a['params']['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x135ff3,null))[_0xeb4b('0x1f')](function(_0xe304ad){if(_0xe304ad){return _0xe304ad['removeAgents'](_0xd5ac8a['query']['ids'])[_0xeb4b('0x1f')](function(){if(_[_0xeb4b('0xdc')](_0xd5ac8a[_0xeb4b('0x42')][_0xeb4b('0x6a')])){for(var _0x4e0492=0x0;_0x4e0492<_0xd5ac8a[_0xeb4b('0x42')][_0xeb4b('0x6a')]['length'];_0x4e0492+=0x1){socket[_0xeb4b('0xdd')](_0xeb4b('0xde'),{'UserId':Number(_0xd5ac8a['query']['ids'][_0x4e0492]),'SmsAccountId':Number(_0xd5ac8a[_0xeb4b('0x54')]['id'])});}}else{socket['emit'](_0xeb4b('0xde'),{'UserId':Number(_0xd5ac8a['query']['ids']),'SmsAccountId':Number(_0xd5ac8a[_0xeb4b('0x54')]['id'])});}});}})[_0xeb4b('0x1f')](respondWithStatusCode(_0x135ff3,null))[_0xeb4b('0x27')](handleError(_0x135ff3,null));};exports[_0xeb4b('0xdf')]=function(_0x5ea04a,_0x4dd0da,_0xc5087a){var _0x2155d9={};var _0x1a9d9b={};var _0x37648a;var _0x3c2070;return db[_0xeb4b('0x3b')][_0xeb4b('0x66')]({'where':{'id':_0x5ea04a['params']['id']}})[_0xeb4b('0x1f')](handleEntityNotFound(_0x4dd0da,null))[_0xeb4b('0x1f')](function(_0x14d305){if(_0x14d305){_0x37648a=_0x14d305;_0x1a9d9b[_0xeb4b('0x40')]=_[_0xeb4b('0x55')](db[_0xeb4b('0xa9')][_0xeb4b('0x3c')]);_0x1a9d9b['query']=_[_0xeb4b('0x55')](_0x5ea04a[_0xeb4b('0x42')]);_0x1a9d9b[_0xeb4b('0x43')]=_[_0xeb4b('0x44')](_0x1a9d9b[_0xeb4b('0x40')],_0x1a9d9b['query']);_0x2155d9[_0xeb4b('0x45')]=_['intersection'](_0x1a9d9b[_0xeb4b('0x40')],qs['fields'](_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x46')]));_0x2155d9['attributes']=_0x2155d9[_0xeb4b('0x45')][_0xeb4b('0x47')]?_0x2155d9['attributes']:_0x1a9d9b[_0xeb4b('0x40')];_0x2155d9['order']=qs[_0xeb4b('0x4a')](_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x4a')]);_0x2155d9['where']=qs[_0xeb4b('0x43')](_[_0xeb4b('0x68')](_0x5ea04a[_0xeb4b('0x42')],_0x1a9d9b[_0xeb4b('0x43')]));if(_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x4e')]){_0x2155d9[_0xeb4b('0x4b')]=_[_0xeb4b('0x4c')](_0x2155d9[_0xeb4b('0x4b')],{'$or':_[_0xeb4b('0x41')](_0x2155d9[_0xeb4b('0x45')],function(_0x1cea91){var _0x2591a4={};_0x2591a4[_0x1cea91]={'$like':'%'+_0x5ea04a['query']['filter']+'%'};return _0x2591a4;})});}_0x2155d9=_[_0xeb4b('0x4c')]({},_0x2155d9,_0x5ea04a['options']);return _0x37648a[_0xeb4b('0xdf')](_0x2155d9);}})[_0xeb4b('0x1f')](function(_0x4bc9b4){if(_0x4bc9b4){_0x3c2070=_0x4bc9b4[_0xeb4b('0x47')];if(!_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x48')](_0xeb4b('0x49'))){_0x2155d9[_0xeb4b('0x2d')]=qs[_0xeb4b('0x2d')](_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x2d')]);_0x2155d9[_0xeb4b('0x2b')]=qs['offset'](_0x5ea04a[_0xeb4b('0x42')][_0xeb4b('0x2b')]);}return _0x37648a[_0xeb4b('0xdf')](_0x2155d9);}})['then'](function(_0x25ac32){if(_0x25ac32){return _0x25ac32?{'count':_0x3c2070,'rows':_0x25ac32}:null;}})[_0xeb4b('0x1f')](respondWithResult(_0x4dd0da,null))[_0xeb4b('0x27')](handleError(_0x4dd0da,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 1c07b90..5ae5b02 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 _0x76d2=['hasOwnProperty','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1da0d1,_0x56a820){var _0x107fb9=function(_0x219149){while(--_0x219149){_0x1da0d1['push'](_0x1da0d1['shift']());}};_0x107fb9(++_0x56a820);}(_0x76d2,0x1ba));var _0x276d=function(_0xb393cf,_0xb5361f){_0xb393cf=_0xb393cf-0x0;var _0x185f43=_0x76d2[_0xb393cf];return _0x185f43;};'use strict';var EventEmitter=require(_0x276d('0x0'));var SmsAccount=require(_0x276d('0x1'))['db'][_0x276d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x276d('0x3')](0x0);var events={'afterCreate':_0x276d('0x4'),'afterUpdate':_0x276d('0x5'),'afterDestroy':_0x276d('0x6')};function emitEvent(_0x6e8fc){return function(_0x54013f,_0x3890b6,_0x47e9a2){SmsAccountEvents[_0x276d('0x7')](_0x6e8fc+':'+_0x54013f['id'],_0x54013f);SmsAccountEvents[_0x276d('0x7')](_0x6e8fc,_0x54013f);_0x47e9a2(null);};}for(var e in events){if(events[_0x276d('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x564d=['emit','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x2c3bd9,_0x45f815){var _0x112e55=function(_0x22de25){while(--_0x22de25){_0x2c3bd9['push'](_0x2c3bd9['shift']());}};_0x112e55(++_0x45f815);}(_0x564d,0xeb));var _0xd564=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x564d[_0x1b64dd];return _0xeb464c;};'use strict';var EventEmitter=require(_0xd564('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd564('0x1')](0x0);var events={'afterCreate':_0xd564('0x2'),'afterUpdate':_0xd564('0x3'),'afterDestroy':_0xd564('0x4')};function emitEvent(_0x1184e8){return function(_0x40a867,_0x32c4ba,_0x3ab893){SmsAccountEvents[_0xd564('0x5')](_0x1184e8+':'+_0x40a867['id'],_0x40a867);SmsAccountEvents[_0xd564('0x5')](_0x1184e8,_0x40a867);_0x3ab893(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xd564('0x6')](e,emitEvent(event));}}module[_0xd564('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 3034afe..78eee49 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 _0x2eeb=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','api','moment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2eeb,0x80));var _0xb2ee=function(_0x3295fe,_0x3420ee){_0x3295fe=_0x3295fe-0x0;var _0x567b95=_0x2eeb[_0x3295fe];return _0x567b95;};'use strict';var _=require(_0xb2ee('0x0'));var util=require(_0xb2ee('0x1'));var logger=require('../../config/logger')(_0xb2ee('0x2'));var moment=require(_0xb2ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2ee('0x4'));var rimraf=require(_0xb2ee('0x5'));var config=require(_0xb2ee('0x6'));var attributes=require(_0xb2ee('0x7'));module[_0xb2ee('0x8')]=function(_0x418055,_0x561bdd){return _0x418055['define'](_0xb2ee('0x9'),attributes,{'tableName':_0xb2ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd923=['bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','../../config/logger','api'];(function(_0x4839f7,_0x43e899){var _0x1a729b=function(_0x521093){while(--_0x521093){_0x4839f7['push'](_0x4839f7['shift']());}};_0x1a729b(++_0x43e899);}(_0xd923,0x1dd));var _0x3d92=function(_0xa9a7b1,_0x52fe20){_0xa9a7b1=_0xa9a7b1-0x0;var _0xd4cbf=_0xd923[_0xa9a7b1];return _0xd4cbf;};'use strict';var _=require(_0x3d92('0x0'));var util=require('util');var logger=require(_0x3d92('0x1'))(_0x3d92('0x2'));var moment=require('moment');var BPromise=require(_0x3d92('0x3'));var rp=require(_0x3d92('0x4'));var fs=require('fs');var path=require(_0x3d92('0x5'));var rimraf=require(_0x3d92('0x6'));var config=require(_0x3d92('0x7'));var attributes=require(_0x3d92('0x8'));module['exports']=function(_0x2126de,_0x48b2da){return _0x2126de[_0x3d92('0x9')](_0x3d92('0xa'),attributes,{'tableName':_0x3d92('0xb'),'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 9f7f39e..018b385 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 _0xb279=['include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','SmsAccount,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes'];(function(_0x5cb637,_0x4ab734){var _0x2b671f=function(_0x20a11a){while(--_0x20a11a){_0x5cb637['push'](_0x5cb637['shift']());}};_0x2b671f(++_0x4ab734);}(_0xb279,0x15a));var _0x9b27=function(_0x3aa961,_0x44607a){_0x3aa961=_0x3aa961-0x0;var _0x3dedbd=_0xb279[_0x3aa961];return _0x3dedbd;};'use strict';var _=require(_0x9b27('0x0'));var util=require(_0x9b27('0x1'));var moment=require(_0x9b27('0x2'));var BPromise=require(_0x9b27('0x3'));var rs=require(_0x9b27('0x4'));var fs=require('fs');var Redis=require(_0x9b27('0x5'));var db=require(_0x9b27('0x6'))['db'];var utils=require(_0x9b27('0x7'));var logger=require(_0x9b27('0x8'))(_0x9b27('0x9'));var config=require('../../config/environment');var jayson=require(_0x9b27('0xa'));var client=jayson[_0x9b27('0xb')][_0x9b27('0xc')]({'port':0x232a});config['redis']=_[_0x9b27('0xd')](config[_0x9b27('0xe')],{'host':_0x9b27('0xf'),'port':0x18eb});var socket=require(_0x9b27('0x10'))(new Redis(config[_0x9b27('0xe')]));require('./smsAccount.socket')[_0x9b27('0x11')](socket);function respondWithRpcPromise(_0x5a57c9,_0x573460,_0x35f7de){return new BPromise(function(_0x41c3da,_0x157ca7){return client['request'](_0x5a57c9,_0x35f7de)[_0x9b27('0x12')](function(_0x1f388e){logger['info'](_0x9b27('0x13'),_0x573460,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x573460,'request\x20sent',JSON[_0x9b27('0x14')](_0x1f388e));if(_0x1f388e['error']){if(_0x1f388e['error'][_0x9b27('0x15')]===0x1f4){logger[_0x9b27('0x16')](_0x9b27('0x13'),_0x573460,_0x1f388e[_0x9b27('0x16')][_0x9b27('0x17')]);return _0x157ca7(_0x1f388e[_0x9b27('0x16')][_0x9b27('0x17')]);}logger[_0x9b27('0x16')](_0x9b27('0x13'),_0x573460,_0x1f388e[_0x9b27('0x16')]['message']);return _0x41c3da(_0x1f388e[_0x9b27('0x16')][_0x9b27('0x17')]);}else{logger[_0x9b27('0x18')]('SmsAccount,\x20%s,\x20%s',_0x573460,_0x9b27('0x19'));_0x41c3da(_0x1f388e[_0x9b27('0x1a')][_0x9b27('0x17')]);}})['catch'](function(_0x399248){logger['error'](_0x9b27('0x13'),_0x573460,_0x399248);_0x157ca7(_0x399248);});});}exports[_0x9b27('0x1b')]=function(_0x42deab){var _0xbdcc75=this;return new Promise(function(_0x379153,_0x16a258){return db[_0x9b27('0x1c')][_0x9b27('0x1d')]({'raw':_0x42deab[_0x9b27('0x1e')]?_0x42deab[_0x9b27('0x1e')][_0x9b27('0x1f')]===undefined?!![]:![]:!![],'where':_0x42deab[_0x9b27('0x1e')]?_0x42deab['options'][_0x9b27('0x20')]||null:null,'attributes':_0x42deab[_0x9b27('0x1e')]?_0x42deab[_0x9b27('0x1e')][_0x9b27('0x21')]||null:null,'include':_0x42deab['options']?_0x42deab[_0x9b27('0x1e')][_0x9b27('0x22')]?_[_0x9b27('0x23')](_0x42deab[_0x9b27('0x1e')][_0x9b27('0x22')],function(_0x184212){return{'model':db[_0x184212[_0x9b27('0x24')]],'as':_0x184212['as'],'attributes':_0x184212[_0x9b27('0x21')],'include':_0x184212[_0x9b27('0x22')]?_[_0x9b27('0x23')](_0x184212[_0x9b27('0x22')],function(_0x16e83d){return{'model':db[_0x16e83d[_0x9b27('0x24')]],'as':_0x16e83d['as'],'attributes':_0x16e83d[_0x9b27('0x21')],'include':_0x16e83d['include']?_[_0x9b27('0x23')](_0x16e83d['include'],function(_0x8bfa07){return{'model':db[_0x8bfa07[_0x9b27('0x24')]],'as':_0x8bfa07['as'],'attributes':_0x8bfa07[_0x9b27('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9b27('0x12')](function(_0x203cf9){logger['info'](_0x9b27('0x1b'),_0x42deab);logger[_0x9b27('0x25')](_0x9b27('0x1b'),_0x42deab,JSON[_0x9b27('0x14')](_0x203cf9));_0x379153(_0x203cf9);})['catch'](function(_0x5c5e0e){logger['error'](_0x9b27('0x1b'),_0x5c5e0e['message'],_0x42deab);_0x16a258(_0xbdcc75[_0x9b27('0x16')](0x1f4,_0x5c5e0e[_0x9b27('0x17')]));});});}; \ No newline at end of file +var _0x2618=['raw','attributes','include','map','model','ShowSmsAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./smsAccount.socket','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','find','options'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x2618,0x16e));var _0x8261=function(_0x310039,_0x5265f8){_0x310039=_0x310039-0x0;var _0x4cd469=_0x2618[_0x310039];return _0x4cd469;};'use strict';var _=require('lodash');var util=require(_0x8261('0x0'));var moment=require('moment');var BPromise=require(_0x8261('0x1'));var rs=require(_0x8261('0x2'));var fs=require('fs');var Redis=require(_0x8261('0x3'));var db=require(_0x8261('0x4'))['db'];var utils=require(_0x8261('0x5'));var logger=require(_0x8261('0x6'))(_0x8261('0x7'));var config=require('../../config/environment');var jayson=require(_0x8261('0x8'));var client=jayson[_0x8261('0x9')]['http']({'port':0x232a});config[_0x8261('0xa')]=_[_0x8261('0xb')](config[_0x8261('0xa')],{'host':_0x8261('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8261('0xd'))['register'](socket);function respondWithRpcPromise(_0x70f8a9,_0x1cf05e,_0x4859b0){return new BPromise(function(_0x11c6fa,_0x1836b9){return client[_0x8261('0xe')](_0x70f8a9,_0x4859b0)[_0x8261('0xf')](function(_0x122396){logger[_0x8261('0x10')]('SmsAccount,\x20%s,\x20%s',_0x1cf05e,_0x8261('0x11'));logger[_0x8261('0x12')](_0x8261('0x13'),_0x1cf05e,_0x8261('0x11'),JSON[_0x8261('0x14')](_0x122396));if(_0x122396[_0x8261('0x15')]){if(_0x122396[_0x8261('0x15')][_0x8261('0x16')]===0x1f4){logger[_0x8261('0x15')](_0x8261('0x17'),_0x1cf05e,_0x122396[_0x8261('0x15')][_0x8261('0x18')]);return _0x1836b9(_0x122396[_0x8261('0x15')][_0x8261('0x18')]);}logger[_0x8261('0x15')](_0x8261('0x17'),_0x1cf05e,_0x122396[_0x8261('0x15')][_0x8261('0x18')]);return _0x11c6fa(_0x122396[_0x8261('0x15')][_0x8261('0x18')]);}else{logger[_0x8261('0x10')]('SmsAccount,\x20%s,\x20%s',_0x1cf05e,_0x8261('0x11'));_0x11c6fa(_0x122396[_0x8261('0x19')][_0x8261('0x18')]);}})[_0x8261('0x1a')](function(_0x36b7d0){logger[_0x8261('0x15')](_0x8261('0x17'),_0x1cf05e,_0x36b7d0);_0x1836b9(_0x36b7d0);});});}exports['ShowSmsAccount']=function(_0x8eb160){var _0x58c0d2=this;return new Promise(function(_0x43a976,_0x1ab82a){return db[_0x8261('0x1b')][_0x8261('0x1c')]({'raw':_0x8eb160['options']?_0x8eb160[_0x8261('0x1d')][_0x8261('0x1e')]===undefined?!![]:![]:!![],'where':_0x8eb160[_0x8261('0x1d')]?_0x8eb160[_0x8261('0x1d')]['where']||null:null,'attributes':_0x8eb160[_0x8261('0x1d')]?_0x8eb160[_0x8261('0x1d')][_0x8261('0x1f')]||null:null,'include':_0x8eb160['options']?_0x8eb160[_0x8261('0x1d')][_0x8261('0x20')]?_[_0x8261('0x21')](_0x8eb160[_0x8261('0x1d')][_0x8261('0x20')],function(_0x20866e){return{'model':db[_0x20866e[_0x8261('0x22')]],'as':_0x20866e['as'],'attributes':_0x20866e[_0x8261('0x1f')],'include':_0x20866e[_0x8261('0x20')]?_[_0x8261('0x21')](_0x20866e['include'],function(_0x404ebf){return{'model':db[_0x404ebf['model']],'as':_0x404ebf['as'],'attributes':_0x404ebf[_0x8261('0x1f')],'include':_0x404ebf['include']?_[_0x8261('0x21')](_0x404ebf[_0x8261('0x20')],function(_0x23ca6c){return{'model':db[_0x23ca6c['model']],'as':_0x23ca6c['as'],'attributes':_0x23ca6c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8261('0xf')](function(_0x1e8baf){logger[_0x8261('0x10')]('ShowSmsAccount',_0x8eb160);logger[_0x8261('0x12')](_0x8261('0x23'),_0x8eb160,JSON[_0x8261('0x14')](_0x1e8baf));_0x43a976(_0x1e8baf);})[_0x8261('0x1a')](function(_0x3bbb95){logger[_0x8261('0x15')](_0x8261('0x23'),_0x3bbb95[_0x8261('0x18')],_0x8eb160);_0x1ab82a(_0x58c0d2[_0x8261('0x15')](0x1f4,_0x3bbb95['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 06d0d82..4735303 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 08af07c..3b8888e 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4cd92a,_0x226fe6){var _0x4543f2=function(_0x52ddab){while(--_0x52ddab){_0x4cd92a['push'](_0x4cd92a['shift']());}};_0x4543f2(++_0x226fe6);}(_0xedd9,0xfc));var _0x9edd=function(_0x433650,_0x2780ed){_0x433650=_0x433650-0x0;var _0x13ce1d=_0xedd9[_0x433650];return _0x13ce1d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _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(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 4826bfe..a1e85b8 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 _0x2b30=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b30,0x171));var _0x02b3=function(_0x37f715,_0xc656fd){_0x37f715=_0x37f715-0x0;var _0x43db5f=_0x2b30[_0x37f715];return _0x43db5f;};'use strict';var Sequelize=require(_0x02b3('0x0'));module[_0x02b3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x02b3('0x2')],'allowNull':![],'defaultValue':_0x02b3('0x3')},'appdata':{'type':Sequelize[_0x02b3('0x4')]()},'description':{'type':Sequelize[_0x02b3('0x2')]},'interval':{'type':Sequelize[_0x02b3('0x2')],'defaultValue':_0x02b3('0x5')}}; \ No newline at end of file +var _0x8f08=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4be3ec,_0x218441){var _0x44b79f=function(_0x56d3c1){while(--_0x56d3c1){_0x4be3ec['push'](_0x4be3ec['shift']());}};_0x44b79f(++_0x218441);}(_0x8f08,0x187));var _0x88f0=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x8f08[_0x59d0cc];return _0x2ae79f;};'use strict';var Sequelize=require(_0x88f0('0x0'));module[_0x88f0('0x1')]={'priority':{'type':Sequelize[_0x88f0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88f0('0x3')],'allowNull':![],'defaultValue':_0x88f0('0x4')},'appdata':{'type':Sequelize[_0x88f0('0x5')]()},'description':{'type':Sequelize[_0x88f0('0x3')]},'interval':{'type':Sequelize[_0x88f0('0x3')],'defaultValue':_0x88f0('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index bfee0b5..925b4e1 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 _0x02c1=['sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','update','then','error','stack','name','send','index','SmsApplication','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit'];(function(_0x26211a,_0x5d912d){var _0x4b70a8=function(_0x43efba){while(--_0x43efba){_0x26211a['push'](_0x26211a['shift']());}};_0x4b70a8(++_0x5d912d);}(_0x02c1,0xe2));var _0x102c=function(_0x55bdea,_0x1dab6e){_0x55bdea=_0x55bdea-0x0;var _0x398194=_0x02c1[_0x55bdea];return _0x398194;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x102c('0x0'));var zipdir=require(_0x102c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x102c('0x2'));var moment=require('moment');var BPromise=require(_0x102c('0x3'));var Mustache=require(_0x102c('0x4'));var util=require(_0x102c('0x5'));var path=require(_0x102c('0x6'));var sox=require(_0x102c('0x7'));var csv=require(_0x102c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x102c('0x9'));var _=require(_0x102c('0xa'));var squel=require(_0x102c('0xb'));var crypto=require(_0x102c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x102c('0xd'));var toCsv=require(_0x102c('0x8'));var querystring=require(_0x102c('0xe'));var Papa=require(_0x102c('0xf'));var Redis=require('ioredis');var authService=require(_0x102c('0x10'));var qs=require(_0x102c('0x11'));var as=require(_0x102c('0x12'));var hardwareService=require(_0x102c('0x13'));var logger=require(_0x102c('0x14'))(_0x102c('0x15'));var utils=require(_0x102c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x102c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x908a20,_0xbdc9fe){_0xbdc9fe=_0xbdc9fe||0xcc;return function(_0x3e16f5){if(_0x3e16f5){return _0x908a20[_0x102c('0x18')](_0xbdc9fe);}return _0x908a20[_0x102c('0x19')](_0xbdc9fe)[_0x102c('0x1a')]();};}function respondWithResult(_0x3fb277,_0x3f69a6){_0x3f69a6=_0x3f69a6||0xc8;return function(_0x431572){if(_0x431572){return _0x3fb277['status'](_0x3f69a6)[_0x102c('0x1b')](_0x431572);}};}function respondWithFilteredResult(_0x4b112a,_0x518bc6){return function(_0x118ba9){if(_0x118ba9){var _0x1a82f0=typeof _0x518bc6[_0x102c('0x1c')]===_0x102c('0x1d')&&typeof _0x518bc6[_0x102c('0x1e')]===_0x102c('0x1d');var _0x36428c=_0x118ba9[_0x102c('0x1f')];var _0x3500b3=_0x1a82f0?0x0:_0x518bc6['offset'];var _0x59fd8e=_0x1a82f0?_0x118ba9[_0x102c('0x1f')]:_0x518bc6['offset']+_0x518bc6[_0x102c('0x1e')];var _0x579764;if(_0x59fd8e>=_0x36428c){_0x59fd8e=_0x36428c;_0x579764=0xc8;}else{_0x579764=0xce;}_0x4b112a[_0x102c('0x19')](_0x579764);return _0x4b112a['set']('Content-Range',_0x3500b3+'-'+_0x59fd8e+'/'+_0x36428c)[_0x102c('0x1b')](_0x118ba9);}return null;};}function patchUpdates(_0x2192d4){return function(_0x51c3ca){try{jsonpatch['apply'](_0x51c3ca,_0x2192d4,!![]);}catch(_0x4051ab){return BPromise['reject'](_0x4051ab);}return _0x51c3ca['save']();};}function saveUpdates(_0x1018cd,_0xdaa7c7){return function(_0x4d56dc){if(_0x4d56dc){return _0x4d56dc[_0x102c('0x20')](_0x1018cd)[_0x102c('0x21')](function(_0x472d60){return _0x472d60;});}return null;};}function removeEntity(_0x3b3739,_0x2c6680){return function(_0x2bf061){if(_0x2bf061){return _0x2bf061['destroy']()[_0x102c('0x21')](function(){_0x3b3739[_0x102c('0x19')](0xcc)[_0x102c('0x1a')]();});}};}function handleEntityNotFound(_0x9bc439,_0x51110b){return function(_0x12d109){if(!_0x12d109){_0x9bc439['sendStatus'](0x194);}return _0x12d109;};}function handleError(_0x33c206,_0xa2620c){_0xa2620c=_0xa2620c||0x1f4;return function(_0xebf3e6){logger[_0x102c('0x22')](_0xebf3e6[_0x102c('0x23')]);if(_0xebf3e6['name']){delete _0xebf3e6[_0x102c('0x24')];}_0x33c206[_0x102c('0x19')](_0xa2620c)[_0x102c('0x25')](_0xebf3e6);};}exports[_0x102c('0x26')]=function(_0x243995,_0x49ec98){var _0x1b0d7c={},_0x38a138={},_0x4665ca={'count':0x0,'rows':[]};var _0x9ffd2=_['map'](db[_0x102c('0x27')]['rawAttributes'],function(_0x5259c0){return{'name':_0x5259c0['fieldName'],'type':_0x5259c0[_0x102c('0x28')][_0x102c('0x29')]};});_0x38a138[_0x102c('0x2a')]=_['map'](_0x9ffd2,'name');_0x38a138[_0x102c('0x2b')]=_[_0x102c('0x2c')](_0x243995['query']);_0x38a138[_0x102c('0x2d')]=_[_0x102c('0x2e')](_0x38a138[_0x102c('0x2a')],_0x38a138[_0x102c('0x2b')]);_0x1b0d7c[_0x102c('0x2f')]=_['intersection'](_0x38a138[_0x102c('0x2a')],qs[_0x102c('0x30')](_0x243995['query'][_0x102c('0x30')]));_0x1b0d7c['attributes']=_0x1b0d7c[_0x102c('0x2f')]['length']?_0x1b0d7c[_0x102c('0x2f')]:_0x38a138[_0x102c('0x2a')];if(!_0x243995[_0x102c('0x2b')]['hasOwnProperty'](_0x102c('0x31'))){_0x1b0d7c[_0x102c('0x1e')]=qs['limit'](_0x243995[_0x102c('0x2b')]['limit']);_0x1b0d7c['offset']=qs['offset'](_0x243995['query'][_0x102c('0x1c')]);}_0x1b0d7c['order']=qs['sort'](_0x243995[_0x102c('0x2b')][_0x102c('0x32')]);_0x1b0d7c[_0x102c('0x33')]=qs[_0x102c('0x2d')](_['pick'](_0x243995[_0x102c('0x2b')],_0x38a138['filters']),_0x9ffd2);if(_0x243995[_0x102c('0x2b')][_0x102c('0x34')]){_0x1b0d7c[_0x102c('0x33')]=_[_0x102c('0x35')](_0x1b0d7c['where'],{'$or':_[_0x102c('0x36')](_0x9ffd2,function(_0x4dae7c){if(_0x4dae7c[_0x102c('0x28')]!==_0x102c('0x37')){var _0x4968b5={};_0x4968b5[_0x4dae7c[_0x102c('0x24')]]={'$like':'%'+_0x243995[_0x102c('0x2b')][_0x102c('0x34')]+'%'};return _0x4968b5;}})});}_0x1b0d7c=_[_0x102c('0x35')]({},_0x1b0d7c,_0x243995[_0x102c('0x38')]);var _0x50eef2={'where':_0x1b0d7c[_0x102c('0x33')]};return db['SmsApplication'][_0x102c('0x1f')](_0x50eef2)[_0x102c('0x21')](function(_0x35eb5d){_0x4665ca['count']=_0x35eb5d;if(_0x243995[_0x102c('0x2b')][_0x102c('0x39')]){_0x1b0d7c[_0x102c('0x3a')]=[{'all':!![]}];}return db[_0x102c('0x27')][_0x102c('0x3b')](_0x1b0d7c);})['then'](function(_0x55d7bc){_0x4665ca[_0x102c('0x3c')]=_0x55d7bc;return _0x4665ca;})[_0x102c('0x21')](respondWithFilteredResult(_0x49ec98,_0x1b0d7c))[_0x102c('0x3d')](handleError(_0x49ec98,null));};exports[_0x102c('0x3e')]=function(_0xb968e3,_0x17e8a4){var _0x327623={'raw':!![],'where':{'id':_0xb968e3[_0x102c('0x3f')]['id']}},_0x55bb98={};_0x55bb98['model']=_['keys'](db[_0x102c('0x27')][_0x102c('0x40')]);_0x55bb98['query']=_[_0x102c('0x2c')](_0xb968e3[_0x102c('0x2b')]);_0x55bb98[_0x102c('0x2d')]=_[_0x102c('0x2e')](_0x55bb98[_0x102c('0x2a')],_0x55bb98[_0x102c('0x2b')]);_0x327623[_0x102c('0x2f')]=_[_0x102c('0x2e')](_0x55bb98['model'],qs[_0x102c('0x30')](_0xb968e3['query'][_0x102c('0x30')]));_0x327623[_0x102c('0x2f')]=_0x327623['attributes'][_0x102c('0x41')]?_0x327623['attributes']:_0x55bb98[_0x102c('0x2a')];if(_0xb968e3[_0x102c('0x2b')][_0x102c('0x39')]){_0x327623[_0x102c('0x3a')]=[{'all':!![]}];}_0x327623=_[_0x102c('0x35')]({},_0x327623,_0xb968e3[_0x102c('0x38')]);return db[_0x102c('0x27')]['find'](_0x327623)['then'](handleEntityNotFound(_0x17e8a4,null))[_0x102c('0x21')](respondWithResult(_0x17e8a4,null))[_0x102c('0x3d')](handleError(_0x17e8a4,null));};exports[_0x102c('0x42')]=function(_0x51021a,_0x70d753){return db[_0x102c('0x27')][_0x102c('0x42')](_0x51021a[_0x102c('0x43')],{})[_0x102c('0x21')](respondWithResult(_0x70d753,0xc9))[_0x102c('0x3d')](handleError(_0x70d753,null));};exports[_0x102c('0x20')]=function(_0x5d4b03,_0x1943ee){if(_0x5d4b03[_0x102c('0x43')]['id']){delete _0x5d4b03[_0x102c('0x43')]['id'];}return db[_0x102c('0x27')]['find']({'where':{'id':_0x5d4b03[_0x102c('0x3f')]['id']}})[_0x102c('0x21')](handleEntityNotFound(_0x1943ee,null))[_0x102c('0x21')](saveUpdates(_0x5d4b03[_0x102c('0x43')],null))[_0x102c('0x21')](respondWithResult(_0x1943ee,null))['catch'](handleError(_0x1943ee,null));};exports['destroy']=function(_0x531a5e,_0x3d46bf){return db[_0x102c('0x27')][_0x102c('0x44')]({'where':{'id':_0x531a5e[_0x102c('0x3f')]['id']}})[_0x102c('0x21')](handleEntityNotFound(_0x3d46bf,null))[_0x102c('0x21')](removeEntity(_0x3d46bf,null))[_0x102c('0x3d')](handleError(_0x3d46bf,null));}; \ No newline at end of file +var _0xd06c=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv'];(function(_0x48096c,_0x5393c1){var _0x21eae2=function(_0x1596c9){while(--_0x1596c9){_0x48096c['push'](_0x48096c['shift']());}};_0x21eae2(++_0x5393c1);}(_0xd06c,0xd2));var _0xcd06=function(_0x3aac6f,_0x491b75){_0x3aac6f=_0x3aac6f-0x0;var _0x178c1a=_0xd06c[_0x3aac6f];return _0x178c1a;};'use strict';var emlformat=require(_0xcd06('0x0'));var rimraf=require(_0xcd06('0x1'));var zipdir=require(_0xcd06('0x2'));var jsonpatch=require(_0xcd06('0x3'));var rp=require('request-promise');var moment=require(_0xcd06('0x4'));var BPromise=require(_0xcd06('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcd06('0x6'));var sox=require(_0xcd06('0x7'));var csv=require(_0xcd06('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd06('0x9'));var _=require(_0xcd06('0xa'));var squel=require(_0xcd06('0xb'));var crypto=require(_0xcd06('0xc'));var jsforce=require(_0xcd06('0xd'));var deskjs=require(_0xcd06('0xe'));var toCsv=require(_0xcd06('0x8'));var querystring=require(_0xcd06('0xf'));var Papa=require('papaparse');var Redis=require(_0xcd06('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcd06('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd06('0x12'));var logger=require(_0xcd06('0x13'))(_0xcd06('0x14'));var utils=require(_0xcd06('0x15'));var config=require(_0xcd06('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323762,_0x40bd8f){_0x40bd8f=_0x40bd8f||0xcc;return function(_0x4b5b56){if(_0x4b5b56){return _0x323762[_0xcd06('0x17')](_0x40bd8f);}return _0x323762['status'](_0x40bd8f)[_0xcd06('0x18')]();};}function respondWithResult(_0x48e965,_0x476095){_0x476095=_0x476095||0xc8;return function(_0x1d7796){if(_0x1d7796){return _0x48e965[_0xcd06('0x19')](_0x476095)[_0xcd06('0x1a')](_0x1d7796);}};}function respondWithFilteredResult(_0x2f2b61,_0x4b83aa){return function(_0x58e619){if(_0x58e619){var _0x217a5f=typeof _0x4b83aa[_0xcd06('0x1b')]===_0xcd06('0x1c')&&typeof _0x4b83aa[_0xcd06('0x1d')]===_0xcd06('0x1c');var _0x395e70=_0x58e619[_0xcd06('0x1e')];var _0x1766a2=_0x217a5f?0x0:_0x4b83aa[_0xcd06('0x1b')];var _0x330f80=_0x217a5f?_0x58e619['count']:_0x4b83aa[_0xcd06('0x1b')]+_0x4b83aa['limit'];var _0xf2233b;if(_0x330f80>=_0x395e70){_0x330f80=_0x395e70;_0xf2233b=0xc8;}else{_0xf2233b=0xce;}_0x2f2b61[_0xcd06('0x19')](_0xf2233b);return _0x2f2b61[_0xcd06('0x1f')](_0xcd06('0x20'),_0x1766a2+'-'+_0x330f80+'/'+_0x395e70)[_0xcd06('0x1a')](_0x58e619);}return null;};}function patchUpdates(_0x46f936){return function(_0x348af3){try{jsonpatch[_0xcd06('0x21')](_0x348af3,_0x46f936,!![]);}catch(_0x463984){return BPromise[_0xcd06('0x22')](_0x463984);}return _0x348af3['save']();};}function saveUpdates(_0x4cd0e1,_0x335408){return function(_0x1ed4e2){if(_0x1ed4e2){return _0x1ed4e2[_0xcd06('0x23')](_0x4cd0e1)[_0xcd06('0x24')](function(_0x204020){return _0x204020;});}return null;};}function removeEntity(_0x35eb4c,_0x43aac5){return function(_0x8bee3b){if(_0x8bee3b){return _0x8bee3b[_0xcd06('0x25')]()[_0xcd06('0x24')](function(){_0x35eb4c[_0xcd06('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19fcaa,_0x482bb4){return function(_0x56f7ff){if(!_0x56f7ff){_0x19fcaa[_0xcd06('0x17')](0x194);}return _0x56f7ff;};}function handleError(_0x4e4592,_0x587507){_0x587507=_0x587507||0x1f4;return function(_0x397c3c){logger[_0xcd06('0x26')](_0x397c3c['stack']);if(_0x397c3c[_0xcd06('0x27')]){delete _0x397c3c[_0xcd06('0x27')];}_0x4e4592['status'](_0x587507)[_0xcd06('0x28')](_0x397c3c);};}exports[_0xcd06('0x29')]=function(_0x3df15e,_0x1069f2){var _0x47744f={},_0x90e38e={},_0x15adb2={'count':0x0,'rows':[]};var _0x3a93d2=_['map'](db[_0xcd06('0x2a')][_0xcd06('0x2b')],function(_0x1bdb20){return{'name':_0x1bdb20[_0xcd06('0x2c')],'type':_0x1bdb20[_0xcd06('0x2d')][_0xcd06('0x2e')]};});_0x90e38e[_0xcd06('0x2f')]=_[_0xcd06('0x30')](_0x3a93d2,_0xcd06('0x27'));_0x90e38e[_0xcd06('0x31')]=_[_0xcd06('0x32')](_0x3df15e[_0xcd06('0x31')]);_0x90e38e[_0xcd06('0x33')]=_[_0xcd06('0x34')](_0x90e38e[_0xcd06('0x2f')],_0x90e38e[_0xcd06('0x31')]);_0x47744f[_0xcd06('0x35')]=_[_0xcd06('0x34')](_0x90e38e[_0xcd06('0x2f')],qs[_0xcd06('0x36')](_0x3df15e[_0xcd06('0x31')]['fields']));_0x47744f[_0xcd06('0x35')]=_0x47744f[_0xcd06('0x35')][_0xcd06('0x37')]?_0x47744f[_0xcd06('0x35')]:_0x90e38e['model'];if(!_0x3df15e[_0xcd06('0x31')]['hasOwnProperty'](_0xcd06('0x38'))){_0x47744f[_0xcd06('0x1d')]=qs[_0xcd06('0x1d')](_0x3df15e[_0xcd06('0x31')]['limit']);_0x47744f[_0xcd06('0x1b')]=qs[_0xcd06('0x1b')](_0x3df15e[_0xcd06('0x31')][_0xcd06('0x1b')]);}_0x47744f[_0xcd06('0x39')]=qs[_0xcd06('0x3a')](_0x3df15e[_0xcd06('0x31')][_0xcd06('0x3a')]);_0x47744f[_0xcd06('0x3b')]=qs[_0xcd06('0x33')](_[_0xcd06('0x3c')](_0x3df15e[_0xcd06('0x31')],_0x90e38e[_0xcd06('0x33')]),_0x3a93d2);if(_0x3df15e['query'][_0xcd06('0x3d')]){_0x47744f['where']=_['merge'](_0x47744f[_0xcd06('0x3b')],{'$or':_['map'](_0x3a93d2,function(_0x577eb3){if(_0x577eb3[_0xcd06('0x2d')]!=='VIRTUAL'){var _0x29515e={};_0x29515e[_0x577eb3[_0xcd06('0x27')]]={'$like':'%'+_0x3df15e[_0xcd06('0x31')][_0xcd06('0x3d')]+'%'};return _0x29515e;}})});}_0x47744f=_[_0xcd06('0x3e')]({},_0x47744f,_0x3df15e[_0xcd06('0x3f')]);var _0xde2d28={'where':_0x47744f['where']};return db[_0xcd06('0x2a')]['count'](_0xde2d28)['then'](function(_0x323bb2){_0x15adb2[_0xcd06('0x1e')]=_0x323bb2;if(_0x3df15e[_0xcd06('0x31')][_0xcd06('0x40')]){_0x47744f[_0xcd06('0x41')]=[{'all':!![]}];}return db[_0xcd06('0x2a')]['findAll'](_0x47744f);})[_0xcd06('0x24')](function(_0x21d32f){_0x15adb2[_0xcd06('0x42')]=_0x21d32f;return _0x15adb2;})['then'](respondWithFilteredResult(_0x1069f2,_0x47744f))[_0xcd06('0x43')](handleError(_0x1069f2,null));};exports[_0xcd06('0x44')]=function(_0x3cfa85,_0x18463a){var _0x2d4309={'raw':!![],'where':{'id':_0x3cfa85['params']['id']}},_0x3278a8={};_0x3278a8[_0xcd06('0x2f')]=_[_0xcd06('0x32')](db[_0xcd06('0x2a')]['rawAttributes']);_0x3278a8['query']=_[_0xcd06('0x32')](_0x3cfa85[_0xcd06('0x31')]);_0x3278a8['filters']=_[_0xcd06('0x34')](_0x3278a8['model'],_0x3278a8[_0xcd06('0x31')]);_0x2d4309['attributes']=_[_0xcd06('0x34')](_0x3278a8[_0xcd06('0x2f')],qs['fields'](_0x3cfa85[_0xcd06('0x31')][_0xcd06('0x36')]));_0x2d4309[_0xcd06('0x35')]=_0x2d4309['attributes']['length']?_0x2d4309[_0xcd06('0x35')]:_0x3278a8[_0xcd06('0x2f')];if(_0x3cfa85['query']['includeAll']){_0x2d4309[_0xcd06('0x41')]=[{'all':!![]}];}_0x2d4309=_[_0xcd06('0x3e')]({},_0x2d4309,_0x3cfa85[_0xcd06('0x3f')]);return db[_0xcd06('0x2a')][_0xcd06('0x45')](_0x2d4309)['then'](handleEntityNotFound(_0x18463a,null))[_0xcd06('0x24')](respondWithResult(_0x18463a,null))[_0xcd06('0x43')](handleError(_0x18463a,null));};exports['create']=function(_0x3fd9e5,_0x5bcf3b){return db['SmsApplication'][_0xcd06('0x46')](_0x3fd9e5['body'],{})[_0xcd06('0x24')](respondWithResult(_0x5bcf3b,0xc9))[_0xcd06('0x43')](handleError(_0x5bcf3b,null));};exports['update']=function(_0x43b373,_0x26a366){if(_0x43b373[_0xcd06('0x47')]['id']){delete _0x43b373[_0xcd06('0x47')]['id'];}return db[_0xcd06('0x2a')]['find']({'where':{'id':_0x43b373['params']['id']}})[_0xcd06('0x24')](handleEntityNotFound(_0x26a366,null))[_0xcd06('0x24')](saveUpdates(_0x43b373[_0xcd06('0x47')],null))[_0xcd06('0x24')](respondWithResult(_0x26a366,null))[_0xcd06('0x43')](handleError(_0x26a366,null));};exports[_0xcd06('0x25')]=function(_0xe6e351,_0x189af7){return db[_0xcd06('0x2a')][_0xcd06('0x45')]({'where':{'id':_0xe6e351[_0xcd06('0x48')]['id']}})[_0xcd06('0x24')](handleEntityNotFound(_0x189af7,null))[_0xcd06('0x24')](removeEntity(_0x189af7,null))['catch'](handleError(_0x189af7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 955b706..7878de1 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 _0x621f=['moment','bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','../../config/logger','api'];(function(_0x5713b5,_0x423f83){var _0x2f795d=function(_0x392aea){while(--_0x392aea){_0x5713b5['push'](_0x5713b5['shift']());}};_0x2f795d(++_0x423f83);}(_0x621f,0xed));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf621('0x0'));var util=require('util');var logger=require(_0xf621('0x1'))(_0xf621('0x2'));var moment=require(_0xf621('0x3'));var BPromise=require(_0xf621('0x4'));var rp=require(_0xf621('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf621('0x6'));module[_0xf621('0x7')]=function(_0x36b87d,_0x1e3d0b){return _0x36b87d[_0xf621('0x8')](_0xf621('0x9'),attributes,{'tableName':_0xf621('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf621('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9dec=['exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x9dec,0x1d3));var _0xc9de=function(_0x2f3660,_0x43e478){_0x2f3660=_0x2f3660-0x0;var _0x5ae242=_0x9dec[_0x2f3660];return _0x5ae242;};'use strict';var _=require(_0xc9de('0x0'));var util=require('util');var logger=require(_0xc9de('0x1'))(_0xc9de('0x2'));var moment=require(_0xc9de('0x3'));var BPromise=require(_0xc9de('0x4'));var rp=require(_0xc9de('0x5'));var fs=require('fs');var path=require(_0xc9de('0x6'));var rimraf=require(_0xc9de('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9de('0x8'));module[_0xc9de('0x9')]=function(_0x193ae3,_0x40148e){return _0x193ae3[_0xc9de('0xa')](_0xc9de('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9de('0xc'),'collate':_0xc9de('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 38cb2bc..17372af 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 _0xbdc2=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x556700,_0x2d01b5){var _0x39fbc1=function(_0x133a3a){while(--_0x133a3a){_0x556700['push'](_0x556700['shift']());}};_0x39fbc1(++_0x2d01b5);}(_0xbdc2,0x148));var _0x2bdc=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xbdc2[_0x243217];return _0x478029;};'use strict';var _=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var moment=require(_0x2bdc('0x2'));var BPromise=require(_0x2bdc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bdc('0x4'))['db'];var utils=require(_0x2bdc('0x5'));var logger=require('../../config/logger')(_0x2bdc('0x6'));var config=require(_0x2bdc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2bdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29bed6,_0x9e129f,_0x39475e){return new BPromise(function(_0x3506af,_0x120ca1){return client[_0x2bdc('0x9')](_0x29bed6,_0x39475e)[_0x2bdc('0xa')](function(_0x1dd7c9){logger[_0x2bdc('0xb')](_0x2bdc('0xc'),_0x9e129f,_0x2bdc('0xd'));logger[_0x2bdc('0xe')](_0x2bdc('0xf'),_0x9e129f,'request\x20sent',JSON[_0x2bdc('0x10')](_0x1dd7c9));if(_0x1dd7c9['error']){if(_0x1dd7c9[_0x2bdc('0x11')][_0x2bdc('0x12')]===0x1f4){logger[_0x2bdc('0x11')]('SmsApplication,\x20%s,\x20%s',_0x9e129f,_0x1dd7c9[_0x2bdc('0x11')]['message']);return _0x120ca1(_0x1dd7c9[_0x2bdc('0x11')][_0x2bdc('0x13')]);}logger[_0x2bdc('0x11')](_0x2bdc('0xc'),_0x9e129f,_0x1dd7c9[_0x2bdc('0x11')][_0x2bdc('0x13')]);return _0x3506af(_0x1dd7c9[_0x2bdc('0x11')]['message']);}else{logger[_0x2bdc('0xb')](_0x2bdc('0xc'),_0x9e129f,_0x2bdc('0xd'));_0x3506af(_0x1dd7c9['result'][_0x2bdc('0x13')]);}})['catch'](function(_0x426720){logger['error'](_0x2bdc('0xc'),_0x9e129f,_0x426720);_0x120ca1(_0x426720);});});} \ No newline at end of file +var _0x7fb3=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5be810,_0x34981f){var _0x3a7a68=function(_0x3ddf74){while(--_0x3ddf74){_0x5be810['push'](_0x5be810['shift']());}};_0x3a7a68(++_0x34981f);}(_0x7fb3,0xf9));var _0x37fb=function(_0x52a592,_0x2926b4){_0x52a592=_0x52a592-0x0;var _0x511e55=_0x7fb3[_0x52a592];return _0x511e55;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var moment=require(_0x37fb('0x2'));var BPromise=require(_0x37fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37fb('0x4'));var db=require(_0x37fb('0x5'))['db'];var utils=require(_0x37fb('0x6'));var logger=require(_0x37fb('0x7'))('rpc');var config=require(_0x37fb('0x8'));var jayson=require(_0x37fb('0x9'));var client=jayson[_0x37fb('0xa')][_0x37fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x144254,_0x39d6a3,_0x51b36a){return new BPromise(function(_0x5ab1f3,_0x4ee5e0){return client[_0x37fb('0xc')](_0x144254,_0x51b36a)[_0x37fb('0xd')](function(_0x1f4810){logger[_0x37fb('0xe')](_0x37fb('0xf'),_0x39d6a3,_0x37fb('0x10'));logger[_0x37fb('0x11')](_0x37fb('0x12'),_0x39d6a3,'request\x20sent',JSON['stringify'](_0x1f4810));if(_0x1f4810[_0x37fb('0x13')]){if(_0x1f4810[_0x37fb('0x13')][_0x37fb('0x14')]===0x1f4){logger[_0x37fb('0x13')](_0x37fb('0xf'),_0x39d6a3,_0x1f4810[_0x37fb('0x13')][_0x37fb('0x15')]);return _0x4ee5e0(_0x1f4810[_0x37fb('0x13')]['message']);}logger['error'](_0x37fb('0xf'),_0x39d6a3,_0x1f4810[_0x37fb('0x13')][_0x37fb('0x15')]);return _0x5ab1f3(_0x1f4810[_0x37fb('0x13')]['message']);}else{logger[_0x37fb('0xe')]('SmsApplication,\x20%s,\x20%s',_0x39d6a3,_0x37fb('0x10'));_0x5ab1f3(_0x1f4810[_0x37fb('0x16')][_0x37fb('0x15')]);}})[_0x37fb('0x17')](function(_0x42b5ce){logger[_0x37fb('0x13')](_0x37fb('0xf'),_0x39d6a3,_0x42b5ce);_0x4ee5e0(_0x42b5ce);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index dee3659..19b038a 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 _0x8f4c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x51ad08,_0x1dda9a){var _0x41684a=function(_0x191eb4){while(--_0x191eb4){_0x51ad08['push'](_0x51ad08['shift']());}};_0x41684a(++_0x1dda9a);}(_0x8f4c,0x113));var _0xc8f4=function(_0x17d095,_0x281068){_0x17d095=_0x17d095-0x0;var _0x3a51e2=_0x8f4c[_0x17d095];return _0x3a51e2;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./smsInteraction.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0x9')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router['get'](_0xc8f4('0xf'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x9')]('/:id/download',auth[_0xc8f4('0xd')](),controller['download']);router[_0xc8f4('0x11')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x12')]);router[_0xc8f4('0x11')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller[_0xc8f4('0x13')]);router[_0xc8f4('0x11')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),'smsinteraction:addtags'),controller[_0xc8f4('0x17')]);router[_0xc8f4('0x18')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')]('sms',_0xc8f4('0x19')),controller['update']);router['delete'](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),_0xc8f4('0x1a')),controller[_0xc8f4('0x1b')]);router[_0xc8f4('0x1c')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1d')]);module[_0xc8f4('0x1e')]=router; \ No newline at end of file +var _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x5f45ea,_0x1fcf63){var _0x2b8768=function(_0x42df3d){while(--_0x42df3d){_0x5f45ea['push'](_0x5f45ea['shift']());}};_0x2b8768(++_0x1fcf63);}(_0x7708,0x188));var _0x8770=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0x7708[_0x279368];return _0x40b6d0;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 1a715bd..3df48aa 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 _0xcddd=['BOOLEAN','DATE','STRING','ENUM','sequelize','moment','exports'];(function(_0x40af61,_0x17b208){var _0x4c6604=function(_0x25a896){while(--_0x25a896){_0x40af61['push'](_0x40af61['shift']());}};_0x4c6604(++_0x17b208);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x4fb5ce,_0x2750b2){_0x4fb5ce=_0x4fb5ce-0x0;var _0x325dc7=_0xcddd[_0x4fb5ce];return _0x325dc7;};'use strict';var Sequelize=require(_0xdcdd('0x0'));var moment=require(_0xdcdd('0x1'));module[_0xdcdd('0x2')]={'closed':{'type':Sequelize[_0xdcdd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdcdd('0x4')]},'disposition':{'type':Sequelize[_0xdcdd('0x5')]},'secondDisposition':{'type':Sequelize[_0xdcdd('0x5')]},'thirdDisposition':{'type':Sequelize[_0xdcdd('0x5')]},'note':{'type':Sequelize[_0xdcdd('0x5')]},'phone':{'type':Sequelize[_0xdcdd('0x5')]},'read1stAt':{'type':Sequelize[_0xdcdd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdcdd('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdcdd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xdcdd('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdcdd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4fd7=['moment','exports','BOOLEAN','STRING','ENUM','DATE','sequelize'];(function(_0x4ec207,_0x20a6b3){var _0x8d2120=function(_0x4e6ee6){while(--_0x4e6ee6){_0x4ec207['push'](_0x4ec207['shift']());}};_0x8d2120(++_0x20a6b3);}(_0x4fd7,0xe6));var _0x74fd=function(_0x1b1141,_0x58018d){_0x1b1141=_0x1b1141-0x0;var _0x5a5e3b=_0x4fd7[_0x1b1141];return _0x5a5e3b;};'use strict';var Sequelize=require(_0x74fd('0x0'));var moment=require(_0x74fd('0x1'));module[_0x74fd('0x2')]={'closed':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x74fd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x74fd('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74fd('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x74fd('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index fbcf5cb..83889fd 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 _0x3d2a=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','name','Users','map','TagIds','Tags','push','catch','index','SmsInteraction','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','u.id','ui.SmsInteractionId','users','select','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`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','SELECT','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','includeAll','include','create','update','describe','addMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','SmsMessage','addTags','setTags','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','fullname','CmContact','firstName','direction','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','N.A.','closed','Messages','System','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x310e02,_0x472a9d){var _0x5c9ef2=function(_0x393a18){while(--_0x393a18){_0x310e02['push'](_0x310e02['shift']());}};_0x5c9ef2(++_0x472a9d);}(_0x3d2a,0xdf));var _0xa3d2=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0x3d2a[_0x3fb5eb];return _0x481291;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3d2('0x0'));var zipdir=require(_0xa3d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3d2('0x2'));var moment=require(_0xa3d2('0x3'));var BPromise=require(_0xa3d2('0x4'));var Mustache=require('mustache');var util=require(_0xa3d2('0x5'));var path=require('path');var sox=require(_0xa3d2('0x6'));var csv=require(_0xa3d2('0x7'));var ejs=require(_0xa3d2('0x8'));var fs=require('fs');var fs_extra=require(_0xa3d2('0x9'));var _=require(_0xa3d2('0xa'));var squel=require(_0xa3d2('0xb'));var crypto=require(_0xa3d2('0xc'));var jsforce=require(_0xa3d2('0xd'));var deskjs=require(_0xa3d2('0xe'));var toCsv=require(_0xa3d2('0x7'));var querystring=require(_0xa3d2('0xf'));var Papa=require('papaparse');var Redis=require(_0xa3d2('0x10'));var authService=require(_0xa3d2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa3d2('0x12'));var hardwareService=require(_0xa3d2('0x13'));var logger=require('../../config/logger')(_0xa3d2('0x14'));var utils=require(_0xa3d2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa3d2('0x16')](config[_0xa3d2('0x17')],{'host':_0xa3d2('0x18'),'port':0x18eb});var socket=require(_0xa3d2('0x19'))(new Redis(config['redis']));require(_0xa3d2('0x1a'))['register'](socket);function respondWithStatusCode(_0x3af096,_0xed2a2e){_0xed2a2e=_0xed2a2e||0xcc;return function(_0x2e8134){if(_0x2e8134){return _0x3af096[_0xa3d2('0x1b')](_0xed2a2e);}return _0x3af096['status'](_0xed2a2e)['end']();};}function respondWithResult(_0x40d006,_0x288e52){_0x288e52=_0x288e52||0xc8;return function(_0x13a669){if(_0x13a669){return _0x40d006[_0xa3d2('0x1c')](_0x288e52)['json'](_0x13a669);}};}function respondWithFilteredResult(_0x51db00,_0x66cff9){return function(_0x34f66d){if(_0x34f66d){var _0x41370c=typeof _0x66cff9[_0xa3d2('0x1d')]===_0xa3d2('0x1e')&&typeof _0x66cff9[_0xa3d2('0x1f')]===_0xa3d2('0x1e');var _0x2e3b0e=_0x34f66d[_0xa3d2('0x20')];var _0x28ded9=_0x41370c?0x0:_0x66cff9[_0xa3d2('0x1d')];var _0x226eb8=_0x41370c?_0x34f66d[_0xa3d2('0x20')]:_0x66cff9['offset']+_0x66cff9['limit'];var _0x2e6921;if(_0x226eb8>=_0x2e3b0e){_0x226eb8=_0x2e3b0e;_0x2e6921=0xc8;}else{_0x2e6921=0xce;}_0x51db00[_0xa3d2('0x1c')](_0x2e6921);return _0x51db00[_0xa3d2('0x21')](_0xa3d2('0x22'),_0x28ded9+'-'+_0x226eb8+'/'+_0x2e3b0e)[_0xa3d2('0x23')](_0x34f66d);}return null;};}function patchUpdates(_0xe0d324){return function(_0x4c8ae4){try{jsonpatch['apply'](_0x4c8ae4,_0xe0d324,!![]);}catch(_0x3627a9){return BPromise[_0xa3d2('0x24')](_0x3627a9);}return _0x4c8ae4[_0xa3d2('0x25')]();};}function saveUpdates(_0x531f47,_0x2fb181){return function(_0x35f4ab){if(_0x35f4ab){return _0x35f4ab['update'](_0x531f47)[_0xa3d2('0x26')](function(_0x28b437){return _0x28b437;});}return null;};}function removeEntity(_0x513741,_0x3afede){return function(_0x14987d){if(_0x14987d){return _0x14987d[_0xa3d2('0x27')]()[_0xa3d2('0x26')](function(){_0x513741['status'](0xcc)[_0xa3d2('0x28')]();});}};}function handleEntityNotFound(_0x4854d4,_0x260775){return function(_0xe463ae){if(!_0xe463ae){_0x4854d4[_0xa3d2('0x1b')](0x194);}return _0xe463ae;};}function handleError(_0x22fe18,_0x558b66){_0x558b66=_0x558b66||0x1f4;return function(_0x4e1413){logger[_0xa3d2('0x29')](_0x4e1413['stack']);if(_0x4e1413[_0xa3d2('0x2a')]){delete _0x4e1413['name'];}_0x22fe18[_0xa3d2('0x1c')](_0x558b66)['send'](_0x4e1413);};}function getInteractionUsers(_0x4a4eef,_0x51e547){return new BPromise(function(_0x5da012,_0x55d8f3){try{if(_0x51e547[_0x4a4eef['id']]){_0x4a4eef[_0xa3d2('0x2b')]=_[_0xa3d2('0x2c')](_0x51e547[_0x4a4eef['id']],function(_0xac7950){return{'id':_0xac7950['id'],'fullname':_0xac7950['fullname']};});}}catch(_0x4008ac){_0x55d8f3(_0x4008ac);}_0x5da012(_0x4a4eef);});}function getInteractionTags(_0x13a133,_0x17e541){return new BPromise(function(_0x2e0e5c,_0x5726ad){try{if(_0x13a133[_0xa3d2('0x2d')]){_0x13a133['Tags']=[];_0x13a133['TagIds']['split'](',')['forEach'](function(_0x31e24e){_0x13a133[_0xa3d2('0x2e')][_0xa3d2('0x2f')](_0x17e541[_0x31e24e]);});}delete _0x13a133[_0xa3d2('0x2d')];}catch(_0x5aad4f){_0x5726ad(_0x5aad4f);}_0x2e0e5c(_0x13a133);});}function updateSmsInteraction(_0x25fe0b,_0x16a055,_0x3af52c){return new BPromise(function(_0x4951db,_0x3a6f29){return getInteractionUsers(_0x25fe0b,_0x3af52c)[_0xa3d2('0x26')](function(_0x5d0cd5){return getInteractionTags(_0x5d0cd5,_0x16a055);})[_0xa3d2('0x26')](function(_0x59f200){_0x4951db(_0x59f200);})[_0xa3d2('0x30')](function(_0x41b085){_0x3a6f29(_0x41b085);});});}exports[_0xa3d2('0x31')]=function(_0x2581b8,_0x2aad09){var _0x5d63c6={},_0x28deb6={},_0x154737={'count':0x0,'rows':[]};var _0x4806ad=_[_0xa3d2('0x2c')](db[_0xa3d2('0x32')][_0xa3d2('0x33')],function(_0x322cc4){return{'name':_0x322cc4['fieldName'],'type':_0x322cc4[_0xa3d2('0x34')]['key']};});_0x28deb6[_0xa3d2('0x35')]=_['map'](_0x4806ad,_0xa3d2('0x2a'));_0x28deb6[_0xa3d2('0x36')]=_[_0xa3d2('0x37')](_0x2581b8[_0xa3d2('0x36')]);_0x28deb6[_0xa3d2('0x38')]=_['intersection'](_0x28deb6[_0xa3d2('0x35')],_0x28deb6[_0xa3d2('0x36')]);_0x5d63c6[_0xa3d2('0x39')]=_[_0xa3d2('0x3a')](_0x28deb6[_0xa3d2('0x35')],qs['fields'](_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x3b')]));_0x5d63c6[_0xa3d2('0x39')]=_0x5d63c6[_0xa3d2('0x39')]['length']?_0x5d63c6[_0xa3d2('0x39')]:_0x28deb6['model'];if(!_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x3c')](_0xa3d2('0x3d'))){_0x5d63c6[_0xa3d2('0x1f')]=qs[_0xa3d2('0x1f')](_0x2581b8['query'][_0xa3d2('0x1f')]);_0x5d63c6['offset']=qs[_0xa3d2('0x1d')](_0x2581b8['query'][_0xa3d2('0x1d')]);}_0x5d63c6[_0xa3d2('0x3e')]=qs[_0xa3d2('0x3f')](_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x3f')]);_0x5d63c6['where']=qs[_0xa3d2('0x38')](_[_0xa3d2('0x40')](_0x2581b8[_0xa3d2('0x36')],_0x28deb6['filters']),_0x4806ad);var _0xdc2751=[];var _0x5695a7=squel['select']()[_0xa3d2('0x41')]('id')[_0xa3d2('0x41')](_0xa3d2('0x2a'))[_0xa3d2('0x41')](_0xa3d2('0x42'))[_0xa3d2('0x43')](_0xa3d2('0x44'));var _0x5139b4=squel['select']()[_0xa3d2('0x41')](_0xa3d2('0x45'))[_0xa3d2('0x41')]('u.fullname')[_0xa3d2('0x41')](_0xa3d2('0x46'))[_0xa3d2('0x43')]('user_has_sms_interactions','ui')['left_join'](_0xa3d2('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x299c4c=squel[_0xa3d2('0x48')]()['from'](_0xa3d2('0x49'),'i')['left_join'](_0xa3d2('0x4a'),'c',_0xa3d2('0x4b'))['left_join'](_0xa3d2('0x47'),'o',_0xa3d2('0x4c'))[_0xa3d2('0x4d')](_0xa3d2('0x4e'),'a',_0xa3d2('0x4f'))[_0xa3d2('0x4d')](_0xa3d2('0x50'),'me',_0xa3d2('0x51'))[_0xa3d2('0x4d')](_0xa3d2('0x52'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xa3d2('0x4d')](_0xa3d2('0x44'),'t',_0xa3d2('0x53'));var _0x5efb21=squel[_0xa3d2('0x54')]();var _0x505f03=[];var _0x2801ee=squel[_0xa3d2('0x54')]();var _0x10478e;if(_0x2581b8['query'][_0xa3d2('0x55')]){_0x10478e=as[_0xa3d2('0x56')](_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x55')]);var _0x418d1f=_0x10478e[_0xa3d2('0x57')];for(var _0x406f81=0x0;_0x406f81<_0x10478e['conditions'][_0xa3d2('0x58')];_0x406f81++){var _0x3e041d=_0x10478e[_0xa3d2('0x59')][_0x406f81];var _0x505a2f='i';var _0x451505=_[_0xa3d2('0x5a')](_0x4806ad,['name',_0x3e041d[_0xa3d2('0x41')]]);if(!_0x451505){switch(_0x3e041d[_0xa3d2('0x41')]){case _0xa3d2('0x5b'):if(_0x3e041d['value']==0x1){_0x299c4c[_0xa3d2('0x5c')]('`'+_0x3e041d[_0xa3d2('0x41')]+_0xa3d2('0x5d'));}else{_0x299c4c[_0xa3d2('0x5c')]('`'+_0x3e041d['field']+_0xa3d2('0x5e'));}break;case _0xa3d2('0x5f'):if(_0x3e041d[_0xa3d2('0x60')]===_0xa3d2('0x61')){if(_0x3e041d[_0xa3d2('0x62')][_0xa3d2('0x63')]('\x20')[_0xa3d2('0x58')]>0x1){_0x5efb21[_0x418d1f](_0xa3d2('0x64'),qs[_0xa3d2('0x65')](_0x3e041d[_0xa3d2('0x62')]),null);}else{var _0x5929a9='%'+_0x3e041d[_0xa3d2('0x62')]+'%';_0x5efb21[_0x418d1f](_0xa3d2('0x66'),_0x5929a9,_0x5929a9,_0x5929a9);}}else{_0x451505=_[_0xa3d2('0x5a')](_0x4806ad,[_0xa3d2('0x2a'),_0xa3d2('0x67')]);_0x3e041d[_0xa3d2('0x41')]=_0xa3d2('0x67');_0x1b6265=as[_0xa3d2('0x68')](_0x505a2f,_0x451505[_0xa3d2('0x34')],_0x3e041d);_0x5efb21[_0x418d1f](_0x1b6265[_0xa3d2('0x69')],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x6a')],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x28')]);}break;case'Tag':var _0xa1e431=_0x3e041d['value'][_0xa3d2('0x63')](',')[_0xa3d2('0x2c')](function(_0x27a8da){return Number(_0x27a8da);});_0xa1e431[_0xa3d2('0x6b')](function(_0x4f02e4){_0x2801ee['or'](_0xa3d2('0x6c'),'%,'+_0x4f02e4+',%');});_0x505f03=_['union'](_0x505f03,_0xa1e431);break;case _0xa3d2('0x6d'):if(_0x3e041d[_0xa3d2('0x60')]===_0xa3d2('0x61')){_0x5efb21[_0x418d1f](_0xa3d2('0x6e'),'%'+_0x3e041d[_0xa3d2('0x62')]+'%',null);}else{_0x451505=_[_0xa3d2('0x5a')](_0x4806ad,[_0xa3d2('0x2a'),'UserId']);_0x3e041d[_0xa3d2('0x41')]=_0xa3d2('0x6f');_0x1b6265=as['buildExpression'](_0x505a2f,_0x451505[_0xa3d2('0x34')],_0x3e041d);_0x5efb21[_0x418d1f](_0x1b6265[_0xa3d2('0x69')],_0x1b6265[_0xa3d2('0x62')]['start'],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x28')]);}break;case _0xa3d2('0x70'):_0x1b6265=as[_0xa3d2('0x68')]('me',null,_0x3e041d);_0x5efb21[_0x418d1f](_0x1b6265['text'],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x6a')],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x28')]);break;}}else{var _0x1b6265=as['buildExpression'](_0x505a2f,_0x451505[_0xa3d2('0x34')],_0x3e041d);_0x5efb21[_0x418d1f](_0x1b6265[_0xa3d2('0x69')],_0x1b6265[_0xa3d2('0x62')][_0xa3d2('0x6a')],_0x1b6265['value']['end']);}}}else{var _0x389321=_(_0x2581b8[_0xa3d2('0x36')])[_0xa3d2('0x37')]()[_0xa3d2('0x2c')](function(_0x48f0a9){return _[_0xa3d2('0x71')](_0x4806ad,[_0xa3d2('0x2a'),_0x48f0a9])?_0x48f0a9:undefined;})[_0xa3d2('0x72')]()[_0xa3d2('0x62')]();if(!_[_0xa3d2('0x73')](_0x389321)){_0x389321[_0xa3d2('0x6b')](function(_0x531340){if(_0x531340===_0xa3d2('0x74')){_0x299c4c[_0xa3d2('0x75')](_0xa3d2('0x76'),[][_0xa3d2('0x77')](_0x2581b8['query'][_0x531340]));}else if(_0x531340===_0xa3d2('0x78')){var _0x2be64e=JSON['parse'](_0x2581b8[_0xa3d2('0x36')][_0x531340])[_0xa3d2('0x79')];var _0x2159ee=JSON[_0xa3d2('0x7a')](_0x2581b8['query'][_0x531340])[_0xa3d2('0x7b')];_0x299c4c['where'](_0xa3d2('0x7c'),_0x2be64e,_0x2159ee);}else{if(_0x2581b8[_0xa3d2('0x36')][_0x531340]==='null'){_0x299c4c[_0xa3d2('0x75')]('i.'+_0x531340+_0xa3d2('0x7d'));}else{_0x299c4c[_0xa3d2('0x75')]('i.'+_0x531340+_0xa3d2('0x7e'),_0x2581b8['query'][_0x531340]);}}});}if(_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x7f')]){if(_0x2581b8['query'][_0xa3d2('0x7f')]==0x1){_0x299c4c[_0xa3d2('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x299c4c[_0xa3d2('0x5c')](_0xa3d2('0x80'));}}if(_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x81')]){_0x505f03=_[_0xa3d2('0x82')](_0x2581b8[_0xa3d2('0x36')]['tag'])?_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x81')]:new Array(_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x81')]);_0x505f03[_0xa3d2('0x6b')](function(_0x159586){_0x2801ee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x159586+',%');});}if(_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x83')]){var _0x22afc9=_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x83')]['replace']('\x5c','\x5c\x5c')[_0xa3d2('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x22afc9)){_0x5efb21['or'](_0xa3d2('0x85'),_0x22afc9+'%')['or'](_0xa3d2('0x86'),_0x22afc9+'%');}else{_0x5efb21['or'](_0xa3d2('0x87'),qs[_0xa3d2('0x65')](_0x22afc9))['or'](_0xa3d2('0x88'),_0x22afc9+'%');}}}_0x299c4c[_0xa3d2('0x75')](_0x5efb21);_0x299c4c[_0xa3d2('0x89')](_0xa3d2('0x8a'));var _0x4f2340={'type':db[_0xa3d2('0x8b')]['QueryTypes'][_0xa3d2('0x8c')],'raw':!![]};var _0x2516ec=_0x299c4c['clone']();_0x2516ec[_0xa3d2('0x41')]('i.id');_0x2516ec[_0xa3d2('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa3d2('0x5b'));if(_0x5d63c6[_0xa3d2('0x3e')]){_0x5d63c6[_0xa3d2('0x3e')][_0xa3d2('0x6b')](function(_0x24f453){var _0x37de9f=_0x24f453[0x0]===_0xa3d2('0x8d')?_0x24f453[0x0]:'i.'+_0x24f453[0x0];_0x299c4c[_0xa3d2('0x3e')](_0x37de9f,_0x24f453[0x1]===_0xa3d2('0x8e')?![]:!![]);});}if(!_[_0xa3d2('0x73')](_0x505f03)){_0x299c4c[_0xa3d2('0x5c')](_0x2801ee);_0x2516ec[_0xa3d2('0x75')](_0xa3d2('0x8f'),_0x505f03);}BPromise[_0xa3d2('0x90')]()[_0xa3d2('0x26')](function(){if(!_0x10478e){if(_0x2581b8[_0xa3d2('0x36')]['SmsAccountId'])return;_0x2516ec[_0xa3d2('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x299c4c[_0xa3d2('0x75')](_0xa3d2('0x91'));return;}if(_0x2581b8[_0xa3d2('0x92')]['role']!==_0xa3d2('0x93'))return;return _0x2581b8[_0xa3d2('0x92')][_0xa3d2('0x94')]({'attributes':['id'],'raw':!![]})[_0xa3d2('0x26')](function(_0x32ed71){if(_['isEmpty'](_0x32ed71)){_0x2516ec[_0xa3d2('0x75')](_0xa3d2('0x95'));_0x299c4c[_0xa3d2('0x75')](_0xa3d2('0x95'));}else{_0x2516ec[_0xa3d2('0x75')](_0xa3d2('0x76'),_[_0xa3d2('0x2c')](_0x32ed71,'id'));_0x299c4c[_0xa3d2('0x75')](_0xa3d2('0x76'),_[_0xa3d2('0x2c')](_0x32ed71,'id'));}});})['then'](function(){if(_0x2581b8[_0xa3d2('0x92')]['role']==='agent'&&!_0x10478e&&!_0x2581b8[_0xa3d2('0x36')][_0xa3d2('0x74')])return[];return db['sequelize']['query'](_0x2516ec[_0xa3d2('0x96')](),_0x4f2340);})[_0xa3d2('0x26')](function(_0x5bb17e){_0x154737[_0xa3d2('0x20')]=_0x5bb17e[_0xa3d2('0x58')];if(_0x154737['count']===0x0)return[];return db['sequelize'][_0xa3d2('0x36')](_0x5695a7[_0xa3d2('0x96')](),_0x4f2340)['then'](function(_0x24707e){_0xdc2751=_['keyBy'](_0x24707e,'id');_0x4f2340=_[_0xa3d2('0x97')](_0x4f2340,{'model':db[_0xa3d2('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2581b8['query'][_0xa3d2('0x3b')]){_0x5d63c6[_0xa3d2('0x39')][_0xa3d2('0x6b')](function(_0x331b2f){_0x299c4c[_0xa3d2('0x41')]('i.'+_0x331b2f);});}else{_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0x98'),_0xa3d2('0x5b'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0x99'),_0xa3d2('0x9a'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0x9b'),_0xa3d2('0x9c'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0x9d'),_0xa3d2('0x8d'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0x9e'));_0x299c4c['field'](_0xa3d2('0x9f'),_0xa3d2('0xa0'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xa1'),_0xa3d2('0xa2'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xa3'),_0xa3d2('0xa4'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xa5'),'Contact.phone');_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xa6'),'Contact.mobile');_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xa7'),_0xa3d2('0xa8'));_0x299c4c['field']('o.fullname',_0xa3d2('0xa9'));_0x299c4c[_0xa3d2('0x41')](_0xa3d2('0xaa'),_0xa3d2('0xab'));_0x299c4c['field'](_0xa3d2('0xac'),_0xa3d2('0x2d'));}if(_0x5d63c6['limit'])_0x299c4c[_0xa3d2('0x1f')](_0x5d63c6[_0xa3d2('0x1f')]);if(_0x5d63c6[_0xa3d2('0x1d')])_0x299c4c[_0xa3d2('0x1d')](_0x5d63c6['offset']);return db[_0xa3d2('0xad')]['query'](_0x299c4c[_0xa3d2('0x96')](),_0x4f2340);})['then'](function(_0x151b2f){if(_0x151b2f[_0xa3d2('0x58')]>0x0)_0x5139b4[_0xa3d2('0x75')](_0xa3d2('0xae'),_[_0xa3d2('0x2c')](_0x151b2f,'id'));return db['sequelize'][_0xa3d2('0x36')](_0x5139b4['toString'](),_0x4f2340)[_0xa3d2('0x26')](function(_0xed0058){var _0x158eac=_['groupBy'](_0xed0058,_0xa3d2('0xaf'));var _0x4b331f=[];_0x151b2f[_0xa3d2('0x6b')](function(_0x51dfa0){_0x4b331f[_0xa3d2('0x2f')](updateSmsInteraction(_0x51dfa0,_0xdc2751,_0x158eac));});return BPromise[_0xa3d2('0xb0')](_0x4b331f);});});})['then'](function(_0x5e1d55){_0x154737[_0xa3d2('0xb1')]=_0x5e1d55;return _0x154737;})[_0xa3d2('0x26')](respondWithFilteredResult(_0x2aad09,_0x5d63c6))[_0xa3d2('0x30')](handleError(_0x2aad09,null));};exports[_0xa3d2('0xb2')]=function(_0x59f851,_0x113be5){var _0x3ae01c={'raw':![],'where':{'id':_0x59f851[_0xa3d2('0xb3')]['id']}},_0x1c5c98={};_0x1c5c98[_0xa3d2('0x35')]=_['keys'](db[_0xa3d2('0x32')]['rawAttributes']);_0x1c5c98['query']=_['keys'](_0x59f851[_0xa3d2('0x36')]);_0x1c5c98['filters']=_[_0xa3d2('0x3a')](_0x1c5c98[_0xa3d2('0x35')],_0x1c5c98[_0xa3d2('0x36')]);_0x3ae01c[_0xa3d2('0x39')]=_[_0xa3d2('0x3a')](_0x1c5c98['model'],qs['fields'](_0x59f851[_0xa3d2('0x36')][_0xa3d2('0x3b')]));_0x3ae01c[_0xa3d2('0x39')]=_0x3ae01c[_0xa3d2('0x39')][_0xa3d2('0x58')]?_0x3ae01c[_0xa3d2('0x39')]:_0x1c5c98[_0xa3d2('0x35')];if(_0x59f851[_0xa3d2('0x36')][_0xa3d2('0xb4')]){_0x3ae01c[_0xa3d2('0xb5')]=[{'all':!![]}];}_0x3ae01c=_[_0xa3d2('0x97')]({},_0x3ae01c,_0x59f851['options']);return db['SmsInteraction'][_0xa3d2('0x5a')](_0x3ae01c)[_0xa3d2('0x26')](handleEntityNotFound(_0x113be5,null))[_0xa3d2('0x26')](respondWithResult(_0x113be5,null))['catch'](handleError(_0x113be5,null));};exports[_0xa3d2('0xb6')]=function(_0x243561,_0x57c230){return db[_0xa3d2('0x32')][_0xa3d2('0xb6')](_0x243561[_0xa3d2('0x70')],{})['then'](respondWithResult(_0x57c230,0xc9))[_0xa3d2('0x30')](handleError(_0x57c230,null));};exports[_0xa3d2('0xb7')]=function(_0x149dde,_0x31474e){if(_0x149dde['body']['id']){delete _0x149dde[_0xa3d2('0x70')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x149dde[_0xa3d2('0xb3')]['id']}})[_0xa3d2('0x26')](handleEntityNotFound(_0x31474e,null))[_0xa3d2('0x26')](saveUpdates(_0x149dde[_0xa3d2('0x70')],null))[_0xa3d2('0x26')](respondWithResult(_0x31474e,null))['catch'](handleError(_0x31474e,null));};exports['destroy']=function(_0x2fb6b9,_0x581520){return db[_0xa3d2('0x32')][_0xa3d2('0x5a')]({'where':{'id':_0x2fb6b9['params']['id']}})[_0xa3d2('0x26')](handleEntityNotFound(_0x581520,null))['then'](removeEntity(_0x581520,null))['catch'](handleError(_0x581520,null));};exports[_0xa3d2('0xb8')]=function(_0x2e5f37,_0x48e6a0){return db[_0xa3d2('0x32')][_0xa3d2('0xb8')]()[_0xa3d2('0x26')](respondWithResult(_0x48e6a0,null))[_0xa3d2('0x30')](handleError(_0x48e6a0,null));};exports[_0xa3d2('0xb9')]=function(_0x453f9c,_0x3524bf,_0x2ba513){return db['SmsMessage'][_0xa3d2('0x5a')]({'where':{'id':_0x453f9c[_0xa3d2('0xb3')]['id']}})[_0xa3d2('0x26')](handleEntityNotFound(_0x3524bf,null))[_0xa3d2('0x26')](function(_0x202593){if(_0x202593){return _0x202593[_0xa3d2('0xb9')](_0x453f9c[_0xa3d2('0x70')]['ids'],_[_0xa3d2('0xba')](_0x453f9c[_0xa3d2('0x70')],[_0xa3d2('0xbb'),'id'])||{});}})[_0xa3d2('0x26')](respondWithResult(_0x3524bf,null))[_0xa3d2('0x30')](handleError(_0x3524bf,null));};exports[_0xa3d2('0xbc')]=function(_0x50b86a,_0x3e91c4,_0x344369){var _0x492ca8={'raw':![],'where':{}};var _0x3d8682={};var _0x3d72a7={'count':0x0,'rows':[]};return db[_0xa3d2('0x32')][_0xa3d2('0xbd')]({'where':{'id':_0x50b86a[_0xa3d2('0xb3')]['id']}})[_0xa3d2('0x26')](handleEntityNotFound(_0x3e91c4,null))[_0xa3d2('0x26')](function(_0x2697b2){if(_0x2697b2){_0x3d8682['model']=_[_0xa3d2('0x37')](db['SmsMessage'][_0xa3d2('0x33')]);_0x3d8682[_0xa3d2('0x36')]=_[_0xa3d2('0x37')](_0x50b86a[_0xa3d2('0x36')]);_0x3d8682[_0xa3d2('0x38')]=_[_0xa3d2('0x3a')](_0x3d8682[_0xa3d2('0x35')],_0x3d8682[_0xa3d2('0x36')]);_0x492ca8[_0xa3d2('0x39')]=_['intersection'](_0x3d8682[_0xa3d2('0x35')],qs['fields'](_0x50b86a[_0xa3d2('0x36')][_0xa3d2('0x3b')]));_0x492ca8[_0xa3d2('0x39')]=_0x492ca8[_0xa3d2('0x39')][_0xa3d2('0x58')]?_0x492ca8[_0xa3d2('0x39')]:_0x3d8682[_0xa3d2('0x35')];if(!_0x50b86a[_0xa3d2('0x36')][_0xa3d2('0x3c')](_0xa3d2('0x3d'))){_0x492ca8[_0xa3d2('0x1f')]=qs['limit'](_0x50b86a['query'][_0xa3d2('0x1f')]);_0x492ca8[_0xa3d2('0x1d')]=qs[_0xa3d2('0x1d')](_0x50b86a[_0xa3d2('0x36')]['offset']);}_0x492ca8['order']=qs[_0xa3d2('0x3f')](_0x50b86a['query'][_0xa3d2('0x3f')]);_0x492ca8[_0xa3d2('0x75')]=qs[_0xa3d2('0x38')](_[_0xa3d2('0x40')](_0x50b86a[_0xa3d2('0x36')],_0x3d8682[_0xa3d2('0x38')]));_0x492ca8[_0xa3d2('0x75')]['SmsInteractionId']=_0x2697b2['id'];if(_0x50b86a['query']['filter']){_0x492ca8[_0xa3d2('0x75')]=_['merge'](_0x492ca8[_0xa3d2('0x75')],{'$or':_[_0xa3d2('0x2c')](_0x492ca8[_0xa3d2('0x39')],function(_0x1b6c29){var _0x4bbce4={};_0x4bbce4[_0x1b6c29]={'$like':'%'+_0x50b86a['query'][_0xa3d2('0x83')]+'%'};return _0x4bbce4;})});}if(_0x50b86a[_0xa3d2('0x36')][_0xa3d2('0x79')]){var _0x304461=_0x50b86a[_0xa3d2('0x36')][_0xa3d2('0x79')][_0xa3d2('0x63')](',');var _0x5d70e4={};_0x5d70e4[_0x304461[0x0]]={'$gte':moment(_0x304461[0x1])[_0xa3d2('0xbe')](_0xa3d2('0xbf'))};_0x492ca8[_0xa3d2('0x75')]=_['merge'](_0x492ca8[_0xa3d2('0x75')],_0x5d70e4);}_0x492ca8=_[_0xa3d2('0x97')]({},_0x492ca8,_0x50b86a[_0xa3d2('0xc0')]);return db[_0xa3d2('0xc1')][_0xa3d2('0x20')]({'where':_0x492ca8[_0xa3d2('0x75')]})[_0xa3d2('0x26')](function(_0x53fb81){_0x3d72a7['count']=_0x53fb81;if(_0x50b86a[_0xa3d2('0x36')][_0xa3d2('0xb4')]){_0x492ca8[_0xa3d2('0xb5')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x492ca8);})[_0xa3d2('0x26')](function(_0x2a1771){_0x3d72a7['rows']=_0x2a1771;return _0x3d72a7;});}})[_0xa3d2('0x26')](respondWithFilteredResult(_0x3e91c4,_0x492ca8))[_0xa3d2('0x30')](handleError(_0x3e91c4,null));};exports[_0xa3d2('0xc2')]=function(_0x2d9748,_0x133377,_0x450cc7){return db[_0xa3d2('0x32')][_0xa3d2('0x5a')]({'where':{'id':_0x2d9748['params']['id']}})[_0xa3d2('0x26')](handleEntityNotFound(_0x133377,null))[_0xa3d2('0x26')](function(_0x2c5538){if(_0x2c5538){return _0x2c5538[_0xa3d2('0xc3')](_0x2d9748[_0xa3d2('0x70')][_0xa3d2('0xbb')],_[_0xa3d2('0xba')](_0x2d9748[_0xa3d2('0x70')],[_0xa3d2('0xbb'),'id'])||{})['spread'](function(){return db[_0xa3d2('0xc4')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x2d9748[_0xa3d2('0x70')][_0xa3d2('0xbb')]}});})['then'](function(_0x228d39){socket[_0xa3d2('0xc5')](_0xa3d2('0xc6'),{'id':Number(_0x2d9748[_0xa3d2('0xb3')]['id']),'tags':_0x228d39||[]});return{'id':Number(_0x2d9748['params']['id']),'tags':_0x228d39||[]};});}})[_0xa3d2('0x26')](respondWithResult(_0x133377,null))[_0xa3d2('0x30')](handleError(_0x133377,null));};exports[_0xa3d2('0xc7')]=function(_0x1ffba4,_0x2b38fe,_0x371dd1){return db[_0xa3d2('0x32')][_0xa3d2('0x5a')]({'where':{'id':_0x1ffba4[_0xa3d2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2b38fe,null))[_0xa3d2('0x26')](function(_0x1b13d8){if(_0x1b13d8){return _0x1b13d8[_0xa3d2('0xc7')](_0x1ffba4[_0xa3d2('0x36')][_0xa3d2('0xbb')]);}})['then'](respondWithStatusCode(_0x2b38fe,null))[_0xa3d2('0x30')](handleError(_0x2b38fe,null));};exports[_0xa3d2('0xc8')]=function(_0x1189f2,_0x41f902){var _0x2403e4=moment()[_0xa3d2('0xc9')]()[_0xa3d2('0x96')]();var _0x300f51=path[_0xa3d2('0xca')](config[_0xa3d2('0xcb')],_0xa3d2('0xcc'),_0xa3d2('0xcd'),_0xa3d2('0xce'));var _0x5703b9=path[_0xa3d2('0xca')](config[_0xa3d2('0xcb')],_0xa3d2('0xcc'),_0xa3d2('0xcd'),'attachments');var _0x7c0b0c=path['join'](_0x300f51,_0x2403e4);var _0x5a7242=util['format'](_0xa3d2('0xcf'),_0x1189f2[_0xa3d2('0xb3')]['id'],_0x2403e4);var _0x2aa826=path[_0xa3d2('0xca')](_0x300f51,_0x5a7242);var _0x4552dc=[];_0x4552dc['push']({'model':db[_0xa3d2('0x6d')],'as':_0xa3d2('0x6d'),'attributes':['id',_0xa3d2('0xd0')],'raw':!![]});_0x4552dc[_0xa3d2('0x2f')]({'model':db[_0xa3d2('0xd1')],'as':_0xa3d2('0x5f'),'attributes':['id',_0xa3d2('0xd2'),'lastName'],'raw':!![]});var _0x3d6a69=[{'model':db[_0xa3d2('0xc1')],'as':'Messages','attributes':['id',_0xa3d2('0x70'),_0xa3d2('0x78'),_0xa3d2('0xd3'),_0xa3d2('0xd4'),_0xa3d2('0x7f')],'include':_0x4552dc}];_0x3d6a69[_0xa3d2('0x2f')]({'model':db[_0xa3d2('0xd5')],'as':'Account','attributes':['id',_0xa3d2('0x2a')]});_0x3d6a69[_0xa3d2('0x2f')]({'model':db['User'],'as':_0xa3d2('0xd6'),'attributes':['id','fullname']});return db[_0xa3d2('0x32')]['find']({'where':{'id':_0x1189f2['params']['id']},'include':_0x3d6a69})[_0xa3d2('0x26')](handleEntityNotFound(_0x41f902,null))[_0xa3d2('0x26')](function(_0x4dc5a6){if(_0x4dc5a6){var _0x52cdc2=_0x4dc5a6[_0xa3d2('0xd7')]({'plain':!![]});fs[_0xa3d2('0xd8')](_0x7c0b0c);var _0x1ebbb1={'channel':_0xa3d2('0xd9'),'account':_0x52cdc2[_0xa3d2('0xda')][_0xa3d2('0x2a')],'agent':_0x52cdc2[_0xa3d2('0xd6')]?_0x52cdc2[_0xa3d2('0xd6')][_0xa3d2('0xd0')]:_0xa3d2('0xdb'),'createdAt':moment(_0x52cdc2['createdAt'])[_0xa3d2('0xbe')](_0xa3d2('0xbf'))[_0xa3d2('0x96')](),'closedAt':_0x52cdc2[_0xa3d2('0xdc')]?moment(_0x52cdc2['closedAt'])[_0xa3d2('0xbe')](_0xa3d2('0xbf'))[_0xa3d2('0x96')]():'','disposition':_0x52cdc2['disposition'],'messages':_(_0x52cdc2[_0xa3d2('0xdd')])[_0xa3d2('0x83')]({'secret':![]})[_0xa3d2('0x2c')](function(_0x1e511a){return{'date':moment(_0x1e511a[_0xa3d2('0x78')])[_0xa3d2('0xbe')](_0xa3d2('0xbf'))['toString'](),'sender':_0x1e511a['direction']==='out'?_0x1e511a[_0xa3d2('0x6d')]?_0x1e511a[_0xa3d2('0x6d')][_0xa3d2('0xd0')]:_0xa3d2('0xde'):_0x1e511a[_0xa3d2('0x5f')]['firstName']+(_0x1e511a[_0xa3d2('0x5f')][_0xa3d2('0xdf')]?'\x20'+_0x1e511a[_0xa3d2('0x5f')][_0xa3d2('0xdf')]:''),'body':_0x1e511a['body'],'direction':_0x1e511a[_0xa3d2('0xd3')]==='out'?'A':'C','secret':_0x1e511a[_0xa3d2('0xd4')],'read':_0x1e511a[_0xa3d2('0x7f')]};})[_0xa3d2('0x62')]()};return ejs[_0xa3d2('0xe0')](path[_0xa3d2('0xca')](config[_0xa3d2('0xcb')],_0xa3d2('0xcc'),_0xa3d2('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x1ebbb1})[_0xa3d2('0x26')](function(_0x5d9b2e){var _0x30293e=path[_0xa3d2('0xca')](_0x7c0b0c,_0xa3d2('0xe2')+_0x52cdc2['id']+'-'+_0x2403e4+_0xa3d2('0xe3'));var _0x394743={'path':_0x30293e,'channel':_0xa3d2('0xd9'),'interactionId':_0x52cdc2['id']};return pdf[_0xa3d2('0xe4')](_0x5d9b2e,_0x394743);})['then'](function(){return new BPromise(function(_0x512afb,_0x1480a4){zipdir(_0x7c0b0c,{'saveTo':_0x2aa826},function(_0xd261f5,_0x5b0b55){if(_0xd261f5)return _0x1480a4(_0xd261f5);return _0x512afb(_0x5b0b55);});})[_0xa3d2('0x26')](function(){return new BPromise(function(_0x58ce77,_0x176b8a){rimraf(_0x7c0b0c,function(_0xa7a727){if(_0xa7a727)_0x176b8a(_0xa7a727);return _0x58ce77();});});})['then'](function(){return _0x41f902[_0xa3d2('0xc8')](_0x2aa826,_0x5a7242,function(_0x5806eb){if(_0x5806eb){console[_0xa3d2('0xe5')](_0xa3d2('0xe6'),_0x5806eb);}else{fs[_0xa3d2('0xe7')](_0x2aa826);}});});});}else{return _0x41f902[_0xa3d2('0x1b')](0xc8);}})[_0xa3d2('0x30')](handleError(_0x41f902,null));}; \ No newline at end of file +var _0xc80f=['offset','undefined','limit','count','Content-Range','apply','update','destroy','then','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','SmsInteraction','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','agent','sequelize','toString','merge','a.key','a.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','show','rawAttributes','includeAll','include','options','create','describe','addMessage','SmsMessage','params','omit','ids','findOne','format','findAll','addTags','emit','removeTags','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','end','status','json'];(function(_0x2bc8c8,_0x4fb16e){var _0x3e389e=function(_0x21047d){while(--_0x21047d){_0x2bc8c8['push'](_0x2bc8c8['shift']());}};_0x3e389e(++_0x4fb16e);}(_0xc80f,0x1a5));var _0xfc80=function(_0x2bd268,_0x3bda55){_0x2bd268=_0x2bd268-0x0;var _0x1cc6ef=_0xc80f[_0x2bd268];return _0x1cc6ef;};'use strict';var emlformat=require(_0xfc80('0x0'));var rimraf=require(_0xfc80('0x1'));var zipdir=require(_0xfc80('0x2'));var jsonpatch=require(_0xfc80('0x3'));var rp=require('request-promise');var moment=require(_0xfc80('0x4'));var BPromise=require(_0xfc80('0x5'));var Mustache=require(_0xfc80('0x6'));var util=require(_0xfc80('0x7'));var path=require(_0xfc80('0x8'));var sox=require(_0xfc80('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc80('0xa'));var squel=require(_0xfc80('0xb'));var crypto=require(_0xfc80('0xc'));var jsforce=require(_0xfc80('0xd'));var deskjs=require(_0xfc80('0xe'));var toCsv=require(_0xfc80('0xf'));var querystring=require('querystring');var Papa=require(_0xfc80('0x10'));var Redis=require('ioredis');var authService=require(_0xfc80('0x11'));var qs=require(_0xfc80('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfc80('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc80('0x14'))(_0xfc80('0x15'));var utils=require(_0xfc80('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfc80('0x17'));var db=require(_0xfc80('0x18'))['db'];config[_0xfc80('0x19')]=_[_0xfc80('0x1a')](config[_0xfc80('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc80('0x19')]));require(_0xfc80('0x1b'))[_0xfc80('0x1c')](socket);function respondWithStatusCode(_0x59692d,_0x2f9efe){_0x2f9efe=_0x2f9efe||0xcc;return function(_0x36763a){if(_0x36763a){return _0x59692d[_0xfc80('0x1d')](_0x2f9efe);}return _0x59692d['status'](_0x2f9efe)[_0xfc80('0x1e')]();};}function respondWithResult(_0x56a5f4,_0x129e5e){_0x129e5e=_0x129e5e||0xc8;return function(_0x5f4d3d){if(_0x5f4d3d){return _0x56a5f4[_0xfc80('0x1f')](_0x129e5e)[_0xfc80('0x20')](_0x5f4d3d);}};}function respondWithFilteredResult(_0x4c7066,_0x4db479){return function(_0x19fbdc){if(_0x19fbdc){var _0x46e982=typeof _0x4db479[_0xfc80('0x21')]===_0xfc80('0x22')&&typeof _0x4db479[_0xfc80('0x23')]==='undefined';var _0x1332c3=_0x19fbdc[_0xfc80('0x24')];var _0x528d3e=_0x46e982?0x0:_0x4db479[_0xfc80('0x21')];var _0x26817b=_0x46e982?_0x19fbdc[_0xfc80('0x24')]:_0x4db479['offset']+_0x4db479[_0xfc80('0x23')];var _0x5d01bb;if(_0x26817b>=_0x1332c3){_0x26817b=_0x1332c3;_0x5d01bb=0xc8;}else{_0x5d01bb=0xce;}_0x4c7066[_0xfc80('0x1f')](_0x5d01bb);return _0x4c7066['set'](_0xfc80('0x25'),_0x528d3e+'-'+_0x26817b+'/'+_0x1332c3)[_0xfc80('0x20')](_0x19fbdc);}return null;};}function patchUpdates(_0x11a936){return function(_0x1c9e14){try{jsonpatch[_0xfc80('0x26')](_0x1c9e14,_0x11a936,!![]);}catch(_0x4d82b6){return BPromise['reject'](_0x4d82b6);}return _0x1c9e14['save']();};}function saveUpdates(_0xebe404,_0x1fffaf){return function(_0x131748){if(_0x131748){return _0x131748[_0xfc80('0x27')](_0xebe404)['then'](function(_0x4c94fa){return _0x4c94fa;});}return null;};}function removeEntity(_0x410b4e,_0x17fc9e){return function(_0x4fbc1b){if(_0x4fbc1b){return _0x4fbc1b[_0xfc80('0x28')]()[_0xfc80('0x29')](function(){_0x410b4e[_0xfc80('0x1f')](0xcc)[_0xfc80('0x1e')]();});}};}function handleEntityNotFound(_0x25e3a4,_0x349a9e){return function(_0x42d327){if(!_0x42d327){_0x25e3a4[_0xfc80('0x1d')](0x194);}return _0x42d327;};}function handleError(_0x163dcc,_0x319309){_0x319309=_0x319309||0x1f4;return function(_0x567f75){logger['error'](_0x567f75[_0xfc80('0x2a')]);if(_0x567f75[_0xfc80('0x2b')]){delete _0x567f75[_0xfc80('0x2b')];}_0x163dcc['status'](_0x319309)[_0xfc80('0x2c')](_0x567f75);};}function getInteractionUsers(_0x35580b,_0x2b3331){return new BPromise(function(_0x403945,_0x3654ae){try{if(_0x2b3331[_0x35580b['id']]){_0x35580b[_0xfc80('0x2d')]=_[_0xfc80('0x2e')](_0x2b3331[_0x35580b['id']],function(_0x2260f4){return{'id':_0x2260f4['id'],'fullname':_0x2260f4[_0xfc80('0x2f')]};});}}catch(_0x23948e){_0x3654ae(_0x23948e);}_0x403945(_0x35580b);});}function getInteractionTags(_0x491cc3,_0x30b1ea){return new BPromise(function(_0x15ab7c,_0x2acc54){try{if(_0x491cc3[_0xfc80('0x30')]){_0x491cc3[_0xfc80('0x31')]=[];_0x491cc3['TagIds'][_0xfc80('0x32')](',')[_0xfc80('0x33')](function(_0x30c3de){_0x491cc3[_0xfc80('0x31')][_0xfc80('0x34')](_0x30b1ea[_0x30c3de]);});}delete _0x491cc3[_0xfc80('0x30')];}catch(_0x43f032){_0x2acc54(_0x43f032);}_0x15ab7c(_0x491cc3);});}function updateSmsInteraction(_0x24dca4,_0x4d5db2,_0x394951){return new BPromise(function(_0x2eae5,_0x102dd7){return getInteractionUsers(_0x24dca4,_0x394951)['then'](function(_0x5aaa46){return getInteractionTags(_0x5aaa46,_0x4d5db2);})[_0xfc80('0x29')](function(_0x14d07c){_0x2eae5(_0x14d07c);})['catch'](function(_0x290ebe){_0x102dd7(_0x290ebe);});});}exports[_0xfc80('0x35')]=function(_0x2017e7,_0x1c4f9b){var _0x37b2a0={},_0x266d45={},_0x2332d0={'count':0x0,'rows':[]};var _0x4dbc25=_[_0xfc80('0x2e')](db[_0xfc80('0x36')]['rawAttributes'],function(_0x244373){return{'name':_0x244373['fieldName'],'type':_0x244373['type'][_0xfc80('0x37')]};});_0x266d45[_0xfc80('0x38')]=_[_0xfc80('0x2e')](_0x4dbc25,_0xfc80('0x2b'));_0x266d45[_0xfc80('0x39')]=_[_0xfc80('0x3a')](_0x2017e7[_0xfc80('0x39')]);_0x266d45['filters']=_['intersection'](_0x266d45[_0xfc80('0x38')],_0x266d45[_0xfc80('0x39')]);_0x37b2a0[_0xfc80('0x3b')]=_[_0xfc80('0x3c')](_0x266d45['model'],qs[_0xfc80('0x3d')](_0x2017e7[_0xfc80('0x39')][_0xfc80('0x3d')]));_0x37b2a0[_0xfc80('0x3b')]=_0x37b2a0[_0xfc80('0x3b')][_0xfc80('0x3e')]?_0x37b2a0[_0xfc80('0x3b')]:_0x266d45[_0xfc80('0x38')];if(!_0x2017e7[_0xfc80('0x39')][_0xfc80('0x3f')](_0xfc80('0x40'))){_0x37b2a0[_0xfc80('0x23')]=qs[_0xfc80('0x23')](_0x2017e7['query'][_0xfc80('0x23')]);_0x37b2a0[_0xfc80('0x21')]=qs[_0xfc80('0x21')](_0x2017e7[_0xfc80('0x39')][_0xfc80('0x21')]);}_0x37b2a0[_0xfc80('0x41')]=qs[_0xfc80('0x42')](_0x2017e7[_0xfc80('0x39')][_0xfc80('0x42')]);_0x37b2a0[_0xfc80('0x43')]=qs[_0xfc80('0x44')](_[_0xfc80('0x45')](_0x2017e7['query'],_0x266d45[_0xfc80('0x44')]),_0x4dbc25);var _0xc243bd=[];var _0x4139aa=squel[_0xfc80('0x46')]()[_0xfc80('0x47')]('id')['field'](_0xfc80('0x2b'))['field'](_0xfc80('0x48'))[_0xfc80('0x49')](_0xfc80('0x4a'));var _0x149c89=squel[_0xfc80('0x46')]()['field']('u.id')[_0xfc80('0x47')]('u.fullname')[_0xfc80('0x47')]('ui.SmsInteractionId')[_0xfc80('0x49')](_0xfc80('0x4b'),'ui')['left_join'](_0xfc80('0x4c'),'u',_0xfc80('0x4d'));var _0x1a222c=squel['select']()['from'](_0xfc80('0x4e'),'i')[_0xfc80('0x4f')](_0xfc80('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xfc80('0x4f')](_0xfc80('0x4c'),'o',_0xfc80('0x51'))[_0xfc80('0x4f')](_0xfc80('0x52'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xfc80('0x53'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xfc80('0x4f')](_0xfc80('0x54'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xfc80('0x4f')](_0xfc80('0x4a'),'t',_0xfc80('0x55'));var _0x108a0b=squel[_0xfc80('0x56')]();var _0x41b624=[];var _0x37f716=squel[_0xfc80('0x56')]();var _0x44f0d3;if(_0x2017e7[_0xfc80('0x39')][_0xfc80('0x57')]){_0x44f0d3=as[_0xfc80('0x58')](_0x2017e7[_0xfc80('0x39')][_0xfc80('0x57')]);var _0x30205d=_0x44f0d3[_0xfc80('0x59')];for(var _0xe2cc7c=0x0;_0xe2cc7c<_0x44f0d3['conditions'][_0xfc80('0x3e')];_0xe2cc7c++){var _0x358ba7=_0x44f0d3[_0xfc80('0x5a')][_0xe2cc7c];var _0x1557c3='i';var _0x45b961=_[_0xfc80('0x5b')](_0x4dbc25,[_0xfc80('0x2b'),_0x358ba7[_0xfc80('0x47')]]);if(!_0x45b961){switch(_0x358ba7['field']){case'unreadMessages':if(_0x358ba7[_0xfc80('0x5c')]==0x1){_0x1a222c['having']('`'+_0x358ba7[_0xfc80('0x47')]+_0xfc80('0x5d'));}else{_0x1a222c['having']('`'+_0x358ba7[_0xfc80('0x47')]+_0xfc80('0x5e'));}break;case _0xfc80('0x5f'):if(_0x358ba7[_0xfc80('0x60')]===_0xfc80('0x61')){if(_0x358ba7['value'][_0xfc80('0x32')]('\x20')[_0xfc80('0x3e')]>0x1){_0x108a0b[_0x30205d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfc80('0x62')](_0x358ba7[_0xfc80('0x5c')]),null);}else{var _0x232656='%'+_0x358ba7[_0xfc80('0x5c')]+'%';_0x108a0b[_0x30205d](_0xfc80('0x63'),_0x232656,_0x232656,_0x232656);}}else{_0x45b961=_[_0xfc80('0x5b')](_0x4dbc25,[_0xfc80('0x2b'),_0xfc80('0x64')]);_0x358ba7[_0xfc80('0x47')]='ContactId';_0x4c938f=as[_0xfc80('0x65')](_0x1557c3,_0x45b961['type'],_0x358ba7);_0x108a0b[_0x30205d](_0x4c938f[_0xfc80('0x66')],_0x4c938f['value']['start'],_0x4c938f[_0xfc80('0x5c')]['end']);}break;case _0xfc80('0x67'):var _0x3c4720=_0x358ba7[_0xfc80('0x5c')]['split'](',')[_0xfc80('0x2e')](function(_0x28c974){return Number(_0x28c974);});_0x3c4720[_0xfc80('0x33')](function(_0x107e7c){_0x37f716['or'](_0xfc80('0x68'),'%,'+_0x107e7c+',%');});_0x41b624=_['union'](_0x41b624,_0x3c4720);break;case _0xfc80('0x69'):if(_0x358ba7['operator']===_0xfc80('0x61')){_0x108a0b[_0x30205d](_0xfc80('0x6a'),'%'+_0x358ba7['value']+'%',null);}else{_0x45b961=_[_0xfc80('0x5b')](_0x4dbc25,[_0xfc80('0x2b'),_0xfc80('0x6b')]);_0x358ba7[_0xfc80('0x47')]=_0xfc80('0x6b');_0x4c938f=as[_0xfc80('0x65')](_0x1557c3,_0x45b961[_0xfc80('0x6c')],_0x358ba7);_0x108a0b[_0x30205d](_0x4c938f[_0xfc80('0x66')],_0x4c938f[_0xfc80('0x5c')][_0xfc80('0x6d')],_0x4c938f[_0xfc80('0x5c')][_0xfc80('0x1e')]);}break;case _0xfc80('0x6e'):_0x4c938f=as[_0xfc80('0x65')]('me',null,_0x358ba7);_0x108a0b[_0x30205d](_0x4c938f[_0xfc80('0x66')],_0x4c938f[_0xfc80('0x5c')][_0xfc80('0x6d')],_0x4c938f['value']['end']);break;}}else{var _0x4c938f=as[_0xfc80('0x65')](_0x1557c3,_0x45b961[_0xfc80('0x6c')],_0x358ba7);_0x108a0b[_0x30205d](_0x4c938f['text'],_0x4c938f[_0xfc80('0x5c')][_0xfc80('0x6d')],_0x4c938f[_0xfc80('0x5c')]['end']);}}}else{var _0x4c5f53=_(_0x2017e7[_0xfc80('0x39')])[_0xfc80('0x3a')]()['map'](function(_0x204a8f){return _[_0xfc80('0x6f')](_0x4dbc25,[_0xfc80('0x2b'),_0x204a8f])?_0x204a8f:undefined;})[_0xfc80('0x70')]()[_0xfc80('0x5c')]();if(!_[_0xfc80('0x71')](_0x4c5f53)){_0x4c5f53[_0xfc80('0x33')](function(_0x42cb1b){if(_0x42cb1b===_0xfc80('0x72')){_0x1a222c['where'](_0xfc80('0x73'),[][_0xfc80('0x74')](_0x2017e7[_0xfc80('0x39')][_0x42cb1b]));}else if(_0x42cb1b===_0xfc80('0x75')){var _0x5845bd=JSON[_0xfc80('0x76')](_0x2017e7[_0xfc80('0x39')][_0x42cb1b])[_0xfc80('0x77')];var _0x5b9f7e=JSON[_0xfc80('0x76')](_0x2017e7[_0xfc80('0x39')][_0x42cb1b])[_0xfc80('0x78')];_0x1a222c[_0xfc80('0x43')](_0xfc80('0x79'),_0x5845bd,_0x5b9f7e);}else{if(_0x2017e7[_0xfc80('0x39')][_0x42cb1b]==='null'){_0x1a222c['where']('i.'+_0x42cb1b+_0xfc80('0x7a'));}else{_0x1a222c[_0xfc80('0x43')]('i.'+_0x42cb1b+'\x20=\x20?',_0x2017e7[_0xfc80('0x39')][_0x42cb1b]);}}});}if(_0x2017e7['query'][_0xfc80('0x7b')]){if(_0x2017e7[_0xfc80('0x39')][_0xfc80('0x7b')]==0x1){_0x1a222c[_0xfc80('0x7c')](_0xfc80('0x7d'));}else{_0x1a222c[_0xfc80('0x7c')]('`unreadMessages`\x20>\x200');}}if(_0x2017e7[_0xfc80('0x39')][_0xfc80('0x7e')]){_0x41b624=_[_0xfc80('0x7f')](_0x2017e7[_0xfc80('0x39')][_0xfc80('0x7e')])?_0x2017e7[_0xfc80('0x39')]['tag']:new Array(_0x2017e7['query'][_0xfc80('0x7e')]);_0x41b624[_0xfc80('0x33')](function(_0x12ddcd){_0x37f716['or'](_0xfc80('0x68'),'%,'+_0x12ddcd+',%');});}if(_0x2017e7[_0xfc80('0x39')][_0xfc80('0x80')]){var _0x3dbda5=_0x2017e7[_0xfc80('0x39')][_0xfc80('0x80')]['replace']('\x5c','\x5c\x5c')[_0xfc80('0x81')](/'/g,'\x27\x27');if(qs[_0xfc80('0x82')](_0x3dbda5)){_0x108a0b['or'](_0xfc80('0x83'),_0x3dbda5+'%')['or'](_0xfc80('0x84'),_0x3dbda5+'%');}else{_0x108a0b['or'](_0xfc80('0x85'),qs[_0xfc80('0x62')](_0x3dbda5))['or'](_0xfc80('0x86'),_0x3dbda5+'%');}}}_0x1a222c[_0xfc80('0x43')](_0x108a0b);_0x1a222c[_0xfc80('0x87')](_0xfc80('0x88'));var _0x3d2c25={'type':db[_0xfc80('0x89')][_0xfc80('0x8a')]['SELECT'],'raw':!![]};var _0x1aa71c=_0x1a222c[_0xfc80('0x8b')]();_0x1aa71c[_0xfc80('0x47')](_0xfc80('0x88'));_0x1aa71c[_0xfc80('0x47')](_0xfc80('0x8c'),_0xfc80('0x8d'));if(_0x37b2a0['order']){_0x37b2a0[_0xfc80('0x41')][_0xfc80('0x33')](function(_0x1a1009){var _0x3498ac=_0x1a1009[0x0]==='contactName'?_0x1a1009[0x0]:'i.'+_0x1a1009[0x0];_0x1a222c[_0xfc80('0x41')](_0x3498ac,_0x1a1009[0x1]===_0xfc80('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x41b624)){_0x1a222c['having'](_0x37f716);_0x1aa71c[_0xfc80('0x43')]('t.id\x20IN\x20?',_0x41b624);}BPromise[_0xfc80('0x8f')]()[_0xfc80('0x29')](function(){if(!_0x44f0d3){if(_0x2017e7['query'][_0xfc80('0x72')])return;_0x1aa71c['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1a222c[_0xfc80('0x43')](_0xfc80('0x90'));return;}if(_0x2017e7[_0xfc80('0x91')]['role']!=='agent')return;return _0x2017e7[_0xfc80('0x91')][_0xfc80('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1fa3ed){if(_[_0xfc80('0x71')](_0x1fa3ed)){_0x1aa71c[_0xfc80('0x43')](_0xfc80('0x93'));_0x1a222c[_0xfc80('0x43')](_0xfc80('0x93'));}else{_0x1aa71c['where'](_0xfc80('0x73'),_[_0xfc80('0x2e')](_0x1fa3ed,'id'));_0x1a222c['where'](_0xfc80('0x73'),_[_0xfc80('0x2e')](_0x1fa3ed,'id'));}});})[_0xfc80('0x29')](function(){if(_0x2017e7[_0xfc80('0x91')][_0xfc80('0x94')]===_0xfc80('0x95')&&!_0x44f0d3&&!_0x2017e7[_0xfc80('0x39')][_0xfc80('0x72')])return[];return db[_0xfc80('0x96')][_0xfc80('0x39')](_0x1aa71c['toString'](),_0x3d2c25);})['then'](function(_0x37fe3a){_0x2332d0[_0xfc80('0x24')]=_0x37fe3a[_0xfc80('0x3e')];if(_0x2332d0[_0xfc80('0x24')]===0x0)return[];return db[_0xfc80('0x96')][_0xfc80('0x39')](_0x4139aa[_0xfc80('0x97')](),_0x3d2c25)[_0xfc80('0x29')](function(_0x27d9cc){_0xc243bd=_['keyBy'](_0x27d9cc,'id');_0x3d2c25=_[_0xfc80('0x98')](_0x3d2c25,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2017e7[_0xfc80('0x39')]['fields']){_0x37b2a0['attributes'][_0xfc80('0x33')](function(_0x5329a8){_0x1a222c[_0xfc80('0x47')]('i.'+_0x5329a8);});}else{_0x1a222c[_0xfc80('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfc80('0x8d'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0x99'),'Account.key');_0x1a222c['field'](_0xfc80('0x9a'),'Account.mandatoryDisposition');_0x1a222c[_0xfc80('0x47')]('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',_0xfc80('0x9b'));_0x1a222c['field'](_0xfc80('0x9c'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0x9d'),_0xfc80('0x9e'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0x9f'),'Contact.lastName');_0x1a222c['field'](_0xfc80('0xa0'),'Contact.email');_0x1a222c[_0xfc80('0x47')](_0xfc80('0xa1'),_0xfc80('0xa2'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0xa3'),_0xfc80('0xa4'));_0x1a222c['field'](_0xfc80('0xa5'),_0xfc80('0xa6'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0xa7'),_0xfc80('0xa8'));_0x1a222c[_0xfc80('0x47')](_0xfc80('0xa9'),_0xfc80('0xaa'));_0x1a222c['field'](_0xfc80('0xab'),_0xfc80('0x30'));}if(_0x37b2a0[_0xfc80('0x23')])_0x1a222c['limit'](_0x37b2a0[_0xfc80('0x23')]);if(_0x37b2a0[_0xfc80('0x21')])_0x1a222c[_0xfc80('0x21')](_0x37b2a0[_0xfc80('0x21')]);return db[_0xfc80('0x96')][_0xfc80('0x39')](_0x1a222c[_0xfc80('0x97')](),_0x3d2c25);})['then'](function(_0x40ab37){if(_0x40ab37[_0xfc80('0x3e')]>0x0)_0x149c89['where']('ui.SmsInteractionId\x20IN\x20?',_[_0xfc80('0x2e')](_0x40ab37,'id'));return db[_0xfc80('0x96')][_0xfc80('0x39')](_0x149c89[_0xfc80('0x97')](),_0x3d2c25)[_0xfc80('0x29')](function(_0x426fd7){var _0x40d075=_[_0xfc80('0xac')](_0x426fd7,_0xfc80('0xad'));var _0x9697c3=[];_0x40ab37[_0xfc80('0x33')](function(_0x3a424e){_0x9697c3[_0xfc80('0x34')](updateSmsInteraction(_0x3a424e,_0xc243bd,_0x40d075));});return BPromise[_0xfc80('0xae')](_0x9697c3);});});})['then'](function(_0x5f152d){_0x2332d0[_0xfc80('0xaf')]=_0x5f152d;return _0x2332d0;})[_0xfc80('0x29')](respondWithFilteredResult(_0x1c4f9b,_0x37b2a0))[_0xfc80('0xb0')](handleError(_0x1c4f9b,null));};exports[_0xfc80('0xb1')]=function(_0x16980b,_0x3f55a0){var _0x4aa5e5={'raw':![],'where':{'id':_0x16980b['params']['id']}},_0x4a290a={};_0x4a290a[_0xfc80('0x38')]=_[_0xfc80('0x3a')](db[_0xfc80('0x36')][_0xfc80('0xb2')]);_0x4a290a[_0xfc80('0x39')]=_[_0xfc80('0x3a')](_0x16980b['query']);_0x4a290a[_0xfc80('0x44')]=_[_0xfc80('0x3c')](_0x4a290a['model'],_0x4a290a[_0xfc80('0x39')]);_0x4aa5e5[_0xfc80('0x3b')]=_[_0xfc80('0x3c')](_0x4a290a['model'],qs['fields'](_0x16980b[_0xfc80('0x39')]['fields']));_0x4aa5e5[_0xfc80('0x3b')]=_0x4aa5e5[_0xfc80('0x3b')]['length']?_0x4aa5e5[_0xfc80('0x3b')]:_0x4a290a[_0xfc80('0x38')];if(_0x16980b[_0xfc80('0x39')][_0xfc80('0xb3')]){_0x4aa5e5[_0xfc80('0xb4')]=[{'all':!![]}];}_0x4aa5e5=_[_0xfc80('0x98')]({},_0x4aa5e5,_0x16980b[_0xfc80('0xb5')]);return db[_0xfc80('0x36')][_0xfc80('0x5b')](_0x4aa5e5)[_0xfc80('0x29')](handleEntityNotFound(_0x3f55a0,null))[_0xfc80('0x29')](respondWithResult(_0x3f55a0,null))[_0xfc80('0xb0')](handleError(_0x3f55a0,null));};exports[_0xfc80('0xb6')]=function(_0x86a309,_0x4d2f0e){return db[_0xfc80('0x36')][_0xfc80('0xb6')](_0x86a309[_0xfc80('0x6e')],{})['then'](respondWithResult(_0x4d2f0e,0xc9))[_0xfc80('0xb0')](handleError(_0x4d2f0e,null));};exports[_0xfc80('0x27')]=function(_0x4da9dd,_0x29d0cc){if(_0x4da9dd[_0xfc80('0x6e')]['id']){delete _0x4da9dd[_0xfc80('0x6e')]['id'];}return db['SmsInteraction'][_0xfc80('0x5b')]({'where':{'id':_0x4da9dd['params']['id']}})['then'](handleEntityNotFound(_0x29d0cc,null))[_0xfc80('0x29')](saveUpdates(_0x4da9dd['body'],null))['then'](respondWithResult(_0x29d0cc,null))[_0xfc80('0xb0')](handleError(_0x29d0cc,null));};exports['destroy']=function(_0x2733ff,_0x3032a0){return db[_0xfc80('0x36')][_0xfc80('0x5b')]({'where':{'id':_0x2733ff['params']['id']}})['then'](handleEntityNotFound(_0x3032a0,null))[_0xfc80('0x29')](removeEntity(_0x3032a0,null))['catch'](handleError(_0x3032a0,null));};exports[_0xfc80('0xb7')]=function(_0x3bd4e7,_0xda2dba){return db['SmsInteraction'][_0xfc80('0xb7')]()['then'](respondWithResult(_0xda2dba,null))[_0xfc80('0xb0')](handleError(_0xda2dba,null));};exports[_0xfc80('0xb8')]=function(_0x2909b1,_0xcbc929,_0x1c51ee){return db[_0xfc80('0xb9')]['find']({'where':{'id':_0x2909b1[_0xfc80('0xba')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0xcbc929,null))[_0xfc80('0x29')](function(_0x5cd014){if(_0x5cd014){return _0x5cd014['addMessage'](_0x2909b1['body']['ids'],_[_0xfc80('0xbb')](_0x2909b1[_0xfc80('0x6e')],[_0xfc80('0xbc'),'id'])||{});}})[_0xfc80('0x29')](respondWithResult(_0xcbc929,null))[_0xfc80('0xb0')](handleError(_0xcbc929,null));};exports['getMessages']=function(_0x173a21,_0x5b7fe5,_0x514a3e){var _0x5818ce={'raw':![],'where':{}};var _0x1e3e10={};var _0x2db6e2={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xfc80('0xbd')]({'where':{'id':_0x173a21['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x5b7fe5,null))[_0xfc80('0x29')](function(_0x2e0167){if(_0x2e0167){_0x1e3e10[_0xfc80('0x38')]=_[_0xfc80('0x3a')](db[_0xfc80('0xb9')][_0xfc80('0xb2')]);_0x1e3e10['query']=_[_0xfc80('0x3a')](_0x173a21['query']);_0x1e3e10[_0xfc80('0x44')]=_['intersection'](_0x1e3e10['model'],_0x1e3e10['query']);_0x5818ce[_0xfc80('0x3b')]=_[_0xfc80('0x3c')](_0x1e3e10[_0xfc80('0x38')],qs['fields'](_0x173a21['query'][_0xfc80('0x3d')]));_0x5818ce[_0xfc80('0x3b')]=_0x5818ce[_0xfc80('0x3b')][_0xfc80('0x3e')]?_0x5818ce['attributes']:_0x1e3e10[_0xfc80('0x38')];if(!_0x173a21[_0xfc80('0x39')][_0xfc80('0x3f')](_0xfc80('0x40'))){_0x5818ce['limit']=qs[_0xfc80('0x23')](_0x173a21['query'][_0xfc80('0x23')]);_0x5818ce[_0xfc80('0x21')]=qs[_0xfc80('0x21')](_0x173a21['query'][_0xfc80('0x21')]);}_0x5818ce[_0xfc80('0x41')]=qs[_0xfc80('0x42')](_0x173a21[_0xfc80('0x39')][_0xfc80('0x42')]);_0x5818ce[_0xfc80('0x43')]=qs[_0xfc80('0x44')](_[_0xfc80('0x45')](_0x173a21[_0xfc80('0x39')],_0x1e3e10['filters']));_0x5818ce[_0xfc80('0x43')][_0xfc80('0xad')]=_0x2e0167['id'];if(_0x173a21[_0xfc80('0x39')][_0xfc80('0x80')]){_0x5818ce[_0xfc80('0x43')]=_[_0xfc80('0x98')](_0x5818ce[_0xfc80('0x43')],{'$or':_[_0xfc80('0x2e')](_0x5818ce[_0xfc80('0x3b')],function(_0x4861fb){var _0x363685={};_0x363685[_0x4861fb]={'$like':'%'+_0x173a21[_0xfc80('0x39')][_0xfc80('0x80')]+'%'};return _0x363685;})});}if(_0x173a21['query'][_0xfc80('0x77')]){var _0x263044=_0x173a21[_0xfc80('0x39')][_0xfc80('0x77')][_0xfc80('0x32')](',');var _0x322913={};_0x322913[_0x263044[0x0]]={'$gte':moment(_0x263044[0x1])[_0xfc80('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5818ce['where']=_[_0xfc80('0x98')](_0x5818ce[_0xfc80('0x43')],_0x322913);}_0x5818ce=_[_0xfc80('0x98')]({},_0x5818ce,_0x173a21['options']);return db[_0xfc80('0xb9')][_0xfc80('0x24')]({'where':_0x5818ce[_0xfc80('0x43')]})[_0xfc80('0x29')](function(_0x529d6b){_0x2db6e2[_0xfc80('0x24')]=_0x529d6b;if(_0x173a21[_0xfc80('0x39')]['includeAll']){_0x5818ce[_0xfc80('0xb4')]=[{'all':!![]}];}return db['SmsMessage'][_0xfc80('0xbf')](_0x5818ce);})[_0xfc80('0x29')](function(_0x5970e3){_0x2db6e2['rows']=_0x5970e3;return _0x2db6e2;});}})['then'](respondWithFilteredResult(_0x5b7fe5,_0x5818ce))[_0xfc80('0xb0')](handleError(_0x5b7fe5,null));};exports[_0xfc80('0xc0')]=function(_0x23f359,_0x415f15,_0x5e6bc2){return db[_0xfc80('0x36')][_0xfc80('0x5b')]({'where':{'id':_0x23f359[_0xfc80('0xba')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x415f15,null))['then'](function(_0x56868a){if(_0x56868a){return _0x56868a['setTags'](_0x23f359[_0xfc80('0x6e')]['ids'],_['omit'](_0x23f359[_0xfc80('0x6e')],[_0xfc80('0xbc'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xfc80('0x2b'),_0xfc80('0x48')],'where':{'id':_0x23f359[_0xfc80('0x6e')][_0xfc80('0xbc')]}});})[_0xfc80('0x29')](function(_0x4cee09){socket[_0xfc80('0xc1')]('smsInteractionTags:save',{'id':Number(_0x23f359['params']['id']),'tags':_0x4cee09||[]});return{'id':Number(_0x23f359[_0xfc80('0xba')]['id']),'tags':_0x4cee09||[]};});}})[_0xfc80('0x29')](respondWithResult(_0x415f15,null))['catch'](handleError(_0x415f15,null));};exports[_0xfc80('0xc2')]=function(_0xae4896,_0x1113ab,_0x26a8ff){return db['SmsInteraction'][_0xfc80('0x5b')]({'where':{'id':_0xae4896['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x1113ab,null))[_0xfc80('0x29')](function(_0x2f147c){if(_0x2f147c){return _0x2f147c['removeTags'](_0xae4896[_0xfc80('0x39')][_0xfc80('0xbc')]);}})[_0xfc80('0x29')](respondWithStatusCode(_0x1113ab,null))[_0xfc80('0xb0')](handleError(_0x1113ab,null));};exports[_0xfc80('0xc3')]=function(_0x4431b2,_0x190e7c){var _0x595f0a=moment()[_0xfc80('0xc4')]()[_0xfc80('0x97')]();var _0x30e39e=path['join'](config[_0xfc80('0xc5')],_0xfc80('0xc6'),_0xfc80('0xc7'),_0xfc80('0xc8'));var _0x3e626e=path['join'](config[_0xfc80('0xc5')],_0xfc80('0xc6'),'files',_0xfc80('0xc9'));var _0x18abbc=path[_0xfc80('0xca')](_0x30e39e,_0x595f0a);var _0x4be01b=util['format'](_0xfc80('0xcb'),_0x4431b2[_0xfc80('0xba')]['id'],_0x595f0a);var _0x240801=path[_0xfc80('0xca')](_0x30e39e,_0x4be01b);var _0x1040ec=[];_0x1040ec[_0xfc80('0x34')]({'model':db[_0xfc80('0x69')],'as':_0xfc80('0x69'),'attributes':['id',_0xfc80('0x2f')],'raw':!![]});_0x1040ec[_0xfc80('0x34')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xfc80('0xcc')],'raw':!![]});var _0xb0ee56=[{'model':db[_0xfc80('0xb9')],'as':_0xfc80('0xcd'),'attributes':['id',_0xfc80('0x6e'),'createdAt',_0xfc80('0xce'),_0xfc80('0xcf'),'read'],'include':_0x1040ec}];_0xb0ee56[_0xfc80('0x34')]({'model':db[_0xfc80('0xd0')],'as':_0xfc80('0xd1'),'attributes':['id',_0xfc80('0x2b')]});_0xb0ee56['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0xfc80('0x5b')]({'where':{'id':_0x4431b2['params']['id']},'include':_0xb0ee56})['then'](handleEntityNotFound(_0x190e7c,null))[_0xfc80('0x29')](function(_0x12274c){if(_0x12274c){var _0x1c12a9=_0x12274c[_0xfc80('0xd2')]({'plain':!![]});fs[_0xfc80('0xd3')](_0x18abbc);var _0x485cbe={'channel':_0xfc80('0xd4'),'account':_0x1c12a9[_0xfc80('0xd1')]['name'],'agent':_0x1c12a9[_0xfc80('0xd5')]?_0x1c12a9[_0xfc80('0xd5')][_0xfc80('0x2f')]:_0xfc80('0xd6'),'createdAt':moment(_0x1c12a9['createdAt'])[_0xfc80('0xbe')](_0xfc80('0xd7'))[_0xfc80('0x97')](),'closedAt':_0x1c12a9['closed']?moment(_0x1c12a9[_0xfc80('0xd8')])[_0xfc80('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfc80('0x97')]():'','disposition':_0x1c12a9['disposition'],'messages':_(_0x1c12a9['Messages'])[_0xfc80('0x80')]({'secret':![]})[_0xfc80('0x2e')](function(_0x1ed231){return{'date':moment(_0x1ed231[_0xfc80('0x75')])[_0xfc80('0xbe')](_0xfc80('0xd7'))['toString'](),'sender':_0x1ed231[_0xfc80('0xce')]===_0xfc80('0xd9')?_0x1ed231[_0xfc80('0x69')]?_0x1ed231['User']['fullname']:'System':_0x1ed231[_0xfc80('0x5f')][_0xfc80('0xda')]+(_0x1ed231[_0xfc80('0x5f')][_0xfc80('0xcc')]?'\x20'+_0x1ed231[_0xfc80('0x5f')][_0xfc80('0xcc')]:''),'body':_0x1ed231[_0xfc80('0x6e')],'direction':_0x1ed231[_0xfc80('0xce')]===_0xfc80('0xd9')?'A':'C','secret':_0x1ed231[_0xfc80('0xcf')],'read':_0x1ed231[_0xfc80('0x7b')]};})[_0xfc80('0x5c')]()};return ejs[_0xfc80('0xdb')](path['join'](config[_0xfc80('0xc5')],_0xfc80('0xc6'),_0xfc80('0xdc'),_0xfc80('0xdd')),{'interaction':_0x485cbe})[_0xfc80('0x29')](function(_0x1cee92){var _0x48b6ff=path[_0xfc80('0xca')](_0x18abbc,'transcript-'+_0x1c12a9['id']+'-'+_0x595f0a+_0xfc80('0xde'));var _0x426526={'path':_0x48b6ff,'channel':_0xfc80('0xd4'),'interactionId':_0x1c12a9['id']};return pdf[_0xfc80('0xdf')](_0x1cee92,_0x426526);})[_0xfc80('0x29')](function(){return new BPromise(function(_0x18b990,_0x5b96d6){zipdir(_0x18abbc,{'saveTo':_0x240801},function(_0x42c45e,_0x59fde8){if(_0x42c45e)return _0x5b96d6(_0x42c45e);return _0x18b990(_0x59fde8);});})[_0xfc80('0x29')](function(){return new BPromise(function(_0x1df2b6,_0x2f38c9){rimraf(_0x18abbc,function(_0x2c8996){if(_0x2c8996)_0x2f38c9(_0x2c8996);return _0x1df2b6();});});})[_0xfc80('0x29')](function(){return _0x190e7c['download'](_0x240801,_0x4be01b,function(_0x447de0){if(_0x447de0){console[_0xfc80('0xe0')](_0xfc80('0xe1'),_0x447de0);}else{fs[_0xfc80('0xe2')](_0x240801);}});});});}else{return _0x190e7c[_0xfc80('0x1d')](0xc8);}})[_0xfc80('0xb0')](handleError(_0x190e7c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7114cb2..ce08d12 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 _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0x318643,_0x8ac50e){var _0x59bf55=function(_0x100e61){while(--_0x100e61){_0x318643['push'](_0x318643['shift']());}};_0x59bf55(++_0x8ac50e);}(_0x0598,0x92));var _0x8059=function(_0x5e782e,_0x5ead47){_0x5e782e=_0x5e782e-0x0;var _0xaf5eda=_0x0598[_0x5e782e];return _0xaf5eda;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x8952=['Users','map','findAll','unreadMessages','catch','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','setDataValue'];(function(_0x354c7e,_0x177feb){var _0x299f41=function(_0x3ed047){while(--_0x3ed047){_0x354c7e['push'](_0x354c7e['shift']());}};_0x299f41(++_0x177feb);}(_0x8952,0x17e));var _0x2895=function(_0x247cd4,_0x1b5349){_0x247cd4=_0x247cd4-0x0;var _0x489323=_0x8952[_0x247cd4];return _0x489323;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2895('0x0'))['db'][_0x2895('0x1')];var SmsMessage=require(_0x2895('0x0'))['db'][_0x2895('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2895('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2895('0x4'),'afterDestroy':_0x2895('0x5')};function emitEvent(_0x1f69f6){return function(_0x5b28c6,_0x32429c,_0x73c245){_0x5b28c6[_0x2895('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x526c32){_0x5b28c6[_0x2895('0x7')](_0x2895('0x8'),_0x526c32[_0x2895('0x9')](function(_0x294446){return{'id':_0x294446['id']};}));return SmsMessage[_0x2895('0xa')]({'where':{'SmsInteractionId':_0x5b28c6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x14fb67){_0x5b28c6['setDataValue'](_0x2895('0xb'),_0x14fb67['length']);SmsInteractionEvents['emit'](_0x1f69f6+':'+_0x5b28c6['id'],_0x5b28c6);SmsInteractionEvents['emit'](_0x1f69f6,_0x5b28c6);_0x73c245(null);})[_0x2895('0xc')](_0x73c245(null));};}for(var e in events){if(events[_0x2895('0xd')](e)){var event=events[e];SmsInteraction[_0x2895('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4ea0c38..dfcb5e0 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 _0x5992=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','request-promise','path'];(function(_0x278365,_0x6f3a5d){var _0x3820c6=function(_0x498452){while(--_0x498452){_0x278365['push'](_0x278365['shift']());}};_0x3820c6(++_0x6f3a5d);}(_0x5992,0x82));var _0x2599=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x5992[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x2599('0x0'));var logger=require(_0x2599('0x1'))('api');var moment=require(_0x2599('0x2'));var BPromise=require('bluebird');var rp=require(_0x2599('0x3'));var fs=require('fs');var path=require(_0x2599('0x4'));var rimraf=require(_0x2599('0x5'));var config=require(_0x2599('0x6'));var attributes=require(_0x2599('0x7'));module[_0x2599('0x8')]=function(_0x181641,_0x30c5a7){return _0x181641[_0x2599('0x9')](_0x2599('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20b81d,_0x49363a,_0x3d58b2){if(_0x20b81d['changed'](_0x2599('0xb'))){_0x20b81d[_0x2599('0xc')]=moment()[_0x2599('0xd')](_0x2599('0xe'));}_0x3d58b2(null,_0x20b81d);}}});}; \ No newline at end of file +var _0x1054=['moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x57fc8f,_0x35fb1e){var _0xcf58f7=function(_0x33458b){while(--_0x33458b){_0x57fc8f['push'](_0x57fc8f['shift']());}};_0xcf58f7(++_0x35fb1e);}(_0x1054,0xeb));var _0x4105=function(_0xa1cbe3,_0x4cb2e4){_0xa1cbe3=_0xa1cbe3-0x0;var _0xcff3b=_0x1054[_0xa1cbe3];return _0xcff3b;};'use strict';var _=require(_0x4105('0x0'));var util=require(_0x4105('0x1'));var logger=require('../../config/logger')(_0x4105('0x2'));var moment=require(_0x4105('0x3'));var BPromise=require(_0x4105('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4105('0x5'));var rimraf=require(_0x4105('0x6'));var config=require(_0x4105('0x7'));var attributes=require(_0x4105('0x8'));module[_0x4105('0x9')]=function(_0x2985b6,_0x3827a4){return _0x2985b6['define'](_0x4105('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10a23f,_0x4768b3,_0x3b48cd){if(_0x10a23f[_0x4105('0xb')]('closed')){_0x10a23f[_0x4105('0xc')]=moment()['format'](_0x4105('0xd'));}_0x3b48cd(null,_0x10a23f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index fb715c6..2b6d45a 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 _0xcf3c=['limit','catch','AddTagsToSmsInteraction','find','where','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateSmsInteraction','options','raw'];(function(_0x4aaae5,_0x22d814){var _0x1c02a9=function(_0x4960cc){while(--_0x4960cc){_0x4aaae5['push'](_0x4aaae5['shift']());}};_0x1c02a9(++_0x22d814);}(_0xcf3c,0x142));var _0xccf3=function(_0x1cc081,_0xef781d){_0x1cc081=_0x1cc081-0x0;var _0x36f9fc=_0xcf3c[_0x1cc081];return _0x36f9fc;};'use strict';var _=require(_0xccf3('0x0'));var util=require('util');var moment=require(_0xccf3('0x1'));var BPromise=require(_0xccf3('0x2'));var rs=require(_0xccf3('0x3'));var fs=require('fs');var Redis=require(_0xccf3('0x4'));var db=require(_0xccf3('0x5'))['db'];var utils=require(_0xccf3('0x6'));var logger=require('../../config/logger')(_0xccf3('0x7'));var config=require(_0xccf3('0x8'));var jayson=require(_0xccf3('0x9'));var client=jayson[_0xccf3('0xa')][_0xccf3('0xb')]({'port':0x232a});config[_0xccf3('0xc')]=_[_0xccf3('0xd')](config[_0xccf3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xccf3('0xe'))(new Redis(config[_0xccf3('0xc')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3f2fb4,_0x45911f,_0x7876cf){return new BPromise(function(_0x255c31,_0x398305){return client[_0xccf3('0xf')](_0x3f2fb4,_0x7876cf)[_0xccf3('0x10')](function(_0x4e2d0a){logger[_0xccf3('0x11')](_0xccf3('0x12'),_0x45911f,_0xccf3('0x13'));logger[_0xccf3('0x14')](_0xccf3('0x15'),_0x45911f,'request\x20sent',JSON[_0xccf3('0x16')](_0x4e2d0a));if(_0x4e2d0a['error']){if(_0x4e2d0a[_0xccf3('0x17')]['code']===0x1f4){logger[_0xccf3('0x17')](_0xccf3('0x12'),_0x45911f,_0x4e2d0a['error'][_0xccf3('0x18')]);return _0x398305(_0x4e2d0a[_0xccf3('0x17')][_0xccf3('0x18')]);}logger[_0xccf3('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x45911f,_0x4e2d0a['error']['message']);return _0x255c31(_0x4e2d0a[_0xccf3('0x17')][_0xccf3('0x18')]);}else{logger[_0xccf3('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x45911f,'request\x20sent');_0x255c31(_0x4e2d0a[_0xccf3('0x19')][_0xccf3('0x18')]);}})['catch'](function(_0x1bf4b5){logger[_0xccf3('0x17')](_0xccf3('0x12'),_0x45911f,_0x1bf4b5);_0x398305(_0x1bf4b5);});});}exports[_0xccf3('0x1a')]=function(_0x414786){var _0x1fe20e=this;return new Promise(function(_0x1a3b26,_0x3ae81a){return db['SmsInteraction']['update'](_0x414786['body'],{'raw':_0x414786['options']?_0x414786[_0xccf3('0x1b')][_0xccf3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414786[_0xccf3('0x1b')]?_0x414786[_0xccf3('0x1b')]['where']||null:null,'attributes':_0x414786[_0xccf3('0x1b')]?_0x414786[_0xccf3('0x1b')]['attributes']||null:null,'limit':_0x414786[_0xccf3('0x1b')]?_0x414786[_0xccf3('0x1b')][_0xccf3('0x1d')]||null:null})[_0xccf3('0x10')](function(_0x394906){logger[_0xccf3('0x11')](_0xccf3('0x1a'),_0x414786);logger['debug'](_0xccf3('0x1a'),_0x414786,JSON['stringify'](_0x394906));_0x1a3b26(_0x394906);})[_0xccf3('0x1e')](function(_0x222576){logger[_0xccf3('0x17')](_0xccf3('0x1a'),_0x222576[_0xccf3('0x18')],_0x414786);_0x3ae81a(_0x1fe20e[_0xccf3('0x17')](0x1f4,_0x222576[_0xccf3('0x18')]));});});};exports[_0xccf3('0x1f')]=function(_0x3c6393){return new Promise(function(_0x1b2d62,_0x34b806){return db['SmsInteraction'][_0xccf3('0x20')]({'where':_0x3c6393[_0xccf3('0x1b')]?_0x3c6393[_0xccf3('0x1b')][_0xccf3('0x21')]||null:null})[_0xccf3('0x10')](function(_0x3c729c){if(_0x3c729c){return _0x3c729c['addTags'](_0x3c6393[_0xccf3('0x22')][_0xccf3('0x23')],_[_0xccf3('0x24')](_0x3c6393['body'],[_0xccf3('0x23'),'id'])||{});}})[_0xccf3('0x25')](function(_0x20edf7){logger['info'](_0xccf3('0x26'),_0x3c6393);logger[_0xccf3('0x14')]('AddTags',_0x3c6393,JSON[_0xccf3('0x16')](_0x20edf7));_0x1b2d62(_0x20edf7);})['catch'](function(_0x2a5608){logger['error'](_0xccf3('0x26'),_0x2a5608[_0xccf3('0x18')],_0x3c6393);_0x34b806(_this[_0xccf3('0x17')](0x1f4,_0x2a5608['message']));});});}; \ No newline at end of file +var _0x647e=['AddTagsToSmsInteraction','SmsInteraction','where','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateSmsInteraction','update','options','raw','attributes','limit','catch'];(function(_0x2feea4,_0x4fa64e){var _0x52567d=function(_0x1e0e41){while(--_0x1e0e41){_0x2feea4['push'](_0x2feea4['shift']());}};_0x52567d(++_0x4fa64e);}(_0x647e,0x1ac));var _0xe647=function(_0xfa592a,_0xbf9dd3){_0xfa592a=_0xfa592a-0x0;var _0x1b8740=_0x647e[_0xfa592a];return _0x1b8740;};'use strict';var _=require(_0xe647('0x0'));var util=require(_0xe647('0x1'));var moment=require(_0xe647('0x2'));var BPromise=require(_0xe647('0x3'));var rs=require(_0xe647('0x4'));var fs=require('fs');var Redis=require(_0xe647('0x5'));var db=require(_0xe647('0x6'))['db'];var utils=require(_0xe647('0x7'));var logger=require('../../config/logger')(_0xe647('0x8'));var config=require(_0xe647('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe647('0xa')][_0xe647('0xb')]({'port':0x232a});config[_0xe647('0xc')]=_[_0xe647('0xd')](config['redis'],{'host':_0xe647('0xe'),'port':0x18eb});var socket=require(_0xe647('0xf'))(new Redis(config['redis']));require(_0xe647('0x10'))['register'](socket);function respondWithRpcPromise(_0x556924,_0x3d4275,_0x3947e1){return new BPromise(function(_0x33deb6,_0x1b9f83){return client['request'](_0x556924,_0x3947e1)[_0xe647('0x11')](function(_0xc23097){logger[_0xe647('0x12')](_0xe647('0x13'),_0x3d4275,'request\x20sent');logger[_0xe647('0x14')](_0xe647('0x15'),_0x3d4275,_0xe647('0x16'),JSON[_0xe647('0x17')](_0xc23097));if(_0xc23097[_0xe647('0x18')]){if(_0xc23097['error']['code']===0x1f4){logger[_0xe647('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x3d4275,_0xc23097[_0xe647('0x18')][_0xe647('0x19')]);return _0x1b9f83(_0xc23097['error'][_0xe647('0x19')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x3d4275,_0xc23097[_0xe647('0x18')]['message']);return _0x33deb6(_0xc23097[_0xe647('0x18')]['message']);}else{logger['info'](_0xe647('0x13'),_0x3d4275,_0xe647('0x16'));_0x33deb6(_0xc23097[_0xe647('0x1a')][_0xe647('0x19')]);}})['catch'](function(_0x284a39){logger[_0xe647('0x18')](_0xe647('0x13'),_0x3d4275,_0x284a39);_0x1b9f83(_0x284a39);});});}exports[_0xe647('0x1b')]=function(_0x413c21){var _0x40bcf1=this;return new Promise(function(_0x49b228,_0x6c3010){return db['SmsInteraction'][_0xe647('0x1c')](_0x413c21['body'],{'raw':_0x413c21[_0xe647('0x1d')]?_0x413c21['options'][_0xe647('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x413c21[_0xe647('0x1d')]?_0x413c21[_0xe647('0x1d')]['where']||null:null,'attributes':_0x413c21[_0xe647('0x1d')]?_0x413c21['options'][_0xe647('0x1f')]||null:null,'limit':_0x413c21[_0xe647('0x1d')]?_0x413c21['options'][_0xe647('0x20')]||null:null})[_0xe647('0x11')](function(_0x505cf3){logger[_0xe647('0x12')]('UpdateSmsInteraction',_0x413c21);logger['debug'](_0xe647('0x1b'),_0x413c21,JSON[_0xe647('0x17')](_0x505cf3));_0x49b228(_0x505cf3);})[_0xe647('0x21')](function(_0x360d3e){logger[_0xe647('0x18')](_0xe647('0x1b'),_0x360d3e[_0xe647('0x19')],_0x413c21);_0x6c3010(_0x40bcf1[_0xe647('0x18')](0x1f4,_0x360d3e[_0xe647('0x19')]));});});};exports[_0xe647('0x22')]=function(_0x2781e6){return new Promise(function(_0x41c9cb,_0x36d2c0){return db[_0xe647('0x23')]['find']({'where':_0x2781e6[_0xe647('0x1d')]?_0x2781e6[_0xe647('0x1d')][_0xe647('0x24')]||null:null})[_0xe647('0x11')](function(_0x468d88){if(_0x468d88){return _0x468d88['addTags'](_0x2781e6[_0xe647('0x25')][_0xe647('0x26')],_[_0xe647('0x27')](_0x2781e6[_0xe647('0x25')],[_0xe647('0x26'),'id'])||{});}})[_0xe647('0x28')](function(_0x358c88){logger[_0xe647('0x12')]('AddTags',_0x2781e6);logger[_0xe647('0x14')](_0xe647('0x29'),_0x2781e6,JSON[_0xe647('0x17')](_0x358c88));_0x41c9cb(_0x358c88);})[_0xe647('0x21')](function(_0x3080a5){logger[_0xe647('0x18')](_0xe647('0x29'),_0x3080a5['message'],_0x2781e6);_0x36d2c0(_this[_0xe647('0x18')](0x1f4,_0x3080a5[_0xe647('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 34cba64..dc95b08 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 _0x8f18=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','register'];(function(_0x4e2861,_0x199be0){var _0x2265e3=function(_0x469693){while(--_0x469693){_0x4e2861['push'](_0x4e2861['shift']());}};_0x2265e3(++_0x199be0);}(_0x8f18,0x143));var _0x88f1=function(_0x4e4a0a,_0x15d7f5){_0x4e4a0a=_0x4e4a0a-0x0;var _0x4f2b82=_0x8f18[_0x4e4a0a];return _0x4f2b82;};'use strict';var SmsInteractionEvents=require(_0x88f1('0x0'));var events=[_0x88f1('0x1'),_0x88f1('0x2'),_0x88f1('0x3')];function createListener(_0x211fa0,_0x1cf4a0){return function(_0x4283cb){_0x1cf4a0[_0x88f1('0x4')](_0x211fa0,_0x4283cb);};}function removeListener(_0x3be90a,_0x35649e){return function(){SmsInteractionEvents['removeListener'](_0x3be90a,_0x35649e);};}exports[_0x88f1('0x5')]=function(_0x5cb630){for(var _0x11733d=0x0,_0x59a33f=events['length'];_0x11733d<_0x59a33f;_0x11733d++){var _0xfbd1e3=events[_0x11733d];var _0x48d005=createListener(_0x88f1('0x6')+_0xfbd1e3,_0x5cb630);SmsInteractionEvents['on'](_0xfbd1e3,_0x48d005);}}; \ No newline at end of file +var _0x2a28=['removeListener','length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x1c529a,_0x4bbb35){var _0x83bd43=function(_0x39d112){while(--_0x39d112){_0x1c529a['push'](_0x1c529a['shift']());}};_0x83bd43(++_0x4bbb35);}(_0x2a28,0x11b));var _0x82a2=function(_0x44a21c,_0x46e366){_0x44a21c=_0x44a21c-0x0;var _0x45fc82=_0x2a28[_0x44a21c];return _0x45fc82;};'use strict';var SmsInteractionEvents=require(_0x82a2('0x0'));var events=[_0x82a2('0x1'),_0x82a2('0x2'),_0x82a2('0x3')];function createListener(_0x3d66f5,_0x4cfaaf){return function(_0x34ebbb){_0x4cfaaf[_0x82a2('0x4')](_0x3d66f5,_0x34ebbb);};}function removeListener(_0x48c249,_0x16a1b3){return function(){SmsInteractionEvents[_0x82a2('0x5')](_0x48c249,_0x16a1b3);};}exports['register']=function(_0x4df082){for(var _0x204296=0x0,_0x3b61c4=events[_0x82a2('0x6')];_0x204296<_0x3b61c4;_0x204296++){var _0x2901cf=events[_0x204296];var _0x15fe42=createListener(_0x82a2('0x7')+_0x2901cf,_0x4df082);SmsInteractionEvents['on'](_0x2901cf,_0x15fe42);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6ac167b..24d94ee 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 _0x2f68=['post','sms','status','put','accept','/:id/reject','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','show'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2f68,0x12b));var _0x82f6=function(_0x2c70d3,_0x10d931){_0x2c70d3=_0x2c70d3-0x0;var _0x2eea4c=_0x2f68[_0x2c70d3];return _0x2eea4c;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express[_0x82f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x82f6('0x5'));var interaction=require(_0x82f6('0x6'));var config=require(_0x82f6('0x7'));var controller=require(_0x82f6('0x8'));router[_0x82f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x82f6('0x9')]('/describe',auth[_0x82f6('0xa')](),controller[_0x82f6('0xb')]);router[_0x82f6('0x9')]('/:id',auth[_0x82f6('0xa')](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0xa')](),interaction['tracked'](_0x82f6('0xe'),'smsmessage:create'),controller['create']);router[_0x82f6('0xd')]('/:id/status',controller[_0x82f6('0xf')]);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0xa')](),controller['update']);router[_0x82f6('0x10')]('/:id/accept',auth['isAuthenticated'](),controller[_0x82f6('0x11')]);router[_0x82f6('0x10')](_0x82f6('0x12'),auth[_0x82f6('0xa')](),controller[_0x82f6('0x13')]);router[_0x82f6('0x14')](_0x82f6('0x15'),auth[_0x82f6('0xa')](),controller[_0x82f6('0x16')]);module[_0x82f6('0x17')]=router; \ No newline at end of file +var _0x1a81=['tracked','sms','smsmessage:create','create','post','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x283cfc,_0x1c94bf){var _0x1e8104=function(_0x1f0f2c){while(--_0x1f0f2c){_0x283cfc['push'](_0x283cfc['shift']());}};_0x1e8104(++_0x1c94bf);}(_0x1a81,0x19b));var _0x11a8=function(_0x3d28a2,_0x3005f3){_0x3d28a2=_0x3d28a2-0x0;var _0x3ec179=_0x1a81[_0x3d28a2];return _0x3ec179;};'use strict';var multer=require(_0x11a8('0x0'));var util=require(_0x11a8('0x1'));var path=require(_0x11a8('0x2'));var timeout=require(_0x11a8('0x3'));var express=require(_0x11a8('0x4'));var router=express[_0x11a8('0x5')]();var fs_extra=require(_0x11a8('0x6'));var auth=require(_0x11a8('0x7'));var interaction=require(_0x11a8('0x8'));var config=require(_0x11a8('0x9'));var controller=require(_0x11a8('0xa'));router[_0x11a8('0xb')]('/',auth[_0x11a8('0xc')](),controller[_0x11a8('0xd')]);router[_0x11a8('0xb')](_0x11a8('0xe'),auth['isAuthenticated'](),controller[_0x11a8('0xf')]);router['get'](_0x11a8('0x10'),auth[_0x11a8('0xc')](),controller[_0x11a8('0x11')]);router['post']('/',auth[_0x11a8('0xc')](),interaction[_0x11a8('0x12')](_0x11a8('0x13'),_0x11a8('0x14')),controller[_0x11a8('0x15')]);router[_0x11a8('0x16')](_0x11a8('0x17'),controller[_0x11a8('0x18')]);router['put'](_0x11a8('0x10'),auth['isAuthenticated'](),controller[_0x11a8('0x19')]);router[_0x11a8('0x1a')](_0x11a8('0x1b'),auth[_0x11a8('0xc')](),controller[_0x11a8('0x1c')]);router[_0x11a8('0x1a')](_0x11a8('0x1d'),auth[_0x11a8('0xc')](),controller['reject']);router[_0x11a8('0x1e')](_0x11a8('0x10'),auth[_0x11a8('0xc')](),controller[_0x11a8('0x1f')]);module[_0x11a8('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 73bb63e..c92cc8f 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 _0x4491=['TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x4491,0x1bb));var _0x1449=function(_0x30f57a,_0x2a84d2){_0x30f57a=_0x30f57a-0x0;var _0x6de3e8=_0x4491[_0x30f57a];return _0x6de3e8;};'use strict';var Sequelize=require(_0x1449('0x0'));module['exports']={'body':{'type':Sequelize[_0x1449('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1449('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1449('0x3')]('in',_0x1449('0x4')),'defaultValue':_0x1449('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1449('0x5')](0xbe)},'phone':{'type':Sequelize[_0x1449('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1449('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1449('0x1')]}}; \ No newline at end of file +var _0x229a=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3041ad,_0x2bf8e4){var _0x25230a=function(_0x1029c0){while(--_0x1029c0){_0x3041ad['push'](_0x3041ad['shift']());}};_0x25230a(++_0x2bf8e4);}(_0x229a,0x1ea));var _0xa229=function(_0x45725b,_0x6f132e){_0x45725b=_0x45725b-0x0;var _0x2f65a0=_0x229a[_0x45725b];return _0x2f65a0;};'use strict';var Sequelize=require(_0xa229('0x0'));module[_0xa229('0x1')]={'body':{'type':Sequelize[_0xa229('0x2')](_0xa229('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa229('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa229('0x5')]('in',_0xa229('0x6')),'defaultValue':_0xa229('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa229('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa229('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa229('0x7')]},'providerResponse':{'type':Sequelize[_0xa229('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index ff81d2b..d381a7f 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 _0xdf55=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','then','info','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','SmsMessage','includeAll','include','rows','catch','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','infobip','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdf55,0x83));var _0x5df5=function(_0x3ccac1,_0x5cc7ea){_0x3ccac1=_0x3ccac1-0x0;var _0x10b20b=_0xdf55[_0x3ccac1];return _0x10b20b;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];config[_0x5df5('0x17')]=_[_0x5df5('0x18')](config[_0x5df5('0x17')],{'host':_0x5df5('0x19'),'port':0x18eb});var socket=require(_0x5df5('0x1a'))(new Redis(config[_0x5df5('0x17')]));require(_0x5df5('0x1b'))['register'](socket);var jayson=require(_0x5df5('0x1c'));var client=jayson['client'][_0x5df5('0x1d')]({'port':0x232c});var client9002=jayson[_0x5df5('0x1e')][_0x5df5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3657c8,_0x282d53,_0x4e74c4,_0x27b3fb){return new BPromise(function(_0x457205,_0x591a19){var _0x9a52c9=_0x27b3fb||client;return _0x9a52c9[_0x5df5('0x1f')](_0x3657c8,_0x4e74c4)[_0x5df5('0x20')](function(_0x44f700){logger[_0x5df5('0x21')]('SmsMessage,\x20%s,\x20%s',_0x282d53,'request\x20sent');logger[_0x5df5('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x282d53,_0x5df5('0x23'),JSON[_0x5df5('0x24')](_0x44f700));if(_0x44f700[_0x5df5('0x25')]){if(_0x44f700[_0x5df5('0x25')][_0x5df5('0x26')]===0x1f4){logger['error'](_0x5df5('0x27'),_0x282d53,_0x44f700[_0x5df5('0x25')][_0x5df5('0x28')]);return _0x591a19(_0x44f700[_0x5df5('0x25')][_0x5df5('0x28')]);}logger[_0x5df5('0x25')]('SmsMessage,\x20%s,\x20%s',_0x282d53,_0x44f700[_0x5df5('0x25')][_0x5df5('0x28')]);return _0x457205(_0x44f700[_0x5df5('0x25')][_0x5df5('0x28')]);}else{logger['info'](_0x5df5('0x27'),_0x282d53,_0x5df5('0x23'));_0x457205(_0x44f700[_0x5df5('0x29')]['message']);}})['catch'](function(_0x532923){logger[_0x5df5('0x25')](_0x5df5('0x27'),_0x282d53,_0x532923);_0x591a19(_0x532923);});});}function respondWithStatusCode(_0x4292a0,_0xa7f4b3){_0xa7f4b3=_0xa7f4b3||0xcc;return function(_0x1baf52){if(_0x1baf52){return _0x4292a0[_0x5df5('0x2a')](_0xa7f4b3);}return _0x4292a0[_0x5df5('0x2b')](_0xa7f4b3)[_0x5df5('0x2c')]();};}function respondWithResult(_0x52fbe3,_0x18bb61){_0x18bb61=_0x18bb61||0xc8;return function(_0x4fc1a1){if(_0x4fc1a1){return _0x52fbe3[_0x5df5('0x2b')](_0x18bb61)[_0x5df5('0x2d')](_0x4fc1a1);}};}function respondWithFilteredResult(_0x5bc181,_0x3854d0){return function(_0x4945c6){if(_0x4945c6){var _0xd2b213=typeof _0x3854d0['offset']===_0x5df5('0x2e')&&typeof _0x3854d0['limit']===_0x5df5('0x2e');var _0x5793f5=_0x4945c6[_0x5df5('0x2f')];var _0x47bebb=_0xd2b213?0x0:_0x3854d0[_0x5df5('0x30')];var _0x485484=_0xd2b213?_0x4945c6[_0x5df5('0x2f')]:_0x3854d0[_0x5df5('0x30')]+_0x3854d0[_0x5df5('0x31')];var _0x2d53e5;if(_0x485484>=_0x5793f5){_0x485484=_0x5793f5;_0x2d53e5=0xc8;}else{_0x2d53e5=0xce;}_0x5bc181[_0x5df5('0x2b')](_0x2d53e5);return _0x5bc181[_0x5df5('0x32')](_0x5df5('0x33'),_0x47bebb+'-'+_0x485484+'/'+_0x5793f5)['json'](_0x4945c6);}return null;};}function patchUpdates(_0x4965a0){return function(_0x3275e9){try{jsonpatch[_0x5df5('0x34')](_0x3275e9,_0x4965a0,!![]);}catch(_0x3bbd2b){return BPromise[_0x5df5('0x35')](_0x3bbd2b);}return _0x3275e9[_0x5df5('0x36')]();};}function saveUpdates(_0x2decd5,_0x4989a4){return function(_0x14218e){if(_0x14218e){return _0x14218e[_0x5df5('0x37')](_0x2decd5)[_0x5df5('0x20')](function(_0x3a6b75){return _0x3a6b75;});}return null;};}function removeEntity(_0x5e8d50,_0x14ee6b){return function(_0x4e7561){if(_0x4e7561){return _0x4e7561[_0x5df5('0x38')]()[_0x5df5('0x20')](function(){_0x5e8d50['status'](0xcc)[_0x5df5('0x2c')]();});}};}function handleEntityNotFound(_0x59e9d6,_0x151e4c){return function(_0x44a6d9){if(!_0x44a6d9){_0x59e9d6[_0x5df5('0x2a')](0x194);}return _0x44a6d9;};}function handleError(_0x120eaf,_0x54e822){_0x54e822=_0x54e822||0x1f4;return function(_0x1d8e49){logger[_0x5df5('0x25')](_0x1d8e49[_0x5df5('0x39')]);if(_0x1d8e49[_0x5df5('0x3a')]){delete _0x1d8e49['name'];}_0x120eaf[_0x5df5('0x2b')](_0x54e822)[_0x5df5('0x3b')](_0x1d8e49);};}exports[_0x5df5('0x3c')]=function(_0x18b597,_0x46c501){var _0x47f34f={},_0x25c8b3={},_0x560422={'count':0x0,'rows':[]};var _0x33da21=_[_0x5df5('0x3d')](db['SmsMessage'][_0x5df5('0x3e')],function(_0x217844){return{'name':_0x217844['fieldName'],'type':_0x217844[_0x5df5('0x3f')][_0x5df5('0x40')]};});_0x25c8b3[_0x5df5('0x41')]=_[_0x5df5('0x3d')](_0x33da21,_0x5df5('0x3a'));_0x25c8b3[_0x5df5('0x42')]=_[_0x5df5('0x43')](_0x18b597[_0x5df5('0x42')]);_0x25c8b3['filters']=_['intersection'](_0x25c8b3[_0x5df5('0x41')],_0x25c8b3['query']);_0x47f34f[_0x5df5('0x44')]=_[_0x5df5('0x45')](_0x25c8b3['model'],qs[_0x5df5('0x46')](_0x18b597[_0x5df5('0x42')][_0x5df5('0x46')]));_0x47f34f[_0x5df5('0x44')]=_0x47f34f[_0x5df5('0x44')][_0x5df5('0x47')]?_0x47f34f[_0x5df5('0x44')]:_0x25c8b3[_0x5df5('0x41')];if(!_0x18b597['query'][_0x5df5('0x48')]('nolimit')){_0x47f34f[_0x5df5('0x31')]=qs[_0x5df5('0x31')](_0x18b597[_0x5df5('0x42')][_0x5df5('0x31')]);_0x47f34f[_0x5df5('0x30')]=qs['offset'](_0x18b597[_0x5df5('0x42')][_0x5df5('0x30')]);}_0x47f34f[_0x5df5('0x49')]=qs['sort'](_0x18b597[_0x5df5('0x42')][_0x5df5('0x4a')]);_0x47f34f['where']=qs[_0x5df5('0x4b')](_[_0x5df5('0x4c')](_0x18b597[_0x5df5('0x42')],_0x25c8b3[_0x5df5('0x4b')]),_0x33da21);if(_0x18b597['query'][_0x5df5('0x4d')]){_0x47f34f[_0x5df5('0x4e')]=_['merge'](_0x47f34f[_0x5df5('0x4e')],{'$or':_[_0x5df5('0x3d')](_0x33da21,function(_0x35927b){if(_0x35927b['type']!==_0x5df5('0x4f')){var _0x3842d0={};_0x3842d0[_0x35927b[_0x5df5('0x3a')]]={'$like':'%'+_0x18b597[_0x5df5('0x42')]['filter']+'%'};return _0x3842d0;}})});}_0x47f34f=_[_0x5df5('0x50')]({},_0x47f34f,_0x18b597[_0x5df5('0x51')]);var _0x2eb30e={'where':_0x47f34f[_0x5df5('0x4e')]};return db[_0x5df5('0x52')]['count'](_0x2eb30e)['then'](function(_0x9e2e75){_0x560422['count']=_0x9e2e75;if(_0x18b597[_0x5df5('0x42')][_0x5df5('0x53')]){_0x47f34f[_0x5df5('0x54')]=[{'all':!![]}];}return db[_0x5df5('0x52')]['findAll'](_0x47f34f);})[_0x5df5('0x20')](function(_0x31483f){_0x560422[_0x5df5('0x55')]=_0x31483f;return _0x560422;})[_0x5df5('0x20')](respondWithFilteredResult(_0x46c501,_0x47f34f))[_0x5df5('0x56')](handleError(_0x46c501,null));};exports[_0x5df5('0x57')]=function(_0x5ad720,_0x1bf1e2){var _0x51fd67={'raw':!![],'where':{'id':_0x5ad720[_0x5df5('0x58')]['id']}},_0x279f6b={};_0x279f6b[_0x5df5('0x41')]=_['keys'](db[_0x5df5('0x52')]['rawAttributes']);_0x279f6b[_0x5df5('0x42')]=_['keys'](_0x5ad720[_0x5df5('0x42')]);_0x279f6b[_0x5df5('0x4b')]=_[_0x5df5('0x45')](_0x279f6b['model'],_0x279f6b[_0x5df5('0x42')]);_0x51fd67[_0x5df5('0x44')]=_['intersection'](_0x279f6b[_0x5df5('0x41')],qs[_0x5df5('0x46')](_0x5ad720[_0x5df5('0x42')][_0x5df5('0x46')]));_0x51fd67[_0x5df5('0x44')]=_0x51fd67[_0x5df5('0x44')][_0x5df5('0x47')]?_0x51fd67['attributes']:_0x279f6b[_0x5df5('0x41')];if(_0x5ad720['query'][_0x5df5('0x53')]){_0x51fd67[_0x5df5('0x54')]=[{'all':!![]}];}_0x51fd67=_[_0x5df5('0x50')]({},_0x51fd67,_0x5ad720[_0x5df5('0x51')]);return db[_0x5df5('0x52')][_0x5df5('0x59')](_0x51fd67)[_0x5df5('0x20')](handleEntityNotFound(_0x1bf1e2,null))[_0x5df5('0x20')](respondWithResult(_0x1bf1e2,null))['catch'](handleError(_0x1bf1e2,null));};exports[_0x5df5('0x5a')]=function(_0xdfd74,_0x151af5){return db[_0x5df5('0x52')][_0x5df5('0x5a')](_0xdfd74['body'],{})[_0x5df5('0x20')](respondWithResult(_0x151af5,0xc9))['catch'](handleError(_0x151af5,null));};exports['update']=function(_0x3c05b2,_0x3c7d5e){if(_0x3c05b2[_0x5df5('0x5b')]['id']){delete _0x3c05b2[_0x5df5('0x5b')]['id'];}return db[_0x5df5('0x52')][_0x5df5('0x59')]({'where':{'id':_0x3c05b2['params']['id']}})[_0x5df5('0x20')](handleEntityNotFound(_0x3c7d5e,null))[_0x5df5('0x20')](saveUpdates(_0x3c05b2['body'],null))['then'](respondWithResult(_0x3c7d5e,null))[_0x5df5('0x56')](handleError(_0x3c7d5e,null));};exports[_0x5df5('0x38')]=function(_0x9a168c,_0x4672c5){return db[_0x5df5('0x52')][_0x5df5('0x59')]({'where':{'id':_0x9a168c['params']['id']}})['then'](handleEntityNotFound(_0x4672c5,null))['then'](removeEntity(_0x4672c5,null))[_0x5df5('0x56')](handleError(_0x4672c5,null));};exports[_0x5df5('0x5c')]=function(_0x57e3ea,_0x42288c){return db[_0x5df5('0x52')][_0x5df5('0x5c')]()[_0x5df5('0x20')](respondWithResult(_0x42288c,null))[_0x5df5('0x56')](handleError(_0x42288c,null));};var interaction_log=require(_0x5df5('0x13'))(_0x5df5('0x5d'));exports[_0x5df5('0x5e')]=function(_0x463268,_0x59ecf7,_0x302792){var _0x10286e={'agent':{},'channel':_0x5df5('0x5f')};if(_0x463268[_0x5df5('0x5b')]['id']){delete _0x463268[_0x5df5('0x5b')]['id'];}_0x463268[_0x5df5('0x5b')][_0x5df5('0x60')]=!![];_0x463268[_0x5df5('0x5b')][_0x5df5('0x61')]=moment()[_0x5df5('0x62')](_0x5df5('0x63'));_0x463268[_0x5df5('0x5b')]['UserId']=_0x463268[_0x5df5('0x5b')][_0x5df5('0x64')]||_0x463268['user']['id'];_0x10286e[_0x5df5('0x65')]['id']=_0x463268[_0x5df5('0x5b')][_0x5df5('0x64')];return db[_0x5df5('0x52')]['find']({'where':{'id':_0x463268[_0x5df5('0x58')]['id'],'UserId':null}})[_0x5df5('0x20')](handleEntityNotFound(_0x59ecf7,null))['then'](saveUpdates(_0x463268['body'],null))[_0x5df5('0x20')](function(_0x21b665){if(_0x21b665){_0x10286e[_0x5df5('0x28')]=_0x21b665['get']({'plain':!![]});return db['SmsInteraction'][_0x5df5('0x59')]({'where':{'id':_0x21b665[_0x5df5('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x59ecf7,null))[_0x5df5('0x20')](function(_0x1b3785){if(_0x1b3785){return _0x1b3785[_0x5df5('0x37')]({'UserId':_0x463268[_0x5df5('0x5b')][_0x5df5('0x64')],'read1stAt':_['isNil'](_0x1b3785[_0x5df5('0x67')])?moment()[_0x5df5('0x62')](_0x5df5('0x63')):undefined});}return null;})[_0x5df5('0x20')](function(_0x4e6e48){if(_0x4e6e48){_0x10286e[_0x5df5('0x68')]=_0x4e6e48['get']({'plain':!![]});interaction_log[_0x5df5('0x21')](_0x5df5('0x69'),_0x463268['user']['id'],_0x463268[_0x5df5('0x6a')]['name'],_0x463268[_0x5df5('0x6a')]['role'],_0x10286e[_0x5df5('0x68')]['id'],_0x463268[_0x5df5('0x5b')]?JSON[_0x5df5('0x24')](_0x463268[_0x5df5('0x5b')]):_0x5df5('0x6b'));return respondWithRpcPromise(_0x5df5('0x6c'),'acceptMessage',_0x10286e);}return null;})[_0x5df5('0x20')](function(_0x643ee9){var _0x30a019='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x643ee9[_0x5df5('0x28')][_0x5df5('0x6d')];return db[_0x5df5('0x6e')][_0x5df5('0x42')](_0x30a019,{'type':db[_0x5df5('0x6f')][_0x5df5('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x4160f4){return _0x4160f4;});})[_0x5df5('0x20')](function(_0x3d1df1){if(_0x3d1df1){_0x10286e[_0x5df5('0x28')][_0x5df5('0x71')]=_0x3d1df1[0x0];if(!_0x463268['body'][_0x5df5('0x64')])return;return db[_0x5df5('0x72')][_0x5df5('0x59')]({'where':{'id':_0x463268['body'][_0x5df5('0x64')],'role':_0x5df5('0x65')},'attributes':['id',_0x5df5('0x3a'),_0x5df5('0x73'),_0x5df5('0x74'),_0x5df5('0x75')],'raw':!![]});}return null;})[_0x5df5('0x20')](function(_0xec54b7){if(!_0xec54b7)return null;_0x10286e[_0x5df5('0x28')]['agent']=_0xec54b7;return _0x10286e;})[_0x5df5('0x20')](function(_0xc67e6d){if(_0xc67e6d){if(_0x463268[_0x5df5('0x5b')]['manual']){_0x10286e[_0x5df5('0x28')][_0x5df5('0x76')]=util['format'](_0x5df5('0x77'),_0x463268[_0x5df5('0x6a')][_0x5df5('0x3a')]);_0x10286e['message'][_0x5df5('0x78')]=_0x10286e['channel'];_0x10286e[_0x5df5('0x28')][_0x5df5('0x79')]=_0x10286e[_0x5df5('0x78')];_0x10286e[_0x5df5('0x28')][_0x5df5('0x7a')]=_0x5df5('0x5e');return respondWithRpcPromise('EventManager',_0x5df5('0x7b'),{'event':_0x5df5('0x7c'),'message':_0x10286e['message']},client9002)[_0x5df5('0x20')](function(){return _0x10286e;});}return _0x10286e;}return null;})['then'](respondWithResult(_0x59ecf7,null))['catch'](handleError(_0x59ecf7,null));};var interaction_log=require(_0x5df5('0x13'))('sms-interactions');exports[_0x5df5('0x35')]=function(_0x19c839,_0x311dc0,_0x1f3f81){var _0x453238={'agent':{},'channel':_0x5df5('0x5f')};if(_0x19c839['body']['id']){delete _0x19c839[_0x5df5('0x5b')]['id'];}_0x19c839[_0x5df5('0x5b')][_0x5df5('0x64')]=_0x19c839['body'][_0x5df5('0x64')]||_0x19c839[_0x5df5('0x6a')]['id'];_0x453238['agent']['id']=_0x19c839[_0x5df5('0x5b')][_0x5df5('0x64')];return db[_0x5df5('0x52')][_0x5df5('0x59')]({'where':{'id':_0x19c839[_0x5df5('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x311dc0,null))[_0x5df5('0x20')](function(_0x563f22){if(_0x563f22){_0x453238[_0x5df5('0x28')]=_0x563f22['get']({'plain':!![]});return db[_0x5df5('0x7d')][_0x5df5('0x59')]({'where':{'id':_0x563f22[_0x5df5('0x66')]}});}return null;})[_0x5df5('0x20')](handleEntityNotFound(_0x311dc0,null))[_0x5df5('0x20')](function(_0x53ead8){if(_0x53ead8){_0x453238['interaction']=_0x53ead8[_0x5df5('0x7e')]({'plain':!![]});interaction_log[_0x5df5('0x21')](_0x5df5('0x7f'),_0x19c839[_0x5df5('0x6a')]['id'],_0x19c839[_0x5df5('0x6a')]['name'],_0x19c839[_0x5df5('0x6a')][_0x5df5('0x80')],_0x453238[_0x5df5('0x68')]['id'],_0x19c839[_0x5df5('0x5b')]?JSON[_0x5df5('0x24')](_0x19c839[_0x5df5('0x5b')]):_0x5df5('0x6b'));return respondWithRpcPromise(_0x5df5('0x81'),_0x5df5('0x82'),_0x453238);}return null;})[_0x5df5('0x20')](function(_0x1bff6c){var _0x535fee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bff6c['message'][_0x5df5('0x6d')];return db[_0x5df5('0x6e')]['query'](_0x535fee,{'type':db[_0x5df5('0x6f')][_0x5df5('0x70')][_0x5df5('0x83')],'raw':!![]})[_0x5df5('0x20')](function(_0x7a8c7d){return _0x7a8c7d;});})[_0x5df5('0x20')](function(_0x36d8ee){if(_0x36d8ee){_0x453238['message'][_0x5df5('0x71')]=_0x36d8ee[0x0];if(!_0x19c839[_0x5df5('0x5b')][_0x5df5('0x64')])return;return db[_0x5df5('0x72')][_0x5df5('0x59')]({'where':{'id':_0x19c839[_0x5df5('0x5b')][_0x5df5('0x64')],'role':'agent'},'attributes':['id',_0x5df5('0x3a'),_0x5df5('0x73'),_0x5df5('0x74'),_0x5df5('0x75')],'raw':!![]});}return null;})[_0x5df5('0x20')](function(_0x41110a){if(!_0x41110a)return null;_0x453238[_0x5df5('0x28')][_0x5df5('0x65')]=_0x41110a;return _0x453238;})['then'](function(_0x4594d2){if(_0x4594d2){_0x4594d2[_0x5df5('0x28')]['interface']=util[_0x5df5('0x62')](_0x5df5('0x77'),_0x19c839[_0x5df5('0x6a')][_0x5df5('0x3a')]);_0x4594d2[_0x5df5('0x28')]['channel']=_0x453238[_0x5df5('0x78')];_0x4594d2[_0x5df5('0x28')][_0x5df5('0x79')]=_0x453238['channel'];_0x4594d2['message'][_0x5df5('0x7a')]=_0x5df5('0x35');respondWithRpcPromise(_0x5df5('0x7b'),_0x5df5('0x7b'),{'event':_0x5df5('0x84'),'message':_0x4594d2[_0x5df5('0x28')]},client9002);return _0x453238;}return null;})['then'](respondWithResult(_0x311dc0,null))['catch'](handleError(_0x311dc0,null));};exports['status']=function(_0x1aae8d,_0x373de6,_0x314c24){if(_0x1aae8d['body']['id']){delete _0x1aae8d[_0x5df5('0x5b')]['id'];}var _0x5c399e;return db[_0x5df5('0x52')][_0x5df5('0x59')]({'where':{'id':_0x1aae8d['params']['id']}})[_0x5df5('0x20')](handleEntityNotFound(_0x373de6,null))[_0x5df5('0x20')](function(_0x5e4192){if(_0x5e4192){_0x5c399e=_0x5e4192;return db[_0x5df5('0x85')][_0x5df5('0x59')]({'where':{'id':_0x5e4192[_0x5df5('0x86')]}});}})[_0x5df5('0x20')](handleEntityNotFound(_0x373de6,null))['then'](function(_0x553507){if(_0x553507){logger[_0x5df5('0x22')](_0x5df5('0x87'),_0x5df5('0x2b'),'received\x20delivery\x20report\x20from',_0x553507[_0x5df5('0x3f')],util[_0x5df5('0x88')](_0x1aae8d[_0x5df5('0x5b')],{'showHidden':![],'depth':null}));switch(_0x553507[_0x5df5('0x3f')]){case _0x5df5('0x89'):if(_0x1aae8d['body'][_0x5df5('0x8a')]&&_0x1aae8d[_0x5df5('0x5b')][_0x5df5('0x8a')]===_0x5c399e[_0x5df5('0x8b')]){return _0x5c399e[_0x5df5('0x37')]({'read':!![]});}else{logger[_0x5df5('0x25')](_0x5df5('0x8c'),_0x5df5('0x2b'),_0x5df5('0x89'),util[_0x5df5('0x88')](_0x1aae8d['body'],{'showHidden':![],'depth':null}));}break;case _0x5df5('0x8d'):if(_0x1aae8d[_0x5df5('0x5b')]['MessageUUID']&&_0x1aae8d[_0x5df5('0x5b')][_0x5df5('0x8e')]===_0x5c399e['messageId']&&_[_0x5df5('0x8f')]([_0x5df5('0x90'),_0x5df5('0x91')],_0x1aae8d[_0x5df5('0x5b')]['Status'])>=0x0){return _0x5c399e[_0x5df5('0x37')]({'read':!![]});}else{logger[_0x5df5('0x25')](_0x5df5('0x8c'),_0x5df5('0x2b'),'plivio',util[_0x5df5('0x88')](_0x1aae8d[_0x5df5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5df5('0x92'):var _0x13dd4d=_0x1aae8d[_0x5df5('0x5b')]['results'][0x0];if(_0x13dd4d[_0x5df5('0x2b')][_0x5df5('0x93')]===_0x5df5('0x94')){return _0x5c399e[_0x5df5('0x37')]({'read':!![]});}else{logger[_0x5df5('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5df5('0x2b'),_0x5df5('0x92'),util[_0x5df5('0x88')](_0x1aae8d['body'],{'showHidden':![],'depth':null}));}break;}return _0x5c399e;}})['then'](respondWithResult(_0x373de6,null))[_0x5df5('0x56')](handleError(_0x373de6,null));}; \ No newline at end of file +var _0x3bf0=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','http','client','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','fieldName','type','key','keys','query','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','SmsMessage','include','rows','show','rawAttributes','length','includeAll','create','body','params','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','motionChannel','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3bf0,0x83));var _0x03bf=function(_0x42fefc,_0x11ee7d){_0x42fefc=_0x42fefc-0x0;var _0x2345da=_0x3bf0[_0x42fefc];return _0x2345da;};'use strict';var emlformat=require(_0x03bf('0x0'));var rimraf=require(_0x03bf('0x1'));var zipdir=require(_0x03bf('0x2'));var jsonpatch=require(_0x03bf('0x3'));var rp=require(_0x03bf('0x4'));var moment=require(_0x03bf('0x5'));var BPromise=require(_0x03bf('0x6'));var Mustache=require('mustache');var util=require(_0x03bf('0x7'));var path=require(_0x03bf('0x8'));var sox=require(_0x03bf('0x9'));var csv=require(_0x03bf('0xa'));var ejs=require(_0x03bf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03bf('0xc'));var squel=require(_0x03bf('0xd'));var crypto=require('crypto');var jsforce=require(_0x03bf('0xe'));var deskjs=require(_0x03bf('0xf'));var toCsv=require(_0x03bf('0xa'));var querystring=require('querystring');var Papa=require(_0x03bf('0x10'));var Redis=require(_0x03bf('0x11'));var authService=require(_0x03bf('0x12'));var qs=require(_0x03bf('0x13'));var as=require(_0x03bf('0x14'));var hardwareService=require(_0x03bf('0x15'));var logger=require(_0x03bf('0x16'))(_0x03bf('0x17'));var utils=require(_0x03bf('0x18'));var config=require(_0x03bf('0x19'));var licenseUtil=require(_0x03bf('0x1a'));var db=require(_0x03bf('0x1b'))['db'];config[_0x03bf('0x1c')]=_[_0x03bf('0x1d')](config[_0x03bf('0x1c')],{'host':_0x03bf('0x1e'),'port':0x18eb});var socket=require(_0x03bf('0x1f'))(new Redis(config[_0x03bf('0x1c')]));require(_0x03bf('0x20'))[_0x03bf('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x03bf('0x22')]({'port':0x232c});var client9002=jayson[_0x03bf('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c54ab,_0x4b53d3,_0x2a81d2,_0x2b304b){return new BPromise(function(_0x46bc4f,_0x41a390){var _0x1d9005=_0x2b304b||client;return _0x1d9005[_0x03bf('0x24')](_0x1c54ab,_0x2a81d2)['then'](function(_0x37e8fe){logger[_0x03bf('0x25')](_0x03bf('0x26'),_0x4b53d3,_0x03bf('0x27'));logger[_0x03bf('0x28')](_0x03bf('0x29'),_0x4b53d3,_0x03bf('0x27'),JSON[_0x03bf('0x2a')](_0x37e8fe));if(_0x37e8fe[_0x03bf('0x2b')]){if(_0x37e8fe[_0x03bf('0x2b')][_0x03bf('0x2c')]===0x1f4){logger[_0x03bf('0x2b')](_0x03bf('0x26'),_0x4b53d3,_0x37e8fe[_0x03bf('0x2b')]['message']);return _0x41a390(_0x37e8fe[_0x03bf('0x2b')][_0x03bf('0x2d')]);}logger['error'](_0x03bf('0x26'),_0x4b53d3,_0x37e8fe[_0x03bf('0x2b')][_0x03bf('0x2d')]);return _0x46bc4f(_0x37e8fe[_0x03bf('0x2b')][_0x03bf('0x2d')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4b53d3,_0x03bf('0x27'));_0x46bc4f(_0x37e8fe[_0x03bf('0x2e')][_0x03bf('0x2d')]);}})[_0x03bf('0x2f')](function(_0x16c0ab){logger['error'](_0x03bf('0x26'),_0x4b53d3,_0x16c0ab);_0x41a390(_0x16c0ab);});});}function respondWithStatusCode(_0x50d1a7,_0x2286d8){_0x2286d8=_0x2286d8||0xcc;return function(_0x4dc7e6){if(_0x4dc7e6){return _0x50d1a7[_0x03bf('0x30')](_0x2286d8);}return _0x50d1a7[_0x03bf('0x31')](_0x2286d8)['end']();};}function respondWithResult(_0x1ba789,_0x35653a){_0x35653a=_0x35653a||0xc8;return function(_0x1eb982){if(_0x1eb982){return _0x1ba789['status'](_0x35653a)[_0x03bf('0x32')](_0x1eb982);}};}function respondWithFilteredResult(_0x45a5df,_0x12e554){return function(_0x20e9ba){if(_0x20e9ba){var _0x3b9187=typeof _0x12e554['offset']===_0x03bf('0x33')&&typeof _0x12e554['limit']===_0x03bf('0x33');var _0x498cfd=_0x20e9ba[_0x03bf('0x34')];var _0x1f7595=_0x3b9187?0x0:_0x12e554[_0x03bf('0x35')];var _0x2e7ca6=_0x3b9187?_0x20e9ba[_0x03bf('0x34')]:_0x12e554[_0x03bf('0x35')]+_0x12e554[_0x03bf('0x36')];var _0x4d402f;if(_0x2e7ca6>=_0x498cfd){_0x2e7ca6=_0x498cfd;_0x4d402f=0xc8;}else{_0x4d402f=0xce;}_0x45a5df[_0x03bf('0x31')](_0x4d402f);return _0x45a5df[_0x03bf('0x37')](_0x03bf('0x38'),_0x1f7595+'-'+_0x2e7ca6+'/'+_0x498cfd)['json'](_0x20e9ba);}return null;};}function patchUpdates(_0x3bb8c0){return function(_0x352ac4){try{jsonpatch['apply'](_0x352ac4,_0x3bb8c0,!![]);}catch(_0x1a1f34){return BPromise[_0x03bf('0x39')](_0x1a1f34);}return _0x352ac4['save']();};}function saveUpdates(_0x4a9466,_0x2b0db7){return function(_0x215a36){if(_0x215a36){return _0x215a36[_0x03bf('0x3a')](_0x4a9466)[_0x03bf('0x3b')](function(_0x3c07fb){return _0x3c07fb;});}return null;};}function removeEntity(_0x4c4e0a,_0x3beb7a){return function(_0x1b0eed){if(_0x1b0eed){return _0x1b0eed[_0x03bf('0x3c')]()['then'](function(){_0x4c4e0a[_0x03bf('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139762,_0x3a7603){return function(_0x5b4e42){if(!_0x5b4e42){_0x139762[_0x03bf('0x30')](0x194);}return _0x5b4e42;};}function handleError(_0x46b78c,_0x2a3bad){_0x2a3bad=_0x2a3bad||0x1f4;return function(_0x53e729){logger[_0x03bf('0x2b')](_0x53e729[_0x03bf('0x3d')]);if(_0x53e729[_0x03bf('0x3e')]){delete _0x53e729[_0x03bf('0x3e')];}_0x46b78c['status'](_0x2a3bad)[_0x03bf('0x3f')](_0x53e729);};}exports[_0x03bf('0x40')]=function(_0x52432a,_0x2a891e){var _0x2f6e61={},_0x329ab7={},_0x3cfb71={'count':0x0,'rows':[]};var _0x5237ee=_[_0x03bf('0x41')](db['SmsMessage']['rawAttributes'],function(_0x10e266){return{'name':_0x10e266[_0x03bf('0x42')],'type':_0x10e266[_0x03bf('0x43')][_0x03bf('0x44')]};});_0x329ab7['model']=_[_0x03bf('0x41')](_0x5237ee,_0x03bf('0x3e'));_0x329ab7['query']=_[_0x03bf('0x45')](_0x52432a[_0x03bf('0x46')]);_0x329ab7['filters']=_['intersection'](_0x329ab7[_0x03bf('0x47')],_0x329ab7[_0x03bf('0x46')]);_0x2f6e61[_0x03bf('0x48')]=_[_0x03bf('0x49')](_0x329ab7[_0x03bf('0x47')],qs[_0x03bf('0x4a')](_0x52432a[_0x03bf('0x46')]['fields']));_0x2f6e61['attributes']=_0x2f6e61[_0x03bf('0x48')]['length']?_0x2f6e61[_0x03bf('0x48')]:_0x329ab7[_0x03bf('0x47')];if(!_0x52432a[_0x03bf('0x46')]['hasOwnProperty'](_0x03bf('0x4b'))){_0x2f6e61[_0x03bf('0x36')]=qs[_0x03bf('0x36')](_0x52432a['query'][_0x03bf('0x36')]);_0x2f6e61['offset']=qs[_0x03bf('0x35')](_0x52432a[_0x03bf('0x46')][_0x03bf('0x35')]);}_0x2f6e61[_0x03bf('0x4c')]=qs[_0x03bf('0x4d')](_0x52432a['query'][_0x03bf('0x4d')]);_0x2f6e61[_0x03bf('0x4e')]=qs['filters'](_[_0x03bf('0x4f')](_0x52432a[_0x03bf('0x46')],_0x329ab7[_0x03bf('0x50')]),_0x5237ee);if(_0x52432a[_0x03bf('0x46')]['filter']){_0x2f6e61[_0x03bf('0x4e')]=_[_0x03bf('0x51')](_0x2f6e61[_0x03bf('0x4e')],{'$or':_[_0x03bf('0x41')](_0x5237ee,function(_0x614ada){if(_0x614ada[_0x03bf('0x43')]!==_0x03bf('0x52')){var _0x59e557={};_0x59e557[_0x614ada[_0x03bf('0x3e')]]={'$like':'%'+_0x52432a[_0x03bf('0x46')][_0x03bf('0x53')]+'%'};return _0x59e557;}})});}_0x2f6e61=_[_0x03bf('0x51')]({},_0x2f6e61,_0x52432a[_0x03bf('0x54')]);var _0x59c3d9={'where':_0x2f6e61[_0x03bf('0x4e')]};return db[_0x03bf('0x55')][_0x03bf('0x34')](_0x59c3d9)[_0x03bf('0x3b')](function(_0x5dcb68){_0x3cfb71['count']=_0x5dcb68;if(_0x52432a[_0x03bf('0x46')]['includeAll']){_0x2f6e61[_0x03bf('0x56')]=[{'all':!![]}];}return db[_0x03bf('0x55')]['findAll'](_0x2f6e61);})[_0x03bf('0x3b')](function(_0xfc1770){_0x3cfb71[_0x03bf('0x57')]=_0xfc1770;return _0x3cfb71;})[_0x03bf('0x3b')](respondWithFilteredResult(_0x2a891e,_0x2f6e61))[_0x03bf('0x2f')](handleError(_0x2a891e,null));};exports[_0x03bf('0x58')]=function(_0x2490a1,_0x1bad4a){var _0x328d2a={'raw':!![],'where':{'id':_0x2490a1['params']['id']}},_0x13ea6e={};_0x13ea6e['model']=_['keys'](db[_0x03bf('0x55')][_0x03bf('0x59')]);_0x13ea6e[_0x03bf('0x46')]=_['keys'](_0x2490a1[_0x03bf('0x46')]);_0x13ea6e['filters']=_[_0x03bf('0x49')](_0x13ea6e['model'],_0x13ea6e['query']);_0x328d2a['attributes']=_[_0x03bf('0x49')](_0x13ea6e[_0x03bf('0x47')],qs[_0x03bf('0x4a')](_0x2490a1['query'][_0x03bf('0x4a')]));_0x328d2a[_0x03bf('0x48')]=_0x328d2a[_0x03bf('0x48')][_0x03bf('0x5a')]?_0x328d2a[_0x03bf('0x48')]:_0x13ea6e['model'];if(_0x2490a1[_0x03bf('0x46')][_0x03bf('0x5b')]){_0x328d2a[_0x03bf('0x56')]=[{'all':!![]}];}_0x328d2a=_['merge']({},_0x328d2a,_0x2490a1[_0x03bf('0x54')]);return db[_0x03bf('0x55')]['find'](_0x328d2a)[_0x03bf('0x3b')](handleEntityNotFound(_0x1bad4a,null))[_0x03bf('0x3b')](respondWithResult(_0x1bad4a,null))['catch'](handleError(_0x1bad4a,null));};exports[_0x03bf('0x5c')]=function(_0x5b74c9,_0x28a8ac){return db[_0x03bf('0x55')][_0x03bf('0x5c')](_0x5b74c9[_0x03bf('0x5d')],{})[_0x03bf('0x3b')](respondWithResult(_0x28a8ac,0xc9))[_0x03bf('0x2f')](handleError(_0x28a8ac,null));};exports[_0x03bf('0x3a')]=function(_0x5d1b53,_0x1ff1a6){if(_0x5d1b53[_0x03bf('0x5d')]['id']){delete _0x5d1b53[_0x03bf('0x5d')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x5d1b53[_0x03bf('0x5e')]['id']}})[_0x03bf('0x3b')](handleEntityNotFound(_0x1ff1a6,null))['then'](saveUpdates(_0x5d1b53['body'],null))['then'](respondWithResult(_0x1ff1a6,null))[_0x03bf('0x2f')](handleError(_0x1ff1a6,null));};exports[_0x03bf('0x3c')]=function(_0x5b26c0,_0x4666f0){return db[_0x03bf('0x55')][_0x03bf('0x5f')]({'where':{'id':_0x5b26c0['params']['id']}})[_0x03bf('0x3b')](handleEntityNotFound(_0x4666f0,null))[_0x03bf('0x3b')](removeEntity(_0x4666f0,null))[_0x03bf('0x2f')](handleError(_0x4666f0,null));};exports['describe']=function(_0x2d94e4,_0x1ed5d4){return db[_0x03bf('0x55')][_0x03bf('0x60')]()[_0x03bf('0x3b')](respondWithResult(_0x1ed5d4,null))[_0x03bf('0x2f')](handleError(_0x1ed5d4,null));};var interaction_log=require('../../config/logger')(_0x03bf('0x61'));exports[_0x03bf('0x62')]=function(_0x3b6dad,_0x241dce,_0xcb62c3){var _0x12a3cf={'agent':{},'channel':_0x03bf('0x63')};if(_0x3b6dad['body']['id']){delete _0x3b6dad['body']['id'];}_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x64')]=!![];_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x65')]=moment()[_0x03bf('0x66')](_0x03bf('0x67'));_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x68')]=_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x68')]||_0x3b6dad[_0x03bf('0x69')]['id'];_0x12a3cf['agent']['id']=_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x68')];return db[_0x03bf('0x55')][_0x03bf('0x5f')]({'where':{'id':_0x3b6dad[_0x03bf('0x5e')]['id'],'UserId':null}})[_0x03bf('0x3b')](handleEntityNotFound(_0x241dce,null))[_0x03bf('0x3b')](saveUpdates(_0x3b6dad[_0x03bf('0x5d')],null))[_0x03bf('0x3b')](function(_0x5774de){if(_0x5774de){_0x12a3cf[_0x03bf('0x2d')]=_0x5774de[_0x03bf('0x6a')]({'plain':!![]});return db[_0x03bf('0x6b')][_0x03bf('0x5f')]({'where':{'id':_0x5774de[_0x03bf('0x6c')]}});}return null;})[_0x03bf('0x3b')](handleEntityNotFound(_0x241dce,null))[_0x03bf('0x3b')](function(_0x4c20b2){if(_0x4c20b2){return _0x4c20b2[_0x03bf('0x3a')]({'UserId':_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x68')],'read1stAt':_['isNil'](_0x4c20b2[_0x03bf('0x6d')])?moment()[_0x03bf('0x66')](_0x03bf('0x67')):undefined});}return null;})[_0x03bf('0x3b')](function(_0x4367c2){if(_0x4367c2){_0x12a3cf['interaction']=_0x4367c2[_0x03bf('0x6a')]({'plain':!![]});interaction_log[_0x03bf('0x25')](_0x03bf('0x6e'),_0x3b6dad[_0x03bf('0x69')]['id'],_0x3b6dad['user'][_0x03bf('0x3e')],_0x3b6dad['user'][_0x03bf('0x6f')],_0x12a3cf[_0x03bf('0x70')]['id'],_0x3b6dad[_0x03bf('0x5d')]?JSON[_0x03bf('0x2a')](_0x3b6dad[_0x03bf('0x5d')]):_0x03bf('0x71'));return respondWithRpcPromise(_0x03bf('0x72'),_0x03bf('0x73'),_0x12a3cf);}return null;})['then'](function(_0x233a95){var _0x32f877='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x233a95[_0x03bf('0x2d')]['ContactId'];return db[_0x03bf('0x74')][_0x03bf('0x46')](_0x32f877,{'type':db['Sequelize'][_0x03bf('0x75')][_0x03bf('0x76')],'raw':!![]})['then'](function(_0x5c9a18){return _0x5c9a18;});})[_0x03bf('0x3b')](function(_0x562af8){if(_0x562af8){_0x12a3cf['message'][_0x03bf('0x77')]=_0x562af8[0x0];if(!_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x68')])return;return db[_0x03bf('0x78')][_0x03bf('0x5f')]({'where':{'id':_0x3b6dad[_0x03bf('0x5d')]['UserId'],'role':_0x03bf('0x79')},'attributes':['id',_0x03bf('0x3e'),_0x03bf('0x7a'),_0x03bf('0x7b'),_0x03bf('0x7c')],'raw':!![]});}return null;})[_0x03bf('0x3b')](function(_0x517ff5){if(!_0x517ff5)return null;_0x12a3cf[_0x03bf('0x2d')]['agent']=_0x517ff5;return _0x12a3cf;})['then'](function(_0x35945a){if(_0x35945a){if(_0x3b6dad[_0x03bf('0x5d')][_0x03bf('0x7d')]){_0x12a3cf[_0x03bf('0x2d')][_0x03bf('0x7e')]=util['format'](_0x03bf('0x7f'),_0x3b6dad[_0x03bf('0x69')][_0x03bf('0x3e')]);_0x12a3cf[_0x03bf('0x2d')][_0x03bf('0x80')]=_0x12a3cf[_0x03bf('0x80')];_0x12a3cf[_0x03bf('0x2d')]['motionChannel']=_0x12a3cf[_0x03bf('0x80')];_0x12a3cf[_0x03bf('0x2d')]['event']=_0x03bf('0x62');return respondWithRpcPromise('EventManager',_0x03bf('0x81'),{'event':_0x03bf('0x82'),'message':_0x12a3cf[_0x03bf('0x2d')]},client9002)[_0x03bf('0x3b')](function(){return _0x12a3cf;});}return _0x12a3cf;}return null;})[_0x03bf('0x3b')](respondWithResult(_0x241dce,null))[_0x03bf('0x2f')](handleError(_0x241dce,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x03bf('0x39')]=function(_0x2b1296,_0x56eb62,_0x2194db){var _0x2dc16a={'agent':{},'channel':_0x03bf('0x63')};if(_0x2b1296[_0x03bf('0x5d')]['id']){delete _0x2b1296[_0x03bf('0x5d')]['id'];}_0x2b1296[_0x03bf('0x5d')][_0x03bf('0x68')]=_0x2b1296[_0x03bf('0x5d')]['UserId']||_0x2b1296['user']['id'];_0x2dc16a[_0x03bf('0x79')]['id']=_0x2b1296[_0x03bf('0x5d')]['UserId'];return db[_0x03bf('0x55')][_0x03bf('0x5f')]({'where':{'id':_0x2b1296['params']['id'],'UserId':null}})[_0x03bf('0x3b')](handleEntityNotFound(_0x56eb62,null))[_0x03bf('0x3b')](function(_0x44bc80){if(_0x44bc80){_0x2dc16a[_0x03bf('0x2d')]=_0x44bc80[_0x03bf('0x6a')]({'plain':!![]});return db[_0x03bf('0x6b')][_0x03bf('0x5f')]({'where':{'id':_0x44bc80[_0x03bf('0x6c')]}});}return null;})[_0x03bf('0x3b')](handleEntityNotFound(_0x56eb62,null))[_0x03bf('0x3b')](function(_0x331df6){if(_0x331df6){_0x2dc16a[_0x03bf('0x70')]=_0x331df6[_0x03bf('0x6a')]({'plain':!![]});interaction_log[_0x03bf('0x25')](_0x03bf('0x83'),_0x2b1296[_0x03bf('0x69')]['id'],_0x2b1296[_0x03bf('0x69')][_0x03bf('0x3e')],_0x2b1296['user'][_0x03bf('0x6f')],_0x2dc16a[_0x03bf('0x70')]['id'],_0x2b1296[_0x03bf('0x5d')]?JSON[_0x03bf('0x2a')](_0x2b1296[_0x03bf('0x5d')]):'null');return respondWithRpcPromise('RejectMessage',_0x03bf('0x84'),_0x2dc16a);}return null;})[_0x03bf('0x3b')](function(_0x267015){var _0x38ef57=_0x03bf('0x85')+_0x267015[_0x03bf('0x2d')][_0x03bf('0x86')];return db[_0x03bf('0x74')]['query'](_0x38ef57,{'type':db['Sequelize'][_0x03bf('0x75')][_0x03bf('0x76')],'raw':!![]})[_0x03bf('0x3b')](function(_0x5138e4){return _0x5138e4;});})[_0x03bf('0x3b')](function(_0x43cbe2){if(_0x43cbe2){_0x2dc16a[_0x03bf('0x2d')][_0x03bf('0x77')]=_0x43cbe2[0x0];if(!_0x2b1296[_0x03bf('0x5d')][_0x03bf('0x68')])return;return db[_0x03bf('0x78')][_0x03bf('0x5f')]({'where':{'id':_0x2b1296[_0x03bf('0x5d')][_0x03bf('0x68')],'role':'agent'},'attributes':['id',_0x03bf('0x3e'),_0x03bf('0x7a'),'email',_0x03bf('0x7c')],'raw':!![]});}return null;})[_0x03bf('0x3b')](function(_0x3739db){if(!_0x3739db)return null;_0x2dc16a[_0x03bf('0x2d')]['agent']=_0x3739db;return _0x2dc16a;})['then'](function(_0x3c0c2a){if(_0x3c0c2a){_0x3c0c2a['message']['interface']=util[_0x03bf('0x66')](_0x03bf('0x7f'),_0x2b1296['user'][_0x03bf('0x3e')]);_0x3c0c2a[_0x03bf('0x2d')][_0x03bf('0x80')]=_0x2dc16a[_0x03bf('0x80')];_0x3c0c2a[_0x03bf('0x2d')][_0x03bf('0x87')]=_0x2dc16a[_0x03bf('0x80')];_0x3c0c2a[_0x03bf('0x2d')][_0x03bf('0x88')]='reject';respondWithRpcPromise('EventManager',_0x03bf('0x81'),{'event':_0x03bf('0x89'),'message':_0x3c0c2a[_0x03bf('0x2d')]},client9002);return _0x2dc16a;}return null;})[_0x03bf('0x3b')](respondWithResult(_0x56eb62,null))[_0x03bf('0x2f')](handleError(_0x56eb62,null));};exports[_0x03bf('0x31')]=function(_0x12be7b,_0x4f68bd,_0x1b4cb4){if(_0x12be7b['body']['id']){delete _0x12be7b[_0x03bf('0x5d')]['id'];}var _0x2a7c6f;return db[_0x03bf('0x55')]['find']({'where':{'id':_0x12be7b[_0x03bf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4f68bd,null))[_0x03bf('0x3b')](function(_0x4c3ef9){if(_0x4c3ef9){_0x2a7c6f=_0x4c3ef9;return db[_0x03bf('0x8a')]['find']({'where':{'id':_0x4c3ef9[_0x03bf('0x8b')]}});}})[_0x03bf('0x3b')](handleEntityNotFound(_0x4f68bd,null))['then'](function(_0x2dfde9){if(_0x2dfde9){logger[_0x03bf('0x28')](_0x03bf('0x29'),_0x03bf('0x31'),_0x03bf('0x8c'),_0x2dfde9[_0x03bf('0x43')],util[_0x03bf('0x8d')](_0x12be7b[_0x03bf('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2dfde9[_0x03bf('0x43')]){case _0x03bf('0x8e'):if(_0x12be7b['body'][_0x03bf('0x8f')]&&_0x12be7b[_0x03bf('0x5d')]['MessageSid']===_0x2a7c6f[_0x03bf('0x90')]){return _0x2a7c6f[_0x03bf('0x3a')]({'read':!![]});}else{logger[_0x03bf('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x03bf('0x31'),_0x03bf('0x8e'),util['inspect'](_0x12be7b[_0x03bf('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x03bf('0x91'):if(_0x12be7b[_0x03bf('0x5d')][_0x03bf('0x92')]&&_0x12be7b[_0x03bf('0x5d')][_0x03bf('0x92')]===_0x2a7c6f['messageId']&&_[_0x03bf('0x93')]([_0x03bf('0x94'),_0x03bf('0x95')],_0x12be7b[_0x03bf('0x5d')][_0x03bf('0x96')])>=0x0){return _0x2a7c6f[_0x03bf('0x3a')]({'read':!![]});}else{logger[_0x03bf('0x2b')](_0x03bf('0x97'),_0x03bf('0x31'),_0x03bf('0x98'),util['inspect'](_0x12be7b['body'],{'showHidden':![],'depth':null}));}break;case _0x03bf('0x99'):var _0x16474d=_0x12be7b['body'][_0x03bf('0x9a')][0x0];if(_0x16474d[_0x03bf('0x31')][_0x03bf('0x9b')]==='DELIVERED'){return _0x2a7c6f['update']({'read':!![]});}else{logger[_0x03bf('0x2b')](_0x03bf('0x97'),'status',_0x03bf('0x99'),util[_0x03bf('0x8d')](_0x12be7b[_0x03bf('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2a7c6f;}})[_0x03bf('0x3b')](respondWithResult(_0x4f68bd,null))['catch'](handleError(_0x4f68bd,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7636a60..94590a0 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 _0xb551=['hook','exports','../../mysqldb','save','update','remove','hasOwnProperty'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb551,0x18a));var _0x1b55=function(_0x368fac,_0x3ff552){_0x368fac=_0x368fac-0x0;var _0x2b699a=_0xb551[_0x368fac];return _0x2b699a;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x1b55('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1b55('0x1'),'afterUpdate':_0x1b55('0x2'),'afterDestroy':_0x1b55('0x3')};function emitEvent(_0x563812){return function(_0x1b7ff8,_0x385aeb,_0x20739d){SmsMessageEvents['emit'](_0x563812+':'+_0x1b7ff8['id'],_0x1b7ff8);SmsMessageEvents['emit'](_0x563812,_0x1b7ff8);_0x20739d(null);};}for(var e in events){if(events[_0x1b55('0x4')](e)){var event=events[e];SmsMessage[_0x1b55('0x5')](e,emitEvent(event));}}module[_0x1b55('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x2181=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2181,0x125));var _0x1218=function(_0x3d7635,_0x4fd394){_0x3d7635=_0x3d7635-0x0;var _0x4c0b6c=_0x2181[_0x3d7635];return _0x4c0b6c;};'use strict';var EventEmitter=require(_0x1218('0x0'));var SmsMessage=require(_0x1218('0x1'))['db'][_0x1218('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1218('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1218('0x4'),'afterDestroy':_0x1218('0x5')};function emitEvent(_0x167c76){return function(_0x1f7055,_0x5a01f3,_0x4f5fdc){SmsMessageEvents[_0x1218('0x6')](_0x167c76+':'+_0x1f7055['id'],_0x1f7055);SmsMessageEvents[_0x1218('0x6')](_0x167c76,_0x1f7055);_0x4f5fdc(null);};}for(var e in events){if(events[_0x1218('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b574fe7..229c5da 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 _0xf2c5=['clickSend','plivo','authId','format','%s:%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','sender','text','sort','length','createHash','digest','hex','signature=','keys','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','password','GET','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id'];(function(_0xb8d9cf,_0x455825){var _0x5a2d3b=function(_0x3fc1a0){while(--_0x3fc1a0){_0xb8d9cf['push'](_0xb8d9cf['shift']());}};_0x5a2d3b(++_0x455825);}(_0xf2c5,0xa9));var _0x5f2c=function(_0x25713b,_0x47d6b3){_0x25713b=_0x25713b-0x0;var _0x27ce9e=_0xf2c5[_0x25713b];return _0x27ce9e;};'use strict';var _=require(_0x5f2c('0x0'));var util=require(_0x5f2c('0x1'));var logger=require(_0x5f2c('0x2'))('api');var moment=require(_0x5f2c('0x3'));var BPromise=require(_0x5f2c('0x4'));var rp=require(_0x5f2c('0x5'));var fs=require('fs');var path=require(_0x5f2c('0x6'));var rimraf=require('rimraf');var config=require(_0x5f2c('0x7'));var attributes=require(_0x5f2c('0x8'));module['exports']=function(_0x4a7ade,_0x2b1098){return _0x4a7ade[_0x5f2c('0x9')](_0x5f2c('0xa'),attributes,{'tableName':_0x5f2c('0xb'),'paranoid':![],'indexes':[{'name':_0x5f2c('0xc'),'fields':[_0x5f2c('0xc')]},{'name':_0x5f2c('0xd'),'fields':[_0x5f2c('0xe')],'type':_0x5f2c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16ec64,_0x8eb656,_0x282056){var _0x5de1ca=_0x4a7ade[_0x5f2c('0x10')];var _0x357340=_0x16ec64['get']({'plain':!![]});if(_0x357340[_0x5f2c('0x11')][_0x5f2c('0x12')]()==='in'||_0x357340[_0x5f2c('0x11')][_0x5f2c('0x12')]()===_0x5f2c('0x13')&&!_0x357340[_0x5f2c('0x14')]&&!_['isNil'](_0x357340[_0x5f2c('0x15')])&&!_[_0x5f2c('0x16')](_0x357340['SmsInteractionId'])){_0x5de1ca[_0x5f2c('0x17')][_0x5f2c('0x18')]({'where':{'id':_0x357340[_0x5f2c('0x19')]}})[_0x5f2c('0x1a')](function(_0xbbcdff){if(_0xbbcdff){_0xbbcdff[_0x5f2c('0x1b')]({'lastMsgAt':_0x357340[_0x5f2c('0x1c')],'lastMsgDirection':_0x357340[_0x5f2c('0x11')]['toLowerCase']()});}})[_0x5f2c('0x1d')](function(_0x111fe6){console['error'](_0x111fe6);});}if(_0x357340[_0x5f2c('0x11')]===_0x5f2c('0x13')&&!_0x357340[_0x5f2c('0x14')]){var _0x907e97;_0x5de1ca[_0x5f2c('0x1e')][_0x5f2c('0x1f')]({'where':{'id':_0x357340[_0x5f2c('0x20')]},'raw':!![]})[_0x5f2c('0x1a')](function(_0x40fb5f){_0x907e97=_0x40fb5f;if(_0x907e97&&_0x907e97[_0x5f2c('0x21')]){switch(_0x907e97['type']){case _0x5f2c('0x22'):var _0x5d020e=require(_0x5f2c('0x22'));if(_0x907e97[_0x5f2c('0x23')]&&_0x907e97[_0x5f2c('0x24')]&&_0x907e97[_0x5f2c('0x25')]){var _0x2cdbe3=new _0x5d020e(_0x907e97[_0x5f2c('0x23')],_0x907e97[_0x5f2c('0x24')]);_0x2cdbe3[_0x5f2c('0x26')][_0x5f2c('0x27')]({'body':_0x357340['body'],'to':_0x357340[_0x5f2c('0x25')],'from':_0x907e97[_0x5f2c('0x25')],'statusCallback':_0x907e97[_0x5f2c('0x28')]+_0x5f2c('0x29')+_0x357340['id']+_0x5f2c('0x2a')+_0x907e97[_0x5f2c('0x2b')]})[_0x5f2c('0x1a')](function(_0xa657f9){if(_0xa657f9['sid']){return _0x16ec64[_0x5f2c('0x1b')]({'messageId':_0xa657f9['sid']});}})[_0x5f2c('0x1d')](function(_0x45c0a1){logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x22'),util['inspect'](_0x45c0a1,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5f2c('0x2f'):var _0x458750=_0x5f2c('0x30');if(_0x907e97[_0x5f2c('0x31')]&&_0x907e97['password']){var _0x189807={'recipient':[_0x357340['phone']],'message':_0x357340[_0x5f2c('0xe')],'message_type':_0x907e97[_0x5f2c('0x32')]};if(_0x907e97[_0x5f2c('0x32')]&&_0x907e97['smsMethod']!=='SI'){_0x189807['sender']=_0x907e97[_0x5f2c('0x25')];}var _0x44b68b={'url':_0x458750+_0x5f2c('0x33')+_0x907e97['username']+'&password='+_0x907e97[_0x5f2c('0x34')],'method':_0x5f2c('0x35')};rp(_0x44b68b)['then'](function(_0x586ecf){var _0x6f320b=_0x586ecf['split'](';');var _0x5499a2={'user_key':_0x6f320b[0x0],'session_key':_0x6f320b[0x1]};_0x44b68b={'url':_0x458750+'sms','method':_0x5f2c('0x36'),'headers':{'user_key':_0x5499a2[_0x5f2c('0x37')],'Session_key':_0x5499a2[_0x5f2c('0x38')]},'json':!![],'body':_0x189807};return rp(_0x44b68b);})[_0x5f2c('0x1a')](function(_0x17bb48){if(_0x17bb48[_0x5f2c('0x39')]>=0x1){var _0x5983fc={'messageId':_0x17bb48[_0x5f2c('0x3a')]};if(_0x907e97['smsMethod']!=='GP'||!_0x907e97[_0x5f2c('0x3b')]){_0x5983fc[_0x5f2c('0x3c')]=!![];}return _0x16ec64['update'](_0x5983fc);}else{return logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),'skebby',util['inspect'](_0x17bb48,{'showHidden':![],'depth':null}));}})[_0x5f2c('0x1d')](function(_0x1506fd){return logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x2f'),util[_0x5f2c('0x3d')](_0x1506fd,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x5f2c('0x3e'):if(_0x907e97[_0x5f2c('0x24')]){var _0x54ea95={'recipient':_0x357340['phone'],'message':_0x357340['body'],'sender':_0x907e97[_0x5f2c('0x3f')]||_0x907e97['phone'],'authorization':_0x907e97[_0x5f2c('0x24')]};var _0x8eb656={'method':_0x5f2c('0x36'),'uri':_0x5f2c('0x40'),'body':_0x54ea95,'json':!![]};rp(_0x8eb656)[_0x5f2c('0x1a')](function(_0x66625b){var _0x151865={'messageId':_0x66625b[_0x5f2c('0x41')]};if(!_0x907e97['deliveryReport']){_0x151865[_0x5f2c('0x3c')]=!![];}return _0x16ec64[_0x5f2c('0x1b')](_0x151865);})[_0x5f2c('0x1d')](function(_0x128067){logger['error'](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x3e'),util[_0x5f2c('0x3d')](_0x128067,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),'connectel',_0x5f2c('0x42'));}break;case _0x5f2c('0x43'):if(_0x907e97['username']&&_0x907e97[_0x5f2c('0x34')]){var _0x54ea95={'messages':[{'source':_0x5f2c('0x44'),'to':_0x357340[_0x5f2c('0x25')],'body':_0x357340['body'],'from':_0x907e97['senderString']||_0x907e97[_0x5f2c('0x25')]}]};var _0x589931=util['format']('%s:%s',_0x907e97[_0x5f2c('0x31')],_0x907e97[_0x5f2c('0x34')]);var _0x8eb656={'method':_0x5f2c('0x36'),'uri':_0x5f2c('0x45'),'body':_0x54ea95,'headers':{'Authorization':util['format'](_0x5f2c('0x46'),new Buffer(_0x589931)[_0x5f2c('0x47')](_0x5f2c('0x48')))},'json':!![]};rp(_0x8eb656)[_0x5f2c('0x1a')](function(_0x4d7f9d){if(_0x4d7f9d[_0x5f2c('0x49')]>=0xc8&&_0x4d7f9d['http_code']<=0xce){if(_0x4d7f9d[_0x5f2c('0x4a')]&&_0x4d7f9d[_0x5f2c('0x4a')]['queued_count']>0x0){var _0x2e1fa2=_[_0x5f2c('0x4b')](_0x4d7f9d[_0x5f2c('0x4a')][_0x5f2c('0x26')]);var _0x3d3946={'messageId':_0x2e1fa2[_0x5f2c('0x4c')]};if(!_0x907e97['deliveryReport']){_0x3d3946[_0x5f2c('0x3c')]=!![];}return _0x16ec64[_0x5f2c('0x1b')](_0x3d3946);}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x4d'),util[_0x5f2c('0x3d')](_0x4d7f9d,{'showHidden':![],'depth':null}));}}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x4d'),util[_0x5f2c('0x3d')](_0x4d7f9d,{'showHidden':![],'depth':null}));}})[_0x5f2c('0x1d')](function(_0x3d0da7){logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x4d'),util['inspect'](_0x3d0da7,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x5f2c('0x4e'):if(_0x907e97[_0x5f2c('0x4f')]&&_0x907e97['authToken']){var _0x54ea95={'dst':_0x357340[_0x5f2c('0x25')],'text':_0x357340[_0x5f2c('0xe')],'src':_0x907e97[_0x5f2c('0x3f')]||_0x907e97['phone'],'url':_0x907e97[_0x5f2c('0x28')]+_0x5f2c('0x29')+_0x357340['id']+'/status?token='+_0x907e97[_0x5f2c('0x2b')]};var _0x589931=util[_0x5f2c('0x50')](_0x5f2c('0x51'),_0x907e97['authId'],_0x907e97[_0x5f2c('0x24')]);var _0x8eb656={'method':_0x5f2c('0x36'),'uri':util[_0x5f2c('0x50')]('https://api.plivo.com/v1/Account/%s/Message/',_0x907e97[_0x5f2c('0x4f')]),'body':_0x54ea95,'headers':{'Authorization':util[_0x5f2c('0x50')]('Basic\x20%s',new Buffer(_0x589931)[_0x5f2c('0x47')](_0x5f2c('0x48')))},'json':!![]};rp(_0x8eb656)[_0x5f2c('0x1a')](function(_0x10bb60){var _0x9077d3={'messageId':_0x10bb60[_0x5f2c('0x52')][0x0]};return _0x16ec64['update'](_0x9077d3);})[_0x5f2c('0x1d')](function(_0x723993){logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x4e'),util[_0x5f2c('0x3d')](_0x723993,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x4e'),_0x5f2c('0x53'));}break;case _0x5f2c('0x54'):if(_0x907e97['username']&&_0x907e97[_0x5f2c('0x34')]){if(_0x907e97[_0x5f2c('0x55')]){var _0x191c84={'method':_0x5f2c('0x36'),'uri':_0x907e97[_0x5f2c('0x55')]+'/auth/1/session','body':{'username':_0x907e97[_0x5f2c('0x31')],'password':_0x907e97[_0x5f2c('0x34')]},'json':!![]};return rp(_0x191c84)[_0x5f2c('0x1a')](function(_0x726d4d){var _0x396606={'method':_0x5f2c('0x36'),'uri':_0x907e97[_0x5f2c('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x907e97[_0x5f2c('0x25')],'destinations':[{'to':_0x357340['phone']}],'text':_0x357340[_0x5f2c('0xe')],'notifyUrl':_0x907e97[_0x5f2c('0x28')]+'/api/sms/messages/'+_0x357340['id']+_0x5f2c('0x2a')+_0x907e97[_0x5f2c('0x2b')],'notifyContentType':_0x5f2c('0x56'),'callbackData':_0x907e97[_0x5f2c('0x25')]+';'+_0x357340[_0x5f2c('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x726d4d[_0x5f2c('0x2b')]},'json':!![]};return rp(_0x396606)[_0x5f2c('0x1a')](function(_0xc4adf8){if(_0xc4adf8['messages']){var _0x322b95={'messageId':_0xc4adf8[_0x5f2c('0x26')][0x0][_0x5f2c('0xc')]};if(!_0x907e97[_0x5f2c('0x3b')]){_0x322b95[_0x5f2c('0x3c')]=!![];}return _0x16ec64[_0x5f2c('0x1b')](_0x322b95);}else{return logger['error'](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x54'),util[_0x5f2c('0x3d')](_0xc4adf8,{'showHidden':![],'depth':null}));}});})[_0x5f2c('0x1d')](function(_0x59c3c6){return logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x54'),util[_0x5f2c('0x3d')](_0x59c3c6,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x54'),_0x5f2c('0x57'));}break;case _0x5f2c('0x58'):var _0xbca830=require(_0x5f2c('0x59'));if(_0x907e97[_0x5f2c('0x5a')]){var _0x140e2f={};_0x140e2f[_0x5f2c('0x5b')]=_0x907e97['username'];_0x140e2f[_0x5f2c('0x25')]=_0x357340[_0x5f2c('0x25')];_0x140e2f[_0x5f2c('0x5c')]=_0x907e97[_0x5f2c('0x25')];_0x140e2f[_0x5f2c('0x5d')]=_0x357340[_0x5f2c('0xe')];_0x140e2f['timestamp']=+new Date();var _0x1285ea='';var _0x25971d='';var _0x58ffb7=Object['keys'](_0x140e2f);_0x58ffb7[_0x5f2c('0x5e')]();for(var _0x3f221d=0x0;_0x3f221d<_0x58ffb7[_0x5f2c('0x5f')];_0x3f221d++){if(_0x1285ea!=''){_0x1285ea+='&';}_0x1285ea+=_0x58ffb7[_0x3f221d]+'='+encodeURIComponent(_0x140e2f[_0x58ffb7[_0x3f221d]]);_0x25971d+=_0x140e2f[_0x58ffb7[_0x3f221d]];}_0x25971d+=_0x907e97[_0x5f2c('0x5a')];_0x25971d=_0xbca830[_0x5f2c('0x60')]('md5')[_0x5f2c('0x1b')](_0x25971d)[_0x5f2c('0x61')](_0x5f2c('0x62'));if(_0x1285ea!==''){_0x1285ea+='&';}_0x1285ea+=_0x5f2c('0x63')+_0x25971d;var _0x44b68b={'method':'GET','uri':_0x907e97['baseUrl']+'/external/get/send.php?'+_0x1285ea,'json':!![]};return rp(_0x44b68b)[_0x5f2c('0x1a')](function(_0x1a3e79){var _0x1d8c76=Object[_0x5f2c('0x64')](_0x1a3e79);if(_0x1a3e79[_0x1d8c76[0x0]]['error']&&parseInt(_0x1a3e79[_0x1d8c76[0x0]][_0x5f2c('0x2c')])===0x0){var _0x7fd103={'messageId':_0x1a3e79[_0x1d8c76[0x0]][_0x5f2c('0x65')]};if(!_0x907e97['deliveryReport']){_0x7fd103[_0x5f2c('0x3c')]=!![];}return _0x16ec64[_0x5f2c('0x1b')](_0x7fd103);}else{return logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x5f2c('0x58'),util['inspect'](_0x1a3e79[_0x5f2c('0x2c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xd100db){return logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),_0x5f2c('0x58'),util['inspect'](_0xd100db,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x58'),'Missing\x20parameters:\x20apiKey');}break;case _0x5f2c('0x66'):if(_0x907e97[_0x5f2c('0x5a')]){var _0xe93d25={'method':_0x5f2c('0x36'),'uri':_0x5f2c('0x67'),'headers':{'Authorization':_0x907e97['apiKey']},'body':{'content':_0x357340[_0x5f2c('0xe')],'to':[_0x357340[_0x5f2c('0x25')]],'from':_0x907e97[_0x5f2c('0x25')],'binary':![],'clientMessageId':_0x5f2c('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0xe93d25)['then'](function(_0x2b9180){if(!_0x2b9180[_0x5f2c('0x2c')]){var _0x1314b6={'messageId':_0x2b9180[_0x5f2c('0x26')][0x0][_0x5f2c('0x69')]};if(!_0x907e97[_0x5f2c('0x3b')]){_0x1314b6['read']=!![];}return _0x16ec64[_0x5f2c('0x1b')](_0x1314b6);}else{return logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),_0x5f2c('0x66'),util[_0x5f2c('0x3d')](_0x2b9180[_0x5f2c('0x2c')],{'showHidden':![],'depth':null}));}})[_0x5f2c('0x1d')](function(_0x46b380){return logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),'clickatell',util[_0x5f2c('0x3d')](_0x46b380,{'showHidden':![],'depth':null}));});}else{logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x66'),_0x5f2c('0x6a'));}break;case'bandwidth':if(_0x907e97['username']&&_0x907e97[_0x5f2c('0x34')]){var _0x589931=util[_0x5f2c('0x50')](_0x5f2c('0x51'),_0x907e97[_0x5f2c('0x31')],_0x907e97[_0x5f2c('0x34')]);var _0x8eb656={'method':'POST','uri':_0x5f2c('0x6b')+_0x907e97['accountId']+_0x5f2c('0x6c'),'body':{'to':[_0x357340[_0x5f2c('0x25')]],'text':_0x357340[_0x5f2c('0xe')],'from':_0x907e97[_0x5f2c('0x25')],'applicationId':_0x907e97[_0x5f2c('0x6d')]},'headers':{'Authorization':util[_0x5f2c('0x50')]('Basic\x20%s',new Buffer(_0x589931)['toString']('base64'))},'json':!![]};rp(_0x8eb656)[_0x5f2c('0x1a')](function(_0x59e77b){if(_0x59e77b['id']){var _0xb2fac4={'messageId':_0x59e77b['id']};return _0x16ec64['update'](_0xb2fac4);}else{logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),_0x5f2c('0x6e'),util[_0x5f2c('0x3d')](_0x59e77b,{'showHidden':![],'depth':null}));}})[_0x5f2c('0x1d')](function(_0x38412b){logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x6e'),util[_0x5f2c('0x3d')](_0x38412b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5f2c('0x2d'),_0x5f2c('0x2e'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x5f2c('0x6f'):if(_0x907e97['apiKey']){var _0xc34db5={};var _0x44b68b={'method':'POST','uri':_0x5f2c('0x70'),'headers':{'Authorization':_0x5f2c('0x71')+_0x907e97[_0x5f2c('0x5a')],'Content-Type':_0x5f2c('0x56')},'body':{'from':_0x907e97['phone'],'to':_0x357340[_0x5f2c('0x25')],'text':_0x357340['body']},'json':!![]};return rp(_0x44b68b)['then'](function(_0x100891){if(_0x100891[_0x5f2c('0x72')]==0xca){_0xc34db5[_0x5f2c('0x73')]=_0x100891;var _0x4114cb={'method':_0x5f2c('0x36'),'uri':_0x5f2c('0x74'),'headers':{'Authorization':_0x5f2c('0x71')+_0x907e97[_0x5f2c('0x5a')],'Content-Type':_0x5f2c('0x56')},'body':{'refid':_0xc34db5[_0x5f2c('0x73')][_0x5f2c('0x75')]},'json':!![]};return rp(_0x4114cb)['then'](function(_0x5ae2df){_0xc34db5[_0x5f2c('0x76')]=_0x5ae2df;var _0x2e594d={'messageId':_0xc34db5[_0x5f2c('0x73')]['refid'],'read':!![]};return _0x16ec64['update'](_0x2e594d);});}else{return logger[_0x5f2c('0x2c')](_0x5f2c('0x2d'),_0x5f2c('0x2e'),_0x5f2c('0x6f'),util[_0x5f2c('0x3d')](_0x100891,{'showHidden':![],'depth':null}));}})[_0x5f2c('0x1d')](function(_0x2ee0df){return logger[_0x5f2c('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f2c('0x2e'),_0x5f2c('0x6f'),util[_0x5f2c('0x3d')](_0x2ee0df,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x5f2c('0x2d'),'afterCreate',_0x5f2c('0x6f'),_0x5f2c('0x77'));}break;}}})[_0x5f2c('0x78')](function(){_0x282056();});}else{_0x282056();}}},'charset':_0x5f2c('0x79'),'collate':_0x5f2c('0x7a')});}; \ No newline at end of file +var _0xc8a8=['catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','clickSend','authId','remote','/api/sms/messages/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messageId','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','timestamp','keys','sort','length','digest','hex','signature=','GET','/external/get/send.php?','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt'];(function(_0x480f9c,_0x326662){var _0x4d9214=function(_0x11d94e){while(--_0x11d94e){_0x480f9c['push'](_0x480f9c['shift']());}};_0x4d9214(++_0x326662);}(_0xc8a8,0xe2));var _0x8c8a=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xc8a8[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var logger=require(_0x8c8a('0x2'))(_0x8c8a('0x3'));var moment=require('moment');var BPromise=require(_0x8c8a('0x4'));var rp=require(_0x8c8a('0x5'));var fs=require('fs');var path=require(_0x8c8a('0x6'));var rimraf=require('rimraf');var config=require(_0x8c8a('0x7'));var attributes=require(_0x8c8a('0x8'));module[_0x8c8a('0x9')]=function(_0x3c54ec,_0x88d65f){return _0x3c54ec[_0x8c8a('0xa')](_0x8c8a('0xb'),attributes,{'tableName':_0x8c8a('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x8c8a('0xd'),'fields':[_0x8c8a('0xe')],'type':_0x8c8a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47581f,_0x544ad7,_0x50933a){var _0x218fec=_0x3c54ec[_0x8c8a('0x10')];var _0x29b75e=_0x47581f[_0x8c8a('0x11')]({'plain':!![]});if(_0x29b75e[_0x8c8a('0x12')][_0x8c8a('0x13')]()==='in'||_0x29b75e[_0x8c8a('0x12')][_0x8c8a('0x13')]()===_0x8c8a('0x14')&&!_0x29b75e['secret']&&!_['isNil'](_0x29b75e[_0x8c8a('0x15')])&&!_['isNil'](_0x29b75e[_0x8c8a('0x16')])){_0x218fec[_0x8c8a('0x17')][_0x8c8a('0x18')]({'where':{'id':_0x29b75e[_0x8c8a('0x16')]}})[_0x8c8a('0x19')](function(_0x56f14b){if(_0x56f14b){_0x56f14b[_0x8c8a('0x1a')]({'lastMsgAt':_0x29b75e[_0x8c8a('0x1b')],'lastMsgDirection':_0x29b75e[_0x8c8a('0x12')]['toLowerCase']()});}})[_0x8c8a('0x1c')](function(_0x17f9ae){console[_0x8c8a('0x1d')](_0x17f9ae);});}if(_0x29b75e[_0x8c8a('0x12')]===_0x8c8a('0x14')&&!_0x29b75e['secret']){var _0x99f032;_0x218fec[_0x8c8a('0x1e')][_0x8c8a('0x1f')]({'where':{'id':_0x29b75e[_0x8c8a('0x20')]},'raw':!![]})['then'](function(_0xd5dbf){_0x99f032=_0xd5dbf;if(_0x99f032&&_0x99f032[_0x8c8a('0x21')]){switch(_0x99f032[_0x8c8a('0x21')]){case _0x8c8a('0x22'):var _0x4b7686=require(_0x8c8a('0x22'));if(_0x99f032[_0x8c8a('0x23')]&&_0x99f032[_0x8c8a('0x24')]&&_0x99f032[_0x8c8a('0x25')]){var _0xa94970=new _0x4b7686(_0x99f032['accountSid'],_0x99f032[_0x8c8a('0x24')]);_0xa94970[_0x8c8a('0x26')][_0x8c8a('0x27')]({'body':_0x29b75e[_0x8c8a('0xe')],'to':_0x29b75e[_0x8c8a('0x25')],'from':_0x99f032[_0x8c8a('0x25')],'statusCallback':_0x99f032['remote']+'/api/sms/messages/'+_0x29b75e['id']+_0x8c8a('0x28')+_0x99f032[_0x8c8a('0x29')]})[_0x8c8a('0x19')](function(_0x247a20){if(_0x247a20[_0x8c8a('0x2a')]){return _0x47581f['update']({'messageId':_0x247a20[_0x8c8a('0x2a')]});}})[_0x8c8a('0x1c')](function(_0x19341e){logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x22'),util['inspect'](_0x19341e,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x22'),_0x8c8a('0x2d'));}break;case _0x8c8a('0x2e'):var _0x5e8352=_0x8c8a('0x2f');if(_0x99f032[_0x8c8a('0x30')]&&_0x99f032[_0x8c8a('0x31')]){var _0x229080={'recipient':[_0x29b75e[_0x8c8a('0x25')]],'message':_0x29b75e['body'],'message_type':_0x99f032[_0x8c8a('0x32')]};if(_0x99f032['smsMethod']&&_0x99f032[_0x8c8a('0x32')]!=='SI'){_0x229080['sender']=_0x99f032[_0x8c8a('0x25')];}var _0x3387e7={'url':_0x5e8352+_0x8c8a('0x33')+_0x99f032[_0x8c8a('0x30')]+_0x8c8a('0x34')+_0x99f032['password'],'method':'GET'};rp(_0x3387e7)[_0x8c8a('0x19')](function(_0x2e85fb){var _0x5d6b99=_0x2e85fb['split'](';');var _0x3cbef5={'user_key':_0x5d6b99[0x0],'session_key':_0x5d6b99[0x1]};_0x3387e7={'url':_0x5e8352+_0x8c8a('0x35'),'method':_0x8c8a('0x36'),'headers':{'user_key':_0x3cbef5[_0x8c8a('0x37')],'Session_key':_0x3cbef5[_0x8c8a('0x38')]},'json':!![],'body':_0x229080};return rp(_0x3387e7);})[_0x8c8a('0x19')](function(_0x4c3907){if(_0x4c3907[_0x8c8a('0x39')]>=0x1){var _0x55c7ac={'messageId':_0x4c3907[_0x8c8a('0x3a')]};if(_0x99f032[_0x8c8a('0x32')]!=='GP'||!_0x99f032[_0x8c8a('0x3b')]){_0x55c7ac[_0x8c8a('0x3c')]=!![];}return _0x47581f[_0x8c8a('0x1a')](_0x55c7ac);}else{return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'skebby',util[_0x8c8a('0x3d')](_0x4c3907,{'showHidden':![],'depth':null}));}})[_0x8c8a('0x1c')](function(_0x58f493){return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x2e'),util[_0x8c8a('0x3d')](_0x58f493,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x2e'),_0x8c8a('0x3e'));}break;case _0x8c8a('0x3f'):if(_0x99f032[_0x8c8a('0x24')]){var _0x45c1b1={'recipient':_0x29b75e[_0x8c8a('0x25')],'message':_0x29b75e['body'],'sender':_0x99f032['senderString']||_0x99f032[_0x8c8a('0x25')],'authorization':_0x99f032[_0x8c8a('0x24')]};var _0x544ad7={'method':_0x8c8a('0x36'),'uri':_0x8c8a('0x40'),'body':_0x45c1b1,'json':!![]};rp(_0x544ad7)[_0x8c8a('0x19')](function(_0x15b976){var _0x101a9b={'messageId':_0x15b976[_0x8c8a('0x41')]};if(!_0x99f032['deliveryReport']){_0x101a9b[_0x8c8a('0x3c')]=!![];}return _0x47581f['update'](_0x101a9b);})[_0x8c8a('0x1c')](function(_0x55fd7e){logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),'afterCreate',_0x8c8a('0x3f'),util[_0x8c8a('0x3d')](_0x55fd7e,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),'afterCreate',_0x8c8a('0x3f'),_0x8c8a('0x42'));}break;case _0x8c8a('0x43'):if(_0x99f032[_0x8c8a('0x30')]&&_0x99f032[_0x8c8a('0x31')]){var _0x45c1b1={'messages':[{'source':_0x8c8a('0x44'),'to':_0x29b75e['phone'],'body':_0x29b75e[_0x8c8a('0xe')],'from':_0x99f032[_0x8c8a('0x45')]||_0x99f032['phone']}]};var _0xa7f51b=util[_0x8c8a('0x46')](_0x8c8a('0x47'),_0x99f032['username'],_0x99f032[_0x8c8a('0x31')]);var _0x544ad7={'method':_0x8c8a('0x36'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x45c1b1,'headers':{'Authorization':util[_0x8c8a('0x46')](_0x8c8a('0x48'),new Buffer(_0xa7f51b)[_0x8c8a('0x49')](_0x8c8a('0x4a')))},'json':!![]};rp(_0x544ad7)[_0x8c8a('0x19')](function(_0x5636ed){if(_0x5636ed[_0x8c8a('0x4b')]>=0xc8&&_0x5636ed[_0x8c8a('0x4b')]<=0xce){if(_0x5636ed[_0x8c8a('0x4c')]&&_0x5636ed['data']['queued_count']>0x0){var _0x4e6343=_['head'](_0x5636ed[_0x8c8a('0x4c')][_0x8c8a('0x26')]);var _0x318a55={'messageId':_0x4e6343['message_id']};if(!_0x99f032[_0x8c8a('0x3b')]){_0x318a55[_0x8c8a('0x3c')]=!![];}return _0x47581f['update'](_0x318a55);}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),'afterCreate',_0x8c8a('0x4d'),util[_0x8c8a('0x3d')](_0x5636ed,{'showHidden':![],'depth':null}));}}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),'afterCreate',_0x8c8a('0x4d'),util[_0x8c8a('0x3d')](_0x5636ed,{'showHidden':![],'depth':null}));}})['catch'](function(_0x27bad7){logger['error'](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'clickSend',util[_0x8c8a('0x3d')](_0x27bad7,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x4d'),_0x8c8a('0x3e'));}break;case'plivo':if(_0x99f032[_0x8c8a('0x4e')]&&_0x99f032[_0x8c8a('0x24')]){var _0x45c1b1={'dst':_0x29b75e[_0x8c8a('0x25')],'text':_0x29b75e[_0x8c8a('0xe')],'src':_0x99f032[_0x8c8a('0x45')]||_0x99f032['phone'],'url':_0x99f032[_0x8c8a('0x4f')]+_0x8c8a('0x50')+_0x29b75e['id']+_0x8c8a('0x28')+_0x99f032['token']};var _0xa7f51b=util[_0x8c8a('0x46')](_0x8c8a('0x47'),_0x99f032[_0x8c8a('0x4e')],_0x99f032[_0x8c8a('0x24')]);var _0x544ad7={'method':_0x8c8a('0x36'),'uri':util[_0x8c8a('0x46')]('https://api.plivo.com/v1/Account/%s/Message/',_0x99f032[_0x8c8a('0x4e')]),'body':_0x45c1b1,'headers':{'Authorization':util[_0x8c8a('0x46')]('Basic\x20%s',new Buffer(_0xa7f51b)[_0x8c8a('0x49')]('base64'))},'json':!![]};rp(_0x544ad7)[_0x8c8a('0x19')](function(_0x146408){var _0x4c6226={'messageId':_0x146408[_0x8c8a('0x51')][0x0]};return _0x47581f[_0x8c8a('0x1a')](_0x4c6226);})['catch'](function(_0x171b62){logger[_0x8c8a('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8c8a('0x2c'),'plivo',util[_0x8c8a('0x3d')](_0x171b62,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x52'),_0x8c8a('0x53'));}break;case _0x8c8a('0x54'):if(_0x99f032[_0x8c8a('0x30')]&&_0x99f032[_0x8c8a('0x31')]){if(_0x99f032[_0x8c8a('0x55')]){var _0x1d38d4={'method':_0x8c8a('0x36'),'uri':_0x99f032[_0x8c8a('0x55')]+_0x8c8a('0x56'),'body':{'username':_0x99f032[_0x8c8a('0x30')],'password':_0x99f032[_0x8c8a('0x31')]},'json':!![]};return rp(_0x1d38d4)[_0x8c8a('0x19')](function(_0x36ce1f){var _0x3899ed={'method':'POST','uri':_0x99f032['baseUrl']+_0x8c8a('0x57'),'body':{'messages':[{'from':_0x99f032[_0x8c8a('0x25')],'destinations':[{'to':_0x29b75e[_0x8c8a('0x25')]}],'text':_0x29b75e[_0x8c8a('0xe')],'notifyUrl':_0x99f032[_0x8c8a('0x4f')]+'/api/sms/messages/'+_0x29b75e['id']+'/status?token='+_0x99f032['token'],'notifyContentType':_0x8c8a('0x58'),'callbackData':_0x99f032['phone']+';'+_0x29b75e['body']}]},'headers':{'Authorization':_0x8c8a('0x59')+_0x36ce1f['token']},'json':!![]};return rp(_0x3899ed)['then'](function(_0x181ff4){if(_0x181ff4[_0x8c8a('0x26')]){var _0x3f63d3={'messageId':_0x181ff4[_0x8c8a('0x26')][0x0][_0x8c8a('0x5a')]};if(!_0x99f032[_0x8c8a('0x3b')]){_0x3f63d3[_0x8c8a('0x3c')]=!![];}return _0x47581f[_0x8c8a('0x1a')](_0x3f63d3);}else{return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'infobip',util[_0x8c8a('0x3d')](_0x181ff4,{'showHidden':![],'depth':null}));}});})[_0x8c8a('0x1c')](function(_0x49ba72){return logger['error'](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x54'),util[_0x8c8a('0x3d')](_0x49ba72,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'infobip',_0x8c8a('0x5b'));}}else{logger[_0x8c8a('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8c8a('0x2c'),_0x8c8a('0x54'),_0x8c8a('0x3e'));}break;case _0x8c8a('0x5c'):var _0x2f4a22=require(_0x8c8a('0x5d'));if(_0x99f032[_0x8c8a('0x5e')]){var _0x362438={};_0x362438[_0x8c8a('0x5f')]=_0x99f032[_0x8c8a('0x30')];_0x362438[_0x8c8a('0x25')]=_0x29b75e[_0x8c8a('0x25')];_0x362438[_0x8c8a('0x60')]=_0x99f032[_0x8c8a('0x25')];_0x362438['text']=_0x29b75e[_0x8c8a('0xe')];_0x362438[_0x8c8a('0x61')]=+new Date();var _0x5bb174='';var _0x54acb6='';var _0x4dd04f=Object[_0x8c8a('0x62')](_0x362438);_0x4dd04f[_0x8c8a('0x63')]();for(var _0x57b939=0x0;_0x57b939<_0x4dd04f[_0x8c8a('0x64')];_0x57b939++){if(_0x5bb174!=''){_0x5bb174+='&';}_0x5bb174+=_0x4dd04f[_0x57b939]+'='+encodeURIComponent(_0x362438[_0x4dd04f[_0x57b939]]);_0x54acb6+=_0x362438[_0x4dd04f[_0x57b939]];}_0x54acb6+=_0x99f032[_0x8c8a('0x5e')];_0x54acb6=_0x2f4a22['createHash']('md5')[_0x8c8a('0x1a')](_0x54acb6)[_0x8c8a('0x65')](_0x8c8a('0x66'));if(_0x5bb174!==''){_0x5bb174+='&';}_0x5bb174+=_0x8c8a('0x67')+_0x54acb6;var _0x3387e7={'method':_0x8c8a('0x68'),'uri':_0x99f032['baseUrl']+_0x8c8a('0x69')+_0x5bb174,'json':!![]};return rp(_0x3387e7)[_0x8c8a('0x19')](function(_0x55ffac){var _0x10fa20=Object['keys'](_0x55ffac);if(_0x55ffac[_0x10fa20[0x0]][_0x8c8a('0x1d')]&&parseInt(_0x55ffac[_0x10fa20[0x0]][_0x8c8a('0x1d')])===0x0){var _0x147bb5={'messageId':_0x55ffac[_0x10fa20[0x0]][_0x8c8a('0x6a')]};if(!_0x99f032[_0x8c8a('0x3b')]){_0x147bb5[_0x8c8a('0x3c')]=!![];}return _0x47581f['update'](_0x147bb5);}else{return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x5c'),util['inspect'](_0x55ffac[_0x8c8a('0x1d')],{'showHidden':![],'depth':null}));}})[_0x8c8a('0x1c')](function(_0x176c4e){return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x5c'),util[_0x8c8a('0x3d')](_0x176c4e,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'csc','Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x99f032[_0x8c8a('0x5e')]){var _0x381fe1={'method':_0x8c8a('0x36'),'uri':_0x8c8a('0x6b'),'headers':{'Authorization':_0x99f032[_0x8c8a('0x5e')]},'body':{'content':_0x29b75e['body'],'to':[_0x29b75e[_0x8c8a('0x25')]],'from':_0x99f032[_0x8c8a('0x25')],'binary':![],'clientMessageId':'uuid','charset':_0x8c8a('0x6c')},'json':!![]};rp(_0x381fe1)[_0x8c8a('0x19')](function(_0x4ddd16){if(!_0x4ddd16[_0x8c8a('0x1d')]){var _0x3ed484={'messageId':_0x4ddd16[_0x8c8a('0x26')][0x0][_0x8c8a('0x6d')]};if(!_0x99f032[_0x8c8a('0x3b')]){_0x3ed484['read']=!![];}return _0x47581f[_0x8c8a('0x1a')](_0x3ed484);}else{return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x6e'),util[_0x8c8a('0x3d')](_0x4ddd16[_0x8c8a('0x1d')],{'showHidden':![],'depth':null}));}})[_0x8c8a('0x1c')](function(_0xa882c9){return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x6e'),util[_0x8c8a('0x3d')](_0xa882c9,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x6e'),'Missing\x20parameters:\x20apiKey');}break;case _0x8c8a('0x6f'):if(_0x99f032[_0x8c8a('0x30')]&&_0x99f032['password']){var _0xa7f51b=util[_0x8c8a('0x46')](_0x8c8a('0x47'),_0x99f032[_0x8c8a('0x30')],_0x99f032[_0x8c8a('0x31')]);var _0x544ad7={'method':_0x8c8a('0x36'),'uri':_0x8c8a('0x70')+_0x99f032[_0x8c8a('0x71')]+_0x8c8a('0x72'),'body':{'to':[_0x29b75e[_0x8c8a('0x25')]],'text':_0x29b75e[_0x8c8a('0xe')],'from':_0x99f032[_0x8c8a('0x25')],'applicationId':_0x99f032['applicationId']},'headers':{'Authorization':util[_0x8c8a('0x46')](_0x8c8a('0x48'),new Buffer(_0xa7f51b)[_0x8c8a('0x49')](_0x8c8a('0x4a')))},'json':!![]};rp(_0x544ad7)[_0x8c8a('0x19')](function(_0x3e6d67){if(_0x3e6d67['id']){var _0x2a5849={'messageId':_0x3e6d67['id']};return _0x47581f[_0x8c8a('0x1a')](_0x2a5849);}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x6f'),util['inspect'](_0x3e6d67,{'showHidden':![],'depth':null}));}})[_0x8c8a('0x1c')](function(_0x372fb7){logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),'bandwidth',util['inspect'](_0x372fb7,{'showHidden':![],'depth':null}));});}else{logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x6f'),_0x8c8a('0x3e'));}break;case'intelepeer':if(_0x99f032[_0x8c8a('0x5e')]){var _0x30cee2={};var _0x3387e7={'method':_0x8c8a('0x36'),'uri':_0x8c8a('0x73'),'headers':{'Authorization':_0x8c8a('0x74')+_0x99f032[_0x8c8a('0x5e')],'Content-Type':_0x8c8a('0x58')},'body':{'from':_0x99f032[_0x8c8a('0x25')],'to':_0x29b75e[_0x8c8a('0x25')],'text':_0x29b75e[_0x8c8a('0xe')]},'json':!![]};return rp(_0x3387e7)['then'](function(_0x266410){if(_0x266410[_0x8c8a('0x75')]==0xca){_0x30cee2[_0x8c8a('0x76')]=_0x266410;var _0x41d948={'method':_0x8c8a('0x36'),'uri':_0x8c8a('0x77'),'headers':{'Authorization':_0x8c8a('0x74')+_0x99f032['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x30cee2[_0x8c8a('0x76')][_0x8c8a('0x78')]},'json':!![]};return rp(_0x41d948)[_0x8c8a('0x19')](function(_0x127f70){_0x30cee2[_0x8c8a('0x79')]=_0x127f70;var _0x427d04={'messageId':_0x30cee2['message'][_0x8c8a('0x78')],'read':!![]};return _0x47581f[_0x8c8a('0x1a')](_0x427d04);});}else{return logger[_0x8c8a('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8c8a('0x2c'),_0x8c8a('0x7a'),util[_0x8c8a('0x3d')](_0x266410,{'showHidden':![],'depth':null}));}})[_0x8c8a('0x1c')](function(_0x147256){return logger[_0x8c8a('0x1d')](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x7a'),util[_0x8c8a('0x3d')](_0x147256,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x8c8a('0x2b'),_0x8c8a('0x2c'),_0x8c8a('0x7a'),_0x8c8a('0x7b'));}break;}}})[_0x8c8a('0x7c')](function(){_0x50933a();});}else{_0x50933a();}}},'charset':_0x8c8a('0x7d'),'collate':_0x8c8a('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 1c8cbbd..380d674 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 _0x2eca=['message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0x2eca,0x144));var _0xa2ec=function(_0x441db3,_0x10f359){_0x441db3=_0x441db3-0x0;var _0x16c05d=_0x2eca[_0x441db3];return _0x16c05d;};'use strict';var _=require(_0xa2ec('0x0'));var util=require(_0xa2ec('0x1'));var moment=require(_0xa2ec('0x2'));var BPromise=require(_0xa2ec('0x3'));var rs=require(_0xa2ec('0x4'));var fs=require('fs');var Redis=require(_0xa2ec('0x5'));var db=require(_0xa2ec('0x6'))['db'];var utils=require(_0xa2ec('0x7'));var logger=require(_0xa2ec('0x8'))(_0xa2ec('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa2ec('0xa')][_0xa2ec('0xb')]({'port':0x232a});config[_0xa2ec('0xc')]=_[_0xa2ec('0xd')](config['redis'],{'host':_0xa2ec('0xe'),'port':0x18eb});var socket=require(_0xa2ec('0xf'))(new Redis(config[_0xa2ec('0xc')]));require(_0xa2ec('0x10'))[_0xa2ec('0x11')](socket);function respondWithRpcPromise(_0x34af41,_0x291f53,_0x7f1656){return new BPromise(function(_0x3a4204,_0x158283){return client[_0xa2ec('0x12')](_0x34af41,_0x7f1656)[_0xa2ec('0x13')](function(_0x440fc6){logger['info'](_0xa2ec('0x14'),_0x291f53,'request\x20sent');logger[_0xa2ec('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x291f53,_0xa2ec('0x16'),JSON[_0xa2ec('0x17')](_0x440fc6));if(_0x440fc6[_0xa2ec('0x18')]){if(_0x440fc6[_0xa2ec('0x18')][_0xa2ec('0x19')]===0x1f4){logger['error'](_0xa2ec('0x14'),_0x291f53,_0x440fc6['error'][_0xa2ec('0x1a')]);return _0x158283(_0x440fc6['error'][_0xa2ec('0x1a')]);}logger[_0xa2ec('0x18')](_0xa2ec('0x14'),_0x291f53,_0x440fc6[_0xa2ec('0x18')][_0xa2ec('0x1a')]);return _0x3a4204(_0x440fc6[_0xa2ec('0x18')][_0xa2ec('0x1a')]);}else{logger[_0xa2ec('0x1b')](_0xa2ec('0x14'),_0x291f53,_0xa2ec('0x16'));_0x3a4204(_0x440fc6[_0xa2ec('0x1c')][_0xa2ec('0x1a')]);}})[_0xa2ec('0x1d')](function(_0x2b9d63){logger[_0xa2ec('0x18')](_0xa2ec('0x14'),_0x291f53,_0x2b9d63);_0x158283(_0x2b9d63);});});}exports[_0xa2ec('0x1e')]=function(_0x3dee7c){var _0x2cac6e=this;return new Promise(function(_0x39636f,_0x37c6fb){return db[_0xa2ec('0x1f')][_0xa2ec('0x20')](_0x3dee7c[_0xa2ec('0x21')],{'raw':_0x3dee7c['options']?_0x3dee7c[_0xa2ec('0x22')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21ab79){logger[_0xa2ec('0x1b')](_0xa2ec('0x1e'),_0x3dee7c);logger['debug'](_0xa2ec('0x1e'),_0x3dee7c,JSON['stringify'](_0x21ab79));_0x39636f(_0x21ab79);})['catch'](function(_0x4ca0a5){logger[_0xa2ec('0x18')](_0xa2ec('0x1e'),_0x4ca0a5[_0xa2ec('0x1a')],_0x3dee7c);_0x37c6fb(_0x2cac6e[_0xa2ec('0x18')](0x1f4,_0x4ca0a5['message']));});});}; \ No newline at end of file +var _0x6b9f=['socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsMessage','SmsMessage','create','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x6b9f,0x116));var _0xf6b9=function(_0x2b2c9d,_0x5a411d){_0x2b2c9d=_0x2b2c9d-0x0;var _0x18ea24=_0x6b9f[_0x2b2c9d];return _0x18ea24;};'use strict';var _=require(_0xf6b9('0x0'));var util=require(_0xf6b9('0x1'));var moment=require('moment');var BPromise=require(_0xf6b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6b9('0x3'));var db=require(_0xf6b9('0x4'))['db'];var utils=require(_0xf6b9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf6b9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf6b9('0x7')][_0xf6b9('0x8')]({'port':0x232a});config[_0xf6b9('0x9')]=_[_0xf6b9('0xa')](config['redis'],{'host':_0xf6b9('0xb'),'port':0x18eb});var socket=require(_0xf6b9('0xc'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x137488,_0x399c63,_0x3b5d6d){return new BPromise(function(_0x55a337,_0x2885ff){return client[_0xf6b9('0xd')](_0x137488,_0x3b5d6d)[_0xf6b9('0xe')](function(_0x364276){logger[_0xf6b9('0xf')](_0xf6b9('0x10'),_0x399c63,_0xf6b9('0x11'));logger[_0xf6b9('0x12')](_0xf6b9('0x13'),_0x399c63,_0xf6b9('0x11'),JSON['stringify'](_0x364276));if(_0x364276[_0xf6b9('0x14')]){if(_0x364276[_0xf6b9('0x14')][_0xf6b9('0x15')]===0x1f4){logger[_0xf6b9('0x14')](_0xf6b9('0x10'),_0x399c63,_0x364276[_0xf6b9('0x14')][_0xf6b9('0x16')]);return _0x2885ff(_0x364276[_0xf6b9('0x14')][_0xf6b9('0x16')]);}logger['error'](_0xf6b9('0x10'),_0x399c63,_0x364276['error'][_0xf6b9('0x16')]);return _0x55a337(_0x364276[_0xf6b9('0x14')][_0xf6b9('0x16')]);}else{logger[_0xf6b9('0xf')](_0xf6b9('0x10'),_0x399c63,_0xf6b9('0x11'));_0x55a337(_0x364276['result']['message']);}})[_0xf6b9('0x17')](function(_0x125ec1){logger['error'](_0xf6b9('0x10'),_0x399c63,_0x125ec1);_0x2885ff(_0x125ec1);});});}exports[_0xf6b9('0x18')]=function(_0x2e0eb6){var _0x2b6d99=this;return new Promise(function(_0x19c357,_0x5afdd7){return db[_0xf6b9('0x19')][_0xf6b9('0x1a')](_0x2e0eb6['body'],{'raw':_0x2e0eb6[_0xf6b9('0x1b')]?_0x2e0eb6['options'][_0xf6b9('0x1c')]===undefined?!![]:![]:!![]})[_0xf6b9('0xe')](function(_0x5242b1){logger[_0xf6b9('0xf')](_0xf6b9('0x18'),_0x2e0eb6);logger[_0xf6b9('0x12')]('CreateSmsMessage',_0x2e0eb6,JSON['stringify'](_0x5242b1));_0x19c357(_0x5242b1);})[_0xf6b9('0x17')](function(_0x262f73){logger['error']('CreateSmsMessage',_0x262f73[_0xf6b9('0x16')],_0x2e0eb6);_0x5afdd7(_0x2b6d99[_0xf6b9('0x14')](0x1f4,_0x262f73[_0xf6b9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 88d2485..30610bb 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 _0xd0dc=['emit','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x153ebe,_0x248c17){var _0x485fe8=function(_0x1a88ec){while(--_0x1a88ec){_0x153ebe['push'](_0x153ebe['shift']());}};_0x485fe8(++_0x248c17);}(_0xd0dc,0xc1));var _0xcd0d=function(_0x312a7f,_0x509e83){_0x312a7f=_0x312a7f-0x0;var _0x2fb5ba=_0xd0dc[_0x312a7f];return _0x2fb5ba;};'use strict';var SmsMessageEvents=require(_0xcd0d('0x0'));var events=[_0xcd0d('0x1'),_0xcd0d('0x2'),'update'];function createListener(_0x4b8e02,_0x52f930){return function(_0x5dbcbe){_0x52f930[_0xcd0d('0x3')](_0x4b8e02,_0x5dbcbe);};}function removeListener(_0x35d0a6,_0x13c2f0){return function(){SmsMessageEvents['removeListener'](_0x35d0a6,_0x13c2f0);};}exports[_0xcd0d('0x4')]=function(_0x45e5b0){for(var _0x1e2cf3=0x0,_0x4aa68f=events[_0xcd0d('0x5')];_0x1e2cf3<_0x4aa68f;_0x1e2cf3++){var _0x151175=events[_0x1e2cf3];var _0x203765=createListener(_0xcd0d('0x6')+_0x151175,_0x45e5b0);SmsMessageEvents['on'](_0x151175,_0x203765);}}; \ No newline at end of file +var _0x7515=['smsMessage:','./smsMessage.events','remove','removeListener','register'];(function(_0x43a430,_0x12cfd1){var _0x4e73da=function(_0x1ec4f7){while(--_0x1ec4f7){_0x43a430['push'](_0x43a430['shift']());}};_0x4e73da(++_0x12cfd1);}(_0x7515,0x1aa));var _0x5751=function(_0x254857,_0xd3bee9){_0x254857=_0x254857-0x0;var _0x439b1b=_0x7515[_0x254857];return _0x439b1b;};'use strict';var SmsMessageEvents=require(_0x5751('0x0'));var events=['save',_0x5751('0x1'),'update'];function createListener(_0x505c6b,_0x27900f){return function(_0x25b149){_0x27900f['emit'](_0x505c6b,_0x25b149);};}function removeListener(_0x5bb3f5,_0x395f67){return function(){SmsMessageEvents[_0x5751('0x2')](_0x5bb3f5,_0x395f67);};}exports[_0x5751('0x3')]=function(_0x27dadc){for(var _0x24ba07=0x0,_0x479de5=events['length'];_0x24ba07<_0x479de5;_0x24ba07++){var _0x111f6c=events[_0x24ba07];var _0x959901=createListener(_0x5751('0x4')+_0x111f6c,_0x27dadc);SmsMessageEvents['on'](_0x111f6c,_0x959901);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 51be340..f7b1a01 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 _0x5c06=['get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller'];(function(_0x134ad3,_0x165e06){var _0x1ca07e=function(_0x401063){while(--_0x401063){_0x134ad3['push'](_0x134ad3['shift']());}};_0x1ca07e(++_0x165e06);}(_0x5c06,0x6c));var _0x65c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5c06[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x65c0('0x0'));var util=require('util');var path=require(_0x65c0('0x1'));var timeout=require(_0x65c0('0x2'));var express=require(_0x65c0('0x3'));var router=express['Router']();var fs_extra=require(_0x65c0('0x4'));var auth=require(_0x65c0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65c0('0x6'));var controller=require(_0x65c0('0x7'));router[_0x65c0('0x8')]('/',auth[_0x65c0('0x9')](),controller[_0x65c0('0xa')]);router['get'](_0x65c0('0xb'),auth['isAuthenticated'](),controller[_0x65c0('0xc')]);router[_0x65c0('0x8')](_0x65c0('0xd'),auth[_0x65c0('0x9')](),controller['show']);router['get'](_0x65c0('0xe'),auth[_0x65c0('0x9')](),controller[_0x65c0('0xf')]);router[_0x65c0('0x8')](_0x65c0('0x10'),auth[_0x65c0('0x9')](),controller[_0x65c0('0x11')]);router[_0x65c0('0x8')](_0x65c0('0x12'),auth[_0x65c0('0x9')](),controller[_0x65c0('0x13')]);router[_0x65c0('0x14')]('/',auth[_0x65c0('0x9')](),controller[_0x65c0('0x15')]);router[_0x65c0('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x65c0('0x16')]);router[_0x65c0('0x14')]('/:id/users',auth[_0x65c0('0x9')](),controller[_0x65c0('0x17')]);router['put'](_0x65c0('0xd'),auth[_0x65c0('0x9')](),controller[_0x65c0('0x18')]);router[_0x65c0('0x19')](_0x65c0('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x65c0('0x19')](_0x65c0('0x10'),auth[_0x65c0('0x9')](),controller[_0x65c0('0x1a')]);router[_0x65c0('0x19')](_0x65c0('0x12'),auth[_0x65c0('0x9')](),controller[_0x65c0('0x1b')]);module[_0x65c0('0x1c')]=router; \ No newline at end of file +var _0xbf4b=['/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','/:id','/:id/members','/:id/teams','getTeams','post','create','addTeams'];(function(_0x3bf489,_0x4028e3){var _0x136b9e=function(_0x1d4b52){while(--_0x1d4b52){_0x3bf489['push'](_0x3bf489['shift']());}};_0x136b9e(++_0x4028e3);}(_0xbf4b,0x99));var _0xbbf4=function(_0x2a24b2,_0x171540){_0x2a24b2=_0x2a24b2-0x0;var _0x2ed7d3=_0xbf4b[_0x2a24b2];return _0x2ed7d3;};'use strict';var multer=require(_0xbbf4('0x0'));var util=require(_0xbbf4('0x1'));var path=require('path');var timeout=require(_0xbbf4('0x2'));var express=require(_0xbbf4('0x3'));var router=express[_0xbbf4('0x4')]();var fs_extra=require(_0xbbf4('0x5'));var auth=require(_0xbbf4('0x6'));var interaction=require(_0xbbf4('0x7'));var config=require(_0xbbf4('0x8'));var controller=require(_0xbbf4('0x9'));router['get']('/',auth[_0xbbf4('0xa')](),controller[_0xbbf4('0xb')]);router[_0xbbf4('0xc')](_0xbbf4('0xd'),auth[_0xbbf4('0xa')](),controller['describe']);router[_0xbbf4('0xc')](_0xbbf4('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbbf4('0xc')](_0xbbf4('0xf'),auth[_0xbbf4('0xa')](),controller['getMembers']);router[_0xbbf4('0xc')](_0xbbf4('0x10'),auth['isAuthenticated'](),controller[_0xbbf4('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xbbf4('0x12')]('/',auth['isAuthenticated'](),controller[_0xbbf4('0x13')]);router[_0xbbf4('0x12')]('/:id/teams',auth[_0xbbf4('0xa')](),controller[_0xbbf4('0x14')]);router[_0xbbf4('0x12')](_0xbbf4('0x15'),auth[_0xbbf4('0xa')](),controller[_0xbbf4('0x16')]);router[_0xbbf4('0x17')]('/:id',auth[_0xbbf4('0xa')](),controller[_0xbbf4('0x18')]);router['delete'](_0xbbf4('0xe'),auth['isAuthenticated'](),controller[_0xbbf4('0x19')]);router[_0xbbf4('0x1a')](_0xbbf4('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xbbf4('0x1a')](_0xbbf4('0x15'),auth['isAuthenticated'](),controller[_0xbbf4('0x1b')]);module[_0xbbf4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index b9f8c39..0aeafa7 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 _0xc3f5=['INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0xc3f5,0x71));var _0x5c3f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc3f5[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x5c3f('0x0'));module[_0x5c3f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5c3f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c3f('0x3')](_0x5c3f('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x1ab1=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x1ab1,0x192));var _0x11ab=function(_0xeab56e,_0x2bcc33){_0xeab56e=_0xeab56e-0x0;var _0x36c60c=_0x1ab1[_0xeab56e];return _0x36c60c;};'use strict';var Sequelize=require('sequelize');module[_0x11ab('0x0')]={'name':{'type':Sequelize[_0x11ab('0x1')],'unique':_0x11ab('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x11ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x11ab('0x4'),_0x11ab('0x5'),_0x11ab('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a014871..ba738bd 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 _0x0309=['includes','union','isEmpty','removeAgents','userSmsQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','sendStatus','error','stack','name','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','SmsQueueId','User','UserId','agent','smsPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','ids','online','voicePause','interface','flatMap','transaction','addTeams','each','UserSmsQueue','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT'];(function(_0x5e7176,_0xc0a402){var _0x40ca1d=function(_0x9f25b2){while(--_0x9f25b2){_0x5e7176['push'](_0x5e7176['shift']());}};_0x40ca1d(++_0xc0a402);}(_0x0309,0x8d));var _0x9030=function(_0x522bcf,_0x290caf){_0x522bcf=_0x522bcf-0x0;var _0x4b5453=_0x0309[_0x522bcf];return _0x4b5453;};'use strict';var emlformat=require(_0x9030('0x0'));var rimraf=require(_0x9030('0x1'));var zipdir=require(_0x9030('0x2'));var jsonpatch=require(_0x9030('0x3'));var rp=require(_0x9030('0x4'));var moment=require('moment');var BPromise=require(_0x9030('0x5'));var Mustache=require(_0x9030('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9030('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9030('0x8'));var squel=require('squel');var crypto=require(_0x9030('0x9'));var jsforce=require(_0x9030('0xa'));var deskjs=require(_0x9030('0xb'));var toCsv=require(_0x9030('0xc'));var querystring=require(_0x9030('0xd'));var Papa=require(_0x9030('0xe'));var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9030('0x12'));var logger=require('../../config/logger')(_0x9030('0x13'));var utils=require(_0x9030('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9030('0x15'));var db=require('../../mysqldb')['db'];config[_0x9030('0x16')]=_['defaults'](config[_0x9030('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9030('0x17'))(new Redis(config[_0x9030('0x16')]));require(_0x9030('0x18'))[_0x9030('0x19')](socket);function respondWithStatusCode(_0x551021,_0x5a879a){_0x5a879a=_0x5a879a||0xcc;return function(_0x5f0f25){if(_0x5f0f25){return _0x551021['sendStatus'](_0x5a879a);}return _0x551021[_0x9030('0x1a')](_0x5a879a)[_0x9030('0x1b')]();};}function respondWithResult(_0x4b8351,_0x3895d0){_0x3895d0=_0x3895d0||0xc8;return function(_0xccfccb){if(_0xccfccb){return _0x4b8351['status'](_0x3895d0)[_0x9030('0x1c')](_0xccfccb);}};}function respondWithFilteredResult(_0x4bc394,_0x43016c){return function(_0x4960fd){if(_0x4960fd){var _0x5802bd=typeof _0x43016c[_0x9030('0x1d')]===_0x9030('0x1e')&&typeof _0x43016c[_0x9030('0x1f')]===_0x9030('0x1e');var _0x42207a=_0x4960fd[_0x9030('0x20')];var _0x3207ad=_0x5802bd?0x0:_0x43016c['offset'];var _0x19ef2a=_0x5802bd?_0x4960fd[_0x9030('0x20')]:_0x43016c[_0x9030('0x1d')]+_0x43016c[_0x9030('0x1f')];var _0x56c9a5;if(_0x19ef2a>=_0x42207a){_0x19ef2a=_0x42207a;_0x56c9a5=0xc8;}else{_0x56c9a5=0xce;}_0x4bc394[_0x9030('0x1a')](_0x56c9a5);return _0x4bc394['set']('Content-Range',_0x3207ad+'-'+_0x19ef2a+'/'+_0x42207a)[_0x9030('0x1c')](_0x4960fd);}return null;};}function patchUpdates(_0x350ef3){return function(_0x55d3a7){try{jsonpatch[_0x9030('0x21')](_0x55d3a7,_0x350ef3,!![]);}catch(_0x2c26ed){return BPromise[_0x9030('0x22')](_0x2c26ed);}return _0x55d3a7[_0x9030('0x23')]();};}function saveUpdates(_0x2cb254,_0x3fd61d){return function(_0x359900){if(_0x359900){return _0x359900[_0x9030('0x24')](_0x2cb254)[_0x9030('0x25')](function(_0x46f19c){return _0x46f19c;});}return null;};}function removeEntity(_0x1ae92e,_0x53dbc2){return function(_0xe7e11a){if(_0xe7e11a){return _0xe7e11a[_0x9030('0x26')]()['then'](function(){var _0x1761ee=_0xe7e11a['get']({'plain':!![]});var _0x249b66=_0x9030('0x27');return db[_0x9030('0x28')]['destroy']({'where':{'type':_0x249b66,'resourceId':_0x1761ee['id']}})[_0x9030('0x25')](function(){return _0xe7e11a;});})['then'](function(){_0x1ae92e['status'](0xcc)[_0x9030('0x1b')]();});}};}function handleEntityNotFound(_0x3af16a,_0x1afa08){return function(_0x5328c5){if(!_0x5328c5){_0x3af16a[_0x9030('0x29')](0x194);}return _0x5328c5;};}function handleError(_0x5245a7,_0x494a77){_0x494a77=_0x494a77||0x1f4;return function(_0x51da2a){logger[_0x9030('0x2a')](_0x51da2a[_0x9030('0x2b')]);if(_0x51da2a[_0x9030('0x2c')]){delete _0x51da2a['name'];}_0x5245a7[_0x9030('0x1a')](_0x494a77)['send'](_0x51da2a);};}exports[_0x9030('0x2d')]=function(_0xbed7eb,_0x1f6355){var _0xcff932={},_0x546d55={},_0x4a5c20={'count':0x0,'rows':[]};var _0x43b6c2=_['map'](db[_0x9030('0x2e')][_0x9030('0x2f')],function(_0x239c50){return{'name':_0x239c50[_0x9030('0x30')],'type':_0x239c50[_0x9030('0x31')][_0x9030('0x32')]};});_0x546d55[_0x9030('0x33')]=_['map'](_0x43b6c2,'name');_0x546d55[_0x9030('0x34')]=_[_0x9030('0x35')](_0xbed7eb['query']);_0x546d55[_0x9030('0x36')]=_[_0x9030('0x37')](_0x546d55[_0x9030('0x33')],_0x546d55[_0x9030('0x34')]);_0xcff932[_0x9030('0x38')]=_[_0x9030('0x37')](_0x546d55[_0x9030('0x33')],qs['fields'](_0xbed7eb[_0x9030('0x34')][_0x9030('0x39')]));_0xcff932[_0x9030('0x38')]=_0xcff932['attributes'][_0x9030('0x3a')]?_0xcff932[_0x9030('0x38')]:_0x546d55[_0x9030('0x33')];if(!_0xbed7eb[_0x9030('0x34')][_0x9030('0x3b')](_0x9030('0x3c'))){_0xcff932['limit']=qs[_0x9030('0x1f')](_0xbed7eb['query']['limit']);_0xcff932['offset']=qs['offset'](_0xbed7eb['query'][_0x9030('0x1d')]);}_0xcff932[_0x9030('0x3d')]=qs[_0x9030('0x3e')](_0xbed7eb[_0x9030('0x34')][_0x9030('0x3e')]);_0xcff932[_0x9030('0x3f')]=qs[_0x9030('0x36')](_[_0x9030('0x40')](_0xbed7eb[_0x9030('0x34')],_0x546d55[_0x9030('0x36')]),_0x43b6c2);if(_0xbed7eb['query']['filter']){_0xcff932[_0x9030('0x3f')]=_[_0x9030('0x41')](_0xcff932['where'],{'$or':_[_0x9030('0x42')](_0x43b6c2,function(_0x1dcd29){if(_0x1dcd29[_0x9030('0x31')]!=='VIRTUAL'){var _0x1d436b={};_0x1d436b[_0x1dcd29[_0x9030('0x2c')]]={'$like':'%'+_0xbed7eb[_0x9030('0x34')][_0x9030('0x43')]+'%'};return _0x1d436b;}})});}_0xcff932=_[_0x9030('0x41')]({},_0xcff932,_0xbed7eb[_0x9030('0x44')]);var _0x5236a8={'where':_0xcff932[_0x9030('0x3f')]};return db[_0x9030('0x2e')][_0x9030('0x20')](_0x5236a8)[_0x9030('0x25')](function(_0x5c95ec){_0x4a5c20['count']=_0x5c95ec;if(_0xbed7eb[_0x9030('0x34')][_0x9030('0x45')]){_0xcff932[_0x9030('0x46')]=[{'all':!![]}];}return db[_0x9030('0x2e')][_0x9030('0x47')](_0xcff932);})[_0x9030('0x25')](function(_0x2b14cd){_0x4a5c20[_0x9030('0x48')]=_0x2b14cd;return _0x4a5c20;})[_0x9030('0x25')](respondWithFilteredResult(_0x1f6355,_0xcff932))[_0x9030('0x49')](handleError(_0x1f6355,null));};exports[_0x9030('0x4a')]=function(_0x33836e,_0x1f0e49){var _0x218c51={'raw':!![],'where':{'id':_0x33836e[_0x9030('0x4b')]['id']}},_0x1d9211={};_0x1d9211['model']=_['keys'](db[_0x9030('0x2e')]['rawAttributes']);_0x1d9211[_0x9030('0x34')]=_[_0x9030('0x35')](_0x33836e[_0x9030('0x34')]);_0x1d9211[_0x9030('0x36')]=_['intersection'](_0x1d9211[_0x9030('0x33')],_0x1d9211[_0x9030('0x34')]);_0x218c51[_0x9030('0x38')]=_['intersection'](_0x1d9211[_0x9030('0x33')],qs[_0x9030('0x39')](_0x33836e['query']['fields']));_0x218c51['attributes']=_0x218c51[_0x9030('0x38')][_0x9030('0x3a')]?_0x218c51[_0x9030('0x38')]:_0x1d9211[_0x9030('0x33')];if(_0x33836e[_0x9030('0x34')]['includeAll']){_0x218c51[_0x9030('0x46')]=[{'all':!![]}];}_0x218c51=_[_0x9030('0x41')]({},_0x218c51,_0x33836e[_0x9030('0x44')]);return db[_0x9030('0x2e')][_0x9030('0x4c')](_0x218c51)['then'](handleEntityNotFound(_0x1f0e49,null))[_0x9030('0x25')](respondWithResult(_0x1f0e49,null))['catch'](handleError(_0x1f0e49,null));};exports[_0x9030('0x4d')]=function(_0x4df4d5,_0x3023b9){return db[_0x9030('0x2e')][_0x9030('0x4d')](_0x4df4d5[_0x9030('0x4e')],{})[_0x9030('0x25')](function(_0x55c8b8){var _0x524da6=_0x4df4d5[_0x9030('0x4f')][_0x9030('0x50')]({'plain':!![]});if(!_0x524da6)throw new Error(_0x9030('0x51'));if(_0x524da6[_0x9030('0x52')]===_0x9030('0x4f')){var _0x587e6a=_0x55c8b8[_0x9030('0x50')]({'plain':!![]});var _0x52d097=_0x9030('0x27');return db[_0x9030('0x53')]['find']({'where':{'name':_0x52d097,'userProfileId':_0x524da6['userProfileId']},'raw':!![]})[_0x9030('0x25')](function(_0x3e6c7c){if(_0x3e6c7c&&_0x3e6c7c[_0x9030('0x54')]===0x0){return db[_0x9030('0x28')][_0x9030('0x4d')]({'name':_0x587e6a[_0x9030('0x2c')],'resourceId':_0x587e6a['id'],'type':_0x3e6c7c[_0x9030('0x2c')],'sectionId':_0x3e6c7c['id']},{})[_0x9030('0x25')](function(){return _0x55c8b8;});}else{return _0x55c8b8;}})[_0x9030('0x49')](function(_0x5c030b){logger[_0x9030('0x2a')](_0x9030('0x55'),_0x5c030b);throw _0x5c030b;});}return _0x55c8b8;})['then'](respondWithResult(_0x3023b9,0xc9))[_0x9030('0x49')](handleError(_0x3023b9,null));};exports[_0x9030('0x24')]=function(_0x4acda3,_0x59d701){if(_0x4acda3[_0x9030('0x4e')]['id']){delete _0x4acda3[_0x9030('0x4e')]['id'];}return db[_0x9030('0x2e')][_0x9030('0x4c')]({'where':{'id':_0x4acda3[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x59d701,null))[_0x9030('0x25')](saveUpdates(_0x4acda3['body'],null))[_0x9030('0x25')](respondWithResult(_0x59d701,null))[_0x9030('0x49')](handleError(_0x59d701,null));};exports['destroy']=function(_0x196b71,_0x419693){return db[_0x9030('0x2e')]['find']({'where':{'id':_0x196b71[_0x9030('0x4b')]['id']}})['then'](handleEntityNotFound(_0x419693,null))['then'](removeEntity(_0x419693,null))['catch'](handleError(_0x419693,null));};exports['describe']=function(_0x595e04,_0x2e7742){return db[_0x9030('0x2e')]['describe']()[_0x9030('0x25')](respondWithResult(_0x2e7742,null))[_0x9030('0x49')](handleError(_0x2e7742,null));};exports[_0x9030('0x56')]=function(_0x1049e3,_0x5f1af9,_0x44d0b3){var _0x4b21f0={'raw':!![],'where':{}},_0x919d6f={},_0x8fe0d1;return db[_0x9030('0x2e')][_0x9030('0x57')]({'where':{'id':_0x1049e3[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x5f1af9,null))[_0x9030('0x25')](function(_0x1bb35a){if(_0x1bb35a){_0x8fe0d1=_0x1bb35a[_0x9030('0x50')]({'plain':!![]});_0x919d6f[_0x9030('0x33')]=_[_0x9030('0x35')](db['UserSmsQueue'][_0x9030('0x2f')]);_0x919d6f[_0x9030('0x34')]=_[_0x9030('0x35')](_0x1049e3[_0x9030('0x34')]);_0x919d6f[_0x9030('0x36')]=_[_0x9030('0x37')](_0x919d6f[_0x9030('0x33')],_0x919d6f['query']);_0x4b21f0[_0x9030('0x38')]=_[_0x9030('0x37')](_0x919d6f[_0x9030('0x33')],qs[_0x9030('0x39')](_0x1049e3[_0x9030('0x34')][_0x9030('0x39')]));_0x4b21f0[_0x9030('0x38')]=_0x4b21f0[_0x9030('0x38')][_0x9030('0x3a')]?_0x4b21f0[_0x9030('0x38')]:_0x919d6f[_0x9030('0x33')];if(!_0x1049e3[_0x9030('0x34')]['hasOwnProperty'](_0x9030('0x3c'))){_0x4b21f0['limit']=qs['limit'](_0x1049e3[_0x9030('0x34')][_0x9030('0x1f')]);_0x4b21f0[_0x9030('0x1d')]=qs[_0x9030('0x1d')](_0x1049e3[_0x9030('0x34')][_0x9030('0x1d')]);}_0x4b21f0[_0x9030('0x3d')]=qs[_0x9030('0x3e')](_0x1049e3[_0x9030('0x34')][_0x9030('0x3e')]);_0x4b21f0[_0x9030('0x3f')]=qs['filters'](_[_0x9030('0x40')](_0x1049e3[_0x9030('0x34')],_0x919d6f[_0x9030('0x36')]));_0x4b21f0[_0x9030('0x3f')][_0x9030('0x58')]=_0x1bb35a['id'];if(_0x1049e3[_0x9030('0x34')][_0x9030('0x43')]){_0x4b21f0['where']=_[_0x9030('0x41')](_0x4b21f0[_0x9030('0x3f')],{'$or':_[_0x9030('0x42')](_0x4b21f0[_0x9030('0x38')],function(_0x2a514f){var _0x1aa600={};_0x1aa600[_0x2a514f]={'$like':'%'+_0x1049e3[_0x9030('0x34')][_0x9030('0x43')]+'%'};return _0x1aa600;})});}_0x4b21f0=_[_0x9030('0x41')]({},_0x4b21f0,_0x1049e3[_0x9030('0x44')]);return db['UserSmsQueue'][_0x9030('0x47')](_0x4b21f0);}})[_0x9030('0x25')](function(_0x507b0c){if(_0x507b0c){return db[_0x9030('0x59')]['findAndCountAll']({'where':{'id':_[_0x9030('0x42')](_0x507b0c,_0x9030('0x5a')),'role':_0x9030('0x5b')},'attributes':['id',_0x9030('0x2c'),_0x9030('0x5c'),'updatedAt','createdAt']});}})[_0x9030('0x25')](function(_0x24fc5a){if(_0x24fc5a){return{'count':_0x24fc5a[_0x9030('0x20')],'rows':_['map'](_0x24fc5a[_0x9030('0x48')],function(_0x17f841){return{'membername':_0x17f841[_0x9030('0x2c')],'UserId':_0x17f841['id'],'queue_name':_0x8fe0d1[_0x9030('0x2c')],'SmsQueueId':_0x8fe0d1['id'],'interface':util[_0x9030('0x5d')](_0x9030('0x5e'),_0x9030('0x5f'),_0x17f841[_0x9030('0x2c')]),'penalty':0x0,'paused':_0x17f841[_0x9030('0x5c')],'createdAt':_0x17f841[_0x9030('0x60')],'updatedAt':_0x17f841[_0x9030('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9030('0x25')](respondWithFilteredResult(_0x5f1af9,_0x4b21f0))[_0x9030('0x49')](handleError(_0x5f1af9,null));};exports[_0x9030('0x62')]=function(_0x1ca0b4,_0x1fc740,_0x43bd91){var _0xb58e93={};var _0x83d2c9={};var _0x22eb68;var _0x283d35;return db['SmsQueue'][_0x9030('0x57')]({'where':{'id':_0x1ca0b4[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x1fc740,null))[_0x9030('0x25')](function(_0x1ccbe2){if(_0x1ccbe2){_0x22eb68=_0x1ccbe2;_0x83d2c9['model']=_[_0x9030('0x35')](db[_0x9030('0x63')]['rawAttributes']);_0x83d2c9[_0x9030('0x34')]=_[_0x9030('0x35')](_0x1ca0b4[_0x9030('0x34')]);_0x83d2c9['filters']=_[_0x9030('0x37')](_0x83d2c9['model'],_0x83d2c9[_0x9030('0x34')]);_0xb58e93[_0x9030('0x38')]=_['intersection'](_0x83d2c9[_0x9030('0x33')],qs[_0x9030('0x39')](_0x1ca0b4[_0x9030('0x34')][_0x9030('0x39')]));_0xb58e93['attributes']=_0xb58e93['attributes'][_0x9030('0x3a')]?_0xb58e93[_0x9030('0x38')]:_0x83d2c9['model'];_0xb58e93[_0x9030('0x3d')]=qs[_0x9030('0x3e')](_0x1ca0b4['query'][_0x9030('0x3e')]);_0xb58e93[_0x9030('0x3f')]=qs['filters'](_[_0x9030('0x40')](_0x1ca0b4[_0x9030('0x34')],_0x83d2c9[_0x9030('0x36')]));if(_0x1ca0b4[_0x9030('0x34')]['filter']){_0xb58e93[_0x9030('0x3f')]=_[_0x9030('0x41')](_0xb58e93['where'],{'$or':_['map'](_0xb58e93[_0x9030('0x38')],function(_0x3384aa){var _0x5d0837={};_0x5d0837[_0x3384aa]={'$like':'%'+_0x1ca0b4[_0x9030('0x34')][_0x9030('0x43')]+'%'};return _0x5d0837;})});}_0xb58e93=_['merge']({},_0xb58e93,_0x1ca0b4[_0x9030('0x44')]);return _0x22eb68[_0x9030('0x62')](_0xb58e93);}})[_0x9030('0x25')](function(_0xb365){if(_0xb365){_0x283d35=_0xb365[_0x9030('0x3a')];if(!_0x1ca0b4[_0x9030('0x34')]['hasOwnProperty'](_0x9030('0x3c'))){_0xb58e93[_0x9030('0x1f')]=qs[_0x9030('0x1f')](_0x1ca0b4['query'][_0x9030('0x1f')]);_0xb58e93[_0x9030('0x1d')]=qs['offset'](_0x1ca0b4[_0x9030('0x34')][_0x9030('0x1d')]);}return _0x22eb68[_0x9030('0x62')](_0xb58e93);}})['then'](function(_0x963f57){if(_0x963f57){return _0x963f57?{'count':_0x283d35,'rows':_0x963f57}:null;}})[_0x9030('0x25')](respondWithResult(_0x1fc740,null))['catch'](handleError(_0x1fc740,null));};exports['addTeams']=function(_0x2ea62f,_0x883903,_0x167b1d){var _0x160558=_0x2ea62f['body'][_0x9030('0x64')];return db[_0x9030('0x63')][_0x9030('0x47')]({'where':{'id':_0x160558},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9030('0x2c'),_0x9030('0x65'),_0x9030('0x66'),_0x9030('0x67')],'raw':!![]}]})[_0x9030('0x25')](function(_0x5eca1a){if(_0x5eca1a){var _0x39630b=_[_0x9030('0x68')](_0x5eca1a,function(_0x4a9283){var _0x473fac=_0x4a9283[_0x9030('0x50')]({'plain':!![]});return _0x473fac['Agents'];});return db[_0x9030('0x2e')][_0x9030('0x4c')]({'where':{'id':_0x2ea62f[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](function(_0x5264e2){return db['sequelize'][_0x9030('0x69')](function(_0x14b1e7){return _0x5264e2[_0x9030('0x6a')](_0x160558,{'transaction':_0x14b1e7})['then'](function(){return BPromise[_0x9030('0x6b')](_0x39630b,function(_0x5cfd25){return db[_0x9030('0x6c')]['findOrCreate']({'where':{'UserId':_0x5cfd25['id'],'SmsQueueId':_0x2ea62f[_0x9030('0x4b')]['id']},'transaction':_0x14b1e7});});})['then'](function(){_0x39630b[_0x9030('0x6d')](function(_0x57bfb5){socket[_0x9030('0x6e')]('userSmsQueue:save',{'UserId':_0x57bfb5['id'],'SmsQueueId':_0x5264e2['id']});});});});});}})['then'](respondWithStatusCode(_0x883903,null))[_0x9030('0x49')](handleError(_0x883903,null));};exports[_0x9030('0x6f')]=function(_0x50c4e9,_0x2ba8de,_0x5b3e7e){return db[_0x9030('0x63')][_0x9030('0x47')]({'where':{'id':_0x50c4e9[_0x9030('0x34')][_0x9030('0x64')]},'attributes':['id'],'include':[{'model':db[_0x9030('0x59')],'as':_0x9030('0x70'),'attributes':['id'],'raw':!![]}]})[_0x9030('0x25')](handleEntityNotFound(_0x2ba8de,null))[_0x9030('0x25')](function(_0x1ac9f5){var _0x636237=_[_0x9030('0x42')](_0x1ac9f5,'id');var _0x39d157=[];var _0x40f3b2=[];var _0x2c1286=squel[_0x9030('0x71')]();_0x2c1286[_0x9030('0x72')](_0x9030('0x73'))[_0x9030('0x74')](_0x9030('0x75'),'tq')[_0x9030('0x76')](_0x9030('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9030('0x3f')](_0x9030('0x78'),_0x50c4e9['params']['id']);for(var _0x155d65=0x0;_0x155d65<_0x1ac9f5[_0x9030('0x3a')];_0x155d65+=0x1){let _0xbb392e=_0x1ac9f5[_0x155d65];for(var _0x3b67ad=0x0;_0x3b67ad<_0xbb392e['Agents'][_0x9030('0x3a')];_0x3b67ad+=0x1){let _0x53c562=_0xbb392e[_0x9030('0x70')][_0x3b67ad];var _0x2337ac=_0x2c1286['clone']();_0x2337ac['where'](_0x9030('0x79'),_0x53c562['id']);_0x40f3b2[_0x9030('0x7a')](db['sequelize'][_0x9030('0x34')](_0x2337ac[_0x9030('0x7b')](),{'type':db[_0x9030('0x7c')][_0x9030('0x7d')][_0x9030('0x7e')]})[_0x9030('0x25')](function(_0x424e96){if(_0x424e96[_0x9030('0x3a')]===0x1){return _0x53c562['id'];}else{var _0x5d48f6=_['every'](_[_0x9030('0x42')](_0x424e96,'TeamId'),function(_0x1edea8){return _[_0x9030('0x7f')](_0x636237,_0x1edea8);});if(_0x5d48f6){return _0x53c562['id'];}}}));}}return BPromise['all'](_0x40f3b2)[_0x9030('0x25')](function(_0x2d46d7){_0x39d157=_(_0x39d157)[_0x9030('0x80')](_0x2d46d7)['compact']()['value']();return db[_0x9030('0x2e')][_0x9030('0x4c')]({'where':{'id':_0x50c4e9[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](function(_0x1db9f0){return db[_0x9030('0x7c')][_0x9030('0x69')](function(_0x31cf00){return _0x1db9f0['removeTeams'](_0x50c4e9['query']['ids'],{'transaction':_0x31cf00})[_0x9030('0x25')](function(){if(!_[_0x9030('0x81')](_0x39d157)){return _0x1db9f0[_0x9030('0x82')](_0x39d157,{'transaction':_0x31cf00});}})[_0x9030('0x25')](function(){_0x39d157[_0x9030('0x6d')](function(_0x2bcb05){socket[_0x9030('0x6e')](_0x9030('0x83'),{'UserId':_0x2bcb05,'SmsQueueId':_0x1db9f0['id']});});});});});});})[_0x9030('0x25')](respondWithStatusCode(_0x2ba8de,null))[_0x9030('0x49')](handleError(_0x2ba8de,null));};exports[_0x9030('0x84')]=function(_0xf3758c,_0x596c7c,_0x3b8ad6){return db[_0x9030('0x2e')][_0x9030('0x4c')]({'where':{'id':_0xf3758c[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x596c7c,null))[_0x9030('0x25')](function(_0x4b6643){if(_0x4b6643){return _0x4b6643[_0x9030('0x84')](_0xf3758c['body']['ids'],_['omit'](_0xf3758c['body'],['ids','id'])||{})['spread'](function(_0x2e9d30){for(var _0x10481=0x0;_0x10481<_0xf3758c['body'][_0x9030('0x64')][_0x9030('0x3a')];_0x10481+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0xf3758c[_0x9030('0x4e')]['ids'][_0x10481]),'SmsQueueId':Number(_0xf3758c[_0x9030('0x4b')]['id'])});}return _0x2e9d30;});}})['then'](respondWithResult(_0x596c7c,null))[_0x9030('0x49')](handleError(_0x596c7c,null));};exports[_0x9030('0x82')]=function(_0x34d849,_0x4a2db6,_0x53a9ef){return db['SmsQueue']['find']({'where':{'id':_0x34d849[_0x9030('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a2db6,null))[_0x9030('0x25')](function(_0x3eaebd){if(_0x3eaebd){return _0x3eaebd[_0x9030('0x82')](_0x34d849[_0x9030('0x34')][_0x9030('0x64')])['then'](function(){if(_['isArray'](_0x34d849[_0x9030('0x34')][_0x9030('0x64')])){for(var _0x4491fa=0x0;_0x4491fa<_0x34d849['query'][_0x9030('0x64')][_0x9030('0x3a')];_0x4491fa+=0x1){socket[_0x9030('0x6e')](_0x9030('0x83'),{'UserId':Number(_0x34d849[_0x9030('0x34')][_0x9030('0x64')][_0x4491fa]),'SmsQueueId':Number(_0x34d849[_0x9030('0x4b')]['id'])});}}else{socket[_0x9030('0x6e')](_0x9030('0x83'),{'UserId':Number(_0x34d849[_0x9030('0x34')][_0x9030('0x64')]),'SmsQueueId':Number(_0x34d849['params']['id'])});}});}})[_0x9030('0x25')](respondWithStatusCode(_0x4a2db6,null))['catch'](handleError(_0x4a2db6,null));};exports[_0x9030('0x85')]=function(_0x115379,_0x2c5c43,_0x2d1847){var _0x552759={};var _0x8dd5b9={};var _0x424db7;var _0xbb6017;return db[_0x9030('0x2e')][_0x9030('0x57')]({'where':{'id':_0x115379[_0x9030('0x4b')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x2c5c43,null))[_0x9030('0x25')](function(_0x273fbc){if(_0x273fbc){_0x424db7=_0x273fbc;_0x8dd5b9[_0x9030('0x33')]=_[_0x9030('0x35')](db[_0x9030('0x59')][_0x9030('0x2f')]);_0x8dd5b9[_0x9030('0x34')]=_[_0x9030('0x35')](_0x115379[_0x9030('0x34')]);_0x8dd5b9[_0x9030('0x36')]=_[_0x9030('0x37')](_0x8dd5b9[_0x9030('0x33')],_0x8dd5b9[_0x9030('0x34')]);_0x552759[_0x9030('0x38')]=_[_0x9030('0x37')](_0x8dd5b9[_0x9030('0x33')],qs['fields'](_0x115379[_0x9030('0x34')][_0x9030('0x39')]));_0x552759[_0x9030('0x38')]=_0x552759[_0x9030('0x38')][_0x9030('0x3a')]?_0x552759['attributes']:_0x8dd5b9['model'];_0x552759['order']=qs[_0x9030('0x3e')](_0x115379['query'][_0x9030('0x3e')]);_0x552759['where']=qs[_0x9030('0x36')](_['pick'](_0x115379[_0x9030('0x34')],_0x8dd5b9['filters']));if(_0x115379[_0x9030('0x34')][_0x9030('0x43')]){_0x552759['where']=_[_0x9030('0x41')](_0x552759[_0x9030('0x3f')],{'$or':_[_0x9030('0x42')](_0x552759[_0x9030('0x38')],function(_0x42527a){var _0x2aadf5={};_0x2aadf5[_0x42527a]={'$like':'%'+_0x115379[_0x9030('0x34')]['filter']+'%'};return _0x2aadf5;})});}_0x552759=_[_0x9030('0x41')]({},_0x552759,_0x115379[_0x9030('0x44')]);return _0x424db7[_0x9030('0x85')](_0x552759);}})[_0x9030('0x25')](function(_0x5ef1b4){if(_0x5ef1b4){_0xbb6017=_0x5ef1b4['length'];if(!_0x115379['query'][_0x9030('0x3b')]('nolimit')){_0x552759['limit']=qs[_0x9030('0x1f')](_0x115379[_0x9030('0x34')]['limit']);_0x552759[_0x9030('0x1d')]=qs[_0x9030('0x1d')](_0x115379[_0x9030('0x34')][_0x9030('0x1d')]);}return _0x424db7[_0x9030('0x85')](_0x552759);}})[_0x9030('0x25')](function(_0x1e7737){if(_0x1e7737){return _0x1e7737?{'count':_0xbb6017,'rows':_0x1e7737}:null;}})['then'](respondWithResult(_0x2c5c43,null))[_0x9030('0x49')](handleError(_0x2c5c43,null));}; \ No newline at end of file +var _0x6e0e=['getAgents','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','json','undefined','offset','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','type','VIRTUAL','merge','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','role','user','SmsQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','sort','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userSmsQueue:save','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','all','union','compact','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray'];(function(_0x47420d,_0x1de090){var _0x280d1d=function(_0x890b34){while(--_0x890b34){_0x47420d['push'](_0x47420d['shift']());}};_0x280d1d(++_0x1de090);}(_0x6e0e,0x8a));var _0xe6e0=function(_0xe10376,_0x215d21){_0xe10376=_0xe10376-0x0;var _0x19c9ab=_0x6e0e[_0xe10376];return _0x19c9ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6e0('0x0'));var zipdir=require(_0xe6e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe6e0('0x2'));var BPromise=require(_0xe6e0('0x3'));var Mustache=require('mustache');var util=require(_0xe6e0('0x4'));var path=require(_0xe6e0('0x5'));var sox=require(_0xe6e0('0x6'));var csv=require(_0xe6e0('0x7'));var ejs=require(_0xe6e0('0x8'));var fs=require('fs');var fs_extra=require(_0xe6e0('0x9'));var _=require(_0xe6e0('0xa'));var squel=require('squel');var crypto=require(_0xe6e0('0xb'));var jsforce=require(_0xe6e0('0xc'));var deskjs=require(_0xe6e0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe6e0('0xe'));var Papa=require(_0xe6e0('0xf'));var Redis=require(_0xe6e0('0x10'));var authService=require(_0xe6e0('0x11'));var qs=require(_0xe6e0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6e0('0x13'))(_0xe6e0('0x14'));var utils=require('../../config/utils');var config=require(_0xe6e0('0x15'));var licenseUtil=require(_0xe6e0('0x16'));var db=require('../../mysqldb')['db'];config[_0xe6e0('0x17')]=_[_0xe6e0('0x18')](config[_0xe6e0('0x17')],{'host':_0xe6e0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0xe6e0('0x1a')](socket);function respondWithStatusCode(_0x6d813f,_0x454af3){_0x454af3=_0x454af3||0xcc;return function(_0x23194a){if(_0x23194a){return _0x6d813f[_0xe6e0('0x1b')](_0x454af3);}return _0x6d813f[_0xe6e0('0x1c')](_0x454af3)['end']();};}function respondWithResult(_0x17c36e,_0x58b6b4){_0x58b6b4=_0x58b6b4||0xc8;return function(_0x401026){if(_0x401026){return _0x17c36e[_0xe6e0('0x1c')](_0x58b6b4)[_0xe6e0('0x1d')](_0x401026);}};}function respondWithFilteredResult(_0x26f763,_0x26558d){return function(_0x2d91d6){if(_0x2d91d6){var _0x215520=typeof _0x26558d['offset']===_0xe6e0('0x1e')&&typeof _0x26558d['limit']===_0xe6e0('0x1e');var _0x21d782=_0x2d91d6['count'];var _0x14913a=_0x215520?0x0:_0x26558d[_0xe6e0('0x1f')];var _0x33b234=_0x215520?_0x2d91d6['count']:_0x26558d[_0xe6e0('0x1f')]+_0x26558d[_0xe6e0('0x20')];var _0x1d90e8;if(_0x33b234>=_0x21d782){_0x33b234=_0x21d782;_0x1d90e8=0xc8;}else{_0x1d90e8=0xce;}_0x26f763['status'](_0x1d90e8);return _0x26f763[_0xe6e0('0x21')](_0xe6e0('0x22'),_0x14913a+'-'+_0x33b234+'/'+_0x21d782)[_0xe6e0('0x1d')](_0x2d91d6);}return null;};}function patchUpdates(_0x1afca2){return function(_0x3e980f){try{jsonpatch['apply'](_0x3e980f,_0x1afca2,!![]);}catch(_0x465250){return BPromise[_0xe6e0('0x23')](_0x465250);}return _0x3e980f[_0xe6e0('0x24')]();};}function saveUpdates(_0x10e42c,_0x2e5dd5){return function(_0x240e1){if(_0x240e1){return _0x240e1[_0xe6e0('0x25')](_0x10e42c)[_0xe6e0('0x26')](function(_0x360262){return _0x360262;});}return null;};}function removeEntity(_0x122453,_0x364903){return function(_0x5b47ef){if(_0x5b47ef){return _0x5b47ef['destroy']()[_0xe6e0('0x26')](function(){var _0x3c95e1=_0x5b47ef[_0xe6e0('0x27')]({'plain':!![]});var _0x1d6733='SmsQueues';return db[_0xe6e0('0x28')][_0xe6e0('0x29')]({'where':{'type':_0x1d6733,'resourceId':_0x3c95e1['id']}})[_0xe6e0('0x26')](function(){return _0x5b47ef;});})[_0xe6e0('0x26')](function(){_0x122453[_0xe6e0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42ef58,_0x10b0d2){return function(_0x3d0be4){if(!_0x3d0be4){_0x42ef58[_0xe6e0('0x1b')](0x194);}return _0x3d0be4;};}function handleError(_0xaa1b7,_0x23803f){_0x23803f=_0x23803f||0x1f4;return function(_0x1e2ab8){logger[_0xe6e0('0x2a')](_0x1e2ab8['stack']);if(_0x1e2ab8[_0xe6e0('0x2b')]){delete _0x1e2ab8[_0xe6e0('0x2b')];}_0xaa1b7[_0xe6e0('0x1c')](_0x23803f)[_0xe6e0('0x2c')](_0x1e2ab8);};}exports[_0xe6e0('0x2d')]=function(_0x389a55,_0x37f1f5){var _0x5e8650={},_0x199bf1={},_0x27ae7b={'count':0x0,'rows':[]};var _0xb33a25=_['map'](db['SmsQueue']['rawAttributes'],function(_0x33d8e2){return{'name':_0x33d8e2[_0xe6e0('0x2e')],'type':_0x33d8e2['type'][_0xe6e0('0x2f')]};});_0x199bf1[_0xe6e0('0x30')]=_[_0xe6e0('0x31')](_0xb33a25,_0xe6e0('0x2b'));_0x199bf1[_0xe6e0('0x32')]=_[_0xe6e0('0x33')](_0x389a55['query']);_0x199bf1['filters']=_['intersection'](_0x199bf1['model'],_0x199bf1['query']);_0x5e8650[_0xe6e0('0x34')]=_[_0xe6e0('0x35')](_0x199bf1['model'],qs[_0xe6e0('0x36')](_0x389a55[_0xe6e0('0x32')][_0xe6e0('0x36')]));_0x5e8650['attributes']=_0x5e8650['attributes'][_0xe6e0('0x37')]?_0x5e8650[_0xe6e0('0x34')]:_0x199bf1[_0xe6e0('0x30')];if(!_0x389a55['query'][_0xe6e0('0x38')](_0xe6e0('0x39'))){_0x5e8650['limit']=qs[_0xe6e0('0x20')](_0x389a55[_0xe6e0('0x32')]['limit']);_0x5e8650[_0xe6e0('0x1f')]=qs[_0xe6e0('0x1f')](_0x389a55[_0xe6e0('0x32')]['offset']);}_0x5e8650['order']=qs['sort'](_0x389a55[_0xe6e0('0x32')]['sort']);_0x5e8650['where']=qs[_0xe6e0('0x3a')](_[_0xe6e0('0x3b')](_0x389a55[_0xe6e0('0x32')],_0x199bf1[_0xe6e0('0x3a')]),_0xb33a25);if(_0x389a55[_0xe6e0('0x32')][_0xe6e0('0x3c')]){_0x5e8650[_0xe6e0('0x3d')]=_['merge'](_0x5e8650[_0xe6e0('0x3d')],{'$or':_['map'](_0xb33a25,function(_0x5962cf){if(_0x5962cf[_0xe6e0('0x3e')]!==_0xe6e0('0x3f')){var _0x4fd93a={};_0x4fd93a[_0x5962cf[_0xe6e0('0x2b')]]={'$like':'%'+_0x389a55[_0xe6e0('0x32')][_0xe6e0('0x3c')]+'%'};return _0x4fd93a;}})});}_0x5e8650=_[_0xe6e0('0x40')]({},_0x5e8650,_0x389a55['options']);var _0x122547={'where':_0x5e8650[_0xe6e0('0x3d')]};return db[_0xe6e0('0x41')][_0xe6e0('0x42')](_0x122547)[_0xe6e0('0x26')](function(_0x31037e){_0x27ae7b[_0xe6e0('0x42')]=_0x31037e;if(_0x389a55[_0xe6e0('0x32')][_0xe6e0('0x43')]){_0x5e8650[_0xe6e0('0x44')]=[{'all':!![]}];}return db[_0xe6e0('0x41')][_0xe6e0('0x45')](_0x5e8650);})[_0xe6e0('0x26')](function(_0x3a2e0f){_0x27ae7b[_0xe6e0('0x46')]=_0x3a2e0f;return _0x27ae7b;})[_0xe6e0('0x26')](respondWithFilteredResult(_0x37f1f5,_0x5e8650))[_0xe6e0('0x47')](handleError(_0x37f1f5,null));};exports[_0xe6e0('0x48')]=function(_0x46c75a,_0x59b150){var _0x365d9f={'raw':!![],'where':{'id':_0x46c75a[_0xe6e0('0x49')]['id']}},_0x20bd86={};_0x20bd86['model']=_[_0xe6e0('0x33')](db['SmsQueue'][_0xe6e0('0x4a')]);_0x20bd86['query']=_[_0xe6e0('0x33')](_0x46c75a[_0xe6e0('0x32')]);_0x20bd86['filters']=_[_0xe6e0('0x35')](_0x20bd86[_0xe6e0('0x30')],_0x20bd86[_0xe6e0('0x32')]);_0x365d9f[_0xe6e0('0x34')]=_['intersection'](_0x20bd86[_0xe6e0('0x30')],qs[_0xe6e0('0x36')](_0x46c75a[_0xe6e0('0x32')][_0xe6e0('0x36')]));_0x365d9f[_0xe6e0('0x34')]=_0x365d9f[_0xe6e0('0x34')]['length']?_0x365d9f[_0xe6e0('0x34')]:_0x20bd86[_0xe6e0('0x30')];if(_0x46c75a[_0xe6e0('0x32')][_0xe6e0('0x43')]){_0x365d9f[_0xe6e0('0x44')]=[{'all':!![]}];}_0x365d9f=_[_0xe6e0('0x40')]({},_0x365d9f,_0x46c75a[_0xe6e0('0x4b')]);return db[_0xe6e0('0x41')][_0xe6e0('0x4c')](_0x365d9f)[_0xe6e0('0x26')](handleEntityNotFound(_0x59b150,null))[_0xe6e0('0x26')](respondWithResult(_0x59b150,null))[_0xe6e0('0x47')](handleError(_0x59b150,null));};exports[_0xe6e0('0x4d')]=function(_0x2fc0f4,_0x61c16c){return db[_0xe6e0('0x41')][_0xe6e0('0x4d')](_0x2fc0f4[_0xe6e0('0x4e')],{})[_0xe6e0('0x26')](function(_0x4b11d1){var _0x37996d=_0x2fc0f4['user'][_0xe6e0('0x27')]({'plain':!![]});if(!_0x37996d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37996d[_0xe6e0('0x4f')]===_0xe6e0('0x50')){var _0x9222d9=_0x4b11d1[_0xe6e0('0x27')]({'plain':!![]});var _0x443438=_0xe6e0('0x51');return db['UserProfileSection'][_0xe6e0('0x4c')]({'where':{'name':_0x443438,'userProfileId':_0x37996d['userProfileId']},'raw':!![]})['then'](function(_0x2e8696){if(_0x2e8696&&_0x2e8696[_0xe6e0('0x52')]===0x0){return db[_0xe6e0('0x28')][_0xe6e0('0x4d')]({'name':_0x9222d9[_0xe6e0('0x2b')],'resourceId':_0x9222d9['id'],'type':_0x2e8696[_0xe6e0('0x2b')],'sectionId':_0x2e8696['id']},{})['then'](function(){return _0x4b11d1;});}else{return _0x4b11d1;}})[_0xe6e0('0x47')](function(_0x446273){logger['error'](_0xe6e0('0x53'),_0x446273);throw _0x446273;});}return _0x4b11d1;})['then'](respondWithResult(_0x61c16c,0xc9))[_0xe6e0('0x47')](handleError(_0x61c16c,null));};exports[_0xe6e0('0x25')]=function(_0x43f7b4,_0xfedd7e){if(_0x43f7b4['body']['id']){delete _0x43f7b4['body']['id'];}return db['SmsQueue'][_0xe6e0('0x4c')]({'where':{'id':_0x43f7b4[_0xe6e0('0x49')]['id']}})[_0xe6e0('0x26')](handleEntityNotFound(_0xfedd7e,null))[_0xe6e0('0x26')](saveUpdates(_0x43f7b4[_0xe6e0('0x4e')],null))[_0xe6e0('0x26')](respondWithResult(_0xfedd7e,null))[_0xe6e0('0x47')](handleError(_0xfedd7e,null));};exports['destroy']=function(_0x332cfb,_0x40c83c){return db[_0xe6e0('0x41')][_0xe6e0('0x4c')]({'where':{'id':_0x332cfb[_0xe6e0('0x49')]['id']}})[_0xe6e0('0x26')](handleEntityNotFound(_0x40c83c,null))[_0xe6e0('0x26')](removeEntity(_0x40c83c,null))[_0xe6e0('0x47')](handleError(_0x40c83c,null));};exports[_0xe6e0('0x54')]=function(_0x4778e6,_0x5522df){return db[_0xe6e0('0x41')][_0xe6e0('0x54')]()['then'](respondWithResult(_0x5522df,null))['catch'](handleError(_0x5522df,null));};exports[_0xe6e0('0x55')]=function(_0x585acc,_0x319224,_0x2b04d5){var _0x2ba053={'raw':!![],'where':{}},_0x140a88={},_0x3dbc51;return db[_0xe6e0('0x41')]['findOne']({'where':{'id':_0x585acc[_0xe6e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x319224,null))[_0xe6e0('0x26')](function(_0x1d75ec){if(_0x1d75ec){_0x3dbc51=_0x1d75ec[_0xe6e0('0x27')]({'plain':!![]});_0x140a88[_0xe6e0('0x30')]=_[_0xe6e0('0x33')](db[_0xe6e0('0x56')]['rawAttributes']);_0x140a88[_0xe6e0('0x32')]=_[_0xe6e0('0x33')](_0x585acc[_0xe6e0('0x32')]);_0x140a88['filters']=_[_0xe6e0('0x35')](_0x140a88[_0xe6e0('0x30')],_0x140a88[_0xe6e0('0x32')]);_0x2ba053[_0xe6e0('0x34')]=_['intersection'](_0x140a88[_0xe6e0('0x30')],qs[_0xe6e0('0x36')](_0x585acc[_0xe6e0('0x32')][_0xe6e0('0x36')]));_0x2ba053['attributes']=_0x2ba053[_0xe6e0('0x34')]['length']?_0x2ba053[_0xe6e0('0x34')]:_0x140a88[_0xe6e0('0x30')];if(!_0x585acc[_0xe6e0('0x32')][_0xe6e0('0x38')](_0xe6e0('0x39'))){_0x2ba053[_0xe6e0('0x20')]=qs['limit'](_0x585acc[_0xe6e0('0x32')]['limit']);_0x2ba053[_0xe6e0('0x1f')]=qs['offset'](_0x585acc['query']['offset']);}_0x2ba053['order']=qs[_0xe6e0('0x57')](_0x585acc[_0xe6e0('0x32')][_0xe6e0('0x57')]);_0x2ba053[_0xe6e0('0x3d')]=qs['filters'](_[_0xe6e0('0x3b')](_0x585acc[_0xe6e0('0x32')],_0x140a88['filters']));_0x2ba053['where'][_0xe6e0('0x58')]=_0x1d75ec['id'];if(_0x585acc['query'][_0xe6e0('0x3c')]){_0x2ba053[_0xe6e0('0x3d')]=_[_0xe6e0('0x40')](_0x2ba053[_0xe6e0('0x3d')],{'$or':_[_0xe6e0('0x31')](_0x2ba053['attributes'],function(_0x45a8f7){var _0x379934={};_0x379934[_0x45a8f7]={'$like':'%'+_0x585acc[_0xe6e0('0x32')][_0xe6e0('0x3c')]+'%'};return _0x379934;})});}_0x2ba053=_[_0xe6e0('0x40')]({},_0x2ba053,_0x585acc[_0xe6e0('0x4b')]);return db['UserSmsQueue'][_0xe6e0('0x45')](_0x2ba053);}})[_0xe6e0('0x26')](function(_0x57fad4){if(_0x57fad4){return db[_0xe6e0('0x59')][_0xe6e0('0x5a')]({'where':{'id':_[_0xe6e0('0x31')](_0x57fad4,'UserId'),'role':_0xe6e0('0x5b')},'attributes':['id',_0xe6e0('0x2b'),_0xe6e0('0x5c'),_0xe6e0('0x5d'),_0xe6e0('0x5e')]});}})[_0xe6e0('0x26')](function(_0x258606){if(_0x258606){return{'count':_0x258606[_0xe6e0('0x42')],'rows':_[_0xe6e0('0x31')](_0x258606[_0xe6e0('0x46')],function(_0x23dbe2){return{'membername':_0x23dbe2['name'],'UserId':_0x23dbe2['id'],'queue_name':_0x3dbc51[_0xe6e0('0x2b')],'SmsQueueId':_0x3dbc51['id'],'interface':util[_0xe6e0('0x5f')](_0xe6e0('0x60'),_0xe6e0('0x61'),_0x23dbe2[_0xe6e0('0x2b')]),'penalty':0x0,'paused':_0x23dbe2['smsPause'],'createdAt':_0x23dbe2[_0xe6e0('0x5e')],'updatedAt':_0x23dbe2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe6e0('0x26')](respondWithFilteredResult(_0x319224,_0x2ba053))[_0xe6e0('0x47')](handleError(_0x319224,null));};exports[_0xe6e0('0x62')]=function(_0x29a565,_0x1992a5,_0x264deb){var _0x344130={};var _0x4ef5a2={};var _0xc905a0;var _0x57f32e;return db[_0xe6e0('0x41')][_0xe6e0('0x63')]({'where':{'id':_0x29a565[_0xe6e0('0x49')]['id']}})[_0xe6e0('0x26')](handleEntityNotFound(_0x1992a5,null))[_0xe6e0('0x26')](function(_0x2f79dd){if(_0x2f79dd){_0xc905a0=_0x2f79dd;_0x4ef5a2[_0xe6e0('0x30')]=_[_0xe6e0('0x33')](db[_0xe6e0('0x64')][_0xe6e0('0x4a')]);_0x4ef5a2['query']=_[_0xe6e0('0x33')](_0x29a565[_0xe6e0('0x32')]);_0x4ef5a2[_0xe6e0('0x3a')]=_[_0xe6e0('0x35')](_0x4ef5a2[_0xe6e0('0x30')],_0x4ef5a2[_0xe6e0('0x32')]);_0x344130[_0xe6e0('0x34')]=_['intersection'](_0x4ef5a2[_0xe6e0('0x30')],qs['fields'](_0x29a565[_0xe6e0('0x32')][_0xe6e0('0x36')]));_0x344130['attributes']=_0x344130[_0xe6e0('0x34')]['length']?_0x344130[_0xe6e0('0x34')]:_0x4ef5a2[_0xe6e0('0x30')];_0x344130[_0xe6e0('0x65')]=qs['sort'](_0x29a565['query'][_0xe6e0('0x57')]);_0x344130[_0xe6e0('0x3d')]=qs[_0xe6e0('0x3a')](_[_0xe6e0('0x3b')](_0x29a565[_0xe6e0('0x32')],_0x4ef5a2['filters']));if(_0x29a565['query'][_0xe6e0('0x3c')]){_0x344130['where']=_[_0xe6e0('0x40')](_0x344130[_0xe6e0('0x3d')],{'$or':_['map'](_0x344130['attributes'],function(_0x34f98d){var _0x27a1f5={};_0x27a1f5[_0x34f98d]={'$like':'%'+_0x29a565[_0xe6e0('0x32')][_0xe6e0('0x3c')]+'%'};return _0x27a1f5;})});}_0x344130=_['merge']({},_0x344130,_0x29a565['options']);return _0xc905a0[_0xe6e0('0x62')](_0x344130);}})[_0xe6e0('0x26')](function(_0x48600f){if(_0x48600f){_0x57f32e=_0x48600f[_0xe6e0('0x37')];if(!_0x29a565[_0xe6e0('0x32')][_0xe6e0('0x38')](_0xe6e0('0x39'))){_0x344130[_0xe6e0('0x20')]=qs[_0xe6e0('0x20')](_0x29a565[_0xe6e0('0x32')][_0xe6e0('0x20')]);_0x344130[_0xe6e0('0x1f')]=qs['offset'](_0x29a565[_0xe6e0('0x32')]['offset']);}return _0xc905a0[_0xe6e0('0x62')](_0x344130);}})['then'](function(_0x5ce882){if(_0x5ce882){return _0x5ce882?{'count':_0x57f32e,'rows':_0x5ce882}:null;}})[_0xe6e0('0x26')](respondWithResult(_0x1992a5,null))[_0xe6e0('0x47')](handleError(_0x1992a5,null));};exports[_0xe6e0('0x66')]=function(_0x119921,_0x5946df,_0x419e97){var _0x371b1d=_0x119921[_0xe6e0('0x4e')][_0xe6e0('0x67')];return db[_0xe6e0('0x64')]['findAll']({'where':{'id':_0x371b1d},'attributes':['id'],'include':[{'model':db[_0xe6e0('0x59')],'as':_0xe6e0('0x68'),'attributes':['id','name',_0xe6e0('0x69'),_0xe6e0('0x6a'),_0xe6e0('0x6b')],'raw':!![]}]})[_0xe6e0('0x26')](function(_0x1367af){if(_0x1367af){var _0x347332=_[_0xe6e0('0x6c')](_0x1367af,function(_0x1aed6d){var _0x62ee31=_0x1aed6d['get']({'plain':!![]});return _0x62ee31[_0xe6e0('0x68')];});return db[_0xe6e0('0x41')]['find']({'where':{'id':_0x119921[_0xe6e0('0x49')]['id']}})['then'](function(_0x1095a7){return db[_0xe6e0('0x6d')][_0xe6e0('0x6e')](function(_0x53a09d){return _0x1095a7[_0xe6e0('0x66')](_0x371b1d,{'transaction':_0x53a09d})[_0xe6e0('0x26')](function(){return BPromise['each'](_0x347332,function(_0x416ef3){return db[_0xe6e0('0x56')]['findOrCreate']({'where':{'UserId':_0x416ef3['id'],'SmsQueueId':_0x119921['params']['id']},'transaction':_0x53a09d});});})[_0xe6e0('0x26')](function(){_0x347332[_0xe6e0('0x6f')](function(_0x317cbd){socket[_0xe6e0('0x70')](_0xe6e0('0x71'),{'UserId':_0x317cbd['id'],'SmsQueueId':_0x1095a7['id']});});});});});}})[_0xe6e0('0x26')](respondWithStatusCode(_0x5946df,null))[_0xe6e0('0x47')](handleError(_0x5946df,null));};exports['removeTeams']=function(_0x39fd13,_0x24f0ad,_0x4f150d){return db[_0xe6e0('0x64')][_0xe6e0('0x45')]({'where':{'id':_0x39fd13[_0xe6e0('0x32')][_0xe6e0('0x67')]},'attributes':['id'],'include':[{'model':db[_0xe6e0('0x59')],'as':_0xe6e0('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x24f0ad,null))[_0xe6e0('0x26')](function(_0xfebede){var _0x3b1038=_[_0xe6e0('0x31')](_0xfebede,'id');var _0x57bd7e=[];var _0x138b29=[];var _0x3849ac=squel[_0xe6e0('0x72')]();_0x3849ac['field'](_0xe6e0('0x73'))['from'](_0xe6e0('0x74'),'tq')[_0xe6e0('0x75')](_0xe6e0('0x76'),'ut',_0xe6e0('0x77'))[_0xe6e0('0x3d')](_0xe6e0('0x78'),_0x39fd13[_0xe6e0('0x49')]['id']);for(var _0x2c7c2d=0x0;_0x2c7c2d<_0xfebede[_0xe6e0('0x37')];_0x2c7c2d+=0x1){let _0x57fca7=_0xfebede[_0x2c7c2d];for(var _0xcba093=0x0;_0xcba093<_0x57fca7[_0xe6e0('0x68')][_0xe6e0('0x37')];_0xcba093+=0x1){let _0x1a66ce=_0x57fca7[_0xe6e0('0x68')][_0xcba093];var _0xd045f=_0x3849ac[_0xe6e0('0x79')]();_0xd045f[_0xe6e0('0x3d')]('ut.UserId\x20=\x20?',_0x1a66ce['id']);_0x138b29[_0xe6e0('0x7a')](db[_0xe6e0('0x6d')][_0xe6e0('0x32')](_0xd045f['toString'](),{'type':db[_0xe6e0('0x6d')][_0xe6e0('0x7b')][_0xe6e0('0x7c')]})[_0xe6e0('0x26')](function(_0x4d6ecc){if(_0x4d6ecc[_0xe6e0('0x37')]===0x1){return _0x1a66ce['id'];}else{var _0x120a87=_[_0xe6e0('0x7d')](_[_0xe6e0('0x31')](_0x4d6ecc,'TeamId'),function(_0x5c61cc){return _['includes'](_0x3b1038,_0x5c61cc);});if(_0x120a87){return _0x1a66ce['id'];}}}));}}return BPromise[_0xe6e0('0x7e')](_0x138b29)[_0xe6e0('0x26')](function(_0x2a967e){_0x57bd7e=_(_0x57bd7e)[_0xe6e0('0x7f')](_0x2a967e)[_0xe6e0('0x80')]()['value']();return db[_0xe6e0('0x41')][_0xe6e0('0x4c')]({'where':{'id':_0x39fd13[_0xe6e0('0x49')]['id']}})['then'](function(_0x3c0bf4){return db[_0xe6e0('0x6d')][_0xe6e0('0x6e')](function(_0x1f3721){return _0x3c0bf4['removeTeams'](_0x39fd13['query']['ids'],{'transaction':_0x1f3721})[_0xe6e0('0x26')](function(){if(!_[_0xe6e0('0x81')](_0x57bd7e)){return _0x3c0bf4['removeAgents'](_0x57bd7e,{'transaction':_0x1f3721});}})['then'](function(){_0x57bd7e[_0xe6e0('0x6f')](function(_0x250a8c){socket[_0xe6e0('0x70')](_0xe6e0('0x82'),{'UserId':_0x250a8c,'SmsQueueId':_0x3c0bf4['id']});});});});});});})[_0xe6e0('0x26')](respondWithStatusCode(_0x24f0ad,null))[_0xe6e0('0x47')](handleError(_0x24f0ad,null));};exports[_0xe6e0('0x83')]=function(_0xd0ff86,_0x5b69db,_0x22b433){return db[_0xe6e0('0x41')][_0xe6e0('0x4c')]({'where':{'id':_0xd0ff86['params']['id']}})[_0xe6e0('0x26')](handleEntityNotFound(_0x5b69db,null))[_0xe6e0('0x26')](function(_0x2ee6f0){if(_0x2ee6f0){return _0x2ee6f0[_0xe6e0('0x83')](_0xd0ff86[_0xe6e0('0x4e')][_0xe6e0('0x67')],_[_0xe6e0('0x84')](_0xd0ff86[_0xe6e0('0x4e')],['ids','id'])||{})[_0xe6e0('0x85')](function(_0x447538){for(var _0xbdc097=0x0;_0xbdc097<_0xd0ff86[_0xe6e0('0x4e')][_0xe6e0('0x67')]['length'];_0xbdc097+=0x1){socket['emit'](_0xe6e0('0x71'),{'UserId':Number(_0xd0ff86[_0xe6e0('0x4e')][_0xe6e0('0x67')][_0xbdc097]),'SmsQueueId':Number(_0xd0ff86['params']['id'])});}return _0x447538;});}})[_0xe6e0('0x26')](respondWithResult(_0x5b69db,null))[_0xe6e0('0x47')](handleError(_0x5b69db,null));};exports[_0xe6e0('0x86')]=function(_0x1c9792,_0x5aaa35,_0x578eab){return db[_0xe6e0('0x41')][_0xe6e0('0x4c')]({'where':{'id':_0x1c9792['params']['id']}})['then'](handleEntityNotFound(_0x5aaa35,null))[_0xe6e0('0x26')](function(_0x4d4a0f){if(_0x4d4a0f){return _0x4d4a0f[_0xe6e0('0x86')](_0x1c9792['query'][_0xe6e0('0x67')])[_0xe6e0('0x26')](function(){if(_[_0xe6e0('0x87')](_0x1c9792[_0xe6e0('0x32')]['ids'])){for(var _0x194de0=0x0;_0x194de0<_0x1c9792['query']['ids'][_0xe6e0('0x37')];_0x194de0+=0x1){socket[_0xe6e0('0x70')](_0xe6e0('0x82'),{'UserId':Number(_0x1c9792[_0xe6e0('0x32')][_0xe6e0('0x67')][_0x194de0]),'SmsQueueId':Number(_0x1c9792['params']['id'])});}}else{socket[_0xe6e0('0x70')](_0xe6e0('0x82'),{'UserId':Number(_0x1c9792[_0xe6e0('0x32')][_0xe6e0('0x67')]),'SmsQueueId':Number(_0x1c9792[_0xe6e0('0x49')]['id'])});}});}})[_0xe6e0('0x26')](respondWithStatusCode(_0x5aaa35,null))[_0xe6e0('0x47')](handleError(_0x5aaa35,null));};exports[_0xe6e0('0x88')]=function(_0x4f03ae,_0x240654,_0x20efed){var _0x435211={};var _0x2da32f={};var _0x4f57f9;var _0x23ec81;return db[_0xe6e0('0x41')][_0xe6e0('0x63')]({'where':{'id':_0x4f03ae[_0xe6e0('0x49')]['id']}})[_0xe6e0('0x26')](handleEntityNotFound(_0x240654,null))[_0xe6e0('0x26')](function(_0x12e6af){if(_0x12e6af){_0x4f57f9=_0x12e6af;_0x2da32f[_0xe6e0('0x30')]=_['keys'](db[_0xe6e0('0x59')][_0xe6e0('0x4a')]);_0x2da32f[_0xe6e0('0x32')]=_['keys'](_0x4f03ae[_0xe6e0('0x32')]);_0x2da32f[_0xe6e0('0x3a')]=_[_0xe6e0('0x35')](_0x2da32f[_0xe6e0('0x30')],_0x2da32f[_0xe6e0('0x32')]);_0x435211[_0xe6e0('0x34')]=_['intersection'](_0x2da32f[_0xe6e0('0x30')],qs[_0xe6e0('0x36')](_0x4f03ae['query'][_0xe6e0('0x36')]));_0x435211['attributes']=_0x435211[_0xe6e0('0x34')][_0xe6e0('0x37')]?_0x435211[_0xe6e0('0x34')]:_0x2da32f[_0xe6e0('0x30')];_0x435211[_0xe6e0('0x65')]=qs[_0xe6e0('0x57')](_0x4f03ae[_0xe6e0('0x32')][_0xe6e0('0x57')]);_0x435211[_0xe6e0('0x3d')]=qs[_0xe6e0('0x3a')](_['pick'](_0x4f03ae[_0xe6e0('0x32')],_0x2da32f[_0xe6e0('0x3a')]));if(_0x4f03ae[_0xe6e0('0x32')][_0xe6e0('0x3c')]){_0x435211[_0xe6e0('0x3d')]=_[_0xe6e0('0x40')](_0x435211[_0xe6e0('0x3d')],{'$or':_['map'](_0x435211[_0xe6e0('0x34')],function(_0x3cf95a){var _0x51e4c5={};_0x51e4c5[_0x3cf95a]={'$like':'%'+_0x4f03ae[_0xe6e0('0x32')][_0xe6e0('0x3c')]+'%'};return _0x51e4c5;})});}_0x435211=_[_0xe6e0('0x40')]({},_0x435211,_0x4f03ae[_0xe6e0('0x4b')]);return _0x4f57f9[_0xe6e0('0x88')](_0x435211);}})[_0xe6e0('0x26')](function(_0x322591){if(_0x322591){_0x23ec81=_0x322591[_0xe6e0('0x37')];if(!_0x4f03ae['query'][_0xe6e0('0x38')](_0xe6e0('0x39'))){_0x435211[_0xe6e0('0x20')]=qs[_0xe6e0('0x20')](_0x4f03ae['query'][_0xe6e0('0x20')]);_0x435211[_0xe6e0('0x1f')]=qs[_0xe6e0('0x1f')](_0x4f03ae[_0xe6e0('0x32')][_0xe6e0('0x1f')]);}return _0x4f57f9[_0xe6e0('0x88')](_0x435211);}})[_0xe6e0('0x26')](function(_0x1aa21){if(_0x1aa21){return _0x1aa21?{'count':_0x23ec81,'rows':_0x1aa21}:null;}})[_0xe6e0('0x26')](respondWithResult(_0x240654,null))['catch'](handleError(_0x240654,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ca86eda..a37bc19 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 _0x353b=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x353b,0x1a8));var _0xb353=function(_0x29982b,_0x594e0){_0x29982b=_0x29982b-0x0;var _0xb1f0a9=_0x353b[_0x29982b];return _0xb1f0a9;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xb353('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb353('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb353('0x2'),'afterDestroy':_0xb353('0x3')};function emitEvent(_0x19816f){return function(_0x3891ae,_0x472a41,_0x339d18){SmsQueueEvents[_0xb353('0x4')](_0x19816f+':'+_0x3891ae['id'],_0x3891ae);SmsQueueEvents[_0xb353('0x4')](_0x19816f,_0x3891ae);_0x339d18(null);};}for(var e in events){if(events[_0xb353('0x5')](e)){var event=events[e];SmsQueue[_0xb353('0x6')](e,emitEvent(event));}}module[_0xb353('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xf97b=['events','SmsQueue','setMaxListeners','remove','hasOwnProperty','hook','exports'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xf97b,0x126));var _0xbf97=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf97b[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xbf97('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xbf97('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbf97('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbf97('0x3')};function emitEvent(_0x5b567d){return function(_0x33b986,_0x1543d4,_0x7e811d){SmsQueueEvents['emit'](_0x5b567d+':'+_0x33b986['id'],_0x33b986);SmsQueueEvents['emit'](_0x5b567d,_0x33b986);_0x7e811d(null);};}for(var e in events){if(events[_0xbf97('0x4')](e)){var event=events[e];SmsQueue[_0xbf97('0x5')](e,emitEvent(event));}}module[_0xbf97('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 5b77e72..079656f 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 _0xc40a=['../../config/logger','bluebird','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc40a,0x148));var _0xac40=function(_0x3d962b,_0x4c7d80){_0x3d962b=_0x3d962b-0x0;var _0x4cdc0e=_0xc40a[_0x3d962b];return _0x4cdc0e;};'use strict';var _=require(_0xac40('0x0'));var util=require(_0xac40('0x1'));var logger=require(_0xac40('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac40('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac40('0x4'));var config=require('../../config/environment');var attributes=require(_0xac40('0x5'));module[_0xac40('0x6')]=function(_0xfa9745,_0x30207c){return _0xfa9745[_0xac40('0x7')](_0xac40('0x8'),attributes,{'tableName':_0xac40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad62=['SmsQueue','sms_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xad62,0x14f));var _0x2ad6=function(_0x3b413c,_0x59c11d){_0x3b413c=_0x3b413c-0x0;var _0x2db3b6=_0xad62[_0x3b413c];return _0x2db3b6;};'use strict';var _=require('lodash');var util=require(_0x2ad6('0x0'));var logger=require(_0x2ad6('0x1'))('api');var moment=require(_0x2ad6('0x2'));var BPromise=require(_0x2ad6('0x3'));var rp=require(_0x2ad6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ad6('0x5'));var config=require(_0x2ad6('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x209002,_0x541bcb){return _0x209002['define'](_0x2ad6('0x7'),attributes,{'tableName':_0x2ad6('0x8'),'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 4b7899a..bd8069b 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 _0xc746=['stringify','error','code','message','result','catch','SmsQueue','findAll','options','raw','attributes','limit','include','model','map','GetSmsQueue','find','ShowSmsQueue','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x36b5f7,_0x24170d){var _0x1f4816=function(_0x4eb90f){while(--_0x4eb90f){_0x36b5f7['push'](_0x36b5f7['shift']());}};_0x1f4816(++_0x24170d);}(_0xc746,0x13a));var _0x6c74=function(_0x4dba6d,_0x22f3c5){_0x4dba6d=_0x4dba6d-0x0;var _0x446f38=_0xc746[_0x4dba6d];return _0x446f38;};'use strict';var _=require('lodash');var util=require(_0x6c74('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c74('0x1'))['db'];var utils=require(_0x6c74('0x2'));var logger=require(_0x6c74('0x3'))(_0x6c74('0x4'));var config=require('../../config/environment');var jayson=require(_0x6c74('0x5'));var client=jayson[_0x6c74('0x6')][_0x6c74('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6c74('0x8'),'port':0x18eb});var socket=require(_0x6c74('0x9'))(new Redis(config[_0x6c74('0xa')]));require(_0x6c74('0xb'))[_0x6c74('0xc')](socket);function respondWithRpcPromise(_0x5184c2,_0x33324c,_0x2d837d){return new BPromise(function(_0x70db2e,_0x47aea6){return client['request'](_0x5184c2,_0x2d837d)[_0x6c74('0xd')](function(_0x42fbe7){logger[_0x6c74('0xe')](_0x6c74('0xf'),_0x33324c,_0x6c74('0x10'));logger[_0x6c74('0x11')](_0x6c74('0x12'),_0x33324c,_0x6c74('0x10'),JSON[_0x6c74('0x13')](_0x42fbe7));if(_0x42fbe7[_0x6c74('0x14')]){if(_0x42fbe7['error'][_0x6c74('0x15')]===0x1f4){logger[_0x6c74('0x14')](_0x6c74('0xf'),_0x33324c,_0x42fbe7[_0x6c74('0x14')][_0x6c74('0x16')]);return _0x47aea6(_0x42fbe7[_0x6c74('0x14')][_0x6c74('0x16')]);}logger['error'](_0x6c74('0xf'),_0x33324c,_0x42fbe7[_0x6c74('0x14')][_0x6c74('0x16')]);return _0x70db2e(_0x42fbe7['error'][_0x6c74('0x16')]);}else{logger[_0x6c74('0xe')](_0x6c74('0xf'),_0x33324c,'request\x20sent');_0x70db2e(_0x42fbe7[_0x6c74('0x17')][_0x6c74('0x16')]);}})[_0x6c74('0x18')](function(_0x3ef6f2){logger['error'](_0x6c74('0xf'),_0x33324c,_0x3ef6f2);_0x47aea6(_0x3ef6f2);});});}exports['GetSmsQueue']=function(_0x142d2f){var _0x3c5eae=this;return new Promise(function(_0x384a30,_0x265338){return db[_0x6c74('0x19')][_0x6c74('0x1a')]({'raw':_0x142d2f[_0x6c74('0x1b')]?_0x142d2f[_0x6c74('0x1b')][_0x6c74('0x1c')]===undefined?!![]:![]:!![],'where':_0x142d2f[_0x6c74('0x1b')]?_0x142d2f[_0x6c74('0x1b')]['where']||null:null,'attributes':_0x142d2f[_0x6c74('0x1b')]?_0x142d2f['options'][_0x6c74('0x1d')]||null:null,'limit':_0x142d2f[_0x6c74('0x1b')]?_0x142d2f[_0x6c74('0x1b')][_0x6c74('0x1e')]||null:null,'include':_0x142d2f[_0x6c74('0x1b')]?_0x142d2f['options']['include']?_['map'](_0x142d2f[_0x6c74('0x1b')][_0x6c74('0x1f')],function(_0x33283c){return{'model':db[_0x33283c[_0x6c74('0x20')]],'as':_0x33283c['as'],'attributes':_0x33283c[_0x6c74('0x1d')],'include':_0x33283c[_0x6c74('0x1f')]?_[_0x6c74('0x21')](_0x33283c[_0x6c74('0x1f')],function(_0x439c19){return{'model':db[_0x439c19[_0x6c74('0x20')]],'as':_0x439c19['as'],'attributes':_0x439c19[_0x6c74('0x1d')],'include':_0x439c19[_0x6c74('0x1f')]?_[_0x6c74('0x21')](_0x439c19['include'],function(_0x3db715){return{'model':db[_0x3db715[_0x6c74('0x20')]],'as':_0x3db715['as'],'attributes':_0x3db715['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c74('0xd')](function(_0x472d95){logger[_0x6c74('0xe')](_0x6c74('0x22'),_0x142d2f);logger[_0x6c74('0x11')](_0x6c74('0x22'),_0x142d2f,JSON[_0x6c74('0x13')](_0x472d95));_0x384a30(_0x472d95);})[_0x6c74('0x18')](function(_0x4745c8){logger[_0x6c74('0x14')](_0x6c74('0x22'),_0x4745c8[_0x6c74('0x16')],_0x142d2f);_0x265338(_0x3c5eae['error'](0x1f4,_0x4745c8[_0x6c74('0x16')]));});});};exports['ShowSmsQueue']=function(_0x13ebf2){var _0x12af52=this;return new Promise(function(_0x335d3d,_0x2068ea){return db['SmsQueue'][_0x6c74('0x23')]({'raw':_0x13ebf2[_0x6c74('0x1b')]?_0x13ebf2[_0x6c74('0x1b')][_0x6c74('0x1c')]===undefined?!![]:![]:!![],'where':_0x13ebf2[_0x6c74('0x1b')]?_0x13ebf2[_0x6c74('0x1b')]['where']||null:null,'attributes':_0x13ebf2[_0x6c74('0x1b')]?_0x13ebf2['options'][_0x6c74('0x1d')]||null:null,'include':_0x13ebf2['options']?_0x13ebf2[_0x6c74('0x1b')][_0x6c74('0x1f')]?_['map'](_0x13ebf2[_0x6c74('0x1b')][_0x6c74('0x1f')],function(_0x1a79df){return{'model':db[_0x1a79df[_0x6c74('0x20')]],'as':_0x1a79df['as'],'attributes':_0x1a79df[_0x6c74('0x1d')],'include':_0x1a79df[_0x6c74('0x1f')]?_[_0x6c74('0x21')](_0x1a79df['include'],function(_0x106160){return{'model':db[_0x106160[_0x6c74('0x20')]],'as':_0x106160['as'],'attributes':_0x106160[_0x6c74('0x1d')],'include':_0x106160[_0x6c74('0x1f')]?_[_0x6c74('0x21')](_0x106160[_0x6c74('0x1f')],function(_0x3b8145){return{'model':db[_0x3b8145[_0x6c74('0x20')]],'as':_0x3b8145['as'],'attributes':_0x3b8145['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a84f2){logger[_0x6c74('0xe')]('ShowSmsQueue',_0x13ebf2);logger[_0x6c74('0x11')](_0x6c74('0x24'),_0x13ebf2,JSON[_0x6c74('0x13')](_0x4a84f2));_0x335d3d(_0x4a84f2);})[_0x6c74('0x18')](function(_0x2255cd){logger[_0x6c74('0x14')](_0x6c74('0x24'),_0x2255cd['message'],_0x13ebf2);_0x2068ea(_0x12af52[_0x6c74('0x14')](0x1f4,_0x2255cd['message']));});});}; \ No newline at end of file +var _0x89d1=['http','redis','localhost','./smsQueue.socket','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','catch','find','raw','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x357632,_0x2108b8){var _0x2e1d58=function(_0x39c393){while(--_0x39c393){_0x357632['push'](_0x357632['shift']());}};_0x2e1d58(++_0x2108b8);}(_0x89d1,0x17c));var _0x189d=function(_0x40287a,_0x2df937){_0x40287a=_0x40287a-0x0;var _0x55eb66=_0x89d1[_0x40287a];return _0x55eb66;};'use strict';var _=require(_0x189d('0x0'));var util=require('util');var moment=require(_0x189d('0x1'));var BPromise=require(_0x189d('0x2'));var rs=require(_0x189d('0x3'));var fs=require('fs');var Redis=require(_0x189d('0x4'));var db=require(_0x189d('0x5'))['db'];var utils=require(_0x189d('0x6'));var logger=require('../../config/logger')(_0x189d('0x7'));var config=require(_0x189d('0x8'));var jayson=require(_0x189d('0x9'));var client=jayson['client'][_0x189d('0xa')]({'port':0x232a});config[_0x189d('0xb')]=_['defaults'](config[_0x189d('0xb')],{'host':_0x189d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x189d('0xd'))['register'](socket);function respondWithRpcPromise(_0x171fc1,_0x3fdc0f,_0x34da15){return new BPromise(function(_0x173092,_0x2bf3a0){return client[_0x189d('0xe')](_0x171fc1,_0x34da15)[_0x189d('0xf')](function(_0x48c5c3){logger[_0x189d('0x10')]('SmsQueue,\x20%s,\x20%s',_0x3fdc0f,'request\x20sent');logger[_0x189d('0x11')](_0x189d('0x12'),_0x3fdc0f,_0x189d('0x13'),JSON[_0x189d('0x14')](_0x48c5c3));if(_0x48c5c3['error']){if(_0x48c5c3[_0x189d('0x15')][_0x189d('0x16')]===0x1f4){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3[_0x189d('0x15')]['message']);return _0x2bf3a0(_0x48c5c3[_0x189d('0x15')][_0x189d('0x18')]);}logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3['error'][_0x189d('0x18')]);return _0x173092(_0x48c5c3['error'][_0x189d('0x18')]);}else{logger[_0x189d('0x10')](_0x189d('0x17'),_0x3fdc0f,_0x189d('0x13'));_0x173092(_0x48c5c3['result']['message']);}})['catch'](function(_0x37684c){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x37684c);_0x2bf3a0(_0x37684c);});});}exports[_0x189d('0x19')]=function(_0x1b1ece){var _0x290a38=this;return new Promise(function(_0x53b088,_0x14d815){return db[_0x189d('0x1a')][_0x189d('0x1b')]({'raw':_0x1b1ece[_0x189d('0x1c')]?_0x1b1ece[_0x189d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b1ece[_0x189d('0x1c')]?_0x1b1ece['options'][_0x189d('0x1d')]||null:null,'attributes':_0x1b1ece['options']?_0x1b1ece[_0x189d('0x1c')][_0x189d('0x1e')]||null:null,'limit':_0x1b1ece[_0x189d('0x1c')]?_0x1b1ece[_0x189d('0x1c')][_0x189d('0x1f')]||null:null,'include':_0x1b1ece[_0x189d('0x1c')]?_0x1b1ece[_0x189d('0x1c')][_0x189d('0x20')]?_[_0x189d('0x21')](_0x1b1ece[_0x189d('0x1c')][_0x189d('0x20')],function(_0x4312dc){return{'model':db[_0x4312dc[_0x189d('0x22')]],'as':_0x4312dc['as'],'attributes':_0x4312dc[_0x189d('0x1e')],'include':_0x4312dc[_0x189d('0x20')]?_[_0x189d('0x21')](_0x4312dc[_0x189d('0x20')],function(_0x3d958b){return{'model':db[_0x3d958b[_0x189d('0x22')]],'as':_0x3d958b['as'],'attributes':_0x3d958b['attributes'],'include':_0x3d958b[_0x189d('0x20')]?_['map'](_0x3d958b[_0x189d('0x20')],function(_0x10eec7){return{'model':db[_0x10eec7['model']],'as':_0x10eec7['as'],'attributes':_0x10eec7[_0x189d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x189d('0xf')](function(_0x1fbff2){logger[_0x189d('0x10')](_0x189d('0x19'),_0x1b1ece);logger[_0x189d('0x11')]('GetSmsQueue',_0x1b1ece,JSON['stringify'](_0x1fbff2));_0x53b088(_0x1fbff2);})[_0x189d('0x23')](function(_0x350a51){logger[_0x189d('0x15')](_0x189d('0x19'),_0x350a51[_0x189d('0x18')],_0x1b1ece);_0x14d815(_0x290a38[_0x189d('0x15')](0x1f4,_0x350a51[_0x189d('0x18')]));});});};exports['ShowSmsQueue']=function(_0x31e8f6){var _0x54cd00=this;return new Promise(function(_0x164494,_0xa4b0e9){return db[_0x189d('0x1a')][_0x189d('0x24')]({'raw':_0x31e8f6[_0x189d('0x1c')]?_0x31e8f6[_0x189d('0x1c')][_0x189d('0x25')]===undefined?!![]:![]:!![],'where':_0x31e8f6['options']?_0x31e8f6[_0x189d('0x1c')][_0x189d('0x1d')]||null:null,'attributes':_0x31e8f6[_0x189d('0x1c')]?_0x31e8f6['options']['attributes']||null:null,'include':_0x31e8f6[_0x189d('0x1c')]?_0x31e8f6['options']['include']?_[_0x189d('0x21')](_0x31e8f6[_0x189d('0x1c')]['include'],function(_0x27a957){return{'model':db[_0x27a957[_0x189d('0x22')]],'as':_0x27a957['as'],'attributes':_0x27a957[_0x189d('0x1e')],'include':_0x27a957['include']?_[_0x189d('0x21')](_0x27a957['include'],function(_0x4623ee){return{'model':db[_0x4623ee['model']],'as':_0x4623ee['as'],'attributes':_0x4623ee['attributes'],'include':_0x4623ee[_0x189d('0x20')]?_['map'](_0x4623ee[_0x189d('0x20')],function(_0x43ff78){return{'model':db[_0x43ff78[_0x189d('0x22')]],'as':_0x43ff78['as'],'attributes':_0x43ff78[_0x189d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x189d('0xf')](function(_0x1b304b){logger['info'](_0x189d('0x26'),_0x31e8f6);logger[_0x189d('0x11')]('ShowSmsQueue',_0x31e8f6,JSON[_0x189d('0x14')](_0x1b304b));_0x164494(_0x1b304b);})[_0x189d('0x23')](function(_0x339276){logger['error'](_0x189d('0x26'),_0x339276['message'],_0x31e8f6);_0xa4b0e9(_0x54cd00[_0x189d('0x15')](0x1f4,_0x339276[_0x189d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5bc3a8b..96bd598 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 _0x0eef=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0eef,0x11c));var _0xf0ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0eef[_0x2641f9];return _0x585741;};'use strict';var SmsQueueEvents=require(_0xf0ee('0x0'));var events=[_0xf0ee('0x1'),_0xf0ee('0x2'),_0xf0ee('0x3')];function createListener(_0x43d964,_0xae579a){return function(_0x1a7ce6){_0xae579a[_0xf0ee('0x4')](_0x43d964,_0x1a7ce6);};}function removeListener(_0x1bf7ca,_0x560dfa){return function(){SmsQueueEvents[_0xf0ee('0x5')](_0x1bf7ca,_0x560dfa);};}exports[_0xf0ee('0x6')]=function(_0x2a71a9){for(var _0x9a9401=0x0,_0x100a6a=events[_0xf0ee('0x7')];_0x9a9401<_0x100a6a;_0x9a9401++){var _0x917155=events[_0x9a9401];var _0x46f9bf=createListener(_0xf0ee('0x8')+_0x917155,_0x2a71a9);SmsQueueEvents['on'](_0x917155,_0x46f9bf);}}; \ No newline at end of file +var _0xdbed=['length','./smsQueue.events','update','emit','removeListener','register'];(function(_0x543f7c,_0x454d0f){var _0x1dd2af=function(_0x31af43){while(--_0x31af43){_0x543f7c['push'](_0x543f7c['shift']());}};_0x1dd2af(++_0x454d0f);}(_0xdbed,0x1ed));var _0xddbe=function(_0x71a25e,_0x3b855f){_0x71a25e=_0x71a25e-0x0;var _0x38739c=_0xdbed[_0x71a25e];return _0x38739c;};'use strict';var SmsQueueEvents=require(_0xddbe('0x0'));var events=['save','remove',_0xddbe('0x1')];function createListener(_0x5f16de,_0x12fcca){return function(_0x39b105){_0x12fcca[_0xddbe('0x2')](_0x5f16de,_0x39b105);};}function removeListener(_0x285ea3,_0xa89d06){return function(){SmsQueueEvents[_0xddbe('0x3')](_0x285ea3,_0xa89d06);};}exports[_0xddbe('0x4')]=function(_0xc657e4){for(var _0x3eff56=0x0,_0x4b8c58=events[_0xddbe('0x5')];_0x3eff56<_0x4b8c58;_0x3eff56++){var _0x4a7da6=events[_0x3eff56];var _0x31bded=createListener('smsQueue:'+_0x4a7da6,_0xc657e4);SmsQueueEvents['on'](_0x4a7da6,_0x31bded);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f5f894a..a3241d5 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 _0x179d=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x4aeda4,_0x3e4a3d){var _0x5cf127=function(_0x1b5dfa){while(--_0x1b5dfa){_0x4aeda4['push'](_0x4aeda4['shift']());}};_0x5cf127(++_0x3e4a3d);}(_0x179d,0x85));var _0xd179=function(_0x4b6b50,_0x1cb504){_0x4b6b50=_0x4b6b50-0x0;var _0x553c6d=_0x179d[_0x4b6b50];return _0x553c6d;};'use strict';var multer=require('multer');var util=require(_0xd179('0x0'));var path=require(_0xd179('0x1'));var timeout=require(_0xd179('0x2'));var express=require('express');var router=express[_0xd179('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd179('0x4'));var config=require(_0xd179('0x5'));var controller=require(_0xd179('0x6'));router[_0xd179('0x7')]('/',auth[_0xd179('0x8')](),controller[_0xd179('0x9')]);router[_0xd179('0x7')](_0xd179('0xa'),auth[_0xd179('0x8')](),controller[_0xd179('0xb')]);router[_0xd179('0x7')](_0xd179('0xc'),auth['isAuthenticated'](),controller[_0xd179('0xd')]);router[_0xd179('0xe')]('/',auth['isAuthenticated'](),controller[_0xd179('0xf')]);router[_0xd179('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd179('0x11')]('/:id',auth[_0xd179('0x8')](),controller[_0xd179('0x12')]);module[_0xd179('0x13')]=router; \ No newline at end of file +var _0x79d3=['isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x5d2788,_0x2e1b65){var _0x4b4e50=function(_0x5a0b4f){while(--_0x5a0b4f){_0x5d2788['push'](_0x5d2788['shift']());}};_0x4b4e50(++_0x2e1b65);}(_0x79d3,0x15f));var _0x379d=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x79d3[_0x175a55];return _0x167adf;};'use strict';var multer=require(_0x379d('0x0'));var util=require('util');var path=require(_0x379d('0x1'));var timeout=require('connect-timeout');var express=require(_0x379d('0x2'));var router=express[_0x379d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x379d('0x4'));var interaction=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var controller=require(_0x379d('0x7'));router[_0x379d('0x8')]('/',auth[_0x379d('0x9')](),controller[_0x379d('0xa')]);router['get'](_0x379d('0xb'),auth['isAuthenticated'](),controller[_0x379d('0xc')]);router[_0x379d('0x8')](_0x379d('0xd'),auth['isAuthenticated'](),controller[_0x379d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x379d('0xf')](_0x379d('0xd'),auth[_0x379d('0x9')](),controller['update']);router[_0x379d('0x10')](_0x379d('0xd'),auth[_0x379d('0x9')](),controller[_0x379d('0x11')]);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 c15ddd6..5bbbe85 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 _0xaf70=['STRING','DATE','moment','sequelize'];(function(_0x32d8f6,_0x153146){var _0x4d6740=function(_0x5e41a6){while(--_0x5e41a6){_0x32d8f6['push'](_0x32d8f6['shift']());}};_0x4d6740(++_0x153146);}(_0xaf70,0x17a));var _0x0af7=function(_0x18d9e8,_0x5c87e9){_0x18d9e8=_0x18d9e8-0x0;var _0x4198f1=_0xaf70[_0x18d9e8];return _0x4198f1;};'use strict';var moment=require(_0x0af7('0x0'));var Sequelize=require(_0x0af7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0af7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0af7('0x2')]},'joinAt':{'type':Sequelize[_0x0af7('0x3')]},'leaveAt':{'type':Sequelize[_0x0af7('0x3')]},'acceptAt':{'type':Sequelize[_0x0af7('0x3')]},'exitAt':{'type':Sequelize[_0x0af7('0x3')]},'reason':{'type':Sequelize[_0x0af7('0x2')]}}; \ No newline at end of file +var _0x5888=['DATE','moment','sequelize','exports','STRING'];(function(_0x223c9e,_0x6a8ddf){var _0x4e32f4=function(_0x5173c0){while(--_0x5173c0){_0x223c9e['push'](_0x223c9e['shift']());}};_0x4e32f4(++_0x6a8ddf);}(_0x5888,0x15f));var _0x8588=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x5888[_0x513545];return _0x18b7c5;};'use strict';var moment=require(_0x8588('0x0'));var Sequelize=require(_0x8588('0x1'));module[_0x8588('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8588('0x3')]},'joinAt':{'type':Sequelize[_0x8588('0x4')]},'leaveAt':{'type':Sequelize[_0x8588('0x4')]},'acceptAt':{'type':Sequelize[_0x8588('0x4')]},'exitAt':{'type':Sequelize[_0x8588('0x4')]},'reason':{'type':Sequelize[_0x8588('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a36291b..4296bb2 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 _0x049c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','describe','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x049c,0xd1));var _0xc049=function(_0x2c81ce,_0x39921f){_0x2c81ce=_0x2c81ce-0x0;var _0x1dc54a=_0x049c[_0x2c81ce];return _0x1dc54a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc049('0x0'));var jsonpatch=require(_0xc049('0x1'));var rp=require(_0xc049('0x2'));var moment=require(_0xc049('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc049('0x4'));var path=require('path');var sox=require(_0xc049('0x5'));var csv=require('to-csv');var ejs=require(_0xc049('0x6'));var fs=require('fs');var fs_extra=require(_0xc049('0x7'));var _=require(_0xc049('0x8'));var squel=require(_0xc049('0x9'));var crypto=require(_0xc049('0xa'));var jsforce=require(_0xc049('0xb'));var deskjs=require(_0xc049('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc049('0xd'));var Redis=require(_0xc049('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc049('0xf'));var as=require(_0xc049('0x10'));var hardwareService=require(_0xc049('0x11'));var logger=require(_0xc049('0x12'))('api');var utils=require(_0xc049('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc049('0x14'))['db'];function respondWithStatusCode(_0x4eee7a,_0x49c2a2){_0x49c2a2=_0x49c2a2||0xcc;return function(_0x171545){if(_0x171545){return _0x4eee7a[_0xc049('0x15')](_0x49c2a2);}return _0x4eee7a[_0xc049('0x16')](_0x49c2a2)['end']();};}function respondWithResult(_0x2ec8f5,_0x332588){_0x332588=_0x332588||0xc8;return function(_0x3516e5){if(_0x3516e5){return _0x2ec8f5[_0xc049('0x16')](_0x332588)[_0xc049('0x17')](_0x3516e5);}};}function respondWithFilteredResult(_0x47c90e,_0x2ed19e){return function(_0x31fd4c){if(_0x31fd4c){var _0x192278=typeof _0x2ed19e[_0xc049('0x18')]===_0xc049('0x19')&&typeof _0x2ed19e['limit']==='undefined';var _0x4981e4=_0x31fd4c['count'];var _0x1b1465=_0x192278?0x0:_0x2ed19e[_0xc049('0x18')];var _0x3e82aa=_0x192278?_0x31fd4c[_0xc049('0x1a')]:_0x2ed19e[_0xc049('0x18')]+_0x2ed19e[_0xc049('0x1b')];var _0x477a4d;if(_0x3e82aa>=_0x4981e4){_0x3e82aa=_0x4981e4;_0x477a4d=0xc8;}else{_0x477a4d=0xce;}_0x47c90e[_0xc049('0x16')](_0x477a4d);return _0x47c90e[_0xc049('0x1c')](_0xc049('0x1d'),_0x1b1465+'-'+_0x3e82aa+'/'+_0x4981e4)[_0xc049('0x17')](_0x31fd4c);}return null;};}function patchUpdates(_0x341b08){return function(_0x381c45){try{jsonpatch[_0xc049('0x1e')](_0x381c45,_0x341b08,!![]);}catch(_0x36aa5f){return BPromise['reject'](_0x36aa5f);}return _0x381c45[_0xc049('0x1f')]();};}function saveUpdates(_0x224536,_0x4a1789){return function(_0x387ff4){if(_0x387ff4){return _0x387ff4[_0xc049('0x20')](_0x224536)[_0xc049('0x21')](function(_0x5f5773){return _0x5f5773;});}return null;};}function removeEntity(_0x1047ab,_0x3426a9){return function(_0x315246){if(_0x315246){return _0x315246[_0xc049('0x22')]()['then'](function(){_0x1047ab[_0xc049('0x16')](0xcc)[_0xc049('0x23')]();});}};}function handleEntityNotFound(_0x40f6e8,_0x4c6beb){return function(_0x52c71a){if(!_0x52c71a){_0x40f6e8[_0xc049('0x15')](0x194);}return _0x52c71a;};}function handleError(_0x3cf522,_0x5ef717){_0x5ef717=_0x5ef717||0x1f4;return function(_0x16d174){logger['error'](_0x16d174[_0xc049('0x24')]);if(_0x16d174[_0xc049('0x25')]){delete _0x16d174['name'];}_0x3cf522['status'](_0x5ef717)[_0xc049('0x26')](_0x16d174);};}exports[_0xc049('0x27')]=function(_0x1d8c82,_0x1b081d){var _0x547d2a={},_0xf7c03e={},_0xe38cd3={'count':0x0,'rows':[]};var _0xad15d=_[_0xc049('0x28')](db[_0xc049('0x29')][_0xc049('0x2a')],function(_0x2bbb6a){return{'name':_0x2bbb6a[_0xc049('0x2b')],'type':_0x2bbb6a[_0xc049('0x2c')][_0xc049('0x2d')]};});_0xf7c03e['model']=_[_0xc049('0x28')](_0xad15d,_0xc049('0x25'));_0xf7c03e[_0xc049('0x2e')]=_[_0xc049('0x2f')](_0x1d8c82['query']);_0xf7c03e['filters']=_[_0xc049('0x30')](_0xf7c03e[_0xc049('0x31')],_0xf7c03e[_0xc049('0x2e')]);_0x547d2a['attributes']=_['intersection'](_0xf7c03e[_0xc049('0x31')],qs[_0xc049('0x32')](_0x1d8c82[_0xc049('0x2e')][_0xc049('0x32')]));_0x547d2a['attributes']=_0x547d2a[_0xc049('0x33')][_0xc049('0x34')]?_0x547d2a[_0xc049('0x33')]:_0xf7c03e[_0xc049('0x31')];if(!_0x1d8c82[_0xc049('0x2e')][_0xc049('0x35')](_0xc049('0x36'))){_0x547d2a[_0xc049('0x1b')]=qs[_0xc049('0x1b')](_0x1d8c82['query'][_0xc049('0x1b')]);_0x547d2a[_0xc049('0x18')]=qs[_0xc049('0x18')](_0x1d8c82[_0xc049('0x2e')][_0xc049('0x18')]);}_0x547d2a[_0xc049('0x37')]=qs[_0xc049('0x38')](_0x1d8c82[_0xc049('0x2e')][_0xc049('0x38')]);_0x547d2a[_0xc049('0x39')]=qs[_0xc049('0x3a')](_[_0xc049('0x3b')](_0x1d8c82['query'],_0xf7c03e[_0xc049('0x3a')]),_0xad15d);if(_0x1d8c82[_0xc049('0x2e')][_0xc049('0x3c')]){_0x547d2a[_0xc049('0x39')]=_[_0xc049('0x3d')](_0x547d2a[_0xc049('0x39')],{'$or':_['map'](_0xad15d,function(_0x34d936){if(_0x34d936[_0xc049('0x2c')]!==_0xc049('0x3e')){var _0x38dcb3={};_0x38dcb3[_0x34d936[_0xc049('0x25')]]={'$like':'%'+_0x1d8c82[_0xc049('0x2e')][_0xc049('0x3c')]+'%'};return _0x38dcb3;}})});}_0x547d2a=_[_0xc049('0x3d')]({},_0x547d2a,_0x1d8c82[_0xc049('0x3f')]);var _0x395723={'where':_0x547d2a[_0xc049('0x39')]};return db['SmsQueueReport'][_0xc049('0x1a')](_0x395723)[_0xc049('0x21')](function(_0x3ea3f7){_0xe38cd3[_0xc049('0x1a')]=_0x3ea3f7;if(_0x1d8c82[_0xc049('0x2e')][_0xc049('0x40')]){_0x547d2a[_0xc049('0x41')]=[{'all':!![]}];}return db[_0xc049('0x29')][_0xc049('0x42')](_0x547d2a);})['then'](function(_0x25112b){_0xe38cd3[_0xc049('0x43')]=_0x25112b;return _0xe38cd3;})[_0xc049('0x21')](respondWithFilteredResult(_0x1b081d,_0x547d2a))['catch'](handleError(_0x1b081d,null));};exports[_0xc049('0x44')]=function(_0x424164,_0x46ba61){var _0x33e1f1={'raw':!![],'where':{'id':_0x424164[_0xc049('0x45')]['id']}},_0x2a7602={};_0x2a7602['model']=_['keys'](db[_0xc049('0x29')][_0xc049('0x2a')]);_0x2a7602[_0xc049('0x2e')]=_[_0xc049('0x2f')](_0x424164[_0xc049('0x2e')]);_0x2a7602[_0xc049('0x3a')]=_[_0xc049('0x30')](_0x2a7602[_0xc049('0x31')],_0x2a7602[_0xc049('0x2e')]);_0x33e1f1[_0xc049('0x33')]=_[_0xc049('0x30')](_0x2a7602['model'],qs[_0xc049('0x32')](_0x424164[_0xc049('0x2e')][_0xc049('0x32')]));_0x33e1f1[_0xc049('0x33')]=_0x33e1f1[_0xc049('0x33')][_0xc049('0x34')]?_0x33e1f1[_0xc049('0x33')]:_0x2a7602[_0xc049('0x31')];if(_0x424164[_0xc049('0x2e')]['includeAll']){_0x33e1f1[_0xc049('0x41')]=[{'all':!![]}];}_0x33e1f1=_[_0xc049('0x3d')]({},_0x33e1f1,_0x424164['options']);return db[_0xc049('0x29')]['find'](_0x33e1f1)['then'](handleEntityNotFound(_0x46ba61,null))[_0xc049('0x21')](respondWithResult(_0x46ba61,null))['catch'](handleError(_0x46ba61,null));};exports['create']=function(_0x2be67e,_0x525c74){return db[_0xc049('0x29')][_0xc049('0x46')](_0x2be67e[_0xc049('0x47')],{})[_0xc049('0x21')](respondWithResult(_0x525c74,0xc9))[_0xc049('0x48')](handleError(_0x525c74,null));};exports[_0xc049('0x20')]=function(_0x1331d3,_0x3a8626){if(_0x1331d3[_0xc049('0x47')]['id']){delete _0x1331d3[_0xc049('0x47')]['id'];}return db[_0xc049('0x29')]['find']({'where':{'id':_0x1331d3[_0xc049('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a8626,null))[_0xc049('0x21')](saveUpdates(_0x1331d3['body'],null))[_0xc049('0x21')](respondWithResult(_0x3a8626,null))[_0xc049('0x48')](handleError(_0x3a8626,null));};exports[_0xc049('0x22')]=function(_0x3c5c1a,_0x4988c9){return db[_0xc049('0x29')][_0xc049('0x49')]({'where':{'id':_0x3c5c1a[_0xc049('0x45')]['id']}})[_0xc049('0x21')](handleEntityNotFound(_0x4988c9,null))[_0xc049('0x21')](removeEntity(_0x4988c9,null))[_0xc049('0x48')](handleError(_0x4988c9,null));};exports[_0xc049('0x4a')]=function(_0x164ec3,_0x85cb43){return db[_0xc049('0x29')]['describe']()[_0xc049('0x21')](respondWithResult(_0x85cb43,null))['catch'](handleError(_0x85cb43,null));}; \ No newline at end of file +var _0x3b24=['length','hasOwnProperty','nolimit','order','sort','filters','where','merge','includeAll','include','rows','catch','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes'];(function(_0xe5e6c8,_0x815769){var _0x5430f6=function(_0x45ae6d){while(--_0x45ae6d){_0xe5e6c8['push'](_0xe5e6c8['shift']());}};_0x5430f6(++_0x815769);}(_0x3b24,0xed));var _0x43b2=function(_0x1bffe9,_0x3191ae){_0x1bffe9=_0x1bffe9-0x0;var _0x4d5b14=_0x3b24[_0x1bffe9];return _0x4d5b14;};'use strict';var emlformat=require(_0x43b2('0x0'));var rimraf=require(_0x43b2('0x1'));var zipdir=require(_0x43b2('0x2'));var jsonpatch=require(_0x43b2('0x3'));var rp=require(_0x43b2('0x4'));var moment=require('moment');var BPromise=require(_0x43b2('0x5'));var Mustache=require(_0x43b2('0x6'));var util=require(_0x43b2('0x7'));var path=require('path');var sox=require(_0x43b2('0x8'));var csv=require(_0x43b2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43b2('0xa'));var squel=require(_0x43b2('0xb'));var crypto=require('crypto');var jsforce=require(_0x43b2('0xc'));var deskjs=require(_0x43b2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43b2('0xe'));var Papa=require(_0x43b2('0xf'));var Redis=require(_0x43b2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x43b2('0x11'));var as=require(_0x43b2('0x12'));var hardwareService=require(_0x43b2('0x13'));var logger=require(_0x43b2('0x14'))(_0x43b2('0x15'));var utils=require('../../config/utils');var config=require(_0x43b2('0x16'));var licenseUtil=require(_0x43b2('0x17'));var db=require(_0x43b2('0x18'))['db'];function respondWithStatusCode(_0x24af02,_0x6b9135){_0x6b9135=_0x6b9135||0xcc;return function(_0x56128e){if(_0x56128e){return _0x24af02[_0x43b2('0x19')](_0x6b9135);}return _0x24af02[_0x43b2('0x1a')](_0x6b9135)['end']();};}function respondWithResult(_0x19b98b,_0x1a58bc){_0x1a58bc=_0x1a58bc||0xc8;return function(_0x4d4ffd){if(_0x4d4ffd){return _0x19b98b[_0x43b2('0x1a')](_0x1a58bc)[_0x43b2('0x1b')](_0x4d4ffd);}};}function respondWithFilteredResult(_0xab31ce,_0x214214){return function(_0x2a460a){if(_0x2a460a){var _0x5c07bf=typeof _0x214214[_0x43b2('0x1c')]===_0x43b2('0x1d')&&typeof _0x214214[_0x43b2('0x1e')]===_0x43b2('0x1d');var _0x5e10c7=_0x2a460a[_0x43b2('0x1f')];var _0x245a17=_0x5c07bf?0x0:_0x214214['offset'];var _0x322090=_0x5c07bf?_0x2a460a[_0x43b2('0x1f')]:_0x214214['offset']+_0x214214[_0x43b2('0x1e')];var _0x206f29;if(_0x322090>=_0x5e10c7){_0x322090=_0x5e10c7;_0x206f29=0xc8;}else{_0x206f29=0xce;}_0xab31ce['status'](_0x206f29);return _0xab31ce[_0x43b2('0x20')](_0x43b2('0x21'),_0x245a17+'-'+_0x322090+'/'+_0x5e10c7)[_0x43b2('0x1b')](_0x2a460a);}return null;};}function patchUpdates(_0x561e9f){return function(_0x45ebf9){try{jsonpatch[_0x43b2('0x22')](_0x45ebf9,_0x561e9f,!![]);}catch(_0x5a7d84){return BPromise[_0x43b2('0x23')](_0x5a7d84);}return _0x45ebf9[_0x43b2('0x24')]();};}function saveUpdates(_0x465ae2,_0x4f76ba){return function(_0x25eb3c){if(_0x25eb3c){return _0x25eb3c[_0x43b2('0x25')](_0x465ae2)[_0x43b2('0x26')](function(_0xab0269){return _0xab0269;});}return null;};}function removeEntity(_0x1a63f7,_0x59987e){return function(_0x5b8462){if(_0x5b8462){return _0x5b8462['destroy']()['then'](function(){_0x1a63f7[_0x43b2('0x1a')](0xcc)[_0x43b2('0x27')]();});}};}function handleEntityNotFound(_0x1589d3,_0x2c99a8){return function(_0x44fe27){if(!_0x44fe27){_0x1589d3[_0x43b2('0x19')](0x194);}return _0x44fe27;};}function handleError(_0x2d1d43,_0x26dc98){_0x26dc98=_0x26dc98||0x1f4;return function(_0x5315af){logger['error'](_0x5315af['stack']);if(_0x5315af[_0x43b2('0x28')]){delete _0x5315af[_0x43b2('0x28')];}_0x2d1d43[_0x43b2('0x1a')](_0x26dc98)[_0x43b2('0x29')](_0x5315af);};}exports[_0x43b2('0x2a')]=function(_0x5760c7,_0x4b4f4a){var _0x2299fb={},_0x1de022={},_0x9056f7={'count':0x0,'rows':[]};var _0x5899a2=_[_0x43b2('0x2b')](db[_0x43b2('0x2c')][_0x43b2('0x2d')],function(_0x5bcd4a){return{'name':_0x5bcd4a[_0x43b2('0x2e')],'type':_0x5bcd4a[_0x43b2('0x2f')][_0x43b2('0x30')]};});_0x1de022[_0x43b2('0x31')]=_[_0x43b2('0x2b')](_0x5899a2,_0x43b2('0x28'));_0x1de022[_0x43b2('0x32')]=_[_0x43b2('0x33')](_0x5760c7[_0x43b2('0x32')]);_0x1de022['filters']=_[_0x43b2('0x34')](_0x1de022['model'],_0x1de022[_0x43b2('0x32')]);_0x2299fb['attributes']=_[_0x43b2('0x34')](_0x1de022[_0x43b2('0x31')],qs[_0x43b2('0x35')](_0x5760c7[_0x43b2('0x32')][_0x43b2('0x35')]));_0x2299fb[_0x43b2('0x36')]=_0x2299fb[_0x43b2('0x36')][_0x43b2('0x37')]?_0x2299fb[_0x43b2('0x36')]:_0x1de022['model'];if(!_0x5760c7[_0x43b2('0x32')][_0x43b2('0x38')](_0x43b2('0x39'))){_0x2299fb[_0x43b2('0x1e')]=qs[_0x43b2('0x1e')](_0x5760c7[_0x43b2('0x32')][_0x43b2('0x1e')]);_0x2299fb[_0x43b2('0x1c')]=qs[_0x43b2('0x1c')](_0x5760c7['query']['offset']);}_0x2299fb[_0x43b2('0x3a')]=qs[_0x43b2('0x3b')](_0x5760c7['query'][_0x43b2('0x3b')]);_0x2299fb['where']=qs[_0x43b2('0x3c')](_['pick'](_0x5760c7[_0x43b2('0x32')],_0x1de022['filters']),_0x5899a2);if(_0x5760c7['query']['filter']){_0x2299fb[_0x43b2('0x3d')]=_['merge'](_0x2299fb[_0x43b2('0x3d')],{'$or':_[_0x43b2('0x2b')](_0x5899a2,function(_0xc11d99){if(_0xc11d99[_0x43b2('0x2f')]!=='VIRTUAL'){var _0x399478={};_0x399478[_0xc11d99[_0x43b2('0x28')]]={'$like':'%'+_0x5760c7['query']['filter']+'%'};return _0x399478;}})});}_0x2299fb=_[_0x43b2('0x3e')]({},_0x2299fb,_0x5760c7['options']);var _0x301244={'where':_0x2299fb[_0x43b2('0x3d')]};return db[_0x43b2('0x2c')]['count'](_0x301244)[_0x43b2('0x26')](function(_0x49929d){_0x9056f7['count']=_0x49929d;if(_0x5760c7[_0x43b2('0x32')][_0x43b2('0x3f')]){_0x2299fb[_0x43b2('0x40')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x2299fb);})[_0x43b2('0x26')](function(_0x3ff172){_0x9056f7[_0x43b2('0x41')]=_0x3ff172;return _0x9056f7;})[_0x43b2('0x26')](respondWithFilteredResult(_0x4b4f4a,_0x2299fb))[_0x43b2('0x42')](handleError(_0x4b4f4a,null));};exports['show']=function(_0xee38f0,_0x2730cc){var _0x2f9b5f={'raw':!![],'where':{'id':_0xee38f0[_0x43b2('0x43')]['id']}},_0x3afc38={};_0x3afc38[_0x43b2('0x31')]=_[_0x43b2('0x33')](db[_0x43b2('0x2c')][_0x43b2('0x2d')]);_0x3afc38['query']=_[_0x43b2('0x33')](_0xee38f0[_0x43b2('0x32')]);_0x3afc38[_0x43b2('0x3c')]=_[_0x43b2('0x34')](_0x3afc38['model'],_0x3afc38['query']);_0x2f9b5f[_0x43b2('0x36')]=_[_0x43b2('0x34')](_0x3afc38[_0x43b2('0x31')],qs[_0x43b2('0x35')](_0xee38f0['query'][_0x43b2('0x35')]));_0x2f9b5f[_0x43b2('0x36')]=_0x2f9b5f[_0x43b2('0x36')]['length']?_0x2f9b5f[_0x43b2('0x36')]:_0x3afc38[_0x43b2('0x31')];if(_0xee38f0[_0x43b2('0x32')][_0x43b2('0x3f')]){_0x2f9b5f['include']=[{'all':!![]}];}_0x2f9b5f=_[_0x43b2('0x3e')]({},_0x2f9b5f,_0xee38f0['options']);return db[_0x43b2('0x2c')]['find'](_0x2f9b5f)[_0x43b2('0x26')](handleEntityNotFound(_0x2730cc,null))[_0x43b2('0x26')](respondWithResult(_0x2730cc,null))[_0x43b2('0x42')](handleError(_0x2730cc,null));};exports[_0x43b2('0x44')]=function(_0x3d437a,_0x13b671){return db[_0x43b2('0x2c')][_0x43b2('0x44')](_0x3d437a['body'],{})[_0x43b2('0x26')](respondWithResult(_0x13b671,0xc9))[_0x43b2('0x42')](handleError(_0x13b671,null));};exports[_0x43b2('0x25')]=function(_0x506a0a,_0x560c17){if(_0x506a0a['body']['id']){delete _0x506a0a[_0x43b2('0x45')]['id'];}return db[_0x43b2('0x2c')][_0x43b2('0x46')]({'where':{'id':_0x506a0a['params']['id']}})[_0x43b2('0x26')](handleEntityNotFound(_0x560c17,null))['then'](saveUpdates(_0x506a0a['body'],null))[_0x43b2('0x26')](respondWithResult(_0x560c17,null))[_0x43b2('0x42')](handleError(_0x560c17,null));};exports[_0x43b2('0x47')]=function(_0x61d767,_0x42956e){return db[_0x43b2('0x2c')][_0x43b2('0x46')]({'where':{'id':_0x61d767[_0x43b2('0x43')]['id']}})[_0x43b2('0x26')](handleEntityNotFound(_0x42956e,null))['then'](removeEntity(_0x42956e,null))[_0x43b2('0x42')](handleError(_0x42956e,null));};exports['describe']=function(_0x31c6a0,_0x17a136){return db[_0x43b2('0x2c')][_0x43b2('0x48')]()[_0x43b2('0x26')](respondWithResult(_0x17a136,null))[_0x43b2('0x42')](handleError(_0x17a136,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 59f3bf3..8076238 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x3cb6d8,_0x19ff85){var _0x5c7088=function(_0x731044){while(--_0x731044){_0x3cb6d8['push'](_0x3cb6d8['shift']());}};_0x5c7088(++_0x19ff85);}(_0x70e0,0x17b));var _0x070e=function(_0x1bad84,_0x2a46b7){_0x1bad84=_0x1bad84-0x0;var _0x39bd01=_0x70e0[_0x1bad84];return _0x39bd01;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1a5894a..4b19fac 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 _0xeb31=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','where','limit'];(function(_0x5238d2,_0x5a5e2a){var _0x26d3e2=function(_0x5b1cbf){while(--_0x5b1cbf){_0x5238d2['push'](_0x5238d2['shift']());}};_0x26d3e2(++_0x5a5e2a);}(_0xeb31,0xf8));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1eb3('0x0'));var util=require(_0x1eb3('0x1'));var moment=require(_0x1eb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x1eb3('0x3'));var fs=require('fs');var Redis=require(_0x1eb3('0x4'));var db=require(_0x1eb3('0x5'))['db'];var utils=require(_0x1eb3('0x6'));var logger=require(_0x1eb3('0x7'))('rpc');var config=require(_0x1eb3('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1eb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3f81,_0x5e0735,_0x25ea26){return new BPromise(function(_0x29bc1f,_0x5a33cd){return client[_0x1eb3('0xa')](_0x5a3f81,_0x25ea26)[_0x1eb3('0xb')](function(_0x4d6215){logger[_0x1eb3('0xc')](_0x1eb3('0xd'),_0x5e0735,_0x1eb3('0xe'));logger[_0x1eb3('0xf')](_0x1eb3('0x10'),_0x5e0735,_0x1eb3('0xe'),JSON[_0x1eb3('0x11')](_0x4d6215));if(_0x4d6215[_0x1eb3('0x12')]){if(_0x4d6215[_0x1eb3('0x12')][_0x1eb3('0x13')]===0x1f4){logger['error'](_0x1eb3('0xd'),_0x5e0735,_0x4d6215[_0x1eb3('0x12')]['message']);return _0x5a33cd(_0x4d6215[_0x1eb3('0x12')][_0x1eb3('0x14')]);}logger[_0x1eb3('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x5e0735,_0x4d6215['error'][_0x1eb3('0x14')]);return _0x29bc1f(_0x4d6215[_0x1eb3('0x12')][_0x1eb3('0x14')]);}else{logger['info'](_0x1eb3('0xd'),_0x5e0735,'request\x20sent');_0x29bc1f(_0x4d6215[_0x1eb3('0x15')][_0x1eb3('0x14')]);}})[_0x1eb3('0x16')](function(_0x3cab3a){logger[_0x1eb3('0x12')](_0x1eb3('0xd'),_0x5e0735,_0x3cab3a);_0x5a33cd(_0x3cab3a);});});}exports[_0x1eb3('0x17')]=function(_0x39c1d7){var _0x2075ce=this;return new Promise(function(_0x2ca2fa,_0x1c12d1){return db[_0x1eb3('0x18')]['create'](_0x39c1d7[_0x1eb3('0x19')],{'raw':_0x39c1d7[_0x1eb3('0x1a')]?_0x39c1d7['options'][_0x1eb3('0x1b')]===undefined?!![]:![]:!![]})[_0x1eb3('0xb')](function(_0x65d8b8){logger[_0x1eb3('0xc')](_0x1eb3('0x17'),_0x39c1d7);logger['debug']('CreateSmsQueueReport',_0x39c1d7,JSON[_0x1eb3('0x11')](_0x65d8b8));_0x2ca2fa(_0x65d8b8);})[_0x1eb3('0x16')](function(_0x5e538f){logger[_0x1eb3('0x12')](_0x1eb3('0x17'),_0x5e538f[_0x1eb3('0x14')],_0x39c1d7);_0x1c12d1(_0x2075ce[_0x1eb3('0x12')](0x1f4,_0x5e538f['message']));});});};exports[_0x1eb3('0x1c')]=function(_0x33b33b){var _0x1d5e71=this;return new Promise(function(_0x1afc5f,_0x14ccc3){return db[_0x1eb3('0x18')]['update'](_0x33b33b['body'],{'raw':_0x33b33b[_0x1eb3('0x1a')]?_0x33b33b[_0x1eb3('0x1a')][_0x1eb3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33b33b[_0x1eb3('0x1a')]?_0x33b33b[_0x1eb3('0x1a')][_0x1eb3('0x1d')]||null:null,'attributes':_0x33b33b[_0x1eb3('0x1a')]?_0x33b33b[_0x1eb3('0x1a')]['attributes']||null:null,'limit':_0x33b33b['options']?_0x33b33b[_0x1eb3('0x1a')][_0x1eb3('0x1e')]||null:null})[_0x1eb3('0xb')](function(_0x5e2788){logger[_0x1eb3('0xc')]('UpdateSmsQueueReport',_0x33b33b);logger[_0x1eb3('0xf')]('UpdateSmsQueueReport',_0x33b33b,JSON[_0x1eb3('0x11')](_0x5e2788));_0x1afc5f(_0x5e2788);})[_0x1eb3('0x16')](function(_0x47c038){logger['error']('UpdateSmsQueueReport',_0x47c038[_0x1eb3('0x14')],_0x33b33b);_0x14ccc3(_0x1d5e71[_0x1eb3('0x12')](0x1f4,_0x47c038[_0x1eb3('0x14')]));});});}; \ No newline at end of file +var _0xb271=['then','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw'];(function(_0x7e7838,_0x1a193d){var _0x5213bb=function(_0x5062c4){while(--_0x5062c4){_0x7e7838['push'](_0x7e7838['shift']());}};_0x5213bb(++_0x1a193d);}(_0xb271,0x126));var _0x1b27=function(_0x303e68,_0x108575){_0x303e68=_0x303e68-0x0;var _0x4046d0=_0xb271[_0x303e68];return _0x4046d0;};'use strict';var _=require(_0x1b27('0x0'));var util=require(_0x1b27('0x1'));var moment=require(_0x1b27('0x2'));var BPromise=require(_0x1b27('0x3'));var rs=require(_0x1b27('0x4'));var fs=require('fs');var Redis=require(_0x1b27('0x5'));var db=require(_0x1b27('0x6'))['db'];var utils=require(_0x1b27('0x7'));var logger=require(_0x1b27('0x8'))(_0x1b27('0x9'));var config=require('../../config/environment');var jayson=require(_0x1b27('0xa'));var client=jayson[_0x1b27('0xb')][_0x1b27('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22fa7a,_0x2ce7c4,_0x30518c){return new BPromise(function(_0x29ed20,_0x4189de){return client[_0x1b27('0xd')](_0x22fa7a,_0x30518c)['then'](function(_0x270ee1){logger[_0x1b27('0xe')](_0x1b27('0xf'),_0x2ce7c4,_0x1b27('0x10'));logger[_0x1b27('0x11')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2ce7c4,_0x1b27('0x10'),JSON[_0x1b27('0x12')](_0x270ee1));if(_0x270ee1[_0x1b27('0x13')]){if(_0x270ee1[_0x1b27('0x13')][_0x1b27('0x14')]===0x1f4){logger[_0x1b27('0x13')](_0x1b27('0xf'),_0x2ce7c4,_0x270ee1[_0x1b27('0x13')][_0x1b27('0x15')]);return _0x4189de(_0x270ee1['error'][_0x1b27('0x15')]);}logger['error'](_0x1b27('0xf'),_0x2ce7c4,_0x270ee1[_0x1b27('0x13')][_0x1b27('0x15')]);return _0x29ed20(_0x270ee1[_0x1b27('0x13')][_0x1b27('0x15')]);}else{logger[_0x1b27('0xe')](_0x1b27('0xf'),_0x2ce7c4,'request\x20sent');_0x29ed20(_0x270ee1[_0x1b27('0x16')][_0x1b27('0x15')]);}})[_0x1b27('0x17')](function(_0x173373){logger[_0x1b27('0x13')](_0x1b27('0xf'),_0x2ce7c4,_0x173373);_0x4189de(_0x173373);});});}exports[_0x1b27('0x18')]=function(_0x284975){var _0x124cbb=this;return new Promise(function(_0x157f4b,_0x5f3de8){return db[_0x1b27('0x19')][_0x1b27('0x1a')](_0x284975[_0x1b27('0x1b')],{'raw':_0x284975['options']?_0x284975[_0x1b27('0x1c')][_0x1b27('0x1d')]===undefined?!![]:![]:!![]})[_0x1b27('0x1e')](function(_0x26f575){logger[_0x1b27('0xe')](_0x1b27('0x18'),_0x284975);logger[_0x1b27('0x11')](_0x1b27('0x18'),_0x284975,JSON[_0x1b27('0x12')](_0x26f575));_0x157f4b(_0x26f575);})[_0x1b27('0x17')](function(_0x48aff2){logger['error'](_0x1b27('0x18'),_0x48aff2[_0x1b27('0x15')],_0x284975);_0x5f3de8(_0x124cbb[_0x1b27('0x13')](0x1f4,_0x48aff2[_0x1b27('0x15')]));});});};exports[_0x1b27('0x1f')]=function(_0x254a68){var _0x15d834=this;return new Promise(function(_0x43d7e5,_0x21ab4c){return db[_0x1b27('0x19')][_0x1b27('0x20')](_0x254a68[_0x1b27('0x1b')],{'raw':_0x254a68[_0x1b27('0x1c')]?_0x254a68[_0x1b27('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254a68[_0x1b27('0x1c')]?_0x254a68[_0x1b27('0x1c')][_0x1b27('0x21')]||null:null,'attributes':_0x254a68['options']?_0x254a68[_0x1b27('0x1c')][_0x1b27('0x22')]||null:null,'limit':_0x254a68[_0x1b27('0x1c')]?_0x254a68[_0x1b27('0x1c')][_0x1b27('0x23')]||null:null})[_0x1b27('0x1e')](function(_0x571247){logger[_0x1b27('0xe')](_0x1b27('0x1f'),_0x254a68);logger['debug'](_0x1b27('0x1f'),_0x254a68,JSON[_0x1b27('0x12')](_0x571247));_0x43d7e5(_0x571247);})[_0x1b27('0x17')](function(_0x5af611){logger['error']('UpdateSmsQueueReport',_0x5af611[_0x1b27('0x15')],_0x254a68);_0x21ab4c(_0x15d834[_0x1b27('0x13')](0x1f4,_0x5af611[_0x1b27('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 221e366..dcbc577 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 _0xe5b3=['../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2413cb,_0x170870){var _0x216efd=function(_0x3d324a){while(--_0x3d324a){_0x2413cb['push'](_0x2413cb['shift']());}};_0x216efd(++_0x170870);}(_0xe5b3,0x133));var _0x3e5b=function(_0x245b3b,_0x161dff){_0x245b3b=_0x245b3b-0x0;var _0x249d89=_0xe5b3[_0x245b3b];return _0x249d89;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router; \ No newline at end of file +var _0x4873=['./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1997f3,_0x4bbaf6){var _0x524dcb=function(_0x29e1bd){while(--_0x29e1bd){_0x1997f3['push'](_0x1997f3['shift']());}};_0x524dcb(++_0x4bbaf6);}(_0x4873,0x1df));var _0x3487=function(_0x5d8de6,_0x4dc16b){_0x5d8de6=_0x5d8de6-0x0;var _0x22ab90=_0x4873[_0x5d8de6];return _0x22ab90;};'use strict';var multer=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var path=require(_0x3487('0x2'));var timeout=require('connect-timeout');var express=require(_0x3487('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3487('0x4'));var interaction=require(_0x3487('0x5'));var config=require(_0x3487('0x6'));var controller=require(_0x3487('0x7'));router[_0x3487('0x8')]('/',auth[_0x3487('0x9')](),controller[_0x3487('0xa')]);router[_0x3487('0x8')]('/describe',auth[_0x3487('0x9')](),controller[_0x3487('0xb')]);router[_0x3487('0x8')](_0x3487('0xc'),auth[_0x3487('0x9')](),controller['show']);router[_0x3487('0xd')]('/',auth['isAuthenticated'](),controller[_0x3487('0xe')]);router[_0x3487('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3487('0x10')]);router[_0x3487('0x11')]('/:id',auth[_0x3487('0x9')](),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 b1ddeff..e38a985 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3d0fb4,_0x4e5464){var _0xea699f=function(_0x3f863d){while(--_0x3f863d){_0x3d0fb4['push'](_0x3d0fb4['shift']());}};_0xea699f(++_0x4e5464);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2799f6,_0x5c1ab1){var _0x3734e4=function(_0x53d210){while(--_0x53d210){_0x2799f6['push'](_0x2799f6['shift']());}};_0x3734e4(++_0x5c1ab1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0xf3cd[_0x39cc8f];return _0x15e616;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6ceeeb9..38c474e 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 _0xb396=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','catch','show','params','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4bcd16,_0x519256){var _0x61c0fb=function(_0x46fe6e){while(--_0x46fe6e){_0x4bcd16['push'](_0x4bcd16['shift']());}};_0x61c0fb(++_0x519256);}(_0xb396,0x168));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6b39('0x0'));var jsonpatch=require(_0x6b39('0x1'));var rp=require(_0x6b39('0x2'));var moment=require(_0x6b39('0x3'));var BPromise=require(_0x6b39('0x4'));var Mustache=require(_0x6b39('0x5'));var util=require(_0x6b39('0x6'));var path=require('path');var sox=require(_0x6b39('0x7'));var csv=require(_0x6b39('0x8'));var ejs=require(_0x6b39('0x9'));var fs=require('fs');var fs_extra=require(_0x6b39('0xa'));var _=require(_0x6b39('0xb'));var squel=require(_0x6b39('0xc'));var crypto=require(_0x6b39('0xd'));var jsforce=require(_0x6b39('0xe'));var deskjs=require(_0x6b39('0xf'));var toCsv=require(_0x6b39('0x8'));var querystring=require(_0x6b39('0x10'));var Papa=require(_0x6b39('0x11'));var Redis=require(_0x6b39('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6b39('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b39('0x14'));var utils=require(_0x6b39('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b39('0x16'));var db=require(_0x6b39('0x17'))['db'];function respondWithStatusCode(_0x24a562,_0x30dc63){_0x30dc63=_0x30dc63||0xcc;return function(_0x30d11b){if(_0x30d11b){return _0x24a562[_0x6b39('0x18')](_0x30dc63);}return _0x24a562['status'](_0x30dc63)[_0x6b39('0x19')]();};}function respondWithResult(_0x4078ab,_0x401fad){_0x401fad=_0x401fad||0xc8;return function(_0x40ed5d){if(_0x40ed5d){return _0x4078ab[_0x6b39('0x1a')](_0x401fad)['json'](_0x40ed5d);}};}function respondWithFilteredResult(_0x5112cf,_0x2f1f68){return function(_0x327e8f){if(_0x327e8f){var _0x54013c=typeof _0x2f1f68[_0x6b39('0x1b')]===_0x6b39('0x1c')&&typeof _0x2f1f68[_0x6b39('0x1d')]===_0x6b39('0x1c');var _0x9f23a7=_0x327e8f['count'];var _0x315728=_0x54013c?0x0:_0x2f1f68[_0x6b39('0x1b')];var _0x44ced6=_0x54013c?_0x327e8f[_0x6b39('0x1e')]:_0x2f1f68[_0x6b39('0x1b')]+_0x2f1f68[_0x6b39('0x1d')];var _0x4ef674;if(_0x44ced6>=_0x9f23a7){_0x44ced6=_0x9f23a7;_0x4ef674=0xc8;}else{_0x4ef674=0xce;}_0x5112cf['status'](_0x4ef674);return _0x5112cf['set'](_0x6b39('0x1f'),_0x315728+'-'+_0x44ced6+'/'+_0x9f23a7)['json'](_0x327e8f);}return null;};}function patchUpdates(_0x2d0467){return function(_0x18273a){try{jsonpatch[_0x6b39('0x20')](_0x18273a,_0x2d0467,!![]);}catch(_0x334d10){return BPromise[_0x6b39('0x21')](_0x334d10);}return _0x18273a[_0x6b39('0x22')]();};}function saveUpdates(_0x197482,_0x11e546){return function(_0x40395f){if(_0x40395f){return _0x40395f[_0x6b39('0x23')](_0x197482)[_0x6b39('0x24')](function(_0x4826e8){return _0x4826e8;});}return null;};}function removeEntity(_0x4310f4,_0x474d8b){return function(_0x47d763){if(_0x47d763){return _0x47d763['destroy']()['then'](function(){_0x4310f4['status'](0xcc)[_0x6b39('0x19')]();});}};}function handleEntityNotFound(_0x565166,_0x2ad135){return function(_0x4dcd76){if(!_0x4dcd76){_0x565166[_0x6b39('0x18')](0x194);}return _0x4dcd76;};}function handleError(_0x13f79a,_0x135ac5){_0x135ac5=_0x135ac5||0x1f4;return function(_0x27bca8){logger['error'](_0x27bca8[_0x6b39('0x25')]);if(_0x27bca8[_0x6b39('0x26')]){delete _0x27bca8[_0x6b39('0x26')];}_0x13f79a[_0x6b39('0x1a')](_0x135ac5)[_0x6b39('0x27')](_0x27bca8);};}exports[_0x6b39('0x28')]=function(_0x3e7ef6,_0x6e5de5){var _0x21e4f2={},_0x408b86={},_0x471110={'count':0x0,'rows':[]};var _0x509673=_[_0x6b39('0x29')](db[_0x6b39('0x2a')][_0x6b39('0x2b')],function(_0x158d28){return{'name':_0x158d28[_0x6b39('0x2c')],'type':_0x158d28[_0x6b39('0x2d')][_0x6b39('0x2e')]};});_0x408b86[_0x6b39('0x2f')]=_[_0x6b39('0x29')](_0x509673,'name');_0x408b86[_0x6b39('0x30')]=_[_0x6b39('0x31')](_0x3e7ef6[_0x6b39('0x30')]);_0x408b86[_0x6b39('0x32')]=_[_0x6b39('0x33')](_0x408b86[_0x6b39('0x2f')],_0x408b86[_0x6b39('0x30')]);_0x21e4f2[_0x6b39('0x34')]=_[_0x6b39('0x33')](_0x408b86['model'],qs[_0x6b39('0x35')](_0x3e7ef6[_0x6b39('0x30')][_0x6b39('0x35')]));_0x21e4f2['attributes']=_0x21e4f2[_0x6b39('0x34')][_0x6b39('0x36')]?_0x21e4f2[_0x6b39('0x34')]:_0x408b86[_0x6b39('0x2f')];if(!_0x3e7ef6[_0x6b39('0x30')]['hasOwnProperty']('nolimit')){_0x21e4f2['limit']=qs[_0x6b39('0x1d')](_0x3e7ef6['query']['limit']);_0x21e4f2[_0x6b39('0x1b')]=qs[_0x6b39('0x1b')](_0x3e7ef6[_0x6b39('0x30')][_0x6b39('0x1b')]);}_0x21e4f2[_0x6b39('0x37')]=qs[_0x6b39('0x38')](_0x3e7ef6['query']['sort']);_0x21e4f2['where']=qs['filters'](_[_0x6b39('0x39')](_0x3e7ef6[_0x6b39('0x30')],_0x408b86[_0x6b39('0x32')]),_0x509673);if(_0x3e7ef6[_0x6b39('0x30')][_0x6b39('0x3a')]){_0x21e4f2['where']=_[_0x6b39('0x3b')](_0x21e4f2['where'],{'$or':_[_0x6b39('0x29')](_0x509673,function(_0x2db849){if(_0x2db849[_0x6b39('0x2d')]!==_0x6b39('0x3c')){var _0x5a29f6={};_0x5a29f6[_0x2db849[_0x6b39('0x26')]]={'$like':'%'+_0x3e7ef6['query']['filter']+'%'};return _0x5a29f6;}})});}_0x21e4f2=_[_0x6b39('0x3b')]({},_0x21e4f2,_0x3e7ef6[_0x6b39('0x3d')]);var _0x4684d3={'where':_0x21e4f2[_0x6b39('0x3e')]};return db[_0x6b39('0x2a')][_0x6b39('0x1e')](_0x4684d3)[_0x6b39('0x24')](function(_0x1babb6){_0x471110[_0x6b39('0x1e')]=_0x1babb6;if(_0x3e7ef6[_0x6b39('0x30')][_0x6b39('0x3f')]){_0x21e4f2['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x6b39('0x40')](_0x21e4f2);})[_0x6b39('0x24')](function(_0x3f9be5){_0x471110[_0x6b39('0x41')]=_0x3f9be5;return _0x471110;})[_0x6b39('0x24')](respondWithFilteredResult(_0x6e5de5,_0x21e4f2))[_0x6b39('0x42')](handleError(_0x6e5de5,null));};exports[_0x6b39('0x43')]=function(_0x1f36f9,_0xaece58){var _0x2a5244={'raw':!![],'where':{'id':_0x1f36f9[_0x6b39('0x44')]['id']}},_0x678353={};_0x678353[_0x6b39('0x2f')]=_['keys'](db['SmsTransferReport'][_0x6b39('0x2b')]);_0x678353['query']=_[_0x6b39('0x31')](_0x1f36f9['query']);_0x678353[_0x6b39('0x32')]=_[_0x6b39('0x33')](_0x678353[_0x6b39('0x2f')],_0x678353['query']);_0x2a5244[_0x6b39('0x34')]=_[_0x6b39('0x33')](_0x678353[_0x6b39('0x2f')],qs['fields'](_0x1f36f9[_0x6b39('0x30')][_0x6b39('0x35')]));_0x2a5244[_0x6b39('0x34')]=_0x2a5244['attributes'][_0x6b39('0x36')]?_0x2a5244['attributes']:_0x678353['model'];if(_0x1f36f9['query']['includeAll']){_0x2a5244['include']=[{'all':!![]}];}_0x2a5244=_['merge']({},_0x2a5244,_0x1f36f9[_0x6b39('0x3d')]);return db['SmsTransferReport']['find'](_0x2a5244)[_0x6b39('0x24')](handleEntityNotFound(_0xaece58,null))[_0x6b39('0x24')](respondWithResult(_0xaece58,null))['catch'](handleError(_0xaece58,null));};exports[_0x6b39('0x45')]=function(_0x173ca6,_0x184324){return db[_0x6b39('0x2a')]['create'](_0x173ca6[_0x6b39('0x46')],{})[_0x6b39('0x24')](respondWithResult(_0x184324,0xc9))['catch'](handleError(_0x184324,null));};exports[_0x6b39('0x23')]=function(_0x43abdf,_0x1941eb){if(_0x43abdf[_0x6b39('0x46')]['id']){delete _0x43abdf['body']['id'];}return db[_0x6b39('0x2a')][_0x6b39('0x47')]({'where':{'id':_0x43abdf[_0x6b39('0x44')]['id']}})[_0x6b39('0x24')](handleEntityNotFound(_0x1941eb,null))[_0x6b39('0x24')](saveUpdates(_0x43abdf[_0x6b39('0x46')],null))[_0x6b39('0x24')](respondWithResult(_0x1941eb,null))['catch'](handleError(_0x1941eb,null));};exports['destroy']=function(_0x5ac03b,_0x32cf99){return db[_0x6b39('0x2a')][_0x6b39('0x47')]({'where':{'id':_0x5ac03b[_0x6b39('0x44')]['id']}})[_0x6b39('0x24')](handleEntityNotFound(_0x32cf99,null))[_0x6b39('0x24')](removeEntity(_0x32cf99,null))[_0x6b39('0x42')](handleError(_0x32cf99,null));};exports[_0x6b39('0x48')]=function(_0x304667,_0x30bf86){return db[_0x6b39('0x2a')][_0x6b39('0x48')]()[_0x6b39('0x24')](respondWithResult(_0x30bf86,null))['catch'](handleError(_0x30bf86,null));}; \ No newline at end of file +var _0xb1a8=['stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','catch','show','find','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus'];(function(_0x72c98f,_0x15881a){var _0xec0971=function(_0x3aaf00){while(--_0x3aaf00){_0x72c98f['push'](_0x72c98f['shift']());}};_0xec0971(++_0x15881a);}(_0xb1a8,0x19b));var _0x8b1a=function(_0xdc4604,_0x5ab1e6){_0xdc4604=_0xdc4604-0x0;var _0x53fa5b=_0xb1a8[_0xdc4604];return _0x53fa5b;};'use strict';var emlformat=require(_0x8b1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b1a('0x1'));var jsonpatch=require(_0x8b1a('0x2'));var rp=require('request-promise');var moment=require(_0x8b1a('0x3'));var BPromise=require(_0x8b1a('0x4'));var Mustache=require('mustache');var util=require(_0x8b1a('0x5'));var path=require(_0x8b1a('0x6'));var sox=require(_0x8b1a('0x7'));var csv=require(_0x8b1a('0x8'));var ejs=require(_0x8b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x8b1a('0xa'));var _=require(_0x8b1a('0xb'));var squel=require(_0x8b1a('0xc'));var crypto=require(_0x8b1a('0xd'));var jsforce=require(_0x8b1a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b1a('0x8'));var querystring=require(_0x8b1a('0xf'));var Papa=require(_0x8b1a('0x10'));var Redis=require(_0x8b1a('0x11'));var authService=require(_0x8b1a('0x12'));var qs=require(_0x8b1a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b1a('0x14'));var logger=require(_0x8b1a('0x15'))(_0x8b1a('0x16'));var utils=require(_0x8b1a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8b1a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x382d99,_0xb79181){_0xb79181=_0xb79181||0xcc;return function(_0x556a7a){if(_0x556a7a){return _0x382d99['sendStatus'](_0xb79181);}return _0x382d99[_0x8b1a('0x19')](_0xb79181)['end']();};}function respondWithResult(_0x4d6272,_0x42edf5){_0x42edf5=_0x42edf5||0xc8;return function(_0xef8071){if(_0xef8071){return _0x4d6272[_0x8b1a('0x19')](_0x42edf5)['json'](_0xef8071);}};}function respondWithFilteredResult(_0x4667f3,_0x49c375){return function(_0x15859c){if(_0x15859c){var _0x15962a=typeof _0x49c375[_0x8b1a('0x1a')]===_0x8b1a('0x1b')&&typeof _0x49c375[_0x8b1a('0x1c')]==='undefined';var _0x2081e4=_0x15859c['count'];var _0x56c86f=_0x15962a?0x0:_0x49c375[_0x8b1a('0x1a')];var _0x402699=_0x15962a?_0x15859c[_0x8b1a('0x1d')]:_0x49c375['offset']+_0x49c375[_0x8b1a('0x1c')];var _0x1a78d0;if(_0x402699>=_0x2081e4){_0x402699=_0x2081e4;_0x1a78d0=0xc8;}else{_0x1a78d0=0xce;}_0x4667f3[_0x8b1a('0x19')](_0x1a78d0);return _0x4667f3[_0x8b1a('0x1e')](_0x8b1a('0x1f'),_0x56c86f+'-'+_0x402699+'/'+_0x2081e4)['json'](_0x15859c);}return null;};}function patchUpdates(_0x507bf1){return function(_0x291b6c){try{jsonpatch[_0x8b1a('0x20')](_0x291b6c,_0x507bf1,!![]);}catch(_0x5cf447){return BPromise[_0x8b1a('0x21')](_0x5cf447);}return _0x291b6c[_0x8b1a('0x22')]();};}function saveUpdates(_0x168a7b,_0x1b506e){return function(_0x1ffece){if(_0x1ffece){return _0x1ffece[_0x8b1a('0x23')](_0x168a7b)[_0x8b1a('0x24')](function(_0x347f89){return _0x347f89;});}return null;};}function removeEntity(_0x375b48,_0x44c426){return function(_0x37b76b){if(_0x37b76b){return _0x37b76b['destroy']()[_0x8b1a('0x24')](function(){_0x375b48[_0x8b1a('0x19')](0xcc)[_0x8b1a('0x25')]();});}};}function handleEntityNotFound(_0x29f946,_0xc36799){return function(_0x21020d){if(!_0x21020d){_0x29f946[_0x8b1a('0x26')](0x194);}return _0x21020d;};}function handleError(_0x31d5e9,_0x4241ec){_0x4241ec=_0x4241ec||0x1f4;return function(_0x26cdd7){logger['error'](_0x26cdd7[_0x8b1a('0x27')]);if(_0x26cdd7[_0x8b1a('0x28')]){delete _0x26cdd7['name'];}_0x31d5e9[_0x8b1a('0x19')](_0x4241ec)['send'](_0x26cdd7);};}exports[_0x8b1a('0x29')]=function(_0x480ae7,_0x46662d){var _0x4bb40c={},_0x42e3d9={},_0x966c0d={'count':0x0,'rows':[]};var _0x1745f5=_[_0x8b1a('0x2a')](db['SmsTransferReport'][_0x8b1a('0x2b')],function(_0x1159be){return{'name':_0x1159be[_0x8b1a('0x2c')],'type':_0x1159be['type'][_0x8b1a('0x2d')]};});_0x42e3d9[_0x8b1a('0x2e')]=_['map'](_0x1745f5,_0x8b1a('0x28'));_0x42e3d9[_0x8b1a('0x2f')]=_[_0x8b1a('0x30')](_0x480ae7[_0x8b1a('0x2f')]);_0x42e3d9[_0x8b1a('0x31')]=_[_0x8b1a('0x32')](_0x42e3d9[_0x8b1a('0x2e')],_0x42e3d9['query']);_0x4bb40c[_0x8b1a('0x33')]=_[_0x8b1a('0x32')](_0x42e3d9[_0x8b1a('0x2e')],qs['fields'](_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x34')]));_0x4bb40c[_0x8b1a('0x33')]=_0x4bb40c[_0x8b1a('0x33')][_0x8b1a('0x35')]?_0x4bb40c['attributes']:_0x42e3d9[_0x8b1a('0x2e')];if(!_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x36')]('nolimit')){_0x4bb40c[_0x8b1a('0x1c')]=qs[_0x8b1a('0x1c')](_0x480ae7['query'][_0x8b1a('0x1c')]);_0x4bb40c[_0x8b1a('0x1a')]=qs['offset'](_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x1a')]);}_0x4bb40c['order']=qs[_0x8b1a('0x37')](_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x37')]);_0x4bb40c['where']=qs[_0x8b1a('0x31')](_[_0x8b1a('0x38')](_0x480ae7[_0x8b1a('0x2f')],_0x42e3d9[_0x8b1a('0x31')]),_0x1745f5);if(_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x39')]){_0x4bb40c[_0x8b1a('0x3a')]=_[_0x8b1a('0x3b')](_0x4bb40c['where'],{'$or':_[_0x8b1a('0x2a')](_0x1745f5,function(_0x5522ac){if(_0x5522ac[_0x8b1a('0x3c')]!==_0x8b1a('0x3d')){var _0x4a359d={};_0x4a359d[_0x5522ac[_0x8b1a('0x28')]]={'$like':'%'+_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x39')]+'%'};return _0x4a359d;}})});}_0x4bb40c=_[_0x8b1a('0x3b')]({},_0x4bb40c,_0x480ae7[_0x8b1a('0x3e')]);var _0x11cf18={'where':_0x4bb40c[_0x8b1a('0x3a')]};return db[_0x8b1a('0x3f')]['count'](_0x11cf18)[_0x8b1a('0x24')](function(_0x10923f){_0x966c0d[_0x8b1a('0x1d')]=_0x10923f;if(_0x480ae7[_0x8b1a('0x2f')][_0x8b1a('0x40')]){_0x4bb40c[_0x8b1a('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8b1a('0x42')](_0x4bb40c);})['then'](function(_0x1dfc54){_0x966c0d['rows']=_0x1dfc54;return _0x966c0d;})[_0x8b1a('0x24')](respondWithFilteredResult(_0x46662d,_0x4bb40c))[_0x8b1a('0x43')](handleError(_0x46662d,null));};exports[_0x8b1a('0x44')]=function(_0x1d9518,_0x553b8d){var _0x118441={'raw':!![],'where':{'id':_0x1d9518['params']['id']}},_0x3b4f8a={};_0x3b4f8a[_0x8b1a('0x2e')]=_[_0x8b1a('0x30')](db[_0x8b1a('0x3f')][_0x8b1a('0x2b')]);_0x3b4f8a[_0x8b1a('0x2f')]=_[_0x8b1a('0x30')](_0x1d9518[_0x8b1a('0x2f')]);_0x3b4f8a[_0x8b1a('0x31')]=_[_0x8b1a('0x32')](_0x3b4f8a['model'],_0x3b4f8a[_0x8b1a('0x2f')]);_0x118441[_0x8b1a('0x33')]=_[_0x8b1a('0x32')](_0x3b4f8a[_0x8b1a('0x2e')],qs[_0x8b1a('0x34')](_0x1d9518['query']['fields']));_0x118441[_0x8b1a('0x33')]=_0x118441['attributes'][_0x8b1a('0x35')]?_0x118441[_0x8b1a('0x33')]:_0x3b4f8a[_0x8b1a('0x2e')];if(_0x1d9518[_0x8b1a('0x2f')][_0x8b1a('0x40')]){_0x118441[_0x8b1a('0x41')]=[{'all':!![]}];}_0x118441=_[_0x8b1a('0x3b')]({},_0x118441,_0x1d9518['options']);return db[_0x8b1a('0x3f')][_0x8b1a('0x45')](_0x118441)[_0x8b1a('0x24')](handleEntityNotFound(_0x553b8d,null))[_0x8b1a('0x24')](respondWithResult(_0x553b8d,null))[_0x8b1a('0x43')](handleError(_0x553b8d,null));};exports['create']=function(_0x43c777,_0x3ffd5d){return db[_0x8b1a('0x3f')][_0x8b1a('0x46')](_0x43c777['body'],{})[_0x8b1a('0x24')](respondWithResult(_0x3ffd5d,0xc9))[_0x8b1a('0x43')](handleError(_0x3ffd5d,null));};exports['update']=function(_0x25c8c4,_0x3f9509){if(_0x25c8c4['body']['id']){delete _0x25c8c4[_0x8b1a('0x47')]['id'];}return db[_0x8b1a('0x3f')][_0x8b1a('0x45')]({'where':{'id':_0x25c8c4['params']['id']}})[_0x8b1a('0x24')](handleEntityNotFound(_0x3f9509,null))[_0x8b1a('0x24')](saveUpdates(_0x25c8c4['body'],null))[_0x8b1a('0x24')](respondWithResult(_0x3f9509,null))[_0x8b1a('0x43')](handleError(_0x3f9509,null));};exports[_0x8b1a('0x48')]=function(_0x1ad4e3,_0x1587f7){return db['SmsTransferReport'][_0x8b1a('0x45')]({'where':{'id':_0x1ad4e3[_0x8b1a('0x49')]['id']}})[_0x8b1a('0x24')](handleEntityNotFound(_0x1587f7,null))[_0x8b1a('0x24')](removeEntity(_0x1587f7,null))['catch'](handleError(_0x1587f7,null));};exports[_0x8b1a('0x4a')]=function(_0x4ee103,_0x170fa1){return db[_0x8b1a('0x3f')][_0x8b1a('0x4a')]()[_0x8b1a('0x24')](respondWithResult(_0x170fa1,null))[_0x8b1a('0x43')](handleError(_0x170fa1,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a624ff3..3924548 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 _0x0cd6=['lodash','util','api','moment','request-promise','path','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x0cd6,0x113));var _0x60cd=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x0cd6[_0x25d2fb];return _0x1ded53;};'use strict';var _=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var logger=require('../../config/logger')(_0x60cd('0x2'));var moment=require(_0x60cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x60cd('0x4'));var fs=require('fs');var path=require(_0x60cd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60cd('0x6'));module[_0x60cd('0x7')]=function(_0x22f155,_0x4e3293){return _0x22f155[_0x60cd('0x8')]('SmsTransferReport',attributes,{'tableName':_0x60cd('0x9'),'paranoid':![],'indexes':[{'name':_0x60cd('0xa'),'fields':[_0x60cd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82d3=['define','uniqueid','util','../../config/logger','api','path','rimraf','../../config/environment','exports'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x82d3,0xa4));var _0x382d=function(_0x192b8f,_0x3ef379){_0x192b8f=_0x192b8f-0x0;var _0x231da1=_0x82d3[_0x192b8f];return _0x231da1;};'use strict';var _=require('lodash');var util=require(_0x382d('0x0'));var logger=require(_0x382d('0x1'))(_0x382d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x382d('0x3'));var rimraf=require(_0x382d('0x4'));var config=require(_0x382d('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x382d('0x6')]=function(_0xebe77d,_0x1429f1){return _0xebe77d[_0x382d('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x382d('0x8'),'fields':[_0x382d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5101614..82a1e80 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 _0x75a2=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x75a2,0x187));var _0x275a=function(_0x1eb2bd,_0x5d1980){_0x1eb2bd=_0x1eb2bd-0x0;var _0x2b59f5=_0x75a2[_0x1eb2bd];return _0x2b59f5;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32f0cb,_0x12cad9,_0x17ad5e){return new BPromise(function(_0x38b303,_0x525950){return client['request'](_0x32f0cb,_0x17ad5e)[_0x275a('0x8')](function(_0x46f9c7){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,'request\x20sent');logger[_0x275a('0x9')](_0x275a('0xa'),_0x12cad9,_0x275a('0xb'),JSON[_0x275a('0xc')](_0x46f9c7));if(_0x46f9c7[_0x275a('0xd')]){if(_0x46f9c7[_0x275a('0xd')][_0x275a('0xe')]===0x1f4){logger[_0x275a('0xd')](_0x275a('0xf'),_0x12cad9,_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);return _0x525950(_0x46f9c7['error'][_0x275a('0x10')]);}logger[_0x275a('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,_0x46f9c7['error'][_0x275a('0x10')]);return _0x38b303(_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);}else{logger[_0x275a('0x11')](_0x275a('0xf'),_0x12cad9,_0x275a('0xb'));_0x38b303(_0x46f9c7[_0x275a('0x12')][_0x275a('0x10')]);}})[_0x275a('0x13')](function(_0x58e54d){logger['error'](_0x275a('0xf'),_0x12cad9,_0x58e54d);_0x525950(_0x58e54d);});});} \ No newline at end of file +var _0xc999=['../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment','bluebird','../../config/logger'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xc999,0x176));var _0x9c99=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xc999[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0x9c99('0x0'));var moment=require(_0x9c99('0x1'));var BPromise=require(_0x9c99('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(_0x9c99('0x3'))('rpc');var config=require(_0x9c99('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9c99('0x5')][_0x9c99('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe80252,_0x47bfaa,_0xfa25e1){return new BPromise(function(_0x323317,_0x326099){return client[_0x9c99('0x7')](_0xe80252,_0xfa25e1)[_0x9c99('0x8')](function(_0xfe5788){logger['info'](_0x9c99('0x9'),_0x47bfaa,_0x9c99('0xa'));logger[_0x9c99('0xb')](_0x9c99('0xc'),_0x47bfaa,'request\x20sent',JSON[_0x9c99('0xd')](_0xfe5788));if(_0xfe5788[_0x9c99('0xe')]){if(_0xfe5788[_0x9c99('0xe')]['code']===0x1f4){logger[_0x9c99('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x47bfaa,_0xfe5788['error'][_0x9c99('0xf')]);return _0x326099(_0xfe5788[_0x9c99('0xe')][_0x9c99('0xf')]);}logger[_0x9c99('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x47bfaa,_0xfe5788[_0x9c99('0xe')]['message']);return _0x323317(_0xfe5788['error']['message']);}else{logger[_0x9c99('0x10')](_0x9c99('0x9'),_0x47bfaa,'request\x20sent');_0x323317(_0xfe5788[_0x9c99('0x11')]['message']);}})['catch'](function(_0x413965){logger[_0x9c99('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x47bfaa,_0x413965);_0x326099(_0x413965);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ed04c50..4a04bc1 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 _0xef2e=['get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','file','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xef2e,0x141));var _0xeef2=function(_0x36585d,_0x24d96e){_0x36585d=_0x36585d-0x0;var _0x450532=_0xef2e[_0x36585d];return _0x450532;};'use strict';var multer=require('multer');var util=require(_0xeef2('0x0'));var path=require(_0xeef2('0x1'));var timeout=require(_0xeef2('0x2'));var express=require(_0xeef2('0x3'));var router=express[_0xeef2('0x4')]();var fs_extra=require(_0xeef2('0x5'));var auth=require(_0xeef2('0x6'));var interaction=require(_0xeef2('0x7'));var config=require(_0xeef2('0x8'));var controller=require('./sound.controller');router[_0xeef2('0x9')]('/',auth[_0xeef2('0xa')](),controller[_0xeef2('0xb')]);router['get'](_0xeef2('0xc'),auth['isAuthenticated'](),controller[_0xeef2('0xd')]);router[_0xeef2('0x9')](_0xeef2('0xe'),auth[_0xeef2('0xa')](),controller[_0xeef2('0xf')]);var upload=multer({'storage':multer[_0xeef2('0x10')]({'destination':function(_0x457005,_0x164277,_0x4d3112){_0x4d3112(null,path[_0xeef2('0x11')](config[_0xeef2('0x12')],_0xeef2('0x13')));},'filename':function(_0x246615,_0x2deb85,_0xb04ac7){_0x2deb85[_0xeef2('0x14')]=_0x2deb85[_0xeef2('0x14')][_0xeef2('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb04ac7(null,util[_0xeef2('0x16')](_0xeef2('0x17'),path['basename'](_0x2deb85[_0xeef2('0x14')],path[_0xeef2('0x18')](_0x2deb85[_0xeef2('0x14')])),Date[_0xeef2('0x19')](),path[_0xeef2('0x18')](_0x2deb85['originalname'])));}})});router[_0xeef2('0x1a')]('/',upload['single'](_0xeef2('0x1b')),controller[_0xeef2('0x1c')]);router[_0xeef2('0x1d')](_0xeef2('0xc'),auth['isAuthenticated'](),controller[_0xeef2('0x1e')]);router[_0xeef2('0x1f')](_0xeef2('0xc'),auth[_0xeef2('0xa')](),controller[_0xeef2('0x1f')]);module[_0xeef2('0x20')]=router; \ No newline at end of file +var _0xc3cc=['server/files/sounds/original/','originalname','replace','basename','extname','now','single','file','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3cc,0x67));var _0xcc3c=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0xc3cc[_0x98db33];return _0x5ae63a;};'use strict';var multer=require(_0xcc3c('0x0'));var util=require('util');var path=require(_0xcc3c('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc3c('0x2'));var router=express[_0xcc3c('0x3')]();var fs_extra=require(_0xcc3c('0x4'));var auth=require(_0xcc3c('0x5'));var interaction=require(_0xcc3c('0x6'));var config=require(_0xcc3c('0x7'));var controller=require(_0xcc3c('0x8'));router[_0xcc3c('0x9')]('/',auth[_0xcc3c('0xa')](),controller['index']);router[_0xcc3c('0x9')](_0xcc3c('0xb'),auth[_0xcc3c('0xa')](),controller[_0xcc3c('0xc')]);router[_0xcc3c('0x9')](_0xcc3c('0xd'),auth[_0xcc3c('0xa')](),controller[_0xcc3c('0xe')]);var upload=multer({'storage':multer[_0xcc3c('0xf')]({'destination':function(_0x9f4d51,_0x4b7fbe,_0x3f4772){_0x3f4772(null,path[_0xcc3c('0x10')](config['root'],_0xcc3c('0x11')));},'filename':function(_0x57f561,_0x75ab8,_0x50c0fe){_0x75ab8['originalname']=_0x75ab8[_0xcc3c('0x12')][_0xcc3c('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50c0fe(null,util['format']('%s-%s%s',path[_0xcc3c('0x14')](_0x75ab8[_0xcc3c('0x12')],path[_0xcc3c('0x15')](_0x75ab8['originalname'])),Date[_0xcc3c('0x16')](),path[_0xcc3c('0x15')](_0x75ab8[_0xcc3c('0x12')])));}})});router['post']('/',upload[_0xcc3c('0x17')](_0xcc3c('0x18')),controller[_0xcc3c('0x19')]);router[_0xcc3c('0x1a')]('/:id',auth[_0xcc3c('0xa')](),controller[_0xcc3c('0x1b')]);router[_0xcc3c('0x1c')](_0xcc3c('0xb'),auth[_0xcc3c('0xa')](),controller[_0xcc3c('0x1c')]);module[_0xcc3c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3f93afa..e47e8b5 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 _0xe546=['BIGINT','INTEGER','FLOAT','STRING','name'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xe546,0xe4));var _0x6e54=function(_0x15d1f7,_0x597509){_0x15d1f7=_0x15d1f7-0x0;var _0x4245ec=_0xe546[_0x15d1f7];return _0x4245ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6e54('0x0')],'unique':_0x6e54('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6e54('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0x6e54('0x0')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x6e54('0x2')]},'original_channelCount':{'type':Sequelize[_0x6e54('0x3')]},'original_bitRate':{'type':Sequelize[_0x6e54('0x2')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x6e54('0x0')]},'converted_duration':{'type':Sequelize[_0x6e54('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6e54('0x2')]},'converted_channelCount':{'type':Sequelize[_0x6e54('0x3')]},'converted_bitRate':{'type':Sequelize[_0x6e54('0x2')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x345e=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x345e,0xf8));var _0xe345=function(_0x3130be,_0x54990e){_0x3130be=_0x3130be-0x0;var _0x484c5b=_0x345e[_0x3130be];return _0x484c5b;};'use strict';var Sequelize=require(_0xe345('0x0'));module[_0xe345('0x1')]={'name':{'type':Sequelize[_0xe345('0x2')],'unique':_0xe345('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe345('0x2')]},'display_name':{'type':Sequelize[_0xe345('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe345('0x2')]},'original_format':{'type':Sequelize[_0xe345('0x2')]},'original_duration':{'type':Sequelize[_0xe345('0x4')]},'original_sampleCount':{'type':Sequelize[_0xe345('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe345('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe345('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xe345('0x6')]},'converted_bitRate':{'type':Sequelize[_0xe345('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xe345('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 83453da..61c7f5d 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 _0xb42d=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Sound','includeAll','rows','show','params','keys','options','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','catch','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','Sound\x20upload\x20filepath:\x20%s','info','0777','transcode','unlinkSync','send','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','Sounds','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields'];(function(_0x38e9f4,_0xbad497){var _0xb0c52d=function(_0x21ae60){while(--_0x21ae60){_0x38e9f4['push'](_0x38e9f4['shift']());}};_0xb0c52d(++_0xbad497);}(_0xb42d,0xbf));var _0xdb42=function(_0x17bcc4,_0x287b25){_0x17bcc4=_0x17bcc4-0x0;var _0x47280e=_0xb42d[_0x17bcc4];return _0x47280e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb42('0x0'));var zipdir=require(_0xdb42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb42('0x2'));var moment=require(_0xdb42('0x3'));var BPromise=require(_0xdb42('0x4'));var Mustache=require(_0xdb42('0x5'));var util=require(_0xdb42('0x6'));var path=require('path');var sox=require(_0xdb42('0x7'));var csv=require(_0xdb42('0x8'));var ejs=require(_0xdb42('0x9'));var fs=require('fs');var fs_extra=require(_0xdb42('0xa'));var _=require('lodash');var squel=require(_0xdb42('0xb'));var crypto=require(_0xdb42('0xc'));var jsforce=require(_0xdb42('0xd'));var deskjs=require(_0xdb42('0xe'));var toCsv=require(_0xdb42('0x8'));var querystring=require(_0xdb42('0xf'));var Papa=require(_0xdb42('0x10'));var Redis=require(_0xdb42('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdb42('0x12'));var as=require(_0xdb42('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb42('0x14'))(_0xdb42('0x15'));var utils=require(_0xdb42('0x16'));var config=require(_0xdb42('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb42('0x18'))['db'];function respondWithStatusCode(_0x19ac72,_0x378ea8){_0x378ea8=_0x378ea8||0xcc;return function(_0x592b26){if(_0x592b26){return _0x19ac72[_0xdb42('0x19')](_0x378ea8);}return _0x19ac72['status'](_0x378ea8)[_0xdb42('0x1a')]();};}function respondWithResult(_0x1a7cfd,_0x44e50e){_0x44e50e=_0x44e50e||0xc8;return function(_0x2e579b){if(_0x2e579b){return _0x1a7cfd[_0xdb42('0x1b')](_0x44e50e)[_0xdb42('0x1c')](_0x2e579b);}};}function respondWithFilteredResult(_0x30c89b,_0x6befb7){return function(_0x308e6e){if(_0x308e6e){var _0x102f14=typeof _0x6befb7[_0xdb42('0x1d')]===_0xdb42('0x1e')&&typeof _0x6befb7[_0xdb42('0x1f')]===_0xdb42('0x1e');var _0x3545bb=_0x308e6e['count'];var _0x2c2d1a=_0x102f14?0x0:_0x6befb7['offset'];var _0x5114dc=_0x102f14?_0x308e6e[_0xdb42('0x20')]:_0x6befb7['offset']+_0x6befb7[_0xdb42('0x1f')];var _0x4ffed6;if(_0x5114dc>=_0x3545bb){_0x5114dc=_0x3545bb;_0x4ffed6=0xc8;}else{_0x4ffed6=0xce;}_0x30c89b[_0xdb42('0x1b')](_0x4ffed6);return _0x30c89b[_0xdb42('0x21')](_0xdb42('0x22'),_0x2c2d1a+'-'+_0x5114dc+'/'+_0x3545bb)['json'](_0x308e6e);}return null;};}function patchUpdates(_0x303ea1){return function(_0x50bb3b){try{jsonpatch['apply'](_0x50bb3b,_0x303ea1,!![]);}catch(_0x3006d4){return BPromise['reject'](_0x3006d4);}return _0x50bb3b[_0xdb42('0x23')]();};}function saveUpdates(_0x14bffe,_0x189cc9){return function(_0x544b2c){if(_0x544b2c){return _0x544b2c[_0xdb42('0x24')](_0x14bffe)[_0xdb42('0x25')](function(_0x4bc573){return _0x4bc573;});}return null;};}function removeEntity(_0x593848,_0x5f5c1d){return function(_0x4091f1){if(_0x4091f1){return _0x4091f1['destroy']()[_0xdb42('0x25')](function(){var _0x4afd2d=_0x4091f1['get']({'plain':!![]});var _0x1aeea9=_0xdb42('0x26');return db[_0xdb42('0x27')][_0xdb42('0x28')]({'where':{'type':_0x1aeea9,'resourceId':_0x4afd2d['id']}})[_0xdb42('0x25')](function(){return _0x4091f1;});})[_0xdb42('0x25')](function(){_0x593848[_0xdb42('0x1b')](0xcc)[_0xdb42('0x1a')]();});}};}function handleEntityNotFound(_0x2cea5a,_0x3203b8){return function(_0x4e995f){if(!_0x4e995f){_0x2cea5a[_0xdb42('0x19')](0x194);}return _0x4e995f;};}function handleError(_0x42fcf6,_0x8d9ded){_0x8d9ded=_0x8d9ded||0x1f4;return function(_0x3902f8){logger[_0xdb42('0x29')](_0x3902f8[_0xdb42('0x2a')]);if(_0x3902f8['name']){delete _0x3902f8[_0xdb42('0x2b')];}_0x42fcf6[_0xdb42('0x1b')](_0x8d9ded)['send'](_0x3902f8);};}exports[_0xdb42('0x2c')]=function(_0x580fb8,_0x3e4f98){var _0x274e0e={},_0x19cbe7={},_0x47c912={'count':0x0,'rows':[]};var _0x35e5e9=_[_0xdb42('0x2d')](db['Sound'][_0xdb42('0x2e')],function(_0x542d7f){return{'name':_0x542d7f[_0xdb42('0x2f')],'type':_0x542d7f['type'][_0xdb42('0x30')]};});_0x19cbe7[_0xdb42('0x31')]=_[_0xdb42('0x2d')](_0x35e5e9,_0xdb42('0x2b'));_0x19cbe7['query']=_['keys'](_0x580fb8[_0xdb42('0x32')]);_0x19cbe7[_0xdb42('0x33')]=_[_0xdb42('0x34')](_0x19cbe7[_0xdb42('0x31')],_0x19cbe7['query']);_0x274e0e[_0xdb42('0x35')]=_[_0xdb42('0x34')](_0x19cbe7[_0xdb42('0x31')],qs[_0xdb42('0x36')](_0x580fb8[_0xdb42('0x32')][_0xdb42('0x36')]));_0x274e0e['attributes']=_0x274e0e[_0xdb42('0x35')][_0xdb42('0x37')]?_0x274e0e['attributes']:_0x19cbe7['model'];if(!_0x580fb8['query'][_0xdb42('0x38')](_0xdb42('0x39'))){_0x274e0e[_0xdb42('0x1f')]=qs[_0xdb42('0x1f')](_0x580fb8[_0xdb42('0x32')][_0xdb42('0x1f')]);_0x274e0e['offset']=qs['offset'](_0x580fb8[_0xdb42('0x32')][_0xdb42('0x1d')]);}_0x274e0e[_0xdb42('0x3a')]=qs['sort'](_0x580fb8['query'][_0xdb42('0x3b')]);_0x274e0e[_0xdb42('0x3c')]=qs[_0xdb42('0x33')](_[_0xdb42('0x3d')](_0x580fb8[_0xdb42('0x32')],_0x19cbe7[_0xdb42('0x33')]),_0x35e5e9);if(_0x580fb8[_0xdb42('0x32')][_0xdb42('0x3e')]){_0x274e0e[_0xdb42('0x3c')]=_[_0xdb42('0x3f')](_0x274e0e[_0xdb42('0x3c')],{'$or':_['map'](_0x35e5e9,function(_0x1df472){if(_0x1df472[_0xdb42('0x40')]!==_0xdb42('0x41')){var _0x103d8a={};_0x103d8a[_0x1df472[_0xdb42('0x2b')]]={'$like':'%'+_0x580fb8[_0xdb42('0x32')][_0xdb42('0x3e')]+'%'};return _0x103d8a;}})});}_0x274e0e=_[_0xdb42('0x3f')]({},_0x274e0e,_0x580fb8['options']);var _0x2dee7b={'where':_0x274e0e[_0xdb42('0x3c')]};return db[_0xdb42('0x42')][_0xdb42('0x20')](_0x2dee7b)[_0xdb42('0x25')](function(_0x249387){_0x47c912[_0xdb42('0x20')]=_0x249387;if(_0x580fb8[_0xdb42('0x32')][_0xdb42('0x43')]){_0x274e0e['include']=[{'all':!![]}];}return db[_0xdb42('0x42')]['findAll'](_0x274e0e);})[_0xdb42('0x25')](function(_0x2db787){_0x47c912[_0xdb42('0x44')]=_0x2db787;return _0x47c912;})[_0xdb42('0x25')](respondWithFilteredResult(_0x3e4f98,_0x274e0e))['catch'](handleError(_0x3e4f98,null));};exports[_0xdb42('0x45')]=function(_0x52bf6c,_0x18b15b){var _0x443400={'raw':!![],'where':{'id':_0x52bf6c[_0xdb42('0x46')]['id']}},_0x1c9607={};_0x1c9607[_0xdb42('0x31')]=_[_0xdb42('0x47')](db[_0xdb42('0x42')][_0xdb42('0x2e')]);_0x1c9607[_0xdb42('0x32')]=_[_0xdb42('0x47')](_0x52bf6c[_0xdb42('0x32')]);_0x1c9607['filters']=_['intersection'](_0x1c9607[_0xdb42('0x31')],_0x1c9607[_0xdb42('0x32')]);_0x443400[_0xdb42('0x35')]=_[_0xdb42('0x34')](_0x1c9607[_0xdb42('0x31')],qs[_0xdb42('0x36')](_0x52bf6c[_0xdb42('0x32')][_0xdb42('0x36')]));_0x443400[_0xdb42('0x35')]=_0x443400[_0xdb42('0x35')][_0xdb42('0x37')]?_0x443400['attributes']:_0x1c9607['model'];if(_0x52bf6c[_0xdb42('0x32')][_0xdb42('0x43')]){_0x443400['include']=[{'all':!![]}];}_0x443400=_[_0xdb42('0x3f')]({},_0x443400,_0x52bf6c[_0xdb42('0x48')]);return db['Sound']['find'](_0x443400)[_0xdb42('0x25')](handleEntityNotFound(_0x18b15b,null))['then'](respondWithResult(_0x18b15b,null))['catch'](handleError(_0x18b15b,null));};exports[_0xdb42('0x49')]=function(_0x4f64ff,_0x1e1dca,_0x2b82d0){return db[_0xdb42('0x42')][_0xdb42('0x4a')]({'where':{'id':_0x4f64ff[_0xdb42('0x46')]['id']},'attributes':[_0xdb42('0x2b'),_0xdb42('0x4b'),_0xdb42('0x4c')],'raw':!![]})[_0xdb42('0x25')](handleEntityNotFound(_0x1e1dca,null))[_0xdb42('0x25')](function(_0x466842){if(_0x466842){if(!fs[_0xdb42('0x4d')](path[_0xdb42('0x4e')](config[_0xdb42('0x4f')],_0xdb42('0x50'),_0x466842[_0xdb42('0x4b')]+'.'+_0x466842['converted_format']))){throw new db[(_0xdb42('0x51'))]['ValidationError'](_0xdb42('0x52'));}return _0x1e1dca[_0xdb42('0x49')](path[_0xdb42('0x4e')](config['root'],'server/files/sounds/converted',util[_0xdb42('0x53')](_0xdb42('0x54'),_0x466842[_0xdb42('0x4b')],_0x466842[_0xdb42('0x4c')])),util[_0xdb42('0x53')](_0xdb42('0x54'),_0x466842[_0xdb42('0x2b')],_0x466842[_0xdb42('0x4c')]));}return null;})[_0xdb42('0x55')](handleError(_0x1e1dca,null));};exports['create']=function(_0x69dbac,_0x54f721,_0x35ef3c){var _0x46db5b={'name':path[_0xdb42('0x56')](_0x69dbac[_0xdb42('0x57')]['originalname'],path['extname'](_0x69dbac[_0xdb42('0x57')][_0xdb42('0x58')])),'save_name':path[_0xdb42('0x56')](_0x69dbac[_0xdb42('0x57')]['filename'],path['extname'](_0x69dbac[_0xdb42('0x57')]['filename'])),'original_format':path[_0xdb42('0x59')](_0x69dbac['file']['originalname'])[_0xdb42('0x5a')](0x1),'converted_format':_0xdb42('0x5b')};var _0x1dd31b=path['join'](config['root'],_0xdb42('0x5c'),_0x69dbac[_0xdb42('0x57')][_0xdb42('0x5d')]);var _0x8b33df=path[_0xdb42('0x4e')](config['root'],_0xdb42('0x50'),util['format'](_0xdb42('0x54'),path[_0xdb42('0x56')](_0x69dbac[_0xdb42('0x57')]['filename'],path[_0xdb42('0x59')](_0x69dbac[_0xdb42('0x57')]['filename'])),_0x46db5b[_0xdb42('0x4c')]));logger['info'](_0xdb42('0x5e'),_0x1dd31b);logger[_0xdb42('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0x8b33df);try{fs['chmodSync'](_0x1dd31b,parseInt(_0xdb42('0x60'),0x8));var _0x36cee1=sox[_0xdb42('0x61')](_0x1dd31b,_0x8b33df,{'sampleRate':0x1f40,'format':_0xdb42('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36cee1['on']('error',function(_0x59a95d){fs[_0xdb42('0x62')](_0x1dd31b);_0x54f721[_0xdb42('0x1b')](0x1f4)[_0xdb42('0x63')](_0x59a95d);});_0x36cee1['on']('src',function(_0x247d7b){_0x46db5b['original_duration']=isNaN(_0x247d7b[_0xdb42('0x64')])?null:_0x247d7b['duration']*0x3e8;_0x46db5b[_0xdb42('0x65')]=isNaN(_0x247d7b[_0xdb42('0x66')])?null:_0x247d7b[_0xdb42('0x66')];_0x46db5b[_0xdb42('0x67')]=isNaN(_0x247d7b[_0xdb42('0x68')])?null:_0x247d7b[_0xdb42('0x68')];_0x46db5b['original_bitRate']=isNaN(_0x247d7b[_0xdb42('0x69')])?null:_0x247d7b[_0xdb42('0x69')];_0x46db5b['original_sampleRate']=isNaN(_0x247d7b[_0xdb42('0x6a')])?null:_0x247d7b[_0xdb42('0x6a')];});_0x36cee1['on'](_0xdb42('0x6b'),function(_0x2a75e1){_0x46db5b['converted_duration']=isNaN(_0x2a75e1[_0xdb42('0x64')])?null:_0x2a75e1[_0xdb42('0x64')]*0x3e8;_0x46db5b[_0xdb42('0x6c')]=isNaN(_0x2a75e1[_0xdb42('0x66')])?null:_0x2a75e1[_0xdb42('0x66')];_0x46db5b['converted_channelCount']=isNaN(_0x2a75e1['channelCount'])?null:_0x2a75e1[_0xdb42('0x68')];_0x46db5b[_0xdb42('0x6d')]=isNaN(_0x2a75e1[_0xdb42('0x69')])?null:_0x2a75e1[_0xdb42('0x69')];_0x46db5b[_0xdb42('0x6e')]=isNaN(_0x2a75e1[_0xdb42('0x6a')])?null:_0x2a75e1[_0xdb42('0x6a')];});_0x36cee1['on'](_0xdb42('0x1a'),function(){fs[_0xdb42('0x6f')](_0x8b33df,parseInt('0777',0x8));return db[_0xdb42('0x42')]['create'](_0x46db5b)[_0xdb42('0x25')](function(_0x264d81){var _0x2339f3={'role':_0x69dbac[_0xdb42('0x70')][_0xdb42('0x71')],'userProfileId':_0x69dbac[_0xdb42('0x70')]['userProfileId']};if(!_0x2339f3)throw new Error(_0xdb42('0x72'));if(_0x2339f3['role']===_0xdb42('0x73')){var _0x35941d=_0x264d81[_0xdb42('0x74')]({'plain':!![]});return db[_0xdb42('0x75')][_0xdb42('0x4a')]({'where':{'name':_0xdb42('0x26'),'userProfileId':_0x2339f3['userProfileId']},'raw':!![]})[_0xdb42('0x25')](function(_0x35de88){if(_0x35de88&&_0x35de88[_0xdb42('0x76')]===0x0){return db[_0xdb42('0x27')]['create']({'name':_0x35941d[_0xdb42('0x2b')],'resourceId':_0x35941d['id'],'type':_0x35de88[_0xdb42('0x2b')],'sectionId':_0x35de88['id']},{})[_0xdb42('0x25')](function(){return _0x264d81;});}else{return _0x264d81;}})['catch'](function(_0x3f51cb){logger['error'](_0xdb42('0x77'),_0x3f51cb);throw _0x3f51cb;});}return _0x264d81;})[_0xdb42('0x25')](respondWithResult(_0x54f721,null))['catch'](handleError(_0x54f721,null));});_0x36cee1['start']();}catch(_0x3a8aff){_0x54f721['status'](0x1f4)[_0xdb42('0x63')](_0x3a8aff);}};exports[_0xdb42('0x24')]=function(_0x6d1a7d,_0x252415,_0x236866){return db[_0xdb42('0x42')]['find']({'where':{'id':_0x6d1a7d['params']['id']}})['then'](handleEntityNotFound(_0x252415,null))[_0xdb42('0x25')](saveUpdates(_[_0xdb42('0x3d')](_0x6d1a7d[_0xdb42('0x70')],['name',_0xdb42('0x78')]),null))['then'](respondWithResult(_0x252415,null))[_0xdb42('0x55')](handleError(_0x252415,null));};exports[_0xdb42('0x79')]=function(_0x5205c9,_0x54b4a3,_0x61fc94){return db[_0xdb42('0x42')]['find']({'where':{'id':_0x5205c9[_0xdb42('0x46')]['id']}})['then'](function(_0x1c65ce){if(_0x1c65ce){return _0x1c65ce[_0xdb42('0x28')]();}})[_0xdb42('0x25')](function(_0x4f9a05){var _0x5d0873=path[_0xdb42('0x4e')](config['root'],_0xdb42('0x5c'),util[_0xdb42('0x53')](_0xdb42('0x54'),_0x4f9a05[_0xdb42('0x4b')],_0x4f9a05[_0xdb42('0x7a')]));var _0x31f804=path[_0xdb42('0x4e')](config[_0xdb42('0x4f')],_0xdb42('0x50'),util[_0xdb42('0x53')](_0xdb42('0x54'),_0x4f9a05[_0xdb42('0x4b')],_0x4f9a05[_0xdb42('0x4c')]));fs['unlinkSync'](_0x5d0873);fs[_0xdb42('0x62')](_0x31f804);return _0x4f9a05;})['then'](function(_0x101e6a){if(_0x101e6a){return _0x54b4a3[_0xdb42('0x1b')](0xcc)[_0xdb42('0x1a')]();}})[_0xdb42('0x25')](handleEntityNotFound(_0x54b4a3,null))['catch'](handleError(_0x54b4a3,null));}; \ No newline at end of file +var _0x9858=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','format','save_name','%s.%s','basename','file','originalname','extname','filename','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','error','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','start','description','server/files/sounds/original','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Sounds','UserProfileResource','sendStatus','name','send','index','map','Sound','rawAttributes','fieldName','type','key'];(function(_0x3e29ed,_0x359303){var _0x58bb04=function(_0x3bc52d){while(--_0x3bc52d){_0x3e29ed['push'](_0x3e29ed['shift']());}};_0x58bb04(++_0x359303);}(_0x9858,0x145));var _0x8985=function(_0x47d62a,_0x39f8e1){_0x47d62a=_0x47d62a-0x0;var _0x393363=_0x9858[_0x47d62a];return _0x393363;};'use strict';var emlformat=require(_0x8985('0x0'));var rimraf=require(_0x8985('0x1'));var zipdir=require(_0x8985('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8985('0x3'));var moment=require('moment');var BPromise=require(_0x8985('0x4'));var Mustache=require(_0x8985('0x5'));var util=require(_0x8985('0x6'));var path=require(_0x8985('0x7'));var sox=require('sox');var csv=require(_0x8985('0x8'));var ejs=require(_0x8985('0x9'));var fs=require('fs');var fs_extra=require(_0x8985('0xa'));var _=require(_0x8985('0xb'));var squel=require(_0x8985('0xc'));var crypto=require(_0x8985('0xd'));var jsforce=require(_0x8985('0xe'));var deskjs=require(_0x8985('0xf'));var toCsv=require(_0x8985('0x8'));var querystring=require('querystring');var Papa=require(_0x8985('0x10'));var Redis=require(_0x8985('0x11'));var authService=require(_0x8985('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8985('0x13'))('api');var utils=require(_0x8985('0x14'));var config=require(_0x8985('0x15'));var licenseUtil=require(_0x8985('0x16'));var db=require(_0x8985('0x17'))['db'];function respondWithStatusCode(_0x3e1cfe,_0x211f1c){_0x211f1c=_0x211f1c||0xcc;return function(_0x2dfcd5){if(_0x2dfcd5){return _0x3e1cfe['sendStatus'](_0x211f1c);}return _0x3e1cfe[_0x8985('0x18')](_0x211f1c)[_0x8985('0x19')]();};}function respondWithResult(_0x3614a0,_0x4a9861){_0x4a9861=_0x4a9861||0xc8;return function(_0x5991ca){if(_0x5991ca){return _0x3614a0['status'](_0x4a9861)[_0x8985('0x1a')](_0x5991ca);}};}function respondWithFilteredResult(_0x36388e,_0x783f96){return function(_0x2afb56){if(_0x2afb56){var _0x502fe3=typeof _0x783f96[_0x8985('0x1b')]===_0x8985('0x1c')&&typeof _0x783f96[_0x8985('0x1d')]==='undefined';var _0x29b7ff=_0x2afb56[_0x8985('0x1e')];var _0x5afe05=_0x502fe3?0x0:_0x783f96[_0x8985('0x1b')];var _0x252951=_0x502fe3?_0x2afb56[_0x8985('0x1e')]:_0x783f96['offset']+_0x783f96[_0x8985('0x1d')];var _0x41d080;if(_0x252951>=_0x29b7ff){_0x252951=_0x29b7ff;_0x41d080=0xc8;}else{_0x41d080=0xce;}_0x36388e[_0x8985('0x18')](_0x41d080);return _0x36388e[_0x8985('0x1f')](_0x8985('0x20'),_0x5afe05+'-'+_0x252951+'/'+_0x29b7ff)['json'](_0x2afb56);}return null;};}function patchUpdates(_0x3d7c77){return function(_0x501fb5){try{jsonpatch[_0x8985('0x21')](_0x501fb5,_0x3d7c77,!![]);}catch(_0x5da31e){return BPromise['reject'](_0x5da31e);}return _0x501fb5[_0x8985('0x22')]();};}function saveUpdates(_0x3e96f0,_0x2c8bcc){return function(_0x8ac86d){if(_0x8ac86d){return _0x8ac86d[_0x8985('0x23')](_0x3e96f0)[_0x8985('0x24')](function(_0x43a348){return _0x43a348;});}return null;};}function removeEntity(_0x31b411,_0x48d9c3){return function(_0x14a9d4){if(_0x14a9d4){return _0x14a9d4[_0x8985('0x25')]()[_0x8985('0x24')](function(){var _0x38144c=_0x14a9d4['get']({'plain':!![]});var _0x296768=_0x8985('0x26');return db[_0x8985('0x27')][_0x8985('0x25')]({'where':{'type':_0x296768,'resourceId':_0x38144c['id']}})['then'](function(){return _0x14a9d4;});})[_0x8985('0x24')](function(){_0x31b411[_0x8985('0x18')](0xcc)[_0x8985('0x19')]();});}};}function handleEntityNotFound(_0x25bbe6,_0x3b1f65){return function(_0x46c939){if(!_0x46c939){_0x25bbe6[_0x8985('0x28')](0x194);}return _0x46c939;};}function handleError(_0x1e7bb0,_0x568fc9){_0x568fc9=_0x568fc9||0x1f4;return function(_0x72826){logger['error'](_0x72826['stack']);if(_0x72826[_0x8985('0x29')]){delete _0x72826[_0x8985('0x29')];}_0x1e7bb0[_0x8985('0x18')](_0x568fc9)[_0x8985('0x2a')](_0x72826);};}exports[_0x8985('0x2b')]=function(_0x33c885,_0xea1710){var _0x1e02a1={},_0x5795e7={},_0x5b29cd={'count':0x0,'rows':[]};var _0x1a6905=_[_0x8985('0x2c')](db[_0x8985('0x2d')][_0x8985('0x2e')],function(_0x4b7cf4){return{'name':_0x4b7cf4[_0x8985('0x2f')],'type':_0x4b7cf4[_0x8985('0x30')][_0x8985('0x31')]};});_0x5795e7[_0x8985('0x32')]=_[_0x8985('0x2c')](_0x1a6905,'name');_0x5795e7[_0x8985('0x33')]=_[_0x8985('0x34')](_0x33c885[_0x8985('0x33')]);_0x5795e7[_0x8985('0x35')]=_[_0x8985('0x36')](_0x5795e7[_0x8985('0x32')],_0x5795e7[_0x8985('0x33')]);_0x1e02a1[_0x8985('0x37')]=_[_0x8985('0x36')](_0x5795e7[_0x8985('0x32')],qs[_0x8985('0x38')](_0x33c885['query']['fields']));_0x1e02a1[_0x8985('0x37')]=_0x1e02a1['attributes']['length']?_0x1e02a1[_0x8985('0x37')]:_0x5795e7[_0x8985('0x32')];if(!_0x33c885[_0x8985('0x33')][_0x8985('0x39')](_0x8985('0x3a'))){_0x1e02a1[_0x8985('0x1d')]=qs[_0x8985('0x1d')](_0x33c885[_0x8985('0x33')][_0x8985('0x1d')]);_0x1e02a1[_0x8985('0x1b')]=qs['offset'](_0x33c885[_0x8985('0x33')][_0x8985('0x1b')]);}_0x1e02a1[_0x8985('0x3b')]=qs[_0x8985('0x3c')](_0x33c885[_0x8985('0x33')][_0x8985('0x3c')]);_0x1e02a1['where']=qs[_0x8985('0x35')](_[_0x8985('0x3d')](_0x33c885[_0x8985('0x33')],_0x5795e7['filters']),_0x1a6905);if(_0x33c885[_0x8985('0x33')][_0x8985('0x3e')]){_0x1e02a1['where']=_[_0x8985('0x3f')](_0x1e02a1[_0x8985('0x40')],{'$or':_['map'](_0x1a6905,function(_0x143ebb){if(_0x143ebb['type']!==_0x8985('0x41')){var _0x1d9c60={};_0x1d9c60[_0x143ebb[_0x8985('0x29')]]={'$like':'%'+_0x33c885[_0x8985('0x33')][_0x8985('0x3e')]+'%'};return _0x1d9c60;}})});}_0x1e02a1=_['merge']({},_0x1e02a1,_0x33c885['options']);var _0x155462={'where':_0x1e02a1[_0x8985('0x40')]};return db[_0x8985('0x2d')][_0x8985('0x1e')](_0x155462)[_0x8985('0x24')](function(_0x3120a9){_0x5b29cd[_0x8985('0x1e')]=_0x3120a9;if(_0x33c885[_0x8985('0x33')][_0x8985('0x42')]){_0x1e02a1[_0x8985('0x43')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x1e02a1);})['then'](function(_0x819fcd){_0x5b29cd[_0x8985('0x44')]=_0x819fcd;return _0x5b29cd;})[_0x8985('0x24')](respondWithFilteredResult(_0xea1710,_0x1e02a1))[_0x8985('0x45')](handleError(_0xea1710,null));};exports[_0x8985('0x46')]=function(_0x2203d7,_0x4c2307){var _0x42980f={'raw':!![],'where':{'id':_0x2203d7[_0x8985('0x47')]['id']}},_0x19174d={};_0x19174d['model']=_[_0x8985('0x34')](db[_0x8985('0x2d')][_0x8985('0x2e')]);_0x19174d['query']=_[_0x8985('0x34')](_0x2203d7[_0x8985('0x33')]);_0x19174d[_0x8985('0x35')]=_[_0x8985('0x36')](_0x19174d['model'],_0x19174d[_0x8985('0x33')]);_0x42980f[_0x8985('0x37')]=_['intersection'](_0x19174d[_0x8985('0x32')],qs[_0x8985('0x38')](_0x2203d7[_0x8985('0x33')][_0x8985('0x38')]));_0x42980f['attributes']=_0x42980f[_0x8985('0x37')][_0x8985('0x48')]?_0x42980f[_0x8985('0x37')]:_0x19174d[_0x8985('0x32')];if(_0x2203d7['query'][_0x8985('0x42')]){_0x42980f[_0x8985('0x43')]=[{'all':!![]}];}_0x42980f=_[_0x8985('0x3f')]({},_0x42980f,_0x2203d7[_0x8985('0x49')]);return db[_0x8985('0x2d')]['find'](_0x42980f)[_0x8985('0x24')](handleEntityNotFound(_0x4c2307,null))['then'](respondWithResult(_0x4c2307,null))[_0x8985('0x45')](handleError(_0x4c2307,null));};exports['download']=function(_0x467b38,_0x36ee2c,_0x4c3420){return db['Sound'][_0x8985('0x4a')]({'where':{'id':_0x467b38[_0x8985('0x47')]['id']},'attributes':['name','save_name',_0x8985('0x4b')],'raw':!![]})[_0x8985('0x24')](handleEntityNotFound(_0x36ee2c,null))[_0x8985('0x24')](function(_0x76399){if(_0x76399){if(!fs[_0x8985('0x4c')](path[_0x8985('0x4d')](config[_0x8985('0x4e')],_0x8985('0x4f'),_0x76399['save_name']+'.'+_0x76399['converted_format']))){throw new db[(_0x8985('0x50'))][(_0x8985('0x51'))](_0x8985('0x52'));}return _0x36ee2c[_0x8985('0x53')](path[_0x8985('0x4d')](config['root'],_0x8985('0x4f'),util[_0x8985('0x54')]('%s.%s',_0x76399[_0x8985('0x55')],_0x76399[_0x8985('0x4b')])),util[_0x8985('0x54')](_0x8985('0x56'),_0x76399['name'],_0x76399['converted_format']));}return null;})['catch'](handleError(_0x36ee2c,null));};exports['create']=function(_0x80e687,_0x4da05,_0x2ae6e9){var _0x3ca974={'name':path[_0x8985('0x57')](_0x80e687[_0x8985('0x58')][_0x8985('0x59')],path[_0x8985('0x5a')](_0x80e687[_0x8985('0x58')]['originalname'])),'save_name':path[_0x8985('0x57')](_0x80e687['file']['filename'],path[_0x8985('0x5a')](_0x80e687[_0x8985('0x58')][_0x8985('0x5b')])),'original_format':path['extname'](_0x80e687[_0x8985('0x58')][_0x8985('0x59')])['substring'](0x1),'converted_format':_0x8985('0x5c')};var _0x3b497a=path[_0x8985('0x4d')](config[_0x8985('0x4e')],'server/files/sounds/original',_0x80e687[_0x8985('0x58')][_0x8985('0x5b')]);var _0x233fb1=path['join'](config[_0x8985('0x4e')],_0x8985('0x4f'),util[_0x8985('0x54')](_0x8985('0x56'),path['basename'](_0x80e687[_0x8985('0x58')][_0x8985('0x5b')],path[_0x8985('0x5a')](_0x80e687[_0x8985('0x58')][_0x8985('0x5b')])),_0x3ca974[_0x8985('0x4b')]));logger[_0x8985('0x5d')](_0x8985('0x5e'),_0x3b497a);logger[_0x8985('0x5d')](_0x8985('0x5f'),_0x233fb1);try{fs[_0x8985('0x60')](_0x3b497a,parseInt('0777',0x8));var _0x2a9352=sox[_0x8985('0x61')](_0x3b497a,_0x233fb1,{'sampleRate':0x1f40,'format':_0x8985('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2a9352['on'](_0x8985('0x62'),function(_0xdb3404){fs['unlinkSync'](_0x3b497a);_0x4da05[_0x8985('0x18')](0x1f4)[_0x8985('0x2a')](_0xdb3404);});_0x2a9352['on'](_0x8985('0x63'),function(_0x396623){_0x3ca974[_0x8985('0x64')]=isNaN(_0x396623['duration'])?null:_0x396623[_0x8985('0x65')]*0x3e8;_0x3ca974['original_sampleCount']=isNaN(_0x396623[_0x8985('0x66')])?null:_0x396623[_0x8985('0x66')];_0x3ca974[_0x8985('0x67')]=isNaN(_0x396623[_0x8985('0x68')])?null:_0x396623[_0x8985('0x68')];_0x3ca974[_0x8985('0x69')]=isNaN(_0x396623[_0x8985('0x6a')])?null:_0x396623[_0x8985('0x6a')];_0x3ca974['original_sampleRate']=isNaN(_0x396623[_0x8985('0x6b')])?null:_0x396623['sampleRate'];});_0x2a9352['on']('dest',function(_0x35fe06){_0x3ca974[_0x8985('0x6c')]=isNaN(_0x35fe06[_0x8985('0x65')])?null:_0x35fe06[_0x8985('0x65')]*0x3e8;_0x3ca974['converted_sampleCount']=isNaN(_0x35fe06[_0x8985('0x66')])?null:_0x35fe06['sampleCount'];_0x3ca974[_0x8985('0x6d')]=isNaN(_0x35fe06[_0x8985('0x68')])?null:_0x35fe06[_0x8985('0x68')];_0x3ca974[_0x8985('0x6e')]=isNaN(_0x35fe06[_0x8985('0x6a')])?null:_0x35fe06[_0x8985('0x6a')];_0x3ca974[_0x8985('0x6f')]=isNaN(_0x35fe06[_0x8985('0x6b')])?null:_0x35fe06[_0x8985('0x6b')];});_0x2a9352['on']('end',function(){fs[_0x8985('0x60')](_0x233fb1,parseInt(_0x8985('0x70'),0x8));return db[_0x8985('0x2d')][_0x8985('0x71')](_0x3ca974)[_0x8985('0x24')](function(_0x334cf5){var _0x37c7b0={'role':_0x80e687[_0x8985('0x72')][_0x8985('0x73')],'userProfileId':_0x80e687['body'][_0x8985('0x74')]};if(!_0x37c7b0)throw new Error(_0x8985('0x75'));if(_0x37c7b0[_0x8985('0x73')]==='user'){var _0x3e6fd6=_0x334cf5[_0x8985('0x76')]({'plain':!![]});return db[_0x8985('0x77')][_0x8985('0x4a')]({'where':{'name':_0x8985('0x26'),'userProfileId':_0x37c7b0[_0x8985('0x74')]},'raw':!![]})[_0x8985('0x24')](function(_0x1a319c){if(_0x1a319c&&_0x1a319c[_0x8985('0x78')]===0x0){return db[_0x8985('0x27')][_0x8985('0x71')]({'name':_0x3e6fd6[_0x8985('0x29')],'resourceId':_0x3e6fd6['id'],'type':_0x1a319c[_0x8985('0x29')],'sectionId':_0x1a319c['id']},{})[_0x8985('0x24')](function(){return _0x334cf5;});}else{return _0x334cf5;}})['catch'](function(_0x23f631){logger[_0x8985('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23f631);throw _0x23f631;});}return _0x334cf5;})[_0x8985('0x24')](respondWithResult(_0x4da05,null))[_0x8985('0x45')](handleError(_0x4da05,null));});_0x2a9352[_0x8985('0x79')]();}catch(_0x36f030){_0x4da05[_0x8985('0x18')](0x1f4)[_0x8985('0x2a')](_0x36f030);}};exports['update']=function(_0x5684c9,_0x505a44,_0x2335d6){return db['Sound'][_0x8985('0x4a')]({'where':{'id':_0x5684c9['params']['id']}})[_0x8985('0x24')](handleEntityNotFound(_0x505a44,null))[_0x8985('0x24')](saveUpdates(_['pick'](_0x5684c9[_0x8985('0x72')],[_0x8985('0x29'),_0x8985('0x7a')]),null))[_0x8985('0x24')](respondWithResult(_0x505a44,null))['catch'](handleError(_0x505a44,null));};exports['delete']=function(_0xa6d5d2,_0x90048d,_0x275d11){return db[_0x8985('0x2d')][_0x8985('0x4a')]({'where':{'id':_0xa6d5d2[_0x8985('0x47')]['id']}})[_0x8985('0x24')](function(_0x3ea5df){if(_0x3ea5df){return _0x3ea5df[_0x8985('0x25')]();}})[_0x8985('0x24')](function(_0x2ead8e){var _0x4eac13=path[_0x8985('0x4d')](config[_0x8985('0x4e')],_0x8985('0x7b'),util[_0x8985('0x54')](_0x8985('0x56'),_0x2ead8e[_0x8985('0x55')],_0x2ead8e['original_format']));var _0x47d40f=path[_0x8985('0x4d')](config[_0x8985('0x4e')],_0x8985('0x4f'),util[_0x8985('0x54')](_0x8985('0x56'),_0x2ead8e[_0x8985('0x55')],_0x2ead8e[_0x8985('0x4b')]));fs['unlinkSync'](_0x4eac13);fs[_0x8985('0x7c')](_0x47d40f);return _0x2ead8e;})[_0x8985('0x24')](function(_0x15cf08){if(_0x15cf08){return _0x90048d['status'](0xcc)['end']();}})[_0x8985('0x24')](handleEntityNotFound(_0x90048d,null))[_0x8985('0x45')](handleError(_0x90048d,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index aaff602..6c34e7f 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 _0xad07=['define','Sound','lodash','../../config/logger','api','moment','path','../../config/environment','./sound.attributes'];(function(_0x412ff5,_0x47a49f){var _0x280aeb=function(_0x1c07f7){while(--_0x1c07f7){_0x412ff5['push'](_0x412ff5['shift']());}};_0x280aeb(++_0x47a49f);}(_0xad07,0xa4));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var util=require('util');var logger=require(_0x7ad0('0x1'))(_0x7ad0('0x2'));var moment=require(_0x7ad0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ad0('0x4'));var rimraf=require('rimraf');var config=require(_0x7ad0('0x5'));var attributes=require(_0x7ad0('0x6'));module['exports']=function(_0x4f06c8,_0x2765cd){return _0x4f06c8[_0x7ad0('0x7')](_0x7ad0('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61f5=['request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','moment','bluebird'];(function(_0x16bcf6,_0x150318){var _0x52360f=function(_0x2d8204){while(--_0x2d8204){_0x16bcf6['push'](_0x16bcf6['shift']());}};_0x52360f(++_0x150318);}(_0x61f5,0x1b6));var _0x561f=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x61f5[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x561f('0x0'));var util=require(_0x561f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x561f('0x2'));var BPromise=require(_0x561f('0x3'));var rp=require(_0x561f('0x4'));var fs=require('fs');var path=require(_0x561f('0x5'));var rimraf=require(_0x561f('0x6'));var config=require(_0x561f('0x7'));var attributes=require(_0x561f('0x8'));module[_0x561f('0x9')]=function(_0x505dfd,_0x9e7afa){return _0x505dfd[_0x561f('0xa')](_0x561f('0xb'),attributes,{'tableName':_0x561f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 9486955..8f4de2b 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 _0x9444=['code','message','result','ShowSound','Sound','options','raw','include','map','attributes','model','info','stringify','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error'];(function(_0x20819e,_0x953317){var _0x5d0c3a=function(_0x160434){while(--_0x160434){_0x20819e['push'](_0x20819e['shift']());}};_0x5d0c3a(++_0x953317);}(_0x9444,0x12e));var _0x4944=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x9444[_0x18b5e8];return _0x25baed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4944('0x0'));var BPromise=require(_0x4944('0x1'));var rs=require(_0x4944('0x2'));var fs=require('fs');var Redis=require(_0x4944('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4944('0x4'));var logger=require(_0x4944('0x5'))(_0x4944('0x6'));var config=require(_0x4944('0x7'));var jayson=require(_0x4944('0x8'));var client=jayson[_0x4944('0x9')][_0x4944('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34d89a,_0x1b39cb,_0x466fe9){return new BPromise(function(_0x32335f,_0x35baeb){return client[_0x4944('0xb')](_0x34d89a,_0x466fe9)[_0x4944('0xc')](function(_0x2de6d9){logger['info'](_0x4944('0xd'),_0x1b39cb,_0x4944('0xe'));logger[_0x4944('0xf')](_0x4944('0x10'),_0x1b39cb,_0x4944('0xe'),JSON['stringify'](_0x2de6d9));if(_0x2de6d9[_0x4944('0x11')]){if(_0x2de6d9['error'][_0x4944('0x12')]===0x1f4){logger['error'](_0x4944('0xd'),_0x1b39cb,_0x2de6d9[_0x4944('0x11')][_0x4944('0x13')]);return _0x35baeb(_0x2de6d9[_0x4944('0x11')][_0x4944('0x13')]);}logger[_0x4944('0x11')](_0x4944('0xd'),_0x1b39cb,_0x2de6d9[_0x4944('0x11')][_0x4944('0x13')]);return _0x32335f(_0x2de6d9['error'][_0x4944('0x13')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x1b39cb,_0x4944('0xe'));_0x32335f(_0x2de6d9[_0x4944('0x14')]['message']);}})['catch'](function(_0x58c2a2){logger[_0x4944('0x11')](_0x4944('0xd'),_0x1b39cb,_0x58c2a2);_0x35baeb(_0x58c2a2);});});}exports[_0x4944('0x15')]=function(_0x3c17ff){var _0x12895b=this;return new Promise(function(_0x18ea8d,_0x311abc){return db[_0x4944('0x16')]['find']({'raw':_0x3c17ff[_0x4944('0x17')]?_0x3c17ff[_0x4944('0x17')][_0x4944('0x18')]===undefined?!![]:![]:!![],'where':_0x3c17ff['options']?_0x3c17ff[_0x4944('0x17')]['where']||null:null,'attributes':_0x3c17ff[_0x4944('0x17')]?_0x3c17ff[_0x4944('0x17')]['attributes']||null:null,'include':_0x3c17ff[_0x4944('0x17')]?_0x3c17ff['options'][_0x4944('0x19')]?_[_0x4944('0x1a')](_0x3c17ff['options']['include'],function(_0x5ce41d){return{'model':db[_0x5ce41d['model']],'as':_0x5ce41d['as'],'attributes':_0x5ce41d[_0x4944('0x1b')],'include':_0x5ce41d['include']?_[_0x4944('0x1a')](_0x5ce41d[_0x4944('0x19')],function(_0x36ebd5){return{'model':db[_0x36ebd5['model']],'as':_0x36ebd5['as'],'attributes':_0x36ebd5[_0x4944('0x1b')],'include':_0x36ebd5[_0x4944('0x19')]?_[_0x4944('0x1a')](_0x36ebd5[_0x4944('0x19')],function(_0x57924e){return{'model':db[_0x57924e[_0x4944('0x1c')]],'as':_0x57924e['as'],'attributes':_0x57924e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29eb2d){logger[_0x4944('0x1d')](_0x4944('0x15'),_0x3c17ff);logger[_0x4944('0xf')](_0x4944('0x15'),_0x3c17ff,JSON[_0x4944('0x1e')](_0x29eb2d));_0x18ea8d(_0x29eb2d);})[_0x4944('0x1f')](function(_0x24a87e){logger[_0x4944('0x11')](_0x4944('0x15'),_0x24a87e[_0x4944('0x13')],_0x3c17ff);_0x311abc(_0x12895b[_0x4944('0x11')](0x1f4,_0x24a87e[_0x4944('0x13')]));});});}; \ No newline at end of file +var _0x3642=['model','stringify','catch','util','bluebird','randomstring','../../mysqldb','rpc','client','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','info','ShowSound','options','raw','where','attributes','include','map'];(function(_0x5f56aa,_0x14f697){var _0x5ab8ab=function(_0x53b354){while(--_0x53b354){_0x5f56aa['push'](_0x5f56aa['shift']());}};_0x5ab8ab(++_0x14f697);}(_0x3642,0x183));var _0x2364=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x3642[_0x1e381c];return _0x9b5ea9;};'use strict';var _=require('lodash');var util=require(_0x2364('0x0'));var moment=require('moment');var BPromise=require(_0x2364('0x1'));var rs=require(_0x2364('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2364('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2364('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2364('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39280b,_0x31a918,_0x409718){return new BPromise(function(_0x5ca46c,_0x4b6952){return client['request'](_0x39280b,_0x409718)[_0x2364('0x6')](function(_0x5a708a){logger['info'](_0x2364('0x7'),_0x31a918,_0x2364('0x8'));logger[_0x2364('0x9')](_0x2364('0xa'),_0x31a918,_0x2364('0x8'),JSON['stringify'](_0x5a708a));if(_0x5a708a[_0x2364('0xb')]){if(_0x5a708a['error']['code']===0x1f4){logger['error'](_0x2364('0x7'),_0x31a918,_0x5a708a[_0x2364('0xb')][_0x2364('0xc')]);return _0x4b6952(_0x5a708a[_0x2364('0xb')][_0x2364('0xc')]);}logger[_0x2364('0xb')](_0x2364('0x7'),_0x31a918,_0x5a708a[_0x2364('0xb')][_0x2364('0xc')]);return _0x5ca46c(_0x5a708a[_0x2364('0xb')][_0x2364('0xc')]);}else{logger[_0x2364('0xd')]('Sound,\x20%s,\x20%s',_0x31a918,_0x2364('0x8'));_0x5ca46c(_0x5a708a['result'][_0x2364('0xc')]);}})['catch'](function(_0xbe3a7d){logger['error'](_0x2364('0x7'),_0x31a918,_0xbe3a7d);_0x4b6952(_0xbe3a7d);});});}exports[_0x2364('0xe')]=function(_0x18ea06){var _0x4f6c95=this;return new Promise(function(_0x4f26e3,_0x22d1ac){return db['Sound']['find']({'raw':_0x18ea06[_0x2364('0xf')]?_0x18ea06['options'][_0x2364('0x10')]===undefined?!![]:![]:!![],'where':_0x18ea06['options']?_0x18ea06[_0x2364('0xf')][_0x2364('0x11')]||null:null,'attributes':_0x18ea06[_0x2364('0xf')]?_0x18ea06[_0x2364('0xf')][_0x2364('0x12')]||null:null,'include':_0x18ea06[_0x2364('0xf')]?_0x18ea06['options'][_0x2364('0x13')]?_[_0x2364('0x14')](_0x18ea06['options'][_0x2364('0x13')],function(_0x1d22b5){return{'model':db[_0x1d22b5['model']],'as':_0x1d22b5['as'],'attributes':_0x1d22b5[_0x2364('0x12')],'include':_0x1d22b5[_0x2364('0x13')]?_[_0x2364('0x14')](_0x1d22b5[_0x2364('0x13')],function(_0x47740e){return{'model':db[_0x47740e[_0x2364('0x15')]],'as':_0x47740e['as'],'attributes':_0x47740e[_0x2364('0x12')],'include':_0x47740e[_0x2364('0x13')]?_['map'](_0x47740e[_0x2364('0x13')],function(_0x30da65){return{'model':db[_0x30da65[_0x2364('0x15')]],'as':_0x30da65['as'],'attributes':_0x30da65[_0x2364('0x12')]};}):[]};}):[]};}):[]:[]})[_0x2364('0x6')](function(_0x33511f){logger[_0x2364('0xd')]('ShowSound',_0x18ea06);logger['debug']('ShowSound',_0x18ea06,JSON[_0x2364('0x16')](_0x33511f));_0x4f26e3(_0x33511f);})[_0x2364('0x17')](function(_0x5444c6){logger['error'](_0x2364('0xe'),_0x5444c6[_0x2364('0xc')],_0x18ea06);_0x22d1ac(_0x4f6c95[_0x2364('0xb')](0x1f4,_0x5444c6[_0x2364('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ae0228a..b1145e4 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0xa97d18,_0xc0e8e6){var _0x1ce994=function(_0xdd31f7){while(--_0xdd31f7){_0xa97d18['push'](_0xa97d18['shift']());}};_0x1ce994(++_0xc0e8e6);}(_0x14a0,0x8e));var _0x014a=function(_0x7f14eb,_0x293155){_0x7f14eb=_0x7f14eb-0x0;var _0x554bff=_0x14a0[_0x7f14eb];return _0x554bff;};'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['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x439534,_0x4ff786){var _0x211660=function(_0x338e7e){while(--_0x338e7e){_0x439534['push'](_0x439534['shift']());}};_0x211660(++_0x4ff786);}(_0xda2d,0x102));var _0xdda2=function(_0x51ce72,_0x344852){_0x51ce72=_0x51ce72-0x0;var _0x2ec5f4=_0xda2d[_0x51ce72];return _0x2ec5f4;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1b304c8..f2bc06e 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 _0xe5bc=['STRING','TEXT','ENUM','out','exports'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0xe5bc,0x1ad));var _0xce5b=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xe5bc[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module[_0xce5b('0x0')]={'uniqueid':{'type':Sequelize[_0xce5b('0x1')]},'body':{'type':Sequelize[_0xce5b('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xce5b('0x3')]('in',_0xce5b('0x4')),'defaultValue':_0xce5b('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xce5b('0x2')]}}; \ No newline at end of file +var _0x7513=['out','STRING','sequelize','exports','TEXT','ENUM'];(function(_0x4def4a,_0x192fad){var _0x2758ba=function(_0x2e731c){while(--_0x2e731c){_0x4def4a['push'](_0x4def4a['shift']());}};_0x2758ba(++_0x192fad);}(_0x7513,0x14c));var _0x3751=function(_0x21ddb5,_0x4e5746){_0x21ddb5=_0x21ddb5-0x0;var _0x5d32a1=_0x7513[_0x21ddb5];return _0x5d32a1;};'use strict';var Sequelize=require(_0x3751('0x0'));module[_0x3751('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3751('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3751('0x3')]('in','out'),'defaultValue':_0x3751('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3751('0x5')]},'providerResponse':{'type':Sequelize[_0x3751('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index f6b72f5..7b490e4 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 _0x4049=['show','params','rawAttributes','find','body','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','name','send','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','SquareMessage','findAll','rows','catch'];(function(_0x3f9b54,_0x35bb05){var _0x537027=function(_0x1678c5){while(--_0x1678c5){_0x3f9b54['push'](_0x3f9b54['shift']());}};_0x537027(++_0x35bb05);}(_0x4049,0x177));var _0x9404=function(_0x4b2b2c,_0x17cbcc){_0x4b2b2c=_0x4b2b2c-0x0;var _0x47c263=_0x4049[_0x4b2b2c];return _0x47c263;};'use strict';var emlformat=require(_0x9404('0x0'));var rimraf=require(_0x9404('0x1'));var zipdir=require(_0x9404('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9404('0x3'));var BPromise=require(_0x9404('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9404('0x5'));var sox=require('sox');var csv=require(_0x9404('0x6'));var ejs=require(_0x9404('0x7'));var fs=require('fs');var fs_extra=require(_0x9404('0x8'));var _=require(_0x9404('0x9'));var squel=require(_0x9404('0xa'));var crypto=require(_0x9404('0xb'));var jsforce=require(_0x9404('0xc'));var deskjs=require(_0x9404('0xd'));var toCsv=require(_0x9404('0x6'));var querystring=require(_0x9404('0xe'));var Papa=require(_0x9404('0xf'));var Redis=require(_0x9404('0x10'));var authService=require(_0x9404('0x11'));var qs=require(_0x9404('0x12'));var as=require(_0x9404('0x13'));var hardwareService=require(_0x9404('0x14'));var logger=require(_0x9404('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9404('0x16'));var licenseUtil=require(_0x9404('0x17'));var db=require(_0x9404('0x18'))['db'];function respondWithStatusCode(_0x3398bd,_0x34f5a0){_0x34f5a0=_0x34f5a0||0xcc;return function(_0x567bcc){if(_0x567bcc){return _0x3398bd['sendStatus'](_0x34f5a0);}return _0x3398bd[_0x9404('0x19')](_0x34f5a0)[_0x9404('0x1a')]();};}function respondWithResult(_0x15d49d,_0x927f73){_0x927f73=_0x927f73||0xc8;return function(_0x3d13e8){if(_0x3d13e8){return _0x15d49d[_0x9404('0x19')](_0x927f73)['json'](_0x3d13e8);}};}function respondWithFilteredResult(_0x75e18f,_0x4db206){return function(_0x42c863){if(_0x42c863){var _0x5e42c0=typeof _0x4db206['offset']===_0x9404('0x1b')&&typeof _0x4db206['limit']==='undefined';var _0x6583c8=_0x42c863[_0x9404('0x1c')];var _0x29f018=_0x5e42c0?0x0:_0x4db206[_0x9404('0x1d')];var _0x34068f=_0x5e42c0?_0x42c863[_0x9404('0x1c')]:_0x4db206[_0x9404('0x1d')]+_0x4db206[_0x9404('0x1e')];var _0x122231;if(_0x34068f>=_0x6583c8){_0x34068f=_0x6583c8;_0x122231=0xc8;}else{_0x122231=0xce;}_0x75e18f['status'](_0x122231);return _0x75e18f[_0x9404('0x1f')](_0x9404('0x20'),_0x29f018+'-'+_0x34068f+'/'+_0x6583c8)[_0x9404('0x21')](_0x42c863);}return null;};}function patchUpdates(_0x40d2db){return function(_0x465787){try{jsonpatch[_0x9404('0x22')](_0x465787,_0x40d2db,!![]);}catch(_0x46e447){return BPromise[_0x9404('0x23')](_0x46e447);}return _0x465787['save']();};}function saveUpdates(_0x3ea676,_0x241182){return function(_0x4e0953){if(_0x4e0953){return _0x4e0953['update'](_0x3ea676)[_0x9404('0x24')](function(_0x59eabb){return _0x59eabb;});}return null;};}function removeEntity(_0x50185a,_0x36ab65){return function(_0x48d713){if(_0x48d713){return _0x48d713[_0x9404('0x25')]()['then'](function(){_0x50185a[_0x9404('0x19')](0xcc)[_0x9404('0x1a')]();});}};}function handleEntityNotFound(_0x4eca2d,_0x3d41c5){return function(_0x3940aa){if(!_0x3940aa){_0x4eca2d[_0x9404('0x26')](0x194);}return _0x3940aa;};}function handleError(_0x224c67,_0x4173bb){_0x4173bb=_0x4173bb||0x1f4;return function(_0x419221){logger[_0x9404('0x27')](_0x419221['stack']);if(_0x419221[_0x9404('0x28')]){delete _0x419221[_0x9404('0x28')];}_0x224c67[_0x9404('0x19')](_0x4173bb)[_0x9404('0x29')](_0x419221);};}exports['index']=function(_0xddb0f9,_0x4a600a){var _0x4a3af7={},_0x1c2169={},_0x1b1a76={'count':0x0,'rows':[]};var _0x217f4e=_['map'](db['SquareMessage']['rawAttributes'],function(_0x26a2a8){return{'name':_0x26a2a8[_0x9404('0x2a')],'type':_0x26a2a8[_0x9404('0x2b')]['key']};});_0x1c2169[_0x9404('0x2c')]=_['map'](_0x217f4e,_0x9404('0x28'));_0x1c2169[_0x9404('0x2d')]=_[_0x9404('0x2e')](_0xddb0f9[_0x9404('0x2d')]);_0x1c2169[_0x9404('0x2f')]=_['intersection'](_0x1c2169[_0x9404('0x2c')],_0x1c2169['query']);_0x4a3af7[_0x9404('0x30')]=_[_0x9404('0x31')](_0x1c2169[_0x9404('0x2c')],qs[_0x9404('0x32')](_0xddb0f9[_0x9404('0x2d')][_0x9404('0x32')]));_0x4a3af7[_0x9404('0x30')]=_0x4a3af7[_0x9404('0x30')][_0x9404('0x33')]?_0x4a3af7[_0x9404('0x30')]:_0x1c2169['model'];if(!_0xddb0f9[_0x9404('0x2d')][_0x9404('0x34')](_0x9404('0x35'))){_0x4a3af7[_0x9404('0x1e')]=qs['limit'](_0xddb0f9[_0x9404('0x2d')][_0x9404('0x1e')]);_0x4a3af7['offset']=qs[_0x9404('0x1d')](_0xddb0f9[_0x9404('0x2d')][_0x9404('0x1d')]);}_0x4a3af7[_0x9404('0x36')]=qs[_0x9404('0x37')](_0xddb0f9['query'][_0x9404('0x37')]);_0x4a3af7[_0x9404('0x38')]=qs[_0x9404('0x2f')](_[_0x9404('0x39')](_0xddb0f9[_0x9404('0x2d')],_0x1c2169['filters']),_0x217f4e);if(_0xddb0f9[_0x9404('0x2d')][_0x9404('0x3a')]){_0x4a3af7[_0x9404('0x38')]=_[_0x9404('0x3b')](_0x4a3af7[_0x9404('0x38')],{'$or':_[_0x9404('0x3c')](_0x217f4e,function(_0x28858e){if(_0x28858e[_0x9404('0x2b')]!==_0x9404('0x3d')){var _0x2558ca={};_0x2558ca[_0x28858e[_0x9404('0x28')]]={'$like':'%'+_0xddb0f9['query'][_0x9404('0x3a')]+'%'};return _0x2558ca;}})});}_0x4a3af7=_[_0x9404('0x3b')]({},_0x4a3af7,_0xddb0f9[_0x9404('0x3e')]);var _0x35c313={'where':_0x4a3af7[_0x9404('0x38')]};return db['SquareMessage'][_0x9404('0x1c')](_0x35c313)[_0x9404('0x24')](function(_0xfe145){_0x1b1a76[_0x9404('0x1c')]=_0xfe145;if(_0xddb0f9[_0x9404('0x2d')][_0x9404('0x3f')]){_0x4a3af7[_0x9404('0x40')]=[{'all':!![]}];}return db[_0x9404('0x41')][_0x9404('0x42')](_0x4a3af7);})['then'](function(_0x444975){_0x1b1a76[_0x9404('0x43')]=_0x444975;return _0x1b1a76;})['then'](respondWithFilteredResult(_0x4a600a,_0x4a3af7))[_0x9404('0x44')](handleError(_0x4a600a,null));};exports[_0x9404('0x45')]=function(_0x58c134,_0x351c96){var _0x2a07df={'raw':!![],'where':{'id':_0x58c134[_0x9404('0x46')]['id']}},_0x3bdafb={};_0x3bdafb[_0x9404('0x2c')]=_[_0x9404('0x2e')](db['SquareMessage'][_0x9404('0x47')]);_0x3bdafb[_0x9404('0x2d')]=_[_0x9404('0x2e')](_0x58c134[_0x9404('0x2d')]);_0x3bdafb[_0x9404('0x2f')]=_['intersection'](_0x3bdafb[_0x9404('0x2c')],_0x3bdafb[_0x9404('0x2d')]);_0x2a07df[_0x9404('0x30')]=_['intersection'](_0x3bdafb['model'],qs[_0x9404('0x32')](_0x58c134[_0x9404('0x2d')][_0x9404('0x32')]));_0x2a07df[_0x9404('0x30')]=_0x2a07df['attributes'][_0x9404('0x33')]?_0x2a07df[_0x9404('0x30')]:_0x3bdafb['model'];if(_0x58c134[_0x9404('0x2d')][_0x9404('0x3f')]){_0x2a07df[_0x9404('0x40')]=[{'all':!![]}];}_0x2a07df=_[_0x9404('0x3b')]({},_0x2a07df,_0x58c134[_0x9404('0x3e')]);return db[_0x9404('0x41')][_0x9404('0x48')](_0x2a07df)['then'](handleEntityNotFound(_0x351c96,null))['then'](respondWithResult(_0x351c96,null))[_0x9404('0x44')](handleError(_0x351c96,null));};exports['create']=function(_0x501a3d,_0x2186c2){return db[_0x9404('0x41')]['create'](_0x501a3d[_0x9404('0x49')],{})['then'](respondWithResult(_0x2186c2,0xc9))[_0x9404('0x44')](handleError(_0x2186c2,null));};exports['update']=function(_0x1bc451,_0x5641d5){if(_0x1bc451['body']['id']){delete _0x1bc451[_0x9404('0x49')]['id'];}return db[_0x9404('0x41')][_0x9404('0x48')]({'where':{'id':_0x1bc451[_0x9404('0x46')]['id']}})[_0x9404('0x24')](handleEntityNotFound(_0x5641d5,null))[_0x9404('0x24')](saveUpdates(_0x1bc451['body'],null))[_0x9404('0x24')](respondWithResult(_0x5641d5,null))[_0x9404('0x44')](handleError(_0x5641d5,null));};exports[_0x9404('0x25')]=function(_0x476d19,_0x3caa79){return db[_0x9404('0x41')][_0x9404('0x48')]({'where':{'id':_0x476d19[_0x9404('0x46')]['id']}})[_0x9404('0x24')](handleEntityNotFound(_0x3caa79,null))['then'](removeEntity(_0x3caa79,null))[_0x9404('0x44')](handleError(_0x3caa79,null));}; \ No newline at end of file +var _0x33cd=['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','end','json','offset','limit','undefined','count','set','apply','then','sendStatus','error','stack','name','send','index','map','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SquareMessage','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x33cd,0x180));var _0xd33c=function(_0x5e6698,_0x598fce){_0x5e6698=_0x5e6698-0x0;var _0x4e8735=_0x33cd[_0x5e6698];return _0x4e8735;};'use strict';var emlformat=require(_0xd33c('0x0'));var rimraf=require(_0xd33c('0x1'));var zipdir=require(_0xd33c('0x2'));var jsonpatch=require(_0xd33c('0x3'));var rp=require(_0xd33c('0x4'));var moment=require(_0xd33c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd33c('0x6'));var path=require(_0xd33c('0x7'));var sox=require(_0xd33c('0x8'));var csv=require(_0xd33c('0x9'));var ejs=require(_0xd33c('0xa'));var fs=require('fs');var fs_extra=require(_0xd33c('0xb'));var _=require(_0xd33c('0xc'));var squel=require(_0xd33c('0xd'));var crypto=require(_0xd33c('0xe'));var jsforce=require(_0xd33c('0xf'));var deskjs=require(_0xd33c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd33c('0x11'));var Redis=require(_0xd33c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd33c('0x13'));var as=require(_0xd33c('0x14'));var hardwareService=require(_0xd33c('0x15'));var logger=require(_0xd33c('0x16'))(_0xd33c('0x17'));var utils=require(_0xd33c('0x18'));var config=require(_0xd33c('0x19'));var licenseUtil=require(_0xd33c('0x1a'));var db=require(_0xd33c('0x1b'))['db'];function respondWithStatusCode(_0x155727,_0x2f6a77){_0x2f6a77=_0x2f6a77||0xcc;return function(_0x3a38af){if(_0x3a38af){return _0x155727['sendStatus'](_0x2f6a77);}return _0x155727[_0xd33c('0x1c')](_0x2f6a77)[_0xd33c('0x1d')]();};}function respondWithResult(_0x4ca174,_0x2ec24d){_0x2ec24d=_0x2ec24d||0xc8;return function(_0x829443){if(_0x829443){return _0x4ca174[_0xd33c('0x1c')](_0x2ec24d)[_0xd33c('0x1e')](_0x829443);}};}function respondWithFilteredResult(_0x4b014c,_0x191593){return function(_0x1a1b24){if(_0x1a1b24){var _0x19967a=typeof _0x191593[_0xd33c('0x1f')]==='undefined'&&typeof _0x191593[_0xd33c('0x20')]===_0xd33c('0x21');var _0x3e5104=_0x1a1b24[_0xd33c('0x22')];var _0x140c79=_0x19967a?0x0:_0x191593[_0xd33c('0x1f')];var _0x41b39a=_0x19967a?_0x1a1b24[_0xd33c('0x22')]:_0x191593[_0xd33c('0x1f')]+_0x191593[_0xd33c('0x20')];var _0x4d551;if(_0x41b39a>=_0x3e5104){_0x41b39a=_0x3e5104;_0x4d551=0xc8;}else{_0x4d551=0xce;}_0x4b014c[_0xd33c('0x1c')](_0x4d551);return _0x4b014c[_0xd33c('0x23')]('Content-Range',_0x140c79+'-'+_0x41b39a+'/'+_0x3e5104)[_0xd33c('0x1e')](_0x1a1b24);}return null;};}function patchUpdates(_0x1bdd52){return function(_0x347480){try{jsonpatch[_0xd33c('0x24')](_0x347480,_0x1bdd52,!![]);}catch(_0x973bc5){return BPromise['reject'](_0x973bc5);}return _0x347480['save']();};}function saveUpdates(_0x156acb,_0xe07e1a){return function(_0xc60004){if(_0xc60004){return _0xc60004['update'](_0x156acb)[_0xd33c('0x25')](function(_0xc36199){return _0xc36199;});}return null;};}function removeEntity(_0x190411,_0x23ed07){return function(_0x119713){if(_0x119713){return _0x119713['destroy']()[_0xd33c('0x25')](function(){_0x190411['status'](0xcc)[_0xd33c('0x1d')]();});}};}function handleEntityNotFound(_0x18a68c,_0x2c04a2){return function(_0xd5122){if(!_0xd5122){_0x18a68c[_0xd33c('0x26')](0x194);}return _0xd5122;};}function handleError(_0x465bc8,_0x41c9a1){_0x41c9a1=_0x41c9a1||0x1f4;return function(_0x327e17){logger[_0xd33c('0x27')](_0x327e17[_0xd33c('0x28')]);if(_0x327e17[_0xd33c('0x29')]){delete _0x327e17[_0xd33c('0x29')];}_0x465bc8['status'](_0x41c9a1)[_0xd33c('0x2a')](_0x327e17);};}exports[_0xd33c('0x2b')]=function(_0xa7c096,_0x2d5a12){var _0x258b3e={},_0x414dd1={},_0x29c77c={'count':0x0,'rows':[]};var _0x3b0ef8=_[_0xd33c('0x2c')](db['SquareMessage']['rawAttributes'],function(_0x27cb65){return{'name':_0x27cb65[_0xd33c('0x2d')],'type':_0x27cb65[_0xd33c('0x2e')]['key']};});_0x414dd1[_0xd33c('0x2f')]=_['map'](_0x3b0ef8,_0xd33c('0x29'));_0x414dd1['query']=_[_0xd33c('0x30')](_0xa7c096[_0xd33c('0x31')]);_0x414dd1[_0xd33c('0x32')]=_['intersection'](_0x414dd1['model'],_0x414dd1[_0xd33c('0x31')]);_0x258b3e[_0xd33c('0x33')]=_['intersection'](_0x414dd1[_0xd33c('0x2f')],qs[_0xd33c('0x34')](_0xa7c096[_0xd33c('0x31')][_0xd33c('0x34')]));_0x258b3e[_0xd33c('0x33')]=_0x258b3e[_0xd33c('0x33')][_0xd33c('0x35')]?_0x258b3e[_0xd33c('0x33')]:_0x414dd1['model'];if(!_0xa7c096['query'][_0xd33c('0x36')](_0xd33c('0x37'))){_0x258b3e[_0xd33c('0x20')]=qs[_0xd33c('0x20')](_0xa7c096[_0xd33c('0x31')][_0xd33c('0x20')]);_0x258b3e[_0xd33c('0x1f')]=qs[_0xd33c('0x1f')](_0xa7c096['query'][_0xd33c('0x1f')]);}_0x258b3e[_0xd33c('0x38')]=qs[_0xd33c('0x39')](_0xa7c096['query'][_0xd33c('0x39')]);_0x258b3e[_0xd33c('0x3a')]=qs[_0xd33c('0x32')](_[_0xd33c('0x3b')](_0xa7c096[_0xd33c('0x31')],_0x414dd1[_0xd33c('0x32')]),_0x3b0ef8);if(_0xa7c096[_0xd33c('0x31')][_0xd33c('0x3c')]){_0x258b3e[_0xd33c('0x3a')]=_['merge'](_0x258b3e[_0xd33c('0x3a')],{'$or':_[_0xd33c('0x2c')](_0x3b0ef8,function(_0x454388){if(_0x454388[_0xd33c('0x2e')]!==_0xd33c('0x3d')){var _0x3369a9={};_0x3369a9[_0x454388['name']]={'$like':'%'+_0xa7c096[_0xd33c('0x31')][_0xd33c('0x3c')]+'%'};return _0x3369a9;}})});}_0x258b3e=_[_0xd33c('0x3e')]({},_0x258b3e,_0xa7c096[_0xd33c('0x3f')]);var _0x2ab53f={'where':_0x258b3e[_0xd33c('0x3a')]};return db[_0xd33c('0x40')][_0xd33c('0x22')](_0x2ab53f)[_0xd33c('0x25')](function(_0x382b7b){_0x29c77c['count']=_0x382b7b;if(_0xa7c096[_0xd33c('0x31')][_0xd33c('0x41')]){_0x258b3e[_0xd33c('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0xd33c('0x43')](_0x258b3e);})[_0xd33c('0x25')](function(_0x54555b){_0x29c77c[_0xd33c('0x44')]=_0x54555b;return _0x29c77c;})['then'](respondWithFilteredResult(_0x2d5a12,_0x258b3e))['catch'](handleError(_0x2d5a12,null));};exports[_0xd33c('0x45')]=function(_0xb0dc83,_0x11c5b1){var _0x35cae2={'raw':!![],'where':{'id':_0xb0dc83[_0xd33c('0x46')]['id']}},_0x16d8f4={};_0x16d8f4['model']=_[_0xd33c('0x30')](db[_0xd33c('0x40')]['rawAttributes']);_0x16d8f4['query']=_[_0xd33c('0x30')](_0xb0dc83[_0xd33c('0x31')]);_0x16d8f4[_0xd33c('0x32')]=_[_0xd33c('0x47')](_0x16d8f4['model'],_0x16d8f4[_0xd33c('0x31')]);_0x35cae2[_0xd33c('0x33')]=_['intersection'](_0x16d8f4[_0xd33c('0x2f')],qs[_0xd33c('0x34')](_0xb0dc83[_0xd33c('0x31')][_0xd33c('0x34')]));_0x35cae2[_0xd33c('0x33')]=_0x35cae2[_0xd33c('0x33')]['length']?_0x35cae2[_0xd33c('0x33')]:_0x16d8f4[_0xd33c('0x2f')];if(_0xb0dc83[_0xd33c('0x31')]['includeAll']){_0x35cae2[_0xd33c('0x42')]=[{'all':!![]}];}_0x35cae2=_['merge']({},_0x35cae2,_0xb0dc83[_0xd33c('0x3f')]);return db[_0xd33c('0x40')][_0xd33c('0x48')](_0x35cae2)[_0xd33c('0x25')](handleEntityNotFound(_0x11c5b1,null))['then'](respondWithResult(_0x11c5b1,null))['catch'](handleError(_0x11c5b1,null));};exports[_0xd33c('0x49')]=function(_0xb47f06,_0x346f91){return db[_0xd33c('0x40')][_0xd33c('0x49')](_0xb47f06[_0xd33c('0x4a')],{})[_0xd33c('0x25')](respondWithResult(_0x346f91,0xc9))[_0xd33c('0x4b')](handleError(_0x346f91,null));};exports[_0xd33c('0x4c')]=function(_0x6307fc,_0xb9a40d){if(_0x6307fc[_0xd33c('0x4a')]['id']){delete _0x6307fc[_0xd33c('0x4a')]['id'];}return db['SquareMessage'][_0xd33c('0x48')]({'where':{'id':_0x6307fc[_0xd33c('0x46')]['id']}})[_0xd33c('0x25')](handleEntityNotFound(_0xb9a40d,null))[_0xd33c('0x25')](saveUpdates(_0x6307fc['body'],null))['then'](respondWithResult(_0xb9a40d,null))[_0xd33c('0x4b')](handleError(_0xb9a40d,null));};exports[_0xd33c('0x4d')]=function(_0x44f21d,_0x588130){return db['SquareMessage'][_0xd33c('0x48')]({'where':{'id':_0x44f21d[_0xd33c('0x46')]['id']}})[_0xd33c('0x25')](handleEntityNotFound(_0x588130,null))['then'](removeEntity(_0x588130,null))[_0xd33c('0x4b')](handleError(_0x588130,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c046513..f6784cb 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 _0x061b=['square_messages','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x061b,0x15d));var _0xb061=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x061b[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0xb061('0x0'));var logger=require(_0xb061('0x1'))('api');var moment=require(_0xb061('0x2'));var BPromise=require(_0xb061('0x3'));var rp=require(_0xb061('0x4'));var fs=require('fs');var path=require(_0xb061('0x5'));var rimraf=require('rimraf');var config=require(_0xb061('0x6'));var attributes=require(_0xb061('0x7'));module[_0xb061('0x8')]=function(_0x185fc7,_0x598bef){return _0x185fc7[_0xb061('0x9')](_0xb061('0xa'),attributes,{'tableName':_0xb061('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ab=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','../../config/logger','api'];(function(_0x57bd12,_0x6285dd){var _0x2dad13=function(_0x35dfa5){while(--_0x35dfa5){_0x57bd12['push'](_0x57bd12['shift']());}};_0x2dad13(++_0x6285dd);}(_0x06ab,0x148));var _0xb06a=function(_0x192313,_0x30dc3a){_0x192313=_0x192313-0x0;var _0x50cfc0=_0x06ab[_0x192313];return _0x50cfc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb06a('0x0'))(_0xb06a('0x1'));var moment=require(_0xb06a('0x2'));var BPromise=require(_0xb06a('0x3'));var rp=require(_0xb06a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb06a('0x5'));var config=require(_0xb06a('0x6'));var attributes=require(_0xb06a('0x7'));module[_0xb06a('0x8')]=function(_0x203924,_0x2c1ff1){return _0x203924[_0xb06a('0x9')](_0xb06a('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 3271f56..3d5e01d 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 _0x7bac=['info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','catch','CreateSquareMessage','create','body','options','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x59c89e,_0x273a9d){var _0x246672=function(_0x416c5d){while(--_0x416c5d){_0x59c89e['push'](_0x59c89e['shift']());}};_0x246672(++_0x273a9d);}(_0x7bac,0x65));var _0xc7ba=function(_0x4c6dc6,_0x2f4870){_0x4c6dc6=_0x4c6dc6-0x0;var _0x6e96ee=_0x7bac[_0x4c6dc6];return _0x6e96ee;};'use strict';var _=require(_0xc7ba('0x0'));var util=require(_0xc7ba('0x1'));var moment=require(_0xc7ba('0x2'));var BPromise=require(_0xc7ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7ba('0x4'));var db=require(_0xc7ba('0x5'))['db'];var utils=require(_0xc7ba('0x6'));var logger=require(_0xc7ba('0x7'))(_0xc7ba('0x8'));var config=require(_0xc7ba('0x9'));var jayson=require(_0xc7ba('0xa'));var client=jayson[_0xc7ba('0xb')][_0xc7ba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56b03b,_0x30e4b8,_0x2bd742){return new BPromise(function(_0xf8b078,_0x192b06){return client[_0xc7ba('0xd')](_0x56b03b,_0x2bd742)[_0xc7ba('0xe')](function(_0x4f9481){logger[_0xc7ba('0xf')]('SquareMessage,\x20%s,\x20%s',_0x30e4b8,_0xc7ba('0x10'));logger[_0xc7ba('0x11')](_0xc7ba('0x12'),_0x30e4b8,_0xc7ba('0x10'),JSON['stringify'](_0x4f9481));if(_0x4f9481[_0xc7ba('0x13')]){if(_0x4f9481[_0xc7ba('0x13')][_0xc7ba('0x14')]===0x1f4){logger['error'](_0xc7ba('0x15'),_0x30e4b8,_0x4f9481[_0xc7ba('0x13')][_0xc7ba('0x16')]);return _0x192b06(_0x4f9481[_0xc7ba('0x13')]['message']);}logger[_0xc7ba('0x13')](_0xc7ba('0x15'),_0x30e4b8,_0x4f9481[_0xc7ba('0x13')][_0xc7ba('0x16')]);return _0xf8b078(_0x4f9481['error'][_0xc7ba('0x16')]);}else{logger['info'](_0xc7ba('0x15'),_0x30e4b8,_0xc7ba('0x10'));_0xf8b078(_0x4f9481['result']['message']);}})[_0xc7ba('0x17')](function(_0x4137cf){logger[_0xc7ba('0x13')](_0xc7ba('0x15'),_0x30e4b8,_0x4137cf);_0x192b06(_0x4137cf);});});}exports[_0xc7ba('0x18')]=function(_0x5b80cc){var _0x514025=this;return new Promise(function(_0x6c72eb,_0x16bbce){return db['SquareMessage'][_0xc7ba('0x19')](_0x5b80cc[_0xc7ba('0x1a')],{'raw':_0x5b80cc[_0xc7ba('0x1b')]?_0x5b80cc['options']['raw']===undefined?!![]:![]:!![]})[_0xc7ba('0xe')](function(_0x4bdf99){logger[_0xc7ba('0xf')](_0xc7ba('0x18'),_0x5b80cc);logger[_0xc7ba('0x11')](_0xc7ba('0x18'),_0x5b80cc,JSON[_0xc7ba('0x1c')](_0x4bdf99));_0x6c72eb(_0x4bdf99);})[_0xc7ba('0x17')](function(_0x20383c){logger['error'](_0xc7ba('0x18'),_0x20383c[_0xc7ba('0x16')],_0x5b80cc);_0x16bbce(_0x514025['error'](0x1f4,_0x20383c['message']));});});}; \ No newline at end of file +var _0xac1d=['then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateSquareMessage','SquareMessage','create','body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x50667a,_0x2655af){var _0x305875=function(_0x36c144){while(--_0x36c144){_0x50667a['push'](_0x50667a['shift']());}};_0x305875(++_0x2655af);}(_0xac1d,0xbf));var _0xdac1=function(_0x5cecea,_0x322303){_0x5cecea=_0x5cecea-0x0;var _0x5156ab=_0xac1d[_0x5cecea];return _0x5156ab;};'use strict';var _=require(_0xdac1('0x0'));var util=require(_0xdac1('0x1'));var moment=require(_0xdac1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdac1('0x3'));var fs=require('fs');var Redis=require(_0xdac1('0x4'));var db=require(_0xdac1('0x5'))['db'];var utils=require(_0xdac1('0x6'));var logger=require(_0xdac1('0x7'))(_0xdac1('0x8'));var config=require(_0xdac1('0x9'));var jayson=require(_0xdac1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x549f3f,_0x5a27cd,_0x35e199){return new BPromise(function(_0x141c16,_0x3cc3d6){return client[_0xdac1('0xb')](_0x549f3f,_0x35e199)[_0xdac1('0xc')](function(_0x85d3fb){logger['info'](_0xdac1('0xd'),_0x5a27cd,_0xdac1('0xe'));logger[_0xdac1('0xf')](_0xdac1('0x10'),_0x5a27cd,'request\x20sent',JSON[_0xdac1('0x11')](_0x85d3fb));if(_0x85d3fb[_0xdac1('0x12')]){if(_0x85d3fb[_0xdac1('0x12')][_0xdac1('0x13')]===0x1f4){logger['error'](_0xdac1('0xd'),_0x5a27cd,_0x85d3fb[_0xdac1('0x12')]['message']);return _0x3cc3d6(_0x85d3fb[_0xdac1('0x12')][_0xdac1('0x14')]);}logger[_0xdac1('0x12')]('SquareMessage,\x20%s,\x20%s',_0x5a27cd,_0x85d3fb[_0xdac1('0x12')]['message']);return _0x141c16(_0x85d3fb[_0xdac1('0x12')][_0xdac1('0x14')]);}else{logger[_0xdac1('0x15')](_0xdac1('0xd'),_0x5a27cd,_0xdac1('0xe'));_0x141c16(_0x85d3fb['result'][_0xdac1('0x14')]);}})['catch'](function(_0x1ba67a){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5a27cd,_0x1ba67a);_0x3cc3d6(_0x1ba67a);});});}exports[_0xdac1('0x16')]=function(_0x3b8e2b){var _0x63e032=this;return new Promise(function(_0x4438b0,_0x3e3118){return db[_0xdac1('0x17')][_0xdac1('0x18')](_0x3b8e2b[_0xdac1('0x19')],{'raw':_0x3b8e2b[_0xdac1('0x1a')]?_0x3b8e2b[_0xdac1('0x1a')][_0xdac1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x13e24b){logger[_0xdac1('0x15')](_0xdac1('0x16'),_0x3b8e2b);logger['debug'](_0xdac1('0x16'),_0x3b8e2b,JSON['stringify'](_0x13e24b));_0x4438b0(_0x13e24b);})[_0xdac1('0x1c')](function(_0x8e2eda){logger[_0xdac1('0x12')](_0xdac1('0x16'),_0x8e2eda[_0xdac1('0x14')],_0x3b8e2b);_0x3e3118(_0x63e032[_0xdac1('0x12')](0x1f4,_0x8e2eda[_0xdac1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 0bc4bb9..99a0a4a 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 _0x664e=['../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','create','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ec532,_0x41b664){var _0x5dcfe5=function(_0x5988f6){while(--_0x5988f6){_0x2ec532['push'](_0x2ec532['shift']());}};_0x5dcfe5(++_0x41b664);}(_0x664e,0x1c6));var _0xe664=function(_0x308e81,_0x217890){_0x308e81=_0x308e81-0x0;var _0x112806=_0x664e[_0x308e81];return _0x112806;};'use strict';var multer=require(_0xe664('0x0'));var util=require('util');var path=require(_0xe664('0x1'));var timeout=require('connect-timeout');var express=require(_0xe664('0x2'));var router=express[_0xe664('0x3')]();var fs_extra=require(_0xe664('0x4'));var auth=require(_0xe664('0x5'));var interaction=require(_0xe664('0x6'));var config=require('../../config/environment');var controller=require(_0xe664('0x7'));router[_0xe664('0x8')]('/',auth[_0xe664('0x9')](),controller[_0xe664('0xa')]);router[_0xe664('0x8')](_0xe664('0xb'),auth[_0xe664('0x9')](),controller['show']);router[_0xe664('0x8')](_0xe664('0xc'),auth[_0xe664('0x9')](),timeout(_0xe664('0xd')),controller[_0xe664('0xe')]);router[_0xe664('0xf')]('/',auth[_0xe664('0x9')](),controller[_0xe664('0x10')]);router['put'](_0xe664('0xb'),auth[_0xe664('0x9')](),controller[_0xe664('0x11')]);router[_0xe664('0x12')]('/:id',auth[_0xe664('0x9')](),controller[_0xe664('0x13')]);module['exports']=router; \ No newline at end of file +var _0xcf51=['../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','put','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xcf51,0x161));var _0x1cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf51[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x1cf5('0x0'));var path=require(_0x1cf5('0x1'));var timeout=require(_0x1cf5('0x2'));var express=require(_0x1cf5('0x3'));var router=express[_0x1cf5('0x4')]();var fs_extra=require(_0x1cf5('0x5'));var auth=require(_0x1cf5('0x6'));var interaction=require(_0x1cf5('0x7'));var config=require(_0x1cf5('0x8'));var controller=require(_0x1cf5('0x9'));router[_0x1cf5('0xa')]('/',auth[_0x1cf5('0xb')](),controller[_0x1cf5('0xc')]);router['get']('/:id',auth[_0x1cf5('0xb')](),controller[_0x1cf5('0xd')]);router['get'](_0x1cf5('0xe'),auth[_0x1cf5('0xb')](),timeout(_0x1cf5('0xf')),controller[_0x1cf5('0x10')]);router[_0x1cf5('0x11')]('/',auth[_0x1cf5('0xb')](),controller[_0x1cf5('0x12')]);router[_0x1cf5('0x13')]('/:id',auth[_0x1cf5('0xb')](),controller[_0x1cf5('0x14')]);router['delete'](_0x1cf5('0x15'),auth['isAuthenticated'](),controller[_0x1cf5('0x16')]);module[_0x1cf5('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 07b2bea..0d6fef6 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 _0xdadd=['sequelize','STRING'];(function(_0x39b899,_0xffd0ef){var _0x39490f=function(_0x4388aa){while(--_0x4388aa){_0x39b899['push'](_0x39b899['shift']());}};_0x39490f(++_0xffd0ef);}(_0xdadd,0x1c8));var _0xddad=function(_0x4c0998,_0x165050){_0x4c0998=_0x4c0998-0x0;var _0x1110e2=_0xdadd[_0x4c0998];return _0x1110e2;};'use strict';var Sequelize=require(_0xddad('0x0'));module['exports']={'name':{'type':Sequelize[_0xddad('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xddad('0x1')]},'description':{'type':Sequelize[_0xddad('0x1')]}}; \ No newline at end of file +var _0x2032=['STRING','sequelize','exports'];(function(_0x224b50,_0x55a343){var _0x1f3e9b=function(_0x26ae7c){while(--_0x26ae7c){_0x224b50['push'](_0x224b50['shift']());}};_0x1f3e9b(++_0x55a343);}(_0x2032,0xc7));var _0x2203=function(_0x44032d,_0x2a470f){_0x44032d=_0x44032d-0x0;var _0xad55f4=_0x2032[_0x44032d];return _0xad55f4;};'use strict';var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'name':{'type':Sequelize[_0x2203('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 33ad121..53bc1da 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 _0x0f39=['odbc','eml-format','rimraf','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','params','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x0f39,0x141));var _0x90f3=function(_0x2e83cf,_0x2fdd4b){_0x2e83cf=_0x2e83cf-0x0;var _0x958981=_0x0f39[_0x2e83cf];return _0x958981;};'use strict';var emlformat=require(_0x90f3('0x0'));var rimraf=require(_0x90f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90f3('0x2'));var rp=require('request-promise');var moment=require(_0x90f3('0x3'));var BPromise=require(_0x90f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x90f3('0x5'));var sox=require('sox');var csv=require(_0x90f3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90f3('0x7'));var _=require(_0x90f3('0x8'));var squel=require(_0x90f3('0x9'));var crypto=require(_0x90f3('0xa'));var jsforce=require(_0x90f3('0xb'));var deskjs=require(_0x90f3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90f3('0xd'));var Redis=require('ioredis');var authService=require(_0x90f3('0xe'));var qs=require(_0x90f3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90f3('0x10'))(_0x90f3('0x11'));var utils=require(_0x90f3('0x12'));var config=require(_0x90f3('0x13'));var licenseUtil=require(_0x90f3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e9f70,_0x111b87){_0x111b87=_0x111b87||0xcc;return function(_0x81bb3c){if(_0x81bb3c){return _0x1e9f70['sendStatus'](_0x111b87);}return _0x1e9f70['status'](_0x111b87)[_0x90f3('0x15')]();};}function respondWithResult(_0x3ec44d,_0x1f95d0){_0x1f95d0=_0x1f95d0||0xc8;return function(_0x1bcf3f){if(_0x1bcf3f){return _0x3ec44d[_0x90f3('0x16')](_0x1f95d0)[_0x90f3('0x17')](_0x1bcf3f);}};}function respondWithFilteredResult(_0x109e2e,_0x181ab1){return function(_0x29175a){if(_0x29175a){var _0xebc93b=typeof _0x181ab1['offset']===_0x90f3('0x18')&&typeof _0x181ab1[_0x90f3('0x19')]===_0x90f3('0x18');var _0x235ea7=_0x29175a[_0x90f3('0x1a')];var _0x441ce6=_0xebc93b?0x0:_0x181ab1[_0x90f3('0x1b')];var _0x4bbe38=_0xebc93b?_0x29175a[_0x90f3('0x1a')]:_0x181ab1[_0x90f3('0x1b')]+_0x181ab1['limit'];var _0xacf9c;if(_0x4bbe38>=_0x235ea7){_0x4bbe38=_0x235ea7;_0xacf9c=0xc8;}else{_0xacf9c=0xce;}_0x109e2e['status'](_0xacf9c);return _0x109e2e[_0x90f3('0x1c')](_0x90f3('0x1d'),_0x441ce6+'-'+_0x4bbe38+'/'+_0x235ea7)[_0x90f3('0x17')](_0x29175a);}return null;};}function patchUpdates(_0x49cef5){return function(_0x3341b7){try{jsonpatch['apply'](_0x3341b7,_0x49cef5,!![]);}catch(_0x341f3e){return BPromise[_0x90f3('0x1e')](_0x341f3e);}return _0x3341b7['save']();};}function saveUpdates(_0x1da01f,_0x2ea824){return function(_0x1aa421){if(_0x1aa421){return _0x1aa421[_0x90f3('0x1f')](_0x1da01f)[_0x90f3('0x20')](function(_0x30c1be){return _0x30c1be;});}return null;};}function removeEntity(_0x26d755,_0xa2c05){return function(_0x30307c){if(_0x30307c){return _0x30307c[_0x90f3('0x21')]()[_0x90f3('0x20')](function(){var _0x22caea=_0x30307c[_0x90f3('0x22')]({'plain':!![]});var _0xa4b011='ODBC';return db[_0x90f3('0x23')][_0x90f3('0x21')]({'where':{'type':_0xa4b011,'resourceId':_0x22caea['id']}})[_0x90f3('0x20')](function(){return _0x30307c;});})['then'](function(){_0x26d755[_0x90f3('0x16')](0xcc)[_0x90f3('0x15')]();});}};}function handleEntityNotFound(_0x419d0a,_0x4e16ff){return function(_0x3dcb21){if(!_0x3dcb21){_0x419d0a[_0x90f3('0x24')](0x194);}return _0x3dcb21;};}function handleError(_0x4676b2,_0x3ea65c){_0x3ea65c=_0x3ea65c||0x1f4;return function(_0x50cf91){logger[_0x90f3('0x25')](_0x50cf91[_0x90f3('0x26')]);if(_0x50cf91['name']){delete _0x50cf91['name'];}_0x4676b2['status'](_0x3ea65c)[_0x90f3('0x27')](_0x50cf91);};}exports[_0x90f3('0x28')]=function(_0x5c2579,_0x532d56){var _0x8b589d={},_0x17a235={},_0x317488={'count':0x0,'rows':[]};var _0x346701=_[_0x90f3('0x29')](db[_0x90f3('0x2a')][_0x90f3('0x2b')],function(_0x318249){return{'name':_0x318249[_0x90f3('0x2c')],'type':_0x318249[_0x90f3('0x2d')][_0x90f3('0x2e')]};});_0x17a235[_0x90f3('0x2f')]=_[_0x90f3('0x29')](_0x346701,_0x90f3('0x30'));_0x17a235[_0x90f3('0x31')]=_[_0x90f3('0x32')](_0x5c2579[_0x90f3('0x31')]);_0x17a235[_0x90f3('0x33')]=_[_0x90f3('0x34')](_0x17a235['model'],_0x17a235['query']);_0x8b589d['attributes']=_[_0x90f3('0x34')](_0x17a235[_0x90f3('0x2f')],qs[_0x90f3('0x35')](_0x5c2579[_0x90f3('0x31')][_0x90f3('0x35')]));_0x8b589d[_0x90f3('0x36')]=_0x8b589d[_0x90f3('0x36')]['length']?_0x8b589d[_0x90f3('0x36')]:_0x17a235[_0x90f3('0x2f')];if(!_0x5c2579[_0x90f3('0x31')]['hasOwnProperty'](_0x90f3('0x37'))){_0x8b589d[_0x90f3('0x19')]=qs[_0x90f3('0x19')](_0x5c2579[_0x90f3('0x31')][_0x90f3('0x19')]);_0x8b589d['offset']=qs[_0x90f3('0x1b')](_0x5c2579[_0x90f3('0x31')]['offset']);}_0x8b589d['order']=qs[_0x90f3('0x38')](_0x5c2579[_0x90f3('0x31')][_0x90f3('0x38')]);_0x8b589d[_0x90f3('0x39')]=qs[_0x90f3('0x33')](_[_0x90f3('0x3a')](_0x5c2579['query'],_0x17a235['filters']),_0x346701);if(_0x5c2579[_0x90f3('0x31')][_0x90f3('0x3b')]){_0x8b589d[_0x90f3('0x39')]=_['merge'](_0x8b589d[_0x90f3('0x39')],{'$or':_['map'](_0x346701,function(_0x4af2d0){if(_0x4af2d0['type']!==_0x90f3('0x3c')){var _0x587af8={};_0x587af8[_0x4af2d0[_0x90f3('0x30')]]={'$like':'%'+_0x5c2579[_0x90f3('0x31')][_0x90f3('0x3b')]+'%'};return _0x587af8;}})});}_0x8b589d=_[_0x90f3('0x3d')]({},_0x8b589d,_0x5c2579[_0x90f3('0x3e')]);var _0x191809={'where':_0x8b589d[_0x90f3('0x39')]};return db[_0x90f3('0x2a')][_0x90f3('0x1a')](_0x191809)[_0x90f3('0x20')](function(_0xaa459e){_0x317488[_0x90f3('0x1a')]=_0xaa459e;if(_0x5c2579[_0x90f3('0x31')][_0x90f3('0x3f')]){_0x8b589d['include']=[{'all':!![]}];}return db[_0x90f3('0x2a')]['findAll'](_0x8b589d);})[_0x90f3('0x20')](function(_0x45f8c1){_0x317488['rows']=_0x45f8c1;return _0x317488;})[_0x90f3('0x20')](respondWithFilteredResult(_0x532d56,_0x8b589d))[_0x90f3('0x40')](handleError(_0x532d56,null));};exports['show']=function(_0x354527,_0x3a7eda){var _0x4cdecd={'raw':!![],'where':{'id':_0x354527[_0x90f3('0x41')]['id']}},_0x2ab3d5={};_0x2ab3d5[_0x90f3('0x2f')]=_[_0x90f3('0x32')](db[_0x90f3('0x2a')][_0x90f3('0x2b')]);_0x2ab3d5[_0x90f3('0x31')]=_[_0x90f3('0x32')](_0x354527['query']);_0x2ab3d5[_0x90f3('0x33')]=_['intersection'](_0x2ab3d5[_0x90f3('0x2f')],_0x2ab3d5[_0x90f3('0x31')]);_0x4cdecd[_0x90f3('0x36')]=_[_0x90f3('0x34')](_0x2ab3d5[_0x90f3('0x2f')],qs[_0x90f3('0x35')](_0x354527[_0x90f3('0x31')]['fields']));_0x4cdecd[_0x90f3('0x36')]=_0x4cdecd[_0x90f3('0x36')][_0x90f3('0x42')]?_0x4cdecd['attributes']:_0x2ab3d5[_0x90f3('0x2f')];if(_0x354527[_0x90f3('0x31')][_0x90f3('0x3f')]){_0x4cdecd[_0x90f3('0x43')]=[{'all':!![]}];}_0x4cdecd=_[_0x90f3('0x3d')]({},_0x4cdecd,_0x354527[_0x90f3('0x3e')]);return db[_0x90f3('0x2a')]['find'](_0x4cdecd)[_0x90f3('0x20')](handleEntityNotFound(_0x3a7eda,null))[_0x90f3('0x20')](respondWithResult(_0x3a7eda,null))[_0x90f3('0x40')](handleError(_0x3a7eda,null));};exports['create']=function(_0x53dea7,_0x143573){return db['SquareOdbc'][_0x90f3('0x44')](_0x53dea7['body'],{})[_0x90f3('0x20')](function(_0x49b4e0){var _0x3dc4dc=_0x53dea7[_0x90f3('0x45')][_0x90f3('0x22')]({'plain':!![]});if(!_0x3dc4dc)throw new Error(_0x90f3('0x46'));if(_0x3dc4dc[_0x90f3('0x47')]===_0x90f3('0x45')){var _0x232a26=_0x49b4e0[_0x90f3('0x22')]({'plain':!![]});var _0x45bb19=_0x90f3('0x48');return db['UserProfileSection'][_0x90f3('0x49')]({'where':{'name':_0x45bb19,'userProfileId':_0x3dc4dc['userProfileId']},'raw':!![]})[_0x90f3('0x20')](function(_0x71d7fd){if(_0x71d7fd&&_0x71d7fd[_0x90f3('0x4a')]===0x0){return db[_0x90f3('0x23')][_0x90f3('0x44')]({'name':_0x232a26[_0x90f3('0x30')],'resourceId':_0x232a26['id'],'type':_0x71d7fd[_0x90f3('0x30')],'sectionId':_0x71d7fd['id']},{})['then'](function(){return _0x49b4e0;});}else{return _0x49b4e0;}})[_0x90f3('0x40')](function(_0xbb38fd){logger[_0x90f3('0x25')](_0x90f3('0x4b'),_0xbb38fd);throw _0xbb38fd;});}return _0x49b4e0;})[_0x90f3('0x20')](respondWithResult(_0x143573,0xc9))[_0x90f3('0x40')](handleError(_0x143573,null));};exports[_0x90f3('0x1f')]=function(_0x2fd9d1,_0x129727){if(_0x2fd9d1[_0x90f3('0x4c')]['id']){delete _0x2fd9d1[_0x90f3('0x4c')]['id'];}return db['SquareOdbc'][_0x90f3('0x49')]({'where':{'id':_0x2fd9d1[_0x90f3('0x41')]['id']}})[_0x90f3('0x20')](handleEntityNotFound(_0x129727,null))[_0x90f3('0x20')](saveUpdates(_0x2fd9d1[_0x90f3('0x4c')],null))[_0x90f3('0x20')](respondWithResult(_0x129727,null))[_0x90f3('0x40')](handleError(_0x129727,null));};exports[_0x90f3('0x21')]=function(_0x4a4780,_0x244181){return db[_0x90f3('0x2a')][_0x90f3('0x49')]({'where':{'id':_0x4a4780[_0x90f3('0x41')]['id']}})[_0x90f3('0x20')](handleEntityNotFound(_0x244181,null))[_0x90f3('0x20')](removeEntity(_0x244181,null))[_0x90f3('0x40')](handleError(_0x244181,null));};exports[_0x90f3('0x4d')]=function(_0x156567,_0xfe6da4,_0x2b87d6){var _0x535306;return db[_0x90f3('0x2a')]['find']({'where':{'id':_0x156567[_0x90f3('0x41')]['id']},'attributes':['id',_0x90f3('0x4e')]})[_0x90f3('0x20')](handleEntityNotFound(_0xfe6da4,null))[_0x90f3('0x20')](function(_0x293d71){if(_0x293d71){var _0x425106=require(_0x90f3('0x4f'))();_0x425106['openSync'](_0x293d71[_0x90f3('0x4e')]);_0x425106['closeSync']();return _0x293d71;}})[_0x90f3('0x20')](respondWithResult(_0xfe6da4,null))[_0x90f3('0x40')](handleError(_0xfe6da4,null));}; \ No newline at end of file +var _0x8f76=['query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','ODBC','destroy','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','model'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f76,0xd3));var _0x68f7=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x8f76[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68f7('0x0'));var zipdir=require(_0x68f7('0x1'));var jsonpatch=require(_0x68f7('0x2'));var rp=require(_0x68f7('0x3'));var moment=require(_0x68f7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x68f7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x68f7('0x6'));var ejs=require(_0x68f7('0x7'));var fs=require('fs');var fs_extra=require(_0x68f7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x68f7('0x9'));var jsforce=require(_0x68f7('0xa'));var deskjs=require(_0x68f7('0xb'));var toCsv=require(_0x68f7('0x6'));var querystring=require(_0x68f7('0xc'));var Papa=require(_0x68f7('0xd'));var Redis=require('ioredis');var authService=require(_0x68f7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x68f7('0xf'));var hardwareService=require(_0x68f7('0x10'));var logger=require('../../config/logger')(_0x68f7('0x11'));var utils=require('../../config/utils');var config=require(_0x68f7('0x12'));var licenseUtil=require(_0x68f7('0x13'));var db=require(_0x68f7('0x14'))['db'];function respondWithStatusCode(_0x2cd609,_0x10196b){_0x10196b=_0x10196b||0xcc;return function(_0x481253){if(_0x481253){return _0x2cd609[_0x68f7('0x15')](_0x10196b);}return _0x2cd609[_0x68f7('0x16')](_0x10196b)[_0x68f7('0x17')]();};}function respondWithResult(_0x50b818,_0xc8a446){_0xc8a446=_0xc8a446||0xc8;return function(_0x4ce6bd){if(_0x4ce6bd){return _0x50b818[_0x68f7('0x16')](_0xc8a446)[_0x68f7('0x18')](_0x4ce6bd);}};}function respondWithFilteredResult(_0x1835ab,_0x3ce92c){return function(_0x15f37f){if(_0x15f37f){var _0x3e41c8=typeof _0x3ce92c[_0x68f7('0x19')]==='undefined'&&typeof _0x3ce92c[_0x68f7('0x1a')]===_0x68f7('0x1b');var _0x371399=_0x15f37f[_0x68f7('0x1c')];var _0x32e88f=_0x3e41c8?0x0:_0x3ce92c[_0x68f7('0x19')];var _0x1199d9=_0x3e41c8?_0x15f37f[_0x68f7('0x1c')]:_0x3ce92c[_0x68f7('0x19')]+_0x3ce92c['limit'];var _0x38219a;if(_0x1199d9>=_0x371399){_0x1199d9=_0x371399;_0x38219a=0xc8;}else{_0x38219a=0xce;}_0x1835ab[_0x68f7('0x16')](_0x38219a);return _0x1835ab[_0x68f7('0x1d')](_0x68f7('0x1e'),_0x32e88f+'-'+_0x1199d9+'/'+_0x371399)['json'](_0x15f37f);}return null;};}function patchUpdates(_0x21108f){return function(_0x3945d9){try{jsonpatch[_0x68f7('0x1f')](_0x3945d9,_0x21108f,!![]);}catch(_0x203010){return BPromise['reject'](_0x203010);}return _0x3945d9['save']();};}function saveUpdates(_0x5a15ad,_0x8fd1c2){return function(_0xf53c73){if(_0xf53c73){return _0xf53c73[_0x68f7('0x20')](_0x5a15ad)['then'](function(_0x4c7761){return _0x4c7761;});}return null;};}function removeEntity(_0x4dd83c,_0x16cde4){return function(_0x31c369){if(_0x31c369){return _0x31c369['destroy']()[_0x68f7('0x21')](function(){var _0x402896=_0x31c369['get']({'plain':!![]});var _0x216829=_0x68f7('0x22');return db['UserProfileResource'][_0x68f7('0x23')]({'where':{'type':_0x216829,'resourceId':_0x402896['id']}})[_0x68f7('0x21')](function(){return _0x31c369;});})[_0x68f7('0x21')](function(){_0x4dd83c['status'](0xcc)[_0x68f7('0x17')]();});}};}function handleEntityNotFound(_0x1ead2e,_0x31a6c2){return function(_0x2f1529){if(!_0x2f1529){_0x1ead2e['sendStatus'](0x194);}return _0x2f1529;};}function handleError(_0x4e6f2b,_0xe7aefb){_0xe7aefb=_0xe7aefb||0x1f4;return function(_0x286fce){logger[_0x68f7('0x24')](_0x286fce[_0x68f7('0x25')]);if(_0x286fce[_0x68f7('0x26')]){delete _0x286fce[_0x68f7('0x26')];}_0x4e6f2b[_0x68f7('0x16')](_0xe7aefb)[_0x68f7('0x27')](_0x286fce);};}exports[_0x68f7('0x28')]=function(_0x13289c,_0xab7fc2){var _0x466810={},_0x50337d={},_0x57b14c={'count':0x0,'rows':[]};var _0x18e38e=_['map'](db[_0x68f7('0x29')][_0x68f7('0x2a')],function(_0x2ae4b7){return{'name':_0x2ae4b7[_0x68f7('0x2b')],'type':_0x2ae4b7[_0x68f7('0x2c')][_0x68f7('0x2d')]};});_0x50337d[_0x68f7('0x2e')]=_['map'](_0x18e38e,_0x68f7('0x26'));_0x50337d[_0x68f7('0x2f')]=_[_0x68f7('0x30')](_0x13289c[_0x68f7('0x2f')]);_0x50337d['filters']=_[_0x68f7('0x31')](_0x50337d['model'],_0x50337d[_0x68f7('0x2f')]);_0x466810['attributes']=_[_0x68f7('0x31')](_0x50337d[_0x68f7('0x2e')],qs[_0x68f7('0x32')](_0x13289c['query'][_0x68f7('0x32')]));_0x466810[_0x68f7('0x33')]=_0x466810[_0x68f7('0x33')][_0x68f7('0x34')]?_0x466810['attributes']:_0x50337d[_0x68f7('0x2e')];if(!_0x13289c['query'][_0x68f7('0x35')]('nolimit')){_0x466810[_0x68f7('0x1a')]=qs[_0x68f7('0x1a')](_0x13289c[_0x68f7('0x2f')][_0x68f7('0x1a')]);_0x466810[_0x68f7('0x19')]=qs[_0x68f7('0x19')](_0x13289c['query'][_0x68f7('0x19')]);}_0x466810[_0x68f7('0x36')]=qs[_0x68f7('0x37')](_0x13289c[_0x68f7('0x2f')][_0x68f7('0x37')]);_0x466810[_0x68f7('0x38')]=qs[_0x68f7('0x39')](_[_0x68f7('0x3a')](_0x13289c[_0x68f7('0x2f')],_0x50337d[_0x68f7('0x39')]),_0x18e38e);if(_0x13289c['query'][_0x68f7('0x3b')]){_0x466810[_0x68f7('0x38')]=_[_0x68f7('0x3c')](_0x466810[_0x68f7('0x38')],{'$or':_[_0x68f7('0x3d')](_0x18e38e,function(_0x3d6a50){if(_0x3d6a50[_0x68f7('0x2c')]!==_0x68f7('0x3e')){var _0x51317d={};_0x51317d[_0x3d6a50[_0x68f7('0x26')]]={'$like':'%'+_0x13289c[_0x68f7('0x2f')][_0x68f7('0x3b')]+'%'};return _0x51317d;}})});}_0x466810=_[_0x68f7('0x3c')]({},_0x466810,_0x13289c[_0x68f7('0x3f')]);var _0x2d4c37={'where':_0x466810[_0x68f7('0x38')]};return db[_0x68f7('0x29')][_0x68f7('0x1c')](_0x2d4c37)['then'](function(_0x53c8f8){_0x57b14c['count']=_0x53c8f8;if(_0x13289c['query']['includeAll']){_0x466810['include']=[{'all':!![]}];}return db[_0x68f7('0x29')][_0x68f7('0x40')](_0x466810);})[_0x68f7('0x21')](function(_0x21a428){_0x57b14c[_0x68f7('0x41')]=_0x21a428;return _0x57b14c;})[_0x68f7('0x21')](respondWithFilteredResult(_0xab7fc2,_0x466810))[_0x68f7('0x42')](handleError(_0xab7fc2,null));};exports[_0x68f7('0x43')]=function(_0x455cf1,_0xa09339){var _0x3d5ede={'raw':!![],'where':{'id':_0x455cf1['params']['id']}},_0x489f17={};_0x489f17['model']=_[_0x68f7('0x30')](db[_0x68f7('0x29')][_0x68f7('0x2a')]);_0x489f17[_0x68f7('0x2f')]=_[_0x68f7('0x30')](_0x455cf1['query']);_0x489f17[_0x68f7('0x39')]=_[_0x68f7('0x31')](_0x489f17[_0x68f7('0x2e')],_0x489f17[_0x68f7('0x2f')]);_0x3d5ede[_0x68f7('0x33')]=_[_0x68f7('0x31')](_0x489f17['model'],qs[_0x68f7('0x32')](_0x455cf1[_0x68f7('0x2f')]['fields']));_0x3d5ede[_0x68f7('0x33')]=_0x3d5ede['attributes'][_0x68f7('0x34')]?_0x3d5ede[_0x68f7('0x33')]:_0x489f17[_0x68f7('0x2e')];if(_0x455cf1['query'][_0x68f7('0x44')]){_0x3d5ede[_0x68f7('0x45')]=[{'all':!![]}];}_0x3d5ede=_['merge']({},_0x3d5ede,_0x455cf1[_0x68f7('0x3f')]);return db[_0x68f7('0x29')][_0x68f7('0x46')](_0x3d5ede)[_0x68f7('0x21')](handleEntityNotFound(_0xa09339,null))['then'](respondWithResult(_0xa09339,null))[_0x68f7('0x42')](handleError(_0xa09339,null));};exports['create']=function(_0x1da51b,_0x599bbe){return db[_0x68f7('0x29')]['create'](_0x1da51b[_0x68f7('0x47')],{})[_0x68f7('0x21')](function(_0x205aed){var _0x2b21cd=_0x1da51b[_0x68f7('0x48')]['get']({'plain':!![]});if(!_0x2b21cd)throw new Error(_0x68f7('0x49'));if(_0x2b21cd['role']==='user'){var _0x1fca9f=_0x205aed[_0x68f7('0x4a')]({'plain':!![]});var _0x336354=_0x68f7('0x22');return db[_0x68f7('0x4b')][_0x68f7('0x46')]({'where':{'name':_0x336354,'userProfileId':_0x2b21cd[_0x68f7('0x4c')]},'raw':!![]})[_0x68f7('0x21')](function(_0x1f8cc2){if(_0x1f8cc2&&_0x1f8cc2[_0x68f7('0x4d')]===0x0){return db[_0x68f7('0x4e')][_0x68f7('0x4f')]({'name':_0x1fca9f[_0x68f7('0x26')],'resourceId':_0x1fca9f['id'],'type':_0x1f8cc2[_0x68f7('0x26')],'sectionId':_0x1f8cc2['id']},{})[_0x68f7('0x21')](function(){return _0x205aed;});}else{return _0x205aed;}})[_0x68f7('0x42')](function(_0x341c3e){logger[_0x68f7('0x24')](_0x68f7('0x50'),_0x341c3e);throw _0x341c3e;});}return _0x205aed;})[_0x68f7('0x21')](respondWithResult(_0x599bbe,0xc9))['catch'](handleError(_0x599bbe,null));};exports[_0x68f7('0x20')]=function(_0x312422,_0x3f8792){if(_0x312422['body']['id']){delete _0x312422[_0x68f7('0x47')]['id'];}return db[_0x68f7('0x29')][_0x68f7('0x46')]({'where':{'id':_0x312422['params']['id']}})['then'](handleEntityNotFound(_0x3f8792,null))[_0x68f7('0x21')](saveUpdates(_0x312422['body'],null))[_0x68f7('0x21')](respondWithResult(_0x3f8792,null))['catch'](handleError(_0x3f8792,null));};exports[_0x68f7('0x23')]=function(_0xe0d81c,_0x2dfe15){return db[_0x68f7('0x29')][_0x68f7('0x46')]({'where':{'id':_0xe0d81c[_0x68f7('0x51')]['id']}})['then'](handleEntityNotFound(_0x2dfe15,null))['then'](removeEntity(_0x2dfe15,null))[_0x68f7('0x42')](handleError(_0x2dfe15,null));};exports[_0x68f7('0x52')]=function(_0x648ffd,_0x2780be,_0x417766){var _0x158098;return db[_0x68f7('0x29')][_0x68f7('0x46')]({'where':{'id':_0x648ffd[_0x68f7('0x51')]['id']},'attributes':['id',_0x68f7('0x53')]})[_0x68f7('0x21')](handleEntityNotFound(_0x2780be,null))[_0x68f7('0x21')](function(_0x53b04d){if(_0x53b04d){var _0x507b47=require(_0x68f7('0x54'))();_0x507b47[_0x68f7('0x55')](_0x53b04d['dsn']);_0x507b47['closeSync']();return _0x53b04d;}})[_0x68f7('0x21')](respondWithResult(_0x2780be,null))[_0x68f7('0x42')](handleError(_0x2780be,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index cb53884..4b440cd 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 _0xada4=['path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x21d88d,_0x4ff19c){var _0x30a579=function(_0x24cf7a){while(--_0x24cf7a){_0x21d88d['push'](_0x21d88d['shift']());}};_0x30a579(++_0x4ff19c);}(_0xada4,0x96));var _0x4ada=function(_0x19d104,_0x2667e5){_0x19d104=_0x19d104-0x0;var _0x454533=_0xada4[_0x19d104];return _0x454533;};'use strict';var _=require(_0x4ada('0x0'));var util=require(_0x4ada('0x1'));var logger=require(_0x4ada('0x2'))('api');var moment=require(_0x4ada('0x3'));var BPromise=require(_0x4ada('0x4'));var rp=require(_0x4ada('0x5'));var fs=require('fs');var path=require(_0x4ada('0x6'));var rimraf=require(_0x4ada('0x7'));var config=require(_0x4ada('0x8'));var attributes=require(_0x4ada('0x9'));module[_0x4ada('0xa')]=function(_0x295759,_0x134495){return _0x295759[_0x4ada('0xb')](_0x4ada('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x761b=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x458959,_0x4cdf7a){var _0xde7ff6=function(_0x4dbf8f){while(--_0x4dbf8f){_0x458959['push'](_0x458959['shift']());}};_0xde7ff6(++_0x4cdf7a);}(_0x761b,0x13f));var _0xb761=function(_0x123035,_0x122952){_0x123035=_0x123035-0x0;var _0x516c5f=_0x761b[_0x123035];return _0x516c5f;};'use strict';var _=require(_0xb761('0x0'));var util=require(_0xb761('0x1'));var logger=require(_0xb761('0x2'))(_0xb761('0x3'));var moment=require(_0xb761('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb761('0x5'));var config=require(_0xb761('0x6'));var attributes=require('./squareOdbc.attributes');module[_0xb761('0x7')]=function(_0x4eeaed,_0x231708){return _0x4eeaed[_0xb761('0x8')](_0xb761('0x9'),attributes,{'tableName':_0xb761('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 187153a..229f52d 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 _0xa77d=['../../mysqldb','../../config/logger','jayson/promise','http','request','request\x20sent','debug','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','bluebird'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xa77d,0x13c));var _0xda77=function(_0x1fe937,_0x5a5a63){_0x1fe937=_0x1fe937-0x0;var _0x2a6f0d=_0xa77d[_0x1fe937];return _0x2a6f0d;};'use strict';var _=require(_0xda77('0x0'));var util=require(_0xda77('0x1'));var moment=require('moment');var BPromise=require(_0xda77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda77('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xda77('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda77('0x5'));var client=jayson['client'][_0xda77('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x49d2cd,_0x59f4a3,_0x15c779){return new BPromise(function(_0x2668bb,_0x2966d2){return client[_0xda77('0x7')](_0x49d2cd,_0x15c779)['then'](function(_0x5c692b){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x59f4a3,_0xda77('0x8'));logger[_0xda77('0x9')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x59f4a3,'request\x20sent',JSON['stringify'](_0x5c692b));if(_0x5c692b[_0xda77('0xa')]){if(_0x5c692b[_0xda77('0xa')][_0xda77('0xb')]===0x1f4){logger[_0xda77('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x59f4a3,_0x5c692b['error'][_0xda77('0xc')]);return _0x2966d2(_0x5c692b[_0xda77('0xa')][_0xda77('0xc')]);}logger[_0xda77('0xa')](_0xda77('0xd'),_0x59f4a3,_0x5c692b['error'][_0xda77('0xc')]);return _0x2668bb(_0x5c692b[_0xda77('0xa')][_0xda77('0xc')]);}else{logger[_0xda77('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x59f4a3,_0xda77('0x8'));_0x2668bb(_0x5c692b[_0xda77('0xf')][_0xda77('0xc')]);}})[_0xda77('0x10')](function(_0x401315){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x59f4a3,_0x401315);_0x2966d2(_0x401315);});});}exports[_0xda77('0x11')]=function(_0x502f5c){var _0x3c4405=this;return new Promise(function(_0x3d0816,_0x5aead1){return db[_0xda77('0x12')][_0xda77('0x13')]({'raw':_0x502f5c[_0xda77('0x14')]?_0x502f5c[_0xda77('0x14')][_0xda77('0x15')]===undefined?!![]:![]:!![],'where':_0x502f5c['options']?_0x502f5c[_0xda77('0x14')][_0xda77('0x16')]||null:null,'attributes':_0x502f5c['options']?_0x502f5c['options'][_0xda77('0x17')]||null:null,'include':_0x502f5c['options']?_0x502f5c[_0xda77('0x14')][_0xda77('0x18')]?_[_0xda77('0x19')](_0x502f5c[_0xda77('0x14')][_0xda77('0x18')],function(_0xc71d5){return{'model':db[_0xc71d5[_0xda77('0x1a')]],'as':_0xc71d5['as'],'attributes':_0xc71d5['attributes'],'include':_0xc71d5[_0xda77('0x18')]?_['map'](_0xc71d5['include'],function(_0xb7087a){return{'model':db[_0xb7087a[_0xda77('0x1a')]],'as':_0xb7087a['as'],'attributes':_0xb7087a['attributes'],'include':_0xb7087a[_0xda77('0x18')]?_[_0xda77('0x19')](_0xb7087a[_0xda77('0x18')],function(_0x3eecab){return{'model':db[_0x3eecab[_0xda77('0x1a')]],'as':_0x3eecab['as'],'attributes':_0x3eecab[_0xda77('0x17')]};}):[]};}):[]};}):[]:[]})[_0xda77('0x1b')](function(_0x14b655){logger['info'](_0xda77('0x11'),_0x502f5c);logger[_0xda77('0x9')](_0xda77('0x11'),_0x502f5c,JSON[_0xda77('0x1c')](_0x14b655));_0x3d0816(_0x14b655);})['catch'](function(_0x5bc8f1){logger[_0xda77('0xa')](_0xda77('0x11'),_0x5bc8f1[_0xda77('0xc')],_0x502f5c);_0x5aead1(_0x3c4405[_0xda77('0xa')](0x1f4,_0x5bc8f1[_0xda77('0xc')]));});});}; \ No newline at end of file +var _0x7930=['../../config/logger','rpc','client','http','then','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SquareOdbc,\x20%s,\x20%s','message','info','ShowSquareOdbc','SquareOdbc','options','raw','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x27acda,_0x4c11a6){var _0x47f760=function(_0xc481bc){while(--_0xc481bc){_0x27acda['push'](_0x27acda['shift']());}};_0x47f760(++_0x4c11a6);}(_0x7930,0xb2));var _0x0793=function(_0x3950aa,_0x3b2aad){_0x3950aa=_0x3950aa-0x0;var _0x4ef637=_0x7930[_0x3950aa];return _0x4ef637;};'use strict';var _=require(_0x0793('0x0'));var util=require(_0x0793('0x1'));var moment=require(_0x0793('0x2'));var BPromise=require(_0x0793('0x3'));var rs=require(_0x0793('0x4'));var fs=require('fs');var Redis=require(_0x0793('0x5'));var db=require(_0x0793('0x6'))['db'];var utils=require(_0x0793('0x7'));var logger=require(_0x0793('0x8'))(_0x0793('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0793('0xa')][_0x0793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e2223,_0x323bc5,_0x5275f0){return new BPromise(function(_0x2800a9,_0xf36a68){return client['request'](_0x1e2223,_0x5275f0)[_0x0793('0xc')](function(_0x1e0fc0){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x323bc5,'request\x20sent');logger[_0x0793('0xd')](_0x0793('0xe'),_0x323bc5,_0x0793('0xf'),JSON[_0x0793('0x10')](_0x1e0fc0));if(_0x1e0fc0['error']){if(_0x1e0fc0['error'][_0x0793('0x11')]===0x1f4){logger[_0x0793('0x12')](_0x0793('0x13'),_0x323bc5,_0x1e0fc0[_0x0793('0x12')]['message']);return _0xf36a68(_0x1e0fc0[_0x0793('0x12')][_0x0793('0x14')]);}logger[_0x0793('0x12')](_0x0793('0x13'),_0x323bc5,_0x1e0fc0[_0x0793('0x12')][_0x0793('0x14')]);return _0x2800a9(_0x1e0fc0['error'][_0x0793('0x14')]);}else{logger[_0x0793('0x15')](_0x0793('0x13'),_0x323bc5,'request\x20sent');_0x2800a9(_0x1e0fc0['result'][_0x0793('0x14')]);}})['catch'](function(_0x58f23){logger[_0x0793('0x12')](_0x0793('0x13'),_0x323bc5,_0x58f23);_0xf36a68(_0x58f23);});});}exports[_0x0793('0x16')]=function(_0x34f4ff){var _0x3f3923=this;return new Promise(function(_0x3bc24c,_0x2cbcf3){return db[_0x0793('0x17')]['find']({'raw':_0x34f4ff[_0x0793('0x18')]?_0x34f4ff[_0x0793('0x18')][_0x0793('0x19')]===undefined?!![]:![]:!![],'where':_0x34f4ff[_0x0793('0x18')]?_0x34f4ff['options']['where']||null:null,'attributes':_0x34f4ff['options']?_0x34f4ff['options'][_0x0793('0x1a')]||null:null,'include':_0x34f4ff['options']?_0x34f4ff[_0x0793('0x18')][_0x0793('0x1b')]?_[_0x0793('0x1c')](_0x34f4ff['options'][_0x0793('0x1b')],function(_0x4ac824){return{'model':db[_0x4ac824[_0x0793('0x1d')]],'as':_0x4ac824['as'],'attributes':_0x4ac824[_0x0793('0x1a')],'include':_0x4ac824[_0x0793('0x1b')]?_[_0x0793('0x1c')](_0x4ac824[_0x0793('0x1b')],function(_0x3f0561){return{'model':db[_0x3f0561['model']],'as':_0x3f0561['as'],'attributes':_0x3f0561[_0x0793('0x1a')],'include':_0x3f0561['include']?_[_0x0793('0x1c')](_0x3f0561['include'],function(_0x5f2c96){return{'model':db[_0x5f2c96[_0x0793('0x1d')]],'as':_0x5f2c96['as'],'attributes':_0x5f2c96['attributes']};}):[]};}):[]};}):[]:[]})[_0x0793('0xc')](function(_0x3ec1f1){logger[_0x0793('0x15')](_0x0793('0x16'),_0x34f4ff);logger['debug'](_0x0793('0x16'),_0x34f4ff,JSON[_0x0793('0x10')](_0x3ec1f1));_0x3bc24c(_0x3ec1f1);})[_0x0793('0x1e')](function(_0x190331){logger['error']('ShowSquareOdbc',_0x190331[_0x0793('0x14')],_0x34f4ff);_0x2cbcf3(_0x3f3923['error'](0x1f4,_0x190331[_0x0793('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a1a26c8..057806e 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 _0x49a1=['delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x49a1,0x190));var _0x149a=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x49a1[_0x592416];return _0x3005fa;};'use strict';var multer=require(_0x149a('0x0'));var util=require(_0x149a('0x1'));var path=require(_0x149a('0x2'));var timeout=require(_0x149a('0x3'));var express=require(_0x149a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x149a('0x5'));var config=require(_0x149a('0x6'));var controller=require('./squareProject.controller');router[_0x149a('0x7')]('/',auth[_0x149a('0x8')](),controller['index']);router[_0x149a('0x7')]('/:id',auth[_0x149a('0x8')](),controller[_0x149a('0x9')]);router['get'](_0x149a('0xa'),auth[_0x149a('0x8')](),controller[_0x149a('0xb')]);router[_0x149a('0xc')]('/',auth[_0x149a('0x8')](),controller[_0x149a('0xd')]);router['post']('/:id/users',auth[_0x149a('0x8')](),controller[_0x149a('0xe')]);router[_0x149a('0xf')](_0x149a('0x10'),auth[_0x149a('0x8')](),controller[_0x149a('0x11')]);router[_0x149a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x149a('0x13')]);router['delete'](_0x149a('0xa'),auth[_0x149a('0x8')](),controller[_0x149a('0x14')]);module[_0x149a('0x15')]=router; \ No newline at end of file +var _0x5713=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/users','getUsers','post','update','delete','destroy','removeUsers','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5713,0x1c7));var _0x3571=function(_0x2329da,_0x8fec33){_0x2329da=_0x2329da-0x0;var _0x33babc=_0x5713[_0x2329da];return _0x33babc;};'use strict';var multer=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var path=require('path');var timeout=require(_0x3571('0x2'));var express=require('express');var router=express[_0x3571('0x3')]();var fs_extra=require(_0x3571('0x4'));var auth=require(_0x3571('0x5'));var interaction=require(_0x3571('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x3571('0x7')]('/',auth[_0x3571('0x8')](),controller[_0x3571('0x9')]);router[_0x3571('0x7')](_0x3571('0xa'),auth[_0x3571('0x8')](),controller['show']);router[_0x3571('0x7')](_0x3571('0xb'),auth[_0x3571('0x8')](),controller[_0x3571('0xc')]);router[_0x3571('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3571('0xd')](_0x3571('0xb'),auth[_0x3571('0x8')](),controller['addUsers']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3571('0xe')]);router[_0x3571('0xf')](_0x3571('0xa'),auth[_0x3571('0x8')](),controller[_0x3571('0x10')]);router[_0x3571('0xf')](_0x3571('0xb'),auth[_0x3571('0x8')](),controller[_0x3571('0x11')]);module[_0x3571('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index c8ca8b6..09a0faf 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 _0xf0c3=['utf8','production','DATE','sequelize','STRING','name','BLOB','long','getDataValue','preproduction','toString'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xf0c3,0x142));var _0x3f0c=function(_0x32ea66,_0x20ada8){_0x32ea66=_0x32ea66-0x0;var _0x30cb45=_0xf0c3[_0x32ea66];return _0x30cb45;};'use strict';var Sequelize=require(_0x3f0c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f0c('0x1')],'unique':_0x3f0c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3f0c('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3f0c('0x3')](_0x3f0c('0x4')),'get':function(){if(this[_0x3f0c('0x5')](_0x3f0c('0x6'))){return this[_0x3f0c('0x5')]('preproduction')[_0x3f0c('0x7')](_0x3f0c('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x3f0c('0x4')),'get':function(){if(this['getDataValue'](_0x3f0c('0x9'))){return this[_0x3f0c('0x5')](_0x3f0c('0x9'))['toString'](_0x3f0c('0x8'));}}},'savedAt':{'type':Sequelize[_0x3f0c('0xa')]},'publishedAt':{'type':Sequelize[_0x3f0c('0xa')]}}; \ No newline at end of file +var _0x3144=['BLOB','production','utf8','DATE','sequelize','STRING','name','long','getDataValue','preproduction','toString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3144,0x1dd));var _0x4314=function(_0x2b2230,_0xe48d8e){_0x2b2230=_0x2b2230-0x0;var _0x20cd54=_0x3144[_0x2b2230];return _0x20cd54;};'use strict';var Sequelize=require(_0x4314('0x0'));module['exports']={'name':{'type':Sequelize[_0x4314('0x1')],'unique':_0x4314('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4314('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x4314('0x3')),'get':function(){if(this[_0x4314('0x4')](_0x4314('0x5'))){return this['getDataValue'](_0x4314('0x5'))[_0x4314('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x4314('0x7')]('long'),'get':function(){if(this[_0x4314('0x4')](_0x4314('0x8'))){return this['getDataValue'](_0x4314('0x8'))[_0x4314('0x6')](_0x4314('0x9'));}}},'savedAt':{'type':Sequelize[_0x4314('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cc73403..1af1051 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 _0x302f=['localhost','socket.io-emitter','register','status','json','offset','undefined','count','Content-Range','reject','save','then','destroy','get','SquareProjects','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SquareProject','fieldName','type','model','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','query','order','sort','pick','filter','merge','where','options','includeAll','include','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','rawAttributes','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0x302f,0xf3));var _0xf302=function(_0x505f37,_0x318725){_0x505f37=_0x505f37-0x0;var _0x30092a=_0x302f[_0x505f37];return _0x30092a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf302('0x0'));var rp=require(_0xf302('0x1'));var moment=require(_0xf302('0x2'));var BPromise=require(_0xf302('0x3'));var Mustache=require(_0xf302('0x4'));var util=require(_0xf302('0x5'));var path=require(_0xf302('0x6'));var sox=require(_0xf302('0x7'));var csv=require(_0xf302('0x8'));var ejs=require(_0xf302('0x9'));var fs=require('fs');var fs_extra=require(_0xf302('0xa'));var _=require('lodash');var squel=require(_0xf302('0xb'));var crypto=require(_0xf302('0xc'));var jsforce=require(_0xf302('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf302('0xe'));var authService=require(_0xf302('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf302('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf302('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf302('0x12'));var db=require('../../mysqldb')['db'];config[_0xf302('0x13')]=_[_0xf302('0x14')](config[_0xf302('0x13')],{'host':_0xf302('0x15'),'port':0x18eb});var socket=require(_0xf302('0x16'))(new Redis(config[_0xf302('0x13')]));require('./squareProject.socket')[_0xf302('0x17')](socket);function respondWithStatusCode(_0x41e435,_0x5066fd){_0x5066fd=_0x5066fd||0xcc;return function(_0x307cb2){if(_0x307cb2){return _0x41e435['sendStatus'](_0x5066fd);}return _0x41e435['status'](_0x5066fd)['end']();};}function respondWithResult(_0xb095e1,_0x1e2204){_0x1e2204=_0x1e2204||0xc8;return function(_0x530726){if(_0x530726){return _0xb095e1[_0xf302('0x18')](_0x1e2204)[_0xf302('0x19')](_0x530726);}};}function respondWithFilteredResult(_0x4f9370,_0x15bc88){return function(_0x1d7b41){if(_0x1d7b41){var _0x333719=typeof _0x15bc88[_0xf302('0x1a')]===_0xf302('0x1b')&&typeof _0x15bc88['limit']==='undefined';var _0x20d9e8=_0x1d7b41[_0xf302('0x1c')];var _0x56e0be=_0x333719?0x0:_0x15bc88[_0xf302('0x1a')];var _0x3c473b=_0x333719?_0x1d7b41['count']:_0x15bc88[_0xf302('0x1a')]+_0x15bc88['limit'];var _0x47679c;if(_0x3c473b>=_0x20d9e8){_0x3c473b=_0x20d9e8;_0x47679c=0xc8;}else{_0x47679c=0xce;}_0x4f9370['status'](_0x47679c);return _0x4f9370['set'](_0xf302('0x1d'),_0x56e0be+'-'+_0x3c473b+'/'+_0x20d9e8)['json'](_0x1d7b41);}return null;};}function patchUpdates(_0x4200b9){return function(_0x2c8e10){try{jsonpatch['apply'](_0x2c8e10,_0x4200b9,!![]);}catch(_0x58fc40){return BPromise[_0xf302('0x1e')](_0x58fc40);}return _0x2c8e10[_0xf302('0x1f')]();};}function saveUpdates(_0x2496a9,_0x309696){return function(_0x156bb9){if(_0x156bb9){return _0x156bb9['update'](_0x2496a9)[_0xf302('0x20')](function(_0x3784e2){return _0x3784e2;});}return null;};}function removeEntity(_0x20a1d4,_0x13363f){return function(_0x409f3c){if(_0x409f3c){return _0x409f3c[_0xf302('0x21')]()[_0xf302('0x20')](function(){var _0x458094=_0x409f3c[_0xf302('0x22')]({'plain':!![]});var _0x5bab06=_0xf302('0x23');return db[_0xf302('0x24')][_0xf302('0x21')]({'where':{'type':_0x5bab06,'resourceId':_0x458094['id']}})[_0xf302('0x20')](function(){return _0x409f3c;});})[_0xf302('0x20')](function(){_0x20a1d4[_0xf302('0x18')](0xcc)[_0xf302('0x25')]();});}};}function handleEntityNotFound(_0xe72054,_0x460e8d){return function(_0x50eb42){if(!_0x50eb42){_0xe72054[_0xf302('0x26')](0x194);}return _0x50eb42;};}function handleError(_0x11659f,_0x10420d){_0x10420d=_0x10420d||0x1f4;return function(_0x14cf28){logger[_0xf302('0x27')](_0x14cf28[_0xf302('0x28')]);if(_0x14cf28['name']){delete _0x14cf28[_0xf302('0x29')];}_0x11659f[_0xf302('0x18')](_0x10420d)[_0xf302('0x2a')](_0x14cf28);};}exports[_0xf302('0x2b')]=function(_0x1daab5,_0x22d728){var _0x41a95f={},_0x191bc1={},_0x1161bc={'count':0x0,'rows':[]};var _0x513f1f=_[_0xf302('0x2c')](db[_0xf302('0x2d')]['rawAttributes'],function(_0x746693){return{'name':_0x746693[_0xf302('0x2e')],'type':_0x746693[_0xf302('0x2f')]['key']};});_0x191bc1[_0xf302('0x30')]=_[_0xf302('0x2c')](_0x513f1f,_0xf302('0x29'));_0x191bc1['query']=_[_0xf302('0x31')](_0x1daab5['query']);_0x191bc1[_0xf302('0x32')]=_[_0xf302('0x33')](_0x191bc1['model'],_0x191bc1['query']);_0x41a95f[_0xf302('0x34')]=_['intersection'](_0x191bc1[_0xf302('0x30')],qs[_0xf302('0x35')](_0x1daab5['query'][_0xf302('0x35')]));_0x41a95f['attributes']=_0x41a95f['attributes'][_0xf302('0x36')]?_0x41a95f[_0xf302('0x34')]:_0x191bc1['model'];if(!_0x1daab5['query'][_0xf302('0x37')](_0xf302('0x38'))){_0x41a95f[_0xf302('0x39')]=qs[_0xf302('0x39')](_0x1daab5[_0xf302('0x3a')]['limit']);_0x41a95f[_0xf302('0x1a')]=qs['offset'](_0x1daab5[_0xf302('0x3a')][_0xf302('0x1a')]);}_0x41a95f[_0xf302('0x3b')]=qs[_0xf302('0x3c')](_0x1daab5[_0xf302('0x3a')][_0xf302('0x3c')]);_0x41a95f['where']=qs[_0xf302('0x32')](_[_0xf302('0x3d')](_0x1daab5['query'],_0x191bc1[_0xf302('0x32')]),_0x513f1f);if(_0x1daab5[_0xf302('0x3a')][_0xf302('0x3e')]){_0x41a95f['where']=_[_0xf302('0x3f')](_0x41a95f[_0xf302('0x40')],{'$or':_['map'](_0x513f1f,function(_0x5385ac){if(_0x5385ac[_0xf302('0x2f')]!=='VIRTUAL'){var _0x1b216d={};_0x1b216d[_0x5385ac[_0xf302('0x29')]]={'$like':'%'+_0x1daab5['query'][_0xf302('0x3e')]+'%'};return _0x1b216d;}})});}_0x41a95f=_[_0xf302('0x3f')]({},_0x41a95f,_0x1daab5[_0xf302('0x41')]);var _0x5309dc={'where':_0x41a95f['where']};return db['SquareProject'][_0xf302('0x1c')](_0x5309dc)[_0xf302('0x20')](function(_0x57f8c5){_0x1161bc[_0xf302('0x1c')]=_0x57f8c5;if(_0x1daab5[_0xf302('0x3a')][_0xf302('0x42')]){_0x41a95f[_0xf302('0x43')]=[{'all':!![]}];}return db[_0xf302('0x2d')]['findAll'](_0x41a95f);})['then'](function(_0x26eef2){_0x1161bc['rows']=_0x26eef2;return _0x1161bc;})[_0xf302('0x20')](respondWithFilteredResult(_0x22d728,_0x41a95f))[_0xf302('0x44')](handleError(_0x22d728,null));};exports['show']=function(_0x230626,_0xf720c4){var _0x452e3c={'raw':![],'where':{'id':_0x230626['params']['id']}},_0x3492e1={};_0x3492e1[_0xf302('0x30')]=_[_0xf302('0x31')](db[_0xf302('0x2d')]['rawAttributes']);_0x3492e1[_0xf302('0x3a')]=_[_0xf302('0x31')](_0x230626[_0xf302('0x3a')]);_0x3492e1[_0xf302('0x32')]=_[_0xf302('0x33')](_0x3492e1[_0xf302('0x30')],_0x3492e1['query']);_0x452e3c['attributes']=_['intersection'](_0x3492e1[_0xf302('0x30')],qs[_0xf302('0x35')](_0x230626['query']['fields']));_0x452e3c[_0xf302('0x34')]=_0x452e3c['attributes']['length']?_0x452e3c['attributes']:_0x3492e1[_0xf302('0x30')];if(_0x230626[_0xf302('0x3a')][_0xf302('0x42')]){_0x452e3c[_0xf302('0x43')]=[{'all':!![]}];}_0x452e3c=_['merge']({},_0x452e3c,_0x230626[_0xf302('0x41')]);return db['SquareProject'][_0xf302('0x45')](_0x452e3c)['then'](handleEntityNotFound(_0xf720c4,null))[_0xf302('0x20')](respondWithResult(_0xf720c4,null))[_0xf302('0x44')](handleError(_0xf720c4,null));};exports['create']=function(_0x4a4bfc,_0x58a1ed){return db[_0xf302('0x2d')][_0xf302('0x46')](_0x4a4bfc[_0xf302('0x47')],{})[_0xf302('0x20')](function(_0x3f3c38){var _0x216783=_0x4a4bfc[_0xf302('0x48')][_0xf302('0x22')]({'plain':!![]});if(!_0x216783)throw new Error(_0xf302('0x49'));if(_0x216783[_0xf302('0x4a')]===_0xf302('0x48')){var _0x4ea61f=_0x3f3c38[_0xf302('0x22')]({'plain':!![]});var _0x5075fc=_0xf302('0x23');return db[_0xf302('0x4b')]['find']({'where':{'name':_0x5075fc,'userProfileId':_0x216783[_0xf302('0x4c')]},'raw':!![]})[_0xf302('0x20')](function(_0x422b8b){if(_0x422b8b&&_0x422b8b['autoAssociation']===0x0){return db[_0xf302('0x24')][_0xf302('0x46')]({'name':_0x4ea61f[_0xf302('0x29')],'resourceId':_0x4ea61f['id'],'type':_0x422b8b[_0xf302('0x29')],'sectionId':_0x422b8b['id']},{})[_0xf302('0x20')](function(){return _0x3f3c38;});}else{return _0x3f3c38;}})[_0xf302('0x44')](function(_0x3a74cb){logger[_0xf302('0x27')](_0xf302('0x4d'),_0x3a74cb);throw _0x3a74cb;});}return _0x3f3c38;})[_0xf302('0x20')](respondWithResult(_0x58a1ed,0xc9))['catch'](handleError(_0x58a1ed,null));};exports[_0xf302('0x4e')]=function(_0x170031,_0x5a8229){if(_0x170031['body']['id']){delete _0x170031[_0xf302('0x47')]['id'];}return db[_0xf302('0x2d')][_0xf302('0x45')]({'where':{'id':_0x170031['params']['id']}})[_0xf302('0x20')](handleEntityNotFound(_0x5a8229,null))[_0xf302('0x20')](saveUpdates(_0x170031[_0xf302('0x47')],null))['then'](respondWithResult(_0x5a8229,null))[_0xf302('0x44')](handleError(_0x5a8229,null));};exports[_0xf302('0x21')]=function(_0x10db59,_0x39d01a){return db[_0xf302('0x2d')]['find']({'where':{'id':_0x10db59['params']['id']}})[_0xf302('0x20')](handleEntityNotFound(_0x39d01a,null))[_0xf302('0x20')](removeEntity(_0x39d01a,null))[_0xf302('0x44')](handleError(_0x39d01a,null));};exports['addUsers']=function(_0x2a5eb4,_0x1c82d2,_0x2df91c){return db['SquareProject'][_0xf302('0x45')]({'where':{'id':_0x2a5eb4[_0xf302('0x4f')]['id']}})[_0xf302('0x20')](handleEntityNotFound(_0x1c82d2,null))[_0xf302('0x20')](function(_0x37f8ed){if(_0x37f8ed){return _0x37f8ed['addUsers'](_0x2a5eb4[_0xf302('0x47')][_0xf302('0x50')],_['omit'](_0x2a5eb4[_0xf302('0x47')],[_0xf302('0x50'),'id'])||{});}})[_0xf302('0x20')](respondWithResult(_0x1c82d2,null))[_0xf302('0x44')](handleError(_0x1c82d2,null));};exports[_0xf302('0x51')]=function(_0x2e846e,_0x56b1f2,_0x3862c6){return db[_0xf302('0x2d')][_0xf302('0x45')]({'where':{'id':_0x2e846e[_0xf302('0x4f')]['id']}})[_0xf302('0x20')](handleEntityNotFound(_0x56b1f2,null))[_0xf302('0x20')](function(_0x2aae5f){if(_0x2aae5f){return _0x2aae5f[_0xf302('0x51')](_0x2e846e[_0xf302('0x3a')][_0xf302('0x50')])[_0xf302('0x20')](function(){if(_['isArray'](_0x2e846e[_0xf302('0x3a')][_0xf302('0x50')])){for(var _0x503cdc=0x0;_0x503cdc<_0x2e846e[_0xf302('0x3a')][_0xf302('0x50')][_0xf302('0x36')];_0x503cdc+=0x1){socket[_0xf302('0x52')](_0xf302('0x53'),{'UserId':Number(_0x2e846e[_0xf302('0x3a')][_0xf302('0x50')][_0x503cdc]),'SquareProjectId':Number(_0x2e846e['params']['id'])});}}else{socket[_0xf302('0x52')](_0xf302('0x53'),{'UserId':Number(_0x2e846e[_0xf302('0x3a')][_0xf302('0x50')]),'SquareProjectId':Number(_0x2e846e[_0xf302('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x56b1f2,null))['catch'](handleError(_0x56b1f2,null));};exports[_0xf302('0x54')]=function(_0x2376de,_0x3dcd2c,_0x30fa65){var _0x5a2f0f={};var _0x41600f={};var _0x1e9be1;var _0x396f4d;return db[_0xf302('0x2d')][_0xf302('0x55')]({'where':{'id':_0x2376de[_0xf302('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3dcd2c,null))[_0xf302('0x20')](function(_0x53f601){if(_0x53f601){_0x1e9be1=_0x53f601;_0x41600f[_0xf302('0x30')]=_[_0xf302('0x31')](db[_0xf302('0x56')][_0xf302('0x57')]);_0x41600f['query']=_[_0xf302('0x31')](_0x2376de[_0xf302('0x3a')]);_0x41600f[_0xf302('0x32')]=_['intersection'](_0x41600f[_0xf302('0x30')],_0x41600f['query']);_0x5a2f0f['attributes']=_[_0xf302('0x33')](_0x41600f[_0xf302('0x30')],qs['fields'](_0x2376de[_0xf302('0x3a')][_0xf302('0x35')]));_0x5a2f0f[_0xf302('0x34')]=_0x5a2f0f[_0xf302('0x34')][_0xf302('0x36')]?_0x5a2f0f[_0xf302('0x34')]:_0x41600f[_0xf302('0x30')];_0x5a2f0f[_0xf302('0x3b')]=qs[_0xf302('0x3c')](_0x2376de[_0xf302('0x3a')][_0xf302('0x3c')]);_0x5a2f0f[_0xf302('0x40')]=qs[_0xf302('0x32')](_['pick'](_0x2376de[_0xf302('0x3a')],_0x41600f[_0xf302('0x32')]));if(_0x2376de[_0xf302('0x3a')][_0xf302('0x3e')]){_0x5a2f0f['where']=_[_0xf302('0x3f')](_0x5a2f0f['where'],{'$or':_[_0xf302('0x2c')](_0x5a2f0f[_0xf302('0x34')],function(_0x2c96a4){var _0x36d10e={};_0x36d10e[_0x2c96a4]={'$like':'%'+_0x2376de[_0xf302('0x3a')][_0xf302('0x3e')]+'%'};return _0x36d10e;})});}_0x5a2f0f=_['merge']({},_0x5a2f0f,_0x2376de[_0xf302('0x41')]);return _0x1e9be1[_0xf302('0x54')](_0x5a2f0f);}})['then'](function(_0x4a3229){if(_0x4a3229){_0x396f4d=_0x4a3229[_0xf302('0x36')];if(!_0x2376de[_0xf302('0x3a')]['hasOwnProperty']('nolimit')){_0x5a2f0f[_0xf302('0x39')]=qs['limit'](_0x2376de[_0xf302('0x3a')][_0xf302('0x39')]);_0x5a2f0f['offset']=qs['offset'](_0x2376de[_0xf302('0x3a')][_0xf302('0x1a')]);}return _0x1e9be1[_0xf302('0x54')](_0x5a2f0f);}})['then'](function(_0x55f019){if(_0x55f019){return _0x55f019?{'count':_0x396f4d,'rows':_0x55f019}:null;}})['then'](respondWithResult(_0x3dcd2c,null))['catch'](handleError(_0x3dcd2c,null));}; \ No newline at end of file +var _0x7cd8=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','length','emit','userSquareProject:remove','getUsers','findOne','User','options','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','status','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x211b76,_0x497e2f){var _0xc9defe=function(_0x45189d){while(--_0x45189d){_0x211b76['push'](_0x211b76['shift']());}};_0xc9defe(++_0x497e2f);}(_0x7cd8,0x1c1));var _0x87cd=function(_0x91a922,_0x472fae){_0x91a922=_0x91a922-0x0;var _0x3fd7cf=_0x7cd8[_0x91a922];return _0x3fd7cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87cd('0x0'));var zipdir=require(_0x87cd('0x1'));var jsonpatch=require(_0x87cd('0x2'));var rp=require('request-promise');var moment=require(_0x87cd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x87cd('0x4'));var util=require(_0x87cd('0x5'));var path=require(_0x87cd('0x6'));var sox=require('sox');var csv=require(_0x87cd('0x7'));var ejs=require(_0x87cd('0x8'));var fs=require('fs');var fs_extra=require(_0x87cd('0x9'));var _=require(_0x87cd('0xa'));var squel=require(_0x87cd('0xb'));var crypto=require(_0x87cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x87cd('0xd'));var toCsv=require(_0x87cd('0x7'));var querystring=require(_0x87cd('0xe'));var Papa=require(_0x87cd('0xf'));var Redis=require(_0x87cd('0x10'));var authService=require(_0x87cd('0x11'));var qs=require(_0x87cd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87cd('0x13'));var logger=require(_0x87cd('0x14'))(_0x87cd('0x15'));var utils=require(_0x87cd('0x16'));var config=require(_0x87cd('0x17'));var licenseUtil=require(_0x87cd('0x18'));var db=require(_0x87cd('0x19'))['db'];config[_0x87cd('0x1a')]=_[_0x87cd('0x1b')](config[_0x87cd('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x87cd('0x1c'))(new Redis(config[_0x87cd('0x1a')]));require(_0x87cd('0x1d'))[_0x87cd('0x1e')](socket);function respondWithStatusCode(_0x29af8a,_0x5b6b48){_0x5b6b48=_0x5b6b48||0xcc;return function(_0x2c8d30){if(_0x2c8d30){return _0x29af8a['sendStatus'](_0x5b6b48);}return _0x29af8a['status'](_0x5b6b48)[_0x87cd('0x1f')]();};}function respondWithResult(_0x216891,_0x2de639){_0x2de639=_0x2de639||0xc8;return function(_0x56a1ec){if(_0x56a1ec){return _0x216891['status'](_0x2de639)[_0x87cd('0x20')](_0x56a1ec);}};}function respondWithFilteredResult(_0xb96ef6,_0x39bb14){return function(_0x559317){if(_0x559317){var _0x212e62=typeof _0x39bb14[_0x87cd('0x21')]===_0x87cd('0x22')&&typeof _0x39bb14[_0x87cd('0x23')]===_0x87cd('0x22');var _0x9a1f62=_0x559317[_0x87cd('0x24')];var _0x533e33=_0x212e62?0x0:_0x39bb14[_0x87cd('0x21')];var _0x120a78=_0x212e62?_0x559317['count']:_0x39bb14[_0x87cd('0x21')]+_0x39bb14[_0x87cd('0x23')];var _0xbb7ea6;if(_0x120a78>=_0x9a1f62){_0x120a78=_0x9a1f62;_0xbb7ea6=0xc8;}else{_0xbb7ea6=0xce;}_0xb96ef6['status'](_0xbb7ea6);return _0xb96ef6[_0x87cd('0x25')](_0x87cd('0x26'),_0x533e33+'-'+_0x120a78+'/'+_0x9a1f62)[_0x87cd('0x20')](_0x559317);}return null;};}function patchUpdates(_0x36f190){return function(_0xff7f7){try{jsonpatch[_0x87cd('0x27')](_0xff7f7,_0x36f190,!![]);}catch(_0xc69949){return BPromise[_0x87cd('0x28')](_0xc69949);}return _0xff7f7[_0x87cd('0x29')]();};}function saveUpdates(_0x43e4f1,_0x1ca89b){return function(_0x24c0c6){if(_0x24c0c6){return _0x24c0c6[_0x87cd('0x2a')](_0x43e4f1)[_0x87cd('0x2b')](function(_0x2ff4fe){return _0x2ff4fe;});}return null;};}function removeEntity(_0x34b8d7,_0x11a8cf){return function(_0x397961){if(_0x397961){return _0x397961[_0x87cd('0x2c')]()['then'](function(){var _0x270c39=_0x397961[_0x87cd('0x2d')]({'plain':!![]});var _0x3d4a3e=_0x87cd('0x2e');return db['UserProfileResource'][_0x87cd('0x2c')]({'where':{'type':_0x3d4a3e,'resourceId':_0x270c39['id']}})['then'](function(){return _0x397961;});})[_0x87cd('0x2b')](function(){_0x34b8d7[_0x87cd('0x2f')](0xcc)[_0x87cd('0x1f')]();});}};}function handleEntityNotFound(_0x2de196,_0x345fbe){return function(_0x2e3d16){if(!_0x2e3d16){_0x2de196[_0x87cd('0x30')](0x194);}return _0x2e3d16;};}function handleError(_0x359015,_0x56f5dd){_0x56f5dd=_0x56f5dd||0x1f4;return function(_0x180542){logger[_0x87cd('0x31')](_0x180542[_0x87cd('0x32')]);if(_0x180542['name']){delete _0x180542[_0x87cd('0x33')];}_0x359015['status'](_0x56f5dd)['send'](_0x180542);};}exports[_0x87cd('0x34')]=function(_0x4369c0,_0x2543a1){var _0xbdbb7f={},_0x12c03b={},_0x5daaef={'count':0x0,'rows':[]};var _0x225f79=_[_0x87cd('0x35')](db[_0x87cd('0x36')][_0x87cd('0x37')],function(_0x1efa96){return{'name':_0x1efa96[_0x87cd('0x38')],'type':_0x1efa96['type'][_0x87cd('0x39')]};});_0x12c03b[_0x87cd('0x3a')]=_[_0x87cd('0x35')](_0x225f79,_0x87cd('0x33'));_0x12c03b[_0x87cd('0x3b')]=_[_0x87cd('0x3c')](_0x4369c0[_0x87cd('0x3b')]);_0x12c03b[_0x87cd('0x3d')]=_[_0x87cd('0x3e')](_0x12c03b['model'],_0x12c03b[_0x87cd('0x3b')]);_0xbdbb7f[_0x87cd('0x3f')]=_[_0x87cd('0x3e')](_0x12c03b['model'],qs[_0x87cd('0x40')](_0x4369c0['query'][_0x87cd('0x40')]));_0xbdbb7f[_0x87cd('0x3f')]=_0xbdbb7f[_0x87cd('0x3f')]['length']?_0xbdbb7f[_0x87cd('0x3f')]:_0x12c03b[_0x87cd('0x3a')];if(!_0x4369c0[_0x87cd('0x3b')][_0x87cd('0x41')](_0x87cd('0x42'))){_0xbdbb7f[_0x87cd('0x23')]=qs['limit'](_0x4369c0[_0x87cd('0x3b')][_0x87cd('0x23')]);_0xbdbb7f[_0x87cd('0x21')]=qs[_0x87cd('0x21')](_0x4369c0[_0x87cd('0x3b')][_0x87cd('0x21')]);}_0xbdbb7f[_0x87cd('0x43')]=qs[_0x87cd('0x44')](_0x4369c0[_0x87cd('0x3b')]['sort']);_0xbdbb7f[_0x87cd('0x45')]=qs[_0x87cd('0x3d')](_[_0x87cd('0x46')](_0x4369c0[_0x87cd('0x3b')],_0x12c03b[_0x87cd('0x3d')]),_0x225f79);if(_0x4369c0[_0x87cd('0x3b')]['filter']){_0xbdbb7f[_0x87cd('0x45')]=_[_0x87cd('0x47')](_0xbdbb7f[_0x87cd('0x45')],{'$or':_[_0x87cd('0x35')](_0x225f79,function(_0x3b1cc9){if(_0x3b1cc9[_0x87cd('0x48')]!==_0x87cd('0x49')){var _0x1c5a84={};_0x1c5a84[_0x3b1cc9[_0x87cd('0x33')]]={'$like':'%'+_0x4369c0[_0x87cd('0x3b')][_0x87cd('0x4a')]+'%'};return _0x1c5a84;}})});}_0xbdbb7f=_['merge']({},_0xbdbb7f,_0x4369c0['options']);var _0x37dccf={'where':_0xbdbb7f[_0x87cd('0x45')]};return db[_0x87cd('0x36')][_0x87cd('0x24')](_0x37dccf)[_0x87cd('0x2b')](function(_0x3712b3){_0x5daaef[_0x87cd('0x24')]=_0x3712b3;if(_0x4369c0['query'][_0x87cd('0x4b')]){_0xbdbb7f[_0x87cd('0x4c')]=[{'all':!![]}];}return db[_0x87cd('0x36')]['findAll'](_0xbdbb7f);})['then'](function(_0x7078a9){_0x5daaef[_0x87cd('0x4d')]=_0x7078a9;return _0x5daaef;})[_0x87cd('0x2b')](respondWithFilteredResult(_0x2543a1,_0xbdbb7f))[_0x87cd('0x4e')](handleError(_0x2543a1,null));};exports[_0x87cd('0x4f')]=function(_0x2140c2,_0x592edb){var _0x1ea2b5={'raw':![],'where':{'id':_0x2140c2[_0x87cd('0x50')]['id']}},_0x7f2fd7={};_0x7f2fd7[_0x87cd('0x3a')]=_[_0x87cd('0x3c')](db[_0x87cd('0x36')][_0x87cd('0x37')]);_0x7f2fd7[_0x87cd('0x3b')]=_[_0x87cd('0x3c')](_0x2140c2[_0x87cd('0x3b')]);_0x7f2fd7[_0x87cd('0x3d')]=_[_0x87cd('0x3e')](_0x7f2fd7[_0x87cd('0x3a')],_0x7f2fd7['query']);_0x1ea2b5[_0x87cd('0x3f')]=_['intersection'](_0x7f2fd7[_0x87cd('0x3a')],qs[_0x87cd('0x40')](_0x2140c2[_0x87cd('0x3b')]['fields']));_0x1ea2b5[_0x87cd('0x3f')]=_0x1ea2b5['attributes']['length']?_0x1ea2b5[_0x87cd('0x3f')]:_0x7f2fd7[_0x87cd('0x3a')];if(_0x2140c2[_0x87cd('0x3b')][_0x87cd('0x4b')]){_0x1ea2b5[_0x87cd('0x4c')]=[{'all':!![]}];}_0x1ea2b5=_[_0x87cd('0x47')]({},_0x1ea2b5,_0x2140c2['options']);return db[_0x87cd('0x36')][_0x87cd('0x51')](_0x1ea2b5)[_0x87cd('0x2b')](handleEntityNotFound(_0x592edb,null))[_0x87cd('0x2b')](respondWithResult(_0x592edb,null))[_0x87cd('0x4e')](handleError(_0x592edb,null));};exports['create']=function(_0x3f7c53,_0x1ac5a6){return db[_0x87cd('0x36')][_0x87cd('0x52')](_0x3f7c53[_0x87cd('0x53')],{})[_0x87cd('0x2b')](function(_0x3cb3c5){var _0x524ca9=_0x3f7c53[_0x87cd('0x54')]['get']({'plain':!![]});if(!_0x524ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x524ca9[_0x87cd('0x55')]===_0x87cd('0x54')){var _0x40b77c=_0x3cb3c5[_0x87cd('0x2d')]({'plain':!![]});var _0x249963=_0x87cd('0x2e');return db[_0x87cd('0x56')][_0x87cd('0x51')]({'where':{'name':_0x249963,'userProfileId':_0x524ca9[_0x87cd('0x57')]},'raw':!![]})[_0x87cd('0x2b')](function(_0x129609){if(_0x129609&&_0x129609[_0x87cd('0x58')]===0x0){return db[_0x87cd('0x59')][_0x87cd('0x52')]({'name':_0x40b77c[_0x87cd('0x33')],'resourceId':_0x40b77c['id'],'type':_0x129609[_0x87cd('0x33')],'sectionId':_0x129609['id']},{})[_0x87cd('0x2b')](function(){return _0x3cb3c5;});}else{return _0x3cb3c5;}})['catch'](function(_0x41ade1){logger[_0x87cd('0x31')](_0x87cd('0x5a'),_0x41ade1);throw _0x41ade1;});}return _0x3cb3c5;})[_0x87cd('0x2b')](respondWithResult(_0x1ac5a6,0xc9))['catch'](handleError(_0x1ac5a6,null));};exports[_0x87cd('0x2a')]=function(_0x1ef276,_0x1d6bc1){if(_0x1ef276[_0x87cd('0x53')]['id']){delete _0x1ef276[_0x87cd('0x53')]['id'];}return db[_0x87cd('0x36')][_0x87cd('0x51')]({'where':{'id':_0x1ef276[_0x87cd('0x50')]['id']}})[_0x87cd('0x2b')](handleEntityNotFound(_0x1d6bc1,null))['then'](saveUpdates(_0x1ef276[_0x87cd('0x53')],null))[_0x87cd('0x2b')](respondWithResult(_0x1d6bc1,null))[_0x87cd('0x4e')](handleError(_0x1d6bc1,null));};exports[_0x87cd('0x2c')]=function(_0x3dddb2,_0x4b3e7b){return db[_0x87cd('0x36')][_0x87cd('0x51')]({'where':{'id':_0x3dddb2[_0x87cd('0x50')]['id']}})[_0x87cd('0x2b')](handleEntityNotFound(_0x4b3e7b,null))[_0x87cd('0x2b')](removeEntity(_0x4b3e7b,null))[_0x87cd('0x4e')](handleError(_0x4b3e7b,null));};exports['addUsers']=function(_0x4b306e,_0x46cb6b,_0xe745e4){return db[_0x87cd('0x36')]['find']({'where':{'id':_0x4b306e[_0x87cd('0x50')]['id']}})[_0x87cd('0x2b')](handleEntityNotFound(_0x46cb6b,null))[_0x87cd('0x2b')](function(_0x459f8d){if(_0x459f8d){return _0x459f8d[_0x87cd('0x5b')](_0x4b306e[_0x87cd('0x53')][_0x87cd('0x5c')],_[_0x87cd('0x5d')](_0x4b306e['body'],[_0x87cd('0x5c'),'id'])||{});}})[_0x87cd('0x2b')](respondWithResult(_0x46cb6b,null))['catch'](handleError(_0x46cb6b,null));};exports[_0x87cd('0x5e')]=function(_0x2e7240,_0x1495ce,_0x443aa8){return db[_0x87cd('0x36')][_0x87cd('0x51')]({'where':{'id':_0x2e7240['params']['id']}})[_0x87cd('0x2b')](handleEntityNotFound(_0x1495ce,null))[_0x87cd('0x2b')](function(_0x45dee3){if(_0x45dee3){return _0x45dee3[_0x87cd('0x5e')](_0x2e7240[_0x87cd('0x3b')][_0x87cd('0x5c')])[_0x87cd('0x2b')](function(){if(_[_0x87cd('0x5f')](_0x2e7240['query'][_0x87cd('0x5c')])){for(var _0x1f38d6=0x0;_0x1f38d6<_0x2e7240[_0x87cd('0x3b')][_0x87cd('0x5c')][_0x87cd('0x60')];_0x1f38d6+=0x1){socket[_0x87cd('0x61')]('userSquareProject:remove',{'UserId':Number(_0x2e7240[_0x87cd('0x3b')][_0x87cd('0x5c')][_0x1f38d6]),'SquareProjectId':Number(_0x2e7240[_0x87cd('0x50')]['id'])});}}else{socket[_0x87cd('0x61')](_0x87cd('0x62'),{'UserId':Number(_0x2e7240[_0x87cd('0x3b')]['ids']),'SquareProjectId':Number(_0x2e7240[_0x87cd('0x50')]['id'])});}});}})[_0x87cd('0x2b')](respondWithStatusCode(_0x1495ce,null))[_0x87cd('0x4e')](handleError(_0x1495ce,null));};exports[_0x87cd('0x63')]=function(_0x18e0fa,_0x505f06,_0x34487e){var _0x6391bf={};var _0x5e9740={};var _0x172bc1;var _0x2a8357;return db[_0x87cd('0x36')][_0x87cd('0x64')]({'where':{'id':_0x18e0fa[_0x87cd('0x50')]['id']}})[_0x87cd('0x2b')](handleEntityNotFound(_0x505f06,null))[_0x87cd('0x2b')](function(_0x33b389){if(_0x33b389){_0x172bc1=_0x33b389;_0x5e9740[_0x87cd('0x3a')]=_[_0x87cd('0x3c')](db[_0x87cd('0x65')][_0x87cd('0x37')]);_0x5e9740[_0x87cd('0x3b')]=_['keys'](_0x18e0fa[_0x87cd('0x3b')]);_0x5e9740[_0x87cd('0x3d')]=_[_0x87cd('0x3e')](_0x5e9740[_0x87cd('0x3a')],_0x5e9740[_0x87cd('0x3b')]);_0x6391bf[_0x87cd('0x3f')]=_[_0x87cd('0x3e')](_0x5e9740[_0x87cd('0x3a')],qs[_0x87cd('0x40')](_0x18e0fa[_0x87cd('0x3b')][_0x87cd('0x40')]));_0x6391bf[_0x87cd('0x3f')]=_0x6391bf[_0x87cd('0x3f')]['length']?_0x6391bf[_0x87cd('0x3f')]:_0x5e9740['model'];_0x6391bf[_0x87cd('0x43')]=qs[_0x87cd('0x44')](_0x18e0fa[_0x87cd('0x3b')][_0x87cd('0x44')]);_0x6391bf[_0x87cd('0x45')]=qs[_0x87cd('0x3d')](_[_0x87cd('0x46')](_0x18e0fa['query'],_0x5e9740[_0x87cd('0x3d')]));if(_0x18e0fa[_0x87cd('0x3b')]['filter']){_0x6391bf[_0x87cd('0x45')]=_['merge'](_0x6391bf[_0x87cd('0x45')],{'$or':_[_0x87cd('0x35')](_0x6391bf[_0x87cd('0x3f')],function(_0x2d2390){var _0x3fbfc1={};_0x3fbfc1[_0x2d2390]={'$like':'%'+_0x18e0fa[_0x87cd('0x3b')][_0x87cd('0x4a')]+'%'};return _0x3fbfc1;})});}_0x6391bf=_[_0x87cd('0x47')]({},_0x6391bf,_0x18e0fa[_0x87cd('0x66')]);return _0x172bc1['getUsers'](_0x6391bf);}})[_0x87cd('0x2b')](function(_0x547172){if(_0x547172){_0x2a8357=_0x547172['length'];if(!_0x18e0fa[_0x87cd('0x3b')][_0x87cd('0x41')](_0x87cd('0x42'))){_0x6391bf[_0x87cd('0x23')]=qs['limit'](_0x18e0fa['query'][_0x87cd('0x23')]);_0x6391bf[_0x87cd('0x21')]=qs[_0x87cd('0x21')](_0x18e0fa[_0x87cd('0x3b')][_0x87cd('0x21')]);}return _0x172bc1[_0x87cd('0x63')](_0x6391bf);}})[_0x87cd('0x2b')](function(_0x45abac){if(_0x45abac){return _0x45abac?{'count':_0x2a8357,'rows':_0x45abac}:null;}})['then'](respondWithResult(_0x505f06,null))[_0x87cd('0x4e')](handleError(_0x505f06,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 081295d..041ccf5 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 _0x8eb8=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x343111,_0x258b52){var _0x3ebe57=function(_0x4e217e){while(--_0x4e217e){_0x343111['push'](_0x343111['shift']());}};_0x3ebe57(++_0x258b52);}(_0x8eb8,0x16c));var _0x88eb=function(_0x3b5b1c,_0x38b583){_0x3b5b1c=_0x3b5b1c-0x0;var _0x4db5b2=_0x8eb8[_0x3b5b1c];return _0x4db5b2;};'use strict';var EventEmitter=require(_0x88eb('0x0'));var SquareProject=require(_0x88eb('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x88eb('0x2')](0x0);var events={'afterCreate':_0x88eb('0x3'),'afterUpdate':_0x88eb('0x4'),'afterDestroy':_0x88eb('0x5')};function emitEvent(_0x6f4e5e){return function(_0x5d4c77,_0x4c5939,_0x23b99e){SquareProjectEvents[_0x88eb('0x6')](_0x6f4e5e+':'+_0x5d4c77['id'],_0x5d4c77);SquareProjectEvents['emit'](_0x6f4e5e,_0x5d4c77);_0x23b99e(null);};}for(var e in events){if(events[_0x88eb('0x7')](e)){var event=events[e];SquareProject[_0x88eb('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xbac6=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save'];(function(_0x8ce506,_0x517f30){var _0x23c8e5=function(_0x1d048e){while(--_0x1d048e){_0x8ce506['push'](_0x8ce506['shift']());}};_0x23c8e5(++_0x517f30);}(_0xbac6,0xaf));var _0x6bac=function(_0x4897b5,_0x3d2e27){_0x4897b5=_0x4897b5-0x0;var _0x3adafe=_0xbac6[_0x4897b5];return _0x3adafe;};'use strict';var EventEmitter=require(_0x6bac('0x0'));var SquareProject=require(_0x6bac('0x1'))['db'][_0x6bac('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6bac('0x3')](0x0);var events={'afterCreate':_0x6bac('0x4'),'afterUpdate':'update','afterDestroy':_0x6bac('0x5')};function emitEvent(_0x4fe190){return function(_0x2ec210,_0x21baa8,_0x417af9){SquareProjectEvents['emit'](_0x4fe190+':'+_0x2ec210['id'],_0x2ec210);SquareProjectEvents['emit'](_0x4fe190,_0x2ec210);_0x417af9(null);};}for(var e in events){if(events[_0x6bac('0x6')](e)){var event=events[e];SquareProject[_0x6bac('0x7')](e,emitEvent(event));}}module[_0x6bac('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e2c5605..3f068cd 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 _0x1ff9=['changed','preproduction','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x32d57c,_0x4b33d9){var _0xb3fdf8=function(_0x5f162f){while(--_0x5f162f){_0x32d57c['push'](_0x32d57c['shift']());}};_0xb3fdf8(++_0x4b33d9);}(_0x1ff9,0x192));var _0x91ff=function(_0x51308d,_0x42cf02){_0x51308d=_0x51308d-0x0;var _0x37cde8=_0x1ff9[_0x51308d];return _0x37cde8;};'use strict';var _=require(_0x91ff('0x0'));var util=require(_0x91ff('0x1'));var logger=require(_0x91ff('0x2'))(_0x91ff('0x3'));var moment=require('moment');var BPromise=require(_0x91ff('0x4'));var rp=require(_0x91ff('0x5'));var fs=require('fs');var path=require(_0x91ff('0x6'));var rimraf=require(_0x91ff('0x7'));var config=require(_0x91ff('0x8'));var attributes=require(_0x91ff('0x9'));module[_0x91ff('0xa')]=function(_0x4910ad,_0x13fa13){return _0x4910ad[_0x91ff('0xb')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a05ad,_0x25d97e,_0x1fa619){if(_0x5a05ad[_0x91ff('0xc')](_0x91ff('0xd'))){_0x5a05ad[_0x91ff('0xe')]=moment()[_0x91ff('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5a05ad[_0x91ff('0xc')](_0x91ff('0x10'))){_0x5a05ad['publishedAt']=moment()[_0x91ff('0xf')](_0x91ff('0x11'));}_0x1fa619(null,_0x5a05ad);}}});}; \ No newline at end of file +var _0x34c1=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','api','moment','bluebird','request-promise','path'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x34c1,0xde));var _0x134c=function(_0x1fcb89,_0x97e587){_0x1fcb89=_0x1fcb89-0x0;var _0x2a1e82=_0x34c1[_0x1fcb89];return _0x2a1e82;};'use strict';var _=require(_0x134c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x134c('0x1'));var moment=require(_0x134c('0x2'));var BPromise=require(_0x134c('0x3'));var rp=require(_0x134c('0x4'));var fs=require('fs');var path=require(_0x134c('0x5'));var rimraf=require(_0x134c('0x6'));var config=require(_0x134c('0x7'));var attributes=require(_0x134c('0x8'));module[_0x134c('0x9')]=function(_0x2fb998,_0x141fa7){return _0x2fb998[_0x134c('0xa')](_0x134c('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51d796,_0x35ac8b,_0x3f1740){if(_0x51d796[_0x134c('0xc')](_0x134c('0xd'))){_0x51d796[_0x134c('0xe')]=moment()[_0x134c('0xf')](_0x134c('0x10'));}if(_0x51d796[_0x134c('0xc')](_0x134c('0x11'))){_0x51d796[_0x134c('0x12')]=moment()[_0x134c('0xf')](_0x134c('0x10'));}_0x3f1740(null,_0x51d796);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 8004199..39bfc7c 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 _0x20de=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','ioredis'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0x20de,0x151));var _0xe20d=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x20de[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var moment=require(_0xe20d('0x2'));var BPromise=require(_0xe20d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe20d('0x4'));var db=require(_0xe20d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe20d('0x6'))(_0xe20d('0x7'));var config=require(_0xe20d('0x8'));var jayson=require(_0xe20d('0x9'));var client=jayson[_0xe20d('0xa')][_0xe20d('0xb')]({'port':0x232a});config[_0xe20d('0xc')]=_[_0xe20d('0xd')](config[_0xe20d('0xc')],{'host':_0xe20d('0xe'),'port':0x18eb});var socket=require(_0xe20d('0xf'))(new Redis(config[_0xe20d('0xc')]));require(_0xe20d('0x10'))[_0xe20d('0x11')](socket);function respondWithRpcPromise(_0x9cfe21,_0x6b8337,_0x329048){return new BPromise(function(_0x2366bd,_0x116cce){return client['request'](_0x9cfe21,_0x329048)[_0xe20d('0x12')](function(_0x541771){logger[_0xe20d('0x13')]('SquareProject,\x20%s,\x20%s',_0x6b8337,_0xe20d('0x14'));logger[_0xe20d('0x15')](_0xe20d('0x16'),_0x6b8337,_0xe20d('0x14'),JSON[_0xe20d('0x17')](_0x541771));if(_0x541771[_0xe20d('0x18')]){if(_0x541771[_0xe20d('0x18')]['code']===0x1f4){logger['error'](_0xe20d('0x19'),_0x6b8337,_0x541771[_0xe20d('0x18')][_0xe20d('0x1a')]);return _0x116cce(_0x541771['error'][_0xe20d('0x1a')]);}logger[_0xe20d('0x18')](_0xe20d('0x19'),_0x6b8337,_0x541771[_0xe20d('0x18')][_0xe20d('0x1a')]);return _0x2366bd(_0x541771[_0xe20d('0x18')][_0xe20d('0x1a')]);}else{logger[_0xe20d('0x13')](_0xe20d('0x19'),_0x6b8337,_0xe20d('0x14'));_0x2366bd(_0x541771['result'][_0xe20d('0x1a')]);}})[_0xe20d('0x1b')](function(_0x5c1cea){logger[_0xe20d('0x18')]('SquareProject,\x20%s,\x20%s',_0x6b8337,_0x5c1cea);_0x116cce(_0x5c1cea);});});}exports[_0xe20d('0x1c')]=function(_0x3e73b2){var _0x4694a9=this;return new Promise(function(_0x14b3e4,_0xeaa78e){return db[_0xe20d('0x1d')][_0xe20d('0x1e')]({'raw':_0x3e73b2[_0xe20d('0x1f')]?_0x3e73b2['options'][_0xe20d('0x20')]===undefined?!![]:![]:!![],'where':_0x3e73b2[_0xe20d('0x1f')]?_0x3e73b2[_0xe20d('0x1f')][_0xe20d('0x21')]||null:null,'attributes':_0x3e73b2[_0xe20d('0x1f')]?_0x3e73b2[_0xe20d('0x1f')][_0xe20d('0x22')]||null:null,'include':_0x3e73b2[_0xe20d('0x1f')]?_0x3e73b2[_0xe20d('0x1f')]['include']?_[_0xe20d('0x23')](_0x3e73b2[_0xe20d('0x1f')][_0xe20d('0x24')],function(_0x536c29){return{'model':db[_0x536c29[_0xe20d('0x25')]],'as':_0x536c29['as'],'attributes':_0x536c29[_0xe20d('0x22')],'include':_0x536c29['include']?_[_0xe20d('0x23')](_0x536c29[_0xe20d('0x24')],function(_0x2bfe8b){return{'model':db[_0x2bfe8b[_0xe20d('0x25')]],'as':_0x2bfe8b['as'],'attributes':_0x2bfe8b[_0xe20d('0x22')],'include':_0x2bfe8b[_0xe20d('0x24')]?_[_0xe20d('0x23')](_0x2bfe8b[_0xe20d('0x24')],function(_0x4ca87b){return{'model':db[_0x4ca87b['model']],'as':_0x4ca87b['as'],'attributes':_0x4ca87b[_0xe20d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe20d('0x12')](function(_0x54bb86){logger['info'](_0xe20d('0x1c'),_0x3e73b2);logger[_0xe20d('0x15')]('ShowSquareProject',_0x3e73b2,JSON[_0xe20d('0x17')](_0x54bb86));_0x14b3e4(_0x54bb86);})[_0xe20d('0x1b')](function(_0x408934){logger[_0xe20d('0x18')](_0xe20d('0x1c'),_0x408934['message'],_0x3e73b2);_0xeaa78e(_0x4694a9['error'](0x1f4,_0x408934[_0xe20d('0x1a')]));});});}; \ No newline at end of file +var _0xd91d=['client','http','defaults','redis','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','options','where','attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x945e90,_0x1bfbea){var _0x56fdce=function(_0x53a735){while(--_0x53a735){_0x945e90['push'](_0x945e90['shift']());}};_0x56fdce(++_0x1bfbea);}(_0xd91d,0x1e4));var _0xdd91=function(_0x4efe4c,_0x251288){_0x4efe4c=_0x4efe4c-0x0;var _0x5b079b=_0xd91d[_0x4efe4c];return _0x5b079b;};'use strict';var _=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var moment=require(_0xdd91('0x2'));var BPromise=require(_0xdd91('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd91('0x4'))['db'];var utils=require(_0xdd91('0x5'));var logger=require(_0xdd91('0x6'))(_0xdd91('0x7'));var config=require(_0xdd91('0x8'));var jayson=require(_0xdd91('0x9'));var client=jayson[_0xdd91('0xa')][_0xdd91('0xb')]({'port':0x232a});config['redis']=_[_0xdd91('0xc')](config[_0xdd91('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd91('0xe'))(new Redis(config[_0xdd91('0xd')]));require(_0xdd91('0xf'))[_0xdd91('0x10')](socket);function respondWithRpcPromise(_0x466a2b,_0x10d154,_0x5acf92){return new BPromise(function(_0x8ddc32,_0x4c79de){return client[_0xdd91('0x11')](_0x466a2b,_0x5acf92)[_0xdd91('0x12')](function(_0xaee7c0){logger[_0xdd91('0x13')](_0xdd91('0x14'),_0x10d154,_0xdd91('0x15'));logger[_0xdd91('0x16')](_0xdd91('0x17'),_0x10d154,_0xdd91('0x15'),JSON[_0xdd91('0x18')](_0xaee7c0));if(_0xaee7c0[_0xdd91('0x19')]){if(_0xaee7c0[_0xdd91('0x19')][_0xdd91('0x1a')]===0x1f4){logger[_0xdd91('0x19')](_0xdd91('0x14'),_0x10d154,_0xaee7c0[_0xdd91('0x19')][_0xdd91('0x1b')]);return _0x4c79de(_0xaee7c0['error'][_0xdd91('0x1b')]);}logger['error'](_0xdd91('0x14'),_0x10d154,_0xaee7c0[_0xdd91('0x19')][_0xdd91('0x1b')]);return _0x8ddc32(_0xaee7c0[_0xdd91('0x19')][_0xdd91('0x1b')]);}else{logger[_0xdd91('0x13')](_0xdd91('0x14'),_0x10d154,_0xdd91('0x15'));_0x8ddc32(_0xaee7c0[_0xdd91('0x1c')][_0xdd91('0x1b')]);}})[_0xdd91('0x1d')](function(_0x546bdb){logger[_0xdd91('0x19')](_0xdd91('0x14'),_0x10d154,_0x546bdb);_0x4c79de(_0x546bdb);});});}exports[_0xdd91('0x1e')]=function(_0x3a034c){var _0x26207d=this;return new Promise(function(_0x18313d,_0x428def){return db[_0xdd91('0x1f')]['find']({'raw':_0x3a034c['options']?_0x3a034c[_0xdd91('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3a034c[_0xdd91('0x20')]?_0x3a034c[_0xdd91('0x20')][_0xdd91('0x21')]||null:null,'attributes':_0x3a034c[_0xdd91('0x20')]?_0x3a034c[_0xdd91('0x20')][_0xdd91('0x22')]||null:null,'include':_0x3a034c[_0xdd91('0x20')]?_0x3a034c[_0xdd91('0x20')][_0xdd91('0x23')]?_[_0xdd91('0x24')](_0x3a034c[_0xdd91('0x20')]['include'],function(_0x4b1d8e){return{'model':db[_0x4b1d8e['model']],'as':_0x4b1d8e['as'],'attributes':_0x4b1d8e['attributes'],'include':_0x4b1d8e[_0xdd91('0x23')]?_['map'](_0x4b1d8e[_0xdd91('0x23')],function(_0x552d48){return{'model':db[_0x552d48[_0xdd91('0x25')]],'as':_0x552d48['as'],'attributes':_0x552d48[_0xdd91('0x22')],'include':_0x552d48[_0xdd91('0x23')]?_['map'](_0x552d48[_0xdd91('0x23')],function(_0x351fa7){return{'model':db[_0x351fa7['model']],'as':_0x351fa7['as'],'attributes':_0x351fa7['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd91('0x12')](function(_0x4fa19b){logger[_0xdd91('0x13')]('ShowSquareProject',_0x3a034c);logger[_0xdd91('0x16')](_0xdd91('0x1e'),_0x3a034c,JSON[_0xdd91('0x18')](_0x4fa19b));_0x18313d(_0x4fa19b);})[_0xdd91('0x1d')](function(_0x3765b7){logger[_0xdd91('0x19')](_0xdd91('0x1e'),_0x3765b7[_0xdd91('0x1b')],_0x3a034c);_0x428def(_0x26207d[_0xdd91('0x19')](0x1f4,_0x3765b7[_0xdd91('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8408093..5dd02ac 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 _0xb952=['length','squareProject:','./squareProject.events','save','emit','register'];(function(_0x3563d5,_0xaba01f){var _0x2fc31f=function(_0x3bb66e){while(--_0x3bb66e){_0x3563d5['push'](_0x3563d5['shift']());}};_0x2fc31f(++_0xaba01f);}(_0xb952,0x1a0));var _0x2b95=function(_0x3d6454,_0x3a1897){_0x3d6454=_0x3d6454-0x0;var _0x5317f2=_0xb952[_0x3d6454];return _0x5317f2;};'use strict';var SquareProjectEvents=require(_0x2b95('0x0'));var events=[_0x2b95('0x1'),'remove','update'];function createListener(_0x16fa4b,_0xdbe00f){return function(_0x449be4){_0xdbe00f[_0x2b95('0x2')](_0x16fa4b,_0x449be4);};}function removeListener(_0x5b510c,_0x144d85){return function(){SquareProjectEvents['removeListener'](_0x5b510c,_0x144d85);};}exports[_0x2b95('0x3')]=function(_0x4b5231){for(var _0x291633=0x0,_0x11c31a=events[_0x2b95('0x4')];_0x291633<_0x11c31a;_0x291633++){var _0x2747fc=events[_0x291633];var _0xa551ff=createListener(_0x2b95('0x5')+_0x2747fc,_0x4b5231);SquareProjectEvents['on'](_0x2747fc,_0xa551ff);}}; \ No newline at end of file +var _0x11a4=['save','remove','update','removeListener','register','length','squareProject:'];(function(_0x30d7dd,_0x278e33){var _0x3d442a=function(_0x532bec){while(--_0x532bec){_0x30d7dd['push'](_0x30d7dd['shift']());}};_0x3d442a(++_0x278e33);}(_0x11a4,0x103));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x411a('0x0'),_0x411a('0x1'),_0x411a('0x2')];function createListener(_0x5232af,_0x1e588b){return function(_0x3539bf){_0x1e588b['emit'](_0x5232af,_0x3539bf);};}function removeListener(_0x4cb306,_0x4c36bd){return function(){SquareProjectEvents[_0x411a('0x3')](_0x4cb306,_0x4c36bd);};}exports[_0x411a('0x4')]=function(_0x2a451d){for(var _0x9980e9=0x0,_0x3a6ac1=events[_0x411a('0x5')];_0x9980e9<_0x3a6ac1;_0x9980e9++){var _0x396880=events[_0x9980e9];var _0xfd9bd4=createListener(_0x411a('0x6')+_0x396880,_0x2a451d);SquareProjectEvents['on'](_0x396880,_0xfd9bd4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b831bfb..3ea46e4 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 _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x46177e,_0x113b81){var _0x6fe960=function(_0x1edc83){while(--_0x1edc83){_0x46177e['push'](_0x46177e['shift']());}};_0x6fe960(++_0x113b81);}(_0xe14b,0x93));var _0xbe14=function(_0x574460,_0x200d62){_0x574460=_0x574460-0x0;var _0x5707a1=_0xe14b[_0x574460];return _0x5707a1;};'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['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=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(_0x3e026d,_0x534e5d){var _0x3bbe8e=function(_0x16db74){while(--_0x16db74){_0x3e026d['push'](_0x3e026d['shift']());}};_0x3bbe8e(++_0x534e5d);}(_0x5fab,0x177));var _0xb5fa=function(_0x1e01ca,_0x14dc80){_0x1e01ca=_0x1e01ca-0x0;var _0x318e7f=_0x5fab[_0x1e01ca];return _0x318e7f;};'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 11bd53f..b24d578 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 _0xe14b=['VIRTUAL','lastIndexOf','sequelize','exports','STRING'];(function(_0x4c099b,_0x5a5710){var _0x562c2b=function(_0xca6403){while(--_0xca6403){_0x4c099b['push'](_0x4c099b['shift']());}};_0x562c2b(++_0x5a5710);}(_0xe14b,0x93));var _0xbe14=function(_0x1ccda6,_0x554407){_0x1ccda6=_0x1ccda6-0x0;var _0xccf550=_0xe14b[_0x1ccda6];return _0xccf550;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe14('0x2')]},'context':{'type':Sequelize[_0xbe14('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe14('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbe14('0x2')]},'saveName':{'type':Sequelize[_0xbe14('0x2')]},'filename':{'type':Sequelize[_0xbe14('0x2')]},'savePath':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x3')],'get':function(){var _0x39387e='';var _0x196fca=this['getDataValue']('savePath');if(_0x196fca){_0x39387e=_0x196fca['substring'](_0x196fca[_0xbe14('0x4')]('.'));}return _0x39387e;}}}; \ No newline at end of file +var _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x2cd7c0,_0x79c95){var _0x211df9=function(_0x3d9699){while(--_0x3d9699){_0x2cd7c0['push'](_0x2cd7c0['shift']());}};_0x211df9(++_0x79c95);}(_0x6f47,0xc7));var _0x76f4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6f47[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 42d17f1..806a7a3 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 _0xa208=['uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','length','catch','create','body','find','params','download','../../components/encryptor'];(function(_0x57cc49,_0x44ab4b){var _0x5dc398=function(_0x22c9ea){while(--_0x22c9ea){_0x57cc49['push'](_0x57cc49['shift']());}};_0x5dc398(++_0x44ab4b);}(_0xa208,0xd8));var _0x8a20=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa208[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x8a20('0x0'));var rimraf=require(_0x8a20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a20('0x2'));var rp=require(_0x8a20('0x3'));var moment=require('moment');var BPromise=require(_0x8a20('0x4'));var Mustache=require(_0x8a20('0x5'));var util=require(_0x8a20('0x6'));var path=require('path');var sox=require(_0x8a20('0x7'));var csv=require(_0x8a20('0x8'));var ejs=require(_0x8a20('0x9'));var fs=require('fs');var fs_extra=require(_0x8a20('0xa'));var _=require('lodash');var squel=require(_0x8a20('0xb'));var crypto=require(_0x8a20('0xc'));var jsforce=require(_0x8a20('0xd'));var deskjs=require(_0x8a20('0xe'));var toCsv=require(_0x8a20('0x8'));var querystring=require(_0x8a20('0xf'));var Papa=require(_0x8a20('0x10'));var Redis=require(_0x8a20('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8a20('0x12'));var as=require(_0x8a20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8a20('0x14'));var config=require(_0x8a20('0x15'));var licenseUtil=require(_0x8a20('0x16'));var db=require(_0x8a20('0x17'))['db'];function respondWithStatusCode(_0x23465f,_0x26fd70){_0x26fd70=_0x26fd70||0xcc;return function(_0x430ec3){if(_0x430ec3){return _0x23465f[_0x8a20('0x18')](_0x26fd70);}return _0x23465f[_0x8a20('0x19')](_0x26fd70)[_0x8a20('0x1a')]();};}function respondWithResult(_0x54bc62,_0x5e7587){_0x5e7587=_0x5e7587||0xc8;return function(_0x125164){if(_0x125164){return _0x54bc62[_0x8a20('0x19')](_0x5e7587)[_0x8a20('0x1b')](_0x125164);}};}function respondWithFilteredResult(_0x29fbb0,_0x231e0d){return function(_0x1e6985){if(_0x1e6985){var _0x51fac3=typeof _0x231e0d[_0x8a20('0x1c')]==='undefined'&&typeof _0x231e0d[_0x8a20('0x1d')]===_0x8a20('0x1e');var _0x3a6b1b=_0x1e6985['count'];var _0x3be66d=_0x51fac3?0x0:_0x231e0d[_0x8a20('0x1c')];var _0x5784e6=_0x51fac3?_0x1e6985[_0x8a20('0x1f')]:_0x231e0d['offset']+_0x231e0d['limit'];var _0xb25623;if(_0x5784e6>=_0x3a6b1b){_0x5784e6=_0x3a6b1b;_0xb25623=0xc8;}else{_0xb25623=0xce;}_0x29fbb0[_0x8a20('0x19')](_0xb25623);return _0x29fbb0[_0x8a20('0x20')](_0x8a20('0x21'),_0x3be66d+'-'+_0x5784e6+'/'+_0x3a6b1b)[_0x8a20('0x1b')](_0x1e6985);}return null;};}function patchUpdates(_0x697853){return function(_0x2dfb4d){try{jsonpatch[_0x8a20('0x22')](_0x2dfb4d,_0x697853,!![]);}catch(_0x18395a){return BPromise[_0x8a20('0x23')](_0x18395a);}return _0x2dfb4d[_0x8a20('0x24')]();};}function saveUpdates(_0x93d0dc,_0x5e22f2){return function(_0x153a84){if(_0x153a84){return _0x153a84[_0x8a20('0x25')](_0x93d0dc)[_0x8a20('0x26')](function(_0x356353){return _0x356353;});}return null;};}function removeEntity(_0x16ab2e,_0x41c18f){return function(_0x3778bc){if(_0x3778bc){return _0x3778bc[_0x8a20('0x27')]()[_0x8a20('0x26')](function(){_0x16ab2e[_0x8a20('0x19')](0xcc)[_0x8a20('0x1a')]();});}};}function handleEntityNotFound(_0x141729,_0x139faf){return function(_0xe0958f){if(!_0xe0958f){_0x141729[_0x8a20('0x18')](0x194);}return _0xe0958f;};}function handleError(_0x132d69,_0xec16a8){_0xec16a8=_0xec16a8||0x1f4;return function(_0x342bcb){logger['error'](_0x342bcb[_0x8a20('0x28')]);if(_0x342bcb[_0x8a20('0x29')]){delete _0x342bcb[_0x8a20('0x29')];}_0x132d69[_0x8a20('0x19')](_0xec16a8)[_0x8a20('0x2a')](_0x342bcb);};}exports[_0x8a20('0x2b')]=function(_0x272564,_0x49f558){var _0x8c8f23={},_0x4ee86c={},_0xc3261b={'count':0x0,'rows':[]};var _0x2864f0=_['map'](db[_0x8a20('0x2c')][_0x8a20('0x2d')],function(_0x4f032d){return{'name':_0x4f032d[_0x8a20('0x2e')],'type':_0x4f032d[_0x8a20('0x2f')][_0x8a20('0x30')]};});_0x4ee86c[_0x8a20('0x31')]=_[_0x8a20('0x32')](_0x2864f0,_0x8a20('0x29'));_0x4ee86c[_0x8a20('0x33')]=_[_0x8a20('0x34')](_0x272564['query']);_0x4ee86c['filters']=_['intersection'](_0x4ee86c[_0x8a20('0x31')],_0x4ee86c[_0x8a20('0x33')]);_0x8c8f23['attributes']=_[_0x8a20('0x35')](_0x4ee86c[_0x8a20('0x31')],qs[_0x8a20('0x36')](_0x272564[_0x8a20('0x33')]['fields']));_0x8c8f23[_0x8a20('0x37')]=_0x8c8f23[_0x8a20('0x37')]['length']?_0x8c8f23['attributes']:_0x4ee86c['model'];if(!_0x272564[_0x8a20('0x33')][_0x8a20('0x38')](_0x8a20('0x39'))){_0x8c8f23[_0x8a20('0x1d')]=qs['limit'](_0x272564[_0x8a20('0x33')]['limit']);_0x8c8f23['offset']=qs['offset'](_0x272564['query'][_0x8a20('0x1c')]);}_0x8c8f23[_0x8a20('0x3a')]=qs[_0x8a20('0x3b')](_0x272564[_0x8a20('0x33')][_0x8a20('0x3b')]);_0x8c8f23[_0x8a20('0x3c')]=qs[_0x8a20('0x3d')](_[_0x8a20('0x3e')](_0x272564[_0x8a20('0x33')],_0x4ee86c[_0x8a20('0x3d')]),_0x2864f0);if(_0x272564['query'][_0x8a20('0x3f')]){_0x8c8f23[_0x8a20('0x3c')]=_['merge'](_0x8c8f23[_0x8a20('0x3c')],{'$or':_[_0x8a20('0x32')](_0x2864f0,function(_0x17ca86){if(_0x17ca86['type']!==_0x8a20('0x40')){var _0x1803f8={};_0x1803f8[_0x17ca86[_0x8a20('0x29')]]={'$like':'%'+_0x272564[_0x8a20('0x33')]['filter']+'%'};return _0x1803f8;}})});}_0x8c8f23=_[_0x8a20('0x41')]({},_0x8c8f23,_0x272564[_0x8a20('0x42')]);var _0xaeb8e={'where':_0x8c8f23[_0x8a20('0x3c')]};return db[_0x8a20('0x2c')][_0x8a20('0x1f')](_0xaeb8e)[_0x8a20('0x26')](function(_0x126eef){_0xc3261b[_0x8a20('0x1f')]=_0x126eef;if(_0x272564['query'][_0x8a20('0x43')]){_0x8c8f23[_0x8a20('0x44')]=[{'all':!![]}];}return db['SquareRecording'][_0x8a20('0x45')](_0x8c8f23);})[_0x8a20('0x26')](function(_0x33dea7){_0xc3261b['rows']=_0x33dea7;return _0xc3261b;})[_0x8a20('0x26')](respondWithFilteredResult(_0x49f558,_0x8c8f23))['catch'](handleError(_0x49f558,null));};exports['show']=function(_0x41ea03,_0x2f7e90){var _0x1e9b5e={'raw':!![],'where':{'id':_0x41ea03['params']['id']}},_0x3af670={};_0x3af670[_0x8a20('0x31')]=_['keys'](db['SquareRecording'][_0x8a20('0x2d')]);_0x3af670[_0x8a20('0x33')]=_[_0x8a20('0x34')](_0x41ea03[_0x8a20('0x33')]);_0x3af670[_0x8a20('0x3d')]=_[_0x8a20('0x35')](_0x3af670[_0x8a20('0x31')],_0x3af670[_0x8a20('0x33')]);_0x1e9b5e[_0x8a20('0x37')]=_[_0x8a20('0x35')](_0x3af670[_0x8a20('0x31')],qs[_0x8a20('0x36')](_0x41ea03[_0x8a20('0x33')]['fields']));_0x1e9b5e[_0x8a20('0x37')]=_0x1e9b5e[_0x8a20('0x37')][_0x8a20('0x46')]?_0x1e9b5e[_0x8a20('0x37')]:_0x3af670[_0x8a20('0x31')];if(_0x41ea03[_0x8a20('0x33')][_0x8a20('0x43')]){_0x1e9b5e[_0x8a20('0x44')]=[{'all':!![]}];}_0x1e9b5e=_['merge']({},_0x1e9b5e,_0x41ea03['options']);return db[_0x8a20('0x2c')]['find'](_0x1e9b5e)['then'](handleEntityNotFound(_0x2f7e90,null))[_0x8a20('0x26')](respondWithResult(_0x2f7e90,null))[_0x8a20('0x47')](handleError(_0x2f7e90,null));};exports['create']=function(_0x204091,_0x4e4db7){return db[_0x8a20('0x2c')][_0x8a20('0x48')](_0x204091[_0x8a20('0x49')],{})[_0x8a20('0x26')](respondWithResult(_0x4e4db7,0xc9))[_0x8a20('0x47')](handleError(_0x4e4db7,null));};exports['update']=function(_0x38c686,_0x158a5a){if(_0x38c686[_0x8a20('0x49')]['id']){delete _0x38c686[_0x8a20('0x49')]['id'];}return db['SquareRecording'][_0x8a20('0x4a')]({'where':{'id':_0x38c686[_0x8a20('0x4b')]['id']}})['then'](handleEntityNotFound(_0x158a5a,null))[_0x8a20('0x26')](saveUpdates(_0x38c686['body'],null))[_0x8a20('0x26')](respondWithResult(_0x158a5a,null))[_0x8a20('0x47')](handleError(_0x158a5a,null));};exports[_0x8a20('0x4c')]=function(_0x9f3a8,_0x25ab75,_0x56c64e){var _0x5ebae2=require(_0x8a20('0x4d'));var _0x3342d0=![];var _0x16cd3a={};if(_0x9f3a8[_0x8a20('0x33')][_0x8a20('0x2f')]&&_0x9f3a8[_0x8a20('0x33')][_0x8a20('0x2f')]===_0x8a20('0x4e')){_0x16cd3a[_0x8a20('0x4e')]=_0x9f3a8['params']['id'];}else{_0x16cd3a['id']=_0x9f3a8['params']['id'];}return db[_0x8a20('0x2c')][_0x8a20('0x4a')]({'where':_0x16cd3a,'attributes':['id',_0x8a20('0x4f'),_0x8a20('0x50')],'raw':!![]})[_0x8a20('0x26')](handleEntityNotFound(_0x25ab75,null))[_0x8a20('0x26')](function(_0x184c2a){if(_0x184c2a){var _0x244fd9=_0x184c2a[_0x8a20('0x4f')];var _0x1bc8bb=util[_0x8a20('0x51')](_0x8a20('0x52'),_0x244fd9);if(fs[_0x8a20('0x53')](_0x1bc8bb)){_0x3342d0=!![];return _0x5ebae2[_0x8a20('0x54')](_0x1bc8bb,_0x244fd9,config['secrets']['recording'])[_0x8a20('0x26')](function(){return _0x184c2a;});}return _0x184c2a;}})['then'](function(_0x418098){if(_0x418098){var _0x3a3c8f=_0x418098[_0x8a20('0x4f')];if(!fs['existsSync'](_0x3a3c8f)){throw new db['Sequelize']['ValidationError'](_0x8a20('0x55'));}if(_0x418098[_0x8a20('0x50')]){return _0x25ab75[_0x8a20('0x4c')](_0x3a3c8f,_0x418098[_0x8a20('0x50')]+path[_0x8a20('0x56')](_0x3a3c8f),function(){if(_0x3342d0){fs[_0x8a20('0x57')](_0x3a3c8f);}});}else{return _0x25ab75['download'](_0x3a3c8f,function(_0x5627ac){if(_0x3342d0){fs[_0x8a20('0x57')](_0x3a3c8f);}});}}})[_0x8a20('0x47')](function(_0x4f5cf1){if(_0x4f5cf1[_0x8a20('0x58')]===_0x8a20('0x55')){_0x25ab75[_0x8a20('0x19')](0x194)[_0x8a20('0x2a')](_0x8a20('0x59'));}else{return handleError(_0x25ab75,null);}});};exports['destroy']=function(_0x5c059a,_0x3b5f7c){return db['SquareRecording']['find']({'where':{'id':_0x5c059a[_0x8a20('0x4b')]['id']}})[_0x8a20('0x26')](function(_0x56ad2b){if(_[_0x8a20('0x5a')](_0x56ad2b)){throw new ReferenceError(_0x8a20('0x5b'));}return _0x56ad2b;})[_0x8a20('0x26')](function(_0x435808){var _0x45b412=_0x435808[_0x8a20('0x4f')];logger[_0x8a20('0x5c')](_0x8a20('0x5d'),_0x45b412);if(!_['isNil'](_0x435808[_0x8a20('0x4f')])&&fs[_0x8a20('0x53')](_0x45b412)){logger['info'](_0x8a20('0x5e')+_0x45b412+_0x8a20('0x5f'));fs[_0x8a20('0x60')](_0x45b412);}_0x45b412=_0x45b412+_0x8a20('0x61');if(!_[_0x8a20('0x5a')](_0x435808[_0x8a20('0x4f')])&&fs[_0x8a20('0x53')](_0x45b412)){logger[_0x8a20('0x5c')](_0x8a20('0x5e')+_0x45b412+_0x8a20('0x5f'));fs[_0x8a20('0x60')](_0x45b412);}return _0x435808;})[_0x8a20('0x26')](function(_0xec530f){if(!_0xec530f)throw new InternalError();return _0xec530f[_0x8a20('0x27')]();})[_0x8a20('0x26')](function(){_0x3b5f7c[_0x8a20('0x19')](0xcc)[_0x8a20('0x1a')]();})[_0x8a20('0x47')](handleError(_0x3b5f7c,null));}; \ No newline at end of file +var _0xfcdf=['sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x5108fb,_0x53b8d2){var _0x35fee7=function(_0x15499f){while(--_0x15499f){_0x5108fb['push'](_0x5108fb['shift']());}};_0x35fee7(++_0x53b8d2);}(_0xfcdf,0x1ab));var _0xffcd=function(_0x5297f9,_0x56acf3){_0x5297f9=_0x5297f9-0x0;var _0x30892a=_0xfcdf[_0x5297f9];return _0x30892a;};'use strict';var emlformat=require(_0xffcd('0x0'));var rimraf=require(_0xffcd('0x1'));var zipdir=require(_0xffcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xffcd('0x3'));var BPromise=require(_0xffcd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xffcd('0x5'));var csv=require(_0xffcd('0x6'));var ejs=require(_0xffcd('0x7'));var fs=require('fs');var fs_extra=require(_0xffcd('0x8'));var _=require('lodash');var squel=require(_0xffcd('0x9'));var crypto=require('crypto');var jsforce=require(_0xffcd('0xa'));var deskjs=require(_0xffcd('0xb'));var toCsv=require(_0xffcd('0x6'));var querystring=require(_0xffcd('0xc'));var Papa=require(_0xffcd('0xd'));var Redis=require(_0xffcd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xffcd('0xf'));var as=require(_0xffcd('0x10'));var hardwareService=require(_0xffcd('0x11'));var logger=require(_0xffcd('0x12'))(_0xffcd('0x13'));var utils=require('../../config/utils');var config=require(_0xffcd('0x14'));var licenseUtil=require(_0xffcd('0x15'));var db=require(_0xffcd('0x16'))['db'];function respondWithStatusCode(_0xe4d8af,_0x199e1b){_0x199e1b=_0x199e1b||0xcc;return function(_0x46b860){if(_0x46b860){return _0xe4d8af[_0xffcd('0x17')](_0x199e1b);}return _0xe4d8af[_0xffcd('0x18')](_0x199e1b)[_0xffcd('0x19')]();};}function respondWithResult(_0x1e466e,_0x52e2d1){_0x52e2d1=_0x52e2d1||0xc8;return function(_0xcaabb7){if(_0xcaabb7){return _0x1e466e[_0xffcd('0x18')](_0x52e2d1)['json'](_0xcaabb7);}};}function respondWithFilteredResult(_0x2375de,_0x32f2ed){return function(_0x2d3197){if(_0x2d3197){var _0x44d823=typeof _0x32f2ed[_0xffcd('0x1a')]===_0xffcd('0x1b')&&typeof _0x32f2ed[_0xffcd('0x1c')]===_0xffcd('0x1b');var _0x5659c2=_0x2d3197[_0xffcd('0x1d')];var _0x17bd60=_0x44d823?0x0:_0x32f2ed[_0xffcd('0x1a')];var _0x4960a8=_0x44d823?_0x2d3197[_0xffcd('0x1d')]:_0x32f2ed['offset']+_0x32f2ed[_0xffcd('0x1c')];var _0x52ee64;if(_0x4960a8>=_0x5659c2){_0x4960a8=_0x5659c2;_0x52ee64=0xc8;}else{_0x52ee64=0xce;}_0x2375de[_0xffcd('0x18')](_0x52ee64);return _0x2375de['set'](_0xffcd('0x1e'),_0x17bd60+'-'+_0x4960a8+'/'+_0x5659c2)['json'](_0x2d3197);}return null;};}function patchUpdates(_0x3a9865){return function(_0x1c8abb){try{jsonpatch[_0xffcd('0x1f')](_0x1c8abb,_0x3a9865,!![]);}catch(_0x3fa20a){return BPromise[_0xffcd('0x20')](_0x3fa20a);}return _0x1c8abb['save']();};}function saveUpdates(_0x133364,_0x510627){return function(_0x5635e8){if(_0x5635e8){return _0x5635e8[_0xffcd('0x21')](_0x133364)['then'](function(_0x53aed2){return _0x53aed2;});}return null;};}function removeEntity(_0x4b1698,_0x48d363){return function(_0x4ee25c){if(_0x4ee25c){return _0x4ee25c[_0xffcd('0x22')]()[_0xffcd('0x23')](function(){_0x4b1698[_0xffcd('0x18')](0xcc)[_0xffcd('0x19')]();});}};}function handleEntityNotFound(_0x49bec3,_0x10a79e){return function(_0x17bbb0){if(!_0x17bbb0){_0x49bec3[_0xffcd('0x17')](0x194);}return _0x17bbb0;};}function handleError(_0x22154e,_0x827e76){_0x827e76=_0x827e76||0x1f4;return function(_0x454edb){logger['error'](_0x454edb['stack']);if(_0x454edb['name']){delete _0x454edb[_0xffcd('0x24')];}_0x22154e[_0xffcd('0x18')](_0x827e76)[_0xffcd('0x25')](_0x454edb);};}exports[_0xffcd('0x26')]=function(_0x1bf719,_0x109c84){var _0x8defcc={},_0x5abefe={},_0x1c3e1={'count':0x0,'rows':[]};var _0x54fbd5=_['map'](db[_0xffcd('0x27')][_0xffcd('0x28')],function(_0xd6ec8f){return{'name':_0xd6ec8f[_0xffcd('0x29')],'type':_0xd6ec8f[_0xffcd('0x2a')][_0xffcd('0x2b')]};});_0x5abefe[_0xffcd('0x2c')]=_['map'](_0x54fbd5,_0xffcd('0x24'));_0x5abefe[_0xffcd('0x2d')]=_[_0xffcd('0x2e')](_0x1bf719['query']);_0x5abefe[_0xffcd('0x2f')]=_[_0xffcd('0x30')](_0x5abefe['model'],_0x5abefe[_0xffcd('0x2d')]);_0x8defcc[_0xffcd('0x31')]=_[_0xffcd('0x30')](_0x5abefe['model'],qs[_0xffcd('0x32')](_0x1bf719['query'][_0xffcd('0x32')]));_0x8defcc[_0xffcd('0x31')]=_0x8defcc[_0xffcd('0x31')][_0xffcd('0x33')]?_0x8defcc[_0xffcd('0x31')]:_0x5abefe[_0xffcd('0x2c')];if(!_0x1bf719[_0xffcd('0x2d')]['hasOwnProperty'](_0xffcd('0x34'))){_0x8defcc['limit']=qs[_0xffcd('0x1c')](_0x1bf719[_0xffcd('0x2d')][_0xffcd('0x1c')]);_0x8defcc[_0xffcd('0x1a')]=qs['offset'](_0x1bf719[_0xffcd('0x2d')]['offset']);}_0x8defcc['order']=qs[_0xffcd('0x35')](_0x1bf719[_0xffcd('0x2d')][_0xffcd('0x35')]);_0x8defcc[_0xffcd('0x36')]=qs['filters'](_[_0xffcd('0x37')](_0x1bf719[_0xffcd('0x2d')],_0x5abefe[_0xffcd('0x2f')]),_0x54fbd5);if(_0x1bf719[_0xffcd('0x2d')]['filter']){_0x8defcc[_0xffcd('0x36')]=_[_0xffcd('0x38')](_0x8defcc['where'],{'$or':_[_0xffcd('0x39')](_0x54fbd5,function(_0x4dff64){if(_0x4dff64[_0xffcd('0x2a')]!==_0xffcd('0x3a')){var _0x2f386f={};_0x2f386f[_0x4dff64[_0xffcd('0x24')]]={'$like':'%'+_0x1bf719[_0xffcd('0x2d')][_0xffcd('0x3b')]+'%'};return _0x2f386f;}})});}_0x8defcc=_['merge']({},_0x8defcc,_0x1bf719[_0xffcd('0x3c')]);var _0x38c510={'where':_0x8defcc[_0xffcd('0x36')]};return db['SquareRecording'][_0xffcd('0x1d')](_0x38c510)['then'](function(_0x27c849){_0x1c3e1[_0xffcd('0x1d')]=_0x27c849;if(_0x1bf719[_0xffcd('0x2d')][_0xffcd('0x3d')]){_0x8defcc[_0xffcd('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0xffcd('0x3f')](_0x8defcc);})[_0xffcd('0x23')](function(_0x1f927e){_0x1c3e1[_0xffcd('0x40')]=_0x1f927e;return _0x1c3e1;})[_0xffcd('0x23')](respondWithFilteredResult(_0x109c84,_0x8defcc))[_0xffcd('0x41')](handleError(_0x109c84,null));};exports[_0xffcd('0x42')]=function(_0x9aa89d,_0x44d617){var _0x4ed2a4={'raw':!![],'where':{'id':_0x9aa89d[_0xffcd('0x43')]['id']}},_0x7eb5a0={};_0x7eb5a0[_0xffcd('0x2c')]=_[_0xffcd('0x2e')](db[_0xffcd('0x27')][_0xffcd('0x28')]);_0x7eb5a0['query']=_[_0xffcd('0x2e')](_0x9aa89d[_0xffcd('0x2d')]);_0x7eb5a0[_0xffcd('0x2f')]=_[_0xffcd('0x30')](_0x7eb5a0[_0xffcd('0x2c')],_0x7eb5a0['query']);_0x4ed2a4[_0xffcd('0x31')]=_['intersection'](_0x7eb5a0[_0xffcd('0x2c')],qs['fields'](_0x9aa89d[_0xffcd('0x2d')][_0xffcd('0x32')]));_0x4ed2a4[_0xffcd('0x31')]=_0x4ed2a4[_0xffcd('0x31')]['length']?_0x4ed2a4[_0xffcd('0x31')]:_0x7eb5a0[_0xffcd('0x2c')];if(_0x9aa89d['query'][_0xffcd('0x3d')]){_0x4ed2a4[_0xffcd('0x3e')]=[{'all':!![]}];}_0x4ed2a4=_[_0xffcd('0x38')]({},_0x4ed2a4,_0x9aa89d[_0xffcd('0x3c')]);return db[_0xffcd('0x27')][_0xffcd('0x44')](_0x4ed2a4)[_0xffcd('0x23')](handleEntityNotFound(_0x44d617,null))['then'](respondWithResult(_0x44d617,null))[_0xffcd('0x41')](handleError(_0x44d617,null));};exports[_0xffcd('0x45')]=function(_0x1a2de7,_0x1a09ae){return db[_0xffcd('0x27')][_0xffcd('0x45')](_0x1a2de7['body'],{})['then'](respondWithResult(_0x1a09ae,0xc9))[_0xffcd('0x41')](handleError(_0x1a09ae,null));};exports[_0xffcd('0x21')]=function(_0x3f81a8,_0x4ccf0a){if(_0x3f81a8[_0xffcd('0x46')]['id']){delete _0x3f81a8['body']['id'];}return db['SquareRecording'][_0xffcd('0x44')]({'where':{'id':_0x3f81a8[_0xffcd('0x43')]['id']}})[_0xffcd('0x23')](handleEntityNotFound(_0x4ccf0a,null))[_0xffcd('0x23')](saveUpdates(_0x3f81a8[_0xffcd('0x46')],null))[_0xffcd('0x23')](respondWithResult(_0x4ccf0a,null))[_0xffcd('0x41')](handleError(_0x4ccf0a,null));};exports[_0xffcd('0x47')]=function(_0x3e19f0,_0x582733,_0x5bc0c7){var _0x17bee4=require(_0xffcd('0x48'));var _0x511e2f=![];var _0x5e987e={};if(_0x3e19f0[_0xffcd('0x2d')]['type']&&_0x3e19f0[_0xffcd('0x2d')][_0xffcd('0x2a')]===_0xffcd('0x49')){_0x5e987e['uniqueid']=_0x3e19f0['params']['id'];}else{_0x5e987e['id']=_0x3e19f0[_0xffcd('0x43')]['id'];}return db[_0xffcd('0x27')][_0xffcd('0x44')]({'where':_0x5e987e,'attributes':['id',_0xffcd('0x4a'),_0xffcd('0x4b')],'raw':!![]})[_0xffcd('0x23')](handleEntityNotFound(_0x582733,null))[_0xffcd('0x23')](function(_0x3f68f6){if(_0x3f68f6){var _0x65354c=_0x3f68f6[_0xffcd('0x4a')];var _0x498d90=util[_0xffcd('0x4c')](_0xffcd('0x4d'),_0x65354c);if(fs['existsSync'](_0x498d90)){_0x511e2f=!![];return _0x17bee4[_0xffcd('0x4e')](_0x498d90,_0x65354c,config[_0xffcd('0x4f')]['recording'])['then'](function(){return _0x3f68f6;});}return _0x3f68f6;}})['then'](function(_0x466881){if(_0x466881){var _0x3a78be=_0x466881[_0xffcd('0x4a')];if(!fs[_0xffcd('0x50')](_0x3a78be)){throw new db[(_0xffcd('0x51'))][(_0xffcd('0x52'))](_0xffcd('0x53'));}if(_0x466881['filename']){return _0x582733['download'](_0x3a78be,_0x466881[_0xffcd('0x4b')]+path[_0xffcd('0x54')](_0x3a78be),function(){if(_0x511e2f){fs[_0xffcd('0x55')](_0x3a78be);}});}else{return _0x582733['download'](_0x3a78be,function(_0x3ea753){if(_0x511e2f){fs[_0xffcd('0x55')](_0x3a78be);}});}}})[_0xffcd('0x41')](function(_0x15d3b5){if(_0x15d3b5[_0xffcd('0x56')]===_0xffcd('0x53')){_0x582733[_0xffcd('0x18')](0x194)[_0xffcd('0x25')](_0xffcd('0x57'));}else{return handleError(_0x582733,null);}});};exports[_0xffcd('0x22')]=function(_0x2bf084,_0x3eb97a){return db['SquareRecording'][_0xffcd('0x44')]({'where':{'id':_0x2bf084[_0xffcd('0x43')]['id']}})[_0xffcd('0x23')](function(_0x3cc5ab){if(_[_0xffcd('0x58')](_0x3cc5ab)){throw new ReferenceError(_0xffcd('0x59'));}return _0x3cc5ab;})[_0xffcd('0x23')](function(_0x42df31){var _0x34084e=_0x42df31[_0xffcd('0x4a')];logger[_0xffcd('0x5a')](_0xffcd('0x5b'),_0x34084e);if(!_['isNil'](_0x42df31['savePath'])&&fs[_0xffcd('0x50')](_0x34084e)){logger[_0xffcd('0x5a')](_0xffcd('0x5c')+_0x34084e+_0xffcd('0x5d'));fs['unlinkSync'](_0x34084e);}_0x34084e=_0x34084e+_0xffcd('0x5e');if(!_[_0xffcd('0x58')](_0x42df31[_0xffcd('0x4a')])&&fs[_0xffcd('0x50')](_0x34084e)){logger[_0xffcd('0x5a')](_0xffcd('0x5c')+_0x34084e+_0xffcd('0x5d'));fs[_0xffcd('0x5f')](_0x34084e);}return _0x42df31;})[_0xffcd('0x23')](function(_0x5d6384){if(!_0x5d6384)throw new InternalError();return _0x5d6384[_0xffcd('0x22')]();})[_0xffcd('0x23')](function(){_0x3eb97a['status'](0xcc)[_0xffcd('0x19')]();})[_0xffcd('0x41')](handleError(_0x3eb97a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index aeddc3b..56d6e2a 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 _0x6dc0=['SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes','define'];(function(_0x2eafa9,_0x3f015c){var _0x48785e=function(_0x16dfc4){while(--_0x16dfc4){_0x2eafa9['push'](_0x2eafa9['shift']());}};_0x48785e(++_0x3f015c);}(_0x6dc0,0xb6));var _0x06dc=function(_0x8ea1e,_0x34158a){_0x8ea1e=_0x8ea1e-0x0;var _0x1009b9=_0x6dc0[_0x8ea1e];return _0x1009b9;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var logger=require(_0x06dc('0x2'))('api');var moment=require(_0x06dc('0x3'));var BPromise=require(_0x06dc('0x4'));var rp=require(_0x06dc('0x5'));var fs=require('fs');var path=require(_0x06dc('0x6'));var rimraf=require('rimraf');var config=require(_0x06dc('0x7'));var attributes=require(_0x06dc('0x8'));module['exports']=function(_0x2454b0,_0x491195){return _0x2454b0[_0x06dc('0x9')](_0x06dc('0xa'),attributes,{'tableName':_0x06dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x225b=['square_recordings','lodash','util','api','moment','request-promise','rimraf','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x131f7f,_0x59ce3c){var _0x4b90ea=function(_0x2a2a17){while(--_0x2a2a17){_0x131f7f['push'](_0x131f7f['shift']());}};_0x4b90ea(++_0x59ce3c);}(_0x225b,0xb1));var _0xb225=function(_0x40665f,_0x1e970b){_0x40665f=_0x40665f-0x0;var _0x3ab679=_0x225b[_0x40665f];return _0x3ab679;};'use strict';var _=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var logger=require('../../config/logger')(_0xb225('0x2'));var moment=require(_0xb225('0x3'));var BPromise=require('bluebird');var rp=require(_0xb225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb225('0x5'));var config=require('../../config/environment');var attributes=require(_0xb225('0x6'));module[_0xb225('0x7')]=function(_0x3f2419,_0x4751e2){return _0x3f2419[_0xb225('0x8')](_0xb225('0x9'),attributes,{'tableName':_0xb225('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 61b62ee..ab899de 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 _0x37e8=['rpc','../../config/environment','jayson/promise','client','request','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareRecording','SquareRecording','create','options','raw','then','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0xdf7d68,_0x6f13f3){var _0x326e86=function(_0x5a3470){while(--_0x5a3470){_0xdf7d68['push'](_0xdf7d68['shift']());}};_0x326e86(++_0x6f13f3);}(_0x37e8,0xe5));var _0x837e=function(_0x4b43a6,_0x47ac36){_0x4b43a6=_0x4b43a6-0x0;var _0x15fbc6=_0x37e8[_0x4b43a6];return _0x15fbc6;};'use strict';var _=require('lodash');var util=require(_0x837e('0x0'));var moment=require(_0x837e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x837e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x837e('0x3'));var logger=require(_0x837e('0x4'))(_0x837e('0x5'));var config=require(_0x837e('0x6'));var jayson=require(_0x837e('0x7'));var client=jayson[_0x837e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d65c,_0x33db98,_0x1d75e5){return new BPromise(function(_0x3cb57a,_0x4c52d5){return client[_0x837e('0x9')](_0x38d65c,_0x1d75e5)['then'](function(_0x231fa6){logger['info'](_0x837e('0xa'),_0x33db98,_0x837e('0xb'));logger[_0x837e('0xc')](_0x837e('0xd'),_0x33db98,_0x837e('0xb'),JSON[_0x837e('0xe')](_0x231fa6));if(_0x231fa6['error']){if(_0x231fa6[_0x837e('0xf')][_0x837e('0x10')]===0x1f4){logger[_0x837e('0xf')](_0x837e('0xa'),_0x33db98,_0x231fa6[_0x837e('0xf')][_0x837e('0x11')]);return _0x4c52d5(_0x231fa6[_0x837e('0xf')]['message']);}logger[_0x837e('0xf')]('SquareRecording,\x20%s,\x20%s',_0x33db98,_0x231fa6['error'][_0x837e('0x11')]);return _0x3cb57a(_0x231fa6[_0x837e('0xf')][_0x837e('0x11')]);}else{logger[_0x837e('0x12')]('SquareRecording,\x20%s,\x20%s',_0x33db98,_0x837e('0xb'));_0x3cb57a(_0x231fa6['result'][_0x837e('0x11')]);}})[_0x837e('0x13')](function(_0x377d8b){logger[_0x837e('0xf')](_0x837e('0xa'),_0x33db98,_0x377d8b);_0x4c52d5(_0x377d8b);});});}exports[_0x837e('0x14')]=function(_0x15269c){var _0x3a68b3=this;return new Promise(function(_0x2c8617,_0x66fc51){return db[_0x837e('0x15')][_0x837e('0x16')](_0x15269c['body'],{'raw':_0x15269c['options']?_0x15269c[_0x837e('0x17')][_0x837e('0x18')]===undefined?!![]:![]:!![]})[_0x837e('0x19')](function(_0x38823b){logger['info'](_0x837e('0x14'),_0x15269c);logger['debug'](_0x837e('0x14'),_0x15269c,JSON[_0x837e('0xe')](_0x38823b));_0x2c8617(_0x38823b);})[_0x837e('0x13')](function(_0x35dd01){logger[_0x837e('0xf')](_0x837e('0x14'),_0x35dd01[_0x837e('0x11')],_0x15269c);_0x66fc51(_0x3a68b3[_0x837e('0xf')](0x1f4,_0x35dd01[_0x837e('0x11')]));});});}; \ No newline at end of file +var _0xd6d0=['rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','info','result','catch','CreateSquareRecording','SquareRecording','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b7492,_0x386025){var _0x4f8cb4=function(_0x4d6683){while(--_0x4d6683){_0x3b7492['push'](_0x3b7492['shift']());}};_0x4f8cb4(++_0x386025);}(_0xd6d0,0x170));var _0x0d6d=function(_0x55c4eb,_0x32ea3a){_0x55c4eb=_0x55c4eb-0x0;var _0x4ddd52=_0xd6d0[_0x55c4eb];return _0x4ddd52;};'use strict';var _=require(_0x0d6d('0x0'));var util=require(_0x0d6d('0x1'));var moment=require(_0x0d6d('0x2'));var BPromise=require(_0x0d6d('0x3'));var rs=require(_0x0d6d('0x4'));var fs=require('fs');var Redis=require(_0x0d6d('0x5'));var db=require(_0x0d6d('0x6'))['db'];var utils=require(_0x0d6d('0x7'));var logger=require(_0x0d6d('0x8'))(_0x0d6d('0x9'));var config=require(_0x0d6d('0xa'));var jayson=require(_0x0d6d('0xb'));var client=jayson['client'][_0x0d6d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x948f00,_0x351d68,_0x4f1db0){return new BPromise(function(_0x13a8d5,_0x2ac42a){return client[_0x0d6d('0xd')](_0x948f00,_0x4f1db0)[_0x0d6d('0xe')](function(_0x1b68e1){logger['info']('SquareRecording,\x20%s,\x20%s',_0x351d68,_0x0d6d('0xf'));logger[_0x0d6d('0x10')](_0x0d6d('0x11'),_0x351d68,_0x0d6d('0xf'),JSON[_0x0d6d('0x12')](_0x1b68e1));if(_0x1b68e1[_0x0d6d('0x13')]){if(_0x1b68e1[_0x0d6d('0x13')]['code']===0x1f4){logger[_0x0d6d('0x13')](_0x0d6d('0x14'),_0x351d68,_0x1b68e1[_0x0d6d('0x13')][_0x0d6d('0x15')]);return _0x2ac42a(_0x1b68e1[_0x0d6d('0x13')][_0x0d6d('0x15')]);}logger[_0x0d6d('0x13')](_0x0d6d('0x14'),_0x351d68,_0x1b68e1[_0x0d6d('0x13')][_0x0d6d('0x15')]);return _0x13a8d5(_0x1b68e1[_0x0d6d('0x13')][_0x0d6d('0x15')]);}else{logger[_0x0d6d('0x16')](_0x0d6d('0x14'),_0x351d68,'request\x20sent');_0x13a8d5(_0x1b68e1[_0x0d6d('0x17')][_0x0d6d('0x15')]);}})[_0x0d6d('0x18')](function(_0x25b339){logger[_0x0d6d('0x13')](_0x0d6d('0x14'),_0x351d68,_0x25b339);_0x2ac42a(_0x25b339);});});}exports[_0x0d6d('0x19')]=function(_0x21a843){var _0x347490=this;return new Promise(function(_0x5a8503,_0x7dc6ef){return db[_0x0d6d('0x1a')]['create'](_0x21a843['body'],{'raw':_0x21a843[_0x0d6d('0x1b')]?_0x21a843[_0x0d6d('0x1b')][_0x0d6d('0x1c')]===undefined?!![]:![]:!![]})[_0x0d6d('0xe')](function(_0x3bd54a){logger[_0x0d6d('0x16')](_0x0d6d('0x19'),_0x21a843);logger[_0x0d6d('0x10')](_0x0d6d('0x19'),_0x21a843,JSON[_0x0d6d('0x12')](_0x3bd54a));_0x5a8503(_0x3bd54a);})[_0x0d6d('0x18')](function(_0x37da24){logger['error'](_0x0d6d('0x19'),_0x37da24['message'],_0x21a843);_0x7dc6ef(_0x347490['error'](0x1f4,_0x37da24[_0x0d6d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 245d428..5ac2673 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x290f77,_0x5e7aaf){var _0x42106b=function(_0x21b30a){while(--_0x21b30a){_0x290f77['push'](_0x290f77['shift']());}};_0x42106b(++_0x5e7aaf);}(_0xe706,0xa3));var _0x6e70=function(_0x4d579b,_0x2327f3){_0x4d579b=_0x4d579b-0x0;var _0x288145=_0xe706[_0x4d579b];return _0x288145;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1cb88a,_0x48ecab){var _0x512661=function(_0x4a5763){while(--_0x4a5763){_0x1cb88a['push'](_0x1cb88a['shift']());}};_0x512661(++_0x48ecab);}(_0xe706,0xa3));var _0x6e70=function(_0xfcfe92,_0x14ea66){_0xfcfe92=_0xfcfe92-0x0;var _0x166ba1=_0xe706[_0xfcfe92];return _0x166ba1;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 480dee5..e563588 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 _0x188c=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x188c,0xc1));var _0xc188=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x188c[_0x36d203];return _0x2f9e62;};'use strict';var Sequelize=require(_0xc188('0x0'));module[_0xc188('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xc188('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc188('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc188('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xc188('0x2')]},'callerid':{'type':Sequelize[_0xc188('0x2')]},'calleridname':{'type':Sequelize[_0xc188('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xc188('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc188('0x2')]},'dnid':{'type':Sequelize[_0xc188('0x2')]},'rdnis':{'type':Sequelize[_0xc188('0x2')]},'context':{'type':Sequelize[_0xc188('0x2')]},'extension':{'type':Sequelize[_0xc188('0x2')]},'priority':{'type':Sequelize[_0xc188('0x2')]},'enhanced':{'type':Sequelize[_0xc188('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xc188('0x2')]},'project_name':{'type':Sequelize[_0xc188('0x2')]},'joinAt':{'type':Sequelize[_0xc188('0x3')]},'leaveAt':{'type':Sequelize[_0xc188('0x3')]},'bot':{'type':Sequelize[_0xc188('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x47c5=['DATE','STRING'];(function(_0xb71bc3,_0x435a43){var _0x24beb7=function(_0x23d2ef){while(--_0x23d2ef){_0xb71bc3['push'](_0xb71bc3['shift']());}};_0x24beb7(++_0x435a43);}(_0x47c5,0x1cd));var _0x547c=function(_0x1f8a2a,_0x906b0f){_0x1f8a2a=_0x1f8a2a-0x0;var _0x4dcaa7=_0x47c5[_0x1f8a2a];return _0x4dcaa7;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x547c('0x0')]},'network_script':{'type':Sequelize[_0x547c('0x0')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x547c('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x547c('0x0')]},'uniqueid':{'type':Sequelize[_0x547c('0x0')]},'version':{'type':Sequelize[_0x547c('0x0')]},'callerid':{'type':Sequelize[_0x547c('0x0')]},'calleridname':{'type':Sequelize[_0x547c('0x0')]},'callingpres':{'type':Sequelize[_0x547c('0x0')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x547c('0x0')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x547c('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x547c('0x0')]},'accountcode':{'type':Sequelize[_0x547c('0x0')]},'threadid':{'type':Sequelize[_0x547c('0x0')]},'project_name':{'type':Sequelize[_0x547c('0x0')]},'joinAt':{'type':Sequelize[_0x547c('0x1')]},'leaveAt':{'type':Sequelize[_0x547c('0x1')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e87ddfd..dd06b66 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 _0x353b=['catch','create','update','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','then','destroy','error','name','index','SquareReport','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find'];(function(_0x2ea3a4,_0x4d12f4){var _0x1d6cd5=function(_0x1d26a7){while(--_0x1d26a7){_0x2ea3a4['push'](_0x2ea3a4['shift']());}};_0x1d6cd5(++_0x4d12f4);}(_0x353b,0xd4));var _0xb353=function(_0x7a42d9,_0x5a0c72){_0x7a42d9=_0x7a42d9-0x0;var _0x278b78=_0x353b[_0x7a42d9];return _0x278b78;};'use strict';var emlformat=require(_0xb353('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb353('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb353('0x2'));var moment=require(_0xb353('0x3'));var BPromise=require(_0xb353('0x4'));var Mustache=require('mustache');var util=require(_0xb353('0x5'));var path=require(_0xb353('0x6'));var sox=require(_0xb353('0x7'));var csv=require(_0xb353('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb353('0x9'));var _=require(_0xb353('0xa'));var squel=require('squel');var crypto=require(_0xb353('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb353('0xc'));var toCsv=require(_0xb353('0x8'));var querystring=require(_0xb353('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb353('0xe'));var qs=require(_0xb353('0xf'));var as=require(_0xb353('0x10'));var hardwareService=require(_0xb353('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb353('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb353('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29cd6c,_0x1755d7){_0x1755d7=_0x1755d7||0xcc;return function(_0x3d6627){if(_0x3d6627){return _0x29cd6c[_0xb353('0x14')](_0x1755d7);}return _0x29cd6c[_0xb353('0x15')](_0x1755d7)[_0xb353('0x16')]();};}function respondWithResult(_0x442f8a,_0x4ce561){_0x4ce561=_0x4ce561||0xc8;return function(_0x4075ce){if(_0x4075ce){return _0x442f8a[_0xb353('0x15')](_0x4ce561)[_0xb353('0x17')](_0x4075ce);}};}function respondWithFilteredResult(_0x3c06d2,_0x415113){return function(_0x50e616){if(_0x50e616){var _0x3e5592=typeof _0x415113[_0xb353('0x18')]===_0xb353('0x19')&&typeof _0x415113['limit']===_0xb353('0x19');var _0x2a1810=_0x50e616['count'];var _0x3be97f=_0x3e5592?0x0:_0x415113[_0xb353('0x18')];var _0x232f9f=_0x3e5592?_0x50e616[_0xb353('0x1a')]:_0x415113['offset']+_0x415113['limit'];var _0x44dd37;if(_0x232f9f>=_0x2a1810){_0x232f9f=_0x2a1810;_0x44dd37=0xc8;}else{_0x44dd37=0xce;}_0x3c06d2['status'](_0x44dd37);return _0x3c06d2[_0xb353('0x1b')](_0xb353('0x1c'),_0x3be97f+'-'+_0x232f9f+'/'+_0x2a1810)[_0xb353('0x17')](_0x50e616);}return null;};}function patchUpdates(_0x3dded7){return function(_0x50bb37){try{jsonpatch['apply'](_0x50bb37,_0x3dded7,!![]);}catch(_0x597671){return BPromise[_0xb353('0x1d')](_0x597671);}return _0x50bb37['save']();};}function saveUpdates(_0x4ac555,_0x2aa331){return function(_0x21b639){if(_0x21b639){return _0x21b639['update'](_0x4ac555)[_0xb353('0x1e')](function(_0x5d8dd4){return _0x5d8dd4;});}return null;};}function removeEntity(_0x9b689c,_0x4568f7){return function(_0x58ca62){if(_0x58ca62){return _0x58ca62[_0xb353('0x1f')]()['then'](function(){_0x9b689c[_0xb353('0x15')](0xcc)[_0xb353('0x16')]();});}};}function handleEntityNotFound(_0x16f6c7,_0x5da96e){return function(_0x35d59f){if(!_0x35d59f){_0x16f6c7[_0xb353('0x14')](0x194);}return _0x35d59f;};}function handleError(_0x165a42,_0x5c229a){_0x5c229a=_0x5c229a||0x1f4;return function(_0x1ad105){logger[_0xb353('0x20')](_0x1ad105['stack']);if(_0x1ad105[_0xb353('0x21')]){delete _0x1ad105[_0xb353('0x21')];}_0x165a42['status'](_0x5c229a)['send'](_0x1ad105);};}exports[_0xb353('0x22')]=function(_0x3a3db0,_0x41eecb){var _0x139007={},_0x17427e={},_0x20c788={'count':0x0,'rows':[]};var _0x3299f5=_['map'](db[_0xb353('0x23')]['rawAttributes'],function(_0x23ddb0){return{'name':_0x23ddb0[_0xb353('0x24')],'type':_0x23ddb0[_0xb353('0x25')]['key']};});_0x17427e[_0xb353('0x26')]=_[_0xb353('0x27')](_0x3299f5,_0xb353('0x21'));_0x17427e['query']=_['keys'](_0x3a3db0[_0xb353('0x28')]);_0x17427e[_0xb353('0x29')]=_['intersection'](_0x17427e[_0xb353('0x26')],_0x17427e[_0xb353('0x28')]);_0x139007[_0xb353('0x2a')]=_[_0xb353('0x2b')](_0x17427e[_0xb353('0x26')],qs[_0xb353('0x2c')](_0x3a3db0['query'][_0xb353('0x2c')]));_0x139007[_0xb353('0x2a')]=_0x139007[_0xb353('0x2a')][_0xb353('0x2d')]?_0x139007[_0xb353('0x2a')]:_0x17427e[_0xb353('0x26')];if(!_0x3a3db0['query'][_0xb353('0x2e')](_0xb353('0x2f'))){_0x139007[_0xb353('0x30')]=qs['limit'](_0x3a3db0[_0xb353('0x28')]['limit']);_0x139007[_0xb353('0x18')]=qs[_0xb353('0x18')](_0x3a3db0['query'][_0xb353('0x18')]);}_0x139007[_0xb353('0x31')]=qs[_0xb353('0x32')](_0x3a3db0[_0xb353('0x28')]['sort']);_0x139007[_0xb353('0x33')]=qs[_0xb353('0x29')](_['pick'](_0x3a3db0[_0xb353('0x28')],_0x17427e[_0xb353('0x29')]),_0x3299f5);if(_0x3a3db0['query'][_0xb353('0x34')]){_0x139007['where']=_[_0xb353('0x35')](_0x139007['where'],{'$or':_[_0xb353('0x27')](_0x3299f5,function(_0x1c8fd4){if(_0x1c8fd4['type']!==_0xb353('0x36')){var _0x1ade7b={};_0x1ade7b[_0x1c8fd4[_0xb353('0x21')]]={'$like':'%'+_0x3a3db0['query'][_0xb353('0x34')]+'%'};return _0x1ade7b;}})});}_0x139007=_[_0xb353('0x35')]({},_0x139007,_0x3a3db0[_0xb353('0x37')]);var _0x4f0dbf={'where':_0x139007['where']};return db['SquareReport']['count'](_0x4f0dbf)[_0xb353('0x1e')](function(_0x529318){_0x20c788[_0xb353('0x1a')]=_0x529318;if(_0x3a3db0[_0xb353('0x28')][_0xb353('0x38')]){_0x139007[_0xb353('0x39')]=[{'all':!![]}];}return db[_0xb353('0x23')][_0xb353('0x3a')](_0x139007);})['then'](function(_0x13d175){_0x20c788[_0xb353('0x3b')]=_0x13d175;return _0x20c788;})['then'](respondWithFilteredResult(_0x41eecb,_0x139007))['catch'](handleError(_0x41eecb,null));};exports['show']=function(_0x129bc7,_0x514400){var _0x16e4c4={'raw':!![],'where':{'id':_0x129bc7[_0xb353('0x3c')]['id']}},_0x1c68cf={};_0x1c68cf['model']=_[_0xb353('0x3d')](db[_0xb353('0x23')][_0xb353('0x3e')]);_0x1c68cf[_0xb353('0x28')]=_[_0xb353('0x3d')](_0x129bc7['query']);_0x1c68cf[_0xb353('0x29')]=_[_0xb353('0x2b')](_0x1c68cf[_0xb353('0x26')],_0x1c68cf[_0xb353('0x28')]);_0x16e4c4[_0xb353('0x2a')]=_['intersection'](_0x1c68cf[_0xb353('0x26')],qs[_0xb353('0x2c')](_0x129bc7[_0xb353('0x28')][_0xb353('0x2c')]));_0x16e4c4['attributes']=_0x16e4c4[_0xb353('0x2a')][_0xb353('0x2d')]?_0x16e4c4[_0xb353('0x2a')]:_0x1c68cf[_0xb353('0x26')];if(_0x129bc7[_0xb353('0x28')][_0xb353('0x38')]){_0x16e4c4['include']=[{'all':!![]}];}_0x16e4c4=_[_0xb353('0x35')]({},_0x16e4c4,_0x129bc7[_0xb353('0x37')]);return db[_0xb353('0x23')][_0xb353('0x3f')](_0x16e4c4)[_0xb353('0x1e')](handleEntityNotFound(_0x514400,null))[_0xb353('0x1e')](respondWithResult(_0x514400,null))[_0xb353('0x40')](handleError(_0x514400,null));};exports[_0xb353('0x41')]=function(_0x142b9d,_0x3c9ee0){return db[_0xb353('0x23')][_0xb353('0x41')](_0x142b9d['body'],{})[_0xb353('0x1e')](respondWithResult(_0x3c9ee0,0xc9))[_0xb353('0x40')](handleError(_0x3c9ee0,null));};exports[_0xb353('0x42')]=function(_0x34983c,_0x578fef){if(_0x34983c['body']['id']){delete _0x34983c[_0xb353('0x43')]['id'];}return db['SquareReport'][_0xb353('0x3f')]({'where':{'id':_0x34983c['params']['id']}})[_0xb353('0x1e')](handleEntityNotFound(_0x578fef,null))[_0xb353('0x1e')](saveUpdates(_0x34983c['body'],null))[_0xb353('0x1e')](respondWithResult(_0x578fef,null))['catch'](handleError(_0x578fef,null));};exports[_0xb353('0x1f')]=function(_0x2a51b4,_0x34b164){return db[_0xb353('0x23')]['find']({'where':{'id':_0x2a51b4[_0xb353('0x3c')]['id']}})[_0xb353('0x1e')](handleEntityNotFound(_0x34b164,null))['then'](removeEntity(_0x34b164,null))[_0xb353('0x40')](handleError(_0x34b164,null));};exports[_0xb353('0x44')]=function(_0x5efc52,_0x4af176){return db[_0xb353('0x23')][_0xb353('0x44')]()[_0xb353('0x1e')](respondWithResult(_0x4af176,null))[_0xb353('0x40')](handleError(_0x4af176,null));}; \ No newline at end of file +var _0x41c9=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x41c9,0xce));var _0x941c=function(_0x4fe7d5,_0x112c3d){_0x4fe7d5=_0x4fe7d5-0x0;var _0x46e5b3=_0x41c9[_0x4fe7d5];return _0x46e5b3;};'use strict';var emlformat=require(_0x941c('0x0'));var rimraf=require(_0x941c('0x1'));var zipdir=require(_0x941c('0x2'));var jsonpatch=require(_0x941c('0x3'));var rp=require(_0x941c('0x4'));var moment=require(_0x941c('0x5'));var BPromise=require(_0x941c('0x6'));var Mustache=require(_0x941c('0x7'));var util=require(_0x941c('0x8'));var path=require(_0x941c('0x9'));var sox=require(_0x941c('0xa'));var csv=require(_0x941c('0xb'));var ejs=require(_0x941c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x941c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x941c('0xb'));var querystring=require(_0x941c('0xe'));var Papa=require(_0x941c('0xf'));var Redis=require(_0x941c('0x10'));var authService=require(_0x941c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x941c('0x12'));var logger=require(_0x941c('0x13'))(_0x941c('0x14'));var utils=require(_0x941c('0x15'));var config=require(_0x941c('0x16'));var licenseUtil=require(_0x941c('0x17'));var db=require(_0x941c('0x18'))['db'];function respondWithStatusCode(_0x4e9cd1,_0x2f622d){_0x2f622d=_0x2f622d||0xcc;return function(_0x4ec861){if(_0x4ec861){return _0x4e9cd1['sendStatus'](_0x2f622d);}return _0x4e9cd1[_0x941c('0x19')](_0x2f622d)[_0x941c('0x1a')]();};}function respondWithResult(_0x43eecb,_0xe07630){_0xe07630=_0xe07630||0xc8;return function(_0x48ea8a){if(_0x48ea8a){return _0x43eecb[_0x941c('0x19')](_0xe07630)[_0x941c('0x1b')](_0x48ea8a);}};}function respondWithFilteredResult(_0xa4e277,_0x50654e){return function(_0x472d10){if(_0x472d10){var _0x56536f=typeof _0x50654e[_0x941c('0x1c')]==='undefined'&&typeof _0x50654e['limit']==='undefined';var _0xcf5305=_0x472d10[_0x941c('0x1d')];var _0x4933fd=_0x56536f?0x0:_0x50654e[_0x941c('0x1c')];var _0x479a4a=_0x56536f?_0x472d10[_0x941c('0x1d')]:_0x50654e[_0x941c('0x1c')]+_0x50654e[_0x941c('0x1e')];var _0x5dcc9e;if(_0x479a4a>=_0xcf5305){_0x479a4a=_0xcf5305;_0x5dcc9e=0xc8;}else{_0x5dcc9e=0xce;}_0xa4e277[_0x941c('0x19')](_0x5dcc9e);return _0xa4e277[_0x941c('0x1f')](_0x941c('0x20'),_0x4933fd+'-'+_0x479a4a+'/'+_0xcf5305)[_0x941c('0x1b')](_0x472d10);}return null;};}function patchUpdates(_0x4e8852){return function(_0x11fb2c){try{jsonpatch[_0x941c('0x21')](_0x11fb2c,_0x4e8852,!![]);}catch(_0x163000){return BPromise['reject'](_0x163000);}return _0x11fb2c['save']();};}function saveUpdates(_0x3aae7c,_0x331f91){return function(_0x255120){if(_0x255120){return _0x255120['update'](_0x3aae7c)[_0x941c('0x22')](function(_0x454009){return _0x454009;});}return null;};}function removeEntity(_0x1fd914,_0x40b9a6){return function(_0x4a331c){if(_0x4a331c){return _0x4a331c[_0x941c('0x23')]()[_0x941c('0x22')](function(){_0x1fd914[_0x941c('0x19')](0xcc)[_0x941c('0x1a')]();});}};}function handleEntityNotFound(_0x39befd,_0x3f0866){return function(_0x163fc3){if(!_0x163fc3){_0x39befd[_0x941c('0x24')](0x194);}return _0x163fc3;};}function handleError(_0x73a56f,_0x14487c){_0x14487c=_0x14487c||0x1f4;return function(_0x4a9450){logger[_0x941c('0x25')](_0x4a9450[_0x941c('0x26')]);if(_0x4a9450[_0x941c('0x27')]){delete _0x4a9450[_0x941c('0x27')];}_0x73a56f[_0x941c('0x19')](_0x14487c)[_0x941c('0x28')](_0x4a9450);};}exports[_0x941c('0x29')]=function(_0x1ad26a,_0x2efcb9){var _0x571aa1={},_0x1f580b={},_0x10daeb={'count':0x0,'rows':[]};var _0x43d09e=_[_0x941c('0x2a')](db[_0x941c('0x2b')][_0x941c('0x2c')],function(_0x529276){return{'name':_0x529276[_0x941c('0x2d')],'type':_0x529276[_0x941c('0x2e')]['key']};});_0x1f580b['model']=_[_0x941c('0x2a')](_0x43d09e,_0x941c('0x27'));_0x1f580b['query']=_[_0x941c('0x2f')](_0x1ad26a['query']);_0x1f580b[_0x941c('0x30')]=_[_0x941c('0x31')](_0x1f580b[_0x941c('0x32')],_0x1f580b['query']);_0x571aa1[_0x941c('0x33')]=_[_0x941c('0x31')](_0x1f580b[_0x941c('0x32')],qs[_0x941c('0x34')](_0x1ad26a['query'][_0x941c('0x34')]));_0x571aa1[_0x941c('0x33')]=_0x571aa1[_0x941c('0x33')]['length']?_0x571aa1['attributes']:_0x1f580b[_0x941c('0x32')];if(!_0x1ad26a[_0x941c('0x35')][_0x941c('0x36')](_0x941c('0x37'))){_0x571aa1[_0x941c('0x1e')]=qs['limit'](_0x1ad26a[_0x941c('0x35')][_0x941c('0x1e')]);_0x571aa1[_0x941c('0x1c')]=qs[_0x941c('0x1c')](_0x1ad26a[_0x941c('0x35')]['offset']);}_0x571aa1[_0x941c('0x38')]=qs[_0x941c('0x39')](_0x1ad26a['query'][_0x941c('0x39')]);_0x571aa1[_0x941c('0x3a')]=qs[_0x941c('0x30')](_['pick'](_0x1ad26a[_0x941c('0x35')],_0x1f580b[_0x941c('0x30')]),_0x43d09e);if(_0x1ad26a[_0x941c('0x35')][_0x941c('0x3b')]){_0x571aa1['where']=_[_0x941c('0x3c')](_0x571aa1[_0x941c('0x3a')],{'$or':_[_0x941c('0x2a')](_0x43d09e,function(_0xbf6bc){if(_0xbf6bc[_0x941c('0x2e')]!==_0x941c('0x3d')){var _0x3c2bca={};_0x3c2bca[_0xbf6bc[_0x941c('0x27')]]={'$like':'%'+_0x1ad26a[_0x941c('0x35')][_0x941c('0x3b')]+'%'};return _0x3c2bca;}})});}_0x571aa1=_['merge']({},_0x571aa1,_0x1ad26a[_0x941c('0x3e')]);var _0x37f856={'where':_0x571aa1[_0x941c('0x3a')]};return db[_0x941c('0x2b')]['count'](_0x37f856)[_0x941c('0x22')](function(_0x1935ac){_0x10daeb[_0x941c('0x1d')]=_0x1935ac;if(_0x1ad26a[_0x941c('0x35')][_0x941c('0x3f')]){_0x571aa1[_0x941c('0x40')]=[{'all':!![]}];}return db[_0x941c('0x2b')][_0x941c('0x41')](_0x571aa1);})[_0x941c('0x22')](function(_0x1de6cd){_0x10daeb['rows']=_0x1de6cd;return _0x10daeb;})[_0x941c('0x22')](respondWithFilteredResult(_0x2efcb9,_0x571aa1))[_0x941c('0x42')](handleError(_0x2efcb9,null));};exports[_0x941c('0x43')]=function(_0x11e518,_0x180467){var _0x12c8ec={'raw':!![],'where':{'id':_0x11e518[_0x941c('0x44')]['id']}},_0x450ef8={};_0x450ef8[_0x941c('0x32')]=_[_0x941c('0x2f')](db[_0x941c('0x2b')][_0x941c('0x2c')]);_0x450ef8['query']=_[_0x941c('0x2f')](_0x11e518[_0x941c('0x35')]);_0x450ef8['filters']=_['intersection'](_0x450ef8['model'],_0x450ef8['query']);_0x12c8ec[_0x941c('0x33')]=_[_0x941c('0x31')](_0x450ef8[_0x941c('0x32')],qs[_0x941c('0x34')](_0x11e518[_0x941c('0x35')][_0x941c('0x34')]));_0x12c8ec['attributes']=_0x12c8ec['attributes'][_0x941c('0x45')]?_0x12c8ec[_0x941c('0x33')]:_0x450ef8[_0x941c('0x32')];if(_0x11e518[_0x941c('0x35')][_0x941c('0x3f')]){_0x12c8ec[_0x941c('0x40')]=[{'all':!![]}];}_0x12c8ec=_['merge']({},_0x12c8ec,_0x11e518[_0x941c('0x3e')]);return db['SquareReport'][_0x941c('0x46')](_0x12c8ec)['then'](handleEntityNotFound(_0x180467,null))[_0x941c('0x22')](respondWithResult(_0x180467,null))['catch'](handleError(_0x180467,null));};exports[_0x941c('0x47')]=function(_0x507ea6,_0x253de4){return db[_0x941c('0x2b')][_0x941c('0x47')](_0x507ea6['body'],{})[_0x941c('0x22')](respondWithResult(_0x253de4,0xc9))[_0x941c('0x42')](handleError(_0x253de4,null));};exports[_0x941c('0x48')]=function(_0x4ad65a,_0x3f0af9){if(_0x4ad65a[_0x941c('0x49')]['id']){delete _0x4ad65a['body']['id'];}return db['SquareReport'][_0x941c('0x46')]({'where':{'id':_0x4ad65a['params']['id']}})[_0x941c('0x22')](handleEntityNotFound(_0x3f0af9,null))['then'](saveUpdates(_0x4ad65a[_0x941c('0x49')],null))[_0x941c('0x22')](respondWithResult(_0x3f0af9,null))['catch'](handleError(_0x3f0af9,null));};exports['destroy']=function(_0x56718d,_0x361c87){return db['SquareReport'][_0x941c('0x46')]({'where':{'id':_0x56718d[_0x941c('0x44')]['id']}})[_0x941c('0x22')](handleEntityNotFound(_0x361c87,null))[_0x941c('0x22')](removeEntity(_0x361c87,null))[_0x941c('0x42')](handleError(_0x361c87,null));};exports['describe']=function(_0x43628f,_0x3ed6f3){return db[_0x941c('0x2b')][_0x941c('0x4a')]()[_0x941c('0x22')](respondWithResult(_0x3ed6f3,null))['catch'](handleError(_0x3ed6f3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c007b7a..376d084 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 _0x1aeb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','leaveAt','lodash','util'];(function(_0x460494,_0x529a0b){var _0x3d6e05=function(_0x43d029){while(--_0x43d029){_0x460494['push'](_0x460494['shift']());}};_0x3d6e05(++_0x529a0b);}(_0x1aeb,0x14e));var _0xb1ae=function(_0x99096c,_0x898397){_0x99096c=_0x99096c-0x0;var _0x481d3b=_0x1aeb[_0x99096c];return _0x481d3b;};'use strict';var _=require(_0xb1ae('0x0'));var util=require(_0xb1ae('0x1'));var logger=require(_0xb1ae('0x2'))(_0xb1ae('0x3'));var moment=require(_0xb1ae('0x4'));var BPromise=require(_0xb1ae('0x5'));var rp=require(_0xb1ae('0x6'));var fs=require('fs');var path=require(_0xb1ae('0x7'));var rimraf=require(_0xb1ae('0x8'));var config=require(_0xb1ae('0x9'));var attributes=require(_0xb1ae('0xa'));module[_0xb1ae('0xb')]=function(_0x1bf097,_0x4fa66b){return _0x1bf097[_0xb1ae('0xc')](_0xb1ae('0xd'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xb1ae('0xe'),'fields':['uniqueid','project_name']},{'name':_0xb1ae('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bad=['../../config/logger','api','bluebird','request-promise','rimraf','./squareReport.attributes','define','report_square','uniqueid','leaveAt','lodash','util'];(function(_0x5eff6b,_0x199069){var _0x2a22b6=function(_0x2249ae){while(--_0x2249ae){_0x5eff6b['push'](_0x5eff6b['shift']());}};_0x2a22b6(++_0x199069);}(_0x5bad,0x106));var _0xd5ba=function(_0x530611,_0x308a3c){_0x530611=_0x530611-0x0;var _0x35aded=_0x5bad[_0x530611];return _0x35aded;};'use strict';var _=require(_0xd5ba('0x0'));var util=require(_0xd5ba('0x1'));var logger=require(_0xd5ba('0x2'))(_0xd5ba('0x3'));var moment=require('moment');var BPromise=require(_0xd5ba('0x4'));var rp=require(_0xd5ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5ba('0x7'));module['exports']=function(_0x4580ad,_0xacbbc5){return _0x4580ad[_0xd5ba('0x8')]('SquareReport',attributes,{'tableName':_0xd5ba('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd5ba('0xa'),'project_name']},{'name':_0xd5ba('0xb'),'fields':[_0xd5ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 6f8b833..9f369f9 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 _0xff07=['request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','create','body','options','raw','then','catch','SquareReport','update','where','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','info','SquareReport,\x20%s,\x20%s'];(function(_0x5a3ab8,_0x5c9511){var _0x1a0ffa=function(_0x679894){while(--_0x679894){_0x5a3ab8['push'](_0x5a3ab8['shift']());}};_0x1a0ffa(++_0x5c9511);}(_0xff07,0x1f3));var _0x7ff0=function(_0x4c2bdc,_0x5915d7){_0x4c2bdc=_0x4c2bdc-0x0;var _0x5a3222=_0xff07[_0x4c2bdc];return _0x5a3222;};'use strict';var _=require(_0x7ff0('0x0'));var util=require(_0x7ff0('0x1'));var moment=require(_0x7ff0('0x2'));var BPromise=require(_0x7ff0('0x3'));var rs=require(_0x7ff0('0x4'));var fs=require('fs');var Redis=require(_0x7ff0('0x5'));var db=require(_0x7ff0('0x6'))['db'];var utils=require(_0x7ff0('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ff0('0x8')][_0x7ff0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd581,_0x54aa02,_0x125012){return new BPromise(function(_0x8ae2d7,_0x58b791){return client[_0x7ff0('0xa')](_0x2fd581,_0x125012)['then'](function(_0x4001c4){logger[_0x7ff0('0xb')](_0x7ff0('0xc'),_0x54aa02,_0x7ff0('0xd'));logger[_0x7ff0('0xe')](_0x7ff0('0xf'),_0x54aa02,_0x7ff0('0xd'),JSON[_0x7ff0('0x10')](_0x4001c4));if(_0x4001c4[_0x7ff0('0x11')]){if(_0x4001c4[_0x7ff0('0x11')][_0x7ff0('0x12')]===0x1f4){logger[_0x7ff0('0x11')]('SquareReport,\x20%s,\x20%s',_0x54aa02,_0x4001c4[_0x7ff0('0x11')][_0x7ff0('0x13')]);return _0x58b791(_0x4001c4['error'][_0x7ff0('0x13')]);}logger[_0x7ff0('0x11')]('SquareReport,\x20%s,\x20%s',_0x54aa02,_0x4001c4[_0x7ff0('0x11')]['message']);return _0x8ae2d7(_0x4001c4[_0x7ff0('0x11')][_0x7ff0('0x13')]);}else{logger['info'](_0x7ff0('0xc'),_0x54aa02,_0x7ff0('0xd'));_0x8ae2d7(_0x4001c4[_0x7ff0('0x14')][_0x7ff0('0x13')]);}})['catch'](function(_0x109535){logger[_0x7ff0('0x11')]('SquareReport,\x20%s,\x20%s',_0x54aa02,_0x109535);_0x58b791(_0x109535);});});}exports[_0x7ff0('0x15')]=function(_0x27067c){var _0x26ca11=this;return new Promise(function(_0x4413da,_0x5aae4c){return db['SquareReport'][_0x7ff0('0x16')](_0x27067c[_0x7ff0('0x17')],{'raw':_0x27067c[_0x7ff0('0x18')]?_0x27067c['options'][_0x7ff0('0x19')]===undefined?!![]:![]:!![]})[_0x7ff0('0x1a')](function(_0x4aba3f){logger[_0x7ff0('0xb')](_0x7ff0('0x15'),_0x27067c);logger[_0x7ff0('0xe')](_0x7ff0('0x15'),_0x27067c,JSON[_0x7ff0('0x10')](_0x4aba3f));_0x4413da(_0x4aba3f);})[_0x7ff0('0x1b')](function(_0x897d19){logger[_0x7ff0('0x11')](_0x7ff0('0x15'),_0x897d19['message'],_0x27067c);_0x5aae4c(_0x26ca11[_0x7ff0('0x11')](0x1f4,_0x897d19['message']));});});};exports['UpdateSquareReport']=function(_0x5bfd8e){var _0x701ddc=this;return new Promise(function(_0x281a65,_0x43214c){return db[_0x7ff0('0x1c')][_0x7ff0('0x1d')](_0x5bfd8e[_0x7ff0('0x17')],{'raw':_0x5bfd8e['options']?_0x5bfd8e[_0x7ff0('0x18')][_0x7ff0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bfd8e[_0x7ff0('0x18')]?_0x5bfd8e['options'][_0x7ff0('0x1e')]||null:null,'attributes':_0x5bfd8e[_0x7ff0('0x18')]?_0x5bfd8e[_0x7ff0('0x18')]['attributes']||null:null,'limit':_0x5bfd8e[_0x7ff0('0x18')]?_0x5bfd8e[_0x7ff0('0x18')]['limit']||null:null})[_0x7ff0('0x1a')](function(_0x37b7ed){logger[_0x7ff0('0xb')](_0x7ff0('0x1f'),_0x5bfd8e);logger[_0x7ff0('0xe')]('UpdateSquareReport',_0x5bfd8e,JSON[_0x7ff0('0x10')](_0x37b7ed));_0x281a65(_0x37b7ed);})[_0x7ff0('0x1b')](function(_0x73836c){logger[_0x7ff0('0x11')](_0x7ff0('0x1f'),_0x73836c[_0x7ff0('0x13')],_0x5bfd8e);_0x43214c(_0x701ddc[_0x7ff0('0x11')](0x1f4,_0x73836c[_0x7ff0('0x13')]));});});}; \ No newline at end of file +var _0x1f99=['../../config/utils','rpc','../../config/environment','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','CreateSquareReport','SquareReport','create','options','debug','stringify','body','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3576e9,_0x1c581b){var _0x5c959d=function(_0x7a72d6){while(--_0x7a72d6){_0x3576e9['push'](_0x3576e9['shift']());}};_0x5c959d(++_0x1c581b);}(_0x1f99,0x11c));var _0x91f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91f9('0x0'));var util=require(_0x91f9('0x1'));var moment=require(_0x91f9('0x2'));var BPromise=require(_0x91f9('0x3'));var rs=require(_0x91f9('0x4'));var fs=require('fs');var Redis=require(_0x91f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91f9('0x6'));var logger=require('../../config/logger')(_0x91f9('0x7'));var config=require(_0x91f9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f1a78,_0x2c1769,_0xc015f2){return new BPromise(function(_0x1f2d20,_0x48706c){return client[_0x91f9('0xa')](_0x9f1a78,_0xc015f2)[_0x91f9('0xb')](function(_0x1352f3){logger['info'](_0x91f9('0xc'),_0x2c1769,_0x91f9('0xd'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x2c1769,_0x91f9('0xd'),JSON['stringify'](_0x1352f3));if(_0x1352f3[_0x91f9('0xe')]){if(_0x1352f3[_0x91f9('0xe')][_0x91f9('0xf')]===0x1f4){logger[_0x91f9('0xe')](_0x91f9('0xc'),_0x2c1769,_0x1352f3[_0x91f9('0xe')][_0x91f9('0x10')]);return _0x48706c(_0x1352f3[_0x91f9('0xe')][_0x91f9('0x10')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x2c1769,_0x1352f3[_0x91f9('0xe')][_0x91f9('0x10')]);return _0x1f2d20(_0x1352f3[_0x91f9('0xe')]['message']);}else{logger[_0x91f9('0x11')](_0x91f9('0xc'),_0x2c1769,_0x91f9('0xd'));_0x1f2d20(_0x1352f3['result'][_0x91f9('0x10')]);}})[_0x91f9('0x12')](function(_0xb7b705){logger['error'](_0x91f9('0xc'),_0x2c1769,_0xb7b705);_0x48706c(_0xb7b705);});});}exports[_0x91f9('0x13')]=function(_0xcfdcfe){var _0x1a0eb8=this;return new Promise(function(_0x329c87,_0x4c5e4d){return db[_0x91f9('0x14')][_0x91f9('0x15')](_0xcfdcfe['body'],{'raw':_0xcfdcfe[_0x91f9('0x16')]?_0xcfdcfe['options']['raw']===undefined?!![]:![]:!![]})[_0x91f9('0xb')](function(_0x2483a7){logger[_0x91f9('0x11')](_0x91f9('0x13'),_0xcfdcfe);logger[_0x91f9('0x17')](_0x91f9('0x13'),_0xcfdcfe,JSON[_0x91f9('0x18')](_0x2483a7));_0x329c87(_0x2483a7);})[_0x91f9('0x12')](function(_0x2efeb2){logger['error'](_0x91f9('0x13'),_0x2efeb2[_0x91f9('0x10')],_0xcfdcfe);_0x4c5e4d(_0x1a0eb8[_0x91f9('0xe')](0x1f4,_0x2efeb2[_0x91f9('0x10')]));});});};exports['UpdateSquareReport']=function(_0x8b1c59){var _0x44d46d=this;return new Promise(function(_0x288e9d,_0x147174){return db['SquareReport']['update'](_0x8b1c59[_0x91f9('0x19')],{'raw':_0x8b1c59[_0x91f9('0x16')]?_0x8b1c59['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8b1c59[_0x91f9('0x16')]?_0x8b1c59['options']['where']||null:null,'attributes':_0x8b1c59[_0x91f9('0x16')]?_0x8b1c59[_0x91f9('0x16')][_0x91f9('0x1a')]||null:null,'limit':_0x8b1c59[_0x91f9('0x16')]?_0x8b1c59[_0x91f9('0x16')][_0x91f9('0x1b')]||null:null})[_0x91f9('0xb')](function(_0x4b2b08){logger[_0x91f9('0x11')]('UpdateSquareReport',_0x8b1c59);logger[_0x91f9('0x17')](_0x91f9('0x1c'),_0x8b1c59,JSON[_0x91f9('0x18')](_0x4b2b08));_0x288e9d(_0x4b2b08);})[_0x91f9('0x12')](function(_0x7f8a4e){logger[_0x91f9('0xe')](_0x91f9('0x1c'),_0x7f8a4e[_0x91f9('0x10')],_0x8b1c59);_0x147174(_0x44d46d[_0x91f9('0xe')](0x1f4,_0x7f8a4e[_0x91f9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0c462f1..2dd941b 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 _0xbdc5=['post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','get','isAuthenticated','show'];(function(_0x325d36,_0x7c6b84){var _0x27193e=function(_0x1d4790){while(--_0x1d4790){_0x325d36['push'](_0x325d36['shift']());}};_0x27193e(++_0x7c6b84);}(_0xbdc5,0x8c));var _0x5bdc=function(_0xe05a51,_0x573bf3){_0xe05a51=_0xe05a51-0x0;var _0x1f87e5=_0xbdc5[_0xe05a51];return _0x1f87e5;};'use strict';var multer=require(_0x5bdc('0x0'));var util=require(_0x5bdc('0x1'));var path=require(_0x5bdc('0x2'));var timeout=require(_0x5bdc('0x3'));var express=require(_0x5bdc('0x4'));var router=express[_0x5bdc('0x5')]();var fs_extra=require(_0x5bdc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bdc('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5bdc('0x8')]);router[_0x5bdc('0x9')]('/describe',auth[_0x5bdc('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5bdc('0xb')]);router[_0x5bdc('0xc')]('/',auth[_0x5bdc('0xa')](),controller['create']);router[_0x5bdc('0xd')](_0x5bdc('0xe'),auth['isAuthenticated'](),controller[_0x5bdc('0xf')]);router[_0x5bdc('0x10')]('/:id',auth[_0x5bdc('0xa')](),controller[_0x5bdc('0x11')]);module[_0x5bdc('0x12')]=router; \ No newline at end of file +var _0xda95=['show','post','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe'];(function(_0x3213b7,_0x6789ca){var _0xb960bf=function(_0x2f7f04){while(--_0x2f7f04){_0x3213b7['push'](_0x3213b7['shift']());}};_0xb960bf(++_0x6789ca);}(_0xda95,0x15c));var _0x5da9=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xda95[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0x5da9('0x0'));var util=require(_0x5da9('0x1'));var path=require('path');var timeout=require(_0x5da9('0x2'));var express=require(_0x5da9('0x3'));var router=express[_0x5da9('0x4')]();var fs_extra=require(_0x5da9('0x5'));var auth=require(_0x5da9('0x6'));var interaction=require(_0x5da9('0x7'));var config=require(_0x5da9('0x8'));var controller=require(_0x5da9('0x9'));router[_0x5da9('0xa')]('/',auth[_0x5da9('0xb')](),controller['index']);router[_0x5da9('0xa')](_0x5da9('0xc'),auth[_0x5da9('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5da9('0xb')](),controller[_0x5da9('0xd')]);router[_0x5da9('0xe')]('/',auth[_0x5da9('0xb')](),controller['create']);router['put']('/:id',auth[_0x5da9('0xb')](),controller['update']);router[_0x5da9('0xf')](_0x5da9('0x10'),auth['isAuthenticated'](),controller[_0x5da9('0x11')]);module[_0x5da9('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 4239885..4522c12 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 _0xafdb=['exports','STRING','TEXT','sequelize'];(function(_0x69fa12,_0x12f4eb){var _0x497313=function(_0x1236f9){while(--_0x1236f9){_0x69fa12['push'](_0x69fa12['shift']());}};_0x497313(++_0x12f4eb);}(_0xafdb,0x77));var _0xbafd=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0xafdb[_0x4226d6];return _0x19655b;};'use strict';var Sequelize=require(_0xbafd('0x0'));module[_0xbafd('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xbafd('0x2')]},'application':{'type':Sequelize[_0xbafd('0x2')]},'data':{'type':Sequelize[_0xbafd('0x3')]},'project_name':{'type':Sequelize[_0xbafd('0x2')]},'callerid':{'type':Sequelize[_0xbafd('0x2')]}}; \ No newline at end of file +var _0x5874=['TEXT','sequelize','exports','STRING'];(function(_0x131389,_0x2fd67d){var _0x553a27=function(_0x1070ee){while(--_0x1070ee){_0x131389['push'](_0x131389['shift']());}};_0x553a27(++_0x2fd67d);}(_0x5874,0xd1));var _0x4587=function(_0x46a00c,_0x1e5aa0){_0x46a00c=_0x46a00c-0x0;var _0x299f95=_0x5874[_0x46a00c];return _0x299f95;};'use strict';var Sequelize=require(_0x4587('0x0'));module[_0x4587('0x1')]={'uniqueid':{'type':Sequelize[_0x4587('0x2')]},'node':{'type':Sequelize[_0x4587('0x2')]},'application':{'type':Sequelize[_0x4587('0x2')]},'data':{'type':Sequelize[_0x4587('0x3')]},'project_name':{'type':Sequelize[_0x4587('0x2')]},'callerid':{'type':Sequelize[_0x4587('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6cb723c..a7a50f2 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 _0x38b6=['limit','count','Content-Range','apply','save','then','error','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x3428ee,_0x4d9716){var _0x4e653c=function(_0x354c59){while(--_0x354c59){_0x3428ee['push'](_0x3428ee['shift']());}};_0x4e653c(++_0x4d9716);}(_0x38b6,0x14f));var _0x638b=function(_0x2c246c,_0x361329){_0x2c246c=_0x2c246c-0x0;var _0x38bb3f=_0x38b6[_0x2c246c];return _0x38bb3f;};'use strict';var emlformat=require(_0x638b('0x0'));var rimraf=require(_0x638b('0x1'));var zipdir=require(_0x638b('0x2'));var jsonpatch=require(_0x638b('0x3'));var rp=require(_0x638b('0x4'));var moment=require('moment');var BPromise=require(_0x638b('0x5'));var Mustache=require(_0x638b('0x6'));var util=require(_0x638b('0x7'));var path=require(_0x638b('0x8'));var sox=require('sox');var csv=require(_0x638b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x638b('0xa'));var _=require(_0x638b('0xb'));var squel=require(_0x638b('0xc'));var crypto=require(_0x638b('0xd'));var jsforce=require(_0x638b('0xe'));var deskjs=require(_0x638b('0xf'));var toCsv=require(_0x638b('0x9'));var querystring=require(_0x638b('0x10'));var Papa=require(_0x638b('0x11'));var Redis=require(_0x638b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x638b('0x13'));var as=require(_0x638b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x638b('0x15'))('api');var utils=require(_0x638b('0x16'));var config=require(_0x638b('0x17'));var licenseUtil=require(_0x638b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b7a57,_0x8dc350){_0x8dc350=_0x8dc350||0xcc;return function(_0x1eca3d){if(_0x1eca3d){return _0x3b7a57[_0x638b('0x19')](_0x8dc350);}return _0x3b7a57[_0x638b('0x1a')](_0x8dc350)[_0x638b('0x1b')]();};}function respondWithResult(_0x138bb2,_0xe1417f){_0xe1417f=_0xe1417f||0xc8;return function(_0x26e14c){if(_0x26e14c){return _0x138bb2[_0x638b('0x1a')](_0xe1417f)[_0x638b('0x1c')](_0x26e14c);}};}function respondWithFilteredResult(_0x482f86,_0x2926f5){return function(_0x49bbca){if(_0x49bbca){var _0xd160de=typeof _0x2926f5[_0x638b('0x1d')]==='undefined'&&typeof _0x2926f5[_0x638b('0x1e')]==='undefined';var _0x470e32=_0x49bbca[_0x638b('0x1f')];var _0x56a77d=_0xd160de?0x0:_0x2926f5[_0x638b('0x1d')];var _0x448422=_0xd160de?_0x49bbca[_0x638b('0x1f')]:_0x2926f5[_0x638b('0x1d')]+_0x2926f5['limit'];var _0x4bb0ce;if(_0x448422>=_0x470e32){_0x448422=_0x470e32;_0x4bb0ce=0xc8;}else{_0x4bb0ce=0xce;}_0x482f86[_0x638b('0x1a')](_0x4bb0ce);return _0x482f86['set'](_0x638b('0x20'),_0x56a77d+'-'+_0x448422+'/'+_0x470e32)[_0x638b('0x1c')](_0x49bbca);}return null;};}function patchUpdates(_0x2adbb6){return function(_0x43b8da){try{jsonpatch[_0x638b('0x21')](_0x43b8da,_0x2adbb6,!![]);}catch(_0x280699){return BPromise['reject'](_0x280699);}return _0x43b8da[_0x638b('0x22')]();};}function saveUpdates(_0x11b693,_0x4fe457){return function(_0x3ea866){if(_0x3ea866){return _0x3ea866['update'](_0x11b693)[_0x638b('0x23')](function(_0x2a46b7){return _0x2a46b7;});}return null;};}function removeEntity(_0x5a168e,_0x22331c){return function(_0x33b2ca){if(_0x33b2ca){return _0x33b2ca['destroy']()[_0x638b('0x23')](function(){_0x5a168e[_0x638b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca741,_0x49babf){return function(_0x40eebd){if(!_0x40eebd){_0x5ca741[_0x638b('0x19')](0x194);}return _0x40eebd;};}function handleError(_0x52cf9a,_0x5ccaa0){_0x5ccaa0=_0x5ccaa0||0x1f4;return function(_0x957efc){logger[_0x638b('0x24')](_0x957efc['stack']);if(_0x957efc[_0x638b('0x25')]){delete _0x957efc[_0x638b('0x25')];}_0x52cf9a['status'](_0x5ccaa0)[_0x638b('0x26')](_0x957efc);};}exports[_0x638b('0x27')]=function(_0x1b0251,_0x4c64a0){var _0x17215c={},_0x286aa6={},_0x3b8abb={'count':0x0,'rows':[]};var _0x50b50c=_['map'](db[_0x638b('0x28')][_0x638b('0x29')],function(_0x234dfa){return{'name':_0x234dfa[_0x638b('0x2a')],'type':_0x234dfa[_0x638b('0x2b')][_0x638b('0x2c')]};});_0x286aa6[_0x638b('0x2d')]=_[_0x638b('0x2e')](_0x50b50c,_0x638b('0x25'));_0x286aa6[_0x638b('0x2f')]=_[_0x638b('0x30')](_0x1b0251[_0x638b('0x2f')]);_0x286aa6[_0x638b('0x31')]=_[_0x638b('0x32')](_0x286aa6[_0x638b('0x2d')],_0x286aa6[_0x638b('0x2f')]);_0x17215c[_0x638b('0x33')]=_[_0x638b('0x32')](_0x286aa6[_0x638b('0x2d')],qs[_0x638b('0x34')](_0x1b0251[_0x638b('0x2f')]['fields']));_0x17215c[_0x638b('0x33')]=_0x17215c[_0x638b('0x33')][_0x638b('0x35')]?_0x17215c[_0x638b('0x33')]:_0x286aa6[_0x638b('0x2d')];if(!_0x1b0251['query'][_0x638b('0x36')](_0x638b('0x37'))){_0x17215c[_0x638b('0x1e')]=qs[_0x638b('0x1e')](_0x1b0251[_0x638b('0x2f')]['limit']);_0x17215c[_0x638b('0x1d')]=qs[_0x638b('0x1d')](_0x1b0251[_0x638b('0x2f')][_0x638b('0x1d')]);}_0x17215c['order']=qs[_0x638b('0x38')](_0x1b0251[_0x638b('0x2f')][_0x638b('0x38')]);_0x17215c[_0x638b('0x39')]=qs['filters'](_[_0x638b('0x3a')](_0x1b0251['query'],_0x286aa6[_0x638b('0x31')]),_0x50b50c);if(_0x1b0251['query'][_0x638b('0x3b')]){_0x17215c[_0x638b('0x39')]=_[_0x638b('0x3c')](_0x17215c[_0x638b('0x39')],{'$or':_['map'](_0x50b50c,function(_0x39b657){if(_0x39b657[_0x638b('0x2b')]!=='VIRTUAL'){var _0x57951e={};_0x57951e[_0x39b657[_0x638b('0x25')]]={'$like':'%'+_0x1b0251[_0x638b('0x2f')][_0x638b('0x3b')]+'%'};return _0x57951e;}})});}_0x17215c=_['merge']({},_0x17215c,_0x1b0251['options']);var _0x54f9d6={'where':_0x17215c[_0x638b('0x39')]};return db[_0x638b('0x28')][_0x638b('0x1f')](_0x54f9d6)[_0x638b('0x23')](function(_0x355f54){_0x3b8abb[_0x638b('0x1f')]=_0x355f54;if(_0x1b0251[_0x638b('0x2f')][_0x638b('0x3d')]){_0x17215c[_0x638b('0x3e')]=[{'all':!![]}];}return db[_0x638b('0x28')][_0x638b('0x3f')](_0x17215c);})[_0x638b('0x23')](function(_0x1174c4){_0x3b8abb[_0x638b('0x40')]=_0x1174c4;return _0x3b8abb;})[_0x638b('0x23')](respondWithFilteredResult(_0x4c64a0,_0x17215c))[_0x638b('0x41')](handleError(_0x4c64a0,null));};exports['show']=function(_0x233736,_0x4c02c2){var _0x24d5be={'raw':!![],'where':{'id':_0x233736['params']['id']}},_0x20eb8f={};_0x20eb8f[_0x638b('0x2d')]=_['keys'](db[_0x638b('0x28')][_0x638b('0x29')]);_0x20eb8f[_0x638b('0x2f')]=_[_0x638b('0x30')](_0x233736[_0x638b('0x2f')]);_0x20eb8f['filters']=_[_0x638b('0x32')](_0x20eb8f[_0x638b('0x2d')],_0x20eb8f[_0x638b('0x2f')]);_0x24d5be[_0x638b('0x33')]=_[_0x638b('0x32')](_0x20eb8f['model'],qs[_0x638b('0x34')](_0x233736['query'][_0x638b('0x34')]));_0x24d5be[_0x638b('0x33')]=_0x24d5be[_0x638b('0x33')][_0x638b('0x35')]?_0x24d5be[_0x638b('0x33')]:_0x20eb8f[_0x638b('0x2d')];if(_0x233736['query'][_0x638b('0x3d')]){_0x24d5be[_0x638b('0x3e')]=[{'all':!![]}];}_0x24d5be=_[_0x638b('0x3c')]({},_0x24d5be,_0x233736[_0x638b('0x42')]);return db['SquareDetailsReport'][_0x638b('0x43')](_0x24d5be)[_0x638b('0x23')](handleEntityNotFound(_0x4c02c2,null))[_0x638b('0x23')](respondWithResult(_0x4c02c2,null))['catch'](handleError(_0x4c02c2,null));};exports[_0x638b('0x44')]=function(_0x2d8795,_0x360eb9){return db['SquareDetailsReport'][_0x638b('0x44')](_0x2d8795[_0x638b('0x45')],{})[_0x638b('0x23')](respondWithResult(_0x360eb9,0xc9))['catch'](handleError(_0x360eb9,null));};exports[_0x638b('0x46')]=function(_0x905429,_0x4a9603){if(_0x905429[_0x638b('0x45')]['id']){delete _0x905429[_0x638b('0x45')]['id'];}return db[_0x638b('0x28')][_0x638b('0x43')]({'where':{'id':_0x905429['params']['id']}})[_0x638b('0x23')](handleEntityNotFound(_0x4a9603,null))[_0x638b('0x23')](saveUpdates(_0x905429[_0x638b('0x45')],null))['then'](respondWithResult(_0x4a9603,null))[_0x638b('0x41')](handleError(_0x4a9603,null));};exports[_0x638b('0x47')]=function(_0x80dd60,_0x2cb05d){return db['SquareDetailsReport'][_0x638b('0x43')]({'where':{'id':_0x80dd60['params']['id']}})[_0x638b('0x23')](handleEntityNotFound(_0x2cb05d,null))[_0x638b('0x23')](removeEntity(_0x2cb05d,null))[_0x638b('0x41')](handleError(_0x2cb05d,null));};exports[_0x638b('0x48')]=function(_0x38cf58,_0xb0e906){return db[_0x638b('0x28')]['describe']()['then'](respondWithResult(_0xb0e906,null))[_0x638b('0x41')](handleError(_0xb0e906,null));}; \ No newline at end of file +var _0xb8b2=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','index','map','SquareDetailsReport','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','lodash'];(function(_0x844484,_0x111e5f){var _0x3de9fa=function(_0x3155ad){while(--_0x3155ad){_0x844484['push'](_0x844484['shift']());}};_0x3de9fa(++_0x111e5f);}(_0xb8b2,0x11a));var _0x2b8b=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xb8b2[_0x59162a];return _0x35e50d;};'use strict';var emlformat=require(_0x2b8b('0x0'));var rimraf=require(_0x2b8b('0x1'));var zipdir=require(_0x2b8b('0x2'));var jsonpatch=require(_0x2b8b('0x3'));var rp=require('request-promise');var moment=require(_0x2b8b('0x4'));var BPromise=require(_0x2b8b('0x5'));var Mustache=require('mustache');var util=require(_0x2b8b('0x6'));var path=require(_0x2b8b('0x7'));var sox=require(_0x2b8b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b8b('0x9'));var squel=require(_0x2b8b('0xa'));var crypto=require('crypto');var jsforce=require(_0x2b8b('0xb'));var deskjs=require(_0x2b8b('0xc'));var toCsv=require(_0x2b8b('0xd'));var querystring=require(_0x2b8b('0xe'));var Papa=require(_0x2b8b('0xf'));var Redis=require(_0x2b8b('0x10'));var authService=require(_0x2b8b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b8b('0x12'));var hardwareService=require(_0x2b8b('0x13'));var logger=require(_0x2b8b('0x14'))(_0x2b8b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18b7ec,_0x487676){_0x487676=_0x487676||0xcc;return function(_0x4d434e){if(_0x4d434e){return _0x18b7ec['sendStatus'](_0x487676);}return _0x18b7ec['status'](_0x487676)[_0x2b8b('0x16')]();};}function respondWithResult(_0x3de7e5,_0xf38bbb){_0xf38bbb=_0xf38bbb||0xc8;return function(_0x2bf934){if(_0x2bf934){return _0x3de7e5[_0x2b8b('0x17')](_0xf38bbb)['json'](_0x2bf934);}};}function respondWithFilteredResult(_0x4c9822,_0x575561){return function(_0x10b72d){if(_0x10b72d){var _0x524a6d=typeof _0x575561['offset']==='undefined'&&typeof _0x575561[_0x2b8b('0x18')]===_0x2b8b('0x19');var _0xcfc6a5=_0x10b72d[_0x2b8b('0x1a')];var _0x2f2df5=_0x524a6d?0x0:_0x575561['offset'];var _0x5d7923=_0x524a6d?_0x10b72d[_0x2b8b('0x1a')]:_0x575561[_0x2b8b('0x1b')]+_0x575561[_0x2b8b('0x18')];var _0x11a853;if(_0x5d7923>=_0xcfc6a5){_0x5d7923=_0xcfc6a5;_0x11a853=0xc8;}else{_0x11a853=0xce;}_0x4c9822[_0x2b8b('0x17')](_0x11a853);return _0x4c9822['set'](_0x2b8b('0x1c'),_0x2f2df5+'-'+_0x5d7923+'/'+_0xcfc6a5)[_0x2b8b('0x1d')](_0x10b72d);}return null;};}function patchUpdates(_0xc05258){return function(_0x44cd91){try{jsonpatch[_0x2b8b('0x1e')](_0x44cd91,_0xc05258,!![]);}catch(_0x30fec1){return BPromise[_0x2b8b('0x1f')](_0x30fec1);}return _0x44cd91[_0x2b8b('0x20')]();};}function saveUpdates(_0x24458a,_0x51d344){return function(_0x293413){if(_0x293413){return _0x293413[_0x2b8b('0x21')](_0x24458a)[_0x2b8b('0x22')](function(_0x161800){return _0x161800;});}return null;};}function removeEntity(_0x29d0b8,_0x25cbee){return function(_0x36b1f3){if(_0x36b1f3){return _0x36b1f3['destroy']()[_0x2b8b('0x22')](function(){_0x29d0b8['status'](0xcc)[_0x2b8b('0x16')]();});}};}function handleEntityNotFound(_0x3fdb3e,_0xbe199a){return function(_0x14b194){if(!_0x14b194){_0x3fdb3e[_0x2b8b('0x23')](0x194);}return _0x14b194;};}function handleError(_0x3eca2d,_0x48e821){_0x48e821=_0x48e821||0x1f4;return function(_0x2a6026){logger[_0x2b8b('0x24')](_0x2a6026['stack']);if(_0x2a6026[_0x2b8b('0x25')]){delete _0x2a6026[_0x2b8b('0x25')];}_0x3eca2d['status'](_0x48e821)[_0x2b8b('0x26')](_0x2a6026);};}exports[_0x2b8b('0x27')]=function(_0x369f05,_0x291dc4){var _0x114e97={},_0x37c08f={},_0x49f7d5={'count':0x0,'rows':[]};var _0x379490=_[_0x2b8b('0x28')](db[_0x2b8b('0x29')]['rawAttributes'],function(_0x20df77){return{'name':_0x20df77[_0x2b8b('0x2a')],'type':_0x20df77['type']['key']};});_0x37c08f[_0x2b8b('0x2b')]=_['map'](_0x379490,_0x2b8b('0x25'));_0x37c08f[_0x2b8b('0x2c')]=_[_0x2b8b('0x2d')](_0x369f05[_0x2b8b('0x2c')]);_0x37c08f['filters']=_['intersection'](_0x37c08f['model'],_0x37c08f[_0x2b8b('0x2c')]);_0x114e97['attributes']=_[_0x2b8b('0x2e')](_0x37c08f['model'],qs['fields'](_0x369f05['query']['fields']));_0x114e97[_0x2b8b('0x2f')]=_0x114e97[_0x2b8b('0x2f')][_0x2b8b('0x30')]?_0x114e97[_0x2b8b('0x2f')]:_0x37c08f[_0x2b8b('0x2b')];if(!_0x369f05[_0x2b8b('0x2c')][_0x2b8b('0x31')](_0x2b8b('0x32'))){_0x114e97[_0x2b8b('0x18')]=qs[_0x2b8b('0x18')](_0x369f05[_0x2b8b('0x2c')][_0x2b8b('0x18')]);_0x114e97[_0x2b8b('0x1b')]=qs[_0x2b8b('0x1b')](_0x369f05[_0x2b8b('0x2c')]['offset']);}_0x114e97[_0x2b8b('0x33')]=qs['sort'](_0x369f05[_0x2b8b('0x2c')][_0x2b8b('0x34')]);_0x114e97[_0x2b8b('0x35')]=qs['filters'](_[_0x2b8b('0x36')](_0x369f05[_0x2b8b('0x2c')],_0x37c08f[_0x2b8b('0x37')]),_0x379490);if(_0x369f05[_0x2b8b('0x2c')][_0x2b8b('0x38')]){_0x114e97[_0x2b8b('0x35')]=_[_0x2b8b('0x39')](_0x114e97['where'],{'$or':_[_0x2b8b('0x28')](_0x379490,function(_0x39a2bd){if(_0x39a2bd[_0x2b8b('0x3a')]!==_0x2b8b('0x3b')){var _0xfef4c={};_0xfef4c[_0x39a2bd['name']]={'$like':'%'+_0x369f05[_0x2b8b('0x2c')]['filter']+'%'};return _0xfef4c;}})});}_0x114e97=_[_0x2b8b('0x39')]({},_0x114e97,_0x369f05['options']);var _0x50573f={'where':_0x114e97[_0x2b8b('0x35')]};return db[_0x2b8b('0x29')][_0x2b8b('0x1a')](_0x50573f)[_0x2b8b('0x22')](function(_0x41329d){_0x49f7d5[_0x2b8b('0x1a')]=_0x41329d;if(_0x369f05[_0x2b8b('0x2c')]['includeAll']){_0x114e97['include']=[{'all':!![]}];}return db[_0x2b8b('0x29')][_0x2b8b('0x3c')](_0x114e97);})[_0x2b8b('0x22')](function(_0x3e06d2){_0x49f7d5[_0x2b8b('0x3d')]=_0x3e06d2;return _0x49f7d5;})[_0x2b8b('0x22')](respondWithFilteredResult(_0x291dc4,_0x114e97))[_0x2b8b('0x3e')](handleError(_0x291dc4,null));};exports[_0x2b8b('0x3f')]=function(_0x147268,_0x54362a){var _0x4879bc={'raw':!![],'where':{'id':_0x147268[_0x2b8b('0x40')]['id']}},_0x3c1e84={};_0x3c1e84[_0x2b8b('0x2b')]=_['keys'](db[_0x2b8b('0x29')][_0x2b8b('0x41')]);_0x3c1e84[_0x2b8b('0x2c')]=_[_0x2b8b('0x2d')](_0x147268[_0x2b8b('0x2c')]);_0x3c1e84['filters']=_['intersection'](_0x3c1e84[_0x2b8b('0x2b')],_0x3c1e84[_0x2b8b('0x2c')]);_0x4879bc[_0x2b8b('0x2f')]=_['intersection'](_0x3c1e84[_0x2b8b('0x2b')],qs['fields'](_0x147268[_0x2b8b('0x2c')]['fields']));_0x4879bc[_0x2b8b('0x2f')]=_0x4879bc[_0x2b8b('0x2f')][_0x2b8b('0x30')]?_0x4879bc[_0x2b8b('0x2f')]:_0x3c1e84[_0x2b8b('0x2b')];if(_0x147268[_0x2b8b('0x2c')][_0x2b8b('0x42')]){_0x4879bc['include']=[{'all':!![]}];}_0x4879bc=_[_0x2b8b('0x39')]({},_0x4879bc,_0x147268[_0x2b8b('0x43')]);return db[_0x2b8b('0x29')][_0x2b8b('0x44')](_0x4879bc)[_0x2b8b('0x22')](handleEntityNotFound(_0x54362a,null))[_0x2b8b('0x22')](respondWithResult(_0x54362a,null))['catch'](handleError(_0x54362a,null));};exports[_0x2b8b('0x45')]=function(_0x43a1aa,_0x533cc9){return db[_0x2b8b('0x29')][_0x2b8b('0x45')](_0x43a1aa[_0x2b8b('0x46')],{})['then'](respondWithResult(_0x533cc9,0xc9))[_0x2b8b('0x3e')](handleError(_0x533cc9,null));};exports['update']=function(_0x10e78d,_0x478d04){if(_0x10e78d[_0x2b8b('0x46')]['id']){delete _0x10e78d['body']['id'];}return db['SquareDetailsReport'][_0x2b8b('0x44')]({'where':{'id':_0x10e78d[_0x2b8b('0x40')]['id']}})[_0x2b8b('0x22')](handleEntityNotFound(_0x478d04,null))['then'](saveUpdates(_0x10e78d[_0x2b8b('0x46')],null))[_0x2b8b('0x22')](respondWithResult(_0x478d04,null))[_0x2b8b('0x3e')](handleError(_0x478d04,null));};exports[_0x2b8b('0x47')]=function(_0x245239,_0x1e2fe9){return db[_0x2b8b('0x29')]['find']({'where':{'id':_0x245239['params']['id']}})[_0x2b8b('0x22')](handleEntityNotFound(_0x1e2fe9,null))[_0x2b8b('0x22')](removeEntity(_0x1e2fe9,null))[_0x2b8b('0x3e')](handleError(_0x1e2fe9,null));};exports[_0x2b8b('0x48')]=function(_0x4ccfdc,_0x1cca53){return db[_0x2b8b('0x29')]['describe']()[_0x2b8b('0x22')](respondWithResult(_0x1cca53,null))[_0x2b8b('0x3e')](handleError(_0x1cca53,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8fd1f76..593d4b1 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 _0xb5fa=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x5cb54b,_0x5b038c){var _0xaeb5c4=function(_0x10ab41){while(--_0x10ab41){_0x5cb54b['push'](_0x5cb54b['shift']());}};_0xaeb5c4(++_0x5b038c);}(_0xb5fa,0x119));var _0xab5f=function(_0x2cd6c9,_0x112eba){_0x2cd6c9=_0x2cd6c9-0x0;var _0x2c1c41=_0xb5fa[_0x2cd6c9];return _0x2c1c41;};'use strict';var _=require(_0xab5f('0x0'));var util=require('util');var logger=require(_0xab5f('0x1'))(_0xab5f('0x2'));var moment=require(_0xab5f('0x3'));var BPromise=require('bluebird');var rp=require(_0xab5f('0x4'));var fs=require('fs');var path=require(_0xab5f('0x5'));var rimraf=require('rimraf');var config=require(_0xab5f('0x6'));var attributes=require(_0xab5f('0x7'));module[_0xab5f('0x8')]=function(_0x3b24e2,_0x547408){return _0x3b24e2[_0xab5f('0x9')](_0xab5f('0xa'),attributes,{'tableName':_0xab5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fb1=['bluebird','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','lodash','util','../../config/logger','moment'];(function(_0x1de20e,_0x386aaf){var _0x3355f9=function(_0x3507b3){while(--_0x3507b3){_0x1de20e['push'](_0x1de20e['shift']());}};_0x3355f9(++_0x386aaf);}(_0x4fb1,0x19e));var _0x14fb=function(_0x39d734,_0x410b58){_0x39d734=_0x39d734-0x0;var _0x49c46f=_0x4fb1[_0x39d734];return _0x49c46f;};'use strict';var _=require(_0x14fb('0x0'));var util=require(_0x14fb('0x1'));var logger=require(_0x14fb('0x2'))('api');var moment=require(_0x14fb('0x3'));var BPromise=require(_0x14fb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14fb('0x5'));var rimraf=require(_0x14fb('0x6'));var config=require(_0x14fb('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x14fb('0x8')]=function(_0x89b223,_0x41ea65){return _0x89b223[_0x14fb('0x9')](_0x14fb('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 0c8e036..1cccf85 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 _0x97c1=['create','body','options','raw','then','CreateSquareDetailsReport','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareDetailsReport'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x97c1,0xdf));var _0x197c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateSquareDetailsReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});}; \ No newline at end of file +var _0x5c3c=['SquareDetailsReport','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport'];(function(_0x443cc8,_0x4fcbe0){var _0x2c72dc=function(_0x11a12a){while(--_0x11a12a){_0x443cc8['push'](_0x443cc8['shift']());}};_0x2c72dc(++_0x4fcbe0);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x5c3c[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![]})[_0xc5c3('0xd')](function(_0x3cc612){logger[_0xc5c3('0x15')](_0xc5c3('0x17'),_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x3cc612));_0x28bae6(_0x3cc612);})[_0xc5c3('0x1d')](function(_0x2de266){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x2de266[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2de266['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index bd95450..eb6ddd1 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 _0x3f2c=['express','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x216ebe,_0x317409){var _0x418f92=function(_0x4bcaa7){while(--_0x4bcaa7){_0x216ebe['push'](_0x216ebe['shift']());}};_0x418f92(++_0x317409);}(_0x3f2c,0x1e0));var _0xc3f2=function(_0x162a4d,_0x590294){_0x162a4d=_0x162a4d-0x0;var _0x9b66a9=_0x3f2c[_0x162a4d];return _0x9b66a9;};'use strict';var express=require(_0xc3f2('0x0'));var router=express['Router']();var auth=require(_0xc3f2('0x1'));var controller=require('./system.controller');router[_0xc3f2('0x2')]('/',auth[_0xc3f2('0x3')](),controller[_0xc3f2('0x4')]);router[_0xc3f2('0x2')](_0xc3f2('0x5'),auth['isAuthenticated'](),controller[_0xc3f2('0x6')]);module[_0xc3f2('0x7')]=router; \ No newline at end of file +var _0xf224=['index','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf224,0x1a2));var _0x4f22=function(_0x414ea8,_0x354b7b){_0x414ea8=_0x414ea8-0x0;var _0x380e81=_0xf224[_0x414ea8];return _0x380e81;};'use strict';var express=require(_0x4f22('0x0'));var router=express[_0x4f22('0x1')]();var auth=require(_0x4f22('0x2'));var controller=require(_0x4f22('0x3'));router[_0x4f22('0x4')]('/',auth['isAuthenticated'](),controller[_0x4f22('0x5')]);router['get']('/process/:pid/kill',auth[_0x4f22('0x6')](),controller[_0x4f22('0x7')]);module[_0x4f22('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f57e8d0..dfde980 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 _0x0595=['catch','child_process','exec','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','getAllData','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','params'];(function(_0x13d71e,_0x1ab6a1){var _0x2dc8aa=function(_0x466e63){while(--_0x466e63){_0x13d71e['push'](_0x13d71e['shift']());}};_0x2dc8aa(++_0x1ab6a1);}(_0x0595,0x1c9));var _0x5059=function(_0x562143,_0xcde680){_0x562143=_0x562143-0x0;var _0x9d943e=_0x0595[_0x562143];return _0x9d943e;};'use strict';var info=require('systeminformation');var exec=require(_0x5059('0x0'))[_0x5059('0x1')];var logger=require(_0x5059('0x2'))('api');var util=require(_0x5059('0x3'));var BPromise=require('bluebird');var _=require(_0x5059('0x4'));function handleError(_0x2ef2f,_0x15fa8e,_0x3ce742){_0x15fa8e=_0x15fa8e||0x1f4;return function(_0x1b6aae){logger[_0x5059('0x5')](_0x5059('0x6'),_0x3ce742,_0x15fa8e,util['inspect'](_0x1b6aae,{'showHidden':![],'depth':null}));delete _0x1b6aae['name'];_0x2ef2f[_0x5059('0x7')](_0x15fa8e)[_0x5059('0x8')](_0x1b6aae);};}exports[_0x5059('0x9')]=function(_0x408dcc,_0x32d2cb){return info[_0x5059('0xa')]()['then'](function(_0x2facba){return _0x32d2cb['status'](0xc8)[_0x5059('0xb')](_0x2facba);})['catch'](function(_0x56e8d1){return _0x32d2cb[_0x5059('0x7')](0x1f4)[_0x5059('0xb')](_0x56e8d1);});};exports[_0x5059('0xc')]=function(_0x12acf8,_0x19757b){var _0x1ae235=[_0x5059('0xd')];return new BPromise(function(_0x5ed8cc,_0x41e809){return exec(util[_0x5059('0xe')](_0x5059('0xf'),_0x12acf8['params']['pid']),function(_0x5ef255,_0x41e6f4,_0x16ac81){if(_0x5ef255){return _0x41e809(_0x5ef255);}return _0x5ed8cc(_0x41e6f4);});})[_0x5059('0x10')](function(_0x609e85){var _0x3af417=![];var _0x178145=_0x609e85[_0x5059('0x11')](/\n/);for(var _0x1bc4ec=0x0,_0xb6e935=_0x1ae235[_0x5059('0x12')];_0x1bc4ec<_0xb6e935,_0x3af417===![];_0x1bc4ec+=0x1){if(_0x609e85['indexOf'](_0x1ae235[_0x1bc4ec])>=0x0){_0x3af417=!![];}}if(!_0x3af417){throw new Error(util[_0x5059('0xe')](_0x5059('0x13'),_0x12acf8['params'][_0x5059('0x14')]));}process['kill'](_0x12acf8['params'][_0x5059('0x14')],_0x5059('0x15'));return _0x19757b[_0x5059('0x7')](0xc8)[_0x5059('0xb')]({'message':util[_0x5059('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x12acf8[_0x5059('0x16')][_0x5059('0x14')])});})[_0x5059('0x17')](handleError(_0x19757b,null,_0x5059('0xc')));}; \ No newline at end of file +var _0x8b42=['child_process','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x6622a2,_0x401a17){var _0x52252e=function(_0x339759){while(--_0x339759){_0x6622a2['push'](_0x6622a2['shift']());}};_0x52252e(++_0x401a17);}(_0x8b42,0x11f));var _0x28b4=function(_0x38a5bb,_0x4e5537){_0x38a5bb=_0x38a5bb-0x0;var _0x195741=_0x8b42[_0x38a5bb];return _0x195741;};'use strict';var info=require(_0x28b4('0x0'));var exec=require(_0x28b4('0x1'))['exec'];var logger=require(_0x28b4('0x2'))(_0x28b4('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x28b4('0x4'));function handleError(_0x425dab,_0x265026,_0x471ab4){_0x265026=_0x265026||0x1f4;return function(_0x269473){logger[_0x28b4('0x5')](_0x28b4('0x6'),_0x471ab4,_0x265026,util['inspect'](_0x269473,{'showHidden':![],'depth':null}));delete _0x269473[_0x28b4('0x7')];_0x425dab[_0x28b4('0x8')](_0x265026)[_0x28b4('0x9')](_0x269473);};}exports[_0x28b4('0xa')]=function(_0x11bee8,_0x221aad){return info['getAllData']()[_0x28b4('0xb')](function(_0x534667){return _0x221aad[_0x28b4('0x8')](0xc8)[_0x28b4('0xc')](_0x534667);})[_0x28b4('0xd')](function(_0x34f09d){return _0x221aad[_0x28b4('0x8')](0x1f4)[_0x28b4('0xc')](_0x34f09d);});};exports[_0x28b4('0xe')]=function(_0x2315ac,_0x254a15){var _0x121ac6=[_0x28b4('0xf')];return new BPromise(function(_0x293732,_0x48d5b6){return exec(util[_0x28b4('0x10')](_0x28b4('0x11'),_0x2315ac['params']['pid']),function(_0x59dd83,_0x596bcd,_0x5008eb){if(_0x59dd83){return _0x48d5b6(_0x59dd83);}return _0x293732(_0x596bcd);});})[_0x28b4('0xb')](function(_0x110558){var _0x1def02=![];var _0x440e03=_0x110558[_0x28b4('0x12')](/\n/);for(var _0x139a55=0x0,_0x103604=_0x121ac6['length'];_0x139a55<_0x103604,_0x1def02===![];_0x139a55+=0x1){if(_0x110558[_0x28b4('0x13')](_0x121ac6[_0x139a55])>=0x0){_0x1def02=!![];}}if(!_0x1def02){throw new Error(util[_0x28b4('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2315ac['params'][_0x28b4('0x14')]));}process[_0x28b4('0x15')](_0x2315ac['params'][_0x28b4('0x14')],_0x28b4('0x16'));return _0x254a15[_0x28b4('0x8')](0xc8)[_0x28b4('0xc')]({'message':util[_0x28b4('0x10')](_0x28b4('0x17'),_0x2315ac['params']['pid'])});})[_0x28b4('0xd')](handleError(_0x254a15,null,_0x28b4('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b1949a7..9bf03b6 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 _0x68a5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','multer','path','connect-timeout'];(function(_0x519ced,_0x176b5d){var _0x448522=function(_0x4d94f6){while(--_0x4d94f6){_0x519ced['push'](_0x519ced['shift']());}};_0x448522(++_0x176b5d);}(_0x68a5,0xfc));var _0x568a=function(_0x224a43,_0x3c8942){_0x224a43=_0x224a43-0x0;var _0x151c4e=_0x68a5[_0x224a43];return _0x151c4e;};'use strict';var multer=require(_0x568a('0x0'));var util=require('util');var path=require(_0x568a('0x1'));var timeout=require(_0x568a('0x2'));var express=require('express');var router=express[_0x568a('0x3')]();var fs_extra=require(_0x568a('0x4'));var auth=require(_0x568a('0x5'));var interaction=require(_0x568a('0x6'));var config=require('../../config/environment');var controller=require(_0x568a('0x7'));router['get']('/',auth[_0x568a('0x8')](),controller[_0x568a('0x9')]);router[_0x568a('0xa')](_0x568a('0xb'),auth['isAuthenticated'](),controller[_0x568a('0xc')]);router['post']('/',auth[_0x568a('0x8')](),controller[_0x568a('0xd')]);router[_0x568a('0xe')](_0x568a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x568a('0xf')](_0x568a('0xb'),auth['isAuthenticated'](),controller[_0x568a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x391f=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x10a6ee,_0x15678d){var _0x4e7cac=function(_0x56ce03){while(--_0x56ce03){_0x10a6ee['push'](_0x10a6ee['shift']());}};_0x4e7cac(++_0x15678d);}(_0x391f,0x10c));var _0xf391=function(_0x24315c,_0x3ccfe4){_0x24315c=_0x24315c-0x0;var _0x14f58a=_0x391f[_0x24315c];return _0x14f58a;};'use strict';var multer=require(_0xf391('0x0'));var util=require(_0xf391('0x1'));var path=require(_0xf391('0x2'));var timeout=require(_0xf391('0x3'));var express=require(_0xf391('0x4'));var router=express[_0xf391('0x5')]();var fs_extra=require(_0xf391('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf391('0x7'));var config=require(_0xf391('0x8'));var controller=require(_0xf391('0x9'));router[_0xf391('0xa')]('/',auth[_0xf391('0xb')](),controller['index']);router[_0xf391('0xa')](_0xf391('0xc'),auth[_0xf391('0xb')](),controller[_0xf391('0xd')]);router[_0xf391('0xe')]('/',auth['isAuthenticated'](),controller[_0xf391('0xf')]);router[_0xf391('0x10')](_0xf391('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf391('0x11')](_0xf391('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf391('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1a166e5..5c26df3 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 _0x7948=['exports','STRING','name','#0091EA','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7948,0x185));var _0x8794=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x7948[_0x421c56];return _0x49b244;};'use strict';var Sequelize=require(_0x8794('0x0'));module[_0x8794('0x1')]={'name':{'type':Sequelize[_0x8794('0x2')],'unique':_0x8794('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8794('0x2')],'defaultValue':_0x8794('0x4')},'description':{'type':Sequelize[_0x8794('0x2')]}}; \ No newline at end of file +var _0x1bc6=['STRING','name','#0091EA','sequelize','exports'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0x1bc6,0x94));var _0x61bc=function(_0x15c663,_0x1d67fd){_0x15c663=_0x15c663-0x0;var _0x1cd1a7=_0x1bc6[_0x15c663];return _0x1cd1a7;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'name':{'type':Sequelize[_0x61bc('0x2')],'unique':_0x61bc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x61bc('0x2')],'defaultValue':_0x61bc('0x4')},'description':{'type':Sequelize[_0x61bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 1bd29c3..39ba246 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 _0xfc03=['Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','create','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map'];(function(_0x3cea34,_0x459157){var _0x131d11=function(_0x5a4d9c){while(--_0x5a4d9c){_0x3cea34['push'](_0x3cea34['shift']());}};_0x131d11(++_0x459157);}(_0xfc03,0x16f));var _0x3fc0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc03[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3fc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fc0('0x1'));var jsonpatch=require(_0x3fc0('0x2'));var rp=require('request-promise');var moment=require(_0x3fc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fc0('0x4'));var util=require(_0x3fc0('0x5'));var path=require(_0x3fc0('0x6'));var sox=require(_0x3fc0('0x7'));var csv=require(_0x3fc0('0x8'));var ejs=require(_0x3fc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3fc0('0xa'));var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x8'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var as=require(_0x3fc0('0x12'));var hardwareService=require(_0x3fc0('0x13'));var logger=require(_0x3fc0('0x14'))('api');var utils=require(_0x3fc0('0x15'));var config=require(_0x3fc0('0x16'));var licenseUtil=require(_0x3fc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1011b7,_0x582e22){_0x582e22=_0x582e22||0xcc;return function(_0x3a4cc0){if(_0x3a4cc0){return _0x1011b7[_0x3fc0('0x18')](_0x582e22);}return _0x1011b7['status'](_0x582e22)[_0x3fc0('0x19')]();};}function respondWithResult(_0x422926,_0x392c46){_0x392c46=_0x392c46||0xc8;return function(_0x4eb69a){if(_0x4eb69a){return _0x422926[_0x3fc0('0x1a')](_0x392c46)[_0x3fc0('0x1b')](_0x4eb69a);}};}function respondWithFilteredResult(_0x367ce1,_0x27619a){return function(_0x562ecc){if(_0x562ecc){var _0x277dbf=typeof _0x27619a[_0x3fc0('0x1c')]===_0x3fc0('0x1d')&&typeof _0x27619a['limit']===_0x3fc0('0x1d');var _0x491446=_0x562ecc[_0x3fc0('0x1e')];var _0x3c5026=_0x277dbf?0x0:_0x27619a['offset'];var _0x3bb388=_0x277dbf?_0x562ecc[_0x3fc0('0x1e')]:_0x27619a[_0x3fc0('0x1c')]+_0x27619a[_0x3fc0('0x1f')];var _0x1bd575;if(_0x3bb388>=_0x491446){_0x3bb388=_0x491446;_0x1bd575=0xc8;}else{_0x1bd575=0xce;}_0x367ce1[_0x3fc0('0x1a')](_0x1bd575);return _0x367ce1[_0x3fc0('0x20')](_0x3fc0('0x21'),_0x3c5026+'-'+_0x3bb388+'/'+_0x491446)[_0x3fc0('0x1b')](_0x562ecc);}return null;};}function patchUpdates(_0x5c859e){return function(_0xf13744){try{jsonpatch[_0x3fc0('0x22')](_0xf13744,_0x5c859e,!![]);}catch(_0x34ffa7){return BPromise[_0x3fc0('0x23')](_0x34ffa7);}return _0xf13744[_0x3fc0('0x24')]();};}function saveUpdates(_0x448293,_0x47c770){return function(_0x477674){if(_0x477674){return _0x477674[_0x3fc0('0x25')](_0x448293)[_0x3fc0('0x26')](function(_0x28fc65){return _0x28fc65;});}return null;};}function removeEntity(_0x46c213,_0x303dd2){return function(_0x2f423e){if(_0x2f423e){return _0x2f423e[_0x3fc0('0x27')]()[_0x3fc0('0x26')](function(){var _0x35a3e2=_0x2f423e[_0x3fc0('0x28')]({'plain':!![]});var _0x1abe10=_0x3fc0('0x29');return db[_0x3fc0('0x2a')][_0x3fc0('0x27')]({'where':{'type':_0x1abe10,'resourceId':_0x35a3e2['id']}})[_0x3fc0('0x26')](function(){return _0x2f423e;});})['then'](function(){_0x46c213[_0x3fc0('0x1a')](0xcc)[_0x3fc0('0x19')]();});}};}function handleEntityNotFound(_0x1d9932,_0x35c34c){return function(_0x5a9179){if(!_0x5a9179){_0x1d9932[_0x3fc0('0x18')](0x194);}return _0x5a9179;};}function handleError(_0x197dfa,_0x126515){_0x126515=_0x126515||0x1f4;return function(_0x2645b4){logger['error'](_0x2645b4[_0x3fc0('0x2b')]);if(_0x2645b4[_0x3fc0('0x2c')]){delete _0x2645b4[_0x3fc0('0x2c')];}_0x197dfa[_0x3fc0('0x1a')](_0x126515)[_0x3fc0('0x2d')](_0x2645b4);};}exports[_0x3fc0('0x2e')]=function(_0x485f0c,_0xd9ecae){var _0x2351c8={},_0x181948={},_0x21a074={'count':0x0,'rows':[]};var _0x3f1a75=_[_0x3fc0('0x2f')](db[_0x3fc0('0x30')][_0x3fc0('0x31')],function(_0x4d6551){return{'name':_0x4d6551['fieldName'],'type':_0x4d6551[_0x3fc0('0x32')]['key']};});_0x181948[_0x3fc0('0x33')]=_[_0x3fc0('0x2f')](_0x3f1a75,_0x3fc0('0x2c'));_0x181948[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x485f0c['query']);_0x181948['filters']=_[_0x3fc0('0x36')](_0x181948[_0x3fc0('0x33')],_0x181948[_0x3fc0('0x34')]);_0x2351c8[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x181948['model'],qs[_0x3fc0('0x38')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x38')]));_0x2351c8['attributes']=_0x2351c8[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x2351c8[_0x3fc0('0x37')]:_0x181948[_0x3fc0('0x33')];if(!_0x485f0c['query'][_0x3fc0('0x3a')](_0x3fc0('0x3b'))){_0x2351c8['limit']=qs[_0x3fc0('0x1f')](_0x485f0c['query'][_0x3fc0('0x1f')]);_0x2351c8[_0x3fc0('0x1c')]=qs[_0x3fc0('0x1c')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x1c')]);}_0x2351c8[_0x3fc0('0x3c')]=qs[_0x3fc0('0x3d')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x3d')]);_0x2351c8[_0x3fc0('0x3e')]=qs[_0x3fc0('0x3f')](_['pick'](_0x485f0c[_0x3fc0('0x34')],_0x181948[_0x3fc0('0x3f')]),_0x3f1a75);if(_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x40')]){_0x2351c8[_0x3fc0('0x3e')]=_[_0x3fc0('0x41')](_0x2351c8['where'],{'$or':_['map'](_0x3f1a75,function(_0x3af7ed){if(_0x3af7ed[_0x3fc0('0x32')]!==_0x3fc0('0x42')){var _0x3e285f={};_0x3e285f[_0x3af7ed[_0x3fc0('0x2c')]]={'$like':'%'+_0x485f0c['query']['filter']+'%'};return _0x3e285f;}})});}_0x2351c8=_['merge']({},_0x2351c8,_0x485f0c[_0x3fc0('0x43')]);var _0x39d65c={'where':_0x2351c8[_0x3fc0('0x3e')]};return db['Tag']['count'](_0x39d65c)[_0x3fc0('0x26')](function(_0x239dc5){_0x21a074[_0x3fc0('0x1e')]=_0x239dc5;if(_0x485f0c[_0x3fc0('0x34')]['includeAll']){_0x2351c8['include']=[{'all':!![]}];}return db[_0x3fc0('0x30')][_0x3fc0('0x44')](_0x2351c8);})['then'](function(_0x32768f){_0x21a074['rows']=_0x32768f;return _0x21a074;})[_0x3fc0('0x26')](respondWithFilteredResult(_0xd9ecae,_0x2351c8))[_0x3fc0('0x45')](handleError(_0xd9ecae,null));};exports[_0x3fc0('0x46')]=function(_0x90120f,_0x2d01e9){var _0x38e449={'raw':!![],'where':{'id':_0x90120f[_0x3fc0('0x47')]['id']}},_0x80dfee={};_0x80dfee['model']=_[_0x3fc0('0x35')](db['Tag'][_0x3fc0('0x31')]);_0x80dfee[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x90120f[_0x3fc0('0x34')]);_0x80dfee[_0x3fc0('0x3f')]=_['intersection'](_0x80dfee[_0x3fc0('0x33')],_0x80dfee[_0x3fc0('0x34')]);_0x38e449[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x80dfee['model'],qs[_0x3fc0('0x38')](_0x90120f['query'][_0x3fc0('0x38')]));_0x38e449[_0x3fc0('0x37')]=_0x38e449[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x38e449[_0x3fc0('0x37')]:_0x80dfee['model'];if(_0x90120f[_0x3fc0('0x34')][_0x3fc0('0x48')]){_0x38e449[_0x3fc0('0x49')]=[{'all':!![]}];}_0x38e449=_['merge']({},_0x38e449,_0x90120f[_0x3fc0('0x43')]);return db[_0x3fc0('0x30')]['find'](_0x38e449)[_0x3fc0('0x26')](handleEntityNotFound(_0x2d01e9,null))[_0x3fc0('0x26')](respondWithResult(_0x2d01e9,null))[_0x3fc0('0x45')](handleError(_0x2d01e9,null));};exports['create']=function(_0x5e5c73,_0x3a35ac){return db[_0x3fc0('0x30')][_0x3fc0('0x4a')](_0x5e5c73['body'],{})[_0x3fc0('0x26')](function(_0x527569){var _0x40dbf3=_0x5e5c73['user']['get']({'plain':!![]});if(!_0x40dbf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dbf3[_0x3fc0('0x4b')]===_0x3fc0('0x4c')){var _0x141b4c=_0x527569[_0x3fc0('0x28')]({'plain':!![]});var _0x1e0c43=_0x3fc0('0x29');return db['UserProfileSection'][_0x3fc0('0x4d')]({'where':{'name':_0x1e0c43,'userProfileId':_0x40dbf3[_0x3fc0('0x4e')]},'raw':!![]})['then'](function(_0x550463){if(_0x550463&&_0x550463[_0x3fc0('0x4f')]===0x0){return db[_0x3fc0('0x2a')][_0x3fc0('0x4a')]({'name':_0x141b4c[_0x3fc0('0x2c')],'resourceId':_0x141b4c['id'],'type':_0x550463[_0x3fc0('0x2c')],'sectionId':_0x550463['id']},{})[_0x3fc0('0x26')](function(){return _0x527569;});}else{return _0x527569;}})[_0x3fc0('0x45')](function(_0x2da185){logger[_0x3fc0('0x50')](_0x3fc0('0x51'),_0x2da185);throw _0x2da185;});}return _0x527569;})[_0x3fc0('0x26')](respondWithResult(_0x3a35ac,0xc9))[_0x3fc0('0x45')](handleError(_0x3a35ac,null));};exports['update']=function(_0x24be72,_0xda5d3e){if(_0x24be72[_0x3fc0('0x52')]['id']){delete _0x24be72[_0x3fc0('0x52')]['id'];}return db[_0x3fc0('0x30')]['find']({'where':{'id':_0x24be72[_0x3fc0('0x47')]['id']}})['then'](handleEntityNotFound(_0xda5d3e,null))[_0x3fc0('0x26')](saveUpdates(_0x24be72[_0x3fc0('0x52')],null))[_0x3fc0('0x26')](respondWithResult(_0xda5d3e,null))[_0x3fc0('0x45')](handleError(_0xda5d3e,null));};exports['destroy']=function(_0x1656c7,_0xd903e3){return db[_0x3fc0('0x30')][_0x3fc0('0x4d')]({'where':{'id':_0x1656c7[_0x3fc0('0x47')]['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0xd903e3,null))['then'](removeEntity(_0xd903e3,null))[_0x3fc0('0x45')](handleError(_0xd903e3,null));}; \ No newline at end of file +var _0xda55=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','role','user','Tags','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','get','error','stack','name','send','index','map','Tag','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x199d4f,_0x49ede1){var _0x202d75=function(_0x3e56d9){while(--_0x3e56d9){_0x199d4f['push'](_0x199d4f['shift']());}};_0x202d75(++_0x49ede1);}(_0xda55,0x6d));var _0x5da5=function(_0x88a170,_0x570911){_0x88a170=_0x88a170-0x0;var _0x171401=_0xda55[_0x88a170];return _0x171401;};'use strict';var emlformat=require(_0x5da5('0x0'));var rimraf=require(_0x5da5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5da5('0x2'));var moment=require(_0x5da5('0x3'));var BPromise=require(_0x5da5('0x4'));var Mustache=require(_0x5da5('0x5'));var util=require(_0x5da5('0x6'));var path=require('path');var sox=require(_0x5da5('0x7'));var csv=require('to-csv');var ejs=require(_0x5da5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5da5('0x9'));var squel=require(_0x5da5('0xa'));var crypto=require(_0x5da5('0xb'));var jsforce=require(_0x5da5('0xc'));var deskjs=require(_0x5da5('0xd'));var toCsv=require(_0x5da5('0xe'));var querystring=require(_0x5da5('0xf'));var Papa=require(_0x5da5('0x10'));var Redis=require('ioredis');var authService=require(_0x5da5('0x11'));var qs=require(_0x5da5('0x12'));var as=require(_0x5da5('0x13'));var hardwareService=require(_0x5da5('0x14'));var logger=require(_0x5da5('0x15'))(_0x5da5('0x16'));var utils=require(_0x5da5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5da5('0x18'));var db=require(_0x5da5('0x19'))['db'];function respondWithStatusCode(_0x4f813b,_0x37aeb0){_0x37aeb0=_0x37aeb0||0xcc;return function(_0x31366e){if(_0x31366e){return _0x4f813b[_0x5da5('0x1a')](_0x37aeb0);}return _0x4f813b[_0x5da5('0x1b')](_0x37aeb0)[_0x5da5('0x1c')]();};}function respondWithResult(_0x440b8f,_0x481562){_0x481562=_0x481562||0xc8;return function(_0x489b60){if(_0x489b60){return _0x440b8f['status'](_0x481562)[_0x5da5('0x1d')](_0x489b60);}};}function respondWithFilteredResult(_0x126fc8,_0x13c701){return function(_0x665ce8){if(_0x665ce8){var _0x11bd3=typeof _0x13c701[_0x5da5('0x1e')]===_0x5da5('0x1f')&&typeof _0x13c701['limit']===_0x5da5('0x1f');var _0x290136=_0x665ce8[_0x5da5('0x20')];var _0x16b11f=_0x11bd3?0x0:_0x13c701[_0x5da5('0x1e')];var _0x428b07=_0x11bd3?_0x665ce8['count']:_0x13c701[_0x5da5('0x1e')]+_0x13c701[_0x5da5('0x21')];var _0x3d3d26;if(_0x428b07>=_0x290136){_0x428b07=_0x290136;_0x3d3d26=0xc8;}else{_0x3d3d26=0xce;}_0x126fc8[_0x5da5('0x1b')](_0x3d3d26);return _0x126fc8[_0x5da5('0x22')]('Content-Range',_0x16b11f+'-'+_0x428b07+'/'+_0x290136)[_0x5da5('0x1d')](_0x665ce8);}return null;};}function patchUpdates(_0x3372fc){return function(_0x42a3cb){try{jsonpatch['apply'](_0x42a3cb,_0x3372fc,!![]);}catch(_0x3e0b28){return BPromise[_0x5da5('0x23')](_0x3e0b28);}return _0x42a3cb[_0x5da5('0x24')]();};}function saveUpdates(_0x2e68d5,_0xec69f2){return function(_0x436960){if(_0x436960){return _0x436960['update'](_0x2e68d5)[_0x5da5('0x25')](function(_0x568ddf){return _0x568ddf;});}return null;};}function removeEntity(_0x1b67c4,_0x716ab7){return function(_0x2dd138){if(_0x2dd138){return _0x2dd138['destroy']()[_0x5da5('0x25')](function(){var _0x236bf3=_0x2dd138[_0x5da5('0x26')]({'plain':!![]});var _0x21e795='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x21e795,'resourceId':_0x236bf3['id']}})[_0x5da5('0x25')](function(){return _0x2dd138;});})['then'](function(){_0x1b67c4['status'](0xcc)[_0x5da5('0x1c')]();});}};}function handleEntityNotFound(_0x3974d8,_0x5740a7){return function(_0x1798ae){if(!_0x1798ae){_0x3974d8[_0x5da5('0x1a')](0x194);}return _0x1798ae;};}function handleError(_0x558b12,_0x3b815e){_0x3b815e=_0x3b815e||0x1f4;return function(_0x27de55){logger[_0x5da5('0x27')](_0x27de55[_0x5da5('0x28')]);if(_0x27de55[_0x5da5('0x29')]){delete _0x27de55['name'];}_0x558b12[_0x5da5('0x1b')](_0x3b815e)[_0x5da5('0x2a')](_0x27de55);};}exports[_0x5da5('0x2b')]=function(_0x15a0c0,_0x55e2bf){var _0x5ee7f2={},_0x4cb022={},_0x245273={'count':0x0,'rows':[]};var _0x27ed41=_[_0x5da5('0x2c')](db[_0x5da5('0x2d')]['rawAttributes'],function(_0x585298){return{'name':_0x585298[_0x5da5('0x2e')],'type':_0x585298['type']['key']};});_0x4cb022[_0x5da5('0x2f')]=_['map'](_0x27ed41,_0x5da5('0x29'));_0x4cb022[_0x5da5('0x30')]=_[_0x5da5('0x31')](_0x15a0c0[_0x5da5('0x30')]);_0x4cb022[_0x5da5('0x32')]=_[_0x5da5('0x33')](_0x4cb022[_0x5da5('0x2f')],_0x4cb022[_0x5da5('0x30')]);_0x5ee7f2['attributes']=_[_0x5da5('0x33')](_0x4cb022['model'],qs[_0x5da5('0x34')](_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x34')]));_0x5ee7f2[_0x5da5('0x35')]=_0x5ee7f2[_0x5da5('0x35')][_0x5da5('0x36')]?_0x5ee7f2[_0x5da5('0x35')]:_0x4cb022[_0x5da5('0x2f')];if(!_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x37')](_0x5da5('0x38'))){_0x5ee7f2[_0x5da5('0x21')]=qs[_0x5da5('0x21')](_0x15a0c0['query'][_0x5da5('0x21')]);_0x5ee7f2['offset']=qs[_0x5da5('0x1e')](_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x1e')]);}_0x5ee7f2[_0x5da5('0x39')]=qs['sort'](_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x3a')]);_0x5ee7f2[_0x5da5('0x3b')]=qs['filters'](_[_0x5da5('0x3c')](_0x15a0c0[_0x5da5('0x30')],_0x4cb022['filters']),_0x27ed41);if(_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x3d')]){_0x5ee7f2[_0x5da5('0x3b')]=_[_0x5da5('0x3e')](_0x5ee7f2[_0x5da5('0x3b')],{'$or':_[_0x5da5('0x2c')](_0x27ed41,function(_0x52a902){if(_0x52a902[_0x5da5('0x3f')]!==_0x5da5('0x40')){var _0x14c3f5={};_0x14c3f5[_0x52a902[_0x5da5('0x29')]]={'$like':'%'+_0x15a0c0[_0x5da5('0x30')]['filter']+'%'};return _0x14c3f5;}})});}_0x5ee7f2=_[_0x5da5('0x3e')]({},_0x5ee7f2,_0x15a0c0[_0x5da5('0x41')]);var _0x5a189e={'where':_0x5ee7f2[_0x5da5('0x3b')]};return db['Tag']['count'](_0x5a189e)[_0x5da5('0x25')](function(_0x21c579){_0x245273[_0x5da5('0x20')]=_0x21c579;if(_0x15a0c0[_0x5da5('0x30')][_0x5da5('0x42')]){_0x5ee7f2[_0x5da5('0x43')]=[{'all':!![]}];}return db[_0x5da5('0x2d')][_0x5da5('0x44')](_0x5ee7f2);})[_0x5da5('0x25')](function(_0x2a2814){_0x245273[_0x5da5('0x45')]=_0x2a2814;return _0x245273;})[_0x5da5('0x25')](respondWithFilteredResult(_0x55e2bf,_0x5ee7f2))[_0x5da5('0x46')](handleError(_0x55e2bf,null));};exports[_0x5da5('0x47')]=function(_0x284d40,_0x30be40){var _0x1fc965={'raw':!![],'where':{'id':_0x284d40[_0x5da5('0x48')]['id']}},_0x4464a7={};_0x4464a7[_0x5da5('0x2f')]=_['keys'](db['Tag'][_0x5da5('0x49')]);_0x4464a7[_0x5da5('0x30')]=_['keys'](_0x284d40[_0x5da5('0x30')]);_0x4464a7[_0x5da5('0x32')]=_[_0x5da5('0x33')](_0x4464a7[_0x5da5('0x2f')],_0x4464a7[_0x5da5('0x30')]);_0x1fc965[_0x5da5('0x35')]=_[_0x5da5('0x33')](_0x4464a7[_0x5da5('0x2f')],qs[_0x5da5('0x34')](_0x284d40[_0x5da5('0x30')]['fields']));_0x1fc965[_0x5da5('0x35')]=_0x1fc965['attributes']['length']?_0x1fc965[_0x5da5('0x35')]:_0x4464a7[_0x5da5('0x2f')];if(_0x284d40[_0x5da5('0x30')][_0x5da5('0x42')]){_0x1fc965[_0x5da5('0x43')]=[{'all':!![]}];}_0x1fc965=_[_0x5da5('0x3e')]({},_0x1fc965,_0x284d40['options']);return db[_0x5da5('0x2d')]['find'](_0x1fc965)['then'](handleEntityNotFound(_0x30be40,null))[_0x5da5('0x25')](respondWithResult(_0x30be40,null))[_0x5da5('0x46')](handleError(_0x30be40,null));};exports['create']=function(_0x419d74,_0x322b08){return db[_0x5da5('0x2d')][_0x5da5('0x4a')](_0x419d74[_0x5da5('0x4b')],{})['then'](function(_0x225792){var _0x5277bc=_0x419d74['user'][_0x5da5('0x26')]({'plain':!![]});if(!_0x5277bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5277bc[_0x5da5('0x4c')]===_0x5da5('0x4d')){var _0x17581a=_0x225792[_0x5da5('0x26')]({'plain':!![]});var _0x2cc43f=_0x5da5('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x2cc43f,'userProfileId':_0x5277bc[_0x5da5('0x4f')]},'raw':!![]})[_0x5da5('0x25')](function(_0x520830){if(_0x520830&&_0x520830['autoAssociation']===0x0){return db[_0x5da5('0x50')]['create']({'name':_0x17581a[_0x5da5('0x29')],'resourceId':_0x17581a['id'],'type':_0x520830['name'],'sectionId':_0x520830['id']},{})['then'](function(){return _0x225792;});}else{return _0x225792;}})[_0x5da5('0x46')](function(_0x323655){logger[_0x5da5('0x27')](_0x5da5('0x51'),_0x323655);throw _0x323655;});}return _0x225792;})['then'](respondWithResult(_0x322b08,0xc9))[_0x5da5('0x46')](handleError(_0x322b08,null));};exports[_0x5da5('0x52')]=function(_0xa1d591,_0x56523b){if(_0xa1d591[_0x5da5('0x4b')]['id']){delete _0xa1d591[_0x5da5('0x4b')]['id'];}return db[_0x5da5('0x2d')][_0x5da5('0x53')]({'where':{'id':_0xa1d591[_0x5da5('0x48')]['id']}})[_0x5da5('0x25')](handleEntityNotFound(_0x56523b,null))[_0x5da5('0x25')](saveUpdates(_0xa1d591[_0x5da5('0x4b')],null))[_0x5da5('0x25')](respondWithResult(_0x56523b,null))[_0x5da5('0x46')](handleError(_0x56523b,null));};exports[_0x5da5('0x54')]=function(_0x283ba5,_0x211b80){return db[_0x5da5('0x2d')][_0x5da5('0x53')]({'where':{'id':_0x283ba5[_0x5da5('0x48')]['id']}})[_0x5da5('0x25')](handleEntityNotFound(_0x211b80,null))[_0x5da5('0x25')](removeEntity(_0x211b80,null))[_0x5da5('0x46')](handleError(_0x211b80,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 86797f2..837203b 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 _0x61bf=['rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x423f6a,_0x2b2377){var _0x174dba=function(_0x414760){while(--_0x414760){_0x423f6a['push'](_0x423f6a['shift']());}};_0x174dba(++_0x2b2377);}(_0x61bf,0x96));var _0xf61b=function(_0x240503,_0x166674){_0x240503=_0x240503-0x0;var _0x14dfc2=_0x61bf[_0x240503];return _0x14dfc2;};'use strict';var _=require(_0xf61b('0x0'));var util=require(_0xf61b('0x1'));var logger=require(_0xf61b('0x2'))(_0xf61b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf61b('0x4'));var fs=require('fs');var path=require(_0xf61b('0x5'));var rimraf=require(_0xf61b('0x6'));var config=require(_0xf61b('0x7'));var attributes=require(_0xf61b('0x8'));module['exports']=function(_0x27890a,_0x2ea32b){return _0x27890a[_0xf61b('0x9')](_0xf61b('0xa'),attributes,{'tableName':_0xf61b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd59d=['Tag','tools_tags','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xd59d,0x1a6));var _0xdd59=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xd59d[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd59('0x0'))(_0xdd59('0x1'));var moment=require('moment');var BPromise=require(_0xdd59('0x2'));var rp=require(_0xdd59('0x3'));var fs=require('fs');var path=require(_0xdd59('0x4'));var rimraf=require(_0xdd59('0x5'));var config=require(_0xdd59('0x6'));var attributes=require(_0xdd59('0x7'));module[_0xdd59('0x8')]=function(_0xcb7d61,_0x18b834){return _0xcb7d61[_0xdd59('0x9')](_0xdd59('0xa'),attributes,{'tableName':_0xdd59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 306897e..19dedb5 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x413e00,_0x4be1e8){var _0x1d17f2=function(_0x511cc4){while(--_0x511cc4){_0x413e00['push'](_0x413e00['shift']());}};_0x1d17f2(++_0x4be1e8);}(_0x6aa7,0x178));var _0x76aa=function(_0x3a32cb,_0x32e29b){_0x3a32cb=_0x3a32cb-0x0;var _0x1cda41=_0x6aa7[_0x3a32cb];return _0x1cda41;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file +var _0xaf93=['jayson/promise','client','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0xaf93,0x151));var _0x3af9=function(_0x44bf50,_0x48eacd){_0x44bf50=_0x44bf50-0x0;var _0x39f989=_0xaf93[_0x44bf50];return _0x39f989;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3af9('0x2'));var fs=require('fs');var Redis=require(_0x3af9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3af9('0x4'));var logger=require(_0x3af9('0x5'))(_0x3af9('0x6'));var config=require(_0x3af9('0x7'));var jayson=require(_0x3af9('0x8'));var client=jayson[_0x3af9('0x9')][_0x3af9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x535583,_0x2ac1a2,_0x56e4c2){return new BPromise(function(_0x133672,_0x53b5ba){return client['request'](_0x535583,_0x56e4c2)[_0x3af9('0xb')](function(_0x5d655f){logger['info'](_0x3af9('0xc'),_0x2ac1a2,_0x3af9('0xd'));logger[_0x3af9('0xe')](_0x3af9('0xf'),_0x2ac1a2,'request\x20sent',JSON[_0x3af9('0x10')](_0x5d655f));if(_0x5d655f[_0x3af9('0x11')]){if(_0x5d655f[_0x3af9('0x11')][_0x3af9('0x12')]===0x1f4){logger[_0x3af9('0x11')](_0x3af9('0xc'),_0x2ac1a2,_0x5d655f[_0x3af9('0x11')][_0x3af9('0x13')]);return _0x53b5ba(_0x5d655f['error'][_0x3af9('0x13')]);}logger['error'](_0x3af9('0xc'),_0x2ac1a2,_0x5d655f[_0x3af9('0x11')][_0x3af9('0x13')]);return _0x133672(_0x5d655f['error'][_0x3af9('0x13')]);}else{logger[_0x3af9('0x14')](_0x3af9('0xc'),_0x2ac1a2,'request\x20sent');_0x133672(_0x5d655f[_0x3af9('0x15')][_0x3af9('0x13')]);}})[_0x3af9('0x16')](function(_0x29dc4b){logger['error'](_0x3af9('0xc'),_0x2ac1a2,_0x29dc4b);_0x53b5ba(_0x29dc4b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c8c852f..7243853 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 d5ba71e..471b534 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 _0xb10b=['name','sequelize','STRING'];(function(_0x176b22,_0x4a2a86){var _0x5f81c8=function(_0x4851e7){while(--_0x4851e7){_0x176b22['push'](_0x176b22['shift']());}};_0x5f81c8(++_0x4a2a86);}(_0xb10b,0x12a));var _0xbb10=function(_0x1be994,_0x267018){_0x1be994=_0x1be994-0x0;var _0x365952=_0xb10b[_0x1be994];return _0x365952;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x41e14b,_0x23dff8){var _0x33f2af=function(_0x8dadf){while(--_0x8dadf){_0x41e14b['push'](_0x41e14b['shift']());}};_0x33f2af(++_0x23dff8);}(_0x2032,0xd9));var _0x2203=function(_0x3a7a39,_0x51a402){_0x3a7a39=_0x3a7a39-0x0;var _0x135a40=_0x2032[_0x3a7a39];return _0x135a40;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 6be4044..e116c75 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 _0xac48=['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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','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','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','ValidationError','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','removeAgents','Mail','Queue:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x12efa0,_0x579590){var _0x158c02=function(_0x311422){while(--_0x311422){_0x12efa0['push'](_0x12efa0['shift']());}};_0x158c02(++_0x579590);}(_0xac48,0xa2));var _0x8ac4=function(_0x4672fa,_0x390a87){_0x4672fa=_0x4672fa-0x0;var _0x57633b=_0xac48[_0x4672fa];return _0x57633b;};'use strict';var emlformat=require(_0x8ac4('0x0'));var rimraf=require(_0x8ac4('0x1'));var zipdir=require(_0x8ac4('0x2'));var jsonpatch=require(_0x8ac4('0x3'));var rp=require(_0x8ac4('0x4'));var moment=require(_0x8ac4('0x5'));var BPromise=require(_0x8ac4('0x6'));var Mustache=require(_0x8ac4('0x7'));var util=require(_0x8ac4('0x8'));var path=require(_0x8ac4('0x9'));var sox=require(_0x8ac4('0xa'));var csv=require(_0x8ac4('0xb'));var ejs=require(_0x8ac4('0xc'));var fs=require('fs');var fs_extra=require(_0x8ac4('0xd'));var _=require(_0x8ac4('0xe'));var squel=require(_0x8ac4('0xf'));var crypto=require(_0x8ac4('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ac4('0x11'));var Papa=require(_0x8ac4('0x12'));var Redis=require(_0x8ac4('0x13'));var authService=require(_0x8ac4('0x14'));var qs=require(_0x8ac4('0x15'));var as=require(_0x8ac4('0x16'));var hardwareService=require(_0x8ac4('0x17'));var logger=require(_0x8ac4('0x18'))(_0x8ac4('0x19'));var utils=require(_0x8ac4('0x1a'));var config=require(_0x8ac4('0x1b'));var licenseUtil=require(_0x8ac4('0x1c'));var db=require(_0x8ac4('0x1d'))['db'];config[_0x8ac4('0x1e')]=_[_0x8ac4('0x1f')](config[_0x8ac4('0x1e')],{'host':_0x8ac4('0x20'),'port':0x18eb});var socket=require(_0x8ac4('0x21'))(new Redis(config['redis']));require(_0x8ac4('0x22'))[_0x8ac4('0x23')](socket);function respondWithStatusCode(_0x41e87a,_0x37d2c3){_0x37d2c3=_0x37d2c3||0xcc;return function(_0x32244b){if(_0x32244b){return _0x41e87a[_0x8ac4('0x24')](_0x37d2c3);}return _0x41e87a[_0x8ac4('0x25')](_0x37d2c3)['end']();};}function respondWithResult(_0x2613be,_0x4b4409){_0x4b4409=_0x4b4409||0xc8;return function(_0x568fbe){if(_0x568fbe){return _0x2613be[_0x8ac4('0x25')](_0x4b4409)[_0x8ac4('0x26')](_0x568fbe);}};}function respondWithFilteredResult(_0x26a6a3,_0x5a2914){return function(_0x342d2e){if(_0x342d2e){var _0xcca5c8=typeof _0x5a2914[_0x8ac4('0x27')]===_0x8ac4('0x28')&&typeof _0x5a2914[_0x8ac4('0x29')]==='undefined';var _0x472eb4=_0x342d2e[_0x8ac4('0x2a')];var _0x17c8a3=_0xcca5c8?0x0:_0x5a2914['offset'];var _0x42e343=_0xcca5c8?_0x342d2e[_0x8ac4('0x2a')]:_0x5a2914['offset']+_0x5a2914['limit'];var _0x13a775;if(_0x42e343>=_0x472eb4){_0x42e343=_0x472eb4;_0x13a775=0xc8;}else{_0x13a775=0xce;}_0x26a6a3[_0x8ac4('0x25')](_0x13a775);return _0x26a6a3[_0x8ac4('0x2b')](_0x8ac4('0x2c'),_0x17c8a3+'-'+_0x42e343+'/'+_0x472eb4)[_0x8ac4('0x26')](_0x342d2e);}return null;};}function patchUpdates(_0x4ab573){return function(_0x15edc8){try{jsonpatch[_0x8ac4('0x2d')](_0x15edc8,_0x4ab573,!![]);}catch(_0x30d6ca){return BPromise['reject'](_0x30d6ca);}return _0x15edc8[_0x8ac4('0x2e')]();};}function saveUpdates(_0x3310aa,_0x46315d){return function(_0x104d66){if(_0x104d66){return _0x104d66[_0x8ac4('0x2f')](_0x3310aa)[_0x8ac4('0x30')](function(_0x3cb520){return _0x3cb520;});}return null;};}function handleEntityNotFound(_0x2cf4cb,_0x5f0da3){return function(_0x3d4b97){if(!_0x3d4b97){_0x2cf4cb[_0x8ac4('0x24')](0x194);}return _0x3d4b97;};}function handleError(_0x303783,_0x596ccb){_0x596ccb=_0x596ccb||0x1f4;return function(_0x1cc2be){logger[_0x8ac4('0x31')](_0x1cc2be[_0x8ac4('0x32')]);if(_0x1cc2be[_0x8ac4('0x33')]){delete _0x1cc2be[_0x8ac4('0x33')];}_0x303783['status'](_0x596ccb)[_0x8ac4('0x34')](_0x1cc2be);};}exports[_0x8ac4('0x35')]=function(_0x494906,_0x32ca2e){var _0x1fe391={},_0x4447ec={},_0x2ec6b6={'count':0x0,'rows':[]};var _0x4a6985=_[_0x8ac4('0x36')](db[_0x8ac4('0x37')][_0x8ac4('0x38')],function(_0x21694b){return{'name':_0x21694b[_0x8ac4('0x39')],'type':_0x21694b[_0x8ac4('0x3a')]['key']};});_0x4447ec[_0x8ac4('0x3b')]=_[_0x8ac4('0x36')](_0x4a6985,_0x8ac4('0x33'));_0x4447ec[_0x8ac4('0x3c')]=_[_0x8ac4('0x3d')](_0x494906[_0x8ac4('0x3c')]);_0x4447ec[_0x8ac4('0x3e')]=_[_0x8ac4('0x3f')](_0x4447ec[_0x8ac4('0x3b')],_0x4447ec[_0x8ac4('0x3c')]);_0x1fe391[_0x8ac4('0x40')]=_[_0x8ac4('0x3f')](_0x4447ec[_0x8ac4('0x3b')],qs[_0x8ac4('0x41')](_0x494906[_0x8ac4('0x3c')][_0x8ac4('0x41')]));_0x1fe391[_0x8ac4('0x40')]=_0x1fe391[_0x8ac4('0x40')][_0x8ac4('0x42')]?_0x1fe391[_0x8ac4('0x40')]:_0x4447ec['model'];if(!_0x494906[_0x8ac4('0x3c')][_0x8ac4('0x43')]('nolimit')){_0x1fe391[_0x8ac4('0x29')]=qs[_0x8ac4('0x29')](_0x494906[_0x8ac4('0x3c')]['limit']);_0x1fe391[_0x8ac4('0x27')]=qs[_0x8ac4('0x27')](_0x494906['query'][_0x8ac4('0x27')]);}_0x1fe391['order']=qs[_0x8ac4('0x44')](_0x494906[_0x8ac4('0x3c')][_0x8ac4('0x44')]);_0x1fe391[_0x8ac4('0x45')]=qs[_0x8ac4('0x3e')](_['pick'](_0x494906['query'],_0x4447ec[_0x8ac4('0x3e')]),_0x4a6985);if(_0x494906['query'][_0x8ac4('0x46')]){_0x1fe391[_0x8ac4('0x45')]=_[_0x8ac4('0x47')](_0x1fe391[_0x8ac4('0x45')],{'$or':_[_0x8ac4('0x36')](_0x4a6985,function(_0x1402ce){if(_0x1402ce[_0x8ac4('0x3a')]!==_0x8ac4('0x48')){var _0x23065b={};_0x23065b[_0x1402ce[_0x8ac4('0x33')]]={'$like':'%'+_0x494906[_0x8ac4('0x3c')]['filter']+'%'};return _0x23065b;}})});}_0x1fe391=_['merge']({},_0x1fe391,_0x494906['options']);var _0x4ad8eb={'where':_0x1fe391[_0x8ac4('0x45')]};return db[_0x8ac4('0x37')][_0x8ac4('0x2a')](_0x4ad8eb)[_0x8ac4('0x30')](function(_0x82a1c0){_0x2ec6b6[_0x8ac4('0x2a')]=_0x82a1c0;if(_0x494906['query']['includeAll']){_0x1fe391[_0x8ac4('0x49')]=[{'all':!![]}];}return db[_0x8ac4('0x37')][_0x8ac4('0x4a')](_0x1fe391);})[_0x8ac4('0x30')](function(_0x157e94){_0x2ec6b6[_0x8ac4('0x4b')]=_0x157e94;return _0x2ec6b6;})[_0x8ac4('0x30')](respondWithFilteredResult(_0x32ca2e,_0x1fe391))['catch'](handleError(_0x32ca2e,null));};exports[_0x8ac4('0x4c')]=function(_0x2a2d0e,_0x551501){var _0x1db2cd={'raw':![],'where':{'id':_0x2a2d0e[_0x8ac4('0x4d')]['id']}},_0xada0ff={};_0xada0ff['model']=_['keys'](db[_0x8ac4('0x37')]['rawAttributes']);_0xada0ff['query']=_[_0x8ac4('0x3d')](_0x2a2d0e[_0x8ac4('0x3c')]);_0xada0ff[_0x8ac4('0x3e')]=_[_0x8ac4('0x3f')](_0xada0ff[_0x8ac4('0x3b')],_0xada0ff[_0x8ac4('0x3c')]);_0x1db2cd[_0x8ac4('0x40')]=_[_0x8ac4('0x3f')](_0xada0ff['model'],qs[_0x8ac4('0x41')](_0x2a2d0e[_0x8ac4('0x3c')][_0x8ac4('0x41')]));_0x1db2cd[_0x8ac4('0x40')]=_0x1db2cd[_0x8ac4('0x40')][_0x8ac4('0x42')]?_0x1db2cd[_0x8ac4('0x40')]:_0xada0ff[_0x8ac4('0x3b')];if(_0x2a2d0e['query'][_0x8ac4('0x4e')]){_0x1db2cd[_0x8ac4('0x49')]=[{'all':!![]}];}_0x1db2cd=_[_0x8ac4('0x47')]({},_0x1db2cd,_0x2a2d0e[_0x8ac4('0x4f')]);return db[_0x8ac4('0x37')][_0x8ac4('0x50')](_0x1db2cd)[_0x8ac4('0x30')](handleEntityNotFound(_0x551501,null))[_0x8ac4('0x30')](respondWithResult(_0x551501,null))[_0x8ac4('0x51')](handleError(_0x551501,null));};exports['create']=function(_0x4fda74,_0x5729fe){return db[_0x8ac4('0x37')][_0x8ac4('0x52')](_0x4fda74[_0x8ac4('0x53')],{})[_0x8ac4('0x30')](function(_0x2c4c0d){var _0x51234c=_0x4fda74[_0x8ac4('0x54')][_0x8ac4('0x55')]({'plain':!![]});if(!_0x51234c)throw new Error(_0x8ac4('0x56'));if(_0x51234c['role']===_0x8ac4('0x54')){var _0x4db0aa=_0x2c4c0d[_0x8ac4('0x55')]({'plain':!![]});var _0xdd5984=_0x8ac4('0x57');return db['UserProfileSection'][_0x8ac4('0x50')]({'where':{'name':_0xdd5984,'userProfileId':_0x51234c[_0x8ac4('0x58')]},'raw':!![]})[_0x8ac4('0x30')](function(_0x1449cb){if(_0x1449cb&&_0x1449cb['autoAssociation']===0x0){return db[_0x8ac4('0x59')][_0x8ac4('0x52')]({'name':_0x4db0aa['name'],'resourceId':_0x4db0aa['id'],'type':_0x1449cb[_0x8ac4('0x33')],'sectionId':_0x1449cb['id']},{})[_0x8ac4('0x30')](function(){return _0x2c4c0d;});}else{return _0x2c4c0d;}})[_0x8ac4('0x51')](function(_0x572782){logger['error'](_0x8ac4('0x5a'),_0x572782);throw _0x572782;});}return _0x2c4c0d;})[_0x8ac4('0x30')](respondWithResult(_0x5729fe,0xc9))[_0x8ac4('0x51')](handleError(_0x5729fe,null));};exports[_0x8ac4('0x2f')]=function(_0x42add6,_0x1e6eeb){if(_0x42add6['body']['id']){delete _0x42add6['body']['id'];}return db['Team'][_0x8ac4('0x50')]({'where':{'id':_0x42add6[_0x8ac4('0x4d')]['id']}})[_0x8ac4('0x30')](handleEntityNotFound(_0x1e6eeb,null))[_0x8ac4('0x30')](saveUpdates(_0x42add6[_0x8ac4('0x53')],null))[_0x8ac4('0x30')](respondWithResult(_0x1e6eeb,null))[_0x8ac4('0x51')](handleError(_0x1e6eeb,null));};exports[_0x8ac4('0x5b')]=function(_0x4851f4,_0x4f94b3){var _0x1bb3bc=_0x4851f4[_0x8ac4('0x4d')]['id'];var _0x5cd268=[];return db[_0x8ac4('0x5c')][_0x8ac4('0x5d')](function(_0x5ed78d){var _0x2cae78=_0x8ac4('0x5e')+_0x1bb3bc;return db[_0x8ac4('0x5c')]['query'](_0x2cae78,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')]['SELECT'],'raw':!![],'transaction':_0x5ed78d})[_0x8ac4('0x30')](function(_0x4ed714){_0x5cd268=_[_0x8ac4('0x36')](_0x4ed714,function(_0x119989){return Number(_0x119989[_0x8ac4('0x61')]);});})[_0x8ac4('0x30')](function(){var _0x192067=_0x8ac4('0x62')+_0x1bb3bc;return db[_0x8ac4('0x5c')][_0x8ac4('0x3c')](_0x192067,{'type':db[_0x8ac4('0x5f')]['QueryTypes'][_0x8ac4('0x63')],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x16744d){var _0x5cd9bd=_[_0x8ac4('0x36')](_0x16744d,function(_0x2c06aa){return Number(_0x2c06aa[_0x8ac4('0x64')]);});return db[_0x8ac4('0x65')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'VoiceQueueId':{'$in':_0x5cd9bd}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){var _0x538230=_0x8ac4('0x66')+_0x1bb3bc;return db[_0x8ac4('0x5c')][_0x8ac4('0x3c')](_0x538230,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')]['SELECT'],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x5455e8){var _0x24e12e=_[_0x8ac4('0x36')](_0x5455e8,function(_0x2b1c36){return Number(_0x2b1c36[_0x8ac4('0x67')]);});return db[_0x8ac4('0x68')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'MailQueueId':{'$in':_0x24e12e}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){var _0x24c7b4=_0x8ac4('0x69')+_0x1bb3bc;return db['sequelize']['query'](_0x24c7b4,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')][_0x8ac4('0x63')],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x43d369){var _0x392cb8=_['map'](_0x43d369,function(_0x531ebb){return Number(_0x531ebb[_0x8ac4('0x6a')]);});return db[_0x8ac4('0x6b')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'SmsQueueId':{'$in':_0x392cb8}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){var _0x4d2239='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1bb3bc;return db[_0x8ac4('0x5c')]['query'](_0x4d2239,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')][_0x8ac4('0x63')],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x107a1b){var _0x2d7390=_[_0x8ac4('0x36')](_0x107a1b,function(_0x5f3f3d){return Number(_0x5f3f3d[_0x8ac4('0x6c')]);});return db[_0x8ac4('0x6d')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'ChatQueueId':{'$in':_0x2d7390}},'transaction':_0x5ed78d});})['then'](function(){var _0x1eca2c=_0x8ac4('0x6e')+_0x1bb3bc;return db[_0x8ac4('0x5c')][_0x8ac4('0x3c')](_0x1eca2c,{'type':db[_0x8ac4('0x5f')]['QueryTypes'][_0x8ac4('0x63')],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x38429f){var _0x2ddd0f=_['map'](_0x38429f,function(_0xdb06ad){return Number(_0xdb06ad[_0x8ac4('0x6f')]);});return db[_0x8ac4('0x70')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'FaxQueueId':{'$in':_0x2ddd0f}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){var _0x2e32d=_0x8ac4('0x71')+_0x1bb3bc;return db[_0x8ac4('0x5c')][_0x8ac4('0x3c')](_0x2e32d,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')]['SELECT'],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x324a67){var _0x22d559=_[_0x8ac4('0x36')](_0x324a67,function(_0x373ad7){return Number(_0x373ad7[_0x8ac4('0x72')]);});return db[_0x8ac4('0x73')]['destroy']({'where':{'UserId':{'$in':_0x5cd268},'OpenchannelQueueId':{'$in':_0x22d559}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){var _0x17b329=_0x8ac4('0x74')+_0x1bb3bc;return db[_0x8ac4('0x5c')]['query'](_0x17b329,{'type':db[_0x8ac4('0x5f')][_0x8ac4('0x60')][_0x8ac4('0x63')],'raw':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x311b28){var _0x189392=_[_0x8ac4('0x36')](_0x311b28,function(_0x486d68){return Number(_0x486d68[_0x8ac4('0x75')]);});return db[_0x8ac4('0x76')][_0x8ac4('0x5b')]({'where':{'UserId':{'$in':_0x5cd268},'WhatsappQueueId':{'$in':_0x189392}},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){return db['TeamVoicePrefix'][_0x8ac4('0x50')]({'where':{'TeamId':_0x1bb3bc}});})[_0x8ac4('0x30')](function(_0x28af2f){if(_0x28af2f===null){return;}return db[_0x8ac4('0x77')]['destroy']({'where':{'UserId':{'$in':_0x5cd268},'VoicePrefixId':_0x28af2f[_0x8ac4('0x78')]},'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(){return db[_0x8ac4('0x37')][_0x8ac4('0x5b')]({'where':{'id':_0x1bb3bc},'cascade':!![],'transaction':_0x5ed78d});})[_0x8ac4('0x30')](function(_0x19c25a){if(_0x19c25a===0x0){_0x4f94b3[_0x8ac4('0x24')](0x194);}else{return db[_0x8ac4('0x59')]['destroy']({'where':{'type':_0x8ac4('0x57'),'resourceId':_0x1bb3bc},'cascade':!![],'transaction':_0x5ed78d})['then'](function(){_0x4f94b3[_0x8ac4('0x25')](0xcc)[_0x8ac4('0x79')]();});}})[_0x8ac4('0x51')](function(_0x23ca90){_0x4f94b3[_0x8ac4('0x25')](0x1f4)[_0x8ac4('0x34')](_0x23ca90);});});};exports['getQueues']=function(_0x1d779b,_0xb3ecef,_0x153f10){return db[_0x8ac4('0x37')][_0x8ac4('0x7a')]({'where':{'id':_0x1d779b[_0x8ac4('0x4d')]['id']}})[_0x8ac4('0x30')](handleEntityNotFound(_0xb3ecef,null))['then'](function(_0x490a13){if(!_0x1d779b[_0x8ac4('0x3c')][_0x8ac4('0x7b')]||!utils[_0x8ac4('0x7c')](_0x1d779b[_0x8ac4('0x3c')][_0x8ac4('0x7b')])){throw new db[(_0x8ac4('0x5f'))]['ValidationError'](_0x8ac4('0x7d'));}var _0x24b1ef={};var _0x3f1827={};_0x3f1827[_0x8ac4('0x3b')]=_['keys'](db[_[_0x8ac4('0x7e')](_0x1d779b['query'][_0x8ac4('0x7b')][_0x8ac4('0x7f')]())+_0x8ac4('0x80')][_0x8ac4('0x38')]);_0x3f1827[_0x8ac4('0x3c')]=_[_0x8ac4('0x3d')](_0x1d779b[_0x8ac4('0x3c')]);_0x3f1827[_0x8ac4('0x3e')]=_['intersection'](_0x3f1827[_0x8ac4('0x3b')],_0x3f1827[_0x8ac4('0x3c')]);_0x24b1ef[_0x8ac4('0x40')]=_['intersection'](_0x3f1827['model'],qs['fields'](_0x1d779b[_0x8ac4('0x3c')]['fields']));_0x24b1ef[_0x8ac4('0x40')]=_0x24b1ef[_0x8ac4('0x40')][_0x8ac4('0x42')]?_0x24b1ef['attributes']:_0x3f1827['model'];_0x24b1ef[_0x8ac4('0x29')]=qs['limit'](_0x1d779b[_0x8ac4('0x3c')][_0x8ac4('0x29')]);_0x24b1ef['offset']=qs[_0x8ac4('0x27')](_0x1d779b[_0x8ac4('0x3c')][_0x8ac4('0x27')]);_0x24b1ef['order']=qs['sort'](_0x1d779b[_0x8ac4('0x3c')]['sort']);_0x24b1ef['where']=qs[_0x8ac4('0x3e')](_[_0x8ac4('0x81')](_0x1d779b['query'],_0x3f1827['filters']));_0x24b1ef=_['merge']({},_0x24b1ef,_0x1d779b[_0x8ac4('0x4f')]);return _0x490a13[_0x8ac4('0x55')+_[_0x8ac4('0x7e')](_0x1d779b[_0x8ac4('0x3c')]['channel'][_0x8ac4('0x7f')]())+_0x8ac4('0x82')](_0x24b1ef);})['then'](respondWithResult(_0xb3ecef,null))['catch'](handleError(_0xb3ecef,null));};exports[_0x8ac4('0x83')]=function(_0x28cd42,_0x2c19b1,_0x2a6f13){return db[_0x8ac4('0x37')][_0x8ac4('0x7a')]({'where':{'id':_0x28cd42[_0x8ac4('0x4d')]['id']}})[_0x8ac4('0x30')](function(_0x839c4a){if(_0x839c4a){if(!_0x28cd42['body'][_0x8ac4('0x7b')]||!utils[_0x8ac4('0x7c')](_0x28cd42[_0x8ac4('0x53')][_0x8ac4('0x7b')])){throw new db[(_0x8ac4('0x5f'))][(_0x8ac4('0x84'))](_0x8ac4('0x7d'));}return _0x839c4a[_0x8ac4('0x85')+_['capitalize'](_0x28cd42[_0x8ac4('0x53')][_0x8ac4('0x7b')]['toLowerCase']())+_0x8ac4('0x82')](_0x28cd42[_0x8ac4('0x53')][_0x8ac4('0x86')]);}return null;})[_0x8ac4('0x30')](handleEntityNotFound(_0x2c19b1,null))[_0x8ac4('0x30')](respondWithStatusCode(_0x2c19b1,null))[_0x8ac4('0x51')](handleError(_0x2c19b1,null));};exports[_0x8ac4('0x87')]=function(_0xe9a373,_0x414fdf,_0x1584e2){return db[_0x8ac4('0x37')]['findOne']({'where':{'id':_0xe9a373[_0x8ac4('0x4d')]['id']}})['then'](function(_0x2f6591){if(_0x2f6591){if(!_0xe9a373[_0x8ac4('0x3c')][_0x8ac4('0x7b')]||!utils[_0x8ac4('0x7c')](_0xe9a373[_0x8ac4('0x3c')]['channel'])){throw new db[(_0x8ac4('0x5f'))][(_0x8ac4('0x84'))](_0x8ac4('0x7d'));}return _0x2f6591[_0x8ac4('0x88')+_['capitalize'](_0xe9a373[_0x8ac4('0x3c')][_0x8ac4('0x7b')][_0x8ac4('0x7f')]())+'Queues'](_0xe9a373[_0x8ac4('0x3c')][_0x8ac4('0x86')]);}return null;})[_0x8ac4('0x30')](handleEntityNotFound(_0x414fdf,null))[_0x8ac4('0x30')](respondWithStatusCode(_0x414fdf,null))[_0x8ac4('0x51')](handleError(_0x414fdf,null));};exports[_0x8ac4('0x89')]=function(_0x376957,_0x50780c){var _0x114e8e=_[_0x8ac4('0x8a')](_0x376957[_0x8ac4('0x53')]['ids'])?_0x376957[_0x8ac4('0x53')][_0x8ac4('0x86')]:[_0x376957[_0x8ac4('0x53')][_0x8ac4('0x86')]];var _0xef8380=_0x376957[_0x8ac4('0x4d')]['id'];return db['Team']['find']({'where':{'id':_0xef8380}})[_0x8ac4('0x30')](handleEntityNotFound(_0x50780c,null))[_0x8ac4('0x30')](function(_0x412773){if(_0x412773){var _0x405d40=[_0x8ac4('0x8b'),_0x8ac4('0x8c'),'Mail',_0x8ac4('0x8d'),_0x8ac4('0x8e'),_0x8ac4('0x8f'),_0x8ac4('0x90')];return db[_0x8ac4('0x5c')][_0x8ac4('0x5d')](function(_0x579094){var _0x26d20f=_['map'](_0x405d40,function(_0x346017){var _0xaccebd={'attributes':['id',_0x8ac4('0x33')]};if(_0x346017===_0x8ac4('0x8b')){_0xaccebd[_0x8ac4('0x91')]={'attributes':[_0x8ac4('0x92')]};}return _0x412773[_0x8ac4('0x55')+_0x346017+_0x8ac4('0x82')](_0xaccebd)[_0x8ac4('0x30')](function(_0x474d17){var _0x37879f=_['map'](_0x474d17,function(_0x508ac4){var _0x4adfa6=_[_0x8ac4('0x36')](_0x114e8e,function(_0x1e5c96){var _0x23d6a5={'where':{'UserId':_0x1e5c96,[_0x346017+_0x8ac4('0x93')]:_0x508ac4['id']},'transaction':_0x579094};if(_0x346017==='Voice'){_0x23d6a5['defaults']={'penalty':_0x508ac4['TeamVoiceQueue']['penalty']};}return db[_0x8ac4('0x94')+_0x346017+'Queue'][_0x8ac4('0x95')](_0x23d6a5)['then'](function(){socket[_0x8ac4('0x96')](_0x8ac4('0x54')+_0x346017+_0x8ac4('0x97'),{'UserId':_0x1e5c96,[_0x346017+_0x8ac4('0x93')]:_0x508ac4['id']});if(_0x346017!==_0x8ac4('0x8b')){return;}return db['User']['findAll']({'where':{'id':_0x114e8e,'online':0x1},'attributes':['id',_0x8ac4('0x33'),_0x8ac4('0x98'),_0x8ac4('0x99'),'interface'],'raw':!![]})[_0x8ac4('0x30')](function(_0x3b705e){var _0x5a563a=_['map'](_0x3b705e,function(_0xd0dd67){return db[_0x8ac4('0x9a')][_0x8ac4('0x9b')]({'membername':_0xd0dd67[_0x8ac4('0x33')],'UserId':_0xd0dd67['id'],'queue_name':_0x508ac4['name'],'VoiceQueueId':_0x508ac4['id'],'interface':_[_0x8ac4('0x9c')](_0xd0dd67[_0x8ac4('0x9d')])?util['format'](_0x8ac4('0x9e'),_0xd0dd67['name']):_0xd0dd67[_0x8ac4('0x9d')],'paused':_0xd0dd67[_0x8ac4('0x99')]||![],'penalty':_0x508ac4[_0x8ac4('0x9f')][_0x8ac4('0x92')]},{'transaction':_0x579094});});return Promise[_0x8ac4('0xa0')](_0x5a563a);});});});return Promise[_0x8ac4('0xa0')](_0x4adfa6);});return Promise[_0x8ac4('0xa0')](_0x37879f);})[_0x8ac4('0x30')](function(){return db[_0x8ac4('0xa1')][_0x8ac4('0x7a')]({'where':{'teamId':_0xef8380}})[_0x8ac4('0x30')](function(_0x2cff55){if(_0x2cff55){var _0x9c7fcb=_['map'](_0x114e8e,function(_0x3ed52a){db['UserVoicePrefix'][_0x8ac4('0x9b')]({'UserId':_0x3ed52a,'VoicePrefixId':_0x2cff55[_0x8ac4('0x78')]});});return Promise[_0x8ac4('0xa0')](_0x9c7fcb);}});});});return Promise[_0x8ac4('0xa0')](_0x26d20f)[_0x8ac4('0x30')](function(){return _0x412773[_0x8ac4('0x89')](_0x114e8e,{'transaction':_0x579094})['spread'](function(_0x45c1d4){return _0x45c1d4;});});});}})[_0x8ac4('0x30')](respondWithResult(_0x50780c,null))[_0x8ac4('0x51')](handleError(_0x50780c,null));};exports[_0x8ac4('0xa2')]=function(_0x1e1a55,_0x87fe04){var _0x2f28d2=_[_0x8ac4('0x8a')](_0x1e1a55['query'][_0x8ac4('0x86')])?_0x1e1a55[_0x8ac4('0x3c')][_0x8ac4('0x86')]:[_0x1e1a55[_0x8ac4('0x3c')][_0x8ac4('0x86')]];var _0x30ae93=_0x1e1a55[_0x8ac4('0x4d')]['id'];return db[_0x8ac4('0x37')][_0x8ac4('0x50')]({'where':{'id':_0x30ae93}})[_0x8ac4('0x30')](handleEntityNotFound(_0x87fe04,null))[_0x8ac4('0x30')](function(_0x284b17){if(_0x284b17){var _0x264c4d=[_0x8ac4('0x8b'),'Chat',_0x8ac4('0xa3'),_0x8ac4('0x8d'),_0x8ac4('0x8e'),'Openchannel',_0x8ac4('0x90')];return db[_0x8ac4('0x5c')][_0x8ac4('0x5d')](function(_0x2cf146){var _0x20c31d=_[_0x8ac4('0x36')](_0x264c4d,function(_0x1c1f55){var _0x577bb4={'attributes':['id','name']};return _0x284b17[_0x8ac4('0x55')+_0x1c1f55+_0x8ac4('0x82')](_0x577bb4)['then'](function(_0x551afe){var _0x41d625=_[_0x8ac4('0x36')](_0x551afe,function(_0x7732a6){return _0x7732a6[_0x8ac4('0xa2')](_0x2f28d2,{'transaction':_0x2cf146})[_0x8ac4('0x30')](function(){var _0x545136=_[_0x8ac4('0x36')](_0x2f28d2,function(_0x269562){socket[_0x8ac4('0x96')](_0x8ac4('0x54')+_0x1c1f55+_0x8ac4('0xa4'),{'UserId':Number(_0x269562),[_0x1c1f55+_0x8ac4('0x93')]:_0x7732a6['id']});if(_0x1c1f55!=='Voice'){return;}return db[_0x8ac4('0x9a')][_0x8ac4('0x5b')]({'where':{'VoiceQueueId':_0x7732a6['id'],'UserId':_0x269562},'transaction':_0x2cf146});});return Promise[_0x8ac4('0xa0')](_0x545136);});});return Promise[_0x8ac4('0xa0')](_0x41d625);});});return Promise[_0x8ac4('0xa0')](_0x20c31d)['then'](function(){return _0x284b17[_0x8ac4('0xa2')](_0x2f28d2,{'transaction':_0x2cf146});})['then'](function(){return db[_0x8ac4('0xa1')]['findOne']({'where':{'teamId':_0x30ae93}})[_0x8ac4('0x30')](function(_0x484699){if(_0x484699){var _0x2b53eb=_[_0x8ac4('0x36')](_0x2f28d2,function(_0x107785){db[_0x8ac4('0x77')][_0x8ac4('0x5b')]({'where':{'UserId':_0x107785,'VoicePrefixId':_0x484699[_0x8ac4('0x78')]}});});return Promise[_0x8ac4('0xa0')](_0x2b53eb);}});});});}})[_0x8ac4('0x30')](respondWithStatusCode(_0x87fe04,null))[_0x8ac4('0x51')](handleError(_0x87fe04,null));};exports[_0x8ac4('0xa5')]=function(_0x2bd2fc,_0x3e5960,_0x429ac9){var _0x2a84dd={};var _0x14fd4c={};var _0x176f55;var _0x2dda7a;return db[_0x8ac4('0x37')][_0x8ac4('0x7a')]({'where':{'id':_0x2bd2fc[_0x8ac4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e5960,null))[_0x8ac4('0x30')](function(_0x93cca4){if(_0x93cca4){_0x176f55=_0x93cca4;_0x14fd4c['model']=_[_0x8ac4('0x3d')](db['User']['rawAttributes']);_0x14fd4c[_0x8ac4('0x3c')]=_[_0x8ac4('0x3d')](_0x2bd2fc['query']);_0x14fd4c['filters']=_[_0x8ac4('0x3f')](_0x14fd4c['model'],_0x14fd4c['query']);_0x2a84dd[_0x8ac4('0x40')]=_['intersection'](_0x14fd4c[_0x8ac4('0x3b')],qs['fields'](_0x2bd2fc[_0x8ac4('0x3c')]['fields']));_0x2a84dd['attributes']=_0x2a84dd[_0x8ac4('0x40')][_0x8ac4('0x42')]?_0x2a84dd[_0x8ac4('0x40')]:_0x14fd4c[_0x8ac4('0x3b')];_0x2a84dd['order']=qs['sort'](_0x2bd2fc[_0x8ac4('0x3c')][_0x8ac4('0x44')]);_0x2a84dd[_0x8ac4('0x45')]=qs[_0x8ac4('0x3e')](_['pick'](_0x2bd2fc[_0x8ac4('0x3c')],_0x14fd4c[_0x8ac4('0x3e')]));if(_0x2bd2fc[_0x8ac4('0x3c')]['filter']){_0x2a84dd[_0x8ac4('0x45')]=_[_0x8ac4('0x47')](_0x2a84dd['where'],{'$or':_[_0x8ac4('0x36')](_0x2a84dd['attributes'],function(_0x475a83){var _0x248a45={};_0x248a45[_0x475a83]={'$like':'%'+_0x2bd2fc[_0x8ac4('0x3c')][_0x8ac4('0x46')]+'%'};return _0x248a45;})});}_0x2a84dd=_[_0x8ac4('0x47')]({},_0x2a84dd,_0x2bd2fc[_0x8ac4('0x4f')]);return _0x176f55[_0x8ac4('0xa5')](_0x2a84dd);}})[_0x8ac4('0x30')](function(_0x1f6ab3){if(_0x1f6ab3){_0x2dda7a=_0x1f6ab3[_0x8ac4('0x42')];if(!_0x2bd2fc[_0x8ac4('0x3c')][_0x8ac4('0x43')](_0x8ac4('0xa6'))){_0x2a84dd[_0x8ac4('0x29')]=qs[_0x8ac4('0x29')](_0x2bd2fc[_0x8ac4('0x3c')][_0x8ac4('0x29')]);_0x2a84dd[_0x8ac4('0x27')]=qs['offset'](_0x2bd2fc[_0x8ac4('0x3c')][_0x8ac4('0x27')]);}return _0x176f55['getAgents'](_0x2a84dd);}})[_0x8ac4('0x30')](function(_0x431301){if(_0x431301){return _0x431301?{'count':_0x2dda7a,'rows':_0x431301}:null;}})['then'](respondWithResult(_0x3e5960,null))[_0x8ac4('0x51')](handleError(_0x3e5960,null));}; \ No newline at end of file +var _0x4e71=['error','stack','name','send','index','map','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','merge','type','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','end','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','sort','capitalize','addQueues','add','ids','removeQueues','remove','Queues','addAgents','isArray','Voice','Mail','Fax','transaction','through','TeamVoiceQueue','penalty','User','findOrCreate','emit','user','Queue:save','QueueId','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Chat','Openchannel','Whatsapp','Queue:remove','UserVoicePrefix','filter','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4e71,0x1ba));var _0x14e7=function(_0x376267,_0x1b2c72){_0x376267=_0x376267-0x0;var _0x51c56c=_0x4e71[_0x376267];return _0x51c56c;};'use strict';var emlformat=require(_0x14e7('0x0'));var rimraf=require(_0x14e7('0x1'));var zipdir=require(_0x14e7('0x2'));var jsonpatch=require(_0x14e7('0x3'));var rp=require(_0x14e7('0x4'));var moment=require('moment');var BPromise=require(_0x14e7('0x5'));var Mustache=require(_0x14e7('0x6'));var util=require('util');var path=require(_0x14e7('0x7'));var sox=require(_0x14e7('0x8'));var csv=require(_0x14e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14e7('0xa'));var _=require(_0x14e7('0xb'));var squel=require('squel');var crypto=require(_0x14e7('0xc'));var jsforce=require(_0x14e7('0xd'));var deskjs=require(_0x14e7('0xe'));var toCsv=require(_0x14e7('0x9'));var querystring=require(_0x14e7('0xf'));var Papa=require(_0x14e7('0x10'));var Redis=require(_0x14e7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14e7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x14e7('0x14'));var config=require(_0x14e7('0x15'));var licenseUtil=require(_0x14e7('0x16'));var db=require(_0x14e7('0x17'))['db'];config[_0x14e7('0x18')]=_[_0x14e7('0x19')](config[_0x14e7('0x18')],{'host':_0x14e7('0x1a'),'port':0x18eb});var socket=require(_0x14e7('0x1b'))(new Redis(config[_0x14e7('0x18')]));require(_0x14e7('0x1c'))[_0x14e7('0x1d')](socket);function respondWithStatusCode(_0x31f143,_0xcc174a){_0xcc174a=_0xcc174a||0xcc;return function(_0x165041){if(_0x165041){return _0x31f143[_0x14e7('0x1e')](_0xcc174a);}return _0x31f143[_0x14e7('0x1f')](_0xcc174a)['end']();};}function respondWithResult(_0x6c7b88,_0x4a2fbf){_0x4a2fbf=_0x4a2fbf||0xc8;return function(_0x1a0a6a){if(_0x1a0a6a){return _0x6c7b88[_0x14e7('0x1f')](_0x4a2fbf)[_0x14e7('0x20')](_0x1a0a6a);}};}function respondWithFilteredResult(_0x3be187,_0x32d9eb){return function(_0x54a999){if(_0x54a999){var _0x4f128c=typeof _0x32d9eb[_0x14e7('0x21')]===_0x14e7('0x22')&&typeof _0x32d9eb[_0x14e7('0x23')]===_0x14e7('0x22');var _0x256cd4=_0x54a999[_0x14e7('0x24')];var _0xea17ae=_0x4f128c?0x0:_0x32d9eb[_0x14e7('0x21')];var _0x1f3505=_0x4f128c?_0x54a999[_0x14e7('0x24')]:_0x32d9eb[_0x14e7('0x21')]+_0x32d9eb[_0x14e7('0x23')];var _0x128f61;if(_0x1f3505>=_0x256cd4){_0x1f3505=_0x256cd4;_0x128f61=0xc8;}else{_0x128f61=0xce;}_0x3be187[_0x14e7('0x1f')](_0x128f61);return _0x3be187['set'](_0x14e7('0x25'),_0xea17ae+'-'+_0x1f3505+'/'+_0x256cd4)[_0x14e7('0x20')](_0x54a999);}return null;};}function patchUpdates(_0x347305){return function(_0x5e3218){try{jsonpatch[_0x14e7('0x26')](_0x5e3218,_0x347305,!![]);}catch(_0x5c9615){return BPromise[_0x14e7('0x27')](_0x5c9615);}return _0x5e3218['save']();};}function saveUpdates(_0x27b7ee,_0x282f78){return function(_0x45f579){if(_0x45f579){return _0x45f579['update'](_0x27b7ee)[_0x14e7('0x28')](function(_0x195fa7){return _0x195fa7;});}return null;};}function handleEntityNotFound(_0x220e03,_0x5c0a7e){return function(_0x349e8e){if(!_0x349e8e){_0x220e03[_0x14e7('0x1e')](0x194);}return _0x349e8e;};}function handleError(_0x590861,_0x3c14ca){_0x3c14ca=_0x3c14ca||0x1f4;return function(_0x32a5fc){logger[_0x14e7('0x29')](_0x32a5fc[_0x14e7('0x2a')]);if(_0x32a5fc[_0x14e7('0x2b')]){delete _0x32a5fc[_0x14e7('0x2b')];}_0x590861[_0x14e7('0x1f')](_0x3c14ca)[_0x14e7('0x2c')](_0x32a5fc);};}exports[_0x14e7('0x2d')]=function(_0x575376,_0x5bf2fb){var _0x50106a={},_0x3d61a2={},_0x5403a9={'count':0x0,'rows':[]};var _0x584fb5=_[_0x14e7('0x2e')](db['Team']['rawAttributes'],function(_0x296c94){return{'name':_0x296c94['fieldName'],'type':_0x296c94['type'][_0x14e7('0x2f')]};});_0x3d61a2[_0x14e7('0x30')]=_[_0x14e7('0x2e')](_0x584fb5,_0x14e7('0x2b'));_0x3d61a2[_0x14e7('0x31')]=_[_0x14e7('0x32')](_0x575376[_0x14e7('0x31')]);_0x3d61a2['filters']=_[_0x14e7('0x33')](_0x3d61a2['model'],_0x3d61a2[_0x14e7('0x31')]);_0x50106a['attributes']=_[_0x14e7('0x33')](_0x3d61a2['model'],qs[_0x14e7('0x34')](_0x575376['query'][_0x14e7('0x34')]));_0x50106a[_0x14e7('0x35')]=_0x50106a[_0x14e7('0x35')]['length']?_0x50106a['attributes']:_0x3d61a2[_0x14e7('0x30')];if(!_0x575376[_0x14e7('0x31')][_0x14e7('0x36')](_0x14e7('0x37'))){_0x50106a[_0x14e7('0x23')]=qs['limit'](_0x575376[_0x14e7('0x31')]['limit']);_0x50106a[_0x14e7('0x21')]=qs[_0x14e7('0x21')](_0x575376[_0x14e7('0x31')][_0x14e7('0x21')]);}_0x50106a[_0x14e7('0x38')]=qs['sort'](_0x575376[_0x14e7('0x31')]['sort']);_0x50106a[_0x14e7('0x39')]=qs[_0x14e7('0x3a')](_[_0x14e7('0x3b')](_0x575376[_0x14e7('0x31')],_0x3d61a2[_0x14e7('0x3a')]),_0x584fb5);if(_0x575376[_0x14e7('0x31')]['filter']){_0x50106a[_0x14e7('0x39')]=_[_0x14e7('0x3c')](_0x50106a['where'],{'$or':_[_0x14e7('0x2e')](_0x584fb5,function(_0xfd693b){if(_0xfd693b[_0x14e7('0x3d')]!==_0x14e7('0x3e')){var _0x4d8e35={};_0x4d8e35[_0xfd693b['name']]={'$like':'%'+_0x575376[_0x14e7('0x31')]['filter']+'%'};return _0x4d8e35;}})});}_0x50106a=_['merge']({},_0x50106a,_0x575376[_0x14e7('0x3f')]);var _0x5c6d5a={'where':_0x50106a[_0x14e7('0x39')]};return db[_0x14e7('0x40')]['count'](_0x5c6d5a)[_0x14e7('0x28')](function(_0x10d26d){_0x5403a9[_0x14e7('0x24')]=_0x10d26d;if(_0x575376[_0x14e7('0x31')][_0x14e7('0x41')]){_0x50106a[_0x14e7('0x42')]=[{'all':!![]}];}return db[_0x14e7('0x40')][_0x14e7('0x43')](_0x50106a);})[_0x14e7('0x28')](function(_0x2121dd){_0x5403a9[_0x14e7('0x44')]=_0x2121dd;return _0x5403a9;})[_0x14e7('0x28')](respondWithFilteredResult(_0x5bf2fb,_0x50106a))[_0x14e7('0x45')](handleError(_0x5bf2fb,null));};exports[_0x14e7('0x46')]=function(_0x4299c4,_0x24f2da){var _0x1843a0={'raw':![],'where':{'id':_0x4299c4[_0x14e7('0x47')]['id']}},_0x4b0f5b={};_0x4b0f5b[_0x14e7('0x30')]=_['keys'](db[_0x14e7('0x40')][_0x14e7('0x48')]);_0x4b0f5b[_0x14e7('0x31')]=_[_0x14e7('0x32')](_0x4299c4[_0x14e7('0x31')]);_0x4b0f5b[_0x14e7('0x3a')]=_[_0x14e7('0x33')](_0x4b0f5b[_0x14e7('0x30')],_0x4b0f5b['query']);_0x1843a0[_0x14e7('0x35')]=_['intersection'](_0x4b0f5b[_0x14e7('0x30')],qs['fields'](_0x4299c4[_0x14e7('0x31')][_0x14e7('0x34')]));_0x1843a0['attributes']=_0x1843a0[_0x14e7('0x35')][_0x14e7('0x49')]?_0x1843a0[_0x14e7('0x35')]:_0x4b0f5b['model'];if(_0x4299c4[_0x14e7('0x31')][_0x14e7('0x41')]){_0x1843a0[_0x14e7('0x42')]=[{'all':!![]}];}_0x1843a0=_[_0x14e7('0x3c')]({},_0x1843a0,_0x4299c4['options']);return db[_0x14e7('0x40')]['find'](_0x1843a0)['then'](handleEntityNotFound(_0x24f2da,null))[_0x14e7('0x28')](respondWithResult(_0x24f2da,null))[_0x14e7('0x45')](handleError(_0x24f2da,null));};exports[_0x14e7('0x4a')]=function(_0x148701,_0xb81ea3){return db[_0x14e7('0x40')][_0x14e7('0x4a')](_0x148701[_0x14e7('0x4b')],{})[_0x14e7('0x28')](function(_0x20b029){var _0x5ce09e=_0x148701['user'][_0x14e7('0x4c')]({'plain':!![]});if(!_0x5ce09e)throw new Error(_0x14e7('0x4d'));if(_0x5ce09e[_0x14e7('0x4e')]==='user'){var _0x3aeba7=_0x20b029[_0x14e7('0x4c')]({'plain':!![]});var _0x61dc98=_0x14e7('0x4f');return db[_0x14e7('0x50')]['find']({'where':{'name':_0x61dc98,'userProfileId':_0x5ce09e[_0x14e7('0x51')]},'raw':!![]})['then'](function(_0x2f53b9){if(_0x2f53b9&&_0x2f53b9[_0x14e7('0x52')]===0x0){return db['UserProfileResource'][_0x14e7('0x4a')]({'name':_0x3aeba7[_0x14e7('0x2b')],'resourceId':_0x3aeba7['id'],'type':_0x2f53b9[_0x14e7('0x2b')],'sectionId':_0x2f53b9['id']},{})[_0x14e7('0x28')](function(){return _0x20b029;});}else{return _0x20b029;}})[_0x14e7('0x45')](function(_0x38acaa){logger[_0x14e7('0x29')](_0x14e7('0x53'),_0x38acaa);throw _0x38acaa;});}return _0x20b029;})['then'](respondWithResult(_0xb81ea3,0xc9))['catch'](handleError(_0xb81ea3,null));};exports[_0x14e7('0x54')]=function(_0x26c4d0,_0x1ec67b){if(_0x26c4d0[_0x14e7('0x4b')]['id']){delete _0x26c4d0[_0x14e7('0x4b')]['id'];}return db[_0x14e7('0x40')][_0x14e7('0x55')]({'where':{'id':_0x26c4d0[_0x14e7('0x47')]['id']}})[_0x14e7('0x28')](handleEntityNotFound(_0x1ec67b,null))[_0x14e7('0x28')](saveUpdates(_0x26c4d0[_0x14e7('0x4b')],null))[_0x14e7('0x28')](respondWithResult(_0x1ec67b,null))[_0x14e7('0x45')](handleError(_0x1ec67b,null));};exports[_0x14e7('0x56')]=function(_0x1841cb,_0x5be503){var _0x274f7b=_0x1841cb[_0x14e7('0x47')]['id'];var _0x189286=[];return db[_0x14e7('0x57')]['transaction'](function(_0x50283c){var _0x18fff5=_0x14e7('0x58')+_0x274f7b;return db[_0x14e7('0x57')][_0x14e7('0x31')](_0x18fff5,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')][_0x14e7('0x5b')],'raw':!![],'transaction':_0x50283c})[_0x14e7('0x28')](function(_0x32fbfc){_0x189286=_[_0x14e7('0x2e')](_0x32fbfc,function(_0x46faac){return Number(_0x46faac[_0x14e7('0x5c')]);});})[_0x14e7('0x28')](function(){var _0x2e9e50=_0x14e7('0x5d')+_0x274f7b;return db[_0x14e7('0x57')][_0x14e7('0x31')](_0x2e9e50,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')]['SELECT'],'raw':!![],'transaction':_0x50283c});})[_0x14e7('0x28')](function(_0x30bc72){var _0x203d15=_[_0x14e7('0x2e')](_0x30bc72,function(_0x45d7a0){return Number(_0x45d7a0[_0x14e7('0x5e')]);});return db['UserVoiceQueue'][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'VoiceQueueId':{'$in':_0x203d15}},'transaction':_0x50283c});})[_0x14e7('0x28')](function(){var _0x1ae9e8=_0x14e7('0x5f')+_0x274f7b;return db[_0x14e7('0x57')][_0x14e7('0x31')](_0x1ae9e8,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')]['SELECT'],'raw':!![],'transaction':_0x50283c});})['then'](function(_0x505a01){var _0x396ebb=_['map'](_0x505a01,function(_0x339799){return Number(_0x339799[_0x14e7('0x60')]);});return db[_0x14e7('0x61')]['destroy']({'where':{'UserId':{'$in':_0x189286},'MailQueueId':{'$in':_0x396ebb}},'transaction':_0x50283c});})['then'](function(){var _0x3a889f=_0x14e7('0x62')+_0x274f7b;return db['sequelize'][_0x14e7('0x31')](_0x3a889f,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')][_0x14e7('0x5b')],'raw':!![],'transaction':_0x50283c});})[_0x14e7('0x28')](function(_0x1ff2f5){var _0x5001c8=_[_0x14e7('0x2e')](_0x1ff2f5,function(_0x1665b7){return Number(_0x1665b7[_0x14e7('0x63')]);});return db[_0x14e7('0x64')]['destroy']({'where':{'UserId':{'$in':_0x189286},'SmsQueueId':{'$in':_0x5001c8}},'transaction':_0x50283c});})[_0x14e7('0x28')](function(){var _0x505cc1=_0x14e7('0x65')+_0x274f7b;return db[_0x14e7('0x57')][_0x14e7('0x31')](_0x505cc1,{'type':db['Sequelize'][_0x14e7('0x5a')][_0x14e7('0x5b')],'raw':!![],'transaction':_0x50283c});})[_0x14e7('0x28')](function(_0xf32050){var _0x448294=_['map'](_0xf32050,function(_0x1d9dec){return Number(_0x1d9dec[_0x14e7('0x66')]);});return db[_0x14e7('0x67')][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'ChatQueueId':{'$in':_0x448294}},'transaction':_0x50283c});})['then'](function(){var _0xbb5a=_0x14e7('0x68')+_0x274f7b;return db['sequelize'][_0x14e7('0x31')](_0xbb5a,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')]['SELECT'],'raw':!![],'transaction':_0x50283c});})[_0x14e7('0x28')](function(_0x3786e0){var _0x4cda5b=_[_0x14e7('0x2e')](_0x3786e0,function(_0x151f40){return Number(_0x151f40['FaxQueueId']);});return db[_0x14e7('0x69')][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'FaxQueueId':{'$in':_0x4cda5b}},'transaction':_0x50283c});})[_0x14e7('0x28')](function(){var _0x14210b=_0x14e7('0x6a')+_0x274f7b;return db[_0x14e7('0x57')]['query'](_0x14210b,{'type':db[_0x14e7('0x59')][_0x14e7('0x5a')][_0x14e7('0x5b')],'raw':!![],'transaction':_0x50283c});})['then'](function(_0x45c3f7){var _0x4240c5=_[_0x14e7('0x2e')](_0x45c3f7,function(_0x4f2142){return Number(_0x4f2142[_0x14e7('0x6b')]);});return db['UserOpenchannelQueue'][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'OpenchannelQueueId':{'$in':_0x4240c5}},'transaction':_0x50283c});})['then'](function(){var _0x34201e='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x274f7b;return db[_0x14e7('0x57')][_0x14e7('0x31')](_0x34201e,{'type':db[_0x14e7('0x59')]['QueryTypes'][_0x14e7('0x5b')],'raw':!![],'transaction':_0x50283c});})['then'](function(_0xde4bb9){var _0x572542=_[_0x14e7('0x2e')](_0xde4bb9,function(_0x158178){return Number(_0x158178['WhatsappQueueId']);});return db[_0x14e7('0x6c')][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'WhatsappQueueId':{'$in':_0x572542}},'transaction':_0x50283c});})['then'](function(){return db[_0x14e7('0x6d')]['find']({'where':{'TeamId':_0x274f7b}});})[_0x14e7('0x28')](function(_0x4bb27f){if(_0x4bb27f===null){return;}return db['UserVoicePrefix'][_0x14e7('0x56')]({'where':{'UserId':{'$in':_0x189286},'VoicePrefixId':_0x4bb27f[_0x14e7('0x6e')]},'transaction':_0x50283c});})[_0x14e7('0x28')](function(){return db[_0x14e7('0x40')][_0x14e7('0x56')]({'where':{'id':_0x274f7b},'cascade':!![],'transaction':_0x50283c});})['then'](function(_0x61aeed){if(_0x61aeed===0x0){_0x5be503[_0x14e7('0x1e')](0x194);}else{return db[_0x14e7('0x6f')][_0x14e7('0x56')]({'where':{'type':'Teams','resourceId':_0x274f7b},'cascade':!![],'transaction':_0x50283c})[_0x14e7('0x28')](function(){_0x5be503['status'](0xcc)[_0x14e7('0x70')]();});}})[_0x14e7('0x45')](function(_0x48a556){_0x5be503[_0x14e7('0x1f')](0x1f4)[_0x14e7('0x2c')](_0x48a556);});});};exports[_0x14e7('0x71')]=function(_0x3ea04d,_0x4bfd35,_0x4fd3c7){return db[_0x14e7('0x40')][_0x14e7('0x72')]({'where':{'id':_0x3ea04d['params']['id']}})[_0x14e7('0x28')](handleEntityNotFound(_0x4bfd35,null))['then'](function(_0x5c08c2){if(!_0x3ea04d[_0x14e7('0x31')][_0x14e7('0x73')]||!utils[_0x14e7('0x74')](_0x3ea04d[_0x14e7('0x31')][_0x14e7('0x73')])){throw new db['Sequelize'][(_0x14e7('0x75'))](_0x14e7('0x76'));}var _0x3b150b={};var _0x48036f={};_0x48036f['model']=_[_0x14e7('0x32')](db[_['capitalize'](_0x3ea04d[_0x14e7('0x31')][_0x14e7('0x73')][_0x14e7('0x77')]())+_0x14e7('0x78')]['rawAttributes']);_0x48036f[_0x14e7('0x31')]=_[_0x14e7('0x32')](_0x3ea04d['query']);_0x48036f[_0x14e7('0x3a')]=_[_0x14e7('0x33')](_0x48036f[_0x14e7('0x30')],_0x48036f['query']);_0x3b150b[_0x14e7('0x35')]=_[_0x14e7('0x33')](_0x48036f[_0x14e7('0x30')],qs[_0x14e7('0x34')](_0x3ea04d[_0x14e7('0x31')]['fields']));_0x3b150b['attributes']=_0x3b150b[_0x14e7('0x35')][_0x14e7('0x49')]?_0x3b150b['attributes']:_0x48036f[_0x14e7('0x30')];_0x3b150b[_0x14e7('0x23')]=qs[_0x14e7('0x23')](_0x3ea04d[_0x14e7('0x31')]['limit']);_0x3b150b[_0x14e7('0x21')]=qs[_0x14e7('0x21')](_0x3ea04d[_0x14e7('0x31')]['offset']);_0x3b150b[_0x14e7('0x38')]=qs[_0x14e7('0x79')](_0x3ea04d[_0x14e7('0x31')]['sort']);_0x3b150b[_0x14e7('0x39')]=qs['filters'](_[_0x14e7('0x3b')](_0x3ea04d[_0x14e7('0x31')],_0x48036f['filters']));_0x3b150b=_[_0x14e7('0x3c')]({},_0x3b150b,_0x3ea04d[_0x14e7('0x3f')]);return _0x5c08c2['get'+_[_0x14e7('0x7a')](_0x3ea04d[_0x14e7('0x31')][_0x14e7('0x73')][_0x14e7('0x77')]())+'Queues'](_0x3b150b);})[_0x14e7('0x28')](respondWithResult(_0x4bfd35,null))[_0x14e7('0x45')](handleError(_0x4bfd35,null));};exports[_0x14e7('0x7b')]=function(_0x201275,_0x407e20,_0x11c031){return db[_0x14e7('0x40')][_0x14e7('0x72')]({'where':{'id':_0x201275[_0x14e7('0x47')]['id']}})[_0x14e7('0x28')](function(_0x363e33){if(_0x363e33){if(!_0x201275['body'][_0x14e7('0x73')]||!utils[_0x14e7('0x74')](_0x201275['body'][_0x14e7('0x73')])){throw new db[(_0x14e7('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x363e33[_0x14e7('0x7c')+_[_0x14e7('0x7a')](_0x201275[_0x14e7('0x4b')][_0x14e7('0x73')]['toLowerCase']())+'Queues'](_0x201275[_0x14e7('0x4b')][_0x14e7('0x7d')]);}return null;})[_0x14e7('0x28')](handleEntityNotFound(_0x407e20,null))[_0x14e7('0x28')](respondWithStatusCode(_0x407e20,null))['catch'](handleError(_0x407e20,null));};exports[_0x14e7('0x7e')]=function(_0x235e8e,_0x5b8676,_0x2e80f5){return db['Team'][_0x14e7('0x72')]({'where':{'id':_0x235e8e[_0x14e7('0x47')]['id']}})[_0x14e7('0x28')](function(_0x372ade){if(_0x372ade){if(!_0x235e8e[_0x14e7('0x31')][_0x14e7('0x73')]||!utils[_0x14e7('0x74')](_0x235e8e['query'][_0x14e7('0x73')])){throw new db[(_0x14e7('0x59'))]['ValidationError'](_0x14e7('0x76'));}return _0x372ade[_0x14e7('0x7f')+_[_0x14e7('0x7a')](_0x235e8e[_0x14e7('0x31')][_0x14e7('0x73')]['toLowerCase']())+_0x14e7('0x80')](_0x235e8e[_0x14e7('0x31')]['ids']);}return null;})['then'](handleEntityNotFound(_0x5b8676,null))['then'](respondWithStatusCode(_0x5b8676,null))[_0x14e7('0x45')](handleError(_0x5b8676,null));};exports[_0x14e7('0x81')]=function(_0x3e0599,_0x2fd9f5){var _0xe820df=_[_0x14e7('0x82')](_0x3e0599['body']['ids'])?_0x3e0599[_0x14e7('0x4b')][_0x14e7('0x7d')]:[_0x3e0599['body'][_0x14e7('0x7d')]];var _0x1d0342=_0x3e0599[_0x14e7('0x47')]['id'];return db['Team']['find']({'where':{'id':_0x1d0342}})[_0x14e7('0x28')](handleEntityNotFound(_0x2fd9f5,null))[_0x14e7('0x28')](function(_0x33fc1b){if(_0x33fc1b){var _0x6cdbd4=[_0x14e7('0x83'),'Chat',_0x14e7('0x84'),'Sms',_0x14e7('0x85'),'Openchannel','Whatsapp'];return db[_0x14e7('0x57')][_0x14e7('0x86')](function(_0x4a97bf){var _0x4347a3=_[_0x14e7('0x2e')](_0x6cdbd4,function(_0x1a2480){var _0x71fb86={'attributes':['id',_0x14e7('0x2b')]};if(_0x1a2480===_0x14e7('0x83')){_0x71fb86[_0x14e7('0x87')]={'attributes':['penalty']};}return _0x33fc1b['get'+_0x1a2480+_0x14e7('0x80')](_0x71fb86)[_0x14e7('0x28')](function(_0x535749){var _0x5d3dec=_[_0x14e7('0x2e')](_0x535749,function(_0x4d03b5){var _0x21c60b=_[_0x14e7('0x2e')](_0xe820df,function(_0x303027){var _0x553dcf={'where':{'UserId':_0x303027,[_0x1a2480+'QueueId']:_0x4d03b5['id']},'transaction':_0x4a97bf};if(_0x1a2480===_0x14e7('0x83')){_0x553dcf[_0x14e7('0x19')]={'penalty':_0x4d03b5[_0x14e7('0x88')][_0x14e7('0x89')]};}return db[_0x14e7('0x8a')+_0x1a2480+'Queue'][_0x14e7('0x8b')](_0x553dcf)[_0x14e7('0x28')](function(){socket[_0x14e7('0x8c')](_0x14e7('0x8d')+_0x1a2480+_0x14e7('0x8e'),{'UserId':_0x303027,[_0x1a2480+_0x14e7('0x8f')]:_0x4d03b5['id']});if(_0x1a2480!==_0x14e7('0x83')){return;}return db[_0x14e7('0x8a')]['findAll']({'where':{'id':_0xe820df,'online':0x1},'attributes':['id',_0x14e7('0x2b'),_0x14e7('0x90'),'voicePause',_0x14e7('0x91')],'raw':!![]})[_0x14e7('0x28')](function(_0x11e188){var _0x2574cb=_[_0x14e7('0x2e')](_0x11e188,function(_0x55bc5f){return db[_0x14e7('0x92')][_0x14e7('0x93')]({'membername':_0x55bc5f[_0x14e7('0x2b')],'UserId':_0x55bc5f['id'],'queue_name':_0x4d03b5[_0x14e7('0x2b')],'VoiceQueueId':_0x4d03b5['id'],'interface':_[_0x14e7('0x94')](_0x55bc5f[_0x14e7('0x91')])?util[_0x14e7('0x95')](_0x14e7('0x96'),_0x55bc5f['name']):_0x55bc5f[_0x14e7('0x91')],'paused':_0x55bc5f['voicePause']||![],'penalty':_0x4d03b5[_0x14e7('0x88')][_0x14e7('0x89')]},{'transaction':_0x4a97bf});});return Promise[_0x14e7('0x97')](_0x2574cb);});});});return Promise[_0x14e7('0x97')](_0x21c60b);});return Promise[_0x14e7('0x97')](_0x5d3dec);})[_0x14e7('0x28')](function(){return db[_0x14e7('0x6d')][_0x14e7('0x72')]({'where':{'teamId':_0x1d0342}})[_0x14e7('0x28')](function(_0x5286ec){if(_0x5286ec){var _0x3792d7=_[_0x14e7('0x2e')](_0xe820df,function(_0x26be7c){db['UserVoicePrefix'][_0x14e7('0x93')]({'UserId':_0x26be7c,'VoicePrefixId':_0x5286ec[_0x14e7('0x6e')]});});return Promise[_0x14e7('0x97')](_0x3792d7);}});});});return Promise[_0x14e7('0x97')](_0x4347a3)['then'](function(){return _0x33fc1b[_0x14e7('0x81')](_0xe820df,{'transaction':_0x4a97bf})[_0x14e7('0x98')](function(_0x240045){return _0x240045;});});});}})[_0x14e7('0x28')](respondWithResult(_0x2fd9f5,null))['catch'](handleError(_0x2fd9f5,null));};exports[_0x14e7('0x99')]=function(_0x11e765,_0x44b842){var _0x2a5f20=_[_0x14e7('0x82')](_0x11e765['query'][_0x14e7('0x7d')])?_0x11e765[_0x14e7('0x31')][_0x14e7('0x7d')]:[_0x11e765[_0x14e7('0x31')][_0x14e7('0x7d')]];var _0x225f99=_0x11e765[_0x14e7('0x47')]['id'];return db[_0x14e7('0x40')][_0x14e7('0x55')]({'where':{'id':_0x225f99}})['then'](handleEntityNotFound(_0x44b842,null))[_0x14e7('0x28')](function(_0x39f369){if(_0x39f369){var _0xe39cd2=[_0x14e7('0x83'),_0x14e7('0x9a'),'Mail','Sms',_0x14e7('0x85'),_0x14e7('0x9b'),_0x14e7('0x9c')];return db[_0x14e7('0x57')][_0x14e7('0x86')](function(_0x4852e7){var _0x4a855c=_[_0x14e7('0x2e')](_0xe39cd2,function(_0x5efa98){var _0x24545d={'attributes':['id',_0x14e7('0x2b')]};return _0x39f369[_0x14e7('0x4c')+_0x5efa98+_0x14e7('0x80')](_0x24545d)[_0x14e7('0x28')](function(_0x461255){var _0x5121fc=_['map'](_0x461255,function(_0x144a05){return _0x144a05[_0x14e7('0x99')](_0x2a5f20,{'transaction':_0x4852e7})[_0x14e7('0x28')](function(){var _0x1fbd43=_[_0x14e7('0x2e')](_0x2a5f20,function(_0x18db5a){socket['emit'](_0x14e7('0x8d')+_0x5efa98+_0x14e7('0x9d'),{'UserId':Number(_0x18db5a),[_0x5efa98+'QueueId']:_0x144a05['id']});if(_0x5efa98!==_0x14e7('0x83')){return;}return db[_0x14e7('0x92')][_0x14e7('0x56')]({'where':{'VoiceQueueId':_0x144a05['id'],'UserId':_0x18db5a},'transaction':_0x4852e7});});return Promise[_0x14e7('0x97')](_0x1fbd43);});});return Promise[_0x14e7('0x97')](_0x5121fc);});});return Promise[_0x14e7('0x97')](_0x4a855c)[_0x14e7('0x28')](function(){return _0x39f369[_0x14e7('0x99')](_0x2a5f20,{'transaction':_0x4852e7});})[_0x14e7('0x28')](function(){return db[_0x14e7('0x6d')]['findOne']({'where':{'teamId':_0x225f99}})[_0x14e7('0x28')](function(_0x18ea8e){if(_0x18ea8e){var _0x569940=_[_0x14e7('0x2e')](_0x2a5f20,function(_0x71f2b6){db[_0x14e7('0x9e')]['destroy']({'where':{'UserId':_0x71f2b6,'VoicePrefixId':_0x18ea8e[_0x14e7('0x6e')]}});});return Promise['all'](_0x569940);}});});});}})['then'](respondWithStatusCode(_0x44b842,null))[_0x14e7('0x45')](handleError(_0x44b842,null));};exports['getAgents']=function(_0x28b3a4,_0xcf83e1,_0x386d76){var _0x3405f8={};var _0x3f3439={};var _0x47671f;var _0x29400e;return db[_0x14e7('0x40')][_0x14e7('0x72')]({'where':{'id':_0x28b3a4[_0x14e7('0x47')]['id']}})[_0x14e7('0x28')](handleEntityNotFound(_0xcf83e1,null))[_0x14e7('0x28')](function(_0x4c74ce){if(_0x4c74ce){_0x47671f=_0x4c74ce;_0x3f3439[_0x14e7('0x30')]=_[_0x14e7('0x32')](db['User'][_0x14e7('0x48')]);_0x3f3439[_0x14e7('0x31')]=_[_0x14e7('0x32')](_0x28b3a4[_0x14e7('0x31')]);_0x3f3439['filters']=_[_0x14e7('0x33')](_0x3f3439['model'],_0x3f3439['query']);_0x3405f8[_0x14e7('0x35')]=_['intersection'](_0x3f3439[_0x14e7('0x30')],qs[_0x14e7('0x34')](_0x28b3a4['query'][_0x14e7('0x34')]));_0x3405f8['attributes']=_0x3405f8[_0x14e7('0x35')][_0x14e7('0x49')]?_0x3405f8['attributes']:_0x3f3439['model'];_0x3405f8[_0x14e7('0x38')]=qs[_0x14e7('0x79')](_0x28b3a4['query'][_0x14e7('0x79')]);_0x3405f8[_0x14e7('0x39')]=qs['filters'](_[_0x14e7('0x3b')](_0x28b3a4['query'],_0x3f3439['filters']));if(_0x28b3a4[_0x14e7('0x31')][_0x14e7('0x9f')]){_0x3405f8[_0x14e7('0x39')]=_[_0x14e7('0x3c')](_0x3405f8[_0x14e7('0x39')],{'$or':_[_0x14e7('0x2e')](_0x3405f8[_0x14e7('0x35')],function(_0x190726){var _0x59dc57={};_0x59dc57[_0x190726]={'$like':'%'+_0x28b3a4['query'][_0x14e7('0x9f')]+'%'};return _0x59dc57;})});}_0x3405f8=_['merge']({},_0x3405f8,_0x28b3a4[_0x14e7('0x3f')]);return _0x47671f[_0x14e7('0xa0')](_0x3405f8);}})[_0x14e7('0x28')](function(_0x178bbc){if(_0x178bbc){_0x29400e=_0x178bbc[_0x14e7('0x49')];if(!_0x28b3a4[_0x14e7('0x31')]['hasOwnProperty'](_0x14e7('0x37'))){_0x3405f8[_0x14e7('0x23')]=qs[_0x14e7('0x23')](_0x28b3a4[_0x14e7('0x31')]['limit']);_0x3405f8[_0x14e7('0x21')]=qs['offset'](_0x28b3a4[_0x14e7('0x31')][_0x14e7('0x21')]);}return _0x47671f[_0x14e7('0xa0')](_0x3405f8);}})[_0x14e7('0x28')](function(_0x3505b0){if(_0x3505b0){return _0x3505b0?{'count':_0x29400e,'rows':_0x3505b0}:null;}})[_0x14e7('0x28')](respondWithResult(_0xcf83e1,null))['catch'](handleError(_0xcf83e1,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 41b5e94..fca0334 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 _0x8bac=['Team','setMaxListeners','save','remove','emit','exports','events','../../mysqldb'];(function(_0x26b5e6,_0x4a78b8){var _0x4d5307=function(_0x53a195){while(--_0x53a195){_0x26b5e6['push'](_0x26b5e6['shift']());}};_0x4d5307(++_0x4a78b8);}(_0x8bac,0x66));var _0xc8ba=function(_0x2e63e8,_0xed68f5){_0x2e63e8=_0x2e63e8-0x0;var _0x3fe904=_0x8bac[_0x2e63e8];return _0x3fe904;};'use strict';var EventEmitter=require(_0xc8ba('0x0'));var Team=require(_0xc8ba('0x1'))['db'][_0xc8ba('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xc8ba('0x3')](0x0);var events={'afterCreate':_0xc8ba('0x4'),'afterUpdate':'update','afterDestroy':_0xc8ba('0x5')};function emitEvent(_0x1d5dd5){return function(_0x1a66a8,_0x427ea7,_0x231a6e){TeamEvents[_0xc8ba('0x6')](_0x1d5dd5+':'+_0x1a66a8['id'],_0x1a66a8);TeamEvents[_0xc8ba('0x6')](_0x1d5dd5,_0x1a66a8);_0x231a6e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc8ba('0x7')]=TeamEvents; \ No newline at end of file +var _0xf505=['save','update','remove','emit','hook','exports','events','../../mysqldb','Team'];(function(_0x3fab95,_0x43b58d){var _0x2e587d=function(_0x1733b5){while(--_0x1733b5){_0x3fab95['push'](_0x3fab95['shift']());}};_0x2e587d(++_0x43b58d);}(_0xf505,0x84));var _0x5f50=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0xf505[_0x124298];return _0x35ac24;};'use strict';var EventEmitter=require(_0x5f50('0x0'));var Team=require(_0x5f50('0x1'))['db'][_0x5f50('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5f50('0x3'),'afterUpdate':_0x5f50('0x4'),'afterDestroy':_0x5f50('0x5')};function emitEvent(_0x3e1988){return function(_0x5e3f50,_0xbc4950,_0x113568){TeamEvents[_0x5f50('0x6')](_0x3e1988+':'+_0x5e3f50['id'],_0x5e3f50);TeamEvents['emit'](_0x3e1988,_0x5e3f50);_0x113568(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x5f50('0x7')](e,emitEvent(event));}}module[_0x5f50('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index cd28f9f..6577552 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 _0x4109=['define','Team','teams','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./team.attributes','exports'];(function(_0x43831f,_0x3103ad){var _0x58ab74=function(_0x391e71){while(--_0x391e71){_0x43831f['push'](_0x43831f['shift']());}};_0x58ab74(++_0x3103ad);}(_0x4109,0x196));var _0x9410=function(_0x1d0377,_0x318b1e){_0x1d0377=_0x1d0377-0x0;var _0x3ac54b=_0x4109[_0x1d0377];return _0x3ac54b;};'use strict';var _=require(_0x9410('0x0'));var util=require(_0x9410('0x1'));var logger=require(_0x9410('0x2'))(_0x9410('0x3'));var moment=require(_0x9410('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9410('0x5'));var rimraf=require(_0x9410('0x6'));var config=require(_0x9410('0x7'));var attributes=require(_0x9410('0x8'));module[_0x9410('0x9')]=function(_0x2c7880,_0x4a73b0){return _0x2c7880[_0x9410('0xa')](_0x9410('0xb'),attributes,{'tableName':_0x9410('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc509=['../../config/environment','./team.attributes','define','Team','teams','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x98a99d,_0x30220c){var _0x155003=function(_0x332e1e){while(--_0x332e1e){_0x98a99d['push'](_0x98a99d['shift']());}};_0x155003(++_0x30220c);}(_0xc509,0x15a));var _0x9c50=function(_0x2092c7,_0x48f8ea){_0x2092c7=_0x2092c7-0x0;var _0x5659b5=_0xc509[_0x2092c7];return _0x5659b5;};'use strict';var _=require(_0x9c50('0x0'));var util=require(_0x9c50('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9c50('0x2'));var rp=require(_0x9c50('0x3'));var fs=require('fs');var path=require(_0x9c50('0x4'));var rimraf=require(_0x9c50('0x5'));var config=require(_0x9c50('0x6'));var attributes=require(_0x9c50('0x7'));module['exports']=function(_0x36dacd,_0x3101b1){return _0x36dacd[_0x9c50('0x8')](_0x9c50('0x9'),attributes,{'tableName':_0x9c50('0xa'),'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 7478655..39e4adc 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 _0x8823=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x3df9c8,_0x5c034e){var _0x2b0f57=function(_0x403fe6){while(--_0x403fe6){_0x3df9c8['push'](_0x3df9c8['shift']());}};_0x2b0f57(++_0x5c034e);}(_0x8823,0x98));var _0x3882=function(_0x510b91,_0x13a16a){_0x510b91=_0x510b91-0x0;var _0x294940=_0x8823[_0x510b91];return _0x294940;};'use strict';var _=require(_0x3882('0x0'));var util=require('util');var moment=require(_0x3882('0x1'));var BPromise=require(_0x3882('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3882('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3882('0x4'));var logger=require('../../config/logger')(_0x3882('0x5'));var config=require(_0x3882('0x6'));var jayson=require(_0x3882('0x7'));var client=jayson[_0x3882('0x8')][_0x3882('0x9')]({'port':0x232a});config[_0x3882('0xa')]=_['defaults'](config[_0x3882('0xa')],{'host':_0x3882('0xb'),'port':0x18eb});var socket=require(_0x3882('0xc'))(new Redis(config[_0x3882('0xa')]));require(_0x3882('0xd'))[_0x3882('0xe')](socket);function respondWithRpcPromise(_0x5d7585,_0x241a42,_0xe5ae4e){return new BPromise(function(_0x126735,_0x3bce62){return client[_0x3882('0xf')](_0x5d7585,_0xe5ae4e)[_0x3882('0x10')](function(_0x1e4bcf){logger[_0x3882('0x11')](_0x3882('0x12'),_0x241a42,_0x3882('0x13'));logger[_0x3882('0x14')](_0x3882('0x15'),_0x241a42,'request\x20sent',JSON['stringify'](_0x1e4bcf));if(_0x1e4bcf[_0x3882('0x16')]){if(_0x1e4bcf[_0x3882('0x16')]['code']===0x1f4){logger['error'](_0x3882('0x12'),_0x241a42,_0x1e4bcf['error'][_0x3882('0x17')]);return _0x3bce62(_0x1e4bcf['error']['message']);}logger['error'](_0x3882('0x12'),_0x241a42,_0x1e4bcf['error'][_0x3882('0x17')]);return _0x126735(_0x1e4bcf[_0x3882('0x16')][_0x3882('0x17')]);}else{logger[_0x3882('0x11')](_0x3882('0x12'),_0x241a42,_0x3882('0x13'));_0x126735(_0x1e4bcf[_0x3882('0x18')][_0x3882('0x17')]);}})[_0x3882('0x19')](function(_0x4d42f1){logger[_0x3882('0x16')]('Team,\x20%s,\x20%s',_0x241a42,_0x4d42f1);_0x3bce62(_0x4d42f1);});});} \ No newline at end of file +var _0xa1a8=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x40e021,_0x574ea8){var _0x4bdd10=function(_0x2b700c){while(--_0x2b700c){_0x40e021['push'](_0x40e021['shift']());}};_0x4bdd10(++_0x574ea8);}(_0xa1a8,0x13c));var _0x8a1a=function(_0x1c1d70,_0x27e8de){_0x1c1d70=_0x1c1d70-0x0;var _0x56303f=_0xa1a8[_0x1c1d70];return _0x56303f;};'use strict';var _=require(_0x8a1a('0x0'));var util=require(_0x8a1a('0x1'));var moment=require(_0x8a1a('0x2'));var BPromise=require(_0x8a1a('0x3'));var rs=require(_0x8a1a('0x4'));var fs=require('fs');var Redis=require(_0x8a1a('0x5'));var db=require(_0x8a1a('0x6'))['db'];var utils=require(_0x8a1a('0x7'));var logger=require(_0x8a1a('0x8'))(_0x8a1a('0x9'));var config=require(_0x8a1a('0xa'));var jayson=require(_0x8a1a('0xb'));var client=jayson[_0x8a1a('0xc')]['http']({'port':0x232a});config[_0x8a1a('0xd')]=_[_0x8a1a('0xe')](config[_0x8a1a('0xd')],{'host':_0x8a1a('0xf'),'port':0x18eb});var socket=require(_0x8a1a('0x10'))(new Redis(config[_0x8a1a('0xd')]));require(_0x8a1a('0x11'))[_0x8a1a('0x12')](socket);function respondWithRpcPromise(_0x465693,_0x5087eb,_0x57b965){return new BPromise(function(_0x2073e8,_0x292b89){return client[_0x8a1a('0x13')](_0x465693,_0x57b965)[_0x8a1a('0x14')](function(_0xd4303c){logger[_0x8a1a('0x15')](_0x8a1a('0x16'),_0x5087eb,'request\x20sent');logger[_0x8a1a('0x17')](_0x8a1a('0x18'),_0x5087eb,_0x8a1a('0x19'),JSON[_0x8a1a('0x1a')](_0xd4303c));if(_0xd4303c[_0x8a1a('0x1b')]){if(_0xd4303c[_0x8a1a('0x1b')][_0x8a1a('0x1c')]===0x1f4){logger['error'](_0x8a1a('0x16'),_0x5087eb,_0xd4303c[_0x8a1a('0x1b')][_0x8a1a('0x1d')]);return _0x292b89(_0xd4303c['error'][_0x8a1a('0x1d')]);}logger['error'](_0x8a1a('0x16'),_0x5087eb,_0xd4303c[_0x8a1a('0x1b')][_0x8a1a('0x1d')]);return _0x2073e8(_0xd4303c['error'][_0x8a1a('0x1d')]);}else{logger[_0x8a1a('0x15')]('Team,\x20%s,\x20%s',_0x5087eb,_0x8a1a('0x19'));_0x2073e8(_0xd4303c[_0x8a1a('0x1e')][_0x8a1a('0x1d')]);}})['catch'](function(_0x327c99){logger[_0x8a1a('0x1b')]('Team,\x20%s,\x20%s',_0x5087eb,_0x327c99);_0x292b89(_0x327c99);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index cf059a2..78f4ab4 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 _0xbcdc=['emit','length','team:','./team.events','save','update'];(function(_0x53a81e,_0x478044){var _0x41fd30=function(_0x27c21b){while(--_0x27c21b){_0x53a81e['push'](_0x53a81e['shift']());}};_0x41fd30(++_0x478044);}(_0xbcdc,0xb7));var _0xcbcd=function(_0x2a7a6d,_0x20c534){_0x2a7a6d=_0x2a7a6d-0x0;var _0x5dfaf8=_0xbcdc[_0x2a7a6d];return _0x5dfaf8;};'use strict';var TeamEvents=require(_0xcbcd('0x0'));var events=[_0xcbcd('0x1'),'remove',_0xcbcd('0x2')];function createListener(_0x182889,_0x32498c){return function(_0x34a39a){_0x32498c[_0xcbcd('0x3')](_0x182889,_0x34a39a);};}function removeListener(_0x53c78f,_0x24f0ee){return function(){TeamEvents['removeListener'](_0x53c78f,_0x24f0ee);};}exports['register']=function(_0x59d517){for(var _0x32ee2f=0x0,_0x25ec5b=events[_0xcbcd('0x4')];_0x32ee2f<_0x25ec5b;_0x32ee2f++){var _0xe53a49=events[_0x32ee2f];var _0x2df1cd=createListener(_0xcbcd('0x5')+_0xe53a49,_0x59d517);TeamEvents['on'](_0xe53a49,_0x2df1cd);}}; \ No newline at end of file +var _0x5577=['register','length','team:','./team.events','save','remove','update','emit'];(function(_0x5b8df4,_0xb19c48){var _0xdaeff5=function(_0x2a0ea1){while(--_0x2a0ea1){_0x5b8df4['push'](_0x5b8df4['shift']());}};_0xdaeff5(++_0xb19c48);}(_0x5577,0xe3));var _0x7557=function(_0x16495f,_0x5c1d14){_0x16495f=_0x16495f-0x0;var _0x1d62b5=_0x5577[_0x16495f];return _0x1d62b5;};'use strict';var TeamEvents=require(_0x7557('0x0'));var events=[_0x7557('0x1'),_0x7557('0x2'),_0x7557('0x3')];function createListener(_0x68706b,_0x4c9745){return function(_0x37b00c){_0x4c9745[_0x7557('0x4')](_0x68706b,_0x37b00c);};}function removeListener(_0x2e56cc,_0xe4dc27){return function(){TeamEvents['removeListener'](_0x2e56cc,_0xe4dc27);};}exports[_0x7557('0x5')]=function(_0x2b18aa){for(var _0x5e8405=0x0,_0x1e3d11=events[_0x7557('0x6')];_0x5e8405<_0x1e3d11;_0x5e8405++){var _0x4f7fbf=events[_0x5e8405];var _0x5c1308=createListener(_0x7557('0x7')+_0x4f7fbf,_0x2b18aa);TeamEvents['on'](_0x4f7fbf,_0x5c1308);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 917f9cc..818e748 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 _0x7846=['exports','INTEGER'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7846,0xf4));var _0x6784=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0x7846[_0x340d75];return _0x3f1114;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'TeamId':{'type':Sequelize[_0x6784('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x6784('0x1')]}}; \ No newline at end of file +var _0xb492=['exports','INTEGER'];(function(_0x48b55e,_0x260672){var _0x75b956=function(_0x1603a8){while(--_0x1603a8){_0x48b55e['push'](_0x48b55e['shift']());}};_0x75b956(++_0x260672);}(_0xb492,0x172));var _0x2b49=function(_0x2f4e69,_0x310499){_0x2f4e69=_0x2f4e69-0x0;var _0x54a9ff=_0xb492[_0x2f4e69];return _0x54a9ff;};'use strict';var Sequelize=require('sequelize');module[_0x2b49('0x0')]={'TeamId':{'type':Sequelize[_0x2b49('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2b49('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e69eeb7..66b9f7c 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 _0x6ea9=['path','rimraf','./teamVoicePrefix.attributes','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5e29c4,_0x15e192){var _0x434d5f=function(_0x498bc8){while(--_0x498bc8){_0x5e29c4['push'](_0x5e29c4['shift']());}};_0x434d5f(++_0x15e192);}(_0x6ea9,0x89));var _0x96ea=function(_0x104581,_0x48c80d){_0x104581=_0x104581-0x0;var _0x32201c=_0x6ea9[_0x104581];return _0x32201c;};'use strict';var _=require(_0x96ea('0x0'));var util=require(_0x96ea('0x1'));var logger=require(_0x96ea('0x2'))(_0x96ea('0x3'));var moment=require(_0x96ea('0x4'));var BPromise=require('bluebird');var rp=require(_0x96ea('0x5'));var fs=require('fs');var path=require(_0x96ea('0x6'));var rimraf=require(_0x96ea('0x7'));var config=require('../../config/environment');var attributes=require(_0x96ea('0x8'));module['exports']=function(_0x32cf31,_0x54e1b1){return _0x32cf31[_0x96ea('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x96ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb910=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x56d449,_0x1396ff){var _0x291138=function(_0x25e493){while(--_0x25e493){_0x56d449['push'](_0x56d449['shift']());}};_0x291138(++_0x1396ff);}(_0xb910,0x12b));var _0x0b91=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb910[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var logger=require(_0x0b91('0x2'))(_0x0b91('0x3'));var moment=require(_0x0b91('0x4'));var BPromise=require(_0x0b91('0x5'));var rp=require(_0x0b91('0x6'));var fs=require('fs');var path=require(_0x0b91('0x7'));var rimraf=require(_0x0b91('0x8'));var config=require(_0x0b91('0x9'));var attributes=require(_0x0b91('0xa'));module[_0x0b91('0xb')]=function(_0x295749,_0x1800dc){return _0x295749['define'](_0x0b91('0xc'),attributes,{'tableName':_0x0b91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 3985305..4cfb2fb 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x20e5c3,_0x41470c){var _0x401520=function(_0x37f246){while(--_0x37f246){_0x20e5c3['push'](_0x20e5c3['shift']());}};_0x401520(++_0x41470c);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x30819e,_0x170506){var _0x3b522c=function(_0xd8c1bf){while(--_0xd8c1bf){_0x30819e['push'](_0x30819e['shift']());}};_0x3b522c(++_0x170506);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xcb91[_0x29e3ec];return _0x25727e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index ba37465..f8e3cdb 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 _0xe068=['INTEGER','exports'];(function(_0x1a9b90,_0x5b4b5a){var _0x59735e=function(_0x5deb32){while(--_0x5deb32){_0x1a9b90['push'](_0x1a9b90['shift']());}};_0x59735e(++_0x5b4b5a);}(_0xe068,0xeb));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x8e06('0x0')]={'penalty':{'type':Sequelize[_0x8e06('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd29e=['INTEGER','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd29e,0x1a7));var _0xed29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd29e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xed29('0x0')]={'penalty':{'type':Sequelize[_0xed29('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 bce32d3..cbad451 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 _0x43fd=['api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x24c92d,_0x10abff){var _0x10883a=function(_0x49b5e9){while(--_0x49b5e9){_0x24c92d['push'](_0x24c92d['shift']());}};_0x10883a(++_0x10abff);}(_0x43fd,0x150));var _0xd43f=function(_0x4a43d9,_0x6175fc){_0x4a43d9=_0x4a43d9-0x0;var _0xc0b955=_0x43fd[_0x4a43d9];return _0xc0b955;};'use strict';var _=require(_0xd43f('0x0'));var util=require(_0xd43f('0x1'));var logger=require('../../config/logger')(_0xd43f('0x2'));var moment=require('moment');var BPromise=require(_0xd43f('0x3'));var rp=require(_0xd43f('0x4'));var fs=require('fs');var path=require(_0xd43f('0x5'));var rimraf=require(_0xd43f('0x6'));var config=require(_0xd43f('0x7'));var attributes=require(_0xd43f('0x8'));module[_0xd43f('0x9')]=function(_0x2807ed,_0xfede84){return _0x2807ed[_0xd43f('0xa')](_0xd43f('0xb'),attributes,{'tableName':_0xd43f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2cc=['team_has_voice_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x16a8ae,_0xaee4a6){var _0x3aa0e0=function(_0x402245){while(--_0x402245){_0x16a8ae['push'](_0x16a8ae['shift']());}};_0x3aa0e0(++_0xaee4a6);}(_0xe2cc,0x69));var _0xce2c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe2cc[_0x432682];return _0x463d05;};'use strict';var _=require(_0xce2c('0x0'));var util=require(_0xce2c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xce2c('0x2'));var BPromise=require(_0xce2c('0x3'));var rp=require(_0xce2c('0x4'));var fs=require('fs');var path=require(_0xce2c('0x5'));var rimraf=require(_0xce2c('0x6'));var config=require(_0xce2c('0x7'));var attributes=require(_0xce2c('0x8'));module[_0xce2c('0x9')]=function(_0x592e10,_0x51e5d0){return _0x592e10[_0xce2c('0xa')](_0xce2c('0xb'),attributes,{'tableName':_0xce2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 24fb5c2..fe12623 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 _0x5d44=['../../config/logger','rpc','../../config/environment','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf7dd0f,_0x396c3b){var _0x3fc64b=function(_0x41adc1){while(--_0x41adc1){_0xf7dd0f['push'](_0xf7dd0f['shift']());}};_0x3fc64b(++_0x396c3b);}(_0x5d44,0xd1));var _0x45d4=function(_0x415314,_0x1bf87e){_0x415314=_0x415314-0x0;var _0x29bcab=_0x5d44[_0x415314];return _0x29bcab;};'use strict';var _=require(_0x45d4('0x0'));var util=require(_0x45d4('0x1'));var moment=require(_0x45d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x45d4('0x3'));var fs=require('fs');var Redis=require(_0x45d4('0x4'));var db=require(_0x45d4('0x5'))['db'];var utils=require(_0x45d4('0x6'));var logger=require(_0x45d4('0x7'))(_0x45d4('0x8'));var config=require(_0x45d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45d4('0xa')][_0x45d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d570,_0x56fe0b,_0x2717b2){return new BPromise(function(_0x4ecf33,_0x102cbe){return client['request'](_0x32d570,_0x2717b2)[_0x45d4('0xc')](function(_0x46cbe9){logger[_0x45d4('0xd')](_0x45d4('0xe'),_0x56fe0b,'request\x20sent');logger[_0x45d4('0xf')](_0x45d4('0x10'),_0x56fe0b,_0x45d4('0x11'),JSON[_0x45d4('0x12')](_0x46cbe9));if(_0x46cbe9[_0x45d4('0x13')]){if(_0x46cbe9['error'][_0x45d4('0x14')]===0x1f4){logger[_0x45d4('0x13')](_0x45d4('0xe'),_0x56fe0b,_0x46cbe9[_0x45d4('0x13')][_0x45d4('0x15')]);return _0x102cbe(_0x46cbe9[_0x45d4('0x13')][_0x45d4('0x15')]);}logger[_0x45d4('0x13')](_0x45d4('0xe'),_0x56fe0b,_0x46cbe9[_0x45d4('0x13')][_0x45d4('0x15')]);return _0x4ecf33(_0x46cbe9[_0x45d4('0x13')][_0x45d4('0x15')]);}else{logger[_0x45d4('0xd')](_0x45d4('0xe'),_0x56fe0b,_0x45d4('0x11'));_0x4ecf33(_0x46cbe9[_0x45d4('0x16')][_0x45d4('0x15')]);}})[_0x45d4('0x17')](function(_0x4a3c3d){logger[_0x45d4('0x13')](_0x45d4('0xe'),_0x56fe0b,_0x4a3c3d);_0x102cbe(_0x4a3c3d);});});} \ No newline at end of file +var _0x3cd1=['info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x3cd1,0x112));var _0x13cd=function(_0x850fbc,_0x1c1107){_0x850fbc=_0x850fbc-0x0;var _0xb309d6=_0x3cd1[_0x850fbc];return _0xb309d6;};'use strict';var _=require('lodash');var util=require(_0x13cd('0x0'));var moment=require(_0x13cd('0x1'));var BPromise=require(_0x13cd('0x2'));var rs=require(_0x13cd('0x3'));var fs=require('fs');var Redis=require(_0x13cd('0x4'));var db=require(_0x13cd('0x5'))['db'];var utils=require(_0x13cd('0x6'));var logger=require(_0x13cd('0x7'))('rpc');var config=require(_0x13cd('0x8'));var jayson=require(_0x13cd('0x9'));var client=jayson[_0x13cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55cac0,_0x461fe5,_0x427fb0){return new BPromise(function(_0x258008,_0x64751a){return client['request'](_0x55cac0,_0x427fb0)[_0x13cd('0xb')](function(_0x334e06){logger[_0x13cd('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x461fe5,'request\x20sent');logger[_0x13cd('0xd')](_0x13cd('0xe'),_0x461fe5,_0x13cd('0xf'),JSON[_0x13cd('0x10')](_0x334e06));if(_0x334e06[_0x13cd('0x11')]){if(_0x334e06[_0x13cd('0x11')][_0x13cd('0x12')]===0x1f4){logger['error'](_0x13cd('0x13'),_0x461fe5,_0x334e06[_0x13cd('0x11')]['message']);return _0x64751a(_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);}logger[_0x13cd('0x11')](_0x13cd('0x13'),_0x461fe5,_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);return _0x258008(_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);}else{logger['info'](_0x13cd('0x13'),_0x461fe5,'request\x20sent');_0x258008(_0x334e06[_0x13cd('0x15')][_0x13cd('0x14')]);}})['catch'](function(_0x1bd779){logger[_0x13cd('0x11')](_0x13cd('0x13'),_0x461fe5,_0x1bd779);_0x64751a(_0x1bd779);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 39473d7..c74dd7e 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 _0xceef=['create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceef,0xf6));var _0xfcee=function(_0x405d5b,_0x367d49){_0x405d5b=_0x405d5b-0x0;var _0x26b41c=_0xceef[_0x405d5b];return _0x26b41c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcee('0x0'));var timeout=require(_0xfcee('0x1'));var express=require('express');var router=express[_0xfcee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfcee('0x3'));var interaction=require(_0xfcee('0x4'));var config=require('../../config/environment');var controller=require(_0xfcee('0x5'));router[_0xfcee('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcee('0x6')](_0xfcee('0x7'),auth[_0xfcee('0x8')](),controller['show']);router['post']('/',auth[_0xfcee('0x8')](),controller[_0xfcee('0x9')]);router[_0xfcee('0xa')](_0xfcee('0x7'),auth[_0xfcee('0x8')](),controller[_0xfcee('0xb')]);router[_0xfcee('0xc')]('/:id',auth[_0xfcee('0x8')](),controller[_0xfcee('0xd')]);module[_0xfcee('0xe')]=router; \ No newline at end of file +var _0xc648=['fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x447ac9,_0x71e5d6){var _0x565b54=function(_0x19f009){while(--_0x19f009){_0x447ac9['push'](_0x447ac9['shift']());}};_0x565b54(++_0x71e5d6);}(_0xc648,0x171));var _0x8c64=function(_0x38d577,_0x7f5e7f){_0x38d577=_0x38d577-0x0;var _0x41a3d8=_0xc648[_0x38d577];return _0x41a3d8;};'use strict';var multer=require('multer');var util=require(_0x8c64('0x0'));var path=require(_0x8c64('0x1'));var timeout=require(_0x8c64('0x2'));var express=require(_0x8c64('0x3'));var router=express[_0x8c64('0x4')]();var fs_extra=require(_0x8c64('0x5'));var auth=require(_0x8c64('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0x8c64('0x7')]('/',auth[_0x8c64('0x8')](),controller[_0x8c64('0x9')]);router[_0x8c64('0x7')]('/:id',auth[_0x8c64('0x8')](),controller[_0x8c64('0xa')]);router[_0x8c64('0xb')]('/',auth[_0x8c64('0x8')](),controller[_0x8c64('0xc')]);router['put'](_0x8c64('0xd'),auth[_0x8c64('0x8')](),controller['update']);router[_0x8c64('0xe')](_0x8c64('0xd'),auth[_0x8c64('0x8')](),controller[_0x8c64('0xf')]);module[_0x8c64('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index fc954cd..ef80b4a 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 _0x9c14=['STRING','TEXT','exports'];(function(_0x46e749,_0x9b62a){var _0x1b776f=function(_0xe39362){while(--_0xe39362){_0x46e749['push'](_0x46e749['shift']());}};_0x1b776f(++_0x9b62a);}(_0x9c14,0xcb));var _0x49c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c14[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x49c1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x49c1('0x1')]},'html':{'type':Sequelize[_0x49c1('0x2')]}}; \ No newline at end of file +var _0x456e=['exports','STRING','TEXT'];(function(_0x4f939a,_0x5232ee){var _0xb1d4eb=function(_0x19821b){while(--_0x19821b){_0x4f939a['push'](_0x4f939a['shift']());}};_0xb1d4eb(++_0x5232ee);}(_0x456e,0x1ce));var _0xe456=function(_0x366001,_0x5dd533){_0x366001=_0x366001-0x0;var _0x422bb0=_0x456e[_0x366001];return _0x422bb0;};'use strict';var Sequelize=require('sequelize');module[_0xe456('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe456('0x1')]},'html':{'type':Sequelize[_0xe456('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 5511e81..bf27d52 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 _0x8f7c=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Templates','UserProfileResource','end','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x8f7c,0x97));var _0xc8f7=function(_0xf29c93,_0x31af07){_0xf29c93=_0xf29c93-0x0;var _0x143296=_0x8f7c[_0xf29c93];return _0x143296;};'use strict';var emlformat=require(_0xc8f7('0x0'));var rimraf=require(_0xc8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8f7('0x2'));var rp=require(_0xc8f7('0x3'));var moment=require(_0xc8f7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc8f7('0x5'));var path=require('path');var sox=require(_0xc8f7('0x6'));var csv=require(_0xc8f7('0x7'));var ejs=require(_0xc8f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8f7('0x9'));var squel=require(_0xc8f7('0xa'));var crypto=require(_0xc8f7('0xb'));var jsforce=require(_0xc8f7('0xc'));var deskjs=require(_0xc8f7('0xd'));var toCsv=require(_0xc8f7('0x7'));var querystring=require(_0xc8f7('0xe'));var Papa=require(_0xc8f7('0xf'));var Redis=require('ioredis');var authService=require(_0xc8f7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8f7('0x11'));var logger=require(_0xc8f7('0x12'))(_0xc8f7('0x13'));var utils=require(_0xc8f7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc8f7('0x15'));var db=require(_0xc8f7('0x16'))['db'];function respondWithStatusCode(_0x308e0c,_0x4bc760){_0x4bc760=_0x4bc760||0xcc;return function(_0x4d1a57){if(_0x4d1a57){return _0x308e0c[_0xc8f7('0x17')](_0x4bc760);}return _0x308e0c[_0xc8f7('0x18')](_0x4bc760)['end']();};}function respondWithResult(_0x329ae6,_0x5da923){_0x5da923=_0x5da923||0xc8;return function(_0x1d97cf){if(_0x1d97cf){return _0x329ae6[_0xc8f7('0x18')](_0x5da923)[_0xc8f7('0x19')](_0x1d97cf);}};}function respondWithFilteredResult(_0x81df32,_0x3efd0d){return function(_0x3994d5){if(_0x3994d5){var _0xa4f54e=typeof _0x3efd0d[_0xc8f7('0x1a')]===_0xc8f7('0x1b')&&typeof _0x3efd0d[_0xc8f7('0x1c')]==='undefined';var _0x298477=_0x3994d5[_0xc8f7('0x1d')];var _0x5f2129=_0xa4f54e?0x0:_0x3efd0d[_0xc8f7('0x1a')];var _0x4ac04f=_0xa4f54e?_0x3994d5['count']:_0x3efd0d[_0xc8f7('0x1a')]+_0x3efd0d['limit'];var _0x1ca233;if(_0x4ac04f>=_0x298477){_0x4ac04f=_0x298477;_0x1ca233=0xc8;}else{_0x1ca233=0xce;}_0x81df32[_0xc8f7('0x18')](_0x1ca233);return _0x81df32[_0xc8f7('0x1e')](_0xc8f7('0x1f'),_0x5f2129+'-'+_0x4ac04f+'/'+_0x298477)[_0xc8f7('0x19')](_0x3994d5);}return null;};}function patchUpdates(_0x34aaa5){return function(_0x529f16){try{jsonpatch[_0xc8f7('0x20')](_0x529f16,_0x34aaa5,!![]);}catch(_0x5c156e){return BPromise[_0xc8f7('0x21')](_0x5c156e);}return _0x529f16[_0xc8f7('0x22')]();};}function saveUpdates(_0x463196,_0x1c13f5){return function(_0x16d207){if(_0x16d207){return _0x16d207[_0xc8f7('0x23')](_0x463196)['then'](function(_0x2adad0){return _0x2adad0;});}return null;};}function removeEntity(_0x33e491,_0x3e90d4){return function(_0x37f5cd){if(_0x37f5cd){return _0x37f5cd[_0xc8f7('0x24')]()[_0xc8f7('0x25')](function(){var _0x8f8d6e=_0x37f5cd['get']({'plain':!![]});var _0x14e3bb=_0xc8f7('0x26');return db[_0xc8f7('0x27')]['destroy']({'where':{'type':_0x14e3bb,'resourceId':_0x8f8d6e['id']}})[_0xc8f7('0x25')](function(){return _0x37f5cd;});})[_0xc8f7('0x25')](function(){_0x33e491[_0xc8f7('0x18')](0xcc)[_0xc8f7('0x28')]();});}};}function handleEntityNotFound(_0x3ec2ea,_0x2955a6){return function(_0x50209f){if(!_0x50209f){_0x3ec2ea[_0xc8f7('0x17')](0x194);}return _0x50209f;};}function handleError(_0x3c5ab7,_0x1bbd2f){_0x1bbd2f=_0x1bbd2f||0x1f4;return function(_0x14cdec){logger[_0xc8f7('0x29')](_0x14cdec[_0xc8f7('0x2a')]);if(_0x14cdec[_0xc8f7('0x2b')]){delete _0x14cdec['name'];}_0x3c5ab7[_0xc8f7('0x18')](_0x1bbd2f)[_0xc8f7('0x2c')](_0x14cdec);};}exports[_0xc8f7('0x2d')]=function(_0xdc26a3,_0x134ea3){var _0x767dbe={},_0x318893={},_0x3b2ea0={'count':0x0,'rows':[]};var _0x5988a5=_['map'](db[_0xc8f7('0x2e')][_0xc8f7('0x2f')],function(_0x2ece22){return{'name':_0x2ece22[_0xc8f7('0x30')],'type':_0x2ece22[_0xc8f7('0x31')][_0xc8f7('0x32')]};});_0x318893[_0xc8f7('0x33')]=_[_0xc8f7('0x34')](_0x5988a5,_0xc8f7('0x2b'));_0x318893[_0xc8f7('0x35')]=_[_0xc8f7('0x36')](_0xdc26a3['query']);_0x318893[_0xc8f7('0x37')]=_['intersection'](_0x318893[_0xc8f7('0x33')],_0x318893[_0xc8f7('0x35')]);_0x767dbe['attributes']=_[_0xc8f7('0x38')](_0x318893['model'],qs[_0xc8f7('0x39')](_0xdc26a3['query'][_0xc8f7('0x39')]));_0x767dbe[_0xc8f7('0x3a')]=_0x767dbe[_0xc8f7('0x3a')][_0xc8f7('0x3b')]?_0x767dbe[_0xc8f7('0x3a')]:_0x318893[_0xc8f7('0x33')];if(!_0xdc26a3[_0xc8f7('0x35')][_0xc8f7('0x3c')](_0xc8f7('0x3d'))){_0x767dbe[_0xc8f7('0x1c')]=qs[_0xc8f7('0x1c')](_0xdc26a3[_0xc8f7('0x35')]['limit']);_0x767dbe[_0xc8f7('0x1a')]=qs[_0xc8f7('0x1a')](_0xdc26a3[_0xc8f7('0x35')][_0xc8f7('0x1a')]);}_0x767dbe[_0xc8f7('0x3e')]=qs['sort'](_0xdc26a3[_0xc8f7('0x35')][_0xc8f7('0x3f')]);_0x767dbe['where']=qs[_0xc8f7('0x37')](_[_0xc8f7('0x40')](_0xdc26a3[_0xc8f7('0x35')],_0x318893[_0xc8f7('0x37')]),_0x5988a5);if(_0xdc26a3[_0xc8f7('0x35')][_0xc8f7('0x41')]){_0x767dbe[_0xc8f7('0x42')]=_[_0xc8f7('0x43')](_0x767dbe['where'],{'$or':_[_0xc8f7('0x34')](_0x5988a5,function(_0x5f4c40){if(_0x5f4c40[_0xc8f7('0x31')]!==_0xc8f7('0x44')){var _0xc83991={};_0xc83991[_0x5f4c40['name']]={'$like':'%'+_0xdc26a3[_0xc8f7('0x35')]['filter']+'%'};return _0xc83991;}})});}_0x767dbe=_[_0xc8f7('0x43')]({},_0x767dbe,_0xdc26a3['options']);var _0x4ec22b={'where':_0x767dbe[_0xc8f7('0x42')]};return db[_0xc8f7('0x2e')][_0xc8f7('0x1d')](_0x4ec22b)[_0xc8f7('0x25')](function(_0xe82b27){_0x3b2ea0[_0xc8f7('0x1d')]=_0xe82b27;if(_0xdc26a3[_0xc8f7('0x35')][_0xc8f7('0x45')]){_0x767dbe[_0xc8f7('0x46')]=[{'all':!![]}];}return db[_0xc8f7('0x2e')][_0xc8f7('0x47')](_0x767dbe);})[_0xc8f7('0x25')](function(_0x4c6d35){_0x3b2ea0[_0xc8f7('0x48')]=_0x4c6d35;return _0x3b2ea0;})[_0xc8f7('0x25')](respondWithFilteredResult(_0x134ea3,_0x767dbe))[_0xc8f7('0x49')](handleError(_0x134ea3,null));};exports[_0xc8f7('0x4a')]=function(_0x47dc32,_0x52e09f){var _0x4341bb={'raw':!![],'where':{'id':_0x47dc32['params']['id']}},_0x5135b8={};_0x5135b8[_0xc8f7('0x33')]=_['keys'](db[_0xc8f7('0x2e')]['rawAttributes']);_0x5135b8[_0xc8f7('0x35')]=_[_0xc8f7('0x36')](_0x47dc32[_0xc8f7('0x35')]);_0x5135b8[_0xc8f7('0x37')]=_[_0xc8f7('0x38')](_0x5135b8['model'],_0x5135b8[_0xc8f7('0x35')]);_0x4341bb[_0xc8f7('0x3a')]=_[_0xc8f7('0x38')](_0x5135b8['model'],qs[_0xc8f7('0x39')](_0x47dc32[_0xc8f7('0x35')][_0xc8f7('0x39')]));_0x4341bb[_0xc8f7('0x3a')]=_0x4341bb[_0xc8f7('0x3a')]['length']?_0x4341bb['attributes']:_0x5135b8[_0xc8f7('0x33')];if(_0x47dc32[_0xc8f7('0x35')][_0xc8f7('0x45')]){_0x4341bb[_0xc8f7('0x46')]=[{'all':!![]}];}_0x4341bb=_[_0xc8f7('0x43')]({},_0x4341bb,_0x47dc32['options']);return db[_0xc8f7('0x2e')][_0xc8f7('0x4b')](_0x4341bb)['then'](handleEntityNotFound(_0x52e09f,null))[_0xc8f7('0x25')](respondWithResult(_0x52e09f,null))[_0xc8f7('0x49')](handleError(_0x52e09f,null));};exports[_0xc8f7('0x4c')]=function(_0x2ee7a3,_0x3ac86a){return db['Template'][_0xc8f7('0x4c')](_0x2ee7a3[_0xc8f7('0x4d')],{})[_0xc8f7('0x25')](function(_0x45237e){var _0x5dfb8e=_0x2ee7a3[_0xc8f7('0x4e')]['get']({'plain':!![]});if(!_0x5dfb8e)throw new Error(_0xc8f7('0x4f'));if(_0x5dfb8e[_0xc8f7('0x50')]===_0xc8f7('0x4e')){var _0x1aa087=_0x45237e[_0xc8f7('0x51')]({'plain':!![]});var _0x5517e2=_0xc8f7('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x5517e2,'userProfileId':_0x5dfb8e['userProfileId']},'raw':!![]})[_0xc8f7('0x25')](function(_0x30cc03){if(_0x30cc03&&_0x30cc03[_0xc8f7('0x52')]===0x0){return db[_0xc8f7('0x27')][_0xc8f7('0x4c')]({'name':_0x1aa087['name'],'resourceId':_0x1aa087['id'],'type':_0x30cc03['name'],'sectionId':_0x30cc03['id']},{})[_0xc8f7('0x25')](function(){return _0x45237e;});}else{return _0x45237e;}})['catch'](function(_0x50f2a3){logger[_0xc8f7('0x29')](_0xc8f7('0x53'),_0x50f2a3);throw _0x50f2a3;});}return _0x45237e;})[_0xc8f7('0x25')](respondWithResult(_0x3ac86a,0xc9))[_0xc8f7('0x49')](handleError(_0x3ac86a,null));};exports[_0xc8f7('0x23')]=function(_0x24e890,_0x310cbf){if(_0x24e890[_0xc8f7('0x4d')]['id']){delete _0x24e890[_0xc8f7('0x4d')]['id'];}return db[_0xc8f7('0x2e')][_0xc8f7('0x4b')]({'where':{'id':_0x24e890[_0xc8f7('0x54')]['id']}})[_0xc8f7('0x25')](handleEntityNotFound(_0x310cbf,null))[_0xc8f7('0x25')](saveUpdates(_0x24e890[_0xc8f7('0x4d')],null))[_0xc8f7('0x25')](respondWithResult(_0x310cbf,null))[_0xc8f7('0x49')](handleError(_0x310cbf,null));};exports[_0xc8f7('0x24')]=function(_0x2e6d0f,_0x3b3044){return db['Template']['find']({'where':{'id':_0x2e6d0f[_0xc8f7('0x54')]['id']}})[_0xc8f7('0x25')](handleEntityNotFound(_0x3b3044,null))[_0xc8f7('0x25')](removeEntity(_0x3b3044,null))[_0xc8f7('0x49')](handleError(_0x3b3044,null));}; \ No newline at end of file +var _0x5e27=['Template','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','merge','where','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x5e27,0x1b5));var _0x75e2=function(_0x2099cd,_0xbab0d6){_0x2099cd=_0x2099cd-0x0;var _0x5077f8=_0x5e27[_0x2099cd];return _0x5077f8;};'use strict';var emlformat=require(_0x75e2('0x0'));var rimraf=require(_0x75e2('0x1'));var zipdir=require(_0x75e2('0x2'));var jsonpatch=require(_0x75e2('0x3'));var rp=require(_0x75e2('0x4'));var moment=require('moment');var BPromise=require(_0x75e2('0x5'));var Mustache=require(_0x75e2('0x6'));var util=require(_0x75e2('0x7'));var path=require(_0x75e2('0x8'));var sox=require(_0x75e2('0x9'));var csv=require(_0x75e2('0xa'));var ejs=require(_0x75e2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75e2('0xc'));var squel=require(_0x75e2('0xd'));var crypto=require(_0x75e2('0xe'));var jsforce=require(_0x75e2('0xf'));var deskjs=require(_0x75e2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75e2('0x11'));var Redis=require(_0x75e2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75e2('0x13'));var hardwareService=require(_0x75e2('0x14'));var logger=require(_0x75e2('0x15'))(_0x75e2('0x16'));var utils=require('../../config/utils');var config=require(_0x75e2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe227c9,_0x4b76d8){_0x4b76d8=_0x4b76d8||0xcc;return function(_0x3cbe17){if(_0x3cbe17){return _0xe227c9[_0x75e2('0x18')](_0x4b76d8);}return _0xe227c9['status'](_0x4b76d8)[_0x75e2('0x19')]();};}function respondWithResult(_0x101789,_0x3cd771){_0x3cd771=_0x3cd771||0xc8;return function(_0x34517b){if(_0x34517b){return _0x101789[_0x75e2('0x1a')](_0x3cd771)[_0x75e2('0x1b')](_0x34517b);}};}function respondWithFilteredResult(_0x37dbfa,_0x36ab23){return function(_0x1d7898){if(_0x1d7898){var _0x856c6c=typeof _0x36ab23['offset']===_0x75e2('0x1c')&&typeof _0x36ab23[_0x75e2('0x1d')]===_0x75e2('0x1c');var _0x239875=_0x1d7898['count'];var _0x409f1e=_0x856c6c?0x0:_0x36ab23[_0x75e2('0x1e')];var _0x2a795c=_0x856c6c?_0x1d7898['count']:_0x36ab23[_0x75e2('0x1e')]+_0x36ab23[_0x75e2('0x1d')];var _0x4b8e3f;if(_0x2a795c>=_0x239875){_0x2a795c=_0x239875;_0x4b8e3f=0xc8;}else{_0x4b8e3f=0xce;}_0x37dbfa['status'](_0x4b8e3f);return _0x37dbfa[_0x75e2('0x1f')](_0x75e2('0x20'),_0x409f1e+'-'+_0x2a795c+'/'+_0x239875)[_0x75e2('0x1b')](_0x1d7898);}return null;};}function patchUpdates(_0xf66708){return function(_0x109ce9){try{jsonpatch[_0x75e2('0x21')](_0x109ce9,_0xf66708,!![]);}catch(_0x5c5abb){return BPromise[_0x75e2('0x22')](_0x5c5abb);}return _0x109ce9[_0x75e2('0x23')]();};}function saveUpdates(_0x2c4e4e,_0x5c3af6){return function(_0x464ebe){if(_0x464ebe){return _0x464ebe[_0x75e2('0x24')](_0x2c4e4e)[_0x75e2('0x25')](function(_0x191a55){return _0x191a55;});}return null;};}function removeEntity(_0x4bf1b4,_0x4d9dbb){return function(_0x5f51f5){if(_0x5f51f5){return _0x5f51f5[_0x75e2('0x26')]()['then'](function(){var _0x31e8c7=_0x5f51f5['get']({'plain':!![]});var _0x108d3f='Templates';return db['UserProfileResource'][_0x75e2('0x26')]({'where':{'type':_0x108d3f,'resourceId':_0x31e8c7['id']}})[_0x75e2('0x25')](function(){return _0x5f51f5;});})[_0x75e2('0x25')](function(){_0x4bf1b4[_0x75e2('0x1a')](0xcc)[_0x75e2('0x19')]();});}};}function handleEntityNotFound(_0x29eb56,_0x3fa198){return function(_0x479ead){if(!_0x479ead){_0x29eb56[_0x75e2('0x18')](0x194);}return _0x479ead;};}function handleError(_0xc47bc3,_0x518fac){_0x518fac=_0x518fac||0x1f4;return function(_0x17596f){logger[_0x75e2('0x27')](_0x17596f['stack']);if(_0x17596f[_0x75e2('0x28')]){delete _0x17596f[_0x75e2('0x28')];}_0xc47bc3['status'](_0x518fac)[_0x75e2('0x29')](_0x17596f);};}exports['index']=function(_0x3fa75e,_0x545ef3){var _0x3182b8={},_0xf3de78={},_0x316ea9={'count':0x0,'rows':[]};var _0x4a4c9d=_[_0x75e2('0x2a')](db[_0x75e2('0x2b')][_0x75e2('0x2c')],function(_0x286ec2){return{'name':_0x286ec2['fieldName'],'type':_0x286ec2[_0x75e2('0x2d')][_0x75e2('0x2e')]};});_0xf3de78[_0x75e2('0x2f')]=_[_0x75e2('0x2a')](_0x4a4c9d,_0x75e2('0x28'));_0xf3de78[_0x75e2('0x30')]=_[_0x75e2('0x31')](_0x3fa75e[_0x75e2('0x30')]);_0xf3de78[_0x75e2('0x32')]=_[_0x75e2('0x33')](_0xf3de78[_0x75e2('0x2f')],_0xf3de78[_0x75e2('0x30')]);_0x3182b8[_0x75e2('0x34')]=_[_0x75e2('0x33')](_0xf3de78[_0x75e2('0x2f')],qs['fields'](_0x3fa75e[_0x75e2('0x30')][_0x75e2('0x35')]));_0x3182b8['attributes']=_0x3182b8[_0x75e2('0x34')][_0x75e2('0x36')]?_0x3182b8[_0x75e2('0x34')]:_0xf3de78[_0x75e2('0x2f')];if(!_0x3fa75e[_0x75e2('0x30')][_0x75e2('0x37')]('nolimit')){_0x3182b8[_0x75e2('0x1d')]=qs[_0x75e2('0x1d')](_0x3fa75e[_0x75e2('0x30')]['limit']);_0x3182b8[_0x75e2('0x1e')]=qs['offset'](_0x3fa75e['query'][_0x75e2('0x1e')]);}_0x3182b8[_0x75e2('0x38')]=qs['sort'](_0x3fa75e[_0x75e2('0x30')][_0x75e2('0x39')]);_0x3182b8['where']=qs[_0x75e2('0x32')](_['pick'](_0x3fa75e[_0x75e2('0x30')],_0xf3de78[_0x75e2('0x32')]),_0x4a4c9d);if(_0x3fa75e[_0x75e2('0x30')]['filter']){_0x3182b8['where']=_[_0x75e2('0x3a')](_0x3182b8[_0x75e2('0x3b')],{'$or':_[_0x75e2('0x2a')](_0x4a4c9d,function(_0x268e74){if(_0x268e74[_0x75e2('0x2d')]!==_0x75e2('0x3c')){var _0x430d3e={};_0x430d3e[_0x268e74['name']]={'$like':'%'+_0x3fa75e['query'][_0x75e2('0x3d')]+'%'};return _0x430d3e;}})});}_0x3182b8=_['merge']({},_0x3182b8,_0x3fa75e[_0x75e2('0x3e')]);var _0x4a2ffd={'where':_0x3182b8[_0x75e2('0x3b')]};return db[_0x75e2('0x2b')][_0x75e2('0x3f')](_0x4a2ffd)[_0x75e2('0x25')](function(_0x3df1cf){_0x316ea9['count']=_0x3df1cf;if(_0x3fa75e[_0x75e2('0x30')][_0x75e2('0x40')]){_0x3182b8[_0x75e2('0x41')]=[{'all':!![]}];}return db[_0x75e2('0x2b')][_0x75e2('0x42')](_0x3182b8);})[_0x75e2('0x25')](function(_0x1d63b1){_0x316ea9[_0x75e2('0x43')]=_0x1d63b1;return _0x316ea9;})[_0x75e2('0x25')](respondWithFilteredResult(_0x545ef3,_0x3182b8))[_0x75e2('0x44')](handleError(_0x545ef3,null));};exports['show']=function(_0x2be719,_0x5c76a1){var _0x52ed69={'raw':!![],'where':{'id':_0x2be719[_0x75e2('0x45')]['id']}},_0x3f2210={};_0x3f2210[_0x75e2('0x2f')]=_[_0x75e2('0x31')](db[_0x75e2('0x2b')][_0x75e2('0x2c')]);_0x3f2210[_0x75e2('0x30')]=_['keys'](_0x2be719['query']);_0x3f2210[_0x75e2('0x32')]=_[_0x75e2('0x33')](_0x3f2210['model'],_0x3f2210[_0x75e2('0x30')]);_0x52ed69['attributes']=_[_0x75e2('0x33')](_0x3f2210[_0x75e2('0x2f')],qs['fields'](_0x2be719[_0x75e2('0x30')][_0x75e2('0x35')]));_0x52ed69['attributes']=_0x52ed69[_0x75e2('0x34')][_0x75e2('0x36')]?_0x52ed69['attributes']:_0x3f2210[_0x75e2('0x2f')];if(_0x2be719[_0x75e2('0x30')][_0x75e2('0x40')]){_0x52ed69[_0x75e2('0x41')]=[{'all':!![]}];}_0x52ed69=_[_0x75e2('0x3a')]({},_0x52ed69,_0x2be719[_0x75e2('0x3e')]);return db['Template'][_0x75e2('0x46')](_0x52ed69)[_0x75e2('0x25')](handleEntityNotFound(_0x5c76a1,null))[_0x75e2('0x25')](respondWithResult(_0x5c76a1,null))[_0x75e2('0x44')](handleError(_0x5c76a1,null));};exports[_0x75e2('0x47')]=function(_0x34b6bb,_0x4e6e2d){return db[_0x75e2('0x2b')][_0x75e2('0x47')](_0x34b6bb['body'],{})['then'](function(_0x4e2d6d){var _0x27b95c=_0x34b6bb[_0x75e2('0x48')][_0x75e2('0x49')]({'plain':!![]});if(!_0x27b95c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27b95c[_0x75e2('0x4a')]==='user'){var _0x34899c=_0x4e2d6d['get']({'plain':!![]});var _0x1da244='Templates';return db[_0x75e2('0x4b')][_0x75e2('0x46')]({'where':{'name':_0x1da244,'userProfileId':_0x27b95c[_0x75e2('0x4c')]},'raw':!![]})['then'](function(_0x36c905){if(_0x36c905&&_0x36c905[_0x75e2('0x4d')]===0x0){return db[_0x75e2('0x4e')]['create']({'name':_0x34899c[_0x75e2('0x28')],'resourceId':_0x34899c['id'],'type':_0x36c905[_0x75e2('0x28')],'sectionId':_0x36c905['id']},{})[_0x75e2('0x25')](function(){return _0x4e2d6d;});}else{return _0x4e2d6d;}})['catch'](function(_0x35f895){logger[_0x75e2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35f895);throw _0x35f895;});}return _0x4e2d6d;})[_0x75e2('0x25')](respondWithResult(_0x4e6e2d,0xc9))[_0x75e2('0x44')](handleError(_0x4e6e2d,null));};exports[_0x75e2('0x24')]=function(_0x58c740,_0x2f7767){if(_0x58c740[_0x75e2('0x4f')]['id']){delete _0x58c740['body']['id'];}return db[_0x75e2('0x2b')][_0x75e2('0x46')]({'where':{'id':_0x58c740[_0x75e2('0x45')]['id']}})[_0x75e2('0x25')](handleEntityNotFound(_0x2f7767,null))[_0x75e2('0x25')](saveUpdates(_0x58c740['body'],null))[_0x75e2('0x25')](respondWithResult(_0x2f7767,null))[_0x75e2('0x44')](handleError(_0x2f7767,null));};exports[_0x75e2('0x26')]=function(_0x27308c,_0x9f3ff6){return db[_0x75e2('0x2b')][_0x75e2('0x46')]({'where':{'id':_0x27308c['params']['id']}})[_0x75e2('0x25')](handleEntityNotFound(_0x9f3ff6,null))[_0x75e2('0x25')](removeEntity(_0x9f3ff6,null))[_0x75e2('0x44')](handleError(_0x9f3ff6,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 140d33b..e552800 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 _0xabcc=['../../config/environment','./template.attributes','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47b9cf,_0x1fdd93){var _0x4d4d58=function(_0x5e78ba){while(--_0x5e78ba){_0x47b9cf['push'](_0x47b9cf['shift']());}};_0x4d4d58(++_0x1fdd93);}(_0xabcc,0xa0));var _0xcabc=function(_0x47eaba,_0x14825c){_0x47eaba=_0x47eaba-0x0;var _0x4ce103=_0xabcc[_0x47eaba];return _0x4ce103;};'use strict';var _=require(_0xcabc('0x0'));var util=require('util');var logger=require(_0xcabc('0x1'))(_0xcabc('0x2'));var moment=require(_0xcabc('0x3'));var BPromise=require(_0xcabc('0x4'));var rp=require(_0xcabc('0x5'));var fs=require('fs');var path=require(_0xcabc('0x6'));var rimraf=require(_0xcabc('0x7'));var config=require(_0xcabc('0x8'));var attributes=require(_0xcabc('0x9'));module['exports']=function(_0x486b42,_0x47ab57){return _0x486b42['define'](_0xcabc('0xa'),attributes,{'tableName':_0xcabc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf17=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','Template'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xaf17,0x153));var _0x7af1=function(_0x26aeb6,_0x5809e6){_0x26aeb6=_0x26aeb6-0x0;var _0x4af791=_0xaf17[_0x26aeb6];return _0x4af791;};'use strict';var _=require(_0x7af1('0x0'));var util=require(_0x7af1('0x1'));var logger=require(_0x7af1('0x2'))(_0x7af1('0x3'));var moment=require(_0x7af1('0x4'));var BPromise=require(_0x7af1('0x5'));var rp=require(_0x7af1('0x6'));var fs=require('fs');var path=require(_0x7af1('0x7'));var rimraf=require(_0x7af1('0x8'));var config=require(_0x7af1('0x9'));var attributes=require(_0x7af1('0xa'));module['exports']=function(_0x13e514,_0x4ed164){return _0x13e514['define'](_0x7af1('0xb'),attributes,{'tableName':_0x7af1('0xc'),'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 f8fc074..13f0873 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 _0x49a2=['catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','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'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x49a2,0xf3));var _0x249a=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0x49a2[_0xf6aec0];return _0x59a51b;};'use strict';var _=require(_0x249a('0x0'));var util=require('util');var moment=require(_0x249a('0x1'));var BPromise=require(_0x249a('0x2'));var rs=require(_0x249a('0x3'));var fs=require('fs');var Redis=require(_0x249a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x249a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x249a('0x6'));var client=jayson[_0x249a('0x7')][_0x249a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c3032,_0x43ba88,_0xf04c00){return new BPromise(function(_0x16a5a9,_0x50d906){return client[_0x249a('0x9')](_0x2c3032,_0xf04c00)[_0x249a('0xa')](function(_0x350dfc){logger[_0x249a('0xb')](_0x249a('0xc'),_0x43ba88,_0x249a('0xd'));logger[_0x249a('0xe')](_0x249a('0xf'),_0x43ba88,_0x249a('0xd'),JSON[_0x249a('0x10')](_0x350dfc));if(_0x350dfc[_0x249a('0x11')]){if(_0x350dfc[_0x249a('0x11')][_0x249a('0x12')]===0x1f4){logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x50d906(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}logger[_0x249a('0x11')](_0x249a('0xc'),_0x43ba88,_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);return _0x16a5a9(_0x350dfc[_0x249a('0x11')][_0x249a('0x13')]);}else{logger[_0x249a('0xb')]('Template,\x20%s,\x20%s',_0x43ba88,_0x249a('0xd'));_0x16a5a9(_0x350dfc[_0x249a('0x14')]['message']);}})[_0x249a('0x15')](function(_0x1d9f30){logger[_0x249a('0x11')]('Template,\x20%s,\x20%s',_0x43ba88,_0x1d9f30);_0x50d906(_0x1d9f30);});});}exports[_0x249a('0x16')]=function(_0x5d7b56){var _0x3749db=this;return new Promise(function(_0x3a749b,_0x10b194){return db[_0x249a('0x17')][_0x249a('0x18')]({'raw':_0x5d7b56[_0x249a('0x19')]?_0x5d7b56['options'][_0x249a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d7b56[_0x249a('0x19')]?_0x5d7b56[_0x249a('0x19')][_0x249a('0x1b')]||null:null,'attributes':_0x5d7b56['options']?_0x5d7b56[_0x249a('0x19')][_0x249a('0x1c')]||null:null,'limit':_0x5d7b56[_0x249a('0x19')]?_0x5d7b56[_0x249a('0x19')][_0x249a('0x1d')]||null:null,'include':_0x5d7b56['options']?_0x5d7b56[_0x249a('0x19')][_0x249a('0x1e')]?_[_0x249a('0x1f')](_0x5d7b56[_0x249a('0x19')]['include'],function(_0x2c9d95){return{'model':db[_0x2c9d95[_0x249a('0x20')]],'as':_0x2c9d95['as'],'attributes':_0x2c9d95['attributes'],'include':_0x2c9d95['include']?_[_0x249a('0x1f')](_0x2c9d95[_0x249a('0x1e')],function(_0x485f2b){return{'model':db[_0x485f2b[_0x249a('0x20')]],'as':_0x485f2b['as'],'attributes':_0x485f2b[_0x249a('0x1c')],'include':_0x485f2b[_0x249a('0x1e')]?_[_0x249a('0x1f')](_0x485f2b[_0x249a('0x1e')],function(_0x562e0b){return{'model':db[_0x562e0b[_0x249a('0x20')]],'as':_0x562e0b['as'],'attributes':_0x562e0b[_0x249a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x249a('0xa')](function(_0x4e75ca){logger['info'](_0x249a('0x16'),_0x5d7b56);logger[_0x249a('0xe')]('GetTemplate',_0x5d7b56,JSON[_0x249a('0x10')](_0x4e75ca));_0x3a749b(_0x4e75ca);})[_0x249a('0x15')](function(_0x1d6d8c){logger[_0x249a('0x11')](_0x249a('0x16'),_0x1d6d8c[_0x249a('0x13')],_0x5d7b56);_0x10b194(_0x3749db[_0x249a('0x11')](0x1f4,_0x1d6d8c[_0x249a('0x13')]));});});}; \ No newline at end of file +var _0x3dec=['client','http','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','Template','findAll','options','where','attributes','limit','include','map','model','then','stringify','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x548d88,_0x32d993){var _0x1498ee=function(_0x76b80b){while(--_0x76b80b){_0x548d88['push'](_0x548d88['shift']());}};_0x1498ee(++_0x32d993);}(_0x3dec,0x18d));var _0xc3de=function(_0x10bf5d,_0x10a3a9){_0x10bf5d=_0x10bf5d-0x0;var _0x27f511=_0x3dec[_0x10bf5d];return _0x27f511;};'use strict';var _=require(_0xc3de('0x0'));var util=require(_0xc3de('0x1'));var moment=require(_0xc3de('0x2'));var BPromise=require(_0xc3de('0x3'));var rs=require(_0xc3de('0x4'));var fs=require('fs');var Redis=require(_0xc3de('0x5'));var db=require(_0xc3de('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3de('0x7'))(_0xc3de('0x8'));var config=require(_0xc3de('0x9'));var jayson=require(_0xc3de('0xa'));var client=jayson[_0xc3de('0xb')][_0xc3de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4af5bf,_0x51b20d,_0x5ec47b){return new BPromise(function(_0x8e67de,_0x46cab7){return client['request'](_0x4af5bf,_0x5ec47b)['then'](function(_0x2fd565){logger['info'](_0xc3de('0xd'),_0x51b20d,_0xc3de('0xe'));logger[_0xc3de('0xf')](_0xc3de('0x10'),_0x51b20d,_0xc3de('0xe'),JSON['stringify'](_0x2fd565));if(_0x2fd565['error']){if(_0x2fd565[_0xc3de('0x11')]['code']===0x1f4){logger[_0xc3de('0x11')](_0xc3de('0xd'),_0x51b20d,_0x2fd565[_0xc3de('0x11')][_0xc3de('0x12')]);return _0x46cab7(_0x2fd565[_0xc3de('0x11')][_0xc3de('0x12')]);}logger['error'](_0xc3de('0xd'),_0x51b20d,_0x2fd565[_0xc3de('0x11')]['message']);return _0x8e67de(_0x2fd565[_0xc3de('0x11')]['message']);}else{logger[_0xc3de('0x13')](_0xc3de('0xd'),_0x51b20d,_0xc3de('0xe'));_0x8e67de(_0x2fd565[_0xc3de('0x14')][_0xc3de('0x12')]);}})[_0xc3de('0x15')](function(_0x248711){logger[_0xc3de('0x11')](_0xc3de('0xd'),_0x51b20d,_0x248711);_0x46cab7(_0x248711);});});}exports['GetTemplate']=function(_0x58f0e3){var _0x32f570=this;return new Promise(function(_0x33dfc8,_0x5194a1){return db[_0xc3de('0x16')][_0xc3de('0x17')]({'raw':_0x58f0e3[_0xc3de('0x18')]?_0x58f0e3[_0xc3de('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x58f0e3['options']?_0x58f0e3['options'][_0xc3de('0x19')]||null:null,'attributes':_0x58f0e3['options']?_0x58f0e3['options'][_0xc3de('0x1a')]||null:null,'limit':_0x58f0e3[_0xc3de('0x18')]?_0x58f0e3[_0xc3de('0x18')][_0xc3de('0x1b')]||null:null,'include':_0x58f0e3[_0xc3de('0x18')]?_0x58f0e3[_0xc3de('0x18')][_0xc3de('0x1c')]?_[_0xc3de('0x1d')](_0x58f0e3[_0xc3de('0x18')][_0xc3de('0x1c')],function(_0x381258){return{'model':db[_0x381258['model']],'as':_0x381258['as'],'attributes':_0x381258['attributes'],'include':_0x381258[_0xc3de('0x1c')]?_['map'](_0x381258[_0xc3de('0x1c')],function(_0x4e875d){return{'model':db[_0x4e875d[_0xc3de('0x1e')]],'as':_0x4e875d['as'],'attributes':_0x4e875d[_0xc3de('0x1a')],'include':_0x4e875d[_0xc3de('0x1c')]?_[_0xc3de('0x1d')](_0x4e875d[_0xc3de('0x1c')],function(_0x24db6a){return{'model':db[_0x24db6a[_0xc3de('0x1e')]],'as':_0x24db6a['as'],'attributes':_0x24db6a['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3de('0x1f')](function(_0x274434){logger[_0xc3de('0x13')]('GetTemplate',_0x58f0e3);logger[_0xc3de('0xf')]('GetTemplate',_0x58f0e3,JSON[_0xc3de('0x20')](_0x274434));_0x33dfc8(_0x274434);})[_0xc3de('0x15')](function(_0x2de7ca){logger['error'](_0xc3de('0x21'),_0x2de7ca[_0xc3de('0x12')],_0x58f0e3);_0x5194a1(_0x32f570[_0xc3de('0x11')](0x1f4,_0x2de7ca['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index fbb101e..f5968ec 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 _0x9672=['/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','index','get','/:id','isAuthenticated','show'];(function(_0x30610a,_0x3c7d4b){var _0x479b2c=function(_0x22f12d){while(--_0x22f12d){_0x30610a['push'](_0x30610a['shift']());}};_0x479b2c(++_0x3c7d4b);}(_0x9672,0xee));var _0x2967=function(_0x7b50bf,_0x54b8b6){_0x7b50bf=_0x7b50bf-0x0;var _0x2589d8=_0x9672[_0x7b50bf];return _0x2589d8;};'use strict';var multer=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var path=require('path');var timeout=require(_0x2967('0x2'));var express=require(_0x2967('0x3'));var router=express[_0x2967('0x4')]();var fs_extra=require(_0x2967('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var controller=require(_0x2967('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2967('0x9')]);router[_0x2967('0xa')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0xd')]);router[_0x2967('0xa')](_0x2967('0xe'),auth[_0x2967('0xc')](),controller['getAllConditions']);router[_0x2967('0xa')](_0x2967('0xf'),auth[_0x2967('0xc')](),controller[_0x2967('0x10')]);router[_0x2967('0xa')](_0x2967('0x11'),auth['isAuthenticated'](),controller[_0x2967('0x12')]);router['post']('/',auth[_0x2967('0xc')](),controller['create']);router[_0x2967('0x13')](_0x2967('0xe'),auth['isAuthenticated'](),controller[_0x2967('0x14')]);router['post'](_0x2967('0xf'),auth[_0x2967('0xc')](),controller[_0x2967('0x15')]);router['post']('/:id/actions',auth[_0x2967('0xc')](),controller[_0x2967('0x16')]);router[_0x2967('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x2967('0x18')]);router[_0x2967('0x19')](_0x2967('0xb'),auth[_0x2967('0xc')](),controller[_0x2967('0x1a')]);module[_0x2967('0x1b')]=router; \ No newline at end of file +var _0xee4e=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','isAuthenticated','getActions','create','post','addAnyCondition','addAction','put','update','delete','exports'];(function(_0x24310a,_0x22f59f){var _0x34fe89=function(_0x4a26c2){while(--_0x4a26c2){_0x24310a['push'](_0x24310a['shift']());}};_0x34fe89(++_0x22f59f);}(_0xee4e,0x122));var _0xeee4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xee4e[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var path=require(_0xeee4('0x2'));var timeout=require('connect-timeout');var express=require(_0xeee4('0x3'));var router=express[_0xeee4('0x4')]();var fs_extra=require(_0xeee4('0x5'));var auth=require(_0xeee4('0x6'));var interaction=require(_0xeee4('0x7'));var config=require(_0xeee4('0x8'));var controller=require(_0xeee4('0x9'));router[_0xeee4('0xa')]('/',auth['isAuthenticated'](),controller[_0xeee4('0xb')]);router[_0xeee4('0xa')](_0xeee4('0xc'),auth['isAuthenticated'](),controller[_0xeee4('0xd')]);router[_0xeee4('0xa')](_0xeee4('0xe'),auth['isAuthenticated'](),controller[_0xeee4('0xf')]);router[_0xeee4('0xa')](_0xeee4('0x10'),auth['isAuthenticated'](),controller[_0xeee4('0x11')]);router['get'](_0xeee4('0x12'),auth[_0xeee4('0x13')](),controller[_0xeee4('0x14')]);router['post']('/',auth[_0xeee4('0x13')](),controller[_0xeee4('0x15')]);router[_0xeee4('0x16')](_0xeee4('0xe'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0xeee4('0x16')](_0xeee4('0x10'),auth[_0xeee4('0x13')](),controller[_0xeee4('0x17')]);router[_0xeee4('0x16')]('/:id/actions',auth['isAuthenticated'](),controller[_0xeee4('0x18')]);router[_0xeee4('0x19')](_0xeee4('0xc'),auth[_0xeee4('0x13')](),controller[_0xeee4('0x1a')]);router[_0xeee4('0x1b')]('/:id',auth[_0xeee4('0x13')](),controller['destroy']);module[_0xeee4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index c8d89fa..c157f5b 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 _0x7d8e=['sequelize','exports','STRING'];(function(_0x2d55a1,_0x30cb10){var _0x39ed86=function(_0x1df22a){while(--_0x1df22a){_0x2d55a1['push'](_0x2d55a1['shift']());}};_0x39ed86(++_0x30cb10);}(_0x7d8e,0x7b));var _0xe7d8=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0x7d8e[_0x8a7e38];return _0x228609;};'use strict';var Sequelize=require(_0xe7d8('0x0'));module[_0xe7d8('0x1')]={'name':{'type':Sequelize[_0xe7d8('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7d8('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6d0f=['BOOLEAN','STRING'];(function(_0x1d7cd3,_0x45d978){var _0x41e1b2=function(_0x210ac4){while(--_0x210ac4){_0x1d7cd3['push'](_0x1d7cd3['shift']());}};_0x41e1b2(++_0x45d978);}(_0x6d0f,0x131));var _0xf6d0=function(_0x15eaff,_0x2fd75f){_0x15eaff=_0x15eaff-0x0;var _0x4c9d5b=_0x6d0f[_0x15eaff];return _0x4c9d5b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf6d0('0x0')]},'channel':{'type':Sequelize[_0xf6d0('0x0')]},'description':{'type':Sequelize[_0xf6d0('0x0')]},'status':{'type':Sequelize[_0xf6d0('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index eaf5ff1..ca9f52c 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 _0x7baf=['hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Triggers','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x27b56d,_0x4ab96a){var _0x443280=function(_0x1ce965){while(--_0x1ce965){_0x27b56d['push'](_0x27b56d['shift']());}};_0x443280(++_0x4ab96a);}(_0x7baf,0x1a9));var _0xf7ba=function(_0x42c560,_0x51587f){_0x42c560=_0x42c560-0x0;var _0x4c0730=_0x7baf[_0x42c560];return _0x4c0730;};'use strict';var emlformat=require(_0xf7ba('0x0'));var rimraf=require(_0xf7ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7ba('0x2'));var rp=require(_0xf7ba('0x3'));var moment=require(_0xf7ba('0x4'));var BPromise=require(_0xf7ba('0x5'));var Mustache=require(_0xf7ba('0x6'));var util=require(_0xf7ba('0x7'));var path=require(_0xf7ba('0x8'));var sox=require(_0xf7ba('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7ba('0xa'));var _=require(_0xf7ba('0xb'));var squel=require(_0xf7ba('0xc'));var crypto=require(_0xf7ba('0xd'));var jsforce=require(_0xf7ba('0xe'));var deskjs=require(_0xf7ba('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf7ba('0x10'));var Redis=require(_0xf7ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf7ba('0x12'));var as=require(_0xf7ba('0x13'));var hardwareService=require(_0xf7ba('0x14'));var logger=require(_0xf7ba('0x15'))(_0xf7ba('0x16'));var utils=require('../../config/utils');var config=require(_0xf7ba('0x17'));var licenseUtil=require(_0xf7ba('0x18'));var db=require(_0xf7ba('0x19'))['db'];function respondWithStatusCode(_0x2416f7,_0x3dd6e9){_0x3dd6e9=_0x3dd6e9||0xcc;return function(_0xb90870){if(_0xb90870){return _0x2416f7[_0xf7ba('0x1a')](_0x3dd6e9);}return _0x2416f7[_0xf7ba('0x1b')](_0x3dd6e9)[_0xf7ba('0x1c')]();};}function respondWithResult(_0x5536b6,_0x415830){_0x415830=_0x415830||0xc8;return function(_0x578635){if(_0x578635){return _0x5536b6[_0xf7ba('0x1b')](_0x415830)[_0xf7ba('0x1d')](_0x578635);}};}function respondWithFilteredResult(_0x2978cf,_0x793abd){return function(_0x321dca){if(_0x321dca){var _0x18e418=typeof _0x793abd[_0xf7ba('0x1e')]===_0xf7ba('0x1f')&&typeof _0x793abd[_0xf7ba('0x20')]==='undefined';var _0xff2d20=_0x321dca[_0xf7ba('0x21')];var _0x222040=_0x18e418?0x0:_0x793abd[_0xf7ba('0x1e')];var _0x4b8945=_0x18e418?_0x321dca['count']:_0x793abd[_0xf7ba('0x1e')]+_0x793abd[_0xf7ba('0x20')];var _0x2441d1;if(_0x4b8945>=_0xff2d20){_0x4b8945=_0xff2d20;_0x2441d1=0xc8;}else{_0x2441d1=0xce;}_0x2978cf[_0xf7ba('0x1b')](_0x2441d1);return _0x2978cf['set'](_0xf7ba('0x22'),_0x222040+'-'+_0x4b8945+'/'+_0xff2d20)[_0xf7ba('0x1d')](_0x321dca);}return null;};}function patchUpdates(_0x730be4){return function(_0xf0b123){try{jsonpatch[_0xf7ba('0x23')](_0xf0b123,_0x730be4,!![]);}catch(_0x287289){return BPromise[_0xf7ba('0x24')](_0x287289);}return _0xf0b123['save']();};}function saveUpdates(_0x2fe8c1,_0x182b14){return function(_0x52355c){if(_0x52355c){return _0x52355c[_0xf7ba('0x25')](_0x2fe8c1)[_0xf7ba('0x26')](function(_0x2c5d97){return _0x2c5d97;});}return null;};}function removeEntity(_0xe7efcb,_0x5e9662){return function(_0x5711a1){if(_0x5711a1){return _0x5711a1[_0xf7ba('0x27')]()[_0xf7ba('0x26')](function(){var _0x1f9b32=_0x5711a1[_0xf7ba('0x28')]({'plain':!![]});var _0xd3b746=_0xf7ba('0x29');return db['UserProfileResource'][_0xf7ba('0x27')]({'where':{'type':_0xd3b746,'resourceId':_0x1f9b32['id']}})[_0xf7ba('0x26')](function(){return _0x5711a1;});})[_0xf7ba('0x26')](function(){_0xe7efcb[_0xf7ba('0x1b')](0xcc)[_0xf7ba('0x1c')]();});}};}function handleEntityNotFound(_0xe5662,_0x4960e2){return function(_0x5f27cf){if(!_0x5f27cf){_0xe5662['sendStatus'](0x194);}return _0x5f27cf;};}function handleError(_0x443bfc,_0xbf0fb3){_0xbf0fb3=_0xbf0fb3||0x1f4;return function(_0x46ba71){logger[_0xf7ba('0x2a')](_0x46ba71[_0xf7ba('0x2b')]);if(_0x46ba71[_0xf7ba('0x2c')]){delete _0x46ba71['name'];}_0x443bfc['status'](_0xbf0fb3)[_0xf7ba('0x2d')](_0x46ba71);};}exports[_0xf7ba('0x2e')]=function(_0x44bb3b,_0x5bb5e5){var _0x269447={},_0x35f0fd={},_0x19d905={'count':0x0,'rows':[]};var _0x4d6655=_['map'](db[_0xf7ba('0x2f')][_0xf7ba('0x30')],function(_0x562f0a){return{'name':_0x562f0a[_0xf7ba('0x31')],'type':_0x562f0a[_0xf7ba('0x32')][_0xf7ba('0x33')]};});_0x35f0fd[_0xf7ba('0x34')]=_['map'](_0x4d6655,_0xf7ba('0x2c'));_0x35f0fd['query']=_[_0xf7ba('0x35')](_0x44bb3b[_0xf7ba('0x36')]);_0x35f0fd[_0xf7ba('0x37')]=_[_0xf7ba('0x38')](_0x35f0fd[_0xf7ba('0x34')],_0x35f0fd[_0xf7ba('0x36')]);_0x269447[_0xf7ba('0x39')]=_[_0xf7ba('0x38')](_0x35f0fd[_0xf7ba('0x34')],qs['fields'](_0x44bb3b[_0xf7ba('0x36')][_0xf7ba('0x3a')]));_0x269447[_0xf7ba('0x39')]=_0x269447[_0xf7ba('0x39')][_0xf7ba('0x3b')]?_0x269447[_0xf7ba('0x39')]:_0x35f0fd[_0xf7ba('0x34')];if(!_0x44bb3b[_0xf7ba('0x36')][_0xf7ba('0x3c')](_0xf7ba('0x3d'))){_0x269447[_0xf7ba('0x20')]=qs[_0xf7ba('0x20')](_0x44bb3b['query'][_0xf7ba('0x20')]);_0x269447[_0xf7ba('0x1e')]=qs['offset'](_0x44bb3b['query'][_0xf7ba('0x1e')]);}_0x269447[_0xf7ba('0x3e')]=qs['sort'](_0x44bb3b[_0xf7ba('0x36')][_0xf7ba('0x3f')]);_0x269447['where']=qs['filters'](_[_0xf7ba('0x40')](_0x44bb3b['query'],_0x35f0fd[_0xf7ba('0x37')]),_0x4d6655);if(_0x44bb3b[_0xf7ba('0x36')]['filter']){_0x269447[_0xf7ba('0x41')]=_[_0xf7ba('0x42')](_0x269447[_0xf7ba('0x41')],{'$or':_[_0xf7ba('0x43')](_0x4d6655,function(_0x469a96){if(_0x469a96[_0xf7ba('0x32')]!==_0xf7ba('0x44')){var _0xc2d3c3={};_0xc2d3c3[_0x469a96[_0xf7ba('0x2c')]]={'$like':'%'+_0x44bb3b[_0xf7ba('0x36')][_0xf7ba('0x45')]+'%'};return _0xc2d3c3;}})});}_0x269447=_[_0xf7ba('0x42')]({},_0x269447,_0x44bb3b['options']);var _0x2285d4={'where':_0x269447['where']};return db[_0xf7ba('0x2f')][_0xf7ba('0x21')](_0x2285d4)['then'](function(_0x1729e8){_0x19d905[_0xf7ba('0x21')]=_0x1729e8;if(_0x44bb3b[_0xf7ba('0x36')][_0xf7ba('0x46')]){_0x269447['include']=[{'all':!![]}];}return db[_0xf7ba('0x2f')][_0xf7ba('0x47')](_0x269447);})[_0xf7ba('0x26')](function(_0x12811c){_0x19d905[_0xf7ba('0x48')]=_0x12811c;return _0x19d905;})[_0xf7ba('0x26')](respondWithFilteredResult(_0x5bb5e5,_0x269447))[_0xf7ba('0x49')](handleError(_0x5bb5e5,null));};exports[_0xf7ba('0x4a')]=function(_0x2da47c,_0x3d90fa){var _0x3bf4e7={'raw':![],'where':{'id':_0x2da47c[_0xf7ba('0x4b')]['id']}},_0x4bf9ef={};_0x4bf9ef[_0xf7ba('0x34')]=_['keys'](db[_0xf7ba('0x2f')]['rawAttributes']);_0x4bf9ef[_0xf7ba('0x36')]=_[_0xf7ba('0x35')](_0x2da47c['query']);_0x4bf9ef[_0xf7ba('0x37')]=_[_0xf7ba('0x38')](_0x4bf9ef[_0xf7ba('0x34')],_0x4bf9ef[_0xf7ba('0x36')]);_0x3bf4e7[_0xf7ba('0x39')]=_[_0xf7ba('0x38')](_0x4bf9ef[_0xf7ba('0x34')],qs['fields'](_0x2da47c[_0xf7ba('0x36')][_0xf7ba('0x3a')]));_0x3bf4e7['attributes']=_0x3bf4e7[_0xf7ba('0x39')][_0xf7ba('0x3b')]?_0x3bf4e7[_0xf7ba('0x39')]:_0x4bf9ef['model'];if(_0x2da47c[_0xf7ba('0x36')][_0xf7ba('0x46')]){_0x3bf4e7[_0xf7ba('0x4c')]=[{'all':!![]}];}_0x3bf4e7=_[_0xf7ba('0x42')]({},_0x3bf4e7,_0x2da47c[_0xf7ba('0x4d')]);return db[_0xf7ba('0x2f')][_0xf7ba('0x4e')](_0x3bf4e7)[_0xf7ba('0x26')](handleEntityNotFound(_0x3d90fa,null))[_0xf7ba('0x26')](respondWithResult(_0x3d90fa,null))['catch'](handleError(_0x3d90fa,null));};exports['create']=function(_0x4b4480,_0x3f9ede){return db[_0xf7ba('0x2f')][_0xf7ba('0x4f')](_0x4b4480[_0xf7ba('0x50')],{})[_0xf7ba('0x26')](function(_0x4d13a9){var _0x1e7549=_0x4b4480[_0xf7ba('0x51')][_0xf7ba('0x28')]({'plain':!![]});if(!_0x1e7549)throw new Error(_0xf7ba('0x52'));if(_0x1e7549[_0xf7ba('0x53')]===_0xf7ba('0x51')){var _0x111900=_0x4d13a9[_0xf7ba('0x28')]({'plain':!![]});var _0xca5c3a=_0xf7ba('0x29');return db[_0xf7ba('0x54')]['find']({'where':{'name':_0xca5c3a,'userProfileId':_0x1e7549[_0xf7ba('0x55')]},'raw':!![]})[_0xf7ba('0x26')](function(_0x135e75){if(_0x135e75&&_0x135e75['autoAssociation']===0x0){return db[_0xf7ba('0x56')][_0xf7ba('0x4f')]({'name':_0x111900['name'],'resourceId':_0x111900['id'],'type':_0x135e75['name'],'sectionId':_0x135e75['id']},{})[_0xf7ba('0x26')](function(){return _0x4d13a9;});}else{return _0x4d13a9;}})[_0xf7ba('0x49')](function(_0x57ae4f){logger['error'](_0xf7ba('0x57'),_0x57ae4f);throw _0x57ae4f;});}return _0x4d13a9;})[_0xf7ba('0x26')](respondWithResult(_0x3f9ede,0xc9))[_0xf7ba('0x49')](handleError(_0x3f9ede,null));};exports[_0xf7ba('0x25')]=function(_0x586d9e,_0x301a3c){if(_0x586d9e[_0xf7ba('0x50')]['id']){delete _0x586d9e[_0xf7ba('0x50')]['id'];}return db[_0xf7ba('0x2f')][_0xf7ba('0x4e')]({'where':{'id':_0x586d9e[_0xf7ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x301a3c,null))[_0xf7ba('0x26')](saveUpdates(_0x586d9e[_0xf7ba('0x50')],null))[_0xf7ba('0x26')](respondWithResult(_0x301a3c,null))['catch'](handleError(_0x301a3c,null));};exports[_0xf7ba('0x27')]=function(_0x4f14c1,_0xa1a7fb){return db[_0xf7ba('0x2f')][_0xf7ba('0x4e')]({'where':{'id':_0x4f14c1[_0xf7ba('0x4b')]['id']}})[_0xf7ba('0x26')](handleEntityNotFound(_0xa1a7fb,null))['then'](removeEntity(_0xa1a7fb,null))[_0xf7ba('0x49')](handleError(_0xa1a7fb,null));};exports['addAllCondition']=function(_0x129a65,_0x3a4190,_0x411297){if(_0x129a65['body']['id']){delete _0x129a65[_0xf7ba('0x50')]['id'];}return db['Trigger'][_0xf7ba('0x4e')]({'where':{'id':_0x129a65[_0xf7ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a4190,null))[_0xf7ba('0x26')](function(_0x1537b7){if(_0x1537b7){_0x129a65['body'][_0xf7ba('0x58')]=_0x1537b7['id'];return db[_0xf7ba('0x59')][_0xf7ba('0x4f')](_0x129a65[_0xf7ba('0x50')]);}})['then'](respondWithResult(_0x3a4190,null))[_0xf7ba('0x49')](handleError(_0x3a4190,null));};exports[_0xf7ba('0x5a')]=function(_0x5b4bcd,_0x4e9e07,_0x3ffc90){if(_0x5b4bcd['body']['id']){delete _0x5b4bcd['body']['id'];}return db[_0xf7ba('0x2f')]['find']({'where':{'id':_0x5b4bcd[_0xf7ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e9e07,null))[_0xf7ba('0x26')](function(_0x4a72c7){if(_0x4a72c7){_0x5b4bcd[_0xf7ba('0x50')][_0xf7ba('0x5b')]=_0x4a72c7['id'];return db[_0xf7ba('0x59')][_0xf7ba('0x4f')](_0x5b4bcd[_0xf7ba('0x50')]);}})[_0xf7ba('0x26')](respondWithResult(_0x4e9e07,null))['catch'](handleError(_0x4e9e07,null));};exports[_0xf7ba('0x5c')]=function(_0x11ef8e,_0x52336f,_0x19c1a3){var _0x18dad8={};var _0x1a8531={};var _0x5b8879;var _0x1d927d;return db[_0xf7ba('0x2f')]['findOne']({'where':{'id':_0x11ef8e['params']['id']}})[_0xf7ba('0x26')](handleEntityNotFound(_0x52336f,null))[_0xf7ba('0x26')](function(_0x3bf8f0){if(_0x3bf8f0){_0x5b8879=_0x3bf8f0;_0x1a8531[_0xf7ba('0x34')]=_[_0xf7ba('0x35')](db[_0xf7ba('0x59')][_0xf7ba('0x30')]);_0x1a8531[_0xf7ba('0x36')]=_['keys'](_0x11ef8e[_0xf7ba('0x36')]);_0x1a8531[_0xf7ba('0x37')]=_[_0xf7ba('0x38')](_0x1a8531[_0xf7ba('0x34')],_0x1a8531[_0xf7ba('0x36')]);_0x18dad8[_0xf7ba('0x39')]=_['intersection'](_0x1a8531[_0xf7ba('0x34')],qs[_0xf7ba('0x3a')](_0x11ef8e[_0xf7ba('0x36')]['fields']));_0x18dad8[_0xf7ba('0x39')]=_0x18dad8[_0xf7ba('0x39')][_0xf7ba('0x3b')]?_0x18dad8[_0xf7ba('0x39')]:_0x1a8531[_0xf7ba('0x34')];_0x18dad8[_0xf7ba('0x3e')]=qs[_0xf7ba('0x3f')](_0x11ef8e[_0xf7ba('0x36')]['sort']);_0x18dad8[_0xf7ba('0x41')]=qs[_0xf7ba('0x37')](_[_0xf7ba('0x40')](_0x11ef8e[_0xf7ba('0x36')],_0x1a8531[_0xf7ba('0x37')]));if(_0x11ef8e[_0xf7ba('0x36')][_0xf7ba('0x45')]){_0x18dad8['where']=_[_0xf7ba('0x42')](_0x18dad8['where'],{'$or':_['map'](_0x18dad8[_0xf7ba('0x39')],function(_0x3d64ae){var _0x147dc8={};_0x147dc8[_0x3d64ae]={'$like':'%'+_0x11ef8e[_0xf7ba('0x36')]['filter']+'%'};return _0x147dc8;})});}_0x18dad8=_[_0xf7ba('0x42')]({},_0x18dad8,_0x11ef8e[_0xf7ba('0x4d')]);return _0x5b8879['getAllConditions'](_0x18dad8);}})[_0xf7ba('0x26')](function(_0x132c4e){if(_0x132c4e){_0x1d927d=_0x132c4e[_0xf7ba('0x3b')];if(!_0x11ef8e['query']['hasOwnProperty']('nolimit')){_0x18dad8[_0xf7ba('0x20')]=qs[_0xf7ba('0x20')](_0x11ef8e[_0xf7ba('0x36')]['limit']);_0x18dad8[_0xf7ba('0x1e')]=qs[_0xf7ba('0x1e')](_0x11ef8e[_0xf7ba('0x36')][_0xf7ba('0x1e')]);}return _0x5b8879[_0xf7ba('0x5c')](_0x18dad8);}})[_0xf7ba('0x26')](function(_0x1729b0){if(_0x1729b0){return _0x1729b0?{'count':_0x1d927d,'rows':_0x1729b0}:null;}})[_0xf7ba('0x26')](respondWithResult(_0x52336f,null))[_0xf7ba('0x49')](handleError(_0x52336f,null));};exports[_0xf7ba('0x5d')]=function(_0x59e0a5,_0xbdd04a,_0x26ee98){var _0x176bc1={};var _0x52aab5={};var _0x3435b9;var _0x3ce8e1;return db[_0xf7ba('0x2f')][_0xf7ba('0x5e')]({'where':{'id':_0x59e0a5[_0xf7ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbdd04a,null))['then'](function(_0x312b88){if(_0x312b88){_0x3435b9=_0x312b88;_0x52aab5[_0xf7ba('0x34')]=_[_0xf7ba('0x35')](db[_0xf7ba('0x59')][_0xf7ba('0x30')]);_0x52aab5[_0xf7ba('0x36')]=_['keys'](_0x59e0a5[_0xf7ba('0x36')]);_0x52aab5['filters']=_[_0xf7ba('0x38')](_0x52aab5[_0xf7ba('0x34')],_0x52aab5[_0xf7ba('0x36')]);_0x176bc1[_0xf7ba('0x39')]=_[_0xf7ba('0x38')](_0x52aab5['model'],qs[_0xf7ba('0x3a')](_0x59e0a5[_0xf7ba('0x36')][_0xf7ba('0x3a')]));_0x176bc1[_0xf7ba('0x39')]=_0x176bc1[_0xf7ba('0x39')][_0xf7ba('0x3b')]?_0x176bc1['attributes']:_0x52aab5[_0xf7ba('0x34')];_0x176bc1[_0xf7ba('0x3e')]=qs['sort'](_0x59e0a5['query'][_0xf7ba('0x3f')]);_0x176bc1['where']=qs[_0xf7ba('0x37')](_[_0xf7ba('0x40')](_0x59e0a5['query'],_0x52aab5[_0xf7ba('0x37')]));if(_0x59e0a5['query'][_0xf7ba('0x45')]){_0x176bc1[_0xf7ba('0x41')]=_[_0xf7ba('0x42')](_0x176bc1[_0xf7ba('0x41')],{'$or':_[_0xf7ba('0x43')](_0x176bc1[_0xf7ba('0x39')],function(_0x31591c){var _0x9b1a67={};_0x9b1a67[_0x31591c]={'$like':'%'+_0x59e0a5['query']['filter']+'%'};return _0x9b1a67;})});}_0x176bc1=_[_0xf7ba('0x42')]({},_0x176bc1,_0x59e0a5[_0xf7ba('0x4d')]);return _0x3435b9[_0xf7ba('0x5d')](_0x176bc1);}})[_0xf7ba('0x26')](function(_0x373f0c){if(_0x373f0c){_0x3ce8e1=_0x373f0c[_0xf7ba('0x3b')];if(!_0x59e0a5['query'][_0xf7ba('0x3c')]('nolimit')){_0x176bc1['limit']=qs[_0xf7ba('0x20')](_0x59e0a5['query'][_0xf7ba('0x20')]);_0x176bc1['offset']=qs[_0xf7ba('0x1e')](_0x59e0a5['query']['offset']);}return _0x3435b9[_0xf7ba('0x5d')](_0x176bc1);}})['then'](function(_0x27a364){if(_0x27a364){return _0x27a364?{'count':_0x3ce8e1,'rows':_0x27a364}:null;}})[_0xf7ba('0x26')](respondWithResult(_0xbdd04a,null))[_0xf7ba('0x49')](handleError(_0xbdd04a,null));};exports['addAction']=function(_0xe9843,_0x27b444,_0x6c778a){if(_0xe9843[_0xf7ba('0x50')]['id']){delete _0xe9843['body']['id'];}return db[_0xf7ba('0x2f')][_0xf7ba('0x4e')]({'where':{'id':_0xe9843[_0xf7ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27b444,null))[_0xf7ba('0x26')](function(_0x3f979b){if(_0x3f979b){_0xe9843['body']['TriggerId']=_0x3f979b['id'];return db[_0xf7ba('0x5f')][_0xf7ba('0x4f')](_0xe9843[_0xf7ba('0x50')]);}})[_0xf7ba('0x26')](respondWithResult(_0x27b444,null))[_0xf7ba('0x49')](handleError(_0x27b444,null));};exports[_0xf7ba('0x60')]=function(_0x376082,_0xd7cbe4,_0x90337c){var _0x50db40={};var _0x16ae95={};var _0x2cffdc;var _0x4f1405;return db[_0xf7ba('0x2f')][_0xf7ba('0x5e')]({'where':{'id':_0x376082[_0xf7ba('0x4b')]['id']}})[_0xf7ba('0x26')](handleEntityNotFound(_0xd7cbe4,null))[_0xf7ba('0x26')](function(_0x78ee34){if(_0x78ee34){_0x2cffdc=_0x78ee34;_0x16ae95[_0xf7ba('0x34')]=_['keys'](db[_0xf7ba('0x5f')][_0xf7ba('0x30')]);_0x16ae95['query']=_[_0xf7ba('0x35')](_0x376082['query']);_0x16ae95[_0xf7ba('0x37')]=_['intersection'](_0x16ae95[_0xf7ba('0x34')],_0x16ae95[_0xf7ba('0x36')]);_0x50db40[_0xf7ba('0x39')]=_[_0xf7ba('0x38')](_0x16ae95[_0xf7ba('0x34')],qs['fields'](_0x376082['query'][_0xf7ba('0x3a')]));_0x50db40[_0xf7ba('0x39')]=_0x50db40[_0xf7ba('0x39')][_0xf7ba('0x3b')]?_0x50db40[_0xf7ba('0x39')]:_0x16ae95['model'];_0x50db40['order']=qs[_0xf7ba('0x3f')](_0x376082[_0xf7ba('0x36')][_0xf7ba('0x3f')]);_0x50db40[_0xf7ba('0x41')]=qs[_0xf7ba('0x37')](_[_0xf7ba('0x40')](_0x376082['query'],_0x16ae95['filters']));if(_0x376082[_0xf7ba('0x36')][_0xf7ba('0x45')]){_0x50db40[_0xf7ba('0x41')]=_['merge'](_0x50db40[_0xf7ba('0x41')],{'$or':_['map'](_0x50db40['attributes'],function(_0x47fdf0){var _0x566e04={};_0x566e04[_0x47fdf0]={'$like':'%'+_0x376082[_0xf7ba('0x36')][_0xf7ba('0x45')]+'%'};return _0x566e04;})});}_0x50db40=_['merge']({},_0x50db40,_0x376082['options']);return _0x2cffdc['getActions'](_0x50db40);}})[_0xf7ba('0x26')](function(_0x1b4458){if(_0x1b4458){_0x4f1405=_0x1b4458['length'];if(!_0x376082[_0xf7ba('0x36')]['hasOwnProperty'](_0xf7ba('0x3d'))){_0x50db40[_0xf7ba('0x20')]=qs[_0xf7ba('0x20')](_0x376082['query']['limit']);_0x50db40[_0xf7ba('0x1e')]=qs[_0xf7ba('0x1e')](_0x376082[_0xf7ba('0x36')][_0xf7ba('0x1e')]);}return _0x2cffdc[_0xf7ba('0x60')](_0x50db40);}})[_0xf7ba('0x26')](function(_0x5ac33d){if(_0x5ac33d){return _0x5ac33d?{'count':_0x4f1405,'rows':_0x5ac33d}:null;}})['then'](respondWithResult(_0xd7cbe4,null))[_0xf7ba('0x49')](handleError(_0xd7cbe4,null));}; \ No newline at end of file +var _0xc6be=['sendStatus','status','end','offset','undefined','limit','count','set','json','apply','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','role','user','UserProfileSection','autoAssociation','create','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','options','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','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'];(function(_0x34587e,_0x53939){var _0x2db49a=function(_0x39621c){while(--_0x39621c){_0x34587e['push'](_0x34587e['shift']());}};_0x2db49a(++_0x53939);}(_0xc6be,0x165));var _0xec6b=function(_0x2dc86e,_0x579bdf){_0x2dc86e=_0x2dc86e-0x0;var _0x12291a=_0xc6be[_0x2dc86e];return _0x12291a;};'use strict';var emlformat=require(_0xec6b('0x0'));var rimraf=require(_0xec6b('0x1'));var zipdir=require(_0xec6b('0x2'));var jsonpatch=require(_0xec6b('0x3'));var rp=require(_0xec6b('0x4'));var moment=require(_0xec6b('0x5'));var BPromise=require(_0xec6b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xec6b('0x7'));var sox=require(_0xec6b('0x8'));var csv=require('to-csv');var ejs=require(_0xec6b('0x9'));var fs=require('fs');var fs_extra=require(_0xec6b('0xa'));var _=require('lodash');var squel=require(_0xec6b('0xb'));var crypto=require('crypto');var jsforce=require(_0xec6b('0xc'));var deskjs=require(_0xec6b('0xd'));var toCsv=require(_0xec6b('0xe'));var querystring=require(_0xec6b('0xf'));var Papa=require(_0xec6b('0x10'));var Redis=require('ioredis');var authService=require(_0xec6b('0x11'));var qs=require(_0xec6b('0x12'));var as=require(_0xec6b('0x13'));var hardwareService=require(_0xec6b('0x14'));var logger=require(_0xec6b('0x15'))(_0xec6b('0x16'));var utils=require(_0xec6b('0x17'));var config=require(_0xec6b('0x18'));var licenseUtil=require(_0xec6b('0x19'));var db=require(_0xec6b('0x1a'))['db'];function respondWithStatusCode(_0xc6d0f,_0x119637){_0x119637=_0x119637||0xcc;return function(_0x3bfb1d){if(_0x3bfb1d){return _0xc6d0f[_0xec6b('0x1b')](_0x119637);}return _0xc6d0f[_0xec6b('0x1c')](_0x119637)[_0xec6b('0x1d')]();};}function respondWithResult(_0x1fddf2,_0x4d12b3){_0x4d12b3=_0x4d12b3||0xc8;return function(_0x4e4805){if(_0x4e4805){return _0x1fddf2[_0xec6b('0x1c')](_0x4d12b3)['json'](_0x4e4805);}};}function respondWithFilteredResult(_0x1c917a,_0x65a5fb){return function(_0x39671f){if(_0x39671f){var _0x1cd1ed=typeof _0x65a5fb[_0xec6b('0x1e')]===_0xec6b('0x1f')&&typeof _0x65a5fb[_0xec6b('0x20')]===_0xec6b('0x1f');var _0x350eab=_0x39671f[_0xec6b('0x21')];var _0x4a2d21=_0x1cd1ed?0x0:_0x65a5fb[_0xec6b('0x1e')];var _0x505a19=_0x1cd1ed?_0x39671f[_0xec6b('0x21')]:_0x65a5fb[_0xec6b('0x1e')]+_0x65a5fb[_0xec6b('0x20')];var _0x442a53;if(_0x505a19>=_0x350eab){_0x505a19=_0x350eab;_0x442a53=0xc8;}else{_0x442a53=0xce;}_0x1c917a[_0xec6b('0x1c')](_0x442a53);return _0x1c917a[_0xec6b('0x22')]('Content-Range',_0x4a2d21+'-'+_0x505a19+'/'+_0x350eab)[_0xec6b('0x23')](_0x39671f);}return null;};}function patchUpdates(_0x2eafcf){return function(_0x29139f){try{jsonpatch[_0xec6b('0x24')](_0x29139f,_0x2eafcf,!![]);}catch(_0x4f3d15){return BPromise['reject'](_0x4f3d15);}return _0x29139f['save']();};}function saveUpdates(_0x4c8f59,_0x305e4e){return function(_0x1fa59f){if(_0x1fa59f){return _0x1fa59f[_0xec6b('0x25')](_0x4c8f59)[_0xec6b('0x26')](function(_0x141fef){return _0x141fef;});}return null;};}function removeEntity(_0x4fa662,_0xfb2a56){return function(_0x2a861b){if(_0x2a861b){return _0x2a861b[_0xec6b('0x27')]()['then'](function(){var _0x266c81=_0x2a861b[_0xec6b('0x28')]({'plain':!![]});var _0x1deaa2='Triggers';return db[_0xec6b('0x29')][_0xec6b('0x27')]({'where':{'type':_0x1deaa2,'resourceId':_0x266c81['id']}})[_0xec6b('0x26')](function(){return _0x2a861b;});})[_0xec6b('0x26')](function(){_0x4fa662['status'](0xcc)[_0xec6b('0x1d')]();});}};}function handleEntityNotFound(_0x5643cd,_0xc50c40){return function(_0x527463){if(!_0x527463){_0x5643cd[_0xec6b('0x1b')](0x194);}return _0x527463;};}function handleError(_0x48ba2e,_0x1b487b){_0x1b487b=_0x1b487b||0x1f4;return function(_0x153b06){logger[_0xec6b('0x2a')](_0x153b06[_0xec6b('0x2b')]);if(_0x153b06[_0xec6b('0x2c')]){delete _0x153b06[_0xec6b('0x2c')];}_0x48ba2e[_0xec6b('0x1c')](_0x1b487b)[_0xec6b('0x2d')](_0x153b06);};}exports[_0xec6b('0x2e')]=function(_0x2e65e0,_0x1d9b0a){var _0x12fb98={},_0x377ccc={},_0x1da561={'count':0x0,'rows':[]};var _0x566e18=_[_0xec6b('0x2f')](db[_0xec6b('0x30')][_0xec6b('0x31')],function(_0x47b208){return{'name':_0x47b208[_0xec6b('0x32')],'type':_0x47b208[_0xec6b('0x33')][_0xec6b('0x34')]};});_0x377ccc['model']=_[_0xec6b('0x2f')](_0x566e18,_0xec6b('0x2c'));_0x377ccc[_0xec6b('0x35')]=_['keys'](_0x2e65e0[_0xec6b('0x35')]);_0x377ccc[_0xec6b('0x36')]=_[_0xec6b('0x37')](_0x377ccc['model'],_0x377ccc['query']);_0x12fb98[_0xec6b('0x38')]=_[_0xec6b('0x37')](_0x377ccc[_0xec6b('0x39')],qs[_0xec6b('0x3a')](_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x3a')]));_0x12fb98['attributes']=_0x12fb98[_0xec6b('0x38')][_0xec6b('0x3b')]?_0x12fb98['attributes']:_0x377ccc['model'];if(!_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x3c')](_0xec6b('0x3d'))){_0x12fb98[_0xec6b('0x20')]=qs[_0xec6b('0x20')](_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x20')]);_0x12fb98['offset']=qs['offset'](_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x1e')]);}_0x12fb98[_0xec6b('0x3e')]=qs[_0xec6b('0x3f')](_0x2e65e0['query'][_0xec6b('0x3f')]);_0x12fb98['where']=qs[_0xec6b('0x36')](_[_0xec6b('0x40')](_0x2e65e0['query'],_0x377ccc[_0xec6b('0x36')]),_0x566e18);if(_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x41')]){_0x12fb98[_0xec6b('0x42')]=_['merge'](_0x12fb98[_0xec6b('0x42')],{'$or':_['map'](_0x566e18,function(_0x389999){if(_0x389999[_0xec6b('0x33')]!==_0xec6b('0x43')){var _0x4c7089={};_0x4c7089[_0x389999[_0xec6b('0x2c')]]={'$like':'%'+_0x2e65e0[_0xec6b('0x35')][_0xec6b('0x41')]+'%'};return _0x4c7089;}})});}_0x12fb98=_[_0xec6b('0x44')]({},_0x12fb98,_0x2e65e0['options']);var _0x4508ad={'where':_0x12fb98[_0xec6b('0x42')]};return db['Trigger'][_0xec6b('0x21')](_0x4508ad)['then'](function(_0x5a2314){_0x1da561['count']=_0x5a2314;if(_0x2e65e0['query'][_0xec6b('0x45')]){_0x12fb98[_0xec6b('0x46')]=[{'all':!![]}];}return db['Trigger'][_0xec6b('0x47')](_0x12fb98);})['then'](function(_0x4a84df){_0x1da561[_0xec6b('0x48')]=_0x4a84df;return _0x1da561;})[_0xec6b('0x26')](respondWithFilteredResult(_0x1d9b0a,_0x12fb98))[_0xec6b('0x49')](handleError(_0x1d9b0a,null));};exports[_0xec6b('0x4a')]=function(_0xb42ee,_0x38a3b9){var _0x54a138={'raw':![],'where':{'id':_0xb42ee[_0xec6b('0x4b')]['id']}},_0x3ef1ed={};_0x3ef1ed[_0xec6b('0x39')]=_[_0xec6b('0x4c')](db[_0xec6b('0x30')][_0xec6b('0x31')]);_0x3ef1ed[_0xec6b('0x35')]=_[_0xec6b('0x4c')](_0xb42ee[_0xec6b('0x35')]);_0x3ef1ed[_0xec6b('0x36')]=_[_0xec6b('0x37')](_0x3ef1ed[_0xec6b('0x39')],_0x3ef1ed[_0xec6b('0x35')]);_0x54a138[_0xec6b('0x38')]=_[_0xec6b('0x37')](_0x3ef1ed[_0xec6b('0x39')],qs[_0xec6b('0x3a')](_0xb42ee['query'][_0xec6b('0x3a')]));_0x54a138[_0xec6b('0x38')]=_0x54a138[_0xec6b('0x38')][_0xec6b('0x3b')]?_0x54a138[_0xec6b('0x38')]:_0x3ef1ed[_0xec6b('0x39')];if(_0xb42ee[_0xec6b('0x35')][_0xec6b('0x45')]){_0x54a138[_0xec6b('0x46')]=[{'all':!![]}];}_0x54a138=_[_0xec6b('0x44')]({},_0x54a138,_0xb42ee['options']);return db[_0xec6b('0x30')][_0xec6b('0x4d')](_0x54a138)[_0xec6b('0x26')](handleEntityNotFound(_0x38a3b9,null))[_0xec6b('0x26')](respondWithResult(_0x38a3b9,null))[_0xec6b('0x49')](handleError(_0x38a3b9,null));};exports['create']=function(_0x4b94ac,_0x1172f5){return db['Trigger']['create'](_0x4b94ac['body'],{})[_0xec6b('0x26')](function(_0x1916c4){var _0x514e7d=_0x4b94ac['user'][_0xec6b('0x28')]({'plain':!![]});if(!_0x514e7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514e7d[_0xec6b('0x4e')]===_0xec6b('0x4f')){var _0x2dd4a9=_0x1916c4['get']({'plain':!![]});var _0x17f3f6='Triggers';return db[_0xec6b('0x50')][_0xec6b('0x4d')]({'where':{'name':_0x17f3f6,'userProfileId':_0x514e7d['userProfileId']},'raw':!![]})[_0xec6b('0x26')](function(_0x148162){if(_0x148162&&_0x148162[_0xec6b('0x51')]===0x0){return db[_0xec6b('0x29')][_0xec6b('0x52')]({'name':_0x2dd4a9[_0xec6b('0x2c')],'resourceId':_0x2dd4a9['id'],'type':_0x148162[_0xec6b('0x2c')],'sectionId':_0x148162['id']},{})[_0xec6b('0x26')](function(){return _0x1916c4;});}else{return _0x1916c4;}})[_0xec6b('0x49')](function(_0x2986e1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2986e1);throw _0x2986e1;});}return _0x1916c4;})['then'](respondWithResult(_0x1172f5,0xc9))['catch'](handleError(_0x1172f5,null));};exports[_0xec6b('0x25')]=function(_0x590b7c,_0xb6e132){if(_0x590b7c['body']['id']){delete _0x590b7c['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x590b7c['params']['id']}})[_0xec6b('0x26')](handleEntityNotFound(_0xb6e132,null))[_0xec6b('0x26')](saveUpdates(_0x590b7c[_0xec6b('0x53')],null))[_0xec6b('0x26')](respondWithResult(_0xb6e132,null))['catch'](handleError(_0xb6e132,null));};exports[_0xec6b('0x27')]=function(_0x49982a,_0x31757d){return db['Trigger'][_0xec6b('0x4d')]({'where':{'id':_0x49982a[_0xec6b('0x4b')]['id']}})[_0xec6b('0x26')](handleEntityNotFound(_0x31757d,null))['then'](removeEntity(_0x31757d,null))['catch'](handleError(_0x31757d,null));};exports[_0xec6b('0x54')]=function(_0x411e39,_0x496704,_0x787495){if(_0x411e39[_0xec6b('0x53')]['id']){delete _0x411e39[_0xec6b('0x53')]['id'];}return db[_0xec6b('0x30')][_0xec6b('0x4d')]({'where':{'id':_0x411e39[_0xec6b('0x4b')]['id']}})[_0xec6b('0x26')](handleEntityNotFound(_0x496704,null))[_0xec6b('0x26')](function(_0x14abc9){if(_0x14abc9){_0x411e39[_0xec6b('0x53')][_0xec6b('0x55')]=_0x14abc9['id'];return db[_0xec6b('0x56')][_0xec6b('0x52')](_0x411e39[_0xec6b('0x53')]);}})[_0xec6b('0x26')](respondWithResult(_0x496704,null))[_0xec6b('0x49')](handleError(_0x496704,null));};exports[_0xec6b('0x57')]=function(_0x295d1f,_0x7322e3,_0x1bed93){if(_0x295d1f['body']['id']){delete _0x295d1f[_0xec6b('0x53')]['id'];}return db['Trigger'][_0xec6b('0x4d')]({'where':{'id':_0x295d1f[_0xec6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x7322e3,null))[_0xec6b('0x26')](function(_0x228a43){if(_0x228a43){_0x295d1f[_0xec6b('0x53')]['TriggerAnyId']=_0x228a43['id'];return db['Condition']['create'](_0x295d1f[_0xec6b('0x53')]);}})['then'](respondWithResult(_0x7322e3,null))[_0xec6b('0x49')](handleError(_0x7322e3,null));};exports[_0xec6b('0x58')]=function(_0x5eeb8e,_0x2bc79d,_0x55b766){var _0x389a87={};var _0x4157ca={};var _0x1d1507;var _0x579d85;return db[_0xec6b('0x30')]['findOne']({'where':{'id':_0x5eeb8e['params']['id']}})[_0xec6b('0x26')](handleEntityNotFound(_0x2bc79d,null))[_0xec6b('0x26')](function(_0x2ffa83){if(_0x2ffa83){_0x1d1507=_0x2ffa83;_0x4157ca[_0xec6b('0x39')]=_[_0xec6b('0x4c')](db[_0xec6b('0x56')][_0xec6b('0x31')]);_0x4157ca['query']=_[_0xec6b('0x4c')](_0x5eeb8e[_0xec6b('0x35')]);_0x4157ca[_0xec6b('0x36')]=_['intersection'](_0x4157ca[_0xec6b('0x39')],_0x4157ca[_0xec6b('0x35')]);_0x389a87[_0xec6b('0x38')]=_[_0xec6b('0x37')](_0x4157ca['model'],qs[_0xec6b('0x3a')](_0x5eeb8e[_0xec6b('0x35')][_0xec6b('0x3a')]));_0x389a87['attributes']=_0x389a87['attributes'][_0xec6b('0x3b')]?_0x389a87[_0xec6b('0x38')]:_0x4157ca[_0xec6b('0x39')];_0x389a87['order']=qs[_0xec6b('0x3f')](_0x5eeb8e['query'][_0xec6b('0x3f')]);_0x389a87['where']=qs[_0xec6b('0x36')](_[_0xec6b('0x40')](_0x5eeb8e['query'],_0x4157ca[_0xec6b('0x36')]));if(_0x5eeb8e[_0xec6b('0x35')][_0xec6b('0x41')]){_0x389a87[_0xec6b('0x42')]=_['merge'](_0x389a87['where'],{'$or':_[_0xec6b('0x2f')](_0x389a87['attributes'],function(_0x2e79db){var _0x40de74={};_0x40de74[_0x2e79db]={'$like':'%'+_0x5eeb8e[_0xec6b('0x35')][_0xec6b('0x41')]+'%'};return _0x40de74;})});}_0x389a87=_[_0xec6b('0x44')]({},_0x389a87,_0x5eeb8e[_0xec6b('0x59')]);return _0x1d1507[_0xec6b('0x58')](_0x389a87);}})[_0xec6b('0x26')](function(_0x2ed1a8){if(_0x2ed1a8){_0x579d85=_0x2ed1a8[_0xec6b('0x3b')];if(!_0x5eeb8e[_0xec6b('0x35')]['hasOwnProperty'](_0xec6b('0x3d'))){_0x389a87[_0xec6b('0x20')]=qs[_0xec6b('0x20')](_0x5eeb8e[_0xec6b('0x35')][_0xec6b('0x20')]);_0x389a87[_0xec6b('0x1e')]=qs[_0xec6b('0x1e')](_0x5eeb8e[_0xec6b('0x35')][_0xec6b('0x1e')]);}return _0x1d1507[_0xec6b('0x58')](_0x389a87);}})[_0xec6b('0x26')](function(_0x3a84d2){if(_0x3a84d2){return _0x3a84d2?{'count':_0x579d85,'rows':_0x3a84d2}:null;}})[_0xec6b('0x26')](respondWithResult(_0x2bc79d,null))['catch'](handleError(_0x2bc79d,null));};exports[_0xec6b('0x5a')]=function(_0x433fb6,_0x40b7ab,_0x599ec9){var _0x478d5c={};var _0x3c4240={};var _0x4dfa62;var _0x442ba2;return db[_0xec6b('0x30')][_0xec6b('0x5b')]({'where':{'id':_0x433fb6['params']['id']}})['then'](handleEntityNotFound(_0x40b7ab,null))['then'](function(_0x38373f){if(_0x38373f){_0x4dfa62=_0x38373f;_0x3c4240[_0xec6b('0x39')]=_[_0xec6b('0x4c')](db[_0xec6b('0x56')][_0xec6b('0x31')]);_0x3c4240[_0xec6b('0x35')]=_[_0xec6b('0x4c')](_0x433fb6[_0xec6b('0x35')]);_0x3c4240['filters']=_[_0xec6b('0x37')](_0x3c4240[_0xec6b('0x39')],_0x3c4240[_0xec6b('0x35')]);_0x478d5c[_0xec6b('0x38')]=_[_0xec6b('0x37')](_0x3c4240[_0xec6b('0x39')],qs['fields'](_0x433fb6['query']['fields']));_0x478d5c['attributes']=_0x478d5c['attributes'][_0xec6b('0x3b')]?_0x478d5c[_0xec6b('0x38')]:_0x3c4240[_0xec6b('0x39')];_0x478d5c['order']=qs[_0xec6b('0x3f')](_0x433fb6[_0xec6b('0x35')][_0xec6b('0x3f')]);_0x478d5c[_0xec6b('0x42')]=qs[_0xec6b('0x36')](_[_0xec6b('0x40')](_0x433fb6[_0xec6b('0x35')],_0x3c4240[_0xec6b('0x36')]));if(_0x433fb6['query'][_0xec6b('0x41')]){_0x478d5c[_0xec6b('0x42')]=_[_0xec6b('0x44')](_0x478d5c['where'],{'$or':_[_0xec6b('0x2f')](_0x478d5c[_0xec6b('0x38')],function(_0x305103){var _0x4609cc={};_0x4609cc[_0x305103]={'$like':'%'+_0x433fb6['query'][_0xec6b('0x41')]+'%'};return _0x4609cc;})});}_0x478d5c=_[_0xec6b('0x44')]({},_0x478d5c,_0x433fb6[_0xec6b('0x59')]);return _0x4dfa62['getAnyConditions'](_0x478d5c);}})['then'](function(_0x349b3f){if(_0x349b3f){_0x442ba2=_0x349b3f[_0xec6b('0x3b')];if(!_0x433fb6[_0xec6b('0x35')][_0xec6b('0x3c')](_0xec6b('0x3d'))){_0x478d5c[_0xec6b('0x20')]=qs['limit'](_0x433fb6[_0xec6b('0x35')][_0xec6b('0x20')]);_0x478d5c[_0xec6b('0x1e')]=qs[_0xec6b('0x1e')](_0x433fb6['query'][_0xec6b('0x1e')]);}return _0x4dfa62['getAnyConditions'](_0x478d5c);}})[_0xec6b('0x26')](function(_0x47d4b1){if(_0x47d4b1){return _0x47d4b1?{'count':_0x442ba2,'rows':_0x47d4b1}:null;}})[_0xec6b('0x26')](respondWithResult(_0x40b7ab,null))[_0xec6b('0x49')](handleError(_0x40b7ab,null));};exports[_0xec6b('0x5c')]=function(_0x5b8fc3,_0xf96133,_0x54cb3b){if(_0x5b8fc3[_0xec6b('0x53')]['id']){delete _0x5b8fc3[_0xec6b('0x53')]['id'];}return db[_0xec6b('0x30')][_0xec6b('0x4d')]({'where':{'id':_0x5b8fc3[_0xec6b('0x4b')]['id']}})[_0xec6b('0x26')](handleEntityNotFound(_0xf96133,null))['then'](function(_0x3f5b5b){if(_0x3f5b5b){_0x5b8fc3[_0xec6b('0x53')][_0xec6b('0x5d')]=_0x3f5b5b['id'];return db[_0xec6b('0x5e')][_0xec6b('0x52')](_0x5b8fc3[_0xec6b('0x53')]);}})[_0xec6b('0x26')](respondWithResult(_0xf96133,null))[_0xec6b('0x49')](handleError(_0xf96133,null));};exports[_0xec6b('0x5f')]=function(_0x263bb8,_0xcef903,_0x4f1805){var _0x5436b2={};var _0x3411a2={};var _0x42fb3b;var _0x165a6c;return db['Trigger'][_0xec6b('0x5b')]({'where':{'id':_0x263bb8[_0xec6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcef903,null))[_0xec6b('0x26')](function(_0x35b1c5){if(_0x35b1c5){_0x42fb3b=_0x35b1c5;_0x3411a2[_0xec6b('0x39')]=_[_0xec6b('0x4c')](db[_0xec6b('0x5e')][_0xec6b('0x31')]);_0x3411a2[_0xec6b('0x35')]=_[_0xec6b('0x4c')](_0x263bb8[_0xec6b('0x35')]);_0x3411a2[_0xec6b('0x36')]=_[_0xec6b('0x37')](_0x3411a2[_0xec6b('0x39')],_0x3411a2[_0xec6b('0x35')]);_0x5436b2[_0xec6b('0x38')]=_[_0xec6b('0x37')](_0x3411a2[_0xec6b('0x39')],qs['fields'](_0x263bb8[_0xec6b('0x35')]['fields']));_0x5436b2['attributes']=_0x5436b2[_0xec6b('0x38')]['length']?_0x5436b2[_0xec6b('0x38')]:_0x3411a2[_0xec6b('0x39')];_0x5436b2[_0xec6b('0x3e')]=qs[_0xec6b('0x3f')](_0x263bb8[_0xec6b('0x35')][_0xec6b('0x3f')]);_0x5436b2[_0xec6b('0x42')]=qs['filters'](_[_0xec6b('0x40')](_0x263bb8[_0xec6b('0x35')],_0x3411a2[_0xec6b('0x36')]));if(_0x263bb8[_0xec6b('0x35')][_0xec6b('0x41')]){_0x5436b2[_0xec6b('0x42')]=_[_0xec6b('0x44')](_0x5436b2['where'],{'$or':_[_0xec6b('0x2f')](_0x5436b2[_0xec6b('0x38')],function(_0x259afa){var _0x465a2={};_0x465a2[_0x259afa]={'$like':'%'+_0x263bb8[_0xec6b('0x35')][_0xec6b('0x41')]+'%'};return _0x465a2;})});}_0x5436b2=_[_0xec6b('0x44')]({},_0x5436b2,_0x263bb8[_0xec6b('0x59')]);return _0x42fb3b['getActions'](_0x5436b2);}})[_0xec6b('0x26')](function(_0x46291c){if(_0x46291c){_0x165a6c=_0x46291c[_0xec6b('0x3b')];if(!_0x263bb8[_0xec6b('0x35')]['hasOwnProperty']('nolimit')){_0x5436b2[_0xec6b('0x20')]=qs[_0xec6b('0x20')](_0x263bb8['query'][_0xec6b('0x20')]);_0x5436b2['offset']=qs[_0xec6b('0x1e')](_0x263bb8['query'][_0xec6b('0x1e')]);}return _0x42fb3b[_0xec6b('0x5f')](_0x5436b2);}})[_0xec6b('0x26')](function(_0x28ae0f){if(_0x28ae0f){return _0x28ae0f?{'count':_0x165a6c,'rows':_0x28ae0f}:null;}})[_0xec6b('0x26')](respondWithResult(_0xcef903,null))[_0xec6b('0x49')](handleError(_0xcef903,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 40227de..18805df 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 _0x0c02=['./trigger.attributes','exports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x508867,_0x37c32b){var _0x50d219=function(_0x51c6ed){while(--_0x51c6ed){_0x508867['push'](_0x508867['shift']());}};_0x50d219(++_0x37c32b);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var logger=require(_0x20c0('0x1'))('api');var moment=require(_0x20c0('0x2'));var BPromise=require(_0x20c0('0x3'));var rp=require(_0x20c0('0x4'));var fs=require('fs');var path=require(_0x20c0('0x5'));var rimraf=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var attributes=require(_0x20c0('0x8'));module[_0x20c0('0x9')]=function(_0x13312d,_0xd25ee8){return _0x13312d['define']('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee2=['../../config/logger','api','moment','request-promise','path','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util'];(function(_0x26a9e6,_0x2f028a){var _0x1ec392=function(_0xaa7438){while(--_0xaa7438){_0x26a9e6['push'](_0x26a9e6['shift']());}};_0x1ec392(++_0x2f028a);}(_0x1ee2,0x11c));var _0x21ee=function(_0x302486,_0x80eb87){_0x302486=_0x302486-0x0;var _0x4ed511=_0x1ee2[_0x302486];return _0x4ed511;};'use strict';var _=require(_0x21ee('0x0'));var util=require(_0x21ee('0x1'));var logger=require(_0x21ee('0x2'))(_0x21ee('0x3'));var moment=require(_0x21ee('0x4'));var BPromise=require('bluebird');var rp=require(_0x21ee('0x5'));var fs=require('fs');var path=require(_0x21ee('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x21ee('0x7'));module[_0x21ee('0x8')]=function(_0x221a30,_0x20a492){return _0x221a30['define'](_0x21ee('0x9'),attributes,{'tableName':_0x21ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 5664baa..1101d7a 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 _0x190a=['where','include','map','model','attributes','catch','ShowTrigger','Trigger','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','options','raw'];(function(_0x35aeb8,_0x41d01b){var _0xc8f75d=function(_0x1eab56){while(--_0x1eab56){_0x35aeb8['push'](_0x35aeb8['shift']());}};_0xc8f75d(++_0x41d01b);}(_0x190a,0xb3));var _0xa190=function(_0x3312f6,_0x248a41){_0x3312f6=_0x3312f6-0x0;var _0x4bbd09=_0x190a[_0x3312f6];return _0x4bbd09;};'use strict';var _=require(_0xa190('0x0'));var util=require('util');var moment=require(_0xa190('0x1'));var BPromise=require(_0xa190('0x2'));var rs=require(_0xa190('0x3'));var fs=require('fs');var Redis=require(_0xa190('0x4'));var db=require(_0xa190('0x5'))['db'];var utils=require(_0xa190('0x6'));var logger=require('../../config/logger')(_0xa190('0x7'));var config=require(_0xa190('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa190('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50f6eb,_0x2bd03e,_0x4cb699){return new BPromise(function(_0x380f92,_0x2a8764){return client[_0xa190('0xa')](_0x50f6eb,_0x4cb699)[_0xa190('0xb')](function(_0x2fe2c3){logger[_0xa190('0xc')]('Trigger,\x20%s,\x20%s',_0x2bd03e,_0xa190('0xd'));logger[_0xa190('0xe')](_0xa190('0xf'),_0x2bd03e,_0xa190('0xd'),JSON[_0xa190('0x10')](_0x2fe2c3));if(_0x2fe2c3[_0xa190('0x11')]){if(_0x2fe2c3['error'][_0xa190('0x12')]===0x1f4){logger[_0xa190('0x11')](_0xa190('0x13'),_0x2bd03e,_0x2fe2c3['error'][_0xa190('0x14')]);return _0x2a8764(_0x2fe2c3[_0xa190('0x11')][_0xa190('0x14')]);}logger[_0xa190('0x11')]('Trigger,\x20%s,\x20%s',_0x2bd03e,_0x2fe2c3[_0xa190('0x11')][_0xa190('0x14')]);return _0x380f92(_0x2fe2c3[_0xa190('0x11')][_0xa190('0x14')]);}else{logger[_0xa190('0xc')](_0xa190('0x13'),_0x2bd03e,_0xa190('0xd'));_0x380f92(_0x2fe2c3[_0xa190('0x15')][_0xa190('0x14')]);}})['catch'](function(_0x37ba99){logger[_0xa190('0x11')](_0xa190('0x13'),_0x2bd03e,_0x37ba99);_0x2a8764(_0x37ba99);});});}exports[_0xa190('0x16')]=function(_0x2509b5){var _0x243266=this;return new Promise(function(_0x3829bc,_0x247e05){return db['Trigger']['findAll']({'raw':_0x2509b5['options']?_0x2509b5[_0xa190('0x17')][_0xa190('0x18')]===undefined?!![]:![]:!![],'where':_0x2509b5[_0xa190('0x17')]?_0x2509b5[_0xa190('0x17')][_0xa190('0x19')]||null:null,'attributes':_0x2509b5['options']?_0x2509b5[_0xa190('0x17')]['attributes']||null:null,'limit':_0x2509b5[_0xa190('0x17')]?_0x2509b5[_0xa190('0x17')]['limit']||null:null,'include':_0x2509b5[_0xa190('0x17')]?_0x2509b5[_0xa190('0x17')][_0xa190('0x1a')]?_[_0xa190('0x1b')](_0x2509b5['options'][_0xa190('0x1a')],function(_0x495c55){return{'model':db[_0x495c55[_0xa190('0x1c')]],'as':_0x495c55['as'],'attributes':_0x495c55['attributes'],'include':_0x495c55[_0xa190('0x1a')]?_['map'](_0x495c55[_0xa190('0x1a')],function(_0x360b4c){return{'model':db[_0x360b4c[_0xa190('0x1c')]],'as':_0x360b4c['as'],'attributes':_0x360b4c[_0xa190('0x1d')],'include':_0x360b4c[_0xa190('0x1a')]?_[_0xa190('0x1b')](_0x360b4c[_0xa190('0x1a')],function(_0x4c719a){return{'model':db[_0x4c719a['model']],'as':_0x4c719a['as'],'attributes':_0x4c719a[_0xa190('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa190('0xb')](function(_0x127966){logger[_0xa190('0xc')]('GetTrigger',_0x2509b5);logger['debug'](_0xa190('0x16'),_0x2509b5,JSON[_0xa190('0x10')](_0x127966));_0x3829bc(_0x127966);})[_0xa190('0x1e')](function(_0x1d9696){logger[_0xa190('0x11')]('GetTrigger',_0x1d9696[_0xa190('0x14')],_0x2509b5);_0x247e05(_0x243266[_0xa190('0x11')](0x1f4,_0x1d9696['message']));});});};exports[_0xa190('0x1f')]=function(_0x4a5a78){var _0x55c2c0=this;return new Promise(function(_0x11a621,_0x29ac31){return db[_0xa190('0x20')][_0xa190('0x21')]({'raw':_0x4a5a78[_0xa190('0x17')]?_0x4a5a78['options'][_0xa190('0x18')]===undefined?!![]:![]:!![],'where':_0x4a5a78[_0xa190('0x17')]?_0x4a5a78[_0xa190('0x17')]['where']||null:null,'attributes':_0x4a5a78[_0xa190('0x17')]?_0x4a5a78['options'][_0xa190('0x1d')]||null:null,'include':_0x4a5a78[_0xa190('0x17')]?_0x4a5a78[_0xa190('0x17')][_0xa190('0x1a')]?_[_0xa190('0x1b')](_0x4a5a78[_0xa190('0x17')]['include'],function(_0x3179de){return{'model':db[_0x3179de[_0xa190('0x1c')]],'as':_0x3179de['as'],'attributes':_0x3179de[_0xa190('0x1d')],'include':_0x3179de[_0xa190('0x1a')]?_[_0xa190('0x1b')](_0x3179de['include'],function(_0x18967e){return{'model':db[_0x18967e[_0xa190('0x1c')]],'as':_0x18967e['as'],'attributes':_0x18967e[_0xa190('0x1d')],'include':_0x18967e[_0xa190('0x1a')]?_['map'](_0x18967e['include'],function(_0x8f0dad){return{'model':db[_0x8f0dad[_0xa190('0x1c')]],'as':_0x8f0dad['as'],'attributes':_0x8f0dad[_0xa190('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa190('0xb')](function(_0x1106b0){logger[_0xa190('0xc')](_0xa190('0x1f'),_0x4a5a78);logger[_0xa190('0xe')](_0xa190('0x1f'),_0x4a5a78,JSON[_0xa190('0x10')](_0x1106b0));_0x11a621(_0x1106b0);})[_0xa190('0x1e')](function(_0x32c71b){logger[_0xa190('0x11')](_0xa190('0x1f'),_0x32c71b[_0xa190('0x14')],_0x4a5a78);_0x29ac31(_0x55c2c0[_0xa190('0x11')](0x1f4,_0x32c71b['message']));});});}; \ No newline at end of file +var _0x9971=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrigger'];(function(_0x525509,_0x3af854){var _0x492648=function(_0x549b18){while(--_0x549b18){_0x525509['push'](_0x525509['shift']());}};_0x492648(++_0x3af854);}(_0x9971,0x1e1));var _0x1997=function(_0x320e2c,_0x5cc29e){_0x320e2c=_0x320e2c-0x0;var _0x81d272=_0x9971[_0x320e2c];return _0x81d272;};'use strict';var _=require('lodash');var util=require(_0x1997('0x0'));var moment=require(_0x1997('0x1'));var BPromise=require(_0x1997('0x2'));var rs=require(_0x1997('0x3'));var fs=require('fs');var Redis=require(_0x1997('0x4'));var db=require(_0x1997('0x5'))['db'];var utils=require(_0x1997('0x6'));var logger=require(_0x1997('0x7'))('rpc');var config=require(_0x1997('0x8'));var jayson=require(_0x1997('0x9'));var client=jayson[_0x1997('0xa')][_0x1997('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec2f8e,_0xd6e84f,_0x60a86d){return new BPromise(function(_0xe21681,_0x5ab4f6){return client[_0x1997('0xc')](_0xec2f8e,_0x60a86d)[_0x1997('0xd')](function(_0x1e1e2e){logger[_0x1997('0xe')](_0x1997('0xf'),_0xd6e84f,'request\x20sent');logger[_0x1997('0x10')](_0x1997('0x11'),_0xd6e84f,_0x1997('0x12'),JSON[_0x1997('0x13')](_0x1e1e2e));if(_0x1e1e2e[_0x1997('0x14')]){if(_0x1e1e2e[_0x1997('0x14')][_0x1997('0x15')]===0x1f4){logger[_0x1997('0x14')](_0x1997('0xf'),_0xd6e84f,_0x1e1e2e[_0x1997('0x14')][_0x1997('0x16')]);return _0x5ab4f6(_0x1e1e2e[_0x1997('0x14')]['message']);}logger[_0x1997('0x14')]('Trigger,\x20%s,\x20%s',_0xd6e84f,_0x1e1e2e[_0x1997('0x14')][_0x1997('0x16')]);return _0xe21681(_0x1e1e2e[_0x1997('0x14')][_0x1997('0x16')]);}else{logger[_0x1997('0xe')]('Trigger,\x20%s,\x20%s',_0xd6e84f,'request\x20sent');_0xe21681(_0x1e1e2e['result']['message']);}})[_0x1997('0x17')](function(_0x5c7c1e){logger['error'](_0x1997('0xf'),_0xd6e84f,_0x5c7c1e);_0x5ab4f6(_0x5c7c1e);});});}exports[_0x1997('0x18')]=function(_0x2565cc){var _0x392e9d=this;return new Promise(function(_0x2b8852,_0x3e48a8){return db[_0x1997('0x19')][_0x1997('0x1a')]({'raw':_0x2565cc[_0x1997('0x1b')]?_0x2565cc['options'][_0x1997('0x1c')]===undefined?!![]:![]:!![],'where':_0x2565cc['options']?_0x2565cc[_0x1997('0x1b')][_0x1997('0x1d')]||null:null,'attributes':_0x2565cc[_0x1997('0x1b')]?_0x2565cc['options'][_0x1997('0x1e')]||null:null,'limit':_0x2565cc[_0x1997('0x1b')]?_0x2565cc['options'][_0x1997('0x1f')]||null:null,'include':_0x2565cc[_0x1997('0x1b')]?_0x2565cc['options'][_0x1997('0x20')]?_[_0x1997('0x21')](_0x2565cc['options'][_0x1997('0x20')],function(_0x57de68){return{'model':db[_0x57de68[_0x1997('0x22')]],'as':_0x57de68['as'],'attributes':_0x57de68[_0x1997('0x1e')],'include':_0x57de68[_0x1997('0x20')]?_['map'](_0x57de68[_0x1997('0x20')],function(_0x59f8f0){return{'model':db[_0x59f8f0[_0x1997('0x22')]],'as':_0x59f8f0['as'],'attributes':_0x59f8f0[_0x1997('0x1e')],'include':_0x59f8f0[_0x1997('0x20')]?_[_0x1997('0x21')](_0x59f8f0[_0x1997('0x20')],function(_0x507d00){return{'model':db[_0x507d00['model']],'as':_0x507d00['as'],'attributes':_0x507d00['attributes']};}):[]};}):[]};}):[]:[]})[_0x1997('0xd')](function(_0x80b01c){logger['info'](_0x1997('0x18'),_0x2565cc);logger[_0x1997('0x10')](_0x1997('0x18'),_0x2565cc,JSON[_0x1997('0x13')](_0x80b01c));_0x2b8852(_0x80b01c);})[_0x1997('0x17')](function(_0x396d43){logger[_0x1997('0x14')](_0x1997('0x18'),_0x396d43[_0x1997('0x16')],_0x2565cc);_0x3e48a8(_0x392e9d['error'](0x1f4,_0x396d43[_0x1997('0x16')]));});});};exports['ShowTrigger']=function(_0x5d908c){var _0x41d403=this;return new Promise(function(_0x48e5dd,_0x2f9b8f){return db['Trigger'][_0x1997('0x23')]({'raw':_0x5d908c['options']?_0x5d908c['options'][_0x1997('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d908c['options']?_0x5d908c[_0x1997('0x1b')]['where']||null:null,'attributes':_0x5d908c['options']?_0x5d908c['options']['attributes']||null:null,'include':_0x5d908c['options']?_0x5d908c[_0x1997('0x1b')]['include']?_['map'](_0x5d908c[_0x1997('0x1b')][_0x1997('0x20')],function(_0x7ebc1c){return{'model':db[_0x7ebc1c['model']],'as':_0x7ebc1c['as'],'attributes':_0x7ebc1c['attributes'],'include':_0x7ebc1c[_0x1997('0x20')]?_[_0x1997('0x21')](_0x7ebc1c[_0x1997('0x20')],function(_0x3f342d){return{'model':db[_0x3f342d[_0x1997('0x22')]],'as':_0x3f342d['as'],'attributes':_0x3f342d[_0x1997('0x1e')],'include':_0x3f342d[_0x1997('0x20')]?_[_0x1997('0x21')](_0x3f342d[_0x1997('0x20')],function(_0x2e076d){return{'model':db[_0x2e076d[_0x1997('0x22')]],'as':_0x2e076d['as'],'attributes':_0x2e076d[_0x1997('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1997('0xd')](function(_0x511289){logger[_0x1997('0xe')](_0x1997('0x24'),_0x5d908c);logger['debug'](_0x1997('0x24'),_0x5d908c,JSON[_0x1997('0x13')](_0x511289));_0x48e5dd(_0x511289);})[_0x1997('0x17')](function(_0x1ed55a){logger['error']('ShowTrigger',_0x1ed55a[_0x1997('0x16')],_0x5d908c);_0x2f9b8f(_0x41d403[_0x1997('0x14')](0x1f4,_0x1ed55a[_0x1997('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 50b021d..2eae916 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 _0xc5a9=['get','isAuthenticated','index','show','post','/:id/clone','create','/:id','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xc5a9,0x1bb));var _0x9c5a=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0xc5a9[_0x459423];return _0x42ed14;};'use strict';var multer=require('multer');var util=require(_0x9c5a('0x0'));var path=require('path');var timeout=require(_0x9c5a('0x1'));var express=require('express');var router=express[_0x9c5a('0x2')]();var fs_extra=require(_0x9c5a('0x3'));var auth=require(_0x9c5a('0x4'));var interaction=require(_0x9c5a('0x5'));var config=require('../../config/environment');var controller=require(_0x9c5a('0x6'));router[_0x9c5a('0x7')]('/',auth[_0x9c5a('0x8')](),controller[_0x9c5a('0x9')]);router['get']('/:id',auth[_0x9c5a('0x8')](),controller[_0x9c5a('0xa')]);router[_0x9c5a('0xb')](_0x9c5a('0xc'),auth[_0x9c5a('0x8')](),controller['clone']);router['post']('/',auth[_0x9c5a('0x8')](),controller[_0x9c5a('0xd')]);router['put'](_0x9c5a('0xe'),auth[_0x9c5a('0x8')](),controller['update']);router[_0x9c5a('0xf')](_0x9c5a('0xe'),auth[_0x9c5a('0x8')](),controller[_0x9c5a('0x10')]);module[_0x9c5a('0x11')]=router; \ No newline at end of file +var _0x6eb6=['get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eb6,0x115));var _0x66eb=function(_0x537c93,_0x1321d0){_0x537c93=_0x537c93-0x0;var _0x4b8f6e=_0x6eb6[_0x537c93];return _0x4b8f6e;};'use strict';var multer=require(_0x66eb('0x0'));var util=require(_0x66eb('0x1'));var path=require('path');var timeout=require(_0x66eb('0x2'));var express=require(_0x66eb('0x3'));var router=express[_0x66eb('0x4')]();var fs_extra=require(_0x66eb('0x5'));var auth=require(_0x66eb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x66eb('0x7'));var controller=require(_0x66eb('0x8'));router[_0x66eb('0x9')]('/',auth['isAuthenticated'](),controller[_0x66eb('0xa')]);router[_0x66eb('0x9')](_0x66eb('0xb'),auth[_0x66eb('0xc')](),controller[_0x66eb('0xd')]);router[_0x66eb('0xe')](_0x66eb('0xf'),auth['isAuthenticated'](),controller[_0x66eb('0x10')]);router[_0x66eb('0xe')]('/',auth[_0x66eb('0xc')](),controller[_0x66eb('0x11')]);router[_0x66eb('0x12')](_0x66eb('0xb'),auth['isAuthenticated'](),controller[_0x66eb('0x13')]);router[_0x66eb('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x66eb('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b52221d..3e40aea 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 _0xb604=['STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','sequelize','exports','name','user','friend'];(function(_0x78bfeb,_0x49b60a){var _0xfedbf=function(_0x3becb7){while(--_0x3becb7){_0x78bfeb['push'](_0x78bfeb['shift']());}};_0xfedbf(++_0x49b60a);}(_0xb604,0xc3));var _0x4b60=function(_0x217657,_0x2246e9){_0x217657=_0x217657-0x0;var _0x115c80=_0xb604[_0x217657];return _0x115c80;};'use strict';var Sequelize=require(_0x4b60('0x0'));module[_0x4b60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b60('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x4b60('0x3'),'peer'),'allowNull':![],'defaultValue':_0x4b60('0x4')},'context':{'type':Sequelize[_0x4b60('0x5')],'allowNull':![],'defaultValue':_0x4b60('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x4b60('0x7'),_0x4b60('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0x4b60('0x9'),_0x4b60('0xa'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x4b60('0x5')]},'secret':{'type':Sequelize[_0x4b60('0x5')]},'md5secret':{'type':Sequelize[_0x4b60('0x5')]},'remotesecret':{'type':Sequelize[_0x4b60('0x5')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x4b60('0xb'),'set':function(_0xfbfe1d){this['setDataValue'](_0x4b60('0xc'),_0xfbfe1d?_0xfbfe1d[_0x4b60('0xd')](','):null);},'get':function(){return this[_0x4b60('0xe')](_0x4b60('0xc'))?this[_0x4b60('0xe')]('transport')[_0x4b60('0xf')](','):null;},'comment':_0x4b60('0x10')},'dtmfmode':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x12'),_0x4b60('0x13'),_0x4b60('0x14'),_0x4b60('0x15'),_0x4b60('0x16')),'defaultValue':_0x4b60('0x12')},'directmedia':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no',_0x4b60('0x18'),_0x4b60('0x19'),_0x4b60('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4b60('0x5')]},'directmediadeny':{'type':Sequelize[_0x4b60('0x5')]},'nat':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':_0x4b60('0x1b'),'set':function(_0xd63bb1){this['setDataValue'](_0x4b60('0x1c'),_0xd63bb1?_0xd63bb1['join'](','):null);},'get':function(){return this[_0x4b60('0xe')](_0x4b60('0x1c'))?this[_0x4b60('0xe')](_0x4b60('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4b60('0x5')]},'namedcallgroup':{'type':Sequelize[_0x4b60('0x5')]},'pickupgroup':{'type':Sequelize[_0x4b60('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4b60('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':_0x4b60('0x1d')},'allow':{'type':Sequelize[_0x4b60('0x5')],'allowNull':![],'defaultValue':_0x4b60('0x1e'),'set':function(_0x501e82){this[_0x4b60('0x1f')](_0x4b60('0x20'),_0x501e82?_0x501e82[_0x4b60('0xd')](';'):_0x4b60('0x1e'));},'get':function(){return this['getDataValue'](_0x4b60('0x20'))?this[_0x4b60('0xe')]('allow')[_0x4b60('0xf')](';'):null;},'comment':_0x4b60('0x21')},'autoframing':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'insecure':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':'port,invite','set':function(_0x2a6831){this[_0x4b60('0x1f')](_0x4b60('0x22'),_0x2a6831?_0x2a6831[_0x4b60('0xd')](','):null);},'get':function(){return this['getDataValue'](_0x4b60('0x22'))?this[_0x4b60('0xe')](_0x4b60('0x22'))['split'](','):null;},'comment':_0x4b60('0x23')},'trustrpid':{'type':Sequelize[_0x4b60('0x11')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4b60('0x11')]('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no')},'accountcode':{'type':Sequelize[_0x4b60('0x24')](0xb)},'setvar':{'type':Sequelize[_0x4b60('0x5')]},'callerid':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':_0x4b60('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no'),'defaultValue':_0x4b60('0x17')},'busylevel':{'type':Sequelize[_0x4b60('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x4b60('0x5')]},'videosupport':{'type':Sequelize[_0x4b60('0x11')]('yes','no',_0x4b60('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no')},'mailbox':{'type':Sequelize[_0x4b60('0x5')]},'session_timers':{'type':Sequelize['ENUM'](_0x4b60('0x27'),'refuse',_0x4b60('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x4b60('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x29'),_0x4b60('0x2a')),'defaultValue':_0x4b60('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x4b60('0x5')]},'regexten':{'type':Sequelize[_0x4b60('0x5')]},'fromdomain':{'type':Sequelize[_0x4b60('0x5')]},'fromuser':{'type':Sequelize[_0x4b60('0x5')]},'port':{'type':Sequelize[_0x4b60('0x24')](0x5)},'qualify':{'type':Sequelize[_0x4b60('0x11')]('yes','no'),'defaultValue':_0x4b60('0x17')},'keepalive':{'type':Sequelize[_0x4b60('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x4b60('0x5')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4b60('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4b60('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no',_0x4b60('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4b60('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x4b60('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4b60('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x4b60('0x5')]},'contactdeny':{'type':Sequelize[_0x4b60('0x5')]},'contactacl':{'type':Sequelize[_0x4b60('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x4b60('0x5')]},'maxforwards':{'type':Sequelize[_0x4b60('0x24')](0xb)},'encryption':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x4b60('0x17'),'no')},'icesupport':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no',_0x4b60('0x2c'),_0x4b60('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x4b60('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x4b60('0x5')]},'dtlscipher':{'type':Sequelize[_0x4b60('0x5')]},'dtlscafile':{'type':Sequelize[_0x4b60('0x5')]},'dtlscapath':{'type':Sequelize[_0x4b60('0x5')]},'dtlssetup':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x2e'),_0x4b60('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4b60('0x5')]},'usereqphone':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4b60('0x5')]},'recordofffeature':{'type':Sequelize[_0x4b60('0x5')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no')},'vmexten':{'type':Sequelize[_0x4b60('0x5')]},'mohinterpret':{'type':Sequelize[_0x4b60('0x5')]},'mohsuggest':{'type':Sequelize[_0x4b60('0x5')]},'parkinglot':{'type':Sequelize[_0x4b60('0x5')]},'description':{'type':Sequelize[_0x4b60('0x5')]},'host':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':_0x4b60('0x30')},'canreinvite':{'type':Sequelize[_0x4b60('0x11')](_0x4b60('0x17'),'no',_0x4b60('0x18'),_0x4b60('0x19'),_0x4b60('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4b60('0x5')]},'otherFields':{'type':Sequelize[_0x4b60('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4b60('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x3dd7=['sequelize','exports','STRING','name','friend','user','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','accept','refuse','originate','uac','certificate','active','passive','actpass','update,nonat'];(function(_0x11d96c,_0x196ca4){var _0x1fc51b=function(_0xdc77fd){while(--_0xdc77fd){_0x11d96c['push'](_0x11d96c['shift']());}};_0x1fc51b(++_0x196ca4);}(_0x3dd7,0x138));var _0x73dd=function(_0x334cb7,_0xb2b507){_0x334cb7=_0x334cb7-0x0;var _0x476215=_0x3dd7[_0x334cb7];return _0x476215;};'use strict';var Sequelize=require(_0x73dd('0x0'));module[_0x73dd('0x1')]={'name':{'type':Sequelize[_0x73dd('0x2')],'allowNull':![],'unique':_0x73dd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x73dd('0x4'),_0x73dd('0x5'),_0x73dd('0x6')),'allowNull':![],'defaultValue':_0x73dd('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x8'),_0x73dd('0x9'),_0x73dd('0xa'),_0x73dd('0xb'),_0x73dd('0xc'),'PROHIB_PASSED_SCREEN',_0x73dd('0xd'),_0x73dd('0xe'))},'deny':{'type':Sequelize[_0x73dd('0x2')]},'permit':{'type':Sequelize[_0x73dd('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x73dd('0x2')]},'remotesecret':{'type':Sequelize[_0x73dd('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0xe3de6a){this[_0x73dd('0xf')](_0x73dd('0x10'),_0xe3de6a?_0xe3de6a[_0x73dd('0x11')](','):null);},'get':function(){return this[_0x73dd('0x12')]('transport')?this[_0x73dd('0x12')](_0x73dd('0x10'))['split'](','):null;},'comment':_0x73dd('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x73dd('0x14'),_0x73dd('0x15'),_0x73dd('0x16'),_0x73dd('0x17'),_0x73dd('0x18')),'defaultValue':_0x73dd('0x14')},'directmedia':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no',_0x73dd('0x1a'),_0x73dd('0x1b'),_0x73dd('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x73dd('0x2')]},'directmediadeny':{'type':Sequelize[_0x73dd('0x2')]},'nat':{'type':Sequelize[_0x73dd('0x2')],'defaultValue':_0x73dd('0x1d'),'set':function(_0x2e11c6){this[_0x73dd('0xf')](_0x73dd('0x1e'),_0x2e11c6?_0x2e11c6[_0x73dd('0x11')](','):null);},'get':function(){return this[_0x73dd('0x12')](_0x73dd('0x1e'))?this[_0x73dd('0x12')](_0x73dd('0x1e'))['split'](','):null;},'comment':_0x73dd('0x1f')},'callgroup':{'type':Sequelize[_0x73dd('0x2')]},'namedcallgroup':{'type':Sequelize[_0x73dd('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x73dd('0x2')]},'language':{'type':Sequelize[_0x73dd('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x73dd('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x73dd('0x2')],'defaultValue':_0x73dd('0x20')},'allow':{'type':Sequelize[_0x73dd('0x2')],'allowNull':![],'defaultValue':_0x73dd('0x21'),'set':function(_0x4a47d0){this[_0x73dd('0xf')]('allow',_0x4a47d0?_0x4a47d0['join'](';'):_0x73dd('0x21'));},'get':function(){return this[_0x73dd('0x12')]('allow')?this[_0x73dd('0x12')](_0x73dd('0x22'))[_0x73dd('0x23')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'insecure':{'type':Sequelize[_0x73dd('0x2')],'defaultValue':_0x73dd('0x24'),'set':function(_0x1c109b){this[_0x73dd('0xf')](_0x73dd('0x25'),_0x1c109b?_0x1c109b[_0x73dd('0x11')](','):null);},'get':function(){return this[_0x73dd('0x12')]('insecure')?this['getDataValue'](_0x73dd('0x25'))['split'](','):null;},'comment':_0x73dd('0x26')},'trustrpid':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no',_0x73dd('0x27'))},'promiscredir':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x73dd('0x7')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x73dd('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x73dd('0x28')},'amaflags':{'type':Sequelize[_0x73dd('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no'),'defaultValue':_0x73dd('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x73dd('0x2')]},'template':{'type':Sequelize[_0x73dd('0x2')]},'videosupport':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no',_0x73dd('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no')},'mailbox':{'type':Sequelize[_0x73dd('0x2')]},'session_timers':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x2b'),_0x73dd('0x2c'),_0x73dd('0x2d'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'session_refresher':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x2e'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x73dd('0x2')]},'regexten':{'type':Sequelize[_0x73dd('0x2')]},'fromdomain':{'type':Sequelize[_0x73dd('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x73dd('0x2a')](0x5)},'qualify':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no'),'defaultValue':_0x73dd('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x73dd('0x2')]},'rtptimeout':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'sendrpid':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x73dd('0x2')]},'callbackextension':{'type':Sequelize[_0x73dd('0x2')]},'timert1':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'timerb':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'qualifyfreq':{'type':Sequelize[_0x73dd('0x2a')](0xb)},'contactpermit':{'type':Sequelize[_0x73dd('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x73dd('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x73dd('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x73dd('0x7')]('yes','no')},'force_avp':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no','fingerprint',_0x73dd('0x2f'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x73dd('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x73dd('0x2')]},'dtlscipher':{'type':Sequelize[_0x73dd('0x2')]},'dtlscafile':{'type':Sequelize[_0x73dd('0x2')]},'dtlscapath':{'type':Sequelize[_0x73dd('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x73dd('0x30'),_0x73dd('0x31'),_0x73dd('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x73dd('0x2')]},'usereqphone':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x73dd('0x2')]},'recordofffeature':{'type':Sequelize[_0x73dd('0x2')]},'call_limit':{'type':Sequelize[_0x73dd('0x2a')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x73dd('0x7')](_0x73dd('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no')},'vmexten':{'type':Sequelize[_0x73dd('0x2')]},'mohinterpret':{'type':Sequelize[_0x73dd('0x2')]},'mohsuggest':{'type':Sequelize[_0x73dd('0x2')]},'parkinglot':{'type':Sequelize[_0x73dd('0x2')]},'description':{'type':Sequelize[_0x73dd('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x73dd('0x19'),'no','nonat',_0x73dd('0x1b'),_0x73dd('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x73dd('0x2')]},'otherFields':{'type':Sequelize[_0x73dd('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x73dd('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 1e21893..f8e1bbe 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 _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x612ce5,_0x3f9440){var _0x1558e8=function(_0x2cfe1a){while(--_0x2cfe1a){_0x612ce5['push'](_0x612ce5['shift']());}};_0x1558e8(++_0x3f9440);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file +var _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x37464d,_0x29bf11){var _0x4e7573=function(_0x4de5e3){while(--_0x4de5e3){_0x37464d['push'](_0x37464d['shift']());}};_0x4e7573(++_0x29bf11);}(_0x9bde,0xe1));var _0xe9bd=function(_0x14192b,_0x3c7fac){_0x14192b=_0x14192b-0x0;var _0x150128=_0x9bde[_0x14192b];return _0x150128;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4196094..1794aa2 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 _0x3989=['request-promise','path','rimraf','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment'];(function(_0x4beb08,_0x38a1e4){var _0x56a591=function(_0x26d077){while(--_0x26d077){_0x4beb08['push'](_0x4beb08['shift']());}};_0x56a591(++_0x38a1e4);}(_0x3989,0x128));var _0x9398=function(_0x3a1fb4,_0x51f164){_0x3a1fb4=_0x3a1fb4-0x0;var _0xcc9cf4=_0x3989[_0x3a1fb4];return _0xcc9cf4;};'use strict';var _=require(_0x9398('0x0'));var util=require(_0x9398('0x1'));var logger=require(_0x9398('0x2'))('api');var moment=require(_0x9398('0x3'));var BPromise=require('bluebird');var rp=require(_0x9398('0x4'));var fs=require('fs');var path=require(_0x9398('0x5'));var rimraf=require(_0x9398('0x6'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module['exports']=function(_0x5bc05d,_0x2f14bf){return _0x5bc05d[_0x9398('0x7')](_0x9398('0x8'),attributes,{'tableName':_0x9398('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf153=['tools_trunks','lodash','util','../../config/logger','path','rimraf','./trunk.attributes','exports','define','Trunk'];(function(_0x6322b1,_0x404ec4){var _0x3e5e34=function(_0x2e7928){while(--_0x2e7928){_0x6322b1['push'](_0x6322b1['shift']());}};_0x3e5e34(++_0x404ec4);}(_0xf153,0x1af));var _0x3f15=function(_0x395900,_0x3002ea){_0x395900=_0x395900-0x0;var _0x1f9ace=_0xf153[_0x395900];return _0x1f9ace;};'use strict';var _=require(_0x3f15('0x0'));var util=require(_0x3f15('0x1'));var logger=require(_0x3f15('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f15('0x3'));var rimraf=require(_0x3f15('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f15('0x5'));module[_0x3f15('0x6')]=function(_0x28fd54,_0x5b2f9b){return _0x28fd54[_0x3f15('0x7')](_0x3f15('0x8'),attributes,{'tableName':_0x3f15('0x9'),'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 845ba7e..86d19b5 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 _0x01f9=['where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','attributes','include','map','model','debug','ShowTrunk','find','raw'];(function(_0x50408a,_0x53aea4){var _0x1b4cf0=function(_0x13ec43){while(--_0x13ec43){_0x50408a['push'](_0x50408a['shift']());}};_0x1b4cf0(++_0x53aea4);}(_0x01f9,0x18d));var _0x901f=function(_0x3b4d7a,_0x16a846){_0x3b4d7a=_0x3b4d7a-0x0;var _0x23ad89=_0x01f9[_0x3b4d7a];return _0x23ad89;};'use strict';var _=require(_0x901f('0x0'));var util=require(_0x901f('0x1'));var moment=require('moment');var BPromise=require(_0x901f('0x2'));var rs=require(_0x901f('0x3'));var fs=require('fs');var Redis=require(_0x901f('0x4'));var db=require(_0x901f('0x5'))['db'];var utils=require(_0x901f('0x6'));var logger=require(_0x901f('0x7'))(_0x901f('0x8'));var config=require('../../config/environment');var jayson=require(_0x901f('0x9'));var client=jayson[_0x901f('0xa')][_0x901f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18eae5,_0x23b69c,_0xdf5431){return new BPromise(function(_0x4742ce,_0x16bf7a){return client[_0x901f('0xc')](_0x18eae5,_0xdf5431)[_0x901f('0xd')](function(_0x42d0b2){logger[_0x901f('0xe')](_0x901f('0xf'),_0x23b69c,_0x901f('0x10'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x23b69c,_0x901f('0x10'),JSON[_0x901f('0x11')](_0x42d0b2));if(_0x42d0b2[_0x901f('0x12')]){if(_0x42d0b2[_0x901f('0x12')][_0x901f('0x13')]===0x1f4){logger['error'](_0x901f('0xf'),_0x23b69c,_0x42d0b2[_0x901f('0x12')][_0x901f('0x14')]);return _0x16bf7a(_0x42d0b2[_0x901f('0x12')][_0x901f('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x23b69c,_0x42d0b2[_0x901f('0x12')][_0x901f('0x14')]);return _0x4742ce(_0x42d0b2[_0x901f('0x12')][_0x901f('0x14')]);}else{logger[_0x901f('0xe')](_0x901f('0xf'),_0x23b69c,_0x901f('0x10'));_0x4742ce(_0x42d0b2[_0x901f('0x15')][_0x901f('0x14')]);}})[_0x901f('0x16')](function(_0x448591){logger[_0x901f('0x12')](_0x901f('0xf'),_0x23b69c,_0x448591);_0x16bf7a(_0x448591);});});}exports[_0x901f('0x17')]=function(_0x3f936f){var _0x47df34=this;return new Promise(function(_0x289678,_0x24fcbd){return db[_0x901f('0x18')][_0x901f('0x19')]({'raw':_0x3f936f[_0x901f('0x1a')]?_0x3f936f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f936f[_0x901f('0x1a')]?_0x3f936f['options']['where']||null:null,'attributes':_0x3f936f[_0x901f('0x1a')]?_0x3f936f[_0x901f('0x1a')][_0x901f('0x1b')]||null:null,'limit':_0x3f936f['options']?_0x3f936f[_0x901f('0x1a')]['limit']||null:null,'include':_0x3f936f[_0x901f('0x1a')]?_0x3f936f[_0x901f('0x1a')][_0x901f('0x1c')]?_[_0x901f('0x1d')](_0x3f936f['options'][_0x901f('0x1c')],function(_0x4c3499){return{'model':db[_0x4c3499['model']],'as':_0x4c3499['as'],'attributes':_0x4c3499[_0x901f('0x1b')],'include':_0x4c3499['include']?_[_0x901f('0x1d')](_0x4c3499[_0x901f('0x1c')],function(_0x306637){return{'model':db[_0x306637[_0x901f('0x1e')]],'as':_0x306637['as'],'attributes':_0x306637[_0x901f('0x1b')],'include':_0x306637[_0x901f('0x1c')]?_['map'](_0x306637[_0x901f('0x1c')],function(_0x55fa13){return{'model':db[_0x55fa13[_0x901f('0x1e')]],'as':_0x55fa13['as'],'attributes':_0x55fa13['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11b4cb){logger[_0x901f('0xe')](_0x901f('0x17'),_0x3f936f);logger[_0x901f('0x1f')](_0x901f('0x17'),_0x3f936f,JSON['stringify'](_0x11b4cb));_0x289678(_0x11b4cb);})[_0x901f('0x16')](function(_0x367b93){logger['error']('GetTrunk',_0x367b93[_0x901f('0x14')],_0x3f936f);_0x24fcbd(_0x47df34[_0x901f('0x12')](0x1f4,_0x367b93[_0x901f('0x14')]));});});};exports[_0x901f('0x20')]=function(_0xaa5e44){var _0x201e71=this;return new Promise(function(_0x474c07,_0x45d304){return db[_0x901f('0x18')][_0x901f('0x21')]({'raw':_0xaa5e44[_0x901f('0x1a')]?_0xaa5e44[_0x901f('0x1a')][_0x901f('0x22')]===undefined?!![]:![]:!![],'where':_0xaa5e44[_0x901f('0x1a')]?_0xaa5e44[_0x901f('0x1a')][_0x901f('0x23')]||null:null,'attributes':_0xaa5e44[_0x901f('0x1a')]?_0xaa5e44['options'][_0x901f('0x1b')]||null:null,'include':_0xaa5e44[_0x901f('0x1a')]?_0xaa5e44[_0x901f('0x1a')][_0x901f('0x1c')]?_[_0x901f('0x1d')](_0xaa5e44[_0x901f('0x1a')]['include'],function(_0x8e1b1){return{'model':db[_0x8e1b1[_0x901f('0x1e')]],'as':_0x8e1b1['as'],'attributes':_0x8e1b1['attributes'],'include':_0x8e1b1['include']?_[_0x901f('0x1d')](_0x8e1b1['include'],function(_0x2bd4af){return{'model':db[_0x2bd4af['model']],'as':_0x2bd4af['as'],'attributes':_0x2bd4af['attributes'],'include':_0x2bd4af[_0x901f('0x1c')]?_[_0x901f('0x1d')](_0x2bd4af[_0x901f('0x1c')],function(_0x407e8c){return{'model':db[_0x407e8c[_0x901f('0x1e')]],'as':_0x407e8c['as'],'attributes':_0x407e8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x901f('0xd')](function(_0x56a38d){logger[_0x901f('0xe')](_0x901f('0x20'),_0xaa5e44);logger[_0x901f('0x1f')](_0x901f('0x20'),_0xaa5e44,JSON['stringify'](_0x56a38d));_0x474c07(_0x56a38d);})[_0x901f('0x16')](function(_0x416f10){logger['error'](_0x901f('0x20'),_0x416f10['message'],_0xaa5e44);_0x45d304(_0x201e71[_0x901f('0x12')](0x1f4,_0x416f10[_0x901f('0x14')]));});});}; \ No newline at end of file +var _0xa1a8=['request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','options','raw','attributes','map','include','model','catch','ShowTrunk','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa1a8,0x199));var _0x8a1a=function(_0x24edf0,_0x564f88){_0x24edf0=_0x24edf0-0x0;var _0x493f78=_0xa1a8[_0x24edf0];return _0x493f78;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a1a('0x0'));var BPromise=require(_0x8a1a('0x1'));var rs=require(_0x8a1a('0x2'));var fs=require('fs');var Redis=require(_0x8a1a('0x3'));var db=require(_0x8a1a('0x4'))['db'];var utils=require(_0x8a1a('0x5'));var logger=require(_0x8a1a('0x6'))(_0x8a1a('0x7'));var config=require(_0x8a1a('0x8'));var jayson=require(_0x8a1a('0x9'));var client=jayson[_0x8a1a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xec9d1,_0x387a01,_0x10560b){return new BPromise(function(_0x21306f,_0x4d9137){return client[_0x8a1a('0xb')](_0xec9d1,_0x10560b)[_0x8a1a('0xc')](function(_0x42d7cb){logger[_0x8a1a('0xd')](_0x8a1a('0xe'),_0x387a01,_0x8a1a('0xf'));logger[_0x8a1a('0x10')](_0x8a1a('0x11'),_0x387a01,_0x8a1a('0xf'),JSON[_0x8a1a('0x12')](_0x42d7cb));if(_0x42d7cb[_0x8a1a('0x13')]){if(_0x42d7cb[_0x8a1a('0x13')][_0x8a1a('0x14')]===0x1f4){logger[_0x8a1a('0x13')](_0x8a1a('0xe'),_0x387a01,_0x42d7cb['error'][_0x8a1a('0x15')]);return _0x4d9137(_0x42d7cb['error']['message']);}logger[_0x8a1a('0x13')](_0x8a1a('0xe'),_0x387a01,_0x42d7cb[_0x8a1a('0x13')][_0x8a1a('0x15')]);return _0x21306f(_0x42d7cb[_0x8a1a('0x13')]['message']);}else{logger[_0x8a1a('0xd')](_0x8a1a('0xe'),_0x387a01,_0x8a1a('0xf'));_0x21306f(_0x42d7cb[_0x8a1a('0x16')][_0x8a1a('0x15')]);}})['catch'](function(_0x51f257){logger[_0x8a1a('0x13')](_0x8a1a('0xe'),_0x387a01,_0x51f257);_0x4d9137(_0x51f257);});});}exports[_0x8a1a('0x17')]=function(_0x1594a4){var _0xa8e4e8=this;return new Promise(function(_0x3b5d2f,_0x5b95c0){return db[_0x8a1a('0x18')]['findAll']({'raw':_0x1594a4[_0x8a1a('0x19')]?_0x1594a4[_0x8a1a('0x19')][_0x8a1a('0x1a')]===undefined?!![]:![]:!![],'where':_0x1594a4[_0x8a1a('0x19')]?_0x1594a4[_0x8a1a('0x19')]['where']||null:null,'attributes':_0x1594a4['options']?_0x1594a4['options'][_0x8a1a('0x1b')]||null:null,'limit':_0x1594a4['options']?_0x1594a4[_0x8a1a('0x19')]['limit']||null:null,'include':_0x1594a4[_0x8a1a('0x19')]?_0x1594a4[_0x8a1a('0x19')]['include']?_[_0x8a1a('0x1c')](_0x1594a4[_0x8a1a('0x19')][_0x8a1a('0x1d')],function(_0x4166c9){return{'model':db[_0x4166c9[_0x8a1a('0x1e')]],'as':_0x4166c9['as'],'attributes':_0x4166c9[_0x8a1a('0x1b')],'include':_0x4166c9['include']?_[_0x8a1a('0x1c')](_0x4166c9[_0x8a1a('0x1d')],function(_0x4c4713){return{'model':db[_0x4c4713[_0x8a1a('0x1e')]],'as':_0x4c4713['as'],'attributes':_0x4c4713['attributes'],'include':_0x4c4713[_0x8a1a('0x1d')]?_[_0x8a1a('0x1c')](_0x4c4713[_0x8a1a('0x1d')],function(_0x252640){return{'model':db[_0x252640[_0x8a1a('0x1e')]],'as':_0x252640['as'],'attributes':_0x252640[_0x8a1a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x180929){logger[_0x8a1a('0xd')]('GetTrunk',_0x1594a4);logger[_0x8a1a('0x10')](_0x8a1a('0x17'),_0x1594a4,JSON[_0x8a1a('0x12')](_0x180929));_0x3b5d2f(_0x180929);})[_0x8a1a('0x1f')](function(_0x17d32d){logger[_0x8a1a('0x13')](_0x8a1a('0x17'),_0x17d32d['message'],_0x1594a4);_0x5b95c0(_0xa8e4e8[_0x8a1a('0x13')](0x1f4,_0x17d32d[_0x8a1a('0x15')]));});});};exports[_0x8a1a('0x20')]=function(_0x661d35){var _0x50e255=this;return new Promise(function(_0x19283e,_0x3fe135){return db['Trunk'][_0x8a1a('0x21')]({'raw':_0x661d35[_0x8a1a('0x19')]?_0x661d35[_0x8a1a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x661d35[_0x8a1a('0x19')]?_0x661d35['options'][_0x8a1a('0x22')]||null:null,'attributes':_0x661d35['options']?_0x661d35[_0x8a1a('0x19')][_0x8a1a('0x1b')]||null:null,'include':_0x661d35[_0x8a1a('0x19')]?_0x661d35['options'][_0x8a1a('0x1d')]?_[_0x8a1a('0x1c')](_0x661d35[_0x8a1a('0x19')]['include'],function(_0x2ad501){return{'model':db[_0x2ad501[_0x8a1a('0x1e')]],'as':_0x2ad501['as'],'attributes':_0x2ad501[_0x8a1a('0x1b')],'include':_0x2ad501[_0x8a1a('0x1d')]?_[_0x8a1a('0x1c')](_0x2ad501[_0x8a1a('0x1d')],function(_0xfee048){return{'model':db[_0xfee048['model']],'as':_0xfee048['as'],'attributes':_0xfee048[_0x8a1a('0x1b')],'include':_0xfee048[_0x8a1a('0x1d')]?_['map'](_0xfee048[_0x8a1a('0x1d')],function(_0x310c35){return{'model':db[_0x310c35[_0x8a1a('0x1e')]],'as':_0x310c35['as'],'attributes':_0x310c35[_0x8a1a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8a1a('0xc')](function(_0x5add4b){logger[_0x8a1a('0xd')]('ShowTrunk',_0x661d35);logger[_0x8a1a('0x10')](_0x8a1a('0x20'),_0x661d35,JSON[_0x8a1a('0x12')](_0x5add4b));_0x19283e(_0x5add4b);})[_0x8a1a('0x1f')](function(_0x410e5a){logger[_0x8a1a('0x13')](_0x8a1a('0x20'),_0x410e5a[_0x8a1a('0x15')],_0x661d35);_0x3fe135(_0x50e255[_0x8a1a('0x13')](0x1f4,_0x410e5a[_0x8a1a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 496b6e9..56d84d7 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 _0x44bb=['addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./user.controller','isAuthenticated','/describe','describe','get','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/mail_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0x44bb,0x83));var _0xb44b=function(_0x591921,_0x5100df){_0x591921=_0x591921-0x0;var _0x568bec=_0x44bb[_0x591921];return _0x568bec;};'use strict';var multer=require(_0xb44b('0x0'));var util=require(_0xb44b('0x1'));var path=require(_0xb44b('0x2'));var timeout=require(_0xb44b('0x3'));var express=require('express');var router=express[_0xb44b('0x4')]();var fs_extra=require(_0xb44b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb44b('0x6'));var config=require('../../config/environment');var controller=require(_0xb44b('0x7'));router['get']('/',auth[_0xb44b('0x8')](),controller['index']);router['get'](_0xb44b('0x9'),auth[_0xb44b('0x8')](),controller[_0xb44b('0xa')]);router[_0xb44b('0xb')]('/whoami',auth[_0xb44b('0x8')](),controller[_0xb44b('0xc')]);router[_0xb44b('0xb')](_0xb44b('0xd'),auth[_0xb44b('0x8')](),controller[_0xb44b('0xe')]);router[_0xb44b('0xb')](_0xb44b('0xf'),auth[_0xb44b('0x8')](),controller['show']);router['get'](_0xb44b('0x10'),controller[_0xb44b('0x11')]);router[_0xb44b('0xb')]('/:id/open_tabs',auth[_0xb44b('0x8')](),controller['getOpenTabs']);router[_0xb44b('0xb')](_0xb44b('0x12'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x13')]);router[_0xb44b('0xb')]('/:id/queues',auth[_0xb44b('0x8')](),controller[_0xb44b('0x14')]);router[_0xb44b('0xb')]('/:id/queues_rt',auth[_0xb44b('0x8')](),controller[_0xb44b('0x15')]);router[_0xb44b('0xb')](_0xb44b('0x16'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x17')]);router[_0xb44b('0xb')](_0xb44b('0x18'),auth['isAuthenticated'](),controller[_0xb44b('0x19')]);router[_0xb44b('0xb')]('/:id/screen_recordings',auth[_0xb44b('0x8')](),controller[_0xb44b('0x1a')]);router[_0xb44b('0xb')](_0xb44b('0x1b'),auth['isAuthenticated'](),controller[_0xb44b('0x1c')]);router[_0xb44b('0xb')]('/:id/openchannel/interactions',auth[_0xb44b('0x8')](),controller[_0xb44b('0x1d')]);router[_0xb44b('0xb')](_0xb44b('0x1e'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x1f')]);router[_0xb44b('0xb')]('/:id/sms/interactions',auth[_0xb44b('0x8')](),controller[_0xb44b('0x20')]);router[_0xb44b('0xb')](_0xb44b('0x21'),auth['isAuthenticated'](),controller[_0xb44b('0x22')]);router[_0xb44b('0xb')](_0xb44b('0x23'),auth[_0xb44b('0x8')](),controller['getWhatsappInteractions']);router['get'](_0xb44b('0x24'),auth[_0xb44b('0x8')](),controller['getTeams']);router[_0xb44b('0xb')](_0xb44b('0x25'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x26')]);router[_0xb44b('0xb')](_0xb44b('0x27'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x28')]);router['get']('/:id/prefixes',auth[_0xb44b('0x8')](),controller['getVoicePrefixes']);router[_0xb44b('0xb')](_0xb44b('0x29'),auth[_0xb44b('0x8')](),controller['getFaxAccounts']);router[_0xb44b('0xb')]('/:id/mail_accounts',auth[_0xb44b('0x8')](),controller['getMailAccounts']);router[_0xb44b('0xb')](_0xb44b('0x2a'),auth['isAuthenticated'](),controller[_0xb44b('0x2b')]);router[_0xb44b('0xb')]('/:id/sms_accounts',auth[_0xb44b('0x8')](),controller[_0xb44b('0x2c')]);router[_0xb44b('0xb')]('/:id/chat_websites',auth[_0xb44b('0x8')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0xb44b('0x8')](),controller[_0xb44b('0x2d')]);router[_0xb44b('0xb')](_0xb44b('0x2e'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x2f')]);router['get'](_0xb44b('0x30'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x31')]);router[_0xb44b('0xb')](_0xb44b('0x32'),auth['isAuthenticated'](),controller[_0xb44b('0x33')]);router[_0xb44b('0x34')](_0xb44b('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb44b('0x34')]('/',auth[_0xb44b('0x8')](),controller['create']);router['post'](_0xb44b('0x35'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x36')]);router[_0xb44b('0x34')](_0xb44b('0x37'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x38')]);var upload=multer({'storage':multer[_0xb44b('0x39')]({'destination':function(_0x15723f,_0x44c322,_0x1eab78){_0x1eab78(null,path['join'](config[_0xb44b('0x3a')],_0xb44b('0x3b')));},'filename':function(_0x5395d9,_0x48c3c0,_0x3d1770){_0x3d1770(null,util[_0xb44b('0x3c')](_0xb44b('0x3d'),Date[_0xb44b('0x3e')](),_0x48c3c0[_0xb44b('0x3f')]));}})});router[_0xb44b('0x34')](_0xb44b('0x10'),upload[_0xb44b('0x40')](_0xb44b('0x41')),controller[_0xb44b('0x42')]);router[_0xb44b('0x34')](_0xb44b('0x43'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x44')]);router['post']('/:id/logout',auth[_0xb44b('0x8')](),controller[_0xb44b('0x45')]);router[_0xb44b('0x34')](_0xb44b('0x46'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x47')]);router[_0xb44b('0x34')](_0xb44b('0x48'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x49')]);router['post'](_0xb44b('0x24'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x4a')]);router['post'](_0xb44b('0x4b'),auth['isAuthenticated'](),controller[_0xb44b('0x4c')]);router[_0xb44b('0x34')](_0xb44b('0x4d'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x4e')]);router['post']('/:id/fax_interactions',auth[_0xb44b('0x8')](),controller['addFaxInteractions']);router[_0xb44b('0x34')](_0xb44b('0x4f'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x50')]);router[_0xb44b('0x34')](_0xb44b('0x51'),auth['isAuthenticated'](),controller[_0xb44b('0x52')]);router[_0xb44b('0x34')](_0xb44b('0x53'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0xb44b('0x8')](),controller['addFaxAccounts']);router[_0xb44b('0x34')](_0xb44b('0x54'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xb44b('0x34')](_0xb44b('0x2a'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x55')]);router[_0xb44b('0x34')]('/:id/sms_accounts',auth[_0xb44b('0x8')](),controller[_0xb44b('0x56')]);router[_0xb44b('0x34')]('/:id/chat_websites',auth[_0xb44b('0x8')](),controller[_0xb44b('0x57')]);router['post']('/:id/whatsapp_accounts',auth[_0xb44b('0x8')](),controller[_0xb44b('0x58')]);router[_0xb44b('0x34')](_0xb44b('0x2e'),auth['isAuthenticated'](),controller[_0xb44b('0x59')]);router[_0xb44b('0x34')](_0xb44b('0x32'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x5a')]);router[_0xb44b('0x5b')](_0xb44b('0xf'),auth['isAuthenticated'](),controller[_0xb44b('0x5c')]);router[_0xb44b('0x5b')]('/:id/password',auth[_0xb44b('0x8')](),controller[_0xb44b('0x5d')]);router[_0xb44b('0x5e')]('/:id/queues',auth[_0xb44b('0x8')](),controller[_0xb44b('0x5f')]);router[_0xb44b('0x5e')](_0xb44b('0x24'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x60')]);router[_0xb44b('0x5e')](_0xb44b('0xf'),auth[_0xb44b('0x8')](),controller['destroy']);router['delete'](_0xb44b('0x4b'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x61')]);router['delete'](_0xb44b('0x4d'),auth[_0xb44b('0x8')](),controller['removeMailInteractions']);router[_0xb44b('0x5e')](_0xb44b('0x62'),auth['isAuthenticated'](),controller[_0xb44b('0x63')]);router[_0xb44b('0x5e')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xb44b('0x64')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete'](_0xb44b('0x53'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x65')]);router[_0xb44b('0x5e')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router['delete']('/:id/mail_accounts',auth[_0xb44b('0x8')](),controller[_0xb44b('0x66')]);router['delete'](_0xb44b('0x2a'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x67')]);router[_0xb44b('0x5e')](_0xb44b('0x68'),auth[_0xb44b('0x8')](),controller['removeSmsAccounts']);router[_0xb44b('0x5e')](_0xb44b('0x69'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xb44b('0x5e')](_0xb44b('0x6a'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x6b')]);router[_0xb44b('0x5e')](_0xb44b('0x2e'),auth[_0xb44b('0x8')](),controller[_0xb44b('0x6c')]);router[_0xb44b('0x5e')](_0xb44b('0x32'),auth[_0xb44b('0x8')](),controller['removeApiKey']);module[_0xb44b('0x6d')]=router; \ No newline at end of file +var _0x5908=['getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','update','put','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./user.controller','get','isAuthenticated','/describe','describe','whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts'];(function(_0x45b4f4,_0x236796){var _0x1f4050=function(_0x525727){while(--_0x525727){_0x45b4f4['push'](_0x45b4f4['shift']());}};_0x1f4050(++_0x236796);}(_0x5908,0x12d));var _0x8590=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x5908[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8590('0x0'));var express=require(_0x8590('0x1'));var router=express[_0x8590('0x2')]();var fs_extra=require(_0x8590('0x3'));var auth=require(_0x8590('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8590('0x5'));router[_0x8590('0x6')]('/',auth[_0x8590('0x7')](),controller['index']);router[_0x8590('0x6')](_0x8590('0x8'),auth['isAuthenticated'](),controller[_0x8590('0x9')]);router[_0x8590('0x6')]('/whoami',auth[_0x8590('0x7')](),controller[_0x8590('0xa')]);router[_0x8590('0x6')](_0x8590('0xb'),auth['isAuthenticated'](),controller['getPresence']);router[_0x8590('0x6')](_0x8590('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8590('0xd'),controller[_0x8590('0xe')]);router['get'](_0x8590('0xf'),auth[_0x8590('0x7')](),controller[_0x8590('0x10')]);router['get'](_0x8590('0x11'),auth[_0x8590('0x7')](),controller[_0x8590('0x12')]);router['get'](_0x8590('0x13'),auth[_0x8590('0x7')](),controller['getQueues']);router[_0x8590('0x6')](_0x8590('0x14'),auth[_0x8590('0x7')](),controller[_0x8590('0x15')]);router[_0x8590('0x6')](_0x8590('0x16'),auth['isAuthenticated'](),controller[_0x8590('0x17')]);router[_0x8590('0x6')](_0x8590('0x18'),auth[_0x8590('0x7')](),controller[_0x8590('0x19')]);router['get'](_0x8590('0x1a'),auth[_0x8590('0x7')](),controller[_0x8590('0x1b')]);router[_0x8590('0x6')]('/:id/chat/interactions',auth[_0x8590('0x7')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0x8590('0x7')](),controller[_0x8590('0x1c')]);router['get'](_0x8590('0x1d'),auth[_0x8590('0x7')](),controller[_0x8590('0x1e')]);router[_0x8590('0x6')](_0x8590('0x1f'),auth['isAuthenticated'](),controller[_0x8590('0x20')]);router[_0x8590('0x6')](_0x8590('0x21'),auth[_0x8590('0x7')](),controller[_0x8590('0x22')]);router[_0x8590('0x6')](_0x8590('0x23'),auth[_0x8590('0x7')](),controller[_0x8590('0x24')]);router['get']('/:id/teams',auth[_0x8590('0x7')](),controller[_0x8590('0x25')]);router[_0x8590('0x6')](_0x8590('0x26'),auth['isAuthenticated'](),controller[_0x8590('0x27')]);router[_0x8590('0x6')](_0x8590('0x28'),auth[_0x8590('0x7')](),controller[_0x8590('0x29')]);router[_0x8590('0x6')](_0x8590('0x2a'),auth[_0x8590('0x7')](),controller[_0x8590('0x2b')]);router[_0x8590('0x6')](_0x8590('0x2c'),auth[_0x8590('0x7')](),controller['getFaxAccounts']);router[_0x8590('0x6')](_0x8590('0x2d'),auth[_0x8590('0x7')](),controller[_0x8590('0x2e')]);router['get'](_0x8590('0x2f'),auth[_0x8590('0x7')](),controller[_0x8590('0x30')]);router[_0x8590('0x6')](_0x8590('0x31'),auth['isAuthenticated'](),controller[_0x8590('0x32')]);router[_0x8590('0x6')](_0x8590('0x33'),auth[_0x8590('0x7')](),controller[_0x8590('0x34')]);router[_0x8590('0x6')](_0x8590('0x35'),auth[_0x8590('0x7')](),controller['getWhatsappAccounts']);router[_0x8590('0x6')](_0x8590('0x36'),auth['isAuthenticated'](),controller[_0x8590('0x37')]);router[_0x8590('0x6')](_0x8590('0x38'),auth[_0x8590('0x7')](),controller[_0x8590('0x39')]);router[_0x8590('0x6')](_0x8590('0x3a'),auth['isAuthenticated'](),controller['getApiKey']);router['post']('/:id/contacts',auth[_0x8590('0x7')](),controller[_0x8590('0x3b')]);router[_0x8590('0x3c')]('/',auth[_0x8590('0x7')](),controller[_0x8590('0x3d')]);router[_0x8590('0x3c')](_0x8590('0x3e'),auth[_0x8590('0x7')](),controller[_0x8590('0x3f')]);router[_0x8590('0x3c')](_0x8590('0x13'),auth['isAuthenticated'](),controller[_0x8590('0x40')]);var upload=multer({'storage':multer[_0x8590('0x41')]({'destination':function(_0xf8bb65,_0x1d3afc,_0x1d7246){_0x1d7246(null,path[_0x8590('0x42')](config[_0x8590('0x43')],_0x8590('0x44')));},'filename':function(_0x1280a2,_0x5d0460,_0x5a2b36){_0x5a2b36(null,util[_0x8590('0x45')](_0x8590('0x46'),Date[_0x8590('0x47')](),_0x5d0460['originalname']));}})});router[_0x8590('0x3c')](_0x8590('0xd'),upload[_0x8590('0x48')](_0x8590('0x49')),controller[_0x8590('0x4a')]);router[_0x8590('0x3c')](_0x8590('0x4b'),auth[_0x8590('0x7')](),controller[_0x8590('0x4c')]);router[_0x8590('0x3c')](_0x8590('0x4d'),auth['isAuthenticated'](),controller[_0x8590('0x4e')]);router[_0x8590('0x3c')](_0x8590('0x4f'),auth['isAuthenticated'](),controller[_0x8590('0x50')]);router[_0x8590('0x3c')]('/:id/unpause',auth[_0x8590('0x7')](),controller[_0x8590('0x51')]);router['post']('/:id/teams',auth[_0x8590('0x7')](),controller['addTeams']);router['post'](_0x8590('0x52'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x8590('0x3c')](_0x8590('0x53'),auth[_0x8590('0x7')](),controller[_0x8590('0x54')]);router['post'](_0x8590('0x55'),auth[_0x8590('0x7')](),controller['addFaxInteractions']);router[_0x8590('0x3c')](_0x8590('0x56'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x8590('0x3c')]('/:id/openchannel_interactions',auth[_0x8590('0x7')](),controller['addOpenchannelInteractions']);router[_0x8590('0x3c')]('/:id/whatsapp_interactions',auth[_0x8590('0x7')](),controller['addWhatsappInteractions']);router[_0x8590('0x3c')](_0x8590('0x2c'),auth[_0x8590('0x7')](),controller[_0x8590('0x57')]);router[_0x8590('0x3c')](_0x8590('0x2d'),auth[_0x8590('0x7')](),controller[_0x8590('0x58')]);router['post']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x8590('0x59')]);router['post'](_0x8590('0x31'),auth[_0x8590('0x7')](),controller['addSmsAccounts']);router[_0x8590('0x3c')](_0x8590('0x33'),auth[_0x8590('0x7')](),controller[_0x8590('0x5a')]);router[_0x8590('0x3c')](_0x8590('0x35'),auth[_0x8590('0x7')](),controller[_0x8590('0x5b')]);router['post'](_0x8590('0x36'),auth[_0x8590('0x7')](),controller[_0x8590('0x5c')]);router['post'](_0x8590('0x3a'),auth[_0x8590('0x7')](),controller['createApiKey']);router['put'](_0x8590('0xc'),auth[_0x8590('0x7')](),controller[_0x8590('0x5d')]);router[_0x8590('0x5e')](_0x8590('0x5f'),auth[_0x8590('0x7')](),controller[_0x8590('0x60')]);router[_0x8590('0x61')](_0x8590('0x13'),auth['isAuthenticated'](),controller[_0x8590('0x62')]);router[_0x8590('0x61')](_0x8590('0x63'),auth[_0x8590('0x7')](),controller[_0x8590('0x64')]);router['delete'](_0x8590('0xc'),auth[_0x8590('0x7')](),controller[_0x8590('0x65')]);router[_0x8590('0x61')]('/:id/chat_interactions',auth[_0x8590('0x7')](),controller[_0x8590('0x66')]);router[_0x8590('0x61')](_0x8590('0x53'),auth[_0x8590('0x7')](),controller[_0x8590('0x67')]);router['delete'](_0x8590('0x55'),auth['isAuthenticated'](),controller[_0x8590('0x68')]);router['delete'](_0x8590('0x56'),auth['isAuthenticated'](),controller[_0x8590('0x69')]);router[_0x8590('0x61')](_0x8590('0x6a'),auth[_0x8590('0x7')](),controller[_0x8590('0x6b')]);router[_0x8590('0x61')](_0x8590('0x6c'),auth[_0x8590('0x7')](),controller[_0x8590('0x6d')]);router[_0x8590('0x61')](_0x8590('0x2c'),auth[_0x8590('0x7')](),controller[_0x8590('0x6e')]);router[_0x8590('0x61')](_0x8590('0x2d'),auth['isAuthenticated'](),controller[_0x8590('0x6f')]);router[_0x8590('0x61')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x8590('0x70')]);router[_0x8590('0x61')]('/:id/sms_accounts',auth[_0x8590('0x7')](),controller['removeSmsAccounts']);router[_0x8590('0x61')](_0x8590('0x33'),auth['isAuthenticated'](),controller[_0x8590('0x71')]);router[_0x8590('0x61')]('/:id/whatsapp_accounts',auth[_0x8590('0x7')](),controller[_0x8590('0x72')]);router['delete']('/:id/square_projects',auth[_0x8590('0x7')](),controller['removeSquareProjects']);router[_0x8590('0x61')](_0x8590('0x3a'),auth[_0x8590('0x7')](),controller[_0x8590('0x73')]);module[_0x8590('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9c80c68..f33d8be 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 _0xff16=['never','accept','refuse','uac','uas','fingerprint','certificate','passive','actpass','nonat','update,nonat','showWebBar','get','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','dtlscertfile','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','local','INTEGER','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','update','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x53b843,_0x5d0cec){var _0x43b2f1=function(_0x216508){while(--_0x216508){_0x53b843['push'](_0x53b843['shift']());}};_0x43b2f1(++_0x5d0cec);}(_0xff16,0x7f));var _0x6ff1=function(_0x3f092f,_0x4042f4){_0x3f092f=_0x3f092f-0x0;var _0x1b3a00=_0xff16[_0x3f092f];return _0x1b3a00;};'use strict';var Sequelize=require(_0x6ff1('0x0'));var moment=require(_0x6ff1('0x1'));var util=require('util');var _=require(_0x6ff1('0x2'));module[_0x6ff1('0x3')]={'name':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':![],'unique':_0x6ff1('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3f3c60){this[_0x6ff1('0x6')](_0x6ff1('0x5'),_0x3f3c60);this[_0x6ff1('0x6')]('defaultuser',_0x3f3c60);},'comment':_0x6ff1('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x133524){this[_0x6ff1('0x6')](_0x6ff1('0x8'),_0x133524);this[_0x6ff1('0x6')](_0x6ff1('0x9'),util[_0x6ff1('0xa')](_0x6ff1('0xb'),_0x133524,this[_0x6ff1('0xc')]('internal')));}},'alias':{'type':Sequelize[_0x6ff1('0x4')]},'email':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':![],'unique':_0x6ff1('0xd'),'validate':{'isEmail':!![]},'set':function(_0x425a21){if(_0x425a21){this[_0x6ff1('0x6')](_0x6ff1('0xd'),_0x425a21[_0x6ff1('0xe')]());}}},'role':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x10'),_0x6ff1('0x11'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x6ff1('0x12')},'internal':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':![],'unique':_0x6ff1('0x14'),'set':function(_0x543e07){this['setDataValue']('internal',_0x543e07);this[_0x6ff1('0x6')](_0x6ff1('0x15'),_0x543e07);this[_0x6ff1('0x6')](_0x6ff1('0x9'),util[_0x6ff1('0xa')](_0x6ff1('0xb'),this['getDataValue'](_0x6ff1('0x8')),_0x543e07));}},'salt':{'type':Sequelize[_0x6ff1('0x4')]},'phone':{'type':Sequelize[_0x6ff1('0x4')]},'mobile':{'type':Sequelize[_0x6ff1('0x4')]},'address':{'type':Sequelize[_0x6ff1('0x4')]},'zipcode':{'type':Sequelize[_0x6ff1('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6ff1('0x4')]},'country':{'type':Sequelize[_0x6ff1('0x4')]},'online':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6ff1('0x17')]},'voicePause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6ff1('0x4')],'defaultValue':_0x6ff1('0x18')},'lastPauseAt':{'type':Sequelize[_0x6ff1('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x6ff1('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6ff1('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6ff1('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6ff1('0xf')]('friend',_0x6ff1('0x11'),_0x6ff1('0x19')),'allowNull':!![],'defaultValue':_0x6ff1('0x1a')},'context':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x1b'),_0x6ff1('0x1c'),_0x6ff1('0x1d'),_0x6ff1('0x1e'),'PROHIB_NOT_SCREENED',_0x6ff1('0x1f'),_0x6ff1('0x20'),_0x6ff1('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![],'defaultValue':_0x6ff1('0x22'),'set':function(_0x1a7906){this[_0x6ff1('0x6')](_0x6ff1('0x23'),_0x1a7906?_0x1a7906['join'](','):null);},'get':function(){return this['getDataValue'](_0x6ff1('0x23'))?this[_0x6ff1('0xc')](_0x6ff1('0x23'))[_0x6ff1('0x24')](','):null;},'comment':_0x6ff1('0x25')},'dtmfmode':{'type':Sequelize[_0x6ff1('0xf')]('rfc2833',_0x6ff1('0x26'),_0x6ff1('0x27'),_0x6ff1('0x28'),'auto'),'allowNull':!![],'defaultValue':_0x6ff1('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no','nonat',_0x6ff1('0x2b'),_0x6ff1('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![],'defaultValue':_0x6ff1('0x2d'),'set':function(_0x168746){this[_0x6ff1('0x6')]('nat',_0x168746?_0x168746[_0x6ff1('0x2e')](','):null);},'get':function(){return this['getDataValue'](_0x6ff1('0x2f'))?this['getDataValue']('nat')[_0x6ff1('0x24')](','):null;},'comment':_0x6ff1('0x30')},'callgroup':{'type':Sequelize[_0x6ff1('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6ff1('0x4')]},'pickupgroup':{'type':Sequelize[_0x6ff1('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x6ff1('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6ff1('0x4')]},'disallow':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ff1('0x31'),'set':function(_0x4c41b9){this[_0x6ff1('0x6')](_0x6ff1('0x32'),_0x4c41b9?_0x4c41b9[_0x6ff1('0x2e')](';'):_0x6ff1('0x31'));},'get':function(){return this[_0x6ff1('0xc')](_0x6ff1('0x32'))?this['getDataValue'](_0x6ff1('0x32'))[_0x6ff1('0x24')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![],'set':function(_0x6bc8bb){this[_0x6ff1('0x6')](_0x6ff1('0x33'),_0x6bc8bb?_0x6bc8bb[_0x6ff1('0x2e')](','):null);},'get':function(){return this[_0x6ff1('0xc')](_0x6ff1('0x33'))?this['getDataValue'](_0x6ff1('0x33'))[_0x6ff1('0x24')](','):null;},'comment':_0x6ff1('0x34')},'trustrpid':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no',_0x6ff1('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x6ff1('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x36'),_0x6ff1('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x38'),_0x6ff1('0x39')),'allowNull':!![],'defaultValue':_0x6ff1('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x6ff1('0x2a')},'keepalive':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6ff1('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6ff1('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6ff1('0xf')]('yes','no',_0x6ff1('0x3a'),_0x6ff1('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6ff1('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6ff1('0xf')]('active',_0x6ff1('0x3c'),_0x6ff1('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6ff1('0xf')](_0x6ff1('0x2a'),'no',_0x6ff1('0x3e'),_0x6ff1('0x2b'),_0x6ff1('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6ff1('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x6ff1('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x0,'set':function(_0x316344){this['setDataValue'](_0x6ff1('0x40'),_0x316344);var _0x4ac7b2=this[_0x6ff1('0x41')]({'plain':!![]});switch(_0x316344){case 0x0:case 0x1:var _0x37d452=_0x4ac7b2[_0x6ff1('0x23')]?_['isArray'](_0x4ac7b2[_0x6ff1('0x23')])?_0x4ac7b2[_0x6ff1('0x23')][_0x6ff1('0x2e')]():_0x4ac7b2[_0x6ff1('0x23')]:_0x6ff1('0x22');if(_0x37d452===_0x6ff1('0x42')){_0x37d452=_0x6ff1('0x22');}this[_0x6ff1('0x6')]('transport',_0x37d452);this[_0x6ff1('0x6')](_0x6ff1('0x43'),'no');this[_0x6ff1('0x6')](_0x6ff1('0x44'),null);this[_0x6ff1('0x6')](_0x6ff1('0x45'),null);this[_0x6ff1('0x6')](_0x6ff1('0x46'),null);this[_0x6ff1('0x6')](_0x6ff1('0x47'),null);this['setDataValue'](_0x6ff1('0x48'),null);this['setDataValue'](_0x6ff1('0x49'),null);this[_0x6ff1('0x6')]('dtlscertfile',null);this['setDataValue'](_0x6ff1('0x4a'),null);this[_0x6ff1('0x6')](_0x6ff1('0x4b'),'no');break;case 0x2:this[_0x6ff1('0x6')](_0x6ff1('0x23'),_0x6ff1('0x42'));this[_0x6ff1('0x6')](_0x6ff1('0x43'),_0x6ff1('0x2a'));this[_0x6ff1('0x6')](_0x6ff1('0x44'),_0x6ff1('0x2a'));this['setDataValue'](_0x6ff1('0x45'),_0x6ff1('0x2a'));this['setDataValue']('icesupport',_0x6ff1('0x2a'));this['setDataValue'](_0x6ff1('0x47'),_0x6ff1('0x2a'));this[_0x6ff1('0x6')](_0x6ff1('0x48'),'no');this[_0x6ff1('0x6')]('dtlssetup',_0x6ff1('0x3d'));this[_0x6ff1('0x6')](_0x6ff1('0x4c'),_0x4ac7b2['dtlscertfile']||_0x6ff1('0x4d'));this['setDataValue'](_0x6ff1('0x4a'),_0x4ac7b2[_0x6ff1('0x4a')]||'/etc/pki/tls/private/motion.key');this[_0x6ff1('0x6')](_0x6ff1('0x4b'),_0x6ff1('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x37b27c){this[_0x6ff1('0x6')](_0x6ff1('0x4e'),_0x37b27c?_0x37b27c[_0x6ff1('0x2e')](','):[]);},'get':function(){return this[_0x6ff1('0xc')]('permissions')?_[_0x6ff1('0x4f')](this[_0x6ff1('0xc')](_0x6ff1('0x4e'))['split'](','),function(_0x4190fe){return parseInt(_0x4190fe,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6ff1('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6ff1('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6ff1('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6ff1('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6ff1('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6ff1('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6ff1('0x50')],'get':function(){return this[_0x6ff1('0xc')](_0x6ff1('0x51'))?this[_0x6ff1('0xc')](_0x6ff1('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6ff1('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6ff1('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![],'set':function(_0xb109aa){if(typeof _0xb109aa===_0x6ff1('0x52')){var _0x4eca12=_0xb109aa==='1'?!![]:_0xb109aa==='0'?![]:_0xb109aa===_0x6ff1('0x53')?!![]:_0xb109aa===_0x6ff1('0x54')?![]:![];this['setDataValue'](_0x6ff1('0x55'),_0x4eca12);}else{this[_0x6ff1('0x6')](_0x6ff1('0x55'),_0xb109aa);}}},'blocked':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![],'set':function(_0x147e28){this[_0x6ff1('0x6')](_0x6ff1('0x56'),_0x147e28);if(_0x147e28===!![]){this[_0x6ff1('0x6')](_0x6ff1('0x57'),moment());this[_0x6ff1('0x6')](_0x6ff1('0x58'),0x0);}else{this[_0x6ff1('0x6')](_0x6ff1('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x6ff1('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6ff1('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6ff1('0x13')](0x5)[_0x6ff1('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6ff1('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xadec=['ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uas','fingerprint','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','force_avp','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','setDataValue','name','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','local','accountcode','callerid','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN'];(function(_0x4b541e,_0x3f95cf){var _0x82d27b=function(_0x591452){while(--_0x591452){_0x4b541e['push'](_0x4b541e['shift']());}};_0x82d27b(++_0x3f95cf);}(_0xadec,0x156));var _0xcade=function(_0x2124a1,_0x19562c){_0x2124a1=_0x2124a1-0x0;var _0xb8646b=_0xadec[_0x2124a1];return _0xb8646b;};'use strict';var Sequelize=require(_0xcade('0x0'));var moment=require(_0xcade('0x1'));var util=require(_0xcade('0x2'));var _=require(_0xcade('0x3'));module[_0xcade('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x570d9c){this[_0xcade('0x5')](_0xcade('0x6'),_0x570d9c);this[_0xcade('0x5')]('defaultuser',_0x570d9c);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x51d665){this[_0xcade('0x5')]('fullname',_0x51d665);this[_0xcade('0x5')]('callerid',util['format'](_0xcade('0x7'),_0x51d665,this[_0xcade('0x8')](_0xcade('0x9'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xcade('0xa')],'allowNull':![],'unique':_0xcade('0xb'),'validate':{'isEmail':!![]},'set':function(_0x1339b6){if(_0x1339b6){this[_0xcade('0x5')](_0xcade('0xb'),_0x1339b6[_0xcade('0xc')]());}}},'role':{'type':Sequelize[_0xcade('0xd')](_0xcade('0xe'),_0xcade('0xf'),_0xcade('0x10'),_0xcade('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xcade('0xa')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xcade('0xa')],'defaultValue':_0xcade('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xcade('0x9'),'set':function(_0x33d794){this[_0xcade('0x5')]('internal',_0x33d794);this[_0xcade('0x5')](_0xcade('0x13'),_0x33d794);this['setDataValue'](_0xcade('0x14'),util[_0xcade('0x15')](_0xcade('0x7'),this['getDataValue'](_0xcade('0x16')),_0x33d794));}},'salt':{'type':Sequelize[_0xcade('0xa')]},'phone':{'type':Sequelize[_0xcade('0xa')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xcade('0xa')]},'zipcode':{'type':Sequelize[_0xcade('0xa')]},'userpic':{'type':Sequelize[_0xcade('0xa')]},'city':{'type':Sequelize[_0xcade('0xa')]},'country':{'type':Sequelize[_0xcade('0xa')]},'online':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xcade('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xcade('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcade('0x1a')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xcade('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![],'defaultValue':_0xcade('0x1b')},'ipaddr':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'port':{'type':Sequelize[_0xcade('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x1c'),_0xcade('0xf'),_0xcade('0x1d')),'allowNull':!![],'defaultValue':_0xcade('0x1c')},'context':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![],'defaultValue':_0xcade('0x1e')},'callingpres':{'type':Sequelize['ENUM'](_0xcade('0x1f'),_0xcade('0x20'),_0xcade('0x21'),_0xcade('0x22'),'PROHIB_NOT_SCREENED',_0xcade('0x23'),_0xcade('0x24'),_0xcade('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'permit':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'secret':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'transport':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![],'defaultValue':_0xcade('0x26'),'set':function(_0x31429b){this['setDataValue'](_0xcade('0x27'),_0x31429b?_0x31429b[_0xcade('0x28')](','):null);},'get':function(){return this[_0xcade('0x8')](_0xcade('0x27'))?this[_0xcade('0x8')](_0xcade('0x27'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xcade('0xd')]('rfc2833',_0xcade('0x29'),_0xcade('0x2a'),_0xcade('0x2b'),_0xcade('0x2c')),'allowNull':!![],'defaultValue':_0xcade('0x2d')},'directmedia':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no',_0xcade('0x2f'),_0xcade('0x30'),_0xcade('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcade('0x32'),'set':function(_0x56dedb){this[_0xcade('0x5')]('nat',_0x56dedb?_0x56dedb['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0xcade('0x33'))['split'](','):null;},'comment':_0xcade('0x34')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xcade('0xa')]},'pickupgroup':{'type':Sequelize[_0xcade('0xa')]},'namedpickupgroup':{'type':Sequelize[_0xcade('0xa')]},'language':{'type':Sequelize[_0xcade('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcade('0xa')]},'disallow':{'type':Sequelize[_0xcade('0xa')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xcade('0xa')],'allowNull':![],'defaultValue':_0xcade('0x35'),'set':function(_0x1ced10){this['setDataValue'](_0xcade('0x36'),_0x1ced10?_0x1ced10[_0xcade('0x28')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xcade('0x8')](_0xcade('0x36'))?this['getDataValue'](_0xcade('0x36'))[_0xcade('0x37')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0xcfd42){this[_0xcade('0x5')](_0xcade('0x38'),_0xcfd42?_0xcfd42[_0xcade('0x28')](','):null);},'get':function(){return this[_0xcade('0x8')](_0xcade('0x38'))?this[_0xcade('0x8')](_0xcade('0x38'))[_0xcade('0x37')](','):null;},'comment':_0xcade('0x39')},'trustrpid':{'type':Sequelize[_0xcade('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcade('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no',_0xcade('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xcade('0x2e')},'busylevel':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcade('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xcade('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'template':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcade('0xd')]('yes','no',_0xcade('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x3c'),'refuse',_0xcade('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xcade('0xd')]('uac',_0xcade('0x3e')),'allowNull':!![],'defaultValue':_0xcade('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xcade('0x2e')},'keepalive':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xcade('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no',_0xcade('0x3f'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xcade('0x40'),_0xcade('0x41'),_0xcade('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xcade('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xcade('0x2e'),'no',_0xcade('0x2f'),_0xcade('0x30'),_0xcade('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xcade('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcade('0x44')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x364528){this['setDataValue'](_0xcade('0x45'),_0x364528);var _0x2454a6=this[_0xcade('0x46')]({'plain':!![]});switch(_0x364528){case 0x0:case 0x1:var _0x6dc026=_0x2454a6[_0xcade('0x27')]?_[_0xcade('0x47')](_0x2454a6[_0xcade('0x27')])?_0x2454a6[_0xcade('0x27')][_0xcade('0x28')]():_0x2454a6[_0xcade('0x27')]:_0xcade('0x26');if(_0x6dc026===_0xcade('0x48')){_0x6dc026=_0xcade('0x26');}this[_0xcade('0x5')](_0xcade('0x27'),_0x6dc026);this['setDataValue']('encryption','no');this['setDataValue'](_0xcade('0x49'),null);this['setDataValue']('force_avp',null);this[_0xcade('0x5')](_0xcade('0x4a'),null);this[_0xcade('0x5')](_0xcade('0x4b'),null);this[_0xcade('0x5')](_0xcade('0x4c'),null);this[_0xcade('0x5')](_0xcade('0x4d'),null);this[_0xcade('0x5')](_0xcade('0x4e'),null);this['setDataValue'](_0xcade('0x4f'),null);this[_0xcade('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xcade('0x27'),_0xcade('0x48'));this[_0xcade('0x5')]('encryption',_0xcade('0x2e'));this[_0xcade('0x5')](_0xcade('0x49'),_0xcade('0x2e'));this['setDataValue'](_0xcade('0x50'),_0xcade('0x2e'));this[_0xcade('0x5')]('icesupport',_0xcade('0x2e'));this[_0xcade('0x5')]('dtlsenable',_0xcade('0x2e'));this['setDataValue'](_0xcade('0x4c'),'no');this[_0xcade('0x5')](_0xcade('0x4d'),'actpass');this[_0xcade('0x5')](_0xcade('0x4e'),_0x2454a6[_0xcade('0x4e')]||_0xcade('0x51'));this[_0xcade('0x5')](_0xcade('0x4f'),_0x2454a6[_0xcade('0x4f')]||_0xcade('0x52'));this[_0xcade('0x5')](_0xcade('0x53'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xcade('0x44')],'set':function(_0x49ac15){this[_0xcade('0x5')](_0xcade('0x54'),_0x49ac15?_0x49ac15[_0xcade('0x28')](','):[]);},'get':function(){return this[_0xcade('0x8')](_0xcade('0x54'))?_[_0xcade('0x55')](this[_0xcade('0x8')]('permissions')[_0xcade('0x37')](','),function(_0x490081){return parseInt(_0x490081,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcade('0xa')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xcade('0xa')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcade('0xd')](_0xcade('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcade('0xa')]},'phoneBarEnableJaws':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xcade('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0xcade('0x8')](_0xcade('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xcade('0xa')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcade('0xa')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![],'set':function(_0x44ff6b){if(typeof _0x44ff6b===_0xcade('0x57')){var _0x22e9e9=_0x44ff6b==='1'?!![]:_0x44ff6b==='0'?![]:_0x44ff6b===_0xcade('0x58')?!![]:_0x44ff6b===_0xcade('0x59')?![]:![];this['setDataValue'](_0xcade('0x5a'),_0x22e9e9);}else{this[_0xcade('0x5')](_0xcade('0x5a'),_0x44ff6b);}}},'blocked':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![],'set':function(_0x51970e){this[_0xcade('0x5')]('blocked',_0x51970e);if(_0x51970e===!![]){this[_0xcade('0x5')](_0xcade('0x5b'),moment());this[_0xcade('0x5')](_0xcade('0x5c'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xcade('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcade('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcade('0x1a')](0x5)[_0xcade('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcade('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xcade('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b7db99d..f73b53e 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 _0x2542=['Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','sendStatus','send','index','rawAttributes','fieldName','key','password','salt','User','query','includeAll','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','keys','filters','intersection','fields','options','body','describe','addContacts','ids','internal','max','isNil','min_internal','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)','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','113','106','108','109','111','114','115','create','agent','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','UserProfileSection','userProfileId','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','each','findAll','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','emit','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','QueueId','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','findOne','CmContact','order','sort','where','pick','merge','hasOwnProperty','include','List','Tag','Tags','color','tag','nolimit','getContacts','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','LOGIN','PAUSE','YYYY-MM-DD\x20HH:mm:ss','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','chatPause','faxPause','openchannelPause','smsPause','pauseType','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Queue:save','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Mail','Sms','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','addSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$and','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','CmHopper','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyIat','whoami','getPresence','teams','queues','inbound','lower','toString','asc','desc','uniqBy','orderBy','client','offline','idle','unknown','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','request','then','info','request\x20sent','debug','stringify','error','code','message','User,\x20%s,\x20%s','result','catch','end','offset','undefined','limit','count','status','Content-Range','json','update','destroy','get','role','admin'];(function(_0x855f62,_0x54a9b0){var _0x43bca8=function(_0x409d94){while(--_0x409d94){_0x855f62['push'](_0x855f62['shift']());}};_0x43bca8(++_0x54a9b0);}(_0x2542,0x169));var _0x2254=function(_0x4dbd78,_0x3d4539){_0x4dbd78=_0x4dbd78-0x0;var _0x2a0eba=_0x2542[_0x4dbd78];return _0x2a0eba;};'use strict';var moment=require(_0x2254('0x0'));var BPromise=require(_0x2254('0x1'));var util=require(_0x2254('0x2'));var path=require(_0x2254('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2254('0x4'));var jayson=require('jayson/promise');var Redis=require(_0x2254('0x5'));var authService=require(_0x2254('0x6'));var qs=require(_0x2254('0x7'));var logger=require(_0x2254('0x8'))(_0x2254('0x9'));var utils=require('../../config/utils');var config=require(_0x2254('0xa'));var licenseUtil=require(_0x2254('0xb'));var db=require(_0x2254('0xc'))['db'];var socket=require(_0x2254('0xd'))(new Redis(config[_0x2254('0xe')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);config[_0x2254('0xe')]=_[_0x2254('0x11')](config[_0x2254('0xe')],{'host':_0x2254('0x12'),'port':0x18eb});var client=jayson['client'][_0x2254('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2655ea,_0x506abe,_0x143c90,_0x575d58){return new BPromise(function(_0x524fad,_0xe4fc71){var _0x3e4213=_0x575d58||client;return _0x3e4213[_0x2254('0x14')](_0x2655ea,_0x143c90)[_0x2254('0x15')](function(_0x3c326b){logger[_0x2254('0x16')]('User,\x20%s,\x20%s',_0x506abe,_0x2254('0x17'));logger[_0x2254('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x506abe,_0x2254('0x17'),JSON[_0x2254('0x19')](_0x3c326b));if(_0x3c326b[_0x2254('0x1a')]){if(_0x3c326b[_0x2254('0x1a')][_0x2254('0x1b')]===0x1f4){logger[_0x2254('0x1a')]('User,\x20%s,\x20%s',_0x506abe,_0x3c326b[_0x2254('0x1a')]['message']);return _0xe4fc71(_0x3c326b[_0x2254('0x1a')][_0x2254('0x1c')]);}logger[_0x2254('0x1a')](_0x2254('0x1d'),_0x506abe,_0x3c326b[_0x2254('0x1a')][_0x2254('0x1c')]);return _0x524fad(_0x3c326b['error']['message']);}else{logger['info'](_0x2254('0x1d'),_0x506abe,_0x2254('0x17'));_0x524fad(_0x3c326b[_0x2254('0x1e')][_0x2254('0x1c')]);}})[_0x2254('0x1f')](function(_0x2339bc){logger['error'](_0x2254('0x1d'),_0x506abe,_0x2339bc);_0xe4fc71(_0x2339bc);});});}function respondWithStatusCode(_0x16148d,_0x906cde){_0x906cde=_0x906cde||0xcc;return function(_0x576369){if(_0x576369){return _0x16148d['sendStatus'](_0x906cde);}return _0x16148d['status'](_0x906cde)[_0x2254('0x20')]();};}function respondWithResult(_0x559af4,_0xf88b56){_0xf88b56=_0xf88b56||0xc8;return function(_0x56b91e){if(_0x56b91e){return _0x559af4['status'](_0xf88b56)['json'](_0x56b91e);}};}function respondWithFilteredResult(_0x540020,_0x5e5edb){return function(_0x4f797d){if(_0x4f797d){var _0x1aa71f=typeof _0x5e5edb[_0x2254('0x21')]===_0x2254('0x22')&&typeof _0x5e5edb[_0x2254('0x23')]===_0x2254('0x22');var _0x1349c9=_0x4f797d['count'];var _0x4a8274=_0x1aa71f?0x0:_0x5e5edb[_0x2254('0x21')];var _0x4f6877=_0x1aa71f?_0x4f797d[_0x2254('0x24')]:_0x5e5edb[_0x2254('0x21')]+_0x5e5edb[_0x2254('0x23')];var _0x3aa0bd;if(_0x4f6877>=_0x1349c9){_0x4f6877=_0x1349c9;_0x3aa0bd=0xc8;}else{_0x3aa0bd=0xce;}_0x540020[_0x2254('0x25')](_0x3aa0bd);return _0x540020['set'](_0x2254('0x26'),_0x4a8274+'-'+_0x4f6877+'/'+_0x1349c9)[_0x2254('0x27')](_0x4f797d);}return null;};}function saveUpdates(_0x21285d){return function(_0x37af8b){if(_0x37af8b){return _0x37af8b[_0x2254('0x28')](_0x21285d)[_0x2254('0x15')](function(_0x3214a7){return _0x3214a7;});}return null;};}function removeEntity(_0x22e791){return function(_0x29975f){if(_0x29975f){return _0x29975f[_0x2254('0x29')]()[_0x2254('0x15')](function(){var _0xad7774=_0x29975f[_0x2254('0x2a')]({'plain':!![]});if(_0xad7774[_0x2254('0x2b')]===_0x2254('0x2c'))return;var _0x1b16c8=[{'name':_0x2254('0x2d'),'value':_0x2254('0x2e'),'ignore':!![]},{'name':_0x2254('0x2f'),'value':'agent','ignore':![]},{'name':_0x2254('0x30'),'value':_0x2254('0x31'),'ignore':![]}];var _0x765e8e=_(_0x1b16c8)[_0x2254('0x32')](_0x2254('0x33'))[_0x2254('0x34')](_0x2254('0x35'))[_0x2254('0x35')]();if(_[_0x2254('0x36')](_0x765e8e,_0xad7774['role'])){return;}var _0x835a0e=_[_0x2254('0x37')](_0x1b16c8,['value',_0xad7774[_0x2254('0x2b')]])[_0x2254('0x38')];return db[_0x2254('0x39')][_0x2254('0x29')]({'where':{'type':_0x835a0e,'resourceId':_0xad7774['id']}})['then'](function(){return _0x29975f;});})['then'](function(){_0x22e791[_0x2254('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d620a){return function(_0x10d749){if(!_0x10d749){_0x3d620a[_0x2254('0x3a')](0x194);}return _0x10d749;};}function handleError(_0x141ddc,_0x12428a){_0x12428a=_0x12428a||0x1f4;return function(_0x2707f4){logger[_0x2254('0x1a')](_0x2707f4['stack']);if(_0x2707f4[_0x2254('0x38')]){delete _0x2707f4[_0x2254('0x38')];}_0x141ddc[_0x2254('0x25')](_0x12428a)[_0x2254('0x3b')](_0x2707f4);};}exports[_0x2254('0x3c')]=function(_0x3f6007,_0x3e7ccb){var _0x24744a={},_0x122314={'count':0x0,'rows':[]};var _0x34543d=_(db['User'][_0x2254('0x3d')])[_0x2254('0x34')](function(_0x31d845){return{'name':_0x31d845[_0x2254('0x3e')],'type':_0x31d845['type'][_0x2254('0x3f')]};})[_0x2254('0x32')](function(_0x457625){return!_[_0x2254('0x36')]([_0x2254('0x40'),_0x2254('0x41')],_0x457625[_0x2254('0x38')]);})[_0x2254('0x35')]();_0x24744a=qs['getOptions'](_0x34543d,_0x3f6007);var _0x362ad1={'where':_0x24744a['where']};return db[_0x2254('0x42')][_0x2254('0x24')](_0x362ad1)[_0x2254('0x15')](function(_0x9f142b){_0x122314[_0x2254('0x24')]=_0x9f142b;if(_0x3f6007[_0x2254('0x43')][_0x2254('0x44')]){_0x24744a['include']=[{'all':!![]}];}if(!_[_0x2254('0x36')](_0x24744a[_0x2254('0x45')],'id')){_0x24744a[_0x2254('0x45')][_0x2254('0x46')]('id');}return db[_0x2254('0x42')]['findAll'](_0x24744a);})[_0x2254('0x15')](function(_0x1dec43){_0x122314[_0x2254('0x47')]=_0x1dec43;if(_0x3f6007[_0x2254('0x43')][_0x2254('0x48')]==='true'){var _0x12a227=[];for(var _0x47c933=0x0;_0x47c933<_0x122314[_0x2254('0x47')][_0x2254('0x49')];_0x47c933++){_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x4a'),_0x122314[_0x2254('0x47')][_0x47c933][_0x2254('0x4b')]));_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x4c'),_0x122314[_0x2254('0x47')][_0x47c933][_0x2254('0x4b')]));_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x4d'),_0x122314[_0x2254('0x47')][_0x47c933]['dataValues']));_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x4e'),_0x122314[_0x2254('0x47')][_0x47c933]['dataValues']));_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x4f'),_0x122314[_0x2254('0x47')][_0x47c933][_0x2254('0x4b')]));_0x12a227[_0x2254('0x46')](get_open_tabs(_0x2254('0x50'),_0x122314[_0x2254('0x47')][_0x47c933][_0x2254('0x4b')]));}return BPromise[_0x2254('0x51')](_0x12a227)['then'](function(_0x239ba0){return _0x122314;});}else{return _0x122314;}})[_0x2254('0x15')](respondWithFilteredResult(_0x3e7ccb,_0x24744a))[_0x2254('0x1f')](handleError(_0x3e7ccb,null));};exports[_0x2254('0x52')]=function(_0xbbc059,_0x1a203e){var _0x3396c2={'raw':![],'where':{'id':_0xbbc059[_0x2254('0x53')]['id']}},_0x438922={};_0x438922[_0x2254('0x54')]=_['differenceBy'](_[_0x2254('0x55')](db[_0x2254('0x42')]['rawAttributes']),[_0x2254('0x40'),_0x2254('0x41')]);_0x438922[_0x2254('0x43')]=_[_0x2254('0x55')](_0xbbc059['query']);_0x438922[_0x2254('0x56')]=_[_0x2254('0x57')](_0x438922['model'],_0x438922[_0x2254('0x43')]);_0x3396c2[_0x2254('0x45')]=_[_0x2254('0x57')](_0x438922[_0x2254('0x54')],qs['fields'](_0xbbc059[_0x2254('0x43')][_0x2254('0x58')]));_0x3396c2[_0x2254('0x45')]=_0x3396c2['attributes']['length']?_0x3396c2[_0x2254('0x45')]:_0x438922[_0x2254('0x54')];if(_0xbbc059['query'][_0x2254('0x44')]){_0x3396c2['include']=[{'all':!![]}];}_0x3396c2=_['merge']({},_0x3396c2,_0xbbc059[_0x2254('0x59')]);if(!_[_0x2254('0x36')](_0x3396c2[_0x2254('0x45')],'id')){_0x3396c2[_0x2254('0x45')][_0x2254('0x46')]('id');}return db['User']['find'](_0x3396c2)[_0x2254('0x15')](handleEntityNotFound(_0x1a203e,null))['then'](function(_0x10a8db){var _0x28a7c6=[];values=_0x10a8db;if(_0xbbc059[_0x2254('0x43')][_0x2254('0x48')]==='true'){_0x28a7c6[_0x2254('0x46')](get_open_tabs(_0x2254('0x4a'),_0x10a8db['dataValues']));_0x28a7c6['push'](get_open_tabs(_0x2254('0x4c'),_0x10a8db['dataValues']));_0x28a7c6[_0x2254('0x46')](get_open_tabs(_0x2254('0x4f'),_0x10a8db[_0x2254('0x4b')]));_0x28a7c6[_0x2254('0x46')](get_open_tabs(_0x2254('0x50'),_0x10a8db['dataValues']));_0x28a7c6['push'](get_open_tabs(_0x2254('0x4d'),_0x10a8db['dataValues']));_0x28a7c6[_0x2254('0x46')](get_open_tabs('mail',_0x10a8db['dataValues']));return BPromise['all'](_0x28a7c6);}else{return values;}})[_0x2254('0x15')](function(_0x448773){return values;})[_0x2254('0x15')](respondWithResult(_0x1a203e,null))[_0x2254('0x1f')](handleError(_0x1a203e,null));};exports[_0x2254('0x28')]=function(_0x1cf757,_0x14b1ba){if(_0x1cf757[_0x2254('0x5a')]['id']){delete _0x1cf757[_0x2254('0x5a')]['id'];}delete _0x1cf757[_0x2254('0x5a')][_0x2254('0x2b')];return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x1cf757[_0x2254('0x53')]['id']}})[_0x2254('0x15')](handleEntityNotFound(_0x14b1ba,null))[_0x2254('0x15')](saveUpdates(_0x1cf757[_0x2254('0x5a')],null))[_0x2254('0x15')](respondWithResult(_0x14b1ba,null))[_0x2254('0x1f')](handleError(_0x14b1ba,null));};exports['describe']=function(_0x329378,_0xae171c){return db[_0x2254('0x42')][_0x2254('0x5b')]()['then'](respondWithResult(_0xae171c,null))['catch'](handleError(_0xae171c,null));};exports[_0x2254('0x5c')]=function(_0x423c17,_0x1d73a3){return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x423c17['params']['id']}})[_0x2254('0x15')](handleEntityNotFound(_0x1d73a3,null))[_0x2254('0x15')](function(_0x639396){if(_0x639396){return _0x639396['addContacts'](_0x423c17['body'][_0x2254('0x5d')],_['omit'](_0x423c17[_0x2254('0x5a')],[_0x2254('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x1d73a3,null))[_0x2254('0x1f')](handleError(_0x1d73a3,null));};function validateUser(_0x1b154f){return new BPromise(function(_0x4d30a5,_0x1288b5){if(_0x1b154f[_0x2254('0x5e')])return _0x4d30a5(_0x1b154f);return db['Setting']['findById'](0x1)[_0x2254('0x15')](function(_0xa159a4){if(_0xa159a4['securePassword'])authService['validatePasswordPattern'](_0x1b154f[_0x2254('0x40')]);db['User'][_0x2254('0x5f')]('internal')[_0x2254('0x15')](function(_0x7bdd46){if(_[_0x2254('0x60')](_0x7bdd46)){_0x1b154f[_0x2254('0x5e')]=_0xa159a4['min_internal']||0x1;return;}if(_[_0x2254('0x60')](_0xa159a4['min_internal'])||_0xa159a4[_0x2254('0x61')]===_0x7bdd46){_0x1b154f[_0x2254('0x5e')]=_0x7bdd46+0x1;return;}if(_0xa159a4['min_internal']>_0x7bdd46){_0x1b154f[_0x2254('0x5e')]=_0xa159a4[_0x2254('0x61')];return;}return db['sequelize'][_0x2254('0x43')](_0x2254('0x62'),{'type':db[_0x2254('0x63')][_0x2254('0x64')]['SELECT']})[_0x2254('0x15')](function(_0x301db7){if(_0x301db7&&_0x301db7['length']){for(var _0x1ac8ff=0x0,_0x4469c7=_0x301db7['length'];_0x1ac8ff<_0x4469c7&&_[_0x2254('0x60')](_0x1b154f['internal']);_0x1ac8ff++){if(_0xa159a4[_0x2254('0x61')]<=_0x301db7[_0x1ac8ff]['from']){_0x1b154f[_0x2254('0x5e')]=_0x301db7[_0x1ac8ff][_0x2254('0x65')];}else if(_0xa159a4['min_internal']>_0x301db7[_0x1ac8ff][_0x2254('0x65')]&&_0xa159a4['min_internal']<=_0x301db7[_0x1ac8ff]['to']){_0x1b154f[_0x2254('0x5e')]=_0xa159a4[_0x2254('0x61')];}}}if(_[_0x2254('0x60')](_0x1b154f['internal'])){_0x1b154f[_0x2254('0x5e')]=_0x7bdd46+0x1;}return _0x4d30a5(_0x1b154f);});});})['catch'](function(_0x30966){_0x1288b5(_0x30966);});});}function updateUser(_0x33f29b){return new BPromise(function(_0x4d4891,_0x58d475){try{if(_0x33f29b[_0x2254('0x66')]){_0x33f29b[_0x2254('0x67')]=_0x33f29b[_0x2254('0x5e')];_0x33f29b[_0x2254('0x68')]={'mailbox':_0x33f29b['internal'],'password':_0x33f29b[_0x2254('0x40')],'fullname':_0x33f29b[_0x2254('0x69')],'email':_0x33f29b[_0x2254('0x6a')]};}if(_0x33f29b[_0x2254('0x2b')]==='agent'){if(!_0x33f29b[_0x2254('0x6b')])_0x33f29b[_0x2254('0x6b')]=['101',_0x2254('0x6c'),'103',_0x2254('0x6d'),'110','104','105',_0x2254('0x6e'),'107',_0x2254('0x6f'),_0x2254('0x70'),'100',_0x2254('0x71'),_0x2254('0x72'),_0x2254('0x73')];}_0x4d4891(_0x33f29b);}catch(_0x1a7c04){_0x58d475(_0x1a7c04);}});}exports[_0x2254('0x74')]=function(_0x2ed18e,_0x523b10){if(_0x2ed18e['user'][_0x2254('0x2b')]===_0x2254('0x75'))throw new Error(_0x2254('0x76'));if(_0x2ed18e[_0x2254('0x5a')][_0x2254('0x2b')]===_0x2254('0x2e')&&_0x2ed18e[_0x2254('0x2e')][_0x2254('0x2b')]!==_0x2254('0x2c')){throw new Error(_0x2254('0x77'));}if(_0x2ed18e['body'][_0x2254('0x2b')]===_0x2254('0x2c')&&_0x2ed18e['user'][_0x2254('0x2b')]!=='admin'){throw new Error(_0x2254('0x78'));}return licenseUtil[_0x2254('0x79')]([_0x2ed18e['body']])[_0x2254('0x15')](function(){return validateUser(_0x2ed18e['body']);})[_0x2254('0x15')](function(_0x2f66ba){return updateUser(_0x2f66ba)[_0x2254('0x15')](function(_0x1f7a48){if(_0x1f7a48['role']===_0x2254('0x2c')){_0x1f7a48[_0x2254('0x7a')]=_0x2ed18e[_0x2254('0x2e')][_0x2254('0x7a')];delete _0x1f7a48['userProfileId'];}return _0x1f7a48;});})[_0x2254('0x15')](function(_0x480eeb){return db['User'][_0x2254('0x74')](_0x480eeb,{'include':[{'model':db[_0x2254('0x68')],'as':'VoiceMail'}]});})['then'](function(_0x1f29ec){if(_0x2ed18e[_0x2254('0x5a')][_0x2254('0x2b')]===_0x2254('0x2e'))return _0x1f29ec;if(_0x2ed18e[_0x2254('0x2e')][_0x2254('0x2b')]!==_0x2254('0x2e'))return _0x1f29ec;return db[_0x2254('0x7b')][_0x2254('0x37')]({'where':{'name':_0x1f29ec['role']===_0x2254('0x75')?'Agents':_0x2254('0x30'),'userProfileId':_0x2ed18e['user'][_0x2254('0x7c')]},'raw':!![]})[_0x2254('0x15')](function(_0x2b0a45){if(!_0x2b0a45||_0x2b0a45['autoAssociation']!=0x0)return _0x1f29ec;return db[_0x2254('0x39')][_0x2254('0x74')]({'name':_0x1f29ec[_0x2254('0x38')],'resourceId':_0x1f29ec['id'],'type':_0x2b0a45[_0x2254('0x38')],'sectionId':_0x2b0a45['id']},{})[_0x2254('0x15')](function(){return _0x1f29ec;});})[_0x2254('0x1f')](function(_0x4783ab){logger[_0x2254('0x1a')](_0x2254('0x7d'),_0x4783ab);throw _0x4783ab;});})[_0x2254('0x15')](respondWithResult(_0x523b10,0xc9))[_0x2254('0x1f')](handleError(_0x523b10,null));};exports[_0x2254('0x7e')]=function(_0x70c30,_0x557e75){var _0x806221=_0x70c30['body'];var _0x64c4f5=[];if(_0x70c30[_0x2254('0x2e')][_0x2254('0x2b')]===_0x2254('0x75'))throw new Error(_0x2254('0x76'));if(_[_0x2254('0x7f')](_0x806221,[_0x2254('0x2b'),'user'])&&_0x70c30[_0x2254('0x2e')]['role']!==_0x2254('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x2254('0x7f')](_0x806221,[_0x2254('0x2b'),_0x2254('0x2c')])&&_0x70c30['user'][_0x2254('0x2b')]!==_0x2254('0x2c')){throw new Error(_0x2254('0x80'));}return licenseUtil[_0x2254('0x79')](_0x806221)[_0x2254('0x15')](function(){return validateUser(_0x806221[0x0]);})[_0x2254('0x15')](function(){for(var _0x34185c=0x1;_0x34185c<_0x806221[_0x2254('0x49')];_0x34185c++){var _0x5e94b6=_0x806221[_0x34185c-0x1]['internal'];if(!_0x806221[_0x34185c][_0x2254('0x5e')])_0x806221[_0x34185c]['internal']=_0x5e94b6+0x1;_0x64c4f5[_0x2254('0x46')](validateUser(_0x806221[_0x34185c]));}return BPromise[_0x2254('0x51')](_0x64c4f5);})[_0x2254('0x15')](function(){_0x64c4f5=[];for(var _0x438c95=0x0;_0x438c95<_0x806221[_0x2254('0x49')];_0x438c95++){_0x64c4f5[_0x2254('0x46')](updateUser(_0x806221[_0x438c95]));}return BPromise[_0x2254('0x51')](_0x64c4f5);})['then'](function(){return BPromise[_0x2254('0x81')](_0x806221,function(_0x34ac83){return db[_0x2254('0x42')]['create'](_0x34ac83,{'include':[{'model':db[_0x2254('0x68')],'as':_0x2254('0x68')}]})[_0x2254('0x15')](function(_0x1426d6){_0x34ac83['id']=_0x1426d6['id'];return _0x34ac83;});});})[_0x2254('0x15')](function(_0x37ddcc){if(_0x70c30[_0x2254('0x5a')][_0x2254('0x2b')]===_0x2254('0x2e'))return _0x37ddcc;if(_0x70c30['user'][_0x2254('0x2b')]!==_0x2254('0x2e'))return _0x37ddcc;var _0x590b46=_['some'](_0x37ddcc,function(_0x30aa5c){return _0x30aa5c['role']===_0x2254('0x75')||_0x30aa5c[_0x2254('0x2b')]===_0x2254('0x31');});if(!_0x590b46)return _0x37ddcc;return db[_0x2254('0x7b')][_0x2254('0x82')]({'where':{'name':{'$or':[_0x2254('0x2f'),_0x2254('0x30')]},'userProfileId':_0x70c30[_0x2254('0x2e')]['userProfileId']},'raw':!![]})['then'](function(_0x2f74e4){if(_[_0x2254('0x83')](_0x2f74e4)||!_[_0x2254('0x7f')](_0x2f74e4,[_0x2254('0x84'),0x0]))return _0x37ddcc;_0x64c4f5=[];var _0x201da7=_(_0x2f74e4)['map'](function(_0x573b62){if(_0x573b62[_0x2254('0x84')]===0x1)return;return _0x573b62['name']===_0x2254('0x2f')?_0x2254('0x75'):_0x2254('0x31');})[_0x2254('0x85')]()[_0x2254('0x35')]();for(var _0x331cfc=0x0;_0x331cfc<_0x37ddcc[_0x2254('0x49')];_0x331cfc++){if(!_['includes'](_0x201da7,_0x37ddcc[_0x331cfc][_0x2254('0x2b')]))return;var _0x30e919=_0x37ddcc[_0x331cfc]['role']===_0x2254('0x75')?_0x2254('0x2f'):_0x2254('0x30');_0x64c4f5[_0x2254('0x46')](db[_0x2254('0x39')][_0x2254('0x74')]({'name':_0x37ddcc[_0x331cfc][_0x2254('0x38')],'resourceId':_0x37ddcc[_0x331cfc]['id'],'type':_0x30e919,'sectionId':_[_0x2254('0x37')](_0x2f74e4,[_0x2254('0x38'),_0x30e919])['id']},{}));}return BPromise[_0x2254('0x51')](_0x64c4f5);});})[_0x2254('0x15')](respondWithResult(_0x557e75,0xc9))['catch'](handleError(_0x557e75,null));};exports[_0x2254('0x86')]=function(_0x38bb67,_0x2c5f98){if(_0x38bb67[_0x2254('0x5a')]['id']){delete _0x38bb67[_0x2254('0x5a')]['id'];}return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x38bb67['params']['id']}})[_0x2254('0x15')](function(_0x3e937a){if(!_0x3e937a)return null;if(_0x3e937a['id']===_0x38bb67[_0x2254('0x2e')]['id']){if(!_0x38bb67['body'][_0x2254('0x87')]||!_0x38bb67[_0x2254('0x5a')][_0x2254('0x88')]){throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))](_0x2254('0x8b'));}if(!_0x3e937a['authenticate'](_0x38bb67[_0x2254('0x5a')][_0x2254('0x87')])){throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))](_0x2254('0x8c'));}if(_0x38bb67['body']['oldPassword']===_0x38bb67[_0x2254('0x5a')]['newPassword']){throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))](_0x2254('0x8d'));}}else if(_0x38bb67[_0x2254('0x2e')][_0x2254('0x2b')]===_0x2254('0x2c')){if(!_0x38bb67['body']['newPassword']){throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))](_0x2254('0x8e'));}}else if(_0x38bb67[_0x2254('0x2e')]['role']===_0x2254('0x2e')){if(!_0x38bb67[_0x2254('0x5a')][_0x2254('0x88')]){throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))](_0x2254('0x8e'));}if(_0x3e937a[_0x2254('0x2b')]!==_0x2254('0x75')){throw new db[(_0x2254('0x89'))]['ValidationError'](_0x2254('0x76'));}}else{throw new db[(_0x2254('0x89'))][(_0x2254('0x8a'))]('Unauthorized');}return _0x3e937a;})[_0x2254('0x15')](handleEntityNotFound(_0x2c5f98,null))[_0x2254('0x15')](function(_0x16ca50){return db['Setting']['findOne']({'attributes':['id',_0x2254('0x8f'),_0x2254('0x90'),_0x2254('0x91')]})[_0x2254('0x15')](function(_0x310fb6){if(_0x310fb6[_0x2254('0x8f')])authService[_0x2254('0x92')](_0x38bb67[_0x2254('0x5a')]['newPassword']);if(!_0x310fb6[_0x2254('0x90')]||!_0x16ca50[_0x2254('0x93')])return _0x16ca50;authService[_0x2254('0x94')](_0x38bb67[_0x2254('0x5a')][_0x2254('0x88')],_0x16ca50[_0x2254('0x93')],_0x310fb6['passwordHistoryLimit']);return _0x16ca50;})['then'](saveUpdates({'password':_0x38bb67[_0x2254('0x5a')]['newPassword'],'passwordResetAt':_0x38bb67['user']['id']==_0x38bb67[_0x2254('0x53')]['id']?moment():null,'previousPasswords':authService[_0x2254('0x95')](_0x38bb67[_0x2254('0x5a')][_0x2254('0x88')],_0x16ca50['previousPasswords'])},null));})['then'](respondWithResult(_0x2c5f98,null))[_0x2254('0x1f')](handleError(_0x2c5f98,null));};exports[_0x2254('0x96')]=function(_0x1cd8f8,_0x57700b){var _0x181f4a=_0x1cd8f8[_0x2254('0x5a')][_0x2254('0x97')];return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x1cd8f8[_0x2254('0x53')]['id']},'attributes':['id',_0x2254('0x38'),'role',_0x2254('0x98'),_0x2254('0x99'),_0x2254('0x9a'),_0x2254('0x9b')]})[_0x2254('0x15')](handleEntityNotFound(_0x57700b,null))[_0x2254('0x15')](function(_0x21fac0){if(_0x21fac0){if(!utils[_0x2254('0x9c')](_0x181f4a)){throw new db[(_0x2254('0x89'))]['ValidationError'](_0x2254('0x9d'));}return _0x21fac0[_0x2254('0x9e')+_[_0x2254('0x9f')](_0x181f4a[_0x2254('0xa0')]())+_0x2254('0xa1')](_0x1cd8f8[_0x2254('0x5a')]['ids'],{'penalty':_0x1cd8f8['body'][_0x2254('0xa2')]||0x0})['spread'](function(_0x34a26a){for(var _0x1ebf1f=0x0;_0x1ebf1f<_0x1cd8f8[_0x2254('0x5a')][_0x2254('0x5d')]['length'];_0x1ebf1f+=0x1){var _0x3cba5c={'UserId':Number(_0x1cd8f8[_0x2254('0x53')]['id'])};_0x3cba5c[_[_0x2254('0x9f')](_0x181f4a['toLowerCase']())+'QueueId']=Number(_0x1cd8f8[_0x2254('0x5a')]['ids'][_0x1ebf1f]);socket[_0x2254('0xa3')](_0x2254('0x2e')+_[_0x2254('0x9f')](_0x181f4a['toLowerCase']())+'Queue:save',_0x3cba5c);}return _0x34a26a;})[_0x2254('0x15')](function(){if(_0x181f4a===_0x2254('0xa4')){return db[_0x2254('0xa5')][_0x2254('0x82')]({'where':{'id':_0x1cd8f8[_0x2254('0x5a')]['ids']||[]},'raw':!![],'attributes':['id',_0x2254('0x38')]});}})[_0x2254('0x15')](function(_0x10d356){var _0x5d373=_0x21fac0[_0x2254('0x2a')]({'plain':!![]});var _0x30b354=[];if(_0x181f4a==='voice'&&_0x5d373[_0x2254('0x2b')]===_0x2254('0x75')&&_0x5d373['online']){for(var _0x3490aa=0x0;_0x3490aa<_0x10d356['length'];_0x3490aa+=0x1){_0x30b354[_0x2254('0x46')]({'membername':_0x5d373[_0x2254('0x38')],'UserId':_0x5d373['id'],'queue_name':_0x10d356[_0x3490aa]['name'],'VoiceQueueId':_0x10d356[_0x3490aa]['id'],'interface':_[_0x2254('0x60')](_0x5d373[_0x2254('0x9b')])?util[_0x2254('0xa6')](_0x2254('0xa7'),_0x5d373[_0x2254('0x38')]):_0x5d373[_0x2254('0x9b')],'paused':_0x5d373[_0x2254('0x9a')]||![],'penalty':_0x1cd8f8[_0x2254('0x5a')][_0x2254('0xa2')]||0x0});}return BPromise[_0x2254('0x81')](_0x30b354,function(_0x46259e){return db[_0x2254('0xa8')][_0x2254('0xa9')](_0x46259e);});}return _0x21fac0;});}})[_0x2254('0x15')](respondWithStatusCode(_0x57700b,null))['catch'](handleError(_0x57700b,null));};exports[_0x2254('0xaa')]=function(_0x4019fb,_0x52ba52){var _0x4e072b;return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x4019fb[_0x2254('0x53')]['id']},'attributes':['id',_0x2254('0x38'),'role']})[_0x2254('0x15')](handleEntityNotFound(_0x52ba52,null))['then'](function(_0x5042be){if(_0x5042be){_0x4e072b=_0x5042be;if(!_0x4019fb[_0x2254('0x43')][_0x2254('0x97')]||!utils[_0x2254('0x9c')](_0x4019fb[_0x2254('0x43')]['channel'])){throw new db[(_0x2254('0x89'))]['ValidationError'](_0x2254('0x9d'));}return _0x5042be[_0x2254('0xab')+_[_0x2254('0x9f')](_0x4019fb[_0x2254('0x43')][_0x2254('0x97')][_0x2254('0xa0')]())+_0x2254('0xa1')](_0x4019fb[_0x2254('0x43')][_0x2254('0x5d')]);}})[_0x2254('0x15')](function(_0x193809){if(_['isArray'](_0x4019fb[_0x2254('0x43')][_0x2254('0x5d')])){for(var _0x448322=0x0;_0x448322<_0x4019fb[_0x2254('0x43')][_0x2254('0x5d')][_0x2254('0x49')];_0x448322+=0x1){var _0x21e817={'UserId':Number(_0x4019fb[_0x2254('0x53')]['id'])};_0x21e817[_['capitalize'](_0x4019fb[_0x2254('0x43')][_0x2254('0x97')][_0x2254('0xa0')]())+_0x2254('0xac')]=Number(_0x4019fb[_0x2254('0x43')]['ids'][_0x448322]);socket[_0x2254('0xa3')](_0x2254('0x2e')+_['capitalize'](_0x4019fb[_0x2254('0x43')][_0x2254('0x97')][_0x2254('0xa0')]())+'Queue:remove',_0x21e817);}}else{var _0x21e817={'UserId':Number(_0x4019fb[_0x2254('0x53')]['id'])};_0x21e817[_['capitalize'](_0x4019fb[_0x2254('0x43')][_0x2254('0x97')][_0x2254('0xa0')]())+_0x2254('0xac')]=Number(_0x4019fb['query'][_0x2254('0x5d')]);socket[_0x2254('0xa3')](_0x2254('0x2e')+_[_0x2254('0x9f')](_0x4019fb['query'][_0x2254('0x97')][_0x2254('0xa0')]())+_0x2254('0xad'),_0x21e817);}return _0x193809;})['then'](function(){if(_0x4019fb[_0x2254('0x43')][_0x2254('0x97')]===_0x2254('0xa4')){return db[_0x2254('0xa8')][_0x2254('0x29')]({'where':{'UserId':_0x4019fb[_0x2254('0x53')]['id'],'VoiceQueueId':_0x4019fb[_0x2254('0x43')][_0x2254('0x5d')]},'individualHooks':!![]})['then'](function(){return _0x4e072b;});}return _0x4e072b;})[_0x2254('0x15')](respondWithStatusCode(_0x52ba52,null))[_0x2254('0x1f')](handleError(_0x52ba52,null));};exports['addAvatar']=function(_0x1a1ff3,_0x1f8bc0){_0x1a1ff3[_0x2254('0x5a')][_0x2254('0xae')]=_0x1a1ff3[_0x2254('0xaf')][_0x2254('0xb0')];return db[_0x2254('0x42')]['find']({'where':{'id':_0x1a1ff3[_0x2254('0x53')]['id']}})[_0x2254('0x15')](handleEntityNotFound(_0x1f8bc0,null))[_0x2254('0x15')](saveUpdates(_0x1a1ff3[_0x2254('0x5a')],null))['then'](respondWithResult(_0x1f8bc0,null))[_0x2254('0x1f')](handleError(_0x1f8bc0,null));};exports[_0x2254('0xb1')]=function(_0x19ece2,_0x4fc1b4){var _0x5611e1=path[_0x2254('0xb2')](config[_0x2254('0xb3')],_0x2254('0xb4'));return db[_0x2254('0x42')][_0x2254('0x37')]({'where':{'id':_0x19ece2[_0x2254('0x53')]['id']},'attributes':['id',_0x2254('0xae')],'raw':!![]})[_0x2254('0x15')](handleEntityNotFound(_0x4fc1b4,null))[_0x2254('0x15')](function(_0x285aee){if(_0x285aee){if(_['isNil'](_0x285aee['userpic'])){return _0x4fc1b4[_0x2254('0xb5')](_0x5611e1);}else{if(!fs[_0x2254('0xb6')](path['join'](config['root'],_0x2254('0xb7'),_0x285aee[_0x2254('0xae')]))){return _0x4fc1b4[_0x2254('0xb5')](_0x5611e1);}return _0x4fc1b4['download'](path['join'](config[_0x2254('0xb3')],'server/files/images/',_0x285aee[_0x2254('0xae')]));}}})[_0x2254('0x1f')](handleError(_0x4fc1b4,null));};exports[_0x2254('0xb8')]=function(_0x12c084,_0x3a1db3){return db[_0x2254('0x42')]['find']({'where':{'id':_0x12c084[_0x2254('0x53')]['id']},'attributes':['id']})[_0x2254('0x15')](handleEntityNotFound(_0x3a1db3,null))[_0x2254('0x15')](function(_0xa5db88){var _0x5e7978=[];values=_0xa5db88[_0x2254('0x4b')];_0x5e7978[_0x2254('0x46')](get_open_tabs(_0x2254('0x4a'),_0xa5db88['dataValues']));_0x5e7978['push'](get_open_tabs(_0x2254('0x4c'),_0xa5db88[_0x2254('0x4b')]));_0x5e7978[_0x2254('0x46')](get_open_tabs(_0x2254('0x4f'),_0xa5db88[_0x2254('0x4b')]));_0x5e7978[_0x2254('0x46')](get_open_tabs(_0x2254('0x50'),_0xa5db88[_0x2254('0x4b')]));_0x5e7978[_0x2254('0x46')](get_open_tabs(_0x2254('0x4d'),_0xa5db88[_0x2254('0x4b')]));_0x5e7978[_0x2254('0x46')](get_open_tabs(_0x2254('0x4e'),_0xa5db88[_0x2254('0x4b')]));return BPromise['all'](_0x5e7978);})[_0x2254('0x15')](function(_0x41897d){var _0x35c8eb=[];if(_0x41897d){for(var _0x4a1ac6=0x0;_0x4a1ac6=_0x1e394f){_0x45c4a0=_0x1e394f;_0x18bdbb=0xc8;}else{_0x18bdbb=0xce;}_0x2c47c5[_0xee2f('0x1a')](_0x18bdbb);return _0x2c47c5[_0xee2f('0x21')](_0xee2f('0x22'),_0x168adc+'-'+_0x45c4a0+'/'+_0x1e394f)[_0xee2f('0x1c')](_0x70e308);}return null;};}function saveUpdates(_0x3737fd){return function(_0x4d8398){if(_0x4d8398){return _0x4d8398[_0xee2f('0x23')](_0x3737fd)['then'](function(_0x235697){return _0x235697;});}return null;};}function removeEntity(_0x180429){return function(_0x25ee9c){if(_0x25ee9c){return _0x25ee9c[_0xee2f('0x24')]()[_0xee2f('0xf')](function(){var _0x47d5a6=_0x25ee9c[_0xee2f('0x25')]({'plain':!![]});if(_0x47d5a6[_0xee2f('0x26')]==='admin')return;var _0x4ee0e1=[{'name':_0xee2f('0x27'),'value':'user','ignore':!![]},{'name':_0xee2f('0x28'),'value':_0xee2f('0x29'),'ignore':![]},{'name':'Telephones','value':_0xee2f('0x2a'),'ignore':![]}];var _0x5ca9f6=_(_0x4ee0e1)['filter']('ignore')[_0xee2f('0x2b')](_0xee2f('0x2c'))['value']();if(_[_0xee2f('0x2d')](_0x5ca9f6,_0x47d5a6[_0xee2f('0x26')])){return;}var _0xd64b7=_[_0xee2f('0x2e')](_0x4ee0e1,[_0xee2f('0x2c'),_0x47d5a6['role']])[_0xee2f('0x2f')];return db['UserProfileResource'][_0xee2f('0x24')]({'where':{'type':_0xd64b7,'resourceId':_0x47d5a6['id']}})[_0xee2f('0xf')](function(){return _0x25ee9c;});})[_0xee2f('0xf')](function(){_0x180429['status'](0xcc)[_0xee2f('0x1b')]();});}};}function handleEntityNotFound(_0x5ed71e){return function(_0xd3aaa9){if(!_0xd3aaa9){_0x5ed71e['sendStatus'](0x194);}return _0xd3aaa9;};}function handleError(_0x3e6dcc,_0x13a824){_0x13a824=_0x13a824||0x1f4;return function(_0x13149e){logger[_0xee2f('0x15')](_0x13149e[_0xee2f('0x30')]);if(_0x13149e[_0xee2f('0x2f')]){delete _0x13149e[_0xee2f('0x2f')];}_0x3e6dcc[_0xee2f('0x1a')](_0x13a824)[_0xee2f('0x31')](_0x13149e);};}exports[_0xee2f('0x32')]=function(_0x433547,_0x5ad0a7){var _0x4584b8={},_0x47e54b={'count':0x0,'rows':[]};var _0x46166f=_(db[_0xee2f('0x33')][_0xee2f('0x34')])[_0xee2f('0x2b')](function(_0xaddf3b){return{'name':_0xaddf3b[_0xee2f('0x35')],'type':_0xaddf3b[_0xee2f('0x36')][_0xee2f('0x37')]};})['filter'](function(_0x562d58){return!_['includes']([_0xee2f('0x38'),'salt'],_0x562d58[_0xee2f('0x2f')]);})['value']();_0x4584b8=qs['getOptions'](_0x46166f,_0x433547);var _0x5027a6={'where':_0x4584b8['where']};return db[_0xee2f('0x33')][_0xee2f('0x20')](_0x5027a6)[_0xee2f('0xf')](function(_0x268775){_0x47e54b['count']=_0x268775;if(_0x433547['query'][_0xee2f('0x39')]){_0x4584b8['include']=[{'all':!![]}];}if(!_['includes'](_0x4584b8[_0xee2f('0x3a')],'id')){_0x4584b8[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x3c')](_0x4584b8);})[_0xee2f('0xf')](function(_0x19bd4d){_0x47e54b['rows']=_0x19bd4d;if(_0x433547['query'][_0xee2f('0x3d')]===_0xee2f('0x3e')){var _0x3bf382=[];for(var _0x2b9b33=0x0;_0x2b9b33<_0x47e54b['rows'][_0xee2f('0x3f')];_0x2b9b33++){_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x40'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs('fax',_0x47e54b['rows'][_0x2b9b33]['dataValues']));_0x3bf382['push'](get_open_tabs(_0xee2f('0x44'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x47e54b['rows'][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33]['dataValues']));}return BPromise['all'](_0x3bf382)['then'](function(_0x1609f0){return _0x47e54b;});}else{return _0x47e54b;}})['then'](respondWithFilteredResult(_0x5ad0a7,_0x4584b8))['catch'](handleError(_0x5ad0a7,null));};exports['show']=function(_0x5f39b4,_0x3834d1){var _0x3ebb54={'raw':![],'where':{'id':_0x5f39b4['params']['id']}},_0x32da72={};_0x32da72[_0xee2f('0x47')]=_['differenceBy'](_[_0xee2f('0x48')](db[_0xee2f('0x33')][_0xee2f('0x34')]),[_0xee2f('0x38'),_0xee2f('0x49')]);_0x32da72['query']=_['keys'](_0x5f39b4[_0xee2f('0x4a')]);_0x32da72['filters']=_[_0xee2f('0x4b')](_0x32da72[_0xee2f('0x47')],_0x32da72[_0xee2f('0x4a')]);_0x3ebb54[_0xee2f('0x3a')]=_['intersection'](_0x32da72['model'],qs[_0xee2f('0x4c')](_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x4c')]));_0x3ebb54[_0xee2f('0x3a')]=_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3f')]?_0x3ebb54[_0xee2f('0x3a')]:_0x32da72[_0xee2f('0x47')];if(_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x39')]){_0x3ebb54[_0xee2f('0x4d')]=[{'all':!![]}];}_0x3ebb54=_[_0xee2f('0x4e')]({},_0x3ebb54,_0x5f39b4['options']);if(!_[_0xee2f('0x2d')](_0x3ebb54[_0xee2f('0x3a')],'id')){_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x2e')](_0x3ebb54)[_0xee2f('0xf')](handleEntityNotFound(_0x3834d1,null))[_0xee2f('0xf')](function(_0xda9ad5){var _0xa88c4c=[];values=_0xda9ad5;if(_0x5f39b4['query'][_0xee2f('0x3d')]==='true'){_0xa88c4c['push'](get_open_tabs(_0xee2f('0x40'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0xda9ad5['dataValues']));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0xda9ad5[_0xee2f('0x42')]));return BPromise['all'](_0xa88c4c);}else{return values;}})[_0xee2f('0xf')](function(_0x4b9d29){return values;})[_0xee2f('0xf')](respondWithResult(_0x3834d1,null))[_0xee2f('0x18')](handleError(_0x3834d1,null));};exports[_0xee2f('0x23')]=function(_0x11ba31,_0x2f3891){if(_0x11ba31['body']['id']){delete _0x11ba31[_0xee2f('0x50')]['id'];}delete _0x11ba31[_0xee2f('0x50')][_0xee2f('0x26')];return db[_0xee2f('0x33')]['find']({'where':{'id':_0x11ba31['params']['id']}})['then'](handleEntityNotFound(_0x2f3891,null))['then'](saveUpdates(_0x11ba31['body'],null))[_0xee2f('0xf')](respondWithResult(_0x2f3891,null))['catch'](handleError(_0x2f3891,null));};exports[_0xee2f('0x51')]=function(_0x1421da,_0xd967e9){return db[_0xee2f('0x33')][_0xee2f('0x51')]()[_0xee2f('0xf')](respondWithResult(_0xd967e9,null))['catch'](handleError(_0xd967e9,null));};exports['addContacts']=function(_0x1708c5,_0x58e464){return db[_0xee2f('0x33')]['find']({'where':{'id':_0x1708c5[_0xee2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x58e464,null))[_0xee2f('0xf')](function(_0x38616b){if(_0x38616b){return _0x38616b[_0xee2f('0x53')](_0x1708c5['body'][_0xee2f('0x54')],_[_0xee2f('0x55')](_0x1708c5[_0xee2f('0x50')],[_0xee2f('0x54'),'id'])||{});}})[_0xee2f('0xf')](respondWithResult(_0x58e464,null))[_0xee2f('0x18')](handleError(_0x58e464,null));};function validateUser(_0xf0c721){return new BPromise(function(_0x54f48f,_0x3ee766){if(_0xf0c721[_0xee2f('0x56')])return _0x54f48f(_0xf0c721);return db[_0xee2f('0x57')][_0xee2f('0x58')](0x1)[_0xee2f('0xf')](function(_0x3c9d47){if(_0x3c9d47[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0xf0c721[_0xee2f('0x38')]);db[_0xee2f('0x33')][_0xee2f('0x5b')]('internal')[_0xee2f('0xf')](function(_0xf15bc1){if(_['isNil'](_0xf15bc1)){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47['min_internal']||0x1;return;}if(_[_0xee2f('0x5c')](_0x3c9d47['min_internal'])||_0x3c9d47['min_internal']===_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;return;}if(_0x3c9d47[_0xee2f('0x5d')]>_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];return;}return db[_0xee2f('0x5e')]['query'](_0xee2f('0x5f'),{'type':db[_0xee2f('0x5e')][_0xee2f('0x60')]['SELECT']})[_0xee2f('0xf')](function(_0x413d70){if(_0x413d70&&_0x413d70['length']){for(var _0x1f1c55=0x0,_0x32800d=_0x413d70[_0xee2f('0x3f')];_0x1f1c55<_0x32800d&&_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')]);_0x1f1c55++){if(_0x3c9d47[_0xee2f('0x5d')]<=_0x413d70[_0x1f1c55][_0xee2f('0x61')]){_0xf0c721[_0xee2f('0x56')]=_0x413d70[_0x1f1c55][_0xee2f('0x61')];}else if(_0x3c9d47['min_internal']>_0x413d70[_0x1f1c55]['from']&&_0x3c9d47['min_internal']<=_0x413d70[_0x1f1c55]['to']){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];}}}if(_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')])){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;}return _0x54f48f(_0xf0c721);});});})['catch'](function(_0x2b69f0){_0x3ee766(_0x2b69f0);});});}function updateUser(_0x3a4464){return new BPromise(function(_0x4e39ba,_0x2c4a18){try{if(_0x3a4464[_0xee2f('0x62')]){_0x3a4464[_0xee2f('0x63')]=_0x3a4464['internal'];_0x3a4464[_0xee2f('0x64')]={'mailbox':_0x3a4464['internal'],'password':_0x3a4464[_0xee2f('0x38')],'fullname':_0x3a4464[_0xee2f('0x65')],'email':_0x3a4464['email']};}if(_0x3a4464[_0xee2f('0x26')]===_0xee2f('0x29')){if(!_0x3a4464['permissions'])_0x3a4464['permissions']=['101',_0xee2f('0x66'),'103','113',_0xee2f('0x67'),_0xee2f('0x68'),'105',_0xee2f('0x69'),'107',_0xee2f('0x6a'),_0xee2f('0x6b'),_0xee2f('0x6c'),_0xee2f('0x6d'),_0xee2f('0x6e'),_0xee2f('0x6f')];}_0x4e39ba(_0x3a4464);}catch(_0x20990f){_0x2c4a18(_0x20990f);}});}exports['create']=function(_0x86eb61,_0x2989a8){if(_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error('Unauthorized');if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]===_0xee2f('0x70')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x86eb61['body'][_0xee2f('0x26')]===_0xee2f('0x71')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x72'));}return licenseUtil[_0xee2f('0x73')]([_0x86eb61['body']])['then'](function(){return validateUser(_0x86eb61[_0xee2f('0x50')]);})[_0xee2f('0xf')](function(_0x12c4f9){return updateUser(_0x12c4f9)[_0xee2f('0xf')](function(_0x38ee46){if(_0x38ee46[_0xee2f('0x26')]===_0xee2f('0x71')){_0x38ee46[_0xee2f('0x74')]=_0x86eb61[_0xee2f('0x70')][_0xee2f('0x74')];delete _0x38ee46[_0xee2f('0x75')];}return _0x38ee46;});})[_0xee2f('0xf')](function(_0x563d01){return db['User'][_0xee2f('0x76')](_0x563d01,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5a1fdc){if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]==='user')return _0x5a1fdc;if(_0x86eb61['user'][_0xee2f('0x26')]!==_0xee2f('0x70'))return _0x5a1fdc;return db[_0xee2f('0x77')]['find']({'where':{'name':_0x5a1fdc['role']===_0xee2f('0x29')?_0xee2f('0x28'):_0xee2f('0x78'),'userProfileId':_0x86eb61['user'][_0xee2f('0x75')]},'raw':!![]})['then'](function(_0x1afacf){if(!_0x1afacf||_0x1afacf['autoAssociation']!=0x0)return _0x5a1fdc;return db[_0xee2f('0x79')][_0xee2f('0x76')]({'name':_0x5a1fdc[_0xee2f('0x2f')],'resourceId':_0x5a1fdc['id'],'type':_0x1afacf['name'],'sectionId':_0x1afacf['id']},{})['then'](function(){return _0x5a1fdc;});})[_0xee2f('0x18')](function(_0x4448a6){logger[_0xee2f('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4448a6);throw _0x4448a6;});})[_0xee2f('0xf')](respondWithResult(_0x2989a8,0xc9))[_0xee2f('0x18')](handleError(_0x2989a8,null));};exports[_0xee2f('0x7a')]=function(_0x346fc2,_0x413340){var _0x2c14f=_0x346fc2[_0xee2f('0x50')];var _0x16326e=[];if(_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error(_0xee2f('0x7b'));if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),'user'])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7d'));}if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),_0xee2f('0x71')])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7e'));}return licenseUtil['checkUserLimits'](_0x2c14f)[_0xee2f('0xf')](function(){return validateUser(_0x2c14f[0x0]);})[_0xee2f('0xf')](function(){for(var _0x1422e9=0x1;_0x1422e9<_0x2c14f[_0xee2f('0x3f')];_0x1422e9++){var _0x53d769=_0x2c14f[_0x1422e9-0x1][_0xee2f('0x56')];if(!_0x2c14f[_0x1422e9][_0xee2f('0x56')])_0x2c14f[_0x1422e9][_0xee2f('0x56')]=_0x53d769+0x1;_0x16326e['push'](validateUser(_0x2c14f[_0x1422e9]));}return BPromise['all'](_0x16326e);})[_0xee2f('0xf')](function(){_0x16326e=[];for(var _0x48fe47=0x0;_0x48fe47<_0x2c14f['length'];_0x48fe47++){_0x16326e['push'](updateUser(_0x2c14f[_0x48fe47]));}return BPromise[_0xee2f('0x7f')](_0x16326e);})[_0xee2f('0xf')](function(){return BPromise[_0xee2f('0x80')](_0x2c14f,function(_0x172cee){return db['User'][_0xee2f('0x76')](_0x172cee,{'include':[{'model':db[_0xee2f('0x64')],'as':_0xee2f('0x64')}]})['then'](function(_0x20e5db){_0x172cee['id']=_0x20e5db['id'];return _0x172cee;});});})['then'](function(_0x150445){if(_0x346fc2['body']['role']===_0xee2f('0x70'))return _0x150445;if(_0x346fc2['user'][_0xee2f('0x26')]!=='user')return _0x150445;var _0x4e585b=_[_0xee2f('0x7c')](_0x150445,function(_0x20bc03){return _0x20bc03['role']===_0xee2f('0x29')||_0x20bc03[_0xee2f('0x26')]==='telephone';});if(!_0x4e585b)return _0x150445;return db['UserProfileSection'][_0xee2f('0x3c')]({'where':{'name':{'$or':[_0xee2f('0x28'),'Telephones']},'userProfileId':_0x346fc2[_0xee2f('0x70')][_0xee2f('0x75')]},'raw':!![]})[_0xee2f('0xf')](function(_0x2238c2){if(_[_0xee2f('0x81')](_0x2238c2)||!_['some'](_0x2238c2,['autoAssociation',0x0]))return _0x150445;_0x16326e=[];var _0x567de2=_(_0x2238c2)[_0xee2f('0x2b')](function(_0x1fe927){if(_0x1fe927[_0xee2f('0x82')]===0x1)return;return _0x1fe927[_0xee2f('0x2f')]===_0xee2f('0x28')?_0xee2f('0x29'):_0xee2f('0x2a');})[_0xee2f('0x83')]()[_0xee2f('0x2c')]();for(var _0x173f5f=0x0;_0x173f5f<_0x150445[_0xee2f('0x3f')];_0x173f5f++){if(!_[_0xee2f('0x2d')](_0x567de2,_0x150445[_0x173f5f][_0xee2f('0x26')]))return;var _0x470780=_0x150445[_0x173f5f][_0xee2f('0x26')]===_0xee2f('0x29')?'Agents':'Telephones';_0x16326e[_0xee2f('0x3b')](db[_0xee2f('0x79')]['create']({'name':_0x150445[_0x173f5f][_0xee2f('0x2f')],'resourceId':_0x150445[_0x173f5f]['id'],'type':_0x470780,'sectionId':_[_0xee2f('0x2e')](_0x2238c2,[_0xee2f('0x2f'),_0x470780])['id']},{}));}return BPromise['all'](_0x16326e);});})[_0xee2f('0xf')](respondWithResult(_0x413340,0xc9))[_0xee2f('0x18')](handleError(_0x413340,null));};exports[_0xee2f('0x84')]=function(_0x609bd9,_0x1954b5){if(_0x609bd9[_0xee2f('0x50')]['id']){delete _0x609bd9[_0xee2f('0x50')]['id'];}return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x609bd9['params']['id']}})[_0xee2f('0xf')](function(_0x16b101){if(!_0x16b101)return null;if(_0x16b101['id']===_0x609bd9[_0xee2f('0x70')]['id']){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]||!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x88'));}if(!_0x16b101[_0xee2f('0x89')](_0x609bd9['body'][_0xee2f('0x85')])){throw new db['Sequelize']['ValidationError'](_0xee2f('0x8a'));}if(_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]===_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x8b'));}}else if(_0x609bd9[_0xee2f('0x70')]['role']===_0xee2f('0x71')){if(!_0x609bd9[_0xee2f('0x50')]['newPassword']){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}}else if(_0x609bd9[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x70')){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}if(_0x16b101[_0xee2f('0x26')]!=='agent'){throw new db[(_0xee2f('0x87'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize'][(_0xee2f('0x8c'))]('Unauthorized');}return _0x16b101;})[_0xee2f('0xf')](handleEntityNotFound(_0x1954b5,null))[_0xee2f('0xf')](function(_0x344a3a){return db['Setting'][_0xee2f('0x8e')]({'attributes':['id',_0xee2f('0x59'),'enforcePasswordHistory',_0xee2f('0x8f')]})[_0xee2f('0xf')](function(_0x392446){if(_0x392446[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]);if(!_0x392446['enforcePasswordHistory']||!_0x344a3a[_0xee2f('0x90')])return _0x344a3a;authService[_0xee2f('0x91')](_0x609bd9['body'][_0xee2f('0x86')],_0x344a3a[_0xee2f('0x90')],_0x392446[_0xee2f('0x8f')]);return _0x344a3a;})['then'](saveUpdates({'password':_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')],'passwordResetAt':_0x609bd9[_0xee2f('0x70')]['id']==_0x609bd9[_0xee2f('0x52')]['id']?moment():null,'previousPasswords':authService[_0xee2f('0x92')](_0x609bd9[_0xee2f('0x50')]['newPassword'],_0x344a3a[_0xee2f('0x90')])},null));})[_0xee2f('0xf')](respondWithResult(_0x1954b5,null))[_0xee2f('0x18')](handleError(_0x1954b5,null));};exports['addQueues']=function(_0x50670a,_0xd39c00){var _0x52bb33=_0x50670a[_0xee2f('0x50')][_0xee2f('0x93')];return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x50670a[_0xee2f('0x52')]['id']},'attributes':['id','name','role',_0xee2f('0x94'),_0xee2f('0x95'),'voicePause',_0xee2f('0x96')]})[_0xee2f('0xf')](handleEntityNotFound(_0xd39c00,null))[_0xee2f('0xf')](function(_0xd98eab){if(_0xd98eab){if(!utils['isValidChannel'](_0x52bb33)){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0xd98eab['add'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x50670a[_0xee2f('0x50')]['ids'],{'penalty':_0x50670a['body'][_0xee2f('0x9b')]||0x0})[_0xee2f('0x9c')](function(_0x1fff43){for(var _0x56abfb=0x0;_0x56abfb<_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]['length'];_0x56abfb+=0x1){var _0x969efe={'UserId':Number(_0x50670a[_0xee2f('0x52')]['id'])};_0x969efe[_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')][_0x56abfb]);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9f'),_0x969efe);}return _0x1fff43;})['then'](function(){if(_0x52bb33===_0xee2f('0xa0')){return db[_0xee2f('0xa1')][_0xee2f('0x3c')]({'where':{'id':_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]||[]},'raw':!![],'attributes':['id',_0xee2f('0x2f')]});}})[_0xee2f('0xf')](function(_0x3a71fa){var _0x298dfa=_0xd98eab[_0xee2f('0x25')]({'plain':!![]});var _0x2bf351=[];if(_0x52bb33===_0xee2f('0xa0')&&_0x298dfa['role']===_0xee2f('0x29')&&_0x298dfa['online']){for(var _0xc1d07e=0x0;_0xc1d07e<_0x3a71fa[_0xee2f('0x3f')];_0xc1d07e+=0x1){_0x2bf351['push']({'membername':_0x298dfa[_0xee2f('0x2f')],'UserId':_0x298dfa['id'],'queue_name':_0x3a71fa[_0xc1d07e][_0xee2f('0x2f')],'VoiceQueueId':_0x3a71fa[_0xc1d07e]['id'],'interface':_[_0xee2f('0x5c')](_0x298dfa[_0xee2f('0x96')])?util[_0xee2f('0xa2')](_0xee2f('0xa3'),_0x298dfa['name']):_0x298dfa[_0xee2f('0x96')],'paused':_0x298dfa[_0xee2f('0xa4')]||![],'penalty':_0x50670a[_0xee2f('0x50')][_0xee2f('0x9b')]||0x0});}return BPromise[_0xee2f('0x80')](_0x2bf351,function(_0x31b0f7){return db[_0xee2f('0xa5')][_0xee2f('0xa6')](_0x31b0f7);});}return _0xd98eab;});}})[_0xee2f('0xf')](respondWithStatusCode(_0xd39c00,null))[_0xee2f('0x18')](handleError(_0xd39c00,null));};exports['removeQueues']=function(_0x1d4d12,_0x3ab6c7){var _0x37ebf7;return db['User']['find']({'where':{'id':_0x1d4d12[_0xee2f('0x52')]['id']},'attributes':['id',_0xee2f('0x2f'),_0xee2f('0x26')]})[_0xee2f('0xf')](handleEntityNotFound(_0x3ab6c7,null))[_0xee2f('0xf')](function(_0x4a91ca){if(_0x4a91ca){_0x37ebf7=_0x4a91ca;if(!_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')]||!utils['isValidChannel'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')])){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0x4a91ca[_0xee2f('0xa7')+_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')]);}})[_0xee2f('0xf')](function(_0x2bd952){if(_[_0xee2f('0xa8')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')])){for(var _0x5010eb=0x0;_0x5010eb<_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')][_0xee2f('0x3f')];_0x5010eb+=0x1){var _0x11e4f5={'UserId':Number(_0x1d4d12[_0xee2f('0x52')]['id'])};_0x11e4f5[_[_0xee2f('0x98')](_0x1d4d12['query'][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x1d4d12[_0xee2f('0x4a')]['ids'][_0x5010eb]);socket[_0xee2f('0x9e')](_0xee2f('0x70')+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0xa9'),_0x11e4f5);}}else{var _0x11e4f5={'UserId':Number(_0x1d4d12['params']['id'])};_0x11e4f5[_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+'QueueId']=Number(_0x1d4d12[_0xee2f('0x4a')]['ids']);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')]['channel'][_0xee2f('0x99')]())+'Queue:remove',_0x11e4f5);}return _0x2bd952;})[_0xee2f('0xf')](function(){if(_0x1d4d12['query'][_0xee2f('0x93')]===_0xee2f('0xa0')){return db[_0xee2f('0xa5')][_0xee2f('0x24')]({'where':{'UserId':_0x1d4d12[_0xee2f('0x52')]['id'],'VoiceQueueId':_0x1d4d12['query'][_0xee2f('0x54')]},'individualHooks':!![]})[_0xee2f('0xf')](function(){return _0x37ebf7;});}return _0x37ebf7;})[_0xee2f('0xf')](respondWithStatusCode(_0x3ab6c7,null))[_0xee2f('0x18')](handleError(_0x3ab6c7,null));};exports[_0xee2f('0xaa')]=function(_0x73e99a,_0x55f1bd){_0x73e99a[_0xee2f('0x50')][_0xee2f('0xab')]=_0x73e99a[_0xee2f('0xac')]['filename'];return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x73e99a[_0xee2f('0x52')]['id']}})[_0xee2f('0xf')](handleEntityNotFound(_0x55f1bd,null))[_0xee2f('0xf')](saveUpdates(_0x73e99a[_0xee2f('0x50')],null))[_0xee2f('0xf')](respondWithResult(_0x55f1bd,null))[_0xee2f('0x18')](handleError(_0x55f1bd,null));};exports[_0xee2f('0xad')]=function(_0x2dc4ff,_0x351e10){var _0x3f0ef6=path['join'](config[_0xee2f('0xae')],'server/files/images/logos/default_profile.png');return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x2dc4ff['params']['id']},'attributes':['id',_0xee2f('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0x351e10,null))[_0xee2f('0xf')](function(_0x34a358){if(_0x34a358){if(_[_0xee2f('0x5c')](_0x34a358[_0xee2f('0xab')])){return _0x351e10['download'](_0x3f0ef6);}else{if(!fs[_0xee2f('0xaf')](path[_0xee2f('0xb0')](config[_0xee2f('0xae')],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]))){return _0x351e10[_0xee2f('0xb2')](_0x3f0ef6);}return _0x351e10['download'](path[_0xee2f('0xb0')](config['root'],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]));}}})['catch'](handleError(_0x351e10,null));};exports[_0xee2f('0xb3')]=function(_0x44c1a8,_0x4b9d27){return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x44c1a8[_0xee2f('0x52')]['id']},'attributes':['id']})[_0xee2f('0xf')](handleEntityNotFound(_0x4b9d27,null))[_0xee2f('0xf')](function(_0x2f5a60){var _0x33182c=[];values=_0x2f5a60['dataValues'];_0x33182c[_0xee2f('0x3b')](get_open_tabs('chat',_0x2f5a60['dataValues']));_0x33182c['push'](get_open_tabs(_0xee2f('0x43'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x2f5a60[_0xee2f('0x42')]));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0x2f5a60[_0xee2f('0x42')]));return BPromise[_0xee2f('0x7f')](_0x33182c);})[_0xee2f('0xf')](function(_0x1cbce0){var _0x6e5a1d=[];if(_0x1cbce0){for(var _0xf2d880=0x0;_0xf2d880=_0x3e4dee[_0x6fc6('0x50')]){throw new Error(_0x6fc6('0x51'));}})['then'](function(){if(_0x44a019){return db[_0x6fc6('0x3e')]['destroy']({'where':{'membername':_0x44a019[_0x6fc6('0x26')]},'individualHooks':!![]});}})[_0x6fc6('0xe')](function(){if(_0x44a019){return _0x44a019[_0x6fc6('0x52')]({'raw':!![]});}})[_0x6fc6('0xe')](function(_0xdce0c7){if(_0x44a019){if(_0xdce0c7){var _0x35f269=[];_0x1dcc50=_0xdce0c7;if(_0x1dcc50[_0x6fc6('0x2b')]){for(var _0x4d6c21=0x0;_0x4d6c21<_0x1dcc50['length'];_0x4d6c21++){_0x35f269[_0x6fc6('0x47')](db[_0x6fc6('0x3e')][_0x6fc6('0x53')]({'membername':_0x44a019['name'],'UserId':_0x44a019['id'],'queue_name':_0x1dcc50[_0x4d6c21]['name'],'VoiceQueueId':_0x1dcc50[_0x4d6c21]['id'],'interface':_0x5d4930,'paused':_0x44a019[_0x6fc6('0x4d')]||![],'penalty':_0x1dcc50[_0x4d6c21][_0x6fc6('0x54')]||0x0}));}return BPromise['all'](_0x35f269);}}}})['then'](function(){if(_0x44a019){return db[_0x6fc6('0x29')][_0x6fc6('0x17')]({'where':{'membername':_0x44a019[_0x6fc6('0x26')],'exitAt':null}});}})['then'](function(_0x34fd0d){if(_0x44a019){if(_0x34fd0d&&_0x34fd0d['length']){var _0x1999c6=[];_0x34fd0d[_0x6fc6('0x30')](function(_0x4b92e2){_0x1999c6[_0x6fc6('0x47')](_0x4b92e2[_0x6fc6('0x3f')]({'exitAt':moment()[_0x6fc6('0x2c')](_0x6fc6('0x2d'))}));});return BPromise['all'](_0x1999c6);}}})[_0x6fc6('0xe')](function(_0x2cf800){if(_0x44a019){var _0xf22fee=[];var _0x39d528=[];var _0x1c16f6=utils[_0x6fc6('0x2f')]();var _0x391bcf={'membername':_0x44a019['name'],'interface':_0x5d4930,'enterAt':moment()[_0x6fc6('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x44a019[_0x6fc6('0x27')],'internal':_0x44a019[_0x6fc6('0x28')]};_0x1c16f6[_0x6fc6('0x30')](function(_0x2bfa15){_0xf22fee['push'](_['merge']({'channel':_0x2bfa15,'type':_0x6fc6('0x55'),'data1':_0x6fc6('0x56'),'data2':_0x5d4930},_0x391bcf));if(_0x44a019[_0x6fc6('0x4d')]){_0x39d528[_0x6fc6('0x47')](_[_0x6fc6('0x57')]({'channel':_0x2bfa15,'type':'PAUSE','data1':_0x6fc6('0x58')},_0x391bcf));}});return db[_0x6fc6('0x29')]['bulkCreate'](_0xf22fee[_0x6fc6('0x59')](_0x39d528),{'individualHooks':!![]});}})[_0x6fc6('0xe')](function(){if(_0x44a019){return _0x44a019[_0x6fc6('0x3f')]({'online':!![],'lastLoginAt':moment()['format'](_0x6fc6('0x2d')),'voicePause':_0x44a019[_0x6fc6('0x4d')]||![],'mailPause':_0x44a019[_0x6fc6('0x4d')]||![],'chatPause':_0x44a019[_0x6fc6('0x4d')]||![],'faxPause':_0x44a019['loginInPause']||![],'smsPause':_0x44a019[_0x6fc6('0x4d')]||![],'openchannelPause':_0x44a019[_0x6fc6('0x4d')]||![],'pauseType':_0x44a019[_0x6fc6('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x6fc6('0x2c')](_0x6fc6('0x2d')),'interface':_0x5d4930});}})['then'](function(_0x3dafad){_0x5b3e34(_0x3dafad);})[_0x6fc6('0x21')](function(_0x1f087b){_0x14d1bd(_0x42969f[_0x6fc6('0x11')](0x1f4,_0x1f087b[_0x6fc6('0x14')]));});});}; \ No newline at end of file +var _0x9269=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','stringify','error','User,\x20%s,\x20%s','message','info','result','catch','GetUser','findAll','options','raw','where','attributes','include','model','map','debug','ShowUser','User','find','PauseUser','role','internal','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','interface','format','SIP/%s','type','DEFAULT\x20PAUSE','uniqueid','body','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','push','all','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x21ada5,_0x5ed209){var _0x7b36ac=function(_0xcf88bd){while(--_0xcf88bd){_0x21ada5['push'](_0x21ada5['shift']());}};_0x7b36ac(++_0x5ed209);}(_0x9269,0xb2));var _0x9926=function(_0x242e41,_0x2beb78){_0x242e41=_0x242e41-0x0;var _0x171510=_0x9269[_0x242e41];return _0x171510;};'use strict';var _=require(_0x9926('0x0'));var util=require(_0x9926('0x1'));var moment=require(_0x9926('0x2'));var BPromise=require(_0x9926('0x3'));var rs=require(_0x9926('0x4'));var fs=require('fs');var Redis=require(_0x9926('0x5'));var db=require(_0x9926('0x6'))['db'];var utils=require(_0x9926('0x7'));var logger=require(_0x9926('0x8'))(_0x9926('0x9'));var config=require('../../config/environment');var jayson=require(_0x9926('0xa'));var client=jayson['client'][_0x9926('0xb')]({'port':0x232a});config[_0x9926('0xc')]=_[_0x9926('0xd')](config[_0x9926('0xc')],{'host':_0x9926('0xe'),'port':0x18eb});var socket=require(_0x9926('0xf'))(new Redis(config[_0x9926('0xc')]));require('./user.socket')[_0x9926('0x10')](socket);function respondWithRpcPromise(_0x777f7a,_0x219062,_0x2f9cb6){return new BPromise(function(_0x581cd7,_0x4ddb8f){return client[_0x9926('0x11')](_0x777f7a,_0x2f9cb6)[_0x9926('0x12')](function(_0x42b4e8){logger['info']('User,\x20%s,\x20%s',_0x219062,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x219062,_0x9926('0x13'),JSON[_0x9926('0x14')](_0x42b4e8));if(_0x42b4e8['error']){if(_0x42b4e8[_0x9926('0x15')]['code']===0x1f4){logger['error'](_0x9926('0x16'),_0x219062,_0x42b4e8[_0x9926('0x15')][_0x9926('0x17')]);return _0x4ddb8f(_0x42b4e8[_0x9926('0x15')][_0x9926('0x17')]);}logger[_0x9926('0x15')](_0x9926('0x16'),_0x219062,_0x42b4e8[_0x9926('0x15')][_0x9926('0x17')]);return _0x581cd7(_0x42b4e8[_0x9926('0x15')][_0x9926('0x17')]);}else{logger[_0x9926('0x18')]('User,\x20%s,\x20%s',_0x219062,_0x9926('0x13'));_0x581cd7(_0x42b4e8[_0x9926('0x19')]['message']);}})[_0x9926('0x1a')](function(_0x1708f9){logger[_0x9926('0x15')]('User,\x20%s,\x20%s',_0x219062,_0x1708f9);_0x4ddb8f(_0x1708f9);});});}exports[_0x9926('0x1b')]=function(_0x3ae66f){var _0x427a97=this;return new Promise(function(_0x2c6a15,_0x2add1d){return db['User'][_0x9926('0x1c')]({'raw':_0x3ae66f[_0x9926('0x1d')]?_0x3ae66f[_0x9926('0x1d')][_0x9926('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ae66f[_0x9926('0x1d')]?_0x3ae66f[_0x9926('0x1d')][_0x9926('0x1f')]||null:null,'attributes':_0x3ae66f[_0x9926('0x1d')]?_0x3ae66f['options'][_0x9926('0x20')]||null:null,'limit':_0x3ae66f[_0x9926('0x1d')]?_0x3ae66f[_0x9926('0x1d')]['limit']||null:null,'include':_0x3ae66f[_0x9926('0x1d')]?_0x3ae66f[_0x9926('0x1d')]['include']?_['map'](_0x3ae66f['options'][_0x9926('0x21')],function(_0x52e29f){return{'model':db[_0x52e29f[_0x9926('0x22')]],'as':_0x52e29f['as'],'attributes':_0x52e29f[_0x9926('0x20')],'include':_0x52e29f['include']?_['map'](_0x52e29f[_0x9926('0x21')],function(_0x4543c3){return{'model':db[_0x4543c3[_0x9926('0x22')]],'as':_0x4543c3['as'],'attributes':_0x4543c3[_0x9926('0x20')],'include':_0x4543c3[_0x9926('0x21')]?_[_0x9926('0x23')](_0x4543c3[_0x9926('0x21')],function(_0x379eae){return{'model':db[_0x379eae['model']],'as':_0x379eae['as'],'attributes':_0x379eae[_0x9926('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9926('0x12')](function(_0x43430c){logger[_0x9926('0x18')]('GetUser',_0x3ae66f);logger[_0x9926('0x24')](_0x9926('0x1b'),_0x3ae66f,JSON[_0x9926('0x14')](_0x43430c));_0x2c6a15(_0x43430c);})[_0x9926('0x1a')](function(_0x50e6e2){logger[_0x9926('0x15')](_0x9926('0x1b'),_0x50e6e2[_0x9926('0x17')],_0x3ae66f);_0x2add1d(_0x427a97[_0x9926('0x15')](0x1f4,_0x50e6e2[_0x9926('0x17')]));});});};exports[_0x9926('0x25')]=function(_0xd1afbe){var _0x1b00c7=this;return new Promise(function(_0x17f5e5,_0x11d1d3){return db[_0x9926('0x26')][_0x9926('0x27')]({'raw':_0xd1afbe[_0x9926('0x1d')]?_0xd1afbe['options'][_0x9926('0x1e')]===undefined?!![]:![]:!![],'where':_0xd1afbe[_0x9926('0x1d')]?_0xd1afbe[_0x9926('0x1d')]['where']||null:null,'attributes':_0xd1afbe['options']?_0xd1afbe[_0x9926('0x1d')][_0x9926('0x20')]||null:null,'include':_0xd1afbe[_0x9926('0x1d')]?_0xd1afbe[_0x9926('0x1d')][_0x9926('0x21')]?_[_0x9926('0x23')](_0xd1afbe[_0x9926('0x1d')]['include'],function(_0x29124b){return{'model':db[_0x29124b[_0x9926('0x22')]],'as':_0x29124b['as'],'attributes':_0x29124b[_0x9926('0x20')],'include':_0x29124b[_0x9926('0x21')]?_[_0x9926('0x23')](_0x29124b[_0x9926('0x21')],function(_0x21ec2c){return{'model':db[_0x21ec2c['model']],'as':_0x21ec2c['as'],'attributes':_0x21ec2c[_0x9926('0x20')],'include':_0x21ec2c[_0x9926('0x21')]?_[_0x9926('0x23')](_0x21ec2c[_0x9926('0x21')],function(_0x1d1bdc){return{'model':db[_0x1d1bdc['model']],'as':_0x1d1bdc['as'],'attributes':_0x1d1bdc[_0x9926('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9926('0x12')](function(_0x4d555d){logger[_0x9926('0x18')](_0x9926('0x25'),_0xd1afbe);logger[_0x9926('0x24')]('ShowUser',_0xd1afbe,JSON[_0x9926('0x14')](_0x4d555d));_0x17f5e5(_0x4d555d);})[_0x9926('0x1a')](function(_0x43a98d){logger[_0x9926('0x15')](_0x9926('0x25'),_0x43a98d[_0x9926('0x17')],_0xd1afbe);_0x11d1d3(_0x1b00c7[_0x9926('0x15')](0x1f4,_0x43a98d[_0x9926('0x17')]));});});};exports[_0x9926('0x28')]=function(_0x413607){var _0x32bf92=this;return new Promise(function(_0x591557,_0x2aa029){var _0x4d2fc0;return db[_0x9926('0x26')][_0x9926('0x27')]({'where':_0x413607['options'][_0x9926('0x1f')]||{},'attributes':['id','name',_0x9926('0x29'),_0x9926('0x2a'),'interface']})[_0x9926('0x12')](function(_0x5734a9){if(_0x5734a9){_0x4d2fc0=_0x5734a9;return db[_0x9926('0x2b')][_0x9926('0x2c')]({'paused':0x1},{'where':{'UserId':_0x4d2fc0['id']},'individualHooks':!![]});}})[_0x9926('0x12')](function(){if(_0x4d2fc0){return db[_0x9926('0x2d')][_0x9926('0x1c')]({'where':{'membername':_0x4d2fc0[_0x9926('0x2e')],'type':_0x9926('0x2f'),'exitAt':null}});}})[_0x9926('0x12')](function(_0x4f9c48){if(_0x4d2fc0){if(_0x4f9c48&&_0x4f9c48[_0x9926('0x30')]){var _0x466e3f=moment()['format'](_0x9926('0x31'));for(var _0x444262=0x0,_0xaaa38a=_0x4f9c48[_0x9926('0x30')];_0x444262<_0xaaa38a;_0x444262++){_0x4f9c48[_0x444262][_0x9926('0x32')]({'exitAt':_0x466e3f});}}}})[_0x9926('0x12')](function(){if(_0x4d2fc0){var _0x5a26e5=[];var _0x41783f=utils['getChannels']();_0x41783f[_0x9926('0x33')](function(_0x3c2888){_0x5a26e5['push']({'channel':_0x3c2888,'membername':_0x4d2fc0['name'],'interface':_[_0x9926('0x34')](_0x4d2fc0[_0x9926('0x35')])?util[_0x9926('0x36')](_0x9926('0x37'),_0x4d2fc0[_0x9926('0x2e')]):_0x4d2fc0[_0x9926('0x35')],'type':_0x9926('0x2f'),'enterAt':moment()[_0x9926('0x36')](_0x9926('0x31')),'data1':_0x413607['body'][_0x9926('0x38')]||_0x9926('0x39'),'role':_0x4d2fc0['role'],'internal':_0x4d2fc0[_0x9926('0x2a')],'uniqueid':_0x413607['body'][_0x9926('0x3a')]||null});});return db['MemberReport']['bulkCreate'](_0x5a26e5,{'individualHooks':!![]});}})[_0x9926('0x12')](function(){if(_0x4d2fc0){return _0x4d2fc0[_0x9926('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x413607[_0x9926('0x3b')][_0x9926('0x38')]||_0x9926('0x39'),'lastPauseAt':moment()[_0x9926('0x36')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9926('0x12')](function(_0x1632d6){_0x591557(_0x1632d6);})[_0x9926('0x1a')](function(_0x36fafa){_0x2aa029(_0x32bf92['error'](0x1f4,_0x36fafa['message']));});});};exports['UnpauseUser']=function(_0x264835){var _0x37d383=this;return new Promise(function(_0x4ab5ac,_0x4185d0){var _0x36c7d1;return db[_0x9926('0x26')][_0x9926('0x3c')]({'where':_0x264835[_0x9926('0x1d')][_0x9926('0x1f')]||{},'attributes':['id',_0x9926('0x2e')]})['then'](function(_0x101166){if(_0x101166){_0x36c7d1=_0x101166;if(_0x264835['body'][_0x9926('0x3d')]&&!utils[_0x9926('0x3e')](_0x264835['body'][_0x9926('0x3d')])){throw new Error(_0x9926('0x3f'));}switch(_0x264835[_0x9926('0x3b')][_0x9926('0x3d')]){case _0x9926('0x40'):return db[_0x9926('0x2b')][_0x9926('0x2c')]({'paused':0x0},{'where':{'UserId':_0x36c7d1['id']}})[_0x9926('0x12')](function(){return db[_0x9926('0x2d')][_0x9926('0x27')]({'where':{'channel':_0x264835['body'][_0x9926('0x3d')],'membername':_0x36c7d1[_0x9926('0x2e')],'type':'PAUSE','exitAt':null}});})[_0x9926('0x12')](function(_0x1ea2a1){if(_0x1ea2a1){return _0x1ea2a1['update']({'exitAt':moment()[_0x9926('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9926('0x41')},{'individualHooks':!![]});}return null;})[_0x9926('0x12')](function(){return _0x36c7d1[_0x9926('0x2c')]({'voicePause':![]});});case _0x9926('0x42'):case _0x9926('0x43'):case _0x9926('0x44'):case _0x9926('0x45'):case _0x9926('0x46'):case _0x9926('0x47'):return db[_0x9926('0x2d')][_0x9926('0x27')]({'where':{'channel':_0x264835[_0x9926('0x3b')][_0x9926('0x3d')],'membername':_0x36c7d1[_0x9926('0x2e')],'type':_0x9926('0x2f'),'exitAt':null}})[_0x9926('0x12')](function(_0x15da10){return _0x15da10['update']({'exitAt':moment()[_0x9926('0x36')](_0x9926('0x31')),'data2':'system'},{'individualHooks':!![]});})[_0x9926('0x12')](function(){var _0x296817={};_[_0x9926('0x48')](_0x296817,util[_0x9926('0x36')](_0x9926('0x49'),_0x264835[_0x9926('0x3b')][_0x9926('0x3d')],_0x9926('0x4a')),![]);return _0x36c7d1[_0x9926('0x2c')](_0x296817);});default:return db[_0x9926('0x2b')][_0x9926('0x2c')]({'paused':0x0},{'where':{'UserId':_0x36c7d1['id']}})[_0x9926('0x12')](function(){return db['MemberReport'][_0x9926('0x1c')]({'where':{'membername':_0x36c7d1[_0x9926('0x2e')],'type':_0x9926('0x2f'),'exitAt':null}});})[_0x9926('0x12')](function(_0x282c1b){var _0x493008=[];_0x282c1b[_0x9926('0x33')](function(_0x36eadc){_0x493008[_0x9926('0x4b')](_0x36eadc[_0x9926('0x2c')]({'exitAt':moment()[_0x9926('0x36')](_0x9926('0x31')),'data2':_0x9926('0x41')}));});return BPromise[_0x9926('0x4c')](_0x493008);})[_0x9926('0x12')](function(){return _0x36c7d1[_0x9926('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x9926('0x12')](function(_0x410cbf){_0x4ab5ac(_0x410cbf);})[_0x9926('0x1a')](function(_0x5e6d26){_0x4185d0(_0x37d383['error'](0x1f4,_0x5e6d26[_0x9926('0x17')]));});});};exports['LogoutUser']=function(_0x14c6ad){var _0x1f6926=this;return new Promise(function(_0xe93802,_0xcbd1f6){var _0x338a96;return db[_0x9926('0x26')][_0x9926('0x3c')]({'where':_0x14c6ad[_0x9926('0x1d')][_0x9926('0x1f')]||{},'attributes':['id',_0x9926('0x2e')]})[_0x9926('0x12')](function(_0x2c1e02){if(_0x2c1e02){_0x338a96=_0x2c1e02;return db[_0x9926('0x2b')]['destroy']({'where':{'membername':_0x338a96['name']},'individualHooks':!![]});}})[_0x9926('0x12')](function(){if(_0x338a96){return db['MemberReport']['findAll']({'where':{'membername':_0x338a96[_0x9926('0x2e')],'exitAt':null}});}})[_0x9926('0x12')](function(_0x451fdf){if(_0x338a96){if(_0x451fdf&&_0x451fdf[_0x9926('0x30')]){var _0xcb6c1d=[];_0x451fdf[_0x9926('0x33')](function(_0x2fb08c){_0xcb6c1d['push'](_0x2fb08c[_0x9926('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0xcb6c1d);}}})['then'](function(){if(_0x338a96){return _0x338a96[_0x9926('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9926('0x12')](function(_0x5b89ea){_0xe93802(_0x5b89ea);})[_0x9926('0x1a')](function(_0x27b87d){_0xcbd1f6(_0x1f6926[_0x9926('0x15')](0x1f4,_0x27b87d[_0x9926('0x17')]));});});};exports[_0x9926('0x4d')]=function(_0x764b61){var _0x57e76c=this;return new Promise(function(_0x12b947,_0x1ddae1){var _0x295469;var _0x554b88;var _0x431111;var _0x2b56bf;return db[_0x9926('0x26')][_0x9926('0x3c')]({'where':_0x764b61['options']['where']||{},'attributes':['id',_0x9926('0x2e'),'role','mobile','phone',_0x9926('0x2a'),_0x9926('0x4e'),_0x9926('0x35')]})['then'](function(_0x4266cf){if(_0x4266cf){_0x295469=_0x4266cf;_0x2b56bf=_0x764b61[_0x9926('0x3b')][_0x9926('0x35')]?_0x764b61[_0x9926('0x3b')]['interface']:util[_0x9926('0x36')](_0x9926('0x37'),_0x295469['name']);return db[_0x9926('0x26')][_0x9926('0x4f')]({'where':{'role':_0x9926('0x50'),'online':!![],'id':{'$ne':_0x295469['id']}}});}})[_0x9926('0x12')](function(_0x5b8489){if(_0x5b8489){_0x431111=_0x5b8489;return require(_0x9926('0x51'))['getLicense']();}})[_0x9926('0x12')](function(_0x70159){if(_0x70159&&_0x70159[_0x9926('0x52')]&&_0x431111>=_0x70159['agents']){throw new Error(_0x9926('0x53'));}})[_0x9926('0x12')](function(){if(_0x295469){return db[_0x9926('0x2b')][_0x9926('0x54')]({'where':{'membername':_0x295469['name']},'individualHooks':!![]});}})[_0x9926('0x12')](function(){if(_0x295469){return _0x295469['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x44da1f){if(_0x295469){if(_0x44da1f){var _0x2b63b2=[];_0x554b88=_0x44da1f;if(_0x554b88[_0x9926('0x30')]){for(var _0x9d13e0=0x0;_0x9d13e0<_0x554b88[_0x9926('0x30')];_0x9d13e0++){_0x2b63b2[_0x9926('0x4b')](db[_0x9926('0x2b')][_0x9926('0x55')]({'membername':_0x295469[_0x9926('0x2e')],'UserId':_0x295469['id'],'queue_name':_0x554b88[_0x9d13e0][_0x9926('0x2e')],'VoiceQueueId':_0x554b88[_0x9d13e0]['id'],'interface':_0x2b56bf,'paused':_0x295469['loginInPause']||![],'penalty':_0x554b88[_0x9d13e0][_0x9926('0x56')]||0x0}));}return BPromise[_0x9926('0x4c')](_0x2b63b2);}}}})['then'](function(){if(_0x295469){return db[_0x9926('0x2d')][_0x9926('0x1c')]({'where':{'membername':_0x295469[_0x9926('0x2e')],'exitAt':null}});}})['then'](function(_0x264104){if(_0x295469){if(_0x264104&&_0x264104[_0x9926('0x30')]){var _0x3ff926=[];_0x264104['forEach'](function(_0x38bd6f){_0x3ff926['push'](_0x38bd6f['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x9926('0x4c')](_0x3ff926);}}})[_0x9926('0x12')](function(_0x1128a7){if(_0x295469){var _0x4e52c8=[];var _0x635824=[];var _0x231a90=utils[_0x9926('0x57')]();var _0x54ee50={'membername':_0x295469[_0x9926('0x2e')],'interface':_0x2b56bf,'enterAt':moment()[_0x9926('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x295469[_0x9926('0x29')],'internal':_0x295469[_0x9926('0x2a')]};_0x231a90[_0x9926('0x33')](function(_0x5dd979){_0x4e52c8[_0x9926('0x4b')](_[_0x9926('0x58')]({'channel':_0x5dd979,'type':_0x9926('0x59'),'data1':_0x9926('0x5a'),'data2':_0x2b56bf},_0x54ee50));if(_0x295469[_0x9926('0x4e')]){_0x635824[_0x9926('0x4b')](_[_0x9926('0x58')]({'channel':_0x5dd979,'type':_0x9926('0x2f'),'data1':_0x9926('0x5b')},_0x54ee50));}});return db['MemberReport'][_0x9926('0x5c')](_0x4e52c8[_0x9926('0x5d')](_0x635824),{'individualHooks':!![]});}})['then'](function(){if(_0x295469){return _0x295469[_0x9926('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x9926('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x295469[_0x9926('0x4e')]||![],'mailPause':_0x295469['loginInPause']||![],'chatPause':_0x295469[_0x9926('0x4e')]||![],'faxPause':_0x295469[_0x9926('0x4e')]||![],'smsPause':_0x295469['loginInPause']||![],'openchannelPause':_0x295469[_0x9926('0x4e')]||![],'pauseType':_0x295469[_0x9926('0x4e')]?_0x9926('0x5b'):null,'lastPauseAt':moment()[_0x9926('0x36')](_0x9926('0x31')),'interface':_0x2b56bf});}})['then'](function(_0x138c30){_0x12b947(_0x138c30);})[_0x9926('0x1a')](function(_0x591b0c){_0x1ddae1(_0x57e76c[_0x9926('0x15')](0x1f4,_0x591b0c[_0x9926('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index e7c3a3b..7db1699 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 _0xfa43=['update','emit','register','length','user:','./user.events','remove'];(function(_0x5ae747,_0x5e807e){var _0x4e6b6c=function(_0x5bc3c5){while(--_0x5bc3c5){_0x5ae747['push'](_0x5ae747['shift']());}};_0x4e6b6c(++_0x5e807e);}(_0xfa43,0x178));var _0x3fa4=function(_0x89ae8e,_0x31b787){_0x89ae8e=_0x89ae8e-0x0;var _0x17d7d0=_0xfa43[_0x89ae8e];return _0x17d7d0;};'use strict';var UserEvents=require(_0x3fa4('0x0'));var events=['save',_0x3fa4('0x1'),_0x3fa4('0x2')];function createListener(_0x5db5b6,_0x695c7c){return function(_0x49a401){_0x695c7c[_0x3fa4('0x3')](_0x5db5b6,_0x49a401);};}function removeListener(_0xbaba93,_0x1cf259){return function(){UserEvents['removeListener'](_0xbaba93,_0x1cf259);};}exports[_0x3fa4('0x4')]=function(_0x34bf01){for(var _0x4e38f4=0x0,_0x1b067b=events[_0x3fa4('0x5')];_0x4e38f4<_0x1b067b;_0x4e38f4++){var _0x3d32f2=events[_0x4e38f4];var _0x4f3a6a=createListener(_0x3fa4('0x6')+_0x3d32f2,_0x34bf01);UserEvents['on'](_0x3d32f2,_0x4f3a6a);}}; \ No newline at end of file +var _0x6326=['./user.events','save','remove','update','emit','register','length','user:'];(function(_0x510202,_0x2adcfc){var _0x5b11cb=function(_0x1090a4){while(--_0x1090a4){_0x510202['push'](_0x510202['shift']());}};_0x5b11cb(++_0x2adcfc);}(_0x6326,0xa8));var _0x6632=function(_0x4b565e,_0x3ae39a){_0x4b565e=_0x4b565e-0x0;var _0x260fd2=_0x6326[_0x4b565e];return _0x260fd2;};'use strict';var UserEvents=require(_0x6632('0x0'));var events=[_0x6632('0x1'),_0x6632('0x2'),_0x6632('0x3')];function createListener(_0x5d0d15,_0x589b38){return function(_0x15c8b8){_0x589b38[_0x6632('0x4')](_0x5d0d15,_0x15c8b8);};}function removeListener(_0x3abc01,_0x457b7b){return function(){UserEvents['removeListener'](_0x3abc01,_0x457b7b);};}exports[_0x6632('0x5')]=function(_0x331e20){for(var _0x428157=0x0,_0x181481=events[_0x6632('0x6')];_0x428157<_0x181481;_0x428157++){var _0x55a3a3=events[_0x428157];var _0x47e304=createListener(_0x6632('0x7')+_0x55a3a3,_0x331e20);UserEvents['on'](_0x55a3a3,_0x47e304);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 52dc5e9..220339d 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2f470e,_0x41ea6a){var _0x3e2262=function(_0xb5e61f){while(--_0xb5e61f){_0x2f470e['push'](_0x2f470e['shift']());}};_0x3e2262(++_0x41ea6a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xcb91[_0x173452];return _0xee3fd0;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index d8fecd1..dc5c9c1 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 _0xd318=['sequelize','exports','INTEGER'];(function(_0x4f1737,_0x431b9f){var _0x173fcc=function(_0x452fd2){while(--_0x452fd2){_0x4f1737['push'](_0x4f1737['shift']());}};_0x173fcc(++_0x431b9f);}(_0xd318,0x75));var _0x8d31=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd318[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x8d31('0x0'));module[_0x8d31('0x1')]={'penalty':{'type':Sequelize[_0x8d31('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd6fb=['exports','INTEGER','sequelize'];(function(_0xe6922f,_0x29da89){var _0x386cb6=function(_0x5ccc92){while(--_0x5ccc92){_0xe6922f['push'](_0xe6922f['shift']());}};_0x386cb6(++_0x29da89);}(_0xd6fb,0x143));var _0xbd6f=function(_0x3855a7,_0x56aff7){_0x3855a7=_0x3855a7-0x0;var _0x556f4b=_0xd6fb[_0x3855a7];return _0x556f4b;};'use strict';var Sequelize=require(_0xbd6f('0x0'));module[_0xbd6f('0x1')]={'penalty':{'type':Sequelize[_0xbd6f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 55cb41a..29d1dc0 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 _0xaf61=['moment','bluebird','path','../../config/environment','define','user_has_chat_queues','util','api'];(function(_0x58032a,_0x466b28){var _0x24a4c5=function(_0x42f358){while(--_0x42f358){_0x58032a['push'](_0x58032a['shift']());}};_0x24a4c5(++_0x466b28);}(_0xaf61,0x96));var _0x1af6=function(_0x1e5008,_0x370329){_0x1e5008=_0x1e5008-0x0;var _0x55d11d=_0xaf61[_0x1e5008];return _0x55d11d;};'use strict';var _=require('lodash');var util=require(_0x1af6('0x0'));var logger=require('../../config/logger')(_0x1af6('0x1'));var moment=require(_0x1af6('0x2'));var BPromise=require(_0x1af6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1af6('0x4'));var rimraf=require('rimraf');var config=require(_0x1af6('0x5'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x3785b7,_0x270f24){return _0x3785b7[_0x1af6('0x6')]('UserChatQueue',attributes,{'tableName':_0x1af6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74b9=['exports','lodash','util','api','moment','bluebird','path','rimraf','./userChatQueue.attributes'];(function(_0x3f27b9,_0x444887){var _0xd80228=function(_0x591aed){while(--_0x591aed){_0x3f27b9['push'](_0x3f27b9['shift']());}};_0xd80228(++_0x444887);}(_0x74b9,0x9a));var _0x974b=function(_0x246d2c,_0x2c4de7){_0x246d2c=_0x246d2c-0x0;var _0x52487f=_0x74b9[_0x246d2c];return _0x52487f;};'use strict';var _=require(_0x974b('0x0'));var util=require(_0x974b('0x1'));var logger=require('../../config/logger')(_0x974b('0x2'));var moment=require(_0x974b('0x3'));var BPromise=require(_0x974b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x974b('0x5'));var rimraf=require(_0x974b('0x6'));var config=require('../../config/environment');var attributes=require(_0x974b('0x7'));module[_0x974b('0x8')]=function(_0x5a9108,_0x44cd26){return _0x5a9108['define']('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 bb4deb4..2217230 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 _0x6171=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3e6342,_0x2deb66){var _0x4dfd78=function(_0xacecef){while(--_0xacecef){_0x3e6342['push'](_0x3e6342['shift']());}};_0x4dfd78(++_0x2deb66);}(_0x6171,0x131));var _0x1617=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x6171[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x1617('0x0'));var util=require(_0x1617('0x1'));var moment=require(_0x1617('0x2'));var BPromise=require(_0x1617('0x3'));var rs=require(_0x1617('0x4'));var fs=require('fs');var Redis=require(_0x1617('0x5'));var db=require(_0x1617('0x6'))['db'];var utils=require(_0x1617('0x7'));var logger=require(_0x1617('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1617('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48dcd4,_0x53a993,_0x141965){return new BPromise(function(_0x554b62,_0x3fbe9b){return client[_0x1617('0xa')](_0x48dcd4,_0x141965)['then'](function(_0x2dd2ee){logger[_0x1617('0xb')](_0x1617('0xc'),_0x53a993,'request\x20sent');logger[_0x1617('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x53a993,_0x1617('0xe'),JSON[_0x1617('0xf')](_0x2dd2ee));if(_0x2dd2ee[_0x1617('0x10')]){if(_0x2dd2ee[_0x1617('0x10')][_0x1617('0x11')]===0x1f4){logger['error'](_0x1617('0xc'),_0x53a993,_0x2dd2ee['error'][_0x1617('0x12')]);return _0x3fbe9b(_0x2dd2ee[_0x1617('0x10')][_0x1617('0x12')]);}logger[_0x1617('0x10')](_0x1617('0xc'),_0x53a993,_0x2dd2ee[_0x1617('0x10')]['message']);return _0x554b62(_0x2dd2ee[_0x1617('0x10')][_0x1617('0x12')]);}else{logger[_0x1617('0xb')](_0x1617('0xc'),_0x53a993,_0x1617('0xe'));_0x554b62(_0x2dd2ee['result'][_0x1617('0x12')]);}})[_0x1617('0x13')](function(_0x477335){logger[_0x1617('0x10')](_0x1617('0xc'),_0x53a993,_0x477335);_0x3fbe9b(_0x477335);});});} \ No newline at end of file +var _0x7b87=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4554ff,_0x2ef0de){var _0x3ee466=function(_0x51d009){while(--_0x51d009){_0x4554ff['push'](_0x4554ff['shift']());}};_0x3ee466(++_0x2ef0de);}(_0x7b87,0x16e));var _0x77b8=function(_0xf1dbd8,_0x1cb2e1){_0xf1dbd8=_0xf1dbd8-0x0;var _0x5ee4be=_0x7b87[_0xf1dbd8];return _0x5ee4be;};'use strict';var _=require(_0x77b8('0x0'));var util=require(_0x77b8('0x1'));var moment=require('moment');var BPromise=require(_0x77b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b8('0x3'));var db=require(_0x77b8('0x4'))['db'];var utils=require(_0x77b8('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x77b8('0x6'));var client=jayson[_0x77b8('0x7')][_0x77b8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x579cec,_0x2b23ad,_0x531613){return new BPromise(function(_0x5a6e40,_0x9123df){return client[_0x77b8('0x9')](_0x579cec,_0x531613)[_0x77b8('0xa')](function(_0x42a346){logger[_0x77b8('0xb')](_0x77b8('0xc'),_0x2b23ad,_0x77b8('0xd'));logger[_0x77b8('0xe')](_0x77b8('0xf'),_0x2b23ad,_0x77b8('0xd'),JSON[_0x77b8('0x10')](_0x42a346));if(_0x42a346['error']){if(_0x42a346['error'][_0x77b8('0x11')]===0x1f4){logger['error'](_0x77b8('0xc'),_0x2b23ad,_0x42a346[_0x77b8('0x12')][_0x77b8('0x13')]);return _0x9123df(_0x42a346['error'][_0x77b8('0x13')]);}logger['error'](_0x77b8('0xc'),_0x2b23ad,_0x42a346[_0x77b8('0x12')]['message']);return _0x5a6e40(_0x42a346['error'][_0x77b8('0x13')]);}else{logger[_0x77b8('0xb')](_0x77b8('0xc'),_0x2b23ad,_0x77b8('0xd'));_0x5a6e40(_0x42a346['result'][_0x77b8('0x13')]);}})['catch'](function(_0x15c189){logger[_0x77b8('0x12')](_0x77b8('0xc'),_0x2b23ad,_0x15c189);_0x9123df(_0x15c189);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c5f16e5..464a0b6 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x55d283,_0x46088e){var _0x3e6010=function(_0x228b56){while(--_0x228b56){_0x55d283['push'](_0x55d283['shift']());}};_0x3e6010(++_0x46088e);}(_0xe706,0xa3));var _0x6e70=function(_0x56ea12,_0x304238){_0x56ea12=_0x56ea12-0x0;var _0x4b9883=_0xe706[_0x56ea12];return _0x4b9883;};'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(_0x2a6b55,_0x572485){var _0x3dd7fd=function(_0x52837f){while(--_0x52837f){_0x2a6b55['push'](_0x2a6b55['shift']());}};_0x3dd7fd(++_0x572485);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 7f2fa20..d869b0c 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 _0xf639=['sequelize','INTEGER'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf639,0x12e));var _0x9f63=function(_0x2f9cbc,_0x42cf1b){_0x2f9cbc=_0x2f9cbc-0x0;var _0xd91e8=_0xf639[_0x2f9cbc];return _0xd91e8;};'use strict';var Sequelize=require(_0x9f63('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9f63('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x601b=['exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x601b,0x123));var _0xb601=function(_0xb8b4a6,_0x588c86){_0xb8b4a6=_0xb8b4a6-0x0;var _0xcdfa2f=_0x601b[_0xb8b4a6];return _0xcdfa2f;};'use strict';var Sequelize=require('sequelize');module[_0xb601('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb601('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb601('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 47fe50a..85ef366 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 _0x82f2=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x50b658,_0xd3077f){var _0x484d1d=function(_0x15f39b){while(--_0x15f39b){_0x50b658['push'](_0x50b658['shift']());}};_0x484d1d(++_0xd3077f);}(_0x82f2,0x65));var _0x282f=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x82f2[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x282f('0x0'));var util=require(_0x282f('0x1'));var logger=require(_0x282f('0x2'))(_0x282f('0x3'));var moment=require(_0x282f('0x4'));var BPromise=require('bluebird');var rp=require(_0x282f('0x5'));var fs=require('fs');var path=require(_0x282f('0x6'));var rimraf=require(_0x282f('0x7'));var config=require(_0x282f('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x282f('0x9')]=function(_0x184fa8,_0x384bf8){return _0x184fa8[_0x282f('0xa')](_0x282f('0xb'),attributes,{'tableName':_0x282f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8819=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8819,0xac));var _0x9881=function(_0x949653,_0x1a2e29){_0x949653=_0x949653-0x0;var _0xdbe482=_0x8819[_0x949653];return _0xdbe482;};'use strict';var _=require(_0x9881('0x0'));var util=require(_0x9881('0x1'));var logger=require(_0x9881('0x2'))(_0x9881('0x3'));var moment=require('moment');var BPromise=require(_0x9881('0x4'));var rp=require(_0x9881('0x5'));var fs=require('fs');var path=require(_0x9881('0x6'));var rimraf=require('rimraf');var config=require(_0x9881('0x7'));var attributes=require(_0x9881('0x8'));module[_0x9881('0x9')]=function(_0x42662f,_0x1e21ee){return _0x42662f[_0x9881('0xa')](_0x9881('0xb'),attributes,{'tableName':_0x9881('0xc'),'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 f893a8c..430175f 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 _0x873f=['jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x873f,0x122));var _0xf873=function(_0xc869,_0x48ac46){_0xc869=_0xc869-0x0;var _0x5dee4a=_0x873f[_0xc869];return _0x5dee4a;};'use strict';var _=require('lodash');var util=require(_0xf873('0x0'));var moment=require(_0xf873('0x1'));var BPromise=require(_0xf873('0x2'));var rs=require(_0xf873('0x3'));var fs=require('fs');var Redis=require(_0xf873('0x4'));var db=require(_0xf873('0x5'))['db'];var utils=require(_0xf873('0x6'));var logger=require('../../config/logger')(_0xf873('0x7'));var config=require(_0xf873('0x8'));var jayson=require(_0xf873('0x9'));var client=jayson[_0xf873('0xa')][_0xf873('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22fcd6,_0x75205a,_0x190fde){return new BPromise(function(_0x578d24,_0x42c0b4){return client[_0xf873('0xc')](_0x22fcd6,_0x190fde)['then'](function(_0xcbeb68){logger[_0xf873('0xd')](_0xf873('0xe'),_0x75205a,_0xf873('0xf'));logger[_0xf873('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x75205a,_0xf873('0xf'),JSON[_0xf873('0x11')](_0xcbeb68));if(_0xcbeb68[_0xf873('0x12')]){if(_0xcbeb68[_0xf873('0x12')][_0xf873('0x13')]===0x1f4){logger[_0xf873('0x12')](_0xf873('0xe'),_0x75205a,_0xcbeb68[_0xf873('0x12')][_0xf873('0x14')]);return _0x42c0b4(_0xcbeb68[_0xf873('0x12')][_0xf873('0x14')]);}logger['error'](_0xf873('0xe'),_0x75205a,_0xcbeb68['error'][_0xf873('0x14')]);return _0x578d24(_0xcbeb68[_0xf873('0x12')][_0xf873('0x14')]);}else{logger[_0xf873('0xd')](_0xf873('0xe'),_0x75205a,'request\x20sent');_0x578d24(_0xcbeb68[_0xf873('0x15')]['message']);}})[_0xf873('0x16')](function(_0x515162){logger[_0xf873('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x75205a,_0x515162);_0x42c0b4(_0x515162);});});} \ No newline at end of file +var _0x0829=['then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x0829,0x113));var _0x9082=function(_0x475e2a,_0x3bcb5a){_0x475e2a=_0x475e2a-0x0;var _0x4e96aa=_0x0829[_0x475e2a];return _0x4e96aa;};'use strict';var _=require(_0x9082('0x0'));var util=require(_0x9082('0x1'));var moment=require(_0x9082('0x2'));var BPromise=require(_0x9082('0x3'));var rs=require(_0x9082('0x4'));var fs=require('fs');var Redis=require(_0x9082('0x5'));var db=require(_0x9082('0x6'))['db'];var utils=require(_0x9082('0x7'));var logger=require('../../config/logger')(_0x9082('0x8'));var config=require(_0x9082('0x9'));var jayson=require(_0x9082('0xa'));var client=jayson[_0x9082('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cbace,_0x3df468,_0x2c6323){return new BPromise(function(_0x2f7667,_0x14c00a){return client[_0x9082('0xc')](_0x2cbace,_0x2c6323)[_0x9082('0xd')](function(_0x541eff){logger[_0x9082('0xe')](_0x9082('0xf'),_0x3df468,'request\x20sent');logger[_0x9082('0x10')](_0x9082('0x11'),_0x3df468,_0x9082('0x12'),JSON[_0x9082('0x13')](_0x541eff));if(_0x541eff['error']){if(_0x541eff[_0x9082('0x14')][_0x9082('0x15')]===0x1f4){logger[_0x9082('0x14')](_0x9082('0xf'),_0x3df468,_0x541eff[_0x9082('0x14')][_0x9082('0x16')]);return _0x14c00a(_0x541eff[_0x9082('0x14')]['message']);}logger[_0x9082('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x3df468,_0x541eff[_0x9082('0x14')][_0x9082('0x16')]);return _0x2f7667(_0x541eff['error'][_0x9082('0x16')]);}else{logger[_0x9082('0xe')](_0x9082('0xf'),_0x3df468,_0x9082('0x12'));_0x2f7667(_0x541eff['result'][_0x9082('0x16')]);}})[_0x9082('0x17')](function(_0x11a28c){logger['error'](_0x9082('0xf'),_0x3df468,_0x11a28c);_0x14c00a(_0x11a28c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 08efac6..bd04e75 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x20b1ca,_0xcaa99b){var _0x13a457=function(_0x49b381){while(--_0x49b381){_0x20b1ca['push'](_0x20b1ca['shift']());}};_0x13a457(++_0xcaa99b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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(_0x5f3c49,_0x2c9716){var _0x5259ac=function(_0x54eb42){while(--_0x54eb42){_0x5f3c49['push'](_0x5f3c49['shift']());}};_0x5259ac(++_0x2c9716);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 0696749..b7acfb3 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 _0xf88f=['exports','INTEGER','sequelize'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xf88f,0x1bb));var _0xff88=function(_0x50d2fa,_0x18cb02){_0x50d2fa=_0x50d2fa-0x0;var _0xa22395=_0xf88f[_0x50d2fa];return _0xa22395;};'use strict';var Sequelize=require(_0xff88('0x0'));module[_0xff88('0x1')]={'penalty':{'type':Sequelize[_0xff88('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc3d6=['sequelize','exports','INTEGER'];(function(_0x5034ba,_0x1ba2cc){var _0x390eed=function(_0x4c5a2a){while(--_0x4c5a2a){_0x5034ba['push'](_0x5034ba['shift']());}};_0x390eed(++_0x1ba2cc);}(_0xc3d6,0x153));var _0x6c3d=function(_0x31f696,_0x223c9c){_0x31f696=_0x31f696-0x0;var _0x37d3a1=_0xc3d6[_0x31f696];return _0x37d3a1;};'use strict';var Sequelize=require(_0x6c3d('0x0'));module[_0x6c3d('0x1')]={'penalty':{'type':Sequelize[_0x6c3d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index b530258..d270317 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 _0xd2ce=['exports','UserMailQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes'];(function(_0x5358ba,_0x4cfc24){var _0xf0ff1a=function(_0x29d182){while(--_0x29d182){_0x5358ba['push'](_0x5358ba['shift']());}};_0xf0ff1a(++_0x4cfc24);}(_0xd2ce,0x115));var _0xed2c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xd2ce[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var logger=require(_0xed2c('0x1'))(_0xed2c('0x2'));var moment=require(_0xed2c('0x3'));var BPromise=require(_0xed2c('0x4'));var rp=require(_0xed2c('0x5'));var fs=require('fs');var path=require(_0xed2c('0x6'));var rimraf=require(_0xed2c('0x7'));var config=require('../../config/environment');var attributes=require(_0xed2c('0x8'));module[_0xed2c('0x9')]=function(_0x237ab5,_0x1a19ca){return _0x237ab5['define'](_0xed2c('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a20=['moment','bluebird','request-promise','rimraf','./userMailQueue.attributes','exports','UserMailQueue','lodash','util','../../config/logger'];(function(_0x87f2fc,_0x2d3133){var _0x3dce1b=function(_0x3c9124){while(--_0x3c9124){_0x87f2fc['push'](_0x87f2fc['shift']());}};_0x3dce1b(++_0x2d3133);}(_0x9a20,0x9d));var _0x09a2=function(_0x2f64a4,_0x524238){_0x2f64a4=_0x2f64a4-0x0;var _0x3169b8=_0x9a20[_0x2f64a4];return _0x3169b8;};'use strict';var _=require(_0x09a2('0x0'));var util=require(_0x09a2('0x1'));var logger=require(_0x09a2('0x2'))('api');var moment=require(_0x09a2('0x3'));var BPromise=require(_0x09a2('0x4'));var rp=require(_0x09a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09a2('0x6'));var config=require('../../config/environment');var attributes=require(_0x09a2('0x7'));module[_0x09a2('0x8')]=function(_0x2f4e72,_0x402625){return _0x2f4e72['define'](_0x09a2('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 82616c6..76f5f6b 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3c5bb9,_0xe76bce){var _0x20deec=function(_0xd775ab){while(--_0xd775ab){_0x3c5bb9['push'](_0x3c5bb9['shift']());}};_0x20deec(++_0xe76bce);}(_0xa41a,0x6b));var _0xaa41=function(_0x76625f,_0x49ac3b){_0x76625f=_0x76625f-0x0;var _0x5e9b25=_0xa41a[_0x76625f];return _0x5e9b25;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1f6e01,_0x3e70){var _0x4fe892=function(_0x52f080){while(--_0x52f080){_0x1f6e01['push'](_0x1f6e01['shift']());}};_0x4fe892(++_0x3e70);}(_0x6aa7,0x178));var _0x76aa=function(_0x187d5f,_0x2e2bc0){_0x187d5f=_0x187d5f-0x0;var _0x76dab5=_0x6aa7[_0x187d5f];return _0x76dab5;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5b72943..7f3faf5 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 _0xbde4=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbde4,0x69));var _0x4bde=function(_0x2a7c4e,_0x412876){_0x2a7c4e=_0x2a7c4e-0x0;var _0x4db2cb=_0xbde4[_0x2a7c4e];return _0x4db2cb;};'use strict';var multer=require(_0x4bde('0x0'));var util=require(_0x4bde('0x1'));var path=require(_0x4bde('0x2'));var timeout=require(_0x4bde('0x3'));var express=require(_0x4bde('0x4'));var router=express[_0x4bde('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4bde('0x6'));var interaction=require(_0x4bde('0x7'));var config=require(_0x4bde('0x8'));var controller=require(_0x4bde('0x9'));router[_0x4bde('0xa')]('/',auth[_0x4bde('0xb')](),controller['sendUserNotification']);module[_0x4bde('0xc')]=router; \ No newline at end of file +var _0x67a7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x67a7,0x14a));var _0x767a=function(_0x424895,_0x14c6f8){_0x424895=_0x424895-0x0;var _0xbf70ff=_0x67a7[_0x424895];return _0xbf70ff;};'use strict';var multer=require(_0x767a('0x0'));var util=require(_0x767a('0x1'));var path=require(_0x767a('0x2'));var timeout=require(_0x767a('0x3'));var express=require(_0x767a('0x4'));var router=express[_0x767a('0x5')]();var fs_extra=require(_0x767a('0x6'));var auth=require(_0x767a('0x7'));var interaction=require(_0x767a('0x8'));var config=require(_0x767a('0x9'));var controller=require(_0x767a('0xa'));router[_0x767a('0xb')]('/',auth['isAuthenticated'](),controller[_0x767a('0xc')]);module[_0x767a('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index eccf08f..030dd3e 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 _0xc800=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xc800,0x7d));var _0x0c80=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xc800[_0x5c3ae9];return _0x3f5950;};'use strict';var Sequelize=require(_0x0c80('0x0'));module[_0x0c80('0x1')]={'body':{'type':Sequelize[_0x0c80('0x2')]},'senderName':{'type':Sequelize[_0x0c80('0x3')]},'recipientsId':{'type':Sequelize[_0x0c80('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0c80('0x3')]},'beep':{'type':Sequelize[_0x0c80('0x4')]}}; \ No newline at end of file +var _0x719d=['exports','STRING','TEXT','BOOLEAN','sequelize'];(function(_0x103331,_0x3a3567){var _0x657f2d=function(_0x4925cd){while(--_0x4925cd){_0x103331['push'](_0x103331['shift']());}};_0x657f2d(++_0x3a3567);}(_0x719d,0x1ad));var _0xd719=function(_0x1ce697,_0x54b289){_0x1ce697=_0x1ce697-0x0;var _0x56dccf=_0x719d[_0x1ce697];return _0x56dccf;};'use strict';var Sequelize=require(_0xd719('0x0'));module[_0xd719('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xd719('0x2')]},'recipientsId':{'type':Sequelize[_0xd719('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xd719('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e0cd208..a0dbe7d 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 _0x7a4e=['zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','then','sendStatus','error','stack','name','send','sendUserNotification','hasOwnProperty','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','parse','chatqueue','faxqueue','mailqueue','smsqueue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','Queue','push','flatten','eml-format'];(function(_0x297220,_0x49bec5){var _0x532a3e=function(_0x117fd2){while(--_0x117fd2){_0x297220['push'](_0x297220['shift']());}};_0x532a3e(++_0x49bec5);}(_0x7a4e,0x1e4));var _0xe7a4=function(_0x11c3f7,_0x51be41){_0x11c3f7=_0x11c3f7-0x0;var _0x234af2=_0x7a4e[_0x11c3f7];return _0x234af2;};'use strict';var emlformat=require(_0xe7a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7a4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a4('0x2'));var moment=require(_0xe7a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe7a4('0x4'));var util=require(_0xe7a4('0x5'));var path=require('path');var sox=require(_0xe7a4('0x6'));var csv=require(_0xe7a4('0x7'));var ejs=require(_0xe7a4('0x8'));var fs=require('fs');var fs_extra=require(_0xe7a4('0x9'));var _=require(_0xe7a4('0xa'));var squel=require(_0xe7a4('0xb'));var crypto=require(_0xe7a4('0xc'));var jsforce=require(_0xe7a4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe7a4('0x7'));var querystring=require(_0xe7a4('0xe'));var Papa=require(_0xe7a4('0xf'));var Redis=require(_0xe7a4('0x10'));var authService=require(_0xe7a4('0x11'));var qs=require(_0xe7a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7a4('0x13'));var logger=require(_0xe7a4('0x14'))(_0xe7a4('0x15'));var utils=require(_0xe7a4('0x16'));var config=require(_0xe7a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7a4('0x18'))['db'];config[_0xe7a4('0x19')]=_[_0xe7a4('0x1a')](config[_0xe7a4('0x19')],{'host':_0xe7a4('0x1b'),'port':0x18eb});var socket=require(_0xe7a4('0x1c'))(new Redis(config['redis']));require(_0xe7a4('0x1d'))['register'](socket);function respondWithStatusCode(_0x193a89,_0x3e842a){_0x3e842a=_0x3e842a||0xcc;return function(_0x4088ef){if(_0x4088ef){return _0x193a89['sendStatus'](_0x3e842a);}return _0x193a89[_0xe7a4('0x1e')](_0x3e842a)[_0xe7a4('0x1f')]();};}function respondWithResult(_0x4ff7f4,_0x83f07a){_0x83f07a=_0x83f07a||0xc8;return function(_0x415e7){if(_0x415e7){return _0x4ff7f4[_0xe7a4('0x1e')](_0x83f07a)['json'](_0x415e7);}};}function respondWithFilteredResult(_0x5c9cc8,_0x1db9a8){return function(_0x4fff6e){if(_0x4fff6e){var _0x3cfa8f=typeof _0x1db9a8[_0xe7a4('0x20')]===_0xe7a4('0x21')&&typeof _0x1db9a8[_0xe7a4('0x22')]===_0xe7a4('0x21');var _0xc7fd47=_0x4fff6e[_0xe7a4('0x23')];var _0x16bd23=_0x3cfa8f?0x0:_0x1db9a8[_0xe7a4('0x20')];var _0x412859=_0x3cfa8f?_0x4fff6e[_0xe7a4('0x23')]:_0x1db9a8[_0xe7a4('0x20')]+_0x1db9a8[_0xe7a4('0x22')];var _0x5d3d77;if(_0x412859>=_0xc7fd47){_0x412859=_0xc7fd47;_0x5d3d77=0xc8;}else{_0x5d3d77=0xce;}_0x5c9cc8[_0xe7a4('0x1e')](_0x5d3d77);return _0x5c9cc8['set'](_0xe7a4('0x24'),_0x16bd23+'-'+_0x412859+'/'+_0xc7fd47)[_0xe7a4('0x25')](_0x4fff6e);}return null;};}function patchUpdates(_0x2d3888){return function(_0x2d5ab8){try{jsonpatch['apply'](_0x2d5ab8,_0x2d3888,!![]);}catch(_0x345141){return BPromise[_0xe7a4('0x26')](_0x345141);}return _0x2d5ab8[_0xe7a4('0x27')]();};}function saveUpdates(_0x24c6ef,_0x2b846a){return function(_0x39b504){if(_0x39b504){return _0x39b504['update'](_0x24c6ef)['then'](function(_0x5937a9){return _0x5937a9;});}return null;};}function removeEntity(_0x24a1f1,_0x56c464){return function(_0x5c2409){if(_0x5c2409){return _0x5c2409[_0xe7a4('0x28')]()[_0xe7a4('0x29')](function(){_0x24a1f1['status'](0xcc)[_0xe7a4('0x1f')]();});}};}function handleEntityNotFound(_0x2e18b7,_0x403026){return function(_0x40fae8){if(!_0x40fae8){_0x2e18b7[_0xe7a4('0x2a')](0x194);}return _0x40fae8;};}function handleError(_0x12265b,_0xace669){_0xace669=_0xace669||0x1f4;return function(_0x5ab30d){logger[_0xe7a4('0x2b')](_0x5ab30d[_0xe7a4('0x2c')]);if(_0x5ab30d[_0xe7a4('0x2d')]){delete _0x5ab30d[_0xe7a4('0x2d')];}_0x12265b[_0xe7a4('0x1e')](_0xace669)[_0xe7a4('0x2e')](_0x5ab30d);};}exports[_0xe7a4('0x2f')]=function(_0x28cac0,_0x29d384,_0x588aef){if(!_0x28cac0['body'][_0xe7a4('0x30')]('text')&&!_0x28cac0[_0xe7a4('0x31')]['hasOwnProperty'](_0xe7a4('0x32'))){throw new db['Sequelize'][(_0xe7a4('0x33'))](_0xe7a4('0x34'));}else{if(_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x30')](_0xe7a4('0x32'))&&!_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x30')](_0xe7a4('0x35'))){throw new db['Sequelize'][(_0xe7a4('0x33'))](_0xe7a4('0x36'));}if(!_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x30')](_0xe7a4('0x37'))){throw new db[(_0xe7a4('0x38'))][(_0xe7a4('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0xb4d074=JSON[_0xe7a4('0x39')](_0x28cac0[_0xe7a4('0x31')]['recipients']);}catch(_0x3b2a92){logger[_0xe7a4('0x2b')](_0x3b2a92);throw new db[(_0xe7a4('0x38'))][(_0xe7a4('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x35381d=[_0xe7a4('0x3a'),_0xe7a4('0x3b'),_0xe7a4('0x3c'),'openchannelqueue',_0xe7a4('0x3d'),'voicequeue',_0xe7a4('0x3e'),'team',_0xe7a4('0x3f')];if(_[_0xe7a4('0x40')](_0xb4d074,function(_0x592b34){return!_[_0xe7a4('0x41')](_0x35381d,_0x592b34['model'][_0xe7a4('0x42')]());})){throw new db[(_0xe7a4('0x38'))][(_0xe7a4('0x33'))](_0xe7a4('0x43'));}}}var _0x379380={};_0x379380[_0xe7a4('0x44')]=_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x30')]('senderName')?_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x44')]:_0x28cac0[_0xe7a4('0x3f')][_0xe7a4('0x45')];_0x379380[_0xe7a4('0x46')]=_['isEmpty'](_0x28cac0[_0xe7a4('0x31')]['recipientsDescription'])?null:_0x28cac0[_0xe7a4('0x31')][_0xe7a4('0x46')];_0x379380[_0xe7a4('0x47')]=_0x28cac0[_0xe7a4('0x31')]['beep']||![];_0x379380[_0xe7a4('0x48')]=_0x28cac0['user']['id'];return getContent(_0x28cac0[_0xe7a4('0x31')])['then'](function(_0x1d96ca){_0x379380[_0xe7a4('0x31')]=_0x1d96ca;return getRecipients(_0xb4d074);})[_0xe7a4('0x29')](function(_0x12619a){_0x379380[_0xe7a4('0x49')]=_[_0xe7a4('0x4a')](_0x12619a)[_0xe7a4('0x4b')](',');return db[_0xe7a4('0x4c')]['transaction'](function(_0x23c32b){return db[_0xe7a4('0x4d')]['create'](_0x379380,{'raw':!![],'transaction':_0x23c32b})[_0xe7a4('0x29')](function(_0x198f61){var _0x3aabc3={'sender':_0x379380[_0xe7a4('0x44')],'description':_0x379380[_0xe7a4('0x46')],'content':_0x379380[_0xe7a4('0x31')],'beep':_0x379380[_0xe7a4('0x47')]};_0x12619a[_0xe7a4('0x4e')](function(_0x26fc32){_0x3aabc3[_0xe7a4('0x4f')]=_0x26fc32;socket[_0xe7a4('0x50')](_0xe7a4('0x51'),_0x3aabc3);});return _0x198f61;});});})[_0xe7a4('0x29')](respondWithResult(_0x29d384,0xc9))[_0xe7a4('0x52')](handleError(_0x29d384,null));};function getContent(_0x5138a3){return new BPromise(function(_0x5aa181,_0x230fc4){if(_0x5138a3[_0xe7a4('0x53')]){_0x5aa181(_0x5138a3['text']);return;}return db[_0xe7a4('0x54')][_0xe7a4('0x55')]({'attributes':[_0xe7a4('0x56')],'where':{'id':_0x5138a3[_0xe7a4('0x32')]},'raw':!![]})[_0xe7a4('0x29')](function(_0xdcbcf3){if(!_0xdcbcf3)throw new db[(_0xe7a4('0x38'))]['ValidationError'](_0xe7a4('0x57'));var _0x147a58=Mustache[_0xe7a4('0x58')](_0xdcbcf3['html'],_0x5138a3['view']);_0x5aa181(_0x147a58);})[_0xe7a4('0x52')](function(_0x2f22c8){_0x230fc4(_0x2f22c8);});});}function getRecipients(_0x45ef97){return new BPromise(function(_0x31d741,_0x40dfc7){var _0x5270c2=[];var _0x40f365=[];_0x45ef97['forEach'](function(_0xcc52b8){var _0x3c33a5=_[_0xe7a4('0x59')](_0xcc52b8['model'][_0xe7a4('0x42')]());if(_0x3c33a5===_0xe7a4('0x5a')){_0x5270c2=_[_0xe7a4('0x5b')](_0x5270c2,_0xcc52b8[_0xe7a4('0x5c')]);}else{if(_[_0xe7a4('0x41')](_0x3c33a5,_0xe7a4('0x5d')))_0x3c33a5=_0x3c33a5['replace'](_0xe7a4('0x5d'),_0xe7a4('0x5e'));_0xcc52b8['ids'][_0xe7a4('0x4e')](function(_0x2bf12d){_0x40f365[_0xe7a4('0x5f')](getAgents(_0x3c33a5,_0x2bf12d));});}});return BPromise['all'](_0x40f365)[_0xe7a4('0x29')](function(_0x18f949){_0x5270c2=_[_0xe7a4('0x5b')](_0x5270c2,_[_0xe7a4('0x60')](_0x18f949));_0x31d741(_0x5270c2);})[_0xe7a4('0x52')](function(_0x45a036){_0x40dfc7(_0x45a036);});});}function getAgents(_0xe3f1ea,_0x357651){return new BPromise(function(_0x5b6466,_0x467ed9){return db[_0xe3f1ea][_0xe7a4('0x55')]({'where':{'id':_0x357651}})[_0xe7a4('0x29')](function(_0x21e0a5){return _0x21e0a5['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x457b74){var _0x34569a=_['map'](_0x457b74,'id');_0x5b6466(_0x34569a);});})['catch'](function(_0x335fa3){_0x467ed9(_0x335fa3);});});} \ No newline at end of file +var _0x2098=['mustache','util','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/utils','../../config/license/util','../../mysqldb','redis','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','forEach','recipient','emit','catch','Template','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','model','User','union','ids','queue','replace','all','flatten','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2098,0x12c));var _0x8209=function(_0x4da2c8,_0x227051){_0x4da2c8=_0x4da2c8-0x0;var _0x56048f=_0x2098[_0x4da2c8];return _0x56048f;};'use strict';var emlformat=require(_0x8209('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8209('0x1'));var jsonpatch=require(_0x8209('0x2'));var rp=require(_0x8209('0x3'));var moment=require(_0x8209('0x4'));var BPromise=require(_0x8209('0x5'));var Mustache=require(_0x8209('0x6'));var util=require(_0x8209('0x7'));var path=require('path');var sox=require(_0x8209('0x8'));var csv=require('to-csv');var ejs=require(_0x8209('0x9'));var fs=require('fs');var fs_extra=require(_0x8209('0xa'));var _=require(_0x8209('0xb'));var squel=require(_0x8209('0xc'));var crypto=require(_0x8209('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8209('0xe'));var toCsv=require(_0x8209('0xf'));var querystring=require(_0x8209('0x10'));var Papa=require('papaparse');var Redis=require(_0x8209('0x11'));var authService=require(_0x8209('0x12'));var qs=require(_0x8209('0x13'));var as=require(_0x8209('0x14'));var hardwareService=require(_0x8209('0x15'));var logger=require(_0x8209('0x16'))(_0x8209('0x17'));var utils=require(_0x8209('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8209('0x19'));var db=require(_0x8209('0x1a'))['db'];config[_0x8209('0x1b')]=_['defaults'](config[_0x8209('0x1b')],{'host':_0x8209('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8209('0x1b')]));require(_0x8209('0x1d'))[_0x8209('0x1e')](socket);function respondWithStatusCode(_0x37bfea,_0x265a28){_0x265a28=_0x265a28||0xcc;return function(_0x365844){if(_0x365844){return _0x37bfea[_0x8209('0x1f')](_0x265a28);}return _0x37bfea[_0x8209('0x20')](_0x265a28)[_0x8209('0x21')]();};}function respondWithResult(_0x3d81a3,_0x58ec4a){_0x58ec4a=_0x58ec4a||0xc8;return function(_0x5de879){if(_0x5de879){return _0x3d81a3[_0x8209('0x20')](_0x58ec4a)[_0x8209('0x22')](_0x5de879);}};}function respondWithFilteredResult(_0x1b2537,_0x24c8ec){return function(_0x4263cd){if(_0x4263cd){var _0x55a2e8=typeof _0x24c8ec[_0x8209('0x23')]===_0x8209('0x24')&&typeof _0x24c8ec[_0x8209('0x25')]===_0x8209('0x24');var _0x319795=_0x4263cd[_0x8209('0x26')];var _0x2b276c=_0x55a2e8?0x0:_0x24c8ec[_0x8209('0x23')];var _0x230b67=_0x55a2e8?_0x4263cd[_0x8209('0x26')]:_0x24c8ec[_0x8209('0x23')]+_0x24c8ec['limit'];var _0x528747;if(_0x230b67>=_0x319795){_0x230b67=_0x319795;_0x528747=0xc8;}else{_0x528747=0xce;}_0x1b2537[_0x8209('0x20')](_0x528747);return _0x1b2537[_0x8209('0x27')](_0x8209('0x28'),_0x2b276c+'-'+_0x230b67+'/'+_0x319795)[_0x8209('0x22')](_0x4263cd);}return null;};}function patchUpdates(_0x2efda4){return function(_0x4fec72){try{jsonpatch[_0x8209('0x29')](_0x4fec72,_0x2efda4,!![]);}catch(_0x5acc64){return BPromise[_0x8209('0x2a')](_0x5acc64);}return _0x4fec72['save']();};}function saveUpdates(_0x577590,_0x321b1a){return function(_0x43521d){if(_0x43521d){return _0x43521d[_0x8209('0x2b')](_0x577590)[_0x8209('0x2c')](function(_0x378661){return _0x378661;});}return null;};}function removeEntity(_0x556af9,_0x3b6a13){return function(_0xa5c501){if(_0xa5c501){return _0xa5c501[_0x8209('0x2d')]()[_0x8209('0x2c')](function(){_0x556af9['status'](0xcc)[_0x8209('0x21')]();});}};}function handleEntityNotFound(_0x5451a9,_0x4e3536){return function(_0x128b7b){if(!_0x128b7b){_0x5451a9[_0x8209('0x1f')](0x194);}return _0x128b7b;};}function handleError(_0x161b8f,_0x3eefac){_0x3eefac=_0x3eefac||0x1f4;return function(_0x5e6cd8){logger['error'](_0x5e6cd8[_0x8209('0x2e')]);if(_0x5e6cd8[_0x8209('0x2f')]){delete _0x5e6cd8['name'];}_0x161b8f[_0x8209('0x20')](_0x3eefac)[_0x8209('0x30')](_0x5e6cd8);};}exports[_0x8209('0x31')]=function(_0x595b53,_0x498708,_0x1f2cc5){if(!_0x595b53[_0x8209('0x32')][_0x8209('0x33')](_0x8209('0x34'))&&!_0x595b53[_0x8209('0x32')][_0x8209('0x33')]('TemplateId')){throw new db[(_0x8209('0x35'))][(_0x8209('0x36'))](_0x8209('0x37'));}else{if(_0x595b53['body'][_0x8209('0x33')]('TemplateId')&&!_0x595b53[_0x8209('0x32')][_0x8209('0x33')]('view')){throw new db['Sequelize']['ValidationError'](_0x8209('0x38'));}if(!_0x595b53[_0x8209('0x32')]['hasOwnProperty'](_0x8209('0x39'))){throw new db[(_0x8209('0x35'))][(_0x8209('0x36'))](_0x8209('0x3a'));}else{try{var _0x3c0ddd=JSON[_0x8209('0x3b')](_0x595b53[_0x8209('0x32')]['recipients']);}catch(_0x4ac699){logger[_0x8209('0x3c')](_0x4ac699);throw new db[(_0x8209('0x35'))][(_0x8209('0x36'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x347fb8=[_0x8209('0x3d'),_0x8209('0x3e'),_0x8209('0x3f'),'openchannelqueue',_0x8209('0x40'),_0x8209('0x41'),_0x8209('0x42'),_0x8209('0x43'),_0x8209('0x44')];if(_[_0x8209('0x45')](_0x3c0ddd,function(_0x3aca46){return!_['includes'](_0x347fb8,_0x3aca46['model'][_0x8209('0x46')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4e27e9={};_0x4e27e9['senderName']=_0x595b53['body'][_0x8209('0x33')](_0x8209('0x47'))?_0x595b53[_0x8209('0x32')][_0x8209('0x47')]:_0x595b53['user'][_0x8209('0x48')];_0x4e27e9[_0x8209('0x49')]=_[_0x8209('0x4a')](_0x595b53[_0x8209('0x32')][_0x8209('0x49')])?null:_0x595b53[_0x8209('0x32')]['recipientsDescription'];_0x4e27e9[_0x8209('0x4b')]=_0x595b53['body'][_0x8209('0x4b')]||![];_0x4e27e9[_0x8209('0x4c')]=_0x595b53['user']['id'];return getContent(_0x595b53['body'])['then'](function(_0x77379){_0x4e27e9[_0x8209('0x32')]=_0x77379;return getRecipients(_0x3c0ddd);})['then'](function(_0x379798){_0x4e27e9[_0x8209('0x4d')]=_[_0x8209('0x4e')](_0x379798)[_0x8209('0x4f')](',');return db['sequelize']['transaction'](function(_0x33e552){return db[_0x8209('0x50')][_0x8209('0x51')](_0x4e27e9,{'raw':!![],'transaction':_0x33e552})['then'](function(_0x7713af){var _0x31c192={'sender':_0x4e27e9[_0x8209('0x47')],'description':_0x4e27e9[_0x8209('0x49')],'content':_0x4e27e9['body'],'beep':_0x4e27e9['beep']};_0x379798[_0x8209('0x52')](function(_0x1aeff3){_0x31c192[_0x8209('0x53')]=_0x1aeff3;socket[_0x8209('0x54')]('userNotification:send',_0x31c192);});return _0x7713af;});});})[_0x8209('0x2c')](respondWithResult(_0x498708,0xc9))[_0x8209('0x55')](handleError(_0x498708,null));};function getContent(_0x49ffa1){return new BPromise(function(_0x46ac50,_0x239861){if(_0x49ffa1['text']){_0x46ac50(_0x49ffa1[_0x8209('0x34')]);return;}return db[_0x8209('0x56')][_0x8209('0x57')]({'attributes':[_0x8209('0x58')],'where':{'id':_0x49ffa1[_0x8209('0x59')]},'raw':!![]})[_0x8209('0x2c')](function(_0x11f4f8){if(!_0x11f4f8)throw new db[(_0x8209('0x35'))][(_0x8209('0x36'))](_0x8209('0x5a'));var _0x516f8b=Mustache[_0x8209('0x5b')](_0x11f4f8[_0x8209('0x58')],_0x49ffa1[_0x8209('0x5c')]);_0x46ac50(_0x516f8b);})[_0x8209('0x55')](function(_0x1c0717){_0x239861(_0x1c0717);});});}function getRecipients(_0x2c0123){return new BPromise(function(_0x550932,_0x5add16){var _0x54a27f=[];var _0x9c93db=[];_0x2c0123['forEach'](function(_0x11c733){var _0x50a32b=_['startCase'](_0x11c733[_0x8209('0x5d')][_0x8209('0x46')]());if(_0x50a32b===_0x8209('0x5e')){_0x54a27f=_[_0x8209('0x5f')](_0x54a27f,_0x11c733[_0x8209('0x60')]);}else{if(_['includes'](_0x50a32b,_0x8209('0x61')))_0x50a32b=_0x50a32b[_0x8209('0x62')](_0x8209('0x61'),'Queue');_0x11c733[_0x8209('0x60')]['forEach'](function(_0x5c3a17){_0x9c93db['push'](getAgents(_0x50a32b,_0x5c3a17));});}});return BPromise[_0x8209('0x63')](_0x9c93db)['then'](function(_0x323ef5){_0x54a27f=_[_0x8209('0x5f')](_0x54a27f,_[_0x8209('0x64')](_0x323ef5));_0x550932(_0x54a27f);})[_0x8209('0x55')](function(_0x2ac579){_0x5add16(_0x2ac579);});});}function getAgents(_0x3f9992,_0x3b27d7){return new BPromise(function(_0x37b539,_0x17a195){return db[_0x3f9992][_0x8209('0x57')]({'where':{'id':_0x3b27d7}})[_0x8209('0x2c')](function(_0x455d17){return _0x455d17[_0x8209('0x65')]({'attributes':['id'],'raw':!![]})[_0x8209('0x2c')](function(_0x42440a){var _0xed0f40=_['map'](_0x42440a,'id');_0x37b539(_0xed0f40);});})[_0x8209('0x55')](function(_0x565aab){_0x17a195(_0x565aab);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 41963f2..366c367 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 _0x9999=['emit','hasOwnProperty','exports','../../mysqldb','UserNotification','setMaxListeners','update','remove'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x9999,0x73));var _0x9999=function(_0x1cf11f,_0x21a416){_0x1cf11f=_0x1cf11f-0x0;var _0x10c6b5=_0x9999[_0x1cf11f];return _0x10c6b5;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x9999('0x0'))['db'][_0x9999('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9999('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9999('0x3'),'afterDestroy':_0x9999('0x4')};function emitEvent(_0x17c140){return function(_0x17f538,_0x22af47,_0x288289){UserNotificationEvents[_0x9999('0x5')](_0x17c140+':'+_0x17f538['id'],_0x17f538);UserNotificationEvents[_0x9999('0x5')](_0x17c140,_0x17f538);_0x288289(null);};}for(var e in events){if(events[_0x9999('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9999('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x13b6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x2a8b9a,_0x256b3d){var _0x4450e5=function(_0x567c39){while(--_0x567c39){_0x2a8b9a['push'](_0x2a8b9a['shift']());}};_0x4450e5(++_0x256b3d);}(_0x13b6,0xdc));var _0x613b=function(_0x427138,_0x1a7fc8){_0x427138=_0x427138-0x0;var _0x2a87c4=_0x13b6[_0x427138];return _0x2a87c4;};'use strict';var EventEmitter=require(_0x613b('0x0'));var UserNotification=require(_0x613b('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x613b('0x2')](0x0);var events={'afterCreate':_0x613b('0x3'),'afterUpdate':'update','afterDestroy':_0x613b('0x4')};function emitEvent(_0x28e021){return function(_0x2bc082,_0x298451,_0x134640){UserNotificationEvents[_0x613b('0x5')](_0x28e021+':'+_0x2bc082['id'],_0x2bc082);UserNotificationEvents[_0x613b('0x5')](_0x28e021,_0x2bc082);_0x134640(null);};}for(var e in events){if(events[_0x613b('0x6')](e)){var event=events[e];UserNotification[_0x613b('0x7')](e,emitEvent(event));}}module[_0x613b('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index c0447ba..d01ef68 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 _0xc0aa=['userNotifications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','UserNotification'];(function(_0x414658,_0x32591f){var _0x3f33b8=function(_0x1ce3f3){while(--_0x1ce3f3){_0x414658['push'](_0x414658['shift']());}};_0x3f33b8(++_0x32591f);}(_0xc0aa,0x15f));var _0xac0a=function(_0x542083,_0x48b819){_0x542083=_0x542083-0x0;var _0x3bca9e=_0xc0aa[_0x542083];return _0x3bca9e;};'use strict';var _=require('lodash');var util=require(_0xac0a('0x0'));var logger=require('../../config/logger')(_0xac0a('0x1'));var moment=require(_0xac0a('0x2'));var BPromise=require(_0xac0a('0x3'));var rp=require(_0xac0a('0x4'));var fs=require('fs');var path=require(_0xac0a('0x5'));var rimraf=require(_0xac0a('0x6'));var config=require(_0xac0a('0x7'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x3955cd,_0x1ebf58){return _0x3955cd['define'](_0xac0a('0x8'),attributes,{'tableName':_0xac0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac0a('0xa'),'collate':_0xac0a('0xb')});}; \ No newline at end of file +var _0x325b=['rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x325b,0x8b));var _0xb325=function(_0x19ad73,_0x3057d6){_0x19ad73=_0x19ad73-0x0;var _0x3f2e6e=_0x325b[_0x19ad73];return _0x3f2e6e;};'use strict';var _=require(_0xb325('0x0'));var util=require(_0xb325('0x1'));var logger=require(_0xb325('0x2'))('api');var moment=require(_0xb325('0x3'));var BPromise=require(_0xb325('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb325('0x5'));var config=require(_0xb325('0x6'));var attributes=require(_0xb325('0x7'));module['exports']=function(_0x4a1ea8,_0x33dcfc){return _0x4a1ea8['define'](_0xb325('0x8'),attributes,{'tableName':_0xb325('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb325('0xa'),'collate':_0xb325('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 7c8aae1..6b7b663 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 _0x4dd9=['request\x20sent','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','then','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0xdf582f,_0x4ffee0){var _0xc0b21d=function(_0x466e0b){while(--_0x466e0b){_0xdf582f['push'](_0xdf582f['shift']());}};_0xc0b21d(++_0x4ffee0);}(_0x4dd9,0x19d));var _0x94dd=function(_0x1a37b2,_0x584b3b){_0x1a37b2=_0x1a37b2-0x0;var _0x130c75=_0x4dd9[_0x1a37b2];return _0x130c75;};'use strict';var _=require(_0x94dd('0x0'));var util=require(_0x94dd('0x1'));var moment=require(_0x94dd('0x2'));var BPromise=require(_0x94dd('0x3'));var rs=require(_0x94dd('0x4'));var fs=require('fs');var Redis=require(_0x94dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x94dd('0x6'));var logger=require('../../config/logger')(_0x94dd('0x7'));var config=require(_0x94dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x94dd('0x9')]['http']({'port':0x232a});config[_0x94dd('0xa')]=_[_0x94dd('0xb')](config[_0x94dd('0xa')],{'host':_0x94dd('0xc'),'port':0x18eb});var socket=require(_0x94dd('0xd'))(new Redis(config[_0x94dd('0xa')]));require(_0x94dd('0xe'))['register'](socket);function respondWithRpcPromise(_0x126c8f,_0x5952c2,_0x1db5c6){return new BPromise(function(_0x31429c,_0x53bdba){return client['request'](_0x126c8f,_0x1db5c6)[_0x94dd('0xf')](function(_0x166a8f){logger['info'](_0x94dd('0x10'),_0x5952c2,'request\x20sent');logger[_0x94dd('0x11')](_0x94dd('0x12'),_0x5952c2,_0x94dd('0x13'),JSON['stringify'](_0x166a8f));if(_0x166a8f[_0x94dd('0x14')]){if(_0x166a8f[_0x94dd('0x14')][_0x94dd('0x15')]===0x1f4){logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x5952c2,_0x166a8f[_0x94dd('0x14')]['message']);return _0x53bdba(_0x166a8f[_0x94dd('0x14')][_0x94dd('0x16')]);}logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x5952c2,_0x166a8f[_0x94dd('0x14')][_0x94dd('0x16')]);return _0x31429c(_0x166a8f[_0x94dd('0x14')][_0x94dd('0x16')]);}else{logger[_0x94dd('0x17')](_0x94dd('0x10'),_0x5952c2,_0x94dd('0x13'));_0x31429c(_0x166a8f['result'][_0x94dd('0x16')]);}})['catch'](function(_0x17b388){logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x5952c2,_0x17b388);_0x53bdba(_0x17b388);});});} \ No newline at end of file +var _0xf9c3=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x850780,_0xf1150c){var _0x4432db=function(_0x7b8cd9){while(--_0x7b8cd9){_0x850780['push'](_0x850780['shift']());}};_0x4432db(++_0xf1150c);}(_0xf9c3,0x80));var _0x3f9c=function(_0x36ee10,_0x3e4e4b){_0x36ee10=_0x36ee10-0x0;var _0x1ae7e8=_0xf9c3[_0x36ee10];return _0x1ae7e8;};'use strict';var _=require(_0x3f9c('0x0'));var util=require(_0x3f9c('0x1'));var moment=require(_0x3f9c('0x2'));var BPromise=require(_0x3f9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f9c('0x4'));var db=require(_0x3f9c('0x5'))['db'];var utils=require(_0x3f9c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3f9c('0x7'));var client=jayson[_0x3f9c('0x8')][_0x3f9c('0x9')]({'port':0x232a});config[_0x3f9c('0xa')]=_[_0x3f9c('0xb')](config[_0x3f9c('0xa')],{'host':_0x3f9c('0xc'),'port':0x18eb});var socket=require(_0x3f9c('0xd'))(new Redis(config[_0x3f9c('0xa')]));require(_0x3f9c('0xe'))[_0x3f9c('0xf')](socket);function respondWithRpcPromise(_0x2f8c07,_0x5d7e7e,_0x59bf43){return new BPromise(function(_0x45cb20,_0x3bc6b0){return client[_0x3f9c('0x10')](_0x2f8c07,_0x59bf43)[_0x3f9c('0x11')](function(_0x3b3e1a){logger[_0x3f9c('0x12')](_0x3f9c('0x13'),_0x5d7e7e,_0x3f9c('0x14'));logger[_0x3f9c('0x15')](_0x3f9c('0x16'),_0x5d7e7e,_0x3f9c('0x14'),JSON[_0x3f9c('0x17')](_0x3b3e1a));if(_0x3b3e1a[_0x3f9c('0x18')]){if(_0x3b3e1a[_0x3f9c('0x18')]['code']===0x1f4){logger[_0x3f9c('0x18')](_0x3f9c('0x13'),_0x5d7e7e,_0x3b3e1a['error'][_0x3f9c('0x19')]);return _0x3bc6b0(_0x3b3e1a[_0x3f9c('0x18')][_0x3f9c('0x19')]);}logger[_0x3f9c('0x18')]('UserNotification,\x20%s,\x20%s',_0x5d7e7e,_0x3b3e1a[_0x3f9c('0x18')]['message']);return _0x45cb20(_0x3b3e1a[_0x3f9c('0x18')][_0x3f9c('0x19')]);}else{logger['info'](_0x3f9c('0x13'),_0x5d7e7e,'request\x20sent');_0x45cb20(_0x3b3e1a[_0x3f9c('0x1a')][_0x3f9c('0x19')]);}})['catch'](function(_0x5369ba){logger[_0x3f9c('0x18')](_0x3f9c('0x13'),_0x5d7e7e,_0x5369ba);_0x3bc6b0(_0x5369ba);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 1feca8b..4a9200b 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 _0x3bd5=['./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x455893,_0x909838){var _0x3851e8=function(_0x32ac8a){while(--_0x32ac8a){_0x455893['push'](_0x455893['shift']());}};_0x3851e8(++_0x909838);}(_0x3bd5,0xbd));var _0x53bd=function(_0x3f01a9,_0x3487ea){_0x3f01a9=_0x3f01a9-0x0;var _0x26ec34=_0x3bd5[_0x3f01a9];return _0x26ec34;};'use strict';var UserNotificationEvents=require(_0x53bd('0x0'));var events=[_0x53bd('0x1'),_0x53bd('0x2'),_0x53bd('0x3')];function createListener(_0x59e7de,_0x377527){return function(_0x4cb0f3){_0x377527[_0x53bd('0x4')](_0x59e7de,_0x4cb0f3);};}function removeListener(_0x45a8f8,_0x4b83ad){return function(){UserNotificationEvents[_0x53bd('0x5')](_0x45a8f8,_0x4b83ad);};}exports[_0x53bd('0x6')]=function(_0x46dd48){for(var _0x58d5ab=0x0,_0x4ceadb=events['length'];_0x58d5ab<_0x4ceadb;_0x58d5ab++){var _0x1e6ec4=events[_0x58d5ab];var _0x472d98=createListener('userNotification:'+_0x1e6ec4,_0x46dd48);UserNotificationEvents['on'](_0x1e6ec4,_0x472d98);}}; \ No newline at end of file +var _0x5b54=['./userNotification.events','save','update','removeListener','register','userNotification:'];(function(_0x34826d,_0x224c02){var _0x339fe5=function(_0x9af280){while(--_0x9af280){_0x34826d['push'](_0x34826d['shift']());}};_0x339fe5(++_0x224c02);}(_0x5b54,0x18c));var _0x45b5=function(_0x578c3f,_0x4802d3){_0x578c3f=_0x578c3f-0x0;var _0x439282=_0x5b54[_0x578c3f];return _0x439282;};'use strict';var UserNotificationEvents=require(_0x45b5('0x0'));var events=[_0x45b5('0x1'),'remove',_0x45b5('0x2')];function createListener(_0xf166a1,_0x399d79){return function(_0x9c99cd){_0x399d79['emit'](_0xf166a1,_0x9c99cd);};}function removeListener(_0x1c2ed7,_0x4cd7df){return function(){UserNotificationEvents[_0x45b5('0x3')](_0x1c2ed7,_0x4cd7df);};}exports[_0x45b5('0x4')]=function(_0x10e2f5){for(var _0x3ff032=0x0,_0x47e067=events['length'];_0x3ff032<_0x47e067;_0x3ff032++){var _0x4d9a83=events[_0x3ff032];var _0x2ba02a=createListener(_0x45b5('0x5')+_0x4d9a83,_0x10e2f5);UserNotificationEvents['on'](_0x4d9a83,_0x2ba02a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6623024..84d13d3 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1ee4d6,_0x52691d){var _0x485a99=function(_0x1e6838){while(--_0x1e6838){_0x1ee4d6['push'](_0x1ee4d6['shift']());}};_0x485a99(++_0x52691d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xcb91[_0x36d25e];return _0x4b95b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x495707,_0x2d72eb){var _0x269dc4=function(_0x594c0d){while(--_0x594c0d){_0x495707['push'](_0x495707['shift']());}};_0x269dc4(++_0x2d72eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 90aac75..455fb08 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 _0x106f=['sequelize','exports'];(function(_0x588cf2,_0x2e250a){var _0x437057=function(_0x3c75cb){while(--_0x3c75cb){_0x588cf2['push'](_0x588cf2['shift']());}};_0x437057(++_0x2e250a);}(_0x106f,0x162));var _0xf106=function(_0x428145,_0x4c46f4){_0x428145=_0x428145-0x0;var _0x56735e=_0x106f[_0x428145];return _0x56735e;};'use strict';var Sequelize=require(_0xf106('0x0'));module[_0xf106('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x273b=['INTEGER','exports'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x273b,0xb9));var _0xb273=function(_0x340e1d,_0x30adeb){_0x340e1d=_0x340e1d-0x0;var _0x327f93=_0x273b[_0x340e1d];return _0x327f93;};'use strict';var Sequelize=require('sequelize');module[_0xb273('0x0')]={'penalty':{'type':Sequelize[_0xb273('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 abfb931..83d8d76 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 _0x46d9=['lodash','api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0xc91a95,_0x1e4a21){var _0x38bbec=function(_0x2a9f21){while(--_0x2a9f21){_0xc91a95['push'](_0xc91a95['shift']());}};_0x38bbec(++_0x1e4a21);}(_0x46d9,0x1ec));var _0x946d=function(_0x1f232a,_0xdfff04){_0x1f232a=_0x1f232a-0x0;var _0xddf20e=_0x46d9[_0x1f232a];return _0xddf20e;};'use strict';var _=require(_0x946d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x946d('0x1'));var moment=require(_0x946d('0x2'));var BPromise=require(_0x946d('0x3'));var rp=require(_0x946d('0x4'));var fs=require('fs');var path=require(_0x946d('0x5'));var rimraf=require(_0x946d('0x6'));var config=require('../../config/environment');var attributes=require(_0x946d('0x7'));module[_0x946d('0x8')]=function(_0x12251e,_0x1e9087){return _0x12251e[_0x946d('0x9')](_0x946d('0xa'),attributes,{'tableName':_0x946d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31b3=['path','user_has_openchannel_queues','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4c463a,_0x4411bb){var _0x54f816=function(_0x3086ce){while(--_0x3086ce){_0x4c463a['push'](_0x4c463a['shift']());}};_0x54f816(++_0x4411bb);}(_0x31b3,0x160));var _0x331b=function(_0x8f6fa5,_0x320980){_0x8f6fa5=_0x8f6fa5-0x0;var _0x2e1201=_0x31b3[_0x8f6fa5];return _0x2e1201;};'use strict';var _=require(_0x331b('0x0'));var util=require(_0x331b('0x1'));var logger=require(_0x331b('0x2'))('api');var moment=require(_0x331b('0x3'));var BPromise=require('bluebird');var rp=require(_0x331b('0x4'));var fs=require('fs');var path=require(_0x331b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x1b85ad,_0x2e8a93){return _0x1b85ad['define']('UserOpenchannelQueue',attributes,{'tableName':_0x331b('0x6'),'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 654ea07..58d72cf 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 _0xd01d=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3cc6f4,_0xa34978){var _0x5eb574=function(_0x2b168e){while(--_0x2b168e){_0x3cc6f4['push'](_0x3cc6f4['shift']());}};_0x5eb574(++_0xa34978);}(_0xd01d,0x89));var _0xdd01=function(_0x1e622b,_0x2bc782){_0x1e622b=_0x1e622b-0x0;var _0x1dd8bb=_0xd01d[_0x1e622b];return _0x1dd8bb;};'use strict';var _=require(_0xdd01('0x0'));var util=require('util');var moment=require(_0xdd01('0x1'));var BPromise=require(_0xdd01('0x2'));var rs=require(_0xdd01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd01('0x4'));var logger=require(_0xdd01('0x5'))(_0xdd01('0x6'));var config=require(_0xdd01('0x7'));var jayson=require(_0xdd01('0x8'));var client=jayson[_0xdd01('0x9')][_0xdd01('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b6e8c,_0x54bd3c,_0x5735c9){return new BPromise(function(_0x4108d3,_0x210da9){return client[_0xdd01('0xb')](_0x7b6e8c,_0x5735c9)[_0xdd01('0xc')](function(_0x43fdac){logger[_0xdd01('0xd')](_0xdd01('0xe'),_0x54bd3c,_0xdd01('0xf'));logger['debug'](_0xdd01('0x10'),_0x54bd3c,'request\x20sent',JSON[_0xdd01('0x11')](_0x43fdac));if(_0x43fdac[_0xdd01('0x12')]){if(_0x43fdac['error'][_0xdd01('0x13')]===0x1f4){logger[_0xdd01('0x12')](_0xdd01('0xe'),_0x54bd3c,_0x43fdac[_0xdd01('0x12')][_0xdd01('0x14')]);return _0x210da9(_0x43fdac[_0xdd01('0x12')][_0xdd01('0x14')]);}logger[_0xdd01('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54bd3c,_0x43fdac[_0xdd01('0x12')][_0xdd01('0x14')]);return _0x4108d3(_0x43fdac['error'][_0xdd01('0x14')]);}else{logger[_0xdd01('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54bd3c,'request\x20sent');_0x4108d3(_0x43fdac[_0xdd01('0x15')][_0xdd01('0x14')]);}})[_0xdd01('0x16')](function(_0x2fd071){logger['error'](_0xdd01('0xe'),_0x54bd3c,_0x2fd071);_0x210da9(_0x2fd071);});});} \ No newline at end of file +var _0x533d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring'];(function(_0x1c3871,_0x290d71){var _0x40be9b=function(_0x5571b9){while(--_0x5571b9){_0x1c3871['push'](_0x1c3871['shift']());}};_0x40be9b(++_0x290d71);}(_0x533d,0x1b5));var _0xd533=function(_0x232e2d,_0x5e55b5){_0x232e2d=_0x232e2d-0x0;var _0x4b9459=_0x533d[_0x232e2d];return _0x4b9459;};'use strict';var _=require(_0xd533('0x0'));var util=require('util');var moment=require(_0xd533('0x1'));var BPromise=require(_0xd533('0x2'));var rs=require(_0xd533('0x3'));var fs=require('fs');var Redis=require(_0xd533('0x4'));var db=require(_0xd533('0x5'))['db'];var utils=require(_0xd533('0x6'));var logger=require(_0xd533('0x7'))(_0xd533('0x8'));var config=require(_0xd533('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd533('0xa')][_0xd533('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e5995,_0x105dd9,_0x553066){return new BPromise(function(_0x10c14a,_0x28cd1e){return client[_0xd533('0xc')](_0x4e5995,_0x553066)[_0xd533('0xd')](function(_0x6a7007){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x105dd9,_0xd533('0xe'));logger['debug'](_0xd533('0xf'),_0x105dd9,_0xd533('0xe'),JSON[_0xd533('0x10')](_0x6a7007));if(_0x6a7007[_0xd533('0x11')]){if(_0x6a7007[_0xd533('0x11')][_0xd533('0x12')]===0x1f4){logger['error'](_0xd533('0x13'),_0x105dd9,_0x6a7007[_0xd533('0x11')]['message']);return _0x28cd1e(_0x6a7007[_0xd533('0x11')]['message']);}logger['error'](_0xd533('0x13'),_0x105dd9,_0x6a7007[_0xd533('0x11')][_0xd533('0x14')]);return _0x10c14a(_0x6a7007[_0xd533('0x11')]['message']);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x105dd9,_0xd533('0xe'));_0x10c14a(_0x6a7007['result'][_0xd533('0x14')]);}})['catch'](function(_0x11f0eb){logger[_0xd533('0x11')](_0xd533('0x13'),_0x105dd9,_0x11f0eb);_0x28cd1e(_0x11f0eb);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 49bfbf4..cf9aaef 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 _0xefbd=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','get','show','getSections','post','create','clone','/:id/sections','addSections','/:id/resources','addResources','put','/:id','update','delete','destroy','removeSections','exports','multer','util'];(function(_0x326260,_0x5c2b17){var _0x1f05c7=function(_0x522f70){while(--_0x522f70){_0x326260['push'](_0x326260['shift']());}};_0x1f05c7(++_0x5c2b17);}(_0xefbd,0x15a));var _0xdefb=function(_0x30713e,_0x2c4cbe){_0x30713e=_0x30713e-0x0;var _0x37d6c2=_0xefbd[_0x30713e];return _0x37d6c2;};'use strict';var multer=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var path=require('path');var timeout=require(_0xdefb('0x2'));var express=require('express');var router=express[_0xdefb('0x3')]();var fs_extra=require(_0xdefb('0x4'));var auth=require(_0xdefb('0x5'));var interaction=require(_0xdefb('0x6'));var config=require(_0xdefb('0x7'));var controller=require(_0xdefb('0x8'));router['get']('/',auth[_0xdefb('0x9')](),controller[_0xdefb('0xa')]);router['get'](_0xdefb('0xb'),auth[_0xdefb('0x9')](),controller['describe']);router[_0xdefb('0xc')]('/:id',auth[_0xdefb('0x9')](),controller[_0xdefb('0xd')]);router[_0xdefb('0xc')]('/:id/sections',auth[_0xdefb('0x9')](),controller[_0xdefb('0xe')]);router[_0xdefb('0xc')]('/:id/resources',auth[_0xdefb('0x9')](),controller['getResources']);router[_0xdefb('0xf')]('/',auth['isAuthenticated'](),controller[_0xdefb('0x10')]);router['post']('/:id/clone',auth[_0xdefb('0x9')](),controller[_0xdefb('0x11')]);router['post'](_0xdefb('0x12'),auth[_0xdefb('0x9')](),controller[_0xdefb('0x13')]);router[_0xdefb('0xf')](_0xdefb('0x14'),auth['isAuthenticated'](),controller[_0xdefb('0x15')]);router[_0xdefb('0x16')](_0xdefb('0x17'),auth[_0xdefb('0x9')](),controller[_0xdefb('0x18')]);router[_0xdefb('0x19')](_0xdefb('0x17'),auth[_0xdefb('0x9')](),controller[_0xdefb('0x1a')]);router[_0xdefb('0x19')](_0xdefb('0x12'),auth[_0xdefb('0x9')](),controller[_0xdefb('0x1b')]);router['delete'](_0xdefb('0x14'),auth['isAuthenticated'](),controller['removeResources']);module[_0xdefb('0x1c')]=router; \ No newline at end of file +var _0x5c89=['isAuthenticated','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','put','update','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x50065f,_0x3be717){var _0x41035e=function(_0x56b844){while(--_0x56b844){_0x50065f['push'](_0x50065f['shift']());}};_0x41035e(++_0x3be717);}(_0x5c89,0xc0));var _0x95c8=function(_0x2d8029,_0x16a1e8){_0x2d8029=_0x2d8029-0x0;var _0x3fb34d=_0x5c89[_0x2d8029];return _0x3fb34d;};'use strict';var multer=require(_0x95c8('0x0'));var util=require(_0x95c8('0x1'));var path=require(_0x95c8('0x2'));var timeout=require(_0x95c8('0x3'));var express=require(_0x95c8('0x4'));var router=express['Router']();var fs_extra=require(_0x95c8('0x5'));var auth=require(_0x95c8('0x6'));var interaction=require(_0x95c8('0x7'));var config=require(_0x95c8('0x8'));var controller=require('./userProfile.controller');router[_0x95c8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x95c8('0x9')](_0x95c8('0xa'),auth[_0x95c8('0xb')](),controller['describe']);router['get'](_0x95c8('0xc'),auth['isAuthenticated'](),controller[_0x95c8('0xd')]);router[_0x95c8('0x9')](_0x95c8('0xe'),auth['isAuthenticated'](),controller[_0x95c8('0xf')]);router[_0x95c8('0x9')](_0x95c8('0x10'),auth[_0x95c8('0xb')](),controller[_0x95c8('0x11')]);router[_0x95c8('0x12')]('/',auth[_0x95c8('0xb')](),controller[_0x95c8('0x13')]);router[_0x95c8('0x12')](_0x95c8('0x14'),auth[_0x95c8('0xb')](),controller[_0x95c8('0x15')]);router[_0x95c8('0x12')](_0x95c8('0xe'),auth[_0x95c8('0xb')](),controller['addSections']);router[_0x95c8('0x12')](_0x95c8('0x10'),auth['isAuthenticated'](),controller[_0x95c8('0x16')]);router[_0x95c8('0x17')](_0x95c8('0xc'),auth[_0x95c8('0xb')](),controller[_0x95c8('0x18')]);router[_0x95c8('0x19')](_0x95c8('0xc'),auth[_0x95c8('0xb')](),controller[_0x95c8('0x1a')]);router[_0x95c8('0x19')](_0x95c8('0xe'),auth[_0x95c8('0xb')](),controller[_0x95c8('0x1b')]);router[_0x95c8('0x19')](_0x95c8('0x10'),auth[_0x95c8('0xb')](),controller['removeResources']);module[_0x95c8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index cee02e5..f42a345 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 _0x4c5e=['exports','STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x1ef18c,_0x32dce7){var _0x367e82=function(_0x28a5fb){while(--_0x28a5fb){_0x1ef18c['push'](_0x1ef18c['shift']());}};_0x367e82(++_0x32dce7);}(_0x4c5e,0x170));var _0xe4c5=function(_0x592cb1,_0x15c8b4){_0x592cb1=_0x592cb1-0x0;var _0x18f79b=_0x4c5e[_0x592cb1];return _0x18f79b;};'use strict';var Sequelize=require(_0xe4c5('0x0'));module[_0xe4c5('0x1')]={'name':{'type':Sequelize[_0xe4c5('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xe4c5('0x2')],'set':function(_0x3df012){this[_0xe4c5('0x3')]('crudPermissions',_0x3df012?_0x3df012[_0xe4c5('0x4')](''):[]);},'get':function(){return this[_0xe4c5('0x5')](_0xe4c5('0x6'))?this[_0xe4c5('0x5')](_0xe4c5('0x6'))[_0xe4c5('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe4c5('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe4c5('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb39c=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0xcb05b2,_0x4e6cfd){var _0x53dae8=function(_0x5ea28c){while(--_0x5ea28c){_0xcb05b2['push'](_0xcb05b2['shift']());}};_0x53dae8(++_0x4e6cfd);}(_0xb39c,0x9b));var _0xcb39=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb39c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xcb39('0x0'));module[_0xcb39('0x1')]={'name':{'type':Sequelize[_0xcb39('0x2')],'allowNull':![],'unique':_0xcb39('0x3')},'crudPermissions':{'type':Sequelize[_0xcb39('0x2')],'set':function(_0x3c4a0f){this[_0xcb39('0x4')](_0xcb39('0x5'),_0x3c4a0f?_0x3c4a0f[_0xcb39('0x6')](''):[]);},'get':function(){return this[_0xcb39('0x7')](_0xcb39('0x5'))?this[_0xcb39('0x7')](_0xcb39('0x5'))[_0xcb39('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xcb39('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcb39('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index f8eed6f..a2950ae 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 _0x9c1d=['end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','options','includeAll','include','UserProfile','findAll','rows','catch','merge','find','create','body','params','length','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','userProfileId','each','push','removeSections','getSections','includes','isEmpty','subsections','enabled','forEach','resourceId','Plugin','addResources','bulkCreate','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status'];(function(_0x11de8b,_0x45cfe7){var _0x1bf521=function(_0x152952){while(--_0x152952){_0x11de8b['push'](_0x11de8b['shift']());}};_0x1bf521(++_0x45cfe7);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x11aaec,_0x3e5cff){_0x11aaec=_0x11aaec-0x0;var _0x11db30=_0x9c1d[_0x11aaec];return _0x11db30;};'use strict';var emlformat=require(_0xd9c1('0x0'));var rimraf=require(_0xd9c1('0x1'));var zipdir=require(_0xd9c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9c1('0x3'));var moment=require(_0xd9c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd9c1('0x5'));var util=require(_0xd9c1('0x6'));var path=require('path');var sox=require(_0xd9c1('0x7'));var csv=require(_0xd9c1('0x8'));var ejs=require(_0xd9c1('0x9'));var fs=require('fs');var fs_extra=require(_0xd9c1('0xa'));var _=require(_0xd9c1('0xb'));var squel=require(_0xd9c1('0xc'));var crypto=require(_0xd9c1('0xd'));var jsforce=require(_0xd9c1('0xe'));var deskjs=require(_0xd9c1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9c1('0x10'));var Papa=require(_0xd9c1('0x11'));var Redis=require(_0xd9c1('0x12'));var authService=require(_0xd9c1('0x13'));var qs=require(_0xd9c1('0x14'));var as=require(_0xd9c1('0x15'));var hardwareService=require(_0xd9c1('0x16'));var logger=require('../../config/logger')(_0xd9c1('0x17'));var utils=require(_0xd9c1('0x18'));var config=require(_0xd9c1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9c1('0x1a'))['db'];config['redis']=_[_0xd9c1('0x1b')](config[_0xd9c1('0x1c')],{'host':_0xd9c1('0x1d'),'port':0x18eb});var socket=require(_0xd9c1('0x1e'))(new Redis(config[_0xd9c1('0x1c')]));require(_0xd9c1('0x1f'))[_0xd9c1('0x20')](socket);function respondWithStatusCode(_0x13b927,_0xf95f06){_0xf95f06=_0xf95f06||0xcc;return function(_0x259305){if(_0x259305){return _0x13b927[_0xd9c1('0x21')](_0xf95f06);}return _0x13b927[_0xd9c1('0x22')](_0xf95f06)[_0xd9c1('0x23')]();};}function respondWithResult(_0x174ccd,_0xe47aa2){_0xe47aa2=_0xe47aa2||0xc8;return function(_0x5e500f){if(_0x5e500f){return _0x174ccd['status'](_0xe47aa2)[_0xd9c1('0x24')](_0x5e500f);}};}function respondWithFilteredResult(_0xf6c9b2,_0x1090a4){return function(_0x1a1542){if(_0x1a1542){var _0x10a586=typeof _0x1090a4[_0xd9c1('0x25')]===_0xd9c1('0x26')&&typeof _0x1090a4[_0xd9c1('0x27')]===_0xd9c1('0x26');var _0x55c310=_0x1a1542[_0xd9c1('0x28')];var _0x11611d=_0x10a586?0x0:_0x1090a4[_0xd9c1('0x25')];var _0x2aea78=_0x10a586?_0x1a1542[_0xd9c1('0x28')]:_0x1090a4[_0xd9c1('0x25')]+_0x1090a4['limit'];var _0x28f523;if(_0x2aea78>=_0x55c310){_0x2aea78=_0x55c310;_0x28f523=0xc8;}else{_0x28f523=0xce;}_0xf6c9b2[_0xd9c1('0x22')](_0x28f523);return _0xf6c9b2[_0xd9c1('0x29')]('Content-Range',_0x11611d+'-'+_0x2aea78+'/'+_0x55c310)['json'](_0x1a1542);}return null;};}function patchUpdates(_0x410be7){return function(_0x31cd40){try{jsonpatch[_0xd9c1('0x2a')](_0x31cd40,_0x410be7,!![]);}catch(_0x403d78){return BPromise[_0xd9c1('0x2b')](_0x403d78);}return _0x31cd40[_0xd9c1('0x2c')]();};}function saveUpdates(_0x27818f,_0x562efb){return function(_0x26df40){if(_0x26df40){return _0x26df40[_0xd9c1('0x2d')](_0x27818f)['then'](function(_0x5dc2ee){return _0x5dc2ee;});}return null;};}function removeEntity(_0x2245ca,_0x45b15d){return function(_0x5106e3){if(_0x5106e3){return _0x5106e3['destroy']()[_0xd9c1('0x2e')](function(){_0x2245ca[_0xd9c1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dcc10,_0x298042){return function(_0x2d2f1c){if(!_0x2d2f1c){_0x4dcc10[_0xd9c1('0x21')](0x194);}return _0x2d2f1c;};}function handleError(_0x28bd8a,_0xc0192e){_0xc0192e=_0xc0192e||0x1f4;return function(_0x7373cb){logger[_0xd9c1('0x2f')](_0x7373cb['stack']);if(_0x7373cb[_0xd9c1('0x30')]){delete _0x7373cb[_0xd9c1('0x30')];}_0x28bd8a[_0xd9c1('0x22')](_0xc0192e)[_0xd9c1('0x31')](_0x7373cb);};}exports[_0xd9c1('0x32')]=function(_0xd6248b,_0x11c8b3){var _0x313f05={},_0x5a1a5c={},_0x5117d6={'count':0x0,'rows':[]};var _0x5923d9=_[_0xd9c1('0x33')](db['UserProfile'][_0xd9c1('0x34')],function(_0x3b92fb){return{'name':_0x3b92fb['fieldName'],'type':_0x3b92fb[_0xd9c1('0x35')][_0xd9c1('0x36')]};});_0x5a1a5c[_0xd9c1('0x37')]=_[_0xd9c1('0x33')](_0x5923d9,_0xd9c1('0x30'));_0x5a1a5c[_0xd9c1('0x38')]=_[_0xd9c1('0x39')](_0xd6248b[_0xd9c1('0x38')]);_0x5a1a5c[_0xd9c1('0x3a')]=_[_0xd9c1('0x3b')](_0x5a1a5c[_0xd9c1('0x37')],_0x5a1a5c[_0xd9c1('0x38')]);_0x313f05['attributes']=_['intersection'](_0x5a1a5c[_0xd9c1('0x37')],qs[_0xd9c1('0x3c')](_0xd6248b[_0xd9c1('0x38')]['fields']));_0x313f05[_0xd9c1('0x3d')]=_0x313f05[_0xd9c1('0x3d')]['length']?_0x313f05[_0xd9c1('0x3d')]:_0x5a1a5c[_0xd9c1('0x37')];if(!_0xd6248b['query']['hasOwnProperty'](_0xd9c1('0x3e'))){_0x313f05[_0xd9c1('0x27')]=qs[_0xd9c1('0x27')](_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x27')]);_0x313f05[_0xd9c1('0x25')]=qs['offset'](_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x25')]);}_0x313f05[_0xd9c1('0x3f')]=qs['sort'](_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x40')]);_0x313f05[_0xd9c1('0x41')]=qs[_0xd9c1('0x3a')](_[_0xd9c1('0x42')](_0xd6248b[_0xd9c1('0x38')],_0x5a1a5c[_0xd9c1('0x3a')]),_0x5923d9);if(_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x43')]){_0x313f05[_0xd9c1('0x41')]=_['merge'](_0x313f05[_0xd9c1('0x41')],{'$or':_[_0xd9c1('0x33')](_0x5923d9,function(_0x5ddcb6){if(_0x5ddcb6['type']!=='VIRTUAL'){var _0x26f67a={};_0x26f67a[_0x5ddcb6[_0xd9c1('0x30')]]={'$like':'%'+_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x43')]+'%'};return _0x26f67a;}})});}_0x313f05=_['merge']({},_0x313f05,_0xd6248b[_0xd9c1('0x44')]);var _0x418a64={'where':_0x313f05[_0xd9c1('0x41')]};return db['UserProfile']['count'](_0x418a64)[_0xd9c1('0x2e')](function(_0xbf9915){_0x5117d6[_0xd9c1('0x28')]=_0xbf9915;if(_0xd6248b[_0xd9c1('0x38')][_0xd9c1('0x45')]){_0x313f05[_0xd9c1('0x46')]=[{'all':!![]}];}return db[_0xd9c1('0x47')][_0xd9c1('0x48')](_0x313f05);})[_0xd9c1('0x2e')](function(_0x4f55a3){_0x5117d6[_0xd9c1('0x49')]=_0x4f55a3;return _0x5117d6;})[_0xd9c1('0x2e')](respondWithFilteredResult(_0x11c8b3,_0x313f05))[_0xd9c1('0x4a')](handleError(_0x11c8b3,null));};exports['show']=function(_0x587490,_0x1a830d){var _0x58316f={'raw':![],'where':{'id':_0x587490['params']['id']}},_0x43383d={};_0x43383d['model']=_[_0xd9c1('0x39')](db[_0xd9c1('0x47')][_0xd9c1('0x34')]);_0x43383d[_0xd9c1('0x38')]=_[_0xd9c1('0x39')](_0x587490[_0xd9c1('0x38')]);_0x43383d[_0xd9c1('0x3a')]=_[_0xd9c1('0x3b')](_0x43383d[_0xd9c1('0x37')],_0x43383d[_0xd9c1('0x38')]);_0x58316f[_0xd9c1('0x3d')]=_[_0xd9c1('0x3b')](_0x43383d[_0xd9c1('0x37')],qs[_0xd9c1('0x3c')](_0x587490[_0xd9c1('0x38')][_0xd9c1('0x3c')]));_0x58316f['attributes']=_0x58316f[_0xd9c1('0x3d')]['length']?_0x58316f['attributes']:_0x43383d[_0xd9c1('0x37')];if(_0x587490[_0xd9c1('0x38')][_0xd9c1('0x45')]){_0x58316f[_0xd9c1('0x46')]=[{'all':!![]}];}_0x58316f=_[_0xd9c1('0x4b')]({},_0x58316f,_0x587490[_0xd9c1('0x44')]);return db[_0xd9c1('0x47')][_0xd9c1('0x4c')](_0x58316f)[_0xd9c1('0x2e')](handleEntityNotFound(_0x1a830d,null))[_0xd9c1('0x2e')](respondWithResult(_0x1a830d,null))['catch'](handleError(_0x1a830d,null));};exports[_0xd9c1('0x4d')]=function(_0x5834e5,_0x4ae001){return db[_0xd9c1('0x47')][_0xd9c1('0x4d')](_0x5834e5[_0xd9c1('0x4e')],{})[_0xd9c1('0x2e')](respondWithResult(_0x4ae001,0xc9))[_0xd9c1('0x4a')](handleError(_0x4ae001,null));};exports['clone']=function(_0x40086a,_0x18b24a){var _0x550133={'where':{'id':_0x40086a[_0xd9c1('0x4f')]['id']}},_0x311595={};_0x311595[_0xd9c1('0x37')]=_[_0xd9c1('0x39')](db[_0xd9c1('0x47')]['rawAttributes']);_0x550133[_0xd9c1('0x3d')]=_[_0xd9c1('0x3b')](_0x311595[_0xd9c1('0x37')],qs[_0xd9c1('0x3c')](_0x40086a['query'][_0xd9c1('0x3c')]));_0x550133[_0xd9c1('0x3d')]=_0x550133[_0xd9c1('0x3d')][_0xd9c1('0x50')]?_0x550133[_0xd9c1('0x3d')]:_0x311595[_0xd9c1('0x37')];if(_0x40086a[_0xd9c1('0x38')][_0xd9c1('0x45')]){_0x550133[_0xd9c1('0x46')]=[{'all':!![]}];}_0x550133=_['merge']({},_0x550133,_0x40086a[_0xd9c1('0x44')]);return db[_0xd9c1('0x47')]['find'](_0x550133)[_0xd9c1('0x2e')](handleEntityNotFound(_0x18b24a,null))[_0xd9c1('0x2e')](function(_0x4038f9){if(_0x4038f9){var _0x168e70=_0x4038f9[_0xd9c1('0x51')]({'plain':!![]});_0x168e70=qs[_0xd9c1('0x52')](_0x168e70,['id',_0xd9c1('0x53'),_0xd9c1('0x54'),_0xd9c1('0x55')]);_0x40086a[_0xd9c1('0x4e')]=_['omit'](_0x40086a[_0xd9c1('0x4e')],['id',_0xd9c1('0x53'),_0xd9c1('0x54')]);return db[_0xd9c1('0x56')][_0xd9c1('0x57')](function(_0x2f9044){return db[_0xd9c1('0x47')][_0xd9c1('0x4d')](_[_0xd9c1('0x4b')](_0x168e70,_0x40086a[_0xd9c1('0x4e')]),{'include':_0x40086a['query'][_0xd9c1('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x2f9044})['then'](function(_0x38a9b3){var _0x37475b=_0x38a9b3[_0xd9c1('0x51')]({'plain':!![]});return db[_0xd9c1('0x58')]['findAll']({'where':{'userProfileId':_0x40086a[_0xd9c1('0x4f')]['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x2a9c79){if(_0x2a9c79){return BPromise['each'](_0x2a9c79,function(_0x34de0d){return new BPromise(function(_0x172816,_0x5a87e5){if(_0x34de0d[_0xd9c1('0x59')]===null||_0x34de0d[_0xd9c1('0x59')]===0x1)_0x172816(null);return db[_0xd9c1('0x5a')][_0xd9c1('0x48')]({'where':{'sectionId':_0x34de0d['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x6fb91){var _0x3ed406=_[_0xd9c1('0x33')](_0x6fb91,function(_0x4fa36f){return qs['omit'](_0x4fa36f,['id','createdAt',_0xd9c1('0x54'),_0xd9c1('0x5b')]);});_0x172816(_0x3ed406);})[_0xd9c1('0x4a')](function(_0x28e58e){_0x5a87e5(_0x28e58e);});})['then'](function(_0x969c4){var _0xe912b8=qs[_0xd9c1('0x52')](_0x34de0d,['id',_0xd9c1('0x53'),_0xd9c1('0x54')]);_0xe912b8['userProfileId']=_0x37475b['id'];if(_0x969c4)_0xe912b8[_0xd9c1('0x5c')]=_0x969c4;return _0xe912b8;})['then'](function(_0x2cc55e){return db[_0xd9c1('0x58')][_0xd9c1('0x4d')](_0x2cc55e,{'include':[{'model':db['UserProfileResource'],'as':_0xd9c1('0x5c')}],'raw':!![],'transaction':_0x2f9044});});})[_0xd9c1('0x2e')](function(){return _0x37475b;});}});});});}})[_0xd9c1('0x2e')](respondWithResult(_0x18b24a,0xc9))[_0xd9c1('0x4a')](handleError(_0x18b24a,null));};exports[_0xd9c1('0x2d')]=function(_0x1a4e7d,_0x1ff317){if(_0x1a4e7d[_0xd9c1('0x4e')]['id']){delete _0x1a4e7d['body']['id'];}return db[_0xd9c1('0x47')]['find']({'where':{'id':_0x1a4e7d[_0xd9c1('0x4f')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x1ff317,null))[_0xd9c1('0x2e')](saveUpdates(_0x1a4e7d[_0xd9c1('0x4e')],null))[_0xd9c1('0x2e')](respondWithResult(_0x1ff317,null))[_0xd9c1('0x4a')](handleError(_0x1ff317,null));};exports[_0xd9c1('0x5d')]=function(_0x15ae8c,_0x3fc82f){return db[_0xd9c1('0x47')][_0xd9c1('0x4c')]({'where':{'id':_0x15ae8c['params']['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x3fc82f,null))['then'](removeEntity(_0x3fc82f,null))[_0xd9c1('0x4a')](handleError(_0x3fc82f,null));};exports['describe']=function(_0x1c99a1,_0x4f8bc4){return db[_0xd9c1('0x47')][_0xd9c1('0x5e')]()[_0xd9c1('0x2e')](respondWithResult(_0x4f8bc4,null))[_0xd9c1('0x4a')](handleError(_0x4f8bc4,null));};exports[_0xd9c1('0x5f')]=function(_0x10b0ba,_0xc91efc){var _0x234484=_0x10b0ba[_0xd9c1('0x4e')];return db[_0xd9c1('0x47')][_0xd9c1('0x4c')]({'where':{'id':_0x10b0ba[_0xd9c1('0x4f')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0xc91efc,null))[_0xd9c1('0x2e')](function(_0x1dfb52){if(_0x1dfb52){return db[_0xd9c1('0x56')]['transaction'](function(_0x3d80b6){return db[_0xd9c1('0x58')][_0xd9c1('0x5d')]({'where':{'userProfileId':_0x10b0ba[_0xd9c1('0x4f')]['id'],'sectionId':_[_0xd9c1('0x33')](_0x234484,function(_0x2484fc){return _0x2484fc[_0xd9c1('0x5b')];})},'transaction':_0x3d80b6})[_0xd9c1('0x2e')](function(){var _0x280e87=_['map'](_0x234484,function(_0x86facc){_0x86facc[_0xd9c1('0x60')]=_0x10b0ba['params']['id'];return _0x86facc;});var _0x3dc696=[];return BPromise[_0xd9c1('0x61')](_0x280e87,function(_0x3b9bf6){return db['UserProfileSection']['create'](_0x3b9bf6,{'include':[{'model':db[_0xd9c1('0x5a')],'as':_0xd9c1('0x5c')}],'raw':!![],'transaction':_0x3d80b6})[_0xd9c1('0x2e')](function(_0x133b29){_0x3dc696[_0xd9c1('0x62')](_0x133b29['get']({'plain':!![]}));});})[_0xd9c1('0x2e')](function(){return _0x3dc696;});});});}})[_0xd9c1('0x2e')](function(_0x2af121){return _0x2af121;})[_0xd9c1('0x2e')](respondWithResult(_0xc91efc,null))[_0xd9c1('0x4a')](handleError(_0xc91efc,null));};exports[_0xd9c1('0x63')]=function(_0x381b6a,_0x5de8a0){var _0x719c3b;return db[_0xd9c1('0x47')][_0xd9c1('0x4c')]({'where':{'id':_0x381b6a[_0xd9c1('0x4f')]['id']},'attributes':['id',_0xd9c1('0x30')]})[_0xd9c1('0x2e')](handleEntityNotFound(_0x5de8a0,null))[_0xd9c1('0x2e')](function(_0xd3c97a){if(_0xd3c97a){_0x719c3b=_0xd3c97a;return db[_0xd9c1('0x58')]['destroy']({'where':{'userProfileId':_0x381b6a[_0xd9c1('0x4f')]['id'],'sectionId':_0x381b6a['query']['ids']}});}})['then'](function(){return _0x719c3b;})[_0xd9c1('0x2e')](respondWithStatusCode(_0x5de8a0,null))[_0xd9c1('0x4a')](handleError(_0x5de8a0,null));};exports[_0xd9c1('0x64')]=function(_0x411ed1,_0x549184){var _0x2c3c78=[];var _0x28c154=[];return db[_0xd9c1('0x58')][_0xd9c1('0x48')]({'where':{'userProfileId':_0x411ed1['params']['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x5e1ac2){_0x2c3c78=_[_0xd9c1('0x43')](_0x5e1ac2,function(_0x3459f2){return _0x3459f2['enabled']===0x1||_[_0xd9c1('0x65')]([0x3eb,0x709],_0x3459f2['sectionId']);});if(!_[_0xd9c1('0x66')](_0x2c3c78)){return _[_0xd9c1('0x33')](_0x2c3c78,function(_0x2223eb){return _0x2223eb[_0xd9c1('0x5b')];});}else{return;}})[_0xd9c1('0x2e')](function(_0x34b44a){if(_0x34b44a)_0x28c154=_0x34b44a;if(_[_0xd9c1('0x65')](_0x28c154,0x64)){var _0x7fad7f=_['find'](_0x2c3c78,{'sectionId':0x64});return hasDefaultDashboard(_0x7fad7f)[_0xd9c1('0x2e')](function(_0x214210){return _['map'](_0x2c3c78,function(_0x21fd5c){if(_0x21fd5c[_0xd9c1('0x5b')]===0x64){_0x21fd5c[_0xd9c1('0x67')]=_0x214210;}return _0x21fd5c;});});}else{return;}})[_0xd9c1('0x2e')](function(_0x2118bd){if(_0x2118bd)_0x2c3c78=_0x2118bd;if(_['includes'](_0x28c154,0x3eb)){var _0x177ff0=_[_0xd9c1('0x4c')](_0x2c3c78,{'sectionId':0x3eb});return getCustomDashboards(_0x177ff0)[_0xd9c1('0x2e')](function(_0x1351ce){return _['map'](_0x2c3c78,function(_0x39baa9){if(_0x177ff0[_0xd9c1('0x68')]){if(_0x39baa9[_0xd9c1('0x5b')]===0x3eb){_0x39baa9[_0xd9c1('0x67')]=_0x1351ce;}}else{if(_0x39baa9['sectionId']===0x64){_0x39baa9['subsections']=_0x1351ce;}}return _0x39baa9;});});}else{return;}})[_0xd9c1('0x2e')](function(_0x599d6a){if(_0x599d6a)_0x2c3c78=_0x599d6a;if(_[_0xd9c1('0x65')](_0x28c154,0x709)){var _0x4bcd77=_[_0xd9c1('0x4c')](_0x2c3c78,{'sectionId':0x709});return getPlugins(_0x4bcd77)[_0xd9c1('0x2e')](function(_0x25aebe){if(_0x4bcd77['enabled']){return _[_0xd9c1('0x33')](_0x2c3c78,function(_0x113836){if(_0x113836['sectionId']===0x709){_0x113836[_0xd9c1('0x67')]=_0x25aebe;}return _0x113836;});}else{var _0x1ef7d0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x25aebe};var _0x5bec38=_[_0xd9c1('0x33')](_0x2c3c78);_0x5bec38['push'](_0x1ef7d0);return _0x5bec38;}});}else{return;}})[_0xd9c1('0x2e')](function(_0x577cd9){if(_0x577cd9)_0x2c3c78=_0x577cd9;return _[_0xd9c1('0x43')](_0x2c3c78,[_0xd9c1('0x68'),0x1]);})[_0xd9c1('0x2e')](respondWithResult(_0x549184,null))['catch'](handleError(_0x549184,null));};function hasDefaultDashboard(_0x2c3dfe){var _0x223480=[0x65];return new BPromise(function(_0x3d10ea,_0x395126){try{if(_0x2c3dfe['autoAssociation']){_0x3d10ea(_0x223480);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x2c3dfe['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x1b685b){_0x1b685b?_0x3d10ea(_0x223480):_0x3d10ea();});}}catch(_0x17b11e){_0x395126(_0x17b11e);}});}function getCustomDashboards(_0x4a7436){var _0x4db1e2=[];return new BPromise(function(_0x1c4124,_0x1a24b0){try{if(_0x4a7436[_0xd9c1('0x59')]){return db['Dashboard'][_0xd9c1('0x48')]({'raw':!![]})[_0xd9c1('0x2e')](function(_0x22f73c){_0x22f73c[_0xd9c1('0x69')](function(_0x4f566b){_0x4db1e2[_0xd9c1('0x62')](_0x4f566b['id']+0x1869f);});_0x1c4124(_0x4db1e2);});}else{return db[_0xd9c1('0x5a')][_0xd9c1('0x48')]({'where':{'sectionId':_0x4a7436['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x4dc0c8){_0x4dc0c8[_0xd9c1('0x69')](function(_0x2b9647){_0x4db1e2[_0xd9c1('0x62')](_0x2b9647[_0xd9c1('0x6a')]+0x1869f);});_0x1c4124(_0x4db1e2);});}}catch(_0x2701af){_0x1a24b0(_0x2701af);}});}function getPlugins(_0x541b72){var _0x7fa87=[];return new BPromise(function(_0x5419f3,_0x312984){try{if(_0x541b72[_0xd9c1('0x59')]){return db[_0xd9c1('0x6b')][_0xd9c1('0x48')]({'raw':!![]})['then'](function(_0x55eee1){_0x55eee1[_0xd9c1('0x69')](function(_0x14749d){_0x7fa87[_0xd9c1('0x62')](_0x14749d['id']+0x15b38);});_0x5419f3(_0x7fa87);});}else{return db[_0xd9c1('0x5a')][_0xd9c1('0x48')]({'where':{'sectionId':_0x541b72['id']},'raw':!![]})[_0xd9c1('0x2e')](function(_0x350fc0){_0x350fc0[_0xd9c1('0x69')](function(_0x56c58d){_0x7fa87['push'](_0x56c58d['resourceId']+0x15b38);});_0x5419f3(_0x7fa87);});}}catch(_0x439339){_0x312984(_0x439339);}});}exports[_0xd9c1('0x6c')]=function(_0x370b12,_0x42acc5){return db[_0xd9c1('0x47')][_0xd9c1('0x4c')]({'where':{'id':_0x370b12[_0xd9c1('0x4f')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x42acc5,null))[_0xd9c1('0x2e')](function(_0xb73034){if(_0xb73034){return db[_0xd9c1('0x56')][_0xd9c1('0x57')](function(_0x4ee431){return db[_0xd9c1('0x58')]['findAll']({'where':{'userProfileId':_0x370b12['params']['id']},'attributes':['id'],'raw':!![]})[_0xd9c1('0x2e')](function(_0x395acc){if(_0x395acc){return db[_0xd9c1('0x58')][_0xd9c1('0x5d')]({'where':{'userProfileId':_0x370b12['params']['id'],'id':_[_0xd9c1('0x33')](_0x395acc,function(_0x4e1cf6){return _0x4e1cf6['id'];})},'transaction':_0x4ee431});}})[_0xd9c1('0x2e')](function(_0x5bb5d3){var _0x2d0f4b=_[_0xd9c1('0x33')](_0x370b12[_0xd9c1('0x4e')],function(_0x42f1d2){_0x42f1d2[_0xd9c1('0x60')]=_0x370b12[_0xd9c1('0x4f')]['id'];return _0x42f1d2;});return db[_0xd9c1('0x58')][_0xd9c1('0x6d')](_0x2d0f4b,{'raw':!![],'transaction':_0x4ee431});})[_0xd9c1('0x2e')](function(_0x204699){var _0x11d835=_[_0xd9c1('0x43')](_['map'](_0x204699,function(_0x599c11){return _0x599c11[_0xd9c1('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x11d835){return db['UserProfileSection'][_0xd9c1('0x48')]({'where':{'userProfileId':_0x370b12['params']['id'],'sectionId':_['map'](_0x11d835,function(_0x6df4a7){return _0x6df4a7[_0xd9c1('0x5b')];})},'attributes':['id',_0xd9c1('0x5b')],'raw':!![]})[_0xd9c1('0x2e')](function(_0x58161b){var _0x3de592=_[_0xd9c1('0x33')](_0x370b12[_0xd9c1('0x4e')],function(_0x3b19ef){_0x3b19ef['userProfileId']=_0x370b12['params']['id'];return _0x3b19ef;});return db[_0xd9c1('0x5a')][_0xd9c1('0x6d')](_0x3de592,{'raw':!![],'transaction':_0x4ee431});});}})['catch'](handleError(_0x42acc5,null));});}})[_0xd9c1('0x2e')](function(_0xb0d713){var _0x4f4936=_[_0xd9c1('0x33')](_0xb0d713,function(_0x5902d7){return _0x5902d7['get']({'plain':!![]});});})[_0xd9c1('0x2e')](respondWithResult(_0x42acc5,null))[_0xd9c1('0x4a')](handleError(_0x42acc5,null));};exports['removeResources']=function(_0x564950,_0x7a6b9f,_0x139519){return db['UserProfile'][_0xd9c1('0x4c')]({'where':{'id':_0x564950[_0xd9c1('0x4f')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x7a6b9f,null))['then'](function(_0x5e2461){if(_0x5e2461){return _0x5e2461['removeResources'](_0x564950[_0xd9c1('0x38')]['ids']);}})[_0xd9c1('0x2e')](respondWithStatusCode(_0x7a6b9f,null))[_0xd9c1('0x4a')](handleError(_0x7a6b9f,null));};exports['getResources']=function(_0x18448f,_0x750de7){var _0x4ed163={};if(!_0x18448f[_0xd9c1('0x38')][_0xd9c1('0x6e')])throw new Error(_0xd9c1('0x6f'));if(!_0x18448f['query'][_0xd9c1('0x70')](_0xd9c1('0x3e'))){_0x4ed163['limit']=qs[_0xd9c1('0x27')](_0x18448f[_0xd9c1('0x38')][_0xd9c1('0x27')]);_0x4ed163[_0xd9c1('0x25')]=qs[_0xd9c1('0x25')](_0x18448f[_0xd9c1('0x38')][_0xd9c1('0x25')]);}return db[_0xd9c1('0x47')][_0xd9c1('0x4c')]({'where':{'id':_0x18448f[_0xd9c1('0x4f')]['id']}})[_0xd9c1('0x2e')](function(_0x456b0){if(!_0x456b0)throw new Error(_0xd9c1('0x71')+_0x18448f[_0xd9c1('0x4f')]['id']);return db['UserProfile'][_0xd9c1('0x72')](_0x18448f);})[_0xd9c1('0x2e')](respondWithFilteredResult(_0x750de7,_0x4ed163))[_0xd9c1('0x4a')](handleError(_0x750de7,null));}; \ No newline at end of file +var _0x8f1a=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','UserProfile','then','includeAll','include','findAll','rows','catch','params','keys','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','describe','addSections','getSections','includes','sectionId','isEmpty','subsections','enabled','push','findOne','Dashboard','forEach','resourceId','addResources','userProfileId','bulkCreate','ids','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x5cddbb,_0x25e6c1){_0x5cddbb=_0x5cddbb-0x0;var _0x55cebf=_0x8f1a[_0x5cddbb];return _0x55cebf;};'use strict';var emlformat=require(_0xa8f1('0x0'));var rimraf=require(_0xa8f1('0x1'));var zipdir=require(_0xa8f1('0x2'));var jsonpatch=require(_0xa8f1('0x3'));var rp=require(_0xa8f1('0x4'));var moment=require(_0xa8f1('0x5'));var BPromise=require(_0xa8f1('0x6'));var Mustache=require(_0xa8f1('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa8f1('0x8'));var csv=require('to-csv');var ejs=require(_0xa8f1('0x9'));var fs=require('fs');var fs_extra=require(_0xa8f1('0xa'));var _=require('lodash');var squel=require(_0xa8f1('0xb'));var crypto=require(_0xa8f1('0xc'));var jsforce=require(_0xa8f1('0xd'));var deskjs=require(_0xa8f1('0xe'));var toCsv=require(_0xa8f1('0xf'));var querystring=require(_0xa8f1('0x10'));var Papa=require(_0xa8f1('0x11'));var Redis=require(_0xa8f1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa8f1('0x13'));var as=require(_0xa8f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8f1('0x15'))('api');var utils=require(_0xa8f1('0x16'));var config=require(_0xa8f1('0x17'));var licenseUtil=require(_0xa8f1('0x18'));var db=require('../../mysqldb')['db'];config[_0xa8f1('0x19')]=_[_0xa8f1('0x1a')](config[_0xa8f1('0x19')],{'host':_0xa8f1('0x1b'),'port':0x18eb});var socket=require(_0xa8f1('0x1c'))(new Redis(config['redis']));require(_0xa8f1('0x1d'))['register'](socket);function respondWithStatusCode(_0x20c6af,_0x78aee6){_0x78aee6=_0x78aee6||0xcc;return function(_0x4a230f){if(_0x4a230f){return _0x20c6af['sendStatus'](_0x78aee6);}return _0x20c6af[_0xa8f1('0x1e')](_0x78aee6)[_0xa8f1('0x1f')]();};}function respondWithResult(_0x2a496d,_0x42c7b1){_0x42c7b1=_0x42c7b1||0xc8;return function(_0x454241){if(_0x454241){return _0x2a496d[_0xa8f1('0x1e')](_0x42c7b1)[_0xa8f1('0x20')](_0x454241);}};}function respondWithFilteredResult(_0x1a840a,_0x28bf9c){return function(_0x124917){if(_0x124917){var _0x453532=typeof _0x28bf9c[_0xa8f1('0x21')]===_0xa8f1('0x22')&&typeof _0x28bf9c[_0xa8f1('0x23')]==='undefined';var _0x57b963=_0x124917[_0xa8f1('0x24')];var _0x378dd9=_0x453532?0x0:_0x28bf9c[_0xa8f1('0x21')];var _0x4f1dd5=_0x453532?_0x124917[_0xa8f1('0x24')]:_0x28bf9c[_0xa8f1('0x21')]+_0x28bf9c[_0xa8f1('0x23')];var _0x31eba8;if(_0x4f1dd5>=_0x57b963){_0x4f1dd5=_0x57b963;_0x31eba8=0xc8;}else{_0x31eba8=0xce;}_0x1a840a[_0xa8f1('0x1e')](_0x31eba8);return _0x1a840a['set'](_0xa8f1('0x25'),_0x378dd9+'-'+_0x4f1dd5+'/'+_0x57b963)[_0xa8f1('0x20')](_0x124917);}return null;};}function patchUpdates(_0x4d905c){return function(_0x3132cc){try{jsonpatch[_0xa8f1('0x26')](_0x3132cc,_0x4d905c,!![]);}catch(_0xa960e4){return BPromise[_0xa8f1('0x27')](_0xa960e4);}return _0x3132cc[_0xa8f1('0x28')]();};}function saveUpdates(_0x2f764d,_0xa0ac0f){return function(_0x2e2dc6){if(_0x2e2dc6){return _0x2e2dc6[_0xa8f1('0x29')](_0x2f764d)['then'](function(_0x3966b6){return _0x3966b6;});}return null;};}function removeEntity(_0x11f825,_0xb6019a){return function(_0x3091d6){if(_0x3091d6){return _0x3091d6[_0xa8f1('0x2a')]()['then'](function(){_0x11f825[_0xa8f1('0x1e')](0xcc)[_0xa8f1('0x1f')]();});}};}function handleEntityNotFound(_0x584d34,_0x560396){return function(_0x528cc4){if(!_0x528cc4){_0x584d34[_0xa8f1('0x2b')](0x194);}return _0x528cc4;};}function handleError(_0x431c11,_0x5c06e0){_0x5c06e0=_0x5c06e0||0x1f4;return function(_0x584151){logger['error'](_0x584151[_0xa8f1('0x2c')]);if(_0x584151[_0xa8f1('0x2d')]){delete _0x584151[_0xa8f1('0x2d')];}_0x431c11[_0xa8f1('0x1e')](_0x5c06e0)[_0xa8f1('0x2e')](_0x584151);};}exports[_0xa8f1('0x2f')]=function(_0x419a70,_0x2bb524){var _0x179ed0={},_0x3641e2={},_0x3ec18d={'count':0x0,'rows':[]};var _0x12be31=_['map'](db['UserProfile'][_0xa8f1('0x30')],function(_0x30ea90){return{'name':_0x30ea90[_0xa8f1('0x31')],'type':_0x30ea90[_0xa8f1('0x32')][_0xa8f1('0x33')]};});_0x3641e2[_0xa8f1('0x34')]=_[_0xa8f1('0x35')](_0x12be31,_0xa8f1('0x2d'));_0x3641e2[_0xa8f1('0x36')]=_['keys'](_0x419a70['query']);_0x3641e2['filters']=_[_0xa8f1('0x37')](_0x3641e2[_0xa8f1('0x34')],_0x3641e2[_0xa8f1('0x36')]);_0x179ed0[_0xa8f1('0x38')]=_[_0xa8f1('0x37')](_0x3641e2['model'],qs['fields'](_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x39')]));_0x179ed0[_0xa8f1('0x38')]=_0x179ed0[_0xa8f1('0x38')][_0xa8f1('0x3a')]?_0x179ed0['attributes']:_0x3641e2[_0xa8f1('0x34')];if(!_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x3b')](_0xa8f1('0x3c'))){_0x179ed0[_0xa8f1('0x23')]=qs['limit'](_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x23')]);_0x179ed0[_0xa8f1('0x21')]=qs[_0xa8f1('0x21')](_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x21')]);}_0x179ed0['order']=qs[_0xa8f1('0x3d')](_0x419a70[_0xa8f1('0x36')]['sort']);_0x179ed0[_0xa8f1('0x3e')]=qs['filters'](_[_0xa8f1('0x3f')](_0x419a70[_0xa8f1('0x36')],_0x3641e2[_0xa8f1('0x40')]),_0x12be31);if(_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x41')]){_0x179ed0['where']=_[_0xa8f1('0x42')](_0x179ed0[_0xa8f1('0x3e')],{'$or':_[_0xa8f1('0x35')](_0x12be31,function(_0x59eadc){if(_0x59eadc['type']!==_0xa8f1('0x43')){var _0x22fc44={};_0x22fc44[_0x59eadc['name']]={'$like':'%'+_0x419a70['query'][_0xa8f1('0x41')]+'%'};return _0x22fc44;}})});}_0x179ed0=_['merge']({},_0x179ed0,_0x419a70[_0xa8f1('0x44')]);var _0x2d6ac6={'where':_0x179ed0[_0xa8f1('0x3e')]};return db[_0xa8f1('0x45')][_0xa8f1('0x24')](_0x2d6ac6)[_0xa8f1('0x46')](function(_0x50da6e){_0x3ec18d[_0xa8f1('0x24')]=_0x50da6e;if(_0x419a70[_0xa8f1('0x36')][_0xa8f1('0x47')]){_0x179ed0[_0xa8f1('0x48')]=[{'all':!![]}];}return db[_0xa8f1('0x45')][_0xa8f1('0x49')](_0x179ed0);})[_0xa8f1('0x46')](function(_0x2c9784){_0x3ec18d[_0xa8f1('0x4a')]=_0x2c9784;return _0x3ec18d;})[_0xa8f1('0x46')](respondWithFilteredResult(_0x2bb524,_0x179ed0))[_0xa8f1('0x4b')](handleError(_0x2bb524,null));};exports['show']=function(_0x227d6c,_0x2f8f9b){var _0x8fb471={'raw':![],'where':{'id':_0x227d6c[_0xa8f1('0x4c')]['id']}},_0x529912={};_0x529912[_0xa8f1('0x34')]=_[_0xa8f1('0x4d')](db['UserProfile'][_0xa8f1('0x30')]);_0x529912[_0xa8f1('0x36')]=_[_0xa8f1('0x4d')](_0x227d6c[_0xa8f1('0x36')]);_0x529912[_0xa8f1('0x40')]=_[_0xa8f1('0x37')](_0x529912['model'],_0x529912['query']);_0x8fb471[_0xa8f1('0x38')]=_['intersection'](_0x529912['model'],qs[_0xa8f1('0x39')](_0x227d6c[_0xa8f1('0x36')][_0xa8f1('0x39')]));_0x8fb471[_0xa8f1('0x38')]=_0x8fb471['attributes'][_0xa8f1('0x3a')]?_0x8fb471[_0xa8f1('0x38')]:_0x529912[_0xa8f1('0x34')];if(_0x227d6c[_0xa8f1('0x36')][_0xa8f1('0x47')]){_0x8fb471[_0xa8f1('0x48')]=[{'all':!![]}];}_0x8fb471=_['merge']({},_0x8fb471,_0x227d6c['options']);return db[_0xa8f1('0x45')][_0xa8f1('0x4e')](_0x8fb471)[_0xa8f1('0x46')](handleEntityNotFound(_0x2f8f9b,null))['then'](respondWithResult(_0x2f8f9b,null))[_0xa8f1('0x4b')](handleError(_0x2f8f9b,null));};exports[_0xa8f1('0x4f')]=function(_0x296adf,_0x5365e4){return db[_0xa8f1('0x45')][_0xa8f1('0x4f')](_0x296adf[_0xa8f1('0x50')],{})[_0xa8f1('0x46')](respondWithResult(_0x5365e4,0xc9))['catch'](handleError(_0x5365e4,null));};exports[_0xa8f1('0x51')]=function(_0x209ccd,_0x123622){var _0x470a69={'where':{'id':_0x209ccd['params']['id']}},_0x438e3a={};_0x438e3a[_0xa8f1('0x34')]=_[_0xa8f1('0x4d')](db[_0xa8f1('0x45')][_0xa8f1('0x30')]);_0x470a69['attributes']=_[_0xa8f1('0x37')](_0x438e3a[_0xa8f1('0x34')],qs[_0xa8f1('0x39')](_0x209ccd[_0xa8f1('0x36')]['fields']));_0x470a69[_0xa8f1('0x38')]=_0x470a69[_0xa8f1('0x38')][_0xa8f1('0x3a')]?_0x470a69[_0xa8f1('0x38')]:_0x438e3a[_0xa8f1('0x34')];if(_0x209ccd[_0xa8f1('0x36')][_0xa8f1('0x47')]){_0x470a69[_0xa8f1('0x48')]=[{'all':!![]}];}_0x470a69=_[_0xa8f1('0x42')]({},_0x470a69,_0x209ccd[_0xa8f1('0x44')]);return db[_0xa8f1('0x45')][_0xa8f1('0x4e')](_0x470a69)[_0xa8f1('0x46')](handleEntityNotFound(_0x123622,null))[_0xa8f1('0x46')](function(_0x4766c7){if(_0x4766c7){var _0x4f6522=_0x4766c7[_0xa8f1('0x52')]({'plain':!![]});_0x4f6522=qs[_0xa8f1('0x53')](_0x4f6522,['id',_0xa8f1('0x54'),_0xa8f1('0x55'),_0xa8f1('0x56')]);_0x209ccd[_0xa8f1('0x50')]=_[_0xa8f1('0x53')](_0x209ccd[_0xa8f1('0x50')],['id',_0xa8f1('0x54'),_0xa8f1('0x55')]);return db[_0xa8f1('0x57')][_0xa8f1('0x58')](function(_0x169e9a){return db[_0xa8f1('0x45')][_0xa8f1('0x4f')](_[_0xa8f1('0x42')](_0x4f6522,_0x209ccd[_0xa8f1('0x50')]),{'include':_0x209ccd[_0xa8f1('0x36')][_0xa8f1('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x169e9a})['then'](function(_0x256a9d){var _0xb7d4df=_0x256a9d['get']({'plain':!![]});return db[_0xa8f1('0x59')][_0xa8f1('0x49')]({'where':{'userProfileId':_0x209ccd['params']['id']},'raw':!![]})[_0xa8f1('0x46')](function(_0x302fb7){if(_0x302fb7){return BPromise[_0xa8f1('0x5a')](_0x302fb7,function(_0x16c41c){return new BPromise(function(_0x1c0c64,_0xe97fca){if(_0x16c41c[_0xa8f1('0x5b')]===null||_0x16c41c[_0xa8f1('0x5b')]===0x1)_0x1c0c64(null);return db[_0xa8f1('0x5c')][_0xa8f1('0x49')]({'where':{'sectionId':_0x16c41c['id']},'raw':!![]})[_0xa8f1('0x46')](function(_0x1d2a95){var _0x5dd096=_[_0xa8f1('0x35')](_0x1d2a95,function(_0x1b893a){return qs[_0xa8f1('0x53')](_0x1b893a,['id','createdAt',_0xa8f1('0x55'),'sectionId']);});_0x1c0c64(_0x5dd096);})[_0xa8f1('0x4b')](function(_0x23a4a5){_0xe97fca(_0x23a4a5);});})[_0xa8f1('0x46')](function(_0x57d29e){var _0x4b38c2=qs['omit'](_0x16c41c,['id','createdAt',_0xa8f1('0x55')]);_0x4b38c2['userProfileId']=_0xb7d4df['id'];if(_0x57d29e)_0x4b38c2['Resources']=_0x57d29e;return _0x4b38c2;})[_0xa8f1('0x46')](function(_0x2a10b2){return db[_0xa8f1('0x59')]['create'](_0x2a10b2,{'include':[{'model':db[_0xa8f1('0x5c')],'as':_0xa8f1('0x5d')}],'raw':!![],'transaction':_0x169e9a});});})[_0xa8f1('0x46')](function(){return _0xb7d4df;});}});});});}})[_0xa8f1('0x46')](respondWithResult(_0x123622,0xc9))[_0xa8f1('0x4b')](handleError(_0x123622,null));};exports[_0xa8f1('0x29')]=function(_0x533da6,_0x4ef328){if(_0x533da6['body']['id']){delete _0x533da6[_0xa8f1('0x50')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x533da6['params']['id']}})['then'](handleEntityNotFound(_0x4ef328,null))[_0xa8f1('0x46')](saveUpdates(_0x533da6[_0xa8f1('0x50')],null))[_0xa8f1('0x46')](respondWithResult(_0x4ef328,null))[_0xa8f1('0x4b')](handleError(_0x4ef328,null));};exports[_0xa8f1('0x2a')]=function(_0x2093bf,_0x319be2){return db[_0xa8f1('0x45')]['find']({'where':{'id':_0x2093bf['params']['id']}})['then'](handleEntityNotFound(_0x319be2,null))['then'](removeEntity(_0x319be2,null))[_0xa8f1('0x4b')](handleError(_0x319be2,null));};exports[_0xa8f1('0x5e')]=function(_0x3a752e,_0x23b139){return db['UserProfile'][_0xa8f1('0x5e')]()[_0xa8f1('0x46')](respondWithResult(_0x23b139,null))[_0xa8f1('0x4b')](handleError(_0x23b139,null));};exports[_0xa8f1('0x5f')]=function(_0x300d95,_0x5ba2af){var _0x3b5fca=_0x300d95['body'];return db[_0xa8f1('0x45')]['find']({'where':{'id':_0x300d95['params']['id']}})[_0xa8f1('0x46')](handleEntityNotFound(_0x5ba2af,null))[_0xa8f1('0x46')](function(_0x5807dd){if(_0x5807dd){return db[_0xa8f1('0x57')][_0xa8f1('0x58')](function(_0x33d27d){return db[_0xa8f1('0x59')]['destroy']({'where':{'userProfileId':_0x300d95[_0xa8f1('0x4c')]['id'],'sectionId':_['map'](_0x3b5fca,function(_0x3d4075){return _0x3d4075['sectionId'];})},'transaction':_0x33d27d})['then'](function(){var _0x2aee34=_[_0xa8f1('0x35')](_0x3b5fca,function(_0x10ad88){_0x10ad88['userProfileId']=_0x300d95[_0xa8f1('0x4c')]['id'];return _0x10ad88;});var _0x4238c0=[];return BPromise[_0xa8f1('0x5a')](_0x2aee34,function(_0x1548c0){return db['UserProfileSection'][_0xa8f1('0x4f')](_0x1548c0,{'include':[{'model':db[_0xa8f1('0x5c')],'as':_0xa8f1('0x5d')}],'raw':!![],'transaction':_0x33d27d})[_0xa8f1('0x46')](function(_0xabe88e){_0x4238c0['push'](_0xabe88e['get']({'plain':!![]}));});})[_0xa8f1('0x46')](function(){return _0x4238c0;});});});}})['then'](function(_0x428e62){return _0x428e62;})['then'](respondWithResult(_0x5ba2af,null))[_0xa8f1('0x4b')](handleError(_0x5ba2af,null));};exports['removeSections']=function(_0x3f6bc,_0x3777be){var _0x24559b;return db[_0xa8f1('0x45')][_0xa8f1('0x4e')]({'where':{'id':_0x3f6bc['params']['id']},'attributes':['id',_0xa8f1('0x2d')]})['then'](handleEntityNotFound(_0x3777be,null))[_0xa8f1('0x46')](function(_0x471987){if(_0x471987){_0x24559b=_0x471987;return db[_0xa8f1('0x59')][_0xa8f1('0x2a')]({'where':{'userProfileId':_0x3f6bc[_0xa8f1('0x4c')]['id'],'sectionId':_0x3f6bc[_0xa8f1('0x36')]['ids']}});}})['then'](function(){return _0x24559b;})[_0xa8f1('0x46')](respondWithStatusCode(_0x3777be,null))['catch'](handleError(_0x3777be,null));};exports[_0xa8f1('0x60')]=function(_0x532390,_0x355c26){var _0x5a09be=[];var _0x4bb80b=[];return db[_0xa8f1('0x59')][_0xa8f1('0x49')]({'where':{'userProfileId':_0x532390[_0xa8f1('0x4c')]['id']},'raw':!![]})[_0xa8f1('0x46')](function(_0xaabb5f){_0x5a09be=_[_0xa8f1('0x41')](_0xaabb5f,function(_0x159146){return _0x159146['enabled']===0x1||_[_0xa8f1('0x61')]([0x3eb,0x709],_0x159146[_0xa8f1('0x62')]);});if(!_[_0xa8f1('0x63')](_0x5a09be)){return _[_0xa8f1('0x35')](_0x5a09be,function(_0x15f41a){return _0x15f41a['sectionId'];});}else{return;}})[_0xa8f1('0x46')](function(_0x519749){if(_0x519749)_0x4bb80b=_0x519749;if(_[_0xa8f1('0x61')](_0x4bb80b,0x64)){var _0x402b35=_[_0xa8f1('0x4e')](_0x5a09be,{'sectionId':0x64});return hasDefaultDashboard(_0x402b35)['then'](function(_0x554183){return _['map'](_0x5a09be,function(_0x2aca4b){if(_0x2aca4b[_0xa8f1('0x62')]===0x64){_0x2aca4b[_0xa8f1('0x64')]=_0x554183;}return _0x2aca4b;});});}else{return;}})[_0xa8f1('0x46')](function(_0x2e9669){if(_0x2e9669)_0x5a09be=_0x2e9669;if(_['includes'](_0x4bb80b,0x3eb)){var _0x17e2d2=_['find'](_0x5a09be,{'sectionId':0x3eb});return getCustomDashboards(_0x17e2d2)[_0xa8f1('0x46')](function(_0x2bdeb3){return _[_0xa8f1('0x35')](_0x5a09be,function(_0x1d1640){if(_0x17e2d2[_0xa8f1('0x65')]){if(_0x1d1640['sectionId']===0x3eb){_0x1d1640[_0xa8f1('0x64')]=_0x2bdeb3;}}else{if(_0x1d1640[_0xa8f1('0x62')]===0x64){_0x1d1640[_0xa8f1('0x64')]=_0x2bdeb3;}}return _0x1d1640;});});}else{return;}})['then'](function(_0x47322c){if(_0x47322c)_0x5a09be=_0x47322c;if(_[_0xa8f1('0x61')](_0x4bb80b,0x709)){var _0x2d1359=_[_0xa8f1('0x4e')](_0x5a09be,{'sectionId':0x709});return getPlugins(_0x2d1359)['then'](function(_0x440e87){if(_0x2d1359[_0xa8f1('0x65')]){return _[_0xa8f1('0x35')](_0x5a09be,function(_0x1a1e98){if(_0x1a1e98[_0xa8f1('0x62')]===0x709){_0x1a1e98[_0xa8f1('0x64')]=_0x440e87;}return _0x1a1e98;});}else{var _0x3b58e0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x440e87};var _0x371093=_[_0xa8f1('0x35')](_0x5a09be);_0x371093[_0xa8f1('0x66')](_0x3b58e0);return _0x371093;}});}else{return;}})[_0xa8f1('0x46')](function(_0x4bf2ab){if(_0x4bf2ab)_0x5a09be=_0x4bf2ab;return _[_0xa8f1('0x41')](_0x5a09be,[_0xa8f1('0x65'),0x1]);})[_0xa8f1('0x46')](respondWithResult(_0x355c26,null))[_0xa8f1('0x4b')](handleError(_0x355c26,null));};function hasDefaultDashboard(_0x35f107){var _0x3dafb7=[0x65];return new BPromise(function(_0x4c76c3,_0x1ae436){try{if(_0x35f107[_0xa8f1('0x5b')]){_0x4c76c3(_0x3dafb7);}else{return db['UserProfileResource'][_0xa8f1('0x67')]({'where':{'sectionId':_0x35f107['id']},'raw':!![]})[_0xa8f1('0x46')](function(_0x4c00c6){_0x4c00c6?_0x4c76c3(_0x3dafb7):_0x4c76c3();});}}catch(_0x5534e6){_0x1ae436(_0x5534e6);}});}function getCustomDashboards(_0x734eb4){var _0x3c37b8=[];return new BPromise(function(_0x523b7e,_0x59340d){try{if(_0x734eb4[_0xa8f1('0x5b')]){return db[_0xa8f1('0x68')]['findAll']({'raw':!![]})[_0xa8f1('0x46')](function(_0x4c7fd7){_0x4c7fd7[_0xa8f1('0x69')](function(_0x472b87){_0x3c37b8['push'](_0x472b87['id']+0x1869f);});_0x523b7e(_0x3c37b8);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x734eb4['id']},'raw':!![]})[_0xa8f1('0x46')](function(_0x13df7a){_0x13df7a[_0xa8f1('0x69')](function(_0x10964f){_0x3c37b8[_0xa8f1('0x66')](_0x10964f[_0xa8f1('0x6a')]+0x1869f);});_0x523b7e(_0x3c37b8);});}}catch(_0x2203c9){_0x59340d(_0x2203c9);}});}function getPlugins(_0x5ec14d){var _0x3c5e46=[];return new BPromise(function(_0x166c85,_0x4a010d){try{if(_0x5ec14d[_0xa8f1('0x5b')]){return db['Plugin']['findAll']({'raw':!![]})['then'](function(_0x3f4cde){_0x3f4cde['forEach'](function(_0x34fe41){_0x3c5e46[_0xa8f1('0x66')](_0x34fe41['id']+0x15b38);});_0x166c85(_0x3c5e46);});}else{return db[_0xa8f1('0x5c')]['findAll']({'where':{'sectionId':_0x5ec14d['id']},'raw':!![]})['then'](function(_0x35e70a){_0x35e70a[_0xa8f1('0x69')](function(_0x11e625){_0x3c5e46[_0xa8f1('0x66')](_0x11e625['resourceId']+0x15b38);});_0x166c85(_0x3c5e46);});}}catch(_0x2c25da){_0x4a010d(_0x2c25da);}});}exports[_0xa8f1('0x6b')]=function(_0x393de9,_0x34f1db){return db[_0xa8f1('0x45')][_0xa8f1('0x4e')]({'where':{'id':_0x393de9[_0xa8f1('0x4c')]['id']}})[_0xa8f1('0x46')](handleEntityNotFound(_0x34f1db,null))[_0xa8f1('0x46')](function(_0xcec656){if(_0xcec656){return db[_0xa8f1('0x57')][_0xa8f1('0x58')](function(_0x59cb18){return db[_0xa8f1('0x59')][_0xa8f1('0x49')]({'where':{'userProfileId':_0x393de9[_0xa8f1('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0xa8f1('0x46')](function(_0x3b2134){if(_0x3b2134){return db[_0xa8f1('0x59')]['destroy']({'where':{'userProfileId':_0x393de9['params']['id'],'id':_[_0xa8f1('0x35')](_0x3b2134,function(_0x15180f){return _0x15180f['id'];})},'transaction':_0x59cb18});}})[_0xa8f1('0x46')](function(_0x482f06){var _0x1a8f94=_[_0xa8f1('0x35')](_0x393de9[_0xa8f1('0x50')],function(_0x567cfa){_0x567cfa[_0xa8f1('0x6c')]=_0x393de9[_0xa8f1('0x4c')]['id'];return _0x567cfa;});return db['UserProfileSection'][_0xa8f1('0x6d')](_0x1a8f94,{'raw':!![],'transaction':_0x59cb18});})[_0xa8f1('0x46')](function(_0x936bed){var _0x5a3e1a=_[_0xa8f1('0x41')](_[_0xa8f1('0x35')](_0x936bed,function(_0x259f40){return _0x259f40['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5a3e1a){return db[_0xa8f1('0x59')][_0xa8f1('0x49')]({'where':{'userProfileId':_0x393de9['params']['id'],'sectionId':_[_0xa8f1('0x35')](_0x5a3e1a,function(_0x38592c){return _0x38592c[_0xa8f1('0x62')];})},'attributes':['id',_0xa8f1('0x62')],'raw':!![]})['then'](function(_0x2a2543){var _0x5eb327=_[_0xa8f1('0x35')](_0x393de9['body'],function(_0x1154da){_0x1154da[_0xa8f1('0x6c')]=_0x393de9[_0xa8f1('0x4c')]['id'];return _0x1154da;});return db[_0xa8f1('0x5c')][_0xa8f1('0x6d')](_0x5eb327,{'raw':!![],'transaction':_0x59cb18});});}})[_0xa8f1('0x4b')](handleError(_0x34f1db,null));});}})['then'](function(_0x2fac68){var _0x48b88d=_['map'](_0x2fac68,function(_0x88a898){return _0x88a898[_0xa8f1('0x52')]({'plain':!![]});});})[_0xa8f1('0x46')](respondWithResult(_0x34f1db,null))[_0xa8f1('0x4b')](handleError(_0x34f1db,null));};exports['removeResources']=function(_0x4ad3d2,_0x1cffd6,_0xf75dc7){return db[_0xa8f1('0x45')]['find']({'where':{'id':_0x4ad3d2[_0xa8f1('0x4c')]['id']}})[_0xa8f1('0x46')](handleEntityNotFound(_0x1cffd6,null))[_0xa8f1('0x46')](function(_0x5e5a1c){if(_0x5e5a1c){return _0x5e5a1c['removeResources'](_0x4ad3d2[_0xa8f1('0x36')][_0xa8f1('0x6e')]);}})[_0xa8f1('0x46')](respondWithStatusCode(_0x1cffd6,null))[_0xa8f1('0x4b')](handleError(_0x1cffd6,null));};exports[_0xa8f1('0x6f')]=function(_0x8ad99,_0x92d769){var _0x34e1b6={};if(!_0x8ad99[_0xa8f1('0x36')]['section'])throw new Error(_0xa8f1('0x70'));if(!_0x8ad99[_0xa8f1('0x36')][_0xa8f1('0x3b')](_0xa8f1('0x3c'))){_0x34e1b6['limit']=qs[_0xa8f1('0x23')](_0x8ad99[_0xa8f1('0x36')][_0xa8f1('0x23')]);_0x34e1b6[_0xa8f1('0x21')]=qs[_0xa8f1('0x21')](_0x8ad99[_0xa8f1('0x36')]['offset']);}return db[_0xa8f1('0x45')]['find']({'where':{'id':_0x8ad99[_0xa8f1('0x4c')]['id']}})[_0xa8f1('0x46')](function(_0x54ca76){if(!_0x54ca76)throw new Error(_0xa8f1('0x71')+_0x8ad99[_0xa8f1('0x4c')]['id']);return db[_0xa8f1('0x45')][_0xa8f1('0x6f')](_0x8ad99);})[_0xa8f1('0x46')](respondWithFilteredResult(_0x92d769,_0x34e1b6))[_0xa8f1('0x4b')](handleError(_0x92d769,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8a1c863..e25321d 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 _0x4819=['save','update','remove','emit','exports','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0x4819,0xcd));var _0x9481=function(_0x4e1ecc,_0x4497cf){_0x4e1ecc=_0x4e1ecc-0x0;var _0x5d9775=_0x4819[_0x4e1ecc];return _0x5d9775;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9481('0x0'))['db'][_0x9481('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9481('0x2')](0x0);var events={'afterCreate':_0x9481('0x3'),'afterUpdate':_0x9481('0x4'),'afterDestroy':_0x9481('0x5')};function emitEvent(_0x40a703){return function(_0x14dc10,_0xc39edf,_0x16c617){UserProfileEvents['emit'](_0x40a703+':'+_0x14dc10['id'],_0x14dc10);UserProfileEvents[_0x9481('0x6')](_0x40a703,_0x14dc10);_0x16c617(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9481('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1574=['UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x10dd94,_0x505d61){var _0x31057a=function(_0x539c47){while(--_0x539c47){_0x10dd94['push'](_0x10dd94['shift']());}};_0x31057a(++_0x505d61);}(_0x1574,0x148));var _0x4157=function(_0x4a2262,_0x5a4e03){_0x4a2262=_0x4a2262-0x0;var _0x19d70a=_0x1574[_0x4a2262];return _0x19d70a;};'use strict';var EventEmitter=require(_0x4157('0x0'));var UserProfile=require(_0x4157('0x1'))['db'][_0x4157('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4157('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4157('0x4'),'afterDestroy':_0x4157('0x5')};function emitEvent(_0xab8757){return function(_0x1759d6,_0x2f0766,_0x1c528e){UserProfileEvents[_0x4157('0x6')](_0xab8757+':'+_0x1759d6['id'],_0x1759d6);UserProfileEvents[_0x4157('0x6')](_0xab8757,_0x1759d6);_0x1c528e(null);};}for(var e in events){if(events[_0x4157('0x7')](e)){var event=events[e];UserProfile[_0x4157('0x8')](e,emitEvent(event));}}module[_0x4157('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 209f721..b25c924 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 _0xb091=['map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','Disposition','Dashboard','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','ignore','isEmpty','union','push','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','default','DefaultReports','custom','CustomReports','count','rows','include','Tag','Tags','color','tag','ThroughTags','openTabs','true','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','value','findAll','then','associatedResources'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xb091,0x16e));var _0x1b09=function(_0x2d16e0,_0x45c01f){_0x2d16e0=_0x2d16e0-0x0;var _0x17d74a=_0xb091[_0x2d16e0];return _0x17d74a;};'use strict';var _=require('lodash');var attributes=require(_0x1b09('0x0'));var qs=require(_0x1b09('0x1'));var squel=require(_0x1b09('0x2'));module[_0x1b09('0x3')]=function(_0x56c107){var _0xa6ef49=_0x56c107['models'];function _0x5aa3b0(_0x295863,_0x24d22c){return new Promise(function(_0x4e252c,_0xda8caa){if(!_0x24d22c)return _0x4e252c(null);var _0x5fa348=_0x24d22c[_0x1b09('0x4')]?{[_0x24d22c['filter'][_0x1b09('0x5')]]:_0x24d22c[_0x1b09('0x4')][_0x1b09('0x6')]}:undefined;return _0xa6ef49[_0x295863][_0x1b09('0x7')]({'where':_0x5fa348,'raw':!![]})[_0x1b09('0x8')](function(_0x3362e4){_0x24d22c[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x3362e4,'id');_0x4e252c(_0x24d22c);})[_0x1b09('0xb')](function(_0x36aa1b){_0xda8caa(_0x36aa1b);});});}function _0x14dac6(_0x5f31ac,_0x40082a){return new Promise(function(_0x894b73,_0x5690cb){var _0x4c28c4=_0x5f31ac[_0x1b09('0x4')]?{[_0x5f31ac[_0x1b09('0x4')][_0x1b09('0x5')]]:_0x5f31ac[_0x1b09('0x4')][_0x1b09('0x6')]}:undefined;return _0xa6ef49[_0x5f31ac[_0x1b09('0xc')]][_0x1b09('0x7')]({'where':_0x4c28c4,'raw':!![]})['then'](function(_0x37fdb2){_0x40082a['associatedResources']=_[_0x1b09('0xa')](_0x37fdb2,function(_0x27a731){return _0x27a731[_0x1b09('0xd')];});_0x894b73(_0x40082a);})[_0x1b09('0xb')](function(_0x10b7eb){_0x5690cb(_0x10b7eb);});});}function _0x1dc96b(_0x64689a,_0x33129b,_0x1196b2){if(!_0x33129b)return Promise[_0x1b09('0xe')](null);return new Promise(function(_0x311158,_0x231ef6){return _0xa6ef49[_0x1b09('0xf')]['findAll']({'where':{'sectionId':_0x33129b['id']},'raw':!![]})[_0x1b09('0x8')](function(_0x1c1ef9){if(_0x64689a['field']&&_0x64689a['field']!=='id'){_0x33129b[_0x1b09('0x9')]=_['map'](_0x1c1ef9,function(_0x267b5e){return _0x267b5e[_0x64689a['field']];});}else{if(_0x1196b2===_0x1b09('0x10')){_0x33129b[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x1c1ef9,function(_0x1e8f97){return{'id':_0x1e8f97[_0x1b09('0x11')],'type':_0x1e8f97[_0x1b09('0x12')]};});}else{_0x33129b[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x1c1ef9,function(_0x48b803){return _0x48b803['resourceId'];});}}_0x311158(_0x33129b);})[_0x1b09('0xb')](function(_0x41c786){_0x231ef6(_0x41c786);});});}function _0x4ce7dc(_0x3c0496,_0x11d0d5){var _0x6e132c={'parentSections':[]};switch(_0x3c0496[_0x1b09('0x13')]()){case'squareprojects':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x15');break;case'odbc':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x16');break;case'squarerecordings':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x17');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x19'),'field':'name','foreignKey':_0x1b09('0x1a')}];break;case _0x1b09('0x1b'):_0x6e132c['childModel']=_0x1b09('0x1c');break;case _0x1b09('0x1d'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x1e');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x1f'),'field':'id','foreignKey':_0x1b09('0x20')}];break;case'lists':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x21');break;case'companies':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x22');break;case _0x1b09('0x23'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x24');break;case'chatqueues':_0x6e132c[_0x1b09('0x14')]='ChatQueue';break;case _0x1b09('0x25'):_0x6e132c['childModel']=_0x1b09('0x26');break;case _0x1b09('0x27'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x28');break;case _0x1b09('0x29'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x2a');break;case _0x1b09('0x2b'):case _0x1b09('0x2c'):case _0x1b09('0x2d'):_0x6e132c['childModel']=_0x1b09('0x2e');break;case _0x1b09('0x2f'):_0x6e132c[_0x1b09('0x14')]='VoiceContext';break;case _0x1b09('0x30'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x31');break;case _0x1b09('0x32'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x33');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x34'),'field':'name','foreignKey':_0x1b09('0x35'),'model':'User','filter':{'field':_0x1b09('0x36'),'value':['agent']}},{'name':_0x1b09('0x37'),'field':_0x1b09('0xd'),'foreignKey':_0x1b09('0x35'),'model':_0x1b09('0x38'),'filter':{'field':_0x1b09('0x36'),'value':[_0x1b09('0x39')]}},{'name':_0x1b09('0x3a'),'field':_0x1b09('0xd'),'foreignKey':_0x1b09('0x3b'),'model':_0x1b09('0x3c'),'filter':{'field':_0x1b09('0x12'),'value':[_0x1b09('0x3d')]}},{'name':_0x1b09('0x3e'),'field':'name','foreignKey':'queue','model':_0x1b09('0x3c'),'filter':{'field':_0x1b09('0x12'),'value':[_0x1b09('0x3f')]}}];break;case _0x1b09('0x40'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x41');break;case _0x1b09('0x42'):_0x6e132c[_0x1b09('0x14')]='VoiceChanSpy';break;case'voiceprefixes':_0x6e132c[_0x1b09('0x14')]='VoicePrefix';break;case _0x1b09('0x43'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x44');break;case'mailqueues':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x45');break;case _0x1b09('0x46'):_0x6e132c['childModel']=_0x1b09('0x47');break;case _0x1b09('0x48'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x49');break;case'openchannelqueues':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4a');break;case'openchannelaccounts':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4b');break;case'smsqueues':_0x6e132c['childModel']='SmsQueue';break;case'smsaccounts':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4c');break;case _0x1b09('0x4d'):_0x6e132c['childModel']=_0x1b09('0x4e');break;case _0x1b09('0x4f'):_0x6e132c['childModel']=_0x1b09('0x50');break;case _0x1b09('0x51'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x52');break;case _0x1b09('0x53'):case _0x1b09('0x54'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x3c');if(_0x11d0d5){_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x3a')},{'name':'QueueCampaigns'}];}break;case _0x1b09('0x55'):case _0x1b09('0x56'):case _0x1b09('0x57'):_0x6e132c['childModel']=_0x1b09('0x38');if(_0x11d0d5){_0x6e132c['parentSections']=[{'name':_0x1b09('0x58'),'filter':{'field':_0x1b09('0x36'),'value':['admin',_0x1b09('0x59')]},'ignore':!![]},{'name':_0x1b09('0x34')},{'name':_0x1b09('0x37')}];}break;case _0x1b09('0x5a'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x5b');break;case'salesforceaccounts':_0x6e132c[_0x1b09('0x14')]='SalesforceAccount';break;case _0x1b09('0x5c'):_0x6e132c['childModel']='FreshdeskAccount';break;case _0x1b09('0x5d'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x5e');break;case _0x1b09('0x5f'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x60');break;case _0x1b09('0x61'):_0x6e132c[_0x1b09('0x14')]='ZohoAccount';break;case _0x1b09('0x62'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x38');break;case'cannedanswers':_0x6e132c['childModel']=_0x1b09('0x63');break;case'dispositions':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x64');break;case'customdashboards':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x65');break;case'intervals':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x66');break;case _0x1b09('0x67'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x68');break;case'scheduler':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x69');break;case _0x1b09('0x6a'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x6b');break;case _0x1b09('0x6c'):_0x6e132c[_0x1b09('0x14')]='Tag';break;case'templates':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x6d');break;case _0x1b09('0x6e'):_0x6e132c['childModel']=_0x1b09('0x6f');break;case _0x1b09('0x70'):_0x6e132c[_0x1b09('0x14')]='Trunk';break;case _0x1b09('0x71'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x72');break;case _0x1b09('0x73'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x74');break;case _0x1b09('0x75'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x10');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x76'),'field':'id','foreignKey':_0x1b09('0x77')}];break;case _0x1b09('0x78'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x79');break;}return _0x6e132c;}function _0x4ca41c(_0x5766cb,_0x2cc31e){var _0x54efba=_0x5766cb[_0x1b09('0x7a')](0x0)[_0x1b09('0x7b')]()+_0x5766cb[_0x1b09('0x7c')](0x1);var _0x5b284f={'type':_0xa6ef49['Sequelize'][_0x1b09('0x7d')][_0x1b09('0x7e')],'raw':!![]};return new Promise(function(_0x5ad730,_0xbaf193){var _0x2f2388=squel[_0x1b09('0x7f')]()[_0x1b09('0x5')](_0x1b09('0x80')+_0x54efba+_0x1b09('0x81'),'id')[_0x1b09('0x5')]('ui.createdAt')[_0x1b09('0x82')]('user_has_'+_0x5766cb+_0x1b09('0x83'),'ui')[_0x1b09('0x84')](_0x1b09('0x85'),_0x2cc31e['id']);return _0xa6ef49[_0x1b09('0x86')][_0x1b09('0x87')](_0x2f2388[_0x1b09('0x88')](),_0x5b284f)[_0x1b09('0x8')](function(_0x44ffc1){_0x2cc31e[_0x54efba+_0x1b09('0x89')]=_0x44ffc1;_0x5ad730(_0x44ffc1);})[_0x1b09('0xb')](function(_0x391790){_0xbaf193(_0x391790);});});}return _0x56c107[_0x1b09('0x8a')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x14f94b){var _0x314411={'raw':![],'where':{}};var _0x7e199d={};var _0x4c3068={'count':0x0,'rows':[]};var _0x42fa10=_0x14f94b[_0x1b09('0x87')][_0x1b09('0x8b')];var _0x57bec1=_0x14f94b[_0x1b09('0x87')][_0x1b09('0x8c')]||![];var _0x187a11=_0x4ce7dc(_0x42fa10,_0x57bec1);if(!_0x187a11['childModel'])throw new Error(_0x1b09('0x8d')+_0x42fa10+'\x27');var _0x54c7c6=[{'name':_0x42fa10}];if(!_['isEmpty'](_0x187a11[_0x1b09('0x18')]))_0x54c7c6=_0x187a11[_0x1b09('0x18')];var _0x10e809=[];for(var _0x527f4e=0x0;_0x527f4e<_0x54c7c6[_0x1b09('0x8e')];_0x527f4e++){_0x10e809['push'](_0xa6ef49[_0x1b09('0x8f')][_0x1b09('0x90')]({'where':{'userProfileId':_0x14f94b['params']['id'],'name':_0x54c7c6[_0x527f4e][_0x1b09('0xd')]},'raw':!![]}));}return Promise['all'](_0x10e809)[_0x1b09('0x8')](function(_0x2a537d){var _0x52b5cf=_[_0x1b09('0x4')](_0x2a537d,function(_0x597a68){return _0x597a68?_0x597a68:undefined;});var _0x2472b4=_[_0x1b09('0x4')](_0x54c7c6,[_0x1b09('0x91'),!![]]);var _0x1a357d=_[_0x1b09('0x92')](_0x52b5cf)&&_['isEmpty'](_0x2472b4)?null:_[_0x1b09('0x93')](_0x2472b4,_0x52b5cf);if(!_0x1a357d)return null;var _0x150b7e=[];for(var _0x410138=0x0;_0x410138<_0x1a357d['length'];_0x410138++){var _0x701d0e=_[_0x1b09('0x90')](_0x54c7c6,function(_0x29cf4e){return _0x1a357d[_0x410138]?_0x29cf4e[_0x1b09('0xd')]===_0x1a357d[_0x410138][_0x1b09('0xd')]:null;});if(_0x701d0e){if(_0x1a357d[_0x410138]['ignore']){_0x150b7e[_0x1b09('0x94')](_0x5aa3b0(_0x187a11['childModel'],_0x1a357d[_0x410138]));}else{if(!_0x1a357d[_0x410138][_0x1b09('0x95')]){_0x150b7e[_0x1b09('0x94')](_0x1dc96b(_0x701d0e,_0x1a357d[_0x410138],_0x187a11[_0x1b09('0x14')]));}else{if(_0x701d0e[_0x1b09('0xc')]){_0x150b7e[_0x1b09('0x94')](_0x14dac6(_0x701d0e,_0x1a357d[_0x410138]));}}}}}return Promise[_0x1b09('0x96')](_0x150b7e);})[_0x1b09('0x8')](function(_0x3db691){var _0x4e74de=_0x3db691;var _0xdcd93e=null;if(_0x4e74de){_0xdcd93e=_0x4e74de[_0x1b09('0x8e')]===0x1?_0x4e74de[0x0]:null;}if(!_0xdcd93e&&!_0x4e74de)return _0x4c3068;var _0x58c56e=_0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x97')];_0x7e199d[_0x1b09('0xc')]=_[_0x1b09('0x98')](_0x58c56e);_0x7e199d[_0x1b09('0x87')]=_[_0x1b09('0x98')](_0x14f94b[_0x1b09('0x87')]);_0x7e199d[_0x1b09('0x99')]=_[_0x1b09('0x9a')](_0x7e199d['model'],_0x7e199d[_0x1b09('0x87')]);_0x314411[_0x1b09('0x9b')]=_[_0x1b09('0x9a')](_0x7e199d[_0x1b09('0xc')],qs[_0x1b09('0x9c')](_0x14f94b['query'][_0x1b09('0x9c')]));_0x314411[_0x1b09('0x9b')]=_0x314411['attributes'][_0x1b09('0x8e')]?_0x314411['attributes']:_0x7e199d[_0x1b09('0xc')];if(!_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9d')]('nolimit')){_0x314411['limit']=qs['limit'](_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9e')]);_0x314411[_0x1b09('0x9f')]=qs[_0x1b09('0x9f')](_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9f')]);}_0x314411[_0x1b09('0xa0')]=qs[_0x1b09('0xa1')](_0x14f94b[_0x1b09('0x87')][_0x1b09('0xa1')]);_0x314411[_0x1b09('0x84')]=qs[_0x1b09('0x99')](_['pick'](_0x14f94b['query'],_0x7e199d[_0x1b09('0x99')]));if(_0x14f94b[_0x1b09('0x87')][_0x1b09('0x4')]){_0x314411[_0x1b09('0x84')]=_[_0x1b09('0xa2')](_0x314411[_0x1b09('0x84')],{'$or':_[_0x1b09('0xa')](_0x58c56e,function(_0x52f219){if(_0x52f219[_0x1b09('0x12')][_0x1b09('0xa3')]!==_0x1b09('0xa4')){var _0x4f777b={};_0x4f777b[_0x52f219[_0x1b09('0x5')]]={'$like':'%'+_0x14f94b[_0x1b09('0x87')][_0x1b09('0x4')]+'%'};return _0x4f777b;}})});}var _0x1de91c=[];var _0x2d95b1=null;var _0x4ae2a6={};if(_0xdcd93e){_0x2d95b1=_['find'](_0x54c7c6,[_0x1b09('0xd'),_0xdcd93e[_0x1b09('0xd')]]);if(_0x2d95b1['field']){_0x4ae2a6={};if(_0x187a11[_0x1b09('0x14')]==='AnalyticExtractedReport'){_0x4ae2a6[_0x2d95b1[_0x1b09('0xa5')]]=_[_0x1b09('0xa')](_0xdcd93e[_0x1b09('0x9')],'id');}else{_0x4ae2a6[_0x2d95b1['foreignKey']]=_0xdcd93e[_0x1b09('0x9')];}_0x1de91c['push'](_0x4ae2a6);}else{_0x314411['where']['id']=_0xdcd93e[_0x1b09('0x9')];}}else{for(var _0x4a9d0e=0x0;_0x4a9d0e<_0x4e74de['length'];_0x4a9d0e++){_0x2d95b1=_['find'](_0x54c7c6,[_0x1b09('0xd'),_0x4e74de[_0x4a9d0e][_0x1b09('0xd')]]);if(_0x2d95b1[_0x1b09('0x5')]){_0x4ae2a6={};_0x4ae2a6[_0x2d95b1[_0x1b09('0xa5')]]=_0x4e74de[_0x4a9d0e]['associatedResources'];_0x1de91c[_0x1b09('0x94')](_0x4ae2a6);}else{if(!_0x314411[_0x1b09('0x84')]['id'])_0x314411[_0x1b09('0x84')]['id']=[];_0x4e74de[_0x4a9d0e][_0x1b09('0x9')][_0x1b09('0xa6')](function(_0x4e1562){_0x314411[_0x1b09('0x84')]['id'][_0x1b09('0x94')](_0x4e1562);});}}}if(!_[_0x1b09('0x92')](_0x1de91c)){_0x314411[_0x1b09('0x84')]=_['merge'](_0x314411['where'],{'$and':{'$or':_0x1de91c}});}_0x314411=_['merge']({},_0x314411,_0x14f94b[_0x1b09('0xa7')]);if(_0xdcd93e&&!_0xdcd93e[_0x1b09('0x95')]&&_0x187a11[_0x1b09('0x14')]===_0x1b09('0x10')){if(_0x14f94b[_0x1b09('0x87')][_0x1b09('0xa8')]){_0x314411['include']=[{'all':!![]}];}return _0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x7')](_0x314411)['then'](function(_0x56be94){var _0x356d3a=[];_0x56be94[_0x1b09('0xa6')](function(_0x145a82){var _0x49a600;switch(_0x145a82['reportType']){case _0x1b09('0xa9'):_0x49a600=_['find'](_0xdcd93e[_0x1b09('0x9')],function(_0x52c640){return _0x52c640['id']===_0x145a82['reportId']&&_0x52c640[_0x1b09('0x12')]===_0x1b09('0xaa');});break;case _0x1b09('0xab'):_0x49a600=_['find'](_0xdcd93e[_0x1b09('0x9')],function(_0x29aeaf){return _0x29aeaf['id']===_0x145a82[_0x1b09('0x77')]&&_0x29aeaf[_0x1b09('0x12')]===_0x1b09('0xac');});break;}if(_0x49a600)_0x356d3a[_0x1b09('0x94')](_0x145a82);});_0x4c3068[_0x1b09('0xad')]=_0x356d3a['length'];_0x4c3068[_0x1b09('0xae')]=_0x356d3a;return _0x4c3068;});}else{return _0xa6ef49[_0x187a11['childModel']][_0x1b09('0xad')]({'where':_0x314411[_0x1b09('0x84')]})['then'](function(_0x20b050){_0x4c3068[_0x1b09('0xad')]=_0x20b050;if(_0x14f94b['query']['includeAll']){if(_0x187a11[_0x1b09('0x14')]===_0x1b09('0x1e')){_0x314411[_0x1b09('0xaf')]=[{'model':_0xa6ef49[_0x1b09('0xb0')],'as':_0x1b09('0xb1'),'attributes':['id',_0x1b09('0xd'),_0x1b09('0xb2')],'required':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]?!![]:![]},{'model':_0xa6ef49[_0x1b09('0xb0')],'as':_0x1b09('0xb4'),'attributes':['id',_0x1b09('0xd'),_0x1b09('0xb2')],'through':_0x14f94b['query'][_0x1b09('0xb3')]?{'attributes':[],'where':{'TagId':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]||undefined}}:{},'required':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]?!![]:![]}];}else{_0x314411[_0x1b09('0xaf')]=[{'all':!![]}];}}return _0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x7')](_0x314411);})[_0x1b09('0x8')](function(_0x3c6ebe){_0x4c3068[_0x1b09('0xae')]=_0x3c6ebe;if(_0x42fa10===_0x1b09('0x34')&&_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb5')]===_0x1b09('0xb6')){var _0x2ab5e5=[];for(var _0x590266=0x0;_0x590266<_0x4c3068['rows']['length'];_0x590266++){_0x2ab5e5['push'](_0x4ca41c('chat',_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5['push'](_0x4ca41c('sms',_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xb8'),_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xb9'),_0x4c3068[_0x1b09('0xae')][_0x590266]['dataValues']));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xba'),_0x4c3068[_0x1b09('0xae')][_0x590266]['dataValues']));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xbb'),_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));}return Promise[_0x1b09('0x96')](_0x2ab5e5)[_0x1b09('0x8')](function(){return _0x4c3068;});}return _0x4c3068;});}});}}});}; \ No newline at end of file +var _0x741c=['length','find','all','ignore','autoAssociation','push','keys','intersection','fields','attributes','nolimit','limit','offset','order','sort','pick','filters','merge','key','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','CmContact','color','ThroughTags','tag','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','value','findAll','catch','model','associatedResources','name','then','map','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatwebsites','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','type','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','queuecampaigns','users','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','tags','Tag','templates','Template','trunks','Trunk','variables','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','SELECT','select','ui.','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','UserProfile','user_profiles','section','mergeResources','isEmpty'];(function(_0x38a5f1,_0x306c7b){var _0x2db2f8=function(_0x49959b){while(--_0x49959b){_0x38a5f1['push'](_0x38a5f1['shift']());}};_0x2db2f8(++_0x306c7b);}(_0x741c,0x196));var _0xc741=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x741c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc741('0x0'));var attributes=require(_0xc741('0x1'));var qs=require(_0xc741('0x2'));var squel=require(_0xc741('0x3'));module[_0xc741('0x4')]=function(_0x31de60){var _0x5c8d3b=_0x31de60['models'];function _0x4089bf(_0x4ccc27,_0xc80e99){return new Promise(function(_0x1935b4,_0x3708ae){if(!_0xc80e99)return _0x1935b4(null);var _0x133bc4=_0xc80e99[_0xc741('0x5')]?{[_0xc80e99[_0xc741('0x5')][_0xc741('0x6')]]:_0xc80e99['filter'][_0xc741('0x7')]}:undefined;return _0x5c8d3b[_0x4ccc27][_0xc741('0x8')]({'where':_0x133bc4,'raw':!![]})['then'](function(_0xc6555){_0xc80e99['associatedResources']=_['map'](_0xc6555,'id');_0x1935b4(_0xc80e99);})[_0xc741('0x9')](function(_0x264cb9){_0x3708ae(_0x264cb9);});});}function _0x40639b(_0x47501c,_0xa1abb1){return new Promise(function(_0x29920b,_0x312684){var _0x506b51=_0x47501c['filter']?{[_0x47501c['filter'][_0xc741('0x6')]]:_0x47501c[_0xc741('0x5')][_0xc741('0x7')]}:undefined;return _0x5c8d3b[_0x47501c[_0xc741('0xa')]][_0xc741('0x8')]({'where':_0x506b51,'raw':!![]})['then'](function(_0xde1da){_0xa1abb1[_0xc741('0xb')]=_['map'](_0xde1da,function(_0xc0383){return _0xc0383[_0xc741('0xc')];});_0x29920b(_0xa1abb1);})[_0xc741('0x9')](function(_0x450179){_0x312684(_0x450179);});});}function _0x21514e(_0x5bbe86,_0x4dcf16,_0x341f54){if(!_0x4dcf16)return Promise['resolve'](null);return new Promise(function(_0x1c4f3a,_0x3903c6){return _0x5c8d3b['UserProfileResource']['findAll']({'where':{'sectionId':_0x4dcf16['id']},'raw':!![]})[_0xc741('0xd')](function(_0x477cc2){if(_0x5bbe86[_0xc741('0x6')]&&_0x5bbe86['field']!=='id'){_0x4dcf16[_0xc741('0xb')]=_[_0xc741('0xe')](_0x477cc2,function(_0x475348){return _0x475348[_0x5bbe86[_0xc741('0x6')]];});}else{if(_0x341f54===_0xc741('0xf')){_0x4dcf16[_0xc741('0xb')]=_[_0xc741('0xe')](_0x477cc2,function(_0x30b7ea){return{'id':_0x30b7ea[_0xc741('0x10')],'type':_0x30b7ea['type']};});}else{_0x4dcf16[_0xc741('0xb')]=_['map'](_0x477cc2,function(_0x212c67){return _0x212c67['resourceId'];});}}_0x1c4f3a(_0x4dcf16);})[_0xc741('0x9')](function(_0x3c3497){_0x3903c6(_0x3c3497);});});}function _0x38e752(_0x5ca96f,_0x71c786){var _0x5a89bd={'parentSections':[]};switch(_0x5ca96f[_0xc741('0x11')]()){case _0xc741('0x12'):_0x5a89bd[_0xc741('0x13')]='SquareProject';break;case'odbc':_0x5a89bd['childModel']=_0xc741('0x14');break;case _0xc741('0x15'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x16');_0x5a89bd[_0xc741('0x17')]=[{'name':'SquareProjects','field':'name','foreignKey':_0xc741('0x18')}];break;case _0xc741('0x19'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x1a');break;case _0xc741('0x1b'):_0x5a89bd[_0xc741('0x13')]='CmContact';_0x5a89bd[_0xc741('0x17')]=[{'name':_0xc741('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xc741('0x1d'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x1e');break;case _0xc741('0x1f'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x20');break;case _0xc741('0x21'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x22');break;case'chatqueues':_0x5a89bd[_0xc741('0x13')]='ChatQueue';break;case _0xc741('0x23'):_0x5a89bd['childModel']='ChatWebsite';break;case _0xc741('0x24'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x25');break;case'faxaccounts':_0x5a89bd[_0xc741('0x13')]=_0xc741('0x26');break;case _0xc741('0x27'):case'internalroutes':case _0xc741('0x28'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x29');break;case _0xc741('0x2a'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x2b');break;case _0xc741('0x2c'):_0x5a89bd['childModel']='VoiceMail';break;case _0xc741('0x2d'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x2e');_0x5a89bd[_0xc741('0x17')]=[{'name':_0xc741('0x2f'),'field':_0xc741('0xc'),'foreignKey':'membername','model':_0xc741('0x30'),'filter':{'field':_0xc741('0x31'),'value':['agent']}},{'name':_0xc741('0x32'),'field':_0xc741('0xc'),'foreignKey':_0xc741('0x33'),'model':'User','filter':{'field':_0xc741('0x31'),'value':[_0xc741('0x34')]}},{'name':_0xc741('0x35'),'field':_0xc741('0xc'),'foreignKey':_0xc741('0x36'),'model':_0xc741('0x37'),'filter':{'field':_0xc741('0x38'),'value':['inbound']}},{'name':_0xc741('0x39'),'field':_0xc741('0xc'),'foreignKey':_0xc741('0x36'),'model':_0xc741('0x37'),'filter':{'field':_0xc741('0x38'),'value':[_0xc741('0x3a')]}}];break;case _0xc741('0x3b'):_0x5a89bd[_0xc741('0x13')]='VoiceMusicOnHold';break;case _0xc741('0x3c'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x3d');break;case _0xc741('0x3e'):_0x5a89bd['childModel']=_0xc741('0x3f');break;case'ivrcampaigns':_0x5a89bd[_0xc741('0x13')]=_0xc741('0x40');break;case _0xc741('0x41'):_0x5a89bd['childModel']='MailQueue';break;case _0xc741('0x42'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x43');break;case _0xc741('0x44'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x45');break;case _0xc741('0x46'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x47');break;case _0xc741('0x48'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x49');break;case _0xc741('0x4a'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x4b');break;case _0xc741('0x4c'):_0x5a89bd[_0xc741('0x13')]='SmsAccount';break;case _0xc741('0x4d'):_0x5a89bd['childModel']=_0xc741('0x4e');break;case'whatsappaccounts':_0x5a89bd[_0xc741('0x13')]=_0xc741('0x4f');break;case'teams':_0x5a89bd[_0xc741('0x13')]=_0xc741('0x50');break;case'voicequeues':case _0xc741('0x51'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x37');if(_0x71c786){_0x5a89bd[_0xc741('0x17')]=[{'name':_0xc741('0x35')},{'name':_0xc741('0x39')}];}break;case _0xc741('0x52'):case'agents':case _0xc741('0x53'):_0x5a89bd['childModel']='User';if(_0x71c786){_0x5a89bd[_0xc741('0x17')]=[{'name':'Users','filter':{'field':_0xc741('0x31'),'value':[_0xc741('0x54'),_0xc741('0x55')]},'ignore':!![]},{'name':_0xc741('0x2f')},{'name':_0xc741('0x32')}];}break;case _0xc741('0x56'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x57');break;case _0xc741('0x58'):_0x5a89bd['childModel']='SalesforceAccount';break;case _0xc741('0x59'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x5a');break;case _0xc741('0x5b'):_0x5a89bd['childModel']=_0xc741('0x5c');break;case'deskaccounts':_0x5a89bd[_0xc741('0x13')]=_0xc741('0x5d');break;case _0xc741('0x5e'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x5f');break;case _0xc741('0x60'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x30');break;case _0xc741('0x61'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x62');break;case _0xc741('0x63'):_0x5a89bd['childModel']=_0xc741('0x64');break;case _0xc741('0x65'):_0x5a89bd[_0xc741('0x13')]='Dashboard';break;case _0xc741('0x66'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x67');break;case _0xc741('0x68'):_0x5a89bd['childModel']=_0xc741('0x69');break;case _0xc741('0x6a'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x6b');break;case'sounds':_0x5a89bd[_0xc741('0x13')]='Sound';break;case _0xc741('0x6c'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x6d');break;case _0xc741('0x6e'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x6f');break;case'triggers':_0x5a89bd[_0xc741('0x13')]='Trigger';break;case _0xc741('0x70'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x71');break;case _0xc741('0x72'):_0x5a89bd[_0xc741('0x13')]='Variable';break;case'plugins':_0x5a89bd[_0xc741('0x13')]='Plugin';break;case _0xc741('0x73'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0xf');_0x5a89bd[_0xc741('0x17')]=[{'name':_0xc741('0x74'),'field':'id','foreignKey':_0xc741('0x75')}];break;case _0xc741('0x76'):_0x5a89bd[_0xc741('0x13')]=_0xc741('0x77');break;}return _0x5a89bd;}function _0x335eb6(_0xc1c742,_0x1e31bb){var _0x4f386b=_0xc1c742['charAt'](0x0)[_0xc741('0x78')]()+_0xc1c742[_0xc741('0x79')](0x1);var _0xe0b6d8={'type':_0x5c8d3b['Sequelize']['QueryTypes'][_0xc741('0x7a')],'raw':!![]};return new Promise(function(_0x5a4f5b,_0x394be8){var _0x3523a2=squel[_0xc741('0x7b')]()[_0xc741('0x6')](_0xc741('0x7c')+_0x4f386b+'InteractionId','id')['field'](_0xc741('0x7d'))[_0xc741('0x7e')]('user_has_'+_0xc1c742+_0xc741('0x7f'),'ui')[_0xc741('0x80')](_0xc741('0x81'),_0x1e31bb['id']);return _0x5c8d3b[_0xc741('0x82')][_0xc741('0x83')](_0x3523a2['toString'](),_0xe0b6d8)['then'](function(_0x2802a7){_0x1e31bb[_0x4f386b+'OpenTabs']=_0x2802a7;_0x5a4f5b(_0x2802a7);})[_0xc741('0x9')](function(_0x43471d){_0x394be8(_0x43471d);});});}return _0x31de60['define'](_0xc741('0x84'),attributes,{'tableName':_0xc741('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xf47dfd){var _0x1aecb3={'raw':![],'where':{}};var _0x1c5c67={};var _0x9027d1={'count':0x0,'rows':[]};var _0xd0575b=_0xf47dfd['query'][_0xc741('0x86')];var _0x28390d=_0xf47dfd['query'][_0xc741('0x87')]||![];var _0x2d9a96=_0x38e752(_0xd0575b,_0x28390d);if(!_0x2d9a96[_0xc741('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0xd0575b+'\x27');var _0xe0f852=[{'name':_0xd0575b}];if(!_[_0xc741('0x88')](_0x2d9a96['parentSections']))_0xe0f852=_0x2d9a96[_0xc741('0x17')];var _0x3768ef=[];for(var _0xfa0e86=0x0;_0xfa0e86<_0xe0f852[_0xc741('0x89')];_0xfa0e86++){_0x3768ef['push'](_0x5c8d3b['UserProfileSection'][_0xc741('0x8a')]({'where':{'userProfileId':_0xf47dfd['params']['id'],'name':_0xe0f852[_0xfa0e86][_0xc741('0xc')]},'raw':!![]}));}return Promise[_0xc741('0x8b')](_0x3768ef)[_0xc741('0xd')](function(_0x1d0401){var _0x438997=_[_0xc741('0x5')](_0x1d0401,function(_0x5eab1a){return _0x5eab1a?_0x5eab1a:undefined;});var _0x40cfe0=_['filter'](_0xe0f852,[_0xc741('0x8c'),!![]]);var _0x1931e2=_[_0xc741('0x88')](_0x438997)&&_[_0xc741('0x88')](_0x40cfe0)?null:_['union'](_0x40cfe0,_0x438997);if(!_0x1931e2)return null;var _0x31c533=[];for(var _0x19b48a=0x0;_0x19b48a<_0x1931e2[_0xc741('0x89')];_0x19b48a++){var _0x164525=_[_0xc741('0x8a')](_0xe0f852,function(_0x240865){return _0x1931e2[_0x19b48a]?_0x240865[_0xc741('0xc')]===_0x1931e2[_0x19b48a][_0xc741('0xc')]:null;});if(_0x164525){if(_0x1931e2[_0x19b48a][_0xc741('0x8c')]){_0x31c533['push'](_0x4089bf(_0x2d9a96['childModel'],_0x1931e2[_0x19b48a]));}else{if(!_0x1931e2[_0x19b48a][_0xc741('0x8d')]){_0x31c533[_0xc741('0x8e')](_0x21514e(_0x164525,_0x1931e2[_0x19b48a],_0x2d9a96[_0xc741('0x13')]));}else{if(_0x164525[_0xc741('0xa')]){_0x31c533['push'](_0x40639b(_0x164525,_0x1931e2[_0x19b48a]));}}}}}return Promise[_0xc741('0x8b')](_0x31c533);})[_0xc741('0xd')](function(_0x22982b){var _0x3f3b84=_0x22982b;var _0x31c314=null;if(_0x3f3b84){_0x31c314=_0x3f3b84[_0xc741('0x89')]===0x1?_0x3f3b84[0x0]:null;}if(!_0x31c314&&!_0x3f3b84)return _0x9027d1;var _0x2cb099=_0x5c8d3b[_0x2d9a96[_0xc741('0x13')]]['rawAttributes'];_0x1c5c67[_0xc741('0xa')]=_['keys'](_0x2cb099);_0x1c5c67['query']=_[_0xc741('0x8f')](_0xf47dfd[_0xc741('0x83')]);_0x1c5c67['filters']=_[_0xc741('0x90')](_0x1c5c67[_0xc741('0xa')],_0x1c5c67['query']);_0x1aecb3['attributes']=_[_0xc741('0x90')](_0x1c5c67[_0xc741('0xa')],qs['fields'](_0xf47dfd[_0xc741('0x83')][_0xc741('0x91')]));_0x1aecb3[_0xc741('0x92')]=_0x1aecb3[_0xc741('0x92')][_0xc741('0x89')]?_0x1aecb3[_0xc741('0x92')]:_0x1c5c67[_0xc741('0xa')];if(!_0xf47dfd[_0xc741('0x83')]['hasOwnProperty'](_0xc741('0x93'))){_0x1aecb3[_0xc741('0x94')]=qs[_0xc741('0x94')](_0xf47dfd[_0xc741('0x83')]['limit']);_0x1aecb3[_0xc741('0x95')]=qs[_0xc741('0x95')](_0xf47dfd['query'][_0xc741('0x95')]);}_0x1aecb3[_0xc741('0x96')]=qs[_0xc741('0x97')](_0xf47dfd[_0xc741('0x83')]['sort']);_0x1aecb3['where']=qs['filters'](_[_0xc741('0x98')](_0xf47dfd[_0xc741('0x83')],_0x1c5c67[_0xc741('0x99')]));if(_0xf47dfd[_0xc741('0x83')]['filter']){_0x1aecb3[_0xc741('0x80')]=_[_0xc741('0x9a')](_0x1aecb3['where'],{'$or':_['map'](_0x2cb099,function(_0x110cac){if(_0x110cac[_0xc741('0x38')][_0xc741('0x9b')]!=='VIRTUAL'){var _0x3922e1={};_0x3922e1[_0x110cac[_0xc741('0x6')]]={'$like':'%'+_0xf47dfd[_0xc741('0x83')]['filter']+'%'};return _0x3922e1;}})});}var _0x4a3c3a=[];var _0x58b414=null;var _0x2e7cfa={};if(_0x31c314){_0x58b414=_[_0xc741('0x8a')](_0xe0f852,['name',_0x31c314['name']]);if(_0x58b414[_0xc741('0x6')]){_0x2e7cfa={};if(_0x2d9a96[_0xc741('0x13')]==='AnalyticExtractedReport'){_0x2e7cfa[_0x58b414[_0xc741('0x9c')]]=_['map'](_0x31c314['associatedResources'],'id');}else{_0x2e7cfa[_0x58b414['foreignKey']]=_0x31c314[_0xc741('0xb')];}_0x4a3c3a[_0xc741('0x8e')](_0x2e7cfa);}else{_0x1aecb3[_0xc741('0x80')]['id']=_0x31c314[_0xc741('0xb')];}}else{for(var _0x59822a=0x0;_0x59822a<_0x3f3b84[_0xc741('0x89')];_0x59822a++){_0x58b414=_['find'](_0xe0f852,[_0xc741('0xc'),_0x3f3b84[_0x59822a]['name']]);if(_0x58b414['field']){_0x2e7cfa={};_0x2e7cfa[_0x58b414[_0xc741('0x9c')]]=_0x3f3b84[_0x59822a][_0xc741('0xb')];_0x4a3c3a['push'](_0x2e7cfa);}else{if(!_0x1aecb3[_0xc741('0x80')]['id'])_0x1aecb3[_0xc741('0x80')]['id']=[];_0x3f3b84[_0x59822a][_0xc741('0xb')][_0xc741('0x9d')](function(_0x3103bd){_0x1aecb3[_0xc741('0x80')]['id']['push'](_0x3103bd);});}}}if(!_[_0xc741('0x88')](_0x4a3c3a)){_0x1aecb3[_0xc741('0x80')]=_[_0xc741('0x9a')](_0x1aecb3[_0xc741('0x80')],{'$and':{'$or':_0x4a3c3a}});}_0x1aecb3=_[_0xc741('0x9a')]({},_0x1aecb3,_0xf47dfd[_0xc741('0x9e')]);if(_0x31c314&&!_0x31c314[_0xc741('0x8d')]&&_0x2d9a96[_0xc741('0x13')]===_0xc741('0xf')){if(_0xf47dfd[_0xc741('0x83')][_0xc741('0x9f')]){_0x1aecb3[_0xc741('0xa0')]=[{'all':!![]}];}return _0x5c8d3b[_0x2d9a96['childModel']]['findAll'](_0x1aecb3)['then'](function(_0x4c78dc){var _0x1a693a=[];_0x4c78dc[_0xc741('0x9d')](function(_0xb83d6e){var _0x2e1962;switch(_0xb83d6e[_0xc741('0xa1')]){case _0xc741('0xa2'):_0x2e1962=_[_0xc741('0x8a')](_0x31c314[_0xc741('0xb')],function(_0x252e16){return _0x252e16['id']===_0xb83d6e[_0xc741('0x75')]&&_0x252e16[_0xc741('0x38')]===_0xc741('0xa3');});break;case _0xc741('0xa4'):_0x2e1962=_['find'](_0x31c314[_0xc741('0xb')],function(_0x211cee){return _0x211cee['id']===_0xb83d6e[_0xc741('0x75')]&&_0x211cee[_0xc741('0x38')]===_0xc741('0xa5');});break;}if(_0x2e1962)_0x1a693a[_0xc741('0x8e')](_0xb83d6e);});_0x9027d1[_0xc741('0xa6')]=_0x1a693a[_0xc741('0x89')];_0x9027d1[_0xc741('0xa7')]=_0x1a693a;return _0x9027d1;});}else{return _0x5c8d3b[_0x2d9a96[_0xc741('0x13')]][_0xc741('0xa6')]({'where':_0x1aecb3[_0xc741('0x80')]})['then'](function(_0x3d755c){_0x9027d1[_0xc741('0xa6')]=_0x3d755c;if(_0xf47dfd[_0xc741('0x83')]['includeAll']){if(_0x2d9a96[_0xc741('0x13')]===_0xc741('0xa8')){_0x1aecb3['include']=[{'model':_0x5c8d3b[_0xc741('0x6d')],'as':'Tags','attributes':['id',_0xc741('0xc'),_0xc741('0xa9')],'required':_0xf47dfd[_0xc741('0x83')]['tag']?!![]:![]},{'model':_0x5c8d3b[_0xc741('0x6d')],'as':_0xc741('0xaa'),'attributes':['id','name','color'],'through':_0xf47dfd[_0xc741('0x83')][_0xc741('0xab')]?{'attributes':[],'where':{'TagId':_0xf47dfd[_0xc741('0x83')][_0xc741('0xab')]||undefined}}:{},'required':_0xf47dfd['query'][_0xc741('0xab')]?!![]:![]}];}else{_0x1aecb3[_0xc741('0xa0')]=[{'all':!![]}];}}return _0x5c8d3b[_0x2d9a96[_0xc741('0x13')]][_0xc741('0x8')](_0x1aecb3);})[_0xc741('0xd')](function(_0x4045cc){_0x9027d1[_0xc741('0xa7')]=_0x4045cc;if(_0xd0575b==='Agents'&&_0xf47dfd[_0xc741('0x83')][_0xc741('0xac')]===_0xc741('0xad')){var _0x62d071=[];for(var _0x193414=0x0;_0x193414<_0x9027d1[_0xc741('0xa7')]['length'];_0x193414++){_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xae'),_0x9027d1['rows'][_0x193414]['dataValues']));_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xaf'),_0x9027d1['rows'][_0x193414][_0xc741('0xb0')]));_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xb1'),_0x9027d1[_0xc741('0xa7')][_0x193414][_0xc741('0xb0')]));_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xb2'),_0x9027d1[_0xc741('0xa7')][_0x193414][_0xc741('0xb0')]));_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xb3'),_0x9027d1['rows'][_0x193414]['dataValues']));_0x62d071[_0xc741('0x8e')](_0x335eb6(_0xc741('0xb4'),_0x9027d1[_0xc741('0xa7')][_0x193414]['dataValues']));}return Promise[_0xc741('0x8b')](_0x62d071)['then'](function(){return _0x9027d1;});}return _0x9027d1;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8558fef..0836d3a 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 _0xa701=['UserProfile,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x342874,_0xae5304){var _0x503c39=function(_0xd68ca4){while(--_0xd68ca4){_0x342874['push'](_0x342874['shift']());}};_0x503c39(++_0xae5304);}(_0xa701,0xd4));var _0x1a70=function(_0x174cd9,_0x29f608){_0x174cd9=_0x174cd9-0x0;var _0x2206b8=_0xa701[_0x174cd9];return _0x2206b8;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));var config=require(_0x1a70('0x5'));var jayson=require(_0x1a70('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x1a70('0x7')]=_[_0x1a70('0x8')](config[_0x1a70('0x7')],{'host':_0x1a70('0x9'),'port':0x18eb});var socket=require(_0x1a70('0xa'))(new Redis(config[_0x1a70('0x7')]));require(_0x1a70('0xb'))['register'](socket);function respondWithRpcPromise(_0xe69b9b,_0x121091,_0x17015c){return new BPromise(function(_0x471b1f,_0x5772d9){return client[_0x1a70('0xc')](_0xe69b9b,_0x17015c)[_0x1a70('0xd')](function(_0x1b29e7){logger['info']('UserProfile,\x20%s,\x20%s',_0x121091,_0x1a70('0xe'));logger['debug'](_0x1a70('0xf'),_0x121091,'request\x20sent',JSON[_0x1a70('0x10')](_0x1b29e7));if(_0x1b29e7['error']){if(_0x1b29e7[_0x1a70('0x11')]['code']===0x1f4){logger[_0x1a70('0x11')](_0x1a70('0x12'),_0x121091,_0x1b29e7[_0x1a70('0x11')][_0x1a70('0x13')]);return _0x5772d9(_0x1b29e7[_0x1a70('0x11')]['message']);}logger['error'](_0x1a70('0x12'),_0x121091,_0x1b29e7['error'][_0x1a70('0x13')]);return _0x471b1f(_0x1b29e7[_0x1a70('0x11')]['message']);}else{logger[_0x1a70('0x14')]('UserProfile,\x20%s,\x20%s',_0x121091,_0x1a70('0xe'));_0x471b1f(_0x1b29e7[_0x1a70('0x15')]['message']);}})[_0x1a70('0x16')](function(_0x35de3b){logger['error']('UserProfile,\x20%s,\x20%s',_0x121091,_0x35de3b);_0x5772d9(_0x35de3b);});});} \ No newline at end of file +var _0x18b2=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d919f,_0x5b0e3b){var _0x521be6=function(_0x283ce3){while(--_0x283ce3){_0x4d919f['push'](_0x4d919f['shift']());}};_0x521be6(++_0x5b0e3b);}(_0x18b2,0x85));var _0x218b=function(_0x57fd91,_0x172c23){_0x57fd91=_0x57fd91-0x0;var _0x2c378b=_0x18b2[_0x57fd91];return _0x2c378b;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require(_0x218b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x3'));var db=require(_0x218b('0x4'))['db'];var utils=require(_0x218b('0x5'));var logger=require(_0x218b('0x6'))(_0x218b('0x7'));var config=require(_0x218b('0x8'));var jayson=require(_0x218b('0x9'));var client=jayson[_0x218b('0xa')][_0x218b('0xb')]({'port':0x232a});config[_0x218b('0xc')]=_[_0x218b('0xd')](config[_0x218b('0xc')],{'host':_0x218b('0xe'),'port':0x18eb});var socket=require(_0x218b('0xf'))(new Redis(config[_0x218b('0xc')]));require('./userProfile.socket')[_0x218b('0x10')](socket);function respondWithRpcPromise(_0xc5f1d7,_0x413da9,_0x161acf){return new BPromise(function(_0x421a0f,_0x4ee68f){return client[_0x218b('0x11')](_0xc5f1d7,_0x161acf)['then'](function(_0xfc01c1){logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,'request\x20sent');logger[_0x218b('0x14')](_0x218b('0x15'),_0x413da9,'request\x20sent',JSON[_0x218b('0x16')](_0xfc01c1));if(_0xfc01c1[_0x218b('0x17')]){if(_0xfc01c1['error'][_0x218b('0x18')]===0x1f4){logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x4ee68f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x421a0f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}else{logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,_0x218b('0x1a'));_0x421a0f(_0xfc01c1['result'][_0x218b('0x19')]);}})[_0x218b('0x1b')](function(_0x139ade){logger['error']('UserProfile,\x20%s,\x20%s',_0x413da9,_0x139ade);_0x4ee68f(_0x139ade);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5349278..f81c558 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 _0x48d9=['userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x48d9,0x1ac));var _0x948d=function(_0x4800c8,_0x322ffa){_0x4800c8=_0x4800c8-0x0;var _0x450385=_0x48d9[_0x4800c8];return _0x450385;};'use strict';var UserProfileEvents=require(_0x948d('0x0'));var events=['save',_0x948d('0x1'),_0x948d('0x2')];function createListener(_0x562e11,_0x40501b){return function(_0xacf057){_0x40501b[_0x948d('0x3')](_0x562e11,_0xacf057);};}function removeListener(_0x2cd38a,_0x3b3e83){return function(){UserProfileEvents[_0x948d('0x4')](_0x2cd38a,_0x3b3e83);};}exports[_0x948d('0x5')]=function(_0x427118){for(var _0x2ca162=0x0,_0x786a2c=events['length'];_0x2ca162<_0x786a2c;_0x2ca162++){var _0x2a53a9=events[_0x2ca162];var _0x513d5c=createListener(_0x948d('0x6')+_0x2a53a9,_0x427118);UserProfileEvents['on'](_0x2a53a9,_0x513d5c);}}; \ No newline at end of file +var _0x5ff8=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x17d8a8,_0x477ed3){var _0x4906f0=function(_0x44e442){while(--_0x44e442){_0x17d8a8['push'](_0x17d8a8['shift']());}};_0x4906f0(++_0x477ed3);}(_0x5ff8,0xee));var _0x85ff=function(_0x2ab68a,_0x34b82e){_0x2ab68a=_0x2ab68a-0x0;var _0x298236=_0x5ff8[_0x2ab68a];return _0x298236;};'use strict';var UserProfileEvents=require(_0x85ff('0x0'));var events=[_0x85ff('0x1'),_0x85ff('0x2'),_0x85ff('0x3')];function createListener(_0xa7c099,_0x3f0f5f){return function(_0x68263d){_0x3f0f5f[_0x85ff('0x4')](_0xa7c099,_0x68263d);};}function removeListener(_0x3bdbd2,_0x100f21){return function(){UserProfileEvents[_0x85ff('0x5')](_0x3bdbd2,_0x100f21);};}exports[_0x85ff('0x6')]=function(_0x2d133b){for(var _0x3ca1b8=0x0,_0x41a0d8=events[_0x85ff('0x7')];_0x3ca1b8<_0x41a0d8;_0x3ca1b8++){var _0x179915=events[_0x3ca1b8];var _0x595677=createListener(_0x85ff('0x8')+_0x179915,_0x2d133b);UserProfileEvents['on'](_0x179915,_0x595677);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 069f65a..2afb61d 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 _0x72a5=['../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x72a5,0xaa));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x572a('0x0'));var util=require(_0x572a('0x1'));var path=require(_0x572a('0x2'));var timeout=require('connect-timeout');var express=require(_0x572a('0x3'));var router=express[_0x572a('0x4')]();var fs_extra=require(_0x572a('0x5'));var auth=require(_0x572a('0x6'));var interaction=require(_0x572a('0x7'));var config=require('../../config/environment');var controller=require(_0x572a('0x8'));router[_0x572a('0x9')]('/',auth[_0x572a('0xa')](),controller[_0x572a('0xb')]);router[_0x572a('0x9')](_0x572a('0xc'),auth[_0x572a('0xa')](),controller['describe']);router[_0x572a('0x9')]('/:id',auth[_0x572a('0xa')](),controller[_0x572a('0xd')]);router[_0x572a('0xe')]('/',auth['isAuthenticated'](),controller[_0x572a('0xf')]);router[_0x572a('0x10')](_0x572a('0x11'),auth[_0x572a('0xa')](),controller[_0x572a('0x12')]);router[_0x572a('0x13')](_0x572a('0x11'),auth[_0x572a('0xa')](),controller[_0x572a('0x14')]);module[_0x572a('0x15')]=router; \ No newline at end of file +var _0xcda3=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','post','put','update','delete'];(function(_0x1d99b3,_0x39da31){var _0x35e26a=function(_0x3e6f84){while(--_0x3e6f84){_0x1d99b3['push'](_0x1d99b3['shift']());}};_0x35e26a(++_0x39da31);}(_0xcda3,0xe0));var _0x3cda=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0xcda3[_0x143565];return _0x4dc1d9;};'use strict';var multer=require(_0x3cda('0x0'));var util=require(_0x3cda('0x1'));var path=require('path');var timeout=require(_0x3cda('0x2'));var express=require(_0x3cda('0x3'));var router=express['Router']();var fs_extra=require(_0x3cda('0x4'));var auth=require(_0x3cda('0x5'));var interaction=require(_0x3cda('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x3cda('0x7')](),controller['index']);router[_0x3cda('0x8')](_0x3cda('0x9'),auth[_0x3cda('0x7')](),controller[_0x3cda('0xa')]);router[_0x3cda('0x8')](_0x3cda('0xb'),auth[_0x3cda('0x7')](),controller['show']);router[_0x3cda('0xc')]('/',auth[_0x3cda('0x7')](),controller['create']);router[_0x3cda('0xd')](_0x3cda('0xb'),auth[_0x3cda('0x7')](),controller[_0x3cda('0xe')]);router[_0x3cda('0xf')](_0x3cda('0xb'),auth['isAuthenticated'](),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 b6c2a85..af0bada 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 _0x473e=['sequelize','exports','STRING','INTEGER'];(function(_0x53da09,_0x1ba494){var _0x39d223=function(_0x16e4e0){while(--_0x16e4e0){_0x53da09['push'](_0x53da09['shift']());}};_0x39d223(++_0x1ba494);}(_0x473e,0xb0));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe473('0x0'));module[_0xe473('0x1')]={'name':{'type':Sequelize[_0xe473('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe473('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe473('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x98b6=['INTEGER','sequelize','STRING'];(function(_0x1b388d,_0x2ec762){var _0x3da432=function(_0x3ce8c1){while(--_0x3ce8c1){_0x1b388d['push'](_0x1b388d['shift']());}};_0x3da432(++_0x2ec762);}(_0x98b6,0x10c));var _0x698b=function(_0x3e6793,_0x48ec08){_0x3e6793=_0x3e6793-0x0;var _0x5277f0=_0x98b6[_0x3e6793];return _0x5277f0;};'use strict';var Sequelize=require(_0x698b('0x0'));module['exports']={'name':{'type':Sequelize[_0x698b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x698b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x698b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3d3b7c1..22b0f65 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','UserProfileResource','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x208d8e,_0x2d6b7f){var _0x2b50d1=function(_0x4c537d){while(--_0x4c537d){_0x208d8e['push'](_0x208d8e['shift']());}};_0x2b50d1(++_0x2d6b7f);}(_0x90b1,0x1bb));var _0x190b=function(_0x47f19d,_0x30582c){_0x47f19d=_0x47f19d-0x0;var _0x1fc180=_0x90b1[_0x47f19d];return _0x1fc180;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['UserProfileResource'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['UserProfileResource'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file +var _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','UserProfileResource','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x45f0ab,_0x166cd2){var _0x53e0ee=function(_0x5291ed){while(--_0x5291ed){_0x45f0ab['push'](_0x45f0ab['shift']());}};_0x53e0ee(++_0x166cd2);}(_0x4c60,0xc1));var _0x04c6=function(_0x539564,_0x3dc3ea){_0x539564=_0x539564-0x0;var _0x5c8904=_0x4c60[_0x539564];return _0x5c8904;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['UserProfileResource'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['UserProfileResource'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['UserProfileResource'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['UserProfileResource'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['UserProfileResource'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1a289db..4e00bb0 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 _0x2c90=['define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c90,0xd7));var _0x02c9=function(_0xdc6f31,_0x48ff1b){_0xdc6f31=_0xdc6f31-0x0;var _0x52ec6e=_0x2c90[_0xdc6f31];return _0x52ec6e;};'use strict';var _=require('lodash');var util=require(_0x02c9('0x0'));var logger=require(_0x02c9('0x1'))(_0x02c9('0x2'));var moment=require(_0x02c9('0x3'));var BPromise=require(_0x02c9('0x4'));var rp=require(_0x02c9('0x5'));var fs=require('fs');var path=require(_0x02c9('0x6'));var rimraf=require(_0x02c9('0x7'));var config=require(_0x02c9('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x02c9('0x9')]=function(_0x57e93f,_0x2e62db){return _0x57e93f[_0x02c9('0xa')](_0x02c9('0xb'),attributes,{'tableName':_0x02c9('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x02c9('0xd'),_0x02c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c55=['sectionId','lodash','util','../../config/logger','api','bluebird','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x8c55,0x90));var _0x58c5=function(_0x5cbaf9,_0x4be626){_0x5cbaf9=_0x5cbaf9-0x0;var _0x44f529=_0x8c55[_0x5cbaf9];return _0x44f529;};'use strict';var _=require(_0x58c5('0x0'));var util=require(_0x58c5('0x1'));var logger=require(_0x58c5('0x2'))(_0x58c5('0x3'));var moment=require('moment');var BPromise=require(_0x58c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x58c5('0x5')]=function(_0x12d5a4,_0x363228){return _0x12d5a4['define'](_0x58c5('0x6'),attributes,{'tableName':_0x58c5('0x7'),'paranoid':![],'indexes':[{'name':_0x58c5('0x8'),'fields':[_0x58c5('0x9'),_0x58c5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 618c4f3..5e8263b 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 _0xac55=['stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xac55,0x8c));var _0x5ac5=function(_0x6e605b,_0x43b637){_0x6e605b=_0x6e605b-0x0;var _0x53794c=_0xac55[_0x6e605b];return _0x53794c;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac5('0x2'));var db=require(_0x5ac5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ac5('0x4'));var config=require(_0x5ac5('0x5'));var jayson=require(_0x5ac5('0x6'));var client=jayson[_0x5ac5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12564b,_0x4a0bc9,_0x55306e){return new BPromise(function(_0x23d3ee,_0x559ebf){return client['request'](_0x12564b,_0x55306e)[_0x5ac5('0x8')](function(_0x593955){logger[_0x5ac5('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x4a0bc9,_0x5ac5('0xa'));logger[_0x5ac5('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4a0bc9,_0x5ac5('0xa'),JSON[_0x5ac5('0xc')](_0x593955));if(_0x593955[_0x5ac5('0xd')]){if(_0x593955['error'][_0x5ac5('0xe')]===0x1f4){logger[_0x5ac5('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x4a0bc9,_0x593955[_0x5ac5('0xd')][_0x5ac5('0xf')]);return _0x559ebf(_0x593955[_0x5ac5('0xd')][_0x5ac5('0xf')]);}logger['error'](_0x5ac5('0x10'),_0x4a0bc9,_0x593955[_0x5ac5('0xd')][_0x5ac5('0xf')]);return _0x23d3ee(_0x593955[_0x5ac5('0xd')][_0x5ac5('0xf')]);}else{logger[_0x5ac5('0x9')](_0x5ac5('0x10'),_0x4a0bc9,_0x5ac5('0xa'));_0x23d3ee(_0x593955[_0x5ac5('0x11')][_0x5ac5('0xf')]);}})[_0x5ac5('0x12')](function(_0x4d4145){logger[_0x5ac5('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x4a0bc9,_0x4d4145);_0x559ebf(_0x4d4145);});});} \ No newline at end of file +var _0x1636=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x20f603,_0x38b024){var _0x5f0e0c=function(_0x5bc2c1){while(--_0x5bc2c1){_0x20f603['push'](_0x20f603['shift']());}};_0x5f0e0c(++_0x38b024);}(_0x1636,0x1b4));var _0x6163=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1636[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6163('0x0'));var util=require(_0x6163('0x1'));var moment=require(_0x6163('0x2'));var BPromise=require('bluebird');var rs=require(_0x6163('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6163('0x4'))['db'];var utils=require(_0x6163('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6163('0x6'));var jayson=require(_0x6163('0x7'));var client=jayson[_0x6163('0x8')][_0x6163('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41a576,_0x3ab341,_0x98651b){return new BPromise(function(_0x16676f,_0x342b8a){return client[_0x6163('0xa')](_0x41a576,_0x98651b)[_0x6163('0xb')](function(_0x540d0c){logger[_0x6163('0xc')](_0x6163('0xd'),_0x3ab341,_0x6163('0xe'));logger['debug'](_0x6163('0xf'),_0x3ab341,_0x6163('0xe'),JSON[_0x6163('0x10')](_0x540d0c));if(_0x540d0c[_0x6163('0x11')]){if(_0x540d0c[_0x6163('0x11')][_0x6163('0x12')]===0x1f4){logger[_0x6163('0x11')](_0x6163('0xd'),_0x3ab341,_0x540d0c['error'][_0x6163('0x13')]);return _0x342b8a(_0x540d0c[_0x6163('0x11')][_0x6163('0x13')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3ab341,_0x540d0c['error'][_0x6163('0x13')]);return _0x16676f(_0x540d0c['error'][_0x6163('0x13')]);}else{logger[_0x6163('0xc')](_0x6163('0xd'),_0x3ab341,_0x6163('0xe'));_0x16676f(_0x540d0c['result'][_0x6163('0x13')]);}})[_0x6163('0x14')](function(_0x5b1fb7){logger[_0x6163('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3ab341,_0x5b1fb7);_0x342b8a(_0x5b1fb7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 935c802..328330e 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 _0x2fe5=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0x2fe5,0x1cc));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var path=require(_0x52fe('0x2'));var timeout=require(_0x52fe('0x3'));var express=require(_0x52fe('0x4'));var router=express[_0x52fe('0x5')]();var fs_extra=require(_0x52fe('0x6'));var auth=require(_0x52fe('0x7'));var interaction=require(_0x52fe('0x8'));var config=require('../../config/environment');var controller=require(_0x52fe('0x9'));router[_0x52fe('0xa')]('/',auth[_0x52fe('0xb')](),controller[_0x52fe('0xc')]);router['get'](_0x52fe('0xd'),auth[_0x52fe('0xb')](),controller[_0x52fe('0xe')]);router['get'](_0x52fe('0xf'),auth[_0x52fe('0xb')](),controller[_0x52fe('0x10')]);router[_0x52fe('0x11')]('/',auth[_0x52fe('0xb')](),controller[_0x52fe('0x12')]);router[_0x52fe('0x13')]('/:id',auth[_0x52fe('0xb')](),controller[_0x52fe('0x14')]);router['delete']('/:id',auth[_0x52fe('0xb')](),controller[_0x52fe('0x15')]);module[_0x52fe('0x16')]=router; \ No newline at end of file +var _0x0ad2=['../../config/environment','./userProfileSection.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0ad2,0x1b2));var _0x20ad=function(_0x23d706,_0x12b65b){_0x23d706=_0x23d706-0x0;var _0x66611c=_0x0ad2[_0x23d706];return _0x66611c;};'use strict';var multer=require(_0x20ad('0x0'));var util=require(_0x20ad('0x1'));var path=require('path');var timeout=require(_0x20ad('0x2'));var express=require(_0x20ad('0x3'));var router=express['Router']();var fs_extra=require(_0x20ad('0x4'));var auth=require(_0x20ad('0x5'));var interaction=require(_0x20ad('0x6'));var config=require(_0x20ad('0x7'));var controller=require(_0x20ad('0x8'));router[_0x20ad('0x9')]('/',auth['isAuthenticated'](),controller[_0x20ad('0xa')]);router[_0x20ad('0x9')](_0x20ad('0xb'),auth['isAuthenticated'](),controller[_0x20ad('0xc')]);router[_0x20ad('0x9')](_0x20ad('0xd'),auth[_0x20ad('0xe')](),controller[_0x20ad('0xf')]);router[_0x20ad('0x10')]('/',auth['isAuthenticated'](),controller[_0x20ad('0x11')]);router[_0x20ad('0x12')](_0x20ad('0xd'),auth[_0x20ad('0xe')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x20ad('0x13')]);module[_0x20ad('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1fefe9e..f39273c 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 _0x63a5=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize','exports'];(function(_0x405541,_0x2945cc){var _0x194a1e=function(_0x46fffe){while(--_0x46fffe){_0x405541['push'](_0x405541['shift']());}};_0x194a1e(++_0x2945cc);}(_0x63a5,0x18e));var _0x563a=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x63a5[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0x563a('0x0'));module[_0x563a('0x1')]={'name':{'type':Sequelize[_0x563a('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x563a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x563a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x563a('0x2')],'set':function(_0x386400){this[_0x563a('0x5')]('crudPermissions',_0x386400?_0x386400['join'](''):[]);},'get':function(){return this[_0x563a('0x6')]('crudPermissions')?this[_0x563a('0x6')](_0x563a('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0x4213=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions','join'];(function(_0xd7c25b,_0x57b236){var _0x1cfa1f=function(_0x21e76f){while(--_0x21e76f){_0xd7c25b['push'](_0xd7c25b['shift']());}};_0x1cfa1f(++_0x57b236);}(_0x4213,0x77));var _0x3421=function(_0x4c09ae,_0x5c0189){_0x4c09ae=_0x4c09ae-0x0;var _0x260d5f=_0x4213[_0x4c09ae];return _0x260d5f;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'name':{'type':Sequelize[_0x3421('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x3421('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3421('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3421('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3421('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xdbd54e){this['setDataValue'](_0x3421('0x5'),_0xdbd54e?_0xdbd54e[_0x3421('0x6')](''):[]);},'get':function(){return this[_0x3421('0x7')](_0x3421('0x5'))?this['getDataValue'](_0x3421('0x5'))[_0x3421('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 90fbd8e..0cffc46 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 _0x9608=['findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','error','name','send','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9608,0xee));var _0x8960=function(_0xe8762b,_0x188a41){_0xe8762b=_0xe8762b-0x0;var _0x562d35=_0x9608[_0xe8762b];return _0x562d35;};'use strict';var emlformat=require(_0x8960('0x0'));var rimraf=require(_0x8960('0x1'));var zipdir=require(_0x8960('0x2'));var jsonpatch=require(_0x8960('0x3'));var rp=require(_0x8960('0x4'));var moment=require(_0x8960('0x5'));var BPromise=require(_0x8960('0x6'));var Mustache=require(_0x8960('0x7'));var util=require(_0x8960('0x8'));var path=require(_0x8960('0x9'));var sox=require('sox');var csv=require(_0x8960('0xa'));var ejs=require(_0x8960('0xb'));var fs=require('fs');var fs_extra=require(_0x8960('0xc'));var _=require(_0x8960('0xd'));var squel=require(_0x8960('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8960('0xf'));var toCsv=require(_0x8960('0xa'));var querystring=require(_0x8960('0x10'));var Papa=require(_0x8960('0x11'));var Redis=require(_0x8960('0x12'));var authService=require(_0x8960('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8960('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8960('0x15'))('api');var utils=require(_0x8960('0x16'));var config=require(_0x8960('0x17'));var licenseUtil=require(_0x8960('0x18'));var db=require(_0x8960('0x19'))['db'];function respondWithStatusCode(_0x43f938,_0x7beb0e){_0x7beb0e=_0x7beb0e||0xcc;return function(_0x149098){if(_0x149098){return _0x43f938[_0x8960('0x1a')](_0x7beb0e);}return _0x43f938[_0x8960('0x1b')](_0x7beb0e)[_0x8960('0x1c')]();};}function respondWithResult(_0x124d13,_0x323fd5){_0x323fd5=_0x323fd5||0xc8;return function(_0x472108){if(_0x472108){return _0x124d13[_0x8960('0x1b')](_0x323fd5)[_0x8960('0x1d')](_0x472108);}};}function respondWithFilteredResult(_0x54c685,_0x4ea0cf){return function(_0x1c4820){if(_0x1c4820){var _0x4d4a75=typeof _0x4ea0cf['offset']==='undefined'&&typeof _0x4ea0cf[_0x8960('0x1e')]===_0x8960('0x1f');var _0x29ece0=_0x1c4820[_0x8960('0x20')];var _0x51127d=_0x4d4a75?0x0:_0x4ea0cf[_0x8960('0x21')];var _0x37ed45=_0x4d4a75?_0x1c4820[_0x8960('0x20')]:_0x4ea0cf['offset']+_0x4ea0cf[_0x8960('0x1e')];var _0x135aa2;if(_0x37ed45>=_0x29ece0){_0x37ed45=_0x29ece0;_0x135aa2=0xc8;}else{_0x135aa2=0xce;}_0x54c685['status'](_0x135aa2);return _0x54c685[_0x8960('0x22')]('Content-Range',_0x51127d+'-'+_0x37ed45+'/'+_0x29ece0)[_0x8960('0x1d')](_0x1c4820);}return null;};}function patchUpdates(_0x2cbb23){return function(_0x4d9234){try{jsonpatch[_0x8960('0x23')](_0x4d9234,_0x2cbb23,!![]);}catch(_0xcddeac){return BPromise[_0x8960('0x24')](_0xcddeac);}return _0x4d9234['save']();};}function saveUpdates(_0x4a2b01,_0x308641){return function(_0x33ef14){if(_0x33ef14){return _0x33ef14[_0x8960('0x25')](_0x4a2b01)['then'](function(_0x2e60b2){return _0x2e60b2;});}return null;};}function removeEntity(_0x4a37fb,_0x46cd27){return function(_0xbfcbe9){if(_0xbfcbe9){return _0xbfcbe9['destroy']()['then'](function(){_0x4a37fb[_0x8960('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30acbe,_0x43afec){return function(_0x9f43a2){if(!_0x9f43a2){_0x30acbe[_0x8960('0x1a')](0x194);}return _0x9f43a2;};}function handleError(_0x1cd522,_0x4b7f82){_0x4b7f82=_0x4b7f82||0x1f4;return function(_0x41d0d0){logger[_0x8960('0x26')](_0x41d0d0['stack']);if(_0x41d0d0['name']){delete _0x41d0d0[_0x8960('0x27')];}_0x1cd522['status'](_0x4b7f82)[_0x8960('0x28')](_0x41d0d0);};}exports['index']=function(_0x294b72,_0x440341){var _0x3195c3={},_0x2dd2bd={},_0x4115d0={'count':0x0,'rows':[]};var _0x364f3f=_[_0x8960('0x29')](db[_0x8960('0x2a')][_0x8960('0x2b')],function(_0x29bd8e){return{'name':_0x29bd8e[_0x8960('0x2c')],'type':_0x29bd8e['type'][_0x8960('0x2d')]};});_0x2dd2bd[_0x8960('0x2e')]=_[_0x8960('0x29')](_0x364f3f,_0x8960('0x27'));_0x2dd2bd[_0x8960('0x2f')]=_[_0x8960('0x30')](_0x294b72[_0x8960('0x2f')]);_0x2dd2bd[_0x8960('0x31')]=_[_0x8960('0x32')](_0x2dd2bd[_0x8960('0x2e')],_0x2dd2bd[_0x8960('0x2f')]);_0x3195c3[_0x8960('0x33')]=_[_0x8960('0x32')](_0x2dd2bd[_0x8960('0x2e')],qs[_0x8960('0x34')](_0x294b72[_0x8960('0x2f')]['fields']));_0x3195c3[_0x8960('0x33')]=_0x3195c3[_0x8960('0x33')][_0x8960('0x35')]?_0x3195c3[_0x8960('0x33')]:_0x2dd2bd[_0x8960('0x2e')];if(!_0x294b72['query'][_0x8960('0x36')](_0x8960('0x37'))){_0x3195c3[_0x8960('0x1e')]=qs[_0x8960('0x1e')](_0x294b72[_0x8960('0x2f')][_0x8960('0x1e')]);_0x3195c3[_0x8960('0x21')]=qs[_0x8960('0x21')](_0x294b72[_0x8960('0x2f')][_0x8960('0x21')]);}_0x3195c3['order']=qs['sort'](_0x294b72['query'][_0x8960('0x38')]);_0x3195c3[_0x8960('0x39')]=qs[_0x8960('0x31')](_['pick'](_0x294b72[_0x8960('0x2f')],_0x2dd2bd[_0x8960('0x31')]),_0x364f3f);if(_0x294b72[_0x8960('0x2f')][_0x8960('0x3a')]){_0x3195c3[_0x8960('0x39')]=_[_0x8960('0x3b')](_0x3195c3[_0x8960('0x39')],{'$or':_[_0x8960('0x29')](_0x364f3f,function(_0x5b9261){if(_0x5b9261[_0x8960('0x3c')]!==_0x8960('0x3d')){var _0x17b53e={};_0x17b53e[_0x5b9261[_0x8960('0x27')]]={'$like':'%'+_0x294b72[_0x8960('0x2f')]['filter']+'%'};return _0x17b53e;}})});}_0x3195c3=_[_0x8960('0x3b')]({},_0x3195c3,_0x294b72[_0x8960('0x3e')]);var _0x49e326={'where':_0x3195c3['where']};return db['UserProfileSection'][_0x8960('0x20')](_0x49e326)[_0x8960('0x3f')](function(_0x4803e0){_0x4115d0[_0x8960('0x20')]=_0x4803e0;if(_0x294b72['query'][_0x8960('0x40')]){_0x3195c3[_0x8960('0x41')]=[{'all':!![]}];}return db[_0x8960('0x2a')][_0x8960('0x42')](_0x3195c3);})[_0x8960('0x3f')](function(_0x25f48e){_0x4115d0[_0x8960('0x43')]=_0x25f48e;return _0x4115d0;})[_0x8960('0x3f')](respondWithFilteredResult(_0x440341,_0x3195c3))[_0x8960('0x44')](handleError(_0x440341,null));};exports[_0x8960('0x45')]=function(_0xa0621d,_0x5d5744){var _0x3d23e4={'raw':![],'where':{'id':_0xa0621d[_0x8960('0x46')]['id']}},_0x23b9c1={};_0x23b9c1[_0x8960('0x2e')]=_[_0x8960('0x30')](db[_0x8960('0x2a')]['rawAttributes']);_0x23b9c1[_0x8960('0x2f')]=_[_0x8960('0x30')](_0xa0621d['query']);_0x23b9c1[_0x8960('0x31')]=_[_0x8960('0x32')](_0x23b9c1[_0x8960('0x2e')],_0x23b9c1[_0x8960('0x2f')]);_0x3d23e4[_0x8960('0x33')]=_[_0x8960('0x32')](_0x23b9c1[_0x8960('0x2e')],qs[_0x8960('0x34')](_0xa0621d[_0x8960('0x2f')][_0x8960('0x34')]));_0x3d23e4[_0x8960('0x33')]=_0x3d23e4[_0x8960('0x33')]['length']?_0x3d23e4[_0x8960('0x33')]:_0x23b9c1[_0x8960('0x2e')];if(_0xa0621d[_0x8960('0x2f')][_0x8960('0x40')]){_0x3d23e4[_0x8960('0x41')]=[{'all':!![]}];}_0x3d23e4=_['merge']({},_0x3d23e4,_0xa0621d[_0x8960('0x3e')]);return db[_0x8960('0x2a')][_0x8960('0x47')](_0x3d23e4)[_0x8960('0x3f')](handleEntityNotFound(_0x5d5744,null))[_0x8960('0x3f')](respondWithResult(_0x5d5744,null))[_0x8960('0x44')](handleError(_0x5d5744,null));};exports['create']=function(_0x266fc0,_0x5f5688){return db['UserProfileSection'][_0x8960('0x48')](_0x266fc0[_0x8960('0x49')],{})['then'](respondWithResult(_0x5f5688,0xc9))[_0x8960('0x44')](handleError(_0x5f5688,null));};exports['update']=function(_0x26491d,_0x1970fe){if(_0x26491d[_0x8960('0x49')]['id']){delete _0x26491d[_0x8960('0x49')]['id'];}return db[_0x8960('0x2a')]['find']({'where':{'id':_0x26491d[_0x8960('0x46')]['id']}})[_0x8960('0x3f')](handleEntityNotFound(_0x1970fe,null))[_0x8960('0x3f')](saveUpdates(_0x26491d[_0x8960('0x49')],null))[_0x8960('0x3f')](respondWithResult(_0x1970fe,null))[_0x8960('0x44')](handleError(_0x1970fe,null));};exports[_0x8960('0x4a')]=function(_0x221604,_0xc9b0e4){return db[_0x8960('0x2a')][_0x8960('0x47')]({'where':{'id':_0x221604[_0x8960('0x46')]['id']}})[_0x8960('0x3f')](handleEntityNotFound(_0xc9b0e4,null))[_0x8960('0x3f')](removeEntity(_0xc9b0e4,null))[_0x8960('0x44')](handleError(_0xc9b0e4,null));};exports[_0x8960('0x4b')]=function(_0x12f3c8,_0x3cbd24){return db[_0x8960('0x2a')]['describe']()[_0x8960('0x3f')](respondWithResult(_0x3cbd24,null))['catch'](handleError(_0x3cbd24,null));}; \ No newline at end of file +var _0x0131=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileSection','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','findAll','rows','show','length','includeAll','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3bc541,_0x52d4ec){var _0x1a873d=function(_0x3fb71d){while(--_0x3fb71d){_0x3bc541['push'](_0x3bc541['shift']());}};_0x1a873d(++_0x52d4ec);}(_0x0131,0xd5));var _0x1013=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x0131[_0x4de586];return _0x46baf5;};'use strict';var emlformat=require(_0x1013('0x0'));var rimraf=require(_0x1013('0x1'));var zipdir=require(_0x1013('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1013('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1013('0x4'));var util=require(_0x1013('0x5'));var path=require(_0x1013('0x6'));var sox=require(_0x1013('0x7'));var csv=require(_0x1013('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1013('0x9'));var _=require(_0x1013('0xa'));var squel=require(_0x1013('0xb'));var crypto=require(_0x1013('0xc'));var jsforce=require(_0x1013('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1013('0x8'));var querystring=require(_0x1013('0xe'));var Papa=require(_0x1013('0xf'));var Redis=require(_0x1013('0x10'));var authService=require(_0x1013('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1013('0x12'));var hardwareService=require(_0x1013('0x13'));var logger=require(_0x1013('0x14'))(_0x1013('0x15'));var utils=require(_0x1013('0x16'));var config=require(_0x1013('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x597689,_0x2d8db5){_0x2d8db5=_0x2d8db5||0xcc;return function(_0x4cf2d4){if(_0x4cf2d4){return _0x597689[_0x1013('0x18')](_0x2d8db5);}return _0x597689['status'](_0x2d8db5)['end']();};}function respondWithResult(_0x4f0631,_0x5441cb){_0x5441cb=_0x5441cb||0xc8;return function(_0x2e0306){if(_0x2e0306){return _0x4f0631[_0x1013('0x19')](_0x5441cb)[_0x1013('0x1a')](_0x2e0306);}};}function respondWithFilteredResult(_0x3beaae,_0xb7362c){return function(_0x6f9fb7){if(_0x6f9fb7){var _0x584e29=typeof _0xb7362c[_0x1013('0x1b')]===_0x1013('0x1c')&&typeof _0xb7362c[_0x1013('0x1d')]==='undefined';var _0x228ff6=_0x6f9fb7[_0x1013('0x1e')];var _0x42b59f=_0x584e29?0x0:_0xb7362c[_0x1013('0x1b')];var _0x3a05cc=_0x584e29?_0x6f9fb7['count']:_0xb7362c[_0x1013('0x1b')]+_0xb7362c[_0x1013('0x1d')];var _0x1d3ac6;if(_0x3a05cc>=_0x228ff6){_0x3a05cc=_0x228ff6;_0x1d3ac6=0xc8;}else{_0x1d3ac6=0xce;}_0x3beaae[_0x1013('0x19')](_0x1d3ac6);return _0x3beaae[_0x1013('0x1f')]('Content-Range',_0x42b59f+'-'+_0x3a05cc+'/'+_0x228ff6)[_0x1013('0x1a')](_0x6f9fb7);}return null;};}function patchUpdates(_0x2bd1c8){return function(_0x1c9462){try{jsonpatch[_0x1013('0x20')](_0x1c9462,_0x2bd1c8,!![]);}catch(_0xa5e670){return BPromise[_0x1013('0x21')](_0xa5e670);}return _0x1c9462[_0x1013('0x22')]();};}function saveUpdates(_0x371153,_0x425adc){return function(_0x739d33){if(_0x739d33){return _0x739d33[_0x1013('0x23')](_0x371153)[_0x1013('0x24')](function(_0x3e94ab){return _0x3e94ab;});}return null;};}function removeEntity(_0x53c5b1,_0x45f018){return function(_0x231921){if(_0x231921){return _0x231921[_0x1013('0x25')]()['then'](function(){_0x53c5b1[_0x1013('0x19')](0xcc)[_0x1013('0x26')]();});}};}function handleEntityNotFound(_0x4d2d9f,_0x17eb8){return function(_0x4d5b00){if(!_0x4d5b00){_0x4d2d9f['sendStatus'](0x194);}return _0x4d5b00;};}function handleError(_0x1e986f,_0x42b772){_0x42b772=_0x42b772||0x1f4;return function(_0x443d84){logger[_0x1013('0x27')](_0x443d84[_0x1013('0x28')]);if(_0x443d84[_0x1013('0x29')]){delete _0x443d84['name'];}_0x1e986f['status'](_0x42b772)[_0x1013('0x2a')](_0x443d84);};}exports[_0x1013('0x2b')]=function(_0x3d7e41,_0x21ee40){var _0x5bf257={},_0x4f39fa={},_0x5878d3={'count':0x0,'rows':[]};var _0x3006c9=_['map'](db[_0x1013('0x2c')][_0x1013('0x2d')],function(_0x462b9b){return{'name':_0x462b9b['fieldName'],'type':_0x462b9b[_0x1013('0x2e')]['key']};});_0x4f39fa['model']=_['map'](_0x3006c9,_0x1013('0x29'));_0x4f39fa[_0x1013('0x2f')]=_[_0x1013('0x30')](_0x3d7e41[_0x1013('0x2f')]);_0x4f39fa[_0x1013('0x31')]=_[_0x1013('0x32')](_0x4f39fa['model'],_0x4f39fa[_0x1013('0x2f')]);_0x5bf257[_0x1013('0x33')]=_[_0x1013('0x32')](_0x4f39fa[_0x1013('0x34')],qs[_0x1013('0x35')](_0x3d7e41[_0x1013('0x2f')][_0x1013('0x35')]));_0x5bf257[_0x1013('0x33')]=_0x5bf257[_0x1013('0x33')]['length']?_0x5bf257['attributes']:_0x4f39fa[_0x1013('0x34')];if(!_0x3d7e41[_0x1013('0x2f')][_0x1013('0x36')](_0x1013('0x37'))){_0x5bf257['limit']=qs['limit'](_0x3d7e41[_0x1013('0x2f')][_0x1013('0x1d')]);_0x5bf257[_0x1013('0x1b')]=qs['offset'](_0x3d7e41[_0x1013('0x2f')][_0x1013('0x1b')]);}_0x5bf257[_0x1013('0x38')]=qs[_0x1013('0x39')](_0x3d7e41[_0x1013('0x2f')][_0x1013('0x39')]);_0x5bf257[_0x1013('0x3a')]=qs['filters'](_[_0x1013('0x3b')](_0x3d7e41['query'],_0x4f39fa[_0x1013('0x31')]),_0x3006c9);if(_0x3d7e41[_0x1013('0x2f')][_0x1013('0x3c')]){_0x5bf257['where']=_[_0x1013('0x3d')](_0x5bf257[_0x1013('0x3a')],{'$or':_[_0x1013('0x3e')](_0x3006c9,function(_0x333b17){if(_0x333b17[_0x1013('0x2e')]!==_0x1013('0x3f')){var _0x191c35={};_0x191c35[_0x333b17['name']]={'$like':'%'+_0x3d7e41[_0x1013('0x2f')]['filter']+'%'};return _0x191c35;}})});}_0x5bf257=_['merge']({},_0x5bf257,_0x3d7e41[_0x1013('0x40')]);var _0x42d88d={'where':_0x5bf257[_0x1013('0x3a')]};return db[_0x1013('0x2c')][_0x1013('0x1e')](_0x42d88d)['then'](function(_0x4af355){_0x5878d3['count']=_0x4af355;if(_0x3d7e41[_0x1013('0x2f')]['includeAll']){_0x5bf257['include']=[{'all':!![]}];}return db[_0x1013('0x2c')][_0x1013('0x41')](_0x5bf257);})[_0x1013('0x24')](function(_0x2a0644){_0x5878d3[_0x1013('0x42')]=_0x2a0644;return _0x5878d3;})[_0x1013('0x24')](respondWithFilteredResult(_0x21ee40,_0x5bf257))['catch'](handleError(_0x21ee40,null));};exports[_0x1013('0x43')]=function(_0x2cac37,_0x24269f){var _0x1032a5={'raw':![],'where':{'id':_0x2cac37['params']['id']}},_0x1f5f97={};_0x1f5f97['model']=_[_0x1013('0x30')](db[_0x1013('0x2c')]['rawAttributes']);_0x1f5f97[_0x1013('0x2f')]=_[_0x1013('0x30')](_0x2cac37['query']);_0x1f5f97[_0x1013('0x31')]=_[_0x1013('0x32')](_0x1f5f97['model'],_0x1f5f97[_0x1013('0x2f')]);_0x1032a5[_0x1013('0x33')]=_['intersection'](_0x1f5f97[_0x1013('0x34')],qs[_0x1013('0x35')](_0x2cac37[_0x1013('0x2f')][_0x1013('0x35')]));_0x1032a5[_0x1013('0x33')]=_0x1032a5[_0x1013('0x33')][_0x1013('0x44')]?_0x1032a5[_0x1013('0x33')]:_0x1f5f97[_0x1013('0x34')];if(_0x2cac37['query'][_0x1013('0x45')]){_0x1032a5[_0x1013('0x46')]=[{'all':!![]}];}_0x1032a5=_[_0x1013('0x3d')]({},_0x1032a5,_0x2cac37[_0x1013('0x40')]);return db[_0x1013('0x2c')][_0x1013('0x47')](_0x1032a5)[_0x1013('0x24')](handleEntityNotFound(_0x24269f,null))[_0x1013('0x24')](respondWithResult(_0x24269f,null))[_0x1013('0x48')](handleError(_0x24269f,null));};exports[_0x1013('0x49')]=function(_0x3735ca,_0x4abe1a){return db[_0x1013('0x2c')][_0x1013('0x49')](_0x3735ca[_0x1013('0x4a')],{})['then'](respondWithResult(_0x4abe1a,0xc9))[_0x1013('0x48')](handleError(_0x4abe1a,null));};exports[_0x1013('0x23')]=function(_0x1d763e,_0x392b1a){if(_0x1d763e[_0x1013('0x4a')]['id']){delete _0x1d763e['body']['id'];}return db[_0x1013('0x2c')]['find']({'where':{'id':_0x1d763e[_0x1013('0x4b')]['id']}})[_0x1013('0x24')](handleEntityNotFound(_0x392b1a,null))[_0x1013('0x24')](saveUpdates(_0x1d763e['body'],null))[_0x1013('0x24')](respondWithResult(_0x392b1a,null))['catch'](handleError(_0x392b1a,null));};exports[_0x1013('0x25')]=function(_0x1d1692,_0x4d2d84){return db[_0x1013('0x2c')]['find']({'where':{'id':_0x1d1692['params']['id']}})[_0x1013('0x24')](handleEntityNotFound(_0x4d2d84,null))[_0x1013('0x24')](removeEntity(_0x4d2d84,null))[_0x1013('0x48')](handleError(_0x4d2d84,null));};exports[_0x1013('0x4c')]=function(_0x9451de,_0x31684a){return db[_0x1013('0x2c')][_0x1013('0x4c')]()[_0x1013('0x24')](respondWithResult(_0x31684a,null))[_0x1013('0x48')](handleError(_0x31684a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index deee055..94345de 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 _0x5580=['bluebird','request-promise','path','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','../../config/logger','moment'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x5580,0x1ea));var _0x0558=function(_0x1250cf,_0x5a2f82){_0x1250cf=_0x1250cf-0x0;var _0x37c58f=_0x5580[_0x1250cf];return _0x37c58f;};'use strict';var _=require(_0x0558('0x0'));var util=require(_0x0558('0x1'));var logger=require(_0x0558('0x2'))('api');var moment=require(_0x0558('0x3'));var BPromise=require(_0x0558('0x4'));var rp=require(_0x0558('0x5'));var fs=require('fs');var path=require(_0x0558('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0558('0x7'));module[_0x0558('0x8')]=function(_0x3bd33a,_0x391e79){return _0x3bd33a[_0x0558('0x9')](_0x0558('0xa'),attributes,{'tableName':_0x0558('0xb'),'paranoid':![],'indexes':[{'name':_0x0558('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x856b=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','user_profile_has_sections'];(function(_0x439c6e,_0x2b236d){var _0x542133=function(_0x28747e){while(--_0x28747e){_0x439c6e['push'](_0x439c6e['shift']());}};_0x542133(++_0x2b236d);}(_0x856b,0xc6));var _0xb856=function(_0x42e612,_0x4ee2ab){_0x42e612=_0x42e612-0x0;var _0x466dcc=_0x856b[_0x42e612];return _0x466dcc;};'use strict';var _=require(_0xb856('0x0'));var util=require(_0xb856('0x1'));var logger=require(_0xb856('0x2'))(_0xb856('0x3'));var moment=require(_0xb856('0x4'));var BPromise=require('bluebird');var rp=require(_0xb856('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb856('0x6'));var config=require(_0xb856('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x197a1d,_0x33a800){return _0x197a1d[_0xb856('0x8')]('UserProfileSection',attributes,{'tableName':_0xb856('0x9'),'paranoid':![],'indexes':[{'name':_0xb856('0xa'),'fields':[_0xb856('0xb'),_0xb856('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6831727..aaa3b9b 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 _0xa633=['request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s'];(function(_0x24470c,_0x3198a2){var _0x3d6b17=function(_0x160a8a){while(--_0x160a8a){_0x24470c['push'](_0x24470c['shift']());}};_0x3d6b17(++_0x3198a2);}(_0xa633,0x15d));var _0x3a63=function(_0x25bf44,_0x4573b0){_0x25bf44=_0x25bf44-0x0;var _0x4a2dca=_0xa633[_0x25bf44];return _0x4a2dca;};'use strict';var _=require(_0x3a63('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a63('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a63('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a63('0x3'))(_0x3a63('0x4'));var config=require(_0x3a63('0x5'));var jayson=require(_0x3a63('0x6'));var client=jayson[_0x3a63('0x7')][_0x3a63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ebc45,_0x1f769d,_0x567ff5){return new BPromise(function(_0x574b7c,_0x77c6ff){return client[_0x3a63('0x9')](_0x7ebc45,_0x567ff5)[_0x3a63('0xa')](function(_0x1aa5db){logger['info'](_0x3a63('0xb'),_0x1f769d,_0x3a63('0xc'));logger['debug'](_0x3a63('0xd'),_0x1f769d,'request\x20sent',JSON[_0x3a63('0xe')](_0x1aa5db));if(_0x1aa5db[_0x3a63('0xf')]){if(_0x1aa5db['error']['code']===0x1f4){logger[_0x3a63('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x1f769d,_0x1aa5db[_0x3a63('0xf')][_0x3a63('0x10')]);return _0x77c6ff(_0x1aa5db['error'][_0x3a63('0x10')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1f769d,_0x1aa5db['error'][_0x3a63('0x10')]);return _0x574b7c(_0x1aa5db[_0x3a63('0xf')][_0x3a63('0x10')]);}else{logger['info'](_0x3a63('0xb'),_0x1f769d,_0x3a63('0xc'));_0x574b7c(_0x1aa5db[_0x3a63('0x11')][_0x3a63('0x10')]);}})[_0x3a63('0x12')](function(_0x3c909a){logger[_0x3a63('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x1f769d,_0x3c909a);_0x77c6ff(_0x3c909a);});});} \ No newline at end of file +var _0x38d3=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd9f486,_0x4ab7c5){var _0x271733=function(_0x19e529){while(--_0x19e529){_0xd9f486['push'](_0xd9f486['shift']());}};_0x271733(++_0x4ab7c5);}(_0x38d3,0x1a7));var _0x338d=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x38d3[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bb0ff38..3343061 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x43bcc1,_0x3eb3d4){var _0x5ba4e9=function(_0x594eba){while(--_0x594eba){_0x43bcc1['push'](_0x43bcc1['shift']());}};_0x5ba4e9(++_0x3eb3d4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0xcb91[_0x455150];return _0x12ca9c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x575b13,_0x1b3e34){var _0xa535a5=function(_0x14816e){while(--_0x14816e){_0x575b13['push'](_0x575b13['shift']());}};_0xa535a5(++_0x1b3e34);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xcb91[_0x114b7c];return _0x47185f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b49426d..9fe6903 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 _0xc469=['INTEGER','sequelize','exports'];(function(_0x43b4da,_0x48517e){var _0x58a73a=function(_0x26a667){while(--_0x26a667){_0x43b4da['push'](_0x43b4da['shift']());}};_0x58a73a(++_0x48517e);}(_0xc469,0x1de));var _0x9c46=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xc469[_0x4cce65];return _0x4d1b45;};'use strict';var Sequelize=require(_0x9c46('0x0'));module[_0x9c46('0x1')]={'penalty':{'type':Sequelize[_0x9c46('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcbd1=['exports','INTEGER','sequelize'];(function(_0x58680e,_0x418cdb){var _0x27f9aa=function(_0x11d764){while(--_0x11d764){_0x58680e['push'](_0x58680e['shift']());}};_0x27f9aa(++_0x418cdb);}(_0xcbd1,0x15b));var _0x1cbd=function(_0x19423b,_0x2b3022){_0x19423b=_0x19423b-0x0;var _0x5d69c5=_0xcbd1[_0x19423b];return _0x5d69c5;};'use strict';var Sequelize=require(_0x1cbd('0x0'));module[_0x1cbd('0x1')]={'penalty':{'type':Sequelize[_0x1cbd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b89c046..71464cc 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 _0x0295=['define','lodash','api','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x310ad9,_0x530ab5){var _0x53f73b=function(_0x4a89e9){while(--_0x4a89e9){_0x310ad9['push'](_0x310ad9['shift']());}};_0x53f73b(++_0x530ab5);}(_0x0295,0x1f0));var _0x5029=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x0295[_0x595bd1];return _0xd0344f;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fd4=['rimraf','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x595e1f,_0x3c3c87){_0x595e1f=_0x595e1f-0x0;var _0x396b4d=_0x9fd4[_0x595e1f];return _0x396b4d;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var BPromise=require(_0x49fd('0x5'));var rp=require(_0x49fd('0x6'));var fs=require('fs');var path=require(_0x49fd('0x7'));var rimraf=require(_0x49fd('0x8'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x49fd('0x9')]=function(_0x42fdc7,_0x1bc16e){return _0x42fdc7[_0x49fd('0xa')]('UserSmsQueue',attributes,{'tableName':_0x49fd('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 9e6c120..ae92bdb 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 _0x6015=['then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x116685,_0x50713b){var _0xade6a5=function(_0x563f11){while(--_0x563f11){_0x116685['push'](_0x116685['shift']());}};_0xade6a5(++_0x50713b);}(_0x6015,0x94));var _0x5601=function(_0x5a326a,_0x43da35){_0x5a326a=_0x5a326a-0x0;var _0x4736c7=_0x6015[_0x5a326a];return _0x4736c7;};'use strict';var _=require('lodash');var util=require(_0x5601('0x0'));var moment=require(_0x5601('0x1'));var BPromise=require('bluebird');var rs=require(_0x5601('0x2'));var fs=require('fs');var Redis=require(_0x5601('0x3'));var db=require(_0x5601('0x4'))['db'];var utils=require(_0x5601('0x5'));var logger=require(_0x5601('0x6'))(_0x5601('0x7'));var config=require(_0x5601('0x8'));var jayson=require(_0x5601('0x9'));var client=jayson[_0x5601('0xa')][_0x5601('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16aed7,_0x23c58d,_0x32aca3){return new BPromise(function(_0x5c4bf8,_0x3b8994){return client[_0x5601('0xc')](_0x16aed7,_0x32aca3)[_0x5601('0xd')](function(_0x268ebe){logger[_0x5601('0xe')](_0x5601('0xf'),_0x23c58d,'request\x20sent');logger[_0x5601('0x10')](_0x5601('0x11'),_0x23c58d,_0x5601('0x12'),JSON['stringify'](_0x268ebe));if(_0x268ebe[_0x5601('0x13')]){if(_0x268ebe[_0x5601('0x13')][_0x5601('0x14')]===0x1f4){logger['error'](_0x5601('0xf'),_0x23c58d,_0x268ebe[_0x5601('0x13')][_0x5601('0x15')]);return _0x3b8994(_0x268ebe['error'][_0x5601('0x15')]);}logger[_0x5601('0x13')](_0x5601('0xf'),_0x23c58d,_0x268ebe[_0x5601('0x13')][_0x5601('0x15')]);return _0x5c4bf8(_0x268ebe[_0x5601('0x13')][_0x5601('0x15')]);}else{logger[_0x5601('0xe')](_0x5601('0xf'),_0x23c58d,_0x5601('0x12'));_0x5c4bf8(_0x268ebe['result']['message']);}})[_0x5601('0x16')](function(_0x564ea5){logger[_0x5601('0x13')](_0x5601('0xf'),_0x23c58d,_0x564ea5);_0x3b8994(_0x564ea5);});});} \ No newline at end of file +var _0x8a3b=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x193d92,_0x45bac0){var _0x5471d0=function(_0xf0b1ad){while(--_0xf0b1ad){_0x193d92['push'](_0x193d92['shift']());}};_0x5471d0(++_0x45bac0);}(_0x8a3b,0x151));var _0xb8a3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x8a3b[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xb8a3('0x0'));var util=require(_0xb8a3('0x1'));var moment=require(_0xb8a3('0x2'));var BPromise=require(_0xb8a3('0x3'));var rs=require(_0xb8a3('0x4'));var fs=require('fs');var Redis=require(_0xb8a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb8a3('0x6'))(_0xb8a3('0x7'));var config=require(_0xb8a3('0x8'));var jayson=require(_0xb8a3('0x9'));var client=jayson[_0xb8a3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2361,_0x458fa8,_0x56ea14){return new BPromise(function(_0x49114f,_0x1cd964){return client['request'](_0x5c2361,_0x56ea14)['then'](function(_0x527fcc){logger[_0xb8a3('0xb')](_0xb8a3('0xc'),_0x458fa8,'request\x20sent');logger[_0xb8a3('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x458fa8,_0xb8a3('0xe'),JSON[_0xb8a3('0xf')](_0x527fcc));if(_0x527fcc[_0xb8a3('0x10')]){if(_0x527fcc['error']['code']===0x1f4){logger[_0xb8a3('0x10')](_0xb8a3('0xc'),_0x458fa8,_0x527fcc[_0xb8a3('0x10')][_0xb8a3('0x11')]);return _0x1cd964(_0x527fcc['error']['message']);}logger['error'](_0xb8a3('0xc'),_0x458fa8,_0x527fcc[_0xb8a3('0x10')][_0xb8a3('0x11')]);return _0x49114f(_0x527fcc[_0xb8a3('0x10')]['message']);}else{logger[_0xb8a3('0xb')](_0xb8a3('0xc'),_0x458fa8,'request\x20sent');_0x49114f(_0x527fcc[_0xb8a3('0x12')][_0xb8a3('0x11')]);}})[_0xb8a3('0x13')](function(_0x4f5ed4){logger['error'](_0xb8a3('0xc'),_0x458fa8,_0x4f5ed4);_0x1cd964(_0x4f5ed4);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 8554f2d..111a59e 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 _0x7aa5=['INTEGER','sequelize','exports'];(function(_0x110a44,_0x3e37c8){var _0x5a4bb7=function(_0x5c98d7){while(--_0x5c98d7){_0x110a44['push'](_0x110a44['shift']());}};_0x5a4bb7(++_0x3e37c8);}(_0x7aa5,0x142));var _0x57aa=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x7aa5[_0x1fb1c1];return _0x1622df;};'use strict';var Sequelize=require(_0x57aa('0x0'));module[_0x57aa('0x1')]={'UserId':{'type':Sequelize[_0x57aa('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x57aa('0x2')]}}; \ No newline at end of file +var _0x66d3=['sequelize','exports','INTEGER'];(function(_0x39010b,_0x17e844){var _0x3d8797=function(_0x33924a){while(--_0x33924a){_0x39010b['push'](_0x39010b['shift']());}};_0x3d8797(++_0x17e844);}(_0x66d3,0x16e));var _0x366d=function(_0x4c54df,_0x26aca8){_0x4c54df=_0x4c54df-0x0;var _0x529081=_0x66d3[_0x4c54df];return _0x529081;};'use strict';var Sequelize=require(_0x366d('0x0'));module[_0x366d('0x1')]={'UserId':{'type':Sequelize[_0x366d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x366d('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index d9e8e5b..cbf18a2 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(_0x249d76,_0x1a6778){var _0x246d84=function(_0x5cf920){while(--_0x5cf920){_0x249d76['push'](_0x249d76['shift']());}};_0x246d84(++_0x1a6778);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x4c0bbe,_0x303991){var _0x1481b6=function(_0x20b0ee){while(--_0x20b0ee){_0x4c0bbe['push'](_0x4c0bbe['shift']());}};_0x1481b6(++_0x303991);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 42a9864..42550f9 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(_0x5b6879,_0x48199f){var _0x489bbd=function(_0x4dd899){while(--_0x4dd899){_0x5b6879['push'](_0x5b6879['shift']());}};_0x489bbd(++_0x48199f);}(_0x70e0,0x17b));var _0x070e=function(_0x1694fa,_0x58c4c7){_0x1694fa=_0x1694fa-0x0;var _0x110225=_0x70e0[_0x1694fa];return _0x110225;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2bf05c,_0x132f75){var _0x3164a8=function(_0x607992){while(--_0x607992){_0x2bf05c['push'](_0x2bf05c['shift']());}};_0x3164a8(++_0x132f75);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a4ff18d..fd50992 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 _0x8db9=['sequelize','exports','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8db9,0x1c2));var _0x98db=function(_0x2d9568,_0x520b1b){_0x2d9568=_0x2d9568-0x0;var _0x5edbd1=_0x8db9[_0x2d9568];return _0x5edbd1;};'use strict';var Sequelize=require(_0x98db('0x0'));module[_0x98db('0x1')]={'penalty':{'type':Sequelize[_0x98db('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe51f=['sequelize','exports','INTEGER'];(function(_0x42a070,_0x1077e7){var _0x4d2f87=function(_0x3fe9dc){while(--_0x3fe9dc){_0x42a070['push'](_0x42a070['shift']());}};_0x4d2f87(++_0x1077e7);}(_0xe51f,0x19b));var _0xfe51=function(_0x21bc0d,_0x3b726b){_0x21bc0d=_0x21bc0d-0x0;var _0x55f499=_0xe51f[_0x21bc0d];return _0x55f499;};'use strict';var Sequelize=require(_0xfe51('0x0'));module[_0xfe51('0x1')]={'penalty':{'type':Sequelize[_0xfe51('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 73aa9d1..dd6226e 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 _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x599b10,_0x125f2d){var _0xa6a5e6=function(_0x28a06e){while(--_0x28a06e){_0x599b10['push'](_0x599b10['shift']());}};_0xa6a5e6(++_0x125f2d);}(_0x6c76,0x184));var _0x66c7=function(_0x9bf11a,_0x36d433){_0x9bf11a=_0x9bf11a-0x0;var _0x26032d=_0x6c76[_0x9bf11a];return _0x26032d;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2bb=['request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2bb,0xff));var _0xbd2b=function(_0xab7f73,_0x4f9bad){_0xab7f73=_0xab7f73-0x0;var _0xca40f9=_0xd2bb[_0xab7f73];return _0xca40f9;};'use strict';var _=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var logger=require('../../config/logger')(_0xbd2b('0x2'));var moment=require(_0xbd2b('0x3'));var BPromise=require(_0xbd2b('0x4'));var rp=require(_0xbd2b('0x5'));var fs=require('fs');var path=require(_0xbd2b('0x6'));var rimraf=require(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xbd2b('0x9')]=function(_0x40a432,_0x204fa6){return _0x40a432[_0xbd2b('0xa')](_0xbd2b('0xb'),attributes,{'tableName':_0xbd2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 6fd1cd5..25b38de 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 _0x697b=['../../config/logger','rpc','../../config/environment','client','then','info','debug','request\x20sent','stringify','code','error','UserVoiceQueue,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20bedf,_0x44afe8){var _0x3750d7=function(_0x59f268){while(--_0x59f268){_0x20bedf['push'](_0x20bedf['shift']());}};_0x3750d7(++_0x44afe8);}(_0x697b,0x1d9));var _0xb697=function(_0x2499cf,_0x196780){_0x2499cf=_0x2499cf-0x0;var _0x3dc078=_0x697b[_0x2499cf];return _0x3dc078;};'use strict';var _=require(_0xb697('0x0'));var util=require(_0xb697('0x1'));var moment=require('moment');var BPromise=require(_0xb697('0x2'));var rs=require(_0xb697('0x3'));var fs=require('fs');var Redis=require(_0xb697('0x4'));var db=require(_0xb697('0x5'))['db'];var utils=require(_0xb697('0x6'));var logger=require(_0xb697('0x7'))(_0xb697('0x8'));var config=require(_0xb697('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb697('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390597,_0x6b1641,_0x28e114){return new BPromise(function(_0x189f19,_0x17723f){return client['request'](_0x390597,_0x28e114)[_0xb697('0xb')](function(_0x74bfc4){logger[_0xb697('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x6b1641,'request\x20sent');logger[_0xb697('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x6b1641,_0xb697('0xe'),JSON[_0xb697('0xf')](_0x74bfc4));if(_0x74bfc4['error']){if(_0x74bfc4['error'][_0xb697('0x10')]===0x1f4){logger[_0xb697('0x11')](_0xb697('0x12'),_0x6b1641,_0x74bfc4['error'][_0xb697('0x13')]);return _0x17723f(_0x74bfc4[_0xb697('0x11')][_0xb697('0x13')]);}logger[_0xb697('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x6b1641,_0x74bfc4[_0xb697('0x11')][_0xb697('0x13')]);return _0x189f19(_0x74bfc4[_0xb697('0x11')][_0xb697('0x13')]);}else{logger[_0xb697('0xc')](_0xb697('0x12'),_0x6b1641,_0xb697('0xe'));_0x189f19(_0x74bfc4['result'][_0xb697('0x13')]);}})['catch'](function(_0x1a2fac){logger[_0xb697('0x11')](_0xb697('0x12'),_0x6b1641,_0x1a2fac);_0x17723f(_0x1a2fac);});});} \ No newline at end of file +var _0xc73e=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xc1cf83,_0x4ef342){var _0x3a4453=function(_0x1540ff){while(--_0x1540ff){_0xc1cf83['push'](_0xc1cf83['shift']());}};_0x3a4453(++_0x4ef342);}(_0xc73e,0xd9));var _0xec73=function(_0x56e222,_0x2d5767){_0x56e222=_0x56e222-0x0;var _0x20808e=_0xc73e[_0x56e222];return _0x20808e;};'use strict';var _=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var moment=require(_0xec73('0x2'));var BPromise=require(_0xec73('0x3'));var rs=require(_0xec73('0x4'));var fs=require('fs');var Redis=require(_0xec73('0x5'));var db=require(_0xec73('0x6'))['db'];var utils=require(_0xec73('0x7'));var logger=require(_0xec73('0x8'))('rpc');var config=require(_0xec73('0x9'));var jayson=require(_0xec73('0xa'));var client=jayson[_0xec73('0xb')][_0xec73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x70717a,_0x31c00c,_0xc0f895){return new BPromise(function(_0x56634f,_0x1d5ccd){return client[_0xec73('0xd')](_0x70717a,_0xc0f895)[_0xec73('0xe')](function(_0x499893){logger[_0xec73('0xf')](_0xec73('0x10'),_0x31c00c,_0xec73('0x11'));logger['debug'](_0xec73('0x12'),_0x31c00c,_0xec73('0x11'),JSON[_0xec73('0x13')](_0x499893));if(_0x499893['error']){if(_0x499893[_0xec73('0x14')][_0xec73('0x15')]===0x1f4){logger[_0xec73('0x14')](_0xec73('0x10'),_0x31c00c,_0x499893[_0xec73('0x14')][_0xec73('0x16')]);return _0x1d5ccd(_0x499893[_0xec73('0x14')][_0xec73('0x16')]);}logger[_0xec73('0x14')](_0xec73('0x10'),_0x31c00c,_0x499893['error']['message']);return _0x56634f(_0x499893[_0xec73('0x14')][_0xec73('0x16')]);}else{logger[_0xec73('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x31c00c,_0xec73('0x11'));_0x56634f(_0x499893[_0xec73('0x17')]['message']);}})[_0xec73('0x18')](function(_0x2bc45e){logger[_0xec73('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x31c00c,_0x2bc45e);_0x1d5ccd(_0x2bc45e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 66ac067..d40fc53 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x120f00,_0x351169){var _0x405825=function(_0x43257c){while(--_0x43257c){_0x120f00['push'](_0x120f00['shift']());}};_0x405825(++_0x351169);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xcb91[_0x2d89ce];return _0x3fad10;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xc38aa1,_0x493518){var _0x22f7e0=function(_0x2bc841){while(--_0x2bc841){_0xc38aa1['push'](_0xc38aa1['shift']());}};_0x22f7e0(++_0x493518);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 45882f6..d88a061 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 _0x02cc=['INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x02cc,0xd4));var _0xc02c=function(_0x48c5e3,_0x31dbf0){_0x48c5e3=_0x48c5e3-0x0;var _0x9d9474=_0x02cc[_0x48c5e3];return _0x9d9474;};'use strict';var Sequelize=require(_0xc02c('0x0'));module[_0xc02c('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc02c('0x2')},'membername':{'type':Sequelize[_0xc02c('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc02c('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xc02c('0x2')},'VoiceQueueId':{'type':Sequelize[_0xc02c('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xc02c('0x3')],'allowNull':![],'unique':_0xc02c('0x5'),'comment':_0xc02c('0x2')},'penalty':{'type':Sequelize[_0xc02c('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xc02c('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xdc15=['Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER','STRING'];(function(_0x8b7ee6,_0x350758){var _0x385cd0=function(_0x41e5f2){while(--_0x41e5f2){_0x8b7ee6['push'](_0x8b7ee6['shift']());}};_0x385cd0(++_0x350758);}(_0xdc15,0xe0));var _0x5dc1=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xdc15[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0x5dc1('0x0'));module[_0x5dc1('0x1')]={'uniqueid':{'type':Sequelize[_0x5dc1('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x5dc1('0x3')],'allowNull':![],'comment':_0x5dc1('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5dc1('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x5dc1('0x4')},'VoiceQueueId':{'type':Sequelize[_0x5dc1('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5dc1('0x5'),'comment':_0x5dc1('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x5dc1('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9eb7c54..c4965e3 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 _0x0a6c=['UserVoiceQueueRt','setMaxListeners','update','emit','hook','../../mysqldb'];(function(_0x5a6744,_0x144876){var _0xff7177=function(_0x4b3e10){while(--_0x4b3e10){_0x5a6744['push'](_0x5a6744['shift']());}};_0xff7177(++_0x144876);}(_0x0a6c,0x14f));var _0xc0a6=function(_0x197db5,_0x1d30f1){_0x197db5=_0x197db5-0x0;var _0x2792e6=_0x0a6c[_0x197db5];return _0x2792e6;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xc0a6('0x0'))['db'][_0xc0a6('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc0a6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5695c3){return function(_0x468829,_0x1ed373,_0x21c0d1){UserVoiceQueueRtEvents[_0xc0a6('0x4')](_0x5695c3+':'+_0x468829['id'],_0x468829);UserVoiceQueueRtEvents['emit'](_0x5695c3,_0x468829);_0x21c0d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xc0a6('0x5')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xb05c=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x605236,_0x2ff0bb){var _0x432d3c=function(_0xbd621a){while(--_0xbd621a){_0x605236['push'](_0x605236['shift']());}};_0x432d3c(++_0x2ff0bb);}(_0xb05c,0x10e));var _0xcb05=function(_0x305701,_0xc02f37){_0x305701=_0x305701-0x0;var _0x3591ce=_0xb05c[_0x305701];return _0x3591ce;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xcb05('0x0'))['db'][_0xcb05('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xcb05('0x2')](0x0);var events={'afterCreate':_0xcb05('0x3'),'afterUpdate':_0xcb05('0x4'),'afterDestroy':_0xcb05('0x5')};function emitEvent(_0x5c851e){return function(_0x3db092,_0xfac33b,_0x5a066d){UserVoiceQueueRtEvents[_0xcb05('0x6')](_0x5c851e+':'+_0x3db092['id'],_0x3db092);UserVoiceQueueRtEvents[_0xcb05('0x6')](_0x5c851e,_0x3db092);_0x5a066d(null);};}for(var e in events){if(events[_0xcb05('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xcb05('0x8')](e,emitEvent(event));}}module[_0xcb05('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 fbab0c4..a1c0740 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 _0xa947=['rimraf','exports','define','UserVoiceQueueRt','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2cb064,_0x17d24b){var _0x19afe8=function(_0x2c0b8a){while(--_0x2c0b8a){_0x2cb064['push'](_0x2cb064['shift']());}};_0x19afe8(++_0x17d24b);}(_0xa947,0x16c));var _0x7a94=function(_0x22688a,_0x8bbddc){_0x22688a=_0x22688a-0x0;var _0x50c037=_0xa947[_0x22688a];return _0x50c037;};'use strict';var _=require(_0x7a94('0x0'));var util=require('util');var logger=require(_0x7a94('0x1'))(_0x7a94('0x2'));var moment=require(_0x7a94('0x3'));var BPromise=require(_0x7a94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a94('0x5'));var rimraf=require(_0x7a94('0x6'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x7a94('0x7')]=function(_0x18b8de,_0x2db8f0){return _0x18b8de[_0x7a94('0x8')](_0x7a94('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7b9=['moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','../../config/logger','api'];(function(_0x19a21b,_0x5beb89){var _0x4623d4=function(_0x5b5b49){while(--_0x5b5b49){_0x19a21b['push'](_0x19a21b['shift']());}};_0x4623d4(++_0x5beb89);}(_0xa7b9,0x75));var _0x9a7b=function(_0x5d6280,_0x3f72ab){_0x5d6280=_0x5d6280-0x0;var _0x77b738=_0xa7b9[_0x5d6280];return _0x77b738;};'use strict';var _=require(_0x9a7b('0x0'));var util=require('util');var logger=require(_0x9a7b('0x1'))(_0x9a7b('0x2'));var moment=require(_0x9a7b('0x3'));var BPromise=require(_0x9a7b('0x4'));var rp=require(_0x9a7b('0x5'));var fs=require('fs');var path=require(_0x9a7b('0x6'));var rimraf=require('rimraf');var config=require(_0x9a7b('0x7'));var attributes=require(_0x9a7b('0x8'));module[_0x9a7b('0x9')]=function(_0x5bccc0,_0x283ffd){return _0x5bccc0[_0x9a7b('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x9a7b('0xb'),'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 ffb61f4..484b5a2 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 _0x1a7e=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a7e,0x1da));var _0xe1a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe1a7('0x0'));var moment=require(_0xe1a7('0x1'));var BPromise=require(_0xe1a7('0x2'));var rs=require(_0xe1a7('0x3'));var fs=require('fs');var Redis=require(_0xe1a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1a7('0x5'));var logger=require(_0xe1a7('0x6'))(_0xe1a7('0x7'));var config=require(_0xe1a7('0x8'));var jayson=require(_0xe1a7('0x9'));var client=jayson[_0xe1a7('0xa')][_0xe1a7('0xb')]({'port':0x232a});config['redis']=_[_0xe1a7('0xc')](config['redis'],{'host':_0xe1a7('0xd'),'port':0x18eb});var socket=require(_0xe1a7('0xe'))(new Redis(config[_0xe1a7('0xf')]));require(_0xe1a7('0x10'))['register'](socket);function respondWithRpcPromise(_0x2efdd4,_0x12cd45,_0x4e6249){return new BPromise(function(_0x22392e,_0x1b6ec1){return client['request'](_0x2efdd4,_0x4e6249)['then'](function(_0x41deb3){logger[_0xe1a7('0x11')](_0xe1a7('0x12'),_0x12cd45,_0xe1a7('0x13'));logger[_0xe1a7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x12cd45,_0xe1a7('0x13'),JSON[_0xe1a7('0x15')](_0x41deb3));if(_0x41deb3[_0xe1a7('0x16')]){if(_0x41deb3[_0xe1a7('0x16')][_0xe1a7('0x17')]===0x1f4){logger['error'](_0xe1a7('0x12'),_0x12cd45,_0x41deb3[_0xe1a7('0x16')]['message']);return _0x1b6ec1(_0x41deb3[_0xe1a7('0x16')][_0xe1a7('0x18')]);}logger[_0xe1a7('0x16')](_0xe1a7('0x12'),_0x12cd45,_0x41deb3[_0xe1a7('0x16')]['message']);return _0x22392e(_0x41deb3[_0xe1a7('0x16')][_0xe1a7('0x18')]);}else{logger[_0xe1a7('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x12cd45,_0xe1a7('0x13'));_0x22392e(_0x41deb3['result'][_0xe1a7('0x18')]);}})[_0xe1a7('0x19')](function(_0xdd7e77){logger[_0xe1a7('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x12cd45,_0xdd7e77);_0x1b6ec1(_0xdd7e77);});});}exports[_0xe1a7('0x1a')]=function(_0x44355a){var _0x249389=this;return new Promise(function(_0x516e1a,_0x47abb8){return db[_0xe1a7('0x1b')][_0xe1a7('0x1c')]({'raw':_0x44355a[_0xe1a7('0x1d')]?_0x44355a[_0xe1a7('0x1d')][_0xe1a7('0x1e')]===undefined?!![]:![]:!![],'where':_0x44355a[_0xe1a7('0x1d')]?_0x44355a[_0xe1a7('0x1d')][_0xe1a7('0x1f')]||null:null,'attributes':[[db[_0xe1a7('0x20')]['fn']('COUNT',db[_0xe1a7('0x20')]['fn']('IF',db[_0xe1a7('0x20')][_0xe1a7('0x21')](_0xe1a7('0x22')))),_0xe1a7('0x23')]]})[_0xe1a7('0x24')](function(_0x4c3fcd){logger['info']('GetVoiceQueueRtPauses',_0x44355a);logger[_0xe1a7('0x14')]('GetVoiceQueueRtPauses',_0x44355a,JSON[_0xe1a7('0x15')](_0x4c3fcd));_0x516e1a(_0x4c3fcd);})[_0xe1a7('0x19')](function(_0x50f79a){logger[_0xe1a7('0x16')]('GetVoiceQueueRtPauses',_0x50f79a[_0xe1a7('0x18')],_0x44355a);_0x47abb8(_0x249389[_0xe1a7('0x16')](0x1f4,_0x50f79a['message']));});});}; \ No newline at end of file +var _0xaa81=['client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UserVoiceQueueRt,\x20%s,\x20%s','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa81,0x64));var _0x1aa8=function(_0x32e6d8,_0x22d733){_0x32e6d8=_0x32e6d8-0x0;var _0x2c8dc3=_0xaa81[_0x32e6d8];return _0x2c8dc3;};'use strict';var _=require(_0x1aa8('0x0'));var util=require(_0x1aa8('0x1'));var moment=require(_0x1aa8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1aa8('0x3'));var fs=require('fs');var Redis=require(_0x1aa8('0x4'));var db=require(_0x1aa8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1aa8('0x6'))('rpc');var config=require(_0x1aa8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1aa8('0x8')]['http']({'port':0x232a});config[_0x1aa8('0x9')]=_[_0x1aa8('0xa')](config[_0x1aa8('0x9')],{'host':_0x1aa8('0xb'),'port':0x18eb});var socket=require(_0x1aa8('0xc'))(new Redis(config[_0x1aa8('0x9')]));require(_0x1aa8('0xd'))['register'](socket);function respondWithRpcPromise(_0x5a5b77,_0x1978ec,_0x1a9150){return new BPromise(function(_0x2e310d,_0x945ffa){return client[_0x1aa8('0xe')](_0x5a5b77,_0x1a9150)[_0x1aa8('0xf')](function(_0x522329){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1978ec,_0x1aa8('0x10'));logger[_0x1aa8('0x11')](_0x1aa8('0x12'),_0x1978ec,_0x1aa8('0x10'),JSON[_0x1aa8('0x13')](_0x522329));if(_0x522329['error']){if(_0x522329['error'][_0x1aa8('0x14')]===0x1f4){logger[_0x1aa8('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1978ec,_0x522329[_0x1aa8('0x15')][_0x1aa8('0x16')]);return _0x945ffa(_0x522329['error'][_0x1aa8('0x16')]);}logger[_0x1aa8('0x15')](_0x1aa8('0x17'),_0x1978ec,_0x522329[_0x1aa8('0x15')][_0x1aa8('0x16')]);return _0x2e310d(_0x522329[_0x1aa8('0x15')][_0x1aa8('0x16')]);}else{logger[_0x1aa8('0x18')](_0x1aa8('0x17'),_0x1978ec,'request\x20sent');_0x2e310d(_0x522329['result']['message']);}})[_0x1aa8('0x19')](function(_0x3562ff){logger[_0x1aa8('0x15')](_0x1aa8('0x17'),_0x1978ec,_0x3562ff);_0x945ffa(_0x3562ff);});});}exports[_0x1aa8('0x1a')]=function(_0xa58f88){var _0x5391cf=this;return new Promise(function(_0x20152c,_0x5b68e5){return db[_0x1aa8('0x1b')][_0x1aa8('0x1c')]({'raw':_0xa58f88['options']?_0xa58f88[_0x1aa8('0x1d')][_0x1aa8('0x1e')]===undefined?!![]:![]:!![],'where':_0xa58f88[_0x1aa8('0x1d')]?_0xa58f88[_0x1aa8('0x1d')][_0x1aa8('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1aa8('0x20'),db['sequelize']['fn']('IF',db[_0x1aa8('0x21')][_0x1aa8('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x1aa8('0x23')]]})[_0x1aa8('0xf')](function(_0x22c9a5){logger[_0x1aa8('0x18')](_0x1aa8('0x1a'),_0xa58f88);logger[_0x1aa8('0x11')]('GetVoiceQueueRtPauses',_0xa58f88,JSON[_0x1aa8('0x13')](_0x22c9a5));_0x20152c(_0x22c9a5);})['catch'](function(_0x41d0fb){logger['error'](_0x1aa8('0x1a'),_0x41d0fb[_0x1aa8('0x16')],_0xa58f88);_0x5b68e5(_0x5391cf[_0x1aa8('0x15')](0x1f4,_0x41d0fb[_0x1aa8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4de1b08..25317a4 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 _0x75a2=['length','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x217ac6,_0x2582a6){var _0x45bf78=function(_0x39c892){while(--_0x39c892){_0x217ac6['push'](_0x217ac6['shift']());}};_0x45bf78(++_0x2582a6);}(_0x75a2,0x187));var _0x275a=function(_0x3967ac,_0x876a01){_0x3967ac=_0x3967ac-0x0;var _0x25746b=_0x75a2[_0x3967ac];return _0x25746b;};'use strict';var UserVoiceQueueRtEvents=require(_0x275a('0x0'));var events=[_0x275a('0x1'),_0x275a('0x2'),'update'];function createListener(_0x2221c5,_0x116ea8){return function(_0x339ace){_0x116ea8[_0x275a('0x3')](_0x2221c5,_0x339ace);};}function removeListener(_0x5019d2,_0x251db9){return function(){UserVoiceQueueRtEvents['removeListener'](_0x5019d2,_0x251db9);};}exports['register']=function(_0x4ab56d){for(var _0x5ecd7b=0x0,_0x32f0cb=events[_0x275a('0x4')];_0x5ecd7b<_0x32f0cb;_0x5ecd7b++){var _0x17ad5e=events[_0x5ecd7b];var _0x38b303=createListener('userVoiceQueueRt:'+_0x17ad5e,_0x4ab56d);UserVoiceQueueRtEvents['on'](_0x17ad5e,_0x38b303);}}; \ No newline at end of file +var _0x2f2e=['emit','length','save','remove'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2f2e,0x146));var _0xe2f2=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x2f2e[_0x51fe5f];return _0x4abce9;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('userVoiceQueueRt:'+_0xc44c89,_0x5b202f);UserVoiceQueueRtEvents['on'](_0xc44c89,_0x48111c);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 0561241..adf9220 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x16b13d,_0x2faf09){var _0x1f1e77=function(_0x2c4d2a){while(--_0x2c4d2a){_0x16b13d['push'](_0x16b13d['shift']());}};_0x1f1e77(++_0x2faf09);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x31794d,_0x508a2a){var _0x52fdaf=function(_0xfbb3f2){while(--_0xfbb3f2){_0x31794d['push'](_0x31794d['shift']());}};_0x52fdaf(++_0x508a2a);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index db51ea9..8531dd9 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 _0xeecc=['exports','sequelize'];(function(_0x19d22f,_0x22dc1d){var _0x2d2d8d=function(_0x612175){while(--_0x612175){_0x19d22f['push'](_0x19d22f['shift']());}};_0x2d2d8d(++_0x22dc1d);}(_0xeecc,0x121));var _0xceec=function(_0x5b5dc8,_0x5d34a8){_0x5b5dc8=_0x5b5dc8-0x0;var _0x47a2a4=_0xeecc[_0x5b5dc8];return _0x47a2a4;};'use strict';var Sequelize=require(_0xceec('0x0'));module[_0xceec('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2f37=['exports','INTEGER'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x2f37,0xa0));var _0x72f3=function(_0x398d71,_0x26478f){_0x398d71=_0x398d71-0x0;var _0x19caba=_0x2f37[_0x398d71];return _0x19caba;};'use strict';var Sequelize=require('sequelize');module[_0x72f3('0x0')]={'penalty':{'type':Sequelize[_0x72f3('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index a2cc732..3c8e4de 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 _0x445d=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x30a0f8,_0x2e17b8){var _0x4ae72c=function(_0x421f39){while(--_0x421f39){_0x30a0f8['push'](_0x30a0f8['shift']());}};_0x4ae72c(++_0x2e17b8);}(_0x445d,0x138));var _0xd445=function(_0x3b9eda,_0x1ef917){_0x3b9eda=_0x3b9eda-0x0;var _0xd935c4=_0x445d[_0x3b9eda];return _0xd935c4;};'use strict';var _=require(_0xd445('0x0'));var util=require(_0xd445('0x1'));var logger=require(_0xd445('0x2'))(_0xd445('0x3'));var moment=require(_0xd445('0x4'));var BPromise=require('bluebird');var rp=require(_0xd445('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd445('0x6'));var config=require(_0xd445('0x7'));var attributes=require(_0xd445('0x8'));module[_0xd445('0x9')]=function(_0x20cc0d,_0x5b7132){return _0x20cc0d['define'](_0xd445('0xa'),attributes,{'tableName':_0xd445('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc7=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','../../config/logger','api','request-promise','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5cc7,0x150));var _0x75cc=function(_0x26c888,_0x1abead){_0x26c888=_0x26c888-0x0;var _0x44576b=_0x5cc7[_0x26c888];return _0x44576b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x75cc('0x0'))(_0x75cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x75cc('0x2'));var fs=require('fs');var path=require(_0x75cc('0x3'));var rimraf=require(_0x75cc('0x4'));var config=require(_0x75cc('0x5'));var attributes=require(_0x75cc('0x6'));module[_0x75cc('0x7')]=function(_0xa08f3f,_0x1eaa90){return _0xa08f3f[_0x75cc('0x8')](_0x75cc('0x9'),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 1ff0454..f205c13 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 _0xf283=['http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x49abe0,_0x4c2a8b){var _0xebc3a8=function(_0x53f824){while(--_0x53f824){_0x49abe0['push'](_0x49abe0['shift']());}};_0xebc3a8(++_0x4c2a8b);}(_0xf283,0x1c3));var _0x3f28=function(_0x34c14a,_0x4a8ff8){_0x34c14a=_0x34c14a-0x0;var _0xeb5c81=_0xf283[_0x34c14a];return _0xeb5c81;};'use strict';var _=require(_0x3f28('0x0'));var util=require(_0x3f28('0x1'));var moment=require(_0x3f28('0x2'));var BPromise=require(_0x3f28('0x3'));var rs=require(_0x3f28('0x4'));var fs=require('fs');var Redis=require(_0x3f28('0x5'));var db=require(_0x3f28('0x6'))['db'];var utils=require(_0x3f28('0x7'));var logger=require('../../config/logger')(_0x3f28('0x8'));var config=require(_0x3f28('0x9'));var jayson=require(_0x3f28('0xa'));var client=jayson['client'][_0x3f28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb4d0,_0x347fbd,_0xea826e){return new BPromise(function(_0x55295c,_0xa0fd51){return client['request'](_0x3bb4d0,_0xea826e)[_0x3f28('0xc')](function(_0xc93946){logger[_0x3f28('0xd')](_0x3f28('0xe'),_0x347fbd,_0x3f28('0xf'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x347fbd,'request\x20sent',JSON[_0x3f28('0x10')](_0xc93946));if(_0xc93946[_0x3f28('0x11')]){if(_0xc93946[_0x3f28('0x11')][_0x3f28('0x12')]===0x1f4){logger[_0x3f28('0x11')](_0x3f28('0xe'),_0x347fbd,_0xc93946[_0x3f28('0x11')][_0x3f28('0x13')]);return _0xa0fd51(_0xc93946[_0x3f28('0x11')][_0x3f28('0x13')]);}logger[_0x3f28('0x11')](_0x3f28('0xe'),_0x347fbd,_0xc93946[_0x3f28('0x11')]['message']);return _0x55295c(_0xc93946[_0x3f28('0x11')][_0x3f28('0x13')]);}else{logger[_0x3f28('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x347fbd,_0x3f28('0xf'));_0x55295c(_0xc93946[_0x3f28('0x14')][_0x3f28('0x13')]);}})[_0x3f28('0x15')](function(_0x2bac23){logger[_0x3f28('0x11')](_0x3f28('0xe'),_0x347fbd,_0x2bac23);_0xa0fd51(_0x2bac23);});});} \ No newline at end of file +var _0xaeb5=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0xce3741,_0x23c97e){var _0x23158e=function(_0x361fe5){while(--_0x361fe5){_0xce3741['push'](_0xce3741['shift']());}};_0x23158e(++_0x23c97e);}(_0xaeb5,0xd3));var _0x5aeb=function(_0x26cd65,_0x3e6b6f){_0x26cd65=_0x26cd65-0x0;var _0x51c930=_0xaeb5[_0x26cd65];return _0x51c930;};'use strict';var _=require(_0x5aeb('0x0'));var util=require(_0x5aeb('0x1'));var moment=require('moment');var BPromise=require(_0x5aeb('0x2'));var rs=require(_0x5aeb('0x3'));var fs=require('fs');var Redis=require(_0x5aeb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5aeb('0x5'));var logger=require(_0x5aeb('0x6'))(_0x5aeb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5aeb('0x8')][_0x5aeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64efc7,_0x35816e,_0x1c61b1){return new BPromise(function(_0x2c000c,_0x3d7117){return client[_0x5aeb('0xa')](_0x64efc7,_0x1c61b1)[_0x5aeb('0xb')](function(_0x2b4631){logger[_0x5aeb('0xc')](_0x5aeb('0xd'),_0x35816e,'request\x20sent');logger[_0x5aeb('0xe')](_0x5aeb('0xf'),_0x35816e,_0x5aeb('0x10'),JSON['stringify'](_0x2b4631));if(_0x2b4631['error']){if(_0x2b4631[_0x5aeb('0x11')][_0x5aeb('0x12')]===0x1f4){logger[_0x5aeb('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x35816e,_0x2b4631['error'][_0x5aeb('0x13')]);return _0x3d7117(_0x2b4631['error'][_0x5aeb('0x13')]);}logger[_0x5aeb('0x11')](_0x5aeb('0xd'),_0x35816e,_0x2b4631[_0x5aeb('0x11')][_0x5aeb('0x13')]);return _0x2c000c(_0x2b4631[_0x5aeb('0x11')]['message']);}else{logger[_0x5aeb('0xc')](_0x5aeb('0xd'),_0x35816e,_0x5aeb('0x10'));_0x2c000c(_0x2b4631[_0x5aeb('0x14')][_0x5aeb('0x13')]);}})['catch'](function(_0x11e0c0){logger[_0x5aeb('0x11')](_0x5aeb('0xd'),_0x35816e,_0x11e0c0);_0x3d7117(_0x11e0c0);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 90dff5a..6e2d5d9 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 _0xc02d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b8ce9,_0x157372){var _0x3ed19e=function(_0xe002e){while(--_0xe002e){_0x2b8ce9['push'](_0x2b8ce9['shift']());}};_0x3ed19e(++_0x157372);}(_0xc02d,0x1aa));var _0xdc02=function(_0x5345e0,_0x1c93a4){_0x5345e0=_0x5345e0-0x0;var _0x35e35b=_0xc02d[_0x5345e0];return _0x35e35b;};'use strict';var multer=require('multer');var util=require(_0xdc02('0x0'));var path=require(_0xdc02('0x1'));var timeout=require(_0xdc02('0x2'));var express=require(_0xdc02('0x3'));var router=express[_0xdc02('0x4')]();var fs_extra=require(_0xdc02('0x5'));var auth=require(_0xdc02('0x6'));var interaction=require(_0xdc02('0x7'));var config=require(_0xdc02('0x8'));var controller=require(_0xdc02('0x9'));router[_0xdc02('0xa')]('/',auth['isAuthenticated'](),controller[_0xdc02('0xb')]);router[_0xdc02('0xa')](_0xdc02('0xc'),auth[_0xdc02('0xd')](),controller['show']);router['post']('/',auth[_0xdc02('0xd')](),controller[_0xdc02('0xe')]);router[_0xdc02('0xf')]('/:id',auth[_0xdc02('0xd')](),controller['update']);router[_0xdc02('0x10')](_0xdc02('0xc'),auth[_0xdc02('0xd')](),controller[_0xdc02('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2ce1=['post','put','update','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2ce1,0x8b));var _0x12ce=function(_0x331cb0,_0x14953d){_0x331cb0=_0x331cb0-0x0;var _0x5c4451=_0x2ce1[_0x331cb0];return _0x5c4451;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x12ce('0x0'));var express=require(_0x12ce('0x1'));var router=express[_0x12ce('0x2')]();var fs_extra=require(_0x12ce('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x12ce('0x4'));var config=require(_0x12ce('0x5'));var controller=require('./variable.controller');router[_0x12ce('0x6')]('/',auth[_0x12ce('0x7')](),controller[_0x12ce('0x8')]);router['get'](_0x12ce('0x9'),auth['isAuthenticated'](),controller[_0x12ce('0xa')]);router[_0x12ce('0xb')]('/',auth[_0x12ce('0x7')](),controller['create']);router[_0x12ce('0xc')](_0x12ce('0x9'),auth[_0x12ce('0x7')](),controller[_0x12ce('0xd')]);router['delete'](_0x12ce('0x9'),auth['isAuthenticated'](),controller[_0x12ce('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1909d6e..922d7cf 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 _0x615a=['exports','STRING','name'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x615a,0x8d));var _0xa615=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x615a[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require('sequelize');module[_0xa615('0x0')]={'name':{'type':Sequelize[_0xa615('0x1')],'unique':_0xa615('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa615('0x1')]}}; \ No newline at end of file +var _0xa04d=['exports','STRING'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa04d,0x118));var _0xda04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa04d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xda04('0x0')]={'name':{'type':Sequelize[_0xda04('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xda04('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4bab895..e2c2847 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 _0x7cb7=['type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','get','Variables','error','name','send','index','map','Variable','rawAttributes'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x7cb7,0x176));var _0x77cb=function(_0x2131f3,_0x4ee7e7){_0x2131f3=_0x2131f3-0x0;var _0x598737=_0x7cb7[_0x2131f3];return _0x598737;};'use strict';var emlformat=require(_0x77cb('0x0'));var rimraf=require(_0x77cb('0x1'));var zipdir=require(_0x77cb('0x2'));var jsonpatch=require(_0x77cb('0x3'));var rp=require(_0x77cb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x77cb('0x5'));var util=require(_0x77cb('0x6'));var path=require(_0x77cb('0x7'));var sox=require(_0x77cb('0x8'));var csv=require(_0x77cb('0x9'));var ejs=require(_0x77cb('0xa'));var fs=require('fs');var fs_extra=require(_0x77cb('0xb'));var _=require('lodash');var squel=require(_0x77cb('0xc'));var crypto=require(_0x77cb('0xd'));var jsforce=require(_0x77cb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x77cb('0xf'));var Papa=require(_0x77cb('0x10'));var Redis=require(_0x77cb('0x11'));var authService=require(_0x77cb('0x12'));var qs=require(_0x77cb('0x13'));var as=require(_0x77cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x77cb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x77cb('0x16'));var db=require(_0x77cb('0x17'))['db'];function respondWithStatusCode(_0x950b11,_0x38a1d5){_0x38a1d5=_0x38a1d5||0xcc;return function(_0x261a55){if(_0x261a55){return _0x950b11[_0x77cb('0x18')](_0x38a1d5);}return _0x950b11[_0x77cb('0x19')](_0x38a1d5)[_0x77cb('0x1a')]();};}function respondWithResult(_0x4db9db,_0x4a045f){_0x4a045f=_0x4a045f||0xc8;return function(_0x23adb1){if(_0x23adb1){return _0x4db9db[_0x77cb('0x19')](_0x4a045f)[_0x77cb('0x1b')](_0x23adb1);}};}function respondWithFilteredResult(_0x267583,_0x4ad5e7){return function(_0x275ae6){if(_0x275ae6){var _0x5740fc=typeof _0x4ad5e7['offset']===_0x77cb('0x1c')&&typeof _0x4ad5e7[_0x77cb('0x1d')]===_0x77cb('0x1c');var _0x47f8c9=_0x275ae6[_0x77cb('0x1e')];var _0x4f6d96=_0x5740fc?0x0:_0x4ad5e7[_0x77cb('0x1f')];var _0x9b24b4=_0x5740fc?_0x275ae6[_0x77cb('0x1e')]:_0x4ad5e7['offset']+_0x4ad5e7['limit'];var _0x4452aa;if(_0x9b24b4>=_0x47f8c9){_0x9b24b4=_0x47f8c9;_0x4452aa=0xc8;}else{_0x4452aa=0xce;}_0x267583['status'](_0x4452aa);return _0x267583[_0x77cb('0x20')]('Content-Range',_0x4f6d96+'-'+_0x9b24b4+'/'+_0x47f8c9)[_0x77cb('0x1b')](_0x275ae6);}return null;};}function patchUpdates(_0x2b0f03){return function(_0x30aab7){try{jsonpatch['apply'](_0x30aab7,_0x2b0f03,!![]);}catch(_0x3df385){return BPromise[_0x77cb('0x21')](_0x3df385);}return _0x30aab7[_0x77cb('0x22')]();};}function saveUpdates(_0x2ed6d7,_0x5595b8){return function(_0xd7ec74){if(_0xd7ec74){return _0xd7ec74[_0x77cb('0x23')](_0x2ed6d7)['then'](function(_0x10dc6a){return _0x10dc6a;});}return null;};}function removeEntity(_0x5d60ca,_0x46215c){return function(_0x10c4c0){if(_0x10c4c0){return _0x10c4c0['destroy']()[_0x77cb('0x24')](function(){var _0x92fe1=_0x10c4c0[_0x77cb('0x25')]({'plain':!![]});var _0x11a90c=_0x77cb('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x11a90c,'resourceId':_0x92fe1['id']}})[_0x77cb('0x24')](function(){return _0x10c4c0;});})[_0x77cb('0x24')](function(){_0x5d60ca[_0x77cb('0x19')](0xcc)[_0x77cb('0x1a')]();});}};}function handleEntityNotFound(_0x486715,_0x5dae2b){return function(_0x1b895b){if(!_0x1b895b){_0x486715[_0x77cb('0x18')](0x194);}return _0x1b895b;};}function handleError(_0x5e7136,_0x46dc04){_0x46dc04=_0x46dc04||0x1f4;return function(_0x256fb6){logger[_0x77cb('0x27')](_0x256fb6['stack']);if(_0x256fb6[_0x77cb('0x28')]){delete _0x256fb6[_0x77cb('0x28')];}_0x5e7136[_0x77cb('0x19')](_0x46dc04)[_0x77cb('0x29')](_0x256fb6);};}exports[_0x77cb('0x2a')]=function(_0x5ba804,_0x1c0977){var _0x3b1f84={},_0x45f5d3={},_0x5a964e={'count':0x0,'rows':[]};var _0x1d89f4=_[_0x77cb('0x2b')](db[_0x77cb('0x2c')][_0x77cb('0x2d')],function(_0x52c68b){return{'name':_0x52c68b['fieldName'],'type':_0x52c68b[_0x77cb('0x2e')]['key']};});_0x45f5d3[_0x77cb('0x2f')]=_[_0x77cb('0x2b')](_0x1d89f4,'name');_0x45f5d3[_0x77cb('0x30')]=_['keys'](_0x5ba804['query']);_0x45f5d3[_0x77cb('0x31')]=_[_0x77cb('0x32')](_0x45f5d3[_0x77cb('0x2f')],_0x45f5d3[_0x77cb('0x30')]);_0x3b1f84['attributes']=_[_0x77cb('0x32')](_0x45f5d3['model'],qs['fields'](_0x5ba804[_0x77cb('0x30')][_0x77cb('0x33')]));_0x3b1f84[_0x77cb('0x34')]=_0x3b1f84['attributes']['length']?_0x3b1f84[_0x77cb('0x34')]:_0x45f5d3[_0x77cb('0x2f')];if(!_0x5ba804[_0x77cb('0x30')][_0x77cb('0x35')](_0x77cb('0x36'))){_0x3b1f84[_0x77cb('0x1d')]=qs[_0x77cb('0x1d')](_0x5ba804['query'][_0x77cb('0x1d')]);_0x3b1f84[_0x77cb('0x1f')]=qs[_0x77cb('0x1f')](_0x5ba804[_0x77cb('0x30')][_0x77cb('0x1f')]);}_0x3b1f84[_0x77cb('0x37')]=qs[_0x77cb('0x38')](_0x5ba804['query']['sort']);_0x3b1f84[_0x77cb('0x39')]=qs[_0x77cb('0x31')](_[_0x77cb('0x3a')](_0x5ba804['query'],_0x45f5d3['filters']),_0x1d89f4);if(_0x5ba804[_0x77cb('0x30')][_0x77cb('0x3b')]){_0x3b1f84['where']=_[_0x77cb('0x3c')](_0x3b1f84[_0x77cb('0x39')],{'$or':_[_0x77cb('0x2b')](_0x1d89f4,function(_0x24ad8d){if(_0x24ad8d['type']!==_0x77cb('0x3d')){var _0x8a24c4={};_0x8a24c4[_0x24ad8d[_0x77cb('0x28')]]={'$like':'%'+_0x5ba804['query'][_0x77cb('0x3b')]+'%'};return _0x8a24c4;}})});}_0x3b1f84=_[_0x77cb('0x3c')]({},_0x3b1f84,_0x5ba804[_0x77cb('0x3e')]);var _0x59bd34={'where':_0x3b1f84[_0x77cb('0x39')]};return db[_0x77cb('0x2c')][_0x77cb('0x1e')](_0x59bd34)[_0x77cb('0x24')](function(_0x4bfcc3){_0x5a964e['count']=_0x4bfcc3;if(_0x5ba804['query'][_0x77cb('0x3f')]){_0x3b1f84['include']=[{'all':!![]}];}return db[_0x77cb('0x2c')][_0x77cb('0x40')](_0x3b1f84);})[_0x77cb('0x24')](function(_0x2e5b37){_0x5a964e[_0x77cb('0x41')]=_0x2e5b37;return _0x5a964e;})[_0x77cb('0x24')](respondWithFilteredResult(_0x1c0977,_0x3b1f84))[_0x77cb('0x42')](handleError(_0x1c0977,null));};exports[_0x77cb('0x43')]=function(_0x202f17,_0x331e38){var _0x5996b4={'raw':!![],'where':{'id':_0x202f17['params']['id']}},_0x83b4fb={};_0x83b4fb['model']=_[_0x77cb('0x44')](db[_0x77cb('0x2c')][_0x77cb('0x2d')]);_0x83b4fb[_0x77cb('0x30')]=_[_0x77cb('0x44')](_0x202f17[_0x77cb('0x30')]);_0x83b4fb['filters']=_['intersection'](_0x83b4fb[_0x77cb('0x2f')],_0x83b4fb[_0x77cb('0x30')]);_0x5996b4[_0x77cb('0x34')]=_[_0x77cb('0x32')](_0x83b4fb[_0x77cb('0x2f')],qs[_0x77cb('0x33')](_0x202f17[_0x77cb('0x30')][_0x77cb('0x33')]));_0x5996b4[_0x77cb('0x34')]=_0x5996b4[_0x77cb('0x34')][_0x77cb('0x45')]?_0x5996b4[_0x77cb('0x34')]:_0x83b4fb[_0x77cb('0x2f')];if(_0x202f17[_0x77cb('0x30')][_0x77cb('0x3f')]){_0x5996b4[_0x77cb('0x46')]=[{'all':!![]}];}_0x5996b4=_[_0x77cb('0x3c')]({},_0x5996b4,_0x202f17[_0x77cb('0x3e')]);return db['Variable'][_0x77cb('0x47')](_0x5996b4)[_0x77cb('0x24')](handleEntityNotFound(_0x331e38,null))['then'](respondWithResult(_0x331e38,null))[_0x77cb('0x42')](handleError(_0x331e38,null));};exports[_0x77cb('0x48')]=function(_0x2257ae,_0x5a7984){return db['Variable'][_0x77cb('0x48')](_0x2257ae['body'],{})['then'](function(_0x316c3f){var _0x2e3336=_0x2257ae[_0x77cb('0x49')][_0x77cb('0x25')]({'plain':!![]});if(!_0x2e3336)throw new Error(_0x77cb('0x4a'));if(_0x2e3336[_0x77cb('0x4b')]==='user'){var _0x4a72ed=_0x316c3f[_0x77cb('0x25')]({'plain':!![]});var _0xceca7a='Variables';return db[_0x77cb('0x4c')][_0x77cb('0x47')]({'where':{'name':_0xceca7a,'userProfileId':_0x2e3336[_0x77cb('0x4d')]},'raw':!![]})['then'](function(_0x582d0f){if(_0x582d0f&&_0x582d0f[_0x77cb('0x4e')]===0x0){return db[_0x77cb('0x4f')][_0x77cb('0x48')]({'name':_0x4a72ed[_0x77cb('0x28')],'resourceId':_0x4a72ed['id'],'type':_0x582d0f[_0x77cb('0x28')],'sectionId':_0x582d0f['id']},{})['then'](function(){return _0x316c3f;});}else{return _0x316c3f;}})[_0x77cb('0x42')](function(_0x56ca18){logger[_0x77cb('0x27')](_0x77cb('0x50'),_0x56ca18);throw _0x56ca18;});}return _0x316c3f;})[_0x77cb('0x24')](respondWithResult(_0x5a7984,0xc9))[_0x77cb('0x42')](handleError(_0x5a7984,null));};exports[_0x77cb('0x23')]=function(_0x3d272d,_0x46679a){if(_0x3d272d[_0x77cb('0x51')]['id']){delete _0x3d272d['body']['id'];}return db['Variable'][_0x77cb('0x47')]({'where':{'id':_0x3d272d[_0x77cb('0x52')]['id']}})[_0x77cb('0x24')](handleEntityNotFound(_0x46679a,null))[_0x77cb('0x24')](saveUpdates(_0x3d272d[_0x77cb('0x51')],null))['then'](respondWithResult(_0x46679a,null))[_0x77cb('0x42')](handleError(_0x46679a,null));};exports[_0x77cb('0x53')]=function(_0x2f2b66,_0x4a0a4e){return db['Variable']['find']({'where':{'id':_0x2f2b66[_0x77cb('0x52')]['id']}})[_0x77cb('0x24')](handleEntityNotFound(_0x4a0a4e,null))[_0x77cb('0x24')](removeEntity(_0x4a0a4e,null))['catch'](handleError(_0x4a0a4e,null));}; \ No newline at end of file +var _0x06fc=['status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','include','Variable','rows','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x06fc,0x89));var _0xc06f=function(_0x1675f9,_0x2e30e7){_0x1675f9=_0x1675f9-0x0;var _0x507cee=_0x06fc[_0x1675f9];return _0x507cee;};'use strict';var emlformat=require(_0xc06f('0x0'));var rimraf=require(_0xc06f('0x1'));var zipdir=require(_0xc06f('0x2'));var jsonpatch=require(_0xc06f('0x3'));var rp=require(_0xc06f('0x4'));var moment=require(_0xc06f('0x5'));var BPromise=require(_0xc06f('0x6'));var Mustache=require(_0xc06f('0x7'));var util=require('util');var path=require(_0xc06f('0x8'));var sox=require(_0xc06f('0x9'));var csv=require(_0xc06f('0xa'));var ejs=require(_0xc06f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc06f('0xc'));var crypto=require(_0xc06f('0xd'));var jsforce=require(_0xc06f('0xe'));var deskjs=require(_0xc06f('0xf'));var toCsv=require(_0xc06f('0xa'));var querystring=require(_0xc06f('0x10'));var Papa=require(_0xc06f('0x11'));var Redis=require(_0xc06f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc06f('0x13'));var as=require(_0xc06f('0x14'));var hardwareService=require(_0xc06f('0x15'));var logger=require(_0xc06f('0x16'))(_0xc06f('0x17'));var utils=require(_0xc06f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc06f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x597d3f,_0x462e5b){_0x462e5b=_0x462e5b||0xcc;return function(_0x23b0b7){if(_0x23b0b7){return _0x597d3f[_0xc06f('0x1a')](_0x462e5b);}return _0x597d3f[_0xc06f('0x1b')](_0x462e5b)[_0xc06f('0x1c')]();};}function respondWithResult(_0xd5b4d1,_0x46da23){_0x46da23=_0x46da23||0xc8;return function(_0x578512){if(_0x578512){return _0xd5b4d1['status'](_0x46da23)['json'](_0x578512);}};}function respondWithFilteredResult(_0x3e35af,_0x5c8af1){return function(_0x144be5){if(_0x144be5){var _0x254ff5=typeof _0x5c8af1[_0xc06f('0x1d')]===_0xc06f('0x1e')&&typeof _0x5c8af1[_0xc06f('0x1f')]==='undefined';var _0x2e73e6=_0x144be5['count'];var _0x4d41eb=_0x254ff5?0x0:_0x5c8af1[_0xc06f('0x1d')];var _0x528756=_0x254ff5?_0x144be5[_0xc06f('0x20')]:_0x5c8af1[_0xc06f('0x1d')]+_0x5c8af1['limit'];var _0x130742;if(_0x528756>=_0x2e73e6){_0x528756=_0x2e73e6;_0x130742=0xc8;}else{_0x130742=0xce;}_0x3e35af['status'](_0x130742);return _0x3e35af[_0xc06f('0x21')]('Content-Range',_0x4d41eb+'-'+_0x528756+'/'+_0x2e73e6)[_0xc06f('0x22')](_0x144be5);}return null;};}function patchUpdates(_0x3c9ac9){return function(_0x454f1c){try{jsonpatch[_0xc06f('0x23')](_0x454f1c,_0x3c9ac9,!![]);}catch(_0x47dfed){return BPromise[_0xc06f('0x24')](_0x47dfed);}return _0x454f1c[_0xc06f('0x25')]();};}function saveUpdates(_0x25ec6,_0x275df6){return function(_0x4d39eb){if(_0x4d39eb){return _0x4d39eb[_0xc06f('0x26')](_0x25ec6)[_0xc06f('0x27')](function(_0x1dbff6){return _0x1dbff6;});}return null;};}function removeEntity(_0x1d7f59,_0x2e575b){return function(_0x177c21){if(_0x177c21){return _0x177c21['destroy']()[_0xc06f('0x27')](function(){var _0x377d66=_0x177c21[_0xc06f('0x28')]({'plain':!![]});var _0x4334a9='Variables';return db[_0xc06f('0x29')]['destroy']({'where':{'type':_0x4334a9,'resourceId':_0x377d66['id']}})[_0xc06f('0x27')](function(){return _0x177c21;});})['then'](function(){_0x1d7f59[_0xc06f('0x1b')](0xcc)[_0xc06f('0x1c')]();});}};}function handleEntityNotFound(_0x4e4aab,_0x4c5ae7){return function(_0x454c0c){if(!_0x454c0c){_0x4e4aab[_0xc06f('0x1a')](0x194);}return _0x454c0c;};}function handleError(_0x3948d5,_0xf96fa0){_0xf96fa0=_0xf96fa0||0x1f4;return function(_0x4a694e){logger[_0xc06f('0x2a')](_0x4a694e[_0xc06f('0x2b')]);if(_0x4a694e[_0xc06f('0x2c')]){delete _0x4a694e['name'];}_0x3948d5['status'](_0xf96fa0)[_0xc06f('0x2d')](_0x4a694e);};}exports[_0xc06f('0x2e')]=function(_0x27e134,_0x35a8d1){var _0x2ec8d7={},_0x30492a={},_0x3f5598={'count':0x0,'rows':[]};var _0x21aa07=_['map'](db['Variable'][_0xc06f('0x2f')],function(_0xa8a1bf){return{'name':_0xa8a1bf[_0xc06f('0x30')],'type':_0xa8a1bf['type']['key']};});_0x30492a['model']=_['map'](_0x21aa07,_0xc06f('0x2c'));_0x30492a['query']=_['keys'](_0x27e134['query']);_0x30492a[_0xc06f('0x31')]=_[_0xc06f('0x32')](_0x30492a[_0xc06f('0x33')],_0x30492a[_0xc06f('0x34')]);_0x2ec8d7[_0xc06f('0x35')]=_[_0xc06f('0x32')](_0x30492a[_0xc06f('0x33')],qs[_0xc06f('0x36')](_0x27e134['query'][_0xc06f('0x36')]));_0x2ec8d7[_0xc06f('0x35')]=_0x2ec8d7[_0xc06f('0x35')][_0xc06f('0x37')]?_0x2ec8d7['attributes']:_0x30492a[_0xc06f('0x33')];if(!_0x27e134[_0xc06f('0x34')][_0xc06f('0x38')]('nolimit')){_0x2ec8d7[_0xc06f('0x1f')]=qs[_0xc06f('0x1f')](_0x27e134[_0xc06f('0x34')][_0xc06f('0x1f')]);_0x2ec8d7[_0xc06f('0x1d')]=qs['offset'](_0x27e134[_0xc06f('0x34')][_0xc06f('0x1d')]);}_0x2ec8d7['order']=qs[_0xc06f('0x39')](_0x27e134[_0xc06f('0x34')][_0xc06f('0x39')]);_0x2ec8d7[_0xc06f('0x3a')]=qs[_0xc06f('0x31')](_[_0xc06f('0x3b')](_0x27e134['query'],_0x30492a[_0xc06f('0x31')]),_0x21aa07);if(_0x27e134[_0xc06f('0x34')][_0xc06f('0x3c')]){_0x2ec8d7['where']=_[_0xc06f('0x3d')](_0x2ec8d7[_0xc06f('0x3a')],{'$or':_['map'](_0x21aa07,function(_0x10dd48){if(_0x10dd48[_0xc06f('0x3e')]!=='VIRTUAL'){var _0x11e588={};_0x11e588[_0x10dd48[_0xc06f('0x2c')]]={'$like':'%'+_0x27e134[_0xc06f('0x34')][_0xc06f('0x3c')]+'%'};return _0x11e588;}})});}_0x2ec8d7=_[_0xc06f('0x3d')]({},_0x2ec8d7,_0x27e134[_0xc06f('0x3f')]);var _0x834ad={'where':_0x2ec8d7[_0xc06f('0x3a')]};return db['Variable'][_0xc06f('0x20')](_0x834ad)[_0xc06f('0x27')](function(_0x3f24a1){_0x3f5598[_0xc06f('0x20')]=_0x3f24a1;if(_0x27e134[_0xc06f('0x34')]['includeAll']){_0x2ec8d7[_0xc06f('0x40')]=[{'all':!![]}];}return db[_0xc06f('0x41')]['findAll'](_0x2ec8d7);})[_0xc06f('0x27')](function(_0x3443b6){_0x3f5598[_0xc06f('0x42')]=_0x3443b6;return _0x3f5598;})[_0xc06f('0x27')](respondWithFilteredResult(_0x35a8d1,_0x2ec8d7))[_0xc06f('0x43')](handleError(_0x35a8d1,null));};exports['show']=function(_0x10a9bb,_0x473666){var _0x15beb0={'raw':!![],'where':{'id':_0x10a9bb[_0xc06f('0x44')]['id']}},_0x2344b1={};_0x2344b1[_0xc06f('0x33')]=_[_0xc06f('0x45')](db[_0xc06f('0x41')][_0xc06f('0x2f')]);_0x2344b1[_0xc06f('0x34')]=_[_0xc06f('0x45')](_0x10a9bb[_0xc06f('0x34')]);_0x2344b1['filters']=_[_0xc06f('0x32')](_0x2344b1[_0xc06f('0x33')],_0x2344b1[_0xc06f('0x34')]);_0x15beb0[_0xc06f('0x35')]=_[_0xc06f('0x32')](_0x2344b1[_0xc06f('0x33')],qs['fields'](_0x10a9bb[_0xc06f('0x34')][_0xc06f('0x36')]));_0x15beb0[_0xc06f('0x35')]=_0x15beb0[_0xc06f('0x35')]['length']?_0x15beb0[_0xc06f('0x35')]:_0x2344b1[_0xc06f('0x33')];if(_0x10a9bb['query'][_0xc06f('0x46')]){_0x15beb0['include']=[{'all':!![]}];}_0x15beb0=_[_0xc06f('0x3d')]({},_0x15beb0,_0x10a9bb[_0xc06f('0x3f')]);return db[_0xc06f('0x41')][_0xc06f('0x47')](_0x15beb0)[_0xc06f('0x27')](handleEntityNotFound(_0x473666,null))[_0xc06f('0x27')](respondWithResult(_0x473666,null))[_0xc06f('0x43')](handleError(_0x473666,null));};exports[_0xc06f('0x48')]=function(_0x3cd90f,_0x50139e){return db[_0xc06f('0x41')][_0xc06f('0x48')](_0x3cd90f[_0xc06f('0x49')],{})[_0xc06f('0x27')](function(_0xe1eb04){var _0x3dfdc7=_0x3cd90f[_0xc06f('0x4a')][_0xc06f('0x28')]({'plain':!![]});if(!_0x3dfdc7)throw new Error(_0xc06f('0x4b'));if(_0x3dfdc7[_0xc06f('0x4c')]===_0xc06f('0x4a')){var _0x3dc3ca=_0xe1eb04['get']({'plain':!![]});var _0x3e4598=_0xc06f('0x4d');return db[_0xc06f('0x4e')][_0xc06f('0x47')]({'where':{'name':_0x3e4598,'userProfileId':_0x3dfdc7[_0xc06f('0x4f')]},'raw':!![]})[_0xc06f('0x27')](function(_0x1f6896){if(_0x1f6896&&_0x1f6896['autoAssociation']===0x0){return db[_0xc06f('0x29')]['create']({'name':_0x3dc3ca[_0xc06f('0x2c')],'resourceId':_0x3dc3ca['id'],'type':_0x1f6896[_0xc06f('0x2c')],'sectionId':_0x1f6896['id']},{})[_0xc06f('0x27')](function(){return _0xe1eb04;});}else{return _0xe1eb04;}})[_0xc06f('0x43')](function(_0x57bccc){logger[_0xc06f('0x2a')](_0xc06f('0x50'),_0x57bccc);throw _0x57bccc;});}return _0xe1eb04;})[_0xc06f('0x27')](respondWithResult(_0x50139e,0xc9))[_0xc06f('0x43')](handleError(_0x50139e,null));};exports[_0xc06f('0x26')]=function(_0x1b0b5d,_0x1f8d73){if(_0x1b0b5d[_0xc06f('0x49')]['id']){delete _0x1b0b5d[_0xc06f('0x49')]['id'];}return db[_0xc06f('0x41')][_0xc06f('0x47')]({'where':{'id':_0x1b0b5d[_0xc06f('0x44')]['id']}})[_0xc06f('0x27')](handleEntityNotFound(_0x1f8d73,null))[_0xc06f('0x27')](saveUpdates(_0x1b0b5d[_0xc06f('0x49')],null))[_0xc06f('0x27')](respondWithResult(_0x1f8d73,null))[_0xc06f('0x43')](handleError(_0x1f8d73,null));};exports[_0xc06f('0x51')]=function(_0xd8a234,_0x494e88){return db[_0xc06f('0x41')][_0xc06f('0x47')]({'where':{'id':_0xd8a234[_0xc06f('0x44')]['id']}})[_0xc06f('0x27')](handleEntityNotFound(_0x494e88,null))[_0xc06f('0x27')](removeEntity(_0x494e88,null))[_0xc06f('0x43')](handleError(_0x494e88,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d93dcae..f263eb1 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 _0x87d5=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','tools_variables'];(function(_0x13a7f8,_0x5e62bd){var _0x285f0e=function(_0xecb3a0){while(--_0xecb3a0){_0x13a7f8['push'](_0x13a7f8['shift']());}};_0x285f0e(++_0x5e62bd);}(_0x87d5,0x82));var _0x587d=function(_0x5a828c,_0x5c50ae){_0x5a828c=_0x5a828c-0x0;var _0x1b126e=_0x87d5[_0x5a828c];return _0x1b126e;};'use strict';var _=require(_0x587d('0x0'));var util=require(_0x587d('0x1'));var logger=require(_0x587d('0x2'))('api');var moment=require(_0x587d('0x3'));var BPromise=require('bluebird');var rp=require(_0x587d('0x4'));var fs=require('fs');var path=require(_0x587d('0x5'));var rimraf=require(_0x587d('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x587d('0x7')]=function(_0x3953a9,_0x2525ed){return _0x3953a9[_0x587d('0x8')]('Variable',attributes,{'tableName':_0x587d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dba=['Variable','tools_variables','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define'];(function(_0x38d52,_0x4a06be){var _0x61f09a=function(_0x36331e){while(--_0x36331e){_0x38d52['push'](_0x38d52['shift']());}};_0x61f09a(++_0x4a06be);}(_0x0dba,0x113));var _0xa0db=function(_0x428959,_0x4a16ed){_0x428959=_0x428959-0x0;var _0x2c4949=_0x0dba[_0x428959];return _0x2c4949;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var logger=require(_0xa0db('0x2'))('api');var moment=require(_0xa0db('0x3'));var BPromise=require(_0xa0db('0x4'));var rp=require(_0xa0db('0x5'));var fs=require('fs');var path=require(_0xa0db('0x6'));var rimraf=require('rimraf');var config=require(_0xa0db('0x7'));var attributes=require(_0xa0db('0x8'));module[_0xa0db('0x9')]=function(_0x8a68de,_0x5b4f00){return _0x8a68de[_0xa0db('0xa')](_0xa0db('0xb'),attributes,{'tableName':_0xa0db('0xc'),'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 88165ff..2893653 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xa41a,0x6b));var _0xaa41=function(_0x1a5fda,_0x20f270){_0x1a5fda=_0x1a5fda-0x0;var _0x1da3fa=_0xa41a[_0x1a5fda];return _0x1da3fa;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x93dc1c,_0x423000){var _0x4c3e89=function(_0x1e1c7e){while(--_0x1e1c7e){_0x93dc1c['push'](_0x93dc1c['shift']());}};_0x4c3e89(++_0x423000);}(_0xe14b,0x93));var _0xbe14=function(_0x5847e2,_0x349658){_0x5847e2=_0x5847e2-0x0;var _0x289798=_0xe14b[_0x5847e2];return _0x289798;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 6b4f566..00d9b7b 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 _0x688e=['canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','./version.controller','index','get','isAuthenticated'];(function(_0xc4815a,_0x3ddfe8){var _0x24e3e6=function(_0x27a998){while(--_0x27a998){_0xc4815a['push'](_0xc4815a['shift']());}};_0x24e3e6(++_0x3ddfe8);}(_0x688e,0xd9));var _0xe688=function(_0x3c098b,_0x19209e){_0x3c098b=_0x3c098b-0x0;var _0x40bb63=_0x688e[_0x3c098b];return _0x40bb63;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe688('0x0'));router['get']('/',controller[_0xe688('0x1')]);router[_0xe688('0x2')]('/fetch',auth[_0xe688('0x3')](),auth[_0xe688('0x4')](),controller['fetch']);router[_0xe688('0x2')](_0xe688('0x5'),auth[_0xe688('0x3')](),auth[_0xe688('0x4')](),controller[_0xe688('0x6')]);router[_0xe688('0x2')](_0xe688('0x7'),auth[_0xe688('0x3')](),auth['canUpdate'](),controller[_0xe688('0x8')]);router[_0xe688('0x2')](_0xe688('0x9'),auth[_0xe688('0x3')](),controller[_0xe688('0xa')]);router[_0xe688('0x2')](_0xe688('0xb'),controller[_0xe688('0xc')]);module['exports']=router; \ No newline at end of file +var _0xfe36=['/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart','restart','/migrations','exports','express','../../components/auth/service','./version.controller','get','index'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0xfe36,0x18b));var _0x6fe3=function(_0x3e0d28,_0x42a357){_0x3e0d28=_0x3e0d28-0x0;var _0x3e1b02=_0xfe36[_0x3e0d28];return _0x3e1b02;};'use strict';var express=require(_0x6fe3('0x0'));var router=express['Router']();var auth=require(_0x6fe3('0x1'));var controller=require(_0x6fe3('0x2'));router[_0x6fe3('0x3')]('/',controller[_0x6fe3('0x4')]);router[_0x6fe3('0x3')](_0x6fe3('0x5'),auth[_0x6fe3('0x6')](),auth[_0x6fe3('0x7')](),controller[_0x6fe3('0x8')]);router[_0x6fe3('0x3')](_0x6fe3('0x9'),auth[_0x6fe3('0x6')](),auth[_0x6fe3('0x7')](),controller[_0x6fe3('0xa')]);router[_0x6fe3('0x3')](_0x6fe3('0xb'),auth[_0x6fe3('0x6')](),auth[_0x6fe3('0x7')](),controller['pull']);router[_0x6fe3('0x3')](_0x6fe3('0xc'),auth[_0x6fe3('0x6')](),controller[_0x6fe3('0xd')]);router[_0x6fe3('0x3')](_0x6fe3('0xe'),controller['migrations']);module[_0x6fe3('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 46c1a4e..0417867 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 _0xc3c3=['join','length','replace','.js','push','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.','root','map','then','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','info','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xc3c3,0x123));var _0x3c3c=function(_0x5c9a80,_0x3d9398){_0x5c9a80=_0x5c9a80-0x0;var _0x58fe8a=_0xc3c3[_0x5c9a80];return _0x58fe8a;};'use strict';var Umzug=require('umzug');var path=require(_0x3c3c('0x0'));var fs=require('fs');var _=require(_0x3c3c('0x1'));var pkginfo=require(_0x3c3c('0x2'))(module,_0x3c3c('0x3'));var compareVersions=require(_0x3c3c('0x4'));var exec=require(_0x3c3c('0x5'))[_0x3c3c('0x6')];var db=require(_0x3c3c('0x7'))['db'];var config=require(_0x3c3c('0x8'));var pm2=require(_0x3c3c('0x9'));var logger=require(_0x3c3c('0xa'))(_0x3c3c('0xb'));var git=require(_0x3c3c('0xc'))(config['root']);exports[_0x3c3c('0xd')]=function(_0x2dc33e,_0x3199c6){var _0x1fd452={'current':module[_0x3c3c('0xe')][_0x3c3c('0x3')],'phonebar':0x2};if(_0x2dc33e[_0x3c3c('0xf')]&&_0x2dc33e[_0x3c3c('0xf')][_0x3c3c('0x10')]){return git[_0x3c3c('0x11')]()[_0x3c3c('0x12')](function(_0x5757dc,_0x3e8734){_0x1fd452[_0x3c3c('0x10')]=(_0x5757dc?module[_0x3c3c('0xe')][_0x3c3c('0x3')]:_0x3e8734[_0x3c3c('0x10')])||_0x3c3c('0x13');return _0x3199c6[_0x3c3c('0x14')](0xc8)[_0x3c3c('0x15')](_0x1fd452);});}else{return _0x3199c6[_0x3c3c('0x14')](0xc8)[_0x3c3c('0x15')](_0x1fd452);}};exports[_0x3c3c('0x11')]=function(_0x3f25c9,_0x4f7226){return git[_0x3c3c('0x11')](['origin',_0x3c3c('0x16')],function(_0x4e6db1){if(_0x4e6db1){logger[_0x3c3c('0x17')](_0x4e6db1);return _0x4f7226['status'](0x1f4)[_0x3c3c('0x15')](_0x4e6db1);}logger['info'](_0x3c3c('0x18'));return _0x4f7226[_0x3c3c('0x14')](0xc8)['json']({'output':_0x3c3c('0x19')});});};exports[_0x3c3c('0x1a')]=function(_0x1f77d8,_0x3dac96){return git[_0x3c3c('0x1a')]([_0x3c3c('0x1b'),_0x3c3c('0x1c')],function(_0x5b8e8c){if(_0x5b8e8c){logger[_0x3c3c('0x17')](_0x5b8e8c);return _0x3dac96[_0x3c3c('0x14')](0x1f4)[_0x3c3c('0x15')](_0x5b8e8c);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3dac96[_0x3c3c('0x14')](0xc8)[_0x3c3c('0x15')]({'output':_0x3c3c('0x1d')});});};exports[_0x3c3c('0x1e')]=function(_0x5016c3,_0x412edc){exec('npm\x20install\x20--production',function(_0x56ae16,_0x831d4b,_0x4a0989){logger[_0x3c3c('0x1f')](_0x831d4b);logger[_0x3c3c('0x1f')](_0x4a0989);if(_0x56ae16){logger[_0x3c3c('0x17')](_0x56ae16);return _0x412edc[_0x3c3c('0x14')](0x1f4)['json'](_0x56ae16);}return _0x412edc[_0x3c3c('0x14')](0xc8)['json']({'output':_0x831d4b});});};exports[_0x3c3c('0x20')]=function(_0x1fbc21,_0xc11822){return pm2[_0x3c3c('0x20')](_0x3c3c('0x21'))['then'](function(_0x16eaa2){logger['info'](_0x3c3c('0x22'),_0x16eaa2);return _0xc11822[_0x3c3c('0x14')](0xc8)[_0x3c3c('0x15')]({'output':_0x3c3c('0x23')});})[_0x3c3c('0x24')](function(_0x322c11){logger['error'](_0x322c11);return _0xc11822['status'](0x1f4)[_0x3c3c('0x15')](_0x322c11);});};exports[_0x3c3c('0x25')]=function(_0x18c83e,_0x3a71d0){var _0xa42ca0=fs[_0x3c3c('0x26')](path[_0x3c3c('0x27')](config['root'],'server',_0x3c3c('0x25')));var _0x38fe42=[];for(var _0x109408=0x0;_0x109408<_0xa42ca0[_0x3c3c('0x28')];_0x109408++){var _0x1f5e71=_0xa42ca0[_0x109408][_0x3c3c('0x29')](_0x3c3c('0x2a'),'');if(compareVersions(module[_0x3c3c('0xe')]['version'],_0x1f5e71)===-0x1){_0x38fe42[_0x3c3c('0x2b')](_0x1f5e71);}}if(_0x38fe42[_0x3c3c('0x28')]){var _0x279863=_0x38fe42['sort'](compareVersions);var _0x154546=new Umzug({'storage':_0x3c3c('0x2c'),'storageOptions':{'model':db[_0x3c3c('0x2d')],'modelName':_0x3c3c('0x2d'),'columnName':_0x3c3c('0x3')},'migrations':{'params':[db[_0x3c3c('0x2c')][_0x3c3c('0x2e')](),db[_0x3c3c('0x2c')][_0x3c3c('0x2f')],function(){throw new Error(_0x3c3c('0x30'));}],'path':path[_0x3c3c('0x27')](config[_0x3c3c('0x31')],'server','migrations'),'pattern':/\.js$/}});_0x154546['up']({'migrations':_[_0x3c3c('0x32')](_0x279863,function(_0x21df27){return _0x21df27+_0x3c3c('0x2a');})})[_0x3c3c('0x33')](function(){return _0x3a71d0[_0x3c3c('0x14')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x3c3c('0x3')]+_0x3c3c('0x34')+_['last'](_0x279863),'migrations':_[_0x3c3c('0x27')](_0x279863)});})[_0x3c3c('0x24')](function(_0x8ddb5c){if(_0x8ddb5c instanceof db['sequelize'][_0x3c3c('0x35')]){return _0x3a71d0[_0x3c3c('0x14')](0xc8)[_0x3c3c('0x15')]({'output':_0x3c3c('0x36')});}else{return _0x3a71d0[_0x3c3c('0x14')](0x1f4)['json'](_0x8ddb5c);}});}else{return _0x3a71d0['status'](0xc8)[_0x3c3c('0x15')]({'output':_0x3c3c('0x36')});}}; \ No newline at end of file +var _0xb238=['path','lodash','version','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','error','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date'];(function(_0x54388a,_0x112d3e){var _0x3f5f0e=function(_0x2f1016){while(--_0x2f1016){_0x54388a['push'](_0x54388a['shift']());}};_0x3f5f0e(++_0x112d3e);}(_0xb238,0x188));var _0x8b23=function(_0x323590,_0x3211db){_0x323590=_0x323590-0x0;var _0x246383=_0xb238[_0x323590];return _0x246383;};'use strict';var Umzug=require('umzug');var path=require(_0x8b23('0x0'));var fs=require('fs');var _=require(_0x8b23('0x1'));var pkginfo=require('pkginfo')(module,_0x8b23('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x8b23('0x3'))[_0x8b23('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x8b23('0x5'));var pm2=require(_0x8b23('0x6'));var logger=require(_0x8b23('0x7'))(_0x8b23('0x8'));var git=require(_0x8b23('0x9'))(config[_0x8b23('0xa')]);exports['index']=function(_0x589190,_0x4ffb5b){var _0x1bb12b={'current':module[_0x8b23('0xb')][_0x8b23('0x2')],'phonebar':0x2};if(_0x589190[_0x8b23('0xc')]&&_0x589190[_0x8b23('0xc')][_0x8b23('0xd')]){return git['fetch']()[_0x8b23('0xe')](function(_0x1b29f4,_0x58b763){_0x1bb12b[_0x8b23('0xd')]=(_0x1b29f4?module[_0x8b23('0xb')][_0x8b23('0x2')]:_0x58b763[_0x8b23('0xd')])||_0x8b23('0xf');return _0x4ffb5b[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')](_0x1bb12b);});}else{return _0x4ffb5b[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')](_0x1bb12b);}};exports[_0x8b23('0x12')]=function(_0x19e5cd,_0x28ea6f){return git[_0x8b23('0x12')]([_0x8b23('0x13'),_0x8b23('0x14')],function(_0x2879b5){if(_0x2879b5){logger['error'](_0x2879b5);return _0x28ea6f[_0x8b23('0x10')](0x1f4)[_0x8b23('0x11')](_0x2879b5);}logger[_0x8b23('0x15')](_0x8b23('0x16'));return _0x28ea6f[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')]({'output':_0x8b23('0x17')});});};exports[_0x8b23('0x18')]=function(_0x30ad26,_0x1cf3fd){return git[_0x8b23('0x18')]([_0x8b23('0x19'),'FETCH_HEAD'],function(_0x850a47){if(_0x850a47){logger['error'](_0x850a47);return _0x1cf3fd[_0x8b23('0x10')](0x1f4)[_0x8b23('0x11')](_0x850a47);}logger[_0x8b23('0x15')](_0x8b23('0x1a'));return _0x1cf3fd[_0x8b23('0x10')](0xc8)['json']({'output':_0x8b23('0x1b')});});};exports[_0x8b23('0x1c')]=function(_0x44e967,_0x1726b8){exec('npm\x20install\x20--production',function(_0x288494,_0x337e40,_0x271c10){logger[_0x8b23('0x15')](_0x337e40);logger[_0x8b23('0x15')](_0x271c10);if(_0x288494){logger[_0x8b23('0x1d')](_0x288494);return _0x1726b8['status'](0x1f4)[_0x8b23('0x11')](_0x288494);}return _0x1726b8[_0x8b23('0x10')](0xc8)['json']({'output':_0x337e40});});};exports[_0x8b23('0x1e')]=function(_0x39fade,_0x2cd869){return pm2['restart'](_0x8b23('0x1f'))['then'](function(_0x1731e1){logger[_0x8b23('0x15')](_0x8b23('0x20'),_0x1731e1);return _0x2cd869[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')]({'output':_0x8b23('0x21')});})['catch'](function(_0x10cb54){logger[_0x8b23('0x1d')](_0x10cb54);return _0x2cd869[_0x8b23('0x10')](0x1f4)[_0x8b23('0x11')](_0x10cb54);});};exports[_0x8b23('0x22')]=function(_0xc875f9,_0x5a4a32){var _0x2a920b=fs[_0x8b23('0x23')](path[_0x8b23('0x24')](config['root'],_0x8b23('0x25'),'migrations'));var _0x1a41d2=[];for(var _0x43bec1=0x0;_0x43bec1<_0x2a920b[_0x8b23('0x26')];_0x43bec1++){var _0x31612d=_0x2a920b[_0x43bec1][_0x8b23('0x27')]('.js','');if(compareVersions(module[_0x8b23('0xb')][_0x8b23('0x2')],_0x31612d)===-0x1){_0x1a41d2[_0x8b23('0x28')](_0x31612d);}}if(_0x1a41d2[_0x8b23('0x26')]){var _0x4bb3a8=_0x1a41d2[_0x8b23('0x29')](compareVersions);var _0x161ea1=new Umzug({'storage':_0x8b23('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x8b23('0x2b'),'columnName':_0x8b23('0x2')},'migrations':{'params':[db['sequelize'][_0x8b23('0x2c')](),db[_0x8b23('0x2a')][_0x8b23('0x2d')],function(){throw new Error(_0x8b23('0x2e'));}],'path':path[_0x8b23('0x24')](config[_0x8b23('0xa')],_0x8b23('0x25'),_0x8b23('0x22')),'pattern':/\.js$/}});_0x161ea1['up']({'migrations':_[_0x8b23('0x2f')](_0x4bb3a8,function(_0xa0e52b){return _0xa0e52b+_0x8b23('0x30');})})[_0x8b23('0x31')](function(){return _0x5a4a32['status'](0xc8)['json']({'output':_0x8b23('0x32')+module[_0x8b23('0xb')]['version']+_0x8b23('0x33')+_[_0x8b23('0x34')](_0x4bb3a8),'migrations':_[_0x8b23('0x24')](_0x4bb3a8)});})[_0x8b23('0x35')](function(_0x3f29ed){if(_0x3f29ed instanceof db[_0x8b23('0x2a')][_0x8b23('0x36')]){return _0x5a4a32[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')]({'output':_0x8b23('0x37')});}else{return _0x5a4a32['status'](0x1f4)[_0x8b23('0x11')](_0x3f29ed);}});}else{return _0x5a4a32[_0x8b23('0x10')](0xc8)[_0x8b23('0x11')]({'output':_0x8b23('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index de228dd..3338fb9 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 _0xcc04=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','describe','get','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5afb77,_0xdad1e1){var _0x477268=function(_0xb9202e){while(--_0xb9202e){_0x5afb77['push'](_0x5afb77['shift']());}};_0x477268(++_0xdad1e1);}(_0xcc04,0x19c));var _0x4cc0=function(_0x32ed6a,_0x1cd968){_0x32ed6a=_0x32ed6a-0x0;var _0x5d670c=_0xcc04[_0x32ed6a];return _0x5d670c;};'use strict';var multer=require(_0x4cc0('0x0'));var util=require(_0x4cc0('0x1'));var path=require(_0x4cc0('0x2'));var timeout=require(_0x4cc0('0x3'));var express=require(_0x4cc0('0x4'));var router=express['Router']();var fs_extra=require(_0x4cc0('0x5'));var auth=require(_0x4cc0('0x6'));var interaction=require(_0x4cc0('0x7'));var config=require(_0x4cc0('0x8'));var controller=require(_0x4cc0('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xb')]);router[_0x4cc0('0xc')](_0x4cc0('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4cc0('0xe')]('/',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xf')]);router['put'](_0x4cc0('0xd'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x10')]);router[_0x4cc0('0x11')]('/:id',auth[_0x4cc0('0xa')](),controller['destroy']);module[_0x4cc0('0x12')]=router; \ No newline at end of file +var _0x3007=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update'];(function(_0xc0a4be,_0xe7deb){var _0x20e0e3=function(_0x39b8ad){while(--_0x39b8ad){_0xc0a4be['push'](_0xc0a4be['shift']());}};_0x20e0e3(++_0xe7deb);}(_0x3007,0x17e));var _0x7300=function(_0x205c18,_0x5a10cc){_0x205c18=_0x205c18-0x0;var _0x29f2a2=_0x3007[_0x205c18];return _0x29f2a2;};'use strict';var multer=require(_0x7300('0x0'));var util=require(_0x7300('0x1'));var path=require(_0x7300('0x2'));var timeout=require(_0x7300('0x3'));var express=require(_0x7300('0x4'));var router=express[_0x7300('0x5')]();var fs_extra=require(_0x7300('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x7300('0x7')]('/',auth[_0x7300('0x8')](),controller[_0x7300('0x9')]);router[_0x7300('0x7')](_0x7300('0xa'),auth[_0x7300('0x8')](),controller['describe']);router[_0x7300('0x7')](_0x7300('0xb'),auth[_0x7300('0x8')](),controller[_0x7300('0xc')]);router[_0x7300('0xd')]('/',auth[_0x7300('0x8')](),controller[_0x7300('0xe')]);router[_0x7300('0xf')]('/:id',auth[_0x7300('0x8')](),controller[_0x7300('0x10')]);router[_0x7300('0x11')](_0x7300('0xb'),auth[_0x7300('0x8')](),controller[_0x7300('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 87b74d6..93a05b9 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 _0x4f3c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x16404a,_0x459beb){var _0x125955=function(_0x3e5109){while(--_0x3e5109){_0x16404a['push'](_0x16404a['shift']());}};_0x125955(++_0x459beb);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0x4f3c[_0x3caeb5];return _0x5eca7e;};'use strict';var Sequelize=require(_0xc4f3('0x0'));module[_0xc4f3('0x1')]={'type':{'type':Sequelize[_0xc4f3('0x2')]},'uniqueid':{'type':Sequelize[_0xc4f3('0x2')]},'calleridnum':{'type':Sequelize[_0xc4f3('0x2')]},'calleridname':{'type':Sequelize[_0xc4f3('0x2')]},'queue':{'type':Sequelize[_0xc4f3('0x2')]},'interface':{'type':Sequelize[_0xc4f3('0x2')]},'membername':{'type':Sequelize[_0xc4f3('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc4f3('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xc4f3('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc4f3('0x3')]},'holdtime':{'type':Sequelize[_0xc4f3('0x4')]},'agentcomplete':{'type':Sequelize[_0xc4f3('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc4f3('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc4f3('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc4f3('0x4')]},'agentacw':{'type':Sequelize[_0xc4f3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc4f3('0x4')]},'reason':{'type':Sequelize[_0xc4f3('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc4f3('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc4f3('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc4f3('0x2')]},'accountcode':{'type':Sequelize[_0xc4f3('0x2')]},'context':{'type':Sequelize[_0xc4f3('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc4f3('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc4f3('0x2')]},'destcalleridname':{'type':Sequelize[_0xc4f3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc4f3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc4f3('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc4f3('0x2')]},'destcontext':{'type':Sequelize[_0xc4f3('0x2')]},'destexten':{'type':Sequelize[_0xc4f3('0x2')]},'destpriority':{'type':Sequelize[_0xc4f3('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc4f3('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xc4f3('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc4f3('0x2')],'comment':_0xc4f3('0x6')},'transferexten':{'type':Sequelize[_0xc4f3('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x25025f,_0x261af2){var _0x1ee1db=function(_0x18c1c1){while(--_0x18c1c1){_0x25025f['push'](_0x25025f['shift']());}};_0x1ee1db(++_0x261af2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'type':{'type':Sequelize[_0x0baf('0x1')]},'uniqueid':{'type':Sequelize[_0x0baf('0x1')]},'calleridnum':{'type':Sequelize[_0x0baf('0x1')]},'calleridname':{'type':Sequelize[_0x0baf('0x1')]},'queue':{'type':Sequelize[_0x0baf('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0baf('0x1')]},'agentcalledAt':{'type':Sequelize[_0x0baf('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0baf('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x0baf('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x0baf('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0baf('0x2')]},'holdtime':{'type':Sequelize[_0x0baf('0x3')]},'agentcomplete':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0baf('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0baf('0x3')]},'reason':{'type':Sequelize[_0x0baf('0x1')]},'lastevent':{'type':Sequelize[_0x0baf('0x1')]},'channel':{'type':Sequelize[_0x0baf('0x1')]},'channelstate':{'type':Sequelize[_0x0baf('0x3')]},'channelstatedesc':{'type':Sequelize[_0x0baf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x0baf('0x1')]},'connectedlinename':{'type':Sequelize[_0x0baf('0x1')]},'language':{'type':Sequelize[_0x0baf('0x1')]},'accountcode':{'type':Sequelize[_0x0baf('0x1')]},'context':{'type':Sequelize[_0x0baf('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x0baf('0x1')]},'destchannelstate':{'type':Sequelize[_0x0baf('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x0baf('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0baf('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x0baf('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0baf('0x1')]},'destaccountcode':{'type':Sequelize[_0x0baf('0x1')]},'destcontext':{'type':Sequelize[_0x0baf('0x1')]},'destexten':{'type':Sequelize[_0x0baf('0x1')]},'destpriority':{'type':Sequelize[_0x0baf('0x1')]},'destuniqueid':{'type':Sequelize[_0x0baf('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0baf('0x1')],'comment':_0x0baf('0x5')},'transferexten':{'type':Sequelize[_0x0baf('0x1')]},'transferuniqueid':{'type':Sequelize[_0x0baf('0x1')]},'agententerreason':{'type':Sequelize[_0x0baf('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 9d862c4..3adabeb 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(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 1a06399..e6eebf5 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 _0x0fda=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x2c4f2a,_0x17ccb4){_0x2c4f2a=_0x2c4f2a-0x0;var _0x1115a5=_0x0fda[_0x2c4f2a];return _0x1115a5;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var logger=require(_0xa0fd('0x1'))(_0xa0fd('0x2'));var moment=require(_0xa0fd('0x3'));var BPromise=require(_0xa0fd('0x4'));var rp=require(_0xa0fd('0x5'));var fs=require('fs');var path=require(_0xa0fd('0x6'));var rimraf=require(_0xa0fd('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xa0fd('0x8')]=function(_0x4aec58,_0x49b3c1){return _0x4aec58[_0xa0fd('0x9')](_0xa0fd('0xa'),attributes,{'tableName':_0xa0fd('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa0fd('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9d5=['define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf9d5,0x122));var _0x5f9d=function(_0xabbba3,_0x5a3f85){_0xabbba3=_0xabbba3-0x0;var _0x592f33=_0xf9d5[_0xabbba3];return _0x592f33;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var logger=require(_0x5f9d('0x1'))('api');var moment=require(_0x5f9d('0x2'));var BPromise=require(_0x5f9d('0x3'));var rp=require(_0x5f9d('0x4'));var fs=require('fs');var path=require(_0x5f9d('0x5'));var rimraf=require(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var attributes=require(_0x5f9d('0x8'));module['exports']=function(_0x1fc74c,_0x59027b){return _0x1fc74c[_0x5f9d('0x9')](_0x5f9d('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5f9d('0xb'),_0x5f9d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 643c192..355a4ca 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 _0x7f48=['UpdateVoiceAgentReport','attributes','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport'];(function(_0x43eb20,_0x3a8df7){var _0x2128fb=function(_0x5100ba){while(--_0x5100ba){_0x43eb20['push'](_0x43eb20['shift']());}};_0x2128fb(++_0x3a8df7);}(_0x7f48,0x189));var _0x87f4=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x7f48[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0x87f4('0x0'));var util=require(_0x87f4('0x1'));var moment=require('moment');var BPromise=require(_0x87f4('0x2'));var rs=require(_0x87f4('0x3'));var fs=require('fs');var Redis=require(_0x87f4('0x4'));var db=require(_0x87f4('0x5'))['db'];var utils=require(_0x87f4('0x6'));var logger=require(_0x87f4('0x7'))(_0x87f4('0x8'));var config=require(_0x87f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x87f4('0xa')][_0x87f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9af3f8,_0x1f5f4c,_0x2c4e32){return new BPromise(function(_0x341ff1,_0x528692){return client[_0x87f4('0xc')](_0x9af3f8,_0x2c4e32)[_0x87f4('0xd')](function(_0x2f9878){logger[_0x87f4('0xe')](_0x87f4('0xf'),_0x1f5f4c,_0x87f4('0x10'));logger[_0x87f4('0x11')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1f5f4c,'request\x20sent',JSON['stringify'](_0x2f9878));if(_0x2f9878[_0x87f4('0x12')]){if(_0x2f9878[_0x87f4('0x12')]['code']===0x1f4){logger[_0x87f4('0x12')](_0x87f4('0xf'),_0x1f5f4c,_0x2f9878[_0x87f4('0x12')]['message']);return _0x528692(_0x2f9878[_0x87f4('0x12')][_0x87f4('0x13')]);}logger[_0x87f4('0x12')](_0x87f4('0xf'),_0x1f5f4c,_0x2f9878['error'][_0x87f4('0x13')]);return _0x341ff1(_0x2f9878[_0x87f4('0x12')][_0x87f4('0x13')]);}else{logger['info'](_0x87f4('0xf'),_0x1f5f4c,_0x87f4('0x10'));_0x341ff1(_0x2f9878[_0x87f4('0x14')][_0x87f4('0x13')]);}})[_0x87f4('0x15')](function(_0x220747){logger[_0x87f4('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x1f5f4c,_0x220747);_0x528692(_0x220747);});});}exports['CreateVoiceAgentReport']=function(_0x850b64){var _0x1f70d4=this;return new Promise(function(_0x304c28,_0xade380){return db[_0x87f4('0x16')]['create'](_0x850b64[_0x87f4('0x17')],{'raw':_0x850b64[_0x87f4('0x18')]?_0x850b64[_0x87f4('0x18')][_0x87f4('0x19')]===undefined?!![]:![]:!![]})[_0x87f4('0xd')](function(_0x539502){logger['info'](_0x87f4('0x1a'),_0x850b64);logger[_0x87f4('0x11')](_0x87f4('0x1a'),_0x850b64,JSON['stringify'](_0x539502));_0x304c28(_0x539502);})['catch'](function(_0x6dffa4){logger['error'](_0x87f4('0x1a'),_0x6dffa4[_0x87f4('0x13')],_0x850b64);_0xade380(_0x1f70d4[_0x87f4('0x12')](0x1f4,_0x6dffa4[_0x87f4('0x13')]));});});};exports[_0x87f4('0x1b')]=function(_0x208ee1){var _0x1d1039=this;return new Promise(function(_0xd880de,_0x455c72){return db['VoiceAgentReport']['update'](_0x208ee1[_0x87f4('0x17')],{'raw':_0x208ee1[_0x87f4('0x18')]?_0x208ee1[_0x87f4('0x18')][_0x87f4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208ee1[_0x87f4('0x18')]?_0x208ee1[_0x87f4('0x18')]['where']||null:null,'attributes':_0x208ee1['options']?_0x208ee1['options'][_0x87f4('0x1c')]||null:null,'limit':_0x208ee1['options']?_0x208ee1['options']['limit']||null:null})[_0x87f4('0xd')](function(_0x5e837d){logger[_0x87f4('0xe')]('UpdateVoiceAgentReport',_0x208ee1);logger[_0x87f4('0x11')]('UpdateVoiceAgentReport',_0x208ee1,JSON[_0x87f4('0x1d')](_0x5e837d));_0xd880de(_0x5e837d);})[_0x87f4('0x15')](function(_0x1242be){logger[_0x87f4('0x12')](_0x87f4('0x1b'),_0x1242be[_0x87f4('0x13')],_0x208ee1);_0x455c72(_0x1d1039[_0x87f4('0x12')](0x1f4,_0x1242be[_0x87f4('0x13')]));});});}; \ No newline at end of file +var _0x318a=['result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x3151f9,_0x2271fa){var _0x3aa5a8=function(_0x5beb6e){while(--_0x5beb6e){_0x3151f9['push'](_0x3151f9['shift']());}};_0x3aa5a8(++_0x2271fa);}(_0x318a,0x10b));var _0xa318=function(_0x42a48b,_0xaccc46){_0x42a48b=_0x42a48b-0x0;var _0x4d84b9=_0x318a[_0x42a48b];return _0x4d84b9;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var moment=require(_0xa318('0x2'));var BPromise=require(_0xa318('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa318('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa318('0x5'))(_0xa318('0x6'));var config=require(_0xa318('0x7'));var jayson=require(_0xa318('0x8'));var client=jayson[_0xa318('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40a378,_0x851068,_0x2b5b58){return new BPromise(function(_0x4be1e4,_0xb8b38){return client[_0xa318('0xa')](_0x40a378,_0x2b5b58)[_0xa318('0xb')](function(_0x440823){logger[_0xa318('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x851068,_0xa318('0xd'));logger[_0xa318('0xe')](_0xa318('0xf'),_0x851068,_0xa318('0xd'),JSON[_0xa318('0x10')](_0x440823));if(_0x440823[_0xa318('0x11')]){if(_0x440823[_0xa318('0x11')][_0xa318('0x12')]===0x1f4){logger[_0xa318('0x11')](_0xa318('0x13'),_0x851068,_0x440823[_0xa318('0x11')]['message']);return _0xb8b38(_0x440823[_0xa318('0x11')][_0xa318('0x14')]);}logger[_0xa318('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x851068,_0x440823[_0xa318('0x11')]['message']);return _0x4be1e4(_0x440823[_0xa318('0x11')][_0xa318('0x14')]);}else{logger[_0xa318('0xc')](_0xa318('0x13'),_0x851068,_0xa318('0xd'));_0x4be1e4(_0x440823[_0xa318('0x15')][_0xa318('0x14')]);}})[_0xa318('0x16')](function(_0x57c242){logger[_0xa318('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x851068,_0x57c242);_0xb8b38(_0x57c242);});});}exports[_0xa318('0x17')]=function(_0x1e8c8e){var _0x32c389=this;return new Promise(function(_0x1a4b88,_0x400b75){return db[_0xa318('0x18')][_0xa318('0x19')](_0x1e8c8e[_0xa318('0x1a')],{'raw':_0x1e8c8e[_0xa318('0x1b')]?_0x1e8c8e[_0xa318('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa318('0xb')](function(_0x53bd86){logger[_0xa318('0xc')](_0xa318('0x17'),_0x1e8c8e);logger[_0xa318('0xe')]('CreateVoiceAgentReport',_0x1e8c8e,JSON[_0xa318('0x10')](_0x53bd86));_0x1a4b88(_0x53bd86);})['catch'](function(_0x497502){logger[_0xa318('0x11')](_0xa318('0x17'),_0x497502[_0xa318('0x14')],_0x1e8c8e);_0x400b75(_0x32c389[_0xa318('0x11')](0x1f4,_0x497502[_0xa318('0x14')]));});});};exports[_0xa318('0x1c')]=function(_0x5e592b){var _0x18d3b8=this;return new Promise(function(_0x2a5ce5,_0x4d794c){return db[_0xa318('0x18')][_0xa318('0x1d')](_0x5e592b[_0xa318('0x1a')],{'raw':_0x5e592b[_0xa318('0x1b')]?_0x5e592b[_0xa318('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e592b[_0xa318('0x1b')]?_0x5e592b[_0xa318('0x1b')]['where']||null:null,'attributes':_0x5e592b[_0xa318('0x1b')]?_0x5e592b[_0xa318('0x1b')][_0xa318('0x1e')]||null:null,'limit':_0x5e592b[_0xa318('0x1b')]?_0x5e592b['options'][_0xa318('0x1f')]||null:null})[_0xa318('0xb')](function(_0x4e5924){logger['info'](_0xa318('0x1c'),_0x5e592b);logger[_0xa318('0xe')](_0xa318('0x1c'),_0x5e592b,JSON['stringify'](_0x4e5924));_0x2a5ce5(_0x4e5924);})[_0xa318('0x16')](function(_0x4548d9){logger[_0xa318('0x11')]('UpdateVoiceAgentReport',_0x4548d9['message'],_0x5e592b);_0x4d794c(_0x18d3b8[_0xa318('0x11')](0x1f4,_0x4548d9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 6be33ca..e984e61 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 _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x3f558f,_0x338b4c){var _0x4c8cf2=function(_0x98a9f){while(--_0x98a9f){_0x3f558f['push'](_0x3f558f['shift']());}};_0x4c8cf2(++_0x338b4c);}(_0xd13e,0x193));var _0xed13=function(_0x422e01,_0x1e3efb){_0x422e01=_0x422e01-0x0;var _0x37b8c8=_0xd13e[_0x422e01];return _0x37b8c8;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0xb')]);router[_0xed13('0x8')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')]('/',auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);router['delete'](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x12')]);module[_0xed13('0x13')]=router; \ No newline at end of file +var _0x81bd=['../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2847ec,_0x40ce19){var _0x507988=function(_0x3545a1){while(--_0x3545a1){_0x2847ec['push'](_0x2847ec['shift']());}};_0x507988(++_0x40ce19);}(_0x81bd,0x7c));var _0xd81b=function(_0x75aebf,_0xb132d7){_0x75aebf=_0x75aebf-0x0;var _0x148756=_0x81bd[_0x75aebf];return _0x148756;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var fs_extra=require(_0xd81b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var controller=require(_0xd81b('0x9'));router['get']('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0xb')]);router[_0xd81b('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd81b('0xd')]);router['get'](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')]('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x12')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x13')]);router[_0xd81b('0x14')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller['destroy']);module[_0xd81b('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a597d95..6b2e689 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(_0xc4c071,_0x2d31de){var _0x2cc680=function(_0x3108d5){while(--_0x3108d5){_0xc4c071['push'](_0xc4c071['shift']());}};_0x2cc680(++_0x2d31de);}(_0x066e,0xca));var _0xe066=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x066e[_0x33032e];return _0x13316b;};'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 _0x8603=['exports','STRING','ENUM','outbound','inbound-fax','outbound-fax','DATE','INTEGER'];(function(_0x59b0e3,_0x18d47d){var _0xa15298=function(_0x57a19d){while(--_0x57a19d){_0x59b0e3['push'](_0x59b0e3['shift']());}};_0xa15298(++_0x18d47d);}(_0x8603,0x190));var _0x3860=function(_0x2ad4e0,_0x4f0a5c){_0x2ad4e0=_0x2ad4e0-0x0;var _0x5ef8a7=_0x8603[_0x2ad4e0];return _0x5ef8a7;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'uniqueid':{'type':Sequelize[_0x3860('0x1')]},'type':{'type':Sequelize[_0x3860('0x2')]('inbound','internal',_0x3860('0x3'),_0x3860('0x4'),_0x3860('0x5'),'dialer')},'tag':{'type':Sequelize[_0x3860('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x3860('0x1')]},'destination':{'type':Sequelize[_0x3860('0x1')]},'destinationcontext':{'type':Sequelize[_0x3860('0x1')]},'callerid':{'type':Sequelize[_0x3860('0x1')]},'channel':{'type':Sequelize[_0x3860('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x3860('0x6')]},'systemanswertime':{'type':Sequelize[_0x3860('0x6')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3860('0x6')]},'duration':{'type':Sequelize[_0x3860('0x7')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x3860('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3860('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3860('0x1')]},'userDisposition':{'type':Sequelize[_0x3860('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x3860('0x1')]},'note':{'type':Sequelize[_0x3860('0x1')]},'prefix':{'type':Sequelize[_0x3860('0x1')]},'routeid':{'type':Sequelize[_0x3860('0x7')]},'sipcallid':{'type':Sequelize[_0x3860('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e20d0c6..bc1da70 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 _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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'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 +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x2700f8,_0x45705b){_0x2700f8=_0x2700f8-0x0;var _0x599445=_0x2032[_0x2700f8];return _0x599445;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 8a01b2f..6a9cecb 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 _0xa7d0=['./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0xa7d0,0x148));var _0x0a7d=function(_0x2d7e87,_0x6762ec){_0x2d7e87=_0x2d7e87-0x0;var _0x529a0a=_0xa7d0[_0x2d7e87];return _0x529a0a;};'use strict';var _=require(_0x0a7d('0x0'));var util=require(_0x0a7d('0x1'));var logger=require(_0x0a7d('0x2'))(_0x0a7d('0x3'));var moment=require(_0x0a7d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a7d('0x5'));var rimraf=require(_0x0a7d('0x6'));var config=require(_0x0a7d('0x7'));var attributes=require(_0x0a7d('0x8'));module[_0x0a7d('0x9')]=function(_0x15fabd,_0x22c962){return _0x15fabd[_0x0a7d('0xa')](_0x0a7d('0xb'),attributes,{'tableName':_0x0a7d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0a7d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ce5=['../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3b412a,_0x11d421){var _0x3540b4=function(_0x1abd14){while(--_0x1abd14){_0x3b412a['push'](_0x3b412a['shift']());}};_0x3540b4(++_0x11d421);}(_0x4ce5,0x1b2));var _0x54ce=function(_0x3430aa,_0x1698fb){_0x3430aa=_0x3430aa-0x0;var _0x17e717=_0x4ce5[_0x3430aa];return _0x17e717;};'use strict';var _=require(_0x54ce('0x0'));var util=require('util');var logger=require(_0x54ce('0x1'))(_0x54ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x54ce('0x3'));var fs=require('fs');var path=require(_0x54ce('0x4'));var rimraf=require(_0x54ce('0x5'));var config=require(_0x54ce('0x6'));var attributes=require(_0x54ce('0x7'));module['exports']=function(_0x4baee7,_0x390e82){return _0x4baee7[_0x54ce('0x8')](_0x54ce('0x9'),attributes,{'tableName':_0x54ce('0xa'),'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 384892e..a83067a 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 _0x7351=['VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','update','stringify','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1048fc,_0x11ea26){var _0x2cd0d9=function(_0x2e9a94){while(--_0x2e9a94){_0x1048fc['push'](_0x1048fc['shift']());}};_0x2cd0d9(++_0x11ea26);}(_0x7351,0x15b));var _0x1735=function(_0xfc0cd5,_0x253b36){_0xfc0cd5=_0xfc0cd5-0x0;var _0x4402f0=_0x7351[_0xfc0cd5];return _0x4402f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1735('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1735('0x1'));var db=require(_0x1735('0x2'))['db'];var utils=require(_0x1735('0x3'));var logger=require(_0x1735('0x4'))(_0x1735('0x5'));var config=require(_0x1735('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1735('0x7')][_0x1735('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14e25c,_0x1f4f20,_0x2c043d){return new BPromise(function(_0x325c53,_0x5c7b30){return client['request'](_0x14e25c,_0x2c043d)[_0x1735('0x9')](function(_0x2455b9){logger['info'](_0x1735('0xa'),_0x1f4f20,_0x1735('0xb'));logger[_0x1735('0xc')](_0x1735('0xd'),_0x1f4f20,_0x1735('0xb'),JSON['stringify'](_0x2455b9));if(_0x2455b9['error']){if(_0x2455b9[_0x1735('0xe')][_0x1735('0xf')]===0x1f4){logger[_0x1735('0xe')](_0x1735('0xa'),_0x1f4f20,_0x2455b9[_0x1735('0xe')][_0x1735('0x10')]);return _0x5c7b30(_0x2455b9[_0x1735('0xe')][_0x1735('0x10')]);}logger[_0x1735('0xe')](_0x1735('0xa'),_0x1f4f20,_0x2455b9[_0x1735('0xe')][_0x1735('0x10')]);return _0x325c53(_0x2455b9[_0x1735('0xe')][_0x1735('0x10')]);}else{logger[_0x1735('0x11')](_0x1735('0xa'),_0x1f4f20,_0x1735('0xb'));_0x325c53(_0x2455b9[_0x1735('0x12')][_0x1735('0x10')]);}})['catch'](function(_0xfbc428){logger[_0x1735('0xe')](_0x1735('0xa'),_0x1f4f20,_0xfbc428);_0x5c7b30(_0xfbc428);});});}exports['GetVoiceCallReport']=function(_0x34de3d){var _0x562937=this;return new Promise(function(_0x5080fb,_0x1ceee5){return db['VoiceCallReport']['findAll']({'raw':_0x34de3d[_0x1735('0x13')]?_0x34de3d['options'][_0x1735('0x14')]===undefined?!![]:![]:!![],'where':_0x34de3d[_0x1735('0x13')]?_0x34de3d['options'][_0x1735('0x15')]||null:null,'attributes':_0x34de3d[_0x1735('0x13')]?_0x34de3d[_0x1735('0x13')][_0x1735('0x16')]||null:null,'limit':_0x34de3d['options']?_0x34de3d[_0x1735('0x13')][_0x1735('0x17')]||null:null,'include':_0x34de3d[_0x1735('0x13')]?_0x34de3d[_0x1735('0x13')][_0x1735('0x18')]?_[_0x1735('0x19')](_0x34de3d[_0x1735('0x13')][_0x1735('0x18')],function(_0x2cd59c){return{'model':db[_0x2cd59c[_0x1735('0x1a')]],'as':_0x2cd59c['as'],'attributes':_0x2cd59c[_0x1735('0x16')],'include':_0x2cd59c[_0x1735('0x18')]?_[_0x1735('0x19')](_0x2cd59c[_0x1735('0x18')],function(_0x242d37){return{'model':db[_0x242d37[_0x1735('0x1a')]],'as':_0x242d37['as'],'attributes':_0x242d37['attributes'],'include':_0x242d37[_0x1735('0x18')]?_[_0x1735('0x19')](_0x242d37[_0x1735('0x18')],function(_0x4edacf){return{'model':db[_0x4edacf[_0x1735('0x1a')]],'as':_0x4edacf['as'],'attributes':_0x4edacf[_0x1735('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1735('0x9')](function(_0x556ddc){logger[_0x1735('0x11')](_0x1735('0x1b'),_0x34de3d);logger[_0x1735('0xc')](_0x1735('0x1b'),_0x34de3d,JSON['stringify'](_0x556ddc));_0x5080fb(_0x556ddc);})[_0x1735('0x1c')](function(_0x4e08c5){logger['error']('GetVoiceCallReport',_0x4e08c5[_0x1735('0x10')],_0x34de3d);_0x1ceee5(_0x562937['error'](0x1f4,_0x4e08c5[_0x1735('0x10')]));});});};exports[_0x1735('0x1d')]=function(_0x31888f){var _0x4425e4=this;return new Promise(function(_0xac315f,_0x46aeea){return db['VoiceCallReport'][_0x1735('0x1e')](_0x31888f[_0x1735('0x1f')],{'raw':_0x31888f[_0x1735('0x13')]?_0x31888f[_0x1735('0x13')][_0x1735('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x12c4de){logger[_0x1735('0x11')](_0x1735('0x1d'),_0x31888f);logger[_0x1735('0xc')](_0x1735('0x1d'),_0x31888f,JSON['stringify'](_0x12c4de));_0xac315f(_0x12c4de);})[_0x1735('0x1c')](function(_0xc701fb){logger[_0x1735('0xe')](_0x1735('0x1d'),_0xc701fb[_0x1735('0x10')],_0x31888f);_0x46aeea(_0x4425e4[_0x1735('0xe')](0x1f4,_0xc701fb[_0x1735('0x10')]));});});};exports[_0x1735('0x20')]=function(_0x8ee926){var _0x9c97b4=this;return new Promise(function(_0x46899f,_0x2905b9){return db[_0x1735('0x21')][_0x1735('0x22')](_0x8ee926[_0x1735('0x1f')],{'raw':_0x8ee926['options']?_0x8ee926[_0x1735('0x13')][_0x1735('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ee926['options']?_0x8ee926[_0x1735('0x13')][_0x1735('0x15')]||null:null,'attributes':_0x8ee926[_0x1735('0x13')]?_0x8ee926[_0x1735('0x13')]['attributes']||null:null,'limit':_0x8ee926[_0x1735('0x13')]?_0x8ee926[_0x1735('0x13')][_0x1735('0x17')]||null:null})[_0x1735('0x9')](function(_0xfbdbef){logger[_0x1735('0x11')](_0x1735('0x20'),_0x8ee926);logger[_0x1735('0xc')](_0x1735('0x20'),_0x8ee926,JSON[_0x1735('0x23')](_0xfbdbef));_0x46899f(_0xfbdbef);})['catch'](function(_0x2a2833){logger[_0x1735('0xe')](_0x1735('0x20'),_0x2a2833[_0x1735('0x10')],_0x8ee926);_0x2905b9(_0x9c97b4['error'](0x1f4,_0x2a2833[_0x1735('0x10')]));});});}; \ No newline at end of file +var _0xf9a7=['body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','create'];(function(_0x1322ac,_0x5198bd){var _0x79159d=function(_0x5359f6){while(--_0x5359f6){_0x1322ac['push'](_0x1322ac['shift']());}};_0x79159d(++_0x5198bd);}(_0xf9a7,0x133));var _0x7f9a=function(_0x216418,_0x52f997){_0x216418=_0x216418-0x0;var _0x1ba913=_0xf9a7[_0x216418];return _0x1ba913;};'use strict';var _=require(_0x7f9a('0x0'));var util=require(_0x7f9a('0x1'));var moment=require(_0x7f9a('0x2'));var BPromise=require(_0x7f9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f9a('0x6'));var jayson=require(_0x7f9a('0x7'));var client=jayson[_0x7f9a('0x8')][_0x7f9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa9179c,_0x11fce1,_0x31dce9){return new BPromise(function(_0x40f1ec,_0x12962c){return client['request'](_0xa9179c,_0x31dce9)[_0x7f9a('0xa')](function(_0x2e5da7){logger['info'](_0x7f9a('0xb'),_0x11fce1,'request\x20sent');logger[_0x7f9a('0xc')](_0x7f9a('0xd'),_0x11fce1,_0x7f9a('0xe'),JSON[_0x7f9a('0xf')](_0x2e5da7));if(_0x2e5da7[_0x7f9a('0x10')]){if(_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x11')]===0x1f4){logger[_0x7f9a('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x11fce1,_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);return _0x12962c(_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x11fce1,_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);return _0x40f1ec(_0x2e5da7['error'][_0x7f9a('0x12')]);}else{logger[_0x7f9a('0x13')](_0x7f9a('0xb'),_0x11fce1,'request\x20sent');_0x40f1ec(_0x2e5da7[_0x7f9a('0x14')]['message']);}})['catch'](function(_0x270f9c){logger['error'](_0x7f9a('0xb'),_0x11fce1,_0x270f9c);_0x12962c(_0x270f9c);});});}exports[_0x7f9a('0x15')]=function(_0x7bdf1e){var _0x1af06f=this;return new Promise(function(_0x4970bd,_0x3044d2){return db[_0x7f9a('0x16')][_0x7f9a('0x17')]({'raw':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x19')]===undefined?!![]:![]:!![],'where':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1a')]||null:null,'attributes':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1b')]||null:null,'limit':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1c')]||null:null,'include':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1d')]?_[_0x7f9a('0x1e')](_0x7bdf1e['options'][_0x7f9a('0x1d')],function(_0x54818e){return{'model':db[_0x54818e[_0x7f9a('0x1f')]],'as':_0x54818e['as'],'attributes':_0x54818e[_0x7f9a('0x1b')],'include':_0x54818e[_0x7f9a('0x1d')]?_['map'](_0x54818e[_0x7f9a('0x1d')],function(_0x561be6){return{'model':db[_0x561be6[_0x7f9a('0x1f')]],'as':_0x561be6['as'],'attributes':_0x561be6[_0x7f9a('0x1b')],'include':_0x561be6['include']?_[_0x7f9a('0x1e')](_0x561be6[_0x7f9a('0x1d')],function(_0x261289){return{'model':db[_0x261289[_0x7f9a('0x1f')]],'as':_0x261289['as'],'attributes':_0x261289[_0x7f9a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a96d7){logger[_0x7f9a('0x13')]('GetVoiceCallReport',_0x7bdf1e);logger['debug'](_0x7f9a('0x15'),_0x7bdf1e,JSON[_0x7f9a('0xf')](_0x2a96d7));_0x4970bd(_0x2a96d7);})[_0x7f9a('0x20')](function(_0xde443f){logger[_0x7f9a('0x10')](_0x7f9a('0x15'),_0xde443f[_0x7f9a('0x12')],_0x7bdf1e);_0x3044d2(_0x1af06f[_0x7f9a('0x10')](0x1f4,_0xde443f[_0x7f9a('0x12')]));});});};exports[_0x7f9a('0x21')]=function(_0x3d48ae){var _0x780020=this;return new Promise(function(_0x48c229,_0x2a2a93){return db[_0x7f9a('0x16')][_0x7f9a('0x22')](_0x3d48ae[_0x7f9a('0x23')],{'raw':_0x3d48ae[_0x7f9a('0x18')]?_0x3d48ae[_0x7f9a('0x18')][_0x7f9a('0x19')]===undefined?!![]:![]:!![]})[_0x7f9a('0xa')](function(_0x44ffba){logger[_0x7f9a('0x13')](_0x7f9a('0x21'),_0x3d48ae);logger[_0x7f9a('0xc')](_0x7f9a('0x21'),_0x3d48ae,JSON[_0x7f9a('0xf')](_0x44ffba));_0x48c229(_0x44ffba);})[_0x7f9a('0x20')](function(_0x3f22f0){logger['error'](_0x7f9a('0x21'),_0x3f22f0[_0x7f9a('0x12')],_0x3d48ae);_0x2a2a93(_0x780020[_0x7f9a('0x10')](0x1f4,_0x3f22f0['message']));});});};exports['UpdateVoiceCallReport']=function(_0x4db944){var _0x29289b=this;return new Promise(function(_0x262d43,_0x28b627){return db[_0x7f9a('0x16')][_0x7f9a('0x24')](_0x4db944[_0x7f9a('0x23')],{'raw':_0x4db944[_0x7f9a('0x18')]?_0x4db944[_0x7f9a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db944[_0x7f9a('0x18')]?_0x4db944[_0x7f9a('0x18')][_0x7f9a('0x1a')]||null:null,'attributes':_0x4db944[_0x7f9a('0x18')]?_0x4db944['options'][_0x7f9a('0x1b')]||null:null,'limit':_0x4db944[_0x7f9a('0x18')]?_0x4db944['options'][_0x7f9a('0x1c')]||null:null})[_0x7f9a('0xa')](function(_0x197515){logger[_0x7f9a('0x13')]('UpdateVoiceCallReport',_0x4db944);logger[_0x7f9a('0xc')](_0x7f9a('0x25'),_0x4db944,JSON[_0x7f9a('0xf')](_0x197515));_0x262d43(_0x197515);})['catch'](function(_0x3982c2){logger[_0x7f9a('0x10')](_0x7f9a('0x25'),_0x3982c2[_0x7f9a('0x12')],_0x4db944);_0x28b627(_0x29289b[_0x7f9a('0x10')](0x1f4,_0x3982c2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 4ea5eea..7b421e2 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 _0x364e=['put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x364e,0x138));var _0xe364=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x364e[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require(_0xe364('0x0'));var util=require(_0xe364('0x1'));var path=require('path');var timeout=require(_0xe364('0x2'));var express=require(_0xe364('0x3'));var router=express[_0xe364('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe364('0x5'));var interaction=require(_0xe364('0x6'));var config=require('../../config/environment');var controller=require(_0xe364('0x7'));router[_0xe364('0x8')]('/',auth[_0xe364('0x9')](),controller[_0xe364('0xa')]);router['get']('/:id',auth[_0xe364('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe364('0xb')]);router[_0xe364('0xc')]('/:id',auth[_0xe364('0x9')](),controller[_0xe364('0xd')]);router[_0xe364('0xe')](_0xe364('0xf'),auth[_0xe364('0x9')](),controller[_0xe364('0x10')]);module[_0xe364('0x11')]=router; \ No newline at end of file +var _0x6538=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','put','/:id','update','delete','destroy','exports'];(function(_0x3b7db2,_0x5edd58){var _0x3a819e=function(_0x207221){while(--_0x207221){_0x3b7db2['push'](_0x3b7db2['shift']());}};_0x3a819e(++_0x5edd58);}(_0x6538,0xb0));var _0x8653=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x6538[_0x32b122];return _0x4ad25a;};'use strict';var multer=require('multer');var util=require(_0x8653('0x0'));var path=require(_0x8653('0x1'));var timeout=require(_0x8653('0x2'));var express=require(_0x8653('0x3'));var router=express['Router']();var fs_extra=require(_0x8653('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8653('0x5'));var config=require(_0x8653('0x6'));var controller=require(_0x8653('0x7'));router[_0x8653('0x8')]('/',auth[_0x8653('0x9')](),controller['index']);router[_0x8653('0x8')]('/:id',auth[_0x8653('0x9')](),controller['show']);router['post']('/',auth[_0x8653('0x9')](),controller['create']);router[_0x8653('0xa')](_0x8653('0xb'),auth[_0x8653('0x9')](),controller[_0x8653('0xc')]);router[_0x8653('0xd')](_0x8653('0xb'),auth['isAuthenticated'](),controller[_0x8653('0xe')]);module[_0x8653('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fb14aa3..7eecd15 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 _0x2fc3=['BOOLEAN','STRING','join','getDataValue','options','split'];(function(_0x5a91aa,_0x2f2550){var _0x4350e0=function(_0xe646f7){while(--_0xe646f7){_0x5a91aa['push'](_0x5a91aa['shift']());}};_0x4350e0(++_0x2f2550);}(_0x2fc3,0xe5));var _0x32fc=function(_0x31904e,_0x46c5ab){_0x31904e=_0x31904e-0x0;var _0xd82c28=_0x2fc3[_0x31904e];return _0xd82c28;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x32fc('0x0')]},'prefix':{'type':Sequelize[_0x32fc('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x53adc1){this['setDataValue']('options',_0x53adc1?_0x53adc1[_0x32fc('0x1')](''):[]);},'get':function(){return this[_0x32fc('0x2')](_0x32fc('0x3'))?this['getDataValue'](_0x32fc('0x3'))[_0x32fc('0x4')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x32fc('0x0')]},'record':{'type':Sequelize[_0x32fc('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x32fc('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xee92=['getDataValue','split','BOOLEAN','STRING','name','setDataValue','options','join'];(function(_0x19faa4,_0x1ce8e8){var _0x51b78b=function(_0x1d1508){while(--_0x1d1508){_0x19faa4['push'](_0x19faa4['shift']());}};_0x51b78b(++_0x1ce8e8);}(_0xee92,0x13b));var _0x2ee9=function(_0x276708,_0x43e52a){_0x276708=_0x276708-0x0;var _0x9e762f=_0xee92[_0x276708];return _0x9e762f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2ee9('0x0')]},'prefix':{'type':Sequelize[_0x2ee9('0x0')],'unique':_0x2ee9('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x2ee9('0x0')],'set':function(_0x55abfb){this[_0x2ee9('0x2')](_0x2ee9('0x3'),_0x55abfb?_0x55abfb[_0x2ee9('0x4')](''):[]);},'get':function(){return this[_0x2ee9('0x5')]('options')?this[_0x2ee9('0x5')](_0x2ee9('0x3'))[_0x2ee9('0x6')](''):[];}},'auth':{'type':Sequelize[_0x2ee9('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x2ee9('0x0')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ee9('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8ba84ca..80380a6 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 _0x6364=['sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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'];(function(_0x3cc740,_0x27dfd9){var _0x3a1d3e=function(_0x351f58){while(--_0x351f58){_0x3cc740['push'](_0x3cc740['shift']());}};_0x3a1d3e(++_0x27dfd9);}(_0x6364,0x8f));var _0x4636=function(_0x2e687b,_0x2b3a40){_0x2e687b=_0x2e687b-0x0;var _0x404282=_0x6364[_0x2e687b];return _0x404282;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4636('0x0'));var jsonpatch=require(_0x4636('0x1'));var rp=require(_0x4636('0x2'));var moment=require(_0x4636('0x3'));var BPromise=require(_0x4636('0x4'));var Mustache=require(_0x4636('0x5'));var util=require(_0x4636('0x6'));var path=require(_0x4636('0x7'));var sox=require('sox');var csv=require(_0x4636('0x8'));var ejs=require(_0x4636('0x9'));var fs=require('fs');var fs_extra=require(_0x4636('0xa'));var _=require(_0x4636('0xb'));var squel=require(_0x4636('0xc'));var crypto=require('crypto');var jsforce=require(_0x4636('0xd'));var deskjs=require(_0x4636('0xe'));var toCsv=require(_0x4636('0x8'));var querystring=require(_0x4636('0xf'));var Papa=require('papaparse');var Redis=require(_0x4636('0x10'));var authService=require(_0x4636('0x11'));var qs=require(_0x4636('0x12'));var as=require(_0x4636('0x13'));var hardwareService=require(_0x4636('0x14'));var logger=require('../../config/logger')(_0x4636('0x15'));var utils=require(_0x4636('0x16'));var config=require(_0x4636('0x17'));var licenseUtil=require(_0x4636('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ee0e,_0xa30deb){_0xa30deb=_0xa30deb||0xcc;return function(_0x26a363){if(_0x26a363){return _0x13ee0e[_0x4636('0x19')](_0xa30deb);}return _0x13ee0e[_0x4636('0x1a')](_0xa30deb)['end']();};}function respondWithResult(_0x5d59c8,_0x1b0436){_0x1b0436=_0x1b0436||0xc8;return function(_0x3eaf7a){if(_0x3eaf7a){return _0x5d59c8[_0x4636('0x1a')](_0x1b0436)[_0x4636('0x1b')](_0x3eaf7a);}};}function respondWithFilteredResult(_0x495fb9,_0x1e432f){return function(_0x2abb29){if(_0x2abb29){var _0x20859a=typeof _0x1e432f[_0x4636('0x1c')]===_0x4636('0x1d')&&typeof _0x1e432f[_0x4636('0x1e')]==='undefined';var _0xc04acf=_0x2abb29[_0x4636('0x1f')];var _0x3362ca=_0x20859a?0x0:_0x1e432f[_0x4636('0x1c')];var _0x5495dc=_0x20859a?_0x2abb29[_0x4636('0x1f')]:_0x1e432f['offset']+_0x1e432f['limit'];var _0x30f410;if(_0x5495dc>=_0xc04acf){_0x5495dc=_0xc04acf;_0x30f410=0xc8;}else{_0x30f410=0xce;}_0x495fb9[_0x4636('0x1a')](_0x30f410);return _0x495fb9['set'](_0x4636('0x20'),_0x3362ca+'-'+_0x5495dc+'/'+_0xc04acf)[_0x4636('0x1b')](_0x2abb29);}return null;};}function patchUpdates(_0x5a014c){return function(_0x34afd3){try{jsonpatch[_0x4636('0x21')](_0x34afd3,_0x5a014c,!![]);}catch(_0x51a2ec){return BPromise[_0x4636('0x22')](_0x51a2ec);}return _0x34afd3[_0x4636('0x23')]();};}function saveUpdates(_0x3dc87e,_0x5ae7c8){return function(_0x441a89){if(_0x441a89){return _0x441a89['update'](_0x3dc87e)[_0x4636('0x24')](function(_0x469027){return _0x469027;});}return null;};}function removeEntity(_0x3cd3d7,_0x9b2338){return function(_0x281223){if(_0x281223){return _0x281223[_0x4636('0x25')]()[_0x4636('0x24')](function(){var _0x428098=_0x281223[_0x4636('0x26')]({'plain':!![]});var _0x3d74d5=_0x4636('0x27');return db[_0x4636('0x28')][_0x4636('0x25')]({'where':{'type':_0x3d74d5,'resourceId':_0x428098['id']}})[_0x4636('0x24')](function(){return _0x281223;});})[_0x4636('0x24')](function(){_0x3cd3d7[_0x4636('0x1a')](0xcc)[_0x4636('0x29')]();});}};}function handleEntityNotFound(_0x3a7f91,_0x2d4df5){return function(_0x378a45){if(!_0x378a45){_0x3a7f91['sendStatus'](0x194);}return _0x378a45;};}function handleError(_0x3f51aa,_0x4bd69a){_0x4bd69a=_0x4bd69a||0x1f4;return function(_0x8dd8cf){logger[_0x4636('0x2a')](_0x8dd8cf[_0x4636('0x2b')]);if(_0x8dd8cf['name']){delete _0x8dd8cf['name'];}_0x3f51aa['status'](_0x4bd69a)[_0x4636('0x2c')](_0x8dd8cf);};}exports['index']=function(_0x4e0bc0,_0x4e893d){var _0x272b59={},_0x5f0260={},_0x5a7701={'count':0x0,'rows':[]};var _0x247551=_['map'](db[_0x4636('0x2d')][_0x4636('0x2e')],function(_0x64a49){return{'name':_0x64a49[_0x4636('0x2f')],'type':_0x64a49[_0x4636('0x30')][_0x4636('0x31')]};});_0x5f0260[_0x4636('0x32')]=_['map'](_0x247551,_0x4636('0x33'));_0x5f0260[_0x4636('0x34')]=_['keys'](_0x4e0bc0[_0x4636('0x34')]);_0x5f0260['filters']=_[_0x4636('0x35')](_0x5f0260[_0x4636('0x32')],_0x5f0260['query']);_0x272b59[_0x4636('0x36')]=_[_0x4636('0x35')](_0x5f0260[_0x4636('0x32')],qs['fields'](_0x4e0bc0[_0x4636('0x34')][_0x4636('0x37')]));_0x272b59[_0x4636('0x36')]=_0x272b59[_0x4636('0x36')][_0x4636('0x38')]?_0x272b59['attributes']:_0x5f0260[_0x4636('0x32')];if(!_0x4e0bc0[_0x4636('0x34')][_0x4636('0x39')]('nolimit')){_0x272b59['limit']=qs[_0x4636('0x1e')](_0x4e0bc0[_0x4636('0x34')]['limit']);_0x272b59[_0x4636('0x1c')]=qs[_0x4636('0x1c')](_0x4e0bc0[_0x4636('0x34')]['offset']);}_0x272b59[_0x4636('0x3a')]=qs['sort'](_0x4e0bc0[_0x4636('0x34')][_0x4636('0x3b')]);_0x272b59[_0x4636('0x3c')]=qs[_0x4636('0x3d')](_[_0x4636('0x3e')](_0x4e0bc0[_0x4636('0x34')],_0x5f0260[_0x4636('0x3d')]),_0x247551);if(_0x4e0bc0[_0x4636('0x34')]['filter']){_0x272b59['where']=_[_0x4636('0x3f')](_0x272b59['where'],{'$or':_[_0x4636('0x40')](_0x247551,function(_0x5f29c0){if(_0x5f29c0[_0x4636('0x30')]!=='VIRTUAL'){var _0x4ade78={};_0x4ade78[_0x5f29c0[_0x4636('0x33')]]={'$like':'%'+_0x4e0bc0[_0x4636('0x34')][_0x4636('0x41')]+'%'};return _0x4ade78;}})});}_0x272b59=_[_0x4636('0x3f')]({},_0x272b59,_0x4e0bc0[_0x4636('0x42')]);var _0x1c2c0b={'where':_0x272b59['where']};return db['VoiceChanSpy'][_0x4636('0x1f')](_0x1c2c0b)[_0x4636('0x24')](function(_0xbf5ef1){_0x5a7701['count']=_0xbf5ef1;if(_0x4e0bc0[_0x4636('0x34')]['includeAll']){_0x272b59[_0x4636('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x4636('0x44')](_0x272b59);})['then'](function(_0x17176c){_0x5a7701[_0x4636('0x45')]=_0x17176c;return _0x5a7701;})[_0x4636('0x24')](respondWithFilteredResult(_0x4e893d,_0x272b59))[_0x4636('0x46')](handleError(_0x4e893d,null));};exports[_0x4636('0x47')]=function(_0x1768fb,_0x573447){var _0x47344a={'raw':![],'where':{'id':_0x1768fb[_0x4636('0x48')]['id']}},_0x34be34={};_0x34be34[_0x4636('0x32')]=_['keys'](db[_0x4636('0x2d')]['rawAttributes']);_0x34be34['query']=_[_0x4636('0x49')](_0x1768fb['query']);_0x34be34[_0x4636('0x3d')]=_[_0x4636('0x35')](_0x34be34[_0x4636('0x32')],_0x34be34[_0x4636('0x34')]);_0x47344a['attributes']=_[_0x4636('0x35')](_0x34be34[_0x4636('0x32')],qs[_0x4636('0x37')](_0x1768fb[_0x4636('0x34')]['fields']));_0x47344a[_0x4636('0x36')]=_0x47344a[_0x4636('0x36')][_0x4636('0x38')]?_0x47344a[_0x4636('0x36')]:_0x34be34['model'];if(_0x1768fb[_0x4636('0x34')][_0x4636('0x4a')]){_0x47344a[_0x4636('0x43')]=[{'all':!![]}];}_0x47344a=_[_0x4636('0x3f')]({},_0x47344a,_0x1768fb['options']);return db[_0x4636('0x2d')][_0x4636('0x4b')](_0x47344a)[_0x4636('0x24')](handleEntityNotFound(_0x573447,null))['then'](respondWithResult(_0x573447,null))[_0x4636('0x46')](handleError(_0x573447,null));};exports[_0x4636('0x4c')]=function(_0x29acb1,_0x193bc8){return db[_0x4636('0x2d')][_0x4636('0x4c')](_0x29acb1[_0x4636('0x4d')],{})[_0x4636('0x24')](function(_0x3d979e){var _0x865cf0=_0x29acb1[_0x4636('0x4e')][_0x4636('0x26')]({'plain':!![]});if(!_0x865cf0)throw new Error(_0x4636('0x4f'));if(_0x865cf0[_0x4636('0x50')]===_0x4636('0x4e')){var _0x1864d0=_0x3d979e[_0x4636('0x26')]({'plain':!![]});var _0x18f28a=_0x4636('0x27');return db[_0x4636('0x51')][_0x4636('0x4b')]({'where':{'name':_0x18f28a,'userProfileId':_0x865cf0[_0x4636('0x52')]},'raw':!![]})[_0x4636('0x24')](function(_0x50bd5d){if(_0x50bd5d&&_0x50bd5d[_0x4636('0x53')]===0x0){return db['UserProfileResource'][_0x4636('0x4c')]({'name':_0x1864d0['name'],'resourceId':_0x1864d0['id'],'type':_0x50bd5d[_0x4636('0x33')],'sectionId':_0x50bd5d['id']},{})[_0x4636('0x24')](function(){return _0x3d979e;});}else{return _0x3d979e;}})[_0x4636('0x46')](function(_0x65cf2){logger[_0x4636('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x65cf2);throw _0x65cf2;});}return _0x3d979e;})[_0x4636('0x24')](respondWithResult(_0x193bc8,0xc9))[_0x4636('0x46')](handleError(_0x193bc8,null));};exports['update']=function(_0x2cfc5e,_0x237ff9){if(_0x2cfc5e['body']['id']){delete _0x2cfc5e[_0x4636('0x4d')]['id'];}return db[_0x4636('0x2d')][_0x4636('0x4b')]({'where':{'id':_0x2cfc5e[_0x4636('0x48')]['id']}})[_0x4636('0x24')](handleEntityNotFound(_0x237ff9,null))['then'](saveUpdates(_0x2cfc5e['body'],null))[_0x4636('0x24')](respondWithResult(_0x237ff9,null))[_0x4636('0x46')](handleError(_0x237ff9,null));};exports[_0x4636('0x25')]=function(_0x30c2ac,_0x14ee0e){return db['VoiceChanSpy'][_0x4636('0x4b')]({'where':{'id':_0x30c2ac[_0x4636('0x48')]['id']}})[_0x4636('0x24')](handleEntityNotFound(_0x14ee0e,null))['then'](removeEntity(_0x14ee0e,null))[_0x4636('0x46')](handleError(_0x14ee0e,null));}; \ No newline at end of file +var _0x3c81=['request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch'];(function(_0x12cb52,_0x5a47df){var _0x4c6e91=function(_0x563302){while(--_0x563302){_0x12cb52['push'](_0x12cb52['shift']());}};_0x4c6e91(++_0x5a47df);}(_0x3c81,0x102));var _0x13c8=function(_0x43dbff,_0x27cc65){_0x43dbff=_0x43dbff-0x0;var _0x13c506=_0x3c81[_0x43dbff];return _0x13c506;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){var _0x49b552=_0x1770e5[_0x13c8('0x28')]({'plain':!![]});var _0x4aff35='ChanSpies';return db['UserProfileResource'][_0x13c8('0x27')]({'where':{'type':_0x4aff35,'resourceId':_0x49b552['id']}})[_0x13c8('0x26')](function(){return _0x1770e5;});})['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x29')]();});}};}function handleEntityNotFound(_0x596166,_0x545b47){return function(_0x1c7dc4){if(!_0x1c7dc4){_0x596166[_0x13c8('0x19')](0x194);}return _0x1c7dc4;};}function handleError(_0x34fdbe,_0x560ede){_0x560ede=_0x560ede||0x1f4;return function(_0x5ef2f7){logger[_0x13c8('0x2a')](_0x5ef2f7[_0x13c8('0x2b')]);if(_0x5ef2f7[_0x13c8('0x2c')]){delete _0x5ef2f7[_0x13c8('0x2c')];}_0x34fdbe[_0x13c8('0x1a')](_0x560ede)[_0x13c8('0x2d')](_0x5ef2f7);};}exports[_0x13c8('0x2e')]=function(_0x4a1b9c,_0x109cb8){var _0xcbc9b7={},_0x5a5911={},_0x5c85e4={'count':0x0,'rows':[]};var _0x23a725=_[_0x13c8('0x2f')](db['VoiceChanSpy'][_0x13c8('0x30')],function(_0x355ddc){return{'name':_0x355ddc['fieldName'],'type':_0x355ddc[_0x13c8('0x31')][_0x13c8('0x32')]};});_0x5a5911[_0x13c8('0x33')]=_[_0x13c8('0x2f')](_0x23a725,_0x13c8('0x2c'));_0x5a5911[_0x13c8('0x34')]=_[_0x13c8('0x35')](_0x4a1b9c[_0x13c8('0x34')]);_0x5a5911['filters']=_['intersection'](_0x5a5911[_0x13c8('0x33')],_0x5a5911[_0x13c8('0x34')]);_0xcbc9b7['attributes']=_[_0x13c8('0x36')](_0x5a5911['model'],qs[_0x13c8('0x37')](_0x4a1b9c['query'][_0x13c8('0x37')]));_0xcbc9b7[_0x13c8('0x38')]=_0xcbc9b7[_0x13c8('0x38')][_0x13c8('0x39')]?_0xcbc9b7[_0x13c8('0x38')]:_0x5a5911[_0x13c8('0x33')];if(!_0x4a1b9c[_0x13c8('0x34')]['hasOwnProperty'](_0x13c8('0x3a'))){_0xcbc9b7[_0x13c8('0x1d')]=qs['limit'](_0x4a1b9c[_0x13c8('0x34')][_0x13c8('0x1d')]);_0xcbc9b7[_0x13c8('0x1c')]=qs['offset'](_0x4a1b9c['query']['offset']);}_0xcbc9b7[_0x13c8('0x3b')]=qs[_0x13c8('0x3c')](_0x4a1b9c[_0x13c8('0x34')][_0x13c8('0x3c')]);_0xcbc9b7[_0x13c8('0x3d')]=qs[_0x13c8('0x3e')](_[_0x13c8('0x3f')](_0x4a1b9c[_0x13c8('0x34')],_0x5a5911[_0x13c8('0x3e')]),_0x23a725);if(_0x4a1b9c['query']['filter']){_0xcbc9b7[_0x13c8('0x3d')]=_[_0x13c8('0x40')](_0xcbc9b7[_0x13c8('0x3d')],{'$or':_[_0x13c8('0x2f')](_0x23a725,function(_0x4f1bed){if(_0x4f1bed[_0x13c8('0x31')]!=='VIRTUAL'){var _0x343dba={};_0x343dba[_0x4f1bed[_0x13c8('0x2c')]]={'$like':'%'+_0x4a1b9c[_0x13c8('0x34')][_0x13c8('0x41')]+'%'};return _0x343dba;}})});}_0xcbc9b7=_[_0x13c8('0x40')]({},_0xcbc9b7,_0x4a1b9c[_0x13c8('0x42')]);var _0xb272c0={'where':_0xcbc9b7[_0x13c8('0x3d')]};return db[_0x13c8('0x43')][_0x13c8('0x1f')](_0xb272c0)[_0x13c8('0x26')](function(_0x416169){_0x5c85e4[_0x13c8('0x1f')]=_0x416169;if(_0x4a1b9c[_0x13c8('0x34')][_0x13c8('0x44')]){_0xcbc9b7[_0x13c8('0x45')]=[{'all':!![]}];}return db[_0x13c8('0x43')][_0x13c8('0x46')](_0xcbc9b7);})[_0x13c8('0x26')](function(_0x1cff99){_0x5c85e4[_0x13c8('0x47')]=_0x1cff99;return _0x5c85e4;})[_0x13c8('0x26')](respondWithFilteredResult(_0x109cb8,_0xcbc9b7))[_0x13c8('0x48')](handleError(_0x109cb8,null));};exports[_0x13c8('0x49')]=function(_0x44ee66,_0x57e65f){var _0x3ef04e={'raw':![],'where':{'id':_0x44ee66[_0x13c8('0x4a')]['id']}},_0x3fcb7f={};_0x3fcb7f[_0x13c8('0x33')]=_[_0x13c8('0x35')](db['VoiceChanSpy']['rawAttributes']);_0x3fcb7f[_0x13c8('0x34')]=_[_0x13c8('0x35')](_0x44ee66[_0x13c8('0x34')]);_0x3fcb7f['filters']=_['intersection'](_0x3fcb7f['model'],_0x3fcb7f[_0x13c8('0x34')]);_0x3ef04e['attributes']=_[_0x13c8('0x36')](_0x3fcb7f['model'],qs[_0x13c8('0x37')](_0x44ee66[_0x13c8('0x34')][_0x13c8('0x37')]));_0x3ef04e[_0x13c8('0x38')]=_0x3ef04e[_0x13c8('0x38')][_0x13c8('0x39')]?_0x3ef04e['attributes']:_0x3fcb7f[_0x13c8('0x33')];if(_0x44ee66[_0x13c8('0x34')]['includeAll']){_0x3ef04e[_0x13c8('0x45')]=[{'all':!![]}];}_0x3ef04e=_[_0x13c8('0x40')]({},_0x3ef04e,_0x44ee66[_0x13c8('0x42')]);return db[_0x13c8('0x43')][_0x13c8('0x4b')](_0x3ef04e)['then'](handleEntityNotFound(_0x57e65f,null))[_0x13c8('0x26')](respondWithResult(_0x57e65f,null))[_0x13c8('0x48')](handleError(_0x57e65f,null));};exports[_0x13c8('0x4c')]=function(_0x38418b,_0x185d18){return db['VoiceChanSpy'][_0x13c8('0x4c')](_0x38418b[_0x13c8('0x4d')],{})[_0x13c8('0x26')](function(_0x6b042b){var _0x2d4f87=_0x38418b[_0x13c8('0x4e')][_0x13c8('0x28')]({'plain':!![]});if(!_0x2d4f87)throw new Error(_0x13c8('0x4f'));if(_0x2d4f87[_0x13c8('0x50')]===_0x13c8('0x4e')){var _0x266f4e=_0x6b042b['get']({'plain':!![]});var _0x10ba7c=_0x13c8('0x51');return db[_0x13c8('0x52')][_0x13c8('0x4b')]({'where':{'name':_0x10ba7c,'userProfileId':_0x2d4f87[_0x13c8('0x53')]},'raw':!![]})[_0x13c8('0x26')](function(_0x48b7f6){if(_0x48b7f6&&_0x48b7f6[_0x13c8('0x54')]===0x0){return db[_0x13c8('0x55')][_0x13c8('0x4c')]({'name':_0x266f4e['name'],'resourceId':_0x266f4e['id'],'type':_0x48b7f6['name'],'sectionId':_0x48b7f6['id']},{})[_0x13c8('0x26')](function(){return _0x6b042b;});}else{return _0x6b042b;}})[_0x13c8('0x48')](function(_0x55d353){logger[_0x13c8('0x2a')](_0x13c8('0x56'),_0x55d353);throw _0x55d353;});}return _0x6b042b;})['then'](respondWithResult(_0x185d18,0xc9))[_0x13c8('0x48')](handleError(_0x185d18,null));};exports['update']=function(_0x242791,_0x1f67bd){if(_0x242791[_0x13c8('0x4d')]['id']){delete _0x242791['body']['id'];}return db[_0x13c8('0x43')][_0x13c8('0x4b')]({'where':{'id':_0x242791['params']['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x1f67bd,null))['then'](saveUpdates(_0x242791[_0x13c8('0x4d')],null))[_0x13c8('0x26')](respondWithResult(_0x1f67bd,null))[_0x13c8('0x48')](handleError(_0x1f67bd,null));};exports[_0x13c8('0x27')]=function(_0x3760e4,_0x5f4884){return db[_0x13c8('0x43')]['find']({'where':{'id':_0x3760e4['params']['id']}})['then'](handleEntityNotFound(_0x5f4884,null))['then'](removeEntity(_0x5f4884,null))['catch'](handleError(_0x5f4884,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e7eb6be..bace4bf 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 _0x075a=['system','merge','Set','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','User','findAll','catch','exports','models','define','VoiceChanSpy','then','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix'];(function(_0xbed308,_0x3528d0){var _0x5123fc=function(_0x44844b){while(--_0x44844b){_0xbed308['push'](_0xbed308['shift']());}};_0x5123fc(++_0x3528d0);}(_0x075a,0x17d));var _0xa075=function(_0x2f1272,_0x399984){_0x2f1272=_0x2f1272-0x0;var _0x87ad25=_0x075a[_0x2f1272];return _0x87ad25;};'use strict';var _=require(_0xa075('0x0'));var util=require(_0xa075('0x1'));var BPromise=require(_0xa075('0x2'));var attributes=require(_0xa075('0x3'));var getUserApplications=function(_0xcd9dbc,_0x1a0c63,_0x3915f8){var _0x5af5ee=0x1;var _0x21c9b0=[];var _0x348954={'context':_0x1a0c63[_0xa075('0x4')]||_0xa075('0x5'),'exten':util[_0xa075('0x6')](_0xa075('0x7'),_0xcd9dbc[_0xa075('0x8')],_0x3915f8),'type':_0xa075('0x9'),'isApp':![],'ChanSpyId':_0xcd9dbc['id'],'UserId':_0x1a0c63['id']};_0x21c9b0['push'](_[_0xa075('0xa')]({'app':_0xa075('0xb'),'appdata':util[_0xa075('0x6')]('CDR(type)=%s',_0xa075('0xc')),'priority':_0x5af5ee++},_0x348954));if(_0xcd9dbc[_0xa075('0xd')]){_0x21c9b0[_0xa075('0xe')](_['merge']({'app':_0xa075('0xf'),'appdata':util[_0xa075('0x6')](_0xa075('0x10'),_0xcd9dbc['recordingFormat']),'priority':_0x5af5ee++},_0x348954));}if(_0xcd9dbc[_0xa075('0x11')]){_0x21c9b0[_0xa075('0xe')](_[_0xa075('0xa')]({'app':_0xa075('0x12'),'appdata':_0xcd9dbc[_0xa075('0x13')],'priority':_0x5af5ee++},_0x348954));}_0x21c9b0[_0xa075('0xe')](_[_0xa075('0xa')]({'app':_0xa075('0x14'),'appdata':util[_0xa075('0x6')](_0xa075('0x15'),_0x1a0c63[_0xa075('0x16')],_0xcd9dbc[_0xa075('0x17')]?_0xcd9dbc[_0xa075('0x17')][_0xa075('0x18')](''):''),'priority':_0x5af5ee++},_0x348954));if(_0xcd9dbc['record']){_0x21c9b0[_0xa075('0xe')](_[_0xa075('0xa')]({'app':_0xa075('0x19'),'priority':_0x5af5ee++},_0x348954));}return _0x21c9b0;};var getChanSpyApplications=function(_0x1f1c65,_0x482981){var _0x78f76a=[];for(var _0x2d3fdc=0x0,_0x55addb=0x1;_0x2d3fdc<_0x482981[_0xa075('0x1a')];_0x2d3fdc++,_0x55addb=0x1){_0x78f76a=_0x78f76a['concat'](getUserApplications(_0x1f1c65,_0x482981[_0x2d3fdc],_0x482981[_0x2d3fdc][_0xa075('0x1b')]));if(_0x482981[_0x2d3fdc][_0xa075('0x1b')]!=_0x482981[_0x2d3fdc]['name']){_0x78f76a=_0x78f76a['concat'](getUserApplications(_0x1f1c65,_0x482981[_0x2d3fdc],_0x482981[_0x2d3fdc]['name']));}}return _0x78f76a;};var getChanSpyPromise=function(_0x29a7bd,_0x26c61c){return new BPromise(function(_0x1e4402,_0x94847d){return _0x29a7bd[_0xa075('0x1c')][_0xa075('0x1d')]({'attributes':['id','name',_0xa075('0x1b')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x4c3e3e){if(_0x4c3e3e){return _0x1e4402(getChanSpyApplications(_0x26c61c,_0x4c3e3e));}return _0x1e4402([]);})[_0xa075('0x1e')](function(_0xf7855){_0x94847d(_0xf7855);});});};module[_0xa075('0x1f')]=function(_0x5ee620,_0xe9f750){var _0x5b8424=_0x5ee620[_0xa075('0x20')];return _0x5ee620[_0xa075('0x21')](_0xa075('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b2b4c,_0x51d9ba,_0x512c19){return getChanSpyPromise(_0x5b8424,_0x4b2b4c)[_0xa075('0x23')](function(_0x3cccef){if(_0x3cccef&&_0x3cccef[_0xa075('0x1a')]){return _0x5b8424[_0xa075('0x24')][_0xa075('0x25')](_0x3cccef);}})[_0xa075('0x23')](function(){_0x512c19();})[_0xa075('0x1e')](function(_0x2b9e05){_0x512c19(_0x2b9e05);});},'afterUpdate':function(_0x169eb7,_0x3b91be,_0x4e5419){return _0x5b8424[_0xa075('0x24')][_0xa075('0x26')]({'where':{'ChanSpyId':_0x169eb7['id']}})[_0xa075('0x23')](function(){return getChanSpyPromise(_0x5b8424,_0x169eb7);})['then'](function(_0x48c064){if(_0x48c064&&_0x48c064['length']){return _0x5b8424[_0xa075('0x24')][_0xa075('0x25')](_0x48c064);}})[_0xa075('0x23')](function(){_0x4e5419();})[_0xa075('0x1e')](function(_0x245aed){_0x4e5419(_0x245aed);});},'afterDestroy':function(_0x55275d,_0x2ef599,_0x1cf847){return _0x5b8424[_0xa075('0x24')]['destroy']({'where':{'ChanSpyId':_0x55275d['id']}})['then'](function(){_0x1cf847();})['catch'](function(_0x357e8c){_0x1cf847(_0x357e8c);});}}});}; \ No newline at end of file +var _0x0309=['exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','from-sip','format','%s%s','prefix','system','merge','record','MixMonitor','recordingFormat','auth','push','Authenticate','ChanSpy','SIP/%s,%s','options','StopMixMonitor','internal','concat','User','findAll','agent','then','catch'];(function(_0xd40e15,_0x54e8de){var _0x1159c=function(_0x1ab8bb){while(--_0x1ab8bb){_0xd40e15['push'](_0xd40e15['shift']());}};_0x1159c(++_0x54e8de);}(_0x0309,0x1d0));var _0x9030=function(_0x5864d8,_0x514433){_0x5864d8=_0x5864d8-0x0;var _0x465a34=_0x0309[_0x5864d8];return _0x465a34;};'use strict';var _=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var BPromise=require(_0x9030('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x1fa5b0,_0xda82e9,_0x5b7b24){var _0x7b69eb=0x1;var _0x581d21=[];var _0x567845={'context':_0xda82e9['context']||_0x9030('0x3'),'exten':util[_0x9030('0x4')](_0x9030('0x5'),_0x1fa5b0[_0x9030('0x6')],_0x5b7b24),'type':_0x9030('0x7'),'isApp':![],'ChanSpyId':_0x1fa5b0['id'],'UserId':_0xda82e9['id']};_0x581d21['push'](_[_0x9030('0x8')]({'app':'Set','appdata':util[_0x9030('0x4')]('CDR(type)=%s','chanspy'),'priority':_0x7b69eb++},_0x567845));if(_0x1fa5b0[_0x9030('0x9')]){_0x581d21['push'](_[_0x9030('0x8')]({'app':_0x9030('0xa'),'appdata':util[_0x9030('0x4')]('${UNIQUEID}.%s,a',_0x1fa5b0[_0x9030('0xb')]),'priority':_0x7b69eb++},_0x567845));}if(_0x1fa5b0[_0x9030('0xc')]){_0x581d21[_0x9030('0xd')](_[_0x9030('0x8')]({'app':_0x9030('0xe'),'appdata':_0x1fa5b0['password'],'priority':_0x7b69eb++},_0x567845));}_0x581d21['push'](_[_0x9030('0x8')]({'app':_0x9030('0xf'),'appdata':util['format'](_0x9030('0x10'),_0xda82e9['name'],_0x1fa5b0[_0x9030('0x11')]?_0x1fa5b0[_0x9030('0x11')]['join'](''):''),'priority':_0x7b69eb++},_0x567845));if(_0x1fa5b0[_0x9030('0x9')]){_0x581d21[_0x9030('0xd')](_['merge']({'app':_0x9030('0x12'),'priority':_0x7b69eb++},_0x567845));}return _0x581d21;};var getChanSpyApplications=function(_0x185dba,_0x15bb97){var _0x4b68a4=[];for(var _0x244929=0x0,_0x38ddf7=0x1;_0x244929<_0x15bb97['length'];_0x244929++,_0x38ddf7=0x1){_0x4b68a4=_0x4b68a4['concat'](getUserApplications(_0x185dba,_0x15bb97[_0x244929],_0x15bb97[_0x244929][_0x9030('0x13')]));if(_0x15bb97[_0x244929][_0x9030('0x13')]!=_0x15bb97[_0x244929]['name']){_0x4b68a4=_0x4b68a4[_0x9030('0x14')](getUserApplications(_0x185dba,_0x15bb97[_0x244929],_0x15bb97[_0x244929]['name']));}}return _0x4b68a4;};var getChanSpyPromise=function(_0x1853fd,_0x5e3815){return new BPromise(function(_0xb522c3,_0x12a151){return _0x1853fd[_0x9030('0x15')][_0x9030('0x16')]({'attributes':['id','name',_0x9030('0x13')],'where':{'role':_0x9030('0x17'),'chanspy':!![]},'raw':!![]})[_0x9030('0x18')](function(_0xdeb39){if(_0xdeb39){return _0xb522c3(getChanSpyApplications(_0x5e3815,_0xdeb39));}return _0xb522c3([]);})[_0x9030('0x19')](function(_0x39d971){_0x12a151(_0x39d971);});});};module[_0x9030('0x1a')]=function(_0x187668,_0x459c4f){var _0x2e4e14=_0x187668[_0x9030('0x1b')];return _0x187668[_0x9030('0x1c')](_0x9030('0x1d'),attributes,{'tableName':_0x9030('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x11e6d7,_0xd2804f,_0x4154ef){return getChanSpyPromise(_0x2e4e14,_0x11e6d7)['then'](function(_0x6a32ca){if(_0x6a32ca&&_0x6a32ca[_0x9030('0x1f')]){return _0x2e4e14[_0x9030('0x20')][_0x9030('0x21')](_0x6a32ca);}})['then'](function(){_0x4154ef();})[_0x9030('0x19')](function(_0x396946){_0x4154ef(_0x396946);});},'afterUpdate':function(_0x4d2964,_0x2b02a7,_0x12fed6){return _0x2e4e14[_0x9030('0x20')][_0x9030('0x22')]({'where':{'ChanSpyId':_0x4d2964['id']}})['then'](function(){return getChanSpyPromise(_0x2e4e14,_0x4d2964);})[_0x9030('0x18')](function(_0x22da21){if(_0x22da21&&_0x22da21[_0x9030('0x1f')]){return _0x2e4e14['VoiceExtension']['bulkCreate'](_0x22da21);}})[_0x9030('0x18')](function(){_0x12fed6();})[_0x9030('0x19')](function(_0x4f64ad){_0x12fed6(_0x4f64ad);});},'afterDestroy':function(_0x310e7d,_0x5bf4d1,_0x23b440){return _0x2e4e14[_0x9030('0x20')][_0x9030('0x22')]({'where':{'ChanSpyId':_0x310e7d['id']}})['then'](function(){_0x23b440();})[_0x9030('0x19')](function(_0x307485){_0x23b440(_0x307485);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e1b7e32..c6d75e2 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 _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2f3103,_0x34ed85){var _0x58a697=function(_0x1d46a8){while(--_0x1d46a8){_0x2f3103['push'](_0x2f3103['shift']());}};_0x58a697(++_0x34ed85);}(_0x668b,0x140));var _0xb668=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0x668b[_0x284bc3];return _0x41ac81;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file +var _0x7980=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x581656,_0x59f902){var _0x2e429b=function(_0x5a1783){while(--_0x5a1783){_0x581656['push'](_0x581656['shift']());}};_0x2e429b(++_0x59f902);}(_0x7980,0xab));var _0x0798=function(_0x31ebf6,_0x20ee80){_0x31ebf6=_0x31ebf6-0x0;var _0x2a6841=_0x7980[_0x31ebf6];return _0x2a6841;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 6fe4abf..36448ec 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 _0xc513=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create','delete','destroy','multer','path','express','Router'];(function(_0x565dff,_0x1c2a7c){var _0x12ca3c=function(_0x3bcb13){while(--_0x3bcb13){_0x565dff['push'](_0x565dff['shift']());}};_0x12ca3c(++_0x1c2a7c);}(_0xc513,0xb2));var _0x3c51=function(_0x27bd5f,_0x38b38a){_0x27bd5f=_0x27bd5f-0x0;var _0x2b8963=_0xc513[_0x27bd5f];return _0x2b8963;};'use strict';var multer=require(_0x3c51('0x0'));var util=require('util');var path=require(_0x3c51('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c51('0x2'));var router=express[_0x3c51('0x3')]();var fs_extra=require(_0x3c51('0x4'));var auth=require(_0x3c51('0x5'));var interaction=require(_0x3c51('0x6'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x3c51('0x7')]('/',auth[_0x3c51('0x8')](),controller['index']);router['get'](_0x3c51('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3c51('0xa')]('/',auth[_0x3c51('0x8')](),controller[_0x3c51('0xb')]);router['put']('/:id',auth[_0x3c51('0x8')](),controller['update']);router[_0x3c51('0xc')]('/:id',auth[_0x3c51('0x8')](),controller[_0x3c51('0xd')]);module['exports']=router; \ No newline at end of file +var _0xe806=['delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x395c78,_0xcbf3c2){var _0x40773c=function(_0x81eaa9){while(--_0x81eaa9){_0x395c78['push'](_0x395c78['shift']());}};_0x40773c(++_0xcbf3c2);}(_0xe806,0x152));var _0x6e80=function(_0x390b71,_0x331576){_0x390b71=_0x390b71-0x0;var _0x192d82=_0xe806[_0x390b71];return _0x192d82;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6e80('0x0'));var router=express[_0x6e80('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x6e80('0x2'));var interaction=require(_0x6e80('0x3'));var config=require('../../config/environment');var controller=require(_0x6e80('0x4'));router[_0x6e80('0x5')]('/',auth[_0x6e80('0x6')](),controller[_0x6e80('0x7')]);router[_0x6e80('0x5')]('/:id',auth[_0x6e80('0x6')](),controller[_0x6e80('0x8')]);router[_0x6e80('0x9')]('/',auth[_0x6e80('0x6')](),controller[_0x6e80('0xa')]);router[_0x6e80('0xb')](_0x6e80('0xc'),auth[_0x6e80('0x6')](),controller[_0x6e80('0xd')]);router[_0x6e80('0xe')](_0x6e80('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e80('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7cfc036..be724b3 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 _0xfb5e=['STRING','exports'];(function(_0x733e23,_0x322d5b){var _0x8eb5f7=function(_0x3090ae){while(--_0x3090ae){_0x733e23['push'](_0x733e23['shift']());}};_0x8eb5f7(++_0x322d5b);}(_0xfb5e,0x89));var _0xefb5=function(_0x5dac46,_0x28e9dc){_0x5dac46=_0x5dac46-0x0;var _0x51095c=_0xfb5e[_0x5dac46];return _0x51095c;};'use strict';var Sequelize=require('sequelize');module[_0xefb5('0x0')]={'name':{'type':Sequelize[_0xefb5('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xefb5('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x078a=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x49dc15,_0x147ac6){var _0x44abda=function(_0xe276e4){while(--_0xe276e4){_0x49dc15['push'](_0x49dc15['shift']());}};_0x44abda(++_0x147ac6);}(_0x078a,0x195));var _0xa078=function(_0x1d658a,_0x280a68){_0x1d658a=_0x1d658a-0x0;var _0x5b627f=_0x078a[_0x1d658a];return _0x5b627f;};'use strict';var Sequelize=require(_0xa078('0x0'));module[_0xa078('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa078('0x2')},'description':{'type':Sequelize[_0xa078('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa078('0x4')],'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 cb7063f..62e5d71 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 _0x363b=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','readFileSync','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','join','root','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x128173,_0x19f9e5){var _0x48866f=function(_0x3563ee){while(--_0x3563ee){_0x128173['push'](_0x128173['shift']());}};_0x48866f(++_0x19f9e5);}(_0x363b,0x1b0));var _0xb363=function(_0x5ed04a,_0x4e2a7b){_0x5ed04a=_0x5ed04a-0x0;var _0x2ad468=_0x363b[_0x5ed04a];return _0x2ad468;};'use strict';var emlformat=require(_0xb363('0x0'));var rimraf=require(_0xb363('0x1'));var zipdir=require(_0xb363('0x2'));var jsonpatch=require(_0xb363('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb363('0x4'));var Mustache=require(_0xb363('0x5'));var util=require(_0xb363('0x6'));var path=require(_0xb363('0x7'));var sox=require(_0xb363('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb363('0x9'));var _=require('lodash');var squel=require(_0xb363('0xa'));var crypto=require('crypto');var jsforce=require(_0xb363('0xb'));var deskjs=require(_0xb363('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb363('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb363('0xe'));var logger=require('../../config/logger')(_0xb363('0xf'));var utils=require(_0xb363('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb363('0x11'));var db=require(_0xb363('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb363('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x4ae841,_0x19a4cc,_0xe70b0a,_0x15182a){return new BPromise(function(_0x58f2d9,_0x4bd72b){var _0x57f87a=_0x15182a||client;return _0x57f87a['request'](_0x4ae841,_0xe70b0a)[_0xb363('0x14')](function(_0x24bfae){logger[_0xb363('0x15')](_0xb363('0x16'),_0x19a4cc,_0xb363('0x17'));logger[_0xb363('0x18')](_0xb363('0x19'),_0x19a4cc,_0xb363('0x17'),JSON[_0xb363('0x1a')](_0x24bfae));if(_0x24bfae[_0xb363('0x1b')]){if(_0x24bfae[_0xb363('0x1b')][_0xb363('0x1c')]===0x1f4){logger[_0xb363('0x1b')](_0xb363('0x16'),_0x19a4cc,_0x24bfae[_0xb363('0x1b')][_0xb363('0x1d')]);return _0x4bd72b(_0x24bfae['error'][_0xb363('0x1d')]);}logger[_0xb363('0x1b')](_0xb363('0x16'),_0x19a4cc,_0x24bfae['error']['message']);return _0x58f2d9(_0x24bfae[_0xb363('0x1b')][_0xb363('0x1d')]);}else{logger['info'](_0xb363('0x16'),_0x19a4cc,_0xb363('0x17'));_0x58f2d9(_0x24bfae[_0xb363('0x1e')][_0xb363('0x1d')]);}})[_0xb363('0x1f')](function(_0x141ac3){logger[_0xb363('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x19a4cc,_0x141ac3);_0x4bd72b(_0x141ac3);});});}function respondWithStatusCode(_0x88b338,_0x220884){_0x220884=_0x220884||0xcc;return function(_0x2ee14c){if(_0x2ee14c){return _0x88b338[_0xb363('0x20')](_0x220884);}return _0x88b338[_0xb363('0x21')](_0x220884)[_0xb363('0x22')]();};}function respondWithResult(_0x564ad2,_0x4d4631){_0x4d4631=_0x4d4631||0xc8;return function(_0x1627cb){if(_0x1627cb){return _0x564ad2[_0xb363('0x21')](_0x4d4631)[_0xb363('0x23')](_0x1627cb);}};}function respondWithFilteredResult(_0xedbc21,_0x3bf603){return function(_0x139016){if(_0x139016){var _0x26c4f5=typeof _0x3bf603[_0xb363('0x24')]===_0xb363('0x25')&&typeof _0x3bf603['limit']===_0xb363('0x25');var _0x5558aa=_0x139016['count'];var _0x16c1ce=_0x26c4f5?0x0:_0x3bf603[_0xb363('0x24')];var _0x573599=_0x26c4f5?_0x139016[_0xb363('0x26')]:_0x3bf603[_0xb363('0x24')]+_0x3bf603[_0xb363('0x27')];var _0x284cf3;if(_0x573599>=_0x5558aa){_0x573599=_0x5558aa;_0x284cf3=0xc8;}else{_0x284cf3=0xce;}_0xedbc21[_0xb363('0x21')](_0x284cf3);return _0xedbc21[_0xb363('0x28')](_0xb363('0x29'),_0x16c1ce+'-'+_0x573599+'/'+_0x5558aa)[_0xb363('0x23')](_0x139016);}return null;};}function patchUpdates(_0x2926ce){return function(_0x45f028){try{jsonpatch['apply'](_0x45f028,_0x2926ce,!![]);}catch(_0xfa555f){return BPromise[_0xb363('0x2a')](_0xfa555f);}return _0x45f028[_0xb363('0x2b')]();};}function saveUpdates(_0x38410b,_0x39135a){return function(_0x2a7458){if(_0x2a7458){return _0x2a7458[_0xb363('0x2c')](_0x38410b)[_0xb363('0x14')](function(_0x5009f9){return _0x5009f9;});}return null;};}function removeEntity(_0x5df5a6,_0x273dd6){return function(_0x71b5d8){if(_0x71b5d8){return _0x71b5d8[_0xb363('0x2d')]()[_0xb363('0x14')](function(){var _0x7eb6dd=_0x71b5d8[_0xb363('0x2e')]({'plain':!![]});var _0x649763=_0xb363('0x2f');return db[_0xb363('0x30')][_0xb363('0x2d')]({'where':{'type':_0x649763,'resourceId':_0x7eb6dd['id']}})['then'](function(){return _0x71b5d8;});})[_0xb363('0x14')](function(){_0x5df5a6[_0xb363('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313513,_0x42942f){return function(_0x263a23){if(!_0x263a23){_0x313513[_0xb363('0x20')](0x194);}return _0x263a23;};}function handleError(_0x4e0848,_0x535775){_0x535775=_0x535775||0x1f4;return function(_0x5c99d6){logger[_0xb363('0x1b')](_0x5c99d6[_0xb363('0x31')]);if(_0x5c99d6[_0xb363('0x32')]){delete _0x5c99d6[_0xb363('0x32')];}_0x4e0848['status'](_0x535775)[_0xb363('0x33')](_0x5c99d6);};}exports[_0xb363('0x34')]=function(_0x512c16,_0x2060eb){var _0xfcf11c={},_0x58ab35={},_0x4563b6={'count':0x0,'rows':[]};var _0x755353=_['map'](db[_0xb363('0x35')][_0xb363('0x36')],function(_0x41c399){return{'name':_0x41c399[_0xb363('0x37')],'type':_0x41c399['type'][_0xb363('0x38')]};});_0x58ab35[_0xb363('0x39')]=_[_0xb363('0x3a')](_0x755353,_0xb363('0x32'));_0x58ab35[_0xb363('0x3b')]=_[_0xb363('0x3c')](_0x512c16['query']);_0x58ab35[_0xb363('0x3d')]=_[_0xb363('0x3e')](_0x58ab35[_0xb363('0x39')],_0x58ab35[_0xb363('0x3b')]);_0xfcf11c[_0xb363('0x3f')]=_[_0xb363('0x3e')](_0x58ab35[_0xb363('0x39')],qs[_0xb363('0x40')](_0x512c16[_0xb363('0x3b')][_0xb363('0x40')]));_0xfcf11c[_0xb363('0x3f')]=_0xfcf11c[_0xb363('0x3f')][_0xb363('0x41')]?_0xfcf11c['attributes']:_0x58ab35[_0xb363('0x39')];if(!_0x512c16['query'][_0xb363('0x42')](_0xb363('0x43'))){_0xfcf11c[_0xb363('0x27')]=qs[_0xb363('0x27')](_0x512c16[_0xb363('0x3b')]['limit']);_0xfcf11c['offset']=qs[_0xb363('0x24')](_0x512c16[_0xb363('0x3b')][_0xb363('0x24')]);}_0xfcf11c['order']=qs[_0xb363('0x44')](_0x512c16[_0xb363('0x3b')]['sort']);_0xfcf11c[_0xb363('0x45')]=qs['filters'](_['pick'](_0x512c16[_0xb363('0x3b')],_0x58ab35[_0xb363('0x3d')]),_0x755353);if(_0x512c16[_0xb363('0x3b')][_0xb363('0x46')]){_0xfcf11c[_0xb363('0x45')]=_[_0xb363('0x47')](_0xfcf11c[_0xb363('0x45')],{'$or':_['map'](_0x755353,function(_0x4f07e7){if(_0x4f07e7[_0xb363('0x48')]!==_0xb363('0x49')){var _0x2dc81a={};_0x2dc81a[_0x4f07e7[_0xb363('0x32')]]={'$like':'%'+_0x512c16['query'][_0xb363('0x46')]+'%'};return _0x2dc81a;}})});}_0xfcf11c=_[_0xb363('0x47')]({},_0xfcf11c,_0x512c16[_0xb363('0x4a')]);var _0x5064ca={'where':_0xfcf11c['where']};return db[_0xb363('0x35')][_0xb363('0x26')](_0x5064ca)['then'](function(_0x5c93c9){_0x4563b6['count']=_0x5c93c9;if(_0x512c16[_0xb363('0x3b')][_0xb363('0x4b')]){_0xfcf11c['include']=[{'all':!![]}];}return db[_0xb363('0x35')][_0xb363('0x4c')](_0xfcf11c);})[_0xb363('0x14')](function(_0x1454fa){_0x4563b6[_0xb363('0x4d')]=_0x1454fa;return _0x4563b6;})[_0xb363('0x14')](respondWithFilteredResult(_0x2060eb,_0xfcf11c))[_0xb363('0x1f')](handleError(_0x2060eb,null));};exports[_0xb363('0x4e')]=function(_0x268625,_0x579dab){var _0x3577ae={'raw':![],'where':{'id':_0x268625['params']['id']}},_0x163dd7={};_0x163dd7['model']=_[_0xb363('0x3c')](db[_0xb363('0x35')][_0xb363('0x36')]);_0x163dd7[_0xb363('0x3b')]=_[_0xb363('0x3c')](_0x268625[_0xb363('0x3b')]);_0x163dd7[_0xb363('0x3d')]=_[_0xb363('0x3e')](_0x163dd7[_0xb363('0x39')],_0x163dd7[_0xb363('0x3b')]);_0x3577ae[_0xb363('0x3f')]=_[_0xb363('0x3e')](_0x163dd7[_0xb363('0x39')],qs[_0xb363('0x40')](_0x268625[_0xb363('0x3b')][_0xb363('0x40')]));_0x3577ae[_0xb363('0x3f')]=_0x3577ae['attributes'][_0xb363('0x41')]?_0x3577ae[_0xb363('0x3f')]:_0x163dd7[_0xb363('0x39')];if(_0x268625[_0xb363('0x3b')][_0xb363('0x4b')]){_0x3577ae[_0xb363('0x4f')]=[{'all':!![]}];}_0x3577ae=_[_0xb363('0x47')]({},_0x3577ae,_0x268625[_0xb363('0x4a')]);return db['VoiceContext'][_0xb363('0x50')](_0x3577ae)[_0xb363('0x14')](handleEntityNotFound(_0x579dab,null))[_0xb363('0x14')](respondWithResult(_0x579dab,null))[_0xb363('0x1f')](handleError(_0x579dab,null));};exports[_0xb363('0x51')]=function(_0x52b553,_0x13e050,_0x2525e0){var _0x30385a;return db[_0xb363('0x35')]['create'](_0x52b553['body'],{'raw':!![]})[_0xb363('0x14')](function(_0x14171e){_0x30385a=_0x14171e;return db[_0xb363('0x35')]['findAll']({'raw':!![]});})[_0xb363('0x14')](function(_0x1e9e3c){var _0x26ce84=fs[_0xb363('0x52')](path['join'](config['root'],_0xb363('0x53')),_0xb363('0x54'));var _0x432dcc=ejs[_0xb363('0x55')](_0x26ce84,{'contexts':_0x1e9e3c||[]});fs['writeFileSync'](_0xb363('0x56'),_0x432dcc);})[_0xb363('0x14')](function(){return respondWithRpcPromise(_0xb363('0x57'),_0xb363('0x51'),{'module':_0xb363('0x58')});})[_0xb363('0x14')](function(){var _0x465560=_0x52b553['user'][_0xb363('0x2e')]({'plain':!![]});if(!_0x465560)throw new Error(_0xb363('0x59'));if(_0x465560[_0xb363('0x5a')]===_0xb363('0x5b')){var _0x1cbf9b=_0x30385a['get']({'plain':!![]});return db[_0xb363('0x5c')]['find']({'where':{'name':_0xb363('0x2f'),'userProfileId':_0x465560['userProfileId']},'raw':!![]})['then'](function(_0x568cff){if(_0x568cff&&_0x568cff[_0xb363('0x5d')]===0x0){return db[_0xb363('0x30')][_0xb363('0x51')]({'name':_0x1cbf9b[_0xb363('0x32')],'resourceId':_0x1cbf9b['id'],'type':_0x568cff[_0xb363('0x32')],'sectionId':_0x568cff['id']},{})[_0xb363('0x14')](function(){return _0x30385a;});}else{return _0x30385a;}})[_0xb363('0x1f')](function(_0x584d25){logger[_0xb363('0x1b')](_0xb363('0x5e'),_0x584d25);throw _0x584d25;});}return _0x30385a;})[_0xb363('0x14')](respondWithResult(_0x13e050,0xc9))[_0xb363('0x1f')](handleError(_0x13e050,null));};exports[_0xb363('0x2c')]=function(_0x1c71c8,_0x2b9941,_0x3ee024){var _0x69d76a;return db['VoiceContext'][_0xb363('0x50')]({'where':{'id':_0x1c71c8[_0xb363('0x5f')]['id']}})[_0xb363('0x14')](handleEntityNotFound(_0x2b9941,null))[_0xb363('0x14')](saveUpdates(_0x1c71c8[_0xb363('0x60')],null))[_0xb363('0x14')](function(_0x3689e7){if(_0x3689e7){_0x69d76a=_0x3689e7;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xb363('0x14')](function(_0xa9df2c){var _0xb0a20a=fs[_0xb363('0x52')](path[_0xb363('0x61')](config[_0xb363('0x62')],_0xb363('0x53')),_0xb363('0x54'));var _0x282db4=ejs['render'](_0xb0a20a,{'contexts':_0xa9df2c||[]});fs[_0xb363('0x63')](_0xb363('0x56'),_0x282db4);})['then'](function(){return respondWithRpcPromise(_0xb363('0x57'),_0xb363('0x2c'),{'module':_0xb363('0x58')});})[_0xb363('0x14')](function(){return _0x69d76a;})[_0xb363('0x14')](respondWithResult(_0x2b9941,null))['catch'](handleError(_0x2b9941,null));};exports[_0xb363('0x2d')]=function(_0x4593a0,_0x452fb0,_0x55a43d){var _0x945b79;return db[_0xb363('0x35')][_0xb363('0x50')]({'where':{'id':_0x4593a0[_0xb363('0x5f')]['id']}})[_0xb363('0x14')](handleEntityNotFound(_0x452fb0,null))[_0xb363('0x14')](removeEntity(_0x452fb0,null))[_0xb363('0x14')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xb363('0x14')](function(_0x1bff30){var _0x1f7c64=fs['readFileSync'](path[_0xb363('0x61')](config['root'],_0xb363('0x53')),_0xb363('0x54'));var _0x47ab39=ejs[_0xb363('0x55')](_0x1f7c64,{'contexts':_0x1bff30});fs[_0xb363('0x63')](_0xb363('0x56'),_0x47ab39);return respondWithRpcPromise(_0xb363('0x57'),_0xb363('0x2d'),{'module':_0xb363('0x58')});})[_0xb363('0x1f')](handleError(_0x452fb0,null));}; \ No newline at end of file +var _0x50b2=['offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','Contexts','UserProfileResource','end','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50b2,0x177));var _0x250b=function(_0xaaa4fd,_0x9c5f4b){_0xaaa4fd=_0xaaa4fd-0x0;var _0xd428ce=_0x50b2[_0xaaa4fd];return _0xd428ce;};'use strict';var emlformat=require(_0x250b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x250b('0x1'));var jsonpatch=require(_0x250b('0x2'));var rp=require(_0x250b('0x3'));var moment=require('moment');var BPromise=require(_0x250b('0x4'));var Mustache=require(_0x250b('0x5'));var util=require('util');var path=require(_0x250b('0x6'));var sox=require('sox');var csv=require(_0x250b('0x7'));var ejs=require(_0x250b('0x8'));var fs=require('fs');var fs_extra=require(_0x250b('0x9'));var _=require(_0x250b('0xa'));var squel=require(_0x250b('0xb'));var crypto=require('crypto');var jsforce=require(_0x250b('0xc'));var deskjs=require(_0x250b('0xd'));var toCsv=require(_0x250b('0x7'));var querystring=require(_0x250b('0xe'));var Papa=require(_0x250b('0xf'));var Redis=require(_0x250b('0x10'));var authService=require(_0x250b('0x11'));var qs=require(_0x250b('0x12'));var as=require(_0x250b('0x13'));var hardwareService=require(_0x250b('0x14'));var logger=require(_0x250b('0x15'))(_0x250b('0x16'));var utils=require('../../config/utils');var config=require(_0x250b('0x17'));var licenseUtil=require(_0x250b('0x18'));var db=require(_0x250b('0x19'))['db'];var jayson=require(_0x250b('0x1a'));var client=jayson[_0x250b('0x1b')][_0x250b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3145ac,_0x2a972f,_0x4a76b6,_0x2fd122){return new BPromise(function(_0x2fe147,_0x23f6a1){var _0x2f6e4e=_0x2fd122||client;return _0x2f6e4e[_0x250b('0x1d')](_0x3145ac,_0x4a76b6)[_0x250b('0x1e')](function(_0xc0d26c){logger[_0x250b('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x2a972f,_0x250b('0x20'));logger[_0x250b('0x21')](_0x250b('0x22'),_0x2a972f,_0x250b('0x20'),JSON['stringify'](_0xc0d26c));if(_0xc0d26c['error']){if(_0xc0d26c[_0x250b('0x23')][_0x250b('0x24')]===0x1f4){logger['error'](_0x250b('0x25'),_0x2a972f,_0xc0d26c[_0x250b('0x23')][_0x250b('0x26')]);return _0x23f6a1(_0xc0d26c[_0x250b('0x23')][_0x250b('0x26')]);}logger[_0x250b('0x23')]('VoiceContext,\x20%s,\x20%s',_0x2a972f,_0xc0d26c[_0x250b('0x23')]['message']);return _0x2fe147(_0xc0d26c[_0x250b('0x23')][_0x250b('0x26')]);}else{logger[_0x250b('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x2a972f,_0x250b('0x20'));_0x2fe147(_0xc0d26c[_0x250b('0x27')][_0x250b('0x26')]);}})['catch'](function(_0x593d39){logger[_0x250b('0x23')](_0x250b('0x25'),_0x2a972f,_0x593d39);_0x23f6a1(_0x593d39);});});}function respondWithStatusCode(_0x4a65db,_0x13b515){_0x13b515=_0x13b515||0xcc;return function(_0x1dae8e){if(_0x1dae8e){return _0x4a65db['sendStatus'](_0x13b515);}return _0x4a65db[_0x250b('0x28')](_0x13b515)['end']();};}function respondWithResult(_0x328bff,_0xb0a83d){_0xb0a83d=_0xb0a83d||0xc8;return function(_0x350925){if(_0x350925){return _0x328bff['status'](_0xb0a83d)['json'](_0x350925);}};}function respondWithFilteredResult(_0x303380,_0x59dfba){return function(_0x3d3d26){if(_0x3d3d26){var _0x494497=typeof _0x59dfba[_0x250b('0x29')]===_0x250b('0x2a')&&typeof _0x59dfba[_0x250b('0x2b')]===_0x250b('0x2a');var _0x1be33f=_0x3d3d26[_0x250b('0x2c')];var _0x5ecb0a=_0x494497?0x0:_0x59dfba[_0x250b('0x29')];var _0x605831=_0x494497?_0x3d3d26['count']:_0x59dfba['offset']+_0x59dfba[_0x250b('0x2b')];var _0x16956c;if(_0x605831>=_0x1be33f){_0x605831=_0x1be33f;_0x16956c=0xc8;}else{_0x16956c=0xce;}_0x303380[_0x250b('0x28')](_0x16956c);return _0x303380[_0x250b('0x2d')](_0x250b('0x2e'),_0x5ecb0a+'-'+_0x605831+'/'+_0x1be33f)['json'](_0x3d3d26);}return null;};}function patchUpdates(_0x3aa4fe){return function(_0x303388){try{jsonpatch['apply'](_0x303388,_0x3aa4fe,!![]);}catch(_0x5e4ee7){return BPromise[_0x250b('0x2f')](_0x5e4ee7);}return _0x303388['save']();};}function saveUpdates(_0xb8b46d,_0x25c37e){return function(_0x53127d){if(_0x53127d){return _0x53127d[_0x250b('0x30')](_0xb8b46d)['then'](function(_0x2977fd){return _0x2977fd;});}return null;};}function removeEntity(_0x2e62d1,_0x5a2990){return function(_0x5bd9d0){if(_0x5bd9d0){return _0x5bd9d0[_0x250b('0x31')]()[_0x250b('0x1e')](function(){var _0x49b224=_0x5bd9d0[_0x250b('0x32')]({'plain':!![]});var _0x207364=_0x250b('0x33');return db[_0x250b('0x34')][_0x250b('0x31')]({'where':{'type':_0x207364,'resourceId':_0x49b224['id']}})[_0x250b('0x1e')](function(){return _0x5bd9d0;});})[_0x250b('0x1e')](function(){_0x2e62d1[_0x250b('0x28')](0xcc)[_0x250b('0x35')]();});}};}function handleEntityNotFound(_0x50e90c,_0x3e3517){return function(_0x1ecf43){if(!_0x1ecf43){_0x50e90c[_0x250b('0x36')](0x194);}return _0x1ecf43;};}function handleError(_0x5a4e1b,_0x2c6481){_0x2c6481=_0x2c6481||0x1f4;return function(_0x3afb89){logger[_0x250b('0x23')](_0x3afb89[_0x250b('0x37')]);if(_0x3afb89[_0x250b('0x38')]){delete _0x3afb89[_0x250b('0x38')];}_0x5a4e1b[_0x250b('0x28')](_0x2c6481)[_0x250b('0x39')](_0x3afb89);};}exports[_0x250b('0x3a')]=function(_0x54978e,_0x3d98c9){var _0x2d7393={},_0x14819d={},_0x3495af={'count':0x0,'rows':[]};var _0x55a89a=_[_0x250b('0x3b')](db[_0x250b('0x3c')][_0x250b('0x3d')],function(_0x292108){return{'name':_0x292108[_0x250b('0x3e')],'type':_0x292108[_0x250b('0x3f')][_0x250b('0x40')]};});_0x14819d[_0x250b('0x41')]=_[_0x250b('0x3b')](_0x55a89a,'name');_0x14819d['query']=_[_0x250b('0x42')](_0x54978e[_0x250b('0x43')]);_0x14819d[_0x250b('0x44')]=_[_0x250b('0x45')](_0x14819d[_0x250b('0x41')],_0x14819d['query']);_0x2d7393[_0x250b('0x46')]=_[_0x250b('0x45')](_0x14819d['model'],qs[_0x250b('0x47')](_0x54978e[_0x250b('0x43')]['fields']));_0x2d7393['attributes']=_0x2d7393[_0x250b('0x46')][_0x250b('0x48')]?_0x2d7393[_0x250b('0x46')]:_0x14819d[_0x250b('0x41')];if(!_0x54978e['query'][_0x250b('0x49')]('nolimit')){_0x2d7393[_0x250b('0x2b')]=qs['limit'](_0x54978e['query'][_0x250b('0x2b')]);_0x2d7393[_0x250b('0x29')]=qs[_0x250b('0x29')](_0x54978e[_0x250b('0x43')]['offset']);}_0x2d7393[_0x250b('0x4a')]=qs[_0x250b('0x4b')](_0x54978e[_0x250b('0x43')][_0x250b('0x4b')]);_0x2d7393['where']=qs['filters'](_[_0x250b('0x4c')](_0x54978e[_0x250b('0x43')],_0x14819d[_0x250b('0x44')]),_0x55a89a);if(_0x54978e[_0x250b('0x43')][_0x250b('0x4d')]){_0x2d7393[_0x250b('0x4e')]=_[_0x250b('0x4f')](_0x2d7393[_0x250b('0x4e')],{'$or':_[_0x250b('0x3b')](_0x55a89a,function(_0x133b07){if(_0x133b07[_0x250b('0x3f')]!=='VIRTUAL'){var _0x4e3812={};_0x4e3812[_0x133b07[_0x250b('0x38')]]={'$like':'%'+_0x54978e[_0x250b('0x43')][_0x250b('0x4d')]+'%'};return _0x4e3812;}})});}_0x2d7393=_[_0x250b('0x4f')]({},_0x2d7393,_0x54978e[_0x250b('0x50')]);var _0x56abdf={'where':_0x2d7393[_0x250b('0x4e')]};return db['VoiceContext'][_0x250b('0x2c')](_0x56abdf)[_0x250b('0x1e')](function(_0x17dac1){_0x3495af[_0x250b('0x2c')]=_0x17dac1;if(_0x54978e[_0x250b('0x43')][_0x250b('0x51')]){_0x2d7393[_0x250b('0x52')]=[{'all':!![]}];}return db[_0x250b('0x3c')][_0x250b('0x53')](_0x2d7393);})['then'](function(_0x3d5b42){_0x3495af[_0x250b('0x54')]=_0x3d5b42;return _0x3495af;})[_0x250b('0x1e')](respondWithFilteredResult(_0x3d98c9,_0x2d7393))[_0x250b('0x55')](handleError(_0x3d98c9,null));};exports['show']=function(_0x22022b,_0x5b5f02){var _0x7bdb4b={'raw':![],'where':{'id':_0x22022b['params']['id']}},_0x647e92={};_0x647e92[_0x250b('0x41')]=_[_0x250b('0x42')](db['VoiceContext']['rawAttributes']);_0x647e92[_0x250b('0x43')]=_['keys'](_0x22022b[_0x250b('0x43')]);_0x647e92[_0x250b('0x44')]=_[_0x250b('0x45')](_0x647e92['model'],_0x647e92[_0x250b('0x43')]);_0x7bdb4b['attributes']=_['intersection'](_0x647e92['model'],qs[_0x250b('0x47')](_0x22022b['query'][_0x250b('0x47')]));_0x7bdb4b['attributes']=_0x7bdb4b['attributes'][_0x250b('0x48')]?_0x7bdb4b[_0x250b('0x46')]:_0x647e92[_0x250b('0x41')];if(_0x22022b['query'][_0x250b('0x51')]){_0x7bdb4b['include']=[{'all':!![]}];}_0x7bdb4b=_[_0x250b('0x4f')]({},_0x7bdb4b,_0x22022b[_0x250b('0x50')]);return db[_0x250b('0x3c')][_0x250b('0x56')](_0x7bdb4b)[_0x250b('0x1e')](handleEntityNotFound(_0x5b5f02,null))[_0x250b('0x1e')](respondWithResult(_0x5b5f02,null))[_0x250b('0x55')](handleError(_0x5b5f02,null));};exports[_0x250b('0x57')]=function(_0x2eebf7,_0x43b3f4,_0x30c9de){var _0xc906;return db[_0x250b('0x3c')][_0x250b('0x57')](_0x2eebf7[_0x250b('0x58')],{'raw':!![]})[_0x250b('0x1e')](function(_0x1a4d6f){_0xc906=_0x1a4d6f;return db[_0x250b('0x3c')][_0x250b('0x53')]({'raw':!![]});})[_0x250b('0x1e')](function(_0x2c3db0){var _0x3b7354=fs[_0x250b('0x59')](path['join'](config[_0x250b('0x5a')],_0x250b('0x5b')),_0x250b('0x5c'));var _0x4cc980=ejs[_0x250b('0x5d')](_0x3b7354,{'contexts':_0x2c3db0||[]});fs[_0x250b('0x5e')](_0x250b('0x5f'),_0x4cc980);})['then'](function(){return respondWithRpcPromise('Reload',_0x250b('0x57'),{'module':_0x250b('0x60')});})[_0x250b('0x1e')](function(){var _0x8f5c7f=_0x2eebf7[_0x250b('0x61')][_0x250b('0x32')]({'plain':!![]});if(!_0x8f5c7f)throw new Error(_0x250b('0x62'));if(_0x8f5c7f['role']==='user'){var _0x37d4ab=_0xc906['get']({'plain':!![]});return db['UserProfileSection'][_0x250b('0x56')]({'where':{'name':_0x250b('0x33'),'userProfileId':_0x8f5c7f[_0x250b('0x63')]},'raw':!![]})[_0x250b('0x1e')](function(_0x36541e){if(_0x36541e&&_0x36541e[_0x250b('0x64')]===0x0){return db[_0x250b('0x34')][_0x250b('0x57')]({'name':_0x37d4ab[_0x250b('0x38')],'resourceId':_0x37d4ab['id'],'type':_0x36541e[_0x250b('0x38')],'sectionId':_0x36541e['id']},{})['then'](function(){return _0xc906;});}else{return _0xc906;}})['catch'](function(_0x539ada){logger[_0x250b('0x23')](_0x250b('0x65'),_0x539ada);throw _0x539ada;});}return _0xc906;})[_0x250b('0x1e')](respondWithResult(_0x43b3f4,0xc9))['catch'](handleError(_0x43b3f4,null));};exports[_0x250b('0x30')]=function(_0x385230,_0x218083,_0x56e58a){var _0x24efcc;return db[_0x250b('0x3c')][_0x250b('0x56')]({'where':{'id':_0x385230[_0x250b('0x66')]['id']}})[_0x250b('0x1e')](handleEntityNotFound(_0x218083,null))['then'](saveUpdates(_0x385230[_0x250b('0x58')],null))['then'](function(_0x29e0ef){if(_0x29e0ef){_0x24efcc=_0x29e0ef;return db[_0x250b('0x3c')][_0x250b('0x53')]({'raw':!![]});}})[_0x250b('0x1e')](function(_0xd75804){var _0x37c5d7=fs['readFileSync'](path[_0x250b('0x67')](config['root'],_0x250b('0x5b')),_0x250b('0x5c'));var _0x13fb83=ejs[_0x250b('0x5d')](_0x37c5d7,{'contexts':_0xd75804||[]});fs[_0x250b('0x5e')](_0x250b('0x5f'),_0x13fb83);})[_0x250b('0x1e')](function(){return respondWithRpcPromise('Reload',_0x250b('0x30'),{'module':_0x250b('0x60')});})[_0x250b('0x1e')](function(){return _0x24efcc;})['then'](respondWithResult(_0x218083,null))[_0x250b('0x55')](handleError(_0x218083,null));};exports['destroy']=function(_0x34fef5,_0x18dfa9,_0x9bd823){var _0x300979;return db[_0x250b('0x3c')]['find']({'where':{'id':_0x34fef5[_0x250b('0x66')]['id']}})[_0x250b('0x1e')](handleEntityNotFound(_0x18dfa9,null))[_0x250b('0x1e')](removeEntity(_0x18dfa9,null))[_0x250b('0x1e')](function(){return db[_0x250b('0x3c')][_0x250b('0x53')]({'raw':!![]});})['then'](function(_0x3cb144){var _0x2c7753=fs[_0x250b('0x59')](path['join'](config[_0x250b('0x5a')],'server/files/templates/context.ejs'),_0x250b('0x5c'));var _0x4eb338=ejs[_0x250b('0x5d')](_0x2c7753,{'contexts':_0x3cb144});fs['writeFileSync'](_0x250b('0x5f'),_0x4eb338);return respondWithRpcPromise('Reload',_0x250b('0x31'),{'module':_0x250b('0x60')});})[_0x250b('0x55')](handleError(_0x18dfa9,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 305e957..c408b9d 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 _0x1dd4=['request-promise','path','rimraf','./voiceContext.attributes','exports','voice_contexts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x1dd4,0x95));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41dd('0x0'));var util=require('util');var logger=require(_0x41dd('0x1'))(_0x41dd('0x2'));var moment=require(_0x41dd('0x3'));var BPromise=require(_0x41dd('0x4'));var rp=require(_0x41dd('0x5'));var fs=require('fs');var path=require(_0x41dd('0x6'));var rimraf=require(_0x41dd('0x7'));var config=require('../../config/environment');var attributes=require(_0x41dd('0x8'));module[_0x41dd('0x9')]=function(_0x186073,_0x27cd63){return _0x186073['define']('VoiceContext',attributes,{'tableName':_0x41dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf930=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x1295c0,_0x62722b){var _0x22167d=function(_0xfeba62){while(--_0xfeba62){_0x1295c0['push'](_0x1295c0['shift']());}};_0x22167d(++_0x62722b);}(_0xf930,0x17e));var _0x0f93=function(_0x390e07,_0x52d722){_0x390e07=_0x390e07-0x0;var _0x5b7779=_0xf930[_0x390e07];return _0x5b7779;};'use strict';var _=require(_0x0f93('0x0'));var util=require(_0x0f93('0x1'));var logger=require(_0x0f93('0x2'))(_0x0f93('0x3'));var moment=require(_0x0f93('0x4'));var BPromise=require(_0x0f93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f93('0x6'));var config=require(_0x0f93('0x7'));var attributes=require(_0x0f93('0x8'));module[_0x0f93('0x9')]=function(_0x53dd3f,_0x34e415){return _0x53dd3f[_0x0f93('0xa')](_0x0f93('0xb'),attributes,{'tableName':_0x0f93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3f045de..325d91f 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 _0x9584=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x250a41,_0x328b78){var _0x459feb=function(_0x554599){while(--_0x554599){_0x250a41['push'](_0x250a41['shift']());}};_0x459feb(++_0x328b78);}(_0x9584,0x1b9));var _0x4958=function(_0x5a3f0f,_0x35aad7){_0x5a3f0f=_0x5a3f0f-0x0;var _0x43391f=_0x9584[_0x5a3f0f];return _0x43391f;};'use strict';var _=require(_0x4958('0x0'));var util=require(_0x4958('0x1'));var moment=require(_0x4958('0x2'));var BPromise=require('bluebird');var rs=require(_0x4958('0x3'));var fs=require('fs');var Redis=require(_0x4958('0x4'));var db=require(_0x4958('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4958('0x6'))(_0x4958('0x7'));var config=require(_0x4958('0x8'));var jayson=require(_0x4958('0x9'));var client=jayson[_0x4958('0xa')][_0x4958('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x527644,_0x1dfabd,_0x152103){return new BPromise(function(_0x27c0ff,_0x276ec8){return client[_0x4958('0xc')](_0x527644,_0x152103)[_0x4958('0xd')](function(_0xf399d6){logger[_0x4958('0xe')](_0x4958('0xf'),_0x1dfabd,_0x4958('0x10'));logger[_0x4958('0x11')](_0x4958('0x12'),_0x1dfabd,'request\x20sent',JSON[_0x4958('0x13')](_0xf399d6));if(_0xf399d6[_0x4958('0x14')]){if(_0xf399d6['error'][_0x4958('0x15')]===0x1f4){logger[_0x4958('0x14')](_0x4958('0xf'),_0x1dfabd,_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);return _0x276ec8(_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);}logger[_0x4958('0x14')](_0x4958('0xf'),_0x1dfabd,_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);return _0x27c0ff(_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1dfabd,_0x4958('0x10'));_0x27c0ff(_0xf399d6[_0x4958('0x17')]['message']);}})['catch'](function(_0x442552){logger[_0x4958('0x14')]('VoiceContext,\x20%s,\x20%s',_0x1dfabd,_0x442552);_0x276ec8(_0x442552);});});} \ No newline at end of file +var _0xb9ed=['code','message','VoiceContext,\x20%s,\x20%s','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1f1745,_0x5cad63){var _0xc41d1b=function(_0x49242){while(--_0x49242){_0x1f1745['push'](_0x1f1745['shift']());}};_0xc41d1b(++_0x5cad63);}(_0xb9ed,0x1bc));var _0xdb9e=function(_0x590559,_0x17f731){_0x590559=_0x590559-0x0;var _0x438471=_0xb9ed[_0x590559];return _0x438471;};'use strict';var _=require(_0xdb9e('0x0'));var util=require('util');var moment=require(_0xdb9e('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb9e('0x2'));var fs=require('fs');var Redis=require(_0xdb9e('0x3'));var db=require(_0xdb9e('0x4'))['db'];var utils=require(_0xdb9e('0x5'));var logger=require(_0xdb9e('0x6'))(_0xdb9e('0x7'));var config=require(_0xdb9e('0x8'));var jayson=require(_0xdb9e('0x9'));var client=jayson['client'][_0xdb9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53309a,_0x45e22b,_0x57ab79){return new BPromise(function(_0xd9de78,_0x59451a){return client[_0xdb9e('0xb')](_0x53309a,_0x57ab79)['then'](function(_0x1b3b52){logger[_0xdb9e('0xc')]('VoiceContext,\x20%s,\x20%s',_0x45e22b,'request\x20sent');logger[_0xdb9e('0xd')](_0xdb9e('0xe'),_0x45e22b,_0xdb9e('0xf'),JSON[_0xdb9e('0x10')](_0x1b3b52));if(_0x1b3b52[_0xdb9e('0x11')]){if(_0x1b3b52[_0xdb9e('0x11')][_0xdb9e('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x45e22b,_0x1b3b52[_0xdb9e('0x11')][_0xdb9e('0x13')]);return _0x59451a(_0x1b3b52['error']['message']);}logger[_0xdb9e('0x11')](_0xdb9e('0x14'),_0x45e22b,_0x1b3b52['error'][_0xdb9e('0x13')]);return _0xd9de78(_0x1b3b52['error'][_0xdb9e('0x13')]);}else{logger[_0xdb9e('0xc')](_0xdb9e('0x14'),_0x45e22b,_0xdb9e('0xf'));_0xd9de78(_0x1b3b52[_0xdb9e('0x15')][_0xdb9e('0x13')]);}})['catch'](function(_0x4a3459){logger[_0xdb9e('0x11')](_0xdb9e('0x14'),_0x45e22b,_0x4a3459);_0x59451a(_0x4a3459);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4a24dd5..2cd0496 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 _0x878f=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2edc4c,_0x3b27e9){var _0x3a496a=function(_0x270a4f){while(--_0x270a4f){_0x2edc4c['push'](_0x2edc4c['shift']());}};_0x3a496a(++_0x3b27e9);}(_0x878f,0x124));var _0xf878=function(_0xd02416,_0x40a97f){_0xd02416=_0xd02416-0x0;var _0x1f24a8=_0x878f[_0xd02416];return _0x1f24a8;};'use strict';var multer=require(_0xf878('0x0'));var util=require(_0xf878('0x1'));var path=require(_0xf878('0x2'));var timeout=require(_0xf878('0x3'));var express=require(_0xf878('0x4'));var router=express[_0xf878('0x5')]();var fs_extra=require(_0xf878('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf878('0x7'));var controller=require(_0xf878('0x8'));router[_0xf878('0x9')]('/',auth['isAuthenticated'](),controller[_0xf878('0xa')]);router[_0xf878('0x9')](_0xf878('0xb'),auth[_0xf878('0xc')](),controller['describe']);router[_0xf878('0x9')](_0xf878('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xe')]('/',auth[_0xf878('0xc')](),controller[_0xf878('0xf')]);router[_0xf878('0x10')](_0xf878('0xd'),auth[_0xf878('0xc')](),controller[_0xf878('0x11')]);router[_0xf878('0x12')](_0xf878('0xd'),auth[_0xf878('0xc')](),controller[_0xf878('0x13')]);module[_0xf878('0x14')]=router; \ No newline at end of file +var _0xc716=['create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0x147e56,_0x2efae8){var _0x40c49c=function(_0x380aaa){while(--_0x380aaa){_0x147e56['push'](_0x147e56['shift']());}};_0x40c49c(++_0x2efae8);}(_0xc716,0x16c));var _0x6c71=function(_0x53295e,_0x25bb70){_0x53295e=_0x53295e-0x0;var _0x32f9a5=_0xc716[_0x53295e];return _0x32f9a5;};'use strict';var multer=require(_0x6c71('0x0'));var util=require('util');var path=require(_0x6c71('0x1'));var timeout=require(_0x6c71('0x2'));var express=require(_0x6c71('0x3'));var router=express[_0x6c71('0x4')]();var fs_extra=require(_0x6c71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6c71('0x6'));var config=require('../../config/environment');var controller=require(_0x6c71('0x7'));router[_0x6c71('0x8')]('/',auth[_0x6c71('0x9')](),controller[_0x6c71('0xa')]);router[_0x6c71('0x8')](_0x6c71('0xb'),auth[_0x6c71('0x9')](),controller[_0x6c71('0xc')]);router[_0x6c71('0x8')]('/:id',auth[_0x6c71('0x9')](),controller['show']);router[_0x6c71('0xd')]('/',auth['isAuthenticated'](),controller[_0x6c71('0xe')]);router[_0x6c71('0xf')]('/:id',auth[_0x6c71('0x9')](),controller[_0x6c71('0x10')]);router[_0x6c71('0x11')](_0x6c71('0x12'),auth[_0x6c71('0x9')](),controller[_0x6c71('0x13')]);module[_0x6c71('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 71e5070..48ff4a6 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 _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x520f7e,_0x67518d){var _0x587f49=function(_0x226a93){while(--_0x226a93){_0x520f7e['push'](_0x520f7e['shift']());}};_0x587f49(++_0x67518d);}(_0x84ab,0x12f));var _0xb84a=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x84ab[_0x4aba15];return _0x1c8122;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file +var _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x19318e,_0x46c067){var _0x425540=function(_0xb4e055){while(--_0xb4e055){_0x19318e['push'](_0x19318e['shift']());}};_0x425540(++_0x46c067);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4062d6,_0x1fa4d4){_0x4062d6=_0x4062d6-0x0;var _0x584618=_0x8ef6[_0x4062d6];return _0x584618;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 234a91d..2d29bb7 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 _0xfdfc=['query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','options','includeAll','findAll','rows','catch','params','intersection','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xfdfc,0xfc));var _0xcfdf=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xfdfc[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfdf('0x0'));var zipdir=require(_0xcfdf('0x1'));var jsonpatch=require(_0xcfdf('0x2'));var rp=require(_0xcfdf('0x3'));var moment=require('moment');var BPromise=require(_0xcfdf('0x4'));var Mustache=require(_0xcfdf('0x5'));var util=require(_0xcfdf('0x6'));var path=require(_0xcfdf('0x7'));var sox=require(_0xcfdf('0x8'));var csv=require(_0xcfdf('0x9'));var ejs=require(_0xcfdf('0xa'));var fs=require('fs');var fs_extra=require(_0xcfdf('0xb'));var _=require(_0xcfdf('0xc'));var squel=require(_0xcfdf('0xd'));var crypto=require('crypto');var jsforce=require(_0xcfdf('0xe'));var deskjs=require(_0xcfdf('0xf'));var toCsv=require(_0xcfdf('0x9'));var querystring=require(_0xcfdf('0x10'));var Papa=require('papaparse');var Redis=require(_0xcfdf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcfdf('0x12'));var as=require(_0xcfdf('0x13'));var hardwareService=require(_0xcfdf('0x14'));var logger=require(_0xcfdf('0x15'))(_0xcfdf('0x16'));var utils=require(_0xcfdf('0x17'));var config=require(_0xcfdf('0x18'));var licenseUtil=require(_0xcfdf('0x19'));var db=require(_0xcfdf('0x1a'))['db'];function respondWithStatusCode(_0x4c2a1b,_0x478ef5){_0x478ef5=_0x478ef5||0xcc;return function(_0x1a3312){if(_0x1a3312){return _0x4c2a1b[_0xcfdf('0x1b')](_0x478ef5);}return _0x4c2a1b['status'](_0x478ef5)[_0xcfdf('0x1c')]();};}function respondWithResult(_0x3d65c6,_0x229f37){_0x229f37=_0x229f37||0xc8;return function(_0x2796f8){if(_0x2796f8){return _0x3d65c6[_0xcfdf('0x1d')](_0x229f37)['json'](_0x2796f8);}};}function respondWithFilteredResult(_0x21052d,_0x30a8ed){return function(_0x323470){if(_0x323470){var _0x2c1028=typeof _0x30a8ed['offset']==='undefined'&&typeof _0x30a8ed['limit']==='undefined';var _0x461cb5=_0x323470[_0xcfdf('0x1e')];var _0x448f3e=_0x2c1028?0x0:_0x30a8ed['offset'];var _0x4cf94d=_0x2c1028?_0x323470['count']:_0x30a8ed[_0xcfdf('0x1f')]+_0x30a8ed[_0xcfdf('0x20')];var _0x1a96e8;if(_0x4cf94d>=_0x461cb5){_0x4cf94d=_0x461cb5;_0x1a96e8=0xc8;}else{_0x1a96e8=0xce;}_0x21052d[_0xcfdf('0x1d')](_0x1a96e8);return _0x21052d[_0xcfdf('0x21')](_0xcfdf('0x22'),_0x448f3e+'-'+_0x4cf94d+'/'+_0x461cb5)[_0xcfdf('0x23')](_0x323470);}return null;};}function patchUpdates(_0x7bbf7b){return function(_0xbbc94c){try{jsonpatch[_0xcfdf('0x24')](_0xbbc94c,_0x7bbf7b,!![]);}catch(_0x10de27){return BPromise[_0xcfdf('0x25')](_0x10de27);}return _0xbbc94c['save']();};}function saveUpdates(_0x454d5f,_0x2339c4){return function(_0x487261){if(_0x487261){return _0x487261[_0xcfdf('0x26')](_0x454d5f)['then'](function(_0x4006e1){return _0x4006e1;});}return null;};}function removeEntity(_0x20b46b,_0x4c536f){return function(_0xd7ade){if(_0xd7ade){return _0xd7ade[_0xcfdf('0x27')]()[_0xcfdf('0x28')](function(){_0x20b46b['status'](0xcc)[_0xcfdf('0x1c')]();});}};}function handleEntityNotFound(_0xc7eac,_0x5ac857){return function(_0xa7e368){if(!_0xa7e368){_0xc7eac['sendStatus'](0x194);}return _0xa7e368;};}function handleError(_0x15da39,_0x2825f4){_0x2825f4=_0x2825f4||0x1f4;return function(_0x163b0d){logger[_0xcfdf('0x29')](_0x163b0d['stack']);if(_0x163b0d[_0xcfdf('0x2a')]){delete _0x163b0d[_0xcfdf('0x2a')];}_0x15da39[_0xcfdf('0x1d')](_0x2825f4)[_0xcfdf('0x2b')](_0x163b0d);};}exports[_0xcfdf('0x2c')]=function(_0x531f05,_0x50b8d6){var _0x1a7a1b={},_0x58415c={},_0x771ccd={'count':0x0,'rows':[]};var _0x5bb00c=_['map'](db[_0xcfdf('0x2d')][_0xcfdf('0x2e')],function(_0x1db67f){return{'name':_0x1db67f[_0xcfdf('0x2f')],'type':_0x1db67f[_0xcfdf('0x30')][_0xcfdf('0x31')]};});_0x58415c[_0xcfdf('0x32')]=_[_0xcfdf('0x33')](_0x5bb00c,'name');_0x58415c[_0xcfdf('0x34')]=_[_0xcfdf('0x35')](_0x531f05[_0xcfdf('0x34')]);_0x58415c['filters']=_['intersection'](_0x58415c[_0xcfdf('0x32')],_0x58415c[_0xcfdf('0x34')]);_0x1a7a1b[_0xcfdf('0x36')]=_['intersection'](_0x58415c[_0xcfdf('0x32')],qs[_0xcfdf('0x37')](_0x531f05['query']['fields']));_0x1a7a1b[_0xcfdf('0x36')]=_0x1a7a1b['attributes'][_0xcfdf('0x38')]?_0x1a7a1b['attributes']:_0x58415c[_0xcfdf('0x32')];if(!_0x531f05[_0xcfdf('0x34')]['hasOwnProperty'](_0xcfdf('0x39'))){_0x1a7a1b[_0xcfdf('0x20')]=qs[_0xcfdf('0x20')](_0x531f05[_0xcfdf('0x34')][_0xcfdf('0x20')]);_0x1a7a1b[_0xcfdf('0x1f')]=qs[_0xcfdf('0x1f')](_0x531f05[_0xcfdf('0x34')]['offset']);}_0x1a7a1b[_0xcfdf('0x3a')]=qs[_0xcfdf('0x3b')](_0x531f05[_0xcfdf('0x34')][_0xcfdf('0x3b')]);_0x1a7a1b[_0xcfdf('0x3c')]=qs[_0xcfdf('0x3d')](_[_0xcfdf('0x3e')](_0x531f05['query'],_0x58415c[_0xcfdf('0x3d')]),_0x5bb00c);if(_0x531f05[_0xcfdf('0x34')]['filter']){_0x1a7a1b[_0xcfdf('0x3c')]=_['merge'](_0x1a7a1b[_0xcfdf('0x3c')],{'$or':_['map'](_0x5bb00c,function(_0x5d750f){if(_0x5d750f[_0xcfdf('0x30')]!==_0xcfdf('0x3f')){var _0x377e86={};_0x377e86[_0x5d750f['name']]={'$like':'%'+_0x531f05['query']['filter']+'%'};return _0x377e86;}})});}_0x1a7a1b=_['merge']({},_0x1a7a1b,_0x531f05[_0xcfdf('0x40')]);var _0x1ee525={'where':_0x1a7a1b[_0xcfdf('0x3c')]};return db[_0xcfdf('0x2d')][_0xcfdf('0x1e')](_0x1ee525)['then'](function(_0x3fe79d){_0x771ccd[_0xcfdf('0x1e')]=_0x3fe79d;if(_0x531f05[_0xcfdf('0x34')][_0xcfdf('0x41')]){_0x1a7a1b['include']=[{'all':!![]}];}return db[_0xcfdf('0x2d')][_0xcfdf('0x42')](_0x1a7a1b);})[_0xcfdf('0x28')](function(_0x5bb6e3){_0x771ccd[_0xcfdf('0x43')]=_0x5bb6e3;return _0x771ccd;})[_0xcfdf('0x28')](respondWithFilteredResult(_0x50b8d6,_0x1a7a1b))[_0xcfdf('0x44')](handleError(_0x50b8d6,null));};exports['show']=function(_0x3591d2,_0x2e0ee8){var _0x1d3b95={'raw':!![],'where':{'id':_0x3591d2[_0xcfdf('0x45')]['id']}},_0x5b934b={};_0x5b934b[_0xcfdf('0x32')]=_[_0xcfdf('0x35')](db[_0xcfdf('0x2d')][_0xcfdf('0x2e')]);_0x5b934b[_0xcfdf('0x34')]=_['keys'](_0x3591d2[_0xcfdf('0x34')]);_0x5b934b[_0xcfdf('0x3d')]=_[_0xcfdf('0x46')](_0x5b934b[_0xcfdf('0x32')],_0x5b934b[_0xcfdf('0x34')]);_0x1d3b95['attributes']=_['intersection'](_0x5b934b[_0xcfdf('0x32')],qs[_0xcfdf('0x37')](_0x3591d2['query'][_0xcfdf('0x37')]));_0x1d3b95['attributes']=_0x1d3b95[_0xcfdf('0x36')][_0xcfdf('0x38')]?_0x1d3b95[_0xcfdf('0x36')]:_0x5b934b[_0xcfdf('0x32')];if(_0x3591d2[_0xcfdf('0x34')]['includeAll']){_0x1d3b95[_0xcfdf('0x47')]=[{'all':!![]}];}_0x1d3b95=_['merge']({},_0x1d3b95,_0x3591d2[_0xcfdf('0x40')]);return db[_0xcfdf('0x2d')][_0xcfdf('0x48')](_0x1d3b95)[_0xcfdf('0x28')](handleEntityNotFound(_0x2e0ee8,null))[_0xcfdf('0x28')](respondWithResult(_0x2e0ee8,null))[_0xcfdf('0x44')](handleError(_0x2e0ee8,null));};exports[_0xcfdf('0x49')]=function(_0x584753,_0x20109d){return db[_0xcfdf('0x2d')]['create'](_0x584753[_0xcfdf('0x4a')],{})[_0xcfdf('0x28')](respondWithResult(_0x20109d,0xc9))[_0xcfdf('0x44')](handleError(_0x20109d,null));};exports['update']=function(_0x3e168c,_0x13534a){if(_0x3e168c[_0xcfdf('0x4a')]['id']){delete _0x3e168c[_0xcfdf('0x4a')]['id'];}return db[_0xcfdf('0x2d')][_0xcfdf('0x48')]({'where':{'id':_0x3e168c[_0xcfdf('0x45')]['id']}})[_0xcfdf('0x28')](handleEntityNotFound(_0x13534a,null))['then'](saveUpdates(_0x3e168c[_0xcfdf('0x4a')],null))['then'](respondWithResult(_0x13534a,null))['catch'](handleError(_0x13534a,null));};exports[_0xcfdf('0x27')]=function(_0x3c9dbd,_0x1b37c3){return db[_0xcfdf('0x2d')][_0xcfdf('0x48')]({'where':{'id':_0x3c9dbd[_0xcfdf('0x45')]['id']}})[_0xcfdf('0x28')](handleEntityNotFound(_0x1b37c3,null))[_0xcfdf('0x28')](removeEntity(_0x1b37c3,null))[_0xcfdf('0x44')](handleError(_0x1b37c3,null));};exports[_0xcfdf('0x4b')]=function(_0x400012,_0x365fdc){return db['VoiceDialReport']['describe']()[_0xcfdf('0x28')](respondWithResult(_0x365fdc,null))[_0xcfdf('0x44')](handleError(_0x365fdc,null));}; \ No newline at end of file +var _0x721c=['set','reject','save','then','error','stack','name','send','map','VoiceDialReport','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset'];(function(_0x235e66,_0x4bef96){var _0x36019b=function(_0x3674f3){while(--_0x3674f3){_0x235e66['push'](_0x235e66['shift']());}};_0x36019b(++_0x4bef96);}(_0x721c,0xf3));var _0xc721=function(_0x599778,_0x1e20e8){_0x599778=_0x599778-0x0;var _0x402cb6=_0x721c[_0x599778];return _0x402cb6;};'use strict';var emlformat=require(_0xc721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc721('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc721('0x2'));var BPromise=require(_0xc721('0x3'));var Mustache=require(_0xc721('0x4'));var util=require(_0xc721('0x5'));var path=require(_0xc721('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc721('0x7'));var fs=require('fs');var fs_extra=require(_0xc721('0x8'));var _=require(_0xc721('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc721('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc721('0xb'));var Papa=require(_0xc721('0xc'));var Redis=require('ioredis');var authService=require(_0xc721('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc721('0xe'));var hardwareService=require(_0xc721('0xf'));var logger=require(_0xc721('0x10'))(_0xc721('0x11'));var utils=require(_0xc721('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc721('0x13'));var db=require(_0xc721('0x14'))['db'];function respondWithStatusCode(_0x419462,_0x212751){_0x212751=_0x212751||0xcc;return function(_0x1c96d1){if(_0x1c96d1){return _0x419462[_0xc721('0x15')](_0x212751);}return _0x419462['status'](_0x212751)[_0xc721('0x16')]();};}function respondWithResult(_0x18415a,_0x2084d5){_0x2084d5=_0x2084d5||0xc8;return function(_0x55587a){if(_0x55587a){return _0x18415a[_0xc721('0x17')](_0x2084d5)[_0xc721('0x18')](_0x55587a);}};}function respondWithFilteredResult(_0x4cee51,_0x3246f0){return function(_0x267f43){if(_0x267f43){var _0x4968fd=typeof _0x3246f0['offset']==='undefined'&&typeof _0x3246f0[_0xc721('0x19')]===_0xc721('0x1a');var _0x4164c0=_0x267f43[_0xc721('0x1b')];var _0x329125=_0x4968fd?0x0:_0x3246f0[_0xc721('0x1c')];var _0x2e8a9f=_0x4968fd?_0x267f43[_0xc721('0x1b')]:_0x3246f0[_0xc721('0x1c')]+_0x3246f0[_0xc721('0x19')];var _0x35b8ed;if(_0x2e8a9f>=_0x4164c0){_0x2e8a9f=_0x4164c0;_0x35b8ed=0xc8;}else{_0x35b8ed=0xce;}_0x4cee51[_0xc721('0x17')](_0x35b8ed);return _0x4cee51[_0xc721('0x1d')]('Content-Range',_0x329125+'-'+_0x2e8a9f+'/'+_0x4164c0)[_0xc721('0x18')](_0x267f43);}return null;};}function patchUpdates(_0x393368){return function(_0x79c83c){try{jsonpatch['apply'](_0x79c83c,_0x393368,!![]);}catch(_0x4d2e51){return BPromise[_0xc721('0x1e')](_0x4d2e51);}return _0x79c83c[_0xc721('0x1f')]();};}function saveUpdates(_0xadcd6f,_0x25e21b){return function(_0x1493f8){if(_0x1493f8){return _0x1493f8['update'](_0xadcd6f)[_0xc721('0x20')](function(_0x1c87cd){return _0x1c87cd;});}return null;};}function removeEntity(_0xf1b595,_0x3b016e){return function(_0x59701f){if(_0x59701f){return _0x59701f['destroy']()[_0xc721('0x20')](function(){_0xf1b595['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3719b9,_0x3fda15){return function(_0x52aad3){if(!_0x52aad3){_0x3719b9[_0xc721('0x15')](0x194);}return _0x52aad3;};}function handleError(_0x3d91dc,_0x223b4c){_0x223b4c=_0x223b4c||0x1f4;return function(_0x1e0831){logger[_0xc721('0x21')](_0x1e0831[_0xc721('0x22')]);if(_0x1e0831[_0xc721('0x23')]){delete _0x1e0831['name'];}_0x3d91dc[_0xc721('0x17')](_0x223b4c)[_0xc721('0x24')](_0x1e0831);};}exports['index']=function(_0x124a45,_0x30bcd7){var _0x213f10={},_0x4af9b6={},_0x27991d={'count':0x0,'rows':[]};var _0x2e6073=_[_0xc721('0x25')](db[_0xc721('0x26')][_0xc721('0x27')],function(_0x974242){return{'name':_0x974242['fieldName'],'type':_0x974242[_0xc721('0x28')]['key']};});_0x4af9b6[_0xc721('0x29')]=_[_0xc721('0x25')](_0x2e6073,_0xc721('0x23'));_0x4af9b6[_0xc721('0x2a')]=_['keys'](_0x124a45[_0xc721('0x2a')]);_0x4af9b6[_0xc721('0x2b')]=_[_0xc721('0x2c')](_0x4af9b6[_0xc721('0x29')],_0x4af9b6[_0xc721('0x2a')]);_0x213f10[_0xc721('0x2d')]=_['intersection'](_0x4af9b6[_0xc721('0x29')],qs[_0xc721('0x2e')](_0x124a45['query']['fields']));_0x213f10['attributes']=_0x213f10['attributes'][_0xc721('0x2f')]?_0x213f10[_0xc721('0x2d')]:_0x4af9b6['model'];if(!_0x124a45[_0xc721('0x2a')]['hasOwnProperty'](_0xc721('0x30'))){_0x213f10[_0xc721('0x19')]=qs[_0xc721('0x19')](_0x124a45[_0xc721('0x2a')][_0xc721('0x19')]);_0x213f10['offset']=qs[_0xc721('0x1c')](_0x124a45['query'][_0xc721('0x1c')]);}_0x213f10[_0xc721('0x31')]=qs[_0xc721('0x32')](_0x124a45[_0xc721('0x2a')][_0xc721('0x32')]);_0x213f10[_0xc721('0x33')]=qs[_0xc721('0x2b')](_[_0xc721('0x34')](_0x124a45[_0xc721('0x2a')],_0x4af9b6[_0xc721('0x2b')]),_0x2e6073);if(_0x124a45[_0xc721('0x2a')]['filter']){_0x213f10[_0xc721('0x33')]=_['merge'](_0x213f10['where'],{'$or':_[_0xc721('0x25')](_0x2e6073,function(_0x19b1df){if(_0x19b1df[_0xc721('0x28')]!==_0xc721('0x35')){var _0x326de5={};_0x326de5[_0x19b1df[_0xc721('0x23')]]={'$like':'%'+_0x124a45[_0xc721('0x2a')][_0xc721('0x36')]+'%'};return _0x326de5;}})});}_0x213f10=_[_0xc721('0x37')]({},_0x213f10,_0x124a45[_0xc721('0x38')]);var _0x4469b7={'where':_0x213f10[_0xc721('0x33')]};return db[_0xc721('0x26')][_0xc721('0x1b')](_0x4469b7)[_0xc721('0x20')](function(_0x29d1d9){_0x27991d[_0xc721('0x1b')]=_0x29d1d9;if(_0x124a45[_0xc721('0x2a')][_0xc721('0x39')]){_0x213f10[_0xc721('0x3a')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x213f10);})['then'](function(_0x5be408){_0x27991d[_0xc721('0x3b')]=_0x5be408;return _0x27991d;})[_0xc721('0x20')](respondWithFilteredResult(_0x30bcd7,_0x213f10))[_0xc721('0x3c')](handleError(_0x30bcd7,null));};exports[_0xc721('0x3d')]=function(_0x3ff8e5,_0x3a9b3c){var _0x1427d8={'raw':!![],'where':{'id':_0x3ff8e5[_0xc721('0x3e')]['id']}},_0x514a61={};_0x514a61[_0xc721('0x29')]=_[_0xc721('0x3f')](db[_0xc721('0x26')][_0xc721('0x27')]);_0x514a61[_0xc721('0x2a')]=_[_0xc721('0x3f')](_0x3ff8e5[_0xc721('0x2a')]);_0x514a61[_0xc721('0x2b')]=_[_0xc721('0x2c')](_0x514a61[_0xc721('0x29')],_0x514a61['query']);_0x1427d8['attributes']=_[_0xc721('0x2c')](_0x514a61[_0xc721('0x29')],qs['fields'](_0x3ff8e5[_0xc721('0x2a')][_0xc721('0x2e')]));_0x1427d8[_0xc721('0x2d')]=_0x1427d8[_0xc721('0x2d')][_0xc721('0x2f')]?_0x1427d8['attributes']:_0x514a61[_0xc721('0x29')];if(_0x3ff8e5[_0xc721('0x2a')]['includeAll']){_0x1427d8[_0xc721('0x3a')]=[{'all':!![]}];}_0x1427d8=_[_0xc721('0x37')]({},_0x1427d8,_0x3ff8e5[_0xc721('0x38')]);return db[_0xc721('0x26')][_0xc721('0x40')](_0x1427d8)[_0xc721('0x20')](handleEntityNotFound(_0x3a9b3c,null))[_0xc721('0x20')](respondWithResult(_0x3a9b3c,null))[_0xc721('0x3c')](handleError(_0x3a9b3c,null));};exports[_0xc721('0x41')]=function(_0x53db,_0x29855b){return db['VoiceDialReport'][_0xc721('0x41')](_0x53db[_0xc721('0x42')],{})[_0xc721('0x20')](respondWithResult(_0x29855b,0xc9))[_0xc721('0x3c')](handleError(_0x29855b,null));};exports['update']=function(_0x5b7d97,_0x5562fc){if(_0x5b7d97[_0xc721('0x42')]['id']){delete _0x5b7d97['body']['id'];}return db[_0xc721('0x26')][_0xc721('0x40')]({'where':{'id':_0x5b7d97[_0xc721('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5562fc,null))[_0xc721('0x20')](saveUpdates(_0x5b7d97['body'],null))[_0xc721('0x20')](respondWithResult(_0x5562fc,null))['catch'](handleError(_0x5562fc,null));};exports['destroy']=function(_0x342ecb,_0x235e9a){return db[_0xc721('0x26')][_0xc721('0x40')]({'where':{'id':_0x342ecb[_0xc721('0x3e')]['id']}})['then'](handleEntityNotFound(_0x235e9a,null))[_0xc721('0x20')](removeEntity(_0x235e9a,null))[_0xc721('0x3c')](handleError(_0x235e9a,null));};exports[_0xc721('0x43')]=function(_0x59867b,_0x1c8f06){return db[_0xc721('0x26')]['describe']()[_0xc721('0x20')](respondWithResult(_0x1c8f06,null))['catch'](handleError(_0x1c8f06,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 61a6a07..c3de49f 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 _0x3f91=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','moment'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x3f91,0x99));var _0x13f9=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3f91[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13f9('0x0'))(_0x13f9('0x1'));var moment=require(_0x13f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x13f9('0x3'));var fs=require('fs');var path=require(_0x13f9('0x4'));var rimraf=require(_0x13f9('0x5'));var config=require(_0x13f9('0x6'));var attributes=require(_0x13f9('0x7'));module[_0x13f9('0x8')]=function(_0x5b6ad9,_0x537190){return _0x5b6ad9[_0x13f9('0x9')](_0x13f9('0xa'),attributes,{'tableName':_0x13f9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x13f9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc94c=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0xc94c,0x7c));var _0xcc94=function(_0x210a7c,_0x4e6ed6){_0x210a7c=_0x210a7c-0x0;var _0xd7be81=_0xc94c[_0x210a7c];return _0xd7be81;};'use strict';var _=require(_0xcc94('0x0'));var util=require('util');var logger=require(_0xcc94('0x1'))('api');var moment=require(_0xcc94('0x2'));var BPromise=require(_0xcc94('0x3'));var rp=require(_0xcc94('0x4'));var fs=require('fs');var path=require(_0xcc94('0x5'));var rimraf=require(_0xcc94('0x6'));var config=require(_0xcc94('0x7'));var attributes=require(_0xcc94('0x8'));module[_0xcc94('0x9')]=function(_0x1462ea,_0xefabdd){return _0x1462ea[_0xcc94('0xa')]('VoiceDialReport',attributes,{'tableName':_0xcc94('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcc94('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 79a4432..e9b9e81 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 _0x1483=['UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x1483,0x85));var _0x3148=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x1483[_0x38b2d9];return _0x23a3e1;};'use strict';var _=require(_0x3148('0x0'));var util=require(_0x3148('0x1'));var moment=require('moment');var BPromise=require(_0x3148('0x2'));var rs=require(_0x3148('0x3'));var fs=require('fs');var Redis=require(_0x3148('0x4'));var db=require(_0x3148('0x5'))['db'];var utils=require(_0x3148('0x6'));var logger=require(_0x3148('0x7'))('rpc');var config=require(_0x3148('0x8'));var jayson=require(_0x3148('0x9'));var client=jayson['client'][_0x3148('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40f43d,_0x15efe4,_0xafe15b){return new BPromise(function(_0x110dbf,_0x28f63a){return client[_0x3148('0xb')](_0x40f43d,_0xafe15b)['then'](function(_0x2c7a15){logger[_0x3148('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x15efe4,_0x3148('0xd'));logger[_0x3148('0xe')](_0x3148('0xf'),_0x15efe4,_0x3148('0xd'),JSON[_0x3148('0x10')](_0x2c7a15));if(_0x2c7a15[_0x3148('0x11')]){if(_0x2c7a15[_0x3148('0x11')]['code']===0x1f4){logger[_0x3148('0x11')](_0x3148('0x12'),_0x15efe4,_0x2c7a15[_0x3148('0x11')][_0x3148('0x13')]);return _0x28f63a(_0x2c7a15[_0x3148('0x11')][_0x3148('0x13')]);}logger[_0x3148('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x15efe4,_0x2c7a15['error'][_0x3148('0x13')]);return _0x110dbf(_0x2c7a15[_0x3148('0x11')][_0x3148('0x13')]);}else{logger[_0x3148('0xc')](_0x3148('0x12'),_0x15efe4,_0x3148('0xd'));_0x110dbf(_0x2c7a15['result'][_0x3148('0x13')]);}})[_0x3148('0x14')](function(_0x24acfc){logger[_0x3148('0x11')](_0x3148('0x12'),_0x15efe4,_0x24acfc);_0x28f63a(_0x24acfc);});});}exports[_0x3148('0x15')]=function(_0x2decaa){var _0x3f46f4=this;return new Promise(function(_0x48097a,_0x8afe5){return db[_0x3148('0x16')][_0x3148('0x17')](_0x2decaa[_0x3148('0x18')],{'raw':_0x2decaa[_0x3148('0x19')]?_0x2decaa[_0x3148('0x19')][_0x3148('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x19ef47){logger['info'](_0x3148('0x15'),_0x2decaa);logger[_0x3148('0xe')](_0x3148('0x15'),_0x2decaa,JSON[_0x3148('0x10')](_0x19ef47));_0x48097a(_0x19ef47);})[_0x3148('0x14')](function(_0x432070){logger['error'](_0x3148('0x15'),_0x432070[_0x3148('0x13')],_0x2decaa);_0x8afe5(_0x3f46f4['error'](0x1f4,_0x432070[_0x3148('0x13')]));});});};exports[_0x3148('0x1b')]=function(_0x3b3e68){var _0x58bdff=this;return new Promise(function(_0x3c5638,_0x592b7e){return db['VoiceDialReport'][_0x3148('0x1c')](_0x3b3e68[_0x3148('0x18')],{'raw':_0x3b3e68[_0x3148('0x19')]?_0x3b3e68[_0x3148('0x19')][_0x3148('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b3e68[_0x3148('0x19')]?_0x3b3e68[_0x3148('0x19')][_0x3148('0x1d')]||null:null,'attributes':_0x3b3e68[_0x3148('0x19')]?_0x3b3e68['options'][_0x3148('0x1e')]||null:null,'limit':_0x3b3e68[_0x3148('0x19')]?_0x3b3e68['options'][_0x3148('0x1f')]||null:null})['then'](function(_0x10fd93){logger['info'](_0x3148('0x1b'),_0x3b3e68);logger[_0x3148('0xe')](_0x3148('0x1b'),_0x3b3e68,JSON['stringify'](_0x10fd93));_0x3c5638(_0x10fd93);})[_0x3148('0x14')](function(_0x2ecd40){logger[_0x3148('0x11')](_0x3148('0x1b'),_0x2ecd40[_0x3148('0x13')],_0x3b3e68);_0x592b7e(_0x58bdff[_0x3148('0x11')](0x1f4,_0x2ecd40['message']));});});}; \ No newline at end of file +var _0xa529=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','then','UpdateVoiceDialReport','raw','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x19ff50,_0x4ec334){var _0x33b996=function(_0x203a79){while(--_0x203a79){_0x19ff50['push'](_0x19ff50['shift']());}};_0x33b996(++_0x4ec334);}(_0xa529,0xdc));var _0x9a52=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa529[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9a52('0x0'));var util=require('util');var moment=require(_0x9a52('0x1'));var BPromise=require(_0x9a52('0x2'));var rs=require(_0x9a52('0x3'));var fs=require('fs');var Redis=require(_0x9a52('0x4'));var db=require(_0x9a52('0x5'))['db'];var utils=require(_0x9a52('0x6'));var logger=require(_0x9a52('0x7'))(_0x9a52('0x8'));var config=require(_0x9a52('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9a52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fb075,_0x4070bb,_0x5d2fdd){return new BPromise(function(_0x264840,_0x5ea311){return client[_0x9a52('0xb')](_0x2fb075,_0x5d2fdd)['then'](function(_0x4f5f61){logger[_0x9a52('0xc')](_0x9a52('0xd'),_0x4070bb,_0x9a52('0xe'));logger[_0x9a52('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4070bb,_0x9a52('0xe'),JSON[_0x9a52('0x10')](_0x4f5f61));if(_0x4f5f61[_0x9a52('0x11')]){if(_0x4f5f61[_0x9a52('0x11')]['code']===0x1f4){logger[_0x9a52('0x11')](_0x9a52('0xd'),_0x4070bb,_0x4f5f61['error']['message']);return _0x5ea311(_0x4f5f61[_0x9a52('0x11')][_0x9a52('0x12')]);}logger[_0x9a52('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x4070bb,_0x4f5f61['error'][_0x9a52('0x12')]);return _0x264840(_0x4f5f61[_0x9a52('0x11')][_0x9a52('0x12')]);}else{logger[_0x9a52('0xc')](_0x9a52('0xd'),_0x4070bb,_0x9a52('0xe'));_0x264840(_0x4f5f61['result'][_0x9a52('0x12')]);}})[_0x9a52('0x13')](function(_0x48b518){logger['error'](_0x9a52('0xd'),_0x4070bb,_0x48b518);_0x5ea311(_0x48b518);});});}exports[_0x9a52('0x14')]=function(_0x5ce007){var _0x323be6=this;return new Promise(function(_0x108295,_0x348870){return db[_0x9a52('0x15')][_0x9a52('0x16')](_0x5ce007[_0x9a52('0x17')],{'raw':_0x5ce007['options']?_0x5ce007[_0x9a52('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9a52('0x19')](function(_0xe7ca36){logger['info'](_0x9a52('0x14'),_0x5ce007);logger[_0x9a52('0xf')](_0x9a52('0x14'),_0x5ce007,JSON[_0x9a52('0x10')](_0xe7ca36));_0x108295(_0xe7ca36);})[_0x9a52('0x13')](function(_0x4f4e4f){logger['error']('CreateVoiceDialReport',_0x4f4e4f[_0x9a52('0x12')],_0x5ce007);_0x348870(_0x323be6[_0x9a52('0x11')](0x1f4,_0x4f4e4f['message']));});});};exports[_0x9a52('0x1a')]=function(_0x176ece){var _0x57d9fa=this;return new Promise(function(_0x4dc06d,_0x183908){return db[_0x9a52('0x15')]['update'](_0x176ece[_0x9a52('0x17')],{'raw':_0x176ece[_0x9a52('0x18')]?_0x176ece[_0x9a52('0x18')][_0x9a52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176ece['options']?_0x176ece[_0x9a52('0x18')]['where']||null:null,'attributes':_0x176ece[_0x9a52('0x18')]?_0x176ece['options'][_0x9a52('0x1c')]||null:null,'limit':_0x176ece[_0x9a52('0x18')]?_0x176ece['options']['limit']||null:null})[_0x9a52('0x19')](function(_0x3ab858){logger[_0x9a52('0xc')](_0x9a52('0x1a'),_0x176ece);logger[_0x9a52('0xf')](_0x9a52('0x1a'),_0x176ece,JSON[_0x9a52('0x10')](_0x3ab858));_0x4dc06d(_0x3ab858);})[_0x9a52('0x13')](function(_0x16d81f){logger[_0x9a52('0x11')](_0x9a52('0x1a'),_0x16d81f[_0x9a52('0x12')],_0x176ece);_0x183908(_0x57d9fa[_0x9a52('0x11')](0x1f4,_0x16d81f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c7bacef..90a3d96 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 _0x8fea=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','show','create','post','/:id/applications','addApplications','put'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8fea,0x1d1));var _0xa8fe=function(_0x28278f,_0x574b0d){_0x28278f=_0x28278f-0x0;var _0x3d9f74=_0x8fea[_0x28278f];return _0x3d9f74;};'use strict';var multer=require(_0xa8fe('0x0'));var util=require(_0xa8fe('0x1'));var path=require(_0xa8fe('0x2'));var timeout=require(_0xa8fe('0x3'));var express=require(_0xa8fe('0x4'));var router=express[_0xa8fe('0x5')]();var fs_extra=require(_0xa8fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa8fe('0x7'));var config=require('../../config/environment');var controller=require(_0xa8fe('0x8'));router[_0xa8fe('0x9')]('/',auth[_0xa8fe('0xa')](),controller[_0xa8fe('0xb')]);router[_0xa8fe('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa8fe('0xc')]);router['post']('/',auth[_0xa8fe('0xa')](),controller[_0xa8fe('0xd')]);router[_0xa8fe('0xe')](_0xa8fe('0xf'),auth[_0xa8fe('0xa')](),controller[_0xa8fe('0x10')]);router[_0xa8fe('0x11')]('/:id',auth[_0xa8fe('0xa')](),controller[_0xa8fe('0x12')]);router[_0xa8fe('0x13')](_0xa8fe('0x14'),auth[_0xa8fe('0xa')](),controller[_0xa8fe('0x15')]);module[_0xa8fe('0x16')]=router; \ No newline at end of file +var _0xe69d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','update','delete','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe69d,0x175));var _0xde69=function(_0x151ec1,_0x737b4a){_0x151ec1=_0x151ec1-0x0;var _0x185aa7=_0xe69d[_0x151ec1];return _0x185aa7;};'use strict';var multer=require(_0xde69('0x0'));var util=require(_0xde69('0x1'));var path=require(_0xde69('0x2'));var timeout=require(_0xde69('0x3'));var express=require(_0xde69('0x4'));var router=express[_0xde69('0x5')]();var fs_extra=require(_0xde69('0x6'));var auth=require(_0xde69('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xde69('0x8'));var controller=require(_0xde69('0x9'));router[_0xde69('0xa')]('/',auth[_0xde69('0xb')](),controller['index']);router[_0xde69('0xa')](_0xde69('0xc'),auth[_0xde69('0xb')](),controller[_0xde69('0xd')]);router[_0xde69('0xe')]('/',auth['isAuthenticated'](),controller[_0xde69('0xf')]);router[_0xde69('0xe')](_0xde69('0x10'),auth[_0xde69('0xb')](),controller[_0xde69('0x11')]);router['put'](_0xde69('0xc'),auth[_0xde69('0xb')](),controller[_0xde69('0x12')]);router[_0xde69('0x13')]('/:id',auth[_0xde69('0xb')](),controller[_0xde69('0x14')]);module[_0xde69('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 d040816..a6f7fe1 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 _0x7fbf=['inbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x7fbf,0xaa));var _0xf7fb=function(_0x3a60dd,_0x3345f9){_0x3a60dd=_0x3a60dd-0x0;var _0x581cae=_0x7fbf[_0x3a60dd];return _0x581cae;};'use strict';var Sequelize=require(_0xf7fb('0x0'));module[_0xf7fb('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf7fb('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xf7fb('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xf7fb('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf7fb('0x3')],'allowNull':![],'defaultValue':_0xf7fb('0x4')},'appdata':{'type':Sequelize[_0xf7fb('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf7fb('0x5')](_0xf7fb('0x6'),'outbound','internal',_0xf7fb('0x7'),'outbound-fax',_0xf7fb('0x8'),_0xf7fb('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xf7fb('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf7fb('0xa')},'IntervalId':{'type':Sequelize[_0xf7fb('0xb')]},'isApp':{'type':Sequelize[_0xf7fb('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf7fb('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf7fb('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xf7fb('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf7fb('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xf7fb('0xd')},'answer':{'type':Sequelize[_0xf7fb('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xf7fb('0xe')],'get':function(_0x1e7525){return this['getDataValue'](_0xf7fb('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x0fa4=['VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','outbound-fax','*,*,*,*','BOOLEAN','INTEGER'];(function(_0x1bd87b,_0x3cddb7){var _0x265ede=function(_0x306f47){while(--_0x306f47){_0x1bd87b['push'](_0x1bd87b['shift']());}};_0x265ede(++_0x3cddb7);}(_0x0fa4,0x111));var _0x40fa=function(_0x552a50,_0x91446e){_0x552a50=_0x552a50-0x0;var _0x46ea96=_0x0fa4[_0x552a50];return _0x46ea96;};'use strict';var Sequelize=require(_0x40fa('0x0'));module[_0x40fa('0x1')]={'context':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'unique':_0x40fa('0x3')},'priority':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x40fa('0x3')},'tag':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'defaultValue':_0x40fa('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x40fa('0x5')](_0x40fa('0x6'),'outbound',_0x40fa('0x7'),'inbound-fax',_0x40fa('0x8'),'system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x40fa('0x2')],'allowNull':![],'defaultValue':_0x40fa('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x40fa('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x40fa('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x40fa('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x40fa('0xb')]},'recordingFormat':{'type':Sequelize[_0x40fa('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x40fa('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x40fa('0xc')],'get':function(_0xdd80be){return this[_0x40fa('0xd')](_0x40fa('0xe'));}},'alias':{'type':Sequelize[_0x40fa('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 53ac5ae..4700963 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 _0x46c2=['update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','sequelize','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./voiceExtension.socket','register','sendStatus','end','offset','undefined','count','set','json','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','then','error','stack','status','index','VoiceExtension','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','merge','options','include','rows','catch','show','params','keys','includeAll','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x445e2f,_0x29f35e){var _0x443f61=function(_0x4c7a70){while(--_0x4c7a70){_0x445e2f['push'](_0x445e2f['shift']());}};_0x443f61(++_0x29f35e);}(_0x46c2,0x180));var _0x246c=function(_0x5186be,_0x560353){_0x5186be=_0x5186be-0x0;var _0x2b278b=_0x46c2[_0x5186be];return _0x2b278b;};'use strict';var _=require(_0x246c('0x0'));var Redis=require(_0x246c('0x1'));var qs=require(_0x246c('0x2'));var logger=require(_0x246c('0x3'))(_0x246c('0x4'));var config=require(_0x246c('0x5'));var db=require(_0x246c('0x6'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x246c('0x7')]));require(_0x246c('0x8'))[_0x246c('0x9')](socket);function respondWithStatusCode(_0x1c584d,_0x5492f5){_0x5492f5=_0x5492f5||0xcc;return function(_0x356bda){if(_0x356bda){return _0x1c584d[_0x246c('0xa')](_0x5492f5);}return _0x1c584d['status'](_0x5492f5)[_0x246c('0xb')]();};}function respondWithResult(_0x29e920,_0x4ab007){_0x4ab007=_0x4ab007||0xc8;return function(_0x549764){if(_0x549764){return _0x29e920['status'](_0x4ab007)['json'](_0x549764);}};}function respondWithFilteredResult(_0x492ab9,_0x555622){return function(_0xf30d80){if(_0xf30d80){var _0x388a98=typeof _0x555622[_0x246c('0xc')]===_0x246c('0xd')&&typeof _0x555622['limit']==='undefined';var _0xa3849=_0xf30d80[_0x246c('0xe')];var _0x27be26=_0x388a98?0x0:_0x555622[_0x246c('0xc')];var _0x37cee3=_0x388a98?_0xf30d80[_0x246c('0xe')]:_0x555622[_0x246c('0xc')]+_0x555622['limit'];var _0x2dd446;if(_0x37cee3>=_0xa3849){_0x37cee3=_0xa3849;_0x2dd446=0xc8;}else{_0x2dd446=0xce;}_0x492ab9['status'](_0x2dd446);return _0x492ab9[_0x246c('0xf')]('Content-Range',_0x27be26+'-'+_0x37cee3+'/'+_0xa3849)[_0x246c('0x10')](_0xf30d80);}return null;};}function removeEntity(_0xf9e922){return function(_0x4ae7e1){if(_0x4ae7e1){return _0x4ae7e1[_0x246c('0x11')]()['then'](function(){var _0x4848aa=_0x4ae7e1[_0x246c('0x12')]({'plain':!![]});var _0x136563=[{'name':_0x246c('0x13'),'value':_0x246c('0x14'),'ignore':![]},{'name':_0x246c('0x15'),'value':_0x246c('0x16'),'ignore':![]},{'name':_0x246c('0x17'),'value':_0x246c('0x18'),'ignore':![]}];var _0x3fb06d=_(_0x136563)[_0x246c('0x19')](_0x246c('0x1a'))[_0x246c('0x1b')](_0x246c('0x1c'))[_0x246c('0x1c')]();if(_[_0x246c('0x1d')](_0x3fb06d,_0x4848aa[_0x246c('0x1e')])){return;}var _0x2734e2=_[_0x246c('0x1f')](_0x136563,[_0x246c('0x1c'),_0x4848aa[_0x246c('0x1e')]])[_0x246c('0x20')];return db[_0x246c('0x21')][_0x246c('0x11')]({'where':{'type':_0x2734e2,'resourceId':_0x4848aa['id']}})[_0x246c('0x22')](function(){return _0x4ae7e1;});})[_0x246c('0x22')](function(){_0xf9e922['status'](0xcc)[_0x246c('0xb')]();});}};}function handleEntityNotFound(_0x1802bc){return function(_0x2ca2bb){if(!_0x2ca2bb){_0x1802bc[_0x246c('0xa')](0x194);}return _0x2ca2bb;};}function handleError(_0x529071,_0x42c858){_0x42c858=_0x42c858||0x1f4;return function(_0x4544c9){logger[_0x246c('0x23')](_0x4544c9[_0x246c('0x24')]);if(_0x4544c9[_0x246c('0x20')]){delete _0x4544c9[_0x246c('0x20')];}_0x529071[_0x246c('0x25')](_0x42c858)['send'](_0x4544c9);};}exports[_0x246c('0x26')]=function(_0x2c4a49,_0x324fe3){var _0x4e3185={},_0x5259e8={},_0x4b7d5a={'count':0x0,'rows':[]};var _0x34dc8d=_[_0x246c('0x1b')](db[_0x246c('0x27')][_0x246c('0x28')],function(_0x28abb7){return{'name':_0x28abb7[_0x246c('0x29')],'type':_0x28abb7['type'][_0x246c('0x2a')]};});_0x5259e8[_0x246c('0x2b')]=_[_0x246c('0x1b')](_0x34dc8d,_0x246c('0x20'));_0x5259e8[_0x246c('0x2c')]=_['keys'](_0x2c4a49['query']);_0x5259e8['filters']=_[_0x246c('0x2d')](_0x5259e8[_0x246c('0x2b')],_0x5259e8[_0x246c('0x2c')]);_0x4e3185['attributes']=_[_0x246c('0x2d')](_0x5259e8[_0x246c('0x2b')],qs[_0x246c('0x2e')](_0x2c4a49[_0x246c('0x2c')]['fields']));_0x4e3185[_0x246c('0x2f')]=_0x4e3185[_0x246c('0x2f')]['length']?_0x4e3185[_0x246c('0x2f')]:_0x5259e8[_0x246c('0x2b')];if(!_0x2c4a49['query'][_0x246c('0x30')](_0x246c('0x31'))){_0x4e3185['limit']=qs['limit'](_0x2c4a49[_0x246c('0x2c')][_0x246c('0x32')]);_0x4e3185[_0x246c('0xc')]=qs[_0x246c('0xc')](_0x2c4a49['query'][_0x246c('0xc')]);}_0x4e3185[_0x246c('0x33')]=qs[_0x246c('0x34')](_0x2c4a49[_0x246c('0x2c')][_0x246c('0x34')]);_0x4e3185[_0x246c('0x35')]=qs[_0x246c('0x36')](_[_0x246c('0x37')](_0x2c4a49[_0x246c('0x2c')],_0x5259e8[_0x246c('0x36')]),_0x34dc8d);if(_0x2c4a49[_0x246c('0x2c')]['filter']){_0x4e3185['where']=_['merge'](_0x4e3185[_0x246c('0x35')],{'$or':_[_0x246c('0x1b')](_0x34dc8d,function(_0x1303fc){if(_0x1303fc[_0x246c('0x1e')]!==_0x246c('0x38')){var _0x50a1f4={};_0x50a1f4[_0x1303fc['name']]={'$like':'%'+_0x2c4a49[_0x246c('0x2c')]['filter']+'%'};return _0x50a1f4;}})});}_0x4e3185=_[_0x246c('0x39')]({},_0x4e3185,_0x2c4a49[_0x246c('0x3a')]);var _0xfed256={'where':_0x4e3185[_0x246c('0x35')]};return db[_0x246c('0x27')][_0x246c('0xe')](_0xfed256)[_0x246c('0x22')](function(_0x4425fa){_0x4b7d5a['count']=_0x4425fa;if(_0x2c4a49[_0x246c('0x2c')]['includeAll']){_0x4e3185[_0x246c('0x3b')]=[{'all':!![]}];}return db[_0x246c('0x27')]['findAll'](_0x4e3185);})[_0x246c('0x22')](function(_0x1b7546){_0x4b7d5a[_0x246c('0x3c')]=_0x1b7546;return _0x4b7d5a;})['then'](respondWithFilteredResult(_0x324fe3,_0x4e3185))[_0x246c('0x3d')](handleError(_0x324fe3,null));};exports[_0x246c('0x3e')]=function(_0x543f60,_0xd935c0){var _0x44124a={'raw':![],'where':{'id':_0x543f60[_0x246c('0x3f')]['id']}},_0x222e1a={};_0x222e1a[_0x246c('0x2b')]=_[_0x246c('0x40')](db[_0x246c('0x27')]['rawAttributes']);_0x222e1a[_0x246c('0x2c')]=_[_0x246c('0x40')](_0x543f60[_0x246c('0x2c')]);_0x222e1a['filters']=_[_0x246c('0x2d')](_0x222e1a[_0x246c('0x2b')],_0x222e1a[_0x246c('0x2c')]);_0x44124a[_0x246c('0x2f')]=_[_0x246c('0x2d')](_0x222e1a[_0x246c('0x2b')],qs['fields'](_0x543f60[_0x246c('0x2c')][_0x246c('0x2e')]));_0x44124a[_0x246c('0x2f')]=_0x44124a[_0x246c('0x2f')]['length']?_0x44124a['attributes']:_0x222e1a[_0x246c('0x2b')];if(_0x543f60[_0x246c('0x2c')][_0x246c('0x41')]){_0x44124a['include']=[{'all':!![]}];}_0x44124a=_[_0x246c('0x39')]({},_0x44124a,_0x543f60[_0x246c('0x3a')]);return db[_0x246c('0x27')]['find'](_0x44124a)[_0x246c('0x22')](handleEntityNotFound(_0xd935c0,null))[_0x246c('0x22')](respondWithResult(_0xd935c0,null))['catch'](handleError(_0xd935c0,null));};exports[_0x246c('0x11')]=function(_0x3f2de0,_0x5bf21a){return db[_0x246c('0x27')][_0x246c('0x1f')]({'where':{'id':_0x3f2de0['params']['id']}})['then'](handleEntityNotFound(_0x5bf21a,null))['then'](removeEntity(_0x5bf21a,null))['catch'](handleError(_0x5bf21a,null));};exports[_0x246c('0x42')]=function(_0xa2ab0b,_0x5295af){if(_0xa2ab0b[_0x246c('0x43')][_0x246c('0x1e')]===_0x246c('0x16')&&!_[_0x246c('0x44')](_0xa2ab0b[_0x246c('0x43')][_0x246c('0x45')],'_')){_0xa2ab0b[_0x246c('0x43')][_0x246c('0x45')]='_'[_0x246c('0x46')](_0xa2ab0b[_0x246c('0x43')][_0x246c('0x45')]);}return db[_0x246c('0x27')][_0x246c('0x42')](_0xa2ab0b[_0x246c('0x43')],{'raw':![]})[_0x246c('0x22')](function(_0xe6209c){var _0x167ef7=_0xa2ab0b['user'][_0x246c('0x12')]({'plain':!![]});if(!_0x167ef7)throw new Error(_0x246c('0x47'));if(_0x167ef7['role']===_0x246c('0x48')){var _0x23af88=_0xe6209c['get']({'plain':!![]});var _0x2e386c=[{'name':'InboundRoutes','value':_0x246c('0x14')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x246c('0x17'),'value':_0x246c('0x18')}];var _0x2cb8aa=_[_0x246c('0x1f')](_0x2e386c,[_0x246c('0x1c'),_0x23af88[_0x246c('0x1e')]])[_0x246c('0x20')];return db[_0x246c('0x49')]['find']({'where':{'name':_0x2cb8aa,'userProfileId':_0x167ef7['userProfileId']},'raw':!![]})[_0x246c('0x22')](function(_0x5c78d4){if(_0x5c78d4&&_0x5c78d4[_0x246c('0x4a')]===0x0){return db[_0x246c('0x21')][_0x246c('0x42')]({'name':_0x23af88[_0x246c('0x20')],'resourceId':_0x23af88['id'],'type':_0x5c78d4[_0x246c('0x20')],'sectionId':_0x5c78d4['id']},{})['then'](function(){return _0xe6209c;});}else{return _0xe6209c;}})[_0x246c('0x3d')](function(_0x4c3d33){logger[_0x246c('0x23')](_0x246c('0x4b'),_0x4c3d33);throw _0x4c3d33;});}return _0xe6209c;})[_0x246c('0x22')](respondWithResult(_0x5295af,0xc9))[_0x246c('0x3d')](handleError(_0x5295af,null));};exports[_0x246c('0x4c')]=function(_0x26a28d,_0x126d23){if(_0x26a28d[_0x246c('0x43')]['id']){delete _0x26a28d[_0x246c('0x43')]['id'];}return db[_0x246c('0x27')][_0x246c('0x1f')]({'where':{'id':_0x26a28d[_0x246c('0x3f')]['id']}})[_0x246c('0x22')](handleEntityNotFound(_0x126d23,null))[_0x246c('0x22')](function(_0x36f39a){if(_0x36f39a){return db[_0x246c('0x27')][_0x246c('0x4c')](_[_0x246c('0x37')](_0x26a28d[_0x246c('0x43')],['exten',_0x246c('0x4d'),_0x246c('0x4e'),_0x246c('0x4f'),'cutdigits',_0x246c('0x50'),_0x246c('0x51')]),{'where':{'context':_0x36f39a['context'],'exten':_0x36f39a[_0x246c('0x45')]},'individualHooks':!![]})['then'](function(_0xad43e4){return _0xad43e4;});}return null;})['then'](respondWithStatusCode(_0x126d23,null))['catch'](handleError(_0x126d23,null));};exports[_0x246c('0x52')]=function(_0x3e5304,_0x4fb20b){return db[_0x246c('0x27')][_0x246c('0x53')]({'where':{'id':_0x3e5304[_0x246c('0x3f')]['id']}})[_0x246c('0x22')](function(_0x2a87fd){if(_0x2a87fd){return db[_0x246c('0x54')]['transaction'](function(_0x1f7dbd){return db[_0x246c('0x27')][_0x246c('0x11')]({'where':{'VoiceExtensionId':_0x3e5304[_0x246c('0x3f')]['id']},'transaction':_0x1f7dbd})[_0x246c('0x22')](function(){var _0x373915=_[_0x246c('0x1b')](_0x3e5304[_0x246c('0x43')],function(_0x126a22){_0x126a22[_0x246c('0x55')]=_0x3e5304['params']['id'];_0x126a22[_0x246c('0x56')]=!![];return _0x126a22;});return _0x2a87fd[_0x246c('0x57')](_0x373915);})[_0x246c('0x22')](function(_0x5d2fc2){console[_0x246c('0x58')](_0x246c('0x59'),_0x5d2fc2);return db[_0x246c('0x27')]['bulkCreate'](_0x5d2fc2,{'transaction':_0x1f7dbd});});})[_0x246c('0x22')](function(){return db[_0x246c('0x27')][_0x246c('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3e5304[_0x246c('0x3f')]['id']},'order':_0x246c('0x5b')});});}})['then'](respondWithResult(_0x4fb20b,null))[_0x246c('0x3d')](handleError(_0x4fb20b,null));}; \ No newline at end of file +var _0xbebe=['status','offset','undefined','count','limit','set','Content-Range','json','destroy','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','value','includes','type','name','UserProfileResource','end','error','stack','send','index','map','VoiceExtension','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','startsWith','exten','concat','user','role','InboundRoutes','InternalRoutes','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','log','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceExtension.socket','register','sendStatus'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbebe,0xab));var _0xebeb=function(_0x46b60f,_0x3fddae){_0x46b60f=_0x46b60f-0x0;var _0x285100=_0xbebe[_0x46b60f];return _0x285100;};'use strict';var _=require(_0xebeb('0x0'));var Redis=require(_0xebeb('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xebeb('0x2'))(_0xebeb('0x3'));var config=require(_0xebeb('0x4'));var db=require(_0xebeb('0x5'))['db'];config['redis']=_[_0xebeb('0x6')](config['redis'],{'host':_0xebeb('0x7'),'port':0x18eb});var socket=require(_0xebeb('0x8'))(new Redis(config[_0xebeb('0x9')]));require(_0xebeb('0xa'))[_0xebeb('0xb')](socket);function respondWithStatusCode(_0x2b0c0f,_0x8a7f2f){_0x8a7f2f=_0x8a7f2f||0xcc;return function(_0x95f163){if(_0x95f163){return _0x2b0c0f[_0xebeb('0xc')](_0x8a7f2f);}return _0x2b0c0f[_0xebeb('0xd')](_0x8a7f2f)['end']();};}function respondWithResult(_0x207d74,_0x4132cf){_0x4132cf=_0x4132cf||0xc8;return function(_0x125e1a){if(_0x125e1a){return _0x207d74[_0xebeb('0xd')](_0x4132cf)['json'](_0x125e1a);}};}function respondWithFilteredResult(_0xac441d,_0x1ddf8b){return function(_0x52415d){if(_0x52415d){var _0x56d2fe=typeof _0x1ddf8b[_0xebeb('0xe')]===_0xebeb('0xf')&&typeof _0x1ddf8b['limit']===_0xebeb('0xf');var _0xcb041a=_0x52415d[_0xebeb('0x10')];var _0x52d2a3=_0x56d2fe?0x0:_0x1ddf8b[_0xebeb('0xe')];var _0x38c772=_0x56d2fe?_0x52415d[_0xebeb('0x10')]:_0x1ddf8b[_0xebeb('0xe')]+_0x1ddf8b[_0xebeb('0x11')];var _0x4500fc;if(_0x38c772>=_0xcb041a){_0x38c772=_0xcb041a;_0x4500fc=0xc8;}else{_0x4500fc=0xce;}_0xac441d['status'](_0x4500fc);return _0xac441d[_0xebeb('0x12')](_0xebeb('0x13'),_0x52d2a3+'-'+_0x38c772+'/'+_0xcb041a)[_0xebeb('0x14')](_0x52415d);}return null;};}function removeEntity(_0x4b64e0){return function(_0x3e7c30){if(_0x3e7c30){return _0x3e7c30[_0xebeb('0x15')]()[_0xebeb('0x16')](function(){var _0x2ade90=_0x3e7c30[_0xebeb('0x17')]({'plain':!![]});var _0x3d3d75=[{'name':'InboundRoutes','value':_0xebeb('0x18'),'ignore':![]},{'name':_0xebeb('0x19'),'value':_0xebeb('0x1a'),'ignore':![]},{'name':'InternalRoutes','value':_0xebeb('0x1b'),'ignore':![]}];var _0x27b2b7=_(_0x3d3d75)[_0xebeb('0x1c')](_0xebeb('0x1d'))['map'](_0xebeb('0x1e'))[_0xebeb('0x1e')]();if(_[_0xebeb('0x1f')](_0x27b2b7,_0x2ade90[_0xebeb('0x20')])){return;}var _0x34bdaf=_['find'](_0x3d3d75,['value',_0x2ade90['type']])[_0xebeb('0x21')];return db[_0xebeb('0x22')][_0xebeb('0x15')]({'where':{'type':_0x34bdaf,'resourceId':_0x2ade90['id']}})[_0xebeb('0x16')](function(){return _0x3e7c30;});})[_0xebeb('0x16')](function(){_0x4b64e0[_0xebeb('0xd')](0xcc)[_0xebeb('0x23')]();});}};}function handleEntityNotFound(_0x3d6c8b){return function(_0x30ea64){if(!_0x30ea64){_0x3d6c8b[_0xebeb('0xc')](0x194);}return _0x30ea64;};}function handleError(_0x32e4a9,_0x10a84b){_0x10a84b=_0x10a84b||0x1f4;return function(_0x14c2e0){logger[_0xebeb('0x24')](_0x14c2e0[_0xebeb('0x25')]);if(_0x14c2e0['name']){delete _0x14c2e0[_0xebeb('0x21')];}_0x32e4a9[_0xebeb('0xd')](_0x10a84b)[_0xebeb('0x26')](_0x14c2e0);};}exports[_0xebeb('0x27')]=function(_0x1477ec,_0x45c611){var _0x2a3904={},_0x5afc96={},_0x525557={'count':0x0,'rows':[]};var _0x7a7a7e=_[_0xebeb('0x28')](db[_0xebeb('0x29')]['rawAttributes'],function(_0x57a582){return{'name':_0x57a582['fieldName'],'type':_0x57a582[_0xebeb('0x20')][_0xebeb('0x2a')]};});_0x5afc96[_0xebeb('0x2b')]=_[_0xebeb('0x28')](_0x7a7a7e,_0xebeb('0x21'));_0x5afc96[_0xebeb('0x2c')]=_[_0xebeb('0x2d')](_0x1477ec['query']);_0x5afc96[_0xebeb('0x2e')]=_['intersection'](_0x5afc96[_0xebeb('0x2b')],_0x5afc96['query']);_0x2a3904[_0xebeb('0x2f')]=_[_0xebeb('0x30')](_0x5afc96['model'],qs['fields'](_0x1477ec[_0xebeb('0x2c')][_0xebeb('0x31')]));_0x2a3904[_0xebeb('0x2f')]=_0x2a3904[_0xebeb('0x2f')][_0xebeb('0x32')]?_0x2a3904[_0xebeb('0x2f')]:_0x5afc96['model'];if(!_0x1477ec['query'][_0xebeb('0x33')](_0xebeb('0x34'))){_0x2a3904[_0xebeb('0x11')]=qs[_0xebeb('0x11')](_0x1477ec[_0xebeb('0x2c')][_0xebeb('0x11')]);_0x2a3904[_0xebeb('0xe')]=qs[_0xebeb('0xe')](_0x1477ec[_0xebeb('0x2c')]['offset']);}_0x2a3904[_0xebeb('0x35')]=qs[_0xebeb('0x36')](_0x1477ec[_0xebeb('0x2c')]['sort']);_0x2a3904[_0xebeb('0x37')]=qs['filters'](_['pick'](_0x1477ec[_0xebeb('0x2c')],_0x5afc96[_0xebeb('0x2e')]),_0x7a7a7e);if(_0x1477ec['query'][_0xebeb('0x1c')]){_0x2a3904['where']=_[_0xebeb('0x38')](_0x2a3904[_0xebeb('0x37')],{'$or':_['map'](_0x7a7a7e,function(_0x3223f0){if(_0x3223f0[_0xebeb('0x20')]!==_0xebeb('0x39')){var _0x9c969e={};_0x9c969e[_0x3223f0[_0xebeb('0x21')]]={'$like':'%'+_0x1477ec[_0xebeb('0x2c')][_0xebeb('0x1c')]+'%'};return _0x9c969e;}})});}_0x2a3904=_[_0xebeb('0x38')]({},_0x2a3904,_0x1477ec[_0xebeb('0x3a')]);var _0x4fee8e={'where':_0x2a3904[_0xebeb('0x37')]};return db[_0xebeb('0x29')][_0xebeb('0x10')](_0x4fee8e)['then'](function(_0x5a5d37){_0x525557[_0xebeb('0x10')]=_0x5a5d37;if(_0x1477ec[_0xebeb('0x2c')][_0xebeb('0x3b')]){_0x2a3904['include']=[{'all':!![]}];}return db[_0xebeb('0x29')]['findAll'](_0x2a3904);})[_0xebeb('0x16')](function(_0xa2c14d){_0x525557[_0xebeb('0x3c')]=_0xa2c14d;return _0x525557;})[_0xebeb('0x16')](respondWithFilteredResult(_0x45c611,_0x2a3904))[_0xebeb('0x3d')](handleError(_0x45c611,null));};exports['show']=function(_0x614b50,_0x8420c4){var _0x161be5={'raw':![],'where':{'id':_0x614b50[_0xebeb('0x3e')]['id']}},_0x5791c0={};_0x5791c0[_0xebeb('0x2b')]=_[_0xebeb('0x2d')](db[_0xebeb('0x29')][_0xebeb('0x3f')]);_0x5791c0[_0xebeb('0x2c')]=_['keys'](_0x614b50[_0xebeb('0x2c')]);_0x5791c0['filters']=_[_0xebeb('0x30')](_0x5791c0[_0xebeb('0x2b')],_0x5791c0['query']);_0x161be5[_0xebeb('0x2f')]=_[_0xebeb('0x30')](_0x5791c0[_0xebeb('0x2b')],qs[_0xebeb('0x31')](_0x614b50[_0xebeb('0x2c')][_0xebeb('0x31')]));_0x161be5[_0xebeb('0x2f')]=_0x161be5[_0xebeb('0x2f')][_0xebeb('0x32')]?_0x161be5[_0xebeb('0x2f')]:_0x5791c0[_0xebeb('0x2b')];if(_0x614b50[_0xebeb('0x2c')]['includeAll']){_0x161be5[_0xebeb('0x40')]=[{'all':!![]}];}_0x161be5=_[_0xebeb('0x38')]({},_0x161be5,_0x614b50[_0xebeb('0x3a')]);return db['VoiceExtension']['find'](_0x161be5)[_0xebeb('0x16')](handleEntityNotFound(_0x8420c4,null))[_0xebeb('0x16')](respondWithResult(_0x8420c4,null))[_0xebeb('0x3d')](handleError(_0x8420c4,null));};exports[_0xebeb('0x15')]=function(_0x46f07e,_0x3a0ae4){return db['VoiceExtension'][_0xebeb('0x41')]({'where':{'id':_0x46f07e[_0xebeb('0x3e')]['id']}})[_0xebeb('0x16')](handleEntityNotFound(_0x3a0ae4,null))['then'](removeEntity(_0x3a0ae4,null))[_0xebeb('0x3d')](handleError(_0x3a0ae4,null));};exports[_0xebeb('0x42')]=function(_0x4347c4,_0x3ed5b5){if(_0x4347c4[_0xebeb('0x43')][_0xebeb('0x20')]===_0xebeb('0x1a')&&!_[_0xebeb('0x44')](_0x4347c4[_0xebeb('0x43')][_0xebeb('0x45')],'_')){_0x4347c4[_0xebeb('0x43')]['exten']='_'[_0xebeb('0x46')](_0x4347c4[_0xebeb('0x43')][_0xebeb('0x45')]);}return db[_0xebeb('0x29')][_0xebeb('0x42')](_0x4347c4[_0xebeb('0x43')],{'raw':![]})[_0xebeb('0x16')](function(_0x11270d){var _0x3821ca=_0x4347c4[_0xebeb('0x47')]['get']({'plain':!![]});if(!_0x3821ca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3821ca[_0xebeb('0x48')]===_0xebeb('0x47')){var _0x4ccd4a=_0x11270d[_0xebeb('0x17')]({'plain':!![]});var _0x530d76=[{'name':_0xebeb('0x49'),'value':_0xebeb('0x18')},{'name':'OutboundRoutes','value':_0xebeb('0x1a')},{'name':_0xebeb('0x4a'),'value':_0xebeb('0x1b')}];var _0x4511a9=_[_0xebeb('0x41')](_0x530d76,[_0xebeb('0x1e'),_0x4ccd4a['type']])[_0xebeb('0x21')];return db['UserProfileSection'][_0xebeb('0x41')]({'where':{'name':_0x4511a9,'userProfileId':_0x3821ca['userProfileId']},'raw':!![]})[_0xebeb('0x16')](function(_0x308e50){if(_0x308e50&&_0x308e50['autoAssociation']===0x0){return db[_0xebeb('0x22')][_0xebeb('0x42')]({'name':_0x4ccd4a[_0xebeb('0x21')],'resourceId':_0x4ccd4a['id'],'type':_0x308e50[_0xebeb('0x21')],'sectionId':_0x308e50['id']},{})[_0xebeb('0x16')](function(){return _0x11270d;});}else{return _0x11270d;}})[_0xebeb('0x3d')](function(_0x382bdf){logger[_0xebeb('0x24')](_0xebeb('0x4b'),_0x382bdf);throw _0x382bdf;});}return _0x11270d;})['then'](respondWithResult(_0x3ed5b5,0xc9))[_0xebeb('0x3d')](handleError(_0x3ed5b5,null));};exports['update']=function(_0x4cd918,_0x2d4029){if(_0x4cd918[_0xebeb('0x43')]['id']){delete _0x4cd918[_0xebeb('0x43')]['id'];}return db[_0xebeb('0x29')][_0xebeb('0x41')]({'where':{'id':_0x4cd918[_0xebeb('0x3e')]['id']}})[_0xebeb('0x16')](handleEntityNotFound(_0x2d4029,null))[_0xebeb('0x16')](function(_0x175bc0){if(_0x175bc0){return db[_0xebeb('0x29')]['update'](_[_0xebeb('0x4c')](_0x4cd918[_0xebeb('0x43')],['exten',_0xebeb('0x4d'),_0xebeb('0x4e'),'recordingFormat','cutdigits',_0xebeb('0x4f'),_0xebeb('0x50')]),{'where':{'context':_0x175bc0[_0xebeb('0x4d')],'exten':_0x175bc0[_0xebeb('0x45')]},'individualHooks':!![]})[_0xebeb('0x16')](function(_0x3ff9b5){return _0x3ff9b5;});}return null;})[_0xebeb('0x16')](respondWithStatusCode(_0x2d4029,null))[_0xebeb('0x3d')](handleError(_0x2d4029,null));};exports[_0xebeb('0x51')]=function(_0x2f7824,_0x1029e5){return db[_0xebeb('0x29')][_0xebeb('0x52')]({'where':{'id':_0x2f7824[_0xebeb('0x3e')]['id']}})[_0xebeb('0x16')](function(_0x705249){if(_0x705249){return db[_0xebeb('0x53')][_0xebeb('0x54')](function(_0x3aa96f){return db[_0xebeb('0x29')][_0xebeb('0x15')]({'where':{'VoiceExtensionId':_0x2f7824[_0xebeb('0x3e')]['id']},'transaction':_0x3aa96f})[_0xebeb('0x16')](function(){var _0x13ffaf=_[_0xebeb('0x28')](_0x2f7824['body'],function(_0x2a476d){_0x2a476d[_0xebeb('0x55')]=_0x2f7824[_0xebeb('0x3e')]['id'];_0x2a476d[_0xebeb('0x56')]=!![];return _0x2a476d;});return _0x705249[_0xebeb('0x57')](_0x13ffaf);})[_0xebeb('0x16')](function(_0x66def6){console[_0xebeb('0x58')]('LOG\x20~\x20.then\x20~\x20routing',_0x66def6);return db[_0xebeb('0x29')][_0xebeb('0x59')](_0x66def6,{'transaction':_0x3aa96f});});})[_0xebeb('0x16')](function(){return db['VoiceExtension'][_0xebeb('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f7824[_0xebeb('0x3e')]['id']},'order':_0xebeb('0x5b')});});}})['then'](respondWithResult(_0x1029e5,null))[_0xebeb('0x3d')](handleError(_0x1029e5,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d697905..faad078 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 _0xb4dd=['VoiceExtension','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x4516fb,_0x5d9950){var _0x1d891c=function(_0x324800){while(--_0x324800){_0x4516fb['push'](_0x4516fb['shift']());}};_0x1d891c(++_0x5d9950);}(_0xb4dd,0x1a5));var _0xdb4d=function(_0x3656e8,_0x105208){_0x3656e8=_0x3656e8-0x0;var _0x5681b8=_0xb4dd[_0x3656e8];return _0x5681b8;};'use strict';var EventEmitter=require(_0xdb4d('0x0'));var VoiceExtension=require(_0xdb4d('0x1'))['db'][_0xdb4d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xdb4d('0x3')](0x0);var events={'afterCreate':_0xdb4d('0x4'),'afterUpdate':_0xdb4d('0x5'),'afterDestroy':_0xdb4d('0x6')};function emitEvent(_0x4bf9a2){return function(_0x5e97c7,_0x5c6950,_0x183f73){VoiceExtensionEvents[_0xdb4d('0x7')](_0x4bf9a2+':'+_0x5e97c7['id'],_0x5e97c7);VoiceExtensionEvents[_0xdb4d('0x7')](_0x4bf9a2,_0x5e97c7);_0x183f73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xdb4d('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x6171=['../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','events'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x6171,0x14f));var _0x1617=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x6171[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0x1617('0x0'));var VoiceExtension=require(_0x1617('0x1'))['db'][_0x1617('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1617('0x3'),'afterUpdate':_0x1617('0x4'),'afterDestroy':_0x1617('0x5')};function emitEvent(_0x3a3cfa){return function(_0x3e5a4e,_0x50814e,_0x58fffa){VoiceExtensionEvents[_0x1617('0x6')](_0x3a3cfa+':'+_0x3e5a4e['id'],_0x3e5a4e);VoiceExtensionEvents[_0x1617('0x6')](_0x3a3cfa,_0x3e5a4e);_0x58fffa(null);};}for(var e in events){if(events[_0x1617('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 7d54fba..3461dd7 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 _0x96aa=['callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','name','param','prefix','phone','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','then','length','interval','intervals','filter','IntervalId','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x96aa,0x67));var _0xa96a=function(_0x1c90a9,_0x63d7c1){_0x1c90a9=_0x1c90a9-0x0;var _0xbddb89=_0x96aa[_0x1c90a9];return _0xbddb89;};'use strict';var _=require(_0xa96a('0x0'));var attributes=require(_0xa96a('0x1'));module['exports']=function(_0x4519b6){var _0x32bff8=_0x4519b6[_0xa96a('0x2')];function _0x12bbb7(_0x10a117){var _0x4911c8=0x2;var _0x1ce4a1=[{'type':_0x10a117[_0xa96a('0x3')],'app':'Set','appdata':_0xa96a('0x4')+_0x10a117[_0xa96a('0x3')],'context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117[_0xa96a('0x6')],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']},{'type':_0x10a117[_0xa96a('0x3')],'app':_0x10a117[_0xa96a('0x7')]?_0xa96a('0x8'):_0xa96a('0x9'),'appdata':_0x10a117[_0xa96a('0x7')]?_0xa96a('0xa')+_0x10a117[_0xa96a('0x7')]:'No\x20alias\x20set','context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117['exten'],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']}];if(_0x10a117[_0xa96a('0x3')]===_0xa96a('0xb')){_0x1ce4a1['push']({'type':_0xa96a('0xb'),'app':_0xa96a('0x8'),'appdata':_0xa96a('0xc')+_0x10a117['id'],'context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117[_0xa96a('0x6')],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']});}_0x1ce4a1[_0xa96a('0xd')]({'type':_0x10a117[_0xa96a('0x3')],'app':_0xa96a('0x8'),'appdata':_0xa96a('0xe'),'context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117[_0xa96a('0x6')],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']},{'type':_0x10a117[_0xa96a('0x3')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117['exten'],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']},{'type':_0x10a117[_0xa96a('0x3')],'app':'Set','appdata':_0xa96a('0xf'),'context':_0x10a117[_0xa96a('0x5')],'exten':_0x10a117[_0xa96a('0x6')],'priority':_0x4911c8++,'VoiceExtensionId':_0x10a117['id']});return _0x1ce4a1;}function _0x3372f9(_0x11503){var _0x16257d=0x2;var _0x5013f8=[{'type':_0xa96a('0x10'),'app':_0xa96a('0x8'),'appdata':'CDR(type)=outbound','context':_0x11503[_0xa96a('0x5')],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':_0x11503[_0xa96a('0x7')]?_0xa96a('0x8'):_0xa96a('0x9'),'appdata':_0x11503[_0xa96a('0x7')]?_0xa96a('0xa')+_0x11503[_0xa96a('0x7')]:'No\x20alias\x20set','context':_0x11503[_0xa96a('0x5')],'exten':_0x11503['exten'],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':'Set','appdata':_0xa96a('0x11')+(_0x11503[_0xa96a('0x12')]?'${EXTEN:'+_0x11503['cutdigits']+'}':_0xa96a('0x13')),'context':_0x11503[_0xa96a('0x5')],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':_0xa96a('0x8'),'appdata':_0xa96a('0xc')+_0x11503['id'],'context':_0x11503['context'],'exten':_0x11503['exten'],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':'ExecIf','appdata':_0xa96a('0x14')+(_0x16257d+0x2)+_0xa96a('0x15')+(_0x16257d+0x1)+')','context':_0x11503[_0xa96a('0x5')],'exten':_0x11503['exten'],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':'Set','appdata':_0x11503['cutdigits']?_0xa96a('0x16')+_0x11503['cutdigits']+'}':_0xa96a('0x17'),'context':_0x11503[_0xa96a('0x5')],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':'outbound','app':_0xa96a('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x11503['context'],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':'outbound','app':'Set','appdata':_0xa96a('0x18'),'context':_0x11503[_0xa96a('0x5')],'exten':_0x11503['exten'],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':_0xa96a('0x8'),'appdata':_0xa96a('0xf'),'context':_0x11503[_0xa96a('0x5')],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':'outbound','app':_0xa96a('0x8'),'appdata':_0xa96a('0x19')+_0x11503['id'],'context':_0x11503['context'],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']}];if(_0x11503[_0xa96a('0x1a')](_0xa96a('0x1b'))&&_0x11503[_0xa96a('0x1b')]!==_0xa96a('0x1c')){_0x5013f8[_0xa96a('0xd')]({'type':_0xa96a('0x10'),'app':'Set','appdata':_0xa96a('0x1d'),'context':_0x11503[_0xa96a('0x5')],'exten':_0x11503[_0xa96a('0x6')],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']},{'type':_0xa96a('0x10'),'app':_0xa96a('0x8'),'appdata':_0xa96a('0x1e')+_0x11503['recordingFormat']||'wav','context':_0x11503['context'],'exten':_0x11503['exten'],'priority':_0x16257d++,'VoiceExtensionId':_0x11503['id']});}return _0x5013f8;}function _0x1dd4b2(_0x1c86d2,_0x2f2d8){var _0x11f401=[{'name':_0xa96a('0x1f'),'param':0x0},{'name':_0xa96a('0x20'),'param':0x1},{'name':_0xa96a('0x21'),'param':0x2},{'name':_0xa96a('0x22'),'param':0x3}];var _0x282340={};var _0xddd3f8=_0x2f2d8[_0xa96a('0x23')](',');var _0x39ee3f=[];for(var _0x54fdb1=0x0;_0x54fdb1<_0x11f401['length'];_0x54fdb1++){switch(_0x11f401[_0x54fdb1][_0xa96a('0x24')]){case _0xa96a('0x1f'):_0x282340['trunk']=_0xddd3f8[_0x11f401[_0x54fdb1][_0xa96a('0x25')]]['split']('/')[0x1];_0x282340['phone']=_0xddd3f8[_0x11f401[_0x54fdb1][_0xa96a('0x25')]][_0xa96a('0x23')]('/')[0x2];_0x282340[_0xa96a('0x26')]=_0x282340[_0xa96a('0x27')]?_0x282340[_0xa96a('0x27')][_0xa96a('0x23')]('$')[0x0]:undefined;_0x282340[_0xa96a('0x27')]=_0x1c86d2[_0xa96a('0x12')]?(_0x282340[_0xa96a('0x26')]||'')+'${EXTEN:'+_0x1c86d2[_0xa96a('0x12')]+'}':(_0x282340[_0xa96a('0x26')]||'')+_0xa96a('0x13');_0x39ee3f[_0x11f401[_0x54fdb1]['param']]=['SIP',_0x282340['trunk'],_0x282340['phone']][_0xa96a('0x28')]('/');break;case _0xa96a('0x21'):_0x282340['options']=_0xddd3f8[_0x11f401[_0x54fdb1][_0xa96a('0x25')]];if(_0x1c86d2[_0xa96a('0x1b')]!==_0xa96a('0x1c')){if(_0x282340[_0xa96a('0x21')][_0xa96a('0x29')](_0xa96a('0x2a'))<0x0){_0x282340['options']+='U(xcally-mixmonitor-context)';}}else{_0x282340['options']=_0x282340[_0xa96a('0x21')][_0xa96a('0x2b')](_0xa96a('0x2a'),'');}_0x39ee3f[_0x11f401[_0x54fdb1]['param']]=_0x282340[_0xa96a('0x21')];break;default:_0x39ee3f[_0x11f401[_0x54fdb1][_0xa96a('0x25')]]=_0xddd3f8[_0x11f401[_0x54fdb1][_0xa96a('0x25')]];}}return _0x39ee3f['join'](',');}function _0x4589aa(_0x11bc5c,_0x715b94,_0x273242){return new Promise(function(_0x241379,_0x23778e){var _0x349414=[];if(_['isEmpty'](_0x715b94))return _0x241379(_0x349414);_0x32bff8[_0xa96a('0x2c')][_0xa96a('0x2d')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0xa96a('0x2e')](function(_0x423800){for(var _0x5588ad=0x0,_0x544d9f=0x0;_0x5588ad<_0x715b94[_0xa96a('0x2f')];_0x5588ad++,_0x544d9f=0x0){var _0x3babc5=_0x715b94[_0x5588ad];var _0x362bc8=[];var _0x399aef=[];delete _0x3babc5['id'];if(_0x3babc5[_0xa96a('0x30')]!=='*,*,*,*'){_0x3babc5[_0xa96a('0x31')]=[_0x3babc5[_0xa96a('0x30')]];}else{_0x3babc5[_0xa96a('0x31')]=_0x3babc5['IntervalId']?_['map'](_[_0xa96a('0x32')](_0x423800,{'IntervalId':_0x3babc5[_0xa96a('0x33')]}),_0xa96a('0x30')):[];}_0x3babc5['context']=_0x11bc5c['context'];_0x3babc5[_0xa96a('0x6')]=_0x11bc5c[_0xa96a('0x6')];if(_0x3babc5[_0xa96a('0x3')])_0x3babc5[_0xa96a('0x3')]=_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')]();if(_0x11bc5c[_0xa96a('0x3')]===_0xa96a('0x10')){if(_0x3babc5[_0xa96a('0x1a')](_0xa96a('0x35'))&&_0x3babc5[_0xa96a('0x35')]&&_0x3babc5[_0xa96a('0x35')]!=='--'){_0x362bc8[_0xa96a('0xd')]({'type':_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')](),'app':'Set','appdata':_0xa96a('0x36')+_0x3babc5['tag'],'context':_0x11bc5c['context'],'exten':_0x11bc5c[_0xa96a('0x6')],'priority':_0x3babc5['intervals'][_0xa96a('0x2f')]+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});}_0x362bc8[_0xa96a('0xd')]({'type':_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')](),'app':_0xa96a('0x37'),'appdata':_0xa96a('0x38')+(_0x3babc5[_0xa96a('0x39')]?_0xa96a('0x3a')+_0x3babc5[_0xa96a('0x39')]+')':_0xa96a('0x3b')),'context':_0x11bc5c[_0xa96a('0x5')],'exten':_0x11bc5c['exten'],'priority':_0x3babc5[_0xa96a('0x31')][_0xa96a('0x2f')]+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});}else{if(_0x3babc5['hasOwnProperty'](_0xa96a('0x3c'))){if([_0xa96a('0x3d'),'playback'][_0xa96a('0x3e')](_0x3babc5['app'][_0xa96a('0x34')]())&&_0x3babc5[_0xa96a('0x3f')]!==_0xa96a('0x40')){if(_0x3babc5[_0xa96a('0x3c')]){_0x362bc8['push']({'type':_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')](),'app':'ExecIf','appdata':_0xa96a('0x41'),'context':_0x11bc5c[_0xa96a('0x5')],'exten':_0x11bc5c[_0xa96a('0x6')],'priority':_0x3babc5[_0xa96a('0x31')][_0xa96a('0x2f')]+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});_0x362bc8[_0xa96a('0xd')]({'type':_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')](),'app':_0xa96a('0x8'),'appdata':_0xa96a('0x42'),'context':_0x11bc5c['context'],'exten':_0x11bc5c[_0xa96a('0x6')],'priority':_0x3babc5['intervals'][_0xa96a('0x2f')]+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});}else{_0x362bc8[_0xa96a('0xd')]({'type':_0x3babc5['type']['toLowerCase'](),'app':_0xa96a('0x37'),'appdata':_0xa96a('0x43'),'context':_0x11bc5c[_0xa96a('0x5')],'exten':_0x11bc5c['exten'],'priority':_0x3babc5[_0xa96a('0x31')]['length']+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});_0x362bc8[_0xa96a('0xd')]({'type':_0x3babc5[_0xa96a('0x3')][_0xa96a('0x34')](),'app':_0xa96a('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x11bc5c[_0xa96a('0x5')],'exten':_0x11bc5c[_0xa96a('0x6')],'priority':_0x3babc5[_0xa96a('0x31')][_0xa96a('0x2f')]+_0x273242+_0x544d9f++,'VoiceExtensionId':_0x11bc5c['id']});}}}}for(var _0x342d0c=0x0;_0x342d0c<_0x3babc5['intervals'][_0xa96a('0x2f')];_0x342d0c++){var _0x1f49d7=_0x273242+_0x3babc5['intervals'][_0xa96a('0x2f')];var _0x3da092=_0x342d0c===_0x3babc5[_0xa96a('0x31')][_0xa96a('0x2f')]-0x1?_0x273242+_0x362bc8[_0xa96a('0x2f')]+_0x399aef['length']+0x2:_0x273242+_0x342d0c+0x1;_0x362bc8[_0xa96a('0x44')](_0x342d0c,0x0,{'type':_0x11bc5c[_0xa96a('0x3')],'app':_0xa96a('0x45'),'appdata':_0x3babc5[_0xa96a('0x31')][_0x342d0c]+'?'+_0x11bc5c[_0xa96a('0x5')]+_0xa96a('0x46')+_0x1f49d7+':'+_0x11bc5c[_0xa96a('0x5')]+_0xa96a('0x46')+_0x3da092,'exten':_0x11bc5c['exten'],'context':_0x11bc5c[_0xa96a('0x5')],'priority':_0x273242+_0x342d0c,'VoiceExtensionId':_0x11bc5c['id']});}if(_0x3babc5[_0xa96a('0x3f')]===_0xa96a('0x47'))_0x3babc5[_0xa96a('0x48')]=_0x1dd4b2(_0x11bc5c,_0x3babc5[_0xa96a('0x48')]);_0x3babc5[_0xa96a('0x49')]=_0x362bc8[_0xa96a('0x2f')]?_[_0xa96a('0x4a')](_0x362bc8)[_0xa96a('0x49')]+0x1:_0x273242;_0x349414=_[_0xa96a('0x4b')](_0x349414,_0x362bc8,[_0x3babc5],_0x399aef);_0x273242=_[_0xa96a('0x4a')](_0x349414)['priority']+0x1;}return _0x241379(_0x349414);})[_0xa96a('0x4c')](function(_0x33205b){_0x23778e(_0x33205b);});});}return _0x4519b6['define'](_0xa96a('0x4d'),attributes,{'tableName':_0xa96a('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4a9153){var _0x1481b4=this['get']({'plain':!![]});var _0x536eb7=_0x1481b4[_0xa96a('0x3')]==='outbound'?_0x3372f9(_0x1481b4):_0x12bbb7(_0x1481b4);return _0x4589aa(_0x1481b4,_0x4a9153,_[_0xa96a('0x4a')](_0x536eb7)[_0xa96a('0x49')]+0x1)[_0xa96a('0x2e')](function(_0x4e1bf1){var _0x18fa8f=_[_0xa96a('0x4b')](_0x536eb7,_0x4e1bf1);_0x18fa8f[_0xa96a('0xd')]({'type':_0x1481b4[_0xa96a('0x3')],'app':_0xa96a('0x4f'),'exten':_0x1481b4[_0xa96a('0x6')],'context':_0x1481b4[_0xa96a('0x5')],'priority':_[_0xa96a('0x4a')](_0x18fa8f)['priority']+0x1,'VoiceExtensionId':_0x1481b4['id']});return _0x18fa8f;});}}});}; \ No newline at end of file +var _0x25fa=['CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','define','voice_extensions','get','then','Hangup','lodash','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','split','length','name','param','phone','prefix','${EXTEN:','join','options','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x2c5f82,_0x3fdc87){_0x2c5f82=_0x2c5f82-0x0;var _0x531733=_0x25fa[_0x2c5f82];return _0x531733;};'use strict';var _=require(_0xa25f('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa25f('0x1')]=function(_0x37129d){var _0x57e272=_0x37129d[_0xa25f('0x2')];function _0xb88bd8(_0x256155){var _0x4d0b34=0x2;var _0x4e444d=[{'type':_0x256155[_0xa25f('0x3')],'app':'Set','appdata':_0xa25f('0x4')+_0x256155[_0xa25f('0x3')],'context':_0x256155[_0xa25f('0x5')],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']},{'type':_0x256155[_0xa25f('0x3')],'app':_0x256155[_0xa25f('0x7')]?_0xa25f('0x8'):_0xa25f('0x9'),'appdata':_0x256155[_0xa25f('0x7')]?'CDR(routeAlias)='+_0x256155[_0xa25f('0x7')]:_0xa25f('0xa'),'context':_0x256155['context'],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']}];if(_0x256155[_0xa25f('0x3')]===_0xa25f('0xb')){_0x4e444d[_0xa25f('0xc')]({'type':'inbound','app':_0xa25f('0x8'),'appdata':_0xa25f('0xd')+_0x256155['id'],'context':_0x256155['context'],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']});}_0x4e444d[_0xa25f('0xc')]({'type':_0x256155['type'],'app':_0xa25f('0x8'),'appdata':_0xa25f('0xe'),'context':_0x256155[_0xa25f('0x5')],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']},{'type':_0x256155[_0xa25f('0x3')],'app':_0xa25f('0x8'),'appdata':_0xa25f('0xf'),'context':_0x256155[_0xa25f('0x5')],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']},{'type':_0x256155[_0xa25f('0x3')],'app':_0xa25f('0x8'),'appdata':_0xa25f('0x10'),'context':_0x256155['context'],'exten':_0x256155[_0xa25f('0x6')],'priority':_0x4d0b34++,'VoiceExtensionId':_0x256155['id']});return _0x4e444d;}function _0x471679(_0x1751c6){var _0x451a6e=0x2;var _0x18705c=[{'type':_0xa25f('0x11'),'app':'Set','appdata':_0xa25f('0x12'),'context':_0x1751c6['context'],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':'outbound','app':_0x1751c6['alias']?_0xa25f('0x8'):'NoOp','appdata':_0x1751c6[_0xa25f('0x7')]?_0xa25f('0x13')+_0x1751c6[_0xa25f('0x7')]:_0xa25f('0xa'),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6['exten'],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':_0xa25f('0x8'),'appdata':_0xa25f('0x14')+(_0x1751c6[_0xa25f('0x15')]?'${EXTEN:'+_0x1751c6[_0xa25f('0x15')]+'}':_0xa25f('0x16')),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':'outbound','app':_0xa25f('0x8'),'appdata':_0xa25f('0xd')+_0x1751c6['id'],'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':'outbound','app':_0xa25f('0x17'),'appdata':_0xa25f('0x18')+(_0x451a6e+0x2)+'):Goto('+(_0x451a6e+0x1)+')','context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6['exten'],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':'Set','appdata':_0x1751c6[_0xa25f('0x15')]?_0xa25f('0x19')+_0x1751c6['cutdigits']+'}':_0xa25f('0x1a'),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6['exten'],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':'Set','appdata':_0xa25f('0xe'),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':_0xa25f('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':_0xa25f('0x8'),'appdata':_0xa25f('0x10'),'context':_0x1751c6['context'],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':_0xa25f('0x8'),'appdata':_0xa25f('0x1b')+_0x1751c6['id'],'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']}];if(_0x1751c6[_0xa25f('0x1c')](_0xa25f('0x1d'))&&_0x1751c6[_0xa25f('0x1d')]!=='none'){_0x18705c['push']({'type':'outbound','app':_0xa25f('0x8'),'appdata':_0xa25f('0x1e'),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']},{'type':_0xa25f('0x11'),'app':_0xa25f('0x8'),'appdata':_0xa25f('0x1f')+_0x1751c6[_0xa25f('0x1d')]||_0xa25f('0x20'),'context':_0x1751c6[_0xa25f('0x5')],'exten':_0x1751c6[_0xa25f('0x6')],'priority':_0x451a6e++,'VoiceExtensionId':_0x1751c6['id']});}return _0x18705c;}function _0x574149(_0x58ee76,_0xeb44b1){var _0x24f832=[{'name':_0xa25f('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x3f12cd={};var _0x25952d=_0xeb44b1[_0xa25f('0x22')](',');var _0x4a334b=[];for(var _0x4c4db1=0x0;_0x4c4db1<_0x24f832[_0xa25f('0x23')];_0x4c4db1++){switch(_0x24f832[_0x4c4db1][_0xa25f('0x24')]){case'trunk':_0x3f12cd['trunk']=_0x25952d[_0x24f832[_0x4c4db1][_0xa25f('0x25')]][_0xa25f('0x22')]('/')[0x1];_0x3f12cd[_0xa25f('0x26')]=_0x25952d[_0x24f832[_0x4c4db1]['param']][_0xa25f('0x22')]('/')[0x2];_0x3f12cd[_0xa25f('0x27')]=_0x3f12cd[_0xa25f('0x26')]?_0x3f12cd['phone']['split']('$')[0x0]:undefined;_0x3f12cd[_0xa25f('0x26')]=_0x58ee76[_0xa25f('0x15')]?(_0x3f12cd[_0xa25f('0x27')]||'')+_0xa25f('0x28')+_0x58ee76[_0xa25f('0x15')]+'}':(_0x3f12cd[_0xa25f('0x27')]||'')+_0xa25f('0x16');_0x4a334b[_0x24f832[_0x4c4db1][_0xa25f('0x25')]]=['SIP',_0x3f12cd[_0xa25f('0x21')],_0x3f12cd[_0xa25f('0x26')]][_0xa25f('0x29')]('/');break;case _0xa25f('0x2a'):_0x3f12cd[_0xa25f('0x2a')]=_0x25952d[_0x24f832[_0x4c4db1][_0xa25f('0x25')]];if(_0x58ee76[_0xa25f('0x1d')]!==_0xa25f('0x2b')){if(_0x3f12cd[_0xa25f('0x2a')][_0xa25f('0x2c')](_0xa25f('0x2d'))<0x0){_0x3f12cd[_0xa25f('0x2a')]+=_0xa25f('0x2d');}}else{_0x3f12cd['options']=_0x3f12cd[_0xa25f('0x2a')]['replace'](_0xa25f('0x2d'),'');}_0x4a334b[_0x24f832[_0x4c4db1][_0xa25f('0x25')]]=_0x3f12cd[_0xa25f('0x2a')];break;default:_0x4a334b[_0x24f832[_0x4c4db1]['param']]=_0x25952d[_0x24f832[_0x4c4db1][_0xa25f('0x25')]];}}return _0x4a334b[_0xa25f('0x29')](',');}function _0x37d94d(_0x19724c,_0x4e1f80,_0x18df2c){return new Promise(function(_0x22b869,_0x25123c){var _0x3d3cad=[];if(_[_0xa25f('0x2e')](_0x4e1f80))return _0x22b869(_0x3d3cad);_0x57e272[_0xa25f('0x2f')]['findAll']({'attributes':['id',_0xa25f('0x30'),_0xa25f('0x31')],'raw':!![]})['then'](function(_0x2a91c7){for(var _0xd5321c=0x0,_0x448a64=0x0;_0xd5321c<_0x4e1f80[_0xa25f('0x23')];_0xd5321c++,_0x448a64=0x0){var _0x2cfa49=_0x4e1f80[_0xd5321c];var _0x33a9ea=[];var _0x38d694=[];delete _0x2cfa49['id'];if(_0x2cfa49[_0xa25f('0x30')]!==_0xa25f('0x32')){_0x2cfa49[_0xa25f('0x33')]=[_0x2cfa49[_0xa25f('0x30')]];}else{_0x2cfa49[_0xa25f('0x33')]=_0x2cfa49[_0xa25f('0x31')]?_['map'](_[_0xa25f('0x34')](_0x2a91c7,{'IntervalId':_0x2cfa49[_0xa25f('0x31')]}),_0xa25f('0x30')):[];}_0x2cfa49[_0xa25f('0x5')]=_0x19724c['context'];_0x2cfa49[_0xa25f('0x6')]=_0x19724c[_0xa25f('0x6')];if(_0x2cfa49[_0xa25f('0x3')])_0x2cfa49['type']=_0x2cfa49[_0xa25f('0x3')][_0xa25f('0x35')]();if(_0x19724c[_0xa25f('0x3')]===_0xa25f('0x11')){if(_0x2cfa49[_0xa25f('0x1c')](_0xa25f('0x36'))&&_0x2cfa49[_0xa25f('0x36')]&&_0x2cfa49[_0xa25f('0x36')]!=='--'){_0x33a9ea['push']({'type':_0x2cfa49[_0xa25f('0x3')][_0xa25f('0x35')](),'app':_0xa25f('0x8'),'appdata':_0xa25f('0x37')+_0x2cfa49[_0xa25f('0x36')],'context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c[_0xa25f('0x6')],'priority':_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});}_0x33a9ea[_0xa25f('0xc')]({'type':_0x2cfa49[_0xa25f('0x3')][_0xa25f('0x35')](),'app':_0xa25f('0x17'),'appdata':_0xa25f('0x38')+(_0x2cfa49[_0xa25f('0x39')]?_0xa25f('0x3a')+_0x2cfa49[_0xa25f('0x39')]+')':_0xa25f('0x3b')),'context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c[_0xa25f('0x6')],'priority':_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});}else{if(_0x2cfa49['hasOwnProperty'](_0xa25f('0x3c'))){if([_0xa25f('0x3d'),_0xa25f('0x3e')][_0xa25f('0x3f')](_0x2cfa49['app'][_0xa25f('0x35')]())&&_0x2cfa49['appType']!==_0xa25f('0x40')){if(_0x2cfa49['answer']){_0x33a9ea['push']({'type':_0x2cfa49[_0xa25f('0x3')][_0xa25f('0x35')](),'app':_0xa25f('0x17'),'appdata':_0xa25f('0x41'),'context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c[_0xa25f('0x6')],'priority':_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});_0x33a9ea[_0xa25f('0xc')]({'type':_0x2cfa49[_0xa25f('0x3')][_0xa25f('0x35')](),'app':_0xa25f('0x8'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c[_0xa25f('0x6')],'priority':_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});}else{_0x33a9ea['push']({'type':_0x2cfa49[_0xa25f('0x3')]['toLowerCase'](),'app':_0xa25f('0x17'),'appdata':_0xa25f('0x42'),'context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c[_0xa25f('0x6')],'priority':_0x2cfa49['intervals'][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});_0x33a9ea[_0xa25f('0xc')]({'type':_0x2cfa49[_0xa25f('0x3')]['toLowerCase'](),'app':_0xa25f('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x19724c[_0xa25f('0x5')],'exten':_0x19724c['exten'],'priority':_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]+_0x18df2c+_0x448a64++,'VoiceExtensionId':_0x19724c['id']});}}}}for(var _0x15073a=0x0;_0x15073a<_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')];_0x15073a++){var _0x13d644=_0x18df2c+_0x2cfa49['intervals'][_0xa25f('0x23')];var _0x1830bd=_0x15073a===_0x2cfa49[_0xa25f('0x33')][_0xa25f('0x23')]-0x1?_0x18df2c+_0x33a9ea[_0xa25f('0x23')]+_0x38d694[_0xa25f('0x23')]+0x2:_0x18df2c+_0x15073a+0x1;_0x33a9ea[_0xa25f('0x43')](_0x15073a,0x0,{'type':_0x19724c['type'],'app':'GotoIfTime','appdata':_0x2cfa49['intervals'][_0x15073a]+'?'+_0x19724c[_0xa25f('0x5')]+_0xa25f('0x44')+_0x13d644+':'+_0x19724c[_0xa25f('0x5')]+_0xa25f('0x44')+_0x1830bd,'exten':_0x19724c[_0xa25f('0x6')],'context':_0x19724c[_0xa25f('0x5')],'priority':_0x18df2c+_0x15073a,'VoiceExtensionId':_0x19724c['id']});}if(_0x2cfa49[_0xa25f('0x45')]===_0xa25f('0x46'))_0x2cfa49[_0xa25f('0x47')]=_0x574149(_0x19724c,_0x2cfa49[_0xa25f('0x47')]);_0x2cfa49[_0xa25f('0x48')]=_0x33a9ea['length']?_[_0xa25f('0x49')](_0x33a9ea)[_0xa25f('0x48')]+0x1:_0x18df2c;_0x3d3cad=_[_0xa25f('0x4a')](_0x3d3cad,_0x33a9ea,[_0x2cfa49],_0x38d694);_0x18df2c=_[_0xa25f('0x49')](_0x3d3cad)[_0xa25f('0x48')]+0x1;}return _0x22b869(_0x3d3cad);})['catch'](function(_0x1817ee){_0x25123c(_0x1817ee);});});}return _0x37129d[_0xa25f('0x4b')]('VoiceExtension',attributes,{'tableName':_0xa25f('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x214d6a){var _0x57611a=this[_0xa25f('0x4d')]({'plain':!![]});var _0xdca81a=_0x57611a[_0xa25f('0x3')]===_0xa25f('0x11')?_0x471679(_0x57611a):_0xb88bd8(_0x57611a);return _0x37d94d(_0x57611a,_0x214d6a,_[_0xa25f('0x49')](_0xdca81a)['priority']+0x1)[_0xa25f('0x4e')](function(_0x9b3284){var _0x36de62=_['concat'](_0xdca81a,_0x9b3284);_0x36de62[_0xa25f('0xc')]({'type':_0x57611a[_0xa25f('0x3')],'app':_0xa25f('0x4f'),'exten':_0x57611a['exten'],'context':_0x57611a[_0xa25f('0x5')],'priority':_[_0xa25f('0x49')](_0x36de62)[_0xa25f('0x48')]+0x1,'VoiceExtensionId':_0x57611a['id']});return _0x36de62;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2b14a94..f4b0127 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 _0x496e=['findAll','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceExtension'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x496e,0x1a0));var _0xe496=function(_0x528ced,_0x5e6348){_0x528ced=_0x528ced-0x0;var _0x8ea2ef=_0x496e[_0x528ced];return _0x8ea2ef;};'use strict';var _=require('lodash');var util=require(_0xe496('0x0'));var moment=require(_0xe496('0x1'));var BPromise=require(_0xe496('0x2'));var rs=require(_0xe496('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe496('0x4'))('rpc');var config=require(_0xe496('0x5'));var jayson=require(_0xe496('0x6'));var client=jayson[_0xe496('0x7')][_0xe496('0x8')]({'port':0x232a});config[_0xe496('0x9')]=_[_0xe496('0xa')](config[_0xe496('0x9')],{'host':_0xe496('0xb'),'port':0x18eb});var socket=require(_0xe496('0xc'))(new Redis(config[_0xe496('0x9')]));require(_0xe496('0xd'))['register'](socket);function respondWithRpcPromise(_0x4a4caa,_0x37c55b,_0x5ca4d4){return new BPromise(function(_0x2e679b,_0x44936f){return client[_0xe496('0xe')](_0x4a4caa,_0x5ca4d4)[_0xe496('0xf')](function(_0x19d4fa){logger[_0xe496('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x37c55b,'request\x20sent');logger[_0xe496('0x11')](_0xe496('0x12'),_0x37c55b,'request\x20sent',JSON[_0xe496('0x13')](_0x19d4fa));if(_0x19d4fa[_0xe496('0x14')]){if(_0x19d4fa[_0xe496('0x14')][_0xe496('0x15')]===0x1f4){logger['error'](_0xe496('0x16'),_0x37c55b,_0x19d4fa['error'][_0xe496('0x17')]);return _0x44936f(_0x19d4fa['error'][_0xe496('0x17')]);}logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x19d4fa[_0xe496('0x14')]['message']);return _0x2e679b(_0x19d4fa[_0xe496('0x14')][_0xe496('0x17')]);}else{logger['info'](_0xe496('0x16'),_0x37c55b,_0xe496('0x18'));_0x2e679b(_0x19d4fa[_0xe496('0x19')][_0xe496('0x17')]);}})[_0xe496('0x1a')](function(_0x25e42d){logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x25e42d);_0x44936f(_0x25e42d);});});}exports[_0xe496('0x1b')]=function(_0x1993cd){var _0x2f9856=this;return new Promise(function(_0x3f6436,_0x30927d){return db['VoiceExtension'][_0xe496('0x1c')]({'raw':_0x1993cd[_0xe496('0x1d')]?_0x1993cd[_0xe496('0x1d')][_0xe496('0x1e')]===undefined?!![]:![]:!![],'where':_0x1993cd[_0xe496('0x1d')]?_0x1993cd[_0xe496('0x1d')][_0xe496('0x1f')]||null:null,'attributes':_0x1993cd[_0xe496('0x1d')]?_0x1993cd['options'][_0xe496('0x20')]||null:null,'limit':_0x1993cd['options']?_0x1993cd['options'][_0xe496('0x21')]||null:null,'include':_0x1993cd[_0xe496('0x1d')]?_0x1993cd[_0xe496('0x1d')][_0xe496('0x22')]?_[_0xe496('0x23')](_0x1993cd['options'][_0xe496('0x22')],function(_0x2d122e){return{'model':db[_0x2d122e[_0xe496('0x24')]],'as':_0x2d122e['as'],'attributes':_0x2d122e['attributes'],'include':_0x2d122e[_0xe496('0x22')]?_[_0xe496('0x23')](_0x2d122e[_0xe496('0x22')],function(_0x57dc9d){return{'model':db[_0x57dc9d[_0xe496('0x24')]],'as':_0x57dc9d['as'],'attributes':_0x57dc9d[_0xe496('0x20')],'include':_0x57dc9d[_0xe496('0x22')]?_[_0xe496('0x23')](_0x57dc9d[_0xe496('0x22')],function(_0x2c6ee6){return{'model':db[_0x2c6ee6[_0xe496('0x24')]],'as':_0x2c6ee6['as'],'attributes':_0x2c6ee6[_0xe496('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe496('0xf')](function(_0x1a7c5e){logger[_0xe496('0x10')](_0xe496('0x1b'),_0x1993cd);logger['debug'](_0xe496('0x1b'),_0x1993cd,JSON[_0xe496('0x13')](_0x1a7c5e));_0x3f6436(_0x1a7c5e);})[_0xe496('0x1a')](function(_0x3fa5bc){logger[_0xe496('0x14')](_0xe496('0x1b'),_0x3fa5bc['message'],_0x1993cd);_0x30927d(_0x2f9856[_0xe496('0x14')](0x1f4,_0x3fa5bc['message']));});});}; \ No newline at end of file +var _0xf966=['options','where','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll'];(function(_0x188c5f,_0xbb26e0){var _0x81aa0e=function(_0x37407d){while(--_0x37407d){_0x188c5f['push'](_0x188c5f['shift']());}};_0x81aa0e(++_0xbb26e0);}(_0xf966,0x184));var _0x6f96=function(_0x4ad035,_0x4773e3){_0x4ad035=_0x4ad035-0x0;var _0x1e3446=_0xf966[_0x4ad035];return _0x1e3446;};'use strict';var _=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var moment=require(_0x6f96('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f96('0x3'));var fs=require('fs');var Redis=require(_0x6f96('0x4'));var db=require(_0x6f96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f96('0x6'))(_0x6f96('0x7'));var config=require(_0x6f96('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f96('0x9')][_0x6f96('0xa')]({'port':0x232a});config[_0x6f96('0xb')]=_[_0x6f96('0xc')](config[_0x6f96('0xb')],{'host':_0x6f96('0xd'),'port':0x18eb});var socket=require(_0x6f96('0xe'))(new Redis(config[_0x6f96('0xb')]));require(_0x6f96('0xf'))[_0x6f96('0x10')](socket);function respondWithRpcPromise(_0x467f84,_0x23c22e,_0x1ec145){return new BPromise(function(_0x32b642,_0x28a317){return client['request'](_0x467f84,_0x1ec145)[_0x6f96('0x11')](function(_0x496d0b){logger['info'](_0x6f96('0x12'),_0x23c22e,_0x6f96('0x13'));logger['debug'](_0x6f96('0x14'),_0x23c22e,_0x6f96('0x13'),JSON[_0x6f96('0x15')](_0x496d0b));if(_0x496d0b[_0x6f96('0x16')]){if(_0x496d0b[_0x6f96('0x16')][_0x6f96('0x17')]===0x1f4){logger[_0x6f96('0x16')](_0x6f96('0x12'),_0x23c22e,_0x496d0b['error'][_0x6f96('0x18')]);return _0x28a317(_0x496d0b[_0x6f96('0x16')]['message']);}logger[_0x6f96('0x16')](_0x6f96('0x12'),_0x23c22e,_0x496d0b['error']['message']);return _0x32b642(_0x496d0b[_0x6f96('0x16')][_0x6f96('0x18')]);}else{logger[_0x6f96('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x23c22e,_0x6f96('0x13'));_0x32b642(_0x496d0b['result'][_0x6f96('0x18')]);}})[_0x6f96('0x1a')](function(_0x539055){logger['error'](_0x6f96('0x12'),_0x23c22e,_0x539055);_0x28a317(_0x539055);});});}exports[_0x6f96('0x1b')]=function(_0x593f91){var _0x26066f=this;return new Promise(function(_0x543b83,_0x3e3f51){return db[_0x6f96('0x1c')][_0x6f96('0x1d')]({'raw':_0x593f91[_0x6f96('0x1e')]?_0x593f91[_0x6f96('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x593f91[_0x6f96('0x1e')]?_0x593f91['options'][_0x6f96('0x1f')]||null:null,'attributes':_0x593f91[_0x6f96('0x1e')]?_0x593f91['options'][_0x6f96('0x20')]||null:null,'limit':_0x593f91['options']?_0x593f91[_0x6f96('0x1e')][_0x6f96('0x21')]||null:null,'include':_0x593f91[_0x6f96('0x1e')]?_0x593f91[_0x6f96('0x1e')][_0x6f96('0x22')]?_[_0x6f96('0x23')](_0x593f91[_0x6f96('0x1e')][_0x6f96('0x22')],function(_0x3a5f09){return{'model':db[_0x3a5f09['model']],'as':_0x3a5f09['as'],'attributes':_0x3a5f09[_0x6f96('0x20')],'include':_0x3a5f09[_0x6f96('0x22')]?_[_0x6f96('0x23')](_0x3a5f09[_0x6f96('0x22')],function(_0x1c20aa){return{'model':db[_0x1c20aa[_0x6f96('0x24')]],'as':_0x1c20aa['as'],'attributes':_0x1c20aa['attributes'],'include':_0x1c20aa['include']?_['map'](_0x1c20aa[_0x6f96('0x22')],function(_0x105796){return{'model':db[_0x105796[_0x6f96('0x24')]],'as':_0x105796['as'],'attributes':_0x105796['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f96('0x11')](function(_0x29c45e){logger[_0x6f96('0x19')](_0x6f96('0x1b'),_0x593f91);logger[_0x6f96('0x25')]('GetVoiceExtension',_0x593f91,JSON[_0x6f96('0x15')](_0x29c45e));_0x543b83(_0x29c45e);})[_0x6f96('0x1a')](function(_0x5b9284){logger[_0x6f96('0x16')](_0x6f96('0x1b'),_0x5b9284[_0x6f96('0x18')],_0x593f91);_0x3e3f51(_0x26066f[_0x6f96('0x16')](0x1f4,_0x5b9284[_0x6f96('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ef8bf68..5c1089d 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 _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x2a509a,_0x46989a){var _0x444d82=function(_0x444518){while(--_0x444518){_0x2a509a['push'](_0x2a509a['shift']());}};_0x444d82(++_0x46989a);}(_0x2ef3,0xba));var _0x32ef=function(_0x51ea17,_0x125b0a){_0x51ea17=_0x51ea17-0x0;var _0x9b99=_0x2ef3[_0x51ea17];return _0x9b99;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0xf39d5b,_0x43bcf1){var _0x3a5f78=function(_0x41c5dc){while(--_0x41c5dc){_0xf39d5b['push'](_0xf39d5b['shift']());}};_0x3a5f78(++_0x43bcf1);}(_0x1261,0x144));var _0x1126=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0x1261[_0x6acb69];return _0x29a021;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8224a3a..c57805e 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 _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x2b81db,_0xe9c3cb){var _0x1e0f1d=function(_0x63f3b2){while(--_0x63f3b2){_0x2b81db['push'](_0x2b81db['shift']());}};_0x1e0f1d(++_0xe9c3cb);}(_0x6d11,0xbf));var _0x16d1=function(_0x114b6d,_0x18865f){_0x114b6d=_0x114b6d-0x0;var _0x3fc999=_0x6d11[_0x114b6d];return _0x3fc999;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0xadb5,0xad));var _0x5adb=function(_0x4b878e,_0xac0813){_0x4b878e=_0x4b878e-0x0;var _0x2edf0e=_0xadb5[_0x4b878e];return _0x2edf0e;};'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('./voiceMail.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 262ad7d..dc88648 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 _0x4fcf=['yes','TINYINT(4)','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM'];(function(_0x5bc41f,_0x5cc4d3){var _0x19aa58=function(_0x43501f){while(--_0x43501f){_0x5bc41f['push'](_0x5bc41f['shift']());}};_0x19aa58(++_0x5cc4d3);}(_0x4fcf,0x137));var _0xf4fc=function(_0x5dbd30,_0x4cdbc1){_0x5dbd30=_0x5dbd30-0x0;var _0x18501e=_0x4fcf[_0x5dbd30];return _0x18501e;};'use strict';var Sequelize=require('sequelize');module[_0xf4fc('0x0')]={'customer_id':{'type':Sequelize[_0xf4fc('0x1')]},'context':{'type':Sequelize[_0xf4fc('0x1')],'defaultValue':_0xf4fc('0x2'),'unique':_0xf4fc('0x3')},'mailbox':{'type':Sequelize[_0xf4fc('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf4fc('0x1')]},'fullname':{'type':Sequelize[_0xf4fc('0x1')]},'email':{'type':Sequelize[_0xf4fc('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5c38ed){this['setDataValue'](_0xf4fc('0x4'),typeof _0x5c38ed===_0xf4fc('0x5')&&_0x5c38ed['trim']()?_0x5c38ed[_0xf4fc('0x6')]():null);}},'pager':{'type':Sequelize[_0xf4fc('0x1')]},'tz':{'type':Sequelize[_0xf4fc('0x1')],'defaultValue':_0xf4fc('0x7')},'attach':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xf4fc('0x8')]('yes','no'),'defaultValue':_0xf4fc('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xf4fc('0x1')]},'review':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf4fc('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf4fc('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xf4fc('0x9'),'no'),'defaultValue':_0xf4fc('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf4fc('0x8')](_0xf4fc('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xf4fc('0x9'),'no'),'defaultValue':_0xf4fc('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf4fc('0x1')]},'emailbody':{'type':Sequelize[_0xf4fc('0x1')]},'maxsecs':{'type':Sequelize[_0xf4fc('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf4fc('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf4fc('0xc')](_0xf4fc('0xd'))+_0xf4fc('0xe')+this[_0xf4fc('0xc')](_0xf4fc('0xf'));}}}; \ No newline at end of file +var _0xcd3e=['mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0x3eba45,_0x3863cb){var _0x1b9a3b=function(_0x34b04b){while(--_0x34b04b){_0x3eba45['push'](_0x3eba45['shift']());}};_0x1b9a3b(++_0x3863cb);}(_0xcd3e,0x1b1));var _0xecd3=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0xcd3e[_0x3aaf0a];return _0x33e6bc;};'use strict';var Sequelize=require(_0xecd3('0x0'));module[_0xecd3('0x1')]={'customer_id':{'type':Sequelize[_0xecd3('0x2')]},'context':{'type':Sequelize[_0xecd3('0x2')],'defaultValue':'from-voicemail','unique':_0xecd3('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xecd3('0x3')},'password':{'type':Sequelize[_0xecd3('0x2')]},'fullname':{'type':Sequelize[_0xecd3('0x2')]},'email':{'type':Sequelize[_0xecd3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x10739c){this[_0xecd3('0x4')](_0xecd3('0x5'),typeof _0x10739c==='string'&&_0x10739c[_0xecd3('0x6')]()?_0x10739c['trim']():null);}},'pager':{'type':Sequelize[_0xecd3('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':_0xecd3('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xecd3('0x2')]},'callback':{'type':Sequelize[_0xecd3('0x2')]},'review':{'type':Sequelize['ENUM'](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xecd3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xecd3('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xecd3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xecd3('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xecd3('0x7')](_0xecd3('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xecd3('0xa')},'emailsubject':{'type':Sequelize[_0xecd3('0x2')]},'emailbody':{'type':Sequelize[_0xecd3('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xecd3('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xecd3('0xc')],'get':function(){return this[_0xecd3('0xd')](_0xecd3('0xe'))+'\x20-\x20'+this['getDataValue'](_0xecd3('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1dcb6df..91c5b99 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 _0x04b8=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x194801,_0x147ece){var _0x18c56c=function(_0x236640){while(--_0x236640){_0x194801['push'](_0x194801['shift']());}};_0x18c56c(++_0x147ece);}(_0x04b8,0x159));var _0x804b=function(_0x2e890e,_0x1a22b7){_0x2e890e=_0x2e890e-0x0;var _0x5d2b7f=_0x04b8[_0x2e890e];return _0x5d2b7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['VoiceMail'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['VoiceMail']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Voicemails';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};exports[_0x804b('0x55')]=function(_0x5a549f,_0x4f7cc4,_0x13fa81){return db[_0x804b('0x2d')][_0x804b('0x56')]({'where':{'id':_0x5a549f[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x4f7cc4,null))[_0x804b('0x24')](function(_0x24c9b0){var _0x3100aa;var _0x2c0ed4={},_0x3f0ca3={};_0x3f0ca3[_0x804b('0x31')]=_[_0x804b('0x33')](db[_0x804b('0x57')][_0x804b('0x2e')]);_0x3f0ca3[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5a549f['query']);_0x3f0ca3[_0x804b('0x34')]=_[_0x804b('0x35')](_0x3f0ca3['model'],_0x3f0ca3[_0x804b('0x32')]);_0x2c0ed4[_0x804b('0x36')]=_[_0x804b('0x35')](_0x3f0ca3[_0x804b('0x31')],qs['fields'](_0x5a549f[_0x804b('0x32')][_0x804b('0x37')]));_0x2c0ed4['attributes']=_0x2c0ed4[_0x804b('0x36')][_0x804b('0x38')]?_0x2c0ed4[_0x804b('0x36')]:_0x3f0ca3['model'];if(!_0x5a549f[_0x804b('0x32')][_0x804b('0x39')](_0x804b('0x58'))){_0x2c0ed4[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x5a549f['query'][_0x804b('0x1d')]);_0x2c0ed4[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x5a549f[_0x804b('0x32')]['offset']);}_0x2c0ed4['order']=qs[_0x804b('0x3b')](_0x5a549f['query'][_0x804b('0x3b')]);_0x2c0ed4[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x5a549f[_0x804b('0x32')],_0x3f0ca3['filters']));if(_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]){_0x2c0ed4[_0x804b('0x3c')]=_['merge'](_0x2c0ed4[_0x804b('0x3c')],{'$or':_[_0x804b('0x2c')](_0x2c0ed4['attributes'],function(_0xb9deae){var _0x481bcd={};_0x481bcd[_0xb9deae]={'$like':'%'+_0x5a549f[_0x804b('0x32')][_0x804b('0x3e')]+'%'};return _0x481bcd;})});}_0x2c0ed4['where']=_[_0x804b('0x3f')](_0x2c0ed4[_0x804b('0x3c')],{'mailboxuser':_0x24c9b0[_0x804b('0x59')]});_0x2c0ed4=_['merge']({},_0x2c0ed4,_0x5a549f[_0x804b('0x41')]);return db['VoiceMailMessage'][_0x804b('0x5a')](_0x2c0ed4)[_0x804b('0x24')](respondWithFilteredResult(_0x4f7cc4,_0x2c0ed4));})[_0x804b('0x46')](handleError(_0x4f7cc4,null));}; \ No newline at end of file +var _0xefda=['sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','mailbox','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x169996,_0x4b59b5){var _0x28d7e6=function(_0x5e3acd){while(--_0x5e3acd){_0x169996['push'](_0x169996['shift']());}};_0x28d7e6(++_0x4b59b5);}(_0xefda,0x96));var _0xaefd=function(_0x3e9931,_0x2c8724){_0x3e9931=_0x3e9931-0x0;var _0x1f69d8=_0xefda[_0x3e9931];return _0x1f69d8;};'use strict';var emlformat=require(_0xaefd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaefd('0x1'));var rp=require(_0xaefd('0x2'));var moment=require('moment');var BPromise=require(_0xaefd('0x3'));var Mustache=require(_0xaefd('0x4'));var util=require(_0xaefd('0x5'));var path=require(_0xaefd('0x6'));var sox=require(_0xaefd('0x7'));var csv=require(_0xaefd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefd('0x9'));var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0x8'));var querystring=require(_0xaefd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0xf'));var as=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var licenseUtil=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];function respondWithStatusCode(_0x382983,_0x2a310c){_0x2a310c=_0x2a310c||0xcc;return function(_0x4b2b5c){if(_0x4b2b5c){return _0x382983[_0xaefd('0x18')](_0x2a310c);}return _0x382983['status'](_0x2a310c)[_0xaefd('0x19')]();};}function respondWithResult(_0x1725af,_0x9dfdf6){_0x9dfdf6=_0x9dfdf6||0xc8;return function(_0x43b82a){if(_0x43b82a){return _0x1725af['status'](_0x9dfdf6)[_0xaefd('0x1a')](_0x43b82a);}};}function respondWithFilteredResult(_0x13492c,_0x41f345){return function(_0x411701){if(_0x411701){var _0x10ee28=typeof _0x41f345[_0xaefd('0x1b')]===_0xaefd('0x1c')&&typeof _0x41f345[_0xaefd('0x1d')]==='undefined';var _0x9d9c29=_0x411701[_0xaefd('0x1e')];var _0x9748f4=_0x10ee28?0x0:_0x41f345[_0xaefd('0x1b')];var _0x2db61b=_0x10ee28?_0x411701[_0xaefd('0x1e')]:_0x41f345['offset']+_0x41f345[_0xaefd('0x1d')];var _0x182f9a;if(_0x2db61b>=_0x9d9c29){_0x2db61b=_0x9d9c29;_0x182f9a=0xc8;}else{_0x182f9a=0xce;}_0x13492c[_0xaefd('0x1f')](_0x182f9a);return _0x13492c[_0xaefd('0x20')](_0xaefd('0x21'),_0x9748f4+'-'+_0x2db61b+'/'+_0x9d9c29)[_0xaefd('0x1a')](_0x411701);}return null;};}function patchUpdates(_0x5282ed){return function(_0x463d48){try{jsonpatch[_0xaefd('0x22')](_0x463d48,_0x5282ed,!![]);}catch(_0x2dcdd8){return BPromise[_0xaefd('0x23')](_0x2dcdd8);}return _0x463d48[_0xaefd('0x24')]();};}function saveUpdates(_0x577fb7,_0x479486){return function(_0x5b9967){if(_0x5b9967){return _0x5b9967[_0xaefd('0x25')](_0x577fb7)[_0xaefd('0x26')](function(_0x313a6f){return _0x313a6f;});}return null;};}function removeEntity(_0x5a44ed,_0x23060f){return function(_0x4cd9b2){if(_0x4cd9b2){return _0x4cd9b2[_0xaefd('0x27')]()[_0xaefd('0x26')](function(){var _0x1a05eb=_0x4cd9b2['get']({'plain':!![]});var _0x435413=_0xaefd('0x28');return db[_0xaefd('0x29')][_0xaefd('0x27')]({'where':{'type':_0x435413,'resourceId':_0x1a05eb['id']}})[_0xaefd('0x26')](function(){return _0x4cd9b2;});})['then'](function(){_0x5a44ed[_0xaefd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x810bf,_0x16f10f){return function(_0x5470bd){if(!_0x5470bd){_0x810bf[_0xaefd('0x18')](0x194);}return _0x5470bd;};}function handleError(_0x2a8fa8,_0x521839){_0x521839=_0x521839||0x1f4;return function(_0xbeb1b8){logger[_0xaefd('0x2a')](_0xbeb1b8[_0xaefd('0x2b')]);if(_0xbeb1b8['name']){delete _0xbeb1b8[_0xaefd('0x2c')];}_0x2a8fa8['status'](_0x521839)[_0xaefd('0x2d')](_0xbeb1b8);};}exports['index']=function(_0x4a1acb,_0x1d89c4){var _0x1b470c={},_0x4a032d={},_0x578378={'count':0x0,'rows':[]};var _0x4ee0c1=_[_0xaefd('0x2e')](db[_0xaefd('0x2f')]['rawAttributes'],function(_0x5503d0){return{'name':_0x5503d0[_0xaefd('0x30')],'type':_0x5503d0[_0xaefd('0x31')][_0xaefd('0x32')]};});_0x4a032d[_0xaefd('0x33')]=_['map'](_0x4ee0c1,_0xaefd('0x2c'));_0x4a032d[_0xaefd('0x34')]=_[_0xaefd('0x35')](_0x4a1acb[_0xaefd('0x34')]);_0x4a032d[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x4a032d[_0xaefd('0x33')],_0x4a032d[_0xaefd('0x34')]);_0x1b470c[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x4a032d[_0xaefd('0x33')],qs[_0xaefd('0x39')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x39')]));_0x1b470c[_0xaefd('0x38')]=_0x1b470c[_0xaefd('0x38')]['length']?_0x1b470c[_0xaefd('0x38')]:_0x4a032d[_0xaefd('0x33')];if(!_0x4a1acb[_0xaefd('0x34')]['hasOwnProperty'](_0xaefd('0x3a'))){_0x1b470c['limit']=qs[_0xaefd('0x1d')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x1d')]);_0x1b470c[_0xaefd('0x1b')]=qs[_0xaefd('0x1b')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x1b')]);}_0x1b470c[_0xaefd('0x3b')]=qs[_0xaefd('0x3c')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x3c')]);_0x1b470c[_0xaefd('0x3d')]=qs[_0xaefd('0x36')](_[_0xaefd('0x3e')](_0x4a1acb['query'],_0x4a032d[_0xaefd('0x36')]),_0x4ee0c1);if(_0x4a1acb['query'][_0xaefd('0x3f')]){_0x1b470c[_0xaefd('0x3d')]=_[_0xaefd('0x40')](_0x1b470c[_0xaefd('0x3d')],{'$or':_[_0xaefd('0x2e')](_0x4ee0c1,function(_0x3c9331){if(_0x3c9331[_0xaefd('0x31')]!==_0xaefd('0x41')){var _0x3c7022={};_0x3c7022[_0x3c9331[_0xaefd('0x2c')]]={'$like':'%'+_0x4a1acb['query'][_0xaefd('0x3f')]+'%'};return _0x3c7022;}})});}_0x1b470c=_[_0xaefd('0x40')]({},_0x1b470c,_0x4a1acb['options']);var _0x427f00={'where':_0x1b470c[_0xaefd('0x3d')]};return db[_0xaefd('0x2f')]['count'](_0x427f00)['then'](function(_0x43b6a6){_0x578378[_0xaefd('0x1e')]=_0x43b6a6;if(_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x42')]){_0x1b470c[_0xaefd('0x43')]=[{'all':!![]}];}return db[_0xaefd('0x2f')][_0xaefd('0x44')](_0x1b470c);})[_0xaefd('0x26')](function(_0x48a7af){_0x578378[_0xaefd('0x45')]=_0x48a7af;return _0x578378;})[_0xaefd('0x26')](respondWithFilteredResult(_0x1d89c4,_0x1b470c))[_0xaefd('0x46')](handleError(_0x1d89c4,null));};exports[_0xaefd('0x47')]=function(_0x20d5fd,_0x197f3f){var _0x3633ec={'raw':!![],'where':{'id':_0x20d5fd['params']['id']}},_0x1f4a15={};_0x1f4a15['model']=_[_0xaefd('0x35')](db[_0xaefd('0x2f')]['rawAttributes']);_0x1f4a15['query']=_[_0xaefd('0x35')](_0x20d5fd[_0xaefd('0x34')]);_0x1f4a15[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x1f4a15[_0xaefd('0x33')],_0x1f4a15[_0xaefd('0x34')]);_0x3633ec[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x1f4a15[_0xaefd('0x33')],qs['fields'](_0x20d5fd[_0xaefd('0x34')][_0xaefd('0x39')]));_0x3633ec[_0xaefd('0x38')]=_0x3633ec[_0xaefd('0x38')][_0xaefd('0x48')]?_0x3633ec[_0xaefd('0x38')]:_0x1f4a15[_0xaefd('0x33')];if(_0x20d5fd['query'][_0xaefd('0x42')]){_0x3633ec['include']=[{'all':!![]}];}_0x3633ec=_[_0xaefd('0x40')]({},_0x3633ec,_0x20d5fd[_0xaefd('0x49')]);return db[_0xaefd('0x2f')][_0xaefd('0x4a')](_0x3633ec)['then'](handleEntityNotFound(_0x197f3f,null))['then'](respondWithResult(_0x197f3f,null))[_0xaefd('0x46')](handleError(_0x197f3f,null));};exports[_0xaefd('0x4b')]=function(_0x179b8b,_0x4eeb56){return db[_0xaefd('0x2f')][_0xaefd('0x4b')](_0x179b8b['body'],{})[_0xaefd('0x26')](function(_0xf2783d){var _0x3c6a3e=_0x179b8b[_0xaefd('0x4c')][_0xaefd('0x4d')]({'plain':!![]});if(!_0x3c6a3e)throw new Error(_0xaefd('0x4e'));if(_0x3c6a3e[_0xaefd('0x4f')]===_0xaefd('0x4c')){var _0x4dc674=_0xf2783d['get']({'plain':!![]});var _0x1406b8=_0xaefd('0x28');return db['UserProfileSection'][_0xaefd('0x4a')]({'where':{'name':_0x1406b8,'userProfileId':_0x3c6a3e['userProfileId']},'raw':!![]})[_0xaefd('0x26')](function(_0x47296d){if(_0x47296d&&_0x47296d[_0xaefd('0x50')]===0x0){return db[_0xaefd('0x29')][_0xaefd('0x4b')]({'name':_0x4dc674[_0xaefd('0x2c')],'resourceId':_0x4dc674['id'],'type':_0x47296d['name'],'sectionId':_0x47296d['id']},{})['then'](function(){return _0xf2783d;});}else{return _0xf2783d;}})[_0xaefd('0x46')](function(_0x338823){logger['error'](_0xaefd('0x51'),_0x338823);throw _0x338823;});}return _0xf2783d;})[_0xaefd('0x26')](respondWithResult(_0x4eeb56,0xc9))[_0xaefd('0x46')](handleError(_0x4eeb56,null));};exports[_0xaefd('0x25')]=function(_0x4a883b,_0x583caa){if(_0x4a883b[_0xaefd('0x52')]['id']){delete _0x4a883b[_0xaefd('0x52')]['id'];}return db[_0xaefd('0x2f')][_0xaefd('0x4a')]({'where':{'id':_0x4a883b[_0xaefd('0x53')]['id']}})['then'](handleEntityNotFound(_0x583caa,null))[_0xaefd('0x26')](saveUpdates(_0x4a883b[_0xaefd('0x52')],null))['then'](respondWithResult(_0x583caa,null))[_0xaefd('0x46')](handleError(_0x583caa,null));};exports[_0xaefd('0x27')]=function(_0x5f2925,_0x108e35){return db[_0xaefd('0x2f')][_0xaefd('0x4a')]({'where':{'id':_0x5f2925['params']['id']}})[_0xaefd('0x26')](handleEntityNotFound(_0x108e35,null))[_0xaefd('0x26')](removeEntity(_0x108e35,null))['catch'](handleError(_0x108e35,null));};exports[_0xaefd('0x54')]=function(_0x21b65c,_0x14b472,_0x2dd1ee){return db['VoiceMail']['findOne']({'where':{'id':_0x21b65c[_0xaefd('0x53')]['id']}})[_0xaefd('0x26')](handleEntityNotFound(_0x14b472,null))[_0xaefd('0x26')](function(_0x3e1673){var _0x4189c4;var _0x8ab9e7={},_0x314660={};_0x314660[_0xaefd('0x33')]=_[_0xaefd('0x35')](db[_0xaefd('0x55')]['rawAttributes']);_0x314660['query']=_[_0xaefd('0x35')](_0x21b65c[_0xaefd('0x34')]);_0x314660[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x314660['model'],_0x314660[_0xaefd('0x34')]);_0x8ab9e7[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x314660[_0xaefd('0x33')],qs[_0xaefd('0x39')](_0x21b65c[_0xaefd('0x34')][_0xaefd('0x39')]));_0x8ab9e7[_0xaefd('0x38')]=_0x8ab9e7['attributes'][_0xaefd('0x48')]?_0x8ab9e7[_0xaefd('0x38')]:_0x314660[_0xaefd('0x33')];if(!_0x21b65c[_0xaefd('0x34')]['hasOwnProperty'](_0xaefd('0x3a'))){_0x8ab9e7['limit']=qs[_0xaefd('0x1d')](_0x21b65c[_0xaefd('0x34')]['limit']);_0x8ab9e7['offset']=qs[_0xaefd('0x1b')](_0x21b65c['query']['offset']);}_0x8ab9e7['order']=qs[_0xaefd('0x3c')](_0x21b65c[_0xaefd('0x34')][_0xaefd('0x3c')]);_0x8ab9e7[_0xaefd('0x3d')]=qs[_0xaefd('0x36')](_[_0xaefd('0x3e')](_0x21b65c['query'],_0x314660['filters']));if(_0x21b65c['query']['filter']){_0x8ab9e7[_0xaefd('0x3d')]=_['merge'](_0x8ab9e7[_0xaefd('0x3d')],{'$or':_['map'](_0x8ab9e7[_0xaefd('0x38')],function(_0x32dc0d){var _0x416241={};_0x416241[_0x32dc0d]={'$like':'%'+_0x21b65c[_0xaefd('0x34')][_0xaefd('0x3f')]+'%'};return _0x416241;})});}_0x8ab9e7[_0xaefd('0x3d')]=_[_0xaefd('0x40')](_0x8ab9e7['where'],{'mailboxuser':_0x3e1673[_0xaefd('0x56')]});_0x8ab9e7=_[_0xaefd('0x40')]({},_0x8ab9e7,_0x21b65c[_0xaefd('0x49')]);return db[_0xaefd('0x55')]['findAndCountAll'](_0x8ab9e7)[_0xaefd('0x26')](respondWithFilteredResult(_0x14b472,_0x8ab9e7));})['catch'](handleError(_0x14b472,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 1146e16..924bda8 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 _0xbfcb=['bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment'];(function(_0x6a13ac,_0x14dbda){var _0xf1b2a5=function(_0xec7619){while(--_0xec7619){_0x6a13ac['push'](_0x6a13ac['shift']());}};_0xf1b2a5(++_0x14dbda);}(_0xbfcb,0x181));var _0xbbfc=function(_0x25c293,_0x403d8f){_0x25c293=_0x25c293-0x0;var _0x5da475=_0xbfcb[_0x25c293];return _0x5da475;};'use strict';var _=require(_0xbbfc('0x0'));var util=require(_0xbbfc('0x1'));var logger=require(_0xbbfc('0x2'))(_0xbbfc('0x3'));var moment=require(_0xbbfc('0x4'));var BPromise=require(_0xbbfc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbfc('0x6'));var config=require(_0xbbfc('0x7'));var attributes=require(_0xbbfc('0x8'));module[_0xbbfc('0x9')]=function(_0x3f2950,_0x3baf1d){return _0x3f2950[_0xbbfc('0xa')](_0xbbfc('0xb'),attributes,{'tableName':_0xbbfc('0xc'),'paranoid':![],'indexes':[{'name':_0xbbfc('0xd'),'fields':['mailbox',_0xbbfc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ad0=['../../config/environment','exports','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x41c6eb,_0x5b4051){var _0x1cea50=function(_0x52cc48){while(--_0x52cc48){_0x41c6eb['push'](_0x41c6eb['shift']());}};_0x1cea50(++_0x5b4051);}(_0x2ad0,0x119));var _0x02ad=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x2ad0[_0x61b3ab];return _0x57097f;};'use strict';var _=require('lodash');var util=require(_0x02ad('0x0'));var logger=require(_0x02ad('0x1'))('api');var moment=require(_0x02ad('0x2'));var BPromise=require('bluebird');var rp=require(_0x02ad('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02ad('0x4'));var config=require(_0x02ad('0x5'));var attributes=require('./voiceMail.attributes');module[_0x02ad('0x6')]=function(_0x30f666,_0x4c660b){return _0x30f666['define']('VoiceMail',attributes,{'tableName':_0x02ad('0x7'),'paranoid':![],'indexes':[{'name':_0x02ad('0x8'),'fields':[_0x02ad('0x9'),_0x02ad('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 5d08a70..eef6ce0 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 _0x6241=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45a567,_0x312076){var _0x3ef084=function(_0x112ee3){while(--_0x112ee3){_0x45a567['push'](_0x45a567['shift']());}};_0x3ef084(++_0x312076);}(_0x6241,0x76));var _0x1624=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6241[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x1624('0x0'));var util=require(_0x1624('0x1'));var moment=require(_0x1624('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1624('0x3'));var db=require(_0x1624('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1624('0x5'))(_0x1624('0x6'));var config=require(_0x1624('0x7'));var jayson=require(_0x1624('0x8'));var client=jayson[_0x1624('0x9')][_0x1624('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5077f6,_0x134a21,_0x304800){return new BPromise(function(_0x5179f3,_0xebcc8f){return client[_0x1624('0xb')](_0x5077f6,_0x304800)[_0x1624('0xc')](function(_0x126922){logger[_0x1624('0xd')](_0x1624('0xe'),_0x134a21,_0x1624('0xf'));logger[_0x1624('0x10')](_0x1624('0x11'),_0x134a21,'request\x20sent',JSON['stringify'](_0x126922));if(_0x126922[_0x1624('0x12')]){if(_0x126922[_0x1624('0x12')][_0x1624('0x13')]===0x1f4){logger[_0x1624('0x12')](_0x1624('0xe'),_0x134a21,_0x126922['error']['message']);return _0xebcc8f(_0x126922[_0x1624('0x12')]['message']);}logger[_0x1624('0x12')](_0x1624('0xe'),_0x134a21,_0x126922[_0x1624('0x12')][_0x1624('0x14')]);return _0x5179f3(_0x126922[_0x1624('0x12')][_0x1624('0x14')]);}else{logger[_0x1624('0xd')](_0x1624('0xe'),_0x134a21,_0x1624('0xf'));_0x5179f3(_0x126922['result'][_0x1624('0x14')]);}})[_0x1624('0x15')](function(_0x43e666){logger[_0x1624('0x12')](_0x1624('0xe'),_0x134a21,_0x43e666);_0xebcc8f(_0x43e666);});});} \ No newline at end of file +var _0xde63=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xde63,0xa9));var _0x3de6=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0xde63[_0x1c510a];return _0x23cedd;};'use strict';var _=require(_0x3de6('0x0'));var util=require(_0x3de6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3de6('0x2'))['db'];var utils=require(_0x3de6('0x3'));var logger=require(_0x3de6('0x4'))(_0x3de6('0x5'));var config=require(_0x3de6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3de6('0x7')][_0x3de6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c72dc,_0x4a127e,_0xf3b80a){return new BPromise(function(_0x34110b,_0x38c932){return client['request'](_0x2c72dc,_0xf3b80a)[_0x3de6('0x9')](function(_0x5dfc61){logger[_0x3de6('0xa')]('VoiceMail,\x20%s,\x20%s',_0x4a127e,_0x3de6('0xb'));logger[_0x3de6('0xc')](_0x3de6('0xd'),_0x4a127e,'request\x20sent',JSON[_0x3de6('0xe')](_0x5dfc61));if(_0x5dfc61[_0x3de6('0xf')]){if(_0x5dfc61[_0x3de6('0xf')]['code']===0x1f4){logger['error'](_0x3de6('0x10'),_0x4a127e,_0x5dfc61[_0x3de6('0xf')][_0x3de6('0x11')]);return _0x38c932(_0x5dfc61['error'][_0x3de6('0x11')]);}logger[_0x3de6('0xf')](_0x3de6('0x10'),_0x4a127e,_0x5dfc61[_0x3de6('0xf')][_0x3de6('0x11')]);return _0x34110b(_0x5dfc61[_0x3de6('0xf')][_0x3de6('0x11')]);}else{logger[_0x3de6('0xa')](_0x3de6('0x10'),_0x4a127e,'request\x20sent');_0x34110b(_0x5dfc61[_0x3de6('0x12')][_0x3de6('0x11')]);}})['catch'](function(_0x543876){logger['error']('VoiceMail,\x20%s,\x20%s',_0x4a127e,_0x543876);_0x38c932(_0x543876);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0f8d74c..6807508 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 _0xec1d=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xec1d,0xa8));var _0xdec1=function(_0x13b82c,_0x2f45c8){_0x13b82c=_0x13b82c-0x0;var _0x57d0cd=_0xec1d[_0x13b82c];return _0x57d0cd;};'use strict';var multer=require('multer');var util=require(_0xdec1('0x0'));var path=require(_0xdec1('0x1'));var timeout=require(_0xdec1('0x2'));var express=require(_0xdec1('0x3'));var router=express[_0xdec1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdec1('0x5'));var interaction=require(_0xdec1('0x6'));var config=require(_0xdec1('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xdec1('0x8')]('/',auth[_0xdec1('0x9')](),controller[_0xdec1('0xa')]);router[_0xdec1('0x8')](_0xdec1('0xb'),auth[_0xdec1('0x9')](),controller[_0xdec1('0xc')]);router[_0xdec1('0x8')](_0xdec1('0xd'),auth['isAuthenticated'](),controller[_0xdec1('0xe')]);router[_0xdec1('0xf')]('/',auth[_0xdec1('0x9')](),controller[_0xdec1('0x10')]);router[_0xdec1('0x11')](_0xdec1('0xb'),auth['isAuthenticated'](),controller[_0xdec1('0x12')]);router[_0xdec1('0x13')](_0xdec1('0xb'),auth[_0xdec1('0x9')](),controller[_0xdec1('0x14')]);module[_0xdec1('0x15')]=router; \ No newline at end of file +var _0x9f89=['post','isAuthenticated','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/download','download'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x9f89,0x96));var _0x99f8=function(_0x4e8d8c,_0x5a0582){_0x4e8d8c=_0x4e8d8c-0x0;var _0x50362f=_0x9f89[_0x4e8d8c];return _0x50362f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99f8('0x0'));var timeout=require('connect-timeout');var express=require(_0x99f8('0x1'));var router=express[_0x99f8('0x2')]();var fs_extra=require(_0x99f8('0x3'));var auth=require(_0x99f8('0x4'));var interaction=require(_0x99f8('0x5'));var config=require(_0x99f8('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x99f8('0x7')]('/',auth['isAuthenticated'](),controller[_0x99f8('0x8')]);router[_0x99f8('0x7')](_0x99f8('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x99f8('0xa'),auth['isAuthenticated'](),controller[_0x99f8('0xb')]);router[_0x99f8('0xc')]('/',auth[_0x99f8('0xd')](),controller['create']);router[_0x99f8('0xe')](_0x99f8('0x9'),auth['isAuthenticated'](),controller[_0x99f8('0xf')]);router[_0x99f8('0x10')](_0x99f8('0x9'),auth[_0x99f8('0xd')](),controller['destroy']);module[_0x99f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 267e438..4a5b629 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 _0x8ba2=['VIRTUAL','getDataValue','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x2aa041,_0x46d6f1){var _0x4d0c80=function(_0x39d32c){while(--_0x39d32c){_0x2aa041['push'](_0x2aa041['shift']());}};_0x4d0c80(++_0x46d6f1);}(_0x8ba2,0xb2));var _0x28ba=function(_0x17c497,_0x426b71){_0x17c497=_0x17c497-0x0;var _0x9b55a3=_0x8ba2[_0x17c497];return _0x9b55a3;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'name':{'type':Sequelize[_0x28ba('0x2')],'get':function(_0x1097fb){return this[_0x28ba('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x28ba('0x5')](_0x28ba('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x28ba('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x28ba('0x7')](_0x28ba('0x8'))}}; \ No newline at end of file +var _0x7fbb=['sequelize','exports','VIRTUAL','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x51e15c,_0xe486c){var _0x3d67f9=function(_0x5032ef){while(--_0x5032ef){_0x51e15c['push'](_0x51e15c['shift']());}};_0x3d67f9(++_0xe486c);}(_0x7fbb,0x80));var _0xb7fb=function(_0x221e53,_0x3a70b7){_0x221e53=_0x221e53-0x0;var _0x10a623=_0x7fbb[_0x221e53];return _0x10a623;};'use strict';var Sequelize=require(_0xb7fb('0x0'));module[_0xb7fb('0x1')]={'name':{'type':Sequelize[_0xb7fb('0x2')],'get':function(_0x24ea57){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb7fb('0x4')](_0xb7fb('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb7fb('0x3')],'defaultValue':''},'stamp':{'type':_0xb7fb('0x6'),'defaultValue':Sequelize[_0xb7fb('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b37f931..bef234e 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 _0x663f=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','map','rawAttributes','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceMailMessage','findAll','rows','catch','keys','includeAll','include','find','body','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4c4fbe,_0x483482){var _0x39b3b9=function(_0x803f56){while(--_0x803f56){_0x4c4fbe['push'](_0x4c4fbe['shift']());}};_0x39b3b9(++_0x483482);}(_0x663f,0x17f));var _0xf663=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x663f[_0x4ed4d2];return _0x15ae2e;};'use strict';var emlformat=require(_0xf663('0x0'));var rimraf=require(_0xf663('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf663('0x2'));var moment=require(_0xf663('0x3'));var BPromise=require(_0xf663('0x4'));var Mustache=require(_0xf663('0x5'));var util=require(_0xf663('0x6'));var path=require(_0xf663('0x7'));var sox=require(_0xf663('0x8'));var csv=require(_0xf663('0x9'));var ejs=require(_0xf663('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf663('0xb'));var squel=require('squel');var crypto=require(_0xf663('0xc'));var jsforce=require(_0xf663('0xd'));var deskjs=require(_0xf663('0xe'));var toCsv=require(_0xf663('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf663('0xf'));var as=require(_0xf663('0x10'));var hardwareService=require(_0xf663('0x11'));var logger=require(_0xf663('0x12'))(_0xf663('0x13'));var utils=require(_0xf663('0x14'));var config=require(_0xf663('0x15'));var licenseUtil=require(_0xf663('0x16'));var db=require(_0xf663('0x17'))['db'];function respondWithStatusCode(_0x1d346a,_0x3e899d){_0x3e899d=_0x3e899d||0xcc;return function(_0x493ace){if(_0x493ace){return _0x1d346a[_0xf663('0x18')](_0x3e899d);}return _0x1d346a['status'](_0x3e899d)[_0xf663('0x19')]();};}function respondWithResult(_0x4f6577,_0x236e50){_0x236e50=_0x236e50||0xc8;return function(_0x49fc14){if(_0x49fc14){return _0x4f6577[_0xf663('0x1a')](_0x236e50)[_0xf663('0x1b')](_0x49fc14);}};}function respondWithFilteredResult(_0x43b9a8,_0x2f2869){return function(_0x356e5a){if(_0x356e5a){var _0x578982=typeof _0x2f2869[_0xf663('0x1c')]===_0xf663('0x1d')&&typeof _0x2f2869[_0xf663('0x1e')]===_0xf663('0x1d');var _0x157b22=_0x356e5a[_0xf663('0x1f')];var _0x531a29=_0x578982?0x0:_0x2f2869['offset'];var _0x8cf4ac=_0x578982?_0x356e5a[_0xf663('0x1f')]:_0x2f2869['offset']+_0x2f2869[_0xf663('0x1e')];var _0x2e70e9;if(_0x8cf4ac>=_0x157b22){_0x8cf4ac=_0x157b22;_0x2e70e9=0xc8;}else{_0x2e70e9=0xce;}_0x43b9a8[_0xf663('0x1a')](_0x2e70e9);return _0x43b9a8[_0xf663('0x20')](_0xf663('0x21'),_0x531a29+'-'+_0x8cf4ac+'/'+_0x157b22)[_0xf663('0x1b')](_0x356e5a);}return null;};}function patchUpdates(_0x1c4a93){return function(_0xa653d8){try{jsonpatch['apply'](_0xa653d8,_0x1c4a93,!![]);}catch(_0x3012a8){return BPromise[_0xf663('0x22')](_0x3012a8);}return _0xa653d8[_0xf663('0x23')]();};}function saveUpdates(_0x2a3757,_0x38927){return function(_0x5e7eb9){if(_0x5e7eb9){return _0x5e7eb9[_0xf663('0x24')](_0x2a3757)['then'](function(_0x305d8e){return _0x305d8e;});}return null;};}function removeEntity(_0x3289a1,_0x50798c){return function(_0x1a3c6e){if(_0x1a3c6e){return _0x1a3c6e[_0xf663('0x25')]()[_0xf663('0x26')](function(){_0x3289a1[_0xf663('0x1a')](0xcc)[_0xf663('0x19')]();});}};}function handleEntityNotFound(_0x5bb8dc,_0x1ee974){return function(_0x48f17b){if(!_0x48f17b){_0x5bb8dc[_0xf663('0x18')](0x194);}return _0x48f17b;};}function handleError(_0x4ca09b,_0x53d34b){_0x53d34b=_0x53d34b||0x1f4;return function(_0x56154c){logger[_0xf663('0x27')](_0x56154c['stack']);if(_0x56154c[_0xf663('0x28')]){delete _0x56154c[_0xf663('0x28')];}_0x4ca09b[_0xf663('0x1a')](_0x53d34b)[_0xf663('0x29')](_0x56154c);};}exports['index']=function(_0x667f4,_0x3afbc4){var _0x4b55e2={},_0x2a5d48={},_0x401142={'count':0x0,'rows':[]};var _0x1d3ee3=_[_0xf663('0x2a')](db['VoiceMailMessage'][_0xf663('0x2b')],function(_0x114279){return{'name':_0x114279['fieldName'],'type':_0x114279[_0xf663('0x2c')][_0xf663('0x2d')]};});_0x2a5d48[_0xf663('0x2e')]=_[_0xf663('0x2f')](_[_0xf663('0x2a')](_0x1d3ee3,'name'),['name']);_0x2a5d48[_0xf663('0x30')]=_['keys'](_0x667f4[_0xf663('0x30')]);_0x2a5d48[_0xf663('0x31')]=_[_0xf663('0x32')](_0x2a5d48[_0xf663('0x2e')],_0x2a5d48[_0xf663('0x30')]);_0x4b55e2[_0xf663('0x33')]=_[_0xf663('0x32')](_0x2a5d48[_0xf663('0x2e')],qs[_0xf663('0x34')](_0x667f4[_0xf663('0x30')][_0xf663('0x34')]));_0x4b55e2[_0xf663('0x33')]=_0x4b55e2[_0xf663('0x33')][_0xf663('0x35')]?_0x4b55e2[_0xf663('0x33')]:_0x2a5d48[_0xf663('0x2e')];if(!_0x667f4[_0xf663('0x30')]['hasOwnProperty'](_0xf663('0x36'))){_0x4b55e2[_0xf663('0x1e')]=qs[_0xf663('0x1e')](_0x667f4[_0xf663('0x30')][_0xf663('0x1e')]);_0x4b55e2[_0xf663('0x1c')]=qs[_0xf663('0x1c')](_0x667f4[_0xf663('0x30')][_0xf663('0x1c')]);}_0x4b55e2[_0xf663('0x37')]=qs[_0xf663('0x38')](_0x667f4[_0xf663('0x30')][_0xf663('0x38')]);_0x4b55e2[_0xf663('0x39')]=qs[_0xf663('0x31')](_[_0xf663('0x3a')](_0x667f4[_0xf663('0x30')],_0x2a5d48['filters']),_0x1d3ee3);if(_0x667f4[_0xf663('0x30')]['filter']){_0x4b55e2['where']=_[_0xf663('0x3b')](_0x4b55e2[_0xf663('0x39')],{'$or':_[_0xf663('0x2a')](_0x1d3ee3,function(_0x4d044f){if(_0x4d044f[_0xf663('0x2c')]!==_0xf663('0x3c')){var _0x305b81={};_0x305b81[_0x4d044f[_0xf663('0x28')]]={'$like':'%'+_0x667f4[_0xf663('0x30')]['filter']+'%'};return _0x305b81;}})});}_0x4b55e2=_[_0xf663('0x3b')]({},_0x4b55e2,_0x667f4[_0xf663('0x3d')]);var _0x4415e1={'where':_0x4b55e2[_0xf663('0x39')]};return db['VoiceMailMessage'][_0xf663('0x1f')](_0x4415e1)[_0xf663('0x26')](function(_0x139c8f){_0x401142[_0xf663('0x1f')]=_0x139c8f;if(_0x667f4[_0xf663('0x30')]['includeAll']){_0x4b55e2['include']=[{'all':!![]}];}return db[_0xf663('0x3e')][_0xf663('0x3f')](_0x4b55e2);})[_0xf663('0x26')](function(_0x560f83){_0x401142[_0xf663('0x40')]=_0x560f83;return _0x401142;})[_0xf663('0x26')](respondWithFilteredResult(_0x3afbc4,_0x4b55e2))[_0xf663('0x41')](handleError(_0x3afbc4,null));};exports['show']=function(_0x3668e9,_0x3a4d4e){var _0xdc89f8={'raw':!![],'where':{'id':_0x3668e9['params']['id']}},_0x207723={};_0x207723[_0xf663('0x2e')]=_[_0xf663('0x42')](db['VoiceMailMessage'][_0xf663('0x2b')]);_0x207723[_0xf663('0x30')]=_['keys'](_0x3668e9[_0xf663('0x30')]);_0x207723[_0xf663('0x31')]=_['intersection'](_0x207723[_0xf663('0x2e')],_0x207723[_0xf663('0x30')]);_0xdc89f8['attributes']=_['intersection'](_0x207723[_0xf663('0x2e')],qs[_0xf663('0x34')](_0x3668e9['query']['fields']));_0xdc89f8[_0xf663('0x33')]=_0xdc89f8[_0xf663('0x33')][_0xf663('0x35')]?_0xdc89f8[_0xf663('0x33')]:_0x207723[_0xf663('0x2e')];if(_0x3668e9['query'][_0xf663('0x43')]){_0xdc89f8[_0xf663('0x44')]=[{'all':!![]}];}_0xdc89f8=_[_0xf663('0x3b')]({},_0xdc89f8,_0x3668e9[_0xf663('0x3d')]);return db[_0xf663('0x3e')][_0xf663('0x45')](_0xdc89f8)[_0xf663('0x26')](handleEntityNotFound(_0x3a4d4e,null))['then'](respondWithResult(_0x3a4d4e,null))[_0xf663('0x41')](handleError(_0x3a4d4e,null));};exports['create']=function(_0x552fb5,_0x5a6385){return db['VoiceMailMessage']['create'](_0x552fb5['body'],{})[_0xf663('0x26')](respondWithResult(_0x5a6385,0xc9))['catch'](handleError(_0x5a6385,null));};exports[_0xf663('0x24')]=function(_0x3bd544,_0x11d74e){if(_0x3bd544[_0xf663('0x46')]['id']){delete _0x3bd544[_0xf663('0x46')]['id'];}return db[_0xf663('0x3e')][_0xf663('0x45')]({'where':{'id':_0x3bd544[_0xf663('0x47')]['id']}})['then'](handleEntityNotFound(_0x11d74e,null))[_0xf663('0x26')](saveUpdates(_0x3bd544[_0xf663('0x46')],null))['then'](respondWithResult(_0x11d74e,null))[_0xf663('0x41')](handleError(_0x11d74e,null));};exports[_0xf663('0x25')]=function(_0x5833ff,_0x5caabe){return db[_0xf663('0x3e')][_0xf663('0x45')]({'where':{'id':_0x5833ff[_0xf663('0x47')]['id']}})['then'](handleEntityNotFound(_0x5caabe,null))[_0xf663('0x26')](removeEntity(_0x5caabe,null))[_0xf663('0x41')](handleError(_0x5caabe,null));};exports[_0xf663('0x48')]=function(_0x2bdcf9,_0x7ad761,_0x388572){return db[_0xf663('0x3e')][_0xf663('0x45')]({'where':{'id':_0x2bdcf9['params']['id']},'attributes':['id','recording',_0xf663('0x49')]})['then'](handleEntityNotFound(_0x7ad761,null))[_0xf663('0x26')](function(_0x4b5416){if(_0x4b5416){if(!_0x4b5416[_0xf663('0x4a')]){throw new db[(_0xf663('0x4b'))][(_0xf663('0x4c'))](_0xf663('0x4d'));}var _0x4fbf1b={'Content-Type':'audio/wav','Content-Disposition':_0xf663('0x4e')};if(_0x4b5416[_0xf663('0x49')]){_0x4fbf1b[_0xf663('0x4f')]='attachment;\x20filename=\x22'+_0x4b5416[_0xf663('0x49')]+_0xf663('0x50');}_0x7ad761[_0xf663('0x20')](_0x4fbf1b);return _0x7ad761[_0xf663('0x29')](new Buffer(_0x4b5416[_0xf663('0x4a')]));}})[_0xf663('0x41')](handleError(_0x7ad761,null));}; \ No newline at end of file +var _0x4ae9=['include','findAll','rows','catch','show','params','options','find','create','body','destroy','recording','Sequelize','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','stack','name','send','index','map','VoiceMailMessage','rawAttributes','type','differenceBy','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x5ad97d,_0xd58ecb){var _0x3ba721=function(_0x1f14da){while(--_0x1f14da){_0x5ad97d['push'](_0x5ad97d['shift']());}};_0x3ba721(++_0xd58ecb);}(_0x4ae9,0x10e));var _0x94ae=function(_0x4e1211,_0x1c0e26){_0x4e1211=_0x4e1211-0x0;var _0x4ae887=_0x4ae9[_0x4e1211];return _0x4ae887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94ae('0x0'));var zipdir=require(_0x94ae('0x1'));var jsonpatch=require(_0x94ae('0x2'));var rp=require(_0x94ae('0x3'));var moment=require(_0x94ae('0x4'));var BPromise=require(_0x94ae('0x5'));var Mustache=require(_0x94ae('0x6'));var util=require(_0x94ae('0x7'));var path=require(_0x94ae('0x8'));var sox=require(_0x94ae('0x9'));var csv=require(_0x94ae('0xa'));var ejs=require(_0x94ae('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ae('0xc'));var squel=require(_0x94ae('0xd'));var crypto=require(_0x94ae('0xe'));var jsforce=require(_0x94ae('0xf'));var deskjs=require(_0x94ae('0x10'));var toCsv=require('to-csv');var querystring=require(_0x94ae('0x11'));var Papa=require('papaparse');var Redis=require(_0x94ae('0x12'));var authService=require(_0x94ae('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x94ae('0x14'));var hardwareService=require(_0x94ae('0x15'));var logger=require(_0x94ae('0x16'))(_0x94ae('0x17'));var utils=require(_0x94ae('0x18'));var config=require(_0x94ae('0x19'));var licenseUtil=require(_0x94ae('0x1a'));var db=require(_0x94ae('0x1b'))['db'];function respondWithStatusCode(_0x531d36,_0x4a1b80){_0x4a1b80=_0x4a1b80||0xcc;return function(_0x412250){if(_0x412250){return _0x531d36['sendStatus'](_0x4a1b80);}return _0x531d36[_0x94ae('0x1c')](_0x4a1b80)[_0x94ae('0x1d')]();};}function respondWithResult(_0x354c55,_0x209017){_0x209017=_0x209017||0xc8;return function(_0x5ca9c4){if(_0x5ca9c4){return _0x354c55[_0x94ae('0x1c')](_0x209017)['json'](_0x5ca9c4);}};}function respondWithFilteredResult(_0x373d70,_0x4e1457){return function(_0x281082){if(_0x281082){var _0x1d4045=typeof _0x4e1457[_0x94ae('0x1e')]===_0x94ae('0x1f')&&typeof _0x4e1457[_0x94ae('0x20')]===_0x94ae('0x1f');var _0x2ee59=_0x281082[_0x94ae('0x21')];var _0x44d11f=_0x1d4045?0x0:_0x4e1457[_0x94ae('0x1e')];var _0x5d49e9=_0x1d4045?_0x281082[_0x94ae('0x21')]:_0x4e1457[_0x94ae('0x1e')]+_0x4e1457[_0x94ae('0x20')];var _0x3459de;if(_0x5d49e9>=_0x2ee59){_0x5d49e9=_0x2ee59;_0x3459de=0xc8;}else{_0x3459de=0xce;}_0x373d70['status'](_0x3459de);return _0x373d70[_0x94ae('0x22')](_0x94ae('0x23'),_0x44d11f+'-'+_0x5d49e9+'/'+_0x2ee59)[_0x94ae('0x24')](_0x281082);}return null;};}function patchUpdates(_0xcddd9c){return function(_0x52f25e){try{jsonpatch[_0x94ae('0x25')](_0x52f25e,_0xcddd9c,!![]);}catch(_0x2c498e){return BPromise['reject'](_0x2c498e);}return _0x52f25e['save']();};}function saveUpdates(_0x14def0,_0x46be55){return function(_0x314680){if(_0x314680){return _0x314680[_0x94ae('0x26')](_0x14def0)[_0x94ae('0x27')](function(_0x505a09){return _0x505a09;});}return null;};}function removeEntity(_0x10cdf2,_0x2d4f13){return function(_0x312c2d){if(_0x312c2d){return _0x312c2d['destroy']()[_0x94ae('0x27')](function(){_0x10cdf2[_0x94ae('0x1c')](0xcc)[_0x94ae('0x1d')]();});}};}function handleEntityNotFound(_0x97ddc3,_0x3c87e3){return function(_0x5884a6){if(!_0x5884a6){_0x97ddc3[_0x94ae('0x28')](0x194);}return _0x5884a6;};}function handleError(_0x18ba8d,_0x10743d){_0x10743d=_0x10743d||0x1f4;return function(_0x3a400f){logger['error'](_0x3a400f[_0x94ae('0x29')]);if(_0x3a400f[_0x94ae('0x2a')]){delete _0x3a400f[_0x94ae('0x2a')];}_0x18ba8d[_0x94ae('0x1c')](_0x10743d)[_0x94ae('0x2b')](_0x3a400f);};}exports[_0x94ae('0x2c')]=function(_0x4008be,_0x4c740c){var _0x4ba9e5={},_0x1f3445={},_0x3a866d={'count':0x0,'rows':[]};var _0x2253f6=_[_0x94ae('0x2d')](db[_0x94ae('0x2e')][_0x94ae('0x2f')],function(_0x327273){return{'name':_0x327273['fieldName'],'type':_0x327273[_0x94ae('0x30')]['key']};});_0x1f3445['model']=_[_0x94ae('0x31')](_['map'](_0x2253f6,'name'),[_0x94ae('0x2a')]);_0x1f3445[_0x94ae('0x32')]=_[_0x94ae('0x33')](_0x4008be[_0x94ae('0x32')]);_0x1f3445[_0x94ae('0x34')]=_['intersection'](_0x1f3445['model'],_0x1f3445[_0x94ae('0x32')]);_0x4ba9e5['attributes']=_[_0x94ae('0x35')](_0x1f3445[_0x94ae('0x36')],qs[_0x94ae('0x37')](_0x4008be[_0x94ae('0x32')][_0x94ae('0x37')]));_0x4ba9e5[_0x94ae('0x38')]=_0x4ba9e5[_0x94ae('0x38')][_0x94ae('0x39')]?_0x4ba9e5['attributes']:_0x1f3445[_0x94ae('0x36')];if(!_0x4008be[_0x94ae('0x32')]['hasOwnProperty'](_0x94ae('0x3a'))){_0x4ba9e5[_0x94ae('0x20')]=qs[_0x94ae('0x20')](_0x4008be[_0x94ae('0x32')]['limit']);_0x4ba9e5['offset']=qs[_0x94ae('0x1e')](_0x4008be[_0x94ae('0x32')]['offset']);}_0x4ba9e5['order']=qs[_0x94ae('0x3b')](_0x4008be[_0x94ae('0x32')][_0x94ae('0x3b')]);_0x4ba9e5[_0x94ae('0x3c')]=qs[_0x94ae('0x34')](_[_0x94ae('0x3d')](_0x4008be[_0x94ae('0x32')],_0x1f3445[_0x94ae('0x34')]),_0x2253f6);if(_0x4008be[_0x94ae('0x32')][_0x94ae('0x3e')]){_0x4ba9e5[_0x94ae('0x3c')]=_[_0x94ae('0x3f')](_0x4ba9e5['where'],{'$or':_[_0x94ae('0x2d')](_0x2253f6,function(_0x52cf08){if(_0x52cf08[_0x94ae('0x30')]!==_0x94ae('0x40')){var _0x41ab59={};_0x41ab59[_0x52cf08[_0x94ae('0x2a')]]={'$like':'%'+_0x4008be[_0x94ae('0x32')][_0x94ae('0x3e')]+'%'};return _0x41ab59;}})});}_0x4ba9e5=_[_0x94ae('0x3f')]({},_0x4ba9e5,_0x4008be['options']);var _0xc07896={'where':_0x4ba9e5['where']};return db[_0x94ae('0x2e')]['count'](_0xc07896)[_0x94ae('0x27')](function(_0x484fd8){_0x3a866d[_0x94ae('0x21')]=_0x484fd8;if(_0x4008be['query'][_0x94ae('0x41')]){_0x4ba9e5[_0x94ae('0x42')]=[{'all':!![]}];}return db[_0x94ae('0x2e')][_0x94ae('0x43')](_0x4ba9e5);})[_0x94ae('0x27')](function(_0x132a1c){_0x3a866d[_0x94ae('0x44')]=_0x132a1c;return _0x3a866d;})[_0x94ae('0x27')](respondWithFilteredResult(_0x4c740c,_0x4ba9e5))[_0x94ae('0x45')](handleError(_0x4c740c,null));};exports[_0x94ae('0x46')]=function(_0x34a5f0,_0x4047d0){var _0x42aac0={'raw':!![],'where':{'id':_0x34a5f0[_0x94ae('0x47')]['id']}},_0x5d32b7={};_0x5d32b7[_0x94ae('0x36')]=_['keys'](db[_0x94ae('0x2e')][_0x94ae('0x2f')]);_0x5d32b7['query']=_[_0x94ae('0x33')](_0x34a5f0[_0x94ae('0x32')]);_0x5d32b7[_0x94ae('0x34')]=_[_0x94ae('0x35')](_0x5d32b7[_0x94ae('0x36')],_0x5d32b7[_0x94ae('0x32')]);_0x42aac0['attributes']=_[_0x94ae('0x35')](_0x5d32b7[_0x94ae('0x36')],qs[_0x94ae('0x37')](_0x34a5f0[_0x94ae('0x32')]['fields']));_0x42aac0['attributes']=_0x42aac0[_0x94ae('0x38')][_0x94ae('0x39')]?_0x42aac0['attributes']:_0x5d32b7[_0x94ae('0x36')];if(_0x34a5f0[_0x94ae('0x32')][_0x94ae('0x41')]){_0x42aac0[_0x94ae('0x42')]=[{'all':!![]}];}_0x42aac0=_[_0x94ae('0x3f')]({},_0x42aac0,_0x34a5f0[_0x94ae('0x48')]);return db[_0x94ae('0x2e')][_0x94ae('0x49')](_0x42aac0)[_0x94ae('0x27')](handleEntityNotFound(_0x4047d0,null))[_0x94ae('0x27')](respondWithResult(_0x4047d0,null))[_0x94ae('0x45')](handleError(_0x4047d0,null));};exports[_0x94ae('0x4a')]=function(_0x106e36,_0x1ec0a2){return db[_0x94ae('0x2e')][_0x94ae('0x4a')](_0x106e36[_0x94ae('0x4b')],{})[_0x94ae('0x27')](respondWithResult(_0x1ec0a2,0xc9))['catch'](handleError(_0x1ec0a2,null));};exports[_0x94ae('0x26')]=function(_0x36c88f,_0x4a9a26){if(_0x36c88f[_0x94ae('0x4b')]['id']){delete _0x36c88f['body']['id'];}return db[_0x94ae('0x2e')][_0x94ae('0x49')]({'where':{'id':_0x36c88f[_0x94ae('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a9a26,null))[_0x94ae('0x27')](saveUpdates(_0x36c88f[_0x94ae('0x4b')],null))[_0x94ae('0x27')](respondWithResult(_0x4a9a26,null))[_0x94ae('0x45')](handleError(_0x4a9a26,null));};exports[_0x94ae('0x4c')]=function(_0x55da5e,_0x12b295){return db[_0x94ae('0x2e')][_0x94ae('0x49')]({'where':{'id':_0x55da5e[_0x94ae('0x47')]['id']}})[_0x94ae('0x27')](handleEntityNotFound(_0x12b295,null))[_0x94ae('0x27')](removeEntity(_0x12b295,null))[_0x94ae('0x45')](handleError(_0x12b295,null));};exports['download']=function(_0xc631ac,_0x4ccb40,_0x547074){return db['VoiceMailMessage'][_0x94ae('0x49')]({'where':{'id':_0xc631ac[_0x94ae('0x47')]['id']},'attributes':['id','recording','msg_id']})[_0x94ae('0x27')](handleEntityNotFound(_0x4ccb40,null))['then'](function(_0x240f8c){if(_0x240f8c){if(!_0x240f8c[_0x94ae('0x4d')]){throw new db[(_0x94ae('0x4e'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x1c737d={'Content-Type':_0x94ae('0x4f'),'Content-Disposition':_0x94ae('0x50')};if(_0x240f8c[_0x94ae('0x51')]){_0x1c737d['Content-Disposition']=_0x94ae('0x52')+_0x240f8c[_0x94ae('0x51')]+_0x94ae('0x53');}_0x4ccb40[_0x94ae('0x22')](_0x1c737d);return _0x4ccb40[_0x94ae('0x2b')](new Buffer(_0x240f8c[_0x94ae('0x4d')]));}})[_0x94ae('0x45')](handleError(_0x4ccb40,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index da17522..3730528 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 _0xaf0e=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0xaf0e,0x1d8));var _0xeaf0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaf0e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xeaf0('0x0'));var util=require('util');var logger=require(_0xeaf0('0x1'))(_0xeaf0('0x2'));var moment=require(_0xeaf0('0x3'));var BPromise=require(_0xeaf0('0x4'));var rp=require(_0xeaf0('0x5'));var fs=require('fs');var path=require(_0xeaf0('0x6'));var rimraf=require(_0xeaf0('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xeaf0('0x8')]=function(_0xec2ecb,_0xfadb97){return _0xec2ecb[_0xeaf0('0x9')](_0xeaf0('0xa'),attributes,{'tableName':_0xeaf0('0xb'),'paranoid':![],'indexes':[{'name':_0xeaf0('0xc'),'fields':[_0xeaf0('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x15d7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x38640b,_0x1bed92){var _0x3fd5d5=function(_0x559ee6){while(--_0x559ee6){_0x38640b['push'](_0x38640b['shift']());}};_0x3fd5d5(++_0x1bed92);}(_0x15d7,0xa6));var _0x715d=function(_0x146a6b,_0x204330){_0x146a6b=_0x146a6b-0x0;var _0x40bf25=_0x15d7[_0x146a6b];return _0x40bf25;};'use strict';var _=require(_0x715d('0x0'));var util=require(_0x715d('0x1'));var logger=require(_0x715d('0x2'))(_0x715d('0x3'));var moment=require(_0x715d('0x4'));var BPromise=require(_0x715d('0x5'));var rp=require(_0x715d('0x6'));var fs=require('fs');var path=require(_0x715d('0x7'));var rimraf=require(_0x715d('0x8'));var config=require('../../config/environment');var attributes=require(_0x715d('0x9'));module[_0x715d('0xa')]=function(_0x9003a3,_0x565238){return _0x9003a3['define'](_0x715d('0xb'),attributes,{'tableName':_0x715d('0xc'),'paranoid':![],'indexes':[{'name':_0x715d('0xd'),'fields':[_0x715d('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index a74bfb7..731d502 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 _0x9d67=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash'];(function(_0x3cdddf,_0x17119c){var _0x51e2d6=function(_0x16f1ea){while(--_0x16f1ea){_0x3cdddf['push'](_0x3cdddf['shift']());}};_0x51e2d6(++_0x17119c);}(_0x9d67,0x77));var _0x79d6=function(_0x5dcc3d,_0x365c26){_0x5dcc3d=_0x5dcc3d-0x0;var _0x79e198=_0x9d67[_0x5dcc3d];return _0x79e198;};'use strict';var _=require(_0x79d6('0x0'));var util=require(_0x79d6('0x1'));var moment=require(_0x79d6('0x2'));var BPromise=require(_0x79d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x79d6('0x4'));var logger=require(_0x79d6('0x5'))(_0x79d6('0x6'));var config=require(_0x79d6('0x7'));var jayson=require(_0x79d6('0x8'));var client=jayson['client'][_0x79d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d06a2,_0x58b4bd,_0x583e9f){return new BPromise(function(_0x23b1d5,_0x5e75d5){return client['request'](_0x2d06a2,_0x583e9f)[_0x79d6('0xa')](function(_0xb5eeb){logger[_0x79d6('0xb')](_0x79d6('0xc'),_0x58b4bd,'request\x20sent');logger[_0x79d6('0xd')](_0x79d6('0xe'),_0x58b4bd,'request\x20sent',JSON[_0x79d6('0xf')](_0xb5eeb));if(_0xb5eeb[_0x79d6('0x10')]){if(_0xb5eeb[_0x79d6('0x10')]['code']===0x1f4){logger[_0x79d6('0x10')](_0x79d6('0xc'),_0x58b4bd,_0xb5eeb[_0x79d6('0x10')][_0x79d6('0x11')]);return _0x5e75d5(_0xb5eeb[_0x79d6('0x10')]['message']);}logger[_0x79d6('0x10')](_0x79d6('0xc'),_0x58b4bd,_0xb5eeb[_0x79d6('0x10')][_0x79d6('0x11')]);return _0x23b1d5(_0xb5eeb[_0x79d6('0x10')][_0x79d6('0x11')]);}else{logger[_0x79d6('0xb')](_0x79d6('0xc'),_0x58b4bd,_0x79d6('0x12'));_0x23b1d5(_0xb5eeb['result'][_0x79d6('0x11')]);}})[_0x79d6('0x13')](function(_0x5ec929){logger[_0x79d6('0x10')](_0x79d6('0xc'),_0x58b4bd,_0x5ec929);_0x5e75d5(_0x5ec929);});});} \ No newline at end of file +var _0xe4f7=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a70c1,_0x58c33b){var _0x58aac7=function(_0x52d2a8){while(--_0x52d2a8){_0x4a70c1['push'](_0x4a70c1['shift']());}};_0x58aac7(++_0x58c33b);}(_0xe4f7,0x1ea));var _0x7e4f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe4f7[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x7e4f('0x0'));var moment=require(_0x7e4f('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e4f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x7e4f('0x4'));var jayson=require(_0x7e4f('0x5'));var client=jayson[_0x7e4f('0x6')][_0x7e4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x196e0d,_0x54b0ad,_0x4ee925){return new BPromise(function(_0x17a91d,_0xd13c19){return client[_0x7e4f('0x8')](_0x196e0d,_0x4ee925)[_0x7e4f('0x9')](function(_0xeec65a){logger[_0x7e4f('0xa')](_0x7e4f('0xb'),_0x54b0ad,_0x7e4f('0xc'));logger['debug'](_0x7e4f('0xd'),_0x54b0ad,'request\x20sent',JSON[_0x7e4f('0xe')](_0xeec65a));if(_0xeec65a[_0x7e4f('0xf')]){if(_0xeec65a['error'][_0x7e4f('0x10')]===0x1f4){logger[_0x7e4f('0xf')](_0x7e4f('0xb'),_0x54b0ad,_0xeec65a['error'][_0x7e4f('0x11')]);return _0xd13c19(_0xeec65a[_0x7e4f('0xf')]['message']);}logger[_0x7e4f('0xf')](_0x7e4f('0xb'),_0x54b0ad,_0xeec65a[_0x7e4f('0xf')][_0x7e4f('0x11')]);return _0x17a91d(_0xeec65a['error'][_0x7e4f('0x11')]);}else{logger[_0x7e4f('0xa')](_0x7e4f('0xb'),_0x54b0ad,'request\x20sent');_0x17a91d(_0xeec65a[_0x7e4f('0x12')][_0x7e4f('0x11')]);}})[_0x7e4f('0x13')](function(_0x40367d){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x54b0ad,_0x40367d);_0xd13c19(_0x40367d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index d913503..4e7e458 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 _0xa30a=['get','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x468cf2,_0x465b5f){var _0x19030d=function(_0x1823fa){while(--_0x1823fa){_0x468cf2['push'](_0x468cf2['shift']());}};_0x19030d(++_0x465b5f);}(_0xa30a,0xe7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xaa30('0x0'));var path=require(_0xaa30('0x1'));var timeout=require(_0xaa30('0x2'));var express=require(_0xaa30('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaa30('0x4'));var interaction=require(_0xaa30('0x5'));var config=require(_0xaa30('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xaa30('0x7')](),controller[_0xaa30('0x8')]);router[_0xaa30('0x9')]('/:id',auth[_0xaa30('0x7')](),controller[_0xaa30('0xa')]);router['get'](_0xaa30('0xb'),auth[_0xaa30('0x7')](),controller[_0xaa30('0xc')]);router[_0xaa30('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa30('0xe')]);router[_0xaa30('0xd')](_0xaa30('0xb'),auth[_0xaa30('0x7')](),controller[_0xaa30('0xf')]);router[_0xaa30('0x10')](_0xaa30('0x11'),auth[_0xaa30('0x7')](),controller[_0xaa30('0x12')]);router['delete']('/:id',auth[_0xaa30('0x7')](),controller[_0xaa30('0x13')]);router[_0xaa30('0x14')](_0xaa30('0x15'),auth[_0xaa30('0x7')](),controller[_0xaa30('0x16')]);module[_0xaa30('0x17')]=router; \ No newline at end of file +var _0x0bc4=['removeSound','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x47457c,_0x466483){var _0x533d24=function(_0x124ab6){while(--_0x124ab6){_0x47457c['push'](_0x47457c['shift']());}};_0x533d24(++_0x466483);}(_0x0bc4,0xb5));var _0x40bc=function(_0x32036c,_0x5c2ec6){_0x32036c=_0x32036c-0x0;var _0x1d8818=_0x0bc4[_0x32036c];return _0x1d8818;};'use strict';var multer=require(_0x40bc('0x0'));var util=require(_0x40bc('0x1'));var path=require(_0x40bc('0x2'));var timeout=require(_0x40bc('0x3'));var express=require('express');var router=express[_0x40bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40bc('0x5'));var interaction=require(_0x40bc('0x6'));var config=require('../../config/environment');var controller=require(_0x40bc('0x7'));router[_0x40bc('0x8')]('/',auth[_0x40bc('0x9')](),controller['index']);router[_0x40bc('0x8')](_0x40bc('0xa'),auth[_0x40bc('0x9')](),controller['show']);router[_0x40bc('0x8')](_0x40bc('0xb'),auth['isAuthenticated'](),controller[_0x40bc('0xc')]);router[_0x40bc('0xd')]('/',auth[_0x40bc('0x9')](),controller['create']);router[_0x40bc('0xd')](_0x40bc('0xb'),auth['isAuthenticated'](),controller['addSound']);router[_0x40bc('0xe')]('/:id',auth[_0x40bc('0x9')](),controller[_0x40bc('0xf')]);router[_0x40bc('0x10')]('/:id',auth[_0x40bc('0x9')](),controller[_0x40bc('0x11')]);router[_0x40bc('0x10')](_0x40bc('0x12'),auth[_0x40bc('0x9')](),controller[_0x40bc('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 151ddd6..aaa3bac 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 _0xa780=['BOOLEAN','exports','STRING','ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP'];(function(_0x58e32c,_0x309781){var _0x481e60=function(_0x5326ab){while(--_0x5326ab){_0x58e32c['push'](_0x58e32c['shift']());}};_0x481e60(++_0x309781);}(_0xa780,0x97));var _0x0a78=function(_0x582f8f,_0x271d59){_0x582f8f=_0x582f8f-0x0;var _0x14d725=_0xa780[_0x582f8f];return _0x14d725;};'use strict';var Sequelize=require('sequelize');module[_0x0a78('0x0')]={'name':{'type':Sequelize[_0x0a78('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x0a78('0x2')]('custom',_0x0a78('0x3'),_0x0a78('0x4'),_0x0a78('0x5'),'quietmp3',_0x0a78('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x0a78('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0a78('0x1')],'allowNull':!![],'defaultValue':_0x0a78('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x0a78('0x8')},'defaultEntry':{'type':Sequelize[_0x0a78('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc20=['exports','STRING','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','sequelize'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xcc20,0x6b));var _0x0cc2=function(_0x42cde3,_0x105eda){_0x42cde3=_0x42cde3-0x0;var _0x1ebfa0=_0xcc20[_0x42cde3];return _0x1ebfa0;};'use strict';var Sequelize=require(_0x0cc2('0x0'));module[_0x0cc2('0x1')]={'name':{'type':Sequelize[_0x0cc2('0x2')],'allowNull':![],'unique':_0x0cc2('0x3')},'mode':{'type':Sequelize[_0x0cc2('0x4')](_0x0cc2('0x5'),_0x0cc2('0x6'),'mp3nb',_0x0cc2('0x7'),_0x0cc2('0x8'),_0x0cc2('0x9')),'allowNull':!![],'defaultValue':_0x0cc2('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x0cc2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x0cc2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0cc2('0xa')},'format':{'type':Sequelize[_0x0cc2('0x2')],'allowNull':!![]},'stamp':{'type':_0x0cc2('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index b486dd2..0a706c4 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 _0x9675=['hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','length','includeAll','include','find','body','params','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','removeSound','id2','order','map','getSounds'];(function(_0x51ce3e,_0x4a1ed5){var _0x175562=function(_0x2e739d){while(--_0x2e739d){_0x51ce3e['push'](_0x51ce3e['shift']());}};_0x175562(++_0x4a1ed5);}(_0x9675,0x72));var _0x5967=function(_0x10c60b,_0x15c539){_0x10c60b=_0x10c60b-0x0;var _0x27f91c=_0x9675[_0x10c60b];return _0x27f91c;};'use strict';var emlformat=require(_0x5967('0x0'));var rimraf=require(_0x5967('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5967('0x2'));var rp=require(_0x5967('0x3'));var moment=require(_0x5967('0x4'));var BPromise=require(_0x5967('0x5'));var Mustache=require(_0x5967('0x6'));var util=require(_0x5967('0x7'));var path=require(_0x5967('0x8'));var sox=require(_0x5967('0x9'));var csv=require(_0x5967('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5967('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5967('0xc'));var jsforce=require(_0x5967('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5967('0xa'));var querystring=require(_0x5967('0xe'));var Papa=require(_0x5967('0xf'));var Redis=require(_0x5967('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5967('0x11'));var as=require(_0x5967('0x12'));var hardwareService=require(_0x5967('0x13'));var logger=require(_0x5967('0x14'))(_0x5967('0x15'));var utils=require(_0x5967('0x16'));var config=require(_0x5967('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5967('0x18'))['db'];function respondWithStatusCode(_0x5a8f08,_0x424cbf){_0x424cbf=_0x424cbf||0xcc;return function(_0x55f705){if(_0x55f705){return _0x5a8f08[_0x5967('0x19')](_0x424cbf);}return _0x5a8f08[_0x5967('0x1a')](_0x424cbf)[_0x5967('0x1b')]();};}function respondWithResult(_0xfe5d59,_0x3a62e5){_0x3a62e5=_0x3a62e5||0xc8;return function(_0x432326){if(_0x432326){return _0xfe5d59[_0x5967('0x1a')](_0x3a62e5)['json'](_0x432326);}};}function respondWithFilteredResult(_0x26bdcf,_0x299559){return function(_0x5ad622){if(_0x5ad622){var _0x57a9a8=typeof _0x299559[_0x5967('0x1c')]==='undefined'&&typeof _0x299559[_0x5967('0x1d')]===_0x5967('0x1e');var _0x551bfd=_0x5ad622[_0x5967('0x1f')];var _0x493713=_0x57a9a8?0x0:_0x299559['offset'];var _0x37292a=_0x57a9a8?_0x5ad622[_0x5967('0x1f')]:_0x299559[_0x5967('0x1c')]+_0x299559['limit'];var _0x3382a8;if(_0x37292a>=_0x551bfd){_0x37292a=_0x551bfd;_0x3382a8=0xc8;}else{_0x3382a8=0xce;}_0x26bdcf[_0x5967('0x1a')](_0x3382a8);return _0x26bdcf['set'](_0x5967('0x20'),_0x493713+'-'+_0x37292a+'/'+_0x551bfd)['json'](_0x5ad622);}return null;};}function patchUpdates(_0x5f1870){return function(_0x39b9cb){try{jsonpatch[_0x5967('0x21')](_0x39b9cb,_0x5f1870,!![]);}catch(_0x4f111e){return BPromise[_0x5967('0x22')](_0x4f111e);}return _0x39b9cb[_0x5967('0x23')]();};}function saveUpdates(_0x1a05d0,_0x417381){return function(_0x3b59c1){if(_0x3b59c1){return _0x3b59c1[_0x5967('0x24')](_0x1a05d0)['then'](function(_0x4e6675){return _0x4e6675;});}return null;};}function removeEntity(_0x85d0f6,_0x3e15f6){return function(_0x2378ee){if(_0x2378ee){return _0x2378ee[_0x5967('0x25')]()[_0x5967('0x26')](function(){var _0x7454cf=_0x2378ee[_0x5967('0x27')]({'plain':!![]});var _0x53a99e=_0x5967('0x28');return db[_0x5967('0x29')][_0x5967('0x25')]({'where':{'type':_0x53a99e,'resourceId':_0x7454cf['id']}})[_0x5967('0x26')](function(){return _0x2378ee;});})[_0x5967('0x26')](function(){_0x85d0f6[_0x5967('0x1a')](0xcc)[_0x5967('0x1b')]();});}};}function handleEntityNotFound(_0x40e411,_0x159871){return function(_0x4456b3){if(!_0x4456b3){_0x40e411[_0x5967('0x19')](0x194);}return _0x4456b3;};}function handleError(_0x49ae06,_0x14730a){_0x14730a=_0x14730a||0x1f4;return function(_0x1f3ae6){logger[_0x5967('0x2a')](_0x1f3ae6[_0x5967('0x2b')]);if(_0x1f3ae6[_0x5967('0x2c')]){delete _0x1f3ae6[_0x5967('0x2c')];}_0x49ae06[_0x5967('0x1a')](_0x14730a)['send'](_0x1f3ae6);};}exports['index']=function(_0x593f2c,_0x1e0a71){var _0x53c6ae={},_0x4e25ff={},_0x3f98f8={'count':0x0,'rows':[]};var _0x12e788=_['map'](db[_0x5967('0x2d')][_0x5967('0x2e')],function(_0x34bb7c){return{'name':_0x34bb7c[_0x5967('0x2f')],'type':_0x34bb7c[_0x5967('0x30')]['key']};});_0x4e25ff[_0x5967('0x31')]=_['map'](_0x12e788,_0x5967('0x2c'));_0x4e25ff[_0x5967('0x32')]=_[_0x5967('0x33')](_0x593f2c[_0x5967('0x32')]);_0x4e25ff[_0x5967('0x34')]=_['intersection'](_0x4e25ff[_0x5967('0x31')],_0x4e25ff[_0x5967('0x32')]);_0x53c6ae['attributes']=_[_0x5967('0x35')](_0x4e25ff[_0x5967('0x31')],qs[_0x5967('0x36')](_0x593f2c[_0x5967('0x32')][_0x5967('0x36')]));_0x53c6ae[_0x5967('0x37')]=_0x53c6ae[_0x5967('0x37')]['length']?_0x53c6ae[_0x5967('0x37')]:_0x4e25ff['model'];if(!_0x593f2c['query']['hasOwnProperty'](_0x5967('0x38'))){_0x53c6ae[_0x5967('0x1d')]=qs[_0x5967('0x1d')](_0x593f2c[_0x5967('0x32')][_0x5967('0x1d')]);_0x53c6ae[_0x5967('0x1c')]=qs[_0x5967('0x1c')](_0x593f2c[_0x5967('0x32')]['offset']);}_0x53c6ae['order']=qs[_0x5967('0x39')](_0x593f2c['query'][_0x5967('0x39')]);delete _0x593f2c[_0x5967('0x32')][_0x5967('0x39')];_0x53c6ae[_0x5967('0x3a')]=qs[_0x5967('0x34')](_[_0x5967('0x3b')](_0x593f2c[_0x5967('0x32')],_0x4e25ff[_0x5967('0x34')]),_0x12e788);if(_0x593f2c[_0x5967('0x32')][_0x5967('0x3c')]){_0x53c6ae['where']=_[_0x5967('0x3d')](_0x53c6ae['where'],{'$or':_['map'](_0x12e788,function(_0x2ff793){if(_0x2ff793[_0x5967('0x30')]!=='VIRTUAL'){var _0x3c7552={};_0x3c7552[_0x2ff793[_0x5967('0x2c')]]={'$like':'%'+_0x593f2c[_0x5967('0x32')][_0x5967('0x3c')]+'%'};return _0x3c7552;}})});}_0x53c6ae=_['merge']({},_0x53c6ae,_0x593f2c[_0x5967('0x3e')]);var _0x3a0f59={'where':_0x53c6ae[_0x5967('0x3a')]};return db[_0x5967('0x2d')]['count'](_0x3a0f59)['then'](function(_0x2ef494){_0x3f98f8[_0x5967('0x1f')]=_0x2ef494;if(_0x593f2c[_0x5967('0x32')]['includeAll']){_0x53c6ae['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5967('0x3f')](_0x53c6ae);})[_0x5967('0x26')](function(_0x39a754){_0x3f98f8[_0x5967('0x40')]=_0x39a754;return _0x3f98f8;})[_0x5967('0x26')](respondWithFilteredResult(_0x1e0a71,_0x53c6ae))[_0x5967('0x41')](handleError(_0x1e0a71,null));};exports[_0x5967('0x42')]=function(_0x4b4742,_0x3176bf){var _0x816be5={'raw':![],'where':{'id':_0x4b4742['params']['id']}},_0x4fe863={};_0x4fe863['model']=_['keys'](db[_0x5967('0x2d')][_0x5967('0x2e')]);_0x4fe863[_0x5967('0x32')]=_['keys'](_0x4b4742[_0x5967('0x32')]);_0x4fe863['filters']=_[_0x5967('0x35')](_0x4fe863[_0x5967('0x31')],_0x4fe863['query']);_0x816be5[_0x5967('0x37')]=_[_0x5967('0x35')](_0x4fe863[_0x5967('0x31')],qs[_0x5967('0x36')](_0x4b4742[_0x5967('0x32')][_0x5967('0x36')]));_0x816be5['attributes']=_0x816be5[_0x5967('0x37')][_0x5967('0x43')]?_0x816be5['attributes']:_0x4fe863[_0x5967('0x31')];if(_0x4b4742['query'][_0x5967('0x44')]){_0x816be5[_0x5967('0x45')]=[{'all':!![]}];}_0x816be5=_[_0x5967('0x3d')]({},_0x816be5,_0x4b4742[_0x5967('0x3e')]);return db[_0x5967('0x2d')][_0x5967('0x46')](_0x816be5)[_0x5967('0x26')](handleEntityNotFound(_0x3176bf,null))['then'](respondWithResult(_0x3176bf,null))['catch'](handleError(_0x3176bf,null));};exports[_0x5967('0x24')]=function(_0x3eb952,_0x5a2caa){if(_0x3eb952[_0x5967('0x47')]['id']){delete _0x3eb952[_0x5967('0x47')]['id'];}return db['VoiceMusicOnHold'][_0x5967('0x46')]({'where':{'id':_0x3eb952[_0x5967('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a2caa,null))['then'](saveUpdates(_0x3eb952[_0x5967('0x47')],null))[_0x5967('0x26')](respondWithResult(_0x5a2caa,null))['catch'](handleError(_0x5a2caa,null));};exports[_0x5967('0x49')]=function(_0x106da3,_0x4327d3,_0x52ab6b){return db[_0x5967('0x4a')][_0x5967('0x4b')](function(_0x207864){if(_0x106da3[_0x5967('0x47')][_0x5967('0x4c')]===_0x5967('0x4d')){_0x106da3[_0x5967('0x47')][_0x5967('0x4e')]=path[_0x5967('0x4f')](config[_0x5967('0x50')],_0x5967('0x51'),_0x106da3[_0x5967('0x47')][_0x5967('0x2c')]);}return db[_0x5967('0x2d')][_0x5967('0x49')](_0x106da3[_0x5967('0x47')],{'transaction':_0x207864})[_0x5967('0x26')](function(_0x58d55b){if(_0x106da3[_0x5967('0x47')][_0x5967('0x4c')]==='files'){fs[_0x5967('0x52')](_0x58d55b[_0x5967('0x4e')],parseInt('0777',0x8));}var _0x463bbd=_0x106da3[_0x5967('0x53')][_0x5967('0x27')]({'plain':!![]});if(!_0x463bbd)throw new Error(_0x5967('0x54'));if(_0x463bbd[_0x5967('0x55')]===_0x5967('0x53')){var _0x1c0018=_0x58d55b[_0x5967('0x27')]({'plain':!![]});return db[_0x5967('0x56')][_0x5967('0x46')]({'where':{'name':_0x5967('0x28'),'userProfileId':_0x463bbd[_0x5967('0x57')]},'raw':!![]})[_0x5967('0x26')](function(_0x1a7300){if(_0x1a7300&&_0x1a7300[_0x5967('0x58')]===0x0){return db[_0x5967('0x29')][_0x5967('0x49')]({'name':_0x1c0018[_0x5967('0x2c')],'resourceId':_0x1c0018['id'],'type':_0x1a7300[_0x5967('0x2c')],'sectionId':_0x1a7300['id']},{})[_0x5967('0x26')](function(){return _0x58d55b;});}else{return _0x58d55b;}})[_0x5967('0x41')](function(_0x10d37a){logger['error'](_0x5967('0x59'),_0x10d37a);});}return _0x58d55b;});})[_0x5967('0x26')](respondWithResult(_0x4327d3,0xc9))[_0x5967('0x41')](handleError(_0x4327d3,null));};exports[_0x5967('0x25')]=function(_0x3dcd09,_0x2532e5,_0x3ecbae){var _0x4d5558;return db[_0x5967('0x2d')][_0x5967('0x46')]({'where':{'id':_0x3dcd09[_0x5967('0x48')]['id']}})[_0x5967('0x26')](function(_0x4c5085){if(_0x4c5085){return db[_0x5967('0x4a')][_0x5967('0x4b')](function(_0x2671b7){return _0x4c5085[_0x5967('0x25')]({'transaction':_0x2671b7,'raw':!![]})[_0x5967('0x26')](function(_0x23bf94){if(_0x23bf94[_0x5967('0x4e')]){fs[_0x5967('0x5a')](_0x23bf94['directory'])[_0x5967('0x5b')](function(_0x15e2fb){fs['unlinkSync'](path[_0x5967('0x4f')](_0x23bf94['directory'],_0x15e2fb));});fs[_0x5967('0x5c')](_0x23bf94[_0x5967('0x4e')]);}return _0x23bf94;});})[_0x5967('0x41')](function(_0x49fa71){throw new db[(_0x5967('0x5d'))][(_0x5967('0x5e'))](_0x49fa71[_0x5967('0x5f')]);});}})['then'](handleEntityNotFound(_0x2532e5,null))[_0x5967('0x26')](removeEntity(_0x2532e5,null))[_0x5967('0x41')](handleError(_0x2532e5,null));};exports[_0x5967('0x60')]=function(_0x4a8de9,_0x34e241,_0xb82532){return db[_0x5967('0x4a')][_0x5967('0x4b')](function(_0x53d273){var _0x39d93b;return db['VoiceMusicOnHold'][_0x5967('0x46')]({'where':{'id':_0x4a8de9['params']['id']}})[_0x5967('0x26')](function(_0x229ba8){if(_0x229ba8){_0x39d93b=_0x229ba8;return _0x229ba8[_0x5967('0x60')](_0x4a8de9['body']['id'],{'transaction':_0x53d273});}})[_0x5967('0x26')](function(_0x32a5a9){if(_0x32a5a9){return db[_0x5967('0x61')][_0x5967('0x62')]({'where':{'id':_0x4a8de9[_0x5967('0x47')]['id']},'attributes':['id','name',_0x5967('0x63'),_0x5967('0x64'),_0x5967('0x65')],'raw':!![]});}})[_0x5967('0x26')](function(_0x4a1a85){if(_0x4a1a85){var _0x2d8286=path[_0x5967('0x4f')](config[_0x5967('0x50')],_0x5967('0x66'),util['format'](_0x5967('0x67'),path['basename'](_0x4a1a85[_0x5967('0x63')],path[_0x5967('0x68')](_0x4a1a85[_0x5967('0x63')])),_0x4a1a85[_0x5967('0x64')]));var _0x2e5a8e=path[_0x5967('0x4f')](config[_0x5967('0x50')],'server/files/moh',_0x39d93b[_0x5967('0x2c')],util[_0x5967('0x69')](_0x5967('0x67'),_0x4a1a85[_0x5967('0x2c')],_0x4a1a85['converted_format']));fs[_0x5967('0x6a')](_0x2d8286,_0x2e5a8e);return _0x4a1a85;}})[_0x5967('0x41')](function(_0x4f9c18){throw new db[(_0x5967('0x5d'))][(_0x5967('0x5e'))](_0x4f9c18[_0x5967('0x5f')]);});})['then'](handleEntityNotFound(_0x34e241,null))[_0x5967('0x26')](respondWithResult(_0x34e241,0xc9))[_0x5967('0x41')](handleError(_0x34e241,null));};exports[_0x5967('0x6b')]=function(_0x3cf1bb,_0x26b955,_0x2e3269){return db[_0x5967('0x4a')][_0x5967('0x4b')](function(_0x2b1f85){var _0x5a3156;return db[_0x5967('0x2d')][_0x5967('0x62')]({'where':{'id':_0x3cf1bb[_0x5967('0x48')]['id']}})[_0x5967('0x26')](handleEntityNotFound(_0x26b955,null))['then'](function(_0x5067af){if(_0x5067af){_0x5a3156=_0x5067af;return _0x5067af['removeSound'](_0x3cf1bb['params'][_0x5967('0x6c')]);}})[_0x5967('0x26')](function(_0x558cf2){if(_0x558cf2){return db[_0x5967('0x61')][_0x5967('0x62')]({'where':{'id':_0x3cf1bb[_0x5967('0x48')][_0x5967('0x6c')]},'attributes':['id','name',_0x5967('0x63'),_0x5967('0x64'),'createdAt'],'raw':!![]});}})[_0x5967('0x26')](function(_0x3ebb5a){if(_0x3ebb5a){fs['unlinkSync'](path[_0x5967('0x4f')](_0x5a3156['directory'],util[_0x5967('0x69')](_0x5967('0x67'),_0x3ebb5a['name'],_0x3ebb5a[_0x5967('0x64')])));return _0x3ebb5a;}})['catch'](function(_0xf14031){throw new db[(_0x5967('0x5d'))]['ValidationError'](_0xf14031[_0x5967('0x5f')]);});})[_0x5967('0x26')](handleEntityNotFound(_0x26b955,null))[_0x5967('0x26')](respondWithStatusCode(_0x26b955,0xcc))[_0x5967('0x41')](handleError(_0x26b955,null));};exports['getSounds']=function(_0x3f8caa,_0x5d295d,_0x27c080){var _0x53f8cd={};var _0xdf1551={};var _0x33de01;var _0x89e51b;return db['VoiceMusicOnHold'][_0x5967('0x62')]({'where':{'id':_0x3f8caa[_0x5967('0x48')]['id']}})[_0x5967('0x26')](handleEntityNotFound(_0x5d295d,null))[_0x5967('0x26')](function(_0x3b57fb){if(_0x3b57fb){_0x33de01=_0x3b57fb;_0xdf1551[_0x5967('0x31')]=_[_0x5967('0x33')](db[_0x5967('0x61')][_0x5967('0x2e')]);_0xdf1551[_0x5967('0x32')]=_[_0x5967('0x33')](_0x3f8caa[_0x5967('0x32')]);_0xdf1551[_0x5967('0x34')]=_[_0x5967('0x35')](_0xdf1551[_0x5967('0x31')],_0xdf1551[_0x5967('0x32')]);_0x53f8cd[_0x5967('0x37')]=_[_0x5967('0x35')](_0xdf1551[_0x5967('0x31')],qs[_0x5967('0x36')](_0x3f8caa['query'][_0x5967('0x36')]));_0x53f8cd[_0x5967('0x37')]=_0x53f8cd[_0x5967('0x37')][_0x5967('0x43')]?_0x53f8cd[_0x5967('0x37')]:_0xdf1551[_0x5967('0x31')];_0x53f8cd[_0x5967('0x6d')]=qs[_0x5967('0x39')](_0x3f8caa[_0x5967('0x32')][_0x5967('0x39')]);_0x53f8cd[_0x5967('0x3a')]=qs[_0x5967('0x34')](_[_0x5967('0x3b')](_0x3f8caa[_0x5967('0x32')],_0xdf1551[_0x5967('0x34')]));if(_0x3f8caa[_0x5967('0x32')][_0x5967('0x3c')]){_0x53f8cd['where']=_[_0x5967('0x3d')](_0x53f8cd['where'],{'$or':_[_0x5967('0x6e')](_0x53f8cd[_0x5967('0x37')],function(_0x27fdde){var _0x5f4edd={};_0x5f4edd[_0x27fdde]={'$like':'%'+_0x3f8caa[_0x5967('0x32')][_0x5967('0x3c')]+'%'};return _0x5f4edd;})});}_0x53f8cd=_[_0x5967('0x3d')]({},_0x53f8cd,_0x3f8caa['options']);return _0x33de01[_0x5967('0x6f')](_0x53f8cd);}})[_0x5967('0x26')](function(_0x3cfdb3){if(_0x3cfdb3){_0x89e51b=_0x3cfdb3[_0x5967('0x43')];if(!_0x3f8caa[_0x5967('0x32')][_0x5967('0x70')](_0x5967('0x38'))){_0x53f8cd[_0x5967('0x1d')]=qs['limit'](_0x3f8caa[_0x5967('0x32')][_0x5967('0x1d')]);_0x53f8cd[_0x5967('0x1c')]=qs[_0x5967('0x1c')](_0x3f8caa[_0x5967('0x32')][_0x5967('0x1c')]);}return _0x33de01[_0x5967('0x6f')](_0x53f8cd);}})[_0x5967('0x26')](function(_0x4b9623){if(_0x4b9623){return _0x4b9623?{'count':_0x89e51b,'rows':_0x4b9623}:null;}})[_0x5967('0x26')](respondWithResult(_0x5d295d,null))[_0x5967('0x41')](handleError(_0x5d295d,null));}; \ No newline at end of file +var _0xb7d8=['UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','catch','body','VoiceMusicOnHold','transaction','mode','directory','root','server/files/moh','create','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','unlinkSync','join','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','getSounds','length','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','MusicOnHolds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7d8,0xb8));var _0x8b7d=function(_0x5622b2,_0x530d41){_0x5622b2=_0x5622b2-0x0;var _0x53f226=_0xb7d8[_0x5622b2];return _0x53f226;};'use strict';var emlformat=require(_0x8b7d('0x0'));var rimraf=require(_0x8b7d('0x1'));var zipdir=require(_0x8b7d('0x2'));var jsonpatch=require(_0x8b7d('0x3'));var rp=require('request-promise');var moment=require(_0x8b7d('0x4'));var BPromise=require(_0x8b7d('0x5'));var Mustache=require(_0x8b7d('0x6'));var util=require(_0x8b7d('0x7'));var path=require('path');var sox=require(_0x8b7d('0x8'));var csv=require('to-csv');var ejs=require(_0x8b7d('0x9'));var fs=require('fs');var fs_extra=require(_0x8b7d('0xa'));var _=require(_0x8b7d('0xb'));var squel=require(_0x8b7d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b7d('0xd'));var deskjs=require(_0x8b7d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b7d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8b7d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b7d('0x11'));var logger=require(_0x8b7d('0x12'))(_0x8b7d('0x13'));var utils=require('../../config/utils');var config=require(_0x8b7d('0x14'));var licenseUtil=require(_0x8b7d('0x15'));var db=require(_0x8b7d('0x16'))['db'];function respondWithStatusCode(_0x8a2f1,_0x2b6b1a){_0x2b6b1a=_0x2b6b1a||0xcc;return function(_0x2e4739){if(_0x2e4739){return _0x8a2f1[_0x8b7d('0x17')](_0x2b6b1a);}return _0x8a2f1[_0x8b7d('0x18')](_0x2b6b1a)['end']();};}function respondWithResult(_0x128e0b,_0x31d4b3){_0x31d4b3=_0x31d4b3||0xc8;return function(_0x492ffb){if(_0x492ffb){return _0x128e0b[_0x8b7d('0x18')](_0x31d4b3)[_0x8b7d('0x19')](_0x492ffb);}};}function respondWithFilteredResult(_0x470bfc,_0x34e4c6){return function(_0x22de8f){if(_0x22de8f){var _0x5c5a50=typeof _0x34e4c6[_0x8b7d('0x1a')]===_0x8b7d('0x1b')&&typeof _0x34e4c6[_0x8b7d('0x1c')]===_0x8b7d('0x1b');var _0x169f3c=_0x22de8f['count'];var _0x46403d=_0x5c5a50?0x0:_0x34e4c6[_0x8b7d('0x1a')];var _0x5a78c0=_0x5c5a50?_0x22de8f[_0x8b7d('0x1d')]:_0x34e4c6[_0x8b7d('0x1a')]+_0x34e4c6[_0x8b7d('0x1c')];var _0x478884;if(_0x5a78c0>=_0x169f3c){_0x5a78c0=_0x169f3c;_0x478884=0xc8;}else{_0x478884=0xce;}_0x470bfc[_0x8b7d('0x18')](_0x478884);return _0x470bfc[_0x8b7d('0x1e')](_0x8b7d('0x1f'),_0x46403d+'-'+_0x5a78c0+'/'+_0x169f3c)[_0x8b7d('0x19')](_0x22de8f);}return null;};}function patchUpdates(_0x360bc2){return function(_0x4fc54a){try{jsonpatch['apply'](_0x4fc54a,_0x360bc2,!![]);}catch(_0x28b0bb){return BPromise[_0x8b7d('0x20')](_0x28b0bb);}return _0x4fc54a[_0x8b7d('0x21')]();};}function saveUpdates(_0x52f599,_0x5882ff){return function(_0x72c374){if(_0x72c374){return _0x72c374[_0x8b7d('0x22')](_0x52f599)[_0x8b7d('0x23')](function(_0x32f0f1){return _0x32f0f1;});}return null;};}function removeEntity(_0x106052,_0x5a25c1){return function(_0x50bf35){if(_0x50bf35){return _0x50bf35[_0x8b7d('0x24')]()[_0x8b7d('0x23')](function(){var _0x45aac9=_0x50bf35['get']({'plain':!![]});var _0xe67110=_0x8b7d('0x25');return db[_0x8b7d('0x26')][_0x8b7d('0x24')]({'where':{'type':_0xe67110,'resourceId':_0x45aac9['id']}})[_0x8b7d('0x23')](function(){return _0x50bf35;});})[_0x8b7d('0x23')](function(){_0x106052[_0x8b7d('0x18')](0xcc)[_0x8b7d('0x27')]();});}};}function handleEntityNotFound(_0x24d4d2,_0x4fc767){return function(_0x1c5385){if(!_0x1c5385){_0x24d4d2['sendStatus'](0x194);}return _0x1c5385;};}function handleError(_0x4d90ed,_0x12d946){_0x12d946=_0x12d946||0x1f4;return function(_0x13151c){logger[_0x8b7d('0x28')](_0x13151c[_0x8b7d('0x29')]);if(_0x13151c['name']){delete _0x13151c[_0x8b7d('0x2a')];}_0x4d90ed[_0x8b7d('0x18')](_0x12d946)['send'](_0x13151c);};}exports[_0x8b7d('0x2b')]=function(_0x130db2,_0x284560){var _0x61951a={},_0x438783={},_0x478615={'count':0x0,'rows':[]};var _0x1d7dbd=_[_0x8b7d('0x2c')](db['VoiceMusicOnHold'][_0x8b7d('0x2d')],function(_0x2bfaa8){return{'name':_0x2bfaa8[_0x8b7d('0x2e')],'type':_0x2bfaa8[_0x8b7d('0x2f')][_0x8b7d('0x30')]};});_0x438783[_0x8b7d('0x31')]=_[_0x8b7d('0x2c')](_0x1d7dbd,'name');_0x438783['query']=_[_0x8b7d('0x32')](_0x130db2['query']);_0x438783[_0x8b7d('0x33')]=_[_0x8b7d('0x34')](_0x438783['model'],_0x438783[_0x8b7d('0x35')]);_0x61951a['attributes']=_[_0x8b7d('0x34')](_0x438783[_0x8b7d('0x31')],qs[_0x8b7d('0x36')](_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x36')]));_0x61951a['attributes']=_0x61951a[_0x8b7d('0x37')]['length']?_0x61951a['attributes']:_0x438783[_0x8b7d('0x31')];if(!_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x38')](_0x8b7d('0x39'))){_0x61951a['limit']=qs['limit'](_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x1c')]);_0x61951a[_0x8b7d('0x1a')]=qs[_0x8b7d('0x1a')](_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x1a')]);}_0x61951a[_0x8b7d('0x3a')]=qs[_0x8b7d('0x3b')](_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x3b')]);delete _0x130db2[_0x8b7d('0x35')][_0x8b7d('0x3b')];_0x61951a[_0x8b7d('0x3c')]=qs[_0x8b7d('0x33')](_[_0x8b7d('0x3d')](_0x130db2[_0x8b7d('0x35')],_0x438783[_0x8b7d('0x33')]),_0x1d7dbd);if(_0x130db2[_0x8b7d('0x35')]['filter']){_0x61951a[_0x8b7d('0x3c')]=_[_0x8b7d('0x3e')](_0x61951a[_0x8b7d('0x3c')],{'$or':_['map'](_0x1d7dbd,function(_0x1b600d){if(_0x1b600d[_0x8b7d('0x2f')]!==_0x8b7d('0x3f')){var _0x4daeea={};_0x4daeea[_0x1b600d[_0x8b7d('0x2a')]]={'$like':'%'+_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x40')]+'%'};return _0x4daeea;}})});}_0x61951a=_[_0x8b7d('0x3e')]({},_0x61951a,_0x130db2[_0x8b7d('0x41')]);var _0x34edd3={'where':_0x61951a[_0x8b7d('0x3c')]};return db['VoiceMusicOnHold'][_0x8b7d('0x1d')](_0x34edd3)[_0x8b7d('0x23')](function(_0x3bfaba){_0x478615['count']=_0x3bfaba;if(_0x130db2[_0x8b7d('0x35')][_0x8b7d('0x42')]){_0x61951a[_0x8b7d('0x43')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x61951a);})['then'](function(_0x361d1a){_0x478615[_0x8b7d('0x44')]=_0x361d1a;return _0x478615;})['then'](respondWithFilteredResult(_0x284560,_0x61951a))['catch'](handleError(_0x284560,null));};exports['show']=function(_0x51b7a1,_0x5a3569){var _0x901209={'raw':![],'where':{'id':_0x51b7a1[_0x8b7d('0x45')]['id']}},_0x3b2577={};_0x3b2577[_0x8b7d('0x31')]=_[_0x8b7d('0x32')](db['VoiceMusicOnHold']['rawAttributes']);_0x3b2577[_0x8b7d('0x35')]=_[_0x8b7d('0x32')](_0x51b7a1[_0x8b7d('0x35')]);_0x3b2577[_0x8b7d('0x33')]=_['intersection'](_0x3b2577['model'],_0x3b2577[_0x8b7d('0x35')]);_0x901209[_0x8b7d('0x37')]=_[_0x8b7d('0x34')](_0x3b2577[_0x8b7d('0x31')],qs[_0x8b7d('0x36')](_0x51b7a1[_0x8b7d('0x35')][_0x8b7d('0x36')]));_0x901209['attributes']=_0x901209[_0x8b7d('0x37')]['length']?_0x901209[_0x8b7d('0x37')]:_0x3b2577[_0x8b7d('0x31')];if(_0x51b7a1[_0x8b7d('0x35')][_0x8b7d('0x42')]){_0x901209['include']=[{'all':!![]}];}_0x901209=_['merge']({},_0x901209,_0x51b7a1['options']);return db['VoiceMusicOnHold']['find'](_0x901209)[_0x8b7d('0x23')](handleEntityNotFound(_0x5a3569,null))[_0x8b7d('0x23')](respondWithResult(_0x5a3569,null))[_0x8b7d('0x46')](handleError(_0x5a3569,null));};exports['update']=function(_0x16274f,_0x36bc6c){if(_0x16274f[_0x8b7d('0x47')]['id']){delete _0x16274f[_0x8b7d('0x47')]['id'];}return db[_0x8b7d('0x48')]['find']({'where':{'id':_0x16274f[_0x8b7d('0x45')]['id']}})[_0x8b7d('0x23')](handleEntityNotFound(_0x36bc6c,null))[_0x8b7d('0x23')](saveUpdates(_0x16274f[_0x8b7d('0x47')],null))[_0x8b7d('0x23')](respondWithResult(_0x36bc6c,null))[_0x8b7d('0x46')](handleError(_0x36bc6c,null));};exports['create']=function(_0x5ebae6,_0x50a829,_0x43f836){return db['sequelize'][_0x8b7d('0x49')](function(_0xb560c7){if(_0x5ebae6[_0x8b7d('0x47')][_0x8b7d('0x4a')]==='files'){_0x5ebae6['body'][_0x8b7d('0x4b')]=path['join'](config[_0x8b7d('0x4c')],_0x8b7d('0x4d'),_0x5ebae6[_0x8b7d('0x47')][_0x8b7d('0x2a')]);}return db['VoiceMusicOnHold'][_0x8b7d('0x4e')](_0x5ebae6[_0x8b7d('0x47')],{'transaction':_0xb560c7})[_0x8b7d('0x23')](function(_0x1c24bc){if(_0x5ebae6[_0x8b7d('0x47')][_0x8b7d('0x4a')]==='files'){fs[_0x8b7d('0x4f')](_0x1c24bc[_0x8b7d('0x4b')],parseInt(_0x8b7d('0x50'),0x8));}var _0x3e328b=_0x5ebae6[_0x8b7d('0x51')][_0x8b7d('0x52')]({'plain':!![]});if(!_0x3e328b)throw new Error(_0x8b7d('0x53'));if(_0x3e328b[_0x8b7d('0x54')]===_0x8b7d('0x51')){var _0x191f26=_0x1c24bc['get']({'plain':!![]});return db[_0x8b7d('0x55')][_0x8b7d('0x56')]({'where':{'name':_0x8b7d('0x25'),'userProfileId':_0x3e328b[_0x8b7d('0x57')]},'raw':!![]})[_0x8b7d('0x23')](function(_0x4dc8d1){if(_0x4dc8d1&&_0x4dc8d1[_0x8b7d('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x191f26['name'],'resourceId':_0x191f26['id'],'type':_0x4dc8d1[_0x8b7d('0x2a')],'sectionId':_0x4dc8d1['id']},{})[_0x8b7d('0x23')](function(){return _0x1c24bc;});}else{return _0x1c24bc;}})[_0x8b7d('0x46')](function(_0x4a5237){logger[_0x8b7d('0x28')](_0x8b7d('0x59'),_0x4a5237);});}return _0x1c24bc;});})[_0x8b7d('0x23')](respondWithResult(_0x50a829,0xc9))[_0x8b7d('0x46')](handleError(_0x50a829,null));};exports['destroy']=function(_0x2a2150,_0x5a0dff,_0x3a19ab){var _0x3db303;return db[_0x8b7d('0x48')][_0x8b7d('0x56')]({'where':{'id':_0x2a2150[_0x8b7d('0x45')]['id']}})[_0x8b7d('0x23')](function(_0x502848){if(_0x502848){return db[_0x8b7d('0x5a')][_0x8b7d('0x49')](function(_0x46815a){return _0x502848[_0x8b7d('0x24')]({'transaction':_0x46815a,'raw':!![]})[_0x8b7d('0x23')](function(_0x1816d9){if(_0x1816d9[_0x8b7d('0x4b')]){fs['readdirSync'](_0x1816d9['directory'])['forEach'](function(_0x2a3baf){fs[_0x8b7d('0x5b')](path[_0x8b7d('0x5c')](_0x1816d9[_0x8b7d('0x4b')],_0x2a3baf));});fs['rmdirSync'](_0x1816d9['directory']);}return _0x1816d9;});})[_0x8b7d('0x46')](function(_0x230c79){throw new db[(_0x8b7d('0x5d'))][(_0x8b7d('0x5e'))](_0x230c79[_0x8b7d('0x5f')]);});}})['then'](handleEntityNotFound(_0x5a0dff,null))['then'](removeEntity(_0x5a0dff,null))[_0x8b7d('0x46')](handleError(_0x5a0dff,null));};exports[_0x8b7d('0x60')]=function(_0x2f525f,_0x18da55,_0x58b464){return db[_0x8b7d('0x5a')]['transaction'](function(_0x55e70e){var _0x580887;return db[_0x8b7d('0x48')][_0x8b7d('0x56')]({'where':{'id':_0x2f525f['params']['id']}})[_0x8b7d('0x23')](function(_0x3a24be){if(_0x3a24be){_0x580887=_0x3a24be;return _0x3a24be['addSound'](_0x2f525f[_0x8b7d('0x47')]['id'],{'transaction':_0x55e70e});}})[_0x8b7d('0x23')](function(_0x3e452f){if(_0x3e452f){return db[_0x8b7d('0x61')][_0x8b7d('0x62')]({'where':{'id':_0x2f525f[_0x8b7d('0x47')]['id']},'attributes':['id','name',_0x8b7d('0x63'),'converted_format',_0x8b7d('0x64')],'raw':!![]});}})[_0x8b7d('0x23')](function(_0x23b442){if(_0x23b442){var _0x34d736=path[_0x8b7d('0x5c')](config[_0x8b7d('0x4c')],'server/files/sounds/converted',util[_0x8b7d('0x65')](_0x8b7d('0x66'),path[_0x8b7d('0x67')](_0x23b442['save_name'],path[_0x8b7d('0x68')](_0x23b442[_0x8b7d('0x63')])),_0x23b442[_0x8b7d('0x69')]));var _0x27ee49=path[_0x8b7d('0x5c')](config['root'],_0x8b7d('0x4d'),_0x580887[_0x8b7d('0x2a')],util['format'](_0x8b7d('0x66'),_0x23b442[_0x8b7d('0x2a')],_0x23b442['converted_format']));fs[_0x8b7d('0x6a')](_0x34d736,_0x27ee49);return _0x23b442;}})[_0x8b7d('0x46')](function(_0x4f7e9d){throw new db[(_0x8b7d('0x5d'))][(_0x8b7d('0x5e'))](_0x4f7e9d[_0x8b7d('0x5f')]);});})[_0x8b7d('0x23')](handleEntityNotFound(_0x18da55,null))[_0x8b7d('0x23')](respondWithResult(_0x18da55,0xc9))[_0x8b7d('0x46')](handleError(_0x18da55,null));};exports[_0x8b7d('0x6b')]=function(_0x1e7bd4,_0x237608,_0x28239f){return db[_0x8b7d('0x5a')]['transaction'](function(_0x7ae085){var _0x21fc28;return db[_0x8b7d('0x48')]['findOne']({'where':{'id':_0x1e7bd4[_0x8b7d('0x45')]['id']}})['then'](handleEntityNotFound(_0x237608,null))[_0x8b7d('0x23')](function(_0x4f1adc){if(_0x4f1adc){_0x21fc28=_0x4f1adc;return _0x4f1adc[_0x8b7d('0x6b')](_0x1e7bd4[_0x8b7d('0x45')][_0x8b7d('0x6c')]);}})['then'](function(_0x3500bf){if(_0x3500bf){return db['Sound'][_0x8b7d('0x62')]({'where':{'id':_0x1e7bd4[_0x8b7d('0x45')][_0x8b7d('0x6c')]},'attributes':['id',_0x8b7d('0x2a'),_0x8b7d('0x63'),_0x8b7d('0x69'),_0x8b7d('0x64')],'raw':!![]});}})[_0x8b7d('0x23')](function(_0x55f716){if(_0x55f716){fs[_0x8b7d('0x5b')](path[_0x8b7d('0x5c')](_0x21fc28[_0x8b7d('0x4b')],util['format'](_0x8b7d('0x66'),_0x55f716['name'],_0x55f716['converted_format'])));return _0x55f716;}})[_0x8b7d('0x46')](function(_0x13a0c0){throw new db[(_0x8b7d('0x5d'))][(_0x8b7d('0x5e'))](_0x13a0c0[_0x8b7d('0x5f')]);});})[_0x8b7d('0x23')](handleEntityNotFound(_0x237608,null))[_0x8b7d('0x23')](respondWithStatusCode(_0x237608,0xcc))[_0x8b7d('0x46')](handleError(_0x237608,null));};exports[_0x8b7d('0x6d')]=function(_0x55b41a,_0x277f0,_0x3c9515){var _0x13a1ef={};var _0x21bdaf={};var _0x3752f3;var _0x43fcb6;return db[_0x8b7d('0x48')][_0x8b7d('0x62')]({'where':{'id':_0x55b41a[_0x8b7d('0x45')]['id']}})[_0x8b7d('0x23')](handleEntityNotFound(_0x277f0,null))[_0x8b7d('0x23')](function(_0x47480b){if(_0x47480b){_0x3752f3=_0x47480b;_0x21bdaf[_0x8b7d('0x31')]=_[_0x8b7d('0x32')](db[_0x8b7d('0x61')][_0x8b7d('0x2d')]);_0x21bdaf[_0x8b7d('0x35')]=_[_0x8b7d('0x32')](_0x55b41a[_0x8b7d('0x35')]);_0x21bdaf[_0x8b7d('0x33')]=_[_0x8b7d('0x34')](_0x21bdaf[_0x8b7d('0x31')],_0x21bdaf[_0x8b7d('0x35')]);_0x13a1ef[_0x8b7d('0x37')]=_[_0x8b7d('0x34')](_0x21bdaf[_0x8b7d('0x31')],qs['fields'](_0x55b41a[_0x8b7d('0x35')][_0x8b7d('0x36')]));_0x13a1ef[_0x8b7d('0x37')]=_0x13a1ef[_0x8b7d('0x37')][_0x8b7d('0x6e')]?_0x13a1ef[_0x8b7d('0x37')]:_0x21bdaf[_0x8b7d('0x31')];_0x13a1ef['order']=qs[_0x8b7d('0x3b')](_0x55b41a['query'][_0x8b7d('0x3b')]);_0x13a1ef[_0x8b7d('0x3c')]=qs[_0x8b7d('0x33')](_[_0x8b7d('0x3d')](_0x55b41a[_0x8b7d('0x35')],_0x21bdaf[_0x8b7d('0x33')]));if(_0x55b41a[_0x8b7d('0x35')][_0x8b7d('0x40')]){_0x13a1ef[_0x8b7d('0x3c')]=_[_0x8b7d('0x3e')](_0x13a1ef[_0x8b7d('0x3c')],{'$or':_[_0x8b7d('0x2c')](_0x13a1ef[_0x8b7d('0x37')],function(_0x16ef71){var _0x3490b2={};_0x3490b2[_0x16ef71]={'$like':'%'+_0x55b41a[_0x8b7d('0x35')][_0x8b7d('0x40')]+'%'};return _0x3490b2;})});}_0x13a1ef=_[_0x8b7d('0x3e')]({},_0x13a1ef,_0x55b41a[_0x8b7d('0x41')]);return _0x3752f3['getSounds'](_0x13a1ef);}})['then'](function(_0xb92c57){if(_0xb92c57){_0x43fcb6=_0xb92c57['length'];if(!_0x55b41a[_0x8b7d('0x35')][_0x8b7d('0x38')](_0x8b7d('0x39'))){_0x13a1ef['limit']=qs[_0x8b7d('0x1c')](_0x55b41a[_0x8b7d('0x35')][_0x8b7d('0x1c')]);_0x13a1ef['offset']=qs[_0x8b7d('0x1a')](_0x55b41a[_0x8b7d('0x35')]['offset']);}return _0x3752f3[_0x8b7d('0x6d')](_0x13a1ef);}})['then'](function(_0x9ce76f){if(_0x9ce76f){return _0x9ce76f?{'count':_0x43fcb6,'rows':_0x9ce76f}:null;}})[_0x8b7d('0x23')](respondWithResult(_0x277f0,null))['catch'](handleError(_0x277f0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 683efca..c2b9225 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 _0x8a4a=['api','moment','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x5ce1bd,_0x44b0f8){var _0x16f7ad=function(_0x21c319){while(--_0x21c319){_0x5ce1bd['push'](_0x5ce1bd['shift']());}};_0x16f7ad(++_0x44b0f8);}(_0x8a4a,0x1b5));var _0xa8a4=function(_0x1840b1,_0x2d021e){_0x1840b1=_0x1840b1-0x0;var _0x54ee73=_0x8a4a[_0x1840b1];return _0x54ee73;};'use strict';var _=require(_0xa8a4('0x0'));var util=require(_0xa8a4('0x1'));var logger=require(_0xa8a4('0x2'))(_0xa8a4('0x3'));var moment=require(_0xa8a4('0x4'));var BPromise=require('bluebird');var rp=require(_0xa8a4('0x5'));var fs=require('fs');var path=require(_0xa8a4('0x6'));var rimraf=require(_0xa8a4('0x7'));var config=require('../../config/environment');var attributes=require(_0xa8a4('0x8'));module['exports']=function(_0x4b4d65,_0x3997dc){return _0x4b4d65[_0xa8a4('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xa8a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x3df0bb,_0x118693){var _0x55694e=function(_0x470bd9){while(--_0x470bd9){_0x3df0bb['push'](_0x3df0bb['shift']());}};_0x55694e(++_0x118693);}(_0x6df2,0x1da));var _0x26df=function(_0x3b4349,_0x1b44b2){_0x3b4349=_0x3b4349-0x0;var _0x3f76c0=_0x6df2[_0x3b4349];return _0x3f76c0;};'use strict';var _=require(_0x26df('0x0'));var util=require(_0x26df('0x1'));var logger=require(_0x26df('0x2'))(_0x26df('0x3'));var moment=require(_0x26df('0x4'));var BPromise=require(_0x26df('0x5'));var rp=require(_0x26df('0x6'));var fs=require('fs');var path=require(_0x26df('0x7'));var rimraf=require(_0x26df('0x8'));var config=require(_0x26df('0x9'));var attributes=require(_0x26df('0xa'));module[_0x26df('0xb')]=function(_0x28b46f,_0x3cf16e){return _0x28b46f['define'](_0x26df('0xc'),attributes,{'tableName':_0x26df('0xd'),'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 2a9424c..c5346e2 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x591f1a,_0x6acb2){var _0x619f58=function(_0x50a0c9){while(--_0x50a0c9){_0x591f1a['push'](_0x591f1a['shift']());}};_0x619f58(++_0x6acb2);}(_0x70e0,0x17b));var _0x070e=function(_0x11e701,_0x12ce16){_0x11e701=_0x11e701-0x0;var _0x4bb51f=_0x70e0[_0x11e701];return _0x4bb51f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +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(_0x19233b,_0x2e37ec){var _0x91175d=function(_0x21a24d){while(--_0x21a24d){_0x19233b['push'](_0x19233b['shift']());}};_0x91175d(++_0x2e37ec);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xcb91[_0x3861f7];return _0x50879f;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 80e1ea5..f73e386 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 _0xfbaf=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','/:id/teams','post','create','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xfbaf,0xcb));var _0xffba=function(_0x571b8,_0x26e178){_0x571b8=_0x571b8-0x0;var _0x357aca=_0xfbaf[_0x571b8];return _0x357aca;};'use strict';var multer=require(_0xffba('0x0'));var util=require(_0xffba('0x1'));var path=require('path');var timeout=require(_0xffba('0x2'));var express=require(_0xffba('0x3'));var router=express['Router']();var fs_extra=require(_0xffba('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xffba('0x5'));var config=require(_0xffba('0x6'));var controller=require(_0xffba('0x7'));router[_0xffba('0x8')]('/',auth[_0xffba('0x9')](),controller[_0xffba('0xa')]);router[_0xffba('0x8')](_0xffba('0xb'),auth[_0xffba('0x9')](),controller[_0xffba('0xc')]);router[_0xffba('0x8')](_0xffba('0xd'),auth[_0xffba('0x9')](),controller['show']);router[_0xffba('0x8')](_0xffba('0xe'),auth[_0xffba('0x9')](),controller['getAgents']);router[_0xffba('0x8')](_0xffba('0xf'),auth[_0xffba('0x9')](),controller['getTeams']);router[_0xffba('0x10')]('/',auth[_0xffba('0x9')](),controller[_0xffba('0x11')]);router[_0xffba('0x10')](_0xffba('0xe'),auth['isAuthenticated'](),controller[_0xffba('0x12')]);router[_0xffba('0x10')](_0xffba('0xf'),auth[_0xffba('0x9')](),controller[_0xffba('0x13')]);router[_0xffba('0x14')](_0xffba('0xd'),auth['isAuthenticated'](),controller[_0xffba('0x15')]);router[_0xffba('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xffba('0x16')](_0xffba('0xe'),auth[_0xffba('0x9')](),controller[_0xffba('0x17')]);router[_0xffba('0x16')](_0xffba('0xf'),auth[_0xffba('0x9')](),controller[_0xffba('0x18')]);module[_0xffba('0x19')]=router; \ No newline at end of file +var _0x3c70=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','/:id/users','isAuthenticated','/:id/teams','getTeams','post','addAgents','addTeams','update','delete','destroy','removeAgents','removeTeams','multer','util'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x3c70,0x10c));var _0x03c7=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x3c70[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var path=require(_0x03c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x03c7('0x3'));var router=express[_0x03c7('0x4')]();var fs_extra=require(_0x03c7('0x5'));var auth=require(_0x03c7('0x6'));var interaction=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var controller=require('./voicePrefix.controller');router[_0x03c7('0x9')]('/',auth['isAuthenticated'](),controller[_0x03c7('0xa')]);router[_0x03c7('0x9')](_0x03c7('0xb'),auth['isAuthenticated'](),controller[_0x03c7('0xc')]);router[_0x03c7('0x9')](_0x03c7('0xd'),auth['isAuthenticated'](),controller[_0x03c7('0xe')]);router['get'](_0x03c7('0xf'),auth[_0x03c7('0x10')](),controller['getAgents']);router[_0x03c7('0x9')](_0x03c7('0x11'),auth[_0x03c7('0x10')](),controller[_0x03c7('0x12')]);router[_0x03c7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03c7('0x13')](_0x03c7('0xf'),auth['isAuthenticated'](),controller[_0x03c7('0x14')]);router[_0x03c7('0x13')](_0x03c7('0x11'),auth[_0x03c7('0x10')](),controller[_0x03c7('0x15')]);router['put'](_0x03c7('0xd'),auth['isAuthenticated'](),controller[_0x03c7('0x16')]);router[_0x03c7('0x17')]('/:id',auth[_0x03c7('0x10')](),controller[_0x03c7('0x18')]);router[_0x03c7('0x17')]('/:id/users',auth[_0x03c7('0x10')](),controller[_0x03c7('0x19')]);router[_0x03c7('0x17')](_0x03c7('0x11'),auth[_0x03c7('0x10')](),controller[_0x03c7('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3ef4858..c06dc20 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 _0x9302=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0x9302,0x153));var _0x2930=function(_0x59adec,_0x43b4e7){_0x59adec=_0x59adec-0x0;var _0xb5fada=_0x9302[_0x59adec];return _0xb5fada;};'use strict';var Sequelize=require(_0x2930('0x0'));module[_0x2930('0x1')]={'name':{'type':Sequelize[_0x2930('0x2')],'allowNull':![],'unique':_0x2930('0x3')},'prefix':{'type':Sequelize[_0x2930('0x4')],'get':function(_0x50c54d){return _0x2930('0x5')+this[_0x2930('0x6')](_0x2930('0x3'))+'-';}},'description':{'type':Sequelize[_0x2930('0x2')]},'callerIdAll':{'type':Sequelize[_0x2930('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x2930('0x7')]}}; \ No newline at end of file +var _0xe09e=['exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe09e,0xf6));var _0xee09=function(_0x65553a,_0x405870){_0x65553a=_0x65553a-0x0;var _0x26ea5f=_0xe09e[_0x65553a];return _0x26ea5f;};'use strict';var Sequelize=require('sequelize');module[_0xee09('0x0')]={'name':{'type':Sequelize[_0xee09('0x1')],'allowNull':![],'unique':_0xee09('0x2')},'prefix':{'type':Sequelize[_0xee09('0x3')],'get':function(_0x5ed613){return _0xee09('0x4')+this[_0xee09('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xee09('0x1')]},'callerIdAll':{'type':Sequelize[_0xee09('0x1')]},'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 da7b951..78b8c28 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 _0xe511=['bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','prefix','system-','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','VoicePrefixes','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','query','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','include','findAll','rows','show','params','keys','fields','length','options','catch','destroy','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe511,0x16f));var _0x1e51=function(_0x4b824a,_0x275d05){_0x4b824a=_0x4b824a-0x0;var _0x3779ab=_0xe511[_0x4b824a];return _0x3779ab;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];config[_0x1e51('0x18')]=_['defaults'](config[_0x1e51('0x18')],{'host':_0x1e51('0x19'),'port':0x18eb});var socket=require(_0x1e51('0x1a'))(new Redis(config[_0x1e51('0x18')]));require(_0x1e51('0x1b'))[_0x1e51('0x1c')](socket);function respondWithStatusCode(_0x441c70,_0x467e77){_0x467e77=_0x467e77||0xcc;return function(_0x1cc62a){if(_0x1cc62a){return _0x441c70[_0x1e51('0x1d')](_0x467e77);}return _0x441c70['status'](_0x467e77)[_0x1e51('0x1e')]();};}function respondWithResult(_0x24db4f,_0x4526b4){_0x4526b4=_0x4526b4||0xc8;return function(_0x5857e2){if(_0x5857e2){return _0x24db4f[_0x1e51('0x1f')](_0x4526b4)['json'](_0x5857e2);}};}function respondWithFilteredResult(_0x53d222,_0x1f6f4e){return function(_0x27dcad){if(_0x27dcad){var _0x40ae4c=typeof _0x1f6f4e[_0x1e51('0x20')]===_0x1e51('0x21')&&typeof _0x1f6f4e[_0x1e51('0x22')]==='undefined';var _0x39449b=_0x27dcad['count'];var _0xea581d=_0x40ae4c?0x0:_0x1f6f4e[_0x1e51('0x20')];var _0x309a87=_0x40ae4c?_0x27dcad[_0x1e51('0x23')]:_0x1f6f4e['offset']+_0x1f6f4e['limit'];var _0x4e6a49;if(_0x309a87>=_0x39449b){_0x309a87=_0x39449b;_0x4e6a49=0xc8;}else{_0x4e6a49=0xce;}_0x53d222['status'](_0x4e6a49);return _0x53d222[_0x1e51('0x24')]('Content-Range',_0xea581d+'-'+_0x309a87+'/'+_0x39449b)[_0x1e51('0x25')](_0x27dcad);}return null;};}function patchUpdates(_0x28aacb){return function(_0x415154){try{jsonpatch[_0x1e51('0x26')](_0x415154,_0x28aacb,!![]);}catch(_0x23c85a){return BPromise[_0x1e51('0x27')](_0x23c85a);}return _0x415154[_0x1e51('0x28')]();};}function saveUpdates(_0x461d3d,_0x4bcdd3){return function(_0x4d04c0){if(_0x4d04c0){return _0x4d04c0[_0x1e51('0x29')](_0x461d3d)[_0x1e51('0x2a')](function(_0x2e42b1){return _0x2e42b1;});}return null;};}function removeEntity(_0x1386db,_0x505d79){return function(_0x54d031){if(_0x54d031){return _0x54d031['destroy']()[_0x1e51('0x2a')](function(){var _0x2a1561=_0x54d031[_0x1e51('0x2b')]({'plain':!![]});var _0x5412bc=_0x1e51('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5412bc,'resourceId':_0x2a1561['id']}})[_0x1e51('0x2a')](function(){return _0x54d031;});})['then'](function(){_0x1386db[_0x1e51('0x1f')](0xcc)[_0x1e51('0x1e')]();});}};}function handleEntityNotFound(_0x56722f,_0x3e6ef2){return function(_0x10ee23){if(!_0x10ee23){_0x56722f[_0x1e51('0x1d')](0x194);}return _0x10ee23;};}function handleError(_0x6862d1,_0x52538c){_0x52538c=_0x52538c||0x1f4;return function(_0x4cf046){logger['error'](_0x4cf046[_0x1e51('0x2d')]);if(_0x4cf046[_0x1e51('0x2e')]){delete _0x4cf046[_0x1e51('0x2e')];}_0x6862d1[_0x1e51('0x1f')](_0x52538c)[_0x1e51('0x2f')](_0x4cf046);};}exports[_0x1e51('0x30')]=function(_0x378206,_0x34701c){var _0x31b678={},_0x3167b6={},_0x27b550={'count':0x0,'rows':[]};var _0x54c84e=_[_0x1e51('0x31')](db[_0x1e51('0x32')][_0x1e51('0x33')],function(_0x12da89){return{'name':_0x12da89[_0x1e51('0x34')],'type':_0x12da89['type'][_0x1e51('0x35')]};});_0x3167b6['model']=_[_0x1e51('0x31')](_0x54c84e,_0x1e51('0x2e'));_0x3167b6[_0x1e51('0x36')]=_['keys'](_0x378206[_0x1e51('0x36')]);_0x3167b6['filters']=_[_0x1e51('0x37')](_0x3167b6['model'],_0x3167b6['query']);_0x31b678[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x3167b6[_0x1e51('0x39')],qs['fields'](_0x378206[_0x1e51('0x36')]['fields']));_0x31b678[_0x1e51('0x38')]=_0x31b678[_0x1e51('0x38')]['length']?_0x31b678[_0x1e51('0x38')]:_0x3167b6[_0x1e51('0x39')];if(!_0x378206[_0x1e51('0x36')][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x31b678[_0x1e51('0x22')]=qs['limit'](_0x378206['query'][_0x1e51('0x22')]);_0x31b678['offset']=qs[_0x1e51('0x20')](_0x378206[_0x1e51('0x36')][_0x1e51('0x20')]);}_0x31b678[_0x1e51('0x3c')]=qs[_0x1e51('0x3d')](_0x378206[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x31b678[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x378206[_0x1e51('0x36')],_0x3167b6['filters']),_0x54c84e);if(_0x378206[_0x1e51('0x36')]['filter']){_0x31b678[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x31b678[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x54c84e,function(_0x33e516){if(_0x33e516[_0x1e51('0x42')]!==_0x1e51('0x43')){var _0x27b3fd={};_0x27b3fd[_0x33e516[_0x1e51('0x2e')]]={'$like':'%'+_0x378206[_0x1e51('0x36')][_0x1e51('0x44')]+'%'};return _0x27b3fd;}})});}_0x31b678=_['merge']({},_0x31b678,_0x378206['options']);var _0x13da51={'where':_0x31b678[_0x1e51('0x3e')]};return db[_0x1e51('0x32')][_0x1e51('0x23')](_0x13da51)[_0x1e51('0x2a')](function(_0x1a9e0d){_0x27b550[_0x1e51('0x23')]=_0x1a9e0d;if(_0x378206[_0x1e51('0x36')]['includeAll']){_0x31b678[_0x1e51('0x45')]=[{'all':!![]}];}return db[_0x1e51('0x32')][_0x1e51('0x46')](_0x31b678);})[_0x1e51('0x2a')](function(_0xfd96a0){_0x27b550[_0x1e51('0x47')]=_0xfd96a0;return _0x27b550;})[_0x1e51('0x2a')](respondWithFilteredResult(_0x34701c,_0x31b678))['catch'](handleError(_0x34701c,null));};exports[_0x1e51('0x48')]=function(_0x232789,_0x51296e){var _0xfd6521={'raw':![],'where':{'id':_0x232789[_0x1e51('0x49')]['id']}},_0x38e4a7={};_0x38e4a7['model']=_[_0x1e51('0x4a')](db[_0x1e51('0x32')][_0x1e51('0x33')]);_0x38e4a7[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x232789[_0x1e51('0x36')]);_0x38e4a7[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x38e4a7[_0x1e51('0x39')],_0x38e4a7['query']);_0xfd6521[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x38e4a7['model'],qs[_0x1e51('0x4b')](_0x232789[_0x1e51('0x36')][_0x1e51('0x4b')]));_0xfd6521['attributes']=_0xfd6521[_0x1e51('0x38')][_0x1e51('0x4c')]?_0xfd6521[_0x1e51('0x38')]:_0x38e4a7['model'];if(_0x232789[_0x1e51('0x36')]['includeAll']){_0xfd6521['include']=[{'all':!![]}];}_0xfd6521=_['merge']({},_0xfd6521,_0x232789[_0x1e51('0x4d')]);return db[_0x1e51('0x32')]['find'](_0xfd6521)['then'](handleEntityNotFound(_0x51296e,null))[_0x1e51('0x2a')](respondWithResult(_0x51296e,null))[_0x1e51('0x4e')](handleError(_0x51296e,null));};exports[_0x1e51('0x4f')]=function(_0x233a5a,_0xf3377b){return db[_0x1e51('0x32')]['find']({'where':{'id':_0x233a5a[_0x1e51('0x49')]['id']}})['then'](handleEntityNotFound(_0xf3377b,null))[_0x1e51('0x2a')](removeEntity(_0xf3377b,null))[_0x1e51('0x4e')](handleError(_0xf3377b,null));};exports['describe']=function(_0x5ea040,_0x479fe6){return db[_0x1e51('0x32')][_0x1e51('0x50')]()[_0x1e51('0x2a')](respondWithResult(_0x479fe6,null))['catch'](handleError(_0x479fe6,null));};exports[_0x1e51('0x51')]=function(_0x1fe669,_0x4226da){var _0x2100d4;return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x32fe1f){return db[_0x1e51('0x32')]['create'](_0x1fe669[_0x1e51('0x54')],{'transaction':_0x32fe1f})[_0x1e51('0x2a')](function(_0xeb77ad){_0x2100d4=_0xeb77ad[_0x1e51('0x2b')]({'plain':!![]});return db[_0x1e51('0x55')][_0x1e51('0x56')]({'where':{'id':_0x2100d4['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x4a2c1b){return createVoicePrefixExtensions(_0x2100d4,_0x4a2c1b,_0x32fe1f);});});})['then'](function(){var _0x4807b9=_0x1fe669[_0x1e51('0x57')][_0x1e51('0x2b')]({'plain':!![]});if(!_0x4807b9)throw new Error(_0x1e51('0x58'));if(_0x4807b9['role']===_0x1e51('0x57')){var _0x133576=_0x2100d4;return db[_0x1e51('0x59')]['find']({'where':{'name':_0x1e51('0x2c'),'userProfileId':_0x4807b9[_0x1e51('0x5a')]},'raw':!![]})[_0x1e51('0x2a')](function(_0x570193){if(_0x570193&&_0x570193[_0x1e51('0x5b')]===0x0){return db[_0x1e51('0x5c')][_0x1e51('0x51')]({'name':_0x133576[_0x1e51('0x2e')],'resourceId':_0x133576['id'],'type':_0x570193[_0x1e51('0x2e')],'sectionId':_0x570193['id']},{})[_0x1e51('0x2a')](function(){return _0x2100d4;});}else{return _0x2100d4;}})[_0x1e51('0x4e')](function(_0x607626){logger['error'](_0x1e51('0x5d'),_0x607626);throw _0x607626;});}return _0x2100d4;})[_0x1e51('0x2a')](respondWithResult(_0x4226da,null))['catch'](handleError(_0x4226da,null));};function Extension(_0x5a9d2a,_0x577b19,_0xa39f42,_0x686433){this[_0x1e51('0x5e')]=_0x1e51('0x5f');this[_0x1e51('0x60')]=_0x5a9d2a;this[_0x1e51('0x61')]=_0xa39f42;this[_0x1e51('0x42')]=_0x1e51('0x62');this[_0x1e51('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x577b19;this['appdata']=_0x686433;}function createVoicePrefixExtensions(_0x1d2daf,_0x4048a4,_0x50c202){return new BPromise(function(_0x4e1fa8,_0x1a7297){var _0x114657=new Extension(formatPrefixName(_0x1d2daf['prefix']),0x1,_0x1e51('0x64'),_0x1e51('0x65'));_0x114657[_0x1e51('0x66')]=_0x1d2daf['id'];return db[_0x1e51('0x55')][_0x1e51('0x51')](_0x114657,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x2199e5){var _0x31eae0=_0x2199e5[_0x1e51('0x2b')]({'plain':!![]});var _0x32863f=_['map'](addVoicePrefixExtensions(_0x1d2daf,_0x4048a4),function(_0x178baf){_0x178baf[_0x1e51('0x67')]=_0x31eae0['id'];_0x178baf[_0x1e51('0x66')]=_0x1d2daf['id'];return _0x178baf;});return db[_0x1e51('0x55')][_0x1e51('0x68')](_0x32863f,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x47cc50){if(!_0x47cc50){return _0x1a7297('Extensions\x20creation\x20failed');}else{return _0x4e1fa8(_0x47cc50);}})[_0x1e51('0x4e')](function(_0x1b0459){return _0x1a7297(_0x1b0459);});});;});};function addVoicePrefixExtensions(_0x19ec72,_0x13fb81){var _0x52a439=[];var _0x4bbe62=formatPrefixName(_0x19ec72['prefix']);_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x2,_0x1e51('0x6a'),_0x1e51('0x6b')+_0x19ec72[_0x1e51('0x2e')]));if(_0x19ec72[_0x1e51('0x6c')]){_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x6a'),_0x1e51('0x6d')+_0x19ec72[_0x1e51('0x6c')]));}else{_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x64'),_0x1e51('0x6e')));}_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x4,'goto',_0x13fb81[_0x1e51('0x5e')]+','+_0x1e51('0x6f')+(0x8+_0x19ec72['name']['length'])+'}'+','+0x1));return _0x52a439;}function formatPrefixName(_0x40d5e8){var _0x4d6d41='_';for(var _0x4464bf=0x0;_0x4464bf<_0x40d5e8['length'];_0x4464bf++){if(_0x40d5e8[_0x1e51('0x70')](_0x4464bf)=='-'){_0x4d6d41+=_0x40d5e8[_0x1e51('0x70')](_0x4464bf);}else{_0x4d6d41+='['+_0x40d5e8[_0x1e51('0x70')](_0x4464bf)+']';}}_0x4d6d41+='.';return _0x4d6d41;}exports[_0x1e51('0x29')]=function(_0x5142ed,_0x37f3e6,_0x4c9871){var _0x5eaa16=_0x5142ed[_0x1e51('0x54')];_0x5eaa16[_0x1e51('0x71')]=_0x1e51('0x72')+_0x5eaa16['name']+'-';return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x15f15b){return db[_0x1e51('0x32')]['update'](_0x5eaa16,{'where':{'id':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension'][_0x1e51('0x56')]({'where':{'id':_0x5eaa16['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x486508){return createVoicePrefixExtensions(_0x5eaa16,_0x486508,_0x15f15b);});});});})[_0x1e51('0x2a')](function(){return db[_0x1e51('0x32')]['findById'](_0x5eaa16['id']);})[_0x1e51('0x2a')](respondWithResult(_0x37f3e6,null))['catch'](handleError(_0x37f3e6,null));};exports[_0x1e51('0x73')]=function(_0x6dc707,_0x1d2753,_0x18ed16){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x6dc707['params']['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x1d2753,null))['then'](function(_0x5556ad){if(_0x5556ad){return _0x5556ad[_0x1e51('0x73')](_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')],_[_0x1e51('0x75')](_0x6dc707[_0x1e51('0x54')],[_0x1e51('0x74'),'id'])||{})[_0x1e51('0x76')](function(_0x51ef46){for(var _0x39dc12=0x0;_0x39dc12<_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')]['length'];_0x39dc12+=0x1){socket['emit'](_0x1e51('0x77'),{'UserId':Number(_0x6dc707[_0x1e51('0x54')]['ids'][_0x39dc12]),'VoicePrefixId':Number(_0x6dc707[_0x1e51('0x49')]['id'])});}return _0x51ef46;});}})[_0x1e51('0x2a')](respondWithResult(_0x1d2753,null))['catch'](handleError(_0x1d2753,null));};exports['removeAgents']=function(_0xe96651,_0x49263c,_0x16793c){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0xe96651[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x49263c,null))['then'](function(_0x4e3460){if(_0x4e3460){return _0x4e3460[_0x1e51('0x78')](_0xe96651[_0x1e51('0x36')]['ids'])[_0x1e51('0x2a')](function(){if(_[_0x1e51('0x79')](_0xe96651['query'][_0x1e51('0x74')])){for(var _0x57ab4a=0x0;_0x57ab4a<_0xe96651[_0x1e51('0x36')]['ids']['length'];_0x57ab4a+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xe96651['query']['ids'][_0x57ab4a]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}}else{socket['emit'](_0x1e51('0x7a'),{'UserId':Number(_0xe96651['query'][_0x1e51('0x74')]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x49263c,null))['catch'](handleError(_0x49263c,null));};exports[_0x1e51('0x7b')]=function(_0x3ed4b1,_0x4a2b44,_0x2efc56){var _0x49517c={};var _0x101bb9={};var _0x5c4452;var _0x2b4b49;return db[_0x1e51('0x32')][_0x1e51('0x7c')]({'where':{'id':_0x3ed4b1[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x4a2b44,null))[_0x1e51('0x2a')](function(_0x50e359){if(_0x50e359){_0x5c4452=_0x50e359;_0x101bb9[_0x1e51('0x39')]=_['keys'](db[_0x1e51('0x7d')][_0x1e51('0x33')]);_0x101bb9[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x3ed4b1['query']);_0x101bb9['filters']=_['intersection'](_0x101bb9[_0x1e51('0x39')],_0x101bb9[_0x1e51('0x36')]);_0x49517c[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x101bb9['model'],qs[_0x1e51('0x4b')](_0x3ed4b1['query'][_0x1e51('0x4b')]));_0x49517c['attributes']=_0x49517c['attributes'][_0x1e51('0x4c')]?_0x49517c[_0x1e51('0x38')]:_0x101bb9['model'];_0x49517c[_0x1e51('0x3c')]=qs['sort'](_0x3ed4b1[_0x1e51('0x36')]['sort']);_0x49517c[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_['pick'](_0x3ed4b1[_0x1e51('0x36')],_0x101bb9['filters']));if(_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x44')]){_0x49517c[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x49517c['where'],{'$or':_[_0x1e51('0x31')](_0x49517c[_0x1e51('0x38')],function(_0x4698b1){var _0x4ff0ff={};_0x4ff0ff[_0x4698b1]={'$like':'%'+_0x3ed4b1['query'][_0x1e51('0x44')]+'%'};return _0x4ff0ff;})});}_0x49517c=_[_0x1e51('0x41')]({},_0x49517c,_0x3ed4b1[_0x1e51('0x4d')]);return _0x5c4452['getAgents'](_0x49517c);}})['then'](function(_0x552f34){if(_0x552f34){_0x2b4b49=_0x552f34[_0x1e51('0x4c')];if(!_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x3a')]('nolimit')){_0x49517c[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x3ed4b1['query'][_0x1e51('0x22')]);_0x49517c[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x3ed4b1['query'][_0x1e51('0x20')]);}return _0x5c4452['getAgents'](_0x49517c);}})[_0x1e51('0x2a')](function(_0x2c84a3){if(_0x2c84a3){return _0x2c84a3?{'count':_0x2b4b49,'rows':_0x2c84a3}:null;}})[_0x1e51('0x2a')](respondWithResult(_0x4a2b44,null))[_0x1e51('0x4e')](handleError(_0x4a2b44,null));};exports[_0x1e51('0x7e')]=function(_0x37a7ef,_0x37f26c,_0xa3225a){var _0x10370b={};var _0x5a6e2f={};var _0x5394e1;var _0x4a5daa;return db[_0x1e51('0x32')]['findOne']({'where':{'id':_0x37a7ef[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x37f26c,null))[_0x1e51('0x2a')](function(_0x3a546f){if(_0x3a546f){_0x5394e1=_0x3a546f;_0x5a6e2f[_0x1e51('0x39')]=_[_0x1e51('0x4a')](db[_0x1e51('0x7f')][_0x1e51('0x33')]);_0x5a6e2f[_0x1e51('0x36')]=_['keys'](_0x37a7ef[_0x1e51('0x36')]);_0x5a6e2f[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],_0x5a6e2f[_0x1e51('0x36')]);_0x10370b[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],qs[_0x1e51('0x4b')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x4b')]));_0x10370b[_0x1e51('0x38')]=_0x10370b[_0x1e51('0x38')]['length']?_0x10370b['attributes']:_0x5a6e2f[_0x1e51('0x39')];_0x10370b['order']=qs['sort'](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x10370b[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x37a7ef[_0x1e51('0x36')],_0x5a6e2f[_0x1e51('0x3f')]));if(_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x44')]){_0x10370b['where']=_[_0x1e51('0x41')](_0x10370b[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x10370b['attributes'],function(_0x5e3a9a){var _0x121591={};_0x121591[_0x5e3a9a]={'$like':'%'+_0x37a7ef[_0x1e51('0x36')]['filter']+'%'};return _0x121591;})});}_0x10370b=_[_0x1e51('0x41')]({},_0x10370b,_0x37a7ef[_0x1e51('0x4d')]);return _0x5394e1['getTeams'](_0x10370b);}})[_0x1e51('0x2a')](function(_0x30f3f4){if(_0x30f3f4){_0x4a5daa=_0x30f3f4[_0x1e51('0x4c')];if(!_0x37a7ef['query'][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x10370b[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x22')]);_0x10370b[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x20')]);}return _0x5394e1['getTeams'](_0x10370b);}})['then'](function(_0x41147f){if(_0x41147f){return _0x41147f?{'count':_0x4a5daa,'rows':_0x41147f}:null;}})['then'](respondWithResult(_0x37f26c,null))['catch'](handleError(_0x37f26c,null));};exports['addTeams']=function(_0x251595,_0x53dbbb,_0x159c58){var _0x5494ac=_0x251595[_0x1e51('0x54')][_0x1e51('0x74')];var _0x4859cd;return db[_0x1e51('0x7f')]['findAll']({'where':{'id':_0x5494ac},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id','name',_0x1e51('0x81'),_0x1e51('0x82'),'interface'],'raw':!![]}]})['then'](function(_0x4e99dd){if(_0x4e99dd){_0x4859cd=_0x4e99dd;var _0x46bea7=_[_0x1e51('0x83')](_0x4e99dd,function(_0x3cc89b){var _0x543c71=_0x3cc89b['get']({'plain':!![]});return _0x543c71[_0x1e51('0x80')];});return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x251595['params']['id']}})[_0x1e51('0x2a')](function(_0x20bcb6){return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0xb339a0){return _0x20bcb6[_0x1e51('0x84')](_0x5494ac,{'transaction':_0xb339a0})['then'](function(){return BPromise[_0x1e51('0x85')](_0x4859cd,function(_0x15ca94){return db[_0x1e51('0x86')]['upsert']({'TeamId':_0x15ca94['id'],'VoicePrefixId':_0x251595['params']['id']},{'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){return BPromise['each'](_0x46bea7,function(_0x55c0e9){return db['UserVoicePrefix'][_0x1e51('0x87')]({'where':{'UserId':_0x55c0e9['id'],'VoicePrefixId':_0x251595[_0x1e51('0x49')]['id']},'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){_0x46bea7[_0x1e51('0x88')](function(_0x4c5279){socket['emit']('userVoicePrefix:save',{'UserId':_0x4c5279['id'],'VoicePrefixId':_0x20bcb6['id']});});});});});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x53dbbb,null))['catch'](handleError(_0x53dbbb,null));};exports[_0x1e51('0x89')]=function(_0x15ae93,_0x40146c,_0x419043){return db[_0x1e51('0x7f')][_0x1e51('0x46')]({'where':{'id':_0x15ae93[_0x1e51('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id'],'raw':!![]}]})[_0x1e51('0x2a')](handleEntityNotFound(_0x40146c,null))[_0x1e51('0x2a')](function(_0x478a79){var _0xec29f4=_[_0x1e51('0x31')](_0x478a79,'id');var _0x57c3a2=[];var _0x2b12e9=[];var _0x2ab009=squel[_0x1e51('0x8a')]();_0x2ab009[_0x1e51('0x8b')](_0x1e51('0x8c'))[_0x1e51('0x8d')](_0x1e51('0x8e'),'tq')[_0x1e51('0x8f')](_0x1e51('0x90'),'ut',_0x1e51('0x91'))['where'](_0x1e51('0x92'),_0x15ae93[_0x1e51('0x49')]['id']);for(var _0x42f652=0x0;_0x42f652<_0x478a79[_0x1e51('0x4c')];_0x42f652+=0x1){let _0x131006=_0x478a79[_0x42f652];for(var _0xa5bef1=0x0;_0xa5bef1<_0x131006[_0x1e51('0x80')][_0x1e51('0x4c')];_0xa5bef1+=0x1){let _0x1e1c48=_0x131006[_0x1e51('0x80')][_0xa5bef1];var _0x12d430=_0x2ab009['clone']();_0x12d430[_0x1e51('0x3e')](_0x1e51('0x93'),_0x1e1c48['id']);_0x2b12e9['push'](db['sequelize'][_0x1e51('0x36')](_0x12d430[_0x1e51('0x94')](),{'type':db[_0x1e51('0x52')][_0x1e51('0x95')][_0x1e51('0x96')]})[_0x1e51('0x2a')](function(_0x51114b){if(_0x51114b['length']===0x1){return _0x1e1c48['id'];}else{var _0x290551=_[_0x1e51('0x97')](_['map'](_0x51114b,_0x1e51('0x98')),function(_0x4610e1){return _[_0x1e51('0x99')](_0xec29f4,_0x4610e1);});if(_0x290551){return _0x1e1c48['id'];}}}));}}return BPromise['all'](_0x2b12e9)[_0x1e51('0x2a')](function(_0x304999){_0x57c3a2=_(_0x57c3a2)[_0x1e51('0x9a')](_0x304999)['compact']()[_0x1e51('0x9b')]();return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x15ae93[_0x1e51('0x49')]['id']}})['then'](function(_0x2773c3){return db[_0x1e51('0x52')]['transaction'](function(_0x237435){return _0x2773c3[_0x1e51('0x89')](_0x15ae93[_0x1e51('0x36')][_0x1e51('0x74')],{'transaction':_0x237435})['then'](function(){if(!_[_0x1e51('0x9c')](_0x57c3a2)){return _0x2773c3[_0x1e51('0x78')](_0x57c3a2,{'transaction':_0x237435});}})[_0x1e51('0x2a')](function(){_0x57c3a2[_0x1e51('0x88')](function(_0x43b66c){socket['emit'](_0x1e51('0x7a'),{'UserId':_0x43b66c,'VoicePrefixId':_0x2773c3['id']});});});});});});})[_0x1e51('0x2a')](respondWithStatusCode(_0x40146c,null))[_0x1e51('0x4e')](handleError(_0x40146c,null));}; \ No newline at end of file +var _0x5f66=['map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoicePrefix','count','includeAll','include','findAll','rows','catch','find','destroy','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','goto','charAt','system-','findById','params','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','getAgents','hasOwnProperty','getTeams','Team','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','from','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','update','get','VoicePrefixes','UserProfileResource','then','error','stack','send'];(function(_0x465845,_0x15007c){var _0x314825=function(_0x4f24b8){while(--_0x4f24b8){_0x465845['push'](_0x465845['shift']());}};_0x314825(++_0x15007c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'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'];config[_0x65f6('0x14')]=_['defaults'](config[_0x65f6('0x14')],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x14')]));require(_0x65f6('0x17'))[_0x65f6('0x18')](socket);function respondWithStatusCode(_0x44144b,_0xb1d40a){_0xb1d40a=_0xb1d40a||0xcc;return function(_0x46dbc6){if(_0x46dbc6){return _0x44144b[_0x65f6('0x19')](_0xb1d40a);}return _0x44144b['status'](_0xb1d40a)[_0x65f6('0x1a')]();};}function respondWithResult(_0x49a913,_0x5dd324){_0x5dd324=_0x5dd324||0xc8;return function(_0x1693e6){if(_0x1693e6){return _0x49a913[_0x65f6('0x1b')](_0x5dd324)[_0x65f6('0x1c')](_0x1693e6);}};}function respondWithFilteredResult(_0x1c955c,_0x1b1cbb){return function(_0x1f974c){if(_0x1f974c){var _0xc8660c=typeof _0x1b1cbb[_0x65f6('0x1d')]==='undefined'&&typeof _0x1b1cbb['limit']===_0x65f6('0x1e');var _0x5b4055=_0x1f974c['count'];var _0x5c5b91=_0xc8660c?0x0:_0x1b1cbb[_0x65f6('0x1d')];var _0x21ea88=_0xc8660c?_0x1f974c['count']:_0x1b1cbb[_0x65f6('0x1d')]+_0x1b1cbb[_0x65f6('0x1f')];var _0xbee6a4;if(_0x21ea88>=_0x5b4055){_0x21ea88=_0x5b4055;_0xbee6a4=0xc8;}else{_0xbee6a4=0xce;}_0x1c955c[_0x65f6('0x1b')](_0xbee6a4);return _0x1c955c[_0x65f6('0x20')](_0x65f6('0x21'),_0x5c5b91+'-'+_0x21ea88+'/'+_0x5b4055)['json'](_0x1f974c);}return null;};}function patchUpdates(_0x197a49){return function(_0x4bb39e){try{jsonpatch['apply'](_0x4bb39e,_0x197a49,!![]);}catch(_0x212247){return BPromise[_0x65f6('0x22')](_0x212247);}return _0x4bb39e['save']();};}function saveUpdates(_0x1eeaaa,_0x471a33){return function(_0x2317ce){if(_0x2317ce){return _0x2317ce[_0x65f6('0x23')](_0x1eeaaa)['then'](function(_0x9d7bb0){return _0x9d7bb0;});}return null;};}function removeEntity(_0x59ea32,_0x20a161){return function(_0x5963e0){if(_0x5963e0){return _0x5963e0['destroy']()['then'](function(){var _0x29abdb=_0x5963e0[_0x65f6('0x24')]({'plain':!![]});var _0x4b2292=_0x65f6('0x25');return db[_0x65f6('0x26')]['destroy']({'where':{'type':_0x4b2292,'resourceId':_0x29abdb['id']}})[_0x65f6('0x27')](function(){return _0x5963e0;});})[_0x65f6('0x27')](function(){_0x59ea32[_0x65f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac04b,_0x488d36){return function(_0x266cfe){if(!_0x266cfe){_0x4ac04b[_0x65f6('0x19')](0x194);}return _0x266cfe;};}function handleError(_0x4344b3,_0x408ccc){_0x408ccc=_0x408ccc||0x1f4;return function(_0x518cac){logger[_0x65f6('0x28')](_0x518cac[_0x65f6('0x29')]);if(_0x518cac['name']){delete _0x518cac['name'];}_0x4344b3[_0x65f6('0x1b')](_0x408ccc)[_0x65f6('0x2a')](_0x518cac);};}exports['index']=function(_0x4e50c0,_0x10b368){var _0x1ce43c={},_0x11fe3b={},_0xc53cb7={'count':0x0,'rows':[]};var _0x1217fd=_[_0x65f6('0x2b')](db['VoicePrefix'][_0x65f6('0x2c')],function(_0x38f3c6){return{'name':_0x38f3c6[_0x65f6('0x2d')],'type':_0x38f3c6['type'][_0x65f6('0x2e')]};});_0x11fe3b[_0x65f6('0x2f')]=_[_0x65f6('0x2b')](_0x1217fd,_0x65f6('0x30'));_0x11fe3b[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4e50c0['query']);_0x11fe3b[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x11fe3b['model'],_0x11fe3b[_0x65f6('0x31')]);_0x1ce43c['attributes']=_[_0x65f6('0x34')](_0x11fe3b['model'],qs[_0x65f6('0x35')](_0x4e50c0[_0x65f6('0x31')]['fields']));_0x1ce43c[_0x65f6('0x36')]=_0x1ce43c[_0x65f6('0x36')][_0x65f6('0x37')]?_0x1ce43c['attributes']:_0x11fe3b['model'];if(!_0x4e50c0[_0x65f6('0x31')]['hasOwnProperty'](_0x65f6('0x38'))){_0x1ce43c['limit']=qs[_0x65f6('0x1f')](_0x4e50c0[_0x65f6('0x31')]['limit']);_0x1ce43c[_0x65f6('0x1d')]=qs['offset'](_0x4e50c0['query'][_0x65f6('0x1d')]);}_0x1ce43c[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3a')]);_0x1ce43c[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4e50c0['query'],_0x11fe3b[_0x65f6('0x33')]),_0x1217fd);if(_0x4e50c0['query'][_0x65f6('0x3d')]){_0x1ce43c[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x1ce43c[_0x65f6('0x3b')],{'$or':_['map'](_0x1217fd,function(_0x32148f){if(_0x32148f[_0x65f6('0x3f')]!==_0x65f6('0x40')){var _0x3fb1c6={};_0x3fb1c6[_0x32148f[_0x65f6('0x30')]]={'$like':'%'+_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x3fb1c6;}})});}_0x1ce43c=_[_0x65f6('0x3e')]({},_0x1ce43c,_0x4e50c0[_0x65f6('0x41')]);var _0x5d8e48={'where':_0x1ce43c[_0x65f6('0x3b')]};return db[_0x65f6('0x42')][_0x65f6('0x43')](_0x5d8e48)[_0x65f6('0x27')](function(_0x83e2d9){_0xc53cb7[_0x65f6('0x43')]=_0x83e2d9;if(_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x44')]){_0x1ce43c[_0x65f6('0x45')]=[{'all':!![]}];}return db[_0x65f6('0x42')][_0x65f6('0x46')](_0x1ce43c);})[_0x65f6('0x27')](function(_0x6c4d94){_0xc53cb7[_0x65f6('0x47')]=_0x6c4d94;return _0xc53cb7;})[_0x65f6('0x27')](respondWithFilteredResult(_0x10b368,_0x1ce43c))[_0x65f6('0x48')](handleError(_0x10b368,null));};exports['show']=function(_0x2dd16c,_0x37cd36){var _0x2d8c45={'raw':![],'where':{'id':_0x2dd16c['params']['id']}},_0x3828c9={};_0x3828c9[_0x65f6('0x2f')]=_[_0x65f6('0x32')](db[_0x65f6('0x42')]['rawAttributes']);_0x3828c9[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x2dd16c[_0x65f6('0x31')]);_0x3828c9[_0x65f6('0x33')]=_['intersection'](_0x3828c9[_0x65f6('0x2f')],_0x3828c9['query']);_0x2d8c45[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x3828c9['model'],qs[_0x65f6('0x35')](_0x2dd16c['query'][_0x65f6('0x35')]));_0x2d8c45[_0x65f6('0x36')]=_0x2d8c45[_0x65f6('0x36')][_0x65f6('0x37')]?_0x2d8c45[_0x65f6('0x36')]:_0x3828c9[_0x65f6('0x2f')];if(_0x2dd16c['query']['includeAll']){_0x2d8c45[_0x65f6('0x45')]=[{'all':!![]}];}_0x2d8c45=_[_0x65f6('0x3e')]({},_0x2d8c45,_0x2dd16c[_0x65f6('0x41')]);return db[_0x65f6('0x42')][_0x65f6('0x49')](_0x2d8c45)[_0x65f6('0x27')](handleEntityNotFound(_0x37cd36,null))[_0x65f6('0x27')](respondWithResult(_0x37cd36,null))[_0x65f6('0x48')](handleError(_0x37cd36,null));};exports[_0x65f6('0x4a')]=function(_0x517a47,_0x1f16cf){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x517a47['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x1f16cf,null))[_0x65f6('0x27')](removeEntity(_0x1f16cf,null))['catch'](handleError(_0x1f16cf,null));};exports[_0x65f6('0x4b')]=function(_0x253d52,_0x57eb04){return db[_0x65f6('0x42')]['describe']()[_0x65f6('0x27')](respondWithResult(_0x57eb04,null))[_0x65f6('0x48')](handleError(_0x57eb04,null));};exports[_0x65f6('0x4c')]=function(_0x4b9f0a,_0x1646c5){var _0x43a52e;return db['sequelize'][_0x65f6('0x4d')](function(_0x34312c){return db['VoicePrefix'][_0x65f6('0x4c')](_0x4b9f0a[_0x65f6('0x4e')],{'transaction':_0x34312c})[_0x65f6('0x27')](function(_0x25d504){_0x43a52e=_0x25d504[_0x65f6('0x24')]({'plain':!![]});return db[_0x65f6('0x4f')][_0x65f6('0x49')]({'where':{'id':_0x43a52e[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x52c5a4){return createVoicePrefixExtensions(_0x43a52e,_0x52c5a4,_0x34312c);});});})['then'](function(){var _0x19f40c=_0x4b9f0a[_0x65f6('0x51')][_0x65f6('0x24')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x52'));if(_0x19f40c['role']===_0x65f6('0x51')){var _0x2032b9=_0x43a52e;return db[_0x65f6('0x53')]['find']({'where':{'name':_0x65f6('0x25'),'userProfileId':_0x19f40c[_0x65f6('0x54')]},'raw':!![]})[_0x65f6('0x27')](function(_0x4e289e){if(_0x4e289e&&_0x4e289e['autoAssociation']===0x0){return db[_0x65f6('0x26')][_0x65f6('0x4c')]({'name':_0x2032b9[_0x65f6('0x30')],'resourceId':_0x2032b9['id'],'type':_0x4e289e[_0x65f6('0x30')],'sectionId':_0x4e289e['id']},{})[_0x65f6('0x27')](function(){return _0x43a52e;});}else{return _0x43a52e;}})[_0x65f6('0x48')](function(_0x35d77f){logger[_0x65f6('0x28')](_0x65f6('0x55'),_0x35d77f);throw _0x35d77f;});}return _0x43a52e;})[_0x65f6('0x27')](respondWithResult(_0x1646c5,null))[_0x65f6('0x48')](handleError(_0x1646c5,null));};function Extension(_0x141fcc,_0x30adee,_0x3e3143,_0x5ba9c6){this[_0x65f6('0x56')]=_0x65f6('0x57');this[_0x65f6('0x58')]=_0x141fcc;this['app']=_0x3e3143;this[_0x65f6('0x3f')]=_0x65f6('0x59');this[_0x65f6('0x5a')]=_0x65f6('0x5b');this['priority']=_0x30adee;this[_0x65f6('0x5c')]=_0x5ba9c6;}function createVoicePrefixExtensions(_0x4227f5,_0xe5fc65,_0x3e0d8b){return new BPromise(function(_0x553ff0,_0x2923ff){var _0x2fc20f=new Extension(formatPrefixName(_0x4227f5['prefix']),0x1,_0x65f6('0x5d'),_0x65f6('0x5e'));_0x2fc20f[_0x65f6('0x5f')]=_0x4227f5['id'];return db['VoiceExtension'][_0x65f6('0x4c')](_0x2fc20f,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0x3974ef){var _0x3c23e3=_0x3974ef[_0x65f6('0x24')]({'plain':!![]});var _0x334fa1=_['map'](addVoicePrefixExtensions(_0x4227f5,_0xe5fc65),function(_0x4ee8bd){_0x4ee8bd['VoiceExtensionId']=_0x3c23e3['id'];_0x4ee8bd[_0x65f6('0x5f')]=_0x4227f5['id'];return _0x4ee8bd;});return db[_0x65f6('0x4f')][_0x65f6('0x60')](_0x334fa1,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0xab6f0){if(!_0xab6f0){return _0x2923ff(_0x65f6('0x61'));}else{return _0x553ff0(_0xab6f0);}})['catch'](function(_0xfbfebc){return _0x2923ff(_0xfbfebc);});});;});};function addVoicePrefixExtensions(_0x1d1532,_0x54b569){var _0x225aeb=[];var _0x39c244=formatPrefixName(_0x1d1532[_0x65f6('0x62')]);_0x225aeb['push'](new Extension(_0x39c244,0x2,_0x65f6('0x63'),_0x65f6('0x64')+_0x1d1532['name']));if(_0x1d1532[_0x65f6('0x65')]){_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x63'),_0x65f6('0x67')+_0x1d1532[_0x65f6('0x65')]));}else{_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x5d'),'No\x20callerid\x20available'));}_0x225aeb['push'](new Extension(_0x39c244,0x4,_0x65f6('0x68'),_0x54b569[_0x65f6('0x56')]+','+'${EXTEN:'+(0x8+_0x1d1532[_0x65f6('0x30')]['length'])+'}'+','+0x1));return _0x225aeb;}function formatPrefixName(_0x3a483b){var _0x4e0450='_';for(var _0x440df1=0x0;_0x440df1<_0x3a483b[_0x65f6('0x37')];_0x440df1++){if(_0x3a483b[_0x65f6('0x69')](_0x440df1)=='-'){_0x4e0450+=_0x3a483b[_0x65f6('0x69')](_0x440df1);}else{_0x4e0450+='['+_0x3a483b[_0x65f6('0x69')](_0x440df1)+']';}}_0x4e0450+='.';return _0x4e0450;}exports[_0x65f6('0x23')]=function(_0x1aaf75,_0x1cc66a,_0x2405a7){var _0x4b7ecd=_0x1aaf75['body'];_0x4b7ecd[_0x65f6('0x62')]=_0x65f6('0x6a')+_0x4b7ecd[_0x65f6('0x30')]+'-';return db['sequelize']['transaction'](function(_0x2dbec2){return db[_0x65f6('0x42')][_0x65f6('0x23')](_0x4b7ecd,{'where':{'id':_0x4b7ecd['id']},'transaction':_0x2dbec2})[_0x65f6('0x27')](function(){return db[_0x65f6('0x4f')][_0x65f6('0x4a')]({'where':{'VoicePrefixId':_0x4b7ecd['id']},'transaction':_0x2dbec2})['then'](function(){return db['VoiceExtension'][_0x65f6('0x49')]({'where':{'id':_0x4b7ecd[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x219bf8){return createVoicePrefixExtensions(_0x4b7ecd,_0x219bf8,_0x2dbec2);});});});})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x6b')](_0x4b7ecd['id']);})[_0x65f6('0x27')](respondWithResult(_0x1cc66a,null))[_0x65f6('0x48')](handleError(_0x1cc66a,null));};exports['addAgents']=function(_0x34ab7b,_0x351d43,_0x11411c){return db['VoicePrefix']['find']({'where':{'id':_0x34ab7b[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0x351d43,null))[_0x65f6('0x27')](function(_0xf6de){if(_0xf6de){return _0xf6de[_0x65f6('0x6d')](_0x34ab7b[_0x65f6('0x4e')]['ids'],_['omit'](_0x34ab7b['body'],[_0x65f6('0x6e'),'id'])||{})[_0x65f6('0x6f')](function(_0x161fb2){for(var _0x57464e=0x0;_0x57464e<_0x34ab7b[_0x65f6('0x4e')][_0x65f6('0x6e')][_0x65f6('0x37')];_0x57464e+=0x1){socket['emit'](_0x65f6('0x70'),{'UserId':Number(_0x34ab7b[_0x65f6('0x4e')]['ids'][_0x57464e]),'VoicePrefixId':Number(_0x34ab7b[_0x65f6('0x6c')]['id'])});}return _0x161fb2;});}})[_0x65f6('0x27')](respondWithResult(_0x351d43,null))['catch'](handleError(_0x351d43,null));};exports[_0x65f6('0x71')]=function(_0x5ef825,_0xe8449b,_0x55ea91){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x5ef825['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0xe8449b,null))[_0x65f6('0x27')](function(_0x2a700b){if(_0x2a700b){return _0x2a700b[_0x65f6('0x71')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])[_0x65f6('0x27')](function(){if(_[_0x65f6('0x72')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])){for(var _0x288eb0=0x0;_0x288eb0<_0x5ef825['query'][_0x65f6('0x6e')][_0x65f6('0x37')];_0x288eb0+=0x1){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')][_0x288eb0]),'VoicePrefixId':Number(_0x5ef825[_0x65f6('0x6c')]['id'])});}}else{socket['emit'](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')]),'VoicePrefixId':Number(_0x5ef825['params']['id'])});}});}})[_0x65f6('0x27')](respondWithStatusCode(_0xe8449b,null))[_0x65f6('0x48')](handleError(_0xe8449b,null));};exports['getAgents']=function(_0x4946c7,_0xa4a742,_0x413c21){var _0x5158c9={};var _0x2d86c8={};var _0x3b3bd5;var _0x73d359;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x4946c7[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0xa4a742,null))[_0x65f6('0x27')](function(_0x504b39){if(_0x504b39){_0x3b3bd5=_0x504b39;_0x2d86c8[_0x65f6('0x2f')]=_['keys'](db['User'][_0x65f6('0x2c')]);_0x2d86c8[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4946c7[_0x65f6('0x31')]);_0x2d86c8[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2d86c8[_0x65f6('0x2f')],_0x2d86c8[_0x65f6('0x31')]);_0x5158c9['attributes']=_['intersection'](_0x2d86c8[_0x65f6('0x2f')],qs['fields'](_0x4946c7[_0x65f6('0x31')][_0x65f6('0x35')]));_0x5158c9[_0x65f6('0x36')]=_0x5158c9[_0x65f6('0x36')][_0x65f6('0x37')]?_0x5158c9['attributes']:_0x2d86c8[_0x65f6('0x2f')];_0x5158c9[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4946c7['query'][_0x65f6('0x3a')]);_0x5158c9[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4946c7[_0x65f6('0x31')],_0x2d86c8[_0x65f6('0x33')]));if(_0x4946c7['query']['filter']){_0x5158c9[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x5158c9[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0x5158c9['attributes'],function(_0x4bda86){var _0x336076={};_0x336076[_0x4bda86]={'$like':'%'+_0x4946c7[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x336076;})});}_0x5158c9=_[_0x65f6('0x3e')]({},_0x5158c9,_0x4946c7[_0x65f6('0x41')]);return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x4d607a){if(_0x4d607a){_0x73d359=_0x4d607a['length'];if(!_0x4946c7[_0x65f6('0x31')][_0x65f6('0x77')](_0x65f6('0x38'))){_0x5158c9[_0x65f6('0x1f')]=qs['limit'](_0x4946c7['query'][_0x65f6('0x1f')]);_0x5158c9[_0x65f6('0x1d')]=qs['offset'](_0x4946c7[_0x65f6('0x31')]['offset']);}return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x3a30ed){if(_0x3a30ed){return _0x3a30ed?{'count':_0x73d359,'rows':_0x3a30ed}:null;}})[_0x65f6('0x27')](respondWithResult(_0xa4a742,null))['catch'](handleError(_0xa4a742,null));};exports[_0x65f6('0x78')]=function(_0x330e18,_0x13c03b,_0x9f6e0c){var _0xec6a56={};var _0x144db0={};var _0x584ea4;var _0x45b3e6;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x330e18['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x13c03b,null))[_0x65f6('0x27')](function(_0xdf396c){if(_0xdf396c){_0x584ea4=_0xdf396c;_0x144db0[_0x65f6('0x2f')]=_['keys'](db[_0x65f6('0x79')][_0x65f6('0x2c')]);_0x144db0[_0x65f6('0x31')]=_['keys'](_0x330e18['query']);_0x144db0[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x144db0['model'],_0x144db0[_0x65f6('0x31')]);_0xec6a56[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x144db0['model'],qs[_0x65f6('0x35')](_0x330e18[_0x65f6('0x31')]['fields']));_0xec6a56[_0x65f6('0x36')]=_0xec6a56[_0x65f6('0x36')][_0x65f6('0x37')]?_0xec6a56['attributes']:_0x144db0[_0x65f6('0x2f')];_0xec6a56[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x330e18['query'][_0x65f6('0x3a')]);_0xec6a56['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x330e18[_0x65f6('0x31')],_0x144db0[_0x65f6('0x33')]));if(_0x330e18[_0x65f6('0x31')][_0x65f6('0x3d')]){_0xec6a56['where']=_[_0x65f6('0x3e')](_0xec6a56[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0xec6a56[_0x65f6('0x36')],function(_0x207d15){var _0x59407d={};_0x59407d[_0x207d15]={'$like':'%'+_0x330e18['query']['filter']+'%'};return _0x59407d;})});}_0xec6a56=_[_0x65f6('0x3e')]({},_0xec6a56,_0x330e18[_0x65f6('0x41')]);return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})['then'](function(_0x151cee){if(_0x151cee){_0x45b3e6=_0x151cee['length'];if(!_0x330e18['query'][_0x65f6('0x77')](_0x65f6('0x38'))){_0xec6a56['limit']=qs[_0x65f6('0x1f')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1f')]);_0xec6a56[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1d')]);}return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})[_0x65f6('0x27')](function(_0x350641){if(_0x350641){return _0x350641?{'count':_0x45b3e6,'rows':_0x350641}:null;}})[_0x65f6('0x27')](respondWithResult(_0x13c03b,null))[_0x65f6('0x48')](handleError(_0x13c03b,null));};exports['addTeams']=function(_0x349af7,_0x52dc75,_0x55355f){var _0x24d524=_0x349af7[_0x65f6('0x4e')][_0x65f6('0x6e')];var _0x3727f9;return db['Team'][_0x65f6('0x46')]({'where':{'id':_0x24d524},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x65f6('0x30'),_0x65f6('0x7a'),_0x65f6('0x7b'),_0x65f6('0x7c')],'raw':!![]}]})[_0x65f6('0x27')](function(_0xcdfebe){if(_0xcdfebe){_0x3727f9=_0xcdfebe;var _0x5a33cf=_[_0x65f6('0x7d')](_0xcdfebe,function(_0x56bf49){var _0x1ef2a0=_0x56bf49[_0x65f6('0x24')]({'plain':!![]});return _0x1ef2a0[_0x65f6('0x7e')];});return db['VoicePrefix'][_0x65f6('0x49')]({'where':{'id':_0x349af7['params']['id']}})['then'](function(_0x377d5e){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0xf364a9){return _0x377d5e[_0x65f6('0x80')](_0x24d524,{'transaction':_0xf364a9})['then'](function(){return BPromise[_0x65f6('0x81')](_0x3727f9,function(_0x400633){return db[_0x65f6('0x82')][_0x65f6('0x83')]({'TeamId':_0x400633['id'],'VoicePrefixId':_0x349af7['params']['id']},{'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){return BPromise[_0x65f6('0x81')](_0x5a33cf,function(_0x344163){return db[_0x65f6('0x84')][_0x65f6('0x85')]({'where':{'UserId':_0x344163['id'],'VoicePrefixId':_0x349af7[_0x65f6('0x6c')]['id']},'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){_0x5a33cf[_0x65f6('0x86')](function(_0x558410){socket[_0x65f6('0x73')](_0x65f6('0x70'),{'UserId':_0x558410['id'],'VoicePrefixId':_0x377d5e['id']});});});});});}})[_0x65f6('0x27')](respondWithStatusCode(_0x52dc75,null))[_0x65f6('0x48')](handleError(_0x52dc75,null));};exports[_0x65f6('0x87')]=function(_0x4171a1,_0x57667e,_0x3fd6ee){return db[_0x65f6('0x79')]['findAll']({'where':{'id':_0x4171a1[_0x65f6('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x65f6('0x88')],'as':_0x65f6('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x27')](handleEntityNotFound(_0x57667e,null))[_0x65f6('0x27')](function(_0x2177f1){var _0x55c9bd=_[_0x65f6('0x2b')](_0x2177f1,'id');var _0x395642=[];var _0x2394eb=[];var _0x31870f=squel[_0x65f6('0x89')]();_0x31870f['field']('tq.TeamId')[_0x65f6('0x8a')](_0x65f6('0x8b'),'tq')[_0x65f6('0x8c')](_0x65f6('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x4171a1[_0x65f6('0x6c')]['id']);for(var _0x3b0a97=0x0;_0x3b0a97<_0x2177f1[_0x65f6('0x37')];_0x3b0a97+=0x1){let _0x50e159=_0x2177f1[_0x3b0a97];for(var _0x12730b=0x0;_0x12730b<_0x50e159[_0x65f6('0x7e')][_0x65f6('0x37')];_0x12730b+=0x1){let _0x18c6a8=_0x50e159[_0x65f6('0x7e')][_0x12730b];var _0x54e258=_0x31870f[_0x65f6('0x8e')]();_0x54e258[_0x65f6('0x3b')]('ut.UserId\x20=\x20?',_0x18c6a8['id']);_0x2394eb['push'](db[_0x65f6('0x7f')][_0x65f6('0x31')](_0x54e258[_0x65f6('0x8f')](),{'type':db[_0x65f6('0x7f')][_0x65f6('0x90')]['SELECT']})[_0x65f6('0x27')](function(_0x4b080a){if(_0x4b080a[_0x65f6('0x37')]===0x1){return _0x18c6a8['id'];}else{var _0x5d181a=_[_0x65f6('0x91')](_['map'](_0x4b080a,_0x65f6('0x92')),function(_0x48a9df){return _[_0x65f6('0x93')](_0x55c9bd,_0x48a9df);});if(_0x5d181a){return _0x18c6a8['id'];}}}));}}return BPromise[_0x65f6('0x94')](_0x2394eb)['then'](function(_0x4f2f43){_0x395642=_(_0x395642)[_0x65f6('0x95')](_0x4f2f43)[_0x65f6('0x96')]()[_0x65f6('0x97')]();return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x4171a1[_0x65f6('0x6c')]['id']}})[_0x65f6('0x27')](function(_0x1b5957){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0x4a90e3){return _0x1b5957[_0x65f6('0x87')](_0x4171a1[_0x65f6('0x31')][_0x65f6('0x6e')],{'transaction':_0x4a90e3})[_0x65f6('0x27')](function(){if(!_[_0x65f6('0x98')](_0x395642)){return _0x1b5957[_0x65f6('0x71')](_0x395642,{'transaction':_0x4a90e3});}})['then'](function(){_0x395642[_0x65f6('0x86')](function(_0x91d7bf){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':_0x91d7bf,'VoicePrefixId':_0x1b5957['id']});});});});});});})[_0x65f6('0x27')](respondWithStatusCode(_0x57667e,null))[_0x65f6('0x48')](handleError(_0x57667e,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index fdf66da..fd77e32 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 _0x4e75=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update'];(function(_0x2dc735,_0x5b3890){var _0x1c3693=function(_0x50dcda){while(--_0x50dcda){_0x2dc735['push'](_0x2dc735['shift']());}};_0x1c3693(++_0x5b3890);}(_0x4e75,0x19a));var _0x54e7=function(_0x5b80fc,_0x31de80){_0x5b80fc=_0x5b80fc-0x0;var _0x90097e=_0x4e75[_0x5b80fc];return _0x90097e;};'use strict';var EventEmitter=require(_0x54e7('0x0'));var VoicePrefix=require(_0x54e7('0x1'))['db'][_0x54e7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x54e7('0x3'),'afterDestroy':_0x54e7('0x4')};function emitEvent(_0x21bd52){return function(_0x3bb184,_0x582fb3,_0x5bbc50){VoicePrefixEvents[_0x54e7('0x5')](_0x21bd52+':'+_0x3bb184['id'],_0x3bb184);VoicePrefixEvents[_0x54e7('0x5')](_0x21bd52,_0x3bb184);_0x5bbc50(null);};}for(var e in events){if(events[_0x54e7('0x6')](e)){var event=events[e];VoicePrefix[_0x54e7('0x7')](e,emitEvent(event));}}module[_0x54e7('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x503a=['remove','emit','hook','exports','../../mysqldb','VoicePrefix','save','update'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x503a,0x1b4));var _0xa503=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0x503a[_0x4d8764];return _0x4e0b49;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xa503('0x0'))['db'][_0xa503('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa503('0x2'),'afterUpdate':_0xa503('0x3'),'afterDestroy':_0xa503('0x4')};function emitEvent(_0x47f9de){return function(_0x154e3b,_0x438ac9,_0x2b0bb1){VoicePrefixEvents[_0xa503('0x5')](_0x47f9de+':'+_0x154e3b['id'],_0x154e3b);VoicePrefixEvents[_0xa503('0x5')](_0x47f9de,_0x154e3b);_0x2b0bb1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xa503('0x6')](e,emitEvent(event));}}module[_0xa503('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 4a24d17..9980f4e 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 _0x7740=['exports','define','VoicePrefix','voice_prefixes','util','api','moment','path','rimraf','../../config/environment'];(function(_0x12aa66,_0x2d35c1){var _0x53dfe9=function(_0x2ab011){while(--_0x2ab011){_0x12aa66['push'](_0x12aa66['shift']());}};_0x53dfe9(++_0x2d35c1);}(_0x7740,0xc2));var _0x0774=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x7740[_0x20fdc1];return _0x25397c;};'use strict';var _=require('lodash');var util=require(_0x0774('0x0'));var logger=require('../../config/logger')(_0x0774('0x1'));var moment=require(_0x0774('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0774('0x3'));var rimraf=require(_0x0774('0x4'));var config=require(_0x0774('0x5'));var attributes=require('./voicePrefix.attributes');module[_0x0774('0x6')]=function(_0x320d8c,_0x418088){return _0x320d8c[_0x0774('0x7')](_0x0774('0x8'),attributes,{'tableName':_0x0774('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3ac=['exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb3ac,0x1a7));var _0xcb3a=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xb3ac[_0x265aa2];return _0x447a3a;};'use strict';var _=require(_0xcb3a('0x0'));var util=require(_0xcb3a('0x1'));var logger=require(_0xcb3a('0x2'))(_0xcb3a('0x3'));var moment=require(_0xcb3a('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb3a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb3a('0x6'));var config=require(_0xcb3a('0x7'));var attributes=require(_0xcb3a('0x8'));module[_0xcb3a('0x9')]=function(_0x2a2f71,_0x44dfa7){return _0x2a2f71[_0xcb3a('0xa')](_0xcb3a('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 970469d..cea1f0c 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 _0xc1db=['socket.io-emitter','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0xc1db,0x120));var _0xbc1d=function(_0x17290d,_0x5531e6){_0x17290d=_0x17290d-0x0;var _0x4d5916=_0xc1db[_0x17290d];return _0x4d5916;};'use strict';var _=require(_0xbc1d('0x0'));var util=require('util');var moment=require(_0xbc1d('0x1'));var BPromise=require(_0xbc1d('0x2'));var rs=require(_0xbc1d('0x3'));var fs=require('fs');var Redis=require(_0xbc1d('0x4'));var db=require(_0xbc1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc1d('0x6'))(_0xbc1d('0x7'));var config=require(_0xbc1d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbc1d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbc1d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc1d('0xb'))(new Redis(config[_0xbc1d('0xa')]));require('./voicePrefix.socket')[_0xbc1d('0xc')](socket);function respondWithRpcPromise(_0x4c2a66,_0x25dc8c,_0x23176d){return new BPromise(function(_0x51282b,_0x1c211f){return client[_0xbc1d('0xd')](_0x4c2a66,_0x23176d)[_0xbc1d('0xe')](function(_0x23f1b4){logger['info'](_0xbc1d('0xf'),_0x25dc8c,'request\x20sent');logger[_0xbc1d('0x10')](_0xbc1d('0x11'),_0x25dc8c,'request\x20sent',JSON[_0xbc1d('0x12')](_0x23f1b4));if(_0x23f1b4[_0xbc1d('0x13')]){if(_0x23f1b4['error'][_0xbc1d('0x14')]===0x1f4){logger[_0xbc1d('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x25dc8c,_0x23f1b4[_0xbc1d('0x13')]['message']);return _0x1c211f(_0x23f1b4[_0xbc1d('0x13')][_0xbc1d('0x15')]);}logger[_0xbc1d('0x13')](_0xbc1d('0xf'),_0x25dc8c,_0x23f1b4[_0xbc1d('0x13')][_0xbc1d('0x15')]);return _0x51282b(_0x23f1b4['error'][_0xbc1d('0x15')]);}else{logger['info'](_0xbc1d('0xf'),_0x25dc8c,_0xbc1d('0x16'));_0x51282b(_0x23f1b4['result']['message']);}})['catch'](function(_0x11f2ef){logger[_0xbc1d('0x13')](_0xbc1d('0xf'),_0x25dc8c,_0x11f2ef);_0x1c211f(_0x11f2ef);});});} \ No newline at end of file +var _0x7a12=['client','http','redis','localhost','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7a12,0xe8));var _0x27a1=function(_0x1180df,_0x217274){_0x1180df=_0x1180df-0x0;var _0x3c07d7=_0x7a12[_0x1180df];return _0x3c07d7;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var moment=require(_0x27a1('0x2'));var BPromise=require(_0x27a1('0x3'));var rs=require(_0x27a1('0x4'));var fs=require('fs');var Redis=require(_0x27a1('0x5'));var db=require(_0x27a1('0x6'))['db'];var utils=require(_0x27a1('0x7'));var logger=require('../../config/logger')(_0x27a1('0x8'));var config=require(_0x27a1('0x9'));var jayson=require(_0x27a1('0xa'));var client=jayson[_0x27a1('0xb')][_0x27a1('0xc')]({'port':0x232a});config[_0x27a1('0xd')]=_['defaults'](config[_0x27a1('0xd')],{'host':_0x27a1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x27a1('0xd')]));require(_0x27a1('0xf'))['register'](socket);function respondWithRpcPromise(_0x468277,_0x32369d,_0xe469c8){return new BPromise(function(_0x56a122,_0x2cb05d){return client[_0x27a1('0x10')](_0x468277,_0xe469c8)[_0x27a1('0x11')](function(_0x3b4187){logger[_0x27a1('0x12')](_0x27a1('0x13'),_0x32369d,_0x27a1('0x14'));logger['debug'](_0x27a1('0x15'),_0x32369d,_0x27a1('0x14'),JSON[_0x27a1('0x16')](_0x3b4187));if(_0x3b4187[_0x27a1('0x17')]){if(_0x3b4187['error'][_0x27a1('0x18')]===0x1f4){logger[_0x27a1('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x32369d,_0x3b4187['error'][_0x27a1('0x19')]);return _0x2cb05d(_0x3b4187[_0x27a1('0x17')]['message']);}logger[_0x27a1('0x17')](_0x27a1('0x13'),_0x32369d,_0x3b4187['error'][_0x27a1('0x19')]);return _0x56a122(_0x3b4187[_0x27a1('0x17')][_0x27a1('0x19')]);}else{logger[_0x27a1('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x32369d,_0x27a1('0x14'));_0x56a122(_0x3b4187['result'][_0x27a1('0x19')]);}})[_0x27a1('0x1a')](function(_0x582c8a){logger[_0x27a1('0x17')](_0x27a1('0x13'),_0x32369d,_0x582c8a);_0x2cb05d(_0x582c8a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 87aeff2..cf0a94e 100644 --- a/server/api/voicePrefix/voicePrefix.socket.js +++ b/server/api/voicePrefix/voicePrefix.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbca8=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','register'];(function(_0x4dd072,_0x515c74){var _0x45ee58=function(_0x2bf321){while(--_0x2bf321){_0x4dd072['push'](_0x4dd072['shift']());}};_0x45ee58(++_0x515c74);}(_0xbca8,0xcc));var _0x8bca=function(_0x216ef8,_0x99bf41){_0x216ef8=_0x216ef8-0x0;var _0x1ff674=_0xbca8[_0x216ef8];return _0x1ff674;};'use strict';var VoicePrefixEvents=require(_0x8bca('0x0'));var events=[_0x8bca('0x1'),_0x8bca('0x2'),_0x8bca('0x3')];function createListener(_0x17db5b,_0x51da56){return function(_0x129f58){_0x51da56[_0x8bca('0x4')](_0x17db5b,_0x129f58);};}function removeListener(_0x34d392,_0x5cafc7){return function(){VoicePrefixEvents['removeListener'](_0x34d392,_0x5cafc7);};}exports[_0x8bca('0x5')]=function(_0x2ecf60){for(var _0x318474=0x0,_0x348ddd=events['length'];_0x318474<_0x348ddd;_0x318474++){var _0x3fdccf=events[_0x318474];var _0x38e241=createListener(_0x8bca('0x6')+_0x3fdccf,_0x2ecf60);VoicePrefixEvents['on'](_0x3fdccf,_0x38e241);}}; \ No newline at end of file +var _0xe3db=['./voicePrefix.events','save','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x24d896,_0x3b7ea9){var _0x47f3ea=function(_0x3ab586){while(--_0x3ab586){_0x24d896['push'](_0x24d896['shift']());}};_0x47f3ea(++_0x3b7ea9);}(_0xe3db,0xc8));var _0xbe3d=function(_0x4e35cd,_0x45318a){_0x4e35cd=_0x4e35cd-0x0;var _0x396bad=_0xe3db[_0x4e35cd];return _0x396bad;};'use strict';var VoicePrefixEvents=require(_0xbe3d('0x0'));var events=[_0xbe3d('0x1'),'remove',_0xbe3d('0x2')];function createListener(_0x17c43e,_0x37fcba){return function(_0x411429){_0x37fcba[_0xbe3d('0x3')](_0x17c43e,_0x411429);};}function removeListener(_0x192368,_0x30163d){return function(){VoicePrefixEvents[_0xbe3d('0x4')](_0x192368,_0x30163d);};}exports[_0xbe3d('0x5')]=function(_0xd5a81){for(var _0x2b4c19=0x0,_0x4c255b=events[_0xbe3d('0x6')];_0x2b4c19<_0x4c255b;_0x2b4c19++){var _0x90d1ab=events[_0x2b4c19];var _0x24136a=createListener(_0xbe3d('0x7')+_0x90d1ab,_0xd5a81);VoicePrefixEvents['on'](_0x90d1ab,_0x24136a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index aa5d0ca..7693469 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x4ac41d,_0x797f24){var _0x5b9770=function(_0x164fe4){while(--_0x164fe4){_0x4ac41d['push'](_0x4ac41d['shift']());}};_0x5b9770(++_0x797f24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x290ef5,_0x32cfa7){var _0x450d92=function(_0x4308db){while(--_0x4308db){_0x290ef5['push'](_0x290ef5['shift']());}};_0x450d92(++_0x32cfa7);}(_0xb10b,0x12a));var _0xbb10=function(_0x267f04,_0x18005d){_0x267f04=_0x267f04-0x0;var _0x324621=_0xb10b[_0x267f04];return _0x324621;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index b92581c..a86c5f2 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 _0x0bae=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','inbound','ENUM','ringall','fewestcalls','rrmemory','linear','rrordered','setDataValue','getDataValue','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','join','periodic_announce','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x42b73e,_0x2a8f82){var _0x5d86b6=function(_0x214f46){while(--_0x214f46){_0x42b73e['push'](_0x42b73e['shift']());}};_0x5d86b6(++_0x2a8f82);}(_0x0bae,0x147));var _0xe0ba=function(_0x818b4,_0x5b89e6){_0x818b4=_0x818b4-0x0;var _0x586c89=_0x0bae[_0x818b4];return _0x586c89;};'use strict';var Sequelize=require('sequelize');module[_0xe0ba('0x0')]={'name':{'type':Sequelize[_0xe0ba('0x1')],'allowNull':![],'unique':_0xe0ba('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe0ba('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xe0ba('0x3')},'musiconhold':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe0ba('0x4')]('rr',_0xe0ba('0x5'),'leastrecent',_0xe0ba('0x6'),'random',_0xe0ba('0x7'),_0xe0ba('0x8'),'wrandom',_0xe0ba('0x9')),'allowNull':![],'defaultValue':_0xe0ba('0x5'),'set':function(_0x505019){this[_0xe0ba('0xa')]('strategy',_0x505019?_0x505019:'rrmemory');},'get':function(){var _0xb39225=this[_0xe0ba('0xb')]('type');var _0x4ecdec=this[_0xe0ba('0xb')](_0xe0ba('0xc'));var _0x31baca=this[_0xe0ba('0xb')]('strategy');if(_0xb39225==='inbound'){return _0x31baca;}if(_0x4ecdec===_0xe0ba('0xd')&&_0x31baca===_0xe0ba('0x7')||_0x4ecdec===_0xe0ba('0xd')&&_0x31baca==='roundrobin'){return _0x31baca;}if(_0x4ecdec===_0xe0ba('0xe')||_0x4ecdec===_0xe0ba('0xf')||_0x4ecdec===_0xe0ba('0x10')){return _0x31baca;}return null;}},'servicelevel':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe0ba('0x11')](0xb)},'timeout':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe0ba('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe0ba('0x4')]('yes','no'),'defaultValue':_0xe0ba('0x12')},'autopause':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no',_0xe0ba('0x13')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe0ba('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xe0ba('0x12'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe0ba('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no'),'defaultValue':_0xe0ba('0x12')},'announce_holdtime':{'type':Sequelize[_0xe0ba('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe0ba('0x12'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe0ba('0x1')]},'queue_youarenext':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe0ba('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xe0ba('0x1')]},'queue_quantity2':{'type':Sequelize[_0xe0ba('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x47f781){this[_0xe0ba('0xa')]('periodic_announce',_0x47f781?_0x47f781[_0xe0ba('0x14')](','):[]);},'get':function(){return this['getDataValue'](_0xe0ba('0x15'))?this[_0xe0ba('0xb')](_0xe0ba('0x15'))[_0xe0ba('0x16')](','):[];}},'joinempty':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':'yes','set':function(_0x253523){this[_0xe0ba('0xa')](_0xe0ba('0x17'),_0x253523?_0x253523[_0xe0ba('0x14')](','):undefined);},'get':function(){return this[_0xe0ba('0xb')]('joinempty')?this['getDataValue'](_0xe0ba('0x17'))[_0xe0ba('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x30b195){this[_0xe0ba('0xa')]('leavewhenempty',_0x30b195?_0x30b195[_0xe0ba('0x14')](','):undefined);},'get':function(){return this[_0xe0ba('0xb')](_0xe0ba('0x18'))?this['getDataValue']('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe0ba('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x12'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe0ba('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x47bb64){this[_0xe0ba('0xa')]('acw',_0x47bb64);if(_0x47bb64){if(this[_0xe0ba('0xb')](_0xe0ba('0x19'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe0ba('0x11')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe0ba('0x1a')],'defaultValue':0x0,'comment':_0xe0ba('0x1b')},'dialMethod':{'type':Sequelize['ENUM'](_0xe0ba('0x1c'),'progressive',_0xe0ba('0x10'),'predictive',_0xe0ba('0xd')),'defaultValue':_0xe0ba('0xe'),'comment':_0xe0ba('0x1d')},'dialLimitChannel':{'type':Sequelize[_0xe0ba('0x11')](0x4)[_0xe0ba('0x1e')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe0ba('0x1f')},'dialLimitQueue':{'type':Sequelize[_0xe0ba('0x11')](0x4)[_0xe0ba('0x1e')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe0ba('0x20')},'dialPowerLevel':{'type':Sequelize[_0xe0ba('0x21')](0x2)[_0xe0ba('0x1e')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x22'),'dropRate'),'defaultValue':_0xe0ba('0x23'),'comment':_0xe0ba('0x24')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe0ba('0x21')](0x2)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe0ba('0x25')},'dialPredictiveInterval':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe0ba('0x26')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe0ba('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe0ba('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':'tTxX','comment':_0xe0ba('0x27')},'dialQueueTimeout':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x28')},'dialQueueProject':{'type':Sequelize[_0xe0ba('0x1')],'comment':_0xe0ba('0x29')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x2a')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x2b')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe0ba('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe0ba('0x30')},'dialTimezone':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':_0xe0ba('0x31')},'dialPrefix':{'type':Sequelize[_0xe0ba('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe0ba('0x4')](_0xe0ba('0x32'),_0xe0ba('0x33'),_0xe0ba('0x34')),'defaultValue':_0xe0ba('0x32')},'dialAMDActive':{'type':Sequelize[_0xe0ba('0x1a')],'defaultValue':0x0,'comment':_0xe0ba('0x35')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe0ba('0x1e')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe0ba('0x36')},'dialAMDGreeting':{'type':Sequelize[_0xe0ba('0x11')](0x9)[_0xe0ba('0x1e')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe0ba('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe0ba('0x11')](0x9)[_0xe0ba('0x1e')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe0ba('0x11')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe0ba('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0xe0ba('0x11')](0x9)[_0xe0ba('0x1e')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe0ba('0x11')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe0ba('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe0ba('0x11')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe0ba('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe0ba('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe0ba('0x11')](0x9)[_0xe0ba('0x1e')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe0ba('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe0ba('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0xe0ba('0x1a')],'defaultValue':0x0,'comment':_0xe0ba('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xe0ba('0x3f'),_0xe0ba('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xe0ba('0x1')],'comment':_0xe0ba('0x29')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe0ba('0x1a')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe0ba('0x1a')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe0ba('0x1e')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe0ba('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xe0ba('0x1e')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe0ba('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe0ba('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe0ba('0x11')](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe0ba('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe0ba('0x1e')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe0ba('0x11')],'allowNull':!![],'comment':_0xe0ba('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe0ba('0x4c'),'set':function(_0x408142){if(!_0x408142)this[_0xe0ba('0xa')](_0xe0ba('0x4d'),null);this[_0xe0ba('0xa')](_0xe0ba('0x4e'),_0x408142);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe0ba('0x1e')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe0ba('0x11')](0x3)[_0xe0ba('0x1e')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4c00=['sequelize','exports','name','ENUM','outbound','inbound','STRING','default','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x46004b,_0x88bb15){var _0x214fa4=function(_0x41e830){while(--_0x41e830){_0x46004b['push'](_0x46004b['shift']());}};_0x214fa4(++_0x88bb15);}(_0x4c00,0x1c2));var _0x04c0=function(_0x462729,_0x226b5a){_0x462729=_0x462729-0x0;var _0x107767=_0x4c00[_0x462729];return _0x107767;};'use strict';var Sequelize=require(_0x04c0('0x0'));module[_0x04c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x04c0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x04c0('0x3')]('inbound',_0x04c0('0x4')),'allowNull':![],'defaultValue':_0x04c0('0x5')},'musiconhold':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':_0x04c0('0x7')},'announce':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x04c0('0x3')]('rr',_0x04c0('0x8'),_0x04c0('0x9'),_0x04c0('0xa'),'random','rrmemory',_0x04c0('0xb'),_0x04c0('0xc'),_0x04c0('0xd')),'allowNull':![],'defaultValue':_0x04c0('0x8'),'set':function(_0x1ffe24){this[_0x04c0('0xe')](_0x04c0('0xf'),_0x1ffe24?_0x1ffe24:_0x04c0('0x10'));},'get':function(){var _0x27ca70=this[_0x04c0('0x11')](_0x04c0('0x12'));var _0x4f5a26=this[_0x04c0('0x11')](_0x04c0('0x13'));var _0x38f6a6=this[_0x04c0('0x11')](_0x04c0('0xf'));if(_0x27ca70===_0x04c0('0x5')){return _0x38f6a6;}if(_0x4f5a26===_0x04c0('0x14')&&_0x38f6a6===_0x04c0('0x10')||_0x4f5a26==='booked'&&_0x38f6a6===_0x04c0('0x15')){return _0x38f6a6;}if(_0x4f5a26==='progressive'||_0x4f5a26==='predictive'||_0x4f5a26==='power'){return _0x38f6a6;}return null;}},'servicelevel':{'type':Sequelize[_0x04c0('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x04c0('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x04c0('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x04c0('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x04c0('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no',_0x04c0('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x04c0('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x04c0('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x04c0('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x04c0('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x04c0('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x04c0('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':_0x04c0('0x17')},'announce_holdtime':{'type':Sequelize[_0x04c0('0x3')]('yes','no',_0x04c0('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x04c0('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x04c0('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x04c0('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x04c0('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x04c0('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x04c0('0x6')]},'queue_quantity1':{'type':Sequelize[_0x04c0('0x6')]},'queue_quantity2':{'type':Sequelize[_0x04c0('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x04c0('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x52eef2){this[_0x04c0('0xe')](_0x04c0('0x1a'),_0x52eef2?_0x52eef2[_0x04c0('0x1b')](','):[]);},'get':function(){return this[_0x04c0('0x11')](_0x04c0('0x1a'))?this[_0x04c0('0x11')](_0x04c0('0x1a'))[_0x04c0('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x36e5d3){this['setDataValue']('joinempty',_0x36e5d3?_0x36e5d3['join'](','):undefined);},'get':function(){return this[_0x04c0('0x11')]('joinempty')?this['getDataValue'](_0x04c0('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':'no','set':function(_0x244274){this[_0x04c0('0xe')]('leavewhenempty',_0x244274?_0x244274[_0x04c0('0x1b')](','):undefined);},'get':function(){return this[_0x04c0('0x11')](_0x04c0('0x1e'))?this[_0x04c0('0x11')]('leavewhenempty')[_0x04c0('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x04c0('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x04c0('0x6')]},'description':{'type':Sequelize[_0x04c0('0x6')]},'acw':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':0x0,'set':function(_0x19e388){this[_0x04c0('0xe')]('acw',_0x19e388);if(_0x19e388){if(this[_0x04c0('0x11')]('wrapuptime')<0x2){this[_0x04c0('0xe')](_0x04c0('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x04c0('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x04c0('0x21')},'dialMethod':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x22'),_0x04c0('0x23'),_0x04c0('0x24'),_0x04c0('0x25'),'booked'),'defaultValue':_0x04c0('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x04c0('0x16')](0x4)[_0x04c0('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x04c0('0x27')},'dialLimitQueue':{'type':Sequelize[_0x04c0('0x16')](0x4)[_0x04c0('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x04c0('0x28')},'dialPowerLevel':{'type':Sequelize[_0x04c0('0x29')](0x2)[_0x04c0('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x04c0('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x2b'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x04c0('0x29')](0x2)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x04c0('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x04c0('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x04c0('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04c0('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':_0x04c0('0x2f'),'comment':_0x04c0('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04c0('0x31')},'dialQueueProject':{'type':Sequelize[_0x04c0('0x6')],'comment':_0x04c0('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x04c0('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x04c0('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x04c0('0x3')](_0x04c0('0x37'),_0x04c0('0x38'),_0x04c0('0x39')),'defaultValue':_0x04c0('0x37')},'dialAMDActive':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x04c0('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x04c0('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x04c0('0x16')](0x9)[_0x04c0('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x04c0('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x04c0('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x04c0('0x16')](0x9)[_0x04c0('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x04c0('0x16')](0x9)[_0x04c0('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x04c0('0x16')](0x9)[_0x04c0('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x04c0('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x04c0('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x04c0('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x04c0('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x04c0('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x04c0('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':0x0,'comment':_0x04c0('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x04c0('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x04c0('0x41')},'dialCutDigit':{'type':Sequelize[_0x04c0('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04c0('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04c0('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04c0('0x46')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04c0('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x04c0('0x16')](0x5)[_0x04c0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04c0('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':![],'comment':_0x04c0('0x48'),'set':function(_0x2566ff){if(!_0x2566ff)this['setDataValue'](_0x04c0('0x49'),null);this[_0x04c0('0xe')](_0x04c0('0x4a'),_0x2566ff);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x04c0('0x16')](0x3)[_0x04c0('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x04c0('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x04c0('0x1f')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index f973484..15a320f 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 _0x9d88=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','catch','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','VoiceQueues','params','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','penalty','sequelize','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','compact','transaction','UserVoiceQueueRt','addAgents','omit','spread','isEmpty','online','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','CmHopperBlack','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x9d88,0x9f));var _0x89d8=function(_0x2fafbf,_0x43253b){_0x2fafbf=_0x2fafbf-0x0;var _0x30a39d=_0x9d88[_0x2fafbf];return _0x30a39d;};'use strict';var emlformat=require(_0x89d8('0x0'));var rimraf=require(_0x89d8('0x1'));var zipdir=require(_0x89d8('0x2'));var jsonpatch=require(_0x89d8('0x3'));var rp=require(_0x89d8('0x4'));var moment=require(_0x89d8('0x5'));var BPromise=require(_0x89d8('0x6'));var Mustache=require(_0x89d8('0x7'));var util=require(_0x89d8('0x8'));var path=require(_0x89d8('0x9'));var sox=require(_0x89d8('0xa'));var csv=require('to-csv');var ejs=require(_0x89d8('0xb'));var fs=require('fs');var fs_extra=require(_0x89d8('0xc'));var _=require(_0x89d8('0xd'));var squel=require(_0x89d8('0xe'));var crypto=require(_0x89d8('0xf'));var jsforce=require(_0x89d8('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x89d8('0x11'));var Redis=require(_0x89d8('0x12'));var authService=require(_0x89d8('0x13'));var qs=require(_0x89d8('0x14'));var as=require(_0x89d8('0x15'));var hardwareService=require(_0x89d8('0x16'));var logger=require(_0x89d8('0x17'))(_0x89d8('0x18'));var utils=require('../../config/utils');var config=require(_0x89d8('0x19'));var licenseUtil=require(_0x89d8('0x1a'));var db=require(_0x89d8('0x1b'))['db'];config['redis']=_[_0x89d8('0x1c')](config[_0x89d8('0x1d')],{'host':_0x89d8('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89d8('0x1d')]));require(_0x89d8('0x1f'))[_0x89d8('0x20')](socket);function respondWithStatusCode(_0x176d2a,_0x3ce471){_0x3ce471=_0x3ce471||0xcc;return function(_0x6d6702){if(_0x6d6702){return _0x176d2a[_0x89d8('0x21')](_0x3ce471);}return _0x176d2a[_0x89d8('0x22')](_0x3ce471)[_0x89d8('0x23')]();};}function respondWithResult(_0x59ba6b,_0x16f309){_0x16f309=_0x16f309||0xc8;return function(_0x31f1b8){if(_0x31f1b8){return _0x59ba6b[_0x89d8('0x22')](_0x16f309)[_0x89d8('0x24')](_0x31f1b8);}};}function respondWithFilteredResult(_0x194eac,_0xda9ac4){return function(_0x56a678){if(_0x56a678){var _0x480297=typeof _0xda9ac4[_0x89d8('0x25')]===_0x89d8('0x26')&&typeof _0xda9ac4[_0x89d8('0x27')]===_0x89d8('0x26');var _0x26179c=_0x56a678['count'];var _0x55b3dc=_0x480297?0x0:_0xda9ac4[_0x89d8('0x25')];var _0x7dc15a=_0x480297?_0x56a678[_0x89d8('0x28')]:_0xda9ac4[_0x89d8('0x25')]+_0xda9ac4['limit'];var _0x3528cd;if(_0x7dc15a>=_0x26179c){_0x7dc15a=_0x26179c;_0x3528cd=0xc8;}else{_0x3528cd=0xce;}_0x194eac[_0x89d8('0x22')](_0x3528cd);return _0x194eac['set'](_0x89d8('0x29'),_0x55b3dc+'-'+_0x7dc15a+'/'+_0x26179c)[_0x89d8('0x24')](_0x56a678);}return null;};}function patchUpdates(_0x5e89cc){return function(_0x5dae71){try{jsonpatch[_0x89d8('0x2a')](_0x5dae71,_0x5e89cc,!![]);}catch(_0x1c266e){return BPromise[_0x89d8('0x2b')](_0x1c266e);}return _0x5dae71[_0x89d8('0x2c')]();};}function saveUpdates(_0x3e40a6,_0x2ea9da){return function(_0x37f738){if(_0x37f738){return _0x37f738[_0x89d8('0x2d')](_0x3e40a6)[_0x89d8('0x2e')](function(_0x42e943){return _0x42e943;});}return null;};}function removeEntity(_0x1e7551,_0x135cf3){return function(_0xfb111c){if(_0xfb111c){return _0xfb111c[_0x89d8('0x2f')]()['then'](function(){var _0x57dd27=_0xfb111c[_0x89d8('0x30')]({'plain':!![]});var _0x18a665=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x89d8('0x31'),'value':_0x89d8('0x32'),'ignore':![]}];var _0x27c330=_(_0x18a665)[_0x89d8('0x33')](_0x89d8('0x34'))[_0x89d8('0x35')](_0x89d8('0x36'))[_0x89d8('0x36')]();if(_[_0x89d8('0x37')](_0x27c330,_0x57dd27[_0x89d8('0x38')])){return;}var _0x2848b6=_[_0x89d8('0x39')](_0x18a665,[_0x89d8('0x36'),_0x57dd27[_0x89d8('0x38')]])[_0x89d8('0x3a')];return db[_0x89d8('0x3b')][_0x89d8('0x2f')]({'where':{'type':_0x2848b6,'resourceId':_0x57dd27['id']}})['then'](function(){return _0xfb111c;});})['then'](function(){_0x1e7551[_0x89d8('0x22')](0xcc)[_0x89d8('0x23')]();});}};}function handleEntityNotFound(_0x58e33c,_0x242145){return function(_0x49b6cd){if(!_0x49b6cd){_0x58e33c[_0x89d8('0x21')](0x194);}return _0x49b6cd;};}function handleError(_0x68f91c,_0x473953){_0x473953=_0x473953||0x1f4;return function(_0x49999c){logger[_0x89d8('0x3c')](_0x49999c[_0x89d8('0x3d')]);if(_0x49999c[_0x89d8('0x3a')]){delete _0x49999c[_0x89d8('0x3a')];}_0x68f91c[_0x89d8('0x22')](_0x473953)[_0x89d8('0x3e')](_0x49999c);};}exports[_0x89d8('0x3f')]=function(_0x2f5ee5,_0x43c843){var _0x42c218={},_0x47980f={},_0x1c5942={'count':0x0,'rows':[]};var _0x289139=_[_0x89d8('0x35')](db[_0x89d8('0x40')][_0x89d8('0x41')],function(_0x5a10f8){return{'name':_0x5a10f8[_0x89d8('0x42')],'type':_0x5a10f8[_0x89d8('0x38')][_0x89d8('0x43')]};});_0x47980f[_0x89d8('0x44')]=_['map'](_0x289139,_0x89d8('0x3a'));_0x47980f[_0x89d8('0x45')]=_[_0x89d8('0x46')](_0x2f5ee5[_0x89d8('0x45')]);_0x47980f['filters']=_[_0x89d8('0x47')](_0x47980f[_0x89d8('0x44')],_0x47980f[_0x89d8('0x45')]);_0x42c218[_0x89d8('0x48')]=_['intersection'](_0x47980f[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0x2f5ee5[_0x89d8('0x45')]['fields']));_0x42c218['attributes']=_0x42c218[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x42c218[_0x89d8('0x48')]:_0x47980f[_0x89d8('0x44')];if(!_0x2f5ee5[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x42c218[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x2f5ee5[_0x89d8('0x45')][_0x89d8('0x27')]);_0x42c218[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0x2f5ee5[_0x89d8('0x45')][_0x89d8('0x25')]);}_0x42c218[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x2f5ee5[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x42c218[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x2f5ee5[_0x89d8('0x45')],_0x47980f[_0x89d8('0x50')]),_0x289139);if(_0x2f5ee5['query'][_0x89d8('0x33')]){_0x42c218[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x42c218['where'],{'$or':_[_0x89d8('0x35')](_0x289139,function(_0x383e12){if(_0x383e12[_0x89d8('0x38')]!==_0x89d8('0x53')){var _0x3cb8f9={};_0x3cb8f9[_0x383e12[_0x89d8('0x3a')]]={'$like':'%'+_0x2f5ee5[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0x3cb8f9;}})});}_0x42c218=_['merge']({},_0x42c218,_0x2f5ee5[_0x89d8('0x54')]);var _0x46bc2f={'where':_0x42c218[_0x89d8('0x4f')]};return db[_0x89d8('0x40')][_0x89d8('0x28')](_0x46bc2f)[_0x89d8('0x2e')](function(_0x371e8f){_0x1c5942[_0x89d8('0x28')]=_0x371e8f;if(_0x2f5ee5['query'][_0x89d8('0x55')]){_0x42c218['include']=[{'all':!![]}];}return db[_0x89d8('0x40')][_0x89d8('0x56')](_0x42c218);})[_0x89d8('0x2e')](function(_0x3f5efe){_0x1c5942['rows']=_0x3f5efe;return _0x1c5942;})[_0x89d8('0x2e')](respondWithFilteredResult(_0x43c843,_0x42c218))[_0x89d8('0x57')](handleError(_0x43c843,null));};exports['show']=function(_0x4d1db0,_0x5dd720){var _0x4f8050={'raw':![],'where':{'id':_0x4d1db0['params']['id']}},_0x5e2128={};_0x5e2128[_0x89d8('0x44')]=_[_0x89d8('0x46')](db[_0x89d8('0x40')][_0x89d8('0x41')]);_0x5e2128['query']=_[_0x89d8('0x46')](_0x4d1db0[_0x89d8('0x45')]);_0x5e2128[_0x89d8('0x50')]=_['intersection'](_0x5e2128['model'],_0x5e2128[_0x89d8('0x45')]);_0x4f8050[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x5e2128['model'],qs[_0x89d8('0x49')](_0x4d1db0['query'][_0x89d8('0x49')]));_0x4f8050[_0x89d8('0x48')]=_0x4f8050[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x4f8050[_0x89d8('0x48')]:_0x5e2128[_0x89d8('0x44')];if(_0x4d1db0[_0x89d8('0x45')][_0x89d8('0x55')]){_0x4f8050[_0x89d8('0x58')]=[{'all':!![]}];}_0x4f8050=_[_0x89d8('0x52')]({},_0x4f8050,_0x4d1db0[_0x89d8('0x54')]);return db[_0x89d8('0x40')][_0x89d8('0x39')](_0x4f8050)[_0x89d8('0x2e')](handleEntityNotFound(_0x5dd720,null))['then'](respondWithResult(_0x5dd720,null))['catch'](handleError(_0x5dd720,null));};exports['create']=function(_0xa3e659,_0x3654af){return db['VoiceQueue'][_0x89d8('0x59')](_0xa3e659[_0x89d8('0x5a')],{})[_0x89d8('0x2e')](function(_0x57d719){var _0x59b4f3=_0xa3e659['user'][_0x89d8('0x30')]({'plain':!![]});if(!_0x59b4f3)throw new Error(_0x89d8('0x5b'));if(_0x59b4f3[_0x89d8('0x5c')]===_0x89d8('0x5d')){var _0x36fea8=_0x57d719[_0x89d8('0x30')]({'plain':!![]});var _0x10f833=[{'name':'VoiceQueues','value':_0x89d8('0x5e')},{'name':_0x89d8('0x31'),'value':_0x89d8('0x32')}];var _0x3d9766=_[_0x89d8('0x39')](_0x10f833,[_0x89d8('0x36'),_0x36fea8[_0x89d8('0x38')]])['name'];return db[_0x89d8('0x5f')][_0x89d8('0x39')]({'where':{'name':_0x3d9766,'userProfileId':_0x59b4f3[_0x89d8('0x60')]},'raw':!![]})[_0x89d8('0x2e')](function(_0x46dd42){if(_0x46dd42&&_0x46dd42[_0x89d8('0x61')]===0x0){return db['UserProfileResource'][_0x89d8('0x59')]({'name':_0x36fea8[_0x89d8('0x3a')],'resourceId':_0x36fea8['id'],'type':_0x46dd42['name'],'sectionId':_0x46dd42['id']},{})[_0x89d8('0x2e')](function(){return _0x57d719;});}else{return _0x57d719;}})['catch'](function(_0x23c77f){logger[_0x89d8('0x3c')](_0x89d8('0x62'),_0x23c77f);throw _0x23c77f;});}return _0x57d719;})[_0x89d8('0x2e')](respondWithResult(_0x3654af,0xc9))[_0x89d8('0x57')](handleError(_0x3654af,null));};exports['clone']=function(_0x359fda,_0x3ba832){var _0x5e5b95={'where':{'id':_0x359fda['params']['id']}},_0x1a9121={};_0x1a9121['model']=_['keys'](db[_0x89d8('0x40')]['rawAttributes']);_0x5e5b95[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x1a9121[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0x359fda['query'][_0x89d8('0x49')]));_0x5e5b95[_0x89d8('0x48')]=_0x5e5b95[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x5e5b95['attributes']:_0x1a9121[_0x89d8('0x44')];if(_0x359fda[_0x89d8('0x45')][_0x89d8('0x55')]){_0x5e5b95[_0x89d8('0x58')]=[{'all':!![]}];}_0x5e5b95=_['merge']({},_0x5e5b95,_0x359fda['options']);return db['VoiceQueue'][_0x89d8('0x39')](_0x5e5b95)[_0x89d8('0x2e')](handleEntityNotFound(_0x3ba832,null))[_0x89d8('0x2e')](function(_0x5bfc2b){if(_0x5bfc2b){var _0x319137=_0x5bfc2b[_0x89d8('0x30')]({'plain':!![]});_0x319137=qs['omit'](_0x319137,['id',_0x89d8('0x63'),'updatedAt']);_0x359fda['body']=_['omit'](_0x359fda[_0x89d8('0x5a')],['id',_0x89d8('0x63'),_0x89d8('0x64')]);return db[_0x89d8('0x40')][_0x89d8('0x59')](_[_0x89d8('0x52')](_0x319137,_0x359fda[_0x89d8('0x5a')]),{'include':_0x359fda['query'][_0x89d8('0x55')]?[{'all':!![]}]:undefined})['then'](function(_0x1593e4){var _0x56a8ae=_0x359fda[_0x89d8('0x5d')][_0x89d8('0x30')]({'plain':!![]});if(!_0x56a8ae)throw new Error(_0x89d8('0x5b'));if(_0x56a8ae['role']===_0x89d8('0x5d')){var _0x4f7f2c=_0x1593e4[_0x89d8('0x30')]({'plain':!![]});var _0x58cc7f=[{'name':_0x89d8('0x65'),'value':_0x89d8('0x5e')},{'name':_0x89d8('0x31'),'value':_0x89d8('0x32')}];var _0x2f4287=_[_0x89d8('0x39')](_0x58cc7f,[_0x89d8('0x36'),_0x4f7f2c['type']])[_0x89d8('0x3a')];return db[_0x89d8('0x5f')][_0x89d8('0x39')]({'where':{'name':_0x2f4287,'userProfileId':_0x56a8ae['userProfileId']},'raw':!![]})[_0x89d8('0x2e')](function(_0x15d1f8){if(_0x15d1f8&&_0x15d1f8[_0x89d8('0x61')]===0x0){return db['UserProfileResource'][_0x89d8('0x59')]({'name':_0x4f7f2c[_0x89d8('0x3a')],'resourceId':_0x4f7f2c['id'],'type':_0x15d1f8[_0x89d8('0x3a')],'sectionId':_0x15d1f8['id']},{})[_0x89d8('0x2e')](function(){return _0x1593e4;});}else{return _0x1593e4;}})[_0x89d8('0x57')](function(_0x131681){logger[_0x89d8('0x3c')](_0x89d8('0x62'),_0x131681);throw _0x131681;});}return _0x1593e4;});}})[_0x89d8('0x2e')](respondWithResult(_0x3ba832,0xc9))[_0x89d8('0x57')](handleError(_0x3ba832,null));};exports['update']=function(_0x3574fa,_0x5a45eb){if(_0x3574fa[_0x89d8('0x5a')]['id']){delete _0x3574fa['body']['id'];}return db[_0x89d8('0x40')]['find']({'where':{'id':_0x3574fa[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x5a45eb,null))[_0x89d8('0x2e')](saveUpdates(_0x3574fa[_0x89d8('0x5a')],null))[_0x89d8('0x2e')](respondWithResult(_0x5a45eb,null))[_0x89d8('0x57')](handleError(_0x5a45eb,null));};exports['destroy']=function(_0x4d3a2f,_0x32abf5){return db['VoiceQueue'][_0x89d8('0x39')]({'where':{'id':_0x4d3a2f[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x32abf5,null))[_0x89d8('0x2e')](removeEntity(_0x32abf5,null))[_0x89d8('0x57')](handleError(_0x32abf5,null));};exports[_0x89d8('0x67')]=function(_0x4fe1aa,_0x26d3ef,_0x8a841d){var _0x45c5e3={'raw':![],'where':{}};var _0x515cf3={};var _0x451a53={'count':0x0,'rows':[]};return db[_0x89d8('0x40')][_0x89d8('0x68')]({'where':{'id':_0x4fe1aa[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x26d3ef,null))[_0x89d8('0x2e')](function(_0x204965){if(_0x204965){_0x515cf3['model']=_['keys'](db[_0x89d8('0x69')][_0x89d8('0x41')]);_0x515cf3['query']=_[_0x89d8('0x46')](_0x4fe1aa[_0x89d8('0x45')]);_0x515cf3[_0x89d8('0x50')]=_['intersection'](_0x515cf3[_0x89d8('0x44')],_0x515cf3[_0x89d8('0x45')]);_0x45c5e3[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x515cf3[_0x89d8('0x44')],qs['fields'](_0x4fe1aa[_0x89d8('0x45')]['fields']));_0x45c5e3['attributes']=_0x45c5e3['attributes'][_0x89d8('0x4a')]?_0x45c5e3[_0x89d8('0x48')]:_0x515cf3['model'];if(!_0x4fe1aa[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x45c5e3[_0x89d8('0x27')]=qs['limit'](_0x4fe1aa['query'][_0x89d8('0x27')]);_0x45c5e3['offset']=qs[_0x89d8('0x25')](_0x4fe1aa[_0x89d8('0x45')][_0x89d8('0x25')]);}_0x45c5e3[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x4fe1aa[_0x89d8('0x45')]['sort']);_0x45c5e3[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x4fe1aa[_0x89d8('0x45')],_0x515cf3[_0x89d8('0x50')]));_0x45c5e3[_0x89d8('0x4f')][_0x89d8('0x6a')]=_0x204965['id'];if(_0x4fe1aa[_0x89d8('0x45')][_0x89d8('0x33')]){_0x45c5e3[_0x89d8('0x4f')]=_['merge'](_0x45c5e3[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x45c5e3[_0x89d8('0x48')],function(_0x4555a1){var _0x5b467={};_0x5b467[_0x4555a1]={'$like':'%'+_0x4fe1aa[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0x5b467;})});}_0x45c5e3=_['merge']({},_0x45c5e3,_0x4fe1aa['options']);return db['CmHopper']['count']({'where':_0x45c5e3[_0x89d8('0x4f')]})['then'](function(_0x1da547){_0x451a53['count']=_0x1da547;if(_0x4fe1aa[_0x89d8('0x45')][_0x89d8('0x55')]){_0x45c5e3[_0x89d8('0x58')]=[{'all':!![]}];}return db['CmHopper'][_0x89d8('0x56')](_0x45c5e3);})['then'](function(_0x3ec495){_0x451a53[_0x89d8('0x6b')]=_0x3ec495;return _0x451a53;});}})[_0x89d8('0x2e')](respondWithFilteredResult(_0x26d3ef,_0x45c5e3))[_0x89d8('0x57')](handleError(_0x26d3ef,null));};exports[_0x89d8('0x6c')]=function(_0xa4821f,_0x333a31,_0x2fdbb8){var _0x507635={'raw':!![],'where':{}};var _0x555e28={};var _0x42f53c={'count':0x0,'rows':[]};return db[_0x89d8('0x40')]['findOne']({'where':{'id':_0xa4821f[_0x89d8('0x66')]['id']}})['then'](handleEntityNotFound(_0x333a31,null))[_0x89d8('0x2e')](function(_0x52fa98){if(_0x52fa98){_0x555e28[_0x89d8('0x44')]=_[_0x89d8('0x46')](db[_0x89d8('0x6d')]['rawAttributes']);_0x555e28[_0x89d8('0x45')]=_['keys'](_0xa4821f['query']);_0x555e28['filters']=_['intersection'](_0x555e28[_0x89d8('0x44')],_0x555e28['query']);_0x507635[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x555e28[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0xa4821f[_0x89d8('0x45')][_0x89d8('0x49')]));_0x507635['attributes']=_0x507635[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x507635['attributes']:_0x555e28['model'];if(!_0xa4821f['query'][_0x89d8('0x4b')]('nolimit')){_0x507635['limit']=qs[_0x89d8('0x27')](_0xa4821f[_0x89d8('0x45')][_0x89d8('0x27')]);_0x507635[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0xa4821f['query'][_0x89d8('0x25')]);}_0x507635[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0xa4821f[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x507635[_0x89d8('0x4f')]=qs['filters'](_[_0x89d8('0x51')](_0xa4821f[_0x89d8('0x45')],_0x555e28[_0x89d8('0x50')]));_0x507635[_0x89d8('0x4f')][_0x89d8('0x6a')]=_0x52fa98['id'];if(_0xa4821f[_0x89d8('0x45')][_0x89d8('0x33')]){_0x507635[_0x89d8('0x4f')]=_['merge'](_0x507635['where'],{'$or':_[_0x89d8('0x35')](_0x507635[_0x89d8('0x48')],function(_0x300de9){var _0xb34f52={};_0xb34f52[_0x300de9]={'$like':'%'+_0xa4821f[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0xb34f52;})});}_0x507635=_[_0x89d8('0x52')]({},_0x507635,_0xa4821f[_0x89d8('0x54')]);return db[_0x89d8('0x6d')][_0x89d8('0x28')]({'where':_0x507635['where']})[_0x89d8('0x2e')](function(_0x213e7c){_0x42f53c[_0x89d8('0x28')]=_0x213e7c;if(_0xa4821f[_0x89d8('0x45')][_0x89d8('0x55')]){_0x507635[_0x89d8('0x58')]=[{'all':!![]}];}return db[_0x89d8('0x6d')][_0x89d8('0x56')](_0x507635);})[_0x89d8('0x2e')](function(_0x4f2dee){_0x42f53c['rows']=_0x4f2dee;return _0x42f53c;});}})[_0x89d8('0x2e')](respondWithFilteredResult(_0x333a31,_0x507635))[_0x89d8('0x57')](handleError(_0x333a31,null));};exports[_0x89d8('0x6e')]=function(_0x48c2ae,_0x34ee72,_0x21aa64){var _0x5be2e4={'raw':!![],'where':{}};var _0x230cdc={};var _0xec93d4={'count':0x0,'rows':[]};return db[_0x89d8('0x40')][_0x89d8('0x68')]({'where':{'id':_0x48c2ae[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x34ee72,null))[_0x89d8('0x2e')](function(_0x1949aa){if(_0x1949aa){_0x230cdc[_0x89d8('0x44')]=_[_0x89d8('0x46')](db[_0x89d8('0x6f')][_0x89d8('0x41')]);_0x230cdc[_0x89d8('0x45')]=_[_0x89d8('0x46')](_0x48c2ae[_0x89d8('0x45')]);_0x230cdc['filters']=_[_0x89d8('0x47')](_0x230cdc[_0x89d8('0x44')],_0x230cdc[_0x89d8('0x45')]);_0x5be2e4[_0x89d8('0x48')]=_['intersection'](_0x230cdc[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0x48c2ae[_0x89d8('0x45')][_0x89d8('0x49')]));_0x5be2e4[_0x89d8('0x48')]=_0x5be2e4['attributes'][_0x89d8('0x4a')]?_0x5be2e4[_0x89d8('0x48')]:_0x230cdc[_0x89d8('0x44')];if(!_0x48c2ae[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x5be2e4[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x48c2ae['query']['limit']);_0x5be2e4[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0x48c2ae[_0x89d8('0x45')]['offset']);}_0x5be2e4[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x48c2ae[_0x89d8('0x45')]['sort']);_0x5be2e4[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x48c2ae[_0x89d8('0x45')],_0x230cdc[_0x89d8('0x50')]));_0x5be2e4[_0x89d8('0x4f')][_0x89d8('0x6a')]=_0x1949aa['id'];if(_0x48c2ae[_0x89d8('0x45')][_0x89d8('0x33')]){_0x5be2e4[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x5be2e4[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x5be2e4[_0x89d8('0x48')],function(_0x576746){var _0x2f2d4b={};_0x2f2d4b[_0x576746]={'$like':'%'+_0x48c2ae[_0x89d8('0x45')]['filter']+'%'};return _0x2f2d4b;})});}_0x5be2e4=_[_0x89d8('0x52')]({},_0x5be2e4,_0x48c2ae[_0x89d8('0x54')]);return db[_0x89d8('0x6f')][_0x89d8('0x28')]({'where':_0x5be2e4[_0x89d8('0x4f')]})['then'](function(_0x1bd4f3){_0xec93d4[_0x89d8('0x28')]=_0x1bd4f3;if(_0x48c2ae['query'][_0x89d8('0x55')]){_0x5be2e4[_0x89d8('0x58')]=[{'all':!![]}];}return db[_0x89d8('0x6f')][_0x89d8('0x56')](_0x5be2e4);})[_0x89d8('0x2e')](function(_0x286f32){_0xec93d4[_0x89d8('0x6b')]=_0x286f32;return _0xec93d4;});}})[_0x89d8('0x2e')](respondWithFilteredResult(_0x34ee72,_0x5be2e4))[_0x89d8('0x57')](handleError(_0x34ee72,null));};exports['getHopperBlacks']=function(_0xc48233,_0x53b7df,_0x5453ee){var _0x5e85ee={'raw':!![],'where':{}};var _0x6285ef={};var _0x3a8e65={'count':0x0,'rows':[]};return db[_0x89d8('0x40')][_0x89d8('0x68')]({'where':{'id':_0xc48233[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x53b7df,null))[_0x89d8('0x2e')](function(_0x2becf4){if(_0x2becf4){_0x6285ef[_0x89d8('0x44')]=_[_0x89d8('0x46')](db['CmHopperBlack'][_0x89d8('0x41')]);_0x6285ef['query']=_['keys'](_0xc48233[_0x89d8('0x45')]);_0x6285ef[_0x89d8('0x50')]=_['intersection'](_0x6285ef['model'],_0x6285ef[_0x89d8('0x45')]);_0x5e85ee['attributes']=_[_0x89d8('0x47')](_0x6285ef[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0xc48233[_0x89d8('0x45')][_0x89d8('0x49')]));_0x5e85ee[_0x89d8('0x48')]=_0x5e85ee[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x5e85ee[_0x89d8('0x48')]:_0x6285ef[_0x89d8('0x44')];if(!_0xc48233[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x5e85ee[_0x89d8('0x27')]=qs['limit'](_0xc48233['query']['limit']);_0x5e85ee[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0xc48233[_0x89d8('0x45')][_0x89d8('0x25')]);}_0x5e85ee[_0x89d8('0x4d')]=qs['sort'](_0xc48233[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x5e85ee[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0xc48233[_0x89d8('0x45')],_0x6285ef[_0x89d8('0x50')]));_0x5e85ee[_0x89d8('0x4f')]['VoiceQueueId']=_0x2becf4['id'];if(_0xc48233[_0x89d8('0x45')][_0x89d8('0x33')]){_0x5e85ee['where']=_[_0x89d8('0x52')](_0x5e85ee[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x5e85ee[_0x89d8('0x48')],function(_0x4d7cee){var _0x44941d={};_0x44941d[_0x4d7cee]={'$like':'%'+_0xc48233[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0x44941d;})});}_0x5e85ee=_[_0x89d8('0x52')]({},_0x5e85ee,_0xc48233[_0x89d8('0x54')]);return db['CmHopperBlack'][_0x89d8('0x28')]({'where':_0x5e85ee[_0x89d8('0x4f')]})[_0x89d8('0x2e')](function(_0x23f80b){_0x3a8e65[_0x89d8('0x28')]=_0x23f80b;if(_0xc48233[_0x89d8('0x45')][_0x89d8('0x55')]){_0x5e85ee[_0x89d8('0x58')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x89d8('0x56')](_0x5e85ee);})[_0x89d8('0x2e')](function(_0x1f59d8){_0x3a8e65[_0x89d8('0x6b')]=_0x1f59d8;return _0x3a8e65;});}})[_0x89d8('0x2e')](respondWithFilteredResult(_0x53b7df,_0x5e85ee))[_0x89d8('0x57')](handleError(_0x53b7df,null));};exports[_0x89d8('0x70')]=function(_0x5c5c94,_0x5b173f,_0x3b05f1){var _0x5e081a={};var _0x16c0c0={};var _0xad34c6;var _0x5b837a;return db[_0x89d8('0x40')][_0x89d8('0x68')]({'where':{'id':_0x5c5c94[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x5b173f,null))['then'](function(_0x455f7d){if(_0x455f7d){_0xad34c6=_0x455f7d;_0x16c0c0[_0x89d8('0x44')]=_['keys'](db['Team']['rawAttributes']);_0x16c0c0['query']=_['keys'](_0x5c5c94[_0x89d8('0x45')]);_0x16c0c0[_0x89d8('0x50')]=_[_0x89d8('0x47')](_0x16c0c0[_0x89d8('0x44')],_0x16c0c0[_0x89d8('0x45')]);_0x5e081a[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x16c0c0[_0x89d8('0x44')],qs['fields'](_0x5c5c94[_0x89d8('0x45')][_0x89d8('0x49')]));_0x5e081a['attributes']=_0x5e081a[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x5e081a[_0x89d8('0x48')]:_0x16c0c0['model'];_0x5e081a[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x5c5c94['query'][_0x89d8('0x4e')]);_0x5e081a['where']=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x5c5c94[_0x89d8('0x45')],_0x16c0c0['filters']));if(_0x5c5c94['query'][_0x89d8('0x33')]){_0x5e081a[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x5e081a[_0x89d8('0x4f')],{'$or':_['map'](_0x5e081a[_0x89d8('0x48')],function(_0x185a91){var _0x39e9e6={};_0x39e9e6[_0x185a91]={'$like':'%'+_0x5c5c94['query'][_0x89d8('0x33')]+'%'};return _0x39e9e6;})});}_0x5e081a=_[_0x89d8('0x52')]({},_0x5e081a,_0x5c5c94[_0x89d8('0x54')]);return _0xad34c6[_0x89d8('0x70')](_0x5e081a);}})[_0x89d8('0x2e')](function(_0x32f8fe){if(_0x32f8fe){_0x5b837a=_0x32f8fe[_0x89d8('0x4a')];if(!_0x5c5c94[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x5e081a[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x5c5c94[_0x89d8('0x45')][_0x89d8('0x27')]);_0x5e081a[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0x5c5c94[_0x89d8('0x45')][_0x89d8('0x25')]);}return _0xad34c6[_0x89d8('0x70')](_0x5e081a);}})[_0x89d8('0x2e')](function(_0x3d0146){if(_0x3d0146){return _0x3d0146?{'count':_0x5b837a,'rows':_0x3d0146}:null;}})[_0x89d8('0x2e')](respondWithResult(_0x5b173f,null))['catch'](handleError(_0x5b173f,null));};exports[_0x89d8('0x71')]=function(_0x1e8ac6,_0x3cc276,_0x57b3e9){var _0x23fea1=_0x1e8ac6['body'][_0x89d8('0x72')];var _0x5de76c=_['map'](_0x23fea1,'id');return db[_0x89d8('0x73')][_0x89d8('0x56')]({'where':{'id':_0x5de76c},'attributes':['id'],'include':[{'model':db[_0x89d8('0x74')],'as':_0x89d8('0x75'),'attributes':['id',_0x89d8('0x3a'),'online',_0x89d8('0x76'),_0x89d8('0x77')],'raw':!![]}]})['then'](function(_0x4546d6){if(_0x4546d6){var _0x110350=_[_0x89d8('0x78')](_0x4546d6,function(_0x3a23d7){var _0x537ad6=_0x3a23d7[_0x89d8('0x30')]({'plain':!![]});_0x537ad6[_0x89d8('0x75')]['forEach'](function(_0x19685f){_0x19685f[_0x89d8('0x79')]=_[_0x89d8('0x39')](_0x23fea1,{'id':_0x537ad6['id']})[_0x89d8('0x79')];});return _0x537ad6[_0x89d8('0x75')];});return db[_0x89d8('0x40')][_0x89d8('0x39')]({'where':{'id':_0x1e8ac6[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](function(_0x23d125){return db[_0x89d8('0x7a')]['transaction'](function(_0x22049d){return _0x23d125[_0x89d8('0x71')](_0x5de76c,{'transaction':_0x22049d})[_0x89d8('0x2e')](function(){return BPromise[_0x89d8('0x7b')](_0x23fea1,function(_0x85b9ea){return db[_0x89d8('0x7c')]['upsert']({'TeamId':_0x85b9ea['id'],'VoiceQueueId':_0x1e8ac6[_0x89d8('0x66')]['id'],'penalty':_0x85b9ea[_0x89d8('0x79')]},{'transaction':_0x22049d});});})['then'](function(){return BPromise[_0x89d8('0x7b')](_0x110350,function(_0x598855){return db[_0x89d8('0x7d')][_0x89d8('0x7e')]({'where':{'UserId':_0x598855['id'],'VoiceQueueId':_0x1e8ac6[_0x89d8('0x66')]['id']},'defaults':{'penalty':_0x598855[_0x89d8('0x79')]},'transaction':_0x22049d});});})[_0x89d8('0x2e')](function(){return BPromise[_0x89d8('0x7b')](_[_0x89d8('0x33')](_0x110350,{'online':!![]}),function(_0x28f750){return db['UserVoiceQueueRt'][_0x89d8('0x7f')]({'membername':_0x28f750[_0x89d8('0x3a')],'UserId':_0x28f750['id'],'queue_name':_0x23d125['name'],'VoiceQueueId':_0x23d125['id'],'interface':_[_0x89d8('0x80')](_0x28f750['interface'])?util['format'](_0x89d8('0x81'),_0x28f750['name']):_0x28f750[_0x89d8('0x77')],'paused':_0x28f750[_0x89d8('0x76')]||![],'penalty':_0x28f750[_0x89d8('0x79')]},{'transaction':_0x22049d});});})['then'](function(){_0x110350[_0x89d8('0x82')](function(_0x8bbada){socket[_0x89d8('0x83')](_0x89d8('0x84'),{'UserId':_0x8bbada['id'],'VoiceQueueId':_0x23d125['id']});});});});});}})['then'](respondWithStatusCode(_0x3cc276,null))[_0x89d8('0x57')](handleError(_0x3cc276,null));};exports[_0x89d8('0x85')]=function(_0x5b402d,_0x40532d,_0x4cfacf){return db[_0x89d8('0x73')][_0x89d8('0x56')]({'where':{'id':_0x5b402d[_0x89d8('0x45')][_0x89d8('0x86')]},'attributes':['id'],'include':[{'model':db[_0x89d8('0x74')],'as':_0x89d8('0x75'),'attributes':['id'],'raw':!![]}]})[_0x89d8('0x2e')](handleEntityNotFound(_0x40532d,null))['then'](function(_0x4b9385){var _0x1ad0c6=_[_0x89d8('0x35')](_0x4b9385,'id');var _0x8c61f2=[];var _0x3ffe9a=[];var _0x435251=squel['select']();_0x435251[_0x89d8('0x87')](_0x89d8('0x88'))[_0x89d8('0x89')](_0x89d8('0x8a'),'tq')['join'](_0x89d8('0x8b'),'ut',_0x89d8('0x8c'))['where'](_0x89d8('0x8d'),_0x5b402d[_0x89d8('0x66')]['id']);for(var _0x1c731e=0x0;_0x1c731e<_0x4b9385[_0x89d8('0x4a')];_0x1c731e+=0x1){let _0x4f48cf=_0x4b9385[_0x1c731e];for(var _0x26028b=0x0;_0x26028b<_0x4f48cf[_0x89d8('0x75')]['length'];_0x26028b+=0x1){let _0x29aa96=_0x4f48cf[_0x89d8('0x75')][_0x26028b];var _0xa907c5=_0x435251[_0x89d8('0x8e')]();_0xa907c5['where'](_0x89d8('0x8f'),_0x29aa96['id']);_0x3ffe9a[_0x89d8('0x90')](db[_0x89d8('0x7a')][_0x89d8('0x45')](_0xa907c5[_0x89d8('0x91')](),{'type':db[_0x89d8('0x7a')]['QueryTypes']['SELECT']})[_0x89d8('0x2e')](function(_0x54d805){if(_0x54d805['length']===0x1){return _0x29aa96['id'];}else{var _0x381f5d=_[_0x89d8('0x92')](_['map'](_0x54d805,'TeamId'),function(_0x83ed7d){return _[_0x89d8('0x37')](_0x1ad0c6,_0x83ed7d);});if(_0x381f5d){return _0x29aa96['id'];}}}));}}return BPromise[_0x89d8('0x93')](_0x3ffe9a)['then'](function(_0x38c218){_0x8c61f2=_(_0x8c61f2)[_0x89d8('0x94')](_0x38c218)[_0x89d8('0x95')]()[_0x89d8('0x36')]();return db['VoiceQueue']['find']({'where':{'id':_0x5b402d['params']['id']}})['then'](function(_0x5b9f06){return db[_0x89d8('0x7a')][_0x89d8('0x96')](function(_0x121816){return _0x5b9f06['removeTeams'](_0x5b402d['query']['ids'],{'transaction':_0x121816})[_0x89d8('0x2e')](function(){if(!_['isEmpty'](_0x8c61f2)){return _0x5b9f06['removeAgents'](_0x8c61f2,{'transaction':_0x121816})[_0x89d8('0x2e')](function(){return db[_0x89d8('0x97')][_0x89d8('0x2f')]({'where':{'VoiceQueueId':_0x5b402d[_0x89d8('0x66')]['id'],'UserId':_0x8c61f2},'transaction':_0x121816});});}})['then'](function(){_0x8c61f2[_0x89d8('0x82')](function(_0x4e4ebe){socket[_0x89d8('0x83')]('userVoiceQueue:remove',{'UserId':_0x4e4ebe,'VoiceQueueId':_0x5b9f06['id']});});});});});});})[_0x89d8('0x2e')](respondWithStatusCode(_0x40532d,null))[_0x89d8('0x57')](handleError(_0x40532d,null));};exports[_0x89d8('0x98')]=function(_0x4403be,_0x7abd65,_0x2d190d){var _0x16915b,_0x48ad2f;return db['VoiceQueue'][_0x89d8('0x39')]({'where':{'id':_0x4403be[_0x89d8('0x66')]['id']}})['then'](handleEntityNotFound(_0x7abd65,null))[_0x89d8('0x2e')](function(_0x2d036d){if(_0x2d036d){_0x48ad2f=_0x2d036d;return _0x2d036d[_0x89d8('0x98')](_0x4403be['body'][_0x89d8('0x86')],_[_0x89d8('0x99')](_0x4403be['body'],[_0x89d8('0x86'),'id'])||{})[_0x89d8('0x9a')](function(_0x84a95){for(var _0x1f9ee4=0x0;_0x1f9ee4<_0x4403be['body'][_0x89d8('0x86')][_0x89d8('0x4a')];_0x1f9ee4+=0x1){socket[_0x89d8('0x83')](_0x89d8('0x84'),{'UserId':Number(_0x4403be[_0x89d8('0x5a')][_0x89d8('0x86')][_0x1f9ee4]),'VoiceQueueId':Number(_0x4403be['params']['id'])});}return _0x84a95;});}})[_0x89d8('0x2e')](function(_0x92548b){_0x16915b=_0x92548b||[];if(_0x48ad2f){return db[_0x89d8('0x74')][_0x89d8('0x56')]({'where':{'id':_0x4403be['body'][_0x89d8('0x86')]},'attributes':['id','name','online',_0x89d8('0x76'),'interface'],'raw':!![]});}})[_0x89d8('0x2e')](function(_0x5604af){if(!_[_0x89d8('0x9b')](_0x5604af)){var _0x321467=[];for(var _0x35aa1b=0x0;_0x35aa1b<_0x5604af[_0x89d8('0x4a')];_0x35aa1b++){if(_0x5604af[_0x35aa1b][_0x89d8('0x9c')]){_0x321467[_0x89d8('0x90')](db['UserVoiceQueueRt'][_0x89d8('0x7f')]({'membername':_0x5604af[_0x35aa1b]['name'],'UserId':_0x5604af[_0x35aa1b]['id'],'queue_name':_0x48ad2f[_0x89d8('0x3a')],'VoiceQueueId':_0x48ad2f['id'],'interface':_[_0x89d8('0x80')](_0x5604af[_0x35aa1b][_0x89d8('0x77')])?util['format'](_0x89d8('0x81'),_0x5604af[_0x35aa1b]['name']):_0x5604af[_0x35aa1b][_0x89d8('0x77')],'paused':_0x5604af[_0x35aa1b][_0x89d8('0x76')]||![],'penalty':_0x4403be[_0x89d8('0x5a')][_0x89d8('0x79')]||0x0}));}}return BPromise[_0x89d8('0x93')](_0x321467);}})[_0x89d8('0x2e')](function(){return _0x16915b;})[_0x89d8('0x2e')](respondWithResult(_0x7abd65,null))[_0x89d8('0x57')](handleError(_0x7abd65,null));};exports['removeAgents']=function(_0x31a594,_0x51b517,_0x3deeba){return db[_0x89d8('0x40')][_0x89d8('0x39')]({'where':{'id':_0x31a594[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x51b517,null))[_0x89d8('0x2e')](function(_0x226aba){if(_0x226aba){return _0x226aba[_0x89d8('0x9d')](_0x31a594['query'][_0x89d8('0x86')])[_0x89d8('0x2e')](function(){if(_[_0x89d8('0x9e')](_0x31a594[_0x89d8('0x45')][_0x89d8('0x86')])){for(var _0x332c94=0x0;_0x332c94<_0x31a594[_0x89d8('0x45')][_0x89d8('0x86')][_0x89d8('0x4a')];_0x332c94+=0x1){socket[_0x89d8('0x83')](_0x89d8('0x9f'),{'UserId':Number(_0x31a594[_0x89d8('0x45')][_0x89d8('0x86')][_0x332c94]),'VoiceQueueId':Number(_0x31a594['params']['id'])});}}else{socket[_0x89d8('0x83')](_0x89d8('0x9f'),{'UserId':Number(_0x31a594['query'][_0x89d8('0x86')]),'VoiceQueueId':Number(_0x31a594[_0x89d8('0x66')]['id'])});}});}})[_0x89d8('0x2e')](function(_0x4ab13d){return db[_0x89d8('0x97')][_0x89d8('0x2f')]({'where':{'VoiceQueueId':_0x31a594['params']['id'],'UserId':_0x31a594[_0x89d8('0x45')][_0x89d8('0x86')]}})[_0x89d8('0x2e')](function(){return _0x4ab13d;});})[_0x89d8('0x2e')](respondWithStatusCode(_0x51b517,null))[_0x89d8('0x57')](handleError(_0x51b517,null));};exports[_0x89d8('0xa0')]=function(_0x34c518,_0x2d5b22,_0x2c1b26){var _0x23db9e={};var _0x4e284b={};var _0x577706;var _0x5d5884;return db[_0x89d8('0x40')][_0x89d8('0x68')]({'where':{'id':_0x34c518['params']['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x2d5b22,null))[_0x89d8('0x2e')](function(_0x57a35b){if(_0x57a35b){_0x577706=_0x57a35b;_0x4e284b[_0x89d8('0x44')]=_[_0x89d8('0x46')](db[_0x89d8('0x74')]['rawAttributes']);_0x4e284b['query']=_[_0x89d8('0x46')](_0x34c518[_0x89d8('0x45')]);_0x4e284b[_0x89d8('0x50')]=_['intersection'](_0x4e284b[_0x89d8('0x44')],_0x4e284b[_0x89d8('0x45')]);_0x23db9e[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x4e284b[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0x34c518[_0x89d8('0x45')][_0x89d8('0x49')]));_0x23db9e[_0x89d8('0x48')]=_0x23db9e[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x23db9e[_0x89d8('0x48')]:_0x4e284b['model'];_0x23db9e[_0x89d8('0x4d')]=qs['sort'](_0x34c518['query']['sort']);_0x23db9e[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x34c518[_0x89d8('0x45')],_0x4e284b[_0x89d8('0x50')]));if(_0x34c518[_0x89d8('0x45')][_0x89d8('0x33')]){_0x23db9e['where']=_[_0x89d8('0x52')](_0x23db9e[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x23db9e[_0x89d8('0x48')],function(_0x3c7a0f){var _0x18cf62={};_0x18cf62[_0x3c7a0f]={'$like':'%'+_0x34c518[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0x18cf62;})});}_0x23db9e=_['merge']({},_0x23db9e,_0x34c518[_0x89d8('0x54')]);return _0x577706['getAgents'](_0x23db9e);}})['then'](function(_0x55e812){if(_0x55e812){_0x5d5884=_0x55e812[_0x89d8('0x4a')];if(!_0x34c518['query'][_0x89d8('0x4b')]('nolimit')){_0x23db9e[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x34c518[_0x89d8('0x45')][_0x89d8('0x27')]);_0x23db9e[_0x89d8('0x25')]=qs['offset'](_0x34c518[_0x89d8('0x45')][_0x89d8('0x25')]);}return _0x577706[_0x89d8('0xa0')](_0x23db9e);}})['then'](function(_0x594817){if(_0x594817){return _0x594817?{'count':_0x5d5884,'rows':_0x594817}:null;}})[_0x89d8('0x2e')](respondWithResult(_0x2d5b22,null))['catch'](handleError(_0x2d5b22,null));};exports[_0x89d8('0xa1')]=function(_0x586d55,_0x586e0d,_0x4c947e){var _0x72351a={};var _0x33f5fb={};var _0x35838b;var _0x146217;return db['VoiceQueue'][_0x89d8('0x68')]({'where':{'id':_0x586d55[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x586e0d,null))['then'](function(_0x5b54a1){if(_0x5b54a1){_0x35838b=_0x5b54a1;_0x33f5fb['model']=_[_0x89d8('0x46')](db[_0x89d8('0x97')][_0x89d8('0x41')]);_0x33f5fb['query']=_[_0x89d8('0x46')](_0x586d55[_0x89d8('0x45')]);_0x33f5fb[_0x89d8('0x50')]=_[_0x89d8('0x47')](_0x33f5fb[_0x89d8('0x44')],_0x33f5fb['query']);_0x72351a['attributes']=_[_0x89d8('0x47')](_0x33f5fb[_0x89d8('0x44')],qs[_0x89d8('0x49')](_0x586d55[_0x89d8('0x45')]['fields']));_0x72351a[_0x89d8('0x48')]=_0x72351a[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x72351a[_0x89d8('0x48')]:_0x33f5fb[_0x89d8('0x44')];_0x72351a[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x586d55[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x72351a['where']=qs['filters'](_[_0x89d8('0x51')](_0x586d55['query'],_0x33f5fb['filters']));if(_0x586d55[_0x89d8('0x45')][_0x89d8('0x33')]){_0x72351a[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x72351a[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x72351a[_0x89d8('0x48')],function(_0x2b579e){var _0x59cdc1={};_0x59cdc1[_0x2b579e]={'$like':'%'+_0x586d55['query'][_0x89d8('0x33')]+'%'};return _0x59cdc1;})});}_0x72351a=_['merge']({},_0x72351a,_0x586d55[_0x89d8('0x54')]);return _0x35838b['getMembers'](_0x72351a);}})[_0x89d8('0x2e')](function(_0x19e283){if(_0x19e283){_0x146217=_0x19e283[_0x89d8('0x4a')];if(!_0x586d55[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x72351a[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x586d55[_0x89d8('0x45')][_0x89d8('0x27')]);_0x72351a[_0x89d8('0x25')]=qs['offset'](_0x586d55[_0x89d8('0x45')][_0x89d8('0x25')]);}return _0x35838b[_0x89d8('0xa1')](_0x72351a);}})[_0x89d8('0x2e')](function(_0x281011){return _0x281011?{'count':_0x146217,'rows':_0x281011}:null;})['then'](respondWithResult(_0x586e0d,null))['catch'](handleError(_0x586e0d,null));};exports[_0x89d8('0xa2')]=function(_0x31cb3c,_0x815429,_0x2dfed7){var _0x1af65a={};var _0x2df07d={};var _0x5b2552;var _0xa09f2;return db[_0x89d8('0x40')]['findOne']({'where':{'id':_0x31cb3c[_0x89d8('0x66')]['id']}})['then'](handleEntityNotFound(_0x815429,null))[_0x89d8('0x2e')](function(_0xd90856){if(_0xd90856){_0x5b2552=_0xd90856;_0x2df07d['model']=_['keys'](db[_0x89d8('0xa3')]['rawAttributes']);_0x2df07d[_0x89d8('0x45')]=_[_0x89d8('0x46')](_0x31cb3c[_0x89d8('0x45')]);_0x2df07d[_0x89d8('0x50')]=_[_0x89d8('0x47')](_0x2df07d[_0x89d8('0x44')],_0x2df07d[_0x89d8('0x45')]);_0x1af65a[_0x89d8('0x48')]=_['intersection'](_0x2df07d['model'],qs['fields'](_0x31cb3c['query']['fields']));_0x1af65a[_0x89d8('0x48')]=_0x1af65a[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x1af65a[_0x89d8('0x48')]:_0x2df07d['model'];_0x1af65a[_0x89d8('0x4d')]=qs['sort'](_0x31cb3c[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x1af65a['where']=qs['filters'](_[_0x89d8('0x51')](_0x31cb3c[_0x89d8('0x45')],_0x2df07d[_0x89d8('0x50')]));if(_0x31cb3c[_0x89d8('0x45')][_0x89d8('0x33')]){_0x1af65a[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x1af65a[_0x89d8('0x4f')],{'$or':_[_0x89d8('0x35')](_0x1af65a[_0x89d8('0x48')],function(_0x3cc11b){var _0x4d5c4d={};_0x4d5c4d[_0x3cc11b]={'$like':'%'+_0x31cb3c[_0x89d8('0x45')][_0x89d8('0x33')]+'%'};return _0x4d5c4d;})});}_0x1af65a=_[_0x89d8('0x52')]({},_0x1af65a,_0x31cb3c[_0x89d8('0x54')]);return _0x5b2552['getLists'](_0x1af65a);}})[_0x89d8('0x2e')](function(_0x467c43){if(_0x467c43){_0xa09f2=_0x467c43[_0x89d8('0x4a')];if(!_0x31cb3c[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x1af65a['limit']=qs['limit'](_0x31cb3c[_0x89d8('0x45')][_0x89d8('0x27')]);_0x1af65a[_0x89d8('0x25')]=qs[_0x89d8('0x25')](_0x31cb3c[_0x89d8('0x45')]['offset']);}return _0x5b2552['getLists'](_0x1af65a);}})[_0x89d8('0x2e')](function(_0x199243){if(_0x199243){return _0x199243?{'count':_0xa09f2,'rows':_0x199243}:null;}})[_0x89d8('0x2e')](respondWithResult(_0x815429,null))[_0x89d8('0x57')](handleError(_0x815429,null));};exports['addLists']=function(_0x3479e0,_0x37b713,_0x1cc160){var _0x5c6049,_0x1fde69;return db['VoiceQueue']['find']({'where':{'id':_0x3479e0[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x37b713,null))[_0x89d8('0x2e')](function(_0xe2b989){if(_0xe2b989){_0x1fde69=_0xe2b989;return _0xe2b989[_0x89d8('0xa4')](_0x3479e0[_0x89d8('0x5a')]['ids'],_[_0x89d8('0x99')](_0x3479e0[_0x89d8('0x5a')],[_0x89d8('0x86'),'id'])||{});}return null;})[_0x89d8('0x9a')](function(_0x40096b){var _0x9a4525;_0x5c6049=_0x40096b||[];var _0x1a86a5=[];if(_0x40096b){for(var _0x1ba32d=0x0;_0x1ba32d<_0x40096b[_0x89d8('0x4a')];_0x1ba32d+=0x1){var _0x4ca566=_0x40096b[_0x1ba32d][_0x89d8('0x30')]({'plain':!![]});_0x1fde69[_0x89d8('0xa5')]=_0x3479e0[_0x89d8('0x5a')]['dialCheckDuplicateType']?_0x3479e0[_0x89d8('0x5a')][_0x89d8('0xa5')]:_0x1fde69[_0x89d8('0xa5')];switch(_0x1fde69[_0x89d8('0xa5')]){case _0x89d8('0xa6'):_0x9a4525=squel[_0x89d8('0xa7')]()[_0x89d8('0xa8')]('cm_hopper')[_0x89d8('0xa9')]([_0x89d8('0xaa'),_0x89d8('0xab'),_0x89d8('0xac'),_0x89d8('0xad'),_0x89d8('0x6a'),_0x89d8('0x63'),_0x89d8('0x64')],squel['select']()[_0x89d8('0x87')](_0x89d8('0xaa'),_0x89d8('0xaa'))[_0x89d8('0x87')](_0x89d8('0xae'),_0x89d8('0xab'))[_0x89d8('0x87')]('id',_0x89d8('0xac'))[_0x89d8('0x87')](_0x4ca566['CmListId'][_0x89d8('0x91')](),_0x89d8('0xad'))[_0x89d8('0x87')](_0x3479e0[_0x89d8('0x66')]['id']['toString'](),_0x89d8('0x6a'))['field'](_0x89d8('0xae'),_0x89d8('0x63'))[_0x89d8('0x87')](_0x89d8('0xae'),'updatedAt')[_0x89d8('0x89')]('cm_contacts')[_0x89d8('0x4f')](_0x89d8('0xaf'))[_0x89d8('0x4f')](_0x89d8('0xb0'),_0x4ca566[_0x89d8('0xb1')][_0x89d8('0x91')]())[_0x89d8('0x4f')](_0x89d8('0xb2'))['where'](_0x89d8('0xb3'),squel[_0x89d8('0xb4')]()[_0x89d8('0x87')](_0x89d8('0xb5'))[_0x89d8('0x89')](_0x89d8('0xb6'))[_0x89d8('0x4f')](_0x89d8('0x8d'),_0x3479e0['params']['id'][_0x89d8('0x91')]()))[_0x89d8('0x4f')](_0x89d8('0xb3'),squel[_0x89d8('0xb4')]()[_0x89d8('0x87')](_0x89d8('0xb7'))[_0x89d8('0x89')](_0x89d8('0xb8'))[_0x89d8('0x4f')](_0x89d8('0x8d'),_0x3479e0['params']['id']['toString']())))['toString']();break;case _0x89d8('0xb9'):_0x9a4525=squel[_0x89d8('0xa7')]()[_0x89d8('0xa8')](_0x89d8('0xb8'))['fromQuery']([_0x89d8('0xaa'),_0x89d8('0xab'),_0x89d8('0xac'),_0x89d8('0xad'),_0x89d8('0x6a'),'createdAt','updatedAt'],squel[_0x89d8('0xb4')]()[_0x89d8('0x87')](_0x89d8('0xaa'),_0x89d8('0xaa'))[_0x89d8('0x87')](_0x89d8('0xae'),'scheduledAt')[_0x89d8('0x87')]('id',_0x89d8('0xac'))[_0x89d8('0x87')](_0x4ca566[_0x89d8('0xb1')][_0x89d8('0x91')](),_0x89d8('0xad'))[_0x89d8('0x87')](_0x3479e0[_0x89d8('0x66')]['id'][_0x89d8('0x91')](),_0x89d8('0x6a'))[_0x89d8('0x87')](_0x89d8('0xae'),_0x89d8('0x63'))['field'](_0x89d8('0xae'),'updatedAt')[_0x89d8('0x89')](_0x89d8('0xba'))['where'](_0x89d8('0xaf'))[_0x89d8('0x4f')](_0x89d8('0xb0'),_0x4ca566[_0x89d8('0xb1')][_0x89d8('0x91')]())[_0x89d8('0x4f')](_0x89d8('0xb2'))['where'](_0x89d8('0xb3'),squel['select']()[_0x89d8('0x87')]('COALESCE(phone,\x27\x27)')[_0x89d8('0x89')](_0x89d8('0xb8'))[_0x89d8('0x4f')](_0x89d8('0x8d'),_0x3479e0[_0x89d8('0x66')]['id'][_0x89d8('0x91')]())))[_0x89d8('0x91')]();break;default:_0x9a4525=squel['insert']()['into'](_0x89d8('0xb8'))[_0x89d8('0xa9')](['phone','scheduledAt',_0x89d8('0xac'),_0x89d8('0xad'),_0x89d8('0x6a'),_0x89d8('0x63'),'updatedAt'],squel[_0x89d8('0xb4')]()['field'](_0x89d8('0xaa'),_0x89d8('0xaa'))[_0x89d8('0x87')](_0x89d8('0xae'),_0x89d8('0xab'))[_0x89d8('0x87')]('id','ContactId')[_0x89d8('0x87')](_0x4ca566[_0x89d8('0xb1')][_0x89d8('0x91')](),_0x89d8('0xad'))[_0x89d8('0x87')](_0x3479e0[_0x89d8('0x66')]['id'][_0x89d8('0x91')](),'VoiceQueueId')[_0x89d8('0x87')](_0x89d8('0xae'),'createdAt')[_0x89d8('0x87')](_0x89d8('0xae'),'updatedAt')[_0x89d8('0x89')](_0x89d8('0xba'))[_0x89d8('0x4f')]('deletedAt\x20IS\x20NULL')[_0x89d8('0x4f')](_0x89d8('0xb0'),_0x4ca566[_0x89d8('0xb1')][_0x89d8('0x91')]())['where'](_0x89d8('0xb2')))[_0x89d8('0x91')]();}_0x1a86a5[_0x89d8('0x90')](db[_0x89d8('0x7a')][_0x89d8('0x45')](_0x9a4525));}return BPromise[_0x89d8('0x93')](_0x1a86a5);}})['then'](function(){return _0x5c6049;})[_0x89d8('0x2e')](respondWithResult(_0x37b713,null))[_0x89d8('0x57')](handleError(_0x37b713,null));};exports[_0x89d8('0xbb')]=function(_0x26ae63,_0x72ecad,_0x5a7396){return db[_0x89d8('0x40')]['find']({'where':{'id':_0x26ae63['params']['id']}})[_0x89d8('0x2e')](handleEntityNotFound(_0x72ecad,null))['then'](function(_0x2fc978){if(_0x2fc978){return _0x2fc978['removeLists'](_0x26ae63[_0x89d8('0x45')][_0x89d8('0x86')]);}})[_0x89d8('0x2e')](function(_0x59ebe9){if(_0x59ebe9){return db[_0x89d8('0x69')]['destroy']({'where':{'ListId':_0x26ae63[_0x89d8('0x45')][_0x89d8('0x86')],'VoiceQueueId':_0x26ae63[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](function(){return _0x59ebe9;});}})[_0x89d8('0x2e')](respondWithStatusCode(_0x72ecad,null))[_0x89d8('0x57')](handleError(_0x72ecad,null));};exports[_0x89d8('0xbc')]=function(_0x59f5c8,_0x5bbc52,_0x48b073){var _0x5104a6={};var _0x468308={};var _0x47ee9d;var _0x26e14f;return db[_0x89d8('0x40')]['findOne']({'where':{'id':_0x59f5c8['params']['id']}})['then'](handleEntityNotFound(_0x5bbc52,null))[_0x89d8('0x2e')](function(_0x600895){if(_0x600895){_0x47ee9d=_0x600895;_0x468308[_0x89d8('0x44')]=_['keys'](db[_0x89d8('0xa3')]['rawAttributes']);_0x468308['query']=_[_0x89d8('0x46')](_0x59f5c8[_0x89d8('0x45')]);_0x468308['filters']=_['intersection'](_0x468308[_0x89d8('0x44')],_0x468308[_0x89d8('0x45')]);_0x5104a6[_0x89d8('0x48')]=_[_0x89d8('0x47')](_0x468308['model'],qs[_0x89d8('0x49')](_0x59f5c8['query'][_0x89d8('0x49')]));_0x5104a6[_0x89d8('0x48')]=_0x5104a6[_0x89d8('0x48')][_0x89d8('0x4a')]?_0x5104a6['attributes']:_0x468308[_0x89d8('0x44')];_0x5104a6[_0x89d8('0x4d')]=qs[_0x89d8('0x4e')](_0x59f5c8[_0x89d8('0x45')][_0x89d8('0x4e')]);_0x5104a6[_0x89d8('0x4f')]=qs[_0x89d8('0x50')](_[_0x89d8('0x51')](_0x59f5c8[_0x89d8('0x45')],_0x468308[_0x89d8('0x50')]));if(_0x59f5c8[_0x89d8('0x45')][_0x89d8('0x33')]){_0x5104a6[_0x89d8('0x4f')]=_[_0x89d8('0x52')](_0x5104a6['where'],{'$or':_['map'](_0x5104a6[_0x89d8('0x48')],function(_0x3ac06d){var _0x10d23e={};_0x10d23e[_0x3ac06d]={'$like':'%'+_0x59f5c8['query']['filter']+'%'};return _0x10d23e;})});}_0x5104a6=_[_0x89d8('0x52')]({},_0x5104a6,_0x59f5c8['options']);return _0x47ee9d[_0x89d8('0xbc')](_0x5104a6);}})[_0x89d8('0x2e')](function(_0x8e358c){if(_0x8e358c){_0x26e14f=_0x8e358c[_0x89d8('0x4a')];if(!_0x59f5c8[_0x89d8('0x45')][_0x89d8('0x4b')](_0x89d8('0x4c'))){_0x5104a6[_0x89d8('0x27')]=qs[_0x89d8('0x27')](_0x59f5c8[_0x89d8('0x45')][_0x89d8('0x27')]);_0x5104a6[_0x89d8('0x25')]=qs['offset'](_0x59f5c8[_0x89d8('0x45')]['offset']);}return _0x47ee9d[_0x89d8('0xbc')](_0x5104a6);}})[_0x89d8('0x2e')](function(_0x387f3e){if(_0x387f3e){return _0x387f3e?{'count':_0x26e14f,'rows':_0x387f3e}:null;}})[_0x89d8('0x2e')](respondWithResult(_0x5bbc52,null))['catch'](handleError(_0x5bbc52,null));};exports[_0x89d8('0xbd')]=function(_0x2e23f5,_0x59cefb,_0x44855d){var _0x27cc00,_0x7b8076;return db[_0x89d8('0x40')]['find']({'where':{'id':_0x2e23f5[_0x89d8('0x66')]['id']}})['then'](handleEntityNotFound(_0x59cefb,null))['then'](function(_0x54f8d0){if(_0x54f8d0){_0x7b8076=_0x54f8d0;return _0x54f8d0[_0x89d8('0xbd')](_0x2e23f5[_0x89d8('0x5a')]['ids'],_['omit'](_0x2e23f5['body'],[_0x89d8('0x86'),'id'])||{});}return null;})[_0x89d8('0x9a')](function(_0x143904){var _0x410d50;_0x27cc00=_0x143904||[];var _0x3f6cc5=[];if(_0x143904){for(var _0x48dced=0x0;_0x48dced<_0x143904[_0x89d8('0x4a')];_0x48dced+=0x1){var _0x1d1164=_0x143904[_0x48dced][_0x89d8('0x30')]({'plain':!![]});_0x410d50=squel[_0x89d8('0xa7')]()[_0x89d8('0xa8')](_0x89d8('0xbe'))[_0x89d8('0xa9')]([_0x89d8('0xaa'),'ContactId',_0x89d8('0xad'),'VoiceQueueId',_0x89d8('0x63'),_0x89d8('0x64')],squel['select']()[_0x89d8('0x87')]('phone',_0x89d8('0xaa'))[_0x89d8('0x87')]('id',_0x89d8('0xac'))['field'](_0x1d1164[_0x89d8('0xb1')][_0x89d8('0x91')](),'ListId')['field'](_0x2e23f5[_0x89d8('0x66')]['id'][_0x89d8('0x91')](),_0x89d8('0x6a'))[_0x89d8('0x87')](_0x89d8('0xae'),_0x89d8('0x63'))[_0x89d8('0x87')](_0x89d8('0xae'),_0x89d8('0x64'))['from'](_0x89d8('0xba'))['where'](_0x89d8('0xaf'))[_0x89d8('0x4f')](_0x89d8('0xb0'),_0x1d1164[_0x89d8('0xb1')][_0x89d8('0x91')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x89d8('0x91')]();_0x3f6cc5[_0x89d8('0x90')](db[_0x89d8('0x7a')][_0x89d8('0x45')](_0x410d50));}return BPromise[_0x89d8('0x93')](_0x3f6cc5);}})[_0x89d8('0x2e')](function(){return _0x27cc00;})[_0x89d8('0x2e')](respondWithResult(_0x59cefb,null))['catch'](handleError(_0x59cefb,null));};exports[_0x89d8('0xbf')]=function(_0x312ae0,_0x3acea9,_0x425ee7){return db['VoiceQueue'][_0x89d8('0x39')]({'where':{'id':_0x312ae0['params']['id']}})['then'](handleEntityNotFound(_0x3acea9,null))[_0x89d8('0x2e')](function(_0x167a4c){if(_0x167a4c){return _0x167a4c[_0x89d8('0xbf')](_0x312ae0[_0x89d8('0x45')][_0x89d8('0x86')]);}})[_0x89d8('0x2e')](function(_0x5ec4eb){if(_0x5ec4eb){return db[_0x89d8('0xc0')][_0x89d8('0x2f')]({'where':{'ListId':_0x312ae0[_0x89d8('0x45')][_0x89d8('0x86')],'VoiceQueueId':_0x312ae0[_0x89d8('0x66')]['id']}})[_0x89d8('0x2e')](function(){return _0x5ec4eb;});}})[_0x89d8('0x2e')](respondWithStatusCode(_0x3acea9,null))[_0x89d8('0x57')](handleError(_0x3acea9,null));}; \ No newline at end of file +var _0x4b5b=['isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','get','inbound','QueueCampaigns','filter','ignore','value','includes','type','find','name','error','stack','send','index','map','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','outbound','UserProfileSection','userProfileId','getHoppers','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','removeTeams','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','ids','isEmpty','userVoiceQueue:remove','addAgents','spread','findAll','online','removeAgents'];(function(_0x34e29e,_0x10abaa){var _0x2f2219=function(_0x3bf1b2){while(--_0x3bf1b2){_0x34e29e['push'](_0x34e29e['shift']());}};_0x2f2219(++_0x10abaa);}(_0x4b5b,0x195));var _0xb4b5=function(_0x1ba5db,_0x479fe6){_0x1ba5db=_0x1ba5db-0x0;var _0x21a536=_0x4b5b[_0x1ba5db];return _0x21a536;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4b5('0x0'));var zipdir=require(_0xb4b5('0x1'));var jsonpatch=require(_0xb4b5('0x2'));var rp=require('request-promise');var moment=require(_0xb4b5('0x3'));var BPromise=require(_0xb4b5('0x4'));var Mustache=require('mustache');var util=require(_0xb4b5('0x5'));var path=require(_0xb4b5('0x6'));var sox=require(_0xb4b5('0x7'));var csv=require(_0xb4b5('0x8'));var ejs=require(_0xb4b5('0x9'));var fs=require('fs');var fs_extra=require(_0xb4b5('0xa'));var _=require(_0xb4b5('0xb'));var squel=require(_0xb4b5('0xc'));var crypto=require(_0xb4b5('0xd'));var jsforce=require(_0xb4b5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb4b5('0x8'));var querystring=require(_0xb4b5('0xf'));var Papa=require(_0xb4b5('0x10'));var Redis=require(_0xb4b5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb4b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4b5('0x13'));var logger=require('../../config/logger')(_0xb4b5('0x14'));var utils=require(_0xb4b5('0x15'));var config=require(_0xb4b5('0x16'));var licenseUtil=require(_0xb4b5('0x17'));var db=require(_0xb4b5('0x18'))['db'];config['redis']=_[_0xb4b5('0x19')](config[_0xb4b5('0x1a')],{'host':_0xb4b5('0x1b'),'port':0x18eb});var socket=require(_0xb4b5('0x1c'))(new Redis(config[_0xb4b5('0x1a')]));require('./voiceQueue.socket')[_0xb4b5('0x1d')](socket);function respondWithStatusCode(_0x526f8d,_0x3efc9c){_0x3efc9c=_0x3efc9c||0xcc;return function(_0x57208e){if(_0x57208e){return _0x526f8d['sendStatus'](_0x3efc9c);}return _0x526f8d[_0xb4b5('0x1e')](_0x3efc9c)[_0xb4b5('0x1f')]();};}function respondWithResult(_0x53cac7,_0x10d8b2){_0x10d8b2=_0x10d8b2||0xc8;return function(_0x49aba5){if(_0x49aba5){return _0x53cac7[_0xb4b5('0x1e')](_0x10d8b2)[_0xb4b5('0x20')](_0x49aba5);}};}function respondWithFilteredResult(_0x2b8f0c,_0xde3697){return function(_0x440197){if(_0x440197){var _0x2e121d=typeof _0xde3697[_0xb4b5('0x21')]==='undefined'&&typeof _0xde3697[_0xb4b5('0x22')]===_0xb4b5('0x23');var _0x2e2a87=_0x440197[_0xb4b5('0x24')];var _0x168910=_0x2e121d?0x0:_0xde3697[_0xb4b5('0x21')];var _0x5d189a=_0x2e121d?_0x440197[_0xb4b5('0x24')]:_0xde3697[_0xb4b5('0x21')]+_0xde3697['limit'];var _0x524ce2;if(_0x5d189a>=_0x2e2a87){_0x5d189a=_0x2e2a87;_0x524ce2=0xc8;}else{_0x524ce2=0xce;}_0x2b8f0c[_0xb4b5('0x1e')](_0x524ce2);return _0x2b8f0c['set']('Content-Range',_0x168910+'-'+_0x5d189a+'/'+_0x2e2a87)[_0xb4b5('0x20')](_0x440197);}return null;};}function patchUpdates(_0x1711ce){return function(_0x50268d){try{jsonpatch[_0xb4b5('0x25')](_0x50268d,_0x1711ce,!![]);}catch(_0x3f0d26){return BPromise[_0xb4b5('0x26')](_0x3f0d26);}return _0x50268d[_0xb4b5('0x27')]();};}function saveUpdates(_0x39c892,_0x1afa0d){return function(_0x598886){if(_0x598886){return _0x598886[_0xb4b5('0x28')](_0x39c892)[_0xb4b5('0x29')](function(_0x3b9b11){return _0x3b9b11;});}return null;};}function removeEntity(_0x2c55d8,_0xa9c330){return function(_0x5d81d6){if(_0x5d81d6){return _0x5d81d6[_0xb4b5('0x2a')]()[_0xb4b5('0x29')](function(){var _0x473b0e=_0x5d81d6[_0xb4b5('0x2b')]({'plain':!![]});var _0x1a7313=[{'name':'VoiceQueues','value':_0xb4b5('0x2c'),'ignore':![]},{'name':_0xb4b5('0x2d'),'value':'outbound','ignore':![]}];var _0x214012=_(_0x1a7313)[_0xb4b5('0x2e')](_0xb4b5('0x2f'))['map'](_0xb4b5('0x30'))[_0xb4b5('0x30')]();if(_[_0xb4b5('0x31')](_0x214012,_0x473b0e[_0xb4b5('0x32')])){return;}var _0x2a6af5=_[_0xb4b5('0x33')](_0x1a7313,[_0xb4b5('0x30'),_0x473b0e['type']])[_0xb4b5('0x34')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2a6af5,'resourceId':_0x473b0e['id']}})[_0xb4b5('0x29')](function(){return _0x5d81d6;});})[_0xb4b5('0x29')](function(){_0x2c55d8[_0xb4b5('0x1e')](0xcc)[_0xb4b5('0x1f')]();});}};}function handleEntityNotFound(_0x25b1f0,_0x5940e7){return function(_0xf3a9f9){if(!_0xf3a9f9){_0x25b1f0['sendStatus'](0x194);}return _0xf3a9f9;};}function handleError(_0x34a95f,_0x1daa9b){_0x1daa9b=_0x1daa9b||0x1f4;return function(_0x3b4bab){logger[_0xb4b5('0x35')](_0x3b4bab[_0xb4b5('0x36')]);if(_0x3b4bab[_0xb4b5('0x34')]){delete _0x3b4bab['name'];}_0x34a95f[_0xb4b5('0x1e')](_0x1daa9b)[_0xb4b5('0x37')](_0x3b4bab);};}exports[_0xb4b5('0x38')]=function(_0x1fedd9,_0x37002a){var _0x2c5658={},_0x18c4bb={},_0x2042db={'count':0x0,'rows':[]};var _0x360c76=_[_0xb4b5('0x39')](db[_0xb4b5('0x3a')]['rawAttributes'],function(_0x40085b){return{'name':_0x40085b[_0xb4b5('0x3b')],'type':_0x40085b['type'][_0xb4b5('0x3c')]};});_0x18c4bb[_0xb4b5('0x3d')]=_[_0xb4b5('0x39')](_0x360c76,_0xb4b5('0x34'));_0x18c4bb[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x1fedd9[_0xb4b5('0x3e')]);_0x18c4bb[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x18c4bb[_0xb4b5('0x3d')],_0x18c4bb[_0xb4b5('0x3e')]);_0x2c5658[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x18c4bb['model'],qs[_0xb4b5('0x43')](_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x2c5658['attributes']=_0x2c5658[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x2c5658[_0xb4b5('0x42')]:_0x18c4bb[_0xb4b5('0x3d')];if(!_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x2c5658[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x2c5658[_0xb4b5('0x21')]=qs['offset'](_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}_0x2c5658[_0xb4b5('0x47')]=qs[_0xb4b5('0x48')](_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x2c5658[_0xb4b5('0x49')]=qs[_0xb4b5('0x40')](_[_0xb4b5('0x4a')](_0x1fedd9['query'],_0x18c4bb[_0xb4b5('0x40')]),_0x360c76);if(_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x2c5658['where']=_[_0xb4b5('0x4b')](_0x2c5658[_0xb4b5('0x49')],{'$or':_['map'](_0x360c76,function(_0x5a81da){if(_0x5a81da[_0xb4b5('0x32')]!==_0xb4b5('0x4c')){var _0x1de6c4={};_0x1de6c4[_0x5a81da[_0xb4b5('0x34')]]={'$like':'%'+_0x1fedd9[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x1de6c4;}})});}_0x2c5658=_['merge']({},_0x2c5658,_0x1fedd9[_0xb4b5('0x4d')]);var _0x306dce={'where':_0x2c5658[_0xb4b5('0x49')]};return db['VoiceQueue']['count'](_0x306dce)['then'](function(_0x49da5c){_0x2042db['count']=_0x49da5c;if(_0x1fedd9['query'][_0xb4b5('0x4e')]){_0x2c5658[_0xb4b5('0x4f')]=[{'all':!![]}];}return db[_0xb4b5('0x3a')]['findAll'](_0x2c5658);})[_0xb4b5('0x29')](function(_0x469557){_0x2042db['rows']=_0x469557;return _0x2042db;})[_0xb4b5('0x29')](respondWithFilteredResult(_0x37002a,_0x2c5658))[_0xb4b5('0x50')](handleError(_0x37002a,null));};exports[_0xb4b5('0x51')]=function(_0x267159,_0x14cfc4){var _0x291bf9={'raw':![],'where':{'id':_0x267159[_0xb4b5('0x52')]['id']}},_0x52371c={};_0x52371c[_0xb4b5('0x3d')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x52371c[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x267159[_0xb4b5('0x3e')]);_0x52371c[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x52371c[_0xb4b5('0x3d')],_0x52371c[_0xb4b5('0x3e')]);_0x291bf9[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x52371c[_0xb4b5('0x3d')],qs[_0xb4b5('0x43')](_0x267159['query'][_0xb4b5('0x43')]));_0x291bf9[_0xb4b5('0x42')]=_0x291bf9[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x291bf9[_0xb4b5('0x42')]:_0x52371c[_0xb4b5('0x3d')];if(_0x267159[_0xb4b5('0x3e')]['includeAll']){_0x291bf9[_0xb4b5('0x4f')]=[{'all':!![]}];}_0x291bf9=_['merge']({},_0x291bf9,_0x267159[_0xb4b5('0x4d')]);return db[_0xb4b5('0x3a')][_0xb4b5('0x33')](_0x291bf9)[_0xb4b5('0x29')](handleEntityNotFound(_0x14cfc4,null))[_0xb4b5('0x29')](respondWithResult(_0x14cfc4,null))[_0xb4b5('0x50')](handleError(_0x14cfc4,null));};exports[_0xb4b5('0x53')]=function(_0x3238ae,_0x3eaa5d){return db[_0xb4b5('0x3a')][_0xb4b5('0x53')](_0x3238ae[_0xb4b5('0x54')],{})[_0xb4b5('0x29')](function(_0x24a1a5){var _0x4b7d1d=_0x3238ae[_0xb4b5('0x55')]['get']({'plain':!![]});if(!_0x4b7d1d)throw new Error(_0xb4b5('0x56'));if(_0x4b7d1d[_0xb4b5('0x57')]==='user'){var _0x38c351=_0x24a1a5[_0xb4b5('0x2b')]({'plain':!![]});var _0x31f03d=[{'name':_0xb4b5('0x58'),'value':_0xb4b5('0x2c')},{'name':_0xb4b5('0x2d'),'value':'outbound'}];var _0x24a0bb=_[_0xb4b5('0x33')](_0x31f03d,['value',_0x38c351[_0xb4b5('0x32')]])['name'];return db['UserProfileSection'][_0xb4b5('0x33')]({'where':{'name':_0x24a0bb,'userProfileId':_0x4b7d1d['userProfileId']},'raw':!![]})['then'](function(_0x4d48cc){if(_0x4d48cc&&_0x4d48cc[_0xb4b5('0x59')]===0x0){return db[_0xb4b5('0x5a')][_0xb4b5('0x53')]({'name':_0x38c351[_0xb4b5('0x34')],'resourceId':_0x38c351['id'],'type':_0x4d48cc[_0xb4b5('0x34')],'sectionId':_0x4d48cc['id']},{})[_0xb4b5('0x29')](function(){return _0x24a1a5;});}else{return _0x24a1a5;}})[_0xb4b5('0x50')](function(_0x30cf0b){logger[_0xb4b5('0x35')](_0xb4b5('0x5b'),_0x30cf0b);throw _0x30cf0b;});}return _0x24a1a5;})[_0xb4b5('0x29')](respondWithResult(_0x3eaa5d,0xc9))[_0xb4b5('0x50')](handleError(_0x3eaa5d,null));};exports[_0xb4b5('0x5c')]=function(_0x88d4b3,_0x540df3){var _0xce1c5={'where':{'id':_0x88d4b3['params']['id']}},_0x3b357a={};_0x3b357a[_0xb4b5('0x3d')]=_['keys'](db[_0xb4b5('0x3a')][_0xb4b5('0x5d')]);_0xce1c5['attributes']=_[_0xb4b5('0x41')](_0x3b357a[_0xb4b5('0x3d')],qs['fields'](_0x88d4b3[_0xb4b5('0x3e')]['fields']));_0xce1c5[_0xb4b5('0x42')]=_0xce1c5[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0xce1c5['attributes']:_0x3b357a[_0xb4b5('0x3d')];if(_0x88d4b3[_0xb4b5('0x3e')][_0xb4b5('0x4e')]){_0xce1c5[_0xb4b5('0x4f')]=[{'all':!![]}];}_0xce1c5=_[_0xb4b5('0x4b')]({},_0xce1c5,_0x88d4b3[_0xb4b5('0x4d')]);return db['VoiceQueue'][_0xb4b5('0x33')](_0xce1c5)[_0xb4b5('0x29')](handleEntityNotFound(_0x540df3,null))[_0xb4b5('0x29')](function(_0x2068bf){if(_0x2068bf){var _0x53a22e=_0x2068bf[_0xb4b5('0x2b')]({'plain':!![]});_0x53a22e=qs[_0xb4b5('0x5e')](_0x53a22e,['id',_0xb4b5('0x5f'),_0xb4b5('0x60')]);_0x88d4b3[_0xb4b5('0x54')]=_[_0xb4b5('0x5e')](_0x88d4b3[_0xb4b5('0x54')],['id',_0xb4b5('0x5f'),_0xb4b5('0x60')]);return db[_0xb4b5('0x3a')][_0xb4b5('0x53')](_[_0xb4b5('0x4b')](_0x53a22e,_0x88d4b3[_0xb4b5('0x54')]),{'include':_0x88d4b3['query'][_0xb4b5('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x5c782b){var _0x41583d=_0x88d4b3[_0xb4b5('0x55')]['get']({'plain':!![]});if(!_0x41583d)throw new Error(_0xb4b5('0x56'));if(_0x41583d[_0xb4b5('0x57')]===_0xb4b5('0x55')){var _0xdd2e0f=_0x5c782b[_0xb4b5('0x2b')]({'plain':!![]});var _0x4d6703=[{'name':_0xb4b5('0x58'),'value':_0xb4b5('0x2c')},{'name':_0xb4b5('0x2d'),'value':_0xb4b5('0x61')}];var _0x489c9f=_[_0xb4b5('0x33')](_0x4d6703,[_0xb4b5('0x30'),_0xdd2e0f[_0xb4b5('0x32')]])[_0xb4b5('0x34')];return db[_0xb4b5('0x62')][_0xb4b5('0x33')]({'where':{'name':_0x489c9f,'userProfileId':_0x41583d[_0xb4b5('0x63')]},'raw':!![]})[_0xb4b5('0x29')](function(_0x36eeba){if(_0x36eeba&&_0x36eeba[_0xb4b5('0x59')]===0x0){return db['UserProfileResource'][_0xb4b5('0x53')]({'name':_0xdd2e0f[_0xb4b5('0x34')],'resourceId':_0xdd2e0f['id'],'type':_0x36eeba[_0xb4b5('0x34')],'sectionId':_0x36eeba['id']},{})[_0xb4b5('0x29')](function(){return _0x5c782b;});}else{return _0x5c782b;}})[_0xb4b5('0x50')](function(_0xacf29){logger[_0xb4b5('0x35')](_0xb4b5('0x5b'),_0xacf29);throw _0xacf29;});}return _0x5c782b;});}})[_0xb4b5('0x29')](respondWithResult(_0x540df3,0xc9))[_0xb4b5('0x50')](handleError(_0x540df3,null));};exports[_0xb4b5('0x28')]=function(_0x1608f7,_0x4644f7){if(_0x1608f7[_0xb4b5('0x54')]['id']){delete _0x1608f7[_0xb4b5('0x54')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x1608f7[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x4644f7,null))['then'](saveUpdates(_0x1608f7[_0xb4b5('0x54')],null))[_0xb4b5('0x29')](respondWithResult(_0x4644f7,null))[_0xb4b5('0x50')](handleError(_0x4644f7,null));};exports[_0xb4b5('0x2a')]=function(_0x2fc825,_0x3e50e6){return db['VoiceQueue']['find']({'where':{'id':_0x2fc825[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x3e50e6,null))['then'](removeEntity(_0x3e50e6,null))['catch'](handleError(_0x3e50e6,null));};exports[_0xb4b5('0x64')]=function(_0x29a671,_0x3483d5,_0x596009){var _0x31111c={'raw':![],'where':{}};var _0x52dad3={};var _0x1b0994={'count':0x0,'rows':[]};return db[_0xb4b5('0x3a')]['findOne']({'where':{'id':_0x29a671['params']['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x3483d5,null))[_0xb4b5('0x29')](function(_0x14750c){if(_0x14750c){_0x52dad3[_0xb4b5('0x3d')]=_['keys'](db[_0xb4b5('0x65')][_0xb4b5('0x5d')]);_0x52dad3[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x29a671[_0xb4b5('0x3e')]);_0x52dad3['filters']=_[_0xb4b5('0x41')](_0x52dad3[_0xb4b5('0x3d')],_0x52dad3['query']);_0x31111c[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x52dad3['model'],qs[_0xb4b5('0x43')](_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x31111c[_0xb4b5('0x42')]=_0x31111c[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x31111c[_0xb4b5('0x42')]:_0x52dad3[_0xb4b5('0x3d')];if(!_0x29a671['query'][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x31111c[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x31111c['offset']=qs[_0xb4b5('0x21')](_0x29a671['query']['offset']);}_0x31111c['order']=qs['sort'](_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x31111c['where']=qs[_0xb4b5('0x40')](_['pick'](_0x29a671['query'],_0x52dad3[_0xb4b5('0x40')]));_0x31111c['where'][_0xb4b5('0x66')]=_0x14750c['id'];if(_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x31111c[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x31111c['where'],{'$or':_['map'](_0x31111c['attributes'],function(_0x2f059a){var _0x3ba715={};_0x3ba715[_0x2f059a]={'$like':'%'+_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x3ba715;})});}_0x31111c=_[_0xb4b5('0x4b')]({},_0x31111c,_0x29a671[_0xb4b5('0x4d')]);return db[_0xb4b5('0x65')][_0xb4b5('0x24')]({'where':_0x31111c[_0xb4b5('0x49')]})['then'](function(_0x21881f){_0x1b0994[_0xb4b5('0x24')]=_0x21881f;if(_0x29a671[_0xb4b5('0x3e')][_0xb4b5('0x4e')]){_0x31111c['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x31111c);})[_0xb4b5('0x29')](function(_0x419428){_0x1b0994[_0xb4b5('0x67')]=_0x419428;return _0x1b0994;});}})[_0xb4b5('0x29')](respondWithFilteredResult(_0x3483d5,_0x31111c))[_0xb4b5('0x50')](handleError(_0x3483d5,null));};exports[_0xb4b5('0x68')]=function(_0x5cf383,_0x412498,_0x5d9d59){var _0x5af3ec={'raw':!![],'where':{}};var _0x209a8d={};var _0x2a69b2={'count':0x0,'rows':[]};return db[_0xb4b5('0x3a')]['findOne']({'where':{'id':_0x5cf383[_0xb4b5('0x52')]['id']}})['then'](handleEntityNotFound(_0x412498,null))[_0xb4b5('0x29')](function(_0x3e9856){if(_0x3e9856){_0x209a8d[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0x69')][_0xb4b5('0x5d')]);_0x209a8d[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x5cf383[_0xb4b5('0x3e')]);_0x209a8d[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x209a8d[_0xb4b5('0x3d')],_0x209a8d[_0xb4b5('0x3e')]);_0x5af3ec[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x209a8d[_0xb4b5('0x3d')],qs['fields'](_0x5cf383[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x5af3ec[_0xb4b5('0x42')]=_0x5af3ec['attributes']['length']?_0x5af3ec['attributes']:_0x209a8d[_0xb4b5('0x3d')];if(!_0x5cf383[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x5af3ec[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x5cf383[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x5af3ec[_0xb4b5('0x21')]=qs[_0xb4b5('0x21')](_0x5cf383[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}_0x5af3ec[_0xb4b5('0x47')]=qs[_0xb4b5('0x48')](_0x5cf383['query'][_0xb4b5('0x48')]);_0x5af3ec['where']=qs[_0xb4b5('0x40')](_['pick'](_0x5cf383[_0xb4b5('0x3e')],_0x209a8d[_0xb4b5('0x40')]));_0x5af3ec['where'][_0xb4b5('0x66')]=_0x3e9856['id'];if(_0x5cf383['query']['filter']){_0x5af3ec[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x5af3ec[_0xb4b5('0x49')],{'$or':_[_0xb4b5('0x39')](_0x5af3ec[_0xb4b5('0x42')],function(_0x15ef45){var _0x5c3a75={};_0x5c3a75[_0x15ef45]={'$like':'%'+_0x5cf383['query'][_0xb4b5('0x2e')]+'%'};return _0x5c3a75;})});}_0x5af3ec=_[_0xb4b5('0x4b')]({},_0x5af3ec,_0x5cf383[_0xb4b5('0x4d')]);return db[_0xb4b5('0x69')]['count']({'where':_0x5af3ec[_0xb4b5('0x49')]})[_0xb4b5('0x29')](function(_0x1b9a59){_0x2a69b2['count']=_0x1b9a59;if(_0x5cf383[_0xb4b5('0x3e')][_0xb4b5('0x4e')]){_0x5af3ec[_0xb4b5('0x4f')]=[{'all':!![]}];}return db[_0xb4b5('0x69')]['findAll'](_0x5af3ec);})['then'](function(_0x2daaa7){_0x2a69b2[_0xb4b5('0x67')]=_0x2daaa7;return _0x2a69b2;});}})[_0xb4b5('0x29')](respondWithFilteredResult(_0x412498,_0x5af3ec))['catch'](handleError(_0x412498,null));};exports['getHopperFinals']=function(_0x49e26c,_0x2c9936,_0x241ec6){var _0x467a4b={'raw':!![],'where':{}};var _0x4882de={};var _0x21f412={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb4b5('0x6a')]({'where':{'id':_0x49e26c[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x2c9936,null))[_0xb4b5('0x29')](function(_0x3a2135){if(_0x3a2135){_0x4882de[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0x6b')]['rawAttributes']);_0x4882de['query']=_[_0xb4b5('0x3f')](_0x49e26c[_0xb4b5('0x3e')]);_0x4882de[_0xb4b5('0x40')]=_['intersection'](_0x4882de[_0xb4b5('0x3d')],_0x4882de['query']);_0x467a4b['attributes']=_[_0xb4b5('0x41')](_0x4882de['model'],qs[_0xb4b5('0x43')](_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x467a4b[_0xb4b5('0x42')]=_0x467a4b[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x467a4b['attributes']:_0x4882de['model'];if(!_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x467a4b[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x467a4b[_0xb4b5('0x21')]=qs[_0xb4b5('0x21')](_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}_0x467a4b[_0xb4b5('0x47')]=qs[_0xb4b5('0x48')](_0x49e26c[_0xb4b5('0x3e')]['sort']);_0x467a4b['where']=qs[_0xb4b5('0x40')](_[_0xb4b5('0x4a')](_0x49e26c['query'],_0x4882de[_0xb4b5('0x40')]));_0x467a4b[_0xb4b5('0x49')][_0xb4b5('0x66')]=_0x3a2135['id'];if(_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x467a4b[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x467a4b[_0xb4b5('0x49')],{'$or':_[_0xb4b5('0x39')](_0x467a4b[_0xb4b5('0x42')],function(_0x72f230){var _0x1374ae={};_0x1374ae[_0x72f230]={'$like':'%'+_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x1374ae;})});}_0x467a4b=_['merge']({},_0x467a4b,_0x49e26c[_0xb4b5('0x4d')]);return db[_0xb4b5('0x6b')][_0xb4b5('0x24')]({'where':_0x467a4b['where']})[_0xb4b5('0x29')](function(_0x48f279){_0x21f412[_0xb4b5('0x24')]=_0x48f279;if(_0x49e26c[_0xb4b5('0x3e')][_0xb4b5('0x4e')]){_0x467a4b[_0xb4b5('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x467a4b);})[_0xb4b5('0x29')](function(_0x340655){_0x21f412[_0xb4b5('0x67')]=_0x340655;return _0x21f412;});}})['then'](respondWithFilteredResult(_0x2c9936,_0x467a4b))[_0xb4b5('0x50')](handleError(_0x2c9936,null));};exports[_0xb4b5('0x6c')]=function(_0x15a2b7,_0x323016,_0x5e5ea6){var _0x2fa9d9={'raw':!![],'where':{}};var _0x57e4dc={};var _0x56d27e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x15a2b7[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x323016,null))[_0xb4b5('0x29')](function(_0x1961e8){if(_0x1961e8){_0x57e4dc[_0xb4b5('0x3d')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x57e4dc[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x15a2b7[_0xb4b5('0x3e')]);_0x57e4dc['filters']=_[_0xb4b5('0x41')](_0x57e4dc[_0xb4b5('0x3d')],_0x57e4dc[_0xb4b5('0x3e')]);_0x2fa9d9[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x57e4dc[_0xb4b5('0x3d')],qs['fields'](_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x2fa9d9[_0xb4b5('0x42')]=_0x2fa9d9['attributes']['length']?_0x2fa9d9[_0xb4b5('0x42')]:_0x57e4dc[_0xb4b5('0x3d')];if(!_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x2fa9d9[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x15a2b7[_0xb4b5('0x3e')]['limit']);_0x2fa9d9[_0xb4b5('0x21')]=qs[_0xb4b5('0x21')](_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}_0x2fa9d9[_0xb4b5('0x47')]=qs['sort'](_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x2fa9d9['where']=qs[_0xb4b5('0x40')](_[_0xb4b5('0x4a')](_0x15a2b7[_0xb4b5('0x3e')],_0x57e4dc[_0xb4b5('0x40')]));_0x2fa9d9[_0xb4b5('0x49')]['VoiceQueueId']=_0x1961e8['id'];if(_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x2fa9d9[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x2fa9d9[_0xb4b5('0x49')],{'$or':_[_0xb4b5('0x39')](_0x2fa9d9[_0xb4b5('0x42')],function(_0x13b166){var _0x14a65b={};_0x14a65b[_0x13b166]={'$like':'%'+_0x15a2b7[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x14a65b;})});}_0x2fa9d9=_[_0xb4b5('0x4b')]({},_0x2fa9d9,_0x15a2b7['options']);return db[_0xb4b5('0x6d')][_0xb4b5('0x24')]({'where':_0x2fa9d9[_0xb4b5('0x49')]})[_0xb4b5('0x29')](function(_0x519fe1){_0x56d27e[_0xb4b5('0x24')]=_0x519fe1;if(_0x15a2b7['query'][_0xb4b5('0x4e')]){_0x2fa9d9[_0xb4b5('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2fa9d9);})['then'](function(_0x18b99b){_0x56d27e[_0xb4b5('0x67')]=_0x18b99b;return _0x56d27e;});}})['then'](respondWithFilteredResult(_0x323016,_0x2fa9d9))[_0xb4b5('0x50')](handleError(_0x323016,null));};exports[_0xb4b5('0x6e')]=function(_0x110697,_0x1fd9f3,_0xee0052){var _0x4e0d1f={};var _0x5c4483={};var _0x19cd39;var _0x3910c1;return db[_0xb4b5('0x3a')][_0xb4b5('0x6a')]({'where':{'id':_0x110697['params']['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x1fd9f3,null))[_0xb4b5('0x29')](function(_0x3b85f6){if(_0x3b85f6){_0x19cd39=_0x3b85f6;_0x5c4483[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0x6f')]['rawAttributes']);_0x5c4483['query']=_[_0xb4b5('0x3f')](_0x110697[_0xb4b5('0x3e')]);_0x5c4483[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x5c4483[_0xb4b5('0x3d')],_0x5c4483['query']);_0x4e0d1f[_0xb4b5('0x42')]=_['intersection'](_0x5c4483[_0xb4b5('0x3d')],qs[_0xb4b5('0x43')](_0x110697['query'][_0xb4b5('0x43')]));_0x4e0d1f['attributes']=_0x4e0d1f['attributes']['length']?_0x4e0d1f[_0xb4b5('0x42')]:_0x5c4483[_0xb4b5('0x3d')];_0x4e0d1f['order']=qs[_0xb4b5('0x48')](_0x110697[_0xb4b5('0x3e')]['sort']);_0x4e0d1f['where']=qs[_0xb4b5('0x40')](_['pick'](_0x110697[_0xb4b5('0x3e')],_0x5c4483[_0xb4b5('0x40')]));if(_0x110697[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x4e0d1f[_0xb4b5('0x49')]=_['merge'](_0x4e0d1f['where'],{'$or':_[_0xb4b5('0x39')](_0x4e0d1f[_0xb4b5('0x42')],function(_0x2b6edb){var _0x253dab={};_0x253dab[_0x2b6edb]={'$like':'%'+_0x110697[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x253dab;})});}_0x4e0d1f=_[_0xb4b5('0x4b')]({},_0x4e0d1f,_0x110697['options']);return _0x19cd39[_0xb4b5('0x6e')](_0x4e0d1f);}})['then'](function(_0x13aa91){if(_0x13aa91){_0x3910c1=_0x13aa91[_0xb4b5('0x44')];if(!_0x110697[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x4e0d1f[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x110697[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x4e0d1f['offset']=qs[_0xb4b5('0x21')](_0x110697[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}return _0x19cd39[_0xb4b5('0x6e')](_0x4e0d1f);}})['then'](function(_0x3bdce6){if(_0x3bdce6){return _0x3bdce6?{'count':_0x3910c1,'rows':_0x3bdce6}:null;}})[_0xb4b5('0x29')](respondWithResult(_0x1fd9f3,null))[_0xb4b5('0x50')](handleError(_0x1fd9f3,null));};exports[_0xb4b5('0x70')]=function(_0x4489c2,_0x85fda8,_0x1b6418){var _0x67eb47=_0x4489c2[_0xb4b5('0x54')][_0xb4b5('0x71')];var _0x1f8844=_[_0xb4b5('0x39')](_0x67eb47,'id');return db['Team']['findAll']({'where':{'id':_0x1f8844},'attributes':['id'],'include':[{'model':db[_0xb4b5('0x72')],'as':_0xb4b5('0x73'),'attributes':['id',_0xb4b5('0x34'),'online',_0xb4b5('0x74'),_0xb4b5('0x75')],'raw':!![]}]})[_0xb4b5('0x29')](function(_0x3c160e){if(_0x3c160e){var _0x401a15=_['flatMap'](_0x3c160e,function(_0x4da655){var _0x82e27=_0x4da655[_0xb4b5('0x2b')]({'plain':!![]});_0x82e27[_0xb4b5('0x73')][_0xb4b5('0x76')](function(_0x2c58be){_0x2c58be[_0xb4b5('0x77')]=_[_0xb4b5('0x33')](_0x67eb47,{'id':_0x82e27['id']})['penalty'];});return _0x82e27['Agents'];});return db[_0xb4b5('0x3a')][_0xb4b5('0x33')]({'where':{'id':_0x4489c2[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](function(_0x30a532){return db[_0xb4b5('0x78')][_0xb4b5('0x79')](function(_0x3c118d){return _0x30a532['addTeams'](_0x1f8844,{'transaction':_0x3c118d})[_0xb4b5('0x29')](function(){return BPromise[_0xb4b5('0x7a')](_0x67eb47,function(_0x5d8f9c){return db[_0xb4b5('0x7b')][_0xb4b5('0x7c')]({'TeamId':_0x5d8f9c['id'],'VoiceQueueId':_0x4489c2[_0xb4b5('0x52')]['id'],'penalty':_0x5d8f9c[_0xb4b5('0x77')]},{'transaction':_0x3c118d});});})[_0xb4b5('0x29')](function(){return BPromise['each'](_0x401a15,function(_0x1cbdd2){return db['UserVoiceQueue'][_0xb4b5('0x7d')]({'where':{'UserId':_0x1cbdd2['id'],'VoiceQueueId':_0x4489c2['params']['id']},'defaults':{'penalty':_0x1cbdd2[_0xb4b5('0x77')]},'transaction':_0x3c118d});});})['then'](function(){return BPromise[_0xb4b5('0x7a')](_[_0xb4b5('0x2e')](_0x401a15,{'online':!![]}),function(_0xb5bfa2){return db[_0xb4b5('0x7e')]['upsert']({'membername':_0xb5bfa2['name'],'UserId':_0xb5bfa2['id'],'queue_name':_0x30a532[_0xb4b5('0x34')],'VoiceQueueId':_0x30a532['id'],'interface':_[_0xb4b5('0x7f')](_0xb5bfa2[_0xb4b5('0x75')])?util[_0xb4b5('0x80')](_0xb4b5('0x81'),_0xb5bfa2[_0xb4b5('0x34')]):_0xb5bfa2[_0xb4b5('0x75')],'paused':_0xb5bfa2[_0xb4b5('0x74')]||![],'penalty':_0xb5bfa2['penalty']},{'transaction':_0x3c118d});});})[_0xb4b5('0x29')](function(){_0x401a15[_0xb4b5('0x76')](function(_0x53d4f5){socket[_0xb4b5('0x82')]('userVoiceQueue:save',{'UserId':_0x53d4f5['id'],'VoiceQueueId':_0x30a532['id']});});});});});}})['then'](respondWithStatusCode(_0x85fda8,null))['catch'](handleError(_0x85fda8,null));};exports[_0xb4b5('0x83')]=function(_0x58163c,_0x2ef10b,_0xc91225){return db['Team']['findAll']({'where':{'id':_0x58163c[_0xb4b5('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb4b5('0x72')],'as':_0xb4b5('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb4b5('0x29')](handleEntityNotFound(_0x2ef10b,null))[_0xb4b5('0x29')](function(_0x4b0654){var _0x4794e0=_['map'](_0x4b0654,'id');var _0x391e14=[];var _0x1603f9=[];var _0x813091=squel[_0xb4b5('0x84')]();_0x813091['field'](_0xb4b5('0x85'))[_0xb4b5('0x86')](_0xb4b5('0x87'),'tq')[_0xb4b5('0x88')]('user_has_teams','ut',_0xb4b5('0x89'))[_0xb4b5('0x49')](_0xb4b5('0x8a'),_0x58163c[_0xb4b5('0x52')]['id']);for(var _0x3e8223=0x0;_0x3e8223<_0x4b0654['length'];_0x3e8223+=0x1){let _0x2149aa=_0x4b0654[_0x3e8223];for(var _0x1ad80b=0x0;_0x1ad80b<_0x2149aa['Agents'][_0xb4b5('0x44')];_0x1ad80b+=0x1){let _0x21776c=_0x2149aa[_0xb4b5('0x73')][_0x1ad80b];var _0x3a62f9=_0x813091[_0xb4b5('0x5c')]();_0x3a62f9[_0xb4b5('0x49')](_0xb4b5('0x8b'),_0x21776c['id']);_0x1603f9[_0xb4b5('0x8c')](db[_0xb4b5('0x78')][_0xb4b5('0x3e')](_0x3a62f9[_0xb4b5('0x8d')](),{'type':db[_0xb4b5('0x78')]['QueryTypes'][_0xb4b5('0x8e')]})['then'](function(_0x4611a4){if(_0x4611a4[_0xb4b5('0x44')]===0x1){return _0x21776c['id'];}else{var _0x296c78=_[_0xb4b5('0x8f')](_[_0xb4b5('0x39')](_0x4611a4,_0xb4b5('0x90')),function(_0x6ea610){return _[_0xb4b5('0x31')](_0x4794e0,_0x6ea610);});if(_0x296c78){return _0x21776c['id'];}}}));}}return BPromise[_0xb4b5('0x91')](_0x1603f9)[_0xb4b5('0x29')](function(_0x38d0fd){_0x391e14=_(_0x391e14)[_0xb4b5('0x92')](_0x38d0fd)[_0xb4b5('0x93')]()[_0xb4b5('0x30')]();return db['VoiceQueue'][_0xb4b5('0x33')]({'where':{'id':_0x58163c[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](function(_0xcdcb68){return db['sequelize'][_0xb4b5('0x79')](function(_0x4b5111){return _0xcdcb68[_0xb4b5('0x83')](_0x58163c[_0xb4b5('0x3e')][_0xb4b5('0x94')],{'transaction':_0x4b5111})[_0xb4b5('0x29')](function(){if(!_[_0xb4b5('0x95')](_0x391e14)){return _0xcdcb68['removeAgents'](_0x391e14,{'transaction':_0x4b5111})[_0xb4b5('0x29')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x58163c[_0xb4b5('0x52')]['id'],'UserId':_0x391e14},'transaction':_0x4b5111});});}})['then'](function(){_0x391e14[_0xb4b5('0x76')](function(_0x4e74ef){socket['emit'](_0xb4b5('0x96'),{'UserId':_0x4e74ef,'VoiceQueueId':_0xcdcb68['id']});});});});});});})[_0xb4b5('0x29')](respondWithStatusCode(_0x2ef10b,null))['catch'](handleError(_0x2ef10b,null));};exports[_0xb4b5('0x97')]=function(_0x2d680f,_0x589a31,_0x1c2854){var _0x2b4c85,_0x432716;return db[_0xb4b5('0x3a')][_0xb4b5('0x33')]({'where':{'id':_0x2d680f[_0xb4b5('0x52')]['id']}})['then'](handleEntityNotFound(_0x589a31,null))[_0xb4b5('0x29')](function(_0x5d468a){if(_0x5d468a){_0x432716=_0x5d468a;return _0x5d468a[_0xb4b5('0x97')](_0x2d680f[_0xb4b5('0x54')][_0xb4b5('0x94')],_['omit'](_0x2d680f['body'],[_0xb4b5('0x94'),'id'])||{})[_0xb4b5('0x98')](function(_0x42a68d){for(var _0x1b1beb=0x0;_0x1b1beb<_0x2d680f[_0xb4b5('0x54')][_0xb4b5('0x94')][_0xb4b5('0x44')];_0x1b1beb+=0x1){socket[_0xb4b5('0x82')]('userVoiceQueue:save',{'UserId':Number(_0x2d680f['body']['ids'][_0x1b1beb]),'VoiceQueueId':Number(_0x2d680f['params']['id'])});}return _0x42a68d;});}})[_0xb4b5('0x29')](function(_0x24b657){_0x2b4c85=_0x24b657||[];if(_0x432716){return db['User'][_0xb4b5('0x99')]({'where':{'id':_0x2d680f[_0xb4b5('0x54')][_0xb4b5('0x94')]},'attributes':['id',_0xb4b5('0x34'),_0xb4b5('0x9a'),'voicePause',_0xb4b5('0x75')],'raw':!![]});}})[_0xb4b5('0x29')](function(_0x9ab112){if(!_[_0xb4b5('0x95')](_0x9ab112)){var _0x52dbfc=[];for(var _0x2fb5fb=0x0;_0x2fb5fb<_0x9ab112[_0xb4b5('0x44')];_0x2fb5fb++){if(_0x9ab112[_0x2fb5fb][_0xb4b5('0x9a')]){_0x52dbfc['push'](db[_0xb4b5('0x7e')][_0xb4b5('0x7c')]({'membername':_0x9ab112[_0x2fb5fb][_0xb4b5('0x34')],'UserId':_0x9ab112[_0x2fb5fb]['id'],'queue_name':_0x432716[_0xb4b5('0x34')],'VoiceQueueId':_0x432716['id'],'interface':_[_0xb4b5('0x7f')](_0x9ab112[_0x2fb5fb][_0xb4b5('0x75')])?util['format'](_0xb4b5('0x81'),_0x9ab112[_0x2fb5fb][_0xb4b5('0x34')]):_0x9ab112[_0x2fb5fb][_0xb4b5('0x75')],'paused':_0x9ab112[_0x2fb5fb][_0xb4b5('0x74')]||![],'penalty':_0x2d680f[_0xb4b5('0x54')]['penalty']||0x0}));}}return BPromise[_0xb4b5('0x91')](_0x52dbfc);}})[_0xb4b5('0x29')](function(){return _0x2b4c85;})['then'](respondWithResult(_0x589a31,null))[_0xb4b5('0x50')](handleError(_0x589a31,null));};exports['removeAgents']=function(_0x1bfc2f,_0x274670,_0x120e61){return db[_0xb4b5('0x3a')][_0xb4b5('0x33')]({'where':{'id':_0x1bfc2f[_0xb4b5('0x52')]['id']}})['then'](handleEntityNotFound(_0x274670,null))[_0xb4b5('0x29')](function(_0x1ed347){if(_0x1ed347){return _0x1ed347[_0xb4b5('0x9b')](_0x1bfc2f[_0xb4b5('0x3e')][_0xb4b5('0x94')])[_0xb4b5('0x29')](function(){if(_[_0xb4b5('0x9c')](_0x1bfc2f[_0xb4b5('0x3e')]['ids'])){for(var _0x37eb61=0x0;_0x37eb61<_0x1bfc2f[_0xb4b5('0x3e')][_0xb4b5('0x94')][_0xb4b5('0x44')];_0x37eb61+=0x1){socket[_0xb4b5('0x82')](_0xb4b5('0x96'),{'UserId':Number(_0x1bfc2f['query'][_0xb4b5('0x94')][_0x37eb61]),'VoiceQueueId':Number(_0x1bfc2f[_0xb4b5('0x52')]['id'])});}}else{socket[_0xb4b5('0x82')](_0xb4b5('0x96'),{'UserId':Number(_0x1bfc2f['query'][_0xb4b5('0x94')]),'VoiceQueueId':Number(_0x1bfc2f[_0xb4b5('0x52')]['id'])});}});}})[_0xb4b5('0x29')](function(_0x23d00d){return db[_0xb4b5('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x1bfc2f[_0xb4b5('0x52')]['id'],'UserId':_0x1bfc2f['query'][_0xb4b5('0x94')]}})[_0xb4b5('0x29')](function(){return _0x23d00d;});})[_0xb4b5('0x29')](respondWithStatusCode(_0x274670,null))[_0xb4b5('0x50')](handleError(_0x274670,null));};exports[_0xb4b5('0x9d')]=function(_0x1b8221,_0x8cfa62,_0x29fcbe){var _0x1accb5={};var _0x19d6b9={};var _0x47c1f3;var _0x278880;return db[_0xb4b5('0x3a')]['findOne']({'where':{'id':_0x1b8221['params']['id']}})['then'](handleEntityNotFound(_0x8cfa62,null))[_0xb4b5('0x29')](function(_0x5f0ea5){if(_0x5f0ea5){_0x47c1f3=_0x5f0ea5;_0x19d6b9[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db['User'][_0xb4b5('0x5d')]);_0x19d6b9[_0xb4b5('0x3e')]=_['keys'](_0x1b8221[_0xb4b5('0x3e')]);_0x19d6b9[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x19d6b9[_0xb4b5('0x3d')],_0x19d6b9[_0xb4b5('0x3e')]);_0x1accb5[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x19d6b9['model'],qs[_0xb4b5('0x43')](_0x1b8221['query'][_0xb4b5('0x43')]));_0x1accb5[_0xb4b5('0x42')]=_0x1accb5['attributes'][_0xb4b5('0x44')]?_0x1accb5[_0xb4b5('0x42')]:_0x19d6b9[_0xb4b5('0x3d')];_0x1accb5[_0xb4b5('0x47')]=qs[_0xb4b5('0x48')](_0x1b8221[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x1accb5['where']=qs[_0xb4b5('0x40')](_[_0xb4b5('0x4a')](_0x1b8221['query'],_0x19d6b9['filters']));if(_0x1b8221['query'][_0xb4b5('0x2e')]){_0x1accb5[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x1accb5['where'],{'$or':_[_0xb4b5('0x39')](_0x1accb5[_0xb4b5('0x42')],function(_0x2f4d8c){var _0x45484f={};_0x45484f[_0x2f4d8c]={'$like':'%'+_0x1b8221['query']['filter']+'%'};return _0x45484f;})});}_0x1accb5=_[_0xb4b5('0x4b')]({},_0x1accb5,_0x1b8221['options']);return _0x47c1f3[_0xb4b5('0x9d')](_0x1accb5);}})[_0xb4b5('0x29')](function(_0x233aa3){if(_0x233aa3){_0x278880=_0x233aa3[_0xb4b5('0x44')];if(!_0x1b8221[_0xb4b5('0x3e')]['hasOwnProperty']('nolimit')){_0x1accb5['limit']=qs[_0xb4b5('0x22')](_0x1b8221[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x1accb5[_0xb4b5('0x21')]=qs['offset'](_0x1b8221[_0xb4b5('0x3e')][_0xb4b5('0x21')]);}return _0x47c1f3[_0xb4b5('0x9d')](_0x1accb5);}})[_0xb4b5('0x29')](function(_0x4fc21e){if(_0x4fc21e){return _0x4fc21e?{'count':_0x278880,'rows':_0x4fc21e}:null;}})[_0xb4b5('0x29')](respondWithResult(_0x8cfa62,null))[_0xb4b5('0x50')](handleError(_0x8cfa62,null));};exports[_0xb4b5('0x9e')]=function(_0x53dd73,_0x68f2f,_0x33460f){var _0x580124={};var _0x57afc4={};var _0x49489f;var _0x2cff2c;return db[_0xb4b5('0x3a')][_0xb4b5('0x6a')]({'where':{'id':_0x53dd73[_0xb4b5('0x52')]['id']}})['then'](handleEntityNotFound(_0x68f2f,null))[_0xb4b5('0x29')](function(_0x2a7103){if(_0x2a7103){_0x49489f=_0x2a7103;_0x57afc4[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0x7e')][_0xb4b5('0x5d')]);_0x57afc4[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0x53dd73['query']);_0x57afc4[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0x57afc4[_0xb4b5('0x3d')],_0x57afc4[_0xb4b5('0x3e')]);_0x580124[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x57afc4[_0xb4b5('0x3d')],qs[_0xb4b5('0x43')](_0x53dd73['query'][_0xb4b5('0x43')]));_0x580124['attributes']=_0x580124[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x580124[_0xb4b5('0x42')]:_0x57afc4['model'];_0x580124['order']=qs[_0xb4b5('0x48')](_0x53dd73[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x580124[_0xb4b5('0x49')]=qs[_0xb4b5('0x40')](_[_0xb4b5('0x4a')](_0x53dd73['query'],_0x57afc4[_0xb4b5('0x40')]));if(_0x53dd73[_0xb4b5('0x3e')]['filter']){_0x580124['where']=_[_0xb4b5('0x4b')](_0x580124[_0xb4b5('0x49')],{'$or':_[_0xb4b5('0x39')](_0x580124[_0xb4b5('0x42')],function(_0x45c8a2){var _0x458711={};_0x458711[_0x45c8a2]={'$like':'%'+_0x53dd73[_0xb4b5('0x3e')][_0xb4b5('0x2e')]+'%'};return _0x458711;})});}_0x580124=_[_0xb4b5('0x4b')]({},_0x580124,_0x53dd73[_0xb4b5('0x4d')]);return _0x49489f[_0xb4b5('0x9e')](_0x580124);}})[_0xb4b5('0x29')](function(_0x1802ec){if(_0x1802ec){_0x2cff2c=_0x1802ec[_0xb4b5('0x44')];if(!_0x53dd73[_0xb4b5('0x3e')]['hasOwnProperty'](_0xb4b5('0x46'))){_0x580124[_0xb4b5('0x22')]=qs[_0xb4b5('0x22')](_0x53dd73['query']['limit']);_0x580124[_0xb4b5('0x21')]=qs['offset'](_0x53dd73['query']['offset']);}return _0x49489f['getMembers'](_0x580124);}})[_0xb4b5('0x29')](function(_0x3932d6){return _0x3932d6?{'count':_0x2cff2c,'rows':_0x3932d6}:null;})[_0xb4b5('0x29')](respondWithResult(_0x68f2f,null))[_0xb4b5('0x50')](handleError(_0x68f2f,null));};exports[_0xb4b5('0x9f')]=function(_0xb5b23a,_0x52e1c4,_0x3ee7b0){var _0x20d478={};var _0x4d4b99={};var _0x2f3ca8;var _0x1dc208;return db['VoiceQueue'][_0xb4b5('0x6a')]({'where':{'id':_0xb5b23a[_0xb4b5('0x52')]['id']}})['then'](handleEntityNotFound(_0x52e1c4,null))['then'](function(_0xe36d2f){if(_0xe36d2f){_0x2f3ca8=_0xe36d2f;_0x4d4b99[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0xa0')][_0xb4b5('0x5d')]);_0x4d4b99[_0xb4b5('0x3e')]=_[_0xb4b5('0x3f')](_0xb5b23a[_0xb4b5('0x3e')]);_0x4d4b99[_0xb4b5('0x40')]=_['intersection'](_0x4d4b99[_0xb4b5('0x3d')],_0x4d4b99['query']);_0x20d478[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0x4d4b99[_0xb4b5('0x3d')],qs[_0xb4b5('0x43')](_0xb5b23a[_0xb4b5('0x3e')]['fields']));_0x20d478['attributes']=_0x20d478[_0xb4b5('0x42')][_0xb4b5('0x44')]?_0x20d478[_0xb4b5('0x42')]:_0x4d4b99['model'];_0x20d478[_0xb4b5('0x47')]=qs[_0xb4b5('0x48')](_0xb5b23a['query']['sort']);_0x20d478['where']=qs[_0xb4b5('0x40')](_['pick'](_0xb5b23a[_0xb4b5('0x3e')],_0x4d4b99[_0xb4b5('0x40')]));if(_0xb5b23a[_0xb4b5('0x3e')][_0xb4b5('0x2e')]){_0x20d478[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x20d478['where'],{'$or':_[_0xb4b5('0x39')](_0x20d478[_0xb4b5('0x42')],function(_0x22bd02){var _0x1366b6={};_0x1366b6[_0x22bd02]={'$like':'%'+_0xb5b23a['query'][_0xb4b5('0x2e')]+'%'};return _0x1366b6;})});}_0x20d478=_[_0xb4b5('0x4b')]({},_0x20d478,_0xb5b23a[_0xb4b5('0x4d')]);return _0x2f3ca8['getLists'](_0x20d478);}})[_0xb4b5('0x29')](function(_0x5d0bdc){if(_0x5d0bdc){_0x1dc208=_0x5d0bdc[_0xb4b5('0x44')];if(!_0xb5b23a[_0xb4b5('0x3e')][_0xb4b5('0x45')](_0xb4b5('0x46'))){_0x20d478[_0xb4b5('0x22')]=qs['limit'](_0xb5b23a[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x20d478['offset']=qs[_0xb4b5('0x21')](_0xb5b23a['query']['offset']);}return _0x2f3ca8[_0xb4b5('0x9f')](_0x20d478);}})[_0xb4b5('0x29')](function(_0x329127){if(_0x329127){return _0x329127?{'count':_0x1dc208,'rows':_0x329127}:null;}})[_0xb4b5('0x29')](respondWithResult(_0x52e1c4,null))[_0xb4b5('0x50')](handleError(_0x52e1c4,null));};exports['addLists']=function(_0xdcc27e,_0x101244,_0x4534de){var _0x1b7c71,_0x4dac54;return db[_0xb4b5('0x3a')][_0xb4b5('0x33')]({'where':{'id':_0xdcc27e[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x101244,null))[_0xb4b5('0x29')](function(_0x3931ef){if(_0x3931ef){_0x4dac54=_0x3931ef;return _0x3931ef['addLists'](_0xdcc27e[_0xb4b5('0x54')][_0xb4b5('0x94')],_[_0xb4b5('0x5e')](_0xdcc27e[_0xb4b5('0x54')],[_0xb4b5('0x94'),'id'])||{});}return null;})['spread'](function(_0x21750d){var _0x3fb72e;_0x1b7c71=_0x21750d||[];var _0x5226a2=[];if(_0x21750d){for(var _0x2285fd=0x0;_0x2285fd<_0x21750d[_0xb4b5('0x44')];_0x2285fd+=0x1){var _0x4f4a4a=_0x21750d[_0x2285fd][_0xb4b5('0x2b')]({'plain':!![]});_0x4dac54[_0xb4b5('0xa1')]=_0xdcc27e['body'][_0xb4b5('0xa1')]?_0xdcc27e[_0xb4b5('0x54')][_0xb4b5('0xa1')]:_0x4dac54['dialCheckDuplicateType'];switch(_0x4dac54[_0xb4b5('0xa1')]){case _0xb4b5('0xa2'):_0x3fb72e=squel[_0xb4b5('0xa3')]()['into']('cm_hopper')[_0xb4b5('0xa4')]([_0xb4b5('0xa5'),_0xb4b5('0xa6'),'ContactId',_0xb4b5('0xa7'),_0xb4b5('0x66'),'createdAt',_0xb4b5('0x60')],squel[_0xb4b5('0x84')]()[_0xb4b5('0xa8')](_0xb4b5('0xa5'),_0xb4b5('0xa5'))[_0xb4b5('0xa8')](_0xb4b5('0xa9'),_0xb4b5('0xa6'))['field']('id',_0xb4b5('0xaa'))['field'](_0x4f4a4a[_0xb4b5('0xab')][_0xb4b5('0x8d')](),_0xb4b5('0xa7'))['field'](_0xdcc27e[_0xb4b5('0x52')]['id'][_0xb4b5('0x8d')](),'VoiceQueueId')[_0xb4b5('0xa8')](_0xb4b5('0xa9'),_0xb4b5('0x5f'))['field']('NOW()',_0xb4b5('0x60'))['from'](_0xb4b5('0xac'))[_0xb4b5('0x49')](_0xb4b5('0xad'))[_0xb4b5('0x49')](_0xb4b5('0xae'),_0x4f4a4a[_0xb4b5('0xab')][_0xb4b5('0x8d')]())['where'](_0xb4b5('0xaf'))[_0xb4b5('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb4b5('0x84')]()[_0xb4b5('0xa8')]('COALESCE(calleridnum,\x27\x27)')[_0xb4b5('0x86')](_0xb4b5('0xb0'))[_0xb4b5('0x49')]('VoiceQueueId\x20=\x20?',_0xdcc27e['params']['id']['toString']()))['where'](_0xb4b5('0xb1'),squel[_0xb4b5('0x84')]()[_0xb4b5('0xa8')](_0xb4b5('0xb2'))['from']('cm_hopper')['where'](_0xb4b5('0x8a'),_0xdcc27e[_0xb4b5('0x52')]['id']['toString']())))['toString']();break;case _0xb4b5('0xb3'):_0x3fb72e=squel[_0xb4b5('0xa3')]()[_0xb4b5('0xb4')](_0xb4b5('0xb5'))[_0xb4b5('0xa4')]([_0xb4b5('0xa5'),_0xb4b5('0xa6'),'ContactId','ListId','VoiceQueueId',_0xb4b5('0x5f'),_0xb4b5('0x60')],squel['select']()['field'](_0xb4b5('0xa5'),_0xb4b5('0xa5'))[_0xb4b5('0xa8')](_0xb4b5('0xa9'),_0xb4b5('0xa6'))[_0xb4b5('0xa8')]('id',_0xb4b5('0xaa'))[_0xb4b5('0xa8')](_0x4f4a4a[_0xb4b5('0xab')]['toString'](),_0xb4b5('0xa7'))[_0xb4b5('0xa8')](_0xdcc27e['params']['id'][_0xb4b5('0x8d')](),_0xb4b5('0x66'))['field']('NOW()',_0xb4b5('0x5f'))[_0xb4b5('0xa8')](_0xb4b5('0xa9'),_0xb4b5('0x60'))[_0xb4b5('0x86')](_0xb4b5('0xac'))[_0xb4b5('0x49')]('deletedAt\x20IS\x20NULL')[_0xb4b5('0x49')](_0xb4b5('0xae'),_0x4f4a4a[_0xb4b5('0xab')][_0xb4b5('0x8d')]())[_0xb4b5('0x49')](_0xb4b5('0xaf'))['where'](_0xb4b5('0xb1'),squel[_0xb4b5('0x84')]()[_0xb4b5('0xa8')](_0xb4b5('0xb2'))['from'](_0xb4b5('0xb5'))[_0xb4b5('0x49')](_0xb4b5('0x8a'),_0xdcc27e['params']['id']['toString']())))[_0xb4b5('0x8d')]();break;default:_0x3fb72e=squel['insert']()['into'](_0xb4b5('0xb5'))[_0xb4b5('0xa4')]([_0xb4b5('0xa5'),_0xb4b5('0xa6'),_0xb4b5('0xaa'),_0xb4b5('0xa7'),_0xb4b5('0x66'),_0xb4b5('0x5f'),_0xb4b5('0x60')],squel['select']()[_0xb4b5('0xa8')]('phone',_0xb4b5('0xa5'))[_0xb4b5('0xa8')](_0xb4b5('0xa9'),'scheduledAt')[_0xb4b5('0xa8')]('id',_0xb4b5('0xaa'))[_0xb4b5('0xa8')](_0x4f4a4a[_0xb4b5('0xab')][_0xb4b5('0x8d')](),_0xb4b5('0xa7'))[_0xb4b5('0xa8')](_0xdcc27e[_0xb4b5('0x52')]['id'][_0xb4b5('0x8d')](),_0xb4b5('0x66'))[_0xb4b5('0xa8')]('NOW()','createdAt')[_0xb4b5('0xa8')](_0xb4b5('0xa9'),'updatedAt')[_0xb4b5('0x86')](_0xb4b5('0xac'))[_0xb4b5('0x49')](_0xb4b5('0xad'))[_0xb4b5('0x49')]('ListId\x20=\x20?',_0x4f4a4a[_0xb4b5('0xab')]['toString']())[_0xb4b5('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x5226a2[_0xb4b5('0x8c')](db['sequelize']['query'](_0x3fb72e));}return BPromise['all'](_0x5226a2);}})['then'](function(){return _0x1b7c71;})[_0xb4b5('0x29')](respondWithResult(_0x101244,null))[_0xb4b5('0x50')](handleError(_0x101244,null));};exports[_0xb4b5('0xb6')]=function(_0x32b5cb,_0x277b50,_0xaadd3e){return db[_0xb4b5('0x3a')]['find']({'where':{'id':_0x32b5cb['params']['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x277b50,null))[_0xb4b5('0x29')](function(_0x390d29){if(_0x390d29){return _0x390d29[_0xb4b5('0xb6')](_0x32b5cb[_0xb4b5('0x3e')][_0xb4b5('0x94')]);}})[_0xb4b5('0x29')](function(_0x234e14){if(_0x234e14){return db['CmHopper']['destroy']({'where':{'ListId':_0x32b5cb[_0xb4b5('0x3e')][_0xb4b5('0x94')],'VoiceQueueId':_0x32b5cb[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](function(){return _0x234e14;});}})[_0xb4b5('0x29')](respondWithStatusCode(_0x277b50,null))[_0xb4b5('0x50')](handleError(_0x277b50,null));};exports['getBlackLists']=function(_0x41b0d9,_0x361345,_0x2e13ff){var _0x5d47f9={};var _0xac7324={};var _0x3de0be;var _0x46ace3;return db[_0xb4b5('0x3a')][_0xb4b5('0x6a')]({'where':{'id':_0x41b0d9['params']['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x361345,null))[_0xb4b5('0x29')](function(_0x1dd332){if(_0x1dd332){_0x3de0be=_0x1dd332;_0xac7324[_0xb4b5('0x3d')]=_[_0xb4b5('0x3f')](db[_0xb4b5('0xa0')][_0xb4b5('0x5d')]);_0xac7324[_0xb4b5('0x3e')]=_['keys'](_0x41b0d9[_0xb4b5('0x3e')]);_0xac7324[_0xb4b5('0x40')]=_[_0xb4b5('0x41')](_0xac7324[_0xb4b5('0x3d')],_0xac7324[_0xb4b5('0x3e')]);_0x5d47f9[_0xb4b5('0x42')]=_[_0xb4b5('0x41')](_0xac7324['model'],qs['fields'](_0x41b0d9[_0xb4b5('0x3e')][_0xb4b5('0x43')]));_0x5d47f9[_0xb4b5('0x42')]=_0x5d47f9['attributes'][_0xb4b5('0x44')]?_0x5d47f9[_0xb4b5('0x42')]:_0xac7324[_0xb4b5('0x3d')];_0x5d47f9[_0xb4b5('0x47')]=qs['sort'](_0x41b0d9[_0xb4b5('0x3e')][_0xb4b5('0x48')]);_0x5d47f9['where']=qs['filters'](_[_0xb4b5('0x4a')](_0x41b0d9['query'],_0xac7324[_0xb4b5('0x40')]));if(_0x41b0d9['query']['filter']){_0x5d47f9[_0xb4b5('0x49')]=_[_0xb4b5('0x4b')](_0x5d47f9['where'],{'$or':_[_0xb4b5('0x39')](_0x5d47f9[_0xb4b5('0x42')],function(_0x44f85a){var _0x565065={};_0x565065[_0x44f85a]={'$like':'%'+_0x41b0d9['query'][_0xb4b5('0x2e')]+'%'};return _0x565065;})});}_0x5d47f9=_[_0xb4b5('0x4b')]({},_0x5d47f9,_0x41b0d9[_0xb4b5('0x4d')]);return _0x3de0be[_0xb4b5('0xb7')](_0x5d47f9);}})[_0xb4b5('0x29')](function(_0xd45185){if(_0xd45185){_0x46ace3=_0xd45185[_0xb4b5('0x44')];if(!_0x41b0d9[_0xb4b5('0x3e')][_0xb4b5('0x45')]('nolimit')){_0x5d47f9[_0xb4b5('0x22')]=qs['limit'](_0x41b0d9[_0xb4b5('0x3e')][_0xb4b5('0x22')]);_0x5d47f9[_0xb4b5('0x21')]=qs[_0xb4b5('0x21')](_0x41b0d9[_0xb4b5('0x3e')]['offset']);}return _0x3de0be['getBlackLists'](_0x5d47f9);}})['then'](function(_0x54bec4){if(_0x54bec4){return _0x54bec4?{'count':_0x46ace3,'rows':_0x54bec4}:null;}})[_0xb4b5('0x29')](respondWithResult(_0x361345,null))[_0xb4b5('0x50')](handleError(_0x361345,null));};exports[_0xb4b5('0xb8')]=function(_0x28636d,_0x748ff8,_0x43b6d2){var _0x469752,_0x34c97d;return db['VoiceQueue'][_0xb4b5('0x33')]({'where':{'id':_0x28636d['params']['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x748ff8,null))[_0xb4b5('0x29')](function(_0x5f293d){if(_0x5f293d){_0x34c97d=_0x5f293d;return _0x5f293d[_0xb4b5('0xb8')](_0x28636d[_0xb4b5('0x54')][_0xb4b5('0x94')],_['omit'](_0x28636d[_0xb4b5('0x54')],['ids','id'])||{});}return null;})[_0xb4b5('0x98')](function(_0x525ec9){var _0x415ffd;_0x469752=_0x525ec9||[];var _0x3e8262=[];if(_0x525ec9){for(var _0x16756f=0x0;_0x16756f<_0x525ec9[_0xb4b5('0x44')];_0x16756f+=0x1){var _0x32a110=_0x525ec9[_0x16756f][_0xb4b5('0x2b')]({'plain':!![]});_0x415ffd=squel[_0xb4b5('0xa3')]()[_0xb4b5('0xb4')](_0xb4b5('0xb9'))[_0xb4b5('0xa4')](['phone',_0xb4b5('0xaa'),_0xb4b5('0xa7'),'VoiceQueueId',_0xb4b5('0x5f'),_0xb4b5('0x60')],squel[_0xb4b5('0x84')]()[_0xb4b5('0xa8')](_0xb4b5('0xa5'),_0xb4b5('0xa5'))[_0xb4b5('0xa8')]('id',_0xb4b5('0xaa'))['field'](_0x32a110[_0xb4b5('0xab')][_0xb4b5('0x8d')](),_0xb4b5('0xa7'))[_0xb4b5('0xa8')](_0x28636d[_0xb4b5('0x52')]['id'][_0xb4b5('0x8d')](),_0xb4b5('0x66'))['field'](_0xb4b5('0xa9'),_0xb4b5('0x5f'))[_0xb4b5('0xa8')](_0xb4b5('0xa9'),_0xb4b5('0x60'))['from'](_0xb4b5('0xac'))[_0xb4b5('0x49')](_0xb4b5('0xad'))[_0xb4b5('0x49')]('ListId\x20=\x20?',_0x32a110['CmListId']['toString']())[_0xb4b5('0x49')](_0xb4b5('0xaf')))[_0xb4b5('0x8d')]();_0x3e8262[_0xb4b5('0x8c')](db[_0xb4b5('0x78')][_0xb4b5('0x3e')](_0x415ffd));}return BPromise[_0xb4b5('0x91')](_0x3e8262);}})[_0xb4b5('0x29')](function(){return _0x469752;})[_0xb4b5('0x29')](respondWithResult(_0x748ff8,null))[_0xb4b5('0x50')](handleError(_0x748ff8,null));};exports['removeBlackLists']=function(_0x19e596,_0x235081,_0xe96591){return db[_0xb4b5('0x3a')][_0xb4b5('0x33')]({'where':{'id':_0x19e596[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](handleEntityNotFound(_0x235081,null))['then'](function(_0x51f3bb){if(_0x51f3bb){return _0x51f3bb[_0xb4b5('0xba')](_0x19e596[_0xb4b5('0x3e')][_0xb4b5('0x94')]);}})['then'](function(_0x501b2c){if(_0x501b2c){return db['CmHopperBlack'][_0xb4b5('0x2a')]({'where':{'ListId':_0x19e596[_0xb4b5('0x3e')][_0xb4b5('0x94')],'VoiceQueueId':_0x19e596[_0xb4b5('0x52')]['id']}})[_0xb4b5('0x29')](function(){return _0x501b2c;});}})['then'](respondWithStatusCode(_0x235081,null))['catch'](handleError(_0x235081,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index e42c90f..89a54a6 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 _0x79f9=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x1eb9fe,_0x532436){var _0x5271c8=function(_0x2950fc){while(--_0x2950fc){_0x1eb9fe['push'](_0x1eb9fe['shift']());}};_0x5271c8(++_0x532436);}(_0x79f9,0xf0));var _0x979f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x79f9[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x979f('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x979f('0x1')](0x0);var events={'afterCreate':_0x979f('0x2'),'afterUpdate':'update','afterDestroy':_0x979f('0x3')};function emitEvent(_0x19aef9){return function(_0x418ba9,_0x4b8a38,_0x1eb46a){VoiceQueueEvents[_0x979f('0x4')](_0x19aef9+':'+_0x418ba9['id'],_0x418ba9);VoiceQueueEvents[_0x979f('0x4')](_0x19aef9,_0x418ba9);_0x1eb46a(null);};}for(var e in events){if(events[_0x979f('0x5')](e)){var event=events[e];VoiceQueue[_0x979f('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x475c=['VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xc8efe4,_0x30551f){var _0x3f562e=function(_0x5458db){while(--_0x5458db){_0xc8efe4['push'](_0xc8efe4['shift']());}};_0x3f562e(++_0x30551f);}(_0x475c,0xbb));var _0xc475=function(_0x2594dd,_0x13203d){_0x2594dd=_0x2594dd-0x0;var _0x53bc68=_0x475c[_0x2594dd];return _0x53bc68;};'use strict';var EventEmitter=require(_0xc475('0x0'));var VoiceQueue=require(_0xc475('0x1'))['db'][_0xc475('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc475('0x3')](0x0);var events={'afterCreate':_0xc475('0x4'),'afterUpdate':_0xc475('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12daa4){return function(_0x2cca74,_0x566cc1,_0x3ebf05){VoiceQueueEvents['emit'](_0x12daa4+':'+_0x2cca74['id'],_0x2cca74);VoiceQueueEvents[_0xc475('0x6')](_0x12daa4,_0x2cca74);_0x3ebf05(null);};}for(var e in events){if(events[_0xc475('0x7')](e)){var event=events[e];VoiceQueue[_0xc475('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 99aaf9a..a7f245a 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x1c6664,_0x45566e){var _0x33124b=function(_0x2c04bb){while(--_0x2c04bb){_0x1c6664['push'](_0x1c6664['shift']());}};_0x33124b(++_0x45566e);}(_0x3e74,0x175));var _0x43e7=function(_0x243625,_0x1a0b90){_0x243625=_0x243625-0x0;var _0x2c3032=_0x3e74[_0x243625];return _0x2c3032;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x722103,_0x5732f3){var _0x3e2435=function(_0x44c44a){while(--_0x44c44a){_0x722103['push'](_0x722103['shift']());}};_0x3e2435(++_0x5732f3);}(_0x008c,0x188));var _0xc008=function(_0x331085,_0x46ef3b){_0x331085=_0x331085-0x0;var _0x1547f4=_0x008c[_0x331085];return _0x1547f4;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a180bef..7dcbcb1 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 _0x997f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','VoiceQueue,\x20%s,\x20%s','catch','GetVoiceQueue','VoiceQueue','findAll','options','attributes','limit','map','include','stringify','ShowVoiceQueue','raw','where','model','lodash','util','bluebird','randomstring'];(function(_0x301c53,_0x512ef0){var _0x131a63=function(_0x53727e){while(--_0x53727e){_0x301c53['push'](_0x301c53['shift']());}};_0x131a63(++_0x512ef0);}(_0x997f,0x8c));var _0xf997=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x997f[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0xf997('0x0'));var util=require(_0xf997('0x1'));var moment=require('moment');var BPromise=require(_0xf997('0x2'));var rs=require(_0xf997('0x3'));var fs=require('fs');var Redis=require(_0xf997('0x4'));var db=require(_0xf997('0x5'))['db'];var utils=require(_0xf997('0x6'));var logger=require(_0xf997('0x7'))('rpc');var config=require(_0xf997('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf997('0x9')]=_['defaults'](config[_0xf997('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf997('0xa'))(new Redis(config[_0xf997('0x9')]));require(_0xf997('0xb'))[_0xf997('0xc')](socket);function respondWithRpcPromise(_0x3f5590,_0x50f25d,_0x1d7821){return new BPromise(function(_0x17c1ba,_0x1face9){return client[_0xf997('0xd')](_0x3f5590,_0x1d7821)[_0xf997('0xe')](function(_0x36f22){logger[_0xf997('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x50f25d,'request\x20sent');logger[_0xf997('0x10')](_0xf997('0x11'),_0x50f25d,_0xf997('0x12'),JSON['stringify'](_0x36f22));if(_0x36f22[_0xf997('0x13')]){if(_0x36f22[_0xf997('0x13')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x50f25d,_0x36f22[_0xf997('0x13')][_0xf997('0x14')]);return _0x1face9(_0x36f22['error']['message']);}logger[_0xf997('0x13')](_0xf997('0x15'),_0x50f25d,_0x36f22[_0xf997('0x13')][_0xf997('0x14')]);return _0x17c1ba(_0x36f22[_0xf997('0x13')]['message']);}else{logger[_0xf997('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x50f25d,_0xf997('0x12'));_0x17c1ba(_0x36f22['result']['message']);}})[_0xf997('0x16')](function(_0x101168){logger[_0xf997('0x13')](_0xf997('0x15'),_0x50f25d,_0x101168);_0x1face9(_0x101168);});});}exports[_0xf997('0x17')]=function(_0x415112){var _0x4782f3=this;return new Promise(function(_0x13395a,_0x580343){return db[_0xf997('0x18')][_0xf997('0x19')]({'raw':_0x415112[_0xf997('0x1a')]?_0x415112['options']['raw']===undefined?!![]:![]:!![],'where':_0x415112[_0xf997('0x1a')]?_0x415112[_0xf997('0x1a')]['where']||null:null,'attributes':_0x415112['options']?_0x415112[_0xf997('0x1a')][_0xf997('0x1b')]||null:null,'limit':_0x415112['options']?_0x415112['options'][_0xf997('0x1c')]||null:null,'include':_0x415112['options']?_0x415112['options']['include']?_[_0xf997('0x1d')](_0x415112[_0xf997('0x1a')][_0xf997('0x1e')],function(_0x500f48){return{'model':db[_0x500f48['model']],'as':_0x500f48['as'],'attributes':_0x500f48[_0xf997('0x1b')],'include':_0x500f48[_0xf997('0x1e')]?_[_0xf997('0x1d')](_0x500f48['include'],function(_0x3e49f9){return{'model':db[_0x3e49f9['model']],'as':_0x3e49f9['as'],'attributes':_0x3e49f9[_0xf997('0x1b')],'include':_0x3e49f9[_0xf997('0x1e')]?_[_0xf997('0x1d')](_0x3e49f9[_0xf997('0x1e')],function(_0x4eb976){return{'model':db[_0x4eb976['model']],'as':_0x4eb976['as'],'attributes':_0x4eb976['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5598d1){logger[_0xf997('0xf')](_0xf997('0x17'),_0x415112);logger[_0xf997('0x10')](_0xf997('0x17'),_0x415112,JSON[_0xf997('0x1f')](_0x5598d1));_0x13395a(_0x5598d1);})[_0xf997('0x16')](function(_0x32579f){logger['error'](_0xf997('0x17'),_0x32579f['message'],_0x415112);_0x580343(_0x4782f3[_0xf997('0x13')](0x1f4,_0x32579f[_0xf997('0x14')]));});});};exports[_0xf997('0x20')]=function(_0x281bd9){var _0x45ebbe=this;return new Promise(function(_0x4e9142,_0x167998){return db[_0xf997('0x18')]['find']({'raw':_0x281bd9['options']?_0x281bd9[_0xf997('0x1a')][_0xf997('0x21')]===undefined?!![]:![]:!![],'where':_0x281bd9['options']?_0x281bd9[_0xf997('0x1a')][_0xf997('0x22')]||null:null,'attributes':_0x281bd9['options']?_0x281bd9['options'][_0xf997('0x1b')]||null:null,'include':_0x281bd9['options']?_0x281bd9[_0xf997('0x1a')]['include']?_[_0xf997('0x1d')](_0x281bd9[_0xf997('0x1a')][_0xf997('0x1e')],function(_0x4e9052){return{'model':db[_0x4e9052[_0xf997('0x23')]],'as':_0x4e9052['as'],'attributes':_0x4e9052[_0xf997('0x1b')],'include':_0x4e9052['include']?_[_0xf997('0x1d')](_0x4e9052[_0xf997('0x1e')],function(_0x9608ee){return{'model':db[_0x9608ee[_0xf997('0x23')]],'as':_0x9608ee['as'],'attributes':_0x9608ee[_0xf997('0x1b')],'include':_0x9608ee[_0xf997('0x1e')]?_[_0xf997('0x1d')](_0x9608ee[_0xf997('0x1e')],function(_0x8e286f){return{'model':db[_0x8e286f['model']],'as':_0x8e286f['as'],'attributes':_0x8e286f[_0xf997('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf997('0xe')](function(_0x35f302){logger[_0xf997('0xf')](_0xf997('0x20'),_0x281bd9);logger[_0xf997('0x10')]('ShowVoiceQueue',_0x281bd9,JSON['stringify'](_0x35f302));_0x4e9142(_0x35f302);})[_0xf997('0x16')](function(_0x32911f){logger[_0xf997('0x13')](_0xf997('0x20'),_0x32911f[_0xf997('0x14')],_0x281bd9);_0x167998(_0x45ebbe[_0xf997('0x13')](0x1f4,_0x32911f['message']));});});}; \ No newline at end of file +var _0xf270=['message','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40b062,_0x2a2ffc){var _0xc07ff8=function(_0x594a37){while(--_0x594a37){_0x40b062['push'](_0x40b062['shift']());}};_0xc07ff8(++_0x2a2ffc);}(_0xf270,0xf2));var _0x0f27=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0xf270[_0x16ea87];return _0x6e7b1c;};'use strict';var _=require(_0x0f27('0x0'));var util=require(_0x0f27('0x1'));var moment=require(_0x0f27('0x2'));var BPromise=require(_0x0f27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f27('0x4'));var db=require(_0x0f27('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f27('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0f27('0x7'));var client=jayson['client'][_0x0f27('0x8')]({'port':0x232a});config[_0x0f27('0x9')]=_[_0x0f27('0xa')](config[_0x0f27('0x9')],{'host':_0x0f27('0xb'),'port':0x18eb});var socket=require(_0x0f27('0xc'))(new Redis(config[_0x0f27('0x9')]));require(_0x0f27('0xd'))[_0x0f27('0xe')](socket);function respondWithRpcPromise(_0x30b35b,_0xcc89a2,_0x316315){return new BPromise(function(_0x53e977,_0x183af8){return client[_0x0f27('0xf')](_0x30b35b,_0x316315)[_0x0f27('0x10')](function(_0x4cc0ac){logger[_0x0f27('0x11')](_0x0f27('0x12'),_0xcc89a2,'request\x20sent');logger[_0x0f27('0x13')](_0x0f27('0x14'),_0xcc89a2,'request\x20sent',JSON[_0x0f27('0x15')](_0x4cc0ac));if(_0x4cc0ac[_0x0f27('0x16')]){if(_0x4cc0ac[_0x0f27('0x16')][_0x0f27('0x17')]===0x1f4){logger[_0x0f27('0x16')]('VoiceQueue,\x20%s,\x20%s',_0xcc89a2,_0x4cc0ac[_0x0f27('0x16')]['message']);return _0x183af8(_0x4cc0ac['error'][_0x0f27('0x18')]);}logger[_0x0f27('0x16')](_0x0f27('0x12'),_0xcc89a2,_0x4cc0ac[_0x0f27('0x16')]['message']);return _0x53e977(_0x4cc0ac[_0x0f27('0x16')][_0x0f27('0x18')]);}else{logger[_0x0f27('0x11')](_0x0f27('0x12'),_0xcc89a2,'request\x20sent');_0x53e977(_0x4cc0ac['result'][_0x0f27('0x18')]);}})['catch'](function(_0x1dbf60){logger['error'](_0x0f27('0x12'),_0xcc89a2,_0x1dbf60);_0x183af8(_0x1dbf60);});});}exports['GetVoiceQueue']=function(_0x33d69c){var _0x53fc96=this;return new Promise(function(_0x5b2b3c,_0x485f6a){return db[_0x0f27('0x19')][_0x0f27('0x1a')]({'raw':_0x33d69c['options']?_0x33d69c[_0x0f27('0x1b')][_0x0f27('0x1c')]===undefined?!![]:![]:!![],'where':_0x33d69c[_0x0f27('0x1b')]?_0x33d69c[_0x0f27('0x1b')][_0x0f27('0x1d')]||null:null,'attributes':_0x33d69c[_0x0f27('0x1b')]?_0x33d69c[_0x0f27('0x1b')][_0x0f27('0x1e')]||null:null,'limit':_0x33d69c['options']?_0x33d69c[_0x0f27('0x1b')]['limit']||null:null,'include':_0x33d69c['options']?_0x33d69c[_0x0f27('0x1b')][_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0x33d69c[_0x0f27('0x1b')]['include'],function(_0x577b16){return{'model':db[_0x577b16['model']],'as':_0x577b16['as'],'attributes':_0x577b16[_0x0f27('0x1e')],'include':_0x577b16[_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0x577b16[_0x0f27('0x1f')],function(_0xc78b2a){return{'model':db[_0xc78b2a[_0x0f27('0x21')]],'as':_0xc78b2a['as'],'attributes':_0xc78b2a[_0x0f27('0x1e')],'include':_0xc78b2a[_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0xc78b2a[_0x0f27('0x1f')],function(_0x1f5c12){return{'model':db[_0x1f5c12[_0x0f27('0x21')]],'as':_0x1f5c12['as'],'attributes':_0x1f5c12[_0x0f27('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6a3f0){logger[_0x0f27('0x11')](_0x0f27('0x22'),_0x33d69c);logger[_0x0f27('0x13')]('GetVoiceQueue',_0x33d69c,JSON[_0x0f27('0x15')](_0xa6a3f0));_0x5b2b3c(_0xa6a3f0);})['catch'](function(_0x510605){logger[_0x0f27('0x16')](_0x0f27('0x22'),_0x510605['message'],_0x33d69c);_0x485f6a(_0x53fc96[_0x0f27('0x16')](0x1f4,_0x510605[_0x0f27('0x18')]));});});};exports[_0x0f27('0x23')]=function(_0x28cff7){var _0x5fa818=this;return new Promise(function(_0x5a1311,_0x51a8ce){return db[_0x0f27('0x19')][_0x0f27('0x24')]({'raw':_0x28cff7['options']?_0x28cff7['options'][_0x0f27('0x1c')]===undefined?!![]:![]:!![],'where':_0x28cff7[_0x0f27('0x1b')]?_0x28cff7[_0x0f27('0x1b')][_0x0f27('0x1d')]||null:null,'attributes':_0x28cff7[_0x0f27('0x1b')]?_0x28cff7[_0x0f27('0x1b')][_0x0f27('0x1e')]||null:null,'include':_0x28cff7[_0x0f27('0x1b')]?_0x28cff7[_0x0f27('0x1b')][_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0x28cff7[_0x0f27('0x1b')][_0x0f27('0x1f')],function(_0x44b5d8){return{'model':db[_0x44b5d8['model']],'as':_0x44b5d8['as'],'attributes':_0x44b5d8[_0x0f27('0x1e')],'include':_0x44b5d8[_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0x44b5d8[_0x0f27('0x1f')],function(_0x5c4d2a){return{'model':db[_0x5c4d2a[_0x0f27('0x21')]],'as':_0x5c4d2a['as'],'attributes':_0x5c4d2a[_0x0f27('0x1e')],'include':_0x5c4d2a[_0x0f27('0x1f')]?_[_0x0f27('0x20')](_0x5c4d2a[_0x0f27('0x1f')],function(_0x4f7d21){return{'model':db[_0x4f7d21['model']],'as':_0x4f7d21['as'],'attributes':_0x4f7d21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32f7ac){logger['info']('ShowVoiceQueue',_0x28cff7);logger[_0x0f27('0x13')](_0x0f27('0x23'),_0x28cff7,JSON[_0x0f27('0x15')](_0x32f7ac));_0x5a1311(_0x32f7ac);})[_0x0f27('0x25')](function(_0x3dba85){logger[_0x0f27('0x16')]('ShowVoiceQueue',_0x3dba85[_0x0f27('0x18')],_0x28cff7);_0x51a8ce(_0x5fa818[_0x0f27('0x16')](0x1f4,_0x3dba85['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 4d51ab1..3e2c00b 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 _0x33f9=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3870c6,_0x4b9ea3){var _0x456a8b=function(_0x4bc5e1){while(--_0x4bc5e1){_0x3870c6['push'](_0x3870c6['shift']());}};_0x456a8b(++_0x4b9ea3);}(_0x33f9,0x80));var _0x933f=function(_0x310f3d,_0x5b08ba){_0x310f3d=_0x310f3d-0x0;var _0xcedfb5=_0x33f9[_0x310f3d];return _0xcedfb5;};'use strict';var VoiceQueueEvents=require(_0x933f('0x0'));var events=[_0x933f('0x1'),_0x933f('0x2'),_0x933f('0x3')];function createListener(_0x803d98,_0x22f36c){return function(_0x17e64a){_0x22f36c[_0x933f('0x4')](_0x803d98,_0x17e64a);};}function removeListener(_0x4086a6,_0x58241c){return function(){VoiceQueueEvents[_0x933f('0x5')](_0x4086a6,_0x58241c);};}exports[_0x933f('0x6')]=function(_0x49faad){for(var _0x7a7dc8=0x0,_0x3b0413=events[_0x933f('0x7')];_0x7a7dc8<_0x3b0413;_0x7a7dc8++){var _0x2e33f9=events[_0x7a7dc8];var _0x3c9c26=createListener(_0x933f('0x8')+_0x2e33f9,_0x49faad);VoiceQueueEvents['on'](_0x2e33f9,_0x3c9c26);}}; \ No newline at end of file +var _0x17a7=['voiceQueue:','./voiceQueue.events','save','remove','update','removeListener','register','length'];(function(_0x3fb337,_0x355a60){var _0x14d9fc=function(_0x2a2fd9){while(--_0x2a2fd9){_0x3fb337['push'](_0x3fb337['shift']());}};_0x14d9fc(++_0x355a60);}(_0x17a7,0x151));var _0x717a=function(_0x7a46a6,_0x29a392){_0x7a46a6=_0x7a46a6-0x0;var _0x4d2bad=_0x17a7[_0x7a46a6];return _0x4d2bad;};'use strict';var VoiceQueueEvents=require(_0x717a('0x0'));var events=[_0x717a('0x1'),_0x717a('0x2'),_0x717a('0x3')];function createListener(_0x2d5ec9,_0x5b7f7d){return function(_0x708438){_0x5b7f7d['emit'](_0x2d5ec9,_0x708438);};}function removeListener(_0x472650,_0xb6d689){return function(){VoiceQueueEvents[_0x717a('0x4')](_0x472650,_0xb6d689);};}exports[_0x717a('0x5')]=function(_0x5dcc8f){for(var _0x163b62=0x0,_0x39dbce=events[_0x717a('0x6')];_0x163b62<_0x39dbce;_0x163b62++){var _0x5036ce=events[_0x163b62];var _0x394235=createListener(_0x717a('0x7')+_0x5036ce,_0x5dcc8f);VoiceQueueEvents['on'](_0x5036ce,_0x394235);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ebf7d90..c7c413d 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 _0xc730=['index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0xc730,0x10b));var _0x0c73=function(_0x281678,_0x1dce9c){_0x281678=_0x281678-0x0;var _0x144fff=_0xc730[_0x281678];return _0x144fff;};'use strict';var multer=require(_0x0c73('0x0'));var util=require(_0x0c73('0x1'));var path=require(_0x0c73('0x2'));var timeout=require(_0x0c73('0x3'));var express=require(_0x0c73('0x4'));var router=express[_0x0c73('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0c73('0x6'));var controller=require(_0x0c73('0x7'));router[_0x0c73('0x8')]('/',auth['isAuthenticated'](),controller[_0x0c73('0x9')]);router['get'](_0x0c73('0xa'),auth[_0x0c73('0xb')](),controller[_0x0c73('0xc')]);router[_0x0c73('0x8')](_0x0c73('0xd'),auth[_0x0c73('0xb')](),controller[_0x0c73('0xe')]);router[_0x0c73('0x8')](_0x0c73('0xf'),auth[_0x0c73('0xb')](),controller[_0x0c73('0x10')]);router[_0x0c73('0x11')]('/',auth[_0x0c73('0xb')](),controller['create']);router[_0x0c73('0x12')]('/:id',auth[_0x0c73('0xb')](),controller[_0x0c73('0x13')]);router[_0x0c73('0x14')](_0x0c73('0xf'),auth[_0x0c73('0xb')](),controller[_0x0c73('0x15')]);module[_0x0c73('0x16')]=router; \ No newline at end of file +var _0x4937=['../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','/describe','describe','get','/index','getVoiceQueuesReport','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4937,0x1c8));var _0x7493=function(_0x1aff78,_0x3d1109){_0x1aff78=_0x1aff78-0x0;var _0xc0216c=_0x4937[_0x1aff78];return _0xc0216c;};'use strict';var multer=require(_0x7493('0x0'));var util=require(_0x7493('0x1'));var path=require(_0x7493('0x2'));var timeout=require(_0x7493('0x3'));var express=require('express');var router=express[_0x7493('0x4')]();var fs_extra=require(_0x7493('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7493('0x6'));var config=require(_0x7493('0x7'));var controller=require(_0x7493('0x8'));router['get']('/',auth[_0x7493('0x9')](),controller['index']);router['get'](_0x7493('0xa'),auth['isAuthenticated'](),controller[_0x7493('0xb')]);router[_0x7493('0xc')](_0x7493('0xd'),auth['isAuthenticated'](),controller[_0x7493('0xe')]);router['get']('/:id',auth[_0x7493('0x9')](),controller[_0x7493('0xf')]);router[_0x7493('0x10')]('/',auth[_0x7493('0x9')](),controller[_0x7493('0x11')]);router['put'](_0x7493('0x12'),auth[_0x7493('0x9')](),controller[_0x7493('0x13')]);router[_0x7493('0x14')](_0x7493('0x12'),auth['isAuthenticated'](),controller[_0x7493('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 5b0a185..4fefc30 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 _0x05b9=['diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x13239e,_0x1ff4d4){var _0x558aef=function(_0x4f73ad){while(--_0x4f73ad){_0x13239e['push'](_0x13239e['shift']());}};_0x558aef(++_0x1ff4d4);}(_0x05b9,0x15d));var _0x905b=function(_0x2f506e,_0x2bef86){_0x2f506e=_0x2f506e-0x0;var _0x1a67b2=_0x05b9[_0x2f506e];return _0x1a67b2;};'use strict';var Sequelize=require(_0x905b('0x0'));var moment=require(_0x905b('0x1'));module[_0x905b('0x2')]={'type':{'type':Sequelize[_0x905b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x905b('0x3')]},'calleridname':{'type':Sequelize[_0x905b('0x3')]},'queue':{'type':Sequelize[_0x905b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x905b('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x905b('0x4')],'set':function(_0x34e787){var _0x472ef9=moment(_0x34e787);var _0x1f63d1=moment(this[_0x905b('0x5')]('queuecallerjoinAt'))[_0x905b('0x6')](_0x905b('0x7'));var _0xb34c7f=_0x472ef9[_0x905b('0x8')](_0x1f63d1,_0x905b('0x9'));this[_0x905b('0xa')](_0x905b('0xb'),_0x34e787);this['setDataValue'](_0x905b('0xc'),_0xb34c7f||null);}},'position':{'type':Sequelize[_0x905b('0xd')]},'count':{'type':Sequelize[_0x905b('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x905b('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x905b('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x905b('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x905b('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x905b('0x3')],'comment':_0x905b('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x905b('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x905b('0x3')]},'accountcode':{'type':Sequelize[_0x905b('0x3')]},'context':{'type':Sequelize[_0x905b('0x3')]},'exten':{'type':Sequelize[_0x905b('0x3')]},'priority':{'type':Sequelize[_0x905b('0x3')]},'holdtime':{'type':Sequelize[_0x905b('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x905b('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x905b('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x905b('0x3')],'comment':_0x905b('0x10')},'transferexten':{'type':Sequelize[_0x905b('0x3')]},'transferuniqueid':{'type':Sequelize[_0x905b('0x3')]},'disposition':{'type':Sequelize[_0x905b('0x3')]},'secondDisposition':{'type':Sequelize[_0x905b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x905b('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x203a=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3ca065,_0x16d4d1){var _0x19c452=function(_0x114222){while(--_0x114222){_0x3ca065['push'](_0x3ca065['shift']());}};_0x19c452(++_0x16d4d1);}(_0x203a,0x1a4));var _0xa203=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x203a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xa203('0x0')]},'uniqueid':{'type':Sequelize[_0xa203('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xa203('0x1')]},'queuecallerleaveAt':{'type':Sequelize[_0xa203('0x1')],'set':function(_0x5eeef0){var _0x24dd1c=moment(_0x5eeef0);var _0x5bfa1d=moment(this[_0xa203('0x2')](_0xa203('0x3')))[_0xa203('0x4')](_0xa203('0x5'));var _0x56d44b=_0x24dd1c[_0xa203('0x6')](_0x5bfa1d,_0xa203('0x7'));this['setDataValue'](_0xa203('0x8'),_0x5eeef0);this[_0xa203('0x9')](_0xa203('0xa'),_0x56d44b||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xa203('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa203('0x1')]},'queuecallercomplete':{'type':Sequelize[_0xa203('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa203('0x1')]},'queuecallerexitreason':{'type':Sequelize[_0xa203('0x0')],'comment':_0xa203('0xc')},'originalposition':{'type':Sequelize[_0xa203('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa203('0x0')]},'connectedlinename':{'type':Sequelize[_0xa203('0x0')]},'accountcode':{'type':Sequelize[_0xa203('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa203('0x0')]},'holdtime':{'type':Sequelize[_0xa203('0xd')]},'mohtime':{'type':Sequelize[_0xa203('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa203('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa203('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa203('0x0')],'comment':_0xa203('0xe')},'transferexten':{'type':Sequelize[_0xa203('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xa203('0x0')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa203('0x0')]},'queuecallerenterreason':{'type':Sequelize[_0xa203('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index b9497ae..bb08153 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 _0x0df7=['VIRTUAL','options','includeAll','rows','show','params','include','catch','create','body','hasOwnProperty','pick','findAll','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge'];(function(_0x554d96,_0x552fb5){var _0x558b33=function(_0x45ef3d){while(--_0x45ef3d){_0x554d96['push'](_0x554d96['shift']());}};_0x558b33(++_0x552fb5);}(_0x0df7,0x13d));var _0x70df=function(_0x19a90a,_0x2e3aef){_0x19a90a=_0x19a90a-0x0;var _0x1abe5d=_0x0df7[_0x19a90a];return _0x1abe5d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x70df('0x0'));var rp=require(_0x70df('0x1'));var moment=require(_0x70df('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x70df('0x3'));var util=require(_0x70df('0x4'));var path=require(_0x70df('0x5'));var sox=require(_0x70df('0x6'));var csv=require(_0x70df('0x7'));var ejs=require(_0x70df('0x8'));var fs=require('fs');var fs_extra=require(_0x70df('0x9'));var _=require(_0x70df('0xa'));var squel=require(_0x70df('0xb'));var crypto=require(_0x70df('0xc'));var jsforce=require(_0x70df('0xd'));var deskjs=require(_0x70df('0xe'));var toCsv=require(_0x70df('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x70df('0xf'));var qs=require(_0x70df('0x10'));var as=require(_0x70df('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70df('0x12'))(_0x70df('0x13'));var utils=require(_0x70df('0x14'));var config=require(_0x70df('0x15'));var licenseUtil=require(_0x70df('0x16'));var db=require('../../mysqldb')['db'];config[_0x70df('0x17')]=_[_0x70df('0x18')](config[_0x70df('0x17')],{'host':_0x70df('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x70df('0x1a')](socket);function respondWithStatusCode(_0x1b2617,_0x53abe5){_0x53abe5=_0x53abe5||0xcc;return function(_0x4ff4eb){if(_0x4ff4eb){return _0x1b2617[_0x70df('0x1b')](_0x53abe5);}return _0x1b2617[_0x70df('0x1c')](_0x53abe5)[_0x70df('0x1d')]();};}function respondWithResult(_0x4f4ed1,_0x3ed5e3){_0x3ed5e3=_0x3ed5e3||0xc8;return function(_0x39c97a){if(_0x39c97a){return _0x4f4ed1[_0x70df('0x1c')](_0x3ed5e3)[_0x70df('0x1e')](_0x39c97a);}};}function respondWithFilteredResult(_0x3c8042,_0x43c1d2){return function(_0x3f1729){if(_0x3f1729){var _0x264d87=typeof _0x43c1d2['offset']===_0x70df('0x1f')&&typeof _0x43c1d2[_0x70df('0x20')]===_0x70df('0x1f');var _0xb6374c=_0x3f1729[_0x70df('0x21')];var _0x24e602=_0x264d87?0x0:_0x43c1d2[_0x70df('0x22')];var _0x38641c=_0x264d87?_0x3f1729[_0x70df('0x21')]:_0x43c1d2[_0x70df('0x22')]+_0x43c1d2[_0x70df('0x20')];var _0xefad0;if(_0x38641c>=_0xb6374c){_0x38641c=_0xb6374c;_0xefad0=0xc8;}else{_0xefad0=0xce;}_0x3c8042[_0x70df('0x1c')](_0xefad0);return _0x3c8042[_0x70df('0x23')](_0x70df('0x24'),_0x24e602+'-'+_0x38641c+'/'+_0xb6374c)[_0x70df('0x1e')](_0x3f1729);}return null;};}function patchUpdates(_0x51e34d){return function(_0xa1b9c3){try{jsonpatch[_0x70df('0x25')](_0xa1b9c3,_0x51e34d,!![]);}catch(_0x163a19){return BPromise[_0x70df('0x26')](_0x163a19);}return _0xa1b9c3['save']();};}function saveUpdates(_0x2971cf,_0x2080d0){return function(_0x94eae9){if(_0x94eae9){return _0x94eae9[_0x70df('0x27')](_0x2971cf)['then'](function(_0x54e9e1){return _0x54e9e1;});}return null;};}function removeEntity(_0x837d56,_0x57c8aa){return function(_0x44790b){if(_0x44790b){return _0x44790b[_0x70df('0x28')]()[_0x70df('0x29')](function(){_0x837d56[_0x70df('0x1c')](0xcc)[_0x70df('0x1d')]();});}};}function handleEntityNotFound(_0x5d8e19,_0x5da392){return function(_0x7ace90){if(!_0x7ace90){_0x5d8e19[_0x70df('0x1b')](0x194);}return _0x7ace90;};}function handleError(_0x4e1958,_0x3145ad){_0x3145ad=_0x3145ad||0x1f4;return function(_0x26c84d){logger[_0x70df('0x2a')](_0x26c84d['stack']);if(_0x26c84d[_0x70df('0x2b')]){delete _0x26c84d['name'];}_0x4e1958['status'](_0x3145ad)['send'](_0x26c84d);};}exports[_0x70df('0x2c')]=function(_0x5aa037,_0xe04905){var _0x396a8e={},_0x1ce86d={},_0x78f533={'count':0x0,'rows':[]};var _0x2a44e0=_[_0x70df('0x2d')](db[_0x70df('0x2e')][_0x70df('0x2f')],function(_0x2d2f6f){return{'name':_0x2d2f6f['fieldName'],'type':_0x2d2f6f[_0x70df('0x30')][_0x70df('0x31')]};});_0x1ce86d[_0x70df('0x32')]=_[_0x70df('0x2d')](_0x2a44e0,_0x70df('0x2b'));_0x1ce86d[_0x70df('0x33')]=_[_0x70df('0x34')](_0x5aa037[_0x70df('0x33')]);_0x1ce86d[_0x70df('0x35')]=_[_0x70df('0x36')](_0x1ce86d[_0x70df('0x32')],_0x1ce86d[_0x70df('0x33')]);_0x396a8e[_0x70df('0x37')]=_['intersection'](_0x1ce86d[_0x70df('0x32')],qs[_0x70df('0x38')](_0x5aa037[_0x70df('0x33')][_0x70df('0x38')]));_0x396a8e['attributes']=_0x396a8e[_0x70df('0x37')]['length']?_0x396a8e[_0x70df('0x37')]:_0x1ce86d['model'];if(!_0x5aa037[_0x70df('0x33')]['hasOwnProperty'](_0x70df('0x39'))){_0x396a8e[_0x70df('0x20')]=qs[_0x70df('0x20')](_0x5aa037['query'][_0x70df('0x20')]);_0x396a8e[_0x70df('0x22')]=qs[_0x70df('0x22')](_0x5aa037[_0x70df('0x33')][_0x70df('0x22')]);}_0x396a8e[_0x70df('0x3a')]=qs[_0x70df('0x3b')](_0x5aa037[_0x70df('0x33')][_0x70df('0x3b')]);_0x396a8e[_0x70df('0x3c')]=qs[_0x70df('0x35')](_['pick'](_0x5aa037[_0x70df('0x33')],_0x1ce86d[_0x70df('0x35')]),_0x2a44e0);if(_0x5aa037[_0x70df('0x33')][_0x70df('0x3d')]){_0x396a8e[_0x70df('0x3c')]=_[_0x70df('0x3e')](_0x396a8e[_0x70df('0x3c')],{'$or':_['map'](_0x2a44e0,function(_0x2765b7){if(_0x2765b7[_0x70df('0x30')]!==_0x70df('0x3f')){var _0x307997={};_0x307997[_0x2765b7[_0x70df('0x2b')]]={'$like':'%'+_0x5aa037[_0x70df('0x33')][_0x70df('0x3d')]+'%'};return _0x307997;}})});}_0x396a8e=_[_0x70df('0x3e')]({},_0x396a8e,_0x5aa037[_0x70df('0x40')]);var _0x36afeb={'where':_0x396a8e[_0x70df('0x3c')]};return db[_0x70df('0x2e')][_0x70df('0x21')](_0x36afeb)[_0x70df('0x29')](function(_0x5f7e7a){_0x78f533[_0x70df('0x21')]=_0x5f7e7a;if(_0x5aa037[_0x70df('0x33')][_0x70df('0x41')]){_0x396a8e['include']=[{'all':!![]}];}return db[_0x70df('0x2e')]['findAll'](_0x396a8e);})[_0x70df('0x29')](function(_0x14daf6){_0x78f533[_0x70df('0x42')]=_0x14daf6;return _0x78f533;})[_0x70df('0x29')](respondWithFilteredResult(_0xe04905,_0x396a8e))['catch'](handleError(_0xe04905,null));};exports[_0x70df('0x43')]=function(_0x90ad08,_0x2f5344){var _0x23a5af={'raw':![],'where':{'id':_0x90ad08[_0x70df('0x44')]['id']}},_0x5b8d37={};_0x5b8d37[_0x70df('0x32')]=_['keys'](db['VoiceQueueReport'][_0x70df('0x2f')]);_0x5b8d37[_0x70df('0x33')]=_['keys'](_0x90ad08[_0x70df('0x33')]);_0x5b8d37[_0x70df('0x35')]=_['intersection'](_0x5b8d37[_0x70df('0x32')],_0x5b8d37[_0x70df('0x33')]);_0x23a5af[_0x70df('0x37')]=_[_0x70df('0x36')](_0x5b8d37['model'],qs['fields'](_0x90ad08['query'][_0x70df('0x38')]));_0x23a5af[_0x70df('0x37')]=_0x23a5af['attributes']['length']?_0x23a5af[_0x70df('0x37')]:_0x5b8d37['model'];if(_0x90ad08['query'][_0x70df('0x41')]){_0x23a5af[_0x70df('0x45')]=[{'all':!![]}];}_0x23a5af=_[_0x70df('0x3e')]({},_0x23a5af,_0x90ad08[_0x70df('0x40')]);return db[_0x70df('0x2e')]['find'](_0x23a5af)[_0x70df('0x29')](handleEntityNotFound(_0x2f5344,null))[_0x70df('0x29')](respondWithResult(_0x2f5344,null))[_0x70df('0x46')](handleError(_0x2f5344,null));};exports[_0x70df('0x47')]=function(_0x52a868,_0x2412e5){return db['VoiceQueueReport'][_0x70df('0x47')](_0x52a868[_0x70df('0x48')],{})[_0x70df('0x29')](respondWithResult(_0x2412e5,0xc9))[_0x70df('0x46')](handleError(_0x2412e5,null));};exports['update']=function(_0x4fe7f1,_0x31ed18){if(_0x4fe7f1[_0x70df('0x48')]['id']){delete _0x4fe7f1[_0x70df('0x48')]['id'];}return db[_0x70df('0x2e')]['find']({'where':{'id':_0x4fe7f1[_0x70df('0x44')]['id']}})[_0x70df('0x29')](handleEntityNotFound(_0x31ed18,null))[_0x70df('0x29')](saveUpdates(_0x4fe7f1[_0x70df('0x48')],null))['then'](respondWithResult(_0x31ed18,null))['catch'](handleError(_0x31ed18,null));};exports[_0x70df('0x28')]=function(_0x1b61b8,_0x1a4b37){return db['VoiceQueueReport']['find']({'where':{'id':_0x1b61b8[_0x70df('0x44')]['id']}})[_0x70df('0x29')](handleEntityNotFound(_0x1a4b37,null))['then'](removeEntity(_0x1a4b37,null))[_0x70df('0x46')](handleError(_0x1a4b37,null));};exports['describe']=function(_0x3109bf,_0x519c5d){return db[_0x70df('0x2e')]['describe']()[_0x70df('0x29')](respondWithResult(_0x519c5d,null))[_0x70df('0x46')](handleError(_0x519c5d,null));};exports['getVoiceQueuesReport']=function(_0x332d7f,_0x45f329){var _0x42173e={},_0x316c06={},_0x381ceb={'count':0x0,'rows':[]};_0x316c06['model']=_[_0x70df('0x34')](db[_0x70df('0x2e')][_0x70df('0x2f')]);_0x316c06[_0x70df('0x33')]=_['keys'](_0x332d7f['query']);_0x316c06[_0x70df('0x35')]=_[_0x70df('0x36')](_0x316c06[_0x70df('0x32')],_0x316c06[_0x70df('0x33')]);_0x42173e[_0x70df('0x37')]=_['intersection'](_0x316c06[_0x70df('0x32')],qs[_0x70df('0x38')](_0x332d7f[_0x70df('0x33')]['fields']));_0x42173e[_0x70df('0x37')]=_0x42173e[_0x70df('0x37')]['length']?_0x42173e[_0x70df('0x37')]:_0x316c06[_0x70df('0x32')];if(!_0x332d7f[_0x70df('0x33')][_0x70df('0x49')]('nolimit')){_0x42173e['limit']=qs[_0x70df('0x20')](_0x332d7f[_0x70df('0x33')][_0x70df('0x20')]);_0x42173e['offset']=qs[_0x70df('0x22')](_0x332d7f[_0x70df('0x33')]['offset']);}_0x42173e[_0x70df('0x3a')]=qs['sort'](_0x332d7f[_0x70df('0x33')][_0x70df('0x3b')]);_0x42173e['where']=qs[_0x70df('0x35')](_[_0x70df('0x4a')](_0x332d7f['query'],_0x316c06[_0x70df('0x35')]));if(_0x332d7f['query'][_0x70df('0x3d')]){_0x42173e[_0x70df('0x3c')]=_[_0x70df('0x3e')](_0x42173e['where'],{'$or':_['map'](_0x42173e[_0x70df('0x37')],function(_0x330fe7){var _0xa7ec8b={};_0xa7ec8b[_0x330fe7]={'$like':'%'+_0x332d7f[_0x70df('0x33')][_0x70df('0x3d')]+'%'};return _0xa7ec8b;})});}_0x42173e=_[_0x70df('0x3e')]({},_0x42173e,_0x332d7f[_0x70df('0x40')]);var _0x44b758={'where':_0x42173e[_0x70df('0x3c')]};return db[_0x70df('0x2e')]['count'](_0x44b758)[_0x70df('0x29')](function(_0x32cfc3){_0x381ceb['count']=_0x32cfc3;if(_0x332d7f['query'][_0x70df('0x41')]){_0x42173e[_0x70df('0x45')]=[{'all':!![]}];}return db[_0x70df('0x2e')][_0x70df('0x4b')](_0x42173e);})[_0x70df('0x29')](function(_0x1f5d82){_0x381ceb['rows']=_0x1f5d82;return _0x381ceb;})[_0x70df('0x29')](respondWithFilteredResult(_0x45f329,_0x42173e,'getVoiceQueuesReport'))['catch'](handleError(_0x45f329,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x1953=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','model','keys','filters','intersection','attributes','fields','length','query','sort','where','filter','VIRTUAL','merge','options','findAll','show','params','includeAll','include','catch','create','update','body','find','describe','hasOwnProperty','nolimit','order','pick','rows','getVoiceQueuesReport','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x5b7dcc,_0x1f8e51){var _0x4ff684=function(_0x39bfdb){while(--_0x39bfdb){_0x5b7dcc['push'](_0x5b7dcc['shift']());}};_0x4ff684(++_0x1f8e51);}(_0x1953,0x1a3));var _0x3195=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1953[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x3195('0x0'));var rimraf=require(_0x3195('0x1'));var zipdir=require(_0x3195('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3195('0x3'));var BPromise=require(_0x3195('0x4'));var Mustache=require(_0x3195('0x5'));var util=require(_0x3195('0x6'));var path=require(_0x3195('0x7'));var sox=require(_0x3195('0x8'));var csv=require(_0x3195('0x9'));var ejs=require(_0x3195('0xa'));var fs=require('fs');var fs_extra=require(_0x3195('0xb'));var _=require(_0x3195('0xc'));var squel=require(_0x3195('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3195('0x9'));var querystring=require(_0x3195('0xe'));var Papa=require(_0x3195('0xf'));var Redis=require(_0x3195('0x10'));var authService=require(_0x3195('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3195('0x12'));var hardwareService=require(_0x3195('0x13'));var logger=require(_0x3195('0x14'))(_0x3195('0x15'));var utils=require('../../config/utils');var config=require(_0x3195('0x16'));var licenseUtil=require(_0x3195('0x17'));var db=require(_0x3195('0x18'))['db'];config[_0x3195('0x19')]=_[_0x3195('0x1a')](config[_0x3195('0x19')],{'host':_0x3195('0x1b'),'port':0x18eb});var socket=require(_0x3195('0x1c'))(new Redis(config[_0x3195('0x19')]));require(_0x3195('0x1d'))[_0x3195('0x1e')](socket);function respondWithStatusCode(_0x38dac4,_0xa70203){_0xa70203=_0xa70203||0xcc;return function(_0x3cd8f8){if(_0x3cd8f8){return _0x38dac4[_0x3195('0x1f')](_0xa70203);}return _0x38dac4[_0x3195('0x20')](_0xa70203)['end']();};}function respondWithResult(_0x3e67e4,_0x22314a){_0x22314a=_0x22314a||0xc8;return function(_0x366db7){if(_0x366db7){return _0x3e67e4[_0x3195('0x20')](_0x22314a)[_0x3195('0x21')](_0x366db7);}};}function respondWithFilteredResult(_0x1098c5,_0x16a23b){return function(_0xb8b229){if(_0xb8b229){var _0xbc99d8=typeof _0x16a23b[_0x3195('0x22')]===_0x3195('0x23')&&typeof _0x16a23b[_0x3195('0x24')]===_0x3195('0x23');var _0x291a08=_0xb8b229[_0x3195('0x25')];var _0x3dca87=_0xbc99d8?0x0:_0x16a23b[_0x3195('0x22')];var _0x4e431f=_0xbc99d8?_0xb8b229[_0x3195('0x25')]:_0x16a23b[_0x3195('0x22')]+_0x16a23b['limit'];var _0x2943a1;if(_0x4e431f>=_0x291a08){_0x4e431f=_0x291a08;_0x2943a1=0xc8;}else{_0x2943a1=0xce;}_0x1098c5['status'](_0x2943a1);return _0x1098c5[_0x3195('0x26')](_0x3195('0x27'),_0x3dca87+'-'+_0x4e431f+'/'+_0x291a08)[_0x3195('0x21')](_0xb8b229);}return null;};}function patchUpdates(_0x4ff3a6){return function(_0x43b6b4){try{jsonpatch[_0x3195('0x28')](_0x43b6b4,_0x4ff3a6,!![]);}catch(_0x4efbf4){return BPromise[_0x3195('0x29')](_0x4efbf4);}return _0x43b6b4[_0x3195('0x2a')]();};}function saveUpdates(_0x33e8b2,_0x5876ce){return function(_0x34f18){if(_0x34f18){return _0x34f18['update'](_0x33e8b2)[_0x3195('0x2b')](function(_0x4e8ddb){return _0x4e8ddb;});}return null;};}function removeEntity(_0x1f27b0,_0x331dc8){return function(_0x1c2a28){if(_0x1c2a28){return _0x1c2a28[_0x3195('0x2c')]()[_0x3195('0x2b')](function(){_0x1f27b0[_0x3195('0x20')](0xcc)[_0x3195('0x2d')]();});}};}function handleEntityNotFound(_0x536bf1,_0x18d6f2){return function(_0x1a488f){if(!_0x1a488f){_0x536bf1[_0x3195('0x1f')](0x194);}return _0x1a488f;};}function handleError(_0x1ed7ea,_0x155a52){_0x155a52=_0x155a52||0x1f4;return function(_0x17d2d4){logger[_0x3195('0x2e')](_0x17d2d4[_0x3195('0x2f')]);if(_0x17d2d4['name']){delete _0x17d2d4[_0x3195('0x30')];}_0x1ed7ea['status'](_0x155a52)[_0x3195('0x31')](_0x17d2d4);};}exports[_0x3195('0x32')]=function(_0x5008b9,_0x4345de){var _0x43c4d6={},_0x50105a={},_0x3730b6={'count':0x0,'rows':[]};var _0x70b1a8=_[_0x3195('0x33')](db[_0x3195('0x34')][_0x3195('0x35')],function(_0x3c5f82){return{'name':_0x3c5f82['fieldName'],'type':_0x3c5f82['type']['key']};});_0x50105a[_0x3195('0x36')]=_['map'](_0x70b1a8,_0x3195('0x30'));_0x50105a['query']=_[_0x3195('0x37')](_0x5008b9['query']);_0x50105a[_0x3195('0x38')]=_[_0x3195('0x39')](_0x50105a[_0x3195('0x36')],_0x50105a['query']);_0x43c4d6[_0x3195('0x3a')]=_[_0x3195('0x39')](_0x50105a[_0x3195('0x36')],qs[_0x3195('0x3b')](_0x5008b9['query'][_0x3195('0x3b')]));_0x43c4d6[_0x3195('0x3a')]=_0x43c4d6[_0x3195('0x3a')][_0x3195('0x3c')]?_0x43c4d6[_0x3195('0x3a')]:_0x50105a['model'];if(!_0x5008b9[_0x3195('0x3d')]['hasOwnProperty']('nolimit')){_0x43c4d6['limit']=qs[_0x3195('0x24')](_0x5008b9[_0x3195('0x3d')][_0x3195('0x24')]);_0x43c4d6[_0x3195('0x22')]=qs[_0x3195('0x22')](_0x5008b9[_0x3195('0x3d')][_0x3195('0x22')]);}_0x43c4d6['order']=qs[_0x3195('0x3e')](_0x5008b9[_0x3195('0x3d')][_0x3195('0x3e')]);_0x43c4d6[_0x3195('0x3f')]=qs[_0x3195('0x38')](_['pick'](_0x5008b9[_0x3195('0x3d')],_0x50105a[_0x3195('0x38')]),_0x70b1a8);if(_0x5008b9[_0x3195('0x3d')][_0x3195('0x40')]){_0x43c4d6[_0x3195('0x3f')]=_['merge'](_0x43c4d6['where'],{'$or':_[_0x3195('0x33')](_0x70b1a8,function(_0x3816c2){if(_0x3816c2['type']!==_0x3195('0x41')){var _0x2380ea={};_0x2380ea[_0x3816c2[_0x3195('0x30')]]={'$like':'%'+_0x5008b9['query'][_0x3195('0x40')]+'%'};return _0x2380ea;}})});}_0x43c4d6=_[_0x3195('0x42')]({},_0x43c4d6,_0x5008b9[_0x3195('0x43')]);var _0x52b0b8={'where':_0x43c4d6[_0x3195('0x3f')]};return db['VoiceQueueReport'][_0x3195('0x25')](_0x52b0b8)['then'](function(_0x22b9d4){_0x3730b6[_0x3195('0x25')]=_0x22b9d4;if(_0x5008b9[_0x3195('0x3d')]['includeAll']){_0x43c4d6['include']=[{'all':!![]}];}return db[_0x3195('0x34')][_0x3195('0x44')](_0x43c4d6);})['then'](function(_0x38e2f8){_0x3730b6['rows']=_0x38e2f8;return _0x3730b6;})[_0x3195('0x2b')](respondWithFilteredResult(_0x4345de,_0x43c4d6))['catch'](handleError(_0x4345de,null));};exports[_0x3195('0x45')]=function(_0x489edd,_0x25098f){var _0x1521aa={'raw':![],'where':{'id':_0x489edd[_0x3195('0x46')]['id']}},_0x12c7ea={};_0x12c7ea[_0x3195('0x36')]=_[_0x3195('0x37')](db[_0x3195('0x34')]['rawAttributes']);_0x12c7ea[_0x3195('0x3d')]=_[_0x3195('0x37')](_0x489edd['query']);_0x12c7ea[_0x3195('0x38')]=_[_0x3195('0x39')](_0x12c7ea[_0x3195('0x36')],_0x12c7ea['query']);_0x1521aa[_0x3195('0x3a')]=_[_0x3195('0x39')](_0x12c7ea['model'],qs['fields'](_0x489edd[_0x3195('0x3d')][_0x3195('0x3b')]));_0x1521aa[_0x3195('0x3a')]=_0x1521aa['attributes'][_0x3195('0x3c')]?_0x1521aa[_0x3195('0x3a')]:_0x12c7ea[_0x3195('0x36')];if(_0x489edd[_0x3195('0x3d')][_0x3195('0x47')]){_0x1521aa[_0x3195('0x48')]=[{'all':!![]}];}_0x1521aa=_[_0x3195('0x42')]({},_0x1521aa,_0x489edd['options']);return db[_0x3195('0x34')]['find'](_0x1521aa)['then'](handleEntityNotFound(_0x25098f,null))[_0x3195('0x2b')](respondWithResult(_0x25098f,null))[_0x3195('0x49')](handleError(_0x25098f,null));};exports['create']=function(_0x521606,_0x2f4260){return db[_0x3195('0x34')][_0x3195('0x4a')](_0x521606['body'],{})[_0x3195('0x2b')](respondWithResult(_0x2f4260,0xc9))['catch'](handleError(_0x2f4260,null));};exports[_0x3195('0x4b')]=function(_0xf41eac,_0x157e5a){if(_0xf41eac[_0x3195('0x4c')]['id']){delete _0xf41eac[_0x3195('0x4c')]['id'];}return db['VoiceQueueReport'][_0x3195('0x4d')]({'where':{'id':_0xf41eac[_0x3195('0x46')]['id']}})[_0x3195('0x2b')](handleEntityNotFound(_0x157e5a,null))[_0x3195('0x2b')](saveUpdates(_0xf41eac[_0x3195('0x4c')],null))[_0x3195('0x2b')](respondWithResult(_0x157e5a,null))[_0x3195('0x49')](handleError(_0x157e5a,null));};exports[_0x3195('0x2c')]=function(_0x1dce9f,_0x44aaa5){return db[_0x3195('0x34')][_0x3195('0x4d')]({'where':{'id':_0x1dce9f[_0x3195('0x46')]['id']}})[_0x3195('0x2b')](handleEntityNotFound(_0x44aaa5,null))[_0x3195('0x2b')](removeEntity(_0x44aaa5,null))['catch'](handleError(_0x44aaa5,null));};exports[_0x3195('0x4e')]=function(_0xeabdc9,_0x375617){return db[_0x3195('0x34')]['describe']()[_0x3195('0x2b')](respondWithResult(_0x375617,null))['catch'](handleError(_0x375617,null));};exports['getVoiceQueuesReport']=function(_0x2829b1,_0x5a588f){var _0x4b37a7={},_0x5c982f={},_0x29cc75={'count':0x0,'rows':[]};_0x5c982f[_0x3195('0x36')]=_['keys'](db[_0x3195('0x34')]['rawAttributes']);_0x5c982f[_0x3195('0x3d')]=_[_0x3195('0x37')](_0x2829b1[_0x3195('0x3d')]);_0x5c982f[_0x3195('0x38')]=_['intersection'](_0x5c982f['model'],_0x5c982f['query']);_0x4b37a7[_0x3195('0x3a')]=_[_0x3195('0x39')](_0x5c982f[_0x3195('0x36')],qs[_0x3195('0x3b')](_0x2829b1['query']['fields']));_0x4b37a7['attributes']=_0x4b37a7[_0x3195('0x3a')][_0x3195('0x3c')]?_0x4b37a7[_0x3195('0x3a')]:_0x5c982f[_0x3195('0x36')];if(!_0x2829b1[_0x3195('0x3d')][_0x3195('0x4f')](_0x3195('0x50'))){_0x4b37a7[_0x3195('0x24')]=qs[_0x3195('0x24')](_0x2829b1[_0x3195('0x3d')][_0x3195('0x24')]);_0x4b37a7[_0x3195('0x22')]=qs[_0x3195('0x22')](_0x2829b1['query'][_0x3195('0x22')]);}_0x4b37a7[_0x3195('0x51')]=qs[_0x3195('0x3e')](_0x2829b1[_0x3195('0x3d')]['sort']);_0x4b37a7[_0x3195('0x3f')]=qs[_0x3195('0x38')](_[_0x3195('0x52')](_0x2829b1[_0x3195('0x3d')],_0x5c982f[_0x3195('0x38')]));if(_0x2829b1[_0x3195('0x3d')][_0x3195('0x40')]){_0x4b37a7['where']=_['merge'](_0x4b37a7[_0x3195('0x3f')],{'$or':_['map'](_0x4b37a7[_0x3195('0x3a')],function(_0xd0b8b7){var _0x5630fb={};_0x5630fb[_0xd0b8b7]={'$like':'%'+_0x2829b1[_0x3195('0x3d')][_0x3195('0x40')]+'%'};return _0x5630fb;})});}_0x4b37a7=_[_0x3195('0x42')]({},_0x4b37a7,_0x2829b1[_0x3195('0x43')]);var _0xb27cc1={'where':_0x4b37a7['where']};return db[_0x3195('0x34')]['count'](_0xb27cc1)[_0x3195('0x2b')](function(_0x38cae3){_0x29cc75['count']=_0x38cae3;if(_0x2829b1['query'][_0x3195('0x47')]){_0x4b37a7[_0x3195('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3195('0x44')](_0x4b37a7);})[_0x3195('0x2b')](function(_0x4aea00){_0x29cc75[_0x3195('0x53')]=_0x4aea00;return _0x29cc75;})[_0x3195('0x2b')](respondWithFilteredResult(_0x5a588f,_0x4b37a7,_0x3195('0x54')))[_0x3195('0x49')](handleError(_0x5a588f,null,_0x3195('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a61efbf..03d5ec6 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 _0x39a7=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x39a7,0x1aa));var _0x739a=function(_0x2336ea,_0x46e872){_0x2336ea=_0x2336ea-0x0;var _0x216bf9=_0x39a7[_0x2336ea];return _0x216bf9;};'use strict';var EventEmitter=require(_0x739a('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x739a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x739a('0x2')};function emitEvent(_0x131844){return function(_0x40ed90,_0x123956,_0x5420f4){VoiceQueueReportEvents[_0x739a('0x3')](_0x131844+':'+_0x40ed90['id'],_0x40ed90);VoiceQueueReportEvents[_0x739a('0x3')](_0x131844,_0x40ed90);_0x5420f4(null);};}for(var e in events){if(events[_0x739a('0x4')](e)){var event=events[e];VoiceQueueReport[_0x739a('0x5')](e,emitEvent(event));}}module[_0x739a('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x2d20=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x48a8d4,_0x3f35bd){var _0x277106=function(_0x5b44ab){while(--_0x5b44ab){_0x48a8d4['push'](_0x48a8d4['shift']());}};_0x277106(++_0x3f35bd);}(_0x2d20,0x67));var _0x02d2=function(_0x3484a7,_0xebb108){_0x3484a7=_0x3484a7-0x0;var _0x120e60=_0x2d20[_0x3484a7];return _0x120e60;};'use strict';var EventEmitter=require(_0x02d2('0x0'));var VoiceQueueReport=require(_0x02d2('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x02d2('0x2')](0x0);var events={'afterCreate':_0x02d2('0x3'),'afterUpdate':_0x02d2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1aed0d){return function(_0x40d0be,_0x28d130,_0x129c02){VoiceQueueReportEvents[_0x02d2('0x5')](_0x1aed0d+':'+_0x40d0be['id'],_0x40d0be);VoiceQueueReportEvents[_0x02d2('0x5')](_0x1aed0d,_0x40d0be);_0x129c02(null);};}for(var e in events){if(events[_0x02d2('0x6')](e)){var event=events[e];VoiceQueueReport[_0x02d2('0x7')](e,emitEvent(event));}}module[_0x02d2('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 71a7deb..adde150 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 _0x29d4=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x57aa1a,_0xd85bfd){var _0x4374c9=function(_0x429024){while(--_0x429024){_0x57aa1a['push'](_0x57aa1a['shift']());}};_0x4374c9(++_0xd85bfd);}(_0x29d4,0x1a1));var _0x429d=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x29d4[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var BPromise=require(_0x429d('0x4'));var rp=require(_0x429d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var attributes=require(_0x429d('0x8'));module[_0x429d('0x9')]=function(_0x1c55aa,_0xa71445){return _0x1c55aa[_0x429d('0xa')](_0x429d('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x429d('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1193=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash','util','api','moment'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x1193,0xb0));var _0x3119=function(_0x3334a2,_0x2bf2c4){_0x3334a2=_0x3334a2-0x0;var _0x166070=_0x1193[_0x3334a2];return _0x166070;};'use strict';var _=require(_0x3119('0x0'));var util=require(_0x3119('0x1'));var logger=require('../../config/logger')(_0x3119('0x2'));var moment=require(_0x3119('0x3'));var BPromise=require(_0x3119('0x4'));var rp=require(_0x3119('0x5'));var fs=require('fs');var path=require(_0x3119('0x6'));var rimraf=require(_0x3119('0x7'));var config=require(_0x3119('0x8'));var attributes=require(_0x3119('0x9'));module[_0x3119('0xa')]=function(_0x5e5de1,_0x347ec0){return _0x5e5de1[_0x3119('0xb')](_0x3119('0xc'),attributes,{'tableName':_0x3119('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3119('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 94d40a1..de6337d 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 _0x03bc=['where','attributes','include','map','model','GetVoiceQueueReport','VoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','findAll','options','raw'];(function(_0x2ff064,_0x194717){var _0x429dbb=function(_0x25039b){while(--_0x25039b){_0x2ff064['push'](_0x2ff064['shift']());}};_0x429dbb(++_0x194717);}(_0x03bc,0xbd));var _0xc03b=function(_0x53dbf7,_0x4953cc){_0x53dbf7=_0x53dbf7-0x0;var _0x543510=_0x03bc[_0x53dbf7];return _0x543510;};'use strict';var _=require(_0xc03b('0x0'));var util=require(_0xc03b('0x1'));var moment=require(_0xc03b('0x2'));var BPromise=require(_0xc03b('0x3'));var rs=require(_0xc03b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc03b('0x5'))['db'];var utils=require(_0xc03b('0x6'));var logger=require(_0xc03b('0x7'))(_0xc03b('0x8'));var config=require(_0xc03b('0x9'));var jayson=require(_0xc03b('0xa'));var client=jayson[_0xc03b('0xb')][_0xc03b('0xc')]({'port':0x232a});config[_0xc03b('0xd')]=_[_0xc03b('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc03b('0xf'))(new Redis(config[_0xc03b('0xd')]));require('./voiceQueueReport.socket')[_0xc03b('0x10')](socket);function respondWithRpcPromise(_0x17af40,_0x87d540,_0x53f365){return new BPromise(function(_0x5ded1a,_0x46fe90){return client[_0xc03b('0x11')](_0x17af40,_0x53f365)[_0xc03b('0x12')](function(_0x115f48){logger[_0xc03b('0x13')](_0xc03b('0x14'),_0x87d540,_0xc03b('0x15'));logger[_0xc03b('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x87d540,_0xc03b('0x15'),JSON[_0xc03b('0x17')](_0x115f48));if(_0x115f48['error']){if(_0x115f48[_0xc03b('0x18')][_0xc03b('0x19')]===0x1f4){logger['error'](_0xc03b('0x14'),_0x87d540,_0x115f48[_0xc03b('0x18')]['message']);return _0x46fe90(_0x115f48[_0xc03b('0x18')]['message']);}logger[_0xc03b('0x18')](_0xc03b('0x14'),_0x87d540,_0x115f48[_0xc03b('0x18')]['message']);return _0x5ded1a(_0x115f48[_0xc03b('0x18')][_0xc03b('0x1a')]);}else{logger[_0xc03b('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x87d540,_0xc03b('0x15'));_0x5ded1a(_0x115f48['result']['message']);}})[_0xc03b('0x1b')](function(_0x2337f7){logger[_0xc03b('0x18')](_0xc03b('0x14'),_0x87d540,_0x2337f7);_0x46fe90(_0x2337f7);});});}exports['GetVoiceQueueReport']=function(_0x2810e5){var _0x26ecb7=this;return new Promise(function(_0x4d4dfb,_0x4b1909){return db['VoiceQueueReport'][_0xc03b('0x1c')]({'raw':_0x2810e5[_0xc03b('0x1d')]?_0x2810e5['options'][_0xc03b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2810e5[_0xc03b('0x1d')]?_0x2810e5[_0xc03b('0x1d')][_0xc03b('0x1f')]||null:null,'attributes':_0x2810e5[_0xc03b('0x1d')]?_0x2810e5['options'][_0xc03b('0x20')]||null:null,'limit':_0x2810e5[_0xc03b('0x1d')]?_0x2810e5[_0xc03b('0x1d')]['limit']||null:null,'include':_0x2810e5['options']?_0x2810e5[_0xc03b('0x1d')][_0xc03b('0x21')]?_[_0xc03b('0x22')](_0x2810e5[_0xc03b('0x1d')][_0xc03b('0x21')],function(_0x35a870){return{'model':db[_0x35a870['model']],'as':_0x35a870['as'],'attributes':_0x35a870[_0xc03b('0x20')],'include':_0x35a870[_0xc03b('0x21')]?_['map'](_0x35a870[_0xc03b('0x21')],function(_0x3fbf5a){return{'model':db[_0x3fbf5a[_0xc03b('0x23')]],'as':_0x3fbf5a['as'],'attributes':_0x3fbf5a['attributes'],'include':_0x3fbf5a['include']?_['map'](_0x3fbf5a['include'],function(_0x551b4c){return{'model':db[_0x551b4c[_0xc03b('0x23')]],'as':_0x551b4c['as'],'attributes':_0x551b4c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc03b('0x12')](function(_0x19fe71){logger['info']('GetVoiceQueueReport',_0x2810e5);logger[_0xc03b('0x16')]('GetVoiceQueueReport',_0x2810e5,JSON['stringify'](_0x19fe71));_0x4d4dfb(_0x19fe71);})['catch'](function(_0x32a658){logger[_0xc03b('0x18')](_0xc03b('0x24'),_0x32a658[_0xc03b('0x1a')],_0x2810e5);_0x4b1909(_0x26ecb7[_0xc03b('0x18')](0x1f4,_0x32a658[_0xc03b('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x3e1f04){var _0x21af17=this;return new Promise(function(_0x1a861b,_0x33e0d0){return db[_0xc03b('0x25')][_0xc03b('0x26')](_0x3e1f04[_0xc03b('0x27')],{'raw':_0x3e1f04[_0xc03b('0x1d')]?_0x3e1f04[_0xc03b('0x1d')][_0xc03b('0x1e')]===undefined?!![]:![]:!![]})[_0xc03b('0x12')](function(_0x18dd10){logger[_0xc03b('0x13')](_0xc03b('0x28'),_0x3e1f04);logger['debug'](_0xc03b('0x28'),_0x3e1f04,JSON['stringify'](_0x18dd10));_0x1a861b(_0x18dd10);})['catch'](function(_0x269ab4){logger[_0xc03b('0x18')](_0xc03b('0x28'),_0x269ab4[_0xc03b('0x1a')],_0x3e1f04);_0x33e0d0(_0x21af17[_0xc03b('0x18')](0x1f4,_0x269ab4['message']));});});};exports[_0xc03b('0x29')]=function(_0x1864fd){var _0x2ef404=this;return new Promise(function(_0x4fa2b1,_0x2ded47){return db[_0xc03b('0x25')][_0xc03b('0x2a')](_0x1864fd[_0xc03b('0x27')],{'raw':_0x1864fd[_0xc03b('0x1d')]?_0x1864fd[_0xc03b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1864fd[_0xc03b('0x1d')]?_0x1864fd['options'][_0xc03b('0x1f')]||null:null,'attributes':_0x1864fd['options']?_0x1864fd[_0xc03b('0x1d')][_0xc03b('0x20')]||null:null,'limit':_0x1864fd[_0xc03b('0x1d')]?_0x1864fd[_0xc03b('0x1d')][_0xc03b('0x2b')]||null:null})['then'](function(_0x566bcd){logger[_0xc03b('0x13')](_0xc03b('0x29'),_0x1864fd);logger[_0xc03b('0x16')]('UpdateVoiceQueueReport',_0x1864fd,JSON[_0xc03b('0x17')](_0x566bcd));_0x4fa2b1(_0x566bcd);})[_0xc03b('0x1b')](function(_0x2ec5cb){logger[_0xc03b('0x18')](_0xc03b('0x29'),_0x2ec5cb[_0xc03b('0x1a')],_0x1864fd);_0x2ded47(_0x2ef404[_0xc03b('0x18')](0x1f4,_0x2ec5cb[_0xc03b('0x1a')]));});});}; \ No newline at end of file +var _0x8a95=['message','request\x20sent','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','attributes','limit','include','map','model','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','raw','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8a95,0x147));var _0x58a9=function(_0x4ee458,_0x4f966d){_0x4ee458=_0x4ee458-0x0;var _0x4df0c8=_0x8a95[_0x4ee458];return _0x4df0c8;};'use strict';var _=require(_0x58a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x58a9('0x1'));var rs=require(_0x58a9('0x2'));var fs=require('fs');var Redis=require(_0x58a9('0x3'));var db=require(_0x58a9('0x4'))['db'];var utils=require(_0x58a9('0x5'));var logger=require(_0x58a9('0x6'))(_0x58a9('0x7'));var config=require(_0x58a9('0x8'));var jayson=require(_0x58a9('0x9'));var client=jayson[_0x58a9('0xa')][_0x58a9('0xb')]({'port':0x232a});config[_0x58a9('0xc')]=_['defaults'](config[_0x58a9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x58a9('0xd'))(new Redis(config['redis']));require(_0x58a9('0xe'))[_0x58a9('0xf')](socket);function respondWithRpcPromise(_0x3bb6d6,_0x5c2af4,_0x91636f){return new BPromise(function(_0x32f5a8,_0x7bc88c){return client[_0x58a9('0x10')](_0x3bb6d6,_0x91636f)[_0x58a9('0x11')](function(_0x1f8dcc){logger[_0x58a9('0x12')](_0x58a9('0x13'),_0x5c2af4,'request\x20sent');logger[_0x58a9('0x14')](_0x58a9('0x15'),_0x5c2af4,'request\x20sent',JSON[_0x58a9('0x16')](_0x1f8dcc));if(_0x1f8dcc['error']){if(_0x1f8dcc[_0x58a9('0x17')][_0x58a9('0x18')]===0x1f4){logger[_0x58a9('0x17')](_0x58a9('0x13'),_0x5c2af4,_0x1f8dcc[_0x58a9('0x17')]['message']);return _0x7bc88c(_0x1f8dcc[_0x58a9('0x17')][_0x58a9('0x19')]);}logger['error'](_0x58a9('0x13'),_0x5c2af4,_0x1f8dcc[_0x58a9('0x17')][_0x58a9('0x19')]);return _0x32f5a8(_0x1f8dcc['error'][_0x58a9('0x19')]);}else{logger[_0x58a9('0x12')](_0x58a9('0x13'),_0x5c2af4,_0x58a9('0x1a'));_0x32f5a8(_0x1f8dcc[_0x58a9('0x1b')][_0x58a9('0x19')]);}})[_0x58a9('0x1c')](function(_0xc2371e){logger[_0x58a9('0x17')](_0x58a9('0x13'),_0x5c2af4,_0xc2371e);_0x7bc88c(_0xc2371e);});});}exports[_0x58a9('0x1d')]=function(_0x5847eb){var _0x192bd5=this;return new Promise(function(_0x4b708d,_0x3b00ba){return db[_0x58a9('0x1e')]['findAll']({'raw':_0x5847eb[_0x58a9('0x1f')]?_0x5847eb[_0x58a9('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5847eb[_0x58a9('0x1f')]?_0x5847eb[_0x58a9('0x1f')]['where']||null:null,'attributes':_0x5847eb['options']?_0x5847eb[_0x58a9('0x1f')][_0x58a9('0x20')]||null:null,'limit':_0x5847eb[_0x58a9('0x1f')]?_0x5847eb['options'][_0x58a9('0x21')]||null:null,'include':_0x5847eb['options']?_0x5847eb[_0x58a9('0x1f')][_0x58a9('0x22')]?_[_0x58a9('0x23')](_0x5847eb[_0x58a9('0x1f')][_0x58a9('0x22')],function(_0x4fbddd){return{'model':db[_0x4fbddd[_0x58a9('0x24')]],'as':_0x4fbddd['as'],'attributes':_0x4fbddd[_0x58a9('0x20')],'include':_0x4fbddd[_0x58a9('0x22')]?_[_0x58a9('0x23')](_0x4fbddd[_0x58a9('0x22')],function(_0x582438){return{'model':db[_0x582438[_0x58a9('0x24')]],'as':_0x582438['as'],'attributes':_0x582438[_0x58a9('0x20')],'include':_0x582438[_0x58a9('0x22')]?_[_0x58a9('0x23')](_0x582438[_0x58a9('0x22')],function(_0x5a1ea5){return{'model':db[_0x5a1ea5[_0x58a9('0x24')]],'as':_0x5a1ea5['as'],'attributes':_0x5a1ea5[_0x58a9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58a9('0x11')](function(_0x82735a){logger[_0x58a9('0x12')](_0x58a9('0x1d'),_0x5847eb);logger['debug'](_0x58a9('0x1d'),_0x5847eb,JSON[_0x58a9('0x16')](_0x82735a));_0x4b708d(_0x82735a);})[_0x58a9('0x1c')](function(_0x97eb93){logger[_0x58a9('0x17')](_0x58a9('0x1d'),_0x97eb93[_0x58a9('0x19')],_0x5847eb);_0x3b00ba(_0x192bd5[_0x58a9('0x17')](0x1f4,_0x97eb93[_0x58a9('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0xa8f1d8){var _0x2c63d2=this;return new Promise(function(_0x2f1ce8,_0x33257b){return db[_0x58a9('0x1e')][_0x58a9('0x25')](_0xa8f1d8[_0x58a9('0x26')],{'raw':_0xa8f1d8[_0x58a9('0x1f')]?_0xa8f1d8['options']['raw']===undefined?!![]:![]:!![]})[_0x58a9('0x11')](function(_0x5ea02c){logger[_0x58a9('0x12')](_0x58a9('0x27'),_0xa8f1d8);logger[_0x58a9('0x14')](_0x58a9('0x27'),_0xa8f1d8,JSON[_0x58a9('0x16')](_0x5ea02c));_0x2f1ce8(_0x5ea02c);})[_0x58a9('0x1c')](function(_0x17de23){logger[_0x58a9('0x17')](_0x58a9('0x27'),_0x17de23[_0x58a9('0x19')],_0xa8f1d8);_0x33257b(_0x2c63d2[_0x58a9('0x17')](0x1f4,_0x17de23['message']));});});};exports[_0x58a9('0x28')]=function(_0x235366){var _0x41e8d4=this;return new Promise(function(_0x147ef4,_0x4d034d){return db[_0x58a9('0x1e')][_0x58a9('0x29')](_0x235366[_0x58a9('0x26')],{'raw':_0x235366[_0x58a9('0x1f')]?_0x235366['options'][_0x58a9('0x2a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235366['options']?_0x235366[_0x58a9('0x1f')][_0x58a9('0x2b')]||null:null,'attributes':_0x235366[_0x58a9('0x1f')]?_0x235366['options'][_0x58a9('0x20')]||null:null,'limit':_0x235366[_0x58a9('0x1f')]?_0x235366['options'][_0x58a9('0x21')]||null:null})[_0x58a9('0x11')](function(_0x4b35c5){logger['info']('UpdateVoiceQueueReport',_0x235366);logger[_0x58a9('0x14')](_0x58a9('0x28'),_0x235366,JSON[_0x58a9('0x16')](_0x4b35c5));_0x147ef4(_0x4b35c5);})['catch'](function(_0x28176e){logger[_0x58a9('0x17')](_0x58a9('0x28'),_0x28176e[_0x58a9('0x19')],_0x235366);_0x4d034d(_0x41e8d4[_0x58a9('0x17')](0x1f4,_0x28176e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index eb857cb..a7547b7 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 _0x9752=['emit','removeListener','register','voiceQueueReport:','save','remove','update'];(function(_0x218941,_0x1c1d5d){var _0x2b6ef3=function(_0x38004f){while(--_0x38004f){_0x218941['push'](_0x218941['shift']());}};_0x2b6ef3(++_0x1c1d5d);}(_0x9752,0x90));var _0x2975=function(_0x4f16f6,_0x10bf76){_0x4f16f6=_0x4f16f6-0x0;var _0x581759=_0x9752[_0x4f16f6];return _0x581759;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2975('0x0'),_0x2975('0x1'),_0x2975('0x2')];function createListener(_0x339e5e,_0x586021){return function(_0xd14963){_0x586021[_0x2975('0x3')](_0x339e5e,_0xd14963);};}function removeListener(_0x3ab330,_0x43c0a8){return function(){VoiceQueueReportEvents[_0x2975('0x4')](_0x3ab330,_0x43c0a8);};}exports[_0x2975('0x5')]=function(_0x8d643d){for(var _0x288fbd=0x0,_0x3183f1=events['length'];_0x288fbd<_0x3183f1;_0x288fbd++){var _0x404fb1=events[_0x288fbd];var _0x309302=createListener(_0x2975('0x6')+_0x404fb1,_0x8d643d);VoiceQueueReportEvents['on'](_0x404fb1,_0x309302);}}; \ No newline at end of file +var _0xbfc0=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x1083c9,_0x5ccb0f){var _0x309be0=function(_0x7fab8a){while(--_0x7fab8a){_0x1083c9['push'](_0x1083c9['shift']());}};_0x309be0(++_0x5ccb0f);}(_0xbfc0,0x125));var _0x0bfc=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0xbfc0[_0x153e7d];return _0x3c22dd;};'use strict';var VoiceQueueReportEvents=require(_0x0bfc('0x0'));var events=[_0x0bfc('0x1'),_0x0bfc('0x2'),_0x0bfc('0x3')];function createListener(_0x44194a,_0x27a960){return function(_0x2f0497){_0x27a960[_0x0bfc('0x4')](_0x44194a,_0x2f0497);};}function removeListener(_0x550400,_0x27550b){return function(){VoiceQueueReportEvents['removeListener'](_0x550400,_0x27550b);};}exports[_0x0bfc('0x5')]=function(_0x38afc3){for(var _0x1e81dd=0x0,_0x13f3a1=events[_0x0bfc('0x6')];_0x1e81dd<_0x13f3a1;_0x1e81dd++){var _0x31b89f=events[_0x1e81dd];var _0x115528=createListener(_0x0bfc('0x7')+_0x31b89f,_0x38afc3);VoiceQueueReportEvents['on'](_0x31b89f,_0x115528);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9a264e5..2f5567e 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 _0x912c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','post','create','put','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3aa4df,_0x18e70b){var _0x521505=function(_0x581b83){while(--_0x581b83){_0x3aa4df['push'](_0x3aa4df['shift']());}};_0x521505(++_0x18e70b);}(_0x912c,0x12d));var _0xc912=function(_0x16b561,_0x5a914f){_0x16b561=_0x16b561-0x0;var _0x22599f=_0x912c[_0x16b561];return _0x22599f;};'use strict';var multer=require('multer');var util=require(_0xc912('0x0'));var path=require(_0xc912('0x1'));var timeout=require(_0xc912('0x2'));var express=require(_0xc912('0x3'));var router=express['Router']();var fs_extra=require(_0xc912('0x4'));var auth=require(_0xc912('0x5'));var interaction=require(_0xc912('0x6'));var config=require(_0xc912('0x7'));var controller=require(_0xc912('0x8'));router['get']('/',auth[_0xc912('0x9')](),controller[_0xc912('0xa')]);router[_0xc912('0xb')]('/:id',auth[_0xc912('0x9')](),controller['show']);router[_0xc912('0xc')]('/',auth[_0xc912('0x9')](),controller[_0xc912('0xd')]);router[_0xc912('0xe')](_0xc912('0xf'),auth[_0xc912('0x9')](),controller['update']);router['delete'](_0xc912('0xf'),auth[_0xc912('0x9')](),controller[_0xc912('0x10')]);module[_0xc912('0x11')]=router; \ No newline at end of file +var _0xf6d1=['../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x488092,_0x180ac9){var _0x263a8f=function(_0x413e0d){while(--_0x413e0d){_0x488092['push'](_0x488092['shift']());}};_0x263a8f(++_0x180ac9);}(_0xf6d1,0x99));var _0x1f6d=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xf6d1[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x1f6d('0x0'));var util=require(_0x1f6d('0x1'));var path=require(_0x1f6d('0x2'));var timeout=require(_0x1f6d('0x3'));var express=require(_0x1f6d('0x4'));var router=express[_0x1f6d('0x5')]();var fs_extra=require(_0x1f6d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6d('0x7'));var config=require('../../config/environment');var controller=require(_0x1f6d('0x8'));router[_0x1f6d('0x9')]('/',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xb')]);router[_0x1f6d('0x9')](_0x1f6d('0xc'),auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xd')]);router[_0x1f6d('0xe')]('/',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xf')]);router[_0x1f6d('0x10')]('/:id',auth[_0x1f6d('0xa')](),controller['update']);router[_0x1f6d('0x11')]('/:id',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0x12')]);module[_0x1f6d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 51c8a78..4f7399d 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 _0x1f11=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x1b42a8,_0x26e161){var _0x125b77=function(_0x15dcca){while(--_0x15dcca){_0x1b42a8['push'](_0x1b42a8['shift']());}};_0x125b77(++_0x26e161);}(_0x1f11,0x137));var _0x11f1=function(_0x397f04,_0x2d9ef5){_0x397f04=_0x397f04-0x0;var _0x249786=_0x1f11[_0x397f04];return _0x249786;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x11f1('0x0'));module['exports']={'time':{'type':Sequelize[_0x11f1('0x1')]},'callid':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x11f1('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x11f1('0x2')],'allowNull':![],'defaultValue':moment()['format'](_0x11f1('0x3'))}}; \ No newline at end of file +var _0xc040=['DATE','format','moment','STRING'];(function(_0x2adaec,_0x29e57e){var _0x2e22c7=function(_0x14b841){while(--_0x14b841){_0x2adaec['push'](_0x2adaec['shift']());}};_0x2e22c7(++_0x29e57e);}(_0xc040,0xc6));var _0x0c04=function(_0x316bd0,_0x521710){_0x316bd0=_0x316bd0-0x0;var _0xa2ac28=_0xc040[_0x316bd0];return _0xa2ac28;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0c04('0x0'));module['exports']={'time':{'type':Sequelize[_0x0c04('0x1')]},'callid':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0c04('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0c04('0x2')],'allowNull':![],'defaultValue':moment()[_0x0c04('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8e7bc8c..5a5b096 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 _0x1b87=['filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick'];(function(_0x2d3733,_0xe82103){var _0x27008a=function(_0x2c12c8){while(--_0x2c12c8){_0x2d3733['push'](_0x2d3733['shift']());}};_0x27008a(++_0xe82103);}(_0x1b87,0xa3));var _0x71b8=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x1b87[_0x427d3a];return _0xe5c521;};'use strict';var emlformat=require(_0x71b8('0x0'));var rimraf=require(_0x71b8('0x1'));var zipdir=require(_0x71b8('0x2'));var jsonpatch=require(_0x71b8('0x3'));var rp=require(_0x71b8('0x4'));var moment=require(_0x71b8('0x5'));var BPromise=require(_0x71b8('0x6'));var Mustache=require(_0x71b8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x71b8('0x8'));var csv=require(_0x71b8('0x9'));var ejs=require(_0x71b8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71b8('0xb'));var squel=require('squel');var crypto=require(_0x71b8('0xc'));var jsforce=require(_0x71b8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x71b8('0xe'));var Papa=require(_0x71b8('0xf'));var Redis=require(_0x71b8('0x10'));var authService=require(_0x71b8('0x11'));var qs=require(_0x71b8('0x12'));var as=require(_0x71b8('0x13'));var hardwareService=require(_0x71b8('0x14'));var logger=require(_0x71b8('0x15'))(_0x71b8('0x16'));var utils=require(_0x71b8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x71b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5982f9,_0x36614d){_0x36614d=_0x36614d||0xcc;return function(_0x54a6cf){if(_0x54a6cf){return _0x5982f9[_0x71b8('0x19')](_0x36614d);}return _0x5982f9[_0x71b8('0x1a')](_0x36614d)[_0x71b8('0x1b')]();};}function respondWithResult(_0x53941f,_0x277549){_0x277549=_0x277549||0xc8;return function(_0x4c8ab3){if(_0x4c8ab3){return _0x53941f[_0x71b8('0x1a')](_0x277549)['json'](_0x4c8ab3);}};}function respondWithFilteredResult(_0x43468d,_0x5771c2){return function(_0x1c9866){if(_0x1c9866){var _0x553317=typeof _0x5771c2[_0x71b8('0x1c')]===_0x71b8('0x1d')&&typeof _0x5771c2[_0x71b8('0x1e')]===_0x71b8('0x1d');var _0x310c9c=_0x1c9866[_0x71b8('0x1f')];var _0xf2187f=_0x553317?0x0:_0x5771c2[_0x71b8('0x1c')];var _0x188f7b=_0x553317?_0x1c9866['count']:_0x5771c2[_0x71b8('0x1c')]+_0x5771c2[_0x71b8('0x1e')];var _0x1e78ea;if(_0x188f7b>=_0x310c9c){_0x188f7b=_0x310c9c;_0x1e78ea=0xc8;}else{_0x1e78ea=0xce;}_0x43468d['status'](_0x1e78ea);return _0x43468d[_0x71b8('0x20')](_0x71b8('0x21'),_0xf2187f+'-'+_0x188f7b+'/'+_0x310c9c)['json'](_0x1c9866);}return null;};}function patchUpdates(_0x8c8fe9){return function(_0x36451a){try{jsonpatch[_0x71b8('0x22')](_0x36451a,_0x8c8fe9,!![]);}catch(_0x4c32da){return BPromise[_0x71b8('0x23')](_0x4c32da);}return _0x36451a['save']();};}function saveUpdates(_0x6e0473,_0x25a1ab){return function(_0x2b4b86){if(_0x2b4b86){return _0x2b4b86[_0x71b8('0x24')](_0x6e0473)[_0x71b8('0x25')](function(_0x4f14e6){return _0x4f14e6;});}return null;};}function removeEntity(_0x496b8d,_0x12ebf3){return function(_0x714612){if(_0x714612){return _0x714612['destroy']()['then'](function(){_0x496b8d[_0x71b8('0x1a')](0xcc)[_0x71b8('0x1b')]();});}};}function handleEntityNotFound(_0x57e3b2,_0x5799e8){return function(_0x558764){if(!_0x558764){_0x57e3b2['sendStatus'](0x194);}return _0x558764;};}function handleError(_0x1ab846,_0xc6b39a){_0xc6b39a=_0xc6b39a||0x1f4;return function(_0x3bf328){logger[_0x71b8('0x26')](_0x3bf328[_0x71b8('0x27')]);if(_0x3bf328[_0x71b8('0x28')]){delete _0x3bf328[_0x71b8('0x28')];}_0x1ab846[_0x71b8('0x1a')](_0xc6b39a)[_0x71b8('0x29')](_0x3bf328);};}exports[_0x71b8('0x2a')]=function(_0x2d7421,_0x4610d2){var _0xe634e={},_0x37fd02={},_0x1c6d73={'count':0x0,'rows':[]};var _0x2e713f=_[_0x71b8('0x2b')](db[_0x71b8('0x2c')]['rawAttributes'],function(_0x545171){return{'name':_0x545171[_0x71b8('0x2d')],'type':_0x545171[_0x71b8('0x2e')]['key']};});_0x37fd02['model']=_[_0x71b8('0x2b')](_0x2e713f,_0x71b8('0x28'));_0x37fd02[_0x71b8('0x2f')]=_['keys'](_0x2d7421['query']);_0x37fd02['filters']=_[_0x71b8('0x30')](_0x37fd02['model'],_0x37fd02[_0x71b8('0x2f')]);_0xe634e[_0x71b8('0x31')]=_[_0x71b8('0x30')](_0x37fd02[_0x71b8('0x32')],qs[_0x71b8('0x33')](_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x33')]));_0xe634e[_0x71b8('0x31')]=_0xe634e[_0x71b8('0x31')][_0x71b8('0x34')]?_0xe634e[_0x71b8('0x31')]:_0x37fd02[_0x71b8('0x32')];if(!_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x35')](_0x71b8('0x36'))){_0xe634e[_0x71b8('0x1e')]=qs[_0x71b8('0x1e')](_0x2d7421[_0x71b8('0x2f')]['limit']);_0xe634e[_0x71b8('0x1c')]=qs[_0x71b8('0x1c')](_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x1c')]);}_0xe634e['order']=qs['sort'](_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x37')]);_0xe634e[_0x71b8('0x38')]=qs[_0x71b8('0x39')](_[_0x71b8('0x3a')](_0x2d7421[_0x71b8('0x2f')],_0x37fd02[_0x71b8('0x39')]),_0x2e713f);if(_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x3b')]){_0xe634e[_0x71b8('0x38')]=_[_0x71b8('0x3c')](_0xe634e[_0x71b8('0x38')],{'$or':_[_0x71b8('0x2b')](_0x2e713f,function(_0x1c0c2c){if(_0x1c0c2c[_0x71b8('0x2e')]!=='VIRTUAL'){var _0x4d1831={};_0x4d1831[_0x1c0c2c['name']]={'$like':'%'+_0x2d7421[_0x71b8('0x2f')][_0x71b8('0x3b')]+'%'};return _0x4d1831;}})});}_0xe634e=_[_0x71b8('0x3c')]({},_0xe634e,_0x2d7421[_0x71b8('0x3d')]);var _0x40e68b={'where':_0xe634e[_0x71b8('0x38')]};return db[_0x71b8('0x2c')]['count'](_0x40e68b)[_0x71b8('0x25')](function(_0x265d26){_0x1c6d73[_0x71b8('0x1f')]=_0x265d26;if(_0x2d7421['query'][_0x71b8('0x3e')]){_0xe634e['include']=[{'all':!![]}];}return db[_0x71b8('0x2c')][_0x71b8('0x3f')](_0xe634e);})[_0x71b8('0x25')](function(_0x528daa){_0x1c6d73[_0x71b8('0x40')]=_0x528daa;return _0x1c6d73;})[_0x71b8('0x25')](respondWithFilteredResult(_0x4610d2,_0xe634e))['catch'](handleError(_0x4610d2,null));};exports[_0x71b8('0x41')]=function(_0x28bd24,_0x2722b1){var _0x204f04={'raw':!![],'where':{'id':_0x28bd24[_0x71b8('0x42')]['id']}},_0x5e642b={};_0x5e642b[_0x71b8('0x32')]=_['keys'](db[_0x71b8('0x2c')][_0x71b8('0x43')]);_0x5e642b[_0x71b8('0x2f')]=_['keys'](_0x28bd24[_0x71b8('0x2f')]);_0x5e642b[_0x71b8('0x39')]=_['intersection'](_0x5e642b[_0x71b8('0x32')],_0x5e642b['query']);_0x204f04[_0x71b8('0x31')]=_['intersection'](_0x5e642b[_0x71b8('0x32')],qs['fields'](_0x28bd24[_0x71b8('0x2f')][_0x71b8('0x33')]));_0x204f04[_0x71b8('0x31')]=_0x204f04[_0x71b8('0x31')][_0x71b8('0x34')]?_0x204f04['attributes']:_0x5e642b[_0x71b8('0x32')];if(_0x28bd24['query'][_0x71b8('0x3e')]){_0x204f04[_0x71b8('0x44')]=[{'all':!![]}];}_0x204f04=_[_0x71b8('0x3c')]({},_0x204f04,_0x28bd24[_0x71b8('0x3d')]);return db[_0x71b8('0x2c')]['find'](_0x204f04)[_0x71b8('0x25')](handleEntityNotFound(_0x2722b1,null))[_0x71b8('0x25')](respondWithResult(_0x2722b1,null))[_0x71b8('0x45')](handleError(_0x2722b1,null));};exports[_0x71b8('0x46')]=function(_0x436ffb,_0x380c89){return db[_0x71b8('0x2c')][_0x71b8('0x46')](_0x436ffb[_0x71b8('0x47')],{})[_0x71b8('0x25')](respondWithResult(_0x380c89,0xc9))[_0x71b8('0x45')](handleError(_0x380c89,null));};exports[_0x71b8('0x24')]=function(_0x51f163,_0x58c19f){if(_0x51f163[_0x71b8('0x47')]['id']){delete _0x51f163[_0x71b8('0x47')]['id'];}return db['VoiceQueuesLog'][_0x71b8('0x48')]({'where':{'id':_0x51f163[_0x71b8('0x42')]['id']}})[_0x71b8('0x25')](handleEntityNotFound(_0x58c19f,null))[_0x71b8('0x25')](saveUpdates(_0x51f163[_0x71b8('0x47')],null))['then'](respondWithResult(_0x58c19f,null))['catch'](handleError(_0x58c19f,null));};exports[_0x71b8('0x49')]=function(_0x316b83,_0x57b6b5){return db['VoiceQueuesLog'][_0x71b8('0x48')]({'where':{'id':_0x316b83[_0x71b8('0x42')]['id']}})[_0x71b8('0x25')](handleEntityNotFound(_0x57b6b5,null))[_0x71b8('0x25')](removeEntity(_0x57b6b5,null))[_0x71b8('0x45')](handleError(_0x57b6b5,null));}; \ No newline at end of file +var _0x6d94=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','merge','VIRTUAL','filter','VoiceQueuesLog','includeAll','findAll','catch','show','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x788c48,_0x5c0e5e){var _0x299c14=function(_0x6be4c){while(--_0x6be4c){_0x788c48['push'](_0x788c48['shift']());}};_0x299c14(++_0x5c0e5e);}(_0x6d94,0x1bc));var _0x46d9=function(_0x350e45,_0xa64cbc){_0x350e45=_0x350e45-0x0;var _0x4334dc=_0x6d94[_0x350e45];return _0x4334dc;};'use strict';var emlformat=require(_0x46d9('0x0'));var rimraf=require(_0x46d9('0x1'));var zipdir=require(_0x46d9('0x2'));var jsonpatch=require(_0x46d9('0x3'));var rp=require('request-promise');var moment=require(_0x46d9('0x4'));var BPromise=require(_0x46d9('0x5'));var Mustache=require(_0x46d9('0x6'));var util=require(_0x46d9('0x7'));var path=require(_0x46d9('0x8'));var sox=require(_0x46d9('0x9'));var csv=require(_0x46d9('0xa'));var ejs=require(_0x46d9('0xb'));var fs=require('fs');var fs_extra=require(_0x46d9('0xc'));var _=require(_0x46d9('0xd'));var squel=require(_0x46d9('0xe'));var crypto=require('crypto');var jsforce=require(_0x46d9('0xf'));var deskjs=require(_0x46d9('0x10'));var toCsv=require(_0x46d9('0xa'));var querystring=require(_0x46d9('0x11'));var Papa=require(_0x46d9('0x12'));var Redis=require(_0x46d9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x46d9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46d9('0x15'));var logger=require(_0x46d9('0x16'))(_0x46d9('0x17'));var utils=require(_0x46d9('0x18'));var config=require(_0x46d9('0x19'));var licenseUtil=require(_0x46d9('0x1a'));var db=require(_0x46d9('0x1b'))['db'];function respondWithStatusCode(_0x395a43,_0x5a84da){_0x5a84da=_0x5a84da||0xcc;return function(_0x7f87e5){if(_0x7f87e5){return _0x395a43[_0x46d9('0x1c')](_0x5a84da);}return _0x395a43[_0x46d9('0x1d')](_0x5a84da)[_0x46d9('0x1e')]();};}function respondWithResult(_0x13e29a,_0x4f070f){_0x4f070f=_0x4f070f||0xc8;return function(_0x354379){if(_0x354379){return _0x13e29a[_0x46d9('0x1d')](_0x4f070f)[_0x46d9('0x1f')](_0x354379);}};}function respondWithFilteredResult(_0x569ae1,_0x420c2a){return function(_0x4925cd){if(_0x4925cd){var _0xa4533f=typeof _0x420c2a['offset']===_0x46d9('0x20')&&typeof _0x420c2a['limit']===_0x46d9('0x20');var _0x4c09ef=_0x4925cd[_0x46d9('0x21')];var _0x263e3e=_0xa4533f?0x0:_0x420c2a[_0x46d9('0x22')];var _0x4209a5=_0xa4533f?_0x4925cd['count']:_0x420c2a['offset']+_0x420c2a['limit'];var _0x32de87;if(_0x4209a5>=_0x4c09ef){_0x4209a5=_0x4c09ef;_0x32de87=0xc8;}else{_0x32de87=0xce;}_0x569ae1['status'](_0x32de87);return _0x569ae1[_0x46d9('0x23')](_0x46d9('0x24'),_0x263e3e+'-'+_0x4209a5+'/'+_0x4c09ef)[_0x46d9('0x1f')](_0x4925cd);}return null;};}function patchUpdates(_0x28cb5e){return function(_0x2f44f8){try{jsonpatch[_0x46d9('0x25')](_0x2f44f8,_0x28cb5e,!![]);}catch(_0x533dc9){return BPromise['reject'](_0x533dc9);}return _0x2f44f8[_0x46d9('0x26')]();};}function saveUpdates(_0x439d9f,_0x3bfc3c){return function(_0x5a8739){if(_0x5a8739){return _0x5a8739[_0x46d9('0x27')](_0x439d9f)[_0x46d9('0x28')](function(_0x2a0fa4){return _0x2a0fa4;});}return null;};}function removeEntity(_0x37d0d4,_0x272f68){return function(_0x50442a){if(_0x50442a){return _0x50442a[_0x46d9('0x29')]()[_0x46d9('0x28')](function(){_0x37d0d4[_0x46d9('0x1d')](0xcc)[_0x46d9('0x1e')]();});}};}function handleEntityNotFound(_0x2f206c,_0x4b984c){return function(_0x543a6d){if(!_0x543a6d){_0x2f206c[_0x46d9('0x1c')](0x194);}return _0x543a6d;};}function handleError(_0x544231,_0x47fef3){_0x47fef3=_0x47fef3||0x1f4;return function(_0x21bbc3){logger[_0x46d9('0x2a')](_0x21bbc3['stack']);if(_0x21bbc3[_0x46d9('0x2b')]){delete _0x21bbc3['name'];}_0x544231[_0x46d9('0x1d')](_0x47fef3)[_0x46d9('0x2c')](_0x21bbc3);};}exports[_0x46d9('0x2d')]=function(_0x2d2a43,_0x3948f3){var _0x14b50c={},_0x5c0b37={},_0x30f53f={'count':0x0,'rows':[]};var _0x3eabb5=_[_0x46d9('0x2e')](db['VoiceQueuesLog'][_0x46d9('0x2f')],function(_0x8eef00){return{'name':_0x8eef00[_0x46d9('0x30')],'type':_0x8eef00[_0x46d9('0x31')][_0x46d9('0x32')]};});_0x5c0b37[_0x46d9('0x33')]=_['map'](_0x3eabb5,_0x46d9('0x2b'));_0x5c0b37[_0x46d9('0x34')]=_[_0x46d9('0x35')](_0x2d2a43[_0x46d9('0x34')]);_0x5c0b37[_0x46d9('0x36')]=_[_0x46d9('0x37')](_0x5c0b37[_0x46d9('0x33')],_0x5c0b37[_0x46d9('0x34')]);_0x14b50c[_0x46d9('0x38')]=_[_0x46d9('0x37')](_0x5c0b37[_0x46d9('0x33')],qs[_0x46d9('0x39')](_0x2d2a43['query']['fields']));_0x14b50c['attributes']=_0x14b50c[_0x46d9('0x38')][_0x46d9('0x3a')]?_0x14b50c[_0x46d9('0x38')]:_0x5c0b37[_0x46d9('0x33')];if(!_0x2d2a43['query']['hasOwnProperty']('nolimit')){_0x14b50c[_0x46d9('0x3b')]=qs[_0x46d9('0x3b')](_0x2d2a43['query']['limit']);_0x14b50c[_0x46d9('0x22')]=qs[_0x46d9('0x22')](_0x2d2a43['query'][_0x46d9('0x22')]);}_0x14b50c[_0x46d9('0x3c')]=qs[_0x46d9('0x3d')](_0x2d2a43[_0x46d9('0x34')][_0x46d9('0x3d')]);_0x14b50c[_0x46d9('0x3e')]=qs[_0x46d9('0x36')](_['pick'](_0x2d2a43[_0x46d9('0x34')],_0x5c0b37['filters']),_0x3eabb5);if(_0x2d2a43[_0x46d9('0x34')]['filter']){_0x14b50c['where']=_[_0x46d9('0x3f')](_0x14b50c['where'],{'$or':_['map'](_0x3eabb5,function(_0x4b64f4){if(_0x4b64f4[_0x46d9('0x31')]!==_0x46d9('0x40')){var _0x14c162={};_0x14c162[_0x4b64f4[_0x46d9('0x2b')]]={'$like':'%'+_0x2d2a43[_0x46d9('0x34')][_0x46d9('0x41')]+'%'};return _0x14c162;}})});}_0x14b50c=_['merge']({},_0x14b50c,_0x2d2a43['options']);var _0x23fa45={'where':_0x14b50c['where']};return db[_0x46d9('0x42')][_0x46d9('0x21')](_0x23fa45)[_0x46d9('0x28')](function(_0x11b25b){_0x30f53f[_0x46d9('0x21')]=_0x11b25b;if(_0x2d2a43[_0x46d9('0x34')][_0x46d9('0x43')]){_0x14b50c['include']=[{'all':!![]}];}return db[_0x46d9('0x42')][_0x46d9('0x44')](_0x14b50c);})[_0x46d9('0x28')](function(_0x1e7617){_0x30f53f['rows']=_0x1e7617;return _0x30f53f;})[_0x46d9('0x28')](respondWithFilteredResult(_0x3948f3,_0x14b50c))[_0x46d9('0x45')](handleError(_0x3948f3,null));};exports[_0x46d9('0x46')]=function(_0x3ac977,_0x432cf3){var _0x1a32ae={'raw':!![],'where':{'id':_0x3ac977['params']['id']}},_0x5a45f9={};_0x5a45f9[_0x46d9('0x33')]=_['keys'](db[_0x46d9('0x42')][_0x46d9('0x2f')]);_0x5a45f9[_0x46d9('0x34')]=_[_0x46d9('0x35')](_0x3ac977['query']);_0x5a45f9[_0x46d9('0x36')]=_[_0x46d9('0x37')](_0x5a45f9[_0x46d9('0x33')],_0x5a45f9[_0x46d9('0x34')]);_0x1a32ae[_0x46d9('0x38')]=_[_0x46d9('0x37')](_0x5a45f9[_0x46d9('0x33')],qs[_0x46d9('0x39')](_0x3ac977[_0x46d9('0x34')][_0x46d9('0x39')]));_0x1a32ae['attributes']=_0x1a32ae['attributes'][_0x46d9('0x3a')]?_0x1a32ae[_0x46d9('0x38')]:_0x5a45f9[_0x46d9('0x33')];if(_0x3ac977[_0x46d9('0x34')][_0x46d9('0x43')]){_0x1a32ae[_0x46d9('0x47')]=[{'all':!![]}];}_0x1a32ae=_[_0x46d9('0x3f')]({},_0x1a32ae,_0x3ac977[_0x46d9('0x48')]);return db[_0x46d9('0x42')][_0x46d9('0x49')](_0x1a32ae)[_0x46d9('0x28')](handleEntityNotFound(_0x432cf3,null))[_0x46d9('0x28')](respondWithResult(_0x432cf3,null))['catch'](handleError(_0x432cf3,null));};exports[_0x46d9('0x4a')]=function(_0x2907a8,_0x2e6649){return db[_0x46d9('0x42')][_0x46d9('0x4a')](_0x2907a8[_0x46d9('0x4b')],{})['then'](respondWithResult(_0x2e6649,0xc9))[_0x46d9('0x45')](handleError(_0x2e6649,null));};exports[_0x46d9('0x27')]=function(_0x18d78c,_0x58f7e7){if(_0x18d78c[_0x46d9('0x4b')]['id']){delete _0x18d78c['body']['id'];}return db[_0x46d9('0x42')][_0x46d9('0x49')]({'where':{'id':_0x18d78c[_0x46d9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x58f7e7,null))[_0x46d9('0x28')](saveUpdates(_0x18d78c['body'],null))[_0x46d9('0x28')](respondWithResult(_0x58f7e7,null))['catch'](handleError(_0x58f7e7,null));};exports['destroy']=function(_0x616db9,_0x2d16b6){return db[_0x46d9('0x42')]['find']({'where':{'id':_0x616db9[_0x46d9('0x4c')]['id']}})[_0x46d9('0x28')](handleEntityNotFound(_0x2d16b6,null))['then'](removeEntity(_0x2d16b6,null))[_0x46d9('0x45')](handleError(_0x2d16b6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 85b8430..4b9b0ad 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 _0xc951=['event_dtm','event','dtm','util','../../config/logger','api','moment','request-promise','path','exports','define','VoiceQueuesLog','voice_queues_log'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0xc951,0x1a3));var _0x1c95=function(_0xecf3b1,_0x2c19c2){_0xecf3b1=_0xecf3b1-0x0;var _0x438953=_0xc951[_0xecf3b1];return _0x438953;};'use strict';var _=require('lodash');var util=require(_0x1c95('0x0'));var logger=require(_0x1c95('0x1'))(_0x1c95('0x2'));var moment=require(_0x1c95('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c95('0x4'));var fs=require('fs');var path=require(_0x1c95('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x1c95('0x6')]=function(_0x1c2648,_0x4cc66b){return _0x1c2648[_0x1c95('0x7')](_0x1c95('0x8'),attributes,{'tableName':_0x1c95('0x9'),'paranoid':![],'indexes':[{'name':_0x1c95('0xa'),'fields':[_0x1c95('0xb'),_0x1c95('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe87a=['moment','bluebird','request-promise','path','../../config/environment','exports','define','voice_queues_log','event_dtm','util','../../config/logger','api'];(function(_0x35575f,_0x50a456){var _0x2fb75e=function(_0x3d44ac){while(--_0x3d44ac){_0x35575f['push'](_0x35575f['shift']());}};_0x2fb75e(++_0x50a456);}(_0xe87a,0xed));var _0xae87=function(_0x9d7f73,_0x6f5083){_0x9d7f73=_0x9d7f73-0x0;var _0x29bc2b=_0xe87a[_0x9d7f73];return _0x29bc2b;};'use strict';var _=require('lodash');var util=require(_0xae87('0x0'));var logger=require(_0xae87('0x1'))(_0xae87('0x2'));var moment=require(_0xae87('0x3'));var BPromise=require(_0xae87('0x4'));var rp=require(_0xae87('0x5'));var fs=require('fs');var path=require(_0xae87('0x6'));var rimraf=require('rimraf');var config=require(_0xae87('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xae87('0x8')]=function(_0x24023c,_0x5d16be){return _0x24023c[_0xae87('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xae87('0xa'),'paranoid':![],'indexes':[{'name':_0xae87('0xb'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 5e69217..6ede0bd 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 _0x37d7=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x37d7,0x163));var _0x737d=function(_0x3e1415,_0x2ad5ee){_0x3e1415=_0x3e1415-0x0;var _0x2e1ec7=_0x37d7[_0x3e1415];return _0x2e1ec7;};'use strict';var _=require(_0x737d('0x0'));var util=require(_0x737d('0x1'));var moment=require(_0x737d('0x2'));var BPromise=require(_0x737d('0x3'));var rs=require(_0x737d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x737d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x737d('0x6'))(_0x737d('0x7'));var config=require(_0x737d('0x8'));var jayson=require(_0x737d('0x9'));var client=jayson[_0x737d('0xa')][_0x737d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd4b4c4,_0x3ff31e,_0x242602){return new BPromise(function(_0x4fed8c,_0x21baba){return client[_0x737d('0xc')](_0xd4b4c4,_0x242602)['then'](function(_0x399096){logger[_0x737d('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3ff31e,_0x737d('0xe'));logger[_0x737d('0xf')](_0x737d('0x10'),_0x3ff31e,_0x737d('0xe'),JSON[_0x737d('0x11')](_0x399096));if(_0x399096[_0x737d('0x12')]){if(_0x399096['error'][_0x737d('0x13')]===0x1f4){logger[_0x737d('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3ff31e,_0x399096['error'][_0x737d('0x14')]);return _0x21baba(_0x399096[_0x737d('0x12')]['message']);}logger[_0x737d('0x12')](_0x737d('0x15'),_0x3ff31e,_0x399096[_0x737d('0x12')][_0x737d('0x14')]);return _0x4fed8c(_0x399096[_0x737d('0x12')][_0x737d('0x14')]);}else{logger['info'](_0x737d('0x15'),_0x3ff31e,'request\x20sent');_0x4fed8c(_0x399096[_0x737d('0x16')][_0x737d('0x14')]);}})[_0x737d('0x17')](function(_0x55b06c){logger['error'](_0x737d('0x15'),_0x3ff31e,_0x55b06c);_0x21baba(_0x55b06c);});});} \ No newline at end of file +var _0x45c8=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client'];(function(_0x322ee0,_0x2e2f29){var _0x4f519a=function(_0x64d2d2){while(--_0x64d2d2){_0x322ee0['push'](_0x322ee0['shift']());}};_0x4f519a(++_0x2e2f29);}(_0x45c8,0xef));var _0x845c=function(_0xaa4f6,_0x25bd36){_0xaa4f6=_0xaa4f6-0x0;var _0x4e845d=_0x45c8[_0xaa4f6];return _0x4e845d;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index a4f86e5..aa6de77 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 _0x7a7c=['isAuthenticated','/describe','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','/:id/transcribe','/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x7a7c,0x1ab));var _0xc7a7=function(_0x444a8c,_0x4f8c59){_0x444a8c=_0x444a8c-0x0;var _0x18d87b=_0x7a7c[_0x444a8c];return _0x18d87b;};'use strict';var multer=require(_0xc7a7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc7a7('0x1'));var express=require(_0xc7a7('0x2'));var router=express[_0xc7a7('0x3')]();var fs_extra=require(_0xc7a7('0x4'));var auth=require(_0xc7a7('0x5'));var interaction=require(_0xc7a7('0x6'));var config=require(_0xc7a7('0x7'));var controller=require(_0xc7a7('0x8'));router[_0xc7a7('0x9')]('/',auth[_0xc7a7('0xa')](),controller['index']);router[_0xc7a7('0x9')](_0xc7a7('0xb'),auth[_0xc7a7('0xa')](),controller['describe']);router['get']('/:id',auth[_0xc7a7('0xa')](),controller['show']);router['get'](_0xc7a7('0xc'),auth[_0xc7a7('0xa')](),controller[_0xc7a7('0xd')]);router['get'](_0xc7a7('0xe'),controller[_0xc7a7('0xf')]);router[_0xc7a7('0x9')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xc7a7('0x10')]);router[_0xc7a7('0x11')]('/',auth[_0xc7a7('0xa')](),controller['create']);router[_0xc7a7('0x11')](_0xc7a7('0x12'),auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0xc7a7('0x13'),auth[_0xc7a7('0xa')](),controller[_0xc7a7('0x14')]);router[_0xc7a7('0x15')]('/:id',auth[_0xc7a7('0xa')](),controller[_0xc7a7('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6c70=['update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put'];(function(_0x3a5d13,_0x42ed18){var _0x1f1f46=function(_0x55e9c5){while(--_0x55e9c5){_0x3a5d13['push'](_0x3a5d13['shift']());}};_0x1f1f46(++_0x42ed18);}(_0x6c70,0x130));var _0x06c7=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x6c70[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x06c7('0x0'));var util=require('util');var path=require(_0x06c7('0x1'));var timeout=require('connect-timeout');var express=require(_0x06c7('0x2'));var router=express['Router']();var fs_extra=require(_0x06c7('0x3'));var auth=require(_0x06c7('0x4'));var interaction=require(_0x06c7('0x5'));var config=require(_0x06c7('0x6'));var controller=require(_0x06c7('0x7'));router[_0x06c7('0x8')]('/',auth[_0x06c7('0x9')](),controller['index']);router['get'](_0x06c7('0xa'),auth['isAuthenticated'](),controller[_0x06c7('0xb')]);router[_0x06c7('0x8')](_0x06c7('0xc'),auth[_0x06c7('0x9')](),controller[_0x06c7('0xd')]);router['get'](_0x06c7('0xe'),auth[_0x06c7('0x9')](),controller['download']);router[_0x06c7('0x8')](_0x06c7('0xf'),controller['downloads']);router[_0x06c7('0x8')](_0x06c7('0x10'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x11')]);router['post']('/',auth[_0x06c7('0x9')](),controller[_0x06c7('0x12')]);router['post'](_0x06c7('0x10'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x13')]);router[_0x06c7('0x14')](_0x06c7('0xc'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x15')]);router[_0x06c7('0x16')]('/:id',auth[_0x06c7('0x9')](),controller[_0x06c7('0x17')]);module[_0x06c7('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 6d51b2d..df41604 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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 03ed3ed..af19ca1 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 _0x635e=['fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','VoiceRecording','fieldName','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','length','create','body','find','describe','download','../../components/encryptor','format','existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','uniqueid','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','tempSentiment','updateAttributes','downloadTranscribe'];(function(_0x23a0b6,_0x1625ed){var _0x276250=function(_0x5bfd35){while(--_0x5bfd35){_0x23a0b6['push'](_0x23a0b6['shift']());}};_0x276250(++_0x1625ed);}(_0x635e,0x1d0));var _0xe635=function(_0x5af931,_0x185ad6){_0x5af931=_0x5af931-0x0;var _0x1e4c16=_0x635e[_0x5af931];return _0x1e4c16;};'use strict';var emlformat=require(_0xe635('0x0'));var rimraf=require(_0xe635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe635('0x2'));var rp=require(_0xe635('0x3'));var moment=require(_0xe635('0x4'));var BPromise=require(_0xe635('0x5'));var Mustache=require(_0xe635('0x6'));var util=require(_0xe635('0x7'));var path=require('path');var sox=require(_0xe635('0x8'));var csv=require(_0xe635('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe635('0xa'));var _=require('lodash');var squel=require(_0xe635('0xb'));var crypto=require('crypto');var jsforce=require(_0xe635('0xc'));var deskjs=require(_0xe635('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0xe635('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0xe635('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe635('0x10'));var as=require(_0xe635('0x11'));var hardwareService=require(_0xe635('0x12'));var logger=require(_0xe635('0x13'))(_0xe635('0x14'));var utils=require(_0xe635('0x15'));var config=require(_0xe635('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2accf1,_0x3a2f10){_0x3a2f10=_0x3a2f10||0xcc;return function(_0x45f57e){if(_0x45f57e){return _0x2accf1['sendStatus'](_0x3a2f10);}return _0x2accf1[_0xe635('0x17')](_0x3a2f10)[_0xe635('0x18')]();};}function respondWithResult(_0x4ea34b,_0x21b7e8){_0x21b7e8=_0x21b7e8||0xc8;return function(_0x5cc83e){if(_0x5cc83e){return _0x4ea34b['status'](_0x21b7e8)[_0xe635('0x19')](_0x5cc83e);}};}function respondWithFilteredResult(_0x78b122,_0x17c9fe){return function(_0xfb48d){if(_0xfb48d){var _0x5ed789=typeof _0x17c9fe[_0xe635('0x1a')]===_0xe635('0x1b')&&typeof _0x17c9fe['limit']==='undefined';var _0x25c581=_0xfb48d['count'];var _0x20d16d=_0x5ed789?0x0:_0x17c9fe[_0xe635('0x1a')];var _0x2df2c7=_0x5ed789?_0xfb48d[_0xe635('0x1c')]:_0x17c9fe['offset']+_0x17c9fe['limit'];var _0x2f2d28;if(_0x2df2c7>=_0x25c581){_0x2df2c7=_0x25c581;_0x2f2d28=0xc8;}else{_0x2f2d28=0xce;}_0x78b122['status'](_0x2f2d28);return _0x78b122['set'](_0xe635('0x1d'),_0x20d16d+'-'+_0x2df2c7+'/'+_0x25c581)['json'](_0xfb48d);}return null;};}function patchUpdates(_0x500a85){return function(_0x322210){try{jsonpatch[_0xe635('0x1e')](_0x322210,_0x500a85,!![]);}catch(_0x26cb71){return BPromise[_0xe635('0x1f')](_0x26cb71);}return _0x322210[_0xe635('0x20')]();};}function saveUpdates(_0x12899d,_0x4add30){return function(_0x46df97){if(_0x46df97){return _0x46df97['update'](_0x12899d)['then'](function(_0x3a84f5){return _0x3a84f5;});}return null;};}function removeEntity(_0x307b92,_0x47e9d7){return function(_0x49327a){if(_0x49327a){return _0x49327a[_0xe635('0x21')]()[_0xe635('0x22')](function(){_0x307b92['status'](0xcc)[_0xe635('0x18')]();});}};}function handleEntityNotFound(_0x1e41c3,_0x1a914b){return function(_0x4a841b){if(!_0x4a841b){_0x1e41c3[_0xe635('0x23')](0x194);}return _0x4a841b;};}function handleError(_0xe2608e,_0x53e34d){_0x53e34d=_0x53e34d||0x1f4;return function(_0x2a713d){logger[_0xe635('0x24')](_0x2a713d[_0xe635('0x25')]);if(_0x2a713d[_0xe635('0x26')]){delete _0x2a713d[_0xe635('0x26')];}_0xe2608e[_0xe635('0x17')](_0x53e34d)[_0xe635('0x27')](_0x2a713d);};}exports['index']=function(_0x176671,_0x537036){var _0x1e8313={},_0x377d74={},_0x562045={'count':0x0,'rows':[]};var _0x1f1e7a=_[_0xe635('0x28')](db[_0xe635('0x29')]['rawAttributes'],function(_0x44e8c9){return{'name':_0x44e8c9[_0xe635('0x2a')],'type':_0x44e8c9['type'][_0xe635('0x2b')]};});_0x377d74['model']=_[_0xe635('0x2c')](_['map'](_0x1f1e7a,'name'),['format']);_0x377d74['query']=_[_0xe635('0x2d')](_0x176671[_0xe635('0x2e')]);_0x377d74[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x377d74[_0xe635('0x31')],_0x377d74[_0xe635('0x2e')]);_0x1e8313['attributes']=_[_0xe635('0x30')](_0x377d74['model'],qs[_0xe635('0x32')](_0x176671['query'][_0xe635('0x32')]));_0x1e8313[_0xe635('0x33')]=_0x1e8313['attributes']['length']?_0x1e8313[_0xe635('0x33')]:_0x377d74[_0xe635('0x31')];if(!_0x176671['query'][_0xe635('0x34')](_0xe635('0x35'))){_0x1e8313[_0xe635('0x36')]=qs[_0xe635('0x36')](_0x176671[_0xe635('0x2e')][_0xe635('0x36')]);_0x1e8313['offset']=qs['offset'](_0x176671[_0xe635('0x2e')]['offset']);}_0x1e8313[_0xe635('0x37')]=qs[_0xe635('0x38')](_0x176671['query'][_0xe635('0x38')]);_0x1e8313[_0xe635('0x39')]=qs['filters'](_[_0xe635('0x3a')](_0x176671[_0xe635('0x2e')],_0x377d74[_0xe635('0x2f')]),_0x1f1e7a);if(_0x176671[_0xe635('0x2e')][_0xe635('0x3b')]){_0x1e8313[_0xe635('0x39')]=_[_0xe635('0x3c')](_0x1e8313['where'],{'$or':_[_0xe635('0x28')](_0x1f1e7a,function(_0x29009f){if(_0x29009f[_0xe635('0x3d')]!==_0xe635('0x3e')){var _0x1d9ae9={};_0x1d9ae9[_0x29009f[_0xe635('0x26')]]={'$like':'%'+_0x176671['query'][_0xe635('0x3b')]+'%'};return _0x1d9ae9;}})});}_0x1e8313=_['merge']({},_0x1e8313,_0x176671[_0xe635('0x3f')]);var _0x452d57={'where':_0x1e8313[_0xe635('0x39')]};return db[_0xe635('0x29')][_0xe635('0x1c')](_0x452d57)[_0xe635('0x22')](function(_0x240184){_0x562045['count']=_0x240184;if(_0x176671[_0xe635('0x2e')][_0xe635('0x40')]){_0x1e8313[_0xe635('0x41')]=[{'all':!![]}];}return db[_0xe635('0x29')][_0xe635('0x42')](_0x1e8313);})['then'](function(_0x3d1e1e){_0x562045['rows']=_0x3d1e1e;return _0x562045;})[_0xe635('0x22')](respondWithFilteredResult(_0x537036,_0x1e8313))[_0xe635('0x43')](handleError(_0x537036,null));};exports['show']=function(_0x2f285d,_0x1381cd){var _0x2f2d41={'raw':![],'where':{'id':_0x2f285d[_0xe635('0x44')]['id']}},_0x45e38a={};_0x45e38a[_0xe635('0x31')]=_[_0xe635('0x2d')](db['VoiceRecording'][_0xe635('0x45')]);_0x45e38a[_0xe635('0x2e')]=_[_0xe635('0x2d')](_0x2f285d[_0xe635('0x2e')]);_0x45e38a[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x45e38a[_0xe635('0x31')],_0x45e38a[_0xe635('0x2e')]);_0x2f2d41[_0xe635('0x33')]=_['intersection'](_0x45e38a[_0xe635('0x31')],qs[_0xe635('0x32')](_0x2f285d[_0xe635('0x2e')][_0xe635('0x32')]));_0x2f2d41[_0xe635('0x33')]=_0x2f2d41[_0xe635('0x33')][_0xe635('0x46')]?_0x2f2d41[_0xe635('0x33')]:_0x45e38a[_0xe635('0x31')];if(_0x2f285d[_0xe635('0x2e')][_0xe635('0x40')]){_0x2f2d41['include']=[{'all':!![]}];}_0x2f2d41=_[_0xe635('0x3c')]({},_0x2f2d41,_0x2f285d['options']);return db[_0xe635('0x29')]['find'](_0x2f2d41)[_0xe635('0x22')](handleEntityNotFound(_0x1381cd,null))[_0xe635('0x22')](respondWithResult(_0x1381cd,null))['catch'](handleError(_0x1381cd,null));};exports[_0xe635('0x47')]=function(_0x52bfd6,_0x3b4234){return db[_0xe635('0x29')][_0xe635('0x47')](_0x52bfd6[_0xe635('0x48')],{})[_0xe635('0x22')](respondWithResult(_0x3b4234,0xc9))[_0xe635('0x43')](handleError(_0x3b4234,null));};exports['update']=function(_0x361db4,_0x3debe3){if(_0x361db4[_0xe635('0x48')]['id']){delete _0x361db4[_0xe635('0x48')]['id'];}return db[_0xe635('0x29')][_0xe635('0x49')]({'where':{'id':_0x361db4[_0xe635('0x44')]['id']}})[_0xe635('0x22')](handleEntityNotFound(_0x3debe3,null))[_0xe635('0x22')](saveUpdates(_0x361db4[_0xe635('0x48')],null))['then'](respondWithResult(_0x3debe3,null))[_0xe635('0x43')](handleError(_0x3debe3,null));};exports['describe']=function(_0x4c28ed,_0x3b6d59){return db[_0xe635('0x29')][_0xe635('0x4a')]()[_0xe635('0x22')](respondWithResult(_0x3b6d59,null))[_0xe635('0x43')](handleError(_0x3b6d59,null));};exports[_0xe635('0x4b')]=function(_0x31dba0,_0x2d7785,_0x320845){var _0xd69a61=require(_0xe635('0x4c'));var _0x6bbab8=![];var _0x4415e4={};if(_0x31dba0[_0xe635('0x2e')][_0xe635('0x3d')]&&_0x31dba0[_0xe635('0x2e')][_0xe635('0x3d')]==='uniqueid'){_0x4415e4['uniqueid']=_0x31dba0[_0xe635('0x44')]['id'];}else{_0x4415e4['id']=_0x31dba0['params']['id'];}return db[_0xe635('0x29')][_0xe635('0x49')]({'where':_0x4415e4,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2d7785,null))[_0xe635('0x22')](function(_0x55229f){if(_0x55229f){var _0x368e4b=_0x55229f['value'];var _0x1e141c=util[_0xe635('0x4d')]('%s.cypher',_0x368e4b);if(fs[_0xe635('0x4e')](_0x1e141c)){_0x6bbab8=!![];return _0xd69a61[_0xe635('0x4f')](_0x1e141c,_0x368e4b,config[_0xe635('0x50')][_0xe635('0x51')])[_0xe635('0x22')](function(){return _0x55229f;});}return _0x55229f;}})['then'](function(_0x3e657a){if(_0x3e657a){var _0x1d6b81=_0x3e657a[_0xe635('0x52')];if(!fs[_0xe635('0x4e')](_0x1d6b81)){throw new db[(_0xe635('0x53'))][(_0xe635('0x54'))](_0xe635('0x55'));}if(_0x3e657a[_0xe635('0x56')]){return _0x2d7785[_0xe635('0x4b')](_0x1d6b81,_0x3e657a['filename']+path[_0xe635('0x57')](_0x1d6b81),function(){if(_0x6bbab8){fs[_0xe635('0x58')](_0x1d6b81);}});}else{return _0x2d7785[_0xe635('0x4b')](_0x1d6b81,function(_0x58bc72){if(_0x6bbab8){fs['unlink'](_0x1d6b81);}});}}})[_0xe635('0x43')](function(_0x4b2b2c){if(_0x4b2b2c[_0xe635('0x59')]===_0xe635('0x55')){_0x2d7785['status'](0x194)[_0xe635('0x27')](_0xe635('0x5a'));}else{return handleError(_0x2d7785,null);}});};exports[_0xe635('0x5b')]=function(_0x4bae3b,_0xae5ba6,_0x1e653f){var _0x1a2ac7=require('../../components/encryptor');var _0x55fb2d=![];var _0x1bf1ee={'$and':[db['sequelize'][_0xe635('0x39')](db[_0xe635('0x5c')]['fn'](_0xe635('0x5d'),db[_0xe635('0x5c')][_0xe635('0x5e')](_0xe635('0x5f'))),_0x4bae3b[_0xe635('0x2e')][_0xe635('0x60')])]};if(_0x4bae3b['query'][_0xe635('0x3d')]&&_0x4bae3b['query'][_0xe635('0x3d')]===_0xe635('0x5f')){_0x1bf1ee[_0xe635('0x61')][_0xe635('0x62')]({'uniqueid':_0x4bae3b[_0xe635('0x44')]['id']});}else{_0x1bf1ee['$and']['push']({'id':_0x4bae3b[_0xe635('0x44')]['id']});}return db[_0xe635('0x29')]['find']({'where':_0x1bf1ee,'attributes':['id',_0xe635('0x52')],'raw':!![]})[_0xe635('0x22')](handleEntityNotFound(_0xae5ba6,null))['then'](function(_0x4a5814){if(_0x4a5814){var _0x1c300e=util[_0xe635('0x4d')]('%s.cypher',_0x4a5814['value']);if(fs[_0xe635('0x4e')](_0x1c300e)){_0x55fb2d=!![];return _0x1a2ac7[_0xe635('0x4f')](_0x1c300e,_0x4a5814[_0xe635('0x52')],config[_0xe635('0x50')][_0xe635('0x51')])[_0xe635('0x22')](function(){return _0x4a5814;});}return _0x4a5814;}})[_0xe635('0x22')](function(_0x112448){if(_0x112448){if(!fs['existsSync'](_0x112448['value'])){throw new db['Sequelize'][(_0xe635('0x54'))](_0xe635('0x55'));}if(_0x112448[_0xe635('0x56')]){return _0xae5ba6['download'](_0x112448[_0xe635('0x52')],_0x112448[_0xe635('0x56')]+path[_0xe635('0x57')](_0x112448[_0xe635('0x52')]),function(){if(_0x55fb2d){fs['unlink'](_0x112448[_0xe635('0x52')]);}});}else{return _0xae5ba6[_0xe635('0x4b')](_0x112448[_0xe635('0x52')],function(_0x262ca8){if(_0x55fb2d){fs[_0xe635('0x58')](_0x112448[_0xe635('0x52')]);}});}}})[_0xe635('0x43')](handleError(_0xae5ba6,null));};exports[_0xe635('0x21')]=function(_0x29f42c,_0x5ac2c6){return db[_0xe635('0x29')]['find']({'where':{'id':_0x29f42c[_0xe635('0x44')]['id']}})['then'](function(_0x3c60a9){if(_[_0xe635('0x63')](_0x3c60a9)){throw new ReferenceError(_0xe635('0x64'));}return _0x3c60a9;})[_0xe635('0x22')](function(_0x38018b){var _0x78d303=_0x38018b[_0xe635('0x52')];logger[_0xe635('0x65')](_0xe635('0x66'),_0x78d303);if(!_['isNil'](_0x38018b[_0xe635('0x52')])&&fs['existsSync'](_0x78d303)){logger[_0xe635('0x65')]('File:\x20\x22'+_0x78d303+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe635('0x67')](_0x78d303);}_0x78d303=_0x78d303+'.cypher';if(!_['isNil'](_0x38018b[_0xe635('0x52')])&&fs[_0xe635('0x4e')](_0x78d303)){logger[_0xe635('0x65')](_0xe635('0x68')+_0x78d303+_0xe635('0x69'));fs[_0xe635('0x67')](_0x78d303);}return _0x38018b;})[_0xe635('0x22')](function(_0x218cef){if(!_0x218cef)throw new InternalError();return _0x218cef['destroy']();})[_0xe635('0x22')](function(){_0x5ac2c6['status'](0xcc)[_0xe635('0x18')]();})['catch'](handleError(_0x5ac2c6,null));};function getBucketslist(_0xfeae0f,_0x116bcf,_0x4f321d){return new Promise(function(_0x27e225,_0x2390c0){var _0xb1100c=new AWS['S3']({'accessKeyId':_0x116bcf,'secretAccessKey':_0xfeae0f,'region':_0x4f321d});_0xb1100c[_0xe635('0x6a')]({},function(_0x536c7a,_0x2bfaf1){if(_0x536c7a){return _0x2390c0(_0x536c7a);}else{return _0x27e225(_0x2bfaf1);}});});}function createBucket(_0x104993,_0x4f75aa,_0x2f54c4,_0x51c5b4){return new Promise(function(_0x1ecf0d,_0x583e9e){var _0xbbd6af=new AWS['S3']({'accessKeyId':_0x4f75aa,'secretAccessKey':_0x104993,'region':_0x2f54c4});_0xbbd6af['createBucket']({'Bucket':_0x51c5b4},function(_0x8b33bb,_0x518fad){if(_0x8b33bb){return _0x583e9e(_0x8b33bb);}else{return _0x1ecf0d(_0x518fad);}});});}function uploadFile(_0x4232b3,_0x3b78c5,_0x40749a,_0x84ea1,_0x56a32d,_0x3acbe9){return new Promise(function(_0x14cd67,_0x279e19){var _0x2568e8=new AWS['S3']({'accessKeyId':_0x3b78c5,'secretAccessKey':_0x4232b3,'region':_0x40749a});_0x2568e8['upload']({'Bucket':_0x84ea1,'Key':_0x56a32d,'Body':_0x3acbe9},function(_0x2ab2d6,_0x339cd3){if(_0x2ab2d6){return _0x279e19(_0x2ab2d6);}else{return _0x14cd67(_0x339cd3);}});});}function startTranscribe(_0x114353,_0x197cf7,_0x4c718a,_0x4d2823,_0x4d51cc,_0x4b6b1a){return new Promise(function(_0x2f3fc3,_0x5a2489){var _0x51967d=new AWS[(_0xe635('0x6b'))]({'accessKeyId':_0x197cf7,'secretAccessKey':_0x114353,'region':_0x4c718a});_0x51967d[_0xe635('0x6c')]({'TranscriptionJobName':_0x4d2823,'LanguageCode':_0x4d51cc,'Media':{'MediaFileUri':_0x4b6b1a}},function(_0x3d82a6,_0x1dd09){if(_0x3d82a6){return _0x5a2489(_0x3d82a6);}else{return _0x2f3fc3(_0x1dd09);}});});}function transcribe(_0x3b4a1f,_0x5561d3,_0x2011ea,_0x168a02,_0x33dca3,_0x54561d,_0xae8b2){return new Promise(function(_0xbc198b,_0x515e12){var _0x1cb3d6={};logger[_0xe635('0x65')](util[_0xe635('0x4d')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x3b4a1f,_0x33dca3));return uploadFile(_0x5561d3,_0x2011ea,_0x168a02,_0x33dca3,path[_0xe635('0x6d')](_0x54561d),fs['readFileSync'](_0x54561d))[_0xe635('0x22')](function(_0x557c24){logger[_0xe635('0x65')](util['format'](_0xe635('0x6e'),_0x3b4a1f,_0x33dca3,_0x557c24[_0xe635('0x6f')]));_0x1cb3d6['bucket']=_0x557c24[_0xe635('0x70')];_0x1cb3d6[_0xe635('0x71')]=_0x557c24[_0xe635('0x6f')];logger['info'](util['format'](_0xe635('0x72'),_0x3b4a1f));return startTranscribe(_0x5561d3,_0x2011ea,_0x168a02,uuidv4(),_0xae8b2,_0x557c24[_0xe635('0x6f')]);})[_0xe635('0x22')](function(_0x169711){logger[_0xe635('0x65')](util[_0xe635('0x4d')](_0xe635('0x73'),_0x3b4a1f,_0x169711[_0xe635('0x74')][_0xe635('0x75')]));_0x1cb3d6['transcribeName']=_0x169711[_0xe635('0x74')][_0xe635('0x75')];_0x1cb3d6[_0xe635('0x76')]=_0x169711['TranscriptionJob'][_0xe635('0x77')];return _0xbc198b(_0x1cb3d6);})[_0xe635('0x43')](function(_0x2ec907){return _0x515e12(_0x2ec907);});});}exports[_0xe635('0x78')]=function(_0x5f4788,_0x3b6262,_0x4f2f2f){var _0x4dc04f;var _0x4d99b3;var _0x2090a3;var _0x1be26c=require(_0xe635('0x4c'));return db['VoiceRecording'][_0xe635('0x79')]({'where':{'id':_0x5f4788['params']['id']}})[_0xe635('0x22')](function(_0xc464ef){if(_0xc464ef){var _0x2ca34b=util[_0xe635('0x4d')](_0xe635('0x7a'),_0xc464ef[_0xe635('0x52')]);if(fs['existsSync'](_0x2ca34b)){cypher=!![];return _0x1be26c['decryptFile'](_0x2ca34b,_0xc464ef[_0xe635('0x52')],config['secrets']['recording'])[_0xe635('0x22')](function(){return _0xc464ef;});}return _0xc464ef;}})[_0xe635('0x22')](function(_0x31f617){if(!_0x31f617){throw new db['Sequelize'][(_0xe635('0x54'))](_0xe635('0x7b'));}_0x4d99b3=_0x31f617;return db[_0xe635('0x7c')][_0xe635('0x79')]({'where':{'id':0x1}});})[_0xe635('0x22')](handleEntityNotFound(_0x3b6262,null))[_0xe635('0x22')](function(_0x8c9557){if(_0x8c9557){_0x4dc04f=_0x8c9557;if(!_0x4dc04f[_0xe635('0x7d')]||!_0x4dc04f[_0xe635('0x7e')]||!_0x4dc04f['transcribeRegion']||!_0x4dc04f[_0xe635('0x7f')]||!_0x4dc04f[_0xe635('0x80')]){throw new db[(_0xe635('0x53'))][(_0xe635('0x54'))](_0xe635('0x81'));}if(_0x5f4788[_0xe635('0x48')][_0xe635('0x82')]&&(!_0x4dc04f[_0xe635('0x83')]||!_0x4dc04f[_0xe635('0x84')]||!_0x4dc04f[_0xe635('0x85')]||!_0x4dc04f[_0xe635('0x7f')]||!_0x4dc04f['bucket'])){throw new db[(_0xe635('0x53'))][(_0xe635('0x54'))](_0xe635('0x86'));}return db[_0xe635('0x87')][_0xe635('0x79')]({'where':{'id':_0x4dc04f['transcribeAccountId']}});}})['then'](function(_0x196dcf){if(!_0x196dcf){throw new db[(_0xe635('0x53'))]['ValidationError'](_0xe635('0x88'));}if(!_0x196dcf[_0xe635('0x89')]||!_0x196dcf[_0xe635('0x8a')]){throw new db['Sequelize']['ValidationError'](_0xe635('0x8b'));}_0x2090a3=_0x196dcf;return getBucketslist(_0x2090a3[_0xe635('0x89')],_0x2090a3[_0xe635('0x8a')],_0x4dc04f[_0xe635('0x8c')]);})['then'](function(_0x167358){if(_0x167358&&_0x167358[_0xe635('0x8d')]){var _0x263d2c=_[_0xe635('0x49')](_0x167358['Buckets'],function(_0x264e32){return _0x264e32[_0xe635('0x8e')]===_0x4dc04f[_0xe635('0x80')];});if(!_0x263d2c){logger[_0xe635('0x65')](util[_0xe635('0x4d')](_0xe635('0x8f'),_0x5f4788[_0xe635('0x44')]['id'],_0x4dc04f['bucket']));return createBucket(_0x2090a3[_0xe635('0x89')],_0x2090a3[_0xe635('0x8a')],_0x4dc04f['transcribeRegion'],_0x4dc04f[_0xe635('0x80')]);}logger['info'](util[_0xe635('0x4d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x5f4788[_0xe635('0x44')]['id'],_0x4dc04f[_0xe635('0x80')]));return;}})[_0xe635('0x22')](function(_0xc0c6b0){if(_0x4d99b3['transcribeStatus']===_0xe635('0x90')){return transcribe(_0x5f4788[_0xe635('0x44')]['id'],_0x2090a3[_0xe635('0x89')],_0x2090a3[_0xe635('0x8a')],_0x4dc04f[_0xe635('0x8c')],_0x4dc04f[_0xe635('0x80')],_0x4d99b3[_0xe635('0x52')],_0x4dc04f[_0xe635('0x7f')]);}else{logger[_0xe635('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5f4788[_0xe635('0x44')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x424f7b){if(_0x424f7b){_0x424f7b[_0xe635('0x91')]=_0x5f4788['body'][_0xe635('0x82')];return _0x4d99b3[_0xe635('0x92')](_0x424f7b);}})['then'](respondWithResult(_0x3b6262,null))[_0xe635('0x43')](handleError(_0x3b6262,null));};function writeFile(_0x29cbc5,_0x10e0d9){return new Promise(function(_0x30aa8e,_0x337d32){fs['writeFile'](_0x10e0d9,_0x29cbc5,function(_0x3d28c8,_0xa207b5){if(_0x3d28c8){return _0x337d32(_0x3d28c8);}else{return _0x30aa8e(_0xa207b5);}});});}exports[_0xe635('0x93')]=function(_0x570b42,_0x3be0b0,_0x422627){return db['VoiceRecording'][_0xe635('0x79')]({'where':{'id':_0x570b42[_0xe635('0x44')]['id']}})[_0xe635('0x22')](handleEntityNotFound(_0x3be0b0))['then'](function(_0x4466d4){if(_0x4466d4&&_0x4466d4[_0xe635('0x94')]){var _0x1608db=_0x4466d4['fileText'];var _0x4ef2cd=config[_0xe635('0x95')]+_0xe635('0x96')+_0x4466d4['id']+_0xe635('0x97');if(fs[_0xe635('0x4e')](_0x4ef2cd)){return _0x4ef2cd;}return writeFile(_0x1608db,_0x4ef2cd)[_0xe635('0x22')](function(){return _0x4ef2cd;});}else{throw new db[(_0xe635('0x53'))][(_0xe635('0x54'))](_0xe635('0x98'));}})['then'](function(_0x427535){return _0x3be0b0[_0xe635('0x4b')](_0x427535);})[_0xe635('0x43')](handleError(_0x3be0b0));}; \ No newline at end of file +var _0x9218=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','name','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','findAll','rows','show','params','length','include','find','create','body','catch','describe','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','download','filename','extname','unlink','Not\x20found','downloads','../../components/encryptor','sequelize','token','$and','push','decryptFile','VoiceRecording\x20not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','createBucket','upload','TranscribeService','startTranscriptionJob','basename','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','fast-json-patch'];(function(_0x5bf18d,_0x264c55){var _0x1d6cc0=function(_0x2d69d9){while(--_0x2d69d9){_0x5bf18d['push'](_0x5bf18d['shift']());}};_0x1d6cc0(++_0x264c55);}(_0x9218,0x127));var _0x8921=function(_0x179e93,_0x56de7b){_0x179e93=_0x179e93-0x0;var _0x54464c=_0x9218[_0x179e93];return _0x54464c;};'use strict';var emlformat=require(_0x8921('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8921('0x1'));var jsonpatch=require(_0x8921('0x2'));var rp=require(_0x8921('0x3'));var moment=require(_0x8921('0x4'));var BPromise=require(_0x8921('0x5'));var Mustache=require(_0x8921('0x6'));var util=require(_0x8921('0x7'));var path=require(_0x8921('0x8'));var sox=require('sox');var csv=require(_0x8921('0x9'));var ejs=require(_0x8921('0xa'));var fs=require('fs');var fs_extra=require(_0x8921('0xb'));var _=require('lodash');var squel=require(_0x8921('0xc'));var crypto=require('crypto');var jsforce=require(_0x8921('0xd'));var deskjs=require(_0x8921('0xe'));var toCsv=require(_0x8921('0x9'));var querystring=require(_0x8921('0xf'));var Papa=require(_0x8921('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0x8921('0x11'));var Redis=require(_0x8921('0x12'));var authService=require(_0x8921('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8921('0x14'));var hardwareService=require(_0x8921('0x15'));var logger=require(_0x8921('0x16'))(_0x8921('0x17'));var utils=require(_0x8921('0x18'));var config=require(_0x8921('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8921('0x1a'))['db'];function respondWithStatusCode(_0x34f13b,_0x408d12){_0x408d12=_0x408d12||0xcc;return function(_0x4daf2a){if(_0x4daf2a){return _0x34f13b[_0x8921('0x1b')](_0x408d12);}return _0x34f13b[_0x8921('0x1c')](_0x408d12)['end']();};}function respondWithResult(_0x3f4525,_0x1fc31b){_0x1fc31b=_0x1fc31b||0xc8;return function(_0x1cb556){if(_0x1cb556){return _0x3f4525[_0x8921('0x1c')](_0x1fc31b)[_0x8921('0x1d')](_0x1cb556);}};}function respondWithFilteredResult(_0x4c1bd3,_0x4f3a84){return function(_0x36b09f){if(_0x36b09f){var _0x19beb0=typeof _0x4f3a84[_0x8921('0x1e')]===_0x8921('0x1f')&&typeof _0x4f3a84[_0x8921('0x20')]==='undefined';var _0x3ddbf0=_0x36b09f[_0x8921('0x21')];var _0xfd18eb=_0x19beb0?0x0:_0x4f3a84[_0x8921('0x1e')];var _0xf07eb1=_0x19beb0?_0x36b09f[_0x8921('0x21')]:_0x4f3a84[_0x8921('0x1e')]+_0x4f3a84[_0x8921('0x20')];var _0x3f9fbd;if(_0xf07eb1>=_0x3ddbf0){_0xf07eb1=_0x3ddbf0;_0x3f9fbd=0xc8;}else{_0x3f9fbd=0xce;}_0x4c1bd3[_0x8921('0x1c')](_0x3f9fbd);return _0x4c1bd3[_0x8921('0x22')](_0x8921('0x23'),_0xfd18eb+'-'+_0xf07eb1+'/'+_0x3ddbf0)[_0x8921('0x1d')](_0x36b09f);}return null;};}function patchUpdates(_0x3f2774){return function(_0x3605a4){try{jsonpatch[_0x8921('0x24')](_0x3605a4,_0x3f2774,!![]);}catch(_0x50cfce){return BPromise[_0x8921('0x25')](_0x50cfce);}return _0x3605a4[_0x8921('0x26')]();};}function saveUpdates(_0x3ae859,_0x1494cf){return function(_0x5332f9){if(_0x5332f9){return _0x5332f9['update'](_0x3ae859)[_0x8921('0x27')](function(_0x32b6f3){return _0x32b6f3;});}return null;};}function removeEntity(_0x23e51c,_0x1b8fed){return function(_0x452285){if(_0x452285){return _0x452285[_0x8921('0x28')]()[_0x8921('0x27')](function(){_0x23e51c[_0x8921('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271af9,_0x33ffc6){return function(_0x6b7e85){if(!_0x6b7e85){_0x271af9[_0x8921('0x1b')](0x194);}return _0x6b7e85;};}function handleError(_0x2c17bc,_0x30f949){_0x30f949=_0x30f949||0x1f4;return function(_0x23383f){logger[_0x8921('0x29')](_0x23383f[_0x8921('0x2a')]);if(_0x23383f['name']){delete _0x23383f['name'];}_0x2c17bc[_0x8921('0x1c')](_0x30f949)[_0x8921('0x2b')](_0x23383f);};}exports[_0x8921('0x2c')]=function(_0x1464f5,_0x191165){var _0x2e4e5b={},_0x25274c={},_0x1b911e={'count':0x0,'rows':[]};var _0x41e15e=_[_0x8921('0x2d')](db[_0x8921('0x2e')][_0x8921('0x2f')],function(_0x891569){return{'name':_0x891569[_0x8921('0x30')],'type':_0x891569[_0x8921('0x31')]['key']};});_0x25274c[_0x8921('0x32')]=_['differenceBy'](_['map'](_0x41e15e,_0x8921('0x33')),['format']);_0x25274c['query']=_[_0x8921('0x34')](_0x1464f5['query']);_0x25274c['filters']=_['intersection'](_0x25274c[_0x8921('0x32')],_0x25274c[_0x8921('0x35')]);_0x2e4e5b[_0x8921('0x36')]=_[_0x8921('0x37')](_0x25274c['model'],qs[_0x8921('0x38')](_0x1464f5[_0x8921('0x35')]['fields']));_0x2e4e5b[_0x8921('0x36')]=_0x2e4e5b[_0x8921('0x36')]['length']?_0x2e4e5b[_0x8921('0x36')]:_0x25274c[_0x8921('0x32')];if(!_0x1464f5[_0x8921('0x35')][_0x8921('0x39')](_0x8921('0x3a'))){_0x2e4e5b[_0x8921('0x20')]=qs[_0x8921('0x20')](_0x1464f5['query']['limit']);_0x2e4e5b['offset']=qs[_0x8921('0x1e')](_0x1464f5[_0x8921('0x35')][_0x8921('0x1e')]);}_0x2e4e5b[_0x8921('0x3b')]=qs[_0x8921('0x3c')](_0x1464f5[_0x8921('0x35')][_0x8921('0x3c')]);_0x2e4e5b[_0x8921('0x3d')]=qs['filters'](_[_0x8921('0x3e')](_0x1464f5[_0x8921('0x35')],_0x25274c[_0x8921('0x3f')]),_0x41e15e);if(_0x1464f5[_0x8921('0x35')][_0x8921('0x40')]){_0x2e4e5b[_0x8921('0x3d')]=_['merge'](_0x2e4e5b[_0x8921('0x3d')],{'$or':_[_0x8921('0x2d')](_0x41e15e,function(_0x4b183a){if(_0x4b183a[_0x8921('0x31')]!==_0x8921('0x41')){var _0x2088e0={};_0x2088e0[_0x4b183a['name']]={'$like':'%'+_0x1464f5['query']['filter']+'%'};return _0x2088e0;}})});}_0x2e4e5b=_['merge']({},_0x2e4e5b,_0x1464f5['options']);var _0x27fd7a={'where':_0x2e4e5b[_0x8921('0x3d')]};return db[_0x8921('0x2e')][_0x8921('0x21')](_0x27fd7a)['then'](function(_0x2c7790){_0x1b911e['count']=_0x2c7790;if(_0x1464f5[_0x8921('0x35')][_0x8921('0x42')]){_0x2e4e5b['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x8921('0x43')](_0x2e4e5b);})[_0x8921('0x27')](function(_0x3442b0){_0x1b911e[_0x8921('0x44')]=_0x3442b0;return _0x1b911e;})['then'](respondWithFilteredResult(_0x191165,_0x2e4e5b))['catch'](handleError(_0x191165,null));};exports[_0x8921('0x45')]=function(_0x136c49,_0x535895){var _0x437c14={'raw':![],'where':{'id':_0x136c49[_0x8921('0x46')]['id']}},_0x499b57={};_0x499b57[_0x8921('0x32')]=_['keys'](db[_0x8921('0x2e')]['rawAttributes']);_0x499b57[_0x8921('0x35')]=_[_0x8921('0x34')](_0x136c49[_0x8921('0x35')]);_0x499b57[_0x8921('0x3f')]=_[_0x8921('0x37')](_0x499b57[_0x8921('0x32')],_0x499b57[_0x8921('0x35')]);_0x437c14[_0x8921('0x36')]=_[_0x8921('0x37')](_0x499b57[_0x8921('0x32')],qs[_0x8921('0x38')](_0x136c49[_0x8921('0x35')][_0x8921('0x38')]));_0x437c14[_0x8921('0x36')]=_0x437c14[_0x8921('0x36')][_0x8921('0x47')]?_0x437c14['attributes']:_0x499b57[_0x8921('0x32')];if(_0x136c49[_0x8921('0x35')][_0x8921('0x42')]){_0x437c14[_0x8921('0x48')]=[{'all':!![]}];}_0x437c14=_['merge']({},_0x437c14,_0x136c49['options']);return db[_0x8921('0x2e')][_0x8921('0x49')](_0x437c14)[_0x8921('0x27')](handleEntityNotFound(_0x535895,null))['then'](respondWithResult(_0x535895,null))['catch'](handleError(_0x535895,null));};exports[_0x8921('0x4a')]=function(_0x22c372,_0x4892b0){return db[_0x8921('0x2e')]['create'](_0x22c372['body'],{})[_0x8921('0x27')](respondWithResult(_0x4892b0,0xc9))['catch'](handleError(_0x4892b0,null));};exports['update']=function(_0x4c20cd,_0x4b7ab1){if(_0x4c20cd['body']['id']){delete _0x4c20cd[_0x8921('0x4b')]['id'];}return db['VoiceRecording'][_0x8921('0x49')]({'where':{'id':_0x4c20cd['params']['id']}})[_0x8921('0x27')](handleEntityNotFound(_0x4b7ab1,null))[_0x8921('0x27')](saveUpdates(_0x4c20cd[_0x8921('0x4b')],null))['then'](respondWithResult(_0x4b7ab1,null))[_0x8921('0x4c')](handleError(_0x4b7ab1,null));};exports[_0x8921('0x4d')]=function(_0x3c369c,_0x4fe5bb){return db[_0x8921('0x2e')]['describe']()[_0x8921('0x27')](respondWithResult(_0x4fe5bb,null))[_0x8921('0x4c')](handleError(_0x4fe5bb,null));};exports['download']=function(_0xaf9d5b,_0x239aeb,_0x596033){var _0x208c07=require('../../components/encryptor');var _0x11dc67=![];var _0x3f53cc={};if(_0xaf9d5b[_0x8921('0x35')][_0x8921('0x31')]&&_0xaf9d5b['query'][_0x8921('0x31')]===_0x8921('0x4e')){_0x3f53cc[_0x8921('0x4e')]=_0xaf9d5b[_0x8921('0x46')]['id'];}else{_0x3f53cc['id']=_0xaf9d5b[_0x8921('0x46')]['id'];}return db[_0x8921('0x2e')][_0x8921('0x49')]({'where':_0x3f53cc,'attributes':['id','value'],'raw':!![]})[_0x8921('0x27')](handleEntityNotFound(_0x239aeb,null))['then'](function(_0x37dc22){if(_0x37dc22){var _0x430a2b=_0x37dc22[_0x8921('0x4f')];var _0x3e07d1=util[_0x8921('0x50')](_0x8921('0x51'),_0x430a2b);if(fs[_0x8921('0x52')](_0x3e07d1)){_0x11dc67=!![];return _0x208c07['decryptFile'](_0x3e07d1,_0x430a2b,config[_0x8921('0x53')][_0x8921('0x54')])[_0x8921('0x27')](function(){return _0x37dc22;});}return _0x37dc22;}})[_0x8921('0x27')](function(_0x257a25){if(_0x257a25){var _0x31ee41=_0x257a25[_0x8921('0x4f')];if(!fs[_0x8921('0x52')](_0x31ee41)){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x257a25['filename']){return _0x239aeb[_0x8921('0x57')](_0x31ee41,_0x257a25[_0x8921('0x58')]+path[_0x8921('0x59')](_0x31ee41),function(){if(_0x11dc67){fs[_0x8921('0x5a')](_0x31ee41);}});}else{return _0x239aeb[_0x8921('0x57')](_0x31ee41,function(_0x1b1444){if(_0x11dc67){fs[_0x8921('0x5a')](_0x31ee41);}});}}})[_0x8921('0x4c')](function(_0x34b0ea){if(_0x34b0ea['message']==='VoiceRecording\x20not\x20found'){_0x239aeb['status'](0x194)[_0x8921('0x2b')](_0x8921('0x5b'));}else{return handleError(_0x239aeb,null);}});};exports[_0x8921('0x5c')]=function(_0x5c3998,_0x109bc8,_0x8b5242){var _0x18ea57=require(_0x8921('0x5d'));var _0x598f7b=![];var _0x147292={'$and':[db[_0x8921('0x5e')]['where'](db[_0x8921('0x5e')]['fn']('MD5',db[_0x8921('0x5e')]['col']('uniqueid')),_0x5c3998[_0x8921('0x35')][_0x8921('0x5f')])]};if(_0x5c3998[_0x8921('0x35')][_0x8921('0x31')]&&_0x5c3998[_0x8921('0x35')][_0x8921('0x31')]===_0x8921('0x4e')){_0x147292[_0x8921('0x60')][_0x8921('0x61')]({'uniqueid':_0x5c3998[_0x8921('0x46')]['id']});}else{_0x147292[_0x8921('0x60')][_0x8921('0x61')]({'id':_0x5c3998[_0x8921('0x46')]['id']});}return db['VoiceRecording']['find']({'where':_0x147292,'attributes':['id','value'],'raw':!![]})[_0x8921('0x27')](handleEntityNotFound(_0x109bc8,null))[_0x8921('0x27')](function(_0x39bdc3){if(_0x39bdc3){var _0x297dbe=util[_0x8921('0x50')](_0x8921('0x51'),_0x39bdc3[_0x8921('0x4f')]);if(fs['existsSync'](_0x297dbe)){_0x598f7b=!![];return _0x18ea57[_0x8921('0x62')](_0x297dbe,_0x39bdc3[_0x8921('0x4f')],config[_0x8921('0x53')][_0x8921('0x54')])[_0x8921('0x27')](function(){return _0x39bdc3;});}return _0x39bdc3;}})[_0x8921('0x27')](function(_0x324baf){if(_0x324baf){if(!fs[_0x8921('0x52')](_0x324baf[_0x8921('0x4f')])){throw new db[(_0x8921('0x55'))]['ValidationError'](_0x8921('0x63'));}if(_0x324baf[_0x8921('0x58')]){return _0x109bc8[_0x8921('0x57')](_0x324baf[_0x8921('0x4f')],_0x324baf[_0x8921('0x58')]+path[_0x8921('0x59')](_0x324baf[_0x8921('0x4f')]),function(){if(_0x598f7b){fs['unlink'](_0x324baf[_0x8921('0x4f')]);}});}else{return _0x109bc8[_0x8921('0x57')](_0x324baf[_0x8921('0x4f')],function(_0x326773){if(_0x598f7b){fs['unlink'](_0x324baf['value']);}});}}})[_0x8921('0x4c')](handleError(_0x109bc8,null));};exports[_0x8921('0x28')]=function(_0xe1f6c4,_0x3a9f9c){return db['VoiceRecording']['find']({'where':{'id':_0xe1f6c4[_0x8921('0x46')]['id']}})[_0x8921('0x27')](function(_0x21c812){if(_[_0x8921('0x64')](_0x21c812)){throw new ReferenceError('Entity\x20not\x20found');}return _0x21c812;})[_0x8921('0x27')](function(_0x1e9aaf){var _0x5272f9=_0x1e9aaf[_0x8921('0x4f')];logger[_0x8921('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x5272f9);if(!_[_0x8921('0x64')](_0x1e9aaf[_0x8921('0x4f')])&&fs['existsSync'](_0x5272f9)){logger['info']('File:\x20\x22'+_0x5272f9+_0x8921('0x66'));fs['unlinkSync'](_0x5272f9);}_0x5272f9=_0x5272f9+'.cypher';if(!_[_0x8921('0x64')](_0x1e9aaf['value'])&&fs[_0x8921('0x52')](_0x5272f9)){logger['info']('File:\x20\x22'+_0x5272f9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8921('0x67')](_0x5272f9);}return _0x1e9aaf;})[_0x8921('0x27')](function(_0x19942b){if(!_0x19942b)throw new InternalError();return _0x19942b[_0x8921('0x28')]();})[_0x8921('0x27')](function(){_0x3a9f9c[_0x8921('0x1c')](0xcc)[_0x8921('0x68')]();})[_0x8921('0x4c')](handleError(_0x3a9f9c,null));};function getBucketslist(_0x4da065,_0x16397c,_0x2ee994){return new Promise(function(_0x15ad42,_0x57fb5c){var _0x1d9cc9=new AWS['S3']({'accessKeyId':_0x16397c,'secretAccessKey':_0x4da065,'region':_0x2ee994});_0x1d9cc9['listBuckets']({},function(_0x2c84c8,_0x2989e3){if(_0x2c84c8){return _0x57fb5c(_0x2c84c8);}else{return _0x15ad42(_0x2989e3);}});});}function createBucket(_0x2eff68,_0x418da3,_0x546ce5,_0xa6cc52){return new Promise(function(_0x121007,_0x1a335d){var _0x20acfa=new AWS['S3']({'accessKeyId':_0x418da3,'secretAccessKey':_0x2eff68,'region':_0x546ce5});_0x20acfa[_0x8921('0x69')]({'Bucket':_0xa6cc52},function(_0x387924,_0x814feb){if(_0x387924){return _0x1a335d(_0x387924);}else{return _0x121007(_0x814feb);}});});}function uploadFile(_0x2f967c,_0x5136c0,_0x236174,_0xec565d,_0xd5c7bf,_0x913a12){return new Promise(function(_0x4e86e1,_0x43b713){var _0x447f4b=new AWS['S3']({'accessKeyId':_0x5136c0,'secretAccessKey':_0x2f967c,'region':_0x236174});_0x447f4b[_0x8921('0x6a')]({'Bucket':_0xec565d,'Key':_0xd5c7bf,'Body':_0x913a12},function(_0x3ad10b,_0x15ce67){if(_0x3ad10b){return _0x43b713(_0x3ad10b);}else{return _0x4e86e1(_0x15ce67);}});});}function startTranscribe(_0x4108ea,_0xdf3854,_0x273b52,_0xdde54b,_0x3988fd,_0x5c1422){return new Promise(function(_0x401572,_0x28566f){var _0x3c2572=new AWS[(_0x8921('0x6b'))]({'accessKeyId':_0xdf3854,'secretAccessKey':_0x4108ea,'region':_0x273b52});_0x3c2572[_0x8921('0x6c')]({'TranscriptionJobName':_0xdde54b,'LanguageCode':_0x3988fd,'Media':{'MediaFileUri':_0x5c1422}},function(_0x3bbb21,_0x2df651){if(_0x3bbb21){return _0x28566f(_0x3bbb21);}else{return _0x401572(_0x2df651);}});});}function transcribe(_0x38e7eb,_0x132096,_0x1f91bc,_0x1460f2,_0x3919bf,_0x207edc,_0x94d835){return new Promise(function(_0x58c913,_0x5ca9f8){var _0x28bdc9={};logger[_0x8921('0x65')](util[_0x8921('0x50')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x38e7eb,_0x3919bf));return uploadFile(_0x132096,_0x1f91bc,_0x1460f2,_0x3919bf,path[_0x8921('0x6d')](_0x207edc),fs['readFileSync'](_0x207edc))['then'](function(_0x4b31a0){logger['info'](util[_0x8921('0x50')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x38e7eb,_0x3919bf,_0x4b31a0[_0x8921('0x6e')]));_0x28bdc9[_0x8921('0x6f')]=_0x4b31a0[_0x8921('0x70')];_0x28bdc9[_0x8921('0x71')]=_0x4b31a0[_0x8921('0x6e')];logger[_0x8921('0x65')](util[_0x8921('0x50')](_0x8921('0x72'),_0x38e7eb));return startTranscribe(_0x132096,_0x1f91bc,_0x1460f2,uuidv4(),_0x94d835,_0x4b31a0[_0x8921('0x6e')]);})[_0x8921('0x27')](function(_0x537935){logger[_0x8921('0x65')](util[_0x8921('0x50')](_0x8921('0x73'),_0x38e7eb,_0x537935[_0x8921('0x74')]['TranscriptionJobName']));_0x28bdc9['transcribeName']=_0x537935[_0x8921('0x74')][_0x8921('0x75')];_0x28bdc9['transcribeStatus']=_0x537935[_0x8921('0x74')][_0x8921('0x76')];return _0x58c913(_0x28bdc9);})[_0x8921('0x4c')](function(_0x1d10fd){return _0x5ca9f8(_0x1d10fd);});});}exports[_0x8921('0x77')]=function(_0x38c7fc,_0x31821a,_0x206113){var _0x442c43;var _0x15f340;var _0x44db43;var _0xb79ec0=require(_0x8921('0x5d'));return db['VoiceRecording']['findOne']({'where':{'id':_0x38c7fc[_0x8921('0x46')]['id']}})[_0x8921('0x27')](function(_0x198e2f){if(_0x198e2f){var _0x5444b6=util[_0x8921('0x50')](_0x8921('0x51'),_0x198e2f[_0x8921('0x4f')]);if(fs[_0x8921('0x52')](_0x5444b6)){cypher=!![];return _0xb79ec0[_0x8921('0x62')](_0x5444b6,_0x198e2f[_0x8921('0x4f')],config['secrets'][_0x8921('0x54')])[_0x8921('0x27')](function(){return _0x198e2f;});}return _0x198e2f;}})['then'](function(_0x4baf0f){if(!_0x4baf0f){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))](_0x8921('0x78'));}_0x15f340=_0x4baf0f;return db['Setting'][_0x8921('0x79')]({'where':{'id':0x1}});})[_0x8921('0x27')](handleEntityNotFound(_0x31821a,null))[_0x8921('0x27')](function(_0x2fc4a7){if(_0x2fc4a7){_0x442c43=_0x2fc4a7;if(!_0x442c43[_0x8921('0x7a')]||!_0x442c43['transcribeAccountId']||!_0x442c43[_0x8921('0x7b')]||!_0x442c43['language']||!_0x442c43[_0x8921('0x6f')]){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))](_0x8921('0x7c'));}if(_0x38c7fc[_0x8921('0x4b')][_0x8921('0x7d')]&&(!_0x442c43['sentiment']||!_0x442c43[_0x8921('0x7e')]||!_0x442c43[_0x8921('0x7f')]||!_0x442c43['language']||!_0x442c43[_0x8921('0x6f')])){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))](_0x8921('0x80'));}return db[_0x8921('0x81')][_0x8921('0x79')]({'where':{'id':_0x442c43[_0x8921('0x82')]}});}})[_0x8921('0x27')](function(_0x96bf4c){if(!_0x96bf4c){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))](_0x8921('0x83'));}if(!_0x96bf4c[_0x8921('0x84')]||!_0x96bf4c[_0x8921('0x85')]){throw new db[(_0x8921('0x55'))][(_0x8921('0x56'))](_0x8921('0x86'));}_0x44db43=_0x96bf4c;return getBucketslist(_0x44db43[_0x8921('0x84')],_0x44db43[_0x8921('0x85')],_0x442c43[_0x8921('0x7b')]);})[_0x8921('0x27')](function(_0x2e8ee7){if(_0x2e8ee7&&_0x2e8ee7[_0x8921('0x87')]){var _0x44fc09=_[_0x8921('0x49')](_0x2e8ee7[_0x8921('0x87')],function(_0x4b67ae){return _0x4b67ae['Name']===_0x442c43[_0x8921('0x6f')];});if(!_0x44fc09){logger[_0x8921('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x38c7fc[_0x8921('0x46')]['id'],_0x442c43[_0x8921('0x6f')]));return createBucket(_0x44db43[_0x8921('0x84')],_0x44db43[_0x8921('0x85')],_0x442c43[_0x8921('0x7b')],_0x442c43[_0x8921('0x6f')]);}logger[_0x8921('0x65')](util[_0x8921('0x50')](_0x8921('0x88'),_0x38c7fc[_0x8921('0x46')]['id'],_0x442c43[_0x8921('0x6f')]));return;}})[_0x8921('0x27')](function(_0x1715da){if(_0x15f340[_0x8921('0x89')]===_0x8921('0x8a')){return transcribe(_0x38c7fc['params']['id'],_0x44db43['data1'],_0x44db43[_0x8921('0x85')],_0x442c43['transcribeRegion'],_0x442c43[_0x8921('0x6f')],_0x15f340[_0x8921('0x4f')],_0x442c43[_0x8921('0x8b')]);}else{logger['info'](util[_0x8921('0x50')](_0x8921('0x8c'),_0x38c7fc[_0x8921('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8921('0x27')](function(_0x3a4118){if(_0x3a4118){_0x3a4118[_0x8921('0x8d')]=_0x38c7fc['body'][_0x8921('0x7d')];return _0x15f340[_0x8921('0x8e')](_0x3a4118);}})[_0x8921('0x27')](respondWithResult(_0x31821a,null))[_0x8921('0x4c')](handleError(_0x31821a,null));};function writeFile(_0x2a4946,_0x2e39f9){return new Promise(function(_0x3a4b6e,_0x1b6594){fs[_0x8921('0x8f')](_0x2e39f9,_0x2a4946,function(_0x590dae,_0x30c467){if(_0x590dae){return _0x1b6594(_0x590dae);}else{return _0x3a4b6e(_0x30c467);}});});}exports[_0x8921('0x90')]=function(_0x2895fa,_0x40c7ed,_0x2cb825){return db[_0x8921('0x2e')][_0x8921('0x79')]({'where':{'id':_0x2895fa[_0x8921('0x46')]['id']}})[_0x8921('0x27')](handleEntityNotFound(_0x40c7ed))['then'](function(_0x3b4ebf){if(_0x3b4ebf&&_0x3b4ebf[_0x8921('0x91')]){var _0x38c7ca=_0x3b4ebf[_0x8921('0x91')];var _0x2046fe=config[_0x8921('0x92')]+_0x8921('0x93')+_0x3b4ebf['id']+_0x8921('0x94');if(fs[_0x8921('0x52')](_0x2046fe)){return _0x2046fe;}return writeFile(_0x38c7ca,_0x2046fe)[_0x8921('0x27')](function(){return _0x2046fe;});}else{throw new db['Sequelize'][(_0x8921('0x56'))]('Transcript\x20not\x20available');}})['then'](function(_0x1a8d1e){return _0x40c7ed[_0x8921('0x57')](_0x1a8d1e);})[_0x8921('0x4c')](handleError(_0x40c7ed));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 3c0099a..dd964eb 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 _0x38c1=['uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x38c1,0x7f));var _0x138c=function(_0x9aaca8,_0x222c1a){_0x9aaca8=_0x9aaca8-0x0;var _0x1a77bd=_0x38c1[_0x9aaca8];return _0x1a77bd;};'use strict';var _=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var logger=require(_0x138c('0x2'))(_0x138c('0x3'));var moment=require(_0x138c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x138c('0x5'));var rimraf=require(_0x138c('0x6'));var config=require(_0x138c('0x7'));var attributes=require(_0x138c('0x8'));module[_0x138c('0x9')]=function(_0x29a6ec,_0x5473c5){return _0x29a6ec[_0x138c('0xa')](_0x138c('0xb'),attributes,{'tableName':_0x138c('0xc'),'paranoid':![],'indexes':[{'name':_0x138c('0xd'),'fields':[_0x138c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a94=['bluebird','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x523596,_0x548ca5){var _0x1db19a=function(_0x11182e){while(--_0x11182e){_0x523596['push'](_0x523596['shift']());}};_0x1db19a(++_0x548ca5);}(_0x5a94,0x1e5));var _0x45a9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x5a94[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x45a9('0x0'));var util=require(_0x45a9('0x1'));var logger=require(_0x45a9('0x2'))(_0x45a9('0x3'));var moment=require(_0x45a9('0x4'));var BPromise=require(_0x45a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x45a9('0x6'));var config=require(_0x45a9('0x7'));var attributes=require(_0x45a9('0x8'));module[_0x45a9('0x9')]=function(_0x2e7403,_0x3b271b){return _0x2e7403[_0x45a9('0xa')](_0x45a9('0xb'),attributes,{'tableName':_0x45a9('0xc'),'paranoid':![],'indexes':[{'name':_0x45a9('0xd'),'fields':[_0x45a9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4fb5414..bb98287 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 _0xbff5=['catch','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','%s.cypher','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','where','attributes','then','UpdateVoiceRecording','debug'];(function(_0x4c0155,_0x5b20db){var _0x1276db=function(_0x3ff813){while(--_0x3ff813){_0x4c0155['push'](_0x4c0155['shift']());}};_0x1276db(++_0x5b20db);}(_0xbff5,0x1bc));var _0x5bff=function(_0x1a2ff9,_0x5c00e5){_0x1a2ff9=_0x1a2ff9-0x0;var _0x5cca00=_0xbff5[_0x1a2ff9];return _0x5cca00;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['UpdateVoiceRecording']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['VoiceRecording'][_0x5bff('0x15')](_0xc9fbc3['body'],{'raw':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3['options'][_0x5bff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')]['limit']||null:null})[_0x5bff('0x1a')](function(_0x263cf5){logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0xc9fbc3);logger[_0x5bff('0x1c')](_0x5bff('0x1b'),_0xc9fbc3,JSON[_0x5bff('0xf')](_0x263cf5));_0x36653b(_0x263cf5);})[_0x5bff('0x1d')](function(_0x5e2ae8){logger['error'](_0x5bff('0x1b'),_0x5e2ae8['message'],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x5e2ae8[_0x5bff('0x12')]));});});};exports[_0x5bff('0x1e')]=function(_0x6f18f1){var _0xfa361d=this;return new Promise(function(_0x1140eb,_0x271f3c){var _0xedba9d=require('../../components/encryptor');var _0x4df57a;return db[_0x5bff('0x1f')][_0x5bff('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5bff('0x1a')](function(_0x588078){_0x4df57a=_0x588078;return db['VoiceRecording'][_0x5bff('0x21')](_0x6f18f1['body']);})[_0x5bff('0x1a')](function(_0x64e22){if(_0x4df57a[_0x5bff('0x22')]&&fs[_0x5bff('0x23')](_0x64e22['value'])){var _0x71783=util['format'](_0x5bff('0x24'),_0x64e22['value']);return _0xedba9d[_0x5bff('0x25')](_0x64e22[_0x5bff('0x26')],_0x71783,config[_0x5bff('0x27')][_0x5bff('0x28')])[_0x5bff('0x1a')](function(){fs[_0x5bff('0x29')](_0x64e22['value']);logger[_0x5bff('0x13')](_0x5bff('0x2a'));return _0x64e22;});}return _0x64e22;})[_0x5bff('0x1a')](function(_0x42fe4a){logger[_0x5bff('0x13')](_0x5bff('0x1e'),_0x6f18f1);logger[_0x5bff('0x1c')](_0x5bff('0x1e'),_0x6f18f1,JSON['stringify'](_0x42fe4a));_0x1140eb(_0x42fe4a);})[_0x5bff('0x1d')](function(_0x16042d){logger[_0x5bff('0x10')](_0x5bff('0x1e'),_0x16042d['message'],_0x6f18f1);_0x271f3c(_0xfa361d[_0x5bff('0x10')](0x1f4,_0x16042d[_0x5bff('0x12')]));});});}; \ No newline at end of file +var _0x82c4=['value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','options','raw','where','attributes','CreateVoiceRecording','../../components/encryptor','findOne','create','body','callRecordingEncryption','existsSync'];(function(_0x457d3c,_0x3d4ec1){var _0x3dc5fb=function(_0x5d9ea7){while(--_0x5d9ea7){_0x457d3c['push'](_0x457d3c['shift']());}};_0x3dc5fb(++_0x3d4ec1);}(_0x82c4,0x1ca));var _0x482c=function(_0x4c1917,_0xea7b6c){_0x4c1917=_0x4c1917-0x0;var _0x220fa5=_0x82c4[_0x4c1917];return _0x220fa5;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}exports[_0x482c('0x15')]=function(_0x5b6f7e){var _0x3aed45=this;return new Promise(function(_0x258148,_0x4af05a){return db['VoiceRecording'][_0x482c('0x16')](_0x5b6f7e['body'],{'raw':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e['options'][_0x482c('0x19')]||null:null,'attributes':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x1a')]||null:null,'limit':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e['options']['limit']||null:null})[_0x482c('0xa')](function(_0x147d05){logger[_0x482c('0xb')]('UpdateVoiceRecording',_0x5b6f7e);logger[_0x482c('0xe')]('UpdateVoiceRecording',_0x5b6f7e,JSON[_0x482c('0xf')](_0x147d05));_0x258148(_0x147d05);})[_0x482c('0x14')](function(_0x4f1108){logger[_0x482c('0x10')]('UpdateVoiceRecording',_0x4f1108['message'],_0x5b6f7e);_0x4af05a(_0x3aed45[_0x482c('0x10')](0x1f4,_0x4f1108[_0x482c('0x12')]));});});};exports[_0x482c('0x1b')]=function(_0x1f4501){var _0x3bd5bb=this;return new Promise(function(_0x215826,_0x2981d2){var _0x5ad788=require(_0x482c('0x1c'));var _0x255417;return db['Setting'][_0x482c('0x1d')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x207441){_0x255417=_0x207441;return db['VoiceRecording'][_0x482c('0x1e')](_0x1f4501[_0x482c('0x1f')]);})[_0x482c('0xa')](function(_0x11fa65){if(_0x255417[_0x482c('0x20')]&&fs[_0x482c('0x21')](_0x11fa65[_0x482c('0x22')])){var _0x3e9b22=util[_0x482c('0x23')](_0x482c('0x24'),_0x11fa65[_0x482c('0x22')]);return _0x5ad788[_0x482c('0x25')](_0x11fa65[_0x482c('0x22')],_0x3e9b22,config[_0x482c('0x26')][_0x482c('0x27')])[_0x482c('0xa')](function(){fs[_0x482c('0x28')](_0x11fa65[_0x482c('0x22')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x11fa65;});}return _0x11fa65;})['then'](function(_0x2fd9d0){logger[_0x482c('0xb')](_0x482c('0x1b'),_0x1f4501);logger[_0x482c('0xe')]('CreateVoiceRecording',_0x1f4501,JSON[_0x482c('0xf')](_0x2fd9d0));_0x215826(_0x2fd9d0);})['catch'](function(_0x31428c){logger[_0x482c('0x10')](_0x482c('0x1b'),_0x31428c[_0x482c('0x12')],_0x1f4501);_0x2981d2(_0x3bd5bb[_0x482c('0x10')](0x1f4,_0x31428c[_0x482c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 51e03ac..93c1bb0 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 _0x2022=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2022,0xf3));var _0x2202=function(_0x477a1,_0x212eb7){_0x477a1=_0x477a1-0x0;var _0x28b171=_0x2022[_0x477a1];return _0x28b171;};'use strict';var multer=require(_0x2202('0x0'));var util=require(_0x2202('0x1'));var path=require(_0x2202('0x2'));var timeout=require(_0x2202('0x3'));var express=require(_0x2202('0x4'));var router=express[_0x2202('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2202('0x6'));var config=require(_0x2202('0x7'));var controller=require(_0x2202('0x8'));router[_0x2202('0x9')]('/',auth[_0x2202('0xa')](),controller['index']);router[_0x2202('0x9')]('/describe',auth[_0x2202('0xa')](),controller[_0x2202('0xb')]);router[_0x2202('0x9')](_0x2202('0xc'),auth['isAuthenticated'](),controller[_0x2202('0xd')]);router[_0x2202('0xe')]('/',auth[_0x2202('0xa')](),controller['create']);router[_0x2202('0xf')](_0x2202('0xc'),auth[_0x2202('0xa')](),controller[_0x2202('0x10')]);router[_0x2202('0x11')](_0x2202('0xc'),auth['isAuthenticated'](),controller[_0x2202('0x12')]);module[_0x2202('0x13')]=router; \ No newline at end of file +var _0xea85=['/:id','post','create','update','delete','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xea85,0x180));var _0x5ea8=function(_0x2ae556,_0x1cdf7c){_0x2ae556=_0x2ae556-0x0;var _0x3200dd=_0xea85[_0x2ae556];return _0x3200dd;};'use strict';var multer=require(_0x5ea8('0x0'));var util=require('util');var path=require(_0x5ea8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5ea8('0x2')]();var fs_extra=require(_0x5ea8('0x3'));var auth=require(_0x5ea8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ea8('0x5'));var controller=require(_0x5ea8('0x6'));router[_0x5ea8('0x7')]('/',auth[_0x5ea8('0x8')](),controller[_0x5ea8('0x9')]);router[_0x5ea8('0x7')](_0x5ea8('0xa'),auth[_0x5ea8('0x8')](),controller[_0x5ea8('0xb')]);router['get'](_0x5ea8('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5ea8('0xd')]('/',auth[_0x5ea8('0x8')](),controller[_0x5ea8('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5ea8('0xf')]);router[_0x5ea8('0x10')](_0x5ea8('0xc'),auth[_0x5ea8('0x8')](),controller[_0x5ea8('0x11')]);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 6ff746a..c31a2aa 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 _0x0695=['blind','attended','STRING','moment','exports','ENUM'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0695,0xbd));var _0x5069=function(_0x2fd1cc,_0x4c4831){_0x2fd1cc=_0x2fd1cc-0x0;var _0x3cdc2c=_0x0695[_0x2fd1cc];return _0x3cdc2c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5069('0x0'));module[_0x5069('0x1')]={'type':{'type':Sequelize[_0x5069('0x2')](_0x5069('0x3'),_0x5069('0x4'))},'result':{'type':Sequelize[_0x5069('0x5')]},'transfererchannel':{'type':Sequelize[_0x5069('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x5069('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5069('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x5069('0x5')]},'transferercontext':{'type':Sequelize[_0x5069('0x5')]},'transfererexten':{'type':Sequelize[_0x5069('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5069('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5069('0x5')]},'transfereecontext':{'type':Sequelize[_0x5069('0x5')]},'transfereeexten':{'type':Sequelize[_0x5069('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x5069('0x5')]},'isexternal':{'type':Sequelize[_0x5069('0x2')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1b66=['ENUM','sequelize','attended','STRING'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x1b66,0x1d1));var _0x61b6=function(_0x136856,_0x2e456a){_0x136856=_0x136856-0x0;var _0xb3f1ee=_0x1b66[_0x136856];return _0xb3f1ee;};'use strict';var Sequelize=require(_0x61b6('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM']('blind',_0x61b6('0x1'))},'result':{'type':Sequelize[_0x61b6('0x2')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x61b6('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0x61b6('0x2')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x61b6('0x2')]},'transferercontext':{'type':Sequelize[_0x61b6('0x2')]},'transfererexten':{'type':Sequelize[_0x61b6('0x2')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x61b6('0x2')]},'transfereecalleridnum':{'type':Sequelize[_0x61b6('0x2')]},'transfereecalleridname':{'type':Sequelize[_0x61b6('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x61b6('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0x61b6('0x2')]},'transfereecontext':{'type':Sequelize[_0x61b6('0x2')]},'transfereeexten':{'type':Sequelize[_0x61b6('0x2')]},'transfereelinkedid':{'type':Sequelize[_0x61b6('0x2')]},'isexternal':{'type':Sequelize[_0x61b6('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x61b6('0x2')]},'extension':{'type':Sequelize[_0x61b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4ff1f6e..839568c 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 _0x556a=['hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','findAll','show','params','includeAll','VoiceTransferReport','find','catch','create','body','describe','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','index','map','fieldName','type','key','model','name','keys','intersection','query','attributes','fields','length'];(function(_0x54fa4c,_0xd2fe3c){var _0x2d78f2=function(_0x309d4b){while(--_0x309d4b){_0x54fa4c['push'](_0x54fa4c['shift']());}};_0x2d78f2(++_0xd2fe3c);}(_0x556a,0x187));var _0xa556=function(_0x4fa7d9,_0x250589){_0x4fa7d9=_0x4fa7d9-0x0;var _0x200612=_0x556a[_0x4fa7d9];return _0x200612;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa556('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa556('0x1'));var moment=require('moment');var BPromise=require(_0xa556('0x2'));var Mustache=require(_0xa556('0x3'));var util=require(_0xa556('0x4'));var path=require('path');var sox=require(_0xa556('0x5'));var csv=require(_0xa556('0x6'));var ejs=require(_0xa556('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa556('0x8'));var squel=require(_0xa556('0x9'));var crypto=require(_0xa556('0xa'));var jsforce=require(_0xa556('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa556('0x6'));var querystring=require(_0xa556('0xc'));var Papa=require(_0xa556('0xd'));var Redis=require(_0xa556('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa556('0xf'));var as=require(_0xa556('0x10'));var hardwareService=require(_0xa556('0x11'));var logger=require('../../config/logger')(_0xa556('0x12'));var utils=require(_0xa556('0x13'));var config=require(_0xa556('0x14'));var licenseUtil=require(_0xa556('0x15'));var db=require(_0xa556('0x16'))['db'];function respondWithStatusCode(_0x57921f,_0x2264bf){_0x2264bf=_0x2264bf||0xcc;return function(_0x1a5af9){if(_0x1a5af9){return _0x57921f[_0xa556('0x17')](_0x2264bf);}return _0x57921f['status'](_0x2264bf)[_0xa556('0x18')]();};}function respondWithResult(_0x22ac97,_0x11ad94){_0x11ad94=_0x11ad94||0xc8;return function(_0x5972b7){if(_0x5972b7){return _0x22ac97[_0xa556('0x19')](_0x11ad94)[_0xa556('0x1a')](_0x5972b7);}};}function respondWithFilteredResult(_0x4b9baf,_0x1ac005){return function(_0x39c322){if(_0x39c322){var _0x8f3b43=typeof _0x1ac005[_0xa556('0x1b')]==='undefined'&&typeof _0x1ac005[_0xa556('0x1c')]===_0xa556('0x1d');var _0x11c21d=_0x39c322[_0xa556('0x1e')];var _0x3622db=_0x8f3b43?0x0:_0x1ac005[_0xa556('0x1b')];var _0xc420f4=_0x8f3b43?_0x39c322[_0xa556('0x1e')]:_0x1ac005[_0xa556('0x1b')]+_0x1ac005[_0xa556('0x1c')];var _0x105e4c;if(_0xc420f4>=_0x11c21d){_0xc420f4=_0x11c21d;_0x105e4c=0xc8;}else{_0x105e4c=0xce;}_0x4b9baf['status'](_0x105e4c);return _0x4b9baf[_0xa556('0x1f')](_0xa556('0x20'),_0x3622db+'-'+_0xc420f4+'/'+_0x11c21d)[_0xa556('0x1a')](_0x39c322);}return null;};}function patchUpdates(_0x156599){return function(_0xfa610e){try{jsonpatch[_0xa556('0x21')](_0xfa610e,_0x156599,!![]);}catch(_0x36cf37){return BPromise[_0xa556('0x22')](_0x36cf37);}return _0xfa610e[_0xa556('0x23')]();};}function saveUpdates(_0x354c13,_0x488375){return function(_0x45b176){if(_0x45b176){return _0x45b176[_0xa556('0x24')](_0x354c13)[_0xa556('0x25')](function(_0x2ce7ce){return _0x2ce7ce;});}return null;};}function removeEntity(_0x292648,_0x32153a){return function(_0x4dedfd){if(_0x4dedfd){return _0x4dedfd['destroy']()['then'](function(){_0x292648['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3baadc,_0x2ec16c){return function(_0x21dc31){if(!_0x21dc31){_0x3baadc[_0xa556('0x17')](0x194);}return _0x21dc31;};}function handleError(_0x4feec2,_0x54e0d0){_0x54e0d0=_0x54e0d0||0x1f4;return function(_0x54d7e8){logger[_0xa556('0x26')](_0x54d7e8[_0xa556('0x27')]);if(_0x54d7e8['name']){delete _0x54d7e8['name'];}_0x4feec2[_0xa556('0x19')](_0x54e0d0)['send'](_0x54d7e8);};}exports[_0xa556('0x28')]=function(_0x59f677,_0x25831c){var _0x320195={},_0x991eb5={},_0x5eedd5={'count':0x0,'rows':[]};var _0x56bdbb=_[_0xa556('0x29')](db['VoiceTransferReport']['rawAttributes'],function(_0x49ed38){return{'name':_0x49ed38[_0xa556('0x2a')],'type':_0x49ed38[_0xa556('0x2b')][_0xa556('0x2c')]};});_0x991eb5[_0xa556('0x2d')]=_['map'](_0x56bdbb,_0xa556('0x2e'));_0x991eb5['query']=_[_0xa556('0x2f')](_0x59f677['query']);_0x991eb5['filters']=_[_0xa556('0x30')](_0x991eb5[_0xa556('0x2d')],_0x991eb5[_0xa556('0x31')]);_0x320195[_0xa556('0x32')]=_[_0xa556('0x30')](_0x991eb5[_0xa556('0x2d')],qs[_0xa556('0x33')](_0x59f677[_0xa556('0x31')][_0xa556('0x33')]));_0x320195[_0xa556('0x32')]=_0x320195[_0xa556('0x32')][_0xa556('0x34')]?_0x320195[_0xa556('0x32')]:_0x991eb5[_0xa556('0x2d')];if(!_0x59f677[_0xa556('0x31')][_0xa556('0x35')](_0xa556('0x36'))){_0x320195[_0xa556('0x1c')]=qs[_0xa556('0x1c')](_0x59f677[_0xa556('0x31')]['limit']);_0x320195['offset']=qs['offset'](_0x59f677[_0xa556('0x31')][_0xa556('0x1b')]);}_0x320195[_0xa556('0x37')]=qs[_0xa556('0x38')](_0x59f677[_0xa556('0x31')][_0xa556('0x38')]);_0x320195['where']=qs['filters'](_[_0xa556('0x39')](_0x59f677[_0xa556('0x31')],_0x991eb5[_0xa556('0x3a')]),_0x56bdbb);if(_0x59f677[_0xa556('0x31')][_0xa556('0x3b')]){_0x320195['where']=_[_0xa556('0x3c')](_0x320195[_0xa556('0x3d')],{'$or':_[_0xa556('0x29')](_0x56bdbb,function(_0x650f97){if(_0x650f97[_0xa556('0x2b')]!==_0xa556('0x3e')){var _0x20ae1c={};_0x20ae1c[_0x650f97[_0xa556('0x2e')]]={'$like':'%'+_0x59f677[_0xa556('0x31')][_0xa556('0x3b')]+'%'};return _0x20ae1c;}})});}_0x320195=_[_0xa556('0x3c')]({},_0x320195,_0x59f677[_0xa556('0x3f')]);var _0x3d9a76={'where':_0x320195[_0xa556('0x3d')]};return db['VoiceTransferReport'][_0xa556('0x1e')](_0x3d9a76)[_0xa556('0x25')](function(_0x555ebc){_0x5eedd5['count']=_0x555ebc;if(_0x59f677['query']['includeAll']){_0x320195['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0xa556('0x40')](_0x320195);})['then'](function(_0x45ad9c){_0x5eedd5['rows']=_0x45ad9c;return _0x5eedd5;})[_0xa556('0x25')](respondWithFilteredResult(_0x25831c,_0x320195))['catch'](handleError(_0x25831c,null));};exports[_0xa556('0x41')]=function(_0x3c29c8,_0x52c581){var _0x25f27f={'raw':!![],'where':{'id':_0x3c29c8[_0xa556('0x42')]['id']}},_0x3848f7={};_0x3848f7['model']=_[_0xa556('0x2f')](db['VoiceTransferReport']['rawAttributes']);_0x3848f7[_0xa556('0x31')]=_['keys'](_0x3c29c8[_0xa556('0x31')]);_0x3848f7[_0xa556('0x3a')]=_[_0xa556('0x30')](_0x3848f7['model'],_0x3848f7[_0xa556('0x31')]);_0x25f27f['attributes']=_[_0xa556('0x30')](_0x3848f7['model'],qs[_0xa556('0x33')](_0x3c29c8[_0xa556('0x31')][_0xa556('0x33')]));_0x25f27f[_0xa556('0x32')]=_0x25f27f[_0xa556('0x32')][_0xa556('0x34')]?_0x25f27f[_0xa556('0x32')]:_0x3848f7[_0xa556('0x2d')];if(_0x3c29c8[_0xa556('0x31')][_0xa556('0x43')]){_0x25f27f['include']=[{'all':!![]}];}_0x25f27f=_['merge']({},_0x25f27f,_0x3c29c8[_0xa556('0x3f')]);return db[_0xa556('0x44')][_0xa556('0x45')](_0x25f27f)[_0xa556('0x25')](handleEntityNotFound(_0x52c581,null))[_0xa556('0x25')](respondWithResult(_0x52c581,null))[_0xa556('0x46')](handleError(_0x52c581,null));};exports[_0xa556('0x47')]=function(_0x2e51a7,_0x127f96){return db[_0xa556('0x44')][_0xa556('0x47')](_0x2e51a7['body'],{})[_0xa556('0x25')](respondWithResult(_0x127f96,0xc9))['catch'](handleError(_0x127f96,null));};exports['update']=function(_0x4aed9e,_0x54eebe){if(_0x4aed9e[_0xa556('0x48')]['id']){delete _0x4aed9e[_0xa556('0x48')]['id'];}return db[_0xa556('0x44')][_0xa556('0x45')]({'where':{'id':_0x4aed9e[_0xa556('0x42')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x54eebe,null))[_0xa556('0x25')](saveUpdates(_0x4aed9e['body'],null))[_0xa556('0x25')](respondWithResult(_0x54eebe,null))['catch'](handleError(_0x54eebe,null));};exports['destroy']=function(_0x39f50e,_0x190663){return db[_0xa556('0x44')][_0xa556('0x45')]({'where':{'id':_0x39f50e['params']['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x190663,null))['then'](removeEntity(_0x190663,null))[_0xa556('0x46')](handleError(_0x190663,null));};exports[_0xa556('0x49')]=function(_0x1907b2,_0x3d9be6){return db[_0xa556('0x44')]['describe']()[_0xa556('0x25')](respondWithResult(_0x3d9be6,null))[_0xa556('0x46')](handleError(_0x3d9be6,null));}; \ No newline at end of file +var _0x0efe=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','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','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x0efe,0x18e));var _0xe0ef=function(_0x28c608,_0x57ca4a){_0x28c608=_0x28c608-0x0;var _0x16fa25=_0x0efe[_0x28c608];return _0x16fa25;};'use strict';var emlformat=require(_0xe0ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0ef('0x1'));var jsonpatch=require(_0xe0ef('0x2'));var rp=require(_0xe0ef('0x3'));var moment=require(_0xe0ef('0x4'));var BPromise=require(_0xe0ef('0x5'));var Mustache=require(_0xe0ef('0x6'));var util=require('util');var path=require(_0xe0ef('0x7'));var sox=require('sox');var csv=require(_0xe0ef('0x8'));var ejs=require(_0xe0ef('0x9'));var fs=require('fs');var fs_extra=require(_0xe0ef('0xa'));var _=require('lodash');var squel=require(_0xe0ef('0xb'));var crypto=require(_0xe0ef('0xc'));var jsforce=require(_0xe0ef('0xd'));var deskjs=require(_0xe0ef('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe0ef('0xf'));var Redis=require(_0xe0ef('0x10'));var authService=require(_0xe0ef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0ef('0x12'));var hardwareService=require(_0xe0ef('0x13'));var logger=require(_0xe0ef('0x14'))(_0xe0ef('0x15'));var utils=require(_0xe0ef('0x16'));var config=require(_0xe0ef('0x17'));var licenseUtil=require(_0xe0ef('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e1e5e,_0x509040){_0x509040=_0x509040||0xcc;return function(_0x21e797){if(_0x21e797){return _0x3e1e5e['sendStatus'](_0x509040);}return _0x3e1e5e[_0xe0ef('0x19')](_0x509040)[_0xe0ef('0x1a')]();};}function respondWithResult(_0x2eb9c6,_0x351db8){_0x351db8=_0x351db8||0xc8;return function(_0x4951c5){if(_0x4951c5){return _0x2eb9c6[_0xe0ef('0x19')](_0x351db8)[_0xe0ef('0x1b')](_0x4951c5);}};}function respondWithFilteredResult(_0x3ae2bc,_0x2297e8){return function(_0x519047){if(_0x519047){var _0x4311ca=typeof _0x2297e8[_0xe0ef('0x1c')]===_0xe0ef('0x1d')&&typeof _0x2297e8['limit']===_0xe0ef('0x1d');var _0x3a27c0=_0x519047['count'];var _0x4ce769=_0x4311ca?0x0:_0x2297e8['offset'];var _0x684b3=_0x4311ca?_0x519047[_0xe0ef('0x1e')]:_0x2297e8[_0xe0ef('0x1c')]+_0x2297e8[_0xe0ef('0x1f')];var _0x3e3fc4;if(_0x684b3>=_0x3a27c0){_0x684b3=_0x3a27c0;_0x3e3fc4=0xc8;}else{_0x3e3fc4=0xce;}_0x3ae2bc[_0xe0ef('0x19')](_0x3e3fc4);return _0x3ae2bc[_0xe0ef('0x20')](_0xe0ef('0x21'),_0x4ce769+'-'+_0x684b3+'/'+_0x3a27c0)['json'](_0x519047);}return null;};}function patchUpdates(_0x32ba45){return function(_0x32ab22){try{jsonpatch['apply'](_0x32ab22,_0x32ba45,!![]);}catch(_0x1708ce){return BPromise[_0xe0ef('0x22')](_0x1708ce);}return _0x32ab22[_0xe0ef('0x23')]();};}function saveUpdates(_0x18856d,_0x10b423){return function(_0x35f624){if(_0x35f624){return _0x35f624[_0xe0ef('0x24')](_0x18856d)[_0xe0ef('0x25')](function(_0x1497e0){return _0x1497e0;});}return null;};}function removeEntity(_0x33a384,_0x57918d){return function(_0x19452a){if(_0x19452a){return _0x19452a['destroy']()[_0xe0ef('0x25')](function(){_0x33a384[_0xe0ef('0x19')](0xcc)[_0xe0ef('0x1a')]();});}};}function handleEntityNotFound(_0x43de58,_0x57983d){return function(_0x485c5a){if(!_0x485c5a){_0x43de58[_0xe0ef('0x26')](0x194);}return _0x485c5a;};}function handleError(_0x283720,_0x5a3f7e){_0x5a3f7e=_0x5a3f7e||0x1f4;return function(_0x3d9e25){logger[_0xe0ef('0x27')](_0x3d9e25[_0xe0ef('0x28')]);if(_0x3d9e25['name']){delete _0x3d9e25[_0xe0ef('0x29')];}_0x283720[_0xe0ef('0x19')](_0x5a3f7e)[_0xe0ef('0x2a')](_0x3d9e25);};}exports[_0xe0ef('0x2b')]=function(_0x347211,_0xaafdc8){var _0x4a8528={},_0x2aed7b={},_0x216279={'count':0x0,'rows':[]};var _0x516a4b=_[_0xe0ef('0x2c')](db[_0xe0ef('0x2d')][_0xe0ef('0x2e')],function(_0x58f64a){return{'name':_0x58f64a['fieldName'],'type':_0x58f64a['type'][_0xe0ef('0x2f')]};});_0x2aed7b[_0xe0ef('0x30')]=_[_0xe0ef('0x2c')](_0x516a4b,'name');_0x2aed7b[_0xe0ef('0x31')]=_['keys'](_0x347211[_0xe0ef('0x31')]);_0x2aed7b[_0xe0ef('0x32')]=_[_0xe0ef('0x33')](_0x2aed7b['model'],_0x2aed7b['query']);_0x4a8528['attributes']=_[_0xe0ef('0x33')](_0x2aed7b[_0xe0ef('0x30')],qs['fields'](_0x347211['query']['fields']));_0x4a8528['attributes']=_0x4a8528[_0xe0ef('0x34')][_0xe0ef('0x35')]?_0x4a8528[_0xe0ef('0x34')]:_0x2aed7b[_0xe0ef('0x30')];if(!_0x347211[_0xe0ef('0x31')][_0xe0ef('0x36')](_0xe0ef('0x37'))){_0x4a8528[_0xe0ef('0x1f')]=qs[_0xe0ef('0x1f')](_0x347211[_0xe0ef('0x31')][_0xe0ef('0x1f')]);_0x4a8528['offset']=qs[_0xe0ef('0x1c')](_0x347211[_0xe0ef('0x31')]['offset']);}_0x4a8528['order']=qs[_0xe0ef('0x38')](_0x347211[_0xe0ef('0x31')][_0xe0ef('0x38')]);_0x4a8528[_0xe0ef('0x39')]=qs[_0xe0ef('0x32')](_['pick'](_0x347211['query'],_0x2aed7b[_0xe0ef('0x32')]),_0x516a4b);if(_0x347211[_0xe0ef('0x31')][_0xe0ef('0x3a')]){_0x4a8528['where']=_[_0xe0ef('0x3b')](_0x4a8528['where'],{'$or':_[_0xe0ef('0x2c')](_0x516a4b,function(_0x1d8e79){if(_0x1d8e79[_0xe0ef('0x3c')]!==_0xe0ef('0x3d')){var _0x4c9b16={};_0x4c9b16[_0x1d8e79[_0xe0ef('0x29')]]={'$like':'%'+_0x347211[_0xe0ef('0x31')]['filter']+'%'};return _0x4c9b16;}})});}_0x4a8528=_['merge']({},_0x4a8528,_0x347211[_0xe0ef('0x3e')]);var _0x47b02b={'where':_0x4a8528[_0xe0ef('0x39')]};return db['VoiceTransferReport'][_0xe0ef('0x1e')](_0x47b02b)[_0xe0ef('0x25')](function(_0xc739c7){_0x216279['count']=_0xc739c7;if(_0x347211[_0xe0ef('0x31')][_0xe0ef('0x3f')]){_0x4a8528[_0xe0ef('0x40')]=[{'all':!![]}];}return db[_0xe0ef('0x2d')][_0xe0ef('0x41')](_0x4a8528);})[_0xe0ef('0x25')](function(_0x13b708){_0x216279['rows']=_0x13b708;return _0x216279;})[_0xe0ef('0x25')](respondWithFilteredResult(_0xaafdc8,_0x4a8528))[_0xe0ef('0x42')](handleError(_0xaafdc8,null));};exports[_0xe0ef('0x43')]=function(_0xfa5b17,_0x474888){var _0x721bfb={'raw':!![],'where':{'id':_0xfa5b17[_0xe0ef('0x44')]['id']}},_0x258a89={};_0x258a89[_0xe0ef('0x30')]=_[_0xe0ef('0x45')](db[_0xe0ef('0x2d')]['rawAttributes']);_0x258a89['query']=_[_0xe0ef('0x45')](_0xfa5b17[_0xe0ef('0x31')]);_0x258a89[_0xe0ef('0x32')]=_[_0xe0ef('0x33')](_0x258a89[_0xe0ef('0x30')],_0x258a89['query']);_0x721bfb[_0xe0ef('0x34')]=_[_0xe0ef('0x33')](_0x258a89[_0xe0ef('0x30')],qs[_0xe0ef('0x46')](_0xfa5b17[_0xe0ef('0x31')][_0xe0ef('0x46')]));_0x721bfb[_0xe0ef('0x34')]=_0x721bfb[_0xe0ef('0x34')]['length']?_0x721bfb[_0xe0ef('0x34')]:_0x258a89[_0xe0ef('0x30')];if(_0xfa5b17[_0xe0ef('0x31')][_0xe0ef('0x3f')]){_0x721bfb[_0xe0ef('0x40')]=[{'all':!![]}];}_0x721bfb=_[_0xe0ef('0x3b')]({},_0x721bfb,_0xfa5b17[_0xe0ef('0x3e')]);return db[_0xe0ef('0x2d')][_0xe0ef('0x47')](_0x721bfb)[_0xe0ef('0x25')](handleEntityNotFound(_0x474888,null))[_0xe0ef('0x25')](respondWithResult(_0x474888,null))[_0xe0ef('0x42')](handleError(_0x474888,null));};exports[_0xe0ef('0x48')]=function(_0xc668a9,_0x8964bd){return db['VoiceTransferReport'][_0xe0ef('0x48')](_0xc668a9['body'],{})[_0xe0ef('0x25')](respondWithResult(_0x8964bd,0xc9))['catch'](handleError(_0x8964bd,null));};exports[_0xe0ef('0x24')]=function(_0xfd2c82,_0x367913){if(_0xfd2c82[_0xe0ef('0x49')]['id']){delete _0xfd2c82[_0xe0ef('0x49')]['id'];}return db[_0xe0ef('0x2d')][_0xe0ef('0x47')]({'where':{'id':_0xfd2c82['params']['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x367913,null))[_0xe0ef('0x25')](saveUpdates(_0xfd2c82[_0xe0ef('0x49')],null))[_0xe0ef('0x25')](respondWithResult(_0x367913,null))['catch'](handleError(_0x367913,null));};exports[_0xe0ef('0x4a')]=function(_0x51cb89,_0x98b622){return db[_0xe0ef('0x2d')][_0xe0ef('0x47')]({'where':{'id':_0x51cb89[_0xe0ef('0x44')]['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x98b622,null))[_0xe0ef('0x25')](removeEntity(_0x98b622,null))[_0xe0ef('0x42')](handleError(_0x98b622,null));};exports['describe']=function(_0x5688d7,_0x50137c){return db[_0xe0ef('0x2d')][_0xe0ef('0x4b')]()[_0xe0ef('0x25')](respondWithResult(_0x50137c,null))[_0xe0ef('0x42')](handleError(_0x50137c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b2b559c..b4300dc 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 _0x31dd=['moment','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','util','../../config/logger'];(function(_0xfa3bbd,_0x2e97cf){var _0x2dd3ab=function(_0x2abae6){while(--_0x2abae6){_0xfa3bbd['push'](_0xfa3bbd['shift']());}};_0x2dd3ab(++_0x2e97cf);}(_0x31dd,0x1e2));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd31d('0x0'));var logger=require(_0xd31d('0x1'))('api');var moment=require(_0xd31d('0x2'));var BPromise=require(_0xd31d('0x3'));var rp=require(_0xd31d('0x4'));var fs=require('fs');var path=require(_0xd31d('0x5'));var rimraf=require(_0xd31d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd31d('0x7'));module[_0xd31d('0x8')]=function(_0x249d2e,_0x292b88){return _0x249d2e['define'](_0xd31d('0x9'),attributes,{'tableName':_0xd31d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d92=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9d92,0x1c1));var _0x29d9=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0x9d92[_0x596f6e];return _0x1e0803;};'use strict';var _=require(_0x29d9('0x0'));var util=require(_0x29d9('0x1'));var logger=require(_0x29d9('0x2'))(_0x29d9('0x3'));var moment=require(_0x29d9('0x4'));var BPromise=require(_0x29d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d9('0x6'));var rimraf=require('rimraf');var config=require(_0x29d9('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x557463,_0x49d1e5){return _0x557463['define'](_0x29d9('0x8'),attributes,{'tableName':_0x29d9('0x9'),'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 7a1272f..fccd28e 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 _0xa781=['message','result','VoiceTransferReport','create','raw','CreateVoiceTransferReport','debug','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa781,0xe9));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a78('0x0'));var util=require('util');var moment=require(_0x1a78('0x1'));var BPromise=require(_0x1a78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a78('0x3'))['db'];var utils=require(_0x1a78('0x4'));var logger=require(_0x1a78('0x5'))(_0x1a78('0x6'));var config=require(_0x1a78('0x7'));var jayson=require(_0x1a78('0x8'));var client=jayson[_0x1a78('0x9')][_0x1a78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51edbd,_0x107d3c,_0x1bcb83){return new BPromise(function(_0x54a0ac,_0x4837ff){return client['request'](_0x51edbd,_0x1bcb83)[_0x1a78('0xb')](function(_0x15d198){logger[_0x1a78('0xc')](_0x1a78('0xd'),_0x107d3c,_0x1a78('0xe'));logger['debug'](_0x1a78('0xf'),_0x107d3c,_0x1a78('0xe'),JSON['stringify'](_0x15d198));if(_0x15d198[_0x1a78('0x10')]){if(_0x15d198[_0x1a78('0x10')]['code']===0x1f4){logger['error'](_0x1a78('0xd'),_0x107d3c,_0x15d198[_0x1a78('0x10')][_0x1a78('0x11')]);return _0x4837ff(_0x15d198[_0x1a78('0x10')][_0x1a78('0x11')]);}logger[_0x1a78('0x10')](_0x1a78('0xd'),_0x107d3c,_0x15d198[_0x1a78('0x10')]['message']);return _0x54a0ac(_0x15d198[_0x1a78('0x10')][_0x1a78('0x11')]);}else{logger['info'](_0x1a78('0xd'),_0x107d3c,'request\x20sent');_0x54a0ac(_0x15d198[_0x1a78('0x12')][_0x1a78('0x11')]);}})['catch'](function(_0x2be9d5){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x107d3c,_0x2be9d5);_0x4837ff(_0x2be9d5);});});}exports['CreateVoiceTransferReport']=function(_0x568fd1){var _0x1b4fdb=this;return new Promise(function(_0x2e4e79,_0xa09ad9){return db[_0x1a78('0x13')][_0x1a78('0x14')](_0x568fd1['body'],{'raw':_0x568fd1['options']?_0x568fd1['options'][_0x1a78('0x15')]===undefined?!![]:![]:!![]})[_0x1a78('0xb')](function(_0x3cefbc){logger[_0x1a78('0xc')](_0x1a78('0x16'),_0x568fd1);logger[_0x1a78('0x17')](_0x1a78('0x16'),_0x568fd1,JSON['stringify'](_0x3cefbc));_0x2e4e79(_0x3cefbc);})[_0x1a78('0x18')](function(_0x2dac76){logger['error'](_0x1a78('0x16'),_0x2dac76[_0x1a78('0x11')],_0x568fd1);_0xa09ad9(_0x1b4fdb[_0x1a78('0x10')](0x1f4,_0x2dac76['message']));});});}; \ No newline at end of file +var _0xec5a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','VoiceTransferReport','create','raw','CreateVoiceTransferReport','lodash','util','moment'];(function(_0x42a8aa,_0x42769f){var _0xb99781=function(_0x3eae79){while(--_0x3eae79){_0x42a8aa['push'](_0x42a8aa['shift']());}};_0xb99781(++_0x42769f);}(_0xec5a,0x115));var _0xaec5=function(_0x5150de,_0x548b82){_0x5150de=_0x5150de-0x0;var _0x18d864=_0xec5a[_0x5150de];return _0x18d864;};'use strict';var _=require(_0xaec5('0x0'));var util=require(_0xaec5('0x1'));var moment=require(_0xaec5('0x2'));var BPromise=require('bluebird');var rs=require(_0xaec5('0x3'));var fs=require('fs');var Redis=require(_0xaec5('0x4'));var db=require(_0xaec5('0x5'))['db'];var utils=require(_0xaec5('0x6'));var logger=require(_0xaec5('0x7'))(_0xaec5('0x8'));var config=require(_0xaec5('0x9'));var jayson=require(_0xaec5('0xa'));var client=jayson[_0xaec5('0xb')][_0xaec5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59470c,_0x171efb,_0x347fbd){return new BPromise(function(_0x4c77ea,_0x11f11d){return client[_0xaec5('0xd')](_0x59470c,_0x347fbd)[_0xaec5('0xe')](function(_0x200076){logger[_0xaec5('0xf')](_0xaec5('0x10'),_0x171efb,_0xaec5('0x11'));logger[_0xaec5('0x12')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x171efb,_0xaec5('0x11'),JSON[_0xaec5('0x13')](_0x200076));if(_0x200076['error']){if(_0x200076['error'][_0xaec5('0x14')]===0x1f4){logger[_0xaec5('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x171efb,_0x200076[_0xaec5('0x15')][_0xaec5('0x16')]);return _0x11f11d(_0x200076['error'][_0xaec5('0x16')]);}logger[_0xaec5('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x171efb,_0x200076['error'][_0xaec5('0x16')]);return _0x4c77ea(_0x200076[_0xaec5('0x15')][_0xaec5('0x16')]);}else{logger[_0xaec5('0xf')](_0xaec5('0x10'),_0x171efb,'request\x20sent');_0x4c77ea(_0x200076['result'][_0xaec5('0x16')]);}})[_0xaec5('0x17')](function(_0x70348d){logger[_0xaec5('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x171efb,_0x70348d);_0x11f11d(_0x70348d);});});}exports['CreateVoiceTransferReport']=function(_0x45ebb2){var _0x1fdc7b=this;return new Promise(function(_0x4f6122,_0x39924c){return db[_0xaec5('0x18')][_0xaec5('0x19')](_0x45ebb2['body'],{'raw':_0x45ebb2['options']?_0x45ebb2['options'][_0xaec5('0x1a')]===undefined?!![]:![]:!![]})[_0xaec5('0xe')](function(_0x35b2c9){logger[_0xaec5('0xf')](_0xaec5('0x1b'),_0x45ebb2);logger['debug']('CreateVoiceTransferReport',_0x45ebb2,JSON['stringify'](_0x35b2c9));_0x4f6122(_0x35b2c9);})[_0xaec5('0x17')](function(_0x3ae9ef){logger['error'](_0xaec5('0x1b'),_0x3ae9ef['message'],_0x45ebb2);_0x39924c(_0x1fdc7b['error'](0x1f4,_0x3ae9ef[_0xaec5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 6d03962..e09a7fe 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 _0xe2bb=['/answer','answer','/hold','hold','/unhold','calls','/transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','originate','/hangup','isAuthenticated','canUpdate','hangup'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xe2bb,0x14b));var _0xbe2b=function(_0x401022,_0x89023e){_0x401022=_0x401022-0x0;var _0x285bf1=_0xe2bb[_0x401022];return _0x285bf1;};'use strict';var express=require(_0xbe2b('0x0'));var router=express[_0xbe2b('0x1')]();var auth=require(_0xbe2b('0x2'));var controller=require(_0xbe2b('0x3'));router[_0xbe2b('0x4')](_0xbe2b('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xbe2b('0x6')]);router[_0xbe2b('0x4')](_0xbe2b('0x7'),auth[_0xbe2b('0x8')](),auth[_0xbe2b('0x9')](),controller[_0xbe2b('0xa')]);router[_0xbe2b('0x4')](_0xbe2b('0xb'),auth[_0xbe2b('0x8')](),auth[_0xbe2b('0x9')](),controller[_0xbe2b('0xc')]);router['post'](_0xbe2b('0xd'),auth[_0xbe2b('0x8')](),auth[_0xbe2b('0x9')](),controller[_0xbe2b('0xe')]);router[_0xbe2b('0x4')](_0xbe2b('0xf'),auth[_0xbe2b('0x8')](),auth['canUpdate'](),controller['unhold']);router[_0xbe2b('0x4')]('/calls',auth[_0xbe2b('0x8')](),auth[_0xbe2b('0x9')](),controller[_0xbe2b('0x10')]);router[_0xbe2b('0x4')](_0xbe2b('0x11'),auth[_0xbe2b('0x8')](),auth['canUpdate'](),controller['transfer']);module[_0xbe2b('0x12')]=router; \ No newline at end of file +var _0xa47e=['/unhold','unhold','/calls','/transfer','transfer','exports','express','Router','/originate','isAuthenticated','post','/hangup','canUpdate','hangup','/answer','answer'];(function(_0x12e700,_0x45d65f){var _0x49f00b=function(_0x3f134b){while(--_0x3f134b){_0x12e700['push'](_0x12e700['shift']());}};_0x49f00b(++_0x45d65f);}(_0xa47e,0xa6));var _0xea47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa47e[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xea47('0x0'));var router=express[_0xea47('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xea47('0x2'),auth[_0xea47('0x3')](),auth['canUpdate'](),controller['originate']);router[_0xea47('0x4')](_0xea47('0x5'),auth['isAuthenticated'](),auth[_0xea47('0x6')](),controller[_0xea47('0x7')]);router['post'](_0xea47('0x8'),auth['isAuthenticated'](),auth[_0xea47('0x6')](),controller[_0xea47('0x9')]);router[_0xea47('0x4')]('/hold',auth[_0xea47('0x3')](),auth[_0xea47('0x6')](),controller['hold']);router[_0xea47('0x4')](_0xea47('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xea47('0xb')]);router[_0xea47('0x4')](_0xea47('0xc'),auth[_0xea47('0x3')](),auth['canUpdate'](),controller['calls']);router['post'](_0xea47('0xd'),auth[_0xea47('0x3')](),auth[_0xea47('0x6')](),controller[_0xea47('0xe')]);module[_0xea47('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8b162e1..477be3d 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 _0xe812=['webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','entityFound:','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transfer\x20executed!','lodash','../../mysqldb','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','format','user:%s'];(function(_0x107ff6,_0x4ccaef){var _0x27ae63=function(_0x25f590){while(--_0x25f590){_0x107ff6['push'](_0x107ff6['shift']());}};_0x27ae63(++_0x4ccaef);}(_0xe812,0x1f2));var _0x2e81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe812[_0x167cc1];return _0x10bc4b;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x2e81('0x0'));var db=require(_0x2e81('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x2e81('0x2'));var jayson=require(_0x2e81('0x3'));var amiClient=jayson['client'][_0x2e81('0x4')]({'port':0x232a});var logger=require(_0x2e81('0x5'))('webbarapi');var Redis=require(_0x2e81('0x6'));config[_0x2e81('0x7')]=_['defaults'](config[_0x2e81('0x7')],{'host':_0x2e81('0x8'),'port':0x18eb});var io=require(_0x2e81('0x9'))(new Redis(config['redis']));var Schema=require(_0x2e81('0xa'));var originateValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]},'callNumber':{'type':_0x2e81('0xd'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x2e81('0xd')},'callbackUrl':{'type':_0x2e81('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]},'sessionId':{'type':_0x2e81('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]},'sessionId':{'type':_0x2e81('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]},'sessionId':{'type':_0x2e81('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2e81('0xd'),'required':[!![],_0x2e81('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2e81('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]},'sessionId':{'type':_0x2e81('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],_0x2e81('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2e81('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0xc4d315,_0x258749,_0x52b5e4){logger[_0x2e81('0xf')](_0xc4d315,_0x258749,JSON['stringify'](_0x52b5e4));io['to'](_0xc4d315)[_0x2e81('0x10')](_0x258749,_0x52b5e4);}function handleError(_0xaa8034){return function(_0x4c1b11){console[_0x2e81('0x11')](_0x2e81('0x12'),_0x4c1b11,_0x4c1b11 instanceof RangeError);logger[_0x2e81('0x13')](_0x4c1b11[_0x2e81('0x14')]);if(_0x4c1b11 instanceof RangeError){if(_0x4c1b11[_0x2e81('0x15')]){delete _0x4c1b11[_0x2e81('0x15')];}_0xaa8034[_0x2e81('0x16')](0x194)[_0x2e81('0x17')](_0x4c1b11);}else{if(_0x4c1b11[_0x2e81('0x15')]){delete _0x4c1b11[_0x2e81('0x15')];}_0xaa8034['status'](0x1f4)[_0x2e81('0x17')](_0x4c1b11);}};}function checkError(){return function(_0x23957a){if(!_0x23957a){throw new RangeError(_0x2e81('0x18'));}return _0x23957a;};}function respondWithRpcPromise(_0x65be57,_0x11daeb){return new BPromise(function(_0x386721,_0x18b9be){var _0x39ffa8=amiClient;return _0x39ffa8['request'](_0x65be57,_0x11daeb)[_0x2e81('0x19')](function(_0x49e9f1){if(_0x49e9f1[_0x2e81('0x13')]){if(_0x49e9f1['error'][_0x2e81('0x1a')]===0x1f4){return _0x18b9be(_0x49e9f1['error']['message']);}return _0x386721(_0x49e9f1[_0x2e81('0x13')][_0x2e81('0x1b')]);}else{_0x386721(_0x49e9f1['result']);}})[_0x2e81('0x1c')](function(_0x19b1a9){_0x18b9be(_0x19b1a9);});});}function getAgent(_0x1c4547){return db[_0x2e81('0x1d')][_0x2e81('0x1e')]({'where':{'id':_0x1c4547,'role':_0x2e81('0x1f')}})[_0x2e81('0x19')](checkError());}function getAgentCheckSession(_0x4669aa,_0x1b34db){return new BPromise(function(_0x1bf5a6,_0x3c0066){var _0xc0720f=respondWithRpcPromise(_0x2e81('0x20'));var _0x3ec91d=getAgent(_0x4669aa);Promise['all']([_0xc0720f,_0x3ec91d])['then'](function(_0xfc7ce3){var _0x38cbc2=_0xfc7ce3[0x0];var _0x20ef21=_0xfc7ce3[0x1];var _0x1eb8f6=_[_0x2e81('0x21')](_0x38cbc2[_0x2e81('0x22')],function(_0x243b20){return _0x243b20[_0x2e81('0x23')]==_0x20ef21['id']&&_0x243b20[_0x2e81('0x24')]==_0x1b34db;});if(_0x1eb8f6[_0x2e81('0x25')]==0x1){_0x1bf5a6(_0x20ef21);}else{_0x3c0066(new RangeError(_0x2e81('0x26')+_0x1b34db+'\x20not\x20found!'));}});});}exports[_0x2e81('0x27')]=function(_0x115b08,_0x1d0437){logger[_0x2e81('0xf')](_0x2e81('0x28'),_0x115b08[_0x2e81('0x29')]);var _0x2fad97=originateValidation[_0x2e81('0xa')](_0x115b08[_0x2e81('0x29')]);if(_0x2fad97[_0x2e81('0x25')]>0x0){return _0x1d0437[_0x2e81('0x16')](0x190)[_0x2e81('0x2a')](_0x2fad97);}var _0x1c24f1=_0x115b08[_0x2e81('0x29')][_0x2e81('0x2b')];var _0x1be530=_0x115b08[_0x2e81('0x29')]['callNumber'];var _0x371e5d=_0x115b08[_0x2e81('0x29')]['callerId'];var _0x215d57=_0x115b08[_0x2e81('0x29')]['callbackUrl'];return getAgent(_0x1c24f1)[_0x2e81('0x19')](function(_0x36ccb7){logger[_0x2e81('0xf')]('entityFound:',_0x36ccb7[_0x2e81('0x15')]);emit(util[_0x2e81('0x2c')](_0x2e81('0x2d'),_0x36ccb7[_0x2e81('0x15')]),_0x2e81('0x2e'),{'callNumber':_0x1be530,'callerId':_0x371e5d,'callbackUrl':_0x215d57});return _0x1d0437['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x1d0437));};exports[_0x2e81('0x2f')]=function(_0x5493d7,_0x4c7ff6){logger[_0x2e81('0xf')](_0x2e81('0x30'),_0x5493d7[_0x2e81('0x29')]);var _0x50e75f=hangupValidation[_0x2e81('0xa')](_0x5493d7[_0x2e81('0x29')]);if(_0x50e75f[_0x2e81('0x25')]>0x0){return _0x4c7ff6[_0x2e81('0x16')](0x190)[_0x2e81('0x2a')](_0x50e75f);}var _0x4b0a7f=_0x5493d7['body'][_0x2e81('0x2b')];var _0x35a2e5=_0x5493d7[_0x2e81('0x29')]['sessionId'];return getAgent(_0x4b0a7f)[_0x2e81('0x19')](function(_0x44d10c){logger[_0x2e81('0xf')]('entityFound:',_0x44d10c[_0x2e81('0x15')]);emit(util[_0x2e81('0x2c')](_0x2e81('0x2d'),_0x44d10c[_0x2e81('0x15')]),_0x2e81('0x31'),{'sessionId':_0x35a2e5});return _0x4c7ff6[_0x2e81('0x16')](0xc8)[_0x2e81('0x2a')]({'error':![],'message':_0x2e81('0x32')});})['catch'](handleError(_0x4c7ff6));};exports['answer']=function(_0xfb706a,_0x507936){logger[_0x2e81('0xf')](_0x2e81('0x33'),_0xfb706a[_0x2e81('0x29')]);var _0x42154f=answerValidation[_0x2e81('0xa')](_0xfb706a[_0x2e81('0x29')]);if(_0x42154f['length']>0x0){return _0x507936['status'](0x190)[_0x2e81('0x2a')](_0x42154f);}var _0x2bc2a7=_0xfb706a[_0x2e81('0x29')]['userId'];var _0x4499b7=_0xfb706a[_0x2e81('0x29')]['sessionId'];return getAgent(_0x2bc2a7)[_0x2e81('0x19')](function(_0x4b5c2d){logger[_0x2e81('0xf')](_0x2e81('0x34'),_0x4b5c2d[_0x2e81('0x15')]);emit(util[_0x2e81('0x2c')]('user:%s',_0x4b5c2d[_0x2e81('0x15')]),'webbar:answer',{'sessionId':_0x4499b7});return _0x507936[_0x2e81('0x16')](0xc8)[_0x2e81('0x2a')]({'error':![],'message':'answer\x20executed!'});})[_0x2e81('0x1c')](handleError(_0x507936));};exports[_0x2e81('0x35')]=function(_0x15ec68,_0x3cee87){logger[_0x2e81('0xf')](_0x2e81('0x36'),_0x15ec68[_0x2e81('0x29')]);var _0x4cd20c=holdValidation[_0x2e81('0xa')](_0x15ec68['body']);if(_0x4cd20c['length']>0x0){return _0x3cee87[_0x2e81('0x16')](0x190)['json'](_0x4cd20c);}var _0x551ad0=_0x15ec68[_0x2e81('0x29')][_0x2e81('0x2b')];var _0x36aae0=_0x15ec68['body']['sessionId'];return getAgent(_0x551ad0)[_0x2e81('0x19')](function(_0x1dd4d7){logger[_0x2e81('0xf')](_0x2e81('0x34'),_0x1dd4d7['name']);emit(util['format'](_0x2e81('0x2d'),_0x1dd4d7[_0x2e81('0x15')]),'webbar:hold',{'sessionId':_0x36aae0});return _0x3cee87['status'](0xc8)[_0x2e81('0x2a')]({'error':![],'message':_0x2e81('0x37')});})['catch'](handleError(_0x3cee87));};exports[_0x2e81('0x38')]=function(_0x33a4d7,_0x25b243){logger[_0x2e81('0xf')](_0x2e81('0x39'),_0x33a4d7['body']);var _0x7a56f1=unholdValidation[_0x2e81('0xa')](_0x33a4d7[_0x2e81('0x29')]);if(_0x7a56f1[_0x2e81('0x25')]>0x0){return _0x25b243['status'](0x190)['json'](_0x7a56f1);}var _0x1f5024=_0x33a4d7[_0x2e81('0x29')][_0x2e81('0x2b')];var _0x127d1b=_0x33a4d7[_0x2e81('0x29')]['sessionId'];return getAgent(_0x1f5024)[_0x2e81('0x19')](function(_0x7b48bf){logger[_0x2e81('0xf')](_0x2e81('0x34'),_0x7b48bf[_0x2e81('0x15')]);emit(util['format'](_0x2e81('0x2d'),_0x7b48bf[_0x2e81('0x15')]),'webbar:unhold',{'sessionId':_0x127d1b});return _0x25b243['status'](0xc8)[_0x2e81('0x2a')]({'error':![],'message':'unhold\x20executed!'});})[_0x2e81('0x1c')](handleError(_0x25b243));};exports[_0x2e81('0x3a')]=function(_0xba3975,_0x40d8a4){logger[_0x2e81('0xf')](_0x2e81('0x3b'),_0x40d8a4[_0x2e81('0x29')]);var _0x1570c1=callsValidation['validate'](_0xba3975[_0x2e81('0x29')]);if(_0x1570c1['length']>0x0){return _0x40d8a4[_0x2e81('0x16')](0x190)[_0x2e81('0x2a')](_0x1570c1);}var _0x56135f=_0xba3975[_0x2e81('0x29')][_0x2e81('0x2b')];var _0x56b2d0=respondWithRpcPromise(_0x2e81('0x20'));var _0x5c3b81=getAgent(_0x56135f);return Promise[_0x2e81('0x3c')]([_0x56b2d0,_0x5c3b81])[_0x2e81('0x19')](function(_0x12ae3b){var _0x3980ce=_0x12ae3b[0x0];var _0x4584b5=_0x12ae3b[0x1];var _0x4659c8=_[_0x2e81('0x21')](_0x3980ce[_0x2e81('0x22')],function(_0x4fe65c){return _0x4fe65c[_0x2e81('0x23')]==_0x4584b5['id'];});return _0x40d8a4[_0x2e81('0x16')](0xc8)[_0x2e81('0x2a')]({'count':_0x4659c8[_0x2e81('0x25')],'rows':_0x4659c8});})[_0x2e81('0x1c')](handleError(_0x40d8a4));};exports[_0x2e81('0x3d')]=function(_0x176147,_0x8a1f0f){logger[_0x2e81('0xf')](_0x2e81('0x3e'),_0x176147[_0x2e81('0x29')]);var _0x1a92be=conferenceValidation[_0x2e81('0xa')](_0x176147[_0x2e81('0x29')]);if(_0x1a92be[_0x2e81('0x25')]>0x0){return _0x8a1f0f['status'](0x190)['json'](_0x1a92be);}var _0x354e39=_0x176147[_0x2e81('0x29')][_0x2e81('0x2b')];return getAgent(_0x354e39)[_0x2e81('0x19')](function(_0x45b114){logger[_0x2e81('0xf')](_0x2e81('0x34'),_0x45b114[_0x2e81('0x15')]);emit(util['format']('user:%s',_0x45b114[_0x2e81('0x15')]),_0x2e81('0x3f'));return _0x8a1f0f['status'](0xc8)[_0x2e81('0x2a')]({'error':![],'message':_0x2e81('0x40')});})[_0x2e81('0x1c')](handleError(_0x8a1f0f));};exports[_0x2e81('0x41')]=function(_0x1f4805,_0x85a455){logger[_0x2e81('0xf')](_0x2e81('0x42'),_0x1f4805['body']);var _0x143f60=transferValidation['validate'](_0x1f4805[_0x2e81('0x29')]);if(_0x143f60[_0x2e81('0x25')]>0x0){return _0x85a455[_0x2e81('0x16')](0x190)[_0x2e81('0x2a')](_0x143f60);}var _0xafbd8c=_0x1f4805[_0x2e81('0x29')][_0x2e81('0x2b')];var _0xd0861=_0x1f4805[_0x2e81('0x29')][_0x2e81('0x24')];var _0x12ce2a=_0x1f4805[_0x2e81('0x29')]['transferNumber'];return getAgent(_0xafbd8c)[_0x2e81('0x19')](function(_0x3b1754){logger[_0x2e81('0xf')](_0x2e81('0x34'),_0x3b1754[_0x2e81('0x15')]);emit(util['format'](_0x2e81('0x2d'),_0x3b1754[_0x2e81('0x15')]),'webbar:transfer',{'sessionId':_0xd0861,'transferNumber':_0x12ce2a});return _0x85a455[_0x2e81('0x16')](0xc8)[_0x2e81('0x2a')]({'error':![],'message':_0x2e81('0x43')});})[_0x2e81('0x1c')](handleError(_0x85a455));}; \ No newline at end of file +var _0x0ba7=['client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','code','message','result','findOne','agent','then','VoiceChannels','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','hangup\x20executed!','catch','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird'];(function(_0x248cb3,_0x459c47){var _0xe0e822=function(_0x11a854){while(--_0x11a854){_0x248cb3['push'](_0x248cb3['shift']());}};_0xe0e822(++_0x459c47);}(_0x0ba7,0x16d));var _0x70ba=function(_0x4556ef,_0x1e0d2f){_0x4556ef=_0x4556ef-0x0;var _0x38f805=_0x0ba7[_0x4556ef];return _0x38f805;};'use strict';var path=require(_0x70ba('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x70ba('0x1'))['db'];var config=require(_0x70ba('0x2'));var util=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x70ba('0x5')][_0x70ba('0x6')]({'port':0x232a});var logger=require(_0x70ba('0x7'))(_0x70ba('0x8'));var Redis=require(_0x70ba('0x9'));config[_0x70ba('0xa')]=_[_0x70ba('0xb')](config[_0x70ba('0xa')],{'host':_0x70ba('0xc'),'port':0x18eb});var io=require(_0x70ba('0xd'))(new Redis(config[_0x70ba('0xa')]));var Schema=require(_0x70ba('0xe'));var originateValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'callNumber':{'type':_0x70ba('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x70ba('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x70ba('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x70ba('0x11'),'required':[!![],_0x70ba('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x70ba('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]},'sessionId':{'type':_0x70ba('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x70ba('0xf'),'required':[!![],_0x70ba('0x10')]}});function emit(_0x164521,_0x18334a,_0x3e27e8){logger[_0x70ba('0x13')](_0x164521,_0x18334a,JSON[_0x70ba('0x14')](_0x3e27e8));io['to'](_0x164521)[_0x70ba('0x15')](_0x18334a,_0x3e27e8);}function handleError(_0xb6d69a){return function(_0x5ed907){console['log']('handleError:',_0x5ed907,_0x5ed907 instanceof RangeError);logger[_0x70ba('0x16')](_0x5ed907[_0x70ba('0x17')]);if(_0x5ed907 instanceof RangeError){if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x194)[_0x70ba('0x1a')](_0x5ed907);}else{if(_0x5ed907[_0x70ba('0x18')]){delete _0x5ed907[_0x70ba('0x18')];}_0xb6d69a[_0x70ba('0x19')](0x1f4)[_0x70ba('0x1a')](_0x5ed907);}};}function checkError(){return function(_0x26c039){if(!_0x26c039){throw new RangeError(_0x70ba('0x1b'));}return _0x26c039;};}function respondWithRpcPromise(_0x2a1328,_0x4570b0){return new BPromise(function(_0x273ce4,_0x5ebe9d){var _0x3b31ef=amiClient;return _0x3b31ef[_0x70ba('0x1c')](_0x2a1328,_0x4570b0)['then'](function(_0x123b0c){if(_0x123b0c['error']){if(_0x123b0c['error'][_0x70ba('0x1d')]===0x1f4){return _0x5ebe9d(_0x123b0c['error'][_0x70ba('0x1e')]);}return _0x273ce4(_0x123b0c[_0x70ba('0x16')]['message']);}else{_0x273ce4(_0x123b0c[_0x70ba('0x1f')]);}})['catch'](function(_0x5ad828){_0x5ebe9d(_0x5ad828);});});}function getAgent(_0x39482c){return db['User'][_0x70ba('0x20')]({'where':{'id':_0x39482c,'role':_0x70ba('0x21')}})[_0x70ba('0x22')](checkError());}function getAgentCheckSession(_0x33e218,_0x2c6d18){return new BPromise(function(_0x265423,_0x5a8558){var _0x2d840e=respondWithRpcPromise(_0x70ba('0x23'));var _0x797467=getAgent(_0x33e218);Promise['all']([_0x2d840e,_0x797467])[_0x70ba('0x22')](function(_0x51b5cb){var _0x5955dc=_0x51b5cb[0x0];var _0x505f98=_0x51b5cb[0x1];var _0x77e564=_[_0x70ba('0x24')](_0x5955dc['rows'],function(_0x51b3e3){return _0x51b3e3[_0x70ba('0x25')]==_0x505f98['id']&&_0x51b3e3['sessionId']==_0x2c6d18;});if(_0x77e564[_0x70ba('0x26')]==0x1){_0x265423(_0x505f98);}else{_0x5a8558(new RangeError(_0x70ba('0x27')+_0x2c6d18+_0x70ba('0x28')));}});});}exports[_0x70ba('0x29')]=function(_0x1db0c4,_0x269943){logger[_0x70ba('0x13')](_0x70ba('0x2a'),_0x1db0c4[_0x70ba('0x2b')]);var _0x6055d3=originateValidation[_0x70ba('0xe')](_0x1db0c4['body']);if(_0x6055d3['length']>0x0){return _0x269943[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x6055d3);}var _0x943e49=_0x1db0c4['body']['userId'];var _0x507f00=_0x1db0c4[_0x70ba('0x2b')][_0x70ba('0x2d')];var _0x2200d3=_0x1db0c4['body'][_0x70ba('0x2e')];var _0x5bc56f=_0x1db0c4['body'][_0x70ba('0x2f')];return getAgent(_0x943e49)['then'](function(_0x15774e){logger[_0x70ba('0x13')]('entityFound:',_0x15774e[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x15774e['name']),_0x70ba('0x32'),{'callNumber':_0x507f00,'callerId':_0x2200d3,'callbackUrl':_0x5bc56f});return _0x269943[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x33')});})['catch'](handleError(_0x269943));};exports[_0x70ba('0x34')]=function(_0x569ae3,_0x17707a){logger[_0x70ba('0x13')](_0x70ba('0x35'),_0x569ae3[_0x70ba('0x2b')]);var _0x16ce39=hangupValidation[_0x70ba('0xe')](_0x569ae3[_0x70ba('0x2b')]);if(_0x16ce39['length']>0x0){return _0x17707a[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x16ce39);}var _0x31e713=_0x569ae3[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x473489=_0x569ae3['body'][_0x70ba('0x37')];return getAgent(_0x31e713)[_0x70ba('0x22')](function(_0x1861ed){logger['info']('entityFound:',_0x1861ed['name']);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x1861ed[_0x70ba('0x18')]),'webbar:hangup',{'sessionId':_0x473489});return _0x17707a[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x38')});})[_0x70ba('0x39')](handleError(_0x17707a));};exports[_0x70ba('0x3a')]=function(_0x54e732,_0x5ee74c){logger[_0x70ba('0x13')](_0x70ba('0x3b'),_0x54e732[_0x70ba('0x2b')]);var _0x5a1edb=answerValidation['validate'](_0x54e732[_0x70ba('0x2b')]);if(_0x5a1edb['length']>0x0){return _0x5ee74c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x5a1edb);}var _0x705ca4=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x51f4df=_0x54e732[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x705ca4)[_0x70ba('0x22')](function(_0x3dc2f7){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x3dc2f7[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x3dc2f7[_0x70ba('0x18')]),_0x70ba('0x3d'),{'sessionId':_0x51f4df});return _0x5ee74c[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':_0x70ba('0x3e')});})[_0x70ba('0x39')](handleError(_0x5ee74c));};exports['hold']=function(_0xd7638f,_0x3121f6){logger['info'](_0x70ba('0x3f'),_0xd7638f[_0x70ba('0x2b')]);var _0x3de825=holdValidation[_0x70ba('0xe')](_0xd7638f[_0x70ba('0x2b')]);if(_0x3de825[_0x70ba('0x26')]>0x0){return _0x3121f6[_0x70ba('0x19')](0x190)['json'](_0x3de825);}var _0x2e2613=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x3d1f89=_0xd7638f[_0x70ba('0x2b')][_0x70ba('0x37')];return getAgent(_0x2e2613)[_0x70ba('0x22')](function(_0x400c37){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x400c37[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x400c37[_0x70ba('0x18')]),_0x70ba('0x40'),{'sessionId':_0x3d1f89});return _0x3121f6[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x3121f6));};exports[_0x70ba('0x41')]=function(_0x2dc3c5,_0x19c99c){logger['info']('unhold\x20fired:',_0x2dc3c5['body']);var _0x471d19=unholdValidation[_0x70ba('0xe')](_0x2dc3c5['body']);if(_0x471d19['length']>0x0){return _0x19c99c[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x471d19);}var _0x3e3779=_0x2dc3c5[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4e2397=_0x2dc3c5[_0x70ba('0x2b')]['sessionId'];return getAgent(_0x3e3779)['then'](function(_0x361699){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x361699[_0x70ba('0x18')]);emit(util['format'](_0x70ba('0x31'),_0x361699[_0x70ba('0x18')]),'webbar:unhold',{'sessionId':_0x4e2397});return _0x19c99c['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x70ba('0x39')](handleError(_0x19c99c));};exports[_0x70ba('0x42')]=function(_0x1cb9c7,_0x4cc5b1){logger[_0x70ba('0x13')](_0x70ba('0x43'),_0x4cc5b1[_0x70ba('0x2b')]);var _0x5214eb=callsValidation[_0x70ba('0xe')](_0x1cb9c7[_0x70ba('0x2b')]);if(_0x5214eb['length']>0x0){return _0x4cc5b1['status'](0x190)[_0x70ba('0x2c')](_0x5214eb);}var _0x15b3ab=_0x1cb9c7[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x10e824=respondWithRpcPromise(_0x70ba('0x23'));var _0x44cb31=getAgent(_0x15b3ab);return Promise['all']([_0x10e824,_0x44cb31])[_0x70ba('0x22')](function(_0x27d101){var _0x4de412=_0x27d101[0x0];var _0x508da6=_0x27d101[0x1];var _0x137b7d=_[_0x70ba('0x24')](_0x4de412['rows'],function(_0x4ea26b){return _0x4ea26b[_0x70ba('0x25')]==_0x508da6['id'];});return _0x4cc5b1['status'](0xc8)['json']({'count':_0x137b7d[_0x70ba('0x26')],'rows':_0x137b7d});})[_0x70ba('0x39')](handleError(_0x4cc5b1));};exports[_0x70ba('0x44')]=function(_0xb03649,_0x10bb90){logger[_0x70ba('0x13')](_0x70ba('0x45'),_0xb03649['body']);var _0x46a8a6=conferenceValidation[_0x70ba('0xe')](_0xb03649[_0x70ba('0x2b')]);if(_0x46a8a6[_0x70ba('0x26')]>0x0){return _0x10bb90[_0x70ba('0x19')](0x190)[_0x70ba('0x2c')](_0x46a8a6);}var _0x5d58a1=_0xb03649[_0x70ba('0x2b')]['userId'];return getAgent(_0x5d58a1)[_0x70ba('0x22')](function(_0x4b385b){logger[_0x70ba('0x13')](_0x70ba('0x3c'),_0x4b385b[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x4b385b[_0x70ba('0x18')]),'webbar:conference');return _0x10bb90[_0x70ba('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x70ba('0x39')](handleError(_0x10bb90));};exports[_0x70ba('0x46')]=function(_0x5b1824,_0x208333){logger['info'](_0x70ba('0x47'),_0x5b1824[_0x70ba('0x2b')]);var _0x378893=transferValidation['validate'](_0x5b1824[_0x70ba('0x2b')]);if(_0x378893['length']>0x0){return _0x208333[_0x70ba('0x19')](0x190)['json'](_0x378893);}var _0x2ee3d0=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x36')];var _0x4ebc09=_0x5b1824['body'][_0x70ba('0x37')];var _0x530324=_0x5b1824[_0x70ba('0x2b')][_0x70ba('0x48')];return getAgent(_0x2ee3d0)[_0x70ba('0x22')](function(_0x32a246){logger['info'](_0x70ba('0x3c'),_0x32a246[_0x70ba('0x18')]);emit(util[_0x70ba('0x30')](_0x70ba('0x31'),_0x32a246[_0x70ba('0x18')]),_0x70ba('0x49'),{'sessionId':_0x4ebc09,'transferNumber':_0x530324});return _0x208333[_0x70ba('0x19')](0xc8)[_0x70ba('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x70ba('0x39')](handleError(_0x208333));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 06af1bd..04188cb 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 _0x5f2f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dfa62,_0x52abb4){_0x4dfa62=_0x4dfa62-0x0;var _0x7111fe=_0x5f2f[_0x4dfa62];return _0x7111fe;};'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/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getApplications']);router[_0xf5f2('0x16')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x16')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x18')]);router[_0xf5f2('0x16')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x16')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x16')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x16')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x16')]('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router['put']('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['delete'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x22')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x23')]);router[_0xf5f2('0x22')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x24')]);router['delete']('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);module[_0xf5f2('0x26')]=router; \ No newline at end of file +var _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x2c7e50,_0x3dbc6c){var _0x53c9aa=function(_0x9c016e){while(--_0x9c016e){_0x2c7e50['push'](_0x2c7e50['shift']());}};_0x53c9aa(++_0x3dbc6c);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 37b654f..b224353 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 _0xfee6=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x31c4bb,_0x49b855){var _0x3a1550=function(_0x103158){while(--_0x103158){_0x31c4bb['push'](_0x31c4bb['shift']());}};_0x3a1550(++_0x49b855);}(_0xfee6,0x8a));var _0x6fee=function(_0x40ee59,_0x3916f7){_0x40ee59=_0x40ee59-0x0;var _0x241773=_0xfee6[_0x40ee59];return _0x241773;};'use strict';var Sequelize=require(_0x6fee('0x0'));var rs=require(_0x6fee('0x1'));module[_0x6fee('0x2')]={'name':{'type':Sequelize[_0x6fee('0x3')],'unique':_0x6fee('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6fee('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6fee('0x3')],'defaultValue':function(){return rs[_0x6fee('0x5')]();}},'phone':{'type':Sequelize[_0x6fee('0x3')]},'type':{'type':Sequelize[_0x6fee('0x6')](_0x6fee('0x7'),_0x6fee('0x8'))},'accountSid':{'type':Sequelize[_0x6fee('0x3')]},'baseUrl':{'type':Sequelize[_0x6fee('0x3')]},'authToken':{'type':Sequelize[_0x6fee('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6fee('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6fee('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fee('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6fee('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6fee('0xb')],'comment':_0x6fee('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x6fee('0xa')],'defaultValue':![],'comment':_0x6fee('0xd'),'set':function(_0x2ea35a){if(!_0x2ea35a){this[_0x6fee('0xe')](_0x6fee('0xf'),null);}this[_0x6fee('0xe')](_0x6fee('0x10'),_0x2ea35a);}},'description':{'type':Sequelize[_0x6fee('0x3')]}}; \ No newline at end of file +var _0x74bb=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','name','generate','ENUM','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x82a45d,_0x10ef42){var _0x25bb71=function(_0x59595d){while(--_0x59595d){_0x82a45d['push'](_0x82a45d['shift']());}};_0x25bb71(++_0x10ef42);}(_0x74bb,0x14a));var _0xb74b=function(_0x3a0ccb,_0x4904ef){_0x3a0ccb=_0x3a0ccb-0x0;var _0x34bd52=_0x74bb[_0x3a0ccb];return _0x34bd52;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb74b('0x0')]={'name':{'type':Sequelize[_0xb74b('0x1')],'unique':_0xb74b('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb74b('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb74b('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb74b('0x4')]('twilio',_0xb74b('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xb74b('0x1')]},'authToken':{'type':Sequelize[_0xb74b('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb74b('0x6');}},'notificationSound':{'type':Sequelize[_0xb74b('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb74b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb74b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb74b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb74b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb74b('0x8')],'comment':_0xb74b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xb74b('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1aa797){if(!_0x1aa797){this['setDataValue'](_0xb74b('0xa'),null);}this[_0xb74b('0xb')](_0xb74b('0xc'),_0x1aa797);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ac153f9..0d430fc 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 _0x283d=['ids','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','getAgents','User','order','sequelize','transaction','WhatsappApplication','priority','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','message_id','asc','Applications','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','applications','close','unmanaged','*,*,*,*','created','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','\x0a','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','index','map','WhatsappAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','pick','removeDispositions','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','findOne','removeAnswers'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x283d,0x1d1));var _0xd283=function(_0x480526,_0x39dc56){_0x480526=_0x480526-0x0;var _0x572669=_0x283d[_0x480526];return _0x572669;};'use strict';var emlformat=require(_0xd283('0x0'));var rimraf=require(_0xd283('0x1'));var zipdir=require(_0xd283('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd283('0x3'));var moment=require(_0xd283('0x4'));var BPromise=require(_0xd283('0x5'));var Mustache=require(_0xd283('0x6'));var util=require(_0xd283('0x7'));var path=require(_0xd283('0x8'));var sox=require(_0xd283('0x9'));var csv=require(_0xd283('0xa'));var ejs=require(_0xd283('0xb'));var fs=require('fs');var fs_extra=require(_0xd283('0xc'));var _=require(_0xd283('0xd'));var squel=require(_0xd283('0xe'));var crypto=require(_0xd283('0xf'));var jsforce=require(_0xd283('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd283('0xa'));var querystring=require('querystring');var Papa=require(_0xd283('0x11'));var Redis=require(_0xd283('0x12'));var authService=require(_0xd283('0x13'));var qs=require(_0xd283('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd283('0x15'));var logger=require('../../config/logger')(_0xd283('0x16'));var utils=require(_0xd283('0x17'));var config=require(_0xd283('0x18'));var licenseUtil=require(_0xd283('0x19'));var db=require(_0xd283('0x1a'))['db'];config[_0xd283('0x1b')]=_[_0xd283('0x1c')](config[_0xd283('0x1b')],{'host':_0xd283('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd283('0x1e'))[_0xd283('0x1f')](socket);var jayson=require(_0xd283('0x20'));var client=jayson[_0xd283('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1aeecb,_0x1b39db,_0x26dc3c,_0x17f328){return new BPromise(function(_0x6f8b7c,_0x1c6cdd){var _0xf4d0e9=_0x17f328||client;return _0xf4d0e9['request'](_0x1aeecb,_0x26dc3c)[_0xd283('0x22')](function(_0x2b1f19){logger[_0xd283('0x23')](_0xd283('0x24'),_0x1b39db,_0xd283('0x25'));logger['debug'](_0xd283('0x26'),_0x1b39db,'request\x20sent',JSON[_0xd283('0x27')](_0x2b1f19));if(_0x2b1f19[_0xd283('0x28')]){if(_0x2b1f19[_0xd283('0x28')][_0xd283('0x29')]===0x1f4){logger[_0xd283('0x28')](_0xd283('0x24'),_0x1b39db,_0x2b1f19['error']['message']);return _0x1c6cdd(_0x2b1f19['error'][_0xd283('0x2a')]);}logger[_0xd283('0x28')](_0xd283('0x24'),_0x1b39db,_0x2b1f19[_0xd283('0x28')][_0xd283('0x2a')]);return _0x6f8b7c(_0x2b1f19['error'][_0xd283('0x2a')]);}else{logger[_0xd283('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1b39db,_0xd283('0x25'));_0x6f8b7c(_0x2b1f19[_0xd283('0x2b')][_0xd283('0x2a')]);}})[_0xd283('0x2c')](function(_0x520cb3){logger[_0xd283('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x1b39db,_0x520cb3);_0x1c6cdd(_0x520cb3);});});}function respondWithStatusCode(_0x11517a,_0xaf3c3f){_0xaf3c3f=_0xaf3c3f||0xcc;return function(_0x3cec75){if(_0x3cec75){return _0x11517a['sendStatus'](_0xaf3c3f);}return _0x11517a[_0xd283('0x2d')](_0xaf3c3f)[_0xd283('0x2e')]();};}function respondWithResult(_0x277832,_0x15dd2c){_0x15dd2c=_0x15dd2c||0xc8;return function(_0x18dd46){if(_0x18dd46){return _0x277832[_0xd283('0x2d')](_0x15dd2c)[_0xd283('0x2f')](_0x18dd46);}};}function respondWithFilteredResult(_0x14c3d5,_0x43377d){return function(_0x3bae3b){if(_0x3bae3b){var _0x24504a=typeof _0x43377d[_0xd283('0x30')]==='undefined'&&typeof _0x43377d[_0xd283('0x31')]==='undefined';var _0x55c7ae=_0x3bae3b['count'];var _0x3abc16=_0x24504a?0x0:_0x43377d['offset'];var _0x50a26b=_0x24504a?_0x3bae3b['count']:_0x43377d[_0xd283('0x30')]+_0x43377d[_0xd283('0x31')];var _0x4694a7;if(_0x50a26b>=_0x55c7ae){_0x50a26b=_0x55c7ae;_0x4694a7=0xc8;}else{_0x4694a7=0xce;}_0x14c3d5[_0xd283('0x2d')](_0x4694a7);return _0x14c3d5['set'](_0xd283('0x32'),_0x3abc16+'-'+_0x50a26b+'/'+_0x55c7ae)[_0xd283('0x2f')](_0x3bae3b);}return null;};}function patchUpdates(_0x2d606d){return function(_0x148d54){try{jsonpatch[_0xd283('0x33')](_0x148d54,_0x2d606d,!![]);}catch(_0x12bf01){return BPromise[_0xd283('0x34')](_0x12bf01);}return _0x148d54[_0xd283('0x35')]();};}function saveUpdates(_0x3dba4c,_0x206f5f){return function(_0xe9a271){if(_0xe9a271){return _0xe9a271[_0xd283('0x36')](_0x3dba4c)[_0xd283('0x22')](function(_0x24c23d){return _0x24c23d;});}return null;};}function removeEntity(_0x1f0aee,_0x4f1fa3){return function(_0x1bc87c){if(_0x1bc87c){return _0x1bc87c[_0xd283('0x37')]()[_0xd283('0x22')](function(){var _0x4ae074=_0x1bc87c[_0xd283('0x38')]({'plain':!![]});var _0x133f3a=_0xd283('0x39');return db[_0xd283('0x3a')][_0xd283('0x37')]({'where':{'type':_0x133f3a,'resourceId':_0x4ae074['id']}})[_0xd283('0x22')](function(){return _0x1bc87c;});})['then'](function(){_0x1f0aee[_0xd283('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x269689,_0x4fa3b0){return function(_0x68fef9){if(!_0x68fef9){_0x269689[_0xd283('0x3b')](0x194);}return _0x68fef9;};}function handleError(_0x5b6a39,_0x380dae){_0x380dae=_0x380dae||0x1f4;return function(_0x2f5352){logger[_0xd283('0x28')](_0x2f5352[_0xd283('0x3c')]);if(_0x2f5352[_0xd283('0x3d')]){delete _0x2f5352[_0xd283('0x3d')];}_0x5b6a39[_0xd283('0x2d')](_0x380dae)['send'](_0x2f5352);};}exports[_0xd283('0x3e')]=function(_0x560c2b,_0x435843){var _0x242961={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x534165={},_0x5992ce={'count':0x0,'rows':[]};var _0x516bef=_[_0xd283('0x3f')](db[_0xd283('0x40')]['rawAttributes'],function(_0x588908){return{'name':_0x588908[_0xd283('0x41')],'type':_0x588908[_0xd283('0x42')]['key']};});_0x534165[_0xd283('0x43')]=_[_0xd283('0x3f')](_0x516bef,_0xd283('0x3d'));_0x534165[_0xd283('0x44')]=_[_0xd283('0x45')](_0x560c2b['query']);_0x534165[_0xd283('0x46')]=_[_0xd283('0x47')](_0x534165[_0xd283('0x43')],_0x534165[_0xd283('0x44')]);_0x242961[_0xd283('0x48')]=_[_0xd283('0x47')](_0x534165[_0xd283('0x43')],qs[_0xd283('0x49')](_0x560c2b[_0xd283('0x44')][_0xd283('0x49')]));_0x242961[_0xd283('0x48')]=_0x242961['attributes'][_0xd283('0x4a')]?_0x242961[_0xd283('0x48')]:_0x534165['model'];if(!_0x560c2b[_0xd283('0x44')][_0xd283('0x4b')](_0xd283('0x4c'))){_0x242961[_0xd283('0x31')]=qs[_0xd283('0x31')](_0x560c2b[_0xd283('0x44')]['limit']);_0x242961[_0xd283('0x30')]=qs['offset'](_0x560c2b[_0xd283('0x44')][_0xd283('0x30')]);}_0x242961['order']=qs[_0xd283('0x4d')](_0x560c2b[_0xd283('0x44')][_0xd283('0x4d')]);_0x242961['where']=qs['filters'](_['pick'](_0x560c2b['query'],_0x534165[_0xd283('0x46')]),_0x516bef);if(_0x560c2b[_0xd283('0x44')][_0xd283('0x4e')]){_0x242961[_0xd283('0x4f')]=_[_0xd283('0x50')](_0x242961[_0xd283('0x4f')],{'$or':_[_0xd283('0x3f')](_0x516bef,function(_0x71fea2){if(_0x71fea2[_0xd283('0x42')]!==_0xd283('0x51')){var _0x2d0188={};_0x2d0188[_0x71fea2[_0xd283('0x3d')]]={'$like':'%'+_0x560c2b[_0xd283('0x44')]['filter']+'%'};return _0x2d0188;}})});}_0x242961=_[_0xd283('0x50')]({},_0x242961,_0x560c2b[_0xd283('0x52')]);var _0x27df53={'where':_0x242961['where']};return db[_0xd283('0x40')][_0xd283('0x53')](_0x27df53)['then'](function(_0x5e53bf){_0x5992ce[_0xd283('0x53')]=_0x5e53bf;if(_0x560c2b['query'][_0xd283('0x54')]){_0x242961[_0xd283('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xd283('0x56')](_0x242961);})[_0xd283('0x22')](function(_0x2c5bfe){_0x5992ce[_0xd283('0x57')]=_0x2c5bfe;return _0x5992ce;})['then'](respondWithFilteredResult(_0x435843,_0x242961))[_0xd283('0x2c')](handleError(_0x435843,null));};exports[_0xd283('0x58')]=function(_0x4f3f69,_0x2eeb0b){var _0x551efb={'raw':![],'where':{'id':_0x4f3f69['params']['id']},'include':[{'model':db[_0xd283('0x59')],'as':_0xd283('0x5a')}]},_0x76a5ff={};_0x76a5ff[_0xd283('0x43')]=_[_0xd283('0x45')](db[_0xd283('0x40')][_0xd283('0x5b')]);_0x76a5ff[_0xd283('0x44')]=_[_0xd283('0x45')](_0x4f3f69[_0xd283('0x44')]);_0x76a5ff['filters']=_[_0xd283('0x47')](_0x76a5ff[_0xd283('0x43')],_0x76a5ff[_0xd283('0x44')]);_0x551efb[_0xd283('0x48')]=_[_0xd283('0x47')](_0x76a5ff[_0xd283('0x43')],qs[_0xd283('0x49')](_0x4f3f69['query'][_0xd283('0x49')]));_0x551efb[_0xd283('0x48')]=_0x551efb[_0xd283('0x48')][_0xd283('0x4a')]?_0x551efb['attributes']:_0x76a5ff[_0xd283('0x43')];if(_0x4f3f69[_0xd283('0x44')][_0xd283('0x54')]){_0x551efb[_0xd283('0x55')]=[{'all':!![]}];}_0x551efb=_[_0xd283('0x50')]({},_0x551efb,_0x4f3f69[_0xd283('0x52')]);return db[_0xd283('0x40')][_0xd283('0x5c')](_0x551efb)['then'](handleEntityNotFound(_0x2eeb0b,null))[_0xd283('0x22')](respondWithResult(_0x2eeb0b,null))[_0xd283('0x2c')](handleError(_0x2eeb0b,null));};exports[_0xd283('0x5d')]=function(_0x5671db,_0xb266fe){return db[_0xd283('0x40')][_0xd283('0x5d')](_0x5671db[_0xd283('0x5e')],{})[_0xd283('0x22')](function(_0x487ddd){var _0x3b2f00=_0x5671db['user'][_0xd283('0x38')]({'plain':!![]});if(!_0x3b2f00)throw new Error(_0xd283('0x5f'));if(_0x3b2f00[_0xd283('0x60')]===_0xd283('0x61')){var _0x203ddf=_0x487ddd[_0xd283('0x38')]({'plain':!![]});var _0x242862=_0xd283('0x39');return db[_0xd283('0x62')][_0xd283('0x5c')]({'where':{'name':_0x242862,'userProfileId':_0x3b2f00[_0xd283('0x63')]},'raw':!![]})[_0xd283('0x22')](function(_0x491348){if(_0x491348&&_0x491348[_0xd283('0x64')]===0x0){return db[_0xd283('0x3a')][_0xd283('0x5d')]({'name':_0x203ddf['name'],'resourceId':_0x203ddf['id'],'type':_0x491348[_0xd283('0x3d')],'sectionId':_0x491348['id']},{})[_0xd283('0x22')](function(){return _0x487ddd;});}else{return _0x487ddd;}})[_0xd283('0x2c')](function(_0x449bd8){logger[_0xd283('0x28')](_0xd283('0x65'),_0x449bd8);throw _0x449bd8;});}return _0x487ddd;})[_0xd283('0x22')](respondWithResult(_0xb266fe,0xc9))[_0xd283('0x2c')](handleError(_0xb266fe,null));};exports['update']=function(_0x53c326,_0x49da66){if(_0x53c326['body']['id']){delete _0x53c326['body']['id'];}return db['WhatsappAccount'][_0xd283('0x5c')]({'where':{'id':_0x53c326[_0xd283('0x66')]['id']},'include':[{'model':db[_0xd283('0x59')],'as':'mandatoryDispositionPause'}]})[_0xd283('0x22')](handleEntityNotFound(_0x49da66,null))[_0xd283('0x22')](saveUpdates(_0x53c326['body'],null))['then'](respondWithResult(_0x49da66,null))[_0xd283('0x2c')](handleError(_0x49da66,null));};exports['destroy']=function(_0xfbae4b,_0x5726ad){return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0xfbae4b[_0xd283('0x66')]['id']}})['then'](handleEntityNotFound(_0x5726ad,null))[_0xd283('0x22')](removeEntity(_0x5726ad,null))['catch'](handleError(_0x5726ad,null));};exports[_0xd283('0x67')]=function(_0x23c41b,_0x4f681f){return db[_0xd283('0x40')]['describe']()[_0xd283('0x22')](respondWithResult(_0x4f681f,null))[_0xd283('0x2c')](handleError(_0x4f681f,null));};exports[_0xd283('0x68')]=function(_0x47791d,_0xadb1f0,_0x43cbc5){if(_0x47791d[_0xd283('0x5e')]['id']){delete _0x47791d[_0xd283('0x5e')]['id'];}return db[_0xd283('0x40')]['find']({'where':{'id':_0x47791d[_0xd283('0x66')]['id']}})[_0xd283('0x22')](handleEntityNotFound(_0xadb1f0,null))['then'](function(_0x1723ba){if(_0x1723ba){_0x47791d[_0xd283('0x5e')]['WhatsappAccountId']=_0x1723ba['id'];return db[_0xd283('0x69')][_0xd283('0x5d')](_0x47791d['body']);}})['then'](respondWithResult(_0xadb1f0,null))[_0xd283('0x2c')](handleError(_0xadb1f0,null));};exports['getDispositions']=function(_0x250102,_0x16bf75,_0x5245d1){var _0x2cfe67={'raw':![],'where':{}};var _0x3d1ea8={};var _0x3896bb={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x250102[_0xd283('0x66')]['id']}})[_0xd283('0x22')](handleEntityNotFound(_0x16bf75,null))[_0xd283('0x22')](function(_0x282e0b){if(_0x282e0b){_0x3d1ea8[_0xd283('0x43')]=_[_0xd283('0x45')](db[_0xd283('0x69')][_0xd283('0x5b')]);_0x3d1ea8[_0xd283('0x44')]=_[_0xd283('0x45')](_0x250102[_0xd283('0x44')]);_0x3d1ea8[_0xd283('0x46')]=_[_0xd283('0x47')](_0x3d1ea8[_0xd283('0x43')],_0x3d1ea8[_0xd283('0x44')]);_0x2cfe67[_0xd283('0x48')]=_['intersection'](_0x3d1ea8[_0xd283('0x43')],qs[_0xd283('0x49')](_0x250102[_0xd283('0x44')][_0xd283('0x49')]));_0x2cfe67[_0xd283('0x48')]=_0x2cfe67[_0xd283('0x48')][_0xd283('0x4a')]?_0x2cfe67['attributes']:_0x3d1ea8[_0xd283('0x43')];if(!_0x250102['query'][_0xd283('0x4b')](_0xd283('0x4c'))){_0x2cfe67[_0xd283('0x31')]=qs[_0xd283('0x31')](_0x250102['query'][_0xd283('0x31')]);_0x2cfe67[_0xd283('0x30')]=qs['offset'](_0x250102[_0xd283('0x44')][_0xd283('0x30')]);}_0x2cfe67['order']=qs[_0xd283('0x4d')](_0x250102[_0xd283('0x44')]['sort']);_0x2cfe67[_0xd283('0x4f')]=qs[_0xd283('0x46')](_[_0xd283('0x6a')](_0x250102['query'],_0x3d1ea8['filters']));_0x2cfe67['where']['WhatsappAccountId']=_0x282e0b['id'];if(_0x250102[_0xd283('0x44')]['filter']){_0x2cfe67[_0xd283('0x4f')]=_['merge'](_0x2cfe67[_0xd283('0x4f')],{'$or':_[_0xd283('0x3f')](_0x2cfe67[_0xd283('0x48')],function(_0x424a96){var _0x3c9175={};_0x3c9175[_0x424a96]={'$like':'%'+_0x250102['query']['filter']+'%'};return _0x3c9175;})});}_0x2cfe67=_[_0xd283('0x50')]({},_0x2cfe67,_0x250102[_0xd283('0x52')]);return db[_0xd283('0x69')]['count']({'where':_0x2cfe67[_0xd283('0x4f')]})['then'](function(_0x4f160e){_0x3896bb['count']=_0x4f160e;if(_0x250102[_0xd283('0x44')]['includeAll']){_0x2cfe67['include']=[{'all':!![]}];}return db[_0xd283('0x69')][_0xd283('0x56')](_0x2cfe67);})[_0xd283('0x22')](function(_0x374065){_0x3896bb['rows']=_0x374065;return _0x3896bb;});}})[_0xd283('0x22')](respondWithFilteredResult(_0x16bf75,_0x2cfe67))[_0xd283('0x2c')](handleError(_0x16bf75,null));};exports[_0xd283('0x6b')]=function(_0x4b182a,_0x1dc54d,_0x1d1595){return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0x4b182a[_0xd283('0x66')]['id']}})[_0xd283('0x22')](handleEntityNotFound(_0x1dc54d,null))['then'](function(_0x1d5b4a){if(_0x1d5b4a){return _0x1d5b4a[_0xd283('0x6b')](_0x4b182a[_0xd283('0x44')]['ids']);}})[_0xd283('0x22')](respondWithStatusCode(_0x1dc54d,null))[_0xd283('0x2c')](handleError(_0x1dc54d,null));};exports[_0xd283('0x6c')]=function(_0x47d9a5,_0x45a6d2,_0xa828bb){if(_0x47d9a5[_0xd283('0x5e')]['id']){delete _0x47d9a5[_0xd283('0x5e')]['id'];}return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0x47d9a5['params']['id']}})[_0xd283('0x22')](handleEntityNotFound(_0x45a6d2,null))[_0xd283('0x22')](function(_0x31e6d0){if(_0x31e6d0){_0x47d9a5['body'][_0xd283('0x6d')]=_0x31e6d0['id'];return db[_0xd283('0x6e')][_0xd283('0x5d')](_0x47d9a5['body']);}})[_0xd283('0x22')](respondWithResult(_0x45a6d2,null))[_0xd283('0x2c')](handleError(_0x45a6d2,null));};exports[_0xd283('0x6f')]=function(_0x5c1bd8,_0x4f0530,_0x47b12f){var _0x1ac6f6={'raw':![],'where':{}};var _0x248b95={};var _0x41893e={'count':0x0,'rows':[]};return db[_0xd283('0x40')][_0xd283('0x70')]({'where':{'id':_0x5c1bd8[_0xd283('0x66')]['id']}})['then'](handleEntityNotFound(_0x4f0530,null))[_0xd283('0x22')](function(_0x5c727c){if(_0x5c727c){_0x248b95['model']=_[_0xd283('0x45')](db[_0xd283('0x6e')]['rawAttributes']);_0x248b95[_0xd283('0x44')]=_[_0xd283('0x45')](_0x5c1bd8['query']);_0x248b95[_0xd283('0x46')]=_[_0xd283('0x47')](_0x248b95[_0xd283('0x43')],_0x248b95[_0xd283('0x44')]);_0x1ac6f6['attributes']=_['intersection'](_0x248b95[_0xd283('0x43')],qs['fields'](_0x5c1bd8[_0xd283('0x44')][_0xd283('0x49')]));_0x1ac6f6[_0xd283('0x48')]=_0x1ac6f6[_0xd283('0x48')]['length']?_0x1ac6f6[_0xd283('0x48')]:_0x248b95[_0xd283('0x43')];if(!_0x5c1bd8[_0xd283('0x44')][_0xd283('0x4b')](_0xd283('0x4c'))){_0x1ac6f6['limit']=qs[_0xd283('0x31')](_0x5c1bd8[_0xd283('0x44')][_0xd283('0x31')]);_0x1ac6f6[_0xd283('0x30')]=qs['offset'](_0x5c1bd8[_0xd283('0x44')][_0xd283('0x30')]);}_0x1ac6f6['order']=qs['sort'](_0x5c1bd8[_0xd283('0x44')][_0xd283('0x4d')]);_0x1ac6f6[_0xd283('0x4f')]=qs[_0xd283('0x46')](_[_0xd283('0x6a')](_0x5c1bd8[_0xd283('0x44')],_0x248b95[_0xd283('0x46')]));_0x1ac6f6[_0xd283('0x4f')]['WhatsappAccountId']=_0x5c727c['id'];if(_0x5c1bd8[_0xd283('0x44')][_0xd283('0x4e')]){_0x1ac6f6[_0xd283('0x4f')]=_[_0xd283('0x50')](_0x1ac6f6[_0xd283('0x4f')],{'$or':_['map'](_0x1ac6f6[_0xd283('0x48')],function(_0x38477e){var _0x3bf9ca={};_0x3bf9ca[_0x38477e]={'$like':'%'+_0x5c1bd8['query'][_0xd283('0x4e')]+'%'};return _0x3bf9ca;})});}_0x1ac6f6=_[_0xd283('0x50')]({},_0x1ac6f6,_0x5c1bd8[_0xd283('0x52')]);return db[_0xd283('0x6e')][_0xd283('0x53')]({'where':_0x1ac6f6[_0xd283('0x4f')]})[_0xd283('0x22')](function(_0x4eafd1){_0x41893e[_0xd283('0x53')]=_0x4eafd1;if(_0x5c1bd8[_0xd283('0x44')]['includeAll']){_0x1ac6f6['include']=[{'all':!![]}];}return db[_0xd283('0x6e')]['findAll'](_0x1ac6f6);})['then'](function(_0xb1b733){_0x41893e[_0xd283('0x57')]=_0xb1b733;return _0x41893e;});}})[_0xd283('0x22')](respondWithFilteredResult(_0x4f0530,_0x1ac6f6))[_0xd283('0x2c')](handleError(_0x4f0530,null));};exports['removeAnswers']=function(_0x2b2e1e,_0x6abc95,_0x223bf9){return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0x2b2e1e[_0xd283('0x66')]['id']}})['then'](handleEntityNotFound(_0x6abc95,null))[_0xd283('0x22')](function(_0x126985){if(_0x126985){return _0x126985[_0xd283('0x71')](_0x2b2e1e['query'][_0xd283('0x72')]);}})['then'](respondWithStatusCode(_0x6abc95,null))[_0xd283('0x2c')](handleError(_0x6abc95,null));};exports[_0xd283('0x73')]=function(_0x11217a,_0xb6c36f,_0xb2a669){return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0x11217a[_0xd283('0x66')]['id']}})[_0xd283('0x22')](handleEntityNotFound(_0xb6c36f,null))[_0xd283('0x22')](function(_0x2e5cd4){if(_0x2e5cd4){return _0x2e5cd4[_0xd283('0x73')](_0x11217a[_0xd283('0x5e')][_0xd283('0x72')],_[_0xd283('0x74')](_0x11217a[_0xd283('0x5e')],[_0xd283('0x72'),'id'])||{})[_0xd283('0x75')](function(_0x3f46f3){for(var _0x2b90e3=0x0;_0x2b90e3<_0x11217a[_0xd283('0x5e')]['ids'][_0xd283('0x4a')];_0x2b90e3+=0x1){socket['emit'](_0xd283('0x76'),{'UserId':Number(_0x11217a[_0xd283('0x5e')][_0xd283('0x72')][_0x2b90e3]),'WhatsappAccountId':Number(_0x11217a['params']['id'])});}return _0x3f46f3;});}})[_0xd283('0x22')](respondWithResult(_0xb6c36f,null))['catch'](handleError(_0xb6c36f,null));};exports[_0xd283('0x77')]=function(_0x5dd174,_0x986df3,_0x449a90){return db['WhatsappAccount'][_0xd283('0x5c')]({'where':{'id':_0x5dd174[_0xd283('0x66')]['id']}})[_0xd283('0x22')](handleEntityNotFound(_0x986df3,null))['then'](function(_0x5f274c){if(_0x5f274c){return _0x5f274c[_0xd283('0x77')](_0x5dd174['query'][_0xd283('0x72')])['then'](function(){if(_[_0xd283('0x78')](_0x5dd174[_0xd283('0x44')]['ids'])){for(var _0x42901e=0x0;_0x42901e<_0x5dd174['query']['ids'][_0xd283('0x4a')];_0x42901e+=0x1){socket[_0xd283('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x5dd174[_0xd283('0x44')]['ids'][_0x42901e]),'WhatsappAccountId':Number(_0x5dd174[_0xd283('0x66')]['id'])});}}else{socket[_0xd283('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x5dd174[_0xd283('0x44')]['ids']),'WhatsappAccountId':Number(_0x5dd174['params']['id'])});}});}})[_0xd283('0x22')](respondWithStatusCode(_0x986df3,null))[_0xd283('0x2c')](handleError(_0x986df3,null));};exports[_0xd283('0x7a')]=function(_0x2ae7fb,_0x2c9596,_0x40d84d){var _0x4e6d74={};var _0x1b9e32={};var _0x5aaf1a;var _0x21c05c;return db[_0xd283('0x40')][_0xd283('0x70')]({'where':{'id':_0x2ae7fb[_0xd283('0x66')]['id']}})['then'](handleEntityNotFound(_0x2c9596,null))[_0xd283('0x22')](function(_0x453817){if(_0x453817){_0x5aaf1a=_0x453817;_0x1b9e32[_0xd283('0x43')]=_['keys'](db[_0xd283('0x7b')][_0xd283('0x5b')]);_0x1b9e32[_0xd283('0x44')]=_[_0xd283('0x45')](_0x2ae7fb['query']);_0x1b9e32[_0xd283('0x46')]=_['intersection'](_0x1b9e32[_0xd283('0x43')],_0x1b9e32[_0xd283('0x44')]);_0x4e6d74['attributes']=_['intersection'](_0x1b9e32['model'],qs['fields'](_0x2ae7fb[_0xd283('0x44')][_0xd283('0x49')]));_0x4e6d74[_0xd283('0x48')]=_0x4e6d74[_0xd283('0x48')][_0xd283('0x4a')]?_0x4e6d74[_0xd283('0x48')]:_0x1b9e32[_0xd283('0x43')];_0x4e6d74[_0xd283('0x7c')]=qs[_0xd283('0x4d')](_0x2ae7fb[_0xd283('0x44')][_0xd283('0x4d')]);_0x4e6d74[_0xd283('0x4f')]=qs['filters'](_[_0xd283('0x6a')](_0x2ae7fb[_0xd283('0x44')],_0x1b9e32['filters']));if(_0x2ae7fb[_0xd283('0x44')][_0xd283('0x4e')]){_0x4e6d74[_0xd283('0x4f')]=_[_0xd283('0x50')](_0x4e6d74[_0xd283('0x4f')],{'$or':_['map'](_0x4e6d74[_0xd283('0x48')],function(_0x460901){var _0x4f26c5={};_0x4f26c5[_0x460901]={'$like':'%'+_0x2ae7fb['query'][_0xd283('0x4e')]+'%'};return _0x4f26c5;})});}_0x4e6d74=_[_0xd283('0x50')]({},_0x4e6d74,_0x2ae7fb[_0xd283('0x52')]);return _0x5aaf1a[_0xd283('0x7a')](_0x4e6d74);}})[_0xd283('0x22')](function(_0x2b447f){if(_0x2b447f){_0x21c05c=_0x2b447f[_0xd283('0x4a')];if(!_0x2ae7fb['query'][_0xd283('0x4b')](_0xd283('0x4c'))){_0x4e6d74[_0xd283('0x31')]=qs[_0xd283('0x31')](_0x2ae7fb[_0xd283('0x44')][_0xd283('0x31')]);_0x4e6d74[_0xd283('0x30')]=qs[_0xd283('0x30')](_0x2ae7fb[_0xd283('0x44')][_0xd283('0x30')]);}return _0x5aaf1a[_0xd283('0x7a')](_0x4e6d74);}})[_0xd283('0x22')](function(_0x22bdc4){if(_0x22bdc4){return _0x22bdc4?{'count':_0x21c05c,'rows':_0x22bdc4}:null;}})[_0xd283('0x22')](respondWithResult(_0x2c9596,null))['catch'](handleError(_0x2c9596,null));};exports['addApplications']=function(_0x1c133b,_0x12b533,_0x32c26a){return db[_0xd283('0x40')][_0xd283('0x70')]({'where':{'id':_0x1c133b[_0xd283('0x66')]['id']}})['then'](handleEntityNotFound(_0x12b533,null))[_0xd283('0x22')](function(_0x19f2c6){if(_0x19f2c6){return db[_0xd283('0x7d')][_0xd283('0x7e')](function(_0x207444){return db['WhatsappApplication'][_0xd283('0x37')]({'where':{'WhatsappAccountId':_0x1c133b['params']['id']},'transaction':_0x207444})[_0xd283('0x22')](function(_0x5406dc){var _0x4180d8=_[_0xd283('0x3f')](_0x1c133b['body'],function(_0x47feb1){_0x47feb1[_0xd283('0x6d')]=_0x1c133b[_0xd283('0x66')]['id'];return _0x47feb1;});return db['WhatsappApplication']['bulkCreate'](_0x4180d8,{'transaction':_0x207444});});})[_0xd283('0x22')](function(){return db[_0xd283('0x7f')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x1c133b[_0xd283('0x66')]['id']},'order':_0xd283('0x80')});});}})[_0xd283('0x22')](respondWithResult(_0x12b533,null))[_0xd283('0x2c')](handleError(_0x12b533,null));};exports[_0xd283('0x81')]=function(_0x173e7e,_0x13bb96,_0x246fbf){var _0x201e59={};var _0x30ef3f={};var _0xe96eff;var _0x5db434;return db[_0xd283('0x40')]['findOne']({'where':{'id':_0x173e7e['params']['id']}})['then'](handleEntityNotFound(_0x13bb96,null))[_0xd283('0x22')](function(_0x4ddd42){if(_0x4ddd42){_0xe96eff=_0x4ddd42;_0x30ef3f['model']=_['keys'](db[_0xd283('0x7f')]['rawAttributes']);_0x30ef3f['query']=_[_0xd283('0x45')](_0x173e7e[_0xd283('0x44')]);_0x30ef3f[_0xd283('0x46')]=_[_0xd283('0x47')](_0x30ef3f[_0xd283('0x43')],_0x30ef3f[_0xd283('0x44')]);_0x201e59['attributes']=_[_0xd283('0x47')](_0x30ef3f[_0xd283('0x43')],qs[_0xd283('0x49')](_0x173e7e[_0xd283('0x44')][_0xd283('0x49')]));_0x201e59[_0xd283('0x48')]=_0x201e59[_0xd283('0x48')][_0xd283('0x4a')]?_0x201e59[_0xd283('0x48')]:_0x30ef3f[_0xd283('0x43')];_0x201e59[_0xd283('0x7c')]=qs[_0xd283('0x4d')](_0x173e7e[_0xd283('0x44')]['sort']);_0x201e59[_0xd283('0x4f')]=qs[_0xd283('0x46')](_['pick'](_0x173e7e[_0xd283('0x44')],_0x30ef3f[_0xd283('0x46')]));if(_0x173e7e[_0xd283('0x44')][_0xd283('0x4e')]){_0x201e59[_0xd283('0x4f')]=_[_0xd283('0x50')](_0x201e59[_0xd283('0x4f')],{'$or':_['map'](_0x201e59[_0xd283('0x48')],function(_0x3cd1ff){var _0x3e1f1f={};_0x3e1f1f[_0x3cd1ff]={'$like':'%'+_0x173e7e[_0xd283('0x44')][_0xd283('0x4e')]+'%'};return _0x3e1f1f;})});}_0x201e59=_[_0xd283('0x50')]({},_0x201e59,_0x173e7e[_0xd283('0x52')]);return _0xe96eff['getApplications'](_0x201e59);}})[_0xd283('0x22')](function(_0x2b6318){if(_0x2b6318){_0x5db434=_0x2b6318[_0xd283('0x4a')];if(!_0x173e7e[_0xd283('0x44')][_0xd283('0x4b')](_0xd283('0x4c'))){_0x201e59[_0xd283('0x31')]=qs[_0xd283('0x31')](_0x173e7e[_0xd283('0x44')]['limit']);_0x201e59[_0xd283('0x30')]=qs[_0xd283('0x30')](_0x173e7e[_0xd283('0x44')][_0xd283('0x30')]);}return _0xe96eff['getApplications'](_0x201e59);}})[_0xd283('0x22')](function(_0x4cc0e4){if(_0x4cc0e4){return _0x4cc0e4?{'count':_0x5db434,'rows':_0x4cc0e4}:null;}})[_0xd283('0x22')](respondWithResult(_0x13bb96,null))['catch'](handleError(_0x13bb96,null));};exports[_0xd283('0x82')]=function(_0xa952c1,_0x23997c,_0x4fb45b){var _0x4c7675={'channel':_0xd283('0x83')};var _0x541f2c=[];var _0x14d034=[];var _0x11fce8={};return db[_0xd283('0x40')][_0xd283('0x5c')]({'where':{'id':_0xa952c1['params']['id']},'include':[{'model':db[_0xd283('0x7f')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x23997c,null))[_0xd283('0x22')](function(_0xf34413){_0x4c7675[_0xd283('0x84')]=_0xf34413;if(_0x4c7675['account']&&_0x4c7675['account'][_0xd283('0x42')]===_0xd283('0x85')&&_0xa952c1[_0xd283('0x5e')][_0xd283('0x86')]){if(_0xa952c1[_0xd283('0x5e')][_0xd283('0x86')]['length']===0x0)return;if(_0xa952c1[_0xd283('0x5e')][_0xd283('0x86')][0x0]['state']!==_0xd283('0x87'))return;return db[_0xd283('0x88')][_0xd283('0x36')]({'read':!![],'readAt':_0xa952c1[_0xd283('0x5e')][_0xd283('0x86')][0x0]['timestamp']},{'where':{'messageId':_0xa952c1['body'][_0xd283('0x86')][0x0][_0xd283('0x89')]},'individualHooks':!![]})[_0xd283('0x22')](function(_0x50ecd7){return _0x23997c['status'](0xc8)[_0xd283('0x2f')](_0x50ecd7);});}_0x4c7675['applications']=_['orderBy'](_0xf34413['Applications'],[_0xd283('0x80')],[_0xd283('0x8a')]);if(_0x4c7675[_0xd283('0x84')][_0xd283('0x8b')]){delete _0x4c7675['account'][_0xd283('0x8b')];}return db[_0xd283('0x8c')][_0xd283('0x67')]()[_0xd283('0x22')](function(_0x117ccb){if(!_0x117ccb){throw new db['Sequelize'][(_0xd283('0x8d'))](_0xd283('0x8e'));}_0x541f2c=_[_0xd283('0x8f')](_[_0xd283('0x45')](_0x117ccb),[_0xd283('0x90'),_0xd283('0x91')]);_0x14d034=_[_0xd283('0x8f')](_['keys'](_0x117ccb),[_0xd283('0x90'),_0xd283('0x91'),_0xd283('0x92'),_0xd283('0x93')]);_0x4c7675['body']={'mapKey':'mobile'};if(_0x4c7675[_0xd283('0x84')]&&_0x4c7675[_0xd283('0x84')]['type']===_0xd283('0x94')){_0x4c7675[_0xd283('0x5e')]['from']=_0xa952c1[_0xd283('0x5e')]['From'][_0xd283('0x95')](_0xd283('0x96'),'');_0x4c7675['body'][_0xd283('0x5e')]=_0xa952c1[_0xd283('0x5e')][_0xd283('0x97')];_0x4c7675[_0xd283('0x5e')][_0xd283('0x98')]=_0xa952c1['body'][_0xd283('0x99')];}if(_0x4c7675['account']&&_0x4c7675['account']['type']===_0xd283('0x85')){_0x4c7675['body'][_0xd283('0x9a')]=_0xa952c1['body'][_0xd283('0x9b')][0x0]['from'];_0x4c7675['body'][_0xd283('0x5e')]=_0xa952c1[_0xd283('0x5e')][_0xd283('0x9b')][0x0]['message'][_0xd283('0x5e')];_0x4c7675[_0xd283('0x5e')][_0xd283('0x98')]=_0xa952c1[_0xd283('0x5e')][_0xd283('0x9b')][0x0][_0xd283('0x89')];}if(_0x4c7675['body']['id']){delete _0x4c7675[_0xd283('0x5e')]['id'];}if(_[_0xd283('0x9c')](_0x4c7675[_0xd283('0x5e')][_0xd283('0x9a')])){throw new db[(_0xd283('0x9d'))]['ValidationError'](_0xd283('0x9e'));}if(_['isNil'](_0x4c7675[_0xd283('0x5e')][_0xd283('0x5e')])||_0x4c7675['body'][_0xd283('0x5e')]===''){throw new db[(_0xd283('0x9d'))]['ValidationError'](_0xd283('0x9f'));}if(_[_0xd283('0x9c')](_0x4c7675[_0xd283('0x5e')][_0xd283('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xd283('0xa1')+_0x14d034);}if(!_['includes'](_0x14d034,_0x4c7675['body'][_0xd283('0xa0')])){throw new db[(_0xd283('0x9d'))]['ValidationError'](_0xd283('0xa2')+_0x14d034);}_0x11fce8[_0x4c7675[_0xd283('0x5e')][_0xd283('0xa0')]]=_0x4c7675['body'][_0xd283('0x9a')];return db[_0xd283('0xa3')]['find']({'where':{'id':_0x4c7675[_0xd283('0x84')][_0xd283('0x93')]},'include':[{'model':db[_0xd283('0x8c')],'as':_0xd283('0xa4'),'where':_0x11fce8,'limit':0x1,'order':[[_0xd283('0x91'),_0xd283('0xa5')]]}]});})[_0xd283('0x22')](handleEntityNotFound(_0x23997c,null))['then'](function(_0x357899){if(_0x357899){_0x4c7675[_0xd283('0xa6')]=_[_0xd283('0x74')](_0x357899,['Contacts']);if(_0x357899[_0xd283('0xa4')][_0xd283('0x4a')]){return _0x357899[_0xd283('0xa4')][0x0];}var _0xaa4109=_[_0xd283('0x1c')](_0x4c7675[_0xd283('0x5e')],{'firstName':_0x4c7675['body'][_0xd283('0x9a')],'ListId':_0x357899['id']});_0xaa4109[_0x4c7675[_0xd283('0x5e')][_0xd283('0xa0')]]=_0x4c7675[_0xd283('0x5e')][_0xd283('0x9a')];return db[_0xd283('0x8c')][_0xd283('0x5d')](_0xaa4109,{'fields':_0x541f2c,'raw':!![]});}})[_0xd283('0x22')](handleEntityNotFound(_0x23997c,null))['then'](function(_0x51a226){if(_0x51a226){_0x4c7675[_0xd283('0xa7')]=_0x51a226;var _0x5b6f5b={'ContactId':_0x51a226['id'],'phone':_0x4c7675['body'][_0xd283('0x9a')],'WhatsappAccountId':_0xa952c1[_0xd283('0x66')]['id']};var _0x373ea2={'ContactId':_0x51a226['id'],'WhatsappAccountId':_0xa952c1['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0xd283('0x5c')]({'where':_0x373ea2})[_0xd283('0x22')](function(_0xa2b3d1){if(_0xa2b3d1){return[_0xa2b3d1,![]];}return db[_0xd283('0xa8')][_0xd283('0x5d')](_0x5b6f5b)[_0xd283('0x22')](function(_0x553ac7){return[_0x553ac7,!![]];});});}})[_0xd283('0x75')](function(_0x3f794a,_0xb6095f){_0x4c7675[_0xd283('0xa9')]=_0x3f794a[_0xd283('0x38')]({'plain':!![]});_0x4c7675[_0xd283('0xa9')]['created']=![];if(_0xb6095f){if(_0x4c7675[_0xd283('0x84')]['autoclose']){_0x4c7675[_0xd283('0xaa')]['push']({'id':0x0,'priority':_0x4c7675['applications'][_0xd283('0x4a')]+0x1,'app':_0xd283('0xab'),'appdata':_0xd283('0xac'),'interval':_0xd283('0xad')});}_0x4c7675['interaction'][_0xd283('0xae')]=!![];}return db['WhatsappMessage'][_0xd283('0x5d')]({'phone':_0x4c7675[_0xd283('0x5e')][_0xd283('0x9a')],'messageId':_0x4c7675[_0xd283('0x5e')][_0xd283('0x98')],'body':_0x4c7675[_0xd283('0x5e')][_0xd283('0x5e')],'WhatsappAccountId':_0xa952c1[_0xd283('0x66')]['id'],'WhatsappInteractionId':_0x3f794a['id'],'direction':'in','ContactId':_0x3f794a[_0xd283('0xaf')],'AttachmentId':_0x4c7675[_0xd283('0x5e')]['AttachmentId']});})[_0xd283('0x22')](function(_0x354e2b){_0x4c7675[_0xd283('0x2a')]=_0x354e2b;if(_0x4c7675['interaction']['UserId']){return db['User'][_0xd283('0x5c')]({'attributes':['id',_0xd283('0x3d')],'where':{'id':_0x4c7675['interaction'][_0xd283('0xb0')]}})[_0xd283('0x22')](function(_0x3d9ecf){if(_0x3d9ecf){_0x4c7675['applications'][_0xd283('0xb1')]({'id':0x0,'priority':0x0,'app':_0xd283('0xb2'),'appdata':_0x3d9ecf[_0xd283('0x3d')]+','+(_0x4c7675[_0xd283('0x84')][_0xd283('0xb3')]||0xa),'interval':_0xd283('0xad')});}return respondWithRpcPromise(_0xd283('0xb4'),_0xd283('0xb5'),_0x4c7675);});}return respondWithRpcPromise(_0xd283('0xb4'),_0xd283('0xb5'),_0x4c7675);})[_0xd283('0x22')](function(_0xffdd39){if(_0xffdd39){var _0x3470bd=0xc8;var _0x325e89='receiveMessage';logger[_0xd283('0x23')](_0xd283('0x26'),_0x325e89,_0x3470bd,'entity\x20found');logger['debug'](_0xd283('0xb6'),_0x325e89,_0x3470bd,_0xd283('0xb7'),JSON[_0xd283('0x27')](_0xffdd39));if(_0x4c7675[_0xd283('0x84')]['type']==='twilio'){return _0x23997c[_0xd283('0x2d')](_0x3470bd)['set'](_0xd283('0xb8'),_0xd283('0xb9'))[_0xd283('0xba')](_0xd283('0xbb'));}else{return _0x23997c[_0xd283('0x2d')](_0x3470bd)['json'](_0xffdd39);}}});})[_0xd283('0x2c')](handleError(_0x23997c,null));};exports['send']=function(_0x39653a,_0x1e280d,_0x45fd04){var _0x1abce1,_0x1732aa,_0x3be19f;if(_[_0xd283('0x9c')](_0x39653a[_0xd283('0x5e')][_0xd283('0x5e')])||_0x39653a[_0xd283('0x5e')][_0xd283('0x5e')]===''){throw new db['Sequelize'][(_0xd283('0x8d'))](_0xd283('0x9f'));}if(_[_0xd283('0x9c')](_0x39653a['body']['to'])){throw new db[(_0xd283('0x9d'))][(_0xd283('0x8d'))]('to\x20is\x20mandatory');}_0x1abce1=_0x39653a['body']['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x39653a[_0xd283('0x66')]['id']},'include':[{'model':db[_0xd283('0xa3')],'as':'List','include':[{'model':db[_0xd283('0x8c')],'as':_0xd283('0xa4'),'where':{'mobile':_0x1abce1},'limit':0x1,'order':[[_0xd283('0x91'),_0xd283('0xa5')]]}]}]})[_0xd283('0x22')](handleEntityNotFound(_0x1e280d,null))[_0xd283('0x22')](function(_0x556cbf){if(_0x556cbf&&_0x556cbf[_0xd283('0xbc')]){_0x1732aa=_0x556cbf[_0xd283('0x38')]({'plain':!![]});if(_0x1732aa[_0xd283('0xbc')]&&_0x1732aa[_0xd283('0xbc')][_0xd283('0xa4')][_0xd283('0x4a')]){return _0x1732aa['List']['Contacts'][0x0];}return db[_0xd283('0x8c')][_0xd283('0x5d')](_[_0xd283('0x1c')](_0x39653a[_0xd283('0x5e')],{'firstName':_0x1abce1,'mobile':_0x1abce1,'phone':_0x1abce1,'ListId':_0x1732aa[_0xd283('0x93')]}));}})[_0xd283('0x22')](handleEntityNotFound(_0x1e280d,null))['then'](function(_0x51c423){if(_0x51c423){_0x3be19f=_0x51c423;return db['WhatsappInteraction'][_0xd283('0x5c')]({'where':{'ContactId':_0x3be19f['id'],'closed':![],'WhatsappAccountId':_0x1732aa['id']}})[_0xd283('0x22')](function(_0x23b34b){if(_0x23b34b){return[_0x23b34b,![]];}return db[_0xd283('0xa8')][_0xd283('0x5d')]({'UserId':_0x39653a[_0xd283('0x61')]['id'],'ContactId':_0x3be19f['id'],'WhatsappAccountId':_0x1732aa['id'],'phone':_0x1abce1,'firstMsgDirection':_0xd283('0xbd'),'Messages':[_[_0xd283('0x50')](_0x39653a[_0xd283('0x5e')],{'read':![],'body':_0x39653a[_0xd283('0x5e')][_0xd283('0x5e')],'phone':_0x1abce1,'WhatsappAccountId':_0x1732aa['id'],'UserId':_0x39653a[_0xd283('0x61')]['id'],'ContactId':_0x3be19f['id']})]},{'include':[{'model':db[_0xd283('0x88')],'as':_0xd283('0xbe')}]})[_0xd283('0x22')](function(_0x18f960){return[_0x18f960,!![]];});});}})[_0xd283('0x75')](function(_0x452cc4,_0x5106ea){if(_0x5106ea){return _0x452cc4;}return db[_0xd283('0x88')][_0xd283('0x5d')](_['merge'](_0x39653a[_0xd283('0x5e')],{'read':![],'body':_0x39653a['body'][_0xd283('0x5e')],'phone':_0x1abce1,'WhatsappAccountId':_0x1732aa['id'],'WhatsappInteractionId':_0x452cc4['id'],'UserId':_0x39653a['user']['id'],'ContactId':_0x3be19f['id']}))[_0xd283('0x22')](function(_0x49d342){_0x452cc4['dataValues']['Messages']=[];_0x452cc4[_0xd283('0xbf')][_0xd283('0xbe')][_0xd283('0xc0')](_0x49d342['dataValues']);return _0x452cc4;});})[_0xd283('0x22')](respondWithResult(_0x1e280d,null))['catch'](handleError(_0x1e280d,null));}; \ No newline at end of file +var _0xb294=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','WhatsappAccount','include','findAll','rows','show','params','Pause','includeAll','options','create','body','get','role','user','WhatsappAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','nolimit','order','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','transaction','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','ContactId','UserId','unshift','agent','Start','startRouting','entity\x20found','Content-Type','List','out','dataValues','Messages','eml-format','zip-dir','fast-json-patch','moment','util','to-csv','ejs'];(function(_0xb0462c,_0x3a0bb1){var _0x5af3e6=function(_0x36af12){while(--_0x36af12){_0xb0462c['push'](_0xb0462c['shift']());}};_0x5af3e6(++_0x3a0bb1);}(_0xb294,0x16d));var _0x4b29=function(_0x39a485,_0x21bb63){_0x39a485=_0x39a485-0x0;var _0x2c3ccf=_0xb294[_0x39a485];return _0x2c3ccf;};'use strict';var emlformat=require(_0x4b29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b29('0x1'));var jsonpatch=require(_0x4b29('0x2'));var rp=require('request-promise');var moment=require(_0x4b29('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b29('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4b29('0x5'));var ejs=require(_0x4b29('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b29('0x7'));var squel=require(_0x4b29('0x8'));var crypto=require(_0x4b29('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4b29('0xa'));var toCsv=require(_0x4b29('0x5'));var querystring=require(_0x4b29('0xb'));var Papa=require('papaparse');var Redis=require(_0x4b29('0xc'));var authService=require(_0x4b29('0xd'));var qs=require(_0x4b29('0xe'));var as=require(_0x4b29('0xf'));var hardwareService=require(_0x4b29('0x10'));var logger=require('../../config/logger')(_0x4b29('0x11'));var utils=require(_0x4b29('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4b29('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4b29('0x14')](config['redis'],{'host':_0x4b29('0x15'),'port':0x18eb});var socket=require(_0x4b29('0x16'))(new Redis(config['redis']));require(_0x4b29('0x17'))[_0x4b29('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4b29('0x19')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1d2e6c,_0x5ab282,_0x569469,_0x2c6caf){return new BPromise(function(_0x1b85c3,_0x1448b8){var _0x1464a=_0x2c6caf||client;return _0x1464a[_0x4b29('0x1a')](_0x1d2e6c,_0x569469)[_0x4b29('0x1b')](function(_0x4e447f){logger[_0x4b29('0x1c')](_0x4b29('0x1d'),_0x5ab282,'request\x20sent');logger[_0x4b29('0x1e')](_0x4b29('0x1f'),_0x5ab282,'request\x20sent',JSON['stringify'](_0x4e447f));if(_0x4e447f[_0x4b29('0x20')]){if(_0x4e447f[_0x4b29('0x20')][_0x4b29('0x21')]===0x1f4){logger[_0x4b29('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x5ab282,_0x4e447f['error'][_0x4b29('0x22')]);return _0x1448b8(_0x4e447f[_0x4b29('0x20')][_0x4b29('0x22')]);}logger['error'](_0x4b29('0x1d'),_0x5ab282,_0x4e447f[_0x4b29('0x20')][_0x4b29('0x22')]);return _0x1b85c3(_0x4e447f[_0x4b29('0x20')][_0x4b29('0x22')]);}else{logger[_0x4b29('0x1c')](_0x4b29('0x1d'),_0x5ab282,_0x4b29('0x23'));_0x1b85c3(_0x4e447f['result']['message']);}})[_0x4b29('0x24')](function(_0x4e9cbd){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5ab282,_0x4e9cbd);_0x1448b8(_0x4e9cbd);});});}function respondWithStatusCode(_0x318543,_0x6b02f7){_0x6b02f7=_0x6b02f7||0xcc;return function(_0x5a79e1){if(_0x5a79e1){return _0x318543['sendStatus'](_0x6b02f7);}return _0x318543[_0x4b29('0x25')](_0x6b02f7)['end']();};}function respondWithResult(_0xe7d3b1,_0x4a5f19){_0x4a5f19=_0x4a5f19||0xc8;return function(_0x3e9df5){if(_0x3e9df5){return _0xe7d3b1[_0x4b29('0x25')](_0x4a5f19)[_0x4b29('0x26')](_0x3e9df5);}};}function respondWithFilteredResult(_0x278850,_0xfd0b36){return function(_0x1a6984){if(_0x1a6984){var _0x28aff8=typeof _0xfd0b36[_0x4b29('0x27')]===_0x4b29('0x28')&&typeof _0xfd0b36[_0x4b29('0x29')]===_0x4b29('0x28');var _0x40ee35=_0x1a6984[_0x4b29('0x2a')];var _0x161b9c=_0x28aff8?0x0:_0xfd0b36[_0x4b29('0x27')];var _0x18265f=_0x28aff8?_0x1a6984[_0x4b29('0x2a')]:_0xfd0b36[_0x4b29('0x27')]+_0xfd0b36[_0x4b29('0x29')];var _0x212ee7;if(_0x18265f>=_0x40ee35){_0x18265f=_0x40ee35;_0x212ee7=0xc8;}else{_0x212ee7=0xce;}_0x278850['status'](_0x212ee7);return _0x278850[_0x4b29('0x2b')](_0x4b29('0x2c'),_0x161b9c+'-'+_0x18265f+'/'+_0x40ee35)[_0x4b29('0x26')](_0x1a6984);}return null;};}function patchUpdates(_0xe0574d){return function(_0x1edb79){try{jsonpatch[_0x4b29('0x2d')](_0x1edb79,_0xe0574d,!![]);}catch(_0x834d28){return BPromise[_0x4b29('0x2e')](_0x834d28);}return _0x1edb79[_0x4b29('0x2f')]();};}function saveUpdates(_0x4f7610,_0x5fea2d){return function(_0x1c89d2){if(_0x1c89d2){return _0x1c89d2[_0x4b29('0x30')](_0x4f7610)[_0x4b29('0x1b')](function(_0x4e574c){return _0x4e574c;});}return null;};}function removeEntity(_0x15bed9,_0x6c4d0e){return function(_0xd7f101){if(_0xd7f101){return _0xd7f101[_0x4b29('0x31')]()[_0x4b29('0x1b')](function(){var _0x21225d=_0xd7f101['get']({'plain':!![]});var _0x18c7c1='WhatsappAccounts';return db[_0x4b29('0x32')][_0x4b29('0x31')]({'where':{'type':_0x18c7c1,'resourceId':_0x21225d['id']}})[_0x4b29('0x1b')](function(){return _0xd7f101;});})[_0x4b29('0x1b')](function(){_0x15bed9[_0x4b29('0x25')](0xcc)[_0x4b29('0x33')]();});}};}function handleEntityNotFound(_0x2f2dd7,_0xdeb0a1){return function(_0x2f37f2){if(!_0x2f37f2){_0x2f2dd7[_0x4b29('0x34')](0x194);}return _0x2f37f2;};}function handleError(_0x3af766,_0x16d4f6){_0x16d4f6=_0x16d4f6||0x1f4;return function(_0xad59d5){logger['error'](_0xad59d5[_0x4b29('0x35')]);if(_0xad59d5[_0x4b29('0x36')]){delete _0xad59d5[_0x4b29('0x36')];}_0x3af766['status'](_0x16d4f6)[_0x4b29('0x37')](_0xad59d5);};}exports[_0x4b29('0x38')]=function(_0x418b17,_0x32cbc0){var _0x108fd6={'include':[{'model':db['Pause'],'as':_0x4b29('0x39')}]},_0x3df43d={},_0x4f4be8={'count':0x0,'rows':[]};var _0x44c4f8=_[_0x4b29('0x3a')](db['WhatsappAccount'][_0x4b29('0x3b')],function(_0x168828){return{'name':_0x168828[_0x4b29('0x3c')],'type':_0x168828[_0x4b29('0x3d')][_0x4b29('0x3e')]};});_0x3df43d[_0x4b29('0x3f')]=_[_0x4b29('0x3a')](_0x44c4f8,'name');_0x3df43d['query']=_[_0x4b29('0x40')](_0x418b17['query']);_0x3df43d['filters']=_[_0x4b29('0x41')](_0x3df43d[_0x4b29('0x3f')],_0x3df43d['query']);_0x108fd6[_0x4b29('0x42')]=_[_0x4b29('0x41')](_0x3df43d['model'],qs[_0x4b29('0x43')](_0x418b17['query'][_0x4b29('0x43')]));_0x108fd6[_0x4b29('0x42')]=_0x108fd6[_0x4b29('0x42')][_0x4b29('0x44')]?_0x108fd6['attributes']:_0x3df43d['model'];if(!_0x418b17[_0x4b29('0x45')][_0x4b29('0x46')]('nolimit')){_0x108fd6[_0x4b29('0x29')]=qs[_0x4b29('0x29')](_0x418b17[_0x4b29('0x45')][_0x4b29('0x29')]);_0x108fd6['offset']=qs['offset'](_0x418b17[_0x4b29('0x45')][_0x4b29('0x27')]);}_0x108fd6['order']=qs[_0x4b29('0x47')](_0x418b17[_0x4b29('0x45')][_0x4b29('0x47')]);_0x108fd6[_0x4b29('0x48')]=qs[_0x4b29('0x49')](_[_0x4b29('0x4a')](_0x418b17['query'],_0x3df43d[_0x4b29('0x49')]),_0x44c4f8);if(_0x418b17[_0x4b29('0x45')][_0x4b29('0x4b')]){_0x108fd6[_0x4b29('0x48')]=_[_0x4b29('0x4c')](_0x108fd6[_0x4b29('0x48')],{'$or':_['map'](_0x44c4f8,function(_0x212e18){if(_0x212e18[_0x4b29('0x3d')]!==_0x4b29('0x4d')){var _0x4d7877={};_0x4d7877[_0x212e18[_0x4b29('0x36')]]={'$like':'%'+_0x418b17[_0x4b29('0x45')]['filter']+'%'};return _0x4d7877;}})});}_0x108fd6=_['merge']({},_0x108fd6,_0x418b17['options']);var _0x434163={'where':_0x108fd6[_0x4b29('0x48')]};return db[_0x4b29('0x4e')][_0x4b29('0x2a')](_0x434163)[_0x4b29('0x1b')](function(_0xe670ba){_0x4f4be8[_0x4b29('0x2a')]=_0xe670ba;if(_0x418b17[_0x4b29('0x45')]['includeAll']){_0x108fd6[_0x4b29('0x4f')]=[{'all':!![]}];}return db[_0x4b29('0x4e')][_0x4b29('0x50')](_0x108fd6);})['then'](function(_0x5d318f){_0x4f4be8[_0x4b29('0x51')]=_0x5d318f;return _0x4f4be8;})['then'](respondWithFilteredResult(_0x32cbc0,_0x108fd6))[_0x4b29('0x24')](handleError(_0x32cbc0,null));};exports[_0x4b29('0x52')]=function(_0xc07d3,_0x38edc3){var _0x4f7c8a={'raw':![],'where':{'id':_0xc07d3[_0x4b29('0x53')]['id']},'include':[{'model':db[_0x4b29('0x54')],'as':_0x4b29('0x39')}]},_0x28c337={};_0x28c337[_0x4b29('0x3f')]=_[_0x4b29('0x40')](db['WhatsappAccount'][_0x4b29('0x3b')]);_0x28c337['query']=_[_0x4b29('0x40')](_0xc07d3['query']);_0x28c337[_0x4b29('0x49')]=_['intersection'](_0x28c337[_0x4b29('0x3f')],_0x28c337[_0x4b29('0x45')]);_0x4f7c8a[_0x4b29('0x42')]=_[_0x4b29('0x41')](_0x28c337['model'],qs['fields'](_0xc07d3[_0x4b29('0x45')][_0x4b29('0x43')]));_0x4f7c8a[_0x4b29('0x42')]=_0x4f7c8a[_0x4b29('0x42')]['length']?_0x4f7c8a[_0x4b29('0x42')]:_0x28c337[_0x4b29('0x3f')];if(_0xc07d3['query'][_0x4b29('0x55')]){_0x4f7c8a[_0x4b29('0x4f')]=[{'all':!![]}];}_0x4f7c8a=_['merge']({},_0x4f7c8a,_0xc07d3[_0x4b29('0x56')]);return db[_0x4b29('0x4e')]['find'](_0x4f7c8a)['then'](handleEntityNotFound(_0x38edc3,null))[_0x4b29('0x1b')](respondWithResult(_0x38edc3,null))[_0x4b29('0x24')](handleError(_0x38edc3,null));};exports[_0x4b29('0x57')]=function(_0x25cb30,_0x19028e){return db[_0x4b29('0x4e')]['create'](_0x25cb30[_0x4b29('0x58')],{})['then'](function(_0x2085b6){var _0x1e3883=_0x25cb30['user'][_0x4b29('0x59')]({'plain':!![]});if(!_0x1e3883)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e3883[_0x4b29('0x5a')]===_0x4b29('0x5b')){var _0x4b9b60=_0x2085b6[_0x4b29('0x59')]({'plain':!![]});var _0x135a14=_0x4b29('0x5c');return db[_0x4b29('0x5d')][_0x4b29('0x5e')]({'where':{'name':_0x135a14,'userProfileId':_0x1e3883[_0x4b29('0x5f')]},'raw':!![]})[_0x4b29('0x1b')](function(_0x5412ee){if(_0x5412ee&&_0x5412ee[_0x4b29('0x60')]===0x0){return db[_0x4b29('0x32')][_0x4b29('0x57')]({'name':_0x4b9b60['name'],'resourceId':_0x4b9b60['id'],'type':_0x5412ee[_0x4b29('0x36')],'sectionId':_0x5412ee['id']},{})[_0x4b29('0x1b')](function(){return _0x2085b6;});}else{return _0x2085b6;}})[_0x4b29('0x24')](function(_0x332efa){logger[_0x4b29('0x20')](_0x4b29('0x61'),_0x332efa);throw _0x332efa;});}return _0x2085b6;})[_0x4b29('0x1b')](respondWithResult(_0x19028e,0xc9))[_0x4b29('0x24')](handleError(_0x19028e,null));};exports[_0x4b29('0x30')]=function(_0x34a02c,_0x317a5a){if(_0x34a02c[_0x4b29('0x58')]['id']){delete _0x34a02c['body']['id'];}return db['WhatsappAccount'][_0x4b29('0x5e')]({'where':{'id':_0x34a02c[_0x4b29('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x4b29('0x39')}]})[_0x4b29('0x1b')](handleEntityNotFound(_0x317a5a,null))[_0x4b29('0x1b')](saveUpdates(_0x34a02c['body'],null))[_0x4b29('0x1b')](respondWithResult(_0x317a5a,null))[_0x4b29('0x24')](handleError(_0x317a5a,null));};exports[_0x4b29('0x31')]=function(_0x5b16e3,_0xee41b7){return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x5b16e3[_0x4b29('0x53')]['id']}})['then'](handleEntityNotFound(_0xee41b7,null))[_0x4b29('0x1b')](removeEntity(_0xee41b7,null))['catch'](handleError(_0xee41b7,null));};exports['describe']=function(_0x55efc4,_0x2e4ae9){return db[_0x4b29('0x4e')][_0x4b29('0x62')]()[_0x4b29('0x1b')](respondWithResult(_0x2e4ae9,null))[_0x4b29('0x24')](handleError(_0x2e4ae9,null));};exports[_0x4b29('0x63')]=function(_0x5be7b0,_0xf375f6,_0x33fb59){if(_0x5be7b0[_0x4b29('0x58')]['id']){delete _0x5be7b0['body']['id'];}return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x5be7b0[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0xf375f6,null))['then'](function(_0x2f027d){if(_0x2f027d){_0x5be7b0[_0x4b29('0x58')][_0x4b29('0x64')]=_0x2f027d['id'];return db[_0x4b29('0x65')]['create'](_0x5be7b0[_0x4b29('0x58')]);}})[_0x4b29('0x1b')](respondWithResult(_0xf375f6,null))['catch'](handleError(_0xf375f6,null));};exports['getDispositions']=function(_0x328abf,_0x499a14,_0x51c4ec){var _0x373157={'raw':![],'where':{}};var _0x59d5bb={};var _0x205fde={'count':0x0,'rows':[]};return db[_0x4b29('0x4e')]['findOne']({'where':{'id':_0x328abf[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x499a14,null))['then'](function(_0x35af3a){if(_0x35af3a){_0x59d5bb[_0x4b29('0x3f')]=_[_0x4b29('0x40')](db[_0x4b29('0x65')][_0x4b29('0x3b')]);_0x59d5bb['query']=_[_0x4b29('0x40')](_0x328abf[_0x4b29('0x45')]);_0x59d5bb[_0x4b29('0x49')]=_[_0x4b29('0x41')](_0x59d5bb['model'],_0x59d5bb[_0x4b29('0x45')]);_0x373157[_0x4b29('0x42')]=_[_0x4b29('0x41')](_0x59d5bb[_0x4b29('0x3f')],qs[_0x4b29('0x43')](_0x328abf[_0x4b29('0x45')][_0x4b29('0x43')]));_0x373157[_0x4b29('0x42')]=_0x373157['attributes'][_0x4b29('0x44')]?_0x373157[_0x4b29('0x42')]:_0x59d5bb[_0x4b29('0x3f')];if(!_0x328abf[_0x4b29('0x45')]['hasOwnProperty'](_0x4b29('0x66'))){_0x373157[_0x4b29('0x29')]=qs['limit'](_0x328abf[_0x4b29('0x45')]['limit']);_0x373157['offset']=qs[_0x4b29('0x27')](_0x328abf[_0x4b29('0x45')][_0x4b29('0x27')]);}_0x373157[_0x4b29('0x67')]=qs[_0x4b29('0x47')](_0x328abf[_0x4b29('0x45')]['sort']);_0x373157[_0x4b29('0x48')]=qs[_0x4b29('0x49')](_[_0x4b29('0x4a')](_0x328abf[_0x4b29('0x45')],_0x59d5bb[_0x4b29('0x49')]));_0x373157[_0x4b29('0x48')][_0x4b29('0x64')]=_0x35af3a['id'];if(_0x328abf[_0x4b29('0x45')][_0x4b29('0x4b')]){_0x373157[_0x4b29('0x48')]=_[_0x4b29('0x4c')](_0x373157[_0x4b29('0x48')],{'$or':_[_0x4b29('0x3a')](_0x373157[_0x4b29('0x42')],function(_0x48ae8e){var _0x52b2fa={};_0x52b2fa[_0x48ae8e]={'$like':'%'+_0x328abf[_0x4b29('0x45')]['filter']+'%'};return _0x52b2fa;})});}_0x373157=_[_0x4b29('0x4c')]({},_0x373157,_0x328abf[_0x4b29('0x56')]);return db['Disposition'][_0x4b29('0x2a')]({'where':_0x373157['where']})['then'](function(_0x2b5f11){_0x205fde[_0x4b29('0x2a')]=_0x2b5f11;if(_0x328abf['query']['includeAll']){_0x373157['include']=[{'all':!![]}];}return db[_0x4b29('0x65')][_0x4b29('0x50')](_0x373157);})[_0x4b29('0x1b')](function(_0x407fa6){_0x205fde['rows']=_0x407fa6;return _0x205fde;});}})[_0x4b29('0x1b')](respondWithFilteredResult(_0x499a14,_0x373157))[_0x4b29('0x24')](handleError(_0x499a14,null));};exports[_0x4b29('0x68')]=function(_0x528117,_0xc34751,_0x59bfd4){return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x528117[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0xc34751,null))[_0x4b29('0x1b')](function(_0x4ea699){if(_0x4ea699){return _0x4ea699[_0x4b29('0x68')](_0x528117[_0x4b29('0x45')][_0x4b29('0x69')]);}})[_0x4b29('0x1b')](respondWithStatusCode(_0xc34751,null))[_0x4b29('0x24')](handleError(_0xc34751,null));};exports[_0x4b29('0x6a')]=function(_0x47e196,_0x9420e3,_0x45c3ff){if(_0x47e196['body']['id']){delete _0x47e196[_0x4b29('0x58')]['id'];}return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x47e196[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x9420e3,null))['then'](function(_0x19b93e){if(_0x19b93e){_0x47e196[_0x4b29('0x58')][_0x4b29('0x64')]=_0x19b93e['id'];return db['CannedAnswer'][_0x4b29('0x57')](_0x47e196[_0x4b29('0x58')]);}})[_0x4b29('0x1b')](respondWithResult(_0x9420e3,null))[_0x4b29('0x24')](handleError(_0x9420e3,null));};exports[_0x4b29('0x6b')]=function(_0x1fba34,_0x165e09,_0xed828b){var _0x406b7e={'raw':![],'where':{}};var _0x26b15e={};var _0x4587e3={'count':0x0,'rows':[]};return db[_0x4b29('0x4e')][_0x4b29('0x6c')]({'where':{'id':_0x1fba34[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x165e09,null))[_0x4b29('0x1b')](function(_0x3866ba){if(_0x3866ba){_0x26b15e[_0x4b29('0x3f')]=_[_0x4b29('0x40')](db[_0x4b29('0x6d')][_0x4b29('0x3b')]);_0x26b15e[_0x4b29('0x45')]=_[_0x4b29('0x40')](_0x1fba34[_0x4b29('0x45')]);_0x26b15e[_0x4b29('0x49')]=_[_0x4b29('0x41')](_0x26b15e[_0x4b29('0x3f')],_0x26b15e[_0x4b29('0x45')]);_0x406b7e[_0x4b29('0x42')]=_[_0x4b29('0x41')](_0x26b15e[_0x4b29('0x3f')],qs[_0x4b29('0x43')](_0x1fba34['query'][_0x4b29('0x43')]));_0x406b7e[_0x4b29('0x42')]=_0x406b7e[_0x4b29('0x42')][_0x4b29('0x44')]?_0x406b7e[_0x4b29('0x42')]:_0x26b15e[_0x4b29('0x3f')];if(!_0x1fba34['query']['hasOwnProperty'](_0x4b29('0x66'))){_0x406b7e[_0x4b29('0x29')]=qs[_0x4b29('0x29')](_0x1fba34[_0x4b29('0x45')][_0x4b29('0x29')]);_0x406b7e['offset']=qs[_0x4b29('0x27')](_0x1fba34[_0x4b29('0x45')][_0x4b29('0x27')]);}_0x406b7e[_0x4b29('0x67')]=qs['sort'](_0x1fba34[_0x4b29('0x45')][_0x4b29('0x47')]);_0x406b7e[_0x4b29('0x48')]=qs[_0x4b29('0x49')](_[_0x4b29('0x4a')](_0x1fba34['query'],_0x26b15e[_0x4b29('0x49')]));_0x406b7e[_0x4b29('0x48')][_0x4b29('0x64')]=_0x3866ba['id'];if(_0x1fba34[_0x4b29('0x45')][_0x4b29('0x4b')]){_0x406b7e[_0x4b29('0x48')]=_[_0x4b29('0x4c')](_0x406b7e[_0x4b29('0x48')],{'$or':_['map'](_0x406b7e[_0x4b29('0x42')],function(_0xab6cb2){var _0x582e04={};_0x582e04[_0xab6cb2]={'$like':'%'+_0x1fba34[_0x4b29('0x45')][_0x4b29('0x4b')]+'%'};return _0x582e04;})});}_0x406b7e=_[_0x4b29('0x4c')]({},_0x406b7e,_0x1fba34[_0x4b29('0x56')]);return db[_0x4b29('0x6d')][_0x4b29('0x2a')]({'where':_0x406b7e['where']})[_0x4b29('0x1b')](function(_0x1bc6b0){_0x4587e3['count']=_0x1bc6b0;if(_0x1fba34[_0x4b29('0x45')][_0x4b29('0x55')]){_0x406b7e['include']=[{'all':!![]}];}return db[_0x4b29('0x6d')][_0x4b29('0x50')](_0x406b7e);})['then'](function(_0x444c5b){_0x4587e3[_0x4b29('0x51')]=_0x444c5b;return _0x4587e3;});}})[_0x4b29('0x1b')](respondWithFilteredResult(_0x165e09,_0x406b7e))[_0x4b29('0x24')](handleError(_0x165e09,null));};exports['removeAnswers']=function(_0x478af8,_0x4e3dd1,_0x268b6d){return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x478af8['params']['id']}})['then'](handleEntityNotFound(_0x4e3dd1,null))[_0x4b29('0x1b')](function(_0x3c1e46){if(_0x3c1e46){return _0x3c1e46[_0x4b29('0x6e')](_0x478af8[_0x4b29('0x45')][_0x4b29('0x69')]);}})[_0x4b29('0x1b')](respondWithStatusCode(_0x4e3dd1,null))[_0x4b29('0x24')](handleError(_0x4e3dd1,null));};exports[_0x4b29('0x6f')]=function(_0x36562c,_0x4dd6b7,_0x428a9a){return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x36562c[_0x4b29('0x53')]['id']}})['then'](handleEntityNotFound(_0x4dd6b7,null))['then'](function(_0x2e87ed){if(_0x2e87ed){return _0x2e87ed[_0x4b29('0x6f')](_0x36562c[_0x4b29('0x58')][_0x4b29('0x69')],_[_0x4b29('0x70')](_0x36562c['body'],[_0x4b29('0x69'),'id'])||{})[_0x4b29('0x71')](function(_0x162d02){for(var _0x2cdcbd=0x0;_0x2cdcbd<_0x36562c['body']['ids'][_0x4b29('0x44')];_0x2cdcbd+=0x1){socket['emit'](_0x4b29('0x72'),{'UserId':Number(_0x36562c[_0x4b29('0x58')][_0x4b29('0x69')][_0x2cdcbd]),'WhatsappAccountId':Number(_0x36562c['params']['id'])});}return _0x162d02;});}})[_0x4b29('0x1b')](respondWithResult(_0x4dd6b7,null))[_0x4b29('0x24')](handleError(_0x4dd6b7,null));};exports[_0x4b29('0x73')]=function(_0x188ae5,_0x34e635,_0x176aba){return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x188ae5['params']['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x34e635,null))['then'](function(_0x5bea1d){if(_0x5bea1d){return _0x5bea1d[_0x4b29('0x73')](_0x188ae5[_0x4b29('0x45')][_0x4b29('0x69')])[_0x4b29('0x1b')](function(){if(_['isArray'](_0x188ae5['query'][_0x4b29('0x69')])){for(var _0x51be0c=0x0;_0x51be0c<_0x188ae5[_0x4b29('0x45')][_0x4b29('0x69')][_0x4b29('0x44')];_0x51be0c+=0x1){socket[_0x4b29('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x188ae5[_0x4b29('0x45')][_0x4b29('0x69')][_0x51be0c]),'WhatsappAccountId':Number(_0x188ae5['params']['id'])});}}else{socket[_0x4b29('0x74')](_0x4b29('0x75'),{'UserId':Number(_0x188ae5[_0x4b29('0x45')][_0x4b29('0x69')]),'WhatsappAccountId':Number(_0x188ae5[_0x4b29('0x53')]['id'])});}});}})[_0x4b29('0x1b')](respondWithStatusCode(_0x34e635,null))[_0x4b29('0x24')](handleError(_0x34e635,null));};exports[_0x4b29('0x76')]=function(_0x1cd6e3,_0x4d7d79,_0x33f8a0){var _0x59ddf9={};var _0x13b13d={};var _0xb45e79;var _0x51f468;return db[_0x4b29('0x4e')]['findOne']({'where':{'id':_0x1cd6e3['params']['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x4d7d79,null))['then'](function(_0x1f7fcf){if(_0x1f7fcf){_0xb45e79=_0x1f7fcf;_0x13b13d['model']=_['keys'](db[_0x4b29('0x77')][_0x4b29('0x3b')]);_0x13b13d['query']=_[_0x4b29('0x40')](_0x1cd6e3[_0x4b29('0x45')]);_0x13b13d[_0x4b29('0x49')]=_[_0x4b29('0x41')](_0x13b13d[_0x4b29('0x3f')],_0x13b13d[_0x4b29('0x45')]);_0x59ddf9[_0x4b29('0x42')]=_[_0x4b29('0x41')](_0x13b13d['model'],qs[_0x4b29('0x43')](_0x1cd6e3[_0x4b29('0x45')]['fields']));_0x59ddf9[_0x4b29('0x42')]=_0x59ddf9[_0x4b29('0x42')][_0x4b29('0x44')]?_0x59ddf9[_0x4b29('0x42')]:_0x13b13d['model'];_0x59ddf9[_0x4b29('0x67')]=qs[_0x4b29('0x47')](_0x1cd6e3[_0x4b29('0x45')][_0x4b29('0x47')]);_0x59ddf9['where']=qs['filters'](_[_0x4b29('0x4a')](_0x1cd6e3['query'],_0x13b13d[_0x4b29('0x49')]));if(_0x1cd6e3[_0x4b29('0x45')][_0x4b29('0x4b')]){_0x59ddf9['where']=_[_0x4b29('0x4c')](_0x59ddf9[_0x4b29('0x48')],{'$or':_[_0x4b29('0x3a')](_0x59ddf9['attributes'],function(_0x5a2e28){var _0x10324c={};_0x10324c[_0x5a2e28]={'$like':'%'+_0x1cd6e3[_0x4b29('0x45')][_0x4b29('0x4b')]+'%'};return _0x10324c;})});}_0x59ddf9=_[_0x4b29('0x4c')]({},_0x59ddf9,_0x1cd6e3[_0x4b29('0x56')]);return _0xb45e79[_0x4b29('0x76')](_0x59ddf9);}})['then'](function(_0x3a6ecc){if(_0x3a6ecc){_0x51f468=_0x3a6ecc[_0x4b29('0x44')];if(!_0x1cd6e3['query']['hasOwnProperty']('nolimit')){_0x59ddf9[_0x4b29('0x29')]=qs[_0x4b29('0x29')](_0x1cd6e3[_0x4b29('0x45')]['limit']);_0x59ddf9[_0x4b29('0x27')]=qs[_0x4b29('0x27')](_0x1cd6e3[_0x4b29('0x45')][_0x4b29('0x27')]);}return _0xb45e79[_0x4b29('0x76')](_0x59ddf9);}})[_0x4b29('0x1b')](function(_0x41d5a3){if(_0x41d5a3){return _0x41d5a3?{'count':_0x51f468,'rows':_0x41d5a3}:null;}})[_0x4b29('0x1b')](respondWithResult(_0x4d7d79,null))[_0x4b29('0x24')](handleError(_0x4d7d79,null));};exports['addApplications']=function(_0x22898a,_0x2d2b38,_0x625d72){return db[_0x4b29('0x4e')][_0x4b29('0x6c')]({'where':{'id':_0x22898a[_0x4b29('0x53')]['id']}})[_0x4b29('0x1b')](handleEntityNotFound(_0x2d2b38,null))[_0x4b29('0x1b')](function(_0x35c5e2){if(_0x35c5e2){return db['sequelize'][_0x4b29('0x78')](function(_0x25db5c){return db[_0x4b29('0x79')]['destroy']({'where':{'WhatsappAccountId':_0x22898a[_0x4b29('0x53')]['id']},'transaction':_0x25db5c})[_0x4b29('0x1b')](function(_0x3247dd){var _0x269db0=_['map'](_0x22898a[_0x4b29('0x58')],function(_0x42b8a7){_0x42b8a7['WhatsappAccountId']=_0x22898a[_0x4b29('0x53')]['id'];return _0x42b8a7;});return db[_0x4b29('0x79')][_0x4b29('0x7a')](_0x269db0,{'transaction':_0x25db5c});});})[_0x4b29('0x1b')](function(){return db[_0x4b29('0x79')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x22898a[_0x4b29('0x53')]['id']},'order':_0x4b29('0x7b')});});}})[_0x4b29('0x1b')](respondWithResult(_0x2d2b38,null))[_0x4b29('0x24')](handleError(_0x2d2b38,null));};exports[_0x4b29('0x7c')]=function(_0x34db95,_0x1965e4,_0x5a5a7e){var _0x1d4357={};var _0x278cde={};var _0x531133;var _0x56474d;return db[_0x4b29('0x4e')][_0x4b29('0x6c')]({'where':{'id':_0x34db95[_0x4b29('0x53')]['id']}})['then'](handleEntityNotFound(_0x1965e4,null))[_0x4b29('0x1b')](function(_0x26e941){if(_0x26e941){_0x531133=_0x26e941;_0x278cde[_0x4b29('0x3f')]=_['keys'](db['WhatsappApplication'][_0x4b29('0x3b')]);_0x278cde[_0x4b29('0x45')]=_[_0x4b29('0x40')](_0x34db95[_0x4b29('0x45')]);_0x278cde[_0x4b29('0x49')]=_[_0x4b29('0x41')](_0x278cde[_0x4b29('0x3f')],_0x278cde[_0x4b29('0x45')]);_0x1d4357[_0x4b29('0x42')]=_['intersection'](_0x278cde['model'],qs['fields'](_0x34db95[_0x4b29('0x45')]['fields']));_0x1d4357[_0x4b29('0x42')]=_0x1d4357[_0x4b29('0x42')][_0x4b29('0x44')]?_0x1d4357[_0x4b29('0x42')]:_0x278cde[_0x4b29('0x3f')];_0x1d4357[_0x4b29('0x67')]=qs[_0x4b29('0x47')](_0x34db95[_0x4b29('0x45')][_0x4b29('0x47')]);_0x1d4357[_0x4b29('0x48')]=qs[_0x4b29('0x49')](_[_0x4b29('0x4a')](_0x34db95[_0x4b29('0x45')],_0x278cde[_0x4b29('0x49')]));if(_0x34db95[_0x4b29('0x45')]['filter']){_0x1d4357[_0x4b29('0x48')]=_[_0x4b29('0x4c')](_0x1d4357[_0x4b29('0x48')],{'$or':_['map'](_0x1d4357[_0x4b29('0x42')],function(_0x328f52){var _0x36030f={};_0x36030f[_0x328f52]={'$like':'%'+_0x34db95[_0x4b29('0x45')][_0x4b29('0x4b')]+'%'};return _0x36030f;})});}_0x1d4357=_[_0x4b29('0x4c')]({},_0x1d4357,_0x34db95['options']);return _0x531133[_0x4b29('0x7c')](_0x1d4357);}})[_0x4b29('0x1b')](function(_0x11201d){if(_0x11201d){_0x56474d=_0x11201d['length'];if(!_0x34db95[_0x4b29('0x45')][_0x4b29('0x46')](_0x4b29('0x66'))){_0x1d4357[_0x4b29('0x29')]=qs[_0x4b29('0x29')](_0x34db95['query'][_0x4b29('0x29')]);_0x1d4357[_0x4b29('0x27')]=qs[_0x4b29('0x27')](_0x34db95['query'][_0x4b29('0x27')]);}return _0x531133['getApplications'](_0x1d4357);}})[_0x4b29('0x1b')](function(_0x1264d6){if(_0x1264d6){return _0x1264d6?{'count':_0x56474d,'rows':_0x1264d6}:null;}})[_0x4b29('0x1b')](respondWithResult(_0x1965e4,null))[_0x4b29('0x24')](handleError(_0x1965e4,null));};exports[_0x4b29('0x7d')]=function(_0x166147,_0x11568c,_0x1bb225){var _0x24ed3c={'channel':_0x4b29('0x7e')};var _0x52ee5b=[];var _0x98c426=[];var _0x1f3b59={};return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x166147[_0x4b29('0x53')]['id']},'include':[{'model':db[_0x4b29('0x79')],'as':'Applications'}]})[_0x4b29('0x1b')](handleEntityNotFound(_0x11568c,null))['then'](function(_0x3beb5b){_0x24ed3c['account']=_0x3beb5b;if(_0x24ed3c['account']&&_0x24ed3c[_0x4b29('0x7f')][_0x4b29('0x3d')]===_0x4b29('0x80')&&_0x166147[_0x4b29('0x58')][_0x4b29('0x81')]){if(_0x166147['body']['statuses']['length']===0x0)return;if(_0x166147[_0x4b29('0x58')]['statuses'][0x0][_0x4b29('0x82')]!=='read')return;return db[_0x4b29('0x83')][_0x4b29('0x30')]({'read':!![],'readAt':_0x166147[_0x4b29('0x58')]['statuses'][0x0][_0x4b29('0x84')]},{'where':{'messageId':_0x166147[_0x4b29('0x58')][_0x4b29('0x81')][0x0][_0x4b29('0x85')]},'individualHooks':!![]})[_0x4b29('0x1b')](function(_0x4b655b){return _0x11568c[_0x4b29('0x25')](0xc8)[_0x4b29('0x26')](_0x4b655b);});}_0x24ed3c[_0x4b29('0x86')]=_[_0x4b29('0x87')](_0x3beb5b[_0x4b29('0x88')],['priority'],[_0x4b29('0x89')]);if(_0x24ed3c[_0x4b29('0x7f')][_0x4b29('0x88')]){delete _0x24ed3c['account']['Applications'];}return db[_0x4b29('0x8a')][_0x4b29('0x62')]()[_0x4b29('0x1b')](function(_0x447c05){if(!_0x447c05){throw new db[(_0x4b29('0x8b'))][(_0x4b29('0x8c'))](_0x4b29('0x8d'));}_0x52ee5b=_['difference'](_['keys'](_0x447c05),[_0x4b29('0x8e'),_0x4b29('0x8f')]);_0x98c426=_[_0x4b29('0x90')](_[_0x4b29('0x40')](_0x447c05),['createdAt',_0x4b29('0x8f'),_0x4b29('0x91'),_0x4b29('0x92')]);_0x24ed3c[_0x4b29('0x58')]={'mapKey':_0x4b29('0x93')};if(_0x24ed3c[_0x4b29('0x7f')]&&_0x24ed3c[_0x4b29('0x7f')][_0x4b29('0x3d')]===_0x4b29('0x94')){_0x24ed3c['body']['from']=_0x166147[_0x4b29('0x58')][_0x4b29('0x95')][_0x4b29('0x96')](_0x4b29('0x97'),'');_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x58')]=_0x166147[_0x4b29('0x58')][_0x4b29('0x98')];_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x99')]=_0x166147[_0x4b29('0x58')][_0x4b29('0x9a')];}if(_0x24ed3c['account']&&_0x24ed3c['account']['type']===_0x4b29('0x80')){_0x24ed3c['body'][_0x4b29('0x9b')]=_0x166147[_0x4b29('0x58')][_0x4b29('0x9c')][0x0]['from'];_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x58')]=_0x166147[_0x4b29('0x58')][_0x4b29('0x9c')][0x0][_0x4b29('0x22')][_0x4b29('0x58')];_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x99')]=_0x166147[_0x4b29('0x58')]['notifications'][0x0][_0x4b29('0x85')];}if(_0x24ed3c[_0x4b29('0x58')]['id']){delete _0x24ed3c[_0x4b29('0x58')]['id'];}if(_['isNil'](_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x9b')])){throw new db[(_0x4b29('0x8b'))]['ValidationError'](_0x4b29('0x9d'));}if(_[_0x4b29('0x9e')](_0x24ed3c['body'][_0x4b29('0x58')])||_0x24ed3c['body'][_0x4b29('0x58')]===''){throw new db['Sequelize'][(_0x4b29('0x8c'))](_0x4b29('0x9f'));}if(_[_0x4b29('0x9e')](_0x24ed3c[_0x4b29('0x58')]['mapKey'])){throw new db['Sequelize'][(_0x4b29('0x8c'))](_0x4b29('0xa0')+_0x98c426);}if(!_[_0x4b29('0xa1')](_0x98c426,_0x24ed3c[_0x4b29('0x58')][_0x4b29('0xa2')])){throw new db[(_0x4b29('0x8b'))][(_0x4b29('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x98c426);}_0x1f3b59[_0x24ed3c['body']['mapKey']]=_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x9b')];return db[_0x4b29('0xa3')][_0x4b29('0x5e')]({'where':{'id':_0x24ed3c['account'][_0x4b29('0x92')]},'include':[{'model':db[_0x4b29('0x8a')],'as':_0x4b29('0xa4'),'where':_0x1f3b59,'limit':0x1,'order':[[_0x4b29('0x8f'),_0x4b29('0xa5')]]}]});})['then'](handleEntityNotFound(_0x11568c,null))[_0x4b29('0x1b')](function(_0x3d18f4){if(_0x3d18f4){_0x24ed3c[_0x4b29('0xa6')]=_[_0x4b29('0x70')](_0x3d18f4,['Contacts']);if(_0x3d18f4['Contacts'][_0x4b29('0x44')]){return _0x3d18f4[_0x4b29('0xa4')][0x0];}var _0x4d3a60=_[_0x4b29('0x14')](_0x24ed3c[_0x4b29('0x58')],{'firstName':_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x9b')],'ListId':_0x3d18f4['id']});_0x4d3a60[_0x24ed3c['body'][_0x4b29('0xa2')]]=_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x9b')];return db[_0x4b29('0x8a')][_0x4b29('0x57')](_0x4d3a60,{'fields':_0x52ee5b,'raw':!![]});}})[_0x4b29('0x1b')](handleEntityNotFound(_0x11568c,null))[_0x4b29('0x1b')](function(_0x4d5e49){if(_0x4d5e49){_0x24ed3c[_0x4b29('0xa7')]=_0x4d5e49;var _0xcbd754={'ContactId':_0x4d5e49['id'],'phone':_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x9b')],'WhatsappAccountId':_0x166147[_0x4b29('0x53')]['id']};var _0x231878={'ContactId':_0x4d5e49['id'],'WhatsappAccountId':_0x166147[_0x4b29('0x53')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x4b29('0x5e')]({'where':_0x231878})[_0x4b29('0x1b')](function(_0x261786){if(_0x261786){return[_0x261786,![]];}return db[_0x4b29('0xa8')]['create'](_0xcbd754)[_0x4b29('0x1b')](function(_0xda3576){return[_0xda3576,!![]];});});}})[_0x4b29('0x71')](function(_0x19d093,_0x4b638f){_0x24ed3c['interaction']=_0x19d093[_0x4b29('0x59')]({'plain':!![]});_0x24ed3c[_0x4b29('0xa9')]['created']=![];if(_0x4b638f){if(_0x24ed3c[_0x4b29('0x7f')][_0x4b29('0xaa')]){_0x24ed3c[_0x4b29('0x86')][_0x4b29('0xab')]({'id':0x0,'priority':_0x24ed3c[_0x4b29('0x86')][_0x4b29('0x44')]+0x1,'app':_0x4b29('0xac'),'appdata':_0x4b29('0xad'),'interval':'*,*,*,*'});}_0x24ed3c[_0x4b29('0xa9')]['created']=!![];}return db[_0x4b29('0x83')]['create']({'phone':_0x24ed3c['body'][_0x4b29('0x9b')],'messageId':_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x99')],'body':_0x24ed3c[_0x4b29('0x58')][_0x4b29('0x58')],'WhatsappAccountId':_0x166147[_0x4b29('0x53')]['id'],'WhatsappInteractionId':_0x19d093['id'],'direction':'in','ContactId':_0x19d093[_0x4b29('0xae')],'AttachmentId':_0x24ed3c[_0x4b29('0x58')]['AttachmentId']});})[_0x4b29('0x1b')](function(_0x5dfa94){_0x24ed3c[_0x4b29('0x22')]=_0x5dfa94;if(_0x24ed3c['interaction'][_0x4b29('0xaf')]){return db[_0x4b29('0x77')]['find']({'attributes':['id',_0x4b29('0x36')],'where':{'id':_0x24ed3c[_0x4b29('0xa9')][_0x4b29('0xaf')]}})['then'](function(_0x3f2e6b){if(_0x3f2e6b){_0x24ed3c[_0x4b29('0x86')][_0x4b29('0xb0')]({'id':0x0,'priority':0x0,'app':_0x4b29('0xb1'),'appdata':_0x3f2e6b[_0x4b29('0x36')]+','+(_0x24ed3c['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4b29('0xb2'),_0x4b29('0xb3'),_0x24ed3c);});}return respondWithRpcPromise(_0x4b29('0xb2'),_0x4b29('0xb3'),_0x24ed3c);})[_0x4b29('0x1b')](function(_0x153a38){if(_0x153a38){var _0x12c2af=0xc8;var _0x2f65a6='receiveMessage';logger[_0x4b29('0x1c')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2f65a6,_0x12c2af,_0x4b29('0xb4'));logger[_0x4b29('0x1e')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2f65a6,_0x12c2af,_0x4b29('0xb4'),JSON['stringify'](_0x153a38));if(_0x24ed3c['account'][_0x4b29('0x3d')]===_0x4b29('0x94')){return _0x11568c[_0x4b29('0x25')](_0x12c2af)['set'](_0x4b29('0xb5'),'text/xml')[_0x4b29('0x37')]('\x0a');}else{return _0x11568c['status'](_0x12c2af)[_0x4b29('0x26')](_0x153a38);}}});})[_0x4b29('0x24')](handleError(_0x11568c,null));};exports['send']=function(_0x3d807b,_0x509a44,_0x3266d3){var _0x31c6aa,_0x4cb87d,_0x572af9;if(_['isNil'](_0x3d807b['body']['body'])||_0x3d807b[_0x4b29('0x58')][_0x4b29('0x58')]===''){throw new db[(_0x4b29('0x8b'))][(_0x4b29('0x8c'))](_0x4b29('0x9f'));}if(_[_0x4b29('0x9e')](_0x3d807b[_0x4b29('0x58')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x31c6aa=_0x3d807b[_0x4b29('0x58')]['to'];return db[_0x4b29('0x4e')][_0x4b29('0x5e')]({'where':{'id':_0x3d807b[_0x4b29('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x4b29('0xb6'),'include':[{'model':db[_0x4b29('0x8a')],'as':'Contacts','where':{'mobile':_0x31c6aa},'limit':0x1,'order':[['updatedAt',_0x4b29('0xa5')]]}]}]})[_0x4b29('0x1b')](handleEntityNotFound(_0x509a44,null))[_0x4b29('0x1b')](function(_0x127869){if(_0x127869&&_0x127869['List']){_0x4cb87d=_0x127869['get']({'plain':!![]});if(_0x4cb87d['List']&&_0x4cb87d['List'][_0x4b29('0xa4')][_0x4b29('0x44')]){return _0x4cb87d[_0x4b29('0xb6')][_0x4b29('0xa4')][0x0];}return db['CmContact'][_0x4b29('0x57')](_['defaults'](_0x3d807b[_0x4b29('0x58')],{'firstName':_0x31c6aa,'mobile':_0x31c6aa,'phone':_0x31c6aa,'ListId':_0x4cb87d[_0x4b29('0x92')]}));}})['then'](handleEntityNotFound(_0x509a44,null))[_0x4b29('0x1b')](function(_0x525242){if(_0x525242){_0x572af9=_0x525242;return db[_0x4b29('0xa8')][_0x4b29('0x5e')]({'where':{'ContactId':_0x572af9['id'],'closed':![],'WhatsappAccountId':_0x4cb87d['id']}})['then'](function(_0x1e7c03){if(_0x1e7c03){return[_0x1e7c03,![]];}return db[_0x4b29('0xa8')][_0x4b29('0x57')]({'UserId':_0x3d807b[_0x4b29('0x5b')]['id'],'ContactId':_0x572af9['id'],'WhatsappAccountId':_0x4cb87d['id'],'phone':_0x31c6aa,'firstMsgDirection':_0x4b29('0xb7'),'Messages':[_[_0x4b29('0x4c')](_0x3d807b['body'],{'read':![],'body':_0x3d807b[_0x4b29('0x58')]['body'],'phone':_0x31c6aa,'WhatsappAccountId':_0x4cb87d['id'],'UserId':_0x3d807b[_0x4b29('0x5b')]['id'],'ContactId':_0x572af9['id']})]},{'include':[{'model':db[_0x4b29('0x83')],'as':'Messages'}]})[_0x4b29('0x1b')](function(_0x16aa9e){return[_0x16aa9e,!![]];});});}})[_0x4b29('0x71')](function(_0xa4b6ff,_0x35ced8){if(_0x35ced8){return _0xa4b6ff;}return db[_0x4b29('0x83')][_0x4b29('0x57')](_['merge'](_0x3d807b[_0x4b29('0x58')],{'read':![],'body':_0x3d807b['body'][_0x4b29('0x58')],'phone':_0x31c6aa,'WhatsappAccountId':_0x4cb87d['id'],'WhatsappInteractionId':_0xa4b6ff['id'],'UserId':_0x3d807b[_0x4b29('0x5b')]['id'],'ContactId':_0x572af9['id']}))[_0x4b29('0x1b')](function(_0x38aa04){_0xa4b6ff[_0x4b29('0xb8')][_0x4b29('0xb9')]=[];_0xa4b6ff[_0x4b29('0xb8')][_0x4b29('0xb9')][_0x4b29('0xab')](_0x38aa04[_0x4b29('0xb8')]);return _0xa4b6ff;});})[_0x4b29('0x1b')](respondWithResult(_0x509a44,null))[_0x4b29('0x24')](handleError(_0x509a44,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b6c17b1..d22f19a 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 _0x617e=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','WhatsappAccount'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x617e,0x193));var _0xe617=function(_0x32b691,_0x3dcf40){_0x32b691=_0x32b691-0x0;var _0x33a54e=_0x617e[_0x32b691];return _0x33a54e;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xe617('0x0'))['db'][_0xe617('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe617('0x2')](0x0);var events={'afterCreate':_0xe617('0x3'),'afterUpdate':_0xe617('0x4'),'afterDestroy':_0xe617('0x5')};function emitEvent(_0x294bea){return function(_0x33b332,_0x40512d,_0x30abd9){WhatsappAccountEvents[_0xe617('0x6')](_0x294bea+':'+_0x33b332['id'],_0x33b332);WhatsappAccountEvents[_0xe617('0x6')](_0x294bea,_0x33b332);_0x30abd9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xe617('0x7')](e,emitEvent(event));}}module[_0xe617('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd3f3=['remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0xd3f3,0x88));var _0x3d3f=function(_0x69f7d3,_0x2d440f){_0x69f7d3=_0x69f7d3-0x0;var _0x170252=_0xd3f3[_0x69f7d3];return _0x170252;};'use strict';var EventEmitter=require(_0x3d3f('0x0'));var WhatsappAccount=require(_0x3d3f('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x3d3f('0x2')](0x0);var events={'afterCreate':_0x3d3f('0x3'),'afterUpdate':'update','afterDestroy':_0x3d3f('0x4')};function emitEvent(_0x57c209){return function(_0xe85991,_0x523457,_0xdeae74){WhatsappAccountEvents[_0x3d3f('0x5')](_0x57c209+':'+_0xe85991['id'],_0xe85991);WhatsappAccountEvents['emit'](_0x57c209,_0xe85991);_0xdeae74(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x3d3f('0x6')](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 dd1fe5e..071a856 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 _0x1c44=['path','rimraf','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0x1c44,0x1be));var _0x41c4=function(_0x595198,_0x3de3a1){_0x595198=_0x595198-0x0;var _0x5720d4=_0x1c44[_0x595198];return _0x5720d4;};'use strict';var _=require(_0x41c4('0x0'));var util=require(_0x41c4('0x1'));var logger=require(_0x41c4('0x2'))(_0x41c4('0x3'));var moment=require(_0x41c4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41c4('0x5'));var rimraf=require(_0x41c4('0x6'));var config=require(_0x41c4('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x41c4('0x8')]=function(_0x491819,_0x16b296){return _0x491819['define'](_0x41c4('0x9'),attributes,{'tableName':_0x41c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe344=['./whatsappAccount.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xe344,0x7b));var _0x4e34=function(_0x4cc6cd,_0x3f4936){_0x4cc6cd=_0x4cc6cd-0x0;var _0x254c09=_0xe344[_0x4cc6cd];return _0x254c09;};'use strict';var _=require('lodash');var util=require(_0x4e34('0x0'));var logger=require(_0x4e34('0x1'))(_0x4e34('0x2'));var moment=require(_0x4e34('0x3'));var BPromise=require(_0x4e34('0x4'));var rp=require(_0x4e34('0x5'));var fs=require('fs');var path=require(_0x4e34('0x6'));var rimraf=require(_0x4e34('0x7'));var config=require(_0x4e34('0x8'));var attributes=require(_0x4e34('0x9'));module[_0x4e34('0xa')]=function(_0x315ec6,_0xace79b){return _0x315ec6[_0x4e34('0xb')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index cae2dc6..2ca3d33 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 _0x0a9e=['localhost','socket.io-emitter','./whatsappAccount.socket','register','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x45fb8f,_0x46da98){var _0x3d906b=function(_0x228ab0){while(--_0x228ab0){_0x45fb8f['push'](_0x45fb8f['shift']());}};_0x3d906b(++_0x46da98);}(_0x0a9e,0x1bb));var _0xe0a9=function(_0x662668,_0x2ea071){_0x662668=_0x662668-0x0;var _0x5e8181=_0x0a9e[_0x662668];return _0x5e8181;};'use strict';var _=require(_0xe0a9('0x0'));var util=require(_0xe0a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0a9('0x2'));var fs=require('fs');var Redis=require(_0xe0a9('0x3'));var db=require(_0xe0a9('0x4'))['db'];var utils=require(_0xe0a9('0x5'));var logger=require('../../config/logger')(_0xe0a9('0x6'));var config=require(_0xe0a9('0x7'));var jayson=require(_0xe0a9('0x8'));var client=jayson[_0xe0a9('0x9')][_0xe0a9('0xa')]({'port':0x232a});config[_0xe0a9('0xb')]=_[_0xe0a9('0xc')](config[_0xe0a9('0xb')],{'host':_0xe0a9('0xd'),'port':0x18eb});var socket=require(_0xe0a9('0xe'))(new Redis(config[_0xe0a9('0xb')]));require(_0xe0a9('0xf'))[_0xe0a9('0x10')](socket);function respondWithRpcPromise(_0x860ce3,_0x25a51e,_0x3d98e6){return new BPromise(function(_0x23307c,_0x2e7d53){return client['request'](_0x860ce3,_0x3d98e6)[_0xe0a9('0x11')](function(_0x100cff){logger['info'](_0xe0a9('0x12'),_0x25a51e,_0xe0a9('0x13'));logger[_0xe0a9('0x14')](_0xe0a9('0x15'),_0x25a51e,_0xe0a9('0x13'),JSON[_0xe0a9('0x16')](_0x100cff));if(_0x100cff[_0xe0a9('0x17')]){if(_0x100cff[_0xe0a9('0x17')][_0xe0a9('0x18')]===0x1f4){logger[_0xe0a9('0x17')](_0xe0a9('0x12'),_0x25a51e,_0x100cff[_0xe0a9('0x17')][_0xe0a9('0x19')]);return _0x2e7d53(_0x100cff[_0xe0a9('0x17')][_0xe0a9('0x19')]);}logger[_0xe0a9('0x17')](_0xe0a9('0x12'),_0x25a51e,_0x100cff[_0xe0a9('0x17')]['message']);return _0x23307c(_0x100cff[_0xe0a9('0x17')]['message']);}else{logger[_0xe0a9('0x1a')](_0xe0a9('0x12'),_0x25a51e,'request\x20sent');_0x23307c(_0x100cff[_0xe0a9('0x1b')][_0xe0a9('0x19')]);}})[_0xe0a9('0x1c')](function(_0x4f1be2){logger['error'](_0xe0a9('0x12'),_0x25a51e,_0x4f1be2);_0x2e7d53(_0x4f1be2);});});}exports[_0xe0a9('0x1d')]=function(_0x5ce3ca){var _0x19ca2a=this;return new Promise(function(_0x51c150,_0x30fa01){return db[_0xe0a9('0x1e')][_0xe0a9('0x1f')]({'raw':_0x5ce3ca['options']?_0x5ce3ca[_0xe0a9('0x20')][_0xe0a9('0x21')]===undefined?!![]:![]:!![],'where':_0x5ce3ca[_0xe0a9('0x20')]?_0x5ce3ca['options'][_0xe0a9('0x22')]||null:null,'attributes':_0x5ce3ca['options']?_0x5ce3ca[_0xe0a9('0x20')][_0xe0a9('0x23')]||null:null,'include':_0x5ce3ca[_0xe0a9('0x20')]?_0x5ce3ca[_0xe0a9('0x20')][_0xe0a9('0x24')]?_['map'](_0x5ce3ca['options'][_0xe0a9('0x24')],function(_0x2e9b20){return{'model':db[_0x2e9b20['model']],'as':_0x2e9b20['as'],'attributes':_0x2e9b20[_0xe0a9('0x23')],'include':_0x2e9b20[_0xe0a9('0x24')]?_[_0xe0a9('0x25')](_0x2e9b20[_0xe0a9('0x24')],function(_0x3b22c8){return{'model':db[_0x3b22c8['model']],'as':_0x3b22c8['as'],'attributes':_0x3b22c8[_0xe0a9('0x23')],'include':_0x3b22c8['include']?_['map'](_0x3b22c8[_0xe0a9('0x24')],function(_0xeade09){return{'model':db[_0xeade09['model']],'as':_0xeade09['as'],'attributes':_0xeade09[_0xe0a9('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe0a9('0x11')](function(_0x1a3ced){logger[_0xe0a9('0x1a')](_0xe0a9('0x1d'),_0x5ce3ca);logger['debug'](_0xe0a9('0x1d'),_0x5ce3ca,JSON[_0xe0a9('0x16')](_0x1a3ced));_0x51c150(_0x1a3ced);})['catch'](function(_0x18c2c2){logger[_0xe0a9('0x17')]('ShowWhatsappAccount',_0x18c2c2['message'],_0x5ce3ca);_0x30fa01(_0x19ca2a[_0xe0a9('0x17')](0x1f4,_0x18c2c2[_0xe0a9('0x19')]));});});}; \ No newline at end of file +var _0x754a=['options','raw','where','attributes','include','map','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x5e8460,_0x2003b5){var _0x3d50fd=function(_0x4c499f){while(--_0x4c499f){_0x5e8460['push'](_0x5e8460['shift']());}};_0x3d50fd(++_0x2003b5);}(_0x754a,0x127));var _0xa754=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x754a[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xa754('0x0'));var util=require(_0xa754('0x1'));var moment=require(_0xa754('0x2'));var BPromise=require('bluebird');var rs=require(_0xa754('0x3'));var fs=require('fs');var Redis=require(_0xa754('0x4'));var db=require(_0xa754('0x5'))['db'];var utils=require(_0xa754('0x6'));var logger=require(_0xa754('0x7'))(_0xa754('0x8'));var config=require(_0xa754('0x9'));var jayson=require(_0xa754('0xa'));var client=jayson[_0xa754('0xb')][_0xa754('0xc')]({'port':0x232a});config[_0xa754('0xd')]=_[_0xa754('0xe')](config[_0xa754('0xd')],{'host':_0xa754('0xf'),'port':0x18eb});var socket=require(_0xa754('0x10'))(new Redis(config['redis']));require(_0xa754('0x11'))[_0xa754('0x12')](socket);function respondWithRpcPromise(_0x32aa92,_0x39af99,_0xd570d7){return new BPromise(function(_0x50095b,_0x43e2ec){return client[_0xa754('0x13')](_0x32aa92,_0xd570d7)[_0xa754('0x14')](function(_0x4c008a){logger['info'](_0xa754('0x15'),_0x39af99,_0xa754('0x16'));logger[_0xa754('0x17')](_0xa754('0x18'),_0x39af99,'request\x20sent',JSON[_0xa754('0x19')](_0x4c008a));if(_0x4c008a[_0xa754('0x1a')]){if(_0x4c008a['error']['code']===0x1f4){logger[_0xa754('0x1a')](_0xa754('0x15'),_0x39af99,_0x4c008a[_0xa754('0x1a')][_0xa754('0x1b')]);return _0x43e2ec(_0x4c008a[_0xa754('0x1a')][_0xa754('0x1b')]);}logger['error'](_0xa754('0x15'),_0x39af99,_0x4c008a[_0xa754('0x1a')][_0xa754('0x1b')]);return _0x50095b(_0x4c008a['error'][_0xa754('0x1b')]);}else{logger[_0xa754('0x1c')]('WhatsappAccount,\x20%s,\x20%s',_0x39af99,_0xa754('0x16'));_0x50095b(_0x4c008a[_0xa754('0x1d')][_0xa754('0x1b')]);}})['catch'](function(_0x3afc53){logger[_0xa754('0x1a')](_0xa754('0x15'),_0x39af99,_0x3afc53);_0x43e2ec(_0x3afc53);});});}exports[_0xa754('0x1e')]=function(_0x4be083){var _0x17fee7=this;return new Promise(function(_0x1334a8,_0x452199){return db[_0xa754('0x1f')][_0xa754('0x20')]({'raw':_0x4be083[_0xa754('0x21')]?_0x4be083[_0xa754('0x21')][_0xa754('0x22')]===undefined?!![]:![]:!![],'where':_0x4be083[_0xa754('0x21')]?_0x4be083['options'][_0xa754('0x23')]||null:null,'attributes':_0x4be083['options']?_0x4be083[_0xa754('0x21')][_0xa754('0x24')]||null:null,'include':_0x4be083[_0xa754('0x21')]?_0x4be083[_0xa754('0x21')][_0xa754('0x25')]?_[_0xa754('0x26')](_0x4be083[_0xa754('0x21')][_0xa754('0x25')],function(_0x1e2e6d){return{'model':db[_0x1e2e6d[_0xa754('0x27')]],'as':_0x1e2e6d['as'],'attributes':_0x1e2e6d[_0xa754('0x24')],'include':_0x1e2e6d[_0xa754('0x25')]?_[_0xa754('0x26')](_0x1e2e6d['include'],function(_0x54c797){return{'model':db[_0x54c797[_0xa754('0x27')]],'as':_0x54c797['as'],'attributes':_0x54c797[_0xa754('0x24')],'include':_0x54c797['include']?_['map'](_0x54c797[_0xa754('0x25')],function(_0x5f44bc){return{'model':db[_0x5f44bc[_0xa754('0x27')]],'as':_0x5f44bc['as'],'attributes':_0x5f44bc[_0xa754('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa754('0x14')](function(_0x4e4963){logger[_0xa754('0x1c')]('ShowWhatsappAccount',_0x4be083);logger['debug'](_0xa754('0x1e'),_0x4be083,JSON['stringify'](_0x4e4963));_0x1334a8(_0x4e4963);})[_0xa754('0x28')](function(_0x36f01d){logger['error'](_0xa754('0x1e'),_0x36f01d[_0xa754('0x1b')],_0x4be083);_0x452199(_0x17fee7[_0xa754('0x1a')](0x1f4,_0x36f01d[_0xa754('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 56dc55d..417f13e 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 _0x96d7=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','emit'];(function(_0x35809f,_0x37203f){var _0x3d05e8=function(_0x200a79){while(--_0x200a79){_0x35809f['push'](_0x35809f['shift']());}};_0x3d05e8(++_0x37203f);}(_0x96d7,0x124));var _0x796d=function(_0x4377a8,_0x4c25be){_0x4377a8=_0x4377a8-0x0;var _0x4edd55=_0x96d7[_0x4377a8];return _0x4edd55;};'use strict';var WhatsappAccountEvents=require(_0x796d('0x0'));var events=['save','remove','update'];function createListener(_0x396f51,_0xd47325){return function(_0x1e13b9){_0xd47325[_0x796d('0x1')](_0x396f51,_0x1e13b9);};}function removeListener(_0x400d2d,_0x53887a){return function(){WhatsappAccountEvents[_0x796d('0x2')](_0x400d2d,_0x53887a);};}exports[_0x796d('0x3')]=function(_0x4d0a52){for(var _0x1d93c8=0x0,_0x2b9b6f=events[_0x796d('0x4')];_0x1d93c8<_0x2b9b6f;_0x1d93c8++){var _0x2a9ba8=events[_0x1d93c8];var _0x21e8cf=createListener(_0x796d('0x5')+_0x2a9ba8,_0x4d0a52);WhatsappAccountEvents['on'](_0x2a9ba8,_0x21e8cf);}}; \ No newline at end of file +var _0xed85=['whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener','length'];(function(_0xcf82b2,_0x49ab9a){var _0x4275e9=function(_0x5b768f){while(--_0x5b768f){_0xcf82b2['push'](_0xcf82b2['shift']());}};_0x4275e9(++_0x49ab9a);}(_0xed85,0xb7));var _0x5ed8=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xed85[_0x1678c8];return _0x387aa9;};'use strict';var WhatsappAccountEvents=require(_0x5ed8('0x0'));var events=[_0x5ed8('0x1'),'remove',_0x5ed8('0x2')];function createListener(_0xe5b2db,_0x9e787f){return function(_0x463223){_0x9e787f[_0x5ed8('0x3')](_0xe5b2db,_0x463223);};}function removeListener(_0x3a6f0a,_0x336539){return function(){WhatsappAccountEvents[_0x5ed8('0x4')](_0x3a6f0a,_0x336539);};}exports['register']=function(_0x5bf8cb){for(var _0x16b3a0=0x0,_0x522ad1=events[_0x5ed8('0x5')];_0x16b3a0<_0x522ad1;_0x16b3a0++){var _0x2694c2=events[_0x16b3a0];var _0x4f4709=createListener(_0x5ed8('0x6')+_0x2694c2,_0x5bf8cb);WhatsappAccountEvents['on'](_0x2694c2,_0x4f4709);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 2ec1303..6172a7a 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 _0xa6d0=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','destroy','exports'];(function(_0x95c6cf,_0x119fae){var _0x217671=function(_0x3697ec){while(--_0x3697ec){_0x95c6cf['push'](_0x95c6cf['shift']());}};_0x217671(++_0x119fae);}(_0xa6d0,0xaa));var _0x0a6d=function(_0x36cf33,_0x185bbd){_0x36cf33=_0x36cf33-0x0;var _0x764cac=_0xa6d0[_0x36cf33];return _0x764cac;};'use strict';var multer=require(_0x0a6d('0x0'));var util=require('util');var path=require(_0x0a6d('0x1'));var timeout=require(_0x0a6d('0x2'));var express=require(_0x0a6d('0x3'));var router=express[_0x0a6d('0x4')]();var fs_extra=require(_0x0a6d('0x5'));var auth=require(_0x0a6d('0x6'));var interaction=require(_0x0a6d('0x7'));var config=require('../../config/environment');var controller=require(_0x0a6d('0x8'));router[_0x0a6d('0x9')]('/',auth[_0x0a6d('0xa')](),controller[_0x0a6d('0xb')]);router['get'](_0x0a6d('0xc'),auth[_0x0a6d('0xa')](),controller[_0x0a6d('0xd')]);router[_0x0a6d('0xe')]('/',auth[_0x0a6d('0xa')](),controller['create']);router['put'](_0x0a6d('0xc'),auth[_0x0a6d('0xa')](),controller['update']);router['delete'](_0x0a6d('0xc'),auth['isAuthenticated'](),controller[_0x0a6d('0xf')]);module[_0x0a6d('0x10')]=router; \ No newline at end of file +var _0x47a9=['destroy','multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x1aa8ac,_0x4370d5){var _0xf54d57=function(_0x3fc38d){while(--_0x3fc38d){_0x1aa8ac['push'](_0x1aa8ac['shift']());}};_0xf54d57(++_0x4370d5);}(_0x47a9,0x1b1));var _0x947a=function(_0x19e9c9,_0xe3399f){_0x19e9c9=_0x19e9c9-0x0;var _0x19ab16=_0x47a9[_0x19e9c9];return _0x19ab16;};'use strict';var multer=require(_0x947a('0x0'));var util=require(_0x947a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x947a('0x2'));var router=express[_0x947a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x947a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x947a('0x5'));var controller=require('./whatsappApplication.controller');router[_0x947a('0x6')]('/',auth[_0x947a('0x7')](),controller['index']);router[_0x947a('0x6')](_0x947a('0x8'),auth[_0x947a('0x7')](),controller[_0x947a('0x9')]);router[_0x947a('0xa')]('/',auth[_0x947a('0x7')](),controller[_0x947a('0xb')]);router[_0x947a('0xc')](_0x947a('0x8'),auth[_0x947a('0x7')](),controller[_0x947a('0xd')]);router[_0x947a('0xe')](_0x947a('0x8'),auth[_0x947a('0x7')](),controller[_0x947a('0xf')]);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 d47b27e..54cbdac 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 _0xa345=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0xd09aa,_0x1a3a80){var _0x3da989=function(_0x5b4750){while(--_0x5b4750){_0xd09aa['push'](_0xd09aa['shift']());}};_0x3da989(++_0x1a3a80);}(_0xa345,0x1cf));var _0x5a34=function(_0x35ed15,_0x4256f9){_0x35ed15=_0x35ed15-0x0;var _0x5e9001=_0xa345[_0x35ed15];return _0x5e9001;};'use strict';var Sequelize=require(_0x5a34('0x0'));module[_0x5a34('0x1')]={'priority':{'type':Sequelize[_0x5a34('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5a34('0x3')]()},'description':{'type':Sequelize[_0x5a34('0x4')]},'interval':{'type':Sequelize[_0x5a34('0x4')],'defaultValue':_0x5a34('0x5')}}; \ No newline at end of file +var _0x4ee7=['TEXT','sequelize','INTEGER','STRING','noop'];(function(_0x9b75a4,_0x3cc2bd){var _0x356323=function(_0x550fc3){while(--_0x550fc3){_0x9b75a4['push'](_0x9b75a4['shift']());}};_0x356323(++_0x3cc2bd);}(_0x4ee7,0xe7));var _0x74ee=function(_0x3e6fe9,_0x2eab27){_0x3e6fe9=_0x3e6fe9-0x0;var _0x168044=_0x4ee7[_0x3e6fe9];return _0x168044;};'use strict';var Sequelize=require(_0x74ee('0x0'));module['exports']={'priority':{'type':Sequelize[_0x74ee('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x74ee('0x2')],'allowNull':![],'defaultValue':_0x74ee('0x3')},'appdata':{'type':Sequelize[_0x74ee('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fc9cfa0..276dd8b 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 _0x471a=['Content-Range','apply','reject','save','then','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','length','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x471a,0x18d));var _0xa471=function(_0xd4d369,_0x4f6ad2){_0xd4d369=_0xd4d369-0x0;var _0x293e5d=_0x471a[_0xd4d369];return _0x293e5d;};'use strict';var emlformat=require(_0xa471('0x0'));var rimraf=require(_0xa471('0x1'));var zipdir=require(_0xa471('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa471('0x3'));var moment=require(_0xa471('0x4'));var BPromise=require(_0xa471('0x5'));var Mustache=require(_0xa471('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa471('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa471('0x8'));var crypto=require(_0xa471('0x9'));var jsforce=require(_0xa471('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa471('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa471('0xb'));var authService=require(_0xa471('0xc'));var qs=require(_0xa471('0xd'));var as=require(_0xa471('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa471('0xf'))(_0xa471('0x10'));var utils=require(_0xa471('0x11'));var config=require(_0xa471('0x12'));var licenseUtil=require(_0xa471('0x13'));var db=require(_0xa471('0x14'))['db'];function respondWithStatusCode(_0x5703c9,_0x2ae2a2){_0x2ae2a2=_0x2ae2a2||0xcc;return function(_0x4f1a44){if(_0x4f1a44){return _0x5703c9[_0xa471('0x15')](_0x2ae2a2);}return _0x5703c9['status'](_0x2ae2a2)[_0xa471('0x16')]();};}function respondWithResult(_0x115541,_0x501375){_0x501375=_0x501375||0xc8;return function(_0x39c025){if(_0x39c025){return _0x115541[_0xa471('0x17')](_0x501375)[_0xa471('0x18')](_0x39c025);}};}function respondWithFilteredResult(_0x531451,_0x31bcb7){return function(_0x1ed20c){if(_0x1ed20c){var _0x16e5bf=typeof _0x31bcb7[_0xa471('0x19')]===_0xa471('0x1a')&&typeof _0x31bcb7['limit']===_0xa471('0x1a');var _0x35f2f3=_0x1ed20c[_0xa471('0x1b')];var _0x5e5225=_0x16e5bf?0x0:_0x31bcb7['offset'];var _0x23fb08=_0x16e5bf?_0x1ed20c['count']:_0x31bcb7[_0xa471('0x19')]+_0x31bcb7['limit'];var _0x5e56dc;if(_0x23fb08>=_0x35f2f3){_0x23fb08=_0x35f2f3;_0x5e56dc=0xc8;}else{_0x5e56dc=0xce;}_0x531451[_0xa471('0x17')](_0x5e56dc);return _0x531451[_0xa471('0x1c')](_0xa471('0x1d'),_0x5e5225+'-'+_0x23fb08+'/'+_0x35f2f3)[_0xa471('0x18')](_0x1ed20c);}return null;};}function patchUpdates(_0x45ff30){return function(_0x6b230){try{jsonpatch[_0xa471('0x1e')](_0x6b230,_0x45ff30,!![]);}catch(_0x554610){return BPromise[_0xa471('0x1f')](_0x554610);}return _0x6b230[_0xa471('0x20')]();};}function saveUpdates(_0x398f23,_0x49ea0b){return function(_0x3e0972){if(_0x3e0972){return _0x3e0972['update'](_0x398f23)[_0xa471('0x21')](function(_0x2b7755){return _0x2b7755;});}return null;};}function removeEntity(_0x56a34e,_0x21b9e5){return function(_0x41a855){if(_0x41a855){return _0x41a855['destroy']()[_0xa471('0x21')](function(){_0x56a34e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x188d6a,_0x2b1d3c){return function(_0x56682a){if(!_0x56682a){_0x188d6a['sendStatus'](0x194);}return _0x56682a;};}function handleError(_0x165504,_0x2d2a91){_0x2d2a91=_0x2d2a91||0x1f4;return function(_0x5009cf){logger[_0xa471('0x22')](_0x5009cf[_0xa471('0x23')]);if(_0x5009cf[_0xa471('0x24')]){delete _0x5009cf[_0xa471('0x24')];}_0x165504['status'](_0x2d2a91)[_0xa471('0x25')](_0x5009cf);};}exports[_0xa471('0x26')]=function(_0x5a3f99,_0x3851d9){var _0x3bb318={},_0x469b08={},_0x3961b5={'count':0x0,'rows':[]};var _0x5d4441=_[_0xa471('0x27')](db[_0xa471('0x28')]['rawAttributes'],function(_0x4eb527){return{'name':_0x4eb527[_0xa471('0x29')],'type':_0x4eb527[_0xa471('0x2a')][_0xa471('0x2b')]};});_0x469b08[_0xa471('0x2c')]=_[_0xa471('0x27')](_0x5d4441,'name');_0x469b08[_0xa471('0x2d')]=_[_0xa471('0x2e')](_0x5a3f99[_0xa471('0x2d')]);_0x469b08[_0xa471('0x2f')]=_[_0xa471('0x30')](_0x469b08[_0xa471('0x2c')],_0x469b08[_0xa471('0x2d')]);_0x3bb318[_0xa471('0x31')]=_[_0xa471('0x30')](_0x469b08['model'],qs[_0xa471('0x32')](_0x5a3f99[_0xa471('0x2d')][_0xa471('0x32')]));_0x3bb318[_0xa471('0x31')]=_0x3bb318[_0xa471('0x31')]['length']?_0x3bb318[_0xa471('0x31')]:_0x469b08[_0xa471('0x2c')];if(!_0x5a3f99[_0xa471('0x2d')][_0xa471('0x33')](_0xa471('0x34'))){_0x3bb318[_0xa471('0x35')]=qs['limit'](_0x5a3f99[_0xa471('0x2d')][_0xa471('0x35')]);_0x3bb318[_0xa471('0x19')]=qs[_0xa471('0x19')](_0x5a3f99[_0xa471('0x2d')][_0xa471('0x19')]);}_0x3bb318['order']=qs[_0xa471('0x36')](_0x5a3f99['query']['sort']);_0x3bb318[_0xa471('0x37')]=qs[_0xa471('0x2f')](_[_0xa471('0x38')](_0x5a3f99[_0xa471('0x2d')],_0x469b08[_0xa471('0x2f')]),_0x5d4441);if(_0x5a3f99['query'][_0xa471('0x39')]){_0x3bb318[_0xa471('0x37')]=_[_0xa471('0x3a')](_0x3bb318[_0xa471('0x37')],{'$or':_[_0xa471('0x27')](_0x5d4441,function(_0xcf1361){if(_0xcf1361[_0xa471('0x2a')]!=='VIRTUAL'){var _0x2aefbf={};_0x2aefbf[_0xcf1361[_0xa471('0x24')]]={'$like':'%'+_0x5a3f99['query']['filter']+'%'};return _0x2aefbf;}})});}_0x3bb318=_[_0xa471('0x3a')]({},_0x3bb318,_0x5a3f99[_0xa471('0x3b')]);var _0x2d98f0={'where':_0x3bb318[_0xa471('0x37')]};return db[_0xa471('0x28')][_0xa471('0x1b')](_0x2d98f0)[_0xa471('0x21')](function(_0xcc3f85){_0x3961b5[_0xa471('0x1b')]=_0xcc3f85;if(_0x5a3f99['query'][_0xa471('0x3c')]){_0x3bb318['include']=[{'all':!![]}];}return db[_0xa471('0x28')][_0xa471('0x3d')](_0x3bb318);})[_0xa471('0x21')](function(_0x19eb6e){_0x3961b5[_0xa471('0x3e')]=_0x19eb6e;return _0x3961b5;})[_0xa471('0x21')](respondWithFilteredResult(_0x3851d9,_0x3bb318))[_0xa471('0x3f')](handleError(_0x3851d9,null));};exports['show']=function(_0xc932ae,_0x2d848a){var _0x50668b={'raw':!![],'where':{'id':_0xc932ae[_0xa471('0x40')]['id']}},_0x38ec90={};_0x38ec90['model']=_['keys'](db[_0xa471('0x28')][_0xa471('0x41')]);_0x38ec90[_0xa471('0x2d')]=_[_0xa471('0x2e')](_0xc932ae[_0xa471('0x2d')]);_0x38ec90[_0xa471('0x2f')]=_[_0xa471('0x30')](_0x38ec90[_0xa471('0x2c')],_0x38ec90[_0xa471('0x2d')]);_0x50668b[_0xa471('0x31')]=_[_0xa471('0x30')](_0x38ec90[_0xa471('0x2c')],qs['fields'](_0xc932ae[_0xa471('0x2d')][_0xa471('0x32')]));_0x50668b[_0xa471('0x31')]=_0x50668b[_0xa471('0x31')][_0xa471('0x42')]?_0x50668b['attributes']:_0x38ec90[_0xa471('0x2c')];if(_0xc932ae['query'][_0xa471('0x3c')]){_0x50668b['include']=[{'all':!![]}];}_0x50668b=_[_0xa471('0x3a')]({},_0x50668b,_0xc932ae[_0xa471('0x3b')]);return db[_0xa471('0x28')][_0xa471('0x43')](_0x50668b)[_0xa471('0x21')](handleEntityNotFound(_0x2d848a,null))['then'](respondWithResult(_0x2d848a,null))[_0xa471('0x3f')](handleError(_0x2d848a,null));};exports['create']=function(_0x2fb716,_0x39e2d8){return db[_0xa471('0x28')][_0xa471('0x44')](_0x2fb716[_0xa471('0x45')],{})['then'](respondWithResult(_0x39e2d8,0xc9))[_0xa471('0x3f')](handleError(_0x39e2d8,null));};exports['update']=function(_0x5c0efe,_0x2cf4a9){if(_0x5c0efe['body']['id']){delete _0x5c0efe['body']['id'];}return db[_0xa471('0x28')]['find']({'where':{'id':_0x5c0efe[_0xa471('0x40')]['id']}})[_0xa471('0x21')](handleEntityNotFound(_0x2cf4a9,null))['then'](saveUpdates(_0x5c0efe[_0xa471('0x45')],null))[_0xa471('0x21')](respondWithResult(_0x2cf4a9,null))[_0xa471('0x3f')](handleError(_0x2cf4a9,null));};exports[_0xa471('0x46')]=function(_0x3e486f,_0x21323b){return db[_0xa471('0x28')]['find']({'where':{'id':_0x3e486f[_0xa471('0x40')]['id']}})[_0xa471('0x21')](handleEntityNotFound(_0x21323b,null))[_0xa471('0x21')](removeEntity(_0x21323b,null))['catch'](handleError(_0x21323b,null));}; \ No newline at end of file +var _0x5f6f=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index','WhatsappApplication','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','body','eml-format','rimraf'];(function(_0x1559a3,_0x1e4f51){var _0x3a4b87=function(_0x5212d2){while(--_0x5212d2){_0x1559a3['push'](_0x1559a3['shift']());}};_0x3a4b87(++_0x1e4f51);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2bdf6c,_0x571482){_0x2bdf6c=_0x2bdf6c-0x0;var _0x1f702c=_0x5f6f[_0x2bdf6c];return _0x1f702c;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require(_0xf5f6('0x1'));var zipdir=require(_0xf5f6('0x2'));var jsonpatch=require(_0xf5f6('0x3'));var rp=require(_0xf5f6('0x4'));var moment=require('moment');var BPromise=require(_0xf5f6('0x5'));var Mustache=require(_0xf5f6('0x6'));var util=require(_0xf5f6('0x7'));var path=require('path');var sox=require(_0xf5f6('0x8'));var csv=require(_0xf5f6('0x9'));var ejs=require(_0xf5f6('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf5f6('0xc'));var jsforce=require(_0xf5f6('0xd'));var deskjs=require(_0xf5f6('0xe'));var toCsv=require(_0xf5f6('0x9'));var querystring=require(_0xf5f6('0xf'));var Papa=require(_0xf5f6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f6('0x11'));var as=require(_0xf5f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f6('0x13'))(_0xf5f6('0x14'));var utils=require(_0xf5f6('0x15'));var config=require(_0xf5f6('0x16'));var licenseUtil=require(_0xf5f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b407d,_0x4cde56){_0x4cde56=_0x4cde56||0xcc;return function(_0x2a62c5){if(_0x2a62c5){return _0x3b407d[_0xf5f6('0x18')](_0x4cde56);}return _0x3b407d[_0xf5f6('0x19')](_0x4cde56)[_0xf5f6('0x1a')]();};}function respondWithResult(_0x52648d,_0x96661c){_0x96661c=_0x96661c||0xc8;return function(_0x33cc8a){if(_0x33cc8a){return _0x52648d[_0xf5f6('0x19')](_0x96661c)[_0xf5f6('0x1b')](_0x33cc8a);}};}function respondWithFilteredResult(_0x504cd9,_0x1e3037){return function(_0x3f9f49){if(_0x3f9f49){var _0x21ccf7=typeof _0x1e3037[_0xf5f6('0x1c')]==='undefined'&&typeof _0x1e3037['limit']===_0xf5f6('0x1d');var _0x59a37e=_0x3f9f49[_0xf5f6('0x1e')];var _0x4dd3ae=_0x21ccf7?0x0:_0x1e3037[_0xf5f6('0x1c')];var _0x294af2=_0x21ccf7?_0x3f9f49[_0xf5f6('0x1e')]:_0x1e3037[_0xf5f6('0x1c')]+_0x1e3037[_0xf5f6('0x1f')];var _0x3199f0;if(_0x294af2>=_0x59a37e){_0x294af2=_0x59a37e;_0x3199f0=0xc8;}else{_0x3199f0=0xce;}_0x504cd9['status'](_0x3199f0);return _0x504cd9[_0xf5f6('0x20')](_0xf5f6('0x21'),_0x4dd3ae+'-'+_0x294af2+'/'+_0x59a37e)[_0xf5f6('0x1b')](_0x3f9f49);}return null;};}function patchUpdates(_0x261015){return function(_0x46de8c){try{jsonpatch['apply'](_0x46de8c,_0x261015,!![]);}catch(_0x1049e8){return BPromise[_0xf5f6('0x22')](_0x1049e8);}return _0x46de8c[_0xf5f6('0x23')]();};}function saveUpdates(_0x579375,_0x253b42){return function(_0x32f27e){if(_0x32f27e){return _0x32f27e[_0xf5f6('0x24')](_0x579375)[_0xf5f6('0x25')](function(_0x49906c){return _0x49906c;});}return null;};}function removeEntity(_0x4adf54,_0x1503e0){return function(_0x198cbb){if(_0x198cbb){return _0x198cbb[_0xf5f6('0x26')]()['then'](function(){_0x4adf54[_0xf5f6('0x19')](0xcc)[_0xf5f6('0x1a')]();});}};}function handleEntityNotFound(_0x9500e5,_0x4db805){return function(_0x537a81){if(!_0x537a81){_0x9500e5[_0xf5f6('0x18')](0x194);}return _0x537a81;};}function handleError(_0x43c29d,_0x23ed8c){_0x23ed8c=_0x23ed8c||0x1f4;return function(_0x265457){logger['error'](_0x265457[_0xf5f6('0x27')]);if(_0x265457[_0xf5f6('0x28')]){delete _0x265457['name'];}_0x43c29d[_0xf5f6('0x19')](_0x23ed8c)['send'](_0x265457);};}exports[_0xf5f6('0x29')]=function(_0x8867ac,_0x4b56f7){var _0x3e66b9={},_0x3043fd={},_0x19d7f0={'count':0x0,'rows':[]};var _0x1e6cf2=_['map'](db[_0xf5f6('0x2a')]['rawAttributes'],function(_0x254810){return{'name':_0x254810[_0xf5f6('0x2b')],'type':_0x254810[_0xf5f6('0x2c')][_0xf5f6('0x2d')]};});_0x3043fd['model']=_[_0xf5f6('0x2e')](_0x1e6cf2,'name');_0x3043fd[_0xf5f6('0x2f')]=_[_0xf5f6('0x30')](_0x8867ac['query']);_0x3043fd[_0xf5f6('0x31')]=_[_0xf5f6('0x32')](_0x3043fd[_0xf5f6('0x33')],_0x3043fd[_0xf5f6('0x2f')]);_0x3e66b9[_0xf5f6('0x34')]=_[_0xf5f6('0x32')](_0x3043fd[_0xf5f6('0x33')],qs['fields'](_0x8867ac[_0xf5f6('0x2f')]['fields']));_0x3e66b9[_0xf5f6('0x34')]=_0x3e66b9[_0xf5f6('0x34')]['length']?_0x3e66b9['attributes']:_0x3043fd[_0xf5f6('0x33')];if(!_0x8867ac[_0xf5f6('0x2f')][_0xf5f6('0x35')](_0xf5f6('0x36'))){_0x3e66b9[_0xf5f6('0x1f')]=qs[_0xf5f6('0x1f')](_0x8867ac[_0xf5f6('0x2f')][_0xf5f6('0x1f')]);_0x3e66b9['offset']=qs[_0xf5f6('0x1c')](_0x8867ac[_0xf5f6('0x2f')][_0xf5f6('0x1c')]);}_0x3e66b9['order']=qs['sort'](_0x8867ac[_0xf5f6('0x2f')]['sort']);_0x3e66b9['where']=qs[_0xf5f6('0x31')](_[_0xf5f6('0x37')](_0x8867ac[_0xf5f6('0x2f')],_0x3043fd['filters']),_0x1e6cf2);if(_0x8867ac[_0xf5f6('0x2f')][_0xf5f6('0x38')]){_0x3e66b9['where']=_[_0xf5f6('0x39')](_0x3e66b9['where'],{'$or':_['map'](_0x1e6cf2,function(_0x1e1037){if(_0x1e1037['type']!=='VIRTUAL'){var _0x3dec2d={};_0x3dec2d[_0x1e1037[_0xf5f6('0x28')]]={'$like':'%'+_0x8867ac[_0xf5f6('0x2f')]['filter']+'%'};return _0x3dec2d;}})});}_0x3e66b9=_['merge']({},_0x3e66b9,_0x8867ac[_0xf5f6('0x3a')]);var _0x34ddd9={'where':_0x3e66b9[_0xf5f6('0x3b')]};return db['WhatsappApplication'][_0xf5f6('0x1e')](_0x34ddd9)[_0xf5f6('0x25')](function(_0x1e138c){_0x19d7f0[_0xf5f6('0x1e')]=_0x1e138c;if(_0x8867ac[_0xf5f6('0x2f')][_0xf5f6('0x3c')]){_0x3e66b9[_0xf5f6('0x3d')]=[{'all':!![]}];}return db[_0xf5f6('0x2a')][_0xf5f6('0x3e')](_0x3e66b9);})['then'](function(_0xc344b3){_0x19d7f0[_0xf5f6('0x3f')]=_0xc344b3;return _0x19d7f0;})[_0xf5f6('0x25')](respondWithFilteredResult(_0x4b56f7,_0x3e66b9))[_0xf5f6('0x40')](handleError(_0x4b56f7,null));};exports[_0xf5f6('0x41')]=function(_0x7cea0c,_0x13ba96){var _0x26b6d5={'raw':!![],'where':{'id':_0x7cea0c[_0xf5f6('0x42')]['id']}},_0x37d9a2={};_0x37d9a2[_0xf5f6('0x33')]=_['keys'](db[_0xf5f6('0x2a')][_0xf5f6('0x43')]);_0x37d9a2[_0xf5f6('0x2f')]=_['keys'](_0x7cea0c[_0xf5f6('0x2f')]);_0x37d9a2[_0xf5f6('0x31')]=_['intersection'](_0x37d9a2[_0xf5f6('0x33')],_0x37d9a2['query']);_0x26b6d5['attributes']=_[_0xf5f6('0x32')](_0x37d9a2[_0xf5f6('0x33')],qs[_0xf5f6('0x44')](_0x7cea0c['query'][_0xf5f6('0x44')]));_0x26b6d5[_0xf5f6('0x34')]=_0x26b6d5[_0xf5f6('0x34')]['length']?_0x26b6d5[_0xf5f6('0x34')]:_0x37d9a2['model'];if(_0x7cea0c[_0xf5f6('0x2f')]['includeAll']){_0x26b6d5[_0xf5f6('0x3d')]=[{'all':!![]}];}_0x26b6d5=_[_0xf5f6('0x39')]({},_0x26b6d5,_0x7cea0c[_0xf5f6('0x3a')]);return db[_0xf5f6('0x2a')][_0xf5f6('0x45')](_0x26b6d5)['then'](handleEntityNotFound(_0x13ba96,null))['then'](respondWithResult(_0x13ba96,null))[_0xf5f6('0x40')](handleError(_0x13ba96,null));};exports['create']=function(_0x29438a,_0x4283a5){return db[_0xf5f6('0x2a')]['create'](_0x29438a[_0xf5f6('0x46')],{})[_0xf5f6('0x25')](respondWithResult(_0x4283a5,0xc9))[_0xf5f6('0x40')](handleError(_0x4283a5,null));};exports[_0xf5f6('0x24')]=function(_0x44c264,_0x1fe5a5){if(_0x44c264['body']['id']){delete _0x44c264[_0xf5f6('0x46')]['id'];}return db[_0xf5f6('0x2a')]['find']({'where':{'id':_0x44c264[_0xf5f6('0x42')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x1fe5a5,null))[_0xf5f6('0x25')](saveUpdates(_0x44c264[_0xf5f6('0x46')],null))[_0xf5f6('0x25')](respondWithResult(_0x1fe5a5,null))[_0xf5f6('0x40')](handleError(_0x1fe5a5,null));};exports[_0xf5f6('0x26')]=function(_0x18c9cf,_0x56c530){return db[_0xf5f6('0x2a')]['find']({'where':{'id':_0x18c9cf[_0xf5f6('0x42')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x56c530,null))[_0xf5f6('0x25')](removeEntity(_0x56c530,null))['catch'](handleError(_0x56c530,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index b338b87..b8df978 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 _0x0a52=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path'];(function(_0x394734,_0x1e9bce){var _0x5d38d6=function(_0x4a49d3){while(--_0x4a49d3){_0x394734['push'](_0x394734['shift']());}};_0x5d38d6(++_0x1e9bce);}(_0x0a52,0xe4));var _0x20a5=function(_0x1dbc84,_0xffa93e){_0x1dbc84=_0x1dbc84-0x0;var _0x5be2c3=_0x0a52[_0x1dbc84];return _0x5be2c3;};'use strict';var _=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var logger=require('../../config/logger')(_0x20a5('0x2'));var moment=require(_0x20a5('0x3'));var BPromise=require(_0x20a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a5('0x5'));var rimraf=require(_0x20a5('0x6'));var config=require(_0x20a5('0x7'));var attributes=require(_0x20a5('0x8'));module[_0x20a5('0x9')]=function(_0x1fcc72,_0x4acc66){return _0x1fcc72['define'](_0x20a5('0xa'),attributes,{'tableName':_0x20a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x20a5('0xc')});}; \ No newline at end of file +var _0xa8eb=['bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','lodash','../../config/logger','moment'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0xa8eb,0x179));var _0xba8e=function(_0x364997,_0x3ce8bd){_0x364997=_0x364997-0x0;var _0x27e571=_0xa8eb[_0x364997];return _0x27e571;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var logger=require(_0xba8e('0x1'))('api');var moment=require(_0xba8e('0x2'));var BPromise=require(_0xba8e('0x3'));var rp=require(_0xba8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0xba8e('0x7')]=function(_0x57e345,_0x14c3ac){return _0x57e345['define'](_0xba8e('0x8'),attributes,{'tableName':_0xba8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 6a97f39..6d2b8e0 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4ffb3d,_0x152a2d){var _0x53794a=function(_0x42edbd){while(--_0x42edbd){_0x4ffb3d['push'](_0x4ffb3d['shift']());}};_0x53794a(++_0x152a2d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x5d3679,_0x3911a8){_0x5d3679=_0x5d3679-0x0;var _0x23a806=_0x4c4e[_0x5d3679];return _0x23a806;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22cc36,_0x2c8292){var _0x7fc85=function(_0x4e476d){while(--_0x4e476d){_0x22cc36['push'](_0x22cc36['shift']());}};_0x7fc85(++_0x2c8292);}(_0x2d17,0x17e));var _0x72d1=function(_0x5bbe1a,_0x557a0b){_0x5bbe1a=_0x5bbe1a-0x0;var _0x4e6a88=_0x2d17[_0x5bbe1a];return _0x4e6a88;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 2591d92..a9fb31a 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 _0x56a4=['create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsapp','whatsappinteraction:destroy','removeTags','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x56a4,0x11b));var _0x456a=function(_0x532b5b,_0xce6ec8){_0x532b5b=_0x532b5b-0x0;var _0x169ff9=_0x56a4[_0x532b5b];return _0x169ff9;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0x8')](_0x456a('0xc'),auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0x8')](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0x11')]);router['post'](_0x456a('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x456a('0x10')](_0x456a('0x12'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x14')),controller[_0x456a('0x15')]);router[_0x456a('0x16')](_0x456a('0x17'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x18')),controller[_0x456a('0x19')]);router[_0x456a('0x1a')](_0x456a('0x17'),auth['isAuthenticated'](),interaction[_0x456a('0x13')](_0x456a('0x1b'),_0x456a('0x1c')),controller['destroy']);router[_0x456a('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x456a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x687b=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','destroy','delete','/:id/tags','removeTags'];(function(_0x101c3d,_0x449b7f){var _0x5953c8=function(_0x45a9fd){while(--_0x45a9fd){_0x101c3d['push'](_0x101c3d['shift']());}};_0x5953c8(++_0x449b7f);}(_0x687b,0x14a));var _0xb687=function(_0x4711fc,_0x31742c){_0x4711fc=_0x4711fc-0x0;var _0x4c1eaf=_0x687b[_0x4711fc];return _0x4c1eaf;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0x9')](_0xb687('0xf'),auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x9')](_0xb687('0x11'),auth[_0xb687('0xa')](),controller['download']);router[_0xb687('0x12')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);router[_0xb687('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb687('0x14')]);router[_0xb687('0x12')]('/:id/tags',auth[_0xb687('0xa')](),interaction[_0xb687('0x15')](_0xb687('0x16'),_0xb687('0x17')),controller[_0xb687('0x18')]);router[_0xb687('0x19')](_0xb687('0x1a'),auth[_0xb687('0xa')](),interaction[_0xb687('0x15')](_0xb687('0x16'),_0xb687('0x1b')),controller[_0xb687('0x1c')]);router['delete'](_0xb687('0x1a'),auth[_0xb687('0xa')](),interaction[_0xb687('0x15')]('whatsapp','whatsappinteraction:destroy'),controller[_0xb687('0x1d')]);router[_0xb687('0x1e')](_0xb687('0x1f'),auth['isAuthenticated'](),controller[_0xb687('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 78de2a0..61cce9b 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 _0x0967=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x470f3b,_0x1af0e8){var _0xa509a2=function(_0xa609d){while(--_0xa609d){_0x470f3b['push'](_0x470f3b['shift']());}};_0xa509a2(++_0x1af0e8);}(_0x0967,0x100));var _0x7096=function(_0x3a397a,_0x3a5ecc){_0x3a397a=_0x3a397a-0x0;var _0x20cc04=_0x0967[_0x3a397a];return _0x20cc04;};'use strict';var Sequelize=require(_0x7096('0x0'));var moment=require('moment');module[_0x7096('0x1')]={'closed':{'type':Sequelize[_0x7096('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7096('0x3')]},'disposition':{'type':Sequelize[_0x7096('0x4')]},'secondDisposition':{'type':Sequelize[_0x7096('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7096('0x4')]},'note':{'type':Sequelize[_0x7096('0x4')]},'phone':{'type':Sequelize[_0x7096('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7096('0x5')]('in',_0x7096('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7096('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7096('0x5')]('in',_0x7096('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7096('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xa1aa=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x5ad3b7,_0x1a6bb5){var _0x4bf9ff=function(_0x3153d1){while(--_0x3153d1){_0x5ad3b7['push'](_0x5ad3b7['shift']());}};_0x4bf9ff(++_0x1a6bb5);}(_0xa1aa,0x88));var _0xaa1a=function(_0x49817c,_0x54c345){_0x49817c=_0x49817c-0x0;var _0x267faa=_0xa1aa[_0x49817c];return _0x267faa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xaa1a('0x0')]={'closed':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaa1a('0x2')]},'disposition':{'type':Sequelize[_0xaa1a('0x3')]},'secondDisposition':{'type':Sequelize[_0xaa1a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaa1a('0x3')]},'note':{'type':Sequelize[_0xaa1a('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xaa1a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xaa1a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaa1a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaa1a('0x4')]('in',_0xaa1a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 7e545ee..1a42532 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 _0x1bb2=['role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','WhatsappInteraction','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.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','pick','WhatsappInteractionId','merge','findAll','setTags','spread','emit','download','unix','files','tmp','root','attachments','join','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','basename','existsSync','createReadStream','pipe','out','System','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','Users','fullname','Tags','TagIds','split','forEach','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','select','field','color','from','u.id','u.fullname','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','length','getFullTextValue','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?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','WhatsappAccountId','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL'];(function(_0x2c8b66,_0x32c316){var _0x82b303=function(_0x1cf916){while(--_0x1cf916){_0x2c8b66['push'](_0x2c8b66['shift']());}};_0x82b303(++_0x32c316);}(_0x1bb2,0x152));var _0x21bb=function(_0x1f4e39,_0xa2aa6a){_0x1f4e39=_0x1f4e39-0x0;var _0x1b8001=_0x1bb2[_0x1f4e39];return _0x1b8001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21bb('0x0'));var zipdir=require(_0x21bb('0x1'));var jsonpatch=require(_0x21bb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21bb('0x3'));var Mustache=require(_0x21bb('0x4'));var util=require(_0x21bb('0x5'));var path=require(_0x21bb('0x6'));var sox=require(_0x21bb('0x7'));var csv=require(_0x21bb('0x8'));var ejs=require(_0x21bb('0x9'));var fs=require('fs');var fs_extra=require(_0x21bb('0xa'));var _=require(_0x21bb('0xb'));var squel=require(_0x21bb('0xc'));var crypto=require(_0x21bb('0xd'));var jsforce=require(_0x21bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x21bb('0x8'));var querystring=require('querystring');var Papa=require(_0x21bb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x21bb('0x10'));var as=require(_0x21bb('0x11'));var pdf=require(_0x21bb('0x12'));var hardwareService=require(_0x21bb('0x13'));var logger=require(_0x21bb('0x14'))(_0x21bb('0x15'));var utils=require(_0x21bb('0x16'));var config=require(_0x21bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x21bb('0x18'))['db'];config[_0x21bb('0x19')]=_['defaults'](config[_0x21bb('0x19')],{'host':_0x21bb('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21bb('0x19')]));require(_0x21bb('0x1b'))[_0x21bb('0x1c')](socket);function respondWithStatusCode(_0x3fd2d9,_0x5a66d5){_0x5a66d5=_0x5a66d5||0xcc;return function(_0x2eaa36){if(_0x2eaa36){return _0x3fd2d9['sendStatus'](_0x5a66d5);}return _0x3fd2d9['status'](_0x5a66d5)[_0x21bb('0x1d')]();};}function respondWithResult(_0x1ef9a5,_0x2a8656){_0x2a8656=_0x2a8656||0xc8;return function(_0x465f5e){if(_0x465f5e){return _0x1ef9a5[_0x21bb('0x1e')](_0x2a8656)[_0x21bb('0x1f')](_0x465f5e);}};}function respondWithFilteredResult(_0x3497cf,_0x15fc36){return function(_0x4393d8){if(_0x4393d8){var _0x17ee1d=typeof _0x15fc36[_0x21bb('0x20')]==='undefined'&&typeof _0x15fc36[_0x21bb('0x21')]===_0x21bb('0x22');var _0x436ea6=_0x4393d8['count'];var _0x46b5f7=_0x17ee1d?0x0:_0x15fc36[_0x21bb('0x20')];var _0x271a9f=_0x17ee1d?_0x4393d8[_0x21bb('0x23')]:_0x15fc36[_0x21bb('0x20')]+_0x15fc36[_0x21bb('0x21')];var _0x171ec6;if(_0x271a9f>=_0x436ea6){_0x271a9f=_0x436ea6;_0x171ec6=0xc8;}else{_0x171ec6=0xce;}_0x3497cf[_0x21bb('0x1e')](_0x171ec6);return _0x3497cf[_0x21bb('0x24')](_0x21bb('0x25'),_0x46b5f7+'-'+_0x271a9f+'/'+_0x436ea6)[_0x21bb('0x1f')](_0x4393d8);}return null;};}function patchUpdates(_0xf209cd){return function(_0x5ed52b){try{jsonpatch[_0x21bb('0x26')](_0x5ed52b,_0xf209cd,!![]);}catch(_0x2b2bc3){return BPromise[_0x21bb('0x27')](_0x2b2bc3);}return _0x5ed52b['save']();};}function saveUpdates(_0x35a313,_0x53a3bf){return function(_0x303960){if(_0x303960){return _0x303960[_0x21bb('0x28')](_0x35a313)[_0x21bb('0x29')](function(_0x3239e2){return _0x3239e2;});}return null;};}function removeEntity(_0x112412,_0x14c336){return function(_0x4db3ad){if(_0x4db3ad){return _0x4db3ad[_0x21bb('0x2a')]()[_0x21bb('0x29')](function(){_0x112412[_0x21bb('0x1e')](0xcc)[_0x21bb('0x1d')]();});}};}function handleEntityNotFound(_0x5ddcd6,_0x44d720){return function(_0x26c46a){if(!_0x26c46a){_0x5ddcd6[_0x21bb('0x2b')](0x194);}return _0x26c46a;};}function handleError(_0x1dff25,_0xc6ae64){_0xc6ae64=_0xc6ae64||0x1f4;return function(_0x2c09d6){logger[_0x21bb('0x2c')](_0x2c09d6[_0x21bb('0x2d')]);if(_0x2c09d6['name']){delete _0x2c09d6[_0x21bb('0x2e')];}_0x1dff25[_0x21bb('0x1e')](_0xc6ae64)['send'](_0x2c09d6);};}function getInteractionUsers(_0x75418b,_0x38857e){return new BPromise(function(_0x15ca00,_0x58166a){try{if(_0x38857e[_0x75418b['id']]){_0x75418b[_0x21bb('0x2f')]=_['map'](_0x38857e[_0x75418b['id']],function(_0x2ca209){return{'id':_0x2ca209['id'],'fullname':_0x2ca209[_0x21bb('0x30')]};});}}catch(_0xa113b0){_0x58166a(_0xa113b0);}_0x15ca00(_0x75418b);});}function getInteractionTags(_0x3c58d5,_0x5713d8){return new BPromise(function(_0x32b374,_0x24dac3){try{if(_0x3c58d5['TagIds']){_0x3c58d5[_0x21bb('0x31')]=[];_0x3c58d5[_0x21bb('0x32')][_0x21bb('0x33')](',')[_0x21bb('0x34')](function(_0x1ea462){_0x3c58d5[_0x21bb('0x31')]['push'](_0x5713d8[_0x1ea462]);});}delete _0x3c58d5[_0x21bb('0x32')];}catch(_0x2bf5bc){_0x24dac3(_0x2bf5bc);}_0x32b374(_0x3c58d5);});}function updateWhatsappInteraction(_0x50bde9,_0x45015b,_0x68cbd5){return new BPromise(function(_0x54ef55,_0xe74f9a){return getInteractionUsers(_0x50bde9,_0x68cbd5)[_0x21bb('0x29')](function(_0x27b83d){return getInteractionTags(_0x27b83d,_0x45015b);})[_0x21bb('0x29')](function(_0x58e25a){_0x54ef55(_0x58e25a);})['catch'](function(_0x2b8d0d){_0xe74f9a(_0x2b8d0d);});});}exports['index']=function(_0x41a772,_0x59aedf){var _0x2a50d7={},_0x37bfcf={},_0x420495={'count':0x0,'rows':[]};var _0x7a0ab8=_[_0x21bb('0x35')](db['WhatsappInteraction']['rawAttributes'],function(_0xee3a6b){return{'name':_0xee3a6b[_0x21bb('0x36')],'type':_0xee3a6b[_0x21bb('0x37')][_0x21bb('0x38')]};});_0x37bfcf[_0x21bb('0x39')]=_['map'](_0x7a0ab8,'name');_0x37bfcf[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0x41a772[_0x21bb('0x3a')]);_0x37bfcf['filters']=_[_0x21bb('0x3c')](_0x37bfcf['model'],_0x37bfcf[_0x21bb('0x3a')]);_0x2a50d7[_0x21bb('0x3d')]=_[_0x21bb('0x3c')](_0x37bfcf['model'],qs['fields'](_0x41a772[_0x21bb('0x3a')][_0x21bb('0x3e')]));_0x2a50d7[_0x21bb('0x3d')]=_0x2a50d7[_0x21bb('0x3d')]['length']?_0x2a50d7[_0x21bb('0x3d')]:_0x37bfcf[_0x21bb('0x39')];if(!_0x41a772['query']['hasOwnProperty']('nolimit')){_0x2a50d7[_0x21bb('0x21')]=qs[_0x21bb('0x21')](_0x41a772[_0x21bb('0x3a')][_0x21bb('0x21')]);_0x2a50d7[_0x21bb('0x20')]=qs[_0x21bb('0x20')](_0x41a772[_0x21bb('0x3a')][_0x21bb('0x20')]);}_0x2a50d7[_0x21bb('0x3f')]=qs['sort'](_0x41a772[_0x21bb('0x3a')][_0x21bb('0x40')]);_0x2a50d7[_0x21bb('0x41')]=qs['filters'](_['pick'](_0x41a772['query'],_0x37bfcf[_0x21bb('0x42')]),_0x7a0ab8);var _0x4d890e=[];var _0x27c5e6=squel[_0x21bb('0x43')]()[_0x21bb('0x44')]('id')['field'](_0x21bb('0x2e'))['field'](_0x21bb('0x45'))[_0x21bb('0x46')]('tools_tags');var _0xa6c4c5=squel[_0x21bb('0x43')]()[_0x21bb('0x44')](_0x21bb('0x47'))[_0x21bb('0x44')](_0x21bb('0x48'))[_0x21bb('0x44')]('ui.WhatsappInteractionId')[_0x21bb('0x46')]('user_has_whatsapp_interactions','ui')['left_join']('users','u',_0x21bb('0x49'));var _0x826525=squel[_0x21bb('0x43')]()[_0x21bb('0x46')](_0x21bb('0x4a'),'i')[_0x21bb('0x4b')](_0x21bb('0x4c'),'c',_0x21bb('0x4d'))[_0x21bb('0x4b')](_0x21bb('0x4e'),'o',_0x21bb('0x4f'))['left_join'](_0x21bb('0x50'),'a',_0x21bb('0x51'))[_0x21bb('0x4b')](_0x21bb('0x52'),'me',_0x21bb('0x53'))[_0x21bb('0x4b')](_0x21bb('0x54'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x21bb('0x4b')](_0x21bb('0x55'),'t',_0x21bb('0x56'));var _0x20e7ad=squel[_0x21bb('0x57')]();var _0x522a79=[];var _0x216fe5=squel[_0x21bb('0x57')]();var _0x2f40ba;if(_0x41a772[_0x21bb('0x3a')]['search']){_0x2f40ba=as[_0x21bb('0x58')](_0x41a772['query'][_0x21bb('0x59')]);var _0x4330f5=_0x2f40ba[_0x21bb('0x5a')];for(var _0x4749ad=0x0;_0x4749ad<_0x2f40ba[_0x21bb('0x5b')]['length'];_0x4749ad++){var _0x481711=_0x2f40ba[_0x21bb('0x5b')][_0x4749ad];var _0x14ad52='i';var _0x229f01=_[_0x21bb('0x5c')](_0x7a0ab8,[_0x21bb('0x2e'),_0x481711[_0x21bb('0x44')]]);if(!_0x229f01){switch(_0x481711[_0x21bb('0x44')]){case _0x21bb('0x5d'):if(_0x481711[_0x21bb('0x5e')]==0x1){_0x826525[_0x21bb('0x5f')]('`'+_0x481711[_0x21bb('0x44')]+'`\x20=\x200');}else{_0x826525[_0x21bb('0x5f')]('`'+_0x481711[_0x21bb('0x44')]+_0x21bb('0x60'));}break;case _0x21bb('0x61'):if(_0x481711[_0x21bb('0x62')]===_0x21bb('0x63')){if(_0x481711['value'][_0x21bb('0x33')]('\x20')[_0x21bb('0x64')]>0x1){_0x20e7ad[_0x4330f5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x21bb('0x65')](_0x481711['value']),null);}else{var _0x17d525='%'+_0x481711[_0x21bb('0x5e')]+'%';_0x20e7ad[_0x4330f5](_0x21bb('0x66'),_0x17d525,_0x17d525,_0x17d525);}}else{_0x229f01=_['find'](_0x7a0ab8,[_0x21bb('0x2e'),_0x21bb('0x67')]);_0x481711[_0x21bb('0x44')]=_0x21bb('0x67');_0x8e7c21=as[_0x21bb('0x68')](_0x14ad52,_0x229f01[_0x21bb('0x37')],_0x481711);_0x20e7ad[_0x4330f5](_0x8e7c21[_0x21bb('0x69')],_0x8e7c21[_0x21bb('0x5e')][_0x21bb('0x6a')],_0x8e7c21['value'][_0x21bb('0x1d')]);}break;case _0x21bb('0x6b'):var _0x217030=_0x481711[_0x21bb('0x5e')][_0x21bb('0x33')](',')[_0x21bb('0x35')](function(_0x59cf25){return Number(_0x59cf25);});_0x217030['forEach'](function(_0x14e2f5){_0x216fe5['or'](_0x21bb('0x6c'),'%,'+_0x14e2f5+',%');});_0x522a79=_[_0x21bb('0x6d')](_0x522a79,_0x217030);break;case _0x21bb('0x6e'):if(_0x481711['operator']==='$substring'){_0x20e7ad[_0x4330f5](_0x21bb('0x6f'),'%'+_0x481711['value']+'%',null);}else{_0x229f01=_['find'](_0x7a0ab8,[_0x21bb('0x2e'),_0x21bb('0x70')]);_0x481711[_0x21bb('0x44')]=_0x21bb('0x70');_0x8e7c21=as[_0x21bb('0x68')](_0x14ad52,_0x229f01[_0x21bb('0x37')],_0x481711);_0x20e7ad[_0x4330f5](_0x8e7c21[_0x21bb('0x69')],_0x8e7c21['value'][_0x21bb('0x6a')],_0x8e7c21[_0x21bb('0x5e')][_0x21bb('0x1d')]);}break;case'body':_0x8e7c21=as['buildExpression']('me',null,_0x481711);_0x20e7ad[_0x4330f5](_0x8e7c21[_0x21bb('0x69')],_0x8e7c21[_0x21bb('0x5e')][_0x21bb('0x6a')],_0x8e7c21[_0x21bb('0x5e')]['end']);break;}}else{var _0x8e7c21=as['buildExpression'](_0x14ad52,_0x229f01['type'],_0x481711);_0x20e7ad[_0x4330f5](_0x8e7c21[_0x21bb('0x69')],_0x8e7c21[_0x21bb('0x5e')][_0x21bb('0x6a')],_0x8e7c21[_0x21bb('0x5e')]['end']);}}}else{var _0x4145fe=_(_0x41a772['query'])[_0x21bb('0x3b')]()[_0x21bb('0x35')](function(_0x162aa3){return _[_0x21bb('0x71')](_0x7a0ab8,[_0x21bb('0x2e'),_0x162aa3])?_0x162aa3:undefined;})[_0x21bb('0x72')]()[_0x21bb('0x5e')]();if(!_[_0x21bb('0x73')](_0x4145fe)){_0x4145fe['forEach'](function(_0x19bdc3){if(_0x19bdc3===_0x21bb('0x74')){_0x826525[_0x21bb('0x41')]('i.WhatsappAccountId\x20IN\x20?',[][_0x21bb('0x75')](_0x41a772['query'][_0x19bdc3]));}else if(_0x19bdc3===_0x21bb('0x76')){var _0x16f213=JSON[_0x21bb('0x77')](_0x41a772['query'][_0x19bdc3])[_0x21bb('0x78')];var _0x2b4724=JSON[_0x21bb('0x77')](_0x41a772[_0x21bb('0x3a')][_0x19bdc3])[_0x21bb('0x79')];_0x826525['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16f213,_0x2b4724);}else{if(_0x41a772[_0x21bb('0x3a')][_0x19bdc3]===_0x21bb('0x7a')){_0x826525[_0x21bb('0x41')]('i.'+_0x19bdc3+_0x21bb('0x7b'));}else{_0x826525[_0x21bb('0x41')]('i.'+_0x19bdc3+'\x20=\x20?',_0x41a772[_0x21bb('0x3a')][_0x19bdc3]);}}});}if(_0x41a772[_0x21bb('0x3a')][_0x21bb('0x7c')]){if(_0x41a772[_0x21bb('0x3a')]['read']==0x1){_0x826525[_0x21bb('0x5f')](_0x21bb('0x7d'));}else{_0x826525[_0x21bb('0x5f')](_0x21bb('0x7e'));}}if(_0x41a772['query']['tag']){_0x522a79=_[_0x21bb('0x7f')](_0x41a772[_0x21bb('0x3a')][_0x21bb('0x80')])?_0x41a772['query'][_0x21bb('0x80')]:new Array(_0x41a772[_0x21bb('0x3a')][_0x21bb('0x80')]);_0x522a79[_0x21bb('0x34')](function(_0x2b1cf4){_0x216fe5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b1cf4+',%');});}if(_0x41a772[_0x21bb('0x3a')]['filter']){var _0x551967=_0x41a772[_0x21bb('0x3a')][_0x21bb('0x81')][_0x21bb('0x82')]('\x5c','\x5c\x5c')[_0x21bb('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x551967)){_0x20e7ad['or'](_0x21bb('0x83'),_0x551967+'%')['or']('i.phone\x20LIKE\x20?',_0x551967+'%');}else{_0x20e7ad['or'](_0x21bb('0x84'),qs[_0x21bb('0x65')](_0x551967))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x551967+'%');}}}_0x826525[_0x21bb('0x41')](_0x20e7ad);_0x826525[_0x21bb('0x85')]('i.id');var _0xfac262={'type':db['Sequelize'][_0x21bb('0x86')][_0x21bb('0x87')],'raw':!![]};var _0x16a378=_0x826525[_0x21bb('0x88')]();_0x16a378[_0x21bb('0x44')](_0x21bb('0x89'));_0x16a378['field'](_0x21bb('0x8a'),'unreadMessages');if(_0x2a50d7['order']){_0x2a50d7[_0x21bb('0x3f')]['forEach'](function(_0x1fc242){var _0x2cd902=_0x1fc242[0x0]===_0x21bb('0x8b')?_0x1fc242[0x0]:'i.'+_0x1fc242[0x0];_0x826525[_0x21bb('0x3f')](_0x2cd902,_0x1fc242[0x1]===_0x21bb('0x8c')?![]:!![]);});}if(!_[_0x21bb('0x73')](_0x522a79)){_0x826525[_0x21bb('0x5f')](_0x216fe5);_0x16a378[_0x21bb('0x41')](_0x21bb('0x8d'),_0x522a79);}BPromise[_0x21bb('0x8e')]()[_0x21bb('0x29')](function(){if(!_0x2f40ba){if(_0x41a772[_0x21bb('0x3a')][_0x21bb('0x74')])return;_0x16a378[_0x21bb('0x41')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x826525[_0x21bb('0x41')](_0x21bb('0x8f'));return;}if(_0x41a772['user'][_0x21bb('0x90')]!==_0x21bb('0x91'))return;return _0x41a772[_0x21bb('0x92')][_0x21bb('0x93')]({'attributes':['id'],'raw':!![]})[_0x21bb('0x29')](function(_0x45a47a){if(_[_0x21bb('0x73')](_0x45a47a)){_0x16a378['where'](_0x21bb('0x94'));_0x826525[_0x21bb('0x41')](_0x21bb('0x94'));}else{_0x16a378[_0x21bb('0x41')](_0x21bb('0x95'),_['map'](_0x45a47a,'id'));_0x826525['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x21bb('0x35')](_0x45a47a,'id'));}});})[_0x21bb('0x29')](function(){if(_0x41a772['user'][_0x21bb('0x90')]==='agent'&&!_0x2f40ba&&!_0x41a772[_0x21bb('0x3a')]['WhatsappAccountId'])return[];return db[_0x21bb('0x96')][_0x21bb('0x3a')](_0x16a378[_0x21bb('0x97')](),_0xfac262);})[_0x21bb('0x29')](function(_0x2751a8){_0x420495[_0x21bb('0x23')]=_0x2751a8['length'];if(_0x420495[_0x21bb('0x23')]===0x0)return[];return db[_0x21bb('0x96')][_0x21bb('0x3a')](_0x27c5e6[_0x21bb('0x97')](),_0xfac262)[_0x21bb('0x29')](function(_0x10b6c3){_0x4d890e=_[_0x21bb('0x98')](_0x10b6c3,'id');_0xfac262=_['merge'](_0xfac262,{'model':db[_0x21bb('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41a772['query']['fields']){_0x2a50d7['attributes'][_0x21bb('0x34')](function(_0x300387){_0x826525['field']('i.'+_0x300387);});}else{_0x826525[_0x21bb('0x44')](_0x21bb('0x8a'),_0x21bb('0x5d'));_0x826525[_0x21bb('0x44')](_0x21bb('0x9a'),_0x21bb('0x9b'));_0x826525[_0x21bb('0x44')](_0x21bb('0x9c'),_0x21bb('0x9d'));_0x826525['field'](_0x21bb('0x9e'),_0x21bb('0x8b'));_0x826525[_0x21bb('0x44')](_0x21bb('0x9f'));_0x826525[_0x21bb('0x44')](_0x21bb('0xa0'),'Contact.firstName');_0x826525[_0x21bb('0x44')]('c.lastName',_0x21bb('0xa1'));_0x826525[_0x21bb('0x44')]('c.email',_0x21bb('0xa2'));_0x826525[_0x21bb('0x44')](_0x21bb('0xa3'),_0x21bb('0xa4'));_0x826525['field'](_0x21bb('0xa5'),'Contact.mobile');_0x826525['field'](_0x21bb('0xa6'),'Contact.fax');_0x826525[_0x21bb('0x44')](_0x21bb('0xa7'),'Owner.fullname');_0x826525[_0x21bb('0x44')](_0x21bb('0xa8'),_0x21bb('0xa9'));_0x826525[_0x21bb('0x44')](_0x21bb('0xaa'),_0x21bb('0x32'));}if(_0x2a50d7[_0x21bb('0x21')])_0x826525[_0x21bb('0x21')](_0x2a50d7[_0x21bb('0x21')]);if(_0x2a50d7[_0x21bb('0x20')])_0x826525[_0x21bb('0x20')](_0x2a50d7[_0x21bb('0x20')]);return db[_0x21bb('0x96')][_0x21bb('0x3a')](_0x826525['toString'](),_0xfac262);})[_0x21bb('0x29')](function(_0x462291){if(_0x462291[_0x21bb('0x64')]>0x0)_0xa6c4c5['where'](_0x21bb('0xab'),_[_0x21bb('0x35')](_0x462291,'id'));return db['sequelize'][_0x21bb('0x3a')](_0xa6c4c5[_0x21bb('0x97')](),_0xfac262)[_0x21bb('0x29')](function(_0x2fa1ba){var _0x343384=_[_0x21bb('0xac')](_0x2fa1ba,'WhatsappInteractionId');var _0x295ab3=[];_0x462291[_0x21bb('0x34')](function(_0xc4f3f0){_0x295ab3[_0x21bb('0xad')](updateWhatsappInteraction(_0xc4f3f0,_0x4d890e,_0x343384));});return BPromise[_0x21bb('0xae')](_0x295ab3);});});})[_0x21bb('0x29')](function(_0x5d5fb4){_0x420495[_0x21bb('0xaf')]=_0x5d5fb4;return _0x420495;})[_0x21bb('0x29')](respondWithFilteredResult(_0x59aedf,_0x2a50d7))[_0x21bb('0xb0')](handleError(_0x59aedf,null));};exports[_0x21bb('0xb1')]=function(_0x33a233,_0x5aa874){var _0x271cda={'raw':![],'where':{'id':_0x33a233[_0x21bb('0xb2')]['id']}},_0x124a86={};_0x124a86[_0x21bb('0x39')]=_['keys'](db[_0x21bb('0x99')][_0x21bb('0xb3')]);_0x124a86['query']=_[_0x21bb('0x3b')](_0x33a233[_0x21bb('0x3a')]);_0x124a86[_0x21bb('0x42')]=_[_0x21bb('0x3c')](_0x124a86[_0x21bb('0x39')],_0x124a86[_0x21bb('0x3a')]);_0x271cda[_0x21bb('0x3d')]=_[_0x21bb('0x3c')](_0x124a86[_0x21bb('0x39')],qs[_0x21bb('0x3e')](_0x33a233['query'][_0x21bb('0x3e')]));_0x271cda['attributes']=_0x271cda['attributes'][_0x21bb('0x64')]?_0x271cda[_0x21bb('0x3d')]:_0x124a86['model'];if(_0x33a233[_0x21bb('0x3a')][_0x21bb('0xb4')]){_0x271cda[_0x21bb('0xb5')]=[{'all':!![]}];}_0x271cda=_['merge']({},_0x271cda,_0x33a233[_0x21bb('0xb6')]);return db[_0x21bb('0x99')][_0x21bb('0x5c')](_0x271cda)['then'](handleEntityNotFound(_0x5aa874,null))[_0x21bb('0x29')](respondWithResult(_0x5aa874,null))[_0x21bb('0xb0')](handleError(_0x5aa874,null));};exports[_0x21bb('0xb7')]=function(_0x11ef72,_0xaafc99){return db[_0x21bb('0x99')][_0x21bb('0xb7')](_0x11ef72[_0x21bb('0xb8')],{})[_0x21bb('0x29')](respondWithResult(_0xaafc99,0xc9))[_0x21bb('0xb0')](handleError(_0xaafc99,null));};exports[_0x21bb('0x28')]=function(_0x213678,_0x6da778){if(_0x213678[_0x21bb('0xb8')]['id']){delete _0x213678[_0x21bb('0xb8')]['id'];}return db[_0x21bb('0x99')][_0x21bb('0x5c')]({'where':{'id':_0x213678[_0x21bb('0xb2')]['id']}})[_0x21bb('0x29')](handleEntityNotFound(_0x6da778,null))[_0x21bb('0x29')](saveUpdates(_0x213678['body'],null))[_0x21bb('0x29')](respondWithResult(_0x6da778,null))[_0x21bb('0xb0')](handleError(_0x6da778,null));};exports['destroy']=function(_0xb18803,_0x57efc0){return db[_0x21bb('0x99')][_0x21bb('0x5c')]({'where':{'id':_0xb18803[_0x21bb('0xb2')]['id']}})[_0x21bb('0x29')](handleEntityNotFound(_0x57efc0,null))[_0x21bb('0x29')](removeEntity(_0x57efc0,null))['catch'](handleError(_0x57efc0,null));};exports['describe']=function(_0x4654c0,_0x130086){return db[_0x21bb('0x99')][_0x21bb('0xb9')]()[_0x21bb('0x29')](respondWithResult(_0x130086,null))['catch'](handleError(_0x130086,null));};exports[_0x21bb('0xba')]=function(_0x1f4fd4,_0x26c6c4,_0x357707){return db[_0x21bb('0xbb')][_0x21bb('0x5c')]({'where':{'id':_0x1f4fd4[_0x21bb('0xb2')]['id']}})[_0x21bb('0x29')](handleEntityNotFound(_0x26c6c4,null))[_0x21bb('0x29')](function(_0x1f7cdd){if(_0x1f7cdd){return _0x1f7cdd[_0x21bb('0xba')](_0x1f4fd4['body'][_0x21bb('0xbc')],_[_0x21bb('0xbd')](_0x1f4fd4[_0x21bb('0xb8')],[_0x21bb('0xbc'),'id'])||{});}})[_0x21bb('0x29')](respondWithResult(_0x26c6c4,null))['catch'](handleError(_0x26c6c4,null));};exports[_0x21bb('0xbe')]=function(_0x4742ae,_0x17d8d0,_0x5ef5dd){var _0x36152a={'raw':![],'where':{}};var _0x3e38f1={};var _0x154e6d={'count':0x0,'rows':[]};return db[_0x21bb('0x99')][_0x21bb('0xbf')]({'where':{'id':_0x4742ae['params']['id']}})[_0x21bb('0x29')](handleEntityNotFound(_0x17d8d0,null))['then'](function(_0x1c7ad6){if(_0x1c7ad6){_0x3e38f1[_0x21bb('0x39')]=_['keys'](db[_0x21bb('0xbb')]['rawAttributes']);_0x3e38f1[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0x4742ae[_0x21bb('0x3a')]);_0x3e38f1[_0x21bb('0x42')]=_[_0x21bb('0x3c')](_0x3e38f1[_0x21bb('0x39')],_0x3e38f1[_0x21bb('0x3a')]);_0x36152a[_0x21bb('0x3d')]=_['intersection'](_0x3e38f1[_0x21bb('0x39')],qs[_0x21bb('0x3e')](_0x4742ae['query']['fields']));_0x36152a[_0x21bb('0x3d')]=_0x36152a[_0x21bb('0x3d')][_0x21bb('0x64')]?_0x36152a['attributes']:_0x3e38f1[_0x21bb('0x39')];if(!_0x4742ae[_0x21bb('0x3a')][_0x21bb('0xc0')](_0x21bb('0xc1'))){_0x36152a[_0x21bb('0x21')]=qs[_0x21bb('0x21')](_0x4742ae[_0x21bb('0x3a')][_0x21bb('0x21')]);_0x36152a[_0x21bb('0x20')]=qs[_0x21bb('0x20')](_0x4742ae[_0x21bb('0x3a')][_0x21bb('0x20')]);}_0x36152a[_0x21bb('0x3f')]=qs['sort'](_0x4742ae['query'][_0x21bb('0x40')]);_0x36152a[_0x21bb('0x41')]=qs[_0x21bb('0x42')](_[_0x21bb('0xc2')](_0x4742ae[_0x21bb('0x3a')],_0x3e38f1[_0x21bb('0x42')]));_0x36152a[_0x21bb('0x41')][_0x21bb('0xc3')]=_0x1c7ad6['id'];if(_0x4742ae[_0x21bb('0x3a')][_0x21bb('0x81')]){_0x36152a[_0x21bb('0x41')]=_[_0x21bb('0xc4')](_0x36152a[_0x21bb('0x41')],{'$or':_[_0x21bb('0x35')](_0x36152a[_0x21bb('0x3d')],function(_0x516c0b){var _0x1284e4={};_0x1284e4[_0x516c0b]={'$like':'%'+_0x4742ae[_0x21bb('0x3a')][_0x21bb('0x81')]+'%'};return _0x1284e4;})});}if(_0x4742ae[_0x21bb('0x3a')][_0x21bb('0x78')]){var _0x4685ac=_0x4742ae['query'][_0x21bb('0x78')]['split'](',');var _0x594c8f={};_0x594c8f[_0x4685ac[0x0]]={'$gte':moment(_0x4685ac[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x36152a[_0x21bb('0x41')]=_[_0x21bb('0xc4')](_0x36152a[_0x21bb('0x41')],_0x594c8f);}_0x36152a=_[_0x21bb('0xc4')]({},_0x36152a,_0x4742ae[_0x21bb('0xb6')]);return db[_0x21bb('0xbb')][_0x21bb('0x23')]({'where':_0x36152a[_0x21bb('0x41')]})[_0x21bb('0x29')](function(_0x4388d6){_0x154e6d[_0x21bb('0x23')]=_0x4388d6;if(_0x4742ae[_0x21bb('0x3a')][_0x21bb('0xb4')]){_0x36152a[_0x21bb('0xb5')]=[{'all':!![]}];}return db[_0x21bb('0xbb')][_0x21bb('0xc5')](_0x36152a);})[_0x21bb('0x29')](function(_0x2c6df6){_0x154e6d[_0x21bb('0xaf')]=_0x2c6df6;return _0x154e6d;});}})['then'](respondWithFilteredResult(_0x17d8d0,_0x36152a))[_0x21bb('0xb0')](handleError(_0x17d8d0,null));};exports['addTags']=function(_0x1a0b35,_0x1b4e1a,_0x2ac8d9){return db[_0x21bb('0x99')][_0x21bb('0x5c')]({'where':{'id':_0x1a0b35['params']['id']}})[_0x21bb('0x29')](handleEntityNotFound(_0x1b4e1a,null))[_0x21bb('0x29')](function(_0x121d1e){if(_0x121d1e){return _0x121d1e[_0x21bb('0xc6')](_0x1a0b35['body'][_0x21bb('0xbc')],_['omit'](_0x1a0b35[_0x21bb('0xb8')],[_0x21bb('0xbc'),'id'])||{})[_0x21bb('0xc7')](function(){return db[_0x21bb('0x6b')][_0x21bb('0xc5')]({'attributes':['id',_0x21bb('0x2e'),_0x21bb('0x45')],'where':{'id':_0x1a0b35[_0x21bb('0xb8')][_0x21bb('0xbc')]}});})[_0x21bb('0x29')](function(_0x298b8e){socket[_0x21bb('0xc8')]('whatsappInteractionTags:save',{'id':Number(_0x1a0b35[_0x21bb('0xb2')]['id']),'tags':_0x298b8e||[]});return{'id':Number(_0x1a0b35[_0x21bb('0xb2')]['id']),'tags':_0x298b8e||[]};});}})[_0x21bb('0x29')](respondWithResult(_0x1b4e1a,null))[_0x21bb('0xb0')](handleError(_0x1b4e1a,null));};exports['removeTags']=function(_0x2da693,_0x30d618,_0x1e29ca){return db[_0x21bb('0x99')][_0x21bb('0x5c')]({'where':{'id':_0x2da693[_0x21bb('0xb2')]['id']}})['then'](handleEntityNotFound(_0x30d618,null))[_0x21bb('0x29')](function(_0x379c08){if(_0x379c08){return _0x379c08['removeTags'](_0x2da693[_0x21bb('0x3a')][_0x21bb('0xbc')]);}})[_0x21bb('0x29')](respondWithStatusCode(_0x30d618,null))[_0x21bb('0xb0')](handleError(_0x30d618,null));};exports[_0x21bb('0xc9')]=function(_0x5d0d0b,_0x357186){var _0x431119=moment()[_0x21bb('0xca')]()['toString']();var _0x3b374f=path['join'](config['root'],'server',_0x21bb('0xcb'),_0x21bb('0xcc'));var _0x47bfc1=path['join'](config[_0x21bb('0xcd')],'server',_0x21bb('0xcb'),_0x21bb('0xce'));var _0x202182=path['join'](_0x3b374f,_0x431119);var _0xe4a8f7=util['format']('transcript-%d-%s.zip',_0x5d0d0b[_0x21bb('0xb2')]['id'],_0x431119);var _0x36c666=path[_0x21bb('0xcf')](_0x3b374f,_0xe4a8f7);var _0x534219=[];_0x534219['push']({'model':db[_0x21bb('0x6e')],'as':_0x21bb('0x6e'),'attributes':['id',_0x21bb('0x30')],'raw':!![]});_0x534219[_0x21bb('0xad')]({'model':db[_0x21bb('0xd0')],'as':'Contact','attributes':['id',_0x21bb('0xd1'),_0x21bb('0xd2')],'raw':!![]});if(_0x5d0d0b['query'][_0x21bb('0xce')]){_0x534219['push']({'model':db[_0x21bb('0xd3')],'as':_0x21bb('0xd3'),'raw':!![]});}var _0x11f98d=[{'model':db[_0x21bb('0xbb')],'as':_0x21bb('0xd4'),'attributes':['id','body','createdAt',_0x21bb('0xd5'),_0x21bb('0xd6'),'read'],'include':_0x534219}];_0x11f98d[_0x21bb('0xad')]({'model':db[_0x21bb('0xd7')],'as':_0x21bb('0xd8'),'attributes':['id','name']});_0x11f98d[_0x21bb('0xad')]({'model':db[_0x21bb('0x6e')],'as':'Owner','attributes':['id',_0x21bb('0x30')]});return db[_0x21bb('0x99')]['find']({'where':{'id':_0x5d0d0b[_0x21bb('0xb2')]['id']},'include':_0x11f98d})[_0x21bb('0x29')](handleEntityNotFound(_0x357186,null))[_0x21bb('0x29')](function(_0xfe2803){if(_0xfe2803){var _0x11ac73=_0xfe2803[_0x21bb('0xd9')]({'plain':!![]});fs[_0x21bb('0xda')](_0x202182);var _0x62359d={'channel':_0x21bb('0xdb'),'account':_0x11ac73[_0x21bb('0xd8')][_0x21bb('0x2e')],'agent':_0x11ac73['Owner']?_0x11ac73[_0x21bb('0xdc')][_0x21bb('0x30')]:_0x21bb('0xdd'),'createdAt':moment(_0x11ac73['createdAt'])[_0x21bb('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0x21bb('0x97')](),'closedAt':_0x11ac73['closed']?moment(_0x11ac73[_0x21bb('0xdf')])[_0x21bb('0xde')](_0x21bb('0xe0'))[_0x21bb('0x97')]():'','disposition':_0x11ac73[_0x21bb('0xe1')],'messages':_(_0x11ac73[_0x21bb('0xd4')])[_0x21bb('0x81')]({'secret':![]})[_0x21bb('0x35')](function(_0x369a78){if(_0x369a78[_0x21bb('0xd3')]){var _0x5ac94b=path[_0x21bb('0xcf')](_0x47bfc1,_0x369a78[_0x21bb('0xd3')][_0x21bb('0xe2')]);if(fs[_0x21bb('0xe3')](_0x5ac94b)){fs[_0x21bb('0xe4')](_0x5ac94b)[_0x21bb('0xe5')](fs['createWriteStream'](path[_0x21bb('0xcf')](_0x202182,_0x369a78[_0x21bb('0xd3')][_0x21bb('0xe2')])));}}return{'date':moment(_0x369a78[_0x21bb('0x76')])[_0x21bb('0xde')](_0x21bb('0xe0'))[_0x21bb('0x97')](),'sender':_0x369a78[_0x21bb('0xd5')]===_0x21bb('0xe6')?_0x369a78[_0x21bb('0x6e')]?_0x369a78[_0x21bb('0x6e')][_0x21bb('0x30')]:_0x21bb('0xe7'):_0x369a78[_0x21bb('0x61')][_0x21bb('0xd1')]+(_0x369a78[_0x21bb('0x61')][_0x21bb('0xd2')]?'\x20'+_0x369a78[_0x21bb('0x61')][_0x21bb('0xd2')]:''),'body':_0x369a78[_0x21bb('0xd3')]?_0x369a78['Attachment'][_0x21bb('0xe2')]:_0x369a78['body'],'direction':_0x369a78[_0x21bb('0xd5')]===_0x21bb('0xe6')?'A':'C','secret':_0x369a78['secret'],'read':_0x369a78[_0x21bb('0x7c')],'attachment':_0x369a78[_0x21bb('0xd3')]};})[_0x21bb('0x5e')]()};return ejs[_0x21bb('0xe8')](path[_0x21bb('0xcf')](config['root'],_0x21bb('0xe9'),_0x21bb('0xea'),_0x21bb('0xeb')),{'interaction':_0x62359d})[_0x21bb('0x29')](function(_0x10d97a){var _0xcf6dc3=path['join'](_0x202182,_0x21bb('0xec')+_0x11ac73['id']+'-'+_0x431119+_0x21bb('0xed'));var _0x4dc3fc={'path':_0xcf6dc3,'channel':_0x21bb('0xdb'),'interactionId':_0x11ac73['id']};return pdf['createPdfFromHTML'](_0x10d97a,_0x4dc3fc);})['then'](function(){return new BPromise(function(_0x561683,_0x4c4f92){zipdir(_0x202182,{'saveTo':_0x36c666},function(_0x1b7f63,_0x4cf718){if(_0x1b7f63)return _0x4c4f92(_0x1b7f63);return _0x561683(_0x4cf718);});})['then'](function(){return new BPromise(function(_0x4c0d29,_0x13ae5f){rimraf(_0x202182,function(_0x577b01){if(_0x577b01)_0x13ae5f(_0x577b01);return _0x4c0d29();});});})[_0x21bb('0x29')](function(){return _0x357186[_0x21bb('0xc9')](_0x36c666,_0xe4a8f7,function(_0x1fe06e){if(_0x1fe06e){console[_0x21bb('0xee')](_0x21bb('0xef'),_0x1fe06e);}else{fs[_0x21bb('0xf0')](_0x36c666);}});});});}else{return _0x357186[_0x21bb('0x2b')](0xc8);}})[_0x21bb('0xb0')](handleError(_0x357186,null));}; \ No newline at end of file +var _0x142c=['having','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','compact','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','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?','group','i.id','QueryTypes','SELECT','clone','contactName','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','merge','WhatsappInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','WhatsappInteractionId','rows','catch','show','includeAll','include','params','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','$gte','format','options','findAll','addTags','spread','emit','whatsappInteractionTags:save','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','then','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','ui.WhatsappInteractionId','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value'];(function(_0x214258,_0x52f584){var _0x56e6a6=function(_0x43b575){while(--_0x43b575){_0x214258['push'](_0x214258['shift']());}};_0x56e6a6(++_0x52f584);}(_0x142c,0x86));var _0xc142=function(_0x3f6e7b,_0x54c444){_0x3f6e7b=_0x3f6e7b-0x0;var _0x298019=_0x142c[_0x3f6e7b];return _0x298019;};'use strict';var emlformat=require(_0xc142('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc142('0x1'));var jsonpatch=require(_0xc142('0x2'));var rp=require(_0xc142('0x3'));var moment=require('moment');var BPromise=require(_0xc142('0x4'));var Mustache=require(_0xc142('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc142('0x6'));var csv=require('to-csv');var ejs=require(_0xc142('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc142('0x8'));var squel=require(_0xc142('0x9'));var crypto=require(_0xc142('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc142('0xb'));var querystring=require(_0xc142('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc142('0xd'));var qs=require(_0xc142('0xe'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xc142('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc142('0x10'))('api');var utils=require(_0xc142('0x11'));var config=require(_0xc142('0x12'));var licenseUtil=require(_0xc142('0x13'));var db=require(_0xc142('0x14'))['db'];config['redis']=_[_0xc142('0x15')](config[_0xc142('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc142('0x17'))(new Redis(config['redis']));require(_0xc142('0x18'))['register'](socket);function respondWithStatusCode(_0x589eb8,_0x2473f1){_0x2473f1=_0x2473f1||0xcc;return function(_0x141c33){if(_0x141c33){return _0x589eb8[_0xc142('0x19')](_0x2473f1);}return _0x589eb8[_0xc142('0x1a')](_0x2473f1)['end']();};}function respondWithResult(_0x2c5364,_0x384a79){_0x384a79=_0x384a79||0xc8;return function(_0x260844){if(_0x260844){return _0x2c5364[_0xc142('0x1a')](_0x384a79)[_0xc142('0x1b')](_0x260844);}};}function respondWithFilteredResult(_0x410e92,_0x59e6c0){return function(_0x2d55c5){if(_0x2d55c5){var _0x18fcee=typeof _0x59e6c0[_0xc142('0x1c')]===_0xc142('0x1d')&&typeof _0x59e6c0[_0xc142('0x1e')]===_0xc142('0x1d');var _0x1d05d6=_0x2d55c5[_0xc142('0x1f')];var _0x434e90=_0x18fcee?0x0:_0x59e6c0[_0xc142('0x1c')];var _0x2ea9e3=_0x18fcee?_0x2d55c5['count']:_0x59e6c0['offset']+_0x59e6c0[_0xc142('0x1e')];var _0x4e2fb7;if(_0x2ea9e3>=_0x1d05d6){_0x2ea9e3=_0x1d05d6;_0x4e2fb7=0xc8;}else{_0x4e2fb7=0xce;}_0x410e92[_0xc142('0x1a')](_0x4e2fb7);return _0x410e92[_0xc142('0x20')](_0xc142('0x21'),_0x434e90+'-'+_0x2ea9e3+'/'+_0x1d05d6)[_0xc142('0x1b')](_0x2d55c5);}return null;};}function patchUpdates(_0x218a29){return function(_0x20e226){try{jsonpatch[_0xc142('0x22')](_0x20e226,_0x218a29,!![]);}catch(_0x9e2ce4){return BPromise['reject'](_0x9e2ce4);}return _0x20e226[_0xc142('0x23')]();};}function saveUpdates(_0x25bb97,_0x45866f){return function(_0x4190fc){if(_0x4190fc){return _0x4190fc[_0xc142('0x24')](_0x25bb97)['then'](function(_0x440c73){return _0x440c73;});}return null;};}function removeEntity(_0xea069f,_0x4e0bdd){return function(_0x3ab396){if(_0x3ab396){return _0x3ab396[_0xc142('0x25')]()['then'](function(){_0xea069f['status'](0xcc)[_0xc142('0x26')]();});}};}function handleEntityNotFound(_0x43a014,_0x88d193){return function(_0x5c45ba){if(!_0x5c45ba){_0x43a014[_0xc142('0x19')](0x194);}return _0x5c45ba;};}function handleError(_0x568301,_0x32e5db){_0x32e5db=_0x32e5db||0x1f4;return function(_0x41762f){logger['error'](_0x41762f[_0xc142('0x27')]);if(_0x41762f[_0xc142('0x28')]){delete _0x41762f[_0xc142('0x28')];}_0x568301[_0xc142('0x1a')](_0x32e5db)[_0xc142('0x29')](_0x41762f);};}function getInteractionUsers(_0x5d27f7,_0x18ebf5){return new BPromise(function(_0x12bc27,_0x2e7184){try{if(_0x18ebf5[_0x5d27f7['id']]){_0x5d27f7[_0xc142('0x2a')]=_[_0xc142('0x2b')](_0x18ebf5[_0x5d27f7['id']],function(_0x1c77aa){return{'id':_0x1c77aa['id'],'fullname':_0x1c77aa[_0xc142('0x2c')]};});}}catch(_0x383b65){_0x2e7184(_0x383b65);}_0x12bc27(_0x5d27f7);});}function getInteractionTags(_0x430c6c,_0x52f1dd){return new BPromise(function(_0x34e7f5,_0x342720){try{if(_0x430c6c[_0xc142('0x2d')]){_0x430c6c[_0xc142('0x2e')]=[];_0x430c6c['TagIds'][_0xc142('0x2f')](',')['forEach'](function(_0x365def){_0x430c6c['Tags'][_0xc142('0x30')](_0x52f1dd[_0x365def]);});}delete _0x430c6c['TagIds'];}catch(_0x1d3571){_0x342720(_0x1d3571);}_0x34e7f5(_0x430c6c);});}function updateWhatsappInteraction(_0x415c66,_0x5e30da,_0xdf5bbb){return new BPromise(function(_0x2c2839,_0x509b9b){return getInteractionUsers(_0x415c66,_0xdf5bbb)[_0xc142('0x31')](function(_0x195c70){return getInteractionTags(_0x195c70,_0x5e30da);})[_0xc142('0x31')](function(_0x401203){_0x2c2839(_0x401203);})['catch'](function(_0x4f9c6a){_0x509b9b(_0x4f9c6a);});});}exports[_0xc142('0x32')]=function(_0x2707de,_0x5871ab){var _0x5d14bf={},_0xeb6642={},_0x1a182={'count':0x0,'rows':[]};var _0x2910cf=_['map'](db['WhatsappInteraction'][_0xc142('0x33')],function(_0x131527){return{'name':_0x131527[_0xc142('0x34')],'type':_0x131527[_0xc142('0x35')][_0xc142('0x36')]};});_0xeb6642[_0xc142('0x37')]=_[_0xc142('0x2b')](_0x2910cf,_0xc142('0x28'));_0xeb6642[_0xc142('0x38')]=_[_0xc142('0x39')](_0x2707de[_0xc142('0x38')]);_0xeb6642[_0xc142('0x3a')]=_[_0xc142('0x3b')](_0xeb6642['model'],_0xeb6642[_0xc142('0x38')]);_0x5d14bf['attributes']=_[_0xc142('0x3b')](_0xeb6642[_0xc142('0x37')],qs['fields'](_0x2707de[_0xc142('0x38')][_0xc142('0x3c')]));_0x5d14bf[_0xc142('0x3d')]=_0x5d14bf[_0xc142('0x3d')][_0xc142('0x3e')]?_0x5d14bf[_0xc142('0x3d')]:_0xeb6642[_0xc142('0x37')];if(!_0x2707de['query'][_0xc142('0x3f')]('nolimit')){_0x5d14bf[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0x2707de[_0xc142('0x38')][_0xc142('0x1e')]);_0x5d14bf[_0xc142('0x1c')]=qs['offset'](_0x2707de['query'][_0xc142('0x1c')]);}_0x5d14bf[_0xc142('0x40')]=qs[_0xc142('0x41')](_0x2707de[_0xc142('0x38')][_0xc142('0x41')]);_0x5d14bf[_0xc142('0x42')]=qs[_0xc142('0x3a')](_[_0xc142('0x43')](_0x2707de['query'],_0xeb6642[_0xc142('0x3a')]),_0x2910cf);var _0x2bb9a1=[];var _0x409927=squel['select']()[_0xc142('0x44')]('id')[_0xc142('0x44')](_0xc142('0x28'))[_0xc142('0x44')](_0xc142('0x45'))[_0xc142('0x46')](_0xc142('0x47'));var _0x195b84=squel[_0xc142('0x48')]()[_0xc142('0x44')]('u.id')['field']('u.fullname')[_0xc142('0x44')](_0xc142('0x49'))['from']('user_has_whatsapp_interactions','ui')[_0xc142('0x4a')]('users','u',_0xc142('0x4b'));var _0x4018f4=squel['select']()[_0xc142('0x46')]('whatsapp_interactions','i')['left_join']('cm_contacts','c',_0xc142('0x4c'))[_0xc142('0x4a')](_0xc142('0x4d'),'o','o.id\x20=\x20i.UserId')[_0xc142('0x4a')]('whatsapp_accounts','a',_0xc142('0x4e'))[_0xc142('0x4a')](_0xc142('0x4f'),'me',_0xc142('0x50'))[_0xc142('0x4a')](_0xc142('0x51'),'it',_0xc142('0x52'))[_0xc142('0x4a')](_0xc142('0x47'),'t',_0xc142('0x53'));var _0x378a0b=squel[_0xc142('0x54')]();var _0x75456b=[];var _0x139c3c=squel[_0xc142('0x54')]();var _0x43d88d;if(_0x2707de[_0xc142('0x38')][_0xc142('0x55')]){_0x43d88d=as[_0xc142('0x56')](_0x2707de['query'][_0xc142('0x55')]);var _0x22ae31=_0x43d88d[_0xc142('0x57')];for(var _0x1e401b=0x0;_0x1e401b<_0x43d88d['conditions'][_0xc142('0x3e')];_0x1e401b++){var _0x599606=_0x43d88d[_0xc142('0x58')][_0x1e401b];var _0x23bf73='i';var _0x56a167=_['find'](_0x2910cf,[_0xc142('0x28'),_0x599606['field']]);if(!_0x56a167){switch(_0x599606['field']){case _0xc142('0x59'):if(_0x599606[_0xc142('0x5a')]==0x1){_0x4018f4['having']('`'+_0x599606[_0xc142('0x44')]+'`\x20=\x200');}else{_0x4018f4[_0xc142('0x5b')]('`'+_0x599606[_0xc142('0x44')]+'`\x20>\x200');}break;case _0xc142('0x5c'):if(_0x599606[_0xc142('0x5d')]===_0xc142('0x5e')){if(_0x599606['value']['split']('\x20')['length']>0x1){_0x378a0b[_0x22ae31]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc142('0x5f')](_0x599606[_0xc142('0x5a')]),null);}else{var _0x431a80='%'+_0x599606['value']+'%';_0x378a0b[_0x22ae31](_0xc142('0x60'),_0x431a80,_0x431a80,_0x431a80);}}else{_0x56a167=_[_0xc142('0x61')](_0x2910cf,[_0xc142('0x28'),'ContactId']);_0x599606['field']=_0xc142('0x62');_0x51558d=as['buildExpression'](_0x23bf73,_0x56a167['type'],_0x599606);_0x378a0b[_0x22ae31](_0x51558d[_0xc142('0x63')],_0x51558d[_0xc142('0x5a')][_0xc142('0x64')],_0x51558d['value']['end']);}break;case _0xc142('0x65'):var _0x5733fd=_0x599606[_0xc142('0x5a')][_0xc142('0x2f')](',')[_0xc142('0x2b')](function(_0x30f139){return Number(_0x30f139);});_0x5733fd['forEach'](function(_0x9bb630){_0x139c3c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x9bb630+',%');});_0x75456b=_['union'](_0x75456b,_0x5733fd);break;case _0xc142('0x66'):if(_0x599606[_0xc142('0x5d')]===_0xc142('0x5e')){_0x378a0b[_0x22ae31](_0xc142('0x67'),'%'+_0x599606[_0xc142('0x5a')]+'%',null);}else{_0x56a167=_[_0xc142('0x61')](_0x2910cf,[_0xc142('0x28'),_0xc142('0x68')]);_0x599606[_0xc142('0x44')]=_0xc142('0x68');_0x51558d=as[_0xc142('0x69')](_0x23bf73,_0x56a167[_0xc142('0x35')],_0x599606);_0x378a0b[_0x22ae31](_0x51558d['text'],_0x51558d[_0xc142('0x5a')][_0xc142('0x64')],_0x51558d[_0xc142('0x5a')][_0xc142('0x26')]);}break;case _0xc142('0x6a'):_0x51558d=as[_0xc142('0x69')]('me',null,_0x599606);_0x378a0b[_0x22ae31](_0x51558d[_0xc142('0x63')],_0x51558d['value']['start'],_0x51558d[_0xc142('0x5a')][_0xc142('0x26')]);break;}}else{var _0x51558d=as['buildExpression'](_0x23bf73,_0x56a167[_0xc142('0x35')],_0x599606);_0x378a0b[_0x22ae31](_0x51558d['text'],_0x51558d['value']['start'],_0x51558d[_0xc142('0x5a')][_0xc142('0x26')]);}}}else{var _0x24f35f=_(_0x2707de[_0xc142('0x38')])[_0xc142('0x39')]()[_0xc142('0x2b')](function(_0x1b6f2a){return _[_0xc142('0x6b')](_0x2910cf,[_0xc142('0x28'),_0x1b6f2a])?_0x1b6f2a:undefined;})[_0xc142('0x6c')]()[_0xc142('0x5a')]();if(!_['isEmpty'](_0x24f35f)){_0x24f35f[_0xc142('0x6d')](function(_0x4ca7ce){if(_0x4ca7ce===_0xc142('0x6e')){_0x4018f4[_0xc142('0x42')](_0xc142('0x6f'),[][_0xc142('0x70')](_0x2707de[_0xc142('0x38')][_0x4ca7ce]));}else if(_0x4ca7ce===_0xc142('0x71')){var _0x4475c3=JSON['parse'](_0x2707de['query'][_0x4ca7ce])['$gte'];var _0x5bd02b=JSON[_0xc142('0x72')](_0x2707de[_0xc142('0x38')][_0x4ca7ce])['$lte'];_0x4018f4[_0xc142('0x42')](_0xc142('0x73'),_0x4475c3,_0x5bd02b);}else{if(_0x2707de[_0xc142('0x38')][_0x4ca7ce]===_0xc142('0x74')){_0x4018f4['where']('i.'+_0x4ca7ce+_0xc142('0x75'));}else{_0x4018f4[_0xc142('0x42')]('i.'+_0x4ca7ce+_0xc142('0x76'),_0x2707de['query'][_0x4ca7ce]);}}});}if(_0x2707de[_0xc142('0x38')][_0xc142('0x77')]){if(_0x2707de[_0xc142('0x38')][_0xc142('0x77')]==0x1){_0x4018f4[_0xc142('0x5b')](_0xc142('0x78'));}else{_0x4018f4[_0xc142('0x5b')](_0xc142('0x79'));}}if(_0x2707de['query'][_0xc142('0x7a')]){_0x75456b=_[_0xc142('0x7b')](_0x2707de[_0xc142('0x38')][_0xc142('0x7a')])?_0x2707de['query'][_0xc142('0x7a')]:new Array(_0x2707de[_0xc142('0x38')][_0xc142('0x7a')]);_0x75456b[_0xc142('0x6d')](function(_0x2c42e1){_0x139c3c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c42e1+',%');});}if(_0x2707de[_0xc142('0x38')][_0xc142('0x7c')]){var _0x394f1c=_0x2707de['query']['filter'][_0xc142('0x7d')]('\x5c','\x5c\x5c')[_0xc142('0x7d')](/'/g,'\x27\x27');if(qs[_0xc142('0x7e')](_0x394f1c)){_0x378a0b['or']('i.id\x20LIKE\x20?',_0x394f1c+'%')['or']('i.phone\x20LIKE\x20?',_0x394f1c+'%');}else{_0x378a0b['or'](_0xc142('0x7f'),qs[_0xc142('0x5f')](_0x394f1c))['or'](_0xc142('0x80'),_0x394f1c+'%');}}}_0x4018f4[_0xc142('0x42')](_0x378a0b);_0x4018f4[_0xc142('0x81')](_0xc142('0x82'));var _0x28da05={'type':db['Sequelize'][_0xc142('0x83')][_0xc142('0x84')],'raw':!![]};var _0x1aa49b=_0x4018f4[_0xc142('0x85')]();_0x1aa49b[_0xc142('0x44')](_0xc142('0x82'));_0x1aa49b[_0xc142('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc142('0x59'));if(_0x5d14bf['order']){_0x5d14bf[_0xc142('0x40')]['forEach'](function(_0x51dcfa){var _0x1dac5d=_0x51dcfa[0x0]===_0xc142('0x86')?_0x51dcfa[0x0]:'i.'+_0x51dcfa[0x0];_0x4018f4[_0xc142('0x40')](_0x1dac5d,_0x51dcfa[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc142('0x87')](_0x75456b)){_0x4018f4[_0xc142('0x5b')](_0x139c3c);_0x1aa49b[_0xc142('0x42')](_0xc142('0x88'),_0x75456b);}BPromise['resolve']()[_0xc142('0x31')](function(){if(!_0x43d88d){if(_0x2707de[_0xc142('0x38')][_0xc142('0x6e')])return;_0x1aa49b[_0xc142('0x42')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x4018f4['where'](_0xc142('0x89'));return;}if(_0x2707de['user'][_0xc142('0x8a')]!==_0xc142('0x8b'))return;return _0x2707de[_0xc142('0x8c')][_0xc142('0x8d')]({'attributes':['id'],'raw':!![]})[_0xc142('0x31')](function(_0x542b35){if(_[_0xc142('0x87')](_0x542b35)){_0x1aa49b['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x4018f4[_0xc142('0x42')](_0xc142('0x8e'));}else{_0x1aa49b['where'](_0xc142('0x6f'),_[_0xc142('0x2b')](_0x542b35,'id'));_0x4018f4[_0xc142('0x42')](_0xc142('0x6f'),_[_0xc142('0x2b')](_0x542b35,'id'));}});})['then'](function(){if(_0x2707de['user'][_0xc142('0x8a')]===_0xc142('0x8b')&&!_0x43d88d&&!_0x2707de[_0xc142('0x38')][_0xc142('0x6e')])return[];return db['sequelize'][_0xc142('0x38')](_0x1aa49b['toString'](),_0x28da05);})[_0xc142('0x31')](function(_0x1313c1){_0x1a182['count']=_0x1313c1[_0xc142('0x3e')];if(_0x1a182['count']===0x0)return[];return db['sequelize'][_0xc142('0x38')](_0x409927[_0xc142('0x8f')](),_0x28da05)[_0xc142('0x31')](function(_0x105d1){_0x2bb9a1=_['keyBy'](_0x105d1,'id');_0x28da05=_[_0xc142('0x90')](_0x28da05,{'model':db[_0xc142('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2707de[_0xc142('0x38')][_0xc142('0x3c')]){_0x5d14bf['attributes'][_0xc142('0x6d')](function(_0x3c00b8){_0x4018f4[_0xc142('0x44')]('i.'+_0x3c00b8);});}else{_0x4018f4[_0xc142('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x4018f4[_0xc142('0x44')](_0xc142('0x92'),_0xc142('0x93'));_0x4018f4[_0xc142('0x44')]('a.mandatoryDisposition',_0xc142('0x94'));_0x4018f4['field'](_0xc142('0x95'),_0xc142('0x86'));_0x4018f4[_0xc142('0x44')]('i.*');_0x4018f4[_0xc142('0x44')]('c.firstName',_0xc142('0x96'));_0x4018f4['field'](_0xc142('0x97'),_0xc142('0x98'));_0x4018f4[_0xc142('0x44')](_0xc142('0x99'),'Contact.email');_0x4018f4[_0xc142('0x44')]('c.phone',_0xc142('0x9a'));_0x4018f4[_0xc142('0x44')](_0xc142('0x9b'),_0xc142('0x9c'));_0x4018f4[_0xc142('0x44')](_0xc142('0x9d'),_0xc142('0x9e'));_0x4018f4[_0xc142('0x44')](_0xc142('0x9f'),_0xc142('0xa0'));_0x4018f4['field'](_0xc142('0xa1'),_0xc142('0xa2'));_0x4018f4['field'](_0xc142('0xa3'),'TagIds');}if(_0x5d14bf[_0xc142('0x1e')])_0x4018f4[_0xc142('0x1e')](_0x5d14bf[_0xc142('0x1e')]);if(_0x5d14bf['offset'])_0x4018f4[_0xc142('0x1c')](_0x5d14bf[_0xc142('0x1c')]);return db[_0xc142('0xa4')][_0xc142('0x38')](_0x4018f4[_0xc142('0x8f')](),_0x28da05);})[_0xc142('0x31')](function(_0xed869b){if(_0xed869b['length']>0x0)_0x195b84[_0xc142('0x42')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xc142('0x2b')](_0xed869b,'id'));return db[_0xc142('0xa4')][_0xc142('0x38')](_0x195b84[_0xc142('0x8f')](),_0x28da05)['then'](function(_0x15b5c0){var _0x2d10b=_[_0xc142('0xa5')](_0x15b5c0,_0xc142('0xa6'));var _0x588d92=[];_0xed869b[_0xc142('0x6d')](function(_0x489a57){_0x588d92['push'](updateWhatsappInteraction(_0x489a57,_0x2bb9a1,_0x2d10b));});return BPromise['all'](_0x588d92);});});})['then'](function(_0x5275d1){_0x1a182[_0xc142('0xa7')]=_0x5275d1;return _0x1a182;})[_0xc142('0x31')](respondWithFilteredResult(_0x5871ab,_0x5d14bf))[_0xc142('0xa8')](handleError(_0x5871ab,null));};exports[_0xc142('0xa9')]=function(_0x353f71,_0x24936f){var _0x5d2f1a={'raw':![],'where':{'id':_0x353f71['params']['id']}},_0x358c28={};_0x358c28[_0xc142('0x37')]=_['keys'](db['WhatsappInteraction'][_0xc142('0x33')]);_0x358c28['query']=_[_0xc142('0x39')](_0x353f71[_0xc142('0x38')]);_0x358c28['filters']=_[_0xc142('0x3b')](_0x358c28[_0xc142('0x37')],_0x358c28[_0xc142('0x38')]);_0x5d2f1a[_0xc142('0x3d')]=_[_0xc142('0x3b')](_0x358c28[_0xc142('0x37')],qs[_0xc142('0x3c')](_0x353f71[_0xc142('0x38')][_0xc142('0x3c')]));_0x5d2f1a[_0xc142('0x3d')]=_0x5d2f1a['attributes']['length']?_0x5d2f1a[_0xc142('0x3d')]:_0x358c28[_0xc142('0x37')];if(_0x353f71[_0xc142('0x38')][_0xc142('0xaa')]){_0x5d2f1a[_0xc142('0xab')]=[{'all':!![]}];}_0x5d2f1a=_['merge']({},_0x5d2f1a,_0x353f71['options']);return db[_0xc142('0x91')][_0xc142('0x61')](_0x5d2f1a)[_0xc142('0x31')](handleEntityNotFound(_0x24936f,null))[_0xc142('0x31')](respondWithResult(_0x24936f,null))[_0xc142('0xa8')](handleError(_0x24936f,null));};exports['create']=function(_0x88d94a,_0x3a8126){return db['WhatsappInteraction']['create'](_0x88d94a[_0xc142('0x6a')],{})['then'](respondWithResult(_0x3a8126,0xc9))[_0xc142('0xa8')](handleError(_0x3a8126,null));};exports[_0xc142('0x24')]=function(_0x21ecc0,_0x803c59){if(_0x21ecc0['body']['id']){delete _0x21ecc0[_0xc142('0x6a')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x21ecc0[_0xc142('0xac')]['id']}})[_0xc142('0x31')](handleEntityNotFound(_0x803c59,null))[_0xc142('0x31')](saveUpdates(_0x21ecc0[_0xc142('0x6a')],null))['then'](respondWithResult(_0x803c59,null))['catch'](handleError(_0x803c59,null));};exports['destroy']=function(_0x376524,_0x3f2b1f){return db['WhatsappInteraction'][_0xc142('0x61')]({'where':{'id':_0x376524[_0xc142('0xac')]['id']}})[_0xc142('0x31')](handleEntityNotFound(_0x3f2b1f,null))[_0xc142('0x31')](removeEntity(_0x3f2b1f,null))['catch'](handleError(_0x3f2b1f,null));};exports['describe']=function(_0x5126b1,_0x37e95e){return db[_0xc142('0x91')]['describe']()[_0xc142('0x31')](respondWithResult(_0x37e95e,null))['catch'](handleError(_0x37e95e,null));};exports[_0xc142('0xad')]=function(_0x4da132,_0x439bb8,_0x4bfcbb){return db[_0xc142('0xae')]['find']({'where':{'id':_0x4da132['params']['id']}})['then'](handleEntityNotFound(_0x439bb8,null))[_0xc142('0x31')](function(_0x2010e8){if(_0x2010e8){return _0x2010e8['addMessage'](_0x4da132['body'][_0xc142('0xaf')],_[_0xc142('0xb0')](_0x4da132[_0xc142('0x6a')],[_0xc142('0xaf'),'id'])||{});}})[_0xc142('0x31')](respondWithResult(_0x439bb8,null))[_0xc142('0xa8')](handleError(_0x439bb8,null));};exports[_0xc142('0xb1')]=function(_0xbb10cc,_0x4b0225,_0x23f17c){var _0x7fa3ad={'raw':![],'where':{}};var _0x4bfcb9={};var _0x40cf5c={'count':0x0,'rows':[]};return db[_0xc142('0x91')][_0xc142('0xb2')]({'where':{'id':_0xbb10cc[_0xc142('0xac')]['id']}})[_0xc142('0x31')](handleEntityNotFound(_0x4b0225,null))['then'](function(_0x4316e1){if(_0x4316e1){_0x4bfcb9[_0xc142('0x37')]=_['keys'](db[_0xc142('0xae')][_0xc142('0x33')]);_0x4bfcb9[_0xc142('0x38')]=_[_0xc142('0x39')](_0xbb10cc[_0xc142('0x38')]);_0x4bfcb9['filters']=_[_0xc142('0x3b')](_0x4bfcb9[_0xc142('0x37')],_0x4bfcb9['query']);_0x7fa3ad[_0xc142('0x3d')]=_['intersection'](_0x4bfcb9[_0xc142('0x37')],qs[_0xc142('0x3c')](_0xbb10cc[_0xc142('0x38')][_0xc142('0x3c')]));_0x7fa3ad[_0xc142('0x3d')]=_0x7fa3ad[_0xc142('0x3d')][_0xc142('0x3e')]?_0x7fa3ad[_0xc142('0x3d')]:_0x4bfcb9['model'];if(!_0xbb10cc[_0xc142('0x38')]['hasOwnProperty']('nolimit')){_0x7fa3ad[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0xbb10cc[_0xc142('0x38')][_0xc142('0x1e')]);_0x7fa3ad['offset']=qs[_0xc142('0x1c')](_0xbb10cc[_0xc142('0x38')][_0xc142('0x1c')]);}_0x7fa3ad[_0xc142('0x40')]=qs[_0xc142('0x41')](_0xbb10cc[_0xc142('0x38')][_0xc142('0x41')]);_0x7fa3ad[_0xc142('0x42')]=qs[_0xc142('0x3a')](_['pick'](_0xbb10cc['query'],_0x4bfcb9[_0xc142('0x3a')]));_0x7fa3ad[_0xc142('0x42')][_0xc142('0xa6')]=_0x4316e1['id'];if(_0xbb10cc['query'][_0xc142('0x7c')]){_0x7fa3ad[_0xc142('0x42')]=_[_0xc142('0x90')](_0x7fa3ad[_0xc142('0x42')],{'$or':_[_0xc142('0x2b')](_0x7fa3ad['attributes'],function(_0x2adf48){var _0x13e643={};_0x13e643[_0x2adf48]={'$like':'%'+_0xbb10cc[_0xc142('0x38')][_0xc142('0x7c')]+'%'};return _0x13e643;})});}if(_0xbb10cc[_0xc142('0x38')][_0xc142('0xb3')]){var _0x206321=_0xbb10cc[_0xc142('0x38')][_0xc142('0xb3')][_0xc142('0x2f')](',');var _0x20d9ee={};_0x20d9ee[_0x206321[0x0]]={'$gte':moment(_0x206321[0x1])[_0xc142('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7fa3ad[_0xc142('0x42')]=_[_0xc142('0x90')](_0x7fa3ad[_0xc142('0x42')],_0x20d9ee);}_0x7fa3ad=_[_0xc142('0x90')]({},_0x7fa3ad,_0xbb10cc[_0xc142('0xb5')]);return db['WhatsappMessage'][_0xc142('0x1f')]({'where':_0x7fa3ad[_0xc142('0x42')]})[_0xc142('0x31')](function(_0x407d8b){_0x40cf5c['count']=_0x407d8b;if(_0xbb10cc[_0xc142('0x38')]['includeAll']){_0x7fa3ad[_0xc142('0xab')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xc142('0xb6')](_0x7fa3ad);})[_0xc142('0x31')](function(_0x361bc7){_0x40cf5c[_0xc142('0xa7')]=_0x361bc7;return _0x40cf5c;});}})['then'](respondWithFilteredResult(_0x4b0225,_0x7fa3ad))[_0xc142('0xa8')](handleError(_0x4b0225,null));};exports[_0xc142('0xb7')]=function(_0x520c37,_0xdc576a,_0x4a5881){return db['WhatsappInteraction'][_0xc142('0x61')]({'where':{'id':_0x520c37['params']['id']}})[_0xc142('0x31')](handleEntityNotFound(_0xdc576a,null))[_0xc142('0x31')](function(_0x105a1a){if(_0x105a1a){return _0x105a1a['setTags'](_0x520c37[_0xc142('0x6a')][_0xc142('0xaf')],_[_0xc142('0xb0')](_0x520c37[_0xc142('0x6a')],['ids','id'])||{})[_0xc142('0xb8')](function(){return db[_0xc142('0x65')][_0xc142('0xb6')]({'attributes':['id',_0xc142('0x28'),_0xc142('0x45')],'where':{'id':_0x520c37['body'][_0xc142('0xaf')]}});})[_0xc142('0x31')](function(_0x45be1b){socket[_0xc142('0xb9')](_0xc142('0xba'),{'id':Number(_0x520c37['params']['id']),'tags':_0x45be1b||[]});return{'id':Number(_0x520c37['params']['id']),'tags':_0x45be1b||[]};});}})['then'](respondWithResult(_0xdc576a,null))[_0xc142('0xa8')](handleError(_0xdc576a,null));};exports['removeTags']=function(_0x4121c1,_0x3900e2,_0x2b9a95){return db[_0xc142('0x91')][_0xc142('0x61')]({'where':{'id':_0x4121c1['params']['id']}})[_0xc142('0x31')](handleEntityNotFound(_0x3900e2,null))['then'](function(_0x4d7c7b){if(_0x4d7c7b){return _0x4d7c7b['removeTags'](_0x4121c1['query'][_0xc142('0xaf')]);}})[_0xc142('0x31')](respondWithStatusCode(_0x3900e2,null))[_0xc142('0xa8')](handleError(_0x3900e2,null));};exports[_0xc142('0xbb')]=function(_0xec4b20,_0x31c837){var _0x4011d5=moment()[_0xc142('0xbc')]()[_0xc142('0x8f')]();var _0x30eb7c=path[_0xc142('0xbd')](config[_0xc142('0xbe')],_0xc142('0xbf'),_0xc142('0xc0'),_0xc142('0xc1'));var _0x463f60=path[_0xc142('0xbd')](config[_0xc142('0xbe')],_0xc142('0xbf'),_0xc142('0xc0'),'attachments');var _0x279f97=path[_0xc142('0xbd')](_0x30eb7c,_0x4011d5);var _0x33677e=util[_0xc142('0xb4')](_0xc142('0xc2'),_0xec4b20[_0xc142('0xac')]['id'],_0x4011d5);var _0x4db8f0=path[_0xc142('0xbd')](_0x30eb7c,_0x33677e);var _0x5ce753=[];_0x5ce753['push']({'model':db[_0xc142('0x66')],'as':'User','attributes':['id',_0xc142('0x2c')],'raw':!![]});_0x5ce753[_0xc142('0x30')]({'model':db[_0xc142('0xc3')],'as':_0xc142('0x5c'),'attributes':['id',_0xc142('0xc4'),_0xc142('0xc5')],'raw':!![]});if(_0xec4b20['query'][_0xc142('0xc6')]){_0x5ce753[_0xc142('0x30')]({'model':db['Attachment'],'as':_0xc142('0xc7'),'raw':!![]});}var _0x523d5f=[{'model':db[_0xc142('0xae')],'as':_0xc142('0xc8'),'attributes':['id',_0xc142('0x6a'),_0xc142('0x71'),_0xc142('0xc9'),_0xc142('0xca'),_0xc142('0x77')],'include':_0x5ce753}];_0x523d5f[_0xc142('0x30')]({'model':db[_0xc142('0xcb')],'as':'Account','attributes':['id',_0xc142('0x28')]});_0x523d5f['push']({'model':db[_0xc142('0x66')],'as':_0xc142('0xcc'),'attributes':['id',_0xc142('0x2c')]});return db['WhatsappInteraction'][_0xc142('0x61')]({'where':{'id':_0xec4b20['params']['id']},'include':_0x523d5f})['then'](handleEntityNotFound(_0x31c837,null))[_0xc142('0x31')](function(_0xca8880){if(_0xca8880){var _0x67b768=_0xca8880['get']({'plain':!![]});fs[_0xc142('0xcd')](_0x279f97);var _0x230207={'channel':_0xc142('0xce'),'account':_0x67b768[_0xc142('0xcf')]['name'],'agent':_0x67b768[_0xc142('0xcc')]?_0x67b768[_0xc142('0xcc')][_0xc142('0x2c')]:_0xc142('0xd0'),'createdAt':moment(_0x67b768[_0xc142('0x71')])[_0xc142('0xb4')](_0xc142('0xd1'))['toString'](),'closedAt':_0x67b768['closed']?moment(_0x67b768['closedAt'])['format'](_0xc142('0xd1'))[_0xc142('0x8f')]():'','disposition':_0x67b768[_0xc142('0xd2')],'messages':_(_0x67b768[_0xc142('0xc8')])[_0xc142('0x7c')]({'secret':![]})[_0xc142('0x2b')](function(_0x1749be){if(_0x1749be[_0xc142('0xc7')]){var _0x244438=path[_0xc142('0xbd')](_0x463f60,_0x1749be[_0xc142('0xc7')][_0xc142('0xd3')]);if(fs[_0xc142('0xd4')](_0x244438)){fs[_0xc142('0xd5')](_0x244438)[_0xc142('0xd6')](fs[_0xc142('0xd7')](path[_0xc142('0xbd')](_0x279f97,_0x1749be[_0xc142('0xc7')]['basename'])));}}return{'date':moment(_0x1749be[_0xc142('0x71')])['format'](_0xc142('0xd1'))['toString'](),'sender':_0x1749be[_0xc142('0xc9')]===_0xc142('0xd8')?_0x1749be[_0xc142('0x66')]?_0x1749be[_0xc142('0x66')][_0xc142('0x2c')]:_0xc142('0xd9'):_0x1749be['Contact']['firstName']+(_0x1749be[_0xc142('0x5c')]['lastName']?'\x20'+_0x1749be['Contact'][_0xc142('0xc5')]:''),'body':_0x1749be['Attachment']?_0x1749be[_0xc142('0xc7')][_0xc142('0xd3')]:_0x1749be[_0xc142('0x6a')],'direction':_0x1749be['direction']==='out'?'A':'C','secret':_0x1749be[_0xc142('0xca')],'read':_0x1749be['read'],'attachment':_0x1749be['Attachment']};})[_0xc142('0x5a')]()};return ejs[_0xc142('0xda')](path[_0xc142('0xbd')](config['root'],_0xc142('0xbf'),_0xc142('0xdb'),'downloadInteraction.ejs'),{'interaction':_0x230207})[_0xc142('0x31')](function(_0x2f7612){var _0x756b1f=path[_0xc142('0xbd')](_0x279f97,'transcript-'+_0x67b768['id']+'-'+_0x4011d5+_0xc142('0xdc'));var _0x2ca8fc={'path':_0x756b1f,'channel':_0xc142('0xce'),'interactionId':_0x67b768['id']};return pdf[_0xc142('0xdd')](_0x2f7612,_0x2ca8fc);})[_0xc142('0x31')](function(){return new BPromise(function(_0x14049b,_0x523c70){zipdir(_0x279f97,{'saveTo':_0x4db8f0},function(_0x1472d0,_0x4ce4dd){if(_0x1472d0)return _0x523c70(_0x1472d0);return _0x14049b(_0x4ce4dd);});})[_0xc142('0x31')](function(){return new BPromise(function(_0x2b2b5b,_0x2b0536){rimraf(_0x279f97,function(_0x3fca32){if(_0x3fca32)_0x2b0536(_0x3fca32);return _0x2b2b5b();});});})[_0xc142('0x31')](function(){return _0x31c837[_0xc142('0xbb')](_0x4db8f0,_0x33677e,function(_0x3341cb){if(_0x3341cb){console[_0xc142('0xde')](_0xc142('0xdf'),_0x3341cb);}else{fs[_0xc142('0xe0')](_0x4db8f0);}});});});}else{return _0x31c837['sendStatus'](0xc8);}})[_0xc142('0xa8')](handleError(_0x31c837,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d83b034..4aa479f 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 _0xdbfc=['save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x3198a5,_0x2f4188){var _0x4c259a=function(_0x3fde32){while(--_0x3fde32){_0x3198a5['push'](_0x3198a5['shift']());}};_0x4c259a(++_0x2f4188);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x32f164,_0x30008d){_0x32f164=_0x32f164-0x0;var _0x1ab806=_0xdbfc[_0x32f164];return _0x1ab806;};'use strict';var EventEmitter=require(_0xcdbf('0x0'));var WhatsappInteraction=require(_0xcdbf('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0xcdbf('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xcdbf('0x3')](0x0);var events={'afterCreate':_0xcdbf('0x4'),'afterUpdate':_0xcdbf('0x5'),'afterDestroy':_0xcdbf('0x6')};function emitEvent(_0x1c2ce4){return function(_0xed183,_0x56f671,_0x3ffa10){_0xed183[_0xcdbf('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x369d61){_0xed183[_0xcdbf('0x8')](_0xcdbf('0x9'),_0x369d61[_0xcdbf('0xa')](function(_0x59cb76){return{'id':_0x59cb76['id']};}));return WhatsappMessage[_0xcdbf('0xb')]({'where':{'WhatsappInteractionId':_0xed183['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcdbf('0xc')](function(_0x4088ce){_0xed183[_0xcdbf('0x8')](_0xcdbf('0xd'),_0x4088ce['length']);WhatsappInteractionEvents[_0xcdbf('0xe')](_0x1c2ce4+':'+_0xed183['id'],_0xed183);WhatsappInteractionEvents['emit'](_0x1c2ce4,_0xed183);_0x3ffa10(null);})[_0xcdbf('0xf')](_0x3ffa10(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xcdbf('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2697=['catch','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','emit'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x2697,0x120));var _0x7269=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x2697[_0x38a7ac];return _0x53061a;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x7269('0x0'))['db'][_0x7269('0x1')];var WhatsappMessage=require(_0x7269('0x0'))['db'][_0x7269('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7269('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7269('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5bc3e4){return function(_0x2b2be8,_0x350aeb,_0x320ed5){_0x2b2be8[_0x7269('0x5')]({'attributes':['id'],'raw':!![]})[_0x7269('0x6')](function(_0x20ddbf){_0x2b2be8[_0x7269('0x7')](_0x7269('0x8'),_0x20ddbf[_0x7269('0x9')](function(_0x2c5866){return{'id':_0x2c5866['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2b2be8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7269('0x6')](function(_0x1395a1){_0x2b2be8['setDataValue'](_0x7269('0xa'),_0x1395a1['length']);WhatsappInteractionEvents[_0x7269('0xb')](_0x5bc3e4+':'+_0x2b2be8['id'],_0x2b2be8);WhatsappInteractionEvents['emit'](_0x5bc3e4,_0x2b2be8);_0x320ed5(null);})[_0x7269('0xc')](_0x320ed5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x7269('0xd')](e,emitEvent(event));}}module[_0x7269('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index c3ab9a2..4295d8c 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 _0x00fe=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','lodash'];(function(_0x32e77f,_0x14464d){var _0x47e651=function(_0x3c318e){while(--_0x3c318e){_0x32e77f['push'](_0x32e77f['shift']());}};_0x47e651(++_0x14464d);}(_0x00fe,0x179));var _0xe00f=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x00fe[_0xabbd2f];return _0x34a040;};'use strict';var _=require(_0xe00f('0x0'));var util=require('util');var logger=require(_0xe00f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe00f('0x2'));var rp=require(_0xe00f('0x3'));var fs=require('fs');var path=require(_0xe00f('0x4'));var rimraf=require(_0xe00f('0x5'));var config=require(_0xe00f('0x6'));var attributes=require(_0xe00f('0x7'));module[_0xe00f('0x8')]=function(_0x30527e,_0x254d16){return _0x30527e[_0xe00f('0x9')](_0xe00f('0xa'),attributes,{'tableName':_0xe00f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5981b2,_0xbb6cb6,_0x303492){if(_0x5981b2[_0xe00f('0xc')]('closed')){_0x5981b2[_0xe00f('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x303492(null,_0x5981b2);}}});}; \ No newline at end of file +var _0x4eaa=['moment','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x4eaa,0x16d));var _0xa4ea=function(_0x3c054e,_0x5bac8b){_0x3c054e=_0x3c054e-0x0;var _0x1889f5=_0x4eaa[_0x3c054e];return _0x1889f5;};'use strict';var _=require(_0xa4ea('0x0'));var util=require('util');var logger=require(_0xa4ea('0x1'))(_0xa4ea('0x2'));var moment=require(_0xa4ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4ea('0x4'));var fs=require('fs');var path=require(_0xa4ea('0x5'));var rimraf=require(_0xa4ea('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4ea('0x7'));module[_0xa4ea('0x8')]=function(_0x184df6,_0x30f202){return _0x184df6['define'](_0xa4ea('0x9'),attributes,{'tableName':_0xa4ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39e19c,_0x10e92f,_0x1b5aac){if(_0x39e19c[_0xa4ea('0xb')](_0xa4ea('0xc'))){_0x39e19c[_0xa4ea('0xd')]=moment()[_0xa4ea('0xe')](_0xa4ea('0xf'));}_0x1b5aac(null,_0x39e19c);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 40f0059..c0a2b1d 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 _0xd229=['rpc','jayson/promise','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','ids','omit','spread','AddTags','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x47a0b0,_0xe18865){var _0x4e9dd6=function(_0x3cb34a){while(--_0x3cb34a){_0x47a0b0['push'](_0x47a0b0['shift']());}};_0x4e9dd6(++_0xe18865);}(_0xd229,0x77));var _0x9d22=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0xd229[_0x47b15f];return _0x55bf25;};'use strict';var _=require(_0x9d22('0x0'));var util=require(_0x9d22('0x1'));var moment=require('moment');var BPromise=require(_0x9d22('0x2'));var rs=require(_0x9d22('0x3'));var fs=require('fs');var Redis=require(_0x9d22('0x4'));var db=require(_0x9d22('0x5'))['db'];var utils=require(_0x9d22('0x6'));var logger=require('../../config/logger')(_0x9d22('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d22('0x8'));var client=jayson[_0x9d22('0x9')][_0x9d22('0xa')]({'port':0x232a});config[_0x9d22('0xb')]=_['defaults'](config[_0x9d22('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d22('0xc'))(new Redis(config[_0x9d22('0xb')]));require(_0x9d22('0xd'))[_0x9d22('0xe')](socket);function respondWithRpcPromise(_0x3d363,_0xf75d70,_0x3bea32){return new BPromise(function(_0x1213b3,_0x1dfdf1){return client[_0x9d22('0xf')](_0x3d363,_0x3bea32)[_0x9d22('0x10')](function(_0xa46d9f){logger[_0x9d22('0x11')](_0x9d22('0x12'),_0xf75d70,_0x9d22('0x13'));logger['debug'](_0x9d22('0x14'),_0xf75d70,_0x9d22('0x13'),JSON[_0x9d22('0x15')](_0xa46d9f));if(_0xa46d9f[_0x9d22('0x16')]){if(_0xa46d9f['error'][_0x9d22('0x17')]===0x1f4){logger['error'](_0x9d22('0x12'),_0xf75d70,_0xa46d9f[_0x9d22('0x16')][_0x9d22('0x18')]);return _0x1dfdf1(_0xa46d9f[_0x9d22('0x16')][_0x9d22('0x18')]);}logger[_0x9d22('0x16')](_0x9d22('0x12'),_0xf75d70,_0xa46d9f[_0x9d22('0x16')][_0x9d22('0x18')]);return _0x1213b3(_0xa46d9f['error'][_0x9d22('0x18')]);}else{logger[_0x9d22('0x11')](_0x9d22('0x12'),_0xf75d70,_0x9d22('0x13'));_0x1213b3(_0xa46d9f[_0x9d22('0x19')][_0x9d22('0x18')]);}})[_0x9d22('0x1a')](function(_0x141141){logger[_0x9d22('0x16')](_0x9d22('0x12'),_0xf75d70,_0x141141);_0x1dfdf1(_0x141141);});});}exports['UpdateWhatsappInteraction']=function(_0x3f6160){var _0x38559e=this;return new Promise(function(_0x57007d,_0x5a7be8){return db['WhatsappInteraction'][_0x9d22('0x1b')](_0x3f6160[_0x9d22('0x1c')],{'raw':_0x3f6160[_0x9d22('0x1d')]?_0x3f6160[_0x9d22('0x1d')][_0x9d22('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f6160[_0x9d22('0x1d')]?_0x3f6160[_0x9d22('0x1d')][_0x9d22('0x1f')]||null:null,'attributes':_0x3f6160[_0x9d22('0x1d')]?_0x3f6160['options'][_0x9d22('0x20')]||null:null,'limit':_0x3f6160[_0x9d22('0x1d')]?_0x3f6160[_0x9d22('0x1d')][_0x9d22('0x21')]||null:null})[_0x9d22('0x10')](function(_0x3eab82){logger[_0x9d22('0x11')](_0x9d22('0x22'),_0x3f6160);logger['debug'](_0x9d22('0x22'),_0x3f6160,JSON[_0x9d22('0x15')](_0x3eab82));_0x57007d(_0x3eab82);})[_0x9d22('0x1a')](function(_0x13a341){logger['error'](_0x9d22('0x22'),_0x13a341[_0x9d22('0x18')],_0x3f6160);_0x5a7be8(_0x38559e[_0x9d22('0x16')](0x1f4,_0x13a341[_0x9d22('0x18')]));});});};exports[_0x9d22('0x23')]=function(_0x583466){return new Promise(function(_0x1091e3,_0x35a5c1){return db[_0x9d22('0x24')]['find']({'where':_0x583466[_0x9d22('0x1d')]?_0x583466[_0x9d22('0x1d')][_0x9d22('0x1f')]||null:null})[_0x9d22('0x10')](function(_0xc2954){if(_0xc2954){return _0xc2954['addTags'](_0x583466[_0x9d22('0x1c')][_0x9d22('0x25')],_[_0x9d22('0x26')](_0x583466[_0x9d22('0x1c')],[_0x9d22('0x25'),'id'])||{});}})[_0x9d22('0x27')](function(_0x1a4d1a){logger[_0x9d22('0x11')](_0x9d22('0x28'),_0x583466);logger[_0x9d22('0x29')]('AddTags',_0x583466,JSON['stringify'](_0x1a4d1a));_0x1091e3(_0x1a4d1a);})[_0x9d22('0x1a')](function(_0x206675){logger[_0x9d22('0x16')](_0x9d22('0x28'),_0x206675[_0x9d22('0x18')],_0x583466);_0x35a5c1(_this[_0x9d22('0x16')](0x1f4,_0x206675[_0x9d22('0x18')]));});});}; \ No newline at end of file +var _0xa3e6=['info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa3e6,0xe1));var _0x6a3e=function(_0x3ad246,_0x34d59e){_0x3ad246=_0x3ad246-0x0;var _0xff85f9=_0xa3e6[_0x3ad246];return _0xff85f9;};'use strict';var _=require('lodash');var util=require(_0x6a3e('0x0'));var moment=require('moment');var BPromise=require(_0x6a3e('0x1'));var rs=require(_0x6a3e('0x2'));var fs=require('fs');var Redis=require(_0x6a3e('0x3'));var db=require(_0x6a3e('0x4'))['db'];var utils=require(_0x6a3e('0x5'));var logger=require(_0x6a3e('0x6'))(_0x6a3e('0x7'));var config=require(_0x6a3e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a3e('0x9')]({'port':0x232a});config[_0x6a3e('0xa')]=_[_0x6a3e('0xb')](config[_0x6a3e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a3e('0xc'))(new Redis(config[_0x6a3e('0xa')]));require(_0x6a3e('0xd'))['register'](socket);function respondWithRpcPromise(_0x2c0253,_0x4b6ba7,_0x32c0c9){return new BPromise(function(_0xd6032e,_0x1bd8f0){return client[_0x6a3e('0xe')](_0x2c0253,_0x32c0c9)['then'](function(_0x54be16){logger[_0x6a3e('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x4b6ba7,_0x6a3e('0x10'));logger[_0x6a3e('0x11')](_0x6a3e('0x12'),_0x4b6ba7,_0x6a3e('0x10'),JSON[_0x6a3e('0x13')](_0x54be16));if(_0x54be16['error']){if(_0x54be16[_0x6a3e('0x14')][_0x6a3e('0x15')]===0x1f4){logger[_0x6a3e('0x14')](_0x6a3e('0x16'),_0x4b6ba7,_0x54be16[_0x6a3e('0x14')]['message']);return _0x1bd8f0(_0x54be16['error'][_0x6a3e('0x17')]);}logger['error'](_0x6a3e('0x16'),_0x4b6ba7,_0x54be16[_0x6a3e('0x14')][_0x6a3e('0x17')]);return _0xd6032e(_0x54be16[_0x6a3e('0x14')][_0x6a3e('0x17')]);}else{logger[_0x6a3e('0xf')](_0x6a3e('0x16'),_0x4b6ba7,'request\x20sent');_0xd6032e(_0x54be16['result'][_0x6a3e('0x17')]);}})[_0x6a3e('0x18')](function(_0x6ef12e){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x4b6ba7,_0x6ef12e);_0x1bd8f0(_0x6ef12e);});});}exports[_0x6a3e('0x19')]=function(_0x1d85cb){var _0x3418d7=this;return new Promise(function(_0x117873,_0x43e82b){return db['WhatsappInteraction'][_0x6a3e('0x1a')](_0x1d85cb[_0x6a3e('0x1b')],{'raw':_0x1d85cb[_0x6a3e('0x1c')]?_0x1d85cb[_0x6a3e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d85cb[_0x6a3e('0x1c')]?_0x1d85cb[_0x6a3e('0x1c')][_0x6a3e('0x1d')]||null:null,'attributes':_0x1d85cb[_0x6a3e('0x1c')]?_0x1d85cb['options'][_0x6a3e('0x1e')]||null:null,'limit':_0x1d85cb[_0x6a3e('0x1c')]?_0x1d85cb[_0x6a3e('0x1c')][_0x6a3e('0x1f')]||null:null})[_0x6a3e('0x20')](function(_0x2ddabb){logger['info'](_0x6a3e('0x19'),_0x1d85cb);logger[_0x6a3e('0x11')]('UpdateWhatsappInteraction',_0x1d85cb,JSON['stringify'](_0x2ddabb));_0x117873(_0x2ddabb);})[_0x6a3e('0x18')](function(_0x4d4672){logger[_0x6a3e('0x14')](_0x6a3e('0x19'),_0x4d4672['message'],_0x1d85cb);_0x43e82b(_0x3418d7['error'](0x1f4,_0x4d4672[_0x6a3e('0x17')]));});});};exports[_0x6a3e('0x21')]=function(_0x30afa1){return new Promise(function(_0x34bd89,_0x30515d){return db['WhatsappInteraction'][_0x6a3e('0x22')]({'where':_0x30afa1[_0x6a3e('0x1c')]?_0x30afa1[_0x6a3e('0x1c')][_0x6a3e('0x1d')]||null:null})[_0x6a3e('0x20')](function(_0x579750){if(_0x579750){return _0x579750[_0x6a3e('0x23')](_0x30afa1['body'][_0x6a3e('0x24')],_[_0x6a3e('0x25')](_0x30afa1['body'],[_0x6a3e('0x24'),'id'])||{});}})[_0x6a3e('0x26')](function(_0x460233){logger[_0x6a3e('0xf')](_0x6a3e('0x27'),_0x30afa1);logger[_0x6a3e('0x11')](_0x6a3e('0x27'),_0x30afa1,JSON[_0x6a3e('0x13')](_0x460233));_0x34bd89(_0x460233);})[_0x6a3e('0x18')](function(_0x61996){logger[_0x6a3e('0x14')]('AddTags',_0x61996[_0x6a3e('0x17')],_0x30afa1);_0x30515d(_this['error'](0x1f4,_0x61996[_0x6a3e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3e14e82..c7f61b2 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 _0x08e4=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4bac1c,_0x3fc345){var _0x40b4db=function(_0x4f7e86){while(--_0x4f7e86){_0x4bac1c['push'](_0x4bac1c['shift']());}};_0x40b4db(++_0x3fc345);}(_0x08e4,0x13c));var _0x408e=function(_0x4a374a,_0x45da83){_0x4a374a=_0x4a374a-0x0;var _0x2158b4=_0x08e4[_0x4a374a];return _0x2158b4;};'use strict';var WhatsappInteractionEvents=require(_0x408e('0x0'));var events=[_0x408e('0x1'),'remove','update'];function createListener(_0x5aef52,_0x4ffa5f){return function(_0x566ab0){_0x4ffa5f[_0x408e('0x2')](_0x5aef52,_0x566ab0);};}function removeListener(_0x22e2e5,_0x5ec61e){return function(){WhatsappInteractionEvents[_0x408e('0x3')](_0x22e2e5,_0x5ec61e);};}exports['register']=function(_0xb565d7){for(var _0x150644=0x0,_0x25e8cf=events[_0x408e('0x4')];_0x150644<_0x25e8cf;_0x150644++){var _0x76822e=events[_0x150644];var _0x12157d=createListener(_0x408e('0x5')+_0x76822e,_0xb565d7);WhatsappInteractionEvents['on'](_0x76822e,_0x12157d);}}; \ No newline at end of file +var _0x9f65=['register','length','./whatsappInteraction.events','remove','update'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x9f65,0x179));var _0x59f6=function(_0x25e00c,_0x457c43){_0x25e00c=_0x25e00c-0x0;var _0xed6d40=_0x9f65[_0x25e00c];return _0xed6d40;};'use strict';var WhatsappInteractionEvents=require(_0x59f6('0x0'));var events=['save',_0x59f6('0x1'),_0x59f6('0x2')];function createListener(_0x4bcb46,_0x41e6fc){return function(_0xfd8df0){_0x41e6fc['emit'](_0x4bcb46,_0xfd8df0);};}function removeListener(_0x33aa15,_0x13ec0d){return function(){WhatsappInteractionEvents['removeListener'](_0x33aa15,_0x13ec0d);};}exports[_0x59f6('0x3')]=function(_0x54a48d){for(var _0x2acfa9=0x0,_0x37347f=events[_0x59f6('0x4')];_0x2acfa9<_0x37347f;_0x2acfa9++){var _0xca9fb4=events[_0x2acfa9];var _0x3f9115=createListener('whatsappInteraction:'+_0xca9fb4,_0x54a48d);WhatsappInteractionEvents['on'](_0xca9fb4,_0x3f9115);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index ec790f3..beb57e3 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 _0x7d40=['index','describe','get','/:id','show','tracked','whatsappmessage:create','create','post','/:id/status','status','put','update','/:id/accept','reject','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated'];(function(_0x2a7982,_0x3a4ade){var _0x5e0db5=function(_0x25def5){while(--_0x25def5){_0x2a7982['push'](_0x2a7982['shift']());}};_0x5e0db5(++_0x3a4ade);}(_0x7d40,0x13a));var _0x07d4=function(_0x3ce8c9,_0x2ccfaa){_0x3ce8c9=_0x3ce8c9-0x0;var _0x184215=_0x7d40[_0x3ce8c9];return _0x184215;};'use strict';var multer=require(_0x07d4('0x0'));var util=require('util');var path=require(_0x07d4('0x1'));var timeout=require(_0x07d4('0x2'));var express=require(_0x07d4('0x3'));var router=express[_0x07d4('0x4')]();var fs_extra=require(_0x07d4('0x5'));var auth=require(_0x07d4('0x6'));var interaction=require(_0x07d4('0x7'));var config=require('../../config/environment');var controller=require(_0x07d4('0x8'));router['get']('/',auth[_0x07d4('0x9')](),controller[_0x07d4('0xa')]);router['get']('/describe',auth[_0x07d4('0x9')](),controller[_0x07d4('0xb')]);router[_0x07d4('0xc')](_0x07d4('0xd'),auth['isAuthenticated'](),controller[_0x07d4('0xe')]);router['post']('/',auth[_0x07d4('0x9')](),interaction[_0x07d4('0xf')]('whatsapp',_0x07d4('0x10')),controller[_0x07d4('0x11')]);router[_0x07d4('0x12')](_0x07d4('0x13'),controller[_0x07d4('0x14')]);router[_0x07d4('0x15')](_0x07d4('0xd'),auth[_0x07d4('0x9')](),controller[_0x07d4('0x16')]);router['put'](_0x07d4('0x17'),auth[_0x07d4('0x9')](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x07d4('0x18')]);router[_0x07d4('0x19')](_0x07d4('0xd'),auth[_0x07d4('0x9')](),controller[_0x07d4('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xea27=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','whatsapp','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','multer','util','connect-timeout'];(function(_0x3bbe75,_0x18c3a5){var _0x5226f0=function(_0x4ac541){while(--_0x4ac541){_0x3bbe75['push'](_0x3bbe75['shift']());}};_0x5226f0(++_0x18c3a5);}(_0xea27,0x183));var _0x7ea2=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xea27[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x7ea2('0x0'));var util=require(_0x7ea2('0x1'));var path=require('path');var timeout=require(_0x7ea2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ea2('0x3'));var auth=require(_0x7ea2('0x4'));var interaction=require(_0x7ea2('0x5'));var config=require(_0x7ea2('0x6'));var controller=require(_0x7ea2('0x7'));router[_0x7ea2('0x8')]('/',auth[_0x7ea2('0x9')](),controller[_0x7ea2('0xa')]);router[_0x7ea2('0x8')](_0x7ea2('0xb'),auth[_0x7ea2('0x9')](),controller['describe']);router[_0x7ea2('0x8')](_0x7ea2('0xc'),auth[_0x7ea2('0x9')](),controller[_0x7ea2('0xd')]);router[_0x7ea2('0xe')]('/',auth[_0x7ea2('0x9')](),interaction['tracked'](_0x7ea2('0xf'),_0x7ea2('0x10')),controller['create']);router[_0x7ea2('0xe')](_0x7ea2('0x11'),controller[_0x7ea2('0x12')]);router[_0x7ea2('0x13')](_0x7ea2('0xc'),auth[_0x7ea2('0x9')](),controller[_0x7ea2('0x14')]);router[_0x7ea2('0x13')](_0x7ea2('0x15'),auth[_0x7ea2('0x9')](),controller[_0x7ea2('0x16')]);router[_0x7ea2('0x13')]('/:id/reject',auth[_0x7ea2('0x9')](),controller[_0x7ea2('0x17')]);router[_0x7ea2('0x18')](_0x7ea2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7ea2('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 27f4161..200635e 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 _0x6cad=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x10877f,_0xe44893){var _0x161a32=function(_0x3bc55f){while(--_0x3bc55f){_0x10877f['push'](_0x10877f['shift']());}};_0x161a32(++_0xe44893);}(_0x6cad,0x13a));var _0xd6ca=function(_0x722acb,_0x3d76e0){_0x722acb=_0x722acb-0x0;var _0x28dfb0=_0x6cad[_0x722acb];return _0x28dfb0;};'use strict';var Sequelize=require(_0xd6ca('0x0'));module['exports']={'body':{'type':Sequelize[_0xd6ca('0x1')](_0xd6ca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd6ca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6ca('0x4')]('in',_0xd6ca('0x5')),'defaultValue':_0xd6ca('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd6ca('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xd6ca('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd6ca('0x6')]},'providerResponse':{'type':Sequelize[_0xd6ca('0x1')]}}; \ No newline at end of file +var _0xdbf5=['out','STRING','DATE','TEXT','exports','BOOLEAN','ENUM'];(function(_0x592fdf,_0x3c13b6){var _0x4c3af3=function(_0x40136e){while(--_0x40136e){_0x592fdf['push'](_0x592fdf['shift']());}};_0x4c3af3(++_0x3c13b6);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xf86ceb,_0x4175e6){_0xf86ceb=_0xf86ceb-0x0;var _0x178d22=_0xdbf5[_0xf86ceb];return _0x178d22;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5dbf('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5dbf('0x2')]('in',_0x5dbf('0x3')),'defaultValue':_0x5dbf('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5dbf('0x4')](0xbe)},'phone':{'type':Sequelize[_0x5dbf('0x4')]},'readAt':{'type':Sequelize[_0x5dbf('0x5')]},'secret':{'type':Sequelize[_0x5dbf('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5dbf('0x4')]},'providerResponse':{'type':Sequelize[_0x5dbf('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 9a490f1..e7a2668 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 _0x688c=['inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','then','stack','name','send','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','rows','rawAttributes','create','body','find','params','destroy','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from'];(function(_0x2d986f,_0x12a247){var _0x21150f=function(_0x3ced6f){while(--_0x3ced6f){_0x2d986f['push'](_0x2d986f['shift']());}};_0x21150f(++_0x12a247);}(_0x688c,0x11f));var _0xc688=function(_0x1145de,_0x399846){_0x1145de=_0x1145de-0x0;var _0x2119e4=_0x688c[_0x1145de];return _0x2119e4;};'use strict';var emlformat=require(_0xc688('0x0'));var rimraf=require(_0xc688('0x1'));var zipdir=require(_0xc688('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc688('0x3'));var moment=require(_0xc688('0x4'));var BPromise=require(_0xc688('0x5'));var Mustache=require('mustache');var util=require(_0xc688('0x6'));var path=require('path');var sox=require(_0xc688('0x7'));var csv=require(_0xc688('0x8'));var ejs=require(_0xc688('0x9'));var fs=require('fs');var fs_extra=require(_0xc688('0xa'));var _=require('lodash');var squel=require(_0xc688('0xb'));var crypto=require('crypto');var jsforce=require(_0xc688('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc688('0x8'));var querystring=require(_0xc688('0xd'));var Papa=require('papaparse');var Redis=require(_0xc688('0xe'));var authService=require(_0xc688('0xf'));var qs=require(_0xc688('0x10'));var as=require(_0xc688('0x11'));var hardwareService=require(_0xc688('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc688('0x13'));var config=require(_0xc688('0x14'));var licenseUtil=require(_0xc688('0x15'));var db=require(_0xc688('0x16'))['db'];config[_0xc688('0x17')]=_['defaults'](config[_0xc688('0x17')],{'host':_0xc688('0x18'),'port':0x18eb});var socket=require(_0xc688('0x19'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xc688('0x1a')](socket);var jayson=require(_0xc688('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc688('0x1c')][_0xc688('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4f4db7,_0x4f30a9,_0x532ad8,_0x236845){return new BPromise(function(_0x191bf4,_0x422729){var _0xadb779=_0x236845||client;return _0xadb779['request'](_0x4f4db7,_0x532ad8)['then'](function(_0x505fb0){logger[_0xc688('0x1e')](_0xc688('0x1f'),_0x4f30a9,_0xc688('0x20'));logger[_0xc688('0x21')](_0xc688('0x22'),_0x4f30a9,_0xc688('0x20'),JSON['stringify'](_0x505fb0));if(_0x505fb0['error']){if(_0x505fb0[_0xc688('0x23')][_0xc688('0x24')]===0x1f4){logger['error'](_0xc688('0x1f'),_0x4f30a9,_0x505fb0[_0xc688('0x23')][_0xc688('0x25')]);return _0x422729(_0x505fb0[_0xc688('0x23')]['message']);}logger[_0xc688('0x23')](_0xc688('0x1f'),_0x4f30a9,_0x505fb0[_0xc688('0x23')][_0xc688('0x25')]);return _0x191bf4(_0x505fb0[_0xc688('0x23')][_0xc688('0x25')]);}else{logger[_0xc688('0x1e')](_0xc688('0x1f'),_0x4f30a9,_0xc688('0x20'));_0x191bf4(_0x505fb0[_0xc688('0x26')][_0xc688('0x25')]);}})[_0xc688('0x27')](function(_0x5f1662){logger[_0xc688('0x23')](_0xc688('0x1f'),_0x4f30a9,_0x5f1662);_0x422729(_0x5f1662);});});}function respondWithStatusCode(_0x206a00,_0x28c6fe){_0x28c6fe=_0x28c6fe||0xcc;return function(_0x353954){if(_0x353954){return _0x206a00[_0xc688('0x28')](_0x28c6fe);}return _0x206a00[_0xc688('0x29')](_0x28c6fe)[_0xc688('0x2a')]();};}function respondWithResult(_0x30bfc9,_0x11a3df){_0x11a3df=_0x11a3df||0xc8;return function(_0xd2061f){if(_0xd2061f){return _0x30bfc9['status'](_0x11a3df)['json'](_0xd2061f);}};}function respondWithFilteredResult(_0x102c48,_0x5463ba){return function(_0x367232){if(_0x367232){var _0x8ad05c=typeof _0x5463ba['offset']==='undefined'&&typeof _0x5463ba[_0xc688('0x2b')]==='undefined';var _0x12bc8b=_0x367232[_0xc688('0x2c')];var _0x16e9b1=_0x8ad05c?0x0:_0x5463ba[_0xc688('0x2d')];var _0x52624a=_0x8ad05c?_0x367232[_0xc688('0x2c')]:_0x5463ba[_0xc688('0x2d')]+_0x5463ba[_0xc688('0x2b')];var _0x54087a;if(_0x52624a>=_0x12bc8b){_0x52624a=_0x12bc8b;_0x54087a=0xc8;}else{_0x54087a=0xce;}_0x102c48[_0xc688('0x29')](_0x54087a);return _0x102c48[_0xc688('0x2e')](_0xc688('0x2f'),_0x16e9b1+'-'+_0x52624a+'/'+_0x12bc8b)[_0xc688('0x30')](_0x367232);}return null;};}function patchUpdates(_0x216222){return function(_0x3c7c85){try{jsonpatch[_0xc688('0x31')](_0x3c7c85,_0x216222,!![]);}catch(_0x495785){return BPromise['reject'](_0x495785);}return _0x3c7c85['save']();};}function saveUpdates(_0x22f1ba,_0x51d9f3){return function(_0x3f2aca){if(_0x3f2aca){return _0x3f2aca['update'](_0x22f1ba)[_0xc688('0x32')](function(_0x48bc56){return _0x48bc56;});}return null;};}function removeEntity(_0x30b125,_0x2f17bd){return function(_0x47dadf){if(_0x47dadf){return _0x47dadf['destroy']()['then'](function(){_0x30b125[_0xc688('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a3695,_0x36a599){return function(_0x3ce167){if(!_0x3ce167){_0x1a3695[_0xc688('0x28')](0x194);}return _0x3ce167;};}function handleError(_0x1fd7ed,_0x433e1a){_0x433e1a=_0x433e1a||0x1f4;return function(_0x566d38){logger['error'](_0x566d38[_0xc688('0x33')]);if(_0x566d38[_0xc688('0x34')]){delete _0x566d38[_0xc688('0x34')];}_0x1fd7ed[_0xc688('0x29')](_0x433e1a)[_0xc688('0x35')](_0x566d38);};}exports['index']=function(_0x500eb0,_0x31e214){var _0x5cad9b={},_0x4a4ae5={},_0x5e08b9={'count':0x0,'rows':[]};var _0x55d6bd=_['map'](db['WhatsappMessage']['rawAttributes'],function(_0x227ee5){return{'name':_0x227ee5[_0xc688('0x36')],'type':_0x227ee5[_0xc688('0x37')]['key']};});_0x4a4ae5[_0xc688('0x38')]=_[_0xc688('0x39')](_0x55d6bd,_0xc688('0x34'));_0x4a4ae5[_0xc688('0x3a')]=_[_0xc688('0x3b')](_0x500eb0[_0xc688('0x3a')]);_0x4a4ae5[_0xc688('0x3c')]=_[_0xc688('0x3d')](_0x4a4ae5[_0xc688('0x38')],_0x4a4ae5[_0xc688('0x3a')]);_0x5cad9b['attributes']=_[_0xc688('0x3d')](_0x4a4ae5['model'],qs['fields'](_0x500eb0[_0xc688('0x3a')][_0xc688('0x3e')]));_0x5cad9b[_0xc688('0x3f')]=_0x5cad9b[_0xc688('0x3f')][_0xc688('0x40')]?_0x5cad9b[_0xc688('0x3f')]:_0x4a4ae5[_0xc688('0x38')];if(!_0x500eb0[_0xc688('0x3a')][_0xc688('0x41')](_0xc688('0x42'))){_0x5cad9b[_0xc688('0x2b')]=qs['limit'](_0x500eb0['query'][_0xc688('0x2b')]);_0x5cad9b[_0xc688('0x2d')]=qs[_0xc688('0x2d')](_0x500eb0[_0xc688('0x3a')][_0xc688('0x2d')]);}_0x5cad9b[_0xc688('0x43')]=qs[_0xc688('0x44')](_0x500eb0['query']['sort']);_0x5cad9b[_0xc688('0x45')]=qs['filters'](_[_0xc688('0x46')](_0x500eb0[_0xc688('0x3a')],_0x4a4ae5[_0xc688('0x3c')]),_0x55d6bd);if(_0x500eb0[_0xc688('0x3a')][_0xc688('0x47')]){_0x5cad9b[_0xc688('0x45')]=_[_0xc688('0x48')](_0x5cad9b[_0xc688('0x45')],{'$or':_[_0xc688('0x39')](_0x55d6bd,function(_0x49250d){if(_0x49250d[_0xc688('0x37')]!==_0xc688('0x49')){var _0x36fa56={};_0x36fa56[_0x49250d[_0xc688('0x34')]]={'$like':'%'+_0x500eb0[_0xc688('0x3a')][_0xc688('0x47')]+'%'};return _0x36fa56;}})});}_0x5cad9b=_[_0xc688('0x48')]({},_0x5cad9b,_0x500eb0[_0xc688('0x4a')]);var _0x44cebf={'where':_0x5cad9b['where']};return db[_0xc688('0x4b')]['count'](_0x44cebf)[_0xc688('0x32')](function(_0x2e4cda){_0x5e08b9[_0xc688('0x2c')]=_0x2e4cda;if(_0x500eb0[_0xc688('0x3a')][_0xc688('0x4c')]){_0x5cad9b[_0xc688('0x4d')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x5cad9b);})[_0xc688('0x32')](function(_0x4e8a49){_0x5e08b9[_0xc688('0x4e')]=_0x4e8a49;return _0x5e08b9;})[_0xc688('0x32')](respondWithFilteredResult(_0x31e214,_0x5cad9b))[_0xc688('0x27')](handleError(_0x31e214,null));};exports['show']=function(_0x2fa263,_0x5da4c5){var _0x1c24e5={'raw':!![],'where':{'id':_0x2fa263['params']['id']}},_0x582679={};_0x582679['model']=_[_0xc688('0x3b')](db[_0xc688('0x4b')][_0xc688('0x4f')]);_0x582679[_0xc688('0x3a')]=_['keys'](_0x2fa263[_0xc688('0x3a')]);_0x582679[_0xc688('0x3c')]=_[_0xc688('0x3d')](_0x582679[_0xc688('0x38')],_0x582679[_0xc688('0x3a')]);_0x1c24e5[_0xc688('0x3f')]=_[_0xc688('0x3d')](_0x582679[_0xc688('0x38')],qs[_0xc688('0x3e')](_0x2fa263[_0xc688('0x3a')][_0xc688('0x3e')]));_0x1c24e5[_0xc688('0x3f')]=_0x1c24e5[_0xc688('0x3f')]['length']?_0x1c24e5['attributes']:_0x582679['model'];if(_0x2fa263[_0xc688('0x3a')][_0xc688('0x4c')]){_0x1c24e5[_0xc688('0x4d')]=[{'all':!![]}];}_0x1c24e5=_[_0xc688('0x48')]({},_0x1c24e5,_0x2fa263[_0xc688('0x4a')]);return db[_0xc688('0x4b')]['find'](_0x1c24e5)[_0xc688('0x32')](handleEntityNotFound(_0x5da4c5,null))[_0xc688('0x32')](respondWithResult(_0x5da4c5,null))[_0xc688('0x27')](handleError(_0x5da4c5,null));};exports[_0xc688('0x50')]=function(_0x3a3397,_0x532272){return db[_0xc688('0x4b')][_0xc688('0x50')](_0x3a3397[_0xc688('0x51')],{})[_0xc688('0x32')](respondWithResult(_0x532272,0xc9))[_0xc688('0x27')](handleError(_0x532272,null));};exports['update']=function(_0x4e90c7,_0x51a6c2){if(_0x4e90c7[_0xc688('0x51')]['id']){delete _0x4e90c7[_0xc688('0x51')]['id'];}return db['WhatsappMessage'][_0xc688('0x52')]({'where':{'id':_0x4e90c7[_0xc688('0x53')]['id']}})['then'](handleEntityNotFound(_0x51a6c2,null))[_0xc688('0x32')](saveUpdates(_0x4e90c7[_0xc688('0x51')],null))[_0xc688('0x32')](respondWithResult(_0x51a6c2,null))[_0xc688('0x27')](handleError(_0x51a6c2,null));};exports[_0xc688('0x54')]=function(_0x4b4057,_0x6064ad){return db[_0xc688('0x4b')]['find']({'where':{'id':_0x4b4057[_0xc688('0x53')]['id']}})[_0xc688('0x32')](handleEntityNotFound(_0x6064ad,null))[_0xc688('0x32')](removeEntity(_0x6064ad,null))[_0xc688('0x27')](handleError(_0x6064ad,null));};exports[_0xc688('0x55')]=function(_0x1a6886,_0x1bdb86){return db[_0xc688('0x4b')][_0xc688('0x55')]()[_0xc688('0x32')](respondWithResult(_0x1bdb86,null))[_0xc688('0x27')](handleError(_0x1bdb86,null));};var interaction_log=require(_0xc688('0x56'))(_0xc688('0x57'));exports[_0xc688('0x58')]=function(_0x1f6b18,_0x18c113,_0x2014bc){var _0xc17e5f={'agent':{},'channel':_0xc688('0x59')};if(_0x1f6b18[_0xc688('0x51')]['id']){delete _0x1f6b18[_0xc688('0x51')]['id'];}_0x1f6b18[_0xc688('0x51')]['read']=!![];_0x1f6b18[_0xc688('0x51')][_0xc688('0x5a')]=moment()[_0xc688('0x5b')](_0xc688('0x5c'));_0x1f6b18[_0xc688('0x51')][_0xc688('0x5d')]=_0x1f6b18[_0xc688('0x51')][_0xc688('0x5d')]||_0x1f6b18[_0xc688('0x5e')]['id'];_0xc17e5f[_0xc688('0x5f')]['id']=_0x1f6b18['body'][_0xc688('0x5d')];return db[_0xc688('0x4b')][_0xc688('0x52')]({'where':{'id':_0x1f6b18[_0xc688('0x53')]['id'],'UserId':null}})[_0xc688('0x32')](handleEntityNotFound(_0x18c113,null))[_0xc688('0x32')](saveUpdates(_0x1f6b18['body'],null))[_0xc688('0x32')](function(_0x30f9a1){if(_0x30f9a1){_0xc17e5f[_0xc688('0x25')]=_0x30f9a1[_0xc688('0x60')]({'plain':!![]});return db[_0xc688('0x61')][_0xc688('0x52')]({'where':{'id':_0x30f9a1[_0xc688('0x62')]}});}return null;})[_0xc688('0x32')](handleEntityNotFound(_0x18c113,null))['then'](function(_0x1cd32a){if(_0x1cd32a){return _0x1cd32a[_0xc688('0x63')]({'UserId':_0x1f6b18[_0xc688('0x51')]['UserId'],'read1stAt':_[_0xc688('0x64')](_0x1cd32a[_0xc688('0x65')])?moment()[_0xc688('0x5b')](_0xc688('0x5c')):undefined});}return null;})[_0xc688('0x32')](function(_0x1968b3){if(_0x1968b3){_0xc17e5f['interaction']=_0x1968b3[_0xc688('0x60')]({'plain':!![]});interaction_log[_0xc688('0x1e')](_0xc688('0x66'),_0x1f6b18[_0xc688('0x5e')]['id'],_0x1f6b18['user'][_0xc688('0x34')],_0x1f6b18[_0xc688('0x5e')][_0xc688('0x67')],_0xc17e5f[_0xc688('0x68')]['id'],_0x1f6b18[_0xc688('0x51')]?JSON[_0xc688('0x69')](_0x1f6b18[_0xc688('0x51')]):_0xc688('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xc688('0x6b'),_0xc17e5f);}return null;})[_0xc688('0x32')](function(_0x508888){var _0x1cf7de=_0xc688('0x6c')+_0x508888[_0xc688('0x25')][_0xc688('0x6d')];return db['sequelize'][_0xc688('0x3a')](_0x1cf7de,{'type':db[_0xc688('0x6e')][_0xc688('0x6f')][_0xc688('0x70')],'raw':!![]})[_0xc688('0x32')](function(_0x30bfc8){return _0x30bfc8;});})[_0xc688('0x32')](function(_0x24039f){if(_0x24039f){_0xc17e5f['message'][_0xc688('0x71')]=_0x24039f[0x0];if(!_0x1f6b18[_0xc688('0x51')][_0xc688('0x5d')])return;return db['User'][_0xc688('0x52')]({'where':{'id':_0x1f6b18['body']['UserId'],'role':_0xc688('0x5f')},'attributes':['id',_0xc688('0x34'),_0xc688('0x72'),_0xc688('0x73'),_0xc688('0x74')],'raw':!![]});}return null;})['then'](function(_0x20f9d8){if(!_0x20f9d8)return null;_0xc17e5f[_0xc688('0x25')]['agent']=_0x20f9d8;return _0xc17e5f;})[_0xc688('0x32')](function(_0x18ebfb){if(_0x18ebfb){if(_0x1f6b18[_0xc688('0x51')]['manual']){_0xc17e5f[_0xc688('0x25')][_0xc688('0x75')]=util['format'](_0xc688('0x76'),_0x1f6b18[_0xc688('0x5e')][_0xc688('0x34')]);_0xc17e5f[_0xc688('0x25')][_0xc688('0x77')]=_0xc17e5f[_0xc688('0x77')];_0xc17e5f[_0xc688('0x25')][_0xc688('0x78')]=_0xc17e5f[_0xc688('0x77')];_0xc17e5f[_0xc688('0x25')][_0xc688('0x79')]=_0xc688('0x58');return respondWithRpcPromise(_0xc688('0x7a'),'EventManager',{'event':_0xc688('0x7b'),'message':_0xc17e5f[_0xc688('0x25')]},client9002)[_0xc688('0x32')](function(){return _0xc17e5f;});}return _0xc17e5f;}return null;})[_0xc688('0x32')](respondWithResult(_0x18c113,null))[_0xc688('0x27')](handleError(_0x18c113,null));};var interaction_log=require(_0xc688('0x56'))(_0xc688('0x57'));exports[_0xc688('0x7c')]=function(_0x5143a1,_0x32db50,_0x192cb8){var _0x49bce3={'agent':{},'channel':_0xc688('0x59')};if(_0x5143a1[_0xc688('0x51')]['id']){delete _0x5143a1[_0xc688('0x51')]['id'];}_0x5143a1[_0xc688('0x51')][_0xc688('0x5d')]=_0x5143a1[_0xc688('0x51')][_0xc688('0x5d')]||_0x5143a1[_0xc688('0x5e')]['id'];_0x49bce3['agent']['id']=_0x5143a1[_0xc688('0x51')][_0xc688('0x5d')];return db[_0xc688('0x4b')][_0xc688('0x52')]({'where':{'id':_0x5143a1['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32db50,null))[_0xc688('0x32')](function(_0xb68ec7){if(_0xb68ec7){_0x49bce3[_0xc688('0x25')]=_0xb68ec7[_0xc688('0x60')]({'plain':!![]});return db[_0xc688('0x61')][_0xc688('0x52')]({'where':{'id':_0xb68ec7[_0xc688('0x62')]}});}return null;})[_0xc688('0x32')](handleEntityNotFound(_0x32db50,null))[_0xc688('0x32')](function(_0x1715f5){if(_0x1715f5){_0x49bce3[_0xc688('0x68')]=_0x1715f5[_0xc688('0x60')]({'plain':!![]});interaction_log['info'](_0xc688('0x7d'),_0x5143a1[_0xc688('0x5e')]['id'],_0x5143a1[_0xc688('0x5e')][_0xc688('0x34')],_0x5143a1[_0xc688('0x5e')][_0xc688('0x67')],_0x49bce3[_0xc688('0x68')]['id'],_0x5143a1[_0xc688('0x51')]?JSON[_0xc688('0x69')](_0x5143a1[_0xc688('0x51')]):'null');return respondWithRpcPromise(_0xc688('0x7e'),_0xc688('0x7f'),_0x49bce3);}return null;})['then'](function(_0x20bb00){var _0x32f9f0=_0xc688('0x6c')+_0x20bb00['message'][_0xc688('0x6d')];return db['sequelize']['query'](_0x32f9f0,{'type':db[_0xc688('0x6e')][_0xc688('0x6f')][_0xc688('0x70')],'raw':!![]})['then'](function(_0x448db3){return _0x448db3;});})[_0xc688('0x32')](function(_0xae9008){if(_0xae9008){_0x49bce3[_0xc688('0x25')][_0xc688('0x71')]=_0xae9008[0x0];if(!_0x5143a1[_0xc688('0x51')]['UserId'])return;return db[_0xc688('0x80')][_0xc688('0x52')]({'where':{'id':_0x5143a1[_0xc688('0x51')]['UserId'],'role':'agent'},'attributes':['id',_0xc688('0x34'),_0xc688('0x72'),_0xc688('0x73'),_0xc688('0x74')],'raw':!![]});}return null;})[_0xc688('0x32')](function(_0x18cc50){if(!_0x18cc50)return null;_0x49bce3[_0xc688('0x25')][_0xc688('0x5f')]=_0x18cc50;return _0x49bce3;})[_0xc688('0x32')](function(_0x3250ac){if(_0x3250ac){_0x3250ac[_0xc688('0x25')][_0xc688('0x75')]=util[_0xc688('0x5b')](_0xc688('0x76'),_0x5143a1[_0xc688('0x5e')]['name']);_0x3250ac['message'][_0xc688('0x77')]=_0x49bce3[_0xc688('0x77')];_0x3250ac[_0xc688('0x25')][_0xc688('0x78')]=_0x49bce3[_0xc688('0x77')];_0x3250ac[_0xc688('0x25')]['event']=_0xc688('0x7c');respondWithRpcPromise(_0xc688('0x7a'),_0xc688('0x7a'),{'event':_0xc688('0x81'),'message':_0x3250ac[_0xc688('0x25')]},client9002);return _0x49bce3;}return null;})[_0xc688('0x32')](respondWithResult(_0x32db50,null))[_0xc688('0x27')](handleError(_0x32db50,null));};exports[_0xc688('0x29')]=function(_0xa438a5,_0x12ca85,_0x3b7063){if(_0xa438a5[_0xc688('0x51')]['id']){delete _0xa438a5['body']['id'];}var _0x1483d4;return db['WhatsappMessage'][_0xc688('0x52')]({'where':{'id':_0xa438a5[_0xc688('0x53')]['id']}})[_0xc688('0x32')](handleEntityNotFound(_0x12ca85,null))[_0xc688('0x32')](function(_0x5b3262){if(_0x5b3262){_0x1483d4=_0x5b3262;return db['WhatsappAccount'][_0xc688('0x52')]({'where':{'id':_0x5b3262[_0xc688('0x82')]}});}})['then'](handleEntityNotFound(_0x12ca85,null))[_0xc688('0x32')](function(_0xf897f0){if(_0xf897f0){logger[_0xc688('0x21')](_0xc688('0x83'),_0xc688('0x29'),_0xc688('0x84'),_0xf897f0[_0xc688('0x37')],util[_0xc688('0x85')](_0xa438a5[_0xc688('0x51')],{'showHidden':![],'depth':null}));switch(_0xf897f0[_0xc688('0x37')]){case _0xc688('0x86'):if(_0xa438a5['body'][_0xc688('0x87')]&&_0xa438a5[_0xc688('0x51')][_0xc688('0x87')]===_0x1483d4[_0xc688('0x88')]&&_0xa438a5[_0xc688('0x51')]['MessageStatus']&&_0xa438a5[_0xc688('0x51')][_0xc688('0x89')]===_0xc688('0x8a')){return _0x1483d4['update']({'read':!![]});}else{logger['error'](_0xc688('0x8b'),'status',_0xc688('0x86'),util['inspect'](_0xa438a5[_0xc688('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x1483d4;}})[_0xc688('0x32')](respondWithResult(_0x12ca85,null))[_0xc688('0x27')](handleError(_0x12ca85,null));}; \ No newline at end of file +var _0x08ba=['params','WhatsappMessage','includeAll','find','create','body','describe','whatsapp-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','get','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','whatsapp','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','channel','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show'];(function(_0x53064a,_0x397d7c){var _0x38ec6a=function(_0x54d468){while(--_0x54d468){_0x53064a['push'](_0x53064a['shift']());}};_0x38ec6a(++_0x397d7c);}(_0x08ba,0xcc));var _0xa08b=function(_0x3b562e,_0x3c47de){_0x3b562e=_0x3b562e-0x0;var _0x43664d=_0x08ba[_0x3b562e];return _0x43664d;};'use strict';var emlformat=require(_0xa08b('0x0'));var rimraf=require(_0xa08b('0x1'));var zipdir=require(_0xa08b('0x2'));var jsonpatch=require(_0xa08b('0x3'));var rp=require(_0xa08b('0x4'));var moment=require(_0xa08b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa08b('0x6'));var util=require(_0xa08b('0x7'));var path=require(_0xa08b('0x8'));var sox=require('sox');var csv=require(_0xa08b('0x9'));var ejs=require(_0xa08b('0xa'));var fs=require('fs');var fs_extra=require(_0xa08b('0xb'));var _=require(_0xa08b('0xc'));var squel=require(_0xa08b('0xd'));var crypto=require('crypto');var jsforce=require(_0xa08b('0xe'));var deskjs=require(_0xa08b('0xf'));var toCsv=require(_0xa08b('0x9'));var querystring=require('querystring');var Papa=require(_0xa08b('0x10'));var Redis=require(_0xa08b('0x11'));var authService=require(_0xa08b('0x12'));var qs=require(_0xa08b('0x13'));var as=require(_0xa08b('0x14'));var hardwareService=require(_0xa08b('0x15'));var logger=require(_0xa08b('0x16'))(_0xa08b('0x17'));var utils=require(_0xa08b('0x18'));var config=require(_0xa08b('0x19'));var licenseUtil=require(_0xa08b('0x1a'));var db=require(_0xa08b('0x1b'))['db'];config[_0xa08b('0x1c')]=_[_0xa08b('0x1d')](config[_0xa08b('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xa08b('0x1e'))(new Redis(config[_0xa08b('0x1c')]));require(_0xa08b('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa08b('0x20')][_0xa08b('0x21')]({'port':0x232c});var client9002=jayson[_0xa08b('0x20')][_0xa08b('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x55bf56,_0x488190,_0x1661fa,_0x151e95){return new BPromise(function(_0xa3eafb,_0x7fed56){var _0x1370b3=_0x151e95||client;return _0x1370b3[_0xa08b('0x22')](_0x55bf56,_0x1661fa)[_0xa08b('0x23')](function(_0x55582f){logger[_0xa08b('0x24')](_0xa08b('0x25'),_0x488190,_0xa08b('0x26'));logger['debug'](_0xa08b('0x27'),_0x488190,_0xa08b('0x26'),JSON['stringify'](_0x55582f));if(_0x55582f[_0xa08b('0x28')]){if(_0x55582f[_0xa08b('0x28')]['code']===0x1f4){logger[_0xa08b('0x28')](_0xa08b('0x25'),_0x488190,_0x55582f['error'][_0xa08b('0x29')]);return _0x7fed56(_0x55582f[_0xa08b('0x28')][_0xa08b('0x29')]);}logger[_0xa08b('0x28')](_0xa08b('0x25'),_0x488190,_0x55582f[_0xa08b('0x28')][_0xa08b('0x29')]);return _0xa3eafb(_0x55582f['error']['message']);}else{logger[_0xa08b('0x24')](_0xa08b('0x25'),_0x488190,_0xa08b('0x26'));_0xa3eafb(_0x55582f[_0xa08b('0x2a')][_0xa08b('0x29')]);}})['catch'](function(_0x321fc2){logger[_0xa08b('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x488190,_0x321fc2);_0x7fed56(_0x321fc2);});});}function respondWithStatusCode(_0x29fd80,_0xcf4685){_0xcf4685=_0xcf4685||0xcc;return function(_0x34192c){if(_0x34192c){return _0x29fd80[_0xa08b('0x2b')](_0xcf4685);}return _0x29fd80[_0xa08b('0x2c')](_0xcf4685)[_0xa08b('0x2d')]();};}function respondWithResult(_0x4a7c7c,_0x57016d){_0x57016d=_0x57016d||0xc8;return function(_0x17e9af){if(_0x17e9af){return _0x4a7c7c[_0xa08b('0x2c')](_0x57016d)[_0xa08b('0x2e')](_0x17e9af);}};}function respondWithFilteredResult(_0x21814e,_0x3225b0){return function(_0x5286fd){if(_0x5286fd){var _0x1125f5=typeof _0x3225b0[_0xa08b('0x2f')]===_0xa08b('0x30')&&typeof _0x3225b0[_0xa08b('0x31')]==='undefined';var _0x4a0c07=_0x5286fd[_0xa08b('0x32')];var _0x2d78d6=_0x1125f5?0x0:_0x3225b0[_0xa08b('0x2f')];var _0x1d24cc=_0x1125f5?_0x5286fd[_0xa08b('0x32')]:_0x3225b0[_0xa08b('0x2f')]+_0x3225b0[_0xa08b('0x31')];var _0x788cdc;if(_0x1d24cc>=_0x4a0c07){_0x1d24cc=_0x4a0c07;_0x788cdc=0xc8;}else{_0x788cdc=0xce;}_0x21814e[_0xa08b('0x2c')](_0x788cdc);return _0x21814e[_0xa08b('0x33')](_0xa08b('0x34'),_0x2d78d6+'-'+_0x1d24cc+'/'+_0x4a0c07)['json'](_0x5286fd);}return null;};}function patchUpdates(_0xad8eca){return function(_0x2ab4a6){try{jsonpatch['apply'](_0x2ab4a6,_0xad8eca,!![]);}catch(_0x269bab){return BPromise[_0xa08b('0x35')](_0x269bab);}return _0x2ab4a6[_0xa08b('0x36')]();};}function saveUpdates(_0x16450f,_0x3ab572){return function(_0x441e1d){if(_0x441e1d){return _0x441e1d[_0xa08b('0x37')](_0x16450f)[_0xa08b('0x23')](function(_0x35210e){return _0x35210e;});}return null;};}function removeEntity(_0x4f619f,_0xd86514){return function(_0x45ebcd){if(_0x45ebcd){return _0x45ebcd[_0xa08b('0x38')]()[_0xa08b('0x23')](function(){_0x4f619f['status'](0xcc)[_0xa08b('0x2d')]();});}};}function handleEntityNotFound(_0x3bf8c4,_0x3fcfb2){return function(_0x34e524){if(!_0x34e524){_0x3bf8c4[_0xa08b('0x2b')](0x194);}return _0x34e524;};}function handleError(_0xa97ebf,_0x273c99){_0x273c99=_0x273c99||0x1f4;return function(_0x1ade5a){logger[_0xa08b('0x28')](_0x1ade5a[_0xa08b('0x39')]);if(_0x1ade5a['name']){delete _0x1ade5a[_0xa08b('0x3a')];}_0xa97ebf[_0xa08b('0x2c')](_0x273c99)[_0xa08b('0x3b')](_0x1ade5a);};}exports[_0xa08b('0x3c')]=function(_0x30cd83,_0x2ba9f7){var _0x5d3607={},_0x272430={},_0x260758={'count':0x0,'rows':[]};var _0x2ca9e8=_[_0xa08b('0x3d')](db['WhatsappMessage'][_0xa08b('0x3e')],function(_0x2c18f6){return{'name':_0x2c18f6[_0xa08b('0x3f')],'type':_0x2c18f6[_0xa08b('0x40')][_0xa08b('0x41')]};});_0x272430[_0xa08b('0x42')]=_[_0xa08b('0x3d')](_0x2ca9e8,'name');_0x272430['query']=_[_0xa08b('0x43')](_0x30cd83['query']);_0x272430[_0xa08b('0x44')]=_[_0xa08b('0x45')](_0x272430[_0xa08b('0x42')],_0x272430[_0xa08b('0x46')]);_0x5d3607[_0xa08b('0x47')]=_[_0xa08b('0x45')](_0x272430['model'],qs[_0xa08b('0x48')](_0x30cd83['query'][_0xa08b('0x48')]));_0x5d3607[_0xa08b('0x47')]=_0x5d3607[_0xa08b('0x47')][_0xa08b('0x49')]?_0x5d3607[_0xa08b('0x47')]:_0x272430[_0xa08b('0x42')];if(!_0x30cd83[_0xa08b('0x46')][_0xa08b('0x4a')](_0xa08b('0x4b'))){_0x5d3607[_0xa08b('0x31')]=qs[_0xa08b('0x31')](_0x30cd83[_0xa08b('0x46')][_0xa08b('0x31')]);_0x5d3607[_0xa08b('0x2f')]=qs['offset'](_0x30cd83[_0xa08b('0x46')][_0xa08b('0x2f')]);}_0x5d3607[_0xa08b('0x4c')]=qs['sort'](_0x30cd83[_0xa08b('0x46')][_0xa08b('0x4d')]);_0x5d3607['where']=qs[_0xa08b('0x44')](_[_0xa08b('0x4e')](_0x30cd83[_0xa08b('0x46')],_0x272430[_0xa08b('0x44')]),_0x2ca9e8);if(_0x30cd83['query'][_0xa08b('0x4f')]){_0x5d3607[_0xa08b('0x50')]=_[_0xa08b('0x51')](_0x5d3607[_0xa08b('0x50')],{'$or':_[_0xa08b('0x3d')](_0x2ca9e8,function(_0x46a184){if(_0x46a184[_0xa08b('0x40')]!==_0xa08b('0x52')){var _0x4dd039={};_0x4dd039[_0x46a184[_0xa08b('0x3a')]]={'$like':'%'+_0x30cd83[_0xa08b('0x46')][_0xa08b('0x4f')]+'%'};return _0x4dd039;}})});}_0x5d3607=_['merge']({},_0x5d3607,_0x30cd83[_0xa08b('0x53')]);var _0x399bba={'where':_0x5d3607[_0xa08b('0x50')]};return db['WhatsappMessage'][_0xa08b('0x32')](_0x399bba)[_0xa08b('0x23')](function(_0x292b2b){_0x260758['count']=_0x292b2b;if(_0x30cd83[_0xa08b('0x46')]['includeAll']){_0x5d3607[_0xa08b('0x54')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x5d3607);})['then'](function(_0x4dc63){_0x260758[_0xa08b('0x55')]=_0x4dc63;return _0x260758;})[_0xa08b('0x23')](respondWithFilteredResult(_0x2ba9f7,_0x5d3607))[_0xa08b('0x56')](handleError(_0x2ba9f7,null));};exports[_0xa08b('0x57')]=function(_0x1a1578,_0x7aa1c2){var _0xde7924={'raw':!![],'where':{'id':_0x1a1578[_0xa08b('0x58')]['id']}},_0x5c821b={};_0x5c821b[_0xa08b('0x42')]=_[_0xa08b('0x43')](db[_0xa08b('0x59')][_0xa08b('0x3e')]);_0x5c821b[_0xa08b('0x46')]=_[_0xa08b('0x43')](_0x1a1578[_0xa08b('0x46')]);_0x5c821b[_0xa08b('0x44')]=_[_0xa08b('0x45')](_0x5c821b[_0xa08b('0x42')],_0x5c821b[_0xa08b('0x46')]);_0xde7924[_0xa08b('0x47')]=_[_0xa08b('0x45')](_0x5c821b[_0xa08b('0x42')],qs[_0xa08b('0x48')](_0x1a1578[_0xa08b('0x46')][_0xa08b('0x48')]));_0xde7924['attributes']=_0xde7924['attributes'][_0xa08b('0x49')]?_0xde7924[_0xa08b('0x47')]:_0x5c821b['model'];if(_0x1a1578[_0xa08b('0x46')][_0xa08b('0x5a')]){_0xde7924['include']=[{'all':!![]}];}_0xde7924=_[_0xa08b('0x51')]({},_0xde7924,_0x1a1578[_0xa08b('0x53')]);return db[_0xa08b('0x59')][_0xa08b('0x5b')](_0xde7924)['then'](handleEntityNotFound(_0x7aa1c2,null))[_0xa08b('0x23')](respondWithResult(_0x7aa1c2,null))[_0xa08b('0x56')](handleError(_0x7aa1c2,null));};exports['create']=function(_0x36f8d1,_0x31cbbd){return db[_0xa08b('0x59')][_0xa08b('0x5c')](_0x36f8d1[_0xa08b('0x5d')],{})[_0xa08b('0x23')](respondWithResult(_0x31cbbd,0xc9))['catch'](handleError(_0x31cbbd,null));};exports[_0xa08b('0x37')]=function(_0x5156e4,_0x13b34c){if(_0x5156e4['body']['id']){delete _0x5156e4[_0xa08b('0x5d')]['id'];}return db['WhatsappMessage'][_0xa08b('0x5b')]({'where':{'id':_0x5156e4[_0xa08b('0x58')]['id']}})[_0xa08b('0x23')](handleEntityNotFound(_0x13b34c,null))[_0xa08b('0x23')](saveUpdates(_0x5156e4[_0xa08b('0x5d')],null))[_0xa08b('0x23')](respondWithResult(_0x13b34c,null))[_0xa08b('0x56')](handleError(_0x13b34c,null));};exports[_0xa08b('0x38')]=function(_0x4f99e8,_0x148c85){return db[_0xa08b('0x59')][_0xa08b('0x5b')]({'where':{'id':_0x4f99e8[_0xa08b('0x58')]['id']}})[_0xa08b('0x23')](handleEntityNotFound(_0x148c85,null))[_0xa08b('0x23')](removeEntity(_0x148c85,null))[_0xa08b('0x56')](handleError(_0x148c85,null));};exports['describe']=function(_0x49458e,_0x1886b8){return db[_0xa08b('0x59')][_0xa08b('0x5e')]()[_0xa08b('0x23')](respondWithResult(_0x1886b8,null))['catch'](handleError(_0x1886b8,null));};var interaction_log=require(_0xa08b('0x16'))(_0xa08b('0x5f'));exports[_0xa08b('0x60')]=function(_0x3b6984,_0x24f819,_0x5d87ef){var _0x440c24={'agent':{},'channel':'whatsapp'};if(_0x3b6984[_0xa08b('0x5d')]['id']){delete _0x3b6984[_0xa08b('0x5d')]['id'];}_0x3b6984['body']['read']=!![];_0x3b6984[_0xa08b('0x5d')][_0xa08b('0x61')]=moment()[_0xa08b('0x62')](_0xa08b('0x63'));_0x3b6984[_0xa08b('0x5d')][_0xa08b('0x64')]=_0x3b6984['body'][_0xa08b('0x64')]||_0x3b6984[_0xa08b('0x65')]['id'];_0x440c24[_0xa08b('0x66')]['id']=_0x3b6984['body'][_0xa08b('0x64')];return db['WhatsappMessage']['find']({'where':{'id':_0x3b6984[_0xa08b('0x58')]['id'],'UserId':null}})[_0xa08b('0x23')](handleEntityNotFound(_0x24f819,null))[_0xa08b('0x23')](saveUpdates(_0x3b6984['body'],null))[_0xa08b('0x23')](function(_0x40c923){if(_0x40c923){_0x440c24[_0xa08b('0x29')]=_0x40c923['get']({'plain':!![]});return db[_0xa08b('0x67')][_0xa08b('0x5b')]({'where':{'id':_0x40c923[_0xa08b('0x68')]}});}return null;})[_0xa08b('0x23')](handleEntityNotFound(_0x24f819,null))[_0xa08b('0x23')](function(_0x5dfcf9){if(_0x5dfcf9){return _0x5dfcf9[_0xa08b('0x37')]({'UserId':_0x3b6984[_0xa08b('0x5d')][_0xa08b('0x64')],'read1stAt':_[_0xa08b('0x69')](_0x5dfcf9[_0xa08b('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa08b('0x23')](function(_0x3a0fa9){if(_0x3a0fa9){_0x440c24['interaction']=_0x3a0fa9[_0xa08b('0x6b')]({'plain':!![]});interaction_log[_0xa08b('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b6984['user']['id'],_0x3b6984['user'][_0xa08b('0x3a')],_0x3b6984[_0xa08b('0x65')][_0xa08b('0x6c')],_0x440c24['interaction']['id'],_0x3b6984[_0xa08b('0x5d')]?JSON[_0xa08b('0x6d')](_0x3b6984[_0xa08b('0x5d')]):_0xa08b('0x6e'));return respondWithRpcPromise(_0xa08b('0x6f'),_0xa08b('0x70'),_0x440c24);}return null;})[_0xa08b('0x23')](function(_0x475648){var _0x19cb93=_0xa08b('0x71')+_0x475648[_0xa08b('0x29')][_0xa08b('0x72')];return db[_0xa08b('0x73')][_0xa08b('0x46')](_0x19cb93,{'type':db[_0xa08b('0x74')][_0xa08b('0x75')][_0xa08b('0x76')],'raw':!![]})['then'](function(_0x231d82){return _0x231d82;});})[_0xa08b('0x23')](function(_0x12bb07){if(_0x12bb07){_0x440c24[_0xa08b('0x29')]['contact']=_0x12bb07[0x0];if(!_0x3b6984[_0xa08b('0x5d')]['UserId'])return;return db[_0xa08b('0x77')][_0xa08b('0x5b')]({'where':{'id':_0x3b6984[_0xa08b('0x5d')]['UserId'],'role':_0xa08b('0x66')},'attributes':['id',_0xa08b('0x3a'),_0xa08b('0x78'),_0xa08b('0x79'),_0xa08b('0x7a')],'raw':!![]});}return null;})['then'](function(_0x2a487e){if(!_0x2a487e)return null;_0x440c24[_0xa08b('0x29')][_0xa08b('0x66')]=_0x2a487e;return _0x440c24;})[_0xa08b('0x23')](function(_0x3e64c7){if(_0x3e64c7){if(_0x3b6984[_0xa08b('0x5d')][_0xa08b('0x7b')]){_0x440c24[_0xa08b('0x29')][_0xa08b('0x7c')]=util['format'](_0xa08b('0x7d'),_0x3b6984['user'][_0xa08b('0x3a')]);_0x440c24[_0xa08b('0x29')]['channel']=_0x440c24['channel'];_0x440c24[_0xa08b('0x29')][_0xa08b('0x7e')]=_0x440c24['channel'];_0x440c24['message'][_0xa08b('0x7f')]=_0xa08b('0x60');return respondWithRpcPromise(_0xa08b('0x80'),_0xa08b('0x80'),{'event':'acceptmessage','message':_0x440c24[_0xa08b('0x29')]},client9002)[_0xa08b('0x23')](function(){return _0x440c24;});}return _0x440c24;}return null;})[_0xa08b('0x23')](respondWithResult(_0x24f819,null))[_0xa08b('0x56')](handleError(_0x24f819,null));};var interaction_log=require(_0xa08b('0x16'))(_0xa08b('0x5f'));exports[_0xa08b('0x35')]=function(_0x4cb887,_0x1f1845,_0x191818){var _0x2e5fd5={'agent':{},'channel':_0xa08b('0x81')};if(_0x4cb887[_0xa08b('0x5d')]['id']){delete _0x4cb887[_0xa08b('0x5d')]['id'];}_0x4cb887[_0xa08b('0x5d')][_0xa08b('0x64')]=_0x4cb887[_0xa08b('0x5d')][_0xa08b('0x64')]||_0x4cb887[_0xa08b('0x65')]['id'];_0x2e5fd5[_0xa08b('0x66')]['id']=_0x4cb887[_0xa08b('0x5d')][_0xa08b('0x64')];return db['WhatsappMessage'][_0xa08b('0x5b')]({'where':{'id':_0x4cb887[_0xa08b('0x58')]['id'],'UserId':null}})[_0xa08b('0x23')](handleEntityNotFound(_0x1f1845,null))['then'](function(_0x146594){if(_0x146594){_0x2e5fd5[_0xa08b('0x29')]=_0x146594[_0xa08b('0x6b')]({'plain':!![]});return db[_0xa08b('0x67')]['find']({'where':{'id':_0x146594[_0xa08b('0x68')]}});}return null;})[_0xa08b('0x23')](handleEntityNotFound(_0x1f1845,null))[_0xa08b('0x23')](function(_0x35db61){if(_0x35db61){_0x2e5fd5[_0xa08b('0x82')]=_0x35db61[_0xa08b('0x6b')]({'plain':!![]});interaction_log[_0xa08b('0x24')](_0xa08b('0x83'),_0x4cb887[_0xa08b('0x65')]['id'],_0x4cb887['user'][_0xa08b('0x3a')],_0x4cb887[_0xa08b('0x65')][_0xa08b('0x6c')],_0x2e5fd5['interaction']['id'],_0x4cb887['body']?JSON[_0xa08b('0x6d')](_0x4cb887['body']):_0xa08b('0x6e'));return respondWithRpcPromise(_0xa08b('0x84'),_0xa08b('0x85'),_0x2e5fd5);}return null;})[_0xa08b('0x23')](function(_0x129dae){var _0x57f7aa=_0xa08b('0x71')+_0x129dae[_0xa08b('0x29')][_0xa08b('0x72')];return db[_0xa08b('0x73')]['query'](_0x57f7aa,{'type':db[_0xa08b('0x74')][_0xa08b('0x75')]['SELECT'],'raw':!![]})[_0xa08b('0x23')](function(_0x2fe2e0){return _0x2fe2e0;});})[_0xa08b('0x23')](function(_0x2afc6f){if(_0x2afc6f){_0x2e5fd5[_0xa08b('0x29')][_0xa08b('0x86')]=_0x2afc6f[0x0];if(!_0x4cb887[_0xa08b('0x5d')][_0xa08b('0x64')])return;return db[_0xa08b('0x77')]['find']({'where':{'id':_0x4cb887[_0xa08b('0x5d')][_0xa08b('0x64')],'role':_0xa08b('0x66')},'attributes':['id','name',_0xa08b('0x78'),_0xa08b('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x21f030){if(!_0x21f030)return null;_0x2e5fd5[_0xa08b('0x29')][_0xa08b('0x66')]=_0x21f030;return _0x2e5fd5;})[_0xa08b('0x23')](function(_0x5e9fca){if(_0x5e9fca){_0x5e9fca[_0xa08b('0x29')][_0xa08b('0x7c')]=util['format'](_0xa08b('0x7d'),_0x4cb887[_0xa08b('0x65')][_0xa08b('0x3a')]);_0x5e9fca['message'][_0xa08b('0x87')]=_0x2e5fd5['channel'];_0x5e9fca[_0xa08b('0x29')][_0xa08b('0x7e')]=_0x2e5fd5[_0xa08b('0x87')];_0x5e9fca[_0xa08b('0x29')][_0xa08b('0x7f')]=_0xa08b('0x35');respondWithRpcPromise(_0xa08b('0x80'),_0xa08b('0x80'),{'event':_0xa08b('0x88'),'message':_0x5e9fca[_0xa08b('0x29')]},client9002);return _0x2e5fd5;}return null;})['then'](respondWithResult(_0x1f1845,null))[_0xa08b('0x56')](handleError(_0x1f1845,null));};exports[_0xa08b('0x2c')]=function(_0x1b00ef,_0x35e78e,_0x133e66){if(_0x1b00ef[_0xa08b('0x5d')]['id']){delete _0x1b00ef[_0xa08b('0x5d')]['id'];}var _0x15030c;return db[_0xa08b('0x59')][_0xa08b('0x5b')]({'where':{'id':_0x1b00ef[_0xa08b('0x58')]['id']}})[_0xa08b('0x23')](handleEntityNotFound(_0x35e78e,null))[_0xa08b('0x23')](function(_0x2ec1ef){if(_0x2ec1ef){_0x15030c=_0x2ec1ef;return db['WhatsappAccount']['find']({'where':{'id':_0x2ec1ef[_0xa08b('0x89')]}});}})[_0xa08b('0x23')](handleEntityNotFound(_0x35e78e,null))['then'](function(_0x17c4d7){if(_0x17c4d7){logger[_0xa08b('0x8a')](_0xa08b('0x8b'),_0xa08b('0x2c'),_0xa08b('0x8c'),_0x17c4d7[_0xa08b('0x40')],util[_0xa08b('0x8d')](_0x1b00ef[_0xa08b('0x5d')],{'showHidden':![],'depth':null}));switch(_0x17c4d7[_0xa08b('0x40')]){case _0xa08b('0x8e'):if(_0x1b00ef[_0xa08b('0x5d')][_0xa08b('0x8f')]&&_0x1b00ef[_0xa08b('0x5d')][_0xa08b('0x8f')]===_0x15030c['messageId']&&_0x1b00ef['body'][_0xa08b('0x90')]&&_0x1b00ef['body'][_0xa08b('0x90')]===_0xa08b('0x91')){return _0x15030c[_0xa08b('0x37')]({'read':!![]});}else{logger[_0xa08b('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xa08b('0x8e'),util[_0xa08b('0x8d')](_0x1b00ef['body'],{'showHidden':![],'depth':null}));}break;}return _0x15030c;}})[_0xa08b('0x23')](respondWithResult(_0x35e78e,null))[_0xa08b('0x56')](handleError(_0x35e78e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d74300e..5f51099 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 _0x9e6b=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x58cd6f,_0x5a8fda){var _0x4133e8=function(_0x116c2f){while(--_0x116c2f){_0x58cd6f['push'](_0x58cd6f['shift']());}};_0x4133e8(++_0x5a8fda);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9e6b[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0xb9e6('0x0'));var WhatsappMessage=require(_0xb9e6('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb9e6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb9e6('0x3')};function emitEvent(_0x6fcb00){return function(_0xb74c07,_0x214661,_0x47fc84){WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00+':'+_0xb74c07['id'],_0xb74c07);WhatsappMessageEvents[_0xb9e6('0x4')](_0x6fcb00,_0xb74c07);_0x47fc84(null);};}for(var e in events){if(events[_0xb9e6('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9e6('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7d98=['events','WhatsappMessage','setMaxListeners','save','update','hook','exports'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x7d98,0xe7));var _0x87d9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x7d98[_0x3861f7];return _0x50879f;};'use strict';var EventEmitter=require(_0x87d9('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x87d9('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x87d9('0x2')](0x0);var events={'afterCreate':_0x87d9('0x3'),'afterUpdate':_0x87d9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x417ed2){return function(_0x317ba8,_0x4b4f58,_0x127fa8){WhatsappMessageEvents['emit'](_0x417ed2+':'+_0x317ba8['id'],_0x317ba8);WhatsappMessageEvents['emit'](_0x417ed2,_0x317ba8);_0x127fa8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x87d9('0x5')](e,emitEvent(event));}}module[_0x87d9('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index fdcbd22..f8baa1c 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 _0x4cb4=['phone','remote','/api/whatsapp/messages/','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/messages/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','then','update','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','create'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4cb4,0xb2));var _0x44cb=function(_0x542f45,_0x37468a){_0x542f45=_0x542f45-0x0;var _0x38c609=_0x4cb4[_0x542f45];return _0x38c609;};'use strict';var _=require('lodash');var util=require(_0x44cb('0x0'));var logger=require(_0x44cb('0x1'))(_0x44cb('0x2'));var moment=require(_0x44cb('0x3'));var BPromise=require(_0x44cb('0x4'));var rp=require(_0x44cb('0x5'));var fetch=require(_0x44cb('0x6'));var fs=require('fs');var path=require(_0x44cb('0x7'));var rimraf=require(_0x44cb('0x8'));var config=require(_0x44cb('0x9'));var attributes=require(_0x44cb('0xa'));module['exports']=function(_0x375929,_0x367f1e){return _0x375929['define'](_0x44cb('0xb'),attributes,{'tableName':_0x44cb('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x44cb('0xd'),'fields':[_0x44cb('0xe')],'type':_0x44cb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c90a5,_0x4f719d,_0x6dcb31){var _0x100aac=_0x375929['models'];var _0x2af95f=_0x3c90a5[_0x44cb('0x10')]({'plain':!![]});if(_0x2af95f[_0x44cb('0x11')][_0x44cb('0x12')]()==='in'||_0x2af95f[_0x44cb('0x11')][_0x44cb('0x12')]()===_0x44cb('0x13')&&!_0x2af95f[_0x44cb('0x14')]&&!_[_0x44cb('0x15')](_0x2af95f['UserId'])){_0x100aac['WhatsappInteraction'][_0x44cb('0x16')]({'where':{'id':_0x2af95f['WhatsappInteractionId']}})[_0x44cb('0x17')](function(_0x4b6dc7){if(_0x4b6dc7){_0x4b6dc7[_0x44cb('0x18')]({'lastMsgAt':_0x2af95f['createdAt'],'lastMsgDirection':_0x2af95f['direction']['toLowerCase']()});}})['catch'](function(_0x21fa5f){console[_0x44cb('0x19')](_0x21fa5f);});}if(_0x2af95f['direction']===_0x44cb('0x13')&&!_0x2af95f[_0x44cb('0x14')]){var _0x10ba2a;_0x100aac[_0x44cb('0x1a')][_0x44cb('0x1b')]({'where':{'id':_0x2af95f[_0x44cb('0x1c')]},'raw':!![]})[_0x44cb('0x17')](function(_0x449b68){_0x10ba2a=_0x449b68;if(_0x10ba2a&&_0x10ba2a['type']){switch(_0x10ba2a[_0x44cb('0x1d')]){case _0x44cb('0x1e'):var _0x40c686=require(_0x44cb('0x1e'));if(_0x10ba2a[_0x44cb('0x1f')]&&_0x10ba2a[_0x44cb('0x20')]&&_0x10ba2a['phone']){var _0x124309=new _0x40c686(_0x10ba2a[_0x44cb('0x1f')],_0x10ba2a[_0x44cb('0x20')]);_0x124309['messages'][_0x44cb('0x21')]({'body':_0x2af95f[_0x44cb('0xe')],'to':'whatsapp:'+_0x2af95f[_0x44cb('0x22')],'from':'whatsapp:'+_0x10ba2a[_0x44cb('0x22')],'statusCallback':_0x10ba2a[_0x44cb('0x23')]+_0x44cb('0x24')+_0x2af95f['id']+'/status?token='+_0x10ba2a['token']})['then'](function(_0x1fe367){if(_0x1fe367['sid']){return _0x3c90a5['update']({'messageId':_0x1fe367[_0x44cb('0x25')]});}})[_0x44cb('0x26')](function(_0x32e9f9){logger[_0x44cb('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x44cb('0x1e'),util['inspect'](_0x32e9f9,{'showHidden':![],'depth':null}));});}else{logger[_0x44cb('0x19')](_0x44cb('0x27'),_0x44cb('0x28'),_0x44cb('0x1e'),_0x44cb('0x29'));}break;case _0x44cb('0x2a'):var _0x395b25=_0x10ba2a[_0x44cb('0x1f')];var _0x311095=_0x10ba2a[_0x44cb('0x20')];var _0x11c506=_0x10ba2a['baseUrl']+'/whatsapp/v1/'+_0x395b25+_0x44cb('0x2b');var _0xbc9cb3={'to':[_0x2af95f[_0x44cb('0x22')]],'message':{'type':_0x44cb('0x2c'),'text':_0x2af95f[_0x44cb('0xe')]}};var _0x4c4878={'method':_0x44cb('0x2d'),'uri':_0x11c506,'headers':{'Authorization':_0x44cb('0x2e')+_0x311095,'Content-Type':'application/json'},'body':_0xbc9cb3,'json':!![]};rp(_0x4c4878)['then'](function(_0x90d812){if(_0x90d812[_0x44cb('0x2f')][0x0][_0x44cb('0x30')]){return _0x3c90a5[_0x44cb('0x18')]({'messageId':_0x90d812[_0x44cb('0x2f')][0x0]['message_id']});}})[_0x44cb('0x26')](function(_0x1ac33f){logger[_0x44cb('0x31')](_0x44cb('0x32'),_0x1ac33f);});break;}}})[_0x44cb('0x33')](function(){_0x6dcb31();});}else{_0x6dcb31();}}},'charset':'utf8mb4','collate':_0x44cb('0x34')});}; \ No newline at end of file +var _0xcfd8=['afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','update','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','exports','define','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x41bbaa,_0x532d97){var _0x2f639f=function(_0xa577a3){while(--_0xa577a3){_0x41bbaa['push'](_0x41bbaa['shift']());}};_0x2f639f(++_0x532d97);}(_0xcfd8,0x103));var _0x8cfd=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0xcfd8[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0x8cfd('0x0'));var logger=require(_0x8cfd('0x1'))(_0x8cfd('0x2'));var moment=require(_0x8cfd('0x3'));var BPromise=require(_0x8cfd('0x4'));var rp=require(_0x8cfd('0x5'));var fetch=require(_0x8cfd('0x6'));var fs=require('fs');var path=require(_0x8cfd('0x7'));var rimraf=require(_0x8cfd('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x8cfd('0x9')]=function(_0x3c5927,_0x5a08a1){return _0x3c5927[_0x8cfd('0xa')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8cfd('0xb'),'fields':['messageId']},{'name':_0x8cfd('0xc'),'fields':[_0x8cfd('0xd')],'type':_0x8cfd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56c747,_0x4fb14a,_0x358fc8){var _0x4091c5=_0x3c5927['models'];var _0x33bbd4=_0x56c747[_0x8cfd('0xf')]({'plain':!![]});if(_0x33bbd4[_0x8cfd('0x10')][_0x8cfd('0x11')]()==='in'||_0x33bbd4['direction'][_0x8cfd('0x11')]()===_0x8cfd('0x12')&&!_0x33bbd4[_0x8cfd('0x13')]&&!_[_0x8cfd('0x14')](_0x33bbd4[_0x8cfd('0x15')])){_0x4091c5[_0x8cfd('0x16')][_0x8cfd('0x17')]({'where':{'id':_0x33bbd4[_0x8cfd('0x18')]}})['then'](function(_0x16311a){if(_0x16311a){_0x16311a['update']({'lastMsgAt':_0x33bbd4[_0x8cfd('0x19')],'lastMsgDirection':_0x33bbd4['direction']['toLowerCase']()});}})['catch'](function(_0x125d0c){console[_0x8cfd('0x1a')](_0x125d0c);});}if(_0x33bbd4[_0x8cfd('0x10')]===_0x8cfd('0x12')&&!_0x33bbd4[_0x8cfd('0x13')]){var _0x1d8671;_0x4091c5[_0x8cfd('0x1b')][_0x8cfd('0x1c')]({'where':{'id':_0x33bbd4[_0x8cfd('0x1d')]},'raw':!![]})[_0x8cfd('0x1e')](function(_0x4a1043){_0x1d8671=_0x4a1043;if(_0x1d8671&&_0x1d8671['type']){switch(_0x1d8671[_0x8cfd('0x1f')]){case _0x8cfd('0x20'):var _0x3edb5b=require(_0x8cfd('0x20'));if(_0x1d8671[_0x8cfd('0x21')]&&_0x1d8671[_0x8cfd('0x22')]&&_0x1d8671[_0x8cfd('0x23')]){var _0x8580f9=new _0x3edb5b(_0x1d8671[_0x8cfd('0x21')],_0x1d8671[_0x8cfd('0x22')]);_0x8580f9[_0x8cfd('0x24')][_0x8cfd('0x25')]({'body':_0x33bbd4[_0x8cfd('0xd')],'to':_0x8cfd('0x26')+_0x33bbd4['phone'],'from':_0x8cfd('0x26')+_0x1d8671[_0x8cfd('0x23')],'statusCallback':_0x1d8671[_0x8cfd('0x27')]+_0x8cfd('0x28')+_0x33bbd4['id']+'/status?token='+_0x1d8671[_0x8cfd('0x29')]})['then'](function(_0x204d4a){if(_0x204d4a[_0x8cfd('0x2a')]){return _0x56c747['update']({'messageId':_0x204d4a[_0x8cfd('0x2a')]});}})[_0x8cfd('0x2b')](function(_0x47bcd6){logger[_0x8cfd('0x1a')](_0x8cfd('0x2c'),'afterCreate',_0x8cfd('0x20'),util[_0x8cfd('0x2d')](_0x47bcd6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8cfd('0x2c'),_0x8cfd('0x2e'),_0x8cfd('0x20'),_0x8cfd('0x2f'));}break;case _0x8cfd('0x30'):var _0x338c0c=_0x1d8671[_0x8cfd('0x21')];var _0x513d39=_0x1d8671['authToken'];var _0x360536=_0x1d8671['baseUrl']+_0x8cfd('0x31')+_0x338c0c+_0x8cfd('0x32');var _0x4ced5d={'to':[_0x33bbd4[_0x8cfd('0x23')]],'message':{'type':_0x8cfd('0x33'),'text':_0x33bbd4[_0x8cfd('0xd')]}};var _0x2f1c10={'method':_0x8cfd('0x34'),'uri':_0x360536,'headers':{'Authorization':_0x8cfd('0x35')+_0x513d39,'Content-Type':_0x8cfd('0x36')},'body':_0x4ced5d,'json':!![]};rp(_0x2f1c10)[_0x8cfd('0x1e')](function(_0x1ef67e){if(_0x1ef67e['statuses'][0x0][_0x8cfd('0x37')]){return _0x56c747[_0x8cfd('0x38')]({'messageId':_0x1ef67e['statuses'][0x0][_0x8cfd('0x37')]});}})['catch'](function(_0x144219){logger['err'](_0x8cfd('0x39'),_0x144219);});break;}}})[_0x8cfd('0x3a')](function(){_0x358fc8();});}else{_0x358fc8();}}},'charset':_0x8cfd('0x3b'),'collate':_0x8cfd('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 4304a87..c001391 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 _0x29d7=['socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x21379b,_0x592b48){var _0x223a93=function(_0x402097){while(--_0x402097){_0x21379b['push'](_0x21379b['shift']());}};_0x223a93(++_0x592b48);}(_0x29d7,0x186));var _0x729d=function(_0x586eee,_0xcc477e){_0x586eee=_0x586eee-0x0;var _0xe88f21=_0x29d7[_0x586eee];return _0xe88f21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x729d('0x0'));var BPromise=require(_0x729d('0x1'));var rs=require(_0x729d('0x2'));var fs=require('fs');var Redis=require(_0x729d('0x3'));var db=require(_0x729d('0x4'))['db'];var utils=require(_0x729d('0x5'));var logger=require(_0x729d('0x6'))('rpc');var config=require(_0x729d('0x7'));var jayson=require(_0x729d('0x8'));var client=jayson['client'][_0x729d('0x9')]({'port':0x232a});config[_0x729d('0xa')]=_[_0x729d('0xb')](config['redis'],{'host':_0x729d('0xc'),'port':0x18eb});var socket=require(_0x729d('0xd'))(new Redis(config[_0x729d('0xa')]));require(_0x729d('0xe'))['register'](socket);function respondWithRpcPromise(_0x2481c1,_0x570dd5,_0x60f56d){return new BPromise(function(_0x1353a8,_0x5442f4){return client[_0x729d('0xf')](_0x2481c1,_0x60f56d)[_0x729d('0x10')](function(_0x3d02ae){logger[_0x729d('0x11')](_0x729d('0x12'),_0x570dd5,_0x729d('0x13'));logger[_0x729d('0x14')](_0x729d('0x15'),_0x570dd5,'request\x20sent',JSON['stringify'](_0x3d02ae));if(_0x3d02ae['error']){if(_0x3d02ae[_0x729d('0x16')][_0x729d('0x17')]===0x1f4){logger[_0x729d('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x570dd5,_0x3d02ae[_0x729d('0x16')][_0x729d('0x18')]);return _0x5442f4(_0x3d02ae[_0x729d('0x16')][_0x729d('0x18')]);}logger[_0x729d('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x570dd5,_0x3d02ae[_0x729d('0x16')][_0x729d('0x18')]);return _0x1353a8(_0x3d02ae[_0x729d('0x16')][_0x729d('0x18')]);}else{logger['info'](_0x729d('0x12'),_0x570dd5,_0x729d('0x13'));_0x1353a8(_0x3d02ae[_0x729d('0x19')][_0x729d('0x18')]);}})[_0x729d('0x1a')](function(_0x572f63){logger['error'](_0x729d('0x12'),_0x570dd5,_0x572f63);_0x5442f4(_0x572f63);});});}exports[_0x729d('0x1b')]=function(_0x3a0df6){var _0x694f84=this;return new Promise(function(_0x5af25e,_0x3119d3){return db[_0x729d('0x1c')]['create'](_0x3a0df6['body'],{'raw':_0x3a0df6[_0x729d('0x1d')]?_0x3a0df6[_0x729d('0x1d')][_0x729d('0x1e')]===undefined?!![]:![]:!![]})[_0x729d('0x10')](function(_0x1a60a1){logger[_0x729d('0x11')](_0x729d('0x1b'),_0x3a0df6);logger[_0x729d('0x14')](_0x729d('0x1b'),_0x3a0df6,JSON['stringify'](_0x1a60a1));_0x5af25e(_0x1a60a1);})[_0x729d('0x1a')](function(_0x1c3848){logger[_0x729d('0x16')](_0x729d('0x1b'),_0x1c3848[_0x729d('0x18')],_0x3a0df6);_0x3119d3(_0x694f84[_0x729d('0x16')](0x1f4,_0x1c3848[_0x729d('0x18')]));});});}; \ No newline at end of file +var _0x429e=['client','http','defaults','redis','socket.io-emitter','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x146260,_0x3c8013){var _0x2845e7=function(_0x2b7d61){while(--_0x2b7d61){_0x146260['push'](_0x146260['shift']());}};_0x2845e7(++_0x3c8013);}(_0x429e,0xef));var _0xe429=function(_0x291956,_0x1af1da){_0x291956=_0x291956-0x0;var _0x2db52c=_0x429e[_0x291956];return _0x2db52c;};'use strict';var _=require('lodash');var util=require(_0xe429('0x0'));var moment=require(_0xe429('0x1'));var BPromise=require('bluebird');var rs=require(_0xe429('0x2'));var fs=require('fs');var Redis=require(_0xe429('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe429('0x4'));var logger=require(_0xe429('0x5'))(_0xe429('0x6'));var config=require(_0xe429('0x7'));var jayson=require(_0xe429('0x8'));var client=jayson[_0xe429('0x9')][_0xe429('0xa')]({'port':0x232a});config['redis']=_[_0xe429('0xb')](config[_0xe429('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe429('0xd'))(new Redis(config[_0xe429('0xc')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x6dfc10,_0x456745,_0xac9513){return new BPromise(function(_0x20f4be,_0x465dfe){return client[_0xe429('0xe')](_0x6dfc10,_0xac9513)[_0xe429('0xf')](function(_0x3bd935){logger['info'](_0xe429('0x10'),_0x456745,_0xe429('0x11'));logger[_0xe429('0x12')](_0xe429('0x13'),_0x456745,_0xe429('0x11'),JSON[_0xe429('0x14')](_0x3bd935));if(_0x3bd935[_0xe429('0x15')]){if(_0x3bd935[_0xe429('0x15')]['code']===0x1f4){logger[_0xe429('0x15')](_0xe429('0x10'),_0x456745,_0x3bd935[_0xe429('0x15')][_0xe429('0x16')]);return _0x465dfe(_0x3bd935['error'][_0xe429('0x16')]);}logger['error'](_0xe429('0x10'),_0x456745,_0x3bd935[_0xe429('0x15')]['message']);return _0x20f4be(_0x3bd935[_0xe429('0x15')][_0xe429('0x16')]);}else{logger[_0xe429('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x456745,_0xe429('0x11'));_0x20f4be(_0x3bd935[_0xe429('0x18')][_0xe429('0x16')]);}})[_0xe429('0x19')](function(_0x245313){logger[_0xe429('0x15')](_0xe429('0x10'),_0x456745,_0x245313);_0x465dfe(_0x245313);});});}exports[_0xe429('0x1a')]=function(_0x98e012){var _0x3b0a4a=this;return new Promise(function(_0x5780db,_0x562601){return db[_0xe429('0x1b')][_0xe429('0x1c')](_0x98e012[_0xe429('0x1d')],{'raw':_0x98e012[_0xe429('0x1e')]?_0x98e012[_0xe429('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe429('0xf')](function(_0x343c08){logger[_0xe429('0x17')]('CreateWhatsappMessage',_0x98e012);logger['debug']('CreateWhatsappMessage',_0x98e012,JSON['stringify'](_0x343c08));_0x5780db(_0x343c08);})[_0xe429('0x19')](function(_0x3d7cff){logger[_0xe429('0x15')](_0xe429('0x1a'),_0x3d7cff[_0xe429('0x16')],_0x98e012);_0x562601(_0x3b0a4a['error'](0x1f4,_0x3d7cff[_0xe429('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 0bfc21f..5d745b4 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 _0x4ae4=['update','emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ae4,0x1a5));var _0x44ae=function(_0x2c55d1,_0x558f3d){_0x2c55d1=_0x2c55d1-0x0;var _0x5de2dd=_0x4ae4[_0x2c55d1];return _0x5de2dd;};'use strict';var WhatsappMessageEvents=require(_0x44ae('0x0'));var events=[_0x44ae('0x1'),_0x44ae('0x2'),_0x44ae('0x3')];function createListener(_0xd8eef,_0x21032c){return function(_0x1e5800){_0x21032c[_0x44ae('0x4')](_0xd8eef,_0x1e5800);};}function removeListener(_0x53da6c,_0x211755){return function(){WhatsappMessageEvents[_0x44ae('0x5')](_0x53da6c,_0x211755);};}exports[_0x44ae('0x6')]=function(_0x152868){for(var _0x46a5f1=0x0,_0x2a62b4=events['length'];_0x46a5f1<_0x2a62b4;_0x46a5f1++){var _0x4943c6=events[_0x46a5f1];var _0x337b04=createListener(_0x44ae('0x7')+_0x4943c6,_0x152868);WhatsappMessageEvents['on'](_0x4943c6,_0x337b04);}}; \ No newline at end of file +var _0xd565=['save','emit','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0xd71ff9,_0x36cd21){var _0x2834ef=function(_0x532570){while(--_0x532570){_0xd71ff9['push'](_0xd71ff9['shift']());}};_0x2834ef(++_0x36cd21);}(_0xd565,0x119));var _0x5d56=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd565[_0x2641f9];return _0x585741;};'use strict';var WhatsappMessageEvents=require(_0x5d56('0x0'));var events=[_0x5d56('0x1'),'remove','update'];function createListener(_0x365395,_0x55ee28){return function(_0x2b5956){_0x55ee28[_0x5d56('0x2')](_0x365395,_0x2b5956);};}function removeListener(_0x5276d0,_0x342631){return function(){WhatsappMessageEvents['removeListener'](_0x5276d0,_0x342631);};}exports[_0x5d56('0x3')]=function(_0x2ae612){for(var _0x1a8f29=0x0,_0x265942=events[_0x5d56('0x4')];_0x1a8f29<_0x265942;_0x1a8f29++){var _0x56c8e5=events[_0x1a8f29];var _0x110e68=createListener(_0x5d56('0x5')+_0x56c8e5,_0x2ae612);WhatsappMessageEvents['on'](_0x56c8e5,_0x110e68);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 8a9578f..57f89ea 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 _0x3573=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer'];(function(_0x311f53,_0x4baa5d){var _0x266a80=function(_0x158a1a){while(--_0x158a1a){_0x311f53['push'](_0x311f53['shift']());}};_0x266a80(++_0x4baa5d);}(_0x3573,0x15e));var _0x3357=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3573[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3357('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3357('0x1'));var express=require(_0x3357('0x2'));var router=express[_0x3357('0x3')]();var fs_extra=require(_0x3357('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3357('0x5'));var config=require(_0x3357('0x6'));var controller=require('./whatsappQueue.controller');router[_0x3357('0x7')]('/',auth[_0x3357('0x8')](),controller[_0x3357('0x9')]);router['get'](_0x3357('0xa'),auth['isAuthenticated'](),controller[_0x3357('0xb')]);router[_0x3357('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3357('0xc')]);router[_0x3357('0x7')](_0x3357('0xd'),auth[_0x3357('0x8')](),controller['getMembers']);router['get'](_0x3357('0xe'),auth[_0x3357('0x8')](),controller['getTeams']);router[_0x3357('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x3357('0xf')]);router[_0x3357('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth[_0x3357('0x8')](),controller[_0x3357('0x11')]);router['post'](_0x3357('0x12'),auth[_0x3357('0x8')](),controller[_0x3357('0x13')]);router[_0x3357('0x14')](_0x3357('0x15'),auth[_0x3357('0x8')](),controller[_0x3357('0x16')]);router[_0x3357('0x17')]('/:id',auth[_0x3357('0x8')](),controller[_0x3357('0x18')]);router['delete'](_0x3357('0xe'),auth[_0x3357('0x8')](),controller['removeTeams']);router['delete'](_0x3357('0x12'),auth[_0x3357('0x8')](),controller[_0x3357('0x19')]);module[_0x3357('0x1a')]=router; \ No newline at end of file +var _0x6f7b=['/:id/teams','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','getTeams','post','create','/:id/users','addAgents','put','/:id','update','delete','destroy'];(function(_0x37f26b,_0x5cf1b8){var _0x156e3d=function(_0x4a801b){while(--_0x4a801b){_0x37f26b['push'](_0x37f26b['shift']());}};_0x156e3d(++_0x5cf1b8);}(_0x6f7b,0xe4));var _0xb6f7=function(_0x3ab910,_0x51f48d){_0x3ab910=_0x3ab910-0x0;var _0x55296b=_0x6f7b[_0x3ab910];return _0x55296b;};'use strict';var multer=require('multer');var util=require(_0xb6f7('0x0'));var path=require(_0xb6f7('0x1'));var timeout=require(_0xb6f7('0x2'));var express=require(_0xb6f7('0x3'));var router=express['Router']();var fs_extra=require(_0xb6f7('0x4'));var auth=require(_0xb6f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb6f7('0x6'));var controller=require('./whatsappQueue.controller');router[_0xb6f7('0x7')]('/',auth[_0xb6f7('0x8')](),controller['index']);router['get'](_0xb6f7('0x9'),auth['isAuthenticated'](),controller[_0xb6f7('0xa')]);router[_0xb6f7('0x7')]('/:id',auth[_0xb6f7('0x8')](),controller[_0xb6f7('0xb')]);router['get'](_0xb6f7('0xc'),auth['isAuthenticated'](),controller[_0xb6f7('0xd')]);router['get']('/:id/teams',auth[_0xb6f7('0x8')](),controller[_0xb6f7('0xe')]);router['get']('/:id/users',auth[_0xb6f7('0x8')](),controller['getAgents']);router[_0xb6f7('0xf')]('/',auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x10')]);router['post']('/:id/teams',auth[_0xb6f7('0x8')](),controller['addTeams']);router[_0xb6f7('0xf')](_0xb6f7('0x11'),auth['isAuthenticated'](),controller[_0xb6f7('0x12')]);router[_0xb6f7('0x13')](_0xb6f7('0x14'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x15')]);router[_0xb6f7('0x16')](_0xb6f7('0x14'),auth['isAuthenticated'](),controller[_0xb6f7('0x17')]);router[_0xb6f7('0x16')](_0xb6f7('0x18'),auth['isAuthenticated'](),controller[_0xb6f7('0x19')]);router['delete'](_0xb6f7('0x11'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x1a')]);module[_0xb6f7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 56c32db..1863ee9 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 _0x7a2c=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x26931e,_0x16f950){var _0x36bb27=function(_0x1bbcef){while(--_0x1bbcef){_0x26931e['push'](_0x26931e['shift']());}};_0x36bb27(++_0x16f950);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x3c345a,_0x214d8d){_0x3c345a=_0x3c345a-0x0;var _0x70de58=_0x7a2c[_0x3c345a];return _0x70de58;};'use strict';var Sequelize=require(_0xc7a2('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7a2('0x1')],'unique':_0xc7a2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc7a2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc7a2('0x4')](_0xc7a2('0x5'),_0xc7a2('0x6'),_0xc7a2('0x7'))},'description':{'type':Sequelize[_0xc7a2('0x1')]}}; \ No newline at end of file +var _0xd382=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x35825e,_0x657421){var _0x4f4d90=function(_0x160265){while(--_0x160265){_0x35825e['push'](_0x35825e['shift']());}};_0x4f4d90(++_0x657421);}(_0xd382,0x1b6));var _0x2d38=function(_0x48ee92,_0xa5ee8e){_0x48ee92=_0x48ee92-0x0;var _0x41f855=_0xd382[_0x48ee92];return _0x41f855;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'name':{'type':Sequelize[_0x2d38('0x2')],'unique':_0x2d38('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2d38('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2d38('0x5')](_0x2d38('0x6'),_0x2d38('0x7'),_0x2d38('0x8'))},'description':{'type':Sequelize[_0x2d38('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index b5ed1aa..c019bf6 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 _0x1037=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAll','User','findAndCountAll','UserId','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','order','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes'];(function(_0x491ec2,_0x540c00){var _0x1748db=function(_0x5a6258){while(--_0x5a6258){_0x491ec2['push'](_0x491ec2['shift']());}};_0x1748db(++_0x540c00);}(_0x1037,0xe2));var _0x7103=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x1037[_0x29632e];return _0x426e04;};'use strict';var emlformat=require(_0x7103('0x0'));var rimraf=require(_0x7103('0x1'));var zipdir=require(_0x7103('0x2'));var jsonpatch=require(_0x7103('0x3'));var rp=require(_0x7103('0x4'));var moment=require(_0x7103('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7103('0x6'));var util=require('util');var path=require(_0x7103('0x7'));var sox=require(_0x7103('0x8'));var csv=require('to-csv');var ejs=require(_0x7103('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7103('0xa'));var squel=require(_0x7103('0xb'));var crypto=require(_0x7103('0xc'));var jsforce=require(_0x7103('0xd'));var deskjs=require(_0x7103('0xe'));var toCsv=require(_0x7103('0xf'));var querystring=require(_0x7103('0x10'));var Papa=require(_0x7103('0x11'));var Redis=require('ioredis');var authService=require(_0x7103('0x12'));var qs=require(_0x7103('0x13'));var as=require(_0x7103('0x14'));var hardwareService=require(_0x7103('0x15'));var logger=require(_0x7103('0x16'))('api');var utils=require(_0x7103('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7103('0x18'));var db=require('../../mysqldb')['db'];config[_0x7103('0x19')]=_[_0x7103('0x1a')](config[_0x7103('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7103('0x1b'))(new Redis(config[_0x7103('0x19')]));require(_0x7103('0x1c'))[_0x7103('0x1d')](socket);function respondWithStatusCode(_0x4fb18e,_0x2664a3){_0x2664a3=_0x2664a3||0xcc;return function(_0x4c453b){if(_0x4c453b){return _0x4fb18e['sendStatus'](_0x2664a3);}return _0x4fb18e[_0x7103('0x1e')](_0x2664a3)['end']();};}function respondWithResult(_0xab564f,_0x135113){_0x135113=_0x135113||0xc8;return function(_0x115de6){if(_0x115de6){return _0xab564f[_0x7103('0x1e')](_0x135113)[_0x7103('0x1f')](_0x115de6);}};}function respondWithFilteredResult(_0x4ab072,_0x52a6bf){return function(_0x2367c6){if(_0x2367c6){var _0x467b85=typeof _0x52a6bf[_0x7103('0x20')]==='undefined'&&typeof _0x52a6bf['limit']===_0x7103('0x21');var _0x4ef3b9=_0x2367c6[_0x7103('0x22')];var _0x51cb50=_0x467b85?0x0:_0x52a6bf[_0x7103('0x20')];var _0x58f420=_0x467b85?_0x2367c6[_0x7103('0x22')]:_0x52a6bf[_0x7103('0x20')]+_0x52a6bf[_0x7103('0x23')];var _0x1c748f;if(_0x58f420>=_0x4ef3b9){_0x58f420=_0x4ef3b9;_0x1c748f=0xc8;}else{_0x1c748f=0xce;}_0x4ab072['status'](_0x1c748f);return _0x4ab072[_0x7103('0x24')](_0x7103('0x25'),_0x51cb50+'-'+_0x58f420+'/'+_0x4ef3b9)['json'](_0x2367c6);}return null;};}function patchUpdates(_0x3bd0f6){return function(_0x7fa74b){try{jsonpatch[_0x7103('0x26')](_0x7fa74b,_0x3bd0f6,!![]);}catch(_0x1aeaa2){return BPromise[_0x7103('0x27')](_0x1aeaa2);}return _0x7fa74b[_0x7103('0x28')]();};}function saveUpdates(_0x5a1fd6,_0x5a857f){return function(_0x2ed172){if(_0x2ed172){return _0x2ed172[_0x7103('0x29')](_0x5a1fd6)[_0x7103('0x2a')](function(_0xcbceac){return _0xcbceac;});}return null;};}function removeEntity(_0x5f3ee6,_0x4b1f3b){return function(_0x55713e){if(_0x55713e){return _0x55713e[_0x7103('0x2b')]()['then'](function(){var _0x4874ea=_0x55713e[_0x7103('0x2c')]({'plain':!![]});var _0x6ae64a=_0x7103('0x2d');return db[_0x7103('0x2e')][_0x7103('0x2b')]({'where':{'type':_0x6ae64a,'resourceId':_0x4874ea['id']}})[_0x7103('0x2a')](function(){return _0x55713e;});})[_0x7103('0x2a')](function(){_0x5f3ee6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a1207,_0x45b521){return function(_0xf208){if(!_0xf208){_0x2a1207[_0x7103('0x2f')](0x194);}return _0xf208;};}function handleError(_0x4c7c75,_0x5a6607){_0x5a6607=_0x5a6607||0x1f4;return function(_0x2ac01a){logger[_0x7103('0x30')](_0x2ac01a[_0x7103('0x31')]);if(_0x2ac01a[_0x7103('0x32')]){delete _0x2ac01a[_0x7103('0x32')];}_0x4c7c75[_0x7103('0x1e')](_0x5a6607)[_0x7103('0x33')](_0x2ac01a);};}exports[_0x7103('0x34')]=function(_0x1eb787,_0x26768a){var _0x473d4a={},_0x1374f3={},_0x327842={'count':0x0,'rows':[]};var _0x3050b3=_[_0x7103('0x35')](db[_0x7103('0x36')][_0x7103('0x37')],function(_0x1f2d79){return{'name':_0x1f2d79[_0x7103('0x38')],'type':_0x1f2d79[_0x7103('0x39')]['key']};});_0x1374f3[_0x7103('0x3a')]=_['map'](_0x3050b3,_0x7103('0x32'));_0x1374f3['query']=_[_0x7103('0x3b')](_0x1eb787['query']);_0x1374f3[_0x7103('0x3c')]=_[_0x7103('0x3d')](_0x1374f3[_0x7103('0x3a')],_0x1374f3[_0x7103('0x3e')]);_0x473d4a[_0x7103('0x3f')]=_[_0x7103('0x3d')](_0x1374f3[_0x7103('0x3a')],qs[_0x7103('0x40')](_0x1eb787['query'][_0x7103('0x40')]));_0x473d4a[_0x7103('0x3f')]=_0x473d4a['attributes'][_0x7103('0x41')]?_0x473d4a[_0x7103('0x3f')]:_0x1374f3[_0x7103('0x3a')];if(!_0x1eb787[_0x7103('0x3e')][_0x7103('0x42')](_0x7103('0x43'))){_0x473d4a['limit']=qs[_0x7103('0x23')](_0x1eb787[_0x7103('0x3e')][_0x7103('0x23')]);_0x473d4a[_0x7103('0x20')]=qs[_0x7103('0x20')](_0x1eb787[_0x7103('0x3e')]['offset']);}_0x473d4a['order']=qs[_0x7103('0x44')](_0x1eb787['query'][_0x7103('0x44')]);_0x473d4a[_0x7103('0x45')]=qs['filters'](_[_0x7103('0x46')](_0x1eb787['query'],_0x1374f3[_0x7103('0x3c')]),_0x3050b3);if(_0x1eb787['query'][_0x7103('0x47')]){_0x473d4a[_0x7103('0x45')]=_[_0x7103('0x48')](_0x473d4a[_0x7103('0x45')],{'$or':_[_0x7103('0x35')](_0x3050b3,function(_0x230fe9){if(_0x230fe9['type']!=='VIRTUAL'){var _0x26ad9b={};_0x26ad9b[_0x230fe9[_0x7103('0x32')]]={'$like':'%'+_0x1eb787[_0x7103('0x3e')][_0x7103('0x47')]+'%'};return _0x26ad9b;}})});}_0x473d4a=_[_0x7103('0x48')]({},_0x473d4a,_0x1eb787[_0x7103('0x49')]);var _0x40adf4={'where':_0x473d4a[_0x7103('0x45')]};return db[_0x7103('0x36')]['count'](_0x40adf4)[_0x7103('0x2a')](function(_0x438909){_0x327842[_0x7103('0x22')]=_0x438909;if(_0x1eb787[_0x7103('0x3e')][_0x7103('0x4a')]){_0x473d4a[_0x7103('0x4b')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x473d4a);})[_0x7103('0x2a')](function(_0x1e6ef0){_0x327842[_0x7103('0x4c')]=_0x1e6ef0;return _0x327842;})['then'](respondWithFilteredResult(_0x26768a,_0x473d4a))[_0x7103('0x4d')](handleError(_0x26768a,null));};exports[_0x7103('0x4e')]=function(_0x32bb42,_0x352518){var _0x438944={'raw':!![],'where':{'id':_0x32bb42['params']['id']}},_0x47556e={};_0x47556e[_0x7103('0x3a')]=_[_0x7103('0x3b')](db[_0x7103('0x36')][_0x7103('0x37')]);_0x47556e[_0x7103('0x3e')]=_['keys'](_0x32bb42[_0x7103('0x3e')]);_0x47556e[_0x7103('0x3c')]=_[_0x7103('0x3d')](_0x47556e[_0x7103('0x3a')],_0x47556e['query']);_0x438944[_0x7103('0x3f')]=_[_0x7103('0x3d')](_0x47556e[_0x7103('0x3a')],qs['fields'](_0x32bb42['query'][_0x7103('0x40')]));_0x438944[_0x7103('0x3f')]=_0x438944[_0x7103('0x3f')][_0x7103('0x41')]?_0x438944[_0x7103('0x3f')]:_0x47556e[_0x7103('0x3a')];if(_0x32bb42['query']['includeAll']){_0x438944[_0x7103('0x4b')]=[{'all':!![]}];}_0x438944=_[_0x7103('0x48')]({},_0x438944,_0x32bb42['options']);return db['WhatsappQueue'][_0x7103('0x4f')](_0x438944)[_0x7103('0x2a')](handleEntityNotFound(_0x352518,null))[_0x7103('0x2a')](respondWithResult(_0x352518,null))[_0x7103('0x4d')](handleError(_0x352518,null));};exports[_0x7103('0x50')]=function(_0x5a488b,_0x55d290){return db[_0x7103('0x36')][_0x7103('0x50')](_0x5a488b[_0x7103('0x51')],{})[_0x7103('0x2a')](function(_0x384e63){var _0x265439=_0x5a488b['user']['get']({'plain':!![]});if(!_0x265439)throw new Error(_0x7103('0x52'));if(_0x265439[_0x7103('0x53')]===_0x7103('0x54')){var _0x4a5d0a=_0x384e63['get']({'plain':!![]});var _0x3a8cef=_0x7103('0x2d');return db[_0x7103('0x55')][_0x7103('0x4f')]({'where':{'name':_0x3a8cef,'userProfileId':_0x265439[_0x7103('0x56')]},'raw':!![]})[_0x7103('0x2a')](function(_0x392309){if(_0x392309&&_0x392309[_0x7103('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a5d0a[_0x7103('0x32')],'resourceId':_0x4a5d0a['id'],'type':_0x392309[_0x7103('0x32')],'sectionId':_0x392309['id']},{})[_0x7103('0x2a')](function(){return _0x384e63;});}else{return _0x384e63;}})[_0x7103('0x4d')](function(_0x349b87){logger[_0x7103('0x30')](_0x7103('0x58'),_0x349b87);throw _0x349b87;});}return _0x384e63;})[_0x7103('0x2a')](respondWithResult(_0x55d290,0xc9))[_0x7103('0x4d')](handleError(_0x55d290,null));};exports[_0x7103('0x29')]=function(_0x53f38b,_0x43c542){if(_0x53f38b[_0x7103('0x51')]['id']){delete _0x53f38b['body']['id'];}return db[_0x7103('0x36')][_0x7103('0x4f')]({'where':{'id':_0x53f38b[_0x7103('0x59')]['id']}})[_0x7103('0x2a')](handleEntityNotFound(_0x43c542,null))[_0x7103('0x2a')](saveUpdates(_0x53f38b[_0x7103('0x51')],null))[_0x7103('0x2a')](respondWithResult(_0x43c542,null))[_0x7103('0x4d')](handleError(_0x43c542,null));};exports['destroy']=function(_0x261242,_0x31d7b8){return db['WhatsappQueue'][_0x7103('0x4f')]({'where':{'id':_0x261242['params']['id']}})[_0x7103('0x2a')](handleEntityNotFound(_0x31d7b8,null))['then'](removeEntity(_0x31d7b8,null))[_0x7103('0x4d')](handleError(_0x31d7b8,null));};exports[_0x7103('0x5a')]=function(_0x445e5a,_0x1f7657){return db['WhatsappQueue'][_0x7103('0x5a')]()['then'](respondWithResult(_0x1f7657,null))[_0x7103('0x4d')](handleError(_0x1f7657,null));};exports[_0x7103('0x5b')]=function(_0x4ca23e,_0x5d18e2,_0x1a56e5){var _0x40dedc={'raw':!![],'where':{}},_0x3c6ae9={},_0x1eaf9d;return db['WhatsappQueue'][_0x7103('0x5c')]({'where':{'id':_0x4ca23e[_0x7103('0x59')]['id']}})[_0x7103('0x2a')](handleEntityNotFound(_0x5d18e2,null))[_0x7103('0x2a')](function(_0x5d0313){if(_0x5d0313){_0x1eaf9d=_0x5d0313[_0x7103('0x2c')]({'plain':!![]});_0x3c6ae9[_0x7103('0x3a')]=_[_0x7103('0x3b')](db[_0x7103('0x5d')][_0x7103('0x37')]);_0x3c6ae9['query']=_[_0x7103('0x3b')](_0x4ca23e[_0x7103('0x3e')]);_0x3c6ae9[_0x7103('0x3c')]=_[_0x7103('0x3d')](_0x3c6ae9['model'],_0x3c6ae9[_0x7103('0x3e')]);_0x40dedc[_0x7103('0x3f')]=_[_0x7103('0x3d')](_0x3c6ae9[_0x7103('0x3a')],qs[_0x7103('0x40')](_0x4ca23e[_0x7103('0x3e')][_0x7103('0x40')]));_0x40dedc[_0x7103('0x3f')]=_0x40dedc['attributes'][_0x7103('0x41')]?_0x40dedc['attributes']:_0x3c6ae9[_0x7103('0x3a')];if(!_0x4ca23e[_0x7103('0x3e')][_0x7103('0x42')]('nolimit')){_0x40dedc['limit']=qs[_0x7103('0x23')](_0x4ca23e['query'][_0x7103('0x23')]);_0x40dedc['offset']=qs[_0x7103('0x20')](_0x4ca23e[_0x7103('0x3e')][_0x7103('0x20')]);}_0x40dedc['order']=qs[_0x7103('0x44')](_0x4ca23e[_0x7103('0x3e')]['sort']);_0x40dedc[_0x7103('0x45')]=qs['filters'](_[_0x7103('0x46')](_0x4ca23e['query'],_0x3c6ae9[_0x7103('0x3c')]));_0x40dedc[_0x7103('0x45')][_0x7103('0x5e')]=_0x5d0313['id'];if(_0x4ca23e['query'][_0x7103('0x47')]){_0x40dedc[_0x7103('0x45')]=_['merge'](_0x40dedc[_0x7103('0x45')],{'$or':_[_0x7103('0x35')](_0x40dedc[_0x7103('0x3f')],function(_0x8660c){var _0xcc2e2e={};_0xcc2e2e[_0x8660c]={'$like':'%'+_0x4ca23e[_0x7103('0x3e')]['filter']+'%'};return _0xcc2e2e;})});}_0x40dedc=_[_0x7103('0x48')]({},_0x40dedc,_0x4ca23e['options']);return db['UserWhatsappQueue'][_0x7103('0x5f')](_0x40dedc);}})[_0x7103('0x2a')](function(_0xe0231f){if(_0xe0231f){return db[_0x7103('0x60')][_0x7103('0x61')]({'where':{'id':_[_0x7103('0x35')](_0xe0231f,_0x7103('0x62')),'role':'agent'},'attributes':['id',_0x7103('0x32'),_0x7103('0x63'),_0x7103('0x64'),'createdAt']});}})[_0x7103('0x2a')](function(_0x1882c0){if(_0x1882c0){return{'count':_0x1882c0[_0x7103('0x22')],'rows':_[_0x7103('0x35')](_0x1882c0[_0x7103('0x4c')],function(_0x22f4bc){return{'membername':_0x22f4bc[_0x7103('0x32')],'UserId':_0x22f4bc['id'],'queue_name':_0x1eaf9d['name'],'WhatsappQueueId':_0x1eaf9d['id'],'interface':util[_0x7103('0x65')](_0x7103('0x66'),_0x7103('0x67'),_0x22f4bc[_0x7103('0x32')]),'penalty':0x0,'paused':_0x22f4bc['whatsappPause'],'createdAt':_0x22f4bc[_0x7103('0x68')],'updatedAt':_0x22f4bc[_0x7103('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7103('0x2a')](respondWithFilteredResult(_0x5d18e2,_0x40dedc))[_0x7103('0x4d')](handleError(_0x5d18e2,null));};exports[_0x7103('0x69')]=function(_0x11b8a3,_0x30f63c,_0x53cdb8){var _0x46da9f={};var _0x200c80={};var _0x5d6a4c;var _0x423417;return db[_0x7103('0x36')][_0x7103('0x5c')]({'where':{'id':_0x11b8a3[_0x7103('0x59')]['id']}})['then'](handleEntityNotFound(_0x30f63c,null))[_0x7103('0x2a')](function(_0x5f06b5){if(_0x5f06b5){_0x5d6a4c=_0x5f06b5;_0x200c80[_0x7103('0x3a')]=_[_0x7103('0x3b')](db[_0x7103('0x6a')]['rawAttributes']);_0x200c80[_0x7103('0x3e')]=_[_0x7103('0x3b')](_0x11b8a3[_0x7103('0x3e')]);_0x200c80[_0x7103('0x3c')]=_[_0x7103('0x3d')](_0x200c80['model'],_0x200c80['query']);_0x46da9f[_0x7103('0x3f')]=_[_0x7103('0x3d')](_0x200c80[_0x7103('0x3a')],qs[_0x7103('0x40')](_0x11b8a3[_0x7103('0x3e')][_0x7103('0x40')]));_0x46da9f[_0x7103('0x3f')]=_0x46da9f[_0x7103('0x3f')][_0x7103('0x41')]?_0x46da9f[_0x7103('0x3f')]:_0x200c80[_0x7103('0x3a')];_0x46da9f[_0x7103('0x6b')]=qs[_0x7103('0x44')](_0x11b8a3[_0x7103('0x3e')]['sort']);_0x46da9f['where']=qs[_0x7103('0x3c')](_[_0x7103('0x46')](_0x11b8a3[_0x7103('0x3e')],_0x200c80[_0x7103('0x3c')]));if(_0x11b8a3[_0x7103('0x3e')][_0x7103('0x47')]){_0x46da9f[_0x7103('0x45')]=_[_0x7103('0x48')](_0x46da9f[_0x7103('0x45')],{'$or':_['map'](_0x46da9f[_0x7103('0x3f')],function(_0x56dc12){var _0x9f8e49={};_0x9f8e49[_0x56dc12]={'$like':'%'+_0x11b8a3[_0x7103('0x3e')][_0x7103('0x47')]+'%'};return _0x9f8e49;})});}_0x46da9f=_[_0x7103('0x48')]({},_0x46da9f,_0x11b8a3[_0x7103('0x49')]);return _0x5d6a4c[_0x7103('0x69')](_0x46da9f);}})[_0x7103('0x2a')](function(_0x4394fe){if(_0x4394fe){_0x423417=_0x4394fe[_0x7103('0x41')];if(!_0x11b8a3[_0x7103('0x3e')][_0x7103('0x42')](_0x7103('0x43'))){_0x46da9f[_0x7103('0x23')]=qs[_0x7103('0x23')](_0x11b8a3['query']['limit']);_0x46da9f[_0x7103('0x20')]=qs['offset'](_0x11b8a3[_0x7103('0x3e')][_0x7103('0x20')]);}return _0x5d6a4c[_0x7103('0x69')](_0x46da9f);}})[_0x7103('0x2a')](function(_0x5e53b5){if(_0x5e53b5){return _0x5e53b5?{'count':_0x423417,'rows':_0x5e53b5}:null;}})[_0x7103('0x2a')](respondWithResult(_0x30f63c,null))[_0x7103('0x4d')](handleError(_0x30f63c,null));};exports[_0x7103('0x6c')]=function(_0x11de49,_0x4e0cb5,_0x16e405){var _0x14a2c3=_0x11de49['body'][_0x7103('0x6d')];return db['Team']['findAll']({'where':{'id':_0x14a2c3},'attributes':['id'],'include':[{'model':db[_0x7103('0x60')],'as':_0x7103('0x6e'),'attributes':['id',_0x7103('0x32'),_0x7103('0x6f'),'voicePause',_0x7103('0x70')],'raw':!![]}]})[_0x7103('0x2a')](function(_0x1b8eba){if(_0x1b8eba){var _0x51f523=_[_0x7103('0x71')](_0x1b8eba,function(_0x136ce7){var _0x55788d=_0x136ce7['get']({'plain':!![]});return _0x55788d['Agents'];});return db[_0x7103('0x36')]['find']({'where':{'id':_0x11de49['params']['id']}})['then'](function(_0x56bb28){return db[_0x7103('0x72')][_0x7103('0x73')](function(_0x18d44b){return _0x56bb28[_0x7103('0x6c')](_0x14a2c3,{'transaction':_0x18d44b})[_0x7103('0x2a')](function(){return BPromise['each'](_0x51f523,function(_0xbf1c10){return db[_0x7103('0x5d')][_0x7103('0x74')]({'where':{'UserId':_0xbf1c10['id'],'WhatsappQueueId':_0x11de49[_0x7103('0x59')]['id']},'transaction':_0x18d44b});});})['then'](function(){_0x51f523[_0x7103('0x75')](function(_0x5e56e6){socket[_0x7103('0x76')](_0x7103('0x77'),{'UserId':_0x5e56e6['id'],'WhatsappQueueId':_0x56bb28['id']});});});});});}})[_0x7103('0x2a')](respondWithStatusCode(_0x4e0cb5,null))[_0x7103('0x4d')](handleError(_0x4e0cb5,null));};exports['removeTeams']=function(_0x43042f,_0x5ec6e2,_0x2f7d13){return db[_0x7103('0x6a')][_0x7103('0x5f')]({'where':{'id':_0x43042f[_0x7103('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7103('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5ec6e2,null))[_0x7103('0x2a')](function(_0x314b31){var _0x50e672=_[_0x7103('0x35')](_0x314b31,'id');var _0x55346f=[];var _0x40e90b=[];var _0x1bbdb7=squel['select']();_0x1bbdb7[_0x7103('0x78')](_0x7103('0x79'))[_0x7103('0x7a')](_0x7103('0x7b'),'tq')[_0x7103('0x7c')](_0x7103('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7103('0x45')](_0x7103('0x7e'),_0x43042f[_0x7103('0x59')]['id']);for(var _0x3a7e8d=0x0;_0x3a7e8d<_0x314b31[_0x7103('0x41')];_0x3a7e8d+=0x1){let _0x8cd0a3=_0x314b31[_0x3a7e8d];for(var _0x49d5b8=0x0;_0x49d5b8<_0x8cd0a3[_0x7103('0x6e')][_0x7103('0x41')];_0x49d5b8+=0x1){let _0x145f99=_0x8cd0a3[_0x7103('0x6e')][_0x49d5b8];var _0x3837fd=_0x1bbdb7[_0x7103('0x7f')]();_0x3837fd[_0x7103('0x45')](_0x7103('0x80'),_0x145f99['id']);_0x40e90b['push'](db[_0x7103('0x72')][_0x7103('0x3e')](_0x3837fd[_0x7103('0x81')](),{'type':db[_0x7103('0x72')][_0x7103('0x82')]['SELECT']})['then'](function(_0xf0a4ac){if(_0xf0a4ac[_0x7103('0x41')]===0x1){return _0x145f99['id'];}else{var _0x1bce26=_[_0x7103('0x83')](_[_0x7103('0x35')](_0xf0a4ac,_0x7103('0x84')),function(_0x219f08){return _[_0x7103('0x85')](_0x50e672,_0x219f08);});if(_0x1bce26){return _0x145f99['id'];}}}));}}return BPromise[_0x7103('0x86')](_0x40e90b)['then'](function(_0x1ef575){_0x55346f=_(_0x55346f)[_0x7103('0x87')](_0x1ef575)[_0x7103('0x88')]()[_0x7103('0x89')]();return db[_0x7103('0x36')][_0x7103('0x4f')]({'where':{'id':_0x43042f['params']['id']}})[_0x7103('0x2a')](function(_0x5eceef){return db['sequelize'][_0x7103('0x73')](function(_0x2b24f1){return _0x5eceef['removeTeams'](_0x43042f[_0x7103('0x3e')][_0x7103('0x6d')],{'transaction':_0x2b24f1})['then'](function(){if(!_[_0x7103('0x8a')](_0x55346f)){return _0x5eceef[_0x7103('0x8b')](_0x55346f,{'transaction':_0x2b24f1});}})[_0x7103('0x2a')](function(){_0x55346f[_0x7103('0x75')](function(_0x233822){socket[_0x7103('0x76')](_0x7103('0x8c'),{'UserId':_0x233822,'WhatsappQueueId':_0x5eceef['id']});});});});});});})[_0x7103('0x2a')](respondWithStatusCode(_0x5ec6e2,null))['catch'](handleError(_0x5ec6e2,null));};exports[_0x7103('0x8d')]=function(_0x29b83f,_0x432405,_0xc55212){return db['WhatsappQueue']['find']({'where':{'id':_0x29b83f[_0x7103('0x59')]['id']}})['then'](handleEntityNotFound(_0x432405,null))[_0x7103('0x2a')](function(_0x415661){if(_0x415661){return _0x415661['addAgents'](_0x29b83f[_0x7103('0x51')][_0x7103('0x6d')],_['omit'](_0x29b83f[_0x7103('0x51')],['ids','id'])||{})[_0x7103('0x8e')](function(_0x18d50e){for(var _0x1a122e=0x0;_0x1a122e<_0x29b83f[_0x7103('0x51')][_0x7103('0x6d')][_0x7103('0x41')];_0x1a122e+=0x1){socket[_0x7103('0x76')](_0x7103('0x77'),{'UserId':Number(_0x29b83f[_0x7103('0x51')]['ids'][_0x1a122e]),'WhatsappQueueId':Number(_0x29b83f[_0x7103('0x59')]['id'])});}return _0x18d50e;});}})[_0x7103('0x2a')](respondWithResult(_0x432405,null))[_0x7103('0x4d')](handleError(_0x432405,null));};exports[_0x7103('0x8b')]=function(_0x172b8a,_0x375932,_0x542116){return db[_0x7103('0x36')][_0x7103('0x4f')]({'where':{'id':_0x172b8a[_0x7103('0x59')]['id']}})[_0x7103('0x2a')](handleEntityNotFound(_0x375932,null))[_0x7103('0x2a')](function(_0x332f06){if(_0x332f06){return _0x332f06[_0x7103('0x8b')](_0x172b8a[_0x7103('0x3e')]['ids'])['then'](function(){if(_[_0x7103('0x8f')](_0x172b8a[_0x7103('0x3e')][_0x7103('0x6d')])){for(var _0x2c859a=0x0;_0x2c859a<_0x172b8a['query'][_0x7103('0x6d')][_0x7103('0x41')];_0x2c859a+=0x1){socket[_0x7103('0x76')](_0x7103('0x8c'),{'UserId':Number(_0x172b8a[_0x7103('0x3e')]['ids'][_0x2c859a]),'WhatsappQueueId':Number(_0x172b8a[_0x7103('0x59')]['id'])});}}else{socket[_0x7103('0x76')](_0x7103('0x8c'),{'UserId':Number(_0x172b8a[_0x7103('0x3e')][_0x7103('0x6d')]),'WhatsappQueueId':Number(_0x172b8a[_0x7103('0x59')]['id'])});}});}})[_0x7103('0x2a')](respondWithStatusCode(_0x375932,null))[_0x7103('0x4d')](handleError(_0x375932,null));};exports[_0x7103('0x90')]=function(_0x28c371,_0x20a9fc,_0x22f9c7){var _0x5378ab={};var _0x1a0b01={};var _0x142e29;var _0xb1b19d;return db[_0x7103('0x36')][_0x7103('0x5c')]({'where':{'id':_0x28c371[_0x7103('0x59')]['id']}})[_0x7103('0x2a')](handleEntityNotFound(_0x20a9fc,null))['then'](function(_0x2f2289){if(_0x2f2289){_0x142e29=_0x2f2289;_0x1a0b01[_0x7103('0x3a')]=_[_0x7103('0x3b')](db[_0x7103('0x60')]['rawAttributes']);_0x1a0b01[_0x7103('0x3e')]=_[_0x7103('0x3b')](_0x28c371[_0x7103('0x3e')]);_0x1a0b01[_0x7103('0x3c')]=_[_0x7103('0x3d')](_0x1a0b01['model'],_0x1a0b01[_0x7103('0x3e')]);_0x5378ab['attributes']=_[_0x7103('0x3d')](_0x1a0b01['model'],qs['fields'](_0x28c371[_0x7103('0x3e')][_0x7103('0x40')]));_0x5378ab[_0x7103('0x3f')]=_0x5378ab[_0x7103('0x3f')][_0x7103('0x41')]?_0x5378ab[_0x7103('0x3f')]:_0x1a0b01[_0x7103('0x3a')];_0x5378ab[_0x7103('0x6b')]=qs[_0x7103('0x44')](_0x28c371['query'][_0x7103('0x44')]);_0x5378ab[_0x7103('0x45')]=qs[_0x7103('0x3c')](_[_0x7103('0x46')](_0x28c371['query'],_0x1a0b01[_0x7103('0x3c')]));if(_0x28c371['query'][_0x7103('0x47')]){_0x5378ab[_0x7103('0x45')]=_[_0x7103('0x48')](_0x5378ab[_0x7103('0x45')],{'$or':_[_0x7103('0x35')](_0x5378ab[_0x7103('0x3f')],function(_0x5b573a){var _0x7a4822={};_0x7a4822[_0x5b573a]={'$like':'%'+_0x28c371['query'][_0x7103('0x47')]+'%'};return _0x7a4822;})});}_0x5378ab=_[_0x7103('0x48')]({},_0x5378ab,_0x28c371['options']);return _0x142e29['getAgents'](_0x5378ab);}})[_0x7103('0x2a')](function(_0x260148){if(_0x260148){_0xb1b19d=_0x260148[_0x7103('0x41')];if(!_0x28c371[_0x7103('0x3e')][_0x7103('0x42')](_0x7103('0x43'))){_0x5378ab['limit']=qs[_0x7103('0x23')](_0x28c371['query']['limit']);_0x5378ab[_0x7103('0x20')]=qs[_0x7103('0x20')](_0x28c371[_0x7103('0x3e')][_0x7103('0x20')]);}return _0x142e29['getAgents'](_0x5378ab);}})[_0x7103('0x2a')](function(_0x199cf0){if(_0x199cf0){return _0x199cf0?{'count':_0xb1b19d,'rows':_0x199cf0}:null;}})[_0x7103('0x2a')](respondWithResult(_0x20a9fc,null))[_0x7103('0x4d')](handleError(_0x20a9fc,null));}; \ No newline at end of file +var _0xe6ac=['socket.io-emitter','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','then','destroy','get','UserProfileResource','stack','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','order','pick','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x3d5de9,_0xead516){var _0x42eb14=function(_0x3b211c){while(--_0x3b211c){_0x3d5de9['push'](_0x3d5de9['shift']());}};_0x42eb14(++_0xead516);}(_0xe6ac,0x103));var _0xce6a=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xe6ac[_0x328b1c];return _0x4dbeaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce6a('0x0'));var zipdir=require(_0xce6a('0x1'));var jsonpatch=require(_0xce6a('0x2'));var rp=require(_0xce6a('0x3'));var moment=require(_0xce6a('0x4'));var BPromise=require(_0xce6a('0x5'));var Mustache=require(_0xce6a('0x6'));var util=require(_0xce6a('0x7'));var path=require(_0xce6a('0x8'));var sox=require(_0xce6a('0x9'));var csv=require('to-csv');var ejs=require(_0xce6a('0xa'));var fs=require('fs');var fs_extra=require(_0xce6a('0xb'));var _=require(_0xce6a('0xc'));var squel=require(_0xce6a('0xd'));var crypto=require(_0xce6a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce6a('0xf'));var querystring=require(_0xce6a('0x10'));var Papa=require(_0xce6a('0x11'));var Redis=require(_0xce6a('0x12'));var authService=require(_0xce6a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce6a('0x14'));var logger=require(_0xce6a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xce6a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xce6a('0x17'))['db'];config[_0xce6a('0x18')]=_[_0xce6a('0x19')](config['redis'],{'host':_0xce6a('0x1a'),'port':0x18eb});var socket=require(_0xce6a('0x1b'))(new Redis(config[_0xce6a('0x18')]));require('./whatsappQueue.socket')[_0xce6a('0x1c')](socket);function respondWithStatusCode(_0x40a64e,_0x52cdbb){_0x52cdbb=_0x52cdbb||0xcc;return function(_0x203348){if(_0x203348){return _0x40a64e[_0xce6a('0x1d')](_0x52cdbb);}return _0x40a64e[_0xce6a('0x1e')](_0x52cdbb)[_0xce6a('0x1f')]();};}function respondWithResult(_0x125267,_0x3331a3){_0x3331a3=_0x3331a3||0xc8;return function(_0x468377){if(_0x468377){return _0x125267[_0xce6a('0x1e')](_0x3331a3)['json'](_0x468377);}};}function respondWithFilteredResult(_0x58a0a0,_0x2c4cd8){return function(_0x191fcf){if(_0x191fcf){var _0x5a3e1b=typeof _0x2c4cd8[_0xce6a('0x20')]==='undefined'&&typeof _0x2c4cd8[_0xce6a('0x21')]==='undefined';var _0xfa92e2=_0x191fcf['count'];var _0x108d1b=_0x5a3e1b?0x0:_0x2c4cd8[_0xce6a('0x20')];var _0x5a921d=_0x5a3e1b?_0x191fcf[_0xce6a('0x22')]:_0x2c4cd8[_0xce6a('0x20')]+_0x2c4cd8['limit'];var _0x4b40d8;if(_0x5a921d>=_0xfa92e2){_0x5a921d=_0xfa92e2;_0x4b40d8=0xc8;}else{_0x4b40d8=0xce;}_0x58a0a0[_0xce6a('0x1e')](_0x4b40d8);return _0x58a0a0[_0xce6a('0x23')](_0xce6a('0x24'),_0x108d1b+'-'+_0x5a921d+'/'+_0xfa92e2)[_0xce6a('0x25')](_0x191fcf);}return null;};}function patchUpdates(_0x4a808d){return function(_0x31a18d){try{jsonpatch[_0xce6a('0x26')](_0x31a18d,_0x4a808d,!![]);}catch(_0xfd8d58){return BPromise['reject'](_0xfd8d58);}return _0x31a18d[_0xce6a('0x27')]();};}function saveUpdates(_0x117e8c,_0x89a65f){return function(_0x49f4e1){if(_0x49f4e1){return _0x49f4e1['update'](_0x117e8c)[_0xce6a('0x28')](function(_0x1c9dd8){return _0x1c9dd8;});}return null;};}function removeEntity(_0x1d87b9,_0x113237){return function(_0x2fbf82){if(_0x2fbf82){return _0x2fbf82[_0xce6a('0x29')]()[_0xce6a('0x28')](function(){var _0xfc983d=_0x2fbf82[_0xce6a('0x2a')]({'plain':!![]});var _0x1d96eb='WhatsappQueues';return db[_0xce6a('0x2b')][_0xce6a('0x29')]({'where':{'type':_0x1d96eb,'resourceId':_0xfc983d['id']}})[_0xce6a('0x28')](function(){return _0x2fbf82;});})[_0xce6a('0x28')](function(){_0x1d87b9[_0xce6a('0x1e')](0xcc)[_0xce6a('0x1f')]();});}};}function handleEntityNotFound(_0x5d5a47,_0x3fbfd1){return function(_0x117162){if(!_0x117162){_0x5d5a47[_0xce6a('0x1d')](0x194);}return _0x117162;};}function handleError(_0x326639,_0x150615){_0x150615=_0x150615||0x1f4;return function(_0x1c517e){logger['error'](_0x1c517e[_0xce6a('0x2c')]);if(_0x1c517e['name']){delete _0x1c517e['name'];}_0x326639[_0xce6a('0x1e')](_0x150615)[_0xce6a('0x2d')](_0x1c517e);};}exports[_0xce6a('0x2e')]=function(_0x46d647,_0x27b139){var _0x50a0b9={},_0x34dcfa={},_0x243def={'count':0x0,'rows':[]};var _0x4b2009=_[_0xce6a('0x2f')](db[_0xce6a('0x30')][_0xce6a('0x31')],function(_0x954cd1){return{'name':_0x954cd1[_0xce6a('0x32')],'type':_0x954cd1[_0xce6a('0x33')][_0xce6a('0x34')]};});_0x34dcfa[_0xce6a('0x35')]=_[_0xce6a('0x2f')](_0x4b2009,_0xce6a('0x36'));_0x34dcfa['query']=_['keys'](_0x46d647['query']);_0x34dcfa[_0xce6a('0x37')]=_['intersection'](_0x34dcfa[_0xce6a('0x35')],_0x34dcfa[_0xce6a('0x38')]);_0x50a0b9[_0xce6a('0x39')]=_[_0xce6a('0x3a')](_0x34dcfa[_0xce6a('0x35')],qs['fields'](_0x46d647['query'][_0xce6a('0x3b')]));_0x50a0b9[_0xce6a('0x39')]=_0x50a0b9[_0xce6a('0x39')][_0xce6a('0x3c')]?_0x50a0b9[_0xce6a('0x39')]:_0x34dcfa[_0xce6a('0x35')];if(!_0x46d647[_0xce6a('0x38')][_0xce6a('0x3d')](_0xce6a('0x3e'))){_0x50a0b9[_0xce6a('0x21')]=qs['limit'](_0x46d647[_0xce6a('0x38')]['limit']);_0x50a0b9[_0xce6a('0x20')]=qs[_0xce6a('0x20')](_0x46d647[_0xce6a('0x38')][_0xce6a('0x20')]);}_0x50a0b9['order']=qs[_0xce6a('0x3f')](_0x46d647['query'][_0xce6a('0x3f')]);_0x50a0b9['where']=qs[_0xce6a('0x37')](_['pick'](_0x46d647[_0xce6a('0x38')],_0x34dcfa['filters']),_0x4b2009);if(_0x46d647[_0xce6a('0x38')][_0xce6a('0x40')]){_0x50a0b9['where']=_[_0xce6a('0x41')](_0x50a0b9[_0xce6a('0x42')],{'$or':_[_0xce6a('0x2f')](_0x4b2009,function(_0x5eebce){if(_0x5eebce[_0xce6a('0x33')]!==_0xce6a('0x43')){var _0x38c86e={};_0x38c86e[_0x5eebce[_0xce6a('0x36')]]={'$like':'%'+_0x46d647[_0xce6a('0x38')]['filter']+'%'};return _0x38c86e;}})});}_0x50a0b9=_[_0xce6a('0x41')]({},_0x50a0b9,_0x46d647[_0xce6a('0x44')]);var _0x2c8958={'where':_0x50a0b9[_0xce6a('0x42')]};return db[_0xce6a('0x30')][_0xce6a('0x22')](_0x2c8958)[_0xce6a('0x28')](function(_0x56011d){_0x243def[_0xce6a('0x22')]=_0x56011d;if(_0x46d647[_0xce6a('0x38')]['includeAll']){_0x50a0b9[_0xce6a('0x45')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xce6a('0x46')](_0x50a0b9);})[_0xce6a('0x28')](function(_0x4f7bbd){_0x243def[_0xce6a('0x47')]=_0x4f7bbd;return _0x243def;})[_0xce6a('0x28')](respondWithFilteredResult(_0x27b139,_0x50a0b9))['catch'](handleError(_0x27b139,null));};exports[_0xce6a('0x48')]=function(_0x1a1adb,_0x4d7f75){var _0xece73={'raw':!![],'where':{'id':_0x1a1adb['params']['id']}},_0x55a9d4={};_0x55a9d4['model']=_['keys'](db[_0xce6a('0x30')][_0xce6a('0x31')]);_0x55a9d4[_0xce6a('0x38')]=_[_0xce6a('0x49')](_0x1a1adb[_0xce6a('0x38')]);_0x55a9d4['filters']=_['intersection'](_0x55a9d4['model'],_0x55a9d4[_0xce6a('0x38')]);_0xece73[_0xce6a('0x39')]=_['intersection'](_0x55a9d4[_0xce6a('0x35')],qs[_0xce6a('0x3b')](_0x1a1adb[_0xce6a('0x38')][_0xce6a('0x3b')]));_0xece73[_0xce6a('0x39')]=_0xece73['attributes']['length']?_0xece73[_0xce6a('0x39')]:_0x55a9d4[_0xce6a('0x35')];if(_0x1a1adb['query']['includeAll']){_0xece73[_0xce6a('0x45')]=[{'all':!![]}];}_0xece73=_['merge']({},_0xece73,_0x1a1adb[_0xce6a('0x44')]);return db['WhatsappQueue'][_0xce6a('0x4a')](_0xece73)[_0xce6a('0x28')](handleEntityNotFound(_0x4d7f75,null))[_0xce6a('0x28')](respondWithResult(_0x4d7f75,null))['catch'](handleError(_0x4d7f75,null));};exports[_0xce6a('0x4b')]=function(_0x28aa00,_0x21a857){return db[_0xce6a('0x30')][_0xce6a('0x4b')](_0x28aa00[_0xce6a('0x4c')],{})[_0xce6a('0x28')](function(_0x1ef058){var _0x56136f=_0x28aa00[_0xce6a('0x4d')]['get']({'plain':!![]});if(!_0x56136f)throw new Error(_0xce6a('0x4e'));if(_0x56136f[_0xce6a('0x4f')]===_0xce6a('0x4d')){var _0x26588f=_0x1ef058[_0xce6a('0x2a')]({'plain':!![]});var _0x3b0d89='WhatsappQueues';return db['UserProfileSection'][_0xce6a('0x4a')]({'where':{'name':_0x3b0d89,'userProfileId':_0x56136f['userProfileId']},'raw':!![]})['then'](function(_0x1606d4){if(_0x1606d4&&_0x1606d4[_0xce6a('0x50')]===0x0){return db[_0xce6a('0x2b')][_0xce6a('0x4b')]({'name':_0x26588f[_0xce6a('0x36')],'resourceId':_0x26588f['id'],'type':_0x1606d4[_0xce6a('0x36')],'sectionId':_0x1606d4['id']},{})[_0xce6a('0x28')](function(){return _0x1ef058;});}else{return _0x1ef058;}})[_0xce6a('0x51')](function(_0x4b8760){logger[_0xce6a('0x52')](_0xce6a('0x53'),_0x4b8760);throw _0x4b8760;});}return _0x1ef058;})[_0xce6a('0x28')](respondWithResult(_0x21a857,0xc9))[_0xce6a('0x51')](handleError(_0x21a857,null));};exports[_0xce6a('0x54')]=function(_0x810886,_0x3505b4){if(_0x810886[_0xce6a('0x4c')]['id']){delete _0x810886[_0xce6a('0x4c')]['id'];}return db[_0xce6a('0x30')]['find']({'where':{'id':_0x810886[_0xce6a('0x55')]['id']}})['then'](handleEntityNotFound(_0x3505b4,null))[_0xce6a('0x28')](saveUpdates(_0x810886['body'],null))[_0xce6a('0x28')](respondWithResult(_0x3505b4,null))['catch'](handleError(_0x3505b4,null));};exports[_0xce6a('0x29')]=function(_0x5a914e,_0xeefcf0){return db['WhatsappQueue'][_0xce6a('0x4a')]({'where':{'id':_0x5a914e['params']['id']}})[_0xce6a('0x28')](handleEntityNotFound(_0xeefcf0,null))[_0xce6a('0x28')](removeEntity(_0xeefcf0,null))[_0xce6a('0x51')](handleError(_0xeefcf0,null));};exports[_0xce6a('0x56')]=function(_0x2d573a,_0xbe0bb1){return db[_0xce6a('0x30')][_0xce6a('0x56')]()[_0xce6a('0x28')](respondWithResult(_0xbe0bb1,null))['catch'](handleError(_0xbe0bb1,null));};exports[_0xce6a('0x57')]=function(_0x4645ee,_0xb89e51,_0xa12651){var _0x204d36={'raw':!![],'where':{}},_0x2b2f7a={},_0x775b3a;return db[_0xce6a('0x30')][_0xce6a('0x58')]({'where':{'id':_0x4645ee['params']['id']}})[_0xce6a('0x28')](handleEntityNotFound(_0xb89e51,null))[_0xce6a('0x28')](function(_0x1e6324){if(_0x1e6324){_0x775b3a=_0x1e6324[_0xce6a('0x2a')]({'plain':!![]});_0x2b2f7a['model']=_[_0xce6a('0x49')](db['UserWhatsappQueue'][_0xce6a('0x31')]);_0x2b2f7a[_0xce6a('0x38')]=_[_0xce6a('0x49')](_0x4645ee['query']);_0x2b2f7a['filters']=_[_0xce6a('0x3a')](_0x2b2f7a[_0xce6a('0x35')],_0x2b2f7a[_0xce6a('0x38')]);_0x204d36[_0xce6a('0x39')]=_['intersection'](_0x2b2f7a[_0xce6a('0x35')],qs['fields'](_0x4645ee[_0xce6a('0x38')][_0xce6a('0x3b')]));_0x204d36[_0xce6a('0x39')]=_0x204d36[_0xce6a('0x39')][_0xce6a('0x3c')]?_0x204d36[_0xce6a('0x39')]:_0x2b2f7a[_0xce6a('0x35')];if(!_0x4645ee[_0xce6a('0x38')][_0xce6a('0x3d')]('nolimit')){_0x204d36[_0xce6a('0x21')]=qs['limit'](_0x4645ee[_0xce6a('0x38')][_0xce6a('0x21')]);_0x204d36[_0xce6a('0x20')]=qs[_0xce6a('0x20')](_0x4645ee[_0xce6a('0x38')][_0xce6a('0x20')]);}_0x204d36[_0xce6a('0x59')]=qs[_0xce6a('0x3f')](_0x4645ee[_0xce6a('0x38')][_0xce6a('0x3f')]);_0x204d36[_0xce6a('0x42')]=qs[_0xce6a('0x37')](_[_0xce6a('0x5a')](_0x4645ee[_0xce6a('0x38')],_0x2b2f7a['filters']));_0x204d36['where'][_0xce6a('0x5b')]=_0x1e6324['id'];if(_0x4645ee[_0xce6a('0x38')][_0xce6a('0x40')]){_0x204d36['where']=_[_0xce6a('0x41')](_0x204d36['where'],{'$or':_[_0xce6a('0x2f')](_0x204d36[_0xce6a('0x39')],function(_0x476cbf){var _0x3ce12d={};_0x3ce12d[_0x476cbf]={'$like':'%'+_0x4645ee['query']['filter']+'%'};return _0x3ce12d;})});}_0x204d36=_[_0xce6a('0x41')]({},_0x204d36,_0x4645ee['options']);return db[_0xce6a('0x5c')][_0xce6a('0x46')](_0x204d36);}})[_0xce6a('0x28')](function(_0x2dbcc5){if(_0x2dbcc5){return db[_0xce6a('0x5d')][_0xce6a('0x5e')]({'where':{'id':_[_0xce6a('0x2f')](_0x2dbcc5,'UserId'),'role':_0xce6a('0x5f')},'attributes':['id','name',_0xce6a('0x60'),'updatedAt',_0xce6a('0x61')]});}})['then'](function(_0x238b79){if(_0x238b79){return{'count':_0x238b79[_0xce6a('0x22')],'rows':_['map'](_0x238b79[_0xce6a('0x47')],function(_0x5ba281){return{'membername':_0x5ba281['name'],'UserId':_0x5ba281['id'],'queue_name':_0x775b3a['name'],'WhatsappQueueId':_0x775b3a['id'],'interface':util[_0xce6a('0x62')](_0xce6a('0x63'),_0xce6a('0x64'),_0x5ba281['name']),'penalty':0x0,'paused':_0x5ba281[_0xce6a('0x60')],'createdAt':_0x5ba281[_0xce6a('0x61')],'updatedAt':_0x5ba281[_0xce6a('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb89e51,_0x204d36))[_0xce6a('0x51')](handleError(_0xb89e51,null));};exports[_0xce6a('0x66')]=function(_0x33dfc7,_0x336ef4,_0xc99e8a){var _0x52bb11={};var _0x19fdfc={};var _0x2e91db;var _0x417131;return db[_0xce6a('0x30')][_0xce6a('0x58')]({'where':{'id':_0x33dfc7[_0xce6a('0x55')]['id']}})[_0xce6a('0x28')](handleEntityNotFound(_0x336ef4,null))[_0xce6a('0x28')](function(_0x32c780){if(_0x32c780){_0x2e91db=_0x32c780;_0x19fdfc[_0xce6a('0x35')]=_[_0xce6a('0x49')](db[_0xce6a('0x67')][_0xce6a('0x31')]);_0x19fdfc[_0xce6a('0x38')]=_['keys'](_0x33dfc7[_0xce6a('0x38')]);_0x19fdfc[_0xce6a('0x37')]=_['intersection'](_0x19fdfc['model'],_0x19fdfc[_0xce6a('0x38')]);_0x52bb11['attributes']=_['intersection'](_0x19fdfc[_0xce6a('0x35')],qs['fields'](_0x33dfc7[_0xce6a('0x38')][_0xce6a('0x3b')]));_0x52bb11[_0xce6a('0x39')]=_0x52bb11[_0xce6a('0x39')]['length']?_0x52bb11[_0xce6a('0x39')]:_0x19fdfc['model'];_0x52bb11[_0xce6a('0x59')]=qs[_0xce6a('0x3f')](_0x33dfc7['query'][_0xce6a('0x3f')]);_0x52bb11[_0xce6a('0x42')]=qs[_0xce6a('0x37')](_[_0xce6a('0x5a')](_0x33dfc7[_0xce6a('0x38')],_0x19fdfc['filters']));if(_0x33dfc7[_0xce6a('0x38')][_0xce6a('0x40')]){_0x52bb11[_0xce6a('0x42')]=_[_0xce6a('0x41')](_0x52bb11[_0xce6a('0x42')],{'$or':_[_0xce6a('0x2f')](_0x52bb11[_0xce6a('0x39')],function(_0x483e74){var _0x4d7e8b={};_0x4d7e8b[_0x483e74]={'$like':'%'+_0x33dfc7[_0xce6a('0x38')][_0xce6a('0x40')]+'%'};return _0x4d7e8b;})});}_0x52bb11=_['merge']({},_0x52bb11,_0x33dfc7[_0xce6a('0x44')]);return _0x2e91db['getTeams'](_0x52bb11);}})[_0xce6a('0x28')](function(_0x13ae23){if(_0x13ae23){_0x417131=_0x13ae23[_0xce6a('0x3c')];if(!_0x33dfc7[_0xce6a('0x38')][_0xce6a('0x3d')](_0xce6a('0x3e'))){_0x52bb11['limit']=qs[_0xce6a('0x21')](_0x33dfc7[_0xce6a('0x38')][_0xce6a('0x21')]);_0x52bb11[_0xce6a('0x20')]=qs[_0xce6a('0x20')](_0x33dfc7['query']['offset']);}return _0x2e91db[_0xce6a('0x66')](_0x52bb11);}})['then'](function(_0x7cc32c){if(_0x7cc32c){return _0x7cc32c?{'count':_0x417131,'rows':_0x7cc32c}:null;}})[_0xce6a('0x28')](respondWithResult(_0x336ef4,null))[_0xce6a('0x51')](handleError(_0x336ef4,null));};exports[_0xce6a('0x68')]=function(_0x2594d7,_0x334eb3,_0x58773d){var _0x4aecb1=_0x2594d7[_0xce6a('0x4c')][_0xce6a('0x69')];return db[_0xce6a('0x67')]['findAll']({'where':{'id':_0x4aecb1},'attributes':['id'],'include':[{'model':db[_0xce6a('0x5d')],'as':_0xce6a('0x6a'),'attributes':['id','name',_0xce6a('0x6b'),'voicePause',_0xce6a('0x6c')],'raw':!![]}]})[_0xce6a('0x28')](function(_0x2ebefa){if(_0x2ebefa){var _0x38dbb7=_[_0xce6a('0x6d')](_0x2ebefa,function(_0x1faeea){var _0x922f58=_0x1faeea[_0xce6a('0x2a')]({'plain':!![]});return _0x922f58[_0xce6a('0x6a')];});return db[_0xce6a('0x30')][_0xce6a('0x4a')]({'where':{'id':_0x2594d7[_0xce6a('0x55')]['id']}})['then'](function(_0x5bedbe){return db[_0xce6a('0x6e')][_0xce6a('0x6f')](function(_0x1a1eb3){return _0x5bedbe[_0xce6a('0x68')](_0x4aecb1,{'transaction':_0x1a1eb3})[_0xce6a('0x28')](function(){return BPromise[_0xce6a('0x70')](_0x38dbb7,function(_0x5a7f3f){return db['UserWhatsappQueue'][_0xce6a('0x71')]({'where':{'UserId':_0x5a7f3f['id'],'WhatsappQueueId':_0x2594d7[_0xce6a('0x55')]['id']},'transaction':_0x1a1eb3});});})[_0xce6a('0x28')](function(){_0x38dbb7[_0xce6a('0x72')](function(_0x5a7fe9){socket[_0xce6a('0x73')]('userWhatsappQueue:save',{'UserId':_0x5a7fe9['id'],'WhatsappQueueId':_0x5bedbe['id']});});});});});}})[_0xce6a('0x28')](respondWithStatusCode(_0x334eb3,null))[_0xce6a('0x51')](handleError(_0x334eb3,null));};exports[_0xce6a('0x74')]=function(_0x486244,_0x5d8ab5,_0x319f3d){return db[_0xce6a('0x67')][_0xce6a('0x46')]({'where':{'id':_0x486244[_0xce6a('0x38')][_0xce6a('0x69')]},'attributes':['id'],'include':[{'model':db[_0xce6a('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xce6a('0x28')](handleEntityNotFound(_0x5d8ab5,null))[_0xce6a('0x28')](function(_0x4d750c){var _0x224234=_['map'](_0x4d750c,'id');var _0x160e1d=[];var _0x12a249=[];var _0x3f0ff9=squel['select']();_0x3f0ff9[_0xce6a('0x75')](_0xce6a('0x76'))[_0xce6a('0x77')](_0xce6a('0x78'),'tq')[_0xce6a('0x79')](_0xce6a('0x7a'),'ut',_0xce6a('0x7b'))[_0xce6a('0x42')](_0xce6a('0x7c'),_0x486244[_0xce6a('0x55')]['id']);for(var _0x26a06c=0x0;_0x26a06c<_0x4d750c[_0xce6a('0x3c')];_0x26a06c+=0x1){let _0x47a102=_0x4d750c[_0x26a06c];for(var _0x1326fb=0x0;_0x1326fb<_0x47a102[_0xce6a('0x6a')]['length'];_0x1326fb+=0x1){let _0x377969=_0x47a102[_0xce6a('0x6a')][_0x1326fb];var _0x418b69=_0x3f0ff9[_0xce6a('0x7d')]();_0x418b69[_0xce6a('0x42')]('ut.UserId\x20=\x20?',_0x377969['id']);_0x12a249[_0xce6a('0x7e')](db[_0xce6a('0x6e')]['query'](_0x418b69[_0xce6a('0x7f')](),{'type':db[_0xce6a('0x6e')][_0xce6a('0x80')][_0xce6a('0x81')]})[_0xce6a('0x28')](function(_0x3fdedb){if(_0x3fdedb['length']===0x1){return _0x377969['id'];}else{var _0x4cedb6=_[_0xce6a('0x82')](_[_0xce6a('0x2f')](_0x3fdedb,_0xce6a('0x83')),function(_0x2461fc){return _['includes'](_0x224234,_0x2461fc);});if(_0x4cedb6){return _0x377969['id'];}}}));}}return BPromise[_0xce6a('0x84')](_0x12a249)[_0xce6a('0x28')](function(_0x2f8bc9){_0x160e1d=_(_0x160e1d)['union'](_0x2f8bc9)[_0xce6a('0x85')]()[_0xce6a('0x86')]();return db['WhatsappQueue'][_0xce6a('0x4a')]({'where':{'id':_0x486244[_0xce6a('0x55')]['id']}})[_0xce6a('0x28')](function(_0x2d5036){return db['sequelize']['transaction'](function(_0x24652d){return _0x2d5036[_0xce6a('0x74')](_0x486244[_0xce6a('0x38')][_0xce6a('0x69')],{'transaction':_0x24652d})['then'](function(){if(!_[_0xce6a('0x87')](_0x160e1d)){return _0x2d5036[_0xce6a('0x88')](_0x160e1d,{'transaction':_0x24652d});}})[_0xce6a('0x28')](function(){_0x160e1d[_0xce6a('0x72')](function(_0xf788e9){socket[_0xce6a('0x73')](_0xce6a('0x89'),{'UserId':_0xf788e9,'WhatsappQueueId':_0x2d5036['id']});});});});});});})[_0xce6a('0x28')](respondWithStatusCode(_0x5d8ab5,null))[_0xce6a('0x51')](handleError(_0x5d8ab5,null));};exports[_0xce6a('0x8a')]=function(_0x48eada,_0x1b8615,_0x57b2d9){return db[_0xce6a('0x30')][_0xce6a('0x4a')]({'where':{'id':_0x48eada[_0xce6a('0x55')]['id']}})[_0xce6a('0x28')](handleEntityNotFound(_0x1b8615,null))['then'](function(_0x5daa49){if(_0x5daa49){return _0x5daa49['addAgents'](_0x48eada[_0xce6a('0x4c')]['ids'],_[_0xce6a('0x8b')](_0x48eada[_0xce6a('0x4c')],['ids','id'])||{})['spread'](function(_0x184d8a){for(var _0x259013=0x0;_0x259013<_0x48eada[_0xce6a('0x4c')]['ids'][_0xce6a('0x3c')];_0x259013+=0x1){socket[_0xce6a('0x73')](_0xce6a('0x8c'),{'UserId':Number(_0x48eada[_0xce6a('0x4c')][_0xce6a('0x69')][_0x259013]),'WhatsappQueueId':Number(_0x48eada['params']['id'])});}return _0x184d8a;});}})['then'](respondWithResult(_0x1b8615,null))[_0xce6a('0x51')](handleError(_0x1b8615,null));};exports['removeAgents']=function(_0x1a895d,_0x1c9da4,_0x29a14a){return db[_0xce6a('0x30')]['find']({'where':{'id':_0x1a895d[_0xce6a('0x55')]['id']}})['then'](handleEntityNotFound(_0x1c9da4,null))[_0xce6a('0x28')](function(_0x60cf4b){if(_0x60cf4b){return _0x60cf4b[_0xce6a('0x88')](_0x1a895d[_0xce6a('0x38')][_0xce6a('0x69')])[_0xce6a('0x28')](function(){if(_[_0xce6a('0x8d')](_0x1a895d[_0xce6a('0x38')]['ids'])){for(var _0x5b0911=0x0;_0x5b0911<_0x1a895d[_0xce6a('0x38')][_0xce6a('0x69')][_0xce6a('0x3c')];_0x5b0911+=0x1){socket[_0xce6a('0x73')](_0xce6a('0x89'),{'UserId':Number(_0x1a895d[_0xce6a('0x38')][_0xce6a('0x69')][_0x5b0911]),'WhatsappQueueId':Number(_0x1a895d[_0xce6a('0x55')]['id'])});}}else{socket[_0xce6a('0x73')](_0xce6a('0x89'),{'UserId':Number(_0x1a895d[_0xce6a('0x38')]['ids']),'WhatsappQueueId':Number(_0x1a895d[_0xce6a('0x55')]['id'])});}});}})[_0xce6a('0x28')](respondWithStatusCode(_0x1c9da4,null))[_0xce6a('0x51')](handleError(_0x1c9da4,null));};exports['getAgents']=function(_0x4e77b8,_0x15d6d9,_0x147274){var _0x1c5246={};var _0x4c4363={};var _0x579567;var _0x25ef79;return db[_0xce6a('0x30')][_0xce6a('0x58')]({'where':{'id':_0x4e77b8[_0xce6a('0x55')]['id']}})['then'](handleEntityNotFound(_0x15d6d9,null))[_0xce6a('0x28')](function(_0x189b1a){if(_0x189b1a){_0x579567=_0x189b1a;_0x4c4363[_0xce6a('0x35')]=_[_0xce6a('0x49')](db[_0xce6a('0x5d')][_0xce6a('0x31')]);_0x4c4363[_0xce6a('0x38')]=_[_0xce6a('0x49')](_0x4e77b8[_0xce6a('0x38')]);_0x4c4363[_0xce6a('0x37')]=_['intersection'](_0x4c4363[_0xce6a('0x35')],_0x4c4363[_0xce6a('0x38')]);_0x1c5246['attributes']=_[_0xce6a('0x3a')](_0x4c4363['model'],qs[_0xce6a('0x3b')](_0x4e77b8[_0xce6a('0x38')]['fields']));_0x1c5246['attributes']=_0x1c5246[_0xce6a('0x39')][_0xce6a('0x3c')]?_0x1c5246['attributes']:_0x4c4363['model'];_0x1c5246[_0xce6a('0x59')]=qs[_0xce6a('0x3f')](_0x4e77b8['query']['sort']);_0x1c5246[_0xce6a('0x42')]=qs[_0xce6a('0x37')](_[_0xce6a('0x5a')](_0x4e77b8['query'],_0x4c4363[_0xce6a('0x37')]));if(_0x4e77b8[_0xce6a('0x38')]['filter']){_0x1c5246[_0xce6a('0x42')]=_[_0xce6a('0x41')](_0x1c5246['where'],{'$or':_[_0xce6a('0x2f')](_0x1c5246[_0xce6a('0x39')],function(_0x4768f7){var _0x4db0e7={};_0x4db0e7[_0x4768f7]={'$like':'%'+_0x4e77b8[_0xce6a('0x38')][_0xce6a('0x40')]+'%'};return _0x4db0e7;})});}_0x1c5246=_['merge']({},_0x1c5246,_0x4e77b8[_0xce6a('0x44')]);return _0x579567[_0xce6a('0x8e')](_0x1c5246);}})[_0xce6a('0x28')](function(_0xecdb43){if(_0xecdb43){_0x25ef79=_0xecdb43[_0xce6a('0x3c')];if(!_0x4e77b8[_0xce6a('0x38')][_0xce6a('0x3d')](_0xce6a('0x3e'))){_0x1c5246[_0xce6a('0x21')]=qs[_0xce6a('0x21')](_0x4e77b8[_0xce6a('0x38')][_0xce6a('0x21')]);_0x1c5246['offset']=qs[_0xce6a('0x20')](_0x4e77b8['query'][_0xce6a('0x20')]);}return _0x579567[_0xce6a('0x8e')](_0x1c5246);}})[_0xce6a('0x28')](function(_0x2ca294){if(_0x2ca294){return _0x2ca294?{'count':_0x25ef79,'rows':_0x2ca294}:null;}})[_0xce6a('0x28')](respondWithResult(_0x15d6d9,null))[_0xce6a('0x51')](handleError(_0x15d6d9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index cf4aebb..58dcdec 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 _0xa265=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2f95b9,_0x56b270){var _0x2b31e2=function(_0x821258){while(--_0x821258){_0x2f95b9['push'](_0x2f95b9['shift']());}};_0x2b31e2(++_0x56b270);}(_0xa265,0x189));var _0x5a26=function(_0xc1d5b5,_0x5a2aba){_0xc1d5b5=_0xc1d5b5-0x0;var _0x451864=_0xa265[_0xc1d5b5];return _0x451864;};'use strict';var EventEmitter=require(_0x5a26('0x0'));var WhatsappQueue=require(_0x5a26('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5a26('0x2')](0x0);var events={'afterCreate':_0x5a26('0x3'),'afterUpdate':_0x5a26('0x4'),'afterDestroy':_0x5a26('0x5')};function emitEvent(_0x2567d9){return function(_0x25da3d,_0x4704cd,_0x5e11c7){WhatsappQueueEvents['emit'](_0x2567d9+':'+_0x25da3d['id'],_0x25da3d);WhatsappQueueEvents[_0x5a26('0x6')](_0x2567d9,_0x25da3d);_0x5e11c7(null);};}for(var e in events){if(events[_0x5a26('0x7')](e)){var event=events[e];WhatsappQueue[_0x5a26('0x8')](e,emitEvent(event));}}module[_0x5a26('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xfa78=['hook','events','WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x39d258,_0x586ab4){var _0x2d15b2=function(_0x1b58e9){while(--_0x1b58e9){_0x39d258['push'](_0x39d258['shift']());}};_0x2d15b2(++_0x586ab4);}(_0xfa78,0x1e1));var _0x8fa7=function(_0x55680d,_0x1f6c6a){_0x55680d=_0x55680d-0x0;var _0x1be761=_0xfa78[_0x55680d];return _0x1be761;};'use strict';var EventEmitter=require(_0x8fa7('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x8fa7('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8fa7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fa7('0x3'),'afterDestroy':_0x8fa7('0x4')};function emitEvent(_0x922820){return function(_0x596b58,_0x45d32a,_0x768b87){WhatsappQueueEvents[_0x8fa7('0x5')](_0x922820+':'+_0x596b58['id'],_0x596b58);WhatsappQueueEvents[_0x8fa7('0x5')](_0x922820,_0x596b58);_0x768b87(null);};}for(var e in events){if(events[_0x8fa7('0x6')](e)){var event=events[e];WhatsappQueue[_0x8fa7('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 7e9e397..4fabc2c 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 _0x6ca4=['moment','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','api'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x6ca4,0x14b));var _0x46ca=function(_0x238f5f,_0x10c60a){_0x238f5f=_0x238f5f-0x0;var _0x181f3f=_0x6ca4[_0x238f5f];return _0x181f3f;};'use strict';var _=require(_0x46ca('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x46ca('0x1'));var moment=require(_0x46ca('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46ca('0x3'));var rimraf=require(_0x46ca('0x4'));var config=require('../../config/environment');var attributes=require(_0x46ca('0x5'));module[_0x46ca('0x6')]=function(_0x5d16d0,_0x30b3f0){return _0x5d16d0[_0x46ca('0x7')](_0x46ca('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb18f=['whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','./whatsappQueue.attributes','exports','define'];(function(_0x42cbc7,_0x203a8a){var _0x2c17cb=function(_0x4463ba){while(--_0x4463ba){_0x42cbc7['push'](_0x42cbc7['shift']());}};_0x2c17cb(++_0x203a8a);}(_0xb18f,0x17d));var _0xfb18=function(_0x5acd7e,_0x4327ab){_0x5acd7e=_0x5acd7e-0x0;var _0x34abfc=_0xb18f[_0x5acd7e];return _0x34abfc;};'use strict';var _=require(_0xfb18('0x0'));var util=require(_0xfb18('0x1'));var logger=require(_0xfb18('0x2'))(_0xfb18('0x3'));var moment=require(_0xfb18('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb18('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb18('0x6'));module[_0xfb18('0x7')]=function(_0x223bcf,_0x1105ad){return _0x223bcf[_0xfb18('0x8')]('WhatsappQueue',attributes,{'tableName':_0xfb18('0x9'),'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 8656889..a1f52c8 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 _0xf3ca=['debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','map','model','ShowWhatsappQueue','find','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3f9869,_0x534743){var _0x5816e2=function(_0x4e75ce){while(--_0x4e75ce){_0x3f9869['push'](_0x3f9869['shift']());}};_0x5816e2(++_0x534743);}(_0xf3ca,0xd5));var _0xaf3c=function(_0x27d29e,_0x46ddcc){_0x27d29e=_0x27d29e-0x0;var _0x174321=_0xf3ca[_0x27d29e];return _0x174321;};'use strict';var _=require(_0xaf3c('0x0'));var util=require(_0xaf3c('0x1'));var moment=require(_0xaf3c('0x2'));var BPromise=require(_0xaf3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf3c('0x4'))['db'];var utils=require(_0xaf3c('0x5'));var logger=require(_0xaf3c('0x6'))(_0xaf3c('0x7'));var config=require(_0xaf3c('0x8'));var jayson=require(_0xaf3c('0x9'));var client=jayson['client'][_0xaf3c('0xa')]({'port':0x232a});config[_0xaf3c('0xb')]=_[_0xaf3c('0xc')](config[_0xaf3c('0xb')],{'host':_0xaf3c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf3c('0xb')]));require(_0xaf3c('0xe'))[_0xaf3c('0xf')](socket);function respondWithRpcPromise(_0x24ce62,_0x2726d1,_0x2bbb9f){return new BPromise(function(_0x42c56f,_0x5136a6){return client[_0xaf3c('0x10')](_0x24ce62,_0x2bbb9f)[_0xaf3c('0x11')](function(_0x5f0d24){logger[_0xaf3c('0x12')](_0xaf3c('0x13'),_0x2726d1,_0xaf3c('0x14'));logger[_0xaf3c('0x15')](_0xaf3c('0x16'),_0x2726d1,_0xaf3c('0x14'),JSON[_0xaf3c('0x17')](_0x5f0d24));if(_0x5f0d24[_0xaf3c('0x18')]){if(_0x5f0d24[_0xaf3c('0x18')]['code']===0x1f4){logger['error'](_0xaf3c('0x13'),_0x2726d1,_0x5f0d24[_0xaf3c('0x18')]['message']);return _0x5136a6(_0x5f0d24[_0xaf3c('0x18')][_0xaf3c('0x19')]);}logger['error'](_0xaf3c('0x13'),_0x2726d1,_0x5f0d24[_0xaf3c('0x18')][_0xaf3c('0x19')]);return _0x42c56f(_0x5f0d24['error'][_0xaf3c('0x19')]);}else{logger['info'](_0xaf3c('0x13'),_0x2726d1,'request\x20sent');_0x42c56f(_0x5f0d24['result'][_0xaf3c('0x19')]);}})[_0xaf3c('0x1a')](function(_0x335d66){logger['error'](_0xaf3c('0x13'),_0x2726d1,_0x335d66);_0x5136a6(_0x335d66);});});}exports[_0xaf3c('0x1b')]=function(_0xeab4c2){var _0x30cc48=this;return new Promise(function(_0x313d19,_0x391fa9){return db[_0xaf3c('0x1c')][_0xaf3c('0x1d')]({'raw':_0xeab4c2[_0xaf3c('0x1e')]?_0xeab4c2[_0xaf3c('0x1e')][_0xaf3c('0x1f')]===undefined?!![]:![]:!![],'where':_0xeab4c2[_0xaf3c('0x1e')]?_0xeab4c2[_0xaf3c('0x1e')]['where']||null:null,'attributes':_0xeab4c2[_0xaf3c('0x1e')]?_0xeab4c2['options'][_0xaf3c('0x20')]||null:null,'limit':_0xeab4c2[_0xaf3c('0x1e')]?_0xeab4c2[_0xaf3c('0x1e')]['limit']||null:null,'include':_0xeab4c2[_0xaf3c('0x1e')]?_0xeab4c2[_0xaf3c('0x1e')][_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0xeab4c2['options'][_0xaf3c('0x21')],function(_0x1e8ae7){return{'model':db[_0x1e8ae7[_0xaf3c('0x23')]],'as':_0x1e8ae7['as'],'attributes':_0x1e8ae7['attributes'],'include':_0x1e8ae7[_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0x1e8ae7['include'],function(_0x1cee87){return{'model':db[_0x1cee87['model']],'as':_0x1cee87['as'],'attributes':_0x1cee87['attributes'],'include':_0x1cee87['include']?_[_0xaf3c('0x22')](_0x1cee87[_0xaf3c('0x21')],function(_0x4e2e98){return{'model':db[_0x4e2e98[_0xaf3c('0x23')]],'as':_0x4e2e98['as'],'attributes':_0x4e2e98['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x13ad7b){logger['info'](_0xaf3c('0x1b'),_0xeab4c2);logger[_0xaf3c('0x15')](_0xaf3c('0x1b'),_0xeab4c2,JSON[_0xaf3c('0x17')](_0x13ad7b));_0x313d19(_0x13ad7b);})[_0xaf3c('0x1a')](function(_0x3d562c){logger[_0xaf3c('0x18')](_0xaf3c('0x1b'),_0x3d562c[_0xaf3c('0x19')],_0xeab4c2);_0x391fa9(_0x30cc48[_0xaf3c('0x18')](0x1f4,_0x3d562c[_0xaf3c('0x19')]));});});};exports[_0xaf3c('0x24')]=function(_0x46436a){var _0x22d21f=this;return new Promise(function(_0x4d272e,_0x1b7918){return db[_0xaf3c('0x1c')][_0xaf3c('0x25')]({'raw':_0x46436a[_0xaf3c('0x1e')]?_0x46436a[_0xaf3c('0x1e')][_0xaf3c('0x1f')]===undefined?!![]:![]:!![],'where':_0x46436a['options']?_0x46436a[_0xaf3c('0x1e')][_0xaf3c('0x26')]||null:null,'attributes':_0x46436a[_0xaf3c('0x1e')]?_0x46436a[_0xaf3c('0x1e')][_0xaf3c('0x20')]||null:null,'include':_0x46436a[_0xaf3c('0x1e')]?_0x46436a[_0xaf3c('0x1e')]['include']?_[_0xaf3c('0x22')](_0x46436a[_0xaf3c('0x1e')][_0xaf3c('0x21')],function(_0x49fd8b){return{'model':db[_0x49fd8b['model']],'as':_0x49fd8b['as'],'attributes':_0x49fd8b[_0xaf3c('0x20')],'include':_0x49fd8b[_0xaf3c('0x21')]?_['map'](_0x49fd8b[_0xaf3c('0x21')],function(_0x16e01c){return{'model':db[_0x16e01c[_0xaf3c('0x23')]],'as':_0x16e01c['as'],'attributes':_0x16e01c[_0xaf3c('0x20')],'include':_0x16e01c[_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0x16e01c[_0xaf3c('0x21')],function(_0x257b54){return{'model':db[_0x257b54[_0xaf3c('0x23')]],'as':_0x257b54['as'],'attributes':_0x257b54[_0xaf3c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaf3c('0x11')](function(_0x6c63c4){logger[_0xaf3c('0x12')](_0xaf3c('0x24'),_0x46436a);logger[_0xaf3c('0x15')](_0xaf3c('0x24'),_0x46436a,JSON[_0xaf3c('0x17')](_0x6c63c4));_0x4d272e(_0x6c63c4);})[_0xaf3c('0x1a')](function(_0x3c7101){logger[_0xaf3c('0x18')](_0xaf3c('0x24'),_0x3c7101['message'],_0x46436a);_0x1b7918(_0x22d21f[_0xaf3c('0x18')](0x1f4,_0x3c7101['message']));});});}; \ No newline at end of file +var _0xb1e1=['request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s'];(function(_0x4d37b6,_0x435a80){var _0x4da88b=function(_0x5d19b6){while(--_0x5d19b6){_0x4d37b6['push'](_0x4d37b6['shift']());}};_0x4da88b(++_0x435a80);}(_0xb1e1,0x110));var _0x1b1e=function(_0x1a2e2c,_0x4f69a3){_0x1a2e2c=_0x1a2e2c-0x0;var _0x31075e=_0xb1e1[_0x1a2e2c];return _0x31075e;};'use strict';var _=require(_0x1b1e('0x0'));var util=require(_0x1b1e('0x1'));var moment=require(_0x1b1e('0x2'));var BPromise=require(_0x1b1e('0x3'));var rs=require(_0x1b1e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b1e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b1e('0x6'))(_0x1b1e('0x7'));var config=require(_0x1b1e('0x8'));var jayson=require(_0x1b1e('0x9'));var client=jayson[_0x1b1e('0xa')][_0x1b1e('0xb')]({'port':0x232a});config['redis']=_[_0x1b1e('0xc')](config[_0x1b1e('0xd')],{'host':_0x1b1e('0xe'),'port':0x18eb});var socket=require(_0x1b1e('0xf'))(new Redis(config[_0x1b1e('0xd')]));require(_0x1b1e('0x10'))[_0x1b1e('0x11')](socket);function respondWithRpcPromise(_0x2e8b06,_0x12a957,_0x3df058){return new BPromise(function(_0x2ad65d,_0x350d0c){return client[_0x1b1e('0x12')](_0x2e8b06,_0x3df058)[_0x1b1e('0x13')](function(_0xb00f72){logger[_0x1b1e('0x14')](_0x1b1e('0x15'),_0x12a957,_0x1b1e('0x16'));logger[_0x1b1e('0x17')](_0x1b1e('0x18'),_0x12a957,_0x1b1e('0x16'),JSON[_0x1b1e('0x19')](_0xb00f72));if(_0xb00f72[_0x1b1e('0x1a')]){if(_0xb00f72[_0x1b1e('0x1a')]['code']===0x1f4){logger['error'](_0x1b1e('0x15'),_0x12a957,_0xb00f72[_0x1b1e('0x1a')][_0x1b1e('0x1b')]);return _0x350d0c(_0xb00f72[_0x1b1e('0x1a')][_0x1b1e('0x1b')]);}logger[_0x1b1e('0x1a')](_0x1b1e('0x15'),_0x12a957,_0xb00f72[_0x1b1e('0x1a')][_0x1b1e('0x1b')]);return _0x2ad65d(_0xb00f72[_0x1b1e('0x1a')]['message']);}else{logger[_0x1b1e('0x14')](_0x1b1e('0x15'),_0x12a957,_0x1b1e('0x16'));_0x2ad65d(_0xb00f72['result'][_0x1b1e('0x1b')]);}})[_0x1b1e('0x1c')](function(_0xfa4449){logger[_0x1b1e('0x1a')](_0x1b1e('0x15'),_0x12a957,_0xfa4449);_0x350d0c(_0xfa4449);});});}exports[_0x1b1e('0x1d')]=function(_0x53868f){var _0x449d1f=this;return new Promise(function(_0x54f5eb,_0x24263c){return db[_0x1b1e('0x1e')][_0x1b1e('0x1f')]({'raw':_0x53868f[_0x1b1e('0x20')]?_0x53868f[_0x1b1e('0x20')][_0x1b1e('0x21')]===undefined?!![]:![]:!![],'where':_0x53868f[_0x1b1e('0x20')]?_0x53868f['options'][_0x1b1e('0x22')]||null:null,'attributes':_0x53868f[_0x1b1e('0x20')]?_0x53868f[_0x1b1e('0x20')][_0x1b1e('0x23')]||null:null,'limit':_0x53868f[_0x1b1e('0x20')]?_0x53868f['options'][_0x1b1e('0x24')]||null:null,'include':_0x53868f[_0x1b1e('0x20')]?_0x53868f[_0x1b1e('0x20')][_0x1b1e('0x25')]?_[_0x1b1e('0x26')](_0x53868f[_0x1b1e('0x20')][_0x1b1e('0x25')],function(_0x585c41){return{'model':db[_0x585c41[_0x1b1e('0x27')]],'as':_0x585c41['as'],'attributes':_0x585c41[_0x1b1e('0x23')],'include':_0x585c41['include']?_[_0x1b1e('0x26')](_0x585c41[_0x1b1e('0x25')],function(_0x225958){return{'model':db[_0x225958[_0x1b1e('0x27')]],'as':_0x225958['as'],'attributes':_0x225958['attributes'],'include':_0x225958[_0x1b1e('0x25')]?_[_0x1b1e('0x26')](_0x225958[_0x1b1e('0x25')],function(_0x46a309){return{'model':db[_0x46a309[_0x1b1e('0x27')]],'as':_0x46a309['as'],'attributes':_0x46a309[_0x1b1e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1b1e('0x13')](function(_0x42088e){logger[_0x1b1e('0x14')](_0x1b1e('0x1d'),_0x53868f);logger[_0x1b1e('0x17')](_0x1b1e('0x1d'),_0x53868f,JSON[_0x1b1e('0x19')](_0x42088e));_0x54f5eb(_0x42088e);})[_0x1b1e('0x1c')](function(_0x2052e6){logger['error']('GetWhatsappQueue',_0x2052e6[_0x1b1e('0x1b')],_0x53868f);_0x24263c(_0x449d1f[_0x1b1e('0x1a')](0x1f4,_0x2052e6['message']));});});};exports[_0x1b1e('0x28')]=function(_0x3256c7){var _0x4bbed4=this;return new Promise(function(_0x134666,_0x33dded){return db[_0x1b1e('0x1e')][_0x1b1e('0x29')]({'raw':_0x3256c7[_0x1b1e('0x20')]?_0x3256c7['options']['raw']===undefined?!![]:![]:!![],'where':_0x3256c7['options']?_0x3256c7['options']['where']||null:null,'attributes':_0x3256c7[_0x1b1e('0x20')]?_0x3256c7[_0x1b1e('0x20')][_0x1b1e('0x23')]||null:null,'include':_0x3256c7[_0x1b1e('0x20')]?_0x3256c7['options'][_0x1b1e('0x25')]?_['map'](_0x3256c7[_0x1b1e('0x20')]['include'],function(_0x4c2ae3){return{'model':db[_0x4c2ae3[_0x1b1e('0x27')]],'as':_0x4c2ae3['as'],'attributes':_0x4c2ae3[_0x1b1e('0x23')],'include':_0x4c2ae3[_0x1b1e('0x25')]?_[_0x1b1e('0x26')](_0x4c2ae3['include'],function(_0x27bec6){return{'model':db[_0x27bec6[_0x1b1e('0x27')]],'as':_0x27bec6['as'],'attributes':_0x27bec6[_0x1b1e('0x23')],'include':_0x27bec6[_0x1b1e('0x25')]?_['map'](_0x27bec6[_0x1b1e('0x25')],function(_0x5e3197){return{'model':db[_0x5e3197[_0x1b1e('0x27')]],'as':_0x5e3197['as'],'attributes':_0x5e3197[_0x1b1e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1b1e('0x13')](function(_0x5477fe){logger[_0x1b1e('0x14')](_0x1b1e('0x28'),_0x3256c7);logger[_0x1b1e('0x17')](_0x1b1e('0x28'),_0x3256c7,JSON[_0x1b1e('0x19')](_0x5477fe));_0x134666(_0x5477fe);})[_0x1b1e('0x1c')](function(_0x12b44e){logger[_0x1b1e('0x1a')](_0x1b1e('0x28'),_0x12b44e[_0x1b1e('0x1b')],_0x3256c7);_0x33dded(_0x4bbed4[_0x1b1e('0x1a')](0x1f4,_0x12b44e[_0x1b1e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a185e5b..fb674ec 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 _0xc387=['length','save','update','emit','removeListener','register'];(function(_0x340d75,_0x561cb0){var _0x3f1114=function(_0x2e2bcf){while(--_0x2e2bcf){_0x340d75['push'](_0x340d75['shift']());}};_0x3f1114(++_0x561cb0);}(_0xc387,0x139));var _0x7c38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc387[_0x14add3];return _0x4a174f;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x7c38('0x0'),'remove',_0x7c38('0x1')];function createListener(_0x4862c8,_0x4bd134){return function(_0xefe2fd){_0x4bd134[_0x7c38('0x2')](_0x4862c8,_0xefe2fd);};}function removeListener(_0x2bfe0f,_0x475838){return function(){WhatsappQueueEvents[_0x7c38('0x3')](_0x2bfe0f,_0x475838);};}exports[_0x7c38('0x4')]=function(_0x82f6b3){for(var _0x3804a6=0x0,_0x509024=events[_0x7c38('0x5')];_0x3804a6<_0x509024;_0x3804a6++){var _0x2384fd=events[_0x3804a6];var _0x5ac3fb=createListener('whatsappQueue:'+_0x2384fd,_0x82f6b3);WhatsappQueueEvents['on'](_0x2384fd,_0x5ac3fb);}}; \ No newline at end of file +var _0x787e=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener'];(function(_0x42920d,_0xd21566){var _0x33ed7a=function(_0x53154b){while(--_0x53154b){_0x42920d['push'](_0x42920d['shift']());}};_0x33ed7a(++_0xd21566);}(_0x787e,0xdf));var _0xe787=function(_0x59a76d,_0x33622c){_0x59a76d=_0x59a76d-0x0;var _0x569638=_0x787e[_0x59a76d];return _0x569638;};'use strict';var WhatsappQueueEvents=require(_0xe787('0x0'));var events=[_0xe787('0x1'),'remove',_0xe787('0x2')];function createListener(_0x1c8c72,_0x2ea053){return function(_0x568241){_0x2ea053[_0xe787('0x3')](_0x1c8c72,_0x568241);};}function removeListener(_0x379a3f,_0x51b2b4){return function(){WhatsappQueueEvents[_0xe787('0x4')](_0x379a3f,_0x51b2b4);};}exports['register']=function(_0xe7e477){for(var _0x22bcfc=0x0,_0x3d47a6=events['length'];_0x22bcfc<_0x3d47a6;_0x22bcfc++){var _0x597480=events[_0x22bcfc];var _0x219a87=createListener(_0xe787('0x5')+_0x597480,_0xe7e477);WhatsappQueueEvents['on'](_0x597480,_0x219a87);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 499ed0e..56ca741 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 _0x76d3=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','index','get','isAuthenticated','describe','post','create','put','/:id','update','delete'];(function(_0x2d3b02,_0x54663b){var _0x49f7a0=function(_0x3b2ecb){while(--_0x3b2ecb){_0x2d3b02['push'](_0x2d3b02['shift']());}};_0x49f7a0(++_0x54663b);}(_0x76d3,0x66));var _0x376d=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x76d3[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x376d('0x0'));var path=require(_0x376d('0x1'));var timeout=require(_0x376d('0x2'));var express=require(_0x376d('0x3'));var router=express[_0x376d('0x4')]();var fs_extra=require(_0x376d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x376d('0x6'));var controller=require(_0x376d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x376d('0x8')]);router[_0x376d('0x9')]('/describe',auth[_0x376d('0xa')](),controller[_0x376d('0xb')]);router[_0x376d('0x9')]('/:id',auth[_0x376d('0xa')](),controller['show']);router[_0x376d('0xc')]('/',auth['isAuthenticated'](),controller[_0x376d('0xd')]);router[_0x376d('0xe')](_0x376d('0xf'),auth[_0x376d('0xa')](),controller[_0x376d('0x10')]);router[_0x376d('0x11')](_0x376d('0xf'),auth['isAuthenticated'](),controller[_0x376d('0x12')]);module[_0x376d('0x13')]=router; \ No newline at end of file +var _0x4bdd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e01e7,_0x4a111a){var _0xb8fce2=function(_0x1b93e7){while(--_0x1b93e7){_0x1e01e7['push'](_0x1e01e7['shift']());}};_0xb8fce2(++_0x4a111a);}(_0x4bdd,0x68));var _0xd4bd=function(_0x177e48,_0x64cfb9){_0x177e48=_0x177e48-0x0;var _0x1101a0=_0x4bdd[_0x177e48];return _0x1101a0;};'use strict';var multer=require('multer');var util=require(_0xd4bd('0x0'));var path=require(_0xd4bd('0x1'));var timeout=require(_0xd4bd('0x2'));var express=require(_0xd4bd('0x3'));var router=express[_0xd4bd('0x4')]();var fs_extra=require(_0xd4bd('0x5'));var auth=require(_0xd4bd('0x6'));var interaction=require(_0xd4bd('0x7'));var config=require(_0xd4bd('0x8'));var controller=require(_0xd4bd('0x9'));router[_0xd4bd('0xa')]('/',auth[_0xd4bd('0xb')](),controller[_0xd4bd('0xc')]);router[_0xd4bd('0xa')](_0xd4bd('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xd4bd('0xa')](_0xd4bd('0xe'),auth['isAuthenticated'](),controller[_0xd4bd('0xf')]);router[_0xd4bd('0x10')]('/',auth['isAuthenticated'](),controller[_0xd4bd('0x11')]);router[_0xd4bd('0x12')](_0xd4bd('0xe'),auth[_0xd4bd('0xb')](),controller['update']);router[_0xd4bd('0x13')](_0xd4bd('0xe'),auth['isAuthenticated'](),controller[_0xd4bd('0x14')]);module[_0xd4bd('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 45aedbc..cf49536 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x357ff3,_0xc093b8){var _0x4a2ea7=function(_0x2369b2){while(--_0x2369b2){_0x357ff3['push'](_0x357ff3['shift']());}};_0x4a2ea7(++_0xc093b8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1c8f47,_0x53d16e){var _0x3e02fa=function(_0xde56f6){while(--_0xde56f6){_0x1c8f47['push'](_0x1c8f47['shift']());}};_0x3e02fa(++_0x53d16e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 e733736..c908727 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 _0x9348=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','WhatsappQueueReport','count','include','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../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','limit','undefined','set','apply','reject'];(function(_0x2c280a,_0x2105d2){var _0x48a760=function(_0x1bbd1d){while(--_0x1bbd1d){_0x2c280a['push'](_0x2c280a['shift']());}};_0x48a760(++_0x2105d2);}(_0x9348,0x10d));var _0x8934=function(_0x4f800e,_0x526855){_0x4f800e=_0x4f800e-0x0;var _0x3b6520=_0x9348[_0x4f800e];return _0x3b6520;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['WhatsappQueueReport'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['WhatsappQueueReport'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));};exports['describe']=function(_0xce93cd,_0x2778f9){return db[_0x8934('0x40')][_0x8934('0x4b')]()[_0x8934('0x25')](respondWithResult(_0x2778f9,null))[_0x8934('0x48')](handleError(_0x2778f9,null));}; \ No newline at end of file +var _0xb9a7=['include','rows','catch','show','params','rawAttributes','intersection','create','body','describe','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x5d011f,_0x3330f0){var _0x4c3366=function(_0x20b7f0){while(--_0x20b7f0){_0x5d011f['push'](_0x5d011f['shift']());}};_0x4c3366(++_0x3330f0);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb9a7[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)[_0x7b9a('0x15')]();});}};}function handleEntityNotFound(_0x23219e,_0x5809f5){return function(_0x39b7ec){if(!_0x39b7ec){_0x23219e['sendStatus'](0x194);}return _0x39b7ec;};}function handleError(_0x31eb67,_0x3091ab){_0x3091ab=_0x3091ab||0x1f4;return function(_0x4c2271){logger['error'](_0x4c2271[_0x7b9a('0x20')]);if(_0x4c2271['name']){delete _0x4c2271['name'];}_0x31eb67[_0x7b9a('0x14')](_0x3091ab)['send'](_0x4c2271);};}exports['index']=function(_0x3847b4,_0x4d5880){var _0x5c89b6={},_0x314b6d={},_0x4fee38={'count':0x0,'rows':[]};var _0x1553ae=_[_0x7b9a('0x21')](db[_0x7b9a('0x22')]['rawAttributes'],function(_0x45ccf5){return{'name':_0x45ccf5[_0x7b9a('0x23')],'type':_0x45ccf5[_0x7b9a('0x24')][_0x7b9a('0x25')]};});_0x314b6d[_0x7b9a('0x26')]=_[_0x7b9a('0x21')](_0x1553ae,'name');_0x314b6d['query']=_[_0x7b9a('0x27')](_0x3847b4[_0x7b9a('0x28')]);_0x314b6d[_0x7b9a('0x29')]=_['intersection'](_0x314b6d[_0x7b9a('0x26')],_0x314b6d[_0x7b9a('0x28')]);_0x5c89b6['attributes']=_['intersection'](_0x314b6d[_0x7b9a('0x26')],qs[_0x7b9a('0x2a')](_0x3847b4['query'][_0x7b9a('0x2a')]));_0x5c89b6[_0x7b9a('0x2b')]=_0x5c89b6[_0x7b9a('0x2b')][_0x7b9a('0x2c')]?_0x5c89b6[_0x7b9a('0x2b')]:_0x314b6d['model'];if(!_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x2d')](_0x7b9a('0x2e'))){_0x5c89b6[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x3847b4[_0x7b9a('0x28')]['limit']);_0x5c89b6['offset']=qs[_0x7b9a('0x17')](_0x3847b4[_0x7b9a('0x28')]['offset']);}_0x5c89b6[_0x7b9a('0x2f')]=qs[_0x7b9a('0x30')](_0x3847b4[_0x7b9a('0x28')]['sort']);_0x5c89b6[_0x7b9a('0x31')]=qs[_0x7b9a('0x29')](_['pick'](_0x3847b4['query'],_0x314b6d[_0x7b9a('0x29')]),_0x1553ae);if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]){_0x5c89b6[_0x7b9a('0x31')]=_[_0x7b9a('0x33')](_0x5c89b6[_0x7b9a('0x31')],{'$or':_[_0x7b9a('0x21')](_0x1553ae,function(_0x380f4b){if(_0x380f4b['type']!==_0x7b9a('0x34')){var _0x5ac175={};_0x5ac175[_0x380f4b[_0x7b9a('0x35')]]={'$like':'%'+_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]+'%'};return _0x5ac175;}})});}_0x5c89b6=_[_0x7b9a('0x33')]({},_0x5c89b6,_0x3847b4[_0x7b9a('0x36')]);var _0x89951b={'where':_0x5c89b6['where']};return db[_0x7b9a('0x22')][_0x7b9a('0x19')](_0x89951b)[_0x7b9a('0x1e')](function(_0x1bc1f0){_0x4fee38['count']=_0x1bc1f0;if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x5c89b6[_0x7b9a('0x38')]=[{'all':!![]}];}return db[_0x7b9a('0x22')]['findAll'](_0x5c89b6);})[_0x7b9a('0x1e')](function(_0x53d89a){_0x4fee38[_0x7b9a('0x39')]=_0x53d89a;return _0x4fee38;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x4d5880,_0x5c89b6))[_0x7b9a('0x3a')](handleError(_0x4d5880,null));};exports[_0x7b9a('0x3b')]=function(_0x43fad0,_0x41f541){var _0x56e274={'raw':!![],'where':{'id':_0x43fad0[_0x7b9a('0x3c')]['id']}},_0x33edc6={};_0x33edc6[_0x7b9a('0x26')]=_['keys'](db['WhatsappQueueReport'][_0x7b9a('0x3d')]);_0x33edc6[_0x7b9a('0x28')]=_[_0x7b9a('0x27')](_0x43fad0[_0x7b9a('0x28')]);_0x33edc6[_0x7b9a('0x29')]=_[_0x7b9a('0x3e')](_0x33edc6['model'],_0x33edc6['query']);_0x56e274['attributes']=_[_0x7b9a('0x3e')](_0x33edc6[_0x7b9a('0x26')],qs['fields'](_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x2a')]));_0x56e274[_0x7b9a('0x2b')]=_0x56e274['attributes'][_0x7b9a('0x2c')]?_0x56e274['attributes']:_0x33edc6[_0x7b9a('0x26')];if(_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x56e274[_0x7b9a('0x38')]=[{'all':!![]}];}_0x56e274=_[_0x7b9a('0x33')]({},_0x56e274,_0x43fad0['options']);return db[_0x7b9a('0x22')]['find'](_0x56e274)[_0x7b9a('0x1e')](handleEntityNotFound(_0x41f541,null))['then'](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0x7b9a('0x3f')]=function(_0x3727ef,_0x717d08){return db[_0x7b9a('0x22')][_0x7b9a('0x3f')](_0x3727ef[_0x7b9a('0x40')],{})[_0x7b9a('0x1e')](respondWithResult(_0x717d08,0xc9))[_0x7b9a('0x3a')](handleError(_0x717d08,null));};exports[_0x7b9a('0x1d')]=function(_0x5088c7,_0x1d7957){if(_0x5088c7[_0x7b9a('0x40')]['id']){delete _0x5088c7['body']['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x5088c7[_0x7b9a('0x3c')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1d7957,null))[_0x7b9a('0x1e')](saveUpdates(_0x5088c7[_0x7b9a('0x40')],null))['then'](respondWithResult(_0x1d7957,null))[_0x7b9a('0x3a')](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1f')]=function(_0x287dea,_0x33b200){return db[_0x7b9a('0x22')]['find']({'where':{'id':_0x287dea[_0x7b9a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x33b200,null))[_0x7b9a('0x1e')](removeEntity(_0x33b200,null))[_0x7b9a('0x3a')](handleError(_0x33b200,null));};exports[_0x7b9a('0x41')]=function(_0x3f42a2,_0x52f2ca){return db[_0x7b9a('0x22')][_0x7b9a('0x41')]()[_0x7b9a('0x1e')](respondWithResult(_0x52f2ca,null))[_0x7b9a('0x3a')](handleError(_0x52f2ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8bb8196..65deaa2 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 _0xcd5f=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x23de5c,_0x87bd52){var _0x27413c=function(_0x5bba35){while(--_0x5bba35){_0x23de5c['push'](_0x23de5c['shift']());}};_0x27413c(++_0x87bd52);}(_0xcd5f,0x162));var _0xfcd5=function(_0x5bdaf0,_0x15b1a1){_0x5bdaf0=_0x5bdaf0-0x0;var _0x20e3e7=_0xcd5f[_0x5bdaf0];return _0x20e3e7;};'use strict';var _=require(_0xfcd5('0x0'));var util=require(_0xfcd5('0x1'));var logger=require('../../config/logger')(_0xfcd5('0x2'));var moment=require(_0xfcd5('0x3'));var BPromise=require(_0xfcd5('0x4'));var rp=require(_0xfcd5('0x5'));var fs=require('fs');var path=require(_0xfcd5('0x6'));var rimraf=require('rimraf');var config=require(_0xfcd5('0x7'));var attributes=require(_0xfcd5('0x8'));module[_0xfcd5('0x9')]=function(_0x465f13,_0x265c67){return _0x465f13[_0xfcd5('0xa')](_0xfcd5('0xb'),attributes,{'tableName':_0xfcd5('0xc'),'paranoid':![],'indexes':[{'name':_0xfcd5('0xd'),'fields':[_0xfcd5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x526c=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x3c4e07,_0x5c5b45){var _0x493d69=function(_0x3d91e0){while(--_0x3d91e0){_0x3c4e07['push'](_0x3c4e07['shift']());}};_0x493d69(++_0x5c5b45);}(_0x526c,0x99));var _0xc526=function(_0x3a87d1,_0x584e71){_0x3a87d1=_0x3a87d1-0x0;var _0x3aa6d8=_0x526c[_0x3a87d1];return _0x3aa6d8;};'use strict';var _=require(_0xc526('0x0'));var util=require(_0xc526('0x1'));var logger=require(_0xc526('0x2'))('api');var moment=require(_0xc526('0x3'));var BPromise=require(_0xc526('0x4'));var rp=require(_0xc526('0x5'));var fs=require('fs');var path=require(_0xc526('0x6'));var rimraf=require('rimraf');var config=require(_0xc526('0x7'));var attributes=require(_0xc526('0x8'));module[_0xc526('0x9')]=function(_0x4bd328,_0x5e6779){return _0x4bd328[_0xc526('0xa')](_0xc526('0xb'),attributes,{'tableName':_0xc526('0xc'),'paranoid':![],'indexes':[{'name':_0xc526('0xd'),'fields':[_0xc526('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0df343b..7072e57 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 _0xcbdf=['WhatsappQueueReport','create','body','options','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','raw','limit','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x2d4d6e,_0x35d715){var _0x30c329=function(_0x5928e8){while(--_0x5928e8){_0x2d4d6e['push'](_0x2d4d6e['shift']());}};_0x30c329(++_0x35d715);}(_0xcbdf,0x68));var _0xfcbd=function(_0x33bd92,_0x246002){_0x33bd92=_0x33bd92-0x0;var _0x53bb7a=_0xcbdf[_0x33bd92];return _0x53bb7a;};'use strict';var _=require('lodash');var util=require(_0xfcbd('0x0'));var moment=require(_0xfcbd('0x1'));var BPromise=require('bluebird');var rs=require(_0xfcbd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcbd('0x3'))['db'];var utils=require(_0xfcbd('0x4'));var logger=require(_0xfcbd('0x5'))(_0xfcbd('0x6'));var config=require(_0xfcbd('0x7'));var jayson=require(_0xfcbd('0x8'));var client=jayson[_0xfcbd('0x9')][_0xfcbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11fe19,_0x450792,_0x25ee66){return new BPromise(function(_0x5c6579,_0x541675){return client['request'](_0x11fe19,_0x25ee66)[_0xfcbd('0xb')](function(_0x638726){logger[_0xfcbd('0xc')](_0xfcbd('0xd'),_0x450792,_0xfcbd('0xe'));logger['debug'](_0xfcbd('0xf'),_0x450792,_0xfcbd('0xe'),JSON[_0xfcbd('0x10')](_0x638726));if(_0x638726['error']){if(_0x638726[_0xfcbd('0x11')]['code']===0x1f4){logger[_0xfcbd('0x11')](_0xfcbd('0xd'),_0x450792,_0x638726['error']['message']);return _0x541675(_0x638726[_0xfcbd('0x11')][_0xfcbd('0x12')]);}logger[_0xfcbd('0x11')](_0xfcbd('0xd'),_0x450792,_0x638726[_0xfcbd('0x11')][_0xfcbd('0x12')]);return _0x5c6579(_0x638726['error'][_0xfcbd('0x12')]);}else{logger['info'](_0xfcbd('0xd'),_0x450792,_0xfcbd('0xe'));_0x5c6579(_0x638726[_0xfcbd('0x13')][_0xfcbd('0x12')]);}})['catch'](function(_0x4a5c17){logger[_0xfcbd('0x11')](_0xfcbd('0xd'),_0x450792,_0x4a5c17);_0x541675(_0x4a5c17);});});}exports['CreateWhatsappQueueReport']=function(_0x2e9270){var _0x6aa44a=this;return new Promise(function(_0xf273a2,_0x5c253f){return db[_0xfcbd('0x14')][_0xfcbd('0x15')](_0x2e9270[_0xfcbd('0x16')],{'raw':_0x2e9270[_0xfcbd('0x17')]?_0x2e9270['options']['raw']===undefined?!![]:![]:!![]})[_0xfcbd('0xb')](function(_0xbb4fd1){logger[_0xfcbd('0xc')](_0xfcbd('0x18'),_0x2e9270);logger['debug'](_0xfcbd('0x18'),_0x2e9270,JSON[_0xfcbd('0x10')](_0xbb4fd1));_0xf273a2(_0xbb4fd1);})[_0xfcbd('0x19')](function(_0x24298d){logger[_0xfcbd('0x11')](_0xfcbd('0x18'),_0x24298d['message'],_0x2e9270);_0x5c253f(_0x6aa44a[_0xfcbd('0x11')](0x1f4,_0x24298d[_0xfcbd('0x12')]));});});};exports[_0xfcbd('0x1a')]=function(_0x4478eb){var _0x313b6d=this;return new Promise(function(_0x1a4be8,_0x1b8a61){return db[_0xfcbd('0x14')][_0xfcbd('0x1b')](_0x4478eb[_0xfcbd('0x16')],{'raw':_0x4478eb['options']?_0x4478eb[_0xfcbd('0x17')][_0xfcbd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4478eb[_0xfcbd('0x17')]?_0x4478eb[_0xfcbd('0x17')]['where']||null:null,'attributes':_0x4478eb[_0xfcbd('0x17')]?_0x4478eb[_0xfcbd('0x17')]['attributes']||null:null,'limit':_0x4478eb[_0xfcbd('0x17')]?_0x4478eb[_0xfcbd('0x17')][_0xfcbd('0x1d')]||null:null})[_0xfcbd('0xb')](function(_0x202bd6){logger[_0xfcbd('0xc')](_0xfcbd('0x1a'),_0x4478eb);logger[_0xfcbd('0x1e')](_0xfcbd('0x1a'),_0x4478eb,JSON[_0xfcbd('0x10')](_0x202bd6));_0x1a4be8(_0x202bd6);})[_0xfcbd('0x19')](function(_0x36476e){logger[_0xfcbd('0x11')](_0xfcbd('0x1a'),_0x36476e[_0xfcbd('0x12')],_0x4478eb);_0x1b8a61(_0x313b6d['error'](0x1f4,_0x36476e[_0xfcbd('0x12')]));});});}; \ No newline at end of file +var _0x2e2d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','then','stringify','WhatsappQueueReport','where','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','../../mysqldb'];(function(_0x555ccc,_0x305ba3){var _0x1187c4=function(_0x28a124){while(--_0x28a124){_0x555ccc['push'](_0x555ccc['shift']());}};_0x1187c4(++_0x305ba3);}(_0x2e2d,0x92));var _0xd2e2=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2e2d[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xd2e2('0x0'));var util=require(_0xd2e2('0x1'));var moment=require('moment');var BPromise=require(_0xd2e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2e2('0x3'))['db'];var utils=require(_0xd2e2('0x4'));var logger=require(_0xd2e2('0x5'))(_0xd2e2('0x6'));var config=require(_0xd2e2('0x7'));var jayson=require(_0xd2e2('0x8'));var client=jayson[_0xd2e2('0x9')][_0xd2e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49817a,_0xfb116d,_0x22ba38){return new BPromise(function(_0x467dff,_0x5cfd1d){return client['request'](_0x49817a,_0x22ba38)['then'](function(_0x4a5eb){logger[_0xd2e2('0xb')](_0xd2e2('0xc'),_0xfb116d,_0xd2e2('0xd'));logger[_0xd2e2('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0xfb116d,_0xd2e2('0xd'),JSON['stringify'](_0x4a5eb));if(_0x4a5eb[_0xd2e2('0xf')]){if(_0x4a5eb[_0xd2e2('0xf')][_0xd2e2('0x10')]===0x1f4){logger[_0xd2e2('0xf')](_0xd2e2('0xc'),_0xfb116d,_0x4a5eb[_0xd2e2('0xf')][_0xd2e2('0x11')]);return _0x5cfd1d(_0x4a5eb[_0xd2e2('0xf')][_0xd2e2('0x11')]);}logger['error'](_0xd2e2('0xc'),_0xfb116d,_0x4a5eb['error'][_0xd2e2('0x11')]);return _0x467dff(_0x4a5eb['error'][_0xd2e2('0x11')]);}else{logger[_0xd2e2('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0xfb116d,_0xd2e2('0xd'));_0x467dff(_0x4a5eb[_0xd2e2('0x12')][_0xd2e2('0x11')]);}})[_0xd2e2('0x13')](function(_0x2b34fa){logger[_0xd2e2('0xf')](_0xd2e2('0xc'),_0xfb116d,_0x2b34fa);_0x5cfd1d(_0x2b34fa);});});}exports[_0xd2e2('0x14')]=function(_0x1908e2){var _0x40151d=this;return new Promise(function(_0x5af30a,_0x1e0d55){return db['WhatsappQueueReport'][_0xd2e2('0x15')](_0x1908e2[_0xd2e2('0x16')],{'raw':_0x1908e2[_0xd2e2('0x17')]?_0x1908e2[_0xd2e2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xd2e2('0x18')](function(_0x495a2f){logger[_0xd2e2('0xb')](_0xd2e2('0x14'),_0x1908e2);logger['debug'](_0xd2e2('0x14'),_0x1908e2,JSON[_0xd2e2('0x19')](_0x495a2f));_0x5af30a(_0x495a2f);})[_0xd2e2('0x13')](function(_0x1213d1){logger['error'](_0xd2e2('0x14'),_0x1213d1[_0xd2e2('0x11')],_0x1908e2);_0x1e0d55(_0x40151d[_0xd2e2('0xf')](0x1f4,_0x1213d1[_0xd2e2('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x36e3ce){var _0x1a943e=this;return new Promise(function(_0x41d448,_0x29a4fc){return db[_0xd2e2('0x1a')]['update'](_0x36e3ce[_0xd2e2('0x16')],{'raw':_0x36e3ce[_0xd2e2('0x17')]?_0x36e3ce['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e3ce[_0xd2e2('0x17')]?_0x36e3ce[_0xd2e2('0x17')][_0xd2e2('0x1b')]||null:null,'attributes':_0x36e3ce[_0xd2e2('0x17')]?_0x36e3ce['options']['attributes']||null:null,'limit':_0x36e3ce[_0xd2e2('0x17')]?_0x36e3ce[_0xd2e2('0x17')][_0xd2e2('0x1c')]||null:null})[_0xd2e2('0x18')](function(_0x56cb88){logger[_0xd2e2('0xb')]('UpdateWhatsappQueueReport',_0x36e3ce);logger[_0xd2e2('0xe')]('UpdateWhatsappQueueReport',_0x36e3ce,JSON[_0xd2e2('0x19')](_0x56cb88));_0x41d448(_0x56cb88);})[_0xd2e2('0x13')](function(_0x5bac39){logger['error'](_0xd2e2('0x1d'),_0x5bac39[_0xd2e2('0x11')],_0x36e3ce);_0x29a4fc(_0x1a943e['error'](0x1f4,_0x5bac39[_0xd2e2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 5ebcfe1..21f2cf3 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 _0x0430=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x35c899,_0x3c6df8){var _0x97627e=function(_0x38b28f){while(--_0x38b28f){_0x35c899['push'](_0x35c899['shift']());}};_0x97627e(++_0x3c6df8);}(_0x0430,0xa4));var _0x0043=function(_0x5b38ab,_0x34f642){_0x5b38ab=_0x5b38ab-0x0;var _0x26aca6=_0x0430[_0x5b38ab];return _0x26aca6;};'use strict';var multer=require(_0x0043('0x0'));var util=require(_0x0043('0x1'));var path=require(_0x0043('0x2'));var timeout=require(_0x0043('0x3'));var express=require(_0x0043('0x4'));var router=express[_0x0043('0x5')]();var fs_extra=require(_0x0043('0x6'));var auth=require(_0x0043('0x7'));var interaction=require(_0x0043('0x8'));var config=require(_0x0043('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x0043('0xa')]('/',auth[_0x0043('0xb')](),controller[_0x0043('0xc')]);router['get'](_0x0043('0xd'),auth['isAuthenticated'](),controller[_0x0043('0xe')]);router[_0x0043('0xa')](_0x0043('0xf'),auth[_0x0043('0xb')](),controller[_0x0043('0x10')]);router[_0x0043('0x11')]('/',auth[_0x0043('0xb')](),controller['create']);router[_0x0043('0x12')](_0x0043('0xf'),auth[_0x0043('0xb')](),controller[_0x0043('0x13')]);router[_0x0043('0x14')](_0x0043('0xf'),auth['isAuthenticated'](),controller[_0x0043('0x15')]);module[_0x0043('0x16')]=router; \ No newline at end of file +var _0xd88e=['isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id'];(function(_0x224090,_0x38f7e4){var _0xd97361=function(_0x47b217){while(--_0x47b217){_0x224090['push'](_0x224090['shift']());}};_0xd97361(++_0x38f7e4);}(_0xd88e,0x1d3));var _0xed88=function(_0x1deb1d,_0x3cfd0f){_0x1deb1d=_0x1deb1d-0x0;var _0x4968e2=_0xd88e[_0x1deb1d];return _0x4968e2;};'use strict';var multer=require(_0xed88('0x0'));var util=require(_0xed88('0x1'));var path=require(_0xed88('0x2'));var timeout=require(_0xed88('0x3'));var express=require(_0xed88('0x4'));var router=express[_0xed88('0x5')]();var fs_extra=require(_0xed88('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xed88('0x7'));var config=require(_0xed88('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0xed88('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xed88('0xa'),auth['isAuthenticated'](),controller[_0xed88('0xb')]);router['get'](_0xed88('0xc'),auth[_0xed88('0xd')](),controller[_0xed88('0xe')]);router[_0xed88('0xf')]('/',auth[_0xed88('0xd')](),controller[_0xed88('0x10')]);router[_0xed88('0x11')](_0xed88('0xc'),auth[_0xed88('0xd')](),controller['update']);router[_0xed88('0x12')](_0xed88('0xc'),auth[_0xed88('0xd')](),controller[_0xed88('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a5a970b..b034137 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 _0xbc95=['sequelize','exports','STRING','ENUM','account'];(function(_0x959e8b,_0x33e2d7){var _0x2a2145=function(_0x28cb98){while(--_0x28cb98){_0x959e8b['push'](_0x959e8b['shift']());}};_0x2a2145(++_0x33e2d7);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x9b6f48,_0x583963){_0x9b6f48=_0x9b6f48-0x0;var _0x96a18d=_0xbc95[_0x9b6f48];return _0x96a18d;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'uniqueid':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5bc9('0x3')](_0x5bc9('0x4'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8ff9=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x5f2abc,_0x4f90ae){var _0x3152b6=function(_0x5ee46f){while(--_0x5ee46f){_0x5f2abc['push'](_0x5f2abc['shift']());}};_0x3152b6(++_0x4f90ae);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x4c24d9,_0x506576){_0x4c24d9=_0x4c24d9-0x0;var _0x375bf6=_0x8ff9[_0x4c24d9];return _0x375bf6;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'uniqueid':{'type':Sequelize[_0x98ff('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x98ff('0x3')](_0x98ff('0x4'),_0x98ff('0x5'),_0x98ff('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x98ff('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index da554a7..958eb96 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 _0x092f=['catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x3d71ea,_0x292819){var _0x2d5a84=function(_0xdf7806){while(--_0xdf7806){_0x3d71ea['push'](_0x3d71ea['shift']());}};_0x2d5a84(++_0x292819);}(_0x092f,0x1dc));var _0xf092=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x092f[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0xf092('0x0'));var rimraf=require(_0xf092('0x1'));var zipdir=require(_0xf092('0x2'));var jsonpatch=require(_0xf092('0x3'));var rp=require(_0xf092('0x4'));var moment=require('moment');var BPromise=require(_0xf092('0x5'));var Mustache=require(_0xf092('0x6'));var util=require(_0xf092('0x7'));var path=require('path');var sox=require(_0xf092('0x8'));var csv=require('to-csv');var ejs=require(_0xf092('0x9'));var fs=require('fs');var fs_extra=require(_0xf092('0xa'));var _=require('lodash');var squel=require(_0xf092('0xb'));var crypto=require('crypto');var jsforce=require(_0xf092('0xc'));var deskjs=require(_0xf092('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf092('0xe'));var Papa=require(_0xf092('0xf'));var Redis=require('ioredis');var authService=require(_0xf092('0x10'));var qs=require(_0xf092('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf092('0x12'));var logger=require(_0xf092('0x13'))(_0xf092('0x14'));var utils=require(_0xf092('0x15'));var config=require(_0xf092('0x16'));var licenseUtil=require(_0xf092('0x17'));var db=require(_0xf092('0x18'))['db'];function respondWithStatusCode(_0x4c6fc5,_0x11ed85){_0x11ed85=_0x11ed85||0xcc;return function(_0x147dbe){if(_0x147dbe){return _0x4c6fc5[_0xf092('0x19')](_0x11ed85);}return _0x4c6fc5[_0xf092('0x1a')](_0x11ed85)['end']();};}function respondWithResult(_0x2fb9b,_0x341576){_0x341576=_0x341576||0xc8;return function(_0x4246f){if(_0x4246f){return _0x2fb9b[_0xf092('0x1a')](_0x341576)['json'](_0x4246f);}};}function respondWithFilteredResult(_0x5237a9,_0x17c102){return function(_0x4738c3){if(_0x4738c3){var _0x23df5d=typeof _0x17c102[_0xf092('0x1b')]===_0xf092('0x1c')&&typeof _0x17c102['limit']==='undefined';var _0x5736c5=_0x4738c3[_0xf092('0x1d')];var _0x2edb55=_0x23df5d?0x0:_0x17c102['offset'];var _0x1e94e7=_0x23df5d?_0x4738c3[_0xf092('0x1d')]:_0x17c102[_0xf092('0x1b')]+_0x17c102[_0xf092('0x1e')];var _0x2ff644;if(_0x1e94e7>=_0x5736c5){_0x1e94e7=_0x5736c5;_0x2ff644=0xc8;}else{_0x2ff644=0xce;}_0x5237a9[_0xf092('0x1a')](_0x2ff644);return _0x5237a9[_0xf092('0x1f')](_0xf092('0x20'),_0x2edb55+'-'+_0x1e94e7+'/'+_0x5736c5)[_0xf092('0x21')](_0x4738c3);}return null;};}function patchUpdates(_0x203ca6){return function(_0x424e5d){try{jsonpatch[_0xf092('0x22')](_0x424e5d,_0x203ca6,!![]);}catch(_0x6eb349){return BPromise[_0xf092('0x23')](_0x6eb349);}return _0x424e5d[_0xf092('0x24')]();};}function saveUpdates(_0x4462b1,_0x2aebfa){return function(_0x42062b){if(_0x42062b){return _0x42062b['update'](_0x4462b1)[_0xf092('0x25')](function(_0x219c86){return _0x219c86;});}return null;};}function removeEntity(_0x54d79a,_0x53f407){return function(_0x5ac7d2){if(_0x5ac7d2){return _0x5ac7d2[_0xf092('0x26')]()[_0xf092('0x25')](function(){_0x54d79a[_0xf092('0x1a')](0xcc)[_0xf092('0x27')]();});}};}function handleEntityNotFound(_0x5ee9ce,_0x2c4bfe){return function(_0x2573aa){if(!_0x2573aa){_0x5ee9ce['sendStatus'](0x194);}return _0x2573aa;};}function handleError(_0x3a120b,_0x5a0cdb){_0x5a0cdb=_0x5a0cdb||0x1f4;return function(_0x17db4f){logger[_0xf092('0x28')](_0x17db4f[_0xf092('0x29')]);if(_0x17db4f[_0xf092('0x2a')]){delete _0x17db4f[_0xf092('0x2a')];}_0x3a120b[_0xf092('0x1a')](_0x5a0cdb)[_0xf092('0x2b')](_0x17db4f);};}exports[_0xf092('0x2c')]=function(_0x4fa693,_0x5c9477){var _0x3f55c3={},_0x3f81d8={},_0x56bb4a={'count':0x0,'rows':[]};var _0x1e54b1=_['map'](db[_0xf092('0x2d')][_0xf092('0x2e')],function(_0x44fee2){return{'name':_0x44fee2[_0xf092('0x2f')],'type':_0x44fee2[_0xf092('0x30')][_0xf092('0x31')]};});_0x3f81d8[_0xf092('0x32')]=_[_0xf092('0x33')](_0x1e54b1,_0xf092('0x2a'));_0x3f81d8[_0xf092('0x34')]=_['keys'](_0x4fa693[_0xf092('0x34')]);_0x3f81d8[_0xf092('0x35')]=_[_0xf092('0x36')](_0x3f81d8[_0xf092('0x32')],_0x3f81d8[_0xf092('0x34')]);_0x3f55c3['attributes']=_[_0xf092('0x36')](_0x3f81d8[_0xf092('0x32')],qs[_0xf092('0x37')](_0x4fa693[_0xf092('0x34')][_0xf092('0x37')]));_0x3f55c3[_0xf092('0x38')]=_0x3f55c3[_0xf092('0x38')][_0xf092('0x39')]?_0x3f55c3[_0xf092('0x38')]:_0x3f81d8[_0xf092('0x32')];if(!_0x4fa693[_0xf092('0x34')][_0xf092('0x3a')]('nolimit')){_0x3f55c3[_0xf092('0x1e')]=qs[_0xf092('0x1e')](_0x4fa693[_0xf092('0x34')][_0xf092('0x1e')]);_0x3f55c3[_0xf092('0x1b')]=qs['offset'](_0x4fa693[_0xf092('0x34')][_0xf092('0x1b')]);}_0x3f55c3[_0xf092('0x3b')]=qs[_0xf092('0x3c')](_0x4fa693[_0xf092('0x34')][_0xf092('0x3c')]);_0x3f55c3[_0xf092('0x3d')]=qs[_0xf092('0x35')](_[_0xf092('0x3e')](_0x4fa693[_0xf092('0x34')],_0x3f81d8['filters']),_0x1e54b1);if(_0x4fa693[_0xf092('0x34')]['filter']){_0x3f55c3[_0xf092('0x3d')]=_[_0xf092('0x3f')](_0x3f55c3[_0xf092('0x3d')],{'$or':_['map'](_0x1e54b1,function(_0x6ca991){if(_0x6ca991[_0xf092('0x30')]!==_0xf092('0x40')){var _0x4fe7ea={};_0x4fe7ea[_0x6ca991[_0xf092('0x2a')]]={'$like':'%'+_0x4fa693['query'][_0xf092('0x41')]+'%'};return _0x4fe7ea;}})});}_0x3f55c3=_['merge']({},_0x3f55c3,_0x4fa693[_0xf092('0x42')]);var _0x404a0f={'where':_0x3f55c3[_0xf092('0x3d')]};return db['WhatsappTransferReport']['count'](_0x404a0f)[_0xf092('0x25')](function(_0x4300de){_0x56bb4a[_0xf092('0x1d')]=_0x4300de;if(_0x4fa693[_0xf092('0x34')][_0xf092('0x43')]){_0x3f55c3[_0xf092('0x44')]=[{'all':!![]}];}return db[_0xf092('0x2d')]['findAll'](_0x3f55c3);})[_0xf092('0x25')](function(_0x640708){_0x56bb4a[_0xf092('0x45')]=_0x640708;return _0x56bb4a;})[_0xf092('0x25')](respondWithFilteredResult(_0x5c9477,_0x3f55c3))[_0xf092('0x46')](handleError(_0x5c9477,null));};exports[_0xf092('0x47')]=function(_0x17bea2,_0x7613bc){var _0xeb25ff={'raw':!![],'where':{'id':_0x17bea2[_0xf092('0x48')]['id']}},_0x4ed70e={};_0x4ed70e[_0xf092('0x32')]=_['keys'](db[_0xf092('0x2d')]['rawAttributes']);_0x4ed70e[_0xf092('0x34')]=_['keys'](_0x17bea2[_0xf092('0x34')]);_0x4ed70e['filters']=_[_0xf092('0x36')](_0x4ed70e[_0xf092('0x32')],_0x4ed70e[_0xf092('0x34')]);_0xeb25ff[_0xf092('0x38')]=_[_0xf092('0x36')](_0x4ed70e[_0xf092('0x32')],qs[_0xf092('0x37')](_0x17bea2['query']['fields']));_0xeb25ff[_0xf092('0x38')]=_0xeb25ff[_0xf092('0x38')][_0xf092('0x39')]?_0xeb25ff[_0xf092('0x38')]:_0x4ed70e['model'];if(_0x17bea2['query'][_0xf092('0x43')]){_0xeb25ff[_0xf092('0x44')]=[{'all':!![]}];}_0xeb25ff=_[_0xf092('0x3f')]({},_0xeb25ff,_0x17bea2['options']);return db[_0xf092('0x2d')][_0xf092('0x49')](_0xeb25ff)[_0xf092('0x25')](handleEntityNotFound(_0x7613bc,null))[_0xf092('0x25')](respondWithResult(_0x7613bc,null))[_0xf092('0x46')](handleError(_0x7613bc,null));};exports[_0xf092('0x4a')]=function(_0x55eefe,_0x13e273){return db[_0xf092('0x2d')][_0xf092('0x4a')](_0x55eefe['body'],{})[_0xf092('0x25')](respondWithResult(_0x13e273,0xc9))[_0xf092('0x46')](handleError(_0x13e273,null));};exports[_0xf092('0x4b')]=function(_0x5ce82f,_0x5d8682){if(_0x5ce82f[_0xf092('0x4c')]['id']){delete _0x5ce82f[_0xf092('0x4c')]['id'];}return db[_0xf092('0x2d')][_0xf092('0x49')]({'where':{'id':_0x5ce82f[_0xf092('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d8682,null))[_0xf092('0x25')](saveUpdates(_0x5ce82f[_0xf092('0x4c')],null))[_0xf092('0x25')](respondWithResult(_0x5d8682,null))[_0xf092('0x46')](handleError(_0x5d8682,null));};exports[_0xf092('0x26')]=function(_0x3c6062,_0x6c3161){return db['WhatsappTransferReport']['find']({'where':{'id':_0x3c6062['params']['id']}})[_0xf092('0x25')](handleEntityNotFound(_0x6c3161,null))['then'](removeEntity(_0x6c3161,null))[_0xf092('0x46')](handleError(_0x6c3161,null));};exports[_0xf092('0x4d')]=function(_0x389295,_0x577d94){return db[_0xf092('0x2d')][_0xf092('0x4d')]()[_0xf092('0x25')](respondWithResult(_0x577d94,null))[_0xf092('0x46')](handleError(_0x577d94,null));}; \ No newline at end of file +var _0xa3db=['key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','rows','show','keys','includeAll','include','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type'];(function(_0x2c94cb,_0x4badfd){var _0x16fa09=function(_0x50d952){while(--_0x50d952){_0x2c94cb['push'](_0x2c94cb['shift']());}};_0x16fa09(++_0x4badfd);}(_0xa3db,0x10c));var _0xba3d=function(_0x290e6e,_0x359589){_0x290e6e=_0x290e6e-0x0;var _0x1ae21b=_0xa3db[_0x290e6e];return _0x1ae21b;};'use strict';var emlformat=require(_0xba3d('0x0'));var rimraf=require(_0xba3d('0x1'));var zipdir=require(_0xba3d('0x2'));var jsonpatch=require(_0xba3d('0x3'));var rp=require(_0xba3d('0x4'));var moment=require(_0xba3d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba3d('0x6'));var path=require('path');var sox=require(_0xba3d('0x7'));var csv=require('to-csv');var ejs=require(_0xba3d('0x8'));var fs=require('fs');var fs_extra=require(_0xba3d('0x9'));var _=require(_0xba3d('0xa'));var squel=require(_0xba3d('0xb'));var crypto=require(_0xba3d('0xc'));var jsforce=require(_0xba3d('0xd'));var deskjs=require(_0xba3d('0xe'));var toCsv=require(_0xba3d('0xf'));var querystring=require(_0xba3d('0x10'));var Papa=require(_0xba3d('0x11'));var Redis=require(_0xba3d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba3d('0x13'));var as=require(_0xba3d('0x14'));var hardwareService=require(_0xba3d('0x15'));var logger=require(_0xba3d('0x16'))(_0xba3d('0x17'));var utils=require('../../config/utils');var config=require(_0xba3d('0x18'));var licenseUtil=require(_0xba3d('0x19'));var db=require(_0xba3d('0x1a'))['db'];function respondWithStatusCode(_0x526026,_0x47f11d){_0x47f11d=_0x47f11d||0xcc;return function(_0x1daf60){if(_0x1daf60){return _0x526026[_0xba3d('0x1b')](_0x47f11d);}return _0x526026['status'](_0x47f11d)['end']();};}function respondWithResult(_0xcdcbab,_0x497630){_0x497630=_0x497630||0xc8;return function(_0x446f86){if(_0x446f86){return _0xcdcbab[_0xba3d('0x1c')](_0x497630)[_0xba3d('0x1d')](_0x446f86);}};}function respondWithFilteredResult(_0x38fcc8,_0x327a3a){return function(_0x186bb){if(_0x186bb){var _0x19e521=typeof _0x327a3a[_0xba3d('0x1e')]===_0xba3d('0x1f')&&typeof _0x327a3a[_0xba3d('0x20')]==='undefined';var _0x208978=_0x186bb[_0xba3d('0x21')];var _0x1112ae=_0x19e521?0x0:_0x327a3a[_0xba3d('0x1e')];var _0xbb8168=_0x19e521?_0x186bb[_0xba3d('0x21')]:_0x327a3a[_0xba3d('0x1e')]+_0x327a3a[_0xba3d('0x20')];var _0x5b85e8;if(_0xbb8168>=_0x208978){_0xbb8168=_0x208978;_0x5b85e8=0xc8;}else{_0x5b85e8=0xce;}_0x38fcc8[_0xba3d('0x1c')](_0x5b85e8);return _0x38fcc8['set'](_0xba3d('0x22'),_0x1112ae+'-'+_0xbb8168+'/'+_0x208978)[_0xba3d('0x1d')](_0x186bb);}return null;};}function patchUpdates(_0x2001f5){return function(_0x3aaef4){try{jsonpatch[_0xba3d('0x23')](_0x3aaef4,_0x2001f5,!![]);}catch(_0x3ad698){return BPromise[_0xba3d('0x24')](_0x3ad698);}return _0x3aaef4[_0xba3d('0x25')]();};}function saveUpdates(_0x6db61d,_0x3b4655){return function(_0x2b10ee){if(_0x2b10ee){return _0x2b10ee[_0xba3d('0x26')](_0x6db61d)[_0xba3d('0x27')](function(_0x59f91f){return _0x59f91f;});}return null;};}function removeEntity(_0x4f2b74,_0x5ac59b){return function(_0x51bace){if(_0x51bace){return _0x51bace[_0xba3d('0x28')]()[_0xba3d('0x27')](function(){_0x4f2b74[_0xba3d('0x1c')](0xcc)[_0xba3d('0x29')]();});}};}function handleEntityNotFound(_0x17b9d9,_0x20d60f){return function(_0x4a8f81){if(!_0x4a8f81){_0x17b9d9[_0xba3d('0x1b')](0x194);}return _0x4a8f81;};}function handleError(_0x3cc662,_0x3e61d9){_0x3e61d9=_0x3e61d9||0x1f4;return function(_0x325861){logger[_0xba3d('0x2a')](_0x325861[_0xba3d('0x2b')]);if(_0x325861['name']){delete _0x325861[_0xba3d('0x2c')];}_0x3cc662[_0xba3d('0x1c')](_0x3e61d9)[_0xba3d('0x2d')](_0x325861);};}exports[_0xba3d('0x2e')]=function(_0x50e82a,_0x1a9b37){var _0x4e24d8={},_0x117b69={},_0x1bd4ec={'count':0x0,'rows':[]};var _0x25c4cc=_[_0xba3d('0x2f')](db[_0xba3d('0x30')][_0xba3d('0x31')],function(_0x3d953b){return{'name':_0x3d953b[_0xba3d('0x32')],'type':_0x3d953b[_0xba3d('0x33')][_0xba3d('0x34')]};});_0x117b69['model']=_[_0xba3d('0x2f')](_0x25c4cc,'name');_0x117b69['query']=_['keys'](_0x50e82a[_0xba3d('0x35')]);_0x117b69[_0xba3d('0x36')]=_[_0xba3d('0x37')](_0x117b69[_0xba3d('0x38')],_0x117b69[_0xba3d('0x35')]);_0x4e24d8['attributes']=_[_0xba3d('0x37')](_0x117b69[_0xba3d('0x38')],qs['fields'](_0x50e82a[_0xba3d('0x35')][_0xba3d('0x39')]));_0x4e24d8['attributes']=_0x4e24d8[_0xba3d('0x3a')][_0xba3d('0x3b')]?_0x4e24d8['attributes']:_0x117b69[_0xba3d('0x38')];if(!_0x50e82a['query']['hasOwnProperty'](_0xba3d('0x3c'))){_0x4e24d8[_0xba3d('0x20')]=qs[_0xba3d('0x20')](_0x50e82a[_0xba3d('0x35')][_0xba3d('0x20')]);_0x4e24d8[_0xba3d('0x1e')]=qs[_0xba3d('0x1e')](_0x50e82a[_0xba3d('0x35')][_0xba3d('0x1e')]);}_0x4e24d8[_0xba3d('0x3d')]=qs[_0xba3d('0x3e')](_0x50e82a['query']['sort']);_0x4e24d8[_0xba3d('0x3f')]=qs['filters'](_[_0xba3d('0x40')](_0x50e82a[_0xba3d('0x35')],_0x117b69[_0xba3d('0x36')]),_0x25c4cc);if(_0x50e82a[_0xba3d('0x35')][_0xba3d('0x41')]){_0x4e24d8['where']=_[_0xba3d('0x42')](_0x4e24d8[_0xba3d('0x3f')],{'$or':_[_0xba3d('0x2f')](_0x25c4cc,function(_0x38362a){if(_0x38362a['type']!==_0xba3d('0x43')){var _0x3c754b={};_0x3c754b[_0x38362a[_0xba3d('0x2c')]]={'$like':'%'+_0x50e82a[_0xba3d('0x35')][_0xba3d('0x41')]+'%'};return _0x3c754b;}})});}_0x4e24d8=_[_0xba3d('0x42')]({},_0x4e24d8,_0x50e82a['options']);var _0x253ce2={'where':_0x4e24d8[_0xba3d('0x3f')]};return db[_0xba3d('0x30')][_0xba3d('0x21')](_0x253ce2)[_0xba3d('0x27')](function(_0x583eb5){_0x1bd4ec[_0xba3d('0x21')]=_0x583eb5;if(_0x50e82a['query']['includeAll']){_0x4e24d8['include']=[{'all':!![]}];}return db[_0xba3d('0x30')]['findAll'](_0x4e24d8);})['then'](function(_0x1f8588){_0x1bd4ec[_0xba3d('0x44')]=_0x1f8588;return _0x1bd4ec;})['then'](respondWithFilteredResult(_0x1a9b37,_0x4e24d8))['catch'](handleError(_0x1a9b37,null));};exports[_0xba3d('0x45')]=function(_0x4007e6,_0x1ab91d){var _0x17cd9d={'raw':!![],'where':{'id':_0x4007e6['params']['id']}},_0x117baa={};_0x117baa[_0xba3d('0x38')]=_[_0xba3d('0x46')](db[_0xba3d('0x30')]['rawAttributes']);_0x117baa[_0xba3d('0x35')]=_[_0xba3d('0x46')](_0x4007e6[_0xba3d('0x35')]);_0x117baa[_0xba3d('0x36')]=_[_0xba3d('0x37')](_0x117baa['model'],_0x117baa[_0xba3d('0x35')]);_0x17cd9d[_0xba3d('0x3a')]=_['intersection'](_0x117baa[_0xba3d('0x38')],qs[_0xba3d('0x39')](_0x4007e6[_0xba3d('0x35')][_0xba3d('0x39')]));_0x17cd9d['attributes']=_0x17cd9d['attributes']['length']?_0x17cd9d[_0xba3d('0x3a')]:_0x117baa[_0xba3d('0x38')];if(_0x4007e6[_0xba3d('0x35')][_0xba3d('0x47')]){_0x17cd9d[_0xba3d('0x48')]=[{'all':!![]}];}_0x17cd9d=_[_0xba3d('0x42')]({},_0x17cd9d,_0x4007e6[_0xba3d('0x49')]);return db['WhatsappTransferReport'][_0xba3d('0x4a')](_0x17cd9d)[_0xba3d('0x27')](handleEntityNotFound(_0x1ab91d,null))[_0xba3d('0x27')](respondWithResult(_0x1ab91d,null))[_0xba3d('0x4b')](handleError(_0x1ab91d,null));};exports[_0xba3d('0x4c')]=function(_0xeb7f49,_0x545f30){return db[_0xba3d('0x30')]['create'](_0xeb7f49[_0xba3d('0x4d')],{})[_0xba3d('0x27')](respondWithResult(_0x545f30,0xc9))[_0xba3d('0x4b')](handleError(_0x545f30,null));};exports[_0xba3d('0x26')]=function(_0x468c08,_0x48cfad){if(_0x468c08[_0xba3d('0x4d')]['id']){delete _0x468c08[_0xba3d('0x4d')]['id'];}return db['WhatsappTransferReport'][_0xba3d('0x4a')]({'where':{'id':_0x468c08[_0xba3d('0x4e')]['id']}})[_0xba3d('0x27')](handleEntityNotFound(_0x48cfad,null))[_0xba3d('0x27')](saveUpdates(_0x468c08[_0xba3d('0x4d')],null))[_0xba3d('0x27')](respondWithResult(_0x48cfad,null))[_0xba3d('0x4b')](handleError(_0x48cfad,null));};exports[_0xba3d('0x28')]=function(_0x5b84da,_0x57a073){return db[_0xba3d('0x30')][_0xba3d('0x4a')]({'where':{'id':_0x5b84da['params']['id']}})[_0xba3d('0x27')](handleEntityNotFound(_0x57a073,null))[_0xba3d('0x27')](removeEntity(_0x57a073,null))[_0xba3d('0x4b')](handleError(_0x57a073,null));};exports[_0xba3d('0x4f')]=function(_0x187c94,_0x55a548){return db[_0xba3d('0x30')][_0xba3d('0x4f')]()[_0xba3d('0x27')](respondWithResult(_0x55a548,null))[_0xba3d('0x4b')](handleError(_0x55a548,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index af10556..0fec8e0 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 _0x852b=['api','moment','bluebird','request-promise','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x360f4a,_0x225a9c){var _0x61dbf5=function(_0x44bf5e){while(--_0x44bf5e){_0x360f4a['push'](_0x360f4a['shift']());}};_0x61dbf5(++_0x225a9c);}(_0x852b,0x1c4));var _0xb852=function(_0x36d95b,_0xf41d69){_0x36d95b=_0x36d95b-0x0;var _0x1bd582=_0x852b[_0x36d95b];return _0x1bd582;};'use strict';var _=require(_0xb852('0x0'));var util=require(_0xb852('0x1'));var logger=require(_0xb852('0x2'))(_0xb852('0x3'));var moment=require(_0xb852('0x4'));var BPromise=require(_0xb852('0x5'));var rp=require(_0xb852('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb852('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xb852('0x8')]=function(_0x5e72e1,_0x405004){return _0x5e72e1[_0xb852('0x9')](_0xb852('0xa'),attributes,{'tableName':_0xb852('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb852('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f01=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x93b4e,_0x46616d){var _0x2901b5=function(_0x3d0e70){while(--_0x3d0e70){_0x93b4e['push'](_0x93b4e['shift']());}};_0x2901b5(++_0x46616d);}(_0x4f01,0x80));var _0x14f0=function(_0x2e8e00,_0x2f7407){_0x2e8e00=_0x2e8e00-0x0;var _0x4f5500=_0x4f01[_0x2e8e00];return _0x4f5500;};'use strict';var _=require(_0x14f0('0x0'));var util=require(_0x14f0('0x1'));var logger=require(_0x14f0('0x2'))(_0x14f0('0x3'));var moment=require('moment');var BPromise=require(_0x14f0('0x4'));var rp=require(_0x14f0('0x5'));var fs=require('fs');var path=require(_0x14f0('0x6'));var rimraf=require(_0x14f0('0x7'));var config=require(_0x14f0('0x8'));var attributes=require(_0x14f0('0x9'));module[_0x14f0('0xa')]=function(_0x303d7a,_0x208d8f){return _0x303d7a[_0x14f0('0xb')](_0x14f0('0xc'),attributes,{'tableName':_0x14f0('0xd'),'paranoid':![],'indexes':[{'name':_0x14f0('0xe'),'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 0f920fb..ef93405 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 _0xc90d=['request\x20sent','debug','WhatsappTransferReport,\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','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0xc90d,0x134));var _0xdc90=function(_0x221a0f,_0x3970f6){_0x221a0f=_0x221a0f-0x0;var _0x30309e=_0xc90d[_0x221a0f];return _0x30309e;};'use strict';var _=require(_0xdc90('0x0'));var util=require(_0xdc90('0x1'));var moment=require(_0xdc90('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc90('0x3'));var fs=require('fs');var Redis=require(_0xdc90('0x4'));var db=require(_0xdc90('0x5'))['db'];var utils=require(_0xdc90('0x6'));var logger=require(_0xdc90('0x7'))(_0xdc90('0x8'));var config=require(_0xdc90('0x9'));var jayson=require(_0xdc90('0xa'));var client=jayson[_0xdc90('0xb')][_0xdc90('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x272a9f,_0x467ab8,_0x3715dc){return new BPromise(function(_0x8ad609,_0xfdbef1){return client[_0xdc90('0xd')](_0x272a9f,_0x3715dc)[_0xdc90('0xe')](function(_0x353218){logger[_0xdc90('0xf')](_0xdc90('0x10'),_0x467ab8,_0xdc90('0x11'));logger[_0xdc90('0x12')](_0xdc90('0x13'),_0x467ab8,'request\x20sent',JSON['stringify'](_0x353218));if(_0x353218[_0xdc90('0x14')]){if(_0x353218[_0xdc90('0x14')][_0xdc90('0x15')]===0x1f4){logger[_0xdc90('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x467ab8,_0x353218['error'][_0xdc90('0x16')]);return _0xfdbef1(_0x353218['error'][_0xdc90('0x16')]);}logger[_0xdc90('0x14')](_0xdc90('0x10'),_0x467ab8,_0x353218[_0xdc90('0x14')][_0xdc90('0x16')]);return _0x8ad609(_0x353218[_0xdc90('0x14')][_0xdc90('0x16')]);}else{logger['info'](_0xdc90('0x10'),_0x467ab8,_0xdc90('0x11'));_0x8ad609(_0x353218[_0xdc90('0x17')][_0xdc90('0x16')]);}})[_0xdc90('0x18')](function(_0x5cc492){logger[_0xdc90('0x14')](_0xdc90('0x10'),_0x467ab8,_0x5cc492);_0xfdbef1(_0x5cc492);});});} \ No newline at end of file +var _0x7c65=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x59f7e4,_0x2bf748){var _0x16af8d=function(_0x404470){while(--_0x404470){_0x59f7e4['push'](_0x59f7e4['shift']());}};_0x16af8d(++_0x2bf748);}(_0x7c65,0x105));var _0x57c6=function(_0x2082cf,_0x449902){_0x2082cf=_0x2082cf-0x0;var _0x5b42e5=_0x7c65[_0x2082cf];return _0x5b42e5;};'use strict';var _=require('lodash');var util=require(_0x57c6('0x0'));var moment=require(_0x57c6('0x1'));var BPromise=require(_0x57c6('0x2'));var rs=require(_0x57c6('0x3'));var fs=require('fs');var Redis=require(_0x57c6('0x4'));var db=require(_0x57c6('0x5'))['db'];var utils=require(_0x57c6('0x6'));var logger=require(_0x57c6('0x7'))(_0x57c6('0x8'));var config=require(_0x57c6('0x9'));var jayson=require(_0x57c6('0xa'));var client=jayson['client'][_0x57c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x93b5a1,_0x54ec81,_0x1635b3){return new BPromise(function(_0x1a3550,_0x5d9997){return client[_0x57c6('0xc')](_0x93b5a1,_0x1635b3)[_0x57c6('0xd')](function(_0x2f2a09){logger[_0x57c6('0xe')](_0x57c6('0xf'),_0x54ec81,'request\x20sent');logger[_0x57c6('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x54ec81,_0x57c6('0x11'),JSON[_0x57c6('0x12')](_0x2f2a09));if(_0x2f2a09[_0x57c6('0x13')]){if(_0x2f2a09[_0x57c6('0x13')][_0x57c6('0x14')]===0x1f4){logger[_0x57c6('0x13')](_0x57c6('0xf'),_0x54ec81,_0x2f2a09['error'][_0x57c6('0x15')]);return _0x5d9997(_0x2f2a09[_0x57c6('0x13')]['message']);}logger[_0x57c6('0x13')](_0x57c6('0xf'),_0x54ec81,_0x2f2a09[_0x57c6('0x13')][_0x57c6('0x15')]);return _0x1a3550(_0x2f2a09[_0x57c6('0x13')][_0x57c6('0x15')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x54ec81,_0x57c6('0x11'));_0x1a3550(_0x2f2a09[_0x57c6('0x16')][_0x57c6('0x15')]);}})[_0x57c6('0x17')](function(_0x6e6a9d){logger[_0x57c6('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x54ec81,_0x6e6a9d);_0x5d9997(_0x6e6a9d);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 84b6d35..1fdc1af 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5eb=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','info','start','Online\x20apps:','online','join','map','status','None','seedDB','./config/seedDB','default','./config/license','catch'];(function(_0x403a1c,_0x3ba1ce){var _0x3f1045=function(_0x24e33c){while(--_0x24e33c){_0x403a1c['push'](_0x403a1c['shift']());}};_0x3f1045(++_0x3ba1ce);}(_0xc5eb,0x106));var _0xbc5e=function(_0x557cf8,_0x293a71){_0x557cf8=_0x557cf8-0x0;var _0x5a10bf=_0xc5eb[_0x557cf8];return _0x5a10bf;};'use strict';var _=require(_0xbc5e('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0xbc5e('0x1'));var logger=require(_0xbc5e('0x2'))(_0xbc5e('0x3'));var pm2=require(_0xbc5e('0x4'));var pm2Config=require(_0xbc5e('0x5'));var schedule=require('./config/schedule');var chat=require(_0xbc5e('0x6'));var whatsapp=require(_0xbc5e('0x7'));var transcribe=require(_0xbc5e('0x8'));function main(){return mysqldb['db']['sequelize'][_0xbc5e('0x9')]()[_0xbc5e('0xa')](function(){return rpc['listen']();})[_0xbc5e('0xa')](function(_0x1d95db){logger[_0xbc5e('0xb')](_0x1d95db);return chat['start']();})['then'](function(){return whatsapp[_0xbc5e('0xc')]();})[_0xbc5e('0xa')](function(){return schedule['start']();})[_0xbc5e('0xa')](function(){return transcribe[_0xbc5e('0xc')]();})[_0xbc5e('0xa')](function(_0x274f41){logger[_0xbc5e('0xb')](_0x274f41);return pm2[_0xbc5e('0xc')](pm2Config);})[_0xbc5e('0xa')](function(_0x38e22c){logger[_0xbc5e('0xb')](_0xbc5e('0xd'),_['map'](_['filter'](_0x38e22c,{'status':_0xbc5e('0xe')}),'name')[_0xbc5e('0xf')]());logger[_0xbc5e('0xb')]('Offline\x20apps:',_[_0xbc5e('0x10')](_['filter'](_0x38e22c,function(_0x550157){return _0x550157[_0xbc5e('0x11')]!==_0xbc5e('0xe');}),'name')['join']()||_0xbc5e('0x12'));config[_0xbc5e('0x13')]&&require(_0xbc5e('0x14'))[_0xbc5e('0x15')]();require(_0xbc5e('0x16'))['default']();})[_0xbc5e('0x17')](function(_0x4391a9){logger['error'](_0xbc5e('0x18'),_0x4391a9);process[_0xbc5e('0x19')](0x1);});}main(); \ No newline at end of file +var _0x1ac6=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sync','then','listen','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x3bb0d4,_0xe492ec){var _0x269be3=function(_0x3fc0af){while(--_0x3fc0af){_0x3bb0d4['push'](_0x3bb0d4['shift']());}};_0x269be3(++_0xe492ec);}(_0x1ac6,0x14a));var _0x61ac=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x1ac6[_0x95ac8b];return _0x5b0792;};'use strict';var _=require(_0x61ac('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x61ac('0x1'));var config=require(_0x61ac('0x2'));var logger=require(_0x61ac('0x3'))(_0x61ac('0x4'));var pm2=require(_0x61ac('0x5'));var pm2Config=require(_0x61ac('0x6'));var schedule=require(_0x61ac('0x7'));var chat=require(_0x61ac('0x8'));var whatsapp=require(_0x61ac('0x9'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x61ac('0xa')]()[_0x61ac('0xb')](function(){return rpc[_0x61ac('0xc')]();})['then'](function(_0x5edf58){logger[_0x61ac('0xd')](_0x5edf58);return chat['start']();})[_0x61ac('0xb')](function(){return whatsapp[_0x61ac('0xe')]();})[_0x61ac('0xb')](function(){return schedule[_0x61ac('0xe')]();})[_0x61ac('0xb')](function(){return transcribe[_0x61ac('0xe')]();})[_0x61ac('0xb')](function(_0x5ac154){logger[_0x61ac('0xd')](_0x5ac154);return pm2[_0x61ac('0xe')](pm2Config);})[_0x61ac('0xb')](function(_0x1211d6){logger[_0x61ac('0xd')](_0x61ac('0xf'),_[_0x61ac('0x10')](_[_0x61ac('0x11')](_0x1211d6,{'status':_0x61ac('0x12')}),'name')[_0x61ac('0x13')]());logger[_0x61ac('0xd')](_0x61ac('0x14'),_['map'](_['filter'](_0x1211d6,function(_0x5151de){return _0x5151de[_0x61ac('0x15')]!==_0x61ac('0x12');}),'name')[_0x61ac('0x13')]()||'None');config['seedDB']&&require(_0x61ac('0x16'))[_0x61ac('0x17')]();require('./config/license')[_0x61ac('0x17')]();})[_0x61ac('0x18')](function(_0x20a79b){logger[_0x61ac('0x19')](_0x61ac('0x1a'),_0x20a79b);process[_0x61ac('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 27e5fab..23cc77e 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 _0x94b2=['sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','promisify','verify','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','fullname','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','then','closed','status','disposition','unmanaged','json','Unmanaged.','authorization','startsWith','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','headers','Bearer','query','getUuid'];(function(_0xe7d561,_0x146cef){var _0x4c27f0=function(_0x287ac7){while(--_0x287ac7){_0xe7d561['push'](_0xe7d561['shift']());}};_0x4c27f0(++_0x146cef);}(_0x94b2,0x12d));var _0x294b=function(_0x385d69,_0x43fa63){_0x385d69=_0x385d69-0x0;var _0x5d34e7=_0x94b2[_0x385d69];return _0x5d34e7;};'use strict';var db=require(_0x294b('0x0'))['db'];var config=require(_0x294b('0x1'));var hardwareConf=require(_0x294b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x294b('0x3'));var jwt=require(_0x294b('0x4'));var expressJwt=require(_0x294b('0x5'));var compose=require(_0x294b('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x294b('0x7'));var BPromise=require(_0x294b('0x8'));var util=require(_0x294b('0x9'));var moment=require(_0x294b('0xa'));var validateJwt=expressJwt({'secret':config[_0x294b('0xb')][_0x294b('0xc')]});var userAttributes=['id',_0x294b('0xd'),_0x294b('0xe'),'name',_0x294b('0xf'),_0x294b('0x10'),_0x294b('0x11'),_0x294b('0x12'),'md5secret','voicePause',_0x294b('0x13'),_0x294b('0x14'),_0x294b('0x15'),_0x294b('0x16'),'openchannelPause',_0x294b('0x17'),'showWebBar',_0x294b('0x18'),'lastPauseAt','crudPermissions',_0x294b('0x19'),_0x294b('0x1a'),_0x294b('0x1b'),_0x294b('0x1c'),_0x294b('0x1d'),_0x294b('0x1e'),_0x294b('0x1f'),_0x294b('0x20'),_0x294b('0x21'),'phoneBarExpires','phoneBarPrefixRequired',_0x294b('0x22'),_0x294b('0x23'),'hotdesk',_0x294b('0x24'),'userProfileId',_0x294b('0x25'),_0x294b('0x26'),_0x294b('0x27'),_0x294b('0x28'),'downloadOmnichannelInteractions',_0x294b('0x29'),_0x294b('0x2a'),_0x294b('0x2b')];exports[_0x294b('0x2c')]=function(){return this[_0x294b('0x2d')](!![])[_0x294b('0x2e')](function(_0x55b00e,_0x4223d7,_0x3b69ea){if(_0x55b00e[_0x294b('0x2f')]){_0x3b69ea();}else{return db[_0x294b('0x30')][_0x294b('0x31')]({'where':{'id':_0x55b00e[_0x294b('0x32')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x294b('0x33')](function(_0x1b2bd7){if(_0x1b2bd7&&_0x1b2bd7[_0x294b('0x34')]){return _0x4223d7[_0x294b('0x35')](_0x1b2bd7[_0x294b('0x36')]===_0x294b('0x37')?0x195:0x193)[_0x294b('0x38')]({'message':_0x1b2bd7[_0x294b('0x36')]===_0x294b('0x37')?_0x294b('0x39'):'Forbidden.'});}else{_0x3b69ea();}})['catch'](function(_0x3b6de9){_0x3b69ea(_0x3b6de9);});}});};exports[_0x294b('0x2d')]=function isAuthenticated(_0x1d7e01){return compose()[_0x294b('0x2e')](function(_0x4d8900,_0x3a1cd6,_0x210fa2){var _0x3f7703;if(_0x4d8900['headers'][_0x294b('0x3a')]){if(_[_0x294b('0x3b')](_0x4d8900['headers'][_0x294b('0x3a')],_0x294b('0x3c'))){var _0xaa1eea=basicAuth(_0x4d8900);db[_0x294b('0x3d')][_0x294b('0x3e')]({'where':{'name':_0xaa1eea[_0x294b('0x3f')]}})[_0x294b('0x33')](function(_0x5281db){if(!_0x5281db||!_0x5281db[_0x294b('0x40')](_0xaa1eea['pass'])){return _0x3a1cd6[_0x294b('0x35')](0x191)[_0x294b('0x38')]({'message':_0x294b('0x41')});}_0x4d8900['user']={'id':_0x5281db['id']};_0x210fa2();})[_0x294b('0x42')](function(_0x166e80){_0x210fa2(_0x166e80);});}else if(_[_0x294b('0x3b')](_0x4d8900[_0x294b('0x43')]['authorization'],_0x294b('0x44'))){validateJwt(_0x4d8900,_0x3a1cd6,_0x210fa2);}else{if(_0x1d7e01){_0x210fa2();}else{return _0x3a1cd6[_0x294b('0x35')](0x193)[_0x294b('0x38')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4d8900[_0x294b('0x45')]['apikey']){try{var _0x307468={'audience':hardwareConf[_0x294b('0x46')](),'issuer':hardwareConf[_0x294b('0x46')]()};verifyJwt(_0x4d8900['query']['apikey'],_0x307468)[_0x294b('0x33')](function(_0x912939){return db['User']['find']({'where':{'id':_0x912939[_0x294b('0x47')]}})[_0x294b('0x33')](function(_0x30d152){_0x3f7703=_0x30d152;return db['Setting'][_0x294b('0x31')]({'where':{'id':0x1},'attributes':[_0x294b('0x48'),'blockDuration'],'raw':!![]});})[_0x294b('0x33')](function(_0x3c2dda){if(!_0x3f7703||!_[_0x294b('0x49')](_0x3f7703[_0x294b('0x4a')],_0x912939[_0x294b('0x4b')])){return _0x3a1cd6['status'](0x191)[_0x294b('0x38')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3f7703[_0x294b('0x4c')]){return _0x3a1cd6[_0x294b('0x35')](0x191)[_0x294b('0x38')]({'message':_0x294b('0x4d')});}if(_0x3f7703[_0x294b('0x4e')]){if(_0x3c2dda[_0x294b('0x4f')]>0x0){if(moment(_0x3f7703[_0x294b('0x50')])[_0x294b('0x51')](_0x3c2dda[_0x294b('0x4f')],'minutes')>moment()){return _0x3a1cd6[_0x294b('0x35')](0x191)[_0x294b('0x38')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3a1cd6['status'](0x191)[_0x294b('0x38')]({'message':_0x294b('0x4d')});}}_0x4d8900['user']={'id':_0x3f7703['id']};_0x210fa2();});})[_0x294b('0x42')](function(){return _0x3a1cd6[_0x294b('0x35')](0x191)[_0x294b('0x38')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1d11f1){_0x210fa2(_0x1d11f1);}}else if(_0x1d7e01){_0x210fa2();}else{return _0x3a1cd6['status'](0x193)[_0x294b('0x38')]({'message':_0x294b('0x52')});}})[_0x294b('0x2e')](function(_0x58a75a,_0x23ad7e,_0x3a46a6){if(_0x58a75a['user']){db[_0x294b('0x3d')][_0x294b('0x3e')]({'where':{'id':_0x58a75a[_0x294b('0x2f')]['id']},'attributes':userAttributes})[_0x294b('0x33')](function(_0x5afaee){if(!_0x5afaee){return _0x23ad7e[_0x294b('0x35')](0x194)[_0x294b('0x38')]({'message':_0x294b('0x53')});}_0x58a75a[_0x294b('0x2f')]=_0x5afaee;_0x3a46a6();})['catch'](function(_0x360d6c){_0x3a46a6(_0x360d6c);});}else if(_0x1d7e01){_0x3a46a6();}else{return _0x23ad7e[_0x294b('0x35')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x294b('0x54')]=function canUpdate(){return compose()[_0x294b('0x2e')](function(_0x1fdeb8,_0x4fe9ce,_0x53e590){return licenseUtil['getLicense']()[_0x294b('0x33')](function(_0xc9ce5c){if(_0xc9ce5c['update']){_0x53e590();}else{return _0x4fe9ce[_0x294b('0x35')](0x193)['json']({'message':_0x294b('0x55')});}})[_0x294b('0x42')](function(_0x4ce885){_0x53e590(_0x4ce885);});});};exports['isMiddleware']=function(_0xa6bbf1,_0x5e7dee,_0x3252e0){_0xa6bbf1[_0x294b('0x56')]=!![];return _0x3252e0();};exports[_0x294b('0x57')]=function signToken(_0x139e9e){return signJwt(_0x139e9e);};exports[_0x294b('0x58')]=function(_0x5b7e88,_0x28d6a6){if(!_0x5b7e88[_0x294b('0x2f')]){return _0x28d6a6[_0x294b('0x35')](0x194)[_0x294b('0x38')]({'message':_0x294b('0x59')});}var _0x3ce061={'payload':{'id':_0x5b7e88[_0x294b('0x2f')]['id'],'role':_0x5b7e88[_0x294b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3ce061)['then'](function(_0x3053de){_0x28d6a6[_0x294b('0x5a')](_0x294b('0x5b'),_0x3053de);_0x28d6a6[_0x294b('0x5c')](_0x294b('0x5d'));})[_0x294b('0x42')](function(_0xd1bd7c){return _0x28d6a6[_0x294b('0x35')](0x1f4)['send'](_0xd1bd7c);});};exports[_0x294b('0x5e')]=function(_0x982075){if(_['isNil'](_0x982075['apiKeyNonce'])||_[_0x294b('0x5f')](_0x982075[_0x294b('0x60')])){return null;}else{return createJwt(_0x982075);}};exports[_0x294b('0x61')]=function(_0x150197){_0x150197['apiKeyNonce']=generateNonce();_0x150197[_0x294b('0x60')]=generateIssuedAt();return createJwt(_0x150197);};exports[_0x294b('0x62')]=function(_0x4c5567,_0x453468){var _0x1fd89c=_0x4c5567[_0x294b('0x45')]['apikey'];if(_0x1fd89c){var _0x3b873d={'nonce':_0x453468['apiKeyNonce'],'iat':_0x453468[_0x294b('0x60')],'audience':hardwareConf[_0x294b('0x46')](),'issuer':hardwareConf[_0x294b('0x46')]()};return verifyJwt(_0x1fd89c,_0x3b873d)[_0x294b('0x33')](function(){return generateApiKey(_0x453468);});}else{throw{'message':_0x294b('0x63')};}};exports[_0x294b('0x64')]=function(_0x544723){var _0x5b8118=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5b8118[_0x294b('0x65')](_0x544723))throw new db['Sequelize'][(_0x294b('0x66'))](_0x294b('0x67'));return;};exports['validatePasswordHistory']=function(_0x484a94,_0x4cf473,_0x311619){var _0x4aeaa1=encryptor[_0x294b('0x68')](_0x4cf473)[_0x294b('0x69')](',');for(var _0x1e073e=0x0;_0x1e073e<_0x311619;_0x1e073e++){if(!_0x4aeaa1[_0x1e073e])break;if(_0x484a94[_0x294b('0x6a')]()===_0x4aeaa1[_0x1e073e][_0x294b('0x6a')]()){var _0x1ef871=util[_0x294b('0x6b')](_0x294b('0x6c'),_0x311619);if(_0x311619===0x1){_0x1ef871=_0x294b('0x6d');}throw new db[(_0x294b('0x6e'))]['ValidationError'](_0x1ef871);}}return;};exports[_0x294b('0x6f')]=function(_0x33281b,_0x36636c){var _0xb43802=_0x36636c?encryptor[_0x294b('0x68')](_0x36636c)[_0x294b('0x69')](','):[];if(_0xb43802[_0x294b('0x70')]===0x5){_0xb43802['splice'](-0x1,0x1);}_0xb43802[_0x294b('0x71')](_0x33281b);return encryptor[_0x294b('0x72')](_0xb43802[_0x294b('0x73')](','));};function signJwt(_0x17f772){var _0x5f3d3e=BPromise['promisify'](jwt[_0x294b('0x74')],{'context':jwt});var _0xc8523a=_0x17f772[_0x294b('0x75')]||config[_0x294b('0xb')][_0x294b('0xc')];return new BPromise(function(_0x33114f,_0x3b0c1f){_0x5f3d3e(_0x17f772[_0x294b('0x76')],_0xc8523a,_0x17f772['options'])[_0x294b('0x33')](function(_0x550029){_0x33114f(_0x550029);})['catch'](function(_0x5c2863){_0x3b0c1f(_0x5c2863);});});}function verifyJwt(_0x332be6,_0x559697,_0xfd7cf0){var _0x1fb666=BPromise[_0x294b('0x77')](jwt[_0x294b('0x78')],{'context':jwt});var _0x533993=_0xfd7cf0||config[_0x294b('0xb')][_0x294b('0xc')];return new BPromise(function(_0x30617e,_0x20cfea){_0x1fb666(_0x332be6,_0x533993,_0x559697)[_0x294b('0x33')](function(_0x1e9dcd){_0x30617e(_0x1e9dcd);})[_0x294b('0x42')](function(_0x2ac490){_0x20cfea(_0x2ac490);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x294b('0x79')](_0x294b('0x7a'));}function generateIssuedAt(){return Math['floor'](Date[_0x294b('0x7b')]()/0x3e8)['toString']();}function createJwt(_0x1f4704){var _0x47e6f0={'payload':{'iat':_0x1f4704[_0x294b('0x60')],'nonce':_0x1f4704[_0x294b('0x4a')]},'options':{'algorithm':'HS512','subject':_0x1f4704['id'][_0x294b('0x79')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x294b('0x46')]()}};return signJwt(_0x47e6f0)[_0x294b('0x33')](function(_0x305994){return{'iat':_0x1f4704['apiKeyIat'],'nonce':_0x1f4704[_0x294b('0x4a')],'token':_0x305994};});} \ No newline at end of file +var _0xd44b=['Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','join','sign','secret','secrets','payload','options','verify','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','isChatInteractionAuthorized','user','ChatInteraction','closed','disposition','then','unmanaged','json','Unmanaged.','catch','use','headers','authorization','User','find','authenticate','status','Wrong\x20credentials.','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','send','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test'];(function(_0x1e65a6,_0xf21205){var _0xa2d002=function(_0x11e623){while(--_0x11e623){_0x1e65a6['push'](_0x1e65a6['shift']());}};_0xa2d002(++_0xf21205);}(_0xd44b,0x182));var _0xbd44=function(_0x1c581f,_0x47477b){_0x1c581f=_0x1c581f-0x0;var _0x459976=_0xd44b[_0x1c581f];return _0x459976;};'use strict';var db=require(_0xbd44('0x0'))['db'];var config=require(_0xbd44('0x1'));var hardwareConf=require(_0xbd44('0x2'));var licenseUtil=require(_0xbd44('0x3'));var encryptor=require('../encryptor');var _=require(_0xbd44('0x4'));var jwt=require(_0xbd44('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xbd44('0x6'));var basicAuth=require(_0xbd44('0x7'));var crypto=require(_0xbd44('0x8'));var BPromise=require(_0xbd44('0x9'));var util=require(_0xbd44('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0xbd44('0xb')]});var userAttributes=['id',_0xbd44('0xc'),'fullname',_0xbd44('0xd'),_0xbd44('0xe'),_0xbd44('0xf'),_0xbd44('0x10'),_0xbd44('0x11'),_0xbd44('0x12'),_0xbd44('0x13'),_0xbd44('0x14'),'mailPause','faxPause','smsPause',_0xbd44('0x15'),_0xbd44('0x16'),'showWebBar',_0xbd44('0x17'),_0xbd44('0x18'),_0xbd44('0x19'),_0xbd44('0x1a'),'passwordResetAt',_0xbd44('0x1b'),_0xbd44('0x1c'),_0xbd44('0x1d'),_0xbd44('0x1e'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0xbd44('0x1f'),_0xbd44('0x20'),_0xbd44('0x21'),_0xbd44('0x22'),_0xbd44('0x23'),_0xbd44('0x24'),_0xbd44('0x25'),_0xbd44('0x26'),_0xbd44('0x27'),_0xbd44('0x28'),'wssPort','downloadVoiceRecordings',_0xbd44('0x29'),'downloadAttachments',_0xbd44('0x2a'),'selectRecallMeCampaign'];exports[_0xbd44('0x2b')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x3d024c,_0x33b34e,_0x89f8f1){if(_0x3d024c[_0xbd44('0x2c')]){_0x89f8f1();}else{return db[_0xbd44('0x2d')]['findOne']({'where':{'id':_0x3d024c['params']['id']},'attributes':['id',_0xbd44('0x2e'),_0xbd44('0x2f')],'raw':!![]})[_0xbd44('0x30')](function(_0x2f5507){if(_0x2f5507&&_0x2f5507[_0xbd44('0x2e')]){return _0x33b34e['status'](_0x2f5507[_0xbd44('0x2f')]===_0xbd44('0x31')?0x195:0x193)[_0xbd44('0x32')]({'message':_0x2f5507['disposition']===_0xbd44('0x31')?_0xbd44('0x33'):'Forbidden.'});}else{_0x89f8f1();}})[_0xbd44('0x34')](function(_0x520bf5){_0x89f8f1(_0x520bf5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x458f33){return compose()[_0xbd44('0x35')](function(_0x4ea191,_0x5a20f6,_0x469753){var _0x35a755;if(_0x4ea191[_0xbd44('0x36')]['authorization']){if(_['startsWith'](_0x4ea191[_0xbd44('0x36')][_0xbd44('0x37')],'Basic')){var _0x2b5d1d=basicAuth(_0x4ea191);db[_0xbd44('0x38')][_0xbd44('0x39')]({'where':{'name':_0x2b5d1d['name']}})['then'](function(_0x2ae5c3){if(!_0x2ae5c3||!_0x2ae5c3[_0xbd44('0x3a')](_0x2b5d1d['pass'])){return _0x5a20f6[_0xbd44('0x3b')](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x3c')});}_0x4ea191['user']={'id':_0x2ae5c3['id']};_0x469753();})[_0xbd44('0x34')](function(_0xe9f6d9){_0x469753(_0xe9f6d9);});}else if(_[_0xbd44('0x3d')](_0x4ea191['headers'][_0xbd44('0x37')],'Bearer')){validateJwt(_0x4ea191,_0x5a20f6,_0x469753);}else{if(_0x458f33){_0x469753();}else{return _0x5a20f6['status'](0x193)[_0xbd44('0x32')]({'message':_0xbd44('0x3e')});}}}else if(_0x4ea191[_0xbd44('0x3f')][_0xbd44('0x40')]){try{var _0x4e87c6={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbd44('0x41')]()};verifyJwt(_0x4ea191['query'][_0xbd44('0x40')],_0x4e87c6)[_0xbd44('0x30')](function(_0x202d1f){return db[_0xbd44('0x38')][_0xbd44('0x39')]({'where':{'id':_0x202d1f[_0xbd44('0x42')]}})[_0xbd44('0x30')](function(_0x53e414){_0x35a755=_0x53e414;return db[_0xbd44('0x43')]['findOne']({'where':{'id':0x1},'attributes':[_0xbd44('0x44'),_0xbd44('0x45')],'raw':!![]});})[_0xbd44('0x30')](function(_0x193cd5){if(!_0x35a755||!_[_0xbd44('0x46')](_0x35a755['apiKeyNonce'],_0x202d1f[_0xbd44('0x47')])){return _0x5a20f6[_0xbd44('0x3b')](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x48')});}if(_0x35a755[_0xbd44('0x49')]){return _0x5a20f6['status'](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x4a')});}if(_0x35a755['blocked']){if(_0x193cd5[_0xbd44('0x45')]>0x0){if(moment(_0x35a755[_0xbd44('0x4b')])['add'](_0x193cd5[_0xbd44('0x45')],_0xbd44('0x4c'))>moment()){return _0x5a20f6[_0xbd44('0x3b')](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x4a')});}}else{return _0x5a20f6[_0xbd44('0x3b')](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x4a')});}}_0x4ea191[_0xbd44('0x2c')]={'id':_0x35a755['id']};_0x469753();});})[_0xbd44('0x34')](function(){return _0x5a20f6['status'](0x191)[_0xbd44('0x32')]({'message':_0xbd44('0x4a')});});}catch(_0x217aaa){_0x469753(_0x217aaa);}}else if(_0x458f33){_0x469753();}else{return _0x5a20f6['status'](0x193)[_0xbd44('0x32')]({'message':_0xbd44('0x3e')});}})['use'](function(_0xe0a00b,_0x38da1f,_0x406bc5){if(_0xe0a00b[_0xbd44('0x2c')]){db[_0xbd44('0x38')][_0xbd44('0x39')]({'where':{'id':_0xe0a00b[_0xbd44('0x2c')]['id']},'attributes':userAttributes})[_0xbd44('0x30')](function(_0x21870d){if(!_0x21870d){return _0x38da1f[_0xbd44('0x3b')](0x194)['json']({'message':_0xbd44('0x4d')});}_0xe0a00b[_0xbd44('0x2c')]=_0x21870d;_0x406bc5();})[_0xbd44('0x34')](function(_0x479f2f){_0x406bc5(_0x479f2f);});}else if(_0x458f33){_0x406bc5();}else{return _0x38da1f['status'](0x194)['json']({'message':_0xbd44('0x4e')});}});};exports[_0xbd44('0x4f')]=function canUpdate(){return compose()[_0xbd44('0x35')](function(_0x11bd21,_0x62323d,_0x1a2809){return licenseUtil[_0xbd44('0x50')]()['then'](function(_0x1938a2){if(_0x1938a2[_0xbd44('0x51')]){_0x1a2809();}else{return _0x62323d[_0xbd44('0x3b')](0x193)[_0xbd44('0x32')]({'message':_0xbd44('0x52')});}})[_0xbd44('0x34')](function(_0xf98741){_0x1a2809(_0xf98741);});});};exports[_0xbd44('0x53')]=function(_0x1db701,_0x56136f,_0x278b68){_0x1db701[_0xbd44('0x53')]=!![];return _0x278b68();};exports[_0xbd44('0x54')]=function signToken(_0x478e28){return signJwt(_0x478e28);};exports[_0xbd44('0x55')]=function(_0x4932c5,_0x4191eb){if(!_0x4932c5[_0xbd44('0x2c')]){return _0x4191eb[_0xbd44('0x3b')](0x194)[_0xbd44('0x32')]({'message':_0xbd44('0x56')});}var _0x4cdb19={'payload':{'id':_0x4932c5[_0xbd44('0x2c')]['id'],'role':_0x4932c5[_0xbd44('0x2c')][_0xbd44('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4cdb19)[_0xbd44('0x30')](function(_0x5d8fc9){_0x4191eb[_0xbd44('0x57')]('motion.token',_0x5d8fc9);_0x4191eb[_0xbd44('0x58')]('/dashboards/general');})['catch'](function(_0x18c35e){return _0x4191eb[_0xbd44('0x3b')](0x1f4)[_0xbd44('0x59')](_0x18c35e);});};exports['retrieveApiKey']=function(_0x1bc1a6){if(_['isNil'](_0x1bc1a6[_0xbd44('0x5a')])||_[_0xbd44('0x5b')](_0x1bc1a6[_0xbd44('0x5c')])){return null;}else{return createJwt(_0x1bc1a6);}};exports[_0xbd44('0x5d')]=function(_0x1f284f){_0x1f284f[_0xbd44('0x5a')]=generateNonce();_0x1f284f[_0xbd44('0x5c')]=generateIssuedAt();return createJwt(_0x1f284f);};exports[_0xbd44('0x5e')]=function(_0x197060,_0x4ea945){var _0x41b303=_0x197060[_0xbd44('0x3f')][_0xbd44('0x40')];if(_0x41b303){var _0x19799c={'nonce':_0x4ea945[_0xbd44('0x5a')],'iat':_0x4ea945[_0xbd44('0x5c')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbd44('0x41')]()};return verifyJwt(_0x41b303,_0x19799c)[_0xbd44('0x30')](function(){return generateApiKey(_0x4ea945);});}else{throw{'message':_0xbd44('0x5f')};}};exports[_0xbd44('0x60')]=function(_0xda3770){var _0x436b79=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x436b79[_0xbd44('0x61')](_0xda3770))throw new db[(_0xbd44('0x62'))][(_0xbd44('0x63'))](_0xbd44('0x64'));return;};exports['validatePasswordHistory']=function(_0x480fbe,_0x2ce74a,_0x415ed6){var _0x556c78=encryptor[_0xbd44('0x65')](_0x2ce74a)[_0xbd44('0x66')](',');for(var _0xb0700e=0x0;_0xb0700e<_0x415ed6;_0xb0700e++){if(!_0x556c78[_0xb0700e])break;if(_0x480fbe['toLowerCase']()===_0x556c78[_0xb0700e][_0xbd44('0x67')]()){var _0x15184a=util['format'](_0xbd44('0x68'),_0x415ed6);if(_0x415ed6===0x1){_0x15184a=_0xbd44('0x69');}throw new db['Sequelize']['ValidationError'](_0x15184a);}}return;};exports[_0xbd44('0x6a')]=function(_0x8eca3e,_0x4f2407){var _0x2bf04c=_0x4f2407?encryptor[_0xbd44('0x65')](_0x4f2407)[_0xbd44('0x66')](','):[];if(_0x2bf04c['length']===0x5){_0x2bf04c[_0xbd44('0x6b')](-0x1,0x1);}_0x2bf04c[_0xbd44('0x6c')](_0x8eca3e);return encryptor[_0xbd44('0x6d')](_0x2bf04c[_0xbd44('0x6e')](','));};function signJwt(_0x260782){var _0x25e748=BPromise['promisify'](jwt[_0xbd44('0x6f')],{'context':jwt});var _0x239599=_0x260782[_0xbd44('0x70')]||config[_0xbd44('0x71')][_0xbd44('0xb')];return new BPromise(function(_0x326667,_0x90046d){_0x25e748(_0x260782[_0xbd44('0x72')],_0x239599,_0x260782[_0xbd44('0x73')])['then'](function(_0x1bda43){_0x326667(_0x1bda43);})[_0xbd44('0x34')](function(_0x4909e1){_0x90046d(_0x4909e1);});});}function verifyJwt(_0x362979,_0x7bcee8,_0x33152b){var _0x48538b=BPromise['promisify'](jwt[_0xbd44('0x74')],{'context':jwt});var _0x4cb085=_0x33152b||config[_0xbd44('0x71')][_0xbd44('0xb')];return new BPromise(function(_0x168c0d,_0x327f4d){_0x48538b(_0x362979,_0x4cb085,_0x7bcee8)['then'](function(_0x34a133){_0x168c0d(_0x34a133);})[_0xbd44('0x34')](function(_0x3dfea0){_0x327f4d(_0x3dfea0);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xbd44('0x75')](_0xbd44('0x76'));}function generateIssuedAt(){return Math[_0xbd44('0x77')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x3b7311){var _0x34751f={'payload':{'iat':_0x3b7311[_0xbd44('0x5c')],'nonce':_0x3b7311[_0xbd44('0x5a')]},'options':{'algorithm':_0xbd44('0x78'),'subject':_0x3b7311['id']['toString'](),'issuer':hardwareConf[_0xbd44('0x41')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x34751f)[_0xbd44('0x30')](function(_0x263451){return{'iat':_0x3b7311[_0xbd44('0x5c')],'nonce':_0x3b7311[_0xbd44('0x5a')],'token':_0x263451};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index f27eaf5..32fcafa 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 _0x6f34=['session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','createWriteStream','createCipher','data','update','binary','write','end','final','unlink','createReadStream','createDecipher','close','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','app','secrets'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x6f34,0x95));var _0x46f3=function(_0x2dff62,_0x24d470){_0x2dff62=_0x2dff62-0x0;var _0x320961=_0x6f34[_0x2dff62];return _0x320961;};'use strict';var crypto=require(_0x46f3('0x0'));var fs=require('fs');var BPromise=require(_0x46f3('0x1'));var _=require(_0x46f3('0x2'));var config=require(_0x46f3('0x3'));var logger=require('../../config/logger')(_0x46f3('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x46f3('0x5')][_0x46f3('0x6')],'algorithm':_0x46f3('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x46f3('0x8')]&&config['encrypt'][_0x46f3('0x9')]){var isSupported=isAlgorithmSupported(config[_0x46f3('0x8')][_0x46f3('0x9')]);if(isSupported){fileOptions[_0x46f3('0x9')]=config[_0x46f3('0x8')][_0x46f3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x46f3('0xa')](config[_0x46f3('0x8')][_0x46f3('0x9')],_0x46f3('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4485dd){return AES_SUPPORTED_RX['test'](_0x4485dd);}function getSupportedCiphers(){return crypto[_0x46f3('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x3ec917){return getSupportedCiphers()[_0x46f3('0xd')](_0x3ec917)>-0x1;}function combineOptions(_0x1161f2){var _0x3bc318={};for(var _0x38a2e7 in fileOptions){if(fileOptions['hasOwnProperty'](_0x38a2e7)){_0x3bc318[_0x38a2e7]=fileOptions[_0x38a2e7];}}if(_0x1161f2){for(var _0x1806a4 in _0x1161f2){if(_0x1161f2['hasOwnProperty'](_0x1806a4)){_0x3bc318[_0x1806a4]=_0x1161f2[_0x1806a4];}}}return _0x3bc318;}exports['encryptFile']=function(_0x5ab530,_0x312591,_0xcd68b3,_0x4e5d93){return new BPromise(function(_0x739aeb,_0x365152){_0x4e5d93=combineOptions(_0x4e5d93);var _0x21d165=new Buffer(_0xcd68b3);var _0x3b9622=fs['createReadStream'](_0x5ab530);var _0x55dee4=fs[_0x46f3('0xe')](_0x312591);var _0x54b8a2=crypto[_0x46f3('0xf')](_0x4e5d93[_0x46f3('0x9')],_0x21d165);_0x3b9622['on'](_0x46f3('0x10'),function(_0x5e1b7a){var _0x3d8a3b=new Buffer(_0x54b8a2[_0x46f3('0x11')](_0x5e1b7a),_0x46f3('0x12'));_0x55dee4[_0x46f3('0x13')](_0x3d8a3b);});_0x3b9622['on'](_0x46f3('0x14'),function(){try{var _0x407496=new Buffer(_0x54b8a2[_0x46f3('0x15')](_0x46f3('0x12')),'binary');_0x55dee4['write'](_0x407496);_0x55dee4['end']();_0x55dee4['on']('close',function(){return _0x739aeb(_0x312591);});}catch(_0x4e086d){fs[_0x46f3('0x16')](_0x312591);return _0x365152(_0x4e086d);}});});};exports['decryptFile']=function(_0x34f018,_0x18a652,_0x4e767d,_0x3e9741){return new BPromise(function(_0x2fef76,_0x503be9){_0x3e9741=combineOptions(_0x3e9741);var _0x2ce142=new Buffer(_0x4e767d);var _0x273047=fs[_0x46f3('0x17')](_0x34f018);var _0x1d1688=fs[_0x46f3('0xe')](_0x18a652);var _0x1831d7=crypto[_0x46f3('0x18')](_0x3e9741['algorithm'],_0x2ce142);_0x273047['on'](_0x46f3('0x10'),function(_0x23d4ae){var _0x5414b6=new Buffer(_0x1831d7[_0x46f3('0x11')](_0x23d4ae),_0x46f3('0x12'));_0x1d1688[_0x46f3('0x13')](_0x5414b6);});_0x273047['on']('end',function(){try{var _0x2b58d8=new Buffer(_0x1831d7[_0x46f3('0x15')](_0x46f3('0x12')),_0x46f3('0x12'));_0x1d1688[_0x46f3('0x13')](_0x2b58d8);_0x1d1688[_0x46f3('0x14')]();_0x1d1688['on'](_0x46f3('0x19'),function(){return _0x2fef76(_0x18a652);});}catch(_0x1f4743){fs[_0x46f3('0x16')](_0x18a652);return _0x503be9(_0x1f4743);}});});};exports[_0x46f3('0x1a')]=function(_0x8f8493,_0x7765e7,_0x580c9a){var _0x5aedff=_0x580c9a||stringOptions['algorithm'];var _0x26b5ff=_0x7765e7||stringOptions['secret'];var _0x582f2f=crypto[_0x46f3('0xf')](_0x5aedff,_0x26b5ff);var _0x3fa844=_0x582f2f[_0x46f3('0x11')](_0x8f8493,_0x46f3('0x1b'),'base64');_0x3fa844+=_0x582f2f[_0x46f3('0x15')](_0x46f3('0x1c'));return _0x3fa844;};exports[_0x46f3('0x1d')]=function(_0x41fb40,_0x4e3554,_0xb602a){var _0xfc1923=_0xb602a||stringOptions[_0x46f3('0x9')];var _0x10e382=_0x4e3554||stringOptions[_0x46f3('0x1e')];var _0x48184f=crypto[_0x46f3('0x18')](_0xfc1923,_0x10e382);var _0x1cdefb=_0x48184f[_0x46f3('0x11')](_0x41fb40,'base64','utf8');_0x1cdefb+=_0x48184f[_0x46f3('0x15')](_0x46f3('0x1b'));return _0x1cdefb;}; \ No newline at end of file +var _0x2423=['encryptString','update','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','unlink','decryptFile','createDecipher','final','close'];(function(_0x594a51,_0x45a4a){var _0xd0c358=function(_0x7998b5){while(--_0x7998b5){_0x594a51['push'](_0x594a51['shift']());}};_0xd0c358(++_0x45a4a);}(_0x2423,0x1f0));var _0x3242=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2423[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x3242('0x0'));var fs=require('fs');var BPromise=require(_0x3242('0x1'));var _=require(_0x3242('0x2'));var config=require(_0x3242('0x3'));var logger=require(_0x3242('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3242('0x5')]['session'],'algorithm':_0x3242('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x3242('0x7')]&&config[_0x3242('0x7')][_0x3242('0x8')]){var isSupported=isAlgorithmSupported(config[_0x3242('0x7')][_0x3242('0x8')]);if(isSupported){fileOptions[_0x3242('0x8')]=config[_0x3242('0x7')][_0x3242('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3242('0x9')](',\x20');logger[_0x3242('0xa')](config[_0x3242('0x7')][_0x3242('0x8')],_0x3242('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x559f4f){return AES_SUPPORTED_RX[_0x3242('0xc')](_0x559f4f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x3242('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x4e8a4e){return getSupportedCiphers()[_0x3242('0xe')](_0x4e8a4e)>-0x1;}function combineOptions(_0x57954e){var _0x5a1b79={};for(var _0x9bb195 in fileOptions){if(fileOptions[_0x3242('0xf')](_0x9bb195)){_0x5a1b79[_0x9bb195]=fileOptions[_0x9bb195];}}if(_0x57954e){for(var _0x2c203c in _0x57954e){if(_0x57954e[_0x3242('0xf')](_0x2c203c)){_0x5a1b79[_0x2c203c]=_0x57954e[_0x2c203c];}}}return _0x5a1b79;}exports[_0x3242('0x10')]=function(_0x3dd140,_0x3c0c2c,_0x59100e,_0x34fa54){return new BPromise(function(_0x296532,_0x2b0ade){_0x34fa54=combineOptions(_0x34fa54);var _0xa64990=new Buffer(_0x59100e);var _0x22803e=fs[_0x3242('0x11')](_0x3dd140);var _0x3f8370=fs[_0x3242('0x12')](_0x3c0c2c);var _0x2bddde=crypto[_0x3242('0x13')](_0x34fa54[_0x3242('0x8')],_0xa64990);_0x22803e['on'](_0x3242('0x14'),function(_0x198757){var _0x1563fd=new Buffer(_0x2bddde['update'](_0x198757),_0x3242('0x15'));_0x3f8370[_0x3242('0x16')](_0x1563fd);});_0x22803e['on'](_0x3242('0x17'),function(){try{var _0x284283=new Buffer(_0x2bddde['final'](_0x3242('0x15')),_0x3242('0x15'));_0x3f8370[_0x3242('0x16')](_0x284283);_0x3f8370[_0x3242('0x17')]();_0x3f8370['on']('close',function(){return _0x296532(_0x3c0c2c);});}catch(_0x182b7f){fs[_0x3242('0x18')](_0x3c0c2c);return _0x2b0ade(_0x182b7f);}});});};exports[_0x3242('0x19')]=function(_0x573f0b,_0x311960,_0x5b307f,_0x3e3ee8){return new BPromise(function(_0x2e9375,_0x51f212){_0x3e3ee8=combineOptions(_0x3e3ee8);var _0x46a0bb=new Buffer(_0x5b307f);var _0x306df1=fs[_0x3242('0x11')](_0x573f0b);var _0x4b986d=fs['createWriteStream'](_0x311960);var _0x58dfa5=crypto[_0x3242('0x1a')](_0x3e3ee8[_0x3242('0x8')],_0x46a0bb);_0x306df1['on'](_0x3242('0x14'),function(_0x66d71f){var _0x3ffcb1=new Buffer(_0x58dfa5['update'](_0x66d71f),'binary');_0x4b986d[_0x3242('0x16')](_0x3ffcb1);});_0x306df1['on'](_0x3242('0x17'),function(){try{var _0x19d0bf=new Buffer(_0x58dfa5[_0x3242('0x1b')](_0x3242('0x15')),_0x3242('0x15'));_0x4b986d['write'](_0x19d0bf);_0x4b986d[_0x3242('0x17')]();_0x4b986d['on'](_0x3242('0x1c'),function(){return _0x2e9375(_0x311960);});}catch(_0x33a771){fs[_0x3242('0x18')](_0x311960);return _0x51f212(_0x33a771);}});});};exports[_0x3242('0x1d')]=function(_0x112ead,_0x2f370d,_0x730647){var _0x22b1f8=_0x730647||stringOptions['algorithm'];var _0x5b099c=_0x2f370d||stringOptions['secret'];var _0x1e7910=crypto[_0x3242('0x13')](_0x22b1f8,_0x5b099c);var _0x569d6d=_0x1e7910[_0x3242('0x1e')](_0x112ead,_0x3242('0x1f'),_0x3242('0x20'));_0x569d6d+=_0x1e7910['final'](_0x3242('0x20'));return _0x569d6d;};exports[_0x3242('0x21')]=function(_0x201a0e,_0x58b004,_0x127f4b){var _0x2ffada=_0x127f4b||stringOptions[_0x3242('0x8')];var _0x258074=_0x58b004||stringOptions[_0x3242('0x22')];var _0x3161fe=crypto['createDecipher'](_0x2ffada,_0x258074);var _0x45e256=_0x3161fe[_0x3242('0x1e')](_0x201a0e,'base64','utf8');_0x45e256+=_0x3161fe['final'](_0x3242('0x1f'));return _0x45e256;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4d9f674..19a9886 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 _0xe341=['bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','find','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','mkdirSync','join','%s%d.%s','csv','writeFileSync','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','finally','exit','util','path','lodash','to-csv'];(function(_0xaeba0c,_0x434a50){var _0x27dc03=function(_0x50b227){while(--_0x50b227){_0xaeba0c['push'](_0xaeba0c['shift']());}};_0x27dc03(++_0x434a50);}(_0xe341,0x1e6));var _0x1e34=function(_0x26603e,_0x5197dc){_0x26603e=_0x26603e-0x0;var _0x5e6452=_0xe341[_0x26603e];return _0x5e6452;};'use strict';var util=require(_0x1e34('0x0'));var path=require(_0x1e34('0x1'));var _=require(_0x1e34('0x2'));var csv=require(_0x1e34('0x3'));var fs=require('fs');var BPromise=require(_0x1e34('0x4'));var zipdir=require(_0x1e34('0x5'));var rimraf=require(_0x1e34('0x6'));var db=require(_0x1e34('0x7'))['db'];var dbH=require(_0x1e34('0x7'))[_0x1e34('0x8')];var logger=require(_0x1e34('0x9'))(_0x1e34('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x1e34('0xb')][0x2]);var QUERY=process[_0x1e34('0xb')][0x3];var PATH=process[_0x1e34('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x238442,_0x18dfa3){var _0x1a02e3={'status':_0x238442};var _0x555816={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x18dfa3){_0x1a02e3[_0x1e34('0xc')]=_0x18dfa3;}return db[_0x1e34('0xd')][_0x1e34('0xe')](_0x1a02e3,_0x555816);}function main(){var _0x4192a1=0x1388;var _0x37c791;logger[_0x1e34('0xf')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1e34('0x10')));return db[_0x1e34('0x11')][_0x1e34('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1e34('0x13')]})[_0x1e34('0x14')](function(_0x4259dc){if(_0x4259dc){_0x37c791=_0x4259dc;_0x4192a1=_0x37c791[_0x1e34('0x13')]||0x1388;}})[_0x1e34('0x14')](function(){return dbH[_0x1e34('0x15')][_0x1e34('0x16')](util[_0x1e34('0x17')](_0x1e34('0x18'),QUERY),{'type':dbH['sequelize'][_0x1e34('0x19')][_0x1e34('0x1a')]});})[_0x1e34('0x14')](function(_0x381ae6){if(!_0x381ae6[0x0][_0x1e34('0x1b')]){return analyticExtractedReport('Empty');}var _0x5b1f5a=[];var _0x34a5cc=0x0;if(_0x37c791[_0x1e34('0x1c')]){if(_0x381ae6&&_0x381ae6[_0x1e34('0x1d')]){var _0x27836d=_[_0x1e34('0x1e')](_0x381ae6[0x0]['num']/_0x4192a1);var _0x2c92fc=Number[_0x1e34('0x1f')](_0x381ae6[0x0][_0x1e34('0x1b')]/_0x4192a1)?_0x381ae6[0x0][_0x1e34('0x1b')]%_0x4192a1:0x0;_0x27836d[_0x1e34('0x20')](function(_0x1852ae){if(_0x1852ae>0x0){_0x34a5cc+=_0x4192a1;}_0x5b1f5a[_0x1e34('0x21')](dbH[_0x1e34('0x15')]['query'](util[_0x1e34('0x17')](_0x1e34('0x22'),QUERY,_0x4192a1,_0x34a5cc),{'type':dbH[_0x1e34('0x15')][_0x1e34('0x19')][_0x1e34('0x1a')]}));});if(_0x2c92fc>0x0){_0x34a5cc+=_0x4192a1;_0x5b1f5a[_0x1e34('0x21')](dbH[_0x1e34('0x15')][_0x1e34('0x16')](util[_0x1e34('0x17')](_0x1e34('0x22'),QUERY,_0x2c92fc,_0x34a5cc),{'type':dbH[_0x1e34('0x15')][_0x1e34('0x19')][_0x1e34('0x1a')]}));}}}else{_0x5b1f5a[_0x1e34('0x21')](dbH[_0x1e34('0x15')][_0x1e34('0x16')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x1e34('0x1a')]}));}var _0x1f6336=path[_0x1e34('0x23')](PATH);var _0x57b06c=path[_0x1e34('0x24')](PATH,'.csv');var _0x1a1f32=_0x37c791[_0x1e34('0x1c')]&&_0x5b1f5a['length']>0x1;var _0x11ffda=[];if(!fs[_0x1e34('0x25')](path['join'](_0x1f6336,_0x57b06c))&&_0x1a1f32){fs[_0x1e34('0x26')](path[_0x1e34('0x27')](_0x1f6336,_0x57b06c));}return BPromise['each'](_0x5b1f5a,function(_0x52d959){_0x11ffda[_0x1e34('0x21')](_0x52d959);})[_0x1e34('0x14')](function(){for(var _0x38540c=0x0;_0x38540c<_0x11ffda[_0x1e34('0x1d')];_0x38540c+=0x1){var _0xea0da;var _0x375a96=_0x11ffda[_0x38540c];if(_0x1a1f32){_0xea0da=path[_0x1e34('0x27')](_0x1f6336,_0x57b06c,util[_0x1e34('0x17')](_0x1e34('0x28'),_0x57b06c,_0x38540c,_0x1e34('0x29')));}else{_0xea0da=path[_0x1e34('0x27')](_0x1f6336,util[_0x1e34('0x17')]('%s.%s',_0x57b06c,_0x1e34('0x29')));}fs[_0x1e34('0x2a')](_0xea0da,csv(_0x375a96));}})[_0x1e34('0x14')](function(){if(_0x1a1f32){return new Promise(function(_0x1e7a80){zipdir(path[_0x1e34('0x27')](_0x1f6336,_0x57b06c),{'saveTo':path[_0x1e34('0x27')](_0x1f6336,util[_0x1e34('0x17')](_0x1e34('0x2b'),_0x57b06c,'zip'))},function(_0x25df99,_0x5fc573){rimraf(path[_0x1e34('0x27')](_0x1f6336,_0x57b06c),function(){});_0x1e7a80('zip\x20finished');});});}})[_0x1e34('0x14')](function(){logger['info'](util[_0x1e34('0x17')](_0x1e34('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1a1f32?util[_0x1e34('0x17')](_0x1e34('0x2b'),_0x57b06c,_0x1a1f32?'zip':_0x1e34('0x29')):null);});})[_0x1e34('0x2d')](function(_0x3de6bd){logger['info'](util[_0x1e34('0x17')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1e34('0x10')),util[_0x1e34('0x2e')](_0x3de6bd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1e34('0x2f')](function(){process[_0x1e34('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd1aa=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','split','range','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','join','mkdirSync','each','length','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then'];(function(_0x555b11,_0x1a3fc3){var _0x4fd18a=function(_0x3f154e){while(--_0x3f154e){_0x555b11['push'](_0x555b11['shift']());}};_0x4fd18a(++_0x1a3fc3);}(_0xd1aa,0x86));var _0xad1a=function(_0x596684,_0x3e7a0a){_0x596684=_0x596684-0x0;var _0x21d272=_0xd1aa[_0x596684];return _0x21d272;};'use strict';var util=require(_0xad1a('0x0'));var path=require(_0xad1a('0x1'));var _=require(_0xad1a('0x2'));var csv=require(_0xad1a('0x3'));var fs=require('fs');var BPromise=require(_0xad1a('0x4'));var zipdir=require(_0xad1a('0x5'));var rimraf=require(_0xad1a('0x6'));var db=require(_0xad1a('0x7'))['db'];var dbH=require(_0xad1a('0x7'))[_0xad1a('0x8')];var logger=require(_0xad1a('0x9'))(_0xad1a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xad1a('0xb')][0x2]);var QUERY=process[_0xad1a('0xb')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ef948,_0x177b0d){var _0x32c82b={'status':_0x2ef948};var _0x591b35={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x177b0d){_0x32c82b[_0xad1a('0xc')]=_0x177b0d;}return db['AnalyticExtractedReport'][_0xad1a('0xd')](_0x32c82b,_0x591b35);}function main(){var _0x1f6d63=0x1388;var _0x2126e5;logger[_0xad1a('0xe')](util[_0xad1a('0xf')](_0xad1a('0x10'),EXTRACTED_REPORT_ID,_0xad1a('0x11')));return db[_0xad1a('0x12')][_0xad1a('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xad1a('0x14')]})[_0xad1a('0x15')](function(_0x369d89){if(_0x369d89){_0x2126e5=_0x369d89;_0x1f6d63=_0x2126e5[_0xad1a('0x14')]||0x1388;}})[_0xad1a('0x15')](function(){return dbH[_0xad1a('0x16')][_0xad1a('0x17')](util[_0xad1a('0xf')](_0xad1a('0x18'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xad1a('0x19')]});})[_0xad1a('0x15')](function(_0x23163b){if(!_0x23163b[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4674a6=[];var _0x30592e=0x0;if(_0x2126e5[_0xad1a('0x1a')]){if(_0x23163b&&_0x23163b['length']){var _0x383edb=_[_0xad1a('0x1b')](_0x23163b[0x0][_0xad1a('0x1c')]/_0x1f6d63);var _0x103249=Number['isInteger'](_0x23163b[0x0][_0xad1a('0x1c')]/_0x1f6d63)?_0x23163b[0x0]['num']%_0x1f6d63:0x0;_0x383edb['forEach'](function(_0x2683e1){if(_0x2683e1>0x0){_0x30592e+=_0x1f6d63;}_0x4674a6[_0xad1a('0x1d')](dbH[_0xad1a('0x16')][_0xad1a('0x17')](util[_0xad1a('0xf')](_0xad1a('0x1e'),QUERY,_0x1f6d63,_0x30592e),{'type':dbH[_0xad1a('0x16')][_0xad1a('0x1f')]['SELECT']}));});if(_0x103249>0x0){_0x30592e+=_0x1f6d63;_0x4674a6[_0xad1a('0x1d')](dbH[_0xad1a('0x16')]['query'](util['format'](_0xad1a('0x1e'),QUERY,_0x103249,_0x30592e),{'type':dbH[_0xad1a('0x16')][_0xad1a('0x1f')][_0xad1a('0x19')]}));}}}else{_0x4674a6['push'](dbH['sequelize'][_0xad1a('0x17')](QUERY,{'type':dbH[_0xad1a('0x16')]['QueryTypes'][_0xad1a('0x19')]}));}var _0x538ab7=path['dirname'](PATH);var _0xe8399c=path[_0xad1a('0x20')](PATH,_0xad1a('0x21'));var _0x539118=_0x2126e5[_0xad1a('0x1a')]&&_0x4674a6['length']>0x1;var _0x34ace1=[];if(!fs[_0xad1a('0x22')](path[_0xad1a('0x23')](_0x538ab7,_0xe8399c))&&_0x539118){fs[_0xad1a('0x24')](path[_0xad1a('0x23')](_0x538ab7,_0xe8399c));}return BPromise[_0xad1a('0x25')](_0x4674a6,function(_0x184e45){_0x34ace1[_0xad1a('0x1d')](_0x184e45);})['then'](function(){for(var _0x4303b9=0x0;_0x4303b9<_0x34ace1[_0xad1a('0x26')];_0x4303b9+=0x1){var _0x2757f1;var _0x3a39f8=_0x34ace1[_0x4303b9];if(_0x539118){_0x2757f1=path[_0xad1a('0x23')](_0x538ab7,_0xe8399c,util['format'](_0xad1a('0x27'),_0xe8399c,_0x4303b9,_0xad1a('0x28')));}else{_0x2757f1=path[_0xad1a('0x23')](_0x538ab7,util['format']('%s.%s',_0xe8399c,_0xad1a('0x28')));}fs[_0xad1a('0x29')](_0x2757f1,csv(_0x3a39f8));}})[_0xad1a('0x15')](function(){if(_0x539118){return new Promise(function(_0x32046a){zipdir(path[_0xad1a('0x23')](_0x538ab7,_0xe8399c),{'saveTo':path[_0xad1a('0x23')](_0x538ab7,util[_0xad1a('0xf')](_0xad1a('0x2a'),_0xe8399c,_0xad1a('0x2b')))},function(_0x186bd6,_0x3d63af){rimraf(path['join'](_0x538ab7,_0xe8399c),function(){});_0x32046a(_0xad1a('0x2c'));});});}})['then'](function(){logger[_0xad1a('0xe')](util[_0xad1a('0xf')](_0xad1a('0x2d'),EXTRACTED_REPORT_ID,_0xad1a('0x11')));return analyticExtractedReport(_0xad1a('0x2e'),_0x539118?util[_0xad1a('0xf')](_0xad1a('0x2a'),_0xe8399c,_0x539118?_0xad1a('0x2b'):_0xad1a('0x28')):null);});})[_0xad1a('0x2f')](function(_0x5c2ea8){logger[_0xad1a('0xe')](util[_0xad1a('0xf')](_0xad1a('0x30'),EXTRACTED_REPORT_ID,_0xad1a('0x11')),util[_0xad1a('0x31')](_0x5c2ea8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xad1a('0x32'));})['finally'](function(){process[_0xad1a('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1c603e1..6ee6e61 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 _0x1bb0=['zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','argv','map','pick','toString','value','fill','length','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','push','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','num','Empty','splitSizePdf','then','split','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x1bb0,0x164));var _0x01bb=function(_0xf4ddd6,_0xc848fd){_0xf4ddd6=_0xf4ddd6-0x0;var _0x228c0d=_0x1bb0[_0xf4ddd6];return _0x228c0d;};'use strict';var _=require(_0x01bb('0x0'));var fs=require('fs');var util=require(_0x01bb('0x1'));var path=require('path');var moment=require(_0x01bb('0x2'));var htmlToPdfmake=require(_0x01bb('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x01bb('0x4'));var rimraf=require(_0x01bb('0x5'));var JSDOM=require(_0x01bb('0x6'))[_0x01bb('0x7')];var window=new JSDOM('')[_0x01bb('0x8')];var BPromise=require('bluebird');var db=require(_0x01bb('0x9'))['db'];var dbH=require('../../mysqldb')[_0x01bb('0xa')];var logger=require(_0x01bb('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x01bb('0xc')][0x2]);var QUERY=process[_0x01bb('0xc')][0x3];var PATH=process[_0x01bb('0xc')][0x4];var NAME=process[_0x01bb('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x260a11,_0x3986b6){var _0xd05329={'status':_0x260a11};var _0x59b991={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3986b6){_0xd05329['savename']=_0x3986b6;}return db['AnalyticExtractedReport']['update'](_0xd05329,_0x59b991);}function getHeaders(_0x28b7fa){return _[_0x01bb('0xd')](_0x28b7fa,function(_0x270964){return{'text':_0x270964,'style':'tableHeader'};});}function getRows(_0xf69a75,_0x4feaa8){return _[_0x01bb('0xd')](_0x4feaa8,function(_0x3cc204){return _(_0x3cc204)[_0x01bb('0xe')](_0xf69a75)[_0x01bb('0xd')](function(_0x28f34b){return _0x28f34b?_[_0x01bb('0xf')](_0x28f34b):'';})[_0x01bb('0x10')]();});}function createTable(_0x4a7f65,_0x330baf){var _0xb92b29={'widths':_[_0x01bb('0x11')](Array(_0x4a7f65[_0x01bb('0x12')]),0x91),'heights':function(_0x4eca95){return _0x4eca95===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x149266=getHeaders(_0x4a7f65);_0xb92b29['body']['push'](_0x149266);var _0x47bf57=getRows(_0x4a7f65,_0x330baf);_0xb92b29[_0x01bb('0x13')]=_0xb92b29[_0x01bb('0x13')][_0x01bb('0x14')](_0x47bf57);return _0xb92b29;}function createTables(_0x4dee29){var _0x44de97=[];var _0x36e2a9=_[_0x01bb('0x15')](Object[_0x01bb('0x16')](_0x4dee29[0x0]),0x5);_0x36e2a9[_0x01bb('0x17')](function(_0x2453f6){_0x44de97['push'](createTable(_0x2453f6,_0x4dee29));});return _0x44de97;}function getPDFDocDefinition(_0x23148c){var _0xa661c0=util[_0x01bb('0x18')](_0x01bb('0x19'),NAME,EXTRACTED_REPORT[_0x01bb('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x01bb('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x01bb('0x1b')])[_0x01bb('0x18')](FORMAT));var _0x342f5a=[];for(var _0x31dc3b=0x0;_0x31dc3b<_0x23148c['length'];_0x31dc3b++){var _0x517afb=[];if(_0x31dc3b===0x0){_0x517afb[_0x01bb('0x1c')]({'text':_0xa661c0,'style':_0x01bb('0x1d')});}var _0xb0f3ba={'table':_0x23148c[_0x31dc3b]};if(_0x31dc3b>0x0){_0xb0f3ba[_0x01bb('0x1e')]=_0x01bb('0x1f');_0xb0f3ba[_0x01bb('0x20')]=[0x0,0x46,0x0,0x0];}_0x517afb[_0x01bb('0x1c')](_0xb0f3ba);_0x342f5a[_0x01bb('0x1c')](_0x517afb);}return{'pageSize':'A4','pageOrientation':_0x01bb('0x21'),'content':_0x342f5a,'footer':function(_0x2a491b,_0x3f807e){return{'text':_0x2a491b['toString']()+_0x01bb('0x22')+_0x3f807e,'style':_0x01bb('0x23')};},'defaultStyle':{'font':_0x01bb('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x01bb('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x126fc8){var _0x5e30e5=0x1388;var _0x283df7;if(!_0x126fc8[0x0][_0x01bb('0x26')]){return analyticExtractedReport(_0x01bb('0x27'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x01bb('0x28')]})[_0x01bb('0x29')](function(_0x382a21){if(_0x382a21){_0x283df7=_0x382a21;_0x5e30e5=_0x283df7[_0x01bb('0x28')]||0x3e8;}})[_0x01bb('0x29')](function(){var _0x1ab3fa=[];var _0x416cb6=0x0;if(_0x283df7[_0x01bb('0x2a')]){if(_0x126fc8&&_0x126fc8['length']){var _0x74a103=_['range'](_0x126fc8[0x0][_0x01bb('0x26')]/_0x5e30e5);var _0x6239bd=Number[_0x01bb('0x2b')](_0x126fc8[0x0]['num']/_0x5e30e5)?_0x126fc8[0x0][_0x01bb('0x26')]%_0x5e30e5:0x0;_0x74a103[_0x01bb('0x17')](function(_0x19175e){if(_0x19175e>0x0){_0x416cb6+=_0x5e30e5;}_0x1ab3fa['push'](dbH['sequelize'][_0x01bb('0x2c')](util[_0x01bb('0x18')](_0x01bb('0x2d'),QUERY,_0x5e30e5,_0x416cb6),{'type':dbH[_0x01bb('0x2e')]['QueryTypes'][_0x01bb('0x2f')]}));});if(_0x6239bd>0x0){_0x416cb6+=_0x5e30e5;_0x1ab3fa[_0x01bb('0x1c')](dbH[_0x01bb('0x2e')][_0x01bb('0x2c')](util[_0x01bb('0x18')](_0x01bb('0x2d'),QUERY,_0x6239bd,_0x416cb6),{'type':dbH[_0x01bb('0x2e')]['QueryTypes'][_0x01bb('0x2f')]}));}}}else{_0x1ab3fa[_0x01bb('0x1c')](dbH[_0x01bb('0x2e')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x3efdb0=path[_0x01bb('0x30')](PATH);var _0xee438f=path[_0x01bb('0x31')](PATH,_0x01bb('0x32'));var _0x5110b9=_0x283df7['split']&&_0x1ab3fa[_0x01bb('0x12')]>0x1;var _0x41882c=[];if(!fs[_0x01bb('0x33')](path[_0x01bb('0x34')](_0x3efdb0,_0xee438f))&&_0x5110b9){fs[_0x01bb('0x35')](path[_0x01bb('0x34')](_0x3efdb0,_0xee438f));}return BPromise['each'](_0x1ab3fa,function(_0x2421d2){_0x41882c[_0x01bb('0x1c')](_0x2421d2);})[_0x01bb('0x29')](function(){var _0x11cdf6=[];for(var _0x33c153=0x0;_0x33c153<_0x41882c[_0x01bb('0x12')];_0x33c153+=0x1){var _0xb909c8=_0x41882c[_0x33c153];var _0xbc3761=createTables(_[_0x01bb('0x36')](_0xb909c8));var _0x141b02;var _0x39ba68=getPDFDocDefinition(_0xbc3761);var _0xc5daf3=getPDFPrinter();var _0x3c8d2e=_0xc5daf3[_0x01bb('0x37')](_0x39ba68);if(_0x5110b9){_0x141b02=path[_0x01bb('0x34')](_0x3efdb0,_0xee438f,util[_0x01bb('0x18')](_0x01bb('0x38'),_0xee438f,_0x33c153,_0x01bb('0x39')));}else{_0x141b02=path[_0x01bb('0x34')](_0x3efdb0,util[_0x01bb('0x18')]('%s.%s',_0xee438f,_0x01bb('0x39')));}_0x11cdf6['push'](writePDFDocument(_0x3c8d2e,_0x141b02));}return Promise['all'](_0x11cdf6);})[_0x01bb('0x29')](function(){if(_0x5110b9){return new Promise(function(_0x2fa893){zipdir(path['join'](_0x3efdb0,_0xee438f),{'saveTo':path[_0x01bb('0x34')](_0x3efdb0,util['format'](_0x01bb('0x3a'),_0xee438f,_0x01bb('0x3b')))},function(){rimraf(path['join'](_0x3efdb0,_0xee438f),function(){});_0x2fa893(_0x01bb('0x3c'));});});}})[_0x01bb('0x29')](function(){if(!_0x5110b9)return;rimraf(path['join'](_0x3efdb0,_0xee438f),function(){});})[_0x01bb('0x29')](function(){logger[_0x01bb('0x3d')](util[_0x01bb('0x18')](_0x01bb('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x01bb('0x3f'),_0x5110b9?util['format']('%s.%s',_0xee438f,_0x5110b9?_0x01bb('0x3b'):_0x01bb('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x01bb('0x3d')](util[_0x01bb('0x18')](_0x01bb('0x40'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x01bb('0x41')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2f08f6){EXTRACTED_REPORT=_0x2f08f6;return dbH[_0x01bb('0x2e')][_0x01bb('0x2c')](util[_0x01bb('0x18')](_0x01bb('0x42'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x01bb('0x29')](extractReport)[_0x01bb('0x43')](function(_0x34a4b9){logger['info'](util[_0x01bb('0x18')](_0x01bb('0x44'),EXTRACTED_REPORT_ID,_0x01bb('0x45')),util[_0x01bb('0x46')](_0x34a4b9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x01bb('0x47'));})[_0x01bb('0x48')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5da4bf=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x01bb('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x01bb('0x4a')}});return _0x5da4bf;}function getPDFDocDefinitionFromHTML(_0x2fbd95,_0x54dc3b){var _0x48ab61=util[_0x01bb('0x18')]('%s\x20#%d',_0x54dc3b['channel'],_0x54dc3b['interactionId']);var _0x1923df=moment()[_0x01bb('0x18')]('YYYY-MM-DD')[_0x01bb('0xf')]();var _0x8e5a85=htmlToPdfmake(_0x2fbd95,{'window':window,'tableAutoSize':!![]});return{'content':[_0x8e5a85],'defaultStyle':{'font':_0x01bb('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x01bb('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x01bb('0x4b')}},'header':function(){return[{'text':_0x01bb('0x4c'),'style':'header'}];},'footer':function(_0x103bcb,_0x1ee12e){return[{'text':util[_0x01bb('0x18')](_0x01bb('0x4d'),_0x48ab61,_0x103bcb,_0x1ee12e,_0x1923df),'style':'footer'}];}};}function writePDFDocument(_0x234cb0,_0xb21197){return new Promise(function(_0x5af19e,_0x317bfa){var _0x203fdf=_0x234cb0[_0x01bb('0x4e')](fs[_0x01bb('0x4f')](_0xb21197));_0x203fdf['on']('finish',function(){_0x5af19e(_0x01bb('0x50'));});_0x203fdf['on']('error',function(_0x5baa60){_0x317bfa(_0x5baa60);});_0x234cb0[_0x01bb('0x51')]();});}exports[_0x01bb('0x52')]=function(_0x66a98,_0x5da7b1){var _0x209342=getPDFPrinter();var _0x6d9285=getPDFDocDefinitionFromHTML(_0x66a98,_0x5da7b1);var _0x41a6e0=_0x209342[_0x01bb('0x37')](_0x6d9285);return writePDFDocument(_0x41a6e0,_0x5da7b1['path'])['catch'](function(_0x16e90d){throw _0x16e90d;});}; \ No newline at end of file +var _0x3fcd=['SELECT','basename','.pdf','existsSync','join','each','flatten','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','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','right','num','splitSizePdf','then','split','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes'];(function(_0x10da68,_0x5374b5){var _0xf7ae=function(_0x24a26b){while(--_0x24a26b){_0x10da68['push'](_0x10da68['shift']());}};_0xf7ae(++_0x5374b5);}(_0x3fcd,0x84));var _0xd3fc=function(_0x1de284,_0x32f38a){_0x1de284=_0x1de284-0x0;var _0x3b6016=_0x3fcd[_0x1de284];return _0x3b6016;};'use strict';var _=require(_0xd3fc('0x0'));var fs=require('fs');var util=require(_0xd3fc('0x1'));var path=require(_0xd3fc('0x2'));var moment=require(_0xd3fc('0x3'));var htmlToPdfmake=require(_0xd3fc('0x4'));var PdfPrinter=require(_0xd3fc('0x5'));var zipdir=require(_0xd3fc('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0xd3fc('0x7'))[_0xd3fc('0x8')];var window=new JSDOM('')[_0xd3fc('0x9')];var BPromise=require(_0xd3fc('0xa'));var db=require(_0xd3fc('0xb'))['db'];var dbH=require(_0xd3fc('0xb'))[_0xd3fc('0xc')];var logger=require('../../config/logger')(_0xd3fc('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd3fc('0xe')][0x3];var PATH=process[_0xd3fc('0xe')][0x4];var NAME=process[_0xd3fc('0xe')][0x5];var FORMAT=_0xd3fc('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x6ee527,_0x5e3e7e){var _0xf61432={'status':_0x6ee527};var _0x3e4e1c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e3e7e){_0xf61432['savename']=_0x5e3e7e;}return db[_0xd3fc('0x10')][_0xd3fc('0x11')](_0xf61432,_0x3e4e1c);}function getHeaders(_0x7e0497){return _['map'](_0x7e0497,function(_0x1b7763){return{'text':_0x1b7763,'style':_0xd3fc('0x12')};});}function getRows(_0x3bb8ab,_0x4ee5de){return _[_0xd3fc('0x13')](_0x4ee5de,function(_0x26d477){return _(_0x26d477)['pick'](_0x3bb8ab)[_0xd3fc('0x13')](function(_0x1585f5){return _0x1585f5?_[_0xd3fc('0x14')](_0x1585f5):'';})[_0xd3fc('0x15')]();});}function createTable(_0x3773f8,_0x34e5c){var _0x495b56={'widths':_[_0xd3fc('0x16')](Array(_0x3773f8[_0xd3fc('0x17')]),0x91),'heights':function(_0x2ae677){return _0x2ae677===0x0?_0xd3fc('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2032e9=getHeaders(_0x3773f8);_0x495b56[_0xd3fc('0x19')]['push'](_0x2032e9);var _0x5d721b=getRows(_0x3773f8,_0x34e5c);_0x495b56[_0xd3fc('0x19')]=_0x495b56[_0xd3fc('0x19')][_0xd3fc('0x1a')](_0x5d721b);return _0x495b56;}function createTables(_0x50147c){var _0x43c6c6=[];var _0x1f13b1=_[_0xd3fc('0x1b')](Object[_0xd3fc('0x1c')](_0x50147c[0x0]),0x5);_0x1f13b1[_0xd3fc('0x1d')](function(_0x48e83a){_0x43c6c6[_0xd3fc('0x1e')](createTable(_0x48e83a,_0x50147c));});return _0x43c6c6;}function getPDFDocDefinition(_0x10c799){var _0x1e3b6c=util['format'](_0xd3fc('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xd3fc('0x20')])[_0xd3fc('0x21')](FORMAT),moment(EXTRACTED_REPORT[_0xd3fc('0x22')])['format'](FORMAT));var _0x312ac3=[];for(var _0x4daa62=0x0;_0x4daa62<_0x10c799[_0xd3fc('0x17')];_0x4daa62++){var _0x48f1f9=[];if(_0x4daa62===0x0){_0x48f1f9[_0xd3fc('0x1e')]({'text':_0x1e3b6c,'style':_0xd3fc('0x23')});}var _0x1b8f90={'table':_0x10c799[_0x4daa62]};if(_0x4daa62>0x0){_0x1b8f90[_0xd3fc('0x24')]=_0xd3fc('0x25');_0x1b8f90[_0xd3fc('0x26')]=[0x0,0x46,0x0,0x0];}_0x48f1f9[_0xd3fc('0x1e')](_0x1b8f90);_0x312ac3[_0xd3fc('0x1e')](_0x48f1f9);}return{'pageSize':'A4','pageOrientation':_0xd3fc('0x27'),'content':_0x312ac3,'footer':function(_0x4f9ded,_0xa8ccd7){return{'text':_0x4f9ded[_0xd3fc('0x14')]()+_0xd3fc('0x28')+_0xa8ccd7,'style':_0xd3fc('0x29')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xd3fc('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x48f357){var _0x5a9a2b=0x1388;var _0x162ea3;if(!_0x48f357[0x0][_0xd3fc('0x2b')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd3fc('0x2c')]})[_0xd3fc('0x2d')](function(_0x36f6a3){if(_0x36f6a3){_0x162ea3=_0x36f6a3;_0x5a9a2b=_0x162ea3[_0xd3fc('0x2c')]||0x3e8;}})['then'](function(){var _0x508bfe=[];var _0x1e7da6=0x0;if(_0x162ea3[_0xd3fc('0x2e')]){if(_0x48f357&&_0x48f357[_0xd3fc('0x17')]){var _0x465ddb=_[_0xd3fc('0x2f')](_0x48f357[0x0][_0xd3fc('0x2b')]/_0x5a9a2b);var _0x4ba6d7=Number['isInteger'](_0x48f357[0x0][_0xd3fc('0x2b')]/_0x5a9a2b)?_0x48f357[0x0]['num']%_0x5a9a2b:0x0;_0x465ddb[_0xd3fc('0x1d')](function(_0xda6e3e){if(_0xda6e3e>0x0){_0x1e7da6+=_0x5a9a2b;}_0x508bfe[_0xd3fc('0x1e')](dbH[_0xd3fc('0x30')][_0xd3fc('0x31')](util[_0xd3fc('0x21')](_0xd3fc('0x32'),QUERY,_0x5a9a2b,_0x1e7da6),{'type':dbH[_0xd3fc('0x30')][_0xd3fc('0x33')][_0xd3fc('0x34')]}));});if(_0x4ba6d7>0x0){_0x1e7da6+=_0x5a9a2b;_0x508bfe[_0xd3fc('0x1e')](dbH[_0xd3fc('0x30')]['query'](util['format'](_0xd3fc('0x32'),QUERY,_0x4ba6d7,_0x1e7da6),{'type':dbH[_0xd3fc('0x30')][_0xd3fc('0x33')][_0xd3fc('0x34')]}));}}}else{_0x508bfe[_0xd3fc('0x1e')](dbH[_0xd3fc('0x30')]['query'](QUERY,{'type':dbH[_0xd3fc('0x30')][_0xd3fc('0x33')][_0xd3fc('0x34')]}));}var _0x538599=path['dirname'](PATH);var _0x25fdda=path[_0xd3fc('0x35')](PATH,_0xd3fc('0x36'));var _0x470654=_0x162ea3[_0xd3fc('0x2e')]&&_0x508bfe['length']>0x1;var _0x1bf65c=[];if(!fs[_0xd3fc('0x37')](path[_0xd3fc('0x38')](_0x538599,_0x25fdda))&&_0x470654){fs['mkdirSync'](path['join'](_0x538599,_0x25fdda));}return BPromise[_0xd3fc('0x39')](_0x508bfe,function(_0x4a4893){_0x1bf65c['push'](_0x4a4893);})[_0xd3fc('0x2d')](function(){var _0x1a29bc=[];for(var _0x28c5a7=0x0;_0x28c5a7<_0x1bf65c[_0xd3fc('0x17')];_0x28c5a7+=0x1){var _0x2f07b3=_0x1bf65c[_0x28c5a7];var _0x469b21=createTables(_[_0xd3fc('0x3a')](_0x2f07b3));var _0x5e5d1c;var _0x3fbb77=getPDFDocDefinition(_0x469b21);var _0x2126ba=getPDFPrinter();var _0x37d8b3=_0x2126ba[_0xd3fc('0x3b')](_0x3fbb77);if(_0x470654){_0x5e5d1c=path['join'](_0x538599,_0x25fdda,util['format'](_0xd3fc('0x3c'),_0x25fdda,_0x28c5a7,_0xd3fc('0x3d')));}else{_0x5e5d1c=path[_0xd3fc('0x38')](_0x538599,util[_0xd3fc('0x21')](_0xd3fc('0x3e'),_0x25fdda,_0xd3fc('0x3d')));}_0x1a29bc[_0xd3fc('0x1e')](writePDFDocument(_0x37d8b3,_0x5e5d1c));}return Promise[_0xd3fc('0x3f')](_0x1a29bc);})['then'](function(){if(_0x470654){return new Promise(function(_0x10f26d){zipdir(path['join'](_0x538599,_0x25fdda),{'saveTo':path['join'](_0x538599,util[_0xd3fc('0x21')](_0xd3fc('0x3e'),_0x25fdda,_0xd3fc('0x40')))},function(){rimraf(path['join'](_0x538599,_0x25fdda),function(){});_0x10f26d(_0xd3fc('0x41'));});});}})[_0xd3fc('0x2d')](function(){if(!_0x470654)return;rimraf(path['join'](_0x538599,_0x25fdda),function(){});})[_0xd3fc('0x2d')](function(){logger[_0xd3fc('0x42')](util[_0xd3fc('0x21')](_0xd3fc('0x43'),EXTRACTED_REPORT_ID,_0xd3fc('0x44')));return analyticExtractedReport(_0xd3fc('0x45'),_0x470654?util[_0xd3fc('0x21')](_0xd3fc('0x3e'),_0x25fdda,_0x470654?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xd3fc('0x46'),EXTRACTED_REPORT_ID,_0xd3fc('0x44')));return db['AnalyticExtractedReport'][_0xd3fc('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd3fc('0x2d')](function(_0x4964ea){EXTRACTED_REPORT=_0x4964ea;return dbH[_0xd3fc('0x30')][_0xd3fc('0x31')](util['format'](_0xd3fc('0x48'),QUERY),{'type':dbH['sequelize'][_0xd3fc('0x33')]['SELECT']});})['then'](extractReport)[_0xd3fc('0x49')](function(_0x4cc7c4){logger[_0xd3fc('0x42')](util[_0xd3fc('0x21')](_0xd3fc('0x4a'),EXTRACTED_REPORT_ID,_0xd3fc('0x44')),util[_0xd3fc('0x4b')](_0x4cc7c4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd3fc('0x4c'));})[_0xd3fc('0x4d')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x410987=new PdfPrinter({'Arial':{'normal':__dirname+_0xd3fc('0x4e'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xd3fc('0x4f'),'bolditalics':__dirname+_0xd3fc('0x50')}});return _0x410987;}function getPDFDocDefinitionFromHTML(_0x202c42,_0x1a58d7){var _0x3826d3=util['format'](_0xd3fc('0x51'),_0x1a58d7[_0xd3fc('0x52')],_0x1a58d7[_0xd3fc('0x53')]);var _0x21f318=moment()[_0xd3fc('0x21')](_0xd3fc('0x54'))[_0xd3fc('0x14')]();var _0x185dc8=htmlToPdfmake(_0x202c42,{'window':window,'tableAutoSize':!![]});return{'content':[_0x185dc8],'defaultStyle':{'font':_0xd3fc('0x55')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd3fc('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd3fc('0x56')}},'header':function(){return[{'text':_0xd3fc('0x57'),'style':_0xd3fc('0x23')}];},'footer':function(_0x52da65,_0xdcd6c2){return[{'text':util[_0xd3fc('0x21')](_0xd3fc('0x58'),_0x3826d3,_0x52da65,_0xdcd6c2,_0x21f318),'style':_0xd3fc('0x29')}];}};}function writePDFDocument(_0x3e2f63,_0x42e6ad){return new Promise(function(_0x4a67b0,_0x2a8c95){var _0x21d548=_0x3e2f63['pipe'](fs['createWriteStream'](_0x42e6ad));_0x21d548['on'](_0xd3fc('0x59'),function(){_0x4a67b0('finish');});_0x21d548['on'](_0xd3fc('0x5a'),function(_0x1f1813){_0x2a8c95(_0x1f1813);});_0x3e2f63['end']();});}exports[_0xd3fc('0x5b')]=function(_0x5f0d3c,_0x38a5e5){var _0x17ed79=getPDFPrinter();var _0x470779=getPDFDocDefinitionFromHTML(_0x5f0d3c,_0x38a5e5);var _0x503d39=_0x17ed79[_0xd3fc('0x3b')](_0x470779);return writePDFDocument(_0x503d39,_0x38a5e5[_0xd3fc('0x2')])[_0xd3fc('0x49')](function(_0x115028){throw _0x115028;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 992ee6d..a08d2d1 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 _0x1a05=['inspect','finally','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','then','splitSizeXlsx','sequelize','QueryTypes','num','split','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.xlsx','existsSync','mkdirSync','join','each','push','%s%d.%s','%s.%s','xlsx','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x49e634,_0x29e51f){var _0x5a48d6=function(_0x36e172){while(--_0x36e172){_0x49e634['push'](_0x49e634['shift']());}};_0x5a48d6(++_0x29e51f);}(_0x1a05,0x153));var _0x51a0=function(_0x2f89f9,_0x42aea4){_0x2f89f9=_0x2f89f9-0x0;var _0x26e93c=_0x1a05[_0x2f89f9];return _0x26e93c;};'use strict';var util=require(_0x51a0('0x0'));var path=require(_0x51a0('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x51a0('0x2'));var BPromise=require(_0x51a0('0x3'));var zipdir=require(_0x51a0('0x4'));var rimraf=require(_0x51a0('0x5'));var db=require(_0x51a0('0x6'))['db'];var dbH=require(_0x51a0('0x6'))[_0x51a0('0x7')];var logger=require(_0x51a0('0x8'))(_0x51a0('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x51a0('0xa')][0x3];var PATH=process[_0x51a0('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4021ff,_0x1b4eb2){var _0x5b7db5={'status':_0x4021ff};var _0x1c3e49={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b4eb2){_0x5b7db5[_0x51a0('0xb')]=_0x1b4eb2;}return db['AnalyticExtractedReport'][_0x51a0('0xc')](_0x5b7db5,_0x1c3e49);}function main(){var _0x275935=0x1388;var _0x5461d9;logger[_0x51a0('0xd')](util[_0x51a0('0xe')](_0x51a0('0xf'),EXTRACTED_REPORT_ID,_0x51a0('0x10')));return db[_0x51a0('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x51a0('0x12')](function(_0x1c41cf){if(_0x1c41cf){_0x5461d9=_0x1c41cf;_0x275935=_0x5461d9[_0x51a0('0x13')]||0x1388;}})[_0x51a0('0x12')](function(){return dbH[_0x51a0('0x14')]['query'](util[_0x51a0('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x51a0('0x14')][_0x51a0('0x15')]['SELECT']});})['then'](function(_0x3c1866){if(!_0x3c1866[0x0][_0x51a0('0x16')]){return analyticExtractedReport('Empty');}var _0x275e90=[];var _0x516614=0x0;if(_0x5461d9[_0x51a0('0x17')]){if(_0x3c1866&&_0x3c1866[_0x51a0('0x18')]){var _0x199f44=_[_0x51a0('0x19')](_0x3c1866[0x0][_0x51a0('0x16')]/_0x275935);var _0x31a9e7=Number[_0x51a0('0x1a')](_0x3c1866[0x0][_0x51a0('0x16')]/_0x275935)?_0x3c1866[0x0][_0x51a0('0x16')]%_0x275935:0x0;_0x199f44[_0x51a0('0x1b')](function(_0x37ea2f){if(_0x37ea2f>0x0){_0x516614+=_0x275935;}_0x275e90['push'](dbH[_0x51a0('0x14')][_0x51a0('0x1c')](util[_0x51a0('0xe')](_0x51a0('0x1d'),QUERY,_0x275935,_0x516614),{'type':dbH['sequelize']['QueryTypes'][_0x51a0('0x1e')]}));});if(_0x31a9e7>0x0){_0x516614+=_0x275935;_0x275e90['push'](dbH[_0x51a0('0x14')]['query'](util['format'](_0x51a0('0x1d'),QUERY,_0x31a9e7,_0x516614),{'type':dbH['sequelize']['QueryTypes'][_0x51a0('0x1e')]}));}}}else{_0x275e90['push'](dbH['sequelize'][_0x51a0('0x1c')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x51a0('0x1e')]}));}var _0x1dbb57=path['dirname'](PATH);var _0x3f6d52=path[_0x51a0('0x1f')](PATH,_0x51a0('0x20'));var _0x5896c2=_0x5461d9[_0x51a0('0x17')]&&_0x275e90[_0x51a0('0x18')]>0x1;var _0x22148b=[];if(!fs[_0x51a0('0x21')](path['join'](_0x1dbb57,_0x3f6d52))&&_0x5896c2){fs[_0x51a0('0x22')](path[_0x51a0('0x23')](_0x1dbb57,_0x3f6d52));}return BPromise[_0x51a0('0x24')](_0x275e90,function(_0x1de7ba){_0x22148b[_0x51a0('0x25')](_0x1de7ba);})[_0x51a0('0x12')](function(){for(var _0x211364=0x0;_0x211364<_0x22148b[_0x51a0('0x18')];_0x211364+=0x1){var _0x445136;var _0x41563e=_0x22148b[_0x211364];if(_0x5896c2){_0x445136=path['join'](_0x1dbb57,_0x3f6d52,util[_0x51a0('0xe')](_0x51a0('0x26'),_0x3f6d52,_0x211364,'xlsx'));}else{_0x445136=path[_0x51a0('0x23')](_0x1dbb57,util['format'](_0x51a0('0x27'),_0x3f6d52,_0x51a0('0x28')));}fs['writeFileSync'](_0x445136,json2xls(_0x41563e),'binary');}})[_0x51a0('0x12')](function(){if(_0x5896c2){return new Promise(function(_0x17a070){zipdir(path['join'](_0x1dbb57,_0x3f6d52),{'saveTo':path['join'](_0x1dbb57,util[_0x51a0('0xe')](_0x51a0('0x27'),_0x3f6d52,'zip'))},function(_0x3a2428,_0x98178){rimraf(path[_0x51a0('0x23')](_0x1dbb57,_0x3f6d52),function(){});_0x17a070('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x51a0('0xe')](_0x51a0('0x29'),EXTRACTED_REPORT_ID,_0x51a0('0x10')));return analyticExtractedReport(_0x51a0('0x2a'),_0x5896c2?util[_0x51a0('0xe')](_0x51a0('0x27'),_0x3f6d52,_0x5896c2?_0x51a0('0x2b'):_0x51a0('0x28')):null);});})['catch'](function(_0x202970){logger[_0x51a0('0xd')](util[_0x51a0('0xe')](_0x51a0('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x51a0('0x2d')](_0x202970,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x51a0('0x2e')](function(){process[_0x51a0('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x637b=['savename','AnalyticExtractedReport','update','info','XLSX','Setting','find','then','sequelize','query','format','QueryTypes','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.xlsx','split','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x637b,0x133));var _0xb637=function(_0x327832,_0x352a81){_0x327832=_0x327832-0x0;var _0x172a9f=_0x637b[_0x327832];return _0x172a9f;};'use strict';var util=require(_0xb637('0x0'));var path=require('path');var _=require(_0xb637('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xb637('0x2'));var rimraf=require(_0xb637('0x3'));var db=require(_0xb637('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xb637('0x5'))(_0xb637('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xb637('0x7')][0x2]);var QUERY=process[_0xb637('0x7')][0x3];var PATH=process[_0xb637('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x178a51,_0x54951e){var _0x42d082={'status':_0x178a51};var _0x31e3b5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54951e){_0x42d082[_0xb637('0x8')]=_0x54951e;}return db[_0xb637('0x9')][_0xb637('0xa')](_0x42d082,_0x31e3b5);}function main(){var _0x4c7e3b=0x1388;var _0x4c1215;logger[_0xb637('0xb')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb637('0xc')));return db[_0xb637('0xd')][_0xb637('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0x4f8f00){if(_0x4f8f00){_0x4c1215=_0x4f8f00;_0x4c7e3b=_0x4c1215['splitSizeXlsx']||0x1388;}})[_0xb637('0xf')](function(){return dbH[_0xb637('0x10')][_0xb637('0x11')](util[_0xb637('0x12')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb637('0x10')][_0xb637('0x13')]['SELECT']});})[_0xb637('0xf')](function(_0x1c6baa){if(!_0x1c6baa[0x0][_0xb637('0x14')]){return analyticExtractedReport('Empty');}var _0x3b3010=[];var _0x6ffe48=0x0;if(_0x4c1215['split']){if(_0x1c6baa&&_0x1c6baa['length']){var _0x24505a=_['range'](_0x1c6baa[0x0][_0xb637('0x14')]/_0x4c7e3b);var _0x43d907=Number[_0xb637('0x15')](_0x1c6baa[0x0][_0xb637('0x14')]/_0x4c7e3b)?_0x1c6baa[0x0][_0xb637('0x14')]%_0x4c7e3b:0x0;_0x24505a[_0xb637('0x16')](function(_0x55cf49){if(_0x55cf49>0x0){_0x6ffe48+=_0x4c7e3b;}_0x3b3010[_0xb637('0x17')](dbH[_0xb637('0x10')][_0xb637('0x11')](util['format'](_0xb637('0x18'),QUERY,_0x4c7e3b,_0x6ffe48),{'type':dbH[_0xb637('0x10')][_0xb637('0x13')][_0xb637('0x19')]}));});if(_0x43d907>0x0){_0x6ffe48+=_0x4c7e3b;_0x3b3010[_0xb637('0x17')](dbH[_0xb637('0x10')]['query'](util['format'](_0xb637('0x18'),QUERY,_0x43d907,_0x6ffe48),{'type':dbH[_0xb637('0x10')][_0xb637('0x13')][_0xb637('0x19')]}));}}}else{_0x3b3010[_0xb637('0x17')](dbH[_0xb637('0x10')][_0xb637('0x11')](QUERY,{'type':dbH['sequelize'][_0xb637('0x13')][_0xb637('0x19')]}));}var _0x45c85d=path['dirname'](PATH);var _0x2c38c4=path[_0xb637('0x1a')](PATH,_0xb637('0x1b'));var _0x532118=_0x4c1215[_0xb637('0x1c')]&&_0x3b3010[_0xb637('0x1d')]>0x1;var _0x411ab5=[];if(!fs[_0xb637('0x1e')](path[_0xb637('0x1f')](_0x45c85d,_0x2c38c4))&&_0x532118){fs[_0xb637('0x20')](path['join'](_0x45c85d,_0x2c38c4));}return BPromise['each'](_0x3b3010,function(_0x14efc6){_0x411ab5[_0xb637('0x17')](_0x14efc6);})[_0xb637('0xf')](function(){for(var _0x4f74fb=0x0;_0x4f74fb<_0x411ab5[_0xb637('0x1d')];_0x4f74fb+=0x1){var _0x32d9e1;var _0xb75791=_0x411ab5[_0x4f74fb];if(_0x532118){_0x32d9e1=path[_0xb637('0x1f')](_0x45c85d,_0x2c38c4,util['format'](_0xb637('0x21'),_0x2c38c4,_0x4f74fb,_0xb637('0x22')));}else{_0x32d9e1=path[_0xb637('0x1f')](_0x45c85d,util[_0xb637('0x12')](_0xb637('0x23'),_0x2c38c4,_0xb637('0x22')));}fs[_0xb637('0x24')](_0x32d9e1,json2xls(_0xb75791),_0xb637('0x25'));}})[_0xb637('0xf')](function(){if(_0x532118){return new Promise(function(_0x96c369){zipdir(path[_0xb637('0x1f')](_0x45c85d,_0x2c38c4),{'saveTo':path['join'](_0x45c85d,util[_0xb637('0x12')](_0xb637('0x23'),_0x2c38c4,_0xb637('0x26')))},function(_0x24028c,_0x497677){rimraf(path[_0xb637('0x1f')](_0x45c85d,_0x2c38c4),function(){});_0x96c369(_0xb637('0x27'));});});}})[_0xb637('0xf')](function(){logger[_0xb637('0xb')](util[_0xb637('0x12')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb637('0xc')));return analyticExtractedReport(_0xb637('0x28'),_0x532118?util[_0xb637('0x12')](_0xb637('0x23'),_0x2c38c4,_0x532118?_0xb637('0x26'):_0xb637('0x22')):null);});})['catch'](function(_0x35ead8){logger[_0xb637('0xb')](util[_0xb637('0x12')](_0xb637('0x29'),EXTRACTED_REPORT_ID,_0xb637('0xc')),util['inspect'](_0x35ead8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb637('0x2a'));})[_0xb637('0x2b')](function(){process[_0xb637('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 46d3954..ca1f685 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 _0xc46e=['$[${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','util','models','findAll','then','intervals','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','find','extensions','push','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','inbound','priority','extension','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','app','appType','custom','answer'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc46e,0x1ae));var _0xec46=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0xc46e[_0x4c1ec2];return _0x3f6f1c;};'use strict';var _=require(_0xec46('0x0'));var util=require(_0xec46('0x1'));function rewrite(_0xb47f8c,_0x3b4224){var _0x19577c=this;return _0xb47f8c[_0xec46('0x2')]['Interval'][_0xec46('0x3')]({'raw':!![]})[_0xec46('0x4')](function(_0x488103){_0x19577c[_0xec46('0x5')]=_0x488103;return _0xb47f8c['models'][_0xec46('0x6')][_0xec46('0x3')]({'where':{'IntervalId':_0x3b4224['IntervalId']},'raw':!![]});})[_0xec46('0x4')](function(_0x2b6c9b){return _0xb47f8c['models'][_0xec46('0x6')][_0xec46('0x3')]({'where':{'exten':{'$in':_[_0xec46('0x7')](_['map'](_0x2b6c9b,_0xec46('0x8')))}},'order':[{'raw':_0xec46('0x9')}],'raw':!![]});})[_0xec46('0x4')](function(_0x27ca0a){var _0x21859d=_['filter'](_0x27ca0a,{'priority':'1'});var _0x5d99a5=_[_0xec46('0xa')](_0x27ca0a,{'isApp':0x1});var _0x190df6=_['groupBy'](_0x5d99a5,_0xec46('0x8'));var _0x155021=[_0xec46('0xb'),_0xec46('0xc')];var _0x953791=[];var _0xd48b4b=[];for(var _0x2ec5ff in _0x190df6){if(_0x190df6['hasOwnProperty'](_0x2ec5ff)){_0x19577c['priority']=0x2;_0x19577c['extensions']=[];_0x19577c['extension']=_[_0xec46('0xd')](_0x21859d,{'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')]});_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0]['type'],'app':_0xec46('0x10'),'appdata':util[_0xec46('0x11')](_0xec46('0x12'),_0x190df6[_0x2ec5ff][0x0]['type']),'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c['priority']++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});if(_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')]===_0xec46('0x16')){_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':'Set','appdata':'CDR(routeid)='+_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')],'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0]['VoiceExtensionId']});}else if(_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')]==='outbound'){if(_0x19577c[_0xec46('0x18')]){_0x19577c['extensions'][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':_0xec46('0x19')+(_0x19577c[_0xec46('0x18')][_0xec46('0x1a')]?'${EXTEN:'+_0x19577c[_0xec46('0x18')][_0xec46('0x1a')]+'}':_0xec46('0x1b')),'context':_0x190df6[_0x2ec5ff][0x0]['context'],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});}_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':_0xec46('0x1c')+_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')],'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0]['exten'],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});var _0x423fea=_0x19577c[_0xec46('0x17')]++;_0x19577c['extensions']['push']({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x1d'),'appdata':_0xec46('0x1e')+(_0x423fea+0x2)+_0xec46('0x1f')+(_0x423fea+0x1)+')','context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x423fea,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});if(_0x19577c[_0xec46('0x18')]){_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':'Set','appdata':_0x19577c['extension'][_0xec46('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x19577c['extension']['cutdigits']+'}':_0xec46('0x20'),'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c['priority']++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});}_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':_0xec46('0x21')+_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')],'context':_0x190df6[_0x2ec5ff][0x0]['context'],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});if(_0x19577c[_0xec46('0x18')]&&_0x19577c[_0xec46('0x18')][_0xec46('0x22')](_0xec46('0x23'))&&_0x19577c[_0xec46('0x18')][_0xec46('0x23')]!==_0xec46('0x24')){_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0]['exten'],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x19577c[_0xec46('0x18')]['recordingFormat']||_0xec46('0x25'),'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});}}_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':_0xec46('0x26'),'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});_0x19577c[_0xec46('0xe')][_0xec46('0xf')]({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':'Set','appdata':_0xec46('0x27'),'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});_0x19577c['extensions']['push']({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x10'),'appdata':'MONITOR_OPTIONS=ab','context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'exten':_0x190df6[_0x2ec5ff][0x0]['exten'],'priority':_0x19577c[_0xec46('0x17')]++,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0]['VoiceExtensionId']});for(var _0x4eae3e=0x0,_0x5d6cb1=0x0;_0x4eae3e<_0x190df6[_0x2ec5ff][_0xec46('0x28')];_0x4eae3e+=0x1,_0x5d6cb1=0x0){var _0x5af22b=_0x190df6[_0x2ec5ff][_0x4eae3e];if(_0x5af22b[_0xec46('0x15')]){_0x5af22b['type']=_0x5af22b[_0xec46('0x15')][_0xec46('0x29')]();}var _0x13ddb9=[];var _0x1adcd0=[];delete _0x5af22b['id'];delete _0x5af22b['createdAt'];delete _0x5af22b[_0xec46('0x2a')];var _0x370e9f=_0x5af22b[_0xec46('0x2b')]!==_0xec46('0x2c')?[_0x5af22b[_0xec46('0x2b')]]:_0x5af22b[_0xec46('0x2d')]?_['map'](_[_0xec46('0xa')](_0x19577c['intervals'],{'IntervalId':_0x5af22b[_0xec46('0x2d')]}),_0xec46('0x2b')):[];if(_0x5af22b[_0xec46('0x22')](_0xec46('0x2e'))){if(_0x5af22b[_0xec46('0x2e')]&&_0x5af22b[_0xec46('0x2e')]!=='--'){_0x13ddb9[_0xec46('0xf')]({'type':_0x5af22b[_0xec46('0x15')],'app':'Set','appdata':_0xec46('0x2f')+_0x5af22b['tag'],'context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b['exten'],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});}}if(_0x5af22b[_0xec46('0x15')]==='outbound'&&_0x5af22b[_0xec46('0x22')]('callerID')){if(_0x5af22b['callerID']){_0x13ddb9[_0xec46('0xf')]({'type':_0x5af22b[_0xec46('0x15')],'app':_0xec46('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5af22b[_0xec46('0x30')]+')','context':_0x5af22b['context'],'exten':_0x5af22b[_0xec46('0x8')],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});}else{_0x13ddb9['push']({'type':_0x5af22b[_0xec46('0x15')],'app':_0xec46('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b['exten'],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});}}if(_0x5af22b[_0xec46('0x22')]('answer')){if(_0x155021['indexOf'](_0x5af22b[_0xec46('0x31')][_0xec46('0x29')]())>=0x0&&_0x5af22b[_0xec46('0x32')]!==_0xec46('0x33')){if(_0x5af22b[_0xec46('0x34')]){_0x13ddb9[_0xec46('0xf')]({'type':_0x5af22b['type'],'app':_0xec46('0x1d'),'appdata':_0xec46('0x35'),'context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b[_0xec46('0x8')],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});_0x13ddb9[_0xec46('0xf')]({'type':_0x5af22b[_0xec46('0x15')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b[_0xec46('0x8')],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});}else{_0x13ddb9[_0xec46('0xf')]({'type':_0x5af22b[_0xec46('0x15')],'app':_0xec46('0x1d'),'appdata':_0xec46('0x36'),'context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b['exten'],'priority':_0x370e9f[_0xec46('0x28')]+_0x19577c['priority']+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});_0x13ddb9['push']({'type':_0x5af22b[_0xec46('0x15')],'app':'Set','appdata':_0xec46('0x37'),'context':_0x5af22b[_0xec46('0x13')],'exten':_0x5af22b[_0xec46('0x8')],'priority':_0x370e9f['length']+_0x19577c[_0xec46('0x17')]+_0x5d6cb1++,'VoiceExtensionId':_0x5af22b[_0xec46('0x14')]});}}}for(var _0x38cd7d=0x0;_0x38cd7d<_0x370e9f[_0xec46('0x28')];_0x38cd7d+=0x1){var _0x2257b7=_0x19577c['priority']+_0x370e9f['length'];var _0x3809a9=_0x38cd7d===_0x370e9f[_0xec46('0x28')]-0x1?_0x19577c[_0xec46('0x17')]+_0x13ddb9[_0xec46('0x28')]+_0x1adcd0[_0xec46('0x28')]+0x2:_0x19577c[_0xec46('0x17')]+_0x38cd7d+0x1;_0x13ddb9[_0xec46('0x38')](_0x38cd7d,0x0,{'type':_0x5af22b[_0xec46('0x15')],'app':_0xec46('0x39'),'appdata':_0x370e9f[_0x38cd7d]+'?'+_0x5af22b[_0xec46('0x13')]+_0xec46('0x3a')+_0x2257b7+':'+_0x5af22b['context']+_0xec46('0x3a')+_0x3809a9,'exten':_0x5af22b[_0xec46('0x8')],'context':_0x5af22b[_0xec46('0x13')],'priority':_0x19577c[_0xec46('0x17')]+_0x38cd7d,'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});}_0x5af22b[_0xec46('0x17')]=_0x13ddb9[_0xec46('0x28')]?_[_0xec46('0x3b')](_0x13ddb9)[_0xec46('0x17')]+0x1:_0x19577c['priority'];_0x19577c[_0xec46('0x17')]=(_0x1adcd0['length']?_[_0xec46('0x3b')](_0x1adcd0)[_0xec46('0x17')]:_0x5af22b[_0xec46('0x17')])+0x1;_0x19577c['extensions']=_[_0xec46('0x3c')](_0x19577c[_0xec46('0xe')],_0x13ddb9,[_0x5af22b],_0x1adcd0);}_0x19577c[_0xec46('0xe')]['push']({'type':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x15')],'app':_0xec46('0x3d'),'exten':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x8')],'context':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x13')],'priority':_0x19577c[_0xec46('0x17')],'VoiceExtensionId':_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]});_0x953791['push'](_0x190df6[_0x2ec5ff][0x0][_0xec46('0x14')]);_0xd48b4b=_[_0xec46('0x3c')](_0xd48b4b,_0x19577c[_0xec46('0xe')]);}}return _0xb47f8c[_0xec46('0x3e')](function(_0x3ee10b){return _0xb47f8c[_0xec46('0x2')]['VoiceExtension'][_0xec46('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x953791}},'transaction':_0x3ee10b})[_0xec46('0x4')](function(_0x23c333){return _0xb47f8c[_0xec46('0x2')][_0xec46('0x6')][_0xec46('0x40')](_[_0xec46('0x41')](_0xd48b4b,_0xec46('0x17')),{'transaction':_0x3ee10b});});});})[_0xec46('0x42')](function(_0x3e05cf){console[_0xec46('0x43')](_0x3e05cf);});}exports[_0xec46('0x44')]=rewrite; \ No newline at end of file +var _0x9358=['CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','then','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto('];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x9358,0x1e4));var _0x8935=function(_0x3be87f,_0x16dedd){_0x3be87f=_0x3be87f-0x0;var _0x11b840=_0x9358[_0x3be87f];return _0x11b840;};'use strict';var _=require(_0x8935('0x0'));var util=require(_0x8935('0x1'));function rewrite(_0x47735f,_0x58bb8b){var _0x48e99d=this;return _0x47735f[_0x8935('0x2')]['Interval'][_0x8935('0x3')]({'raw':!![]})['then'](function(_0x5b3dee){_0x48e99d[_0x8935('0x4')]=_0x5b3dee;return _0x47735f[_0x8935('0x2')][_0x8935('0x5')]['findAll']({'where':{'IntervalId':_0x58bb8b[_0x8935('0x6')]},'raw':!![]});})[_0x8935('0x7')](function(_0x55d891){return _0x47735f[_0x8935('0x2')][_0x8935('0x5')][_0x8935('0x3')]({'where':{'exten':{'$in':_[_0x8935('0x8')](_['map'](_0x55d891,_0x8935('0x9')))}},'order':[{'raw':_0x8935('0xa')}],'raw':!![]});})[_0x8935('0x7')](function(_0x20643a){var _0xdf6aa2=_[_0x8935('0xb')](_0x20643a,{'priority':'1'});var _0x5672f4=_[_0x8935('0xb')](_0x20643a,{'isApp':0x1});var _0x2d0d22=_[_0x8935('0xc')](_0x5672f4,'exten');var _0x19d149=['queue',_0x8935('0xd')];var _0x536d79=[];var _0x4e0b6f=[];for(var _0x50ee81 in _0x2d0d22){if(_0x2d0d22[_0x8935('0xe')](_0x50ee81)){_0x48e99d[_0x8935('0xf')]=0x2;_0x48e99d[_0x8935('0x10')]=[];_0x48e99d[_0x8935('0x11')]=_[_0x8935('0x12')](_0xdf6aa2,{'exten':_0x2d0d22[_0x50ee81][0x0]['exten']});_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':util['format']('CDR(type)=%s',_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')]),'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0]['exten'],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});if(_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')]===_0x8935('0x18')){_0x48e99d['extensions']['push']({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x19')+_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')],'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});}else if(_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')]===_0x8935('0x1a')){if(_0x48e99d[_0x8935('0x11')]){_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x1b')+(_0x48e99d['extension'][_0x8935('0x1c')]?_0x8935('0x1d')+_0x48e99d[_0x8935('0x11')][_0x8935('0x1c')]+'}':_0x8935('0x1e')),'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0]['exten'],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});}_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x19')+_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId'],'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d['priority']++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});var _0x3c790d=_0x48e99d[_0x8935('0xf')]++;_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x1f'),'appdata':_0x8935('0x20')+(_0x3c790d+0x2)+_0x8935('0x21')+(_0x3c790d+0x1)+')','context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0]['exten'],'priority':_0x3c790d,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});if(_0x48e99d['extension']){_0x48e99d['extensions'][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':_0x8935('0x15'),'appdata':_0x48e99d[_0x8935('0x11')]['cutdigits']?_0x8935('0x22')+_0x48e99d[_0x8935('0x11')]['cutdigits']+'}':_0x8935('0x23'),'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d['priority']++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});}_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x24')+_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId'],'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});if(_0x48e99d['extension']&&_0x48e99d[_0x8935('0x11')][_0x8935('0xe')](_0x8935('0x25'))&&_0x48e99d[_0x8935('0x11')][_0x8935('0x25')]!==_0x8935('0x26')){_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x27'),'context':_0x2d0d22[_0x50ee81][0x0]['context'],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':_0x8935('0x15'),'appdata':_0x8935('0x28')+_0x48e99d['extension'][_0x8935('0x25')]||'wav','context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});}}_0x48e99d[_0x8935('0x10')]['push']({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':_0x8935('0x15'),'appdata':_0x8935('0x29'),'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':'Set','appdata':_0x8935('0x2a'),'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d['priority']++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});_0x48e99d[_0x8935('0x10')]['push']({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':_0x8935('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'exten':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x9')],'priority':_0x48e99d[_0x8935('0xf')]++,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});for(var _0x1c964d=0x0,_0x5149a8=0x0;_0x1c964d<_0x2d0d22[_0x50ee81]['length'];_0x1c964d+=0x1,_0x5149a8=0x0){var _0x1a2356=_0x2d0d22[_0x50ee81][_0x1c964d];if(_0x1a2356[_0x8935('0x14')]){_0x1a2356['type']=_0x1a2356['type'][_0x8935('0x2b')]();}var _0x16ad7a=[];var _0x303896=[];delete _0x1a2356['id'];delete _0x1a2356[_0x8935('0x2c')];delete _0x1a2356[_0x8935('0x2d')];var _0x113d86=_0x1a2356[_0x8935('0x2e')]!==_0x8935('0x2f')?[_0x1a2356[_0x8935('0x2e')]]:_0x1a2356[_0x8935('0x6')]?_[_0x8935('0x30')](_[_0x8935('0xb')](_0x48e99d[_0x8935('0x4')],{'IntervalId':_0x1a2356['IntervalId']}),_0x8935('0x2e')):[];if(_0x1a2356['hasOwnProperty'](_0x8935('0x31'))){if(_0x1a2356[_0x8935('0x31')]&&_0x1a2356[_0x8935('0x31')]!=='--'){_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356[_0x8935('0x14')],'app':_0x8935('0x15'),'appdata':_0x8935('0x32')+_0x1a2356[_0x8935('0x31')],'context':_0x1a2356[_0x8935('0x16')],'exten':_0x1a2356[_0x8935('0x9')],'priority':_0x113d86[_0x8935('0x33')]+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});}}if(_0x1a2356[_0x8935('0x14')]==='outbound'&&_0x1a2356[_0x8935('0xe')]('callerID')){if(_0x1a2356[_0x8935('0x34')]){_0x16ad7a['push']({'type':_0x1a2356[_0x8935('0x14')],'app':_0x8935('0x1f'),'appdata':_0x8935('0x35')+_0x1a2356[_0x8935('0x34')]+')','context':_0x1a2356[_0x8935('0x16')],'exten':_0x1a2356['exten'],'priority':_0x113d86[_0x8935('0x33')]+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356['VoiceExtensionId']});}else{_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356['type'],'app':'ExecIf','appdata':_0x8935('0x36'),'context':_0x1a2356[_0x8935('0x16')],'exten':_0x1a2356[_0x8935('0x9')],'priority':_0x113d86['length']+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});}}if(_0x1a2356['hasOwnProperty'](_0x8935('0x37'))){if(_0x19d149[_0x8935('0x38')](_0x1a2356[_0x8935('0x39')][_0x8935('0x2b')]())>=0x0&&_0x1a2356[_0x8935('0x3a')]!=='custom'){if(_0x1a2356[_0x8935('0x37')]){_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356['type'],'app':_0x8935('0x1f'),'appdata':_0x8935('0x3b'),'context':_0x1a2356['context'],'exten':_0x1a2356['exten'],'priority':_0x113d86[_0x8935('0x33')]+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356[_0x8935('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1a2356[_0x8935('0x16')],'exten':_0x1a2356['exten'],'priority':_0x113d86['length']+_0x48e99d['priority']+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});}else{_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356[_0x8935('0x14')],'app':_0x8935('0x1f'),'appdata':_0x8935('0x3c'),'context':_0x1a2356[_0x8935('0x16')],'exten':_0x1a2356[_0x8935('0x9')],'priority':_0x113d86[_0x8935('0x33')]+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});_0x16ad7a[_0x8935('0x13')]({'type':_0x1a2356['type'],'app':_0x8935('0x15'),'appdata':_0x8935('0x3d'),'context':_0x1a2356['context'],'exten':_0x1a2356['exten'],'priority':_0x113d86[_0x8935('0x33')]+_0x48e99d[_0x8935('0xf')]+_0x5149a8++,'VoiceExtensionId':_0x1a2356[_0x8935('0x17')]});}}}for(var _0x469a2d=0x0;_0x469a2d<_0x113d86[_0x8935('0x33')];_0x469a2d+=0x1){var _0x35f2bc=_0x48e99d[_0x8935('0xf')]+_0x113d86[_0x8935('0x33')];var _0x19efab=_0x469a2d===_0x113d86[_0x8935('0x33')]-0x1?_0x48e99d['priority']+_0x16ad7a['length']+_0x303896[_0x8935('0x33')]+0x2:_0x48e99d[_0x8935('0xf')]+_0x469a2d+0x1;_0x16ad7a[_0x8935('0x3e')](_0x469a2d,0x0,{'type':_0x1a2356[_0x8935('0x14')],'app':_0x8935('0x3f'),'appdata':_0x113d86[_0x469a2d]+'?'+_0x1a2356[_0x8935('0x16')]+_0x8935('0x40')+_0x35f2bc+':'+_0x1a2356[_0x8935('0x16')]+_0x8935('0x40')+_0x19efab,'exten':_0x1a2356[_0x8935('0x9')],'context':_0x1a2356['context'],'priority':_0x48e99d[_0x8935('0xf')]+_0x469a2d,'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']});}_0x1a2356[_0x8935('0xf')]=_0x16ad7a[_0x8935('0x33')]?_[_0x8935('0x41')](_0x16ad7a)[_0x8935('0xf')]+0x1:_0x48e99d[_0x8935('0xf')];_0x48e99d[_0x8935('0xf')]=(_0x303896['length']?_[_0x8935('0x41')](_0x303896)[_0x8935('0xf')]:_0x1a2356[_0x8935('0xf')])+0x1;_0x48e99d['extensions']=_[_0x8935('0x42')](_0x48e99d[_0x8935('0x10')],_0x16ad7a,[_0x1a2356],_0x303896);}_0x48e99d[_0x8935('0x10')][_0x8935('0x13')]({'type':_0x2d0d22[_0x50ee81][0x0]['type'],'app':'Hangup','exten':_0x2d0d22[_0x50ee81][0x0]['exten'],'context':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x16')],'priority':_0x48e99d['priority'],'VoiceExtensionId':_0x2d0d22[_0x50ee81][0x0][_0x8935('0x17')]});_0x536d79[_0x8935('0x13')](_0x2d0d22[_0x50ee81][0x0]['VoiceExtensionId']);_0x4e0b6f=_[_0x8935('0x42')](_0x4e0b6f,_0x48e99d[_0x8935('0x10')]);}}return _0x47735f[_0x8935('0x43')](function(_0x1dd570){return _0x47735f[_0x8935('0x2')]['VoiceExtension'][_0x8935('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x536d79}},'transaction':_0x1dd570})['then'](function(_0x111d4c){return _0x47735f['models']['VoiceExtension'][_0x8935('0x45')](_[_0x8935('0x46')](_0x4e0b6f,'priority'),{'transaction':_0x1dd570});});});})[_0x8935('0x47')](function(_0x1be0a4){console[_0x8935('0x48')](_0x1be0a4);});}exports[_0x8935('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c7d23ba..707adb6 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 _0x4298=['birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','insert','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','findAll','outbound','BlackLists','get','Campaign','CampaignId','all','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4298,0x131));var _0x8429=function(_0x575696,_0x43e437){_0x575696=_0x575696-0x0;var _0x55cc52=_0x4298[_0x575696];return _0x55cc52;};'use strict';var BPromise=require(_0x8429('0x0'));var util=require(_0x8429('0x1'));var _=require(_0x8429('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x8429('0x3'));var db=require(_0x8429('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x8429('0x5'))(_0x8429('0x6'));config[_0x8429('0x7')]=_[_0x8429('0x8')](config[_0x8429('0x7')],{'host':_0x8429('0x9'),'port':0x18eb});var socket=require(_0x8429('0xa'))(new Redis(config['redis']));require(_0x8429('0xb'))[_0x8429('0xc')](socket);try{if(!process[_0x8429('0xd')][0x2]||process[_0x8429('0xd')][0x2]===_0x8429('0xe')||process[_0x8429('0xd')][0x2]===_0x8429('0xf')){throw new Error(_0x8429('0x10'));}var FILEPATH=process[_0x8429('0xd')][0x2];if(!process[_0x8429('0xd')][0x3]||process[_0x8429('0xd')][0x3]===_0x8429('0xe')||process[_0x8429('0xd')][0x3]===_0x8429('0xf')||!process[_0x8429('0xd')][0x4]||process[_0x8429('0xd')][0x4]===_0x8429('0xe')||process['argv'][0x4]===_0x8429('0xf')){throw new Error(_0x8429('0x11'));}var FIELDS=_[_0x8429('0x12')](process[_0x8429('0xd')][0x3][_0x8429('0x13')](','),process[_0x8429('0xd')][0x4][_0x8429('0x13')](','));if(!process[_0x8429('0xd')][0x5]||process[_0x8429('0xd')][0x5]===_0x8429('0xe')||process[_0x8429('0xd')][0x5]===_0x8429('0xf')){throw new Error(_0x8429('0x14'));}var LISTID=process[_0x8429('0xd')][0x5];var COMPANYID=process[_0x8429('0xd')][0x6]&&process['argv'][0x6]!==_0x8429('0xe')&&process['argv'][0x6]!==_0x8429('0xf')?process[_0x8429('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x8429('0xe')&&process[_0x8429('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x8429('0xd')][0x8]||process[_0x8429('0xd')][0x8]===_0x8429('0xe')||process[_0x8429('0xd')][0x8]===_0x8429('0xf')){throw new Error(_0x8429('0x15'));}var SOCKET_TIMESTAMP=process[_0x8429('0xd')][0x8];}catch(_0x424fde){logger[_0x8429('0x16')](_0x424fde);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(_0x228a17,_0x545a4f,_0x2a2020,_0x1a782e){var _0x20fd21={'message':_0x545a4f};_0x20fd21[_0x228a17]=!![];if(_0x2a2020){_0x20fd21[_0x8429('0x17')]=_0x2a2020;}if(_0x1a782e){_0x20fd21['index']=_0x1a782e;}return _0x20fd21;}function isEmail(_0x4b17e9){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'](_0x4b17e9);}function checkRow(_0x4574f0,_0x1e6614,_0x339cf3){return new BPromise(function(_0x1a9be9,_0x2d759a){if(_[_0x8429('0x18')](_0x4574f0)){return _0x2d759a(handleCheckRowError('error',_0x8429('0x19'),null,_0x339cf3));}if(_0x4574f0['errors']&&_0x4574f0[_0x8429('0x1a')][_0x8429('0x1b')]){var _0x4f2e3a=_['map'](_0x4574f0[_0x8429('0x1a')],_0x8429('0x1c'))[_0x8429('0x1d')](';');return _0x2d759a(handleCheckRowError('error',_0x4f2e3a,null,_0x339cf3));}var _0x2fc386={};for(var _0x40948b in FIELDS){if(FIELDS[_0x8429('0x1e')](_0x40948b)&&FIELDS[_0x40948b]){_0x2fc386[_0x40948b]=_0x4574f0[_0x8429('0x1f')][0x0][FIELDS[_0x40948b]]||_0x4574f0[_0x8429('0x1f')][0x0]['\ufeff'+FIELDS[_0x40948b]];}}if(!_0x2fc386['firstName']){return _0x2d759a(handleCheckRowError(_0x8429('0x16'),_0x8429('0x20'),null,_0x339cf3));}if(!_0x2fc386[_0x8429('0x21')]){return _0x2d759a(handleCheckRowError(_0x8429('0x16'),_0x8429('0x22'),null,_0x339cf3));}if(_0x2fc386[_0x8429('0x23')]){var _0x22b73b=moment(_0x2fc386[_0x8429('0x23')],'YYYY-MM-DD');if(!_0x22b73b[_0x8429('0x24')]()){return _0x2d759a(handleCheckRowError(_0x8429('0x16'),_0x8429('0x25'),null,_0x339cf3));}}if(_0x2fc386[_0x8429('0x26')]){if(!isEmail(_0x2fc386[_0x8429('0x26')])){return _0x2d759a(handleCheckRowError(_0x8429('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x339cf3));}}_0x2fc386[_0x8429('0x27')]=LISTID;_0x2fc386[_0x8429('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8429('0x1b')]&&_0x1e6614){var _0x56fa81={};for(var _0x49523e=0x0,_0x163349=DUPLICATES['length'];_0x49523e<_0x163349;_0x49523e+=0x1){_0x56fa81[DUPLICATES[_0x49523e]]=_0x2fc386[DUPLICATES[_0x49523e]];}var _0x2775a9=_[_0x8429('0x29')](_0x1e6614,_0x56fa81);if(_0x2775a9){return _0x2d759a(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x2775a9,_0x339cf3));}}return db[_0x8429('0x2a')][_0x8429('0x2b')](_0x2fc386,{'raw':!![],'hooks':![],'fields':_[_0x8429('0x2c')](_0x2fc386)})[_0x8429('0x2d')](function(_0x1da869){if(DUPLICATES&&DUPLICATES[_0x8429('0x1b')]&&_0x1e6614){_0x1e6614[_0x8429('0x2e')](_[_0x8429('0x2f')](_0x2fc386,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1da869['id'];return _0x1a9be9();})[_0x8429('0x30')](function(_0x9dc8ff){return _0x2d759a(handleCheckRowError(_0x8429('0x16'),_0x8429('0x31')+(_0x9dc8ff[_0x8429('0x1c')]||JSON[_0x8429('0x32')](_0x9dc8ff)),null,_0x339cf3));});});}function checkHopper(){function _0x5739c7(){return function(_0x5ea371){logger[_0x8429('0x16')](_0x8429('0x33'),_0x8429('0x34'),util[_0x8429('0x35')](_0x5ea371,{'showHidden':![],'depth':null}));};}var _0x5069be=function(_0x603607,_0x5b823f){var _0x4b7100=squel['insert']()[_0x8429('0x36')]('cm_hopper')[_0x8429('0x37')](['phone','scheduledAt',_0x8429('0x38'),'ListId',_0x5b823f,_0x8429('0x39'),_0x8429('0x3a')],squel[_0x8429('0x3b')]()['field'](_0x8429('0x21'),'phone')[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x3e'))[_0x8429('0x3c')]('id',_0x8429('0x38'))[_0x8429('0x3c')](LISTID[_0x8429('0x3f')](),'ListId')[_0x8429('0x3c')](_0x603607['id']['toString'](),_0x5b823f)['field'](_0x8429('0x3d'),'createdAt')[_0x8429('0x3c')]('NOW()','updatedAt')['from'](_0x8429('0x40'))['where'](_0x8429('0x41'))[_0x8429('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x8429('0x42')](_0x8429('0x43'))[_0x8429('0x42')](_0x8429('0x44'),squel[_0x8429('0x3b')]()['field']('phone')[_0x8429('0x45')](_0x8429('0x46'))['where'](_0x5b823f+_0x8429('0x47'),_0x603607['id'][_0x8429('0x3f')]())))[_0x8429('0x3f')]();return _0x4b7100;};var _0x44e59d=function(_0x7d4990,_0x57dfa7){var _0xa5f547=squel[_0x8429('0x48')]()['into'](_0x8429('0x46'))[_0x8429('0x37')]([_0x8429('0x21'),'scheduledAt',_0x8429('0x38'),'ListId',_0x57dfa7,_0x8429('0x39'),_0x8429('0x3a')],squel[_0x8429('0x3b')]()[_0x8429('0x3c')](_0x8429('0x21'),_0x8429('0x21'))[_0x8429('0x3c')]('NOW()',_0x8429('0x3e'))[_0x8429('0x3c')]('id',_0x8429('0x38'))[_0x8429('0x3c')](LISTID[_0x8429('0x3f')](),_0x8429('0x27'))[_0x8429('0x3c')](_0x7d4990['id'][_0x8429('0x3f')](),_0x57dfa7)[_0x8429('0x3c')](_0x8429('0x3d'),'createdAt')[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x3a'))[_0x8429('0x45')]('cm_contacts')[_0x8429('0x42')]('deletedAt\x20IS\x20NULL')[_0x8429('0x42')](_0x8429('0x49'),LISTID[_0x8429('0x3f')]())[_0x8429('0x42')](_0x8429('0x4a'),squel[_0x8429('0x4b')](hopperContacts))[_0x8429('0x42')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x8429('0x44'),squel[_0x8429('0x3b')]()['field'](_0x8429('0x4c'))['from'](_0x8429('0x4d'))[_0x8429('0x42')](_0x57dfa7+_0x8429('0x47'),_0x7d4990['id'][_0x8429('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8429('0x3b')]()[_0x8429('0x3c')](_0x8429('0x21'))[_0x8429('0x45')]('cm_hopper')[_0x8429('0x42')](_0x57dfa7+_0x8429('0x47'),_0x7d4990['id'][_0x8429('0x3f')]())))[_0x8429('0x3f')]();return _0xa5f547;};function _0x4831a4(_0x130654,_0x53f3b7){var _0x4f89ec=squel['insert']()[_0x8429('0x36')]('cm_hopper')['fromQuery']([_0x8429('0x21'),_0x8429('0x3e'),_0x8429('0x38'),_0x8429('0x27'),_0x53f3b7,_0x8429('0x39'),'updatedAt'],squel[_0x8429('0x3b')]()[_0x8429('0x3c')]('phone',_0x8429('0x21'))[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x3e'))['field']('id',_0x8429('0x38'))[_0x8429('0x3c')](LISTID[_0x8429('0x3f')](),_0x8429('0x27'))[_0x8429('0x3c')](_0x130654['id'][_0x8429('0x3f')](),_0x53f3b7)[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x39'))[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x3a'))[_0x8429('0x45')](_0x8429('0x40'))[_0x8429('0x42')](_0x8429('0x41'))['where'](_0x8429('0x49'),LISTID[_0x8429('0x3f')]())['where'](_0x8429('0x4a'),squel[_0x8429('0x4b')](hopperContacts))['where'](_0x8429('0x43')))[_0x8429('0x3f')]();return _0x4f89ec;}function _0x3626b1(_0x367e87,_0x1435c3){var _0x3f2342=squel[_0x8429('0x48')]()[_0x8429('0x36')](_0x8429('0x4e'))[_0x8429('0x37')]([_0x8429('0x21'),_0x8429('0x38'),_0x8429('0x27'),_0x1435c3,_0x8429('0x39'),_0x8429('0x3a')],squel['select']()[_0x8429('0x3c')](_0x8429('0x21'),_0x8429('0x21'))[_0x8429('0x3c')]('id',_0x8429('0x38'))[_0x8429('0x3c')](LISTID['toString'](),'ListId')[_0x8429('0x3c')](_0x367e87['id'][_0x8429('0x3f')](),_0x1435c3)[_0x8429('0x3c')](_0x8429('0x3d'),_0x8429('0x39'))[_0x8429('0x3c')](_0x8429('0x3d'),'updatedAt')[_0x8429('0x45')](_0x8429('0x40'))[_0x8429('0x42')]('deletedAt\x20IS\x20NULL')[_0x8429('0x42')](_0x8429('0x49'),LISTID[_0x8429('0x3f')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8429('0x3f')]();return _0x3f2342;}return db[_0x8429('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x8429('0x50')],'include':[{'model':db[_0x8429('0x51')],'as':_0x8429('0x52'),'where':{'id':LISTID}}]})[_0x8429('0x2d')](function(_0x3447ae){var _0x365dfd=[];if(_0x3447ae){var _0x3eb2e4;for(var _0x2c24f5=0x0,_0x10d638;_0x2c24f5<_0x3447ae['length'];_0x2c24f5+=0x1){_0x10d638=_0x3447ae[_0x2c24f5]['get']({'plain':!![]});switch(_0x10d638[_0x8429('0x50')]){case _0x8429('0x53'):_0x365dfd[_0x8429('0x2e')](db[_0x8429('0x54')][_0x8429('0x55')](_0x44e59d(_0x10d638,_0x8429('0x56')))[_0x8429('0x2d')](function(){})[_0x8429('0x30')](_0x5739c7()));break;case _0x8429('0x57'):_0x365dfd[_0x8429('0x2e')](db[_0x8429('0x54')][_0x8429('0x55')](_0x5069be(_0x10d638,'VoiceQueueId'))[_0x8429('0x2d')](function(){})[_0x8429('0x30')](_0x5739c7()));break;default:_0x365dfd[_0x8429('0x2e')](db[_0x8429('0x54')][_0x8429('0x55')](_0x4831a4(_0x10d638,_0x8429('0x56')))[_0x8429('0x2d')](function(){})['catch'](_0x5739c7()));}}}return _0x365dfd;})['all']()[_0x8429('0x2d')](function(){return db[_0x8429('0x4f')][_0x8429('0x58')]({'where':{'type':_0x8429('0x59')},'attributes':['id'],'include':[{'model':db[_0x8429('0x51')],'as':_0x8429('0x5a'),'where':{'id':LISTID}}]})[_0x8429('0x2d')](function(_0x1278c2){var _0x150122=[];if(_0x1278c2){var _0x236dc5;for(var _0xa3afd5=0x0,_0x546b16;_0xa3afd5<_0x1278c2[_0x8429('0x1b')];_0xa3afd5+=0x1){_0x546b16=_0x1278c2[_0xa3afd5][_0x8429('0x5b')]({'plain':!![]});_0x150122[_0x8429('0x2e')](db[_0x8429('0x54')][_0x8429('0x55')](_0x3626b1(_0x546b16,'VoiceQueueId'))[_0x8429('0x2d')](function(){})[_0x8429('0x30')](_0x5739c7()));}}return _0x150122;})['all']();})[_0x8429('0x2d')](function(){return db[_0x8429('0x5c')][_0x8429('0x58')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x8429('0x51')],'as':_0x8429('0x52'),'where':{'id':LISTID}}]})[_0x8429('0x2d')](function(_0x454abc){var _0x7adc73=[];if(_0x454abc){for(var _0x13c19c=0x0,_0x541225;_0x13c19c<_0x454abc[_0x8429('0x1b')];_0x13c19c+=0x1){_0x541225=_0x454abc[_0x13c19c][_0x8429('0x5b')]({'plain':!![]});switch(_0x541225[_0x8429('0x50')]){case'always':_0x7adc73[_0x8429('0x2e')](db[_0x8429('0x54')]['query'](_0x44e59d(_0x541225,'CampaignId'))[_0x8429('0x2d')](function(){})[_0x8429('0x30')](_0x5739c7()));break;case'onlyIfOpen':_0x7adc73[_0x8429('0x2e')](db[_0x8429('0x54')]['query'](_0x5069be(_0x541225,'CampaignId'))['then'](function(){})[_0x8429('0x30')](_0x5739c7()));break;default:_0x7adc73[_0x8429('0x2e')](db['sequelize'][_0x8429('0x55')](_0x4831a4(_0x541225,_0x8429('0x5d')))[_0x8429('0x2d')](function(){})['catch'](_0x5739c7()));}}}return _0x7adc73;})[_0x8429('0x5e')]();})[_0x8429('0x2d')](function(){return db[_0x8429('0x5c')][_0x8429('0x58')]({'attributes':['id'],'include':[{'model':db[_0x8429('0x51')],'as':_0x8429('0x5a'),'where':{'id':LISTID}}]})[_0x8429('0x2d')](function(_0x446be4){var _0xfae00c=[];if(_0x446be4){for(var _0x1fd5c2=0x0,_0x28140f;_0x1fd5c2<_0x446be4['length'];_0x1fd5c2+=0x1){_0x28140f=_0x446be4[_0x1fd5c2]['get']({'plain':!![]});_0xfae00c[_0x8429('0x2e')](db[_0x8429('0x54')][_0x8429('0x55')](_0x3626b1(_0x28140f,_0x8429('0x5d')))[_0x8429('0x2d')](function(){})['catch'](_0x5739c7()));}}return _0xfae00c;})[_0x8429('0x5e')]();})[_0x8429('0x30')](function(_0x1487d1){logger[_0x8429('0x16')](_0x8429('0x5f'),_0x8429('0x60'),_0x1487d1[_0x8429('0x1c')]);});}var processPromises=function(_0x309d5e){return BPromise[_0x8429('0x5e')](promises)[_0x8429('0x2d')](function(_0x5337a4){})[_0x8429('0x30')](function(_0x3f7f2d){logger[_0x8429('0x16')](_0x8429('0x61'),JSON['stringify'](_0x3f7f2d));})[_0x8429('0x62')](function(){socket['emit'](_0x8429('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x309d5e){return _0x309d5e[_0x8429('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x8429('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x8429('0x65')](_0x8429('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8429('0x66')](FILEPATH);}catch(_0x2705ab){logger['error'](_0x8429('0x67'),JSON[_0x8429('0x32')](_0x2705ab));}finally{process['exit'](0x0);}});};process['on'](_0x8429('0x68'),function(){logger[_0x8429('0x69')](_0x8429('0x6a'));endCsv();});function main(){return BPromise[_0x8429('0x6b')]()[_0x8429('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8429('0x13')](',');return db[_0x8429('0x2a')][_0x8429('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8429('0x2d')](function(_0x321970){var _0x414d56=fs[_0x8429('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8429('0x6d')](_0x414d56,{'header':!![],'skipEmptyLines':!![],'step':function(_0x56c30d,_0x3f929f){total+=0x1;var _0x2d7388=total;promises[_0x8429('0x2e')](checkRow(_0x56c30d,_0x321970,_0x2d7388)[_0x8429('0x2d')](function(){success+=0x1;})[_0x8429('0x30')](function(_0x2ab59c){if(_0x2ab59c['error']){errors+=0x1;delete _0x2ab59c[_0x8429('0x16')];}else if(_0x2ab59c[_0x8429('0x6e')]){duplicates+=0x1;delete _0x2ab59c[_0x8429('0x6e')];}rows[_0x8429('0x2e')](_0x2ab59c);}));if(total%0xc8===0x0){_0x3f929f[_0x8429('0x6f')]();return processPromises(_0x3f929f);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x8429('0x70'));endCsv();});},'error':function(_0x2e28d6,_0x6f193b){logger[_0x8429('0x69')]('CSV\x20parse\x20error',JSON[_0x8429('0x32')](_0x2e28d6));endCsv();}});})[_0x8429('0x30')](function(_0x21a872){logger['error'](_0x8429('0x71'),JSON['stringify'](_0x21a872));});}main(); \ No newline at end of file +var _0xe572=['\x20=\x20?','fromQuery','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','deletedAt\x20IS\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','then','get','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','Campaign','CmList','always','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xe572,0x177));var _0x2e57=function(_0x146f25,_0x2a1d90){_0x146f25=_0x146f25-0x0;var _0x13fb32=_0xe572[_0x146f25];return _0x13fb32;};'use strict';var BPromise=require(_0x2e57('0x0'));var util=require(_0x2e57('0x1'));var _=require(_0x2e57('0x2'));var fs=require('fs');var squel=require(_0x2e57('0x3'));var Papa=require(_0x2e57('0x4'));var Redis=require('ioredis');var db=require(_0x2e57('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x2e57('0x6'))(_0x2e57('0x7'));config[_0x2e57('0x8')]=_[_0x2e57('0x9')](config[_0x2e57('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e57('0xa'))(new Redis(config['redis']));require(_0x2e57('0xb'))[_0x2e57('0xc')](socket);try{if(!process[_0x2e57('0xd')][0x2]||process['argv'][0x2]===_0x2e57('0xe')||process[_0x2e57('0xd')][0x2]===_0x2e57('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x2e57('0xd')][0x3]||process['argv'][0x3]===_0x2e57('0xe')||process[_0x2e57('0xd')][0x3]===_0x2e57('0xf')||!process[_0x2e57('0xd')][0x4]||process[_0x2e57('0xd')][0x4]===_0x2e57('0xe')||process[_0x2e57('0xd')][0x4]===_0x2e57('0xf')){throw new Error(_0x2e57('0x10'));}var FIELDS=_[_0x2e57('0x11')](process[_0x2e57('0xd')][0x3]['split'](','),process[_0x2e57('0xd')][0x4][_0x2e57('0x12')](','));if(!process[_0x2e57('0xd')][0x5]||process[_0x2e57('0xd')][0x5]==='undefined'||process[_0x2e57('0xd')][0x5]==='null'){throw new Error(_0x2e57('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x2e57('0xd')][0x6]&&process['argv'][0x6]!==_0x2e57('0xe')&&process[_0x2e57('0xd')][0x6]!==_0x2e57('0xf')?process[_0x2e57('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x2e57('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x2e57('0xf')?process[_0x2e57('0xd')][0x7]:null;if(!process[_0x2e57('0xd')][0x8]||process[_0x2e57('0xd')][0x8]===_0x2e57('0xe')||process[_0x2e57('0xd')][0x8]===_0x2e57('0xf')){throw new Error(_0x2e57('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x34177e){logger['error'](_0x34177e);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(_0x51b57c,_0x44c584,_0x4f6cae,_0xc70161){var _0x5f5240={'message':_0x44c584};_0x5f5240[_0x51b57c]=!![];if(_0x4f6cae){_0x5f5240[_0x2e57('0x15')]=_0x4f6cae;}if(_0xc70161){_0x5f5240[_0x2e57('0x16')]=_0xc70161;}return _0x5f5240;}function isEmail(_0x51a772){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))*$/[_0x2e57('0x17')](_0x51a772);}function checkRow(_0x54b73c,_0x28c163,_0x2acfb4){return new BPromise(function(_0x5f0940,_0x1b6594){if(_[_0x2e57('0x18')](_0x54b73c)){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),_0x2e57('0x1a'),null,_0x2acfb4));}if(_0x54b73c[_0x2e57('0x1b')]&&_0x54b73c[_0x2e57('0x1b')][_0x2e57('0x1c')]){var _0x203626=_['map'](_0x54b73c[_0x2e57('0x1b')],_0x2e57('0x1d'))[_0x2e57('0x1e')](';');return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),_0x203626,null,_0x2acfb4));}var _0x1f17ab={};for(var _0x1ae581 in FIELDS){if(FIELDS[_0x2e57('0x1f')](_0x1ae581)&&FIELDS[_0x1ae581]){_0x1f17ab[_0x1ae581]=_0x54b73c[_0x2e57('0x20')][0x0][FIELDS[_0x1ae581]]||_0x54b73c['data'][0x0]['\ufeff'+FIELDS[_0x1ae581]];}}if(!_0x1f17ab[_0x2e57('0x21')]){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),_0x2e57('0x22'),null,_0x2acfb4));}if(!_0x1f17ab[_0x2e57('0x23')]){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),'phone\x20not\x20specified!',null,_0x2acfb4));}if(_0x1f17ab[_0x2e57('0x24')]){var _0x4e6755=moment(_0x1f17ab[_0x2e57('0x24')],_0x2e57('0x25'));if(!_0x4e6755['isValid']()){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x2acfb4));}}if(_0x1f17ab[_0x2e57('0x26')]){if(!isEmail(_0x1f17ab[_0x2e57('0x26')])){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),_0x2e57('0x27'),null,_0x2acfb4));}}_0x1f17ab['ListId']=LISTID;_0x1f17ab[_0x2e57('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2e57('0x1c')]&&_0x28c163){var _0xe88569={};for(var _0x273a3a=0x0,_0xd48e0b=DUPLICATES[_0x2e57('0x1c')];_0x273a3a<_0xd48e0b;_0x273a3a+=0x1){_0xe88569[DUPLICATES[_0x273a3a]]=_0x1f17ab[DUPLICATES[_0x273a3a]];}var _0x31b4ff=_[_0x2e57('0x29')](_0x28c163,_0xe88569);if(_0x31b4ff){return _0x1b6594(handleCheckRowError(_0x2e57('0x2a'),_0x2e57('0x2b'),_0x31b4ff,_0x2acfb4));}}return db[_0x2e57('0x2c')][_0x2e57('0x2d')](_0x1f17ab,{'raw':!![],'hooks':![],'fields':_[_0x2e57('0x2e')](_0x1f17ab)})['then'](function(_0xbca66a){if(DUPLICATES&&DUPLICATES[_0x2e57('0x1c')]&&_0x28c163){_0x28c163[_0x2e57('0x2f')](_[_0x2e57('0x30')](_0x1f17ab,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xbca66a['id'];return _0x5f0940();})['catch'](function(_0x4dc425){return _0x1b6594(handleCheckRowError(_0x2e57('0x19'),_0x2e57('0x31')+(_0x4dc425[_0x2e57('0x1d')]||JSON[_0x2e57('0x32')](_0x4dc425)),null,_0x2acfb4));});});}function checkHopper(){function _0x5f59f5(){return function(_0x476b22){logger['error']('cmContact',_0x2e57('0x33'),util['inspect'](_0x476b22,{'showHidden':![],'depth':null}));};}var _0x9df307=function(_0x53ca12,_0x5f3835){var _0x22aedc=squel[_0x2e57('0x34')]()[_0x2e57('0x35')]('cm_hopper')['fromQuery']([_0x2e57('0x23'),_0x2e57('0x36'),_0x2e57('0x37'),_0x2e57('0x38'),_0x5f3835,_0x2e57('0x39'),_0x2e57('0x3a')],squel[_0x2e57('0x3b')]()[_0x2e57('0x3c')](_0x2e57('0x23'),'phone')[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x36'))[_0x2e57('0x3c')]('id','ContactId')[_0x2e57('0x3c')](LISTID[_0x2e57('0x3e')](),_0x2e57('0x38'))[_0x2e57('0x3c')](_0x53ca12['id']['toString'](),_0x5f3835)[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x39'))[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x3a'))[_0x2e57('0x3f')](_0x2e57('0x40'))[_0x2e57('0x41')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x2e57('0x3e')]())[_0x2e57('0x41')](_0x2e57('0x42'))[_0x2e57('0x41')](_0x2e57('0x43'),squel[_0x2e57('0x3b')]()[_0x2e57('0x3c')]('phone')[_0x2e57('0x3f')](_0x2e57('0x44'))['where'](_0x5f3835+_0x2e57('0x45'),_0x53ca12['id']['toString']())))[_0x2e57('0x3e')]();return _0x22aedc;};var _0x1ec034=function(_0x4d8700,_0x138991){var _0x59102f=squel[_0x2e57('0x34')]()['into'](_0x2e57('0x44'))[_0x2e57('0x46')]([_0x2e57('0x23'),_0x2e57('0x36'),_0x2e57('0x37'),_0x2e57('0x38'),_0x138991,_0x2e57('0x39'),_0x2e57('0x3a')],squel[_0x2e57('0x3b')]()[_0x2e57('0x3c')](_0x2e57('0x23'),_0x2e57('0x23'))[_0x2e57('0x3c')]('NOW()','scheduledAt')[_0x2e57('0x3c')]('id',_0x2e57('0x37'))[_0x2e57('0x3c')](LISTID[_0x2e57('0x3e')](),_0x2e57('0x38'))['field'](_0x4d8700['id'][_0x2e57('0x3e')](),_0x138991)[_0x2e57('0x3c')]('NOW()','createdAt')[_0x2e57('0x3c')]('NOW()',_0x2e57('0x3a'))['from'](_0x2e57('0x40'))[_0x2e57('0x41')]('deletedAt\x20IS\x20NULL')[_0x2e57('0x41')](_0x2e57('0x47'),LISTID[_0x2e57('0x3e')]())['where'](_0x2e57('0x48'),squel['str'](hopperContacts))[_0x2e57('0x41')](_0x2e57('0x42'))['where'](_0x2e57('0x43'),squel[_0x2e57('0x3b')]()['field'](_0x2e57('0x49'))['from'](_0x2e57('0x4a'))['where'](_0x138991+_0x2e57('0x45'),_0x4d8700['id'][_0x2e57('0x3e')]()))[_0x2e57('0x41')](_0x2e57('0x43'),squel['select']()['field'](_0x2e57('0x23'))[_0x2e57('0x3f')]('cm_hopper')[_0x2e57('0x41')](_0x138991+_0x2e57('0x45'),_0x4d8700['id'][_0x2e57('0x3e')]())))['toString']();return _0x59102f;};function _0x2a114e(_0x1e974e,_0x44e69e){var _0x13d21b=squel[_0x2e57('0x34')]()[_0x2e57('0x35')]('cm_hopper')[_0x2e57('0x46')](['phone',_0x2e57('0x36'),_0x2e57('0x37'),_0x2e57('0x38'),_0x44e69e,_0x2e57('0x39'),'updatedAt'],squel[_0x2e57('0x3b')]()['field'](_0x2e57('0x23'),_0x2e57('0x23'))[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x36'))['field']('id',_0x2e57('0x37'))[_0x2e57('0x3c')](LISTID['toString'](),_0x2e57('0x38'))[_0x2e57('0x3c')](_0x1e974e['id'][_0x2e57('0x3e')](),_0x44e69e)[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x39'))['field']('NOW()',_0x2e57('0x3a'))['from'](_0x2e57('0x40'))[_0x2e57('0x41')](_0x2e57('0x4b'))[_0x2e57('0x41')]('ListId\x20=\x20?',LISTID['toString']())[_0x2e57('0x41')](_0x2e57('0x48'),squel['str'](hopperContacts))[_0x2e57('0x41')](_0x2e57('0x42')))['toString']();return _0x13d21b;}function _0x244dd2(_0x35f339,_0x1ca518){var _0x1a410a=squel['insert']()[_0x2e57('0x35')]('cm_hopper_black')[_0x2e57('0x46')](['phone',_0x2e57('0x37'),_0x2e57('0x38'),_0x1ca518,'createdAt','updatedAt'],squel[_0x2e57('0x3b')]()[_0x2e57('0x3c')](_0x2e57('0x23'),_0x2e57('0x23'))['field']('id',_0x2e57('0x37'))['field'](LISTID[_0x2e57('0x3e')](),_0x2e57('0x38'))['field'](_0x35f339['id'][_0x2e57('0x3e')](),_0x1ca518)[_0x2e57('0x3c')]('NOW()','createdAt')[_0x2e57('0x3c')](_0x2e57('0x3d'),_0x2e57('0x3a'))[_0x2e57('0x3f')](_0x2e57('0x40'))[_0x2e57('0x41')](_0x2e57('0x4b'))[_0x2e57('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x1a410a;}return db[_0x2e57('0x4c')][_0x2e57('0x4d')]({'where':{'type':_0x2e57('0x4e')},'attributes':['id',_0x2e57('0x4f')],'include':[{'model':db['CmList'],'as':_0x2e57('0x50'),'where':{'id':LISTID}}]})[_0x2e57('0x51')](function(_0x23fc8b){var _0x457d36=[];if(_0x23fc8b){var _0x204e5a;for(var _0x3a738b=0x0,_0x48a9d7;_0x3a738b<_0x23fc8b[_0x2e57('0x1c')];_0x3a738b+=0x1){_0x48a9d7=_0x23fc8b[_0x3a738b][_0x2e57('0x52')]({'plain':!![]});switch(_0x48a9d7['dialCheckDuplicateType']){case'always':_0x457d36['push'](db[_0x2e57('0x53')][_0x2e57('0x54')](_0x1ec034(_0x48a9d7,_0x2e57('0x55')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));break;case _0x2e57('0x57'):_0x457d36[_0x2e57('0x2f')](db['sequelize'][_0x2e57('0x54')](_0x9df307(_0x48a9d7,_0x2e57('0x55')))['then'](function(){})[_0x2e57('0x56')](_0x5f59f5()));break;default:_0x457d36[_0x2e57('0x2f')](db['sequelize'][_0x2e57('0x54')](_0x2a114e(_0x48a9d7,'VoiceQueueId'))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));}}}return _0x457d36;})[_0x2e57('0x58')]()['then'](function(){return db[_0x2e57('0x4c')]['findAll']({'where':{'type':_0x2e57('0x4e')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4ec124){var _0x48dcd8=[];if(_0x4ec124){var _0x34473c;for(var _0x1e682c=0x0,_0x4368b8;_0x1e682c<_0x4ec124['length'];_0x1e682c+=0x1){_0x4368b8=_0x4ec124[_0x1e682c][_0x2e57('0x52')]({'plain':!![]});_0x48dcd8[_0x2e57('0x2f')](db[_0x2e57('0x53')][_0x2e57('0x54')](_0x244dd2(_0x4368b8,_0x2e57('0x55')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));}}return _0x48dcd8;})['all']();})[_0x2e57('0x51')](function(){return db[_0x2e57('0x59')][_0x2e57('0x4d')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x2e57('0x5a')],'as':_0x2e57('0x50'),'where':{'id':LISTID}}]})[_0x2e57('0x51')](function(_0x207234){var _0x2ad6c0=[];if(_0x207234){for(var _0x338b3a=0x0,_0x53ad11;_0x338b3a<_0x207234[_0x2e57('0x1c')];_0x338b3a+=0x1){_0x53ad11=_0x207234[_0x338b3a][_0x2e57('0x52')]({'plain':!![]});switch(_0x53ad11[_0x2e57('0x4f')]){case _0x2e57('0x5b'):_0x2ad6c0[_0x2e57('0x2f')](db[_0x2e57('0x53')]['query'](_0x1ec034(_0x53ad11,_0x2e57('0x5c')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));break;case _0x2e57('0x57'):_0x2ad6c0['push'](db[_0x2e57('0x53')]['query'](_0x9df307(_0x53ad11,_0x2e57('0x5c')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));break;default:_0x2ad6c0[_0x2e57('0x2f')](db[_0x2e57('0x53')][_0x2e57('0x54')](_0x2a114e(_0x53ad11,_0x2e57('0x5c')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));}}}return _0x2ad6c0;})[_0x2e57('0x58')]();})[_0x2e57('0x51')](function(){return db['Campaign'][_0x2e57('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x2e57('0x5a')],'as':_0x2e57('0x5d'),'where':{'id':LISTID}}]})[_0x2e57('0x51')](function(_0x5a9826){var _0x5900e6=[];if(_0x5a9826){for(var _0x36c2f6=0x0,_0x34eff8;_0x36c2f6<_0x5a9826[_0x2e57('0x1c')];_0x36c2f6+=0x1){_0x34eff8=_0x5a9826[_0x36c2f6][_0x2e57('0x52')]({'plain':!![]});_0x5900e6['push'](db[_0x2e57('0x53')]['query'](_0x244dd2(_0x34eff8,_0x2e57('0x5c')))[_0x2e57('0x51')](function(){})[_0x2e57('0x56')](_0x5f59f5()));}}return _0x5900e6;})[_0x2e57('0x58')]();})['catch'](function(_0x1e551a){logger[_0x2e57('0x19')]('cmContact,\x20%s,\x20%s',_0x2e57('0x5e'),_0x1e551a[_0x2e57('0x1d')]);});}var processPromises=function(_0x46b918){return BPromise[_0x2e57('0x58')](promises)['then'](function(_0x4335cb){})[_0x2e57('0x56')](function(_0x3ee73f){logger[_0x2e57('0x19')](_0x2e57('0x5f'),JSON[_0x2e57('0x32')](_0x3ee73f));})[_0x2e57('0x60')](function(){socket[_0x2e57('0x61')](_0x2e57('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x46b918){return _0x46b918[_0x2e57('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x2e57('0x51')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x2e57('0x61')](_0x2e57('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2e57('0x64')](FILEPATH);}catch(_0x55153e){logger[_0x2e57('0x19')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x2e57('0x32')](_0x55153e));}finally{process[_0x2e57('0x65')](0x0);}});};process['on']('SIGINT',function(){logger[_0x2e57('0x66')](_0x2e57('0x67'));endCsv();});function main(){return BPromise[_0x2e57('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x2e57('0x2c')][_0x2e57('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2e57('0x51')](function(_0x518539){var _0xaeba67=fs[_0x2e57('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2e57('0x6a')](_0xaeba67,{'header':!![],'skipEmptyLines':!![],'step':function(_0x45ce61,_0x5cc7cc){total+=0x1;var _0x2bb7ba=total;promises[_0x2e57('0x2f')](checkRow(_0x45ce61,_0x518539,_0x2bb7ba)[_0x2e57('0x51')](function(){success+=0x1;})[_0x2e57('0x56')](function(_0x55e395){if(_0x55e395[_0x2e57('0x19')]){errors+=0x1;delete _0x55e395[_0x2e57('0x19')];}else if(_0x55e395[_0x2e57('0x2a')]){duplicates+=0x1;delete _0x55e395[_0x2e57('0x2a')];}rows['push'](_0x55e395);}));if(total%0xc8===0x0){_0x5cc7cc[_0x2e57('0x6b')]();return processPromises(_0x5cc7cc);}},'complete':function(){return processPromises()[_0x2e57('0x51')](function(){logger[_0x2e57('0x66')](_0x2e57('0x6c'));endCsv();});},'error':function(_0x36bf06,_0x2f44fa){logger['info'](_0x2e57('0x6d'),JSON[_0x2e57('0x32')](_0x36bf06));endCsv();}});})['catch'](function(_0x26ed20){logger['error'](_0x2e57('0x6e'),JSON[_0x2e57('0x32')](_0x26ed20));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d4e87f0..e40da09 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 _0xf2f9=['cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','into','fields','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','error','exit','push','code','message','sequelize','query','spread','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','createReadStream','data','length','rows','errors','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','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','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','catch','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone'];(function(_0x3bf991,_0x1073fe){var _0x4ef446=function(_0x59417c){while(--_0x59417c){_0x3bf991['push'](_0x3bf991['shift']());}};_0x4ef446(++_0x1073fe);}(_0xf2f9,0xec));var _0x9f2f=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0xf2f9[_0x2a3c4d];return _0x55c390;};'use strict';var fs=require('fs');var path=require(_0x9f2f('0x0'));var _=require('lodash');var Papa=require(_0x9f2f('0x1'));var util=require(_0x9f2f('0x2'));var BPromise=require(_0x9f2f('0x3'));var moment=require(_0x9f2f('0x4'));var squel=require(_0x9f2f('0x5'));var Redis=require(_0x9f2f('0x6'));var db=require(_0x9f2f('0x7'))['db'];var config=require(_0x9f2f('0x8'));var logger=require(_0x9f2f('0x9'))(_0x9f2f('0xa'));config[_0x9f2f('0xb')]=_['defaults'](config[_0x9f2f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f2f('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9f2f('0xc')](_0x9f2f('0xd'));function isEmail(_0x75e35d){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))*$/[_0x9f2f('0xe')](_0x75e35d);}function selectNotIn(_0x152e97,_0x2db314,_0x45b43f,_0x3c5e77,_0x25c86e){return squel[_0x9f2f('0xf')]()[_0x9f2f('0x10')]('phone')['from'](_0x3c5e77)[_0x9f2f('0x11')](_0x2db314,null,_0x2db314+_0x9f2f('0x12')+_0x3c5e77+'.'+_0x45b43f)['where'](_0x3c5e77+'.'+_0x45b43f+_0x9f2f('0x13')+_0x152e97+'.'+_0x45b43f)['where'](_0x2db314+_0x9f2f('0x14')+_0x25c86e[_0x9f2f('0x11')]()+')');}function insertCmHopper(_0x512dbd,_0x484ab1,_0x550513,_0x4846fd,_0x187344){var _0x22294a=[_0x9f2f('0x15'),_0x9f2f('0x16'),_0x9f2f('0x17'),_0x9f2f('0x18'),_0x484ab1+'.'+_0x4846fd,'cm_contacts.createdAt',_0x9f2f('0x19'),_0x9f2f('0x1a'),_0x9f2f('0x1b'),'\x22'+_0x187344+'\x22'];return squel[_0x9f2f('0x1c')]()['into'](_0x9f2f('0x1d'))[_0x9f2f('0x1e')]([_0x9f2f('0x1f'),_0x9f2f('0x20'),_0x9f2f('0x21'),_0x9f2f('0x22'),_0x4846fd,_0x9f2f('0x23'),_0x9f2f('0x24'),_0x9f2f('0x25'),'UserId',_0x9f2f('0x26')],squel['select']()['fields'](_0x22294a)[_0x9f2f('0x27')](_0x484ab1)['join'](_0x9f2f('0x28'),null,_0x9f2f('0x29')+_0x484ab1+_0x9f2f('0x2a'))[_0x9f2f('0x11')](_0x550513,null,_0x550513+'.id\x20=\x20'+_0x484ab1+'.'+_0x4846fd)['where'](_0x484ab1+_0x9f2f('0x2b'),_0x512dbd)[_0x9f2f('0x2c')](_0x9f2f('0x2d'),NOW)['where'](_0x9f2f('0x2e'),selectNotIn(_0x484ab1,_0x550513,_0x4846fd,_0x9f2f('0x1d'),[_0x9f2f('0x2f'),_0x9f2f('0x30')]))[_0x9f2f('0x2c')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x484ab1,_0x550513,_0x4846fd,_0x9f2f('0x1d'),['\x22always\x22'])))[_0x9f2f('0x31')]();}function insertCmHopperBlack(_0x374b1a,_0x49fede,_0x2001b9,_0x4dcaa9){var _0x5d43c7=['cm_contacts.phone','cm_contacts.id',_0x9f2f('0x18'),_0x49fede+'.'+_0x4dcaa9,_0x9f2f('0x32'),_0x9f2f('0x19')];return squel[_0x9f2f('0x1c')]()['into'](_0x9f2f('0x33'))['fromQuery']([_0x9f2f('0x1f'),_0x9f2f('0x21'),_0x9f2f('0x22'),_0x4dcaa9,_0x9f2f('0x23'),'updatedAt'],squel[_0x9f2f('0xf')]()['fields'](_0x5d43c7)[_0x9f2f('0x27')](_0x49fede)[_0x9f2f('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x49fede+_0x9f2f('0x2a'))['join'](_0x2001b9,null,_0x2001b9+_0x9f2f('0x12')+_0x49fede+'.'+_0x4dcaa9)[_0x9f2f('0x2c')](_0x49fede+_0x9f2f('0x2b'),_0x374b1a)[_0x9f2f('0x2c')](_0x9f2f('0x2d'),NOW)['where'](_0x9f2f('0x2e'),squel[_0x9f2f('0xf')]()['field'](_0x9f2f('0x1f'))[_0x9f2f('0x27')](_0x9f2f('0x33'))[_0x9f2f('0x2c')](_0x9f2f('0x34'),_0x374b1a)['where'](_0x4dcaa9+_0x9f2f('0x35'),_0x49fede+'.'+_0x4dcaa9)))[_0x9f2f('0x31')]();}function insertCmContact(_0xfdb8a,_0x22bed6,_0x2dd750,_0x260942){var _0xfab96f=_[_0x9f2f('0x36')](_[_0x9f2f('0x37')](_0x260942),[_0x9f2f('0x22'),_0x9f2f('0x38'),_0x9f2f('0x23'),_0x9f2f('0x24')]);return squel['insert']()[_0x9f2f('0x39')](_0x9f2f('0x28'))[_0x9f2f('0x1e')](_0xfab96f,squel[_0x9f2f('0xf')]()[_0x9f2f('0x3a')](_0xfab96f)[_0x9f2f('0x27')](_0x22bed6)[_0x9f2f('0x2c')]('('+_0x2dd750[_0x9f2f('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x9f2f('0xf')]()[_0x9f2f('0x3a')](_0x2dd750)[_0x9f2f('0x27')](_0x9f2f('0x28'))[_0x9f2f('0x2c')](_0x9f2f('0x34'),_0xfdb8a)['where'](_0x9f2f('0x3b')))[_0x9f2f('0x2c')]('id\x20IN\x20?',squel[_0x9f2f('0xf')]()[_0x9f2f('0x10')](_0x9f2f('0x3c'),_0x9f2f('0x3d'))['from'](_0x22bed6)[_0x9f2f('0x3e')](_0x2dd750[_0x9f2f('0x11')](','))))[_0x9f2f('0x31')]();}function handleStop(){logger[_0x9f2f('0x3f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x57cd1c){logger[_0x9f2f('0x40')](_0x57cd1c['message']);process[_0x9f2f('0x41')](0x1);}function handleError(_0x300925,_0x411ab2){stats['errors'][_0x9f2f('0x42')]({'name':_0x411ab2[_0x9f2f('0x43')],'message':_0x411ab2[_0x9f2f('0x44')],'row':_0x300925});}function handleQuery(_0x375814){logger['info'](_0x375814);return db[_0x9f2f('0x45')][_0x9f2f('0x46')](_0x375814)[_0x9f2f('0x47')](function(_0x754bd0){results[_0x9f2f('0x42')](_0x754bd0);})['catch'](function(_0x546ae4){logger['error'](_0x546ae4[_0x9f2f('0x44')]);});}function main(_0x4e9613,_0x3c0668,_0x1a3b0c,_0x2950a9){logger['info']('main',_0x4e9613,JSON[_0x9f2f('0x48')](_0x3c0668));process['send']('start');var _0x279a6a=_0x3c0668[_0x9f2f('0x49')];var _0x28fb0e=_0x3c0668[_0x9f2f('0x4a')];var _0x2dbbb8=path[_0x9f2f('0x11')](config[_0x9f2f('0x4b')],_0x9f2f('0x4c'),_0x28fb0e+_0x9f2f('0x4d'));var _0xc4f536=_[_0x9f2f('0x37')](_0x279a6a)[_0x9f2f('0x11')]();logger[_0x9f2f('0x3f')]('header',_0xc4f536);fs['writeFileSync'](_0x2dbbb8,_0xc4f536+'\x0a');Papa['parse'](fs[_0x9f2f('0x4e')](_0x4e9613),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5b4580,_0x48e8a0){try{for(var _0x5e3010=0x0,_0x3efb69=[];_0x5e3010<_0x5b4580[_0x9f2f('0x4f')][_0x9f2f('0x50')];_0x5e3010++){stats[_0x9f2f('0x51')]+=0x1;if(_0x5b4580[_0x9f2f('0x52')][_0x5e3010]){handleError(_0x5b4580[_0x9f2f('0x4f')][_0x5e3010],_0x5b4580['errors'][_0x5e3010]);}else{var _0xc01b58=[];for(var _0x5c35ce in _0x279a6a){if(_0x279a6a[_0x9f2f('0x53')](_0x5c35ce)){if(_0x5b4580['data'][_0x5e3010][_0x279a6a[_0x5c35ce]]){var _0x55e0a2=_[_0x9f2f('0x54')](_0x5b4580[_0x9f2f('0x4f')][_0x5e3010][_0x279a6a[_0x5c35ce]][_0x9f2f('0x55')](/"/g,'\x27'));switch(_0x5c35ce){case _0x9f2f('0x20'):var _0x1e3caa=moment(_0x55e0a2,_0x9f2f('0xd'),!![]);if(_0x1e3caa['isValid']()){_0x3efb69[_0x9f2f('0x42')]('\x22'+_0x55e0a2+'\x22');}else{_0xc01b58[_0x9f2f('0x42')](_0x9f2f('0x56'));}break;case _0x9f2f('0x25'):var _0x31175c=parseInt(_0x55e0a2);_0x55e0a2=_[_0x9f2f('0x57')](_0x31175c)||_0x31175c<0x0||_0x31175c>0x4?_0x2950a9?0x3:0x2:_0x31175c;_0x3efb69[_0x9f2f('0x42')]('\x22'+_0x55e0a2+'\x22');break;case _0x9f2f('0x58'):var _0x384e68=parseInt(_0x55e0a2);if(_['isNumber'](_0x384e68)&&_[_0x9f2f('0x59')](_0x1a3b0c,_0x384e68)){_0x3efb69['push']('\x22'+_0x384e68+'\x22');}else{_0xc01b58['push'](_0x9f2f('0x5a'));}break;case _0x9f2f('0x5b'):if(isEmail(_0x55e0a2)){_0x3efb69['push']('\x22'+_0x55e0a2+'\x22');}else{_0xc01b58[_0x9f2f('0x42')](_0x9f2f('0x5c'));}break;case'dateOfBirth':var _0xc5584=moment(_0x55e0a2,_0x9f2f('0x5d'),!![]);if(_0xc5584[_0x9f2f('0x5e')]()){_0x3efb69[_0x9f2f('0x42')]('\x22'+_0x55e0a2+'\x22');}else{_0xc01b58[_0x9f2f('0x42')](_0x9f2f('0x5f'));}break;default:_0x3efb69[_0x9f2f('0x42')]('\x22'+_0x55e0a2+'\x22');}}else{switch(_0x5c35ce){case'firstName':case _0x9f2f('0x1f'):_0xc01b58[_0x9f2f('0x42')](_0x5c35ce+_0x9f2f('0x60'));break;default:_0x3efb69[_0x9f2f('0x42')]('\x22\x22');}}}}if(_0xc01b58[_0x9f2f('0x50')]){handleError(_0x5b4580[_0x9f2f('0x4f')][_0x5e3010],{'code':_0x9f2f('0x61'),'message':_0xc01b58['join']()});}else{fs[_0x9f2f('0x62')](_0x2dbbb8,_0x3efb69[_0x9f2f('0x11')]()+'\x0a');}_0x3efb69=[];}if(!(stats[_0x9f2f('0x51')]%0xc8)){socket['emit'](_0x9f2f('0x63')+_0x28fb0e,stats);stats[_0x9f2f('0x52')]=[];}}if(stopped){logger[_0x9f2f('0x3f')]('Abort\x20parser');_0x48e8a0['abort']();}}catch(_0x3df343){handleError(_0x5b4580[_0x9f2f('0x4f')][_0x5e3010],{'code':_0x9f2f('0x64'),'message':_0x3df343[_0x9f2f('0x44')]});logger['error'](_0x9f2f('0x65'),_0x3df343['message']);}},'complete':function(){try{var _0x50d89b=[];var _0x275c02=_0x9f2f('0x28');if(_0x3c0668[_0x9f2f('0x66')]&&_0x3c0668[_0x9f2f('0x66')][_0x9f2f('0x50')]){_0x275c02=_0x9f2f('0x67')+_0x28fb0e;_0x50d89b['push']('CREATE\x20TABLE\x20'+_0x275c02+_0x9f2f('0x68'));}var _0x5161fc=util[_0x9f2f('0xc')](_0x9f2f('0x69'),_0x2dbbb8,_0x275c02,_0xc4f536,_0x3c0668['ListId'],_0x3c0668[_0x9f2f('0x38')]||null,NOW,NOW);if(_['isNil'](_0x279a6a['scheduledat'])){_0x5161fc+=',\x20scheduledAt\x20=\x20NOW()';}_0x50d89b['push'](_0x5161fc);if(_0x3c0668[_0x9f2f('0x66')]&&_0x3c0668[_0x9f2f('0x66')][_0x9f2f('0x50')]){_0x50d89b[_0x9f2f('0x42')](insertCmContact(_0x3c0668[_0x9f2f('0x22')],_0x275c02,_0x3c0668[_0x9f2f('0x66')],_0x279a6a));_0x50d89b[_0x9f2f('0x42')]('DROP\x20TABLE\x20'+_0x275c02+';');}_0x50d89b['push'](insertCmHopper(_0x3c0668['ListId'],_0x9f2f('0x6a'),_0x9f2f('0x6b'),_0x9f2f('0x6c'),_0x2950a9));_0x50d89b[_0x9f2f('0x42')](insertCmHopperBlack(_0x3c0668[_0x9f2f('0x22')],_0x9f2f('0x6d'),_0x9f2f('0x6b'),_0x9f2f('0x6c')));_0x50d89b['push'](insertCmHopper(_0x3c0668[_0x9f2f('0x22')],_0x9f2f('0x6e'),_0x9f2f('0x6f'),_0x9f2f('0x70'),_0x2950a9));_0x50d89b[_0x9f2f('0x42')](insertCmHopperBlack(_0x3c0668['ListId'],_0x9f2f('0x71'),_0x9f2f('0x6f'),'CampaignId'));BPromise[_0x9f2f('0x72')](_0x50d89b,handleQuery)[_0x9f2f('0x73')](function(_0x5d901a){stats['finish']=!![];stats[_0x9f2f('0x74')]=_0x3c0668[_0x9f2f('0x66')]&&_0x3c0668['duplicates'][_0x9f2f('0x50')]?results[0x2][_0x9f2f('0x74')]:results[0x0][_0x9f2f('0x74')];socket['emit'](_0x9f2f('0x63')+_0x28fb0e,stats);fs[_0x9f2f('0x75')](_0x4e9613);fs['unlink'](_0x2dbbb8);process[_0x9f2f('0x41')](0x0);})[_0x9f2f('0x76')](function(_0x498955){logger[_0x9f2f('0x40')](_0x498955[_0x9f2f('0x44')]);process['exit'](0x1);});}catch(_0x205302){logger['error']('complete',_0x205302[_0x9f2f('0x44')]);process['exit'](0x1);}},'error':function(_0x2dab7a,_0x5a2d60,_0x3a31cf,_0x15f729){throw new Error(_0x15f729);}});}function validate(){if(process[_0x9f2f('0x77')]&&process['argv'][_0x9f2f('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0xd64ec1=path[_0x9f2f('0x11')](config[_0x9f2f('0x4b')],_0x9f2f('0x4c'),process[_0x9f2f('0x77')][0x2]);if(!fs[_0x9f2f('0x78')](_0xd64ec1)){throw new Error(_0x9f2f('0x79'));}var _0x4e8c5a={};try{_0x4e8c5a=JSON[_0x9f2f('0x7a')](process['argv'][0x3]);if(!_0x4e8c5a[_0x9f2f('0x49')]){throw new Error(_0x9f2f('0x7b'));}if(!_0x4e8c5a[_0x9f2f('0x49')][_0x9f2f('0x1f')]){throw new Error(_0x9f2f('0x7c'));}if(!_0x4e8c5a[_0x9f2f('0x49')][_0x9f2f('0x7d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x1fdcac=0x0;if(_0x4e8c5a[_0x9f2f('0x49')]['UserId']){_0x1fdcac=0x1;}if(!_0x4e8c5a[_0x9f2f('0x22')]){throw new Error(_0x9f2f('0x7e'));}}catch(_0x5e771d){throw new Error('body\x20id\x20mandatory');}var _0x5b7479=[];try{_0x5b7479=_['map'](JSON[_0x9f2f('0x7a')](process[_0x9f2f('0x77')][0x4]),'id');}catch(_0x3cb5c0){logger['info'](_0x9f2f('0x7f'));}main(_0xd64ec1,_0x4e8c5a,_0x5b7479,_0x1fdcac);}validate();process['on']('SIGINT',handleStop);process['on'](_0x9f2f('0x80'),handleUncaughtException); \ No newline at end of file +var _0xa14a=['each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','uncaughtException','path','lodash','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_contacts.updatedAt','cm_hopper_black','ContactId','select','cm_contacts','.id\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId','updatedAt','id\x20IN\x20?','group','info','error','message','exit','errors','code','sequelize','query','spread','push','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','data','length','rows','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists'];(function(_0x1e7cc0,_0x30d32a){var _0x5d08b4=function(_0x4808ec){while(--_0x4808ec){_0x1e7cc0['push'](_0x1e7cc0['shift']());}};_0x5d08b4(++_0x30d32a);}(_0xa14a,0x1a9));var _0xaa14=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa14a[_0x13ea00];return _0x1f7347;};'use strict';var fs=require('fs');var path=require(_0xaa14('0x0'));var _=require(_0xaa14('0x1'));var Papa=require('papaparse');var util=require(_0xaa14('0x2'));var BPromise=require('bluebird');var moment=require(_0xaa14('0x3'));var squel=require(_0xaa14('0x4'));var Redis=require('ioredis');var db=require(_0xaa14('0x5'))['db'];var config=require(_0xaa14('0x6'));var logger=require(_0xaa14('0x7'))('import');config[_0xaa14('0x8')]=_[_0xaa14('0x9')](config[_0xaa14('0x8')],{'host':_0xaa14('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xaa14('0xb')](_0xaa14('0xc'));function isEmail(_0x13925b){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))*$/[_0xaa14('0xd')](_0x13925b);}function selectNotIn(_0x58ef35,_0x14a234,_0x390332,_0x4685e6,_0x4549a6){return squel['select']()[_0xaa14('0xe')](_0xaa14('0xf'))[_0xaa14('0x10')](_0x4685e6)[_0xaa14('0x11')](_0x14a234,null,_0x14a234+'.id\x20=\x20'+_0x4685e6+'.'+_0x390332)[_0xaa14('0x12')](_0x4685e6+'.'+_0x390332+_0xaa14('0x13')+_0x58ef35+'.'+_0x390332)[_0xaa14('0x12')](_0x14a234+_0xaa14('0x14')+_0x4549a6[_0xaa14('0x11')]()+')');}function insertCmHopper(_0x3c3ad4,_0xc9f852,_0xb31612,_0x5b5849,_0x3f9d3d){var _0x4d0698=[_0xaa14('0x15'),_0xaa14('0x16'),'cm_contacts.id',_0xaa14('0x17'),_0xc9f852+'.'+_0x5b5849,_0xaa14('0x18'),'cm_contacts.updatedAt',_0xaa14('0x19'),_0xaa14('0x1a'),'\x22'+_0x3f9d3d+'\x22'];return squel[_0xaa14('0x1b')]()[_0xaa14('0x1c')](_0xaa14('0x1d'))[_0xaa14('0x1e')]([_0xaa14('0xf'),_0xaa14('0x1f'),'ContactId',_0xaa14('0x20'),_0x5b5849,_0xaa14('0x21'),'updatedAt',_0xaa14('0x22'),'UserId',_0xaa14('0x23')],squel['select']()[_0xaa14('0x24')](_0x4d0698)[_0xaa14('0x10')](_0xc9f852)[_0xaa14('0x11')]('cm_contacts',null,_0xaa14('0x25')+_0xc9f852+'.CmListId')['join'](_0xb31612,null,_0xb31612+'.id\x20=\x20'+_0xc9f852+'.'+_0x5b5849)[_0xaa14('0x12')](_0xc9f852+_0xaa14('0x26'),_0x3c3ad4)[_0xaa14('0x12')](_0xaa14('0x27'),NOW)[_0xaa14('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xc9f852,_0xb31612,_0x5b5849,_0xaa14('0x1d'),[_0xaa14('0x28'),_0xaa14('0x29')]))[_0xaa14('0x12')](_0xaa14('0x2a'),selectNotIn(_0xc9f852,_0xb31612,_0x5b5849,'cm_hopper',[_0xaa14('0x28')])))[_0xaa14('0x2b')]();}function insertCmHopperBlack(_0x4f0a9c,_0x110f79,_0x622a0c,_0x2b2aea){var _0x5d27a9=['cm_contacts.phone',_0xaa14('0x2c'),_0xaa14('0x17'),_0x110f79+'.'+_0x2b2aea,_0xaa14('0x18'),_0xaa14('0x2d')];return squel[_0xaa14('0x1b')]()['into'](_0xaa14('0x2e'))[_0xaa14('0x1e')](['phone',_0xaa14('0x2f'),_0xaa14('0x20'),_0x2b2aea,'createdAt','updatedAt'],squel[_0xaa14('0x30')]()['fields'](_0x5d27a9)[_0xaa14('0x10')](_0x110f79)[_0xaa14('0x11')](_0xaa14('0x31'),null,_0xaa14('0x25')+_0x110f79+'.CmListId')[_0xaa14('0x11')](_0x622a0c,null,_0x622a0c+_0xaa14('0x32')+_0x110f79+'.'+_0x2b2aea)['where'](_0x110f79+_0xaa14('0x26'),_0x4f0a9c)[_0xaa14('0x12')](_0xaa14('0x27'),NOW)['where'](_0xaa14('0x2a'),squel[_0xaa14('0x30')]()['field']('phone')[_0xaa14('0x10')]('cm_hopper_black')[_0xaa14('0x12')](_0xaa14('0x33'),_0x4f0a9c)[_0xaa14('0x12')](_0x2b2aea+_0xaa14('0x34'),_0x110f79+'.'+_0x2b2aea)))[_0xaa14('0x2b')]();}function insertCmContact(_0x40c4ae,_0x27fdbd,_0x4af404,_0x4540ca){var _0x4958d6=_[_0xaa14('0x35')](_['keys'](_0x4540ca),['ListId',_0xaa14('0x36'),_0xaa14('0x21'),_0xaa14('0x37')]);return squel[_0xaa14('0x1b')]()[_0xaa14('0x1c')]('cm_contacts')['fromQuery'](_0x4958d6,squel[_0xaa14('0x30')]()['fields'](_0x4958d6)[_0xaa14('0x10')](_0x27fdbd)[_0xaa14('0x12')]('('+_0x4af404['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xaa14('0x30')]()[_0xaa14('0x24')](_0x4af404)[_0xaa14('0x10')](_0xaa14('0x31'))[_0xaa14('0x12')]('ListId\x20=\x20?',_0x40c4ae)[_0xaa14('0x12')]('deletedAt\x20IS\x20NULL'))[_0xaa14('0x12')](_0xaa14('0x38'),squel[_0xaa14('0x30')]()[_0xaa14('0xe')]('MIN(id)','min_id')['from'](_0x27fdbd)[_0xaa14('0x39')](_0x4af404[_0xaa14('0x11')](','))))[_0xaa14('0x2b')]();}function handleStop(){logger[_0xaa14('0x3a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4b0b7d){logger[_0xaa14('0x3b')](_0x4b0b7d[_0xaa14('0x3c')]);process[_0xaa14('0x3d')](0x1);}function handleError(_0x9f856a,_0x493587){stats[_0xaa14('0x3e')]['push']({'name':_0x493587[_0xaa14('0x3f')],'message':_0x493587['message'],'row':_0x9f856a});}function handleQuery(_0x567143){logger[_0xaa14('0x3a')](_0x567143);return db[_0xaa14('0x40')][_0xaa14('0x41')](_0x567143)[_0xaa14('0x42')](function(_0x331a36){results[_0xaa14('0x43')](_0x331a36);})[_0xaa14('0x44')](function(_0x27ed08){logger[_0xaa14('0x3b')](_0x27ed08[_0xaa14('0x3c')]);});}function main(_0x105b46,_0x49c7bc,_0x416dc9,_0x4d32ab){logger[_0xaa14('0x3a')](_0xaa14('0x45'),_0x105b46,JSON[_0xaa14('0x46')](_0x49c7bc));process[_0xaa14('0x47')](_0xaa14('0x48'));var _0x17c08d=_0x49c7bc[_0xaa14('0x49')];var _0x3c4198=_0x49c7bc[_0xaa14('0x4a')];var _0x379a38=path[_0xaa14('0x11')](config['root'],_0xaa14('0x4b'),_0x3c4198+_0xaa14('0x4c'));var _0x4adc77=_[_0xaa14('0x4d')](_0x17c08d)[_0xaa14('0x11')]();logger['info'](_0xaa14('0x4e'),_0x4adc77);fs[_0xaa14('0x4f')](_0x379a38,_0x4adc77+'\x0a');Papa[_0xaa14('0x50')](fs[_0xaa14('0x51')](_0x105b46),{'header':!![],'skipEmptyLines':!![],'step':function(_0x45187e,_0x2dcae6){try{for(var _0x394177=0x0,_0x1f4f6f=[];_0x394177<_0x45187e[_0xaa14('0x52')][_0xaa14('0x53')];_0x394177++){stats[_0xaa14('0x54')]+=0x1;if(_0x45187e[_0xaa14('0x3e')][_0x394177]){handleError(_0x45187e['data'][_0x394177],_0x45187e[_0xaa14('0x3e')][_0x394177]);}else{var _0x28d6=[];for(var _0x81c93e in _0x17c08d){if(_0x17c08d['hasOwnProperty'](_0x81c93e)){if(_0x45187e[_0xaa14('0x52')][_0x394177][_0x17c08d[_0x81c93e]]){var _0x38894a=_[_0xaa14('0x55')](_0x45187e[_0xaa14('0x52')][_0x394177][_0x17c08d[_0x81c93e]]['replace'](/"/g,'\x27'));switch(_0x81c93e){case _0xaa14('0x1f'):var _0x23202b=moment(_0x38894a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x23202b[_0xaa14('0x56')]()){_0x1f4f6f['push']('\x22'+_0x38894a+'\x22');}else{_0x28d6['push'](_0xaa14('0x57'));}break;case _0xaa14('0x22'):var _0x1e4a96=parseInt(_0x38894a);_0x38894a=_[_0xaa14('0x58')](_0x1e4a96)||_0x1e4a96<0x0||_0x1e4a96>0x4?_0x4d32ab?0x3:0x2:_0x1e4a96;_0x1f4f6f['push']('\x22'+_0x38894a+'\x22');break;case _0xaa14('0x59'):var _0x1e0b09=parseInt(_0x38894a);if(_[_0xaa14('0x5a')](_0x1e0b09)&&_[_0xaa14('0x5b')](_0x416dc9,_0x1e0b09)){_0x1f4f6f[_0xaa14('0x43')]('\x22'+_0x1e0b09+'\x22');}else{_0x28d6[_0xaa14('0x43')](_0xaa14('0x5c'));}break;case _0xaa14('0x5d'):if(isEmail(_0x38894a)){_0x1f4f6f['push']('\x22'+_0x38894a+'\x22');}else{_0x28d6[_0xaa14('0x43')](_0xaa14('0x5e'));}break;case'dateOfBirth':var _0x476246=moment(_0x38894a,'YYYY-MM-DD',!![]);if(_0x476246['isValid']()){_0x1f4f6f['push']('\x22'+_0x38894a+'\x22');}else{_0x28d6[_0xaa14('0x43')](_0xaa14('0x5f'));}break;default:_0x1f4f6f['push']('\x22'+_0x38894a+'\x22');}}else{switch(_0x81c93e){case _0xaa14('0x60'):case _0xaa14('0xf'):_0x28d6[_0xaa14('0x43')](_0x81c93e+_0xaa14('0x61'));break;default:_0x1f4f6f[_0xaa14('0x43')]('\x22\x22');}}}}if(_0x28d6['length']){handleError(_0x45187e['data'][_0x394177],{'code':'SystemRow','message':_0x28d6[_0xaa14('0x11')]()});}else{fs[_0xaa14('0x62')](_0x379a38,_0x1f4f6f[_0xaa14('0x11')]()+'\x0a');}_0x1f4f6f=[];}if(!(stats[_0xaa14('0x54')]%0xc8)){socket[_0xaa14('0x63')](_0xaa14('0x64')+_0x3c4198,stats);stats[_0xaa14('0x3e')]=[];}}if(stopped){logger['info'](_0xaa14('0x65'));_0x2dcae6[_0xaa14('0x66')]();}}catch(_0x312c41){handleError(_0x45187e[_0xaa14('0x52')][_0x394177],{'code':_0xaa14('0x67'),'message':_0x312c41['message']});logger[_0xaa14('0x3b')](_0xaa14('0x68'),_0x312c41[_0xaa14('0x3c')]);}},'complete':function(){try{var _0x3e9ec4=[];var _0x25a400=_0xaa14('0x31');if(_0x49c7bc[_0xaa14('0x69')]&&_0x49c7bc['duplicates'][_0xaa14('0x53')]){_0x25a400='cm_contacts_'+_0x3c4198;_0x3e9ec4['push'](_0xaa14('0x6a')+_0x25a400+'\x20LIKE\x20cm_contacts;');}var _0x5abdbf=util[_0xaa14('0xb')](_0xaa14('0x6b'),_0x379a38,_0x25a400,_0x4adc77,_0x49c7bc[_0xaa14('0x20')],_0x49c7bc['CompanyId']||null,NOW,NOW);if(_[_0xaa14('0x6c')](_0x17c08d[_0xaa14('0x1f')])){_0x5abdbf+=_0xaa14('0x6d');}_0x3e9ec4[_0xaa14('0x43')](_0x5abdbf);if(_0x49c7bc['duplicates']&&_0x49c7bc['duplicates'][_0xaa14('0x53')]){_0x3e9ec4[_0xaa14('0x43')](insertCmContact(_0x49c7bc[_0xaa14('0x20')],_0x25a400,_0x49c7bc[_0xaa14('0x69')],_0x17c08d));_0x3e9ec4['push'](_0xaa14('0x6e')+_0x25a400+';');}_0x3e9ec4[_0xaa14('0x43')](insertCmHopper(_0x49c7bc[_0xaa14('0x20')],_0xaa14('0x6f'),_0xaa14('0x70'),_0xaa14('0x71'),_0x4d32ab));_0x3e9ec4[_0xaa14('0x43')](insertCmHopperBlack(_0x49c7bc['ListId'],_0xaa14('0x72'),_0xaa14('0x70'),_0xaa14('0x71')));_0x3e9ec4[_0xaa14('0x43')](insertCmHopper(_0x49c7bc[_0xaa14('0x20')],_0xaa14('0x73'),_0xaa14('0x74'),_0xaa14('0x75'),_0x4d32ab));_0x3e9ec4[_0xaa14('0x43')](insertCmHopperBlack(_0x49c7bc[_0xaa14('0x20')],_0xaa14('0x76'),'campaigns',_0xaa14('0x75')));BPromise[_0xaa14('0x77')](_0x3e9ec4,handleQuery)[_0xaa14('0x78')](function(_0x255e48){stats[_0xaa14('0x79')]=!![];stats[_0xaa14('0x7a')]=_0x49c7bc[_0xaa14('0x69')]&&_0x49c7bc[_0xaa14('0x69')][_0xaa14('0x53')]?results[0x2][_0xaa14('0x7a')]:results[0x0]['affectedRows'];socket[_0xaa14('0x63')](_0xaa14('0x64')+_0x3c4198,stats);fs[_0xaa14('0x7b')](_0x105b46);fs[_0xaa14('0x7b')](_0x379a38);process['exit'](0x0);})['catch'](function(_0x285b93){logger['error'](_0x285b93[_0xaa14('0x3c')]);process['exit'](0x1);});}catch(_0x425992){logger[_0xaa14('0x3b')](_0xaa14('0x7c'),_0x425992[_0xaa14('0x3c')]);process[_0xaa14('0x3d')](0x1);}},'error':function(_0x1608fb,_0x42f9be,_0x1e26b0,_0x2a5470){throw new Error(_0x2a5470);}});}function validate(){if(process[_0xaa14('0x7d')]&&process[_0xaa14('0x7d')][_0xaa14('0x53')]<0x4){throw new Error(_0xaa14('0x7e'));}var _0x122ec9=path[_0xaa14('0x11')](config[_0xaa14('0x7f')],_0xaa14('0x4b'),process[_0xaa14('0x7d')][0x2]);if(!fs[_0xaa14('0x80')](_0x122ec9)){throw new Error(_0xaa14('0x81'));}var _0x109de4={};try{_0x109de4=JSON[_0xaa14('0x50')](process[_0xaa14('0x7d')][0x3]);if(!_0x109de4[_0xaa14('0x49')]){throw new Error(_0xaa14('0x82'));}if(!_0x109de4[_0xaa14('0x49')][_0xaa14('0xf')]){throw new Error(_0xaa14('0x83'));}if(!_0x109de4['binding'][_0xaa14('0x60')]){throw new Error(_0xaa14('0x84'));}var _0x589468=0x0;if(_0x109de4[_0xaa14('0x49')][_0xaa14('0x59')]){_0x589468=0x1;}if(!_0x109de4[_0xaa14('0x20')]){throw new Error(_0xaa14('0x85'));}}catch(_0x1f1e79){throw new Error('body\x20id\x20mandatory');}var _0x11f817=[];try{_0x11f817=_[_0xaa14('0x86')](JSON[_0xaa14('0x50')](process[_0xaa14('0x7d')][0x4]),'id');}catch(_0x4e4f4f){logger[_0xaa14('0x3a')]('No\x20agent\x20available');}main(_0x122ec9,_0x109de4,_0x11f817,_0x589468);}validate();process['on']('SIGINT',handleStop);process['on'](_0xaa14('0x87'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 1f974f9..93004e1 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 _0x69b7=['Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime'];(function(_0x3a3ff1,_0x5eee91){var _0x427d8e=function(_0x7dd9d4){while(--_0x7dd9d4){_0x3a3ff1['push'](_0x3a3ff1['shift']());}};_0x427d8e(++_0x5eee91);}(_0x69b7,0xd2));var _0x769b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x69b7[_0x502c7d];return _0x30b7ed;};'use strict';exports[_0x769b('0x0')]=function(_0x27b940,_0x28435a){var _0x3ab21c=[{'type':'string','content':_0x769b('0x1'),'variableName':null}];switch(_0x27b940[_0x769b('0x2')]()){case'voice':switch(_0x28435a[_0x769b('0x2')]()){case _0x769b('0x3'):_0x3ab21c[_0x769b('0x4')]({'type':_0x769b('0x5'),'content':'','variableName':_0x769b('0x6')});_0x3ab21c['push']({'type':_0x769b('0x5'),'content':'','variableName':_0x769b('0x7')});break;case _0x769b('0x8'):_0x3ab21c['push']({'type':_0x769b('0x9'),'content':'Outbound\x20Call','variableName':null});_0x3ab21c[_0x769b('0x4')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x3ab21c;};exports[_0x769b('0xa')]=function(_0x1a3573,_0x5f6d68){var _0x208e0e=[];switch(_0x1a3573[_0x769b('0x2')]()){case'voice':switch(_0x5f6d68['toLowerCase']()){case _0x769b('0x3'):_0x208e0e=[{'type':_0x769b('0x9'),'content':_0x769b('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x769b('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x769b('0x7')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0xd'),'keyType':_0x769b('0x5'),'variableName':'calleridname'},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0xe'),'keyType':'variable','variableName':_0x769b('0xf')},{'type':'keyValue','content':'','key':'Queue','keyType':_0x769b('0x5'),'variableName':_0x769b('0x6')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x10'),'keyType':_0x769b('0x5'),'variableName':_0x769b('0x11')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x12'),'keyType':_0x769b('0x5'),'variableName':_0x769b('0x13')},{'type':_0x769b('0x9'),'content':_0x769b('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x15'),'keyType':_0x769b('0x5'),'variableName':'destcalleridname'},{'type':_0x769b('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x769b('0x5'),'variableName':_0x769b('0x16')},{'type':_0x769b('0x9'),'content':_0x769b('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x769b('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x769b('0x5'),'variableName':_0x769b('0x13')},{'type':_0x769b('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x769b('0x5'),'variableName':'agentconnectAt'},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x18'),'keyType':'variable','variableName':_0x769b('0x19')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x1a'),'keyType':_0x769b('0x5'),'variableName':_0x769b('0x1b')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x1c'),'keyType':_0x769b('0x5'),'variableName':_0x769b('0x1d')}];break;case _0x769b('0x8'):_0x208e0e=[{'type':'string','content':_0x769b('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x769b('0x1e'),'keyType':_0x769b('0x5'),'keyContent':'','variableName':_0x769b('0x16')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x1f'),'keyType':'variable','keyContent':'','variableName':_0x769b('0x20')},{'type':'keyValue','content':'','key':_0x769b('0x10'),'keyType':_0x769b('0x5'),'keyContent':'','variableName':_0x769b('0x11')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x12'),'keyType':_0x769b('0x5'),'keyContent':'','variableName':_0x769b('0x21')},{'type':'string','content':_0x769b('0x17')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x22'),'keyType':_0x769b('0x5'),'keyContent':'','variableName':_0x769b('0x23')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x24'),'keyType':_0x769b('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x25'),'keyType':'variable','keyContent':'','variableName':_0x769b('0x26')},{'type':_0x769b('0xc'),'content':'','key':_0x769b('0x27'),'keyType':'variable','keyContent':'','variableName':_0x769b('0x28')}];break;}}return _0x208e0e;}; \ No newline at end of file +var _0x13c0=['toLowerCase','voice','inbound','variable','queue','push','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','outbound','Called\x20Number','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x13c0,0xb5));var _0x013c=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x13c0[_0xd1d19a];return _0x52a79d;};'use strict';exports[_0x013c('0x0')]=function(_0x156d98,_0x1fef28){var _0x298bd9=[{'type':_0x013c('0x1'),'content':_0x013c('0x2'),'variableName':null}];switch(_0x156d98[_0x013c('0x3')]()){case _0x013c('0x4'):switch(_0x1fef28[_0x013c('0x3')]()){case _0x013c('0x5'):_0x298bd9['push']({'type':_0x013c('0x6'),'content':'','variableName':_0x013c('0x7')});_0x298bd9[_0x013c('0x8')]({'type':'variable','content':'','variableName':_0x013c('0x9')});break;case'outbound':_0x298bd9[_0x013c('0x8')]({'type':'string','content':_0x013c('0xa'),'variableName':null});_0x298bd9[_0x013c('0x8')]({'type':_0x013c('0x6'),'content':'','variableName':_0x013c('0xb')});break;}}return _0x298bd9;};exports[_0x013c('0xc')]=function(_0x152d5b,_0x2e792c){var _0x216d8c=[];switch(_0x152d5b['toLowerCase']()){case _0x013c('0x4'):switch(_0x2e792c[_0x013c('0x3')]()){case'inbound':_0x216d8c=[{'type':_0x013c('0x1'),'content':_0x013c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0xf'),'keyType':'variable','variableName':_0x013c('0x9')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x10'),'keyType':'variable','variableName':_0x013c('0x11')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x12'),'keyType':_0x013c('0x6'),'variableName':'destexten'},{'type':_0x013c('0xe'),'content':'','key':'Queue','keyType':'variable','variableName':_0x013c('0x7')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x13'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0x14')},{'type':'keyValue','content':'','key':'Date','keyType':_0x013c('0x6'),'variableName':_0x013c('0x15')},{'type':_0x013c('0x1'),'content':_0x013c('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x17'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0x18')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x19'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0xb')},{'type':_0x013c('0x1'),'content':_0x013c('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x1b'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0x15')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x1c'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0x1d')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x013c('0x6'),'variableName':_0x013c('0x1e')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x1f'),'keyType':_0x013c('0x6'),'variableName':'holdtime'},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x20'),'keyType':_0x013c('0x6'),'variableName':_0x013c('0x21')}];break;case _0x013c('0x22'):_0x216d8c=[{'type':'string','content':_0x013c('0xd'),'variableName':null},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x23'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x013c('0xe'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0x013c('0x24')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x13'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x25'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':_0x013c('0x26')},{'type':'string','content':_0x013c('0x1a')},{'type':'keyValue','content':'','key':_0x013c('0x27'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':_0x013c('0x28')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x29'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x2a'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':_0x013c('0x2b')},{'type':_0x013c('0xe'),'content':'','key':_0x013c('0x2c'),'keyType':_0x013c('0x6'),'keyContent':'','variableName':_0x013c('0x2d')}];break;}}return _0x216d8c;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 9e4c97b..df0e4d2 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 _0x0d31=['role','stringify','Interaction','findOne','update','then','info','catch','error','tracked','query','clone','body','omit','phone','fax','lodash','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d31,0x6d));var _0x10d3=function(_0x4115c6,_0x3cc8be){_0x4115c6=_0x4115c6-0x0;var _0x3c675e=_0x0d31[_0x4115c6];return _0x3c675e;};'use strict';var _=require(_0x10d3('0x0'));var db=require(_0x10d3('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x10d3('0x2')),'mail':require('../../config/logger')(_0x10d3('0x3')),'fax':require(_0x10d3('0x4'))(_0x10d3('0x5')),'sms':require(_0x10d3('0x4'))(_0x10d3('0x6')),'chat':require(_0x10d3('0x4'))(_0x10d3('0x7')),'whatsapp':require(_0x10d3('0x4'))('whatsapp-interactions')};function getInteractionId(_0x1218d2,_0x574eca,_0x5248a8){if(_0x1218d2&&_0x1218d2[_[_0x10d3('0x8')](_0x5248a8)+'InteractionId']){return _0x1218d2[_[_0x10d3('0x8')](_0x5248a8)+_0x10d3('0x9')];}else if(_0x1218d2&&_0x1218d2['id']){return _0x1218d2['id'];}else if(_0x574eca&&_0x574eca['id']){return _0x574eca['id'];}else{return _0x10d3('0xa');}}function log(_0x42dd32,_0x5383cb,_0x6ebeb0,_0x446f83,_0x55d4be,_0x14354a){loggers[_0x55d4be[_0x10d3('0xb')]()][_0x42dd32](_0x10d3('0xc'),_0x14354a[_0x10d3('0xd')](),_0x5383cb?_0x5383cb['id']:null,_0x5383cb?_0x5383cb[_0x10d3('0xe')]:null,_0x5383cb?_0x5383cb[_0x10d3('0xf')]:null,getInteractionId(_0x6ebeb0,_0x446f83,_0x55d4be),_0x6ebeb0?JSON[_0x10d3('0x10')](_0x6ebeb0):'null');}function updateUser(_0x317282,_0x1bc549,_0x6c58d1,_0x548a68,_0x1680c0){db[_['upperFirst'](_0x548a68)+_0x10d3('0x11')][_0x10d3('0x12')]({'where':{'id':getInteractionId(_0x1bc549,_0x6c58d1,_0x548a68)}})['then'](function(_0x1a34cd){if(_0x1a34cd){return _0x1a34cd[_0x10d3('0x13')]({'UserId':_0x317282?_0x317282['id']:null});}})[_0x10d3('0x14')](function(_0x5251c1){if(_0x5251c1){log(_0x10d3('0x15'),_0x317282,_0x1bc549,_0x6c58d1,_0x548a68,_0x1680c0);}})[_0x10d3('0x16')](function(){log(_0x10d3('0x17'),_0x317282,_0x1bc549,_0x6c58d1,_0x548a68,_0x1680c0);});}exports[_0x10d3('0x18')]=function(_0x4e357b,_0x115e19){return function(_0x4ba6bc,_0x14c96e,_0x203ced){var _0x1ee9be=_0x4ba6bc['user'];var _0x5f3984={};var _0x426699=_0x4ba6bc[_0x10d3('0x19')];if(_0x5f3984){_0x5f3984=_[_0x10d3('0x1a')](_0x4ba6bc[_0x10d3('0x1b')]);_0x5f3984=_[_0x10d3('0x1c')](_0x5f3984,['body','html',_0x10d3('0x1d'),_0x10d3('0x1e'),'mobile']);}updateUser(_0x1ee9be,_0x5f3984,_0x426699,_0x4e357b,_0x115e19);_0x203ced(null);};}; \ No newline at end of file +var _0xbee6=['lodash','../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','update','info','error','user','query','clone','body','omit','html','phone','mobile'];(function(_0x4d1373,_0x2df1cc){var _0x46ea3f=function(_0x327678){while(--_0x327678){_0x4d1373['push'](_0x4d1373['shift']());}};_0x46ea3f(++_0x2df1cc);}(_0xbee6,0x87));var _0x6bee=function(_0x485b05,_0x3779f0){_0x485b05=_0x485b05-0x0;var _0x51b9f8=_0xbee6[_0x485b05];return _0x51b9f8;};'use strict';var _=require(_0x6bee('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x6bee('0x1'))(_0x6bee('0x2')),'mail':require(_0x6bee('0x1'))('mail-interactions'),'fax':require(_0x6bee('0x1'))(_0x6bee('0x3')),'sms':require('../../config/logger')('sms-interactions'),'chat':require('../../config/logger')(_0x6bee('0x4')),'whatsapp':require(_0x6bee('0x1'))('whatsapp-interactions')};function getInteractionId(_0x181e6e,_0x10662c,_0x5ec153){if(_0x181e6e&&_0x181e6e[_['upperFirst'](_0x5ec153)+'InteractionId']){return _0x181e6e[_[_0x6bee('0x5')](_0x5ec153)+'InteractionId'];}else if(_0x181e6e&&_0x181e6e['id']){return _0x181e6e['id'];}else if(_0x10662c&&_0x10662c['id']){return _0x10662c['id'];}else{return _0x6bee('0x6');}}function log(_0x450a09,_0x277c29,_0x381cc2,_0x1ceac7,_0x1c03fb,_0x23fb23){loggers[_0x1c03fb[_0x6bee('0x7')]()][_0x450a09](_0x6bee('0x8'),_0x23fb23[_0x6bee('0x9')](),_0x277c29?_0x277c29['id']:null,_0x277c29?_0x277c29[_0x6bee('0xa')]:null,_0x277c29?_0x277c29['role']:null,getInteractionId(_0x381cc2,_0x1ceac7,_0x1c03fb),_0x381cc2?JSON[_0x6bee('0xb')](_0x381cc2):_0x6bee('0xc'));}function updateUser(_0x25af2f,_0x112a27,_0x59f95c,_0xe2e9b9,_0xe48c4f){db[_[_0x6bee('0x5')](_0xe2e9b9)+_0x6bee('0xd')][_0x6bee('0xe')]({'where':{'id':getInteractionId(_0x112a27,_0x59f95c,_0xe2e9b9)}})[_0x6bee('0xf')](function(_0x2851e3){if(_0x2851e3){return _0x2851e3[_0x6bee('0x10')]({'UserId':_0x25af2f?_0x25af2f['id']:null});}})['then'](function(_0xaac795){if(_0xaac795){log(_0x6bee('0x11'),_0x25af2f,_0x112a27,_0x59f95c,_0xe2e9b9,_0xe48c4f);}})['catch'](function(){log(_0x6bee('0x12'),_0x25af2f,_0x112a27,_0x59f95c,_0xe2e9b9,_0xe48c4f);});}exports['tracked']=function(_0x39e430,_0x886ab2){return function(_0xe9bceb,_0x5e4372,_0xe61e5a){var _0x272460=_0xe9bceb[_0x6bee('0x13')];var _0x2724ff={};var _0x2c744a=_0xe9bceb[_0x6bee('0x14')];if(_0x2724ff){_0x2724ff=_[_0x6bee('0x15')](_0xe9bceb[_0x6bee('0x16')]);_0x2724ff=_[_0x6bee('0x17')](_0x2724ff,['body',_0x6bee('0x18'),_0x6bee('0x19'),'fax',_0x6bee('0x1a')]);}updateUser(_0x272460,_0x2724ff,_0x2c744a,_0x39e430,_0x886ab2);_0xe61e5a(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 79666e1..e737ea7 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 _0xb90b=['admin','crypto','util','composable-middleware','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','hasOwnProperty','use','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users'];(function(_0x5f0d74,_0x55a31a){var _0x38f566=function(_0x18eafc){while(--_0x18eafc){_0x5f0d74['push'](_0x5f0d74['shift']());}};_0x38f566(++_0x55a31a);}(_0xb90b,0xa9));var _0xbb90=function(_0x3fe1b8,_0x3e1a18){_0x3fe1b8=_0x3fe1b8-0x0;var _0x5f0555=_0xb90b[_0x3fe1b8];return _0x5f0555;};'use strict';var crypto=require(_0xbb90('0x0'));var util=require(_0xbb90('0x1'));var compose=require(_0xbb90('0x2'));var db=require(_0xbb90('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4cfdf0,_0x58342a){if(_0x4cfdf0&&_0x58342a){if(_0x58342a['data1']&&_0x58342a[_0xbb90('0x4')]){var _0x5dd45c=_0x58342a[_0xbb90('0x5')];var _0x47ca05=_0x58342a['license'];var _0xd6f846=_0x5dd45c[_0xbb90('0x6')]('-')[0x4];var _0x19e0f6=_0x5dd45c['split']('-')[0x0];var _0x8bf0c6=crypto[_0xbb90('0x7')](_0xbb90('0x8'),util[_0xbb90('0x9')](_0xbb90('0xa'),_0xd6f846,_0x5dd45c,_0x19e0f6));var _0x3812b2=_0x8bf0c6[_0xbb90('0xb')](_0x47ca05,_0xbb90('0xc'),'utf8');_0x3812b2+=_0x8bf0c6[_0xbb90('0xd')]('utf8');var _0x468681=JSON[_0xbb90('0xe')](_0x3812b2);return _0x468681[_0xbb90('0xf')](_0x4cfdf0)?_0x468681[_0x4cfdf0]:null;}}return null;}function isLimit(_0x3c15b5,_0x32a881,_0x215568,_0x523a95){var _0x5d7c8e=_0x32a881;return compose()[_0xbb90('0x10')](function(_0x1aa684,_0x4e2506,_0x3223cf){return db['License'][_0xbb90('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x115f7c){var _0x3c8d5f=getValueFromLicense(_0x3c15b5,_0x115f7c);return _0x3c8d5f?_0x3c8d5f:_0x5d7c8e;})[_0xbb90('0x12')](function(_0x45ccd3){_0x5d7c8e=_0x45ccd3;return _0x215568[_0xbb90('0x13')](_0x523a95);})[_0xbb90('0x12')](function(_0x541ff9){if(_0x541ff9>=_0x5d7c8e){return _0x4e2506['status'](0x193)[_0xbb90('0x14')]({'message':util[_0xbb90('0x9')](_0xbb90('0x15'),_0x3c15b5)});}_0x3223cf();})['catch'](function(_0x338e47){_0x3223cf(_0x338e47);});});}function isUserLimit(){return isLimit(_0xbb90('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xbb90('0x17')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xbb89=['%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','count','status','json','format','catch','User','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr'];(function(_0x5e9a51,_0x3080d1){var _0x528bc7=function(_0x20d387){while(--_0x20d387){_0x5e9a51['push'](_0x5e9a51['shift']());}};_0x528bc7(++_0x3080d1);}(_0xbb89,0x1c2));var _0x9bb8=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xbb89[_0x27af45];return _0x18df21;};'use strict';var crypto=require(_0x9bb8('0x0'));var util=require(_0x9bb8('0x1'));var compose=require('composable-middleware');var db=require(_0x9bb8('0x2'))['db'];var config=require(_0x9bb8('0x3'));function getValueFromLicense(_0x5e4eed,_0xa63472){if(_0x5e4eed&&_0xa63472){if(_0xa63472[_0x9bb8('0x4')]&&_0xa63472[_0x9bb8('0x5')]){var _0x1464e1=_0xa63472[_0x9bb8('0x4')];var _0x2983dc=_0xa63472[_0x9bb8('0x5')];var _0x11c0ef=_0x1464e1[_0x9bb8('0x6')]('-')[0x4];var _0x4c713e=_0x1464e1['split']('-')[0x0];var _0x199b0d=crypto[_0x9bb8('0x7')](_0x9bb8('0x8'),util['format'](_0x9bb8('0x9'),_0x11c0ef,_0x1464e1,_0x4c713e));var _0x44c9f1=_0x199b0d[_0x9bb8('0xa')](_0x2983dc,_0x9bb8('0xb'),_0x9bb8('0xc'));_0x44c9f1+=_0x199b0d[_0x9bb8('0xd')](_0x9bb8('0xc'));var _0x1e8efd=JSON[_0x9bb8('0xe')](_0x44c9f1);return _0x1e8efd[_0x9bb8('0xf')](_0x5e4eed)?_0x1e8efd[_0x5e4eed]:null;}}return null;}function isLimit(_0x576251,_0x25bef4,_0x1fb7f3,_0x4c2e1a){var _0x46d58c=_0x25bef4;return compose()[_0x9bb8('0x10')](function(_0x3627dd,_0x451fb0,_0x4233d5){return db['License'][_0x9bb8('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x9bb8('0x12')](function(_0x43212e){var _0x38770a=getValueFromLicense(_0x576251,_0x43212e);return _0x38770a?_0x38770a:_0x46d58c;})['then'](function(_0x4d4822){_0x46d58c=_0x4d4822;return _0x1fb7f3[_0x9bb8('0x13')](_0x4c2e1a);})[_0x9bb8('0x12')](function(_0x34f477){if(_0x34f477>=_0x46d58c){return _0x451fb0[_0x9bb8('0x14')](0x193)[_0x9bb8('0x15')]({'message':util[_0x9bb8('0x16')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x576251)});}_0x4233d5();})[_0x9bb8('0x17')](function(_0x339905){_0x4233d5(_0x339905);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x9bb8('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x9bb8('0x19')}]}});}exports[_0x9bb8('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index ee8a58a..ed0b918 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 _0x36e4=['<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push','DATE','operator','$eq','$between','value','includes','$lte','add','format','castTo','field','text','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne'];(function(_0x5b7d97,_0x2b24b3){var _0xd99a4=function(_0x4a6c5f){while(--_0x4a6c5f){_0x5b7d97['push'](_0x5b7d97['shift']());}};_0xd99a4(++_0x2b24b3);}(_0x36e4,0xad));var _0x436e=function(_0x189360,_0xf00603){_0x189360=_0x189360-0x0;var _0x3e3477=_0x36e4[_0x189360];return _0x3e3477;};'use strict';var _=require(_0x436e('0x0'));var moment=require(_0x436e('0x1'));exports[_0x436e('0x2')]=function(_0x4391bb){var _0x1b1ad4={'conditions':[]};_0x1b1ad4['sqlOperator']=_['startsWith'](_0x4391bb,'[$or]')?'or':_0x436e('0x3');var _0x1ae9d2=_0x4391bb[_0x436e('0x4')](_0x436e('0x5'),'')[_0x436e('0x4')](_0x436e('0x6'),'')[_0x436e('0x7')]('||');for(var _0x488766=0x0;_0x488766<_0x1ae9d2[_0x436e('0x8')];_0x488766++){var _0x3b8273=_0x1ae9d2[_0x488766][_0x436e('0x7')](':=');var _0x464e8a=_0x3b8273[0x0];var _0x3fab61=_0x3b8273[_0x436e('0x9')](0x1);_0x3fab61[_0x436e('0xa')](function(_0xb001eb){var _0x235d02=_0xb001eb[_0x436e('0x7')]('[')[_0x436e('0xb')]();var _0x143a66=_0xb001eb[_0x436e('0xc')](/\[(.*?)\]/g);_0x143a66[_0x436e('0xa')](function(_0x3067e6){var _0x2e3d97=_0x3067e6[_0x436e('0x7')]('[')[_0x436e('0xd')](function(_0x183921){return _0x183921[_0x436e('0xe')](']')>-0x1;})['map'](function(_0x61eb05){return _0x61eb05[_0x436e('0x7')](']')[0x0];})[0x0];_0x1b1ad4[_0x436e('0xf')][_0x436e('0x10')]({'field':_0x464e8a,'operator':_0x235d02,'value':_0x2e3d97});});});}return _0x1b1ad4;};exports['buildExpression']=function(_0x19f8d4,_0xbbd700,_0x21831a){var _0x4b7fc2={};if(_0xbbd700===_0x436e('0x11')){if(_0x21831a[_0x436e('0x12')]===_0x436e('0x13')){_0x21831a[_0x436e('0x12')]=_0x436e('0x14');_0x21831a[_0x436e('0x15')]+=','+_0x21831a['value'];}else if(_[_0x436e('0x16')](['$gt',_0x436e('0x17')],_0x21831a[_0x436e('0x12')])){_0x21831a[_0x436e('0x15')]=moment(_0x21831a[_0x436e('0x15')])[_0x436e('0x18')](0x1,'days')[_0x436e('0x19')]('YYYY-MM-DD');}}if(_0x21831a['castTo']){_0xbbd700=_0x21831a[_0x436e('0x1a')];_0x4b7fc2['text']='CAST('+_0x19f8d4+'.'+_0x21831a[_0x436e('0x1b')]+'\x20AS\x20'+_0x21831a['castTo']+')\x20'+parseOperator(_0x21831a[_0x436e('0x12')]);}else{_0x4b7fc2[_0x436e('0x1c')]=_0x19f8d4+'.'+_0x21831a[_0x436e('0x1b')]+'\x20'+parseOperator(_0x21831a[_0x436e('0x12')]);}if(_[_0x436e('0x16')](['$ne','$notIn'],_0x21831a['operator']))_0x4b7fc2[_0x436e('0x1c')]='('+_0x4b7fc2[_0x436e('0x1c')]+'\x20OR\x20'+_0x19f8d4+'.'+_0x21831a['field']+'\x20IS\x20NULL)';_0x4b7fc2[_0x436e('0x15')]=parseValue(_0xbbd700,_0x21831a[_0x436e('0x12')],_0x21831a[_0x436e('0x15')]);return _0x4b7fc2;};function parseOperator(_0x556c0f){var _0x950b39;switch(_0x556c0f){case _0x436e('0x1d'):_0x950b39=_0x436e('0x1e');break;case _0x436e('0x1f'):_0x950b39=_0x436e('0x20');break;case _0x436e('0x13'):_0x950b39=_0x436e('0x21');break;case _0x436e('0x22'):_0x950b39=_0x436e('0x23');break;case _0x436e('0x24'):case _0x436e('0x25'):case _0x436e('0x26'):_0x950b39=_0x436e('0x27');break;case _0x436e('0x28'):_0x950b39=_0x436e('0x29');break;case _0x436e('0x2a'):_0x950b39=_0x436e('0x2b');break;case _0x436e('0x17'):_0x950b39=_0x436e('0x2c');break;case'$gte':_0x950b39=_0x436e('0x2d');break;case _0x436e('0x14'):_0x950b39=_0x436e('0x2e');break;}return _0x950b39;}function parseValue(_0x1d5d1a,_0x3e2500,_0x2c5f68){var _0x591fb1={'start':undefined,'end':undefined};switch(_0x3e2500){case _0x436e('0x1d'):case _0x436e('0x1f'):_0x591fb1[_0x436e('0x2f')]=_0x2c5f68[_0x436e('0x7')](',');break;case _0x436e('0x24'):_0x591fb1[_0x436e('0x2f')]='%'+_0x2c5f68+'%';break;case _0x436e('0x25'):_0x591fb1['start']=_0x2c5f68+'%';break;case _0x436e('0x26'):_0x591fb1['start']='%'+_0x2c5f68;break;case _0x436e('0x14'):var _0x2b850d=_0x2c5f68[_0x436e('0x7')](',');var _0x2c5f68=_0x2b850d[_0x436e('0xb')]();var _0x13e5c9=_0x2b850d[_0x436e('0x30')]();if(_0x1d5d1a==='DATE'){_0x2c5f68=moment(_0x2c5f68)[_0x436e('0x31')](0x0,!![])[_0x436e('0x19')]();_0x13e5c9=moment(_0x13e5c9)[_0x436e('0x31')](0x0,!![])[_0x436e('0x18')](0x17,'hours')[_0x436e('0x18')](0x3b,_0x436e('0x32'))[_0x436e('0x18')](0x3b,_0x436e('0x33'))[_0x436e('0x19')]();}_0x591fb1={'start':_0x2c5f68,'end':_0x13e5c9};break;default:_0x591fb1[_0x436e('0x2f')]=_0x2c5f68;break;}return _0x591fb1;} \ No newline at end of file +var _0x6bb6=['[$or]','[$and]','replace','split','forEach','shift','match','indexOf','conditions','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','seconds','parseSearch','sqlOperator','startsWith'];(function(_0xc69045,_0x5a367d){var _0x14f423=function(_0x60f486){while(--_0x60f486){_0xc69045['push'](_0xc69045['shift']());}};_0x14f423(++_0x5a367d);}(_0x6bb6,0x1ad));var _0x66bb=function(_0x36c18c,_0x1bb5c6){_0x36c18c=_0x36c18c-0x0;var _0x1e6fd2=_0x6bb6[_0x36c18c];return _0x1e6fd2;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x66bb('0x0')]=function(_0x3c59c6){var _0x5ea042={'conditions':[]};_0x5ea042[_0x66bb('0x1')]=_[_0x66bb('0x2')](_0x3c59c6,_0x66bb('0x3'))?'or':'and';var _0x55d021=_0x3c59c6['replace'](_0x66bb('0x4'),'')[_0x66bb('0x5')](_0x66bb('0x3'),'')[_0x66bb('0x6')]('||');for(var _0x487f71=0x0;_0x487f71<_0x55d021['length'];_0x487f71++){var _0x21282c=_0x55d021[_0x487f71]['split'](':=');var _0x16f614=_0x21282c[0x0];var _0x2b1389=_0x21282c['slice'](0x1);_0x2b1389[_0x66bb('0x7')](function(_0x463b31){var _0x2ff767=_0x463b31[_0x66bb('0x6')]('[')[_0x66bb('0x8')]();var _0x3aceb6=_0x463b31[_0x66bb('0x9')](/\[(.*?)\]/g);_0x3aceb6['forEach'](function(_0x21ba25){var _0xb8c51e=_0x21ba25['split']('[')['filter'](function(_0x2d2029){return _0x2d2029[_0x66bb('0xa')](']')>-0x1;})['map'](function(_0x42cbbc){return _0x42cbbc['split'](']')[0x0];})[0x0];_0x5ea042[_0x66bb('0xb')][_0x66bb('0xc')]({'field':_0x16f614,'operator':_0x2ff767,'value':_0xb8c51e});});});}return _0x5ea042;};exports[_0x66bb('0xd')]=function(_0x14b253,_0x1ddc7c,_0x5cba50){var _0x30c8c3={};if(_0x1ddc7c==='DATE'){if(_0x5cba50[_0x66bb('0xe')]===_0x66bb('0xf')){_0x5cba50[_0x66bb('0xe')]=_0x66bb('0x10');_0x5cba50[_0x66bb('0x11')]+=','+_0x5cba50[_0x66bb('0x11')];}else if(_[_0x66bb('0x12')]([_0x66bb('0x13'),_0x66bb('0x14')],_0x5cba50[_0x66bb('0xe')])){_0x5cba50[_0x66bb('0x11')]=moment(_0x5cba50[_0x66bb('0x11')])[_0x66bb('0x15')](0x1,_0x66bb('0x16'))[_0x66bb('0x17')](_0x66bb('0x18'));}}if(_0x5cba50[_0x66bb('0x19')]){_0x1ddc7c=_0x5cba50['castTo'];_0x30c8c3['text']=_0x66bb('0x1a')+_0x14b253+'.'+_0x5cba50[_0x66bb('0x1b')]+_0x66bb('0x1c')+_0x5cba50[_0x66bb('0x19')]+')\x20'+parseOperator(_0x5cba50[_0x66bb('0xe')]);}else{_0x30c8c3['text']=_0x14b253+'.'+_0x5cba50[_0x66bb('0x1b')]+'\x20'+parseOperator(_0x5cba50[_0x66bb('0xe')]);}if(_['includes'](['$ne','$notIn'],_0x5cba50[_0x66bb('0xe')]))_0x30c8c3[_0x66bb('0x1d')]='('+_0x30c8c3['text']+_0x66bb('0x1e')+_0x14b253+'.'+_0x5cba50[_0x66bb('0x1b')]+_0x66bb('0x1f');_0x30c8c3[_0x66bb('0x11')]=parseValue(_0x1ddc7c,_0x5cba50[_0x66bb('0xe')],_0x5cba50['value']);return _0x30c8c3;};function parseOperator(_0x2c7fbd){var _0x302fa6;switch(_0x2c7fbd){case _0x66bb('0x20'):_0x302fa6=_0x66bb('0x21');break;case _0x66bb('0x22'):_0x302fa6=_0x66bb('0x23');break;case _0x66bb('0xf'):_0x302fa6=_0x66bb('0x24');break;case _0x66bb('0x25'):_0x302fa6=_0x66bb('0x26');break;case _0x66bb('0x27'):case _0x66bb('0x28'):case _0x66bb('0x29'):_0x302fa6='LIKE\x20?';break;case _0x66bb('0x2a'):_0x302fa6=_0x66bb('0x2b');break;case _0x66bb('0x13'):_0x302fa6=_0x66bb('0x2c');break;case _0x66bb('0x14'):_0x302fa6=_0x66bb('0x2d');break;case _0x66bb('0x2e'):_0x302fa6=_0x66bb('0x2f');break;case _0x66bb('0x10'):_0x302fa6=_0x66bb('0x30');break;}return _0x302fa6;}function parseValue(_0x5cf1b2,_0x4ecff7,_0x1ef2a4){var _0x3275f9={'start':undefined,'end':undefined};switch(_0x4ecff7){case _0x66bb('0x20'):case'$notIn':_0x3275f9[_0x66bb('0x31')]=_0x1ef2a4[_0x66bb('0x6')](',');break;case'$substring':_0x3275f9[_0x66bb('0x31')]='%'+_0x1ef2a4+'%';break;case _0x66bb('0x28'):_0x3275f9['start']=_0x1ef2a4+'%';break;case _0x66bb('0x29'):_0x3275f9[_0x66bb('0x31')]='%'+_0x1ef2a4;break;case _0x66bb('0x10'):var _0x134e2e=_0x1ef2a4[_0x66bb('0x6')](',');var _0x1ef2a4=_0x134e2e[_0x66bb('0x8')]();var _0x34f062=_0x134e2e[_0x66bb('0x32')]();if(_0x5cf1b2===_0x66bb('0x33')){_0x1ef2a4=moment(_0x1ef2a4)[_0x66bb('0x34')](0x0,!![])['format']();_0x34f062=moment(_0x34f062)[_0x66bb('0x34')](0x0,!![])['add'](0x17,'hours')[_0x66bb('0x15')](0x3b,'minutes')[_0x66bb('0x15')](0x3b,_0x66bb('0x35'))['format']();}_0x3275f9={'start':_0x1ef2a4,'end':_0x34f062};break;default:_0x3275f9['start']=_0x1ef2a4;break;}return _0x3275f9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index e4a976f..45d2002 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 _0xd734=['lower','col','filter','options','sequelize','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','DATE','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','offset','sort','indexOf','priority','cast','DESC','unsigned','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','match','replace','join','query','$id','model','map','attributes','nolimit','where','pick','merge','VIRTUAL'];(function(_0x34ca92,_0x695326){var _0x45acc4=function(_0x53bc46){while(--_0x53bc46){_0x34ca92['push'](_0x34ca92['shift']());}};_0x45acc4(++_0x695326);}(_0xd734,0x6c));var _0x4d73=function(_0x34e012,_0x179222){_0x34e012=_0x34e012-0x0;var _0xca7d6e=_0xd734[_0x34e012];return _0xca7d6e;};'use strict';var _=require('lodash');var sequelize=require(_0x4d73('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3e4959){var _0x1f8f2d=['ne'];try{var _0x5eea99=JSON[_0x4d73('0x1')](_0x3e4959);var _0x529a7c=Object[_0x4d73('0x2')](_0x5eea99)[0x0];return _0x1f8f2d[_0x4d73('0x3')](_0x529a7c);}catch(_0x573769){return![];}}function getOperatorValue(_0x5360a){var _0x5e4e2e=JSON[_0x4d73('0x1')](_0x5360a);var _0x17f9d3=Object[_0x4d73('0x2')](_0x5e4e2e)[0x0];var _0x49a784=_0x5e4e2e[_0x17f9d3];return{['$'+_0x17f9d3]:_0x49a784};}exports[_0x4d73('0x4')]=function(_0x5a2f59){var _0xd2807=null;if(_0x5a2f59){_0xd2807=_0x5a2f59[_0x4d73('0x5')](',');}return _0xd2807;};exports[_0x4d73('0x6')]=function(_0x4372bb,_0x1520f3){var _0x19702b={};if(!_[_0x4d73('0x7')](_0x4372bb)){_[_0x4d73('0x8')](_0x4372bb,function(_0x110489,_0x513e6a){try{if(_0x1520f3){var _0x3ed792=_[_0x4d73('0x9')](_0x1520f3,{'name':_0x513e6a})||{};if(hasSequelizeOperator(_0x110489)){_0x19702b[_0x513e6a]=getOperatorValue(_0x110489);}else if(_0x3ed792['type']===_0x4d73('0xa')&&_['isPlainObject'](_0x110489)){var _0x400a21=JSON['parse'](_0x110489);var _0x3b64b5={'$gte':moment(moment(_0x400a21['$gte'])[_0x4d73('0xb')](_0x4d73('0xc')))[_0x4d73('0xd')]()[_0x4d73('0xb')](),'$lte':moment(moment(_0x400a21[_0x4d73('0xe')])[_0x4d73('0xb')](_0x4d73('0xc')))['utc']()[_0x4d73('0xf')](0x1,'s')[_0x4d73('0xb')]()};_0x19702b[_0x513e6a]=_0x3b64b5;}else if(_0x3ed792[_0x4d73('0x10')]==='uniqueid'){_0x19702b[_0x513e6a]=_0x110489;}else{_0x19702b[_0x513e6a]=_[_0x4d73('0x11')](_0x110489)?_0x110489:JSON[_0x4d73('0x1')](_0x110489);}}else{_0x19702b[_0x513e6a]=_[_0x4d73('0x11')](_0x110489)?_0x110489:JSON[_0x4d73('0x1')](_0x110489);}}catch(_0x238ed4){_0x19702b[_0x513e6a]=_0x110489[_0x4d73('0x5')](',');}});}return _0x19702b;};exports[_0x4d73('0x12')]=function(_0x230991){_0x230991=parseInt(_0x230991,0xa);if(!_0x230991||_0x230991<0x0){_0x230991=LIMIT_VALUE;}return _0x230991;};exports[_0x4d73('0x13')]=function(_0xc7bcec){_0xc7bcec=parseInt(_0xc7bcec,0xa);if(!_0xc7bcec||_0xc7bcec<0x0){_0xc7bcec=0x0;}return _0xc7bcec;};exports[_0x4d73('0x14')]=function(_0x213449){var _0x2fbcc6,_0x1e6a5e=null;if(_0x213449){_0x2fbcc6=_0x213449[_0x4d73('0x5')](',');_0x1e6a5e=_['map'](_0x2fbcc6,function(_0x8a06a2){if(_0x8a06a2[_0x4d73('0x15')]('-')===0x0){return[_0x8a06a2===_0x4d73('0x16')?sequelize[_0x4d73('0x17')](sequelize['col']('priority'),'unsigned'):_0x8a06a2['substr'](0x1),_0x4d73('0x18')];}else{return[_0x8a06a2===_0x4d73('0x16')?sequelize[_0x4d73('0x17')](sequelize['col'](_0x4d73('0x16')),_0x4d73('0x19')):_0x8a06a2,_0x4d73('0x1a')];}});}return _0x1e6a5e;};exports[_0x4d73('0x1b')]=function(_0x91ca3,_0x4af653){if(_[_0x4d73('0x7')](_0x91ca3)){return _0x91ca3;}if(_[_0x4d73('0x11')](_0x91ca3)){for(var _0x3f7466=0x0;_0x3f7466<_0x91ca3[_0x4d73('0x1c')];_0x3f7466+=0x1){_0x91ca3[_0x3f7466]=this[_0x4d73('0x1b')](_0x91ca3[_0x3f7466],_0x4af653);}return _0x91ca3;}if(!_[_0x4d73('0x1d')](_0x91ca3)){return _0x91ca3;}if(_[_0x4d73('0x1e')](_0x4af653)){_0x4af653=[_0x4af653];}if(!_[_0x4d73('0x11')](_0x4af653)){return _0x91ca3;}for(var _0x2d337c=0x0;_0x2d337c<_0x4af653[_0x4d73('0x1c')];_0x2d337c+=0x1){_[_0x4d73('0x1f')](_0x91ca3,_0x4af653[_0x2d337c]);}for(var _0x40ea1d in _0x91ca3){if(_0x91ca3[_0x4d73('0x20')](_0x40ea1d)){_0x91ca3[_0x40ea1d]=this[_0x4d73('0x1b')](_0x91ca3[_0x40ea1d],_0x4af653);}}return _0x91ca3;};exports[_0x4d73('0x21')]=function(_0x1ec33b){return _0x1ec33b['match'](RegExp(_0x4d73('0x22')))?!![]:![];};exports['isEmail']=function(_0x1f487b){return _0x1f487b[_0x4d73('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4bc4fe){var _0x2f59ae=[];_0x4bc4fe[_0x4d73('0x5')](/[ ,]+/)['forEach'](function(_0x5ded73){_0x5ded73=_0x5ded73[_0x4d73('0x24')](/([^:]")"+/g,'$1');_0x5ded73='+'+_0x5ded73+'*';if(_0x5ded73[_0x4d73('0x3')]('@'))_0x5ded73='\x22'+_0x5ded73+'\x22';_0x2f59ae['push'](_0x5ded73);});return _0x2f59ae[_0x4d73('0x25')]('\x20');};exports['getOptions']=function(_0x84d0cf,_0x439f01,_0xe6ab8b){var _0x2f6d9c={},_0x40d9ff={};if(_0x439f01[_0x4d73('0x26')][_0x4d73('0x27')]){_0x439f01[_0x4d73('0x26')]['id']=_0x439f01[_0x4d73('0x26')][_0x4d73('0x27')];delete _0x439f01[_0x4d73('0x26')][_0x4d73('0x27')];}_0x2f6d9c[_0x4d73('0x28')]=_[_0x4d73('0x29')](_0x84d0cf,'name');_0x2f6d9c[_0x4d73('0x26')]=_[_0x4d73('0x2')](_0x439f01[_0x4d73('0x26')]);_0x2f6d9c[_0x4d73('0x6')]=_['intersection'](_0x2f6d9c[_0x4d73('0x28')],_0x2f6d9c['query']);_0x40d9ff[_0x4d73('0x2a')]=_['intersection'](_0x2f6d9c[_0x4d73('0x28')],this[_0x4d73('0x4')](_0x439f01[_0x4d73('0x26')]['fields']));_0x40d9ff[_0x4d73('0x2a')]=_0x40d9ff[_0x4d73('0x2a')][_0x4d73('0x1c')]?_0x40d9ff[_0x4d73('0x2a')]:_0x2f6d9c[_0x4d73('0x28')];if(!_0x439f01[_0x4d73('0x26')][_0x4d73('0x20')](_0x4d73('0x2b'))){_0x40d9ff[_0x4d73('0x12')]=this[_0x4d73('0x12')](_0x439f01[_0x4d73('0x26')][_0x4d73('0x12')]);_0x40d9ff[_0x4d73('0x13')]=this[_0x4d73('0x13')](_0x439f01[_0x4d73('0x26')][_0x4d73('0x13')]);}_0x40d9ff['order']=this[_0x4d73('0x14')](_0x439f01[_0x4d73('0x26')][_0x4d73('0x14')]);_0x40d9ff[_0x4d73('0x2c')]=this['filters'](_[_0x4d73('0x2d')](_0x439f01[_0x4d73('0x26')],_0x2f6d9c[_0x4d73('0x6')]),_0x84d0cf);if(_0x439f01[_0x4d73('0x26')]['filter']){_0x40d9ff['where']=_[_0x4d73('0x2e')](_0x40d9ff[_0x4d73('0x2c')],{'$or':_[_0x4d73('0x29')](_0x84d0cf,function(_0x1a60d6){if(_0x1a60d6['type']!==_0x4d73('0x2f')){if(_0xe6ab8b){return sequelize['where'](sequelize['fn'](_0x4d73('0x30'),sequelize[_0x4d73('0x31')](_0x1a60d6[_0x4d73('0x10')])),{'$like':sequelize['fn'](_0x4d73('0x30'),'%'+_0x439f01[_0x4d73('0x26')][_0x4d73('0x32')]+'%')});}else{var _0x3af197={};_0x3af197[_0x1a60d6[_0x4d73('0x10')]]={'$like':'%'+_0x439f01[_0x4d73('0x26')][_0x4d73('0x32')]+'%'};return _0x3af197;}}})});}_0x40d9ff=_['merge']({},_0x40d9ff,_0x439f01[_0x4d73('0x33')]);return _0x40d9ff;}; \ No newline at end of file +var _0x8f22=['$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','col','unsigned','DESC','omit','length','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','replace','join','getOptions','query','$id','model','intersection','fields','attributes','nolimit','offset','order','where','pick','filter','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','split','filters','forOwn','find','DATE','isPlainObject'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x8f22,0x1e3));var _0x28f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f22[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x28f2('0x0'));var sequelize=require(_0x28f2('0x1'));var moment=require(_0x28f2('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x89ac4){var _0x3bae3f=['ne'];try{var _0x6efb23=JSON[_0x28f2('0x3')](_0x89ac4);var _0x421a00=Object[_0x28f2('0x4')](_0x6efb23)[0x0];return _0x3bae3f[_0x28f2('0x5')](_0x421a00);}catch(_0x22adc0){return![];}}function getOperatorValue(_0x39590e){var _0x70c20b=JSON[_0x28f2('0x3')](_0x39590e);var _0x17a23c=Object[_0x28f2('0x4')](_0x70c20b)[0x0];var _0x514729=_0x70c20b[_0x17a23c];return{['$'+_0x17a23c]:_0x514729};}exports['fields']=function(_0x579d3d){var _0x24f22a=null;if(_0x579d3d){_0x24f22a=_0x579d3d[_0x28f2('0x6')](',');}return _0x24f22a;};exports[_0x28f2('0x7')]=function(_0x218c62,_0x92c4ff){var _0x1bf3b3={};if(!_['isEmpty'](_0x218c62)){_[_0x28f2('0x8')](_0x218c62,function(_0x5c03d9,_0x2c85b2){try{if(_0x92c4ff){var _0x3b6336=_[_0x28f2('0x9')](_0x92c4ff,{'name':_0x2c85b2})||{};if(hasSequelizeOperator(_0x5c03d9)){_0x1bf3b3[_0x2c85b2]=getOperatorValue(_0x5c03d9);}else if(_0x3b6336['type']===_0x28f2('0xa')&&_[_0x28f2('0xb')](_0x5c03d9)){var _0x5f0701=JSON[_0x28f2('0x3')](_0x5c03d9);var _0xd45a40={'$gte':moment(moment(_0x5f0701[_0x28f2('0xc')])[_0x28f2('0xd')]('YYYY-MM-DD'))[_0x28f2('0xe')]()[_0x28f2('0xd')](),'$lte':moment(moment(_0x5f0701[_0x28f2('0xf')])['format'](_0x28f2('0x10')))['utc']()[_0x28f2('0x11')](0x1,'s')[_0x28f2('0xd')]()};_0x1bf3b3[_0x2c85b2]=_0xd45a40;}else if(_0x3b6336[_0x28f2('0x12')]===_0x28f2('0x13')){_0x1bf3b3[_0x2c85b2]=_0x5c03d9;}else{_0x1bf3b3[_0x2c85b2]=_[_0x28f2('0x14')](_0x5c03d9)?_0x5c03d9:JSON[_0x28f2('0x3')](_0x5c03d9);}}else{_0x1bf3b3[_0x2c85b2]=_[_0x28f2('0x14')](_0x5c03d9)?_0x5c03d9:JSON[_0x28f2('0x3')](_0x5c03d9);}}catch(_0x3e1a01){_0x1bf3b3[_0x2c85b2]=_0x5c03d9[_0x28f2('0x6')](',');}});}return _0x1bf3b3;};exports[_0x28f2('0x15')]=function(_0x24bf8a){_0x24bf8a=parseInt(_0x24bf8a,0xa);if(!_0x24bf8a||_0x24bf8a<0x0){_0x24bf8a=LIMIT_VALUE;}return _0x24bf8a;};exports['offset']=function(_0x4904cd){_0x4904cd=parseInt(_0x4904cd,0xa);if(!_0x4904cd||_0x4904cd<0x0){_0x4904cd=0x0;}return _0x4904cd;};exports[_0x28f2('0x16')]=function(_0x2cab96){var _0x80869a,_0x2cc3b3=null;if(_0x2cab96){_0x80869a=_0x2cab96[_0x28f2('0x6')](',');_0x2cc3b3=_[_0x28f2('0x17')](_0x80869a,function(_0x38035a){if(_0x38035a[_0x28f2('0x18')]('-')===0x0){return[_0x38035a===_0x28f2('0x19')?sequelize['cast'](sequelize[_0x28f2('0x1a')](_0x28f2('0x19')),_0x28f2('0x1b')):_0x38035a['substr'](0x1),_0x28f2('0x1c')];}else{return[_0x38035a==='priority'?sequelize['cast'](sequelize[_0x28f2('0x1a')]('priority'),_0x28f2('0x1b')):_0x38035a,'ASC'];}});}return _0x2cc3b3;};exports[_0x28f2('0x1d')]=function(_0x1e424e,_0x5116ed){if(_['isEmpty'](_0x1e424e)){return _0x1e424e;}if(_[_0x28f2('0x14')](_0x1e424e)){for(var _0x49c057=0x0;_0x49c057<_0x1e424e[_0x28f2('0x1e')];_0x49c057+=0x1){_0x1e424e[_0x49c057]=this['omit'](_0x1e424e[_0x49c057],_0x5116ed);}return _0x1e424e;}if(!_[_0x28f2('0x1f')](_0x1e424e)){return _0x1e424e;}if(_[_0x28f2('0x20')](_0x5116ed)){_0x5116ed=[_0x5116ed];}if(!_[_0x28f2('0x14')](_0x5116ed)){return _0x1e424e;}for(var _0x6d767=0x0;_0x6d767<_0x5116ed[_0x28f2('0x1e')];_0x6d767+=0x1){_['unset'](_0x1e424e,_0x5116ed[_0x6d767]);}for(var _0x3267c0 in _0x1e424e){if(_0x1e424e[_0x28f2('0x21')](_0x3267c0)){_0x1e424e[_0x3267c0]=this[_0x28f2('0x1d')](_0x1e424e[_0x3267c0],_0x5116ed);}}return _0x1e424e;};exports['isNumeric']=function(_0x6185af){return _0x6185af[_0x28f2('0x22')](RegExp(_0x28f2('0x23')))?!![]:![];};exports['isEmail']=function(_0x513c5c){return _0x513c5c[_0x28f2('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x28f2('0x24')]=function(_0x5ba574){var _0x22449b=[];_0x5ba574[_0x28f2('0x6')](/[ ,]+/)['forEach'](function(_0x36a5c1){_0x36a5c1=_0x36a5c1[_0x28f2('0x25')](/([^:]")"+/g,'$1');_0x36a5c1='+'+_0x36a5c1+'*';if(_0x36a5c1['includes']('@'))_0x36a5c1='\x22'+_0x36a5c1+'\x22';_0x22449b['push'](_0x36a5c1);});return _0x22449b[_0x28f2('0x26')]('\x20');};exports[_0x28f2('0x27')]=function(_0x4f5a7b,_0x371889,_0x388ff7){var _0x2faaab={},_0x3a5ab9={};if(_0x371889[_0x28f2('0x28')][_0x28f2('0x29')]){_0x371889['query']['id']=_0x371889[_0x28f2('0x28')]['$id'];delete _0x371889[_0x28f2('0x28')][_0x28f2('0x29')];}_0x2faaab[_0x28f2('0x2a')]=_['map'](_0x4f5a7b,_0x28f2('0x12'));_0x2faaab[_0x28f2('0x28')]=_[_0x28f2('0x4')](_0x371889[_0x28f2('0x28')]);_0x2faaab['filters']=_[_0x28f2('0x2b')](_0x2faaab[_0x28f2('0x2a')],_0x2faaab[_0x28f2('0x28')]);_0x3a5ab9['attributes']=_[_0x28f2('0x2b')](_0x2faaab[_0x28f2('0x2a')],this[_0x28f2('0x2c')](_0x371889[_0x28f2('0x28')][_0x28f2('0x2c')]));_0x3a5ab9[_0x28f2('0x2d')]=_0x3a5ab9[_0x28f2('0x2d')][_0x28f2('0x1e')]?_0x3a5ab9[_0x28f2('0x2d')]:_0x2faaab['model'];if(!_0x371889[_0x28f2('0x28')]['hasOwnProperty'](_0x28f2('0x2e'))){_0x3a5ab9['limit']=this[_0x28f2('0x15')](_0x371889[_0x28f2('0x28')][_0x28f2('0x15')]);_0x3a5ab9[_0x28f2('0x2f')]=this['offset'](_0x371889[_0x28f2('0x28')][_0x28f2('0x2f')]);}_0x3a5ab9[_0x28f2('0x30')]=this[_0x28f2('0x16')](_0x371889['query']['sort']);_0x3a5ab9[_0x28f2('0x31')]=this['filters'](_[_0x28f2('0x32')](_0x371889['query'],_0x2faaab[_0x28f2('0x7')]),_0x4f5a7b);if(_0x371889['query'][_0x28f2('0x33')]){_0x3a5ab9['where']=_[_0x28f2('0x34')](_0x3a5ab9[_0x28f2('0x31')],{'$or':_['map'](_0x4f5a7b,function(_0x3fb287){if(_0x3fb287['type']!==_0x28f2('0x35')){if(_0x388ff7){return sequelize[_0x28f2('0x31')](sequelize['fn'](_0x28f2('0x36'),sequelize[_0x28f2('0x1a')](_0x3fb287['name'])),{'$like':sequelize['fn'](_0x28f2('0x36'),'%'+_0x371889[_0x28f2('0x28')][_0x28f2('0x33')]+'%')});}else{var _0x10087d={};_0x10087d[_0x3fb287[_0x28f2('0x12')]]={'$like':'%'+_0x371889[_0x28f2('0x28')][_0x28f2('0x33')]+'%'};return _0x10087d;}}})});}_0x3a5ab9=_['merge']({},_0x3a5ab9,_0x371889['options']);return _0x3a5ab9;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a04a88b..2c93050 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17e5=['body-parser','method-override','cookie-parser','path','passport','cors','./environment','default','get','env','join','root','public','development','appPath','json\x20replacer','toISOString','split','use','static','set','views','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','express','serve-favicon'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17e5,0x13e));var _0x517e=function(_0x199798,_0x45585a){_0x199798=_0x199798-0x0;var _0x55f707=_0x17e5[_0x199798];return _0x55f707;};'use strict';var express=require(_0x517e('0x0'));var favicon=require(_0x517e('0x1'));var bodyParser=require(_0x517e('0x2'));var methodOverride=require(_0x517e('0x3'));var cookieParser=require(_0x517e('0x4'));var errorHandler=require('errorhandler');var path=require(_0x517e('0x5'));var passport=require(_0x517e('0x6'));var cors=require(_0x517e('0x7'));var moment=require('moment');var config=require(_0x517e('0x8'));var db=require('../mysqldb')['db'];exports[_0x517e('0x9')]=function(_0x25b2e0){var _0xd48d1e=_0x25b2e0[_0x517e('0xa')](_0x517e('0xb'));if(_0xd48d1e==='production'){_0x25b2e0['set']('appPath',path[_0x517e('0xc')](config[_0x517e('0xd')],_0x517e('0xe')));}if(_0xd48d1e===_0x517e('0xf')||_0xd48d1e==='test'){_0x25b2e0['set'](_0x517e('0x10'),path['join'](config[_0x517e('0xd')],'client'));_0x25b2e0['use'](errorHandler());}_0x25b2e0['set'](_0x517e('0x11'),function(_0x312be2,_0x4639ca){if(this[_0x312be2]instanceof Date){_0x4639ca=this[_0x312be2][_0x517e('0x12')]()[_0x517e('0x13')]('.')[0x0]+'Z';}return _0x4639ca;});_0x25b2e0[_0x517e('0x14')](express[_0x517e('0x15')](_0x25b2e0[_0x517e('0xa')](_0x517e('0x10'))));_0x25b2e0[_0x517e('0x16')](_0x517e('0x17'),config[_0x517e('0xd')]+_0x517e('0x18'));_0x25b2e0[_0x517e('0x19')](_0x517e('0x1a'),require(_0x517e('0x1b'))[_0x517e('0x1c')]);_0x25b2e0['set']('view\x20engine',_0x517e('0x1a'));_0x25b2e0['use'](bodyParser[_0x517e('0x1d')]({'limit':_0x517e('0x1e'),'extended':!![]}));_0x25b2e0[_0x517e('0x14')](bodyParser[_0x517e('0x1f')]({'limit':_0x517e('0x1e')}));_0x25b2e0[_0x517e('0x14')](cors());_0x25b2e0[_0x517e('0x14')](methodOverride());_0x25b2e0[_0x517e('0x14')](cookieParser());_0x25b2e0[_0x517e('0x14')](passport['initialize']());}; \ No newline at end of file +var _0x4192=['get','env','production','set','appPath','join','root','public','test','json\x20replacer','toISOString','use','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon','method-override','cookie-parser','errorhandler','passport','cors','./environment','../mysqldb','default'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x4192,0x176));var _0x2419=function(_0x57d11b,_0x2a4299){_0x57d11b=_0x57d11b-0x0;var _0x63ad6e=_0x4192[_0x57d11b];return _0x63ad6e;};'use strict';var express=require(_0x2419('0x0'));var favicon=require(_0x2419('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x2419('0x2'));var cookieParser=require(_0x2419('0x3'));var errorHandler=require(_0x2419('0x4'));var path=require('path');var passport=require(_0x2419('0x5'));var cors=require(_0x2419('0x6'));var moment=require('moment');var config=require(_0x2419('0x7'));var db=require(_0x2419('0x8'))['db'];exports[_0x2419('0x9')]=function(_0x790963){var _0x5e0c7b=_0x790963[_0x2419('0xa')](_0x2419('0xb'));if(_0x5e0c7b===_0x2419('0xc')){_0x790963[_0x2419('0xd')](_0x2419('0xe'),path[_0x2419('0xf')](config[_0x2419('0x10')],_0x2419('0x11')));}if(_0x5e0c7b==='development'||_0x5e0c7b===_0x2419('0x12')){_0x790963[_0x2419('0xd')](_0x2419('0xe'),path[_0x2419('0xf')](config[_0x2419('0x10')],'client'));_0x790963['use'](errorHandler());}_0x790963[_0x2419('0xd')](_0x2419('0x13'),function(_0x1a6256,_0x3048be){if(this[_0x1a6256]instanceof Date){_0x3048be=this[_0x1a6256][_0x2419('0x14')]()['split']('.')[0x0]+'Z';}return _0x3048be;});_0x790963[_0x2419('0x15')](express[_0x2419('0x16')](_0x790963[_0x2419('0xa')]('appPath')));_0x790963[_0x2419('0xd')]('views',config['root']+_0x2419('0x17'));_0x790963[_0x2419('0x18')](_0x2419('0x19'),require(_0x2419('0x1a'))[_0x2419('0x1b')]);_0x790963['set'](_0x2419('0x1c'),_0x2419('0x19'));_0x790963['use'](bodyParser[_0x2419('0x1d')]({'limit':_0x2419('0x1e'),'extended':!![]}));_0x790963[_0x2419('0x15')](bodyParser[_0x2419('0x1f')]({'limit':'50mb'}));_0x790963[_0x2419('0x15')](cors());_0x790963[_0x2419('0x15')](methodOverride());_0x790963[_0x2419('0x15')](cookieParser());_0x790963[_0x2419('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 22e3136..1a7672e 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 _0xd5e7=['../environment','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','map','model','createHash','md5','update','digest','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync'];(function(_0x5bddf9,_0x5560ea){var _0xbd7e3d=function(_0x22bdbf){while(--_0x22bdbf){_0x5bddf9['push'](_0x5bddf9['shift']());}};_0xbd7e3d(++_0x5560ea);}(_0xd5e7,0xb0));var _0x7d5e=function(_0x36a3fa,_0x2cdee9){_0x36a3fa=_0x36a3fa-0x0;var _0x18d977=_0xd5e7[_0x36a3fa];return _0x18d977;};'use strict';var _=require(_0x7d5e('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x7d5e('0x1'));var exec=require(_0x7d5e('0x2'))[_0x7d5e('0x3')];var config=require(_0x7d5e('0x4'));function getInterfaces(){var _0x45a9ea=[];var _0xa0c757=os['networkInterfaces']();var _0x3ca347=_['orderBy'](_['keys'](_0xa0c757));for(var _0x454c52=0x0;_0x454c52<_0x3ca347['length'];_0x454c52++){var _0x3633af=_0xa0c757[_0x3ca347[_0x454c52]][_0x7d5e('0x5')](function(_0x5a9614){return _0x5a9614['family']===_0x7d5e('0x6')&&_0x5a9614['internal']===![];});_0x45a9ea=_0x45a9ea[_0x7d5e('0x7')](_0x3633af);}return _0x45a9ea;}function getFirstInterface(){var _0x2389ae=_[_0x7d5e('0x8')](getInterfaces());return{'macAddress':_0x2389ae&&_0x2389ae['mac']?_0x2389ae[_0x7d5e('0x9')]:_0x7d5e('0xa'),'ipAddress':_0x2389ae&&_0x2389ae['address']?_0x2389ae[_0x7d5e('0xb')]:_0x7d5e('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3fb0ac=_[_0x7d5e('0xd')](os[_0x7d5e('0xe')]()[_0x7d5e('0xf')](function(_0x32f365){return _0x32f365[_0x7d5e('0x10')];}))['join'](':');return crypto[_0x7d5e('0x11')](_0x7d5e('0x12'))[_0x7d5e('0x13')](_0x3fb0ac)[_0x7d5e('0x14')](_0x7d5e('0x15'));}exports[_0x7d5e('0x16')]=function(){var _0x40a928=os['platform']();var _0x1c7dc7=/[0-9a-f-]{36}/;if(config[_0x7d5e('0x17')]&&_0x1c7dc7[_0x7d5e('0x18')](config[_0x7d5e('0x17')])){return config[_0x7d5e('0x17')];}else if(_0x40a928==='win32'){return exec(_0x7d5e('0x19'),{'encoding':'utf8'})[_0x7d5e('0x1a')]('\x0d\x0a','');}else{var _0x3d71df=getFirstInterface();var _0x73d6df=getCPUhash();var _0x54b58e=_0x73d6df+'|'+os[_0x7d5e('0x1b')]()+'|'+_0x3d71df['macAddress']+'|'+_0x3d71df[_0x7d5e('0x1c')];var _0x4c93be=crypto[_0x7d5e('0x11')](_0x7d5e('0x12'))[_0x7d5e('0x13')](_0x54b58e)[_0x7d5e('0x14')]('hex');return _0x4c93be['substring'](0x0,0x8)+'-'+_0x4c93be[_0x7d5e('0x1d')](0x8,0xc)+'-'+_0x4c93be['substring'](0xc,0x10)+'-'+_0x4c93be['substring'](0x10,0x14)+'-'+_0x4c93be[_0x7d5e('0x1d')](0x14);}}; \ No newline at end of file +var _0xacec=['platform','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','md5','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','update','digest','getUuid'];(function(_0x353704,_0x283e9b){var _0x59773e=function(_0x4f00a8){while(--_0x4f00a8){_0x353704['push'](_0x353704['shift']());}};_0x59773e(++_0x283e9b);}(_0xacec,0xae));var _0xcace=function(_0x29638f,_0x5dfb8a){_0x29638f=_0x29638f-0x0;var _0x4c2121=_0xacec[_0x29638f];return _0x4c2121;};'use strict';var _=require(_0xcace('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xcace('0x1'));var exec=require(_0xcace('0x2'))[_0xcace('0x3')];var config=require(_0xcace('0x4'));function getInterfaces(){var _0x2e8375=[];var _0x53b87e=os[_0xcace('0x5')]();var _0x422096=_[_0xcace('0x6')](_[_0xcace('0x7')](_0x53b87e));for(var _0x2dd3cc=0x0;_0x2dd3cc<_0x422096[_0xcace('0x8')];_0x2dd3cc++){var _0x326bf2=_0x53b87e[_0x422096[_0x2dd3cc]]['filter'](function(_0x4d4b17){return _0x4d4b17[_0xcace('0x9')]===_0xcace('0xa')&&_0x4d4b17[_0xcace('0xb')]===![];});_0x2e8375=_0x2e8375[_0xcace('0xc')](_0x326bf2);}return _0x2e8375;}function getFirstInterface(){var _0x345ad6=_['head'](getInterfaces());return{'macAddress':_0x345ad6&&_0x345ad6[_0xcace('0xd')]?_0x345ad6['mac']:_0xcace('0xe'),'ipAddress':_0x345ad6&&_0x345ad6[_0xcace('0xf')]?_0x345ad6['address']:_0xcace('0x10')};}exports[_0xcace('0x11')]=getFirstInterface;function getCPUhash(){var _0x1473e3=_[_0xcace('0x6')](os[_0xcace('0x12')]()['map'](function(_0x2a47ce){return _0x2a47ce[_0xcace('0x13')];}))[_0xcace('0x14')](':');return crypto['createHash']('md5')[_0xcace('0x15')](_0x1473e3)[_0xcace('0x16')]('hex');}exports[_0xcace('0x17')]=function(){var _0x187038=os[_0xcace('0x18')]();var _0x1f4286=/[0-9a-f-]{36}/;if(config[_0xcace('0x19')]&&_0x1f4286['test'](config['licenseToken'])){return config[_0xcace('0x19')];}else if(_0x187038==='win32'){return exec(_0xcace('0x1a'),{'encoding':_0xcace('0x1b')})[_0xcace('0x1c')]('\x0d\x0a','');}else{var _0x21a51c=getFirstInterface();var _0x378126=getCPUhash();var _0x17eac8=_0x378126+'|'+os[_0xcace('0x1d')]()+'|'+_0x21a51c['macAddress']+'|'+_0x21a51c[_0xcace('0x1e')];var _0xdb14e6=crypto['createHash'](_0xcace('0x1f'))[_0xcace('0x15')](_0x17eac8)[_0xcace('0x16')]('hex');return _0xdb14e6[_0xcace('0x20')](0x0,0x8)+'-'+_0xdb14e6[_0xcace('0x20')](0x8,0xc)+'-'+_0xdb14e6['substring'](0xc,0x10)+'-'+_0xdb14e6[_0xcace('0x20')](0x10,0x14)+'-'+_0xdb14e6[_0xcace('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4c1489d..b5c3c1a 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 _0x9d94=['encryptString','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','update','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase'];(function(_0x2545d0,_0x244efa){var _0x10e44c=function(_0xdf7181){while(--_0xdf7181){_0x2545d0['push'](_0x2545d0['shift']());}};_0x10e44c(++_0x244efa);}(_0x9d94,0x192));var _0x49d9=function(_0x4a162f,_0x1bd935){_0x4a162f=_0x4a162f-0x0;var _0x74df47=_0x9d94[_0x4a162f];return _0x74df47;};'use strict';var util=require(_0x49d9('0x0'));var moment=require('moment');var rp=require(_0x49d9('0x1'));var BPromise=require(_0x49d9('0x2'));var pkginfo=require(_0x49d9('0x3'))(module,_0x49d9('0x4'));var db=require(_0x49d9('0x5'))['db'];var encryptor=require(_0x49d9('0x6'));var hardware=require(_0x49d9('0x7'));var logger=require(_0x49d9('0x8'))(_0x49d9('0x9'));var HOST=_0x49d9('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1f6df2){return new BPromise(function(_0x4094ea,_0x1c8471){var _0x4f2903=util[_0x49d9('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x1f6df2,module[_0x49d9('0xc')]['version']);if(oldToken){_0x4f2903=util[_0x49d9('0xb')](_0x49d9('0xd'),HOST,_0x1f6df2,module[_0x49d9('0xc')][_0x49d9('0x4')],oldToken);}var _0xc61bad={'uri':_0x4f2903,'method':_0x49d9('0xe'),'timeout':0xea60,'json':!![]};return rp(_0xc61bad)[_0x49d9('0xf')](function(_0x38d8b2){_0x4094ea(_0x38d8b2);})[_0x49d9('0x10')](function(_0x56e764){_0x1c8471(_0x56e764);});});}function manageLicense(_0x1ca261,_0x5c3ebb){var _0x5aadb5=_0x5c3ebb['get']({'plain':!![]});if(!isOldTokenSent&&_0x5aadb5[_0x49d9('0x11')]!==_0x1ca261&&!_0x5aadb5[_0x49d9('0x12')]){oldToken=_0x5aadb5[_0x49d9('0x11')];}httpRequest(_0x1ca261)[_0x49d9('0xf')](function(_0x1e6e70){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1e6e70[_0x49d9('0x13')]){isOldTokenSent=![];if(!_0x5aadb5['license']&&_0x5aadb5[_0x49d9('0x9')]!=_0x1e6e70['license']||_0x5aadb5[_0x49d9('0x9')]&&_0x5aadb5[_0x49d9('0x12')]){logger['info'](_0x49d9('0x14'));}if(_0x5aadb5[_0x49d9('0x9')]&&!_0x5aadb5[_0x49d9('0x12')]&&_0x5aadb5[_0x49d9('0x9')]!=_0x1e6e70[_0x49d9('0x9')]){logger[_0x49d9('0x15')](_0x49d9('0x16'));}if(_0x5aadb5['license']&&!_0x5aadb5[_0x49d9('0x12')]&&_0x5aadb5['license']==_0x1e6e70[_0x49d9('0x9')]){return _0x5c3ebb;}return _0x5c3ebb['update']({'data1':_0x1ca261,'data2':null,'license':_0x1e6e70[_0x49d9('0x9')]});}else{if(_0x1e6e70[_0x49d9('0x9')]||_0x5aadb5[_0x49d9('0x9')]){if(!_0x5aadb5[_0x49d9('0x12')]){if(_0x5aadb5[_0x49d9('0x11')]==_0x1ca261){GRAY_PERIOD_REASON=_0x49d9('0x17');logger[_0x49d9('0x15')](_0x49d9('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x49d9('0x15')](_0x49d9('0x19'),_0x5aadb5[_0x49d9('0x11')],_0x1ca261);}logger[_0x49d9('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x49d9('0x1a')](),moment()[_0x49d9('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x5c3ebb['update']({'data2':encryptor[_0x49d9('0x1b')](moment()[_0x49d9('0xb')](_0x49d9('0x1c')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x5aadb5[_0x49d9('0x12')]),_0x49d9('0x1d'))>DAYS){logger[_0x49d9('0x15')](_0x49d9('0x1e'),moment()[_0x49d9('0xb')](_0x49d9('0x1c')));isOldTokenSent=![];return _0x5c3ebb[_0x49d9('0x1f')]({'data1':_0x1ca261,'data2':null,'license':null});}}}else{if(_0x5aadb5[_0x49d9('0x11')]!=_0x1ca261){logger[_0x49d9('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5aadb5[_0x49d9('0x11')],_0x1ca261);return _0x5c3ebb['update']({'data1':_0x1ca261,'data2':null,'license':null});}}}return _0x5c3ebb;})[_0x49d9('0xf')](function(_0x1f6d0f){_0x5c3ebb=_0x1f6d0f;})[_0x49d9('0x10')](function(_0x1117f3){logger[_0x49d9('0x20')](_0x1117f3[_0x49d9('0x21')]);})[_0x49d9('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x49d9('0x23')](),_0x5c3ebb);},TIME);});}function defaultLicense(){var _0x392086=hardware[_0x49d9('0x23')]();if(_0x392086){return db['License'][_0x49d9('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x392086}})[_0x49d9('0x25')](function(_0xc64b3d,_0x302f65){logger['info'](_0x49d9('0x26'),_0x392086);manageLicense(_0x392086,_0xc64b3d);})['catch'](function(_0x21ac2c){logger[_0x49d9('0x20')](_0x21ac2c[_0x49d9('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x2ee6=['days','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','catch','get','data2','data1','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','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','update','encryptString','diff','decryptString'];(function(_0x3c62ab,_0x33f23d){var _0x536970=function(_0x3a4759){while(--_0x3a4759){_0x3c62ab['push'](_0x3c62ab['shift']());}};_0x536970(++_0x33f23d);}(_0x2ee6,0x170));var _0x62ee=function(_0x1a9e53,_0x2af5d9){_0x1a9e53=_0x1a9e53-0x0;var _0x18aefb=_0x2ee6[_0x1a9e53];return _0x18aefb;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x62ee('0x0'));var BPromise=require('bluebird');var pkginfo=require(_0x62ee('0x1'))(module,_0x62ee('0x2'));var db=require(_0x62ee('0x3'))['db'];var encryptor=require(_0x62ee('0x4'));var hardware=require(_0x62ee('0x5'));var logger=require(_0x62ee('0x6'))(_0x62ee('0x7'));var HOST=_0x62ee('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4499aa){return new BPromise(function(_0x4be466,_0x505cfd){var _0x247499=util[_0x62ee('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x4499aa,module['exports']['version']);if(oldToken){_0x247499=util[_0x62ee('0x9')](_0x62ee('0xa'),HOST,_0x4499aa,module[_0x62ee('0xb')]['version'],oldToken);}var _0x63c2e5={'uri':_0x247499,'method':_0x62ee('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x63c2e5)['then'](function(_0x680018){_0x4be466(_0x680018);})[_0x62ee('0xd')](function(_0x4ee916){_0x505cfd(_0x4ee916);});});}function manageLicense(_0x1feb7d,_0x434c4a){var _0x3a8f63=_0x434c4a[_0x62ee('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3a8f63['data1']!==_0x1feb7d&&!_0x3a8f63[_0x62ee('0xf')]){oldToken=_0x3a8f63[_0x62ee('0x10')];}httpRequest(_0x1feb7d)[_0x62ee('0x11')](function(_0x1a0102){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1a0102[_0x62ee('0x12')]){isOldTokenSent=![];if(!_0x3a8f63['license']&&_0x3a8f63[_0x62ee('0x7')]!=_0x1a0102[_0x62ee('0x7')]||_0x3a8f63[_0x62ee('0x7')]&&_0x3a8f63['data2']){logger['info'](_0x62ee('0x13'));}if(_0x3a8f63[_0x62ee('0x7')]&&!_0x3a8f63['data2']&&_0x3a8f63[_0x62ee('0x7')]!=_0x1a0102['license']){logger[_0x62ee('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3a8f63[_0x62ee('0x7')]&&!_0x3a8f63[_0x62ee('0xf')]&&_0x3a8f63[_0x62ee('0x7')]==_0x1a0102[_0x62ee('0x7')]){return _0x434c4a;}return _0x434c4a['update']({'data1':_0x1feb7d,'data2':null,'license':_0x1a0102[_0x62ee('0x7')]});}else{if(_0x1a0102[_0x62ee('0x7')]||_0x3a8f63[_0x62ee('0x7')]){if(!_0x3a8f63[_0x62ee('0xf')]){if(_0x3a8f63[_0x62ee('0x10')]==_0x1feb7d){GRAY_PERIOD_REASON=_0x62ee('0x15');logger[_0x62ee('0x14')](_0x62ee('0x16'));}else{GRAY_PERIOD_REASON=_0x62ee('0x17');logger[_0x62ee('0x14')](_0x62ee('0x18'),_0x3a8f63[_0x62ee('0x10')],_0x1feb7d);}logger[_0x62ee('0x14')](_0x62ee('0x19'),GRAY_PERIOD_REASON[_0x62ee('0x1a')](),moment()['format'](_0x62ee('0x1b')));return _0x434c4a[_0x62ee('0x1c')]({'data2':encryptor[_0x62ee('0x1d')](moment()[_0x62ee('0x9')](_0x62ee('0x1b')))});}else{if(moment()[_0x62ee('0x1e')](encryptor[_0x62ee('0x1f')](_0x3a8f63['data2']),_0x62ee('0x20'))>DAYS){logger[_0x62ee('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x62ee('0x9')](_0x62ee('0x1b')));isOldTokenSent=![];return _0x434c4a[_0x62ee('0x1c')]({'data1':_0x1feb7d,'data2':null,'license':null});}}}else{if(_0x3a8f63[_0x62ee('0x10')]!=_0x1feb7d){logger[_0x62ee('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3a8f63[_0x62ee('0x10')],_0x1feb7d);return _0x434c4a['update']({'data1':_0x1feb7d,'data2':null,'license':null});}}}return _0x434c4a;})['then'](function(_0x5df967){_0x434c4a=_0x5df967;})[_0x62ee('0xd')](function(_0x1afc42){logger[_0x62ee('0x21')](_0x1afc42[_0x62ee('0x22')]);})[_0x62ee('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x62ee('0x24')](),_0x434c4a);},TIME);});}function defaultLicense(){var _0x418935=hardware[_0x62ee('0x24')]();if(_0x418935){return db['License'][_0x62ee('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x418935}})[_0x62ee('0x26')](function(_0x9b7217,_0x56367b){logger['info'](_0x62ee('0x27'),_0x418935);manageLicense(_0x418935,_0x9b7217);})[_0x62ee('0xd')](function(_0x3c97b3){logger[_0x62ee('0x21')](_0x3c97b3[_0x62ee('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9680240..601aa81 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 _0xae30=['data1','license','isEmpty','split','decryptString','parse','demo','uuid','deadline','format','machineUuid','changed','disabled','message','User','role','sequelize','COUNT','admin','user','telephone','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch'];(function(_0x12ec91,_0x26e8bc){var _0x40a94c=function(_0x193a91){while(--_0x193a91){_0x12ec91['push'](_0x12ec91['shift']());}};_0x40a94c(++_0x26e8bc);}(_0xae30,0xba));var _0x0ae3=function(_0x4cfd78,_0x52355e){_0x4cfd78=_0x4cfd78-0x0;var _0xf4a95a=_0xae30[_0x4cfd78];return _0xf4a95a;};'use strict';var util=require('util');var _=require(_0x0ae3('0x0'));var moment=require(_0x0ae3('0x1'));var BPromise=require(_0x0ae3('0x2'));var hardware=require(_0x0ae3('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x0ae3('0x4'))['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':_0x0ae3('0x5'),'machineUuid':hardware[_0x0ae3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0ae3('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0ae3('0x8'),'machineUuid':hardware[_0x0ae3('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4914d0){return new BPromise(function(_0x4a09c2,_0x4edce5){return db[_0x0ae3('0x9')][_0x0ae3('0xa')](_[_0x0ae3('0xb')](_0x4914d0,{'raw':!![],'where':{'id':0x1}}))[_0x0ae3('0xc')](function(_0x21983f){return checkLicense(_0x21983f,null);})['then'](function(_0x11481a){_0x4a09c2(_0x11481a);return;})[_0x0ae3('0xd')](function(_0x5bdc37){_0x4edce5(_0x5bdc37);});});}function checkLicense(_0x4ef334,_0x23c1e6){if(!_0x4ef334){demoLicense['uuid']=_0x4ef334[_0x0ae3('0xe')];return demoLicense;}try{var _0x517e8b=_0x23c1e6||_0x4ef334[_0x0ae3('0xf')];if(_[_0x0ae3('0x10')](_0x517e8b)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5c16ac=_0x4ef334[_0x0ae3('0xe')];var _0x4ecd11=_0x4ef334['data2'];var _0x25b353=_0x5c16ac[_0x0ae3('0x11')]('-')[0x4];var _0x3b2d33=_0x5c16ac[_0x0ae3('0x11')]('-')[0x0];var _0x1101bc=encryptor[_0x0ae3('0x12')](_0x517e8b,util['format']('%s:%s:%s',_0x25b353,_0x5c16ac,_0x3b2d33));var _0x3b7f8c=JSON[_0x0ae3('0x13')](_0x1101bc);_0x3b7f8c[_0x0ae3('0x14')]=![];_0x3b7f8c[_0x0ae3('0x15')]=_0x5c16ac;_0x3b7f8c['machineUuid']=hardware[_0x0ae3('0x6')]();if(_0x4ecd11){var _0x5aa724=encryptor[_0x0ae3('0x12')](_0x4ecd11);_0x3b7f8c['gray']=_0x5aa724;_0x3b7f8c[_0x0ae3('0x16')]=moment(_0x5aa724)['add'](0x7,'days')[_0x0ae3('0x17')]();_0x3b7f8c['grayReason']=_0x3b7f8c[_0x0ae3('0x15')]!=_0x3b7f8c[_0x0ae3('0x18')]?_0x0ae3('0x19'):_0x0ae3('0x1a');}return _0x3b7f8c;}catch(_0x4de0e6){breakingLicense[_0x0ae3('0x15')]=_0x4ef334['data1'];breakingLicense[_0x0ae3('0x1b')]=_0x4de0e6['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2063ac,_0x17cc80){getLicense()[_0x0ae3('0xc')](function(_0x504a40){return db[_0x0ae3('0x1c')]['findAll']({'attributes':[_0x0ae3('0x1d'),[db[_0x0ae3('0x1e')]['fn'](_0x0ae3('0x1f'),db[_0x0ae3('0x1e')]['col'](_0x0ae3('0x1d'))),'count']],'group':_0x0ae3('0x1d'),'where':{'role':{'$or':[_0x0ae3('0x20'),_0x0ae3('0x21'),_0x0ae3('0x22')]}},'raw':!![]})[_0x0ae3('0xc')](function(_0x283f47){var _0x5aea14={'user':_0x504a40['users']||0x0,'telephone':_0x504a40['telephones']||0x0};_0x283f47[_0x0ae3('0x23')](function(_0x4f0e68){var _0xe98208=_0x4f0e68[_0x0ae3('0x1d')]==='admin'?_0x0ae3('0x21'):_0x4f0e68[_0x0ae3('0x1d')];_0x5aea14[_0xe98208]-=_0x4f0e68['count'];if(_0x5aea14[_0xe98208]<0x0)_0x5aea14[_0xe98208]=0x0;});_0x2063ac(_0x5aea14);return;});})[_0x0ae3('0xd')](function(_0x52fbb9){_0x17cc80(_0x52fbb9);});});}function checkUserLimits(_0x2d312c){return new BPromise(function(_0x350b0a,_0x34f605){getLimits()['then'](function(_0x8fbd05){var _0x3d9faa=_[_0x0ae3('0x24')](_[_0x0ae3('0x25')](_0x2d312c,_0x0ae3('0x1d')),[_0x0ae3('0x20'),_0x0ae3('0x21'),'telephone']);var _0x21b570=(_0x3d9faa[_0x0ae3('0x20')]||0x0)+(_0x3d9faa[_0x0ae3('0x21')]||0x0);var _0xa84e7b=_0x3d9faa[_0x0ae3('0x22')]||0x0;if(_0x21b570>_0x8fbd05[_0x0ae3('0x21')])return _0x34f605(_0x0ae3('0x26'));if(_0xa84e7b>_0x8fbd05[_0x0ae3('0x22')])return _0x34f605('License\x20limit\x20reached\x20for\x20telephones');return _0x350b0a();})[_0x0ae3('0xd')](function(_0x472f6f){_0x34f605(_0x472f6f);});});}module[_0x0ae3('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x8bba=['add','days','grayReason','changed','disabled','message','User','sequelize','COUNT','count','role','admin','user','telephone','users','telephones','forEach','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline'];(function(_0x3d697d,_0x3930cd){var _0xf7a22a=function(_0x41fdb2){while(--_0x41fdb2){_0x3d697d['push'](_0x3d697d['shift']());}};_0xf7a22a(++_0x3930cd);}(_0x8bba,0xa8));var _0xa8bb=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x8bba[_0x26b80e];return _0x84a8a8;};'use strict';var util=require(_0xa8bb('0x0'));var _=require(_0xa8bb('0x1'));var moment=require(_0xa8bb('0x2'));var BPromise=require(_0xa8bb('0x3'));var hardware=require(_0xa8bb('0x4'));var encryptor=require(_0xa8bb('0x5'));var db=require(_0xa8bb('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa8bb('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa8bb('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa8bb('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa8bb('0x9'),'machineUuid':hardware[_0xa8bb('0xa')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3d5e54){return new BPromise(function(_0x2473c0,_0x3038c6){return db['License'][_0xa8bb('0xb')](_[_0xa8bb('0xc')](_0x3d5e54,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1d4f45){return checkLicense(_0x1d4f45,null);})[_0xa8bb('0xd')](function(_0x1d67cb){_0x2473c0(_0x1d67cb);return;})[_0xa8bb('0xe')](function(_0x4f50f6){_0x3038c6(_0x4f50f6);});});}function checkLicense(_0x21ade6,_0x4d9066){if(!_0x21ade6){demoLicense[_0xa8bb('0xf')]=_0x21ade6[_0xa8bb('0x10')];return demoLicense;}try{var _0x555704=_0x4d9066||_0x21ade6[_0xa8bb('0x11')];if(_[_0xa8bb('0x12')](_0x555704)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x120a48=_0x21ade6[_0xa8bb('0x10')];var _0x28016f=_0x21ade6['data2'];var _0x250533=_0x120a48[_0xa8bb('0x13')]('-')[0x4];var _0x229f8f=_0x120a48['split']('-')[0x0];var _0x78be5f=encryptor[_0xa8bb('0x14')](_0x555704,util[_0xa8bb('0x15')](_0xa8bb('0x16'),_0x250533,_0x120a48,_0x229f8f));var _0x249974=JSON[_0xa8bb('0x17')](_0x78be5f);_0x249974[_0xa8bb('0x18')]=![];_0x249974['uuid']=_0x120a48;_0x249974[_0xa8bb('0x19')]=hardware['getUuid']();if(_0x28016f){var _0x2d9fe9=encryptor['decryptString'](_0x28016f);_0x249974[_0xa8bb('0x1a')]=_0x2d9fe9;_0x249974[_0xa8bb('0x1b')]=moment(_0x2d9fe9)[_0xa8bb('0x1c')](0x7,_0xa8bb('0x1d'))[_0xa8bb('0x15')]();_0x249974[_0xa8bb('0x1e')]=_0x249974[_0xa8bb('0xf')]!=_0x249974[_0xa8bb('0x19')]?_0xa8bb('0x1f'):_0xa8bb('0x20');}return _0x249974;}catch(_0x84a5ba){breakingLicense['uuid']=_0x21ade6[_0xa8bb('0x10')];breakingLicense[_0xa8bb('0x21')]=_0x84a5ba[_0xa8bb('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x12da22,_0x1a43aa){getLicense()[_0xa8bb('0xd')](function(_0x364b92){return db[_0xa8bb('0x22')]['findAll']({'attributes':['role',[db[_0xa8bb('0x23')]['fn'](_0xa8bb('0x24'),db[_0xa8bb('0x23')]['col']('role')),_0xa8bb('0x25')]],'group':_0xa8bb('0x26'),'where':{'role':{'$or':[_0xa8bb('0x27'),_0xa8bb('0x28'),_0xa8bb('0x29')]}},'raw':!![]})[_0xa8bb('0xd')](function(_0x1af5e1){var _0x398c6b={'user':_0x364b92[_0xa8bb('0x2a')]||0x0,'telephone':_0x364b92[_0xa8bb('0x2b')]||0x0};_0x1af5e1[_0xa8bb('0x2c')](function(_0x4d4fbe){var _0x900739=_0x4d4fbe[_0xa8bb('0x26')]===_0xa8bb('0x27')?'user':_0x4d4fbe[_0xa8bb('0x26')];_0x398c6b[_0x900739]-=_0x4d4fbe[_0xa8bb('0x25')];if(_0x398c6b[_0x900739]<0x0)_0x398c6b[_0x900739]=0x0;});_0x12da22(_0x398c6b);return;});})[_0xa8bb('0xe')](function(_0x8dc115){_0x1a43aa(_0x8dc115);});});}function checkUserLimits(_0x3df09f){return new BPromise(function(_0x15527d,_0x18db56){getLimits()[_0xa8bb('0xd')](function(_0x49a5de){var _0x5544a1=_[_0xa8bb('0x2d')](_['countBy'](_0x3df09f,'role'),[_0xa8bb('0x27'),_0xa8bb('0x28'),_0xa8bb('0x29')]);var _0x451bbf=(_0x5544a1[_0xa8bb('0x27')]||0x0)+(_0x5544a1[_0xa8bb('0x28')]||0x0);var _0x5f510c=_0x5544a1[_0xa8bb('0x29')]||0x0;if(_0x451bbf>_0x49a5de[_0xa8bb('0x28')])return _0x18db56(_0xa8bb('0x2e'));if(_0x5f510c>_0x49a5de[_0xa8bb('0x29')])return _0x18db56(_0xa8bb('0x2f'));return _0x15527d();})[_0xa8bb('0xe')](function(_0x200563){_0x18db56(_0x200563);});});}module[_0xa8bb('0x30')]={'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 3ab2a22..f3dcf7e 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 _0xb574=['app-id','secret','exports','http://localhost:9000'];(function(_0x472ccd,_0x249697){var _0x15440f=function(_0x1b44fa){while(--_0x1b44fa){_0x472ccd['push'](_0x472ccd['shift']());}};_0x15440f(++_0x249697);}(_0xb574,0x106));var _0x4b57=function(_0x161951,_0x2e6359){_0x161951=_0x161951-0x0;var _0x9e8192=_0xb574[_0x161951];return _0x9e8192;};'use strict';module[_0x4b57('0x0')]={'DOMAIN':_0x4b57('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4b57('0x2'),'GOOGLE_SECRET':_0x4b57('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xdd4f=['exports','secret'];(function(_0x3d384c,_0x3cbdb5){var _0x1599f2=function(_0x65c1ef){while(--_0x65c1ef){_0x3d384c['push'](_0x3d384c['shift']());}};_0x1599f2(++_0x3cbdb5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x24821a,_0x1ed95b){_0x24821a=_0x24821a-0x0;var _0x42b387=_0xdd4f[_0x24821a];return _0x42b387;};'use strict';module[_0xfdd4('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfdd4('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d9c9181..adc222d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94c6=['level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','/var','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x39e1d4,_0x3c2ed7){var _0x380b2d=function(_0xb3a7ce){while(--_0xb3a7ce){_0x39e1d4['push'](_0x39e1d4['shift']());}};_0x380b2d(++_0x3c2ed7);}(_0x94c6,0xa2));var _0x694c=function(_0x5ec57f,_0x3d8560){_0x5ec57f=_0x5ec57f-0x0;var _0x456e84=_0x94c6[_0x5ec57f];return _0x456e84;};'use strict';var moment=require(_0x694c('0x0'));var winston=require(_0x694c('0x1'));var util=require(_0x694c('0x2'));var path=require(_0x694c('0x3'));var debugLevel=_0x694c('0x4');function filename(_0x205d39,_0x5f3c21){return path['join'](_0x694c('0x5'),'log',_0x694c('0x6'),util[_0x694c('0x7')](_0x694c('0x8'),_0x205d39,_0x5f3c21));}function formatter(_0xa8dfd2,_0x821c06){_0x821c06[_0x694c('0x9')]=_0x821c06['message'][_0x694c('0xa')](/@@{/g,'{{{')[_0x694c('0xa')](/}@@/g,_0x694c('0xb'))[_0x694c('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x694c('0x7')](_0x694c('0xc'),moment()[_0x694c('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x821c06[_0x694c('0xd')][_0x694c('0xe')](),_0xa8dfd2,_0x821c06[_0x694c('0x9')]);}module[_0x694c('0xf')]=function(_0xb7d172){return new winston[(_0x694c('0x10'))]({'transports':[new winston[(_0x694c('0x11'))][(_0x694c('0x12'))]({'name':util[_0x694c('0x7')](_0x694c('0x13'),_0xb7d172,_0x694c('0x14')),'filename':filename(_0xb7d172,_0x694c('0x14')),'level':_0x694c('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x197e19){return formatter(_0xb7d172,_0x197e19);}}),new winston[(_0x694c('0x11'))]['File']({'name':util[_0x694c('0x7')](_0x694c('0x13'),_0xb7d172,'info'),'filename':filename(_0xb7d172,_0x694c('0x15')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c1b8b){return formatter(_0xb7d172,_0x1c1b8b);}}),new winston[(_0x694c('0x11'))][(_0x694c('0x16'))]({'level':process[_0x694c('0x17')][_0x694c('0x18')]||debugLevel,'json':![],'formatter':function(_0x31492a){return formatter(_0xb7d172,_0x31492a);}})]});}; \ No newline at end of file +var _0x5a79=['transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','INFO','join','/var','log','xcally','format','%s-%s.log','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','Logger'];(function(_0x552b03,_0x2c6155){var _0x23636f=function(_0xdaffc7){while(--_0xdaffc7){_0x552b03['push'](_0x552b03['shift']());}};_0x23636f(++_0x2c6155);}(_0x5a79,0x1c0));var _0x95a7=function(_0x21a1a6,_0x1474bf){_0x21a1a6=_0x21a1a6-0x0;var _0x5cec0e=_0x5a79[_0x21a1a6];return _0x5cec0e;};'use strict';var moment=require(_0x95a7('0x0'));var winston=require('winston');var util=require(_0x95a7('0x1'));var path=require('path');var debugLevel=_0x95a7('0x2');function filename(_0x4f069d,_0x1837e9){return path[_0x95a7('0x3')](_0x95a7('0x4'),_0x95a7('0x5'),_0x95a7('0x6'),util[_0x95a7('0x7')](_0x95a7('0x8'),_0x4f069d,_0x1837e9));}function formatter(_0x4b2031,_0x5d863d){_0x5d863d[_0x95a7('0x9')]=_0x5d863d[_0x95a7('0x9')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x95a7('0xa'))['replace'](/@{/g,'{{')[_0x95a7('0xb')](/}@/g,'}}');return util[_0x95a7('0x7')](_0x95a7('0xc'),moment()[_0x95a7('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5d863d['level']['toUpperCase'](),_0x4b2031,_0x5d863d[_0x95a7('0x9')]);}module['exports']=function(_0x513cc2){return new winston[(_0x95a7('0xd'))]({'transports':[new winston[(_0x95a7('0xe'))][(_0x95a7('0xf'))]({'name':util[_0x95a7('0x7')](_0x95a7('0x10'),_0x513cc2,'error'),'filename':filename(_0x513cc2,_0x95a7('0x11')),'level':_0x95a7('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x272537){return formatter(_0x513cc2,_0x272537);}}),new winston[(_0x95a7('0xe'))][(_0x95a7('0xf'))]({'name':util['format']('%s-%s',_0x513cc2,'info'),'filename':filename(_0x513cc2,_0x95a7('0x12')),'level':_0x95a7('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4bb4d7){return formatter(_0x513cc2,_0x4bb4d7);}}),new winston[(_0x95a7('0xe'))][(_0x95a7('0x13'))]({'level':process[_0x95a7('0x14')][_0x95a7('0x15')]||debugLevel,'json':![],'formatter':function(_0x2e122c){return formatter(_0x513cc2,_0x2e122c);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 77adca3..4cb61c7 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 _0xe6c7=['join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','exports','express','../../services/express/index.js','ami'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xe6c7,0x6b));var _0x7e6c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe6c7[_0x2c91e9];return _0x13f0ff;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x7e6c('0x0'),'script':path['join'](__dirname,_0x7e6c('0x1'))},{'name':_0x7e6c('0x2'),'script':path[_0x7e6c('0x3')](__dirname,_0x7e6c('0x4'))},{'name':'agi','script':path[_0x7e6c('0x3')](__dirname,_0x7e6c('0x5'))},{'name':_0x7e6c('0x6'),'script':path['join'](__dirname,_0x7e6c('0x7'))},{'name':_0x7e6c('0x8'),'script':path[_0x7e6c('0x3')](__dirname,_0x7e6c('0x9'))},{'name':'xdr','script':path[_0x7e6c('0x3')](__dirname,'../../services/xdr/index.js')}]};module[_0x7e6c('0xa')]=config; \ No newline at end of file +var _0x4caa=['email','../../services/email/index.js','routing','xdr','exports','path','express','join','agi','../../services/agi/index.js'];(function(_0x16325b,_0x19f311){var _0x33c1e8=function(_0x22e80d){while(--_0x22e80d){_0x16325b['push'](_0x16325b['shift']());}};_0x33c1e8(++_0x19f311);}(_0x4caa,0x16d));var _0xa4ca=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0x4caa[_0x522c6d];return _0x26300d;};'use strict';var path=require(_0xa4ca('0x0'));var os=require('os');var config={'apps':[{'name':_0xa4ca('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xa4ca('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xa4ca('0x3'),'script':path[_0xa4ca('0x2')](__dirname,_0xa4ca('0x4'))},{'name':_0xa4ca('0x5'),'script':path[_0xa4ca('0x2')](__dirname,_0xa4ca('0x6'))},{'name':_0xa4ca('0x7'),'script':path[_0xa4ca('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0xa4ca('0x8'),'script':path[_0xa4ca('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xa4ca('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b20ff10..e0114ee 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 _0x5613=['then','disconnect','stop','restart','list','describe','delete','saved','pm2','bluebird','./config','connected','start'];(function(_0x2ddf01,_0x44ec6e){var _0x1e2ac5=function(_0x4d016a){while(--_0x4d016a){_0x2ddf01['push'](_0x2ddf01['shift']());}};_0x1e2ac5(++_0x44ec6e);}(_0x5613,0x119));var _0x3561=function(_0x183d73,_0x5b8823){_0x183d73=_0x183d73-0x0;var _0x4429f3=_0x5613[_0x183d73];return _0x4429f3;};'use strict';var pm2=require(_0x3561('0x0'));var BPromise=require(_0x3561('0x1'));var config=require(_0x3561('0x2'));function connect(){return new BPromise(function(_0x24fab1,_0x15e1e1){return pm2['connect'](function(_0x5905cc){if(_0x5905cc){return _0x15e1e1(_0x5905cc);}return _0x24fab1(_0x3561('0x3'));});});};exports[_0x3561('0x4')]=function(_0x1bd737){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x2f5f36,_0x47c29d){return pm2[_0x3561('0x4')](_0x1bd737,function(_0x1a05b0,_0x3ed2c7){if(_0x1a05b0){return _0x47c29d(_0x1a05b0);}pm2[_0x3561('0x6')]();return _0x2f5f36(_0x3ed2c7);});});});};exports[_0x3561('0x7')]=function(_0x38a804){return connect()['then'](function(){return new BPromise(function(_0x1bd223,_0x551087){return pm2[_0x3561('0x7')](_0x38a804,function(_0x470b77,_0x2fbfa1){if(_0x470b77){return _0x551087(_0x470b77);}pm2[_0x3561('0x6')]();return _0x1bd223(_0x2fbfa1);});});});};exports['restart']=function(_0xf767c5){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x254d20,_0x44c865){return pm2[_0x3561('0x8')](_0xf767c5,function(_0x9df362,_0x308493){if(_0x9df362){return _0x44c865(_0x9df362);}pm2['disconnect']();return _0x254d20(_0x308493);});});});};exports[_0x3561('0x9')]=function(){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x551590,_0xe77e0a){return pm2['list'](function(_0x5a7ec3,_0x346d60){if(_0x5a7ec3){return _0xe77e0a(_0x5a7ec3);}pm2[_0x3561('0x6')]();return _0x551590(_0x346d60);});});});};exports[_0x3561('0xa')]=function(_0x2afc49){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x42e5ae,_0xf04d58){return pm2['describe'](_0x2afc49,function(_0x2e3440,_0x2bdb0c){if(_0x2e3440){return _0xf04d58(_0x2e3440);}pm2[_0x3561('0x6')]();return _0x42e5ae(_0x2bdb0c);});});});};exports['delete']=function(_0x4ac33a){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x313708,_0x3db5f8){return pm2[_0x3561('0xb')](_0x4ac33a,function(_0xbfc78d,_0x5cdd63){if(_0xbfc78d){return _0x3db5f8(_0xbfc78d);}pm2['disconnect']();return _0x313708(_0x5cdd63);});});});};exports['dump']=function(){return connect()[_0x3561('0x5')](function(){return new BPromise(function(_0x349da3,_0x57a37e){return pm2['dump'](function(_0x4f0560){if(_0x4f0560){return _0x57a37e(_0x4f0560);}return _0x349da3(_0x3561('0xc'));});});});}; \ No newline at end of file +var _0x6970=['start','disconnect','stop','restart','then','list','describe','delete','dump','saved','./config','connect','connected'];(function(_0x105d05,_0x496a37){var _0x2e31ed=function(_0x2233bd){while(--_0x2233bd){_0x105d05['push'](_0x105d05['shift']());}};_0x2e31ed(++_0x496a37);}(_0x6970,0xcd));var _0x0697=function(_0x35cb4d,_0x112fe3){_0x35cb4d=_0x35cb4d-0x0;var _0x2f9985=_0x6970[_0x35cb4d];return _0x2f9985;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x0697('0x0'));function connect(){return new BPromise(function(_0x16a7e2,_0x463dc3){return pm2[_0x0697('0x1')](function(_0x1f4f45){if(_0x1f4f45){return _0x463dc3(_0x1f4f45);}return _0x16a7e2(_0x0697('0x2'));});});};exports['start']=function(_0x27b16d){return connect()['then'](function(){return new BPromise(function(_0x216a9a,_0x5d7712){return pm2[_0x0697('0x3')](_0x27b16d,function(_0x2ce435,_0x2f6ab6){if(_0x2ce435){return _0x5d7712(_0x2ce435);}pm2[_0x0697('0x4')]();return _0x216a9a(_0x2f6ab6);});});});};exports[_0x0697('0x5')]=function(_0x54a3d4){return connect()['then'](function(){return new BPromise(function(_0x3cc49f,_0x1630ac){return pm2['stop'](_0x54a3d4,function(_0x4508e9,_0x58e1f2){if(_0x4508e9){return _0x1630ac(_0x4508e9);}pm2['disconnect']();return _0x3cc49f(_0x58e1f2);});});});};exports[_0x0697('0x6')]=function(_0x2b513c){return connect()[_0x0697('0x7')](function(){return new BPromise(function(_0xc1091c,_0x4544e4){return pm2[_0x0697('0x6')](_0x2b513c,function(_0x3920a0,_0xd51f13){if(_0x3920a0){return _0x4544e4(_0x3920a0);}pm2['disconnect']();return _0xc1091c(_0xd51f13);});});});};exports[_0x0697('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x189c7d,_0xf2b67e){return pm2['list'](function(_0x5e54d9,_0x1c097f){if(_0x5e54d9){return _0xf2b67e(_0x5e54d9);}pm2[_0x0697('0x4')]();return _0x189c7d(_0x1c097f);});});});};exports[_0x0697('0x9')]=function(_0x326192){return connect()[_0x0697('0x7')](function(){return new BPromise(function(_0x56fd39,_0x6337c6){return pm2[_0x0697('0x9')](_0x326192,function(_0x144afc,_0x11bc41){if(_0x144afc){return _0x6337c6(_0x144afc);}pm2[_0x0697('0x4')]();return _0x56fd39(_0x11bc41);});});});};exports['delete']=function(_0x4f32b7){return connect()[_0x0697('0x7')](function(){return new BPromise(function(_0x165bfd,_0x405542){return pm2[_0x0697('0xa')](_0x4f32b7,function(_0x5ee275,_0x18a4c1){if(_0x5ee275){return _0x405542(_0x5ee275);}pm2[_0x0697('0x4')]();return _0x165bfd(_0x18a4c1);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x392f61,_0x4e8616){return pm2[_0x0697('0xb')](function(_0x5f169a){if(_0x5f169a){return _0x4e8616(_0x5f169a);}return _0x392f61(_0x0697('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 317628e..ab5550f 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 _0xfe3b=['Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x26957a,_0x14ace1){var _0x2fe020=function(_0x3334c6){while(--_0x3334c6){_0x26957a['push'](_0x26957a['shift']());}};_0x2fe020(++_0x14ace1);}(_0xfe3b,0x1a9));var _0xbfe3=function(_0x3068c8,_0x1f5504){_0x3068c8=_0x3068c8-0x0;var _0x40c6e4=_0xfe3b[_0x3068c8];return _0x40c6e4;};'use strict';var _=require(_0xbfe3('0x0'));var moment=require(_0xbfe3('0x1'));var Redis=require(_0xbfe3('0x2'));var util=require(_0xbfe3('0x3'));var config=require(_0xbfe3('0x4'));var db=require(_0xbfe3('0x5'))['db'];var logger=require('../logger')('schedule');config[_0xbfe3('0x6')]=_['defaults'](config[_0xbfe3('0x6')],{'host':_0xbfe3('0x7'),'port':0x18eb});var io=require(_0xbfe3('0x8'))(new Redis(config[_0xbfe3('0x6')]));function closeInteractions(){var _0x2f70ef=0x0;var _0x5448fe=[];return db[_0xbfe3('0x9')]['find']({'raw':!![],'attributes':['id',_0xbfe3('0xa')],'where':{'id':0x1}})[_0xbfe3('0xb')](function(_0x3e8c32){_0x2f70ef=_0x3e8c32[_0xbfe3('0xa')];if(_0x2f70ef){return db[_0xbfe3('0xc')][_0xbfe3('0xd')]({'raw':!![],'attributes':['id',_0xbfe3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3e8c32[_0xbfe3('0xa')],'minutes')}}});}else{return[];}})[_0xbfe3('0xb')](function(_0x3b4d8f){if(_0x3b4d8f&&_0x3b4d8f[_0xbfe3('0xf')]){_0x5448fe=_[_0xbfe3('0x10')](_0x3b4d8f||[],'id');logger[_0xbfe3('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x5448fe[_0xbfe3('0x12')]());return db['ChatInteraction'][_0xbfe3('0x13')]({'closeReason':_0xbfe3('0x14'),'disposition':_0xbfe3('0x15'),'closed':!![],'closedAt':moment()[_0xbfe3('0x16')](_0xbfe3('0x17'))},{'where':{'id':_0x5448fe}});}})[_0xbfe3('0xb')](function(){if(_0x5448fe&&_0x5448fe['length']){logger[_0xbfe3('0x11')](_0xbfe3('0x18'),_0x5448fe[_0xbfe3('0x12')]());for(var _0x1bd948=0x0;_0x1bd948<_0x5448fe[_0xbfe3('0xf')];_0x1bd948++){io[_0xbfe3('0x19')](_0xbfe3('0x1a'),{'id':_0x5448fe[_0x1bd948],'closed':!![]});}}})['catch'](function(_0x5bf5a8){logger[_0xbfe3('0x1b')](_0xbfe3('0x1c'),_0x5bf5a8?util[_0xbfe3('0x1d')](_0x5bf5a8,{'showHidden':![],'depth':null}):'');});}exports[_0xbfe3('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7b68=['length','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','subtract','minutes','then','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7b68,0xc8));var _0x87b6=function(_0x36b329,_0x11eec1){_0x36b329=_0x36b329-0x0;var _0x352ba6=_0x7b68[_0x36b329];return _0x352ba6;};'use strict';var _=require(_0x87b6('0x0'));var moment=require(_0x87b6('0x1'));var Redis=require(_0x87b6('0x2'));var util=require('util');var config=require(_0x87b6('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x87b6('0x4'));config[_0x87b6('0x5')]=_[_0x87b6('0x6')](config['redis'],{'host':_0x87b6('0x7'),'port':0x18eb});var io=require(_0x87b6('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x3bede9=0x0;var _0x372949=[];return db[_0x87b6('0x9')][_0x87b6('0xa')]({'raw':!![],'attributes':['id',_0x87b6('0xb')],'where':{'id':0x1}})['then'](function(_0x1053ba){_0x3bede9=_0x1053ba[_0x87b6('0xb')];if(_0x3bede9){return db[_0x87b6('0xc')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x87b6('0xd')](_0x1053ba[_0x87b6('0xb')],_0x87b6('0xe'))}}});}else{return[];}})[_0x87b6('0xf')](function(_0x1dc60a){if(_0x1dc60a&&_0x1dc60a['length']){_0x372949=_[_0x87b6('0x10')](_0x1dc60a||[],'id');logger['info'](_0x87b6('0x11'),_0x372949[_0x87b6('0x12')]());return db[_0x87b6('0xc')][_0x87b6('0x13')]({'closeReason':_0x87b6('0x14'),'disposition':_0x87b6('0x15'),'closed':!![],'closedAt':moment()[_0x87b6('0x16')](_0x87b6('0x17'))},{'where':{'id':_0x372949}});}})[_0x87b6('0xf')](function(){if(_0x372949&&_0x372949[_0x87b6('0x18')]){logger[_0x87b6('0x19')](_0x87b6('0x1a'),_0x372949[_0x87b6('0x12')]());for(var _0x2e6dfe=0x0;_0x2e6dfe<_0x372949[_0x87b6('0x18')];_0x2e6dfe++){io[_0x87b6('0x1b')]('chatInteraction:update',{'id':_0x372949[_0x2e6dfe],'closed':!![]});}}})[_0x87b6('0x1c')](function(_0x55a61d){logger['error'](_0x87b6('0x1d'),_0x55a61d?util[_0x87b6('0x1e')](_0x55a61d,{'showHidden':![],'depth':null}):'');});}exports[_0x87b6('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 904c551..240a6d8 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 _0x3b30=['jobs','map','toString','keyBy','intersection','length','exists','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','startAt','add','start','add\x20cron','stop','active','isBetween','endAt','stop\x20cron','run','util','path','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','../../files/reports','%s.%s','savename','extname','Sent','message','attachments','format','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x3b30,0xd0));var _0x03b3=function(_0x2f592d,_0x3f3808){_0x2f592d=_0x2f592d-0x0;var _0x5bc5be=_0x3b30[_0x2f592d];return _0x5bc5be;};'use strict';var fs=require('fs');var util=require(_0x03b3('0x0'));var path=require(_0x03b3('0x1'));var _=require(_0x03b3('0x2'));var moment=require(_0x03b3('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x03b3('0x4'));var BPromise=require('bluebird');var logger=require(_0x03b3('0x5'))(_0x03b3('0x6'));var db=require(_0x03b3('0x7'))['db'];var analyticCustomReportController=require(_0x03b3('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x03b3('0x9')][_0x03b3('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3b2dc1,_0x384205){return function(){logger[_0x03b3('0xb')](_0x03b3('0xc'),_0x3b2dc1[_0x03b3('0xd')]);var _0x4cbb56=!![];var _0x1ef941={'tls':{'rejectUnauthorized':![]}};if(_0x3b2dc1[_0x03b3('0xe')][_0x03b3('0xf')][_0x03b3('0x10')]){_0x1ef941['service']=_0x3b2dc1[_0x03b3('0xe')]['Smtp'][_0x03b3('0x10')];}else{_0x1ef941[_0x03b3('0x11')]=_0x3b2dc1[_0x03b3('0xe')]['Smtp']['host'];_0x1ef941['port']=_0x3b2dc1[_0x03b3('0xe')]['Smtp'][_0x03b3('0x12')];_0x1ef941[_0x03b3('0x13')]=_0x3b2dc1['MailAccount'][_0x03b3('0xf')][_0x03b3('0x13')];}if(_0x3b2dc1[_0x03b3('0xe')][_0x03b3('0xf')][_0x03b3('0x14')]){_0x1ef941[_0x03b3('0x15')]={'user':_0x3b2dc1[_0x03b3('0xe')][_0x03b3('0xf')]['user'],'pass':_0x3b2dc1[_0x03b3('0xe')][_0x03b3('0xf')]['pass']};}var _0x3141a1={'account':_0x1ef941,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3b2dc1[_0x03b3('0xe')]['name'],_0x3b2dc1[_0x03b3('0xe')][_0x03b3('0xd')]||_0x3b2dc1['MailAccount'][_0x03b3('0xf')][_0x03b3('0x16')]),'to':_0x3b2dc1['email'],'cc':_0x3b2dc1['cc'],'bcc':_0x3b2dc1[_0x03b3('0x17')],'subject':util['format'](_0x03b3('0x18'),_0x384205[_0x03b3('0x19')],_0x3b2dc1[_0x03b3('0x1a')],_0x3b2dc1['subtractUnit'])}};var _0x329d0b=path[_0x03b3('0x1b')](__dirname,_0x03b3('0x1c'));var _0x1cecb5=_0x384205['savename'];var _0x1ba6de=util['format'](_0x03b3('0x1d'),path['basename'](_0x384205[_0x03b3('0x1e')],path[_0x03b3('0x1f')](_0x384205[_0x03b3('0x1e')])),'zip');var _0x540d1e=path[_0x03b3('0x1b')](_0x329d0b,_0x1cecb5);var _0x2060dd=path[_0x03b3('0x1b')](_0x329d0b,_0x1ba6de);if(fs['existsSync'](_0x540d1e)){_0x384205['status']=_0x03b3('0x20');_0x3141a1[_0x03b3('0x21')][_0x03b3('0x22')]=[{'filename':_0x1cecb5,'path':_0x540d1e}];_0x3141a1[_0x03b3('0x21')]['text']=util[_0x03b3('0x23')](_0x03b3('0x24'),JSON[_0x03b3('0x25')](_0x384205,null,0x2));}else if(fs[_0x03b3('0x26')](_0x2060dd)){_0x384205[_0x03b3('0x27')]='Sent';_0x3141a1[_0x03b3('0x21')][_0x03b3('0x22')]=[{'filename':_0x1ba6de,'path':_0x2060dd}];}else{_0x3141a1[_0x03b3('0x21')][_0x03b3('0x28')]=_0x03b3('0x29');if(!_0x3b2dc1['sendIfEmpty']){_0x4cbb56=![];logger[_0x03b3('0xb')](_0x03b3('0x2a'));}}if(_0x4cbb56){return client[_0x03b3('0x2b')](_0x03b3('0x2c'),_0x3141a1)['then'](function(_0x378677){if(_0x378677[_0x03b3('0x2d')]){return logger['error'](_0x03b3('0x2e'),JSON[_0x03b3('0x25')](_0x378677));}return logger[_0x03b3('0xb')](_0x03b3('0x2f'));})[_0x03b3('0x30')](function(_0x3f909d){return logger[_0x03b3('0x2d')]('error\x20mail',JSON[_0x03b3('0x25')](_0x3f909d));});}};}function handleError(){return function(_0x23038b){return logger[_0x03b3('0x2d')](JSON[_0x03b3('0x25')](_0x23038b));};}function handleResult(_0x55e918){return function(_0x22de4c){logger[_0x03b3('0xb')](_0x03b3('0x31'),JSON[_0x03b3('0x25')](_0x22de4c));if(_0x55e918['MailAccount']&&_0x55e918[_0x03b3('0xe')][_0x03b3('0xf')]&&!_[_0x03b3('0x32')](_0x55e918[_0x03b3('0xd')])){setTimeout(handleSendEmail(_0x55e918,_0x22de4c),0x3c*0x3e8);}};}function handleJob(_0xd1885d){return function(){try{if(_[_0x03b3('0x32')](_0xd1885d[_0x03b3('0x1a')])){return logger[_0x03b3('0xb')](_0x03b3('0x33'));}if(_['isNil'](_0xd1885d[_0x03b3('0x34')])){return logger[_0x03b3('0xb')](_0x03b3('0x35'));}var _0x24c94f={'startDate':moment()[_0x03b3('0x36')](_0xd1885d[_0x03b3('0x1a')],_0xd1885d[_0x03b3('0x34')])[_0x03b3('0x23')](_0x03b3('0x37')),'endDate':moment()[_0x03b3('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x03b3('0x38'),'output':_0xd1885d[_0x03b3('0x39')],'name':_0xd1885d['name']};if(!_[_0x03b3('0x32')](_0xd1885d[_0x03b3('0x3a')])){logger['info'](_0x03b3('0x3b'),_0xd1885d['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0xd1885d[_0x03b3('0x3a')]},_0x24c94f)[_0x03b3('0x3c')](handleResult(_0xd1885d))[_0x03b3('0x30')](handleError());}if(!_['isNil'](_0xd1885d[_0x03b3('0x3d')])){logger[_0x03b3('0xb')](_0x03b3('0x3e'),_0xd1885d[_0x03b3('0x3d')]);return analyticCustomReportController['runReport']({'id':_0xd1885d[_0x03b3('0x3d')]},_0x24c94f)[_0x03b3('0x3c')](handleResult(_0xd1885d))['catch'](handleError());}}catch(_0x32e2be){logger[_0x03b3('0x2d')](JSON[_0x03b3('0x25')](_0x32e2be));}return logger[_0x03b3('0xb')](_0x03b3('0x3f'));};}function getJobs(_0x54e9ad){var _0x240ad6={};if(_0x54e9ad){_0x240ad6['id']=_0x54e9ad;}return db[_0x03b3('0x40')][_0x03b3('0x41')]({'where':_0x240ad6,'include':[{'model':db[_0x03b3('0xe')],'attributes':['id',_0x03b3('0x19'),_0x03b3('0xd')],'include':[{'model':db[_0x03b3('0x42')],'as':'Smtp'}]}]})['then'](function(_0x59bb14){var _0x530a0c=_[_0x03b3('0x43')](manager[_0x03b3('0x44')]);var _0x3819af=_[_0x03b3('0x45')](_0x59bb14,function(_0x222f54){return _0x222f54['id'][_0x03b3('0x46')]();});var _0x4ad85c=_[_0x03b3('0x47')](_0x59bb14,function(_0x17a703){return _0x17a703['id']['toString']();});var _0x398588=_0x54e9ad?_0x3819af:_['difference'](_0x3819af,_0x530a0c);var _0x54e61b=_[_0x03b3('0x48')](_0x3819af,_0x530a0c);var _0x58227e=_['difference'](_0x530a0c,_0x3819af);var _0x5a9d47;var _0x37d5cf;for(_0x5a9d47=0x0;_0x5a9d47<_0x58227e[_0x03b3('0x49')]&&!_0x54e9ad;_0x5a9d47+=0x1){_0x37d5cf=_0x58227e[_0x5a9d47][_0x03b3('0x46')]();if(manager[_0x03b3('0x4a')](_0x37d5cf)){manager['stop'](_0x37d5cf);manager[_0x03b3('0x4b')](_0x37d5cf);logger['info']('delete\x20cron',_0x37d5cf);}}logger[_0x03b3('0xb')](_0x03b3('0x4c'),JSON[_0x03b3('0x25')](_0x398588));for(_0x5a9d47=0x0;_0x5a9d47<_0x398588[_0x03b3('0x49')];_0x5a9d47+=0x1){_0x37d5cf=_0x398588[_0x5a9d47][_0x03b3('0x46')]();logger[_0x03b3('0xb')](_0x03b3('0x4d'),_0x37d5cf);if(_0x54e9ad){logger[_0x03b3('0xb')](_0x03b3('0x4e'),_0x54e9ad);logger['info'](JSON[_0x03b3('0x25')](_0x4ad85c[_0x37d5cf]));BPromise[_0x03b3('0x4f')]()[_0x03b3('0x3c')](handleJob(_0x4ad85c[_0x37d5cf]));logger[_0x03b3('0xb')](_0x03b3('0x50'),_0x4ad85c[_0x37d5cf][_0x03b3('0x19')],_0x4ad85c[_0x37d5cf][_0x03b3('0x51')]);}else if(_0x4ad85c[_0x37d5cf][_0x03b3('0x51')]&&_0x4ad85c[_0x37d5cf]['active']&&moment()['isBetween'](_0x4ad85c[_0x37d5cf][_0x03b3('0x52')],_0x4ad85c[_0x37d5cf]['endAt'])){manager[_0x03b3('0x53')](_0x37d5cf,_0x4ad85c[_0x37d5cf][_0x03b3('0x51')],handleJob(_0x4ad85c[_0x37d5cf]));manager[_0x03b3('0x54')](_0x37d5cf);logger[_0x03b3('0xb')](_0x03b3('0x55'),_0x4ad85c[_0x37d5cf][_0x03b3('0x19')],_0x4ad85c[_0x37d5cf][_0x03b3('0x51')]);}else if(manager[_0x03b3('0x4a')](_0x37d5cf)){manager[_0x03b3('0x56')](_0x37d5cf);manager[_0x03b3('0x4b')](_0x37d5cf);logger[_0x03b3('0xb')]('stop\x20cron',_0x4ad85c[_0x37d5cf][_0x03b3('0x19')],_0x4ad85c[_0x37d5cf][_0x03b3('0x51')]);}}for(_0x5a9d47=0x0,_0x37d5cf;_0x5a9d47<_0x54e61b['length']&&!_0x54e9ad;_0x5a9d47+=0x1){_0x37d5cf=_0x54e61b[_0x5a9d47][_0x03b3('0x46')]();if(manager[_0x03b3('0x4a')](_0x37d5cf)){if(_0x4ad85c[_0x37d5cf]['cron']&&_0x4ad85c[_0x37d5cf][_0x03b3('0x57')]&&moment()[_0x03b3('0x58')](_0x4ad85c[_0x37d5cf][_0x03b3('0x52')],_0x4ad85c[_0x37d5cf][_0x03b3('0x59')])){manager['update'](_0x37d5cf,_0x4ad85c[_0x37d5cf][_0x03b3('0x51')],handleJob(_0x4ad85c[_0x37d5cf]));logger[_0x03b3('0xb')]('update\x20cron',_0x4ad85c[_0x37d5cf]['name'],_0x4ad85c[_0x37d5cf]['cron']);}else{manager['stop'](_0x37d5cf);manager[_0x03b3('0x4b')](_0x37d5cf);logger[_0x03b3('0xb')](_0x03b3('0x5a'),_0x4ad85c[_0x37d5cf][_0x03b3('0x19')],_0x4ad85c[_0x37d5cf]['cron']);}}}})['catch'](function(_0x1a27da){logger[_0x03b3('0x2d')](JSON[_0x03b3('0x25')](_0x1a27da));});}exports[_0x03b3('0x5b')]=function(_0x2ada61){return getJobs(_0x2ada61);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4819=['deleteJob','delete\x20cron','toRun','index','my\x20id','cron','isBetween','startAt','start','add\x20cron','stop','stop\x20cron','active','endAt','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','Smtp','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','basename','extname','zip','join','existsSync','status','Sent','attachments','message','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','MailServerOut','keys','jobs','map','toString','keyBy','intersection','difference','length','exists'];(function(_0x3ad737,_0x300131){var _0x16c1e2=function(_0x4c64fe){while(--_0x4c64fe){_0x3ad737['push'](_0x3ad737['shift']());}};_0x16c1e2(++_0x300131);}(_0x4819,0x1cc));var _0x9481=function(_0x4e3ac5,_0x18d402){_0x4e3ac5=_0x4e3ac5-0x0;var _0x3b408f=_0x4819[_0x4e3ac5];return _0x3b408f;};'use strict';var fs=require('fs');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var _=require(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var CronJobManager=require(_0x9481('0x4'));var jayson=require(_0x9481('0x5'));var BPromise=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))('schedule');var db=require(_0x9481('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x9481('0x9')][_0x9481('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x137b7b,_0x8b3acb){return function(){logger[_0x9481('0xb')](_0x9481('0xc'),_0x137b7b[_0x9481('0xd')]);var _0x547533=!![];var _0x2ad656={'tls':{'rejectUnauthorized':![]}};if(_0x137b7b['MailAccount']['Smtp'][_0x9481('0xe')]){_0x2ad656[_0x9481('0xe')]=_0x137b7b[_0x9481('0xf')][_0x9481('0x10')][_0x9481('0xe')];}else{_0x2ad656[_0x9481('0x11')]=_0x137b7b[_0x9481('0xf')][_0x9481('0x10')][_0x9481('0x11')];_0x2ad656[_0x9481('0x12')]=_0x137b7b[_0x9481('0xf')][_0x9481('0x10')]['port'];_0x2ad656[_0x9481('0x13')]=_0x137b7b[_0x9481('0xf')]['Smtp'][_0x9481('0x13')];}if(_0x137b7b[_0x9481('0xf')][_0x9481('0x10')]['authentication']){_0x2ad656[_0x9481('0x14')]={'user':_0x137b7b['MailAccount'][_0x9481('0x10')][_0x9481('0x15')],'pass':_0x137b7b[_0x9481('0xf')][_0x9481('0x10')][_0x9481('0x16')]};}var _0x2cffd2={'account':_0x2ad656,'message':{'from':util[_0x9481('0x17')](_0x9481('0x18'),_0x137b7b[_0x9481('0xf')][_0x9481('0x19')],_0x137b7b[_0x9481('0xf')][_0x9481('0xd')]||_0x137b7b['MailAccount'][_0x9481('0x10')][_0x9481('0x15')]),'to':_0x137b7b[_0x9481('0xd')],'cc':_0x137b7b['cc'],'bcc':_0x137b7b[_0x9481('0x1a')],'subject':util[_0x9481('0x17')](_0x9481('0x1b'),_0x8b3acb[_0x9481('0x19')],_0x137b7b[_0x9481('0x1c')],_0x137b7b['subtractUnit'])}};var _0x29b34e=path['join'](__dirname,'../../files/reports');var _0x241030=_0x8b3acb[_0x9481('0x1d')];var _0x387081=util['format']('%s.%s',path[_0x9481('0x1e')](_0x8b3acb['savename'],path[_0x9481('0x1f')](_0x8b3acb[_0x9481('0x1d')])),_0x9481('0x20'));var _0x37cc70=path[_0x9481('0x21')](_0x29b34e,_0x241030);var _0x3c66b1=path[_0x9481('0x21')](_0x29b34e,_0x387081);if(fs[_0x9481('0x22')](_0x37cc70)){_0x8b3acb[_0x9481('0x23')]=_0x9481('0x24');_0x2cffd2['message'][_0x9481('0x25')]=[{'filename':_0x241030,'path':_0x37cc70}];_0x2cffd2[_0x9481('0x26')][_0x9481('0x27')]=util[_0x9481('0x17')](_0x9481('0x28'),JSON[_0x9481('0x29')](_0x8b3acb,null,0x2));}else if(fs[_0x9481('0x22')](_0x3c66b1)){_0x8b3acb[_0x9481('0x23')]=_0x9481('0x24');_0x2cffd2[_0x9481('0x26')]['attachments']=[{'filename':_0x387081,'path':_0x3c66b1}];}else{_0x2cffd2[_0x9481('0x26')][_0x9481('0x27')]=_0x9481('0x2a');if(!_0x137b7b[_0x9481('0x2b')]){_0x547533=![];logger[_0x9481('0xb')](_0x9481('0x2c'));}}if(_0x547533){return client[_0x9481('0x2d')](_0x9481('0x2e'),_0x2cffd2)[_0x9481('0x2f')](function(_0x244c21){if(_0x244c21['error']){return logger[_0x9481('0x30')]('error\x20mail',JSON[_0x9481('0x29')](_0x244c21));}return logger['info'](_0x9481('0x31'));})[_0x9481('0x32')](function(_0x2103e9){return logger['error']('error\x20mail',JSON[_0x9481('0x29')](_0x2103e9));});}};}function handleError(){return function(_0x378db7){return logger[_0x9481('0x30')](JSON['stringify'](_0x378db7));};}function handleResult(_0x199b6a){return function(_0x3a50dd){logger[_0x9481('0xb')]('data',JSON[_0x9481('0x29')](_0x3a50dd));if(_0x199b6a['MailAccount']&&_0x199b6a['MailAccount'][_0x9481('0x10')]&&!_[_0x9481('0x33')](_0x199b6a[_0x9481('0xd')])){setTimeout(handleSendEmail(_0x199b6a,_0x3a50dd),0x3c*0x3e8);}};}function handleJob(_0x57d6a7){return function(){try{if(_['isNil'](_0x57d6a7['subtractNumber'])){return logger['info'](_0x9481('0x34'));}if(_[_0x9481('0x33')](_0x57d6a7[_0x9481('0x35')])){return logger['info'](_0x9481('0x36'));}var _0x25b90b={'startDate':moment()[_0x9481('0x37')](_0x57d6a7[_0x9481('0x1c')],_0x57d6a7['subtractUnit'])[_0x9481('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x9481('0x17')](_0x9481('0x38')),'type':'scheduled','output':_0x57d6a7[_0x9481('0x39')],'name':_0x57d6a7[_0x9481('0x19')]};if(!_[_0x9481('0x33')](_0x57d6a7[_0x9481('0x3a')])){logger[_0x9481('0xb')](_0x9481('0x3b'),_0x57d6a7[_0x9481('0x3a')]);return analyticDefaultReportController[_0x9481('0x3c')]({'id':_0x57d6a7[_0x9481('0x3a')]},_0x25b90b)[_0x9481('0x2f')](handleResult(_0x57d6a7))[_0x9481('0x32')](handleError());}if(!_[_0x9481('0x33')](_0x57d6a7[_0x9481('0x3d')])){logger[_0x9481('0xb')](_0x9481('0x3e'),_0x57d6a7['CustomReportId']);return analyticCustomReportController[_0x9481('0x3c')]({'id':_0x57d6a7[_0x9481('0x3d')]},_0x25b90b)[_0x9481('0x2f')](handleResult(_0x57d6a7))[_0x9481('0x32')](handleError());}}catch(_0x43e5e2){logger['error'](JSON[_0x9481('0x29')](_0x43e5e2));}return logger[_0x9481('0xb')](_0x9481('0x3f'));};}function getJobs(_0x2b68f4){var _0x5dc2ff={};if(_0x2b68f4){_0x5dc2ff['id']=_0x2b68f4;}return db['Schedule']['findAll']({'where':_0x5dc2ff,'include':[{'model':db[_0x9481('0xf')],'attributes':['id',_0x9481('0x19'),_0x9481('0xd')],'include':[{'model':db[_0x9481('0x40')],'as':_0x9481('0x10')}]}]})['then'](function(_0x3f3588){var _0x7968cf=_[_0x9481('0x41')](manager[_0x9481('0x42')]);var _0x378c84=_[_0x9481('0x43')](_0x3f3588,function(_0xa779ea){return _0xa779ea['id'][_0x9481('0x44')]();});var _0x1ccccb=_[_0x9481('0x45')](_0x3f3588,function(_0x663cd2){return _0x663cd2['id'][_0x9481('0x44')]();});var _0x22eb45=_0x2b68f4?_0x378c84:_['difference'](_0x378c84,_0x7968cf);var _0x1c93d3=_[_0x9481('0x46')](_0x378c84,_0x7968cf);var _0x28915d=_[_0x9481('0x47')](_0x7968cf,_0x378c84);var _0x1b60c4;var _0x50f511;for(_0x1b60c4=0x0;_0x1b60c4<_0x28915d[_0x9481('0x48')]&&!_0x2b68f4;_0x1b60c4+=0x1){_0x50f511=_0x28915d[_0x1b60c4][_0x9481('0x44')]();if(manager[_0x9481('0x49')](_0x50f511)){manager['stop'](_0x50f511);manager[_0x9481('0x4a')](_0x50f511);logger[_0x9481('0xb')](_0x9481('0x4b'),_0x50f511);}}logger[_0x9481('0xb')](_0x9481('0x4c'),JSON[_0x9481('0x29')](_0x22eb45));for(_0x1b60c4=0x0;_0x1b60c4<_0x22eb45[_0x9481('0x48')];_0x1b60c4+=0x1){_0x50f511=_0x22eb45[_0x1b60c4]['toString']();logger['info'](_0x9481('0x4d'),_0x50f511);if(_0x2b68f4){logger['info'](_0x9481('0x4e'),_0x2b68f4);logger[_0x9481('0xb')](JSON[_0x9481('0x29')](_0x1ccccb[_0x50f511]));BPromise['resolve']()[_0x9481('0x2f')](handleJob(_0x1ccccb[_0x50f511]));logger['info']('run\x20job',_0x1ccccb[_0x50f511][_0x9481('0x19')],_0x1ccccb[_0x50f511][_0x9481('0x4f')]);}else if(_0x1ccccb[_0x50f511][_0x9481('0x4f')]&&_0x1ccccb[_0x50f511]['active']&&moment()[_0x9481('0x50')](_0x1ccccb[_0x50f511][_0x9481('0x51')],_0x1ccccb[_0x50f511]['endAt'])){manager['add'](_0x50f511,_0x1ccccb[_0x50f511][_0x9481('0x4f')],handleJob(_0x1ccccb[_0x50f511]));manager[_0x9481('0x52')](_0x50f511);logger[_0x9481('0xb')](_0x9481('0x53'),_0x1ccccb[_0x50f511][_0x9481('0x19')],_0x1ccccb[_0x50f511][_0x9481('0x4f')]);}else if(manager[_0x9481('0x49')](_0x50f511)){manager[_0x9481('0x54')](_0x50f511);manager[_0x9481('0x4a')](_0x50f511);logger['info'](_0x9481('0x55'),_0x1ccccb[_0x50f511][_0x9481('0x19')],_0x1ccccb[_0x50f511][_0x9481('0x4f')]);}}for(_0x1b60c4=0x0,_0x50f511;_0x1b60c4<_0x1c93d3[_0x9481('0x48')]&&!_0x2b68f4;_0x1b60c4+=0x1){_0x50f511=_0x1c93d3[_0x1b60c4]['toString']();if(manager[_0x9481('0x49')](_0x50f511)){if(_0x1ccccb[_0x50f511][_0x9481('0x4f')]&&_0x1ccccb[_0x50f511][_0x9481('0x56')]&&moment()['isBetween'](_0x1ccccb[_0x50f511][_0x9481('0x51')],_0x1ccccb[_0x50f511][_0x9481('0x57')])){manager['update'](_0x50f511,_0x1ccccb[_0x50f511]['cron'],handleJob(_0x1ccccb[_0x50f511]));logger['info'](_0x9481('0x58'),_0x1ccccb[_0x50f511][_0x9481('0x19')],_0x1ccccb[_0x50f511]['cron']);}else{manager[_0x9481('0x54')](_0x50f511);manager[_0x9481('0x4a')](_0x50f511);logger[_0x9481('0xb')](_0x9481('0x55'),_0x1ccccb[_0x50f511]['name'],_0x1ccccb[_0x50f511][_0x9481('0x4f')]);}}}})['catch'](function(_0x3dd528){logger['error'](JSON[_0x9481('0x29')](_0x3dd528));});}exports['run']=function(_0x3ff760){return getJobs(_0x3ff760);};exports[_0x9481('0x52')]=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 bde21c9..e928fff 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 _0x983c=['Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','language','CloudProvider','Cloud\x20Provider\x20not\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','forEach','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x983c,0xf3));var _0xc983=function(_0x43645f,_0x656278){_0x43645f=_0x43645f-0x0;var _0x36f9ab=_0x983c[_0x43645f];return _0x36f9ab;};var _=require(_0xc983('0x0'));var AWS=require(_0xc983('0x1'));var rp=require(_0xc983('0x2'));var util=require(_0xc983('0x3'));var BPromise=require(_0xc983('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xc983('0x5'))(_0xc983('0x6'));function getTranscriptionJob(_0x14b999,_0x2e8c5d,_0xdaae44,_0x290ca8){return new Promise(function(_0x3897b9,_0x541e6f){var _0x346933=new AWS[(_0xc983('0x7'))]({'accessKeyId':_0x2e8c5d,'secretAccessKey':_0x14b999,'region':_0xdaae44});_0x346933[_0xc983('0x8')]({'TranscriptionJobName':_0x290ca8},function(_0x11cd44,_0x52025a){if(_0x11cd44){return _0x541e6f(_0x11cd44);}else{return _0x3897b9(_0x52025a);}});});}function sentiment(_0x548063,_0x4fbf6f,_0x5ad672,_0x41255b,_0x4311dc){return new Promise(function(_0x1ed0e4,_0x4405c2){var _0x15d894=new AWS[(_0xc983('0x9'))]({'accessKeyId':_0x4fbf6f,'secretAccessKey':_0x548063,'region':_0x5ad672});_0x15d894[_0xc983('0xa')]({'Text':_0x41255b,'LanguageCode':_0x4311dc[_0xc983('0xb')](0x0,0x2)},function(_0x25a806,_0x5a8b47){if(_0x25a806){return _0x4405c2(_0x25a806);}else{return _0x1ed0e4(_0x5a8b47);}});});}function checkTranscribeJob(_0x160b3b,_0x2ae6f0,_0x28b2f1){var _0x1b4dd2;return new BPromise(function(_0xf61926,_0x346727){logger['info'](util[_0xc983('0xc')](_0xc983('0xd'),_0x160b3b['id'],_0x160b3b[_0xc983('0xe')]));return getTranscriptionJob(_0x28b2f1[_0xc983('0xf')],_0x28b2f1[_0xc983('0x10')],_0x2ae6f0[_0xc983('0x11')],_0x160b3b['transcribeName'])[_0xc983('0x12')](function(_0x1a1e7d){logger[_0xc983('0x13')](util[_0xc983('0xc')](_0xc983('0x14'),_0x160b3b['id'],_0x160b3b[_0xc983('0xe')],_0x1a1e7d[_0xc983('0x15')][_0xc983('0x16')]));if(!_0x160b3b[_0xc983('0x17')]){switch(_0x1a1e7d[_0xc983('0x15')]['TranscriptionJobStatus']){case'COMPLETED':var _0x43231d={'transcribeStatus':_0x1a1e7d[_0xc983('0x15')][_0xc983('0x16')],'fileUri':_0x1a1e7d[_0xc983('0x15')][_0xc983('0x18')][_0xc983('0x19')]};logger[_0xc983('0x13')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x160b3b['id']));return rp({'uri':_0x1a1e7d[_0xc983('0x15')][_0xc983('0x18')][_0xc983('0x19')],'json':!![]})[_0xc983('0x12')](function(_0xfcf7b6){logger[_0xc983('0x13')](util[_0xc983('0xc')](_0xc983('0x1a'),_0x160b3b['id']));if(_0xfcf7b6&&_0xfcf7b6[_0xc983('0x1b')]&&_0xfcf7b6[_0xc983('0x1b')][_0xc983('0x1c')]&&_0xfcf7b6[_0xc983('0x1b')]['transcripts']['length']){_0x43231d[_0xc983('0x17')]='';for(var _0x446c80=0x0;_0x446c80<_0xfcf7b6['results'][_0xc983('0x1c')]['length'];_0x446c80++){_0x43231d[_0xc983('0x17')]+=_0xfcf7b6[_0xc983('0x1b')][_0xc983('0x1c')][_0x446c80][_0xc983('0x1d')]+'';}}return _0x160b3b[_0xc983('0x1e')](_0x43231d);})['then'](function(){logger[_0xc983('0x13')](util[_0xc983('0xc')](_0xc983('0x1f'),_0x160b3b['id']));if(!_0x160b3b[_0xc983('0x20')]){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2ae6f0[_0xc983('0x23')]||!_0x2ae6f0[_0xc983('0x24')]||!_0x2ae6f0[_0xc983('0x25')]||!_0x2ae6f0['language']||!_0x2ae6f0[_0xc983('0x26')]){throw new db[(_0xc983('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x43231d['fileText']){throw new Error(_0xc983('0x27'));}if(_0x2ae6f0['sentimentAccountId']===_0x28b2f1['id']){return _0x28b2f1;}else{return db['CloudProvider'][_0xc983('0x28')]({'where':{'id':_settings[_0xc983('0x24')]}});}})['then'](function(_0x383f00){if(!_0x383f00){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x383f00[_0xc983('0xf')]||!_0x383f00[_0xc983('0x10')]){throw new db['Sequelize'][(_0xc983('0x22'))](_0xc983('0x29'));}_0x1b4dd2=_0x383f00;logger[_0xc983('0x13')](util[_0xc983('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x160b3b['id']));return sentiment(_0x1b4dd2['data1'],_0x1b4dd2[_0xc983('0x10')],_0x2ae6f0[_0xc983('0x25')],_0x43231d[_0xc983('0x17')],_0x2ae6f0['language']);})['then'](function(_0x3d45df){logger[_0xc983('0x13')](util[_0xc983('0xc')](_0xc983('0x2a'),_0x160b3b['id']));return _0x160b3b[_0xc983('0x1e')]({'sentiment':_0x3d45df[_0xc983('0x2b')],'sPositive':_0x3d45df[_0xc983('0x2c')][_0xc983('0x2d')],'sNegative':_0x3d45df[_0xc983('0x2c')][_0xc983('0x2e')],'sMixed':_0x3d45df[_0xc983('0x2c')][_0xc983('0x2f')],'sNeutral':_0x3d45df['SentimentScore']['Neutral']});})[_0xc983('0x12')](function(){logger['info'](util[_0xc983('0xc')](_0xc983('0x1f'),_0x160b3b['id']));_0xf61926();});case'FAILED':return _0x160b3b['update']({'transcribeStatus':_0xc983('0x30'),'failureReason':_0x1a1e7d[_0xc983('0x15')][_0xc983('0x31')]})[_0xc983('0x12')](function(){logger['info'](util[_0xc983('0xc')](_0xc983('0x1f'),_0x160b3b['id']));_0xf61926();});default:logger[_0xc983('0x13')](util['format'](_0xc983('0x32'),_0x160b3b['id']));break;}}else{return BPromise[_0xc983('0x33')]()['then'](function(){if(!_0x160b3b[_0xc983('0x20')]){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))](_0xc983('0x34'));}if(!_0x2ae6f0[_0xc983('0x23')]||!_0x2ae6f0[_0xc983('0x24')]||!_0x2ae6f0[_0xc983('0x25')]||!_0x2ae6f0[_0xc983('0x35')]||!_0x2ae6f0['bucket']){throw new db[(_0xc983('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x160b3b[_0xc983('0x17')]){throw new Error(_0xc983('0x27'));}if(_0x2ae6f0['sentimentAccountId']===_0x28b2f1['id']){return _0x28b2f1;}else{return db[_0xc983('0x36')][_0xc983('0x28')]({'where':{'id':_settings[_0xc983('0x24')]}});}})['then'](function(_0x2ea6cc){if(!_0x2ea6cc){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))](_0xc983('0x37'));}if(!_0x2ea6cc[_0xc983('0xf')]||!_0x2ea6cc[_0xc983('0x10')]){throw new db[(_0xc983('0x21'))]['ValidationError'](_0xc983('0x29'));}_0x1b4dd2=_0x2ea6cc;logger[_0xc983('0x13')](util[_0xc983('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x160b3b['id']));return sentiment(_0x1b4dd2[_0xc983('0xf')],_0x1b4dd2[_0xc983('0x10')],_0x2ae6f0[_0xc983('0x25')],_0x160b3b['fileText'],_0x2ae6f0[_0xc983('0x35')]);})['then'](function(_0x1de54c){logger[_0xc983('0x13')](util[_0xc983('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x160b3b['id']));return _0x160b3b[_0xc983('0x1e')]({'sentiment':_0x1de54c[_0xc983('0x2b')],'sPositive':_0x1de54c[_0xc983('0x2c')][_0xc983('0x2d')],'sNegative':_0x1de54c[_0xc983('0x2c')][_0xc983('0x2e')],'sMixed':_0x1de54c[_0xc983('0x2c')]['Mixed'],'sNeutral':_0x1de54c[_0xc983('0x2c')]['Neutral'],'transcribeStatus':'COMPLETED'});})[_0xc983('0x12')](function(){logger['info'](util[_0xc983('0xc')](_0xc983('0x1f'),_0x160b3b['id']));_0xf61926();});}})[_0xc983('0x38')](function(_0x29235f){if(_0x29235f){if(!_0x29235f[_0xc983('0x39')]||_0x29235f[_0xc983('0x39')]!==_0xc983('0x3a')){logger[_0xc983('0x3b')](util[_0xc983('0xc')](_0xc983('0x3c'),_0x160b3b['id']),util[_0xc983('0x3d')](_0x29235f,{'showHidden':![],'depth':null}));}}_0xf61926();});});}function checkTranscribe(){var _0x3caa03;var _0x4ce197;var _0x40656b;return db[_0xc983('0x3e')][_0xc983('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xc983('0x12')](function(_0x297a4d){if(!_0x297a4d||!_0x297a4d['length']){throw new db['Sequelize'][(_0xc983('0x22'))](_0xc983('0x40'));}_0x3caa03=_0x297a4d;return db[_0xc983('0x41')][_0xc983('0x28')]({'where':{'id':0x1}});})[_0xc983('0x12')](function(_0x41d0bf){if(!_0x41d0bf){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))](_0xc983('0x42'));}_0x4ce197=_0x41d0bf;if(!_0x4ce197['transcribe']||!_0x4ce197[_0xc983('0x43')]||!_0x4ce197[_0xc983('0x11')]||!_0x4ce197[_0xc983('0x35')]||!_0x4ce197[_0xc983('0x26')]){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))]('Transcribe\x20not\x20configured');}return db[_0xc983('0x36')][_0xc983('0x28')]({'where':{'id':_0x4ce197[_0xc983('0x43')]}});})[_0xc983('0x12')](function(_0x2f3283){if(!_0x2f3283){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))](_0xc983('0x37'));}if(!_0x2f3283[_0xc983('0xf')]||!_0x2f3283[_0xc983('0x10')]){throw new db[(_0xc983('0x21'))][(_0xc983('0x22'))](_0xc983('0x29'));}_0x40656b=_0x2f3283;var _0x162921=[];_0x3caa03[_0xc983('0x44')](function(_0x40e8f3){_0x162921['push'](checkTranscribeJob(_0x40e8f3,_0x4ce197,_0x40656b));});return BPromise[_0xc983('0x45')](_0x162921);})[_0xc983('0x38')](function(_0x18a7c6){if(_0x18a7c6){if(!_0x18a7c6['name']||_0x18a7c6[_0xc983('0x39')]!==_0xc983('0x3a')){logger[_0xc983('0x3b')](util[_0xc983('0x3d')](_0x18a7c6,{'showHidden':![],'depth':null}));}}});}exports[_0xc983('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2f68=['No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','start','aws-sdk','request-promise','util','bluebird','../../config/logger','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','results','length','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll'];(function(_0x18a673,_0x4088cc){var _0x44757d=function(_0x8caf18){while(--_0x8caf18){_0x18a673['push'](_0x18a673['shift']());}};_0x44757d(++_0x4088cc);}(_0x2f68,0x9a));var _0x82f6=function(_0x35fe61,_0x3e8793){_0x35fe61=_0x35fe61-0x0;var _0x237b34=_0x2f68[_0x35fe61];return _0x237b34;};var _=require('lodash');var AWS=require(_0x82f6('0x0'));var rp=require(_0x82f6('0x1'));var util=require(_0x82f6('0x2'));var BPromise=require(_0x82f6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x82f6('0x4'))('transcribe');function getTranscriptionJob(_0x2a06dc,_0x2ab73d,_0x5dad09,_0x3ad120){return new Promise(function(_0x2c4302,_0x542737){var _0x5a8089=new AWS[(_0x82f6('0x5'))]({'accessKeyId':_0x2ab73d,'secretAccessKey':_0x2a06dc,'region':_0x5dad09});_0x5a8089['getTranscriptionJob']({'TranscriptionJobName':_0x3ad120},function(_0x5daa3c,_0x864400){if(_0x5daa3c){return _0x542737(_0x5daa3c);}else{return _0x2c4302(_0x864400);}});});}function sentiment(_0xbd30d5,_0x250d71,_0x5ee0e5,_0x27db58,_0x432289){return new Promise(function(_0x4e7c12,_0x1cf88e){var _0x1eec2f=new AWS[(_0x82f6('0x6'))]({'accessKeyId':_0x250d71,'secretAccessKey':_0xbd30d5,'region':_0x5ee0e5});_0x1eec2f[_0x82f6('0x7')]({'Text':_0x27db58,'LanguageCode':_0x432289[_0x82f6('0x8')](0x0,0x2)},function(_0x34bd7c,_0x4c870e){if(_0x34bd7c){return _0x1cf88e(_0x34bd7c);}else{return _0x4e7c12(_0x4c870e);}});});}function checkTranscribeJob(_0x12c5bc,_0x442262,_0x4cc967){var _0x194da7;return new BPromise(function(_0x1f8bf5,_0x397527){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0xb'),_0x12c5bc['id'],_0x12c5bc[_0x82f6('0xc')]));return getTranscriptionJob(_0x4cc967[_0x82f6('0xd')],_0x4cc967[_0x82f6('0xe')],_0x442262['transcribeRegion'],_0x12c5bc[_0x82f6('0xc')])['then'](function(_0x249222){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0xf'),_0x12c5bc['id'],_0x12c5bc[_0x82f6('0xc')],_0x249222[_0x82f6('0x10')][_0x82f6('0x11')]));if(!_0x12c5bc[_0x82f6('0x12')]){switch(_0x249222[_0x82f6('0x10')][_0x82f6('0x11')]){case _0x82f6('0x13'):var _0x1d9091={'transcribeStatus':_0x249222[_0x82f6('0x10')][_0x82f6('0x11')],'fileUri':_0x249222[_0x82f6('0x10')]['Transcript'][_0x82f6('0x14')]};logger[_0x82f6('0x9')](util['format'](_0x82f6('0x15'),_0x12c5bc['id']));return rp({'uri':_0x249222[_0x82f6('0x10')][_0x82f6('0x16')][_0x82f6('0x14')],'json':!![]})['then'](function(_0xdc4dea){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x17'),_0x12c5bc['id']));if(_0xdc4dea&&_0xdc4dea['results']&&_0xdc4dea['results'][_0x82f6('0x18')]&&_0xdc4dea[_0x82f6('0x19')]['transcripts']['length']){_0x1d9091[_0x82f6('0x12')]='';for(var _0x31face=0x0;_0x31face<_0xdc4dea['results'][_0x82f6('0x18')][_0x82f6('0x1a')];_0x31face++){_0x1d9091['fileText']+=_0xdc4dea['results'][_0x82f6('0x18')][_0x31face]['transcript']+'';}}return _0x12c5bc[_0x82f6('0x1b')](_0x1d9091);})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x1d'),_0x12c5bc['id']));if(!_0x12c5bc[_0x82f6('0x1e')]){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x20'));}if(!_0x442262[_0x82f6('0x21')]||!_0x442262[_0x82f6('0x22')]||!_0x442262[_0x82f6('0x23')]||!_0x442262[_0x82f6('0x24')]||!_0x442262[_0x82f6('0x25')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x27'));}if(!_0x1d9091[_0x82f6('0x12')]){throw new Error(_0x82f6('0x28'));}if(_0x442262[_0x82f6('0x22')]===_0x4cc967['id']){return _0x4cc967;}else{return db[_0x82f6('0x29')][_0x82f6('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x82f6('0x1c')](function(_0x2c764f){if(!_0x2c764f){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x2b'));}if(!_0x2c764f[_0x82f6('0xd')]||!_0x2c764f[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x194da7=_0x2c764f;logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2d'),_0x12c5bc['id']));return sentiment(_0x194da7[_0x82f6('0xd')],_0x194da7[_0x82f6('0xe')],_0x442262[_0x82f6('0x23')],_0x1d9091[_0x82f6('0x12')],_0x442262[_0x82f6('0x24')]);})['then'](function(_0x13a409){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2e'),_0x12c5bc['id']));return _0x12c5bc[_0x82f6('0x1b')]({'sentiment':_0x13a409[_0x82f6('0x2f')],'sPositive':_0x13a409[_0x82f6('0x30')][_0x82f6('0x31')],'sNegative':_0x13a409[_0x82f6('0x30')][_0x82f6('0x32')],'sMixed':_0x13a409[_0x82f6('0x30')][_0x82f6('0x33')],'sNeutral':_0x13a409[_0x82f6('0x30')][_0x82f6('0x34')]});})['then'](function(){logger[_0x82f6('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x12c5bc['id']));_0x1f8bf5();});case _0x82f6('0x35'):return _0x12c5bc[_0x82f6('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x249222[_0x82f6('0x10')][_0x82f6('0x36')]})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x12c5bc['id']));_0x1f8bf5();});default:logger[_0x82f6('0x9')](util['format'](_0x82f6('0x37'),_0x12c5bc['id']));break;}}else{return BPromise['resolve']()[_0x82f6('0x1c')](function(){if(!_0x12c5bc[_0x82f6('0x1e')]){throw new db['Sequelize'][(_0x82f6('0x26'))](_0x82f6('0x20'));}if(!_0x442262[_0x82f6('0x21')]||!_0x442262[_0x82f6('0x22')]||!_0x442262['sentimentRegion']||!_0x442262[_0x82f6('0x24')]||!_0x442262[_0x82f6('0x25')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x12c5bc[_0x82f6('0x12')]){throw new Error(_0x82f6('0x28'));}if(_0x442262['sentimentAccountId']===_0x4cc967['id']){return _0x4cc967;}else{return db[_0x82f6('0x29')][_0x82f6('0x2a')]({'where':{'id':_settings[_0x82f6('0x22')]}});}})[_0x82f6('0x1c')](function(_0xc3e250){if(!_0xc3e250){throw new db['Sequelize'][(_0x82f6('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xc3e250[_0x82f6('0xd')]||!_0xc3e250[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x194da7=_0xc3e250;logger[_0x82f6('0x9')](util[_0x82f6('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x12c5bc['id']));return sentiment(_0x194da7[_0x82f6('0xd')],_0x194da7[_0x82f6('0xe')],_0x442262[_0x82f6('0x23')],_0x12c5bc[_0x82f6('0x12')],_0x442262['language']);})[_0x82f6('0x1c')](function(_0x4797af){logger[_0x82f6('0x9')](util[_0x82f6('0xa')](_0x82f6('0x2e'),_0x12c5bc['id']));return _0x12c5bc[_0x82f6('0x1b')]({'sentiment':_0x4797af[_0x82f6('0x2f')],'sPositive':_0x4797af[_0x82f6('0x30')]['Positive'],'sNegative':_0x4797af[_0x82f6('0x30')][_0x82f6('0x32')],'sMixed':_0x4797af[_0x82f6('0x30')][_0x82f6('0x33')],'sNeutral':_0x4797af[_0x82f6('0x30')][_0x82f6('0x34')],'transcribeStatus':_0x82f6('0x13')});})[_0x82f6('0x1c')](function(){logger['info'](util[_0x82f6('0xa')](_0x82f6('0x1d'),_0x12c5bc['id']));_0x1f8bf5();});}})['catch'](function(_0xfedf51){if(_0xfedf51){if(!_0xfedf51['name']||_0xfedf51[_0x82f6('0x38')]!=='SequelizeValidationError'){logger[_0x82f6('0x39')](util[_0x82f6('0xa')](_0x82f6('0x3a'),_0x12c5bc['id']),util[_0x82f6('0x3b')](_0xfedf51,{'showHidden':![],'depth':null}));}}_0x1f8bf5();});});}function checkTranscribe(){var _0x17a5ae;var _0x2fdcc6;var _0x53f7d4;return db[_0x82f6('0x3c')][_0x82f6('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x3868cc){if(!_0x3868cc||!_0x3868cc[_0x82f6('0x1a')]){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x3e'));}_0x17a5ae=_0x3868cc;return db[_0x82f6('0x3f')][_0x82f6('0x2a')]({'where':{'id':0x1}});})[_0x82f6('0x1c')](function(_0x4e9e13){if(!_0x4e9e13){throw new db['Sequelize'][(_0x82f6('0x26'))](_0x82f6('0x40'));}_0x2fdcc6=_0x4e9e13;if(!_0x2fdcc6[_0x82f6('0x41')]||!_0x2fdcc6['transcribeAccountId']||!_0x2fdcc6[_0x82f6('0x42')]||!_0x2fdcc6[_0x82f6('0x24')]||!_0x2fdcc6['bucket']){throw new db['Sequelize']['ValidationError'](_0x82f6('0x43'));}return db['CloudProvider'][_0x82f6('0x2a')]({'where':{'id':_0x2fdcc6['transcribeAccountId']}});})[_0x82f6('0x1c')](function(_0x4f69de){if(!_0x4f69de){throw new db[(_0x82f6('0x1f'))]['ValidationError'](_0x82f6('0x2b'));}if(!_0x4f69de[_0x82f6('0xd')]||!_0x4f69de[_0x82f6('0xe')]){throw new db[(_0x82f6('0x1f'))][(_0x82f6('0x26'))](_0x82f6('0x2c'));}_0x53f7d4=_0x4f69de;var _0x597844=[];_0x17a5ae[_0x82f6('0x44')](function(_0x1c8304){_0x597844[_0x82f6('0x45')](checkTranscribeJob(_0x1c8304,_0x2fdcc6,_0x53f7d4));});return BPromise['all'](_0x597844);})['catch'](function(_0x13406f){if(_0x13406f){if(!_0x13406f[_0x82f6('0x38')]||_0x13406f[_0x82f6('0x38')]!==_0x82f6('0x46')){logger['error'](util[_0x82f6('0x3b')](_0x13406f,{'showHidden':![],'depth':null}));}}});}exports[_0x82f6('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index ae44a01..c359843 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 _0xd900=['YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','info','join','update','system','format'];(function(_0x576811,_0x25ff72){var _0x4d66d6=function(_0x1b454e){while(--_0x1b454e){_0x576811['push'](_0x576811['shift']());}};_0x4d66d6(++_0x25ff72);}(_0xd900,0x116));var _0x0d90=function(_0x3738ad,_0x4e25ae){_0x3738ad=_0x3738ad-0x0;var _0x253a25=_0xd900[_0x3738ad];return _0x253a25;};'use strict';var _=require(_0x0d90('0x0'));var moment=require(_0x0d90('0x1'));var Redis=require(_0x0d90('0x2'));var util=require(_0x0d90('0x3'));var config=require(_0x0d90('0x4'));var db=require(_0x0d90('0x5'))['db'];var logger=require(_0x0d90('0x6'))(_0x0d90('0x7'));config[_0x0d90('0x8')]=_[_0x0d90('0x9')](config[_0x0d90('0x8')],{'host':_0x0d90('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x36512f=[];return db[_0x0d90('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x0d90('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0d90('0xd')](0x18,_0x0d90('0xe'))}}})[_0x0d90('0xf')](function(_0x1d174a){if(_0x1d174a&&_0x1d174a[_0x0d90('0x10')]){_0x36512f=_['map'](_0x1d174a||[],'id');logger[_0x0d90('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x36512f[_0x0d90('0x12')]());return db[_0x0d90('0xb')][_0x0d90('0x13')]({'closeReason':_0x0d90('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x0d90('0x15')](_0x0d90('0x16'))},{'where':{'id':_0x36512f}});}})[_0x0d90('0xf')](function(){if(_0x36512f&&_0x36512f[_0x0d90('0x10')]){logger[_0x0d90('0x11')](_0x0d90('0x17'),_0x36512f['join']());for(var _0x1fa52a=0x0;_0x1fa52a<_0x36512f['length'];_0x1fa52a++){io['emit'](_0x0d90('0x18'),{'id':_0x36512f[_0x1fa52a],'closed':!![]});}}})[_0x0d90('0x19')](function(_0x1cd30b){logger[_0x0d90('0x1a')](_0x0d90('0x1b'),_0x1cd30b?util[_0x0d90('0x1c')](_0x1cd30b,{'showHidden':![],'depth':null}):'');});}exports[_0x0d90('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2542=['format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','util','../../config/environment','../../mysqldb','../logger','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout'];(function(_0x2a0bf0,_0x247ffd){var _0x104fd6=function(_0x555e9b){while(--_0x555e9b){_0x2a0bf0['push'](_0x2a0bf0['shift']());}};_0x104fd6(++_0x247ffd);}(_0x2542,0x1e8));var _0x2254=function(_0x464b94,_0x44e5f0){_0x464b94=_0x464b94-0x0;var _0x4b8f44=_0x2542[_0x464b94];return _0x4b8f44;};'use strict';var _=require(_0x2254('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x2254('0x1'));var config=require(_0x2254('0x2'));var db=require(_0x2254('0x3'))['db'];var logger=require(_0x2254('0x4'))('schedule');config['redis']=_[_0x2254('0x5')](config[_0x2254('0x6')],{'host':_0x2254('0x7'),'port':0x18eb});var io=require(_0x2254('0x8'))(new Redis(config[_0x2254('0x6')]));function closeInteractions(){var _0x4f8ceb=[];return db[_0x2254('0x9')][_0x2254('0xa')]({'raw':!![],'attributes':['id',_0x2254('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2254('0xc')](0x18,_0x2254('0xd'))}}})['then'](function(_0x4920ce){if(_0x4920ce&&_0x4920ce[_0x2254('0xe')]){_0x4f8ceb=_[_0x2254('0xf')](_0x4920ce||[],'id');logger[_0x2254('0x10')](_0x2254('0x11'),_0x4f8ceb[_0x2254('0x12')]());return db[_0x2254('0x9')][_0x2254('0x13')]({'closeReason':_0x2254('0x14'),'disposition':_0x2254('0x15'),'closed':!![],'closedAt':moment()[_0x2254('0x16')](_0x2254('0x17'))},{'where':{'id':_0x4f8ceb}});}})[_0x2254('0x18')](function(){if(_0x4f8ceb&&_0x4f8ceb['length']){logger['info'](_0x2254('0x19'),_0x4f8ceb[_0x2254('0x12')]());for(var _0x19610a=0x0;_0x19610a<_0x4f8ceb[_0x2254('0xe')];_0x19610a++){io['emit']('whatsappInteraction:update',{'id':_0x4f8ceb[_0x19610a],'closed':!![]});}}})[_0x2254('0x1a')](function(_0x4c8ac0){logger[_0x2254('0x1b')](_0x2254('0x1c'),_0x4c8ac0?util['inspect'](_0x4c8ac0,{'showHidden':![],'depth':null}):'');});}exports[_0x2254('0x1d')]=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 69aaa01..0f3254a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5b1=['contacts2','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1'];(function(_0x46884f,_0x2b5c5a){var _0x78c6c0=function(_0x43ba0a){while(--_0x43ba0a){_0x46884f['push'](_0x46884f['shift']());}};_0x78c6c0(++_0x2b5c5a);}(_0xf5b1,0x1cb));var _0x1f5b=function(_0x549ebf,_0x5620ae){_0x549ebf=_0x549ebf-0x0;var _0x7b62c5=_0xf5b1[_0x549ebf];return _0x7b62c5;};'use strict';var util=require(_0x1f5b('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1f5b('0x1')]({'id':i,'firstName':_0x1f5b('0x2')+i,'lastName':_0x1f5b('0x3')+i,'phone':0xf879fb460+i,'email':_0x1f5b('0x4')+i+_0x1f5b('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1f5b('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x1f5b('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1f5b('0x1')]({'id':i,'firstName':_0x1f5b('0x2')+i,'lastName':_0x1f5b('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x1f5b('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1f5b('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x1f5b('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x1f5b('0x6')]()});}db[_0x1f5b('0x7')][_0x1f5b('0x8')]({'where':{}})[_0x1f5b('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x1f5b('0xa')](_0x1f5b('0xb'),_0x1f5b('0xc'));return db[_0x1f5b('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0x1f5b('0xd')][_0x1f5b('0xe')](hopper);})[_0x1f5b('0x9')](function(){console[_0x1f5b('0xa')]('finished\x20populating',_0x1f5b('0xf'));return db['CmContact'][_0x1f5b('0xe')](contacts2);})[_0x1f5b('0x9')](function(){console[_0x1f5b('0xa')](_0x1f5b('0xb'),_0x1f5b('0x10'));return db[_0x1f5b('0xd')][_0x1f5b('0xe')](hopper2);})['then'](function(){console[_0x1f5b('0xa')](_0x1f5b('0xb'),_0x1f5b('0x11'));})[_0x1f5b('0x12')](function(_0x22b5a7){console['log'](_0x22b5a7);}); \ No newline at end of file +var _0xcdeb=['bulkCreate','log','CmHopper','finished\x20populating','hopper1','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcdeb,0xb1));var _0xbcde=function(_0x239ce8,_0x191cb8){_0x239ce8=_0x239ce8-0x0;var _0x37963f=_0xcdeb[_0x239ce8];return _0x37963f;};'use strict';var util=require(_0xbcde('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xbcde('0x1')]({'id':i,'firstName':_0xbcde('0x2')+i,'lastName':_0xbcde('0x3')+i,'phone':0xf879fb460+i,'email':_0xbcde('0x4')+i+_0xbcde('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xbcde('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xbcde('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbcde('0x6')](),'updatedAt':Date[_0xbcde('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xbcde('0x1')]({'id':i,'firstName':_0xbcde('0x2')+i,'lastName':_0xbcde('0x3')+i,'phone':0xf879fb460+i,'email':_0xbcde('0x4')+i+_0xbcde('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbcde('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xbcde('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbcde('0x6')](),'updatedAt':Date[_0xbcde('0x6')]()});}db[_0xbcde('0x7')][_0xbcde('0x8')]({'where':{}})[_0xbcde('0x9')](function(){return db[_0xbcde('0x7')][_0xbcde('0xa')](contacts);})[_0xbcde('0x9')](function(){console[_0xbcde('0xb')]('finished\x20populating','contacts1');return db[_0xbcde('0xc')][_0xbcde('0x8')]({'where':{}});})[_0xbcde('0x9')](function(){return db[_0xbcde('0xc')][_0xbcde('0xa')](hopper);})[_0xbcde('0x9')](function(){console[_0xbcde('0xb')](_0xbcde('0xd'),_0xbcde('0xe'));return db['CmContact'][_0xbcde('0xa')](contacts2);})[_0xbcde('0x9')](function(){console[_0xbcde('0xb')]('finished\x20populating','contacts2');return db['CmHopper'][_0xbcde('0xa')](hopper2);})[_0xbcde('0x9')](function(){console['log'](_0xbcde('0xd'),_0xbcde('0xf'));})[_0xbcde('0x10')](function(_0x13c66c){console['log'](_0x13c66c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b136817..e7733dd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdaed=['log','add\x20user','util','../mysqldb','agent','format','%s%s','%s%s@xcally.com','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdaed,0x1dd));var _0xddae=function(_0x523ca0,_0x1f5a95){_0x523ca0=_0x523ca0-0x0;var _0x30afed=_0xdaed[_0x523ca0];return _0x30afed;};'use strict';var util=require(_0xddae('0x0'));var db=require(_0xddae('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0xddae('0x2'),i),'fullname':util[_0xddae('0x3')](_0xddae('0x4'),_0xddae('0x2'),i),'email':util['format'](_0xddae('0x5'),'agent',i),'role':_0xddae('0x2'),'password':'password','internal':0xfa0+i,'type':_0xddae('0x6'),'transport':[_0xddae('0x7'),'ws',_0xddae('0x8')],'disallow':[_0xddae('0x9')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xddae('0x2'),i),'encryption':_0xddae('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0xddae('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xddae('0xb'),'dtlsprivatekey':_0xddae('0xc'),'dtlssetup':_0xddae('0xd'),'callerid':util[_0xddae('0x3')]('\x22%s\x22\x20<%s>',util[_0xddae('0x3')](_0xddae('0x4'),_0xddae('0x2'),i),0xfa0+i)});}db[_0xddae('0xe')][_0xddae('0xf')](users)[_0xddae('0x10')](function(){console[_0xddae('0x11')](_0xddae('0x12'));})['catch'](function(_0x46bf59){console[_0xddae('0x11')](_0x46bf59);}); \ No newline at end of file +var _0x4e40=['actpass','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x5d64f3,_0x374d1a){var _0x2e5c81=function(_0x1de19d){while(--_0x1de19d){_0x5d64f3['push'](_0x5d64f3['shift']());}};_0x2e5c81(++_0x374d1a);}(_0x4e40,0x16f));var _0x04e4=function(_0x4c50fa,_0x350fd1){_0x4c50fa=_0x4c50fa-0x0;var _0x531b9d=_0x4e40[_0x4c50fa];return _0x531b9d;};'use strict';var util=require(_0x04e4('0x0'));var db=require(_0x04e4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x04e4('0x2')]({'name':util[_0x04e4('0x3')](_0x04e4('0x4'),_0x04e4('0x5'),i),'fullname':util['format'](_0x04e4('0x4'),_0x04e4('0x5'),i),'email':util['format'](_0x04e4('0x6'),_0x04e4('0x5'),i),'role':_0x04e4('0x5'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x04e4('0x7'),'ws',_0x04e4('0x8')],'disallow':[_0x04e4('0x9')],'allow':['ulaw'],'defaultuser':util[_0x04e4('0x3')](_0x04e4('0x4'),_0x04e4('0x5'),i),'encryption':'yes','avpf':_0x04e4('0xa'),'force_avp':'yes','icesupport':_0x04e4('0xa'),'dtlsenable':_0x04e4('0xa'),'dtlsverify':'no','dtlscertfile':_0x04e4('0xb'),'dtlsprivatekey':_0x04e4('0xc'),'dtlssetup':_0x04e4('0xd'),'callerid':util[_0x04e4('0x3')]('\x22%s\x22\x20<%s>',util[_0x04e4('0x3')]('%s%s',_0x04e4('0x5'),i),0xfa0+i)});}db['User'][_0x04e4('0xe')](users)[_0x04e4('0xf')](function(){console[_0x04e4('0x10')](_0x04e4('0x11'));})[_0x04e4('0x12')](function(_0x2d5ab4){console[_0x04e4('0x10')](_0x2d5ab4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index bc645f1..8245a95 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x288a=['then','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','telephone','Campaign','format','%s:queue:%s','Agents','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','VoiceQueues','SmsQueues','OpenchannelQueue','getVoiceQueues','getFaxQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','util','bluebird','../mysqldb','./environment','User','role','agent','name','type','ivr','UserProfileSection','findOne'];(function(_0x51ea24,_0x2a71cd){var _0x351016=function(_0x411b00){while(--_0x411b00){_0x51ea24['push'](_0x51ea24['shift']());}};_0x351016(++_0x2a71cd);}(_0x288a,0x188));var _0xa288=function(_0x417c41,_0x1edb29){_0x417c41=_0x417c41-0x0;var _0x560c30=_0x288a[_0x417c41];return _0x560c30;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var BPromise=require(_0xa288('0x1'));var db=require(_0xa288('0x2'))['db'];var config=require(_0xa288('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xa288('0x4')],'attributes':['id','name',_0xa288('0x5')],'raw':!![],'where':{'role':_0xa288('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa288('0x7')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xa288('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0xa288('0x7')],'where':{'role':_0xa288('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xa288('0x8')],'where':{'type':_0xa288('0x9')}};function getAssociatedResources(_0x341d34,_0x490cda,_0x1a0c06){return db[_0xa288('0xa')][_0xa288('0xb')]({'where':{'name':_0x341d34,'userProfileId':_0x490cda},'raw':!![]})[_0xa288('0xc')](function(_0x4eafe2){if(_0x4eafe2){if(_0x4eafe2['autoAssociation']){switch(_0x341d34){case'VoiceQueues':case _0xa288('0xd'):case _0xa288('0xe'):case'SmsQueues':case _0xa288('0xf'):case _0xa288('0x10'):case _0xa288('0x11'):return db[_0x1a0c06][_0xa288('0x12')](queryQueues);case _0xa288('0x13'):return db[_0x1a0c06][_0xa288('0x12')](queryTelephones);case _0xa288('0x14'):return db[_0x1a0c06][_0xa288('0x12')](queryTrunks);case _0xa288('0x15'):return db[_0x1a0c06][_0xa288('0x12')](queryCampaigns);}}else{return db[_0xa288('0x16')][_0xa288('0x12')]({'attributes':[_0xa288('0x17')],'where':{'sectionId':_0x4eafe2['id']},'raw':!![]})[_0xa288('0xc')](function(_0x21ec88){if(_0x21ec88){var _0x138b4e={'where':{'id':_['map'](_0x21ec88,_0xa288('0x17'))},'raw':!![]};switch(_0x1a0c06){case _0xa288('0x4'):_0x138b4e[_0xa288('0x18')][_0xa288('0x5')]=_0xa288('0x19');break;case _0xa288('0x1a'):_0x138b4e['where'][_0xa288('0x8')]=_0xa288('0x9');break;}return db[_0x1a0c06]['findAll'](_0x138b4e);}else{return[];}});}}else{return[];}})['then'](function(_0x3558f4){return _0x3558f4;});}function joinOrLeaveQueues(_0x301879,_0x46e988,_0x510f64,_0xd46fbb){_0x301879[_0x46e988](util[_0xa288('0x1b')](_0xa288('0x1c'),_0x510f64,_0xd46fbb['name']));if(_0xd46fbb[_0xa288('0x1d')]){for(var _0x283523=0x0;_0x283523<_0xd46fbb[_0xa288('0x1d')][_0xa288('0x1e')];_0x283523+=0x1){_0x301879[_0x46e988](util[_0xa288('0x1b')]('user:%s',_0xd46fbb['Agents'][_0x283523][_0xa288('0x7')]));}}}function joinOrLeave(_0x4425c8,_0x37ff1a,_0x2f9465){var _0x4895bb;if(_0x4425c8[_0xa288('0x1f')][_0xa288('0x20')]['id']){db[_0xa288('0x4')][_0xa288('0x21')]({'attributes':['id',_0xa288('0x7'),_0xa288('0x5'),_0xa288('0x22')],'where':{'id':_0x4425c8[_0xa288('0x1f')][_0xa288('0x20')]['id']},'include':[{'model':db[_0xa288('0x23')],'as':_0xa288('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xa288('0x25')],'as':_0xa288('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa288('0x27')],'as':_0xa288('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa288('0x29')],'as':_0xa288('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xa288('0x2b')],'as':_0xa288('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xa288('0xc')](function(_0x3bbbc8){if(_0x3bbbc8){_0x4895bb=_0x3bbbc8;_0x4425c8[_0x37ff1a](util[_0xa288('0x1b')](_0xa288('0x2d'),_0x3bbbc8[_0xa288('0x7')]));var _0x104290=[];switch(_0x3bbbc8[_0xa288('0x5')]){case _0xa288('0x2e'):_0x4425c8[_0x37ff1a](_0xa288('0x2f'));_0x4425c8[_0x37ff1a](_0xa288('0x30'));if(queryQueues[_0xa288('0x31')](_0xa288('0x32'))){delete queryQueues[_0xa288('0x32')];}_0x104290['push'](db[_0xa288('0x33')]['findAll'](queryQueues));_0x104290[_0xa288('0x34')](db[_0xa288('0x35')][_0xa288('0x12')](queryQueues));_0x104290['push'](db[_0xa288('0x36')][_0xa288('0x12')](queryQueues));_0x104290[_0xa288('0x34')](db[_0xa288('0x37')][_0xa288('0x12')](queryQueues));_0x104290[_0xa288('0x34')](db[_0xa288('0x38')][_0xa288('0x12')](queryQueues));_0x104290[_0xa288('0x34')](db['OpenchannelQueue']['findAll'](queryQueues));_0x104290['push'](db[_0xa288('0x39')]['findAll'](queryQueues));_0x104290[_0xa288('0x34')](db[_0xa288('0x4')][_0xa288('0x12')](queryTelephones));_0x104290[_0xa288('0x34')](db[_0xa288('0x3a')][_0xa288('0x12')](queryTrunks));_0x104290['push'](db['Campaign']['findAll'](queryCampaigns));_0x104290[_0xa288('0x34')](db[_0xa288('0x4')]['findAll'](queryAgents));break;case _0xa288('0x3b'):_0x4425c8[_0x37ff1a](_0xa288('0x2f'));_0x4425c8[_0x37ff1a]('voice:outbound');_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0x3c'),_0x3bbbc8[_0xa288('0x22')],_0xa288('0x33')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0xd'),_0x3bbbc8['userProfileId'],_0xa288('0x35')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0xe'),_0x3bbbc8['userProfileId'],_0xa288('0x36')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0x3d'),_0x3bbbc8[_0xa288('0x22')],_0xa288('0x37')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0xf'),_0x3bbbc8['userProfileId'],_0xa288('0x38')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0x10'),_0x3bbbc8['userProfileId'],_0xa288('0x3e')));_0x104290[_0xa288('0x34')](getAssociatedResources('WhatsappQueues',_0x3bbbc8[_0xa288('0x22')],_0xa288('0x39')));_0x104290[_0xa288('0x34')](getAssociatedResources('Telephones',_0x3bbbc8[_0xa288('0x22')],_0xa288('0x4')));_0x104290['push'](getAssociatedResources(_0xa288('0x14'),_0x3bbbc8[_0xa288('0x22')],_0xa288('0x3a')));_0x104290[_0xa288('0x34')](getAssociatedResources(_0xa288('0x15'),_0x3bbbc8['userProfileId'],_0xa288('0x1a')));_0x104290[_0xa288('0x34')](db[_0xa288('0x4')][_0xa288('0x12')](queryAgents));break;case _0xa288('0x6'):_0x4425c8[_0x37ff1a](_0xa288('0x2f'));_0x4425c8[_0x37ff1a](_0xa288('0x30'));_0x104290[_0xa288('0x34')](_0x3bbbc8[_0xa288('0x3f')]({'attributes':['id',_0xa288('0x7')]}));_0x104290[_0xa288('0x34')](_0x3bbbc8['getChatQueues']({'attributes':['id','name']}));_0x104290[_0xa288('0x34')](_0x3bbbc8[_0xa288('0x40')]({'attributes':['id',_0xa288('0x7')]}));_0x104290['push'](_0x3bbbc8['getSmsQueues']({'attributes':['id',_0xa288('0x7')]}));_0x104290[_0xa288('0x34')](_0x3bbbc8['getMailQueues']({'attributes':['id',_0xa288('0x7')]}));_0x104290['push'](_0x3bbbc8['getOpenchannelQueues']({'attributes':['id',_0xa288('0x7')]}));_0x104290[_0xa288('0x34')](_0x3bbbc8[_0xa288('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0xa288('0x42')](_0x104290);}})[_0xa288('0xc')](function(_0x15d529){if(_0x15d529&&_0x15d529[_0xa288('0x1e')]){for(var _0x314333=0x0;_0x314333<_0x15d529[_0xa288('0x1e')];_0x314333+=0x1){for(var _0x5ef0fa=0x0;_0x5ef0fa<_0x15d529[_0x314333][_0xa288('0x1e')];_0x5ef0fa+=0x1){switch(_0x314333){case 0x0:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,'voice',_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x1:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x43'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x2:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x44'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x3:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x45'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x4:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x46'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x5:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x47'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x6:joinOrLeaveQueues(_0x4425c8,_0x37ff1a,_0xa288('0x48'),_0x15d529[_0x314333][_0x5ef0fa]);break;case 0x7:if(_0x4895bb[_0xa288('0x5')]!==_0xa288('0x6'))_0x4425c8[_0x37ff1a](util[_0xa288('0x1b')](_0xa288('0x49'),_0x15d529[_0x314333][_0x5ef0fa][_0xa288('0x7')]));break;case 0x8:if(_0x4895bb[_0xa288('0x5')]!=='agent')_0x4425c8[_0x37ff1a](util[_0xa288('0x1b')](_0xa288('0x4a'),_0x15d529[_0x314333][_0x5ef0fa]['name']));break;case 0x9:if(_0x4895bb['role']!==_0xa288('0x6'))_0x4425c8[_0x37ff1a](util[_0xa288('0x1b')](_0xa288('0x4b'),_0x15d529[_0x314333][_0x5ef0fa]['type'],_0x15d529[_0x314333][_0x5ef0fa]['name']));break;case 0xa:_0x4425c8[_0x37ff1a](util[_0xa288('0x1b')](_0xa288('0x2d'),_0x15d529[_0x314333][_0x5ef0fa][_0xa288('0x7')]));break;}}}}})['then'](function(){if(_0x37ff1a===_0xa288('0x4c')){var _0x456d7f=_[_0xa288('0x4d')](_0x4895bb[_0xa288('0x24')],'id');return _0x4895bb[_0xa288('0x4e')](_0x456d7f)['then'](function(){for(var _0x43bed5=0x0;_0x43bed5<_0x456d7f[_0xa288('0x1e')];_0x43bed5+=0x1){_0x2f9465['emit'](_0xa288('0x4f'),{'ChatInteractionId':Number(_0x456d7f[_0x43bed5]),'UserId':Number(_0x4895bb['id'])});}});}})['then'](function(){if(_0x37ff1a==='leave'){var _0x5a561d=_[_0xa288('0x4d')](_0x4895bb[_0xa288('0x26')],'id');return _0x4895bb[_0xa288('0x50')](_0x5a561d)[_0xa288('0xc')](function(){for(var _0x527740=0x0;_0x527740<_0x5a561d[_0xa288('0x1e')];_0x527740+=0x1){_0x2f9465[_0xa288('0x51')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5a561d[_0x527740]),'UserId':Number(_0x4895bb['id'])});}});}})[_0xa288('0xc')](function(){if(_0x37ff1a===_0xa288('0x4c')){var _0x3b8737=_[_0xa288('0x4d')](_0x4895bb[_0xa288('0x28')],'id');return _0x4895bb[_0xa288('0x52')](_0x3b8737)[_0xa288('0xc')](function(){for(var _0x4a8ee4=0x0;_0x4a8ee4<_0x3b8737[_0xa288('0x1e')];_0x4a8ee4+=0x1){_0x2f9465[_0xa288('0x51')](_0xa288('0x53'),{'FaxInteractionId':Number(_0x3b8737[_0x4a8ee4]),'UserId':Number(_0x4895bb['id'])});}});}})[_0xa288('0xc')](function(){if(_0x37ff1a===_0xa288('0x4c')){var _0x18289f=_[_0xa288('0x4d')](_0x4895bb[_0xa288('0x54')],'id');return _0x4895bb['removeSmsInteractions'](_0x18289f)[_0xa288('0xc')](function(){for(var _0x5205a2=0x0;_0x5205a2<_0x18289f[_0xa288('0x1e')];_0x5205a2+=0x1){_0x2f9465['emit'](_0xa288('0x55'),{'SmsInteractionId':Number(_0x18289f[_0x5205a2]),'UserId':Number(_0x4895bb['id'])});}});}})[_0xa288('0xc')](function(){if(_0x37ff1a===_0xa288('0x4c')){var _0x2049e2=_[_0xa288('0x4d')](_0x4895bb[_0xa288('0x2a')],'id');return _0x4895bb[_0xa288('0x56')](_0x2049e2)[_0xa288('0xc')](function(){for(var _0x47a2c8=0x0;_0x47a2c8<_0x2049e2[_0xa288('0x1e')];_0x47a2c8+=0x1){_0x2f9465[_0xa288('0x51')](_0xa288('0x57'),{'OpenchannelInteractionId':Number(_0x2049e2[_0x47a2c8]),'UserId':Number(_0x4895bb['id'])});}});}})[_0xa288('0xc')](function(){if(_0x37ff1a===_0xa288('0x4c')){var _0x1f5349=_['map'](_0x4895bb[_0xa288('0x2c')],'id');return _0x4895bb[_0xa288('0x58')](_0x1f5349)[_0xa288('0xc')](function(){for(var _0x5c474c=0x0;_0x5c474c<_0x1f5349[_0xa288('0x1e')];_0x5c474c+=0x1){_0x2f9465[_0xa288('0x51')](_0xa288('0x59'),{'WhatsappInteractionId':Number(_0x1f5349[_0x5c474c]),'UserId':Number(_0x4895bb['id'])});}});}})['catch'](function(_0x2fe348){_0x4425c8[_0xa288('0x5a')](_0x2fe348);});}}function onDisconnect(_0x4cff24,_0x10da90){joinOrLeave(_0x4cff24,'leave',_0x10da90);}function onConnect(_0x4a528e){joinOrLeave(_0x4a528e,_0xa288('0x5b'));}exports['default']=function(_0x3e7d71){_0x3e7d71['on'](_0xa288('0x5c'),function(_0x37522b){_0x37522b[_0xa288('0x5d')](0x0);_0x37522b['address']=_0x37522b[_0xa288('0x5e')][_0xa288('0x5c')][_0xa288('0x5f')]+':'+_0x37522b[_0xa288('0x5e')][_0xa288('0x5c')][_0xa288('0x60')];_0x37522b[_0xa288('0x61')]=new Date();_0x37522b[_0xa288('0x5a')]=function(_0x5f2d28){console[_0xa288('0x5a')](_0xa288('0x62')+_0x37522b[_0xa288('0x63')]['name']+'['+_0x37522b['address']+']',_0x5f2d28);};_0x37522b['on'](_0xa288('0x64'),function(){onDisconnect(_0x37522b,_0x3e7d71);_0x37522b[_0xa288('0x5a')]('DISCONNECTED');});onConnect(_0x37522b);_0x37522b['log']('CONNECTED');});}; \ No newline at end of file +var _0xa3d4=['ChatQueue','push','MailQueue','OpenchannelQueue','Campaign','user','FaxQueue','SmsQueue','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','Agents','telephone','name','agent','type','ivr','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','role','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue'];(function(_0x2dc21b,_0x308a8c){var _0x42be3d=function(_0xebe384){while(--_0xebe384){_0x2dc21b['push'](_0x2dc21b['shift']());}};_0x42be3d(++_0x308a8c);}(_0xa3d4,0x151));var _0x4a3d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa3d4[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4a3d('0x0'));var util=require('util');var BPromise=require(_0x4a3d('0x1'));var db=require(_0x4a3d('0x2'))['db'];var config=require(_0x4a3d('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x4a3d('0x4'),'model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4a3d('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4a3d('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x4a3d('0x6')],'where':{'role':_0x4a3d('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4a3d('0x6'),_0x4a3d('0x8')],'where':{'type':_0x4a3d('0x9')}};function getAssociatedResources(_0x79f478,_0xb772a4,_0x4d941e){return db['UserProfileSection']['findOne']({'where':{'name':_0x79f478,'userProfileId':_0xb772a4},'raw':!![]})[_0x4a3d('0xa')](function(_0x465d87){if(_0x465d87){if(_0x465d87[_0x4a3d('0xb')]){switch(_0x79f478){case _0x4a3d('0xc'):case _0x4a3d('0xd'):case _0x4a3d('0xe'):case _0x4a3d('0xf'):case _0x4a3d('0x10'):case _0x4a3d('0x11'):case _0x4a3d('0x12'):return db[_0x4d941e][_0x4a3d('0x13')](queryQueues);case _0x4a3d('0x14'):return db[_0x4d941e][_0x4a3d('0x13')](queryTelephones);case _0x4a3d('0x15'):return db[_0x4d941e][_0x4a3d('0x13')](queryTrunks);case _0x4a3d('0x16'):return db[_0x4d941e]['findAll'](queryCampaigns);}}else{return db[_0x4a3d('0x17')][_0x4a3d('0x13')]({'attributes':[_0x4a3d('0x18')],'where':{'sectionId':_0x465d87['id']},'raw':!![]})[_0x4a3d('0xa')](function(_0x5c9435){if(_0x5c9435){var _0xd29733={'where':{'id':_[_0x4a3d('0x19')](_0x5c9435,_0x4a3d('0x18'))},'raw':!![]};switch(_0x4d941e){case _0x4a3d('0x1a'):_0xd29733[_0x4a3d('0x1b')][_0x4a3d('0x1c')]=_0x4a3d('0x5');break;case'Campaign':_0xd29733['where'][_0x4a3d('0x8')]=_0x4a3d('0x9');break;}return db[_0x4d941e][_0x4a3d('0x13')](_0xd29733);}else{return[];}});}}else{return[];}})['then'](function(_0x4058ce){return _0x4058ce;});}function joinOrLeaveQueues(_0x2a141e,_0x3ac9cb,_0x1312d5,_0x2b38fd){_0x2a141e[_0x3ac9cb](util[_0x4a3d('0x1d')]('%s:queue:%s',_0x1312d5,_0x2b38fd[_0x4a3d('0x6')]));if(_0x2b38fd[_0x4a3d('0x4')]){for(var _0x46924c=0x0;_0x46924c<_0x2b38fd['Agents'][_0x4a3d('0x1e')];_0x46924c+=0x1){_0x2a141e[_0x3ac9cb](util[_0x4a3d('0x1d')](_0x4a3d('0x1f'),_0x2b38fd[_0x4a3d('0x4')][_0x46924c]['name']));}}}function joinOrLeave(_0x227047,_0x333654,_0x4a038e){var _0x1a69c2;if(_0x227047[_0x4a3d('0x20')][_0x4a3d('0x21')]['id']){db[_0x4a3d('0x1a')][_0x4a3d('0x22')]({'attributes':['id',_0x4a3d('0x6'),'role',_0x4a3d('0x23')],'where':{'id':_0x227047[_0x4a3d('0x20')]['query']['id']},'include':[{'model':db[_0x4a3d('0x24')],'as':_0x4a3d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a3d('0x26')],'as':_0x4a3d('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4a3d('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4a3d('0x29')],'as':_0x4a3d('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a3d('0x2b')],'as':_0x4a3d('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x4a3d('0xa')](function(_0x25d92d){if(_0x25d92d){_0x1a69c2=_0x25d92d;_0x227047[_0x333654](util[_0x4a3d('0x1d')](_0x4a3d('0x1f'),_0x25d92d[_0x4a3d('0x6')]));var _0x366136=[];switch(_0x25d92d[_0x4a3d('0x1c')]){case _0x4a3d('0x2d'):_0x227047[_0x333654](_0x4a3d('0x2e'));_0x227047[_0x333654](_0x4a3d('0x2f'));if(queryQueues[_0x4a3d('0x30')](_0x4a3d('0x31'))){delete queryQueues[_0x4a3d('0x31')];}_0x366136['push'](db[_0x4a3d('0x32')][_0x4a3d('0x13')](queryQueues));_0x366136['push'](db[_0x4a3d('0x33')][_0x4a3d('0x13')](queryQueues));_0x366136[_0x4a3d('0x34')](db['FaxQueue'][_0x4a3d('0x13')](queryQueues));_0x366136[_0x4a3d('0x34')](db['SmsQueue']['findAll'](queryQueues));_0x366136[_0x4a3d('0x34')](db[_0x4a3d('0x35')][_0x4a3d('0x13')](queryQueues));_0x366136['push'](db[_0x4a3d('0x36')]['findAll'](queryQueues));_0x366136['push'](db['WhatsappQueue'][_0x4a3d('0x13')](queryQueues));_0x366136[_0x4a3d('0x34')](db[_0x4a3d('0x1a')][_0x4a3d('0x13')](queryTelephones));_0x366136[_0x4a3d('0x34')](db['Trunk'][_0x4a3d('0x13')](queryTrunks));_0x366136[_0x4a3d('0x34')](db[_0x4a3d('0x37')][_0x4a3d('0x13')](queryCampaigns));_0x366136[_0x4a3d('0x34')](db['User'][_0x4a3d('0x13')](queryAgents));break;case _0x4a3d('0x38'):_0x227047[_0x333654](_0x4a3d('0x2e'));_0x227047[_0x333654](_0x4a3d('0x2f'));_0x366136['push'](getAssociatedResources(_0x4a3d('0xc'),_0x25d92d[_0x4a3d('0x23')],_0x4a3d('0x32')));_0x366136['push'](getAssociatedResources('ChatQueues',_0x25d92d['userProfileId'],_0x4a3d('0x33')));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0xe'),_0x25d92d['userProfileId'],_0x4a3d('0x39')));_0x366136[_0x4a3d('0x34')](getAssociatedResources('SmsQueues',_0x25d92d[_0x4a3d('0x23')],_0x4a3d('0x3a')));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0x10'),_0x25d92d[_0x4a3d('0x23')],'MailQueue'));_0x366136['push'](getAssociatedResources(_0x4a3d('0x11'),_0x25d92d[_0x4a3d('0x23')],_0x4a3d('0x36')));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0x12'),_0x25d92d[_0x4a3d('0x23')],'WhatsappQueue'));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0x14'),_0x25d92d['userProfileId'],'User'));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0x15'),_0x25d92d[_0x4a3d('0x23')],'Trunk'));_0x366136[_0x4a3d('0x34')](getAssociatedResources(_0x4a3d('0x16'),_0x25d92d[_0x4a3d('0x23')],'Campaign'));_0x366136[_0x4a3d('0x34')](db[_0x4a3d('0x1a')][_0x4a3d('0x13')](queryAgents));break;case _0x4a3d('0x7'):_0x227047[_0x333654](_0x4a3d('0x2e'));_0x227047[_0x333654](_0x4a3d('0x2f'));_0x366136['push'](_0x25d92d[_0x4a3d('0x3b')]({'attributes':['id',_0x4a3d('0x6')]}));_0x366136[_0x4a3d('0x34')](_0x25d92d[_0x4a3d('0x3c')]({'attributes':['id',_0x4a3d('0x6')]}));_0x366136[_0x4a3d('0x34')](_0x25d92d[_0x4a3d('0x3d')]({'attributes':['id',_0x4a3d('0x6')]}));_0x366136[_0x4a3d('0x34')](_0x25d92d['getSmsQueues']({'attributes':['id',_0x4a3d('0x6')]}));_0x366136[_0x4a3d('0x34')](_0x25d92d['getMailQueues']({'attributes':['id','name']}));_0x366136[_0x4a3d('0x34')](_0x25d92d[_0x4a3d('0x3e')]({'attributes':['id','name']}));_0x366136[_0x4a3d('0x34')](_0x25d92d[_0x4a3d('0x3f')]({'attributes':['id',_0x4a3d('0x6')]}));break;}return BPromise['all'](_0x366136);}})[_0x4a3d('0xa')](function(_0x4f87f0){if(_0x4f87f0&&_0x4f87f0['length']){for(var _0x2e44bf=0x0;_0x2e44bf<_0x4f87f0[_0x4a3d('0x1e')];_0x2e44bf+=0x1){for(var _0x4cb1ac=0x0;_0x4cb1ac<_0x4f87f0[_0x2e44bf][_0x4a3d('0x1e')];_0x4cb1ac+=0x1){switch(_0x2e44bf){case 0x0:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x40'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x1:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x41'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x2:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x42'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x3:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x43'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x4:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x44'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x5:joinOrLeaveQueues(_0x227047,_0x333654,_0x4a3d('0x45'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x6:joinOrLeaveQueues(_0x227047,_0x333654,'whatsapp',_0x4f87f0[_0x2e44bf][_0x4cb1ac]);break;case 0x7:if(_0x1a69c2['role']!==_0x4a3d('0x7'))_0x227047[_0x333654](util[_0x4a3d('0x1d')]('telephone:%s',_0x4f87f0[_0x2e44bf][_0x4cb1ac][_0x4a3d('0x6')]));break;case 0x8:if(_0x1a69c2[_0x4a3d('0x1c')]!==_0x4a3d('0x7'))_0x227047[_0x333654](util['format'](_0x4a3d('0x46'),_0x4f87f0[_0x2e44bf][_0x4cb1ac][_0x4a3d('0x6')]));break;case 0x9:if(_0x1a69c2[_0x4a3d('0x1c')]!==_0x4a3d('0x7'))_0x227047[_0x333654](util['format']('campaign:%s:%s',_0x4f87f0[_0x2e44bf][_0x4cb1ac][_0x4a3d('0x8')],_0x4f87f0[_0x2e44bf][_0x4cb1ac][_0x4a3d('0x6')]));break;case 0xa:_0x227047[_0x333654](util[_0x4a3d('0x1d')](_0x4a3d('0x1f'),_0x4f87f0[_0x2e44bf][_0x4cb1ac]['name']));break;}}}}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0x186ae0=_[_0x4a3d('0x19')](_0x1a69c2['ChatInteractions'],'id');return _0x1a69c2[_0x4a3d('0x48')](_0x186ae0)[_0x4a3d('0xa')](function(){for(var _0x5d954d=0x0;_0x5d954d<_0x186ae0['length'];_0x5d954d+=0x1){_0x4a038e[_0x4a3d('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x186ae0[_0x5d954d]),'UserId':Number(_0x1a69c2['id'])});}});}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0x362e80=_[_0x4a3d('0x19')](_0x1a69c2['MailInteractions'],'id');return _0x1a69c2[_0x4a3d('0x4a')](_0x362e80)[_0x4a3d('0xa')](function(){for(var _0x297e25=0x0;_0x297e25<_0x362e80[_0x4a3d('0x1e')];_0x297e25+=0x1){_0x4a038e[_0x4a3d('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x362e80[_0x297e25]),'UserId':Number(_0x1a69c2['id'])});}});}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0xb7ea06=_[_0x4a3d('0x19')](_0x1a69c2['FaxInteractions'],'id');return _0x1a69c2[_0x4a3d('0x4b')](_0xb7ea06)[_0x4a3d('0xa')](function(){for(var _0x4306ae=0x0;_0x4306ae<_0xb7ea06[_0x4a3d('0x1e')];_0x4306ae+=0x1){_0x4a038e[_0x4a3d('0x49')](_0x4a3d('0x4c'),{'FaxInteractionId':Number(_0xb7ea06[_0x4306ae]),'UserId':Number(_0x1a69c2['id'])});}});}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0x43abd4=_[_0x4a3d('0x19')](_0x1a69c2[_0x4a3d('0x4d')],'id');return _0x1a69c2[_0x4a3d('0x4e')](_0x43abd4)[_0x4a3d('0xa')](function(){for(var _0x1a8f46=0x0;_0x1a8f46<_0x43abd4[_0x4a3d('0x1e')];_0x1a8f46+=0x1){_0x4a038e[_0x4a3d('0x49')](_0x4a3d('0x4f'),{'SmsInteractionId':Number(_0x43abd4[_0x1a8f46]),'UserId':Number(_0x1a69c2['id'])});}});}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0x32cf89=_[_0x4a3d('0x19')](_0x1a69c2[_0x4a3d('0x2a')],'id');return _0x1a69c2[_0x4a3d('0x50')](_0x32cf89)['then'](function(){for(var _0x1bdfcf=0x0;_0x1bdfcf<_0x32cf89['length'];_0x1bdfcf+=0x1){_0x4a038e['emit'](_0x4a3d('0x51'),{'OpenchannelInteractionId':Number(_0x32cf89[_0x1bdfcf]),'UserId':Number(_0x1a69c2['id'])});}});}})[_0x4a3d('0xa')](function(){if(_0x333654===_0x4a3d('0x47')){var _0x3a4d8f=_['map'](_0x1a69c2['WhatsappInteractions'],'id');return _0x1a69c2['removeWhatsappInteractions'](_0x3a4d8f)[_0x4a3d('0xa')](function(){for(var _0x217f0f=0x0;_0x217f0f<_0x3a4d8f[_0x4a3d('0x1e')];_0x217f0f+=0x1){_0x4a038e['emit'](_0x4a3d('0x52'),{'WhatsappInteractionId':Number(_0x3a4d8f[_0x217f0f]),'UserId':Number(_0x1a69c2['id'])});}});}})['catch'](function(_0xb3bb20){_0x227047[_0x4a3d('0x53')](_0xb3bb20);});}}function onDisconnect(_0x685f78,_0x4691f6){joinOrLeave(_0x685f78,_0x4a3d('0x47'),_0x4691f6);}function onConnect(_0x548b7e){joinOrLeave(_0x548b7e,_0x4a3d('0x54'));}exports[_0x4a3d('0x55')]=function(_0x3473c1){_0x3473c1['on'](_0x4a3d('0x56'),function(_0x3213da){_0x3213da[_0x4a3d('0x57')](0x0);_0x3213da[_0x4a3d('0x58')]=_0x3213da[_0x4a3d('0x59')][_0x4a3d('0x56')][_0x4a3d('0x5a')]+':'+_0x3213da[_0x4a3d('0x59')][_0x4a3d('0x56')]['remotePort'];_0x3213da[_0x4a3d('0x5b')]=new Date();_0x3213da[_0x4a3d('0x53')]=function(_0x390721){console['log'](_0x4a3d('0x5c')+_0x3213da[_0x4a3d('0x5d')][_0x4a3d('0x6')]+'['+_0x3213da[_0x4a3d('0x58')]+']',_0x390721);};_0x3213da['on'](_0x4a3d('0x5e'),function(){onDisconnect(_0x3213da,_0x3473c1);_0x3213da['log'](_0x4a3d('0x5f'));});onConnect(_0x3213da);_0x3213da[_0x4a3d('0x53')](_0x4a3d('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index f7f6bba..e58e52c 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 _0x804c=['toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','SmsMessage','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','catch','channel','motionChannel','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','find','name','fullname','email','internal','format','SIP/%s','agent','incomingmessage','AfterCreateMessage','outgoingmessage','opened','closed','changed','substatus','query','User','interface','AfterUpdate','default','hasOwnProperty','model','hook'];(function(_0x54f59b,_0xee035f){var _0x4c0135=function(_0x10102b){while(--_0x10102b){_0x54f59b['push'](_0x54f59b['shift']());}};_0x4c0135(++_0xee035f);}(_0x804c,0x15b));var _0xc804=function(_0x4015aa,_0x5f410f){_0x4015aa=_0x4015aa-0x0;var _0x17ef21=_0x804c[_0x4015aa];return _0x17ef21;};'use strict';var util=require(_0xc804('0x0'));var db=require(_0xc804('0x1'))['db'];var jayson=require(_0xc804('0x2'));var logger=require(_0xc804('0x3'))(_0xc804('0x4'));var client=jayson[_0xc804('0x5')][_0xc804('0x6')]({'port':0x232a});var triggers=[{'channel':_0xc804('0x7'),'model':_0xc804('0x8'),'event':_0xc804('0x9'),'condition':_0xc804('0xa'),'callback':afterCreate},{'channel':_0xc804('0x7'),'model':_0xc804('0x8'),'event':_0xc804('0xb'),'condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':_0xc804('0x7'),'model':_0xc804('0xd'),'event':_0xc804('0x9'),'condition':_0xc804('0xe'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xc804('0xf'),'event':_0xc804('0x9'),'condition':_0xc804('0xa'),'callback':afterCreate},{'channel':'Sms','model':_0xc804('0xf'),'event':_0xc804('0xb'),'condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':'Sms','model':_0xc804('0x10'),'event':'afterCreate','condition':_0xc804('0xe'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xc804('0x11'),'event':_0xc804('0x9'),'condition':_0xc804('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xc804('0xb'),'condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xc804('0x12'),'event':_0xc804('0x9'),'condition':_0xc804('0xe'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xc804('0x13'),'event':_0xc804('0x9'),'condition':_0xc804('0xa'),'callback':afterCreate},{'channel':_0xc804('0x14'),'model':_0xc804('0x13'),'event':_0xc804('0xb'),'condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':_0xc804('0x14'),'model':'FaxMessage','event':_0xc804('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc804('0x15'),'model':_0xc804('0x16'),'event':'afterCreate','condition':_0xc804('0xa'),'callback':afterCreate},{'channel':'Mail','model':_0xc804('0x16'),'event':'afterUpdate','condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':_0xc804('0x15'),'model':'MailMessage','event':'afterCreate','condition':_0xc804('0xe'),'callback':afterCreateMessage},{'channel':_0xc804('0x17'),'model':_0xc804('0x18'),'event':_0xc804('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0xc804('0x18'),'event':'afterUpdate','condition':_0xc804('0xc'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xc804('0x19'),'event':_0xc804('0x9'),'condition':_0xc804('0xe'),'callback':afterCreateMessage}];function request(_0x46ede0){return client['request'](_0xc804('0x1a'),_0x46ede0)[_0xc804('0x1b')](function(_0x41d043){logger['info'](_0xc804('0x1c'),_0xc804('0x1a'),_0x41d043);if(_0x41d043['error']){if(_0x41d043[_0xc804('0x1d')]['code']===0x1f4){logger[_0xc804('0x1d')](_0xc804('0x1c'),_0xc804('0x1a'),_0x41d043[_0xc804('0x1d')]);}}})[_0xc804('0x1e')](function(_0x2e113e){logger['error'](_0xc804('0x1c'),_0xc804('0x1a'),_0x2e113e);});}function afterCreateMessage(_0x566d1e){return function(_0x4c9ccf){_0x4c9ccf=_0x4c9ccf['get']({'plain':!![]});_0x4c9ccf[_0xc804('0x1f')]=_0x566d1e;_0x4c9ccf[_0xc804('0x20')]=_0x566d1e;_0x4c9ccf[_0xc804('0x21')]=_0x4c9ccf[_0xc804('0x22')];Promise[_0xc804('0x23')]()['then'](function(){if(typeof _0x4c9ccf[_0xc804('0x24')]==='undefined')return null;var _0x2c1736=_0xc804('0x25')+_0x4c9ccf['ContactId'];return db[_0xc804('0x26')]['query'](_0x2c1736,{'type':db[_0xc804('0x27')][_0xc804('0x28')][_0xc804('0x29')],'raw':!![]});})[_0xc804('0x1b')](function(_0x176629){if(_0x176629){_0x4c9ccf[_0xc804('0x2a')]=_0x176629[0x0];}if(_0x4c9ccf[_0xc804('0x2b')]){return db['User'][_0xc804('0x2c')]({'where':{'id':_0x4c9ccf[_0xc804('0x2b')]},'attributes':['id',_0xc804('0x2d'),_0xc804('0x2e'),_0xc804('0x2f'),_0xc804('0x30')],'raw':!![]})['then'](function(_0x45d028){_0x4c9ccf['interface']=util[_0xc804('0x31')](_0xc804('0x32'),_0x45d028[_0xc804('0x2d')]);_0x4c9ccf['channel']=_0x566d1e;_0x4c9ccf[_0xc804('0x33')]=_0x45d028;return request({'event':_0xc804('0x34'),'message':_0x4c9ccf});})[_0xc804('0x1e')](function(_0x58edfa){logger[_0xc804('0x1d')](_0xc804('0x1c'),_0xc804('0x35'),_0x58edfa);});}else{return request({'event':_0xc804('0x36'),'message':_0x4c9ccf});}});};}function afterCreate(_0x241660,_0x5daf0f){return function(_0x45296e){_0x45296e=_0x45296e['get']({'plain':!![]});_0x45296e[_0xc804('0x1f')]=_0x241660;_0x45296e[_0xc804('0x20')]=_0x241660;_0x45296e[_0xc804('0x21')]=_0xc804('0x37');var _0xa8b7bc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45296e['ContactId'];return db[_0xc804('0x26')]['query'](_0xa8b7bc,{'type':db['Sequelize']['QueryTypes'][_0xc804('0x29')],'raw':!![]})['then'](function(_0x47a08d){return _0x47a08d;})[_0xc804('0x1b')](function(_0x1920aa){if(_0x1920aa){_0x45296e['contact']=_0x1920aa[0x0];}return request({'event':_0x5daf0f,'message':_0x45296e});});};}function afterUpdate(_0x70cf68){return function(_0x25b307){var _0x3ef582=_0x25b307['changed']('closed')&&_0x25b307[_0xc804('0x38')];var _0x2dd131=_0x25b307[_0xc804('0x39')](_0xc804('0x3a'));if(_0x3ef582||_0x2dd131){var _0x3ea8a5=_0x3ef582?'closedinteraction':'substatus';var _0x2b5f0e=_0x25b307['get']({'plain':!![]});_0x2b5f0e[_0xc804('0x1f')]=_0x70cf68;_0x2b5f0e[_0xc804('0x20')]=_0x70cf68;_0x2b5f0e[_0xc804('0x21')]=_0x3ef582?_0xc804('0x38'):_0xc804('0x3a');var _0x16ac81=_0xc804('0x25')+_0x2b5f0e[_0xc804('0x24')];return db[_0xc804('0x26')][_0xc804('0x3b')](_0x16ac81,{'type':db['Sequelize'][_0xc804('0x28')][_0xc804('0x29')],'raw':!![]})[_0xc804('0x1b')](function(_0x5d22e2){if(_0x5d22e2){_0x2b5f0e['contact']=_0x5d22e2[0x0];}if(_0x2b5f0e['UserId']){return db[_0xc804('0x3c')][_0xc804('0x2c')]({'where':{'id':_0x2b5f0e[_0xc804('0x2b')]},'attributes':['id',_0xc804('0x2d'),'fullname','email',_0xc804('0x30')],'raw':!![]})[_0xc804('0x1b')](function(_0xc1ec){_0x2b5f0e[_0xc804('0x3d')]=util[_0xc804('0x31')](_0xc804('0x32'),_0xc1ec[_0xc804('0x2d')]);_0x2b5f0e['agent']=_0xc1ec;return request({'event':_0x3ea8a5,'message':_0x2b5f0e});})[_0xc804('0x1e')](function(_0x5c414e){logger[_0xc804('0x1d')](_0xc804('0x1c'),_0xc804('0x3e'),_0x5c414e);});}else{return request({'event':_0x3ea8a5,'message':_0x2b5f0e});}});}};}exports[_0xc804('0x3f')]=function(){for(var _0x5db9b2=0x0;_0x5db9b2=_0x47de9e[_0x96f3('0x17')]){throw Error(_0x96f3('0x18'));}_0x5d724c(_0x20462d);})['catch'](function(_0x428df6){_0x51710f(_0x428df6);});});}; \ No newline at end of file +var _0xc64f=['./license/util','mail','chat','fax','sms','isValidChannel','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','catch','lodash'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xc64f,0xaa));var _0xfc64=function(_0x4b37b5,_0x5ab532){_0x4b37b5=_0x4b37b5-0x0;var _0x3b6f6b=_0xc64f[_0x4b37b5];return _0x3b6f6b;};'use strict';var _=require(_0xfc64('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xfc64('0x1'));var channels=['voice',_0xfc64('0x2'),_0xfc64('0x3'),_0xfc64('0x4'),_0xfc64('0x5'),'whatsapp','openchannel'];exports['getChannels']=function(){return channels;};exports[_0xfc64('0x6')]=function(_0x59e31c){_0x59e31c=_0x59e31c['toLowerCase']();return _[_0xfc64('0x7')](channels,_0x59e31c);};exports['clearBlockUser']=function(_0x18c86e,_0x25f838,_0x21e41f,_0x476990){var _0x62e29={'loginAttempts':_0x25f838,'blocked':_0x21e41f};if(!_[_0xfc64('0x8')](_0x476990)){_0x62e29[_0xfc64('0x9')]=_0x476990;}return _0x18c86e[_0xfc64('0xa')](_0x62e29);};exports[_0xfc64('0xb')]=function(_0x1ed2bc){return new BPromise(function(_0x4abf3f,_0x477880){var _0xfff38b=0x0;if(_0x1ed2bc[_0xfc64('0xc')]!==_0xfc64('0xd')){_0x4abf3f(_0x1ed2bc);}db[_0xfc64('0xe')][_0xfc64('0xf')]({'where':{'role':_0xfc64('0xd'),'online':!![],'id':{'$ne':_0x1ed2bc['id']}}})[_0xfc64('0x10')](function(_0x472664){_0xfff38b=_0x472664;return util['getLicense']();})[_0xfc64('0x10')](function(_0x583762){if(_0x583762&&_0x583762[_0xfc64('0x11')]&&_0xfff38b>=_0x583762[_0xfc64('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4abf3f(_0x1ed2bc);})[_0xfc64('0x12')](function(_0x2469f7){_0x477880(_0x2469f7);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b7ace73..65bab2c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd4f=['send','exports','render'];(function(_0x194b5c,_0x3e4893){var _0x2badf6=function(_0x28433a){while(--_0x28433a){_0x194b5c['push'](_0x194b5c['shift']());}};_0x2badf6(++_0x3e4893);}(_0xcd4f,0x175));var _0xfcd4=function(_0x3d5934,_0x55a026){_0x3d5934=_0x3d5934-0x0;var _0x4969e9=_0xcd4f[_0x3d5934];return _0x4969e9;};'use strict';module[_0xfcd4('0x0')][0x194]=function pageNotFound(_0x796406,_0x4f0dc4){var _0x3fb6e8='404';var _0x3503e3=0x194;var _0x1d565a={'status':_0x3503e3};_0x4f0dc4['status'](_0x1d565a['status']);_0x4f0dc4[_0xfcd4('0x1')](_0x3fb6e8,{},function(_0x2c3e41,_0x4ac824){if(_0x2c3e41){return _0x4f0dc4['status'](_0x1d565a['status'])['json'](_0x1d565a);}_0x4f0dc4[_0xfcd4('0x2')](_0x4ac824);});}; \ No newline at end of file +var _0xc927=['404','status','render','json','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc927,0xea));var _0x7c92=function(_0x2d042c,_0x13e91a){_0x2d042c=_0x2d042c-0x0;var _0x49062a=_0xc927[_0x2d042c];return _0x49062a;};'use strict';module[_0x7c92('0x0')][0x194]=function pageNotFound(_0x4ac747,_0x9d5de0){var _0x4c893a=_0x7c92('0x1');var _0x5f23a3=0x194;var _0x3a7749={'status':_0x5f23a3};_0x9d5de0['status'](_0x3a7749[_0x7c92('0x2')]);_0x9d5de0[_0x7c92('0x3')](_0x4c893a,{},function(_0x51dab9,_0x4cd72a){if(_0x51dab9){return _0x9d5de0[_0x7c92('0x2')](_0x3a7749[_0x7c92('0x2')])[_0x7c92('0x4')](_0x3a7749);}_0x9d5de0['send'](_0x4cd72a);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a5c0f2e..480cf3d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e6c=['OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','Contact','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','MailApplication','List','Template','TemplateId','MailInteractionId','Account','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Interactions','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','Owner','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','Answers','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Campaign','OwnerId','CmHopperBlack','CampaignId','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Extensions','FaxApplications','SmsApplications','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','Configurations','DeskField','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','Description','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','FreshsalesField','FromId','SessionId','JscriptyAnswerReport','ProjectId','TeamVoiceQueue','team_has_mail_queues','team_has_chat_queues','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','Queues','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','jstz','determine','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','defaultsDeep','motion2','xC@LL1234','utf8mb4','utf8_general_ci','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','import','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','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','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','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/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../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','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueue','SmsQueues'];(function(_0x183a44,_0x4fd341){var _0x45d226=function(_0x32c204){while(--_0x32c204){_0x183a44['push'](_0x183a44['shift']());}};_0x45d226(++_0x4fd341);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var config=require(_0xc6e6('0x0'));var Sequelize=require(_0xc6e6('0x1'));var _=require('lodash');var jstz=require(_0xc6e6('0x2'));var timezone=jstz[_0xc6e6('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0xc6e6('0x1')],{'database':'motion2','username':_0xc6e6('0x4'),'password':'xC@LL1234','options':{'host':_0xc6e6('0x5'),'port':0xcea,'dialect':_0xc6e6('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc6e6('0x7')](),'define':{'charset':_0xc6e6('0x8'),'collate':'utf8_general_ci'}}});config[_0xc6e6('0x9')]=_[_0xc6e6('0xa')](config['sequelizeHistory'],{'database':_0xc6e6('0xb'),'username':'xcall','password':_0xc6e6('0xc'),'options':{'host':_0xc6e6('0x5'),'port':0xcea,'dialect':_0xc6e6('0x6'),'dialectOptions':{'charset':_0xc6e6('0xd')},'logging':![],'timezone':timezone[_0xc6e6('0x7')](),'define':{'charset':_0xc6e6('0x8'),'collate':_0xc6e6('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc6e6('0x1')][_0xc6e6('0xf')],config['sequelize'][_0xc6e6('0x10')],config['sequelize'][_0xc6e6('0x11')],config[_0xc6e6('0x1')][_0xc6e6('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc6e6('0x9')]['database'],config[_0xc6e6('0x9')][_0xc6e6('0x10')],config[_0xc6e6('0x9')][_0xc6e6('0x11')],config[_0xc6e6('0x9')]['options'])};db[_0xc6e6('0x13')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x14'));db[_0xc6e6('0x15')]=db[_0xc6e6('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x16'));db[_0xc6e6('0x17')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x19'));db[_0xc6e6('0x1a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1b'));db[_0xc6e6('0x1c')]=db['sequelize'][_0xc6e6('0x18')]('../api/voiceQueue/voiceQueue.model');db[_0xc6e6('0x1d')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1e'));db['ScreenRecording']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1f'));db[_0xc6e6('0x20')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x21'));db['VoiceMailMessage']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x22'));db[_0xc6e6('0x23')]=db['sequelize'][_0xc6e6('0x18')]('../api/voiceCallReport/voiceCallReport.model');db[_0xc6e6('0x24')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x25'));db[_0xc6e6('0x26')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xc6e6('0x27')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x28'));db['MemberReport']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x29'));db[_0xc6e6('0x2a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2b'));db[_0xc6e6('0x2c')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2d'));db[_0xc6e6('0x2e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2f'));db[_0xc6e6('0x30')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x31'));db['UserChatQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x32'));db[_0xc6e6('0x33')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userFaxQueue/userFaxQueue.model');db[_0xc6e6('0x34')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x35'));db[_0xc6e6('0x36')]=db['sequelize']['import'](_0xc6e6('0x37'));db['MailServerIn']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x38'));db[_0xc6e6('0x39')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x3a'));db[_0xc6e6('0x3b')]=db['sequelize']['import'](_0xc6e6('0x3c'));db[_0xc6e6('0x3d')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/mailSubstatus/mailSubstatus.model');db[_0xc6e6('0x3e')]=db[_0xc6e6('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xc6e6('0x3f')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x40'));db['MailApplication']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x41'));db['MailQueueReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x42'));db[_0xc6e6('0x43')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x44'));db[_0xc6e6('0x45')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x46'));db[_0xc6e6('0x47')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/faxAccount/faxAccount.model');db[_0xc6e6('0x48')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x49'));db['FaxInteraction']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x4a'));db[_0xc6e6('0x4b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x4c'));db['FaxQueue']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x4d'));db[_0xc6e6('0x4e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x4f'));db[_0xc6e6('0x50')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsAccount/smsAccount.model');db[_0xc6e6('0x51')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsApplication/smsApplication.model');db[_0xc6e6('0x52')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x53'));db[_0xc6e6('0x54')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x55'));db[_0xc6e6('0x56')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x57'));db[_0xc6e6('0x58')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x59'));db['OpenchannelApplication']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xc6e6('0x5a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x5b'));db[_0xc6e6('0x5c')]=db['sequelize']['import'](_0xc6e6('0x5d'));db[_0xc6e6('0x5e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatWebsite/chatWebsite.model');db[_0xc6e6('0x5f')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x60'));db[_0xc6e6('0x61')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x62'));db[_0xc6e6('0x63')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x64'));db[_0xc6e6('0x65')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatMessage/chatMessage.model');db[_0xc6e6('0x66')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x67'));db[_0xc6e6('0x68')]=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0xc6e6('0x69')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6a'));db[_0xc6e6('0x6b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x6c'));db['CmCompany']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6d'));db['CmContact']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x6e'));db['CmHopper']=db['sequelize'][_0xc6e6('0x18')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6f'));db[_0xc6e6('0x70')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x71'));db[_0xc6e6('0x72')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x73'));db[_0xc6e6('0x74')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x75'));db[_0xc6e6('0x76')]=db[_0xc6e6('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xc6e6('0x77')]=db['sequelize']['import'](_0xc6e6('0x78'));db[_0xc6e6('0x79')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x7a'));db[_0xc6e6('0x7b')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x7c'));db[_0xc6e6('0x7d')]=db[_0xc6e6('0x1')]['import']('../api/disposition/disposition.model');db[_0xc6e6('0x7e')]=db['sequelize']['import'](_0xc6e6('0x7f'));db[_0xc6e6('0x80')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x81'));db[_0xc6e6('0x82')]=db['sequelize']['import'](_0xc6e6('0x83'));db[_0xc6e6('0x84')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x85'));db[_0xc6e6('0x86')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x87'));db[_0xc6e6('0x88')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/schedule/schedule.model');db[_0xc6e6('0x89')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x8a'));db[_0xc6e6('0x8b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x8c'));db['Template']=db[_0xc6e6('0x1')]['import']('../api/template/template.model');db[_0xc6e6('0x8d')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x8e'));db[_0xc6e6('0x8f')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/variable/variable.model');db[_0xc6e6('0x90')]=db['sequelize']['import'](_0xc6e6('0x91'));db[_0xc6e6('0x92')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x93'));db['AnalyticCustomReport']=db['sequelize'][_0xc6e6('0x18')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xc6e6('0x94')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x95'));db['AnalyticExtractedReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x96'));db[_0xc6e6('0x97')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x98'));db[_0xc6e6('0x99')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x9a'));db[_0xc6e6('0x9b')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x9c'));db[_0xc6e6('0x9d')]=db[_0xc6e6('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xc6e6('0x9e')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x9f'));db[_0xc6e6('0xa0')]=db['sequelize']['import'](_0xc6e6('0xa1'));db['SugarcrmConfiguration']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xa2'));db[_0xc6e6('0xa3')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa4'));db[_0xc6e6('0xa5')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa6'));db[_0xc6e6('0xa7')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa8'));db['DeskField']=db['sequelize']['import'](_0xc6e6('0xa9'));db[_0xc6e6('0xaa')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xab'));db[_0xc6e6('0xac')]=db['sequelize'][_0xc6e6('0x18')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xc6e6('0xad')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xae'));db[_0xc6e6('0xaf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xb0'));db[_0xc6e6('0xb1')]=db['sequelize']['import'](_0xc6e6('0xb2'));db[_0xc6e6('0xb3')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xb4'));db['FreshdeskConfiguration']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xb5'));db['FreshdeskField']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xb6'));db[_0xc6e6('0xb7')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xb8'));db[_0xc6e6('0xb9')]=db[_0xc6e6('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xc6e6('0xba')]=db[_0xc6e6('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xc6e6('0xbb')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xc6e6('0xbc')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xbd'));db[_0xc6e6('0xbe')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xbf'));db[_0xc6e6('0xc0')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xc6e6('0xc1')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xc6e6('0xc2')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xc3'));db[_0xc6e6('0xc4')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xc5'));db[_0xc6e6('0xc6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xc7'));db['FreshsalesField']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xc8'));db[_0xc6e6('0x90')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x91'));db[_0xc6e6('0xc9')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/network/network.model');db[_0xc6e6('0xca')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xcb'));db[_0xc6e6('0xcc')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xc6e6('0xcd')]=db[_0xc6e6('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xc6e6('0xce')]=db[_0xc6e6('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xc6e6('0xcf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsQueueReport/smsQueueReport.model');db[_0xc6e6('0xd0')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd1'));db[_0xc6e6('0xd2')]=db[_0xc6e6('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xc6e6('0xd3')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd4'));db[_0xc6e6('0xd5')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd6'));db[_0xc6e6('0xd7')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd8'));db['SquareRecording']=db['sequelize']['import'](_0xc6e6('0xd9'));db['SquareMessage']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xda'));db['Team']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xdb'));db[_0xc6e6('0xdc')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xdd'));db['Campaign']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xde'));db[_0xc6e6('0xdf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/migration/migration.model');db['Attachment']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/attachment/attachment.model');db['Plugin']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe0'));db[_0xc6e6('0xe1')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe2'));db['ChatTransferReport']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe3'));db[_0xc6e6('0xe4')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe5'));db[_0xc6e6('0xe6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe7'));db[_0xc6e6('0xe8')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe9'));db[_0xc6e6('0xea')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xeb'));db[_0xc6e6('0xec')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xed'));db[_0xc6e6('0xee')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xef'));db[_0xc6e6('0xf0')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xf1'));db[_0xc6e6('0xf2')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xf3'));db[_0xc6e6('0xf4')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userNotification/userNotification.model');db[_0xc6e6('0xf5')]=db[_0xc6e6('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xc6e6('0xf6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/whatsappApplication/whatsappApplication.model');db[_0xc6e6('0xf7')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xf8'));db[_0xc6e6('0xf9')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xfa'));db['WhatsappQueueReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xfb'));db[_0xc6e6('0xfc')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xfd'));db['WhatsappQueue']=db['sequelize'][_0xc6e6('0x18')]('../api/whatsappQueue/whatsappQueue.model');db[_0xc6e6('0xfe')]=db['sequelize'][_0xc6e6('0x18')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize'][_0xc6e6('0x18')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xff'));db[_0xc6e6('0x100')]=db['sequelize']['import'](_0xc6e6('0x101'));db[_0xc6e6('0x13')][_0xc6e6('0x102')](db[_0xc6e6('0x20')],{'as':_0xc6e6('0x20'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['VoiceRecording'],{'as':_0xc6e6('0x106'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x2e')],{'as':_0xc6e6('0x107'),'foreignKey':'UserId'});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':'Extensions','onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['CmHopperFinal'],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x109'),'foreignKey':'UserId'});db['User']['hasMany'](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'foreignKey':_0xc6e6('0x104')});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x10c'),'foreignKey':'UserId'});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x52')],{'as':_0xc6e6('0x10d'),'foreignKey':'UserId'});db[_0xc6e6('0x13')]['hasMany'](db[_0xc6e6('0x10e')],{'as':_0xc6e6('0x10f'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['MailInteraction'],{'as':_0xc6e6('0x110'),'foreignKey':_0xc6e6('0x104')});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0xf7')],{'as':'WhatsappInteractions','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')]['hasMany'](db[_0xc6e6('0xf4')],{'as':_0xc6e6('0x111'),'foreignKey':_0xc6e6('0x112')});db[_0xc6e6('0x13')][_0xc6e6('0x113')](db[_0xc6e6('0xee')],{'as':_0xc6e6('0xee'),'foreignKey':_0xc6e6('0x114')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x69')],{'as':_0xc6e6('0x116'),'through':_0xc6e6('0x117')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x119'),'through':_0xc6e6('0x11a')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x11b'),'through':_0xc6e6('0x11c')});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':_0xc6e6('0x11e')});db[_0xc6e6('0x13')]['belongsToMany'](db['MailInteraction'],{'as':_0xc6e6('0x110'),'through':_0xc6e6('0x11f')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x63')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x10e')],{'as':_0xc6e6('0x10f'),'through':_0xc6e6('0x120')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db['SmsInteraction'],{'as':_0xc6e6('0x10d'),'through':_0xc6e6('0x121')});db[_0xc6e6('0x13')]['belongsToMany'](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'through':_0xc6e6('0x122')});db[_0xc6e6('0x13')]['belongsToMany'](db[_0xc6e6('0xf7')],{'as':'WhatsappInteractions','through':_0xc6e6('0x123')});db[_0xc6e6('0x13')]['belongsToMany'](db['VoiceQueue'],{'as':_0xc6e6('0x124'),'through':'UserVoiceQueue','required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xec')],{'as':_0xc6e6('0x125'),'through':_0xc6e6('0x100'),'required':![]});db[_0xc6e6('0x13')]['belongsToMany'](db['MailQueue'],{'as':_0xc6e6('0x126'),'through':_0xc6e6('0x127'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x68')],{'as':_0xc6e6('0x128'),'through':_0xc6e6('0x129'),'required':![],'hooks':!![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x12a')],{'as':'FaxQueues','through':_0xc6e6('0x33'),'required':![]});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x56')],{'as':_0xc6e6('0x12b'),'through':_0xc6e6('0x34'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x5c')],{'as':_0xc6e6('0x12c'),'through':_0xc6e6('0x12d'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x12e')],{'as':_0xc6e6('0x12f'),'through':_0xc6e6('0x36'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xea')],{'through':_0xc6e6('0x11c')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x130'),'through':_0xc6e6('0x131')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x47')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x133'),'through':_0xc6e6('0x134')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x58')],{'as':_0xc6e6('0x135'),'through':_0xc6e6('0x136')});db[_0xc6e6('0x13')]['belongsToMany'](db['SmsAccount'],{'as':_0xc6e6('0x137'),'through':_0xc6e6('0x138')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xf5')],{'as':'WhatsappAccounts','through':_0xc6e6('0x139')});db['User']['belongsToMany'](db['SquareProject'],{'as':_0xc6e6('0x13a'),'through':_0xc6e6('0x13b')});db[_0xc6e6('0x15')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x13c'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x13d')});db[_0xc6e6('0x13e')]['hasMany'](db[_0xc6e6('0x17')],{'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x17')]['hasMany'](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x13f'),'onDelete':'cascade'});db[_0xc6e6('0x1a')][_0xc6e6('0x115')](db[_0xc6e6('0x89')],{'as':_0xc6e6('0x140'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xc6e6('0x105')](db[_0xc6e6('0x2e')],{'as':_0xc6e6('0x141'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db[_0xc6e6('0x142')],{'as':_0xc6e6('0x143'),'foreignKey':_0xc6e6('0x144')});db['VoiceQueue'][_0xc6e6('0x105')](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x144')});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x145'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xc6e6('0x144')});db['VoiceQueue']['hasMany'](db[_0xc6e6('0xce')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x113')](db[_0xc6e6('0x2a')],{'as':'Trunk','foreignKey':_0xc6e6('0x146')});db[_0xc6e6('0x1c')]['belongsTo'](db[_0xc6e6('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xc6e6('0x1c')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x1c')]['belongsToMany'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x11b'),'through':_0xc6e6('0x14a')});db['VoiceQueue'][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x30')});db[_0xc6e6('0x1c')][_0xc6e6('0x115')](db['Team'],{'as':_0xc6e6('0x14c'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0xc6e6('0x115')](db['CmList'],{'as':_0xc6e6('0x14d'),'through':_0xc6e6('0x14e')});db[_0xc6e6('0x1d')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x14f')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x20')][_0xc6e6('0x105')](db[_0xc6e6('0x150')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':'mailboxuser','sourceKey':_0xc6e6('0x152')});db['VoiceMailMessage'][_0xc6e6('0x113')](db['VoiceMail'],{'foreignKey':_0xc6e6('0x153'),'targetKey':'mailbox'});db[_0xc6e6('0x23')][_0xc6e6('0x105')](db[_0xc6e6('0x27')],{'as':_0xc6e6('0x154'),'foreignKey':_0xc6e6('0x155'),'constraints':![]});db[_0xc6e6('0x23')][_0xc6e6('0x105')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xc6e6('0x23')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'User','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x23')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId'});db[_0xc6e6('0x157')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':_0xc6e6('0x158')});db['MailServerOut'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':'MailAccountId'});db[_0xc6e6('0x132')][_0xc6e6('0x102')](db[_0xc6e6('0x157')],{'as':_0xc6e6('0x159'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x132')][_0xc6e6('0x102')](db['MailServerOut'],{'as':_0xc6e6('0x15a'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['Disposition'],{'as':_0xc6e6('0x15b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db['MailAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['MailMessage'],{'as':'Messages','foreignKey':_0xc6e6('0x158')});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['MailInteraction'],{'as':'Interactions'});db['MailAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x15c')],{'as':'Applications'});db[_0xc6e6('0x132')]['belongsTo'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x132')][_0xc6e6('0x113')](db[_0xc6e6('0x15e')],{'as':_0xc6e6('0x15e'),'foreignKey':_0xc6e6('0x15f')});db['MailAccount'][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x132')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x134')});db[_0xc6e6('0x3b')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x127')});db[_0xc6e6('0x3b')]['belongsToMany'](db[_0xc6e6('0x11d')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xc6e6('0x3e')][_0xc6e6('0x105')](db[_0xc6e6('0x3f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xc6e6('0x160')});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x161'),'foreignKey':'MailAccountId'});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0xc6e6('0x3e')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x163'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x3e')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x3e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x11f'),'foreignKey':_0xc6e6('0x160')});db[_0xc6e6('0x3f')][_0xc6e6('0x105')](db['Attachment'],{'as':_0xc6e6('0x167'),'onDelete':'cascade'});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13')});db[_0xc6e6('0x3f')][_0xc6e6('0x113')](db['CmContact'],{'onDelete':'cascade','as':_0xc6e6('0x156')});db[_0xc6e6('0x3f')][_0xc6e6('0x113')](db['MailInteraction'],{'as':_0xc6e6('0x168'),'foreignKey':'MailInteractionId'});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x132')],{'as':'Account','foreignKey':_0xc6e6('0x158')});db['MailMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x5e'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x66')],{'as':_0xc6e6('0x66'),'foreignKey':_0xc6e6('0x16a')});db['MailApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db['MailApplication'][_0xc6e6('0x113')](db['MailQueue'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x15c')]['belongsTo'](db[_0xc6e6('0x132')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x15c')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':'restrict','foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x15c')][_0xc6e6('0x113')](db['Tag'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailAccount'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xc6e6('0x113')](db['MailInteraction'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailMessage'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailQueue'],{});db[_0xc6e6('0x43')]['hasMany'](db[_0xc6e6('0x45')],{'as':_0xc6e6('0x16f'),'onDelete':_0xc6e6('0x103')});db['FaxAccount']['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x170'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x47')]['hasMany'](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':_0xc6e6('0x170')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['FaxInteraction'],{'as':_0xc6e6('0x171')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db[_0xc6e6('0x48')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['VoiceExtension'],{'as':_0xc6e6('0x172'),'onDelete':'cascade'});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['FaxMessage'],{'as':_0xc6e6('0x151')});db[_0xc6e6('0x47')][_0xc6e6('0x113')](db[_0xc6e6('0x2a')],{'as':_0xc6e6('0x2a')});db[_0xc6e6('0x47')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x47')]['belongsTo'](db[_0xc6e6('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x47')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x173')});db['FaxApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')][_0xc6e6('0x113')](db[_0xc6e6('0x12a')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')][_0xc6e6('0x113')](db['FaxAccount'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')]['belongsTo'](db[_0xc6e6('0x8b')],{'onDelete':'restrict','foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x10e')][_0xc6e6('0x105')](db[_0xc6e6('0x4b')],{'as':'Messages','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x10e')][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x170')});db['FaxInteraction'][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x10e')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x175'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x120'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x4b')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':'User'});db[_0xc6e6('0x4b')]['belongsTo'](db['FaxInteraction'],{'as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x4b')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db[_0xc6e6('0x4b')][_0xc6e6('0x113')](db[_0xc6e6('0x176')],{'as':_0xc6e6('0x176'),'foreignKey':_0xc6e6('0x177')});db['FaxMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xc6e6('0x12a')][_0xc6e6('0x115')](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0xc6e6('0x12a')][_0xc6e6('0x115')](db['Team'],{'through':_0xc6e6('0x178'),'as':'Teams'});db['FaxQueueReport'][_0xc6e6('0x113')](db['FaxAccount'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db['CmList'],{'as':'List','foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db['FaxInteraction'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x4b')],{});db['FaxQueueReport'][_0xc6e6('0x113')](db['User'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x12a')],{});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db['Disposition'],{'as':_0xc6e6('0x15b'),'foreignKey':'SmsAccountId','onDelete':_0xc6e6('0x103')});db['SmsAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db[_0xc6e6('0x54')],{'as':'Messages','foreignKey':_0xc6e6('0x179')});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db[_0xc6e6('0x52')],{'as':'Interactions'});db['SmsAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x51')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x50')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x50')][_0xc6e6('0x113')](db[_0xc6e6('0x82')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x50')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x138')});db[_0xc6e6('0x51')]['belongsTo'](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{'onDelete':'restrict'});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'onDelete':'restrict'});db['SmsApplication'][_0xc6e6('0x113')](db['Interval'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x52')]['hasMany'](db[_0xc6e6('0x54')],{'as':_0xc6e6('0x151'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xc6e6('0x52')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'as':_0xc6e6('0x161'),'foreignKey':'SmsAccountId'});db[_0xc6e6('0x52')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x52')]['belongsTo'](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':'UserId'});db[_0xc6e6('0x52')][_0xc6e6('0x115')](db['Tag'],{'through':_0xc6e6('0x17b'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x52')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x17b'),'as':_0xc6e6('0x165')});db[_0xc6e6('0x52')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x121'),'foreignKey':_0xc6e6('0x17c')});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13')});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db['CmContact'],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db['SmsMessage']['belongsTo'](db[_0xc6e6('0x52')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x168'),'foreignKey':'SmsInteractionId'});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db['SmsAccount'],{'as':_0xc6e6('0x161'),'foreignKey':'SmsAccountId'});db[_0xc6e6('0x56')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x34'),'foreignKey':_0xc6e6('0x17d')});db['SmsQueue']['belongsToMany'](db[_0xc6e6('0x11d')],{'through':_0xc6e6('0x17e'),'as':'Teams'});db[_0xc6e6('0x58')][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x17f'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x58')][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['hasMany'](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x171'),'foreignKey':_0xc6e6('0x17f')});db['OpenchannelAccount']['hasMany'](db[_0xc6e6('0x5a')],{'as':_0xc6e6('0x151'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['hasMany'](db[_0xc6e6('0x180')],{'as':'Applications','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['belongsTo'](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db['OpenchannelAccount'][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x58')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x136')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['User'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':'OpenchannelQueueId'});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['OpenchannelAccount'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['Tag'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x10a')][_0xc6e6('0x105')](db[_0xc6e6('0x5a')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x181')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{'as':'Account','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x10a')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x182'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x10a')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x182'),'as':'ThroughTags'});db[_0xc6e6('0x10a')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x122'),'foreignKey':_0xc6e6('0x181')});db[_0xc6e6('0x5a')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x13')});db['OpenchannelMessage']['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db['OpenchannelMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{'onDelete':'cascade','as':_0xc6e6('0x168'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x176')],{'as':'Attachment','foreignKey':_0xc6e6('0x177')});db[_0xc6e6('0x5a')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x5c')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x12d'),'foreignKey':_0xc6e6('0x183')});db['OpenchannelQueue'][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':'team_has_openchannel_queues','as':_0xc6e6('0x14c')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x169'),'onDelete':'cascade'});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db['CannedAnswer'],{'as':_0xc6e6('0x184'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x6b')],{'as':_0xc6e6('0x185')});db['ChatWebsite'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x171')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x61')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x65')],{'as':_0xc6e6('0x151')});db['ChatWebsite'][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db['ChatWebsite'][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x5e')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':_0xc6e6('0x158')});db[_0xc6e6('0x5e')][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x5e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x131')});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x5a')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{});db['ChatApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x186'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xc6e6('0x68')],{'as':_0xc6e6('0x187'),'foreignKey':_0xc6e6('0x188'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x61')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':'Website','foreignKey':_0xc6e6('0x169'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x61')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x63')][_0xc6e6('0x105')](db['ChatMessage'],{'as':'Messages','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x189')});db[_0xc6e6('0x63')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x63')][_0xc6e6('0x113')](db['CmContact'],{'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x63')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db['ChatInteraction'][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x18a'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x63')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':'chat_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x63')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x18b'),'foreignKey':_0xc6e6('0x189')});db['ChatMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x13')});db[_0xc6e6('0x65')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x65')]['belongsTo'](db[_0xc6e6('0x63')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x189')});db[_0xc6e6('0x65')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xc6e6('0x177')});db['ChatMessage']['belongsTo'](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x66')][_0xc6e6('0x105')](db[_0xc6e6('0x176')],{'as':_0xc6e6('0x167'),'foreignKey':_0xc6e6('0x16a'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x66')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x66')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':'Account','foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x68')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x129'),'hooks':!![]});db[_0xc6e6('0x68')]['belongsToMany'](db[_0xc6e6('0x11d')],{'through':'team_has_chat_queues','as':_0xc6e6('0x14c')});db['ChatGroup']['hasMany'](db[_0xc6e6('0xcc')],{'as':_0xc6e6('0x151'),'foreignKey':'ChatGroupId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x69')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x141'),'through':_0xc6e6('0x117')});db[_0xc6e6('0x6b')]['belongsTo'](db[_0xc6e6('0x5e')],{'as':'Website','foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x18c')]['hasMany'](db[_0xc6e6('0x118')],{'as':'Contacts','foreignKey':_0xc6e6('0x18d')});db[_0xc6e6('0x118')]['hasMany'](db[_0xc6e6('0x142')],{'as':_0xc6e6('0x143'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')]['hasMany'](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x74')],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['JscriptySessionReport'],{'as':_0xc6e6('0x18e'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db['CmContact'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x10c'),'foreignKey':_0xc6e6('0x162'),'onDelete':'restrict'});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['SmsInteraction'],{'as':_0xc6e6('0x10d'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x10e')],{'as':'FaxInteractions','foreignKey':_0xc6e6('0x162'),'onDelete':'restrict'});db[_0xc6e6('0x118')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x118')][_0xc6e6('0x113')](db[_0xc6e6('0x18c')],{'as':_0xc6e6('0x18f'),'foreignKey':_0xc6e6('0x18d')});db[_0xc6e6('0x118')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':'List','foreignKey':'ListId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x118')]['belongsToMany'](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x11a')});db[_0xc6e6('0x118')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xc6e6('0x118')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x190'),'as':_0xc6e6('0x165')});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e'),'onDelete':'cascade'});db[_0xc6e6('0x142')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Agent','foreignKey':_0xc6e6('0x104')});db['CmHopper'][_0xc6e6('0x113')](db[_0xc6e6('0x1c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xc6e6('0x103')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':_0xc6e6('0x191'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':_0xc6e6('0x192')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x1c')],{'as':'Queue','foreignKey':_0xc6e6('0x144'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x191')],{'as':_0xc6e6('0x191'),'foreignKey':_0xc6e6('0x194'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x79')][_0xc6e6('0x105')](db[_0xc6e6('0x7e')],{'as':{'plural':'All','singular':_0xc6e6('0x195')},'foreignKey':'AutomationAllId','onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Automation'][_0xc6e6('0x105')](db[_0xc6e6('0x7e')],{'as':{'plural':_0xc6e6('0x196'),'singular':_0xc6e6('0x197')},'foreignKey':_0xc6e6('0x198'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x79')][_0xc6e6('0x105')](db['Action'],{'as':_0xc6e6('0x199'),'foreignKey':_0xc6e6('0x19a'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Disposition'][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'ParentId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db['Interval'],{'as':'Intervals','foreignKey':_0xc6e6('0x147'),'onDelete':_0xc6e6('0x103'),'hooks':!![],'required':![]});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x19b'),'foreignKey':_0xc6e6('0x147'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x15c')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x61')],{'as':'ChatApplications','foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db['FaxApplication'],{'as':_0xc6e6('0x19c'),'foreignKey':_0xc6e6('0x147')});db['Interval'][_0xc6e6('0x105')](db[_0xc6e6('0x51')],{'as':_0xc6e6('0x19d'),'foreignKey':_0xc6e6('0x147')});db['Schedule']['belongsTo'](db[_0xc6e6('0x132')],{});db[_0xc6e6('0x88')][_0xc6e6('0x113')](db[_0xc6e6('0x94')],{'foreignKey':'DefaultReportId'});db[_0xc6e6('0x88')][_0xc6e6('0x113')](db[_0xc6e6('0x19e')],{'foreignKey':_0xc6e6('0x19f')});db['Sound'][_0xc6e6('0x115')](db[_0xc6e6('0x1a')],{'as':_0xc6e6('0x1a0'),'through':_0xc6e6('0x1a1'),'onDelete':_0xc6e6('0x16b')});db['Tag']['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xc6e6('0x8b')][_0xc6e6('0x115')](db[_0xc6e6('0x63')],{'through':_0xc6e6('0x18a')});db[_0xc6e6('0x8b')][_0xc6e6('0x115')](db[_0xc6e6('0x3e')],{'through':_0xc6e6('0x163')});db[_0xc6e6('0x8b')]['belongsToMany'](db['SmsInteraction'],{'through':_0xc6e6('0x17b')});db[_0xc6e6('0x8b')]['belongsToMany'](db[_0xc6e6('0x10e')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xc6e6('0x115')](db[_0xc6e6('0x10a')],{'through':'openchannel_interaction_has_tags'});db[_0xc6e6('0x8b')]['belongsToMany'](db[_0xc6e6('0xf7')],{'through':_0xc6e6('0x1a2')});db['Trigger'][_0xc6e6('0x105')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xc6e6('0x1a3')},'foreignKey':_0xc6e6('0x1a4'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x8d')]['hasMany'](db['Condition'],{'as':{'plural':_0xc6e6('0x1a5'),'singular':_0xc6e6('0x1a6')},'foreignKey':_0xc6e6('0x1a7'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Trigger'][_0xc6e6('0x105')](db[_0xc6e6('0x77')],{'as':_0xc6e6('0x199'),'foreignKey':_0xc6e6('0x1a8'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x19e')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x19f'),'hooks':!![]});db[_0xc6e6('0x94')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1aa')});db[_0xc6e6('0x97')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ab')});db[_0xc6e6('0x99')][_0xc6e6('0x113')](db[_0xc6e6('0x97')],{'foreignKey':'MetricId'});db[_0xc6e6('0x9b')][_0xc6e6('0x105')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['SalesforceConfiguration'][_0xc6e6('0x105')](db['SalesforceField'],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x9d')]['hasMany'](db['SalesforceField'],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x9d')][_0xc6e6('0x105')](db['SalesforceField'],{'as':'Fields','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x9d')]['belongsTo'](db[_0xc6e6('0x9b')],{'as':'Account','foreignKey':'AccountId'});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x9e')]['belongsTo'](db[_0xc6e6('0x8f')],{'as':'Variable','foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xa0')][_0xc6e6('0x105')](db[_0xc6e6('0x1b5')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['SugarcrmConfiguration'][_0xc6e6('0x105')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db['SugarcrmConfiguration']['hasMany'](db[_0xc6e6('0xa3')],{'as':'Descriptions','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1b5')][_0xc6e6('0x105')](db['SugarcrmField'],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':'FieldId'});db[_0xc6e6('0x1b5')][_0xc6e6('0x113')](db[_0xc6e6('0xa0')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db['SugarcrmField']['hasMany'](db[_0xc6e6('0xa3')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db['SugarcrmField'][_0xc6e6('0x105')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xa3')][_0xc6e6('0x105')](db[_0xc6e6('0xa3')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xa3')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xa5')]['hasMany'](db[_0xc6e6('0xa7')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['DeskConfiguration'][_0xc6e6('0x105')](db['DeskField'],{'as':'Subjects','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xa7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xa7')]['belongsTo'](db[_0xc6e6('0xa5')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xa7')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1b8')});db[_0xc6e6('0x1b7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['DeskField']['hasMany'](db[_0xc6e6('0x1b7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xc6e6('0x1b7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1b3'),'foreignKey':'FieldId'});db[_0xc6e6('0x1b7')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db['ZohoAccount'][_0xc6e6('0x105')](db[_0xc6e6('0xac')],{'as':_0xc6e6('0x1b6'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':'SubjectId'});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':'FieldId'});db[_0xc6e6('0xac')][_0xc6e6('0x113')](db[_0xc6e6('0xaa')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xad')]['hasMany'](db[_0xc6e6('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xc6e6('0xad')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xad')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0x1b9')][_0xc6e6('0x105')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xaf')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xaf')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':'Descriptions','foreignKey':_0xc6e6('0x1b0')});db['ZendeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':'Fields','foreignKey':'FieldId'});db[_0xc6e6('0xaf')]['belongsTo'](db[_0xc6e6('0x1b9')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xaf')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1ba')});db[_0xc6e6('0xb1')][_0xc6e6('0x105')](db['ZendeskField'],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xb1')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xb1')]['hasMany'](db[_0xc6e6('0xb1')],{'as':'Field','foreignKey':_0xc6e6('0x1b1')});db['ZendeskField'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db['FreshdeskAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x1bc')],{'as':_0xc6e6('0x1b6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xc6e6('0x1bc')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1af'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bc')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bc')][_0xc6e6('0x113')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0x1bc')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1be')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db['FreshdeskField'],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db['FreshdeskField'],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bd')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xb7')][_0xc6e6('0x105')](db[_0xc6e6('0xb9')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['VtigerConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db['VtigerConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1af'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xb9')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':'Fields','foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xb9')][_0xc6e6('0x113')](db[_0xc6e6('0xb7')],{'as':'Account','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xba')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xba')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db['VtigerField'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xba')]['belongsTo'](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db[_0xc6e6('0xbb')][_0xc6e6('0x105')](db[_0xc6e6('0xbc')],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xbc')][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db['ServicenowConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Fields','foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xbc')][_0xc6e6('0x113')](db[_0xc6e6('0xbb')],{'as':_0xc6e6('0x161'),'foreignKey':'AccountId'});db['ServicenowField'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['ServicenowField'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xbe')][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db['ServicenowField'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db[_0xc6e6('0xc0')][_0xc6e6('0x105')](db[_0xc6e6('0xc1')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['Dynamics365Configuration'][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':_0xc6e6('0x1ad'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc1')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc1')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Fields','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xc1')]['belongsTo'](db['Dynamics365Account'],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Field','foreignKey':_0xc6e6('0x1b1')});db['Dynamics365Field'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xc4')][_0xc6e6('0x105')](db[_0xc6e6('0xc6')],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xc6')][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc6')]['hasMany'](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1af'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc6')][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1a9'),'foreignKey':_0xc6e6('0x1b1')});db['FreshsalesConfiguration'][_0xc6e6('0x113')](db[_0xc6e6('0xc4')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0x1bf')][_0xc6e6('0x105')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['FreshsalesField'][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bf')][_0xc6e6('0x105')](db['FreshsalesField'],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bf')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':'Variable','foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db['ChatInteraction'],{});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db['ChatMessage'],{});db[_0xc6e6('0xca')]['belongsTo'](db['User'],{});db['ChatQueueReport']['belongsTo'](db[_0xc6e6('0x68')],{});db[_0xc6e6('0xcc')][_0xc6e6('0x113')](db['User'],{'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1c0')});db[_0xc6e6('0xcc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xc6e6('0x105')](db[_0xc6e6('0xcd')],{'foreignKey':_0xc6e6('0x1c1'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xce')][_0xc6e6('0x105')](db[_0xc6e6('0x1c2')],{'foreignKey':_0xc6e6('0x1c1'),'onDelete':_0xc6e6('0x103')});db['SmsQueueReport']['belongsTo'](db[_0xc6e6('0x50')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x52')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x54')],{});db['SmsQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{});db[_0xc6e6('0xd3')][_0xc6e6('0x105')](db[_0xc6e6('0xce')],{'foreignKey':_0xc6e6('0x1c3')});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xc6e6('0x166'),'through':'user_has_square_projects'});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x11e')});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x1c')],{'through':_0xc6e6('0x1c4'),'as':_0xc6e6('0x124')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0x3b')],{'through':_0xc6e6('0x1c5'),'as':_0xc6e6('0x126')});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x68')],{'through':_0xc6e6('0x1c6'),'as':'ChatQueues'});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xc6e6('0x1c7')});db['Team'][_0xc6e6('0x115')](db['SmsQueue'],{'through':_0xc6e6('0x17e'),'as':_0xc6e6('0x12b')});db['Team']['belongsToMany'](db[_0xc6e6('0x5c')],{'through':_0xc6e6('0x1c8'),'as':_0xc6e6('0x12c')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0x12e')],{'through':_0xc6e6('0x1c9'),'as':_0xc6e6('0x12f')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0xec')],{'through':_0xc6e6('0x1ca'),'as':_0xc6e6('0x125')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db[_0xc6e6('0x142')],{'as':'Hoppers','foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db['CmHopperHistory'],{'as':_0xc6e6('0x145'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')]['hasMany'](db[_0xc6e6('0x193')],{'as':_0xc6e6('0x1cb'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0xc6e6('0x146')});db[_0xc6e6('0x191')]['belongsTo'](db['Trunk'],{'as':_0xc6e6('0x1cc'),'foreignKey':_0xc6e6('0x1cd')});db[_0xc6e6('0x191')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db['Campaign'][_0xc6e6('0x113')](db[_0xc6e6('0xd7')],{'as':'SquareProject','foreignKey':_0xc6e6('0x1ce')});db[_0xc6e6('0x191')][_0xc6e6('0x115')](db['CmList'],{'as':'Lists','through':_0xc6e6('0x1cf')});db[_0xc6e6('0x191')]['belongsToMany'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x14d'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xc6e6('0x113')](db[_0xc6e6('0x66')],{'as':_0xc6e6('0x66'),'foreignKey':_0xc6e6('0x16a')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x3f')],{});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x3e')],{});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'foreignKey':_0xc6e6('0x1d0'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':'FromUserId','as':_0xc6e6('0x1d2')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x3b')],{'foreignKey':_0xc6e6('0x1d5'),'as':_0xc6e6('0x1d6')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'foreignKey':_0xc6e6('0x1d7'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x65')],{});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x63')],{});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'foreignKey':_0xc6e6('0x1da'),'as':_0xc6e6('0x1d1')});db['ChatTransferReport']['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db['ChatTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x68')],{'foreignKey':_0xc6e6('0x1dc'),'as':'ToQueue'});db[_0xc6e6('0x1d9')]['belongsTo'](db[_0xc6e6('0x5e')],{'foreignKey':_0xc6e6('0x1dd'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db[_0xc6e6('0x4b')],{});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db[_0xc6e6('0x10e')],{});db['FaxTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'foreignKey':_0xc6e6('0x1de'),'as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe4')]['belongsTo'](db['User'],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db['FaxQueue'],{'foreignKey':_0xc6e6('0x1df'),'as':_0xc6e6('0x1d6')});db[_0xc6e6('0xe4')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xc6e6('0x1e0'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x5a')],{});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{'foreignKey':_0xc6e6('0x1e1'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe6')]['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{'foreignKey':_0xc6e6('0x1e2'),'as':_0xc6e6('0x1d6')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db['OpenchannelAccount'],{'foreignKey':_0xc6e6('0x1e3'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe8')]['belongsTo'](db[_0xc6e6('0x54')],{});db['SmsTransferReport'][_0xc6e6('0x113')](db['SmsInteraction'],{});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'foreignKey':'FromSmsAccountId','as':_0xc6e6('0x1d1')});db['SmsTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':'ToAgent'});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{'foreignKey':_0xc6e6('0x1e4'),'as':_0xc6e6('0x1d6')});db['SmsTransferReport'][_0xc6e6('0x113')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xc6e6('0x1d8')});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x76')],{'as':'CustomFields','foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x119'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x16e')});db['CmList'][_0xc6e6('0x105')](db['CmHopperFinal'],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x109'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x105')](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x115')](db['VoiceQueue'],{'as':_0xc6e6('0x1e5'),'through':_0xc6e6('0x14a')});db[_0xc6e6('0xea')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x11c')});db[_0xc6e6('0xec')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':'Extensions','onDelete':_0xc6e6('0x103')});db['VoicePrefix'][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':'UserVoicePrefix'});db[_0xc6e6('0xec')][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':'TeamVoicePrefix','as':_0xc6e6('0x14c')});db[_0xc6e6('0xee')][_0xc6e6('0x105')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'foreignKey':_0xc6e6('0x114')});db[_0xc6e6('0xee')]['hasMany'](db[_0xc6e6('0xf0')],{'as':_0xc6e6('0x1e6'),'foreignKey':_0xc6e6('0x114'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xf0')]['hasMany'](db[_0xc6e6('0xf2')],{'as':'Resources','foreignKey':_0xc6e6('0x1e7'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'WhatsappAccountId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':_0xc6e6('0x184'),'foreignKey':'WhatsappAccountId'});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db['WhatsappMessage'],{'as':_0xc6e6('0x151'),'foreignKey':'WhatsappAccountId'});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db[_0xc6e6('0xf7')],{'as':_0xc6e6('0x171')});db['WhatsappAccount'][_0xc6e6('0x105')](db[_0xc6e6('0xf6')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0xf5')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xf5')][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0xf5')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':'user_has_whatsapp_accounts'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['User'],{'onDelete':'restrict'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['WhatsappQueue'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['WhatsappAccount'],{'onDelete':_0xc6e6('0x16b')});db['WhatsappApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':'IntervalId'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':'restrict','foreignKey':'TagId'});db['WhatsappInteraction']['hasMany'](db[_0xc6e6('0xf9')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0xc6e6('0xf5')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1e8')});db['WhatsappInteraction']['belongsTo'](db[_0xc6e6('0x118')],{'as':'Contact','foreignKey':'ContactId'});db[_0xc6e6('0xf7')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':'UserId'});db[_0xc6e6('0xf7')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1a2'),'as':'Tags'});db[_0xc6e6('0xf7')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1a2'),'as':_0xc6e6('0x165')});db[_0xc6e6('0xf7')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x166'),'through':'user_has_whatsapp_interactions','foreignKey':_0xc6e6('0x1e9')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'User'});db[_0xc6e6('0xf9')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':'cascade','as':_0xc6e6('0x156')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{'onDelete':'cascade','as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x1e9')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xc6e6('0x1e8')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf5')],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db['WhatsappQueue'],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf9')],{});db[_0xc6e6('0x1ea')]['belongsTo'](db[_0xc6e6('0x13')],{});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf9')],{});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{});db[_0xc6e6('0xfc')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xc6e6('0x1eb'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf5')],{'foreignKey':'ToWhatsappAccountId','as':_0xc6e6('0x1d8')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x12e')],{'foreignKey':_0xc6e6('0x1ec'),'as':'ToQueue'});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0x12e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x36'),'foreignKey':_0xc6e6('0x1ed')});db[_0xc6e6('0x12e')]['belongsToMany'](db['Team'],{'through':_0xc6e6('0x1c9'),'as':_0xc6e6('0x14c')});module[_0xc6e6('0x1ee')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa74f=['MailAccountId','Imap','hasOne','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Team','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','DashboardItem','Exntensions','FaxAccountId','fax_interaction_has_tags','ThroughTags','Users','FaxInteractionId','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteraction','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Pause','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','ProactiveActions','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','Trigger','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','DefaultReportId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Subjects','Field','VariableId','DeskAccount','DeskField','int_desk_configuration_has_tags','ZendeskAccount','ZendeskField','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','MailQueues','ChatQueues','FaxQueues','SmsQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','exports','lodash','sequelize','defaultsDeep','motion2','xC@LL1234','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserMailQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId'];(function(_0x5b065d,_0x14a46a){var _0x439e8a=function(_0x30fd27){while(--_0x30fd27){_0x5b065d['push'](_0x5b065d['shift']());}};_0x439e8a(++_0x14a46a);}(_0xa74f,0x9a));var _0xfa74=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xa74f[_0x126f47];return _0x49508a;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xfa74('0x0'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xfa74('0x1')]=_[_0xfa74('0x2')](config[_0xfa74('0x1')],{'database':_0xfa74('0x3'),'username':'xcall','password':_0xfa74('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':_0xfa74('0x7'),'collate':_0xfa74('0x8')}}});config[_0xfa74('0x9')]=_[_0xfa74('0x2')](config['sequelizeHistory'],{'database':_0xfa74('0x3'),'username':_0xfa74('0xa'),'password':_0xfa74('0x4'),'options':{'host':_0xfa74('0xb'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':'utf8','collate':_0xfa74('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa74('0x1')][_0xfa74('0xc')],config[_0xfa74('0x1')]['username'],config[_0xfa74('0x1')][_0xfa74('0xd')],config[_0xfa74('0x1')][_0xfa74('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xfa74('0xc')],config[_0xfa74('0x9')][_0xfa74('0xf')],config[_0xfa74('0x9')][_0xfa74('0xd')],config['sequelizeHistory'][_0xfa74('0xe')])};db[_0xfa74('0x10')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x12'));db[_0xfa74('0x13')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x14'));db[_0xfa74('0x15')]=db['sequelize']['import'](_0xfa74('0x16'));db[_0xfa74('0x17')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x18'));db[_0xfa74('0x19')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x1a'));db[_0xfa74('0x1b')]=db[_0xfa74('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xfa74('0x1c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x1d'));db[_0xfa74('0x1e')]=db['sequelize']['import'](_0xfa74('0x1f'));db['VoiceMail']=db['sequelize']['import'](_0xfa74('0x20'));db[_0xfa74('0x21')]=db[_0xfa74('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xfa74('0x22')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x23'));db['VoiceDialReport']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xfa74('0x24')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x25'));db['VoiceQueueReport']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x26'));db['MemberReport']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x27'));db['Trunk']=db['sequelize'][_0xfa74('0x11')]('../api/trunk/trunk.model');db[_0xfa74('0x28')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x29'));db[_0xfa74('0x2a')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2b'));db[_0xfa74('0x2c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x2d'));db[_0xfa74('0x2e')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2f'));db['UserMailQueue']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x30'));db[_0xfa74('0x31')]=db['sequelize']['import'](_0xfa74('0x32'));db[_0xfa74('0x33')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0xfa74('0x34')]=db[_0xfa74('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize']['import'](_0xfa74('0x35'));db[_0xfa74('0x36')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x37'));db[_0xfa74('0x38')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x39'));db['MailAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3a'));db[_0xfa74('0x3b')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueue/mailQueue.model');db[_0xfa74('0x3c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3d'));db['MailInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3e'));db[_0xfa74('0x3f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x40'));db[_0xfa74('0x41')]=db['sequelize']['import'](_0xfa74('0x42'));db[_0xfa74('0x43')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueueReport/mailQueueReport.model');db[_0xfa74('0x44')]=db[_0xfa74('0x1')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x45'));db[_0xfa74('0x46')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x47'));db[_0xfa74('0x48')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x49'));db[_0xfa74('0x4a')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxInteraction/faxInteraction.model');db[_0xfa74('0x4b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4c'));db[_0xfa74('0x4d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4e'));db[_0xfa74('0x4f')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x50'));db['SmsAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x51'));db[_0xfa74('0x52')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x53'));db['SmsInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsInteraction/smsInteraction.model');db[_0xfa74('0x54')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x55'));db[_0xfa74('0x56')]=db['sequelize']['import'](_0xfa74('0x57'));db[_0xfa74('0x58')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x59'));db[_0xfa74('0x5a')]=db['sequelize']['import'](_0xfa74('0x5b'));db[_0xfa74('0x5c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x5d'));db[_0xfa74('0x5e')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/openchannelMessage/openchannelMessage.model');db[_0xfa74('0x5f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x60'));db['ChatWebsite']=db['sequelize'][_0xfa74('0x11')]('../api/chatWebsite/chatWebsite.model');db[_0xfa74('0x61')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x62'));db[_0xfa74('0x63')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatApplication/chatApplication.model');db[_0xfa74('0x64')]=db['sequelize'][_0xfa74('0x11')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x65'));db[_0xfa74('0x66')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x67'));db[_0xfa74('0x68')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatGroup/chatGroup.model');db[_0xfa74('0x69')]=db[_0xfa74('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xfa74('0x6a')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6b'));db[_0xfa74('0x6c')]=db['sequelize'][_0xfa74('0x11')]('../api/cmContact/cmContact.model');db[_0xfa74('0x6d')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6e'));db[_0xfa74('0x6f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x70'));db['CmHopperHistory']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x71'));db[_0xfa74('0x72')]=db['sequelize'][_0xfa74('0x11')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xfa74('0x73')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x74'));db[_0xfa74('0x75')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x76'));db[_0xfa74('0x77')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x78'));db[_0xfa74('0x79')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cannedAnswer/cannedAnswer.model');db[_0xfa74('0x7a')]=db[_0xfa74('0x1')]['import']('../api/disposition/disposition.model');db[_0xfa74('0x7b')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x7c'));db[_0xfa74('0x7d')]=db['sequelize'][_0xfa74('0x11')]('../api/interval/interval.model');db['Pause']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x7e'));db[_0xfa74('0x7f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x80'));db[_0xfa74('0x81')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x82'));db['Schedule']=db[_0xfa74('0x1')]['import'](_0xfa74('0x83'));db[_0xfa74('0x84')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x85'));db[_0xfa74('0x86')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x87'));db[_0xfa74('0x88')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x89'));db['Trigger']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8a'));db[_0xfa74('0x8b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8c'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8e'));db[_0xfa74('0x8f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x90'));db[_0xfa74('0x91')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x92'));db[_0xfa74('0x93')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x94'));db[_0xfa74('0x95')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfa74('0x96')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x97'));db['AnalyticFieldReport']=db[_0xfa74('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xfa74('0x98')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x99'));db['SalesforceAccount']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x9a'));db[_0xfa74('0x9b')]=db[_0xfa74('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x9c'));db[_0xfa74('0x9d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x9e'));db[_0xfa74('0x9f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa0'));db[_0xfa74('0xa1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa2'));db['DeskAccount']=db['sequelize']['import'](_0xfa74('0xa3'));db[_0xfa74('0xa4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa5'));db['DeskField']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intDeskField/intDeskField.model');db[_0xfa74('0xa6')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xa7'));db[_0xfa74('0xa8')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa9'));db[_0xfa74('0xaa')]=db[_0xfa74('0x1')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xfa74('0xab')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xac'));db['ZendeskField']=db[_0xfa74('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0xfa74('0xad')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xfa74('0xae')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xaf'));db['FreshdeskField']=db['sequelize']['import'](_0xfa74('0xb0'));db[_0xfa74('0xb1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb2'));db['VtigerConfiguration']=db['sequelize'][_0xfa74('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xfa74('0xb3')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb4'));db[_0xfa74('0xb5')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb6'));db[_0xfa74('0xb7')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xb8'));db[_0xfa74('0xb9')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xba'));db[_0xfa74('0xbb')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xbc'));db[_0xfa74('0xbd')]=db['sequelize']['import'](_0xfa74('0xbe'));db[_0xfa74('0xbf')]=db[_0xfa74('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xfa74('0xc0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc1'));db[_0xfa74('0xc2')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xfa74('0xc3')]=db['sequelize']['import'](_0xfa74('0xc4'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x8e'));db['Network']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xc5'));db[_0xfa74('0xc6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc7'));db['ChatInternalMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa74('0xc8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa74('0xc9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xca'));db[_0xfa74('0xcb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xcc'));db['SmsQueueReport']=db['sequelize'][_0xfa74('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0xfa74('0xcd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xce'));db[_0xfa74('0xcf')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd0'));db[_0xfa74('0xd1')]=db[_0xfa74('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xd2'));db['SquareOdbc']=db[_0xfa74('0x1')]['import'](_0xfa74('0xd3'));db[_0xfa74('0xd4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd5'));db[_0xfa74('0xd6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd7'));db[_0xfa74('0xd8')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xd9'));db['Team']=db[_0xfa74('0x1')]['import'](_0xfa74('0xda'));db[_0xfa74('0xdb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xdc'));db[_0xfa74('0xdd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xde'));db['Migration']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xdf'));db['Attachment']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/attachment/attachment.model');db[_0xfa74('0xe0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe1'));db[_0xfa74('0xe2')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xe3'));db[_0xfa74('0xe4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe5'));db[_0xfa74('0xe6')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0xfa74('0xe7')]=db['sequelize'][_0xfa74('0x11')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xfa74('0xe8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsTransferReport/smsTransferReport.model');db[_0xfa74('0xe9')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xea'));db[_0xfa74('0xeb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xec'));db[_0xfa74('0xed')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xee'));db[_0xfa74('0xef')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xf0'));db[_0xfa74('0xf1')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf2'));db[_0xfa74('0xf3')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf4'));db[_0xfa74('0xf5')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xf6'));db[_0xfa74('0xf7')]=db['sequelize']['import'](_0xfa74('0xf8'));db[_0xfa74('0xf9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfa'));db['WhatsappMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xfb'));db[_0xfa74('0xfc')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfd'));db[_0xfa74('0xfe')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xfa74('0xff')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x100'));db[_0xfa74('0x101')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x102'));db[_0xfa74('0x103')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x104'));db[_0xfa74('0x105')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x106'));db[_0xfa74('0x107')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x108'));db[_0xfa74('0x10')]['hasOne'](db[_0xfa74('0x109')],{'as':'VoiceMail','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x1c')],{'as':'Recordings','foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x2a')],{'as':_0xfa74('0x10d'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade','hooks':!![]});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x110'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x72')],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x64')],{'as':'ChatInteractions','foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x113'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':'MailInteractions','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':_0xfa74('0x115'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['UserNotification'],{'as':_0xfa74('0x116'),'foreignKey':_0xfa74('0x117')});db['User'][_0xfa74('0x118')](db[_0xfa74('0xed')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x68')],{'as':'Groups','through':_0xfa74('0x11a')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['CmContact'],{'as':_0xfa74('0x11b'),'through':_0xfa74('0x11c')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x11e')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'as':_0xfa74('0x11f'),'through':_0xfa74('0x120')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x64')],{'as':_0xfa74('0x121'),'through':'user_has_chat_interactions'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x4a')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User'][_0xfa74('0x119')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'through':_0xfa74('0x122')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'through':_0xfa74('0x123')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['WhatsappInteraction'],{'as':_0xfa74('0x115'),'through':_0xfa74('0x124')});db['User'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x125'),'through':_0xfa74('0x2c'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'as':_0xfa74('0x126'),'through':_0xfa74('0x107'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0x3b')],{'as':'MailQueues','through':_0xfa74('0x127'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x66')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x4d')],{'as':'FaxQueues','through':_0xfa74('0x31'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'as':'SmsQueues','through':_0xfa74('0x33'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x5f')],{'as':_0xfa74('0x128'),'through':_0xfa74('0x34'),'required':![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0xff')],{'as':_0xfa74('0x129'),'through':_0xfa74('0x12a'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12c'),'through':_0xfa74('0x12d')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x46')],{'as':'FaxAccounts','through':_0xfa74('0x12e')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x130'),'through':_0xfa74('0x131')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x58')],{'as':_0xfa74('0x132'),'through':_0xfa74('0x133')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x134')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xf5')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xd4')],{'as':_0xfa74('0x135'),'through':_0xfa74('0x136')});db['VoiceChanSpy'][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':'SpiedAgents','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x137')});db['VoiceContext'][_0xfa74('0x10c')](db['VoiceExtension'],{'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x17')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x138'),'onDelete':'cascade'});db[_0xfa74('0x19')][_0xfa74('0x119')](db[_0xfa74('0x84')],{'as':_0xfa74('0x139'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xfa74('0x10c')](db['UserVoiceQueueRt'],{'as':_0xfa74('0x13a'),'foreignKey':_0xfa74('0x13b')});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')]['hasMany'](db[_0xfa74('0x72')],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'as':_0xfa74('0x140'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':'TrunkId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':'TrunkBackupId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x143'),'through':_0xfa74('0x144')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x2c')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db['Team'],{'as':_0xfa74('0x146'),'through':_0xfa74('0x103')});db[_0xfa74('0x1b')]['belongsToMany'](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x148')});db[_0xfa74('0x1c')][_0xfa74('0x118')](db['User'],{'as':'User','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x1e')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x109')][_0xfa74('0x10c')](db['VoiceMailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x14a'),'sourceKey':_0xfa74('0x14b')});db[_0xfa74('0x21')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xfa74('0x14a'),'targetKey':_0xfa74('0x14b')});db['VoiceCallReport'][_0xfa74('0x10c')](db[_0xfa74('0x14c')],{'as':_0xfa74('0x14d'),'foreignKey':_0xfa74('0x14e'),'constraints':![]});db[_0xfa74('0x22')][_0xfa74('0x10c')](db['VoiceAgentReport'],{'as':_0xfa74('0x14f'),'foreignKey':'uniqueid','constraints':![]});db[_0xfa74('0x22')]['belongsTo'](db['User'],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x22')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x36')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x38')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')]['hasOne'](db[_0xfa74('0x36')],{'as':_0xfa74('0x153'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x154')](db[_0xfa74('0x38')],{'as':_0xfa74('0x155'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x152'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x3f')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':_0xfa74('0x158')});db[_0xfa74('0x12f')]['hasMany'](db[_0xfa74('0x41')],{'as':_0xfa74('0x138')});db['MailAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db[_0xfa74('0x88')],{'as':_0xfa74('0x88'),'foreignKey':_0xfa74('0x15b')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x12f')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x131')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x127')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x146')});db[_0xfa74('0x114')][_0xfa74('0x10c')](db['MailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x114')]['belongsTo'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':'MailAccountId'});db[_0xfa74('0x114')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x114')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x114')]['belongsToMany'](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':_0xfa74('0x163')});db[_0xfa74('0x114')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':'ThroughTags'});db['MailInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Users','through':_0xfa74('0x120'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x10c')](db['Attachment'],{'as':'Attachments','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x10')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x114')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12b'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x166')],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db[_0xfa74('0x41')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db[_0xfa74('0x3b')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x12f')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db['MailQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x114')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x10')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x3b')],{});db[_0xfa74('0x44')][_0xfa74('0x10c')](db[_0xfa74('0x16b')],{'as':'Items','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':'FaxAccountId','onDelete':_0xfa74('0x10a')});db['FaxAccount'][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xfa74('0x46')][_0xfa74('0x10c')](db['FaxInteraction'],{'as':_0xfa74('0x158')});db['FaxAccount']['hasMany'](db[_0xfa74('0x48')],{'as':_0xfa74('0x138')});db[_0xfa74('0x46')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x16c'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db['FaxMessage'],{'as':_0xfa74('0x149')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x46')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x46')][_0xfa74('0x119')](db['User'],{'as':'Agents','through':_0xfa74('0x12e')});db['FaxApplication']['belongsTo'](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['FaxInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x4b')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':'FaxInteractionId'});db[_0xfa74('0x4a')]['belongsTo'](db[_0xfa74('0x46')],{'as':'Account','foreignKey':_0xfa74('0x16d')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x4a')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x16e'),'as':'Tags'});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x86')],{'through':'fax_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':'cascade','as':'User'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x171')});db['FaxMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db['FaxMessage'][_0xfa74('0x118')](db['Attachment'],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x4b')][_0xfa74('0x118')](db['FaxAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x16d')});db['FaxQueue']['belongsToMany'](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x31')});db[_0xfa74('0x4d')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x146')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0x46')],{});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x4b')],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['FaxQueueReport'][_0xfa74('0x118')](db['FaxQueue'],{});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x175'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['CannedAnswer'],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x158')});db['SmsAccount'][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x138')});db['SmsAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x134')][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x134')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'user_has_sms_accounts'});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x56')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x134')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x176')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xfa74('0x176')][_0xfa74('0x118')](db['SmsAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x176')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x176')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0xfa74('0x176')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x177'),'as':_0xfa74('0x163')});db[_0xfa74('0x176')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'sms_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x176')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x122'),'foreignKey':_0xfa74('0x178')});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xfa74('0x118')](db['SmsInteraction'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':'SmsInteractionId'});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'as':'Account','foreignKey':_0xfa74('0x175')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x33'),'foreignKey':_0xfa74('0x179')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x146')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':'Dispositions','foreignKey':_0xfa74('0x17b'),'onDelete':'cascade'});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x158'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5e')],{'as':'Messages','foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5a')],{'as':_0xfa74('0x138'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x58')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x58')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x133')});db['OpenchannelApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x5a')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'onDelete':'restrict','foreignKey':_0xfa74('0x17b')});db['OpenchannelApplication']['belongsTo'](db[_0xfa74('0x7d')],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xfa74('0x5c')][_0xfa74('0x10c')](db['OpenchannelMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['OpenchannelAccount'],{'as':_0xfa74('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x180'),'as':_0xfa74('0x163')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_openchannel_interactions','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x10')],{'onDelete':'cascade','as':_0xfa74('0x10')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db['CmContact'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{'onDelete':_0xfa74('0x10a'),'as':'Interaction','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x58')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x34'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['Team'],{'through':'team_has_openchannel_queues','as':_0xfa74('0x146')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x165'),'onDelete':'cascade'});db[_0xfa74('0x12b')]['hasMany'](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x69')],{'as':_0xfa74('0x181')});db['ChatWebsite'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x158')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x138')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':'MailAccount','foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['ChatWebsite'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x12d')});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x58')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5e')],{});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0xfa74('0x63')]['belongsTo'](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':'UserId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')]['belongsTo'](db['ChatQueue'],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x184'),'onDelete':_0xfa74('0x168')});db['ChatApplication']['belongsTo'](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':'TagId'});db[_0xfa74('0x64')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x64')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db[_0xfa74('0x64')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatInteraction'][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x64')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x187'),'as':_0xfa74('0x163')});db[_0xfa74('0x64')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x187'),'as':'ThroughTags'});db['ChatInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x188'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['User'],{'onDelete':'cascade','as':_0xfa74('0x10')});db['ChatMessage'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['ChatInteraction'],{'onDelete':'cascade','as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xfa74('0x10c')](db[_0xfa74('0x172')],{'as':_0xfa74('0x189'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x166')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'UserChatQueue','hooks':!![]});db[_0xfa74('0x66')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x18a'),'as':'Teams'});db[_0xfa74('0x68')][_0xfa74('0x10c')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xfa74('0x18b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x68')][_0xfa74('0x119')](db['User'],{'as':'Members','through':_0xfa74('0x11a')});db[_0xfa74('0x69')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x6a')]['hasMany'](db[_0xfa74('0x6c')],{'as':'Contacts','foreignKey':_0xfa74('0x18c')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopperFinal'],{'as':_0xfa74('0x10f'),'foreignKey':'ContactId'});db[_0xfa74('0x6c')]['hasMany'](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x151')});db['CmContact']['hasMany'](db[_0xfa74('0xcb')],{'as':'JscriptySessions','foreignKey':_0xfa74('0x151')});db['CmContact'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db['CmContact'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x121'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')]['hasMany'](db[_0xfa74('0x4a')],{'as':'FaxInteractions','foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['MailInteraction'],{'as':_0xfa74('0x11f'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x118')](db[_0xfa74('0x6a')],{'as':_0xfa74('0x18d'),'foreignKey':_0xfa74('0x18c')});db['CmContact'][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x11c')});db['CmContact'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'as':_0xfa74('0x163'),'through':_0xfa74('0x18e')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xfa74('0x6d')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x13b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0xdd')],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x190')});db[_0xfa74('0x13e')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':'cascade'});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':'VoiceQueueId','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')]['belongsTo'](db['Campaign'],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x191'),'singular':_0xfa74('0x192')},'foreignKey':_0xfa74('0x193'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Automation'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x194'),'singular':'OneAny'},'foreignKey':_0xfa74('0x195'),'onDelete':'cascade','hooks':!![]});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x75')],{'as':_0xfa74('0x196'),'foreignKey':'AutomationId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x7a')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x197'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x7d')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'foreignKey':_0xfa74('0x169'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x198'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['FaxApplication'],{'as':_0xfa74('0x199'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x19a'),'foreignKey':'IntervalId'});db[_0xfa74('0x19b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x93')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x91')],{'foreignKey':_0xfa74('0x19c')});db[_0xfa74('0x84')][_0xfa74('0x119')](db[_0xfa74('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xfa74('0x168')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x6c')],{'through':'cm_contact_has_tags'});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x64')],{'through':_0xfa74('0x187')});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'through':_0xfa74('0x162')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x176')],{'through':_0xfa74('0x177')});db[_0xfa74('0x86')]['belongsToMany'](db['FaxInteraction'],{'through':_0xfa74('0x16e')});db['Tag']['belongsToMany'](db[_0xfa74('0x5c')],{'through':'openchannel_interaction_has_tags'});db[_0xfa74('0x86')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xfa74('0x19d')});db['Trigger'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x19e'),'singular':_0xfa74('0x19f')},'foreignKey':_0xfa74('0x1a0'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x1a1')]['hasMany'](db[_0xfa74('0x7b')],{'as':{'plural':'AnyConditions','singular':_0xfa74('0x1a2')},'foreignKey':_0xfa74('0x1a3'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0xfa74('0x196'),'foreignKey':_0xfa74('0x1a4'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x91')][_0xfa74('0x10c')](db[_0xfa74('0x1a5')],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x19c'),'hooks':!![]});db[_0xfa74('0x93')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a6')});db[_0xfa74('0x96')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a8')});db[_0xfa74('0x1a5')][_0xfa74('0x118')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xfa74('0x1a9')][_0xfa74('0x10c')](db[_0xfa74('0x9b')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':'Subjects','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db['SalesforceConfiguration'][_0xfa74('0x10c')](db['SalesforceField'],{'as':_0xfa74('0x1a7'),'onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db['SalesforceConfiguration']['belongsTo'](db[_0xfa74('0x1a9')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1ac')][_0xfa74('0x10c')](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ac')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ac')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1ac')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa74('0x9d')][_0xfa74('0x10c')](db[_0xfa74('0x9f')],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['SugarcrmConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xfa74('0x9f')][_0xfa74('0x118')](db[_0xfa74('0x9d')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db['SugarcrmField'],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa1')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b6')]['hasMany'](db[_0xfa74('0xa4')],{'as':_0xfa74('0x1aa'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db['DeskField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa4')][_0xfa74('0x118')](db[_0xfa74('0x1b6')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['DeskConfiguration'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x1b8')});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db['DeskField'],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['DeskField']['hasMany'](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1b7')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':'VariableId'});db[_0xfa74('0xa6')][_0xfa74('0x10c')](db[_0xfa74('0xa8')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['ZohoConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xa6')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xaa')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xaa')]['hasMany'](db[_0xfa74('0xaa')],{'as':'Field','foreignKey':'FieldId'});db[_0xfa74('0xaa')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b9')][_0xfa74('0x10c')](db[_0xfa74('0xab')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b3'),'foreignKey':'SubjectId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xab')][_0xfa74('0x118')](db['ZendeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db['FreshdeskAccount'][_0xfa74('0x10c')](db['FreshdeskConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskConfiguration'][_0xfa74('0x118')](db['FreshdeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['FreshdeskConfiguration'][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x1bc')});db['FreshdeskField'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskField']['belongsTo'](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb1')][_0xfa74('0x10c')](db[_0xfa74('0x1bd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1ae'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db['VtigerField'],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['VtigerConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xb1')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb3')]['hasMany'](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb3')][_0xfa74('0x118')](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb5')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['ServicenowConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db['ServicenowField'],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb7')][_0xfa74('0x118')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb9')]['hasMany'](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb9')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xbb')]['hasMany'](db[_0xfa74('0xbd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xbd')][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':_0xfa74('0x1af')});db['Dynamics365Configuration'][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['Dynamics365Configuration'][_0xfa74('0x118')](db['Dynamics365Account'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xbf')][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xbf')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xc0')][_0xfa74('0x10c')](db['FreshsalesConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xc2')]['hasMany'](db['FreshsalesField'],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xc2')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xc2')]['hasMany'](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['FreshsalesConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xc0')],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db['FreshsalesField'][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b4'),'foreignKey':'FieldId'});db[_0xfa74('0xc3')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x12b')],{});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatQueueReport'][_0xfa74('0x118')](db['ChatInteraction'],{});db[_0xfa74('0xc6')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x10')],{});db['ChatQueueReport']['belongsTo'](db[_0xfa74('0x66')],{});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1be')});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':'ToId'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1bf'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0x134')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['SmsMessage'],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['User'],{});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x56')],{});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xfa74('0xd1')]['hasMany'](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd4')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x136')});db['Team']['belongsToMany'](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11e')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db['VoiceQueue'],{'through':_0xfa74('0x103'),'as':_0xfa74('0x125')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x3b')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x1c2')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x66')],{'through':'team_has_chat_queues','as':_0xfa74('0x1c3')});db['Team']['belongsToMany'](db[_0xfa74('0x4d')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x1c4')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x1c5')});db['Team'][_0xfa74('0x119')](db['OpenchannelQueue'],{'through':_0xfa74('0x1c6'),'as':_0xfa74('0x128')});db['Team'][_0xfa74('0x119')](db[_0xfa74('0xff')],{'through':_0xfa74('0x1c7'),'as':'WhatsappQueues'});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'through':'TeamVoicePrefix','as':_0xfa74('0x126')});db[_0xfa74('0xdd')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':_0xfa74('0x1c8')});db['Campaign'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':_0xfa74('0x1c9')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0xd4')],{'as':_0xfa74('0xd4'),'foreignKey':_0xfa74('0x1ca')});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x1cb')});db[_0xfa74('0x172')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x114')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1cc'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3b')],{'foreignKey':_0xfa74('0x1d0'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1d2'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x64')],{});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x12b')],{'foreignKey':_0xfa74('0x1d4'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':'ToAgent'});db['ChatTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x66')],{'foreignKey':_0xfa74('0x1d6'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['ChatWebsite'],{'foreignKey':_0xfa74('0x1d7'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x4b')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1d8'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['FaxTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'foreignKey':'ToFaxQueueId','as':_0xfa74('0x1d1')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1da'),'as':'ToAccount'});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x5e')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'foreignKey':_0xfa74('0x1db'),'as':'FromAccount'});db[_0xfa74('0xe7')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5f')],{'foreignKey':_0xfa74('0x1dc'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xfa74('0x118')](db['OpenchannelAccount'],{'foreignKey':_0xfa74('0x1dd'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x54')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':_0xfa74('0x1de'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe8')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x56')],{'foreignKey':_0xfa74('0x1df'),'as':'ToQueue'});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':'ToSmsAccountId','as':_0xfa74('0x1d3')});db['CmList'][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x15a'),'onDelete':'cascade'});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db[_0xfa74('0x73')],{'as':_0xfa74('0x1e0'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmContact'],{'as':'Contacts','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':'HopperFinals','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['ReportAgentPreview'],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x1e1'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11d')});db[_0xfa74('0xeb')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade'});db[_0xfa74('0xeb')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x107')});db[_0xfa74('0xeb')]['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x105'),'as':_0xfa74('0x146')});db[_0xfa74('0xed')][_0xfa74('0x10c')](db[_0xfa74('0x10')],{'as':'Users','foreignKey':_0xfa74('0x1e2')});db['UserProfile'][_0xfa74('0x10c')](db[_0xfa74('0xef')],{'as':_0xfa74('0x1e3'),'foreignKey':'userProfileId','onDelete':_0xfa74('0x10a')});db['UserProfileSection'][_0xfa74('0x10c')](db[_0xfa74('0xf1')],{'as':'Resources','foreignKey':_0xfa74('0x1e4'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x1e5'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['WhatsappMessage'],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':'Interactions'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf7')],{'as':'Applications'});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['WhatsappAccount'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x1e6')});db['WhatsappApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'onDelete':'restrict'});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xf7')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['WhatsappInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x1e7')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db['WhatsappAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0xf9')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db['WhatsappInteraction'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x19d'),'as':_0xfa74('0x163')});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x124'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x10')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':_0xfa74('0x150')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x1e8')});db['WhatsappMessage']['belongsTo'](db[_0xfa74('0xf5')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{});db['WhatsappQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xfc')]['belongsTo'](db[_0xfa74('0x6c')],{'as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db['WhatsappQueue'],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db['WhatsappTransferReport'][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':'FromWhatsappAccountId','as':_0xfa74('0x1cd')});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':_0xfa74('0x1e9'),'as':'ToAccount'});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'foreignKey':_0xfa74('0x1ea'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xff')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue']['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x1c7'),'as':_0xfa74('0x146')});module[_0xfa74('0x1eb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 245ed98..4bd1c47 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4528=['./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./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/pm2','/api/webbar','./api/webbar','root','/www','static','join','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','password','newPassword','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','key','pass','accountSid','secret','registry','isPlainObject','length','isString','replace','@@{','}@@','includes','lodash','path','express','util','./errors','./config/environment','./config/logger','api','./safe-template','safeTemplate','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','statusCode','other','agent_name','test','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/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/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4528,0x1a3));var _0x8452=function(_0x5905f6,_0x3bf88f){_0x5905f6=_0x5905f6-0x0;var _0x3ce641=_0x4528[_0x5905f6];return _0x3ce641;};'use strict';var _=require(_0x8452('0x0'));var path=require(_0x8452('0x1'));var express=require(_0x8452('0x2'));var ewinston=require('express-winston');var util=require(_0x8452('0x3'));var errors=require(_0x8452('0x4'));var config=require(_0x8452('0x5'));var logger=require(_0x8452('0x6'))(_0x8452('0x7'));var authLogger=require(_0x8452('0x6'))('auth');var safeTemplate=require(_0x8452('0x8'))[_0x8452('0x9')];exports[_0x8452('0xa')]=function(_0xc005f6){_0xc005f6['use'](ewinston[_0x8452('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x10b113,_0x16ac20){var _0x2f59a2=_0x8452('0xc');if(!_[_0x8452('0xd')](_0x10b113[_0x8452('0xe')])){_0x2f59a2+=_0x8452('0xf');var _0x283ca3=_0x10b113[_0x8452('0xe')];maskSensitiveData(_0x283ca3);}return safeTemplate(util['format'](_0x2f59a2,_0x10b113[_0x8452('0x10')],_0x10b113[_0x8452('0x11')][_0x8452('0x12')]?_0x10b113[_0x8452('0x11')][_0x8452('0x12')]:_0x10b113[_0x8452('0x13')][_0x8452('0x14')]||_0x10b113['ip'],_0x10b113[_0x8452('0x15')],_0x16ac20['statusCode'],_0x16ac20[_0x8452('0x16')],_0x10b113['user']?_0x10b113[_0x8452('0x17')]['id']:null,_0x10b113['user']?_0x10b113['user'][_0x8452('0x18')]:null,_0x10b113[_0x8452('0x17')]?_0x10b113[_0x8452('0x17')][_0x8452('0x19')]:null,_0x283ca3?util[_0x8452('0x1a')](_0x283ca3,![],null):''));}}));_0xc005f6['use'](ewinston[_0x8452('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2e0ac4,_0x40e094){var _0x140c07=_0x8452('0x1b');if(_0x2e0ac4[_0x8452('0xe')]&&_0x2e0ac4[_0x8452('0xe')][_0x8452('0x1c')]&&_0x2e0ac4[_0x8452('0xe')][_0x8452('0x1d')]){_0x140c07=_0x8452('0x1e');}return util[_0x8452('0x1f')](_0x140c07,_0x2e0ac4[_0x8452('0x10')],_0x2e0ac4[_0x8452('0x11')][_0x8452('0x12')]?_0x2e0ac4[_0x8452('0x11')][_0x8452('0x12')]:_0x2e0ac4[_0x8452('0x13')][_0x8452('0x14')]||_0x2e0ac4['ip'],_0x2e0ac4[_0x8452('0x15')],_0x40e094[_0x8452('0x20')],_0x40e094[_0x8452('0x16')],_0x2e0ac4[_0x8452('0x17')]?_0x2e0ac4[_0x8452('0x17')]['id']:null,_0x2e0ac4['user']?_0x2e0ac4['user'][_0x8452('0x18')]:null,_0x2e0ac4['user']?_0x2e0ac4['user']['role']:null,_0x2e0ac4[_0x8452('0xe')]&&_0x2e0ac4[_0x8452('0xe')][_0x8452('0x1c')]?_0x2e0ac4[_0x8452('0xe')][_0x8452('0x1c')]:_0x8452('0x21'),_0x2e0ac4[_0x8452('0xe')]&&_0x2e0ac4[_0x8452('0xe')][_0x8452('0x1d')]?_0x2e0ac4['body'][_0x8452('0x1d')]:'',_0x2e0ac4['body']&&_0x2e0ac4[_0x8452('0xe')][_0x8452('0x22')]?_0x2e0ac4[_0x8452('0xe')]['agent_name']:'');},'ignoreRoute':function(_0x116cda){var _0x3a2e9e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3a2e9e[_0x8452('0x23')](_0x116cda[_0x8452('0x15')]);}}));_0xc005f6[_0x8452('0x24')](_0x8452('0x25'),require(_0x8452('0x26')));_0xc005f6['use'](_0x8452('0x27'),require(_0x8452('0x28')));_0xc005f6[_0x8452('0x24')](_0x8452('0x29'),require(_0x8452('0x2a')));_0xc005f6[_0x8452('0x24')](_0x8452('0x2b'),require(_0x8452('0x2c')));_0xc005f6[_0x8452('0x24')](_0x8452('0x2d'),require('./api/voiceMusicOnHold'));_0xc005f6[_0x8452('0x24')](_0x8452('0x2e'),require(_0x8452('0x2f')));_0xc005f6[_0x8452('0x24')]('/api/voice/recordings',require('./api/voiceRecording'));_0xc005f6[_0x8452('0x24')](_0x8452('0x30'),require(_0x8452('0x31')));_0xc005f6[_0x8452('0x24')](_0x8452('0x32'),require(_0x8452('0x33')));_0xc005f6['use'](_0x8452('0x34'),require(_0x8452('0x35')));_0xc005f6[_0x8452('0x24')]('/api/voice/calls/reports',require(_0x8452('0x36')));_0xc005f6['use']('/api/voice/dials/reports',require('./api/voiceDialReport'));_0xc005f6[_0x8452('0x24')](_0x8452('0x37'),require(_0x8452('0x38')));_0xc005f6[_0x8452('0x24')](_0x8452('0x39'),require(_0x8452('0x3a')));_0xc005f6[_0x8452('0x24')]('/api/members/reports',require(_0x8452('0x3b')));_0xc005f6[_0x8452('0x24')]('/api/trunks',require(_0x8452('0x3c')));_0xc005f6[_0x8452('0x24')]('/api/voice/transfers/reports',require(_0x8452('0x3d')));_0xc005f6['use'](_0x8452('0x3e'),require('./api/mailServerOut'));_0xc005f6[_0x8452('0x24')]('/api/mail/accounts',require(_0x8452('0x3f')));_0xc005f6[_0x8452('0x24')](_0x8452('0x40'),require(_0x8452('0x41')));_0xc005f6[_0x8452('0x24')](_0x8452('0x42'),require(_0x8452('0x43')));_0xc005f6['use'](_0x8452('0x44'),require(_0x8452('0x45')));_0xc005f6[_0x8452('0x24')](_0x8452('0x46'),require(_0x8452('0x47')));_0xc005f6[_0x8452('0x24')](_0x8452('0x48'),require(_0x8452('0x49')));_0xc005f6[_0x8452('0x24')]('/api/mail/reports/queue',require(_0x8452('0x4a')));_0xc005f6[_0x8452('0x24')]('/api/dashboards',require(_0x8452('0x4b')));_0xc005f6[_0x8452('0x24')](_0x8452('0x4c'),require(_0x8452('0x4d')));_0xc005f6[_0x8452('0x24')](_0x8452('0x4e'),require('./api/faxAccount'));_0xc005f6['use'](_0x8452('0x4f'),require(_0x8452('0x50')));_0xc005f6[_0x8452('0x24')]('/api/fax/interactions',require(_0x8452('0x51')));_0xc005f6['use']('/api/fax/messages',require('./api/faxMessage'));_0xc005f6[_0x8452('0x24')](_0x8452('0x52'),require(_0x8452('0x53')));_0xc005f6[_0x8452('0x24')](_0x8452('0x54'),require(_0x8452('0x55')));_0xc005f6[_0x8452('0x24')](_0x8452('0x56'),require(_0x8452('0x57')));_0xc005f6[_0x8452('0x24')](_0x8452('0x58'),require(_0x8452('0x59')));_0xc005f6[_0x8452('0x24')]('/api/sms/interactions',require(_0x8452('0x5a')));_0xc005f6['use'](_0x8452('0x5b'),require(_0x8452('0x5c')));_0xc005f6[_0x8452('0x24')]('/api/sms/queues',require(_0x8452('0x5d')));_0xc005f6['use'](_0x8452('0x5e'),require('./api/openchannelAccount'));_0xc005f6[_0x8452('0x24')](_0x8452('0x5f'),require(_0x8452('0x60')));_0xc005f6[_0x8452('0x24')](_0x8452('0x61'),require(_0x8452('0x62')));_0xc005f6['use']('/api/openchannel/messages',require(_0x8452('0x63')));_0xc005f6[_0x8452('0x24')](_0x8452('0x64'),require('./api/openchannelQueue'));_0xc005f6[_0x8452('0x24')](_0x8452('0x65'),require('./api/chatWebsite'));_0xc005f6[_0x8452('0x24')](_0x8452('0x66'),require(_0x8452('0x67')));_0xc005f6[_0x8452('0x24')](_0x8452('0x68'),require(_0x8452('0x69')));_0xc005f6[_0x8452('0x24')](_0x8452('0x6a'),require('./api/chatInteraction'));_0xc005f6[_0x8452('0x24')](_0x8452('0x6b'),require(_0x8452('0x6c')));_0xc005f6[_0x8452('0x24')](_0x8452('0x6d'),require('./api/chatOfflineMessage'));_0xc005f6[_0x8452('0x24')](_0x8452('0x6e'),require(_0x8452('0x6f')));_0xc005f6[_0x8452('0x24')](_0x8452('0x70'),require(_0x8452('0x71')));_0xc005f6[_0x8452('0x24')](_0x8452('0x72'),require('./api/chatProactiveAction'));_0xc005f6[_0x8452('0x24')](_0x8452('0x73'),require('./api/cmCompany'));_0xc005f6[_0x8452('0x24')](_0x8452('0x74'),require(_0x8452('0x75')));_0xc005f6[_0x8452('0x24')](_0x8452('0x76'),require(_0x8452('0x77')));_0xc005f6[_0x8452('0x24')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0xc005f6[_0x8452('0x24')](_0x8452('0x78'),require('./api/cmHopperFinal'));_0xc005f6[_0x8452('0x24')](_0x8452('0x79'),require(_0x8452('0x7a')));_0xc005f6[_0x8452('0x24')](_0x8452('0x7b'),require(_0x8452('0x7c')));_0xc005f6['use'](_0x8452('0x7d'),require(_0x8452('0x7e')));_0xc005f6[_0x8452('0x24')](_0x8452('0x7f'),require(_0x8452('0x80')));_0xc005f6[_0x8452('0x24')](_0x8452('0x81'),require('./api/cannedAnswer'));_0xc005f6[_0x8452('0x24')](_0x8452('0x82'),require(_0x8452('0x83')));_0xc005f6['use'](_0x8452('0x84'),require(_0x8452('0x85')));_0xc005f6[_0x8452('0x24')](_0x8452('0x86'),require('./api/interval'));_0xc005f6['use'](_0x8452('0x87'),require('./api/pause'));_0xc005f6[_0x8452('0x24')](_0x8452('0x88'),require(_0x8452('0x89')));_0xc005f6[_0x8452('0x24')](_0x8452('0x8a'),require(_0x8452('0x8b')));_0xc005f6['use']('/api/schedules',require('./api/schedule'));_0xc005f6[_0x8452('0x24')](_0x8452('0x8c'),require(_0x8452('0x8d')));_0xc005f6[_0x8452('0x24')](_0x8452('0x8e'),require('./api/tag'));_0xc005f6['use'](_0x8452('0x8f'),require(_0x8452('0x90')));_0xc005f6[_0x8452('0x24')](_0x8452('0x91'),require(_0x8452('0x92')));_0xc005f6[_0x8452('0x24')](_0x8452('0x93'),require(_0x8452('0x94')));_0xc005f6[_0x8452('0x24')]('/api/integrations',require(_0x8452('0x95')));_0xc005f6[_0x8452('0x24')](_0x8452('0x96'),require(_0x8452('0x97')));_0xc005f6[_0x8452('0x24')](_0x8452('0x98'),require(_0x8452('0x99')));_0xc005f6['use'](_0x8452('0x9a'),require('./api/analyticDefaultReport'));_0xc005f6[_0x8452('0x24')](_0x8452('0x9b'),require(_0x8452('0x9c')));_0xc005f6[_0x8452('0x24')](_0x8452('0x9d'),require('./api/analyticMetric'));_0xc005f6['use']('/api/analytics/field_reports',require(_0x8452('0x9e')));_0xc005f6[_0x8452('0x24')](_0x8452('0x9f'),require(_0x8452('0xa0')));_0xc005f6['use']('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0xc005f6['use']('/api/integrations/salesforce/configurations',require(_0x8452('0xa1')));_0xc005f6['use']('/api/integrations/salesforce/fields',require(_0x8452('0xa2')));_0xc005f6[_0x8452('0x24')]('/api/integrations/sugarcrm/accounts',require(_0x8452('0xa3')));_0xc005f6['use'](_0x8452('0xa4'),require(_0x8452('0xa5')));_0xc005f6[_0x8452('0x24')](_0x8452('0xa6'),require(_0x8452('0xa7')));_0xc005f6[_0x8452('0x24')]('/api/integrations/desk/accounts',require(_0x8452('0xa8')));_0xc005f6[_0x8452('0x24')](_0x8452('0xa9'),require(_0x8452('0xaa')));_0xc005f6[_0x8452('0x24')](_0x8452('0xab'),require(_0x8452('0xac')));_0xc005f6['use'](_0x8452('0xad'),require('./api/intZohoAccount'));_0xc005f6[_0x8452('0x24')](_0x8452('0xae'),require(_0x8452('0xaf')));_0xc005f6['use'](_0x8452('0xb0'),require(_0x8452('0xb1')));_0xc005f6[_0x8452('0x24')]('/api/integrations/zendesk/accounts',require(_0x8452('0xb2')));_0xc005f6[_0x8452('0x24')](_0x8452('0xb3'),require(_0x8452('0xb4')));_0xc005f6[_0x8452('0x24')]('/api/integrations/zendesk/fields',require(_0x8452('0xb5')));_0xc005f6[_0x8452('0x24')](_0x8452('0xb6'),require(_0x8452('0xb7')));_0xc005f6[_0x8452('0x24')](_0x8452('0xb8'),require(_0x8452('0xb9')));_0xc005f6['use']('/api/integrations/freshdesk/fields',require(_0x8452('0xba')));_0xc005f6['use'](_0x8452('0xbb'),require('./api/intVtigerAccount'));_0xc005f6[_0x8452('0x24')]('/api/integrations/vtiger/configurations',require(_0x8452('0xbc')));_0xc005f6[_0x8452('0x24')]('/api/integrations/vtiger/fields',require(_0x8452('0xbd')));_0xc005f6[_0x8452('0x24')](_0x8452('0xbe'),require(_0x8452('0xbf')));_0xc005f6['use']('/api/integrations/servicenow/configurations',require(_0x8452('0xc0')));_0xc005f6[_0x8452('0x24')](_0x8452('0xc1'),require(_0x8452('0xc2')));_0xc005f6['use'](_0x8452('0xc3'),require(_0x8452('0xc4')));_0xc005f6[_0x8452('0x24')](_0x8452('0xc5'),require(_0x8452('0xc6')));_0xc005f6['use']('/api/integrations/dynamics365/fields',require(_0x8452('0xc7')));_0xc005f6[_0x8452('0x24')](_0x8452('0xc8'),require('./api/intFreshsalesAccount'));_0xc005f6[_0x8452('0x24')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0xc005f6['use'](_0x8452('0xc9'),require('./api/intFreshsalesField'));_0xc005f6[_0x8452('0x24')](_0x8452('0xca'),require(_0x8452('0xcb')));_0xc005f6[_0x8452('0x24')]('/api/chat/reports/queue',require(_0x8452('0xcc')));_0xc005f6[_0x8452('0x24')](_0x8452('0xcd'),require(_0x8452('0xce')));_0xc005f6[_0x8452('0x24')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0xc005f6['use'](_0x8452('0xcf'),require(_0x8452('0xd0')));_0xc005f6['use'](_0x8452('0xd1'),require('./api/jscriptySessionReport'));_0xc005f6[_0x8452('0x24')](_0x8452('0xd2'),require('./api/smsQueueReport'));_0xc005f6[_0x8452('0x24')]('/api/square/reports',require(_0x8452('0xd3')));_0xc005f6[_0x8452('0x24')](_0x8452('0xd4'),require(_0x8452('0xd5')));_0xc005f6[_0x8452('0x24')](_0x8452('0xd6'),require(_0x8452('0xd7')));_0xc005f6[_0x8452('0x24')](_0x8452('0xd8'),require('./api/setting'));_0xc005f6[_0x8452('0x24')]('/api/square/odbc',require(_0x8452('0xd9')));_0xc005f6[_0x8452('0x24')](_0x8452('0xda'),require('./api/squareProject'));_0xc005f6[_0x8452('0x24')](_0x8452('0xdb'),require(_0x8452('0xdc')));_0xc005f6[_0x8452('0x24')](_0x8452('0xdd'),require('./api/squareMessage'));_0xc005f6[_0x8452('0x24')]('/api/teams',require(_0x8452('0xde')));_0xc005f6[_0x8452('0x24')](_0x8452('0xdf'),require(_0x8452('0xe0')));_0xc005f6[_0x8452('0x24')]('/api/campaigns',require(_0x8452('0xe1')));_0xc005f6[_0x8452('0x24')]('/api/migrations',require(_0x8452('0xe2')));_0xc005f6[_0x8452('0x24')](_0x8452('0xe3'),require(_0x8452('0xe4')));_0xc005f6[_0x8452('0x24')](_0x8452('0xe5'),require(_0x8452('0xe6')));_0xc005f6[_0x8452('0x24')]('/api/mail/reports/transfer',require(_0x8452('0xe7')));_0xc005f6['use'](_0x8452('0xe8'),require('./api/chatTransferReport'));_0xc005f6[_0x8452('0x24')](_0x8452('0xe9'),require(_0x8452('0xea')));_0xc005f6[_0x8452('0x24')]('/api/openchannel/reports/transfer',require(_0x8452('0xeb')));_0xc005f6[_0x8452('0x24')](_0x8452('0xec'),require(_0x8452('0xed')));_0xc005f6[_0x8452('0x24')]('/api/cm/lists',require('./api/cmList'));_0xc005f6[_0x8452('0x24')](_0x8452('0xee'),require(_0x8452('0xef')));_0xc005f6[_0x8452('0x24')](_0x8452('0xf0'),require(_0x8452('0xf1')));_0xc005f6[_0x8452('0x24')]('/api/userProfile/sections',require('./api/userProfileSection'));_0xc005f6[_0x8452('0x24')](_0x8452('0xf2'),require(_0x8452('0xf3')));_0xc005f6['use'](_0x8452('0xf4'),require(_0x8452('0xf5')));_0xc005f6[_0x8452('0x24')](_0x8452('0xf6'),require(_0x8452('0xf7')));_0xc005f6[_0x8452('0x24')](_0x8452('0xf8'),require(_0x8452('0xf9')));_0xc005f6[_0x8452('0x24')](_0x8452('0xfa'),require(_0x8452('0xfb')));_0xc005f6[_0x8452('0x24')]('/api/whatsapp/messages',require(_0x8452('0xfc')));_0xc005f6[_0x8452('0x24')](_0x8452('0xfd'),require(_0x8452('0xfe')));_0xc005f6[_0x8452('0x24')](_0x8452('0xff'),require('./api/whatsappTransferReport'));_0xc005f6[_0x8452('0x24')](_0x8452('0x100'),require(_0x8452('0x101')));_0xc005f6[_0x8452('0x24')](_0x8452('0x102'),require(_0x8452('0x103')));_0xc005f6[_0x8452('0x24')](_0x8452('0x104'),require(_0x8452('0x105')));_0xc005f6[_0x8452('0x24')](_0x8452('0x106'),require(_0x8452('0x107')));_0xc005f6['use'](_0x8452('0x108'),require('./api/authGoogle'));_0xc005f6[_0x8452('0x24')](_0x8452('0x109'),require('./api/jira'));_0xc005f6['use'](_0x8452('0x10a'),require(_0x8452('0x10b')));_0xc005f6['use'](_0x8452('0x10c'),require(_0x8452('0x10d')));_0xc005f6[_0x8452('0x24')](_0x8452('0x10e'),require(_0x8452('0x10f')));_0xc005f6['use'](_0x8452('0x110'),require(_0x8452('0x111')));_0xc005f6[_0x8452('0x24')](_0x8452('0x112'),require(_0x8452('0x113')));_0xc005f6[_0x8452('0x24')]('/apidoc',express['static'](path['join'](config[_0x8452('0x114')],'/apidoc')));_0xc005f6[_0x8452('0x24')](_0x8452('0x115'),express[_0x8452('0x116')](path[_0x8452('0x117')](config[_0x8452('0x114')],_0x8452('0x115'))));_0xc005f6[_0x8452('0x24')](_0x8452('0x118'),express[_0x8452('0x116')](path[_0x8452('0x117')](config[_0x8452('0x114')],_0x8452('0x118'))));_0xc005f6[_0x8452('0x24')](_0x8452('0x119'),express[_0x8452('0x116')](path['join'](config['root'],_0x8452('0x11a'),_0x8452('0x11b'))));_0xc005f6[_0x8452('0x24')]('/plugins',express[_0x8452('0x116')](path[_0x8452('0x117')](config[_0x8452('0x114')],_0x8452('0x11c'))));_0xc005f6[_0x8452('0x11d')](_0x8452('0x11e'))[_0x8452('0x11f')](errors[0x194]);_0xc005f6[_0x8452('0x11d')]('/*')[_0x8452('0x11f')](function(_0x549415,_0x267dc8){_0x267dc8[_0x8452('0x120')](path[_0x8452('0x121')](_0xc005f6[_0x8452('0x11f')](_0x8452('0x122'))+_0x8452('0x123')));});};var sensitiveFields=['username',_0x8452('0x124'),_0x8452('0x125'),'apiKey','firstName',_0x8452('0x126'),_0x8452('0x127'),_0x8452('0x128'),'mobile',_0x8452('0x129'),_0x8452('0x12a'),_0x8452('0x12b'),_0x8452('0x12c'),_0x8452('0x12d'),_0x8452('0x12e'),'accessKey',_0x8452('0x12f'),'token',_0x8452('0x130'),_0x8452('0x131'),_0x8452('0x132'),_0x8452('0x133'),_0x8452('0x134'),'consumerSecret',_0x8452('0x135'),_0x8452('0x136'),_0x8452('0x137'),_0x8452('0x138'),_0x8452('0x139'),'clientEmail',_0x8452('0x13a'),_0x8452('0x13b'),'secretaccesskey',_0x8452('0x13c'),_0x8452('0x17'),_0x8452('0x13d'),_0x8452('0x13e'),'localstationid','dsn',_0x8452('0x13f'),_0x8452('0x140'),'oldPassword'];function maskSensitiveData(_0x113fb5){var _0x3d6d24=/(?!^)[\s\S](?!$)/g;if(!_[_0x8452('0x141')](_0x113fb5))return;for(var _0x198881 in _0x113fb5){if(_['isArray'](_0x113fb5[_0x198881])){for(var _0x31d220=0x0;_0x31d220<_0x113fb5[_0x198881][_0x8452('0x142')];_0x31d220++){maskSensitiveData(_0x113fb5[_0x198881][_0x31d220]);}}else if(_[_0x8452('0x141')](_0x113fb5[_0x198881])){maskSensitiveData(_0x113fb5[_0x198881]);}else if(_[_0x8452('0x143')](_0x113fb5[_0x198881])){_0x113fb5[_0x198881]=_0x113fb5[_0x198881][_0x8452('0x144')](/{{{/g,_0x8452('0x145'))[_0x8452('0x144')](/}}}/g,_0x8452('0x146'))['replace'](/{{/g,'@{')[_0x8452('0x144')](/}}/g,'}@');if(_[_0x8452('0x147')](sensitiveFields,_0x198881)){_0x113fb5[_0x198881]=_0x113fb5[_0x198881][_0x8452('0x144')](_0x3d6d24,'*');}}}} \ No newline at end of file +var _0xee44=['./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','/api/auth/google','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','/www','join','root','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','username','password','newPassword','apiKey','firstName','lastName','street','phone','email','clientId','clientSecret','code','accessKey','tenantId','token','accessToken','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','accesskeyid','secretaccesskey','dsn','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','includes','lodash','path','./errors','api','./config/logger','./safe-template','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','other','agent_id','agent_name','test','url','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','/api/automations','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','./api/variable','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports'];(function(_0x2b1fd6,_0x4cb237){var _0x2ccb1b=function(_0xa4310e){while(--_0xa4310e){_0x2b1fd6['push'](_0x2b1fd6['shift']());}};_0x2ccb1b(++_0x4cb237);}(_0xee44,0xaa));var _0x4ee4=function(_0x189cab,_0x1a0592){_0x189cab=_0x189cab-0x0;var _0x273b53=_0xee44[_0x189cab];return _0x273b53;};'use strict';var _=require(_0x4ee4('0x0'));var path=require(_0x4ee4('0x1'));var express=require('express');var ewinston=require('express-winston');var util=require('util');var errors=require(_0x4ee4('0x2'));var config=require('./config/environment');var logger=require('./config/logger')(_0x4ee4('0x3'));var authLogger=require(_0x4ee4('0x4'))('auth');var safeTemplate=require(_0x4ee4('0x5'))['safeTemplate'];exports['default']=function(_0x130108){_0x130108[_0x4ee4('0x6')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x50a39e,_0x1776d0){var _0x4138be=_0x4ee4('0x7');if(!_[_0x4ee4('0x8')](_0x50a39e[_0x4ee4('0x9')])){_0x4138be+=_0x4ee4('0xa');var _0x302dba=_0x50a39e['body'];maskSensitiveData(_0x302dba);}return safeTemplate(util[_0x4ee4('0xb')](_0x4138be,_0x50a39e[_0x4ee4('0xc')],_0x50a39e[_0x4ee4('0xd')][_0x4ee4('0xe')]?_0x50a39e[_0x4ee4('0xd')][_0x4ee4('0xe')]:_0x50a39e[_0x4ee4('0xf')][_0x4ee4('0x10')]||_0x50a39e['ip'],_0x50a39e['url'],_0x1776d0['statusCode'],_0x1776d0[_0x4ee4('0x11')],_0x50a39e[_0x4ee4('0x12')]?_0x50a39e['user']['id']:null,_0x50a39e[_0x4ee4('0x12')]?_0x50a39e[_0x4ee4('0x12')][_0x4ee4('0x13')]:null,_0x50a39e[_0x4ee4('0x12')]?_0x50a39e[_0x4ee4('0x12')][_0x4ee4('0x14')]:null,_0x302dba?util[_0x4ee4('0x15')](_0x302dba,![],null):''));}}));_0x130108[_0x4ee4('0x6')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x27090f,_0x165852){var _0x5408b5=_0x4ee4('0x16');if(_0x27090f[_0x4ee4('0x9')]&&_0x27090f['body'][_0x4ee4('0x17')]&&_0x27090f['body']['agent_id']){_0x5408b5=_0x4ee4('0x18');}return util[_0x4ee4('0xb')](_0x5408b5,_0x27090f[_0x4ee4('0xc')],_0x27090f['headers'][_0x4ee4('0xe')]?_0x27090f['headers'][_0x4ee4('0xe')]:_0x27090f[_0x4ee4('0xf')][_0x4ee4('0x10')]||_0x27090f['ip'],_0x27090f['url'],_0x165852[_0x4ee4('0x19')],_0x165852[_0x4ee4('0x11')],_0x27090f['user']?_0x27090f['user']['id']:null,_0x27090f[_0x4ee4('0x12')]?_0x27090f[_0x4ee4('0x12')][_0x4ee4('0x13')]:null,_0x27090f[_0x4ee4('0x12')]?_0x27090f[_0x4ee4('0x12')]['role']:null,_0x27090f['body']&&_0x27090f[_0x4ee4('0x9')][_0x4ee4('0x17')]?_0x27090f[_0x4ee4('0x9')][_0x4ee4('0x17')]:_0x4ee4('0x1a'),_0x27090f[_0x4ee4('0x9')]&&_0x27090f[_0x4ee4('0x9')]['agent_id']?_0x27090f[_0x4ee4('0x9')][_0x4ee4('0x1b')]:'',_0x27090f[_0x4ee4('0x9')]&&_0x27090f[_0x4ee4('0x9')][_0x4ee4('0x1c')]?_0x27090f[_0x4ee4('0x9')][_0x4ee4('0x1c')]:'');},'ignoreRoute':function(_0x2064c1){var _0x5d3e19=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5d3e19[_0x4ee4('0x1d')](_0x2064c1[_0x4ee4('0x1e')]);}}));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x1f'),require('./api/user'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x20'),require(_0x4ee4('0x21')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x22'),require('./api/voiceContext'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x23'),require('./api/voiceExtension'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x24'),require('./api/voiceMusicOnHold'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x25'),require(_0x4ee4('0x26')));_0x130108[_0x4ee4('0x6')]('/api/voice/recordings',require('./api/voiceRecording'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x27'),require(_0x4ee4('0x28')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x29'),require(_0x4ee4('0x2a')));_0x130108['use']('/api/voice/mails/messages',require(_0x4ee4('0x2b')));_0x130108['use']('/api/voice/calls/reports',require(_0x4ee4('0x2c')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x2d'),require('./api/voiceDialReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x2e'),require(_0x4ee4('0x2f')));_0x130108[_0x4ee4('0x6')]('/api/voice/queues/reports',require(_0x4ee4('0x30')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x31'),require(_0x4ee4('0x32')));_0x130108['use'](_0x4ee4('0x33'),require(_0x4ee4('0x34')));_0x130108['use'](_0x4ee4('0x35'),require('./api/voiceTransferReport'));_0x130108['use'](_0x4ee4('0x36'),require(_0x4ee4('0x37')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x38'),require(_0x4ee4('0x39')));_0x130108['use'](_0x4ee4('0x3a'),require(_0x4ee4('0x3b')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x3c'),require(_0x4ee4('0x3d')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x3e'),require('./api/mailInteraction'));_0x130108['use']('/api/mail/messages',require(_0x4ee4('0x3f')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x40'),require('./api/mailApplication'));_0x130108[_0x4ee4('0x6')]('/api/mail/reports/queue',require(_0x4ee4('0x41')));_0x130108['use']('/api/dashboards',require(_0x4ee4('0x42')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x43'),require(_0x4ee4('0x44')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x45'),require(_0x4ee4('0x46')));_0x130108[_0x4ee4('0x6')]('/api/fax/applications',require('./api/faxApplication'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x47'),require(_0x4ee4('0x48')));_0x130108[_0x4ee4('0x6')]('/api/fax/messages',require('./api/faxMessage'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x49'),require(_0x4ee4('0x4a')));_0x130108['use'](_0x4ee4('0x4b'),require(_0x4ee4('0x4c')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x4d'),require(_0x4ee4('0x4e')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x4f'),require(_0x4ee4('0x50')));_0x130108['use'](_0x4ee4('0x51'),require(_0x4ee4('0x52')));_0x130108[_0x4ee4('0x6')]('/api/sms/messages',require(_0x4ee4('0x53')));_0x130108[_0x4ee4('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x130108['use'](_0x4ee4('0x54'),require(_0x4ee4('0x55')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x56'),require(_0x4ee4('0x57')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x58'),require(_0x4ee4('0x59')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x5a'),require(_0x4ee4('0x5b')));_0x130108['use'](_0x4ee4('0x5c'),require(_0x4ee4('0x5d')));_0x130108['use'](_0x4ee4('0x5e'),require(_0x4ee4('0x5f')));_0x130108[_0x4ee4('0x6')]('/api/openchannel/reports/queue',require(_0x4ee4('0x60')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x61'),require(_0x4ee4('0x62')));_0x130108['use'](_0x4ee4('0x63'),require(_0x4ee4('0x64')));_0x130108['use'](_0x4ee4('0x65'),require(_0x4ee4('0x66')));_0x130108['use'](_0x4ee4('0x67'),require(_0x4ee4('0x68')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x69'),require('./api/chatQueue'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x6a'),require(_0x4ee4('0x6b')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x6c'),require('./api/chatProactiveAction'));_0x130108[_0x4ee4('0x6')]('/api/cm/companies',require(_0x4ee4('0x6d')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x6e'),require('./api/cmContact'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x6f'),require(_0x4ee4('0x70')));_0x130108[_0x4ee4('0x6')]('/api/cm/hopper_black',require(_0x4ee4('0x71')));_0x130108[_0x4ee4('0x6')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x130108['use'](_0x4ee4('0x72'),require('./api/cmHopperHistory'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x73'),require('./api/cmCustomField'));_0x130108['use']('/api/actions',require('./api/action'));_0x130108['use'](_0x4ee4('0x74'),require('./api/automation'));_0x130108[_0x4ee4('0x6')]('/api/canned_answers',require('./api/cannedAnswer'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x75'),require(_0x4ee4('0x76')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x77'),require('./api/condition'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x78'),require('./api/interval'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x79'),require(_0x4ee4('0x7a')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x7b'),require(_0x4ee4('0x7c')));_0x130108[_0x4ee4('0x6')]('/api/voiceQueuesLog',require(_0x4ee4('0x7d')));_0x130108['use']('/api/schedules',require(_0x4ee4('0x7e')));_0x130108['use'](_0x4ee4('0x7f'),require(_0x4ee4('0x80')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x81'),require(_0x4ee4('0x82')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x83'),require('./api/template'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x84'),require(_0x4ee4('0x85')));_0x130108['use']('/api/variables',require(_0x4ee4('0x86')));_0x130108['use']('/api/integrations',require('./api/integration'));_0x130108[_0x4ee4('0x6')]('/api/integrations/reports',require(_0x4ee4('0x87')));_0x130108[_0x4ee4('0x6')]('/api/analytics/custom_reports',require(_0x4ee4('0x88')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x89'),require('./api/analyticDefaultReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x8a'),require('./api/analyticExtractedReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x8b'),require(_0x4ee4('0x8c')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x8d'),require('./api/analyticFieldReport'));_0x130108['use'](_0x4ee4('0x8e'),require(_0x4ee4('0x8f')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x90'),require(_0x4ee4('0x91')));_0x130108['use']('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x130108['use']('/api/integrations/salesforce/fields',require(_0x4ee4('0x92')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x93'),require(_0x4ee4('0x94')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x95'),require('./api/intSugarcrmConfiguration'));_0x130108['use'](_0x4ee4('0x96'),require('./api/intSugarcrmField'));_0x130108[_0x4ee4('0x6')]('/api/integrations/desk/accounts',require(_0x4ee4('0x97')));_0x130108['use'](_0x4ee4('0x98'),require('./api/intDeskConfiguration'));_0x130108[_0x4ee4('0x6')]('/api/integrations/desk/fields',require(_0x4ee4('0x99')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x9a'),require(_0x4ee4('0x9b')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x9c'),require(_0x4ee4('0x9d')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x9e'),require(_0x4ee4('0x9f')));_0x130108['use'](_0x4ee4('0xa0'),require(_0x4ee4('0xa1')));_0x130108['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xa2'),require('./api/intZendeskField'));_0x130108['use'](_0x4ee4('0xa3'),require(_0x4ee4('0xa4')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xa5'),require(_0x4ee4('0xa6')));_0x130108['use']('/api/integrations/freshdesk/fields',require(_0x4ee4('0xa7')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xa8'),require(_0x4ee4('0xa9')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xaa'),require('./api/intVtigerConfiguration'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xab'),require(_0x4ee4('0xac')));_0x130108[_0x4ee4('0x6')]('/api/integrations/servicenow/accounts',require(_0x4ee4('0xad')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xae'),require('./api/intServicenowConfiguration'));_0x130108['use']('/api/integrations/servicenow/fields',require(_0x4ee4('0xaf')));_0x130108['use'](_0x4ee4('0xb0'),require(_0x4ee4('0xb1')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xb2'),require(_0x4ee4('0xb3')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xb4'),require(_0x4ee4('0xb5')));_0x130108['use'](_0x4ee4('0xb6'),require(_0x4ee4('0xb7')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xb8'),require(_0x4ee4('0xb9')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xba'),require(_0x4ee4('0xbb')));_0x130108[_0x4ee4('0x6')]('/api/networks',require(_0x4ee4('0xbc')));_0x130108[_0x4ee4('0x6')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xbd'),require(_0x4ee4('0xbe')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xbf'),require(_0x4ee4('0xc0')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xc1'),require('./api/jscriptyQuestionReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xc2'),require(_0x4ee4('0xc3')));_0x130108[_0x4ee4('0x6')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xc4'),require(_0x4ee4('0xc5')));_0x130108[_0x4ee4('0x6')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xc6'),require(_0x4ee4('0xc7')));_0x130108['use'](_0x4ee4('0xc8'),require(_0x4ee4('0xc9')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xca'),require(_0x4ee4('0xcb')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xcc'),require(_0x4ee4('0xcd')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xce'),require(_0x4ee4('0xcf')));_0x130108['use'](_0x4ee4('0xd0'),require(_0x4ee4('0xd1')));_0x130108['use']('/api/teams',require(_0x4ee4('0xd2')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xd3'),require(_0x4ee4('0xd4')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xd5'),require(_0x4ee4('0xd6')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xd7'),require('./api/migration'));_0x130108['use']('/api/attachments',require(_0x4ee4('0xd8')));_0x130108[_0x4ee4('0x6')]('/api/plugins',require(_0x4ee4('0xd9')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xda'),require(_0x4ee4('0xdb')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xdc'),require('./api/chatTransferReport'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xdd'),require(_0x4ee4('0xde')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xdf'),require(_0x4ee4('0xe0')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xe1'),require(_0x4ee4('0xe2')));_0x130108['use'](_0x4ee4('0xe3'),require(_0x4ee4('0xe4')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xe5'),require(_0x4ee4('0xe6')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xe7'),require(_0x4ee4('0xe8')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xe9'),require('./api/userProfileSection'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xea'),require(_0x4ee4('0xeb')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xec'),require(_0x4ee4('0xed')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xee'),require(_0x4ee4('0xef')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xf0'),require(_0x4ee4('0xf1')));_0x130108['use'](_0x4ee4('0xf2'),require(_0x4ee4('0xf3')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xf4'),require(_0x4ee4('0xf5')));_0x130108['use']('/api/whatsapp/reports/queue',require(_0x4ee4('0xf6')));_0x130108['use'](_0x4ee4('0xf7'),require(_0x4ee4('0xf8')));_0x130108['use']('/api/whatsapp/queues',require(_0x4ee4('0xf9')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xfa'),require(_0x4ee4('0xfb')));_0x130108['use']('/api/realtime',require(_0x4ee4('0xfc')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xfd'),require('./api/authLocal'));_0x130108['use'](_0x4ee4('0xfe'),require('./api/authGoogle'));_0x130108[_0x4ee4('0x6')]('/api/jira',require('./api/jira'));_0x130108[_0x4ee4('0x6')](_0x4ee4('0xff'),require(_0x4ee4('0x100')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x101'),require(_0x4ee4('0x102')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x103'),require(_0x4ee4('0x104')));_0x130108['use'](_0x4ee4('0x105'),require(_0x4ee4('0x106')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x107'),require(_0x4ee4('0x108')));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x109'),express[_0x4ee4('0x10a')](path['join'](config['root'],_0x4ee4('0x109'))));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x10b'),express[_0x4ee4('0x10a')](path[_0x4ee4('0x10c')](config[_0x4ee4('0x10d')],_0x4ee4('0x10b'))));_0x130108[_0x4ee4('0x6')](_0x4ee4('0x10e'),express['static'](path[_0x4ee4('0x10c')](config[_0x4ee4('0x10d')],_0x4ee4('0x10e'))));_0x130108['use'](_0x4ee4('0x10f'),express['static'](path[_0x4ee4('0x10c')](config[_0x4ee4('0x10d')],_0x4ee4('0x110'),_0x4ee4('0x111'))));_0x130108[_0x4ee4('0x6')]('/plugins',express['static'](path[_0x4ee4('0x10c')](config[_0x4ee4('0x10d')],_0x4ee4('0x112'))));_0x130108['route'](_0x4ee4('0x113'))[_0x4ee4('0x114')](errors[0x194]);_0x130108[_0x4ee4('0x115')]('/*')[_0x4ee4('0x114')](function(_0x21f0e0,_0x1f52df){_0x1f52df['sendFile'](path[_0x4ee4('0x116')](_0x130108[_0x4ee4('0x114')](_0x4ee4('0x117'))+'/index.html'));});};var sensitiveFields=[_0x4ee4('0x118'),_0x4ee4('0x119'),_0x4ee4('0x11a'),_0x4ee4('0x11b'),_0x4ee4('0x11c'),_0x4ee4('0x11d'),_0x4ee4('0x11e'),_0x4ee4('0x11f'),'mobile','fax',_0x4ee4('0x120'),_0x4ee4('0x121'),_0x4ee4('0x122'),'securityToken',_0x4ee4('0x123'),_0x4ee4('0x124'),_0x4ee4('0x125'),_0x4ee4('0x126'),'channelSecret',_0x4ee4('0x127'),'accessTokenSecret',_0x4ee4('0x128'),_0x4ee4('0x129'),_0x4ee4('0x12a'),'membername',_0x4ee4('0x12b'),'calleridnum',_0x4ee4('0x12c'),_0x4ee4('0x12d'),'clientEmail','privateKey',_0x4ee4('0x12e'),_0x4ee4('0x12f'),'key','user','pass','accountSid','localstationid',_0x4ee4('0x130'),_0x4ee4('0x131'),_0x4ee4('0x132'),_0x4ee4('0x133')];function maskSensitiveData(_0x241080){var _0x245992=/(?!^)[\s\S](?!$)/g;if(!_[_0x4ee4('0x134')](_0x241080))return;for(var _0xe6c19c in _0x241080){if(_[_0x4ee4('0x135')](_0x241080[_0xe6c19c])){for(var _0x149acd=0x0;_0x149acd<_0x241080[_0xe6c19c]['length'];_0x149acd++){maskSensitiveData(_0x241080[_0xe6c19c][_0x149acd]);}}else if(_[_0x4ee4('0x134')](_0x241080[_0xe6c19c])){maskSensitiveData(_0x241080[_0xe6c19c]);}else if(_[_0x4ee4('0x136')](_0x241080[_0xe6c19c])){_0x241080[_0xe6c19c]=_0x241080[_0xe6c19c][_0x4ee4('0x137')](/{{{/g,'@@{')[_0x4ee4('0x137')](/}}}/g,'}@@')[_0x4ee4('0x137')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x4ee4('0x138')](sensitiveFields,_0xe6c19c)){_0x241080[_0xe6c19c]=_0x241080[_0xe6c19c][_0x4ee4('0x137')](_0x245992,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0e7d69c..9b420f5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefca=['../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','RPC\x20listening\x20on\x20','bluebird','lodash','listen','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/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/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc'];(function(_0x74f73,_0x2acc98){var _0x3827c2=function(_0x22acbf){while(--_0x22acbf){_0x74f73['push'](_0x74f73['shift']());}};_0x3827c2(++_0x2acc98);}(_0xefca,0xea));var _0xaefc=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xefca[_0x5d9867];return _0x7d2118;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xaefc('0x0'));var _=require(_0xaefc('0x1'));var config=require('../config/environment');exports[_0xaefc('0x2')]=function(){return new BPromise(function(_0x220208,_0x4b3383){var _0x2db58a={};_0x2db58a=_['merge'](_0x2db58a,require('../api/user/user.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x3')));_0x2db58a=_['merge'](_0x2db58a,require('../api/voiceQueue/voiceQueue.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x5')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x6')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x7')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x8')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x9')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0xa')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/mailServerIn/mailServerIn.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0xb')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0xc')));_0x2db58a=_['merge'](_0x2db58a,require('../api/mailInteraction/mailInteraction.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0xd')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0xe')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0xf')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x10')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x11')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x12')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x13')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x14')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x15')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x16')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x17')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x18')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x19')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x1a')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x1b')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x1c')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x1d')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/chatInteraction/chatInteraction.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x1e')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/chatQueue/chatQueue.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x1f')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x20')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x21')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x22')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x23')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x24')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x25')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/pause/pause.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x26')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x27')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/trigger/trigger.rpc'));_0x2db58a=_['merge'](_0x2db58a,require('../api/variable/variable.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x28')));_0x2db58a=_['merge'](_0x2db58a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x29')));_0x2db58a=_['merge'](_0x2db58a,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x2a')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x2b')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x2c')));_0x2db58a=_['merge'](_0x2db58a,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x2d')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x2e')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x2f')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x30')));_0x2db58a=_['merge'](_0x2db58a,require('../api/squareReport/squareReport.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x31')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x32')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x33')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/squareProject/squareProject.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/squareRecording/squareRecording.rpc'));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x34')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x35')));_0x2db58a=_['merge'](_0x2db58a,require('../api/attachment/attachment.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x36')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x37')));_0x2db58a=_[_0xaefc('0x4')](_0x2db58a,require(_0xaefc('0x38')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x39')));_0x2db58a=_['merge'](_0x2db58a,require(_0xaefc('0x3a')));var _0x399ce1=jayson[_0xaefc('0x3b')](_0x2db58a)[_0xaefc('0x3c')]();var _0x35cf50=config[_0xaefc('0x3d')][_0xaefc('0x3e')]||config[_0xaefc('0x3e')]+0x1;var _0x5413c7=config[_0xaefc('0x3d')]['ip']||_0xaefc('0x3f');_0x399ce1['on'](_0xaefc('0x40'),function(_0x2be36b){return _0x4b3383(_0x2be36b);});_0x399ce1[_0xaefc('0x2')](_0x35cf50,_0x5413c7,function(){console[_0xaefc('0x41')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5413c7,_0x35cf50);require('../config/triggers')['default']();return _0x220208(_0xaefc('0x42')+_0x5413c7+':'+_0x35cf50);});});}; \ No newline at end of file +var _0x1df5=['../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/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/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc'];(function(_0x66f806,_0x608611){var _0x371018=function(_0xe57bb){while(--_0xe57bb){_0x66f806['push'](_0x66f806['shift']());}};_0x371018(++_0x608611);}(_0x1df5,0x100));var _0x51df=function(_0x43b73b,_0x57e8ec){_0x43b73b=_0x43b73b-0x0;var _0x5b18c6=_0x1df5[_0x43b73b];return _0x5b18c6;};'use strict';var jayson=require(_0x51df('0x0'));var BPromise=require(_0x51df('0x1'));var _=require(_0x51df('0x2'));var config=require(_0x51df('0x3'));exports['listen']=function(){return new BPromise(function(_0xdabd7,_0x1433ae){var _0x133b21={};_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/user/user.rpc'));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x5')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x6')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x7')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x8')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x9')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xa')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xb')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xc')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xd')));_0x133b21=_['merge'](_0x133b21,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/mailServerIn/mailServerIn.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xe')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0xf')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x10')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x11')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/mailApplication/mailApplication.rpc'));_0x133b21=_['merge'](_0x133b21,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x12')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x13')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x14')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x15')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x16')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x17')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/smsAccount/smsAccount.rpc'));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x18')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x19')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x1a')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x1b')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x1c')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x1d')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x1e')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x1f')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x20')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x21')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x22')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x23')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x24')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x25')));_0x133b21=_['merge'](_0x133b21,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x26')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x27')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x28')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x29')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x2a')));_0x133b21=_['merge'](_0x133b21,require('../api/template/template.rpc'));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x2b')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x2c')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x2d')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x2e')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x2f')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x30')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x31')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x32')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x33')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x34')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x35')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x36')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x37')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x38')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x39')));_0x133b21=_['merge'](_0x133b21,require(_0x51df('0x3a')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x3b')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/squareRecording/squareRecording.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x3c')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x3d')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x3e')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x3f')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x40')));_0x133b21=_[_0x51df('0x4')](_0x133b21,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x41')));_0x133b21=_['merge'](_0x133b21,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x133b21=_[_0x51df('0x4')](_0x133b21,require(_0x51df('0x42')));var _0x2862de=jayson['server'](_0x133b21)['http']();var _0x59008e=config[_0x51df('0x43')][_0x51df('0x44')]||config[_0x51df('0x44')]+0x1;var _0x396ff7=config[_0x51df('0x43')]['ip']||'localhost';_0x2862de['on'](_0x51df('0x45'),function(_0xc509c5){return _0x1433ae(_0xc509c5);});_0x2862de[_0x51df('0x46')](_0x59008e,_0x396ff7,function(){console[_0x51df('0x47')](_0x51df('0x48'),_0x396ff7,_0x59008e);require(_0x51df('0x49'))[_0x51df('0x4a')]();return _0xdabd7(_0x51df('0x4b')+_0x396ff7+':'+_0x59008e);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 4387c97..f301adc 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x371a7a,_0x407ca5){var _0x588cf6=function(_0x5cddce){while(--_0x5cddce){_0x371a7a['push'](_0x371a7a['shift']());}};_0x588cf6(++_0x407ca5);}(_0xef0f,0x168));var _0xfef0=function(_0x1ffc38,_0x2b250e){_0x1ffc38=_0x1ffc38-0x0;var _0x2faff2=_0xef0f[_0x1ffc38];return _0x2faff2;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate; \ No newline at end of file +var _0x9c00=['isPlainObject','exports','safeTemplate','lodash','replace','isArray','map'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x9c00,0x1a0));var _0x09c0=function(_0x137ef8,_0x3384dc){_0x137ef8=_0x137ef8-0x0;var _0x3b7d28=_0x9c00[_0x137ef8];return _0x3b7d28;};var _=require(_0x09c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x170d8b){return _0x170d8b==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xe0d293){var _0x8c9907=_0xe0d293;if(typeof _0xe0d293==='string'){_0x8c9907=_0xe0d293[_0x09c0('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x09c0('0x2')](_0xe0d293)){_0x8c9907=_0xe0d293[_0x09c0('0x3')](function(_0x2fd03e){return safeTemplate(_0x2fd03e);});}else if(_[_0x09c0('0x4')](_0xe0d293)){_0x8c9907=Object['keys'](_0xe0d293)['reduce'](function(_0x1f3d7e,_0x17d11f){_0x1f3d7e[_0x17d11f]=safeTemplate(_0xe0d293[_0x17d11f]);return _0x1f3d7e;},{});}return _0x8c9907;}module[_0x09c0('0x5')][_0x09c0('0x6')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 435e32f..61f41f5 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 _0x2c6e=['SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','sync','answer','sendRequest','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber'];(function(_0x51cf58,_0x75e514){var _0x40c439=function(_0x1aff7f){while(--_0x1aff7f){_0x51cf58['push'](_0x51cf58['shift']());}};_0x40c439(++_0x75e514);}(_0x2c6e,0x161));var _0xe2c6=function(_0x12b213,_0x13168a){_0x12b213=_0x12b213-0x0;var _0x163c01=_0x2c6e[_0x12b213];return _0x163c01;};'use strict';var util=require(_0xe2c6('0x0'));var _=require(_0xe2c6('0x1'));var EventEmitter=require(_0xe2c6('0x2'))[_0xe2c6('0x3')];var AGIReply=require(_0xe2c6('0x4'));var AGIError=require(_0xe2c6('0x5'));function AGIChannel(_0x4ee5bf){var _0x593301=this,_0x35c893=new AGIReply(),_0x444699=![],_0x11c49c={};EventEmitter[_0xe2c6('0x6')](_0x593301);_0x4ee5bf['setEncoding'](_0xe2c6('0x7'));_0x4ee5bf[_0xe2c6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x35c893[_0xe2c6('0x9')](_0xe2c6('0x7'));_0x35c893['on'](_0xe2c6('0xa'),function(_0x50bb00){for(var _0x419163 in _0x50bb00){_0x593301[_0x419163]=_0x50bb00[_0x419163];}_0x593301[_0xe2c6('0xb')]('ready');});_0x35c893['on'](_0xe2c6('0xc'),function(_0x3eef40){if(_0x3eef40[_0xe2c6('0xd')]()=='hangup'){_0x593301[_0xe2c6('0xb')](_0xe2c6('0xe'));return;}if(_0x3eef40[_0xe2c6('0xf')](0x0,0xb)==_0xe2c6('0x10')){_0x444699=!![];}if(_0x444699){_0x11c49c['rx']+=_0x3eef40+'\x0a';if(_0x3eef40[_0xe2c6('0x11')](_0xe2c6('0x12'))!=-0x1){_0x444699=![];}}else{_0x11c49c['rx']=_0x3eef40;}if(_0x444699){return;}if(typeof _0x11c49c['cb']==_0xe2c6('0x13')){var _0x86fe30=_0x11c49c['rx'][_0xe2c6('0xf')](0x0,0x3),_0x18dc3f=null,_0x3afcb4=null;_0x86fe30=parseInt(_0x86fe30);if(isNaN(_0x86fe30)){_0x11c49c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe2c6('0x14')});return;}if(_0x86fe30!=0xc8){_0x11c49c['cb'](null,{'code':_0x86fe30,'result':-0x1,'extra':'KO'});return;}_0x18dc3f=_0x11c49c['rx'][_0xe2c6('0xf')](0x4)[_0xe2c6('0x15')](_0xe2c6('0x16'),'');if(_0x18dc3f[_0xe2c6('0x17')]('\x20')!=-0x1){_0x18dc3f=_0x18dc3f[_0xe2c6('0x18')](0x0,_0x18dc3f[_0xe2c6('0x17')]('\x20'));}if(_[_0xe2c6('0x19')](_0x18dc3f,'-1')){_0x18dc3f=parseInt(_0x18dc3f);}_0x3afcb4=_0x11c49c['rx'][_0xe2c6('0x1a')]('\x20');if(_0x3afcb4[_0xe2c6('0x1b')]==0x3){_0x3afcb4=_0x3afcb4[0x2]['substring'](0x1,_0x3afcb4[0x2][_0xe2c6('0x1b')]-0x1);}else if(_0x3afcb4['length']>0x3){var _0x38611c=/\((.+)\)/;var _0x456bff=_0x11c49c['rx']['match'](_0x38611c);if(_0x456bff){_0x3afcb4=_0x456bff[0x1];}else{_0x3afcb4=null;}}else{_0x3afcb4=null;}_0x11c49c['cb'](null,{'code':_0x86fe30,'result':_0x18dc3f,'extra':_0x3afcb4});}});_0x4ee5bf['on'](_0xe2c6('0x1c'),function(_0x2d60d6){_0x593301['emit'](_0xe2c6('0x1c'),new AGIError(_0xe2c6('0x1d'),_0x2d60d6[_0xe2c6('0x1e')]));});_0x4ee5bf['on'](_0xe2c6('0x1f'),function(){_0x593301[_0xe2c6('0xb')](_0xe2c6('0x1f'),new AGIError(_0xe2c6('0x20')));});_0x4ee5bf['on'](_0xe2c6('0x21'),function(){_0x593301['emit'](_0xe2c6('0x21'),new AGIError(_0xe2c6('0x22')));_0x4ee5bf['destroy']();});_0x4ee5bf['pipe'](_0x35c893);this[_0xe2c6('0x23')]=function(_0x38b9cc,_0x385de6){var _0x38b9cc=_0x38b9cc||'',_0x385de6=typeof _0x385de6=='function'?_0x385de6:new Function();_0x11c49c={'tx':_0x38b9cc,'rx':'','cb':_0x385de6};_0x4ee5bf[_0xe2c6('0x24')](_0x38b9cc+'\x0a');},this[_0xe2c6('0x1f')]=function(){_0x4ee5bf[_0xe2c6('0x25')]();};}util[_0xe2c6('0x26')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x407399){return this[_0xe2c6('0x23')][_0xe2c6('0x27')](this,_0x407399);};AGIChannel['prototype'][_0xe2c6('0x28')]=function(){return this[_0xe2c6('0x29')]('ANSWER');};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x2b')]=function(_0x1fce20,_0x534836,_0x11c687){_0x1fce20=_0x1fce20===undefined?_0xe2c6('0x2c'):_0x1fce20;_0x534836=_0x534836===undefined?'5':_0x534836;_0x11c687=_0x11c687===undefined?'1':_0x11c687;return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x2e'),_0x1fce20,_0x534836*0x3e8,_0x11c687));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x2f')]=function(_0x573141){_0x573141=_0x573141||'NO\x20MESSAGE';return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')]('VERBOSE\x20\x22%s\x22',_0x573141));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x30')]=function(_0x5d501b,_0x40dfb4){if(_[_0xe2c6('0x31')](_0x40dfb4)){return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x32'),_0x5d501b,_0x40dfb4[_0xe2c6('0x33')](',')));}return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x32'),_0x5d501b,_0x40dfb4));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x34')]=function(_0x2df209){return this[_0xe2c6('0x29')](util['format'](_0xe2c6('0x35'),_0x2df209));};AGIChannel[_0xe2c6('0x2a')]['setExtension']=function(_0x24c1e1){return this['sendRequest'](util['format'](_0xe2c6('0x36'),_0x24c1e1));};AGIChannel[_0xe2c6('0x2a')]['setPriority']=function(_0x128d0f){return this[_0xe2c6('0x29')](util['format'](_0xe2c6('0x37'),_0x128d0f));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0xe')]=function(){return this[_0xe2c6('0x29')](_0xe2c6('0x38'));};AGIChannel['prototype'][_0xe2c6('0x39')]=function(_0x14657e,_0x54375c){var _0x5ba49f=_['isBoolean'](_0x54375c)||_[_0xe2c6('0x3a')](_0x54375c)?_0x54375c['toString']():_0x54375c;return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x3b'),_0x14657e,_0x5ba49f?_0x5ba49f[_0xe2c6('0x3c')]()[_0xe2c6('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x3d')]=function(_0x1036ab,_0x149837){return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x3e'),_0x1036ab,_0x149837));};AGIChannel['prototype'][_0xe2c6('0x3f')]=function(_0x3739b8,_0x5077e2){return this['sendRequest'](util[_0xe2c6('0x2d')](_0xe2c6('0x40'),_0x3739b8,_0x5077e2));};AGIChannel['prototype'][_0xe2c6('0x41')]=function(_0x7336da,_0x3205ee){return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x42'),_0x7336da,_0x3205ee));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x43')]=function(_0x4c5985,_0x370c6e,_0x142880){_0x370c6e=_0x370c6e||this[_0xe2c6('0x44')];_0x142880=_0x142880||0x1;this['setContext'](_0x4c5985);this['setExtension'](_0x370c6e);this[_0xe2c6('0x45')](_0x142880);return this[_0xe2c6('0x2f')](util[_0xe2c6('0x2d')](_0xe2c6('0x46'),_0x4c5985,_0x370c6e,_0x142880));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x47')]=function(_0x26b75e){return this[_0xe2c6('0x29')](util[_0xe2c6('0x2d')](_0xe2c6('0x48'),_0x26b75e));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x49')]=function(_0x6d4c92,_0x3febc3,_0x4237a3,_0x56be25,_0x32aa09,_0x4f7506){_0x3febc3=_0x3febc3||'wav';_0x4237a3=_0x4237a3||'';_0x56be25=_0x56be25===undefined?-0x1:_0x56be25==='-1'?-0x1:_0x56be25*0x3e8;_0x32aa09=_0x32aa09===undefined?'':'s='+_0x32aa09;_0x4f7506=_0x4f7506?'BEEP':'';return this['sendRequest'](util[_0xe2c6('0x2d')](_0xe2c6('0x4a'),_0x6d4c92,_0x3febc3,_0x4237a3,_0x56be25,_0x4f7506,_0x32aa09));};AGIChannel['prototype'][_0xe2c6('0x4b')]=function(_0x12bbfc,_0x29bf06){_0x29bf06=_0x29bf06||'';return this['sendRequest'](util[_0xe2c6('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x12bbfc,_0x29bf06));};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x4c')]=function(_0x349b74){return this[_0xe2c6('0x30')](_0xe2c6('0x4d'),_0x349b74);};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x4e')]=function(_0x339f01){return this[_0xe2c6('0x30')](_0xe2c6('0x4f'),_0x339f01);};AGIChannel[_0xe2c6('0x2a')][_0xe2c6('0x1c')]=function(_0x316d5f,_0xf86c19){this[_0xe2c6('0x2f')](util['format'](_0xe2c6('0x50'),_0x316d5f['id'],_0x316d5f[_0xe2c6('0x51')],_0xf86c19));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe2c6('0x52')]=AGIChannel; \ No newline at end of file +var _0x3b47=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','exports','util','lodash','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','pipe','command','function','write','inherits','prototype','answer','sendRequest','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile'];(function(_0x718795,_0x1901b3){var _0x2daf0c=function(_0x86a58b){while(--_0x86a58b){_0x718795['push'](_0x718795['shift']());}};_0x2daf0c(++_0x1901b3);}(_0x3b47,0x1ce));var _0x73b4=function(_0x28be99,_0x1f5bcf){_0x28be99=_0x28be99-0x0;var _0x38785a=_0x3b47[_0x28be99];return _0x38785a;};'use strict';var util=require(_0x73b4('0x0'));var _=require(_0x73b4('0x1'));var EventEmitter=require('events')[_0x73b4('0x2')];var AGIReply=require(_0x73b4('0x3'));var AGIError=require(_0x73b4('0x4'));function AGIChannel(_0x104a6f){var _0x49611a=this,_0x194ed3=new AGIReply(),_0x567dc3=![],_0x39e0b7={};EventEmitter['call'](_0x49611a);_0x104a6f[_0x73b4('0x5')](_0x73b4('0x6'));_0x104a6f[_0x73b4('0x7')](0x8*0x3c*0x3c*0x3e8);_0x194ed3['setEncoding'](_0x73b4('0x6'));_0x194ed3['on'](_0x73b4('0x8'),function(_0x612f08){for(var _0x184ab6 in _0x612f08){_0x49611a[_0x184ab6]=_0x612f08[_0x184ab6];}_0x49611a['emit'](_0x73b4('0x9'));});_0x194ed3['on'](_0x73b4('0xa'),function(_0x42547f){if(_0x42547f[_0x73b4('0xb')]()==_0x73b4('0xc')){_0x49611a[_0x73b4('0xd')](_0x73b4('0xc'));return;}if(_0x42547f[_0x73b4('0xe')](0x0,0xb)==_0x73b4('0xf')){_0x567dc3=!![];}if(_0x567dc3){_0x39e0b7['rx']+=_0x42547f+'\x0a';if(_0x42547f[_0x73b4('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x567dc3=![];}}else{_0x39e0b7['rx']=_0x42547f;}if(_0x567dc3){return;}if(typeof _0x39e0b7['cb']=='function'){var _0x20156a=_0x39e0b7['rx'][_0x73b4('0xe')](0x0,0x3),_0x62355b=null,_0x56fb11=null;_0x20156a=parseInt(_0x20156a);if(isNaN(_0x20156a)){_0x39e0b7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x73b4('0x11')});return;}if(_0x20156a!=0xc8){_0x39e0b7['cb'](null,{'code':_0x20156a,'result':-0x1,'extra':'KO'});return;}_0x62355b=_0x39e0b7['rx']['substring'](0x4)[_0x73b4('0x12')](_0x73b4('0x13'),'');if(_0x62355b[_0x73b4('0x14')]('\x20')!=-0x1){_0x62355b=_0x62355b['substr'](0x0,_0x62355b[_0x73b4('0x14')]('\x20'));}if(_[_0x73b4('0x15')](_0x62355b,'-1')){_0x62355b=parseInt(_0x62355b);}_0x56fb11=_0x39e0b7['rx'][_0x73b4('0x16')]('\x20');if(_0x56fb11[_0x73b4('0x17')]==0x3){_0x56fb11=_0x56fb11[0x2][_0x73b4('0xe')](0x1,_0x56fb11[0x2]['length']-0x1);}else if(_0x56fb11['length']>0x3){var _0x54af97=/\((.+)\)/;var _0x37af49=_0x39e0b7['rx'][_0x73b4('0x18')](_0x54af97);if(_0x37af49){_0x56fb11=_0x37af49[0x1];}else{_0x56fb11=null;}}else{_0x56fb11=null;}_0x39e0b7['cb'](null,{'code':_0x20156a,'result':_0x62355b,'extra':_0x56fb11});}});_0x104a6f['on'](_0x73b4('0x19'),function(_0x458abd){_0x49611a[_0x73b4('0xd')](_0x73b4('0x19'),new AGIError(_0x73b4('0x1a'),_0x458abd['code']));});_0x104a6f['on'](_0x73b4('0x1b'),function(){_0x49611a['emit'](_0x73b4('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x104a6f['on'](_0x73b4('0x1c'),function(){_0x49611a[_0x73b4('0xd')](_0x73b4('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x104a6f['destroy']();});_0x104a6f[_0x73b4('0x1d')](_0x194ed3);this[_0x73b4('0x1e')]=function(_0x427120,_0x1fb6aa){var _0x427120=_0x427120||'',_0x1fb6aa=typeof _0x1fb6aa==_0x73b4('0x1f')?_0x1fb6aa:new Function();_0x39e0b7={'tx':_0x427120,'rx':'','cb':_0x1fb6aa};_0x104a6f[_0x73b4('0x20')](_0x427120+'\x0a');},this[_0x73b4('0x1b')]=function(){_0x104a6f['destroy']();};}util[_0x73b4('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x73b4('0x22')]['sendRequest']=function(_0x2c9b87){return this[_0x73b4('0x1e')]['sync'](this,_0x2c9b87);};AGIChannel['prototype'][_0x73b4('0x23')]=function(){return this[_0x73b4('0x24')](_0x73b4('0x25'));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x26')]=function(_0x3baea8,_0xcfc6cb,_0x344ed2){_0x3baea8=_0x3baea8===undefined?_0x73b4('0x27'):_0x3baea8;_0xcfc6cb=_0xcfc6cb===undefined?'5':_0xcfc6cb;_0x344ed2=_0x344ed2===undefined?'1':_0x344ed2;return this[_0x73b4('0x24')](util[_0x73b4('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3baea8,_0xcfc6cb*0x3e8,_0x344ed2));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x29')]=function(_0x2578fc){_0x2578fc=_0x2578fc||_0x73b4('0x2a');return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x2b'),_0x2578fc));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x2c')]=function(_0x12fe49,_0x2bf024){if(_[_0x73b4('0x2d')](_0x2bf024)){return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x2e'),_0x12fe49,_0x2bf024[_0x73b4('0x2f')](',')));}return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x2e'),_0x12fe49,_0x2bf024));};AGIChannel['prototype'][_0x73b4('0x30')]=function(_0x5ee0c6){return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x31'),_0x5ee0c6));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x32')]=function(_0xb90d4e){return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x33'),_0xb90d4e));};AGIChannel[_0x73b4('0x22')]['setPriority']=function(_0x2bfa6a){return this[_0x73b4('0x24')](util[_0x73b4('0x28')]('SET\x20PRIORITY\x20%s',_0x2bfa6a));};AGIChannel['prototype']['hangup']=function(){return this[_0x73b4('0x24')](_0x73b4('0x34'));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x35')]=function(_0x4e8020,_0x393132){var _0x3b6a47=_[_0x73b4('0x36')](_0x393132)||_[_0x73b4('0x37')](_0x393132)?_0x393132['toString']():_0x393132;return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x38'),_0x4e8020,_0x3b6a47?_0x3b6a47[_0x73b4('0x39')]()[_0x73b4('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x3a')]=function(_0x1968dc,_0x68479b){return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x3b'),_0x1968dc,_0x68479b));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x3c')]=function(_0xdcf95c,_0x138a85){return this['sendRequest'](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0xdcf95c,_0x138a85));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x3d')]=function(_0x472a09,_0x26501f){return this[_0x73b4('0x24')](util[_0x73b4('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x472a09,_0x26501f));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x3e')]=function(_0x44d534,_0x369d16,_0x5b2cff){_0x369d16=_0x369d16||this['extension'];_0x5b2cff=_0x5b2cff||0x1;this['setContext'](_0x44d534);this[_0x73b4('0x32')](_0x369d16);this[_0x73b4('0x3f')](_0x5b2cff);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0x44d534,_0x369d16,_0x5b2cff));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x40')]=function(_0xdcc19d){return this[_0x73b4('0x24')](util[_0x73b4('0x28')](_0x73b4('0x41'),_0xdcc19d));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x42')]=function(_0x1ffb01,_0x2ddd2a,_0x45c0fb,_0x53095b,_0x31e383,_0x53f4fe){_0x2ddd2a=_0x2ddd2a||'wav';_0x45c0fb=_0x45c0fb||'';_0x53095b=_0x53095b===undefined?-0x1:_0x53095b==='-1'?-0x1:_0x53095b*0x3e8;_0x31e383=_0x31e383===undefined?'':'s='+_0x31e383;_0x53f4fe=_0x53f4fe?_0x73b4('0x43'):'';return this[_0x73b4('0x24')](util['format'](_0x73b4('0x44'),_0x1ffb01,_0x2ddd2a,_0x45c0fb,_0x53095b,_0x53f4fe,_0x31e383));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x45')]=function(_0x374da5,_0x1eabf9){_0x1eabf9=_0x1eabf9||'';return this[_0x73b4('0x24')](util['format'](_0x73b4('0x46'),_0x374da5,_0x1eabf9));};AGIChannel[_0x73b4('0x22')][_0x73b4('0x47')]=function(_0x310680){return this[_0x73b4('0x2c')](_0x73b4('0x48'),_0x310680);};AGIChannel[_0x73b4('0x22')][_0x73b4('0x49')]=function(_0x5130d5){return this[_0x73b4('0x2c')](_0x73b4('0x4a'),_0x5130d5);};AGIChannel[_0x73b4('0x22')][_0x73b4('0x19')]=function(_0x7253d7,_0x538060){this[_0x73b4('0x29')](util[_0x73b4('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x7253d7['id'],_0x7253d7['label'],_0x538060));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x73b4('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index c5c5117..1dd734f 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 _0xe0ca=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0xe0ca,0x177));var _0xae0c=function(_0x2c0cd0,_0x4d669e){_0x2c0cd0=_0x2c0cd0-0x0;var _0x30f63c=_0xe0ca[_0x2c0cd0];return _0x30f63c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xae0c('0x0'),'E_AGI_SERVER_ERROR':_0xae0c('0x1'),'E_AGI_SERVER_CLOSE':_0xae0c('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xae0c('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xae0c('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xae0c('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xae0c('0x6'),'E_AGI_IVR_ENTRY':_0xae0c('0x7')};function AGIError(_0x2c8875){var _0x2c8875=_0x2c8875||null,_0x352cc3=_0x352cc3||[],_0x3af624=0x1,_0x45c4b8='';if(!error[_0x2c8875]){_0x2c8875=_0xae0c('0x8');}_0x352cc3['push'](error[_0x2c8875]);while(arguments[_0x3af624]){_0x352cc3[_0xae0c('0x9')](arguments[_0x3af624]);_0x3af624++;}_0x45c4b8=util[_0xae0c('0xa')][_0xae0c('0xb')](util,_0x352cc3);this['message']=_0x45c4b8;this[_0xae0c('0xc')]=_0x2c8875;}module['exports']=AGIError; \ No newline at end of file +var _0xdedb=['message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x361109,_0x31b686){var _0x42d7a4=function(_0x5c5c2c){while(--_0x5c5c2c){_0x361109['push'](_0x361109['shift']());}};_0x42d7a4(++_0x31b686);}(_0xdedb,0xd3));var _0xbded=function(_0x44bf93,_0x3f724a){_0x44bf93=_0x44bf93-0x0;var _0x488703=_0xdedb[_0x44bf93];return _0x488703;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xbded('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xbded('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xbded('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xbded('0x3'),'E_AGI_SOCKET_ERROR':_0xbded('0x4'),'E_AGI_SOCKET_CLOSE':_0xbded('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xbded('0x6'),'E_AGI_COMMAND_EMPTY':_0xbded('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xbded('0x8'),'E_AGI_IVR_ENTRY':_0xbded('0x9')};function AGIError(_0x2cd02e){var _0x2cd02e=_0x2cd02e||null,_0x4fd54f=_0x4fd54f||[],_0x5babfd=0x1,_0x619347='';if(!error[_0x2cd02e]){_0x2cd02e=_0xbded('0xa');}_0x4fd54f['push'](error[_0x2cd02e]);while(arguments[_0x5babfd]){_0x4fd54f[_0xbded('0xb')](arguments[_0x5babfd]);_0x5babfd++;}_0x619347=util['format'][_0xbded('0xc')](util,_0x4fd54f);this[_0xbded('0xd')]=_0x619347;this[_0xbded('0xe')]=_0x2cd02e;}module[_0xbded('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 8bfe549..20059f7 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 _0xc970=['numberOfEdges','prototype','addVertex','push','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','vertices','edges'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc970,0x112));var _0x0c97=function(_0x225d5e,_0x43fc00){_0x225d5e=_0x225d5e-0x0;var _0x99f13a=_0xc970[_0x225d5e];return _0x99f13a;};'use strict';var _=require(_0x0c97('0x0'));var logger=require('../../../config/logger')(_0x0c97('0x1'));var verticesWithRetry=[_0x0c97('0x2'),_0x0c97('0x3'),'getsecretdigits'];var Graph=function(){this[_0x0c97('0x4')]={};this[_0x0c97('0x5')]={};this[_0x0c97('0x6')]=0x0;};Graph[_0x0c97('0x7')][_0x0c97('0x8')]=function(_0x44bec8){this[_0x0c97('0x4')][_0x44bec8['id']]=_0x44bec8;this[_0x0c97('0x5')][_0x44bec8['id']]=[];};Graph[_0x0c97('0x7')]['addEdge']=function(_0x2f3813,_0x2e9af3,_0x54b33e){this[_0x0c97('0x5')][_0x2f3813][_0x0c97('0x9')]({'target':_0x2e9af3,'condition':_0x54b33e});this[_0x0c97('0x6')]+=0x1;};Graph[_0x0c97('0x7')][_0x0c97('0xa')]=function(){return _['size'](this['vertices']);};Graph[_0x0c97('0x7')][_0x0c97('0xb')]=function(){return this['numberOfEdges'];};Graph[_0x0c97('0x7')]['getVertex']=function(_0x311a8d){return this[_0x0c97('0x4')][_0x311a8d];};Graph[_0x0c97('0x7')][_0x0c97('0xc')]=function(_0x275cf3,_0x39c0ee){if(!this[_0x0c97('0x4')][_0x275cf3]){return logger[_0x0c97('0xd')](_0x0c97('0xe'));}var _0x38dd91=_0x39c0ee(this['vertices'][_0x275cf3]);if(!_0x38dd91){return logger['info'](_0x0c97('0xf'));}if(this[_0x0c97('0x5')][_0x275cf3][_0x0c97('0x10')]===0x0){return logger[_0x0c97('0xd')]('no\x20edge/s\x20available');}for(var _0x58a840=0x0,_0x34ee95=[],_0xc947d2=![];_0x58a840\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','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','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','agi','127.0.0.1','nextTick','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','variables','stringify','timeout','hangup','sync','production','start','root','joinAt','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x5ac70f,_0x20e9e2){var _0x1a8d82=function(_0x5a2eb7){while(--_0x5a2eb7){_0x5ac70f['push'](_0x5ac70f['shift']());}};_0x1a8d82(++_0x20e9e2);}(_0xe14a,0x18c));var _0xae14=function(_0x433c58,_0x5246de){_0x433c58=_0x433c58-0x0;var _0x52de51=_0xe14a[_0x433c58];return _0x52de51;};'use strict';var parser=require(_0xae14('0x0'));var _=require('lodash');var syncho=require(_0xae14('0x1'));var util=require(_0xae14('0x2'));var moment=require(_0xae14('0x3'));var config=require(_0xae14('0x4'));var logger=require(_0xae14('0x5'))('agi');var utilLicense=require(_0xae14('0x6'));var rpc=require(_0xae14('0x7'));var mailRpc=require(_0xae14('0x8'));var Graph=require(_0xae14('0x9'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xae14('0xa')],{'ip':_0xae14('0xb'),'port':0x11dd});function connectionHandler(_0x29ad09){process[_0xae14('0xc')](function(){syncho(function(){try{setChannelVariables(_0x29ad09);agiHandler(_0x29ad09);}catch(_0x47ab25){logger[_0xae14('0xd')](_0x47ab25['stack']);}});});}function listeningHandler(){console[_0xae14('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xae14('0xa')][_0xae14('0xf')]);logger[_0xae14('0x10')](util[_0xae14('0x11')](_0xae14('0x12'),config[_0xae14('0xa')]['ip'],config[_0xae14('0xa')][_0xae14('0xf')]));}function errorHandler(_0x34735f){if(_0x34735f&&_0x34735f[_0xae14('0x13')]&&_0x34735f[_0xae14('0x14')]){logger['error'](util[_0xae14('0x11')](_0xae14('0x15'),_0x34735f[_0xae14('0x13')],_0x34735f[_0xae14('0x14')]));}else{logger[_0xae14('0xd')](util['format'](_0xae14('0x16'),_0x34735f[_0xae14('0x17')]));}}function closeHandler(){logger['info'](util[_0xae14('0x11')](_0xae14('0x18'),this[_0xae14('0x19')],this[_0xae14('0x1a')],this[_0xae14('0x1b')],this[_0xae14('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0xc23858){logger[_0xae14('0xd')](_0xc23858[_0xae14('0x17')]);}}function timeoutHandler(){logger[_0xae14('0x10')](util[_0xae14('0x11')](_0xae14('0x1d'),this[_0xae14('0x19')],this[_0xae14('0x1a')],this[_0xae14('0x1b')],this[_0xae14('0x1c')],this[_0xae14('0x1e')]));}function hangupHandler(){logger[_0xae14('0x10')](util[_0xae14('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xae14('0x19')],this[_0xae14('0x1a')],this[_0xae14('0x1b')],this[_0xae14('0x1c')],this[_0xae14('0x1e')]));this[_0xae14('0x1f')]=!![];}function getRoot(_0x1377c1){return parser[_0xae14('0x20')](_0x1377c1,{'object':!![]})[_0xae14('0x21')]['root'];}function addVertex(_0x49f7db,_0x5b31a3,_0x33dc61){_0x5b31a3[_0xae14('0x22')]=_0x33dc61;if(_0x5b31a3[_0xae14('0x23')]('retry')){_0x5b31a3[_0xae14('0x24')]=parseInt(_0x5b31a3[_0xae14('0x25')],0xa);}_0x49f7db[_0xae14('0x26')](_[_0xae14('0x27')](_0x5b31a3,_0xae14('0x28')));}function initGraph(_0x372800,_0xcafe2){var _0x201a85=new Graph();for(var _0x4def55 in _0x372800){if(_0x372800[_0xae14('0x23')](_0x4def55)){if(_[_0xae14('0x29')](_0x372800[_0x4def55])){for(var _0x6a30be=0x0;_0x6a30be<_0x372800[_0x4def55]['length'];_0x6a30be+=0x1){addVertex(_0x201a85,_0x372800[_0x4def55][_0x6a30be],_0x4def55);}}else{addVertex(_0x201a85,_0x372800[_0x4def55],_0x4def55);}}}for(var _0x1cf9ac=0x0;_0x1cf9ac<_0xcafe2[_0xae14('0x2a')];_0x1cf9ac+=0x1){if(_0xcafe2[_0x1cf9ac]['source']&&_0xcafe2[_0x1cf9ac][_0xae14('0x2b')]){_0x201a85[_0xae14('0x2c')](_0xcafe2[_0x1cf9ac][_0xae14('0x2d')],_0xcafe2[_0x1cf9ac][_0xae14('0x2b')],_0xcafe2[_0x1cf9ac][_0xae14('0x2e')]);}}return _0x201a85;}function getSquareProject(_0x2b264e,_0x4e000e){rpc[_0xae14('0x2f')](_0x2b264e)[_0xae14('0x30')](function(_0x39a4c9){_0x4e000e(null,_0x39a4c9);})[_0xae14('0x31')](function(_0x3c19d2){_0x4e000e(null,_0x3c19d2);});}function createSquareReport(_0xcc55fa,_0x4e0093){rpc[_0xae14('0x32')](_0xcc55fa)[_0xae14('0x30')](function(_0x142ec7){if(_0x4e0093){_0x4e0093(null,_0x142ec7);}})[_0xae14('0x31')](function(_0x3f2a40){if(_0x4e0093){_0x4e0093(null,_0x3f2a40);}});}function setChannelVariables(_0x586b0c){for(var _0x19eadd in _0x586b0c){if(_0x586b0c[_0xae14('0x23')](_0x19eadd)){if(_0x19eadd['indexOf'](_0xae14('0x33'))===0x0){_0x586b0c[_0x19eadd[_0xae14('0x34')](0x4)]=_0x586b0c[_0x19eadd];delete _0x586b0c[_0x19eadd];}}}}function getLogFromObject(_0xd802b6){return util[_0xae14('0x35')](_0xd802b6,{'showHidden':![],'depth':null});}function agiHandler(_0x199a5e){var _0xe8f597,_0x500041,_0x18dc67,_0x536a81,_0x4886ba;logger[_0xae14('0x36')](_0xae14('0x37'),JSON[_0xae14('0x38')](_0x199a5e,null,0x2));logger[_0xae14('0x10')](util[_0xae14('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x199a5e[_0xae14('0x19')],_0x199a5e[_0xae14('0x1a')],_0x199a5e[_0xae14('0x1b')],_0x199a5e[_0xae14('0x1c')],_0x199a5e[_0xae14('0x1e')]));_0x199a5e['on'](_0xae14('0xd'),errorHandler);_0x199a5e['on']('close',closeHandler);_0x199a5e['on'](_0xae14('0x39'),timeoutHandler);_0x199a5e['evtHangup']=![];_0x199a5e['on'](_0xae14('0x3a'),hangupHandler);var _0x53ef8c=getSquareProject[_0xae14('0x3b')](null,_0x199a5e[_0xae14('0x19')]);if(_0x53ef8c){if(_0x53ef8c[_0xae14('0x3c')]){_0xe8f597=getRoot(_0x53ef8c[_0xae14('0x3c')]);if(_0xe8f597&&_0xe8f597[_0xae14('0x3d')]){logger['debug'](_0xae14('0x3e'),JSON[_0xae14('0x38')](_0xe8f597,null,0x2));_0x199a5e[_0xae14('0x3f')]=moment()[_0xae14('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x500041=initGraph(_[_0xae14('0x27')](_0xe8f597,'mxCell'),_0xe8f597[_0xae14('0x28')]);_0x18dc67=new Vertices(_0x199a5e,rpc,mailRpc);logger[_0xae14('0x10')](util[_0xae14('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x199a5e[_0xae14('0x19')],_0x199a5e['calleridname'],_0x199a5e['callerid'],_0x199a5e[_0xae14('0x1c')],_0x199a5e['uniqueid']));_0x500041[_0xae14('0x40')](_0xe8f597[_0xae14('0x3d')]['id'],function(_0x4d42cd){try{_0x4d42cd=_0x18dc67[_0xae14('0x41')](_0x4d42cd);logger['debug'](_0xae14('0x42'),JSON[_0xae14('0x38')](_0x4d42cd,null,0x2));if(_0x4d42cd[_0xae14('0x22')]===_0xae14('0x43')){logger['info'](_0xae14('0x44'));_0x199a5e[_0xae14('0x45')]=_0x4d42cd[_0xae14('0x45')]||_0x199a5e[_0xae14('0x45')];_0x199a5e[_0xae14('0x46')]=_0x4d42cd[_0xae14('0x46')];_0x199a5e[_0xae14('0x47')]=_0x4d42cd[_0xae14('0x47')]?_0x4d42cd[_0xae14('0x47')]-0x1:0x1;return null;}else if(_0x4d42cd&&_0x18dc67[_0x4d42cd[_0xae14('0x22')]]){_0x4886ba=_0x18dc67[_0x4d42cd[_0xae14('0x22')]](_0x4d42cd);logger[_0xae14('0x10')](_0xae14('0x48'),JSON[_0xae14('0x38')](_0x4886ba,null,0x2));if(_0x4886ba&&_0x4886ba[_0xae14('0x49')]===AGI_CODE_SUCCESS&&_0x4886ba['result']!==AGI_RESULT_ERROR&&!_0x199a5e[_0xae14('0x1f')]){logger[_0xae14('0x36')](_0xae14('0x48'),getLogFromObject(_0x4886ba));return _[_0xae14('0x4a')](_0x4886ba['result'])?null:_0x4886ba['result'][_0xae14('0x4b')]();}else{logger[_0xae14('0xd')](_0xae14('0x48'),getLogFromObject(_0x4886ba));return null;}}else{logger[_0xae14('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x2e13fe){logger['error'](_0x2e13fe[_0xae14('0x17')]);return null;}});if(_0xe8f597[_0xae14('0x4c')]){logger[_0xae14('0x10')](util[_0xae14('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x199a5e[_0xae14('0x19')],_0x199a5e['calleridname'],_0x199a5e[_0xae14('0x1b')],_0x199a5e[_0xae14('0x1c')],_0x199a5e['uniqueid']));_0x500041[_0xae14('0x40')](_0xe8f597[_0xae14('0x4c')]['id'],function(_0x534f64){try{_0x534f64=_0x18dc67[_0xae14('0x41')](_0x534f64);logger['debug'](_0xae14('0x42'),JSON[_0xae14('0x38')](_0x534f64,null,0x2));if(_0x534f64&&_0x18dc67[_0x534f64[_0xae14('0x22')]]){_0x4886ba=_0x18dc67[_0x534f64[_0xae14('0x22')]](_0x534f64);if(_0x4886ba){logger[_0xae14('0x36')](_0xae14('0x48'),getLogFromObject(_0x4886ba));return _[_0xae14('0x4a')](_0x4886ba[_0xae14('0x4d')])?null:_0x4886ba[_0xae14('0x4d')][_0xae14('0x4b')]();}else{logger[_0xae14('0xd')](_0xae14('0x48'),getLogFromObject(_0x4886ba));return null;}}else{logger['error'](_0xae14('0x4e'));return null;}}catch(_0x2a74cc){logger[_0xae14('0xd')](_0x2a74cc[_0xae14('0x17')]);return null;}});}logger['info'](util['format'](_0xae14('0x4f'),_0x199a5e[_0xae14('0x19')],_0x199a5e[_0xae14('0x1a')],_0x199a5e[_0xae14('0x1b')],_0x199a5e[_0xae14('0x1c')],_0x199a5e['uniqueid']));logger[_0xae14('0x10')](util[_0xae14('0x11')](_0xae14('0x50'),_0x199a5e[_0xae14('0x45')],_0x199a5e[_0xae14('0x46')],parseInt(_0x199a5e[_0xae14('0x47')],0xa)+0x1));_0x199a5e['continueAt'](_0x199a5e[_0xae14('0x45')],_0x199a5e[_0xae14('0x46')],parseInt(_0x199a5e[_0xae14('0x47')],0xa)+0x1);_0x199a5e[_0xae14('0x51')]();}}else{logger[_0xae14('0xd')](util[_0xae14('0x11')](_0xae14('0x52'),_0x199a5e[_0xae14('0x19')]));_0x199a5e[_0xae14('0x53')](_0x199a5e[_0xae14('0x45')],_0x199a5e[_0xae14('0x46')],parseInt(_0x199a5e['priority'],0xa)+0x1);_0x199a5e[_0xae14('0x51')]();}}else{logger[_0xae14('0xd')](util[_0xae14('0x11')](_0xae14('0x54'),_0x199a5e['arg_1']));_0x199a5e[_0xae14('0x53')](_0x199a5e[_0xae14('0x45')],_0x199a5e[_0xae14('0x46')],parseInt(_0x199a5e[_0xae14('0x47')],0xa)+0x1);_0x199a5e['close']();}}function main(){var _0x1fa2e7;return utilLicense[_0xae14('0x55')]()[_0xae14('0x30')](function(_0x61b5ae){if(_0x61b5ae){if(_0x61b5ae['voice']){if(_0x61b5ae['callysquare']&&_0x61b5ae[_0xae14('0x56')]>0x0){logger[_0xae14('0x10')](util[_0xae14('0x11')](_0xae14('0x57'),_0x61b5ae[_0xae14('0x56')]));_0x1fa2e7=_0x61b5ae[_0xae14('0x56')];}else{logger['info'](_0xae14('0x58'));}}else{logger['info'](_0xae14('0x59'));_0x1fa2e7=-0x1;}}})[_0xae14('0x31')](function(_0x190895){logger['error'](_0xae14('0x5a'),_0x190895[_0xae14('0x17')]);})[_0xae14('0x4c')](function(){var _0x1cf475=require(_0xae14('0x5b'))(config[_0xae14('0xa')][_0xae14('0xf')],config[_0xae14('0xa')]['ip'],_0x1fa2e7);_0x1cf475['on'](_0xae14('0xd'),errorHandler);_0x1cf475['on']('listening',listeningHandler);_0x1cf475['on'](_0xae14('0x5c'),connectionHandler);_0x1cf475['on'](_0xae14('0x51'),closeHandler);});}main(); \ No newline at end of file +var _0xc144=['[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','extension','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','moment','../../config/logger','agi','./mailRpc','./graph','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','addEdge','value','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xc144,0x189));var _0x4c14=function(_0x20d664,_0x20efef){_0x20d664=_0x20d664-0x0;var _0x37d4a0=_0xc144[_0x20d664];return _0x37d4a0;};'use strict';var parser=require(_0x4c14('0x0'));var _=require(_0x4c14('0x1'));var syncho=require(_0x4c14('0x2'));var util=require('util');var moment=require(_0x4c14('0x3'));var config=require('../../config/environment');var logger=require(_0x4c14('0x4'))(_0x4c14('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x4c14('0x6'));var Graph=require(_0x4c14('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x4c14('0x5')]=_['defaults'](config['agi'],{'ip':_0x4c14('0x8'),'port':0x11dd});function connectionHandler(_0x38f806){process[_0x4c14('0x9')](function(){syncho(function(){try{setChannelVariables(_0x38f806);agiHandler(_0x38f806);}catch(_0x4e3ffc){logger[_0x4c14('0xa')](_0x4e3ffc[_0x4c14('0xb')]);}});});}function listeningHandler(){console[_0x4c14('0xc')](_0x4c14('0xd'),config[_0x4c14('0x5')][_0x4c14('0xe')]);logger['info'](util[_0x4c14('0xf')](_0x4c14('0x10'),config['agi']['ip'],config[_0x4c14('0x5')][_0x4c14('0xe')]));}function errorHandler(_0x4b5aaf){if(_0x4b5aaf&&_0x4b5aaf[_0x4c14('0x11')]&&_0x4b5aaf[_0x4c14('0x12')]){logger[_0x4c14('0xa')](util[_0x4c14('0xf')](_0x4c14('0x13'),_0x4b5aaf['name'],_0x4b5aaf[_0x4c14('0x12')]));}else{logger['error'](util[_0x4c14('0xf')]('[ERROR]\x20%s',_0x4b5aaf[_0x4c14('0xb')]));}}function closeHandler(){logger[_0x4c14('0x14')](util[_0x4c14('0xf')](_0x4c14('0x15'),this[_0x4c14('0x16')],this['calleridname'],this[_0x4c14('0x17')],this[_0x4c14('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x22ad72){logger[_0x4c14('0xa')](_0x22ad72[_0x4c14('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x4c14('0xf')](_0x4c14('0x19'),this[_0x4c14('0x16')],this[_0x4c14('0x1a')],this[_0x4c14('0x17')],this[_0x4c14('0x18')],this[_0x4c14('0x1b')]));}function hangupHandler(){logger['info'](util['format'](_0x4c14('0x1c'),this[_0x4c14('0x16')],this[_0x4c14('0x1a')],this[_0x4c14('0x17')],this[_0x4c14('0x18')],this['uniqueid']));this[_0x4c14('0x1d')]=!![];}function getRoot(_0x42a88f){return parser[_0x4c14('0x1e')](_0x42a88f,{'object':!![]})[_0x4c14('0x1f')][_0x4c14('0x20')];}function addVertex(_0x1acf95,_0x19d797,_0x4b2ca4){_0x19d797[_0x4c14('0x21')]=_0x4b2ca4;if(_0x19d797[_0x4c14('0x22')](_0x4c14('0x23'))){_0x19d797[_0x4c14('0x24')]=parseInt(_0x19d797['retry'],0xa);}_0x1acf95['addVertex'](_[_0x4c14('0x25')](_0x19d797,_0x4c14('0x26')));}function initGraph(_0x47d95e,_0x2c2751){var _0x21f6c2=new Graph();for(var _0x30105a in _0x47d95e){if(_0x47d95e[_0x4c14('0x22')](_0x30105a)){if(_[_0x4c14('0x27')](_0x47d95e[_0x30105a])){for(var _0x3bed3a=0x0;_0x3bed3a<_0x47d95e[_0x30105a]['length'];_0x3bed3a+=0x1){addVertex(_0x21f6c2,_0x47d95e[_0x30105a][_0x3bed3a],_0x30105a);}}else{addVertex(_0x21f6c2,_0x47d95e[_0x30105a],_0x30105a);}}}for(var _0xb4c125=0x0;_0xb4c125<_0x2c2751[_0x4c14('0x28')];_0xb4c125+=0x1){if(_0x2c2751[_0xb4c125][_0x4c14('0x29')]&&_0x2c2751[_0xb4c125]['target']){_0x21f6c2[_0x4c14('0x2a')](_0x2c2751[_0xb4c125][_0x4c14('0x29')],_0x2c2751[_0xb4c125]['target'],_0x2c2751[_0xb4c125][_0x4c14('0x2b')]);}}return _0x21f6c2;}function getSquareProject(_0x348590,_0xa1b99b){rpc['getSquareProject'](_0x348590)[_0x4c14('0x2c')](function(_0x3c7f4b){_0xa1b99b(null,_0x3c7f4b);})['catch'](function(_0x2f0f99){_0xa1b99b(null,_0x2f0f99);});}function createSquareReport(_0x220089,_0x4a3be9){rpc[_0x4c14('0x2d')](_0x220089)[_0x4c14('0x2c')](function(_0xd3221d){if(_0x4a3be9){_0x4a3be9(null,_0xd3221d);}})[_0x4c14('0x2e')](function(_0x427772){if(_0x4a3be9){_0x4a3be9(null,_0x427772);}});}function setChannelVariables(_0x55ecfd){for(var _0x4a1dc3 in _0x55ecfd){if(_0x55ecfd[_0x4c14('0x22')](_0x4a1dc3)){if(_0x4a1dc3[_0x4c14('0x2f')](_0x4c14('0x30'))===0x0){_0x55ecfd[_0x4a1dc3[_0x4c14('0x31')](0x4)]=_0x55ecfd[_0x4a1dc3];delete _0x55ecfd[_0x4a1dc3];}}}}function getLogFromObject(_0x415f30){return util[_0x4c14('0x32')](_0x415f30,{'showHidden':![],'depth':null});}function agiHandler(_0x165bcc){var _0x4578b3,_0x427f3e,_0x1fe2a4,_0x2cdea0,_0x247b7d;logger[_0x4c14('0x33')](_0x4c14('0x34'),JSON[_0x4c14('0x35')](_0x165bcc,null,0x2));logger[_0x4c14('0x14')](util[_0x4c14('0xf')](_0x4c14('0x36'),_0x165bcc[_0x4c14('0x16')],_0x165bcc[_0x4c14('0x1a')],_0x165bcc[_0x4c14('0x17')],_0x165bcc['dnid'],_0x165bcc[_0x4c14('0x1b')]));_0x165bcc['on'](_0x4c14('0xa'),errorHandler);_0x165bcc['on'](_0x4c14('0x37'),closeHandler);_0x165bcc['on']('timeout',timeoutHandler);_0x165bcc[_0x4c14('0x1d')]=![];_0x165bcc['on'](_0x4c14('0x38'),hangupHandler);var _0x128be3=getSquareProject[_0x4c14('0x39')](null,_0x165bcc[_0x4c14('0x16')]);if(_0x128be3){if(_0x128be3[_0x4c14('0x3a')]){_0x4578b3=getRoot(_0x128be3[_0x4c14('0x3a')]);if(_0x4578b3&&_0x4578b3[_0x4c14('0x3b')]){logger['debug'](_0x4c14('0x20'),JSON[_0x4c14('0x35')](_0x4578b3,null,0x2));_0x165bcc[_0x4c14('0x3c')]=moment()['format'](_0x4c14('0x3d'));_0x427f3e=initGraph(_[_0x4c14('0x25')](_0x4578b3,'mxCell'),_0x4578b3[_0x4c14('0x26')]);_0x1fe2a4=new Vertices(_0x165bcc,rpc,mailRpc);logger[_0x4c14('0x14')](util['format'](_0x4c14('0x3e'),_0x165bcc[_0x4c14('0x16')],_0x165bcc[_0x4c14('0x1a')],_0x165bcc[_0x4c14('0x17')],_0x165bcc[_0x4c14('0x18')],_0x165bcc[_0x4c14('0x1b')]));_0x427f3e[_0x4c14('0x3f')](_0x4578b3['start']['id'],function(_0x12eb7b){try{_0x12eb7b=_0x1fe2a4[_0x4c14('0x40')](_0x12eb7b);logger[_0x4c14('0x33')](_0x4c14('0x41'),JSON[_0x4c14('0x35')](_0x12eb7b,null,0x2));if(_0x12eb7b[_0x4c14('0x21')]===_0x4c14('0x42')){logger[_0x4c14('0x14')](_0x4c14('0x43'));_0x165bcc[_0x4c14('0x44')]=_0x12eb7b[_0x4c14('0x44')]||_0x165bcc['context'];_0x165bcc['extension']=_0x12eb7b['extension'];_0x165bcc[_0x4c14('0x45')]=_0x12eb7b[_0x4c14('0x45')]?_0x12eb7b['priority']-0x1:0x1;return null;}else if(_0x12eb7b&&_0x1fe2a4[_0x12eb7b[_0x4c14('0x21')]]){_0x247b7d=_0x1fe2a4[_0x12eb7b[_0x4c14('0x21')]](_0x12eb7b);logger[_0x4c14('0x14')](_0x4c14('0x46'),JSON[_0x4c14('0x35')](_0x247b7d,null,0x2));if(_0x247b7d&&_0x247b7d[_0x4c14('0x47')]===AGI_CODE_SUCCESS&&_0x247b7d[_0x4c14('0x48')]!==AGI_RESULT_ERROR&&!_0x165bcc['evtHangup']){logger['debug']('response',getLogFromObject(_0x247b7d));return _[_0x4c14('0x49')](_0x247b7d[_0x4c14('0x48')])?null:_0x247b7d[_0x4c14('0x48')]['toString']();}else{logger['error'](_0x4c14('0x46'),getLogFromObject(_0x247b7d));return null;}}else{logger[_0x4c14('0xa')](_0x4c14('0x4a'));return null;}}catch(_0xb1937c){logger[_0x4c14('0xa')](_0xb1937c[_0x4c14('0xb')]);return null;}});if(_0x4578b3[_0x4c14('0x4b')]){logger[_0x4c14('0x14')](util[_0x4c14('0xf')](_0x4c14('0x4c'),_0x165bcc['arg_1'],_0x165bcc[_0x4c14('0x1a')],_0x165bcc[_0x4c14('0x17')],_0x165bcc[_0x4c14('0x18')],_0x165bcc['uniqueid']));_0x427f3e[_0x4c14('0x3f')](_0x4578b3[_0x4c14('0x4b')]['id'],function(_0x3aaf49){try{_0x3aaf49=_0x1fe2a4['clear'](_0x3aaf49);logger[_0x4c14('0x33')](_0x4c14('0x41'),JSON[_0x4c14('0x35')](_0x3aaf49,null,0x2));if(_0x3aaf49&&_0x1fe2a4[_0x3aaf49[_0x4c14('0x21')]]){_0x247b7d=_0x1fe2a4[_0x3aaf49[_0x4c14('0x21')]](_0x3aaf49);if(_0x247b7d){logger['debug'](_0x4c14('0x46'),getLogFromObject(_0x247b7d));return _['isUndefined'](_0x247b7d[_0x4c14('0x48')])?null:_0x247b7d[_0x4c14('0x48')][_0x4c14('0x4d')]();}else{logger[_0x4c14('0xa')](_0x4c14('0x46'),getLogFromObject(_0x247b7d));return null;}}else{logger['error'](_0x4c14('0x4a'));return null;}}catch(_0x5065e5){logger[_0x4c14('0xa')](_0x5065e5[_0x4c14('0xb')]);return null;}});}logger['info'](util[_0x4c14('0xf')](_0x4c14('0x4e'),_0x165bcc['arg_1'],_0x165bcc[_0x4c14('0x1a')],_0x165bcc[_0x4c14('0x17')],_0x165bcc['dnid'],_0x165bcc['uniqueid']));logger['info'](util[_0x4c14('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x165bcc[_0x4c14('0x44')],_0x165bcc[_0x4c14('0x4f')],parseInt(_0x165bcc['priority'],0xa)+0x1));_0x165bcc['continueAt'](_0x165bcc['context'],_0x165bcc[_0x4c14('0x4f')],parseInt(_0x165bcc[_0x4c14('0x45')],0xa)+0x1);_0x165bcc[_0x4c14('0x37')]();}}else{logger['error'](util[_0x4c14('0xf')](_0x4c14('0x50'),_0x165bcc[_0x4c14('0x16')]));_0x165bcc[_0x4c14('0x51')](_0x165bcc[_0x4c14('0x44')],_0x165bcc[_0x4c14('0x4f')],parseInt(_0x165bcc[_0x4c14('0x45')],0xa)+0x1);_0x165bcc['close']();}}else{logger[_0x4c14('0xa')](util['format'](_0x4c14('0x52'),_0x165bcc[_0x4c14('0x16')]));_0x165bcc[_0x4c14('0x51')](_0x165bcc[_0x4c14('0x44')],_0x165bcc[_0x4c14('0x4f')],parseInt(_0x165bcc[_0x4c14('0x45')],0xa)+0x1);_0x165bcc[_0x4c14('0x37')]();}}function main(){var _0x1da040;return utilLicense['getLicense']()[_0x4c14('0x2c')](function(_0x1a5ae1){if(_0x1a5ae1){if(_0x1a5ae1[_0x4c14('0x53')]){if(_0x1a5ae1[_0x4c14('0x54')]&&_0x1a5ae1['callysquare']>0x0){logger[_0x4c14('0x14')](util[_0x4c14('0xf')](_0x4c14('0x55'),_0x1a5ae1[_0x4c14('0x54')]));_0x1da040=_0x1a5ae1[_0x4c14('0x54')];}else{logger[_0x4c14('0x14')](_0x4c14('0x56'));}}else{logger[_0x4c14('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1da040=-0x1;}}})[_0x4c14('0x2e')](function(_0x40e7bf){logger[_0x4c14('0xa')](_0x4c14('0x57'),_0x40e7bf[_0x4c14('0xb')]);})['finally'](function(){var _0x733256=require(_0x4c14('0x58'))(config[_0x4c14('0x5')][_0x4c14('0xe')],config[_0x4c14('0x5')]['ip'],_0x1da040);_0x733256['on']('error',errorHandler);_0x733256['on'](_0x4c14('0x59'),listeningHandler);_0x733256['on'](_0x4c14('0x5a'),connectionHandler);_0x733256['on']('close',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 e66796b..47e6218 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 _0xe15c=['bluebird','client','http','request','error','result','catch','sendMailMessage','SendMail'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xe15c,0x14d));var _0xce15=function(_0x297c74,_0x28a5be){_0x297c74=_0x297c74-0x0;var _0x4d766d=_0xe15c[_0x297c74];return _0x4d766d;};'use strict';var BPromise=require(_0xce15('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xce15('0x1')][_0xce15('0x2')]({'port':0x232b});function request(_0x515e5f,_0x2e5654){return new BPromise(function(_0x49c2c4,_0x33c21e){return client[_0xce15('0x3')](_0x515e5f,_0x2e5654)['then'](function(_0x48efe0){if(_0x48efe0[_0xce15('0x4')]){return _0x33c21e(_0x48efe0[_0xce15('0x4')]['message']);}else{return _0x49c2c4(_0x48efe0[_0xce15('0x5')]);}})[_0xce15('0x6')](function(_0x13e483){return _0x33c21e(_0x13e483);});});}exports[_0xce15('0x7')]=function(_0x959b2c,_0x41714a){return request(_0xce15('0x8'),{'account':_0x959b2c,'message':_0x41714a});}; \ No newline at end of file +var _0xd512=['catch','SendMail','bluebird','client','http','then','error','message','result'];(function(_0x3c5e4a,_0x1d4848){var _0x65f89a=function(_0x53f7c6){while(--_0x53f7c6){_0x3c5e4a['push'](_0x3c5e4a['shift']());}};_0x65f89a(++_0x1d4848);}(_0xd512,0x80));var _0x2d51=function(_0x3d4d91,_0x577d8a){_0x3d4d91=_0x3d4d91-0x0;var _0xa30755=_0xd512[_0x3d4d91];return _0xa30755;};'use strict';var BPromise=require(_0x2d51('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2d51('0x1')][_0x2d51('0x2')]({'port':0x232b});function request(_0x408786,_0x47aec4){return new BPromise(function(_0x1425dd,_0x1bb33b){return client['request'](_0x408786,_0x47aec4)[_0x2d51('0x3')](function(_0x16b3b8){if(_0x16b3b8[_0x2d51('0x4')]){return _0x1bb33b(_0x16b3b8[_0x2d51('0x4')][_0x2d51('0x5')]);}else{return _0x1425dd(_0x16b3b8[_0x2d51('0x6')]);}})[_0x2d51('0x7')](function(_0x1fce61){return _0x1bb33b(_0x1fce61);});});}exports['sendMailMessage']=function(_0x288a6c,_0x2fe991){return request(_0x2d51('0x8'),{'account':_0x288a6c,'message':_0x2fe991});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 389a17b..0975ccd 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 _0x2b2d=['_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','line','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype'];(function(_0x58ad47,_0x548fec){var _0x3dd187=function(_0x14a1d5){while(--_0x14a1d5){_0x58ad47['push'](_0x58ad47['shift']());}};_0x3dd187(++_0x548fec);}(_0x2b2d,0x1ad));var _0xd2b2=function(_0x285d34,_0x42dd2d){_0x285d34=_0x285d34-0x0;var _0x59e21d=_0x2b2d[_0x285d34];return _0x59e21d;};'use strict';var util=require(_0xd2b2('0x0'));var Transform=require(_0xd2b2('0x1'))[_0xd2b2('0x2')];function AGIReply(_0x4dd940){Transform[_0xd2b2('0x3')](this,_0x4dd940);this[_0xd2b2('0x4')]='';this[_0xd2b2('0x5')]=![];}util[_0xd2b2('0x6')](AGIReply,Transform);AGIReply[_0xd2b2('0x7')][_0xd2b2('0x8')]=function(_0x40e522,_0x59fc4b,_0x1fd93e){var _0x5f58e0='\x0a',_0x3ff8ba=['\x0a\x0a',_0xd2b2('0x9')],_0x318976=-0x1,_0x4c00bd=-0x1,_0x3e4e8a='',_0x119378=0x0,_0x3eadbb='',_0x2012f0='';this[_0xd2b2('0x4')]+=_0x40e522[_0xd2b2('0xa')]();_0x3eadbb=this[_0xd2b2('0x4')];if(!this[_0xd2b2('0x5')]){_0x119378=0x0;while(_0x3ff8ba[_0x119378]){while((_0x4c00bd=_0x3eadbb[_0xd2b2('0xb')](_0x3ff8ba[_0x119378]))!=-0x1){_0x3e4e8a=_0x3ff8ba[_0x119378];_0x2012f0=_0x3eadbb['substring'](0x0,_0x4c00bd);_0x3eadbb=_0x3eadbb[_0xd2b2('0xc')](_0x4c00bd+_0x3e4e8a[_0xd2b2('0xd')]);var _0x3abb89=_0x2012f0[_0xd2b2('0xe')](_0x5f58e0),_0xfeb6ff=0x0,_0x2af6fd={},_0x1ddcc8='',_0x4f3bef='',_0x52e0e0=-0x1;while(_0x3abb89[_0xfeb6ff]){_0x52e0e0=_0x3abb89[_0xfeb6ff][_0xd2b2('0xb')](':');if(_0x52e0e0!=-0x1){_0x1ddcc8=_0x3abb89[_0xfeb6ff]['slice'](0x0,_0x52e0e0)['trim']();_0x4f3bef=_0x3abb89[_0xfeb6ff][_0xd2b2('0xf')](_0x52e0e0+0x1)[_0xd2b2('0x10')]();if(_0x1ddcc8[_0xd2b2('0xd')]>0x0){_0x2af6fd[_0x1ddcc8]=_0x4f3bef;}}else{}_0xfeb6ff++;}this['emit'](_0xd2b2('0x11'),_0x2af6fd);this[_0xd2b2('0x5')]=!![];}_0x119378++;}this[_0xd2b2('0x4')]=_0x3eadbb;}else{while((_0x318976=_0x3eadbb[_0xd2b2('0xb')](_0x5f58e0))!=-0x1){_0x2012f0=_0x3eadbb[_0xd2b2('0xc')](0x0,_0x318976);this['emit'](_0xd2b2('0x12'),_0x2012f0);_0x3eadbb=_0x3eadbb['substring'](_0x318976+_0x5f58e0[_0xd2b2('0xd')]);}this[_0xd2b2('0x4')]=_0x3eadbb;}_0x1fd93e();};module['exports']=AGIReply; \ No newline at end of file +var _0xb60e=['slice','trim','emit','_inBody','exports','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split'];(function(_0x4be5ee,_0x2c2f20){var _0x28aa63=function(_0x116297){while(--_0x116297){_0x4be5ee['push'](_0x4be5ee['shift']());}};_0x28aa63(++_0x2c2f20);}(_0xb60e,0x10f));var _0xeb60=function(_0x2c3c23,_0x3609b5){_0x2c3c23=_0x2c3c23-0x0;var _0x24e0ee=_0xb60e[_0x2c3c23];return _0x24e0ee;};'use strict';var util=require(_0xeb60('0x0'));var Transform=require(_0xeb60('0x1'))[_0xeb60('0x2')];function AGIReply(_0x2be940){Transform[_0xeb60('0x3')](this,_0x2be940);this[_0xeb60('0x4')]='';this['_inBody']=![];}util[_0xeb60('0x5')](AGIReply,Transform);AGIReply[_0xeb60('0x6')][_0xeb60('0x7')]=function(_0x2564e2,_0x38c8b3,_0x1156fc){var _0x48e2ab='\x0a',_0x30b72e=['\x0a\x0a',_0xeb60('0x8')],_0x1e37d9=-0x1,_0x568012=-0x1,_0x2cdfb2='',_0x1c1f8d=0x0,_0x5bb97b='',_0x29397c='';this['_localBuffer']+=_0x2564e2[_0xeb60('0x9')]();_0x5bb97b=this[_0xeb60('0x4')];if(!this['_inBody']){_0x1c1f8d=0x0;while(_0x30b72e[_0x1c1f8d]){while((_0x568012=_0x5bb97b[_0xeb60('0xa')](_0x30b72e[_0x1c1f8d]))!=-0x1){_0x2cdfb2=_0x30b72e[_0x1c1f8d];_0x29397c=_0x5bb97b['substring'](0x0,_0x568012);_0x5bb97b=_0x5bb97b[_0xeb60('0xb')](_0x568012+_0x2cdfb2[_0xeb60('0xc')]);var _0xff008e=_0x29397c[_0xeb60('0xd')](_0x48e2ab),_0x2c8a25=0x0,_0x50c1ff={},_0x548ad6='',_0x2aba82='',_0x40f68a=-0x1;while(_0xff008e[_0x2c8a25]){_0x40f68a=_0xff008e[_0x2c8a25]['indexOf'](':');if(_0x40f68a!=-0x1){_0x548ad6=_0xff008e[_0x2c8a25][_0xeb60('0xe')](0x0,_0x40f68a)[_0xeb60('0xf')]();_0x2aba82=_0xff008e[_0x2c8a25]['slice'](_0x40f68a+0x1)[_0xeb60('0xf')]();if(_0x548ad6['length']>0x0){_0x50c1ff[_0x548ad6]=_0x2aba82;}}else{}_0x2c8a25++;}this[_0xeb60('0x10')]('headers',_0x50c1ff);this[_0xeb60('0x11')]=!![];}_0x1c1f8d++;}this['_localBuffer']=_0x5bb97b;}else{while((_0x1e37d9=_0x5bb97b[_0xeb60('0xa')](_0x48e2ab))!=-0x1){_0x29397c=_0x5bb97b[_0xeb60('0xb')](0x0,_0x1e37d9);this[_0xeb60('0x10')]('line',_0x29397c);_0x5bb97b=_0x5bb97b[_0xeb60('0xb')](_0x1e37d9+_0x48e2ab[_0xeb60('0xc')]);}this['_localBuffer']=_0x5bb97b;}_0x1156fc();};module[_0xeb60('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 40a68d3..b754b99 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 _0x94de=['agentLogin','LoginUser','UnpauseUser','agentLogout','LogoutUser','util','jayson/promise','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact'];(function(_0x3ae17b,_0x43fb59){var _0xcd2806=function(_0x452522){while(--_0x452522){_0x3ae17b['push'](_0x3ae17b['shift']());}};_0xcd2806(++_0x43fb59);}(_0x94de,0x98));var _0xe94d=function(_0x48a847,_0x12bfd0){_0x48a847=_0x48a847-0x0;var _0x272bc9=_0x94de[_0x48a847];return _0x272bc9;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0xe94d('0x0'));var jayson=require(_0xe94d('0x1'));var client=jayson[_0xe94d('0x2')][_0xe94d('0x3')]({'port':0x2329});function request(_0x4b73cf,_0x3797ff){return new BPromise(function(_0x49bd8f,_0x20faee){return client[_0xe94d('0x4')](_0x4b73cf,_0x3797ff)[_0xe94d('0x5')](function(_0x18d3c7){if(_0x18d3c7[_0xe94d('0x6')]){return _0x20faee(_0x18d3c7[_0xe94d('0x6')][_0xe94d('0x7')]);}else{return _0x49bd8f(_0x18d3c7[_0xe94d('0x8')]);}})['catch'](function(_0x32312d){return _0x20faee(_0x32312d);});});}exports[_0xe94d('0x9')]=function(_0x178f10){return request(_0xe94d('0xa'),{'options':{'raw':![],'where':{'name':_0x178f10},'attributes':['production']}});};exports[_0xe94d('0xb')]=function(_0x523866){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x523866},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0xe94d('0xc'),_0xe94d('0xd')]}});};exports[_0xe94d('0xe')]=function(_0x3b9024){return request(_0xe94d('0xa'),{'options':{'where':{'id':_0x3b9024},'attributes':[_0xe94d('0xc')]}});};exports['getVoiceQueueById']=function(_0xd82951){return request(_0xe94d('0xf'),{'options':{'where':{'id':_0xd82951},'attributes':['name']}});};exports[_0xe94d('0x10')]=function(_0x180324){return request(_0xe94d('0x11'),{'options':{'where':{'id':_0x180324},'attributes':[_0xe94d('0xc')]}});};exports['getSquareOdbcById']=function(_0x1384a3){return request(_0xe94d('0x12'),{'options':{'where':{'id':_0x1384a3},'attributes':[_0xe94d('0x13')]}});};exports['getUserById']=function(_0x2e422d){return request(_0xe94d('0x14'),{'options':{'where':{'id':_0x2e422d},'attributes':[_0xe94d('0xc')]}});};exports['getTrunkById']=function(_0x2e44ba){return request(_0xe94d('0x15'),{'options':{'where':{'id':_0x2e44ba},'attributes':[_0xe94d('0xc')]}});};exports[_0xe94d('0x16')]=function(_0x1d3101){return request('ShowSound',{'options':{'where':{'id':_0x1d3101},'attributes':[_0xe94d('0x17')]}});};exports['getIntervalById']=function(_0x5a67dc){return request(_0xe94d('0x18'),{'options':{'raw':![],'where':{'id':_0x5a67dc},'include':[{'model':_0xe94d('0x19'),'as':_0xe94d('0x1a')}]}});};exports[_0xe94d('0x1b')]=function(_0x4e6689){return request(_0xe94d('0x1c'),{'options':{'where':{'id':_0x4e6689},'attributes':['id',_0xe94d('0xc')]}});};exports[_0xe94d('0x1d')]=function(_0x2ac310){return request(_0xe94d('0x1e'),{'body':_0x2ac310});};exports[_0xe94d('0x1f')]=function(_0x24cc7a){return request('CreateSquareDetailsReport',{'body':_0x24cc7a});};exports['createSquareReport']=function(_0x564fbd){return request(_0xe94d('0x20'),{'body':_[_0xe94d('0x21')](_0x564fbd,{'project_name':_0x564fbd[_0xe94d('0x22')],'prev_project_name':_0x564fbd[_0xe94d('0x23')]||'','is_subproject':_0x564fbd[_0xe94d('0x23')]?!![]:![],'leaveAt':moment()[_0xe94d('0x24')](_0xe94d('0x25'))})});};exports[_0xe94d('0x26')]=function(_0x110b79){return request('CreateSquareRecording',{'body':_0x110b79});};exports[_0xe94d('0x27')]=function(_0x694a){return request(_0xe94d('0x28'),{'body':_0x694a});};exports[_0xe94d('0x29')]=function(_0x3c2647){return request(_0xe94d('0x2a'),{'options':{'raw':![],'where':{'phone':_0x3c2647['phone'],'ListId':_0x3c2647['ListId']}}})[_0xe94d('0x5')](function(_0x4a9db7){if(_0x4a9db7){return _0x4a9db7;}return request(_0xe94d('0x2b'),{'body':_0x3c2647});});};exports['getPauseById']=function(_0x95d4ce){return request('ShowPause',{'options':{'where':{'id':_0x95d4ce},'attributes':[_0xe94d('0xc')]}});};exports[_0xe94d('0x2c')]=function(_0x3179bb,_0x5d0abb){return request(_0xe94d('0x2d'),{'body':{'interface':_0x5d0abb},'options':{'where':_0x3179bb}});};exports['agentPause']=function(_0x1c9c15,_0x2a3b79,_0x22af42){return request('PauseUser',{'body':{'type':_0x2a3b79,'uniqueid':_0x22af42},'options':{'where':_0x1c9c15}});};exports['agentUnpause']=function(_0x120e9e){return request(_0xe94d('0x2e'),{'body':{},'options':{'where':_0x120e9e}});};exports[_0xe94d('0x2f')]=function(_0x20a050){return request(_0xe94d('0x30'),{'body':{},'options':{'where':_0x20a050}});}; \ No newline at end of file +var _0x1016=['CreateSquareRecording','createSquareMessage','createCmContact','phone','ListId','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','lodash','client','http','error','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0x1016,0x1a4));var _0x6101=function(_0x5c129a,_0x7e647c){_0x5c129a=_0x5c129a-0x0;var _0x48bd6c=_0x1016[_0x5c129a];return _0x48bd6c;};'use strict';var BPromise=require(_0x6101('0x0'));var moment=require('moment');var _=require(_0x6101('0x1'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x6101('0x2')][_0x6101('0x3')]({'port':0x2329});function request(_0x40b38e,_0x57fe73){return new BPromise(function(_0x33744c,_0x4f1e93){return client['request'](_0x40b38e,_0x57fe73)['then'](function(_0x3cfade){if(_0x3cfade[_0x6101('0x4')]){return _0x4f1e93(_0x3cfade['error']['message']);}else{return _0x33744c(_0x3cfade[_0x6101('0x5')]);}})['catch'](function(_0xbccde5){return _0x4f1e93(_0xbccde5);});});}exports[_0x6101('0x6')]=function(_0x1c2edc){return request(_0x6101('0x7'),{'options':{'raw':![],'where':{'name':_0x1c2edc},'attributes':[_0x6101('0x8')]}});};exports[_0x6101('0x9')]=function(_0x220925){return request(_0x6101('0xa'),{'options':{'raw':![],'where':{'id':_0x220925},'include':[{'model':_0x6101('0xb'),'as':_0x6101('0xc')}],'attributes':['id',_0x6101('0xd'),_0x6101('0xe')]}});};exports[_0x6101('0xf')]=function(_0x1f06bd){return request(_0x6101('0x7'),{'options':{'where':{'id':_0x1f06bd},'attributes':[_0x6101('0xd')]}});};exports[_0x6101('0x10')]=function(_0x5becca){return request(_0x6101('0x11'),{'options':{'where':{'id':_0x5becca},'attributes':['name']}});};exports[_0x6101('0x12')]=function(_0x3e9011){return request(_0x6101('0x13'),{'options':{'where':{'id':_0x3e9011},'attributes':['name']}});};exports[_0x6101('0x14')]=function(_0x1ad54c){return request(_0x6101('0x15'),{'options':{'where':{'id':_0x1ad54c},'attributes':[_0x6101('0x16')]}});};exports['getUserById']=function(_0x11c308){return request(_0x6101('0x17'),{'options':{'where':{'id':_0x11c308},'attributes':[_0x6101('0xd')]}});};exports['getTrunkById']=function(_0x2b7b09){return request(_0x6101('0x18'),{'options':{'where':{'id':_0x2b7b09},'attributes':[_0x6101('0xd')]}});};exports[_0x6101('0x19')]=function(_0x1b40a5){return request(_0x6101('0x1a'),{'options':{'where':{'id':_0x1b40a5},'attributes':[_0x6101('0x1b')]}});};exports[_0x6101('0x1c')]=function(_0x17afb3){return request(_0x6101('0x1d'),{'options':{'raw':![],'where':{'id':_0x17afb3},'include':[{'model':_0x6101('0x1e'),'as':_0x6101('0x1f')}]}});};exports[_0x6101('0x20')]=function(_0x5323f2){return request(_0x6101('0x21'),{'options':{'where':{'id':_0x5323f2},'attributes':['id',_0x6101('0xd')]}});};exports[_0x6101('0x22')]=function(_0x30ac37){return request(_0x6101('0x23'),{'body':_0x30ac37});};exports[_0x6101('0x24')]=function(_0x5767a5){return request(_0x6101('0x25'),{'body':_0x5767a5});};exports[_0x6101('0x26')]=function(_0x5563d5){return request(_0x6101('0x27'),{'body':_[_0x6101('0x28')](_0x5563d5,{'project_name':_0x5563d5['arg_1'],'prev_project_name':_0x5563d5[_0x6101('0x29')]||'','is_subproject':_0x5563d5['arg_2']?!![]:![],'leaveAt':moment()[_0x6101('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x6101('0x2b')]=function(_0x2282f2){return request(_0x6101('0x2c'),{'body':_0x2282f2});};exports[_0x6101('0x2d')]=function(_0x4afe01){return request('CreateSquareMessage',{'body':_0x4afe01});};exports[_0x6101('0x2e')]=function(_0x27ff10){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x27ff10[_0x6101('0x2f')],'ListId':_0x27ff10[_0x6101('0x30')]}}})[_0x6101('0x31')](function(_0x2d79ac){if(_0x2d79ac){return _0x2d79ac;}return request(_0x6101('0x32'),{'body':_0x27ff10});});};exports['getPauseById']=function(_0x2f3eb4){return request(_0x6101('0x33'),{'options':{'where':{'id':_0x2f3eb4},'attributes':[_0x6101('0xd')]}});};exports[_0x6101('0x34')]=function(_0x416d3b,_0x38d192){return request(_0x6101('0x35'),{'body':{'interface':_0x38d192},'options':{'where':_0x416d3b}});};exports[_0x6101('0x36')]=function(_0x2a33f9,_0x3530ed,_0x365006){return request(_0x6101('0x37'),{'body':{'type':_0x3530ed,'uniqueid':_0x365006},'options':{'where':_0x2a33f9}});};exports[_0x6101('0x38')]=function(_0x3615c0){return request('UnpauseUser',{'body':{},'options':{'where':_0x3615c0}});};exports[_0x6101('0x39')]=function(_0x156075){return request('LogoutUser',{'body':{},'options':{'where':_0x156075}});}; \ 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 b74dc11..3a37e61 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 _0xab9f=['exports','./polly'];(function(_0x3544b1,_0x907842){var _0xcc3f18=function(_0x227460){while(--_0x227460){_0x3544b1['push'](_0x3544b1['shift']());}};_0xcc3f18(++_0x907842);}(_0xab9f,0x1bd));var _0xfab9=function(_0x15b042,_0x23fd98){_0x15b042=_0x15b042-0x0;var _0x440fb0=_0xab9f[_0x15b042];return _0x440fb0;};var polly=require(_0xfab9('0x0'));var lex=require('./lex');module[_0xfab9('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x980e=['./polly'];(function(_0x37bac6,_0x358d6d){var _0x1c6234=function(_0x207b7e){while(--_0x207b7e){_0x37bac6['push'](_0x37bac6['shift']());}};_0x1c6234(++_0x358d6d);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};var polly=require(_0xe980('0x0'));var lex=require('./lex');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 d938575..1a8a92f 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 _0x9bde=['exports'];(function(_0x59a125,_0x67bc0a){var _0x3cb680=function(_0x5f5348){while(--_0x5f5348){_0x59a125['push'](_0x59a125['shift']());}};_0x3cb680(++_0x67bc0a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3384ce,_0x5eefe4){_0x3384ce=_0x3384ce-0x0;var _0x58edf3=_0x9bde[_0x3384ce];return _0x58edf3;};'use strict';var lex=require('./lib/api');module[_0xe9bd('0x0')]=function(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a){return lex(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b){return lex(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b);}; \ 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 ee18714..2315f02 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(_0x587c66,_0x4b4761){var _0x3a0ac9=function(_0x1fb1c7){while(--_0x1fb1c7){_0x587c66['push'](_0x587c66['shift']());}};_0x3a0ac9(++_0x4b4761);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x586240,_0x713db6){var _0x6c9f88=function(_0x1f66d0){while(--_0x1f66d0){_0x586240['push'](_0x586240['shift']());}};_0x6c9f88(++_0x713db6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 c5f7f7a..e832a53 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 _0x996d=['exports','./lib/api'];(function(_0x25ce7d,_0x35a459){var _0x548c4a=function(_0x4e9398){while(--_0x4e9398){_0x25ce7d['push'](_0x25ce7d['shift']());}};_0x548c4a(++_0x35a459);}(_0x996d,0x17d));var _0xd996=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x996d[_0x38ced4];return _0x547c07;};'use strict';var polly=require(_0xd996('0x0'));module[_0xd996('0x1')]=function(_0x1dff81,_0x21db15,_0x56d219,_0x49e731,_0x36fd24,_0x5e80d4,_0x25aac5){return polly(_0x1dff81,_0x21db15,_0x56d219,_0x49e731,_0x36fd24,_0x5e80d4,_0x25aac5);}; \ No newline at end of file +var _0xdaae=['exports','./lib/api'];(function(_0x16dfc3,_0x480553){var _0x5c996=function(_0x46b8e3){while(--_0x46b8e3){_0x16dfc3['push'](_0x16dfc3['shift']());}};_0x5c996(++_0x480553);}(_0xdaae,0xcb));var _0xedaa=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xdaae[_0x2ed8f3];return _0x525a55;};'use strict';var polly=require(_0xedaa('0x0'));module[_0xedaa('0x1')]=function(_0xfa944a,_0xa70fd1,_0xa75467,_0x52e215,_0x1623ad,_0x11bf61,_0x19b317){return polly(_0xfa944a,_0xa70fd1,_0xa75467,_0x52e215,_0x1623ad,_0x11bf61,_0x19b317);}; \ 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 a8564ba..9210538 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 _0x4307=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4307,0xae));var _0x7430=function(_0x4f700b,_0x569519){_0x4f700b=_0x4f700b-0x0;var _0x21bcb2=_0x4307[_0x4f700b];return _0x21bcb2;};'use strict';var fs=require('fs');var path=require(_0x7430('0x0'));var BPromise=require(_0x7430('0x1'));var rs=require('randomstring');var AWS=require(_0x7430('0x2'));function pollyResult(_0x4928ef,_0x3ad7b5,_0x7722dd){return new BPromise(function(_0x4d59b4,_0x6b67b0){_0x4928ef[_0x7430('0x3')](_0x3ad7b5,function(_0x305905,_0x478d07){if(_0x305905){_0x6b67b0(_0x305905);}else if(_0x478d07){if(_0x478d07['AudioStream']instanceof Buffer){fs[_0x7430('0x4')](_0x7722dd,_0x478d07['AudioStream'],function(_0x2132b2){if(_0x2132b2){_0x6b67b0(_0x2132b2);}else{_0x4d59b4();}});}else{_0x6b67b0(new Error(_0x7430('0x5')));}}else{_0x6b67b0(new Error(_0x7430('0x6')));}});});}module['exports']=function(_0xa7fe17,_0x3dbd44,_0x41ee17,_0x5a23bc,_0x2010a5,_0x1b7e66,_0x598208){var _0x4fd9c3=new AWS[(_0x7430('0x7'))]({'accessKeyId':_0xa7fe17,'secretAccessKey':_0x3dbd44,'region':_0x41ee17});var _0x19ac7f={'Text':_0x2010a5,'TextType':_0x1b7e66||_0x7430('0x8'),'OutputFormat':'mp3','VoiceId':_0x5a23bc};return pollyResult(_0x4fd9c3,_0x19ac7f,_0x598208);}; \ No newline at end of file +var _0xe6e3=['bluebird','randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0x5c4292,_0x46b711){var _0x5d18c5=function(_0x1a0ae6){while(--_0x1a0ae6){_0x5c4292['push'](_0x5c4292['shift']());}};_0x5d18c5(++_0x46b711);}(_0xe6e3,0x1df));var _0x3e6e=function(_0x52d303,_0x26f460){_0x52d303=_0x52d303-0x0;var _0x42d1c6=_0xe6e3[_0x52d303];return _0x42d1c6;};'use strict';var fs=require('fs');var path=require(_0x3e6e('0x0'));var BPromise=require(_0x3e6e('0x1'));var rs=require(_0x3e6e('0x2'));var AWS=require(_0x3e6e('0x3'));function pollyResult(_0x5d8d68,_0xcebb74,_0x152997){return new BPromise(function(_0x3e5de4,_0x1f8ede){_0x5d8d68['synthesizeSpeech'](_0xcebb74,function(_0x165736,_0x444461){if(_0x165736){_0x1f8ede(_0x165736);}else if(_0x444461){if(_0x444461[_0x3e6e('0x4')]instanceof Buffer){fs[_0x3e6e('0x5')](_0x152997,_0x444461[_0x3e6e('0x4')],function(_0x3138aa){if(_0x3138aa){_0x1f8ede(_0x3138aa);}else{_0x3e5de4();}});}else{_0x1f8ede(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x1f8ede(new Error(_0x3e6e('0x6')));}});});}module[_0x3e6e('0x7')]=function(_0x56942b,_0x719582,_0x4bcdcb,_0x17a6af,_0x47e0eb,_0x280c40,_0x5d41b6){var _0x4d217c=new AWS[(_0x3e6e('0x8'))]({'accessKeyId':_0x56942b,'secretAccessKey':_0x719582,'region':_0x4bcdcb});var _0x49e839={'Text':_0x47e0eb,'TextType':_0x280c40||'text','OutputFormat':_0x3e6e('0x9'),'VoiceId':_0x17a6af};return pollyResult(_0x4d217c,_0x49e839,_0x5d41b6);}; \ 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 4e5d078..fd47ae3 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 _0x0c23=['exports'];(function(_0x45682b,_0x22ef44){var _0x28c3cd=function(_0x59047b){while(--_0x59047b){_0x45682b['push'](_0x45682b['shift']());}};_0x28c3cd(++_0x22ef44);}(_0x0c23,0x1c4));var _0x30c2=function(_0x162b59,_0x49fcde){_0x162b59=_0x162b59-0x0;var _0x2f2488=_0x0c23[_0x162b59];return _0x2f2488;};'use strict';var asr=require('./lib/api');module[_0x30c2('0x0')]=function(_0x24b32f,_0x57ba5f,_0x50dfd8,_0x11cd38){return asr(_0x24b32f,_0x57ba5f,_0x50dfd8);}; \ No newline at end of file +var _0x9d15=['./lib/api'];(function(_0x38803b,_0x5a28a8){var _0x51d637=function(_0x4edc95){while(--_0x4edc95){_0x38803b['push'](_0x38803b['shift']());}};_0x51d637(++_0x5a28a8);}(_0x9d15,0x133));var _0x59d1=function(_0x9674c9,_0x5021f6){_0x9674c9=_0x9674c9-0x0;var _0x4c2c89=_0x9d15[_0x9674c9];return _0x4c2c89;};'use strict';var asr=require(_0x59d1('0x0'));module['exports']=function(_0x503f82,_0x16ab59,_0x1f99a9,_0x281f96){return asr(_0x503f82,_0x16ab59,_0x1f99a9);}; \ 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 9011bce..c3e06f3 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 _0x2e35=['length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x40f279,_0x30bcd7){var _0x4a33e5=function(_0x5a8f09){while(--_0x5a8f09){_0x40f279['push'](_0x40f279['shift']());}};_0x4a33e5(++_0x30bcd7);}(_0x2e35,0x1d0));var _0x52e3=function(_0x5719a4,_0x2426f4){_0x5719a4=_0x5719a4-0x0;var _0x5e162f=_0x2e35[_0x5719a4];return _0x5e162f;};'use strict';var url=require(_0x52e3('0x0'));var BPromise=require(_0x52e3('0x1'));var fs=require('fs');var host=_0x52e3('0x2');module['exports']=function(_0x145ad0,_0xcbe6c5,_0x16d807){return new BPromise(function(_0x3dc244,_0x4ccab4){var _0x158226;if(typeof _0x145ad0!==_0x52e3('0x3')||_0x145ad0[_0x52e3('0x4')]===0x0){return _0x4ccab4(_0x52e3('0x5'));}if(typeof _0xcbe6c5!=='string'||_0xcbe6c5['length']===0x0){return _0x4ccab4('key\x20should\x20be\x20a\x20string');}if(typeof _0x16d807!==_0x52e3('0x6')&&(typeof _0x16d807!=='string'||_0x16d807['length']===0x0)){return _0x4ccab4(_0x52e3('0x7'));}try{_0x158226=fs[_0x52e3('0x8')](_0x145ad0)['toString'](_0x52e3('0x9'));}catch(_0x1153c4){return _0x4ccab4(_0x1153c4);}return _0x3dc244({'method':'POST','uri':host+_0x52e3('0xa')+_0xcbe6c5,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x52e3('0xb'),'languageCode':_0x16d807},'audio':{'content':_0x158226}},'json':!![]});});}; \ No newline at end of file +var _0xc577=['length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','exports'];(function(_0x5f50b5,_0xa8db83){var _0x54c383=function(_0x381334){while(--_0x381334){_0x5f50b5['push'](_0x5f50b5['shift']());}};_0x54c383(++_0xa8db83);}(_0xc577,0x172));var _0x7c57=function(_0x5b964b,_0xe2062a){_0x5b964b=_0x5b964b-0x0;var _0x2f187d=_0xc577[_0x5b964b];return _0x2f187d;};'use strict';var url=require(_0x7c57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7c57('0x1')]=function(_0x35af09,_0xe9a500,_0x2a2415){return new BPromise(function(_0x3abdb2,_0x304922){var _0x2ea08b;if(typeof _0x35af09!=='string'||_0x35af09[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x3'));}if(typeof _0xe9a500!==_0x7c57('0x4')||_0xe9a500[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x5'));}if(typeof _0x2a2415!=='undefined'&&(typeof _0x2a2415!=='string'||_0x2a2415['length']===0x0)){return _0x304922(_0x7c57('0x6'));}try{_0x2ea08b=fs['readFileSync'](_0x35af09)[_0x7c57('0x7')](_0x7c57('0x8'));}catch(_0x11dd41){return _0x304922(_0x11dd41);}return _0x3abdb2({'method':_0x7c57('0x9'),'uri':host+'/v1/speech:recognize?key='+_0xe9a500,'body':{'config':{'encoding':_0x7c57('0xa'),'sampleRateHertz':_0x7c57('0xb'),'languageCode':_0x2a2415},'audio':{'content':_0x2ea08b}},'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 ea6a3e9..41cce7f 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 _0x6224=['./asr','exports'];(function(_0x54b5bd,_0x133fe1){var _0xcba844=function(_0x4023dc){while(--_0x4023dc){_0x54b5bd['push'](_0x54b5bd['shift']());}};_0xcba844(++_0x133fe1);}(_0x6224,0xa8));var _0x4622=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x6224[_0x4b174a];return _0x3cd7bf;};var asr=require(_0x4622('0x0'));module[_0x4622('0x1')]={'asr':asr}; \ No newline at end of file +var _0xebe2=['exports','./asr'];(function(_0x4b3f3e,_0x47dfcc){var _0x921fc3=function(_0x3e4b3b){while(--_0x3e4b3b){_0x4b3f3e['push'](_0x4b3f3e['shift']());}};_0x921fc3(++_0x47dfcc);}(_0xebe2,0x199));var _0x2ebe=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xebe2[_0x46efd7];return _0x5637e4;};var asr=require(_0x2ebe('0x0'));module[_0x2ebe('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index a4b0331..4d60270 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 _0xadda=['../../../config/logger','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','close','error','unlink','pipe','protocol','https:','data','end','transcode','error\x20convert','finish\x20to\x20convert','generate','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','?key=','ssml','input','voice','audioConfig','MP3','POST','resolve','tmp','.mp3','audioContent','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','asr','awsPolly','polly','awsLex','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','md5','path','request-promise','randomstring','google-tts-api','parse','util','./aws','./google','./tilde'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xadda,0x73));var _0xaadd=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xadda[_0x1ac595];return _0x455fff;};'use strict';var apiai=require(_0xaadd('0x0'));var BPromise=require(_0xaadd('0x1'));var dialogflow=require(_0xaadd('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xaadd('0x3'));var path=require(_0xaadd('0x4'));var querystring=require('querystring');var rp=require(_0xaadd('0x5'));var rs=require(_0xaadd('0x6'));var sox=require('sox');var tts=require(_0xaadd('0x7'));var urlParse=require('url')[_0xaadd('0x8')];var util=require(_0xaadd('0x9'));var aws=require(_0xaadd('0xa'));var google=require(_0xaadd('0xb'));var sestek=require('./sestek');var tilde=require(_0xaadd('0xc'));var logger=require(_0xaadd('0xd'))('agi');var ISPEECH_API=_0xaadd('0xe');function downloadFile(_0x5846fa,_0x4d2f5a){return new BPromise(function(_0x586879,_0x49fbc5){var _0x3df9a1=urlParse(_0x5846fa);var _0x1fc960=_0x3df9a1['protocol']==='https:'?https:http;var _0x255478={'host':_0x3df9a1[_0xaadd('0xf')],'path':_0x3df9a1[_0xaadd('0x4')],'headers':{'user-agent':_0xaadd('0x10')}};_0x1fc960[_0xaadd('0x11')](_0x255478,function(_0x157a6c){if(_0x157a6c[_0xaadd('0x12')]!==0xc8){logger['error'](_0xaadd('0x13')+_0x5846fa+_0xaadd('0x14')+_0x157a6c['statusCode']+'\x20('+_0x157a6c[_0xaadd('0x15')]+')');_0x49fbc5(new Error(_0xaadd('0x13')+_0x5846fa+_0xaadd('0x14')+_0x157a6c[_0xaadd('0x12')]+'\x20('+_0x157a6c[_0xaadd('0x15')]+')'));return;}var _0x3f88c6=fs[_0xaadd('0x16')](_0x4d2f5a);_0x3f88c6['on']('finish',function(){logger[_0xaadd('0x17')]('finish\x20download\x20file');_0x3f88c6[_0xaadd('0x18')](_0x586879);});_0x3f88c6['on'](_0xaadd('0x19'),function(_0x363a31){fs[_0xaadd('0x1a')](_0x4d2f5a);logger['error']('download\x20error',_0x363a31);_0x49fbc5(_0x363a31);});_0x157a6c[_0xaadd('0x1b')](_0x3f88c6);})['on']('error',function(_0x484fb7){logger[_0xaadd('0x19')](_0x484fb7);_0x49fbc5(_0x484fb7);})['end']();});}function uploadFile(_0x564b89){return new BPromise(function(_0x193d03,_0x2b45da){var _0x186b03=urlParse(_0x564b89);var _0x4b6ab0=_0x186b03[_0xaadd('0x1c')]===_0xaadd('0x1d')?https:http;var _0x474fde={'host':_0x186b03[_0xaadd('0xf')],'path':_0x186b03['path'],'headers':{'user-agent':_0xaadd('0x10')}};_0x4b6ab0[_0xaadd('0x11')](_0x474fde,function(_0x19697b){if(_0x19697b[_0xaadd('0x12')]!==0xc8){_0x2b45da(new Error(_0xaadd('0x13')+_0x564b89+_0xaadd('0x14')+_0x19697b[_0xaadd('0x12')]+'\x20('+_0x19697b[_0xaadd('0x15')]+')'));return;}var _0x1f6d65='';_0x19697b['on'](_0xaadd('0x1e'),function(_0x1dd3b4){_0x1f6d65+=_0x1dd3b4;});_0x19697b['on'](_0xaadd('0x1f'),function(){_0x193d03(_0x1f6d65);});})['on'](_0xaadd('0x19'),function(_0x5c0c9a){_0x2b45da(_0x5c0c9a);})['end']();});}function convertFile(_0x3ceb67,_0xd1772){return new BPromise(function(_0x5cb02f,_0x3e4f2a){var _0x37fede=sox[_0xaadd('0x20')](_0x3ceb67,_0xd1772,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37fede['on'](_0xaadd('0x19'),function(_0x1b96b1){logger[_0xaadd('0x19')](_0xaadd('0x21'),_0x1b96b1);_0x3e4f2a(_0x1b96b1);});_0x37fede['on']('end',function(){logger['info'](_0xaadd('0x22'));_0x5cb02f();});_0x37fede['start']();});}function base64Decode(_0x36c33e,_0x1d63b0){var _0x303589=path['resolve'](__dirname,'tmp',rs[_0xaadd('0x23')](0x4)+_0xaadd('0x24'));fs[_0xaadd('0x25')](_0x303589,_0x36c33e,_0xaadd('0x26'));return convertFile(_0x303589,_0x1d63b0)[_0xaadd('0x27')](function(){try{fs['unlink'](_0x303589);fs[_0xaadd('0x28')](_0x1d63b0,'777');}catch(_0x5c7a71){logger[_0xaadd('0x19')](_0x5c7a71);}return _0x1d63b0[_0xaadd('0x29')]('.')[0x0];});}function base64Encode(_0x307628){var _0x4336f4=fs[_0xaadd('0x2a')](_0x307628);return new Buffer(_0x4336f4)[_0xaadd('0x2b')](_0xaadd('0x26'));}exports['googleCloudTTS']=function(_0x45589a,_0x722be4,_0x350090,_0x347a9f,_0x429d32,_0x101916){var _0x4372c2,_0x195909;var _0x2cacb8='https://texttospeech.googleapis.com/v1/';var _0x21b8d9=_0xaadd('0x2c')+_0x45589a;var _0x4df385={};if(_0x722be4===_0xaadd('0x2d')){_0x4df385[_0xaadd('0x2e')]={'ssml':_0x350090};}else{_0x4df385[_0xaadd('0x2e')]={'text':_0x350090};};_0x4df385[_0xaadd('0x2f')]={'languageCode':_0x347a9f,'ssmlGender':_0x429d32};_0x4df385[_0xaadd('0x30')]={'audioEncoding':_0xaadd('0x31'),'sampleRateHertz':0x1f40};var _0x5b0304={'url':_0x2cacb8+'text:synthesize'+_0x21b8d9,'method':_0xaadd('0x32'),'json':!![],'body':_0x4df385};return rp(_0x5b0304)[_0xaadd('0x27')](function(_0xd03520){return new BPromise(function(_0x36a0fd,_0x3b5d2c){_0x4372c2=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x35'));var _0x529d40=Buffer['from'](_0xd03520[_0xaadd('0x36')],'base64');return fs[_0xaadd('0x37')](_0x4372c2,_0x529d40,function(_0x139796){_0x3b5d2c(_0x139796);},function(_0x296fda){fs['chmodSync'](_0x4372c2,_0xaadd('0x38'));_0x36a0fd(_0x296fda);});});})[_0xaadd('0x27')](function(_0x3b5965){_0x195909=path[_0xaadd('0x33')](__dirname,'tmp',rs['generate'](0x4)+_0xaadd('0x24'));return convertFile(_0x4372c2,_0x195909);})[_0xaadd('0x27')](function(){try{fs[_0xaadd('0x1a')](_0x4372c2);fs[_0xaadd('0x28')](_0x195909,_0xaadd('0x38'));}catch(_0x235a69){logger[_0xaadd('0x19')](_0x235a69);}logger['info'](_0xaadd('0x39'),_0x195909[_0xaadd('0x29')]('.')[0x0]);return _0x195909[_0xaadd('0x29')]('.')[0x0];});};exports['googleTTS']=function(_0x3f34e6,_0x272ff6){var _0x3f0c41=_0xaadd('0x3a');var _0x13785b,_0x1b722a;var _0x9fabc0;var _0x4cbee7={'encoding':_0xaadd('0x3b'),'method':'POST','timeout':0x2710,'url':_0x3f0c41,'headers':{'Content-Type':_0xaadd('0x3c')},'body':_0xaadd('0x3d')+encodeURIComponent(JSON[_0xaadd('0x3e')]([[[_0xaadd('0x3f'),JSON['stringify']([_0x3f34e6,_0x272ff6||'en',![],_0xaadd('0x40')]),null,_0xaadd('0x41')]]]))};return rp(_0x4cbee7)[_0xaadd('0x27')](function(_0x247c10){try{_0x9fabc0=eval(_0x247c10[_0xaadd('0x42')](0x5))[0x0][0x2];}catch(_0x2da166){throw new Error('parse\x20response\x20failed:\x0a'+_0x247c10['data']);}if(!_0x9fabc0){if(_0x3f34e6[_0xaadd('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xaadd('0x44')+_0x272ff6+_0xaadd('0x45'));}}try{_0x9fabc0=eval(_0x9fabc0)[0x0];}catch(_0x7bf4b5){throw new Error(_0xaadd('0x46')+res[_0xaadd('0x1e')]);}const _0x37ea05=_0x9fabc0;_0x13785b=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x35'));fs[_0xaadd('0x25')](_0x13785b,_0x9fabc0,{'encoding':_0xaadd('0x26')});_0x1b722a=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x24'));return convertFile(_0x13785b,_0x1b722a);})[_0xaadd('0x27')](function(){try{fs[_0xaadd('0x1a')](_0x13785b);fs[_0xaadd('0x28')](_0x1b722a,'777');}catch(_0x2df712){logger[_0xaadd('0x19')](_0x2df712);}logger[_0xaadd('0x17')](_0xaadd('0x47'),_0x1b722a[_0xaadd('0x29')]('.')[0x0]);return _0x1b722a['split']('.')[0x0];});};exports['googleASR']=function(_0x296e06,_0x4395a5,_0x58ba4b){return google['asr'](_0x296e06,_0x4395a5,_0x58ba4b)[_0xaadd('0x27')](function(_0xe033a8){logger[_0xaadd('0x17')](_0xe033a8['uri']);return rp(_0xe033a8);})[_0xaadd('0x27')](function(_0x54502b){var _0x1c8df5='';var _0x800ef8=0x0;try{fs['unlink'](_0x296e06);}catch(_0x4d4f81){logger[_0xaadd('0x19')](_0x4d4f81);}if(_0x54502b&&_0x54502b[_0xaadd('0x48')]){_0x1c8df5=_0x54502b[_0xaadd('0x48')][_0xaadd('0x49')](function(_0x15d198){return _0x15d198&&_0x15d198[_0xaadd('0x4a')][0x0]&&_0x15d198[_0xaadd('0x4a')][0x0][_0xaadd('0x4b')]?_0x15d198['alternatives'][0x0][_0xaadd('0x4b')]:'';})['join']('\x0a');_0x800ef8=_0x54502b['results'][_0xaadd('0x49')](function(_0x309d50){return _0x309d50&&_0x309d50[_0xaadd('0x4a')][0x0]&&_0x309d50[_0xaadd('0x4a')][0x0][_0xaadd('0x4c')]?_0x309d50[_0xaadd('0x4a')][0x0][_0xaadd('0x4c')]:0x0;})[_0xaadd('0x4d')]('\x0a');}logger['info'](_0xaadd('0x4e'),_0x1c8df5);logger[_0xaadd('0x17')](_0xaadd('0x4f'),_0x800ef8);return{'transcript':_0x1c8df5,'confidence':_0x800ef8};})[_0xaadd('0x50')](function(_0x4106a9){logger['error'](_0xaadd('0x51'),_0x4106a9[_0xaadd('0x12')],_0x4106a9['name'],_0x4106a9[_0xaadd('0x52')]);});};exports[_0xaadd('0x53')]=function(_0x31ab42,_0x214e0b,_0x13decb,_0x49ec16){var _0x1dac0b=apiai(_0x214e0b,{'language':_0x49ec16||'en'});return _0x1dac0b[_0xaadd('0x54')](_0x13decb,{'sessionId':md5(_0x31ab42)})[_0xaadd('0x27')](function(_0x3e3406){logger['info'](JSON[_0xaadd('0x3e')](_0x3e3406));return{'source':_0x3e3406['result'][_0xaadd('0x55')],'resolvedQuery':_0x3e3406[_0xaadd('0x56')][_0xaadd('0x57')],'action':_0x3e3406['result'][_0xaadd('0x58')],'actionIncomplete':_0x3e3406[_0xaadd('0x56')]['actionIncomplete'],'speech':_0x3e3406[_0xaadd('0x56')][_0xaadd('0x59')]['speech'],'score':_0x3e3406[_0xaadd('0x56')][_0xaadd('0x5a')],'statusCode':_0x3e3406[_0xaadd('0x5b')][_0xaadd('0x5c')],'endConversation':_0x3e3406[_0xaadd('0x56')][_0xaadd('0x5d')][_0xaadd('0x5e')]||![],'isFallbackIntent':_0x3e3406[_0xaadd('0x56')][_0xaadd('0x5d')][_0xaadd('0x5f')]};});};exports[_0xaadd('0x60')]=function(_0x5b2013,_0xa473c8,_0x570ffb,_0x33dd98,_0x154170,_0x4e76b8){var _0x2990c5=_0x33dd98['replace'](/\\n/g,'\x0a');var _0x2878aa={'credentials':{'private_key':_0x2990c5,'client_email':_0x570ffb}};var _0x368f2a=new dialogflow[(_0xaadd('0x61'))](_0x2878aa);var _0x37bd98=_0x368f2a['sessionPath'](_0xa473c8,md5(_0x5b2013));var _0x28a0b7={'session':_0x37bd98,'queryInput':{'text':{'text':_0x154170,'languageCode':_0x4e76b8}}};return _0x368f2a['detectIntent'](_0x28a0b7)[_0xaadd('0x27')](function(_0x1edde6){if(_0x1edde6&&_0x1edde6[_0xaadd('0x43')]){logger[_0xaadd('0x17')](_0xaadd('0x62'),JSON[_0xaadd('0x3e')](_0x1edde6));var _0x286c45=_0x1edde6[0x0];if(_0x286c45){var _0x49c195={'action':_0x286c45[_0xaadd('0x63')][_0xaadd('0x58')],'allRequiredParamsPresent':_0x286c45['queryResult']['allRequiredParamsPresent'],'endConversation':_0x286c45['queryResult'][_0xaadd('0x64')]&&_0x286c45[_0xaadd('0x63')][_0xaadd('0x64')][_0xaadd('0x65')]?_0x286c45[_0xaadd('0x63')][_0xaadd('0x64')][_0xaadd('0x65')][_0xaadd('0x66')][_0xaadd('0x67')]:![],'fulfillmentText':_0x286c45[_0xaadd('0x63')]['fulfillmentText'],'intentName':_0x286c45[_0xaadd('0x63')][_0xaadd('0x68')]['name'],'intentDisplayName':_0x286c45['queryResult'][_0xaadd('0x68')][_0xaadd('0x69')],'isFallbackIntent':_0x286c45['queryResult'][_0xaadd('0x68')][_0xaadd('0x6a')],'languageCode':_0x286c45[_0xaadd('0x63')][_0xaadd('0x6b')],'queryText':_0x286c45[_0xaadd('0x63')][_0xaadd('0x6c')],'responseId':_0x286c45[_0xaadd('0x6d')],'score':_0x286c45[_0xaadd('0x63')][_0xaadd('0x6e')],'speech':_0x286c45[_0xaadd('0x63')][_0xaadd('0x6f')],'providerResponse':JSON[_0xaadd('0x3e')](_0x1edde6)};return _0x49c195;}}});};exports['tildeASR']=function(_0x3a7c68,_0x3c3a2e,_0x5dbd98,_0xb6a83f){return tilde[_0xaadd('0x70')](_0x3a7c68,_0x3c3a2e,_0x5dbd98,_0xb6a83f)[_0xaadd('0x27')](function(_0x24cece){try{fs[_0xaadd('0x1a')](_0x3a7c68);}catch(_0x58bafc){logger['error'](_0x58bafc);}logger['info']('Tilde\x20ASR\x20transcription',_0x24cece[_0xaadd('0x4b')]);logger[_0xaadd('0x17')]('Tilde\x20ASR\x20confidence',_0x24cece[_0xaadd('0x4c')]);return _0x24cece;});};exports[_0xaadd('0x71')]=function(_0x34f453,_0x40c176,_0x4124ae,_0x48f8d6,_0x44d239,_0x1cbdef){var _0x18f98a=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x35'));var _0x2a199e;return aws[_0xaadd('0x72')](_0x34f453,_0x40c176,_0x4124ae,_0x48f8d6,_0x44d239,_0x1cbdef,_0x18f98a)['then'](function(){_0x2a199e=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x24'));return convertFile(_0x18f98a,_0x2a199e);})[_0xaadd('0x27')](function(){try{fs[_0xaadd('0x1a')](_0x18f98a);fs[_0xaadd('0x28')](_0x2a199e,_0xaadd('0x38'));}catch(_0x452c29){logger['error'](_0x452c29);}return _0x2a199e[_0xaadd('0x29')]('.')[0x0];});};exports[_0xaadd('0x73')]=function(_0x4e5b9d,_0x3da8d5,_0x552003,_0x565d9e,_0x1f0fa5,_0x4fbaea){return aws['lex'](_0x4e5b9d,_0x3da8d5,_0x552003,_0x565d9e,_0x1f0fa5,_0x4fbaea)[_0xaadd('0x27')](function(_0x549767){logger[_0xaadd('0x17')](JSON['stringify'](_0x549767));return _0x549767;});};exports['ispeechTTS']=function(_0x2a9647,_0x39dfef,_0x3b6275,_0xb674d6){var _0x41d587=util[_0xaadd('0x74')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2a9647,encodeURIComponent(_0x39dfef),_0x3b6275,_0xb674d6);var _0x2d239f=path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs[_0xaadd('0x23')](0x4)+_0xaadd('0x35'));var _0x1a5bb0;return downloadFile(_0x41d587,_0x2d239f)[_0xaadd('0x27')](function(){_0x1a5bb0=path['resolve'](__dirname,_0xaadd('0x34'),rs[_0xaadd('0x23')](0x4)+_0xaadd('0x24'));return convertFile(_0x2d239f,_0x1a5bb0);})[_0xaadd('0x27')](function(){try{fs[_0xaadd('0x1a')](_0x2d239f);fs['chmodSync'](_0x1a5bb0,'777');}catch(_0xcbabe2){logger[_0xaadd('0x19')](_0xcbabe2);}return _0x1a5bb0[_0xaadd('0x29')]('.')[0x0];});};exports[_0xaadd('0x75')]=function(_0x59af54,_0x4f2978,_0x454dd4,_0x72ffb1){var _0x381641=util[_0xaadd('0x74')](_0xaadd('0x76'),ISPEECH_API,_0x4f2978,_0x454dd4,base64Encode(_0x59af54),_0x72ffb1?util[_0xaadd('0x74')](_0xaadd('0x77'),encodeURIComponent(_0x72ffb1)):'freeform=3');return uploadFile(_0x381641)[_0xaadd('0x27')](function(_0x2460a9){return querystring[_0xaadd('0x8')](_0x2460a9);});};exports[_0xaadd('0x78')]=function(_0x12fdac,_0x290ee6){return sestek['nda'](_0x12fdac,_0x290ee6)[_0xaadd('0x27')](function(_0x54c08c){logger[_0xaadd('0x17')](JSON[_0xaadd('0x3e')](_0x54c08c));var _0x1d23aa={'speech':_0x54c08c[_0xaadd('0x79')],'action':_0x54c08c[_0xaadd('0x7a')]?_0x54c08c[_0xaadd('0x7a')][_0xaadd('0x7b')]:undefined,'actiondata':_0x54c08c[_0xaadd('0x7a')]?_0x54c08c[_0xaadd('0x7a')][_0xaadd('0x7c')]:undefined};if(_0x54c08c[_0xaadd('0x7a')]&&_0x54c08c[_0xaadd('0x7a')][_0xaadd('0x7d')]){return base64Decode(_0x54c08c[_0xaadd('0x7a')][_0xaadd('0x7d')][_0xaadd('0x7e')],path[_0xaadd('0x33')](__dirname,_0xaadd('0x34'),rs['generate'](0x4)+_0xaadd('0x24')))[_0xaadd('0x27')](function(_0x2a3db5){_0x1d23aa['audiofile']=_0x2a3db5;return _0x1d23aa;});}return _0x1d23aa;});};exports[_0xaadd('0x7f')]=function(){return __dirname;}; \ No newline at end of file +var _0xab46=['unlink','download\x20error','pipe','end','WHAT_EVER','data','resolve','tmp','generate','writeFileSync','then','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','chmodSync','777','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','jQ1olc','stringify','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','result','action','actionIncomplete','speech','score','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','languageCode','responseId','intentDetectionConfidence','tildeASR','polly','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','sestekNDA','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab46,0x1c9));var _0x6ab4=function(_0x31ec29,_0x58915c){_0x31ec29=_0x31ec29-0x0;var _0x3275fc=_0xab46[_0x31ec29];return _0x3275fc;};'use strict';var apiai=require(_0x6ab4('0x0'));var BPromise=require(_0x6ab4('0x1'));var dialogflow=require(_0x6ab4('0x2'));var fs=require('fs');var http=require(_0x6ab4('0x3'));var https=require(_0x6ab4('0x4'));var md5=require(_0x6ab4('0x5'));var path=require(_0x6ab4('0x6'));var querystring=require('querystring');var rp=require(_0x6ab4('0x7'));var rs=require('randomstring');var sox=require(_0x6ab4('0x8'));var tts=require(_0x6ab4('0x9'));var urlParse=require(_0x6ab4('0xa'))[_0x6ab4('0xb')];var util=require(_0x6ab4('0xc'));var aws=require(_0x6ab4('0xd'));var google=require('./google');var sestek=require(_0x6ab4('0xe'));var tilde=require(_0x6ab4('0xf'));var logger=require('../../../config/logger')(_0x6ab4('0x10'));var ISPEECH_API=_0x6ab4('0x11');function downloadFile(_0x3c5054,_0x35705d){return new BPromise(function(_0x3355d1,_0x1c967d){var _0x42fc04=urlParse(_0x3c5054);var _0x45fa4e=_0x42fc04[_0x6ab4('0x12')]===_0x6ab4('0x13')?https:http;var _0x4c3e51={'host':_0x42fc04[_0x6ab4('0x14')],'path':_0x42fc04[_0x6ab4('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x45fa4e[_0x6ab4('0x15')](_0x4c3e51,function(_0xca9b94){if(_0xca9b94[_0x6ab4('0x16')]!==0xc8){logger[_0x6ab4('0x17')](_0x6ab4('0x18')+_0x3c5054+_0x6ab4('0x19')+_0xca9b94[_0x6ab4('0x16')]+'\x20('+_0xca9b94[_0x6ab4('0x1a')]+')');_0x1c967d(new Error(_0x6ab4('0x18')+_0x3c5054+_0x6ab4('0x19')+_0xca9b94[_0x6ab4('0x16')]+'\x20('+_0xca9b94[_0x6ab4('0x1a')]+')'));return;}var _0x184f41=fs['createWriteStream'](_0x35705d);_0x184f41['on'](_0x6ab4('0x1b'),function(){logger[_0x6ab4('0x1c')](_0x6ab4('0x1d'));_0x184f41[_0x6ab4('0x1e')](_0x3355d1);});_0x184f41['on'](_0x6ab4('0x17'),function(_0x409e3d){fs[_0x6ab4('0x1f')](_0x35705d);logger[_0x6ab4('0x17')](_0x6ab4('0x20'),_0x409e3d);_0x1c967d(_0x409e3d);});_0xca9b94[_0x6ab4('0x21')](_0x184f41);})['on'](_0x6ab4('0x17'),function(_0xc243f7){logger[_0x6ab4('0x17')](_0xc243f7);_0x1c967d(_0xc243f7);})[_0x6ab4('0x22')]();});}function uploadFile(_0x2f147e){return new BPromise(function(_0x469a3e,_0x180836){var _0x343917=urlParse(_0x2f147e);var _0x591808=_0x343917[_0x6ab4('0x12')]===_0x6ab4('0x13')?https:http;var _0x47eb2c={'host':_0x343917[_0x6ab4('0x14')],'path':_0x343917['path'],'headers':{'user-agent':_0x6ab4('0x23')}};_0x591808[_0x6ab4('0x15')](_0x47eb2c,function(_0x5883eb){if(_0x5883eb[_0x6ab4('0x16')]!==0xc8){_0x180836(new Error(_0x6ab4('0x18')+_0x2f147e+_0x6ab4('0x19')+_0x5883eb[_0x6ab4('0x16')]+'\x20('+_0x5883eb[_0x6ab4('0x1a')]+')'));return;}var _0x3b1bfd='';_0x5883eb['on'](_0x6ab4('0x24'),function(_0x347e0d){_0x3b1bfd+=_0x347e0d;});_0x5883eb['on'](_0x6ab4('0x22'),function(){_0x469a3e(_0x3b1bfd);});})['on'](_0x6ab4('0x17'),function(_0x386c69){_0x180836(_0x386c69);})[_0x6ab4('0x22')]();});}function convertFile(_0xca66f7,_0x5a10a5){return new BPromise(function(_0x52b28a,_0x2a025c){var _0x3c71be=sox['transcode'](_0xca66f7,_0x5a10a5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c71be['on'](_0x6ab4('0x17'),function(_0x1727be){logger[_0x6ab4('0x17')]('error\x20convert',_0x1727be);_0x2a025c(_0x1727be);});_0x3c71be['on'](_0x6ab4('0x22'),function(){logger[_0x6ab4('0x1c')]('finish\x20to\x20convert');_0x52b28a();});_0x3c71be['start']();});}function base64Decode(_0x8f5b51,_0x298a4e){var _0x5a47ed=path[_0x6ab4('0x25')](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+'.wav');fs[_0x6ab4('0x28')](_0x5a47ed,_0x8f5b51,'base64');return convertFile(_0x5a47ed,_0x298a4e)[_0x6ab4('0x29')](function(){try{fs['unlink'](_0x5a47ed);fs['chmodSync'](_0x298a4e,'777');}catch(_0x39028d){logger[_0x6ab4('0x17')](_0x39028d);}return _0x298a4e[_0x6ab4('0x2a')]('.')[0x0];});}function base64Encode(_0x19afbd){var _0x3fbaab=fs[_0x6ab4('0x2b')](_0x19afbd);return new Buffer(_0x3fbaab)['toString'](_0x6ab4('0x2c'));}exports[_0x6ab4('0x2d')]=function(_0x10aa38,_0x286a70,_0x517c17,_0x306b91,_0x20d40e,_0x3786a4){var _0x3e0d5a,_0x265576;var _0x1d7414=_0x6ab4('0x2e');var _0x46c6df=_0x6ab4('0x2f')+_0x10aa38;var _0x2eb162={};if(_0x286a70==='ssml'){_0x2eb162[_0x6ab4('0x30')]={'ssml':_0x517c17};}else{_0x2eb162[_0x6ab4('0x30')]={'text':_0x517c17};};_0x2eb162['voice']={'languageCode':_0x306b91,'ssmlGender':_0x20d40e};_0x2eb162[_0x6ab4('0x31')]={'audioEncoding':_0x6ab4('0x32'),'sampleRateHertz':0x1f40};var _0x5b612f={'url':_0x1d7414+_0x6ab4('0x33')+_0x46c6df,'method':_0x6ab4('0x34'),'json':!![],'body':_0x2eb162};return rp(_0x5b612f)[_0x6ab4('0x29')](function(_0x4b36e4){return new BPromise(function(_0x24056a,_0x3999f4){_0x3e0d5a=path[_0x6ab4('0x25')](__dirname,'tmp',rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x35'));var _0x4e157c=Buffer[_0x6ab4('0x36')](_0x4b36e4[_0x6ab4('0x37')],_0x6ab4('0x2c'));return fs['writeFile'](_0x3e0d5a,_0x4e157c,function(_0x10b971){_0x3999f4(_0x10b971);},function(_0x289ef8){fs[_0x6ab4('0x38')](_0x3e0d5a,_0x6ab4('0x39'));_0x24056a(_0x289ef8);});});})[_0x6ab4('0x29')](function(_0x7522f){_0x265576=path[_0x6ab4('0x25')](__dirname,_0x6ab4('0x26'),rs['generate'](0x4)+_0x6ab4('0x3a'));return convertFile(_0x3e0d5a,_0x265576);})[_0x6ab4('0x29')](function(){try{fs[_0x6ab4('0x1f')](_0x3e0d5a);fs[_0x6ab4('0x38')](_0x265576,_0x6ab4('0x39'));}catch(_0x325d95){logger['error'](_0x325d95);}logger[_0x6ab4('0x1c')]('googleCloudTTS\x20path',_0x265576['split']('.')[0x0]);return _0x265576[_0x6ab4('0x2a')]('.')[0x0];});};exports[_0x6ab4('0x3b')]=function(_0x239e61,_0x5769e){var _0x398ed7=_0x6ab4('0x3c');var _0x15b299,_0x1be83d;var _0xcc3413;var _0x5b40e0={'encoding':_0x6ab4('0x3d'),'method':_0x6ab4('0x34'),'timeout':0x2710,'url':_0x398ed7,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6ab4('0x3e')+encodeURIComponent(JSON['stringify']([[[_0x6ab4('0x3f'),JSON[_0x6ab4('0x40')]([_0x239e61,_0x5769e||'en',![],'null']),null,'generic']]]))};return rp(_0x5b40e0)['then'](function(_0x24a3f7){try{_0xcc3413=eval(_0x24a3f7[_0x6ab4('0x41')](0x5))[0x0][0x2];}catch(_0x3f7552){throw new Error(_0x6ab4('0x42')+_0x24a3f7['data']);}if(!_0xcc3413){if(_0x239e61['length']>0xc8){throw new Error(_0x6ab4('0x43'));}else{throw new Error(_0x6ab4('0x44')+_0x5769e+_0x6ab4('0x45'));}}try{_0xcc3413=eval(_0xcc3413)[0x0];}catch(_0x239017){throw new Error(_0x6ab4('0x42')+res['data']);}const _0x430bfa=_0xcc3413;_0x15b299=path['resolve'](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x35'));fs[_0x6ab4('0x28')](_0x15b299,_0xcc3413,{'encoding':_0x6ab4('0x2c')});_0x1be83d=path[_0x6ab4('0x25')](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x3a'));return convertFile(_0x15b299,_0x1be83d);})[_0x6ab4('0x29')](function(){try{fs['unlink'](_0x15b299);fs[_0x6ab4('0x38')](_0x1be83d,_0x6ab4('0x39'));}catch(_0x2cc3c5){logger[_0x6ab4('0x17')](_0x2cc3c5);}logger['info']('goggleTTS\x20path',_0x1be83d['split']('.')[0x0]);return _0x1be83d[_0x6ab4('0x2a')]('.')[0x0];});};exports[_0x6ab4('0x46')]=function(_0x546be4,_0x476d04,_0x1efeb1){return google['asr'](_0x546be4,_0x476d04,_0x1efeb1)[_0x6ab4('0x29')](function(_0x4278e6){logger[_0x6ab4('0x1c')](_0x4278e6[_0x6ab4('0x47')]);return rp(_0x4278e6);})[_0x6ab4('0x29')](function(_0x371c64){var _0x2d880d='';var _0x5f1620=0x0;try{fs[_0x6ab4('0x1f')](_0x546be4);}catch(_0x1609e6){logger['error'](_0x1609e6);}if(_0x371c64&&_0x371c64[_0x6ab4('0x48')]){_0x2d880d=_0x371c64[_0x6ab4('0x48')][_0x6ab4('0x49')](function(_0xd12bed){return _0xd12bed&&_0xd12bed[_0x6ab4('0x4a')][0x0]&&_0xd12bed[_0x6ab4('0x4a')][0x0][_0x6ab4('0x4b')]?_0xd12bed[_0x6ab4('0x4a')][0x0][_0x6ab4('0x4b')]:'';})[_0x6ab4('0x4c')]('\x0a');_0x5f1620=_0x371c64[_0x6ab4('0x48')][_0x6ab4('0x49')](function(_0x4dfd45){return _0x4dfd45&&_0x4dfd45[_0x6ab4('0x4a')][0x0]&&_0x4dfd45[_0x6ab4('0x4a')][0x0][_0x6ab4('0x4d')]?_0x4dfd45[_0x6ab4('0x4a')][0x0][_0x6ab4('0x4d')]:0x0;})[_0x6ab4('0x4c')]('\x0a');}logger['info']('googleASR\x20transcription',_0x2d880d);logger[_0x6ab4('0x1c')](_0x6ab4('0x4e'),_0x5f1620);return{'transcript':_0x2d880d,'confidence':_0x5f1620};})[_0x6ab4('0x4f')](function(_0x5cb68b){logger[_0x6ab4('0x17')](_0x6ab4('0x50'),_0x5cb68b[_0x6ab4('0x16')],_0x5cb68b['name'],_0x5cb68b['message']);});};exports[_0x6ab4('0x51')]=function(_0x37715d,_0x2f594e,_0xca9fff,_0xadcde6){var _0x1c339d=apiai(_0x2f594e,{'language':_0xadcde6||'en'});return _0x1c339d[_0x6ab4('0x52')](_0xca9fff,{'sessionId':md5(_0x37715d)})[_0x6ab4('0x29')](function(_0x369dc6){logger[_0x6ab4('0x1c')](JSON['stringify'](_0x369dc6));return{'source':_0x369dc6['result']['source'],'resolvedQuery':_0x369dc6[_0x6ab4('0x53')]['resolvedQuery'],'action':_0x369dc6[_0x6ab4('0x53')][_0x6ab4('0x54')],'actionIncomplete':_0x369dc6['result'][_0x6ab4('0x55')],'speech':_0x369dc6[_0x6ab4('0x53')]['fulfillment'][_0x6ab4('0x56')],'score':_0x369dc6['result'][_0x6ab4('0x57')],'statusCode':_0x369dc6[_0x6ab4('0x58')]['code'],'endConversation':_0x369dc6[_0x6ab4('0x53')][_0x6ab4('0x59')][_0x6ab4('0x5a')]||![],'isFallbackIntent':_0x369dc6[_0x6ab4('0x53')][_0x6ab4('0x59')]['isFallbackIntent']};});};exports[_0x6ab4('0x5b')]=function(_0x1ff6ef,_0x53e5f4,_0x39c9b4,_0xa6867a,_0x32a8a7,_0x2e8abe){var _0x95ec6f=_0xa6867a[_0x6ab4('0x5c')](/\\n/g,'\x0a');var _0x24db20={'credentials':{'private_key':_0x95ec6f,'client_email':_0x39c9b4}};var _0x1f2f73=new dialogflow[(_0x6ab4('0x5d'))](_0x24db20);var _0xf24f07=_0x1f2f73[_0x6ab4('0x5e')](_0x53e5f4,md5(_0x1ff6ef));var _0x5283c6={'session':_0xf24f07,'queryInput':{'text':{'text':_0x32a8a7,'languageCode':_0x2e8abe}}};return _0x1f2f73[_0x6ab4('0x5f')](_0x5283c6)[_0x6ab4('0x29')](function(_0x11e64b){if(_0x11e64b&&_0x11e64b['length']){logger[_0x6ab4('0x1c')](_0x6ab4('0x60'),JSON[_0x6ab4('0x40')](_0x11e64b));var _0x2ae3f9=_0x11e64b[0x0];if(_0x2ae3f9){var _0x48b8e9={'action':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x54')],'allRequiredParamsPresent':_0x2ae3f9[_0x6ab4('0x61')]['allRequiredParamsPresent'],'endConversation':_0x2ae3f9[_0x6ab4('0x61')]['diagnosticInfo']&&_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x62')][_0x6ab4('0x63')]?_0x2ae3f9['queryResult'][_0x6ab4('0x62')][_0x6ab4('0x63')][_0x6ab4('0x64')][_0x6ab4('0x65')]:![],'fulfillmentText':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x66')],'intentName':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x67')][_0x6ab4('0x68')],'intentDisplayName':_0x2ae3f9['queryResult']['intent']['displayName'],'isFallbackIntent':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x67')]['isFallback'],'languageCode':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x69')],'queryText':_0x2ae3f9[_0x6ab4('0x61')]['queryText'],'responseId':_0x2ae3f9[_0x6ab4('0x6a')],'score':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x6b')],'speech':_0x2ae3f9[_0x6ab4('0x61')][_0x6ab4('0x66')],'providerResponse':JSON['stringify'](_0x11e64b)};return _0x48b8e9;}}});};exports[_0x6ab4('0x6c')]=function(_0x34ab0d,_0x55dadb,_0x5f489b,_0x30102e){return tilde['asr'](_0x34ab0d,_0x55dadb,_0x5f489b,_0x30102e)[_0x6ab4('0x29')](function(_0x1d0308){try{fs[_0x6ab4('0x1f')](_0x34ab0d);}catch(_0x5eee31){logger[_0x6ab4('0x17')](_0x5eee31);}logger[_0x6ab4('0x1c')]('Tilde\x20ASR\x20transcription',_0x1d0308['transcript']);logger[_0x6ab4('0x1c')]('Tilde\x20ASR\x20confidence',_0x1d0308['confidence']);return _0x1d0308;});};exports['awsPolly']=function(_0x14f432,_0x1f9cc5,_0x18e233,_0x15e146,_0x4e90b4,_0x17bf5a){var _0x167a5b=path[_0x6ab4('0x25')](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x35'));var _0xfd0d58;return aws[_0x6ab4('0x6d')](_0x14f432,_0x1f9cc5,_0x18e233,_0x15e146,_0x4e90b4,_0x17bf5a,_0x167a5b)[_0x6ab4('0x29')](function(){_0xfd0d58=path['resolve'](__dirname,_0x6ab4('0x26'),rs['generate'](0x4)+_0x6ab4('0x3a'));return convertFile(_0x167a5b,_0xfd0d58);})[_0x6ab4('0x29')](function(){try{fs['unlink'](_0x167a5b);fs[_0x6ab4('0x38')](_0xfd0d58,_0x6ab4('0x39'));}catch(_0x2f8d16){logger[_0x6ab4('0x17')](_0x2f8d16);}return _0xfd0d58[_0x6ab4('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x41645c,_0x525322,_0x50d9da,_0x393792,_0x465f16,_0x4c78ea){return aws[_0x6ab4('0x6e')](_0x41645c,_0x525322,_0x50d9da,_0x393792,_0x465f16,_0x4c78ea)[_0x6ab4('0x29')](function(_0x33b644){logger[_0x6ab4('0x1c')](JSON[_0x6ab4('0x40')](_0x33b644));return _0x33b644;});};exports['ispeechTTS']=function(_0x2579be,_0x509c17,_0x1bcc9b,_0xf0bc29){var _0x479560=util['format'](_0x6ab4('0x6f'),ISPEECH_API,_0x2579be,encodeURIComponent(_0x509c17),_0x1bcc9b,_0xf0bc29);var _0x5bd8d8=path['resolve'](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x35'));var _0xd2b37c;return downloadFile(_0x479560,_0x5bd8d8)[_0x6ab4('0x29')](function(){_0xd2b37c=path[_0x6ab4('0x25')](__dirname,'tmp',rs[_0x6ab4('0x27')](0x4)+_0x6ab4('0x3a'));return convertFile(_0x5bd8d8,_0xd2b37c);})[_0x6ab4('0x29')](function(){try{fs[_0x6ab4('0x1f')](_0x5bd8d8);fs[_0x6ab4('0x38')](_0xd2b37c,_0x6ab4('0x39'));}catch(_0x552fc5){logger[_0x6ab4('0x17')](_0x552fc5);}return _0xd2b37c[_0x6ab4('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x91f473,_0x9c03e5,_0x300ef2,_0x27f518){var _0x3e019c=util['format'](_0x6ab4('0x70'),ISPEECH_API,_0x9c03e5,_0x300ef2,base64Encode(_0x91f473),_0x27f518?util[_0x6ab4('0x71')](_0x6ab4('0x72'),encodeURIComponent(_0x27f518)):'freeform=3');return uploadFile(_0x3e019c)[_0x6ab4('0x29')](function(_0xe7d24e){return querystring[_0x6ab4('0xb')](_0xe7d24e);});};exports[_0x6ab4('0x73')]=function(_0x2e2b62,_0x5e6eb0){return sestek['nda'](_0x2e2b62,_0x5e6eb0)['then'](function(_0x28c3fe){logger[_0x6ab4('0x1c')](JSON[_0x6ab4('0x40')](_0x28c3fe));var _0x5cd567={'speech':_0x28c3fe['text'],'action':_0x28c3fe[_0x6ab4('0x74')]?_0x28c3fe[_0x6ab4('0x74')]['CustomAction']:undefined,'actiondata':_0x28c3fe['channelData']?_0x28c3fe[_0x6ab4('0x74')][_0x6ab4('0x75')]:undefined};if(_0x28c3fe[_0x6ab4('0x74')]&&_0x28c3fe[_0x6ab4('0x74')][_0x6ab4('0x76')]){return base64Decode(_0x28c3fe[_0x6ab4('0x74')][_0x6ab4('0x76')][_0x6ab4('0x77')],path[_0x6ab4('0x25')](__dirname,_0x6ab4('0x26'),rs[_0x6ab4('0x27')](0x4)+'.wav'))[_0x6ab4('0x29')](function(_0x4e0444){_0x5cd567[_0x6ab4('0x78')]=_0x4e0444;return _0x5cd567;});}return _0x5cd567;});};exports[_0x6ab4('0x79')]=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 87994a1..b8663c0 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 _0xec35=['exports'];(function(_0x44f8f0,_0x3cba8b){var _0x2a3925=function(_0x2f8fce){while(--_0x2f8fce){_0x44f8f0['push'](_0x44f8f0['shift']());}};_0x2a3925(++_0x3cba8b);}(_0xec35,0xd5));var _0x5ec3=function(_0x3ac6b3,_0x3e05a9){_0x3ac6b3=_0x3ac6b3-0x0;var _0xc49cbc=_0xec35[_0x3ac6b3];return _0xc49cbc;};var nda=require('./nda');module[_0x5ec3('0x0')]={'nda':nda}; \ No newline at end of file +var _0xb93d=['./nda'];(function(_0x45ae56,_0x205f0c){var _0x371809=function(_0x41a9a6){while(--_0x41a9a6){_0x45ae56['push'](_0x45ae56['shift']());}};_0x371809(++_0x205f0c);}(_0xb93d,0xe1));var _0xdb93=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xb93d[_0x19dd7a];return _0x3feb6a;};var nda=require(_0xdb93('0x0'));module['exports']={'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 b7236b0..1cf9252 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 _0xa74f=['ndaactivity_type','message','uniqueid','callerid','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','../../../../../config/logger','POST','ndauth_url','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x3123f4,_0x4ddfe3){var _0xbee8f2=function(_0x18f0f3){while(--_0x18f0f3){_0x3123f4['push'](_0x3123f4['shift']());}};_0xbee8f2(++_0x4ddfe3);}(_0xa74f,0x9a));var _0xfa74=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xa74f[_0x4c3ffe];return _0x28d3eb;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xfa74('0x0'))('agi');module['exports']=function(_0x29e4c8,_0x110824){var _0x394a1e={'method':_0xfa74('0x1'),'uri':url['resolve'](_0x110824[_0xfa74('0x2')],'/token'),'form':{'grant_type':'password','username':_0x110824[_0xfa74('0x3')],'password':_0x110824[_0xfa74('0x4')]},'json':!![]};return rp(_0x394a1e)[_0xfa74('0x5')](function(_0x2d9fa9){var _0x287921={'method':_0xfa74('0x1'),'uri':url['resolve'](_0x110824[_0xfa74('0x6')],_0xfa74('0x7')),'body':{'type':_0x110824[_0xfa74('0x8')]||_0xfa74('0x9'),'channelId':'Nda','conversation':{'id':_0x29e4c8[_0xfa74('0xa')]},'from':{'id':_0x29e4c8[_0xfa74('0xb')],'name':_0x29e4c8['calleridname']},'recipient':{'id':_0x29e4c8[_0xfa74('0xc')],'name':_0x29e4c8[_0xfa74('0xd')]},'text':_0x110824[_0xfa74('0xe')],'channelData':{}},'headers':{'Authorization':_0xfa74('0xf')+_0x2d9fa9['access_token']},'json':!![]};if(_0x110824[_0xfa74('0x10')]){_0x287921[_0xfa74('0x11')][_0xfa74('0x12')][_0xfa74('0x13')]=_0x110824['project'];}if(_0x110824[_0xfa74('0x14')]=='1'){_0x287921[_0xfa74('0x11')][_0xfa74('0x12')][_0xfa74('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfa74('0x16')};}if(_0x110824['custom_action']){_0x287921[_0xfa74('0x11')][_0xfa74('0x12')][_0xfa74('0x17')]=_0x110824[_0xfa74('0x18')];if(_0x110824[_0xfa74('0x19')]){_0x287921[_0xfa74('0x11')][_0xfa74('0x12')]['CustomActionData']=_0x110824[_0xfa74('0x19')];}}logger[_0xfa74('0x1a')](JSON['stringify'](_0x287921));return rp(_0x287921);});}; \ No newline at end of file +var _0x2948=['project','body','channelData','ProjectName','ndagenerate_audio','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','password','username','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token'];(function(_0x12ce94,_0x304b48){var _0x2766c7=function(_0x5a5cc6){while(--_0x5a5cc6){_0x12ce94['push'](_0x12ce94['shift']());}};_0x2766c7(++_0x304b48);}(_0x2948,0xcb));var _0x8294=function(_0x13cc8e,_0x35d9fa){_0x13cc8e=_0x13cc8e-0x0;var _0x5ec13f=_0x2948[_0x13cc8e];return _0x5ec13f;};'use strict';var rp=require(_0x8294('0x0'));var url=require(_0x8294('0x1'));var logger=require(_0x8294('0x2'))(_0x8294('0x3'));module[_0x8294('0x4')]=function(_0xbbaec1,_0xcb5eea){var _0x2209e9={'method':_0x8294('0x5'),'uri':url['resolve'](_0xcb5eea[_0x8294('0x6')],'/token'),'form':{'grant_type':_0x8294('0x7'),'username':_0xcb5eea[_0x8294('0x8')],'password':_0xcb5eea[_0x8294('0x7')]},'json':!![]};return rp(_0x2209e9)['then'](function(_0x5a7135){var _0x56f7c8={'method':'POST','uri':url[_0x8294('0x9')](_0xcb5eea[_0x8294('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0xcb5eea[_0x8294('0xb')]||_0x8294('0xc'),'channelId':_0x8294('0xd'),'conversation':{'id':_0xbbaec1[_0x8294('0xe')]},'from':{'id':_0xbbaec1[_0x8294('0xf')],'name':_0xbbaec1[_0x8294('0x10')]},'recipient':{'id':_0xbbaec1['dnid'],'name':_0xbbaec1[_0x8294('0x11')]},'text':_0xcb5eea[_0x8294('0x12')],'channelData':{}},'headers':{'Authorization':_0x8294('0x13')+_0x5a7135[_0x8294('0x14')]},'json':!![]};if(_0xcb5eea[_0x8294('0x15')]){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x18')]=_0xcb5eea['project'];}if(_0xcb5eea[_0x8294('0x19')]=='1'){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xcb5eea['custom_action']){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x1a')]=_0xcb5eea[_0x8294('0x1b')];if(_0xcb5eea[_0x8294('0x1c')]){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x1d')]=_0xcb5eea[_0x8294('0x1c')];}}logger[_0x8294('0x1e')](JSON[_0x8294('0x1f')](_0x56f7c8));return rp(_0x56f7c8);});}; \ 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 5318c9a..53112f9 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc459=['exports'];(function(_0x29d0d3,_0x4fc88a){var _0x36c9bc=function(_0x14abeb){while(--_0x14abeb){_0x29d0d3['push'](_0x29d0d3['shift']());}};_0x36c9bc(++_0x4fc88a);}(_0xc459,0x6d));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require('./lib/api');module[_0x9c45('0x0')]=function(_0x2e2d8f,_0x6c7623,_0x2256a3,_0x153493){return asr(_0x2e2d8f,_0x6c7623,_0x2256a3,_0x153493);}; \ No newline at end of file +var _0xaa23=['exports','./lib/api'];(function(_0x339d3b,_0x57ea82){var _0x2265b5=function(_0x193762){while(--_0x193762){_0x339d3b['push'](_0x339d3b['shift']());}};_0x2265b5(++_0x57ea82);}(_0xaa23,0x1dd));var _0x3aa2=function(_0x361ddd,_0x503739){_0x361ddd=_0x361ddd-0x0;var _0x3a92da=_0xaa23[_0x361ddd];return _0x3a92da;};'use strict';var asr=require(_0x3aa2('0x0'));module[_0x3aa2('0x1')]=function(_0x4a6588,_0x10b74b,_0x556dee,_0x258e13){return asr(_0x4a6588,_0x10b74b,_0x556dee,_0x258e13);}; \ 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 5fa7281..66d897c 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 _0xda63=['info','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda63,0x6c));var _0x3da6=function(_0x2503f2,_0x305c53){_0x2503f2=_0x2503f2-0x0;var _0x13ab2c=_0xda63[_0x2503f2];return _0x13ab2c;};'use strict';var BPromise=require(_0x3da6('0x0'));var _=require(_0x3da6('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3da6('0x2'));var crypto=require(_0x3da6('0x3'));var logger=require('../../../../../../config/logger')(_0x3da6('0x4'));module[_0x3da6('0x5')]=function(_0x31bfc6,_0x5e49fb,_0x407841,_0x1d97d4){return new BPromise(function(_0x5262fc,_0x3dff5f){logger[_0x3da6('0x6')]('Tilde\x20URI',_0x1d97d4||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xd7e97c=new WebSocket(_0x1d97d4||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x7eceac='';var _0x247997='0';var _0x2ffcb7='1';var _0x272945=_0x3da6('0x7');function _0x5adcbe(_0x370472){var _0x2e7b72=crypto[_0x3da6('0x8')]('sha1');_0x2e7b72[_0x3da6('0x9')](_0x370472);return _0x2e7b72[_0x3da6('0xa')]('hex');}function _0x4d0392(){try{logger[_0x3da6('0x6')](_0x3da6('0xb'));var _0x143946=moment()[_0x3da6('0xc')]();var _0x17e6d9=_0x5adcbe(_0x143946+_0x5e49fb+_0x407841);_0xd7e97c[_0x3da6('0xd')](JSON[_0x3da6('0xe')]({'appID':_0x5e49fb,'timestamp':_0x143946,'appKey':_0x17e6d9}));var _0x54e3f7=fs['createReadStream'](_0x31bfc6);_0x54e3f7['on'](_0x3da6('0xf'),function(_0x5646ec){_0xd7e97c[_0x3da6('0xd')](_0x5646ec);});_0x54e3f7['on'](_0x3da6('0x10'),function(){_0xd7e97c['send'](_0x3da6('0x11'));});}catch(_0x58da2c){logger[_0x3da6('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x3da6('0xe')](_0x58da2c));_0xd7e97c[_0x3da6('0x13')]();}}function _0xe0cb58(_0x538203){try{if(_0x538203){var _0x452770=JSON[_0x3da6('0x14')](_0x538203);switch(_0x452770[_0x3da6('0x15')]){case 0x0:if(_0x452770[_0x3da6('0x16')]){if(_0x452770[_0x3da6('0x16')][_0x3da6('0x17')]){logger[_0x3da6('0x6')](_0x3da6('0x18'),JSON[_0x3da6('0xe')](_0x452770['result'][_0x3da6('0x19')]));_0x7eceac=_0x452770[_0x3da6('0x16')][_0x3da6('0x19')][0x0][_0x3da6('0x1a')];_0x247997=_0x452770[_0x3da6('0x16')][_0x3da6('0x19')][0x0][_0x3da6('0x1b')];_0x2ffcb7='0';_0x272945='Success.';_0xd7e97c['terminate']();}}break;case 0x1:logger[_0x3da6('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2ffcb7='1';_0x272945=_0x3da6('0x7');break;case 0x2:logger[_0x3da6('0x6')](_0x3da6('0x1c'));_0x2ffcb7='2';_0x272945='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x3da6('0x6')](_0x3da6('0x1d'));_0x2ffcb7='9';_0x272945=_0x3da6('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2ffcb7='10';_0x272945=_0x3da6('0x1e');break;case 0xb:logger[_0x3da6('0x6')](_0x3da6('0x1f'));_0x2ffcb7='11';_0x272945=_0x3da6('0x1f');}}}catch(_0x316546){logger[_0x3da6('0x12')](_0x3da6('0x20'),JSON[_0x3da6('0xe')](_0x316546));_0xd7e97c[_0x3da6('0x13')]();}}function _0x173d17(){logger[_0x3da6('0x6')](_0x3da6('0x21'));_0x5262fc({'transcript':_0x7eceac,'confidence':_0x247997,'status':_0x2ffcb7,'status_message':_0x272945});}function _0x1e5d8b(_0x50955b){logger[_0x3da6('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3da6('0x22')](_0x50955b)){logger[_0x3da6('0x12')](_[_0x3da6('0x23')](_0x50955b)?JSON[_0x3da6('0xe')](_0x50955b):_0x50955b);}}_0xd7e97c['on'](_0x3da6('0x24'),_0x4d0392);_0xd7e97c['on'](_0x3da6('0x25'),_0xe0cb58);_0xd7e97c['on'](_0x3da6('0x10'),_0x173d17);_0xd7e97c['on']('error',_0x1e5d8b);});}; \ No newline at end of file +var _0xa0e7=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x4f5ec9,_0x3caf27){var _0x536b55=function(_0x527fa8){while(--_0x527fa8){_0x4f5ec9['push'](_0x4f5ec9['shift']());}};_0x536b55(++_0x3caf27);}(_0xa0e7,0x79));var _0x7a0e=function(_0x192c94,_0x11597c){_0x192c94=_0x192c94-0x0;var _0x146c62=_0xa0e7[_0x192c94];return _0x146c62;};'use strict';var BPromise=require(_0x7a0e('0x0'));var _=require(_0x7a0e('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7a0e('0x2'));var crypto=require(_0x7a0e('0x3'));var logger=require(_0x7a0e('0x4'))('agi');module[_0x7a0e('0x5')]=function(_0x30f6ee,_0x181242,_0xa8ea40,_0x3d2fd2){return new BPromise(function(_0x7ee6a1,_0x3fa955){logger[_0x7a0e('0x6')]('Tilde\x20URI',_0x3d2fd2||_0x7a0e('0x7'));var _0x1833fc=new WebSocket(_0x3d2fd2||_0x7a0e('0x7'),{'perMessageDeflate':![]});var _0x185262='';var _0x19b236='0';var _0x1e3d22='1';var _0x46826e=_0x7a0e('0x8');function _0x3bb68f(_0x4e94c2){var _0x3de465=crypto['createHash'](_0x7a0e('0x9'));_0x3de465[_0x7a0e('0xa')](_0x4e94c2);return _0x3de465[_0x7a0e('0xb')](_0x7a0e('0xc'));}function _0x35c09b(){try{logger[_0x7a0e('0x6')](_0x7a0e('0xd'));var _0x5d1327=moment()[_0x7a0e('0xe')]();var _0x3caa4e=_0x3bb68f(_0x5d1327+_0x181242+_0xa8ea40);_0x1833fc[_0x7a0e('0xf')](JSON[_0x7a0e('0x10')]({'appID':_0x181242,'timestamp':_0x5d1327,'appKey':_0x3caa4e}));var _0x5db011=fs['createReadStream'](_0x30f6ee);_0x5db011['on'](_0x7a0e('0x11'),function(_0x1ff78b){_0x1833fc['send'](_0x1ff78b);});_0x5db011['on']('close',function(){_0x1833fc[_0x7a0e('0xf')](_0x7a0e('0x12'));});}catch(_0x1a444c){logger[_0x7a0e('0x13')](_0x7a0e('0x14'),JSON[_0x7a0e('0x10')](_0x1a444c));_0x1833fc[_0x7a0e('0x15')]();}}function _0x29a136(_0x4c4f18){try{if(_0x4c4f18){var _0x4dd87c=JSON[_0x7a0e('0x16')](_0x4c4f18);switch(_0x4dd87c['status']){case 0x0:if(_0x4dd87c[_0x7a0e('0x17')]){if(_0x4dd87c['result']['final']){logger['info'](_0x7a0e('0x18'),JSON[_0x7a0e('0x10')](_0x4dd87c[_0x7a0e('0x17')][_0x7a0e('0x19')]));_0x185262=_0x4dd87c[_0x7a0e('0x17')]['hypotheses'][0x0][_0x7a0e('0x1a')];_0x19b236=_0x4dd87c['result'][_0x7a0e('0x19')][0x0][_0x7a0e('0x1b')];_0x1e3d22='0';_0x46826e=_0x7a0e('0x1c');_0x1833fc[_0x7a0e('0x15')]();}}break;case 0x1:logger[_0x7a0e('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1e3d22='1';_0x46826e=_0x7a0e('0x8');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x1e3d22='2';_0x46826e='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x7a0e('0x6')](_0x7a0e('0x1d'));_0x1e3d22='9';_0x46826e='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x7a0e('0x6')](_0x7a0e('0x1e'));_0x1e3d22='10';_0x46826e=_0x7a0e('0x1e');break;case 0xb:logger[_0x7a0e('0x6')](_0x7a0e('0x1f'));_0x1e3d22='11';_0x46826e=_0x7a0e('0x1f');}}}catch(_0x97b4f9){logger['error'](_0x7a0e('0x20'),JSON['stringify'](_0x97b4f9));_0x1833fc[_0x7a0e('0x15')]();}}function _0x53f3ef(){logger[_0x7a0e('0x6')](_0x7a0e('0x21'));_0x7ee6a1({'transcript':_0x185262,'confidence':_0x19b236,'status':_0x1e3d22,'status_message':_0x46826e});}function _0x3d5873(_0x5566f4){logger[_0x7a0e('0x13')](_0x7a0e('0x22'));if(!_[_0x7a0e('0x23')](_0x5566f4)){logger[_0x7a0e('0x13')](_[_0x7a0e('0x24')](_0x5566f4)?JSON[_0x7a0e('0x10')](_0x5566f4):_0x5566f4);}}_0x1833fc['on'](_0x7a0e('0x25'),_0x35c09b);_0x1833fc['on']('message',_0x29a136);_0x1833fc['on']('close',_0x53f3ef);_0x1833fc['on']('error',_0x3d5873);});}; \ 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 295116a..da75d5e 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 _0xb0d1=['./asr','exports'];(function(_0xe633be,_0x33e86d){var _0x4083c1=function(_0x4f6aa2){while(--_0x4f6aa2){_0xe633be['push'](_0xe633be['shift']());}};_0x4083c1(++_0x33e86d);}(_0xb0d1,0x1c0));var _0x1b0d=function(_0x57d629,_0x55926e){_0x57d629=_0x57d629-0x0;var _0x4f2b10=_0xb0d1[_0x57d629];return _0x4f2b10;};var asr=require(_0x1b0d('0x0'));module[_0x1b0d('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3746=['exports','./asr'];(function(_0x29c91c,_0x4c861c){var _0x3ec2b8=function(_0x107828){while(--_0x107828){_0x29c91c['push'](_0x29c91c['shift']());}};_0x3ec2b8(++_0x4c861c);}(_0x3746,0x17f));var _0x6374=function(_0x335702,_0x590282){_0x335702=_0x335702-0x0;var _0x1421b5=_0x3746[_0x335702];return _0x1421b5;};var asr=require(_0x6374('0x0'));module[_0x6374('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index ccbe411..7da7159 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 _0xfdb0=['listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','connection','close','E_AGI_SERVER_CLOSE','nextTick','exports','events','EventEmitter','./error','./channel','127.0.0.1','emit'];(function(_0x4e891c,_0x56cab9){var _0x55610f=function(_0x14503f){while(--_0x14503f){_0x4e891c['push'](_0x4e891c['shift']());}};_0x55610f(++_0x56cab9);}(_0xfdb0,0x8a));var _0x0fdb=function(_0x29d20c,_0x5940b2){_0x29d20c=_0x29d20c-0x0;var _0x494215=_0xfdb0[_0x29d20c];return _0x494215;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x0fdb('0x0'))[_0x0fdb('0x1')];var AGIError=require(_0x0fdb('0x2'));var AGIChannel=require(_0x0fdb('0x3'));var AGIServer=function(_0x20c0f5,_0x2d2f2d,_0x150504){var _0x4b959a=this,_0x20c0f5=_0x20c0f5||0x11dd,_0x2d2f2d=_0x2d2f2d||_0x0fdb('0x4'),_0x5322ad=null,_0x349aaf=0x0;EventEmitter['call'](_0x4b959a);function _0x3c655c(){if(!_0x20c0f5){_0x4b959a['emit']('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x5322ad=net['createServer']();_0x5322ad['listen'](_0x20c0f5,_0x2d2f2d);_0x5322ad['on']('listening',function(){_0x4b959a[_0x0fdb('0x5')](_0x0fdb('0x6'));});_0x5322ad['on']('connection',function(_0x47d11e){_0x5322ad[_0x0fdb('0x7')](function(_0x53cb8f,_0x4721b0){if(_0x53cb8f){_0x4b959a[_0x0fdb('0x5')](_0x0fdb('0x8'),new AGIError(_0x0fdb('0x9'),_0x53cb8f));}else if(_0x150504&&_0x150504<0x0){_0x4b959a[_0x0fdb('0x5')](_0x0fdb('0x8'),new AGIError(_0x0fdb('0xa')));_0x47d11e[_0x0fdb('0xb')]();}else if(_0x150504&&_0x150504>0x0&&_0x150504<_0x4721b0){_0x349aaf+=0x1;_0x4b959a['emit'](_0x0fdb('0x8'),new AGIError(_0x0fdb('0xc'),_0x349aaf));_0x47d11e[_0x0fdb('0xb')]();}else{var _0xb93d5d=new AGIChannel(_0x47d11e);_0xb93d5d['on']('ready',function(){_0x4b959a[_0x0fdb('0x5')](_0x0fdb('0xd'),_0xb93d5d);});}});});_0x5322ad['on'](_0x0fdb('0x8'),function(_0x168470){_0x4b959a[_0x0fdb('0x5')]('error',new AGIError(_0x0fdb('0x9'),_0x168470['code']));});_0x5322ad['on'](_0x0fdb('0xe'),function(){_0x4b959a[_0x0fdb('0x5')](_0x0fdb('0xe'),new AGIError(_0x0fdb('0xf')));});}process[_0x0fdb('0x10')](function(){_0x3c655c();});};util['inherits'](AGIServer,EventEmitter);module[_0x0fdb('0x11')]=function(_0xf49e83,_0x21395d,_0x22a9c6){return new AGIServer(_0xf49e83,_0x21395d,_0x22a9c6);}; \ No newline at end of file +var _0x664d=['listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','util','net','events','EventEmitter','./error','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT'];(function(_0x22af17,_0x164baf){var _0x2acd55=function(_0x5c1a23){while(--_0x5c1a23){_0x22af17['push'](_0x22af17['shift']());}};_0x2acd55(++_0x164baf);}(_0x664d,0x83));var _0xd664=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x664d[_0x27e811];return _0x1627fa;};'use strict';var util=require(_0xd664('0x0'));var net=require(_0xd664('0x1'));var EventEmitter=require(_0xd664('0x2'))[_0xd664('0x3')];var AGIError=require(_0xd664('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x63d71c,_0x3ec261,_0x390177){var _0x147c9f=this,_0x63d71c=_0x63d71c||0x11dd,_0x3ec261=_0x3ec261||_0xd664('0x5'),_0x1506b4=null,_0x3a5dd9=0x0;EventEmitter[_0xd664('0x6')](_0x147c9f);function _0x4bbfd1(){if(!_0x63d71c){_0x147c9f[_0xd664('0x7')]('error',new AGIError(_0xd664('0x8')));return![];}_0x1506b4=net['createServer']();_0x1506b4[_0xd664('0x9')](_0x63d71c,_0x3ec261);_0x1506b4['on'](_0xd664('0xa'),function(){_0x147c9f[_0xd664('0x7')](_0xd664('0xa'));});_0x1506b4['on'](_0xd664('0xb'),function(_0x26a1ba){_0x1506b4[_0xd664('0xc')](function(_0x476a11,_0x424d5b){if(_0x476a11){_0x147c9f['emit'](_0xd664('0xd'),new AGIError(_0xd664('0xe'),_0x476a11));}else if(_0x390177&&_0x390177<0x0){_0x147c9f[_0xd664('0x7')](_0xd664('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x26a1ba[_0xd664('0xf')]();}else if(_0x390177&&_0x390177>0x0&&_0x390177<_0x424d5b){_0x3a5dd9+=0x1;_0x147c9f[_0xd664('0x7')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x3a5dd9));_0x26a1ba[_0xd664('0xf')]();}else{var _0x989b3b=new AGIChannel(_0x26a1ba);_0x989b3b['on'](_0xd664('0x10'),function(){_0x147c9f[_0xd664('0x7')](_0xd664('0xb'),_0x989b3b);});}});});_0x1506b4['on']('error',function(_0x5e6cd1){_0x147c9f[_0xd664('0x7')](_0xd664('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x5e6cd1['code']));});_0x1506b4['on'](_0xd664('0x11'),function(){_0x147c9f[_0xd664('0x7')](_0xd664('0x11'),new AGIError(_0xd664('0x12')));});}process[_0xd664('0x13')](function(){_0x4bbfd1();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x30dc3f,_0x147f64,_0x2ee0bf){return new AGIServer(_0x30dc3f,_0x147f64,_0x2ee0bf);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 9540e07..4c7c998 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 _0x1939=['file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%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','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','\x22%s\x22\x20<%s>','Smtp','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','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','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','streamFile','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','rpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','map','Intervals','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','context','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','isPlainObject','format','%s.%s','length','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','retry','label','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block'];(function(_0x3c184d,_0x3015b0){var _0x3f5ff2=function(_0x544854){while(--_0x544854){_0x3c184d['push'](_0x3c184d['shift']());}};_0x3f5ff2(++_0x3015b0);}(_0x1939,0xbf));var _0x9193=function(_0x419bb9,_0x247ffa){_0x419bb9=_0x419bb9-0x0;var _0x594006=_0x1939[_0x419bb9];return _0x594006;};'use strict';var fs=require('fs');var path=require(_0x9193('0x0'));var util=require(_0x9193('0x1'));var _=require(_0x9193('0x2'));var sh=require('shelljs');var odbc=require(_0x9193('0x3'))();var rs=require('randomstring');var moment=require(_0x9193('0x4'));var Mustache=require(_0x9193('0x5'));var rp=require(_0x9193('0x6'));var logger=require(_0x9193('0x7'))(_0x9193('0x8'));var config=require(_0x9193('0x9'));var scripts=require(_0x9193('0xa'));var FILES_PATH=_0x9193('0xb');var recursiveMapAttributes=['rawHeaders',_0x9193('0xc')];var verticesWithRetry=[_0x9193('0xd'),_0x9193('0xe'),'getsecretdigits'];var AGIVertices=function(_0x2acf29,_0x2946d4,_0x426599){this[_0x9193('0xf')]=_0x2acf29;this[_0x9193('0x10')]=_0x2946d4;this['mailRpc']=_0x426599;};AGIVertices[_0x9193('0x11')][_0x9193('0x12')]=function(_0x396334,_0x438b39){this[_0x9193('0x10')][_0x9193('0x13')](_0x396334)['then'](function(_0x587234){_0x438b39(null,_0x587234?_0x587234[_0x9193('0x14')]:![]);})[_0x9193('0x15')](function(_0x22e821){_0x438b39(_0x22e821);});};AGIVertices[_0x9193('0x11')][_0x9193('0x16')]=function(_0x2d6466,_0x400579){this[_0x9193('0x10')][_0x9193('0x17')](_0x2d6466)[_0x9193('0x18')](function(_0x233cb4){_0x400579(null,_0x233cb4?_0x233cb4[_0x9193('0x14')]:![]);})[_0x9193('0x15')](function(_0x2b0ff3){_0x400579(_0x2b0ff3);});};AGIVertices[_0x9193('0x11')][_0x9193('0x19')]=function(_0x23894e,_0x36d911){this[_0x9193('0x10')][_0x9193('0x1a')](_0x23894e)[_0x9193('0x18')](function(_0x49eb4c){_0x36d911(null,_0x49eb4c?_0x49eb4c['name']:![]);})['catch'](function(_0x16d2ef){_0x36d911(_0x16d2ef);});};AGIVertices['prototype'][_0x9193('0x1b')]=function(_0x5389bb,_0x19eaca){this[_0x9193('0x10')]['getSquareOdbcById'](_0x5389bb)[_0x9193('0x18')](function(_0x50782e){_0x19eaca(null,_0x50782e?_0x50782e[_0x9193('0x1c')]:![]);})[_0x9193('0x15')](function(_0x1505c0){_0x19eaca(_0x1505c0);});};AGIVertices['prototype'][_0x9193('0x1d')]=function(_0x4f0942,_0x1ca240){this['rpc'][_0x9193('0x1e')](_0x4f0942)[_0x9193('0x18')](function(_0x21bacc){_0x1ca240(null,_0x21bacc?_0x21bacc[_0x9193('0x14')]:![]);})[_0x9193('0x15')](function(_0x4d0771){_0x1ca240(_0x4d0771);});};AGIVertices[_0x9193('0x11')][_0x9193('0x1f')]=function(_0x5a044b,_0x520752){this[_0x9193('0x10')]['getTrunkById'](_0x5a044b)['then'](function(_0x5d71a8){_0x520752(null,_0x5d71a8?_0x5d71a8[_0x9193('0x14')]:![]);})[_0x9193('0x15')](function(_0x6d2cb2){_0x520752(_0x6d2cb2);});};AGIVertices[_0x9193('0x11')][_0x9193('0x20')]=function(_0x4eb448,_0x45f288){var _0x309904=this;this[_0x9193('0x10')]['getSoundById'](_0x4eb448)[_0x9193('0x18')](function(_0x309441){_0x45f288(null,_0x309441?_0x309904[_0x9193('0x21')](_0x309441[_0x9193('0x22')]):![]);})[_0x9193('0x15')](function(_0x173ca5){_0x45f288(_0x173ca5);});};AGIVertices['prototype'][_0x9193('0x23')]=function(_0x230dce,_0x3c7538){this['rpc'][_0x9193('0x24')](_0x230dce)[_0x9193('0x18')](function(_0x3dfe69){_0x3c7538(null,_0x3dfe69?_0x3dfe69:![]);})[_0x9193('0x15')](function(_0x11ac6a){_0x3c7538(_0x11ac6a);});};AGIVertices[_0x9193('0x11')][_0x9193('0x25')]=function(_0x35546d,_0x147076,_0x54cd39){this[_0x9193('0x26')][_0x9193('0x25')](_0x35546d,_0x147076)[_0x9193('0x18')](function(){_0x54cd39(null);})[_0x9193('0x15')](function(_0x14aff9){_0x54cd39(_0x14aff9);});};AGIVertices[_0x9193('0x11')][_0x9193('0x27')]=function(_0x244a23,_0x19025a){this[_0x9193('0x10')][_0x9193('0x28')](_0x244a23)[_0x9193('0x18')](function(_0x1729c2){if(_0x1729c2){if(_0x1729c2['IntervalId']){_0x19025a(null,[_0x1729c2['interval']]);}else{_0x19025a(null,_[_0x9193('0x29')](_0x1729c2[_0x9193('0x2a')],'interval'));}}else{_0x19025a(null,![]);}})[_0x9193('0x15')](function(_0x4e35d3){_0x19025a(_0x4e35d3);});};AGIVertices[_0x9193('0x11')][_0x9193('0x21')]=function(_0x1ee13f){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x1ee13f);};AGIVertices[_0x9193('0x11')][_0x9193('0x2b')]=function(_0x107bf0,_0x26f2bc,_0x345c92){odbc[_0x9193('0x2c')](_0x107bf0,function(_0x40560e){if(_0x40560e){logger[_0x9193('0x2d')](_0x9193('0x2e'),_0x40560e);_0x345c92(_0x40560e);}else{logger[_0x9193('0x2f')](_0x9193('0x30'));odbc['query'](_0x26f2bc,function(_0x5d9b2f,_0x21ab9e){if(_0x5d9b2f){logger[_0x9193('0x2f')](_0x9193('0x31'),_0x26f2bc);_0x345c92(_0x5d9b2f);}else{logger[_0x9193('0x2f')](_0x9193('0x32'),_0x26f2bc);odbc['close'](function(_0x38ed91){if(_0x38ed91){logger['error'](_0x9193('0x33'),_0x38ed91);}_0x345c92(null,_0x21ab9e);});}});}});};AGIVertices['prototype'][_0x9193('0x34')]=function(_0x4e790f,_0x8a9641){this['rpc'][_0x9193('0x35')](_0x4e790f)[_0x9193('0x18')](function(_0x263ff8){_0x8a9641(null,_0x263ff8?_0x263ff8:![]);})[_0x9193('0x15')](function(_0x11b9ef){_0x8a9641(_0x11b9ef);});};AGIVertices[_0x9193('0x11')][_0x9193('0x36')]=function(_0x1e3723,_0x56713){this[_0x9193('0x10')][_0x9193('0x36')](_0x1e3723)[_0x9193('0x18')](function(_0x5b9be2){_0x56713(null,_0x5b9be2);})[_0x9193('0x15')](function(_0x44c1e0){_0x56713(_0x44c1e0);});};AGIVertices[_0x9193('0x11')][_0x9193('0x37')]=function(_0x29e812,_0x25c317,_0x4567ab){this[_0x9193('0x10')][_0x9193('0x37')]({'uniqueid':this[_0x9193('0xf')][_0x9193('0x38')],'node':_0x29e812['label'],'application':_0x29e812[_0x9193('0x39')],'data':_0x25c317||null,'project_name':this['channel'][_0x9193('0x3a')],'callerid':this[_0x9193('0xf')][_0x9193('0x3b')]})[_0x9193('0x18')](function(_0x3e3eb8){if(_0x4567ab){_0x4567ab(null,_0x3e3eb8);}})[_0x9193('0x15')](function(_0x2db0de){if(_0x4567ab){_0x4567ab(_0x2db0de);}});};AGIVertices[_0x9193('0x11')][_0x9193('0x3c')]=function(_0xb116e2,_0x4bc2e6,_0x47cdd3,_0x2b1e97){this[_0x9193('0x10')]['createSquareRecording']({'uniqueid':this[_0x9193('0xf')]['uniqueid'],'callerid':this[_0x9193('0xf')][_0x9193('0x3b')],'calleridname':this[_0x9193('0xf')]['calleridname'],'context':this[_0x9193('0xf')][_0x9193('0x3d')],'extension':this['channel'][_0x9193('0x3e')],'priority':this[_0x9193('0xf')]['priority'],'accountcode':this[_0x9193('0xf')]['accountcode'],'dnid':this[_0x9193('0xf')][_0x9193('0x3f')],'projectName':this[_0x9193('0xf')][_0x9193('0x3a')],'saveName':_0x4bc2e6,'filename':_0xb116e2[_0x9193('0x40')]||_0x4bc2e6,'savePath':_0x47cdd3})[_0x9193('0x18')](function(_0xc3ab77){_0x2b1e97(null,_0xc3ab77);})[_0x9193('0x15')](function(_0x13820b){_0x2b1e97(_0x13820b);});};AGIVertices['prototype'][_0x9193('0x41')]=function(_0x154706,_0x1d5082,_0x1e8f7f,_0x3f57ac,_0x1ee811){this[_0x9193('0x10')][_0x9193('0x41')]({'uniqueid':this[_0x9193('0xf')][_0x9193('0x38')],'body':_0x154706,'direction':_0x1d5082,'providerName':_0x1e8f7f,'providerResponse':_0x3f57ac})[_0x9193('0x18')](function(_0x4809af){if(_0x1ee811){_0x1ee811(null,_0x4809af);}})[_0x9193('0x15')](function(_0x438832){if(_0x1ee811){_0x1ee811(_0x438832);}});};AGIVertices[_0x9193('0x11')][_0x9193('0x42')]=function(_0x2be403,_0x1659ba){this[_0x9193('0x10')][_0x9193('0x42')]({'firstName':_[_0x9193('0x43')](_0x2be403['name'])||_[_0x9193('0x44')](_0x2be403[_0x9193('0x14')])?_0x9193('0x45')+Math[_0x9193('0x46')]():_0x2be403[_0x9193('0x14')],'lastName':_[_0x9193('0x43')](_0x2be403[_0x9193('0x47')])||_[_0x9193('0x44')](_0x2be403[_0x9193('0x47')])?null:_0x2be403[_0x9193('0x47')],'phone':_0x2be403['phone'],'ListId':_0x2be403[_0x9193('0x48')],'scheduledat':_0x2be403[_0x9193('0x49')],'callbackUniqueid':this[_0x9193('0xf')][_0x9193('0x38')],'tags':'callback','description':_0x9193('0x4a')+_0x2be403['scheduledAt'][_0x9193('0x4b')](),'priority':_0x2be403['callback_priority']})[_0x9193('0x18')](function(_0x5314f0){_0x1659ba(null,_0x5314f0);})[_0x9193('0x15')](function(_0x2b1544){_0x1659ba(_0x2b1544);});};AGIVertices[_0x9193('0x11')]['getPause']=function(_0xd356b0,_0x1840eb){this[_0x9193('0x10')][_0x9193('0x4c')](_0xd356b0)[_0x9193('0x18')](function(_0x337306){_0x1840eb(null,_0x337306?_0x337306[_0x9193('0x14')]:![]);})[_0x9193('0x15')](function(_0x504ac8){_0x1840eb(_0x504ac8);});};AGIVertices[_0x9193('0x11')]['agentPause']=function(_0x53f04e,_0xc67583,_0x76ad8b){var _0x414180={'role':_0x9193('0x4d')};_0x414180[_0x53f04e]=this[_0x9193('0xf')][_0x9193('0x3b')];this['rpc'][_0x9193('0x4e')](_0x414180,_0xc67583,this['channel'][_0x9193('0x38')])[_0x9193('0x18')](function(_0x5c0502){_0x76ad8b(null,_[_0x9193('0x44')](_0x5c0502)?![]:!![]);})[_0x9193('0x15')](function(_0x1d50de){logger[_0x9193('0x2d')](_0x1d50de);_0x76ad8b(null,![]);});};AGIVertices[_0x9193('0x11')][_0x9193('0x4f')]=function(_0x2e5e6a,_0x4d9e72){var _0x3d592a={'role':_0x9193('0x4d')};_0x3d592a[_0x2e5e6a]=this[_0x9193('0xf')]['callerid'];this[_0x9193('0x10')][_0x9193('0x4f')](_0x3d592a)[_0x9193('0x18')](function(_0x2ac8cc){_0x4d9e72(null,_['isNil'](_0x2ac8cc)?![]:!![]);})[_0x9193('0x15')](function(_0xb7fadf){logger[_0x9193('0x2d')](_0xb7fadf);_0x4d9e72(null,![]);});};AGIVertices[_0x9193('0x11')][_0x9193('0x50')]=function(_0x46d883,_0x5e898f){var _0x18c3f2={'role':_0x9193('0x4d')};_0x18c3f2[_0x46d883]=this[_0x9193('0xf')][_0x9193('0x3b')];this['rpc'][_0x9193('0x50')](_0x18c3f2)[_0x9193('0x18')](function(_0x575cd0){_0x5e898f(null,_[_0x9193('0x44')](_0x575cd0)?![]:!![]);})['catch'](function(_0x34cd66){logger[_0x9193('0x2d')](_0x34cd66);_0x5e898f(null,![]);});};AGIVertices[_0x9193('0x11')][_0x9193('0x51')]=function(_0x25f3e5,_0x5d402e){var _0x4e8914={'role':_0x9193('0x4d')};_0x4e8914[_0x25f3e5]=this['channel']['callerid'];var _0x12962b=_0x25f3e5!='internal'?util['format'](_0x9193('0x52'),'LOCAL',this[_0x9193('0xf')]['callerid']):undefined;this[_0x9193('0x10')]['agentLogin'](_0x4e8914,_0x12962b)[_0x9193('0x18')](function(_0x7cc825){_0x5d402e(null,_[_0x9193('0x44')](_0x7cc825)?![]:!![]);})['catch'](function(_0x3bd9e4){logger['error'](_0x3bd9e4);_0x5d402e(null,![]);});};AGIVertices[_0x9193('0x11')][_0x9193('0x53')]=function(_0x3deb00,_0x22423e){sh[_0x9193('0x54')](_[_0x9193('0x55')](_0x3deb00),function(_0x545304,_0x51b4b7){var _0x484dec=_0x51b4b7[_0x9193('0x56')](/(\r\n|\n|\r)/gm,'');_0x22423e(null,_0x484dec);});};AGIVertices[_0x9193('0x11')][_0x9193('0x57')]=function(_0x195748,_0x41d262){scripts[_0x9193('0x57')](_0x195748[_0x9193('0x58')],_0x195748[_0x9193('0x59')]||'text',_0x195748[_0x9193('0x5a')],_0x195748[_0x9193('0x5b')]||_0x9193('0x5c'),_0x195748[_0x9193('0x5d')]||_0x9193('0x5e'),_0x195748[_0x9193('0x5f')]||_0x9193('0x60'))[_0x9193('0x18')](function(_0x108bc4){_0x41d262(null,_0x108bc4);})['catch'](function(_0xffc95e){_0x41d262(_0xffc95e);});};AGIVertices[_0x9193('0x11')]['googleTTS']=function(_0x59575e,_0x5ab296){scripts[_0x9193('0x61')](_0x59575e['text'],_0x59575e['google_tts_language']||'en',0x1)[_0x9193('0x18')](function(_0x5b2615){_0x5ab296(null,_0x5b2615);})[_0x9193('0x15')](function(_0x5840e2){_0x5ab296(_0x5840e2);});};AGIVertices['prototype'][_0x9193('0x62')]=function(_0x413cc9,_0x589811){var _0x3729a6={'uri':_0x413cc9[_0x9193('0x63')],'method':_0x413cc9[_0x9193('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x413cc9[_0x9193('0x65')])===_0x9193('0x66')&&parseInt(_0x413cc9['timeout'])>=0x1?parseInt(_0x413cc9[_0x9193('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x9193('0x67'),_0x9193('0x68')],_0x3729a6['method'][_0x9193('0x69')]())){try{_0x3729a6[_0x9193('0x6a')]=_0x413cc9['rawBody']?JSON[_0x9193('0x6b')](_0x413cc9[_0x9193('0xc')]):{};}catch(_0x4e07bd){logger['error'](_0x9193('0x6c'),_0x4e07bd);}}try{_0x3729a6[_0x9193('0x6d')]=_0x413cc9['rawHeaders']?JSON[_0x9193('0x6b')](_0x413cc9[_0x9193('0x6e')]):{};}catch(_0x45090d){logger[_0x9193('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x45090d);}if(_0x413cc9[_0x9193('0x6f')]){try{var _0x4f18e2=require(_0x413cc9[_0x9193('0x6f')])['sync'](this,_0x3729a6);_0x3729a6['uri']=Mustache['render'](_0x413cc9['url'],_0x4f18e2,{},['$$','$$']);if(_0x3729a6[_0x9193('0x6d')]){_0x3729a6[_0x9193('0x6d')]=JSON[_0x9193('0x6b')](Mustache[_0x9193('0x70')](JSON['stringify'](_0x3729a6[_0x9193('0x6d')]),_0x4f18e2,{},['$$','$$']));}if(_0x3729a6[_0x9193('0x6a')]){_0x3729a6['body']=JSON[_0x9193('0x6b')](Mustache[_0x9193('0x70')](JSON[_0x9193('0x71')](_0x3729a6[_0x9193('0x6a')]),_0x4f18e2,{},['$$','$$']));}}catch(_0x203e56){logger[_0x9193('0x2d')](_0x9193('0x72'),_0x203e56);}}rp(_0x3729a6)[_0x9193('0x18')](function(_0x2b8ea9){var _0x516de0={'statusCode':_0x2b8ea9[_0x9193('0x73')]||0xc8,'statusMessage':_0x2b8ea9[_0x9193('0x74')]||'OK','headers':_0x2b8ea9[_0x9193('0x6d')]||{},'body':_0x2b8ea9[_0x9193('0x6a')]||{}};_0x589811(null,_0x516de0);})[_0x9193('0x15')](function(_0xde678b){var _0x56a0d3={'statusCode':_0xde678b['statusCode']||0x1f4,'statusMessage':_0xde678b[_0x9193('0x75')]||_0x9193('0x76'),'headers':_0xde678b[_0x9193('0x77')][_0x9193('0x6d')]||{},'body':_0xde678b['options']['body']||{}};_0x589811(null,_0x56a0d3);});};AGIVertices[_0x9193('0x11')][_0x9193('0x78')]=function(_0x5b5e86,_0x43f645){scripts[_0x9193('0x78')](this['channel'][_0x9193('0x38')],_0x5b5e86[_0x9193('0x79')],_0x5b5e86['text'],_0x5b5e86[_0x9193('0x7a')]||'en')[_0x9193('0x18')](function(_0x368364){_0x43f645(null,_0x368364);})[_0x9193('0x15')](function(_0x41768b){_0x43f645(_0x41768b);});};AGIVertices['prototype'][_0x9193('0x7b')]=function(_0x304886,_0x20a48d){scripts[_0x9193('0x7b')](this[_0x9193('0xf')][_0x9193('0x38')],_0x304886[_0x9193('0x7c')],_0x304886['client_email'],_0x304886[_0x9193('0x7d')],_0x304886[_0x9193('0x5a')],_0x304886[_0x9193('0x7e')]||'en')[_0x9193('0x18')](function(_0x2f7656){_0x20a48d(null,_0x2f7656);})['catch'](function(_0x12fcc6){_0x20a48d(_0x12fcc6);});};AGIVertices[_0x9193('0x11')][_0x9193('0x7f')]=function(_0x403836,_0x470d1d){scripts[_0x9193('0x7f')](this[_0x9193('0xf')],_0x403836)[_0x9193('0x18')](function(_0x213deb){_0x470d1d(null,_0x213deb);})[_0x9193('0x15')](function(_0x255e25){_0x470d1d(_0x255e25);});};AGIVertices['prototype'][_0x9193('0x80')]=function(_0x4782ec,_0x449785){scripts['ispeechTTS'](_0x4782ec[_0x9193('0x79')],_0x4782ec['text'],_0x4782ec['ispeech_tts_language']||_0x9193('0x5c'),_0x4782ec[_0x9193('0x81')])[_0x9193('0x18')](function(_0x146211){_0x449785(null,_0x146211);})['catch'](function(_0x27992a){_0x449785(_0x27992a);});};AGIVertices[_0x9193('0x11')][_0x9193('0x82')]=function(_0x470bc9,_0x2b492d,_0x1ea9f6){scripts[_0x9193('0x82')](_0x2b492d,_0x470bc9[_0x9193('0x79')],_0x470bc9[_0x9193('0x83')]||_0x9193('0x5c'),this[_0x9193('0x84')](_0x470bc9['model'])?_0x470bc9[_0x9193('0x85')]:undefined)[_0x9193('0x18')](function(_0x318b30){_0x1ea9f6(null,_0x318b30);})['catch'](function(_0x4118c9){_0x1ea9f6(_0x4118c9);});};AGIVertices[_0x9193('0x11')][_0x9193('0x86')]=function(_0x2facc0,_0x4a2057){scripts['awsPolly'](_0x2facc0[_0x9193('0x87')],_0x2facc0[_0x9193('0x88')],_0x2facc0['aws_polly_region'],_0x2facc0[_0x9193('0x89')]||'Amy',_0x2facc0['text'],_0x2facc0[_0x9193('0x8a')]||'text')[_0x9193('0x18')](function(_0x560500){_0x4a2057(null,_0x560500);})[_0x9193('0x15')](function(_0x21094e){_0x4a2057(_0x21094e);});};AGIVertices['prototype'][_0x9193('0x8b')]=function(_0x2fcbe9,_0x4de3ff){scripts[_0x9193('0x8b')](this['channel'][_0x9193('0x38')],_0x2fcbe9[_0x9193('0x87')],_0x2fcbe9[_0x9193('0x88')],_0x2fcbe9[_0x9193('0x8c')],_0x2fcbe9[_0x9193('0x5a')],_0x2fcbe9['aws_bot_name'])[_0x9193('0x18')](function(_0x56693c){_0x4de3ff(null,_0x56693c);})[_0x9193('0x15')](function(_0x3ba7bd){_0x4de3ff(_0x3ba7bd);});};AGIVertices[_0x9193('0x11')]['googleASR']=function(_0x546afa,_0x5084d1,_0x1ce8a5){scripts[_0x9193('0x8d')](_0x5084d1,_0x546afa[_0x9193('0x79')],_0x546afa[_0x9193('0x8e')]||'en-US')[_0x9193('0x18')](function(_0x114e6b){_0x1ce8a5(null,_0x114e6b);})['catch'](function(_0x12b6ec){_0x1ce8a5(_0x12b6ec);});};AGIVertices['prototype'][_0x9193('0x8f')]=function(_0x47e1a2,_0x405aff,_0x50b984){scripts[_0x9193('0x8f')](_0x405aff,_0x47e1a2[_0x9193('0x90')],_0x47e1a2[_0x9193('0x91')],_0x47e1a2[_0x9193('0x92')])[_0x9193('0x18')](function(_0x108a02){_0x50b984(null,_0x108a02);})[_0x9193('0x15')](function(_0x46a5cb){_0x50b984(_0x46a5cb);});};AGIVertices[_0x9193('0x11')][_0x9193('0x93')]=function(_0x114700){var _0x4dec1a=_[_0x9193('0x94')](verticesWithRetry,_0x114700[_0x9193('0x39')])?_0x114700:_['clone'](_0x114700);for(var _0x319844 in _0x4dec1a){if(_0x4dec1a[_0x9193('0x95')](_0x319844)){if(_0x4dec1a[_0x319844]&&_[_0x9193('0x96')](_0x4dec1a[_0x319844])){if(_[_0x9193('0x94')](recursiveMapAttributes,_0x319844)){_0x4dec1a[_0x319844]=this[_0x9193('0x97')](_0x4dec1a[_0x319844]);}else{_0x4dec1a[_0x319844]=this[_0x9193('0x98')](_0x4dec1a[_0x319844]);}}}}return _0x4dec1a;};AGIVertices[_0x9193('0x11')][_0x9193('0x99')]=function(_0x839ed3){for(var _0x1f2210 in _0x839ed3){if(_0x839ed3[_0x9193('0x95')](_0x1f2210)){if(_['isPlainObject'](_0x839ed3[_0x1f2210])){this[_0x9193('0x99')](_0x839ed3[_0x1f2210]);}else if(_[_0x9193('0x9a')](_0x839ed3[_0x1f2210])){for(var _0x4df970=0x0;_0x4df970<_0x839ed3[_0x1f2210]['length'];_0x4df970++){this[_0x9193('0x99')](_0x839ed3[_0x1f2210][_0x4df970]);}}else if(_[_0x9193('0x96')](_0x839ed3[_0x1f2210])){_0x839ed3[_0x1f2210]=this['replaceAllVariables'](_0x839ed3[_0x1f2210]);}}}};AGIVertices[_0x9193('0x11')][_0x9193('0x9b')]=function(_0x5b4a19,_0x579856){for(var _0x215574 in _0x5b4a19){if(_0x5b4a19['hasOwnProperty'](_0x215574)){if(_[_0x9193('0x9c')](_0x5b4a19[_0x215574])){if(!_[_0x9193('0x43')](_0x5b4a19[_0x215574])){this['saveRestApiResult'](_0x5b4a19[_0x215574],util[_0x9193('0x9d')](_0x9193('0x9e'),_0x579856,_0x215574));}}else if(_[_0x9193('0x9a')](_0x5b4a19[_0x215574])){for(var _0x521777=0x0;_0x521777<_0x5b4a19[_0x215574][_0x9193('0x9f')];_0x521777++){this['saveRestApiResult'](_0x5b4a19[_0x215574][_0x521777],util['format'](_0x9193('0x9e'),_0x579856,_0x215574+'['+_0x521777+']'));}}else{if(!_['isNil'](_0x5b4a19[_0x215574])){this[_0x9193('0xf')][_0x9193('0xa0')](util['format'](_0x9193('0x9e'),_0x579856,_0x215574),_0x5b4a19[_0x215574]);}}}}};AGIVertices[_0x9193('0x11')][_0x9193('0x97')]=function(_0xa215ec){try{var _0x5d41f4=JSON[_0x9193('0x6b')](_0xa215ec);this[_0x9193('0x99')](_0x5d41f4);return JSON['stringify'](_0x5d41f4);}catch(_0x10958d){return this[_0x9193('0x98')](_0xa215ec);}};AGIVertices[_0x9193('0x11')][_0x9193('0x98')]=function(_0x3ab3c2){var _0x25b89b=_0x3ab3c2['split']('{');for(var _0x21eebc=0x1;_0x21eebc<_0x25b89b['length'];_0x21eebc+=0x1){var _0x37960c=_0x25b89b[_0x21eebc][_0x9193('0xa1')]('}');if(_0x37960c['length']>0x1){_0x3ab3c2=_0x3ab3c2[_0x9193('0xa2')]('{'+_0x37960c[0x0]+'}',this[_0x9193('0xf')][_0x9193('0x12')](_0x37960c[0x0])['extra']||_0x37960c[0x0]);}}if(_0x25b89b[_0x9193('0x9f')]===0x1){return _0x3ab3c2['toString']();}return this['replaceAllVariables'](_0x3ab3c2);};AGIVertices[_0x9193('0x11')][_0x9193('0xa3')]=function(_0x394cec,_0x1f130c){var _0xe67e2b=this[_0x9193('0xf')][_0x9193('0x12')](_0x394cec);if(_0xe67e2b[_0x9193('0xa4')]===-0x1){return _0xe67e2b;}logger[_0x9193('0x2f')](util['format'](_0x9193('0xa5'),_0x1f130c,_0xe67e2b[_0x9193('0xa6')]));return this[_0x9193('0xf')]['setVariable'](_0x1f130c,_0xe67e2b[_0x9193('0xa6')]);};AGIVertices['prototype'][_0x9193('0x84')]=function(_0x244c84){return _0x244c84&&_0x244c84!=='0'&&_0x244c84!=='-1'&&_0x244c84!=='';};AGIVertices[_0x9193('0x11')][_0x9193('0xa7')]=function(_0x294270){this['createSquareDetailsReport'][_0x9193('0xa8')](this,_0x294270,'-');_0x294270[_0x9193('0xa9')]=_0x294270[_0x9193('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9193('0x11')]['mrcpsynth']=function(_0x444e65){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x444e65[_0x9193('0xaa')]));if(!this['isConfigured'](_0x444e65['text'])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xac'));}var _0x1559c8='\x22'+_0x444e65[_0x9193('0x5a')]+'\x22';if(this['isConfigured'](_0x444e65[_0x9193('0x77')])){_0x1559c8+=','+_0x444e65[_0x9193('0x77')];}var _0x245d08=this['channel'][_0x9193('0x54')]('MRCPSynth',_0x1559c8);if(_0x245d08[_0x9193('0xa4')]===-0x1){return _0x245d08;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xad'),_0x1559c8));};AGIVertices['prototype'][_0x9193('0xae')]=function(_0x54cfdc){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0xaf'),_0x54cfdc[_0x9193('0xaa')]));if(!this['isConfigured'](_0x54cfdc[_0x9193('0xb0')])){return this['channel'][_0x9193('0xab')]('no\x20grammar\x20configured');}var _0x33ccfa=_0x54cfdc[_0x9193('0xb0')];if(this['isConfigured'](_0x54cfdc[_0x9193('0x77')])){_0x33ccfa+=','+_0x54cfdc[_0x9193('0x77')];}var _0x4ce6e3=this[_0x9193('0xf')][_0x9193('0x54')]('MRCPRecog',_0x33ccfa);if(_0x4ce6e3[_0x9193('0xa4')]===-0x1){return _0x4ce6e3;}var _0x1c7dbc=this[_0x9193('0xa3')](_0x9193('0xb1'),_0x9193('0xb2'));if(_0x1c7dbc[_0x9193('0xa4')]===-0x1){return _0x1c7dbc;}var _0x156296=this['getAndSetVariable'](_0x9193('0xb3'),'MRCP_RECOG_TRANSCRIPT');if(_0x156296[_0x9193('0xa4')]===-0x1){return _0x156296;}var _0x240bc0=this[_0x9193('0xa3')](_0x9193('0xb4'),_0x9193('0xb5'));if(_0x240bc0['result']===-0x1){return _0x240bc0;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xb6'),_0x33ccfa));};AGIVertices[_0x9193('0x11')]['agi']=function(_0x203cd7){logger[_0x9193('0x2f')](util['format'](_0x9193('0xb7'),_0x203cd7[_0x9193('0xaa')]));return this['channel'][_0x9193('0x8')]([_0x203cd7[_0x9193('0xb8')],_0x203cd7[_0x9193('0xb9')]]);};AGIVertices[_0x9193('0x11')][_0x9193('0xba')]=function(_0xcf8207){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0xbb'),_0xcf8207[_0x9193('0xaa')]));if(this[_0x9193('0x84')](_0xcf8207['timeout'])){logger['info'](util['format'](_0x9193('0xbc'),_0xcf8207[_0x9193('0x65')]));var _0x450270=this[_0x9193('0xf')][_0x9193('0xbd')](_0xcf8207[_0x9193('0x65')]);if(_0x450270[_0x9193('0xa4')]===-0x1){return _0x450270;}}return this[_0x9193('0xf')][_0x9193('0xba')]();};AGIVertices[_0x9193('0x11')][_0x9193('0xbe')]=function(_0x3f4d44){logger[_0x9193('0x2f')](util['format'](_0x9193('0xbf'),_0x3f4d44['label']));if(!this[_0x9193('0x84')](_0x3f4d44[_0x9193('0x48')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3f4d44,_0x9193('0xc0'));}_0x3f4d44[_0x9193('0x49')]=moment();if(this[_0x9193('0x84')](_0x3f4d44['delay'])){_0x3f4d44[_0x9193('0x49')]=moment()[_0x9193('0xc1')](_0x3f4d44[_0x9193('0xc2')],_0x9193('0xc3'));}if(!this[_0x9193('0x84')](_0x3f4d44[_0x9193('0xc4')])){_0x3f4d44[_0x9193('0xc4')]=0x2;}this[_0x9193('0x42')][_0x9193('0xa8')](this,_0x3f4d44);return this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0xc5'),_0x3f4d44[_0x9193('0xc6')],_0x3f4d44[_0x9193('0x48')],_0x3f4d44[_0x9193('0x49')]));};AGIVertices[_0x9193('0x11')][_0x9193('0xc7')]=function(_0x8dd568){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x8dd568[_0x9193('0xaa')]));var _0x2bce08=this[_0x9193('0xf')][_0x9193('0x54')](_0x8dd568[_0x9193('0xc8')],_0x8dd568[_0x9193('0x77')]);if(_0x2bce08[_0x9193('0xa4')]===-0x1){return _0x2bce08;}return this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0xc9'),_0x8dd568[_0x9193('0xc8')],_0x8dd568[_0x9193('0x77')]));};AGIVertices[_0x9193('0x11')][_0x9193('0xca')]=function(_0x3e3a11){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0xcb'),_0x3e3a11['label']));if(!this[_0x9193('0x84')](_0x3e3a11[_0x9193('0x5a')])){return this[_0x9193('0xf')]['noop'](_0x9193('0xac'));}var _0x218223='\x22'+_0x3e3a11['text']+'\x22';if(this[_0x9193('0x84')](_0x3e3a11[_0x9193('0x77')])){_0x218223+=','+_0x3e3a11[_0x9193('0x77')];}var _0xbd9b85=this[_0x9193('0xf')]['exec']('MRCPSynth',_0x218223);if(_0xbd9b85[_0x9193('0xa4')]===-0x1){return _0xbd9b85;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xad'),_0x218223));};AGIVertices[_0x9193('0x11')][_0x9193('0xcc')]=function(_0x788f9f){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0xcd'),_0x788f9f[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x788f9f[_0x9193('0x5a')])){return this[_0x9193('0xf')]['noop'](_0x9193('0xac'));}var _0x287559='\x22'+_0x788f9f['text']+'\x22';if(this['isConfigured'](_0x788f9f[_0x9193('0x77')])){_0x287559+=','+_0x788f9f[_0x9193('0x77')];}var _0xfab8a5=this[_0x9193('0xf')][_0x9193('0x54')](_0x9193('0xce'),_0x287559);if(_0xfab8a5['result']===-0x1){return _0xfab8a5;}return this[_0x9193('0xf')]['noop'](util[_0x9193('0x9d')](_0x9193('0xad'),_0x287559));};AGIVertices[_0x9193('0x11')][_0x9193('0xcf')]=function(_0x40d184){logger['info'](util[_0x9193('0x9d')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x40d184[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x40d184[_0x9193('0xb0')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xd0'));}var _0x542892=_0x40d184['grammar'];if(this[_0x9193('0x84')](_0x40d184[_0x9193('0x77')])){_0x542892+=','+_0x40d184[_0x9193('0x77')];}var _0x520830=this[_0x9193('0xf')][_0x9193('0x54')](_0x9193('0xd1'),_0x542892);if(_0x520830[_0x9193('0xa4')]===-0x1){return _0x520830;}var _0x2d777f=this[_0x9193('0xa3')](_0x9193('0xb1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x2d777f[_0x9193('0xa4')]===-0x1){return _0x2d777f;}var _0x22e439=this[_0x9193('0xa3')]('RECOG_INPUT()',_0x9193('0xd2'));if(_0x22e439[_0x9193('0xa4')]===-0x1){return _0x22e439;}var _0x4e9fdc=this[_0x9193('0xa3')](_0x9193('0xb4'),'LUMENVOX_ASR_INSTANCE');if(_0x4e9fdc[_0x9193('0xa4')]===-0x1){return _0x4e9fdc;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xb6'),_0x542892));};AGIVertices['prototype'][_0x9193('0xd3')]=function(_0x74b855){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0xd4'),_0x74b855[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x74b855['grammar'])){return this[_0x9193('0xf')]['noop'](_0x9193('0xd0'));}var _0x39b8c8=_0x74b855['grammar'];if(this['isConfigured'](_0x74b855[_0x9193('0x77')])){_0x39b8c8+=','+_0x74b855[_0x9193('0x77')];}var _0x3cf13b=this[_0x9193('0xf')]['exec'](_0x9193('0xd1'),_0x39b8c8);if(_0x3cf13b['result']===-0x1){return _0x3cf13b;}var _0x44a172=this[_0x9193('0xa3')](_0x9193('0xb1'),'SESTEK_ASR_CONFIDENCE');if(_0x44a172['result']===-0x1){return _0x44a172;}var _0x2c8007=this[_0x9193('0xa3')](_0x9193('0xb3'),_0x9193('0xd5'));if(_0x2c8007[_0x9193('0xa4')]===-0x1){return _0x2c8007;}var _0x32e7f3=this[_0x9193('0xa3')]('RECOG_INSTANCE()',_0x9193('0xd6'));if(_0x32e7f3[_0x9193('0xa4')]===-0x1){return _0x32e7f3;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xb6'),_0x39b8c8));};AGIVertices[_0x9193('0x11')][_0x9193('0xd7')]=function(_0x3f62eb){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3f62eb[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x3f62eb[_0x9193('0xd8')])){return this['channel'][_0x9193('0x2d')](_0x3f62eb,'no\x20database\x20selected');}var _0x56e3ae=this[_0x9193('0x1b')][_0x9193('0xa8')](this,_0x3f62eb[_0x9193('0xd8')]);if(!_0x56e3ae){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3f62eb,_0x9193('0xd9'));}if(!this[_0x9193('0x84')](_0x3f62eb['query'])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3f62eb,_0x9193('0xda'));}var _0x15c1e0=_0x3f62eb[_0x9193('0xdb')][_0x9193('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0xdc'),_0x15c1e0));var _0x3d47ba=this['getQueryOdbc'][_0x9193('0xa8')](this,_0x56e3ae,_0x15c1e0);this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x3f62eb,_0x15c1e0);if(!this[_0x9193('0x84')](_0x3f62eb['variable_id'])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1f9cf3=this[_0x9193('0x12')][_0x9193('0xa8')](this,_0x3f62eb[_0x9193('0xdd')]);if(!_0x1f9cf3){return this['channel'][_0x9193('0x2d')](_0x3f62eb,_0x9193('0xde'));}var _0x326c5a=this;_0x3d47ba[_0x9193('0xdf')](function(_0xbddaae,_0x5570e2){Object[_0x9193('0xe0')](_0xbddaae)[_0x9193('0xdf')](function(_0x52fe55){_0x326c5a[_0x9193('0xf')][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0xe1'),_0x1f9cf3,_0x5570e2,_0x52fe55),_0xbddaae[_0x52fe55]);});});this[_0x9193('0xf')]['setVariable'](util[_0x9193('0x9d')](_0x9193('0xe2'),_0x1f9cf3),_0x3d47ba['length']);return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('variable\x20%s\x20set',_0x1f9cf3));};AGIVertices['prototype'][_0x9193('0xe3')]=function(_0xee3029){logger[_0x9193('0xe4')](util[_0x9193('0x9d')](_0x9193('0xe5'),_0xee3029[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0xee3029[_0x9193('0xe6')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0xee3029,_0x9193('0xe7'));}var _0x266234=this['getUser'][_0x9193('0xa8')](this,_0xee3029['sip_id']);if(!_0x266234){return this[_0x9193('0xf')][_0x9193('0x2d')](_0xee3029,_0x9193('0xe8'));}var _0x55e459=this[_0x9193('0xf')][_0x9193('0x54')](_0x9193('0xe9'),[util[_0x9193('0x9d')]('SIP/%s',_0x266234),_0xee3029[_0x9193('0x65')],_0xee3029[_0x9193('0xea')],_0xee3029[_0x9193('0x63')]]);if(_0x55e459[_0x9193('0xa4')]===-0x1){return _0x55e459;}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xeb'),_0x9193('0xe9')));};AGIVertices['prototype']['dialogflow']=function(_0x1056c1){logger[_0x9193('0x2f')](util['format'](_0x9193('0xec'),_0x1056c1[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x1056c1[_0x9193('0x79')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xed'));}if(!this[_0x9193('0x84')](_0x1056c1[_0x9193('0x5a')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xac'));}this[_0x9193('0xf')][_0x9193('0xee')]=!![];this['createSquareDetailsReport'](_0x1056c1);this[_0x9193('0x41')](_0x1056c1['text'],'in','','');this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')]('Trying\x20Dialogflow:\x20%s',_0x1056c1[_0x9193('0x5a')]));var _0x3cf916=this[_0x9193('0x78')]['sync'](this,_0x1056c1);if(_0x3cf916){for(var _0x16abd8 in _0x3cf916){if(_0x3cf916[_0x9193('0x95')](_0x16abd8)){this[_0x9193('0xf')][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0xef'),_0x16abd8['toUpperCase']()),_0x3cf916[_0x16abd8]);}}this[_0x9193('0x41')](_0x3cf916[_0x9193('0xf0')],_0x9193('0xf1'),_0x9193('0xf2'),'');return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xf3'),_0x3cf916[_0x9193('0xf0')]));}return this['channel'][_0x9193('0x2d')](_0x1056c1,_0x9193('0xf4'));};AGIVertices['prototype'][_0x9193('0xf5')]=function(_0x532388){logger[_0x9193('0x2f')](util['format'](_0x9193('0xf6'),_0x532388[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x532388[_0x9193('0x7c')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xf7'));}if(!this['isConfigured'](_0x532388[_0x9193('0xf8')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xf9'));}if(!this[_0x9193('0x84')](_0x532388[_0x9193('0x7d')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xfa'));}if(!this[_0x9193('0x84')](_0x532388[_0x9193('0x7e')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xfb'));}if(!this[_0x9193('0x84')](_0x532388[_0x9193('0x5a')])){return this['channel']['noop'](_0x9193('0xac'));}this[_0x9193('0xf')][_0x9193('0xee')]=!![];this[_0x9193('0x37')](_0x532388);this[_0x9193('0x41')](_0x532388[_0x9193('0x5a')],'in','','');this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xfc'),_0x532388['text']));var _0x18e5a5=this[_0x9193('0x7b')]['sync'](this,_0x532388);if(_0x18e5a5){for(var _0x335c85 in _0x18e5a5){if(_0x18e5a5[_0x9193('0x95')](_0x335c85)){if(_0x335c85!==_0x9193('0xfd')){this['channel']['setVariable'](util['format'](_0x9193('0xef'),_0x335c85[_0x9193('0x69')]()),_0x18e5a5[_0x335c85]);}}}this[_0x9193('0x41')](_0x18e5a5[_0x9193('0xf0')],_0x9193('0xf1'),_0x9193('0xf5'),_0x18e5a5[_0x9193('0xfd')]);return this[_0x9193('0xf')]['noop'](util[_0x9193('0x9d')](_0x9193('0xfe'),_0x18e5a5['speech']));}return this[_0x9193('0xf')][_0x9193('0x2d')](_0x532388,_0x9193('0xff'));};AGIVertices[_0x9193('0x11')][_0x9193('0x100')]=function(_0x29d047){logger[_0x9193('0x2f')](util['format'](_0x9193('0x101'),_0x29d047['label']));if(!this[_0x9193('0x84')](_0x29d047[_0x9193('0x102')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x9193('0x84')](_0x29d047[_0x9193('0x103')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0x104'));}if(!this[_0x9193('0x84')](_0x29d047[_0x9193('0x105')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0x106'));}if(!this[_0x9193('0x84')](_0x29d047[_0x9193('0x107')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xac'));}this['channel'][_0x9193('0xee')]=!![];this[_0x9193('0x37')](_0x29d047);this['createSquareMessage'](_0x29d047[_0x9193('0x5a')],'in','','');this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('Trying\x20SestekNDA:\x20%s',_0x29d047[_0x9193('0x5a')]));var _0x267ef0=this[_0x9193('0x7f')][_0x9193('0xa8')](this,_0x29d047);if(_0x267ef0){for(var _0x145dcb in _0x267ef0){if(_0x267ef0[_0x9193('0x95')](_0x145dcb)){this['channel']['setVariable'](util['format']('SESTEK_NDA_%s',_0x145dcb[_0x9193('0x69')]()),_0x267ef0[_0x145dcb]);}}this[_0x9193('0x41')](_0x267ef0['speech'],'out',_0x9193('0x100'),'');if(_0x267ef0[_0x9193('0x108')]){this['channel'][_0x9193('0xab')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x267ef0[_0x9193('0x108')]));var _0x5421a6=this['channel']['streamFile'](_0x267ef0[_0x9193('0x108')]);try{fs[_0x9193('0x109')](_0x267ef0[_0x9193('0x108')]+_0x9193('0x10a'));}catch(_0x4d9587){logger[_0x9193('0x2d')](_0x4d9587);}return _0x5421a6;}else{return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x10b'),_0x267ef0[_0x9193('0xf0')]));}}return this[_0x9193('0xf')][_0x9193('0x2d')](_0x29d047,_0x9193('0x10c'));};AGIVertices[_0x9193('0x11')][_0x9193('0x10d')]=function(_0x3437c3){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x10e'),_0x3437c3['label']));return this[_0x9193('0xf')]['noop'](_0x9193('0x10d'));};AGIVertices['prototype']['ext_dial']=function(_0x2f895d){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x10f'),_0x2f895d[_0x9193('0xaa')]));var _0x2ec5d2='';if(_0x2f895d[_0x9193('0x110')]){if(!this[_0x9193('0x84')](_0x2f895d[_0x9193('0x110')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2f895d,'no\x20trunk\x20selected');}else{var _0x125cc3=parseInt(_0x2f895d[_0x9193('0x110')],0xa);if(isNaN(_0x125cc3)){_0x2ec5d2=_0x2f895d[_0x9193('0x110')];}else{_0x2ec5d2=this[_0x9193('0x1f')]['sync'](this,_0x2f895d[_0x9193('0x110')]);if(!_0x2ec5d2){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2f895d,_0x9193('0x111'));}}}}else if(_0x2f895d['trunk_name']){_0x2ec5d2=_0x2f895d[_0x9193('0x112')];}else{return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2f895d,_0x9193('0x113'));}var _0x24974a=this['channel'][_0x9193('0x54')](_0x9193('0xe9'),[util[_0x9193('0x9d')](_0x9193('0x114'),_0x2ec5d2,_0x2f895d['phone']),_0x2f895d[_0x9193('0x65')],_0x2f895d[_0x9193('0xea')],_0x2f895d['url']]);if(_0x24974a[_0x9193('0xa4')]===-0x1){return _0x24974a;}return this[_0x9193('0xf')]['noop'](util['format'](_0x9193('0xeb'),_0x9193('0xe9')));};AGIVertices[_0x9193('0x11')]['finally']=function(_0x19a10c){logger[_0x9193('0x2f')](util['format'](_0x9193('0x115'),_0x19a10c[_0x9193('0xaa')]));return this['channel'][_0x9193('0xab')](_0x9193('0x116'));};AGIVertices[_0x9193('0x11')][_0x9193('0xe')]=function(_0x539198){logger['info'](util['format'](_0x9193('0x117'),_0x539198['label']));if(_0x539198['retry']===0x0){return this['maxRetry'](_0x539198);}_0x539198[_0x9193('0xa9')]-=0x1;if(!this[_0x9193('0x84')](_0x539198[_0x9193('0x118')])){return this[_0x9193('0xf')]['error'](_0x539198,_0x9193('0x119'));}var _0x142bd2=this[_0x9193('0x20')][_0x9193('0xa8')](this,_0x539198[_0x9193('0x118')]);if(!_0x142bd2){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x539198,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x539198[_0x9193('0xdd')])){return this['channel']['error'](_0x9193('0x11a'));}var _0x532dfc=this['channel'][_0x9193('0x11b')](_0x142bd2,_0x539198[_0x9193('0x11c')],_0x539198[_0x9193('0x11d')]);var _0x3d00fd=_0x532dfc[_0x9193('0xa4')]?_0x532dfc['result'][_0x9193('0x4b')]():'';logger[_0x9193('0x2f')]('test',JSON[_0x9193('0x71')](_0x532dfc));if(_0x532dfc[_0x9193('0xa4')]===-0x1){this[_0x9193('0x37')]['sync'](this,_0x539198,_0x3d00fd);return _0x532dfc;}else if(_0x532dfc[_0x9193('0xa6')]==='timeout'){_0x532dfc[_0x9193('0xa4')]=_0x3d00fd[_0x9193('0x9f')]>=parseInt(_0x539198['mindigit'])?'x':'i';}else{_0x532dfc[_0x9193('0xa4')]=_0x3d00fd[_0x9193('0x9f')]>=parseInt(_0x539198[_0x9193('0x11e')])&&_0x3d00fd['length']<=parseInt(_0x539198['maxdigit'])?'x':'i';}var _0x3651ac=this[_0x9193('0x12')][_0x9193('0xa8')](this,_0x539198['variable_id']);if(!_0x3651ac){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x539198,_0x9193('0xde'));}this[_0x9193('0xf')][_0x9193('0xa0')](_0x3651ac,_0x3d00fd);if(this['isConfigured'](_0x539198[_0x9193('0x11f')])){var _0x312a0f=parseInt(_0x539198[_0x9193('0x11f')],0xa);var _0x488a9f=rs[_0x9193('0x120')]({'charset':'*','length':_0x312a0f});var _0x2f3299=_0x3d00fd['length'];if(_0x2f3299>0x0){if(_0x2f3299>_0x312a0f){this['createSquareDetailsReport']['sync'](this,_0x539198,_0x539198[_0x9193('0x121')]==='first'?_0x488a9f+_0x3d00fd[_0x9193('0x122')](_0x312a0f):_0x3d00fd[_0x9193('0x122')](0x0,_0x2f3299-_0x312a0f)+_0x488a9f);}else{this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x539198,rs['generate']({'charset':'*','length':_0x2f3299}));}}else{this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x539198,'');}}else{this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x539198,_0x3d00fd);}return _0x532dfc;};AGIVertices['prototype'][_0x9193('0x123')]=function(_0x2f6a7c){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x124'),_0x2f6a7c[_0x9193('0xaa')]));return this[_0x9193('0xe')](_0x2f6a7c);};AGIVertices[_0x9193('0x11')][_0x9193('0x125')]=function(_0x322808){logger[_0x9193('0x2f')](util['format'](_0x9193('0x126'),_0x322808[_0x9193('0xaa')]));this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x322808,_0x322808[_0x9193('0x127')]);return this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x128'),_0x322808[_0x9193('0x127')]));};AGIVertices[_0x9193('0x11')]['awspolly']=function(_0x1610ba){logger['info'](util['format'](_0x9193('0x129'),_0x1610ba['label']));if(!this[_0x9193('0x84')](_0x1610ba[_0x9193('0x87')])||!this[_0x9193('0x84')](_0x1610ba['aws_secret_access_key'])){return this[_0x9193('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x9193('0x84')](_0x1610ba[_0x9193('0x5a')])){return this[_0x9193('0xf')]['noop'](_0x9193('0xac'));}this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x12a'),_0x1610ba['text']));var _0x51de74=this[_0x9193('0x86')]['sync'](this,_0x1610ba);if(_0x51de74){this['channel']['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x51de74));var _0x1db94f=this[_0x9193('0xf')]['streamFile'](_0x51de74);try{fs['unlink'](_0x51de74+'.wav');}catch(_0x2ae2ab){logger[_0x9193('0x2d')](_0x2ae2ab);}return _0x1db94f;}return this[_0x9193('0xf')][_0x9193('0x2d')](_0x1610ba,_0x9193('0x12b'));};AGIVertices[_0x9193('0x11')][_0x9193('0x12c')]=function(_0x48f24c){logger[_0x9193('0x2f')](util['format'](_0x9193('0x12d'),_0x48f24c['label']));if(!this[_0x9193('0x84')](_0x48f24c[_0x9193('0x87')])||!this['isConfigured'](_0x48f24c[_0x9193('0x88')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x9193('0x84')](_0x48f24c[_0x9193('0x12e')])){return this[_0x9193('0xf')]['noop'](_0x9193('0x12f'));}if(!this[_0x9193('0x84')](_0x48f24c[_0x9193('0x5a')])){return this['channel'][_0x9193('0xab')]('no\x20text\x20configured');}this[_0x9193('0xf')][_0x9193('0xee')]=!![];this[_0x9193('0x37')](_0x48f24c);this['createSquareMessage'](_0x48f24c[_0x9193('0x5a')],'in','','');this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x130'),_0x48f24c[_0x9193('0x5a')]));var _0x4b4318=this[_0x9193('0x8b')][_0x9193('0xa8')](this,_0x48f24c);if(_0x4b4318){for(var _0x36fd13 in _0x4b4318){if(_0x4b4318[_0x9193('0x95')](_0x36fd13)&&_[_0x9193('0x96')](_0x4b4318[_0x36fd13])){this['channel'][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0x131'),_0x36fd13[_0x9193('0x69')]()),_0x4b4318[_0x36fd13]);}}if(_[_0x9193('0x44')](_0x4b4318[_0x9193('0x75')])){return this[_0x9193('0xf')][_0x9193('0xab')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x9193('0x41')](_0x4b4318['message'],'out','amazonlex','');return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x132'),_0x4b4318[_0x9193('0x75')]));}}return this[_0x9193('0xf')][_0x9193('0x2d')](_0x48f24c,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9193('0x11')][_0x9193('0x133')]=function(_0x2bdf52){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x134'),_0x2bdf52['label'],_0x2bdf52[_0x9193('0x65')]));if(!this[_0x9193('0x84')](_0x2bdf52[_0x9193('0x79')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0xed'));}var _0x139bfe=_0x9193('0x135');var _0x1b0965=util[_0x9193('0x9d')](_0x9193('0x136'),FILES_PATH,rs['generate'](0x4));var _0x4ee83a=util[_0x9193('0x9d')](_0x9193('0x9e'),_0x1b0965,_0x139bfe);var _0x2a85af=!![];if(_0x2bdf52[_0x9193('0x137')]===_0x9193('0x138')){_0x2a85af=![];}var _0x3b3a77=this[_0x9193('0xf')][_0x9193('0x139')](_0x1b0965,_0x139bfe,_0x2bdf52[_0x9193('0x13a')],_0x2bdf52[_0x9193('0x65')],undefined,_0x2a85af);if(_0x3b3a77[_0x9193('0xa4')]!==-0x1){this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x13b'),_0x4ee83a));var _0x14e0fa=this[_0x9193('0x8d')][_0x9193('0xa8')](this,_0x2bdf52,_0x4ee83a);if(_0x14e0fa){for(var _0x312311 in _0x14e0fa){if(_0x14e0fa['hasOwnProperty'](_0x312311)){this[_0x9193('0xf')][_0x9193('0xa0')](util['format'](_0x9193('0x13c'),_0x312311[_0x9193('0x69')]()),_0x14e0fa[_0x312311]);}}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x13d'),JSON[_0x9193('0x71')](_0x14e0fa)));}}return _0x3b3a77;};AGIVertices[_0x9193('0x11')][_0x9193('0x13e')]=function(_0x2235ec){logger[_0x9193('0x2f')](util['format'](_0x9193('0x13f'),_0x2235ec['label']));if(!this['isConfigured'](_0x2235ec[_0x9193('0x90')])){return this[_0x9193('0xf')]['noop']('no\x20appid\x20configured');}if(!this[_0x9193('0x84')](_0x2235ec['appsecret'])){return this['channel'][_0x9193('0xab')](_0x9193('0x140'));}var _0x4a23e6=_0x9193('0x135');var _0x2aa772=util[_0x9193('0x9d')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x1892d5=util[_0x9193('0x9d')]('%s.%s',_0x2aa772,_0x4a23e6);var _0x17ed97=!![];if(_0x2235ec[_0x9193('0x137')]===_0x9193('0x138')){_0x17ed97=![];}var _0x1487b5=this[_0x9193('0xf')][_0x9193('0x139')](_0x2aa772,_0x4a23e6,_0x2235ec['intKey'],_0x2235ec[_0x9193('0x65')],undefined,_0x17ed97);if(_0x1487b5[_0x9193('0xa4')]!==-0x1){this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x141'),_0x1892d5));var _0x5c1e7e=this[_0x9193('0x8f')][_0x9193('0xa8')](this,_0x2235ec,_0x1892d5);if(_0x5c1e7e){for(var _0x306146 in _0x5c1e7e){if(_0x5c1e7e['hasOwnProperty'](_0x306146)){this[_0x9193('0xf')][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0x142'),_0x306146['toUpperCase']()),_0x5c1e7e[_0x306146]);}}return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x143'),JSON[_0x9193('0x71')](_0x5c1e7e)));}}return _0x1487b5;};AGIVertices[_0x9193('0x11')][_0x9193('0x144')]=function(_0x5dd3a2){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x145'),_0x5dd3a2[_0x9193('0xaa')]));return this[_0x9193('0xf')]['continueAt'](_0x5dd3a2[_0x9193('0x3d')],_0x5dd3a2['extension'],_0x5dd3a2[_0x9193('0x146')]);};AGIVertices['prototype'][_0x9193('0x147')]=function(_0x536fca){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x536fca[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x536fca['condition'])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x536fca,_0x9193('0x148'));}try{var _0x357638=eval(_0x536fca['condition'])?_0x9193('0x149'):_0x9193('0x14a');this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x14b'),_0x536fca['condition'],_0x357638));return{'code':0xc8,'result':_0x357638};}catch(_0x12712d){return{'code':0xc8,'result':_0x9193('0x14a')};}};AGIVertices['prototype'][_0x9193('0x14c')]=function(_0x3df026){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3df026['label']));if(!this['isConfigured'](_0x3df026[_0x9193('0x14d')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3df026,_0x9193('0x14e'));}var _0x337662=this['getIntervals'][_0x9193('0xa8')](this,_0x3df026[_0x9193('0x14d')]);if(!_0x337662){return this[_0x9193('0xf')]['error'](_0x3df026,_0x9193('0x14f'));}for(var _0x1d5616=0x0;_0x1d5616<_0x337662[_0x9193('0x9f')];_0x1d5616+=0x1){var _0x595aae=this[_0x9193('0xf')][_0x9193('0x12')](util[_0x9193('0x9d')](_0x9193('0x150'),_0x337662[_0x1d5616]));if(_0x595aae[_0x9193('0xa4')]===-0x1){return _0x595aae;}logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('IFTIME\x20%s\x20%s',_0x337662[_0x1d5616],_0x595aae[_0x9193('0xa6')]));if(_0x595aae['extra']===_0x9193('0x149')){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x151'),_0x337662[_0x1d5616],_0x9193('0x149')));this['channel']['noop'](util[_0x9193('0x9d')](_0x9193('0x151'),_0x337662[_0x1d5616],'true'));return{'code':0xc8,'result':_0x9193('0x149')};}else{logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x151'),_0x337662[_0x1d5616],'false'));this['channel']['noop'](util[_0x9193('0x9d')](_0x9193('0x151'),_0x337662[_0x1d5616],'false'));}}return{'code':0xc8,'result':_0x9193('0x14a')};};AGIVertices[_0x9193('0x11')]['hangup']=function(_0x614252){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x152'),_0x614252[_0x9193('0xaa')]));return this[_0x9193('0xf')][_0x9193('0x153')]();};AGIVertices[_0x9193('0x11')][_0x9193('0x154')]=function(_0x123c85){logger[_0x9193('0x2f')](util['format'](_0x9193('0x155'),_0x123c85[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x123c85[_0x9193('0x79')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20key\x20configured');}var _0x3c8263='wav';var _0x2b9c5b=util[_0x9193('0x9d')](_0x9193('0x136'),FILES_PATH,rs[_0x9193('0x120')](0x4));var _0x54522f=util['format'](_0x9193('0x9e'),_0x2b9c5b,_0x3c8263);var _0x5ab12c=!![];if(_0x123c85['beep']===_0x9193('0x138')){_0x5ab12c=![];}var _0x5bca39=this[_0x9193('0xf')][_0x9193('0x139')](_0x2b9c5b,_0x3c8263,_0x123c85[_0x9193('0x13a')],_0x123c85[_0x9193('0x65')],undefined,_0x5ab12c);if(_0x5bca39[_0x9193('0xa4')]!==-0x1){this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x156'),_0x54522f));var _0xf6f0f3=this['ispeechASR'][_0x9193('0xa8')](this,_0x123c85,_0x54522f);if(_0xf6f0f3){for(var _0x1bd9d1 in _0xf6f0f3){if(_0xf6f0f3[_0x9193('0x95')](_0x1bd9d1)){this['channel']['setVariable'](util[_0x9193('0x9d')]('ISPEECH_ASR_%s',_0x1bd9d1[_0x9193('0x69')]()),_0xf6f0f3[_0x1bd9d1]);}}return this[_0x9193('0xf')]['noop'](util[_0x9193('0x9d')](_0x9193('0x157'),JSON[_0x9193('0x71')](_0xf6f0f3)));}}return _0x5bca39;};AGIVertices[_0x9193('0x11')][_0x9193('0x158')]=function(_0xbd61aa){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x159'),_0xbd61aa[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0xbd61aa[_0x9193('0x79')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20key\x20configured');}if(!this[_0x9193('0x84')](_0xbd61aa[_0x9193('0x5a')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20text\x20configured');}this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x15a'),_0xbd61aa['text']));var _0x16f4c0=this['ispeechTTS']['sync'](this,_0xbd61aa);if(_0x16f4c0){this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('ispeech\x20%s\x20file\x20created',_0x16f4c0));var _0x3afa25=this['channel']['streamFile'](_0x16f4c0,_0xbd61aa[_0x9193('0x13a')]);try{fs[_0x9193('0x109')](_0x16f4c0+_0x9193('0x10a'));}catch(_0xed319c){logger[_0x9193('0x2d')](_0xed319c);}return _0x3afa25;}return this[_0x9193('0xf')][_0x9193('0x2d')](_0xbd61aa,_0x9193('0x15b'));};AGIVertices[_0x9193('0x11')][_0x9193('0x15c')]=function(_0xd0c784){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xd0c784[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0xd0c784[_0x9193('0x15d')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0xd0c784,_0x9193('0x15e'));}logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9193('0x3b')],_0xd0c784[_0x9193('0x15d')]));var _0x134898=this[_0x9193('0x51')][_0x9193('0xa8')](this,_0xd0c784[_0x9193('0x15d')]);if(_0x134898){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9193('0xf')]['callerid'],_0xd0c784['findBy']));this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x15f'),this[_0x9193('0xf')][_0x9193('0x3b')],_0xd0c784[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x160')};}else{logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x161'),this['channel']['callerid'],_0xd0c784[_0x9193('0x15d')]));this['channel'][_0x9193('0xab')](util['format'](_0x9193('0x161'),this['channel'][_0x9193('0x3b')],_0xd0c784[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x162')};}};AGIVertices[_0x9193('0x11')][_0x9193('0x163')]=function(_0x1a1cd9){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x164'),_0x1a1cd9[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x1a1cd9[_0x9193('0x15d')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x1a1cd9,_0x9193('0x15e'));}logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x165'),this['channel'][_0x9193('0x3b')],_0x1a1cd9[_0x9193('0x15d')]));var _0x46072d=this['agentLogout'][_0x9193('0xa8')](this,_0x1a1cd9['findBy']);if(_0x46072d){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9193('0xf')][_0x9193('0x3b')],_0x1a1cd9[_0x9193('0x15d')]));this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9193('0xf')][_0x9193('0x3b')],_0x1a1cd9[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x160')};}else{logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x161'),this[_0x9193('0xf')]['callerid'],_0x1a1cd9['findBy']));this[_0x9193('0xf')]['noop'](util[_0x9193('0x9d')](_0x9193('0x161'),this[_0x9193('0xf')]['callerid'],_0x1a1cd9[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x162')};}};AGIVertices[_0x9193('0x11')]['math']=function(_0x2c5dc3){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x166'),_0x2c5dc3[_0x9193('0xaa')]));if(!this['isConfigured'](_0x2c5dc3[_0x9193('0x167')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2c5dc3,_0x9193('0x168'));}this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x169'),_0x2c5dc3['operation']));var _0x56650d=eval(_0x2c5dc3[_0x9193('0x167')]);if(!this['isConfigured'](_0x2c5dc3[_0x9193('0xdd')])){return this[_0x9193('0xf')]['noop'](_0x9193('0x11a'));}var _0x26c571=this[_0x9193('0x12')][_0x9193('0xa8')](this,_0x2c5dc3[_0x9193('0xdd')]);if(!_0x26c571){return this['channel']['error'](_0x2c5dc3,_0x9193('0xde'));}if(_[_0x9193('0x9a')](_0x56650d)){var _0xc1e53f=this;_0x56650d[_0x9193('0xdf')](function(_0x6a0f32,_0x77a205){_0xc1e53f[_0x9193('0xf')]['setVariable'](util[_0x9193('0x9d')](_0x9193('0x16a'),_0x26c571,_0x77a205),_0x6a0f32);});return this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x16b'),_0x26c571));}else{return this[_0x9193('0xf')][_0x9193('0xa0')](_0x26c571,_0x56650d);}};AGIVertices[_0x9193('0x11')][_0x9193('0xd')]=function(_0x552de4){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x16c'),_0x552de4[_0x9193('0xaa')]));if(_0x552de4[_0x9193('0xa9')]===0x0){return this[_0x9193('0xa7')](_0x552de4);}_0x552de4[_0x9193('0xa9')]-=0x1;if(!this[_0x9193('0x84')](_0x552de4[_0x9193('0x118')])){return this[_0x9193('0xf')]['error'](_0x552de4,_0x9193('0x119'));}var _0x3c9b99=this[_0x9193('0x20')][_0x9193('0xa8')](this,_0x552de4['file_id']);if(!_0x3c9b99){return this['channel'][_0x9193('0x2d')](_0x552de4,'no\x20file\x20audio\x20found');}var _0x893ca1=this['channel'][_0x9193('0x11b')](_0x3c9b99,_0x552de4[_0x9193('0x11c')],_0x552de4[_0x9193('0x16d')]);var _0x53b97e=_0x893ca1[_0x9193('0xa4')];if(_0x893ca1['result']===-0x1){this['createSquareDetailsReport'][_0x9193('0xa8')](this,_0x552de4,'-1');return _0x893ca1;}else if(_0x893ca1[_0x9193('0xa6')]===_0x9193('0x65')){_0x893ca1['result']=_0x893ca1[_0x9193('0xa4')][_0x9193('0x9f')]>0x0?_0x893ca1[_0x9193('0xa4')]:'t';}else if(_[_0x9193('0x43')](_0x893ca1['result'])){_0x893ca1['result']='#';_0x53b97e='#';}if(!this['isConfigured'](_0x552de4['variable_id'])){this[_0x9193('0xf')][_0x9193('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x43d03d=this['getVariable']['sync'](this,_0x552de4[_0x9193('0xdd')]);if(!_0x43d03d){return this['channel']['error'](_0x552de4,_0x9193('0xde'));}this[_0x9193('0xf')][_0x9193('0xa0')](_0x43d03d,_0x53b97e);}this['createSquareDetailsReport'][_0x9193('0xa8')](this,_0x552de4,_0x53b97e);return _0x893ca1;};AGIVertices[_0x9193('0x11')][_0x9193('0xab')]=function(_0x9c4f2c){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x16e'),_0x9c4f2c[_0x9193('0xaa')]));return this['channel']['noop'](_0x9c4f2c[_0x9193('0x16f')]||_0x9c4f2c[_0x9193('0xaa')]);};AGIVertices[_0x9193('0x11')][_0x9193('0x170')]=function(_0x561b1e){logger[_0x9193('0x2f')](util['format'](_0x9193('0x171'),_0x561b1e['label']));if(!this[_0x9193('0x84')](_0x561b1e[_0x9193('0x15d')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x561b1e,_0x9193('0x15e'));}logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x165'),this[_0x9193('0xf')]['callerid'],_0x561b1e[_0x9193('0x15d')]));var _0x515614=this[_0x9193('0x172')][_0x9193('0xa8')](this,_0x561b1e[_0x9193('0x173')]);var _0x423d29=this[_0x9193('0x4e')]['sync'](this,_0x561b1e[_0x9193('0x15d')],_0x515614);if(_0x423d29){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x9193('0x3b')],_0x561b1e[_0x9193('0x15d')]));this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x561b1e[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x160')};}else{logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x161'),this[_0x9193('0xf')][_0x9193('0x3b')],_0x561b1e['findBy']));this[_0x9193('0xf')]['noop'](util[_0x9193('0x9d')](_0x9193('0x15f'),this[_0x9193('0xf')][_0x9193('0x3b')],_0x561b1e[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x162')};}};AGIVertices[_0x9193('0x11')]['playback']=function(_0x33980b){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x174'),_0x33980b[_0x9193('0xaa')]));if(!this['isConfigured'](_0x33980b[_0x9193('0x118')])){return this[_0x9193('0xf')]['error'](_0x33980b,_0x9193('0x119'));}var _0x469ad6=this['getSound'][_0x9193('0xa8')](this,_0x33980b['file_id']);if(!_0x469ad6){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x33980b,'no\x20file\x20audio\x20found');}var _0x3fd492=this[_0x9193('0xf')]['exec'](_0x9193('0x175'),[_0x469ad6,_0x33980b['opts']]);if(_0x3fd492[_0x9193('0xa4')]===-0x1){return _0x3fd492;}return this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')]('Executed\x20command\x20%s\x20%s',_0x9193('0x175'),_0x469ad6));};AGIVertices['prototype'][_0x9193('0x176')]=function(_0xcfc899){logger[_0x9193('0x2f')](util['format'](_0x9193('0x177'),_0xcfc899[_0x9193('0xaa')]));if(!this['isConfigured'](_0xcfc899['queue_id'])){return this['channel']['error'](_0xcfc899,_0x9193('0x178'));}var _0x5f4808='';var _0x37976a=parseInt(_0xcfc899[_0x9193('0x179')],0xa);if(isNaN(_0x37976a)){_0x5f4808=_0xcfc899[_0x9193('0x179')];}else{_0x5f4808=this[_0x9193('0x16')][_0x9193('0xa8')](this,_0xcfc899[_0x9193('0x179')]);if(!_0x5f4808){return this['channel']['error'](_0xcfc899,_0x9193('0x17a'));}}var _0x303da3='';if(this[_0x9193('0x84')](_0xcfc899[_0x9193('0x118')])){var _0x5b580d=this[_0x9193('0x20')][_0x9193('0xa8')](this,_0xcfc899[_0x9193('0x118')]);if(_0x5b580d){_0x303da3=_0x5b580d;}}this[_0x9193('0x37')][_0x9193('0xa8')](this,_0xcfc899,_0x5f4808);if(_0xcfc899[_0x9193('0xea')][_0x9193('0x17b')]('x')<0x0){_0xcfc899[_0x9193('0xea')]+='x';}if(_0xcfc899['opts'][_0x9193('0x17b')]('X')<0x0){_0xcfc899['opts']+='X';}this['channel'][_0x9193('0xa0')](_0x9193('0x17c'),_0x5f4808?_0x5f4808['toLowerCase']():'');var _0x3f89c3=this[_0x9193('0xf')]['exec']('QUEUE',[_0x5f4808,_0xcfc899['opts'],_0xcfc899[_0x9193('0x63')],_0x303da3,_0xcfc899[_0x9193('0x65')],_0xcfc899[_0x9193('0x8')],_0xcfc899['macro'],_0xcfc899[_0x9193('0x17d')],'',_0xcfc899[_0x9193('0x17e')]]);if(_0x3f89c3[_0x9193('0xa4')]===-0x1){return _0x3f89c3;}return this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0xc9'),_0x9193('0x17f'),_0x5f4808));};AGIVertices[_0x9193('0x11')]['record']=function(_0x288e78){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x180'),_0x288e78[_0x9193('0xaa')]));var _0x1d7c2e=_0x288e78[_0x9193('0x181')]||_0x9193('0x135');var _0x49941b=util[_0x9193('0x9d')](_0x9193('0x182'),this[_0x9193('0xf')]['uniqueid'],rs[_0x9193('0x120')](0x5));var _0x1707a3=util['format'](_0x9193('0x183'),FILES_PATH,_0x49941b,_0x1d7c2e);var _0x1beb03=util[_0x9193('0x9d')](_0x9193('0x136'),FILES_PATH,_0x49941b);this[_0x9193('0x3c')]['sync'](this,_0x288e78,_0x49941b,_0x1707a3);this[_0x9193('0xf')]['setVariable'](_0x9193('0x184'),_0x49941b);logger[_0x9193('0x2f')](_0x9193('0x185'),_0x1beb03,_0x1d7c2e,_0x288e78[_0x9193('0x186')],_0x288e78[_0x9193('0x65')]);return this[_0x9193('0xf')][_0x9193('0x139')](_0x1beb03,_0x1d7c2e,_0x288e78[_0x9193('0x186')],_0x288e78['timeout'],undefined,!![]);};AGIVertices[_0x9193('0x11')][_0x9193('0x187')]=function(_0x3f2366){logger['info'](util[_0x9193('0x9d')](_0x9193('0x188'),_0x3f2366[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x3f2366[_0x9193('0x63')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20url\x20configured');}var _0x53ba83=this[_0x9193('0x62')][_0x9193('0xa8')](this,_0x3f2366);logger['info'](util[_0x9193('0x9d')](_0x9193('0x189'),util[_0x9193('0x18a')](_0x53ba83,{'showHidden':![],'depth':null})));if(!this[_0x9193('0x84')](_0x3f2366[_0x9193('0xdd')])){return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0x18b'));}var _0x49d64c=this[_0x9193('0x12')]['sync'](this,_0x3f2366[_0x9193('0xdd')]);if(!_0x49d64c){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3f2366,_0x9193('0xde'));}this[_0x9193('0xf')][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0x18c'),_0x49d64c),_0x53ba83[_0x9193('0x73')]?_0x53ba83[_0x9193('0x73')]:'200');this[_0x9193('0xf')][_0x9193('0xa0')](util[_0x9193('0x9d')](_0x9193('0x18d'),_0x49d64c),_0x53ba83['statusMessage']?_0x53ba83[_0x9193('0x74')]:'OK');if(_0x53ba83[_0x9193('0x6a')]){try{this[_0x9193('0x9b')](_0x53ba83[_0x9193('0x6a')],_0x49d64c);}catch(_0x48d345){logger['error'](util[_0x9193('0x9d')](_0x9193('0x18e'),_0x49d64c));}}return this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x18f'),_0x49d64c));};AGIVertices['prototype'][_0x9193('0x190')]=function(_0x3473a2){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3473a2[_0x9193('0xaa')]));return this[_0x9193('0xf')][_0x9193('0x191')](_0x3473a2[_0x9193('0x192')]['replace'](/\s+/g,''),_0x3473a2[_0x9193('0x186')]);};AGIVertices['prototype'][_0x9193('0x193')]=function(_0x345c7b){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x194'),_0x345c7b[_0x9193('0xaa')]));return this[_0x9193('0xf')][_0x9193('0x195')](_0x345c7b[_0x9193('0x66')][_0x9193('0x56')](/\s+/g,''),_0x345c7b[_0x9193('0x186')]);};AGIVertices[_0x9193('0x11')][_0x9193('0x196')]=function(_0x2e95f3){logger['info'](util[_0x9193('0x9d')](_0x9193('0x197'),_0x2e95f3['label']));return this['channel'][_0x9193('0x198')](_0x2e95f3['text'],_0x2e95f3[_0x9193('0x186')]);};AGIVertices['prototype']['sendMail']=function(_0x3afd00){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x199'),_0x3afd00['label']));if(!this[_0x9193('0x84')](_0x3afd00[_0x9193('0x19a')])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20mail\x20account\x20configured');}var _0x1064ff=this[_0x9193('0x23')][_0x9193('0xa8')](this,_0x3afd00[_0x9193('0x19a')]);if(!_0x1064ff||!_0x1064ff['Smtp']){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x3afd00,'no\x20mail\x20account\x20found');}var _0x3577f3={'from':util['format'](_0x9193('0x19b'),_0x1064ff['name'],_0x1064ff['email']||_0x1064ff[_0x9193('0x19c')][_0x9193('0x19d')]),'to':_0x3afd00['to']||'','cc':_0x3afd00['cc']||'','bcc':_0x3afd00[_0x9193('0x19e')]||'','subject':_0x3afd00['subject'],'html':_0x3afd00[_0x9193('0x5a')],'text':_0x3afd00[_0x9193('0x5a')]};var _0x23abf7={'tls':{'rejectUnauthorized':![]}};if(_0x1064ff[_0x9193('0x19c')][_0x9193('0x19f')]){_0x23abf7['service']=_0x1064ff[_0x9193('0x19c')][_0x9193('0x19f')];}else{_0x23abf7['host']=_0x1064ff[_0x9193('0x19c')][_0x9193('0x1a0')];_0x23abf7[_0x9193('0x1a1')]=_0x1064ff[_0x9193('0x19c')]['port'];_0x23abf7[_0x9193('0x1a2')]=_0x1064ff[_0x9193('0x19c')][_0x9193('0x1a2')];}if(_0x1064ff[_0x9193('0x19c')][_0x9193('0x1a3')]){_0x23abf7[_0x9193('0x1a4')]={'user':_0x1064ff[_0x9193('0x19c')]['user'],'pass':_0x1064ff[_0x9193('0x19c')][_0x9193('0x1a5')]};}if(this['isConfigured'](_0x3afd00[_0x9193('0x1a6')])){}logger['debug'](_0x9193('0x1a7'),JSON[_0x9193('0x71')](_0x3577f3));this[_0x9193('0x37')]['sync'](this,_0x3afd00,_0x3afd00[_0x9193('0x19a')]);this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1064ff['name']));this['sendMailMessage']['sync'](this,_0x23abf7,_0x3577f3);return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0x1a8'));};AGIVertices[_0x9193('0x11')][_0x9193('0x1a9')]=function(_0x366a3b){logger[_0x9193('0x2f')](util['format'](_0x9193('0x1aa'),_0x366a3b[_0x9193('0xaa')]));return this['channel']['noop'](_0x9193('0x1ab'));};AGIVertices['prototype'][_0x9193('0x1ac')]=function(_0x53b0e6){logger['info'](util['format'](_0x9193('0x1ad'),_0x53b0e6[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x53b0e6['sms_account_id'])){return this[_0x9193('0xf')]['noop'](_0x9193('0x1ae'));}var _0x2a1c55=this[_0x9193('0x34')][_0x9193('0xa8')](this,_0x53b0e6[_0x9193('0x1af')]);if(!_0x2a1c55){return this['channel']['error'](_0x53b0e6,_0x9193('0x1b0'));}var _0x5d9c02={'body':_0x53b0e6['sms_text'],'phone':_0x53b0e6['to']||'','SmsAccountId':_0x2a1c55['id']};logger[_0x9193('0xe4')](_0x9193('0x1b1'),JSON[_0x9193('0x71')](_0x5d9c02));this['createSquareDetailsReport'][_0x9193('0xa8')](this,_0x53b0e6,_0x53b0e6[_0x9193('0x1af')]);this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x1b2'),_0x2a1c55[_0x9193('0x14')]));this['createSmsMessage'][_0x9193('0xa8')](this,_0x5d9c02);return this[_0x9193('0xf')]['noop'](_0x9193('0x1b3'));};AGIVertices[_0x9193('0x11')]['set']=function(_0x2b4258){logger[_0x9193('0x2f')](util[_0x9193('0x9d')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x2b4258[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x2b4258[_0x9193('0xdd')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2b4258,_0x9193('0x1b4'));}var _0x25e49a=this[_0x9193('0x12')]['sync'](this,_0x2b4258[_0x9193('0xdd')]);if(!_0x25e49a){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x2b4258,_0x9193('0xde'));}return this['channel'][_0x9193('0xa0')](_0x25e49a,_0x2b4258[_0x9193('0x1b5')]);};AGIVertices[_0x9193('0x11')][_0x9193('0x1b6')]=function(_0x22654b){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x1b7'),_0x22654b[_0x9193('0xaa')]));this['channel'][_0x9193('0xab')](_0x9193('0x1b8'));if(_0x22654b[_0x9193('0xba')]===_0x9193('0x1b9')){this[_0x9193('0xf')]['noop'](_0x9193('0x1ba'));return this[_0x9193('0xf')][_0x9193('0xba')]();}return this[_0x9193('0xf')][_0x9193('0xab')](_0x9193('0x1bb'));};AGIVertices[_0x9193('0x11')][_0x9193('0x1bc')]=function(_0x32db05){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x1bd'),_0x32db05[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x32db05['project_id'])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x32db05,_0x9193('0x1be'));}var _0x1afd44=this[_0x9193('0x19')][_0x9193('0xa8')](this,_0x32db05[_0x9193('0x1bf')]);if(!this[_0x9193('0x84')](_0x1afd44)){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x32db05,util[_0x9193('0x9d')](_0x9193('0x1c0'),_0x32db05[_0x9193('0x1bf')]));}if(_0x1afd44===this[_0x9193('0xf')][_0x9193('0x3a')]){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x32db05,_0x9193('0x1c1'));}this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x32db05,_0x1afd44);var _0x21787a=this[_0x9193('0xf')]['exec']('AGI',util[_0x9193('0x9d')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x9193('0x1a0')]||_0x9193('0x1c2'),_0x1afd44,this[_0x9193('0xf')][_0x9193('0x3a')]));if(_0x21787a[_0x9193('0xa4')]===-0x1){return _0x21787a;}return this['channel'][_0x9193('0xab')](util['format'](_0x9193('0xc9'),'AGI',_0x1afd44));};AGIVertices['prototype'][_0x9193('0x1c3')]=function(_0x1f8843){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x1c4'),_0x1f8843[_0x9193('0xaa')]));var _0x44180=this['shellCommand'][_0x9193('0xa8')](this,_0x1f8843['command']);this[_0x9193('0x37')][_0x9193('0xa8')](this,_0x1f8843,_0x1f8843[_0x9193('0xb8')]);if(this[_0x9193('0x84')](_0x1f8843[_0x9193('0xdd')])){var _0x88acd6=this[_0x9193('0x12')][_0x9193('0xa8')](this,_0x1f8843[_0x9193('0xdd')]);if(_0x88acd6){this[_0x9193('0xf')]['setVariable'](_0x88acd6,_0x44180);return this['channel'][_0x9193('0xab')](util['format'](_0x9193('0x1c5'),_0x1f8843[_0x9193('0xb8')],_0x88acd6));}}return this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x1c6'),_0x1f8843[_0x9193('0xb8')]));};AGIVertices[_0x9193('0x11')][_0x9193('0x1c7')]=function(_0x140b17){logger['info'](util['format'](_0x9193('0x1c8'),_0x140b17[_0x9193('0xaa')]));_0x140b17['text']=_0x140b17[_0x9193('0x5a')][_0x9193('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9193('0x84')](_0x140b17['apiKey'])){return this[_0x9193('0xf')][_0x9193('0xab')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x140b17[_0x9193('0x5a')])){return this['channel'][_0x9193('0xab')](_0x9193('0xac'));}this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x140b17['text']));var _0x1dd201=this[_0x9193('0x57')][_0x9193('0xa8')](this,_0x140b17);if(_0x1dd201){this[_0x9193('0xf')][_0x9193('0xab')](util['format'](_0x9193('0x1c9'),_0x1dd201));var _0x4df5d3=this['channel'][_0x9193('0x1ca')](_0x1dd201);try{fs[_0x9193('0x109')](_0x1dd201+_0x9193('0x10a'));}catch(_0x5f571b){logger['error'](_0x5f571b);}return _0x4df5d3;}return this[_0x9193('0xf')]['error'](_0x140b17,_0x9193('0x1cb'));};AGIVertices[_0x9193('0x11')]['tts']=function(_0x4cd076){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x1cc'),_0x4cd076['label']));_0x4cd076[_0x9193('0x5a')]=_0x4cd076[_0x9193('0x5a')][_0x9193('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9193('0x84')](_0x4cd076[_0x9193('0x5a')])){return this[_0x9193('0xf')]['noop'](_0x9193('0xac'));}this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x1cd'),_0x4cd076[_0x9193('0x5a')]));var _0x52679c=this[_0x9193('0x61')][_0x9193('0xa8')](this,_0x4cd076);if(_0x52679c){this[_0x9193('0xf')][_0x9193('0xab')](util[_0x9193('0x9d')]('Google\x20TTS\x20%s\x20file\x20created',_0x52679c));var _0x45ee40=this['channel'][_0x9193('0x1ca')](_0x52679c);try{fs[_0x9193('0x109')](_0x52679c+_0x9193('0x10a'));}catch(_0x190acc){logger[_0x9193('0x2d')](_0x190acc);}return _0x45ee40;}return this['channel'][_0x9193('0x2d')](_0x4cd076,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9193('0x1ce')]=function(_0x215f0b){logger['info'](util[_0x9193('0x9d')](_0x9193('0x1cf'),_0x215f0b[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x215f0b[_0x9193('0x15d')])){return this['channel']['error'](_0x215f0b,_0x9193('0x15e'));}logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x165'),this[_0x9193('0xf')][_0x9193('0x3b')],_0x215f0b[_0x9193('0x15d')]));var _0x532778=this[_0x9193('0x4f')]['sync'](this,_0x215f0b[_0x9193('0x15d')]);if(_0x532778){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x15f'),this[_0x9193('0xf')]['callerid'],_0x215f0b['findBy']));this['channel'][_0x9193('0xab')](util['format'](_0x9193('0x15f'),this[_0x9193('0xf')]['callerid'],_0x215f0b['findBy']));return{'code':0xc8,'result':_0x9193('0x160')};}else{logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x161'),this[_0x9193('0xf')][_0x9193('0x3b')],_0x215f0b[_0x9193('0x15d')]));this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')](_0x9193('0x161'),this[_0x9193('0xf')][_0x9193('0x3b')],_0x215f0b[_0x9193('0x15d')]));return{'code':0xc8,'result':_0x9193('0x162')};}};AGIVertices[_0x9193('0x11')][_0x9193('0x1d0')]=function(_0x1992e2){logger[_0x9193('0x2f')](util['format'](_0x9193('0x1d1'),_0x1992e2[_0x9193('0xaa')]));var _0x10719b=this[_0x9193('0xf')][_0x9193('0x54')](_0x9193('0x1d2'),[_0x1992e2[_0x9193('0x1d3')],_0x1992e2[_0x9193('0x77')]]);if(_0x10719b['result']===-0x1){return _0x10719b;}return this['channel'][_0x9193('0xab')](util[_0x9193('0x9d')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x1992e2[_0x9193('0x1d3')]));};AGIVertices[_0x9193('0x11')][_0x9193('0x1d4')]=function(_0x29e7c9){logger[_0x9193('0x2f')](util[_0x9193('0x9d')](_0x9193('0x1d5'),_0x29e7c9[_0x9193('0xaa')]));if(!this[_0x9193('0x84')](_0x29e7c9[_0x9193('0xdd')])){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x29e7c9,_0x9193('0x1b4'));}var _0x2c59b1=this[_0x9193('0x12')][_0x9193('0xa8')](this,_0x29e7c9[_0x9193('0xdd')]);if(!_0x2c59b1){return this[_0x9193('0xf')][_0x9193('0x2d')](_0x29e7c9,_0x9193('0xde'));}var _0x2ecced=this['channel'][_0x9193('0x12')](_0x2c59b1);return{'code':0xc8,'result':_0x2ecced[_0x9193('0xa6')]?_0x2ecced[_0x9193('0xa6')]:'-'};};String[_0x9193('0x11')][_0x9193('0xa2')]=function(_0x559c49,_0x311826){return this[_0x9193('0xa1')](_0x559c49)['join'](_0x311826);};module[_0x9193('0x1d6')]=AGIVertices; \ No newline at end of file +var _0x431b=['uniqueid','calleridname','context','extension','accountcode','dnid','createSquareMessage','createCmContact','random','isEmpty','lastName','isNil','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','restAPI','url','method','timeout','number','includes','POST','PUT','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','recursiveNodeIndex','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','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','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','SIP/%s','opts','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','end','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','success','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','%s_%s','%s/recordings/%s.%s','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','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','auth','pass','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','googleTTS','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording'];(function(_0x48faa1,_0x1d3ea0){var _0x5796fb=function(_0x2a04d3){while(--_0x2a04d3){_0x48faa1['push'](_0x48faa1['shift']());}};_0x5796fb(++_0x1d3ea0);}(_0x431b,0x18d));var _0xb431=function(_0x12c7e3,_0x417a84){_0x12c7e3=_0x12c7e3-0x0;var _0x348f08=_0x431b[_0x12c7e3];return _0x348f08;};'use strict';var fs=require('fs');var path=require(_0xb431('0x0'));var util=require(_0xb431('0x1'));var _=require(_0xb431('0x2'));var sh=require('shelljs');var odbc=require(_0xb431('0x3'))();var rs=require(_0xb431('0x4'));var moment=require(_0xb431('0x5'));var Mustache=require(_0xb431('0x6'));var rp=require(_0xb431('0x7'));var logger=require(_0xb431('0x8'))(_0xb431('0x9'));var config=require('../../config/environment');var scripts=require(_0xb431('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xb431('0xb'),'rawBody'];var verticesWithRetry=['menu',_0xb431('0xc'),'getsecretdigits'];var AGIVertices=function(_0x58f0ac,_0x325f84,_0x34cdb1){this[_0xb431('0xd')]=_0x58f0ac;this[_0xb431('0xe')]=_0x325f84;this[_0xb431('0xf')]=_0x34cdb1;};AGIVertices[_0xb431('0x10')][_0xb431('0x11')]=function(_0x492f5c,_0x316c21){this[_0xb431('0xe')][_0xb431('0x12')](_0x492f5c)['then'](function(_0x19d028){_0x316c21(null,_0x19d028?_0x19d028[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x41a891){_0x316c21(_0x41a891);});};AGIVertices[_0xb431('0x10')][_0xb431('0x15')]=function(_0x577a74,_0x37388){this['rpc'][_0xb431('0x16')](_0x577a74)[_0xb431('0x17')](function(_0x1d0d79){_0x37388(null,_0x1d0d79?_0x1d0d79[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x163b4c){_0x37388(_0x163b4c);});};AGIVertices['prototype'][_0xb431('0x18')]=function(_0x592db9,_0xc73c8a){this[_0xb431('0xe')][_0xb431('0x19')](_0x592db9)[_0xb431('0x17')](function(_0x57f78b){_0xc73c8a(null,_0x57f78b?_0x57f78b[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x5b12d2){_0xc73c8a(_0x5b12d2);});};AGIVertices[_0xb431('0x10')][_0xb431('0x1a')]=function(_0x575a6d,_0x486ef5){this[_0xb431('0xe')][_0xb431('0x1b')](_0x575a6d)[_0xb431('0x17')](function(_0x21b18b){_0x486ef5(null,_0x21b18b?_0x21b18b[_0xb431('0x1c')]:![]);})[_0xb431('0x14')](function(_0x402818){_0x486ef5(_0x402818);});};AGIVertices[_0xb431('0x10')]['getUser']=function(_0x59d633,_0x39a6fc){this[_0xb431('0xe')][_0xb431('0x1d')](_0x59d633)[_0xb431('0x17')](function(_0xfcf848){_0x39a6fc(null,_0xfcf848?_0xfcf848[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x3cca9e){_0x39a6fc(_0x3cca9e);});};AGIVertices[_0xb431('0x10')]['getTrunk']=function(_0xbba1be,_0x3c555b){this[_0xb431('0xe')]['getTrunkById'](_0xbba1be)['then'](function(_0x529a9a){_0x3c555b(null,_0x529a9a?_0x529a9a[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x1cac66){_0x3c555b(_0x1cac66);});};AGIVertices[_0xb431('0x10')][_0xb431('0x1e')]=function(_0x4d0b73,_0x28337c){var _0x4c8c46=this;this[_0xb431('0xe')][_0xb431('0x1f')](_0x4d0b73)['then'](function(_0xad5fc3){_0x28337c(null,_0xad5fc3?_0x4c8c46[_0xb431('0x20')](_0xad5fc3[_0xb431('0x21')]):![]);})['catch'](function(_0x48fdf9){_0x28337c(_0x48fdf9);});};AGIVertices['prototype'][_0xb431('0x22')]=function(_0x3ee435,_0x157025){this['rpc']['getMailAccountById'](_0x3ee435)[_0xb431('0x17')](function(_0x548802){_0x157025(null,_0x548802?_0x548802:![]);})[_0xb431('0x14')](function(_0x3700b7){_0x157025(_0x3700b7);});};AGIVertices[_0xb431('0x10')][_0xb431('0x23')]=function(_0x4d5600,_0x51186e,_0x262f7b){this[_0xb431('0xf')][_0xb431('0x23')](_0x4d5600,_0x51186e)['then'](function(){_0x262f7b(null);})[_0xb431('0x14')](function(_0xb73758){_0x262f7b(_0xb73758);});};AGIVertices[_0xb431('0x10')][_0xb431('0x24')]=function(_0xdc1fd8,_0x2dcbec){this['rpc'][_0xb431('0x25')](_0xdc1fd8)[_0xb431('0x17')](function(_0x2789d8){if(_0x2789d8){if(_0x2789d8[_0xb431('0x26')]){_0x2dcbec(null,[_0x2789d8[_0xb431('0x27')]]);}else{_0x2dcbec(null,_[_0xb431('0x28')](_0x2789d8[_0xb431('0x29')],_0xb431('0x27')));}}else{_0x2dcbec(null,![]);}})['catch'](function(_0x5c1ea5){_0x2dcbec(_0x5c1ea5);});};AGIVertices[_0xb431('0x10')][_0xb431('0x20')]=function(_0x307c8b){return util[_0xb431('0x2a')](_0xb431('0x2b'),FILES_PATH,_0x307c8b);};AGIVertices[_0xb431('0x10')][_0xb431('0x2c')]=function(_0x2b8430,_0x25e46e,_0x8e4d26){odbc[_0xb431('0x2d')](_0x2b8430,function(_0x2488ca){if(_0x2488ca){logger[_0xb431('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2488ca);_0x8e4d26(_0x2488ca);}else{logger[_0xb431('0x2f')](_0xb431('0x30'));odbc['query'](_0x25e46e,function(_0x573272,_0x569ea9){if(_0x573272){logger[_0xb431('0x2f')](_0xb431('0x31'),_0x25e46e);_0x8e4d26(_0x573272);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x25e46e);odbc[_0xb431('0x32')](function(_0x5ae41c){if(_0x5ae41c){logger[_0xb431('0x2e')](_0xb431('0x33'),_0x5ae41c);}_0x8e4d26(null,_0x569ea9);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x37c194,_0x5ac2ff){this[_0xb431('0xe')][_0xb431('0x34')](_0x37c194)[_0xb431('0x17')](function(_0x5ead7a){_0x5ac2ff(null,_0x5ead7a?_0x5ead7a:![]);})['catch'](function(_0x41faef){_0x5ac2ff(_0x41faef);});};AGIVertices[_0xb431('0x10')][_0xb431('0x35')]=function(_0x3c301c,_0x351df1){this['rpc'][_0xb431('0x35')](_0x3c301c)[_0xb431('0x17')](function(_0x453009){_0x351df1(null,_0x453009);})[_0xb431('0x14')](function(_0x2df9af){_0x351df1(_0x2df9af);});};AGIVertices[_0xb431('0x10')][_0xb431('0x36')]=function(_0x750034,_0x16502b,_0x4245f7){this[_0xb431('0xe')][_0xb431('0x36')]({'uniqueid':this['channel']['uniqueid'],'node':_0x750034[_0xb431('0x37')],'application':_0x750034[_0xb431('0x38')],'data':_0x16502b||null,'project_name':this[_0xb431('0xd')][_0xb431('0x39')],'callerid':this[_0xb431('0xd')][_0xb431('0x3a')]})['then'](function(_0x458c12){if(_0x4245f7){_0x4245f7(null,_0x458c12);}})[_0xb431('0x14')](function(_0x492868){if(_0x4245f7){_0x4245f7(_0x492868);}});};AGIVertices[_0xb431('0x10')][_0xb431('0x3b')]=function(_0x5b6de3,_0xf496e9,_0x257320,_0x24d83a){this['rpc'][_0xb431('0x3b')]({'uniqueid':this[_0xb431('0xd')][_0xb431('0x3c')],'callerid':this[_0xb431('0xd')][_0xb431('0x3a')],'calleridname':this[_0xb431('0xd')][_0xb431('0x3d')],'context':this[_0xb431('0xd')][_0xb431('0x3e')],'extension':this['channel'][_0xb431('0x3f')],'priority':this[_0xb431('0xd')]['priority'],'accountcode':this[_0xb431('0xd')][_0xb431('0x40')],'dnid':this[_0xb431('0xd')][_0xb431('0x41')],'projectName':this['channel'][_0xb431('0x39')],'saveName':_0xf496e9,'filename':_0x5b6de3['file']||_0xf496e9,'savePath':_0x257320})[_0xb431('0x17')](function(_0x289805){_0x24d83a(null,_0x289805);})[_0xb431('0x14')](function(_0x8d793a){_0x24d83a(_0x8d793a);});};AGIVertices['prototype'][_0xb431('0x42')]=function(_0x5c09fa,_0x179c2f,_0x4b5925,_0x1f8c44,_0xbe326f){this[_0xb431('0xe')][_0xb431('0x42')]({'uniqueid':this[_0xb431('0xd')]['uniqueid'],'body':_0x5c09fa,'direction':_0x179c2f,'providerName':_0x4b5925,'providerResponse':_0x1f8c44})[_0xb431('0x17')](function(_0x5844dc){if(_0xbe326f){_0xbe326f(null,_0x5844dc);}})['catch'](function(_0x1c8e6c){if(_0xbe326f){_0xbe326f(_0x1c8e6c);}});};AGIVertices[_0xb431('0x10')][_0xb431('0x43')]=function(_0x49ae58,_0x2e3e61){this[_0xb431('0xe')][_0xb431('0x43')]({'firstName':_['isEmpty'](_0x49ae58[_0xb431('0x13')])||_['isNil'](_0x49ae58[_0xb431('0x13')])?'callback_'+Math[_0xb431('0x44')]():_0x49ae58[_0xb431('0x13')],'lastName':_[_0xb431('0x45')](_0x49ae58[_0xb431('0x46')])||_[_0xb431('0x47')](_0x49ae58[_0xb431('0x46')])?null:_0x49ae58[_0xb431('0x46')],'phone':_0x49ae58[_0xb431('0x48')],'ListId':_0x49ae58[_0xb431('0x49')],'scheduledat':_0x49ae58[_0xb431('0x4a')],'callbackUniqueid':this[_0xb431('0xd')][_0xb431('0x3c')],'tags':'callback','description':_0xb431('0x4b')+_0x49ae58[_0xb431('0x4a')]['toString'](),'priority':_0x49ae58[_0xb431('0x4c')]})['then'](function(_0x57904c){_0x2e3e61(null,_0x57904c);})[_0xb431('0x14')](function(_0xa5924c){_0x2e3e61(_0xa5924c);});};AGIVertices[_0xb431('0x10')]['getPause']=function(_0x3a769a,_0x11c88a){this[_0xb431('0xe')][_0xb431('0x4d')](_0x3a769a)[_0xb431('0x17')](function(_0x47996e){_0x11c88a(null,_0x47996e?_0x47996e[_0xb431('0x13')]:![]);})[_0xb431('0x14')](function(_0x75ff3){_0x11c88a(_0x75ff3);});};AGIVertices[_0xb431('0x10')]['agentPause']=function(_0x3e0001,_0x31b648,_0xd18f33){var _0x59c411={'role':_0xb431('0x4e')};_0x59c411[_0x3e0001]=this[_0xb431('0xd')][_0xb431('0x3a')];this[_0xb431('0xe')][_0xb431('0x4f')](_0x59c411,_0x31b648,this[_0xb431('0xd')][_0xb431('0x3c')])[_0xb431('0x17')](function(_0x2a12a5){_0xd18f33(null,_[_0xb431('0x47')](_0x2a12a5)?![]:!![]);})[_0xb431('0x14')](function(_0x1b5a58){logger[_0xb431('0x2e')](_0x1b5a58);_0xd18f33(null,![]);});};AGIVertices['prototype'][_0xb431('0x50')]=function(_0x180596,_0x1ba445){var _0x17d0eb={'role':_0xb431('0x4e')};_0x17d0eb[_0x180596]=this[_0xb431('0xd')][_0xb431('0x3a')];this[_0xb431('0xe')][_0xb431('0x50')](_0x17d0eb)[_0xb431('0x17')](function(_0x26da46){_0x1ba445(null,_['isNil'](_0x26da46)?![]:!![]);})['catch'](function(_0x1467ce){logger[_0xb431('0x2e')](_0x1467ce);_0x1ba445(null,![]);});};AGIVertices['prototype'][_0xb431('0x51')]=function(_0x6c071e,_0x757a13){var _0x19217e={'role':_0xb431('0x4e')};_0x19217e[_0x6c071e]=this[_0xb431('0xd')][_0xb431('0x3a')];this[_0xb431('0xe')][_0xb431('0x51')](_0x19217e)['then'](function(_0x13810d){_0x757a13(null,_[_0xb431('0x47')](_0x13810d)?![]:!![]);})['catch'](function(_0x1d866a){logger['error'](_0x1d866a);_0x757a13(null,![]);});};AGIVertices['prototype'][_0xb431('0x52')]=function(_0x202b05,_0x1ede25){var _0x6c2518={'role':_0xb431('0x4e')};_0x6c2518[_0x202b05]=this[_0xb431('0xd')][_0xb431('0x3a')];var _0x210fc1=_0x202b05!=_0xb431('0x53')?util['format'](_0xb431('0x54'),'LOCAL',this[_0xb431('0xd')]['callerid']):undefined;this[_0xb431('0xe')]['agentLogin'](_0x6c2518,_0x210fc1)['then'](function(_0x26a59d){_0x1ede25(null,_[_0xb431('0x47')](_0x26a59d)?![]:!![]);})['catch'](function(_0x54f481){logger['error'](_0x54f481);_0x1ede25(null,![]);});};AGIVertices[_0xb431('0x10')]['shellCommand']=function(_0x5a0580,_0x160fdf){sh[_0xb431('0x55')](_['trim'](_0x5a0580),function(_0x393ec4,_0x4c09d3){var _0x2d56ec=_0x4c09d3[_0xb431('0x56')](/(\r\n|\n|\r)/gm,'');_0x160fdf(null,_0x2d56ec);});};AGIVertices[_0xb431('0x10')][_0xb431('0x57')]=function(_0x28dfc8,_0x3f99f7){scripts[_0xb431('0x57')](_0x28dfc8[_0xb431('0x58')],_0x28dfc8[_0xb431('0x59')]||_0xb431('0x5a'),_0x28dfc8[_0xb431('0x5a')],_0x28dfc8[_0xb431('0x5b')]||_0xb431('0x5c'),_0x28dfc8[_0xb431('0x5d')]||_0xb431('0x5e'),_0x28dfc8[_0xb431('0x5f')]||_0xb431('0x60'))[_0xb431('0x17')](function(_0x373316){_0x3f99f7(null,_0x373316);})[_0xb431('0x14')](function(_0x4715d0){_0x3f99f7(_0x4715d0);});};AGIVertices['prototype']['googleTTS']=function(_0x237a7e,_0x29c5c6){scripts['googleTTS'](_0x237a7e['text'],_0x237a7e['google_tts_language']||'en',0x1)[_0xb431('0x17')](function(_0x366d84){_0x29c5c6(null,_0x366d84);})[_0xb431('0x14')](function(_0x1e05e5){_0x29c5c6(_0x1e05e5);});};AGIVertices[_0xb431('0x10')][_0xb431('0x61')]=function(_0x51b388,_0x5ba1f7){var _0x1b42b6={'uri':_0x51b388[_0xb431('0x62')],'method':_0x51b388[_0xb431('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x51b388[_0xb431('0x64')])===_0xb431('0x65')&&parseInt(_0x51b388[_0xb431('0x64')])>=0x1?parseInt(_0x51b388[_0xb431('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xb431('0x66')]([_0xb431('0x67'),_0xb431('0x68')],_0x1b42b6['method']['toUpperCase']())){try{_0x1b42b6[_0xb431('0x69')]=_0x51b388[_0xb431('0x6a')]?JSON['parse'](_0x51b388[_0xb431('0x6a')]):{};}catch(_0x3f2fbc){logger['error'](_0xb431('0x6b'),_0x3f2fbc);}}try{_0x1b42b6[_0xb431('0x6c')]=_0x51b388[_0xb431('0xb')]?JSON[_0xb431('0x6d')](_0x51b388[_0xb431('0xb')]):{};}catch(_0x4db60c){logger[_0xb431('0x2e')](_0xb431('0x6e'),_0x4db60c);}if(_0x51b388[_0xb431('0x6f')]){try{var _0x198a62=require(_0x51b388[_0xb431('0x6f')])[_0xb431('0x70')](this,_0x1b42b6);_0x1b42b6['uri']=Mustache[_0xb431('0x71')](_0x51b388[_0xb431('0x62')],_0x198a62,{},['$$','$$']);if(_0x1b42b6[_0xb431('0x6c')]){_0x1b42b6['headers']=JSON[_0xb431('0x6d')](Mustache[_0xb431('0x71')](JSON['stringify'](_0x1b42b6[_0xb431('0x6c')]),_0x198a62,{},['$$','$$']));}if(_0x1b42b6[_0xb431('0x69')]){_0x1b42b6['body']=JSON[_0xb431('0x6d')](Mustache['render'](JSON[_0xb431('0x72')](_0x1b42b6['body']),_0x198a62,{},['$$','$$']));}}catch(_0x3362cb){logger[_0xb431('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3362cb);}}rp(_0x1b42b6)[_0xb431('0x17')](function(_0x238326){var _0x291835={'statusCode':_0x238326[_0xb431('0x73')]||0xc8,'statusMessage':_0x238326['statusMessage']||'OK','headers':_0x238326[_0xb431('0x6c')]||{},'body':_0x238326[_0xb431('0x69')]||{}};_0x5ba1f7(null,_0x291835);})[_0xb431('0x14')](function(_0x5bcad0){var _0x432876={'statusCode':_0x5bcad0[_0xb431('0x73')]||0x1f4,'statusMessage':_0x5bcad0[_0xb431('0x74')]||_0xb431('0x75'),'headers':_0x5bcad0['options']['headers']||{},'body':_0x5bcad0[_0xb431('0x76')][_0xb431('0x69')]||{}};_0x5ba1f7(null,_0x432876);});};AGIVertices[_0xb431('0x10')][_0xb431('0x77')]=function(_0x1905dc,_0x57b09a){scripts['googleDialogflow'](this[_0xb431('0xd')][_0xb431('0x3c')],_0x1905dc[_0xb431('0x78')],_0x1905dc[_0xb431('0x5a')],_0x1905dc['dialogflow_language']||'en')[_0xb431('0x17')](function(_0x5b6d19){_0x57b09a(null,_0x5b6d19);})[_0xb431('0x14')](function(_0x3e195c){_0x57b09a(_0x3e195c);});};AGIVertices[_0xb431('0x10')][_0xb431('0x79')]=function(_0x536285,_0x2e426b){scripts[_0xb431('0x79')](this[_0xb431('0xd')][_0xb431('0x3c')],_0x536285[_0xb431('0x7a')],_0x536285['client_email'],_0x536285[_0xb431('0x7b')],_0x536285[_0xb431('0x5a')],_0x536285[_0xb431('0x7c')]||'en')[_0xb431('0x17')](function(_0x3ee81c){_0x2e426b(null,_0x3ee81c);})[_0xb431('0x14')](function(_0x1533c6){_0x2e426b(_0x1533c6);});};AGIVertices[_0xb431('0x10')][_0xb431('0x7d')]=function(_0x3040f4,_0x51d25d){scripts[_0xb431('0x7d')](this[_0xb431('0xd')],_0x3040f4)[_0xb431('0x17')](function(_0x5afc2e){_0x51d25d(null,_0x5afc2e);})['catch'](function(_0x398561){_0x51d25d(_0x398561);});};AGIVertices[_0xb431('0x10')][_0xb431('0x7e')]=function(_0x482822,_0x4a8dfe){scripts[_0xb431('0x7e')](_0x482822[_0xb431('0x78')],_0x482822[_0xb431('0x5a')],_0x482822[_0xb431('0x7f')]||_0xb431('0x5c'),_0x482822['speed'])['then'](function(_0x377522){_0x4a8dfe(null,_0x377522);})[_0xb431('0x14')](function(_0x493b6d){_0x4a8dfe(_0x493b6d);});};AGIVertices[_0xb431('0x10')][_0xb431('0x80')]=function(_0x1f491b,_0x3975b8,_0x2d696a){scripts[_0xb431('0x80')](_0x3975b8,_0x1f491b['key'],_0x1f491b['ispeech_asr_language']||_0xb431('0x5c'),this[_0xb431('0x81')](_0x1f491b[_0xb431('0x82')])?_0x1f491b[_0xb431('0x82')]:undefined)[_0xb431('0x17')](function(_0x36678c){_0x2d696a(null,_0x36678c);})['catch'](function(_0x19db37){_0x2d696a(_0x19db37);});};AGIVertices[_0xb431('0x10')][_0xb431('0x83')]=function(_0xe039ae,_0x462be8){scripts[_0xb431('0x83')](_0xe039ae[_0xb431('0x84')],_0xe039ae[_0xb431('0x85')],_0xe039ae[_0xb431('0x86')],_0xe039ae[_0xb431('0x87')]||_0xb431('0x88'),_0xe039ae['text'],_0xe039ae[_0xb431('0x89')]||_0xb431('0x5a'))[_0xb431('0x17')](function(_0x5f2caf){_0x462be8(null,_0x5f2caf);})[_0xb431('0x14')](function(_0x1cebee){_0x462be8(_0x1cebee);});};AGIVertices[_0xb431('0x10')]['awsLex']=function(_0x152713,_0x170bb5){scripts[_0xb431('0x8a')](this[_0xb431('0xd')][_0xb431('0x3c')],_0x152713[_0xb431('0x84')],_0x152713[_0xb431('0x85')],_0x152713[_0xb431('0x8b')],_0x152713['text'],_0x152713[_0xb431('0x8c')])[_0xb431('0x17')](function(_0x12b8c5){_0x170bb5(null,_0x12b8c5);})['catch'](function(_0x6086bd){_0x170bb5(_0x6086bd);});};AGIVertices[_0xb431('0x10')][_0xb431('0x8d')]=function(_0xc4117f,_0x1bcab1,_0x206854){scripts[_0xb431('0x8d')](_0x1bcab1,_0xc4117f['key'],_0xc4117f[_0xb431('0x8e')]||_0xb431('0x5c'))[_0xb431('0x17')](function(_0x155a86){_0x206854(null,_0x155a86);})[_0xb431('0x14')](function(_0x5edfad){_0x206854(_0x5edfad);});};AGIVertices['prototype'][_0xb431('0x8f')]=function(_0x492558,_0x3c125,_0x594aa7){scripts[_0xb431('0x8f')](_0x3c125,_0x492558[_0xb431('0x90')],_0x492558[_0xb431('0x91')],_0x492558[_0xb431('0x92')])[_0xb431('0x17')](function(_0x4e9c16){_0x594aa7(null,_0x4e9c16);})[_0xb431('0x14')](function(_0x2b2a4d){_0x594aa7(_0x2b2a4d);});};AGIVertices[_0xb431('0x10')][_0xb431('0x93')]=function(_0x343877){var _0x419e64=_[_0xb431('0x66')](verticesWithRetry,_0x343877[_0xb431('0x38')])?_0x343877:_[_0xb431('0x94')](_0x343877);for(var _0x547848 in _0x419e64){if(_0x419e64[_0xb431('0x95')](_0x547848)){if(_0x419e64[_0x547848]&&_[_0xb431('0x96')](_0x419e64[_0x547848])){if(_[_0xb431('0x66')](recursiveMapAttributes,_0x547848)){_0x419e64[_0x547848]=this[_0xb431('0x97')](_0x419e64[_0x547848]);}else{_0x419e64[_0x547848]=this[_0xb431('0x98')](_0x419e64[_0x547848]);}}}}return _0x419e64;};AGIVertices[_0xb431('0x10')]['recursiveNodeIndex']=function(_0x3983e0){for(var _0x454fd3 in _0x3983e0){if(_0x3983e0[_0xb431('0x95')](_0x454fd3)){if(_[_0xb431('0x99')](_0x3983e0[_0x454fd3])){this['recursiveNodeIndex'](_0x3983e0[_0x454fd3]);}else if(_[_0xb431('0x9a')](_0x3983e0[_0x454fd3])){for(var _0x13b13b=0x0;_0x13b13b<_0x3983e0[_0x454fd3][_0xb431('0x9b')];_0x13b13b++){this['recursiveNodeIndex'](_0x3983e0[_0x454fd3][_0x13b13b]);}}else if(_['isString'](_0x3983e0[_0x454fd3])){_0x3983e0[_0x454fd3]=this[_0xb431('0x98')](_0x3983e0[_0x454fd3]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0xdff35e,_0x45a890){for(var _0x9e614b in _0xdff35e){if(_0xdff35e[_0xb431('0x95')](_0x9e614b)){if(_[_0xb431('0x99')](_0xdff35e[_0x9e614b])){if(!_[_0xb431('0x45')](_0xdff35e[_0x9e614b])){this[_0xb431('0x9c')](_0xdff35e[_0x9e614b],util[_0xb431('0x2a')]('%s.%s',_0x45a890,_0x9e614b));}}else if(_[_0xb431('0x9a')](_0xdff35e[_0x9e614b])){for(var _0x4d8761=0x0;_0x4d8761<_0xdff35e[_0x9e614b][_0xb431('0x9b')];_0x4d8761++){this[_0xb431('0x9c')](_0xdff35e[_0x9e614b][_0x4d8761],util[_0xb431('0x2a')](_0xb431('0x9d'),_0x45a890,_0x9e614b+'['+_0x4d8761+']'));}}else{if(!_['isNil'](_0xdff35e[_0x9e614b])){this[_0xb431('0xd')][_0xb431('0x9e')](util[_0xb431('0x2a')]('%s.%s',_0x45a890,_0x9e614b),_0xdff35e[_0x9e614b]);}}}}};AGIVertices[_0xb431('0x10')]['replaceObjectAllVariables']=function(_0x2e2882){try{var _0x69bba7=JSON[_0xb431('0x6d')](_0x2e2882);this[_0xb431('0x9f')](_0x69bba7);return JSON[_0xb431('0x72')](_0x69bba7);}catch(_0x18d43a){return this[_0xb431('0x98')](_0x2e2882);}};AGIVertices[_0xb431('0x10')][_0xb431('0x98')]=function(_0x893cdd){var _0x2f7c0b=_0x893cdd['split']('{');for(var _0xdf4e53=0x1;_0xdf4e53<_0x2f7c0b[_0xb431('0x9b')];_0xdf4e53+=0x1){var _0xa939bb=_0x2f7c0b[_0xdf4e53][_0xb431('0xa0')]('}');if(_0xa939bb[_0xb431('0x9b')]>0x1){_0x893cdd=_0x893cdd[_0xb431('0xa1')]('{'+_0xa939bb[0x0]+'}',this[_0xb431('0xd')][_0xb431('0x11')](_0xa939bb[0x0])[_0xb431('0xa2')]||_0xa939bb[0x0]);}}if(_0x2f7c0b[_0xb431('0x9b')]===0x1){return _0x893cdd['toString']();}return this[_0xb431('0x98')](_0x893cdd);};AGIVertices[_0xb431('0x10')][_0xb431('0xa3')]=function(_0x4c8f0e,_0x59a498){var _0x2bbe19=this[_0xb431('0xd')]['getVariable'](_0x4c8f0e);if(_0x2bbe19['result']===-0x1){return _0x2bbe19;}logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xa4'),_0x59a498,_0x2bbe19[_0xb431('0xa2')]));return this[_0xb431('0xd')][_0xb431('0x9e')](_0x59a498,_0x2bbe19[_0xb431('0xa2')]);};AGIVertices[_0xb431('0x10')][_0xb431('0x81')]=function(_0x4edcda){return _0x4edcda&&_0x4edcda!=='0'&&_0x4edcda!=='-1'&&_0x4edcda!=='';};AGIVertices['prototype']['maxRetry']=function(_0x54b557){this[_0xb431('0x36')][_0xb431('0x70')](this,_0x54b557,'-');_0x54b557[_0xb431('0xa5')]=_0x54b557[_0xb431('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xb431('0xa7')]=function(_0x5848b2){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xa8'),_0x5848b2[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x5848b2[_0xb431('0x5a')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xaa'));}var _0x32bf03='\x22'+_0x5848b2[_0xb431('0x5a')]+'\x22';if(this[_0xb431('0x81')](_0x5848b2[_0xb431('0x76')])){_0x32bf03+=','+_0x5848b2[_0xb431('0x76')];}var _0x3927b1=this['channel']['exec'](_0xb431('0xab'),_0x32bf03);if(_0x3927b1[_0xb431('0xac')]===-0x1){return _0x3927b1;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x32bf03));};AGIVertices[_0xb431('0x10')][_0xb431('0xad')]=function(_0x2e91c3){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xae'),_0x2e91c3[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x2e91c3[_0xb431('0xaf')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xb0'));}var _0x5d469e=_0x2e91c3['grammar'];if(this['isConfigured'](_0x2e91c3[_0xb431('0x76')])){_0x5d469e+=','+_0x2e91c3['options'];}var _0x4a9402=this[_0xb431('0xd')]['exec'](_0xb431('0xb1'),_0x5d469e);if(_0x4a9402[_0xb431('0xac')]===-0x1){return _0x4a9402;}var _0x358cd1=this['getAndSetVariable'](_0xb431('0xb2'),_0xb431('0xb3'));if(_0x358cd1[_0xb431('0xac')]===-0x1){return _0x358cd1;}var _0x4d855b=this['getAndSetVariable'](_0xb431('0xb4'),_0xb431('0xb5'));if(_0x4d855b['result']===-0x1){return _0x4d855b;}var _0x1fb380=this[_0xb431('0xa3')](_0xb431('0xb6'),_0xb431('0xb7'));if(_0x1fb380[_0xb431('0xac')]===-0x1){return _0x1fb380;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5d469e));};AGIVertices[_0xb431('0x10')][_0xb431('0x9')]=function(_0x519358){logger[_0xb431('0x2f')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x519358[_0xb431('0x37')]));return this['channel'][_0xb431('0x9')]([_0x519358[_0xb431('0xb8')],_0x519358[_0xb431('0xb9')]]);};AGIVertices[_0xb431('0x10')]['answer']=function(_0x4840c9){logger[_0xb431('0x2f')](util['format'](_0xb431('0xba'),_0x4840c9['label']));if(this['isConfigured'](_0x4840c9[_0xb431('0x64')])){logger[_0xb431('0x2f')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x4840c9['timeout']));var _0x56c790=this[_0xb431('0xd')]['wait'](_0x4840c9[_0xb431('0x64')]);if(_0x56c790[_0xb431('0xac')]===-0x1){return _0x56c790;}}return this[_0xb431('0xd')][_0xb431('0xbb')]();};AGIVertices[_0xb431('0x10')][_0xb431('0xbc')]=function(_0x36edbf){logger[_0xb431('0x2f')](util['format'](_0xb431('0xbd'),_0x36edbf[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x36edbf[_0xb431('0x49')])){return this['channel'][_0xb431('0x2e')](_0x36edbf,'no\x20list\x20selected');}_0x36edbf[_0xb431('0x4a')]=moment();if(this['isConfigured'](_0x36edbf[_0xb431('0xbe')])){_0x36edbf[_0xb431('0x4a')]=moment()[_0xb431('0xbf')](_0x36edbf[_0xb431('0xbe')],_0xb431('0xc0'));}if(!this[_0xb431('0x81')](_0x36edbf['callback_priority'])){_0x36edbf['callback_priority']=0x2;}this[_0xb431('0x43')][_0xb431('0x70')](this,_0x36edbf);return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xc1'),_0x36edbf[_0xb431('0x48')],_0x36edbf[_0xb431('0x49')],_0x36edbf[_0xb431('0x4a')]));};AGIVertices['prototype'][_0xb431('0xc2')]=function(_0x30be40){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xc3'),_0x30be40[_0xb431('0x37')]));var _0x2f9b84=this[_0xb431('0xd')]['exec'](_0x30be40['application'],_0x30be40[_0xb431('0x76')]);if(_0x2f9b84['result']===-0x1){return _0x2f9b84;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x30be40[_0xb431('0xc4')],_0x30be40[_0xb431('0x76')]));};AGIVertices[_0xb431('0x10')][_0xb431('0xc5')]=function(_0x4f9448){logger[_0xb431('0x2f')](util['format'](_0xb431('0xc6'),_0x4f9448['label']));if(!this['isConfigured'](_0x4f9448[_0xb431('0x5a')])){return this[_0xb431('0xd')]['noop'](_0xb431('0xaa'));}var _0x5eaa9b='\x22'+_0x4f9448[_0xb431('0x5a')]+'\x22';if(this[_0xb431('0x81')](_0x4f9448[_0xb431('0x76')])){_0x5eaa9b+=','+_0x4f9448[_0xb431('0x76')];}var _0x55e990=this[_0xb431('0xd')]['exec']('MRCPSynth',_0x5eaa9b);if(_0x55e990['result']===-0x1){return _0x55e990;}return this[_0xb431('0xd')][_0xb431('0xa9')](util['format'](_0xb431('0xc7'),_0x5eaa9b));};AGIVertices['prototype'][_0xb431('0xc8')]=function(_0x328410){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xc9'),_0x328410[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x328410[_0xb431('0x5a')])){return this[_0xb431('0xd')][_0xb431('0xa9')]('no\x20text\x20configured');}var _0x5e2f00='\x22'+_0x328410[_0xb431('0x5a')]+'\x22';if(this['isConfigured'](_0x328410[_0xb431('0x76')])){_0x5e2f00+=','+_0x328410[_0xb431('0x76')];}var _0xa83439=this[_0xb431('0xd')][_0xb431('0x55')]('MRCPSynth',_0x5e2f00);if(_0xa83439[_0xb431('0xac')]===-0x1){return _0xa83439;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5e2f00));};AGIVertices['prototype'][_0xb431('0xca')]=function(_0x40ef07){logger['info'](util[_0xb431('0x2a')](_0xb431('0xcb'),_0x40ef07[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x40ef07['grammar'])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xb0'));}var _0x47c542=_0x40ef07[_0xb431('0xaf')];if(this['isConfigured'](_0x40ef07[_0xb431('0x76')])){_0x47c542+=','+_0x40ef07[_0xb431('0x76')];}var _0x1baace=this[_0xb431('0xd')][_0xb431('0x55')](_0xb431('0xb1'),_0x47c542);if(_0x1baace[_0xb431('0xac')]===-0x1){return _0x1baace;}var _0x2bab01=this[_0xb431('0xa3')](_0xb431('0xb2'),_0xb431('0xcc'));if(_0x2bab01['result']===-0x1){return _0x2bab01;}var _0x46be51=this[_0xb431('0xa3')](_0xb431('0xb4'),_0xb431('0xcd'));if(_0x46be51[_0xb431('0xac')]===-0x1){return _0x46be51;}var _0x2a31af=this[_0xb431('0xa3')](_0xb431('0xb6'),_0xb431('0xce'));if(_0x2a31af['result']===-0x1){return _0x2a31af;}return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xcf'),_0x47c542));};AGIVertices[_0xb431('0x10')][_0xb431('0xd0')]=function(_0x148ca5){logger['info'](util[_0xb431('0x2a')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x148ca5[_0xb431('0x37')]));if(!this['isConfigured'](_0x148ca5[_0xb431('0xaf')])){return this[_0xb431('0xd')][_0xb431('0xa9')]('no\x20grammar\x20configured');}var _0x51c815=_0x148ca5['grammar'];if(this['isConfigured'](_0x148ca5[_0xb431('0x76')])){_0x51c815+=','+_0x148ca5[_0xb431('0x76')];}var _0x2a47c2=this[_0xb431('0xd')]['exec'](_0xb431('0xb1'),_0x51c815);if(_0x2a47c2[_0xb431('0xac')]===-0x1){return _0x2a47c2;}var _0x3e731f=this[_0xb431('0xa3')]('RECOG_CONFIDENCE()',_0xb431('0xd1'));if(_0x3e731f[_0xb431('0xac')]===-0x1){return _0x3e731f;}var _0x217f8b=this[_0xb431('0xa3')](_0xb431('0xb4'),_0xb431('0xd2'));if(_0x217f8b[_0xb431('0xac')]===-0x1){return _0x217f8b;}var _0x18e873=this[_0xb431('0xa3')](_0xb431('0xb6'),_0xb431('0xd3'));if(_0x18e873[_0xb431('0xac')]===-0x1){return _0x18e873;}return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x51c815));};AGIVertices[_0xb431('0x10')][_0xb431('0xd4')]=function(_0x1ca4e4){logger['info'](util[_0xb431('0x2a')](_0xb431('0xd5'),_0x1ca4e4[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x1ca4e4[_0xb431('0xd6')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x1ca4e4,_0xb431('0xd7'));}var _0x22b17d=this['getSquareOdbc']['sync'](this,_0x1ca4e4[_0xb431('0xd6')]);if(!_0x22b17d){return this[_0xb431('0xd')]['error'](_0x1ca4e4,_0xb431('0xd8'));}if(!this['isConfigured'](_0x1ca4e4[_0xb431('0xd9')])){return this[_0xb431('0xd')]['error'](_0x1ca4e4,'no\x20query\x20configured');}var _0x5dc018=_0x1ca4e4[_0xb431('0xd9')][_0xb431('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xda'),_0x5dc018));var _0x311cc9=this[_0xb431('0x2c')][_0xb431('0x70')](this,_0x22b17d,_0x5dc018);this[_0xb431('0x36')]['sync'](this,_0x1ca4e4,_0x5dc018);if(!this[_0xb431('0x81')](_0x1ca4e4[_0xb431('0xdb')])){return this[_0xb431('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2fe441=this[_0xb431('0x11')][_0xb431('0x70')](this,_0x1ca4e4[_0xb431('0xdb')]);if(!_0x2fe441){return this['channel'][_0xb431('0x2e')](_0x1ca4e4,_0xb431('0xdc'));}var _0x1f8c31=this;_0x311cc9[_0xb431('0xdd')](function(_0x46a308,_0x3da5e7){Object[_0xb431('0xde')](_0x46a308)[_0xb431('0xdd')](function(_0x3a54a8){_0x1f8c31[_0xb431('0xd')][_0xb431('0x9e')](util['format']('%s[%s][%s]',_0x2fe441,_0x3da5e7,_0x3a54a8),_0x46a308[_0x3a54a8]);});});this['channel']['setVariable'](util[_0xb431('0x2a')]('%s_ROWS_COUNT',_0x2fe441),_0x311cc9['length']);return this['channel']['noop'](util[_0xb431('0x2a')](_0xb431('0xdf'),_0x2fe441));};AGIVertices[_0xb431('0x10')][_0xb431('0xe0')]=function(_0xdfd900){logger['debug'](util[_0xb431('0x2a')](_0xb431('0xe1'),_0xdfd900[_0xb431('0x37')]));if(!this['isConfigured'](_0xdfd900[_0xb431('0xe2')])){return this['channel'][_0xb431('0x2e')](_0xdfd900,_0xb431('0xe3'));}var _0x1a48e3=this[_0xb431('0xe4')][_0xb431('0x70')](this,_0xdfd900['sip_id']);if(!_0x1a48e3){return this[_0xb431('0xd')]['error'](_0xdfd900,'no\x20user\x20found');}var _0x3536a4=this[_0xb431('0xd')][_0xb431('0x55')]('DIAL',[util[_0xb431('0x2a')](_0xb431('0xe5'),_0x1a48e3),_0xdfd900['timeout'],_0xdfd900[_0xb431('0xe6')],_0xdfd900[_0xb431('0x62')]]);if(_0x3536a4[_0xb431('0xac')]===-0x1){return _0x3536a4;}return this[_0xb431('0xd')][_0xb431('0xa9')](util['format']('Executed\x20command\x20%s',_0xb431('0xe7')));};AGIVertices[_0xb431('0x10')]['dialogflow']=function(_0x52dc67){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0xe8'),_0x52dc67[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x52dc67[_0xb431('0x78')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xe9'));}if(!this[_0xb431('0x81')](_0x52dc67[_0xb431('0x5a')])){return this['channel'][_0xb431('0xa9')](_0xb431('0xaa'));}this[_0xb431('0xd')][_0xb431('0xea')]=!![];this['createSquareDetailsReport'](_0x52dc67);this[_0xb431('0x42')](_0x52dc67[_0xb431('0x5a')],'in','','');this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0xeb'),_0x52dc67['text']));var _0x4df701=this[_0xb431('0x77')][_0xb431('0x70')](this,_0x52dc67);if(_0x4df701){for(var _0x2c59b9 in _0x4df701){if(_0x4df701[_0xb431('0x95')](_0x2c59b9)){this[_0xb431('0xd')][_0xb431('0x9e')](util[_0xb431('0x2a')]('DIALOGFLOW_%s',_0x2c59b9[_0xb431('0xec')]()),_0x4df701[_0x2c59b9]);}}this[_0xb431('0x42')](_0x4df701[_0xb431('0xed')],'out',_0xb431('0xee'),'');return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xef'),_0x4df701['speech']));}return this[_0xb431('0xd')]['error'](_0x52dc67,_0xb431('0xf0'));};AGIVertices[_0xb431('0x10')][_0xb431('0xf1')]=function(_0x1b3e5f){logger[_0xb431('0x2f')](util['format'](_0xb431('0xf2'),_0x1b3e5f['label']));if(!this[_0xb431('0x81')](_0x1b3e5f[_0xb431('0x7a')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xf3'));}if(!this[_0xb431('0x81')](_0x1b3e5f[_0xb431('0xf4')])){return this[_0xb431('0xd')]['noop'](_0xb431('0xf5'));}if(!this[_0xb431('0x81')](_0x1b3e5f['private_key'])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xf6'));}if(!this[_0xb431('0x81')](_0x1b3e5f[_0xb431('0x7c')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xf7'));}if(!this[_0xb431('0x81')](_0x1b3e5f[_0xb431('0x5a')])){return this[_0xb431('0xd')]['noop'](_0xb431('0xaa'));}this[_0xb431('0xd')][_0xb431('0xea')]=!![];this[_0xb431('0x36')](_0x1b3e5f);this[_0xb431('0x42')](_0x1b3e5f[_0xb431('0x5a')],'in','','');this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0xf8'),_0x1b3e5f[_0xb431('0x5a')]));var _0x4904f8=this[_0xb431('0x79')][_0xb431('0x70')](this,_0x1b3e5f);if(_0x4904f8){for(var _0xe13bd in _0x4904f8){if(_0x4904f8[_0xb431('0x95')](_0xe13bd)){if(_0xe13bd!==_0xb431('0xf9')){this[_0xb431('0xd')][_0xb431('0x9e')](util[_0xb431('0x2a')](_0xb431('0xfa'),_0xe13bd['toUpperCase']()),_0x4904f8[_0xe13bd]);}}}this[_0xb431('0x42')](_0x4904f8[_0xb431('0xed')],_0xb431('0xfb'),_0xb431('0xf1'),_0x4904f8['providerResponse']);return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xfc'),_0x4904f8[_0xb431('0xed')]));}return this['channel'][_0xb431('0x2e')](_0x1b3e5f,_0xb431('0xfd'));};AGIVertices[_0xb431('0x10')]['sesteknda']=function(_0x444644){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x444644[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x444644[_0xb431('0xfe')])){return this[_0xb431('0xd')][_0xb431('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x444644[_0xb431('0xff')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x100'));}if(!this[_0xb431('0x81')](_0x444644['password'])){return this['channel'][_0xb431('0xa9')](_0xb431('0x101'));}if(!this[_0xb431('0x81')](_0x444644[_0xb431('0x102')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xaa'));}this[_0xb431('0xd')][_0xb431('0xea')]=!![];this[_0xb431('0x36')](_0x444644);this[_0xb431('0x42')](_0x444644[_0xb431('0x5a')],'in','','');this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x103'),_0x444644[_0xb431('0x5a')]));var _0x19c2bc=this['sestekNDA']['sync'](this,_0x444644);if(_0x19c2bc){for(var _0x7e4004 in _0x19c2bc){if(_0x19c2bc[_0xb431('0x95')](_0x7e4004)){this['channel']['setVariable'](util[_0xb431('0x2a')](_0xb431('0x104'),_0x7e4004[_0xb431('0xec')]()),_0x19c2bc[_0x7e4004]);}}this[_0xb431('0x42')](_0x19c2bc[_0xb431('0xed')],_0xb431('0xfb'),'sesteknda','');if(_0x19c2bc['audiofile']){this[_0xb431('0xd')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x19c2bc[_0xb431('0x105')]));var _0x5db23b=this[_0xb431('0xd')][_0xb431('0x106')](_0x19c2bc['audiofile']);try{fs[_0xb431('0x107')](_0x19c2bc[_0xb431('0x105')]+_0xb431('0x108'));}catch(_0x5a54bf){logger[_0xb431('0x2e')](_0x5a54bf);}return _0x5db23b;}else{return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('SestekNDA\x20Result\x20%s',_0x19c2bc[_0xb431('0xed')]));}}return this[_0xb431('0xd')][_0xb431('0x2e')](_0x444644,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xb431('0x10')][_0xb431('0x109')]=function(_0x395240){logger['info'](util[_0xb431('0x2a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x395240[_0xb431('0x37')]));return this[_0xb431('0xd')]['noop']('end');};AGIVertices[_0xb431('0x10')][_0xb431('0x10a')]=function(_0x155efd){logger['info'](util[_0xb431('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x155efd[_0xb431('0x37')]));var _0x3dd896='';if(_0x155efd[_0xb431('0x10b')]){if(!this[_0xb431('0x81')](_0x155efd[_0xb431('0x10b')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x155efd,_0xb431('0x10c'));}else{var _0x1b7340=parseInt(_0x155efd[_0xb431('0x10b')],0xa);if(isNaN(_0x1b7340)){_0x3dd896=_0x155efd[_0xb431('0x10b')];}else{_0x3dd896=this[_0xb431('0x10d')][_0xb431('0x70')](this,_0x155efd['trunk_id']);if(!_0x3dd896){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x155efd,'no\x20trunk\x20found');}}}}else if(_0x155efd['trunk_name']){_0x3dd896=_0x155efd[_0xb431('0x10e')];}else{return this[_0xb431('0xd')][_0xb431('0x2e')](_0x155efd,_0xb431('0x10c'));}var _0x19e8d8=this[_0xb431('0xd')]['exec'](_0xb431('0xe7'),[util[_0xb431('0x2a')](_0xb431('0x10f'),_0x3dd896,_0x155efd[_0xb431('0x48')]),_0x155efd[_0xb431('0x64')],_0x155efd[_0xb431('0xe6')],_0x155efd[_0xb431('0x62')]]);if(_0x19e8d8[_0xb431('0xac')]===-0x1){return _0x19e8d8;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x110'),_0xb431('0xe7')));};AGIVertices[_0xb431('0x10')][_0xb431('0x111')]=function(_0x3034ef){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x3034ef[_0xb431('0x37')]));return this[_0xb431('0xd')][_0xb431('0xa9')]('finally');};AGIVertices[_0xb431('0x10')][_0xb431('0xc')]=function(_0x274b4d){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x274b4d['label']));if(_0x274b4d[_0xb431('0xa5')]===0x0){return this[_0xb431('0xa6')](_0x274b4d);}_0x274b4d['retry']-=0x1;if(!this[_0xb431('0x81')](_0x274b4d[_0xb431('0x112')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x274b4d,'no\x20file\x20audio\x20selected');}var _0x1ced07=this[_0xb431('0x1e')][_0xb431('0x70')](this,_0x274b4d[_0xb431('0x112')]);if(!_0x1ced07){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x274b4d,_0xb431('0x113'));}if(!this['isConfigured'](_0x274b4d[_0xb431('0xdb')])){return this['channel'][_0xb431('0x2e')](_0xb431('0x114'));}var _0x58c02e=this['channel']['getData'](_0x1ced07,_0x274b4d['response'],_0x274b4d[_0xb431('0x115')]);var _0x385e19=_0x58c02e['result']?_0x58c02e['result'][_0xb431('0x116')]():'';logger[_0xb431('0x2f')](_0xb431('0x117'),JSON[_0xb431('0x72')](_0x58c02e));if(_0x58c02e[_0xb431('0xac')]===-0x1){this['createSquareDetailsReport'][_0xb431('0x70')](this,_0x274b4d,_0x385e19);return _0x58c02e;}else if(_0x58c02e[_0xb431('0xa2')]===_0xb431('0x64')){_0x58c02e['result']=_0x385e19[_0xb431('0x9b')]>=parseInt(_0x274b4d[_0xb431('0x118')])?'x':'i';}else{_0x58c02e[_0xb431('0xac')]=_0x385e19[_0xb431('0x9b')]>=parseInt(_0x274b4d[_0xb431('0x118')])&&_0x385e19['length']<=parseInt(_0x274b4d['maxdigit'])?'x':'i';}var _0x296395=this[_0xb431('0x11')][_0xb431('0x70')](this,_0x274b4d[_0xb431('0xdb')]);if(!_0x296395){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x274b4d,_0xb431('0xdc'));}this[_0xb431('0xd')][_0xb431('0x9e')](_0x296395,_0x385e19);if(this[_0xb431('0x81')](_0x274b4d[_0xb431('0x119')])){var _0x2d4c63=parseInt(_0x274b4d[_0xb431('0x119')],0xa);var _0x2f9e8a=rs[_0xb431('0x11a')]({'charset':'*','length':_0x2d4c63});var _0x244730=_0x385e19[_0xb431('0x9b')];if(_0x244730>0x0){if(_0x244730>_0x2d4c63){this[_0xb431('0x36')][_0xb431('0x70')](this,_0x274b4d,_0x274b4d[_0xb431('0x11b')]==='first'?_0x2f9e8a+_0x385e19[_0xb431('0x11c')](_0x2d4c63):_0x385e19[_0xb431('0x11c')](0x0,_0x244730-_0x2d4c63)+_0x2f9e8a);}else{this[_0xb431('0x36')][_0xb431('0x70')](this,_0x274b4d,rs[_0xb431('0x11a')]({'charset':'*','length':_0x244730}));}}else{this[_0xb431('0x36')][_0xb431('0x70')](this,_0x274b4d,'');}}else{this[_0xb431('0x36')][_0xb431('0x70')](this,_0x274b4d,_0x385e19);}return _0x58c02e;};AGIVertices[_0xb431('0x10')]['getsecretdigits']=function(_0x3b1d0f){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x11d'),_0x3b1d0f[_0xb431('0x37')]));return this['getdigits'](_0x3b1d0f);};AGIVertices[_0xb431('0x10')][_0xb431('0x11e')]=function(_0x5c3940){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x11f'),_0x5c3940[_0xb431('0x37')]));this[_0xb431('0x36')]['sync'](this,_0x5c3940,_0x5c3940['goalname']);return this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0x120'),_0x5c3940[_0xb431('0x121')]));};AGIVertices[_0xb431('0x10')]['awspolly']=function(_0x5d7dc9){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x122'),_0x5d7dc9[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x5d7dc9[_0xb431('0x84')])||!this[_0xb431('0x81')](_0x5d7dc9[_0xb431('0x85')])){return this[_0xb431('0xd')]['noop'](_0xb431('0x123'));}if(!this[_0xb431('0x81')](_0x5d7dc9[_0xb431('0x5a')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0xaa'));}this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0x124'),_0x5d7dc9['text']));var _0xb7ee79=this['awsPolly']['sync'](this,_0x5d7dc9);if(_0xb7ee79){this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x125'),_0xb7ee79));var _0x706566=this[_0xb431('0xd')][_0xb431('0x106')](_0xb7ee79);try{fs[_0xb431('0x107')](_0xb7ee79+_0xb431('0x108'));}catch(_0x5db9bc){logger[_0xb431('0x2e')](_0x5db9bc);}return _0x706566;}return this['channel'][_0xb431('0x2e')](_0x5d7dc9,_0xb431('0x126'));};AGIVertices[_0xb431('0x10')][_0xb431('0x127')]=function(_0x5e0eb3){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x128'),_0x5e0eb3['label']));if(!this['isConfigured'](_0x5e0eb3[_0xb431('0x84')])||!this[_0xb431('0x81')](_0x5e0eb3[_0xb431('0x85')])){return this[_0xb431('0xd')]['noop'](_0xb431('0x123'));}if(!this['isConfigured'](_0x5e0eb3[_0xb431('0x8c')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x129'));}if(!this[_0xb431('0x81')](_0x5e0eb3[_0xb431('0x5a')])){return this[_0xb431('0xd')]['noop'](_0xb431('0xaa'));}this[_0xb431('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x5e0eb3);this[_0xb431('0x42')](_0x5e0eb3['text'],'in','','');this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5e0eb3[_0xb431('0x5a')]));var _0x171c48=this['awsLex'][_0xb431('0x70')](this,_0x5e0eb3);if(_0x171c48){for(var _0x474203 in _0x171c48){if(_0x171c48[_0xb431('0x95')](_0x474203)&&_[_0xb431('0x96')](_0x171c48[_0x474203])){this['channel'][_0xb431('0x9e')](util[_0xb431('0x2a')](_0xb431('0x12a'),_0x474203[_0xb431('0xec')]()),_0x171c48[_0x474203]);}}if(_['isNil'](_0x171c48[_0xb431('0x74')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x12b'));}else{this[_0xb431('0x42')](_0x171c48['message'],_0xb431('0xfb'),_0xb431('0x12c'),'');return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Amazon\x20Lex\x20Result\x20%s',_0x171c48[_0xb431('0x74')]));}}return this[_0xb431('0xd')][_0xb431('0x2e')](_0x5e0eb3,_0xb431('0x12d'));};AGIVertices['prototype'][_0xb431('0x12e')]=function(_0x1a02ef){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x12f'),_0x1a02ef[_0xb431('0x37')],_0x1a02ef[_0xb431('0x64')]));if(!this[_0xb431('0x81')](_0x1a02ef['key'])){return this['channel'][_0xb431('0xa9')]('no\x20key\x20configured');}var _0x3e488f=_0xb431('0x130');var _0x27c40f=util[_0xb431('0x2a')](_0xb431('0x131'),FILES_PATH,rs[_0xb431('0x11a')](0x4));var _0x3ef26f=util[_0xb431('0x2a')](_0xb431('0x9d'),_0x27c40f,_0x3e488f);var _0xabc313=!![];if(_0x1a02ef[_0xb431('0x132')]===_0xb431('0x133')){_0xabc313=![];}var _0x1f3111=this[_0xb431('0xd')][_0xb431('0x134')](_0x27c40f,_0x3e488f,_0x1a02ef[_0xb431('0x135')],_0x1a02ef[_0xb431('0x64')],undefined,_0xabc313);if(_0x1f3111[_0xb431('0xac')]!==-0x1){this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x136'),_0x3ef26f));var _0x214f09=this[_0xb431('0x8d')][_0xb431('0x70')](this,_0x1a02ef,_0x3ef26f);if(_0x214f09){for(var _0xbd48d2 in _0x214f09){if(_0x214f09[_0xb431('0x95')](_0xbd48d2)){this[_0xb431('0xd')][_0xb431('0x9e')](util[_0xb431('0x2a')](_0xb431('0x137'),_0xbd48d2[_0xb431('0xec')]()),_0x214f09[_0xbd48d2]);}}return this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0x138'),JSON[_0xb431('0x72')](_0x214f09)));}}return _0x1f3111;};AGIVertices[_0xb431('0x10')][_0xb431('0x139')]=function(_0x33a129){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x33a129[_0xb431('0x37')]));if(!this['isConfigured'](_0x33a129[_0xb431('0x90')])){return this[_0xb431('0xd')]['noop']('no\x20appid\x20configured');}if(!this[_0xb431('0x81')](_0x33a129[_0xb431('0x91')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x13a'));}var _0x25e672=_0xb431('0x130');var _0x3c71c3=util[_0xb431('0x2a')](_0xb431('0x131'),FILES_PATH,rs[_0xb431('0x11a')](0x4));var _0x314c07=util[_0xb431('0x2a')]('%s.%s',_0x3c71c3,_0x25e672);var _0x1fdbea=!![];if(_0x33a129[_0xb431('0x132')]===_0xb431('0x133')){_0x1fdbea=![];}var _0x274baa=this[_0xb431('0xd')]['recordFile'](_0x3c71c3,_0x25e672,_0x33a129['intKey'],_0x33a129['timeout'],undefined,_0x1fdbea);if(_0x274baa[_0xb431('0xac')]!==-0x1){this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('tilde\x20%s\x20file\x20created',_0x314c07));var _0x236aa8=this[_0xb431('0x8f')][_0xb431('0x70')](this,_0x33a129,_0x314c07);if(_0x236aa8){for(var _0x56dee6 in _0x236aa8){if(_0x236aa8['hasOwnProperty'](_0x56dee6)){this[_0xb431('0xd')]['setVariable'](util[_0xb431('0x2a')]('TILDE_ASR_%s',_0x56dee6[_0xb431('0xec')]()),_0x236aa8[_0x56dee6]);}}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('TildeASR\x20Result\x20%s',JSON[_0xb431('0x72')](_0x236aa8)));}}return _0x274baa;};AGIVertices[_0xb431('0x10')][_0xb431('0x13b')]=function(_0x14d68b){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x13c'),_0x14d68b[_0xb431('0x37')]));return this[_0xb431('0xd')]['continueAt'](_0x14d68b[_0xb431('0x3e')],_0x14d68b[_0xb431('0x3f')],_0x14d68b['priority']);};AGIVertices['prototype'][_0xb431('0x13d')]=function(_0x166f7e){logger['info'](util[_0xb431('0x2a')](_0xb431('0x13e'),_0x166f7e['label']));if(!this['isConfigured'](_0x166f7e[_0xb431('0x13f')])){return this['channel']['error'](_0x166f7e,_0xb431('0x140'));}try{var _0x4270c1=eval(_0x166f7e['condition'])?_0xb431('0x141'):_0xb431('0x142');this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0x143'),_0x166f7e[_0xb431('0x13f')],_0x4270c1));return{'code':0xc8,'result':_0x4270c1};}catch(_0xe48500){return{'code':0xc8,'result':_0xb431('0x142')};}};AGIVertices[_0xb431('0x10')]['gotoiftime']=function(_0x57da32){logger['info'](util[_0xb431('0x2a')](_0xb431('0x144'),_0x57da32[_0xb431('0x37')]));if(!this['isConfigured'](_0x57da32[_0xb431('0x145')])){return this[_0xb431('0xd')]['error'](_0x57da32,_0xb431('0x146'));}var _0x2884c7=this['getIntervals'][_0xb431('0x70')](this,_0x57da32[_0xb431('0x145')]);if(!_0x2884c7){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x57da32,_0xb431('0x147'));}for(var _0x1ea5d2=0x0;_0x1ea5d2<_0x2884c7['length'];_0x1ea5d2+=0x1){var _0x1dc17d=this[_0xb431('0xd')][_0xb431('0x11')](util[_0xb431('0x2a')](_0xb431('0x148'),_0x2884c7[_0x1ea5d2]));if(_0x1dc17d[_0xb431('0xac')]===-0x1){return _0x1dc17d;}logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x149'),_0x2884c7[_0x1ea5d2],_0x1dc17d['extra']));if(_0x1dc17d[_0xb431('0xa2')]===_0xb431('0x141')){logger[_0xb431('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x2884c7[_0x1ea5d2],_0xb431('0x141')));this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('IFTIME\x20%s\x20%s',_0x2884c7[_0x1ea5d2],_0xb431('0x141')));return{'code':0xc8,'result':_0xb431('0x141')};}else{logger['info'](util['format'](_0xb431('0x149'),_0x2884c7[_0x1ea5d2],_0xb431('0x142')));this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x149'),_0x2884c7[_0x1ea5d2],_0xb431('0x142')));}}return{'code':0xc8,'result':_0xb431('0x142')};};AGIVertices[_0xb431('0x10')][_0xb431('0x14a')]=function(_0x210fc4){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x14b'),_0x210fc4['label']));return this[_0xb431('0xd')]['hangup']();};AGIVertices[_0xb431('0x10')][_0xb431('0x14c')]=function(_0x144bf5){logger['info'](util[_0xb431('0x2a')](_0xb431('0x14d'),_0x144bf5['label']));if(!this[_0xb431('0x81')](_0x144bf5[_0xb431('0x78')])){return this['channel'][_0xb431('0xa9')]('no\x20key\x20configured');}var _0x4819f2='wav';var _0x5e9ab6=util[_0xb431('0x2a')](_0xb431('0x131'),FILES_PATH,rs[_0xb431('0x11a')](0x4));var _0xba2bd6=util[_0xb431('0x2a')](_0xb431('0x9d'),_0x5e9ab6,_0x4819f2);var _0x3b5293=!![];if(_0x144bf5[_0xb431('0x132')]===_0xb431('0x133')){_0x3b5293=![];}var _0x83e0a3=this[_0xb431('0xd')][_0xb431('0x134')](_0x5e9ab6,_0x4819f2,_0x144bf5[_0xb431('0x135')],_0x144bf5[_0xb431('0x64')],undefined,_0x3b5293);if(_0x83e0a3['result']!==-0x1){this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('ispeech\x20%s\x20file\x20created',_0xba2bd6));var _0x1a8d68=this[_0xb431('0x80')][_0xb431('0x70')](this,_0x144bf5,_0xba2bd6);if(_0x1a8d68){for(var _0x2438b8 in _0x1a8d68){if(_0x1a8d68[_0xb431('0x95')](_0x2438b8)){this[_0xb431('0xd')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x2438b8['toUpperCase']()),_0x1a8d68[_0x2438b8]);}}return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x14e'),JSON['stringify'](_0x1a8d68)));}}return _0x83e0a3;};AGIVertices[_0xb431('0x10')][_0xb431('0x14f')]=function(_0x16f99b){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x150'),_0x16f99b[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x16f99b[_0xb431('0x78')])){return this['channel'][_0xb431('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x16f99b[_0xb431('0x5a')])){return this[_0xb431('0xd')]['noop'](_0xb431('0xaa'));}this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Trying\x20ispeech\x20TTS\x20%s',_0x16f99b[_0xb431('0x5a')]));var _0x313d40=this[_0xb431('0x7e')][_0xb431('0x70')](this,_0x16f99b);if(_0x313d40){this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x151'),_0x313d40));var _0x2a250a=this[_0xb431('0xd')]['streamFile'](_0x313d40,_0x16f99b[_0xb431('0x135')]);try{fs[_0xb431('0x107')](_0x313d40+_0xb431('0x108'));}catch(_0x27d1de){logger[_0xb431('0x2e')](_0x27d1de);}return _0x2a250a;}return this['channel'][_0xb431('0x2e')](_0x16f99b,_0xb431('0x152'));};AGIVertices[_0xb431('0x10')]['login']=function(_0x3a685f){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x153'),_0x3a685f[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x3a685f[_0xb431('0x154')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x3a685f,_0xb431('0x155'));}logger[_0xb431('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb431('0xd')][_0xb431('0x3a')],_0x3a685f[_0xb431('0x154')]));var _0x4170ad=this[_0xb431('0x52')][_0xb431('0x70')](this,_0x3a685f[_0xb431('0x154')]);if(_0x4170ad){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x156'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x3a685f[_0xb431('0x154')]));this['channel'][_0xb431('0xa9')](util['format'](_0xb431('0x156'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x3a685f[_0xb431('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x157'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x3a685f['findBy']));this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x157'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x3a685f[_0xb431('0x154')]));return{'code':0xc8,'result':_0xb431('0x158')};}};AGIVertices[_0xb431('0x10')][_0xb431('0x159')]=function(_0x36fc4c){logger['info'](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x36fc4c['label']));if(!this['isConfigured'](_0x36fc4c[_0xb431('0x154')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x36fc4c,'no\x20find\x20by\x20configured');}logger[_0xb431('0x2f')](util['format'](_0xb431('0x15a'),this[_0xb431('0xd')]['callerid'],_0x36fc4c[_0xb431('0x154')]));var _0x4b7170=this['agentLogout'][_0xb431('0x70')](this,_0x36fc4c[_0xb431('0x154')]);if(_0x4b7170){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x156'),this[_0xb431('0xd')]['callerid'],_0x36fc4c[_0xb431('0x154')]));this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x156'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x36fc4c[_0xb431('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x157'),this['channel'][_0xb431('0x3a')],_0x36fc4c[_0xb431('0x154')]));this['channel']['noop'](util[_0xb431('0x2a')](_0xb431('0x157'),this['channel'][_0xb431('0x3a')],_0x36fc4c['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb431('0x10')][_0xb431('0x15b')]=function(_0x1febb4){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x15c'),_0x1febb4['label']));if(!this[_0xb431('0x81')](_0x1febb4[_0xb431('0x15d')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x1febb4,_0xb431('0x15e'));}this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x15f'),_0x1febb4[_0xb431('0x15d')]));var _0x24ec50=eval(_0x1febb4['operation']);if(!this[_0xb431('0x81')](_0x1febb4[_0xb431('0xdb')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x114'));}var _0x5d88c6=this[_0xb431('0x11')][_0xb431('0x70')](this,_0x1febb4[_0xb431('0xdb')]);if(!_0x5d88c6){return this['channel']['error'](_0x1febb4,'no\x20variable\x20found');}if(_[_0xb431('0x9a')](_0x24ec50)){var _0x7e81=this;_0x24ec50[_0xb431('0xdd')](function(_0x1b4d39,_0xae2053){_0x7e81['channel'][_0xb431('0x9e')](util['format'](_0xb431('0x160'),_0x5d88c6,_0xae2053),_0x1b4d39);});return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x161'),_0x5d88c6));}else{return this[_0xb431('0xd')][_0xb431('0x9e')](_0x5d88c6,_0x24ec50);}};AGIVertices[_0xb431('0x10')]['menu']=function(_0x2541ba){logger['info'](util[_0xb431('0x2a')](_0xb431('0x162'),_0x2541ba[_0xb431('0x37')]));if(_0x2541ba[_0xb431('0xa5')]===0x0){return this[_0xb431('0xa6')](_0x2541ba);}_0x2541ba[_0xb431('0xa5')]-=0x1;if(!this[_0xb431('0x81')](_0x2541ba[_0xb431('0x112')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x2541ba,_0xb431('0x163'));}var _0x4f8ddf=this[_0xb431('0x1e')][_0xb431('0x70')](this,_0x2541ba[_0xb431('0x112')]);if(!_0x4f8ddf){return this[_0xb431('0xd')]['error'](_0x2541ba,_0xb431('0x113'));}var _0x2bcaec=this[_0xb431('0xd')]['getData'](_0x4f8ddf,_0x2541ba['response'],_0x2541ba[_0xb431('0x164')]);var _0x19fc13=_0x2bcaec['result'];if(_0x2bcaec[_0xb431('0xac')]===-0x1){this[_0xb431('0x36')][_0xb431('0x70')](this,_0x2541ba,'-1');return _0x2bcaec;}else if(_0x2bcaec[_0xb431('0xa2')]===_0xb431('0x64')){_0x2bcaec[_0xb431('0xac')]=_0x2bcaec['result']['length']>0x0?_0x2bcaec[_0xb431('0xac')]:'t';}else if(_[_0xb431('0x45')](_0x2bcaec['result'])){_0x2bcaec[_0xb431('0xac')]='#';_0x19fc13='#';}if(!this[_0xb431('0x81')](_0x2541ba[_0xb431('0xdb')])){this[_0xb431('0xd')]['noop'](_0xb431('0x114'));}else{var _0x47fa77=this['getVariable']['sync'](this,_0x2541ba[_0xb431('0xdb')]);if(!_0x47fa77){return this['channel']['error'](_0x2541ba,_0xb431('0xdc'));}this['channel'][_0xb431('0x9e')](_0x47fa77,_0x19fc13);}this[_0xb431('0x36')]['sync'](this,_0x2541ba,_0x19fc13);return _0x2bcaec;};AGIVertices['prototype']['noop']=function(_0x5207f9){logger[_0xb431('0x2f')](util['format'](_0xb431('0x165'),_0x5207f9[_0xb431('0x37')]));return this[_0xb431('0xd')][_0xb431('0xa9')](_0x5207f9[_0xb431('0x166')]||_0x5207f9['label']);};AGIVertices[_0xb431('0x10')]['pause']=function(_0x5eb251){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x167'),_0x5eb251[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x5eb251[_0xb431('0x154')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x5eb251,'no\x20find\x20by\x20configured');}logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb431('0xd')][_0xb431('0x3a')],_0x5eb251[_0xb431('0x154')]));var _0xd45314=this[_0xb431('0x168')][_0xb431('0x70')](this,_0x5eb251[_0xb431('0x169')]);var _0xd920f3=this['agentPause'][_0xb431('0x70')](this,_0x5eb251[_0xb431('0x154')],_0xd45314);if(_0xd920f3){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb431('0xd')]['callerid'],_0x5eb251[_0xb431('0x154')]));this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb431('0x3a')],_0x5eb251[_0xb431('0x154')]));return{'code':0xc8,'result':_0xb431('0x16a')};}else{logger[_0xb431('0x2f')](util['format'](_0xb431('0x157'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x5eb251['findBy']));this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x156'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x5eb251[_0xb431('0x154')]));return{'code':0xc8,'result':_0xb431('0x158')};}};AGIVertices[_0xb431('0x10')][_0xb431('0x16b')]=function(_0x62b80a){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x62b80a['label']));if(!this[_0xb431('0x81')](_0x62b80a[_0xb431('0x112')])){return this[_0xb431('0xd')]['error'](_0x62b80a,_0xb431('0x163'));}var _0x2beea4=this['getSound'][_0xb431('0x70')](this,_0x62b80a[_0xb431('0x112')]);if(!_0x2beea4){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x62b80a,_0xb431('0x113'));}var _0x39e24e=this['channel'][_0xb431('0x55')](_0xb431('0x16c'),[_0x2beea4,_0x62b80a[_0xb431('0xe6')]]);if(_0x39e24e[_0xb431('0xac')]===-0x1){return _0x39e24e;}return this[_0xb431('0xd')]['noop'](util['format'](_0xb431('0x16d'),_0xb431('0x16c'),_0x2beea4));};AGIVertices['prototype']['queue']=function(_0xf6d922){logger[_0xb431('0x2f')](util['format'](_0xb431('0x16e'),_0xf6d922[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0xf6d922[_0xb431('0x16f')])){return this[_0xb431('0xd')]['error'](_0xf6d922,'no\x20queue\x20selected');}var _0xbce206='';var _0x16fe71=parseInt(_0xf6d922[_0xb431('0x16f')],0xa);if(isNaN(_0x16fe71)){_0xbce206=_0xf6d922['queue_id'];}else{_0xbce206=this['getVoiceQueue'][_0xb431('0x70')](this,_0xf6d922['queue_id']);if(!_0xbce206){return this[_0xb431('0xd')][_0xb431('0x2e')](_0xf6d922,_0xb431('0x170'));}}var _0x47e3d2='';if(this[_0xb431('0x81')](_0xf6d922[_0xb431('0x112')])){var _0x1f12c3=this[_0xb431('0x1e')][_0xb431('0x70')](this,_0xf6d922[_0xb431('0x112')]);if(_0x1f12c3){_0x47e3d2=_0x1f12c3;}}this['createSquareDetailsReport']['sync'](this,_0xf6d922,_0xbce206);if(_0xf6d922[_0xb431('0xe6')][_0xb431('0x171')]('x')<0x0){_0xf6d922[_0xb431('0xe6')]+='x';}if(_0xf6d922[_0xb431('0xe6')][_0xb431('0x171')]('X')<0x0){_0xf6d922[_0xb431('0xe6')]+='X';}this[_0xb431('0xd')]['setVariable'](_0xb431('0x172'),_0xbce206?_0xbce206[_0xb431('0x173')]():'');var _0xd45ba3=this[_0xb431('0xd')][_0xb431('0x55')](_0xb431('0x174'),[_0xbce206,_0xf6d922[_0xb431('0xe6')],_0xf6d922['url'],_0x47e3d2,_0xf6d922['timeout'],_0xf6d922[_0xb431('0x9')],_0xf6d922['macro'],_0xf6d922[_0xb431('0x175')],'',_0xf6d922['position']]);if(_0xd45ba3['result']===-0x1){return _0xd45ba3;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x16d'),'QUEUE',_0xbce206));};AGIVertices[_0xb431('0x10')][_0xb431('0x176')]=function(_0x21372a){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x21372a[_0xb431('0x37')]));var _0x1d1068=_0x21372a['recordingFormat']||_0xb431('0x130');var _0xc1ef30=util[_0xb431('0x2a')](_0xb431('0x177'),this[_0xb431('0xd')]['uniqueid'],rs[_0xb431('0x11a')](0x5));var _0x2a808c=util[_0xb431('0x2a')](_0xb431('0x178'),FILES_PATH,_0xc1ef30,_0x1d1068);var _0x2194dd=util[_0xb431('0x2a')]('%s/recordings/%s',FILES_PATH,_0xc1ef30);this[_0xb431('0x3b')]['sync'](this,_0x21372a,_0xc1ef30,_0x2a808c);this[_0xb431('0xd')][_0xb431('0x9e')]('RECORDING_SAVENAME',_0xc1ef30);logger['info'](_0xb431('0x179'),_0x2194dd,_0x1d1068,_0x21372a[_0xb431('0x17a')],_0x21372a['timeout']);return this[_0xb431('0xd')][_0xb431('0x134')](_0x2194dd,_0x1d1068,_0x21372a['escape_digits'],_0x21372a[_0xb431('0x64')],undefined,!![]);};AGIVertices[_0xb431('0x10')][_0xb431('0x17b')]=function(_0x2c182e){logger['info'](util[_0xb431('0x2a')](_0xb431('0x17c'),_0x2c182e['label']));if(!this['isConfigured'](_0x2c182e['url'])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x17d'));}var _0x5f5003=this[_0xb431('0x61')][_0xb431('0x70')](this,_0x2c182e);logger['info'](util['format'](_0xb431('0x17e'),util[_0xb431('0x17f')](_0x5f5003,{'showHidden':![],'depth':null})));if(!this[_0xb431('0x81')](_0x2c182e[_0xb431('0xdb')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x180'));}var _0x12718c=this[_0xb431('0x11')]['sync'](this,_0x2c182e[_0xb431('0xdb')]);if(!_0x12718c){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x2c182e,_0xb431('0xdc'));}this[_0xb431('0xd')][_0xb431('0x9e')](util['format'](_0xb431('0x181'),_0x12718c),_0x5f5003[_0xb431('0x73')]?_0x5f5003['statusCode']:_0xb431('0x182'));this[_0xb431('0xd')]['setVariable'](util[_0xb431('0x2a')](_0xb431('0x183'),_0x12718c),_0x5f5003[_0xb431('0x184')]?_0x5f5003[_0xb431('0x184')]:'OK');if(_0x5f5003['body']){try{this['saveRestApiResult'](_0x5f5003[_0xb431('0x69')],_0x12718c);}catch(_0x4d33e8){logger[_0xb431('0x2e')](util[_0xb431('0x2a')](_0xb431('0x185'),_0x12718c));}}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0xdf'),_0x12718c));};AGIVertices['prototype'][_0xb431('0x186')]=function(_0x5270c4){logger['info'](util[_0xb431('0x2a')](_0xb431('0x187'),_0x5270c4[_0xb431('0x37')]));return this['channel'][_0xb431('0x188')](_0x5270c4[_0xb431('0x189')][_0xb431('0x56')](/\s+/g,''),_0x5270c4[_0xb431('0x17a')]);};AGIVertices[_0xb431('0x10')][_0xb431('0x18a')]=function(_0x5e4224){logger[_0xb431('0x2f')](util['format'](_0xb431('0x18b'),_0x5e4224[_0xb431('0x37')]));return this['channel'][_0xb431('0x18c')](_0x5e4224['number'][_0xb431('0x56')](/\s+/g,''),_0x5e4224['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x1b40ee){logger['info'](util[_0xb431('0x2a')](_0xb431('0x18d'),_0x1b40ee[_0xb431('0x37')]));return this['channel'][_0xb431('0x18e')](_0x1b40ee['text'],_0x1b40ee[_0xb431('0x17a')]);};AGIVertices[_0xb431('0x10')]['sendMail']=function(_0x3230a1){logger[_0xb431('0x2f')](util['format'](_0xb431('0x18f'),_0x3230a1[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x3230a1['account_id'])){return this[_0xb431('0xd')]['noop'](_0xb431('0x190'));}var _0x1b6858=this[_0xb431('0x22')]['sync'](this,_0x3230a1[_0xb431('0x191')]);if(!_0x1b6858||!_0x1b6858[_0xb431('0x192')]){return this[_0xb431('0xd')]['error'](_0x3230a1,'no\x20mail\x20account\x20found');}var _0xc30918={'from':util[_0xb431('0x2a')](_0xb431('0x193'),_0x1b6858[_0xb431('0x13')],_0x1b6858[_0xb431('0x194')]||_0x1b6858[_0xb431('0x192')][_0xb431('0x195')]),'to':_0x3230a1['to']||'','cc':_0x3230a1['cc']||'','bcc':_0x3230a1['bcc']||'','subject':_0x3230a1[_0xb431('0x196')],'html':_0x3230a1[_0xb431('0x5a')],'text':_0x3230a1[_0xb431('0x5a')]};var _0x59b9dc={'tls':{'rejectUnauthorized':![]}};if(_0x1b6858[_0xb431('0x192')][_0xb431('0x197')]){_0x59b9dc['service']=_0x1b6858['Smtp'][_0xb431('0x197')];}else{_0x59b9dc[_0xb431('0x198')]=_0x1b6858[_0xb431('0x192')][_0xb431('0x198')];_0x59b9dc[_0xb431('0x199')]=_0x1b6858[_0xb431('0x192')]['port'];_0x59b9dc[_0xb431('0x19a')]=_0x1b6858[_0xb431('0x192')][_0xb431('0x19a')];}if(_0x1b6858['Smtp']['authentication']){_0x59b9dc[_0xb431('0x19b')]={'user':_0x1b6858[_0xb431('0x192')][_0xb431('0x195')],'pass':_0x1b6858['Smtp'][_0xb431('0x19c')]};}if(this[_0xb431('0x81')](_0x3230a1['template_id'])){}logger[_0xb431('0x19d')](_0xb431('0x19e'),JSON['stringify'](_0xc30918));this[_0xb431('0x36')][_0xb431('0x70')](this,_0x3230a1,_0x3230a1[_0xb431('0x191')]);this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x19f'),_0x1b6858[_0xb431('0x13')]));this[_0xb431('0x23')][_0xb431('0x70')](this,_0x59b9dc,_0xc30918);return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x1a0'));};AGIVertices['prototype'][_0xb431('0x1a1')]=function(_0x1bf0be){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x1a2'),_0x1bf0be[_0xb431('0x37')]));return this[_0xb431('0xd')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xb431('0x10')][_0xb431('0x1a3')]=function(_0x46fbbd){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x46fbbd['label']));if(!this[_0xb431('0x81')](_0x46fbbd[_0xb431('0x1a4')])){return this[_0xb431('0xd')][_0xb431('0xa9')]('no\x20sms\x20account\x20configured');}var _0x97d9b6=this['getSmsAccount']['sync'](this,_0x46fbbd['sms_account_id']);if(!_0x97d9b6){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x46fbbd,_0xb431('0x1a5'));}var _0x4d8946={'body':_0x46fbbd[_0xb431('0x1a6')],'phone':_0x46fbbd['to']||'','SmsAccountId':_0x97d9b6['id']};logger['debug']('sendSMS\x20message',JSON[_0xb431('0x72')](_0x4d8946));this[_0xb431('0x36')][_0xb431('0x70')](this,_0x46fbbd,_0x46fbbd[_0xb431('0x1a4')]);this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x1a7'),_0x97d9b6['name']));this[_0xb431('0x35')]['sync'](this,_0x4d8946);return this[_0xb431('0xd')][_0xb431('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xb431('0x1a8')]=function(_0x134238){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x134238[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x134238[_0xb431('0xdb')])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x134238,'no\x20variable\x20selected');}var _0x59d298=this['getVariable'][_0xb431('0x70')](this,_0x134238[_0xb431('0xdb')]);if(!_0x59d298){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x134238,'no\x20variable\x20found');}return this['channel']['setVariable'](_0x59d298,_0x134238[_0xb431('0x1a9')]);};AGIVertices[_0xb431('0x10')][_0xb431('0x1aa')]=function(_0x2091d3){logger[_0xb431('0x2f')](util['format'](_0xb431('0x1ab'),_0x2091d3[_0xb431('0x37')]));this[_0xb431('0xd')]['noop'](_0xb431('0x1ac'));if(_0x2091d3[_0xb431('0xbb')]===_0xb431('0x1ad')){this[_0xb431('0xd')]['noop'](_0xb431('0x1ae'));return this[_0xb431('0xd')]['answer']();}return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x1af'));};AGIVertices[_0xb431('0x10')][_0xb431('0x1b0')]=function(_0x4dc953){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x4dc953['label']));if(!this[_0xb431('0x81')](_0x4dc953['project_id'])){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x4dc953,_0xb431('0x1b1'));}var _0x1b843a=this[_0xb431('0x18')]['sync'](this,_0x4dc953[_0xb431('0x1b2')]);if(!this[_0xb431('0x81')](_0x1b843a)){return this[_0xb431('0xd')][_0xb431('0x2e')](_0x4dc953,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x4dc953[_0xb431('0x1b2')]));}if(_0x1b843a===this[_0xb431('0xd')][_0xb431('0x39')]){return this['channel'][_0xb431('0x2e')](_0x4dc953,_0xb431('0x1b3'));}this[_0xb431('0x36')]['sync'](this,_0x4dc953,_0x1b843a);var _0x109d00=this['channel'][_0xb431('0x55')](_0xb431('0x1b4'),util[_0xb431('0x2a')](_0xb431('0x1b5'),config[_0xb431('0x9')][_0xb431('0x198')]||'127.0.0.1',_0x1b843a,this[_0xb431('0xd')][_0xb431('0x39')]));if(_0x109d00[_0xb431('0xac')]===-0x1){return _0x109d00;}return this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Executed\x20command\x20%s\x20%s','AGI',_0x1b843a));};AGIVertices[_0xb431('0x10')]['system']=function(_0x6534e7){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x1b6'),_0x6534e7[_0xb431('0x37')]));var _0x2faca2=this[_0xb431('0x1b7')][_0xb431('0x70')](this,_0x6534e7[_0xb431('0xb8')]);this[_0xb431('0x36')]['sync'](this,_0x6534e7,_0x6534e7[_0xb431('0xb8')]);if(this['isConfigured'](_0x6534e7[_0xb431('0xdb')])){var _0x322101=this['getVariable']['sync'](this,_0x6534e7['variable_id']);if(_0x322101){this[_0xb431('0xd')][_0xb431('0x9e')](_0x322101,_0x2faca2);return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x1b8'),_0x6534e7[_0xb431('0xb8')],_0x322101));}}return this['channel']['noop'](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x6534e7[_0xb431('0xb8')]));};AGIVertices['prototype'][_0xb431('0x1b9')]=function(_0x30ac9e){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x1ba'),_0x30ac9e[_0xb431('0x37')]));_0x30ac9e[_0xb431('0x5a')]=_0x30ac9e[_0xb431('0x5a')][_0xb431('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb431('0x81')](_0x30ac9e[_0xb431('0x58')])){return this[_0xb431('0xd')][_0xb431('0xa9')](_0xb431('0x1bb'));}if(!this[_0xb431('0x81')](_0x30ac9e[_0xb431('0x5a')])){return this[_0xb431('0xd')][_0xb431('0xa9')]('no\x20text\x20configured');}this[_0xb431('0xd')][_0xb431('0xa9')](util['format'](_0xb431('0x1bc'),_0x30ac9e[_0xb431('0x5a')]));var _0x2bb543=this[_0xb431('0x57')]['sync'](this,_0x30ac9e);if(_0x2bb543){this['channel'][_0xb431('0xa9')](util['format'](_0xb431('0x1bd'),_0x2bb543));var _0x273860=this[_0xb431('0xd')]['streamFile'](_0x2bb543);try{fs['unlink'](_0x2bb543+_0xb431('0x108'));}catch(_0x3d82be){logger[_0xb431('0x2e')](_0x3d82be);}return _0x273860;}return this[_0xb431('0xd')][_0xb431('0x2e')](_0x30ac9e,_0xb431('0x1be'));};AGIVertices[_0xb431('0x10')][_0xb431('0x1bf')]=function(_0x316cad){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x316cad[_0xb431('0x37')]));_0x316cad['text']=_0x316cad[_0xb431('0x5a')][_0xb431('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb431('0x81')](_0x316cad[_0xb431('0x5a')])){return this[_0xb431('0xd')]['noop']('no\x20text\x20configured');}this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('Trying\x20Google\x20TTS\x20%s',_0x316cad[_0xb431('0x5a')]));var _0x514101=this[_0xb431('0x1c0')]['sync'](this,_0x316cad);if(_0x514101){this[_0xb431('0xd')][_0xb431('0xa9')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x514101));var _0x2fdeb9=this[_0xb431('0xd')][_0xb431('0x106')](_0x514101);try{fs[_0xb431('0x107')](_0x514101+_0xb431('0x108'));}catch(_0x3c4bf5){logger[_0xb431('0x2e')](_0x3c4bf5);}return _0x2fdeb9;}return this[_0xb431('0xd')][_0xb431('0x2e')](_0x316cad,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xb431('0x10')]['unpause']=function(_0x6d8ccc){logger[_0xb431('0x2f')](util[_0xb431('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x6d8ccc[_0xb431('0x37')]));if(!this[_0xb431('0x81')](_0x6d8ccc[_0xb431('0x154')])){return this['channel']['error'](_0x6d8ccc,'no\x20find\x20by\x20configured');}logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x15a'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x6d8ccc[_0xb431('0x154')]));var _0x1ccfb5=this[_0xb431('0x50')][_0xb431('0x70')](this,_0x6d8ccc[_0xb431('0x154')]);if(_0x1ccfb5){logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x156'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x6d8ccc[_0xb431('0x154')]));this[_0xb431('0xd')]['noop'](util[_0xb431('0x2a')](_0xb431('0x156'),this['channel'][_0xb431('0x3a')],_0x6d8ccc[_0xb431('0x154')]));return{'code':0xc8,'result':_0xb431('0x16a')};}else{logger[_0xb431('0x2f')](util[_0xb431('0x2a')](_0xb431('0x157'),this[_0xb431('0xd')][_0xb431('0x3a')],_0x6d8ccc['findBy']));this[_0xb431('0xd')][_0xb431('0xa9')](util[_0xb431('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb431('0xd')][_0xb431('0x3a')],_0x6d8ccc['findBy']));return{'code':0xc8,'result':_0xb431('0x158')};}};AGIVertices['prototype'][_0xb431('0x1c1')]=function(_0x3e3b01){logger['info'](util[_0xb431('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3e3b01[_0xb431('0x37')]));var _0x18d0eb=this['channel'][_0xb431('0x55')](_0xb431('0x1c2'),[_0x3e3b01[_0xb431('0x1c3')],_0x3e3b01[_0xb431('0x76')]]);if(_0x18d0eb[_0xb431('0xac')]===-0x1){return _0x18d0eb;}return this['channel'][_0xb431('0xa9')](util[_0xb431('0x2a')](_0xb431('0x16d'),_0xb431('0x1c2'),_0x3e3b01[_0xb431('0x1c3')]));};AGIVertices['prototype'][_0xb431('0x1c4')]=function(_0x5624f0){logger['info'](util[_0xb431('0x2a')](_0xb431('0x1c5'),_0x5624f0['label']));if(!this['isConfigured'](_0x5624f0[_0xb431('0xdb')])){return this[_0xb431('0xd')]['error'](_0x5624f0,_0xb431('0x1c6'));}var _0x261934=this[_0xb431('0x11')]['sync'](this,_0x5624f0[_0xb431('0xdb')]);if(!_0x261934){return this[_0xb431('0xd')]['error'](_0x5624f0,_0xb431('0xdc'));}var _0x27091e=this[_0xb431('0xd')][_0xb431('0x11')](_0x261934);return{'code':0xc8,'result':_0x27091e[_0xb431('0xa2')]?_0x27091e[_0xb431('0xa2')]:'-'};};String[_0xb431('0x10')][_0xb431('0xa1')]=function(_0x52b335,_0x4db38e){return this[_0xb431('0xa0')](_0x52b335)[_0xb431('0x1c7')](_0x4db38e);};module[_0xb431('0x1c8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f8da87d..75893a1 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 _0x7439=['linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','seconds','prototype','startAcw','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x7439,0x171));var _0x9743=function(_0x557ca0,_0x234eca){_0x557ca0=_0x557ca0-0x0;var _0x29ea82=_0x7439[_0x557ca0];return _0x29ea82;};'use strict';var util=require(_0x9743('0x0'));var _=require(_0x9743('0x1'));var moment=require(_0x9743('0x2'));var ami=require('../ami');var logger=require(_0x9743('0x3'))(_0x9743('0x4'));var RpcUser=require(_0x9743('0x5'));var RpcVoiceAgentReport=require(_0x9743('0x6'));function Acw(_0x3f4358){this[_0x9743('0x7')]=_0x3f4358[_0x9743('0x7')];this['agents']=_0x3f4358[_0x9743('0x8')];this[_0x9743('0x9')]=_0x3f4358[_0x9743('0x9')];this['channels']={};ami['on'](_0x9743('0xa'),this[_0x9743('0xb')][_0x9743('0xc')](this));ami['on'](_0x9743('0xd'),this[_0x9743('0xe')]['bind'](this));ami['on'](_0x9743('0xf'),this[_0x9743('0x10')][_0x9743('0xc')](this));ami['on']('agentringnoanswer',this[_0x9743('0x11')][_0x9743('0xc')](this));ami['on'](_0x9743('0x12'),this[_0x9743('0x13')]['bind'](this));ami['on'](_0x9743('0x14'),this[_0x9743('0x15')][_0x9743('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x9743('0xc')](this));}function getDiff(_0x31ad83){var _0x284d92=moment()[_0x9743('0x16')](0x0);var _0x39738c=moment(_0x31ad83)[_0x9743('0x16')](0x0);return _0x284d92['diff'](_0x39738c,_0x9743('0x17'));}Acw[_0x9743('0x18')][_0x9743('0x19')]=function(_0x18afef){try{var _0x597e5b=this;var _0xdd9229=this[_0x9743('0x1a')][_0x18afef][_0x9743('0x1b')];var _0x5a5836=this[_0x9743('0x1a')][_0x18afef][_0x9743('0x1c')];var _0x4edd68=this[_0x9743('0x7')][_0x5a5836];var _0x39ce10=![];var _0x5392fb='ACW';if(_0x4edd68[_0x9743('0x1d')]){if(_0x4edd68[_0x9743('0x1e')][_0x9743('0x1f')]){_0x39ce10=!![];_0x5392fb=_0x4edd68[_0x9743('0x1e')][_0x9743('0x1f')];}}ami['Action']({'action':_0x9743('0x20'),'interface':_0xdd9229,'paused':!![],'reason':_0x5392fb})[_0x9743('0x21')](function(_0x8c9c17){if(_0x597e5b[_0x9743('0x8')][_0xdd9229]){return RpcUser[_0x9743('0x22')](_0x597e5b['agents'][_0xdd9229]['id'])[_0x9743('0x21')](function(_0x3da78e){if(_0x3da78e&&!_0x3da78e[_0x9743('0x23')]){logger[_0x9743('0x24')](_0x9743('0x25'),_0x18afef,_0xdd9229,_0x5a5836);var _0x353c88=_0x597e5b[_0x9743('0x1a')][_0x18afef][_0x9743('0x26')]&&_0x597e5b[_0x9743('0x1a')][_0x18afef][_0x9743('0x27')]?_0x597e5b['channels'][_0x18afef][_0x9743('0x27')]:_0x18afef;return RpcUser[_0x9743('0x28')](_0x597e5b[_0x9743('0x8')][_0xdd9229],_0x5392fb,_0x353c88)[_0x9743('0x21')](function(_0x284343){if(!_0x39ce10){_0x597e5b[_0x9743('0x9')][_0xdd9229]={};logger[_0x9743('0x24')](_0x9743('0x29'),_0x18afef,_0x597e5b[_0x9743('0x7')][_0x5a5836][_0x9743('0x2a')],_0xdd9229,_0x5a5836);_0x597e5b['timers'][_0xdd9229][_0x9743('0x2b')]=setTimeout(_0x597e5b[_0x9743('0x2c')][_0x9743('0xc')](_0x597e5b,_0xdd9229),_0x597e5b[_0x9743('0x7')][_0x5a5836][_0x9743('0x2a')]*0x3e8);_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x2d')]=moment()[_0x9743('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x597e5b[_0x9743('0x9')][_0xdd9229]['uniqueid']=_0x18afef;_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x1c')]=_0x5a5836;_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x2f')]=function(){var _0x5c54a8=getDiff(_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x2d')]);clearTimeout(_0x597e5b['timers'][_0xdd9229]['timer']);_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x2b')]=![];RpcVoiceAgentReport[_0x9743('0x30')]({'acwtime':_0x5c54a8},_0x597e5b[_0x9743('0x9')][_0xdd9229][_0x9743('0x31')],_0xdd9229)[_0x9743('0x21')](function(_0x192878){logger[_0x9743('0x24')](_0x9743('0x32'),_0x18afef,_0x5c54a8,_0x192878);})[_0x9743('0x33')](function(_0xb52db7){logger[_0x9743('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x18afef,_0xb52db7);});delete _0x597e5b[_0x9743('0x9')][_0xdd9229];};}});}else{logger[_0x9743('0x24')](_0x9743('0x35'),_0x18afef,_0xdd9229,_0x5a5836);}});}})['catch'](function(_0x5a2e94){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x18afef,_0x597e5b[_0x9743('0x7')][_0x5a5836]['acwTimeout'],_0xdd9229,_0x5a5836);})[_0x9743('0x36')](function(){delete _0x597e5b[_0x9743('0x1a')][_0x18afef];});}catch(_0xaa4254){logger[_0x9743('0x34')]('[ACW][START]\x20%s',_0xaa4254[_0x9743('0x37')]);}};Acw[_0x9743('0x18')][_0x9743('0x2c')]=function(_0x34d162){try{var _0x426c53=this;if(_0x426c53['timers'][_0x34d162]){_0x426c53['timers'][_0x34d162][_0x9743('0x2b')]=![];var _0x213b6b=_0x426c53[_0x9743('0x9')][_0x34d162]['uniqueid'];var _0x5e9157=_0x426c53[_0x9743('0x9')][_0x34d162]['queue'];var _0x165d10=_0x426c53['voiceQueues'][_0x5e9157][_0x9743('0x2a')];logger[_0x9743('0x24')]('[%s][TIMER][STOP][AGENT:%s]',_0x213b6b,_0x34d162);RpcUser[_0x9743('0x38')](this[_0x9743('0x8')][_0x34d162]);RpcVoiceAgentReport[_0x9743('0x30')]({'acwtime':_0x165d10,'agentacw':!![]},_0x213b6b,_0x34d162)[_0x9743('0x21')](function(_0x2e91a6){logger[_0x9743('0x24')](_0x9743('0x32'),_0x213b6b,_0x165d10,_0x2e91a6);})[_0x9743('0x33')](function(_0x298bc1){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x213b6b,_0x298bc1);});}else{logger[_0x9743('0x34')](_0x9743('0x39'),_0x34d162);if(_0x426c53['timers']){logger[_0x9743('0x24')](_0x9743('0x3a'),JSON[_0x9743('0x3b')](_0x426c53['timers']));}}}catch(_0x4f0f70){logger[_0x9743('0x34')](_0x9743('0x3c'),_0x4f0f70[_0x9743('0x37')]);}};Acw['prototype'][_0x9743('0xb')]=function(_0x5276a3){try{if(this[_0x9743('0x7')][_0x5276a3[_0x9743('0x1c')]]&&(this[_0x9743('0x7')][_0x5276a3['queue']][_0x9743('0x4')]||this['voiceQueues'][_0x5276a3[_0x9743('0x1c')]][_0x9743('0x1d')])){if(this[_0x9743('0x8')][_0x5276a3['interface']]){this[_0x9743('0x1a')][_0x5276a3['uniqueid']]={'queue':_0x5276a3['queue'],'interface':_0x5276a3[_0x9743('0x1b')],'destlinkedid':_0x5276a3[_0x9743('0x27')]};}}}catch(_0x36431c){logger[_0x9743('0x34')](_0x9743('0x3d'),_0x36431c['message']);}};Acw['prototype'][_0x9743('0x3e')]=function(_0x431ad8){try{if(this['voiceQueues'][_0x431ad8['queue']]&&(this['voiceQueues'][_0x431ad8['queue']][_0x9743('0x4')]||this['voiceQueues'][_0x431ad8[_0x9743('0x1c')]]['mandatoryDisposition'])){if(this[_0x9743('0x8')][_0x431ad8[_0x9743('0x1b')]]){this[_0x9743('0x1a')][_0x431ad8['uniqueid']]={'queue':_0x431ad8[_0x9743('0x1c')],'interface':_0x431ad8[_0x9743('0x1b')]};}}}catch(_0x635e5a){logger[_0x9743('0x34')](_0x9743('0x3f'),_0x635e5a[_0x9743('0x37')]);}};Acw[_0x9743('0x18')][_0x9743('0xe')]=function(_0x338dc1){try{if(this[_0x9743('0x1a')][_0x338dc1[_0x9743('0x31')]]&&_[_0x9743('0x40')](this[_0x9743('0x1a')][_0x338dc1[_0x9743('0x31')]][_0x9743('0x26')])){logger[_0x9743('0x24')](_0x9743('0x41'),_0x338dc1['uniqueid']);this['startAcw'](_0x338dc1[_0x9743('0x31')]);}else if(this[_0x9743('0x1a')][_0x338dc1[_0x9743('0x42')]]&&_[_0x9743('0x40')](this['channels'][_0x338dc1['linkedid']][_0x9743('0x26')])){logger[_0x9743('0x24')](_0x9743('0x43'),_0x338dc1['linkedid']);this[_0x9743('0x19')](_0x338dc1[_0x9743('0x42')]);}}catch(_0x18a3f7){logger[_0x9743('0x34')](_0x9743('0x44'),_0x18a3f7[_0x9743('0x37')]);}};Acw[_0x9743('0x18')][_0x9743('0x10')]=function(_0x4f152f){try{if(this[_0x9743('0x1a')][_0x4f152f['uniqueid']]&&this['channels'][_0x4f152f[_0x9743('0x31')]][_0x9743('0x26')]){logger['info'](_0x9743('0x45'),_0x4f152f[_0x9743('0x31')]);this[_0x9743('0x19')](_0x4f152f[_0x9743('0x31')]);}else if(this[_0x9743('0x1a')][_0x4f152f[_0x9743('0x42')]]&&this[_0x9743('0x1a')][_0x4f152f[_0x9743('0x42')]][_0x9743('0x26')]){logger[_0x9743('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x4f152f[_0x9743('0x42')]);this[_0x9743('0x19')](_0x4f152f[_0x9743('0x42')]);}}catch(_0x3a1c60){logger[_0x9743('0x34')]('[ACW][syncHangup]\x20%s',_0x3a1c60[_0x9743('0x37')]);}};Acw[_0x9743('0x18')][_0x9743('0x13')]=function(_0x5388fb){try{if(!_[_0x9743('0x46')](this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x47')]])){this[_0x9743('0x19')](_0x5388fb[_0x9743('0x47')]);if(this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x48')]]){this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x48')]]['attended']=!![];this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x49')]]=this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x48')]];delete this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x48')]];}}else if(!_[_0x9743('0x46')](this['channels'][_0x5388fb[_0x9743('0x49')]])){this[_0x9743('0x19')](_0x5388fb[_0x9743('0x49')]);if(this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x4a')]]){this[_0x9743('0x1a')][_0x5388fb['origtransfereruniqueid']][_0x9743('0x26')]=!![];this[_0x9743('0x1a')][_0x5388fb['transfereeuniqueid']]=this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x4a')]];delete this[_0x9743('0x1a')][_0x5388fb[_0x9743('0x4a')]];}}}catch(_0x392203){logger[_0x9743('0x34')](_0x9743('0x4b'),_0x392203['message']);}};Acw[_0x9743('0x18')][_0x9743('0x15')]=function(_0xe3e46e){try{if(this[_0x9743('0x1a')][_0xe3e46e[_0x9743('0x4c')]]){logger[_0x9743('0x24')](_0x9743('0x4d'),JSON[_0x9743('0x3b')](_0xe3e46e[_0x9743('0x4c')]));this[_0x9743('0x19')](_0xe3e46e['transfereruniqueid']);}else if(this[_0x9743('0x1a')][_0xe3e46e[_0x9743('0x4e')]]){logger['info'](_0x9743('0x4f'),JSON[_0x9743('0x3b')](_0xe3e46e[_0x9743('0x4e')]));this[_0x9743('0x19')](_0xe3e46e[_0x9743('0x4e')]);}}catch(_0x514159){logger[_0x9743('0x34')](_0x9743('0x50'),_0x514159['message']);}};Acw[_0x9743('0x18')][_0x9743('0x11')]=function(_0x5be7a4){try{if(this[_0x9743('0x7')][_0x5be7a4['queue']]&&this[_0x9743('0x7')][_0x5be7a4[_0x9743('0x1c')]][_0x9743('0x51')]===_0x9743('0x52')){if(this[_0x9743('0x8')][_0x5be7a4['interface']]){logger[_0x9743('0x24')](_0x9743('0x53'),_0x5be7a4[_0x9743('0x31')],_0x5be7a4['interface'],_0x5be7a4['queue']);return RpcUser[_0x9743('0x28')](this['agents'][_0x5be7a4[_0x9743('0x1b')]],_0x9743('0x54'),_0x5be7a4[_0x9743('0x31')]);}}}catch(_0x67293e){logger[_0x9743('0x34')](_0x9743('0x55'),_0x67293e[_0x9743('0x37')]);}};module[_0x9743('0x56')]=Acw; \ No newline at end of file +var _0xa4e1=['stopAcw','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xa4e1,0x6f));var _0x1a4e=function(_0x40b330,_0x42458b){_0x40b330=_0x40b330-0x0;var _0x27ae9a=_0xa4e1[_0x40b330];return _0x27ae9a;};'use strict';var util=require(_0x1a4e('0x0'));var _=require('lodash');var moment=require(_0x1a4e('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x1a4e('0x2'));var RpcUser=require(_0x1a4e('0x3'));var RpcVoiceAgentReport=require(_0x1a4e('0x4'));function Acw(_0x445e8e){this[_0x1a4e('0x5')]=_0x445e8e[_0x1a4e('0x5')];this[_0x1a4e('0x6')]=_0x445e8e['agents'];this[_0x1a4e('0x7')]=_0x445e8e[_0x1a4e('0x7')];this[_0x1a4e('0x8')]={};ami['on'](_0x1a4e('0x9'),this[_0x1a4e('0xa')][_0x1a4e('0xb')](this));ami['on']('hanguprequest',this[_0x1a4e('0xc')]['bind'](this));ami['on'](_0x1a4e('0xd'),this[_0x1a4e('0xe')][_0x1a4e('0xb')](this));ami['on'](_0x1a4e('0xf'),this['syncAgentRingNoAnswer'][_0x1a4e('0xb')](this));ami['on'](_0x1a4e('0x10'),this[_0x1a4e('0x11')][_0x1a4e('0xb')](this));ami['on']('blindtransfer',this[_0x1a4e('0x12')][_0x1a4e('0xb')](this));ami['on'](_0x1a4e('0x13'),this[_0x1a4e('0x14')][_0x1a4e('0xb')](this));}function getDiff(_0x1b9475){var _0x226bea=moment()[_0x1a4e('0x15')](0x0);var _0x4ef9ce=moment(_0x1b9475)[_0x1a4e('0x15')](0x0);return _0x226bea[_0x1a4e('0x16')](_0x4ef9ce,_0x1a4e('0x17'));}Acw[_0x1a4e('0x18')][_0x1a4e('0x19')]=function(_0x4ff0f0){try{var _0x1b1903=this;var _0x193961=this[_0x1a4e('0x8')][_0x4ff0f0][_0x1a4e('0x1a')];var _0x82284c=this['channels'][_0x4ff0f0][_0x1a4e('0x1b')];var _0x15509b=this[_0x1a4e('0x5')][_0x82284c];var _0x350899=![];var _0x3b6b13=_0x1a4e('0x1c');if(_0x15509b[_0x1a4e('0x1d')]){if(_0x15509b[_0x1a4e('0x1e')][_0x1a4e('0x1f')]){_0x350899=!![];_0x3b6b13=_0x15509b['mandatoryDispositionPause'][_0x1a4e('0x1f')];}}ami[_0x1a4e('0x20')]({'action':_0x1a4e('0x21'),'interface':_0x193961,'paused':!![],'reason':_0x3b6b13})[_0x1a4e('0x22')](function(_0x5255c6){if(_0x1b1903['agents'][_0x193961]){return RpcUser[_0x1a4e('0x23')](_0x1b1903[_0x1a4e('0x6')][_0x193961]['id'])[_0x1a4e('0x22')](function(_0x2aaec9){if(_0x2aaec9&&!_0x2aaec9[_0x1a4e('0x24')]){logger[_0x1a4e('0x25')](_0x1a4e('0x26'),_0x4ff0f0,_0x193961,_0x82284c);var _0x498fa6=_0x1b1903[_0x1a4e('0x8')][_0x4ff0f0][_0x1a4e('0x27')]&&_0x1b1903[_0x1a4e('0x8')][_0x4ff0f0][_0x1a4e('0x28')]?_0x1b1903[_0x1a4e('0x8')][_0x4ff0f0][_0x1a4e('0x28')]:_0x4ff0f0;return RpcUser[_0x1a4e('0x29')](_0x1b1903['agents'][_0x193961],_0x3b6b13,_0x498fa6)[_0x1a4e('0x22')](function(_0xd7ad8b){if(!_0x350899){_0x1b1903[_0x1a4e('0x7')][_0x193961]={};logger[_0x1a4e('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4ff0f0,_0x1b1903[_0x1a4e('0x5')][_0x82284c][_0x1a4e('0x2a')],_0x193961,_0x82284c);_0x1b1903['timers'][_0x193961][_0x1a4e('0x2b')]=setTimeout(_0x1b1903['stopAcw'][_0x1a4e('0xb')](_0x1b1903,_0x193961),_0x1b1903['voiceQueues'][_0x82284c]['acwTimeout']*0x3e8);_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2c')]=moment()['format'](_0x1a4e('0x2d'));_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2e')]=_0x4ff0f0;_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x1b')]=_0x82284c;_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2f')]=function(){var _0x365656=getDiff(_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2c')]);clearTimeout(_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2b')]);_0x1b1903[_0x1a4e('0x7')][_0x193961][_0x1a4e('0x2b')]=![];RpcVoiceAgentReport[_0x1a4e('0x30')]({'acwtime':_0x365656},_0x1b1903['timers'][_0x193961][_0x1a4e('0x2e')],_0x193961)['then'](function(_0x1aab2e){logger[_0x1a4e('0x25')](_0x1a4e('0x31'),_0x4ff0f0,_0x365656,_0x1aab2e);})['catch'](function(_0x4fecf5){logger[_0x1a4e('0x32')](_0x1a4e('0x33'),_0x4ff0f0,_0x4fecf5);});delete _0x1b1903['timers'][_0x193961];};}});}else{logger[_0x1a4e('0x25')](_0x1a4e('0x34'),_0x4ff0f0,_0x193961,_0x82284c);}});}})[_0x1a4e('0x35')](function(_0x2b31f7){logger[_0x1a4e('0x32')](_0x1a4e('0x36'),_0x4ff0f0,_0x1b1903[_0x1a4e('0x5')][_0x82284c]['acwTimeout'],_0x193961,_0x82284c);})[_0x1a4e('0x37')](function(){delete _0x1b1903[_0x1a4e('0x8')][_0x4ff0f0];});}catch(_0x4ac5f3){logger[_0x1a4e('0x32')](_0x1a4e('0x38'),_0x4ac5f3['message']);}};Acw['prototype'][_0x1a4e('0x39')]=function(_0x25bfaa){try{var _0x1f66b2=this;if(_0x1f66b2[_0x1a4e('0x7')][_0x25bfaa]){_0x1f66b2[_0x1a4e('0x7')][_0x25bfaa]['timer']=![];var _0x10b930=_0x1f66b2['timers'][_0x25bfaa][_0x1a4e('0x2e')];var _0x5ca4b5=_0x1f66b2['timers'][_0x25bfaa][_0x1a4e('0x1b')];var _0x2789f2=_0x1f66b2[_0x1a4e('0x5')][_0x5ca4b5][_0x1a4e('0x2a')];logger[_0x1a4e('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x10b930,_0x25bfaa);RpcUser[_0x1a4e('0x3a')](this[_0x1a4e('0x6')][_0x25bfaa]);RpcVoiceAgentReport[_0x1a4e('0x30')]({'acwtime':_0x2789f2,'agentacw':!![]},_0x10b930,_0x25bfaa)[_0x1a4e('0x22')](function(_0x568708){logger['info'](_0x1a4e('0x31'),_0x10b930,_0x2789f2,_0x568708);})[_0x1a4e('0x35')](function(_0x49851c){logger[_0x1a4e('0x32')](_0x1a4e('0x33'),_0x10b930,_0x49851c);});}else{logger['error'](_0x1a4e('0x3b'),_0x25bfaa);if(_0x1f66b2[_0x1a4e('0x7')]){logger[_0x1a4e('0x25')]('[ACW][TIMERS]',JSON[_0x1a4e('0x3c')](_0x1f66b2[_0x1a4e('0x7')]));}}}catch(_0x24e0d1){logger[_0x1a4e('0x32')](_0x1a4e('0x3d'),_0x24e0d1['message']);}};Acw['prototype'][_0x1a4e('0xa')]=function(_0x5c643a){try{if(this['voiceQueues'][_0x5c643a[_0x1a4e('0x1b')]]&&(this['voiceQueues'][_0x5c643a[_0x1a4e('0x1b')]]['acw']||this[_0x1a4e('0x5')][_0x5c643a['queue']][_0x1a4e('0x1d')])){if(this['agents'][_0x5c643a[_0x1a4e('0x1a')]]){this[_0x1a4e('0x8')][_0x5c643a['uniqueid']]={'queue':_0x5c643a[_0x1a4e('0x1b')],'interface':_0x5c643a[_0x1a4e('0x1a')],'destlinkedid':_0x5c643a[_0x1a4e('0x28')]};}}}catch(_0x29b116){logger[_0x1a4e('0x32')](_0x1a4e('0x3e'),_0x29b116['message']);}};Acw['prototype'][_0x1a4e('0x14')]=function(_0x2d6346){try{if(this['voiceQueues'][_0x2d6346[_0x1a4e('0x1b')]]&&(this[_0x1a4e('0x5')][_0x2d6346[_0x1a4e('0x1b')]][_0x1a4e('0x2')]||this[_0x1a4e('0x5')][_0x2d6346['queue']]['mandatoryDisposition'])){if(this[_0x1a4e('0x6')][_0x2d6346[_0x1a4e('0x1a')]]){this[_0x1a4e('0x8')][_0x2d6346[_0x1a4e('0x2e')]]={'queue':_0x2d6346['queue'],'interface':_0x2d6346['interface']};}}}catch(_0x6dea45){logger[_0x1a4e('0x32')](_0x1a4e('0x3f'),_0x6dea45[_0x1a4e('0x40')]);}};Acw['prototype'][_0x1a4e('0xc')]=function(_0x5df524){try{if(this[_0x1a4e('0x8')][_0x5df524[_0x1a4e('0x2e')]]&&_[_0x1a4e('0x41')](this['channels'][_0x5df524['uniqueid']]['attended'])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x5df524[_0x1a4e('0x2e')]);this[_0x1a4e('0x19')](_0x5df524['uniqueid']);}else if(this[_0x1a4e('0x8')][_0x5df524[_0x1a4e('0x42')]]&&_['isUndefined'](this['channels'][_0x5df524[_0x1a4e('0x42')]][_0x1a4e('0x27')])){logger['info'](_0x1a4e('0x43'),_0x5df524[_0x1a4e('0x42')]);this['startAcw'](_0x5df524[_0x1a4e('0x42')]);}}catch(_0x54bb57){logger['error'](_0x1a4e('0x44'),_0x54bb57[_0x1a4e('0x40')]);}};Acw[_0x1a4e('0x18')][_0x1a4e('0xe')]=function(_0x2ce0a6){try{if(this['channels'][_0x2ce0a6[_0x1a4e('0x2e')]]&&this['channels'][_0x2ce0a6['uniqueid']][_0x1a4e('0x27')]){logger[_0x1a4e('0x25')](_0x1a4e('0x45'),_0x2ce0a6['uniqueid']);this[_0x1a4e('0x19')](_0x2ce0a6[_0x1a4e('0x2e')]);}else if(this[_0x1a4e('0x8')][_0x2ce0a6[_0x1a4e('0x42')]]&&this[_0x1a4e('0x8')][_0x2ce0a6[_0x1a4e('0x42')]][_0x1a4e('0x27')]){logger[_0x1a4e('0x25')](_0x1a4e('0x46'),_0x2ce0a6['linkedid']);this[_0x1a4e('0x19')](_0x2ce0a6[_0x1a4e('0x42')]);}}catch(_0x140511){logger[_0x1a4e('0x32')]('[ACW][syncHangup]\x20%s',_0x140511['message']);}};Acw[_0x1a4e('0x18')]['syncAttendedTransfer']=function(_0x466566){try{if(!_[_0x1a4e('0x47')](this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x48')]])){this[_0x1a4e('0x19')](_0x466566[_0x1a4e('0x48')]);if(this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x49')]]){this['channels'][_0x466566[_0x1a4e('0x49')]][_0x1a4e('0x27')]=!![];this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x4a')]]=this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x49')]];delete this['channels'][_0x466566['secondtransfereruniqueid']];}}else if(!_[_0x1a4e('0x47')](this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x4a')]])){this[_0x1a4e('0x19')](_0x466566[_0x1a4e('0x4a')]);if(this['channels'][_0x466566['origtransfereruniqueid']]){this['channels'][_0x466566[_0x1a4e('0x4b')]]['attended']=!![];this['channels'][_0x466566[_0x1a4e('0x48')]]=this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x4b')]];delete this[_0x1a4e('0x8')][_0x466566[_0x1a4e('0x4b')]];}}}catch(_0x58f1e7){logger[_0x1a4e('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x58f1e7[_0x1a4e('0x40')]);}};Acw[_0x1a4e('0x18')][_0x1a4e('0x12')]=function(_0x19902a){try{if(this[_0x1a4e('0x8')][_0x19902a[_0x1a4e('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x1a4e('0x3c')](_0x19902a['transfereruniqueid']));this[_0x1a4e('0x19')](_0x19902a[_0x1a4e('0x4c')]);}else if(this[_0x1a4e('0x8')][_0x19902a[_0x1a4e('0x4d')]]){logger[_0x1a4e('0x25')](_0x1a4e('0x4e'),JSON[_0x1a4e('0x3c')](_0x19902a['transfererlinkedid']));this[_0x1a4e('0x19')](_0x19902a[_0x1a4e('0x4d')]);}}catch(_0x1d60dd){logger[_0x1a4e('0x32')]('[ACW][syncBlindTransfer]\x20%s',_0x1d60dd[_0x1a4e('0x40')]);}};Acw[_0x1a4e('0x18')][_0x1a4e('0x4f')]=function(_0x54289f){try{if(this['voiceQueues'][_0x54289f[_0x1a4e('0x1b')]]&&this[_0x1a4e('0x5')][_0x54289f[_0x1a4e('0x1b')]]['autopause']===_0x1a4e('0x50')){if(this['agents'][_0x54289f[_0x1a4e('0x1a')]]){logger[_0x1a4e('0x25')](_0x1a4e('0x51'),_0x54289f[_0x1a4e('0x2e')],_0x54289f[_0x1a4e('0x1a')],_0x54289f[_0x1a4e('0x1b')]);return RpcUser[_0x1a4e('0x29')](this[_0x1a4e('0x6')][_0x54289f[_0x1a4e('0x1a')]],'Auto-Pause',_0x54289f[_0x1a4e('0x2e')]);}}}catch(_0x3f355f){logger['error'](_0x1a4e('0x52'),_0x3f355f[_0x1a4e('0x40')]);}};module[_0x1a4e('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 29370a9..5636206 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 _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x4b50c1,_0x5433d9){var _0x209630=function(_0x5a3e1d){while(--_0x5a3e1d){_0x4b50c1['push'](_0x4b50c1['shift']());}};_0x209630(++_0x5433d9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0x0b0e[_0x34c4e1];return _0x5a11ef;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x526e65,_0x57f2cd){var _0x436188=function(_0x19afe0){while(--_0x19afe0){_0x526e65['push'](_0x526e65['shift']());}};_0x436188(++_0x57f2cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 36490e2..b8b7bfb 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 _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x439710,_0xd22e69){var _0x58ca09=function(_0x11beed){while(--_0x11beed){_0x439710['push'](_0x439710['shift']());}};_0x58ca09(++_0xd22e69);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5ac8b9b..f7bbab9 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 _0x4503=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','callbackuniqueid','callbackat','recallme','prototype','voiceQueue','dialCutDigit','substring','getQueue','queue','exports','lodash','moment','isNil','uniqueid','name','Contact','phone','number','active'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4503,0x14d));var _0x3450=function(_0x25da8c,_0x3eaf5a){_0x25da8c=_0x25da8c-0x0;var _0x3c8c4f=_0x4503[_0x25da8c];return _0x3c8c4f;};'use strict';var util=require('util');var _=require(_0x3450('0x0'));var moment=require(_0x3450('0x1'));function checkNameSurname(_0x38b6fd,_0x2eb4b3,_0x11712b){var _0x53be5a='';if(!_[_0x3450('0x2')](_0x2eb4b3)&&'string'===typeof _0x2eb4b3){_0x53be5a+=_0x2eb4b3;}if(!_[_0x3450('0x2')](_0x11712b)&&'string'===typeof _0x11712b){_0x53be5a+='\x20'+_0x11712b;}if(_0x53be5a!==''){return _0x53be5a;}return _0x38b6fd;}function Action(_0x56fd4c,_0x18d748,_0x259fc4){this['voiceQueue']=_0x56fd4c;this[_0x3450('0x3')]=_0x259fc4||undefined;this[_0x3450('0x4')]=checkNameSurname(_0x18d748[_0x3450('0x5')][_0x3450('0x6')],_0x18d748[_0x3450('0x5')]['firstName'],_0x18d748[_0x3450('0x5')]['lastName']);this[_0x3450('0x7')]=_0x18d748[_0x3450('0x5')][_0x3450('0x6')];this['queue']=_0x56fd4c['name'];this[_0x3450('0x8')]=_0x18d748[_0x3450('0x8')]||![];this[_0x3450('0x9')]=_0x56fd4c[_0x3450('0x9')];this[_0x3450('0xa')]=_0x56fd4c[_0x3450('0xa')]||0x3;this[_0x3450('0xb')]=_0x18d748[_0x3450('0xb')];this[_0x3450('0xc')]=_0x18d748[_0x3450('0xc')];this[_0x3450('0xd')]=_0x18d748['countcongestionretry'];this[_0x3450('0xe')]=_0x18d748[_0x3450('0xe')];this['countnosuchnumberretry']=_0x18d748['countnosuchnumberretry'];this[_0x3450('0xf')]=_0x18d748['countdropretry'];this[_0x3450('0x10')]=_0x18d748['countabandonedretry'];this[_0x3450('0x11')]=_0x18d748[_0x3450('0x11')];this[_0x3450('0x12')]=_0x18d748[_0x3450('0x12')];this['ContactId']=_0x18d748['ContactId'];this[_0x3450('0x13')]=_0x18d748[_0x3450('0x13')];this[_0x3450('0x14')]=_0x18d748['UserId'];this['VoiceQueueId']=_0x18d748[_0x3450('0x15')];this[_0x3450('0x16')]=_0x18d748[_0x3450('0x16')];this[_0x3450('0x17')]=_0x18d748['id'];this[_0x3450('0x18')]=_0x18d748[_0x3450('0x5')][_0x3450('0x19')]||'';this[_0x3450('0x1a')]=moment()[_0x3450('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x18d748['callback'];this[_0x3450('0x1c')]=_0x18d748['callbackuniqueid'];this[_0x3450('0x1d')]=_0x18d748[_0x3450('0x1d')];this[_0x3450('0x1e')]=_0x18d748[_0x3450('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3450('0x1f')]['getCaller']=function(){return util[_0x3450('0x1b')]('\x22%s\x22\x20<%s>',this[_0x3450('0x4')],this[_0x3450('0x20')][_0x3450('0x21')]>0x0?this['number'][_0x3450('0x22')](this[_0x3450('0x20')][_0x3450('0x21')]):this['number']);};Action[_0x3450('0x1f')][_0x3450('0x23')]=function(){return this[_0x3450('0x24')];};module[_0x3450('0x25')]=Action; \ No newline at end of file +var _0xc98d=['Contact','phone','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','number','getQueue','exports','util','lodash','moment','isNil','string'];(function(_0x5e59e9,_0x482cae){var _0x29d516=function(_0x41d85e){while(--_0x41d85e){_0x5e59e9['push'](_0x5e59e9['shift']());}};_0x29d516(++_0x482cae);}(_0xc98d,0x7f));var _0xdc98=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0xc98d[_0xdd82b4];return _0x549bb2;};'use strict';var util=require(_0xdc98('0x0'));var _=require(_0xdc98('0x1'));var moment=require(_0xdc98('0x2'));function checkNameSurname(_0x496917,_0x30654f,_0x5229f1){var _0x25b1d2='';if(!_[_0xdc98('0x3')](_0x30654f)&&_0xdc98('0x4')===typeof _0x30654f){_0x25b1d2+=_0x30654f;}if(!_[_0xdc98('0x3')](_0x5229f1)&&_0xdc98('0x4')===typeof _0x5229f1){_0x25b1d2+='\x20'+_0x5229f1;}if(_0x25b1d2!==''){return _0x25b1d2;}return _0x496917;}function Action(_0x45e2de,_0x51f72b,_0x255300){this['voiceQueue']=_0x45e2de;this['uniqueid']=_0x255300||undefined;this['name']=checkNameSurname(_0x51f72b[_0xdc98('0x5')][_0xdc98('0x6')],_0x51f72b[_0xdc98('0x5')]['firstName'],_0x51f72b[_0xdc98('0x5')][_0xdc98('0x7')]);this['number']=_0x51f72b['Contact'][_0xdc98('0x6')];this[_0xdc98('0x8')]=_0x45e2de[_0xdc98('0x9')];this[_0xdc98('0xa')]=_0x51f72b[_0xdc98('0xa')]||![];this[_0xdc98('0xb')]=_0x45e2de['type'];this[_0xdc98('0xc')]=_0x45e2de[_0xdc98('0xc')]||0x3;this[_0xdc98('0xd')]=_0x51f72b[_0xdc98('0xd')];this[_0xdc98('0xe')]=_0x51f72b[_0xdc98('0xe')];this[_0xdc98('0xf')]=_0x51f72b[_0xdc98('0xf')];this['countnoanswerretry']=_0x51f72b[_0xdc98('0x10')];this[_0xdc98('0x11')]=_0x51f72b[_0xdc98('0x11')];this[_0xdc98('0x12')]=_0x51f72b[_0xdc98('0x12')];this['countabandonedretry']=_0x51f72b['countabandonedretry'];this[_0xdc98('0x13')]=_0x51f72b[_0xdc98('0x13')];this[_0xdc98('0x14')]=_0x51f72b['countagentrejectretry'];this[_0xdc98('0x15')]=_0x51f72b[_0xdc98('0x15')];this[_0xdc98('0x16')]=_0x51f72b[_0xdc98('0x16')];this['UserId']=_0x51f72b[_0xdc98('0x17')];this[_0xdc98('0x18')]=_0x51f72b['VoiceQueueId'];this[_0xdc98('0x19')]=_0x51f72b[_0xdc98('0x19')];this[_0xdc98('0x1a')]=_0x51f72b['id'];this[_0xdc98('0x1b')]=_0x51f72b['Contact'][_0xdc98('0x1c')]||'';this[_0xdc98('0x1d')]=moment()['format'](_0xdc98('0x1e'));this['callback']=_0x51f72b[_0xdc98('0x1f')];this[_0xdc98('0x20')]=_0x51f72b[_0xdc98('0x20')];this[_0xdc98('0x21')]=_0x51f72b[_0xdc98('0x21')];this[_0xdc98('0x22')]=_0x51f72b[_0xdc98('0x22')];this['originatecalleridnum']='';this[_0xdc98('0x23')]='';}Action[_0xdc98('0x24')]['getCaller']=function(){return util['format'](_0xdc98('0x25'),this[_0xdc98('0x9')],this[_0xdc98('0x26')]['dialCutDigit']>0x0?this['number'][_0xdc98('0x27')](this[_0xdc98('0x26')][_0xdc98('0x28')]):this[_0xdc98('0x29')]);};Action['prototype'][_0xdc98('0x2a')]=function(){return this['queue'];};module[_0xdc98('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 072ff6d..076c603 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 _0xed4e=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xed4e,0x1ab));var _0xeed4=function(_0x1a00b1,_0x1a92b1){_0x1a00b1=_0x1a00b1-0x0;var _0x1d5f50=_0xed4e[_0x1a00b1];return _0x1d5f50;};'use strict';var util=require(_0xeed4('0x0'));var _=require('lodash');var moment=require(_0xeed4('0x1'));function getSeconds(_0x3fd1b9,_0x434530){var _0x30aee9=moment(_0x3fd1b9)['milliseconds'](0x0);var _0x42d325=moment(_0x434530)['milliseconds'](0x0);return _0x30aee9['diff'](_0x42d325,'seconds');}function AgentComplete(_0x1361f8,_0x4e7384){this[_0xeed4('0x2')]=0x4;this[_0xeed4('0x3')]=_0xeed4('0x4');this[_0xeed4('0x5')]=_0x1361f8[_0xeed4('0x5')];this['type']=_0x1361f8[_0xeed4('0x6')];this[_0xeed4('0x7')]=_0x1361f8[_0xeed4('0x6')]==='outbound'?_0xeed4('0x8'):_0x1361f8[_0xeed4('0x6')];this[_0xeed4('0x9')]=_0x1361f8[_0xeed4('0x9')];this['countcongestionretry']=_0x1361f8['countcongestionretry'];this['countnoanswerretry']=_0x1361f8['countnoanswerretry'];this[_0xeed4('0xa')]=_0x1361f8[_0xeed4('0x9')]+_0x1361f8['countcongestionretry']+_0x1361f8['countnoanswerretry']+_0x1361f8[_0xeed4('0xb')]+_0x1361f8[_0xeed4('0xc')]+_0x1361f8[_0xeed4('0xd')]+_0x1361f8[_0xeed4('0xe')]+_0x1361f8[_0xeed4('0xf')];this[_0xeed4('0xb')]=_0x1361f8[_0xeed4('0xb')];this['countdropretry']=_0x1361f8[_0xeed4('0xc')];this[_0xeed4('0xd')]=_0x1361f8[_0xeed4('0xd')];this[_0xeed4('0xe')]=_0x1361f8[_0xeed4('0xe')];this['countagentrejectretry']=_0x1361f8[_0xeed4('0xf')];this[_0xeed4('0x10')]=_0x4e7384[_0xeed4('0x10')];this[_0xeed4('0x11')]=_0x1361f8[_0xeed4('0x12')];this[_0xeed4('0x13')]=_0x1361f8[_0xeed4('0x14')];this[_0xeed4('0x15')]=_0x1361f8[_0xeed4('0x15')];this['responsetime']=_0x1361f8[_0xeed4('0x16')];this[_0xeed4('0x17')]=_0x1361f8['answertime'];this[_0xeed4('0x18')]=moment()[_0xeed4('0x19')](_0xeed4('0x1a'));this[_0xeed4('0x1b')]=getSeconds(_0x1361f8[_0xeed4('0x16')],_0x1361f8['starttime']);this['holdtime']=getSeconds(_0x1361f8[_0xeed4('0x17')],_0x1361f8['responsetime']);this[_0xeed4('0x1c')]=getSeconds(this[_0xeed4('0x18')],_0x1361f8['answertime']);this[_0xeed4('0x8')]=_0x4e7384['queue'];this[_0xeed4('0x1d')]=_0x4e7384[_0xeed4('0x1d')];this['reason']=_0x4e7384[_0xeed4('0x1e')];this[_0xeed4('0x1f')]=_0x1361f8[_0xeed4('0x1f')];this[_0xeed4('0x20')]=_0x1361f8[_0xeed4('0x20')];this[_0xeed4('0x21')]=_0x1361f8[_0xeed4('0x21')];this[_0xeed4('0x22')]=_0x1361f8['recallme'];this[_0xeed4('0x23')]=_0x1361f8['ContactId'];this[_0xeed4('0x24')]=_0x1361f8['ListId'];this[_0xeed4('0x25')]=_0x1361f8[_0xeed4('0x25')];this[_0xeed4('0x26')]=_0x1361f8[_0xeed4('0x26')];this[_0xeed4('0x27')]=_0x1361f8['CampaignId'];this['originatecalleridnum']=_0x1361f8[_0xeed4('0x28')]||'';this[_0xeed4('0x29')]=_0x1361f8['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x1693=['lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x5eccfd,_0x41e5d5){var _0x5562b1=function(_0x5def9f){while(--_0x5def9f){_0x5eccfd['push'](_0x5eccfd['shift']());}};_0x5562b1(++_0x41e5d5);}(_0x1693,0x16f));var _0x3169=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x1693[_0x33c9f8];return _0x2d7004;};'use strict';var util=require(_0x3169('0x0'));var _=require(_0x3169('0x1'));var moment=require(_0x3169('0x2'));function getSeconds(_0x4391f4,_0x4a6a12){var _0x5bfd1d=moment(_0x4391f4)[_0x3169('0x3')](0x0);var _0x595774=moment(_0x4a6a12)[_0x3169('0x3')](0x0);return _0x5bfd1d['diff'](_0x595774,_0x3169('0x4'));}function AgentComplete(_0x2e6db3,_0x1bd9bb){this['state']=0x4;this[_0x3169('0x5')]=_0x3169('0x6');this['scheduledat']=_0x2e6db3[_0x3169('0x7')];this['type']=_0x2e6db3[_0x3169('0x8')];this['campaigntype']=_0x2e6db3[_0x3169('0x8')]===_0x3169('0x9')?_0x3169('0xa'):_0x2e6db3[_0x3169('0x8')];this[_0x3169('0xb')]=_0x2e6db3[_0x3169('0xb')];this[_0x3169('0xc')]=_0x2e6db3['countcongestionretry'];this[_0x3169('0xd')]=_0x2e6db3[_0x3169('0xd')];this[_0x3169('0xe')]=_0x2e6db3[_0x3169('0xb')]+_0x2e6db3[_0x3169('0xc')]+_0x2e6db3[_0x3169('0xd')]+_0x2e6db3[_0x3169('0xf')]+_0x2e6db3[_0x3169('0x10')]+_0x2e6db3['countabandonedretry']+_0x2e6db3['countmachineretry']+_0x2e6db3[_0x3169('0x11')];this['countnosuchnumberretry']=_0x2e6db3['countnosuchnumberretry'];this['countdropretry']=_0x2e6db3['countdropretry'];this[_0x3169('0x12')]=_0x2e6db3[_0x3169('0x12')];this['countmachineretry']=_0x2e6db3[_0x3169('0x13')];this[_0x3169('0x11')]=_0x2e6db3[_0x3169('0x11')];this[_0x3169('0x14')]=_0x1bd9bb['uniqueid'];this[_0x3169('0x15')]=_0x2e6db3[_0x3169('0x16')];this[_0x3169('0x17')]=_0x2e6db3[_0x3169('0x18')];this[_0x3169('0x19')]=_0x2e6db3[_0x3169('0x19')];this[_0x3169('0x1a')]=_0x2e6db3[_0x3169('0x1a')];this['answertime']=_0x2e6db3[_0x3169('0x1b')];this[_0x3169('0x1c')]=moment()[_0x3169('0x1d')](_0x3169('0x1e'));this[_0x3169('0x1f')]=getSeconds(_0x2e6db3['responsetime'],_0x2e6db3['starttime']);this[_0x3169('0x20')]=getSeconds(_0x2e6db3[_0x3169('0x1b')],_0x2e6db3['responsetime']);this[_0x3169('0x21')]=getSeconds(this[_0x3169('0x1c')],_0x2e6db3[_0x3169('0x1b')]);this[_0x3169('0xa')]=_0x1bd9bb[_0x3169('0xa')];this['membername']=_0x1bd9bb['membername'];this[_0x3169('0x22')]=_0x1bd9bb[_0x3169('0x22')];this[_0x3169('0x23')]=_0x2e6db3[_0x3169('0x23')];this[_0x3169('0x24')]=_0x2e6db3[_0x3169('0x24')];this[_0x3169('0x25')]=_0x2e6db3[_0x3169('0x25')];this[_0x3169('0x26')]=_0x2e6db3[_0x3169('0x26')];this[_0x3169('0x27')]=_0x2e6db3['ContactId'];this[_0x3169('0x28')]=_0x2e6db3[_0x3169('0x28')];this['UserId']=_0x2e6db3[_0x3169('0x29')];this['VoiceQueueId']=_0x2e6db3['VoiceQueueId'];this[_0x3169('0x2a')]=_0x2e6db3[_0x3169('0x2a')];this[_0x3169('0x2b')]=_0x2e6db3[_0x3169('0x2b')]||'';this[_0x3169('0x2c')]=_0x2e6db3[_0x3169('0x2c')]||'';}module[_0x3169('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 335a9f1..4755a88 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 _0x31c2=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x468606,_0x237dce){var _0x391e44=function(_0x4bac7c){while(--_0x4bac7c){_0x468606['push'](_0x468606['shift']());}};_0x391e44(++_0x237dce);}(_0x31c2,0x1e1));var _0x231c=function(_0x32bf8a,_0x4f0f9f){_0x32bf8a=_0x32bf8a-0x0;var _0x1f4194=_0x31c2[_0x32bf8a];return _0x1f4194;};'use strict';var util=require(_0x231c('0x0'));var _=require(_0x231c('0x1'));var moment=require(_0x231c('0x2'));function getSeconds(_0x143120,_0x1c57c9){var _0x7e36a0=moment(_0x143120)[_0x231c('0x3')](0x0);var _0x5a8f6b=moment(_0x1c57c9)['milliseconds'](0x0);return _0x7e36a0['diff'](_0x5a8f6b,_0x231c('0x4'));}function Final(_0x1b9d64){this[_0x231c('0x5')]=_0x1b9d64[_0x231c('0x5')];this['scheduledat']=_0x1b9d64[_0x231c('0x6')];this['type']=_0x1b9d64[_0x231c('0x7')];this[_0x231c('0x8')]=_0x1b9d64[_0x231c('0x7')]==='outbound'?_0x231c('0x9'):_0x1b9d64[_0x231c('0x7')];this[_0x231c('0xa')]=_0x1b9d64[_0x231c('0xa')];this[_0x231c('0xb')]=_0x1b9d64[_0x231c('0xb')];this[_0x231c('0xc')]=_0x1b9d64['countnoanswerretry'];this[_0x231c('0xd')]=_0x1b9d64[_0x231c('0xa')]+_0x1b9d64['countcongestionretry']+_0x1b9d64[_0x231c('0xc')]+_0x1b9d64[_0x231c('0xe')]+_0x1b9d64[_0x231c('0xf')]+_0x1b9d64[_0x231c('0x10')]+_0x1b9d64[_0x231c('0x11')]+_0x1b9d64[_0x231c('0x12')];this[_0x231c('0xe')]=_0x1b9d64[_0x231c('0xe')];this[_0x231c('0xf')]=_0x1b9d64[_0x231c('0xf')];this[_0x231c('0x10')]=_0x1b9d64[_0x231c('0x10')];this[_0x231c('0x11')]=_0x1b9d64[_0x231c('0x11')];this[_0x231c('0x12')]=_0x1b9d64[_0x231c('0x12')];this[_0x231c('0x9')]=_0x1b9d64[_0x231c('0x9')];this[_0x231c('0x13')]=_0x1b9d64[_0x231c('0x13')];this['calleridnum']=_0x1b9d64[_0x231c('0x14')];this[_0x231c('0x15')]=_0x1b9d64[_0x231c('0x15')];this[_0x231c('0x16')]=_0x1b9d64[_0x231c('0x16')];this[_0x231c('0x17')]=_0x1b9d64[_0x231c('0x16')];this[_0x231c('0x18')]=_0x1b9d64[_0x231c('0x18')]||0x0;this[_0x231c('0x19')]=_0x1b9d64['holdtime']||0x0;this[_0x231c('0x1a')]=_0x1b9d64['talktime']||0x0;this[_0x231c('0x1b')]=_0x1b9d64['callback'];this[_0x231c('0x1c')]=_0x1b9d64[_0x231c('0x1c')];this[_0x231c('0x1d')]=_0x1b9d64[_0x231c('0x1d')];this[_0x231c('0x1e')]=_0x1b9d64[_0x231c('0x1e')];this[_0x231c('0x1f')]=_0x1b9d64[_0x231c('0x1f')];this['ListId']=_0x1b9d64[_0x231c('0x20')];this[_0x231c('0x21')]=_0x1b9d64['UserId'];this[_0x231c('0x22')]=_0x1b9d64[_0x231c('0x22')];this['CampaignId']=_0x1b9d64[_0x231c('0x23')];this['originatecalleridnum']=_0x1b9d64[_0x231c('0x24')]||'';this[_0x231c('0x25')]=_0x1b9d64[_0x231c('0x25')]||'';}module[_0x231c('0x26')]=Final; \ No newline at end of file +var _0x7579=['endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime'];(function(_0x53c599,_0x4b5ff1){var _0x39f879=function(_0x55ed18){while(--_0x55ed18){_0x53c599['push'](_0x53c599['shift']());}};_0x39f879(++_0x4b5ff1);}(_0x7579,0x1e2));var _0x9757=function(_0x196a43,_0x5782fd){_0x196a43=_0x196a43-0x0;var _0x364eb6=_0x7579[_0x196a43];return _0x364eb6;};'use strict';var util=require(_0x9757('0x0'));var _=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));function getSeconds(_0x30eeec,_0x2e6afa){var _0x304b14=moment(_0x30eeec)['milliseconds'](0x0);var _0x399165=moment(_0x2e6afa)[_0x9757('0x3')](0x0);return _0x304b14[_0x9757('0x4')](_0x399165,_0x9757('0x5'));}function Final(_0x4c1a67){this[_0x9757('0x6')]=_0x4c1a67[_0x9757('0x6')];this[_0x9757('0x7')]=_0x4c1a67['scheduledat'];this[_0x9757('0x8')]=_0x4c1a67['type'];this[_0x9757('0x9')]=_0x4c1a67[_0x9757('0x8')]===_0x9757('0xa')?'queue':_0x4c1a67[_0x9757('0x8')];this[_0x9757('0xb')]=_0x4c1a67[_0x9757('0xb')];this[_0x9757('0xc')]=_0x4c1a67[_0x9757('0xc')];this[_0x9757('0xd')]=_0x4c1a67[_0x9757('0xd')];this[_0x9757('0xe')]=_0x4c1a67[_0x9757('0xb')]+_0x4c1a67[_0x9757('0xc')]+_0x4c1a67[_0x9757('0xd')]+_0x4c1a67['countnosuchnumberretry']+_0x4c1a67[_0x9757('0xf')]+_0x4c1a67[_0x9757('0x10')]+_0x4c1a67[_0x9757('0x11')]+_0x4c1a67['countagentrejectretry'];this[_0x9757('0x12')]=_0x4c1a67[_0x9757('0x12')];this[_0x9757('0xf')]=_0x4c1a67[_0x9757('0xf')];this[_0x9757('0x10')]=_0x4c1a67[_0x9757('0x10')];this[_0x9757('0x11')]=_0x4c1a67['countmachineretry'];this[_0x9757('0x13')]=_0x4c1a67['countagentrejectretry'];this[_0x9757('0x14')]=_0x4c1a67[_0x9757('0x14')];this[_0x9757('0x15')]=_0x4c1a67[_0x9757('0x15')];this[_0x9757('0x16')]=_0x4c1a67[_0x9757('0x16')];this['starttime']=_0x4c1a67[_0x9757('0x17')];this[_0x9757('0x18')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x19')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x1a')]=_0x4c1a67[_0x9757('0x1a')]||0x0;this['holdtime']=_0x4c1a67[_0x9757('0x1b')]||0x0;this['talktime']=_0x4c1a67['talktime']||0x0;this[_0x9757('0x1c')]=_0x4c1a67[_0x9757('0x1c')];this[_0x9757('0x1d')]=_0x4c1a67[_0x9757('0x1d')];this['callbackat']=_0x4c1a67['callbackat'];this['recallme']=_0x4c1a67[_0x9757('0x1e')];this[_0x9757('0x1f')]=_0x4c1a67[_0x9757('0x1f')];this[_0x9757('0x20')]=_0x4c1a67['ListId'];this[_0x9757('0x21')]=_0x4c1a67[_0x9757('0x21')];this['VoiceQueueId']=_0x4c1a67[_0x9757('0x22')];this[_0x9757('0x23')]=_0x4c1a67['CampaignId'];this[_0x9757('0x24')]=_0x4c1a67[_0x9757('0x24')]||'';this[_0x9757('0x25')]=_0x4c1a67[_0x9757('0x25')]||'';}module[_0x9757('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 959a393..ad1e2a3 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 _0xb284=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb284,0x15a));var _0x4b28=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb284[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x4b28('0x0'));var _=require('lodash');var moment=require(_0x4b28('0x1'));function getSeconds(_0xdf5efc,_0x689bba){var _0xbaf5ae=moment(_0xdf5efc)[_0x4b28('0x2')](0x0);var _0x283e14=moment(_0x689bba)[_0x4b28('0x2')](0x0);return _0xbaf5ae[_0x4b28('0x3')](_0x283e14,_0x4b28('0x4'));}function Hangup(_0x5bc44c,_0x385ab6){this[_0x4b28('0x5')]=0x4;this[_0x4b28('0x6')]=_0x4b28('0x7');this[_0x4b28('0x8')]=_0x5bc44c[_0x4b28('0x8')];this[_0x4b28('0x9')]=_0x5bc44c[_0x4b28('0x9')];this[_0x4b28('0xa')]=_0x5bc44c[_0x4b28('0x9')]===_0x4b28('0xb')?_0x4b28('0xc'):_0x5bc44c['type'];this[_0x4b28('0xd')]=_0x5bc44c[_0x4b28('0xd')];this['countcongestionretry']=_0x5bc44c[_0x4b28('0xe')];this[_0x4b28('0xf')]=_0x5bc44c[_0x4b28('0xf')];this[_0x4b28('0x10')]=_0x5bc44c[_0x4b28('0xd')]+_0x5bc44c[_0x4b28('0xe')]+_0x5bc44c['countnoanswerretry']+_0x5bc44c[_0x4b28('0x11')]+_0x5bc44c[_0x4b28('0x12')]+_0x5bc44c[_0x4b28('0x13')]+_0x5bc44c['countmachineretry']+_0x5bc44c[_0x4b28('0x14')];this[_0x4b28('0x11')]=_0x5bc44c[_0x4b28('0x11')];this[_0x4b28('0x12')]=_0x5bc44c[_0x4b28('0x12')];this['countabandonedretry']=_0x5bc44c['countabandonedretry'];this[_0x4b28('0x15')]=_0x5bc44c['countmachineretry'];this[_0x4b28('0x14')]=_0x5bc44c['countagentrejectretry'];this['uniqueid']=_0x385ab6[_0x4b28('0x16')];this[_0x4b28('0x17')]=_0x5bc44c[_0x4b28('0x18')];this[_0x4b28('0x19')]=_0x5bc44c[_0x4b28('0x1a')];this[_0x4b28('0x1b')]=_0x5bc44c['starttime'];this[_0x4b28('0x1c')]=_0x5bc44c[_0x4b28('0x1c')];this[_0x4b28('0x1d')]=moment()[_0x4b28('0x1e')](_0x4b28('0x1f'));this[_0x4b28('0x20')]=getSeconds(_0x5bc44c[_0x4b28('0x1c')],_0x5bc44c[_0x4b28('0x1b')]);this[_0x4b28('0x21')]=0x0;this['talktime']=getSeconds(this[_0x4b28('0x1d')],_0x5bc44c[_0x4b28('0x1c')]);this[_0x4b28('0xc')]=_0x5bc44c[_0x4b28('0xc')];this[_0x4b28('0x22')]='IVR';this[_0x4b28('0x23')]=_0x385ab6[_0x4b28('0x24')];this[_0x4b28('0x25')]=_0x5bc44c[_0x4b28('0x25')];this[_0x4b28('0x26')]=_0x5bc44c[_0x4b28('0x26')];this[_0x4b28('0x27')]=_0x5bc44c[_0x4b28('0x27')];this['recallme']=_0x5bc44c['recallme'];this[_0x4b28('0x28')]=_0x5bc44c['ContactId'];this[_0x4b28('0x29')]=_0x5bc44c[_0x4b28('0x29')];this[_0x4b28('0x2a')]=_0x5bc44c['UserId'];this[_0x4b28('0x2b')]=_0x5bc44c['VoiceQueueId'];this['CampaignId']=_0x5bc44c['CampaignId'];}module[_0x4b28('0x2c')]=Hangup; \ No newline at end of file +var _0x6143=['outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype'];(function(_0x323455,_0xbd3d87){var _0x56e62d=function(_0x1707ce){while(--_0x1707ce){_0x323455['push'](_0x323455['shift']());}};_0x56e62d(++_0xbd3d87);}(_0x6143,0xab));var _0x3614=function(_0x5d6692,_0x152e4a){_0x5d6692=_0x5d6692-0x0;var _0x1ee76d=_0x6143[_0x5d6692];return _0x1ee76d;};'use strict';var util=require('util');var _=require(_0x3614('0x0'));var moment=require('moment');function getSeconds(_0x418f88,_0xb12474){var _0x3d0052=moment(_0x418f88)[_0x3614('0x1')](0x0);var _0x2bd0fb=moment(_0xb12474)['milliseconds'](0x0);return _0x3d0052[_0x3614('0x2')](_0x2bd0fb,'seconds');}function Hangup(_0x2e49e5,_0x21697d){this[_0x3614('0x3')]=0x4;this[_0x3614('0x4')]=_0x3614('0x5');this[_0x3614('0x6')]=_0x2e49e5[_0x3614('0x6')];this['type']=_0x2e49e5[_0x3614('0x7')];this[_0x3614('0x8')]=_0x2e49e5[_0x3614('0x7')]===_0x3614('0x9')?_0x3614('0xa'):_0x2e49e5['type'];this['countbusyretry']=_0x2e49e5['countbusyretry'];this['countcongestionretry']=_0x2e49e5[_0x3614('0xb')];this[_0x3614('0xc')]=_0x2e49e5[_0x3614('0xc')];this['countglobal']=_0x2e49e5[_0x3614('0xd')]+_0x2e49e5[_0x3614('0xb')]+_0x2e49e5[_0x3614('0xc')]+_0x2e49e5[_0x3614('0xe')]+_0x2e49e5[_0x3614('0xf')]+_0x2e49e5[_0x3614('0x10')]+_0x2e49e5[_0x3614('0x11')]+_0x2e49e5[_0x3614('0x12')];this['countnosuchnumberretry']=_0x2e49e5[_0x3614('0xe')];this[_0x3614('0xf')]=_0x2e49e5[_0x3614('0xf')];this[_0x3614('0x10')]=_0x2e49e5['countabandonedretry'];this['countmachineretry']=_0x2e49e5[_0x3614('0x11')];this['countagentrejectretry']=_0x2e49e5[_0x3614('0x12')];this[_0x3614('0x13')]=_0x21697d['uniqueid'];this[_0x3614('0x14')]=_0x2e49e5[_0x3614('0x15')];this[_0x3614('0x16')]=_0x2e49e5['number'];this[_0x3614('0x17')]=_0x2e49e5[_0x3614('0x17')];this[_0x3614('0x18')]=_0x2e49e5[_0x3614('0x18')];this[_0x3614('0x19')]=moment()[_0x3614('0x1a')](_0x3614('0x1b'));this[_0x3614('0x1c')]=getSeconds(_0x2e49e5[_0x3614('0x18')],_0x2e49e5['starttime']);this[_0x3614('0x1d')]=0x0;this[_0x3614('0x1e')]=getSeconds(this[_0x3614('0x19')],_0x2e49e5['responsetime']);this[_0x3614('0xa')]=_0x2e49e5[_0x3614('0xa')];this[_0x3614('0x1f')]=_0x3614('0x20');this[_0x3614('0x21')]=_0x21697d[_0x3614('0x22')];this['callback']=_0x2e49e5[_0x3614('0x23')];this[_0x3614('0x24')]=_0x2e49e5[_0x3614('0x24')];this[_0x3614('0x25')]=_0x2e49e5[_0x3614('0x25')];this['recallme']=_0x2e49e5[_0x3614('0x26')];this[_0x3614('0x27')]=_0x2e49e5[_0x3614('0x27')];this[_0x3614('0x28')]=_0x2e49e5[_0x3614('0x28')];this[_0x3614('0x29')]=_0x2e49e5['UserId'];this['VoiceQueueId']=_0x2e49e5[_0x3614('0x2a')];this[_0x3614('0x2b')]=_0x2e49e5['CampaignId'];}module[_0x3614('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 8fc1e4b..d54fd61 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 _0x36eb=['exports','lodash','milliseconds','diff','seconds','uniqueid','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','name','calleridnum','number','endtime','responsetime','ringtime','starttime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x1e0aa3,_0x461c9a){var _0x45b898=function(_0x16e13a){while(--_0x16e13a){_0x1e0aa3['push'](_0x1e0aa3['shift']());}};_0x45b898(++_0x461c9a);}(_0x36eb,0x119));var _0xb36e=function(_0x2cfdbe,_0xce3adf){_0x2cfdbe=_0x2cfdbe-0x0;var _0x3def0e=_0x36eb[_0x2cfdbe];return _0x3def0e;};'use strict';var util=require('util');var _=require(_0xb36e('0x0'));var moment=require('moment');function getSeconds(_0x2b3f53,_0x53eaf0){var _0x40327f=moment(_0x2b3f53)[_0xb36e('0x1')](0x0);var _0x28945e=moment(_0x53eaf0)[_0xb36e('0x1')](0x0);return _0x40327f[_0xb36e('0x2')](_0x28945e,_0xb36e('0x3'));}function History(_0x2be804){this[_0xb36e('0x4')]=_0x2be804['uniqueid'];this['scheduledat']=_0x2be804['scheduledat']||undefined;this[_0xb36e('0x5')]=_0x2be804[_0xb36e('0x5')];this[_0xb36e('0x6')]=_0x2be804[_0xb36e('0x5')]==='outbound'?_0xb36e('0x7'):_0x2be804[_0xb36e('0x5')];this[_0xb36e('0x8')]=_0x2be804[_0xb36e('0x8')];this[_0xb36e('0x9')]=_0x2be804[_0xb36e('0x9')];this['countnoanswerretry']=_0x2be804[_0xb36e('0xa')];this['countglobal']=_0x2be804[_0xb36e('0x8')]+_0x2be804[_0xb36e('0x9')]+_0x2be804[_0xb36e('0xa')]+_0x2be804['countnosuchnumberretry']+_0x2be804['countdropretry']+_0x2be804[_0xb36e('0xb')]+_0x2be804[_0xb36e('0xc')]+_0x2be804[_0xb36e('0xd')];this[_0xb36e('0xe')]=_0x2be804[_0xb36e('0xe')];this['countdropretry']=_0x2be804[_0xb36e('0xf')];this[_0xb36e('0xb')]=_0x2be804[_0xb36e('0xb')];this[_0xb36e('0xc')]=_0x2be804[_0xb36e('0xc')];this['countagentrejectretry']=_0x2be804['countagentrejectretry'];this[_0xb36e('0x7')]=_0x2be804[_0xb36e('0x7')];this['calleridname']=_0x2be804[_0xb36e('0x10')];this[_0xb36e('0x11')]=_0x2be804[_0xb36e('0x12')];this['starttime']=_0x2be804['starttime'];this['responsetime']=_0x2be804['responsetime'];this[_0xb36e('0x13')]=_0x2be804[_0xb36e('0x14')];this[_0xb36e('0x15')]=getSeconds(_0x2be804[_0xb36e('0x14')],_0x2be804[_0xb36e('0x16')]);this[_0xb36e('0x17')]=0x0;this['talktime']=0x0;this['callback']=_0x2be804['callback'];this[_0xb36e('0x18')]=_0x2be804[_0xb36e('0x18')];this[_0xb36e('0x19')]=_0x2be804[_0xb36e('0x19')];this[_0xb36e('0x1a')]=_0x2be804[_0xb36e('0x1a')];this[_0xb36e('0x1b')]=_0x2be804[_0xb36e('0x1b')];this['ListId']=_0x2be804[_0xb36e('0x1c')];this['UserId']=_0x2be804[_0xb36e('0x1d')];this[_0xb36e('0x1e')]=_0x2be804[_0xb36e('0x1e')];this[_0xb36e('0x1f')]=_0x2be804[_0xb36e('0x1f')];this['originatecalleridnum']=_0x2be804[_0xb36e('0x20')]||'';this[_0xb36e('0x21')]=_0x2be804['originatecalleridname']||'';}module[_0xb36e('0x22')]=History; \ No newline at end of file +var _0x36d7=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','responsetime','endtime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x36d7,0x12d));var _0x736d=function(_0x4947d7,_0x270f05){_0x4947d7=_0x4947d7-0x0;var _0x4b6e94=_0x36d7[_0x4947d7];return _0x4b6e94;};'use strict';var util=require(_0x736d('0x0'));var _=require(_0x736d('0x1'));var moment=require(_0x736d('0x2'));function getSeconds(_0x139e68,_0x525ab1){var _0xd18423=moment(_0x139e68)['milliseconds'](0x0);var _0x30e227=moment(_0x525ab1)[_0x736d('0x3')](0x0);return _0xd18423[_0x736d('0x4')](_0x30e227,_0x736d('0x5'));}function History(_0x2114ca){this['uniqueid']=_0x2114ca[_0x736d('0x6')];this[_0x736d('0x7')]=_0x2114ca[_0x736d('0x7')]||undefined;this[_0x736d('0x8')]=_0x2114ca[_0x736d('0x8')];this['campaigntype']=_0x2114ca['type']==='outbound'?_0x736d('0x9'):_0x2114ca['type'];this[_0x736d('0xa')]=_0x2114ca['countbusyretry'];this[_0x736d('0xb')]=_0x2114ca[_0x736d('0xb')];this[_0x736d('0xc')]=_0x2114ca[_0x736d('0xc')];this['countglobal']=_0x2114ca[_0x736d('0xa')]+_0x2114ca['countcongestionretry']+_0x2114ca['countnoanswerretry']+_0x2114ca[_0x736d('0xd')]+_0x2114ca[_0x736d('0xe')]+_0x2114ca[_0x736d('0xf')]+_0x2114ca['countmachineretry']+_0x2114ca[_0x736d('0x10')];this[_0x736d('0xd')]=_0x2114ca[_0x736d('0xd')];this['countdropretry']=_0x2114ca['countdropretry'];this['countabandonedretry']=_0x2114ca[_0x736d('0xf')];this['countmachineretry']=_0x2114ca['countmachineretry'];this[_0x736d('0x10')]=_0x2114ca[_0x736d('0x10')];this[_0x736d('0x9')]=_0x2114ca['queue'];this[_0x736d('0x11')]=_0x2114ca[_0x736d('0x12')];this[_0x736d('0x13')]=_0x2114ca['number'];this['starttime']=_0x2114ca['starttime'];this[_0x736d('0x14')]=_0x2114ca['responsetime'];this[_0x736d('0x15')]=_0x2114ca[_0x736d('0x14')];this[_0x736d('0x16')]=getSeconds(_0x2114ca[_0x736d('0x14')],_0x2114ca[_0x736d('0x17')]);this[_0x736d('0x18')]=0x0;this[_0x736d('0x19')]=0x0;this['callback']=_0x2114ca[_0x736d('0x1a')];this[_0x736d('0x1b')]=_0x2114ca[_0x736d('0x1b')];this['callbackat']=_0x2114ca[_0x736d('0x1c')];this['recallme']=_0x2114ca[_0x736d('0x1d')];this[_0x736d('0x1e')]=_0x2114ca[_0x736d('0x1e')];this[_0x736d('0x1f')]=_0x2114ca[_0x736d('0x1f')];this[_0x736d('0x20')]=_0x2114ca[_0x736d('0x20')];this[_0x736d('0x21')]=_0x2114ca[_0x736d('0x21')];this[_0x736d('0x22')]=_0x2114ca[_0x736d('0x22')];this[_0x736d('0x23')]=_0x2114ca[_0x736d('0x23')]||'';this['originatecalleridname']=_0x2114ca['originatecalleridname']||'';}module[_0x736d('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index bef2234..01af180 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 _0x6f7a=['predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','format','voice_queue:save','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\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','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','enqueue','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','isNil','xcally-motion-dialer','dialAMDActive','value','uniqueid','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','add','minutes','ListId','[rescheduleContact][Machine]','HANGUP','countglobal','countnosuchnumberretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','reason','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','paused','stateinterface','locked','queueBooked','push','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','isArray','command','timezones','content','indexOf','true','Action','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','\x5cw{0,','pow','replace','random','actionOriginate','object','Contact','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','phone','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','unlockContact','outboundReCallsDay','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','abandonmentRate','--------\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]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls'];(function(_0x179c0c,_0x20fe42){var _0x2ab663=function(_0x3b9c1f){while(--_0x3b9c1f){_0x179c0c['push'](_0x179c0c['shift']());}};_0x2ab663(++_0x20fe42);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1ce042,_0x52261b){_0x1ce042=_0x1ce042-0x0;var _0x2eba0e=_0x6f7a[_0x1ce042];return _0x2eba0e;};'use strict';var util=require(_0xa6f7('0x0'));var _=require(_0xa6f7('0x1'));var BPromise=require(_0xa6f7('0x2'));var uuid=require(_0xa6f7('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xa6f7('0x4'));var Redis=require(_0xa6f7('0x5'));var ut=require(_0xa6f7('0x6'));var config=require(_0xa6f7('0x7'));var logger=require(_0xa6f7('0x8'))(_0xa6f7('0x9'));var loggerBooked=require(_0xa6f7('0x8'))(_0xa6f7('0xa'));var loggerPredictive=require(_0xa6f7('0x8'))(_0xa6f7('0xb'));var loggerPredictiveCalls=require(_0xa6f7('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xa6f7('0xc'));var ami=require(_0xa6f7('0xd'));config[_0xa6f7('0xe')]=_[_0xa6f7('0xf')](config[_0xa6f7('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6f7('0xe')]));var cmHopper=require(_0xa6f7('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xa6f7('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xa6f7('0x12'));var History=require(_0xa6f7('0x13'));var Final=require(_0xa6f7('0x14'));var AgentComplete=require(_0xa6f7('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xa6f7('0x16'));var ipAgi=process['env'][_0xa6f7('0x17')]||_0xa6f7('0x18');var strategy={'rrmemory':_0xa6f7('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xa6f7('0x1a')]['enqueue']=function(_0x41bc4d){this['tail']=this[_0xa6f7('0x1b')]?this[_0xa6f7('0x1b')][_0xa6f7('0x1c')](_0x41bc4d):_0x41bc4d();};function Dialer(_0x47e664,_0xdb37e2){this[_0xa6f7('0x1d')]=new Sequence();this[_0xa6f7('0x1e')]=_0xdb37e2;this[_0xa6f7('0x1f')]=_0x47e664['voiceQueues'];this['campaigns']=_0x47e664[_0xa6f7('0x20')];this['agents']=_0x47e664[_0xa6f7('0x21')];this[_0xa6f7('0x22')]=_0x47e664['trunks'];this[_0xa6f7('0x23')]=config[_0xa6f7('0x23')]||0x2;this[_0xa6f7('0x24')]={};this[_0xa6f7('0x25')]={};this[_0xa6f7('0x26')]={};this[_0xa6f7('0x27')]={};this['optionPredictive']={};this[_0xa6f7('0x28')]={};this[_0xa6f7('0x29')]={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0xa6f7('0x2a'),this[_0xa6f7('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xa6f7('0x2c')](this));ami['on'](_0xa6f7('0x2d'),this[_0xa6f7('0x2e')]['bind'](this));ami['on']('agentcomplete',this[_0xa6f7('0x2f')]['bind'](this));ami['on']('custom:queuesummary',this[_0xa6f7('0xc')]['bind'](this));ami['on'](_0xa6f7('0x30'),this[_0xa6f7('0x31')][_0xa6f7('0x2c')](this));ami['on'](_0xa6f7('0x32'),this[_0xa6f7('0x33')]['bind'](this));ami['on']('varset',this[_0xa6f7('0x34')][_0xa6f7('0x2c')](this));ami['on']('queuemember',this[_0xa6f7('0x35')][_0xa6f7('0x2c')](this));ami['on'](_0xa6f7('0x36'),this[_0xa6f7('0x37')][_0xa6f7('0x2c')](this));this[_0xa6f7('0x38')]();this[_0xa6f7('0x39')]();}function isNotNull(_0x54f72c){return _0x54f72c!==null&&!_[_0xa6f7('0x3a')](_0x54f72c);}function checkIsLoggedIn(_0x3dee2e,_0x40b0f8){return function(){if(_0x40b0f8<=0x0){_0x3dee2e[_0xa6f7('0x3b')]='AGENTS_NOT_LOGGED';throw _0x3dee2e[_0xa6f7('0x3c')]+_0xa6f7('0x3d');}};}function isActive(_0x5bf8e3){return _0x5bf8e3;}function checkIsActive(_0xd6304f,_0x34d571){return function(){if(!isActive(_0x34d571)){_0xd6304f['message']='NOT_ACTIVE';throw _0xd6304f[_0xa6f7('0x3c')]+_0xa6f7('0x3e');}};}function checkInterval(_0x2b33d){return function(){if(!isNotNull(_0x2b33d[_0xa6f7('0x3f')])){_0x2b33d[_0xa6f7('0x3b')]='INTERVAL_IS_NULL';throw _0x2b33d['name']+_0xa6f7('0x40');}if(!isNotNull(_0x2b33d['Interval'][_0xa6f7('0x41')])){_0x2b33d[_0xa6f7('0x3b')]=_0xa6f7('0x42');throw _0x2b33d[_0xa6f7('0x3c')]+_0xa6f7('0x40');}if(!isNotNull(_[_0xa6f7('0x43')](_0x2b33d['Interval'][_0xa6f7('0x41')]))){_0x2b33d[_0xa6f7('0x3b')]=_0xa6f7('0x42');throw _0x2b33d['name']+_0xa6f7('0x40');}};}function msgResponse(_0x5ab03d,_0x1170c4,_0x2f5632){return{'action':_0x5ab03d,'response':_0x1170c4,'message':_0x2f5632,'stack':_0x2f5632};}function myreject(_0x45837c){return function(_0x4ccbd3){return _0x45837c(msgResponse(_0xa6f7('0x44'),_0xa6f7('0x45'),JSON[_0xa6f7('0x46')](_0x4ccbd3)));};}function getSeconds(_0x37b833,_0x14444c){var _0x28490e=moment(_0x37b833)['milliseconds'](0x0);var _0xc33ec8=moment(_0x14444c)[_0xa6f7('0x47')](0x0);return _0x28490e[_0xa6f7('0x48')](_0xc33ec8,_0xa6f7('0x49'));}function emit(_0x18d18c,_0x56a773,_0x45acdd){io['to'](_0x18d18c)[_0xa6f7('0x4a')](_0x56a773,_0x45acdd);}function emitVoiceQueueSummary(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x4b')]===_0xa6f7('0x4c')){var _0x353e54={'id':_0x4c2d2e['id'],'name':_0x4c2d2e['name'],'strategy':_0x4c2d2e[_0xa6f7('0x4d')],'answered':_0x4c2d2e[_0xa6f7('0x4e')],'available':_0x4c2d2e['available'],'loggedIn':_0x4c2d2e[_0xa6f7('0x4f')],'pTalking':_0x4c2d2e[_0xa6f7('0x50')],'sumBillable':_0x4c2d2e[_0xa6f7('0x51')],'sumDuration':_0x4c2d2e[_0xa6f7('0x52')],'sumHoldTime':_0x4c2d2e[_0xa6f7('0x53')]||0x0,'talking':_0x4c2d2e['talking'],'total':_0x4c2d2e[_0xa6f7('0x54')],'type':_0x4c2d2e[_0xa6f7('0x4b')],'unmanaged':_0x4c2d2e[_0xa6f7('0x55')],'abandoned':_0x4c2d2e[_0xa6f7('0x56')],'waiting':_0x4c2d2e[_0xa6f7('0x57')],'loggedInDb':_0x4c2d2e[_0xa6f7('0x58')],'dialActive':_0x4c2d2e[_0xa6f7('0x59')],'dialMethod':_0x4c2d2e[_0xa6f7('0x5a')],'dialOriginateCallerIdName':_0x4c2d2e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4c2d2e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4c2d2e[_0xa6f7('0x5b')],'dialPrefix':_0x4c2d2e[_0xa6f7('0x5c')],'outboundAnswerAgiCallsDay':_0x4c2d2e[_0xa6f7('0x5d')],'outboundAnswerCallsDay':_0x4c2d2e[_0xa6f7('0x5e')],'outboundBlacklistCallsDay':_0x4c2d2e[_0xa6f7('0x5f')],'outboundBusyCallsDay':_0x4c2d2e[_0xa6f7('0x60')],'outboundCongestionCallsDay':_0x4c2d2e[_0xa6f7('0x61')],'outboundDropCallsDayACS':_0x4c2d2e[_0xa6f7('0x62')],'outboundDropCallsDayCallersExit':_0x4c2d2e[_0xa6f7('0x63')],'outboundDropCallsDayTimeout':_0x4c2d2e[_0xa6f7('0x64')],'outboundNoAnswerCallsDay':_0x4c2d2e['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4c2d2e[_0xa6f7('0x65')],'outboundOriginateFailureCallsDay':_0x4c2d2e[_0xa6f7('0x66')],'outboundReCallsDay':_0x4c2d2e['outboundReCallsDay'],'outboundRejectCallsDay':_0x4c2d2e[_0xa6f7('0x67')],'outboundUnknownCallsDay':_0x4c2d2e[_0xa6f7('0x68')],'predictiveIntervalAnsweredCalls':_0x4c2d2e[_0xa6f7('0x69')],'predictiveIntervalAvgHoldtime':_0x4c2d2e[_0xa6f7('0x6a')],'predictiveIntervalAvgTalktime':_0x4c2d2e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4c2d2e[_0xa6f7('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x4c2d2e['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4c2d2e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4c2d2e[_0xa6f7('0x6c')],'predictiveIntervalHitRate':_0x4c2d2e[_0xa6f7('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x4c2d2e[_0xa6f7('0x6e')],'predictiveIntervalPauses':_0x4c2d2e[_0xa6f7('0x6f')],'predictiveIntervalAvailable':_0x4c2d2e[_0xa6f7('0x70')],'predictiveIntervalTotalCalls':_0x4c2d2e[_0xa6f7('0x71')],'message':_0x4c2d2e[_0xa6f7('0x3b')],'originated':_0x4c2d2e['originated'],'erlangCalls':_0x4c2d2e[_0xa6f7('0x72')],'erlangCallToSecond':_0x4c2d2e[_0xa6f7('0x73')],'erlangAbandonmentRate':_0x4c2d2e['erlangAbandonmentRate'],'erlangBusyFactor':_0x4c2d2e[_0xa6f7('0x74')],'startPredictive':_0x4c2d2e[_0xa6f7('0x28')],'startProgressive':_0x4c2d2e[_0xa6f7('0x29')]};if(_0x4c2d2e['Trunk']){_0x353e54[_0xa6f7('0x75')]={'id':_0x4c2d2e['Trunk']['id'],'name':_0x4c2d2e[_0xa6f7('0x75')][_0xa6f7('0x3c')],'active':_0x4c2d2e[_0xa6f7('0x75')]['active'],'callerid':_0x4c2d2e['Trunk'][_0xa6f7('0x76')]};}if(_0x4c2d2e['Interval']){_0x353e54[_0xa6f7('0x3f')]={'id':_0x4c2d2e['Interval']['id'],'name':_0x4c2d2e['Interval'][_0xa6f7('0x3c')]};}var _0x2e3a04=md5(JSON[_0xa6f7('0x46')](_0x353e54));if(_0x4c2d2e[_0xa6f7('0x4')]!==_0x2e3a04){_0x4c2d2e[_0xa6f7('0x4')]=_0x2e3a04;emit(util[_0xa6f7('0x77')]('voice:queue:%s',_0x353e54[_0xa6f7('0x3c')]),_0xa6f7('0x78'),_0x353e54);}}}function emitCampaignSummary(_0x58080f){if(_0x58080f[_0xa6f7('0x4b')]==='ivr'){emit(util[_0xa6f7('0x77')]('campaign:ivr:%s',_0x58080f['name']),_0xa6f7('0x79'),_0x58080f);}}function checkGetDataPredictive(_0x158af5){if(isNotNull(_0x158af5)&&!_[_0xa6f7('0x43')](_0x158af5)){loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x7b'));loggerPredictive['info'](_0xa6f7('0x7c'),_0x158af5[_0xa6f7('0x71')]);loggerPredictive['info'](_0xa6f7('0x7d'),_0x158af5['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x7e'),_0x158af5[_0xa6f7('0x7f')]);loggerPredictive['info'](_0xa6f7('0x80'),_0x158af5['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x81'),_0x158af5[_0xa6f7('0x6a')]);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x82'),_0x158af5['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xa6f7('0x83'));if(_0x158af5[_0xa6f7('0x71')]>0x0){if(!_[_0xa6f7('0x3a')](_0x158af5[_0xa6f7('0x84')])&&_0x158af5['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x85'));if(!_[_0xa6f7('0x3a')](_0x158af5[_0xa6f7('0x6a')])&&_0x158af5[_0xa6f7('0x6a')]>0x0){return!![];}loggerPredictive[_0xa6f7('0x7a')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x86'));}}else{loggerPredictive[_0xa6f7('0x7a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xb049d7){return function(_0x16a2a4){loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x87'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16a2a4[_0xa6f7('0x72')]);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x88'),_0x16a2a4[_0xa6f7('0x73')]);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x89'),_0x16a2a4[_0xa6f7('0x8a')]);loggerPredictive['info'](_0xa6f7('0x8b'),_0x16a2a4[_0xa6f7('0x74')]);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x89'),_0x16a2a4[_0xa6f7('0x8a')]);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x83'));_[_0xa6f7('0x8c')](_0xb049d7,_0x16a2a4);};}function getDiff(_0x444177){var _0x186956=moment()[_0xa6f7('0x47')](0x0);var _0x5719fb=moment(_0x444177)[_0xa6f7('0x47')](0x0);return _0x186956['diff'](_0x5719fb,_0xa6f7('0x49'));}function ifInterval(_0x47a2b1,_0x3a5522){if(_[_0xa6f7('0x3a')](_0x3a5522)){return![];}return getDiff(_0x3a5522)<_0x47a2b1*0x3c;}function freeVariablesPredictive(_0x5a158f){if(isNotNull(_0x5a158f)){if(!_[_0xa6f7('0x3a')](_0x5a158f[_0xa6f7('0x29')])){_0x5a158f[_0xa6f7('0x29')]=undefined;loggerPredictive['info'](_0x5a158f[_0xa6f7('0x3c')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xa6f7('0x3a')](_0x5a158f[_0xa6f7('0x28')])){_0x5a158f['startPredictive']=undefined;loggerPredictive[_0xa6f7('0x7a')](_0x5a158f['name'],_0xa6f7('0x8d'));}if(!_['isUndefined'](_0x5a158f[_0xa6f7('0x8e')])){clearInterval(_0x5a158f[_0xa6f7('0x8e')]);_0x5a158f[_0xa6f7('0x8e')]=undefined;loggerPredictive[_0xa6f7('0x7a')](_0x5a158f[_0xa6f7('0x3c')],_0xa6f7('0x8f'));}}}function erlangb(_0xfded94,_0x2ebb08){if(_0x2ebb08===0x0){return 0x0;}var _0x153635=0x1;for(var _0x16ef40=0x1;_0x16ef40<=_0x2ebb08;_0x16ef40+=0x1){_0x153635=0x1+_0x153635*_0x16ef40/_0xfded94;}return 0x1/_0x153635;}function isVoiceQueueOutbound(_0x110ea5){return _0x110ea5===_0xa6f7('0x4c');}function isNotPreview(_0x4b0434){return _0x4b0434!==_0xa6f7('0x1e');}function isCampaignIvr(_0x3c0c6e){return _0x3c0c6e===_0xa6f7('0x90');}function getCallerId(_0x466bb6,_0x154c78,_0x3a464e){if(!_[_0xa6f7('0x3a')](_0x3a464e)&&typeof _0x3a464e===_0xa6f7('0x91')&&!_['isEmpty'](_0x3a464e)){if(!_[_0xa6f7('0x3a')](_0x154c78)&&typeof _0x154c78===_0xa6f7('0x91')&&!_[_0xa6f7('0x43')](_0x154c78)){return util['format'](_0xa6f7('0x92'),_0x154c78,_0x3a464e);}return util[_0xa6f7('0x77')](_0xa6f7('0x92'),_0x3a464e,_0x3a464e);}if(!_[_0xa6f7('0x3a')](_0x466bb6)&&typeof _0x466bb6===_0xa6f7('0x91')&&!_[_0xa6f7('0x43')](_0x466bb6)){return _0x466bb6;}return _0xa6f7('0x93');}function loggerCatchQueueSummary(_0x1f69e4,_0x4c1af7){return function(_0x55d245){freeVariablesPredictive(_0x4c1af7);emitVoiceQueueSummary(_0x4c1af7);emitCampaignSummary(_0x4c1af7);loggerSyncQueueSummary[_0xa6f7('0x94')](_0x1f69e4,util[_0xa6f7('0x95')](_0x55d245,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5e6d94,_0x3aa759){return function(_0x18ff29){loggerPredictive[_0xa6f7('0x94')](_0x3aa759['name'],_0x5e6d94);loggerPredictive[_0xa6f7('0x94')](_0x18ff29['stack']);freeVariablesPredictive(_0x3aa759);};}function loggerCatch(_0x4f156e){return function(_0x59ed13){logger['error'](_0x4f156e,util['inspect'](_0x59ed13,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x39ba3d){return _0x39ba3d&&!_[_0xa6f7('0x3a')](_0x39ba3d)&&_0x39ba3d[_0xa6f7('0x96')]>0x0;}function decremetOriginate(_0x5f00a7){if(!_[_0xa6f7('0x3a')](_0x5f00a7)&&_0x5f00a7!==null){if(typeof _0x5f00a7[_0xa6f7('0x97')]!==_0xa6f7('0x98')){if(_0x5f00a7[_0xa6f7('0x97')]>0x0){_0x5f00a7[_0xa6f7('0x97')]-=0x1;}else{logger[_0xa6f7('0x94')](_0xa6f7('0x99'));}}}else{logger[_0xa6f7('0x94')](_0xa6f7('0x9a'));}}function checkContactLowerLimitOriginate(_0x2a73ae,_0x55ad6b,_0x1103ff){if(_0x55ad6b>_0x1103ff){for(var _0x2d23cf=0x0;_0x2d23cf<_0x55ad6b-_0x1103ff;_0x2d23cf+=0x1){decremetOriginate(_0x2a73ae);}}}function loggerGetContactDialer(_0x2ba30f,_0x380b79,_0x1637d3){return function(_0x39e8a8){checkContactLowerLimitOriginate(_0x380b79,_0x1637d3,0x0);logger[_0xa6f7('0x94')](_0x2ba30f,util[_0xa6f7('0x95')](_0x39e8a8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x14133e){return function(_0x26435d){if(isNotNull(_0x26435d)&&isNotNull(_0x26435d[0x0])){if(_0x26435d[0x0][_0xa6f7('0x9b')]>0x0){_0x14133e['message']='RESCHEDULED_CONTACTS';logger[_0xa6f7('0x7a')](_0xa6f7('0x9c')+_0x14133e[_0xa6f7('0x3c')],_0x26435d[0x0]['contactsRescheduled'],_0xa6f7('0x9d'));}else{_0x14133e[_0xa6f7('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xa6f7('0x7a')](_0xa6f7('0x9e')+_0x14133e['name']);}}};}function notSendMessagesQueue(_0x52dcd9){if(_0x52dcd9[_0xa6f7('0x9f')]){freeVariablesPredictive(_0x52dcd9);if(_0x52dcd9['originated']===0x0&&_0x52dcd9[_0xa6f7('0xa0')]===0x0&&_0x52dcd9[_0xa6f7('0x57')]===0x0&&(_0x52dcd9['pTalking']||0x0)===0x0){_0x52dcd9['sendMessageOneNotActive']=![];_0x52dcd9[_0xa6f7('0xa1')]=0x0;_0x52dcd9[_0xa6f7('0x3b')]=_0xa6f7('0xa2');loggerSyncQueueSummary['error'](_0xa6f7('0xa3'),_0x52dcd9[_0xa6f7('0x3c')],_0xa6f7('0xa4'));}else{_0x52dcd9[_0xa6f7('0x3b')]=_0xa6f7('0xa5');loggerSyncQueueSummary[_0xa6f7('0x94')](_0xa6f7('0xa3'),_0x52dcd9[_0xa6f7('0x3c')],_0xa6f7('0xa6'));}emitVoiceQueueSummary(_0x52dcd9);}}function notSendMessagesCampaign(_0x1f4f19){if(_0x1f4f19[_0xa6f7('0x9f')]){if(_0x1f4f19['originated']===0x0){_0x1f4f19[_0xa6f7('0x9f')]=![];_0x1f4f19[_0xa6f7('0x3b')]=_0xa6f7('0xa2');loggerSyncQueueSummary[_0xa6f7('0x94')](_0xa6f7('0xa7'),_0x1f4f19[_0xa6f7('0x3c')],'is\x20not\x20active');}else{_0x1f4f19[_0xa6f7('0x3b')]=_0xa6f7('0xa5');loggerSyncQueueSummary[_0xa6f7('0x94')](_0xa6f7('0xa7'),_0x1f4f19[_0xa6f7('0x3c')],_0xa6f7('0xa6'));}emitCampaignSummary(_0x1f4f19);}}function createObjHistory(_0x54c4e6,_0x5d5894,_0x7ff027,_0x373ae3,_0x3ae028){_0x54c4e6[_0xa6f7('0x3b')]=_0x7ff027;var _0x12d120=new Action(_0x54c4e6,_0x5d5894);var _0x4b4009=new History(_0x12d120);_0x4b4009[_0xa6f7('0xa8')]=_0x373ae3;_0x4b4009['statedesc']=_0x3ae028;_0x4b4009[_0xa6f7('0xa9')]=_0x12d120[_0xa6f7('0xaa')];return _0x4b4009;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x24c1f7=this;setInterval(function(){_0x24c1f7['clearZombieChannels'](_0x24c1f7['uniqueId'],_0xa6f7('0xab'));_0x24c1f7[_0xa6f7('0xac')](_0x24c1f7[_0xa6f7('0x25')],_0xa6f7('0xad'));},0x32c8);};Dialer['prototype'][_0xa6f7('0xac')]=function(_0xd2a739,_0x74eb68){var _0x143a3a=this;for(var _0x21cc6b in _0xd2a739){if(typeof _0xd2a739[_0x21cc6b]!==_0xa6f7('0x98')){this['sequence'][_0xa6f7('0xae')](function(){if(!_['isNil'](_0xd2a739[_0x21cc6b])){return ami['Action']({'action':_0xa6f7('0xaf'),'channel':_0xd2a739[_0x21cc6b][_0xa6f7('0xb0')]})['catch'](function(_0x46a8bd){if(_0x46a8bd[_0xa6f7('0x3b')]===_0xa6f7('0xb1')){setTimeout(function(){if(_0xd2a739[_0x21cc6b]&&_0xd2a739[_0x21cc6b]['type']!==_0xa6f7('0x90')){_0x143a3a['updateOriginated'](_0x143a3a[_0xa6f7('0x1f')][_0xd2a739[_0x21cc6b][_0xa6f7('0xb2')]]);logger['error'](_0xa6f7('0xb3'),_0x74eb68,_0x21cc6b,_0xd2a739[_0x21cc6b]['queue']);delete _0xd2a739[_0x21cc6b];}if(_0xd2a739[_0x21cc6b]&&_0xd2a739[_0x21cc6b][_0xa6f7('0x4b')]===_0xa6f7('0x90')){_0x143a3a['updateOriginated'](_0x143a3a[_0xa6f7('0x20')][_0xd2a739[_0x21cc6b][_0xa6f7('0xb2')]]);logger[_0xa6f7('0x94')](_0xa6f7('0xb4'),_0x74eb68,_0x21cc6b,_0xd2a739[_0x21cc6b][_0xa6f7('0xb2')]);delete _0xd2a739[_0x21cc6b];}},0x2328);}});}});}}};Dialer['prototype'][_0xa6f7('0xb5')]=function(_0x37b898){return BPromise[_0xa6f7('0xb6')]()[_0xa6f7('0xb7')](cmHopper['countReScheduled'](_0x37b898))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xb9')));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xba')]=function(_0x4362d8){return BPromise[_0xa6f7('0xb6')]()[_0xa6f7('0xb7')](cmHopperBlack[_0xa6f7('0xba')](_0x4362d8))['catch'](loggerCatch(_0xa6f7('0xbb')));};Dialer[_0xa6f7('0x1a')]['checkIsBlackListIvr']=function(_0x23c56c){return BPromise['resolve']()[_0xa6f7('0xb7')](cmHopperBlack[_0xa6f7('0xbc')](_0x23c56c))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xbd')));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xbe')]=function(_0x278ac6){return BPromise[_0xa6f7('0xb6')]()['then'](cmHopperHistory['avgHandleTime'](_0x278ac6))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xbf')));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xc0')]=function(_0x5c4e41){return BPromise[_0xa6f7('0xb6')]()[_0xa6f7('0xb7')](cmHopper['rescheduleContact'](_0x5c4e41))['catch'](loggerCatch(_0xa6f7('0xc1')));};Dialer[_0xa6f7('0x1a')]['unlockContact']=function(_0x57e8f8,_0x461df5,_0x2309e0){return BPromise['resolve']()[_0xa6f7('0xb7')](cmHopper['unlockContact'](_0x57e8f8,_0x461df5,_0x2309e0))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xc2')));};Dialer['prototype'][_0xa6f7('0xc3')]=function(_0x262c5c,_0x4dfaea,_0x1fb9db,_0xf518ad,_0x380412){return BPromise['resolve']()[_0xa6f7('0xb7')](cmHopper[_0xa6f7('0xc3')](_0x262c5c,_0x4dfaea,_0x1fb9db,_0xf518ad))[_0xa6f7('0xb8')](function(_0x333a85){_0x380412['temp']-=_0x1fb9db;_0x380412[_0xa6f7('0xc4')]=_0x380412[_0xa6f7('0xc4')]>0x0?_0x380412[_0xa6f7('0xc4')]:0x0;loggerCatch(_0xa6f7('0xc5'))(_0x333a85);});};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xc6')]=function(_0x29b0be,_0x826172,_0x34ad42,_0x77b874){return BPromise[_0xa6f7('0xb6')]()[_0xa6f7('0xb7')](cmHopper[_0xa6f7('0xc6')](_0x29b0be,_0x826172,_0x34ad42))[_0xa6f7('0xb8')](function(_0x40df2f){_0x77b874[_0xa6f7('0xc4')]-=_0x826172;_0x77b874[_0xa6f7('0xc4')]=_0x77b874[_0xa6f7('0xc4')]>0x0?_0x77b874[_0xa6f7('0xc4')]:0x0;loggerCatch(_0xa6f7('0xc7'))(_0x40df2f);});};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xc8')]=function(_0x51c125){return BPromise[_0xa6f7('0xb6')]()[_0xa6f7('0xb7')](voiceQueueRt[_0xa6f7('0xc8')](_0x51c125))['catch'](loggerCatch(_0xa6f7('0xc9')));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xca')]=function(_0x41ec8d){return BPromise[_0xa6f7('0xb6')]()['then'](cmHopper[_0xa6f7('0xca')](_0x41ec8d))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xcb')));};Dialer[_0xa6f7('0x1a')]['createHistory']=function(_0x424f4f){return BPromise['resolve']()['then'](cmHopperHistory[_0xa6f7('0xcc')](_0x424f4f))[_0xa6f7('0xb8')](loggerCatch('[createHistory]\x20'));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xcd')]=function(_0x19f7f7){if(!_['isUndefined'](_0x19f7f7)&&_0x19f7f7!==null){if(typeof _0x19f7f7['originated']!==_0xa6f7('0x98')){if(_0x19f7f7['originated']>0x0){_0x19f7f7[_0xa6f7('0x97')]-=0x1;}else{logger[_0xa6f7('0x94')](_0xa6f7('0xce'));}}}else{logger[_0xa6f7('0x94')](_0xa6f7('0xcf'));}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xd0')]=function(_0x33047c,_0x2e89d9){var _0x3a40ff=this;return function(_0x5afef2){_0x3a40ff[_0xa6f7('0xcd')](_0x2e89d9);logger[_0xa6f7('0x94')](_0x33047c,util[_0xa6f7('0x95')](_0x5afef2,{'showHidden':![],'depth':null}));};};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xd1')]=function(_0x4d4d9e,_0x10f80b,_0x850df1){var _0xe5e3c2={'state':0x19,'statedesc':_0xa6f7('0xd2')};this['updateOriginated'](_0x10f80b);this[_0xa6f7('0xd3')](_[_0xa6f7('0x8c')](_0xe5e3c2,_[_0xa6f7('0xd4')](_0x850df1,[_0xa6f7('0xd5'),'ListId',_0xa6f7('0xd6'),_0xa6f7('0xd7'),_0xa6f7('0xd8')])),_0xa6f7('0xd9'),_0xa6f7('0xda'));logger[_0xa6f7('0x94')](_0x4d4d9e);};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xdb')]=function(_0x672fce){return _0x672fce===_0xa6f7('0xdc');};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xdd')]=function(_0x36b646){return!_['isUndefined'](_0x36b646)&&_0x36b646&&!_[_0xa6f7('0x3a')](_0x36b646[_0xa6f7('0x3c')])&&!_[_0xa6f7('0x3a')](_0x36b646[_0xa6f7('0xde')])&&_0x36b646['active']&&(this[_0xa6f7('0x22')][util[_0xa6f7('0x77')](_0xa6f7('0xdf'),_0x36b646[_0xa6f7('0x3c')])]['status']===_0xa6f7('0xe0')||this[_0xa6f7('0x22')][util['format'](_0xa6f7('0xdf'),_0x36b646[_0xa6f7('0x3c')])][_0xa6f7('0xaf')]===_0xa6f7('0xe1'));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xd3')]=function(_0x5506cb,_0x1cf014,_0x5a6e0a){this[_0xa6f7('0xcc')](_0x5506cb)[_0xa6f7('0xb8')](loggerCatch(_0x1cf014));this[_0xa6f7('0xca')](_0x5506cb)['catch'](loggerCatch(_0x5a6e0a));};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x34')]=function(_0x4299f9){var _0x227c68=this['uniqueId'][_0x4299f9['uniqueid']];var _0x3f2aed;if(!_[_0xa6f7('0xe2')](_0x4299f9)&&!_[_0xa6f7('0xe2')](_0x4299f9['variable'])&&!_[_0xa6f7('0xe2')](_0x4299f9['variable']['amdstatus'])&&_0x4299f9['exten']===_0xa6f7('0xe3')&&_0x227c68){if(_0x227c68[_0xa6f7('0x4b')]!==_0xa6f7('0x90')&&this[_0xa6f7('0x1f')][_0x227c68['queue']][_0xa6f7('0xe4')]&&_0x4299f9[_0xa6f7('0xe5')]==='HANGUP'){delete this[_0xa6f7('0x27')][_0x4299f9[_0xa6f7('0xe6')]];this[_0xa6f7('0xcd')](this[_0xa6f7('0x1f')][_0x227c68[_0xa6f7('0xb2')]]);this[_0xa6f7('0x1f')][_0x227c68[_0xa6f7('0xb2')]][_0xa6f7('0x5e')]+=0x1;this['voiceQueues'][_0x227c68['queue']][_0xa6f7('0x5d')]+=0x1;_0x3f2aed=new Hangup(_0x227c68,_0x4299f9);_0x3f2aed[_0xa6f7('0xa8')]=0x12;_0x3f2aed[_0xa6f7('0xe7')]=_0xa6f7('0xe8');_0x3f2aed[_0xa6f7('0xe9')]=_0xa6f7('0xea');ami[_0xa6f7('0x4a')](_0xa6f7('0xeb'),ut[_0xa6f7('0xec')](_0x3f2aed,_0xa6f7('0xed')));this[_0xa6f7('0xd3')](_0x3f2aed,_0xa6f7('0xee'),_0xa6f7('0xef'));}if(_0x227c68[_0xa6f7('0x4b')]!=='ivr'&&this[_0xa6f7('0x1f')][_0x227c68['queue']][_0xa6f7('0xe4')]&&_0x4299f9[_0xa6f7('0xe5')]===_0xa6f7('0xf0')){var _0x32e44f=this;return new BPromise(function(_0x235b12,_0x2a4e42){delete _0x32e44f['uniqueId'][_0x4299f9[_0xa6f7('0xe6')]];_0x32e44f[_0xa6f7('0xcd')](_0x32e44f[_0xa6f7('0x1f')][_0x227c68['queue']]);_0x32e44f[_0xa6f7('0x1f')][_0x227c68['queue']][_0xa6f7('0x5e')]+=0x1;_0x32e44f[_0xa6f7('0x1f')][_0x227c68['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x5cdf85=_0x32e44f[_0xa6f7('0x1f')][_0x227c68[_0xa6f7('0xb2')]];var _0x48328d=new Hangup(_0x227c68,_0x4299f9);_0x48328d['state']=0x13;_0x48328d[_0xa6f7('0xe7')]=_0xa6f7('0xf1');_0x48328d['membername']=_0xa6f7('0xea');_0x48328d[_0xa6f7('0xf2')]+=0x1;_0x48328d['countglobal']+=0x1;_0x48328d[_0xa6f7('0xed')]=!![];ami[_0xa6f7('0x4a')](_0xa6f7('0xeb'),ut[_0xa6f7('0xec')](_0x48328d,_0xa6f7('0xed')));_0x32e44f['createHistory'](_0x48328d)[_0xa6f7('0xb8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x48328d[_0xa6f7('0xf3')]+_0x48328d[_0xa6f7('0xf4')]+_0x48328d[_0xa6f7('0xf5')]+_0x48328d['countnosuchnumberretry']+_0x48328d[_0xa6f7('0xf6')]+_0x48328d[_0xa6f7('0xf7')]+_0x48328d[_0xa6f7('0xf2')]+_0x48328d['countagentrejectretry']>=_0x5cdf85[_0xa6f7('0xf8')]){_0x32e44f[_0xa6f7('0xf9')](_0x48328d,_0x235b12,_0x2a4e42,_0xa6f7('0xfa'));}else{if(_0x48328d[_0xa6f7('0xf2')]>=_0x5cdf85['dialMachineMaxRetry']){_0x32e44f['createStateFinal'](_0x48328d,_0x235b12,_0x2a4e42,'reason\x2019\x20machine....');}else{_0x32e44f[_0xa6f7('0xc0')]({'active':![],'countmachineretry':_0x48328d[_0xa6f7('0xf2')],'scheduledat':moment()[_0xa6f7('0xfb')](_0x5cdf85['dialMachineRetryFrequency'],_0xa6f7('0xfc'))[_0xa6f7('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x48328d['ContactId'],'ListId':_0x48328d[_0xa6f7('0xfd')],'VoiceQueueId':_0x48328d['VoiceQueueId']||undefined,'CampaignId':_0x48328d['CampaignId']||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xfe')));_0x235b12({'reschedule':0x1});}}});}if(_0x227c68[_0xa6f7('0x4b')]===_0xa6f7('0x90')&&this['campaigns'][_0x227c68[_0xa6f7('0xb2')]][_0xa6f7('0xe4')]&&_0x4299f9[_0xa6f7('0xe5')]===_0xa6f7('0xff')){delete this['uniqueId'][_0x4299f9['uniqueid']];this[_0xa6f7('0xcd')](this['campaigns'][_0x227c68[_0xa6f7('0xb2')]]);_0x3f2aed=new Hangup(_0x227c68,_0x4299f9);_0x3f2aed[_0xa6f7('0xa8')]=0x12;_0x3f2aed[_0xa6f7('0xe7')]='HangupInAMD';_0x3f2aed['membername']='AMD';ami[_0xa6f7('0x4a')](_0xa6f7('0xeb'),ut['buildObj'](_0x3f2aed,'amd'));this['saveInDb'](_0x3f2aed,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x227c68[_0xa6f7('0x4b')]===_0xa6f7('0x90')&&this[_0xa6f7('0x20')][_0x227c68[_0xa6f7('0xb2')]][_0xa6f7('0xe4')]&&_0x4299f9[_0xa6f7('0xe5')]===_0xa6f7('0xf0')){var _0x32e44f=this;return new BPromise(function(_0x5d80fb,_0x551d82){delete _0x32e44f[_0xa6f7('0x27')][_0x4299f9[_0xa6f7('0xe6')]];_0x32e44f[_0xa6f7('0xcd')](_0x32e44f[_0xa6f7('0x20')][_0x227c68[_0xa6f7('0xb2')]]);_0x32e44f[_0xa6f7('0x20')][_0x227c68[_0xa6f7('0xb2')]][_0xa6f7('0x5e')]+=0x1;_0x32e44f[_0xa6f7('0x20')][_0x227c68[_0xa6f7('0xb2')]][_0xa6f7('0x5d')]+=0x1;var _0x111b46=_0x32e44f[_0xa6f7('0x20')][_0x227c68[_0xa6f7('0xb2')]];var _0x4c685d=new Hangup(_0x227c68,_0x4299f9);_0x4c685d['state']=0x13;_0x4c685d[_0xa6f7('0xe7')]='Machine';_0x4c685d[_0xa6f7('0xe9')]=_0xa6f7('0xea');_0x4c685d[_0xa6f7('0xf2')]+=0x1;_0x4c685d[_0xa6f7('0x100')]+=0x1;_0x4c685d[_0xa6f7('0xed')]=!![];ami['emit'](_0xa6f7('0xeb'),ut[_0xa6f7('0xec')](_0x4c685d,'amd'));_0x32e44f[_0xa6f7('0xcc')](_0x4c685d)[_0xa6f7('0xb8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4c685d[_0xa6f7('0xf3')]+_0x4c685d[_0xa6f7('0xf4')]+_0x4c685d[_0xa6f7('0xf5')]+_0x4c685d[_0xa6f7('0x101')]+_0x4c685d['countdropretry']+_0x4c685d[_0xa6f7('0xf7')]+_0x4c685d[_0xa6f7('0xf2')]+_0x4c685d[_0xa6f7('0x102')]>=_0x111b46[_0xa6f7('0xf8')]){_0x32e44f['stateGlobal'](_0x4c685d,_0x5d80fb,_0x551d82,_0xa6f7('0xfa'));}else{if(_0x4c685d[_0xa6f7('0xf2')]>=_0x111b46[_0xa6f7('0x103')]){_0x32e44f[_0xa6f7('0x104')](_0x4c685d,_0x5d80fb,_0x551d82,_0xa6f7('0x105'));}else{_0x32e44f[_0xa6f7('0xc0')]({'active':![],'countmachineretry':_0x4c685d['countmachineretry'],'scheduledat':moment()['add'](_0x111b46[_0xa6f7('0x106')],'minutes')['format'](_0xa6f7('0x107')),'ContactId':_0x4c685d['ContactId'],'ListId':_0x4c685d['ListId'],'VoiceQueueId':_0x4c685d[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x4c685d[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0xfe')));_0x5d80fb({'reschedule':0x1});}}});}}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x31')]=function(_0x2642e5){var _0x207261=this[_0xa6f7('0x27')][_0x2642e5[_0xa6f7('0xe6')]];var _0x29f0fa=this;var _0x53201c;if(_0x207261&&_0x207261[_0xa6f7('0x4b')]===_0xa6f7('0x90')){delete this[_0xa6f7('0x27')][_0x2642e5[_0xa6f7('0xe6')]];this['updateOriginated'](this[_0xa6f7('0x20')][_0x207261['queue']]);this['campaigns'][_0x207261['queue']][_0xa6f7('0x108')]+=0x1;_0x53201c=new Hangup(_0x207261,_0x2642e5);this['createHistory'](_0x53201c)[_0xa6f7('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x53201c)['catch'](loggerCatch(_0xa6f7('0x109')));}if(_0x207261&&_0x207261[_0xa6f7('0x4b')]!==_0xa6f7('0x90')&&isNotNull(this['voiceQueues'][_0x207261[_0xa6f7('0xb2')]][_0xa6f7('0x10a')])){delete this[_0xa6f7('0x27')][_0x2642e5[_0xa6f7('0xe6')]];this['updateOriginated'](this['voiceQueues'][_0x207261[_0xa6f7('0xb2')]]);this[_0xa6f7('0x1f')][_0x207261['queue']][_0xa6f7('0x5e')]+=0x1;this[_0xa6f7('0x1f')][_0x207261['queue']][_0xa6f7('0x5d')]+=0x1;_0x53201c=new Hangup(_0x207261,_0x2642e5);_0x53201c['state']=0x10;_0x53201c[_0xa6f7('0xe7')]=_0xa6f7('0x10b');_0x53201c[_0xa6f7('0xe9')]='AGI';this[_0xa6f7('0xcc')](_0x53201c)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x10c')));this[_0xa6f7('0xca')](_0x53201c)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x109')));}if(_0x207261&&_0x207261[_0xa6f7('0x4b')]!==_0xa6f7('0x90')&&!isNotNull(this[_0xa6f7('0x1f')][_0x207261[_0xa6f7('0xb2')]][_0xa6f7('0x10a')])){delete this['uniqueId'][_0x2642e5[_0xa6f7('0xe6')]];this[_0xa6f7('0xcd')](this[_0xa6f7('0x1f')][_0x207261['queue']]);this['voiceQueues'][_0x207261[_0xa6f7('0xb2')]][_0xa6f7('0x68')]+=0x1;_0x53201c=new Hangup(_0x207261,_0x2642e5);_0x53201c[_0xa6f7('0xa8')]=0xc;_0x53201c[_0xa6f7('0xe7')]=_0x2642e5[_0xa6f7('0x10d')];_0x53201c[_0xa6f7('0xe9')]=_0xa6f7('0x10e');this[_0xa6f7('0xcc')](_0x53201c)[_0xa6f7('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xa6f7('0xca')](_0x53201c)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x109')));}};Dialer[_0xa6f7('0x1a')]['syncAgentComplete']=function(_0x41817e){var _0x2ebe7a=this[_0xa6f7('0x27')][_0x41817e['uniqueid']];var _0x3a1d95=this;if(this['voiceQueues'][_0x41817e[_0xa6f7('0xb2')]]){if(_0x2ebe7a&&_0x2ebe7a[_0xa6f7('0x4b')]!=='ivr'){delete this['uniqueId'][_0x41817e[_0xa6f7('0xe6')]];this[_0xa6f7('0x1f')][_0x41817e[_0xa6f7('0xb2')]][_0xa6f7('0x5e')]+=0x1;var _0x4f7015=new AgentComplete(_0x2ebe7a,_0x41817e);if(_0x41817e[_0xa6f7('0x10f')]===_0xa6f7('0x110')){_0x4f7015[_0xa6f7('0x111')]=this[_0xa6f7('0x1f')][_0x41817e['queue']]['dialQueueProject2']&&this[_0xa6f7('0x1f')][_0x41817e[_0xa6f7('0xb2')]]['dialAgiAfterHangupAgent']?moment()[_0xa6f7('0x77')](_0xa6f7('0x107')):undefined;}this[_0xa6f7('0xcc')](_0x4f7015)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x112')));this[_0xa6f7('0xca')](_0x4f7015)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x113')));}}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x2b')]=function(_0x42b6b3){if(this['voiceQueues'][_0x42b6b3[_0xa6f7('0xb2')]]){if(this[_0xa6f7('0x27')][_0x42b6b3[_0xa6f7('0xe6')]]&&this[_0xa6f7('0x27')][_0x42b6b3[_0xa6f7('0xe6')]][_0xa6f7('0x4b')]!==_0xa6f7('0x90')){this[_0xa6f7('0xcd')](this[_0xa6f7('0x1f')][_0x42b6b3[_0xa6f7('0xb2')]]);this[_0xa6f7('0x27')][_0x42b6b3['uniqueid']][_0xa6f7('0x114')]=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));}}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x115')]=function(_0x531859){this['createHistory'](_0x531859)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x112')));this[_0xa6f7('0xca')](_0x531859)['catch'](loggerCatch(_0xa6f7('0x116')));};Dialer[_0xa6f7('0x1a')]['syncQueueCallerAbandon']=function(_0x307f12){var _0x709f73=this[_0xa6f7('0x27')][_0x307f12[_0xa6f7('0xe6')]];var _0x4ed272=this;if(this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]]){if(_0x709f73&&_0x709f73['type']!=='ivr'){delete this[_0xa6f7('0x27')][_0x307f12[_0xa6f7('0xe6')]];this['updateOriginated'](this['voiceQueues'][_0x307f12[_0xa6f7('0xb2')]]);_0x709f73[_0xa6f7('0x117')]=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));var _0x21b1a9=new QueueCallerAbandon(_0x709f73,_0x307f12);if(getSeconds(_0x709f73[_0xa6f7('0x117')],_0x709f73[_0xa6f7('0x118')])>=_0x709f73[_0xa6f7('0x119')]){this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x7f')]+=0x1;this[_0xa6f7('0x1f')][_0x307f12['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xa6f7('0x1f')][_0x307f12['queue']][_0xa6f7('0x6c')]+=0x1;_0x21b1a9[_0xa6f7('0xa8')]=0xa;_0x21b1a9[_0xa6f7('0xe7')]=_0xa6f7('0x11a');_0x21b1a9[_0xa6f7('0x11b')]=_0xa6f7('0x11c');_0x21b1a9[_0xa6f7('0x111')]=this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]]['dialQueueProject2']?moment()[_0xa6f7('0x77')](_0xa6f7('0x107')):undefined;_0x21b1a9[_0xa6f7('0xf6')]+=0x1;_0x21b1a9[_0xa6f7('0x100')]+=0x1;if(_0x21b1a9[_0xa6f7('0xf6')]>=this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x11d')]){this['queueCallerAbandonCreateState'](_0x21b1a9);}else{this[_0xa6f7('0xc0')]({'active':![],'countdropretry':_0x21b1a9[_0xa6f7('0xf6')],'scheduledat':moment()[_0xa6f7('0xfb')](this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]]['dialDropRetryFrequency'],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x709f73[_0xa6f7('0xd5')],'ListId':_0x709f73[_0xa6f7('0xfd')],'VoiceQueueId':_0x709f73[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x709f73[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch('[rescheduleContact][Drop]'));var _0x2248dd=new History(_0x21b1a9);_0x2248dd[_0xa6f7('0xa8')]=0xa;_0x2248dd[_0xa6f7('0xe7')]=_0xa6f7('0x11a');_0x2248dd[_0xa6f7('0xaa')]=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));_0x2248dd[_0xa6f7('0xa9')]=_0x2248dd['starttime'];_0x2248dd['calleridname']=_0x21b1a9['calleridname'];_0x2248dd['calleridnum']=_0x21b1a9[_0xa6f7('0x11e')];this['createHistory'](_0x2248dd)[_0xa6f7('0xb8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x6b')]+=0x1;this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x63')]+=0x1;_0x21b1a9[_0xa6f7('0xa8')]=0xb;_0x21b1a9['statedesc']=_0xa6f7('0x11f');_0x21b1a9[_0xa6f7('0x11b')]=_0xa6f7('0x120');_0x21b1a9[_0xa6f7('0xf7')]+=0x1;_0x21b1a9[_0xa6f7('0x100')]+=0x1;if(_0x21b1a9[_0xa6f7('0xf7')]>=this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x121')]){this[_0xa6f7('0x115')](_0x21b1a9);}else{this[_0xa6f7('0xc0')]({'active':![],'countabandonedretry':_0x21b1a9[_0xa6f7('0xf7')],'scheduledat':moment()['add'](this[_0xa6f7('0x1f')][_0x307f12[_0xa6f7('0xb2')]][_0xa6f7('0x122')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x709f73['ContactId'],'ListId':_0x709f73[_0xa6f7('0xfd')],'VoiceQueueId':_0x709f73[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x709f73[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x123')));var _0x2248dd=new History(_0x21b1a9);_0x2248dd[_0xa6f7('0xa8')]=0xb;_0x2248dd['statedesc']=_0xa6f7('0x11f');_0x2248dd[_0xa6f7('0xaa')]=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));_0x2248dd[_0xa6f7('0xa9')]=_0x2248dd[_0xa6f7('0xaa')];_0x2248dd['calleridname']=_0x21b1a9['calleridname'];_0x2248dd[_0xa6f7('0x11e')]=_0x21b1a9[_0xa6f7('0x11e')];this['createHistory'](_0x2248dd)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x124')));}}}}};Dialer[_0xa6f7('0x1a')]['syncNewExten']=function(_0x594eec){if(this[_0xa6f7('0x25')][_0x594eec[_0xa6f7('0xe6')]]){this[_0xa6f7('0x25')][_0x594eec[_0xa6f7('0xe6')]][_0xa6f7('0xb0')]=_0x594eec['channel'];}if(this[_0xa6f7('0x27')][_0x594eec[_0xa6f7('0xe6')]]){this[_0xa6f7('0x27')][_0x594eec[_0xa6f7('0xe6')]][_0xa6f7('0xb0')]=_0x594eec[_0xa6f7('0xb0')];}};Dialer['prototype'][_0xa6f7('0x35')]=function(_0x50fcb7){if(strategy[this['voiceQueues'][this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]]['queue']]['strategy']]===_0xa6f7('0x126')){if(this[_0xa6f7('0x25')][_0x50fcb7['actionid']]&&_[_0xa6f7('0xe2')](this[_0xa6f7('0x25')][_0x50fcb7['actionid']]['locked'])&&_0x50fcb7[_0xa6f7('0xaf')]==='1'&&_0x50fcb7[_0xa6f7('0x127')]==='0'){if(this['agents'][_0x50fcb7[_0xa6f7('0x128')]]){if(!this[_0xa6f7('0x21')][_0x50fcb7[_0xa6f7('0x128')]][_0xa6f7('0x129')]){this[_0xa6f7('0x21')][_0x50fcb7[_0xa6f7('0x128')]][_0xa6f7('0x129')]=!![];this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]][_0xa6f7('0x129')]=!![];this['actions'][_0x50fcb7['actionid']]['stateinterface']=_0x50fcb7[_0xa6f7('0x128')];}}}}else if((strategy[this[_0xa6f7('0x1f')][this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]][_0xa6f7('0xb2')]][_0xa6f7('0x4d')]]||_0xa6f7('0x19'))===_0xa6f7('0x19')){if(this['actions'][_0x50fcb7[_0xa6f7('0x125')]]){if(this['agents'][_0x50fcb7['stateinterface']]){this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]]['stateinterface']=_0x50fcb7[_0xa6f7('0x128')];if(_[_0xa6f7('0xe2')](this['queueBooked'][this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]][_0xa6f7('0xb2')]])){this[_0xa6f7('0x12a')][this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]][_0xa6f7('0xb2')]]=[];}this[_0xa6f7('0x12a')][this[_0xa6f7('0x25')][_0x50fcb7['actionid']]['queue']][_0xa6f7('0x12b')](_['merge'](_['pick'](this[_0xa6f7('0x25')][_0x50fcb7[_0xa6f7('0x125')]],['idHopper',_0xa6f7('0x128')]),{'status':_0x50fcb7['status'],'paused':_0x50fcb7[_0xa6f7('0x127')]}));}}}};function unlockQueueStatus(_0x1fe164,_0x5de2da){setTimeout(function(){if(_['isUndefined'](_0x1fe164['queueStatusComplete'])){loggerBooked[_0xa6f7('0x94')](_0xa6f7('0x12c'),_0x5de2da);}_0x1fe164[_0xa6f7('0x12d')]=!![];loggerBooked[_0xa6f7('0x7a')](_0xa6f7('0x12e'),_0x5de2da,JSON[_0xa6f7('0x46')](_[_0xa6f7('0xd4')](_0x1fe164,[_0xa6f7('0x3c'),_0xa6f7('0x12d')])));},0x1f3);}Dialer[_0xa6f7('0x1a')][_0xa6f7('0x37')]=function(_0x5e3a06){var _0x522323=this;var _0x160bfd=_0x522323[_0xa6f7('0x1f')][_0x522323[_0xa6f7('0x25')][_0x5e3a06['actionid']]['queue']];if(strategy[this[_0xa6f7('0x1f')][this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]][_0xa6f7('0x4d')]]===_0xa6f7('0x126')){if(this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]]&&this[_0xa6f7('0x25')][_0x5e3a06['actionid']][_0xa6f7('0x128')]){this[_0xa6f7('0x1e')][_0xa6f7('0x12f')](this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0x130')],this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0x128')])[_0xa6f7('0xb8')](function(_0x55bf91){logger[_0xa6f7('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xa6f7('0x95')](_0x55bf91,{'showHidden':![],'depth':null}));})['finally'](function(){_0x522323[_0xa6f7('0xcd')](_0x522323[_0xa6f7('0x1f')][_0x522323['actions'][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]]);_0x522323[_0xa6f7('0x21')][_0x522323[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0x128')]]['locked']=![];delete _0x522323['actions'][_0x5e3a06[_0xa6f7('0x125')]];unlockQueueStatus(_0x160bfd);});}else{this[_0xa6f7('0xcd')](this[_0xa6f7('0x1f')][this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]]);this[_0xa6f7('0xc0')]({'active':![],'ContactId':this[_0xa6f7('0x25')][_0x5e3a06['actionid']][_0xa6f7('0xd5')],'ListId':this['actions'][_0x5e3a06[_0xa6f7('0x125')]]['ListId'],'VoiceQueueId':this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xd7')]||undefined,'CampaignId':this['actions'][_0x5e3a06[_0xa6f7('0x125')]]['CampaignId']||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x131')));delete this[_0xa6f7('0x25')][_0x5e3a06['actionid']];unlockQueueStatus(_0x160bfd);}}else if((strategy[this[_0xa6f7('0x1f')][this['actions'][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]][_0xa6f7('0x4d')]]||_0xa6f7('0x19'))==='rrmemory'){var _0x4b5ff7;if(this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]]&&!_['isEmpty'](this[_0xa6f7('0x12a')][this[_0xa6f7('0x25')][_0x5e3a06['actionid']][_0xa6f7('0xb2')]])){if(this[_0xa6f7('0x132')][_0x522323[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]]['queue']]){this[_0xa6f7('0x132')][_0x522323[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]]['queue']]=this[_0xa6f7('0x132')][this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]]['queue']]?this['queueBookedRR'][this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]]:this[_0xa6f7('0x12a')][this['actions'][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]]?this[_0xa6f7('0x12a')][this[_0xa6f7('0x25')][_0x5e3a06['actionid']][_0xa6f7('0xb2')]][_0xa6f7('0x133')]||0x0:0x0;}this['queueBooked'][this[_0xa6f7('0x25')][_0x5e3a06['actionid']][_0xa6f7('0xb2')]][_0xa6f7('0x133')]=this[_0xa6f7('0x132')][this[_0xa6f7('0x25')][_0x5e3a06[_0xa6f7('0x125')]][_0xa6f7('0xb2')]];for(var _0x4805d2=0x0;_0x4805d2=0x0;})['catch'](myreject(_0xc09f16)));}}else{_0x37057b[_0xa6f7('0x12b')](ami[_0xa6f7('0x14e')]({'action':_0xa6f7('0x149'),'command':util[_0xa6f7('0x77')](_0xa6f7('0x14f'),_0x65ad6a,!_[_0xa6f7('0x3a')](config[_0xa6f7('0x14a')][_0x75a4f4])?_0x75a4f4:'')})[_0xa6f7('0xb7')](function(_0x298b56){return _0x298b56[_0xa6f7('0x14b')]['indexOf'](_0xa6f7('0x14d'))>=0x0;})['catch'](myreject(_0xc09f16)));}BPromise[_0xa6f7('0x150')](_0x37057b)[_0xa6f7('0xb7')](function(_0x2f9531){var _0x3e546e=_[_0xa6f7('0x151')](_0x2f9531);if(_0x3e546e){return _0xb4915a(_0x3e546e);}else{_0x5ac4bb[_0xa6f7('0x3b')]=_0x499ded?_0xa6f7('0x152'):'INTERVAL_IS_OVERTIME';return _0xc09f16(msgResponse('[ifTime][promiseAll]',_0xa6f7('0x145'),_0xa6f7('0x153')+_0x499ded+'\x20'+_0x59c06b+_0xa6f7('0x154')+util[_0xa6f7('0x95')](_0x65ad6a,{'showHidden':![],'depth':null})+_0xa6f7('0x155')+_0x75a4f4));}})['catch'](function(_0x3ec007){return _0xc09f16(msgResponse(_0xa6f7('0x142'),_0xa6f7('0x145'),JSON[_0xa6f7('0x46')](_0x3ec007)));});});};Dialer[_0xa6f7('0x1a')]['checkDialMethod']=function(_0x58e6bc){var _0x168628=this;return function(){switch(_0x58e6bc[_0xa6f7('0x5a')]){case _0xa6f7('0x156'):freeVariablesPredictive(_0x58e6bc);_0x168628[_0xa6f7('0x157')](_0x58e6bc,0x1);break;case _0xa6f7('0x158'):freeVariablesPredictive(_0x58e6bc);_0x168628[_0xa6f7('0x157')](_0x58e6bc,_0x58e6bc[_0xa6f7('0x159')]);break;case'predictive':_0x168628[_0xa6f7('0xb')](_0x58e6bc);break;case _0xa6f7('0xa'):freeVariablesPredictive(_0x58e6bc);_0x168628[_0xa6f7('0x157')](_0x58e6bc,0x1);break;default:freeVariablesPredictive(_0x58e6bc);logger[_0xa6f7('0x94')](_0xa6f7('0x15a'),_0x58e6bc[_0xa6f7('0x3c')],_0xa6f7('0x15b'));}};};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x15c')]=function(_0x3027bb){var _0x3f003e=this;return function(){_0x3f003e['handleIvr'](_0x3027bb);};};Dialer[_0xa6f7('0x1a')]['syncQueueSummary']=function(_0x4a1504){var _0x483526=this;if(isNotPreview(_0x4a1504['dialMethod'])){if(isVoiceQueueOutbound(_0x4a1504[_0xa6f7('0x4b')])&&isActive(_0x4a1504['dialActive'])){_0x4a1504[_0xa6f7('0x9f')]=!![];BPromise['resolve']()[_0xa6f7('0xb7')](checkIsLoggedIn(_0x4a1504,_0x4a1504[_0xa6f7('0x4f')]))['then'](checkIsActive(_0x4a1504,_0x4a1504[_0xa6f7('0x59')]))[_0xa6f7('0xb7')](checkInterval(_0x4a1504))[_0xa6f7('0xb7')](_0x483526[_0xa6f7('0x13d')](_0x4a1504))['then'](_0x483526[_0xa6f7('0x140')](_0x4a1504[_0xa6f7('0x15d')],_0x4a1504[_0xa6f7('0x15e')],_0x4a1504['name'],_0x4a1504))[_0xa6f7('0xb7')](_0x483526[_0xa6f7('0x141')](_0x4a1504['Interval'],_0x4a1504[_0xa6f7('0x15e')],_0x4a1504[_0xa6f7('0x3c')],_0x4a1504))['then'](_0x483526[_0xa6f7('0x15f')](_0x4a1504))[_0xa6f7('0xb8')](loggerCatchQueueSummary(_0xa6f7('0x160'),_0x4a1504));}else{notSendMessagesQueue(_0x4a1504);}}else{freeVariablesPredictive(_0x4a1504);}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x13c')]=function(){var _0x35bc86=this;var _0x3b3ee1;for(var _0x459fb0 in this['campaigns']){if(typeof this[_0xa6f7('0x20')][_0x459fb0]!==_0xa6f7('0x98')){_0x3b3ee1=this[_0xa6f7('0x20')][_0x459fb0];if(isCampaignIvr(_0x3b3ee1[_0xa6f7('0x4b')])&&isActive(_0x3b3ee1[_0xa6f7('0xde')])){_0x3b3ee1[_0xa6f7('0x9f')]=!![];BPromise['resolve']()[_0xa6f7('0xb7')](checkIsActive(_0x3b3ee1,_0x3b3ee1[_0xa6f7('0xde')]))['then'](checkInterval(_0x3b3ee1))['then'](_0x35bc86[_0xa6f7('0x13d')](_0x3b3ee1))['then'](_0x35bc86['checkIfTime'](_0x3b3ee1[_0xa6f7('0x15d')],_0x3b3ee1['dialTimezone'],_0x3b3ee1[_0xa6f7('0x3c')],_0x3b3ee1))[_0xa6f7('0xb7')](_0x35bc86[_0xa6f7('0x141')](_0x3b3ee1['Interval'],_0x3b3ee1['dialTimezone'],_0x3b3ee1[_0xa6f7('0x3c')],_0x3b3ee1))[_0xa6f7('0xb7')](_0x35bc86[_0xa6f7('0x15c')](_0x3b3ee1))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x3b3ee1));}else{notSendMessagesCampaign(_0x3b3ee1);}}}};function getCallerIdRandom(_0x5df639,_0x24e2aa){var _0x36742a;var _0x338305;var _0x4458d1;if(_0x24e2aa<=0x0){_0x24e2aa=0x1;}_0x36742a=new RegExp(_0xa6f7('0x161')+_0x24e2aa+'}$');_0x338305=Math['pow'](0xa,_0x24e2aa-0x1);_0x4458d1=Math[_0xa6f7('0x162')](0xa,_0x24e2aa)-0x1;return util['format']('%s',_[_0xa6f7('0x163')](_0x5df639,_0x36742a,_[_0xa6f7('0x164')](_0x338305,_0x4458d1)));}function extractCalleridName(_0x37e7dc){var _0x4a304e=_0x37e7dc['match'](/"(.*?)"/);return _0x4a304e?_0x4a304e[0x1]:_0x37e7dc;}function extractCalleridNumber(_0x15e5dc){var _0x223fe3=_0x15e5dc['match'](/<(.*?)>/);return _0x223fe3?_0x223fe3[0x1]:_0x15e5dc;}Dialer['prototype'][_0xa6f7('0x165')]=function(_0x36bfcb,_0x48740d){var _0x118c80=this;var _0x3228c6=uuid['v4']();this[_0xa6f7('0x25')][_0x3228c6]=new Action(_0x36bfcb,_0x48740d,_0x3228c6);return new BPromise(function(_0x3f6e98,_0x22fb24){if(_[_0xa6f7('0x3a')](_0x36bfcb)&&typeof _0x36bfcb!==_0xa6f7('0x166')){return _0x22fb24(msgResponse('originate',_0xa6f7('0x145'),'voiceQueue\x20is\x20undefine'));}if(_[_0xa6f7('0x3a')](_0x48740d[_0xa6f7('0x167')]['phone'])||_0x48740d['Contact']['phone']===null){return _0x22fb24(msgResponse(_0xa6f7('0x168'),_0xa6f7('0x145'),'contact\x20is\x20undefine'));}var _0xda2ba9={'XMD-CALLERID':_0x118c80[_0xa6f7('0x25')][_0x3228c6][_0xa6f7('0x169')](),'XMD-AGI':_0x36bfcb[_0xa6f7('0x10a')]?util[_0xa6f7('0x77')](_0xa6f7('0x16a'),ipAgi,_0x36bfcb[_0xa6f7('0x10a')]):_0xa6f7('0x16b'),'XMD-AGIAFTER':_0x36bfcb[_0xa6f7('0x16c')]?util[_0xa6f7('0x77')](_0xa6f7('0x16a'),ipAgi,_0x36bfcb[_0xa6f7('0x16c')]):_0xa6f7('0x16b'),'XMD-QUEUE':_0x36bfcb['type']==='outbound'?util[_0xa6f7('0x77')](_0xa6f7('0x16d'),_0x36bfcb['name'],_0x36bfcb[_0xa6f7('0x16e')]||'',_0x36bfcb[_0xa6f7('0x16f')]?'c':'',_0x36bfcb['dialQueueTimeout']||0x3):_0xa6f7('0x16b'),'XMD-CONTACTID':_0x48740d[_0xa6f7('0xd5')],'XMD-CDRTYPE':_0xa6f7('0x9'),'CALLERID(all)':_0x118c80[_0xa6f7('0x25')][_0x3228c6][_0xa6f7('0x169')](),'XMD-AMD':_0x36bfcb[_0xa6f7('0xe4')]?_0xa6f7('0x170'):_0xa6f7('0x16b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x36bfcb[_0xa6f7('0xe4')]){_0xda2ba9['XMD-AMDINITIALSILENCE']=_0x36bfcb[_0xa6f7('0x171')]||0x9c4;_0xda2ba9['XMD-AMDGREETING']=_0x36bfcb['dialAMDGreeting']||0x5dc;_0xda2ba9[_0xa6f7('0x172')]=_0x36bfcb['dialAMDAfterGreetingSilence']||0x320;_0xda2ba9[_0xa6f7('0x173')]=_0x36bfcb['dialAMDTotalAnalysisTime']||0x1388;_0xda2ba9['XMD-AMDMINWORDLENGTH']=_0x36bfcb[_0xa6f7('0x174')]||0x64;_0xda2ba9[_0xa6f7('0x175')]=_0x36bfcb[_0xa6f7('0x176')]||0x32;_0xda2ba9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x36bfcb[_0xa6f7('0x177')]||0x3;_0xda2ba9[_0xa6f7('0x178')]=_0x36bfcb[_0xa6f7('0x179')]||0x100;_0xda2ba9[_0xa6f7('0x17a')]=_0x36bfcb[_0xa6f7('0x17b')]||0x1388;}if(_0x36bfcb[_0xa6f7('0x4b')]==='outbound'){_0xda2ba9[_0xa6f7('0x17c')]=_0x48740d[_0xa6f7('0xd7')];}else{_0xda2ba9[_0xa6f7('0x17d')]=_0x48740d[_0xa6f7('0xd8')];}for(var _0x3505a5 in _0x48740d['Contact']){if(typeof _0x48740d[_0xa6f7('0x167')][_0x3505a5]!==_0xa6f7('0x98')){if(isNotNull(_0x48740d[_0xa6f7('0x167')][_0x3505a5])&&_0x3505a5!=='id'&&_0x3505a5!==_0xa6f7('0x17e')&&_0x3505a5!==_0xa6f7('0x17f')&&_0x3505a5!==_0xa6f7('0x180')){_0xda2ba9[util[_0xa6f7('0x77')](_0xa6f7('0x181'),_0xa6f7('0x182'),_[_0xa6f7('0x183')](_0x3505a5))]=_0x48740d['Contact'][_0x3505a5];}}}var _0x16881e=_0x118c80[_0xa6f7('0xdd')](_0x36bfcb['Trunk'])?getCallerId(_0x36bfcb[_0xa6f7('0x75')][_0xa6f7('0x76')],_0x36bfcb[_0xa6f7('0x184')],_0x36bfcb[_0xa6f7('0x185')]>0x0?getCallerIdRandom(_0x36bfcb['dialOriginateCallerIdNumber'],_0x36bfcb[_0xa6f7('0x185')]):_0x36bfcb[_0xa6f7('0x186')]):getCallerId(_[_0xa6f7('0xe2')](_0x36bfcb[_0xa6f7('0x187')])?_0x36bfcb[_0xa6f7('0x75')][_0xa6f7('0x76')]:_0x36bfcb[_0xa6f7('0x187')][_0xa6f7('0x76')],_0x36bfcb['dialOriginateCallerIdName'],_0x36bfcb[_0xa6f7('0x185')]>0x0?getCallerIdRandom(_0x36bfcb[_0xa6f7('0x186')],_0x36bfcb[_0xa6f7('0x185')]):_0x36bfcb[_0xa6f7('0x186')]);if(_0x16881e){_0xda2ba9[_0xa6f7('0x188')]=_0x118c80[_0xa6f7('0x25')][_0x3228c6][_0xa6f7('0x189')]=extractCalleridName(_0x16881e);_0xda2ba9[_0xa6f7('0x18a')]=_0x118c80[_0xa6f7('0x25')][_0x3228c6]['originatecalleridnum']=extractCalleridNumber(_0x16881e);}return ami['Action']({'actionid':_0x3228c6,'action':_0xa6f7('0x168'),'channel':_0x118c80[_0xa6f7('0xdd')](_0x36bfcb[_0xa6f7('0x75')])?util[_0xa6f7('0x77')](_0xa6f7('0x18b'),_0x36bfcb[_0xa6f7('0x75')]['name'],isNotNull(_0x36bfcb[_0xa6f7('0x5c')])?_0x36bfcb[_0xa6f7('0x5c')]['trim']()||'':'',_0x36bfcb['dialCutDigit']>0x0?_0x48740d[_0xa6f7('0x167')][_0xa6f7('0x18c')][_0xa6f7('0x18d')](_0x36bfcb[_0xa6f7('0x18e')]):_0x48740d[_0xa6f7('0x167')][_0xa6f7('0x18c')]):util['format'](_0xa6f7('0x18b'),_[_0xa6f7('0xe2')](_0x36bfcb[_0xa6f7('0x187')])?_0x36bfcb[_0xa6f7('0x75')][_0xa6f7('0x3c')]:_0x36bfcb[_0xa6f7('0x187')][_0xa6f7('0x3c')],isNotNull(_0x36bfcb['dialPrefix'])?_0x36bfcb['dialPrefix'][_0xa6f7('0x18f')]()||'':'',_0x36bfcb[_0xa6f7('0x18e')]>0x0?_0x48740d[_0xa6f7('0x167')][_0xa6f7('0x18c')]['substring'](_0x36bfcb[_0xa6f7('0x18e')]):_0x48740d[_0xa6f7('0x167')][_0xa6f7('0x18c')]),'callerid':_0x16881e,'Exten':_0xa6f7('0xe3'),'Context':_0xa6f7('0x190'),'Priority':'1','variable':_0xda2ba9,'timeout':(_0x36bfcb['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3228c6})[_0xa6f7('0xb7')](function(_0x5877e7){return _0x3f6e98(_0x5877e7);})[_0xa6f7('0xb8')](function(_0x347e39){_0x36bfcb['outboundOriginateFailureCallsDay']+=0x1;var _0x1a6d9c=new History(_0x118c80[_0xa6f7('0x25')][_0x3228c6]);logger['error'](util[_0xa6f7('0x77')](_0xa6f7('0x191'),JSON[_0xa6f7('0x46')](_0x347e39)));_0x1a6d9c[_0xa6f7('0xa8')]=0xe;_0x1a6d9c[_0xa6f7('0xe7')]='OriginateError';_0x1a6d9c['starttime']=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));_0x1a6d9c[_0xa6f7('0xa9')]=_0x1a6d9c[_0xa6f7('0xaa')];_0x118c80[_0xa6f7('0xcc')](_0x1a6d9c)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x192')));_0x118c80['moveContactManagedDialer'](_0x1a6d9c)[_0xa6f7('0xb8')](loggerCatch('[originate][error]'))[_0xa6f7('0x1c')](function(){delete _0x118c80['actions'][_0x3228c6];return _0x22fb24(msgResponse('originate',_0xa6f7('0x45'),_0xa6f7('0x193')));});});});};Dialer[_0xa6f7('0x1a')]['syncOriginateResponse']=function(_0x551c24){var _0x2cee1a=this[_0xa6f7('0x25')][_0x551c24[_0xa6f7('0x125')]];if(_0x2cee1a){delete this[_0xa6f7('0x25')][_0x551c24[_0xa6f7('0x125')]];_0x2cee1a[_0xa6f7('0x118')]=moment()[_0xa6f7('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x165beb=_0x2cee1a['type']===_0xa6f7('0x90')?this[_0xa6f7('0x20')][_0x2cee1a['queue']]:this['voiceQueues'][_0x2cee1a[_0xa6f7('0x194')]()];if(!this[_0xa6f7('0xdb')](_0x551c24[_0xa6f7('0x195')])){this['updateOriginated'](_0x165beb);return this[_0xa6f7('0x196')](_0x2cee1a,_0x165beb,_0x551c24)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x197')));}this[_0xa6f7('0x27')][_0x551c24['uniqueid']]=_0x2cee1a;}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x198')]=function(_0x468140,_0x1b153d,_0x57171a){var _0x48a29f=new History(_0x1b153d);if(_0x48a29f[_0xa6f7('0xf3')]+_0x48a29f['countcongestionretry']+_0x48a29f[_0xa6f7('0xf5')]+_0x48a29f['countnosuchnumberretry']+_0x48a29f['countdropretry']+_0x48a29f[_0xa6f7('0xf7')]+_0x48a29f[_0xa6f7('0xf2')]+_0x48a29f[_0xa6f7('0x102')]>=_0x57171a[_0xa6f7('0xf8')]-0x1){return!![];}switch(_0x468140){case 0x3:if(_0x48a29f[_0xa6f7('0xf5')]>=_0x57171a[_0xa6f7('0x199')]-0x1){return!![];}this[_0xa6f7('0xc0')]({'active':![],'countnoanswerretry':_0x48a29f[_0xa6f7('0xf5')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a['dialNoAnswerRetryFrequency'],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f['ListId'],'VoiceQueueId':_0x48a29f['VoiceQueueId']||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x19a')));break;case 0x5:if(_0x48a29f['countbusyretry']>=_0x57171a[_0xa6f7('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x48a29f['countbusyretry']+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a[_0xa6f7('0x19c')],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f['ListId'],'VoiceQueueId':_0x48a29f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x19d')));break;case 0x8:if(_0x48a29f['countcongestionretry']>=_0x57171a['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x48a29f[_0xa6f7('0xf4')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a['dialCongestionRetryFrequency'],'minutes')[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f['VoiceQueueId']||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})['catch'](loggerCatch(_0xa6f7('0x19e')));break;case 0x0:if(_0x48a29f['countnosuchnumberretry']>=_0x57171a[_0xa6f7('0x19f')]-0x1){return!![];}else{this[_0xa6f7('0xc0')]({'active':![],'countnosuchnumberretry':_0x48a29f['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a[_0xa6f7('0x1a0')],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f['ContactId'],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1a1')));}break;case 0xa:if(_0x48a29f[_0xa6f7('0xf6')]>=_0x57171a[_0xa6f7('0x11d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x48a29f[_0xa6f7('0xf6')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a[_0xa6f7('0x1a2')],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f['VoiceQueueId']||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})['catch'](loggerCatch(_0xa6f7('0x1a3')));break;case 0xb:if(_0x48a29f[_0xa6f7('0xf7')]>=_0x57171a['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xa6f7('0xc0')]({'active':![],'countabandonedretry':_0x48a29f[_0xa6f7('0xf7')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a['dialAbandonedRetryFrequency'],_0xa6f7('0xfc'))[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x48a29f['CampaignId']||undefined})['catch'](loggerCatch(_0xa6f7('0x123')));break;case 0x13:if(_0x48a29f[_0xa6f7('0xf2')]>=_0x57171a[_0xa6f7('0x103')]-0x1){return!![];}this[_0xa6f7('0xc0')]({'active':![],'countmachineretry':_0x48a29f[_0xa6f7('0xf2')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a[_0xa6f7('0x106')],'minutes')[_0xa6f7('0x77')](_0xa6f7('0x107')),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x48a29f['CampaignId']||undefined})[_0xa6f7('0xb8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x48a29f[_0xa6f7('0x102')]>=_0x57171a[_0xa6f7('0x1a4')]-0x1){return!![];}this[_0xa6f7('0xc0')]({'active':![],'countagentrejectretry':_0x48a29f[_0xa6f7('0x102')]+=0x1,'scheduledat':moment()[_0xa6f7('0xfb')](_0x57171a[_0xa6f7('0x1a5')],_0xa6f7('0xfc'))[_0xa6f7('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x48a29f[_0xa6f7('0xd5')],'ListId':_0x48a29f[_0xa6f7('0xfd')],'VoiceQueueId':_0x48a29f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x48a29f[_0xa6f7('0xd8')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x196')]=function(_0xb8568f,_0x5b6bb7,_0x5adfba){var _0x37cd05=this;var _0x3c1b89=new History(_0xb8568f);return new BPromise(function(_0x45c91b,_0x5b5ac4){if(_[_0xa6f7('0x3a')](_0x5b6bb7)&&typeof _0x5b6bb7!==_0xa6f7('0x166')){return _0x5b5ac4(msgResponse(_0xa6f7('0x1a6'),_0xa6f7('0x145'),_0xa6f7('0x1a7')));}if(_[_0xa6f7('0x3a')](_0x5adfba)&&typeof _0x5adfba!==_0xa6f7('0x166')){return _0x5b5ac4(msgResponse(_0xa6f7('0x1a6'),_0xa6f7('0x145'),_0xa6f7('0x1a8')));}switch(_0x5adfba[_0xa6f7('0x10f')]){case'0':_0x5b6bb7[_0xa6f7('0x65')]+=0x1;_0x3c1b89[_0xa6f7('0xa8')]=0x0;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x1a9');_0x3c1b89[_0xa6f7('0x101')]+=0x1;_0x3c1b89['countglobal']+=0x1;ami[_0xa6f7('0x4a')](_0xa6f7('0x1aa'),ut[_0xa6f7('0xec')](_0xb8568f,'nosuchnumber'));_0x37cd05['createHistory'](_0x3c1b89)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1ab')));if(_0x37cd05['checkRetriveMax'](0x0,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0x101')]>=_0x5b6bb7[_0xa6f7('0x19f')]){_0x37cd05[_0xa6f7('0x104')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1ac'));}else{_0x37cd05[_0xa6f7('0xf9')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1ac'));}}break;case'3':_0x5b6bb7[_0xa6f7('0x1ad')]+=0x1;_0x3c1b89[_0xa6f7('0xa8')]=0x3;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x1ae');_0x3c1b89[_0xa6f7('0xf5')]+=0x1;_0x3c1b89[_0xa6f7('0x100')]+=0x1;ami[_0xa6f7('0x4a')](_0xa6f7('0x1af'),ut[_0xa6f7('0xec')](_0xb8568f,_0xa6f7('0x1b0')));_0x37cd05['createHistory'](_0x3c1b89)['catch'](loggerCatch(_0xa6f7('0x1b1')));if(_0x37cd05['checkRetriveMax'](0x3,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0xf5')]>=_0x5b6bb7['dialNoAnswerMaxRetry']){_0x37cd05[_0xa6f7('0x104')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1b2'));}else{_0x37cd05[_0xa6f7('0xf9')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1b2'));}}break;case'5':_0x5b6bb7[_0xa6f7('0x60')]+=0x1;_0x3c1b89['state']=0x5;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x1b3');_0x3c1b89['countbusyretry']+=0x1;_0x3c1b89[_0xa6f7('0x100')]+=0x1;ami[_0xa6f7('0x4a')](_0xa6f7('0x1b4'),ut[_0xa6f7('0xec')](_0xb8568f,_0xa6f7('0x1b5')));_0x37cd05[_0xa6f7('0xcc')](_0x3c1b89)[_0xa6f7('0xb8')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x37cd05[_0xa6f7('0x198')](0x5,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89['countbusyretry']>=_0x5b6bb7[_0xa6f7('0x19b')]){_0x37cd05[_0xa6f7('0x104')](_0x3c1b89,_0x45c91b,_0x5b5ac4,'reason\x205\x20busy');}else{_0x37cd05['stateGlobal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1b6'));}}break;case'8':_0x5b6bb7[_0xa6f7('0x61')]+=0x1;_0x3c1b89[_0xa6f7('0xa8')]=0x8;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x1b7');_0x3c1b89['countcongestionretry']+=0x1;_0x3c1b89[_0xa6f7('0x100')]+=0x1;ami[_0xa6f7('0x4a')](_0xa6f7('0x1b8'),ut[_0xa6f7('0xec')](_0xb8568f,_0xa6f7('0x1b9')));_0x37cd05[_0xa6f7('0xcc')](_0x3c1b89)['catch'](loggerCatch(_0xa6f7('0x1ba')));if(_0x37cd05[_0xa6f7('0x198')](0x8,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0xf4')]>=_0x5b6bb7['dialCongestionMaxRetry']){_0x37cd05['createStateFinal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1bb'));}else{_0x37cd05[_0xa6f7('0xf9')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1bb'));}}break;case'11':_0x5b6bb7[_0xa6f7('0x1bc')]+=0x1;_0x3c1b89[_0xa6f7('0xa8')]=0xb;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x11f');_0x3c1b89[_0xa6f7('0xf7')]+=0x1;_0x3c1b89['countglobal']+=0x1;_0x37cd05['createHistory'](_0x3c1b89)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x124')));if(_0x37cd05['checkRetriveMax'](0xb,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0xf7')]>=_0x5b6bb7[_0xa6f7('0x121')]){_0x37cd05[_0xa6f7('0x104')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1bd'));}else{_0x37cd05[_0xa6f7('0xf9')](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1bd'));}}break;case'20':_0x5b6bb7[_0xa6f7('0x67')]+=0x1;_0x3c1b89[_0xa6f7('0xa8')]=0x14;_0x3c1b89[_0xa6f7('0xe7')]=_0xa6f7('0x1be');_0x3c1b89[_0xa6f7('0x102')]+=0x1;_0x3c1b89[_0xa6f7('0x100')]+=0x1;ami[_0xa6f7('0x4a')](_0xa6f7('0x1bf'),ut[_0xa6f7('0xec')](_0xb8568f,_0xa6f7('0x1c0')));_0x37cd05[_0xa6f7('0xcc')](_0x3c1b89)[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1c1')));if(_0x37cd05[_0xa6f7('0x198')](0x14,_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0x102')]>=_0x5b6bb7[_0xa6f7('0x1a4')]){_0x37cd05['createStateFinal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1c2'));}else{_0x37cd05['stateGlobal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0xa6f7('0x1c2'));}}break;default:_0x5b6bb7[_0xa6f7('0x68')]+=0x1;_0x3c1b89['state']=0xc;_0x3c1b89['statedesc']=_0x5adfba['reason'];_0x37cd05['createHistory'](_0x3c1b89)['catch'](loggerCatch(_0xa6f7('0x1c3')));if(_0x37cd05[_0xa6f7('0x198')](_0x5adfba[_0xa6f7('0x10f')],_0xb8568f,_0x5b6bb7)){if(_0x3c1b89[_0xa6f7('0xf3')]+_0x3c1b89['countcongestionretry']+_0x3c1b89['countnoanswerretry']+_0x3c1b89[_0xa6f7('0x101')]+_0x3c1b89['countdropretry']+_0x3c1b89['countabandonedretry']+_0x3c1b89['countmachineretry']+_0x3c1b89[_0xa6f7('0x102')]>=_0x5b6bb7[_0xa6f7('0xf8')]){_0x37cd05['stateGlobal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0x5adfba[_0xa6f7('0x10f')]);}else{_0x37cd05['createStateFinal'](_0x3c1b89,_0x45c91b,_0x5b5ac4,_0x5adfba['reason']);}}}});};Dialer[_0xa6f7('0x1a')][_0xa6f7('0xf9')]=function(_0x292821,_0x5e6ebe,_0x29b949,_0x2f220e){var _0x174dee=new Final(_0x292821);_0x174dee[_0xa6f7('0xa8')]=0xf;_0x174dee[_0xa6f7('0xe7')]='Global';this[_0xa6f7('0x104')](_0x174dee,_0x5e6ebe,_0x29b949,_0x2f220e);};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x104')]=function(_0x1f4eb3,_0x5a65fa,_0x4a8982,_0x5752e8){this[_0xa6f7('0xca')](_0x1f4eb3)[_0xa6f7('0xb7')](function(){return _0x5a65fa(msgResponse(_0xa6f7('0x1a6'),_0xa6f7('0xdc'),_0x5752e8));})['catch'](function(){return _0x4a8982(msgResponse(_0xa6f7('0x1c4'),_0xa6f7('0x145'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0xa6f7('0xb')]=function(_0x197eca){var _0x4e8faf=_0x197eca[_0xa6f7('0x1c5')]/0x64;var _0x11b203=_0x197eca[_0xa6f7('0x64')]/(_0x197eca[_0xa6f7('0x64')]+_0x197eca['outboundAnswerCallsDay']);var _0x449a98=Math[_0xa6f7('0x1c6')](_0x197eca[_0xa6f7('0x70')]*(_0x197eca[_0xa6f7('0x1c7')]/0x64));var _0x44c7d7=Math[_0xa6f7('0x1c6')](_0x197eca['predictiveIntervalAvailable']*(_0x197eca['predictiveIntervalMinThreshold']/0x64));var _0x502ce4=_0x197eca[_0xa6f7('0xa1')]+_0x197eca['talking'];var _0x2f6cdc=Math['floor'](_0x197eca[_0xa6f7('0x72')]*_0x197eca[_0xa6f7('0x8a')]*_0x197eca[_0xa6f7('0x6d')]*_0x197eca['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x197eca[_0xa6f7('0x29')])){if(!_[_0xa6f7('0x3a')](_0x197eca[_0xa6f7('0x28')])){_0x197eca[_0xa6f7('0x28')]=undefined;loggerPredictive[_0xa6f7('0x94')](_0xa6f7('0x1c8'),_0xa6f7('0x1c9'));}if(!_['isUndefined'](_0x197eca['handlePredictive'])){loggerPredictive['error'](_0xa6f7('0x1c8'),_0xa6f7('0x1ca'));clearInterval(_0x197eca[_0xa6f7('0x8e')]);_0x197eca[_0xa6f7('0x8e')]=undefined;}_0x197eca['startProgressive']=moment()['format'](_0xa6f7('0x107'));loggerPredictive[_0xa6f7('0x7a')](_0x197eca[_0xa6f7('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x197eca[_0xa6f7('0x29')]);this[_0xa6f7('0x157')](_0x197eca,0x1);}else if(ifInterval(_0x197eca[_0xa6f7('0x1cb')],_0x197eca['startProgressive'])){this[_0xa6f7('0x157')](_0x197eca,0x1);loggerPredictiveCalls[_0xa6f7('0x7a')](_0xa6f7('0x1cc'),_0x197eca['startProgressive'],_0x197eca[_0xa6f7('0x3c')]);_0x197eca[_0xa6f7('0x72')]=0x0;_0x197eca['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4e8faf<_0x11b203&&_0x197eca[_0xa6f7('0x1cd')]===_0xa6f7('0x1ce')){freeVariablesPredictive(_0x197eca);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x1cf'),'Dropped\x20calls\x20day',_0x11b203,'startProgressive',_0x197eca['name']);}else if(_0x2f6cdc<_0x197eca[_0xa6f7('0x6c')]&&_0x197eca[_0xa6f7('0x1cd')]===_0xa6f7('0x1ce')){freeVariablesPredictive(_0x197eca);loggerPredictive[_0xa6f7('0x7a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xa6f7('0x1d0'),_0x2f6cdc,_0xa6f7('0x1d1'),_0x197eca[_0xa6f7('0x6c')],_0xa6f7('0x29'),_0x197eca['name']);}else if(!ifInterval(_0x197eca[_0xa6f7('0x1cb')],_0x197eca['startProgressive'])&&_[_0xa6f7('0x3a')](_0x197eca['startPredictive'])&&!_['isUndefined'](_0x197eca[_0xa6f7('0x29')])){_0x197eca[_0xa6f7('0x28')]=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));loggerPredictive[_0xa6f7('0x7a')](_0x197eca[_0xa6f7('0x3c')],_0xa6f7('0x1d2'),_0x197eca[_0xa6f7('0x28')]);this[_0xa6f7('0xbe')](_0x197eca[_0xa6f7('0x1cb')])[_0xa6f7('0xb7')](this[_0xa6f7('0x1d3')](_0x197eca))['then'](mergeDataErlangB(_0x197eca))[_0xa6f7('0xb7')](this[_0xa6f7('0x1d4')](_0x197eca))[_0xa6f7('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x197eca));}else if(!ifInterval(_0x197eca[_0xa6f7('0x1cb')],_0x197eca['startPredictive'])){_0x197eca[_0xa6f7('0x6c')]=0x0;_0x197eca['startPredictive']=moment()[_0xa6f7('0x77')](_0xa6f7('0x107'));loggerPredictive[_0xa6f7('0x7a')](_0x197eca[_0xa6f7('0x3c')],_0xa6f7('0x1d5'),_0x197eca[_0xa6f7('0x28')]);clearInterval(_0x197eca[_0xa6f7('0x8e')]);_0x197eca['handlePredictive']=undefined;this['averageHandleTime'](_0x197eca[_0xa6f7('0x1cb')])[_0xa6f7('0xb7')](this[_0xa6f7('0x1d3')](_0x197eca))[_0xa6f7('0xb7')](mergeDataErlangB(_0x197eca))[_0xa6f7('0xb7')](this[_0xa6f7('0x1d4')](_0x197eca))[_0xa6f7('0xb8')](loggerCatchPredictive(_0xa6f7('0x1d6'),_0x197eca));}else if(_0x197eca['predictiveIntervalAvailable']&&_0x502ce4<_0x197eca[_0xa6f7('0x70')]-_0x44c7d7){freeVariablesPredictive(_0x197eca);loggerPredictive[_0xa6f7('0x7a')](_0x197eca[_0xa6f7('0x3c')],_0xa6f7('0x1d7'),_0x502ce4,')\x20are\x20less\x20than\x20threshold\x20(',_0x197eca[_0xa6f7('0x70')],'-',_0x44c7d7,'=',_0x197eca['predictiveIntervalAvailable']-_0x44c7d7,')');}else if(_0x197eca[_0xa6f7('0x70')]&&_0x502ce4>_0x197eca['predictiveIntervalAvailable']+_0x449a98){freeVariablesPredictive(_0x197eca);loggerPredictive[_0xa6f7('0x7a')](_0x197eca['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x502ce4,_0xa6f7('0x1d8'),_0x197eca[_0xa6f7('0x70')],'+',_0x449a98,'=',_0x197eca[_0xa6f7('0x70')]+_0x449a98,')');}};Dialer[_0xa6f7('0x1a')]['getDataPredictive']=function(_0x13f7dd){var _0x45e6c0=this;return function(_0x3e7eb7){return new BPromise(function(_0x474a9d,_0x278d22){_['merge'](_0x13f7dd,_0x3e7eb7[0x0]);if(checkGetDataPredictive(_0x3e7eb7[0x0])){var _0x48c001=_0x13f7dd['predictiveIntervalAvailable']=_0x13f7dd[_0xa6f7('0xa0')]+_0x13f7dd['available'];var _0x2a588e=_0x13f7dd['dialPredictiveInterval']*0x3c;var _0x41a8be=_0x3e7eb7[0x0]['predictiveIntervalAvgTalktime']+_0x3e7eb7[0x0][_0xa6f7('0x6a')];var _0x3cd900=(_0x3e7eb7[0x0][_0xa6f7('0x69')]+_0x3e7eb7[0x0][_0xa6f7('0x7f')]+_0x3e7eb7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3e7eb7[0x0][_0xa6f7('0x71')];_0x13f7dd[_0xa6f7('0x6d')]=_0x3cd900>0x0?_0x3cd900:0x1;switch(_0x13f7dd[_0xa6f7('0x1cd')]){case _0xa6f7('0x1ce'):var _0x5ab36a=_0x13f7dd[_0xa6f7('0x1c5')]/0x64;return _0x45e6c0['abandonmentRate'](_0x48c001,_0x2a588e,_0x41a8be,_0x3cd900,_0x5ab36a)[_0xa6f7('0xb7')](function(_0x11d25e){return _0x474a9d(_0x11d25e);});case _0xa6f7('0x1d9'):var _0x1e9732=_0x13f7dd[_0xa6f7('0x1c5')]/0x64;return _0x45e6c0[_0xa6f7('0x1da')](_0x48c001,_0x2a588e,_0x41a8be,_0x3cd900,_0x1e9732)['then'](function(_0x4045d4){return _0x474a9d(_0x4045d4);});default:return _0x278d22(msgResponse(_0xa6f7('0x1db'),_0xa6f7('0x145'),_0xa6f7('0x1dc')));}}else{return _0x278d22(msgResponse(_0xa6f7('0x1db'),'Failure',_0xa6f7('0x1dd')));}});};};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x1de')]=function(_0x26a24d){var _0x220f25=this;return function(_0x1423c4){return new BPromise(function(_0x182df6,_0x402b9f){_[_0xa6f7('0x8c')](_0x26a24d,_0x1423c4[0x0]);if(checkGetDataPredictive(_0x1423c4[0x0])){loggerPredictive[_0xa6f7('0x7a')](JSON['stringify'](_0x1423c4[0x0]));if(_0x26a24d['dialPredictiveOptimization']===_0xa6f7('0x1ce')){return _0x220f25[_0xa6f7('0xc8')](_0x26a24d['id'])['then'](function(_0x4837aa){var _0x315fd5=_0x26a24d['loggedIn']-_0x4837aa[0x0][_0xa6f7('0x1df')];var _0x3bcfe4=_0x26a24d[_0xa6f7('0x1cb')]*0x3c;var _0x14a5fc=_0x1423c4[0x0][_0xa6f7('0x84')]+_0x1423c4[0x0][_0xa6f7('0x6a')];var _0x4f38b7=(_0x1423c4[0x0][_0xa6f7('0x69')]+_0x1423c4[0x0][_0xa6f7('0x7f')]+_0x1423c4[0x0][_0xa6f7('0x6b')])/_0x1423c4[0x0][_0xa6f7('0x71')];var _0x17f815=_0x26a24d['dialPredictiveOptimizationPercentage']/0x64;_0x26a24d[_0xa6f7('0x6f')]=_0x4837aa[0x0][_0xa6f7('0x1df')]||0x0;_0x26a24d[_0xa6f7('0x6d')]=_0x4f38b7>0x0?_0x4f38b7:0x1;return _0x220f25['abandonmentRate'](_0x315fd5,_0x3bcfe4,_0x14a5fc,_0x4f38b7,_0x17f815);})['then'](function(_0x4cdc41){return _0x182df6(_0x4cdc41);})['catch'](function(_0x4664bc){return _0x402b9f(msgResponse('[CatchErlangB]','Failure',JSON[_0xa6f7('0x46')](_0x4664bc)));});}if(_0x26a24d[_0xa6f7('0x1cd')]===_0xa6f7('0x1d9')){return _0x220f25[_0xa6f7('0xc8')](_0x26a24d['id'])[_0xa6f7('0xb7')](function(_0x3e40f9){var _0x3ddefe=_0x26a24d['loggedIn']-_0x3e40f9[0x0]['outboundQueuePauses'];var _0x133eb3=_0x26a24d['dialPredictiveInterval']*0x3c;var _0x8e545e=_0x1423c4[0x0][_0xa6f7('0x84')]+_0x1423c4[0x0][_0xa6f7('0x6a')];var _0x422913=(_0x1423c4[0x0][_0xa6f7('0x69')]+_0x1423c4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1423c4[0x0][_0xa6f7('0x6b')])/_0x1423c4[0x0][_0xa6f7('0x71')];var _0x301eba=_0x26a24d[_0xa6f7('0x1c5')]/0x64;_0x26a24d['predictiveIntervalPauses']=_0x3e40f9[0x0][_0xa6f7('0x1df')]||0x0;_0x26a24d[_0xa6f7('0x6d')]=_0x422913>0x0?_0x422913:0x1;return _0x220f25['busyFactor'](_0x3ddefe,_0x133eb3,_0x8e545e,_0x422913,_0x301eba);})[_0xa6f7('0xb7')](function(_0x240e36){return _0x182df6(_0x240e36);})[_0xa6f7('0xb8')](function(_0xdaf0b){return _0x402b9f(msgResponse('[CatchErlangB]',_0xa6f7('0x145'),JSON['stringify'](_0xdaf0b)));});}}else{return _0x402b9f(msgResponse('[getDataPredictive]','Failure',_0xa6f7('0x1dd')));}});};};Dialer[_0xa6f7('0x1a')]['startMethodPredictive']=function(_0x3a6d7d){var _0x4b5bd8=this;return function(){var _0x53afa6=0x0;var _0x586593=Math[_0xa6f7('0x1e0')](_0x3a6d7d['erlangCallToSecond']*0x3e8);if(_0x586593>0x0){_0x586593=_0x586593<0x64?0x64:_0x586593;loggerPredictive['info'](_0x3a6d7d[_0xa6f7('0x3c')],_0xa6f7('0x1e1'),_0x586593,_0xa6f7('0x47'));_0x3a6d7d[_0xa6f7('0x8e')]=setInterval(function(){_0x4b5bd8['handlePredictive'](_0x3a6d7d);loggerPredictiveCalls[_0xa6f7('0x7a')](_0xa6f7('0x1e2'),_0x53afa6+=0x1);},_0x586593);}else{loggerPredictive[_0xa6f7('0x7a')](_0x3a6d7d[_0xa6f7('0x3c')],_0xa6f7('0x1e3'));}};};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x1e4')]=function(_0x4ea419,_0x5e544f){var _0x3d72e1=this;return function(_0x396dc5){if(_[_0xa6f7('0x43')](_0x396dc5)){if(_[_0xa6f7('0xe2')](_0x5e544f['UserId'])||!_0x5e544f[_0xa6f7('0x1e5')]){if(_0x4ea419[_0xa6f7('0x5a')]===_0xa6f7('0xa')){_0x4ea419['queueStatusComplete']=_[_0xa6f7('0x3a')](_0x4ea419['queueStatusComplete'])?!![]:_0x4ea419['queueStatusComplete'];var _0x2163d0=uuid['v4']();_0x3d72e1['actions'][_0x2163d0]=new Action(_0x4ea419,_0x5e544f,_0x2163d0);loggerBooked[_0xa6f7('0x7a')]('[booked][checkContactBlack]',_0x2163d0,_0xa6f7('0x1e6'),JSON[_0xa6f7('0x46')](_0x4ea419[_0xa6f7('0x12d')]),_0xa6f7('0x1e7'),_0x4ea419['name']);if(_0x4ea419[_0xa6f7('0x12d')]){_0x4ea419['queueStatusComplete']=![];_0x3d72e1[_0xa6f7('0x12a')][_0x3d72e1[_0xa6f7('0x25')][_0x2163d0][_0xa6f7('0xb2')]]=[];ami[_0xa6f7('0x14e')]({'actionid':_0x2163d0,'action':_0xa6f7('0x1e8'),'queue':_0x4ea419[_0xa6f7('0x3c')]})[_0xa6f7('0xb8')](function(){_0x3d72e1[_0xa6f7('0xcd')](_0x4ea419);_0x3d72e1[_0xa6f7('0xc0')]({'active':![],'ContactId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0]['ContactId'],'ListId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0]['ListId'],'VoiceQueueId':_0x3d72e1['actions'][_0x2163d0][_0xa6f7('0xd7')]||undefined,'CampaignId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0][_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1e9')));delete _0x3d72e1[_0xa6f7('0x25')][_0x2163d0];});}else{loggerBooked[_0xa6f7('0x7a')](_0xa6f7('0x1ea'),JSON['stringify'](_0x4ea419[_0xa6f7('0x12d')]),'Queue:\x20',_0x4ea419[_0xa6f7('0x3c')]);_0x3d72e1[_0xa6f7('0xcd')](_0x4ea419);_0x3d72e1['rescheduleContact']({'active':![],'ContactId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0]['ContactId'],'ListId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0][_0xa6f7('0xfd')],'VoiceQueueId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0][_0xa6f7('0xd7')]||undefined,'CampaignId':_0x3d72e1[_0xa6f7('0x25')][_0x2163d0][_0xa6f7('0xd8')]||undefined})[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1e9')));delete _0x3d72e1[_0xa6f7('0x25')][_0x2163d0];}}else{return _0x3d72e1[_0xa6f7('0x165')](_0x4ea419,_0x5e544f);}}else{if(getDiff(_0x5e544f[_0xa6f7('0x1eb')])<_0x4ea419[_0xa6f7('0x1ec')]*0x3c){if(_0x5e544f[_0xa6f7('0x1ed')]&&!_0x5e544f['Agent']['voicePause']){_0x3d72e1[_0xa6f7('0x1e')]['run'](_0x5e544f['id'])[_0xa6f7('0x1c')](function(){_0x3d72e1[_0xa6f7('0xcd')](_0x4ea419);});}else{_0x3d72e1[_0xa6f7('0x1ee')]({'active':![]},_0x5e544f['id'],0x1)[_0xa6f7('0x1c')](function(){_0x3d72e1[_0xa6f7('0xcd')](_0x4ea419);});}}else{_0x4ea419[_0xa6f7('0x1ef')]+=0x1;_0x3d72e1[_0xa6f7('0xcd')](_0x4ea419);if(_0x4ea419['dialRecallInQueue']){_0x3d72e1[_0xa6f7('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e544f[_0xa6f7('0xd5')],'ListId':_0x5e544f[_0xa6f7('0xfd')],'VoiceQueueId':_0x5e544f[_0xa6f7('0xd7')]||undefined,'CampaignId':_0x5e544f[_0xa6f7('0xd8')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3d72e1[_0xa6f7('0xcc')](createObjHistory(_0x4ea419,_0x5e544f,_0xa6f7('0x1f0'),0x17,_0xa6f7('0x1f1')))[_0xa6f7('0xb8')](loggerCatch(_0xa6f7('0x1f2')));}else{_0x3d72e1[_0xa6f7('0xd3')](createObjHistory(_0x4ea419,_0x5e544f,_0xa6f7('0x1f3'),0x16,_0xa6f7('0x1f4')),_0xa6f7('0x1f5'),_0xa6f7('0x1f6'));}}}}else{_0x4ea419[_0xa6f7('0x5f')]+=0x1;_0x3d72e1[_0xa6f7('0xd3')](createObjHistory(_0x4ea419,_0x5e544f,'BLACKLIST',0xd,_0xa6f7('0x1f7')),_0xa6f7('0x1f8'),_0xa6f7('0x1f9'));throw'inBlackList';}};};Dialer['prototype'][_0xa6f7('0x1fa')]=function(_0x4654e6){var _0x5837a7=this;var _0x542f01=_0x4654e6['limitCalls']-_0x4654e6[_0xa6f7('0x97')]-_0x4654e6[_0xa6f7('0xc4')];emitCampaignSummary(_0x4654e6);if(_0x542f01>0x0){if(_0x542f01>this['maxNumberOriginate']){_0x542f01=this['maxNumberOriginate'];}_0x4654e6['temp']+=_0x542f01;this[_0xa6f7('0xc6')](_0x4654e6['id'],_0x542f01,_0x4654e6['dialOrderByScheduledAt'],_0x4654e6)[_0xa6f7('0xb7')](function(_0x595f6a){_0x4654e6[_0xa6f7('0xc4')]-=_0x542f01;_0x4654e6[_0xa6f7('0xc4')]=_0x4654e6[_0xa6f7('0xc4')]>0x0?_0x4654e6[_0xa6f7('0xc4')]:0x0;if(!checkContactEmpty(_0x595f6a)){_0x4654e6['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xa6f7('0x7a')](_0xa6f7('0x1fb')+_0x4654e6[_0xa6f7('0x3c')]);}else{_0x4654e6['originated']+=_0x595f6a[_0xa6f7('0x96')];_0x4654e6[_0xa6f7('0x3b')]=_0xa6f7('0x1fc');for(var _0x1b2920=0x0;_0x1b2920<_0x595f6a['length'];_0x1b2920+=0x1){_0x4654e6['ivrTotalCallsDays']+=0x1;if(_[_0xa6f7('0xe2')](_0x595f6a[_0x1b2920])||_[_0xa6f7('0xe2')](_0x595f6a[_0x1b2920][_0xa6f7('0x167')])||_[_0xa6f7('0xe2')](_0x595f6a[_0x1b2920][_0xa6f7('0x167')][_0xa6f7('0x18c')])){_0x5837a7[_0xa6f7('0xd1')](_0xa6f7('0x1fd'),_0x4654e6,_0x595f6a[_0x1b2920]);}else{_0x5837a7[_0xa6f7('0xbc')](_['pick'](_0x595f6a[_0x1b2920],[_0xa6f7('0xd8'),_0xa6f7('0x1fe')]))['then'](_0x5837a7[_0xa6f7('0x1e4')](_0x4654e6,_0x595f6a[_0x1b2920]))['catch'](_0x5837a7[_0xa6f7('0xd0')](_0xa6f7('0x1ff'),_0x4654e6));}}}})[_0xa6f7('0xb8')](loggerGetContactDialer(_0xa6f7('0x200'),_0x4654e6,_0x542f01));}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x157')]=function(_0x4d4176,_0x3f41bf){var _0x287ed5=this;var _0x177dbb=[];var _0x2fbc72=_0x3f41bf>=0x1?_0x3f41bf:0x1;if(_0x4d4176[_0xa6f7('0x5a')]==='booked'){_0x2fbc72=0x1;}var _0x13034a=Math[_0xa6f7('0x1e0')](_0x4d4176[_0xa6f7('0xa1')]*_0x2fbc72)-_0x4d4176['originated']-_0x4d4176[_0xa6f7('0xc4')];emitVoiceQueueSummary(_0x4d4176);if(_0x4d4176[_0xa6f7('0x201')]>0x0){var _0x1ad53b=_0x4d4176[_0xa6f7('0x201')]-_0x4d4176[_0xa6f7('0x97')]-_0x4d4176[_0xa6f7('0xa0')]-_0x4d4176['temp']-_0x4d4176[_0xa6f7('0x50')];if(_0x13034a>_0x1ad53b){_0x13034a=_0x1ad53b;}}if(_0x13034a>0x0){if(_0x4d4176['dialMethod']==='booked'){_0x13034a=0x1;}if(_0x13034a>this[_0xa6f7('0x23')]){_0x13034a=this[_0xa6f7('0x23')];}_0x4d4176[_0xa6f7('0xc4')]+=_0x13034a;for(var _0x2b3d5a in this['agents']){if(typeof this['agents'][_0x2b3d5a]!=='undefined'){if(this['agents'][_0x2b3d5a][_0xa6f7('0xa8')]===_0xa6f7('0x202')&&this[_0xa6f7('0x21')][_0x2b3d5a][_0xa6f7('0xaf')]===_0xa6f7('0xe0')){_0x177dbb[_0xa6f7('0x12b')](this[_0xa6f7('0x21')][_0x2b3d5a]['id']);}}}this[_0xa6f7('0xc3')](_0x4d4176['id'],_0x177dbb,_0x13034a,_0x4d4176[_0xa6f7('0x203')],_0x4d4176)[_0xa6f7('0xb7')](function(_0x1520e9){_0x4d4176[_0xa6f7('0xc4')]-=_0x13034a;_0x4d4176[_0xa6f7('0xc4')]=_0x4d4176[_0xa6f7('0xc4')]>0x0?_0x4d4176[_0xa6f7('0xc4')]:0x0;if(!checkContactEmpty(_0x1520e9)){_0x287ed5[_0xa6f7('0xb5')](_0x4d4176)[_0xa6f7('0xb7')](sendMessageReschedule(_0x4d4176))['catch'](loggerCatch(_0xa6f7('0xb9')));}else{_0x4d4176['originated']+=_0x1520e9['length'];_0x4d4176[_0xa6f7('0x3b')]=_0x4d4176[_0xa6f7('0x5a')]==='booked'?_0xa6f7('0x170'):'RUNNING';for(var _0x45bd95=0x0;_0x45bd95<_0x1520e9[_0xa6f7('0x96')];_0x45bd95+=0x1){if(_[_0xa6f7('0xe2')](_0x1520e9[_0x45bd95])||_[_0xa6f7('0xe2')](_0x1520e9[_0x45bd95]['Contact'])||_[_0xa6f7('0xe2')](_0x1520e9[_0x45bd95][_0xa6f7('0x167')][_0xa6f7('0x18c')])){_0x287ed5['emptyContact'](_0xa6f7('0x1fd'),_0x4d4176,_0x1520e9[_0x45bd95]);}else{_0x287ed5[_0xa6f7('0xba')](_[_0xa6f7('0xd4')](_0x1520e9[_0x45bd95],['VoiceQueueId',_0xa6f7('0x1fe')]))[_0xa6f7('0xb7')](_0x287ed5[_0xa6f7('0x1e4')](_0x4d4176,_0x1520e9[_0x45bd95]))['catch'](_0x287ed5[_0xa6f7('0xd0')](_0xa6f7('0x1fd'),_0x4d4176));}}}})['catch'](loggerGetContactDialer(_0xa6f7('0x204'),_0x4d4176,_0x13034a));}};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x8e')]=function(_0xcf70fb){if(_0xcf70fb['dialLimitQueue']>0x0){var _0x58147c=_0xcf70fb[_0xa6f7('0x201')]-_0xcf70fb['originated']-_0xcf70fb[_0xa6f7('0xa0')];if(_0x58147c>0x0){this[_0xa6f7('0x205')](_0xcf70fb);}else{loggerPredictiveCalls[_0xa6f7('0x7a')](_0xa6f7('0x206'));}}else{this[_0xa6f7('0x205')](_0xcf70fb);}};Dialer['prototype'][_0xa6f7('0x205')]=function(_0x51b945){var _0x19ae8e=this;var _0x5cb39f=[];_0x51b945[_0xa6f7('0x97')]+=0x1;for(var _0x5ad45d in this[_0xa6f7('0x21')]){if(typeof this['agents'][_0x5ad45d]!==_0xa6f7('0x98')){if(this[_0xa6f7('0x21')][_0x5ad45d][_0xa6f7('0xa8')]===_0xa6f7('0x202')&&this['agents'][_0x5ad45d][_0xa6f7('0xaf')]===_0xa6f7('0xe0')){_0x5cb39f[_0xa6f7('0x12b')](this[_0xa6f7('0x21')][_0x5ad45d]['id']);}}}this[_0xa6f7('0xc3')](_0x51b945['id'],_0x5cb39f,0x1,_0x51b945['dialOrderByScheduledAt'],_0x51b945)[_0xa6f7('0xb7')](function(_0x4d5563){if(!checkContactEmpty(_0x4d5563)){checkContactLowerLimitOriginate(_0x51b945,0x1,0x0);_0x19ae8e[_0xa6f7('0xb5')](_0x51b945)[_0xa6f7('0xb7')](sendMessageReschedule(_0x51b945))['catch'](loggerCatch(_0xa6f7('0xb9')));}else{_0x51b945[_0xa6f7('0x3b')]=_0xa6f7('0x1fc');if(_['isNil'](_0x4d5563[0x0])||_[_0xa6f7('0xe2')](_0x4d5563[0x0]['Contact'])||_[_0xa6f7('0xe2')](_0x4d5563[0x0][_0xa6f7('0x167')][_0xa6f7('0x18c')])){_0x19ae8e[_0xa6f7('0xd1')](_0xa6f7('0x1fd'),_0x51b945,_0x4d5563[0x0]);}else{_0x19ae8e[_0xa6f7('0xba')](_[_0xa6f7('0xd4')](_0x4d5563[0x0],[_0xa6f7('0xd7'),_0xa6f7('0x1fe')]))['then'](_0x19ae8e['checkContactBlack'](_0x51b945,_0x4d5563[0x0]))[_0xa6f7('0xb8')](_0x19ae8e['loggerHandler']('[actionOriginatePredictive]\x20',_0x51b945));}}})['catch'](loggerGetContactDialer(_0xa6f7('0x207'),_0x51b945,0x1));emitVoiceQueueSummary(_0x51b945);};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x208')]=function(_0x1551d7,_0x5ce3e6,_0x5b2bf1,_0x21512f,_0x32be08,_0x38481d){loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x209'));loggerPredictive['info'](_0xa6f7('0x20a'),_0x1551d7);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x20b'),_0x5ce3e6);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x20c'),_0x5b2bf1);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x20d'),_0x21512f);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x20e'),_0x32be08);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x83'));return new BPromise(function(_0xce5eaa,_0x44e7b7){if(_0x1551d7<=0x0||isNaN(_0x1551d7)){return _0x44e7b7(msgResponse(_0xa6f7('0x20f'),_0xa6f7('0x45'),_0xa6f7('0x210')+_0x1551d7));}if(_0x5b2bf1<=0x0||isNaN(_0x5b2bf1)){return _0x44e7b7(msgResponse('[abandonmentRate]',_0xa6f7('0x45'),'Ts\x20=\x20'+_0x5b2bf1));}if(_0x21512f<=0x0||isNaN(_0x21512f)){return _0x44e7b7(msgResponse('[abandonmentRate]',_0xa6f7('0x45'),_0xa6f7('0x211')+_0x21512f));}if(_0x5ce3e6<=0x0||isNaN(_0x5ce3e6)){return _0x44e7b7(msgResponse(_0xa6f7('0x20f'),_0xa6f7('0x45'),_0xa6f7('0x212')+_0x5ce3e6));}if(_0x32be08<=0x0||isNaN(_0x32be08)){return _0x44e7b7(msgResponse(_0xa6f7('0x20f'),_0xa6f7('0x45'),_0xa6f7('0x213')+_0x32be08));}_0x38481d=_0x38481d||0x0;var _0x1ce491=0x1/_0x5b2bf1;var _0x18b571=0x0;var _0x2f4f08=0x0;var _0x43a3d1=0x0;var _0x11fbf8=0x0;for(var _0xdc5e18=0x0;_0x43a3d1<_0x32be08;_0xdc5e18+=0x1){_0x2f4f08=_0xdc5e18/_0x5ce3e6;_0x18b571=(_0x21512f*_0x2f4f08+_0x38481d)/_0x1ce491;_0x43a3d1=erlangb(_0x18b571,_0x1551d7);_0x11fbf8=_0x18b571/_0x1551d7*(0x1-erlangb(_0x18b571,_0x1551d7));}return _0xce5eaa({'erlangCalls':_0xdc5e18,'erlangCallToSecond':_0x5ce3e6/_0xdc5e18,'erlangAbandonmentRate':_0x43a3d1,'erlangBusyFactor':_0x11fbf8});});};Dialer[_0xa6f7('0x1a')][_0xa6f7('0x1da')]=function(_0x247597,_0x170c15,_0x36b15b,_0x57b256,_0x2b8da1,_0x408c29){loggerPredictive[_0xa6f7('0x7a')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x20a'),_0x247597);loggerPredictive[_0xa6f7('0x7a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x170c15);loggerPredictive['info'](_0xa6f7('0x20c'),_0x36b15b);loggerPredictive['info'](_0xa6f7('0x20d'),_0x57b256);loggerPredictive[_0xa6f7('0x7a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2b8da1);loggerPredictive[_0xa6f7('0x7a')](_0xa6f7('0x83'));return new BPromise(function(_0x5539c6,_0x1584e7){if(_0x247597<=0x0||isNaN(_0x247597)){return _0x1584e7(msgResponse(_0xa6f7('0x214'),'Error','m\x20=\x20'+_0x247597));}if(_0x36b15b<=0x0||isNaN(_0x36b15b)){return _0x1584e7(msgResponse('[busyFactor]',_0xa6f7('0x45'),_0xa6f7('0x215')+_0x36b15b));}if(_0x57b256<=0x0||isNaN(_0x57b256)){return _0x1584e7(msgResponse(_0xa6f7('0x214'),_0xa6f7('0x45'),'p\x20=\x20'+_0x57b256));}if(_0x170c15<=0x0||isNaN(_0x170c15)){return _0x1584e7(msgResponse(_0xa6f7('0x214'),_0xa6f7('0x45'),'interval\x20=\x20'+_0x170c15));}if(_0x2b8da1<=0x0||isNaN(_0x2b8da1)){return _0x1584e7(msgResponse(_0xa6f7('0x214'),'Error',_0xa6f7('0x216')+_0x2b8da1));}_0x408c29=_0x408c29||0x0;var _0x4217ab=0x1/_0x36b15b;var _0x4f961a=0x0;var _0x174b65=0x0;var _0x3f8be7=0x0;var _0x5a53a0=0x0;for(var _0x42e234=0x0;_0x5a53a0<_0x2b8da1;_0x42e234+=0x1){_0x174b65=_0x42e234/_0x170c15;_0x4f961a=(_0x57b256*_0x174b65+_0x408c29)/_0x4217ab;_0x3f8be7=erlangb(_0x4f961a,_0x247597);_0x5a53a0=_0x4f961a/_0x247597*(0x1-erlangb(_0x4f961a,_0x247597));}return _0x5539c6({'erlangCalls':_0x42e234,'erlangCallToSecond':_0x170c15/_0x42e234,'erlangAbandonmentRate':_0x3f8be7,'erlangBusyFactor':_0x5a53a0});});};module[_0xa6f7('0x217')]=Dialer; \ No newline at end of file +var _0xc7a7=['[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','clearZombieChannels','uniqueId','[actions]','undefined','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr]','countglobal','stateGlobal','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dropreason','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actions','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','timezones','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','Queue','handleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','dialPredictiveOptimization','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[actionOriginate]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\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]','m\x20=\x20','Ts\x20=\x20','interval\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]','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','optionPredictive','startProgressive','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','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\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','---------------------------','predictiveIntervalAvgTalktime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','originated','contactsRescheduled'];(function(_0x291cd4,_0x44288d){var _0x3bc45c=function(_0x8011cc){while(--_0x8011cc){_0x291cd4['push'](_0x291cd4['shift']());}};_0x3bc45c(++_0x44288d);}(_0xc7a7,0x171));var _0x7c7a=function(_0x2bb74e,_0x1ebb03){_0x2bb74e=_0x2bb74e-0x0;var _0x4f0de2=_0xc7a7[_0x2bb74e];return _0x4f0de2;};'use strict';var util=require(_0x7c7a('0x0'));var _=require(_0x7c7a('0x1'));var BPromise=require(_0x7c7a('0x2'));var uuid=require('uuid');var moment=require(_0x7c7a('0x3'));var rr=require('rr');var md5=require(_0x7c7a('0x4'));var Redis=require('ioredis');var ut=require(_0x7c7a('0x5'));var config=require(_0x7c7a('0x6'));var logger=require(_0x7c7a('0x7'))(_0x7c7a('0x8'));var loggerBooked=require(_0x7c7a('0x7'))(_0x7c7a('0x9'));var loggerPredictive=require(_0x7c7a('0x7'))(_0x7c7a('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x7c7a('0xb'));var loggerSyncQueueSummary=require(_0x7c7a('0x7'))(_0x7c7a('0xc'));var ami=require('../ami');config[_0x7c7a('0xd')]=_[_0x7c7a('0xe')](config[_0x7c7a('0xd')],{'host':_0x7c7a('0xf'),'port':0x18eb});var io=require(_0x7c7a('0x10'))(new Redis(config[_0x7c7a('0xd')]));var cmHopper=require(_0x7c7a('0x11'));var cmHopperHistory=require(_0x7c7a('0x12'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7c7a('0x13'));var Action=require(_0x7c7a('0x14'));var History=require(_0x7c7a('0x15'));var Final=require(_0x7c7a('0x16'));var AgentComplete=require(_0x7c7a('0x17'));var QueueCallerAbandon=require(_0x7c7a('0x18'));var Hangup=require(_0x7c7a('0x19'));var ipAgi=process['env'][_0x7c7a('0x1a')]||_0x7c7a('0x1b');var strategy={'rrmemory':_0x7c7a('0x1c'),'roundrobin':_0x7c7a('0x1d')};var Sequence=function(){};Sequence[_0x7c7a('0x1e')]['enqueue']=function(_0x46676a){this['tail']=this[_0x7c7a('0x1f')]?this[_0x7c7a('0x1f')][_0x7c7a('0x20')](_0x46676a):_0x46676a();};function Dialer(_0x239fd0,_0x28cb4d){this[_0x7c7a('0x21')]=new Sequence();this[_0x7c7a('0x22')]=_0x28cb4d;this[_0x7c7a('0x23')]=_0x239fd0[_0x7c7a('0x23')];this[_0x7c7a('0x24')]=_0x239fd0[_0x7c7a('0x24')];this[_0x7c7a('0x25')]=_0x239fd0['agents'];this[_0x7c7a('0x26')]=_0x239fd0[_0x7c7a('0x26')];this[_0x7c7a('0x27')]=config[_0x7c7a('0x27')]||0x2;this['channels']={};this['actions']={};this[_0x7c7a('0x28')]={};this['uniqueId']={};this[_0x7c7a('0x29')]={};this['startPredictive']={};this[_0x7c7a('0x2a')]={};this['ivrOriginated']={};this[_0x7c7a('0x2b')]={};this[_0x7c7a('0x2c')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x7c7a('0x2d')](this));ami['on'](_0x7c7a('0x2e'),this[_0x7c7a('0x2f')][_0x7c7a('0x2d')](this));ami['on']('originateresponse',this[_0x7c7a('0x30')][_0x7c7a('0x2d')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x7c7a('0x2d')](this));ami['on'](_0x7c7a('0x31'),this[_0x7c7a('0xc')][_0x7c7a('0x2d')](this));ami['on'](_0x7c7a('0x32'),this[_0x7c7a('0x33')][_0x7c7a('0x2d')](this));ami['on'](_0x7c7a('0x34'),this[_0x7c7a('0x35')][_0x7c7a('0x2d')](this));ami['on']('varset',this[_0x7c7a('0x36')]['bind'](this));ami['on'](_0x7c7a('0x37'),this[_0x7c7a('0x38')]['bind'](this));ami['on'](_0x7c7a('0x39'),this[_0x7c7a('0x3a')][_0x7c7a('0x2d')](this));this[_0x7c7a('0x3b')]();this[_0x7c7a('0x3c')]();}function isNotNull(_0x4c2865){return _0x4c2865!==null&&!_[_0x7c7a('0x3d')](_0x4c2865);}function checkIsLoggedIn(_0x4c6c05,_0x2308c6){return function(){if(_0x2308c6<=0x0){_0x4c6c05[_0x7c7a('0x3e')]=_0x7c7a('0x3f');throw _0x4c6c05['name']+_0x7c7a('0x40');}};}function isActive(_0x400f3c){return _0x400f3c;}function checkIsActive(_0x798c4e,_0x1eeb54){return function(){if(!isActive(_0x1eeb54)){_0x798c4e['message']=_0x7c7a('0x41');throw _0x798c4e[_0x7c7a('0x42')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4c0f7d){return function(){if(!isNotNull(_0x4c0f7d[_0x7c7a('0x43')])){_0x4c0f7d[_0x7c7a('0x3e')]=_0x7c7a('0x44');throw _0x4c0f7d['name']+_0x7c7a('0x45');}if(!isNotNull(_0x4c0f7d['Interval'][_0x7c7a('0x46')])){_0x4c0f7d['message']=_0x7c7a('0x44');throw _0x4c0f7d[_0x7c7a('0x42')]+_0x7c7a('0x45');}if(!isNotNull(_[_0x7c7a('0x47')](_0x4c0f7d['Interval'][_0x7c7a('0x46')]))){_0x4c0f7d[_0x7c7a('0x3e')]=_0x7c7a('0x44');throw _0x4c0f7d[_0x7c7a('0x42')]+_0x7c7a('0x45');}};}function msgResponse(_0x3810ba,_0x18ece2,_0x5c30c4){return{'action':_0x3810ba,'response':_0x18ece2,'message':_0x5c30c4,'stack':_0x5c30c4};}function myreject(_0x4e4ea3){return function(_0xbf9075){return _0x4e4ea3(msgResponse('[ifTime][Action]',_0x7c7a('0x48'),JSON[_0x7c7a('0x49')](_0xbf9075)));};}function getSeconds(_0x80e0b3,_0x302ea1){var _0x9ceb64=moment(_0x80e0b3)[_0x7c7a('0x4a')](0x0);var _0x54ab04=moment(_0x302ea1)[_0x7c7a('0x4a')](0x0);return _0x9ceb64['diff'](_0x54ab04,_0x7c7a('0x4b'));}function emit(_0x120776,_0x291203,_0x9f19c0){io['to'](_0x120776)[_0x7c7a('0x4c')](_0x291203,_0x9f19c0);}function emitVoiceQueueSummary(_0x3868e5){if(_0x3868e5[_0x7c7a('0x4d')]===_0x7c7a('0x4e')){var _0x14b13f={'id':_0x3868e5['id'],'name':_0x3868e5['name'],'strategy':_0x3868e5[_0x7c7a('0x4f')],'answered':_0x3868e5[_0x7c7a('0x50')],'available':_0x3868e5[_0x7c7a('0x51')],'loggedIn':_0x3868e5[_0x7c7a('0x52')],'pTalking':_0x3868e5[_0x7c7a('0x53')],'sumBillable':_0x3868e5[_0x7c7a('0x54')],'sumDuration':_0x3868e5[_0x7c7a('0x55')],'sumHoldTime':_0x3868e5[_0x7c7a('0x56')]||0x0,'talking':_0x3868e5[_0x7c7a('0x57')],'total':_0x3868e5[_0x7c7a('0x58')],'type':_0x3868e5[_0x7c7a('0x4d')],'unmanaged':_0x3868e5[_0x7c7a('0x59')],'abandoned':_0x3868e5['abandoned'],'waiting':_0x3868e5[_0x7c7a('0x5a')],'loggedInDb':_0x3868e5[_0x7c7a('0x5b')],'dialActive':_0x3868e5[_0x7c7a('0x5c')],'dialMethod':_0x3868e5[_0x7c7a('0x5d')],'dialOriginateCallerIdName':_0x3868e5['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3868e5['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3868e5[_0x7c7a('0x5e')],'dialPrefix':_0x3868e5[_0x7c7a('0x5f')],'outboundAnswerAgiCallsDay':_0x3868e5[_0x7c7a('0x60')],'outboundAnswerCallsDay':_0x3868e5[_0x7c7a('0x61')],'outboundBlacklistCallsDay':_0x3868e5['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3868e5[_0x7c7a('0x62')],'outboundCongestionCallsDay':_0x3868e5['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3868e5[_0x7c7a('0x63')],'outboundDropCallsDayCallersExit':_0x3868e5['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3868e5[_0x7c7a('0x64')],'outboundNoAnswerCallsDay':_0x3868e5[_0x7c7a('0x65')],'outboundNoSuchCallsDay':_0x3868e5[_0x7c7a('0x66')],'outboundOriginateFailureCallsDay':_0x3868e5[_0x7c7a('0x67')],'outboundReCallsDay':_0x3868e5[_0x7c7a('0x68')],'outboundRejectCallsDay':_0x3868e5[_0x7c7a('0x69')],'outboundUnknownCallsDay':_0x3868e5['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3868e5[_0x7c7a('0x6a')],'predictiveIntervalAvgHoldtime':_0x3868e5[_0x7c7a('0x6b')],'predictiveIntervalAvgTalktime':_0x3868e5['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3868e5['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3868e5['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3868e5[_0x7c7a('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x3868e5[_0x7c7a('0x6d')],'predictiveIntervalHitRate':_0x3868e5[_0x7c7a('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x3868e5[_0x7c7a('0x6f')],'predictiveIntervalPauses':_0x3868e5[_0x7c7a('0x70')],'predictiveIntervalAvailable':_0x3868e5['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3868e5[_0x7c7a('0x71')],'message':_0x3868e5['message'],'originated':_0x3868e5['originated'],'erlangCalls':_0x3868e5[_0x7c7a('0x72')],'erlangCallToSecond':_0x3868e5[_0x7c7a('0x73')],'erlangAbandonmentRate':_0x3868e5['erlangAbandonmentRate'],'erlangBusyFactor':_0x3868e5[_0x7c7a('0x74')],'startPredictive':_0x3868e5['startPredictive'],'startProgressive':_0x3868e5['startProgressive']};if(_0x3868e5[_0x7c7a('0x75')]){_0x14b13f['Trunk']={'id':_0x3868e5[_0x7c7a('0x75')]['id'],'name':_0x3868e5[_0x7c7a('0x75')]['name'],'active':_0x3868e5[_0x7c7a('0x75')][_0x7c7a('0x76')],'callerid':_0x3868e5['Trunk'][_0x7c7a('0x77')]};}if(_0x3868e5[_0x7c7a('0x43')]){_0x14b13f[_0x7c7a('0x43')]={'id':_0x3868e5['Interval']['id'],'name':_0x3868e5[_0x7c7a('0x43')][_0x7c7a('0x42')]};}var _0xacd350=md5(JSON['stringify'](_0x14b13f));if(_0x3868e5[_0x7c7a('0x4')]!==_0xacd350){_0x3868e5[_0x7c7a('0x4')]=_0xacd350;emit(util[_0x7c7a('0x78')](_0x7c7a('0x79'),_0x14b13f[_0x7c7a('0x42')]),_0x7c7a('0x7a'),_0x14b13f);}}}function emitCampaignSummary(_0x4af012){if(_0x4af012[_0x7c7a('0x4d')]===_0x7c7a('0x7b')){emit(util[_0x7c7a('0x78')]('campaign:ivr:%s',_0x4af012['name']),_0x7c7a('0x7c'),_0x4af012);}}function checkGetDataPredictive(_0x4d507b){if(isNotNull(_0x4d507b)&&!_[_0x7c7a('0x47')](_0x4d507b)){loggerPredictive['info'](_0x7c7a('0x7d'));loggerPredictive[_0x7c7a('0x7e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d507b['predictiveIntervalTotalCalls']);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x7f'),_0x4d507b[_0x7c7a('0x6a')]);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x80'),_0x4d507b[_0x7c7a('0x81')]);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x82'),_0x4d507b[_0x7c7a('0x83')]);loggerPredictive[_0x7c7a('0x7e')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d507b[_0x7c7a('0x6b')]);loggerPredictive[_0x7c7a('0x7e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d507b['predictiveIntervalAvgTalktime']);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x84'));if(_0x4d507b['predictiveIntervalTotalCalls']>0x0){if(!_[_0x7c7a('0x3d')](_0x4d507b[_0x7c7a('0x85')])&&_0x4d507b[_0x7c7a('0x85')]>0x0){return!![];}loggerPredictive[_0x7c7a('0x7e')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x4d507b[_0x7c7a('0x6b')])&&_0x4d507b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7c7a('0x7e')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x86'));}}else{loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x87'));}return![];}function mergeDataErlangB(_0x42e70c){return function(_0x217da6){loggerPredictive[_0x7c7a('0x7e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x88'),_0x217da6[_0x7c7a('0x72')]);loggerPredictive['info'](_0x7c7a('0x89'),_0x217da6[_0x7c7a('0x73')]);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x8a'),_0x217da6[_0x7c7a('0x8b')]);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x8c'),_0x217da6[_0x7c7a('0x74')]);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x8a'),_0x217da6['erlangAbandonmentRate']);loggerPredictive['info'](_0x7c7a('0x84'));_['merge'](_0x42e70c,_0x217da6);};}function getDiff(_0x1b1b4c){var _0x1aa50b=moment()['milliseconds'](0x0);var _0x2a46f0=moment(_0x1b1b4c)['milliseconds'](0x0);return _0x1aa50b['diff'](_0x2a46f0,_0x7c7a('0x4b'));}function ifInterval(_0xec4921,_0x49d318){if(_[_0x7c7a('0x3d')](_0x49d318)){return![];}return getDiff(_0x49d318)<_0xec4921*0x3c;}function freeVariablesPredictive(_0x1ffa4d){if(isNotNull(_0x1ffa4d)){if(!_[_0x7c7a('0x3d')](_0x1ffa4d['startProgressive'])){_0x1ffa4d[_0x7c7a('0x2a')]=undefined;loggerPredictive['info'](_0x1ffa4d[_0x7c7a('0x42')],_0x7c7a('0x8d'));}if(!_[_0x7c7a('0x3d')](_0x1ffa4d['startPredictive'])){_0x1ffa4d[_0x7c7a('0x8e')]=undefined;loggerPredictive[_0x7c7a('0x7e')](_0x1ffa4d[_0x7c7a('0x42')],_0x7c7a('0x8f'));}if(!_[_0x7c7a('0x3d')](_0x1ffa4d['handlePredictive'])){clearInterval(_0x1ffa4d[_0x7c7a('0x90')]);_0x1ffa4d['handlePredictive']=undefined;loggerPredictive['info'](_0x1ffa4d[_0x7c7a('0x42')],_0x7c7a('0x91'));}}}function erlangb(_0x323f3b,_0x30e2db){if(_0x30e2db===0x0){return 0x0;}var _0x5b9815=0x1;for(var _0x42de85=0x1;_0x42de85<=_0x30e2db;_0x42de85+=0x1){_0x5b9815=0x1+_0x5b9815*_0x42de85/_0x323f3b;}return 0x1/_0x5b9815;}function isVoiceQueueOutbound(_0x9744c3){return _0x9744c3===_0x7c7a('0x4e');}function isNotPreview(_0x8119f8){return _0x8119f8!==_0x7c7a('0x22');}function isCampaignIvr(_0x28310f){return _0x28310f===_0x7c7a('0x7b');}function getCallerId(_0x208621,_0x3f4927,_0x2300e0){if(!_['isUndefined'](_0x2300e0)&&typeof _0x2300e0===_0x7c7a('0x92')&&!_[_0x7c7a('0x47')](_0x2300e0)){if(!_['isUndefined'](_0x3f4927)&&typeof _0x3f4927==='string'&&!_[_0x7c7a('0x47')](_0x3f4927)){return util[_0x7c7a('0x78')](_0x7c7a('0x93'),_0x3f4927,_0x2300e0);}return util['format'](_0x7c7a('0x93'),_0x2300e0,_0x2300e0);}if(!_[_0x7c7a('0x3d')](_0x208621)&&typeof _0x208621==='string'&&!_['isEmpty'](_0x208621)){return _0x208621;}return _0x7c7a('0x94');}function loggerCatchQueueSummary(_0x1159be,_0x4f7ace){return function(_0x51a55e){freeVariablesPredictive(_0x4f7ace);emitVoiceQueueSummary(_0x4f7ace);emitCampaignSummary(_0x4f7ace);loggerSyncQueueSummary[_0x7c7a('0x95')](_0x1159be,util[_0x7c7a('0x96')](_0x51a55e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xa4c4c9,_0x3b5838){return function(_0x1e6d5f){loggerPredictive[_0x7c7a('0x95')](_0x3b5838[_0x7c7a('0x42')],_0xa4c4c9);loggerPredictive[_0x7c7a('0x95')](_0x1e6d5f['stack']);freeVariablesPredictive(_0x3b5838);};}function loggerCatch(_0x4af547){return function(_0x59e324){logger['error'](_0x4af547,util[_0x7c7a('0x96')](_0x59e324,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xf4bf15){return _0xf4bf15&&!_[_0x7c7a('0x3d')](_0xf4bf15)&&_0xf4bf15[_0x7c7a('0x97')]>0x0;}function decremetOriginate(_0x43d000){if(!_[_0x7c7a('0x3d')](_0x43d000)&&_0x43d000!==null){if(typeof _0x43d000[_0x7c7a('0x98')]!=='undefined'){if(_0x43d000[_0x7c7a('0x98')]>0x0){_0x43d000[_0x7c7a('0x98')]-=0x1;}else{logger[_0x7c7a('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x7c7a('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5ca975,_0x567909,_0x279e01){if(_0x567909>_0x279e01){for(var _0x2e572e=0x0;_0x2e572e<_0x567909-_0x279e01;_0x2e572e+=0x1){decremetOriginate(_0x5ca975);}}}function loggerGetContactDialer(_0x75ec42,_0x5bfeca,_0x217bdd){return function(_0x557b85){checkContactLowerLimitOriginate(_0x5bfeca,_0x217bdd,0x0);logger['error'](_0x75ec42,util[_0x7c7a('0x96')](_0x557b85,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xc77212){return function(_0x128764){if(isNotNull(_0x128764)&&isNotNull(_0x128764[0x0])){if(_0x128764[0x0][_0x7c7a('0x99')]>0x0){_0xc77212[_0x7c7a('0x3e')]='RESCHEDULED_CONTACTS';logger[_0x7c7a('0x7e')](_0x7c7a('0x9a')+_0xc77212[_0x7c7a('0x42')],_0x128764[0x0][_0x7c7a('0x99')],'contacts');}else{_0xc77212[_0x7c7a('0x3e')]=_0x7c7a('0x9b');logger[_0x7c7a('0x7e')]('[getContactDialer2][Empty]'+_0xc77212['name']);}}};}function notSendMessagesQueue(_0x4f2b91){if(_0x4f2b91['sendMessageOneNotActive']){freeVariablesPredictive(_0x4f2b91);if(_0x4f2b91['originated']===0x0&&_0x4f2b91[_0x7c7a('0x57')]===0x0&&_0x4f2b91[_0x7c7a('0x5a')]===0x0&&(_0x4f2b91[_0x7c7a('0x53')]||0x0)===0x0){_0x4f2b91[_0x7c7a('0x9c')]=![];_0x4f2b91[_0x7c7a('0x51')]=0x0;_0x4f2b91[_0x7c7a('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7c7a('0x95')](_0x7c7a('0x9d'),_0x4f2b91['name'],_0x7c7a('0x9e'));}else{_0x4f2b91[_0x7c7a('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x7c7a('0x95')](_0x7c7a('0x9d'),_0x4f2b91[_0x7c7a('0x42')],'is\x20disactive');}emitVoiceQueueSummary(_0x4f2b91);}}function notSendMessagesCampaign(_0x33441f){if(_0x33441f[_0x7c7a('0x9c')]){if(_0x33441f[_0x7c7a('0x98')]===0x0){_0x33441f['sendMessageOneNotActive']=![];_0x33441f[_0x7c7a('0x3e')]=_0x7c7a('0x41');loggerSyncQueueSummary['error'](_0x7c7a('0x9f'),_0x33441f[_0x7c7a('0x42')],'is\x20not\x20active');}else{_0x33441f[_0x7c7a('0x3e')]=_0x7c7a('0xa0');loggerSyncQueueSummary[_0x7c7a('0x95')](_0x7c7a('0x9f'),_0x33441f['name'],_0x7c7a('0xa1'));}emitCampaignSummary(_0x33441f);}}function createObjHistory(_0x34a891,_0x5c6414,_0x3beb4c,_0xf457c8,_0x3e852c){_0x34a891[_0x7c7a('0x3e')]=_0x3beb4c;var _0x3d0c3d=new Action(_0x34a891,_0x5c6414);var _0x228970=new History(_0x3d0c3d);_0x228970[_0x7c7a('0xa2')]=_0xf457c8;_0x228970[_0x7c7a('0xa3')]=_0x3e852c;_0x228970[_0x7c7a('0xa4')]=_0x3d0c3d['starttime'];return _0x228970;}Dialer[_0x7c7a('0x1e')][_0x7c7a('0x3c')]=function(){var _0x105ccd=this;setInterval(function(){_0x105ccd[_0x7c7a('0xa5')](_0x105ccd[_0x7c7a('0xa6')],'[uniqueid]');_0x105ccd[_0x7c7a('0xa5')](_0x105ccd['actions'],_0x7c7a('0xa7'));},0x32c8);};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xa5')]=function(_0x18d092,_0x643c39){var _0x524cd2=this;for(var _0x181193 in _0x18d092){if(typeof _0x18d092[_0x181193]!==_0x7c7a('0xa8')){this['sequence']['enqueue'](function(){if(!_[_0x7c7a('0xa9')](_0x18d092[_0x181193])){return ami[_0x7c7a('0xaa')]({'action':_0x7c7a('0xab'),'channel':_0x18d092[_0x181193][_0x7c7a('0xac')]})[_0x7c7a('0xad')](function(_0x22610a){if(_0x22610a['message']===_0x7c7a('0xae')){setTimeout(function(){if(_0x18d092[_0x181193]&&_0x18d092[_0x181193][_0x7c7a('0x4d')]!=='ivr'){_0x524cd2[_0x7c7a('0xaf')](_0x524cd2[_0x7c7a('0x23')][_0x18d092[_0x181193][_0x7c7a('0xb0')]]);logger[_0x7c7a('0x95')](_0x7c7a('0xb1'),_0x643c39,_0x181193,_0x18d092[_0x181193][_0x7c7a('0xb0')]);delete _0x18d092[_0x181193];}if(_0x18d092[_0x181193]&&_0x18d092[_0x181193][_0x7c7a('0x4d')]===_0x7c7a('0x7b')){_0x524cd2[_0x7c7a('0xaf')](_0x524cd2[_0x7c7a('0x24')][_0x18d092[_0x181193]['queue']]);logger[_0x7c7a('0x95')]('[Dialer][checkChannel][ivr]',_0x643c39,_0x181193,_0x18d092[_0x181193][_0x7c7a('0xb0')]);delete _0x18d092[_0x181193];}},0x2328);}});}});}}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xb2')]=function(_0xc18e5e){return BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](cmHopper[_0x7c7a('0xb2')](_0xc18e5e))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xb5')));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xb6')]=function(_0x2044d1){return BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](cmHopperBlack['checkIsBlackList'](_0x2044d1))['catch'](loggerCatch(_0x7c7a('0xb7')));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xb8')]=function(_0x3b2dd4){return BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](cmHopperBlack['checkIsBlackListIvr'](_0x3b2dd4))['catch'](loggerCatch(_0x7c7a('0xb9')));};Dialer['prototype'][_0x7c7a('0xba')]=function(_0x2a1dbe){return BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](cmHopperHistory[_0x7c7a('0xbb')](_0x2a1dbe))[_0x7c7a('0xad')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x7c7a('0x1e')]['rescheduleContact']=function(_0x178356){return BPromise[_0x7c7a('0xb3')]()['then'](cmHopper[_0x7c7a('0xbc')](_0x178356))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xbd')));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xbe')]=function(_0x270bfd,_0xa5da76,_0x83b57d){return BPromise[_0x7c7a('0xb3')]()['then'](cmHopper[_0x7c7a('0xbe')](_0x270bfd,_0xa5da76,_0x83b57d))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xbf')));};Dialer['prototype']['getContactDialer']=function(_0x56be56,_0x305b78,_0x195ecf,_0x384373,_0x14d427){return BPromise['resolve']()[_0x7c7a('0xb4')](cmHopper[_0x7c7a('0xc0')](_0x56be56,_0x305b78,_0x195ecf,_0x384373))['catch'](function(_0x21ab5c){_0x14d427['temp']-=_0x195ecf;_0x14d427[_0x7c7a('0xc1')]=_0x14d427['temp']>0x0?_0x14d427[_0x7c7a('0xc1')]:0x0;loggerCatch(_0x7c7a('0xc2'))(_0x21ab5c);});};Dialer['prototype']['getContactDialerIvr']=function(_0x2fd695,_0x5165ef,_0x1fad39,_0x17920b){return BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](cmHopper[_0x7c7a('0xc3')](_0x2fd695,_0x5165ef,_0x1fad39))[_0x7c7a('0xad')](function(_0x286acb){_0x17920b[_0x7c7a('0xc1')]-=_0x5165ef;_0x17920b[_0x7c7a('0xc1')]=_0x17920b[_0x7c7a('0xc1')]>0x0?_0x17920b[_0x7c7a('0xc1')]:0x0;loggerCatch(_0x7c7a('0xc4'))(_0x286acb);});};Dialer['prototype'][_0x7c7a('0xc5')]=function(_0x5f06b6){return BPromise['resolve']()[_0x7c7a('0xb4')](voiceQueueRt[_0x7c7a('0xc5')](_0x5f06b6))[_0x7c7a('0xad')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xc6')]=function(_0x3f5dfa){return BPromise[_0x7c7a('0xb3')]()['then'](cmHopper[_0x7c7a('0xc6')](_0x3f5dfa))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xc7')));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xc8')]=function(_0xf747f7){return BPromise[_0x7c7a('0xb3')]()['then'](cmHopperHistory[_0x7c7a('0xc8')](_0xf747f7))['catch'](loggerCatch(_0x7c7a('0xc9')));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xaf')]=function(_0x4c1f81){if(!_[_0x7c7a('0x3d')](_0x4c1f81)&&_0x4c1f81!==null){if(typeof _0x4c1f81[_0x7c7a('0x98')]!==_0x7c7a('0xa8')){if(_0x4c1f81[_0x7c7a('0x98')]>0x0){_0x4c1f81[_0x7c7a('0x98')]-=0x1;}else{logger['error'](_0x7c7a('0xca'));}}}else{logger[_0x7c7a('0x95')](_0x7c7a('0xcb'));}};Dialer['prototype'][_0x7c7a('0xcc')]=function(_0x30abec,_0x2b518c){var _0x154a7b=this;return function(_0x2e37d4){_0x154a7b[_0x7c7a('0xaf')](_0x2b518c);logger[_0x7c7a('0x95')](_0x30abec,util[_0x7c7a('0x96')](_0x2e37d4,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x7c7a('0xcd')]=function(_0x250a72,_0x7ebaad,_0x14ca36){var _0x24f103={'state':0x19,'statedesc':_0x7c7a('0xce')};this[_0x7c7a('0xaf')](_0x7ebaad);this[_0x7c7a('0xcf')](_[_0x7c7a('0xd0')](_0x24f103,_[_0x7c7a('0xd1')](_0x14ca36,[_0x7c7a('0xd2'),_0x7c7a('0xd3'),_0x7c7a('0xd4'),'VoiceQueueId',_0x7c7a('0xd5')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x7c7a('0x95')](_0x250a72);};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xd6')]=function(_0x55fd1a){return _0x55fd1a===_0x7c7a('0xd7');};Dialer['prototype'][_0x7c7a('0xd8')]=function(_0x23324f){return!_[_0x7c7a('0x3d')](_0x23324f)&&_0x23324f&&!_['isUndefined'](_0x23324f['name'])&&!_['isUndefined'](_0x23324f['active'])&&_0x23324f['active']&&(this[_0x7c7a('0x26')][util['format'](_0x7c7a('0xd9'),_0x23324f['name'])][_0x7c7a('0xab')]===_0x7c7a('0xda')||this[_0x7c7a('0x26')][util[_0x7c7a('0x78')](_0x7c7a('0xd9'),_0x23324f[_0x7c7a('0x42')])][_0x7c7a('0xab')]===_0x7c7a('0xdb'));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xcf')]=function(_0x2e6ed6,_0x397bb7,_0x192aa3){this['createHistory'](_0x2e6ed6)[_0x7c7a('0xad')](loggerCatch(_0x397bb7));this[_0x7c7a('0xc6')](_0x2e6ed6)[_0x7c7a('0xad')](loggerCatch(_0x192aa3));};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x36')]=function(_0x48cd19){var _0xd60b15=this[_0x7c7a('0xa6')][_0x48cd19['uniqueid']];var _0x2d30c8;if(!_['isNil'](_0x48cd19)&&!_[_0x7c7a('0xa9')](_0x48cd19[_0x7c7a('0xdc')])&&!_[_0x7c7a('0xa9')](_0x48cd19['variable'][_0x7c7a('0xdd')])&&_0x48cd19['exten']===_0x7c7a('0xde')&&_0xd60b15){if(_0xd60b15['type']!==_0x7c7a('0x7b')&&this[_0x7c7a('0x23')][_0xd60b15['queue']][_0x7c7a('0xdf')]&&_0x48cd19[_0x7c7a('0xe0')]===_0x7c7a('0xe1')){delete this[_0x7c7a('0xa6')][_0x48cd19[_0x7c7a('0xe2')]];this[_0x7c7a('0xaf')](this[_0x7c7a('0x23')][_0xd60b15['queue']]);this['voiceQueues'][_0xd60b15[_0x7c7a('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x7c7a('0x23')][_0xd60b15['queue']][_0x7c7a('0x60')]+=0x1;_0x2d30c8=new Hangup(_0xd60b15,_0x48cd19);_0x2d30c8[_0x7c7a('0xa2')]=0x12;_0x2d30c8[_0x7c7a('0xa3')]='HangupInAMD';_0x2d30c8[_0x7c7a('0xe3')]=_0x7c7a('0xe4');ami[_0x7c7a('0x4c')](_0x7c7a('0xe5'),ut[_0x7c7a('0xe6')](_0x2d30c8,_0x7c7a('0xe7')));this['saveInDb'](_0x2d30c8,'[syncHangupInAMD][createHistory]',_0x7c7a('0xe8'));}if(_0xd60b15[_0x7c7a('0x4d')]!==_0x7c7a('0x7b')&&this[_0x7c7a('0x23')][_0xd60b15[_0x7c7a('0xb0')]]['dialAMDActive']&&_0x48cd19['value']===_0x7c7a('0xe9')){var _0x4d6f14=this;return new BPromise(function(_0x375c87,_0x7af711){delete _0x4d6f14['uniqueId'][_0x48cd19[_0x7c7a('0xe2')]];_0x4d6f14[_0x7c7a('0xaf')](_0x4d6f14[_0x7c7a('0x23')][_0xd60b15[_0x7c7a('0xb0')]]);_0x4d6f14[_0x7c7a('0x23')][_0xd60b15[_0x7c7a('0xb0')]]['outboundAnswerCallsDay']+=0x1;_0x4d6f14[_0x7c7a('0x23')][_0xd60b15[_0x7c7a('0xb0')]][_0x7c7a('0x60')]+=0x1;var _0x25ab76=_0x4d6f14[_0x7c7a('0x23')][_0xd60b15[_0x7c7a('0xb0')]];var _0x198367=new Hangup(_0xd60b15,_0x48cd19);_0x198367[_0x7c7a('0xa2')]=0x13;_0x198367['statedesc']=_0x7c7a('0xea');_0x198367[_0x7c7a('0xe3')]='AMD';_0x198367['countmachineretry']+=0x1;_0x198367['countglobal']+=0x1;_0x198367[_0x7c7a('0xe7')]=!![];ami[_0x7c7a('0x4c')](_0x7c7a('0xe5'),ut[_0x7c7a('0xe6')](_0x198367,'amd'));_0x4d6f14[_0x7c7a('0xc8')](_0x198367)['catch'](loggerCatch(_0x7c7a('0xeb')));if(_0x198367[_0x7c7a('0xec')]+_0x198367[_0x7c7a('0xed')]+_0x198367[_0x7c7a('0xee')]+_0x198367[_0x7c7a('0xef')]+_0x198367[_0x7c7a('0xf0')]+_0x198367[_0x7c7a('0xf1')]+_0x198367[_0x7c7a('0xf2')]+_0x198367[_0x7c7a('0xf3')]>=_0x25ab76[_0x7c7a('0xf4')]){_0x4d6f14['stateGlobal'](_0x198367,_0x375c87,_0x7af711,_0x7c7a('0xf5'));}else{if(_0x198367['countmachineretry']>=_0x25ab76[_0x7c7a('0xf6')]){_0x4d6f14['createStateFinal'](_0x198367,_0x375c87,_0x7af711,_0x7c7a('0xf7'));}else{_0x4d6f14['rescheduleContact']({'active':![],'countmachineretry':_0x198367[_0x7c7a('0xf2')],'scheduledat':moment()[_0x7c7a('0xf8')](_0x25ab76[_0x7c7a('0xf9')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x198367['ContactId'],'ListId':_0x198367['ListId'],'VoiceQueueId':_0x198367[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x198367[_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xfd')));_0x375c87({'reschedule':0x1});}}});}if(_0xd60b15[_0x7c7a('0x4d')]==='ivr'&&this[_0x7c7a('0x24')][_0xd60b15[_0x7c7a('0xb0')]][_0x7c7a('0xdf')]&&_0x48cd19['value']==='HANGUP'){delete this['uniqueId'][_0x48cd19['uniqueid']];this[_0x7c7a('0xaf')](this['campaigns'][_0xd60b15[_0x7c7a('0xb0')]]);_0x2d30c8=new Hangup(_0xd60b15,_0x48cd19);_0x2d30c8[_0x7c7a('0xa2')]=0x12;_0x2d30c8[_0x7c7a('0xa3')]=_0x7c7a('0xfe');_0x2d30c8['membername']=_0x7c7a('0xe4');ami[_0x7c7a('0x4c')](_0x7c7a('0xe5'),ut['buildObj'](_0x2d30c8,_0x7c7a('0xe7')));this[_0x7c7a('0xcf')](_0x2d30c8,'[syncHangupInAMDIvr][createHistory]',_0x7c7a('0xff'));}if(_0xd60b15[_0x7c7a('0x4d')]===_0x7c7a('0x7b')&&this[_0x7c7a('0x24')][_0xd60b15['queue']][_0x7c7a('0xdf')]&&_0x48cd19[_0x7c7a('0xe0')]===_0x7c7a('0xe9')){var _0x4d6f14=this;return new BPromise(function(_0x23757d,_0x7b6b51){delete _0x4d6f14[_0x7c7a('0xa6')][_0x48cd19[_0x7c7a('0xe2')]];_0x4d6f14[_0x7c7a('0xaf')](_0x4d6f14[_0x7c7a('0x24')][_0xd60b15['queue']]);_0x4d6f14[_0x7c7a('0x24')][_0xd60b15[_0x7c7a('0xb0')]][_0x7c7a('0x61')]+=0x1;_0x4d6f14['campaigns'][_0xd60b15[_0x7c7a('0xb0')]][_0x7c7a('0x60')]+=0x1;var _0x36ed98=_0x4d6f14[_0x7c7a('0x24')][_0xd60b15[_0x7c7a('0xb0')]];var _0x3c8d2a=new Hangup(_0xd60b15,_0x48cd19);_0x3c8d2a['state']=0x13;_0x3c8d2a[_0x7c7a('0xa3')]=_0x7c7a('0xea');_0x3c8d2a[_0x7c7a('0xe3')]=_0x7c7a('0xe4');_0x3c8d2a[_0x7c7a('0xf2')]+=0x1;_0x3c8d2a[_0x7c7a('0x100')]+=0x1;_0x3c8d2a[_0x7c7a('0xe7')]=!![];ami[_0x7c7a('0x4c')](_0x7c7a('0xe5'),ut['buildObj'](_0x3c8d2a,_0x7c7a('0xe7')));_0x4d6f14[_0x7c7a('0xc8')](_0x3c8d2a)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xeb')));if(_0x3c8d2a['countbusyretry']+_0x3c8d2a[_0x7c7a('0xed')]+_0x3c8d2a[_0x7c7a('0xee')]+_0x3c8d2a[_0x7c7a('0xef')]+_0x3c8d2a['countdropretry']+_0x3c8d2a['countabandonedretry']+_0x3c8d2a[_0x7c7a('0xf2')]+_0x3c8d2a['countagentrejectretry']>=_0x36ed98[_0x7c7a('0xf4')]){_0x4d6f14[_0x7c7a('0x101')](_0x3c8d2a,_0x23757d,_0x7b6b51,_0x7c7a('0xf5'));}else{if(_0x3c8d2a['countmachineretry']>=_0x36ed98[_0x7c7a('0xf6')]){_0x4d6f14[_0x7c7a('0x102')](_0x3c8d2a,_0x23757d,_0x7b6b51,_0x7c7a('0xf7'));}else{_0x4d6f14[_0x7c7a('0xbc')]({'active':![],'countmachineretry':_0x3c8d2a['countmachineretry'],'scheduledat':moment()[_0x7c7a('0xf8')](_0x36ed98[_0x7c7a('0xf9')],_0x7c7a('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c8d2a['ContactId'],'ListId':_0x3c8d2a['ListId'],'VoiceQueueId':_0x3c8d2a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x3c8d2a['CampaignId']||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xfd')));_0x23757d({'reschedule':0x1});}}});}}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x33')]=function(_0x3a5553){var _0x5ab3aa=this[_0x7c7a('0xa6')][_0x3a5553[_0x7c7a('0xe2')]];var _0x48a049=this;var _0x2eb8af;if(_0x5ab3aa&&_0x5ab3aa[_0x7c7a('0x4d')]===_0x7c7a('0x7b')){delete this[_0x7c7a('0xa6')][_0x3a5553['uniqueid']];this[_0x7c7a('0xaf')](this['campaigns'][_0x5ab3aa['queue']]);this[_0x7c7a('0x24')][_0x5ab3aa[_0x7c7a('0xb0')]][_0x7c7a('0x103')]+=0x1;_0x2eb8af=new Hangup(_0x5ab3aa,_0x3a5553);this[_0x7c7a('0xc8')](_0x2eb8af)[_0x7c7a('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7c7a('0xc6')](_0x2eb8af)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x104')));}if(_0x5ab3aa&&_0x5ab3aa[_0x7c7a('0x4d')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x5ab3aa['queue']]['dialQueueProject'])){delete this[_0x7c7a('0xa6')][_0x3a5553['uniqueid']];this[_0x7c7a('0xaf')](this['voiceQueues'][_0x5ab3aa[_0x7c7a('0xb0')]]);this[_0x7c7a('0x23')][_0x5ab3aa[_0x7c7a('0xb0')]][_0x7c7a('0x61')]+=0x1;this[_0x7c7a('0x23')][_0x5ab3aa[_0x7c7a('0xb0')]][_0x7c7a('0x60')]+=0x1;_0x2eb8af=new Hangup(_0x5ab3aa,_0x3a5553);_0x2eb8af[_0x7c7a('0xa2')]=0x10;_0x2eb8af[_0x7c7a('0xa3')]=_0x7c7a('0x105');_0x2eb8af[_0x7c7a('0xe3')]='AGI';this[_0x7c7a('0xc8')](_0x2eb8af)[_0x7c7a('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7c7a('0xc6')](_0x2eb8af)[_0x7c7a('0xad')](loggerCatch('[syncHangupIvr]'));}if(_0x5ab3aa&&_0x5ab3aa[_0x7c7a('0x4d')]!==_0x7c7a('0x7b')&&!isNotNull(this[_0x7c7a('0x23')][_0x5ab3aa[_0x7c7a('0xb0')]][_0x7c7a('0x106')])){delete this[_0x7c7a('0xa6')][_0x3a5553[_0x7c7a('0xe2')]];this[_0x7c7a('0xaf')](this[_0x7c7a('0x23')][_0x5ab3aa['queue']]);this['voiceQueues'][_0x5ab3aa['queue']][_0x7c7a('0x107')]+=0x1;_0x2eb8af=new Hangup(_0x5ab3aa,_0x3a5553);_0x2eb8af['state']=0xc;_0x2eb8af[_0x7c7a('0xa3')]=_0x3a5553[_0x7c7a('0x108')];_0x2eb8af['membername']='Unknow';this[_0x7c7a('0xc8')](_0x2eb8af)['catch'](loggerCatch(_0x7c7a('0x109')));this[_0x7c7a('0xc6')](_0x2eb8af)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x104')));}};Dialer[_0x7c7a('0x1e')]['syncAgentComplete']=function(_0x494066){var _0xa3c38c=this[_0x7c7a('0xa6')][_0x494066[_0x7c7a('0xe2')]];var _0x2340eb=this;if(this['voiceQueues'][_0x494066[_0x7c7a('0xb0')]]){if(_0xa3c38c&&_0xa3c38c[_0x7c7a('0x4d')]!==_0x7c7a('0x7b')){delete this[_0x7c7a('0xa6')][_0x494066[_0x7c7a('0xe2')]];this[_0x7c7a('0x23')][_0x494066['queue']][_0x7c7a('0x61')]+=0x1;var _0x3fb579=new AgentComplete(_0xa3c38c,_0x494066);if(_0x494066[_0x7c7a('0x10a')]===_0x7c7a('0x10b')){_0x3fb579[_0x7c7a('0x10c')]=this[_0x7c7a('0x23')][_0x494066[_0x7c7a('0xb0')]][_0x7c7a('0x10d')]&&this['voiceQueues'][_0x494066['queue']][_0x7c7a('0x10e')]?moment()[_0x7c7a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x7c7a('0xc8')](_0x3fb579)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7c7a('0xc6')](_0x3fb579)['catch'](loggerCatch(_0x7c7a('0x10f')));}}};Dialer['prototype'][_0x7c7a('0x110')]=function(_0xbdac88){if(this[_0x7c7a('0x23')][_0xbdac88[_0x7c7a('0xb0')]]){if(this[_0x7c7a('0xa6')][_0xbdac88[_0x7c7a('0xe2')]]&&this['uniqueId'][_0xbdac88[_0x7c7a('0xe2')]][_0x7c7a('0x4d')]!==_0x7c7a('0x7b')){this['updateOriginated'](this[_0x7c7a('0x23')][_0xbdac88[_0x7c7a('0xb0')]]);this[_0x7c7a('0xa6')][_0xbdac88[_0x7c7a('0xe2')]][_0x7c7a('0x111')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x112')]=function(_0x27a21f){this[_0x7c7a('0xc8')](_0x27a21f)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x113')));this[_0x7c7a('0xc6')](_0x27a21f)['catch'](loggerCatch(_0x7c7a('0x114')));};Dialer[_0x7c7a('0x1e')]['syncQueueCallerAbandon']=function(_0x11fb04){var _0x14eec2=this[_0x7c7a('0xa6')][_0x11fb04[_0x7c7a('0xe2')]];var _0x46cccc=this;if(this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]]){if(_0x14eec2&&_0x14eec2[_0x7c7a('0x4d')]!==_0x7c7a('0x7b')){delete this[_0x7c7a('0xa6')][_0x11fb04[_0x7c7a('0xe2')]];this[_0x7c7a('0xaf')](this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]]);_0x14eec2[_0x7c7a('0x115')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4d53bc=new QueueCallerAbandon(_0x14eec2,_0x11fb04);if(getSeconds(_0x14eec2[_0x7c7a('0x115')],_0x14eec2[_0x7c7a('0x116')])>=_0x14eec2[_0x7c7a('0x117')]){this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]][_0x7c7a('0x81')]+=0x1;this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]][_0x7c7a('0x64')]+=0x1;this['voiceQueues'][_0x11fb04['queue']][_0x7c7a('0x6d')]+=0x1;_0x4d53bc[_0x7c7a('0xa2')]=0xa;_0x4d53bc[_0x7c7a('0xa3')]=_0x7c7a('0x118');_0x4d53bc['dropreason']=_0x7c7a('0x119');_0x4d53bc['agiafterat']=this[_0x7c7a('0x23')][_0x11fb04['queue']][_0x7c7a('0x10d')]?moment()['format'](_0x7c7a('0xfb')):undefined;_0x4d53bc[_0x7c7a('0xf0')]+=0x1;_0x4d53bc['countglobal']+=0x1;if(_0x4d53bc[_0x7c7a('0xf0')]>=this['voiceQueues'][_0x11fb04['queue']][_0x7c7a('0x11a')]){this[_0x7c7a('0x112')](_0x4d53bc);}else{this[_0x7c7a('0xbc')]({'active':![],'countdropretry':_0x4d53bc['countdropretry'],'scheduledat':moment()[_0x7c7a('0xf8')](this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]]['dialDropRetryFrequency'],_0x7c7a('0xfa'))['format'](_0x7c7a('0xfb')),'ContactId':_0x14eec2[_0x7c7a('0xd2')],'ListId':_0x14eec2[_0x7c7a('0xd3')],'VoiceQueueId':_0x14eec2[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x14eec2['CampaignId']||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x11b')));var _0x31bf70=new History(_0x4d53bc);_0x31bf70[_0x7c7a('0xa2')]=0xa;_0x31bf70['statedesc']=_0x7c7a('0x118');_0x31bf70[_0x7c7a('0x11c')]=moment()[_0x7c7a('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x31bf70[_0x7c7a('0xa4')]=_0x31bf70['starttime'];_0x31bf70[_0x7c7a('0x11d')]=_0x4d53bc[_0x7c7a('0x11d')];_0x31bf70[_0x7c7a('0x11e')]=_0x4d53bc['calleridnum'];this[_0x7c7a('0xc8')](_0x31bf70)['catch'](loggerCatch(_0x7c7a('0x11f')));}}else{this[_0x7c7a('0x23')][_0x11fb04[_0x7c7a('0xb0')]][_0x7c7a('0x83')]+=0x1;this[_0x7c7a('0x23')][_0x11fb04['queue']][_0x7c7a('0x120')]+=0x1;_0x4d53bc[_0x7c7a('0xa2')]=0xb;_0x4d53bc[_0x7c7a('0xa3')]=_0x7c7a('0x121');_0x4d53bc[_0x7c7a('0x122')]='CALLEREXIT';_0x4d53bc[_0x7c7a('0xf1')]+=0x1;_0x4d53bc[_0x7c7a('0x100')]+=0x1;if(_0x4d53bc[_0x7c7a('0xf1')]>=this['voiceQueues'][_0x11fb04[_0x7c7a('0xb0')]]['dialAbandonedMaxRetry']){this[_0x7c7a('0x112')](_0x4d53bc);}else{this[_0x7c7a('0xbc')]({'active':![],'countabandonedretry':_0x4d53bc[_0x7c7a('0xf1')],'scheduledat':moment()['add'](this[_0x7c7a('0x23')][_0x11fb04['queue']][_0x7c7a('0x123')],_0x7c7a('0xfa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14eec2[_0x7c7a('0xd2')],'ListId':_0x14eec2[_0x7c7a('0xd3')],'VoiceQueueId':_0x14eec2[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x14eec2['CampaignId']||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x124')));var _0x31bf70=new History(_0x4d53bc);_0x31bf70[_0x7c7a('0xa2')]=0xb;_0x31bf70[_0x7c7a('0xa3')]=_0x7c7a('0x121');_0x31bf70['starttime']=moment()[_0x7c7a('0x78')](_0x7c7a('0xfb'));_0x31bf70[_0x7c7a('0xa4')]=_0x31bf70[_0x7c7a('0x11c')];_0x31bf70['calleridname']=_0x4d53bc['calleridname'];_0x31bf70[_0x7c7a('0x11e')]=_0x4d53bc['calleridnum'];this[_0x7c7a('0xc8')](_0x31bf70)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x35')]=function(_0x31e0dc){if(this[_0x7c7a('0x125')][_0x31e0dc[_0x7c7a('0xe2')]]){this[_0x7c7a('0x125')][_0x31e0dc[_0x7c7a('0xe2')]][_0x7c7a('0xac')]=_0x31e0dc[_0x7c7a('0xac')];}if(this['uniqueId'][_0x31e0dc[_0x7c7a('0xe2')]]){this[_0x7c7a('0xa6')][_0x31e0dc[_0x7c7a('0xe2')]][_0x7c7a('0xac')]=_0x31e0dc['channel'];}};Dialer['prototype'][_0x7c7a('0x38')]=function(_0x3d57d4){if(strategy[this['voiceQueues'][this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0xb0')]][_0x7c7a('0x4f')]]===_0x7c7a('0x1d')){if(this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]]&&_[_0x7c7a('0xa9')](this['actions'][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0x127')])&&_0x3d57d4['status']==='1'&&_0x3d57d4[_0x7c7a('0x128')]==='0'){if(this[_0x7c7a('0x25')][_0x3d57d4[_0x7c7a('0x129')]]){if(!this[_0x7c7a('0x25')][_0x3d57d4[_0x7c7a('0x129')]][_0x7c7a('0x127')]){this[_0x7c7a('0x25')][_0x3d57d4[_0x7c7a('0x129')]][_0x7c7a('0x127')]=!![];this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0x127')]=!![];this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0x129')]=_0x3d57d4['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0xb0')]][_0x7c7a('0x4f')]]||_0x7c7a('0x1c'))===_0x7c7a('0x1c')){if(this['actions'][_0x3d57d4[_0x7c7a('0x126')]]){if(this['agents'][_0x3d57d4[_0x7c7a('0x129')]]){this[_0x7c7a('0x125')][_0x3d57d4['actionid']][_0x7c7a('0x129')]=_0x3d57d4[_0x7c7a('0x129')];if(_[_0x7c7a('0xa9')](this[_0x7c7a('0x2b')][this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]]['queue']])){this['queueBooked'][this['actions'][_0x3d57d4[_0x7c7a('0x126')]][_0x7c7a('0xb0')]]=[];}this[_0x7c7a('0x2b')][this[_0x7c7a('0x125')][_0x3d57d4[_0x7c7a('0x126')]]['queue']][_0x7c7a('0x12a')](_[_0x7c7a('0xd0')](_[_0x7c7a('0xd1')](this['actions'][_0x3d57d4[_0x7c7a('0x126')]],[_0x7c7a('0x12b'),'stateinterface']),{'status':_0x3d57d4['status'],'paused':_0x3d57d4[_0x7c7a('0x128')]}));}}}};function unlockQueueStatus(_0x22cc60,_0x4a7127){setTimeout(function(){if(_[_0x7c7a('0x3d')](_0x22cc60[_0x7c7a('0x12c')])){loggerBooked[_0x7c7a('0x95')](_0x7c7a('0x12d'),_0x4a7127);}_0x22cc60['queueStatusComplete']=!![];loggerBooked[_0x7c7a('0x7e')](_0x7c7a('0x12e'),_0x4a7127,JSON[_0x7c7a('0x49')](_['pick'](_0x22cc60,['name',_0x7c7a('0x12c')])));},0x1f3);}Dialer['prototype'][_0x7c7a('0x3a')]=function(_0x39f456){var _0x3b31f4=this;var _0x15a80c=_0x3b31f4[_0x7c7a('0x23')][_0x3b31f4[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]];if(strategy[this[_0x7c7a('0x23')][this[_0x7c7a('0x125')][_0x39f456['actionid']]['queue']][_0x7c7a('0x4f')]]===_0x7c7a('0x1d')){if(this['actions'][_0x39f456[_0x7c7a('0x126')]]&&this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0x129')]){this[_0x7c7a('0x22')][_0x7c7a('0x12f')](this[_0x7c7a('0x125')][_0x39f456['actionid']][_0x7c7a('0x12b')],this['actions'][_0x39f456['actionid']]['stateinterface'])[_0x7c7a('0xad')](function(_0x313f46){logger[_0x7c7a('0x95')](_0x7c7a('0x130'),util[_0x7c7a('0x96')](_0x313f46,{'showHidden':![],'depth':null}));})[_0x7c7a('0x20')](function(){_0x3b31f4['updateOriginated'](_0x3b31f4[_0x7c7a('0x23')][_0x3b31f4[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]]['queue']]);_0x3b31f4[_0x7c7a('0x25')][_0x3b31f4[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0x129')]]['locked']=![];delete _0x3b31f4[_0x7c7a('0x125')][_0x39f456['actionid']];unlockQueueStatus(_0x15a80c);});}else{this[_0x7c7a('0xaf')](this[_0x7c7a('0x23')][this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]]);this[_0x7c7a('0xbc')]({'active':![],'ContactId':this['actions'][_0x39f456['actionid']]['ContactId'],'ListId':this['actions'][_0x39f456['actionid']]['ListId'],'VoiceQueueId':this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xfc')]||undefined,'CampaignId':this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]]['CampaignId']||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x131')));delete this['actions'][_0x39f456[_0x7c7a('0x126')]];unlockQueueStatus(_0x15a80c);}}else if((strategy[this[_0x7c7a('0x23')][this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]][_0x7c7a('0x4f')]]||_0x7c7a('0x1c'))===_0x7c7a('0x1c')){var _0x5017a8;if(this['actions'][_0x39f456[_0x7c7a('0x126')]]&&!_[_0x7c7a('0x47')](this[_0x7c7a('0x2b')][this[_0x7c7a('0x125')][_0x39f456['actionid']]['queue']])){if(this[_0x7c7a('0x2c')][_0x3b31f4[_0x7c7a('0x125')][_0x39f456['actionid']][_0x7c7a('0xb0')]]){this[_0x7c7a('0x2c')][_0x3b31f4['actions'][_0x39f456['actionid']][_0x7c7a('0xb0')]]=this['queueBookedRR'][this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]]?this[_0x7c7a('0x2c')][this['actions'][_0x39f456[_0x7c7a('0x126')]]['queue']]:this[_0x7c7a('0x2b')][this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]]?this[_0x7c7a('0x2b')][this[_0x7c7a('0x125')][_0x39f456['actionid']][_0x7c7a('0xb0')]][_0x7c7a('0x132')]||0x0:0x0;}this['queueBooked'][this[_0x7c7a('0x125')][_0x39f456['actionid']][_0x7c7a('0xb0')]]['_rr']=this[_0x7c7a('0x2c')][this[_0x7c7a('0x125')][_0x39f456[_0x7c7a('0x126')]][_0x7c7a('0xb0')]];for(var _0xab7853=0x0;_0xab7853=0x0;})[_0x7c7a('0xad')](myreject(_0x4521b2)));}}else{_0x2af4e0[_0x7c7a('0x12a')](ami[_0x7c7a('0xaa')]({'action':_0x7c7a('0x14b'),'command':util[_0x7c7a('0x78')](_0x7c7a('0x146'),_0x11325f,!_[_0x7c7a('0x3d')](config[_0x7c7a('0x148')][_0x3091b8])?_0x3091b8:'')})['then'](function(_0x19a237){return _0x19a237['content'][_0x7c7a('0x14c')]('true')>=0x0;})[_0x7c7a('0xad')](myreject(_0x4521b2)));}BPromise[_0x7c7a('0x14d')](_0x2af4e0)['then'](function(_0x560cf9){var _0x31f745=_[_0x7c7a('0x14e')](_0x560cf9);if(_0x31f745){return _0x120131(_0x31f745);}else{_0x456929['message']=_0x67d8db?_0x7c7a('0x14f'):'INTERVAL_IS_OVERTIME';return _0x4521b2(msgResponse(_0x7c7a('0x150'),'Failure',_0x7c7a('0x151')+_0x67d8db+'\x20'+_0x40cd8e+'\x20Interval\x20is\x20overtime:\x20'+util[_0x7c7a('0x96')](_0x11325f,{'showHidden':![],'depth':null})+_0x7c7a('0x152')+_0x3091b8));}})[_0x7c7a('0xad')](function(_0x423bcd){return _0x4521b2(msgResponse(_0x7c7a('0x141'),_0x7c7a('0x142'),JSON['stringify'](_0x423bcd)));});});};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x153')]=function(_0x30c83){var _0x5a49d6=this;return function(){switch(_0x30c83[_0x7c7a('0x5d')]){case _0x7c7a('0x154'):freeVariablesPredictive(_0x30c83);_0x5a49d6['handlePower'](_0x30c83,0x1);break;case _0x7c7a('0x155'):freeVariablesPredictive(_0x30c83);_0x5a49d6[_0x7c7a('0x156')](_0x30c83,_0x30c83['dialPowerLevel']);break;case _0x7c7a('0xa'):_0x5a49d6[_0x7c7a('0xa')](_0x30c83);break;case'booked':freeVariablesPredictive(_0x30c83);_0x5a49d6['handlePower'](_0x30c83,0x1);break;default:freeVariablesPredictive(_0x30c83);logger[_0x7c7a('0x95')](_0x7c7a('0x157'),_0x30c83['name'],'method\x20not\x20recognized');}};};Dialer[_0x7c7a('0x1e')]['launchHandleIvr']=function(_0x94b9e4){var _0xdae206=this;return function(){_0xdae206[_0x7c7a('0x158')](_0x94b9e4);};};Dialer['prototype']['syncQueueSummary']=function(_0x405f73){var _0x3eb7f2=this;if(isNotPreview(_0x405f73[_0x7c7a('0x5d')])){if(isVoiceQueueOutbound(_0x405f73[_0x7c7a('0x4d')])&&isActive(_0x405f73[_0x7c7a('0x5c')])){_0x405f73[_0x7c7a('0x9c')]=!![];BPromise[_0x7c7a('0xb3')]()[_0x7c7a('0xb4')](checkIsLoggedIn(_0x405f73,_0x405f73['loggedIn']))['then'](checkIsActive(_0x405f73,_0x405f73[_0x7c7a('0x5c')]))['then'](checkInterval(_0x405f73))[_0x7c7a('0xb4')](_0x3eb7f2[_0x7c7a('0x13c')](_0x405f73))[_0x7c7a('0xb4')](_0x3eb7f2[_0x7c7a('0x13f')](_0x405f73[_0x7c7a('0x159')],_0x405f73[_0x7c7a('0x15a')],_0x405f73[_0x7c7a('0x42')],_0x405f73))[_0x7c7a('0xb4')](_0x3eb7f2['checkIfTimeIntervals'](_0x405f73[_0x7c7a('0x43')],_0x405f73[_0x7c7a('0x15a')],_0x405f73[_0x7c7a('0x42')],_0x405f73))[_0x7c7a('0xb4')](_0x3eb7f2[_0x7c7a('0x153')](_0x405f73))[_0x7c7a('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x405f73));}else{notSendMessagesQueue(_0x405f73);}}else{freeVariablesPredictive(_0x405f73);}};Dialer[_0x7c7a('0x1e')]['syncCampaigns']=function(){var _0x107860=this;var _0x1abfec;for(var _0x1a6925 in this['campaigns']){if(typeof this[_0x7c7a('0x24')][_0x1a6925]!==_0x7c7a('0xa8')){_0x1abfec=this[_0x7c7a('0x24')][_0x1a6925];if(isCampaignIvr(_0x1abfec[_0x7c7a('0x4d')])&&isActive(_0x1abfec[_0x7c7a('0x76')])){_0x1abfec[_0x7c7a('0x9c')]=!![];BPromise['resolve']()[_0x7c7a('0xb4')](checkIsActive(_0x1abfec,_0x1abfec[_0x7c7a('0x76')]))['then'](checkInterval(_0x1abfec))[_0x7c7a('0xb4')](_0x107860[_0x7c7a('0x13c')](_0x1abfec))['then'](_0x107860[_0x7c7a('0x13f')](_0x1abfec[_0x7c7a('0x159')],_0x1abfec[_0x7c7a('0x15a')],_0x1abfec[_0x7c7a('0x42')],_0x1abfec))[_0x7c7a('0xb4')](_0x107860[_0x7c7a('0x140')](_0x1abfec['Interval'],_0x1abfec['dialTimezone'],_0x1abfec['name'],_0x1abfec))['then'](_0x107860['launchHandleIvr'](_0x1abfec))[_0x7c7a('0xad')](loggerCatchQueueSummary(_0x7c7a('0x15b'),_0x1abfec));}else{notSendMessagesCampaign(_0x1abfec);}}}};function getCallerIdRandom(_0x4fbc89,_0x50ded5){var _0x352d3b;var _0x111a9d;var _0x33f7fd;if(_0x50ded5<=0x0){_0x50ded5=0x1;}_0x352d3b=new RegExp(_0x7c7a('0x15c')+_0x50ded5+'}$');_0x111a9d=Math[_0x7c7a('0x15d')](0xa,_0x50ded5-0x1);_0x33f7fd=Math[_0x7c7a('0x15d')](0xa,_0x50ded5)-0x1;return util['format']('%s',_[_0x7c7a('0x15e')](_0x4fbc89,_0x352d3b,_[_0x7c7a('0x15f')](_0x111a9d,_0x33f7fd)));}function extractCalleridName(_0x2e3ca9){var _0x115097=_0x2e3ca9[_0x7c7a('0x160')](/"(.*?)"/);return _0x115097?_0x115097[0x1]:_0x2e3ca9;}function extractCalleridNumber(_0x578076){var _0x571d80=_0x578076[_0x7c7a('0x160')](/<(.*?)>/);return _0x571d80?_0x571d80[0x1]:_0x578076;}Dialer[_0x7c7a('0x1e')][_0x7c7a('0x161')]=function(_0x1fe107,_0xc6f24d){var _0x3774a5=this;var _0x2d4dcd=uuid['v4']();this[_0x7c7a('0x125')][_0x2d4dcd]=new Action(_0x1fe107,_0xc6f24d,_0x2d4dcd);return new BPromise(function(_0x49d382,_0x2fe987){if(_[_0x7c7a('0x3d')](_0x1fe107)&&typeof _0x1fe107!==_0x7c7a('0x162')){return _0x2fe987(msgResponse(_0x7c7a('0x163'),_0x7c7a('0x142'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0xc6f24d['Contact'][_0x7c7a('0x164')])||_0xc6f24d[_0x7c7a('0x165')]['phone']===null){return _0x2fe987(msgResponse(_0x7c7a('0x163'),'Failure',_0x7c7a('0x166')));}var _0x5159d8={'XMD-CALLERID':_0x3774a5['actions'][_0x2d4dcd][_0x7c7a('0x167')](),'XMD-AGI':_0x1fe107['dialQueueProject']?util[_0x7c7a('0x78')](_0x7c7a('0x168'),ipAgi,_0x1fe107[_0x7c7a('0x106')]):_0x7c7a('0x169'),'XMD-AGIAFTER':_0x1fe107[_0x7c7a('0x10d')]?util['format'](_0x7c7a('0x168'),ipAgi,_0x1fe107[_0x7c7a('0x10d')]):'NONE','XMD-QUEUE':_0x1fe107[_0x7c7a('0x4d')]===_0x7c7a('0x4e')?util[_0x7c7a('0x78')]('\x22%s,%s%s,,,%s\x22',_0x1fe107[_0x7c7a('0x42')],_0x1fe107[_0x7c7a('0x16a')]||'',_0x1fe107['dialAgiAfterHangupAgent']?'c':'',_0x1fe107[_0x7c7a('0x117')]||0x3):_0x7c7a('0x169'),'XMD-CONTACTID':_0xc6f24d[_0x7c7a('0xd2')],'XMD-CDRTYPE':_0x7c7a('0x8'),'CALLERID(all)':_0x3774a5[_0x7c7a('0x125')][_0x2d4dcd][_0x7c7a('0x167')](),'XMD-AMD':_0x1fe107['dialAMDActive']?_0x7c7a('0x16b'):_0x7c7a('0x169'),'XMD-DESTINATION':_0x7c7a('0xde')};if(_0x1fe107['dialAMDActive']){_0x5159d8[_0x7c7a('0x16c')]=_0x1fe107[_0x7c7a('0x16d')]||0x9c4;_0x5159d8[_0x7c7a('0x16e')]=_0x1fe107[_0x7c7a('0x16f')]||0x5dc;_0x5159d8['XMD-AMDAFTERGREETINGSILENCE']=_0x1fe107[_0x7c7a('0x170')]||0x320;_0x5159d8[_0x7c7a('0x171')]=_0x1fe107[_0x7c7a('0x172')]||0x1388;_0x5159d8[_0x7c7a('0x173')]=_0x1fe107[_0x7c7a('0x174')]||0x64;_0x5159d8[_0x7c7a('0x175')]=_0x1fe107[_0x7c7a('0x176')]||0x32;_0x5159d8[_0x7c7a('0x177')]=_0x1fe107['dialAMDMaximumNumberOfWords']||0x3;_0x5159d8[_0x7c7a('0x178')]=_0x1fe107['dialAMDSilenceThreshold']||0x100;_0x5159d8[_0x7c7a('0x179')]=_0x1fe107[_0x7c7a('0x17a')]||0x1388;}if(_0x1fe107[_0x7c7a('0x4d')]===_0x7c7a('0x4e')){_0x5159d8[_0x7c7a('0x17b')]=_0xc6f24d['VoiceQueueId'];}else{_0x5159d8[_0x7c7a('0x17c')]=_0xc6f24d[_0x7c7a('0xd5')];}for(var _0x5a5d7c in _0xc6f24d['Contact']){if(typeof _0xc6f24d[_0x7c7a('0x165')][_0x5a5d7c]!==_0x7c7a('0xa8')){if(isNotNull(_0xc6f24d[_0x7c7a('0x165')][_0x5a5d7c])&&_0x5a5d7c!=='id'&&_0x5a5d7c!==_0x7c7a('0x17d')&&_0x5a5d7c!=='createdAt'&&_0x5a5d7c!==_0x7c7a('0x17e')){_0x5159d8[util[_0x7c7a('0x78')](_0x7c7a('0x17f'),_0x7c7a('0x180'),_[_0x7c7a('0x181')](_0x5a5d7c))]=_0xc6f24d[_0x7c7a('0x165')][_0x5a5d7c];}}}var _0x4a843c=_0x3774a5['isTrunkReachable'](_0x1fe107[_0x7c7a('0x75')])?getCallerId(_0x1fe107['Trunk']['callerid'],_0x1fe107[_0x7c7a('0x182')],_0x1fe107[_0x7c7a('0x183')]>0x0?getCallerIdRandom(_0x1fe107[_0x7c7a('0x184')],_0x1fe107[_0x7c7a('0x183')]):_0x1fe107[_0x7c7a('0x184')]):getCallerId(_[_0x7c7a('0xa9')](_0x1fe107['TrunkBackup'])?_0x1fe107[_0x7c7a('0x75')][_0x7c7a('0x77')]:_0x1fe107[_0x7c7a('0x13d')][_0x7c7a('0x77')],_0x1fe107[_0x7c7a('0x182')],_0x1fe107[_0x7c7a('0x183')]>0x0?getCallerIdRandom(_0x1fe107[_0x7c7a('0x184')],_0x1fe107[_0x7c7a('0x183')]):_0x1fe107[_0x7c7a('0x184')]);if(_0x4a843c){_0x5159d8[_0x7c7a('0x185')]=_0x3774a5[_0x7c7a('0x125')][_0x2d4dcd][_0x7c7a('0x186')]=extractCalleridName(_0x4a843c);_0x5159d8[_0x7c7a('0x187')]=_0x3774a5[_0x7c7a('0x125')][_0x2d4dcd][_0x7c7a('0x188')]=extractCalleridNumber(_0x4a843c);}return ami[_0x7c7a('0xaa')]({'actionid':_0x2d4dcd,'action':_0x7c7a('0x163'),'channel':_0x3774a5[_0x7c7a('0xd8')](_0x1fe107[_0x7c7a('0x75')])?util[_0x7c7a('0x78')]('SIP/%s/%s%s',_0x1fe107['Trunk'][_0x7c7a('0x42')],isNotNull(_0x1fe107['dialPrefix'])?_0x1fe107[_0x7c7a('0x5f')][_0x7c7a('0x189')]()||'':'',_0x1fe107[_0x7c7a('0x18a')]>0x0?_0xc6f24d[_0x7c7a('0x165')][_0x7c7a('0x164')]['substring'](_0x1fe107['dialCutDigit']):_0xc6f24d[_0x7c7a('0x165')][_0x7c7a('0x164')]):util[_0x7c7a('0x78')](_0x7c7a('0x18b'),_[_0x7c7a('0xa9')](_0x1fe107[_0x7c7a('0x13d')])?_0x1fe107['Trunk'][_0x7c7a('0x42')]:_0x1fe107[_0x7c7a('0x13d')][_0x7c7a('0x42')],isNotNull(_0x1fe107['dialPrefix'])?_0x1fe107[_0x7c7a('0x5f')][_0x7c7a('0x189')]()||'':'',_0x1fe107[_0x7c7a('0x18a')]>0x0?_0xc6f24d['Contact'][_0x7c7a('0x164')][_0x7c7a('0x18c')](_0x1fe107[_0x7c7a('0x18a')]):_0xc6f24d[_0x7c7a('0x165')][_0x7c7a('0x164')]),'callerid':_0x4a843c,'Exten':_0x7c7a('0xde'),'Context':_0x7c7a('0x18d'),'Priority':'1','variable':_0x5159d8,'timeout':(_0x1fe107[_0x7c7a('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2d4dcd})[_0x7c7a('0xb4')](function(_0x481f74){return _0x49d382(_0x481f74);})[_0x7c7a('0xad')](function(_0x3bdc91){_0x1fe107[_0x7c7a('0x67')]+=0x1;var _0x2e2814=new History(_0x3774a5[_0x7c7a('0x125')][_0x2d4dcd]);logger[_0x7c7a('0x95')](util[_0x7c7a('0x78')]('[originateError]:\x20%s',JSON[_0x7c7a('0x49')](_0x3bdc91)));_0x2e2814[_0x7c7a('0xa2')]=0xe;_0x2e2814[_0x7c7a('0xa3')]=_0x7c7a('0x18e');_0x2e2814[_0x7c7a('0x11c')]=moment()['format'](_0x7c7a('0xfb'));_0x2e2814[_0x7c7a('0xa4')]=_0x2e2814[_0x7c7a('0x11c')];_0x3774a5[_0x7c7a('0xc8')](_0x2e2814)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x18f')));_0x3774a5[_0x7c7a('0xc6')](_0x2e2814)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x3774a5[_0x7c7a('0x125')][_0x2d4dcd];return _0x2fe987(msgResponse(_0x7c7a('0x163'),'Error',_0x7c7a('0x190')));});});});};Dialer['prototype'][_0x7c7a('0x30')]=function(_0x2e595e){var _0x2872ec=this[_0x7c7a('0x125')][_0x2e595e[_0x7c7a('0x126')]];if(_0x2872ec){delete this[_0x7c7a('0x125')][_0x2e595e[_0x7c7a('0x126')]];_0x2872ec[_0x7c7a('0x116')]=moment()['format'](_0x7c7a('0xfb'));var _0x4984b5=_0x2872ec[_0x7c7a('0x4d')]===_0x7c7a('0x7b')?this[_0x7c7a('0x24')][_0x2872ec[_0x7c7a('0xb0')]]:this[_0x7c7a('0x23')][_0x2872ec[_0x7c7a('0x191')]()];if(!this[_0x7c7a('0xd6')](_0x2e595e[_0x7c7a('0x192')])){this[_0x7c7a('0xaf')](_0x4984b5);return this[_0x7c7a('0x193')](_0x2872ec,_0x4984b5,_0x2e595e)[_0x7c7a('0xad')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x7c7a('0xa6')][_0x2e595e['uniqueid']]=_0x2872ec;}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x194')]=function(_0x20eb4a,_0x5bca35,_0x242cab){var _0x48325a=new History(_0x5bca35);if(_0x48325a[_0x7c7a('0xec')]+_0x48325a[_0x7c7a('0xed')]+_0x48325a[_0x7c7a('0xee')]+_0x48325a[_0x7c7a('0xef')]+_0x48325a[_0x7c7a('0xf0')]+_0x48325a[_0x7c7a('0xf1')]+_0x48325a[_0x7c7a('0xf2')]+_0x48325a['countagentrejectretry']>=_0x242cab[_0x7c7a('0xf4')]-0x1){return!![];}switch(_0x20eb4a){case 0x3:if(_0x48325a[_0x7c7a('0xee')]>=_0x242cab[_0x7c7a('0x195')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x48325a[_0x7c7a('0xee')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab['dialNoAnswerRetryFrequency'],'minutes')[_0x7c7a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a['ListId'],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a['CampaignId']||undefined})[_0x7c7a('0xad')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x48325a[_0x7c7a('0xec')]>=_0x242cab[_0x7c7a('0x196')]-0x1){return!![];}this[_0x7c7a('0xbc')]({'active':![],'countbusyretry':_0x48325a[_0x7c7a('0xec')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab[_0x7c7a('0x197')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a[_0x7c7a('0xd3')],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x198')));break;case 0x8:if(_0x48325a[_0x7c7a('0xed')]>=_0x242cab['dialCongestionMaxRetry']-0x1){return!![];}this[_0x7c7a('0xbc')]({'active':![],'countcongestionretry':_0x48325a['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x242cab[_0x7c7a('0x199')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a['ListId'],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x48325a[_0x7c7a('0xef')]>=_0x242cab[_0x7c7a('0x19a')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x48325a[_0x7c7a('0xef')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab['dialNoSuchNumberRetryFrequency'],_0x7c7a('0xfa'))['format'](_0x7c7a('0xfb')),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a['ListId'],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})['catch'](loggerCatch(_0x7c7a('0x19b')));}break;case 0xa:if(_0x48325a['countdropretry']>=_0x242cab[_0x7c7a('0x11a')]-0x1){return!![];}this[_0x7c7a('0xbc')]({'active':![],'countdropretry':_0x48325a[_0x7c7a('0xf0')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab[_0x7c7a('0x19c')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a['ListId'],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x11b')));break;case 0xb:if(_0x48325a[_0x7c7a('0xf1')]>=_0x242cab[_0x7c7a('0x19d')]-0x1){return!![];}this[_0x7c7a('0xbc')]({'active':![],'countabandonedretry':_0x48325a[_0x7c7a('0xf1')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab[_0x7c7a('0x123')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a['ContactId'],'ListId':_0x48325a[_0x7c7a('0xd3')],'VoiceQueueId':_0x48325a['VoiceQueueId']||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})['catch'](loggerCatch(_0x7c7a('0x124')));break;case 0x13:if(_0x48325a[_0x7c7a('0xf2')]>=_0x242cab['dialMachineMaxRetry']-0x1){return!![];}this[_0x7c7a('0xbc')]({'active':![],'countmachineretry':_0x48325a[_0x7c7a('0xf2')]+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab[_0x7c7a('0xf9')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a[_0x7c7a('0xd2')],'ListId':_0x48325a[_0x7c7a('0xd3')],'VoiceQueueId':_0x48325a[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})['catch'](loggerCatch(_0x7c7a('0xfd')));break;case 0x14:if(_0x48325a['countagentrejectretry']>=_0x242cab[_0x7c7a('0x19e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x48325a['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x7c7a('0xf8')](_0x242cab[_0x7c7a('0x19f')],_0x7c7a('0xfa'))[_0x7c7a('0x78')](_0x7c7a('0xfb')),'ContactId':_0x48325a['ContactId'],'ListId':_0x48325a[_0x7c7a('0xd3')],'VoiceQueueId':_0x48325a['VoiceQueueId']||undefined,'CampaignId':_0x48325a[_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1a0')));break;default:return!![];}};Dialer['prototype'][_0x7c7a('0x193')]=function(_0x610c2d,_0x2368b3,_0x1deecc){var _0x2e7676=this;var _0x5c1fdc=new History(_0x610c2d);return new BPromise(function(_0xd17343,_0x23bd2e){if(_['isUndefined'](_0x2368b3)&&typeof _0x2368b3!==_0x7c7a('0x162')){return _0x23bd2e(msgResponse('[callProgressDetecting]',_0x7c7a('0x142'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x1deecc)&&typeof _0x1deecc!==_0x7c7a('0x162')){return _0x23bd2e(msgResponse(_0x7c7a('0x1a1'),_0x7c7a('0x142'),_0x7c7a('0x1a2')));}switch(_0x1deecc[_0x7c7a('0x10a')]){case'0':_0x2368b3[_0x7c7a('0x66')]+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0x0;_0x5c1fdc[_0x7c7a('0xa3')]=_0x7c7a('0x1a3');_0x5c1fdc['countnosuchnumberretry']+=0x1;_0x5c1fdc[_0x7c7a('0x100')]+=0x1;ami[_0x7c7a('0x4c')]('custom:agentnosuchnumber',ut[_0x7c7a('0xe6')](_0x610c2d,'nosuchnumber'));_0x2e7676['createHistory'](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xeb')));if(_0x2e7676[_0x7c7a('0x194')](0x0,_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xef')]>=_0x2368b3['dialNoSuchNumberMaxRetry']){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1a4'));}else{_0x2e7676[_0x7c7a('0x101')](_0x5c1fdc,_0xd17343,_0x23bd2e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2368b3['outboundNoAnswerCallsDay']+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0x3;_0x5c1fdc['statedesc']=_0x7c7a('0x1a5');_0x5c1fdc[_0x7c7a('0xee')]+=0x1;_0x5c1fdc[_0x7c7a('0x100')]+=0x1;ami[_0x7c7a('0x4c')]('custom:agentnoanswer',ut['buildObj'](_0x610c2d,_0x7c7a('0x1a6')));_0x2e7676['createHistory'](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1a7')));if(_0x2e7676[_0x7c7a('0x194')](0x3,_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xee')]>=_0x2368b3['dialNoAnswerMaxRetry']){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1a8'));}else{_0x2e7676['stateGlobal'](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1a8'));}}break;case'5':_0x2368b3[_0x7c7a('0x62')]+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0x5;_0x5c1fdc[_0x7c7a('0xa3')]=_0x7c7a('0x1a9');_0x5c1fdc[_0x7c7a('0xec')]+=0x1;_0x5c1fdc[_0x7c7a('0x100')]+=0x1;ami['emit'](_0x7c7a('0x1aa'),ut[_0x7c7a('0xe6')](_0x610c2d,_0x7c7a('0x1ab')));_0x2e7676[_0x7c7a('0xc8')](_0x5c1fdc)['catch'](loggerCatch(_0x7c7a('0x1ac')));if(_0x2e7676[_0x7c7a('0x194')](0x5,_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xec')]>=_0x2368b3[_0x7c7a('0x196')]){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1ad'));}else{_0x2e7676[_0x7c7a('0x101')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1ad'));}}break;case'8':_0x2368b3[_0x7c7a('0x1ae')]+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0x8;_0x5c1fdc[_0x7c7a('0xa3')]='Congestion';_0x5c1fdc['countcongestionretry']+=0x1;_0x5c1fdc['countglobal']+=0x1;ami[_0x7c7a('0x4c')](_0x7c7a('0x1af'),ut[_0x7c7a('0xe6')](_0x610c2d,'congestion'));_0x2e7676[_0x7c7a('0xc8')](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1b0')));if(_0x2e7676[_0x7c7a('0x194')](0x8,_0x610c2d,_0x2368b3)){if(_0x5c1fdc['countcongestionretry']>=_0x2368b3[_0x7c7a('0x1b1')]){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1b2'));}else{_0x2e7676['stateGlobal'](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1b2'));}}break;case'11':_0x2368b3[_0x7c7a('0x1b3')]+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0xb;_0x5c1fdc[_0x7c7a('0xa3')]='Abandoned';_0x5c1fdc[_0x7c7a('0xf1')]+=0x1;_0x5c1fdc[_0x7c7a('0x100')]+=0x1;_0x2e7676[_0x7c7a('0xc8')](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2e7676[_0x7c7a('0x194')](0xb,_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xf1')]>=_0x2368b3[_0x7c7a('0x19d')]){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,'reason\x2011\x20abandoned');}else{_0x2e7676[_0x7c7a('0x101')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1b4'));}}break;case'20':_0x2368b3[_0x7c7a('0x69')]+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0x14;_0x5c1fdc['statedesc']=_0x7c7a('0x1b5');_0x5c1fdc[_0x7c7a('0xf3')]+=0x1;_0x5c1fdc[_0x7c7a('0x100')]+=0x1;ami[_0x7c7a('0x4c')](_0x7c7a('0x1b6'),ut[_0x7c7a('0xe6')](_0x610c2d,_0x7c7a('0x1b7')));_0x2e7676[_0x7c7a('0xc8')](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1b8')));if(_0x2e7676[_0x7c7a('0x194')](0x14,_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xf3')]>=_0x2368b3['dialAgentRejectMaxRetry']){_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,'reason\x2020\x20agentreject');}else{_0x2e7676[_0x7c7a('0x101')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x7c7a('0x1b9'));}}break;default:_0x2368b3['outboundUnknownCallsDay']+=0x1;_0x5c1fdc[_0x7c7a('0xa2')]=0xc;_0x5c1fdc[_0x7c7a('0xa3')]=_0x1deecc[_0x7c7a('0x10a')];_0x2e7676[_0x7c7a('0xc8')](_0x5c1fdc)[_0x7c7a('0xad')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2e7676[_0x7c7a('0x194')](_0x1deecc[_0x7c7a('0x10a')],_0x610c2d,_0x2368b3)){if(_0x5c1fdc[_0x7c7a('0xec')]+_0x5c1fdc[_0x7c7a('0xed')]+_0x5c1fdc['countnoanswerretry']+_0x5c1fdc['countnosuchnumberretry']+_0x5c1fdc[_0x7c7a('0xf0')]+_0x5c1fdc[_0x7c7a('0xf1')]+_0x5c1fdc['countmachineretry']+_0x5c1fdc[_0x7c7a('0xf3')]>=_0x2368b3['dialGlobalMaxRetry']){_0x2e7676[_0x7c7a('0x101')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x1deecc['reason']);}else{_0x2e7676[_0x7c7a('0x102')](_0x5c1fdc,_0xd17343,_0x23bd2e,_0x1deecc['reason']);}}}});};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x101')]=function(_0x21f1bb,_0x138ab2,_0x2c7970,_0x476834){var _0x232f68=new Final(_0x21f1bb);_0x232f68['state']=0xf;_0x232f68['statedesc']=_0x7c7a('0x1ba');this[_0x7c7a('0x102')](_0x232f68,_0x138ab2,_0x2c7970,_0x476834);};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x102')]=function(_0x533a30,_0x21675c,_0x442c57,_0x38b60d){this[_0x7c7a('0xc6')](_0x533a30)[_0x7c7a('0xb4')](function(){return _0x21675c(msgResponse(_0x7c7a('0x1a1'),'Success',_0x38b60d));})[_0x7c7a('0xad')](function(){return _0x442c57(msgResponse(_0x7c7a('0x1bb'),_0x7c7a('0x142'),_0x7c7a('0x1bc')));});};Dialer[_0x7c7a('0x1e')][_0x7c7a('0xa')]=function(_0x959d30){var _0x1924b0=_0x959d30['dialPredictiveOptimizationPercentage']/0x64;var _0x3e1575=_0x959d30['outboundDropCallsDayTimeout']/(_0x959d30[_0x7c7a('0x64')]+_0x959d30[_0x7c7a('0x61')]);var _0x280c9c=Math['round'](_0x959d30[_0x7c7a('0x1bd')]*(_0x959d30[_0x7c7a('0x1be')]/0x64));var _0x27bbc3=Math[_0x7c7a('0x1bf')](_0x959d30['predictiveIntervalAvailable']*(_0x959d30[_0x7c7a('0x1c0')]/0x64));var _0x4eda30=_0x959d30[_0x7c7a('0x51')]+_0x959d30[_0x7c7a('0x57')];var _0x4a41b2=Math[_0x7c7a('0x1c1')](_0x959d30[_0x7c7a('0x72')]*_0x959d30[_0x7c7a('0x8b')]*_0x959d30['predictiveIntervalHitRate']*_0x959d30[_0x7c7a('0x6f')]);if(_['isUndefined'](_0x959d30['startProgressive'])){if(!_['isUndefined'](_0x959d30[_0x7c7a('0x8e')])){_0x959d30[_0x7c7a('0x8e')]=undefined;loggerPredictive['error'](_0x7c7a('0x1c2'),_0x7c7a('0x1c3'));}if(!_[_0x7c7a('0x3d')](_0x959d30[_0x7c7a('0x90')])){loggerPredictive[_0x7c7a('0x95')](_0x7c7a('0x1c2'),_0x7c7a('0x1c4'));clearInterval(_0x959d30[_0x7c7a('0x90')]);_0x959d30[_0x7c7a('0x90')]=undefined;}_0x959d30[_0x7c7a('0x2a')]=moment()['format'](_0x7c7a('0xfb'));loggerPredictive[_0x7c7a('0x7e')](_0x959d30['name'],_0x7c7a('0x1c5'),_0x959d30[_0x7c7a('0x2a')]);this['handlePower'](_0x959d30,0x1);}else if(ifInterval(_0x959d30['dialPredictiveInterval'],_0x959d30[_0x7c7a('0x2a')])){this[_0x7c7a('0x156')](_0x959d30,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x959d30[_0x7c7a('0x2a')],_0x959d30['name']);_0x959d30[_0x7c7a('0x72')]=0x0;_0x959d30[_0x7c7a('0x6d')]=0x0;}else if(_0x1924b0<_0x3e1575&&_0x959d30['dialPredictiveOptimization']===_0x7c7a('0x1c6')){freeVariablesPredictive(_0x959d30);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x1c7'),_0x7c7a('0x1c8'),_0x3e1575,_0x7c7a('0x2a'),_0x959d30['name']);}else if(_0x4a41b2<_0x959d30['predictiveIntervalErlangCallsDroppedCalls']&&_0x959d30['dialPredictiveOptimization']===_0x7c7a('0x1c6')){freeVariablesPredictive(_0x959d30);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x1c9'),'Max\x20Drop\x20',_0x4a41b2,_0x7c7a('0x1ca'),_0x959d30[_0x7c7a('0x6d')],_0x7c7a('0x2a'),_0x959d30['name']);}else if(!ifInterval(_0x959d30[_0x7c7a('0x1cb')],_0x959d30[_0x7c7a('0x2a')])&&_[_0x7c7a('0x3d')](_0x959d30[_0x7c7a('0x8e')])&&!_[_0x7c7a('0x3d')](_0x959d30['startProgressive'])){_0x959d30[_0x7c7a('0x8e')]=moment()[_0x7c7a('0x78')](_0x7c7a('0xfb'));loggerPredictive[_0x7c7a('0x7e')](_0x959d30[_0x7c7a('0x42')],'started\x20in\x20predictive\x20at',_0x959d30['startPredictive']);this[_0x7c7a('0xba')](_0x959d30[_0x7c7a('0x1cb')])[_0x7c7a('0xb4')](this['getDataPredictive'](_0x959d30))[_0x7c7a('0xb4')](mergeDataErlangB(_0x959d30))[_0x7c7a('0xb4')](this[_0x7c7a('0x1cc')](_0x959d30))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x959d30));}else if(!ifInterval(_0x959d30[_0x7c7a('0x1cb')],_0x959d30[_0x7c7a('0x8e')])){_0x959d30[_0x7c7a('0x6d')]=0x0;_0x959d30[_0x7c7a('0x8e')]=moment()[_0x7c7a('0x78')](_0x7c7a('0xfb'));loggerPredictive[_0x7c7a('0x7e')](_0x959d30['name'],_0x7c7a('0x1cd'),_0x959d30[_0x7c7a('0x8e')]);clearInterval(_0x959d30[_0x7c7a('0x90')]);_0x959d30[_0x7c7a('0x90')]=undefined;this[_0x7c7a('0xba')](_0x959d30[_0x7c7a('0x1cb')])[_0x7c7a('0xb4')](this[_0x7c7a('0x1ce')](_0x959d30))['then'](mergeDataErlangB(_0x959d30))[_0x7c7a('0xb4')](this[_0x7c7a('0x1cc')](_0x959d30))[_0x7c7a('0xad')](loggerCatchPredictive(_0x7c7a('0x1cf'),_0x959d30));}else if(_0x959d30['predictiveIntervalAvailable']&&_0x4eda30<_0x959d30[_0x7c7a('0x1bd')]-_0x27bbc3){freeVariablesPredictive(_0x959d30);loggerPredictive[_0x7c7a('0x7e')](_0x959d30[_0x7c7a('0x42')],_0x7c7a('0x1d0'),_0x4eda30,_0x7c7a('0x1d1'),_0x959d30[_0x7c7a('0x1bd')],'-',_0x27bbc3,'=',_0x959d30[_0x7c7a('0x1bd')]-_0x27bbc3,')');}else if(_0x959d30['predictiveIntervalAvailable']&&_0x4eda30>_0x959d30['predictiveIntervalAvailable']+_0x280c9c){freeVariablesPredictive(_0x959d30);loggerPredictive['info'](_0x959d30[_0x7c7a('0x42')],_0x7c7a('0x1d0'),_0x4eda30,')\x20are\x20more\x20than\x20threshold\x20(',_0x959d30[_0x7c7a('0x1bd')],'+',_0x280c9c,'=',_0x959d30[_0x7c7a('0x1bd')]+_0x280c9c,')');}};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x1ce')]=function(_0x4e1850){var _0x388ce5=this;return function(_0x4fdb90){return new BPromise(function(_0x462338,_0x17be96){_[_0x7c7a('0xd0')](_0x4e1850,_0x4fdb90[0x0]);if(checkGetDataPredictive(_0x4fdb90[0x0])){var _0x3eb323=_0x4e1850[_0x7c7a('0x1bd')]=_0x4e1850[_0x7c7a('0x57')]+_0x4e1850[_0x7c7a('0x51')];var _0x263e1c=_0x4e1850[_0x7c7a('0x1cb')]*0x3c;var _0x5cec97=_0x4fdb90[0x0]['predictiveIntervalAvgTalktime']+_0x4fdb90[0x0][_0x7c7a('0x6b')];var _0x3e3961=(_0x4fdb90[0x0]['predictiveIntervalAnsweredCalls']+_0x4fdb90[0x0][_0x7c7a('0x81')]+_0x4fdb90[0x0][_0x7c7a('0x83')])/_0x4fdb90[0x0]['predictiveIntervalTotalCalls'];_0x4e1850[_0x7c7a('0x6e')]=_0x3e3961>0x0?_0x3e3961:0x1;switch(_0x4e1850['dialPredictiveOptimization']){case _0x7c7a('0x1c6'):var _0x5a4694=_0x4e1850[_0x7c7a('0x1d2')]/0x64;return _0x388ce5[_0x7c7a('0x1d3')](_0x3eb323,_0x263e1c,_0x5cec97,_0x3e3961,_0x5a4694)[_0x7c7a('0xb4')](function(_0x54784c){return _0x462338(_0x54784c);});case'agentBusyFactor':var _0x462e97=_0x4e1850[_0x7c7a('0x1d2')]/0x64;return _0x388ce5[_0x7c7a('0x1d4')](_0x3eb323,_0x263e1c,_0x5cec97,_0x3e3961,_0x462e97)[_0x7c7a('0xb4')](function(_0x27c2e8){return _0x462338(_0x27c2e8);});default:return _0x17be96(msgResponse(_0x7c7a('0x1d5'),_0x7c7a('0x142'),_0x7c7a('0x1d6')));}}else{return _0x17be96(msgResponse(_0x7c7a('0x1d5'),_0x7c7a('0x142'),'check\x20failure'));}});};};Dialer['prototype'][_0x7c7a('0x1d7')]=function(_0x40ac3a){var _0x295f84=this;return function(_0x1df6f8){return new BPromise(function(_0x3bb86e,_0x4487c7){_[_0x7c7a('0xd0')](_0x40ac3a,_0x1df6f8[0x0]);if(checkGetDataPredictive(_0x1df6f8[0x0])){loggerPredictive[_0x7c7a('0x7e')](JSON[_0x7c7a('0x49')](_0x1df6f8[0x0]));if(_0x40ac3a['dialPredictiveOptimization']==='dropRate'){return _0x295f84[_0x7c7a('0xc5')](_0x40ac3a['id'])['then'](function(_0x7073a5){var _0x48c687=_0x40ac3a[_0x7c7a('0x52')]-_0x7073a5[0x0][_0x7c7a('0x1d8')];var _0x3fba05=_0x40ac3a[_0x7c7a('0x1cb')]*0x3c;var _0x635e62=_0x1df6f8[0x0]['predictiveIntervalAvgTalktime']+_0x1df6f8[0x0]['predictiveIntervalAvgHoldtime'];var _0x2f2c39=(_0x1df6f8[0x0][_0x7c7a('0x6a')]+_0x1df6f8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1df6f8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1df6f8[0x0][_0x7c7a('0x71')];var _0x457512=_0x40ac3a[_0x7c7a('0x1d2')]/0x64;_0x40ac3a[_0x7c7a('0x70')]=_0x7073a5[0x0]['outboundQueuePauses']||0x0;_0x40ac3a['predictiveIntervalHitRate']=_0x2f2c39>0x0?_0x2f2c39:0x1;return _0x295f84[_0x7c7a('0x1d3')](_0x48c687,_0x3fba05,_0x635e62,_0x2f2c39,_0x457512);})[_0x7c7a('0xb4')](function(_0x258f40){return _0x3bb86e(_0x258f40);})['catch'](function(_0x5f185d){return _0x4487c7(msgResponse(_0x7c7a('0x1d9'),_0x7c7a('0x142'),JSON[_0x7c7a('0x49')](_0x5f185d)));});}if(_0x40ac3a[_0x7c7a('0x1da')]===_0x7c7a('0x1db')){return _0x295f84[_0x7c7a('0xc5')](_0x40ac3a['id'])[_0x7c7a('0xb4')](function(_0x2065c3){var _0xf43663=_0x40ac3a[_0x7c7a('0x52')]-_0x2065c3[0x0][_0x7c7a('0x1d8')];var _0x24890e=_0x40ac3a[_0x7c7a('0x1cb')]*0x3c;var _0xbd1c0f=_0x1df6f8[0x0]['predictiveIntervalAvgTalktime']+_0x1df6f8[0x0]['predictiveIntervalAvgHoldtime'];var _0x14efb1=(_0x1df6f8[0x0][_0x7c7a('0x6a')]+_0x1df6f8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1df6f8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1df6f8[0x0][_0x7c7a('0x71')];var _0x5db241=_0x40ac3a['dialPredictiveOptimizationPercentage']/0x64;_0x40ac3a[_0x7c7a('0x70')]=_0x2065c3[0x0][_0x7c7a('0x1d8')]||0x0;_0x40ac3a['predictiveIntervalHitRate']=_0x14efb1>0x0?_0x14efb1:0x1;return _0x295f84[_0x7c7a('0x1d4')](_0xf43663,_0x24890e,_0xbd1c0f,_0x14efb1,_0x5db241);})[_0x7c7a('0xb4')](function(_0x249c0b){return _0x3bb86e(_0x249c0b);})[_0x7c7a('0xad')](function(_0x2cd4d7){return _0x4487c7(msgResponse('[CatchErlangB]',_0x7c7a('0x142'),JSON[_0x7c7a('0x49')](_0x2cd4d7)));});}}else{return _0x4487c7(msgResponse(_0x7c7a('0x1d5'),_0x7c7a('0x142'),'check\x20failure'));}});};};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x1cc')]=function(_0x1f1e7f){var _0x3adbeb=this;return function(){var _0x470c8a=0x0;var _0x140daa=Math[_0x7c7a('0x1c1')](_0x1f1e7f[_0x7c7a('0x73')]*0x3e8);if(_0x140daa>0x0){_0x140daa=_0x140daa<0x64?0x64:_0x140daa;loggerPredictive[_0x7c7a('0x7e')](_0x1f1e7f[_0x7c7a('0x42')],_0x7c7a('0x1dc'),_0x140daa,_0x7c7a('0x4a'));_0x1f1e7f[_0x7c7a('0x90')]=setInterval(function(){_0x3adbeb[_0x7c7a('0x90')](_0x1f1e7f);loggerPredictiveCalls[_0x7c7a('0x7e')](_0x7c7a('0x1dd'),_0x470c8a+=0x1);},_0x140daa);}else{loggerPredictive[_0x7c7a('0x7e')](_0x1f1e7f['name'],_0x7c7a('0x1de'));}};};Dialer['prototype'][_0x7c7a('0x1df')]=function(_0x5e6498,_0x23ea0d){var _0x3041d1=this;return function(_0x2ba39d){if(_[_0x7c7a('0x47')](_0x2ba39d)){if(_['isNil'](_0x23ea0d['UserId'])||!_0x23ea0d['recallme']){if(_0x5e6498[_0x7c7a('0x5d')]===_0x7c7a('0x9')){_0x5e6498[_0x7c7a('0x12c')]=_['isUndefined'](_0x5e6498[_0x7c7a('0x12c')])?!![]:_0x5e6498[_0x7c7a('0x12c')];var _0x48ed59=uuid['v4']();_0x3041d1[_0x7c7a('0x125')][_0x48ed59]=new Action(_0x5e6498,_0x23ea0d,_0x48ed59);loggerBooked[_0x7c7a('0x7e')](_0x7c7a('0x1e0'),_0x48ed59,_0x7c7a('0x1e1'),JSON[_0x7c7a('0x49')](_0x5e6498['queueStatusComplete']),'Queue:\x20',_0x5e6498[_0x7c7a('0x42')]);if(_0x5e6498[_0x7c7a('0x12c')]){_0x5e6498[_0x7c7a('0x12c')]=![];_0x3041d1[_0x7c7a('0x2b')][_0x3041d1[_0x7c7a('0x125')][_0x48ed59]['queue']]=[];ami[_0x7c7a('0xaa')]({'actionid':_0x48ed59,'action':_0x7c7a('0x1e2'),'queue':_0x5e6498['name']})['catch'](function(){_0x3041d1['updateOriginated'](_0x5e6498);_0x3041d1['rescheduleContact']({'active':![],'ContactId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xd2')],'ListId':_0x3041d1['actions'][_0x48ed59][_0x7c7a('0xd3')],'VoiceQueueId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xfc')]||undefined,'CampaignId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1e3')));delete _0x3041d1[_0x7c7a('0x125')][_0x48ed59];});}else{loggerBooked[_0x7c7a('0x7e')](_0x7c7a('0x1e4'),JSON[_0x7c7a('0x49')](_0x5e6498['queueStatusComplete']),_0x7c7a('0x1e5'),_0x5e6498[_0x7c7a('0x42')]);_0x3041d1[_0x7c7a('0xaf')](_0x5e6498);_0x3041d1[_0x7c7a('0xbc')]({'active':![],'ContactId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xd2')],'ListId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xd3')],'VoiceQueueId':_0x3041d1[_0x7c7a('0x125')][_0x48ed59][_0x7c7a('0xfc')]||undefined,'CampaignId':_0x3041d1['actions'][_0x48ed59][_0x7c7a('0xd5')]||undefined})[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0x1e3')));delete _0x3041d1[_0x7c7a('0x125')][_0x48ed59];}}else{return _0x3041d1[_0x7c7a('0x161')](_0x5e6498,_0x23ea0d);}}else{if(getDiff(_0x23ea0d[_0x7c7a('0x1e6')])<_0x5e6498[_0x7c7a('0x1e7')]*0x3c){if(_0x23ea0d['Agent']&&!_0x23ea0d[_0x7c7a('0x1e8')][_0x7c7a('0x1e9')]){_0x3041d1[_0x7c7a('0x22')]['run'](_0x23ea0d['id'])[_0x7c7a('0x20')](function(){_0x3041d1[_0x7c7a('0xaf')](_0x5e6498);});}else{_0x3041d1[_0x7c7a('0xbe')]({'active':![]},_0x23ea0d['id'],0x1)[_0x7c7a('0x20')](function(){_0x3041d1[_0x7c7a('0xaf')](_0x5e6498);});}}else{_0x5e6498[_0x7c7a('0x68')]+=0x1;_0x3041d1[_0x7c7a('0xaf')](_0x5e6498);if(_0x5e6498['dialRecallInQueue']){_0x3041d1['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x23ea0d['ContactId'],'ListId':_0x23ea0d[_0x7c7a('0xd3')],'VoiceQueueId':_0x23ea0d[_0x7c7a('0xfc')]||undefined,'CampaignId':_0x23ea0d[_0x7c7a('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3041d1[_0x7c7a('0xc8')](createObjHistory(_0x5e6498,_0x23ea0d,_0x7c7a('0x1ea'),0x17,'RecallInQueue'))[_0x7c7a('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3041d1[_0x7c7a('0xcf')](createObjHistory(_0x5e6498,_0x23ea0d,'RECALLFAILEDTIMEOUT',0x16,_0x7c7a('0x1eb')),_0x7c7a('0x1ec'),_0x7c7a('0x1ed'));}}}}else{_0x5e6498[_0x7c7a('0x1ee')]+=0x1;_0x3041d1[_0x7c7a('0xcf')](createObjHistory(_0x5e6498,_0x23ea0d,_0x7c7a('0x1ef'),0xd,_0x7c7a('0x1f0')),_0x7c7a('0x1f1'),'[Originate][MoveBlacklist]');throw _0x7c7a('0x1f2');}};};Dialer['prototype'][_0x7c7a('0x158')]=function(_0x41fe19){var _0x486da3=this;var _0x231787=_0x41fe19[_0x7c7a('0x1f3')]-_0x41fe19[_0x7c7a('0x98')]-_0x41fe19[_0x7c7a('0xc1')];emitCampaignSummary(_0x41fe19);if(_0x231787>0x0){if(_0x231787>this[_0x7c7a('0x27')]){_0x231787=this[_0x7c7a('0x27')];}_0x41fe19[_0x7c7a('0xc1')]+=_0x231787;this[_0x7c7a('0xc3')](_0x41fe19['id'],_0x231787,_0x41fe19['dialOrderByScheduledAt'],_0x41fe19)['then'](function(_0x5b36d7){_0x41fe19['temp']-=_0x231787;_0x41fe19[_0x7c7a('0xc1')]=_0x41fe19[_0x7c7a('0xc1')]>0x0?_0x41fe19[_0x7c7a('0xc1')]:0x0;if(!checkContactEmpty(_0x5b36d7)){_0x41fe19[_0x7c7a('0x3e')]=_0x7c7a('0x9b');logger[_0x7c7a('0x7e')](_0x7c7a('0x1f4')+_0x41fe19[_0x7c7a('0x42')]);}else{_0x41fe19[_0x7c7a('0x98')]+=_0x5b36d7['length'];_0x41fe19[_0x7c7a('0x3e')]=_0x7c7a('0x1f5');for(var _0x4101e8=0x0;_0x4101e8<_0x5b36d7[_0x7c7a('0x97')];_0x4101e8+=0x1){_0x41fe19['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x5b36d7[_0x4101e8])||_['isNil'](_0x5b36d7[_0x4101e8][_0x7c7a('0x165')])||_[_0x7c7a('0xa9')](_0x5b36d7[_0x4101e8][_0x7c7a('0x165')][_0x7c7a('0x164')])){_0x486da3[_0x7c7a('0xcd')]('[actionOriginate]\x20',_0x41fe19,_0x5b36d7[_0x4101e8]);}else{_0x486da3['checkIsBlackListIvr'](_['pick'](_0x5b36d7[_0x4101e8],[_0x7c7a('0xd5'),_0x7c7a('0x1f6')]))[_0x7c7a('0xb4')](_0x486da3[_0x7c7a('0x1df')](_0x41fe19,_0x5b36d7[_0x4101e8]))[_0x7c7a('0xad')](_0x486da3[_0x7c7a('0xcc')](_0x7c7a('0x1f7'),_0x41fe19));}}}})[_0x7c7a('0xad')](loggerGetContactDialer('[getContactCampaign2]',_0x41fe19,_0x231787));}};Dialer['prototype'][_0x7c7a('0x156')]=function(_0x451842,_0x4b673c){var _0x39a02d=this;var _0x335564=[];var _0x2bd9f6=_0x4b673c>=0x1?_0x4b673c:0x1;if(_0x451842[_0x7c7a('0x5d')]==='booked'){_0x2bd9f6=0x1;}var _0x53c1dd=Math[_0x7c7a('0x1c1')](_0x451842[_0x7c7a('0x51')]*_0x2bd9f6)-_0x451842['originated']-_0x451842[_0x7c7a('0xc1')];emitVoiceQueueSummary(_0x451842);if(_0x451842['dialLimitQueue']>0x0){var _0x5af818=_0x451842[_0x7c7a('0x1f8')]-_0x451842[_0x7c7a('0x98')]-_0x451842[_0x7c7a('0x57')]-_0x451842['temp']-_0x451842['pTalking'];if(_0x53c1dd>_0x5af818){_0x53c1dd=_0x5af818;}}if(_0x53c1dd>0x0){if(_0x451842[_0x7c7a('0x5d')]===_0x7c7a('0x9')){_0x53c1dd=0x1;}if(_0x53c1dd>this[_0x7c7a('0x27')]){_0x53c1dd=this[_0x7c7a('0x27')];}_0x451842[_0x7c7a('0xc1')]+=_0x53c1dd;for(var _0x1526f9 in this[_0x7c7a('0x25')]){if(typeof this[_0x7c7a('0x25')][_0x1526f9]!==_0x7c7a('0xa8')){if(this[_0x7c7a('0x25')][_0x1526f9]['state']===_0x7c7a('0x1f9')&&this[_0x7c7a('0x25')][_0x1526f9][_0x7c7a('0xab')]==='reachable'){_0x335564['push'](this['agents'][_0x1526f9]['id']);}}}this[_0x7c7a('0xc0')](_0x451842['id'],_0x335564,_0x53c1dd,_0x451842['dialOrderByScheduledAt'],_0x451842)[_0x7c7a('0xb4')](function(_0x116d87){_0x451842[_0x7c7a('0xc1')]-=_0x53c1dd;_0x451842[_0x7c7a('0xc1')]=_0x451842[_0x7c7a('0xc1')]>0x0?_0x451842['temp']:0x0;if(!checkContactEmpty(_0x116d87)){_0x39a02d[_0x7c7a('0xb2')](_0x451842)['then'](sendMessageReschedule(_0x451842))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xb5')));}else{_0x451842[_0x7c7a('0x98')]+=_0x116d87[_0x7c7a('0x97')];_0x451842[_0x7c7a('0x3e')]=_0x451842['dialMethod']==='booked'?'ACTIVE':'RUNNING';for(var _0x6f9fa5=0x0;_0x6f9fa5<_0x116d87[_0x7c7a('0x97')];_0x6f9fa5+=0x1){if(_[_0x7c7a('0xa9')](_0x116d87[_0x6f9fa5])||_[_0x7c7a('0xa9')](_0x116d87[_0x6f9fa5][_0x7c7a('0x165')])||_['isNil'](_0x116d87[_0x6f9fa5][_0x7c7a('0x165')][_0x7c7a('0x164')])){_0x39a02d[_0x7c7a('0xcd')]('[actionOriginate]\x20',_0x451842,_0x116d87[_0x6f9fa5]);}else{_0x39a02d['checkIsBlackList'](_['pick'](_0x116d87[_0x6f9fa5],[_0x7c7a('0xfc'),_0x7c7a('0x1f6')]))[_0x7c7a('0xb4')](_0x39a02d[_0x7c7a('0x1df')](_0x451842,_0x116d87[_0x6f9fa5]))[_0x7c7a('0xad')](_0x39a02d['loggerHandler'](_0x7c7a('0x1fa'),_0x451842));}}}})[_0x7c7a('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x451842,_0x53c1dd));}};Dialer[_0x7c7a('0x1e')]['handlePredictive']=function(_0x3ef17b){if(_0x3ef17b[_0x7c7a('0x1f8')]>0x0){var _0x3e7a14=_0x3ef17b[_0x7c7a('0x1f8')]-_0x3ef17b[_0x7c7a('0x98')]-_0x3ef17b['talking'];if(_0x3e7a14>0x0){this[_0x7c7a('0x1fb')](_0x3ef17b);}else{loggerPredictiveCalls[_0x7c7a('0x7e')](_0x7c7a('0x1fc'));}}else{this['tryOriginatePredictive'](_0x3ef17b);}};Dialer['prototype'][_0x7c7a('0x1fb')]=function(_0x4dbf79){var _0x2870da=this;var _0xf220cb=[];_0x4dbf79[_0x7c7a('0x98')]+=0x1;for(var _0x57ae02 in this['agents']){if(typeof this[_0x7c7a('0x25')][_0x57ae02]!==_0x7c7a('0xa8')){if(this[_0x7c7a('0x25')][_0x57ae02]['state']===_0x7c7a('0x1f9')&&this[_0x7c7a('0x25')][_0x57ae02][_0x7c7a('0xab')]===_0x7c7a('0xda')){_0xf220cb[_0x7c7a('0x12a')](this[_0x7c7a('0x25')][_0x57ae02]['id']);}}}this['getContactDialer'](_0x4dbf79['id'],_0xf220cb,0x1,_0x4dbf79[_0x7c7a('0x1fd')],_0x4dbf79)[_0x7c7a('0xb4')](function(_0x20f1ba){if(!checkContactEmpty(_0x20f1ba)){checkContactLowerLimitOriginate(_0x4dbf79,0x1,0x0);_0x2870da[_0x7c7a('0xb2')](_0x4dbf79)[_0x7c7a('0xb4')](sendMessageReschedule(_0x4dbf79))[_0x7c7a('0xad')](loggerCatch(_0x7c7a('0xb5')));}else{_0x4dbf79['message']=_0x7c7a('0x1f5');if(_[_0x7c7a('0xa9')](_0x20f1ba[0x0])||_['isNil'](_0x20f1ba[0x0][_0x7c7a('0x165')])||_[_0x7c7a('0xa9')](_0x20f1ba[0x0]['Contact'][_0x7c7a('0x164')])){_0x2870da[_0x7c7a('0xcd')](_0x7c7a('0x1fa'),_0x4dbf79,_0x20f1ba[0x0]);}else{_0x2870da[_0x7c7a('0xb6')](_[_0x7c7a('0xd1')](_0x20f1ba[0x0],[_0x7c7a('0xfc'),_0x7c7a('0x1f6')]))[_0x7c7a('0xb4')](_0x2870da[_0x7c7a('0x1df')](_0x4dbf79,_0x20f1ba[0x0]))[_0x7c7a('0xad')](_0x2870da[_0x7c7a('0xcc')](_0x7c7a('0x1fe'),_0x4dbf79));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x4dbf79,0x1));emitVoiceQueueSummary(_0x4dbf79);};Dialer['prototype'][_0x7c7a('0x1d3')]=function(_0x4535ed,_0x119a96,_0x293858,_0x2db7ae,_0x4a5165,_0x5d395f){loggerPredictive['info'](_0x7c7a('0x1ff'));loggerPredictive[_0x7c7a('0x7e')]('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',_0x4535ed);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x200'),_0x119a96);loggerPredictive[_0x7c7a('0x7e')]('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',_0x293858);loggerPredictive['info'](_0x7c7a('0x201'),_0x2db7ae);loggerPredictive['info'](_0x7c7a('0x202'),_0x4a5165);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x84'));return new BPromise(function(_0x17b551,_0x405d13){if(_0x4535ed<=0x0||isNaN(_0x4535ed)){return _0x405d13(msgResponse(_0x7c7a('0x203'),_0x7c7a('0x48'),_0x7c7a('0x204')+_0x4535ed));}if(_0x293858<=0x0||isNaN(_0x293858)){return _0x405d13(msgResponse(_0x7c7a('0x203'),_0x7c7a('0x48'),_0x7c7a('0x205')+_0x293858));}if(_0x2db7ae<=0x0||isNaN(_0x2db7ae)){return _0x405d13(msgResponse(_0x7c7a('0x203'),_0x7c7a('0x48'),'p\x20=\x20'+_0x2db7ae));}if(_0x119a96<=0x0||isNaN(_0x119a96)){return _0x405d13(msgResponse('[abandonmentRate]',_0x7c7a('0x48'),_0x7c7a('0x206')+_0x119a96));}if(_0x4a5165<=0x0||isNaN(_0x4a5165)){return _0x405d13(msgResponse(_0x7c7a('0x203'),_0x7c7a('0x48'),'Amax\x20=\x20'+_0x4a5165));}_0x5d395f=_0x5d395f||0x0;var _0x5bcad5=0x1/_0x293858;var _0xc67851=0x0;var _0x368a97=0x0;var _0x83ee66=0x0;var _0x8b6d3a=0x0;for(var _0xebbb67=0x0;_0x83ee66<_0x4a5165;_0xebbb67+=0x1){_0x368a97=_0xebbb67/_0x119a96;_0xc67851=(_0x2db7ae*_0x368a97+_0x5d395f)/_0x5bcad5;_0x83ee66=erlangb(_0xc67851,_0x4535ed);_0x8b6d3a=_0xc67851/_0x4535ed*(0x1-erlangb(_0xc67851,_0x4535ed));}return _0x17b551({'erlangCalls':_0xebbb67,'erlangCallToSecond':_0x119a96/_0xebbb67,'erlangAbandonmentRate':_0x83ee66,'erlangBusyFactor':_0x8b6d3a});});};Dialer[_0x7c7a('0x1e')][_0x7c7a('0x1d4')]=function(_0x4b1e95,_0x49744c,_0x15a33a,_0x405a8d,_0x353fca,_0x3026a4){loggerPredictive[_0x7c7a('0x7e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x7c7a('0x7e')]('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',_0x4b1e95);loggerPredictive[_0x7c7a('0x7e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49744c);loggerPredictive[_0x7c7a('0x7e')]('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',_0x15a33a);loggerPredictive['info'](_0x7c7a('0x201'),_0x405a8d);loggerPredictive['info'](_0x7c7a('0x207'),_0x353fca);loggerPredictive[_0x7c7a('0x7e')](_0x7c7a('0x84'));return new BPromise(function(_0x3e8f62,_0x152db1){if(_0x4b1e95<=0x0||isNaN(_0x4b1e95)){return _0x152db1(msgResponse(_0x7c7a('0x208'),'Error',_0x7c7a('0x204')+_0x4b1e95));}if(_0x15a33a<=0x0||isNaN(_0x15a33a)){return _0x152db1(msgResponse(_0x7c7a('0x208'),_0x7c7a('0x48'),_0x7c7a('0x205')+_0x15a33a));}if(_0x405a8d<=0x0||isNaN(_0x405a8d)){return _0x152db1(msgResponse('[busyFactor]',_0x7c7a('0x48'),'p\x20=\x20'+_0x405a8d));}if(_0x49744c<=0x0||isNaN(_0x49744c)){return _0x152db1(msgResponse(_0x7c7a('0x208'),_0x7c7a('0x48'),'interval\x20=\x20'+_0x49744c));}if(_0x353fca<=0x0||isNaN(_0x353fca)){return _0x152db1(msgResponse(_0x7c7a('0x208'),_0x7c7a('0x48'),_0x7c7a('0x209')+_0x353fca));}_0x3026a4=_0x3026a4||0x0;var _0x356902=0x1/_0x15a33a;var _0x4a1134=0x0;var _0xbf9e59=0x0;var _0x3e3a7b=0x0;var _0x4757d4=0x0;for(var _0x49ed5e=0x0;_0x4757d4<_0x353fca;_0x49ed5e+=0x1){_0xbf9e59=_0x49ed5e/_0x49744c;_0x4a1134=(_0x405a8d*_0xbf9e59+_0x3026a4)/_0x356902;_0x3e3a7b=erlangb(_0x4a1134,_0x4b1e95);_0x4757d4=_0x4a1134/_0x4b1e95*(0x1-erlangb(_0x4a1134,_0x4b1e95));}return _0x3e8f62({'erlangCalls':_0x49ed5e,'erlangCallToSecond':_0x49744c/_0x49ed5e,'erlangAbandonmentRate':_0x3e3a7b,'erlangBusyFactor':_0x4757d4});});};module[_0x7c7a('0x20a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 7eead6f..9ecc3bc 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 _0xc31c=['talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc31c,0x1a5));var _0xcc31=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc31c[_0x110c3d];return _0x226d67;};'use strict';var util=require(_0xcc31('0x0'));var _=require('lodash');var moment=require(_0xcc31('0x1'));function getSeconds(_0x4289ee,_0xc6e83){var _0x35ebac=moment(_0x4289ee)['milliseconds'](0x0);var _0x444262=moment(_0xc6e83)[_0xcc31('0x2')](0x0);return _0x35ebac[_0xcc31('0x3')](_0x444262,_0xcc31('0x4'));}function QueueCallerAbandon(_0x110dab,_0x2c5b6a){this['scheduledat']=_0x110dab[_0xcc31('0x5')];this['type']=_0x110dab[_0xcc31('0x6')];this[_0xcc31('0x7')]=_0x110dab[_0xcc31('0x6')]===_0xcc31('0x8')?'queue':_0x110dab['type'];this[_0xcc31('0x9')]=_0x110dab[_0xcc31('0x9')];this[_0xcc31('0xa')]=_0x110dab[_0xcc31('0xa')];this[_0xcc31('0xb')]=_0x110dab[_0xcc31('0xb')];this[_0xcc31('0xc')]=_0x110dab['countbusyretry']+_0x110dab['countcongestionretry']+_0x110dab[_0xcc31('0xb')]+_0x110dab['countnosuchnumberretry']+_0x110dab['countdropretry']+_0x110dab[_0xcc31('0xd')]+_0x110dab[_0xcc31('0xe')]+_0x110dab[_0xcc31('0xf')];this['countnosuchnumberretry']=_0x110dab[_0xcc31('0x10')];this[_0xcc31('0x11')]=_0x110dab['countdropretry'];this[_0xcc31('0xd')]=_0x110dab[_0xcc31('0xd')];this[_0xcc31('0xe')]=_0x110dab[_0xcc31('0xe')];this[_0xcc31('0xf')]=_0x110dab[_0xcc31('0xf')];this[_0xcc31('0x12')]=_0x2c5b6a['uniqueid'];this[_0xcc31('0x13')]=_0x110dab[_0xcc31('0x14')];this[_0xcc31('0x15')]=_0x110dab[_0xcc31('0x16')];this[_0xcc31('0x17')]=_0x110dab[_0xcc31('0x17')];this['responsetime']=_0x110dab[_0xcc31('0x18')];this[_0xcc31('0x19')]=_0x110dab[_0xcc31('0x19')];this[_0xcc31('0x1a')]=this[_0xcc31('0x19')];this[_0xcc31('0x1b')]=getSeconds(_0x110dab[_0xcc31('0x18')],_0x110dab['starttime']);this[_0xcc31('0x1c')]=getSeconds(this[_0xcc31('0x19')],_0x110dab[_0xcc31('0x18')]);this[_0xcc31('0x1d')]=0x0;this['queue']=_0x2c5b6a[_0xcc31('0x1e')];this[_0xcc31('0x1f')]=_0x2c5b6a['connectedlinename'];this[_0xcc31('0x20')]=_0x2c5b6a[_0xcc31('0x20')];this[_0xcc31('0x21')]=_0x110dab['callback'];this['callbackuniqueid']=_0x110dab[_0xcc31('0x22')];this[_0xcc31('0x23')]=_0x110dab[_0xcc31('0x23')];this[_0xcc31('0x24')]=_0x110dab[_0xcc31('0x24')];this['ContactId']=_0x110dab[_0xcc31('0x25')];this[_0xcc31('0x26')]=_0x110dab[_0xcc31('0x26')];this[_0xcc31('0x27')]=_0x110dab[_0xcc31('0x27')];this[_0xcc31('0x28')]=_0x110dab['VoiceQueueId'];this[_0xcc31('0x29')]=_0x110dab[_0xcc31('0x29')];this['originatecalleridnum']=_0x110dab[_0xcc31('0x2a')]||'';this[_0xcc31('0x2b')]=_0x110dab[_0xcc31('0x2b')]||'';}module[_0xcc31('0x2c')]=QueueCallerAbandon; \ No newline at end of file +var _0x7ae8=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','droptime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','milliseconds','diff','seconds','scheduledat','type'];(function(_0x2cda37,_0xb5c0e3){var _0x581942=function(_0x362461){while(--_0x362461){_0x2cda37['push'](_0x2cda37['shift']());}};_0x581942(++_0xb5c0e3);}(_0x7ae8,0x142));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require(_0x87ae('0x0'));var moment=require('moment');function getSeconds(_0x419d3d,_0x1a9ebe){var _0x1bf820=moment(_0x419d3d)['milliseconds'](0x0);var _0x2bb442=moment(_0x1a9ebe)[_0x87ae('0x1')](0x0);return _0x1bf820[_0x87ae('0x2')](_0x2bb442,_0x87ae('0x3'));}function QueueCallerAbandon(_0x294d2b,_0x1930fa){this[_0x87ae('0x4')]=_0x294d2b[_0x87ae('0x4')];this[_0x87ae('0x5')]=_0x294d2b['type'];this[_0x87ae('0x6')]=_0x294d2b['type']===_0x87ae('0x7')?_0x87ae('0x8'):_0x294d2b[_0x87ae('0x5')];this[_0x87ae('0x9')]=_0x294d2b[_0x87ae('0x9')];this['countcongestionretry']=_0x294d2b[_0x87ae('0xa')];this['countnoanswerretry']=_0x294d2b[_0x87ae('0xb')];this[_0x87ae('0xc')]=_0x294d2b['countbusyretry']+_0x294d2b[_0x87ae('0xa')]+_0x294d2b['countnoanswerretry']+_0x294d2b[_0x87ae('0xd')]+_0x294d2b[_0x87ae('0xe')]+_0x294d2b[_0x87ae('0xf')]+_0x294d2b[_0x87ae('0x10')]+_0x294d2b[_0x87ae('0x11')];this[_0x87ae('0xd')]=_0x294d2b['countnosuchnumberretry'];this['countdropretry']=_0x294d2b[_0x87ae('0xe')];this['countabandonedretry']=_0x294d2b['countabandonedretry'];this['countmachineretry']=_0x294d2b[_0x87ae('0x10')];this[_0x87ae('0x11')]=_0x294d2b[_0x87ae('0x11')];this[_0x87ae('0x12')]=_0x1930fa['uniqueid'];this[_0x87ae('0x13')]=_0x294d2b[_0x87ae('0x14')];this['calleridnum']=_0x294d2b['number'];this[_0x87ae('0x15')]=_0x294d2b[_0x87ae('0x15')];this[_0x87ae('0x16')]=_0x294d2b[_0x87ae('0x16')];this['droptime']=_0x294d2b['droptime'];this[_0x87ae('0x17')]=this[_0x87ae('0x18')];this['ringtime']=getSeconds(_0x294d2b['responsetime'],_0x294d2b[_0x87ae('0x15')]);this[_0x87ae('0x19')]=getSeconds(this['droptime'],_0x294d2b[_0x87ae('0x16')]);this[_0x87ae('0x1a')]=0x0;this[_0x87ae('0x8')]=_0x1930fa[_0x87ae('0x8')];this[_0x87ae('0x1b')]=_0x1930fa[_0x87ae('0x1c')];this[_0x87ae('0x1d')]=_0x1930fa[_0x87ae('0x1d')];this[_0x87ae('0x1e')]=_0x294d2b[_0x87ae('0x1e')];this[_0x87ae('0x1f')]=_0x294d2b[_0x87ae('0x1f')];this[_0x87ae('0x20')]=_0x294d2b[_0x87ae('0x20')];this[_0x87ae('0x21')]=_0x294d2b[_0x87ae('0x21')];this['ContactId']=_0x294d2b[_0x87ae('0x22')];this[_0x87ae('0x23')]=_0x294d2b[_0x87ae('0x23')];this[_0x87ae('0x24')]=_0x294d2b[_0x87ae('0x24')];this[_0x87ae('0x25')]=_0x294d2b[_0x87ae('0x25')];this[_0x87ae('0x26')]=_0x294d2b['CampaignId'];this[_0x87ae('0x27')]=_0x294d2b[_0x87ae('0x27')]||'';this['originatecalleridname']=_0x294d2b['originatecalleridname']||'';}module[_0x87ae('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 5a69803..345d6d7 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(_0x36b5ec,_0x2ea5a3){var _0x3ac548=function(_0x2bff7b){while(--_0x2bff7b){_0x36b5ec['push'](_0x36b5ec['shift']());}};_0x3ac548(++_0x2ea5a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x273b42,_0x5e6dc3){var _0x4bea0b=function(_0x3b11c9){while(--_0x3b11c9){_0x273b42['push'](_0x273b42['shift']());}};_0x4bea0b(++_0x5e6dc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 affc25a..afa014c 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 _0xe820=['channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstatedesc','prototype','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','reachable','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','bluebird','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage'];(function(_0x16da58,_0x4ffcd8){var _0x3e96c6=function(_0xab9a17){while(--_0xab9a17){_0x16da58['push'](_0x16da58['shift']());}};_0x3e96c6(++_0x4ffcd8);}(_0xe820,0xd2));var _0x0e82=function(_0x48bcff,_0x57984e){_0x48bcff=_0x48bcff-0x0;var _0xbe6ab0=_0xe820[_0x48bcff];return _0xbe6ab0;};'use strict';var util=require(_0x0e82('0x0'));var _=require('lodash');var BPromise=require(_0x0e82('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x0e82('0x2'));var tiff2pdf=require(_0x0e82('0x3'));var gs=require(_0x0e82('0x4'));var logger=require('../../../config/logger')(_0x0e82('0x5'));var ami=require('../ami');var rpcDb=require(_0x0e82('0x6'));var Channel=require(_0x0e82('0x7'));var ut=require(_0x0e82('0x8'));var Action=require(_0x0e82('0x9'));var faxAccount=require(_0x0e82('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x0e82('0xb'));function Fax(_0x33c8a2){this[_0x0e82('0xc')]={};this[_0x0e82('0xd')]=_0x33c8a2[_0x0e82('0xd')];this['trunks']=_0x33c8a2[_0x0e82('0xe')];this[_0x0e82('0xf')]={};ami['on'](_0x0e82('0x10'),this[_0x0e82('0x11')][_0x0e82('0x12')](this));ami['on'](_0x0e82('0x13'),this[_0x0e82('0x14')]['bind'](this));ami['on'](_0x0e82('0x15'),this[_0x0e82('0x16')][_0x0e82('0x12')](this));ami['on'](_0x0e82('0x17'),this[_0x0e82('0x18')][_0x0e82('0x12')](this));ami['on']('faxstatus',this[_0x0e82('0x19')]['bind'](this));ami['on']('receivefax',this[_0x0e82('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x0e82('0x12')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x0e82('0x12')](this));}Fax['prototype'][_0x0e82('0x11')]=function(_0x39cf23){if(_0x39cf23[_0x0e82('0x1b')]===_0x0e82('0x1c')){for(var _0x53622b in this[_0x0e82('0xd')]){if(this[_0x0e82('0xd')][_0x0e82('0x1d')](_0x53622b)){if(_0x39cf23[_0x0e82('0x1e')]===this[_0x0e82('0xd')][_0x53622b][_0x0e82('0x1f')]){this[_0x0e82('0xc')][_0x39cf23[_0x0e82('0x20')]]={};this[_0x0e82('0xc')][_0x39cf23[_0x0e82('0x20')]][_0x0e82('0x21')]=_0x39cf23['channel'];this['channels'][_0x39cf23[_0x0e82('0x20')]]['id']=this[_0x0e82('0xd')][_0x53622b]['id'];this[_0x0e82('0xc')][_0x39cf23[_0x0e82('0x20')]][_0x0e82('0x22')]=this[_0x0e82('0xd')][_0x53622b][_0x0e82('0x22')];logger[_0x0e82('0x23')](_0x39cf23['uniqueid'],_0x0e82('0x24'));}}}}if(this[_0x0e82('0xf')][_0x39cf23[_0x0e82('0x20')]]){this[_0x0e82('0xc')][_0x39cf23['uniqueid']]={};this[_0x0e82('0xc')][_0x39cf23[_0x0e82('0x20')]][_0x0e82('0x21')]=_0x39cf23[_0x0e82('0x21')];logger['info'](_0x39cf23[_0x0e82('0x20')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x0e82('0x14')]=function(_0x168dbe){if(this['channels'][_0x168dbe[_0x0e82('0x20')]]){for(var _0xe3c530 in _0x168dbe[_0x0e82('0x25')]){if(_0x168dbe['variable'][_0x0e82('0x1d')](_0xe3c530)){this[_0x0e82('0xc')][_0x168dbe['uniqueid']][_0xe3c530]=_0x168dbe[_0x0e82('0x26')];}}}};Fax['prototype'][_0x0e82('0x16')]=function(_0x3ec302){if(this['channels'][_0x3ec302[_0x0e82('0x20')]]){this[_0x0e82('0xc')][_0x3ec302[_0x0e82('0x20')]]['channelstate']=_0x3ec302['channelstate'];this[_0x0e82('0xc')][_0x3ec302['uniqueid']][_0x0e82('0x27')]=_0x3ec302['channelstatedesc'];}};Fax[_0x0e82('0x28')][_0x0e82('0x18')]=function(_0x44e177){if(this['channels'][_0x44e177[_0x0e82('0x20')]]){for(var _0x59d2f8 in _0x44e177[_0x0e82('0x25')]){if(_0x44e177[_0x0e82('0x25')][_0x0e82('0x1d')](_0x59d2f8)){this[_0x0e82('0xc')][_0x44e177[_0x0e82('0x20')]][_0x59d2f8]=_0x44e177[_0x0e82('0x26')];}}}};Fax['prototype'][_0x0e82('0x19')]=function(_0x132bc4){if(this[_0x0e82('0xc')][_0x132bc4[_0x0e82('0x20')]]){this[_0x0e82('0xc')][_0x132bc4[_0x0e82('0x20')]][_0x0e82('0x29')]=_0x132bc4[_0x0e82('0x29')];this[_0x0e82('0xc')][_0x132bc4[_0x0e82('0x20')]][_0x0e82('0x2a')]=_0x132bc4[_0x0e82('0x2a')];this[_0x0e82('0xc')][_0x132bc4[_0x0e82('0x20')]][_0x0e82('0x1f')]=_0x132bc4['localstationid'];this[_0x0e82('0xc')][_0x132bc4[_0x0e82('0x20')]][_0x0e82('0x2b')]=_0x132bc4[_0x0e82('0x2b')];logger['info'](_0x132bc4[_0x0e82('0x20')],_0x0e82('0x2c'));}};Fax['prototype'][_0x0e82('0x1a')]=function(_0x57e505){var _0x4a855f=this;if(this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]]){var _0xcf82d5=this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]]['id'];this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]]['remotestationid']=_0x57e505['remotestationid'];this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x2d')]=_0x57e505[_0x0e82('0x2d')];this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x1f')]=_0x57e505[_0x0e82('0x1f')];this['channels'][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x2e')]=_0x57e505[_0x0e82('0x2e')];this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x2f')]=_0x57e505[_0x0e82('0x2f')];this['channels'][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x2b')]=_0x57e505[_0x0e82('0x2b')];this[_0x0e82('0xc')][_0x57e505[_0x0e82('0x20')]][_0x0e82('0x30')]=_0x57e505[_0x0e82('0x30')];if(this['channels'][_0x57e505['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x57e505['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x4a1484){logger[_0x0e82('0x23')](_0x57e505[_0x0e82('0x20')],_0x0e82('0x31'),_0x4a1484[_0x0e82('0x32')]);attachment[_0x0e82('0x33')]({'name':path[_0x0e82('0x34')](_0x57e505[_0x0e82('0x2b')])[_0x0e82('0x22')],'basename':path['parse'](_0x57e505['filename'])[_0x0e82('0x22')]+_0x0e82('0x35'),'type':_0x0e82('0x36')})[_0x0e82('0x37')](function(_0x43a5f2){faxAccount[_0x0e82('0x38')](_0xcf82d5,{'from':_0x57e505[_0x0e82('0x30')],'mapKey':_0x0e82('0x5'),'body':path['parse'](_0x57e505[_0x0e82('0x2b')])['name']+_0x0e82('0x35'),'AttachmentId':_0x43a5f2['id']})['catch'](function(_0x411574){logger['error'](_0x57e505[_0x0e82('0x20')],_0x0e82('0x39'),JSON[_0x0e82('0x3a')](_0x411574));});})['catch'](function(_0x59ee6d){logger[_0x0e82('0x3b')](_0x57e505[_0x0e82('0x20')],_0x0e82('0x3c'),JSON['stringify'](_0x59ee6d));});});}logger[_0x0e82('0x23')](_0x57e505['uniqueid'],_0x0e82('0x3c'));}};Fax[_0x0e82('0x28')][_0x0e82('0x3d')]=function(_0x64406e){if(this[_0x0e82('0xf')][_0x64406e[_0x0e82('0x20')]]){_[_0x0e82('0x3e')](this[_0x0e82('0xc')][_0x64406e[_0x0e82('0x20')]],_[_0x0e82('0x3f')](_0x64406e,[_0x0e82('0x40'),_0x0e82('0x41')]));}};function updateStatus(_0x4e9030){if(_0x4e9030[_0x0e82('0x42')]){faxMessage[_0x0e82('0x43')](_0x4e9030['AttachmentId'],{'failMessage':_0x0e82('0x44')})['then'](function(_0x4a9a16){ut[_0x0e82('0x45')]('[Fax][Message][Error][Updated]',_0x4a9a16);})[_0x0e82('0x46')](function(_0x1006ce){ut[_0x0e82('0x45')](_0x0e82('0x47'),_0x1006ce);});}else{ut[_0x0e82('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x0e82('0x28')]['updateStatus']=function(_0x3e6a16,_0x2a77bd,_0x42c4a7){var _0xe0ee1e=this;var _0x464618={};if(_0x2a77bd){_0x464618={'read':_0x2a77bd};}else{_0x464618={'failMessage':_0x42c4a7};}if(this['actions'][_0x3e6a16][_0x0e82('0x42')]){faxMessage[_0x0e82('0x43')](this[_0x0e82('0xf')][_0x3e6a16][_0x0e82('0x42')],_0x464618)[_0x0e82('0x37')](function(_0x53aaa5){ut[_0x0e82('0x45')](_0x0e82('0x48'),_0x53aaa5);})[_0x0e82('0x46')](function(_0x1e6d69){ut[_0x0e82('0x45')](_0x0e82('0x49'),_0x1e6d69);})[_0x0e82('0x4a')](function(){delete _0xe0ee1e[_0x0e82('0xc')][_0x3e6a16];delete _0xe0ee1e[_0x0e82('0xf')][_0x3e6a16];});}else{ut[_0x0e82('0x45')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x3e6a16];delete this['actions'][_0x3e6a16];}};Fax[_0x0e82('0x28')]['syncHangup']=function(_0x23741c){var _0x3b80aa=this;if(this['channels'][_0x23741c['uniqueid']]){if(this[_0x0e82('0xf')][_0x23741c[_0x0e82('0x20')]]){this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]]['id']=this[_0x0e82('0xf')][_0x23741c[_0x0e82('0x20')]]['id'];this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]][_0x0e82('0x22')]=this[_0x0e82('0xf')][_0x23741c['uniqueid']][_0x0e82('0x22')];}logger[_0x0e82('0x23')](_0x23741c[_0x0e82('0x20')],this[_0x0e82('0xf')][_0x23741c[_0x0e82('0x20')]]?_0x0e82('0x4b'):_0x0e82('0x4c'),JSON[_0x0e82('0x3a')](this['channels'][_0x23741c[_0x0e82('0x20')]]));if(this[_0x0e82('0xf')][_0x23741c[_0x0e82('0x20')]]){if(this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]][_0x0e82('0x4d')]>0x0&&this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]][_0x0e82('0x4e')]==='SUCCESS'){this[_0x0e82('0x4f')](_0x23741c['uniqueid'],!![]);}else{this[_0x0e82('0x4f')](_0x23741c['uniqueid'],![],this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]]['faxstatusstring']?_0x0e82('0x50')+this[_0x0e82('0xc')][_0x23741c[_0x0e82('0x20')]][_0x0e82('0x51')]:_0x0e82('0x52'));}}}};Fax['prototype'][_0x0e82('0x53')]=function(_0x4d5c6e){var _0x5c173e=this;return new BPromise(function(_0x17c402,_0x2cf29f){_0x5c173e[_0x0e82('0x54')](_0x4d5c6e,_0x5c173e[_0x0e82('0xd')][_0x4d5c6e[_0x0e82('0x55')]])[_0x0e82('0x37')](function(_0xb1a061){ut[_0x0e82('0x45')](_0x0e82('0x56'),_0xb1a061);_0x17c402(ut[_0x0e82('0x32')]('Fax\x20received'));})['catch'](function(_0x248d27){ut['logger'](_0x0e82('0x57'),_0x248d27);updateStatus(_0x4d5c6e);_0x2cf29f(ut[_0x0e82('0x32')]('Fax\x20failed'));});});};Fax[_0x0e82('0x28')][_0x0e82('0x58')]=function(_0x4f3940){var _0x3e6445=this;return new BPromise(function(_0x15fdf3,_0x4c7d71){var _0x3cf127=_0x3e6445['checkTrunk'](_0x3e6445[_0x0e82('0xd')][_0x4f3940[_0x0e82('0x55')]][_0x0e82('0x59')],_0x4f3940);if(_0x3cf127[_0x0e82('0x5a')]){_0x15fdf3(ut[_0x0e82('0x32')](_0x0e82('0x5b')));}else{_0x4c7d71(ut[_0x0e82('0x32')](_0x3cf127[_0x0e82('0x32')]));}});};function originate(_0xa97d47,_0x2c632d,_0x4b256f){return new BPromise(function(_0x39911a,_0x4a696b){if(_0x4b256f){var _0x131698=util[_0x0e82('0x5c')](_0x0e82('0x5d'),path['parse'](_0xa97d47[_0x0e82('0x2')])[_0x0e82('0x22')],_0xa97d47[_0x0e82('0x2')]);gs[_0x0e82('0x5e')](_0x131698)[_0x0e82('0x37')](function(){_0xa97d47['path']=util[_0x0e82('0x5c')]('%s/%s.tif',path[_0x0e82('0x34')](_0xa97d47[_0x0e82('0x2')])['dir'],path['parse'](_0xa97d47[_0x0e82('0x2')])[_0x0e82('0x22')]);_0x2c632d[_0x0e82('0x5f')]=_0xa97d47[_0x0e82('0x2')];ut[_0x0e82('0x45')](_0x0e82('0x60'),'');ami[_0x0e82('0x61')](ut[_0x0e82('0x62')](_0xa97d47,_0x2c632d))[_0x0e82('0x37')](function(_0x4d5cc7){_0x39911a(_0x4d5cc7);})[_0x0e82('0x46')](function(_0x328d74){_0x4a696b(_0x328d74);});})['catch'](function(_0x4e34ba){_0x4a696b(_0x4e34ba);});}else{ami['Action'](ut[_0x0e82('0x62')](_0xa97d47,_0x2c632d))[_0x0e82('0x37')](function(_0x28ec5){_0x39911a(_0x28ec5);})['catch'](function(_0x3dd6ab){_0x4a696b(_0x3dd6ab);});}});}Fax['prototype'][_0x0e82('0x54')]=function(_0x354ef9,_0x23f57b){var _0xe1c5f6=this;return new BPromise(function(_0x3457bc,_0x48ac18){var _0x28097c=uuid['v4']();var _0x28eb04=ut['addVariables'](_0x354ef9,_0x23f57b);_0xe1c5f6[_0x0e82('0xf')][_0x28097c]=new Action(_0x28097c,_0x23f57b,_0x354ef9);var _0x193b05=_0xe1c5f6[_0x0e82('0xf')][_0x28097c];if(path['parse'](_0x354ef9[_0x0e82('0x2')])['ext']===_0x0e82('0x35')){originate(_0x193b05,_0x28eb04,!![])[_0x0e82('0x37')](function(_0x36d95a){_0x3457bc(_0x36d95a);})[_0x0e82('0x46')](function(_0xe258d4){_0x48ac18(_0xe258d4);});}else{originate(_0x193b05,_0x28eb04,![])[_0x0e82('0x37')](function(_0x203f3d){_0x3457bc(_0x203f3d);})[_0x0e82('0x46')](function(_0x4a1e4d){_0x48ac18(_0x4a1e4d);});}});};Fax[_0x0e82('0x28')][_0x0e82('0x63')]=function(_0x168bf1){return!_[_0x0e82('0x64')](_0x168bf1)&&!_[_0x0e82('0x64')](_0x168bf1['name'])&&!_[_0x0e82('0x64')](_0x168bf1['active'])&&_0x168bf1[_0x0e82('0x65')]&&!_['isNil'](this[_0x0e82('0xe')][util[_0x0e82('0x5c')]('SIP/%s',_0x168bf1[_0x0e82('0x22')])])&&!_[_0x0e82('0x64')](this[_0x0e82('0xe')][util['format']('SIP/%s',_0x168bf1['name'])][_0x0e82('0x2a')])&&(this[_0x0e82('0xe')][util[_0x0e82('0x5c')]('SIP/%s',_0x168bf1[_0x0e82('0x22')])][_0x0e82('0x2a')]===_0x0e82('0x66')||this[_0x0e82('0xe')][util[_0x0e82('0x5c')](_0x0e82('0x67'),_0x168bf1[_0x0e82('0x22')])][_0x0e82('0x2a')]==='unmonitored');};Fax[_0x0e82('0x28')][_0x0e82('0x68')]=function(_0x2ffc69,_0x1ee1dd){if(!this[_0x0e82('0x63')](_0x2ffc69)){ut[_0x0e82('0x45')](_0x0e82('0x69'),_[_0x0e82('0x64')](_0x2ffc69)?'':_0x2ffc69['name']+_0x0e82('0x6a'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x1ee1dd['fax'])){ut[_0x0e82('0x45')](_0x0e82('0x6b'),JSON[_0x0e82('0x3a')](_0x1ee1dd));return{'isValid':![],'message':_0x0e82('0x6c')};}if(_['isNil'](_0x1ee1dd[_0x0e82('0x2')])){ut['logger'](_0x0e82('0x6d'),JSON[_0x0e82('0x3a')](_0x1ee1dd));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x0e82('0x6e')};};module['exports']=Fax; \ No newline at end of file +var _0xfef3=['[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','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','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','bluebird','moment','path','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','fax','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0xfef3,0x118));var _0x3fef=function(_0x54d5ac,_0x31a3f8){_0x54d5ac=_0x54d5ac-0x0;var _0x28dc98=_0xfef3[_0x54d5ac];return _0x28dc98;};'use strict';var util=require(_0x3fef('0x0'));var _=require('lodash');var BPromise=require(_0x3fef('0x1'));var uuid=require('uuid');var moment=require(_0x3fef('0x2'));var path=require(_0x3fef('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('fax');var ami=require(_0x3fef('0x6'));var rpcDb=require(_0x3fef('0x7'));var Channel=require('./channel');var ut=require(_0x3fef('0x8'));var Action=require(_0x3fef('0x9'));var faxAccount=require(_0x3fef('0xa'));var attachment=require(_0x3fef('0xb'));var faxMessage=require(_0x3fef('0xc'));function Fax(_0x41960c){this[_0x3fef('0xd')]={};this[_0x3fef('0xe')]=_0x41960c[_0x3fef('0xe')];this[_0x3fef('0xf')]=_0x41960c[_0x3fef('0xf')];this[_0x3fef('0x10')]={};ami['on'](_0x3fef('0x11'),this[_0x3fef('0x12')]['bind'](this));ami['on'](_0x3fef('0x13'),this[_0x3fef('0x14')][_0x3fef('0x15')](this));ami['on']('newstate',this[_0x3fef('0x16')]['bind'](this));ami['on'](_0x3fef('0x17'),this[_0x3fef('0x18')][_0x3fef('0x15')](this));ami['on']('faxstatus',this[_0x3fef('0x19')]['bind'](this));ami['on'](_0x3fef('0x1a'),this[_0x3fef('0x1b')]['bind'](this));ami['on'](_0x3fef('0x1c'),this[_0x3fef('0x1d')][_0x3fef('0x15')](this));ami['on'](_0x3fef('0x1e'),this[_0x3fef('0x1f')][_0x3fef('0x15')](this));}Fax['prototype'][_0x3fef('0x12')]=function(_0x5b969a){if(_0x5b969a[_0x3fef('0x20')]===_0x3fef('0x21')){for(var _0x1613ad in this[_0x3fef('0xe')]){if(this['faxAccounts'][_0x3fef('0x22')](_0x1613ad)){if(_0x5b969a[_0x3fef('0x23')]===this['faxAccounts'][_0x1613ad][_0x3fef('0x24')]){this[_0x3fef('0xd')][_0x5b969a[_0x3fef('0x25')]]={};this[_0x3fef('0xd')][_0x5b969a[_0x3fef('0x25')]][_0x3fef('0x26')]=_0x5b969a[_0x3fef('0x26')];this[_0x3fef('0xd')][_0x5b969a[_0x3fef('0x25')]]['id']=this[_0x3fef('0xe')][_0x1613ad]['id'];this[_0x3fef('0xd')][_0x5b969a[_0x3fef('0x25')]][_0x3fef('0x27')]=this[_0x3fef('0xe')][_0x1613ad][_0x3fef('0x27')];logger['info'](_0x5b969a['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x3fef('0x10')][_0x5b969a[_0x3fef('0x25')]]){this[_0x3fef('0xd')][_0x5b969a['uniqueid']]={};this[_0x3fef('0xd')][_0x5b969a['uniqueid']][_0x3fef('0x26')]=_0x5b969a[_0x3fef('0x26')];logger[_0x3fef('0x28')](_0x5b969a[_0x3fef('0x25')],_0x3fef('0x29'));}};Fax['prototype']['syncVarSet']=function(_0x563556){if(this[_0x3fef('0xd')][_0x563556[_0x3fef('0x25')]]){for(var _0x4ea2ab in _0x563556[_0x3fef('0x2a')]){if(_0x563556[_0x3fef('0x2a')]['hasOwnProperty'](_0x4ea2ab)){this[_0x3fef('0xd')][_0x563556[_0x3fef('0x25')]][_0x4ea2ab]=_0x563556[_0x3fef('0x2b')];}}}};Fax[_0x3fef('0x2c')][_0x3fef('0x16')]=function(_0x137849){if(this[_0x3fef('0xd')][_0x137849['uniqueid']]){this[_0x3fef('0xd')][_0x137849[_0x3fef('0x25')]][_0x3fef('0x2d')]=_0x137849[_0x3fef('0x2d')];this['channels'][_0x137849[_0x3fef('0x25')]]['channelstatedesc']=_0x137849[_0x3fef('0x2e')];}};Fax[_0x3fef('0x2c')][_0x3fef('0x18')]=function(_0x1136b3){if(this[_0x3fef('0xd')][_0x1136b3[_0x3fef('0x25')]]){for(var _0x355c03 in _0x1136b3[_0x3fef('0x2a')]){if(_0x1136b3[_0x3fef('0x2a')][_0x3fef('0x22')](_0x355c03)){this['channels'][_0x1136b3['uniqueid']][_0x355c03]=_0x1136b3[_0x3fef('0x2b')];}}}};Fax['prototype'][_0x3fef('0x19')]=function(_0x1503c5){if(this[_0x3fef('0xd')][_0x1503c5[_0x3fef('0x25')]]){this[_0x3fef('0xd')][_0x1503c5[_0x3fef('0x25')]][_0x3fef('0x2f')]=_0x1503c5[_0x3fef('0x2f')];this[_0x3fef('0xd')][_0x1503c5[_0x3fef('0x25')]][_0x3fef('0x30')]=_0x1503c5[_0x3fef('0x30')];this[_0x3fef('0xd')][_0x1503c5[_0x3fef('0x25')]]['localstationid']=_0x1503c5[_0x3fef('0x24')];this[_0x3fef('0xd')][_0x1503c5[_0x3fef('0x25')]][_0x3fef('0x31')]=_0x1503c5[_0x3fef('0x31')];logger[_0x3fef('0x28')](_0x1503c5['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x3fef('0x2c')][_0x3fef('0x1b')]=function(_0x42490a){var _0x12f1be=this;if(this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]]){var _0x736045=this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]]['id'];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]]['remotestationid']=_0x42490a[_0x3fef('0x32')];this[_0x3fef('0xd')][_0x42490a['uniqueid']]['pagestransferred']=_0x42490a[_0x3fef('0x33')];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x24')]=_0x42490a[_0x3fef('0x24')];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x34')]=_0x42490a['resolution'];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x35')]=_0x42490a[_0x3fef('0x35')];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x31')]=_0x42490a[_0x3fef('0x31')];this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x36')]=_0x42490a[_0x3fef('0x36')];if(this[_0x3fef('0xd')][_0x42490a[_0x3fef('0x25')]][_0x3fef('0x33')]>0x0){tiff2pdf(_0x42490a['filename'],_0x3fef('0x37'),function(_0x3d3738){logger[_0x3fef('0x28')](_0x42490a[_0x3fef('0x25')],_0x3fef('0x38'),_0x3d3738[_0x3fef('0x39')]);attachment['create']({'name':path[_0x3fef('0x3a')](_0x42490a['filename'])[_0x3fef('0x27')],'basename':path[_0x3fef('0x3a')](_0x42490a['filename'])[_0x3fef('0x27')]+'.pdf','type':_0x3fef('0x3b')})[_0x3fef('0x3c')](function(_0x1bb81f){faxAccount[_0x3fef('0x3d')](_0x736045,{'from':_0x42490a[_0x3fef('0x36')],'mapKey':_0x3fef('0x3e'),'body':path[_0x3fef('0x3a')](_0x42490a[_0x3fef('0x31')])[_0x3fef('0x27')]+_0x3fef('0x3f'),'AttachmentId':_0x1bb81f['id']})[_0x3fef('0x40')](function(_0x3e96c9){logger[_0x3fef('0x41')](_0x42490a['uniqueid'],_0x3fef('0x42'),JSON[_0x3fef('0x43')](_0x3e96c9));});})['catch'](function(_0x186e8f){logger[_0x3fef('0x41')](_0x42490a[_0x3fef('0x25')],'\x20receiveFax\x20',JSON[_0x3fef('0x43')](_0x186e8f));});});}logger[_0x3fef('0x28')](_0x42490a['uniqueid'],_0x3fef('0x44'));}};Fax['prototype']['syncOriginateResponse']=function(_0x15fb2c){if(this['actions'][_0x15fb2c[_0x3fef('0x25')]]){_[_0x3fef('0x45')](this['channels'][_0x15fb2c[_0x3fef('0x25')]],_[_0x3fef('0x46')](_0x15fb2c,[_0x3fef('0x47'),'reason']));}};function updateStatus(_0x2ef3c8){if(_0x2ef3c8[_0x3fef('0x48')]){faxMessage[_0x3fef('0x49')](_0x2ef3c8['AttachmentId'],{'failMessage':_0x3fef('0x4a')})[_0x3fef('0x3c')](function(_0x2a6b71){ut[_0x3fef('0x4b')](_0x3fef('0x4c'),_0x2a6b71);})['catch'](function(_0x35db07){ut[_0x3fef('0x4b')](_0x3fef('0x4d'),_0x35db07);});}else{ut[_0x3fef('0x4b')](_0x3fef('0x4e'));}}Fax[_0x3fef('0x2c')][_0x3fef('0x4f')]=function(_0x1431b8,_0x2c9f73,_0x4862a5){var _0x5cdbd6=this;var _0x436337={};if(_0x2c9f73){_0x436337={'read':_0x2c9f73};}else{_0x436337={'failMessage':_0x4862a5};}if(this[_0x3fef('0x10')][_0x1431b8][_0x3fef('0x48')]){faxMessage[_0x3fef('0x49')](this[_0x3fef('0x10')][_0x1431b8][_0x3fef('0x48')],_0x436337)[_0x3fef('0x3c')](function(_0x17e188){ut[_0x3fef('0x4b')](_0x3fef('0x50'),_0x17e188);})[_0x3fef('0x40')](function(_0x109fac){ut['logger'](_0x3fef('0x51'),_0x109fac);})[_0x3fef('0x52')](function(){delete _0x5cdbd6[_0x3fef('0xd')][_0x1431b8];delete _0x5cdbd6[_0x3fef('0x10')][_0x1431b8];});}else{ut['logger'](_0x3fef('0x53'));delete this[_0x3fef('0xd')][_0x1431b8];delete this[_0x3fef('0x10')][_0x1431b8];}};Fax[_0x3fef('0x2c')]['syncHangup']=function(_0x189d48){var _0x26b6a8=this;if(this[_0x3fef('0xd')][_0x189d48['uniqueid']]){if(this['actions'][_0x189d48[_0x3fef('0x25')]]){this[_0x3fef('0xd')][_0x189d48[_0x3fef('0x25')]]['id']=this[_0x3fef('0x10')][_0x189d48['uniqueid']]['id'];this[_0x3fef('0xd')][_0x189d48['uniqueid']][_0x3fef('0x27')]=this['actions'][_0x189d48[_0x3fef('0x25')]]['name'];}logger[_0x3fef('0x28')](_0x189d48[_0x3fef('0x25')],this[_0x3fef('0x10')][_0x189d48['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x3fef('0x54'),JSON[_0x3fef('0x43')](this[_0x3fef('0xd')][_0x189d48[_0x3fef('0x25')]]));if(this[_0x3fef('0x10')][_0x189d48[_0x3fef('0x25')]]){if(this[_0x3fef('0xd')][_0x189d48[_0x3fef('0x25')]]['faxpages']>0x0&&this[_0x3fef('0xd')][_0x189d48['uniqueid']]['faxstatus']===_0x3fef('0x55')){this[_0x3fef('0x4f')](_0x189d48[_0x3fef('0x25')],!![]);}else{this[_0x3fef('0x4f')](_0x189d48[_0x3fef('0x25')],![],this[_0x3fef('0xd')][_0x189d48[_0x3fef('0x25')]][_0x3fef('0x56')]?_0x3fef('0x57')+this['channels'][_0x189d48[_0x3fef('0x25')]]['faxstatusstring']:_0x3fef('0x58'));}}}};Fax[_0x3fef('0x2c')][_0x3fef('0x59')]=function(_0x46d6c8){var _0x400c45=this;return new BPromise(function(_0x39c57f,_0x4a4631){_0x400c45[_0x3fef('0x5a')](_0x46d6c8,_0x400c45[_0x3fef('0xe')][_0x46d6c8[_0x3fef('0x5b')]])[_0x3fef('0x3c')](function(_0x6cc4a3){ut[_0x3fef('0x4b')](_0x3fef('0x5c'),_0x6cc4a3);_0x39c57f(ut[_0x3fef('0x39')](_0x3fef('0x5d')));})[_0x3fef('0x40')](function(_0x134344){ut['logger'](_0x3fef('0x5e'),_0x134344);updateStatus(_0x46d6c8);_0x4a4631(ut['message']('Fax\x20failed'));});});};Fax['prototype'][_0x3fef('0x5f')]=function(_0x52d915){var _0x3d89b1=this;return new BPromise(function(_0x19daae,_0xc6d7c9){var _0x5a45ff=_0x3d89b1[_0x3fef('0x60')](_0x3d89b1['faxAccounts'][_0x52d915[_0x3fef('0x5b')]][_0x3fef('0x61')],_0x52d915);if(_0x5a45ff['isValid']){_0x19daae(ut[_0x3fef('0x39')](_0x3fef('0x62')));}else{_0xc6d7c9(ut[_0x3fef('0x39')](_0x5a45ff[_0x3fef('0x39')]));}});};function originate(_0xb68294,_0x2237f8,_0x1e2d38){return new BPromise(function(_0x1362ce,_0x4fde10){if(_0x1e2d38){var _0x25467e=util[_0x3fef('0x63')](_0x3fef('0x64'),path[_0x3fef('0x3a')](_0xb68294[_0x3fef('0x3')])[_0x3fef('0x27')],_0xb68294[_0x3fef('0x3')]);gs[_0x3fef('0x65')](_0x25467e)[_0x3fef('0x3c')](function(){_0xb68294[_0x3fef('0x3')]=util[_0x3fef('0x63')](_0x3fef('0x66'),path[_0x3fef('0x3a')](_0xb68294[_0x3fef('0x3')])['dir'],path[_0x3fef('0x3a')](_0xb68294[_0x3fef('0x3')])[_0x3fef('0x27')]);_0x2237f8['XMF-PATH']=_0xb68294['path'];ut['logger'](_0x3fef('0x67'),'');ami[_0x3fef('0x68')](ut[_0x3fef('0x69')](_0xb68294,_0x2237f8))[_0x3fef('0x3c')](function(_0x530f72){_0x1362ce(_0x530f72);})[_0x3fef('0x40')](function(_0x17856b){_0x4fde10(_0x17856b);});})[_0x3fef('0x40')](function(_0x31b9dc){_0x4fde10(_0x31b9dc);});}else{ami['Action'](ut[_0x3fef('0x69')](_0xb68294,_0x2237f8))[_0x3fef('0x3c')](function(_0x26248c){_0x1362ce(_0x26248c);})[_0x3fef('0x40')](function(_0x5cd60a){_0x4fde10(_0x5cd60a);});}});}Fax['prototype'][_0x3fef('0x5a')]=function(_0x552b79,_0x42c258){var _0x5a1fbf=this;return new BPromise(function(_0x25431a,_0x13b272){var _0x2948c4=uuid['v4']();var _0x128c9b=ut[_0x3fef('0x6a')](_0x552b79,_0x42c258);_0x5a1fbf[_0x3fef('0x10')][_0x2948c4]=new Action(_0x2948c4,_0x42c258,_0x552b79);var _0x30f463=_0x5a1fbf[_0x3fef('0x10')][_0x2948c4];if(path[_0x3fef('0x3a')](_0x552b79['path'])[_0x3fef('0x6b')]===_0x3fef('0x3f')){originate(_0x30f463,_0x128c9b,!![])[_0x3fef('0x3c')](function(_0x1515fb){_0x25431a(_0x1515fb);})['catch'](function(_0x766e5d){_0x13b272(_0x766e5d);});}else{originate(_0x30f463,_0x128c9b,![])[_0x3fef('0x3c')](function(_0x334bc2){_0x25431a(_0x334bc2);})[_0x3fef('0x40')](function(_0x447886){_0x13b272(_0x447886);});}});};Fax[_0x3fef('0x2c')]['isTrunkReachable']=function(_0x34aecb){return!_[_0x3fef('0x6c')](_0x34aecb)&&!_[_0x3fef('0x6c')](_0x34aecb[_0x3fef('0x27')])&&!_[_0x3fef('0x6c')](_0x34aecb[_0x3fef('0x6d')])&&_0x34aecb['active']&&!_[_0x3fef('0x6c')](this[_0x3fef('0xf')][util[_0x3fef('0x63')](_0x3fef('0x6e'),_0x34aecb[_0x3fef('0x27')])])&&!_['isNil'](this[_0x3fef('0xf')][util[_0x3fef('0x63')](_0x3fef('0x6e'),_0x34aecb['name'])][_0x3fef('0x30')])&&(this[_0x3fef('0xf')][util[_0x3fef('0x63')]('SIP/%s',_0x34aecb['name'])][_0x3fef('0x30')]===_0x3fef('0x6f')||this[_0x3fef('0xf')][util[_0x3fef('0x63')]('SIP/%s',_0x34aecb[_0x3fef('0x27')])][_0x3fef('0x30')]===_0x3fef('0x70'));};Fax['prototype'][_0x3fef('0x60')]=function(_0x25f4e1,_0x3dcff5){if(!this[_0x3fef('0x71')](_0x25f4e1)){ut[_0x3fef('0x4b')](_0x3fef('0x72'),_[_0x3fef('0x6c')](_0x25f4e1)?'':_0x25f4e1['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3fef('0x73')};}if(_['isNil'](_0x3dcff5[_0x3fef('0x3e')])){ut[_0x3fef('0x4b')](_0x3fef('0x74'),JSON['stringify'](_0x3dcff5));return{'isValid':![],'message':_0x3fef('0x75')};}if(_['isNil'](_0x3dcff5[_0x3fef('0x3')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x3dcff5));return{'isValid':![],'message':_0x3fef('0x76')};}return{'isValid':!![],'message':_0x3fef('0x77')};};module[_0x3fef('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ae6fcc6..64c15d8 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 _0xbc33=['notify','resolve','catch','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x488d54,_0x2169a1){var _0x3397e3=function(_0x4d3dcf){while(--_0x4d3dcf){_0x488d54['push'](_0x488d54['shift']());}};_0x3397e3(++_0x2169a1);}(_0xbc33,0x14d));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3bc3('0x0'));var BPromise=require(_0x3bc3('0x1'));var logger=require(_0x3bc3('0x2'))(_0x3bc3('0x3'));var _=require(_0x3bc3('0x4'));var faxAccount=require(_0x3bc3('0x5'));function loggerCatch(_0x34c7ac){return function(_0xfa51b6){logger[_0x3bc3('0x6')](_0x34c7ac,util[_0x3bc3('0x7')](_0xfa51b6,{'showHidden':![],'depth':null}));};}exports[_0x3bc3('0x8')]=function(_0x311954,_0x149e35){return BPromise[_0x3bc3('0x9')]()['then'](faxAccount[_0x3bc3('0x8')](_0x311954,_0x149e35))[_0x3bc3('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xa4ed=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','inspect','notify'];(function(_0x48bc52,_0x4634f8){var _0x6f578f=function(_0x524dcc){while(--_0x524dcc){_0x48bc52['push'](_0x48bc52['shift']());}};_0x6f578f(++_0x4634f8);}(_0xa4ed,0xa3));var _0xda4e=function(_0x26c4b7,_0x21c93a){_0x26c4b7=_0x26c4b7-0x0;var _0x7cd1c9=_0xa4ed[_0x26c4b7];return _0x7cd1c9;};'use strict';var util=require(_0xda4e('0x0'));var BPromise=require(_0xda4e('0x1'));var logger=require(_0xda4e('0x2'))('preview');var _=require(_0xda4e('0x3'));var faxAccount=require(_0xda4e('0x4'));function loggerCatch(_0x26c708){return function(_0x2f3e83){logger['error'](_0x26c708,util[_0xda4e('0x5')](_0x2f3e83,{'showHidden':![],'depth':null}));};}exports[_0xda4e('0x6')]=function(_0x178b2a,_0xcdf3d8){return BPromise['resolve']()[_0xda4e('0x7')](faxAccount[_0xda4e('0x6')](_0x178b2a,_0xcdf3d8))[_0xda4e('0x8')](loggerCatch(_0xda4e('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 4ac3d98..d96b3c5 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 _0x18c5=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x429b63,_0x3ff026){var _0x703972=function(_0x3bd776){while(--_0x3bd776){_0x429b63['push'](_0x429b63['shift']());}};_0x703972(++_0x3ff026);}(_0x18c5,0x197));var _0x518c=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x18c5[_0x57014b];return _0x2b258a;};'use strict';var util=require(_0x518c('0x0'));var logger=require(_0x518c('0x1'))(_0x518c('0x2'));var BPromise=require(_0x518c('0x3'));var exec=require(_0x518c('0x4'))[_0x518c('0x5')];exports[_0x518c('0x6')]=function(_0x268e91){return new BPromise(function(_0x1adcbb,_0x22a895){exec(_0x268e91,function(_0x147c6b,_0x263735,_0x26f52b){logger[_0x518c('0x7')](_0x518c('0x8'),_0x263735);if(_0x147c6b){logger[_0x518c('0x7')](_0x518c('0x8'),_0x518c('0x9'),util[_0x518c('0xa')](_0x147c6b,{'showHidden':![],'depth':null}),_0x263735,_0x26f52b);_0x22a895(_0x147c6b);}_0x1adcbb(_0x263735);});});}; \ No newline at end of file +var _0x2adf=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','exec'];(function(_0x5d8707,_0x315736){var _0x4575e4=function(_0x150f3c){while(--_0x150f3c){_0x5d8707['push'](_0x5d8707['shift']());}};_0x4575e4(++_0x315736);}(_0x2adf,0x113));var _0xf2ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2adf[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf2ad('0x0'));var logger=require(_0xf2ad('0x1'))('fax');var BPromise=require(_0xf2ad('0x2'));var exec=require('child_process')[_0xf2ad('0x3')];exports[_0xf2ad('0x4')]=function(_0x3f1dce){return new BPromise(function(_0x127c0d,_0x1ee81b){exec(_0x3f1dce,function(_0x34676a,_0x46a46b,_0x2a603e){logger[_0xf2ad('0x5')](_0xf2ad('0x6'),_0x46a46b);if(_0x34676a){logger['info']('Exec\x20gs',_0xf2ad('0x7'),util[_0xf2ad('0x8')](_0x34676a,{'showHidden':![],'depth':null}),_0x46a46b,_0x2a603e);_0x1ee81b(_0x34676a);}_0x127c0d(_0x46a46b);});});}; \ 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 3dcb5fa..b01f281 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 _0x78ed=['fax','logger','info','inspect','addVariables','ecm','headerinfo','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','from-sip','format','localstationid','util','lodash','moment','../../../../config/logger'];(function(_0xb98696,_0x14ba9e){var _0x23ae71=function(_0x6dcb9c){while(--_0x6dcb9c){_0xb98696['push'](_0xb98696['shift']());}};_0x23ae71(++_0x14ba9e);}(_0x78ed,0x104));var _0xd78e=function(_0x5bf04d,_0x16288d){_0x5bf04d=_0x5bf04d-0x0;var _0x582508=_0x78ed[_0x5bf04d];return _0x582508;};'use strict';var util=require(_0xd78e('0x0'));var _=require(_0xd78e('0x1'));var moment=require(_0xd78e('0x2'));var logger=require(_0xd78e('0x3'))(_0xd78e('0x4'));exports['message']=function(_0x1f48ee){return{'message':_0x1f48ee};};exports[_0xd78e('0x5')]=function(_0x240f23,_0x2a8e82){logger[_0xd78e('0x6')](_0x240f23,util[_0xd78e('0x7')](_0x2a8e82,{'showHidden':![],'depth':null}));};exports[_0xd78e('0x8')]=function(_0x3fe4ca,_0xd1ba80){var _0x2f3427={'XMF-ECM':_0xd1ba80[_0xd78e('0x9')],'XMF-HEADERINFO':_0xd1ba80[_0xd78e('0xa')],'XMF-MINRATE':_0xd1ba80['minrate'],'XMF-MAXRATE':_0xd1ba80['maxrate'],'XMF-MODEM':util['format'](_0xd78e('0xb'),_0xd1ba80[_0xd78e('0xc')]),'XMF-GATEWAY':_0xd1ba80[_0xd78e('0xd')],'XMF-FAXDETECT':_0xd1ba80[_0xd78e('0xe')],'XMF-T38TIMEOUT':_0xd1ba80[_0xd78e('0xf')],'XMF-LOCALSTATIONID':_0xd1ba80['localstationid'],'XMF-PATH':_0x3fe4ca[_0xd78e('0x10')]};return _0x2f3427;};exports[_0xd78e('0x11')]=function(_0x294bf9,_0x4c3d30){return{'actionid':_0x294bf9[_0xd78e('0x12')],'action':_0xd78e('0x13'),'channel':_0x294bf9[_0xd78e('0x14')],'Exten':'xcally-motion-fax','Context':_0xd78e('0x15'),'Priority':'1','callerid':util[_0xd78e('0x16')]('\x22%s\x22\x20<%s>',_0x294bf9[_0xd78e('0xa')]?_0x294bf9[_0xd78e('0xa')]:'',_0x294bf9[_0xd78e('0x17')]),'variable':_0x4c3d30,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x294bf9[_0xd78e('0x12')]};}; \ No newline at end of file +var _0xfa36=['logger','inspect','ecm','headerinfo','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0xfa36,0x136));var _0x6fa3=function(_0x4a7f3c,_0x74b703){_0x4a7f3c=_0x4a7f3c-0x0;var _0x89d3ae=_0xfa36[_0x4a7f3c];return _0x89d3ae;};'use strict';var util=require(_0x6fa3('0x0'));var _=require(_0x6fa3('0x1'));var moment=require(_0x6fa3('0x2'));var logger=require(_0x6fa3('0x3'))(_0x6fa3('0x4'));exports['message']=function(_0x3f614b){return{'message':_0x3f614b};};exports[_0x6fa3('0x5')]=function(_0x24794c,_0x40f8d5){logger['info'](_0x24794c,util[_0x6fa3('0x6')](_0x40f8d5,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x12c983,_0x254efe){var _0x45a87d={'XMF-ECM':_0x254efe[_0x6fa3('0x7')],'XMF-HEADERINFO':_0x254efe[_0x6fa3('0x8')],'XMF-MINRATE':_0x254efe['minrate'],'XMF-MAXRATE':_0x254efe[_0x6fa3('0x9')],'XMF-MODEM':util['format'](_0x6fa3('0xa'),_0x254efe['modem']),'XMF-GATEWAY':_0x254efe[_0x6fa3('0xb')],'XMF-FAXDETECT':_0x254efe[_0x6fa3('0xc')],'XMF-T38TIMEOUT':_0x254efe[_0x6fa3('0xd')],'XMF-LOCALSTATIONID':_0x254efe['localstationid'],'XMF-PATH':_0x12c983[_0x6fa3('0xe')]};return _0x45a87d;};exports[_0x6fa3('0xf')]=function(_0x2e0c84,_0x106e09){return{'actionid':_0x2e0c84[_0x6fa3('0x10')],'action':'originate','channel':_0x2e0c84[_0x6fa3('0x11')],'Exten':_0x6fa3('0x12'),'Context':_0x6fa3('0x13'),'Priority':'1','callerid':util['format'](_0x6fa3('0x14'),_0x2e0c84[_0x6fa3('0x8')]?_0x2e0c84[_0x6fa3('0x8')]:'',_0x2e0c84['localstationid']),'variable':_0x106e09,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2e0c84[_0x6fa3('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index af17f0b..48aeeda 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 _0x3856=['initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','then','getAgents','initAgents','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts'];(function(_0x4ee88f,_0x736119){var _0x9a3a51=function(_0x1d0de4){while(--_0x1d0de4){_0x4ee88f['push'](_0x4ee88f['shift']());}};_0x9a3a51(++_0x736119);}(_0x3856,0xfb));var _0x6385=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3856[_0x22ffbf];return _0x360c17;};'use strict';var BPromise=require(_0x6385('0x0'));var util=require('util');var moment=require(_0x6385('0x1'));var server=require(_0x6385('0x2'));var Realtime=require(_0x6385('0x3'));var Report=require(_0x6385('0x4'));var Acw=require(_0x6385('0x5'));var Trigger=require(_0x6385('0x6'));var Dialer=require(_0x6385('0x7'));var Preview=require(_0x6385('0x8'));var Fax=require('./fax');var user=require(_0x6385('0x9'));var voiceQueue=require(_0x6385('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x6385('0xb'));var trunk=require(_0x6385('0xc'));var trigger=require(_0x6385('0xd'));var template=require(_0x6385('0xe'));var cmHopperHistory=require(_0x6385('0xf'));var campaign=require(_0x6385('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x6385('0x11'));var zendesk=require(_0x6385('0x12'));var salesforce=require(_0x6385('0x13'));var sugarcrm=require(_0x6385('0x14'));var freshdesk=require(_0x6385('0x15'));var desk=require(_0x6385('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x6385('0x17'));var freshsales=require(_0x6385('0x18'));var servicenow=require(_0x6385('0x19'));var dynamics365=require(_0x6385('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6385('0x1b'))(_0x6385('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x6385('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6385('0x1e')](_0x6385('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x6385('0x1f')](user[_0x6385('0x20')]())['then'](realtime[_0x6385('0x21')]())['then'](user['getTelephones']())[_0x6385('0x1f')](realtime['initTelephones']())[_0x6385('0x1f')](trunk['getTrunks']())[_0x6385('0x1f')](realtime['initTrunks']())[_0x6385('0x1f')](voiceQueue[_0x6385('0x22')]())[_0x6385('0x1f')](realtime[_0x6385('0x23')]())[_0x6385('0x1f')](trigger[_0x6385('0x24')]())[_0x6385('0x1f')](realtime[_0x6385('0x25')]())[_0x6385('0x1f')](template[_0x6385('0x26')]())[_0x6385('0x1f')](realtime[_0x6385('0x27')]())['then'](zendesk[_0x6385('0x28')]())['then'](realtime[_0x6385('0x29')]())[_0x6385('0x1f')](salesforce[_0x6385('0x2a')]())[_0x6385('0x1f')](realtime[_0x6385('0x2b')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x6385('0x1f')](realtime[_0x6385('0x2c')]())['then'](freshdesk[_0x6385('0x2d')]())[_0x6385('0x1f')](realtime[_0x6385('0x2e')]())[_0x6385('0x1f')](desk['getDeskAccounts']())[_0x6385('0x1f')](realtime[_0x6385('0x2f')]())[_0x6385('0x1f')](zoho['getZohoAccounts']())[_0x6385('0x1f')](realtime[_0x6385('0x30')]())[_0x6385('0x1f')](vtiger[_0x6385('0x31')]())[_0x6385('0x1f')](realtime[_0x6385('0x32')]())[_0x6385('0x1f')](freshsales[_0x6385('0x33')]())[_0x6385('0x1f')](realtime[_0x6385('0x34')]())[_0x6385('0x1f')](servicenow[_0x6385('0x35')]())[_0x6385('0x1f')](realtime[_0x6385('0x36')]())[_0x6385('0x1f')](dynamics365[_0x6385('0x37')]())['then'](realtime[_0x6385('0x38')]())[_0x6385('0x1f')](campaign[_0x6385('0x39')]())[_0x6385('0x1f')](realtime[_0x6385('0x3a')]())[_0x6385('0x1f')](voiceExtension[_0x6385('0x3b')]())[_0x6385('0x1f')](realtime[_0x6385('0x3c')]())[_0x6385('0x1f')](faxAccount['getFaxAccounts']())['then'](realtime[_0x6385('0x3d')]())[_0x6385('0x1f')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x6385('0x1f')](voiceQueueReport[_0x6385('0x3e')]())[_0x6385('0x1f')](realtime['initVoiceQueueReports']())[_0x6385('0x1f')](cmHopperHistory[_0x6385('0x3f')]())['then'](realtime[_0x6385('0x40')]())[_0x6385('0x1f')](cmHopperHistory[_0x6385('0x41')]())[_0x6385('0x1f')](realtime[_0x6385('0x42')]())[_0x6385('0x1f')](voiceCallReport[_0x6385('0x43')]())[_0x6385('0x1f')](realtime['initVoiceCallReports']())[_0x6385('0x44')](function(_0x514945){logger[_0x6385('0x45')](_0x6385('0x46'),util['inspect'](_0x514945,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6385('0x47')](realtime,preview,fax)['then'](function(_0x454de5){return initRealtime();})[_0x6385('0x1f')](function(){return initParams();})['then'](function(){report[_0x6385('0x48')]();setInterval(initRealtime,0x1388);})[_0x6385('0x44')](function(_0x5f018c){logger[_0x6385('0x45')]('[index.js][main]',util['inspect'](_0x5f018c,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xaf86=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','[index.js][main]','util','moment','./realtime','./acw','./dialer','./preview'];(function(_0x12e53a,_0x4471bc){var _0x27ea42=function(_0x20f336){while(--_0x20f336){_0x12e53a['push'](_0x12e53a['shift']());}};_0x27ea42(++_0x4471bc);}(_0xaf86,0x1b3));var _0x6af8=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0xaf86[_0x4232d8];return _0x324de2;};'use strict';var BPromise=require('bluebird');var util=require(_0x6af8('0x0'));var moment=require(_0x6af8('0x1'));var server=require('./server');var Realtime=require(_0x6af8('0x2'));var Report=require('./report');var Acw=require(_0x6af8('0x3'));var Trigger=require('./trigger');var Dialer=require(_0x6af8('0x4'));var Preview=require(_0x6af8('0x5'));var Fax=require(_0x6af8('0x6'));var user=require(_0x6af8('0x7'));var voiceQueue=require(_0x6af8('0x8'));var voiceQueueReport=require(_0x6af8('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6af8('0xa'));var trigger=require(_0x6af8('0xb'));var template=require(_0x6af8('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x6af8('0xd'));var faxAccount=require(_0x6af8('0xe'));var zendesk=require(_0x6af8('0xf'));var salesforce=require(_0x6af8('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x6af8('0x11'));var desk=require(_0x6af8('0x12'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x6af8('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x6af8('0x14'));var dynamics365=require(_0x6af8('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6af8('0x16'))(_0x6af8('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6af8('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6af8('0x18')](_0x6af8('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6af8('0x1a')]()[_0x6af8('0x1b')](user[_0x6af8('0x1c')]())['then'](realtime[_0x6af8('0x1d')]())[_0x6af8('0x1b')](user[_0x6af8('0x1e')]())[_0x6af8('0x1b')](realtime['initTelephones']())[_0x6af8('0x1b')](trunk[_0x6af8('0x1f')]())['then'](realtime[_0x6af8('0x20')]())['then'](voiceQueue[_0x6af8('0x21')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x22')]())['then'](trigger[_0x6af8('0x23')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x24')]())['then'](template['getTemplates']())[_0x6af8('0x1b')](realtime[_0x6af8('0x25')]())['then'](zendesk['getZendeskAccounts']())[_0x6af8('0x1b')](realtime['initZendeskAccounts']())[_0x6af8('0x1b')](salesforce[_0x6af8('0x26')]())['then'](realtime['initSalesforceAccounts']())[_0x6af8('0x1b')](sugarcrm[_0x6af8('0x27')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x28')]())[_0x6af8('0x1b')](freshdesk[_0x6af8('0x29')]())['then'](realtime['initFreshdeskAccounts']())[_0x6af8('0x1b')](desk[_0x6af8('0x2a')]())['then'](realtime['initDeskAccounts']())['then'](zoho[_0x6af8('0x2b')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0x6af8('0x2c')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x2d')]())[_0x6af8('0x1b')](freshsales[_0x6af8('0x2e')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x2f')]())[_0x6af8('0x1b')](servicenow[_0x6af8('0x30')]())[_0x6af8('0x1b')](realtime['initServicenowAccounts']())[_0x6af8('0x1b')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x6af8('0x31')]())[_0x6af8('0x1b')](campaign['getCampaigns']())['then'](realtime[_0x6af8('0x32')]())[_0x6af8('0x1b')](voiceExtension['getVoiceExtensions']())[_0x6af8('0x1b')](realtime[_0x6af8('0x33')]())[_0x6af8('0x1b')](faxAccount['getFaxAccounts']())[_0x6af8('0x1b')](realtime[_0x6af8('0x34')]())[_0x6af8('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x6af8('0x1a')]()[_0x6af8('0x1b')](voiceQueueReport[_0x6af8('0x35')]())[_0x6af8('0x1b')](realtime['initVoiceQueueReports']())[_0x6af8('0x1b')](cmHopperHistory[_0x6af8('0x36')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x37')]())[_0x6af8('0x1b')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())[_0x6af8('0x1b')](voiceCallReport[_0x6af8('0x38')]())[_0x6af8('0x1b')](realtime[_0x6af8('0x39')]())[_0x6af8('0x3a')](function(_0x43d5c2){logger[_0x6af8('0x3b')]('[index.js][initParams]',util[_0x6af8('0x3c')](_0x43d5c2,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6af8('0x3d')](realtime,preview,fax)[_0x6af8('0x1b')](function(_0x4e9d83){return initRealtime();})[_0x6af8('0x1b')](function(){return initParams();})[_0x6af8('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x6af8('0x3a')](function(_0x4f1942){logger[_0x6af8('0x3b')](_0x6af8('0x3e'),util['inspect'](_0x4f1942,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index d8f32de..caad283 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x50c500,_0x4557c4){var _0x3ac59e=function(_0x305b1e){while(--_0x305b1e){_0x50c500['push'](_0x50c500['shift']());}};_0x3ac59e(++_0x4557c4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x4d3429,_0x1484e7){var _0x408a09=function(_0x2dea2c){while(--_0x2dea2c){_0x4d3429['push'](_0x4d3429['shift']());}};_0x408a09(++_0x1484e7);}(_0x34e8,0x12c));var _0x834e=function(_0x32ad99,_0x17951d){_0x32ad99=_0x32ad99-0x0;var _0x381ff5=_0x34e8[_0x32ad99];return _0x381ff5;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 0e4c572..b60fcf1 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 _0x041b=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x041b,0x83));var _0xb041=function(_0x3ea516,_0x345aae){_0x3ea516=_0x3ea516-0x0;var _0x2766bd=_0x041b[_0x3ea516];return _0x2766bd;};'use strict';function Campaign(_0x374cd1){this['id']=_0x374cd1['id']||0x0;this[_0xb041('0x0')]=_0x374cd1[_0xb041('0x0')]||'';this[_0xb041('0x1')]=_0x374cd1[_0xb041('0x1')]||_0xb041('0x2');this[_0xb041('0x3')]=0x0;this['temp']=0x0;this[_0xb041('0x4')]=0x0;this[_0xb041('0x5')]=0x0;this[_0xb041('0x6')]='';this[_0xb041('0x7')]=!![];this['active']=_0x374cd1[_0xb041('0x8')];this['limitCalls']=_0x374cd1['limitCalls'];this['dialTimezone']=_0x374cd1[_0xb041('0x9')]||null;this['dialGlobalInterval']=_0x374cd1['dialGlobalInterval']?_0x374cd1[_0xb041('0xa')]:null;this[_0xb041('0xb')]=_0x374cd1['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x374cd1['dialOriginateCallerIdNumber'];this[_0xb041('0xc')]=_0x374cd1['dialOriginateTimeout']||0x1e;this[_0xb041('0xd')]=_0x374cd1['dialCongestionMaxRetry'];this[_0xb041('0xe')]=_0x374cd1['dialCongestionRetryFrequency'];this[_0xb041('0xf')]=_0x374cd1[_0xb041('0xf')];this[_0xb041('0x10')]=_0x374cd1['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x374cd1[_0xb041('0x11')];this[_0xb041('0x12')]=_0x374cd1[_0xb041('0x12')];this['dialGlobalMaxRetry']=_0x374cd1[_0xb041('0x13')];this[_0xb041('0x14')]=_0x374cd1['dialNoSuchNumberMaxRetry']||0x3;this[_0xb041('0x15')]=_0x374cd1[_0xb041('0x15')]||0x96;this[_0xb041('0x16')]=_0x374cd1[_0xb041('0x16')]||0x3;this[_0xb041('0x17')]=_0x374cd1[_0xb041('0x17')]||0x96;this[_0xb041('0x18')]=_0x374cd1[_0xb041('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x374cd1[_0xb041('0x19')]||0x96;this['dialMachineMaxRetry']=_0x374cd1[_0xb041('0x1a')]||0x3;this[_0xb041('0x1b')]=_0x374cd1[_0xb041('0x1b')]||0x96;this[_0xb041('0x1c')]=_0x374cd1['dialAgentRejectMaxRetry']||0x3;this[_0xb041('0x1d')]=_0x374cd1['dialAgentRejectRetryFrequency']||0x96;this[_0xb041('0x1e')]=_0x374cd1[_0xb041('0x1e')]||_0xb041('0x1f');this[_0xb041('0x20')]=_0x374cd1['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x374cd1[_0xb041('0x21')]||undefined;this[_0xb041('0x22')]=_0x374cd1[_0xb041('0x22')]||undefined;this[_0xb041('0x23')]=_0x374cd1[_0xb041('0x23')]?_0x374cd1[_0xb041('0x23')]:undefined;this[_0xb041('0x24')]=_0x374cd1['Trunk']?_0x374cd1[_0xb041('0x24')]:undefined;this[_0xb041('0x25')]=_0x374cd1['Interval']?_0x374cd1['Interval']:undefined;this[_0xb041('0x26')]=_0x374cd1[_0xb041('0x26')]?_0x374cd1[_0xb041('0x26')]:undefined;this['dialQueueProject']=_0x374cd1[_0xb041('0x26')]?_0x374cd1[_0xb041('0x26')][_0xb041('0x0')]:undefined;this['dialAMDActive']=_0x374cd1[_0xb041('0x27')]||![];this[_0xb041('0x28')]=_0x374cd1['dialAMDInitialSilence'];this[_0xb041('0x29')]=_0x374cd1[_0xb041('0x29')];this[_0xb041('0x2a')]=_0x374cd1[_0xb041('0x2a')];this[_0xb041('0x2b')]=_0x374cd1[_0xb041('0x2b')];this[_0xb041('0x2c')]=_0x374cd1[_0xb041('0x2c')];this[_0xb041('0x2d')]=_0x374cd1[_0xb041('0x2d')];this[_0xb041('0x2e')]=_0x374cd1['dialAMDMaximumNumberOfWords'];this[_0xb041('0x2f')]=_0x374cd1[_0xb041('0x2f')];this['dialAMDMaximumWordLength']=_0x374cd1['dialAMDMaximumWordLength'];}module[_0xb041('0x30')]=Campaign; \ No newline at end of file +var _0xc75b=['originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc75b,0x123));var _0xbc75=function(_0x50e8b0,_0x4c0aa9){_0x50e8b0=_0x50e8b0-0x0;var _0x282fdf=_0xc75b[_0x50e8b0];return _0x282fdf;};'use strict';function Campaign(_0x91eb66){this['id']=_0x91eb66['id']||0x0;this['name']=_0x91eb66[_0xbc75('0x0')]||'';this[_0xbc75('0x1')]=_0x91eb66[_0xbc75('0x1')]||_0xbc75('0x2');this[_0xbc75('0x3')]=0x0;this[_0xbc75('0x4')]=0x0;this[_0xbc75('0x5')]=0x0;this[_0xbc75('0x6')]=0x0;this[_0xbc75('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0xbc75('0x8')]=_0x91eb66[_0xbc75('0x8')];this[_0xbc75('0x9')]=_0x91eb66[_0xbc75('0x9')];this[_0xbc75('0xa')]=_0x91eb66[_0xbc75('0xa')]||null;this['dialGlobalInterval']=_0x91eb66[_0xbc75('0xb')]?_0x91eb66[_0xbc75('0xb')]:null;this[_0xbc75('0xc')]=_0x91eb66[_0xbc75('0xc')];this[_0xbc75('0xd')]=_0x91eb66['dialOriginateCallerIdNumber'];this[_0xbc75('0xe')]=_0x91eb66[_0xbc75('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x91eb66[_0xbc75('0xf')];this['dialCongestionRetryFrequency']=_0x91eb66['dialCongestionRetryFrequency'];this[_0xbc75('0x10')]=_0x91eb66['dialBusyMaxRetry'];this[_0xbc75('0x11')]=_0x91eb66['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x91eb66[_0xbc75('0x12')];this[_0xbc75('0x13')]=_0x91eb66[_0xbc75('0x13')];this[_0xbc75('0x14')]=_0x91eb66[_0xbc75('0x14')];this[_0xbc75('0x15')]=_0x91eb66[_0xbc75('0x15')]||0x3;this[_0xbc75('0x16')]=_0x91eb66[_0xbc75('0x16')]||0x96;this[_0xbc75('0x17')]=_0x91eb66[_0xbc75('0x17')]||0x3;this[_0xbc75('0x18')]=_0x91eb66[_0xbc75('0x18')]||0x96;this[_0xbc75('0x19')]=_0x91eb66[_0xbc75('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x91eb66[_0xbc75('0x1a')]||0x96;this[_0xbc75('0x1b')]=_0x91eb66[_0xbc75('0x1b')]||0x3;this[_0xbc75('0x1c')]=_0x91eb66[_0xbc75('0x1c')]||0x96;this[_0xbc75('0x1d')]=_0x91eb66[_0xbc75('0x1d')]||0x3;this[_0xbc75('0x1e')]=_0x91eb66[_0xbc75('0x1e')]||0x96;this[_0xbc75('0x1f')]=_0x91eb66[_0xbc75('0x1f')]||_0xbc75('0x20');this[_0xbc75('0x21')]=_0x91eb66[_0xbc75('0x21')]||undefined;this[_0xbc75('0x22')]=_0x91eb66[_0xbc75('0x22')]||undefined;this['dialCutDigit']=_0x91eb66[_0xbc75('0x23')]||undefined;this[_0xbc75('0x24')]=_0x91eb66[_0xbc75('0x24')]?_0x91eb66['TrunkBackup']:undefined;this[_0xbc75('0x25')]=_0x91eb66[_0xbc75('0x25')]?_0x91eb66[_0xbc75('0x25')]:undefined;this[_0xbc75('0x26')]=_0x91eb66[_0xbc75('0x26')]?_0x91eb66[_0xbc75('0x26')]:undefined;this[_0xbc75('0x27')]=_0x91eb66[_0xbc75('0x27')]?_0x91eb66[_0xbc75('0x27')]:undefined;this['dialQueueProject']=_0x91eb66[_0xbc75('0x27')]?_0x91eb66['SquareProject'][_0xbc75('0x0')]:undefined;this[_0xbc75('0x28')]=_0x91eb66[_0xbc75('0x28')]||![];this['dialAMDInitialSilence']=_0x91eb66['dialAMDInitialSilence'];this[_0xbc75('0x29')]=_0x91eb66[_0xbc75('0x29')];this['dialAMDAfterGreetingSilence']=_0x91eb66[_0xbc75('0x2a')];this[_0xbc75('0x2b')]=_0x91eb66[_0xbc75('0x2b')];this[_0xbc75('0x2c')]=_0x91eb66[_0xbc75('0x2c')];this[_0xbc75('0x2d')]=_0x91eb66[_0xbc75('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x91eb66['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x91eb66[_0xbc75('0x2e')];this[_0xbc75('0x2f')]=_0x91eb66[_0xbc75('0x2f')];}module[_0xbc75('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 4f3dd0a..c3c4c17 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 _0x11c1=['starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports'];(function(_0x1384da,_0x1d7aaa){var _0x3ecfcc=function(_0x229d86){while(--_0x229d86){_0x1384da['push'](_0x1384da['shift']());}};_0x3ecfcc(++_0x1d7aaa);}(_0x11c1,0x1cb));var _0x111c=function(_0xbcbb7a,_0x5dc7ef){_0xbcbb7a=_0xbcbb7a-0x0;var _0x371aff=_0x11c1[_0xbcbb7a];return _0x371aff;};'use strict';function Channel(){this[_0x111c('0x0')]=null;this['channel']='';this[_0x111c('0x1')]='';this[_0x111c('0x2')]=0x0;this[_0x111c('0x3')]='';this[_0x111c('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x111c('0x5')]=0x0;this[_0x111c('0x6')]='';this[_0x111c('0x7')]=0x0;this[_0x111c('0x8')]=0x0;this[_0x111c('0x9')]=0x0;this[_0x111c('0xa')]=![];this['answertime']=null;this[_0x111c('0xb')]=null;this[_0x111c('0xc')]=![];this[_0x111c('0xd')]=![];this[_0x111c('0xe')]='';this[_0x111c('0xf')]='';this[_0x111c('0x10')]=0x0;this[_0x111c('0x11')]=0x0;this[_0x111c('0x12')]=0x0;this[_0x111c('0x13')]=null;this[_0x111c('0x14')]=null;this[_0x111c('0x15')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this[_0x111c('0x16')]=undefined;this[_0x111c('0x17')]=undefined;this[_0x111c('0x18')]=undefined;this[_0x111c('0x19')]=0x0;}module[_0x111c('0x1a')]=Channel; \ No newline at end of file +var _0x7269=['unmanaged','abandoned','lastdata','billableseconds','holdtime','type','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime'];(function(_0x441964,_0x3070ae){var _0x4211f0=function(_0x5065c9){while(--_0x5065c9){_0x441964['push'](_0x441964['shift']());}};_0x4211f0(++_0x3070ae);}(_0x7269,0x76));var _0x9726=function(_0x3952f3,_0x50615a){_0x3952f3=_0x3952f3-0x0;var _0x5decdc=_0x7269[_0x3952f3];return _0x5decdc;};'use strict';function Channel(){this[_0x9726('0x0')]=null;this[_0x9726('0x1')]='';this[_0x9726('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x9726('0x3')]=undefined;this[_0x9726('0x4')]=undefined;this['accountcode']=0x0;this[_0x9726('0x5')]='';this[_0x9726('0x6')]=0x0;this[_0x9726('0x7')]=0x0;this[_0x9726('0x8')]=0x0;this[_0x9726('0x9')]=![];this[_0x9726('0xa')]=null;this[_0x9726('0xb')]=null;this[_0x9726('0xc')]=![];this[_0x9726('0xd')]=![];this['lastapplication']='';this[_0x9726('0xe')]='';this['duration']=0x0;this[_0x9726('0xf')]=0x0;this[_0x9726('0x10')]=0x0;this[_0x9726('0x11')]=null;this['tag']=null;this[_0x9726('0x12')]=null;this[_0x9726('0x13')]=![];this[_0x9726('0x14')]=null;this['queue']=null;this[_0x9726('0x15')]=[];this[_0x9726('0x16')]=undefined;this[_0x9726('0x17')]=undefined;this[_0x9726('0x18')]=undefined;this[_0x9726('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 210c545..d5007b1 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 _0x6816=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0x6816,0x81));var _0x6681=function(_0x59ef67,_0x8a9847){_0x59ef67=_0x59ef67-0x0;var _0x2ec2ce=_0x6816[_0x59ef67];return _0x2ec2ce;};'use strict';function DeskAccount(_0x677c2e){this['id']=_0x677c2e['id']||0x0;this['name']=_0x677c2e[_0x6681('0x0')]||'';this[_0x6681('0x1')]=_0x677c2e[_0x6681('0x1')]||'';this[_0x6681('0x2')]=_0x677c2e[_0x6681('0x2')]||'';this['authType']=_0x677c2e[_0x6681('0x3')]||'';this[_0x6681('0x4')]=_0x677c2e[_0x6681('0x4')]||'';this[_0x6681('0x5')]=_0x677c2e['consumerKey']||'';this[_0x6681('0x6')]=_0x677c2e[_0x6681('0x6')]||'';this[_0x6681('0x7')]=_0x677c2e[_0x6681('0x7')]||'';this['tokenSecret']=_0x677c2e[_0x6681('0x8')]||'';this[_0x6681('0x9')]=_0x677c2e['type']||'';this[_0x6681('0xa')]=_0x677c2e[_0x6681('0xa')]||'';this['Configurations']=_0x677c2e[_0x6681('0xb')]||{};}module[_0x6681('0xc')]=DeskAccount; \ No newline at end of file +var _0xe25b=['type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerSecret','token','tokenSecret'];(function(_0x42302c,_0x37260a){var _0x452e8b=function(_0xc3bf40){while(--_0xc3bf40){_0x42302c['push'](_0x42302c['shift']());}};_0x452e8b(++_0x37260a);}(_0xe25b,0x19b));var _0xbe25=function(_0x2aa020,_0x5339dd){_0x2aa020=_0x2aa020-0x0;var _0x308379=_0xe25b[_0x2aa020];return _0x308379;};'use strict';function DeskAccount(_0x2f90c3){this['id']=_0x2f90c3['id']||0x0;this['name']=_0x2f90c3['name']||'';this[_0xbe25('0x0')]=_0x2f90c3['username']||'';this[_0xbe25('0x1')]=_0x2f90c3[_0xbe25('0x1')]||'';this[_0xbe25('0x2')]=_0x2f90c3['authType']||'';this[_0xbe25('0x3')]=_0x2f90c3['password']||'';this['consumerKey']=_0x2f90c3['consumerKey']||'';this[_0xbe25('0x4')]=_0x2f90c3['consumerSecret']||'';this[_0xbe25('0x5')]=_0x2f90c3['token']||'';this[_0xbe25('0x6')]=_0x2f90c3[_0xbe25('0x6')]||'';this[_0xbe25('0x7')]=_0x2f90c3['type']||'';this[_0xbe25('0x8')]=_0x2f90c3[_0xbe25('0x8')]||'';this[_0xbe25('0x9')]=_0x2f90c3[_0xbe25('0x9')]||{};}module[_0xbe25('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9aa714b..32f3d90 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(_0x11ff78,_0x2feab3){_0x11ff78=_0x11ff78-0x0;var _0x546dd5=_0x5b02[_0x11ff78];return _0x546dd5;};'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 _0xe5b5=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xe5b5[_0x52666e];return _0x515330;};'use strict';function Dynamics365Account(_0x16118d){this['id']=_0x16118d['id']||0x0;this[_0x5e5b('0x0')]=_0x16118d[_0x5e5b('0x0')]||'';this[_0x5e5b('0x1')]=_0x16118d[_0x5e5b('0x1')]||'';this[_0x5e5b('0x2')]=_0x16118d[_0x5e5b('0x2')]||'';this[_0x5e5b('0x3')]=_0x16118d[_0x5e5b('0x3')]||'';this[_0x5e5b('0x4')]=_0x16118d[_0x5e5b('0x4')]||'';this[_0x5e5b('0x5')]=_0x16118d[_0x5e5b('0x5')]||'';this[_0x5e5b('0x6')]=_0x16118d[_0x5e5b('0x6')]||{};this[_0x5e5b('0x7')]=_0x16118d[_0x5e5b('0x7')]||'';this[_0x5e5b('0x8')]=_0x16118d[_0x5e5b('0x8')]||{};}module[_0x5e5b('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 8f6b1f3..25ac661 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 _0xfa9e=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','name','description','ecm','localstationid','minrate','maxrate'];(function(_0x5d4510,_0x5aa2c8){var _0x3dfae0=function(_0x5d5587){while(--_0x5d5587){_0x5d4510['push'](_0x5d4510['shift']());}};_0x3dfae0(++_0x5aa2c8);}(_0xfa9e,0x180));var _0xefa9=function(_0x27b50b,_0x5692b8){_0x27b50b=_0x27b50b-0x0;var _0x5a1909=_0xfa9e[_0x27b50b];return _0x5a1909;};'use strict';function FaxAccount(_0x31284b){this['id']=_0x31284b['id']||0x0;this[_0xefa9('0x0')]=_0x31284b['name']||'';this['description']=_0x31284b[_0xefa9('0x1')];this['ecm']=_0x31284b[_0xefa9('0x2')];this['headerinfo']=_0x31284b['headerinfo'];this[_0xefa9('0x3')]=_0x31284b[_0xefa9('0x3')];this['minrate']=_0x31284b[_0xefa9('0x4')]||0x960;this[_0xefa9('0x5')]=_0x31284b[_0xefa9('0x5')]||0x3840;this[_0xefa9('0x6')]=_0x31284b[_0xefa9('0x6')]||_0xefa9('0x7');this['gateway']=_0x31284b[_0xefa9('0x8')]||'no';this[_0xefa9('0x9')]=_0x31284b[_0xefa9('0x9')]||'no';this['t38timeout']=_0x31284b[_0xefa9('0xa')]||0x1388;this['tech']=_0x31284b['tech']||_0xefa9('0xb');this[_0xefa9('0xc')]=_0x31284b[_0xefa9('0xc')]?_0x31284b[_0xefa9('0xc')]:undefined;this[_0xefa9('0xd')]=_0x31284b[_0xefa9('0xd')];this[_0xefa9('0xe')]=_0x31284b['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0xb4f4=['maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x1ba4f4,_0x5829bd){var _0x1a1c31=function(_0x443edc){while(--_0x443edc){_0x1ba4f4['push'](_0x1ba4f4['shift']());}};_0x1a1c31(++_0x5829bd);}(_0xb4f4,0xda));var _0x4b4f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb4f4[_0x4565bf];return _0x5610ba;};'use strict';function FaxAccount(_0x1bce61){this['id']=_0x1bce61['id']||0x0;this[_0x4b4f('0x0')]=_0x1bce61['name']||'';this[_0x4b4f('0x1')]=_0x1bce61[_0x4b4f('0x1')];this[_0x4b4f('0x2')]=_0x1bce61[_0x4b4f('0x2')];this['headerinfo']=_0x1bce61[_0x4b4f('0x3')];this[_0x4b4f('0x4')]=_0x1bce61[_0x4b4f('0x4')];this[_0x4b4f('0x5')]=_0x1bce61[_0x4b4f('0x5')]||0x960;this[_0x4b4f('0x6')]=_0x1bce61[_0x4b4f('0x6')]||0x3840;this['modem']=_0x1bce61['modem']||_0x4b4f('0x7');this[_0x4b4f('0x8')]=_0x1bce61[_0x4b4f('0x8')]||'no';this[_0x4b4f('0x9')]=_0x1bce61[_0x4b4f('0x9')]||'no';this['t38timeout']=_0x1bce61[_0x4b4f('0xa')]||0x1388;this[_0x4b4f('0xb')]=_0x1bce61[_0x4b4f('0xb')]||'SIP';this[_0x4b4f('0xc')]=_0x1bce61[_0x4b4f('0xc')]?_0x1bce61['Trunk']:undefined;this[_0x4b4f('0xd')]=_0x1bce61[_0x4b4f('0xd')];this[_0x4b4f('0xe')]=_0x1bce61[_0x4b4f('0xe')];}module[_0x4b4f('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index a01ba74..92693c2 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 _0x055a=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0xca4c0,_0x65722e){var _0x2737bd=function(_0x50d3ea){while(--_0x50d3ea){_0xca4c0['push'](_0xca4c0['shift']());}};_0x2737bd(++_0x65722e);}(_0x055a,0x13d));var _0xa055=function(_0x2d1ff6,_0x182530){_0x2d1ff6=_0x2d1ff6-0x0;var _0x2f1298=_0x055a[_0x2d1ff6];return _0x2f1298;};'use strict';function FreshdeskAccount(_0x4538e3){this['id']=_0x4538e3['id']||0x0;this['name']=_0x4538e3[_0xa055('0x0')]||'';this[_0xa055('0x1')]=_0x4538e3[_0xa055('0x1')]||'';this[_0xa055('0x2')]=_0x4538e3[_0xa055('0x3')]||'';this['remoteUri']=_0x4538e3[_0xa055('0x4')]||'';this[_0xa055('0x5')]=_0x4538e3[_0xa055('0x5')]||'';this[_0xa055('0x6')]=_0x4538e3[_0xa055('0x6')]||{};}module[_0xa055('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x9db6=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1b1e55,_0x2fb373){var _0x2f3675=function(_0x27e5c4){while(--_0x27e5c4){_0x1b1e55['push'](_0x1b1e55['shift']());}};_0x2f3675(++_0x2fb373);}(_0x9db6,0xb4));var _0x69db=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x9db6[_0x3f6b1b];return _0x4a3d2b;};'use strict';function FreshdeskAccount(_0x28321e){this['id']=_0x28321e['id']||0x0;this[_0x69db('0x0')]=_0x28321e[_0x69db('0x0')]||'';this[_0x69db('0x1')]=_0x28321e[_0x69db('0x1')]||'';this[_0x69db('0x2')]=_0x28321e['token']||'';this[_0x69db('0x3')]=_0x28321e['remoteUri']||'';this[_0x69db('0x4')]=_0x28321e['serverUrl']||'';this[_0x69db('0x5')]=_0x28321e['Configurations']||{};}module[_0x69db('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3b797ef..960b148 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 _0x10af=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0x10af,0xfc));var _0xf10a=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x10af[_0x38ced4];return _0x547c07;};'use strict';function FreshsalesAccount(_0x278c56){this['id']=_0x278c56['id']||0x0;this['name']=_0x278c56[_0xf10a('0x0')]||'';this[_0xf10a('0x1')]=_0x278c56[_0xf10a('0x1')]||'';this[_0xf10a('0x2')]=_0x278c56[_0xf10a('0x3')]||'';this[_0xf10a('0x4')]=_0x278c56[_0xf10a('0x4')]||'';this[_0xf10a('0x5')]=_0x278c56['serverUrl']||'';this[_0xf10a('0x6')]=_0x278c56[_0xf10a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x9fc5=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x9fc5,0xb6));var _0x59fc=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x9fc5[_0x7ad6cb];return _0x22a0ba;};'use strict';function FreshsalesAccount(_0x431fd4){this['id']=_0x431fd4['id']||0x0;this[_0x59fc('0x0')]=_0x431fd4[_0x59fc('0x0')]||'';this['username']=_0x431fd4[_0x59fc('0x1')]||'';this[_0x59fc('0x2')]=_0x431fd4[_0x59fc('0x3')]||'';this[_0x59fc('0x4')]=_0x431fd4[_0x59fc('0x4')]||'';this[_0x59fc('0x5')]=_0x431fd4[_0x59fc('0x5')]||'';this[_0x59fc('0x6')]=_0x431fd4['Configurations']||{};}module[_0x59fc('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 5041544..2d8baa9 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 _0xe10b=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt'];(function(_0xc6299d,_0x4e893e){var _0x278de4=function(_0xe71f61){while(--_0xe71f61){_0xc6299d['push'](_0xc6299d['shift']());}};_0x278de4(++_0x4e893e);}(_0xe10b,0xa2));var _0xbe10=function(_0x51c729,_0x245095){_0x51c729=_0x51c729-0x0;var _0x375d3a=_0xe10b[_0x51c729];return _0x375d3a;};'use strict';function QueueReport(){this[_0xbe10('0x0')]=_0xbe10('0x1');this[_0xbe10('0x2')]='';this[_0xbe10('0x3')]='';this['calleridname']='';this[_0xbe10('0x4')]='';this[_0xbe10('0x5')]=null;this[_0xbe10('0x6')]=null;this[_0xbe10('0x7')]=0x1;this[_0xbe10('0x8')]=0x1;this[_0xbe10('0x9')]=![];this[_0xbe10('0xa')]=null;this[_0xbe10('0xb')]=![];this[_0xbe10('0xc')]=null;this[_0xbe10('0xd')]=![];this[_0xbe10('0xe')]=null;this[_0xbe10('0xf')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0xbe10('0x10')]='';this['accountcode']='';this['context']='';this['exten']='';this['priority']='';this['holdtime']=0x0;this[_0xbe10('0x11')]=![];this[_0xbe10('0x12')]='';this[_0xbe10('0x13')]=_0xbe10('0x14');this[_0xbe10('0x15')]=0x0;this[_0xbe10('0x16')]={};}module[_0xbe10('0x17')]=QueueReport; \ No newline at end of file +var _0x969b=['queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','exten','priority','holdtime','assigned','mohtime','variables','exports','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x969b,0xef));var _0xb969=function(_0x5280b9,_0x55ac77){_0x5280b9=_0x5280b9-0x0;var _0x534e55=_0x969b[_0x5280b9];return _0x534e55;};'use strict';function QueueReport(){this['type']='inbound';this[_0xb969('0x0')]='';this['calleridnum']='';this['calleridname']='';this[_0xb969('0x1')]='';this[_0xb969('0x2')]=null;this[_0xb969('0x3')]=null;this[_0xb969('0x4')]=0x1;this[_0xb969('0x5')]=0x1;this[_0xb969('0x6')]=![];this[_0xb969('0x7')]=null;this[_0xb969('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xb969('0x9')]=![];this[_0xb969('0xa')]=null;this[_0xb969('0xb')]=0x1;this['channel']='';this[_0xb969('0xc')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this[_0xb969('0xd')]='';this[_0xb969('0xe')]='';this[_0xb969('0xf')]=0x0;this[_0xb969('0x10')]=![];this['lastAssignedTo']='';this['motionChannel']='voice';this[_0xb969('0x11')]=0x0;this[_0xb969('0x12')]={};}module[_0xb969('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 3e47fa0..397b89f 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 _0xf333=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf333,0x1d4));var _0x3f33=function(_0x2b357f,_0x1c39c5){_0x2b357f=_0x2b357f-0x0;var _0x259eae=_0xf333[_0x2b357f];return _0x259eae;};'use strict';function SalesforceAccount(_0x18ca4d){this['id']=_0x18ca4d['id']||0x0;this[_0x3f33('0x0')]=_0x18ca4d[_0x3f33('0x0')]||'';this['username']=_0x18ca4d[_0x3f33('0x1')]||'';this['remoteUri']=_0x18ca4d[_0x3f33('0x2')]||'';this[_0x3f33('0x3')]=_0x18ca4d['password']||'';this[_0x3f33('0x4')]=_0x18ca4d[_0x3f33('0x4')]||'';this[_0x3f33('0x5')]=_0x18ca4d[_0x3f33('0x5')]||'';this[_0x3f33('0x6')]=_0x18ca4d['securityToken']||'';this[_0x3f33('0x7')]=_0x18ca4d[_0x3f33('0x7')]||'integrationTab';this[_0x3f33('0x8')]=_0x18ca4d['serverUrl']||'';this[_0x3f33('0x9')]=_0x18ca4d[_0x3f33('0x9')]||{};}module[_0x3f33('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xdfb1=['password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x57e5cf,_0x239ec8){_0x57e5cf=_0x57e5cf-0x0;var _0x52682d=_0xdfb1[_0x57e5cf];return _0x52682d;};'use strict';function SalesforceAccount(_0x31e259){this['id']=_0x31e259['id']||0x0;this[_0x1dfb('0x0')]=_0x31e259[_0x1dfb('0x0')]||'';this[_0x1dfb('0x1')]=_0x31e259['username']||'';this[_0x1dfb('0x2')]=_0x31e259[_0x1dfb('0x2')]||'';this[_0x1dfb('0x3')]=_0x31e259[_0x1dfb('0x3')]||'';this['clientId']=_0x31e259['clientId']||'';this['clientSecret']=_0x31e259[_0x1dfb('0x4')]||'';this[_0x1dfb('0x5')]=_0x31e259[_0x1dfb('0x5')]||'';this['type']=_0x31e259[_0x1dfb('0x6')]||_0x1dfb('0x7');this[_0x1dfb('0x8')]=_0x31e259[_0x1dfb('0x8')]||'';this['Configurations']=_0x31e259[_0x1dfb('0x9')]||{};}module[_0x1dfb('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 b5c1e44..8bef674 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 _0xa1e4=['name','username','password','remoteUri','Configurations','exports'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa1e4,0x150));var _0x4a1e=function(_0x310dc2,_0x2299c4){_0x310dc2=_0x310dc2-0x0;var _0x24980f=_0xa1e4[_0x310dc2];return _0x24980f;};'use strict';function ServicenowAccount(_0x4b094d){this['id']=_0x4b094d['id']||0x0;this['name']=_0x4b094d[_0x4a1e('0x0')]||'';this['username']=_0x4b094d[_0x4a1e('0x1')]||'';this[_0x4a1e('0x2')]=_0x4b094d[_0x4a1e('0x2')]||'';this[_0x4a1e('0x3')]=_0x4b094d[_0x4a1e('0x3')]||'';this['serverUrl']=_0x4b094d['serverUrl']||'';this['Configurations']=_0x4b094d[_0x4a1e('0x4')]||{};}module[_0x4a1e('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x7919=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x14c0d7,_0x3f8ef2){var _0x233b33=function(_0x9a9dd6){while(--_0x9a9dd6){_0x14c0d7['push'](_0x14c0d7['shift']());}};_0x233b33(++_0x3f8ef2);}(_0x7919,0x7e));var _0x9791=function(_0x526239,_0x30443f){_0x526239=_0x526239-0x0;var _0x2e62de=_0x7919[_0x526239];return _0x2e62de;};'use strict';function ServicenowAccount(_0x2a4014){this['id']=_0x2a4014['id']||0x0;this[_0x9791('0x0')]=_0x2a4014[_0x9791('0x0')]||'';this[_0x9791('0x1')]=_0x2a4014[_0x9791('0x1')]||'';this[_0x9791('0x2')]=_0x2a4014[_0x9791('0x2')]||'';this[_0x9791('0x3')]=_0x2a4014[_0x9791('0x3')]||'';this[_0x9791('0x4')]=_0x2a4014[_0x9791('0x4')]||'';this[_0x9791('0x5')]=_0x2a4014['Configurations']||{};}module[_0x9791('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index ff86367..178d2d7 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 _0x8fe1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2a94b2,_0x2ab9fd){var _0x1dc133=function(_0x463716){while(--_0x463716){_0x2a94b2['push'](_0x2a94b2['shift']());}};_0x1dc133(++_0x2ab9fd);}(_0x8fe1,0x195));var _0x18fe=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x8fe1[_0x4cbf20];return _0x582ae4;};'use strict';function SugarcrmAccount(_0x61b24f){this['id']=_0x61b24f['id']||0x0;this[_0x18fe('0x0')]=_0x61b24f[_0x18fe('0x0')]||'';this[_0x18fe('0x1')]=_0x61b24f[_0x18fe('0x1')]||'';this[_0x18fe('0x2')]=_0x61b24f[_0x18fe('0x2')]||'';this[_0x18fe('0x3')]=_0x61b24f[_0x18fe('0x3')]||'';this[_0x18fe('0x4')]=_0x61b24f[_0x18fe('0x4')]||'';this[_0x18fe('0x5')]=_0x61b24f[_0x18fe('0x5')]||{};}module[_0x18fe('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x59e4=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x8a570b,_0x73059){var _0x45f680=function(_0x37ba19){while(--_0x37ba19){_0x8a570b['push'](_0x8a570b['shift']());}};_0x45f680(++_0x73059);}(_0x59e4,0x1a8));var _0x459e=function(_0xebaba9,_0x15a246){_0xebaba9=_0xebaba9-0x0;var _0xca52ea=_0x59e4[_0xebaba9];return _0xca52ea;};'use strict';function SugarcrmAccount(_0x4ae91b){this['id']=_0x4ae91b['id']||0x0;this['name']=_0x4ae91b[_0x459e('0x0')]||'';this[_0x459e('0x1')]=_0x4ae91b[_0x459e('0x1')]||'';this[_0x459e('0x2')]=_0x4ae91b['password']||'';this['remoteUri']=_0x4ae91b[_0x459e('0x3')]||'';this[_0x459e('0x4')]=_0x4ae91b['serverUrl']||'';this[_0x459e('0x5')]=_0x4ae91b[_0x459e('0x5')]||{};}module[_0x459e('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index c2b4c21..690ca44 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 _0x6da1=['accountcode','state','stateTime','status','address','exports','name'];(function(_0x4174bf,_0x2dc30b){var _0x2d406d=function(_0x4997f7){while(--_0x4997f7){_0x4174bf['push'](_0x4174bf['shift']());}};_0x2d406d(++_0x2dc30b);}(_0x6da1,0x1b8));var _0x16da=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x6da1[_0x134192];return _0x3cd080;};'use strict';function Telephone(_0x244702){this['id']=_0x244702['id']||0x0;this[_0x16da('0x0')]=_0x244702['name']||'';this[_0x16da('0x1')]=_0x244702[_0x16da('0x1')]||'';this[_0x16da('0x2')]='unknown';this[_0x16da('0x3')]=0x0;this[_0x16da('0x4')]='unknown';this[_0x16da('0x5')]='';}module[_0x16da('0x6')]=Telephone; \ No newline at end of file +var _0xe7c5=['stateTime','status','address','name','accountcode','state','unknown'];(function(_0xd9cc61,_0x1038d2){var _0x3cae6d=function(_0x542c09){while(--_0x542c09){_0xd9cc61['push'](_0xd9cc61['shift']());}};_0x3cae6d(++_0x1038d2);}(_0xe7c5,0xa4));var _0x5e7c=function(_0x4d01ee,_0x48a5d1){_0x4d01ee=_0x4d01ee-0x0;var _0x598a07=_0xe7c5[_0x4d01ee];return _0x598a07;};'use strict';function Telephone(_0x40977c){this['id']=_0x40977c['id']||0x0;this[_0x5e7c('0x0')]=_0x40977c[_0x5e7c('0x0')]||'';this[_0x5e7c('0x1')]=_0x40977c['accountcode']||'';this[_0x5e7c('0x2')]=_0x5e7c('0x3');this[_0x5e7c('0x4')]=0x0;this[_0x5e7c('0x5')]=_0x5e7c('0x3');this[_0x5e7c('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index c007756..4009aff 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 _0xb10b=['name','html'];(function(_0x4c06bd,_0x44af98){var _0x3ed724=function(_0x36caf0){while(--_0x36caf0){_0x4c06bd['push'](_0x4c06bd['shift']());}};_0x3ed724(++_0x44af98);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c27b6,_0x2192cb){_0x3c27b6=_0x3c27b6-0x0;var _0x2a5f55=_0xb10b[_0x3c27b6];return _0x2a5f55;};'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 +var _0xb10b=['name','html'];(function(_0x4f9119,_0x458fa0){var _0x14b982=function(_0x5645ab){while(--_0x5645ab){_0x4f9119['push'](_0x4f9119['shift']());}};_0x14b982(++_0x458fa0);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d417e,_0x3f0f60){_0x4d417e=_0x4d417e-0x0;var _0x34fb1d=_0xb10b[_0x4d417e];return _0x34fb1d;};'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 169f845..5012663 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x132107,_0x40d4fc){var _0x28ecdf=function(_0x50ebb6){while(--_0x50ebb6){_0x132107['push'](_0x132107['shift']());}};_0x28ecdf(++_0x40d4fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0xfb845c,_0x1945ff){var _0x3ca188=function(_0x28fbc6){while(--_0x28fbc6){_0xfb845c['push'](_0xfb845c['shift']());}};_0x3ca188(++_0x1945ff);}(_0x4fc2,0x111));var _0x24fc=function(_0x150e2e,_0x4ee6e8){_0x150e2e=_0x150e2e-0x0;var _0x4cd254=_0x4fc2[_0x150e2e];return _0x4cd254;};'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 42368f7..2bc905e 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 _0x6142=['domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','stateTime','unknown','registry','indexOf','split','host','port'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6142,0x14b));var _0x2614=function(_0x41dff7,_0x39b771){_0x41dff7=_0x41dff7-0x0;var _0x534734=_0x6142[_0x41dff7];return _0x534734;};'use strict';function Trunk(_0x3c6d31){this['id']=_0x3c6d31['id']||0x0;this[_0x2614('0x0')]=_0x3c6d31[_0x2614('0x0')]||![];this[_0x2614('0x1')]=_0x3c6d31[_0x2614('0x1')]||'';this['state']='unknown';this[_0x2614('0x2')]=0x0;this['status']=_0x2614('0x3');this[_0x2614('0x4')]=_0x3c6d31['registry']&&_0x3c6d31['registry'][_0x2614('0x5')](':')?_0x3c6d31[_0x2614('0x4')][_0x2614('0x6')](':')[0x0]:'';this[_0x2614('0x7')]='';this[_0x2614('0x8')]='';this[_0x2614('0x9')]='';this[_0x2614('0xa')]='';this[_0x2614('0xb')]='';this[_0x2614('0xc')]=_0x2614('0x3');this[_0x2614('0xd')]='';this[_0x2614('0xe')]='';this[_0x2614('0xf')]=_0x3c6d31[_0x2614('0xf')]||'';}module[_0x2614('0x10')]=Trunk; \ No newline at end of file +var _0x349a=['unknown','stateTime','status','registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state'];(function(_0x2798d5,_0x398a0a){var _0x3cb51f=function(_0x2f7469){while(--_0x2f7469){_0x2798d5['push'](_0x2798d5['shift']());}};_0x3cb51f(++_0x398a0a);}(_0x349a,0xf9));var _0xa349=function(_0x2503aa,_0x4ea0db){_0x2503aa=_0x2503aa-0x0;var _0x44f5e2=_0x349a[_0x2503aa];return _0x44f5e2;};'use strict';function Trunk(_0x4ae3ad){this['id']=_0x4ae3ad['id']||0x0;this['active']=_0x4ae3ad[_0xa349('0x0')]||![];this[_0xa349('0x1')]=_0x4ae3ad[_0xa349('0x1')]||'';this[_0xa349('0x2')]=_0xa349('0x3');this[_0xa349('0x4')]=0x0;this[_0xa349('0x5')]=_0xa349('0x3');this[_0xa349('0x6')]=_0x4ae3ad[_0xa349('0x6')]&&_0x4ae3ad[_0xa349('0x6')][_0xa349('0x7')](':')?_0x4ae3ad[_0xa349('0x6')]['split'](':')[0x0]:'';this[_0xa349('0x8')]='';this[_0xa349('0x9')]='';this[_0xa349('0xa')]='';this[_0xa349('0xb')]='';this[_0xa349('0xc')]='';this[_0xa349('0xd')]=_0xa349('0x3');this[_0xa349('0xe')]='';this[_0xa349('0xf')]='';this[_0xa349('0x10')]=_0x4ae3ad[_0xa349('0x10')]||'';}module[_0xa349('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bd7a409..4a10253 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 _0x000b=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x1627ec,_0x81809){var _0x5b4aa9=function(_0x4fd057){while(--_0x4fd057){_0x1627ec['push'](_0x1627ec['shift']());}};_0x5b4aa9(++_0x81809);}(_0x000b,0x1d7));var _0xb000=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x000b[_0x8e9386];return _0x4abf26;};'use strict';function voiceExtension(_0x1a6b82){this['id']=_0x1a6b82['id']||0x0;this[_0xb000('0x0')]=_0x1a6b82[_0xb000('0x0')]||'';this[_0xb000('0x1')]=_0x1a6b82['recordingFormat']||_0xb000('0x2');this['mandatoryDisposition']=_0x1a6b82[_0xb000('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x2532=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x47dbda,_0x5e86dd){var _0x315e4b=function(_0x188307){while(--_0x188307){_0x47dbda['push'](_0x47dbda['shift']());}};_0x315e4b(++_0x5e86dd);}(_0x2532,0x15b));var _0x2253=function(_0x4110ec,_0x2dc4fd){_0x4110ec=_0x4110ec-0x0;var _0x1c3190=_0x2532[_0x4110ec];return _0x1c3190;};'use strict';function voiceExtension(_0x285a49){this['id']=_0x285a49['id']||0x0;this['exten']=_0x285a49[_0x2253('0x0')]||'';this[_0x2253('0x1')]=_0x285a49[_0x2253('0x1')]||_0x2253('0x2');this[_0x2253('0x3')]=_0x285a49[_0x2253('0x3')]||![];}module[_0x2253('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c1ce62f..d066ac1 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 _0x3ddd=['dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x188945,_0x2aafa5){var _0x4959c2=function(_0x534f43){while(--_0x534f43){_0x188945['push'](_0x188945['shift']());}};_0x4959c2(++_0x2aafa5);}(_0x3ddd,0x18b));var _0xd3dd=function(_0x40cd23,_0x792542){_0x40cd23=_0x40cd23-0x0;var _0x54d006=_0x3ddd[_0x40cd23];return _0x54d006;};'use strict';var statusDesc=[_0xd3dd('0x0'),_0xd3dd('0x1'),_0xd3dd('0x2'),_0xd3dd('0x3'),_0xd3dd('0x4'),_0xd3dd('0x5'),_0xd3dd('0x6'),_0xd3dd('0x7'),_0xd3dd('0x8')];var monitorFormat={'wav':_0xd3dd('0x9'),'wav49':'wav49','gsm':_0xd3dd('0xa')};var strategy={'rrmemory':_0xd3dd('0xb'),'roundrobin':_0xd3dd('0xc')};function VoiceQueue(_0x5827aa){this['id']=_0x5827aa['id']||0x0;this[_0xd3dd('0xd')]=_0x5827aa[_0xd3dd('0xd')]||'';this[_0xd3dd('0xe')]=_0x5827aa['monitor_format']||'';this[_0xd3dd('0xf')]=_0x5827aa[_0xd3dd('0xf')]||_0xd3dd('0x10');this[_0xd3dd('0x11')]=0x0;this[_0xd3dd('0x12')]=0x0;this['total']=0x0;this[_0xd3dd('0x13')]=0x0;this[_0xd3dd('0x14')]=0x0;this[_0xd3dd('0x15')]=0x0;this[_0xd3dd('0x16')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xd3dd('0x17')]=0x0;this[_0xd3dd('0x18')]=0x0;this[_0xd3dd('0x19')]=_0x5827aa[_0xd3dd('0x19')]||![];this[_0xd3dd('0x1a')]=_0x5827aa[_0xd3dd('0x1a')]||0xa;this['autopause']=_0x5827aa[_0xd3dd('0x1b')]||'no';this['sendMessageOneNotActive']=!![];this[_0xd3dd('0x1c')]='';this['originated']=0x0;this[_0xd3dd('0x1d')]=0x0;this[_0xd3dd('0x1e')]=_0x5827aa[_0xd3dd('0x1e')]||null;this[_0xd3dd('0x1f')]=_0x5827aa[_0xd3dd('0x1f')]?_0x5827aa[_0xd3dd('0x1f')]:null;this[_0xd3dd('0x20')]=_0x5827aa['dialActive'];this[_0xd3dd('0x21')]=_0x5827aa[_0xd3dd('0x21')]||_0xd3dd('0x22');this[_0xd3dd('0x23')]=_0x5827aa[_0xd3dd('0x23')]||0x0;this[_0xd3dd('0x24')]=_0x5827aa['dialLimitQueue']||0x0;this[_0xd3dd('0x25')]=_0x5827aa['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x5827aa[_0xd3dd('0x26')]||_0xd3dd('0x27');this[_0xd3dd('0x28')]=_0x5827aa[_0xd3dd('0x28')]||0.03;this['dialPredictiveInterval']=_0x5827aa[_0xd3dd('0x29')]||0x258;this[_0xd3dd('0x2a')]=_0x5827aa[_0xd3dd('0x2a')]||'anonymous';this[_0xd3dd('0x2b')]=_0x5827aa[_0xd3dd('0x2b')]||'anonymous';this['dialOriginateTimeout']=_0x5827aa[_0xd3dd('0x2c')]||0x1e;this[_0xd3dd('0x2d')]=_0x5827aa['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x5827aa[_0xd3dd('0x2e')]||0x3;this[_0xd3dd('0x2f')]=_0x5827aa[_0xd3dd('0x2f')]||undefined;this[_0xd3dd('0x30')]=_0x5827aa[_0xd3dd('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x5827aa[_0xd3dd('0x31')]||0x96;this[_0xd3dd('0x32')]=_0x5827aa[_0xd3dd('0x32')]||0x3;this[_0xd3dd('0x33')]=_0x5827aa[_0xd3dd('0x33')]||0x96;this[_0xd3dd('0x34')]=_0x5827aa['dialNoAnswerMaxRetry']||0x3;this[_0xd3dd('0x35')]=_0x5827aa[_0xd3dd('0x35')]||0x96;this[_0xd3dd('0x36')]=_0x5827aa[_0xd3dd('0x36')]||0x3;this[_0xd3dd('0x37')]=_0x5827aa['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x5827aa['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x5827aa[_0xd3dd('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x5827aa[_0xd3dd('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x5827aa[_0xd3dd('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x5827aa[_0xd3dd('0x3b')]||0x3;this[_0xd3dd('0x3c')]=_0x5827aa['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5827aa[_0xd3dd('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5827aa[_0xd3dd('0x3e')]||0x96;this['dialGlobalMaxRetry']=_0x5827aa[_0xd3dd('0x3f')]||0x4;this[_0xd3dd('0x40')]=_0x5827aa[_0xd3dd('0x40')]?_0x5827aa[_0xd3dd('0x40')]:undefined;this[_0xd3dd('0x41')]=_0x5827aa[_0xd3dd('0x41')]?_0x5827aa[_0xd3dd('0x41')]:undefined;this[_0xd3dd('0x42')]=_0x5827aa['dialPrefix']||undefined;this[_0xd3dd('0x43')]=_0x5827aa[_0xd3dd('0x43')]?_0x5827aa[_0xd3dd('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x5827aa[_0xd3dd('0x44')]||_0xd3dd('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x5827aa[_0xd3dd('0x46')]||undefined;this[_0xd3dd('0x47')]=_0x5827aa[_0xd3dd('0x47')]||undefined;this[_0xd3dd('0x48')]=strategy[_0x5827aa['strategy']]||_0xd3dd('0xb');this[_0xd3dd('0x49')]=!![];this[_0xd3dd('0x4a')]=_0x5827aa[_0xd3dd('0x4a')]||![];this['dialAMDInitialSilence']=_0x5827aa['dialAMDInitialSilence'];this[_0xd3dd('0x4b')]=_0x5827aa[_0xd3dd('0x4b')];this['dialAMDAfterGreetingSilence']=_0x5827aa['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5827aa[_0xd3dd('0x4c')];this[_0xd3dd('0x4d')]=_0x5827aa[_0xd3dd('0x4d')];this['dialAMDBetweenWordsSilence']=_0x5827aa[_0xd3dd('0x4e')];this[_0xd3dd('0x4f')]=_0x5827aa['dialAMDMaximumNumberOfWords'];this[_0xd3dd('0x50')]=_0x5827aa[_0xd3dd('0x50')];this['dialAMDMaximumWordLength']=_0x5827aa[_0xd3dd('0x51')];this[_0xd3dd('0x52')]=0x0;this[_0xd3dd('0x53')]=0x0;this[_0xd3dd('0x54')]=_0x5827aa[_0xd3dd('0x54')];this[_0xd3dd('0x55')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xd3dd('0x56')]=0x0;this[_0xd3dd('0x57')]=0x0;this[_0xd3dd('0x58')]=0x0;this[_0xd3dd('0x59')]=0x0;this[_0xd3dd('0x5a')]=0x0;this[_0xd3dd('0x5b')]=0x0;this[_0xd3dd('0x5c')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xd3dd('0x5d')]=0x0;this[_0xd3dd('0x5e')]=0x0;this[_0xd3dd('0x5f')]=0x0;this[_0xd3dd('0x60')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xd3dd('0x61')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xd3dd('0x62')]=0x0;this[_0xd3dd('0x63')]=0x0;this[_0xd3dd('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xd3dd('0x65')]=0x0;this[_0xd3dd('0x66')]=0x0;this[_0xd3dd('0x67')]=_0x5827aa[_0xd3dd('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x5827aa[_0xd3dd('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd3dd('0x69')]=0x0;this[_0xd3dd('0x6a')]=0x1;this['erlangCalls']=0x0;this[_0xd3dd('0x6b')]=0x0;this[_0xd3dd('0x6c')]=0x0;this[_0xd3dd('0x6d')]=0x0;this[_0xd3dd('0x6e')]=_0x5827aa[_0xd3dd('0x6e')]||0x1e;this[_0xd3dd('0x6f')]=_0x5827aa[_0xd3dd('0x6f')]||![];this[_0xd3dd('0x70')]=!!_0x5827aa[_0xd3dd('0x70')]||![];this[_0xd3dd('0x71')]=_0x5827aa[_0xd3dd('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x5827aa[_0xd3dd('0x72')]||![];this[_0xd3dd('0x73')]=_0x5827aa['dialAgiAfterHangupAgent']||![];this[_0xd3dd('0xe')]=monitorFormat[_0x5827aa[_0xd3dd('0xe')]]?monitorFormat[_0x5827aa[_0xd3dd('0xe')]]:undefined;this['mandatoryDisposition']=_0x5827aa[_0xd3dd('0x74')]||![];this[_0xd3dd('0x75')]=_0x5827aa[_0xd3dd('0x75')]?_0x5827aa[_0xd3dd('0x75')]:undefined;}module[_0xd3dd('0x76')]=VoiceQueue; \ No newline at end of file +var _0x5dd8=['queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','wav','rrmemory','roundrobin','name','monitor_format','inbound','waiting','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x5dd8,0x196));var _0x85dd=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x5dd8[_0x4a5f6c];return _0x281ffd;};'use strict';var statusDesc=[_0x85dd('0x0'),_0x85dd('0x1'),_0x85dd('0x2'),_0x85dd('0x3'),'invalid',_0x85dd('0x4'),_0x85dd('0x5'),_0x85dd('0x6'),'onhold'];var monitorFormat={'wav':_0x85dd('0x7'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x85dd('0x8'),'roundrobin':_0x85dd('0x9')};function VoiceQueue(_0x5c2bbd){this['id']=_0x5c2bbd['id']||0x0;this[_0x85dd('0xa')]=_0x5c2bbd[_0x85dd('0xa')]||'';this['monitor_format']=_0x5c2bbd[_0x85dd('0xb')]||'';this['type']=_0x5c2bbd['type']||_0x85dd('0xc');this[_0x85dd('0xd')]=0x0;this['talking']=0x0;this['total']=0x0;this['answered']=0x0;this[_0x85dd('0xe')]=0x0;this[_0x85dd('0xf')]=0x0;this[_0x85dd('0x10')]=0x0;this[_0x85dd('0x11')]=0x0;this[_0x85dd('0x12')]=0x0;this[_0x85dd('0x13')]=0x0;this[_0x85dd('0x14')]=0x0;this[_0x85dd('0x15')]=_0x5c2bbd[_0x85dd('0x15')]||![];this['acwTimeout']=_0x5c2bbd[_0x85dd('0x16')]||0xa;this[_0x85dd('0x17')]=_0x5c2bbd['autopause']||'no';this[_0x85dd('0x18')]=!![];this[_0x85dd('0x19')]='';this['originated']=0x0;this[_0x85dd('0x1a')]=0x0;this[_0x85dd('0x1b')]=_0x5c2bbd[_0x85dd('0x1b')]||null;this['dialGlobalInterval']=_0x5c2bbd[_0x85dd('0x1c')]?_0x5c2bbd['dialGlobalInterval']:null;this['dialActive']=_0x5c2bbd['dialActive'];this[_0x85dd('0x1d')]=_0x5c2bbd['dialMethod']||_0x85dd('0x1e');this[_0x85dd('0x1f')]=_0x5c2bbd[_0x85dd('0x1f')]||0x0;this[_0x85dd('0x20')]=_0x5c2bbd[_0x85dd('0x20')]||0x0;this['dialPowerLevel']=_0x5c2bbd[_0x85dd('0x21')]||0x1;this[_0x85dd('0x22')]=_0x5c2bbd['dialPredictiveOptimization']||_0x85dd('0x23');this[_0x85dd('0x24')]=_0x5c2bbd['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x5c2bbd[_0x85dd('0x25')]||0x258;this[_0x85dd('0x26')]=_0x5c2bbd[_0x85dd('0x26')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x5c2bbd[_0x85dd('0x27')]||'anonymous';this[_0x85dd('0x28')]=_0x5c2bbd[_0x85dd('0x28')]||0x1e;this[_0x85dd('0x29')]=_0x5c2bbd[_0x85dd('0x29')]||_0x85dd('0x2a');this[_0x85dd('0x2b')]=_0x5c2bbd[_0x85dd('0x2b')]||0x3;this[_0x85dd('0x2c')]=_0x5c2bbd[_0x85dd('0x2c')]||undefined;this[_0x85dd('0x2d')]=_0x5c2bbd['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x5c2bbd[_0x85dd('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x5c2bbd[_0x85dd('0x2f')]||0x3;this[_0x85dd('0x30')]=_0x5c2bbd[_0x85dd('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x5c2bbd['dialNoAnswerMaxRetry']||0x3;this[_0x85dd('0x31')]=_0x5c2bbd[_0x85dd('0x31')]||0x96;this[_0x85dd('0x32')]=_0x5c2bbd['dialNoSuchNumberMaxRetry']||0x3;this[_0x85dd('0x33')]=_0x5c2bbd[_0x85dd('0x33')]||0x96;this[_0x85dd('0x34')]=_0x5c2bbd[_0x85dd('0x34')]||0x3;this['dialDropRetryFrequency']=_0x5c2bbd[_0x85dd('0x35')]||0x96;this[_0x85dd('0x36')]=_0x5c2bbd[_0x85dd('0x36')]||0x3;this[_0x85dd('0x37')]=_0x5c2bbd[_0x85dd('0x37')]||0x96;this[_0x85dd('0x38')]=_0x5c2bbd[_0x85dd('0x38')]||0x3;this['dialMachineRetryFrequency']=_0x5c2bbd[_0x85dd('0x39')]||0x96;this[_0x85dd('0x3a')]=_0x5c2bbd[_0x85dd('0x3a')]||0x3;this[_0x85dd('0x3b')]=_0x5c2bbd[_0x85dd('0x3b')]||0x96;this[_0x85dd('0x3c')]=_0x5c2bbd[_0x85dd('0x3c')]||0x4;this[_0x85dd('0x3d')]=_0x5c2bbd[_0x85dd('0x3d')]?_0x5c2bbd[_0x85dd('0x3d')]:undefined;this[_0x85dd('0x3e')]=_0x5c2bbd[_0x85dd('0x3e')]?_0x5c2bbd['TrunkBackup']:undefined;this[_0x85dd('0x3f')]=_0x5c2bbd[_0x85dd('0x3f')]||undefined;this[_0x85dd('0x40')]=_0x5c2bbd['Interval']?_0x5c2bbd[_0x85dd('0x40')]:undefined;this[_0x85dd('0x41')]=_0x5c2bbd['dialOrderByScheduledAt']||_0x85dd('0x42');this[_0x85dd('0x43')]=_0x5c2bbd[_0x85dd('0x43')]||undefined;this[_0x85dd('0x44')]=_0x5c2bbd[_0x85dd('0x44')]||undefined;this[_0x85dd('0x45')]=strategy[_0x5c2bbd[_0x85dd('0x45')]]||_0x85dd('0x8');this[_0x85dd('0x46')]=!![];this[_0x85dd('0x47')]=_0x5c2bbd['dialAMDActive']||![];this[_0x85dd('0x48')]=_0x5c2bbd[_0x85dd('0x48')];this[_0x85dd('0x49')]=_0x5c2bbd['dialAMDGreeting'];this[_0x85dd('0x4a')]=_0x5c2bbd['dialAMDAfterGreetingSilence'];this[_0x85dd('0x4b')]=_0x5c2bbd[_0x85dd('0x4b')];this[_0x85dd('0x4c')]=_0x5c2bbd[_0x85dd('0x4c')];this['dialAMDBetweenWordsSilence']=_0x5c2bbd[_0x85dd('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x5c2bbd['dialAMDMaximumNumberOfWords'];this[_0x85dd('0x4e')]=_0x5c2bbd[_0x85dd('0x4e')];this[_0x85dd('0x4f')]=_0x5c2bbd[_0x85dd('0x4f')];this[_0x85dd('0x50')]=0x0;this[_0x85dd('0x51')]=0x0;this[_0x85dd('0x52')]=_0x5c2bbd[_0x85dd('0x52')];this[_0x85dd('0x53')]=0x0;this[_0x85dd('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x85dd('0x55')]=0x0;this[_0x85dd('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x85dd('0x57')]=0x0;this[_0x85dd('0x58')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x85dd('0x59')]=0x0;this['outboundReCallsDay']=0x0;this[_0x85dd('0x5a')]=0x0;this[_0x85dd('0x5b')]=undefined;this[_0x85dd('0x5c')]=undefined;this[_0x85dd('0x5d')]=undefined;this[_0x85dd('0x5e')]=1.05;this[_0x85dd('0x5f')]=0x0;this[_0x85dd('0x60')]=0x0;this[_0x85dd('0x61')]=0x0;this[_0x85dd('0x62')]=0x0;this[_0x85dd('0x63')]=0x0;this[_0x85dd('0x64')]=0x0;this[_0x85dd('0x65')]=0x0;this[_0x85dd('0x66')]=0x0;this[_0x85dd('0x67')]=_0x5c2bbd[_0x85dd('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x5c2bbd[_0x85dd('0x68')]||0xa;this[_0x85dd('0x69')]=0x0;this[_0x85dd('0x6a')]=0x0;this[_0x85dd('0x6b')]=0x1;this[_0x85dd('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this[_0x85dd('0x6d')]=0x0;this[_0x85dd('0x6e')]=0x0;this['dialRecallMeTimeout']=_0x5c2bbd['dialRecallMeTimeout']||0x1e;this[_0x85dd('0x6f')]=_0x5c2bbd[_0x85dd('0x6f')]||![];this[_0x85dd('0x70')]=!!_0x5c2bbd['dialPreviewAutoRecallMe']||![];this[_0x85dd('0x71')]=_0x5c2bbd[_0x85dd('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x5c2bbd[_0x85dd('0x72')]||![];this[_0x85dd('0x73')]=_0x5c2bbd[_0x85dd('0x73')]||![];this[_0x85dd('0xb')]=monitorFormat[_0x5c2bbd[_0x85dd('0xb')]]?monitorFormat[_0x5c2bbd[_0x85dd('0xb')]]:undefined;this[_0x85dd('0x74')]=_0x5c2bbd['mandatoryDisposition']||![];this[_0x85dd('0x75')]=_0x5c2bbd['mandatoryDispositionPause']?_0x5c2bbd[_0x85dd('0x75')]:undefined;}module[_0x85dd('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 2f3882e..4d5c29c 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 _0x7a91=['name','username','accessKey','remoteUri','serverUrl','exports'];(function(_0x5a768d,_0xac271c){var _0x4612ce=function(_0x563fae){while(--_0x563fae){_0x5a768d['push'](_0x5a768d['shift']());}};_0x4612ce(++_0xac271c);}(_0x7a91,0x12c));var _0x17a9=function(_0x2a32e1,_0x2dd0ff){_0x2a32e1=_0x2a32e1-0x0;var _0x1691d2=_0x7a91[_0x2a32e1];return _0x1691d2;};'use strict';function VtigerAccount(_0x4335c2){this['id']=_0x4335c2['id']||0x0;this[_0x17a9('0x0')]=_0x4335c2[_0x17a9('0x0')]||'';this[_0x17a9('0x1')]=_0x4335c2[_0x17a9('0x1')]||'';this[_0x17a9('0x2')]=_0x4335c2['accessKey']||'';this[_0x17a9('0x3')]=_0x4335c2[_0x17a9('0x3')]||'';this[_0x17a9('0x4')]=_0x4335c2[_0x17a9('0x4')]||'';this['Configurations']=_0x4335c2['Configurations']||{};}module[_0x17a9('0x5')]=VtigerAccount; \ No newline at end of file +var _0x2eaa=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0x3f428a,_0x31629c){var _0x483533=function(_0x43bd02){while(--_0x43bd02){_0x3f428a['push'](_0x3f428a['shift']());}};_0x483533(++_0x31629c);}(_0x2eaa,0xc2));var _0xa2ea=function(_0x22c26f,_0x492b0e){_0x22c26f=_0x22c26f-0x0;var _0xac9585=_0x2eaa[_0x22c26f];return _0xac9585;};'use strict';function VtigerAccount(_0x2f71a8){this['id']=_0x2f71a8['id']||0x0;this[_0xa2ea('0x0')]=_0x2f71a8[_0xa2ea('0x0')]||'';this['username']=_0x2f71a8[_0xa2ea('0x1')]||'';this[_0xa2ea('0x2')]=_0x2f71a8[_0xa2ea('0x2')]||'';this['remoteUri']=_0x2f71a8[_0xa2ea('0x3')]||'';this[_0xa2ea('0x4')]=_0x2f71a8[_0xa2ea('0x4')]||'';this[_0xa2ea('0x5')]=_0x2f71a8[_0xa2ea('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ea21711..582975a 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 _0xb187=['remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x2a6ad6,_0x4a3114){var _0x4c20ef=function(_0x59ade1){while(--_0x59ade1){_0x2a6ad6['push'](_0x2a6ad6['shift']());}};_0x4c20ef(++_0x4a3114);}(_0xb187,0x1f0));var _0x7b18=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0xb187[_0x1139d0];return _0xcc01a6;};'use strict';function ZendeskAccount(_0x2a8170){this['id']=_0x2a8170['id']||0x0;this[_0x7b18('0x0')]=_0x2a8170[_0x7b18('0x0')]||'';this[_0x7b18('0x1')]=_0x2a8170[_0x7b18('0x1')]||'';this['password']=_0x2a8170[_0x7b18('0x2')]||'';this['token']=_0x2a8170[_0x7b18('0x3')]||'';this[_0x7b18('0x4')]=_0x2a8170[_0x7b18('0x4')]||'';this[_0x7b18('0x5')]=_0x2a8170['authType']||'';this[_0x7b18('0x6')]=_0x2a8170[_0x7b18('0x6')]||'integrationTab';this['serverUrl']=_0x2a8170[_0x7b18('0x7')]||'';this[_0x7b18('0x8')]=_0x2a8170[_0x7b18('0x8')]||{};}module[_0x7b18('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xc6f2=['Configurations','exports','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x30950e,_0x3fc5be){var _0x192fb8=function(_0x3ac863){while(--_0x3ac863){_0x30950e['push'](_0x30950e['shift']());}};_0x192fb8(++_0x3fc5be);}(_0xc6f2,0xa2));var _0x2c6f=function(_0x420fc2,_0x344703){_0x420fc2=_0x420fc2-0x0;var _0x5a70c2=_0xc6f2[_0x420fc2];return _0x5a70c2;};'use strict';function ZendeskAccount(_0x4770ba){this['id']=_0x4770ba['id']||0x0;this['name']=_0x4770ba['name']||'';this[_0x2c6f('0x0')]=_0x4770ba['username']||'';this[_0x2c6f('0x1')]=_0x4770ba[_0x2c6f('0x1')]||'';this['token']=_0x4770ba[_0x2c6f('0x2')]||'';this[_0x2c6f('0x3')]=_0x4770ba['remoteUri']||'';this[_0x2c6f('0x4')]=_0x4770ba['authType']||'';this[_0x2c6f('0x5')]=_0x4770ba[_0x2c6f('0x5')]||_0x2c6f('0x6');this[_0x2c6f('0x7')]=_0x4770ba[_0x2c6f('0x7')]||'';this['Configurations']=_0x4770ba[_0x2c6f('0x8')]||{};}module[_0x2c6f('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 0b09928..33c1515 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 _0x93de=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x93de,0xbc));var _0xe93d=function(_0x1ca997,_0x3cecd7){_0x1ca997=_0x1ca997-0x0;var _0x28d96f=_0x93de[_0x1ca997];return _0x28d96f;};'use strict';function ZohoAccount(_0x430949){this['id']=_0x430949['id']||0x0;this[_0xe93d('0x0')]=_0x430949['name']||'';this[_0xe93d('0x1')]=_0x430949[_0xe93d('0x1')]||'';this[_0xe93d('0x2')]=_0x430949[_0xe93d('0x2')]||'';this[_0xe93d('0x3')]=_0x430949['zone']||'';this[_0xe93d('0x4')]=_0x430949[_0xe93d('0x4')]||'';this[_0xe93d('0x5')]=_0x430949[_0xe93d('0x5')]||'';this[_0xe93d('0x6')]=_0x430949[_0xe93d('0x6')]||'';this[_0xe93d('0x7')]=_0x430949[_0xe93d('0x7')]||'';this['refreshToken']=_0x430949[_0xe93d('0x8')]||'';this['Configurations']=_0x430949[_0xe93d('0x9')]||{};}module[_0xe93d('0xa')]=ZohoAccount; \ No newline at end of file +var _0xbbe7=['code','Configurations','exports','name','description','zone','clientSecret','serverUrl'];(function(_0x1a319a,_0x38dd71){var _0x18541b=function(_0x13ed3a){while(--_0x13ed3a){_0x1a319a['push'](_0x1a319a['shift']());}};_0x18541b(++_0x38dd71);}(_0xbbe7,0x1f3));var _0x7bbe=function(_0x1f6178,_0xd0b1a){_0x1f6178=_0x1f6178-0x0;var _0x591767=_0xbbe7[_0x1f6178];return _0x591767;};'use strict';function ZohoAccount(_0x351265){this['id']=_0x351265['id']||0x0;this['name']=_0x351265[_0x7bbe('0x0')]||'';this[_0x7bbe('0x1')]=_0x351265[_0x7bbe('0x1')]||'';this['host']=_0x351265['host']||'';this[_0x7bbe('0x2')]=_0x351265['zone']||'';this['clientId']=_0x351265['clientId']||'';this[_0x7bbe('0x3')]=_0x351265[_0x7bbe('0x3')]||'';this[_0x7bbe('0x4')]=_0x351265[_0x7bbe('0x4')]||'';this[_0x7bbe('0x5')]=_0x351265[_0x7bbe('0x5')]||'';this['refreshToken']=_0x351265['refreshToken']||'';this[_0x7bbe('0x6')]=_0x351265[_0x7bbe('0x6')]||{};}module[_0x7bbe('0x7')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index c979806..5b2b632 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 _0xd232=['string','queue','name','type','membername','Agent','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil'];(function(_0x2ac3cf,_0x465bb6){var _0x27dcca=function(_0x33f954){while(--_0x33f954){_0x2ac3cf['push'](_0x2ac3cf['shift']());}};_0x27dcca(++_0x465bb6);}(_0xd232,0xed));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x2d23('0x0'));var moment=require(_0x2d23('0x1'));function checkNameSurname(_0x1a4d25,_0x18f40c,_0x14bd6b){var _0x37910d='';if(!_[_0x2d23('0x2')](_0x18f40c)&&'string'===typeof _0x18f40c){_0x37910d+=_0x18f40c;}if(!_[_0x2d23('0x2')](_0x14bd6b)&&_0x2d23('0x3')===typeof _0x14bd6b){_0x37910d+='\x20'+_0x14bd6b;}if(_0x37910d!==''){return _0x37910d;}return _0x1a4d25;}function Action(_0x1da428,_0x1854b9,_0x495512,_0x3331ea,_0x1635ae){this['uniqueid']=_0x495512||undefined;this['idContact']=_0x1da428['id'];this[_0x2d23('0x4')]=_0x1854b9[_0x2d23('0x5')];this['type']=_0x1854b9[_0x2d23('0x6')];this['campaigntype']=_0x2d23('0x4');this['dialAnswer']=![];this[_0x2d23('0x7')]=_[_0x2d23('0x2')](_0x1da428[_0x2d23('0x8')])?undefined:_0x1da428[_0x2d23('0x8')][_0x2d23('0x5')];this[_0x2d23('0x9')]=this[_0x2d23('0x7')]?util[_0x2d23('0xa')]('SIP/%s',this[_0x2d23('0x7')]):_0x3331ea||undefined;this[_0x2d23('0xb')]=checkNameSurname(_0x1da428[_0x2d23('0xc')][_0x2d23('0xd')],_0x1da428[_0x2d23('0xc')]['firstName'],_0x1da428[_0x2d23('0xc')][_0x2d23('0xe')]);this['active']=_0x1da428[_0x2d23('0xf')]||![];this[_0x2d23('0x10')]=_0x1da428[_0x2d23('0xc')][_0x2d23('0xd')];this['scheduledat']=_0x1da428[_0x2d23('0x11')];this[_0x2d23('0x12')]=_0x1da428[_0x2d23('0x12')]||0x0;this['countcongestionretry']=_0x1da428[_0x2d23('0x13')]||0x0;this[_0x2d23('0x14')]=_0x1da428['countnoanswerretry']||0x0;this[_0x2d23('0x15')]=(_0x1da428['countbusyretry']||0x0)+(_0x1da428[_0x2d23('0x13')]||0x0)+(_0x1da428[_0x2d23('0x14')]||0x0)+(_0x1da428[_0x2d23('0x16')]||0x0)+(_0x1da428[_0x2d23('0x17')]||0x0)+(_0x1da428['countabandonedretry']||0x0)+(_0x1da428[_0x2d23('0x18')]||0x0)+(_0x1da428[_0x2d23('0x19')]||0x0);this[_0x2d23('0x16')]=_0x1da428[_0x2d23('0x16')]||0x0;this[_0x2d23('0x17')]=_0x1da428[_0x2d23('0x17')]||0x0;this[_0x2d23('0x1a')]=_0x1da428['countabandonedretry']||0x0;this[_0x2d23('0x18')]=_0x1da428[_0x2d23('0x18')]||0x0;this[_0x2d23('0x19')]=_0x1da428['countagentrejectretry']||0x0;this[_0x2d23('0x1b')]=_0x1da428[_0x2d23('0x1b')];this[_0x2d23('0x1c')]=_0x1da428[_0x2d23('0x1c')];this[_0x2d23('0x1d')]=_0x1da428['callbackat'];this[_0x2d23('0x1e')]=_0x1da428[_0x2d23('0x1e')];this[_0x2d23('0x1f')]=_0x1da428[_0x2d23('0x1f')];this['ListId']=_0x1da428['ListId'];this[_0x2d23('0x20')]=_[_0x2d23('0x2')](_0x1da428[_0x2d23('0x8')])?_0x1da428[_0x2d23('0x20')]:_0x1da428[_0x2d23('0x8')]['id'];this['VoiceQueueId']=_0x1da428[_0x2d23('0x21')];this[_0x2d23('0x22')]='';this[_0x2d23('0x23')]='';}Action[_0x2d23('0x24')]['getCaller']=function(){return util[_0x2d23('0xa')](_0x2d23('0x25'),this[_0x2d23('0xb')],this[_0x2d23('0x26')]);};module[_0x2d23('0x27')]=Action; \ No newline at end of file +var _0x98b9=['channelAgent','format','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','dialAnswer','membername','Agent'];(function(_0x101ed4,_0x6c3c54){var _0x2242e3=function(_0x284096){while(--_0x284096){_0x101ed4['push'](_0x101ed4['shift']());}};_0x2242e3(++_0x6c3c54);}(_0x98b9,0x72));var _0x998b=function(_0x156c84,_0x48d03a){_0x156c84=_0x156c84-0x0;var _0x6cec85=_0x98b9[_0x156c84];return _0x6cec85;};'use strict';var util=require(_0x998b('0x0'));var _=require(_0x998b('0x1'));var moment=require(_0x998b('0x2'));function checkNameSurname(_0x449d89,_0xe172b4,_0x46a077){var _0x40c977='';if(!_[_0x998b('0x3')](_0xe172b4)&&_0x998b('0x4')===typeof _0xe172b4){_0x40c977+=_0xe172b4;}if(!_['isNil'](_0x46a077)&&'string'===typeof _0x46a077){_0x40c977+='\x20'+_0x46a077;}if(_0x40c977!==''){return _0x40c977;}return _0x449d89;}function Action(_0x37ecab,_0x718441,_0x1c416a,_0x560e56,_0x273f7e){this[_0x998b('0x5')]=_0x1c416a||undefined;this['idContact']=_0x37ecab['id'];this[_0x998b('0x6')]=_0x718441[_0x998b('0x7')];this[_0x998b('0x8')]=_0x718441[_0x998b('0x8')];this['campaigntype']=_0x998b('0x6');this[_0x998b('0x9')]=![];this[_0x998b('0xa')]=_['isNil'](_0x37ecab[_0x998b('0xb')])?undefined:_0x37ecab[_0x998b('0xb')][_0x998b('0x7')];this[_0x998b('0xc')]=this[_0x998b('0xa')]?util[_0x998b('0xd')]('SIP/%s',this[_0x998b('0xa')]):_0x560e56||undefined;this['calleridname']=checkNameSurname(_0x37ecab[_0x998b('0xe')][_0x998b('0xf')],_0x37ecab[_0x998b('0xe')][_0x998b('0x10')],_0x37ecab[_0x998b('0xe')][_0x998b('0x11')]);this[_0x998b('0x12')]=_0x37ecab['active']||![];this[_0x998b('0x13')]=_0x37ecab[_0x998b('0xe')][_0x998b('0xf')];this[_0x998b('0x14')]=_0x37ecab[_0x998b('0x14')];this[_0x998b('0x15')]=_0x37ecab[_0x998b('0x15')]||0x0;this[_0x998b('0x16')]=_0x37ecab[_0x998b('0x16')]||0x0;this[_0x998b('0x17')]=_0x37ecab[_0x998b('0x17')]||0x0;this['countglobal']=(_0x37ecab[_0x998b('0x15')]||0x0)+(_0x37ecab[_0x998b('0x16')]||0x0)+(_0x37ecab['countnoanswerretry']||0x0)+(_0x37ecab[_0x998b('0x18')]||0x0)+(_0x37ecab[_0x998b('0x19')]||0x0)+(_0x37ecab[_0x998b('0x1a')]||0x0)+(_0x37ecab['countmachineretry']||0x0)+(_0x37ecab[_0x998b('0x1b')]||0x0);this[_0x998b('0x18')]=_0x37ecab['countnosuchnumberretry']||0x0;this[_0x998b('0x19')]=_0x37ecab[_0x998b('0x19')]||0x0;this[_0x998b('0x1a')]=_0x37ecab['countabandonedretry']||0x0;this[_0x998b('0x1c')]=_0x37ecab['countmachineretry']||0x0;this['countagentrejectretry']=_0x37ecab['countagentrejectretry']||0x0;this[_0x998b('0x1d')]=_0x37ecab['callback'];this[_0x998b('0x1e')]=_0x37ecab['callbackuniqueid'];this[_0x998b('0x1f')]=_0x37ecab['callbackat'];this[_0x998b('0x20')]=_0x37ecab['recallme'];this[_0x998b('0x21')]=_0x37ecab[_0x998b('0x21')];this[_0x998b('0x22')]=_0x37ecab[_0x998b('0x22')];this['UserId']=_['isNil'](_0x37ecab[_0x998b('0xb')])?_0x37ecab['UserId']:_0x37ecab[_0x998b('0xb')]['id'];this['VoiceQueueId']=_0x37ecab[_0x998b('0x23')];this[_0x998b('0x24')]='';this[_0x998b('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x998b('0xd')](_0x998b('0x26'),this[_0x998b('0x27')],this[_0x998b('0x28')]);};module[_0x998b('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a91ac93..f162049 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 _0x9957=['[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','responsetime','response','idContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','syncCampaigns','preview','dialMethod','booked','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','dialPreviewAutoRecallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent','then','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','Answer'];(function(_0x153696,_0x52a4f8){var _0x33268a=function(_0x339fed){while(--_0x339fed){_0x153696['push'](_0x153696['shift']());}};_0x33268a(++_0x52a4f8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var uuid=require(_0x7995('0x3'));var moment=require('moment');var md5=require(_0x7995('0x4'));var Redis=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('preview');var loggerAction=require(_0x7995('0x7'))(_0x7995('0x8'));var ami=require(_0x7995('0x9'));var rpcDb=require(_0x7995('0xa'));var Action=require(_0x7995('0xb'));var ut=require(_0x7995('0xc'));config['redis']=_[_0x7995('0xd')](config[_0x7995('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x7995('0xf'))(new Redis(config[_0x7995('0xe')]));var Sequence=function(){};Sequence[_0x7995('0x10')][_0x7995('0x11')]=function(_0x3c1d19){this[_0x7995('0x12')]=this[_0x7995('0x12')]?this['tail'][_0x7995('0x13')](_0x3c1d19):_0x3c1d19();};function Preview(_0x41c652){this['sequence']=new Sequence();this[_0x7995('0x14')]=_0x41c652[_0x7995('0x15')];this[_0x7995('0x16')]=_0x41c652[_0x7995('0x16')];this[_0x7995('0x17')]={};this[_0x7995('0x18')]=_0x41c652[_0x7995('0x18')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x7995('0x19')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x1b'),this[_0x7995('0x1c')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x1d'),this[_0x7995('0x1e')][_0x7995('0x1a')](this));ami['on']('dialend',this[_0x7995('0x1f')]['bind'](this));ami['on'](_0x7995('0x20'),this[_0x7995('0x21')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x22'),this[_0x7995('0x23')][_0x7995('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7995('0x1a')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x7995('0x1a')](this));this[_0x7995('0x24')](this['campaignsPreview']);}function emit(_0x3a9b54,_0x51f276,_0x4b1a8e){io['to'](_0x3a9b54)[_0x7995('0x25')](_0x51f276,_0x4b1a8e);}function emitCampaignPreview(_0x327b1f){if(_0x327b1f[_0x7995('0x26')]===_0x7995('0x27')){var _0x460924={'id':_0x327b1f['id'],'name':_0x327b1f[_0x7995('0x28')],'strategy':_0x327b1f['strategy'],'answered':_0x327b1f[_0x7995('0x29')],'available':_0x327b1f[_0x7995('0x2a')],'loggedIn':_0x327b1f[_0x7995('0x2b')],'pTalking':_0x327b1f[_0x7995('0x2c')],'sumBillable':_0x327b1f[_0x7995('0x2d')],'sumDuration':_0x327b1f[_0x7995('0x2e')],'sumHoldTime':_0x327b1f[_0x7995('0x2f')]||0x0,'talking':_0x327b1f[_0x7995('0x30')],'total':_0x327b1f['total'],'type':_0x327b1f[_0x7995('0x26')],'unmanaged':_0x327b1f[_0x7995('0x31')],'abandoned':_0x327b1f[_0x7995('0x32')],'waiting':_0x327b1f[_0x7995('0x33')],'loggedInDb':_0x327b1f[_0x7995('0x34')],'dialActive':_0x327b1f[_0x7995('0x35')],'dialMethod':_0x327b1f['dialMethod'],'dialOriginateCallerIdName':_0x327b1f[_0x7995('0x36')],'dialOriginateCallerIdNumber':_0x327b1f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x327b1f[_0x7995('0x37')],'dialPrefix':_0x327b1f[_0x7995('0x38')],'outboundAnswerAgiCallsDay':_0x327b1f[_0x7995('0x39')],'outboundAnswerCallsDay':_0x327b1f[_0x7995('0x3a')],'outboundBlacklistCallsDay':_0x327b1f[_0x7995('0x3b')],'outboundBusyCallsDay':_0x327b1f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x327b1f[_0x7995('0x3c')],'outboundDropCallsDayACS':_0x327b1f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x327b1f[_0x7995('0x3d')],'outboundDropCallsDayTimeout':_0x327b1f[_0x7995('0x3e')],'outboundNoAnswerCallsDay':_0x327b1f[_0x7995('0x3f')],'outboundNoSuchCallsDay':_0x327b1f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x327b1f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x327b1f['outboundReCallsDay'],'outboundRejectCallsDay':_0x327b1f[_0x7995('0x40')],'outboundUnknownCallsDay':_0x327b1f[_0x7995('0x41')],'outboundAbandonedCallsDay':_0x327b1f[_0x7995('0x42')],'predictiveIntervalAnsweredCalls':_0x327b1f[_0x7995('0x43')],'predictiveIntervalAvgHoldtime':_0x327b1f[_0x7995('0x44')],'predictiveIntervalAvgTalktime':_0x327b1f[_0x7995('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x327b1f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x327b1f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x327b1f[_0x7995('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x327b1f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x327b1f[_0x7995('0x47')],'predictiveIntervalMultiplicativeFactor':_0x327b1f[_0x7995('0x48')],'predictiveIntervalPauses':_0x327b1f[_0x7995('0x49')],'predictiveIntervalAvailable':_0x327b1f[_0x7995('0x4a')],'predictiveIntervalTotalCalls':_0x327b1f[_0x7995('0x4b')],'message':_0x327b1f['message'],'originated':_0x327b1f[_0x7995('0x4c')],'erlangCalls':_0x327b1f[_0x7995('0x4d')],'erlangCallToSecond':_0x327b1f['erlangCallToSecond'],'erlangAbandonmentRate':_0x327b1f['erlangAbandonmentRate'],'erlangBusyFactor':_0x327b1f['erlangBusyFactor'],'startPredictive':_0x327b1f[_0x7995('0x4e')],'startProgressive':_0x327b1f[_0x7995('0x4f')]};if(_0x327b1f['Trunk']){_0x460924[_0x7995('0x50')]={'id':_0x327b1f['Trunk']['id'],'name':_0x327b1f[_0x7995('0x50')][_0x7995('0x28')],'active':_0x327b1f[_0x7995('0x50')]['active'],'callerid':_0x327b1f['Trunk'][_0x7995('0x51')]};}if(_0x327b1f['Interval']){_0x460924['Interval']={'id':_0x327b1f[_0x7995('0x52')]['id'],'name':_0x327b1f[_0x7995('0x52')]['name']};}var _0x1baa15=md5(JSON[_0x7995('0x53')](_0x460924));if(_0x327b1f[_0x7995('0x4')]!==_0x1baa15){_0x327b1f[_0x7995('0x4')]=_0x1baa15;emit(util[_0x7995('0x54')]('voice:queue:%s',_0x460924[_0x7995('0x28')]),_0x7995('0x55'),_0x460924);}}}function emitVoiceQueueChannelRemove(_0xf612e6){logger[_0x7995('0x56')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7995('0x53')](_0xf612e6));emit(util[_0x7995('0x54')](_0x7995('0x57'),_0xf612e6[_0x7995('0x28')]),_0x7995('0x58'),_0xf612e6);io[_0x7995('0x25')]('voice_queue_presence:remove',_0xf612e6);}function notSendMessagesQueue(_0x183a68){if(_0x183a68[_0x7995('0x59')]){if(_0x183a68[_0x7995('0x4c')]===0x0&&_0x183a68[_0x7995('0x2c')]===0x0){_0x183a68[_0x7995('0x59')]=![];_0x183a68[_0x7995('0x2a')]=0x0;_0x183a68[_0x7995('0x5a')]=0x0;_0x183a68[_0x7995('0x5b')]=_0x7995('0x5c');ut[_0x7995('0x5d')](_0x7995('0x5e'),_0x183a68[_0x7995('0x28')]+_0x7995('0x5f'));}else{_0x183a68['message']='IS_DISACTIVED';ut[_0x7995('0x5d')](_0x7995('0x5e'),_0x183a68['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x183a68);}}Preview[_0x7995('0x10')]['loopCampaigns']=function(){var _0x504a33=this;setInterval(function(){_0x504a33[_0x7995('0x60')]();},0x7cf);};Preview[_0x7995('0x10')][_0x7995('0x60')]=function(){var _0x576b96=this[_0x7995('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x3993b5 in _0x576b96){if(_0x576b96['hasOwnProperty'](_0x3993b5)&&(_0x576b96[_0x3993b5]['dialMethod']===_0x7995('0x61')||_0x576b96[_0x3993b5][_0x7995('0x62')]===_0x7995('0x63'))&&_0x576b96[_0x3993b5][_0x7995('0x26')]==='outbound'){if(this[_0x7995('0x64')]>0x7){this[_0x7995('0x64')]=0x0;this[_0x7995('0x65')]();}}if(_0x576b96[_0x7995('0x66')](_0x3993b5)&&_0x576b96[_0x3993b5]['dialMethod']==='preview'&&_0x576b96[_0x3993b5][_0x7995('0x26')]==='outbound'){if(_0x576b96[_0x3993b5][_0x7995('0x35')]){this['setMessage'](_0x576b96[_0x3993b5]);if(_0x576b96[_0x3993b5][_0x7995('0x67')])this['recallMe'](_0x576b96[_0x3993b5]);}else{notSendMessagesQueue(_0x576b96[_0x3993b5]);}}}};Preview[_0x7995('0x10')][_0x7995('0x68')]=function(_0x4d9245){var _0x3e9e62=this;this[_0x7995('0x69')][_0x7995('0x11')](function(){if(!_[_0x7995('0x6a')](_0x3e9e62['actions'][_0x4d9245])){loggerAction[_0x7995('0x56')](_0x7995('0x6b'),_0x4d9245,_0x7995('0x6c'),_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')],_0x7995('0x6e'),JSON[_0x7995('0x53')](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245]['queue']][_0x7995('0x4c')]),_0x7995('0x6f'),JSON['stringify'](_0x3e9e62[_0x7995('0x14')][_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')]][_0x7995('0x2c')]),JSON[_0x7995('0x53')](_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x70')]),JSON[_0x7995('0x53')](_[_0x7995('0x71')](_0x3e9e62['actions'][_0x4d9245],[_0x7995('0x72'),_0x7995('0x73'),_0x7995('0x74'),'ListId'])));return ami[_0x7995('0x75')]({'action':_0x7995('0x76'),'channel':_0x3e9e62[_0x7995('0x17')][_0x4d9245]['channel']})['catch'](function(_0x5a592e){if(_0x5a592e[_0x7995('0x5b')]===_0x7995('0x77')){setTimeout(function(){if(_0x3e9e62['actions'][_0x4d9245]){ut[_0x7995('0x78')](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]],_0x7995('0x79'));if(_0x3e9e62['actions'][_0x4d9245][_0x7995('0x70')]===!![]){ut['decrementTalkink'](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x4d9245,_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')]);}ut[_0x7995('0x7a')](_0x7995('0x7b')+_0x4d9245,_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]);delete _0x3e9e62[_0x7995('0x17')][_0x4d9245];}},0x2328);}});}});};Preview[_0x7995('0x10')][_0x7995('0x65')]=function(){var _0x328671=this;loggerAction[_0x7995('0x56')](_0x7995('0x7c'),_[_0x7995('0x7d')](this[_0x7995('0x17')]));for(var _0x35bea3 in this[_0x7995('0x17')]){if(_0x328671[_0x7995('0x17')][_0x7995('0x66')](_0x35bea3)){_0x328671[_0x7995('0x68')](_0x35bea3);}}};Preview[_0x7995('0x10')]['recallMe']=function(_0x56a374){var _0x630737=this;rpcDb[_0x7995('0x7e')](_0x56a374['id'],ut[_0x7995('0x7f')](this['agents']))['then'](function(_0x402fa0){if(!_[_0x7995('0x6a')](_0x402fa0)){for(var _0x5b9467=0x0;_0x5b9467<_0x402fa0[_0x7995('0x80')];_0x5b9467+=0x1){if(ut['getDiff'](_0x402fa0[_0x5b9467][_0x7995('0x81')])<_0x56a374[_0x7995('0x82')]*0x3c){if(_0x402fa0[_0x5b9467][_0x7995('0x83')]&&!_0x402fa0[_0x5b9467][_0x7995('0x83')]['voicePause']){_0x630737['run'](_0x402fa0[_0x5b9467]['id'])[_0x7995('0x84')](ut[_0x7995('0x85')](_0x7995('0x86')))[_0x7995('0x87')](ut[_0x7995('0x85')](_0x7995('0x86')));}else{rpcDb[_0x7995('0x88')](_0x402fa0[_0x5b9467]['id']);}}else{var _0x1e2206=new Action(_0x402fa0[_0x5b9467],_0x56a374);_0x1e2206[_0x7995('0x89')]=moment()['format'](_0x7995('0x8a'));_0x56a374[_0x7995('0x8b')]+=0x1;ut[_0x7995('0x8c')](_0x1e2206,0x17,_0x7995('0x8d'));if(_0x56a374['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x7995('0x8e')](_0x402fa0[_0x5b9467]));rpcDb[_0x7995('0x8f')](_0x1e2206,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x7995('0x8c')](_0x1e2206,0x16,_0x7995('0x90'));rpcDb[_0x7995('0x8f')](_0x1e2206,_0x7995('0x91'));rpcDb[_0x7995('0x92')](_0x1e2206,'[HistoryRecallClose]');}}}}})[_0x7995('0x87')](ut['logger2'](_0x7995('0x93')));};Preview[_0x7995('0x10')][_0x7995('0x94')]=function(_0x25b534){_0x25b534[_0x7995('0x59')]=!![];if(ut[_0x7995('0x95')](_0x25b534[_0x7995('0x2b')])){_0x25b534[_0x7995('0x5b')]=_0x7995('0x96');}else if(!ut[_0x7995('0x97')](_0x25b534[_0x7995('0x35')])){_0x25b534[_0x7995('0x5b')]='NOT_ACTIVE';}else if(!this[_0x7995('0x98')](_0x25b534[_0x7995('0x50')])){if(!this[_0x7995('0x98')](_0x25b534[_0x7995('0x99')])){_0x25b534[_0x7995('0x5b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x25b534['message']=_0x7995('0x9a');}}else{_0x25b534[_0x7995('0x5b')]=_0x7995('0x9a');}emitCampaignPreview(_0x25b534);};Preview[_0x7995('0x10')]['callProgressDetectingCustomer']=function(_0x22d317,_0x50a12e,_0x5df621){var _0xca8238=this;var _0x36d27d=this[_0x7995('0x17')][_0x50a12e];var _0x44bf2b=this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]];var _0x32a52f;if(_0x44bf2b){switch(_0x5df621){case'1':_0x44bf2b[_0x7995('0x9b')]+=0x1;_0x36d27d[_0x7995('0x9c')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x0,_0x7995('0x9e'));ami[_0x7995('0x25')]('custom:agentnosuchnumber',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xa0')));rpcDb[_0x7995('0x8f')](_0x36d27d,_0x7995('0xa1'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xa6'));}else{if(_0x36d27d[_0x7995('0x9c')]>=_0x44bf2b['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x36d27d,_0x7995('0xa6'));}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0x9c'),_0x44bf2b['dialNoSuchNumberRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}delete this['actions'][_0x22d317['linkedid']];break;case _0x7995('0xab'):var _0x305b5a=moment()['format'](_0x7995('0x8a'));_0x36d27d['responsetime']=_0x305b5a;_0x36d27d[_0x7995('0xac')]=_0x305b5a;_0x36d27d[_0x7995('0x70')]=!![];_0x44bf2b['pTalking']+=0x1;logger['info'](_0x7995('0xad'),_0x36d27d['uniqueid'],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],_0x7995('0x6f'),_0x44bf2b[_0x7995('0x2c')]);ami[_0x7995('0x25')](_0x7995('0xaf'),ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb0'),this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]]));if(_0x44bf2b[_0x7995('0xb1')]){ami[_0x7995('0x25')](_0x7995('0xb2'),ut[_0x7995('0xb3')](_0x36d27d));}break;case'16':ami[_0x7995('0x25')](_0x7995('0xb4'),ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb5'),this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb5')));_0x44bf2b[_0x7995('0x3a')]+=0x1;_0x44bf2b[_0x7995('0xb6')]+=0x1;_0x44bf2b[_0x7995('0x29')]+=0x1;ut[_0x7995('0xb7')](_0x44bf2b,_0x7995('0xb8'));_0x36d27d[_0x7995('0x9d')]=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x4,_0x7995('0xb9'));rpcDb['createCustomerHistory'](_0x36d27d,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xba'));rpcDb[_0x7995('0xbb')](_0x36d27d);_0x44bf2b[_0x7995('0x2e')]+=_0x36d27d[_0x7995('0xbc')];_0x44bf2b[_0x7995('0x2d')]+=_0x36d27d['talktime'];logger[_0x7995('0x56')](_0x7995('0xbd'),_0x36d27d[_0x7995('0xbe')],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],_0x7995('0x6f'),_0x44bf2b[_0x7995('0x2c')]);delete this[_0x7995('0x17')][_0x22d317['linkedid']];break;case _0x7995('0xbf'):_0x44bf2b[_0x7995('0xc0')]+=0x1;_0x36d27d['countbusyretry']+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x5,_0x7995('0xc1'));ami[_0x7995('0x25')](_0x7995('0xc2'),ut['buildObj'](_0x36d27d,_0x7995('0xc3')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb['createCustomerFinal'](_0x32a52f,_0x7995('0xc4'));}else{if(_0x36d27d[_0x7995('0xc5')]>=_0x44bf2b[_0x7995('0xc6')]){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xc5'),_0x44bf2b[_0x7995('0xc8')]),_0x36d27d['unlockAgent'],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xc9'):_0x44bf2b[_0x7995('0x3f')]+=0x1;_0x36d27d[_0x7995('0xca')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x3,_0x7995('0xcb'));ami['emit']('custom:agentnoanswer',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xcc')));rpcDb['createCustomerHistory'](_0x36d27d,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x36d27d['countnoanswerretry']>=_0x44bf2b[_0x7995('0xcd')]){rpcDb['createCustomerFinal'](_0x36d27d,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xca'),_0x44bf2b['dialNoAnswerRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xce'):_0x44bf2b[_0x7995('0x3c')]+=0x1;_0x36d27d[_0x7995('0xcf')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x8,_0x7995('0xd0'));ami[_0x7995('0x25')]('custom:agentcongestion',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xd1')));rpcDb['createCustomerHistory'](_0x36d27d,_0x7995('0xd2'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b['dialGlobalMaxRetry']){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,'Global');rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x36d27d[_0x7995('0xcf')]>=_0x44bf2b['dialCongestionMaxRetry']){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xd2'));}else{rpcDb['rescheduleContact'](ut[_0x7995('0xa8')](_0x36d27d,'countcongestionretry',_0x44bf2b['dialBusyRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xd3'):_0x44bf2b[_0x7995('0x40')]+=0x1;_0x36d27d['countagentrejectretry']+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut['logCustomer'](_0x36d27d,0x14,'AgentReject');ami[_0x7995('0x25')]('custom:agentreject',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xd4')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0x14,_0x7995('0xd5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xd6'));}else{if(_0x36d27d[_0x7995('0xd7')]>=_0x44bf2b['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x36d27d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xd7'),_0x44bf2b[_0x7995('0xd8')]),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case'ABANDONED':_0x44bf2b['outboundAbandonedCallsDay']+=0x1;_0x36d27d[_0x7995('0xd9')]+=0x1;_0x36d27d['countglobal']=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x36d27d,_0x7995('0xda'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xda'));}else{if(_0x36d27d[_0x7995('0xdb')]>=_0x44bf2b[_0x7995('0xdc')]){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xda'));}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,'countabandonedretry',_0x44bf2b[_0x7995('0xdd')]),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case'18':_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0xde')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x12,_0x22d317[_0x7995('0xdf')]||_0x22d317['dialstatus']);ami['emit']('custom:amd',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xe0')));rpcDb[_0x7995('0x8f')](_0x36d27d,_0x7995('0xe1'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb['createCustomerFinal'](_0x32a52f,_0x7995('0xe1'));}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe1'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];break;case'19':_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x13,_0x22d317[_0x7995('0xdf')]||_0x22d317[_0x7995('0xe3')]);ami['emit'](_0x7995('0xe4'),ut['buildObj'](_0x36d27d,_0x7995('0xe0')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xe5'));}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe5'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];break;default:if(_0x36d27d[_0x7995('0x70')]){ut[_0x7995('0xb7')](_0x44bf2b,_0x7995('0xe6'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x44bf2b[_0x7995('0x28')],_0x22d317);}_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0xc,_0x22d317['cause-txt']||_0x22d317[_0x7995('0xe3')]);rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b['dialGlobalMaxRetry']){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe7'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];}if(!(_0x36d27d[_0x7995('0x70')]&&_0x5df621==='16')){ut[_0x7995('0x78')](_0x44bf2b,_0x7995('0xe8'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x36d27d['uniqueid'],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],'originated:\x20',_0x44bf2b['originated']);}if(_0x5df621!==_0x7995('0xab')){delete this[_0x7995('0x17')][_0x22d317['linkedid']];delete this['actions'][_0x22d317['destlinkedid']];}}};Preview['prototype'][_0x7995('0xe9')]=function(_0x15ae93,_0x346484,_0x421e44){if(_['isUndefined'](_0x346484)&&_0x7995('0xea')!==typeof _0x346484){return;}if(_[_0x7995('0xeb')](_0x421e44)&&'object'!==typeof _0x421e44){return;}switch(_0x421e44[_0x7995('0xec')]){case'0':ut[_0x7995('0xed')](_0x15ae93,0x0,_0x7995('0x9e'));rpcDb['createAgentHistory'](_0x15ae93,_0x7995('0xee'));break;case'3':ut[_0x7995('0xed')](_0x15ae93,0x3,'NoAnswer');rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf0'));break;case'5':ut[_0x7995('0xed')](_0x15ae93,0x5,_0x7995('0xc1'));rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf1'));break;case'8':ut[_0x7995('0xed')](_0x15ae93,0x8,_0x7995('0xd0'));rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf2'));break;case'22':ut[_0x7995('0xed')](_0x15ae93,0x16,_0x7995('0xf3'));rpcDb[_0x7995('0xef')](_0x15ae93,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x7995('0xed')](_0x15ae93,0xc,_0x421e44[_0x7995('0xec')]);rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf2'));}ut['updateOriginated'](_0x346484,_0x7995('0xf4'));logger[_0x7995('0x56')](_0x7995('0xf5'),_0x15ae93['uniqueid'],_0x7995('0xae'),_0x346484[_0x7995('0x28')],_0x7995('0x6e'),_0x346484[_0x7995('0x4c')]);delete this[_0x7995('0x17')][_0x15ae93[_0x7995('0xbe')]];};Preview[_0x7995('0x10')]['checkInBlack']=function(_0x35dbd7,_0x4efc7f,_0x101bc6,_0x164c61,_0x2190d1){var _0x4cae1c=this;return new BPromise(function(_0xd012b9,_0x5a1892){if(_['isNil'](_0x4efc7f)||_['isNil'](_0x4efc7f['Contact'])||_[_0x7995('0x6a')](_0x4efc7f[_0x7995('0xf6')]['phone'])||_[_0x7995('0x6a')](_0x4efc7f[_0x7995('0x74')])){_0x5a1892(ut['message'](_0x7995('0xf7'),_0x164c61,_0x2190d1));return;}var _0xb80394=uuid['v4']();var _0x3e935f=_0x4cae1c[_0x7995('0x14')][_0x4efc7f[_0x7995('0x6c')]['name']];var _0x38ea3e=_0x101bc6?_0x4cae1c[_0x7995('0x18')][_0x101bc6]['id']:undefined;_0x4cae1c[_0x7995('0x17')][_0xb80394]=new Action(_0x4efc7f,_0x3e935f,_0xb80394,_0x101bc6,_0x38ea3e);var _0x186ebe=_0x4cae1c['actions'][_0xb80394];_0x186ebe[_0x7995('0xa9')]=_0x164c61;_0x186ebe[_0x7995('0xaa')]=_0x2190d1;_0x186ebe[_0x7995('0xf8')]=_0x101bc6;if(_[_0x7995('0xf9')](_0x35dbd7)){_0x4cae1c[_0x7995('0xfa')](_0x186ebe,_0x3e935f,_0x4efc7f,_0x101bc6)[_0x7995('0x84')](function(_0x30ad6e){logger[_0x7995('0x56')](_0x7995('0xfb'),_0x7995('0xfc')+_0x186ebe['queue']+_0x7995('0xfd')+_0x186ebe['idContact'],JSON[_0x7995('0x53')](_0x30ad6e));ami[_0x7995('0x25')](_0x7995('0xfe'),ut['buildObj'](_0x186ebe,'called',_0x4cae1c[_0x7995('0x14')][_0x186ebe[_0x7995('0x6d')]]));_0xd012b9(ut['message'](_0x7995('0xff')));})['catch'](function(_0x43de18){ut[_0x7995('0x5d')](_0x7995('0x100'),_0x43de18);_0x5a1892(ut[_0x7995('0x5b')]('Call\x20failed',_0x164c61,_0x2190d1));});}else{_0x3e935f['outboundBlacklistCallsDay']+=0x1;ut[_0x7995('0x101')](_0x186ebe);rpcDb[_0x7995('0x102')](_0x186ebe,_0x7995('0x103'));delete _0x4cae1c[_0x7995('0x17')][_0xb80394];_0x5a1892(ut['message'](_0x7995('0x104'),_0x164c61,_0x2190d1));}});};Preview[_0x7995('0x10')][_0x7995('0x98')]=function(_0x241427){return!_[_0x7995('0x6a')](_0x241427)&&!_['isNil'](_0x241427['name'])&&!_['isNil'](_0x241427[_0x7995('0x105')])&&_0x241427[_0x7995('0x105')]&&!_['isNil'](this[_0x7995('0x16')][util['format'](_0x7995('0x106'),_0x241427[_0x7995('0x28')])])&&!_[_0x7995('0x6a')](this[_0x7995('0x16')][util['format'](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')])&&(this[_0x7995('0x16')][util[_0x7995('0x54')](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')]===_0x7995('0x107')||this[_0x7995('0x16')][util[_0x7995('0x54')](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')]==='unmonitored');};Preview[_0x7995('0x10')]['run']=function(_0x5dc3e5,_0xbd6c64){var _0x5cf7b2=this;return new BPromise(function(_0x433bb2,_0x55dc6c){_0x5cf7b2[_0x7995('0x108')](_0x5dc3e5,_0xbd6c64)[_0x7995('0x84')](function(_0x4ea477){_0x433bb2(_['pick'](_0x4ea477,['message']));})[_0x7995('0x87')](function(_0x198867){if(_0x198867[_0x7995('0x109')]){rpcDb[_0x7995('0x10a')](_0x5dc3e5);}if(_0x198867['active']){rpcDb[_0x7995('0x88')](_0x5dc3e5);}_0x55dc6c(_[_0x7995('0x71')](_0x198867,[_0x7995('0x5b')]));});});};Preview[_0x7995('0x10')][_0x7995('0x108')]=function(_0x3ab70c,_0x3e8479){var _0x2b874e=this;return new BPromise(function(_0x47f0d9,_0x2e93a9){var _0x5e12c4,_0x2cc43d;rpcDb[_0x7995('0x10b')](_0x3ab70c)['then'](function(_0x3e90a5){if(!_[_0x7995('0x6a')](_0x3e90a5[0x0])){_0x2cc43d=_0x3e90a5[0x0][_0x7995('0x10c')]?![]:!![];_0x5e12c4=_0x3e90a5[0x0][_0x7995('0x10c')]?!![]:![];_0x5e12c4=_0x3e8479?!![]:_0x5e12c4;}var _0x20949f=_0x2b874e[_0x7995('0x10d')](_0x3e90a5);if(_0x20949f['isValid']){rpcDb[_0x7995('0x10e')](_[_0x7995('0x71')](_0x3e90a5[0x0],[_0x7995('0x74'),_0x7995('0x10f')]))[_0x7995('0x84')](function(_0x3e3b05){_0x2b874e[_0x7995('0x110')](_0x3e3b05,_0x3e90a5[0x0],_0x3e8479,_0x2cc43d,_0x5e12c4)[_0x7995('0x84')](function(_0xf76f46){_0x47f0d9(_0xf76f46);})[_0x7995('0x87')](function(_0x370e25){_0x2e93a9(_0x370e25);});})[_0x7995('0x87')](function(_0x64a62d){ut[_0x7995('0x5d')](_0x7995('0x111'),_0x64a62d);_0x2e93a9(ut[_0x7995('0x5b')](_0x7995('0x112'),_0x2cc43d,_0x5e12c4));});}else{_0x2e93a9(ut[_0x7995('0x5b')](_0x20949f[_0x7995('0x5b')],_0x2cc43d,_0x5e12c4));}})[_0x7995('0x87')](function(_0x37e69d){ut['logger']('[Preview][getContactPreview]',_0x37e69d);_0x2e93a9(ut[_0x7995('0x5b')](_0x7995('0x112'),![],!![]));});});};Preview['prototype'][_0x7995('0x10d')]=function(_0x4c251c){if(_[_0x7995('0x6a')](_0x4c251c)||_['isEmpty'](_0x4c251c)||!_[_0x7995('0x6a')](_0x4c251c[0x0][_0x7995('0x83')])&&_[_0x7995('0x6a')](_0x4c251c[0x0][_0x7995('0x83')][_0x7995('0x28')])){ut[_0x7995('0x5d')](_0x7995('0x113'),_0x4c251c);return{'isValid':![],'message':_0x7995('0x114')};}var _0x10f635=this[_0x7995('0x14')][_0x4c251c[0x0]['Queue'][_0x7995('0x28')]];_0x10f635[_0x7995('0x5b')]=_0x7995('0x9a');if(_[_0x7995('0x6a')](_0x10f635)){ut['logger'](_0x7995('0x115'),_0x10f635);return{'isValid':![],'message':_0x7995('0x116')};}if(!this[_0x7995('0x98')](_0x10f635[_0x7995('0x50')])){ut['logger'](_0x7995('0x117'),_0x7995('0x118')+_0x10f635[_0x7995('0x28')]+_0x7995('0x119'));if(!this[_0x7995('0x98')](_0x10f635[_0x7995('0x99')])){ut[_0x7995('0x5d')](_0x7995('0x117'),_0x10f635[_0x7995('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7995('0x11a')};}}if(!ut['isActive'](_0x10f635[_0x7995('0x35')])){ut[_0x7995('0x5d')](_0x7995('0x11b'),_0x10f635[_0x7995('0x28')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x7995('0x118')+_0x10f635[_0x7995('0x28')]+_0x7995('0x11c')};}return{'isValid':!![],'message':_0x7995('0x11d')};};Preview[_0x7995('0x10')][_0x7995('0xfa')]=function(_0x3661ab,_0x408692,_0x394a9f,_0xbfb30){var _0x45f389=this;return new BPromise(function(_0x44d6a8,_0x7d14e2){var _0x405711=_0x3661ab['uniqueid'];var _0x5cb30e=_0x45f389[_0x7995('0x98')](_0x408692[_0x7995('0x50')])?util[_0x7995('0x54')]('SIP/%s/%s%s',_0x408692[_0x7995('0x50')][_0x7995('0x28')],_[_0x7995('0x6a')](_0x408692['dialPrefix'])?'':_0x408692[_0x7995('0x38')][_0x7995('0x11e')]()||'',_0x408692[_0x7995('0x11f')]>0x0?_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')][_0x7995('0x121')](_0x408692[_0x7995('0x11f')]):_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')]):util[_0x7995('0x54')](_0x7995('0x122'),_['isNil'](_0x408692['TrunkBackup'])?_0x408692[_0x7995('0x50')]['name']:_0x408692[_0x7995('0x99')][_0x7995('0x28')],_[_0x7995('0x6a')](_0x408692[_0x7995('0x38')])?'':_0x408692[_0x7995('0x38')]['trim']()||'',_0x408692['dialCutDigit']>0x0?_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')][_0x7995('0x121')](_0x408692[_0x7995('0x11f')]):_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')]);var _0x278cb3=_0x45f389[_0x7995('0x98')](_0x408692[_0x7995('0x50')])?ut[_0x7995('0x123')](_0x408692['Trunk'][_0x7995('0x51')],_0x408692[_0x7995('0x36')],_0x408692[_0x7995('0x124')]>0x0?ut[_0x7995('0x125')](_0x408692['dialOriginateCallerIdNumber'],_0x408692['dialRandomLastDigitCallerIdNumber']):_0x408692['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0x408692[_0x7995('0x99')])?_0x408692['Trunk']['callerid']:_0x408692[_0x7995('0x99')][_0x7995('0x51')],_0x408692[_0x7995('0x36')],_0x408692['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7995('0x125')](_0x408692['dialOriginateCallerIdNumber'],_0x408692[_0x7995('0x124')]):_0x408692[_0x7995('0x126')]);if(_0x278cb3){_0x3661ab[_0x7995('0x127')]=ut['extractCalleridName'](_0x278cb3);_0x3661ab[_0x7995('0x128')]=ut[_0x7995('0x129')](_0x278cb3);}var _0x1b5b5b=ut['addVariables'](_0x408692,_0x394a9f,_0x5cb30e,_0x278cb3,_0x405711,_0x3661ab);_[_0x7995('0x12a')](_0x3661ab,ut[_0x7995('0x12b')](_0x1b5b5b));_0x3661ab[_0x7995('0x89')]=moment()[_0x7995('0x54')](_0x7995('0x8a'));ami['Action'](ut[_0x7995('0x12c')](_0x3661ab,_0x408692,_0x1b5b5b,_0x3661ab[_0x7995('0xaa')],_0xbfb30))[_0x7995('0x84')](function(_0x484b6c){_0x408692[_0x7995('0x4c')]+=0x1;logger[_0x7995('0x56')](_0x7995('0x12d'),_0x405711,_0x7995('0xae'),_0x408692[_0x7995('0x28')],'originated:\x20',_0x408692[_0x7995('0x4c')]);_0x44d6a8(_0x484b6c);})[_0x7995('0x87')](function(_0x134724){ut[_0x7995('0xed')](_0x3661ab,0xe,_0x7995('0x12e'));rpcDb[_0x7995('0xef')](_0x3661ab,_0x7995('0x12f'));_0x7d14e2(_0x134724);});});};Preview['prototype']['syncNewExten']=function(_0x37e0b8){if(this[_0x7995('0x17')][_0x37e0b8['linkedid']]){this['actions'][_0x37e0b8[_0x7995('0xe2')]][_0x7995('0x130')]=_0x37e0b8[_0x7995('0x130')];}};Preview[_0x7995('0x10')][_0x7995('0x19')]=function(_0x24a68c){var _0x39a023=this;var _0x4dca11=this[_0x7995('0x17')][_0x24a68c[_0x7995('0x131')]];if(_0x4dca11){if(_0x4dca11[_0x7995('0xf8')]&&this[_0x7995('0x18')][_0x4dca11[_0x7995('0xf8')]]){ut[_0x7995('0x132')](_0x4dca11,this['agents'][_0x4dca11[_0x7995('0xf8')]][_0x7995('0x28')],this[_0x7995('0x18')][_0x4dca11[_0x7995('0xf8')]]['id']);}var _0x13c918=_[_0x7995('0x133')](_0x4dca11);_0x13c918[_0x7995('0x134')]=moment()['format'](_0x7995('0x8a'));var _0x202102=_0x39a023[_0x7995('0x14')][_0x4dca11[_0x7995('0x6d')]];if(ut['isFailure'](_0x24a68c[_0x7995('0x135')])){if(_0x4dca11['unlockAgent']){rpcDb[_0x7995('0x10a')](_0x4dca11[_0x7995('0x136')]);}if(_0x4dca11['activeContact']){rpcDb['disableContact'](_0x4dca11['idContact']);}ami[_0x7995('0x25')](_0x7995('0x137'),ut[_0x7995('0x9f')](_0x4dca11,_0x7995('0x138'),this[_0x7995('0x14')][_0x4dca11[_0x7995('0x6d')]]));this[_0x7995('0xe9')](_0x13c918,_0x202102,_0x24a68c);}else{_0x4dca11[_0x7995('0x89')]=moment()[_0x7995('0x54')](_0x7995('0x8a'));ut[_0x7995('0xed')](_0x13c918,0x4,_0x7995('0xb9'));rpcDb['createAgentHistory'](_0x13c918,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x7995('0x10')]['syncHangup']=function(_0x58a2e8){var _0x1a786e=this;var _0x363250=this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]];var _0x2b5475;if(_0x363250){_0x2b5475=this[_0x7995('0x14')][_0x363250[_0x7995('0x6d')]];logger[_0x7995('0x56')](_0x7995('0x139'),_0x58a2e8[_0x7995('0xe2')],_0x7995('0xae'),_0x2b5475[_0x7995('0x28')],'pTalking:\x20',_0x2b5475[_0x7995('0x2c')]);}if(this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]]&&_0x58a2e8[_0x7995('0xe2')]!==_0x58a2e8[_0x7995('0xbe')]){if(_0x58a2e8[_0x7995('0x13a')]==='16'&&this[_0x7995('0x17')][_0x58a2e8['linkedid']][_0x7995('0x70')]){this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}else if(this[_0x7995('0x17')][_0x58a2e8['linkedid']][_0x7995('0x70')]){logger['info'](_0x7995('0x13c'),_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')],'\x20Queue',_0x2b5475[_0x7995('0x28')],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}}else if(_0x363250&&_[_0x7995('0x6a')](_0x363250['statedesc'])&&_0x2b5475['dialQueueProject']&&_0x58a2e8[_0x7995('0xe2')]===_0x58a2e8[_0x7995('0xbe')]&&_[_0x7995('0x6a')](_0x58a2e8[_0x7995('0xec')])&&_0x58a2e8[_0x7995('0x13a')]==='16'&&_0x58a2e8[_0x7995('0x13d')]==='6'&&_['isUndefined'](_0x363250[_0x7995('0x13e')])){if(_0x363250[_0x7995('0xa9')]){rpcDb[_0x7995('0x10a')](_0x363250[_0x7995('0x136')]);}if(_0x363250['activeContact']){rpcDb['disableContact'](_0x363250[_0x7995('0x136')]);}_0x58a2e8[_0x7995('0xec')]='22';this['callProgressDetectingAgent'](_0x363250,_0x2b5475,_0x58a2e8);}else if(_0x363250&&_0x363250[_0x7995('0x13e')]){if(_0x58a2e8[_0x7995('0x13a')]==='16'&&this['actions'][_0x58a2e8[_0x7995('0xe2')]][_0x7995('0x70')]){logger[_0x7995('0x56')](_0x7995('0x13f'),_0x58a2e8[_0x7995('0xe2')],_0x58a2e8['cause'],'\x20Queue',_0x2b5475[_0x7995('0x28')],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8['cause']);}else if(this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]][_0x7995('0x70')]){logger[_0x7995('0x56')](_0x7995('0x13c'),_0x58a2e8['linkedid'],_0x58a2e8['cause'],'\x20Queue',_0x2b5475['name'],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this['callProgressDetectingCustomer'](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}}};Preview['prototype']['syncDialEnd']=function(_0x1f4b2f){if(this[_0x7995('0x17')][_0x1f4b2f[_0x7995('0x140')]]&&_0x1f4b2f[_0x7995('0x140')]!==_0x1f4b2f[_0x7995('0x141')]){this[_0x7995('0x13b')](_0x1f4b2f,_0x1f4b2f[_0x7995('0x140')],_0x1f4b2f['dialstatus']);}};Preview['prototype'][_0x7995('0x1e')]=function(_0xb00787){if(this[_0x7995('0x17')][_0xb00787['linkedid']]&&_0xb00787[_0x7995('0xe2')]!==_0xb00787[_0x7995('0xbe')]&&!this[_0x7995('0x17')][_0xb00787[_0x7995('0xe2')]][_0x7995('0x70')]){if(_0xb00787[_0x7995('0x13a')]==='1'){this[_0x7995('0x13b')](_0xb00787,_0xb00787[_0x7995('0xe2')],_0xb00787[_0x7995('0x13a')]);}}};Preview['prototype']['addVariable']=function(_0x1161f2,_0x4bd222,_0x2ac8ac){if(this['actions'][_0x1161f2]){if(_[_0x7995('0x6a')](this[_0x7995('0x17')][_0x1161f2][_0x7995('0x142')])){this['actions'][_0x1161f2]['variables']={};}this[_0x7995('0x17')][_0x1161f2][_0x7995('0x142')][_0x4bd222]=_0x2ac8ac;}};Preview[_0x7995('0x10')][_0x7995('0x23')]=function(_0xc6d48c){try{if(!_[_0x7995('0x6a')](_0xc6d48c)){if(ut[_0x7995('0x143')](_[_0x7995('0x144')](_0xc6d48c[_0x7995('0x145')])[0x0])){this[_0x7995('0x146')](_0xc6d48c[_0x7995('0xbe')],_['keys'](_0xc6d48c[_0x7995('0x145')])[0x0],_0xc6d48c[_0x7995('0x147')]);}}}catch(_0x1b7e44){logger[_0x7995('0x148')](_0x7995('0x149'),util['inspect'](_0x1b7e44,{'showHidden':![],'depth':null}));}};Preview[_0x7995('0x10')][_0x7995('0x14a')]=function(_0x3c3cae){if(_0x3c3cae){if(this[_0x7995('0x17')][_0x3c3cae[_0x7995('0x14b')]]){this[_0x7995('0x17')][_0x3c3cae[_0x7995('0x14b')]][_0x7995('0x13e')]=!![];}}};Preview[_0x7995('0x10')]['syncBlindTransfer']=function(_0x5405ca){if(_0x5405ca){if(this[_0x7995('0x17')][_0x5405ca[_0x7995('0x14c')]]){this[_0x7995('0x17')][_0x5405ca[_0x7995('0x14c')]][_0x7995('0x13e')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xadb8=['dialBusyMaxRetry','scheduledAt','activeContact','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','dialCongestionMaxRetry','dialBusyRetryFrequency','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','active','SIP/%s','status','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','variables','keys','variable','addVariable','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','dialMethod','clockClearZombieChannels','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','hasOwnProperty','recallMe','agentReadyId','agents','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x4a8603,_0x7358b4){var _0x2b0c13=function(_0x3baa51){while(--_0x3baa51){_0x4a8603['push'](_0x4a8603['shift']());}};_0x2b0c13(++_0x7358b4);}(_0xadb8,0x1d0));var _0x8adb=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xadb8[_0x36bf88];return _0x332914;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x8adb('0x0'));var uuid=require('uuid');var moment=require(_0x8adb('0x1'));var md5=require(_0x8adb('0x2'));var Redis=require(_0x8adb('0x3'));var config=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var loggerAction=require(_0x8adb('0x5'))('actionPreview');var ami=require(_0x8adb('0x7'));var rpcDb=require(_0x8adb('0x8'));var Action=require(_0x8adb('0x9'));var ut=require(_0x8adb('0xa'));config[_0x8adb('0xb')]=_[_0x8adb('0xc')](config[_0x8adb('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8adb('0xd')]['enqueue']=function(_0x4d986d){this['tail']=this[_0x8adb('0xe')]?this[_0x8adb('0xe')][_0x8adb('0xf')](_0x4d986d):_0x4d986d();};function Preview(_0x45d8ff){this[_0x8adb('0x10')]=new Sequence();this[_0x8adb('0x11')]=_0x45d8ff[_0x8adb('0x12')];this[_0x8adb('0x13')]=_0x45d8ff[_0x8adb('0x13')];this[_0x8adb('0x14')]={};this['agents']=_0x45d8ff['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x8adb('0x15'),this['syncOriginateResponse'][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x17'),this[_0x8adb('0x18')]['bind'](this));ami['on'](_0x8adb('0x19'),this[_0x8adb('0x1a')][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x1b'),this[_0x8adb('0x1c')][_0x8adb('0x16')](this));ami['on']('newexten',this[_0x8adb('0x1d')][_0x8adb('0x16')](this));ami['on']('varset',this['syncVarSet'][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x1e'),this[_0x8adb('0x1f')][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x20'),this[_0x8adb('0x21')][_0x8adb('0x16')](this));this[_0x8adb('0x22')](this[_0x8adb('0x11')]);}function emit(_0x2a322d,_0x36c62a,_0x190171){io['to'](_0x2a322d)['emit'](_0x36c62a,_0x190171);}function emitCampaignPreview(_0x548317){if(_0x548317[_0x8adb('0x23')]===_0x8adb('0x24')){var _0x4f33e7={'id':_0x548317['id'],'name':_0x548317[_0x8adb('0x25')],'strategy':_0x548317[_0x8adb('0x26')],'answered':_0x548317[_0x8adb('0x27')],'available':_0x548317[_0x8adb('0x28')],'loggedIn':_0x548317[_0x8adb('0x29')],'pTalking':_0x548317[_0x8adb('0x2a')],'sumBillable':_0x548317['sumBillable'],'sumDuration':_0x548317[_0x8adb('0x2b')],'sumHoldTime':_0x548317[_0x8adb('0x2c')]||0x0,'talking':_0x548317[_0x8adb('0x2d')],'total':_0x548317['total'],'type':_0x548317[_0x8adb('0x23')],'unmanaged':_0x548317[_0x8adb('0x2e')],'abandoned':_0x548317[_0x8adb('0x2f')],'waiting':_0x548317[_0x8adb('0x30')],'loggedInDb':_0x548317[_0x8adb('0x31')],'dialActive':_0x548317[_0x8adb('0x32')],'dialMethod':_0x548317['dialMethod'],'dialOriginateCallerIdName':_0x548317[_0x8adb('0x33')],'dialOriginateCallerIdNumber':_0x548317[_0x8adb('0x34')],'dialOriginateTimeout':_0x548317[_0x8adb('0x35')],'dialPrefix':_0x548317[_0x8adb('0x36')],'outboundAnswerAgiCallsDay':_0x548317[_0x8adb('0x37')],'outboundAnswerCallsDay':_0x548317[_0x8adb('0x38')],'outboundBlacklistCallsDay':_0x548317[_0x8adb('0x39')],'outboundBusyCallsDay':_0x548317['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x548317[_0x8adb('0x3a')],'outboundDropCallsDayACS':_0x548317[_0x8adb('0x3b')],'outboundDropCallsDayCallersExit':_0x548317[_0x8adb('0x3c')],'outboundDropCallsDayTimeout':_0x548317[_0x8adb('0x3d')],'outboundNoAnswerCallsDay':_0x548317['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x548317[_0x8adb('0x3e')],'outboundOriginateFailureCallsDay':_0x548317['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x548317[_0x8adb('0x3f')],'outboundRejectCallsDay':_0x548317[_0x8adb('0x40')],'outboundUnknownCallsDay':_0x548317[_0x8adb('0x41')],'outboundAbandonedCallsDay':_0x548317[_0x8adb('0x42')],'predictiveIntervalAnsweredCalls':_0x548317['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x548317[_0x8adb('0x43')],'predictiveIntervalAvgTalktime':_0x548317['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x548317[_0x8adb('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x548317['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x548317[_0x8adb('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x548317[_0x8adb('0x46')],'predictiveIntervalHitRate':_0x548317[_0x8adb('0x47')],'predictiveIntervalMultiplicativeFactor':_0x548317[_0x8adb('0x48')],'predictiveIntervalPauses':_0x548317[_0x8adb('0x49')],'predictiveIntervalAvailable':_0x548317[_0x8adb('0x4a')],'predictiveIntervalTotalCalls':_0x548317['predictiveIntervalTotalCalls'],'message':_0x548317['message'],'originated':_0x548317[_0x8adb('0x4b')],'erlangCalls':_0x548317[_0x8adb('0x4c')],'erlangCallToSecond':_0x548317[_0x8adb('0x4d')],'erlangAbandonmentRate':_0x548317[_0x8adb('0x4e')],'erlangBusyFactor':_0x548317[_0x8adb('0x4f')],'startPredictive':_0x548317[_0x8adb('0x50')],'startProgressive':_0x548317[_0x8adb('0x51')]};if(_0x548317[_0x8adb('0x52')]){_0x4f33e7[_0x8adb('0x52')]={'id':_0x548317[_0x8adb('0x52')]['id'],'name':_0x548317[_0x8adb('0x52')][_0x8adb('0x25')],'active':_0x548317[_0x8adb('0x52')]['active'],'callerid':_0x548317[_0x8adb('0x52')][_0x8adb('0x53')]};}if(_0x548317['Interval']){_0x4f33e7[_0x8adb('0x54')]={'id':_0x548317['Interval']['id'],'name':_0x548317[_0x8adb('0x54')][_0x8adb('0x25')]};}var _0x6c8b25=md5(JSON[_0x8adb('0x55')](_0x4f33e7));if(_0x548317[_0x8adb('0x2')]!==_0x6c8b25){_0x548317['md5']=_0x6c8b25;emit(util[_0x8adb('0x56')]('voice:queue:%s',_0x4f33e7[_0x8adb('0x25')]),_0x8adb('0x57'),_0x4f33e7);}}}function emitVoiceQueueChannelRemove(_0x4a1693){logger[_0x8adb('0x58')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x8adb('0x55')](_0x4a1693));emit(util['format'](_0x8adb('0x59'),_0x4a1693[_0x8adb('0x25')]),_0x8adb('0x5a'),_0x4a1693);io['emit']('voice_queue_presence:remove',_0x4a1693);}function notSendMessagesQueue(_0x182c4b){if(_0x182c4b[_0x8adb('0x5b')]){if(_0x182c4b['originated']===0x0&&_0x182c4b[_0x8adb('0x2a')]===0x0){_0x182c4b[_0x8adb('0x5b')]=![];_0x182c4b[_0x8adb('0x28')]=0x0;_0x182c4b[_0x8adb('0x5c')]=0x0;_0x182c4b[_0x8adb('0x5d')]=_0x8adb('0x5e');ut[_0x8adb('0x5f')](_0x8adb('0x60'),_0x182c4b['name']+'\x20is\x20not\x20active');}else{_0x182c4b[_0x8adb('0x5d')]=_0x8adb('0x61');ut[_0x8adb('0x5f')](_0x8adb('0x60'),_0x182c4b['name']+_0x8adb('0x62'));}emitCampaignPreview(_0x182c4b);}}Preview['prototype'][_0x8adb('0x22')]=function(){var _0x32b764=this;setInterval(function(){_0x32b764[_0x8adb('0x63')]();},0x7cf);};Preview[_0x8adb('0xd')]['syncCampaigns']=function(){var _0x4ef5a3=this[_0x8adb('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x7a826d in _0x4ef5a3){if(_0x4ef5a3['hasOwnProperty'](_0x7a826d)&&(_0x4ef5a3[_0x7a826d]['dialMethod']===_0x8adb('0x6')||_0x4ef5a3[_0x7a826d][_0x8adb('0x64')]==='booked')&&_0x4ef5a3[_0x7a826d][_0x8adb('0x23')]===_0x8adb('0x24')){if(this[_0x8adb('0x65')]>0x7){this[_0x8adb('0x65')]=0x0;this[_0x8adb('0x66')]();}}if(_0x4ef5a3['hasOwnProperty'](_0x7a826d)&&_0x4ef5a3[_0x7a826d][_0x8adb('0x64')]==='preview'&&_0x4ef5a3[_0x7a826d][_0x8adb('0x23')]===_0x8adb('0x24')){if(_0x4ef5a3[_0x7a826d]['dialActive']){this['setMessage'](_0x4ef5a3[_0x7a826d]);if(_0x4ef5a3[_0x7a826d][_0x8adb('0x67')])this['recallMe'](_0x4ef5a3[_0x7a826d]);}else{notSendMessagesQueue(_0x4ef5a3[_0x7a826d]);}}}};Preview[_0x8adb('0xd')][_0x8adb('0x68')]=function(_0x470d19){var _0x222f06=this;this['sequence'][_0x8adb('0x69')](function(){if(!_[_0x8adb('0x6a')](_0x222f06['actions'][_0x470d19])){loggerAction['info'](_0x8adb('0x6b'),_0x470d19,_0x8adb('0x6c'),_0x222f06[_0x8adb('0x14')][_0x470d19]['queue'],_0x8adb('0x6d'),JSON[_0x8adb('0x55')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]][_0x8adb('0x4b')]),_0x8adb('0x6f'),JSON[_0x8adb('0x55')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]][_0x8adb('0x2a')]),JSON['stringify'](_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x70')]),JSON[_0x8adb('0x55')](_[_0x8adb('0x71')](_0x222f06[_0x8adb('0x14')][_0x470d19],[_0x8adb('0x72'),_0x8adb('0x73'),_0x8adb('0x74'),_0x8adb('0x75')])));return ami[_0x8adb('0x76')]({'action':'status','channel':_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x77')]})[_0x8adb('0x78')](function(_0x354778){if(_0x354778[_0x8adb('0x5d')]===_0x8adb('0x79')){setTimeout(function(){if(_0x222f06[_0x8adb('0x14')][_0x470d19]){ut[_0x8adb('0x7a')](_0x222f06['campaignsPreview'][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]],_0x8adb('0x7b'));if(_0x222f06[_0x8adb('0x14')][_0x470d19]['dialAnswer']===!![]){ut[_0x8adb('0x7c')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]],'[clearZombieChannel]');ut[_0x8adb('0x7d')](_0x8adb('0x7e')+_0x470d19,_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]);}ut[_0x8adb('0x7d')](_0x8adb('0x7f')+_0x470d19,_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]);delete _0x222f06[_0x8adb('0x14')][_0x470d19];}},0x2328);}});}});};Preview[_0x8adb('0xd')][_0x8adb('0x66')]=function(){var _0x3adac4=this;loggerAction['info'](_0x8adb('0x80'),_['size'](this['actions']));for(var _0x9b2ef5 in this[_0x8adb('0x14')]){if(_0x3adac4['actions'][_0x8adb('0x81')](_0x9b2ef5)){_0x3adac4[_0x8adb('0x68')](_0x9b2ef5);}}};Preview[_0x8adb('0xd')][_0x8adb('0x82')]=function(_0x545a47){var _0x1689b8=this;rpcDb['getContactRecallMe'](_0x545a47['id'],ut[_0x8adb('0x83')](this[_0x8adb('0x84')]))[_0x8adb('0x85')](function(_0x47a2a4){if(!_[_0x8adb('0x6a')](_0x47a2a4)){for(var _0x50dc53=0x0;_0x50dc53<_0x47a2a4[_0x8adb('0x86')];_0x50dc53+=0x1){if(ut[_0x8adb('0x87')](_0x47a2a4[_0x50dc53][_0x8adb('0x88')])<_0x545a47['dialRecallMeTimeout']*0x3c){if(_0x47a2a4[_0x50dc53][_0x8adb('0x89')]&&!_0x47a2a4[_0x50dc53][_0x8adb('0x89')][_0x8adb('0x8a')]){_0x1689b8[_0x8adb('0x8b')](_0x47a2a4[_0x50dc53]['id'])['then'](ut[_0x8adb('0x8c')](_0x8adb('0x8d')))['catch'](ut[_0x8adb('0x8c')](_0x8adb('0x8d')));}else{rpcDb[_0x8adb('0x8e')](_0x47a2a4[_0x50dc53]['id']);}}else{var _0x583622=new Action(_0x47a2a4[_0x50dc53],_0x545a47);_0x583622[_0x8adb('0x8f')]=moment()[_0x8adb('0x56')](_0x8adb('0x90'));_0x545a47[_0x8adb('0x3f')]+=0x1;ut['logCustomer'](_0x583622,0x17,_0x8adb('0x91'));if(_0x545a47['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x47a2a4[_0x50dc53]));rpcDb[_0x8adb('0x92')](_0x583622,_0x8adb('0x93'));}else{ut[_0x8adb('0x94')](_0x583622,0x16,'RecallFailedTimeout');rpcDb[_0x8adb('0x92')](_0x583622,'[HistoryRecallClose]');rpcDb[_0x8adb('0x95')](_0x583622,_0x8adb('0x96'));}}}}})[_0x8adb('0x78')](ut[_0x8adb('0x8c')](_0x8adb('0x97')));};Preview[_0x8adb('0xd')][_0x8adb('0x98')]=function(_0xa04f70){_0xa04f70[_0x8adb('0x5b')]=!![];if(ut['IsNotLoggedIn'](_0xa04f70[_0x8adb('0x29')])){_0xa04f70[_0x8adb('0x5d')]=_0x8adb('0x99');}else if(!ut[_0x8adb('0x9a')](_0xa04f70['dialActive'])){_0xa04f70[_0x8adb('0x5d')]='NOT_ACTIVE';}else if(!this[_0x8adb('0x9b')](_0xa04f70[_0x8adb('0x52')])){if(!this[_0x8adb('0x9b')](_0xa04f70[_0x8adb('0x9c')])){_0xa04f70['message']=_0x8adb('0x9d');}else{_0xa04f70[_0x8adb('0x5d')]='ACTIVE';}}else{_0xa04f70['message']='ACTIVE';}emitCampaignPreview(_0xa04f70);};Preview[_0x8adb('0xd')][_0x8adb('0x9e')]=function(_0x369a45,_0x551dd9,_0x57d00b){var _0x21efac=this;var _0x2db881=this[_0x8adb('0x14')][_0x551dd9];var _0x5abfb7=this[_0x8adb('0x11')][_0x2db881[_0x8adb('0x6e')]];var _0x466f9c;if(_0x5abfb7){switch(_0x57d00b){case'1':_0x5abfb7[_0x8adb('0x3e')]+=0x1;_0x2db881[_0x8adb('0x9f')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x0,'NoSuchNumber');ami['emit'](_0x8adb('0xa1'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xa3')));rpcDb['createCustomerHistory'](_0x2db881,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2db881[_0x8adb('0x9f')]>=_0x5abfb7['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,_0x8adb('0x9f'),_0x5abfb7[_0x8adb('0xa9')]),_0x2db881[_0x8adb('0xaa')],_0x2db881['activeContact']);}}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case _0x8adb('0xac'):var _0x525f00=moment()['format'](_0x8adb('0x90'));_0x2db881[_0x8adb('0xad')]=_0x525f00;_0x2db881[_0x8adb('0xae')]=_0x525f00;_0x2db881[_0x8adb('0x70')]=!![];_0x5abfb7[_0x8adb('0x2a')]+=0x1;logger['info'](_0x8adb('0xaf'),_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],'pTalking:\x20',_0x5abfb7[_0x8adb('0x2a')]);ami[_0x8adb('0xb2')](_0x8adb('0xb3'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb4'),this[_0x8adb('0x11')][_0x2db881['queue']]));if(_0x5abfb7[_0x8adb('0xb5')]){ami[_0x8adb('0xb2')]('custom:agentConnectPreview',ut[_0x8adb('0xb6')](_0x2db881));}break;case'16':ami[_0x8adb('0xb2')](_0x8adb('0xb7'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb8'),this['campaignsPreview'][_0x2db881[_0x8adb('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb8')));_0x5abfb7[_0x8adb('0x38')]+=0x1;_0x5abfb7[_0x8adb('0xb9')]+=0x1;_0x5abfb7['answered']+=0x1;ut[_0x8adb('0x7c')](_0x5abfb7,_0x8adb('0xba'));_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x4,_0x8adb('0xbb'));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xbc'));rpcDb[_0x8adb('0xbd')](_0x2db881);_0x5abfb7[_0x8adb('0x2b')]+=_0x2db881[_0x8adb('0xbe')];_0x5abfb7[_0x8adb('0xbf')]+=_0x2db881[_0x8adb('0xbe')];logger['info']('[syncHangup][talking][decrement]',_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],_0x8adb('0x6f'),_0x5abfb7['pTalking']);delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case _0x8adb('0xc0'):_0x5abfb7[_0x8adb('0xc1')]+=0x1;_0x2db881[_0x8adb('0xc2')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x5,_0x8adb('0xc3'));ami[_0x8adb('0xb2')](_0x8adb('0xc4'),ut['buildObj'](_0x2db881,_0x8adb('0xc5')));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xc6'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,'Global');rpcDb['createCustomerFinal'](_0x466f9c,_0x8adb('0xc7'));}else{if(_0x2db881[_0x8adb('0xc2')]>=_0x5abfb7[_0x8adb('0xc8')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xc6'));}else{rpcDb[_0x8adb('0xa8')](ut[_0x8adb('0xc9')](_0x2db881,_0x8adb('0xc2'),_0x5abfb7['dialBusyRetryFrequency']),_0x2db881['unlockAgent'],_0x2db881[_0x8adb('0xca')]);}}break;case'NOANSWER':_0x5abfb7['outboundNoAnswerCallsDay']+=0x1;_0x2db881['countnoanswerretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x3,_0x8adb('0xcb'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x2db881,'noanswer'));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xcc'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb['createCustomerFinal'](_0x466f9c,_0x8adb('0xcd'));}else{if(_0x2db881[_0x8adb('0xce')]>=_0x5abfb7[_0x8adb('0xcf')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xcc'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2db881,_0x8adb('0xce'),_0x5abfb7[_0x8adb('0xd0')]),_0x2db881['unlockAgent'],_0x2db881['activeContact']);}}break;case _0x8adb('0xd1'):_0x5abfb7[_0x8adb('0x3a')]+=0x1;_0x2db881[_0x8adb('0xd2')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x8,'Congestion');ami[_0x8adb('0xb2')](_0x8adb('0xd3'),ut['buildObj'](_0x2db881,_0x8adb('0xd4')));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2db881[_0x8adb('0xd2')]>=_0x5abfb7[_0x8adb('0xd5')]){rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,_0x8adb('0xd2'),_0x5abfb7[_0x8adb('0xd6')]),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case'CANCEL':_0x5abfb7['outboundRejectCallsDay']+=0x1;_0x2db881['countagentrejectretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0x14,_0x8adb('0xd7'));ami[_0x8adb('0xb2')](_0x8adb('0xd8'),ut[_0x8adb('0xa2')](_0x2db881,'agentreject'));rpcDb['createCustomerHistory'](_0x2db881,_0x8adb('0xd9'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0x14,_0x8adb('0xd7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xda'));}else{if(_0x2db881[_0x8adb('0xdb')]>=_0x5abfb7[_0x8adb('0xdc')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xda'));}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,'countagentrejectretry',_0x5abfb7[_0x8adb('0xdd')]),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case _0x8adb('0xde'):_0x5abfb7['outboundAbandonedCallsDay']+=0x1;_0x2db881[_0x8adb('0xdf')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0xb,_0x8adb('0xe0'));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xe1'));}else{if(_0x2db881[_0x8adb('0xe2')]>=_0x5abfb7[_0x8adb('0xe3')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xe1'));}else{rpcDb['rescheduleContact'](ut[_0x8adb('0xc9')](_0x2db881,_0x8adb('0xdf'),_0x5abfb7['dialAbandonedRetryFrequency']),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case'18':_0x5abfb7[_0x8adb('0x41')]+=0x1;_0x2db881['countmachineretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0x12,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);ami[_0x8adb('0xb2')](_0x8adb('0xe6'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xe7')));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xe8'));if(ut['totalGlobal'](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case'19':_0x5abfb7['outboundUnknownCallsDay']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x13,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);ami[_0x8adb('0xb2')](_0x8adb('0xe6'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xe7')));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][machine]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7['dialGlobalMaxRetry']){_0x466f9c=ut['cloneAction'](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xe9'));}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;default:if(_0x2db881['dialAnswer']){ut[_0x8adb('0x7c')](_0x5abfb7,_0x8adb('0xea'));ut['loggerError'](_0x8adb('0xeb')+_0x5abfb7[_0x8adb('0x25')],_0x369a45);}_0x5abfb7[_0x8adb('0x41')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0xc,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xec'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7['dialGlobalMaxRetry']){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xed'));}else{rpcDb[_0x8adb('0x95')](_0x2db881,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x369a45[_0x8adb('0xab')]];}if(!(_0x2db881[_0x8adb('0x70')]&&_0x57d00b==='16')){ut[_0x8adb('0x7a')](_0x5abfb7,_0x8adb('0xee'));logger[_0x8adb('0x58')](_0x8adb('0xef'),_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],'originated:\x20',_0x5abfb7[_0x8adb('0x4b')]);}if(_0x57d00b!==_0x8adb('0xac')){delete this[_0x8adb('0x14')][_0x369a45['linkedid']];delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xf0')]];}}};Preview[_0x8adb('0xd')][_0x8adb('0xf1')]=function(_0x24dc71,_0x3325b8,_0x4d6499){if(_['isUndefined'](_0x3325b8)&&_0x8adb('0xf2')!==typeof _0x3325b8){return;}if(_['isUndefined'](_0x4d6499)&&_0x8adb('0xf2')!==typeof _0x4d6499){return;}switch(_0x4d6499[_0x8adb('0xf3')]){case'0':ut[_0x8adb('0xf4')](_0x24dc71,0x0,_0x8adb('0xf5'));rpcDb['createAgentHistory'](_0x24dc71,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x8adb('0xf4')](_0x24dc71,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x24dc71,_0x8adb('0xf6'));break;case'5':ut[_0x8adb('0xf4')](_0x24dc71,0x5,_0x8adb('0xc3'));rpcDb['createAgentHistory'](_0x24dc71,_0x8adb('0xf7'));break;case'8':ut[_0x8adb('0xf4')](_0x24dc71,0x8,_0x8adb('0xf8'));rpcDb[_0x8adb('0xf9')](_0x24dc71,_0x8adb('0xfa'));break;case'22':ut[_0x8adb('0xf4')](_0x24dc71,0x16,_0x8adb('0xfb'));rpcDb[_0x8adb('0xf9')](_0x24dc71,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x8adb('0xf4')](_0x24dc71,0xc,_0x4d6499[_0x8adb('0xf3')]);rpcDb[_0x8adb('0xf9')](_0x24dc71,_0x8adb('0xfa'));}ut['updateOriginated'](_0x3325b8,_0x8adb('0xfc'));logger[_0x8adb('0x58')]('[originated][decrement][callProgressDetectingAgent]',_0x24dc71[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x3325b8['name'],_0x8adb('0x6d'),_0x3325b8[_0x8adb('0x4b')]);delete this[_0x8adb('0x14')][_0x24dc71[_0x8adb('0xb0')]];};Preview[_0x8adb('0xd')][_0x8adb('0xfd')]=function(_0xdac51c,_0x35dd98,_0x1e5252,_0x376927,_0x1cccbc){var _0x41e56f=this;return new BPromise(function(_0x42fc08,_0x42e171){if(_[_0x8adb('0x6a')](_0x35dd98)||_['isNil'](_0x35dd98[_0x8adb('0xfe')])||_['isNil'](_0x35dd98[_0x8adb('0xfe')][_0x8adb('0xff')])||_[_0x8adb('0x6a')](_0x35dd98['VoiceQueueId'])){_0x42e171(ut[_0x8adb('0x5d')](_0x8adb('0x100'),_0x376927,_0x1cccbc));return;}var _0x3704a0=uuid['v4']();var _0x5bb96b=_0x41e56f[_0x8adb('0x11')][_0x35dd98[_0x8adb('0x6c')]['name']];var _0x5ef2b8=_0x1e5252?_0x41e56f[_0x8adb('0x84')][_0x1e5252]['id']:undefined;_0x41e56f[_0x8adb('0x14')][_0x3704a0]=new Action(_0x35dd98,_0x5bb96b,_0x3704a0,_0x1e5252,_0x5ef2b8);var _0x1972b7=_0x41e56f[_0x8adb('0x14')][_0x3704a0];_0x1972b7[_0x8adb('0xaa')]=_0x376927;_0x1972b7[_0x8adb('0xca')]=_0x1cccbc;_0x1972b7[_0x8adb('0x101')]=_0x1e5252;if(_[_0x8adb('0x102')](_0xdac51c)){_0x41e56f['execCall'](_0x1972b7,_0x5bb96b,_0x35dd98,_0x1e5252)[_0x8adb('0x85')](function(_0x43528e){logger['info'](_0x8adb('0x103'),'Queue:\x20'+_0x1972b7[_0x8adb('0x6e')]+_0x8adb('0x104')+_0x1972b7[_0x8adb('0x105')],JSON['stringify'](_0x43528e));ami[_0x8adb('0xb2')](_0x8adb('0x106'),ut['buildObj'](_0x1972b7,'called',_0x41e56f[_0x8adb('0x11')][_0x1972b7[_0x8adb('0x6e')]]));_0x42fc08(ut[_0x8adb('0x5d')]('Calling'));})[_0x8adb('0x78')](function(_0x4ca870){ut[_0x8adb('0x5f')](_0x8adb('0x107'),_0x4ca870);_0x42e171(ut[_0x8adb('0x5d')](_0x8adb('0x108'),_0x376927,_0x1cccbc));});}else{_0x5bb96b[_0x8adb('0x39')]+=0x1;ut[_0x8adb('0x109')](_0x1972b7);rpcDb[_0x8adb('0x10a')](_0x1972b7,'[Blacklist][error]');delete _0x41e56f[_0x8adb('0x14')][_0x3704a0];_0x42e171(ut[_0x8adb('0x5d')]('Contact\x20in\x20black\x20List',_0x376927,_0x1cccbc));}});};Preview[_0x8adb('0xd')][_0x8adb('0x9b')]=function(_0x363b77){return!_['isNil'](_0x363b77)&&!_[_0x8adb('0x6a')](_0x363b77[_0x8adb('0x25')])&&!_['isNil'](_0x363b77[_0x8adb('0x10b')])&&_0x363b77[_0x8adb('0x10b')]&&!_[_0x8adb('0x6a')](this[_0x8adb('0x13')][util['format'](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])])&&!_['isNil'](this[_0x8adb('0x13')][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])][_0x8adb('0x10d')])&&(this[_0x8adb('0x13')][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])]['status']==='reachable'||this['trunks'][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])][_0x8adb('0x10d')]===_0x8adb('0x10e'));};Preview['prototype'][_0x8adb('0x8b')]=function(_0x3c35fb,_0x163c9b){var _0x440906=this;return new BPromise(function(_0x2febd9,_0x568ad7){_0x440906[_0x8adb('0x10f')](_0x3c35fb,_0x163c9b)['then'](function(_0x301d1b){_0x2febd9(_[_0x8adb('0x71')](_0x301d1b,['message']));})['catch'](function(_0x254352){if(_0x254352[_0x8adb('0x110')]){rpcDb[_0x8adb('0x111')](_0x3c35fb);}if(_0x254352[_0x8adb('0x10b')]){rpcDb[_0x8adb('0x8e')](_0x3c35fb);}_0x568ad7(_['pick'](_0x254352,[_0x8adb('0x5d')]));});});};Preview['prototype'][_0x8adb('0x10f')]=function(_0x54bbac,_0x3c4581){var _0x4b8e44=this;return new BPromise(function(_0x26bfc5,_0x44204e){var _0x29978c,_0x164946;rpcDb[_0x8adb('0x112')](_0x54bbac)[_0x8adb('0x85')](function(_0x1f279d){if(!_[_0x8adb('0x6a')](_0x1f279d[0x0])){_0x164946=_0x1f279d[0x0][_0x8adb('0x113')]?![]:!![];_0x29978c=_0x1f279d[0x0][_0x8adb('0x113')]?!![]:![];_0x29978c=_0x3c4581?!![]:_0x29978c;}var _0x28977c=_0x4b8e44[_0x8adb('0x114')](_0x1f279d);if(_0x28977c['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x1f279d[0x0],[_0x8adb('0x74'),_0x8adb('0x115')]))['then'](function(_0x159720){_0x4b8e44[_0x8adb('0xfd')](_0x159720,_0x1f279d[0x0],_0x3c4581,_0x164946,_0x29978c)[_0x8adb('0x85')](function(_0x46686e){_0x26bfc5(_0x46686e);})['catch'](function(_0x29862c){_0x44204e(_0x29862c);});})[_0x8adb('0x78')](function(_0x204438){ut['logger']('[Preview][checkIsBlackList]',_0x204438);_0x44204e(ut[_0x8adb('0x5d')](_0x8adb('0x116'),_0x164946,_0x29978c));});}else{_0x44204e(ut['message'](_0x28977c[_0x8adb('0x5d')],_0x164946,_0x29978c));}})['catch'](function(_0x4d10fd){ut[_0x8adb('0x5f')](_0x8adb('0x117'),_0x4d10fd);_0x44204e(ut[_0x8adb('0x5d')](_0x8adb('0x116'),![],!![]));});});};Preview[_0x8adb('0xd')][_0x8adb('0x114')]=function(_0x3c92f0){if(_[_0x8adb('0x6a')](_0x3c92f0)||_['isEmpty'](_0x3c92f0)||!_[_0x8adb('0x6a')](_0x3c92f0[0x0][_0x8adb('0x89')])&&_['isNil'](_0x3c92f0[0x0][_0x8adb('0x89')][_0x8adb('0x25')])){ut[_0x8adb('0x5f')]('[Preview][validateContact][Empty\x20Contact]',_0x3c92f0);return{'isValid':![],'message':_0x8adb('0x118')};}var _0x426925=this[_0x8adb('0x11')][_0x3c92f0[0x0][_0x8adb('0x6c')][_0x8adb('0x25')]];_0x426925['message']=_0x8adb('0x119');if(_[_0x8adb('0x6a')](_0x426925)){ut[_0x8adb('0x5f')](_0x8adb('0x11a'),_0x426925);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x8adb('0x9b')](_0x426925[_0x8adb('0x52')])){ut[_0x8adb('0x5f')](_0x8adb('0x11b'),_0x8adb('0x11c')+_0x426925[_0x8adb('0x25')]+_0x8adb('0x11d'));if(!this[_0x8adb('0x9b')](_0x426925[_0x8adb('0x9c')])){ut[_0x8adb('0x5f')](_0x8adb('0x11b'),_0x426925[_0x8adb('0x25')]+_0x8adb('0x11e'));return{'isValid':![],'message':_0x8adb('0x11f')};}}if(!ut[_0x8adb('0x9a')](_0x426925[_0x8adb('0x32')])){ut[_0x8adb('0x5f')](_0x8adb('0x120'),_0x426925['name']+_0x8adb('0x121'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x426925[_0x8adb('0x25')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8adb('0x122')};};Preview[_0x8adb('0xd')][_0x8adb('0x123')]=function(_0xd23894,_0x440865,_0xd8bd09,_0x3dfd05){var _0x3e79a9=this;return new BPromise(function(_0x14d7c6,_0x4c8eee){var _0x2bf25b=_0xd23894[_0x8adb('0xb0')];var _0x16f5fc=_0x3e79a9[_0x8adb('0x9b')](_0x440865[_0x8adb('0x52')])?util[_0x8adb('0x56')](_0x8adb('0x124'),_0x440865[_0x8adb('0x52')][_0x8adb('0x25')],_[_0x8adb('0x6a')](_0x440865[_0x8adb('0x36')])?'':_0x440865[_0x8adb('0x36')][_0x8adb('0x125')]()||'',_0x440865[_0x8adb('0x126')]>0x0?_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')][_0x8adb('0x127')](_0x440865[_0x8adb('0x126')]):_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')]):util['format'](_0x8adb('0x124'),_[_0x8adb('0x6a')](_0x440865['TrunkBackup'])?_0x440865['Trunk']['name']:_0x440865[_0x8adb('0x9c')]['name'],_['isNil'](_0x440865[_0x8adb('0x36')])?'':_0x440865['dialPrefix'][_0x8adb('0x125')]()||'',_0x440865[_0x8adb('0x126')]>0x0?_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')][_0x8adb('0x127')](_0x440865[_0x8adb('0x126')]):_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')]);var _0x527331=_0x3e79a9['isTrunkReachable'](_0x440865[_0x8adb('0x52')])?ut[_0x8adb('0x128')](_0x440865[_0x8adb('0x52')]['callerid'],_0x440865[_0x8adb('0x33')],_0x440865[_0x8adb('0x129')]>0x0?ut[_0x8adb('0x12a')](_0x440865[_0x8adb('0x34')],_0x440865[_0x8adb('0x129')]):_0x440865[_0x8adb('0x34')]):ut[_0x8adb('0x128')](_[_0x8adb('0x6a')](_0x440865[_0x8adb('0x9c')])?_0x440865[_0x8adb('0x52')][_0x8adb('0x53')]:_0x440865[_0x8adb('0x9c')]['callerid'],_0x440865[_0x8adb('0x33')],_0x440865[_0x8adb('0x129')]>0x0?ut[_0x8adb('0x12a')](_0x440865[_0x8adb('0x34')],_0x440865[_0x8adb('0x129')]):_0x440865[_0x8adb('0x34')]);if(_0x527331){_0xd23894[_0x8adb('0x12b')]=ut[_0x8adb('0x12c')](_0x527331);_0xd23894[_0x8adb('0x12d')]=ut[_0x8adb('0x12e')](_0x527331);}var _0x237958=ut[_0x8adb('0x12f')](_0x440865,_0xd8bd09,_0x16f5fc,_0x527331,_0x2bf25b,_0xd23894);_[_0x8adb('0x130')](_0xd23894,ut[_0x8adb('0x131')](_0x237958));_0xd23894[_0x8adb('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x8adb('0x132')](_0xd23894,_0x440865,_0x237958,_0xd23894[_0x8adb('0xca')],_0x3dfd05))['then'](function(_0x48c92c){_0x440865[_0x8adb('0x4b')]+=0x1;logger[_0x8adb('0x58')]('[originated][increment]',_0x2bf25b,_0x8adb('0xb1'),_0x440865[_0x8adb('0x25')],_0x8adb('0x6d'),_0x440865[_0x8adb('0x4b')]);_0x14d7c6(_0x48c92c);})['catch'](function(_0x13f358){ut[_0x8adb('0xf4')](_0xd23894,0xe,'OriginateError');rpcDb['createAgentHistory'](_0xd23894,_0x8adb('0x133'));_0x4c8eee(_0x13f358);});});};Preview['prototype'][_0x8adb('0x1d')]=function(_0x3824d3){if(this[_0x8adb('0x14')][_0x3824d3['linkedid']]){this[_0x8adb('0x14')][_0x3824d3['linkedid']][_0x8adb('0x77')]=_0x3824d3[_0x8adb('0x77')];}};Preview['prototype'][_0x8adb('0x134')]=function(_0x4ef3b9){var _0x432947=this;var _0x530235=this[_0x8adb('0x14')][_0x4ef3b9[_0x8adb('0x135')]];if(_0x530235){if(_0x530235[_0x8adb('0x101')]&&this['agents'][_0x530235[_0x8adb('0x101')]]){ut['logLookAgent'](_0x530235,this[_0x8adb('0x84')][_0x530235[_0x8adb('0x101')]][_0x8adb('0x25')],this[_0x8adb('0x84')][_0x530235[_0x8adb('0x101')]]['id']);}var _0x1643d7=_['clone'](_0x530235);_0x1643d7[_0x8adb('0xad')]=moment()[_0x8adb('0x56')](_0x8adb('0x90'));var _0x35caa8=_0x432947[_0x8adb('0x11')][_0x530235['queue']];if(ut[_0x8adb('0x136')](_0x4ef3b9[_0x8adb('0x137')])){if(_0x530235['unlockAgent']){rpcDb[_0x8adb('0x111')](_0x530235['idContact']);}if(_0x530235[_0x8adb('0xca')]){rpcDb[_0x8adb('0x8e')](_0x530235['idContact']);}ami[_0x8adb('0xb2')](_0x8adb('0x138'),ut[_0x8adb('0xa2')](_0x530235,_0x8adb('0x139'),this['campaignsPreview'][_0x530235[_0x8adb('0x6e')]]));this[_0x8adb('0xf1')](_0x1643d7,_0x35caa8,_0x4ef3b9);}else{_0x530235[_0x8adb('0x8f')]=moment()[_0x8adb('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8adb('0xf4')](_0x1643d7,0x4,'Answer');rpcDb['createAgentHistory'](_0x1643d7,_0x8adb('0x13a'));}}};Preview[_0x8adb('0xd')][_0x8adb('0x18')]=function(_0x30949b){var _0x43571a=this;var _0x2323a3=this['actions'][_0x30949b[_0x8adb('0xab')]];var _0x20f662;if(_0x2323a3){_0x20f662=this[_0x8adb('0x11')][_0x2323a3['queue']];logger['info'](_0x8adb('0x13b'),_0x30949b[_0x8adb('0xab')],_0x8adb('0xb1'),_0x20f662['name'],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);}if(this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]]&&_0x30949b['linkedid']!==_0x30949b['uniqueid']){if(_0x30949b['cause']==='16'&&this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){this['callProgressDetectingCustomer'](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')]);}else if(this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger['info']('[syncHangup][talking][cause]',_0x30949b[_0x8adb('0xab')],_0x30949b['cause'],'\x20Queue',_0x20f662['name'],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this[_0x8adb('0x9e')](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')]);}}else if(_0x2323a3&&_[_0x8adb('0x6a')](_0x2323a3['statedesc'])&&_0x20f662[_0x8adb('0x13d')]&&_0x30949b[_0x8adb('0xab')]===_0x30949b[_0x8adb('0xb0')]&&_['isNil'](_0x30949b[_0x8adb('0xf3')])&&_0x30949b[_0x8adb('0x13c')]==='16'&&_0x30949b[_0x8adb('0x13e')]==='6'&&_[_0x8adb('0x13f')](_0x2323a3['transfer'])){if(_0x2323a3[_0x8adb('0xaa')]){rpcDb[_0x8adb('0x111')](_0x2323a3[_0x8adb('0x105')]);}if(_0x2323a3[_0x8adb('0xca')]){rpcDb[_0x8adb('0x8e')](_0x2323a3[_0x8adb('0x105')]);}_0x30949b[_0x8adb('0xf3')]='22';this[_0x8adb('0xf1')](_0x2323a3,_0x20f662,_0x30949b);}else if(_0x2323a3&&_0x2323a3[_0x8adb('0x140')]){if(_0x30949b[_0x8adb('0x13c')]==='16'&&this['actions'][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger[_0x8adb('0x58')](_0x8adb('0x141'),_0x30949b[_0x8adb('0xab')],_0x30949b['cause'],_0x8adb('0xb1'),_0x20f662[_0x8adb('0x25')],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this[_0x8adb('0x9e')](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b['cause']);}else if(this['actions'][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger[_0x8adb('0x58')](_0x8adb('0x142'),_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')],'\x20Queue',_0x20f662[_0x8adb('0x25')],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this['callProgressDetectingCustomer'](_0x30949b,_0x30949b['linkedid'],_0x30949b[_0x8adb('0x13c')]);}}};Preview[_0x8adb('0xd')][_0x8adb('0x1c')]=function(_0x1bbe19){if(this[_0x8adb('0x14')][_0x1bbe19['destlinkedid']]&&_0x1bbe19['destlinkedid']!==_0x1bbe19[_0x8adb('0x143')]){this['callProgressDetectingCustomer'](_0x1bbe19,_0x1bbe19[_0x8adb('0xf0')],_0x1bbe19['dialstatus']);}};Preview[_0x8adb('0xd')][_0x8adb('0x1a')]=function(_0x2bec64){if(this['actions'][_0x2bec64[_0x8adb('0xab')]]&&_0x2bec64[_0x8adb('0xab')]!==_0x2bec64[_0x8adb('0xb0')]&&!this['actions'][_0x2bec64[_0x8adb('0xab')]][_0x8adb('0x70')]){if(_0x2bec64[_0x8adb('0x13c')]==='1'){this[_0x8adb('0x9e')](_0x2bec64,_0x2bec64[_0x8adb('0xab')],_0x2bec64[_0x8adb('0x13c')]);}}};Preview['prototype']['addVariable']=function(_0x3e4179,_0x31a941,_0x29866d){if(this[_0x8adb('0x14')][_0x3e4179]){if(_[_0x8adb('0x6a')](this['actions'][_0x3e4179][_0x8adb('0x144')])){this[_0x8adb('0x14')][_0x3e4179][_0x8adb('0x144')]={};}this[_0x8adb('0x14')][_0x3e4179]['variables'][_0x31a941]=_0x29866d;}};Preview['prototype']['syncVarSet']=function(_0x570cc9){try{if(!_['isNil'](_0x570cc9)){if(ut['filterKey'](_[_0x8adb('0x145')](_0x570cc9[_0x8adb('0x146')])[0x0])){this[_0x8adb('0x147')](_0x570cc9[_0x8adb('0xb0')],_[_0x8adb('0x145')](_0x570cc9[_0x8adb('0x146')])[0x0],_0x570cc9['value']);}}}catch(_0x250a81){logger['error'](_0x8adb('0x148'),util['inspect'](_0x250a81,{'showHidden':![],'depth':null}));}};Preview[_0x8adb('0xd')][_0x8adb('0x1f')]=function(_0x53d639){if(_0x53d639){if(this['actions'][_0x53d639[_0x8adb('0x149')]]){this[_0x8adb('0x14')][_0x53d639[_0x8adb('0x149')]][_0x8adb('0x140')]=!![];}}};Preview[_0x8adb('0xd')][_0x8adb('0x21')]=function(_0x5e63a3){if(_0x5e63a3){if(this[_0x8adb('0x14')][_0x5e63a3[_0x8adb('0x14a')]]){this[_0x8adb('0x14')][_0x5e63a3[_0x8adb('0x14a')]][_0x8adb('0x140')]=!![];}}};module[_0x8adb('0x14b')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 043b2bb..e88b880 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 _0xfddc=['[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','exten','xcally-motion-preview','holdtime','membername','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','catch'];(function(_0x137ad6,_0x48589b){var _0x52f0d4=function(_0x8bd426){while(--_0x8bd426){_0x137ad6['push'](_0x137ad6['shift']());}};_0x52f0d4(++_0x48589b);}(_0xfddc,0x97));var _0xcfdd=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xfddc[_0x8a969d];return _0x1d8dc7;};'use strict';var util=require(_0xcfdd('0x0'));var BPromise=require('bluebird');var logger=require(_0xcfdd('0x1'))(_0xcfdd('0x2'));var _=require('lodash');var cmHopper=require(_0xcfdd('0x3'));var cmHopperFinal=require(_0xcfdd('0x4'));var cmHopperHistory=require(_0xcfdd('0x5'));var cmHopperBlack=require(_0xcfdd('0x6'));var voiceQueueRt=require(_0xcfdd('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xcfdd('0x8'));function loggerCatch(_0x41e367){return function(_0x4ed7e3){logger[_0xcfdd('0x9')](_0x41e367,util[_0xcfdd('0xa')](_0x4ed7e3,{'showHidden':![],'depth':null}));};}function create(_0x94d11){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopperHistory['createHistory'](_0x94d11))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0xe')));}function createAgent(_0x3cfca6){return BPromise['resolve']()[_0xcfdd('0xc')](agentReportPreview['createHistory'](_0x3cfca6))['catch'](loggerCatch(_0xcfdd('0xe')));}function moveContact(_0x12bdc7){return BPromise['resolve']()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0xf')](_0x12bdc7,!![]))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x10')));}exports[_0xcfdd('0x11')]=function(_0x500d0e){return BPromise['resolve']()[_0xcfdd('0xc')](cmHopperBlack[_0xcfdd('0x11')](_0x500d0e))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x12')));};exports[_0xcfdd('0x13')]=function(_0x2b5b3d){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x13')](_0x2b5b3d))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x14')));};exports['createHistory']=function(_0x1fa0c1,_0x187eb4){create(_0x1fa0c1)['catch'](loggerCatch(_0x187eb4));moveContact(_0x1fa0c1)['catch'](loggerCatch(_0x187eb4));};exports[_0xcfdd('0x15')]=function(_0x2ce91a,_0x2d5bad){createAgent(_0x2ce91a)[_0xcfdd('0xd')](loggerCatch(_0x2d5bad));};exports[_0xcfdd('0x16')]=function(_0x1fab8c,_0x6ce009){create(_0x1fab8c)['catch'](loggerCatch(_0x6ce009));};exports[_0xcfdd('0x17')]=function(_0x5f028b,_0x22d19b){moveContact(_0x5f028b)[_0xcfdd('0xd')](loggerCatch(_0x22d19b));};exports[_0xcfdd('0x18')]=function(_0xd855c4,_0x3ce0da,_0x5b3588){if(_0x3ce0da){_0xd855c4[_0xcfdd('0x19')]=null;}if(_0x5b3588){_0xd855c4[_0xcfdd('0x1a')]=![];}return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x18')](_0xd855c4))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x1b')));};exports[_0xcfdd('0x1c')]=function(_0x14379a){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x1c')](_0x14379a))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xcfdd('0x1d')]=function(_0x25b788){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x1d')]({'UserId':null},_0x25b788,0x1))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x1e')));};exports['disableContact']=function(_0x36f51d){return BPromise[_0xcfdd('0xb')]()['then'](cmHopper[_0xcfdd('0x1d')]({'active':![]},_0x36f51d,0x1))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x1f')));};exports[_0xcfdd('0x20')]=function(_0x17ad84){var _0x118a5c={};_0x118a5c[_0xcfdd('0x21')]=_0x17ad84[_0xcfdd('0x21')];_0x118a5c[_0xcfdd('0x22')]=_0x17ad84[_0xcfdd('0x22')];_0x118a5c[_0xcfdd('0x23')]=_0x17ad84[_0xcfdd('0x23')];_0x118a5c[_0xcfdd('0x24')]=_0x17ad84['calleridname'];_0x118a5c[_0xcfdd('0x25')]=_0x17ad84[_0xcfdd('0x25')];_0x118a5c['queuecallerjoinAt']=_0x17ad84[_0xcfdd('0x26')];_0x118a5c[_0xcfdd('0x27')]=_0x17ad84['answertime'];_0x118a5c[_0xcfdd('0x28')]=0x1;_0x118a5c[_0xcfdd('0x29')]=_0x17ad84[_0xcfdd('0x2a')];_0x118a5c['connectedlinename']=_0x17ad84['membername'];_0x118a5c[_0xcfdd('0x2b')]='from-sip';_0x118a5c[_0xcfdd('0x2c')]=_0xcfdd('0x2d');_0x118a5c[_0xcfdd('0x2e')]=0x0;_0x118a5c['assigned']=0x1;_0x118a5c['lastAssignedTo']=_0x17ad84[_0xcfdd('0x2f')];_0x118a5c['queuecallerexitreason']=_0xcfdd('0x30');return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](voiceQueueReport[_0xcfdd('0x31')](_0x118a5c))['catch'](loggerCatch(_0xcfdd('0x32')));};exports[_0xcfdd('0x33')]=function(_0x275b50,_0x355ba6){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x33')](_0x275b50,_0x355ba6))[_0xcfdd('0xd')](loggerCatch(_0xcfdd('0x34')));};exports[_0xcfdd('0x35')]=function(_0x2b9be5){return BPromise[_0xcfdd('0xb')]()[_0xcfdd('0xc')](cmHopper[_0xcfdd('0x18')](_0x2b9be5,!![],!![]))['catch'](loggerCatch(_0xcfdd('0x36')));}; \ No newline at end of file +var _0xb3df=['[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','membername','context','from-sip','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','active'];(function(_0x29d749,_0x449a14){var _0x10792a=function(_0x42e680){while(--_0x42e680){_0x29d749['push'](_0x29d749['shift']());}};_0x10792a(++_0x449a14);}(_0xb3df,0x124));var _0xfb3d=function(_0x22f588,_0x150edd){_0x22f588=_0x22f588-0x0;var _0x16b3c7=_0xb3df[_0x22f588];return _0x16b3c7;};'use strict';var util=require('util');var BPromise=require(_0xfb3d('0x0'));var logger=require(_0xfb3d('0x1'))(_0xfb3d('0x2'));var _=require(_0xfb3d('0x3'));var cmHopper=require(_0xfb3d('0x4'));var cmHopperFinal=require(_0xfb3d('0x5'));var cmHopperHistory=require(_0xfb3d('0x6'));var cmHopperBlack=require(_0xfb3d('0x7'));var voiceQueueRt=require(_0xfb3d('0x8'));var agentReportPreview=require(_0xfb3d('0x9'));var voiceQueueReport=require(_0xfb3d('0xa'));function loggerCatch(_0x522df5){return function(_0x3e228a){logger['error'](_0x522df5,util[_0xfb3d('0xb')](_0x3e228a,{'showHidden':![],'depth':null}));};}function create(_0x1493b1){return BPromise[_0xfb3d('0xc')]()['then'](cmHopperHistory[_0xfb3d('0xd')](_0x1493b1))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0xf')));}function createAgent(_0x3a5b85){return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](agentReportPreview[_0xfb3d('0xd')](_0x3a5b85))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0xf')));}function moveContact(_0x1c9e5a){return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](cmHopper[_0xfb3d('0x11')](_0x1c9e5a,!![]))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x12')));}exports[_0xfb3d('0x13')]=function(_0x5b4322){return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](cmHopperBlack[_0xfb3d('0x13')](_0x5b4322))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x14')));};exports[_0xfb3d('0x15')]=function(_0x465500){return BPromise[_0xfb3d('0xc')]()['then'](cmHopper[_0xfb3d('0x15')](_0x465500))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x16')));};exports['createHistory']=function(_0x2d3f8a,_0x239d17){create(_0x2d3f8a)[_0xfb3d('0xe')](loggerCatch(_0x239d17));moveContact(_0x2d3f8a)[_0xfb3d('0xe')](loggerCatch(_0x239d17));};exports['createAgentHistory']=function(_0x4dd5f2,_0x8e8374){createAgent(_0x4dd5f2)[_0xfb3d('0xe')](loggerCatch(_0x8e8374));};exports[_0xfb3d('0x17')]=function(_0xb74f4b,_0x4cf0ca){create(_0xb74f4b)[_0xfb3d('0xe')](loggerCatch(_0x4cf0ca));};exports['createCustomerFinal']=function(_0x14cd4f,_0x271537){moveContact(_0x14cd4f)['catch'](loggerCatch(_0x271537));};exports[_0xfb3d('0x18')]=function(_0x44bc2f,_0x555fa6,_0x14c441){if(_0x555fa6){_0x44bc2f['UserId']=null;}if(_0x14c441){_0x44bc2f[_0xfb3d('0x19')]=![];}return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](cmHopper[_0xfb3d('0x18')](_0x44bc2f))['catch'](loggerCatch(_0xfb3d('0x1a')));};exports[_0xfb3d('0x1b')]=function(_0x40abdc){return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](cmHopper[_0xfb3d('0x1b')](_0x40abdc))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x1c')));};exports[_0xfb3d('0x1d')]=function(_0x3f2791){return BPromise['resolve']()['then'](cmHopper[_0xfb3d('0x1d')]({'UserId':null},_0x3f2791,0x1))['catch'](loggerCatch(_0xfb3d('0x1e')));};exports[_0xfb3d('0x1f')]=function(_0x2fb848){return BPromise[_0xfb3d('0xc')]()[_0xfb3d('0x10')](cmHopper[_0xfb3d('0x1d')]({'active':![]},_0x2fb848,0x1))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x20')));};exports['crateCustomerReportQueue']=function(_0x3620f8){var _0xc7a6b3={};_0xc7a6b3[_0xfb3d('0x21')]=_0x3620f8[_0xfb3d('0x21')];_0xc7a6b3[_0xfb3d('0x22')]=_0x3620f8[_0xfb3d('0x22')];_0xc7a6b3[_0xfb3d('0x23')]=_0x3620f8['calleridnum'];_0xc7a6b3[_0xfb3d('0x24')]=_0x3620f8[_0xfb3d('0x24')];_0xc7a6b3[_0xfb3d('0x25')]=_0x3620f8[_0xfb3d('0x25')];_0xc7a6b3['queuecallerjoinAt']=_0x3620f8[_0xfb3d('0x26')];_0xc7a6b3[_0xfb3d('0x27')]=_0x3620f8[_0xfb3d('0x26')];_0xc7a6b3[_0xfb3d('0x28')]=0x1;_0xc7a6b3['queuecallercompleteAt']=_0x3620f8['endtime'];_0xc7a6b3['connectedlinename']=_0x3620f8[_0xfb3d('0x29')];_0xc7a6b3[_0xfb3d('0x2a')]=_0xfb3d('0x2b');_0xc7a6b3['exten']='xcally-motion-preview';_0xc7a6b3[_0xfb3d('0x2c')]=0x0;_0xc7a6b3[_0xfb3d('0x2d')]=0x1;_0xc7a6b3['lastAssignedTo']=_0x3620f8['membername'];_0xc7a6b3[_0xfb3d('0x2e')]=_0xfb3d('0x2f');return BPromise['resolve']()[_0xfb3d('0x10')](voiceQueueReport[_0xfb3d('0x30')](_0xc7a6b3))['catch'](loggerCatch(_0xfb3d('0x31')));};exports[_0xfb3d('0x32')]=function(_0x3dc767,_0x1fd294){return BPromise['resolve']()[_0xfb3d('0x10')](cmHopper[_0xfb3d('0x32')](_0x3dc767,_0x1fd294))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x33')));};exports['rescheduleContactInQueue']=function(_0x58d20b){return BPromise['resolve']()[_0xfb3d('0x10')](cmHopper['rescheduleContact'](_0x58d20b,!![],!![]))[_0xfb3d('0xe')](loggerCatch(_0xfb3d('0x34')));}; \ 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 e075043..a56b4cd 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 _0x8034=['tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','motionChannel','voice','mandatoryDisposition','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8034,0x188));var _0x4803=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8034[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0x4803('0x0'));var _=require(_0x4803('0x1'));var moment=require('moment');var logger=require(_0x4803('0x2'))('preview');var ipAgi=process[_0x4803('0x3')][_0x4803('0x4')]||'127.0.0.1';function getSeconds(_0x3fe9f0,_0x2233db){var _0x155fb6=moment(_0x3fe9f0)['milliseconds'](0x0);var _0x186246=moment(_0x2233db)[_0x4803('0x5')](0x0);return _0x155fb6['diff'](_0x186246,_0x4803('0x6'));}exports[_0x4803('0x7')]=function(_0x156137){return function(_0x3cc29f){logger[_0x4803('0x8')](_0x156137,util[_0x4803('0x9')](_0x3cc29f,{'showHidden':![],'depth':null}));};};exports[_0x4803('0xa')]=function(_0x45b8c4,_0x13afde){logger[_0x4803('0xb')](_0x45b8c4,util[_0x4803('0x9')](_0x13afde,{'showHidden':![],'depth':null}));};exports[_0x4803('0xc')]=function(_0x3ae08f,_0x2d73e9){logger[_0x4803('0x8')](_0x3ae08f,util[_0x4803('0x9')](_0x2d73e9,{'showHidden':![],'depth':null}));};exports[_0x4803('0xd')]=function(_0x396703){return function(_0x30a32e){logger[_0x4803('0xb')](_0x396703,util[_0x4803('0x9')](_0x30a32e,{'showHidden':![],'depth':null}));};};exports[_0x4803('0xe')]=function(_0x4e6d84,_0x27b0bf,_0x918334){return{'message':_0x4e6d84,'unlock':_0x27b0bf,'active':_0x918334};};exports[_0x4803('0xf')]=function(_0x16e151,_0x237341,_0x58c4ea){if(!_['isUndefined'](_0x58c4ea)&&_0x4803('0x10')===typeof _0x58c4ea&&!_[_0x4803('0x11')](_0x58c4ea)){if(!_[_0x4803('0x12')](_0x237341)&&_0x4803('0x10')===typeof _0x237341&&!_[_0x4803('0x11')](_0x237341)){return util[_0x4803('0x13')](_0x4803('0x14'),_0x237341,_0x58c4ea);}return util[_0x4803('0x13')]('\x22%s\x22\x20<%s>',_0x58c4ea,_0x58c4ea);}if(!_[_0x4803('0x12')](_0x16e151)&&_0x4803('0x10')===typeof _0x16e151&&!_[_0x4803('0x11')](_0x16e151)){return _0x16e151;}return _0x4803('0x15');};exports[_0x4803('0x16')]=function(_0x29254d){if(_[_0x4803('0x17')](_0x29254d)){return![];}return _0x29254d;};exports['addVariables']=function(_0x41865c,_0x833596,_0x220ef5,_0x3f7399,_0x2f3b34,_0x392bb2){var _0x551c5c={'XMD-QUEUE':_0x833596[_0x4803('0x18')]?_0x833596[_0x4803('0x18')][_0x4803('0x19')]:'','XMD-CALLERID':_0x3f7399,'XMD-CALLERID-PREVIEW':_0x392bb2?util['format']('\x22%s\x22\x20<%s>',_0x392bb2['calleridname'],_0x392bb2[_0x4803('0x1a')]):_0x3f7399,'XMD-DIALID':_0x2f3b34,'XMD-CONTACTID':_0x833596[_0x4803('0x1b')],'XMD-CDRTYPE':_0x4803('0x1c'),'CALLERID(all)':_0x3f7399,'XMD-VOICEQUEUEID':_0x833596[_0x4803('0x1d')],'XMD-DIALCHANNEL':_0x220ef5,'XMD-DIALTIMEOUT':_0x41865c[_0x4803('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x4803('0x13')](_0x4803('0x1f'),_0x41865c[_0x4803('0x20')]?'g':'',_[_0x4803('0x11')](_0x41865c['monitor_format'])?'':_0x4803('0x21')),'XMD-DIALURL':_0x41865c[_0x4803('0x22')]||'','XMD-AGI':_0x41865c[_0x4803('0x23')]?util[_0x4803('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x41865c['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x41865c['dialQueueProject2']?util[_0x4803('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x41865c[_0x4803('0x20')]):_0x4803('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x392bb2?_0x392bb2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x392bb2?_0x392bb2['originatecalleridname']:'','XMD-DESTINATION':_0x4803('0x25'),'SIPADDHEADER':_0x4803('0x26')};if(!_['isEmpty'](_0x41865c[_0x4803('0x27')])){_0x551c5c[util[_0x4803('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x41865c[_0x4803('0x27')];_0x551c5c[util['format']('%s',_0x4803('0x28'))]=_0x2f3b34;}if(_0x833596&&_0x833596[_0x4803('0x29')]){for(var _0x3f5107 in _0x833596[_0x4803('0x29')]){if(_0x833596[_0x4803('0x29')][_0x4803('0x2a')](_0x3f5107)){if(!_[_0x4803('0x17')](_0x833596['Contact'][_0x3f5107])&&_0x3f5107!=='id'&&_0x3f5107!==_0x4803('0x2b')&&_0x3f5107!==_0x4803('0x2c')&&_0x3f5107!==_0x4803('0x2d')){_0x551c5c[util['format'](_0x4803('0x2e'),_0x4803('0x2f'),_[_0x4803('0x30')](_0x3f5107))]=_0x833596[_0x4803('0x29')][_0x3f5107];}}}}return _0x551c5c;};exports[_0x4803('0x31')]=function(_0xc115a){var _0x50eeca={};for(var _0x3c77bb in _0xc115a){if(_0xc115a['hasOwnProperty'](_0x3c77bb)){_0x50eeca[util[_0x4803('0x13')]('%s',_[_0x4803('0x32')](_0x3c77bb))]=_0xc115a[_0x3c77bb];}}return{'variables':_0x50eeca};};exports[_0x4803('0x33')]=function(_0x11aea3,_0x4be0a7){if(!_[_0x4803('0x17')](_0x11aea3)){if(_0x11aea3['hasOwnProperty'](_0x4803('0x34'))){if(_0x11aea3[_0x4803('0x34')]>0x0){_0x11aea3[_0x4803('0x34')]-=0x1;}else{logger['error'](_0x4803('0x35'),_0x4be0a7);}}}else{logger[_0x4803('0x8')](_0x4803('0x36'),_0x4be0a7);}};exports[_0x4803('0x37')]=function(_0x81bf21){var _0x4ae0c9=moment()['format'](_0x4803('0x38'));_0x81bf21['state']=0xd;_0x81bf21['statedesc']='Blacklist';_0x81bf21[_0x4803('0x39')]=_0x4ae0c9;_0x81bf21[_0x4803('0x3a')]=_0x4ae0c9;_0x81bf21[_0x4803('0x3b')]=_0x4ae0c9;};exports[_0x4803('0x3c')]=function(_0x3ba6be,_0xf6c4a0,_0x13dd55){var _0x50d65c=moment()['format'](_0x4803('0x38'));_0x3ba6be[_0x4803('0x3d')]=_0xf6c4a0;_0x3ba6be[_0x4803('0x3e')]=_0x13dd55;_0x3ba6be['responsetime']=_0x50d65c;_0x3ba6be[_0x4803('0x3f')]=getSeconds(_0x3ba6be[_0x4803('0x3a')],_0x3ba6be['starttime']);};exports[_0x4803('0x40')]=function(_0x5ab85c,_0x36a13a,_0x21762c){_0x5ab85c['membername']=_0x36a13a;_0x5ab85c[_0x4803('0x41')]=_0x21762c;};exports[_0x4803('0x42')]=function(_0x3e8e99,_0x328fff,_0x56cd47){var _0x1c9dc1=moment()[_0x4803('0x13')](_0x4803('0x38'));_0x3e8e99['state']=_0x328fff;_0x3e8e99[_0x4803('0x3e')]=_0x56cd47;_0x3e8e99[_0x4803('0x3a')]=_0x3e8e99[_0x4803('0x3a')]?_0x3e8e99['responsetime']:_0x1c9dc1;_0x3e8e99[_0x4803('0x3b')]=_0x3e8e99[_0x4803('0x3b')]?_0x3e8e99[_0x4803('0x3b')]:_0x1c9dc1;_0x3e8e99[_0x4803('0x3f')]=getSeconds(_0x3e8e99[_0x4803('0x3a')]||0x0,_0x3e8e99[_0x4803('0x39')]||0x0);_0x3e8e99[_0x4803('0x43')]=_0x3e8e99['answertime']?getSeconds(_0x3e8e99[_0x4803('0x3b')],_0x3e8e99[_0x4803('0x44')]):0x0;};exports[_0x4803('0x45')]=function(_0x2cec45){return _0x2cec45==='Failure';};exports[_0x4803('0x46')]=function(_0x3f8715,_0x408cbd,_0x5467c3,_0x316e3f,_0x3cd822){var _0x327a92=_0x316e3f?_0x4803('0x47'):_0x3f8715[_0x4803('0x48')];_0x327a92=_0x3cd822?_0x4803('0x49'):_0x327a92;return{'actionid':_0x3f8715[_0x4803('0x4a')],'action':_0x4803('0x4b'),'channel':_0x3f8715[_0x4803('0x4c')],'callerid':util['format'](_0x4803('0x14'),_0x327a92,_0x3f8715['calleridnum']),'Exten':_0x4803('0x25'),'Context':_0x4803('0x4d'),'Priority':'1','variable':_0x5467c3,'timeout':(_0x408cbd[_0x4803('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f8715[_0x4803('0x4a')]};};exports[_0x4803('0x4f')]=function(_0x68373c){return _0x68373c[_0x4803('0x50')]+_0x68373c[_0x4803('0x51')]+_0x68373c[_0x4803('0x52')]+_0x68373c[_0x4803('0x53')]+_0x68373c[_0x4803('0x54')];};exports[_0x4803('0x55')]=function(_0x3d51ab){var _0x4ed6e7=_[_0x4803('0x56')](_0x3d51ab);_0x4ed6e7['state']=0xf;_0x4ed6e7['statedesc']=_0x4803('0x57');return _0x4ed6e7;};exports['scheduledAt']=function(_0x24cc11,_0x14bffd,_0x18ece0){var _0x31f37f={};_0x31f37f[_0x14bffd]=_0x24cc11[_0x14bffd];_0x31f37f[_0x4803('0x58')]=![];_0x31f37f['scheduledat']=moment()[_0x4803('0x59')](_0x18ece0,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x31f37f[_0x4803('0x1b')]=_0x24cc11[_0x4803('0x1b')];_0x31f37f[_0x4803('0x5a')]=_0x24cc11['ListId'];_0x31f37f['VoiceQueueId']=_0x24cc11['VoiceQueueId']||undefined;return _0x31f37f;};exports[_0x4803('0x5b')]=function(_0x5856ef,_0x350956){if(!_[_0x4803('0x17')](_0x5856ef)){if(_0x5856ef[_0x4803('0x5c')]>0x0){_0x5856ef[_0x4803('0x5c')]-=0x1;}else{logger[_0x4803('0x8')](_0x350956,_0x4803('0x5d'));}}else{logger[_0x4803('0x8')](_0x350956,_0x4803('0x5e'));}};exports[_0x4803('0x5f')]=function(_0x38b19f){if(_0x38b19f<=0x0){return!![];}return![];};exports[_0x4803('0x60')]=function(_0x310f2e,_0x3e49a7,_0x310854){_0x310f2e['lastevent']=_0x3e49a7;_0x310f2e['name']=_0x310f2e[_0x4803('0x61')];_0x310f2e['interface']=_0x310f2e['channelAgent'];_0x310f2e[_0x4803('0x62')]=_0x4803('0x63');if(_0x310854){_0x310f2e['mandatoryDisposition']=_0x310854[_0x4803('0x64')];}return _0x310f2e;};exports['buildAcw']=function(_0x236ebb){var _0x1ec1a8={};_0x1ec1a8[_0x4803('0x61')]=_0x236ebb[_0x4803('0x61')];_0x1ec1a8[_0x4803('0x65')]=_0x236ebb[_0x4803('0x4c')];_0x1ec1a8['uniqueid']=_0x236ebb[_0x4803('0x4a')];return _0x1ec1a8;};exports[_0x4803('0x66')]=function(_0x2382c9){var _0xbda536=[];for(var _0x1067d4 in _0x2382c9){if(_0x2382c9[_0x4803('0x2a')](_0x1067d4)){if(!_[_0x4803('0x17')](_0x2382c9[_0x1067d4])&&_0x2382c9[_0x1067d4][_0x4803('0x3d')]===_0x4803('0x67')&&_0x2382c9[_0x1067d4][_0x4803('0x68')]===_0x4803('0x69')){_0xbda536[_0x4803('0x6a')](_0x2382c9[_0x1067d4]['id']);}}}return _0xbda536;};exports[_0x4803('0x6b')]=function(_0x349617){var _0x4c7b52=moment()[_0x4803('0x5')](0x0);var _0x47d61c=moment(_0x349617)['milliseconds'](0x0);return _0x4c7b52[_0x4803('0x6c')](_0x47d61c,_0x4803('0x6'));};exports[_0x4803('0x6d')]=function(_0x86189c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x86189c[_0x4803('0x1b')],'ListId':_0x86189c[_0x4803('0x5a')],'VoiceQueueId':_0x86189c[_0x4803('0x1d')]||undefined,'CampaignId':_0x86189c[_0x4803('0x6e')]||undefined};};exports[_0x4803('0x6f')]=function(_0x274398){if(_0x274398==='uniqueid'||_0x274398===_0x4803('0x70')||_0x274398===_0x4803('0x61')||_0x274398===_0x4803('0x71')||_0x274398===_0x4803('0x72')||_0x274398===_0x4803('0x73')||_0x274398==='membername'||_0x274398===_0x4803('0x4c')||_0x274398===_0x4803('0x48')||_0x274398===_0x4803('0x58')||_0x274398===_0x4803('0x1a')||_0x274398===_0x4803('0x74')||_0x274398===_0x4803('0x50')||_0x274398===_0x4803('0x51')||_0x274398==='countnoanswerretry'||_0x274398===_0x4803('0x75')||_0x274398===_0x4803('0x76')||_0x274398===_0x4803('0x77')||_0x274398===_0x4803('0x78')||_0x274398==='recallme'||_0x274398===_0x4803('0x1b')||_0x274398===_0x4803('0x5a')||_0x274398===_0x4803('0x41')||_0x274398===_0x4803('0x1d')||_0x274398==='sipcallid'||_0x274398==='xmd-voicequeueid'||_0x274398==='xmd-queue'||_0x274398===_0x4803('0x79')||_0x274398==='xmd-listid'||_0x274398==='xmd-dialurl'||_0x274398===_0x4803('0x7a')||_0x274398===_0x4803('0x7b')||_0x274398===_0x4803('0x7c')||_0x274398==='xmd-dialchannel'||_0x274398===_0x4803('0x7d')||_0x274398==='xmd-cdrtype'||_0x274398===_0x4803('0x7e')||_0x274398===_0x4803('0x7f')||_0x274398===_0x4803('0x80')||_0x274398===_0x4803('0x81')||_0x274398===_0x4803('0x82')||_0x274398===_0x4803('0x83')||_0x274398===_0x4803('0x84')||_0x274398===_0x4803('0x85')||_0x274398===_0x4803('0x86')||_0x274398==='rtpaudioqosrtt'||_0x274398==='rtpaudioqosrttbridged'||_0x274398===_0x4803('0x81')||_0x274398===_0x4803('0x82')||_0x274398===_0x4803('0x83')||_0x274398==='rtpaudioqosjitterbridged'||_0x274398===_0x4803('0x85')||_0x274398===_0x4803('0x86')||_0x274398===_0x4803('0x87')||_0x274398===_0x4803('0x88')||_0x274398===_0x4803('0x89')||_0x274398==='bridgepvtcallid'||_0x274398===_0x4803('0x3d')||_0x274398===_0x4803('0x3e')){return![];}return!![];};exports[_0x4803('0x8a')]=function(_0x78e85e,_0x222c6c){var _0x2c6c5f,_0x35cd43,_0x4dbc86;if(_0x222c6c<=0x0){_0x222c6c=0x1;}_0x2c6c5f=new RegExp(_0x4803('0x8b')+_0x222c6c+'}$');_0x35cd43=Math[_0x4803('0x8c')](0xa,_0x222c6c-0x1);_0x4dbc86=Math['pow'](0xa,_0x222c6c)-0x1;return util[_0x4803('0x13')]('%s',_[_0x4803('0x8d')](_0x78e85e,_0x2c6c5f,_['random'](_0x35cd43,_0x4dbc86)));};exports[_0x4803('0x8e')]=function(_0x367dc8){var _0x2cf841=_0x367dc8[_0x4803('0x8f')](/"(.*?)"/);return _0x2cf841?_0x2cf841[0x1]:_0x367dc8;};exports[_0x4803('0x90')]=function(_0x1ea677){var _0x1daab5=_0x1ea677[_0x4803('0x8f')](/<(.*?)>/);return _0x1daab5?_0x1daab5[0x1]:_0x1ea677;}; \ No newline at end of file +var _0xd5e2=['addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','answertime','Failure','variablesAction','RECALL','BOOKED','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','name','interface','voice','buildAcw','queue','uniqueid','agentReadyId','status','reachable','push','getDiff','CampaignId','filterKey','type','dialAnswer','active','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>'];(function(_0x51909b,_0x1f65b2){var _0x4905eb=function(_0x37f8e4){while(--_0x37f8e4){_0x51909b['push'](_0x51909b['shift']());}};_0x4905eb(++_0x1f65b2);}(_0xd5e2,0x107));var _0x2d5e=function(_0x54cefb,_0x192225){_0x54cefb=_0x54cefb-0x0;var _0x5e4fbb=_0xd5e2[_0x54cefb];return _0x5e4fbb;};'use strict';var util=require(_0x2d5e('0x0'));var _=require(_0x2d5e('0x1'));var moment=require(_0x2d5e('0x2'));var logger=require(_0x2d5e('0x3'))(_0x2d5e('0x4'));var ipAgi=process[_0x2d5e('0x5')][_0x2d5e('0x6')]||_0x2d5e('0x7');function getSeconds(_0x34db52,_0x55ca24){var _0x35ea9d=moment(_0x34db52)[_0x2d5e('0x8')](0x0);var _0x419d0a=moment(_0x55ca24)[_0x2d5e('0x8')](0x0);return _0x35ea9d[_0x2d5e('0x9')](_0x419d0a,_0x2d5e('0xa'));}exports[_0x2d5e('0xb')]=function(_0x56c06b){return function(_0xe95861){logger[_0x2d5e('0xc')](_0x56c06b,util[_0x2d5e('0xd')](_0xe95861,{'showHidden':![],'depth':null}));};};exports[_0x2d5e('0xe')]=function(_0x95333b,_0x5ef54a){logger[_0x2d5e('0xf')](_0x95333b,util[_0x2d5e('0xd')](_0x5ef54a,{'showHidden':![],'depth':null}));};exports[_0x2d5e('0x10')]=function(_0x327368,_0x24d1c9){logger[_0x2d5e('0xc')](_0x327368,util['inspect'](_0x24d1c9,{'showHidden':![],'depth':null}));};exports[_0x2d5e('0x11')]=function(_0x5d6a52){return function(_0x12a9a2){logger[_0x2d5e('0xf')](_0x5d6a52,util[_0x2d5e('0xd')](_0x12a9a2,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x50ddde,_0x57be8a,_0x1b97fd){return{'message':_0x50ddde,'unlock':_0x57be8a,'active':_0x1b97fd};};exports[_0x2d5e('0x12')]=function(_0x5e3d9a,_0x1484ae,_0x487b86){if(!_[_0x2d5e('0x13')](_0x487b86)&&_0x2d5e('0x14')===typeof _0x487b86&&!_[_0x2d5e('0x15')](_0x487b86)){if(!_[_0x2d5e('0x13')](_0x1484ae)&&_0x2d5e('0x14')===typeof _0x1484ae&&!_[_0x2d5e('0x15')](_0x1484ae)){return util[_0x2d5e('0x16')](_0x2d5e('0x17'),_0x1484ae,_0x487b86);}return util[_0x2d5e('0x16')](_0x2d5e('0x17'),_0x487b86,_0x487b86);}if(!_['isUndefined'](_0x5e3d9a)&&_0x2d5e('0x14')===typeof _0x5e3d9a&&!_[_0x2d5e('0x15')](_0x5e3d9a)){return _0x5e3d9a;}return _0x2d5e('0x18');};exports['isActive']=function(_0x276f76){if(_['isNil'](_0x276f76)){return![];}return _0x276f76;};exports[_0x2d5e('0x19')]=function(_0x4bea4d,_0x30e855,_0x269e85,_0x3cf9cc,_0x15f8db,_0x3a4615){var _0x271faf={'XMD-QUEUE':_0x30e855[_0x2d5e('0x1a')]?_0x30e855[_0x2d5e('0x1a')]['name']:'','XMD-CALLERID':_0x3cf9cc,'XMD-CALLERID-PREVIEW':_0x3a4615?util[_0x2d5e('0x16')](_0x2d5e('0x17'),_0x3a4615[_0x2d5e('0x1b')],_0x3a4615[_0x2d5e('0x1c')]):_0x3cf9cc,'XMD-DIALID':_0x15f8db,'XMD-CONTACTID':_0x30e855[_0x2d5e('0x1d')],'XMD-CDRTYPE':_0x2d5e('0x1e'),'CALLERID(all)':_0x3cf9cc,'XMD-VOICEQUEUEID':_0x30e855[_0x2d5e('0x1f')],'XMD-DIALCHANNEL':_0x269e85,'XMD-DIALTIMEOUT':_0x4bea4d[_0x2d5e('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x2d5e('0x16')]('\x22rtTxX%s%s\x22',_0x4bea4d[_0x2d5e('0x21')]?'g':'',_[_0x2d5e('0x15')](_0x4bea4d['monitor_format'])?'':_0x2d5e('0x22')),'XMD-DIALURL':_0x4bea4d[_0x2d5e('0x23')]||'','XMD-AGI':_0x4bea4d['dialQueueProject']?util[_0x2d5e('0x16')](_0x2d5e('0x24'),ipAgi,_0x4bea4d['dialQueueProject']):_0x2d5e('0x25'),'XMD-AGIAFTER':_0x4bea4d[_0x2d5e('0x21')]?util['format'](_0x2d5e('0x24'),ipAgi,_0x4bea4d['dialQueueProject2']):_0x2d5e('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x3a4615?_0x3a4615[_0x2d5e('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x3a4615?_0x3a4615['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x2d5e('0x27')};if(!_[_0x2d5e('0x15')](_0x4bea4d[_0x2d5e('0x28')])){_0x271faf[util[_0x2d5e('0x16')]('%s',_0x2d5e('0x29'))]=_0x4bea4d[_0x2d5e('0x28')];_0x271faf[util['format']('%s',_0x2d5e('0x2a'))]=_0x15f8db;}if(_0x30e855&&_0x30e855[_0x2d5e('0x2b')]){for(var _0x9f2546 in _0x30e855[_0x2d5e('0x2b')]){if(_0x30e855[_0x2d5e('0x2b')][_0x2d5e('0x2c')](_0x9f2546)){if(!_[_0x2d5e('0x2d')](_0x30e855[_0x2d5e('0x2b')][_0x9f2546])&&_0x9f2546!=='id'&&_0x9f2546!==_0x2d5e('0x2e')&&_0x9f2546!==_0x2d5e('0x2f')&&_0x9f2546!==_0x2d5e('0x30')){_0x271faf[util[_0x2d5e('0x16')](_0x2d5e('0x31'),_0x2d5e('0x32'),_[_0x2d5e('0x33')](_0x9f2546))]=_0x30e855[_0x2d5e('0x2b')][_0x9f2546];}}}}return _0x271faf;};exports[_0x2d5e('0x34')]=function(_0x56da1c){var _0x20fd11={};for(var _0x5ea092 in _0x56da1c){if(_0x56da1c['hasOwnProperty'](_0x5ea092)){_0x20fd11[util[_0x2d5e('0x16')]('%s',_[_0x2d5e('0x35')](_0x5ea092))]=_0x56da1c[_0x5ea092];}}return{'variables':_0x20fd11};};exports[_0x2d5e('0x36')]=function(_0x3b1f2e,_0x3c403d){if(!_[_0x2d5e('0x2d')](_0x3b1f2e)){if(_0x3b1f2e[_0x2d5e('0x2c')]('originated')){if(_0x3b1f2e[_0x2d5e('0x37')]>0x0){_0x3b1f2e[_0x2d5e('0x37')]-=0x1;}else{logger[_0x2d5e('0xc')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3c403d);}}}else{logger[_0x2d5e('0xc')](_0x2d5e('0x38'),_0x3c403d);}};exports[_0x2d5e('0x39')]=function(_0x5c9305){var _0x408931=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5c9305[_0x2d5e('0x3a')]=0xd;_0x5c9305[_0x2d5e('0x3b')]='Blacklist';_0x5c9305['starttime']=_0x408931;_0x5c9305[_0x2d5e('0x3c')]=_0x408931;_0x5c9305[_0x2d5e('0x3d')]=_0x408931;};exports[_0x2d5e('0x3e')]=function(_0x449428,_0x199611,_0xe995f4){var _0x34316e=moment()[_0x2d5e('0x16')](_0x2d5e('0x3f'));_0x449428[_0x2d5e('0x3a')]=_0x199611;_0x449428[_0x2d5e('0x3b')]=_0xe995f4;_0x449428['responsetime']=_0x34316e;_0x449428[_0x2d5e('0x40')]=getSeconds(_0x449428[_0x2d5e('0x3c')],_0x449428[_0x2d5e('0x41')]);};exports[_0x2d5e('0x42')]=function(_0x1bd073,_0x37312c,_0xecf44e){_0x1bd073[_0x2d5e('0x43')]=_0x37312c;_0x1bd073[_0x2d5e('0x44')]=_0xecf44e;};exports[_0x2d5e('0x45')]=function(_0x5d7f4d,_0x209079,_0x5796cc){var _0x2828b2=moment()[_0x2d5e('0x16')](_0x2d5e('0x3f'));_0x5d7f4d[_0x2d5e('0x3a')]=_0x209079;_0x5d7f4d['statedesc']=_0x5796cc;_0x5d7f4d[_0x2d5e('0x3c')]=_0x5d7f4d[_0x2d5e('0x3c')]?_0x5d7f4d[_0x2d5e('0x3c')]:_0x2828b2;_0x5d7f4d[_0x2d5e('0x3d')]=_0x5d7f4d[_0x2d5e('0x3d')]?_0x5d7f4d[_0x2d5e('0x3d')]:_0x2828b2;_0x5d7f4d[_0x2d5e('0x40')]=getSeconds(_0x5d7f4d[_0x2d5e('0x3c')]||0x0,_0x5d7f4d[_0x2d5e('0x41')]||0x0);_0x5d7f4d['talktime']=_0x5d7f4d[_0x2d5e('0x46')]?getSeconds(_0x5d7f4d['endtime'],_0x5d7f4d[_0x2d5e('0x46')]):0x0;};exports['isFailure']=function(_0x2859c5){return _0x2859c5===_0x2d5e('0x47');};exports[_0x2d5e('0x48')]=function(_0x1d63a7,_0x4588a6,_0x12c071,_0x503a41,_0xc38f50){var _0x5ad207=_0x503a41?_0x2d5e('0x49'):_0x1d63a7['calleridname'];_0x5ad207=_0xc38f50?_0x2d5e('0x4a'):_0x5ad207;return{'actionid':_0x1d63a7['uniqueid'],'action':'originate','channel':_0x1d63a7[_0x2d5e('0x4b')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x5ad207,_0x1d63a7[_0x2d5e('0x1c')]),'Exten':_0x2d5e('0x4c'),'Context':'from-sip','Priority':'1','variable':_0x12c071,'timeout':(_0x4588a6[_0x2d5e('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1d63a7['uniqueid']};};exports[_0x2d5e('0x4e')]=function(_0x200c03){return _0x200c03[_0x2d5e('0x4f')]+_0x200c03[_0x2d5e('0x50')]+_0x200c03[_0x2d5e('0x51')]+_0x200c03[_0x2d5e('0x52')]+_0x200c03[_0x2d5e('0x53')];};exports['cloneAction']=function(_0x1b17c2){var _0xfb4a7b=_[_0x2d5e('0x54')](_0x1b17c2);_0xfb4a7b['state']=0xf;_0xfb4a7b[_0x2d5e('0x3b')]=_0x2d5e('0x55');return _0xfb4a7b;};exports[_0x2d5e('0x56')]=function(_0x1b0f9f,_0x2c11ad,_0x436eab){var _0x2c2555={};_0x2c2555[_0x2c11ad]=_0x1b0f9f[_0x2c11ad];_0x2c2555['active']=![];_0x2c2555[_0x2d5e('0x57')]=moment()[_0x2d5e('0x58')](_0x436eab,_0x2d5e('0x59'))[_0x2d5e('0x16')](_0x2d5e('0x3f'));_0x2c2555['ContactId']=_0x1b0f9f[_0x2d5e('0x1d')];_0x2c2555[_0x2d5e('0x5a')]=_0x1b0f9f[_0x2d5e('0x5a')];_0x2c2555['VoiceQueueId']=_0x1b0f9f[_0x2d5e('0x1f')]||undefined;return _0x2c2555;};exports[_0x2d5e('0x5b')]=function(_0x12e3c8,_0x321b2b){if(!_['isNil'](_0x12e3c8)){if(_0x12e3c8['pTalking']>0x0){_0x12e3c8[_0x2d5e('0x5c')]-=0x1;}else{logger[_0x2d5e('0xc')](_0x321b2b,_0x2d5e('0x5d'));}}else{logger[_0x2d5e('0xc')](_0x321b2b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x20322b){if(_0x20322b<=0x0){return!![];}return![];};exports[_0x2d5e('0x5e')]=function(_0x125bee,_0x375d25,_0x2f49ec){_0x125bee[_0x2d5e('0x5f')]=_0x375d25;_0x125bee[_0x2d5e('0x60')]=_0x125bee['queue'];_0x125bee[_0x2d5e('0x61')]=_0x125bee[_0x2d5e('0x4b')];_0x125bee['motionChannel']=_0x2d5e('0x62');if(_0x2f49ec){_0x125bee['mandatoryDisposition']=_0x2f49ec['mandatoryDisposition'];}return _0x125bee;};exports[_0x2d5e('0x63')]=function(_0x40d399){var _0x166274={};_0x166274['queue']=_0x40d399[_0x2d5e('0x64')];_0x166274[_0x2d5e('0x61')]=_0x40d399[_0x2d5e('0x4b')];_0x166274[_0x2d5e('0x65')]=_0x40d399['uniqueid'];return _0x166274;};exports[_0x2d5e('0x66')]=function(_0x5e40a6){var _0x70bffc=[];for(var _0x36955c in _0x5e40a6){if(_0x5e40a6[_0x2d5e('0x2c')](_0x36955c)){if(!_['isNil'](_0x5e40a6[_0x36955c])&&_0x5e40a6[_0x36955c]['state']==='not_inuse'&&_0x5e40a6[_0x36955c][_0x2d5e('0x67')]===_0x2d5e('0x68')){_0x70bffc[_0x2d5e('0x69')](_0x5e40a6[_0x36955c]['id']);}}}return _0x70bffc;};exports[_0x2d5e('0x6a')]=function(_0x51d1e3){var _0x27d976=moment()[_0x2d5e('0x8')](0x0);var _0x109a00=moment(_0x51d1e3)[_0x2d5e('0x8')](0x0);return _0x27d976['diff'](_0x109a00,'seconds');};exports['createBody']=function(_0xa90bce){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xa90bce[_0x2d5e('0x1d')],'ListId':_0xa90bce['ListId'],'VoiceQueueId':_0xa90bce[_0x2d5e('0x1f')]||undefined,'CampaignId':_0xa90bce[_0x2d5e('0x6b')]||undefined};};exports[_0x2d5e('0x6c')]=function(_0x36397d){if(_0x36397d===_0x2d5e('0x65')||_0x36397d==='idContact'||_0x36397d==='queue'||_0x36397d===_0x2d5e('0x6d')||_0x36397d==='campaigntype'||_0x36397d===_0x2d5e('0x6e')||_0x36397d==='membername'||_0x36397d===_0x2d5e('0x4b')||_0x36397d===_0x2d5e('0x1b')||_0x36397d===_0x2d5e('0x6f')||_0x36397d==='calleridnum'||_0x36397d==='scheduledat'||_0x36397d===_0x2d5e('0x4f')||_0x36397d===_0x2d5e('0x50')||_0x36397d===_0x2d5e('0x51')||_0x36397d==='countglobal'||_0x36397d===_0x2d5e('0x70')||_0x36397d==='callbackuniqueid'||_0x36397d===_0x2d5e('0x71')||_0x36397d===_0x2d5e('0x72')||_0x36397d===_0x2d5e('0x1d')||_0x36397d===_0x2d5e('0x5a')||_0x36397d===_0x2d5e('0x44')||_0x36397d===_0x2d5e('0x1f')||_0x36397d===_0x2d5e('0x73')||_0x36397d===_0x2d5e('0x74')||_0x36397d===_0x2d5e('0x75')||_0x36397d===_0x2d5e('0x76')||_0x36397d===_0x2d5e('0x77')||_0x36397d===_0x2d5e('0x78')||_0x36397d===_0x2d5e('0x79')||_0x36397d===_0x2d5e('0x7a')||_0x36397d==='xmd-dialid'||_0x36397d===_0x2d5e('0x7b')||_0x36397d===_0x2d5e('0x7c')||_0x36397d===_0x2d5e('0x7d')||_0x36397d==='xmd-callerid'||_0x36397d===_0x2d5e('0x7e')||_0x36397d===_0x2d5e('0x7f')||_0x36397d===_0x2d5e('0x80')||_0x36397d==='rtpaudioqosbridged'||_0x36397d===_0x2d5e('0x81')||_0x36397d===_0x2d5e('0x82')||_0x36397d===_0x2d5e('0x83')||_0x36397d===_0x2d5e('0x84')||_0x36397d==='rtpaudioqosrtt'||_0x36397d==='rtpaudioqosrttbridged'||_0x36397d===_0x2d5e('0x80')||_0x36397d===_0x2d5e('0x85')||_0x36397d===_0x2d5e('0x81')||_0x36397d===_0x2d5e('0x82')||_0x36397d===_0x2d5e('0x83')||_0x36397d===_0x2d5e('0x84')||_0x36397d==='rtpaudioqosrtt'||_0x36397d===_0x2d5e('0x86')||_0x36397d===_0x2d5e('0x87')||_0x36397d===_0x2d5e('0x88')||_0x36397d===_0x2d5e('0x3a')||_0x36397d===_0x2d5e('0x3b')){return![];}return!![];};exports[_0x2d5e('0x89')]=function(_0x29317a,_0x57c941){var _0x3b41e5,_0x27db84,_0x418e6b;if(_0x57c941<=0x0){_0x57c941=0x1;}_0x3b41e5=new RegExp(_0x2d5e('0x8a')+_0x57c941+'}$');_0x27db84=Math[_0x2d5e('0x8b')](0xa,_0x57c941-0x1);_0x418e6b=Math[_0x2d5e('0x8b')](0xa,_0x57c941)-0x1;return util[_0x2d5e('0x16')]('%s',_[_0x2d5e('0x8c')](_0x29317a,_0x3b41e5,_[_0x2d5e('0x8d')](_0x27db84,_0x418e6b)));};exports['extractCalleridName']=function(_0x35e59a){var _0x562f4e=_0x35e59a[_0x2d5e('0x8e')](/"(.*?)"/);return _0x562f4e?_0x562f4e[0x1]:_0x35e59a;};exports[_0x2d5e('0x8f')]=function(_0x56c3a6){var _0x456656=_0x56c3a6['match'](/<(.*?)>/);return _0x456656?_0x456656[0x1]:_0x56c3a6;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c3c45ed..a56f4b5 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 _0x07ba=['queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove'];(function(_0x48651a,_0x154d06){var _0x50a081=function(_0x30c8b5){while(--_0x30c8b5){_0x48651a['push'](_0x48651a['shift']());}};_0x50a081(++_0x154d06);}(_0x07ba,0x104));var _0xa07b=function(_0x438a94,_0x3c0c56){_0x438a94=_0x438a94-0x0;var _0x4baf66=_0x07ba[_0x438a94];return _0x4baf66;};'use strict';exports[_0xa07b('0x0')]={'queue':{'type':_0xa07b('0x1'),'required':!![]},'interface':{'type':_0xa07b('0x1'),'required':!![]},'membername':{'type':_0xa07b('0x1'),'required':!![]},'penalty':{'type':_0xa07b('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xa07b('0x3')]={'queue':{'type':_0xa07b('0x1'),'required':!![]},'interface':{'type':_0xa07b('0x1'),'required':!![]}};exports[_0xa07b('0x4')]={'interface':{'type':_0xa07b('0x1'),'required':!![]},'paused':{'type':_0xa07b('0x5')},'reason':{'type':'string','required':![]}};exports[_0xa07b('0x6')]={'module':{'type':_0xa07b('0x1'),'required':![]}};exports[_0xa07b('0x7')]={'uniqueid':{'type':_0xa07b('0x1'),'required':!![]}};exports[_0xa07b('0x8')]={'uniqueid':{'type':_0xa07b('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0xa07b('0x1')}};exports[_0xa07b('0x9')]={'uniqueid':{'type':_0xa07b('0x1'),'required':!![]}};exports[_0xa07b('0xa')]={'uniqueid':{'type':_0xa07b('0x1'),'required':!![]},'exten':{'type':_0xa07b('0x1'),'required':!![]},'context':{'type':_0xa07b('0x1')}}; \ No newline at end of file +var _0x2516=['number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','queueadd','string'];(function(_0x344073,_0x443928){var _0x22aa0d=function(_0x35b44f){while(--_0x35b44f){_0x344073['push'](_0x344073['shift']());}};_0x22aa0d(++_0x443928);}(_0x2516,0x14e));var _0x6251=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x2516[_0xea8947];return _0x2455e9;};'use strict';exports[_0x6251('0x0')]={'queue':{'type':_0x6251('0x1'),'required':!![]},'interface':{'type':_0x6251('0x1'),'required':!![]},'membername':{'type':_0x6251('0x1'),'required':!![]},'penalty':{'type':_0x6251('0x2'),'required':![]},'paused':{'type':_0x6251('0x3'),'required':![]}};exports[_0x6251('0x4')]={'queue':{'type':_0x6251('0x1'),'required':!![]},'interface':{'type':_0x6251('0x1'),'required':!![]}};exports[_0x6251('0x5')]={'interface':{'type':_0x6251('0x1'),'required':!![]},'paused':{'type':_0x6251('0x3')},'reason':{'type':_0x6251('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x6251('0x6')]={'uniqueid':{'type':_0x6251('0x1'),'required':!![]}};exports[_0x6251('0x7')]={'uniqueid':{'type':_0x6251('0x1'),'required':!![]},'filename':{'type':_0x6251('0x1')},'format':{'type':_0x6251('0x1')},'mixmonitorid':{'type':_0x6251('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6251('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x6251('0x1'),'required':!![]},'context':{'type':_0x6251('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 8ba8197..98ff75c 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 _0x9cab=['dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumHoldTime','sumBillable','isEmpty','total','unmanaged','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','diff','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0x4ff1fb,_0x4184d4){var _0x30e1fb=function(_0x2d6a70){while(--_0x2d6a70){_0x4ff1fb['push'](_0x4ff1fb['shift']());}};_0x30e1fb(++_0x4184d4);}(_0x9cab,0xab));var _0xb9ca=function(_0x53d719,_0x147238){_0x53d719=_0x53d719-0x0;var _0xea1220=_0x9cab[_0x53d719];return _0xea1220;};'use strict';var BPromise=require(_0xb9ca('0x0'));var util=require(_0xb9ca('0x1'));var _=require(_0xb9ca('0x2'));var moment=require(_0xb9ca('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xb9ca('0x4'));var Trunk=require(_0xb9ca('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xb9ca('0x6'));var Campaign=require(_0xb9ca('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xb9ca('0x8'));var SalesforceAccount=require(_0xb9ca('0x9'));var FreshdeskAccount=require(_0xb9ca('0xa'));var SugarcrmAccount=require(_0xb9ca('0xb'));var ZohoAccount=require(_0xb9ca('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xb9ca('0xd'));var ServicenowAccount=require(_0xb9ca('0xe'));var Dynamics365Account=require(_0xb9ca('0xf'));var FreshsalesAccount=require(_0xb9ca('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xb9ca('0x11')]={};this[_0xb9ca('0x12')]={};this[_0xb9ca('0x13')]={};this[_0xb9ca('0x14')]={};this[_0xb9ca('0x15')]={};this[_0xb9ca('0x16')]={};this[_0xb9ca('0x17')]={};this[_0xb9ca('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb9ca('0x19')]={};this[_0xb9ca('0x1a')]={};this[_0xb9ca('0x1b')]={};this[_0xb9ca('0x1c')]={};this[_0xb9ca('0x1d')]={};this['zendeskAccounts']={};this[_0xb9ca('0x1e')]={};this[_0xb9ca('0x1f')]={};this[_0xb9ca('0x20')]={};this[_0xb9ca('0x21')]={};this[_0xb9ca('0x22')]={};this[_0xb9ca('0x23')]={};this[_0xb9ca('0x24')]={};this[_0xb9ca('0x25')]={};this[_0xb9ca('0x26')]={};this[_0xb9ca('0x27')]={};};function freeIsNotKey(_0x27663a,_0x4431ea,_0x41cf89){var _0xb10126=_[_0xb9ca('0x28')](_0x27663a,function(_0x487253,_0x1c1257){return _0x487253[_0x41cf89];});for(var _0x1f941b in _0x4431ea){if(_0x4431ea[_0xb9ca('0x29')](_0x1f941b)){if(!_0xb10126[_0x1f941b]){delete _0x4431ea[_0x1f941b];}}}}function freeIsNotKeySip(_0x431e22,_0x5d1a24){var _0x21246f=_[_0xb9ca('0x28')](_0x431e22,function(_0x301723,_0xaa87a8){return util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x301723[_0xb9ca('0x2c')]);});for(var _0xa93ec in _0x5d1a24){if(_0x5d1a24[_0xb9ca('0x29')](_0xa93ec)){if(!_0x21246f[_0xa93ec]){delete _0x5d1a24[_0xa93ec];}}}}function freeIsNotKeyAgent(_0x4d080e,_0x518e96){var _0x46b7b3=_[_0xb9ca('0x28')](_0x4d080e,function(_0x1dcf08,_0x3a237a){var _0x4ba7bd=_[_0xb9ca('0x2d')](_0x1dcf08[_0xb9ca('0x2e')])?util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x1dcf08[_0xb9ca('0x2c')]):_0x1dcf08['interface'];return _0x4ba7bd;});for(var _0x1ba57d in _0x518e96){if(_0x518e96[_0xb9ca('0x29')](_0x1ba57d)){if(!_0x46b7b3[_0x1ba57d]){delete _0x518e96[_0x1ba57d];}}}}function clearVoiceCallReports(_0x2ec058){_0x2ec058['total']=0x0;_0x2ec058[_0xb9ca('0x2f')]=0x0;_0x2ec058[_0xb9ca('0x30')]=0x0;_0x2ec058['sumDuration']=0x0;_0x2ec058[_0xb9ca('0x31')]=0x0;}function clearCampaigns(_0x22df12){if(!_[_0xb9ca('0x32')](_0x22df12)){for(var _0x315cf9 in _0x22df12){if(_0x22df12[_0xb9ca('0x29')](_0x315cf9)){_0x22df12[_0x315cf9]['ivrTotalCallsDays']=0x0;_0x22df12[_0x315cf9]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x36e004){if(!_[_0xb9ca('0x32')](_0x36e004)){for(var _0x47a586 in _0x36e004){if(_0x36e004['hasOwnProperty'](_0x47a586)){_0x36e004[_0x47a586][_0xb9ca('0x33')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x2f')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x34')]=0x0;_0x36e004[_0x47a586]['abandoned']=0x0;_0x36e004[_0x47a586][_0xb9ca('0x30')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x35')]=0x0;_0x36e004[_0x47a586]['sumBillable']=0x0;_0x36e004[_0x47a586][_0xb9ca('0x36')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x37')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x38')]=0x0;_0x36e004[_0x47a586]['outboundCongestionCallsDay']=0x0;_0x36e004[_0x47a586]['outboundNoSuchCallsDay']=0x0;_0x36e004[_0x47a586][_0xb9ca('0x39')]=0x0;_0x36e004[_0x47a586]['outboundDropCallsDayTimeout']=0x0;_0x36e004[_0x47a586][_0xb9ca('0x3a')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x3b')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x3c')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x3d')]=0x0;_0x36e004[_0x47a586]['outboundReCallsDay']=0x0;_0x36e004[_0x47a586][_0xb9ca('0x36')]=0x0;_0x36e004[_0x47a586][_0xb9ca('0x3e')]=0x0;_0x36e004[_0x47a586]['queueStatusComplete']=!![];}}}}Realtime[_0xb9ca('0x3f')][_0xb9ca('0x40')]=function(_0x5d186b,_0x5e6300){for(var _0x48c965 in _0x5e6300){if(_0x5d186b[_0xb9ca('0x29')](_0x48c965)){_0x5d186b[_0x48c965]=_0x5e6300[_0x48c965];}}};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x41')]=function(){var _0x2c036c=this;return function(_0x2b7811){if(_0x2b7811){freeIsNotKeyAgent(_0x2b7811,_0x2c036c[_0xb9ca('0x11')]);for(var _0x157e58=0x0,_0x176ea6={},_0x4f3420={};_0x157e58<_0x2b7811[_0xb9ca('0x42')];_0x157e58+=0x1){_0x176ea6=_0x2b7811[_0x157e58];var _0x2d18e0=_[_0xb9ca('0x2d')](_0x176ea6[_0xb9ca('0x2e')])?util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x176ea6[_0xb9ca('0x2c')]):_0x176ea6[_0xb9ca('0x2e')];if(_[_0xb9ca('0x43')](_0x2c036c[_0xb9ca('0x11')][_0x2d18e0])){_0x2c036c[_0xb9ca('0x11')][_0x2d18e0]=new Agent(_0x176ea6);}else{_0x2c036c['mergeFromDatabase'](_0x2c036c[_0xb9ca('0x11')][_0x2d18e0],_0x176ea6);}}}return _0x2c036c[_0xb9ca('0x11')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x44')]=function(){var _0x24b673=this;return function(_0x19bf0b){if(_0x19bf0b){freeIsNotKeySip(_0x19bf0b,_0x24b673[_0xb9ca('0x12')]);for(var _0x271484=0x0,_0x38e476={},_0x5960b4={};_0x271484<_0x19bf0b[_0xb9ca('0x42')];_0x271484+=0x1){_0x38e476=_0x19bf0b[_0x271484];if(_[_0xb9ca('0x43')](_0x24b673[_0xb9ca('0x12')][util['format']('SIP/%s',_0x38e476[_0xb9ca('0x2c')])])){_0x24b673[_0xb9ca('0x12')][util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x38e476[_0xb9ca('0x2c')])]=new Telephone(_0x38e476);}else{_0x24b673[_0xb9ca('0x40')](_0x24b673[_0xb9ca('0x12')][util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x38e476[_0xb9ca('0x2c')])],_0x38e476);}}}return _0x24b673[_0xb9ca('0x12')];};};Realtime['prototype'][_0xb9ca('0x45')]=function(){var _0x47a4dd=this;return function(_0x37914a){if(_0x37914a){freeIsNotKeySip(_0x37914a,_0x47a4dd[_0xb9ca('0x13')]);for(var _0x13a4a9=0x0,_0x4c93fb={},_0x2fc2cf={};_0x13a4a9<_0x37914a[_0xb9ca('0x42')];_0x13a4a9+=0x1){_0x4c93fb=_0x37914a[_0x13a4a9];if(_[_0xb9ca('0x43')](_0x47a4dd[_0xb9ca('0x13')][util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x4c93fb[_0xb9ca('0x2c')])])){_0x47a4dd[_0xb9ca('0x13')][util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x4c93fb[_0xb9ca('0x2c')])]=new Trunk(_0x4c93fb);}else{_0x47a4dd[_0xb9ca('0x40')](_0x47a4dd[_0xb9ca('0x13')][util[_0xb9ca('0x2a')](_0xb9ca('0x2b'),_0x4c93fb[_0xb9ca('0x2c')])],_0x4c93fb);}}}return _0x47a4dd['trunks'];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x46')]=function(){var _0x28f1a3=this;return function(_0x4bf752){if(_0x4bf752){freeIsNotKey(_0x4bf752,_0x28f1a3[_0xb9ca('0x14')],'name');for(var _0x3147ad=0x0,_0x36f1d9={},_0x29750e={};_0x3147ad<_0x4bf752['length'];_0x3147ad+=0x1){_0x36f1d9=_0x4bf752[_0x3147ad];if(_[_0xb9ca('0x43')](_0x28f1a3[_0xb9ca('0x14')][_0x36f1d9['name']])){_0x28f1a3[_0xb9ca('0x14')][_0x36f1d9[_0xb9ca('0x2c')]]=new VoiceQueue(_0x36f1d9);}else{_0x28f1a3[_0xb9ca('0x40')](_0x28f1a3['voiceQueues'][_0x36f1d9[_0xb9ca('0x2c')]],_0x36f1d9);}}}return _0x28f1a3[_0xb9ca('0x14')];};};Realtime[_0xb9ca('0x3f')]['initTriggers']=function(){var _0x64c96c=this;return function(_0x2e2804){if(_0x2e2804){freeIsNotKey(_0x2e2804,_0x64c96c[_0xb9ca('0x15')],'id');for(var _0xbec893=0x0,_0x57b3ba={},_0x51f3f2={};_0xbec893<_0x2e2804['length'];_0xbec893+=0x1){_0x57b3ba=_0x2e2804[_0xbec893];if(_[_0xb9ca('0x43')](_0x64c96c[_0xb9ca('0x15')][_0x57b3ba['id']])){_0x64c96c['triggers'][_0x57b3ba['id']]=new Trigger(_0x57b3ba);}else{_0x64c96c[_0xb9ca('0x40')](_0x64c96c['triggers'][_0x57b3ba['id']],_0x57b3ba);}}}return _0x64c96c['triggers'];};};Realtime[_0xb9ca('0x3f')]['initTemplates']=function(){var _0x2c294a=this;return function(_0x4d9d82){if(_0x4d9d82){freeIsNotKey(_0x4d9d82,_0x2c294a['templates'],'id');for(var _0x177fde=0x0,_0x29e3dd={},_0x1784fe={};_0x177fde<_0x4d9d82[_0xb9ca('0x42')];_0x177fde+=0x1){_0x29e3dd=_0x4d9d82[_0x177fde];if(_[_0xb9ca('0x43')](_0x2c294a[_0xb9ca('0x17')][_0x29e3dd['id']])){_0x2c294a[_0xb9ca('0x17')][_0x29e3dd['id']]=new Template(_0x29e3dd);}else{_0x2c294a['mergeFromDatabase'](_0x2c294a[_0xb9ca('0x17')][_0x29e3dd['id']],_0x29e3dd);}}}return _0x2c294a['templates'];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x47')]=function(){var _0x53d6a8=this;return function(_0x20af38){if(_0x20af38){freeIsNotKey(_0x20af38,_0x53d6a8[_0xb9ca('0x48')],'id');for(var _0x771ea8=0x0,_0x52a59d={},_0x571d78={};_0x771ea8<_0x20af38[_0xb9ca('0x42')];_0x771ea8+=0x1){_0x52a59d=_0x20af38[_0x771ea8];if(_[_0xb9ca('0x43')](_0x53d6a8['zendeskAccounts'][_0x52a59d['id']])){_0x53d6a8['zendeskAccounts'][_0x52a59d['id']]=new ZendeskAccount(_0x52a59d);}else{_0x53d6a8['mergeFromDatabase'](_0x53d6a8[_0xb9ca('0x48')][_0x52a59d['id']],_0x52a59d);}}}return _0x53d6a8[_0xb9ca('0x48')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x49')]=function(){var _0x496bff=this;return function(_0x47b150){if(_0x47b150){freeIsNotKey(_0x47b150,_0x496bff[_0xb9ca('0x1e')],'id');for(var _0x58ddf1=0x0,_0x7050ab={},_0x422e1a={};_0x58ddf1<_0x47b150[_0xb9ca('0x42')];_0x58ddf1+=0x1){_0x7050ab=_0x47b150[_0x58ddf1];if(_['isUndefined'](_0x496bff[_0xb9ca('0x1e')][_0x7050ab['id']])){_0x496bff[_0xb9ca('0x1e')][_0x7050ab['id']]=new SalesforceAccount(_0x7050ab);}else{_0x496bff['mergeFromDatabase'](_0x496bff['salesforceAccounts'][_0x7050ab['id']],_0x7050ab);}}}return _0x496bff['salesforceAccounts'];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4a')]=function(){var _0x3a5e1a=this;return function(_0xa2de4c){if(_0xa2de4c){freeIsNotKey(_0xa2de4c,_0x3a5e1a[_0xb9ca('0x20')],'id');for(var _0x20b880=0x0,_0x5c71d4={},_0x45648e={};_0x20b880<_0xa2de4c[_0xb9ca('0x42')];_0x20b880+=0x1){_0x5c71d4=_0xa2de4c[_0x20b880];if(_[_0xb9ca('0x43')](_0x3a5e1a['freshdeskAccounts'][_0x5c71d4['id']])){_0x3a5e1a[_0xb9ca('0x20')][_0x5c71d4['id']]=new FreshdeskAccount(_0x5c71d4);}else{_0x3a5e1a['mergeFromDatabase'](_0x3a5e1a['freshdeskAccounts'][_0x5c71d4['id']],_0x5c71d4);}}}return _0x3a5e1a[_0xb9ca('0x20')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4b')]=function(){var _0x58ba92=this;return function(_0xf1fcab){if(_0xf1fcab){freeIsNotKey(_0xf1fcab,_0x58ba92[_0xb9ca('0x21')],'id');for(var _0x21074e=0x0,_0x53fec1={},_0x185d02={};_0x21074e<_0xf1fcab['length'];_0x21074e+=0x1){_0x53fec1=_0xf1fcab[_0x21074e];if(_['isUndefined'](_0x58ba92['zohoAccounts'][_0x53fec1['id']])){_0x58ba92[_0xb9ca('0x21')][_0x53fec1['id']]=new ZohoAccount(_0x53fec1);}else{_0x58ba92[_0xb9ca('0x40')](_0x58ba92[_0xb9ca('0x21')][_0x53fec1['id']],_0x53fec1);}}}return _0x58ba92[_0xb9ca('0x21')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4c')]=function(){var _0x3ce61e=this;return function(_0x538ead){if(_0x538ead){freeIsNotKey(_0x538ead,_0x3ce61e[_0xb9ca('0x22')],'id');for(var _0x470357=0x0,_0x441e09={},_0x1bbbf2={};_0x470357<_0x538ead[_0xb9ca('0x42')];_0x470357+=0x1){_0x441e09=_0x538ead[_0x470357];if(_[_0xb9ca('0x43')](_0x3ce61e['deskAccounts'][_0x441e09['id']])){_0x3ce61e['deskAccounts'][_0x441e09['id']]=new DeskAccount(_0x441e09);}else{_0x3ce61e[_0xb9ca('0x40')](_0x3ce61e[_0xb9ca('0x22')][_0x441e09['id']],_0x441e09);}}}return _0x3ce61e[_0xb9ca('0x22')];};};Realtime[_0xb9ca('0x3f')]['initSugarcrmAccounts']=function(){var _0x55b1ba=this;return function(_0x18b446){if(_0x18b446){freeIsNotKey(_0x18b446,_0x55b1ba['sugarcrmAccounts'],'id');for(var _0x3de1c0=0x0,_0x4e42bd={},_0x1c32e6={};_0x3de1c0<_0x18b446[_0xb9ca('0x42')];_0x3de1c0+=0x1){_0x4e42bd=_0x18b446[_0x3de1c0];if(_[_0xb9ca('0x43')](_0x55b1ba[_0xb9ca('0x1f')][_0x4e42bd['id']])){_0x55b1ba[_0xb9ca('0x1f')][_0x4e42bd['id']]=new SugarcrmAccount(_0x4e42bd);}else{_0x55b1ba[_0xb9ca('0x40')](_0x55b1ba[_0xb9ca('0x1f')][_0x4e42bd['id']],_0x4e42bd);}}}return _0x55b1ba[_0xb9ca('0x1f')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x4ab08a=this;return function(_0xee2c45){if(_0xee2c45){freeIsNotKey(_0xee2c45,_0x4ab08a[_0xb9ca('0x23')],'id');for(var _0x485e09=0x0,_0x35692e={},_0xdde05c={};_0x485e09<_0xee2c45[_0xb9ca('0x42')];_0x485e09+=0x1){_0x35692e=_0xee2c45[_0x485e09];if(_[_0xb9ca('0x43')](_0x4ab08a[_0xb9ca('0x23')][_0x35692e['id']])){_0x4ab08a[_0xb9ca('0x23')][_0x35692e['id']]=new VtigerAccount(_0x35692e);}else{_0x4ab08a[_0xb9ca('0x40')](_0x4ab08a['vtigerAccounts'][_0x35692e['id']],_0x35692e);}}}return _0x4ab08a['vtigerAccounts'];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4d')]=function(){var _0x1671f6=this;return function(_0x21bef9){if(_0x21bef9){freeIsNotKey(_0x21bef9,_0x1671f6[_0xb9ca('0x24')],'id');for(var _0x255675=0x0,_0x271d43={},_0x3f5c3d={};_0x255675<_0x21bef9['length'];_0x255675+=0x1){_0x271d43=_0x21bef9[_0x255675];if(_[_0xb9ca('0x43')](_0x1671f6[_0xb9ca('0x24')][_0x271d43['id']])){_0x1671f6[_0xb9ca('0x24')][_0x271d43['id']]=new ServicenowAccount(_0x271d43);}else{_0x1671f6[_0xb9ca('0x40')](_0x1671f6[_0xb9ca('0x24')][_0x271d43['id']],_0x271d43);}}}return _0x1671f6[_0xb9ca('0x24')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4e')]=function(){var _0x257f6b=this;return function(_0x518b27){if(_0x518b27){freeIsNotKey(_0x518b27,_0x257f6b[_0xb9ca('0x25')],'id');for(var _0x5d2658=0x0,_0x68bf8f={},_0x3fb93e={};_0x5d2658<_0x518b27['length'];_0x5d2658+=0x1){_0x68bf8f=_0x518b27[_0x5d2658];if(_[_0xb9ca('0x43')](_0x257f6b[_0xb9ca('0x25')][_0x68bf8f['id']])){_0x257f6b[_0xb9ca('0x25')][_0x68bf8f['id']]=new Dynamics365Account(_0x68bf8f);}else{_0x257f6b['mergeFromDatabase'](_0x257f6b[_0xb9ca('0x25')][_0x68bf8f['id']],_0x68bf8f);}}}return _0x257f6b[_0xb9ca('0x25')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x4f')]=function(){var _0x1fe8a6=this;return function(_0x3d40ce){if(_0x3d40ce){freeIsNotKey(_0x3d40ce,_0x1fe8a6[_0xb9ca('0x26')],'id');for(var _0x1579a0=0x0,_0x540db7={},_0x1b70e9={};_0x1579a0<_0x3d40ce[_0xb9ca('0x42')];_0x1579a0+=0x1){_0x540db7=_0x3d40ce[_0x1579a0];if(_[_0xb9ca('0x43')](_0x1fe8a6[_0xb9ca('0x26')][_0x540db7['id']])){_0x1fe8a6[_0xb9ca('0x26')][_0x540db7['id']]=new FreshsalesAccount(_0x540db7);}else{_0x1fe8a6[_0xb9ca('0x40')](_0x1fe8a6[_0xb9ca('0x26')][_0x540db7['id']],_0x540db7);}}}return _0x1fe8a6[_0xb9ca('0x26')];};};Realtime[_0xb9ca('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x3ab8cb=this;return function(_0x5b97bf){for(var _0x2edb7b=0x0;_0x2edb7b<_0x5b97bf[_0xb9ca('0x42')];_0x2edb7b+=0x1){_[_0xb9ca('0x50')](_0x3ab8cb[_0xb9ca('0x14')][_0x5b97bf[_0x2edb7b]['name']],_0x5b97bf[_0x2edb7b]);}return _0x3ab8cb[_0xb9ca('0x14')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x51')]=function(){var _0x43016c=this;return function(_0x4527b2){clearVoiceQueues(_0x43016c[_0xb9ca('0x14')]);if(_0x4527b2){_0x4527b2=_[_0xb9ca('0x52')](_0x4527b2,'uniqueid');for(var _0x251a59 in _0x4527b2){if(_0x4527b2[_0xb9ca('0x29')](_0x251a59)){var _0x2fbe69={};for(var _0xa6358b=0x0;_0xa6358b<_0x4527b2[_0x251a59][_0xb9ca('0x42')];_0xa6358b+=0x1){var _0x32e1f7=_0x4527b2[_0x251a59][_0xa6358b]['queue'];if(_0x43016c['voiceQueues'][_0x32e1f7]){if(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x53')]){_0x43016c[_0xb9ca('0x14')][_0x32e1f7]['unmanaged']+=0x1;}if(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x54')]){_0x43016c['voiceQueues'][_0x32e1f7]['abandoned']+=0x1;}_0x43016c[_0xb9ca('0x14')][_0x32e1f7][_0xb9ca('0x30')]+=moment(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x55')])['diff'](moment(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x56')]),_0xb9ca('0x57'))||0x0;if(_0xa6358b===_0x4527b2[_0x251a59][_0xb9ca('0x42')]-0x1){_0x43016c[_0xb9ca('0x14')][_0x32e1f7][_0xb9ca('0x35')]+=moment(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x58')]||_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x59')]||_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x5a')])['diff'](moment(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x56')]),_0xb9ca('0x57'))||0x0;_0x43016c[_0xb9ca('0x14')][_0x32e1f7]['total']+=0x1;if(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x5b')]){_0x43016c[_0xb9ca('0x14')][_0x32e1f7]['answered']+=0x1;_0x43016c[_0xb9ca('0x14')][_0x32e1f7]['sumBillable']+=moment(_0x4527b2[_0x251a59][_0xa6358b]['queuecallercompleteAt'])[_0xb9ca('0x5c')](moment(_0x4527b2[_0x251a59][_0xa6358b][_0xb9ca('0x55')]),_0xb9ca('0x57'))||0x0;}}else{_0x43016c[_0xb9ca('0x14')][_0x32e1f7][_0xb9ca('0x35')]+=_0x43016c[_0xb9ca('0x14')][_0x32e1f7][_0xb9ca('0x30')]||0x0;}}}}}}return _0x43016c['voiceQueues'];};};Realtime[_0xb9ca('0x3f')]['initVoiceCallReports']=function(){var _0x2d623a=this;return function(_0x26dfd9){clearVoiceCallReports(_0x2d623a[_0xb9ca('0x18')]);if(_0x26dfd9){for(var _0x44119b=0x0;_0x44119b<_0x26dfd9[_0xb9ca('0x42')];_0x44119b+=0x1){_0x2d623a[_0xb9ca('0x18')][_0xb9ca('0x33')]+=0x1;_0x2d623a[_0xb9ca('0x18')]['sumDuration']+=_0x26dfd9[_0x44119b][_0xb9ca('0x5d')];if(_0x26dfd9[_0x44119b][_0xb9ca('0x5e')]===_0xb9ca('0x5f')){_0x2d623a[_0xb9ca('0x18')][_0xb9ca('0x2f')]+=0x1;_0x2d623a[_0xb9ca('0x18')][_0xb9ca('0x30')]+=_0x26dfd9[_0x44119b][_0xb9ca('0x5d')]-_0x26dfd9[_0x44119b][_0xb9ca('0x60')]||0x0;_0x2d623a['outbound'][_0xb9ca('0x31')]+=_0x26dfd9[_0x44119b][_0xb9ca('0x60')];}}}return _0x2d623a[_0xb9ca('0x18')];};};Realtime[_0xb9ca('0x3f')]['initCampaigns']=function(){var _0xd3e9fd=this;return function(_0x4bffda){if(_0x4bffda){freeIsNotKey(_0x4bffda,_0xd3e9fd[_0xb9ca('0x16')],'name');for(var _0x3b21a2=0x0,_0x5d8634={};_0x3b21a2<_0x4bffda['length'];_0x3b21a2+=0x1){_0x5d8634=_0x4bffda[_0x3b21a2];if(_['isUndefined'](_0xd3e9fd[_0xb9ca('0x16')][_0x5d8634[_0xb9ca('0x2c')]])){_0xd3e9fd['campaigns'][_0x5d8634[_0xb9ca('0x2c')]]=new Campaign(_0x5d8634);}else{_0xd3e9fd[_0xb9ca('0x40')](_0xd3e9fd['campaigns'][_0x5d8634[_0xb9ca('0x2c')]],_0x5d8634);_0xd3e9fd[_0xb9ca('0x16')][_0x5d8634['name']][_0xb9ca('0x61')]=_0x5d8634[_0xb9ca('0x62')]?_0x5d8634[_0xb9ca('0x62')][_0xb9ca('0x2c')]:undefined;}}}return _0xd3e9fd[_0xb9ca('0x16')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x63')]=function(){var _0x62bf65=this;return function(_0x1cc5cf){if(_0x1cc5cf){freeIsNotKey(_0x1cc5cf,_0x62bf65['voiceExtensions'],'id');for(var _0xc494e0=0x0,_0x36cfe4={};_0xc494e0<_0x1cc5cf[_0xb9ca('0x42')];_0xc494e0+=0x1){_0x36cfe4=_0x1cc5cf[_0xc494e0];if(_['isUndefined'](_0x62bf65[_0xb9ca('0x64')][_0x36cfe4['id']])){_0x62bf65[_0xb9ca('0x64')][_0x36cfe4['id']]=new VoiceExtension(_0x36cfe4);}else{_0x62bf65[_0xb9ca('0x40')](_0x62bf65[_0xb9ca('0x64')][_0x36cfe4['id']],_0x36cfe4);}}}return _0x62bf65[_0xb9ca('0x64')];};};Realtime[_0xb9ca('0x3f')][_0xb9ca('0x65')]=function(){var _0x1734cf=this;return function(_0x5387c5){clearCampaigns(_0x1734cf[_0xb9ca('0x16')]);for(var _0x3d5f15=0x0;_0x3d5f15<_0x5387c5[_0xb9ca('0x42')];_0x3d5f15+=0x1){_['merge'](_0x1734cf[_0xb9ca('0x16')][_0x5387c5[_0x3d5f15][_0xb9ca('0x2c')]],_0x5387c5[_0x3d5f15]);}return _0x1734cf['campaigns'];};};Realtime['prototype'][_0xb9ca('0x66')]=function(){var _0x4d5a76=this;return function(_0x5870b8){if(_0x5870b8){freeIsNotKey(_0x5870b8,_0x4d5a76['faxAccounts'],'id');for(var _0x4284b8=0x0,_0x90b80e={},_0x87f664={};_0x4284b8<_0x5870b8[_0xb9ca('0x42')];_0x4284b8+=0x1){_0x90b80e=_0x5870b8[_0x4284b8];if(_[_0xb9ca('0x43')](_0x4d5a76[_0xb9ca('0x27')][_0x90b80e['id']])){_0x4d5a76[_0xb9ca('0x27')][_0x90b80e['id']]=new FaxAccount(_0x90b80e);}else{_0x4d5a76[_0xb9ca('0x40')](_0x4d5a76[_0xb9ca('0x27')][_0x90b80e['id']],_0x90b80e);}}}return _0x4d5a76[_0xb9ca('0x27')];};};module[_0xb9ca('0x67')]=Realtime; \ No newline at end of file +var _0x4105=['queuecallerabandonAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','format','name','isNil','interface','hasOwnProperty','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','SIP/%s','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x5ce268,_0x1835b6){var _0x28c96a=function(_0x18c1d6){while(--_0x18c1d6){_0x5ce268['push'](_0x5ce268['shift']());}};_0x28c96a(++_0x1835b6);}(_0x4105,0x1c3));var _0x5410=function(_0x369005,_0x528230){_0x369005=_0x369005-0x0;var _0x140585=_0x4105[_0x369005];return _0x140585;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x5410('0x0'));var moment=require(_0x5410('0x1'));var Agent=require('../model/agent');var Telephone=require(_0x5410('0x2'));var Trunk=require(_0x5410('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5410('0x4'));var Template=require(_0x5410('0x5'));var Campaign=require(_0x5410('0x6'));var VoiceExtension=require(_0x5410('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x5410('0x8'));var FreshdeskAccount=require(_0x5410('0x9'));var SugarcrmAccount=require(_0x5410('0xa'));var ZohoAccount=require(_0x5410('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x5410('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x5410('0xd'));var FaxAccount=require(_0x5410('0xe'));var Realtime=function(){this[_0x5410('0xf')]={};this[_0x5410('0x10')]={};this['trunks']={};this[_0x5410('0x11')]={};this[_0x5410('0x12')]={};this[_0x5410('0x13')]={};this[_0x5410('0x14')]={};this[_0x5410('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5410('0x16')]={};this[_0x5410('0x17')]={};this[_0x5410('0x18')]={};this[_0x5410('0x19')]={};this['timers']={};this[_0x5410('0x1a')]={};this[_0x5410('0x1b')]={};this['salesforceAccounts']={};this[_0x5410('0x1c')]={};this[_0x5410('0x1d')]={};this[_0x5410('0x1e')]={};this[_0x5410('0x1f')]={};this[_0x5410('0x20')]={};this[_0x5410('0x21')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0x5410('0x22')]={};};function freeIsNotKey(_0x3790ff,_0x4d3b71,_0x14d29e){var _0x348308=_[_0x5410('0x23')](_0x3790ff,function(_0x3ecdda,_0x32132f){return _0x3ecdda[_0x14d29e];});for(var _0x35bbbb in _0x4d3b71){if(_0x4d3b71['hasOwnProperty'](_0x35bbbb)){if(!_0x348308[_0x35bbbb]){delete _0x4d3b71[_0x35bbbb];}}}}function freeIsNotKeySip(_0x3aee4d,_0x206df0){var _0x3e231f=_[_0x5410('0x23')](_0x3aee4d,function(_0x5d7466,_0x5dc0a2){return util[_0x5410('0x24')]('SIP/%s',_0x5d7466[_0x5410('0x25')]);});for(var _0x384f8c in _0x206df0){if(_0x206df0['hasOwnProperty'](_0x384f8c)){if(!_0x3e231f[_0x384f8c]){delete _0x206df0[_0x384f8c];}}}}function freeIsNotKeyAgent(_0x3b6223,_0x86126d){var _0xac7dcd=_['mapKeys'](_0x3b6223,function(_0x17027a,_0x530e19){var _0x360b48=_[_0x5410('0x26')](_0x17027a[_0x5410('0x27')])?util[_0x5410('0x24')]('SIP/%s',_0x17027a[_0x5410('0x25')]):_0x17027a['interface'];return _0x360b48;});for(var _0x2d2390 in _0x86126d){if(_0x86126d[_0x5410('0x28')](_0x2d2390)){if(!_0xac7dcd[_0x2d2390]){delete _0x86126d[_0x2d2390];}}}}function clearVoiceCallReports(_0x2e7ee1){_0x2e7ee1[_0x5410('0x29')]=0x0;_0x2e7ee1[_0x5410('0x2a')]=0x0;_0x2e7ee1['sumHoldTime']=0x0;_0x2e7ee1[_0x5410('0x2b')]=0x0;_0x2e7ee1[_0x5410('0x2c')]=0x0;}function clearCampaigns(_0x33dd03){if(!_[_0x5410('0x2d')](_0x33dd03)){for(var _0x584e49 in _0x33dd03){if(_0x33dd03[_0x5410('0x28')](_0x584e49)){_0x33dd03[_0x584e49][_0x5410('0x2e')]=0x0;_0x33dd03[_0x584e49][_0x5410('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x1bc8c8){if(!_[_0x5410('0x2d')](_0x1bc8c8)){for(var _0x19189d in _0x1bc8c8){if(_0x1bc8c8[_0x5410('0x28')](_0x19189d)){_0x1bc8c8[_0x19189d][_0x5410('0x29')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x2a')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x30')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x31')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x32')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x2b')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x2c')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x33')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x34')]=0x0;_0x1bc8c8[_0x19189d]['outboundBusyCallsDay']=0x0;_0x1bc8c8[_0x19189d]['outboundCongestionCallsDay']=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x35')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x36')]=0x0;_0x1bc8c8[_0x19189d]['outboundDropCallsDayTimeout']=0x0;_0x1bc8c8[_0x19189d]['outboundDropCallsDayCallersExit']=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x37')]=0x0;_0x1bc8c8[_0x19189d]['outboundOriginateFailureCallsDay']=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x38')]=0x0;_0x1bc8c8[_0x19189d]['outboundReCallsDay']=0x0;_0x1bc8c8[_0x19189d]['outboundAnswerAgiCallsDay']=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x39')]=0x0;_0x1bc8c8[_0x19189d][_0x5410('0x3a')]=!![];}}}}Realtime[_0x5410('0x3b')][_0x5410('0x3c')]=function(_0x402780,_0x2512b2){for(var _0x5b6dda in _0x2512b2){if(_0x402780[_0x5410('0x28')](_0x5b6dda)){_0x402780[_0x5b6dda]=_0x2512b2[_0x5b6dda];}}};Realtime[_0x5410('0x3b')][_0x5410('0x3d')]=function(){var _0x4686df=this;return function(_0x568fe5){if(_0x568fe5){freeIsNotKeyAgent(_0x568fe5,_0x4686df[_0x5410('0xf')]);for(var _0x2db6c7=0x0,_0x4f3307={},_0x2d2ba8={};_0x2db6c7<_0x568fe5[_0x5410('0x3e')];_0x2db6c7+=0x1){_0x4f3307=_0x568fe5[_0x2db6c7];var _0x4c7e45=_[_0x5410('0x26')](_0x4f3307['interface'])?util['format'](_0x5410('0x3f'),_0x4f3307[_0x5410('0x25')]):_0x4f3307[_0x5410('0x27')];if(_[_0x5410('0x40')](_0x4686df[_0x5410('0xf')][_0x4c7e45])){_0x4686df[_0x5410('0xf')][_0x4c7e45]=new Agent(_0x4f3307);}else{_0x4686df[_0x5410('0x3c')](_0x4686df[_0x5410('0xf')][_0x4c7e45],_0x4f3307);}}}return _0x4686df['agents'];};};Realtime[_0x5410('0x3b')][_0x5410('0x41')]=function(){var _0x284abb=this;return function(_0x55447c){if(_0x55447c){freeIsNotKeySip(_0x55447c,_0x284abb['telephones']);for(var _0x5aa8f8=0x0,_0x8c02f9={},_0x43669c={};_0x5aa8f8<_0x55447c[_0x5410('0x3e')];_0x5aa8f8+=0x1){_0x8c02f9=_0x55447c[_0x5aa8f8];if(_['isUndefined'](_0x284abb[_0x5410('0x10')][util[_0x5410('0x24')](_0x5410('0x3f'),_0x8c02f9[_0x5410('0x25')])])){_0x284abb[_0x5410('0x10')][util[_0x5410('0x24')](_0x5410('0x3f'),_0x8c02f9[_0x5410('0x25')])]=new Telephone(_0x8c02f9);}else{_0x284abb[_0x5410('0x3c')](_0x284abb[_0x5410('0x10')][util[_0x5410('0x24')](_0x5410('0x3f'),_0x8c02f9['name'])],_0x8c02f9);}}}return _0x284abb[_0x5410('0x10')];};};Realtime['prototype'][_0x5410('0x42')]=function(){var _0x2f3f85=this;return function(_0x37e400){if(_0x37e400){freeIsNotKeySip(_0x37e400,_0x2f3f85[_0x5410('0x43')]);for(var _0x5d5c77=0x0,_0x1fe508={},_0x372ac5={};_0x5d5c77<_0x37e400[_0x5410('0x3e')];_0x5d5c77+=0x1){_0x1fe508=_0x37e400[_0x5d5c77];if(_[_0x5410('0x40')](_0x2f3f85[_0x5410('0x43')][util['format'](_0x5410('0x3f'),_0x1fe508[_0x5410('0x25')])])){_0x2f3f85['trunks'][util['format'](_0x5410('0x3f'),_0x1fe508[_0x5410('0x25')])]=new Trunk(_0x1fe508);}else{_0x2f3f85[_0x5410('0x3c')](_0x2f3f85['trunks'][util[_0x5410('0x24')](_0x5410('0x3f'),_0x1fe508[_0x5410('0x25')])],_0x1fe508);}}}return _0x2f3f85[_0x5410('0x43')];};};Realtime[_0x5410('0x3b')][_0x5410('0x44')]=function(){var _0x51accb=this;return function(_0x5ec37d){if(_0x5ec37d){freeIsNotKey(_0x5ec37d,_0x51accb[_0x5410('0x11')],_0x5410('0x25'));for(var _0x4637f6=0x0,_0x21e3d8={},_0x4be6d3={};_0x4637f6<_0x5ec37d[_0x5410('0x3e')];_0x4637f6+=0x1){_0x21e3d8=_0x5ec37d[_0x4637f6];if(_[_0x5410('0x40')](_0x51accb[_0x5410('0x11')][_0x21e3d8['name']])){_0x51accb[_0x5410('0x11')][_0x21e3d8[_0x5410('0x25')]]=new VoiceQueue(_0x21e3d8);}else{_0x51accb['mergeFromDatabase'](_0x51accb[_0x5410('0x11')][_0x21e3d8['name']],_0x21e3d8);}}}return _0x51accb[_0x5410('0x11')];};};Realtime['prototype'][_0x5410('0x45')]=function(){var _0x3fe5b2=this;return function(_0xa30d94){if(_0xa30d94){freeIsNotKey(_0xa30d94,_0x3fe5b2[_0x5410('0x12')],'id');for(var _0x4e7afc=0x0,_0x383e26={},_0x3f7f1c={};_0x4e7afc<_0xa30d94[_0x5410('0x3e')];_0x4e7afc+=0x1){_0x383e26=_0xa30d94[_0x4e7afc];if(_['isUndefined'](_0x3fe5b2['triggers'][_0x383e26['id']])){_0x3fe5b2[_0x5410('0x12')][_0x383e26['id']]=new Trigger(_0x383e26);}else{_0x3fe5b2[_0x5410('0x3c')](_0x3fe5b2[_0x5410('0x12')][_0x383e26['id']],_0x383e26);}}}return _0x3fe5b2['triggers'];};};Realtime[_0x5410('0x3b')][_0x5410('0x46')]=function(){var _0x213099=this;return function(_0x349521){if(_0x349521){freeIsNotKey(_0x349521,_0x213099[_0x5410('0x14')],'id');for(var _0x35a503=0x0,_0x1d2557={},_0x55e3c6={};_0x35a503<_0x349521[_0x5410('0x3e')];_0x35a503+=0x1){_0x1d2557=_0x349521[_0x35a503];if(_['isUndefined'](_0x213099[_0x5410('0x14')][_0x1d2557['id']])){_0x213099[_0x5410('0x14')][_0x1d2557['id']]=new Template(_0x1d2557);}else{_0x213099[_0x5410('0x3c')](_0x213099[_0x5410('0x14')][_0x1d2557['id']],_0x1d2557);}}}return _0x213099[_0x5410('0x14')];};};Realtime[_0x5410('0x3b')][_0x5410('0x47')]=function(){var _0x294627=this;return function(_0x171ec1){if(_0x171ec1){freeIsNotKey(_0x171ec1,_0x294627[_0x5410('0x1b')],'id');for(var _0x41fc58=0x0,_0x556f71={},_0x5a4227={};_0x41fc58<_0x171ec1['length'];_0x41fc58+=0x1){_0x556f71=_0x171ec1[_0x41fc58];if(_[_0x5410('0x40')](_0x294627[_0x5410('0x1b')][_0x556f71['id']])){_0x294627[_0x5410('0x1b')][_0x556f71['id']]=new ZendeskAccount(_0x556f71);}else{_0x294627['mergeFromDatabase'](_0x294627['zendeskAccounts'][_0x556f71['id']],_0x556f71);}}}return _0x294627[_0x5410('0x1b')];};};Realtime[_0x5410('0x3b')][_0x5410('0x48')]=function(){var _0x397b7e=this;return function(_0x15d40d){if(_0x15d40d){freeIsNotKey(_0x15d40d,_0x397b7e[_0x5410('0x49')],'id');for(var _0x55aea9=0x0,_0x5eb057={},_0x2372cb={};_0x55aea9<_0x15d40d[_0x5410('0x3e')];_0x55aea9+=0x1){_0x5eb057=_0x15d40d[_0x55aea9];if(_[_0x5410('0x40')](_0x397b7e[_0x5410('0x49')][_0x5eb057['id']])){_0x397b7e[_0x5410('0x49')][_0x5eb057['id']]=new SalesforceAccount(_0x5eb057);}else{_0x397b7e[_0x5410('0x3c')](_0x397b7e[_0x5410('0x49')][_0x5eb057['id']],_0x5eb057);}}}return _0x397b7e[_0x5410('0x49')];};};Realtime['prototype'][_0x5410('0x4a')]=function(){var _0x1d4aaf=this;return function(_0x5c31cf){if(_0x5c31cf){freeIsNotKey(_0x5c31cf,_0x1d4aaf['freshdeskAccounts'],'id');for(var _0x31c68a=0x0,_0x3bb5c8={},_0x140bf8={};_0x31c68a<_0x5c31cf[_0x5410('0x3e')];_0x31c68a+=0x1){_0x3bb5c8=_0x5c31cf[_0x31c68a];if(_[_0x5410('0x40')](_0x1d4aaf[_0x5410('0x1d')][_0x3bb5c8['id']])){_0x1d4aaf[_0x5410('0x1d')][_0x3bb5c8['id']]=new FreshdeskAccount(_0x3bb5c8);}else{_0x1d4aaf[_0x5410('0x3c')](_0x1d4aaf[_0x5410('0x1d')][_0x3bb5c8['id']],_0x3bb5c8);}}}return _0x1d4aaf[_0x5410('0x1d')];};};Realtime[_0x5410('0x3b')][_0x5410('0x4b')]=function(){var _0x53cd68=this;return function(_0x1144d3){if(_0x1144d3){freeIsNotKey(_0x1144d3,_0x53cd68[_0x5410('0x1e')],'id');for(var _0x5cca39=0x0,_0x3a93c7={},_0x43fb73={};_0x5cca39<_0x1144d3[_0x5410('0x3e')];_0x5cca39+=0x1){_0x3a93c7=_0x1144d3[_0x5cca39];if(_[_0x5410('0x40')](_0x53cd68[_0x5410('0x1e')][_0x3a93c7['id']])){_0x53cd68[_0x5410('0x1e')][_0x3a93c7['id']]=new ZohoAccount(_0x3a93c7);}else{_0x53cd68['mergeFromDatabase'](_0x53cd68['zohoAccounts'][_0x3a93c7['id']],_0x3a93c7);}}}return _0x53cd68[_0x5410('0x1e')];};};Realtime[_0x5410('0x3b')][_0x5410('0x4c')]=function(){var _0x184940=this;return function(_0x34a72f){if(_0x34a72f){freeIsNotKey(_0x34a72f,_0x184940[_0x5410('0x1f')],'id');for(var _0x9bf381=0x0,_0x3fa14e={},_0xa17dde={};_0x9bf381<_0x34a72f['length'];_0x9bf381+=0x1){_0x3fa14e=_0x34a72f[_0x9bf381];if(_[_0x5410('0x40')](_0x184940['deskAccounts'][_0x3fa14e['id']])){_0x184940['deskAccounts'][_0x3fa14e['id']]=new DeskAccount(_0x3fa14e);}else{_0x184940[_0x5410('0x3c')](_0x184940['deskAccounts'][_0x3fa14e['id']],_0x3fa14e);}}}return _0x184940[_0x5410('0x1f')];};};Realtime[_0x5410('0x3b')][_0x5410('0x4d')]=function(){var _0x4a2bbe=this;return function(_0xad66e0){if(_0xad66e0){freeIsNotKey(_0xad66e0,_0x4a2bbe[_0x5410('0x1c')],'id');for(var _0x1e5b32=0x0,_0x2133c9={},_0x4bfa18={};_0x1e5b32<_0xad66e0[_0x5410('0x3e')];_0x1e5b32+=0x1){_0x2133c9=_0xad66e0[_0x1e5b32];if(_[_0x5410('0x40')](_0x4a2bbe['sugarcrmAccounts'][_0x2133c9['id']])){_0x4a2bbe['sugarcrmAccounts'][_0x2133c9['id']]=new SugarcrmAccount(_0x2133c9);}else{_0x4a2bbe[_0x5410('0x3c')](_0x4a2bbe['sugarcrmAccounts'][_0x2133c9['id']],_0x2133c9);}}}return _0x4a2bbe[_0x5410('0x1c')];};};Realtime[_0x5410('0x3b')][_0x5410('0x4e')]=function(){var _0x2112a0=this;return function(_0xb8f6ad){if(_0xb8f6ad){freeIsNotKey(_0xb8f6ad,_0x2112a0['vtigerAccounts'],'id');for(var _0x3c611b=0x0,_0x5b003e={},_0x6b66a9={};_0x3c611b<_0xb8f6ad[_0x5410('0x3e')];_0x3c611b+=0x1){_0x5b003e=_0xb8f6ad[_0x3c611b];if(_[_0x5410('0x40')](_0x2112a0['vtigerAccounts'][_0x5b003e['id']])){_0x2112a0['vtigerAccounts'][_0x5b003e['id']]=new VtigerAccount(_0x5b003e);}else{_0x2112a0[_0x5410('0x3c')](_0x2112a0[_0x5410('0x20')][_0x5b003e['id']],_0x5b003e);}}}return _0x2112a0[_0x5410('0x20')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x388df4=this;return function(_0x360c9e){if(_0x360c9e){freeIsNotKey(_0x360c9e,_0x388df4[_0x5410('0x21')],'id');for(var _0x18ac5a=0x0,_0x4b5009={},_0x1994bb={};_0x18ac5a<_0x360c9e[_0x5410('0x3e')];_0x18ac5a+=0x1){_0x4b5009=_0x360c9e[_0x18ac5a];if(_['isUndefined'](_0x388df4['servicenowAccounts'][_0x4b5009['id']])){_0x388df4['servicenowAccounts'][_0x4b5009['id']]=new ServicenowAccount(_0x4b5009);}else{_0x388df4[_0x5410('0x3c')](_0x388df4['servicenowAccounts'][_0x4b5009['id']],_0x4b5009);}}}return _0x388df4[_0x5410('0x21')];};};Realtime['prototype'][_0x5410('0x4f')]=function(){var _0x2653f1=this;return function(_0x1538ec){if(_0x1538ec){freeIsNotKey(_0x1538ec,_0x2653f1[_0x5410('0x50')],'id');for(var _0x17e62d=0x0,_0x325866={},_0xeecedb={};_0x17e62d<_0x1538ec['length'];_0x17e62d+=0x1){_0x325866=_0x1538ec[_0x17e62d];if(_[_0x5410('0x40')](_0x2653f1[_0x5410('0x50')][_0x325866['id']])){_0x2653f1[_0x5410('0x50')][_0x325866['id']]=new Dynamics365Account(_0x325866);}else{_0x2653f1['mergeFromDatabase'](_0x2653f1[_0x5410('0x50')][_0x325866['id']],_0x325866);}}}return _0x2653f1[_0x5410('0x50')];};};Realtime[_0x5410('0x3b')][_0x5410('0x51')]=function(){var _0x9d5c2c=this;return function(_0x3eef28){if(_0x3eef28){freeIsNotKey(_0x3eef28,_0x9d5c2c[_0x5410('0x52')],'id');for(var _0x3e9ade=0x0,_0x440f0b={},_0x2b9a45={};_0x3e9ade<_0x3eef28[_0x5410('0x3e')];_0x3e9ade+=0x1){_0x440f0b=_0x3eef28[_0x3e9ade];if(_[_0x5410('0x40')](_0x9d5c2c[_0x5410('0x52')][_0x440f0b['id']])){_0x9d5c2c[_0x5410('0x52')][_0x440f0b['id']]=new FreshsalesAccount(_0x440f0b);}else{_0x9d5c2c[_0x5410('0x3c')](_0x9d5c2c[_0x5410('0x52')][_0x440f0b['id']],_0x440f0b);}}}return _0x9d5c2c[_0x5410('0x52')];};};Realtime[_0x5410('0x3b')][_0x5410('0x53')]=function(){var _0x16e412=this;return function(_0x44246d){for(var _0x5b5e94=0x0;_0x5b5e94<_0x44246d[_0x5410('0x3e')];_0x5b5e94+=0x1){_[_0x5410('0x54')](_0x16e412[_0x5410('0x11')][_0x44246d[_0x5b5e94]['name']],_0x44246d[_0x5b5e94]);}return _0x16e412['voiceQueues'];};};Realtime[_0x5410('0x3b')][_0x5410('0x55')]=function(){var _0x23e5b7=this;return function(_0x1fed0c){clearVoiceQueues(_0x23e5b7[_0x5410('0x11')]);if(_0x1fed0c){_0x1fed0c=_[_0x5410('0x56')](_0x1fed0c,_0x5410('0x57'));for(var _0x614177 in _0x1fed0c){if(_0x1fed0c[_0x5410('0x28')](_0x614177)){var _0x12f4e4={};for(var _0x3db47b=0x0;_0x3db47b<_0x1fed0c[_0x614177][_0x5410('0x3e')];_0x3db47b+=0x1){var _0x4d0481=_0x1fed0c[_0x614177][_0x3db47b]['queue'];if(_0x23e5b7[_0x5410('0x11')][_0x4d0481]){if(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x58')]){_0x23e5b7[_0x5410('0x11')][_0x4d0481]['unmanaged']+=0x1;}if(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x59')]){_0x23e5b7[_0x5410('0x11')][_0x4d0481][_0x5410('0x31')]+=0x1;}_0x23e5b7[_0x5410('0x11')][_0x4d0481][_0x5410('0x32')]+=moment(_0x1fed0c[_0x614177][_0x3db47b]['queuecallerleaveAt'])[_0x5410('0x5a')](moment(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x5b')]),_0x5410('0x5c'))||0x0;if(_0x3db47b===_0x1fed0c[_0x614177]['length']-0x1){_0x23e5b7[_0x5410('0x11')][_0x4d0481][_0x5410('0x2b')]+=moment(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x5d')]||_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x5e')]||_0x1fed0c[_0x614177][_0x3db47b]['queuecallerexitAt'])[_0x5410('0x5a')](moment(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x5b')]),'seconds')||0x0;_0x23e5b7['voiceQueues'][_0x4d0481]['total']+=0x1;if(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x5f')]){_0x23e5b7[_0x5410('0x11')][_0x4d0481][_0x5410('0x2a')]+=0x1;_0x23e5b7['voiceQueues'][_0x4d0481][_0x5410('0x2c')]+=moment(_0x1fed0c[_0x614177][_0x3db47b]['queuecallercompleteAt'])['diff'](moment(_0x1fed0c[_0x614177][_0x3db47b][_0x5410('0x60')]),_0x5410('0x5c'))||0x0;}}else{_0x23e5b7[_0x5410('0x11')][_0x4d0481]['sumDuration']+=_0x23e5b7[_0x5410('0x11')][_0x4d0481][_0x5410('0x32')]||0x0;}}}}}}return _0x23e5b7[_0x5410('0x11')];};};Realtime[_0x5410('0x3b')][_0x5410('0x61')]=function(){var _0x5a9363=this;return function(_0x1e65fc){clearVoiceCallReports(_0x5a9363[_0x5410('0x15')]);if(_0x1e65fc){for(var _0x133d87=0x0;_0x133d87<_0x1e65fc[_0x5410('0x3e')];_0x133d87+=0x1){_0x5a9363[_0x5410('0x15')][_0x5410('0x29')]+=0x1;_0x5a9363[_0x5410('0x15')][_0x5410('0x2b')]+=_0x1e65fc[_0x133d87]['duration'];if(_0x1e65fc[_0x133d87][_0x5410('0x62')]===_0x5410('0x63')){_0x5a9363['outbound'][_0x5410('0x2a')]+=0x1;_0x5a9363[_0x5410('0x15')][_0x5410('0x32')]+=_0x1e65fc[_0x133d87][_0x5410('0x64')]-_0x1e65fc[_0x133d87][_0x5410('0x65')]||0x0;_0x5a9363[_0x5410('0x15')][_0x5410('0x2c')]+=_0x1e65fc[_0x133d87][_0x5410('0x65')];}}}return _0x5a9363[_0x5410('0x15')];};};Realtime[_0x5410('0x3b')][_0x5410('0x66')]=function(){var _0x428994=this;return function(_0x37914d){if(_0x37914d){freeIsNotKey(_0x37914d,_0x428994[_0x5410('0x13')],_0x5410('0x25'));for(var _0x670f7e=0x0,_0x42459b={};_0x670f7e<_0x37914d[_0x5410('0x3e')];_0x670f7e+=0x1){_0x42459b=_0x37914d[_0x670f7e];if(_[_0x5410('0x40')](_0x428994['campaigns'][_0x42459b[_0x5410('0x25')]])){_0x428994[_0x5410('0x13')][_0x42459b[_0x5410('0x25')]]=new Campaign(_0x42459b);}else{_0x428994[_0x5410('0x3c')](_0x428994[_0x5410('0x13')][_0x42459b[_0x5410('0x25')]],_0x42459b);_0x428994[_0x5410('0x13')][_0x42459b[_0x5410('0x25')]][_0x5410('0x67')]=_0x42459b[_0x5410('0x68')]?_0x42459b[_0x5410('0x68')][_0x5410('0x25')]:undefined;}}}return _0x428994[_0x5410('0x13')];};};Realtime[_0x5410('0x3b')][_0x5410('0x69')]=function(){var _0x3beaca=this;return function(_0x135848){if(_0x135848){freeIsNotKey(_0x135848,_0x3beaca['voiceExtensions'],'id');for(var _0xc0a374=0x0,_0x417ffa={};_0xc0a374<_0x135848['length'];_0xc0a374+=0x1){_0x417ffa=_0x135848[_0xc0a374];if(_['isUndefined'](_0x3beaca[_0x5410('0x16')][_0x417ffa['id']])){_0x3beaca[_0x5410('0x16')][_0x417ffa['id']]=new VoiceExtension(_0x417ffa);}else{_0x3beaca[_0x5410('0x3c')](_0x3beaca[_0x5410('0x16')][_0x417ffa['id']],_0x417ffa);}}}return _0x3beaca['voiceExtensions'];};};Realtime[_0x5410('0x3b')][_0x5410('0x6a')]=function(){var _0x519711=this;return function(_0x55dce4){clearCampaigns(_0x519711[_0x5410('0x13')]);for(var _0x56f578=0x0;_0x56f578<_0x55dce4['length'];_0x56f578+=0x1){_[_0x5410('0x54')](_0x519711[_0x5410('0x13')][_0x55dce4[_0x56f578]['name']],_0x55dce4[_0x56f578]);}return _0x519711[_0x5410('0x13')];};};Realtime['prototype'][_0x5410('0x6b')]=function(){var _0x247068=this;return function(_0x250048){if(_0x250048){freeIsNotKey(_0x250048,_0x247068['faxAccounts'],'id');for(var _0x3656a3=0x0,_0x33f458={},_0x2fd77a={};_0x3656a3<_0x250048['length'];_0x3656a3+=0x1){_0x33f458=_0x250048[_0x3656a3];if(_[_0x5410('0x40')](_0x247068[_0x5410('0x22')][_0x33f458['id']])){_0x247068[_0x5410('0x22')][_0x33f458['id']]=new FaxAccount(_0x33f458);}else{_0x247068[_0x5410('0x3c')](_0x247068['faxAccounts'][_0x33f458['id']],_0x33f458);}}}return _0x247068[_0x5410('0x22')];};};module[_0x5410('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f540ec7..06261c3 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 _0xc011=['xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','assigned','lastAssignedTo','format','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','dialer','lastapplication','lastdata','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','linkedid','transfers','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','isArray','forEach','startsWith','Local','substring','phone','transfererlinkedid','exports','lodash','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0xc011,0x9c));var _0x1c01=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc011[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x1c01('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x1c01('0x1'));var ami=require(_0x1c01('0x2'));var RpcVoiceAgentReport=require(_0x1c01('0x3'));var RpcVoiceCallReport=require(_0x1c01('0x4'));var RpcVoiceDialReport=require(_0x1c01('0x5'));var RpcMemberReport=require(_0x1c01('0x6'));var RpcVoiceQueueReport=require(_0x1c01('0x7'));var RpcVoiceRecording=require(_0x1c01('0x8'));var RpcVoiceTransferReport=require(_0x1c01('0x9'));var VoiceQueueReport=require(_0x1c01('0xa'));var VoiceCallReport=require(_0x1c01('0xb'));var VoiceAgentReport=require(_0x1c01('0xc'));var VoiceDialReport=require(_0x1c01('0xd'));var UserReport=require(_0x1c01('0xe'));function Report(_0x57967e){this[_0x1c01('0xf')]=_0x57967e;this['agents']=_0x57967e[_0x1c01('0x10')];this[_0x1c01('0x11')]=_0x57967e[_0x1c01('0x11')];}Report[_0x1c01('0x12')][_0x1c01('0x13')]=function(_0x1d5822){var _0x286fe9=new VoiceQueueReport(this['realtime']);var _0x54f91e=new VoiceAgentReport(this[_0x1c01('0xf')]);var _0x4db5c8=new VoiceDialReport(this[_0x1c01('0xf')]);var _0x5f27cc=new VoiceCallReport(this['realtime']);var _0x3336dd=new UserReport(this[_0x1c01('0xf')]);if(config['xdr']&&config[_0x1c01('0x14')][_0x1c01('0x15')]){ami['on'](_0x1c01('0x16'),this[_0x1c01('0x17')]['bind'](this));ami['on'](_0x1c01('0x18'),this[_0x1c01('0x19')]['bind'](this));ami['on'](_0x1c01('0x1a'),this[_0x1c01('0x1b')]['bind'](this));ami['on'](_0x1c01('0x1c'),this[_0x1c01('0x1d')]['bind'](this));ami['on']('blindtransfer',this[_0x1c01('0x1e')]['bind'](this));ami['on'](_0x1c01('0x1f'),this[_0x1c01('0x20')]['bind'](this));}};Report['prototype'][_0x1c01('0x21')]=function(_0x3d10fb){var _0x29e5ff;_0x29e5ff=_[_0x1c01('0x22')](this[_0x1c01('0x10')],function(_0x1862e9){return _0x1862e9[_0x1c01('0x23')]==_0x3d10fb||_0x1862e9[_0x1c01('0x24')]==_0x3d10fb;});if(_[_0x1c01('0x25')](_0x29e5ff)){var _0x272d5c=_['find'](this[_0x1c01('0x11')],function(_0x3cb481){return _0x3cb481[_0x1c01('0x23')]==_0x3d10fb||_0x3cb481[_0x1c01('0x24')]==_0x3d10fb;});if(_0x272d5c){_0x29e5ff=_['find'](this[_0x1c01('0x10')],function(_0x2d3936){return _0x2d3936[_0x1c01('0x26')]==util['format'](_0x1c01('0x27'),_0x272d5c[_0x1c01('0x24')]);});}}return _0x29e5ff;};Report[_0x1c01('0x12')]['voiceQueueReport']=function(_0x59c8ec){for(var _0x54d31b=0x0;_0x54d31b<_0x59c8ec[_0x1c01('0x28')];_0x54d31b+=0x1){var _0x15e1e2=this['findAgent'](_0x59c8ec[_0x54d31b]['connectedlinenum']);if(_0x15e1e2){_0x59c8ec[_0x54d31b][_0x1c01('0x23')]=_0x15e1e2['accountcode'];_0x59c8ec[_0x54d31b][_0x1c01('0x29')]=!![];_0x59c8ec[_0x54d31b][_0x1c01('0x2a')]=_0x15e1e2[_0x1c01('0x24')];_0x59c8ec[_0x54d31b][_0x1c01('0x26')]=_[_0x1c01('0x25')](_0x15e1e2['interface'])?util[_0x1c01('0x2b')](_0x1c01('0x27'),_0x15e1e2[_0x1c01('0x24')]):_0x15e1e2[_0x1c01('0x26')];if(_0x59c8ec[_0x54d31b][_0x1c01('0x2c')]){_0x59c8ec[_0x54d31b]['queuecallercompleteAt']=moment()[_0x1c01('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x59c8ec[_0x54d31b][_0x1c01('0x2d')]){_0x59c8ec[_0x54d31b][_0x1c01('0x2e')]=moment()[_0x1c01('0x2b')](_0x1c01('0x2f'));}RpcMemberReport[_0x1c01('0x17')](_0x59c8ec[_0x54d31b]);}RpcVoiceQueueReport[_0x1c01('0x30')](_0x59c8ec[_0x54d31b]);}};function extractCalleridNumber(_0x2ed579){var _0x4e4b39=_0x2ed579[_0x1c01('0x31')](/<(.*?)>/);return _0x4e4b39?_0x4e4b39[0x1]:_0x2ed579;}Report[_0x1c01('0x12')][_0x1c01('0x19')]=function(_0x50d716){_0x50d716['destination']=_0x50d716[_0x1c01('0x32')]||_0x50d716[_0x1c01('0x33')];if(_0x50d716[_0x1c01('0x34')]==_0x1c01('0x35')){_0x50d716[_0x1c01('0x36')]='queue';_0x50d716[_0x1c01('0x37')]=_0x50d716[_0x1c01('0x38')];if(_0x50d716[_0x1c01('0x39')]=='from-voip-provider'){_0x50d716[_0x1c01('0x23')]='';_0x50d716[_0x1c01('0x32')]=extractCalleridNumber(_0x50d716[_0x1c01('0x3a')]);}else if(_0x50d716[_0x1c01('0x39')]==_0x1c01('0x3b')){if(_0x50d716[_0x1c01('0x32')]==_0x1c01('0x3c')){_0x50d716[_0x1c01('0x32')]=extractCalleridNumber(_0x50d716[_0x1c01('0x3d')]);_0x50d716[_0x1c01('0x3e')]=_0x50d716[_0x1c01('0x3f')];_0x50d716['destinationchannel']=[_0x50d716[_0x1c01('0x40')],_0x50d716[_0x1c01('0x40')]=_0x50d716['destinationchannel']][0x0];_0x50d716['callerid']=_0x50d716[_0x1c01('0x3d')];}else{_0x50d716[_0x1c01('0x32')]=_0x50d716[_0x1c01('0x3e')];_0x50d716[_0x1c01('0x3e')]=_0x50d716[_0x1c01('0x3f')];if(_0x50d716[_0x1c01('0x41')]==_0x1c01('0x42')){_0x50d716[_0x1c01('0x23')]=_0x50d716[_0x1c01('0x43')];}else{_0x50d716['accountcode']='';}}}}else{_0x50d716[_0x1c01('0x3a')]=util[_0x1c01('0x2b')](_0x1c01('0x44'),_0x50d716['calleridname'],_0x50d716[_0x1c01('0x3e')]);}if(RpcVoiceTransferReport['transfers'][_0x50d716[_0x1c01('0x45')]]){var _0x5d1779=RpcVoiceTransferReport[_0x1c01('0x46')][_0x50d716[_0x1c01('0x45')]];_0x5d1779['transfereelinkedid']=_0x50d716[_0x1c01('0x47')];RpcVoiceTransferReport[_0x1c01('0x1e')](_0x5d1779);delete RpcVoiceTransferReport[_0x1c01('0x46')][_0x50d716['linkedid']];}RpcVoiceCallReport[_0x1c01('0x30')](_0x50d716);if(_0x50d716[_0x1c01('0x48')]){for(var _0x4585c7=0x0;_0x4585c7<_0x50d716[_0x1c01('0x49')][_0x1c01('0x28')];_0x4585c7+=0x1){_0x50d716[_0x1c01('0x4a')]=_0x50d716[_0x1c01('0x49')][_0x4585c7][_0x1c01('0x4b')];_0x50d716[_0x1c01('0x4c')]=_0x50d716[_0x1c01('0x49')][_0x4585c7]['createdAt'];if(_0x50d716[_0x1c01('0x33')]==_0x1c01('0x3c')){_0x50d716[_0x1c01('0x3e')]=_0x50d716[_0x1c01('0x43')];_0x50d716[_0x1c01('0x4d')]=_0x50d716[_0x1c01('0x4e')];_0x50d716[_0x1c01('0x43')]=_0x50d716[_0x1c01('0x23')];_0x50d716[_0x1c01('0x4e')]=_0x50d716[_0x1c01('0x4f')];_0x50d716[_0x1c01('0x33')]=_0x50d716[_0x1c01('0x3f')];}else if(_0x50d716[_0x1c01('0x33')]=='xcally-motion-dialer'){_0x50d716[_0x1c01('0x3e')]=_0x50d716[_0x1c01('0x32')];_0x50d716[_0x1c01('0x33')]=_0x50d716['originatecalleridnum'];}RpcVoiceRecording[_0x1c01('0x30')](_0x50d716);}}};Report['prototype'][_0x1c01('0x1b')]=function(_0x2e0f1d){if(_[_0x1c01('0x50')](_0x2e0f1d)){_0x2e0f1d[_0x1c01('0x51')](function(_0x57981c){RpcVoiceAgentReport['create'](_0x57981c);});}else{RpcVoiceAgentReport[_0x1c01('0x30')](_0x2e0f1d);}};Report[_0x1c01('0x12')][_0x1c01('0x1d')]=function(_0x5e047d){RpcVoiceDialReport[_0x1c01('0x30')](_0x5e047d);var _0x5e8cec;var _0x1d27df;var _0x4bb868=_0x5e047d[_0x1c01('0x40')];if(_[_0x1c01('0x52')](_0x4bb868,_0x1c01('0x53'))){_0x1d27df=_0x4bb868[_0x1c01('0x54')](_0x4bb868['indexOf']('/')+0x1,_0x4bb868['indexOf']('@'));_0x5e8cec=_[_0x1c01('0x22')](this['agents'],function(_0xe11e1f){return _0xe11e1f['mobile']==_0x1d27df||_0xe11e1f[_0x1c01('0x55')]==_0x1d27df||_0xe11e1f[_0x1c01('0x23')]==_0x1d27df;});}else{_0x1d27df=_0x4bb868['substring'](_0x4bb868['indexOf']('/')+0x1,_0x4bb868['lastIndexOf']('-'));_0x5e8cec=this[_0x1c01('0x21')](_0x1d27df);}if(_0x5e8cec){_0x5e047d[_0x1c01('0x26')]=_[_0x1c01('0x25')](_0x5e8cec[_0x1c01('0x26')])?util[_0x1c01('0x2b')](_0x1c01('0x27'),_0x5e8cec[_0x1c01('0x24')]):_0x5e8cec[_0x1c01('0x26')];_0x5e047d[_0x1c01('0x4f')]=_0x5e8cec[_0x1c01('0x24')];_0x5e047d[_0x1c01('0x23')]=_0x5e8cec[_0x1c01('0x23')];RpcMemberReport[_0x1c01('0x1d')](_0x5e047d);}};Report['prototype'][_0x1c01('0x1e')]=function(_0x5b39ca){RpcVoiceTransferReport[_0x1c01('0x46')][_0x5b39ca[_0x1c01('0x56')]]=_0x5b39ca;};Report['prototype'][_0x1c01('0x20')]=function(_0x2a4376){RpcVoiceTransferReport[_0x1c01('0x20')](_0x2a4376);};module[_0x1c01('0x57')]=Report; \ No newline at end of file +var _0x1f6f=['bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','SIP/%s','length','assigned','lastAssignedTo','isNil','queuecallercomplete','format','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','type','dialer','queue','lastdata','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','filename','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport'];(function(_0x25ec2b,_0x1a0b12){var _0x2eea15=function(_0xb3e456){while(--_0xb3e456){_0x25ec2b['push'](_0x25ec2b['shift']());}};_0x2eea15(++_0x1a0b12);}(_0x1f6f,0x18f));var _0xf1f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1f6f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf1f6('0x0'));var moment=require(_0xf1f6('0x1'));var util=require(_0xf1f6('0x2'));var config=require(_0xf1f6('0x3'));var ami=require(_0xf1f6('0x4'));var RpcVoiceAgentReport=require(_0xf1f6('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xf1f6('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xf1f6('0x7'));var RpcVoiceTransferReport=require(_0xf1f6('0x8'));var VoiceQueueReport=require(_0xf1f6('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xf1f6('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xf1f6('0xb'));function Report(_0x2eae3d){this['realtime']=_0x2eae3d;this[_0xf1f6('0xc')]=_0x2eae3d['agents'];this[_0xf1f6('0xd')]=_0x2eae3d['telephones'];}Report[_0xf1f6('0xe')][_0xf1f6('0xf')]=function(_0x32a8df){var _0x471986=new VoiceQueueReport(this[_0xf1f6('0x10')]);var _0x7d6eea=new VoiceAgentReport(this[_0xf1f6('0x10')]);var _0x584bc0=new VoiceDialReport(this[_0xf1f6('0x10')]);var _0x4f7609=new VoiceCallReport(this['realtime']);var _0x31687a=new UserReport(this[_0xf1f6('0x10')]);if(config[_0xf1f6('0x11')]&&config[_0xf1f6('0x11')][_0xf1f6('0x12')]){ami['on'](_0xf1f6('0x13'),this[_0xf1f6('0x14')][_0xf1f6('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xf1f6('0x16'),this[_0xf1f6('0x17')][_0xf1f6('0x15')](this));ami['on'](_0xf1f6('0x18'),this[_0xf1f6('0x19')]['bind'](this));ami['on']('blindtransfer',this[_0xf1f6('0x1a')][_0xf1f6('0x15')](this));ami['on'](_0xf1f6('0x1b'),this[_0xf1f6('0x1c')]['bind'](this));}};Report[_0xf1f6('0xe')][_0xf1f6('0x1d')]=function(_0x59da01){var _0x21fa57;_0x21fa57=_[_0xf1f6('0x1e')](this[_0xf1f6('0xc')],function(_0x43fbbd){return _0x43fbbd[_0xf1f6('0x1f')]==_0x59da01||_0x43fbbd[_0xf1f6('0x20')]==_0x59da01;});if(_['isNil'](_0x21fa57)){var _0x37ee1c=_[_0xf1f6('0x1e')](this[_0xf1f6('0xd')],function(_0x54c1ef){return _0x54c1ef['accountcode']==_0x59da01||_0x54c1ef[_0xf1f6('0x20')]==_0x59da01;});if(_0x37ee1c){_0x21fa57=_[_0xf1f6('0x1e')](this[_0xf1f6('0xc')],function(_0x4b9661){return _0x4b9661[_0xf1f6('0x21')]==util['format'](_0xf1f6('0x22'),_0x37ee1c[_0xf1f6('0x20')]);});}}return _0x21fa57;};Report['prototype'][_0xf1f6('0x14')]=function(_0xa2bab8){for(var _0x371b5a=0x0;_0x371b5a<_0xa2bab8[_0xf1f6('0x23')];_0x371b5a+=0x1){var _0x3d4980=this[_0xf1f6('0x1d')](_0xa2bab8[_0x371b5a]['connectedlinenum']);if(_0x3d4980){_0xa2bab8[_0x371b5a][_0xf1f6('0x1f')]=_0x3d4980['accountcode'];_0xa2bab8[_0x371b5a][_0xf1f6('0x24')]=!![];_0xa2bab8[_0x371b5a][_0xf1f6('0x25')]=_0x3d4980[_0xf1f6('0x20')];_0xa2bab8[_0x371b5a][_0xf1f6('0x21')]=_[_0xf1f6('0x26')](_0x3d4980[_0xf1f6('0x21')])?util['format'](_0xf1f6('0x22'),_0x3d4980[_0xf1f6('0x20')]):_0x3d4980[_0xf1f6('0x21')];if(_0xa2bab8[_0x371b5a][_0xf1f6('0x27')]){_0xa2bab8[_0x371b5a]['queuecallercompleteAt']=moment()[_0xf1f6('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xa2bab8[_0x371b5a][_0xf1f6('0x29')]){_0xa2bab8[_0x371b5a][_0xf1f6('0x2a')]=moment()[_0xf1f6('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0xa2bab8[_0x371b5a]);}RpcVoiceQueueReport[_0xf1f6('0x2b')](_0xa2bab8[_0x371b5a]);}};function extractCalleridNumber(_0x4c6381){var _0x17ab37=_0x4c6381[_0xf1f6('0x2c')](/<(.*?)>/);return _0x17ab37?_0x17ab37[0x1]:_0x4c6381;}Report[_0xf1f6('0xe')][_0xf1f6('0x2d')]=function(_0x42dce2){_0x42dce2[_0xf1f6('0x2e')]=_0x42dce2[_0xf1f6('0x2e')]||_0x42dce2[_0xf1f6('0x2f')];if(_0x42dce2[_0xf1f6('0x30')]==_0xf1f6('0x31')){_0x42dce2['lastapplication']=_0xf1f6('0x32');_0x42dce2[_0xf1f6('0x33')]=_0x42dce2[_0xf1f6('0x32')];if(_0x42dce2['context']==_0xf1f6('0x34')){_0x42dce2[_0xf1f6('0x1f')]='';_0x42dce2[_0xf1f6('0x2e')]=extractCalleridNumber(_0x42dce2[_0xf1f6('0x35')]);}else if(_0x42dce2['context']=='from-sip'){if(_0x42dce2[_0xf1f6('0x2e')]==_0xf1f6('0x36')){_0x42dce2['destination']=extractCalleridNumber(_0x42dce2[_0xf1f6('0x37')]);_0x42dce2[_0xf1f6('0x38')]=_0x42dce2[_0xf1f6('0x39')];_0x42dce2['destinationchannel']=[_0x42dce2[_0xf1f6('0x3a')],_0x42dce2['channel']=_0x42dce2[_0xf1f6('0x3b')]][0x0];_0x42dce2[_0xf1f6('0x35')]=_0x42dce2[_0xf1f6('0x37')];}else{_0x42dce2[_0xf1f6('0x2e')]=_0x42dce2['calleridnum'];_0x42dce2[_0xf1f6('0x38')]=_0x42dce2[_0xf1f6('0x39')];if(_0x42dce2[_0xf1f6('0x3c')]=='ANSWERED'){_0x42dce2[_0xf1f6('0x1f')]=_0x42dce2[_0xf1f6('0x3d')];}else{_0x42dce2['accountcode']='';}}}}else{_0x42dce2['callerid']=util[_0xf1f6('0x28')](_0xf1f6('0x3e'),_0x42dce2[_0xf1f6('0x3f')],_0x42dce2[_0xf1f6('0x38')]);}if(RpcVoiceTransferReport[_0xf1f6('0x40')][_0x42dce2[_0xf1f6('0x41')]]){var _0x499ae5=RpcVoiceTransferReport['transfers'][_0x42dce2[_0xf1f6('0x41')]];_0x499ae5[_0xf1f6('0x42')]=_0x42dce2[_0xf1f6('0x43')];RpcVoiceTransferReport[_0xf1f6('0x1a')](_0x499ae5);delete RpcVoiceTransferReport['transfers'][_0x42dce2[_0xf1f6('0x41')]];}RpcVoiceCallReport[_0xf1f6('0x2b')](_0x42dce2);if(_0x42dce2['monitor']){for(var _0x4197d7=0x0;_0x4197d7<_0x42dce2[_0xf1f6('0x44')][_0xf1f6('0x23')];_0x4197d7+=0x1){_0x42dce2['monitorFilename']=_0x42dce2[_0xf1f6('0x44')][_0x4197d7][_0xf1f6('0x45')];_0x42dce2['createdAt']=_0x42dce2[_0xf1f6('0x44')][_0x4197d7]['createdAt'];if(_0x42dce2['exten']==_0xf1f6('0x36')){_0x42dce2[_0xf1f6('0x38')]=_0x42dce2[_0xf1f6('0x3d')];_0x42dce2['calleridname']=_0x42dce2[_0xf1f6('0x46')];_0x42dce2[_0xf1f6('0x3d')]=_0x42dce2[_0xf1f6('0x1f')];_0x42dce2[_0xf1f6('0x46')]=_0x42dce2[_0xf1f6('0x47')];_0x42dce2[_0xf1f6('0x2f')]=_0x42dce2[_0xf1f6('0x39')];}else if(_0x42dce2['exten']==_0xf1f6('0x48')){_0x42dce2[_0xf1f6('0x38')]=_0x42dce2[_0xf1f6('0x2e')];_0x42dce2[_0xf1f6('0x2f')]=_0x42dce2[_0xf1f6('0x39')];}RpcVoiceRecording[_0xf1f6('0x2b')](_0x42dce2);}}};Report[_0xf1f6('0xe')][_0xf1f6('0x17')]=function(_0x564818){if(_[_0xf1f6('0x49')](_0x564818)){_0x564818[_0xf1f6('0x4a')](function(_0x538043){RpcVoiceAgentReport[_0xf1f6('0x2b')](_0x538043);});}else{RpcVoiceAgentReport['create'](_0x564818);}};Report['prototype']['voiceDialReport']=function(_0x42c671){RpcVoiceDialReport[_0xf1f6('0x2b')](_0x42c671);var _0x2d4608;var _0x4e14a;var _0x55d04d=_0x42c671['channel'];if(_[_0xf1f6('0x4b')](_0x55d04d,_0xf1f6('0x4c'))){_0x4e14a=_0x55d04d[_0xf1f6('0x4d')](_0x55d04d['indexOf']('/')+0x1,_0x55d04d[_0xf1f6('0x4e')]('@'));_0x2d4608=_[_0xf1f6('0x1e')](this[_0xf1f6('0xc')],function(_0x45a94d){return _0x45a94d[_0xf1f6('0x4f')]==_0x4e14a||_0x45a94d[_0xf1f6('0x50')]==_0x4e14a||_0x45a94d[_0xf1f6('0x1f')]==_0x4e14a;});}else{_0x4e14a=_0x55d04d[_0xf1f6('0x4d')](_0x55d04d[_0xf1f6('0x4e')]('/')+0x1,_0x55d04d[_0xf1f6('0x51')]('-'));_0x2d4608=this[_0xf1f6('0x1d')](_0x4e14a);}if(_0x2d4608){_0x42c671[_0xf1f6('0x21')]=_[_0xf1f6('0x26')](_0x2d4608[_0xf1f6('0x21')])?util[_0xf1f6('0x28')]('SIP/%s',_0x2d4608[_0xf1f6('0x20')]):_0x2d4608[_0xf1f6('0x21')];_0x42c671[_0xf1f6('0x47')]=_0x2d4608['name'];_0x42c671[_0xf1f6('0x1f')]=_0x2d4608[_0xf1f6('0x1f')];RpcMemberReport[_0xf1f6('0x19')](_0x42c671);}};Report[_0xf1f6('0xe')][_0xf1f6('0x1a')]=function(_0x15bc07){RpcVoiceTransferReport[_0xf1f6('0x40')][_0x15bc07[_0xf1f6('0x52')]]=_0x15bc07;};Report[_0xf1f6('0xe')]['attendedTransfer']=function(_0x65eac8){RpcVoiceTransferReport[_0xf1f6('0x1c')](_0x65eac8);};module[_0xf1f6('0x53')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 6f9c69f..5e358ce 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1f0=['toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','name','startsWith','substring','indexOf','mobile','phone','accountcode','local','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','ioredis','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','[userReport][devicestatelist]','actionSipPeerStatus','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','omit','event','format','trunk:%s','trunk:save','[userReport][registry]','syncDeviceState','device','[userReport][devicestatechange]','toLowerCase','inuse','stateTime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf1f0,0xe0));var _0x0f1f=function(_0x3dfdc2,_0x5e346a){_0x3dfdc2=_0x3dfdc2-0x0;var _0x36a670=_0xf1f0[_0x3dfdc2];return _0x36a670;};'use strict';var _=require(_0x0f1f('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x0f1f('0x1'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x0f1f('0x2'))('ami');var ami=require(_0x0f1f('0x3'));config[_0x0f1f('0x4')]=_[_0x0f1f('0x5')](config[_0x0f1f('0x4')],{'host':_0x0f1f('0x6'),'port':0x18eb});var io=require(_0x0f1f('0x7'))(new Redis(config['redis']));function UserReport(_0x500fc2){this[_0x0f1f('0x8')]=_0x500fc2[_0x0f1f('0x8')];this[_0x0f1f('0x9')]=_0x500fc2[_0x0f1f('0x9')];this[_0x0f1f('0xa')]=_0x500fc2['telephones'];ami['on']('registryentry',this[_0x0f1f('0xb')]['bind'](this));ami['on']('registry',this[_0x0f1f('0xb')][_0x0f1f('0xc')](this));ami['on'](_0x0f1f('0xd'),this['syncDeviceState'][_0x0f1f('0xc')](this));ami['on'](_0x0f1f('0xe'),this[_0x0f1f('0xf')][_0x0f1f('0xc')](this));return this[_0x0f1f('0x10')]();}function showSipRegistrations(){Promise['resolve']()[_0x0f1f('0x11')](ami[_0x0f1f('0x12')]())[_0x0f1f('0x13')](function(_0x4689e0){logger[_0x0f1f('0x14')](_0x0f1f('0x15'),util[_0x0f1f('0x16')](_0x4689e0,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0f1f('0x17')]()[_0x0f1f('0x11')](ami['actionDeviceStateList']())['catch'](function(_0x178d3f){logger['error'](_0x0f1f('0x18'),util['inspect'](_0x178d3f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0f1f('0x17')]()['then'](ami[_0x0f1f('0x19')]())['catch'](function(_0xa03259){logger[_0x0f1f('0x14')]('[userReport][sippeerstatus]',util[_0x0f1f('0x16')](_0xa03259,{'showHidden':![],'depth':null}));});}UserReport[_0x0f1f('0x1a')][_0x0f1f('0x10')]=function(){setInterval(function(){BPromise[_0x0f1f('0x17')]()[_0x0f1f('0x11')](showSipRegistrations())[_0x0f1f('0x11')](listDeviceStates())[_0x0f1f('0x11')](showPeersStatus());},0x32c8);};UserReport[_0x0f1f('0x1a')]['isNotNull']=function(_0x3f1151){return _0x3f1151!==null&&!_['isUndefined'](_0x3f1151);};UserReport[_0x0f1f('0x1a')][_0x0f1f('0x1b')]=function(_0x49a410,_0xa1731e,_0x4f0a12){io['to'](_0x49a410)['emit'](_0xa1731e,_0x4f0a12);};UserReport[_0x0f1f('0x1a')]['syncRegistry']=function(_0x8f3f23){try{if(this[_0x0f1f('0x1c')](_0x8f3f23)){logger[_0x0f1f('0x1d')](_0x0f1f('0x1e'),_0x8f3f23[_0x0f1f('0x1f')],_0x8f3f23[_0x0f1f('0x20')]);logger[_0x0f1f('0x21')]('[userReport][registry]',util[_0x0f1f('0x16')](_0x8f3f23,{'showHidden':![],'depth':null}));var _0x96b4ba=_[_0x0f1f('0x22')](this['trunks'],{'defaultuser':_0x8f3f23[_0x0f1f('0x1f')]});if(_0x96b4ba){_0x8f3f23[_0x0f1f('0x23')]=_0x8f3f23[_0x0f1f('0x20')];_['merge'](_0x96b4ba,_[_0x0f1f('0x24')](_0x8f3f23,[_0x0f1f('0x25'),'actionid',_0x0f1f('0x1f'),_0x0f1f('0x20')]));logger[_0x0f1f('0x21')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x0f1f('0x16')](_0x96b4ba,{'showHidden':![],'depth':null}));this[_0x0f1f('0x1b')](util[_0x0f1f('0x26')](_0x0f1f('0x27'),_0x96b4ba['name']),_0x0f1f('0x28'),_0x96b4ba);}}}catch(_0x5542b5){logger[_0x0f1f('0x14')](_0x0f1f('0x29'),util[_0x0f1f('0x16')](_0x5542b5,{'showHidden':![],'depth':null}));}};UserReport[_0x0f1f('0x1a')][_0x0f1f('0x2a')]=function(_0x217d59){try{if(this[_0x0f1f('0x1c')](_0x217d59)){logger[_0x0f1f('0x1d')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x217d59[_0x0f1f('0x2b')],_0x217d59['state']);logger[_0x0f1f('0x21')](_0x0f1f('0x2c'),util[_0x0f1f('0x16')](_0x217d59,{'showHidden':![],'depth':null}));if(this[_0x0f1f('0x9')][_0x217d59[_0x0f1f('0x2b')]]){if(!this[_0x0f1f('0x9')][_0x217d59['device']]['local']||_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]()==_0x0f1f('0x2e')){this[_0x0f1f('0x9')][_0x217d59[_0x0f1f('0x2b')]]['local']=![];if(this[_0x0f1f('0x9')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x20')]!==_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]()){this[_0x0f1f('0x9')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x2f')]=_[_0x0f1f('0x30')](moment()['format']('x'));}this[_0x0f1f('0x9')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x20')]=_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]();this[_0x0f1f('0x9')][_0x217d59['device']]['updateStatusRealtime'](_0x217d59);}}else if(this['telephones'][_0x217d59[_0x0f1f('0x2b')]]){if(this[_0x0f1f('0xa')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x20')]!==_0x217d59[_0x0f1f('0x20')]['toLowerCase']()){this[_0x0f1f('0xa')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x2f')]=_[_0x0f1f('0x30')](moment()['format']('x'));}this[_0x0f1f('0xa')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x20')]=_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x0f1f('0xa')][_0x217d59['device']],{'showHidden':![],'depth':null}));this[_0x0f1f('0x1b')](util[_0x0f1f('0x26')](_0x0f1f('0x31'),this['telephones'][_0x217d59[_0x0f1f('0x2b')]]['name']),_0x0f1f('0x32'),this[_0x0f1f('0xa')][_0x217d59[_0x0f1f('0x2b')]]);}else if(this[_0x0f1f('0x8')][_0x217d59[_0x0f1f('0x2b')]]){if(this[_0x0f1f('0x8')][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x20')]!==_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]()){this['trunks'][_0x217d59['device']][_0x0f1f('0x2f')]=_[_0x0f1f('0x30')](moment()[_0x0f1f('0x26')]('x'));}this[_0x0f1f('0x8')][_0x217d59['device']][_0x0f1f('0x20')]=_0x217d59[_0x0f1f('0x20')]['toLowerCase']();logger[_0x0f1f('0x21')](_0x0f1f('0x33'),util[_0x0f1f('0x16')](this['trunks'][_0x217d59[_0x0f1f('0x2b')]],{'showHidden':![],'depth':null}));this[_0x0f1f('0x1b')](util[_0x0f1f('0x26')](_0x0f1f('0x27'),this['trunks'][_0x217d59[_0x0f1f('0x2b')]][_0x0f1f('0x34')]),'trunk:save',this[_0x0f1f('0x8')][_0x217d59['device']]);}else if(_[_0x0f1f('0x35')](_0x217d59['device'],'Local')){var _0x49281d=_0x217d59[_0x0f1f('0x2b')];var _0x78e8e5=_0x49281d[_0x0f1f('0x36')](_0x49281d['indexOf']('/')+0x1,_0x49281d[_0x0f1f('0x37')]('@'));var _0xf6ff62=_[_0x0f1f('0x22')](this[_0x0f1f('0x9')],function(_0x4efab4){return _0x4efab4[_0x0f1f('0x38')]==_0x78e8e5||_0x4efab4[_0x0f1f('0x39')]==_0x78e8e5||_0x4efab4[_0x0f1f('0x3a')]==_0x78e8e5;});if(_0xf6ff62){if(_0xf6ff62[_0x0f1f('0x20')]!==_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]()){_0xf6ff62['stateTime']=_[_0x0f1f('0x30')](moment()[_0x0f1f('0x26')]('x'));}_0xf6ff62[_0x0f1f('0x20')]=_0x217d59[_0x0f1f('0x20')][_0x0f1f('0x2d')]();_0xf6ff62[_0x0f1f('0x3b')]=!![];_0xf6ff62[_0x0f1f('0x3c')](_0x217d59);}}}}catch(_0x472c71){logger['error'](_0x0f1f('0x2c'),util[_0x0f1f('0x16')](_0x472c71,{'showHidden':![],'depth':null}));}};UserReport[_0x0f1f('0x1a')][_0x0f1f('0xf')]=function(_0x32489b){try{if(this[_0x0f1f('0x1c')](_0x32489b)&&this[_0x0f1f('0x1c')](_0x32489b['peerstatus'])){logger['info'](_0x0f1f('0x3d'),_0x32489b[_0x0f1f('0x3e')],_0x32489b[_0x0f1f('0x3f')],_0x32489b[_0x0f1f('0xe')]);logger[_0x0f1f('0x21')]('[userReport][peerstatus]',util[_0x0f1f('0x16')](_0x32489b,{'showHidden':![],'depth':null}));if(this['agents'][_0x32489b[_0x0f1f('0x3e')]]){if(!this[_0x0f1f('0x9')][_0x32489b[_0x0f1f('0x3e')]]['local']||_0x32489b['peerstatus']['toLowerCase']()==_0x0f1f('0x40')){this[_0x0f1f('0x9')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x3b')]=![];this['agents'][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x41')]=_0x32489b['peerstatus'][_0x0f1f('0x2d')]();this[_0x0f1f('0x9')][_0x32489b['peer']][_0x0f1f('0x3f')]=_0x32489b['address'];this['agents'][_0x32489b['peer']][_0x0f1f('0x3c')](_0x32489b);}}else if(this[_0x0f1f('0xa')][_0x32489b['peer']]){this[_0x0f1f('0xa')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x41')]=_0x32489b[_0x0f1f('0xe')][_0x0f1f('0x2d')]();this[_0x0f1f('0xa')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x3f')]=_0x32489b[_0x0f1f('0x3f')];logger[_0x0f1f('0x21')](_0x0f1f('0x42'),util[_0x0f1f('0x16')](this[_0x0f1f('0xa')][_0x32489b[_0x0f1f('0x3e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0f1f('0x26')]('telephone:%s',this['telephones'][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x34')]),'telephone:save',this[_0x0f1f('0xa')][_0x32489b[_0x0f1f('0x3e')]]);}else if(this[_0x0f1f('0x8')][_0x32489b['peer']]){this[_0x0f1f('0x8')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x41')]=_0x32489b['peerstatus']['toLowerCase']();this[_0x0f1f('0x8')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x3f')]=_0x32489b[_0x0f1f('0x3f')];logger[_0x0f1f('0x21')](_0x0f1f('0x43'),util[_0x0f1f('0x16')](this[_0x0f1f('0x8')][_0x32489b[_0x0f1f('0x3e')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0f1f('0x27'),this[_0x0f1f('0x8')][_0x32489b[_0x0f1f('0x3e')]][_0x0f1f('0x34')]),_0x0f1f('0x28'),this[_0x0f1f('0x8')][_0x32489b[_0x0f1f('0x3e')]]);}}}catch(_0x420b00){logger[_0x0f1f('0x14')]('[userReport][peerstatus]',util['inspect'](_0x420b00,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xbe9f=['telephone:%s','telephone:save','startsWith','substring','mobile','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','peerstatus','syncPeerStatus','resolve','then','catch','error','inspect','actionSipPeerStatus','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','state','debug','[userReport][registry]','find','stateRegistry','omit','event','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:'];(function(_0x13dd2b,_0x3a09bf){var _0x3110b4=function(_0xb5b8a){while(--_0xb5b8a){_0x13dd2b['push'](_0x13dd2b['shift']());}};_0x3110b4(++_0x3a09bf);}(_0xbe9f,0x1ac));var _0xfbe9=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xbe9f[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xfbe9('0x0'));var moment=require(_0xfbe9('0x1'));var util=require(_0xfbe9('0x2'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xfbe9('0x3'));var logger=require(_0xfbe9('0x4'))(_0xfbe9('0x5'));var ami=require(_0xfbe9('0x6'));config[_0xfbe9('0x7')]=_[_0xfbe9('0x8')](config[_0xfbe9('0x7')],{'host':_0xfbe9('0x9'),'port':0x18eb});var io=require(_0xfbe9('0xa'))(new Redis(config['redis']));function UserReport(_0xabb2bf){this[_0xfbe9('0xb')]=_0xabb2bf[_0xfbe9('0xb')];this['agents']=_0xabb2bf[_0xfbe9('0xc')];this[_0xfbe9('0xd')]=_0xabb2bf['telephones'];ami['on'](_0xfbe9('0xe'),this[_0xfbe9('0xf')][_0xfbe9('0x10')](this));ami['on'](_0xfbe9('0x11'),this[_0xfbe9('0xf')]['bind'](this));ami['on']('devicestatechange',this['syncDeviceState']['bind'](this));ami['on'](_0xfbe9('0x12'),this[_0xfbe9('0x13')][_0xfbe9('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xfbe9('0x14')]()[_0xfbe9('0x15')](ami['actionSipShowRegistry']())[_0xfbe9('0x16')](function(_0x190ce4){logger[_0xfbe9('0x17')]('[userReport][sipshowregistry]',util['inspect'](_0x190ce4,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xfbe9('0x14')]()['then'](ami['actionDeviceStateList']())[_0xfbe9('0x16')](function(_0x2427de){logger[_0xfbe9('0x17')]('[userReport][devicestatelist]',util[_0xfbe9('0x18')](_0x2427de,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xfbe9('0x14')]()[_0xfbe9('0x15')](ami[_0xfbe9('0x19')]())[_0xfbe9('0x16')](function(_0x5c34a3){logger[_0xfbe9('0x17')]('[userReport][sippeerstatus]',util['inspect'](_0x5c34a3,{'showHidden':![],'depth':null}));});}UserReport[_0xfbe9('0x1a')][_0xfbe9('0x1b')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0xfbe9('0x15')](listDeviceStates())[_0xfbe9('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xfbe9('0x1a')][_0xfbe9('0x1c')]=function(_0x1c0294){return _0x1c0294!==null&&!_[_0xfbe9('0x1d')](_0x1c0294);};UserReport['prototype'][_0xfbe9('0x1e')]=function(_0x3b442d,_0x44e1db,_0x553146){io['to'](_0x3b442d)[_0xfbe9('0x1e')](_0x44e1db,_0x553146);};UserReport[_0xfbe9('0x1a')][_0xfbe9('0xf')]=function(_0x2aa244){try{if(this[_0xfbe9('0x1c')](_0x2aa244)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x2aa244['username'],_0x2aa244[_0xfbe9('0x1f')]);logger[_0xfbe9('0x20')](_0xfbe9('0x21'),util['inspect'](_0x2aa244,{'showHidden':![],'depth':null}));var _0x43418d=_[_0xfbe9('0x22')](this['trunks'],{'defaultuser':_0x2aa244['username']});if(_0x43418d){_0x2aa244[_0xfbe9('0x23')]=_0x2aa244[_0xfbe9('0x1f')];_['merge'](_0x43418d,_[_0xfbe9('0x24')](_0x2aa244,[_0xfbe9('0x25'),'actionid',_0xfbe9('0x26'),_0xfbe9('0x1f')]));logger[_0xfbe9('0x20')](_0xfbe9('0x27'),util[_0xfbe9('0x18')](_0x43418d,{'showHidden':![],'depth':null}));this[_0xfbe9('0x1e')](util[_0xfbe9('0x28')](_0xfbe9('0x29'),_0x43418d[_0xfbe9('0x2a')]),_0xfbe9('0x2b'),_0x43418d);}}}catch(_0x2f968d){logger['error'](_0xfbe9('0x21'),util[_0xfbe9('0x18')](_0x2f968d,{'showHidden':![],'depth':null}));}};UserReport[_0xfbe9('0x1a')][_0xfbe9('0x2c')]=function(_0x58e91f){try{if(this[_0xfbe9('0x1c')](_0x58e91f)){logger[_0xfbe9('0x2d')](_0xfbe9('0x2e'),_0x58e91f['device'],_0x58e91f[_0xfbe9('0x1f')]);logger['debug']('[userReport][devicestatechange]',util['inspect'](_0x58e91f,{'showHidden':![],'depth':null}));if(this[_0xfbe9('0xc')][_0x58e91f['device']]){if(!this[_0xfbe9('0xc')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x30')]||_0x58e91f['state']['toLowerCase']()==_0xfbe9('0x31')){this[_0xfbe9('0xc')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x30')]=![];if(this[_0xfbe9('0xc')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x1f')]!==_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]()){this['agents'][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x33')]=_[_0xfbe9('0x34')](moment()[_0xfbe9('0x28')]('x'));}this[_0xfbe9('0xc')][_0x58e91f['device']][_0xfbe9('0x1f')]=_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]();this[_0xfbe9('0xc')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x35')](_0x58e91f);}}else if(this[_0xfbe9('0xd')][_0x58e91f[_0xfbe9('0x2f')]]){if(this[_0xfbe9('0xd')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x1f')]!==_0x58e91f['state'][_0xfbe9('0x32')]()){this[_0xfbe9('0xd')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x33')]=_[_0xfbe9('0x34')](moment()[_0xfbe9('0x28')]('x'));}this[_0xfbe9('0xd')][_0x58e91f['device']][_0xfbe9('0x1f')]=_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]();logger['debug'](_0xfbe9('0x36'),util[_0xfbe9('0x18')](this[_0xfbe9('0xd')][_0x58e91f['device']],{'showHidden':![],'depth':null}));this[_0xfbe9('0x1e')](util['format'](_0xfbe9('0x37'),this[_0xfbe9('0xd')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x2a')]),_0xfbe9('0x38'),this[_0xfbe9('0xd')][_0x58e91f[_0xfbe9('0x2f')]]);}else if(this['trunks'][_0x58e91f[_0xfbe9('0x2f')]]){if(this[_0xfbe9('0xb')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x1f')]!==_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]()){this[_0xfbe9('0xb')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x33')]=_['toNumber'](moment()[_0xfbe9('0x28')]('x'));}this[_0xfbe9('0xb')][_0x58e91f[_0xfbe9('0x2f')]][_0xfbe9('0x1f')]=_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xfbe9('0x18')](this[_0xfbe9('0xb')][_0x58e91f[_0xfbe9('0x2f')]],{'showHidden':![],'depth':null}));this[_0xfbe9('0x1e')](util[_0xfbe9('0x28')](_0xfbe9('0x29'),this[_0xfbe9('0xb')][_0x58e91f['device']][_0xfbe9('0x2a')]),'trunk:save',this[_0xfbe9('0xb')][_0x58e91f[_0xfbe9('0x2f')]]);}else if(_[_0xfbe9('0x39')](_0x58e91f[_0xfbe9('0x2f')],'Local')){var _0x1f54cc=_0x58e91f['device'];var _0x5aca22=_0x1f54cc[_0xfbe9('0x3a')](_0x1f54cc['indexOf']('/')+0x1,_0x1f54cc['indexOf']('@'));var _0x1f7d1d=_[_0xfbe9('0x22')](this[_0xfbe9('0xc')],function(_0x4ff483){return _0x4ff483[_0xfbe9('0x3b')]==_0x5aca22||_0x4ff483['phone']==_0x5aca22||_0x4ff483['accountcode']==_0x5aca22;});if(_0x1f7d1d){if(_0x1f7d1d['state']!==_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]()){_0x1f7d1d['stateTime']=_[_0xfbe9('0x34')](moment()[_0xfbe9('0x28')]('x'));}_0x1f7d1d[_0xfbe9('0x1f')]=_0x58e91f[_0xfbe9('0x1f')][_0xfbe9('0x32')]();_0x1f7d1d['local']=!![];_0x1f7d1d[_0xfbe9('0x35')](_0x58e91f);}}}}catch(_0x2f7cc4){logger[_0xfbe9('0x17')](_0xfbe9('0x3c'),util[_0xfbe9('0x18')](_0x2f7cc4,{'showHidden':![],'depth':null}));}};UserReport[_0xfbe9('0x1a')]['syncPeerStatus']=function(_0x21afe5){try{if(this[_0xfbe9('0x1c')](_0x21afe5)&&this['isNotNull'](_0x21afe5[_0xfbe9('0x12')])){logger[_0xfbe9('0x2d')](_0xfbe9('0x3d'),_0x21afe5[_0xfbe9('0x3e')],_0x21afe5['address'],_0x21afe5[_0xfbe9('0x12')]);logger[_0xfbe9('0x20')]('[userReport][peerstatus]',util[_0xfbe9('0x18')](_0x21afe5,{'showHidden':![],'depth':null}));if(this[_0xfbe9('0xc')][_0x21afe5[_0xfbe9('0x3e')]]){if(!this[_0xfbe9('0xc')][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x30')]||_0x21afe5['peerstatus'][_0xfbe9('0x32')]()==_0xfbe9('0x3f')){this[_0xfbe9('0xc')][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x30')]=![];this['agents'][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x40')]=_0x21afe5[_0xfbe9('0x12')]['toLowerCase']();this['agents'][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x41')]=_0x21afe5['address'];this[_0xfbe9('0xc')][_0x21afe5['peer']][_0xfbe9('0x35')](_0x21afe5);}}else if(this[_0xfbe9('0xd')][_0x21afe5['peer']]){this['telephones'][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x40')]=_0x21afe5['peerstatus'][_0xfbe9('0x32')]();this['telephones'][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x41')]=_0x21afe5[_0xfbe9('0x41')];logger[_0xfbe9('0x20')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xfbe9('0x18')](this[_0xfbe9('0xd')][_0x21afe5['peer']],{'showHidden':![],'depth':null}));this[_0xfbe9('0x1e')](util[_0xfbe9('0x28')](_0xfbe9('0x37'),this[_0xfbe9('0xd')][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x2a')]),'telephone:save',this[_0xfbe9('0xd')][_0x21afe5[_0xfbe9('0x3e')]]);}else if(this['trunks'][_0x21afe5['peer']]){this[_0xfbe9('0xb')][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x40')]=_0x21afe5[_0xfbe9('0x12')]['toLowerCase']();this['trunks'][_0x21afe5[_0xfbe9('0x3e')]]['address']=_0x21afe5[_0xfbe9('0x41')];logger[_0xfbe9('0x20')](_0xfbe9('0x42'),util[_0xfbe9('0x18')](this[_0xfbe9('0xb')][_0x21afe5[_0xfbe9('0x3e')]],{'showHidden':![],'depth':null}));this[_0xfbe9('0x1e')](util[_0xfbe9('0x28')]('trunk:%s',this[_0xfbe9('0xb')][_0x21afe5[_0xfbe9('0x3e')]][_0xfbe9('0x2a')]),'trunk:save',this[_0xfbe9('0xb')][_0x21afe5['peer']]);}}}catch(_0x347d6d){logger[_0xfbe9('0x17')](_0xfbe9('0x43'),util[_0xfbe9('0x18')](_0x347d6d,{'showHidden':![],'depth':null}));}};module[_0xfbe9('0x44')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index d45e2c0..15b1d10 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x117ce3,_0x1faa06){var _0x58c06b=function(_0x5283e8){while(--_0x5283e8){_0x117ce3['push'](_0x117ce3['shift']());}};_0x58c06b(++_0x1faa06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x4d2040,_0x5c8745){var _0x5aa762=function(_0x2db1de){while(--_0x2db1de){_0x4d2040['push'](_0x4d2040['shift']());}};_0x5aa762(++_0x5c8745);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 731b91c..af17fda 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc035=['xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','diff','holdtime','omit','user:agentcomplete','length','resolve','then','transferType','undefined','getSettings','Action','StopMixMonitor','catch','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','ioredis','../../../config/logger','ami','../ami','set','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','channels','agents','blindTransfers','bind','newchannel','syncNewChannel','varset','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','isUndefined','merge','pick','keys','context','channel','split','exten','connectedlinenum','format','name','user:agentconnect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','[%s][voiceCallReport][newchannel]','syncNewExten','application','appdata','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','includes','lastdata','startsWith','cdr(','toLowerCase','match','queue','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','starttime','seconds','xcally-motion-preview','calleridname','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination'];(function(_0x2a3eec,_0x184790){var _0x262c09=function(_0x30699e){while(--_0x30699e){_0x2a3eec['push'](_0x2a3eec['shift']());}};_0x262c09(++_0x184790);}(_0xc035,0xf6));var _0x5c03=function(_0x14b89b,_0x5dc2be){_0x14b89b=_0x14b89b-0x0;var _0x41254f=_0xc035[_0x14b89b];return _0x41254f;};'use strict';var _=require(_0x5c03('0x0'));var moment=require('moment');var util=require(_0x5c03('0x1'));var path=require(_0x5c03('0x2'));var Redis=require(_0x5c03('0x3'));var config=require('../../../config/environment');var logger=require(_0x5c03('0x4'))(_0x5c03('0x5'));var ami=require(_0x5c03('0x6'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var applications=[_0x5c03('0x7'),'queue','agi',_0x5c03('0x8'),_0x5c03('0x9'),'voicemail'];var dispositions=[_0x5c03('0xa'),_0x5c03('0xb'),_0x5c03('0xb'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0x5c03('0xc'),_0x5c03('0xd'),'FAILED',_0x5c03('0xb'),_0x5c03('0xb')];config[_0x5c03('0xe')]=_[_0x5c03('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c03('0xe')]));function VoiceCallReport(_0x390b74){this[_0x5c03('0x10')]=_0x390b74['channels'];this[_0x5c03('0x11')]=_0x390b74[_0x5c03('0x11')];this[_0x5c03('0x12')]={};ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x14'),this[_0x5c03('0x15')]['bind'](this));ami['on']('newstate',this['syncNewState'][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x16'),this['syncVarSet'][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x17'),this[_0x5c03('0x18')][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x19'),this['syncNewCallerId'][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x1a'),this[_0x5c03('0x1b')][_0x5c03('0x13')](this));ami['on']('blindtransfer',this[_0x5c03('0x1c')][_0x5c03('0x13')](this));ami['on']('musiconholdstart',this[_0x5c03('0x1d')][_0x5c03('0x13')](this));ami['on'](_0x5c03('0x1e'),this[_0x5c03('0x1f')][_0x5c03('0x13')](this));try{logger[_0x5c03('0x20')](_0x5c03('0x21'));ami['actionCoreShowChannels']();}catch(_0x566a4e){logger[_0x5c03('0x22')](_0x5c03('0x23'),util[_0x5c03('0x24')](_0x566a4e,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x5c03('0x25')]=function(_0x49995a){return _0x49995a!==null&&!_['isUndefined'](_0x49995a);};VoiceCallReport[_0x5c03('0x26')][_0x5c03('0x27')]=function(_0x10cc6f,_0xa23d8b,_0xf6a9ae){io['to'](_0x10cc6f)['emit'](_0xa23d8b,_0xf6a9ae);};VoiceCallReport[_0x5c03('0x26')][_0x5c03('0x28')]=function(_0x5bc4ab){try{if(this[_0x5c03('0x25')](_0x5bc4ab)){logger['info'](_0x5c03('0x29'),_0x5bc4ab['uniqueid'],_0x5bc4ab['calleridname'],_0x5bc4ab['calleridnum']);logger[_0x5c03('0x2a')](_0x5c03('0x2b'),_0x5bc4ab[_0x5c03('0x2c')],util['inspect'](_0x5bc4ab,{'showHidden':![],'depth':null}));if(_0x5bc4ab[_0x5c03('0x2c')]===_0x5bc4ab[_0x5c03('0x2d')]){if(!_[_0x5c03('0x2e')](this[_0x5c03('0x10')][_0x5bc4ab[_0x5c03('0x2c')]])){_[_0x5c03('0x2f')](this[_0x5c03('0x10')][_0x5bc4ab[_0x5c03('0x2c')]],_[_0x5c03('0x30')](_0x5bc4ab,_[_0x5c03('0x31')](this[_0x5c03('0x10')][_0x5bc4ab[_0x5c03('0x2c')]])));}}if(_0x5bc4ab[_0x5c03('0x32')]==='from-sip'){if(this[_0x5c03('0x11')][_0x5bc4ab[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]){if(_0x5bc4ab[_0x5c03('0x35')]=='xcally-motion-preview'){this[_0x5c03('0x11')][_0x5bc4ab[_0x5c03('0x33')]['split']('-')[0x0]]['destconnectedlinenum']=_0x5bc4ab[_0x5c03('0x36')];this[_0x5c03('0x27')](util[_0x5c03('0x37')]('user:%s',this[_0x5c03('0x11')][_0x5bc4ab[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x38')]),_0x5c03('0x39'),{'destaccountcode':this['agents'][_0x5bc4ab[_0x5c03('0x33')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5bc4ab[_0x5c03('0x36')]});}}}}}catch(_0x1a1908){logger['error']('[%s][voiceCallReport][newcallerid]',_0x5bc4ab[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x1a1908,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c03('0x26')][_0x5c03('0x15')]=function(_0x29f17c){try{if(this['isNotNull'](_0x29f17c)){logger[_0x5c03('0x2a')](_0x5c03('0x3a'),_0x29f17c['uniqueid'],util[_0x5c03('0x24')](_0x29f17c,{'showHidden':![],'depth':null}));if(_0x29f17c[_0x5c03('0x2c')]===_0x29f17c[_0x5c03('0x2d')]&&_0x29f17c[_0x5c03('0x33')]!=_0x5c03('0x3b')){if(_[_0x5c03('0x2e')](this[_0x5c03('0x10')][_0x29f17c[_0x5c03('0x2c')]])){logger[_0x5c03('0x20')](_0x5c03('0x3c'),_0x29f17c['uniqueid'],_0x29f17c['context'],_0x29f17c['exten']);this[_0x5c03('0x10')][_0x29f17c[_0x5c03('0x2c')]]=new Channel();this[_0x5c03('0x10')][_0x29f17c[_0x5c03('0x2c')]]['starttime']=moment()['format'](_0x5c03('0x3d'));this[_0x5c03('0x10')][_0x29f17c[_0x5c03('0x2c')]][_0x5c03('0x3e')]=dispositions[_[_0x5c03('0x3f')](_0x29f17c[_0x5c03('0x40')])];_[_0x5c03('0x2f')](this[_0x5c03('0x10')][_0x29f17c['uniqueid']],_[_0x5c03('0x30')](_0x29f17c,_[_0x5c03('0x31')](this[_0x5c03('0x10')][_0x29f17c['uniqueid']])));if(_0x29f17c['context']===_0x5c03('0x41')){if(this['agents'][_0x29f17c['channel'][_0x5c03('0x34')]('-')[0x0]]){if(_['isUndefined'](this[_0x5c03('0x11')][_0x29f17c['channel'][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x42')])){this[_0x5c03('0x11')][_0x29f17c['channel']['split']('-')[0x0]][_0x5c03('0x42')]=_0x29f17c[_0x5c03('0x35')];logger['debug'](_0x5c03('0x43'),_0x29f17c[_0x5c03('0x2c')],util[_0x5c03('0x24')]({'id':this['agents'][_0x29f17c[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x29f17c[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x44')],'destconnectedlinenum':_0x29f17c[_0x5c03('0x35')]},{'showHidden':![],'depth':null}));this[_0x5c03('0x27')](util[_0x5c03('0x37')](_0x5c03('0x45'),this['agents'][_0x29f17c[_0x5c03('0x33')]['split']('-')[0x0]][_0x5c03('0x38')]),_0x5c03('0x39'),{'id':this[_0x5c03('0x11')][_0x29f17c[_0x5c03('0x33')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x5c03('0x11')][_0x29f17c[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x29f17c['exten']});}}}}}}}catch(_0x1760d8){logger[_0x5c03('0x22')](_0x5c03('0x46'),_0x29f17c[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x1760d8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c03('0x47')]=function(_0x1226d4){try{if(this[_0x5c03('0x25')](_0x1226d4)){logger[_0x5c03('0x2a')]('[%s][voiceCallReport][newexten]\x20event:',_0x1226d4[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x1226d4,{'showHidden':![],'depth':null}));if(_0x1226d4[_0x5c03('0x2c')]===_0x1226d4[_0x5c03('0x2d')]&&_0x1226d4[_0x5c03('0x35')]!='h'&&_0x1226d4['channel']!='OutgoingSpoolFailed'){_0x1226d4[_0x5c03('0x48')]=_0x1226d4[_0x5c03('0x48')]['toLowerCase']();_0x1226d4['applicationdata']=_0x1226d4[_0x5c03('0x49')]&&_0x1226d4[_0x5c03('0x49')]['startsWith']('CDR(routeAlias)')?_0x1226d4['appdata']:(_0x1226d4[_0x5c03('0x49')]||_0x1226d4[_0x5c03('0x4a')])['toLowerCase']();logger[_0x5c03('0x20')](_0x5c03('0x4b'),_0x1226d4[_0x5c03('0x2c')],_0x1226d4[_0x5c03('0x48')],_0x1226d4[_0x5c03('0x4a')]);if(_[_0x5c03('0x2e')](this[_0x5c03('0x10')][_0x1226d4[_0x5c03('0x2c')]])){this[_0x5c03('0x10')][_0x1226d4['uniqueid']]=new Channel();this['channels'][_0x1226d4[_0x5c03('0x2c')]]['starttime']=_0x1226d4['duration']?moment()[_0x5c03('0x4c')](moment['duration'](_0x1226d4[_0x5c03('0x4d')])['seconds'](),'seconds')['format'](_0x5c03('0x3d')):moment()[_0x5c03('0x37')](_0x5c03('0x3d'));this[_0x5c03('0x10')][_0x1226d4['uniqueid']]['disposition']=_0x5c03('0xa');}_[_0x5c03('0x2f')](this[_0x5c03('0x10')][_0x1226d4[_0x5c03('0x2c')]],_[_0x5c03('0x30')](_0x1226d4,_[_0x5c03('0x31')](this[_0x5c03('0x10')][_0x1226d4[_0x5c03('0x2c')]])));if(_[_0x5c03('0x4e')](applications,_0x1226d4[_0x5c03('0x48')])){this[_0x5c03('0x10')][_0x1226d4['uniqueid']]['lastapplication']=_0x1226d4['application'];this['channels'][_0x1226d4[_0x5c03('0x2c')]][_0x5c03('0x4f')]=_0x1226d4[_0x5c03('0x4a')];if(_0x1226d4[_0x5c03('0x48')]==='set'&&_[_0x5c03('0x50')](_0x1226d4[_0x5c03('0x4a')]['toLowerCase'](),_0x5c03('0x51'))){var _0x5a80ad=_0x1226d4[_0x5c03('0x4a')][_0x5c03('0x34')]('=');var _0x4ccd68=_0x5a80ad[0x0][_0x5c03('0x52')]()[_0x5c03('0x53')](/cdr\((.*)\)/);if(_0x4ccd68){this[_0x5c03('0x10')][_0x1226d4[_0x5c03('0x2c')]][_0x4ccd68[0x1]]=_0x5a80ad[0x1];}}else if(_0x1226d4['application']===_0x5c03('0x54')){this[_0x5c03('0x10')][_0x1226d4[_0x5c03('0x2c')]][_0x5c03('0x54')]=_0x1226d4['applicationdata']['split'](',')[0x0];}}}}}catch(_0xb5cd88){logger[_0x5c03('0x22')]('[%s][voiceCallReport][newexten]',_0x1226d4[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0xb5cd88,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c03('0x26')][_0x5c03('0x55')]=function(_0xc9ee57){try{if(this[_0x5c03('0x25')](_0xc9ee57)){logger[_0x5c03('0x20')](_0x5c03('0x56'),_0xc9ee57[_0x5c03('0x2c')],_0xc9ee57[_0x5c03('0x2d')],_0xc9ee57['calleridname'],_0xc9ee57[_0x5c03('0x57')]);logger[_0x5c03('0x2a')](_0x5c03('0x58'),_0xc9ee57[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0xc9ee57,{'showHidden':![],'depth':null}));if(_0xc9ee57[_0x5c03('0x2c')]!==_0xc9ee57[_0x5c03('0x2d')]){if(this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]]){if(_0xc9ee57['channelstate']==='6'){if(!this[_0x5c03('0x10')][_0xc9ee57['linkedid']][_0x5c03('0x59')]){var _0x1617da=moment();this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x59')]=!![];this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x5a')]=_0x1617da[_0x5c03('0x37')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0xc9ee57[_0x5c03('0x2d')]]['starttime']){this['channels'][_0xc9ee57['linkedid']]['holdtime']=_0x1617da['diff'](this[_0x5c03('0x10')][_0xc9ee57['linkedid']][_0x5c03('0x5b')],_0x5c03('0x5c'));}}this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x2d')]=_0xc9ee57[_0x5c03('0x2c')];if(_0xc9ee57[_0x5c03('0x57')]!==_0x5c03('0x5d')){this['channels'][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x36')]=_0xc9ee57[_0x5c03('0x57')];}this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]]['connectedlinename']=_0xc9ee57[_0x5c03('0x5e')];this['channels'][_0xc9ee57['linkedid']][_0x5c03('0x5f')]=_0xc9ee57['channel'];this['channels'][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x3e')]=dispositions[_['toNumber'](_0xc9ee57[_0x5c03('0x40')])];if(this['agents'][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]){this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x60')]=this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]['id'];this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2d')]][_0x5c03('0x61')]=this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')]['split']('-')[0x0]]['name'];}}}}else{if(this['channels'][_0xc9ee57['uniqueid']]){if(_0xc9ee57[_0x5c03('0x40')]==='6'){if(this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')]['split']('-')[0x0]]){this['channels'][_0xc9ee57[_0x5c03('0x2c')]][_0x5c03('0x60')]=this['agents'][_0xc9ee57[_0x5c03('0x33')]['split']('-')[0x0]]['id'];this['channels'][_0xc9ee57['uniqueid']]['membername']=this['agents'][_0xc9ee57[_0x5c03('0x33')]['split']('-')[0x0]][_0x5c03('0x38')];}}}}if(_0xc9ee57['channelstate']==='6'&&_0xc9ee57[_0x5c03('0x32')]===_0x5c03('0x41')){if(this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]){this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')]['split']('-')[0x0]][_0x5c03('0x42')]=_0xc9ee57['exten'];var _0x40a5fe,_0x26d890;if(this['channels'][_0xc9ee57[_0x5c03('0x2c')]]){_0x40a5fe=this['channels'][_0xc9ee57[_0x5c03('0x2c')]][_0x5c03('0x62')];_0x26d890=this[_0x5c03('0x10')][_0xc9ee57[_0x5c03('0x2c')]]['queue'];}else if(this[_0x5c03('0x10')][_0xc9ee57['linkedid']]){_0x40a5fe=this[_0x5c03('0x10')][_0xc9ee57['linkedid']][_0x5c03('0x62')];_0x26d890=this['channels'][_0xc9ee57['linkedid']][_0x5c03('0x54')];}logger[_0x5c03('0x2a')](_0x5c03('0x63'),_0xc9ee57[_0x5c03('0x2c')],util[_0x5c03('0x24')]({'id':this['agents'][_0xc9ee57['channel'][_0x5c03('0x34')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x44')],'destconnectedlinenum':_0xc9ee57[_0x5c03('0x35')],'routealias':_0x40a5fe,'queue':_0x26d890||undefined},{'showHidden':![],'depth':null}));this[_0x5c03('0x27')](util[_0x5c03('0x37')](_0x5c03('0x45'),this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x38')]),_0x5c03('0x39'),{'id':this['agents'][_0xc9ee57['channel'][_0x5c03('0x34')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x5c03('0x11')][_0xc9ee57[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x44')],'destconnectedlinenum':_0xc9ee57['exten'],'routealias':_0x40a5fe,'queue':_0x26d890||undefined});}}}}catch(_0x51ea3){logger['error'](_0x5c03('0x64'),_0xc9ee57[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x51ea3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c03('0x26')][_0x5c03('0x65')]=function(_0x405534,_0x3f75ce){try{if(this[_0x5c03('0x10')][_0x405534]){logger[_0x5c03('0x20')](_0x5c03('0x66'),_0x405534,_0x3f75ce);this['channels'][_0x405534][_0x5c03('0x67')]=!![];if(_['endsWith'](_0x3f75ce,_0x5c03('0x68'))){_0x3f75ce=_0x3f75ce[_0x5c03('0x69')](_0x5c03('0x68'),_0x5c03('0x6a'));}this['channels'][_0x405534][_0x5c03('0x6b')]=_0x3f75ce;var _0x2205f5=_['find'](this['channels'][_0x405534][_0x5c03('0x6c')],{'filename':_0x3f75ce});if(_[_0x5c03('0x6d')](_0x2205f5)){this[_0x5c03('0x10')][_0x405534]['monitors']['push']({'filename':_0x3f75ce,'createdAt':moment()[_0x5c03('0x37')](_0x5c03('0x3d')),'mixmonitorid':'','status':_0x5c03('0x6e')});}}}catch(_0x1f7fe4){logger[_0x5c03('0x22')](_0x5c03('0x6f'),_0x405534,util[_0x5c03('0x24')](_0x1f7fe4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c03('0x70')]=function(_0x2c7d02){try{if(this[_0x5c03('0x25')](_0x2c7d02)){logger[_0x5c03('0x2a')](_0x5c03('0x71'),_0x2c7d02[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x2c7d02,{'showHidden':![],'depth':null}));if(this[_0x5c03('0x10')][_0x2c7d02['uniqueid']]&&_0x2c7d02[_0x5c03('0x33')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x2c7d02[_0x5c03('0x72')])){if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')]['mixmonitor_filename'])){logger['info'](_0x5c03('0x73'),_0x2c7d02['uniqueid'],_0x2c7d02[_0x5c03('0x74')]);this['syncMixMonitorFilename'](_0x2c7d02['uniqueid'],_0x2c7d02[_0x5c03('0x74')]);}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')]['xmd-phone'])){logger['info'](_0x5c03('0x75'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')]);this['channels'][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x57')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02['variable'][_0x5c03('0x76')])){logger[_0x5c03('0x20')](_0x5c03('0x77'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')]);this[_0x5c03('0x10')][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x78')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02['variable']['xmd-cdrtype'])){logger['info'](_0x5c03('0x79'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02['value']);this['channels'][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x7a')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x7b')])){logger[_0x5c03('0x20')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')][_0x5c03('0x34')](',')[0x0]);this[_0x5c03('0x10')][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x54')]=_0x2c7d02[_0x5c03('0x74')][_0x5c03('0x34')](',')[0x0];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x7c')])){logger[_0x5c03('0x20')](_0x5c03('0x7d'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')]);this['channels'][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x7e')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x7f')])){logger[_0x5c03('0x20')](_0x5c03('0x80'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')]);this[_0x5c03('0x10')][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x81')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x82')])){logger[_0x5c03('0x20')](_0x5c03('0x83'),_0x2c7d02[_0x5c03('0x2c')],_0x2c7d02[_0x5c03('0x74')]);this[_0x5c03('0x10')][_0x2c7d02[_0x5c03('0x2c')]]['calleridpreview']=_0x2c7d02['value'];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x84')])){logger[_0x5c03('0x20')](_0x5c03('0x85'),_0x2c7d02['uniqueid'],_0x2c7d02['value']);this[_0x5c03('0x10')][_0x2c7d02[_0x5c03('0x2c')]][_0x5c03('0x54')]=_0x2c7d02[_0x5c03('0x74')];}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x86')])){logger[_0x5c03('0x20')](_0x5c03('0x87'),_0x2c7d02['uniqueid'],_0x2c7d02[_0x5c03('0x74')]);this['channels'][_0x2c7d02[_0x5c03('0x2c')]]['sipcalluniqueid']=_0x2c7d02[_0x5c03('0x74')];}}}else if(this[_0x5c03('0x25')](_0x2c7d02[_0x5c03('0x72')][_0x5c03('0x88')])){if(_0x2c7d02[_0x5c03('0x74')]){var _0x4657ee=path[_0x5c03('0x89')](_0x2c7d02[_0x5c03('0x74')])['name'];logger['info'](_0x5c03('0x73'),_0x4657ee,_0x2c7d02[_0x5c03('0x74')]);this['syncMixMonitorFilename'](_0x4657ee,_0x2c7d02[_0x5c03('0x74')]);}}else if(this[_0x5c03('0x10')][_0x2c7d02['linkedid']]){if(this[_0x5c03('0x25')](_0x2c7d02['variable'])){if(this['isNotNull'](_0x2c7d02[_0x5c03('0x72')]['sipcallid'])){logger[_0x5c03('0x20')](_0x5c03('0x87'),_0x2c7d02[_0x5c03('0x2d')],_0x2c7d02[_0x5c03('0x74')]);this['channels'][_0x2c7d02[_0x5c03('0x2d')]][_0x5c03('0x8a')]=_0x2c7d02[_0x5c03('0x74')];}}}}}catch(_0x2766cd){logger[_0x5c03('0x22')](_0x5c03('0x8b'),_0x2c7d02[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x2766cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c03('0x26')]['syncHangup']=function(_0x1eab3e){try{if(this[_0x5c03('0x25')](_0x1eab3e)){logger['debug'](_0x5c03('0x8c'),_0x1eab3e[_0x5c03('0x2c')],util[_0x5c03('0x24')](_0x1eab3e,{'showHidden':![],'depth':null}));if(this[_0x5c03('0x10')][_0x1eab3e[_0x5c03('0x2c')]]){logger['info'](_0x5c03('0x8d'),_0x1eab3e[_0x5c03('0x2c')],_0x1eab3e[_0x5c03('0x8e')]);var _0x10e719=moment();this[_0x5c03('0x10')][_0x1eab3e[_0x5c03('0x2c')]]['endtime']=_0x10e719[_0x5c03('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5c03('0x10')][_0x1eab3e['uniqueid']]['duration']=_0x10e719['diff'](this[_0x5c03('0x10')][_0x1eab3e[_0x5c03('0x2c')]]['starttime'],'seconds');if(this[_0x5c03('0x10')][_0x1eab3e[_0x5c03('0x2c')]][_0x5c03('0x59')]){this[_0x5c03('0x10')][_0x1eab3e['uniqueid']][_0x5c03('0x8f')]=_0x10e719[_0x5c03('0x90')](this[_0x5c03('0x10')][_0x1eab3e[_0x5c03('0x2c')]][_0x5c03('0x5a')],_0x5c03('0x5c'));this[_0x5c03('0x10')][_0x1eab3e['uniqueid']][_0x5c03('0x91')]=this['channels'][_0x1eab3e[_0x5c03('0x2c')]][_0x5c03('0x4d')]-this['channels'][_0x1eab3e[_0x5c03('0x2c')]][_0x5c03('0x8f')];}if(_0x1eab3e['context']===_0x5c03('0x41')){if(this[_0x5c03('0x11')][_0x1eab3e[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]){this[_0x5c03('0x11')][_0x1eab3e[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]=_[_0x5c03('0x92')](this[_0x5c03('0x11')][_0x1eab3e['channel'][_0x5c03('0x34')]('-')[0x0]],[_0x5c03('0x42')]);logger[_0x5c03('0x2a')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x1eab3e['uniqueid'],util[_0x5c03('0x24')]({'id':this['agents'][_0x1eab3e['channel'][_0x5c03('0x34')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1eab3e['channel'][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x44')]},{'showHidden':![],'depth':null}));this[_0x5c03('0x27')](util[_0x5c03('0x37')](_0x5c03('0x45'),this[_0x5c03('0x11')][_0x1eab3e[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x38')]),_0x5c03('0x93'),{'id':this[_0x5c03('0x11')][_0x1eab3e[_0x5c03('0x33')][_0x5c03('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c03('0x11')][_0x1eab3e['channel'][_0x5c03('0x34')]('-')[0x0]][_0x5c03('0x44')]});for(var _0x2ccce8=0x0;_0x2ccce80x0?_0x4a08dc:0x0;this[_0x7e72('0x11')][_0x4e2def[_0x7e72('0x69')]][_0x7e72('0x31')]=this[_0x7e72('0x11')][_0x4e2def[_0x7e72('0x69')]][_0x7e72('0x31')]>_[_0x7e72('0x6e')](_0x4e2def[_0x7e72('0x6f')])?_[_0x7e72('0x6e')](_0x4e2def['loggedin']):this[_0x7e72('0x11')][_0x4e2def[_0x7e72('0x69')]][_0x7e72('0x31')];this[_0x7e72('0x70')](this[_0x7e72('0x11')][_0x4e2def[_0x7e72('0x69')]],_0x7e72('0x15'));}logger['debug'](_0x7e72('0x71'),util[_0x7e72('0x3d')](this[_0x7e72('0x11')][_0x4e2def[_0x7e72('0x69')]],{'showHidden':![],'depth':null}));ami[_0x7e72('0x43')](_0x7e72('0x72'),this['voiceQueues'][_0x4e2def[_0x7e72('0x69')]]);}}}catch(_0x24a403){logger[_0x7e72('0x3b')]('[voiceQueueReport][queuesummary]',util[_0x7e72('0x3d')](_0x24a403,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')][_0x7e72('0x73')]=function(_0x53ee42){logger[_0x7e72('0x44')](_0x7e72('0x74'),util[_0x7e72('0x3d')](_0x53ee42,{'showHidden':![],'depth':null}));this[_0x7e72('0x12')]=!![];};VoiceQueueReport['prototype'][_0x7e72('0x19')]=function(_0x1c97ac){try{if(this['isNotNull'](_0x1c97ac)){logger[_0x7e72('0x44')](_0x7e72('0x75'),_0x1c97ac[_0x7e72('0x47')],util['inspect'](_0x1c97ac,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7e72('0xd')][_0x1c97ac[_0x7e72('0x47')]]))this[_0x7e72('0xd')][_0x1c97ac[_0x7e72('0x47')]]=[];if(_[_0x7e72('0x62')](this[_0x7e72('0xf')][_0x1c97ac['uniqueid']]))this[_0x7e72('0xf')][_0x1c97ac[_0x7e72('0x47')]]={};var _0x42fdc5=new QueueReport();_0x42fdc5[_0x7e72('0x48')]=_0x1c97ac[_0x7e72('0x69')];_0x42fdc5[_0x7e72('0x4f')]=this[_0x7e72('0x11')][_0x42fdc5[_0x7e72('0x48')]]&&this[_0x7e72('0x11')][_0x42fdc5[_0x7e72('0x48')]][_0x7e72('0x4f')]?this['voiceQueues'][_0x42fdc5[_0x7e72('0x48')]]['type']||_0x7e72('0x50'):_0x7e72('0x50');_0x42fdc5[_0x7e72('0x69')]=_0x1c97ac[_0x7e72('0x69')];_0x42fdc5[_0x7e72('0x76')]=moment()[_0x7e72('0x4b')](_0x7e72('0x77'));_0x42fdc5[_0x7e72('0x78')]=_0x1c97ac[_0x7e72('0x78')];_0x42fdc5['count']=_0x1c97ac[_0x7e72('0x79')];_0x42fdc5[_0x7e72('0x47')]=_0x1c97ac['uniqueid'];_0x42fdc5[_0x7e72('0x7a')]=this['channels'][_0x1c97ac[_0x7e72('0x47')]]['routealias'];logger['info'](_0x7e72('0x7b'),_0x42fdc5[_0x7e72('0x48')],_0x42fdc5[_0x7e72('0x4f')]);_[_0x7e72('0x7c')](_0x42fdc5,_[_0x7e72('0x7d')](_0x1c97ac,_[_0x7e72('0x7e')](_0x42fdc5)));this['queueReports'][_0x1c97ac[_0x7e72('0x47')]][_0x7e72('0x7f')](_0x42fdc5);this[_0x7e72('0xf')][_0x1c97ac[_0x7e72('0x47')]]=_0x42fdc5;this[_0x7e72('0x80')](_0x42fdc5,_0x7e72('0x18'));}}catch(_0x3bc8af){logger[_0x7e72('0x3b')](_0x7e72('0x75'),_0x1c97ac[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x3bc8af,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')]['syncQueueCallerAbandon']=function(_0x55df81){try{if(this['isNotNull'](_0x55df81)){logger[_0x7e72('0x44')]('[%s][voiceQueueReport][queuecallerabandon]',_0x55df81[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x55df81,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x55df81[_0x7e72('0x47')]]){var _0x5a6432=_[_0x7e72('0x81')](this['queueReports'][_0x55df81[_0x7e72('0x47')]]);_0x5a6432[_0x7e72('0x82')]=![];_0x5a6432['queuecallercompleteAt']=null;_0x5a6432[_0x7e72('0x83')]=_0x55df81[_0x7e72('0x83')];_0x5a6432[_0x7e72('0x84')]=_0x55df81[_0x7e72('0x84')];_0x5a6432['queuecallerabandon']=!![];_0x5a6432['queuecallerabandonAt']=moment()[_0x7e72('0x4b')](_0x7e72('0x77'));_0x5a6432['queuecallerexitreason']=_0x7e72('0x85');_0x5a6432['lastAssignedTo']=null;logger[_0x7e72('0x6b')](_0x7e72('0x86'),_0x5a6432[_0x7e72('0x48')],_0x5a6432[_0x7e72('0x4f')]);this[_0x7e72('0xf')][_0x55df81['uniqueid']]=_0x5a6432;this[_0x7e72('0x41')](_0x5a6432,_0x7e72('0x87'));}}}catch(_0x347699){logger['error'](_0x7e72('0x88'),_0x55df81[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x347699,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')][_0x7e72('0x1b')]=function(_0x6d8ad0){try{if(this[_0x7e72('0x68')](_0x6d8ad0)){logger[_0x7e72('0x44')]('[%s][voiceQueueReport][queuecallerleave]',_0x6d8ad0[_0x7e72('0x47')],util['inspect'](_0x6d8ad0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x6d8ad0[_0x7e72('0x47')]]){var _0x460aa3=_['last'](this[_0x7e72('0xd')][_0x6d8ad0[_0x7e72('0x47')]]);_0x460aa3[_0x7e72('0x89')]=moment()['format'](_0x7e72('0x77'));_0x460aa3['connectedlinenum']=_0x6d8ad0[_0x7e72('0x8a')];_0x460aa3[_0x7e72('0x8b')]=_0x6d8ad0['connectedlinename'];logger[_0x7e72('0x6b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x460aa3['name'],_0x460aa3[_0x7e72('0x4f')],_0x6d8ad0[_0x7e72('0x8a')],_0x6d8ad0[_0x7e72('0x8b')]);this[_0x7e72('0xf')][_0x6d8ad0[_0x7e72('0x47')]]=_0x460aa3;this[_0x7e72('0x80')](_0x460aa3,_0x7e72('0x8c'));}}}catch(_0x598599){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x6d8ad0[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x598599,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')][_0x7e72('0x1f')]=function(_0x47291d){try{if(this[_0x7e72('0x68')](_0x47291d)){logger[_0x7e72('0x44')](_0x7e72('0x8d'),_0x47291d[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x47291d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x47291d[_0x7e72('0x47')]]){var _0xc88823=_[_0x7e72('0x81')](this['queueReports'][_0x47291d[_0x7e72('0x47')]]);_0xc88823['queuecallercomplete']=!![];_0xc88823[_0x7e72('0x8e')]=_0x7e72('0x8f');logger[_0x7e72('0x6b')](_0x7e72('0x90'),_0xc88823[_0x7e72('0x48')],_0xc88823['type']);}}}catch(_0x2e1ac6){logger['error'](_0x7e72('0x8d'),_0x47291d[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x2e1ac6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')]['syncAgentComplete']=function(_0x33655d){try{if(this[_0x7e72('0x68')](_0x33655d)){logger[_0x7e72('0x44')](_0x7e72('0x91'),_0x33655d[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x33655d,{'showHidden':![],'depth':null}));if(this[_0x7e72('0xd')][_0x33655d[_0x7e72('0x47')]]){var _0x13e1de=_['last'](this[_0x7e72('0xd')][_0x33655d[_0x7e72('0x47')]]);_0x13e1de[_0x7e72('0x87')]=![];_0x13e1de[_0x7e72('0x92')]=null;_0x13e1de[_0x7e72('0x93')]=!![];_0x13e1de[_0x7e72('0x94')]=_0x33655d[_0x7e72('0x95')];_0x13e1de[_0x7e72('0x83')]=_0x33655d['holdtime'];_0x13e1de[_0x7e72('0x82')]=!![];_0x13e1de[_0x7e72('0x96')]=![];_0x13e1de[_0x7e72('0x97')]=null;if(!_0x13e1de[_0x7e72('0x98')]){if(_0x33655d['reason']==_0x7e72('0x98')){_0x13e1de[_0x7e72('0x8e')]=_0x7e72('0x99');logger[_0x7e72('0x6b')](_0x7e72('0x9a'),_0x13e1de['name'],_0x13e1de[_0x7e72('0x4f')]);}else{if(_['startsWith'](_0x33655d['channel'][_0x7e72('0x9b')](),_0x7e72('0x9c'))){if(this[_0x7e72('0xd')][_0x33655d[_0x7e72('0x9d')]]){var _0x4d8539=_[_0x7e72('0x81')](this[_0x7e72('0xd')][_0x33655d[_0x7e72('0x9d')]]);_0x4d8539['queuecallercomplete']=![];_0x4d8539[_0x7e72('0x96')]=!![];_0x4d8539[_0x7e72('0x97')]=moment(_0x13e1de[_0x7e72('0x76')])[_0x7e72('0x9e')](_0x33655d[_0x7e72('0x83')],'seconds')[_0x7e72('0x4b')](_0x7e72('0x77'));_0x4d8539['queuecallerexitreason']='FORWARDTRANSFER';_0x4d8539['transfer']=!![];_0x4d8539[_0x7e72('0x9f')]='FORWARD';_0x4d8539['transferexten']=_0x33655d['destexten'];_0x4d8539['transferuniqueid']=_0x33655d[_0x7e72('0x47')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4d8539[_0x7e72('0x48')],_0x4d8539['type']);var _0x344c79=this['queueReports'][_0x33655d[_0x7e72('0x9d')]];this['queueReports'][_0x33655d[_0x7e72('0x9d')]]=this[_0x7e72('0xd')][_0x33655d[_0x7e72('0x47')]];this[_0x7e72('0xd')][_0x33655d['uniqueid']]=_0x344c79;}}else{_0x13e1de[_0x7e72('0x8e')]=_0x7e72('0xa0')+_0x33655d[_0x7e72('0xa1')][_0x7e72('0xa2')]();logger[_0x7e72('0x6b')](_0x7e72('0xa3'),_0x13e1de[_0x7e72('0x48')],_0x13e1de['type'],_0x13e1de['queuecallerexitreason']);}}}this[_0x7e72('0xf')][_0x33655d['uniqueid']]=_0x13e1de;this[_0x7e72('0x41')](_0x13e1de,_0x7e72('0x1c'));}}}catch(_0x194f9b){logger[_0x7e72('0x3b')](_0x7e72('0x91'),_0x33655d['uniqueid'],util[_0x7e72('0x3d')](_0x194f9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7e72('0x21')]=function(_0x56fdad){try{if(this[_0x7e72('0x68')](_0x56fdad)){logger[_0x7e72('0x44')]('[%s][voiceQueueReport][varset]',_0x56fdad[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x56fdad,{'showHidden':![],'depth':null}));this[_0x7e72('0xa4')](_0x56fdad[_0x7e72('0x47')],_[_0x7e72('0x7e')](_0x56fdad[_0x7e72('0xa5')])[0x0],_0x56fdad[_0x7e72('0xa6')]);if(this[_0x7e72('0xd')][_0x56fdad[_0x7e72('0x47')]]){var _0x411c33=_[_0x7e72('0x81')](this['queueReports'][_0x56fdad[_0x7e72('0x47')]]);if(_0x411c33){if(this[_0x7e72('0x68')](_0x56fdad[_0x7e72('0xa5')])&&this[_0x7e72('0x68')](_0x56fdad['variable']['queuestatus'])){switch(_0x56fdad['value']){case _0x7e72('0xa7'):_0x411c33[_0x7e72('0x96')]=![];_0x411c33[_0x7e72('0x97')]=null;break;case'TIMEOUT':_0x411c33[_0x7e72('0xa8')]=_0x7e72('0xa9');_0x411c33[_0x7e72('0x96')]=!![];_0x411c33['queuecallerexitAt']=moment()[_0x7e72('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x411c33['queuecallerleaveAt']=moment()['format'](_0x7e72('0x77'));logger[_0x7e72('0x44')](_0x7e72('0xaa'),_0x56fdad[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x411c33,{'showHidden':![],'depth':null}));ami[_0x7e72('0x43')](_0x7e72('0xab'),_0x411c33);break;default:_0x411c33[_0x7e72('0x96')]=!![];_0x411c33['queuecallerexitAt']=moment()['format'](_0x7e72('0x77'));_0x411c33[_0x7e72('0x89')]=moment()[_0x7e72('0x4b')](_0x7e72('0x77'));}_0x411c33['queuecallerabandon']=![];_0x411c33[_0x7e72('0x92')]=null;_0x411c33[_0x7e72('0x8e')]=_0x56fdad[_0x7e72('0xa6')];this[_0x7e72('0xf')][_0x56fdad[_0x7e72('0x47')]]=_0x411c33;this[_0x7e72('0x41')](_0x411c33,_0x7e72('0x20'));}else if(this['isNotNull'](_0x56fdad[_0x7e72('0xa5')])&&this['isNotNull'](_0x56fdad['variable'][_0x7e72('0xac')])){if(!_0x411c33[_0x7e72('0x87')]){_0x411c33[_0x7e72('0x96')]=!![];_0x411c33['queuecallerexitAt']=moment()['format'](_0x7e72('0x77'));_0x411c33[_0x7e72('0x8e')]='EXITWITHKEY';_0x411c33['queuecallerleaveAt']=moment()[_0x7e72('0x4b')](_0x7e72('0x77'));this[_0x7e72('0xf')][_0x56fdad[_0x7e72('0x47')]]=_0x411c33;}}logger[_0x7e72('0x6b')](_0x7e72('0xad'),_0x56fdad[_0x7e72('0x47')],_0x411c33[_0x7e72('0x48')],_0x411c33[_0x7e72('0x4f')],_[_0x7e72('0x7e')](_0x56fdad[_0x7e72('0xa5')])[0x0],_0x56fdad[_0x7e72('0xa6')]);_0x411c33[_0x7e72('0x14')]=this[_0x7e72('0x14')][_0x56fdad[_0x7e72('0x47')]];}}}}catch(_0x384011){logger[_0x7e72('0x3b')]('[%s][voiceQueueReport][varset]',_0x56fdad[_0x7e72('0x47')],util[_0x7e72('0x3d')](_0x384011,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e72('0x9')]['addVariable']=function(_0x54fd04,_0x43f43e,_0x3a2114){var _0x4d3822=[_0x7e72('0xae'),_0x7e72('0xaf'),_0x7e72('0xb0'),_0x7e72('0xb1'),_0x7e72('0xb2'),_0x7e72('0xb3'),_0x7e72('0xb4'),_0x7e72('0xb5'),_0x7e72('0xb6'),_0x7e72('0xb7'),'bridgepeer',_0x7e72('0xb8'),'membercalls',_0x7e72('0xb9'),_0x7e72('0xba'),_0x7e72('0xbb'),_0x7e72('0x95'),_0x7e72('0xbc'),'memberrealtime'];if(!_[_0x7e72('0x36')](_0x43f43e)&&!_[_0x7e72('0xbd')](_0x4d3822,_0x43f43e)){if(_[_0x7e72('0x62')](this[_0x7e72('0x14')][_0x54fd04])){this[_0x7e72('0x14')][_0x54fd04]={};}this['variables'][_0x54fd04][_0x43f43e]=_0x3a2114;}};VoiceQueueReport[_0x7e72('0x9')][_0x7e72('0xbe')]=function(_0x158b05){try{if(this[_0x7e72('0x68')](_0x158b05)){logger[_0x7e72('0x44')](_0x7e72('0xbf'),_0x158b05['uniqueid'],util[_0x7e72('0x3d')](_0x158b05,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x158b05[_0x7e72('0x47')]]){for(var _0x2e73bc=0x0,_0x1a8b76={};_0x2e73bc0x0?_0x23d9e8:0x0;this['voiceQueues'][_0x129544['queue']]['talking']=this[_0x4b8b('0x12')][_0x129544[_0x4b8b('0x6b')]][_0x4b8b('0x32')]>_[_0x4b8b('0x71')](_0x129544[_0x4b8b('0x73')])?_['toNumber'](_0x129544[_0x4b8b('0x73')]):this[_0x4b8b('0x12')][_0x129544['queue']][_0x4b8b('0x32')];this[_0x4b8b('0x74')](this['voiceQueues'][_0x129544[_0x4b8b('0x6b')]],_0x4b8b('0x16'));}logger[_0x4b8b('0x4a')](_0x4b8b('0x75'),util[_0x4b8b('0x41')](this['voiceQueues'][_0x129544[_0x4b8b('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4b8b('0x76'),this[_0x4b8b('0x12')][_0x129544[_0x4b8b('0x6b')]]);}}}catch(_0x1244a7){logger[_0x4b8b('0x3f')](_0x4b8b('0x6a'),util[_0x4b8b('0x41')](_0x1244a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4b8b('0x35')][_0x4b8b('0x19')]=function(_0x3e773b){logger['debug'](_0x4b8b('0x77'),util['inspect'](_0x3e773b,{'showHidden':![],'depth':null}));this[_0x4b8b('0x13')]=!![];};VoiceQueueReport[_0x4b8b('0x35')][_0x4b8b('0x78')]=function(_0x550d11){try{if(this[_0x4b8b('0x65')](_0x550d11)){logger[_0x4b8b('0x4a')](_0x4b8b('0x79'),_0x550d11[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x550d11,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x4b8b('0x10')][_0x550d11[_0x4b8b('0x4d')]]))this[_0x4b8b('0x10')][_0x550d11[_0x4b8b('0x4d')]]=[];if(_[_0x4b8b('0x66')](this[_0x4b8b('0x37')][_0x550d11[_0x4b8b('0x4d')]]))this[_0x4b8b('0x37')][_0x550d11['uniqueid']]={};var _0x43e4c2=new QueueReport();_0x43e4c2['name']=_0x550d11[_0x4b8b('0x6b')];_0x43e4c2[_0x4b8b('0x56')]=this[_0x4b8b('0x12')][_0x43e4c2[_0x4b8b('0x53')]]&&this[_0x4b8b('0x12')][_0x43e4c2['name']][_0x4b8b('0x56')]?this[_0x4b8b('0x12')][_0x43e4c2[_0x4b8b('0x53')]]['type']||'inbound':_0x4b8b('0x57');_0x43e4c2[_0x4b8b('0x6b')]=_0x550d11[_0x4b8b('0x6b')];_0x43e4c2[_0x4b8b('0x7a')]=moment()['format'](_0x4b8b('0x7b'));_0x43e4c2[_0x4b8b('0x7c')]=_0x550d11[_0x4b8b('0x7c')];_0x43e4c2[_0x4b8b('0x7d')]=_0x550d11[_0x4b8b('0x7d')];_0x43e4c2[_0x4b8b('0x4d')]=_0x550d11['uniqueid'];_0x43e4c2[_0x4b8b('0x7e')]=this[_0x4b8b('0x37')][_0x550d11[_0x4b8b('0x4d')]][_0x4b8b('0x7e')];logger[_0x4b8b('0x6d')](_0x4b8b('0x7f'),_0x43e4c2[_0x4b8b('0x53')],_0x43e4c2[_0x4b8b('0x56')]);_[_0x4b8b('0x80')](_0x43e4c2,_['pick'](_0x550d11,_[_0x4b8b('0x81')](_0x43e4c2)));this['queueReports'][_0x550d11['uniqueid']]['push'](_0x43e4c2);this[_0x4b8b('0x37')][_0x550d11['uniqueid']]=_0x43e4c2;this[_0x4b8b('0x49')](_0x43e4c2,_0x4b8b('0x1a'));}}catch(_0xc81bc0){logger['error'](_0x4b8b('0x79'),_0x550d11[_0x4b8b('0x4d')],util['inspect'](_0xc81bc0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4b8b('0x1c')]=function(_0x1eb658){try{if(this[_0x4b8b('0x65')](_0x1eb658)){logger[_0x4b8b('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1eb658[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x1eb658,{'showHidden':![],'depth':null}));if(this[_0x4b8b('0x10')][_0x1eb658[_0x4b8b('0x4d')]]){var _0x4886cd=_['last'](this['queueReports'][_0x1eb658[_0x4b8b('0x4d')]]);_0x4886cd['queuecallercomplete']=![];_0x4886cd[_0x4b8b('0x82')]=null;_0x4886cd['holdtime']=_0x1eb658[_0x4b8b('0x83')];_0x4886cd[_0x4b8b('0x84')]=_0x1eb658[_0x4b8b('0x84')];_0x4886cd[_0x4b8b('0x1b')]=!![];_0x4886cd[_0x4b8b('0x85')]=moment()[_0x4b8b('0x4e')](_0x4b8b('0x7b'));_0x4886cd[_0x4b8b('0x86')]='ABANDONED';_0x4886cd[_0x4b8b('0x87')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4886cd[_0x4b8b('0x53')],_0x4886cd[_0x4b8b('0x56')]);this[_0x4b8b('0x37')][_0x1eb658[_0x4b8b('0x4d')]]=_0x4886cd;this[_0x4b8b('0x50')](_0x4886cd,_0x4b8b('0x1b'));}}}catch(_0x2907ce){logger['error'](_0x4b8b('0x88'),_0x1eb658['uniqueid'],util[_0x4b8b('0x41')](_0x2907ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4b8b('0x35')][_0x4b8b('0x1e')]=function(_0xb852f7){try{if(this[_0x4b8b('0x65')](_0xb852f7)){logger[_0x4b8b('0x4a')](_0x4b8b('0x89'),_0xb852f7[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0xb852f7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb852f7[_0x4b8b('0x4d')]]){var _0x3ab822=_[_0x4b8b('0x8a')](this['queueReports'][_0xb852f7['uniqueid']]);_0x3ab822[_0x4b8b('0x8b')]=moment()[_0x4b8b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ab822['connectedlinenum']=_0xb852f7[_0x4b8b('0x8c')];_0x3ab822['connectedlinename']=_0xb852f7[_0x4b8b('0x8d')];logger['info'](_0x4b8b('0x8e'),_0x3ab822[_0x4b8b('0x53')],_0x3ab822[_0x4b8b('0x56')],_0xb852f7[_0x4b8b('0x8c')],_0xb852f7[_0x4b8b('0x8d')]);this['channels'][_0xb852f7['uniqueid']]=_0x3ab822;this[_0x4b8b('0x49')](_0x3ab822,'queuecallerleave');}}}catch(_0x4d3b60){logger[_0x4b8b('0x3f')](_0x4b8b('0x89'),_0xb852f7[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x4d3b60,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4b8b('0x22')]=function(_0x3f4fc9){try{if(this[_0x4b8b('0x65')](_0x3f4fc9)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x3f4fc9[_0x4b8b('0x4d')],util['inspect'](_0x3f4fc9,{'showHidden':![],'depth':null}));if(this[_0x4b8b('0x10')][_0x3f4fc9[_0x4b8b('0x4d')]]){var _0x1204b4=_['last'](this['queueReports'][_0x3f4fc9['uniqueid']]);_0x1204b4['queuecallercomplete']=!![];_0x1204b4[_0x4b8b('0x86')]=_0x4b8b('0x8f');logger[_0x4b8b('0x6d')](_0x4b8b('0x90'),_0x1204b4[_0x4b8b('0x53')],_0x1204b4[_0x4b8b('0x56')]);}}}catch(_0x147e69){logger[_0x4b8b('0x3f')]('[%s][voiceQueueReport][agentconnect]',_0x3f4fc9[_0x4b8b('0x4d')],util['inspect'](_0x147e69,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4b8b('0x35')][_0x4b8b('0x20')]=function(_0x1dcde7){try{if(this[_0x4b8b('0x65')](_0x1dcde7)){logger[_0x4b8b('0x4a')]('[%s][voiceQueueReport][agentcomplete]',_0x1dcde7[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x1dcde7,{'showHidden':![],'depth':null}));if(this[_0x4b8b('0x10')][_0x1dcde7['uniqueid']]){var _0x337caa=_[_0x4b8b('0x8a')](this[_0x4b8b('0x10')][_0x1dcde7[_0x4b8b('0x4d')]]);_0x337caa[_0x4b8b('0x1b')]=![];_0x337caa['queuecallerabandonAt']=null;_0x337caa[_0x4b8b('0x91')]=!![];_0x337caa['lastAssignedTo']=_0x1dcde7[_0x4b8b('0x92')];_0x337caa['holdtime']=_0x1dcde7['holdtime'];_0x337caa[_0x4b8b('0x93')]=!![];_0x337caa[_0x4b8b('0x94')]=![];_0x337caa[_0x4b8b('0x95')]=null;if(!_0x337caa['transfer']){if(_0x1dcde7[_0x4b8b('0x96')]==_0x4b8b('0x97')){_0x337caa[_0x4b8b('0x86')]=_0x4b8b('0x98');logger['info'](_0x4b8b('0x99'),_0x337caa[_0x4b8b('0x53')],_0x337caa[_0x4b8b('0x56')]);}else{if(_[_0x4b8b('0x9a')](_0x1dcde7[_0x4b8b('0x3b')][_0x4b8b('0x9b')](),_0x4b8b('0x9c'))){if(this['queueReports'][_0x1dcde7['linkedid']]){var _0x2ab8cc=_[_0x4b8b('0x8a')](this['queueReports'][_0x1dcde7[_0x4b8b('0x9d')]]);_0x2ab8cc[_0x4b8b('0x93')]=![];_0x2ab8cc[_0x4b8b('0x94')]=!![];_0x2ab8cc[_0x4b8b('0x95')]=moment(_0x337caa[_0x4b8b('0x7a')])[_0x4b8b('0x9e')](_0x1dcde7[_0x4b8b('0x83')],_0x4b8b('0x9f'))[_0x4b8b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ab8cc[_0x4b8b('0x86')]=_0x4b8b('0xa0');_0x2ab8cc[_0x4b8b('0x97')]=!![];_0x2ab8cc[_0x4b8b('0xa1')]=_0x4b8b('0xa2');_0x2ab8cc['transferexten']=_0x1dcde7[_0x4b8b('0xa3')];_0x2ab8cc[_0x4b8b('0xa4')]=_0x1dcde7[_0x4b8b('0x4d')];logger[_0x4b8b('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2ab8cc[_0x4b8b('0x53')],_0x2ab8cc[_0x4b8b('0x56')]);var _0x123b2f=this[_0x4b8b('0x10')][_0x1dcde7[_0x4b8b('0x9d')]];this['queueReports'][_0x1dcde7[_0x4b8b('0x9d')]]=this[_0x4b8b('0x10')][_0x1dcde7[_0x4b8b('0x4d')]];this['queueReports'][_0x1dcde7[_0x4b8b('0x4d')]]=_0x123b2f;}}else{_0x337caa[_0x4b8b('0x86')]='COMPLETEDBY'+_0x1dcde7[_0x4b8b('0x96')][_0x4b8b('0xa5')]();logger[_0x4b8b('0x6d')](_0x4b8b('0xa6'),_0x337caa['name'],_0x337caa['type'],_0x337caa[_0x4b8b('0x86')]);}}}this['channels'][_0x1dcde7[_0x4b8b('0x4d')]]=_0x337caa;this[_0x4b8b('0x50')](_0x337caa,_0x4b8b('0x1f'));}}}catch(_0xa8e724){logger['error'](_0x4b8b('0xa7'),_0x1dcde7[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0xa8e724,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4b8b('0x35')]['syncVarSet']=function(_0x120704){try{if(this['isNotNull'](_0x120704)){logger[_0x4b8b('0x4a')]('[%s][voiceQueueReport][varset]',_0x120704[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x120704,{'showHidden':![],'depth':null}));this[_0x4b8b('0xa8')](_0x120704[_0x4b8b('0x4d')],_['keys'](_0x120704['variable'])[0x0],_0x120704[_0x4b8b('0xa9')]);if(this[_0x4b8b('0x10')][_0x120704['uniqueid']]){var _0x1a5674=_[_0x4b8b('0x8a')](this[_0x4b8b('0x10')][_0x120704[_0x4b8b('0x4d')]]);if(_0x1a5674){if(this['isNotNull'](_0x120704['variable'])&&this[_0x4b8b('0x65')](_0x120704[_0x4b8b('0xaa')][_0x4b8b('0xab')])){switch(_0x120704['value']){case'CONTINUE':_0x1a5674['queuecallerexit']=![];_0x1a5674[_0x4b8b('0x95')]=null;break;case _0x4b8b('0xac'):_0x1a5674['lastevent']='timeout';_0x1a5674['queuecallerexit']=!![];_0x1a5674[_0x4b8b('0x95')]=moment()[_0x4b8b('0x4e')](_0x4b8b('0x7b'));_0x1a5674[_0x4b8b('0x8b')]=moment()['format'](_0x4b8b('0x7b'));logger[_0x4b8b('0x4a')](_0x4b8b('0xad'),_0x120704[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x1a5674,{'showHidden':![],'depth':null}));ami[_0x4b8b('0x48')](_0x4b8b('0xae'),_0x1a5674);break;default:_0x1a5674['queuecallerexit']=!![];_0x1a5674[_0x4b8b('0x95')]=moment()[_0x4b8b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a5674[_0x4b8b('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1a5674['queuecallerabandon']=![];_0x1a5674[_0x4b8b('0x85')]=null;_0x1a5674[_0x4b8b('0x86')]=_0x120704[_0x4b8b('0xa9')];this['channels'][_0x120704[_0x4b8b('0x4d')]]=_0x1a5674;this['emitVoiceQueueChannelRemove'](_0x1a5674,_0x4b8b('0xaf'));}else if(this[_0x4b8b('0x65')](_0x120704[_0x4b8b('0xaa')])&&this[_0x4b8b('0x65')](_0x120704[_0x4b8b('0xaa')][_0x4b8b('0xb0')])){if(!_0x1a5674[_0x4b8b('0x1b')]){_0x1a5674['queuecallerexit']=!![];_0x1a5674['queuecallerexitAt']=moment()['format'](_0x4b8b('0x7b'));_0x1a5674[_0x4b8b('0x86')]=_0x4b8b('0xb1');_0x1a5674[_0x4b8b('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x4b8b('0x37')][_0x120704['uniqueid']]=_0x1a5674;}}logger[_0x4b8b('0x6d')](_0x4b8b('0xb2'),_0x120704['uniqueid'],_0x1a5674[_0x4b8b('0x53')],_0x1a5674[_0x4b8b('0x56')],_[_0x4b8b('0x81')](_0x120704[_0x4b8b('0xaa')])[0x0],_0x120704[_0x4b8b('0xa9')]);_0x1a5674[_0x4b8b('0x15')]=this[_0x4b8b('0x15')][_0x120704[_0x4b8b('0x4d')]];}}}}catch(_0x130922){logger[_0x4b8b('0x3f')](_0x4b8b('0xb3'),_0x120704[_0x4b8b('0x4d')],util[_0x4b8b('0x41')](_0x130922,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4b8b('0x35')][_0x4b8b('0xa8')]=function(_0x1ce91b,_0x58c226,_0x9fc6a){var _0x278eb1=[_0x4b8b('0xb4'),_0x4b8b('0xb5'),_0x4b8b('0xb6'),_0x4b8b('0xb7'),_0x4b8b('0xb8'),_0x4b8b('0xb9'),_0x4b8b('0xba'),_0x4b8b('0xbb'),_0x4b8b('0xbc'),_0x4b8b('0xbd'),_0x4b8b('0xbe'),_0x4b8b('0xbf'),_0x4b8b('0xc0'),_0x4b8b('0xc1'),'memberinterface','memberlastcall','membername',_0x4b8b('0xc2'),_0x4b8b('0xc3')];if(!_[_0x4b8b('0xc4')](_0x58c226)&&!_[_0x4b8b('0xc5')](_0x278eb1,_0x58c226)){if(_['isUndefined'](this['variables'][_0x1ce91b])){this['variables'][_0x1ce91b]={};}this[_0x4b8b('0x15')][_0x1ce91b][_0x58c226]=_0x9fc6a;}};VoiceQueueReport[_0x4b8b('0x35')]['syncHangup']=function(_0x522d2d){try{if(this[_0x4b8b('0x65')](_0x522d2d)){logger[_0x4b8b('0x4a')](_0x4b8b('0xc6'),_0x522d2d['uniqueid'],util[_0x4b8b('0x41')](_0x522d2d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x522d2d[_0x4b8b('0x4d')]]){for(var _0x400550=0x0,_0x490d6e={};_0x400550=0x0?moment(_0x12e927[_0x5196('0x18')])[_0x5196('0x19')](_0x12e927[_0x5196('0x17')],_0x5196('0xd')):null,'data1':_0x5196('0x1a'),'data2':_0x12e927[_0x5196('0x13')],'data3':_0x12e927[_0x5196('0x10')],'data4':_0x12e927[_0x5196('0x1b')]||null,'role':'agent','internal':_0x12e927[_0x5196('0x13')]?_['toNumber'](_0x12e927[_0x5196('0x13')]):undefined,'uniqueid':_0x12e927[_0x5196('0x15')]},'log':_0x5196('0x6')});}; \ No newline at end of file +var _0xb951=['CreateMemberReport','voice','isNil','format','lastAssignedTo','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','queue','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','outbound','agent','lodash','util','../client','queuecallercompleteAt','Request'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xb951,0x133));var _0x1b95=function(_0x23fbef,_0x4e78b1){_0x23fbef=_0x23fbef-0x0;var _0x4d25bc=_0xb951[_0x23fbef];return _0x4d25bc;};'use strict';var moment=require('moment');var _=require(_0x1b95('0x0'));var util=require(_0x1b95('0x1'));var client=require(_0x1b95('0x2'));exports['voiceQueueReport']=function(_0x2b0eb8){var _0x474a4e=_0x2b0eb8[_0x1b95('0x3')]||_0x2b0eb8['queuecallerexitAt'];return client[_0x1b95('0x4')](_0x1b95('0x5'),{'body':{'channel':_0x1b95('0x6'),'membername':_0x2b0eb8['lastAssignedTo'],'interface':_[_0x1b95('0x7')](_0x2b0eb8['interface'])?util[_0x1b95('0x8')]('SIP/%s',_0x2b0eb8[_0x1b95('0x9')]):_0x2b0eb8[_0x1b95('0xa')],'type':_0x1b95('0xb'),'enterAt':_0x2b0eb8[_0x1b95('0xc')],'exitAt':_0x474a4e,'duration':moment(_0x474a4e)[_0x1b95('0xd')](_0x2b0eb8[_0x1b95('0xc')],_0x1b95('0xe')),'data1':_0x1b95('0xf'),'data2':_0x2b0eb8[_0x1b95('0x10')],'data3':_0x2b0eb8['exten'],'data4':null,'data5':_0x2b0eb8[_0x1b95('0x11')],'role':'agent','internal':_0x2b0eb8[_0x1b95('0x12')]?_[_0x1b95('0x13')](_0x2b0eb8[_0x1b95('0x12')]):undefined,'uniqueid':_0x2b0eb8[_0x1b95('0x14')]},'log':_0x1b95('0x5')});};exports[_0x1b95('0x15')]=function(_0x24ea0d){return client[_0x1b95('0x4')](_0x1b95('0x5'),{'body':{'channel':'voice','membername':_0x24ea0d['membername'],'interface':_0x24ea0d[_0x1b95('0xa')],'type':'TALKING','enterAt':_0x24ea0d[_0x1b95('0x16')],'exitAt':_0x24ea0d[_0x1b95('0x17')],'duration':moment(_0x24ea0d[_0x1b95('0x17')])[_0x1b95('0xd')](_0x24ea0d['starttime'],_0x1b95('0xe'))>=0x0?moment(_0x24ea0d['endtime'])[_0x1b95('0xd')](_0x24ea0d[_0x1b95('0x16')],_0x1b95('0xe')):null,'data1':_0x1b95('0x18'),'data2':_0x24ea0d[_0x1b95('0x12')],'data3':_0x24ea0d['exten'],'data4':_0x24ea0d['dialstring']||null,'role':_0x1b95('0x19'),'internal':_0x24ea0d[_0x1b95('0x12')]?_[_0x1b95('0x13')](_0x24ea0d[_0x1b95('0x12')]):undefined,'uniqueid':_0x24ea0d[_0x1b95('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 95d5ae7..bebdca3 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 _0xd9b4=['GetSettings','../client','getSettings'];(function(_0x15a099,_0x4eb0c1){var _0x8f248c=function(_0x4e4153){while(--_0x4e4153){_0x15a099['push'](_0x15a099['shift']());}};_0x8f248c(++_0x4eb0c1);}(_0xd9b4,0x1f0));var _0x4d9b=function(_0x56f918,_0xa2096f){_0x56f918=_0x56f918-0x0;var _0x165d3f=_0xd9b4[_0x56f918];return _0x165d3f;};'use strict';var client=require(_0x4d9b('0x0'));exports[_0x4d9b('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x4d9b('0x2')});}; \ No newline at end of file +var _0xd2bf=['../client','stopRecordingOnTransfer','GetSettings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0xd2bf[_0x29c3b2];return _0x4b3aa7;};'use strict';var client=require(_0xfd2b('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfd2b('0x1')]},'log':_0xfd2b('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 136a330..e092d9a 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 _0x33a5=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x400ce4,_0x488faa){var _0x368332=function(_0x408bd6){while(--_0x408bd6){_0x400ce4['push'](_0x400ce4['shift']());}};_0x368332(++_0x488faa);}(_0x33a5,0x125));var _0x533a=function(_0x3ba1c6,_0x2c05b8){_0x3ba1c6=_0x3ba1c6-0x0;var _0x43e6b3=_0x33a5[_0x3ba1c6];return _0x43e6b3;};'use strict';var client=require(_0x533a('0x0'));exports[_0x533a('0x1')]=function(_0x8f8e1c){return function(_0x247378){return client[_0x533a('0x2')](_0x533a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x533a('0x4'),_0x533a('0x5')]},'log':_0x533a('0x3')});};}; \ No newline at end of file +var _0xfb70=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0xe57cbe,_0x4592a3){var _0x5923bb=function(_0x1af7bc){while(--_0x1af7bc){_0xe57cbe['push'](_0xe57cbe['shift']());}};_0x5923bb(++_0x4592a3);}(_0xfb70,0x150));var _0x0fb7=function(_0x48f054,_0x583a8b){_0x48f054=_0x48f054-0x0;var _0x5a72ae=_0xfb70[_0x48f054];return _0x5a72ae;};'use strict';var client=require(_0x0fb7('0x0'));exports[_0x0fb7('0x1')]=function(_0x35ccb9){return function(_0x1765e1){return client[_0x0fb7('0x2')](_0x0fb7('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0fb7('0x4'),_0x0fb7('0x5')]},'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 96956a6..429baa9 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 _0x498e=['data6','data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','action','data1','data2','data4'];(function(_0x42764d,_0x332a27){var _0x2a643c=function(_0x54dfcf){while(--_0x54dfcf){_0x42764d['push'](_0x42764d['shift']());}};_0x2a643c(++_0x332a27);}(_0x498e,0xd3));var _0xe498=function(_0x2578b9,_0x411047){_0x2578b9=_0x2578b9-0x0;var _0x4a8529=_0x498e[_0x2578b9];return _0x4a8529;};'use strict';var client=require(_0xe498('0x0'));exports[_0xe498('0x1')]=function(_0x58f1d5){return function(_0x1bf1cb){return client[_0xe498('0x2')](_0xe498('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe498('0x4'),_0xe498('0x5')],'include':[{'model':_0xe498('0x6'),'as':_0xe498('0x7'),'attributes':['id','field',_0xe498('0x8'),_0xe498('0x9')]},{'model':_0xe498('0x6'),'as':_0xe498('0xa'),'attributes':['id',_0xe498('0xb'),'operator',_0xe498('0x9')]},{'model':_0xe498('0xc'),'as':'Actions','attributes':['id',_0xe498('0xd'),_0xe498('0xe'),_0xe498('0xf'),'data3',_0xe498('0x10'),'data5',_0xe498('0x11'),_0xe498('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x43a9=['name','channel','Condition','AllConditions','field','operator','value','AnyConditions','data1','data2','data3','data4','data5','data6','data7','GetTrigger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43a9,0x1c0));var _0x943a=function(_0x531a72,_0x102550){_0x531a72=_0x531a72-0x0;var _0x7f114e=_0x43a9[_0x531a72];return _0x7f114e;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x81bb4c){return function(_0x105215){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x943a('0x0'),_0x943a('0x1'),'status'],'include':[{'model':_0x943a('0x2'),'as':_0x943a('0x3'),'attributes':['id',_0x943a('0x4'),_0x943a('0x5'),_0x943a('0x6')]},{'model':_0x943a('0x2'),'as':_0x943a('0x7'),'attributes':['id',_0x943a('0x4'),'operator',_0x943a('0x6')]},{'model':'Action','as':'Actions','attributes':['id','action',_0x943a('0x8'),_0x943a('0x9'),_0x943a('0xa'),_0x943a('0xb'),_0x943a('0xc'),_0x943a('0xd'),_0x943a('0xe')]}]},'log':_0x943a('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 825d754..835c461 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 _0x338e=['getTrunks','GetTrunk','name','registry','defaultuser','../client'];(function(_0x3c2f12,_0x209cf4){var _0xdfc32a=function(_0x35b582){while(--_0x35b582){_0x3c2f12['push'](_0x3c2f12['shift']());}};_0xdfc32a(++_0x209cf4);}(_0x338e,0x137));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe338('0x0'));exports[_0xe338('0x1')]=function(_0x31b33e){return function(_0x3e805e){return client['Request'](_0xe338('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe338('0x3'),_0xe338('0x4'),_0xe338('0x5')]},'log':_0xe338('0x2')});};}; \ No newline at end of file +var _0xd59a=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x1d817d,_0x2bca39){var _0x4e524d=function(_0x38f64a){while(--_0x38f64a){_0x1d817d['push'](_0x1d817d['shift']());}};_0x4e524d(++_0x2bca39);}(_0xd59a,0x17d));var _0xad59=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd59a[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0xad59('0x0'));exports[_0xad59('0x1')]=function(_0x1652dd){return function(_0x4288dd){return client['Request'](_0xad59('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xad59('0x3'),_0xad59('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4c42324..1e4ef51 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x3b7210,_0x11c01c){var _0x1b25a8=function(_0x25cb5f){while(--_0x25cb5f){_0x3b7210['push'](_0x3b7210['shift']());}};_0x1b25a8(++_0x11c01c);}(_0x70e0,0x17b));var _0x070e=function(_0x12f36d,_0x1e0130){_0x12f36d=_0x12f36d-0x0;var _0x35d6d6=_0x70e0[_0x12f36d];return _0x35d6d6;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _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(_0x511d97,_0x42a7b7){var _0x1c6d93=function(_0x5b36a4){while(--_0x5b36a4){_0x511d97['push'](_0x511d97['shift']());}};_0x1c6d93(++_0x42a7b7);}(_0x34e8,0x12c));var _0x834e=function(_0x526b14,_0x210ff2){_0x526b14=_0x526b14-0x0;var _0x56f33e=_0x34e8[_0x526b14];return _0x56f33e;};'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 ef719de..5dd72fe 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 _0x542d=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x36d1d8,_0x5135f6){var _0x22a038=function(_0x297f8b){while(--_0x297f8b){_0x36d1d8['push'](_0x36d1d8['shift']());}};_0x22a038(++_0x5135f6);}(_0x542d,0x133));var _0xd542=function(_0x1b3b54,_0x346188){_0x1b3b54=_0x1b3b54-0x0;var _0x4822e4=_0x542d[_0x1b3b54];return _0x4822e4;};'use strict';var client=require(_0xd542('0x0'));exports[_0xd542('0x1')]=function(_0x57d331){return client['Request'](_0xd542('0x2'),{'body':_0x57d331,'log':'CreateVoiceAgentReport'});};exports[_0xd542('0x3')]=function(_0x246098,_0x4e18b0,_0x373197){return client[_0xd542('0x4')](_0xd542('0x5'),{'body':_0x246098,'options':{'where':{'uniqueid':_0x4e18b0,'interface':_0x373197,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xc9cb=['../client','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0xc9cb,0x1c0));var _0xbc9c=function(_0x40363a,_0x13f568){_0x40363a=_0x40363a-0x0;var _0x4d0ca2=_0xc9cb[_0x40363a];return _0x4d0ca2;};'use strict';var client=require(_0xbc9c('0x0'));exports['create']=function(_0x4a6064){return client[_0xbc9c('0x1')](_0xbc9c('0x2'),{'body':_0x4a6064,'log':_0xbc9c('0x2')});};exports['update']=function(_0x4cb483,_0x5b5445,_0x9b5e92){return client['Request'](_0xbc9c('0x3'),{'body':_0x4cb483,'options':{'where':{'uniqueid':_0x5b5445,'interface':_0x9b5e92,'agentcomplete':!![]}},'log':_0xbc9c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 1b5910c..c1f3335 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 _0x23b0=['Request','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','GetVoiceCallReports','util','lodash','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0x445e44,_0x2b3142){var _0x2710dc=function(_0x2b5676){while(--_0x2b5676){_0x445e44['push'](_0x445e44['shift']());}};_0x2710dc(++_0x2b3142);}(_0x23b0,0x1ad));var _0x023b=function(_0x589478,_0x14303b){_0x589478=_0x589478-0x0;var _0x353564=_0x23b0[_0x589478];return _0x353564;};'use strict';var moment=require('moment');var util=require(_0x023b('0x0'));var _=require(_0x023b('0x1'));var client=require('../client');exports['create']=function(_0x122f2b){return client['Request']('CreateVoiceCallReport',{'body':_['merge'](_0x122f2b,{'source':_0x122f2b[_0x023b('0x2')],'destinationcontext':_0x122f2b['context'],'callerid':_0x122f2b[_0x023b('0x3')],'amaflags':_0x023b('0x4')}),'log':'CreateVoiceCallReport'});};exports[_0x023b('0x5')]=function(){return function(){return client[_0x023b('0x6')](_0x023b('0x7'),{'options':{'where':{'type':[_0x023b('0x8')],'createdAt':{'$between':[moment()['startOf']('day')[_0x023b('0x9')](_0x023b('0xa')),moment()[_0x023b('0xb')]('day')[_0x023b('0x9')](_0x023b('0xa'))]}},'attributes':[_0x023b('0xc'),_0x023b('0xd'),'duration','billableseconds']},'log':_0x023b('0xe')});};}; \ No newline at end of file +var _0x0137=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION'];(function(_0x483a6e,_0x2eb203){var _0x4911fa=function(_0xc2edfd){while(--_0xc2edfd){_0x483a6e['push'](_0x483a6e['shift']());}};_0x4911fa(++_0x2eb203);}(_0x0137,0xc0));var _0x7013=function(_0x2a478e,_0x404251){_0x2a478e=_0x2a478e-0x0;var _0x51322c=_0x0137[_0x2a478e];return _0x51322c;};'use strict';var moment=require('moment');var util=require(_0x7013('0x0'));var _=require('lodash');var client=require(_0x7013('0x1'));exports[_0x7013('0x2')]=function(_0x346031){return client[_0x7013('0x3')](_0x7013('0x4'),{'body':_[_0x7013('0x5')](_0x346031,{'source':_0x346031[_0x7013('0x6')],'destinationcontext':_0x346031['context'],'callerid':_0x346031['callerid'],'amaflags':_0x7013('0x7')}),'log':_0x7013('0x4')});};exports[_0x7013('0x8')]=function(){return function(){return client[_0x7013('0x3')](_0x7013('0x9'),{'options':{'where':{'type':[_0x7013('0xa')],'createdAt':{'$between':[moment()[_0x7013('0xb')]('day')[_0x7013('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x7013('0xd'))[_0x7013('0xc')](_0x7013('0xe'))]}},'attributes':[_0x7013('0xf'),_0x7013('0x10'),_0x7013('0x11'),_0x7013('0x12')]},'log':_0x7013('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c194ed0..2ad2b44 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 _0xc8c1=['Request','CreateVoiceDialReport','../client'];(function(_0x29431a,_0x3bef0b){var _0x4e3451=function(_0x4db323){while(--_0x4db323){_0x29431a['push'](_0x29431a['shift']());}};_0x4e3451(++_0x3bef0b);}(_0xc8c1,0x101));var _0x1c8c=function(_0x287e9a,_0x37b569){_0x287e9a=_0x287e9a-0x0;var _0xa03521=_0xc8c1[_0x287e9a];return _0xa03521;};'use strict';var client=require(_0x1c8c('0x0'));exports['create']=function(_0x42e518){return client[_0x1c8c('0x1')](_0x1c8c('0x2'),{'body':_0x42e518,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x10ac=['create','Request','CreateVoiceDialReport','../client'];(function(_0x48cbee,_0x1113a8){var _0x4322e5=function(_0x2372f0){while(--_0x2372f0){_0x48cbee['push'](_0x48cbee['shift']());}};_0x4322e5(++_0x1113a8);}(_0x10ac,0xbb));var _0xc10a=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x10ac[_0x40220a];return _0x3903cc;};'use strict';var client=require(_0xc10a('0x0'));exports[_0xc10a('0x1')]=function(_0xd86521){return client[_0xc10a('0x2')](_0xc10a('0x3'),{'body':_0xd86521,'log':_0xc10a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3bb5a7e..fb539ed 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 _0x58e5=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x1a7cf5,_0x24c34a){var _0x39ca1f=function(_0x5217e3){while(--_0x5217e3){_0x1a7cf5['push'](_0x1a7cf5['shift']());}};_0x39ca1f(++_0x24c34a);}(_0x58e5,0xd1));var _0x558e=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x58e5[_0x51c819];return _0x15c5d2;};'use strict';var client=require(_0x558e('0x0'));exports[_0x558e('0x1')]=function(){return function(){return client[_0x558e('0x2')](_0x558e('0x3'),{'options':{'raw':!![],'attributes':['id',_0x558e('0x4'),_0x558e('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x22fb=['recordingFormat','getVoiceExtensions','Request','exten'];(function(_0x3b4d20,_0x467664){var _0x20e29f=function(_0x299b1c){while(--_0x299b1c){_0x3b4d20['push'](_0x3b4d20['shift']());}};_0x20e29f(++_0x467664);}(_0x22fb,0x192));var _0xb22f=function(_0xc3c921,_0x55846e){_0xc3c921=_0xc3c921-0x0;var _0x557f1a=_0x22fb[_0xc3c921];return _0x557f1a;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xb22f('0x0')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb22f('0x1'),_0xb22f('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xb22f('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b96449a..d3b419f 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 _0xe928=['dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0xe928,0x145));var _0x8e92=function(_0x4e4c5a,_0x34f306){_0x4e4c5a=_0x4e4c5a-0x0;var _0x193b18=_0xe928[_0x4e4c5a];return _0x193b18;};'use strict';var client=require(_0x8e92('0x0'));exports[_0x8e92('0x1')]=function(){return function(){return client[_0x8e92('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x8e92('0x3'),'acw',_0x8e92('0x4'),_0x8e92('0x5'),_0x8e92('0x6'),_0x8e92('0x7'),'dialActive',_0x8e92('0x8'),'dialLimitChannel',_0x8e92('0x9'),_0x8e92('0xa'),_0x8e92('0xb'),_0x8e92('0xc'),'dialPredictiveInterval',_0x8e92('0xd'),'dialOriginateCallerIdNumber',_0x8e92('0xe'),_0x8e92('0xf'),_0x8e92('0x10'),_0x8e92('0x11'),_0x8e92('0x12'),_0x8e92('0x13'),'dialBusyMaxRetry',_0x8e92('0x14'),_0x8e92('0x15'),_0x8e92('0x16'),'dialGlobalMaxRetry',_0x8e92('0x17'),_0x8e92('0x18'),_0x8e92('0x19'),_0x8e92('0x1a'),_0x8e92('0x1b'),_0x8e92('0x1c'),_0x8e92('0x1d'),'dialAMDAfterGreetingSilence',_0x8e92('0x1e'),'dialAMDMinWordLength',_0x8e92('0x1f'),_0x8e92('0x20'),'dialAMDSilenceThreshold',_0x8e92('0x21'),'timeout',_0x8e92('0x22'),_0x8e92('0x23'),_0x8e92('0x24'),_0x8e92('0x25'),_0x8e92('0x26'),_0x8e92('0x27'),_0x8e92('0x6'),_0x8e92('0x28'),'dialRandomLastDigitCallerIdNumber',_0x8e92('0x29'),_0x8e92('0x2a'),_0x8e92('0x2b'),_0x8e92('0x2c'),_0x8e92('0x2d'),'dialAbandonedMaxRetry',_0x8e92('0x2e'),_0x8e92('0x2f'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x8e92('0x30'),'dialPredictiveIntervalMaxThreshold',_0x8e92('0x31'),_0x8e92('0x32')],'include':[{'model':_0x8e92('0x33'),'as':_0x8e92('0x33'),'attributes':['id',_0x8e92('0x3'),_0x8e92('0x34'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x8e92('0x33'),'as':_0x8e92('0x35'),'attributes':['id',_0x8e92('0x3'),_0x8e92('0x34'),_0x8e92('0x36')]},{'model':_0x8e92('0x37'),'as':'Interval','attributes':['id',_0x8e92('0x3')],'include':[{'model':_0x8e92('0x37'),'as':_0x8e92('0x38'),'attributes':['id',_0x8e92('0x3'),_0x8e92('0x39')]}]}]},'log':_0x8e92('0x1')});};}; \ No newline at end of file +var _0xee55=['autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','../client','Request','name','acwTimeout'];(function(_0x23f66f,_0x599a8a){var _0x13051a=function(_0x155411){while(--_0x155411){_0x23f66f['push'](_0x23f66f['shift']());}};_0x13051a(++_0x599a8a);}(_0xee55,0x1a0));var _0x5ee5=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xee55[_0x111e94];return _0x3de107;};'use strict';var client=require(_0x5ee5('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x5ee5('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x5ee5('0x2'),'acw',_0x5ee5('0x3'),_0x5ee5('0x4'),'monitor_format',_0x5ee5('0x5'),_0x5ee5('0x6'),_0x5ee5('0x7'),_0x5ee5('0x8'),_0x5ee5('0x9'),_0x5ee5('0xa'),_0x5ee5('0xb'),'dialPredictiveOptimizationPercentage',_0x5ee5('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x5ee5('0xd'),'dialQueueOptions','dialQueueTimeout',_0x5ee5('0xe'),_0x5ee5('0xf'),_0x5ee5('0x10'),_0x5ee5('0x11'),'dialBusyRetryFrequency',_0x5ee5('0x12'),_0x5ee5('0x13'),_0x5ee5('0x14'),_0x5ee5('0x15'),'dialGlobalInterval','dialPrefix',_0x5ee5('0x16'),_0x5ee5('0x17'),_0x5ee5('0x18'),'dialAMDGreeting',_0x5ee5('0x19'),_0x5ee5('0x1a'),_0x5ee5('0x1b'),_0x5ee5('0x1c'),_0x5ee5('0x1d'),_0x5ee5('0x1e'),_0x5ee5('0x1f'),'timeout',_0x5ee5('0x20'),_0x5ee5('0x21'),_0x5ee5('0x22'),_0x5ee5('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0x5ee5('0x24'),_0x5ee5('0x25'),_0x5ee5('0x26'),'dialCutDigit',_0x5ee5('0x27'),'dialNoSuchNumberRetryFrequency',_0x5ee5('0x28'),'dialDropRetryFrequency',_0x5ee5('0x29'),_0x5ee5('0x2a'),_0x5ee5('0x2b'),_0x5ee5('0x2c'),_0x5ee5('0x2d'),_0x5ee5('0x2e'),_0x5ee5('0x2f'),_0x5ee5('0x30'),_0x5ee5('0x31'),_0x5ee5('0x32')],'include':[{'model':_0x5ee5('0x33'),'as':_0x5ee5('0x33'),'attributes':['id',_0x5ee5('0x2'),_0x5ee5('0x34'),_0x5ee5('0x35')]},{'model':_0x5ee5('0x36'),'as':_0x5ee5('0x37'),'attributes':['id',_0x5ee5('0x2')]},{'model':_0x5ee5('0x33'),'as':_0x5ee5('0x38'),'attributes':['id','name','callerid',_0x5ee5('0x35')]},{'model':_0x5ee5('0x39'),'as':_0x5ee5('0x39'),'attributes':['id','name'],'include':[{'model':_0x5ee5('0x39'),'as':'Intervals','attributes':['id',_0x5ee5('0x2'),_0x5ee5('0x3a')]}]}]},'log':_0x5ee5('0x3b')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 19192ea..842c897 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(_0x4ef443,_0x1e30e9){var _0x3bea94=function(_0x519757){while(--_0x519757){_0x4ef443['push'](_0x4ef443['shift']());}};_0x3bea94(++_0x1e30e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x10dd3d,_0x4d8f54){var _0x4b5a86=function(_0x58d3b1){while(--_0x58d3b1){_0x10dd3d['push'](_0x10dd3d['shift']());}};_0x4b5a86(++_0x4d8f54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 eb9fd26..ae50920 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 _0xe313=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe313,0x73));var _0x3e31=function(_0xd61bed,_0x3d5032){_0xd61bed=_0xd61bed-0x0;var _0x59ca05=_0xe313[_0xd61bed];return _0x59ca05;};'use strict';var client=require(_0x3e31('0x0'));exports[_0x3e31('0x1')]=function(_0x5e9a1a){return function(){return client[_0x3e31('0x2')](_0x3e31('0x3'),{'options':{'where':{'VoiceQueueId':_0x5e9a1a,'paused':!![]},'raw':!![]},'log':_0x3e31('0x1')});};}; \ No newline at end of file +var _0x288a=['getVoiceQueueRtPauses','Request','../client'];(function(_0x3877a5,_0x3ae916){var _0x2cc903=function(_0xb9a7a5){while(--_0xb9a7a5){_0x3877a5['push'](_0x3877a5['shift']());}};_0x2cc903(++_0x3ae916);}(_0x288a,0x71));var _0xa288=function(_0x5f1268,_0x244cb1){_0x5f1268=_0x5f1268-0x0;var _0x2b4d5c=_0x288a[_0x5f1268];return _0x2b4d5c;};'use strict';var client=require(_0xa288('0x0'));exports[_0xa288('0x1')]=function(_0x58d34f){return function(){return client[_0xa288('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x58d34f,'paused':!![]},'raw':!![]},'log':_0xa288('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c75ad3a..db1df9f 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1a09f3,_0x128f93){var _0x5d94fc=function(_0x2d0e9d){while(--_0x2d0e9d){_0x1a09f3['push'](_0x1a09f3['shift']());}};_0x5d94fc(++_0x128f93);}(_0x7a54,0x106));var _0x47a5=function(_0x39f7e7,_0x183d11){_0x39f7e7=_0x39f7e7-0x0;var _0x55053c=_0x7a54[_0x39f7e7];return _0x55053c;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1688ca,_0x2c3ee6){var _0x57fc50=function(_0x19f583){while(--_0x19f583){_0x1688ca['push'](_0x1688ca['shift']());}};_0x57fc50(++_0x2c3ee6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 7e2fc99..4a3af68 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 _0xf525=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','../client','transfers','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x111b45,_0x127ed2){var _0x5b6413=function(_0x34ca69){while(--_0x34ca69){_0x111b45['push'](_0x111b45['shift']());}};_0x5b6413(++_0x127ed2);}(_0xf525,0x153));var _0x5f52=function(_0x4ec9ef,_0x3ed6e2){_0x4ec9ef=_0x4ec9ef-0x0;var _0x20711d=_0xf525[_0x4ec9ef];return _0x20711d;};'use strict';var client=require(_0x5f52('0x0'));exports[_0x5f52('0x1')]={};exports['blindTransfer']=function(_0xc80ebc){return client[_0x5f52('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xc80ebc[_0x5f52('0x3')],'transfererchannel':_0xc80ebc[_0x5f52('0x4')],'transferercalleridnum':_0xc80ebc[_0x5f52('0x5')],'transferercalleridname':_0xc80ebc[_0x5f52('0x6')],'transfererconnectedlinenum':_0xc80ebc['transfererconnectedlinenum'],'transfererconnectedlinename':_0xc80ebc[_0x5f52('0x7')],'transfereraccountcode':_0xc80ebc[_0x5f52('0x8')],'transferercontext':_0xc80ebc['transferercontext'],'transfererexten':_0xc80ebc['transfererexten'],'transfererlinkedid':_0xc80ebc[_0x5f52('0x9')],'transfereechannel':_0xc80ebc[_0x5f52('0xa')],'transfereecalleridnum':_0xc80ebc['transfereecalleridnum'],'transfereecalleridname':_0xc80ebc[_0x5f52('0xb')],'transfereeconnectedlinenum':_0xc80ebc[_0x5f52('0xc')],'transfereeconnectedlinename':_0xc80ebc['transfereeconnectedlinename'],'transfereeaccountcode':_0xc80ebc[_0x5f52('0xd')],'transfereecontext':_0xc80ebc[_0x5f52('0xe')],'transfereeexten':_0xc80ebc[_0x5f52('0xf')],'transfereelinkedid':_0xc80ebc[_0x5f52('0x10')],'isexternal':_0xc80ebc['isexternal'],'context':_0xc80ebc[_0x5f52('0x11')],'extension':_0xc80ebc[_0x5f52('0x12')],'type':_0x5f52('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x2940f9){return client['Request'](_0x5f52('0x14'),{'body':{'result':_0x2940f9[_0x5f52('0x3')],'transfererchannel':_0x2940f9[_0x5f52('0x15')],'transferercalleridnum':_0x2940f9[_0x5f52('0x16')],'transferercalleridname':_0x2940f9[_0x5f52('0x17')],'transfererconnectedlinenum':_0x2940f9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2940f9['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2940f9['origtransfereraccountcode'],'transferercontext':_0x2940f9[_0x5f52('0x18')],'transfererexten':_0x2940f9['secondtransfererexten'],'transfererlinkedid':_0x2940f9['origtransfererlinkedid'],'transfereechannel':_0x2940f9[_0x5f52('0x19')],'transfereecalleridnum':_0x2940f9[_0x5f52('0x1a')],'transfereecalleridname':_0x2940f9[_0x5f52('0x1b')],'transfereeconnectedlinenum':_0x2940f9[_0x5f52('0x1c')],'transfereeconnectedlinename':_0x2940f9[_0x5f52('0x1d')],'transfereeaccountcode':_0x2940f9[_0x5f52('0x1e')],'transfereecontext':_0x2940f9[_0x5f52('0x1f')],'transfereeexten':_0x2940f9[_0x5f52('0x20')],'transfereelinkedid':_0x2940f9[_0x5f52('0x21')],'isexternal':_0x2940f9[_0x5f52('0x22')],'context':_0x2940f9[_0x5f52('0x23')],'extension':_0x2940f9[_0x5f52('0x24')],'type':'attended'},'log':_0x5f52('0x14')});}; \ No newline at end of file +var _0x0ca0=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0ca0,0x166));var _0x00ca=function(_0x4a3acb,_0x162a32){_0x4a3acb=_0x4a3acb-0x0;var _0xe58c9=_0x0ca0[_0x4a3acb];return _0xe58c9;};'use strict';var client=require(_0x00ca('0x0'));exports[_0x00ca('0x1')]={};exports[_0x00ca('0x2')]=function(_0x4223aa){return client[_0x00ca('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x4223aa[_0x00ca('0x4')],'transfererchannel':_0x4223aa[_0x00ca('0x5')],'transferercalleridnum':_0x4223aa[_0x00ca('0x6')],'transferercalleridname':_0x4223aa['transferercalleridname'],'transfererconnectedlinenum':_0x4223aa['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4223aa['transfererconnectedlinename'],'transfereraccountcode':_0x4223aa[_0x00ca('0x7')],'transferercontext':_0x4223aa[_0x00ca('0x8')],'transfererexten':_0x4223aa[_0x00ca('0x9')],'transfererlinkedid':_0x4223aa['transfererlinkedid'],'transfereechannel':_0x4223aa[_0x00ca('0xa')],'transfereecalleridnum':_0x4223aa[_0x00ca('0xb')],'transfereecalleridname':_0x4223aa['transfereecalleridname'],'transfereeconnectedlinenum':_0x4223aa[_0x00ca('0xc')],'transfereeconnectedlinename':_0x4223aa[_0x00ca('0xd')],'transfereeaccountcode':_0x4223aa[_0x00ca('0xe')],'transfereecontext':_0x4223aa[_0x00ca('0xf')],'transfereeexten':_0x4223aa['transfereeexten'],'transfereelinkedid':_0x4223aa[_0x00ca('0x10')],'isexternal':_0x4223aa[_0x00ca('0x11')],'context':_0x4223aa['context'],'extension':_0x4223aa[_0x00ca('0x12')],'type':'blind'},'log':_0x00ca('0x13')});};exports[_0x00ca('0x14')]=function(_0x381246){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x381246[_0x00ca('0x4')],'transfererchannel':_0x381246['origtransfererchannel'],'transferercalleridnum':_0x381246[_0x00ca('0x15')],'transferercalleridname':_0x381246[_0x00ca('0x16')],'transfererconnectedlinenum':_0x381246[_0x00ca('0x17')],'transfererconnectedlinename':_0x381246[_0x00ca('0x18')],'transfereraccountcode':_0x381246['origtransfereraccountcode'],'transferercontext':_0x381246[_0x00ca('0x19')],'transfererexten':_0x381246[_0x00ca('0x1a')],'transfererlinkedid':_0x381246['origtransfererlinkedid'],'transfereechannel':_0x381246[_0x00ca('0x1b')],'transfereecalleridnum':_0x381246[_0x00ca('0x1c')],'transfereecalleridname':_0x381246['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x381246[_0x00ca('0x1d')],'transfereeconnectedlinename':_0x381246[_0x00ca('0x1e')],'transfereeaccountcode':_0x381246[_0x00ca('0x1f')],'transfereecontext':_0x381246[_0x00ca('0x20')],'transfereeexten':_0x381246[_0x00ca('0x21')],'transfereelinkedid':_0x381246[_0x00ca('0x22')],'isexternal':_0x381246['isexternal'],'context':_0x381246[_0x00ca('0x23')],'extension':_0x381246[_0x00ca('0x24')],'type':_0x00ca('0x25')},'log':_0x00ca('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b45ddd4..990fa7c 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 _0x2542=['outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','omit','undefined','values','channels','length','voicechannel','map','channel','uniqueid','ai(mixmonitorid)','toLowerCase','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','stop','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','module','Reload','Action','then','message','catch','error','action','Command','hasOwnProperty','voiceQueues','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x863e9e,_0x5854b0){var _0x24fa60=function(_0x346970){while(--_0x346970){_0x863e9e['push'](_0x863e9e['shift']());}};_0x24fa60(++_0x5854b0);}(_0x2542,0x169));var _0x2254=function(_0x7da84c,_0x2230d1){_0x7da84c=_0x7da84c-0x0;var _0x43ad1e=_0x2542[_0x7da84c];return _0x43ad1e;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var jayson=require(_0x2254('0x2'));var schema=require(_0x2254('0x3'));var BPromise=require('bluebird');var moment=require(_0x2254('0x4'));var config=require('../../../config/environment');var properties=require(_0x2254('0x5'));var ami=require(_0x2254('0x6'));exports[_0x2254('0x7')]=function(_0x456612,_0x76c902,_0x508183){return new BPromise(function(_0x19ad3c,_0xe8ca50){var _0x2ee7ee={'QueuePause':function(_0x3c45ec){return new Promise(function(_0x1637ad,_0x477b47){var _0x263459=util[_0x2254('0x8')](_0x2254('0x9'),_0x2254('0xa'),_0x3c45ec[_0x2254('0xb')]);if(_0x456612['timers']&&_0x456612[_0x2254('0xc')][_0x263459]&&_0x456612[_0x2254('0xc')][_0x263459][_0x2254('0xd')]){_0x456612[_0x2254('0xc')][_0x263459]['updateAcw']();}if(_0x456612['agents'][_0x263459]){_0x456612[_0x2254('0xe')][_0x263459][_0x2254('0xf')]({'statePause':_0x3c45ec[_0x2254('0x10')]?!![]:![]});}_0x1637ad({'code':0xc8,'message':_0x2254('0x11')});});},'Reload':function(_0x3c326b){var _0x381efe=this;return new Promise(function(_0x592a4f,_0x439238){if(ami[_0x2254('0x12')]()==![]){return _0x439238(_0x381efe['error'](0x1f4,[config[_0x2254('0x13')]['ip'],config[_0x2254('0x13')][_0x2254('0x14')],_0x2254('0x15')][_0x2254('0x16')]('\x20')));}_0x3c326b=_[_0x2254('0x17')](_0x3c326b,_['keys'](properties[_0x2254('0x18')]));_0x3c326b['action']=_0x2254('0x19');return ami[_0x2254('0x1a')](_0x3c326b)[_0x2254('0x1b')](function(_0x25f8b2){_0x592a4f({'code':0xc8,'message':_0x25f8b2[_0x2254('0x1c')]});})[_0x2254('0x1d')](function(_0x497724){_0x439238(_0x381efe['error'](0x1f5,_0x497724['message']));});});},'Command':function(_0xb05559){var _0x3a79f8=this;return new Promise(function(_0x3c3a98,_0x1f1163){if(ami[_0x2254('0x12')]()==![]){return _0x1f1163(_0x3a79f8[_0x2254('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x2254('0x13')][_0x2254('0x14')],_0x2254('0x15')]['join']('\x20')));}_0xb05559=_['pick'](_0xb05559,'command');_0xb05559[_0x2254('0x1f')]=_0x2254('0x20');return ami[_0x2254('0x1a')](_0xb05559)['then'](function(_0x5713e4){_0x3c3a98({'code':0xc8,'message':_0x5713e4['content']});})['catch'](function(_0x5e5edb){_0x1f1163(_0x3a79f8['error'](0x1f5,_0x5e5edb[_0x2254('0x1c')]));});});},'VoiceQueues':function(_0x9d6ccf){return new Promise(function(_0x2f3037,_0x265467){var _0x13522d=[];for(var _0x1349c9 in _0x456612['voiceQueues']){if(_0x456612['voiceQueues'][_0x2254('0x21')](_0x1349c9)){var _0x4f6877=_0x456612[_0x2254('0x22')][_0x1349c9];var _0x141dc5={'id':_0x4f6877['id'],'name':_0x4f6877[_0x2254('0xb')],'strategy':_0x4f6877[_0x2254('0x23')],'answered':_0x4f6877[_0x2254('0x24')],'available':_0x4f6877['available'],'loggedIn':_0x4f6877[_0x2254('0x25')],'pTalking':_0x4f6877[_0x2254('0x26')],'sumBillable':_0x4f6877[_0x2254('0x27')],'sumDuration':_0x4f6877[_0x2254('0x28')],'sumHoldTime':_0x4f6877[_0x2254('0x29')]||0x0,'talking':_0x4f6877[_0x2254('0x2a')],'total':_0x4f6877[_0x2254('0x2b')],'type':_0x4f6877[_0x2254('0x2c')],'unmanaged':_0x4f6877[_0x2254('0x2d')],'abandoned':_0x4f6877[_0x2254('0x2e')],'waiting':_0x4f6877[_0x2254('0x2f')],'loggedInDb':_0x4f6877[_0x2254('0x30')]};if(_0x4f6877[_0x2254('0x2c')]===_0x2254('0x31')){_0x141dc5[_0x2254('0x32')]=_0x4f6877[_0x2254('0x32')];_0x141dc5[_0x2254('0x33')]=_0x4f6877[_0x2254('0x33')];_0x141dc5[_0x2254('0x34')]=_0x4f6877['dialOriginateCallerIdName'];_0x141dc5[_0x2254('0x35')]=_0x4f6877[_0x2254('0x35')];_0x141dc5[_0x2254('0x36')]=_0x4f6877[_0x2254('0x36')];_0x141dc5[_0x2254('0x37')]=_0x4f6877[_0x2254('0x37')];_0x141dc5[_0x2254('0x38')]=_0x4f6877[_0x2254('0x38')];_0x141dc5[_0x2254('0x39')]=_0x4f6877['outboundAnswerAgiCallsDay'];_0x141dc5[_0x2254('0x3a')]=_0x4f6877[_0x2254('0x3a')];_0x141dc5['outboundBlacklistCallsDay']=_0x4f6877[_0x2254('0x3b')];_0x141dc5[_0x2254('0x3c')]=_0x4f6877[_0x2254('0x3c')];_0x141dc5[_0x2254('0x3d')]=_0x4f6877['outboundCongestionCallsDay'];_0x141dc5['outboundDropCallsDayACS']=_0x4f6877[_0x2254('0x3e')];_0x141dc5['outboundDropCallsDayCallersExit']=_0x4f6877[_0x2254('0x3f')];_0x141dc5[_0x2254('0x40')]=_0x4f6877[_0x2254('0x40')];_0x141dc5[_0x2254('0x41')]=_0x4f6877[_0x2254('0x41')];_0x141dc5[_0x2254('0x42')]=_0x4f6877[_0x2254('0x42')];_0x141dc5['outboundOriginateFailureCallsDay']=_0x4f6877[_0x2254('0x43')];_0x141dc5[_0x2254('0x44')]=_0x4f6877[_0x2254('0x44')];_0x141dc5[_0x2254('0x45')]=_0x4f6877[_0x2254('0x45')];_0x141dc5[_0x2254('0x46')]=_0x4f6877[_0x2254('0x46')];_0x141dc5[_0x2254('0x47')]=_0x4f6877[_0x2254('0x47')];_0x141dc5[_0x2254('0x48')]=_0x4f6877['predictiveIntervalAvgHoldtime'];_0x141dc5[_0x2254('0x49')]=_0x4f6877[_0x2254('0x49')];_0x141dc5[_0x2254('0x4a')]=_0x4f6877[_0x2254('0x4a')];_0x141dc5['predictiveIntervalDroppedCallsTimeout']=_0x4f6877[_0x2254('0x4b')];_0x141dc5[_0x2254('0x4c')]=_0x4f6877[_0x2254('0x4c')];_0x141dc5[_0x2254('0x4d')]=_0x4f6877[_0x2254('0x4d')];_0x141dc5[_0x2254('0x4e')]=_0x4f6877[_0x2254('0x4e')];_0x141dc5[_0x2254('0x4f')]=_0x4f6877['predictiveIntervalMultiplicativeFactor'];_0x141dc5[_0x2254('0x50')]=_0x4f6877['predictiveIntervalPauses'];_0x141dc5[_0x2254('0x51')]=_0x4f6877[_0x2254('0x51')];_0x141dc5[_0x2254('0x52')]=_0x4f6877[_0x2254('0x52')];_0x141dc5[_0x2254('0x1c')]=_0x4f6877[_0x2254('0x1c')];_0x141dc5[_0x2254('0x53')]=_0x4f6877['originated'];_0x141dc5[_0x2254('0x54')]=_0x4f6877[_0x2254('0x54')];_0x141dc5[_0x2254('0x55')]=_0x4f6877[_0x2254('0x55')];_0x141dc5[_0x2254('0x56')]=_0x4f6877['erlangAbandonmentRate'];_0x141dc5[_0x2254('0x57')]=_0x4f6877[_0x2254('0x57')];_0x141dc5[_0x2254('0x58')]=_0x4f6877[_0x2254('0x58')];_0x141dc5[_0x2254('0x59')]=_0x4f6877['startProgressive'];}if(_0x4f6877[_0x2254('0x5a')]){_0x141dc5['Trunk']={'id':_0x4f6877[_0x2254('0x5a')]['id'],'name':_0x4f6877[_0x2254('0x5a')][_0x2254('0xb')],'active':_0x4f6877[_0x2254('0x5a')][_0x2254('0x5b')],'callerid':_0x4f6877[_0x2254('0x5a')][_0x2254('0x5c')]};}if(_0x4f6877[_0x2254('0x5d')]){_0x141dc5[_0x2254('0x5d')]={'id':_0x4f6877[_0x2254('0x5d')]['id'],'name':_0x4f6877[_0x2254('0x5d')][_0x2254('0xb')]};}_0x13522d[_0x2254('0x5e')](_0x141dc5);}}_0x2f3037({'count':_0x13522d['length'],'rows':_0x13522d});});},'UpdateVoiceQueue':function(_0x41500c){return new Promise(function(_0x1ac370,_0x2c5609){var _0x5cc8fc=_[_0x2254('0x5f')](_0x456612[_0x2254('0x22')],{'id':parseInt(_0x41500c['id'])});var _0x400bb3=_[_0x2254('0x60')](_0x41500c,['id']);if(_0x5cc8fc){for(var _0x2e6603 in _0x400bb3){if(typeof _0x400bb3[_0x2e6603]!==_0x2254('0x61')&&typeof _0x5cc8fc[_0x2e6603]!==_0x2254('0x61')){_0x5cc8fc[_0x2e6603]=_0x400bb3[_0x2e6603];}}_0x1ac370(_0x5cc8fc);}else{_0x2c5609();}});},'VoiceChannels':function(_0x3c685e){return new Promise(function(_0x27eb3b,_0x4fc83c){var _0x239ba0=_[_0x2254('0x62')](_0x456612[_0x2254('0x63')]);_0x27eb3b({'count':_0x239ba0[_0x2254('0x64')],'rows':_0x239ba0});});},'VoiceChannelMixMonitor':function(_0xbbc059){var _0x1a203e=this;return new Promise(function(_0x3396c2,_0x438922){if(ami[_0x2254('0x12')]()==![]){return _0x438922(_0x1a203e[_0x2254('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x2254('0x13')][_0x2254('0x14')],'ami\x20disconnected'][_0x2254('0x16')]('\x20')));}var _0x143bd2=schema(properties[_0x2254('0x65')])[_0x2254('0x3')](_0xbbc059);if(_0x143bd2['length']>0x0){return _0x438922(_0x1a203e[_0x2254('0x1e')](0x1f4,_[_0x2254('0x66')](_0x143bd2,'message')[_0x2254('0x16')](',\x20')));}var _0x3f0670=_[_0x2254('0x5f')](_0x456612[_0x2254('0x63')],{'uniqueid':_0xbbc059['uniqueid']});if(_0x3f0670&&_0x3f0670[_0x2254('0x67')]){var _0x106282=util[_0x2254('0x8')]('%s.%s',_0xbbc059['filename']||_0xbbc059[_0x2254('0x68')],_0xbbc059[_0x2254('0x8')]||'wav');return ami[_0x2254('0x1a')]({'action':'MixMonitor','channel':_0x3f0670['channel'],'file':_0x106282,'options':_0x2254('0x69')})[_0x2254('0x1b')](function(_0x3be0f3){var _0x2bfec4=_[_0x2254('0x5f')](_0x3f0670['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x106282[_0x2254('0x6a')]()});if(_['isNil'](_0x2bfec4)){_0x3f0670[_0x2254('0x6b')][_0x2254('0x5e')]({'filename':_0x2254('0x6c')+_0x106282[_0x2254('0x6a')](),'createdAt':moment()['format'](_0x2254('0x6d')),'mixmonitorid':_0x3be0f3[_0x2254('0x6e')],'status':'rec'});}else{_0x2bfec4['mixmonitorid']=_0x3be0f3[_0x2254('0x6e')];_0x2bfec4['status']=_0x2254('0x6f');}_0x3396c2({'code':0xc8,'message':[_0xbbc059[_0x2254('0x68')],_0x2254('0x70'),_0x3be0f3[_0x2254('0x6e')]][_0x2254('0x16')]('\x20'),'mixmonitorid':_0x3be0f3['mixmonitorid']});})['catch'](function(_0x39b1b1){_0x438922(_0x1a203e['error'](0x1f5,[_0xbbc059[_0x2254('0x68')],_0x39b1b1['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x438922(_0x1a203e[_0x2254('0x1e')](0x1f5,_0x2254('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x1d4b90){var _0x3ea2d9=this;return new Promise(function(_0x13606e,_0x1cf757){if(ami[_0x2254('0x12')]()==![]){return _0x1cf757(_0x3ea2d9[_0x2254('0x1e')](0x1f4,[config[_0x2254('0x13')]['ip'],config[_0x2254('0x13')][_0x2254('0x14')],_0x2254('0x15')][_0x2254('0x16')]('\x20')));}var _0x24e57a=schema(properties[_0x2254('0x65')])[_0x2254('0x3')](_0x1d4b90);if(_0x24e57a[_0x2254('0x64')]>0x0){return _0x1cf757(_0x3ea2d9[_0x2254('0x1e')](0x1f4,_[_0x2254('0x66')](_0x24e57a,'message')[_0x2254('0x16')](',\x20')));}var _0xae171c=_[_0x2254('0x5f')](_0x456612[_0x2254('0x63')],{'uniqueid':_0x1d4b90['uniqueid']});if(_0xae171c){return BPromise['resolve']()[_0x2254('0x1b')](function(){if(_0xae171c[_0x2254('0x67')]){return ami[_0x2254('0x1a')]({'action':_0x2254('0x72'),'channel':_0xae171c[_0x2254('0x67')],'mixmonitorid':_0x1d4b90['mixmonitorid']})[_0x2254('0x1d')](function(_0x2d8a53){});}})[_0x2254('0x1b')](function(){if(_0xae171c['destinationchannel']){return ami['Action']({'action':_0x2254('0x72'),'channel':_0xae171c['destinationchannel'],'mixmonitorid':_0x1d4b90[_0x2254('0x6e')]})[_0x2254('0x1d')](function(_0x5b269d){});}})[_0x2254('0x1b')](function(_0x1b154f){var _0x4d30a5=_[_0x2254('0x5f')](_0xae171c[_0x2254('0x6b')],{'mixmonitorid':_0x1d4b90['mixmonitorid']});if(_0x4d30a5){_0x4d30a5['status']=_0x2254('0x73');}})[_0x2254('0x1b')](function(){var _0x486b82=util['format'](_0x2254('0x74'),_0x1d4b90['filename']||_0x1d4b90[_0x2254('0x68')],_0x1d4b90['format']||_0x2254('0x75'));var _0x7bdd46=_[_0x2254('0x5f')](_0xae171c[_0x2254('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x486b82[_0x2254('0x6a')]()});if(_0x7bdd46){_0x7bdd46['status']=_0x2254('0x73');}})[_0x2254('0x1b')](function(){_0x13606e({'code':0xc8,'message':[_0x1d4b90['uniqueid'],_0x2254('0x76')][_0x2254('0x16')]('\x20')});})['catch'](function(_0x32614f){_0x1cf757(_0x3ea2d9[_0x2254('0x1e')](0x1f5,[_0x1d4b90[_0x2254('0x68')],_0x32614f[_0x2254('0x1c')]['toLowerCase']()][_0x2254('0x16')]('\x20')));});}else{return _0x1cf757(_0x3ea2d9[_0x2254('0x1e')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x1ac8ff){return new Promise(function(_0x4469c7,_0x49d611){var _0x242e15=_['values'](_0x456612[_0x2254('0x77')]);_0x4469c7({'count':_0x242e15['length'],'rows':_0x242e15});});},'VoiceQueuesChannel':function(_0x3cbd35){var _0x1f95b2=this;return new Promise(function(_0x5e86d3,_0x334d31){var _0x4c91ec=schema(properties[_0x2254('0x78')])[_0x2254('0x3')](_0x3cbd35);if(_0x4c91ec[_0x2254('0x64')]>0x0){return _0x334d31(_0x1f95b2['error'](0x1f4,_[_0x2254('0x66')](_0x4c91ec,'message')[_0x2254('0x16')](',\x20')));}var _0x33f29b=_['find'](_0x456612['queueChannels'],{'uniqueid':_0x3cbd35[_0x2254('0x68')]});if(_0x33f29b){_0x5e86d3(_0x33f29b);}else{return _0x334d31(_0x1f95b2[_0x2254('0x1e')](0x1f5,_0x2254('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x2861d0){var _0x4969b1=this;return new Promise(function(_0x2a4a5b,_0x6ff8d4){if(ami[_0x2254('0x12')]()==![]){return _0x6ff8d4(_0x4969b1[_0x2254('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x2254('0x13')][_0x2254('0x14')],'ami\x20disconnected'][_0x2254('0x16')]('\x20')));}var _0x5cbdb0=schema(properties[_0x2254('0x79')])['validate'](_0x2861d0);if(_0x5cbdb0['length']>0x0){return _0x6ff8d4(_0x4969b1['error'](0x1f4,_[_0x2254('0x66')](_0x5cbdb0,'message')[_0x2254('0x16')](',\x20')));}var _0x13dba2=_['find'](_0x456612[_0x2254('0x77')],{'uniqueid':_0x2861d0[_0x2254('0x68')]});if(_0x13dba2&&_0x13dba2[_0x2254('0x67')]){return ami[_0x2254('0x1a')]({'action':_0x2254('0x7a'),'channel':_0x13dba2[_0x2254('0x67')]})['then'](function(_0x553ac5){_0x2a4a5b({'code':0xc8,'message':[_0x2861d0[_0x2254('0x68')],_0x553ac5[_0x2254('0x1c')][_0x2254('0x6a')]()][_0x2254('0x16')]('\x20')});})[_0x2254('0x1d')](function(_0x47347f){_0x6ff8d4(_0x4969b1[_0x2254('0x1e')](0x1f5,[_0x2861d0[_0x2254('0x68')],_0x47347f[_0x2254('0x1c')][_0x2254('0x6a')]()]['join']('\x20')));});}else{return _0x6ff8d4(_0x4969b1[_0x2254('0x1e')](0x1f5,_0x2254('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x53cf03){var _0x447e4f=this;return new Promise(function(_0x57fb43,_0x3b9514){if(ami[_0x2254('0x12')]()==![]){return _0x3b9514(_0x447e4f['error'](0x1f4,[config[_0x2254('0x13')]['ip'],config['asterisk'][_0x2254('0x14')],_0x2254('0x15')][_0x2254('0x16')]('\x20')));}var _0x1f7a48=schema(properties['voicequeuechannelredirect'])[_0x2254('0x3')](_0x53cf03);if(_0x1f7a48[_0x2254('0x64')]>0x0){return _0x3b9514(_0x447e4f[_0x2254('0x1e')](0x1f4,_[_0x2254('0x66')](_0x1f7a48,'message')[_0x2254('0x16')](',\x20')));}var _0x480eeb=_['find'](_0x456612[_0x2254('0x77')],{'uniqueid':_0x53cf03[_0x2254('0x68')]});if(_0x480eeb&&_0x480eeb['channel']){return ami['Action']({'action':_0x2254('0x7b'),'channel':_0x480eeb[_0x2254('0x67')],'exten':_0x53cf03[_0x2254('0x7c')],'context':_0x53cf03[_0x2254('0x7d')]||_0x480eeb[_0x2254('0x7d')],'priority':0x1})[_0x2254('0x1b')](function(_0x1a2ec6){_0x57fb43({'code':0xc8,'message':[_0x53cf03[_0x2254('0x68')],_0x1a2ec6[_0x2254('0x1c')]['toLowerCase']()][_0x2254('0x16')]('\x20')});})['catch'](function(_0x181bc7){_0x3b9514(_0x447e4f['error'](0x1f5,[_0x53cf03[_0x2254('0x68')],_0x181bc7[_0x2254('0x1c')][_0x2254('0x6a')]()]['join']('\x20')));});}else{return _0x3b9514(_0x447e4f[_0x2254('0x1e')](0x1f5,_0x2254('0x71')));}});},'Agents':function(_0x13c6f1){return new Promise(function(_0x472758,_0x227e29){var _0x1433e8=_[_0x2254('0x62')](_0x456612[_0x2254('0xe')]);_0x472758({'count':_0x1433e8[_0x2254('0x64')],'rows':_0x1433e8});});},'Telephones':function(_0x146b52){return new Promise(function(_0x25a0aa,_0x46f6bc){var _0x70c30=_['values'](_0x456612[_0x2254('0x7e')]);_0x25a0aa({'count':_0x70c30['length'],'rows':_0x70c30});});},'Trunks':function(_0x64c4f5){return new Promise(function(_0xb98b40,_0x3b1d5c){var _0x2c907a=_[_0x2254('0x62')](_0x456612[_0x2254('0x7f')]);_0xb98b40({'count':_0x2c907a[_0x2254('0x64')],'rows':_0x2c907a});});},'OutboundChannels':function(_0x5b7f24){return new Promise(function(_0x46b528,_0x55a603){var _0x16aa33=_['values'](_0x456612[_0x2254('0x80')]);_0x46b528({'count':_0x16aa33[_0x2254('0x64')],'rows':_0x16aa33});});},'Outbound':function(_0x1d0c8f){return new Promise(function(_0x4a6c9e,_0x435bf7){_0x4a6c9e(_0x456612[_0x2254('0x31')]);});},'Campaigns':function(_0x2c949c){return new Promise(function(_0x14f121,_0x330ad2){var _0x28779b=_[_0x2254('0x62')](_0x456612[_0x2254('0x81')]);_0x14f121({'count':_0x28779b['length'],'rows':_0x28779b});});},'VoiceQueuesPreview':function(_0x56239e){var _0x437d5b=this;return new Promise(function(_0x4d47ae,_0x4470ee){_0x76c902[_0x2254('0x82')](_0x56239e['id'])[_0x2254('0x1b')](function(_0x438c95){_0x4d47ae({'code':0xc8,'message':_0x438c95[_0x2254('0x1c')]});})[_0x2254('0x1d')](function(_0x376b03){_0x4470ee(_0x437d5b['error'](0x1f4,_0x376b03[_0x2254('0x1c')]));});});},'EventManager':function(_0x34ac83){var _0x158e14=this;return new Promise(function(_0x4868fb,_0x3bbb35){if(!_0x34ac83[_0x2254('0x83')]){return _0x3bbb35(_0x158e14[_0x2254('0x1e')](0x1f4,_0x2254('0x84')));}ami[_0x2254('0x85')](_0x2254('0x86')+_0x34ac83[_0x2254('0x83')],_0x34ac83[_0x2254('0x1c')]);_0x4868fb({'code':0xc8,'message':_0x34ac83});});},'FaxAccounts':function(_0x3e4a0e){return new Promise(function(_0x532c14,_0x2cb797){var _0x1ca5bb=_['values'](_0x456612['faxAccounts']);_0x532c14({'count':_0x1ca5bb[_0x2254('0x64')],'rows':_0x1ca5bb});});},'SendFax':function(_0x54339e){var _0x226c19=this;return new Promise(function(_0x10645f,_0x124622){_0x508183[_0x2254('0x87')](_0x54339e)[_0x2254('0x1b')](function(_0x112aa6){_0x10645f({'code':0xc8,'message':_0x112aa6[_0x2254('0x1c')]});})[_0x2254('0x1d')](function(_0x5bf7cf){_0x124622(_0x226c19['error'](0x1f4,_0x5bf7cf[_0x2254('0x1c')]));});});},'CheckAfterSend':function(_0x1cfb9c){var _0x1e8617=this;return new Promise(function(_0x10a939,_0x201da7){_0x508183['checkAfterSend'](_0x1cfb9c)['then'](function(_0x2a1d14){_0x10a939({'code':0xc8,'message':_0x2a1d14['message']});})[_0x2254('0x1d')](function(_0x444f49){_0x201da7(_0x1e8617[_0x2254('0x1e')](0x1f4,_0x444f49[_0x2254('0x1c')]));});});}};var _0x366185=jayson[_0x2254('0x88')](_0x2ee7ee)[_0x2254('0x89')]();_0x366185['on']('error',function(_0x6b716b){return _0xe8ca50(_0x6b716b);});_0x366185[_0x2254('0x7')](0x232a,'127.0.0.1',function(){console[_0x2254('0x8a')](_0x2254('0x8b'),0x232a);return _0x19ad3c(_0x2254('0x8c')+0x232a);});});}; \ No newline at end of file +var _0x964b=['AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../ami','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','join','module','action','Reload','Action','then','message','catch','ami\x20disconnected','pick','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','find','uniqueid','channel','format','%s.%s','filename','wav','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','http','log'];(function(_0x21186c,_0x244182){var _0x54fa89=function(_0x8f3af6){while(--_0x8f3af6){_0x21186c['push'](_0x21186c['shift']());}};_0x54fa89(++_0x244182);}(_0x964b,0x112));var _0xb964=function(_0xb80b63,_0x1b072f){_0xb80b63=_0xb80b63-0x0;var _0x58380d=_0x964b[_0xb80b63];return _0x58380d;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var jayson=require('jayson/promise');var schema=require(_0xb964('0x2'));var BPromise=require(_0xb964('0x3'));var moment=require(_0xb964('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xb964('0x5'));exports['listen']=function(_0x4760b2,_0x249313,_0xba9f19){return new BPromise(function(_0x11a0c1,_0x204c7d){var _0xde47d5={'QueuePause':function(_0x3fe401){return new Promise(function(_0x53b463,_0x58e49e){var _0x3a3006=util['format']('%s/%s',_0xb964('0x6'),_0x3fe401[_0xb964('0x7')]);if(_0x4760b2[_0xb964('0x8')]&&_0x4760b2[_0xb964('0x8')][_0x3a3006]&&_0x4760b2[_0xb964('0x8')][_0x3a3006][_0xb964('0x9')]){_0x4760b2['timers'][_0x3a3006][_0xb964('0xa')]();}if(_0x4760b2[_0xb964('0xb')][_0x3a3006]){_0x4760b2[_0xb964('0xb')][_0x3a3006][_0xb964('0xc')]({'statePause':_0x3fe401['pause']?!![]:![]});}_0x53b463({'code':0xc8,'message':_0xb964('0xd')});});},'Reload':function(_0x4ddf60){var _0x556533=this;return new Promise(function(_0x3ce73e,_0x256e02){if(ami[_0xb964('0xe')]()==![]){return _0x256e02(_0x556533[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],'ami\x20disconnected'][_0xb964('0x12')]('\x20')));}_0x4ddf60=_['pick'](_0x4ddf60,_['keys'](properties[_0xb964('0x13')]));_0x4ddf60[_0xb964('0x14')]=_0xb964('0x15');return ami[_0xb964('0x16')](_0x4ddf60)[_0xb964('0x17')](function(_0x43309f){_0x3ce73e({'code':0xc8,'message':_0x43309f[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x2bd9d5){_0x256e02(_0x556533['error'](0x1f5,_0x2bd9d5['message']));});});},'Command':function(_0x49a066){var _0x2f5068=this;return new Promise(function(_0x42e78e,_0x209075){if(ami[_0xb964('0xe')]()==![]){return _0x209075(_0x2f5068[_0xb964('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}_0x49a066=_[_0xb964('0x1b')](_0x49a066,'command');_0x49a066[_0xb964('0x14')]=_0xb964('0x1c');return ami[_0xb964('0x16')](_0x49a066)['then'](function(_0x486d66){_0x42e78e({'code':0xc8,'message':_0x486d66[_0xb964('0x1d')]});})['catch'](function(_0x14dece){_0x209075(_0x2f5068[_0xb964('0xf')](0x1f5,_0x14dece[_0xb964('0x18')]));});});},'VoiceQueues':function(_0x446e1b){return new Promise(function(_0x51257e,_0x1cecce){var _0x1d9dcd=[];for(var _0x2801dd in _0x4760b2[_0xb964('0x1e')]){if(_0x4760b2[_0xb964('0x1e')][_0xb964('0x1f')](_0x2801dd)){var _0x13d94d=_0x4760b2[_0xb964('0x1e')][_0x2801dd];var _0x142f76={'id':_0x13d94d['id'],'name':_0x13d94d['name'],'strategy':_0x13d94d[_0xb964('0x20')],'answered':_0x13d94d[_0xb964('0x21')],'available':_0x13d94d[_0xb964('0x22')],'loggedIn':_0x13d94d[_0xb964('0x23')],'pTalking':_0x13d94d[_0xb964('0x24')],'sumBillable':_0x13d94d[_0xb964('0x25')],'sumDuration':_0x13d94d[_0xb964('0x26')],'sumHoldTime':_0x13d94d['sumHoldTime']||0x0,'talking':_0x13d94d[_0xb964('0x27')],'total':_0x13d94d[_0xb964('0x28')],'type':_0x13d94d[_0xb964('0x29')],'unmanaged':_0x13d94d['unmanaged'],'abandoned':_0x13d94d[_0xb964('0x2a')],'waiting':_0x13d94d[_0xb964('0x2b')],'loggedInDb':_0x13d94d[_0xb964('0x2c')]};if(_0x13d94d[_0xb964('0x29')]===_0xb964('0x2d')){_0x142f76[_0xb964('0x2e')]=_0x13d94d['dialActive'];_0x142f76['dialMethod']=_0x13d94d[_0xb964('0x2f')];_0x142f76[_0xb964('0x30')]=_0x13d94d[_0xb964('0x30')];_0x142f76[_0xb964('0x31')]=_0x13d94d['dialOriginateCallerIdNumber'];_0x142f76[_0xb964('0x32')]=_0x13d94d['dialOriginateTimeout'];_0x142f76[_0xb964('0x33')]=_0x13d94d[_0xb964('0x33')];_0x142f76['temp']=_0x13d94d['temp'];_0x142f76[_0xb964('0x34')]=_0x13d94d[_0xb964('0x34')];_0x142f76[_0xb964('0x35')]=_0x13d94d[_0xb964('0x35')];_0x142f76[_0xb964('0x36')]=_0x13d94d[_0xb964('0x36')];_0x142f76['outboundBusyCallsDay']=_0x13d94d['outboundBusyCallsDay'];_0x142f76['outboundCongestionCallsDay']=_0x13d94d[_0xb964('0x37')];_0x142f76[_0xb964('0x38')]=_0x13d94d[_0xb964('0x38')];_0x142f76[_0xb964('0x39')]=_0x13d94d[_0xb964('0x39')];_0x142f76[_0xb964('0x3a')]=_0x13d94d['outboundDropCallsDayTimeout'];_0x142f76['outboundNoAnswerCallsDay']=_0x13d94d[_0xb964('0x3b')];_0x142f76[_0xb964('0x3c')]=_0x13d94d[_0xb964('0x3c')];_0x142f76[_0xb964('0x3d')]=_0x13d94d[_0xb964('0x3d')];_0x142f76['outboundReCallsDay']=_0x13d94d[_0xb964('0x3e')];_0x142f76[_0xb964('0x3f')]=_0x13d94d[_0xb964('0x3f')];_0x142f76[_0xb964('0x40')]=_0x13d94d[_0xb964('0x40')];_0x142f76[_0xb964('0x41')]=_0x13d94d[_0xb964('0x41')];_0x142f76['predictiveIntervalAvgHoldtime']=_0x13d94d[_0xb964('0x42')];_0x142f76['predictiveIntervalAvgTalktime']=_0x13d94d[_0xb964('0x43')];_0x142f76['predictiveIntervalDroppedCallsCallersExit']=_0x13d94d[_0xb964('0x44')];_0x142f76[_0xb964('0x45')]=_0x13d94d['predictiveIntervalDroppedCallsTimeout'];_0x142f76['predictiveIntervalErlangCalls']=_0x13d94d[_0xb964('0x46')];_0x142f76[_0xb964('0x47')]=_0x13d94d[_0xb964('0x47')];_0x142f76[_0xb964('0x48')]=_0x13d94d[_0xb964('0x48')];_0x142f76['predictiveIntervalMultiplicativeFactor']=_0x13d94d[_0xb964('0x49')];_0x142f76[_0xb964('0x4a')]=_0x13d94d[_0xb964('0x4a')];_0x142f76['predictiveIntervalAvailable']=_0x13d94d[_0xb964('0x4b')];_0x142f76[_0xb964('0x4c')]=_0x13d94d[_0xb964('0x4c')];_0x142f76[_0xb964('0x18')]=_0x13d94d[_0xb964('0x18')];_0x142f76['originated']=_0x13d94d[_0xb964('0x4d')];_0x142f76[_0xb964('0x4e')]=_0x13d94d['erlangCalls'];_0x142f76[_0xb964('0x4f')]=_0x13d94d[_0xb964('0x4f')];_0x142f76[_0xb964('0x50')]=_0x13d94d[_0xb964('0x50')];_0x142f76['erlangBusyFactor']=_0x13d94d['erlangBusyFactor'];_0x142f76[_0xb964('0x51')]=_0x13d94d[_0xb964('0x51')];_0x142f76[_0xb964('0x52')]=_0x13d94d[_0xb964('0x52')];}if(_0x13d94d[_0xb964('0x53')]){_0x142f76[_0xb964('0x53')]={'id':_0x13d94d[_0xb964('0x53')]['id'],'name':_0x13d94d[_0xb964('0x53')]['name'],'active':_0x13d94d[_0xb964('0x53')]['active'],'callerid':_0x13d94d[_0xb964('0x53')][_0xb964('0x54')]};}if(_0x13d94d[_0xb964('0x55')]){_0x142f76['Interval']={'id':_0x13d94d[_0xb964('0x55')]['id'],'name':_0x13d94d[_0xb964('0x55')][_0xb964('0x7')]};}_0x1d9dcd[_0xb964('0x56')](_0x142f76);}}_0x51257e({'count':_0x1d9dcd[_0xb964('0x57')],'rows':_0x1d9dcd});});},'UpdateVoiceQueue':function(_0x3d6df5){return new Promise(function(_0x43c3b0,_0x30bbe9){var _0x1b1709=_['find'](_0x4760b2['voiceQueues'],{'id':parseInt(_0x3d6df5['id'])});var _0x4cbdca=_[_0xb964('0x58')](_0x3d6df5,['id']);if(_0x1b1709){for(var _0xe4e024 in _0x4cbdca){if(typeof _0x4cbdca[_0xe4e024]!=='undefined'&&typeof _0x1b1709[_0xe4e024]!==_0xb964('0x59')){_0x1b1709[_0xe4e024]=_0x4cbdca[_0xe4e024];}}_0x43c3b0(_0x1b1709);}else{_0x30bbe9();}});},'VoiceChannels':function(_0x2b9ec9){return new Promise(function(_0x516228,_0x58f7d1){var _0x343942=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x5b')]);_0x516228({'count':_0x343942[_0xb964('0x57')],'rows':_0x343942});});},'VoiceChannelMixMonitor':function(_0x4f1129){var _0x3bacfc=this;return new Promise(function(_0x52fbe7,_0x2cbbed){if(ami[_0xb964('0xe')]()==![]){return _0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}var _0x591a20=schema(properties[_0xb964('0x5c')])[_0xb964('0x2')](_0x4f1129);if(_0x591a20[_0xb964('0x57')]>0x0){return _0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f4,_['map'](_0x591a20,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x1759bc=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x5b')],{'uniqueid':_0x4f1129[_0xb964('0x5e')]});if(_0x1759bc&&_0x1759bc[_0xb964('0x5f')]){var _0x27e73b=util[_0xb964('0x60')](_0xb964('0x61'),_0x4f1129[_0xb964('0x62')]||_0x4f1129[_0xb964('0x5e')],_0x4f1129[_0xb964('0x60')]||_0xb964('0x63'));return ami[_0xb964('0x16')]({'action':'MixMonitor','channel':_0x1759bc[_0xb964('0x5f')],'file':_0x27e73b,'options':'ai(mixmonitorid)'})[_0xb964('0x17')](function(_0x42b5ed){var _0x2344cb=_[_0xb964('0x5d')](_0x1759bc['monitors'],{'filename':_0xb964('0x64')+_0x27e73b[_0xb964('0x65')]()});if(_[_0xb964('0x66')](_0x2344cb)){_0x1759bc[_0xb964('0x67')][_0xb964('0x56')]({'filename':'/var/spool/asterisk/monitor/'+_0x27e73b['toLowerCase'](),'createdAt':moment()[_0xb964('0x60')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x42b5ed[_0xb964('0x68')],'status':_0xb964('0x69')});}else{_0x2344cb['mixmonitorid']=_0x42b5ed[_0xb964('0x68')];_0x2344cb[_0xb964('0x6a')]='rec';}_0x52fbe7({'code':0xc8,'message':[_0x4f1129[_0xb964('0x5e')],_0xb964('0x6b'),_0x42b5ed['mixmonitorid']][_0xb964('0x12')]('\x20'),'mixmonitorid':_0x42b5ed['mixmonitorid']});})[_0xb964('0x19')](function(_0x214430){_0x2cbbed(_0x3bacfc[_0xb964('0xf')](0x1f5,[_0x4f1129[_0xb964('0x5e')],_0x214430[_0xb964('0x18')][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')));});}else{return _0x2cbbed(_0x3bacfc['error'](0x1f5,_0xb964('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x56276c){var _0x3f3b42=this;return new Promise(function(_0x584934,_0x21c239){if(ami[_0xb964('0xe')]()==![]){return _0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],'ami\x20disconnected'][_0xb964('0x12')]('\x20')));}var _0xd527bb=schema(properties['voicechannel'])[_0xb964('0x2')](_0x56276c);if(_0xd527bb[_0xb964('0x57')]>0x0){return _0x21c239(_0x3f3b42['error'](0x1f4,_[_0xb964('0x6d')](_0xd527bb,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x5f0877=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x5b')],{'uniqueid':_0x56276c[_0xb964('0x5e')]});if(_0x5f0877){return BPromise[_0xb964('0x6e')]()[_0xb964('0x17')](function(){if(_0x5f0877[_0xb964('0x5f')]){return ami[_0xb964('0x16')]({'action':_0xb964('0x6f'),'channel':_0x5f0877[_0xb964('0x5f')],'mixmonitorid':_0x56276c['mixmonitorid']})[_0xb964('0x19')](function(_0x5214d8){});}})['then'](function(){if(_0x5f0877[_0xb964('0x70')]){return ami['Action']({'action':_0xb964('0x6f'),'channel':_0x5f0877[_0xb964('0x70')],'mixmonitorid':_0x56276c[_0xb964('0x68')]})['catch'](function(_0x157805){});}})[_0xb964('0x17')](function(_0x59b558){var _0xfbdc9=_[_0xb964('0x5d')](_0x5f0877[_0xb964('0x67')],{'mixmonitorid':_0x56276c['mixmonitorid']});if(_0xfbdc9){_0xfbdc9[_0xb964('0x6a')]='stop';}})[_0xb964('0x17')](function(){var _0x4c59ef=util[_0xb964('0x60')](_0xb964('0x61'),_0x56276c[_0xb964('0x62')]||_0x56276c[_0xb964('0x5e')],_0x56276c['format']||_0xb964('0x63'));var _0x55698f=_[_0xb964('0x5d')](_0x5f0877[_0xb964('0x67')],{'filename':_0xb964('0x64')+_0x4c59ef[_0xb964('0x65')]()});if(_0x55698f){_0x55698f['status']=_0xb964('0x71');}})[_0xb964('0x17')](function(){_0x584934({'code':0xc8,'message':[_0x56276c[_0xb964('0x5e')],_0xb964('0x72')][_0xb964('0x12')]('\x20')});})[_0xb964('0x19')](function(_0xcd064b){_0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f5,[_0x56276c[_0xb964('0x5e')],_0xcd064b[_0xb964('0x18')]['toLowerCase']()][_0xb964('0x12')]('\x20')));});}else{return _0x21c239(_0x3f3b42[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannels':function(_0x31589a){return new Promise(function(_0x289901,_0x4580a2){var _0x3e837e=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x73')]);_0x289901({'count':_0x3e837e[_0xb964('0x57')],'rows':_0x3e837e});});},'VoiceQueuesChannel':function(_0x14ae72){var _0x4c754e=this;return new Promise(function(_0x5e9151,_0x1aada6){var _0x444121=schema(properties[_0xb964('0x74')])['validate'](_0x14ae72);if(_0x444121[_0xb964('0x57')]>0x0){return _0x1aada6(_0x4c754e['error'](0x1f4,_[_0xb964('0x6d')](_0x444121,'message')[_0xb964('0x12')](',\x20')));}var _0x206fc8=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x73')],{'uniqueid':_0x14ae72[_0xb964('0x5e')]});if(_0x206fc8){_0x5e9151(_0x206fc8);}else{return _0x1aada6(_0x4c754e['error'](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x4a2ebf){var _0x4e8dae=this;return new Promise(function(_0x2803dc,_0x5a9d2b){if(ami[_0xb964('0xe')]()==![]){return _0x5a9d2b(_0x4e8dae['error'](0x1f4,[config[_0xb964('0x10')]['ip'],config[_0xb964('0x10')][_0xb964('0x11')],_0xb964('0x1a')]['join']('\x20')));}var _0x3d95e9=schema(properties[_0xb964('0x75')])[_0xb964('0x2')](_0x4a2ebf);if(_0x3d95e9[_0xb964('0x57')]>0x0){return _0x5a9d2b(_0x4e8dae['error'](0x1f4,_[_0xb964('0x6d')](_0x3d95e9,_0xb964('0x18'))['join'](',\x20')));}var _0x2f7d9e=_[_0xb964('0x5d')](_0x4760b2['queueChannels'],{'uniqueid':_0x4a2ebf['uniqueid']});if(_0x2f7d9e&&_0x2f7d9e[_0xb964('0x5f')]){return ami[_0xb964('0x16')]({'action':'Hangup','channel':_0x2f7d9e[_0xb964('0x5f')]})[_0xb964('0x17')](function(_0x26ce8f){_0x2803dc({'code':0xc8,'message':[_0x4a2ebf[_0xb964('0x5e')],_0x26ce8f['message'][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')});})[_0xb964('0x19')](function(_0x45b6d8){_0x5a9d2b(_0x4e8dae[_0xb964('0xf')](0x1f5,[_0x4a2ebf['uniqueid'],_0x45b6d8['message'][_0xb964('0x65')]()][_0xb964('0x12')]('\x20')));});}else{return _0x5a9d2b(_0x4e8dae[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x1c8e7b){var _0x3d3584=this;return new Promise(function(_0x55ef89,_0x2d88e2){if(ami[_0xb964('0xe')]()==![]){return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f4,[config[_0xb964('0x10')]['ip'],config['asterisk']['username'],_0xb964('0x1a')][_0xb964('0x12')]('\x20')));}var _0x12266b=schema(properties[_0xb964('0x76')])[_0xb964('0x2')](_0x1c8e7b);if(_0x12266b['length']>0x0){return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f4,_[_0xb964('0x6d')](_0x12266b,_0xb964('0x18'))[_0xb964('0x12')](',\x20')));}var _0x377539=_[_0xb964('0x5d')](_0x4760b2[_0xb964('0x73')],{'uniqueid':_0x1c8e7b[_0xb964('0x5e')]});if(_0x377539&&_0x377539[_0xb964('0x5f')]){return ami['Action']({'action':_0xb964('0x77'),'channel':_0x377539[_0xb964('0x5f')],'exten':_0x1c8e7b['exten'],'context':_0x1c8e7b['context']||_0x377539[_0xb964('0x78')],'priority':0x1})[_0xb964('0x17')](function(_0x4348f7){_0x55ef89({'code':0xc8,'message':[_0x1c8e7b[_0xb964('0x5e')],_0x4348f7[_0xb964('0x18')][_0xb964('0x65')]()]['join']('\x20')});})['catch'](function(_0x37a420){_0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f5,[_0x1c8e7b['uniqueid'],_0x37a420[_0xb964('0x18')][_0xb964('0x65')]()]['join']('\x20')));});}else{return _0x2d88e2(_0x3d3584[_0xb964('0xf')](0x1f5,_0xb964('0x6c')));}});},'Agents':function(_0x36c47d){return new Promise(function(_0x3298ad,_0x1868a5){var _0x228b25=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0xb')]);_0x3298ad({'count':_0x228b25[_0xb964('0x57')],'rows':_0x228b25});});},'Telephones':function(_0x367eb8){return new Promise(function(_0x49707f,_0x541323){var _0x20c4f9=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x79')]);_0x49707f({'count':_0x20c4f9['length'],'rows':_0x20c4f9});});},'Trunks':function(_0x4a76f7){return new Promise(function(_0x4d1b94,_0x1e0889){var _0x2ba9e5=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7a')]);_0x4d1b94({'count':_0x2ba9e5[_0xb964('0x57')],'rows':_0x2ba9e5});});},'OutboundChannels':function(_0x3bc89e){return new Promise(function(_0x4a46e0,_0x2c636c){var _0x4dbe07=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7b')]);_0x4a46e0({'count':_0x4dbe07['length'],'rows':_0x4dbe07});});},'Outbound':function(_0xa63621){return new Promise(function(_0x466f12,_0x3ace12){_0x466f12(_0x4760b2[_0xb964('0x2d')]);});},'Campaigns':function(_0x28ab60){return new Promise(function(_0x53c7d0,_0x1dada2){var _0x15f7a8=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x7c')]);_0x53c7d0({'count':_0x15f7a8[_0xb964('0x57')],'rows':_0x15f7a8});});},'VoiceQueuesPreview':function(_0x1e336a){var _0x407ff7=this;return new Promise(function(_0x5f2b05,_0x12d7c0){_0x249313[_0xb964('0x7d')](_0x1e336a['id'])[_0xb964('0x17')](function(_0x26a401){_0x5f2b05({'code':0xc8,'message':_0x26a401[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x307b35){_0x12d7c0(_0x407ff7[_0xb964('0xf')](0x1f4,_0x307b35['message']));});});},'EventManager':function(_0x5419d3){var _0xeed18c=this;return new Promise(function(_0x1ea23a,_0x5b3c1d){if(!_0x5419d3['event']){return _0x5b3c1d(_0xeed18c[_0xb964('0xf')](0x1f4,_0xb964('0x7e')));}ami[_0xb964('0x7f')](_0xb964('0x80')+_0x5419d3[_0xb964('0x81')],_0x5419d3[_0xb964('0x18')]);_0x1ea23a({'code':0xc8,'message':_0x5419d3});});},'FaxAccounts':function(_0x208c09){return new Promise(function(_0x13816f,_0x34007a){var _0x4ab081=_[_0xb964('0x5a')](_0x4760b2[_0xb964('0x82')]);_0x13816f({'count':_0x4ab081[_0xb964('0x57')],'rows':_0x4ab081});});},'SendFax':function(_0x360036){var _0x2e7ad8=this;return new Promise(function(_0x20026a,_0x501ba9){_0xba9f19[_0xb964('0x83')](_0x360036)[_0xb964('0x17')](function(_0x403c84){_0x20026a({'code':0xc8,'message':_0x403c84[_0xb964('0x18')]});})['catch'](function(_0x9b630a){_0x501ba9(_0x2e7ad8[_0xb964('0xf')](0x1f4,_0x9b630a[_0xb964('0x18')]));});});},'CheckAfterSend':function(_0x534578){var _0xfcfaba=this;return new Promise(function(_0x2321f4,_0x4bc8ed){_0xba9f19['checkAfterSend'](_0x534578)[_0xb964('0x17')](function(_0x221010){_0x2321f4({'code':0xc8,'message':_0x221010[_0xb964('0x18')]});})[_0xb964('0x19')](function(_0x354c3){_0x4bc8ed(_0xfcfaba['error'](0x1f4,_0x354c3['message']));});});}};var _0x22bbb1=jayson['server'](_0xde47d5)[_0xb964('0x84')]();_0x22bbb1['on'](_0xb964('0xf'),function(_0x2ec697){return _0x204c7d(_0x2ec697);});_0x22bbb1['listen'](0x232a,'127.0.0.1',function(){console[_0xb964('0x85')](_0xb964('0x86'),0x232a);return _0x11a0c1(_0xb964('0x87')+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 1fb29d7..da7462f 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 _0xb821=['routeId','destcalleridnum','calleridname','Unknown','destcalleridname','','push','format','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','../../../../config/logger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','map','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xb821,0xa7));var _0x1b82=function(_0x21609e,_0x38c98b){_0x21609e=_0x21609e-0x0;var _0x5559b4=_0xb821[_0x21609e];return _0x5559b4;};'use strict';var _=require('lodash');var BPromise=require(_0x1b82('0x0'));var Redis=require(_0x1b82('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x1b82('0x2'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x1b82('0x3')]=_[_0x1b82('0x4')](config[_0x1b82('0x3')],{'host':_0x1b82('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b82('0x3')]));function emit(_0x192434,_0x202a5f,_0x3632dd,_0x18f45f,_0x7b87e8){logger[_0x1b82('0x6')](_0x1b82('0x7'),_0x192434,_0x202a5f['id'],_0x3632dd,_0x18f45f,JSON[_0x1b82('0x8')](_0x7b87e8));io['to'](_0x3632dd)['emit'](_0x18f45f,_0x7b87e8);}exports[_0x1b82('0x9')]=function(_0x30c6ee,_0x44dfd4,_0x14c57a,_0xcffb87){var _0x17a96b,_0x739f99;var _0x1ce719={};var _0x5f521f=Number(_0x14c57a[_0x1b82('0xa')]);var _0x241d11=_0x14c57a[_0x1b82('0xb')]?Boolean(Number(_0x14c57a[_0x1b82('0xb')])):![];var _0x50aed7;var _0x1a6285=![];if(!_['isNil'](_0x14c57a['data5'])){if(_0x14c57a[_0x1b82('0xc')]=='1')_0x1a6285=!![];}if(!_0x1a6285){if(_0xcffb87['xmd-contactid']){_0x1ce719['id']=_0xcffb87[_0x1b82('0xd')];}}if(!_0x1ce719['id']){_0x1ce719[_0x1b82('0xe')]=_0x5f521f;_0x50aed7=_0x14c57a['data3']&&_0x14c57a[_0x1b82('0xf')]!=='0'?_0x14c57a['data3']['split'](','):[_0x1b82('0x10')];_0x1ce719['$or']=_[_0x1b82('0x11')](_0x50aed7,function(_0x25228b){var _0xf42818={};_0xf42818[_0x25228b]=_0xcffb87['routeId']?_0xcffb87['destcalleridnum']:_0xcffb87[_0x1b82('0x12')];return _0xf42818;});}var _0x5d66c3=['id',_0x1b82('0x13'),_0x1b82('0x14'),_0x1b82('0x10'),'mobile',_0x1b82('0x15'),_0x1b82('0xe'),_0x1b82('0x16'),_0x1b82('0x17'),_0x1b82('0x18')];var _0x47e99b=_[_0x1b82('0x19')](_0x5d66c3,_0x50aed7);BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc[_0x1b82('0x1c')]({'attributes':_0x47e99b,'where':_0x1ce719}))[_0x1b82('0x1b')](function(_0x31fd64){_0x739f99=_0x31fd64;if(!_[_0x1b82('0x1d')](_0x739f99)){if(_0x739f99['length']===0x1){_0x17a96b=_0x739f99[0x0];logger[_0x1b82('0x6')](_0x1b82('0x1e'),_0xcffb87['uniqueid'],_0x44dfd4['id'],_0x17a96b['id']);}else{logger[_0x1b82('0x6')](_0x1b82('0x1f'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_['map'](_0x739f99,'id')[_0x1b82('0x21')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0xcffb87['uniqueid'],_0x44dfd4['id']);var _0xf2e556={'ListId':_0x5f521f};var _0x149d0f=_0x14c57a[_0x1b82('0x22')]&&_0x14c57a[_0x1b82('0x22')]!=='0'?_0x14c57a['data4']:_0x1b82('0x10');if(_0x241d11){logger[_0x1b82('0x6')](_0x1b82('0x23'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87[_0x1b82('0x12')]:_0xcffb87[_0x1b82('0x26')];if(_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])){_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!==''?_0xcffb87[_0x1b82('0x27')]:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!==_0x1b82('0x2a')?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}return BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc['createContact'](_0xf2e556))[_0x1b82('0x1b')](function(_0x29a31e){_0x17a96b=_0x29a31e;_0x739f99[_0x1b82('0x2b')](_0x29a31e);if(_0x17a96b){logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_0x17a96b['id']);}return;});}else{logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87['calleridnum']:_0xcffb87['destcalleridnum'];if(_[_0x1b82('0x24')](_0xcffb87['routeId'])){_0xf2e556['firstName']=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!==_0x1b82('0x2a')?_0xcffb87['calleridname']:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!==''?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}_0x17a96b=_0xf2e556;_0x739f99[_0x1b82('0x2b')](_0xf2e556);return;}}})['then'](function(){if(_0x30c6ee){emit(_0xcffb87['uniqueid'],_0x44dfd4,util[_0x1b82('0x2c')]('user:%s',_0x30c6ee[_0x1b82('0x2d')]),util[_0x1b82('0x2c')](_0x1b82('0x2e'),_0x14c57a[_0x1b82('0x2f')][_0x1b82('0x30')]()),{'evt':_[_0x1b82('0x31')](_0xcffb87,{'autoCreate':_0x241d11}),'contact':_0x17a96b===undefined?{}:_0x17a96b,'contacts':_0x739f99[_0x1b82('0x32')]===0x0?undefined:_0x739f99});}});}; \ No newline at end of file +var _0x5c12=['bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','map','destcalleridnum','firstName','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge'];(function(_0x1da6f3,_0x3c2d65){var _0x4ad902=function(_0xce6367){while(--_0xce6367){_0x1da6f3['push'](_0x1da6f3['shift']());}};_0x4ad902(++_0x3c2d65);}(_0x5c12,0x188));var _0x25c1=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x5c12[_0xdf3db6];return _0x4b7a65;};'use strict';var _=require('lodash');var BPromise=require(_0x25c1('0x0'));var Redis=require(_0x25c1('0x1'));var util=require('util');var config=require(_0x25c1('0x2'));var logger=require(_0x25c1('0x3'))(_0x25c1('0x4'));var cmContactRpc=require(_0x25c1('0x5'));config[_0x25c1('0x6')]=_[_0x25c1('0x7')](config[_0x25c1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x25c1('0x8'))(new Redis(config[_0x25c1('0x6')]));function emit(_0x382922,_0x4ab674,_0x5c69b1,_0x24981c,_0x3b69ba){logger[_0x25c1('0x9')](_0x25c1('0xa'),_0x382922,_0x4ab674['id'],_0x5c69b1,_0x24981c,JSON[_0x25c1('0xb')](_0x3b69ba));io['to'](_0x5c69b1)['emit'](_0x24981c,_0x3b69ba);}exports[_0x25c1('0xc')]=function(_0x41c89d,_0x11a223,_0x81f0f4,_0x2872b2){var _0x5e44e2,_0x196e2f;var _0x401734={};var _0x49fb8e=Number(_0x81f0f4[_0x25c1('0xd')]);var _0x209af5=_0x81f0f4[_0x25c1('0xe')]?Boolean(Number(_0x81f0f4[_0x25c1('0xe')])):![];var _0x5d3d11;var _0x569ef9=![];if(!_['isNil'](_0x81f0f4['data5'])){if(_0x81f0f4[_0x25c1('0xf')]=='1')_0x569ef9=!![];}if(!_0x569ef9){if(_0x2872b2[_0x25c1('0x10')]){_0x401734['id']=_0x2872b2[_0x25c1('0x10')];}}if(!_0x401734['id']){_0x401734[_0x25c1('0x11')]=_0x49fb8e;_0x5d3d11=_0x81f0f4[_0x25c1('0x12')]&&_0x81f0f4['data3']!=='0'?_0x81f0f4[_0x25c1('0x12')]['split'](','):['phone'];_0x401734['$or']=_[_0x25c1('0x13')](_0x5d3d11,function(_0x1a08b5){var _0x4dc64b={};_0x4dc64b[_0x1a08b5]=_0x2872b2['routeId']?_0x2872b2[_0x25c1('0x14')]:_0x2872b2['calleridnum'];return _0x4dc64b;});}var _0x7175d4=['id',_0x25c1('0x15'),'lastName','phone','mobile',_0x25c1('0x16'),_0x25c1('0x11'),_0x25c1('0x17'),_0x25c1('0x18'),'updatedAt'];var _0x119639=_[_0x25c1('0x19')](_0x7175d4,_0x5d3d11);BPromise[_0x25c1('0x1a')]()[_0x25c1('0x1b')](cmContactRpc['getContacts']({'attributes':_0x119639,'where':_0x401734}))['then'](function(_0x2a8a84){_0x196e2f=_0x2a8a84;if(!_[_0x25c1('0x1c')](_0x196e2f)){if(_0x196e2f[_0x25c1('0x1d')]===0x1){_0x5e44e2=_0x196e2f[0x0];logger[_0x25c1('0x9')](_0x25c1('0x1e'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id'],_0x5e44e2['id']);}else{logger[_0x25c1('0x9')](_0x25c1('0x20'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id'],_[_0x25c1('0x13')](_0x196e2f,'id')[_0x25c1('0x21')](','));}return;}else{logger[_0x25c1('0x9')](_0x25c1('0x22'),_0x2872b2['uniqueid'],_0x11a223['id']);var _0x2dadae={'ListId':_0x49fb8e};var _0x20dbb9=_0x81f0f4[_0x25c1('0x23')]&&_0x81f0f4[_0x25c1('0x23')]!=='0'?_0x81f0f4[_0x25c1('0x23')]:_0x25c1('0x24');if(_0x209af5){logger['info'](_0x25c1('0x25'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id']);_0x2dadae[_0x20dbb9]=_[_0x25c1('0x26')](_0x2872b2[_0x25c1('0x27')])?_0x2872b2[_0x25c1('0x28')]:_0x2872b2[_0x25c1('0x14')];if(_['isNil'](_0x2872b2[_0x25c1('0x27')])){_0x2dadae['firstName']=_0x2872b2[_0x25c1('0x29')]&&_0x2872b2[_0x25c1('0x29')]!==_0x25c1('0x2a')?_0x2872b2[_0x25c1('0x29')]:_0x25c1('0x2b');}else{_0x2dadae[_0x25c1('0x15')]=_0x2872b2[_0x25c1('0x2c')]&&_0x2872b2[_0x25c1('0x2c')]!==_0x25c1('0x2a')?_0x2872b2['destcalleridname']:_0x25c1('0x2b');}return BPromise['resolve']()['then'](cmContactRpc[_0x25c1('0x2d')](_0x2dadae))[_0x25c1('0x1b')](function(_0x4ef790){_0x5e44e2=_0x4ef790;_0x196e2f[_0x25c1('0x2e')](_0x4ef790);if(_0x5e44e2){logger['info'](_0x25c1('0x2f'),_0x2872b2['uniqueid'],_0x11a223['id'],_0x5e44e2['id']);}return;});}else{logger[_0x25c1('0x9')](_0x25c1('0x30'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id']);_0x2dadae[_0x20dbb9]=_[_0x25c1('0x26')](_0x2872b2[_0x25c1('0x27')])?_0x2872b2[_0x25c1('0x28')]:_0x2872b2[_0x25c1('0x14')];if(_[_0x25c1('0x26')](_0x2872b2['routeId'])){_0x2dadae[_0x25c1('0x15')]=_0x2872b2['calleridname']&&_0x2872b2[_0x25c1('0x29')]!==''?_0x2872b2[_0x25c1('0x29')]:_0x25c1('0x2b');}else{_0x2dadae[_0x25c1('0x15')]=_0x2872b2[_0x25c1('0x2c')]&&_0x2872b2[_0x25c1('0x2c')]!==_0x25c1('0x2a')?_0x2872b2[_0x25c1('0x2c')]:_0x25c1('0x2b');}_0x5e44e2=_0x2dadae;_0x196e2f[_0x25c1('0x2e')](_0x2dadae);return;}}})[_0x25c1('0x1b')](function(){if(_0x41c89d){emit(_0x2872b2[_0x25c1('0x1f')],_0x11a223,util[_0x25c1('0x31')](_0x25c1('0x32'),_0x41c89d[_0x25c1('0x33')]),util[_0x25c1('0x31')](_0x25c1('0x34'),_0x81f0f4[_0x25c1('0x35')][_0x25c1('0x36')]()),{'evt':_[_0x25c1('0x37')](_0x2872b2,{'autoCreate':_0x209af5}),'contact':_0x5e44e2===undefined?{}:_0x5e44e2,'contacts':_0x196e2f[_0x25c1('0x1d')]===0x0?undefined:_0x196e2f});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 54aa43e..e28ff4b 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 _0x02c9=['data2','html','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','600','data6','winApplication','render','winArguments','format','user:%s','name','toLowerCase','merge','trigger:%s','exec','integration','routeId','urlforward','script','parse','query','replace','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','value','AccountId','operator','upperFirst','interaction','message','event','queue','agent','membername','lastevent','exports','util','lodash','./urlforward','./integration','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','prototype','clone','undefined','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','action','contactmanager','motionbar','browser','data1','popup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02c9,0x125));var _0x902c=function(_0x5e1f02,_0x3333f3){_0x5e1f02=_0x5e1f02-0x0;var _0xe2e013=_0x02c9[_0x5e1f02];return _0xe2e013;};'use strict';var util=require(_0x902c('0x0'));var _=require(_0x902c('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x902c('0x2'));var integration=require(_0x902c('0x3'));var cmContact=require('./cmContact');var script=require(_0x902c('0x4'));var config=require('../../../config/environment');var logger=require(_0x902c('0x5'))(_0x902c('0x6'));var ami=require(_0x902c('0x7'));config[_0x902c('0x8')]=_[_0x902c('0x9')](config[_0x902c('0x8')],{'host':_0x902c('0xa'),'port':0x18eb});var io=require(_0x902c('0xb'))(new Redis(config[_0x902c('0x8')]));var operators={'equals':function(_0x21e492,_0x4f1613){return _0x21e492==_0x4f1613;},'not_equals':function(_0x52d24b,_0x4de302){return _0x52d24b!=_0x4de302;}};var barAndWebActions=['popup',_0x902c('0xc'),_0x902c('0xd')];function Trigger(_0x1587ec){this[_0x902c('0xe')]=_0x1587ec[_0x902c('0xe')];this[_0x902c('0xf')]=_0x1587ec['agents'];this[_0x902c('0x10')]=_0x1587ec[_0x902c('0x10')];this[_0x902c('0x11')]=_0x1587ec['templates'];this[_0x902c('0x12')]=_0x1587ec['voiceExtensions'];this['zendeskAccounts']=_0x1587ec[_0x902c('0x13')];this[_0x902c('0x14')]=_0x1587ec['freshdeskAccounts'];this[_0x902c('0x15')]=_0x1587ec[_0x902c('0x15')];this[_0x902c('0x16')]=_0x1587ec[_0x902c('0x16')];this[_0x902c('0x17')]=_0x1587ec[_0x902c('0x17')];this[_0x902c('0x18')]=_0x1587ec[_0x902c('0x18')];this[_0x902c('0x19')]=_0x1587ec['vtigerAccounts'];this[_0x902c('0x1a')]=_0x1587ec[_0x902c('0x1a')];this[_0x902c('0x1b')]=_0x1587ec[_0x902c('0x1b')];this[_0x902c('0x1c')]=_0x1587ec[_0x902c('0x1c')];this['accounts']={'zendesk':this[_0x902c('0x13')],'salesforce':this[_0x902c('0x15')],'freshdesk':this[_0x902c('0x14')],'sugarcrm':this[_0x902c('0x16')],'zoho':this[_0x902c('0x17')],'desk':this[_0x902c('0x18')],'vtiger':this[_0x902c('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x902c('0x1c')],'servicenow':this[_0x902c('0x1a')]};ami['on']('custom:agentcalled',this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x1f'),this['syncCustomEvent'][_0x902c('0x1e')](this));ami['on'](_0x902c('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x902c('0x21'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x22'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x23'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on']('custom:agentbusy',this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x24'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x25'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x26'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x27'),this[_0x902c('0x1d')]['bind'](this));ami['on'](_0x902c('0x28'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x29'),this['syncAgentDial']['bind'](this));ami['on'](_0x902c('0x2a'),this[_0x902c('0x2b')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x2c'),this[_0x902c('0x2b')]['bind'](this));ami['on']('custom:newinteraction',this[_0x902c('0x1d')]['bind'](this));ami['on'](_0x902c('0x2d'),this[_0x902c('0x1d')]['bind'](this));ami['on']('custom:substatus',this['syncCustomEvent']['bind'](this));ami['on'](_0x902c('0x2e'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x2f'),this[_0x902c('0x1d')][_0x902c('0x1e')](this));ami['on'](_0x902c('0x30'),this[_0x902c('0x1d')]['bind'](this));ami['on'](_0x902c('0x31'),this[_0x902c('0x1d')]['bind'](this));}Trigger['prototype'][_0x902c('0x32')]=function(_0x34dc53,_0x4c2d22,_0x16544f){logger[_0x902c('0x33')](_0x34dc53,_0x4c2d22,JSON['stringify'](_0x16544f));io['to'](_0x34dc53)['emit'](_0x4c2d22,_0x16544f);};Trigger[_0x902c('0x34')][_0x902c('0x1d')]=function(_0x59d62e){var _0x5334d9=_[_0x902c('0x35')](_0x59d62e);if(typeof _0x5334d9['motionChannel']===_0x902c('0x36')){_0x5334d9[_0x902c('0x37')]=_0x902c('0x38');}this[_0x902c('0x39')](_0x5334d9);};Trigger[_0x902c('0x34')][_0x902c('0x2b')]=function(_0x23ba43){if(this[_0x902c('0xf')][_0x23ba43[_0x902c('0x3a')]]){this[_0x902c('0x1d')](_0x23ba43);}};Trigger[_0x902c('0x34')][_0x902c('0x39')]=function(_0xfe5964){var _0x5559ac;for(var _0x201fe7 in this[_0x902c('0xe')]){if(this[_0x902c('0xe')][_0x902c('0x3b')](_0x201fe7)){if(this['triggers'][_0x201fe7][_0x902c('0x3c')]){_0x5559ac=this['checkTrigger'](this[_0x902c('0xe')][_0x201fe7],_0xfe5964);if(_0x5559ac){_['merge'](_0xfe5964,_0xfe5964[_0x902c('0x3d')]);for(var _0x3f7425=0x0,_0x60e9ba,_0x16ab74,_0x17096a;_0x3f74250x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5fc3[_0xcf4569];return _0x7fef;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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 18f717e..59ab2b7 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 _0xf1a0=['nameField','customField','idField','indexOf','content','incidents','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','queue','callDirection','ticketId','format','emit','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','POST','clientId','remoteUri','username','password','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','replace','%2b','value','telephone1',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type'];(function(_0x4c7c25,_0x1e16a8){var _0x297619=function(_0x453f76){while(--_0x453f76){_0x4c7c25['push'](_0x4c7c25['shift']());}};_0x297619(++_0x1e16a8);}(_0xf1a0,0x1a2));var _0x0f1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1a0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x0f1a('0x0'));var util=require(_0x0f1a('0x1'));var intUtil=require('./util');var md5=require(_0x0f1a('0x2'));var Redis=require(_0x0f1a('0x3'));var logger=require(_0x0f1a('0x4'))(_0x0f1a('0x5'));var config=require(_0x0f1a('0x6'));config[_0x0f1a('0x7')]=_[_0x0f1a('0x8')](config['redis'],{'host':_0x0f1a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x9d6f12,_0x52ed6e,_0x5dd791){var _0x50904b={'method':_0x0f1a('0xa'),'uri':_0x52ed6e,'form':{'client_id':_0x9d6f12[_0x0f1a('0xb')],'resource':_0x9d6f12[_0x0f1a('0xc')],'username':_0x9d6f12[_0x0f1a('0xd')],'password':_0x9d6f12[_0x0f1a('0xe')],'grant_type':'password','client_secret':_0x9d6f12['clientSecret']},'json':!![]};return rp(_0x50904b)['then'](function(_0x2490c6){return _0x2490c6[_0x0f1a('0xf')];})[_0x0f1a('0x10')](function(_0x13b680){logger['error']('['+[_0x5dd791[_0x0f1a('0x11')]()]+_0x0f1a('0x12'));return _0x13b680[_0x0f1a('0x13')];});}function getUser(_0x142032,_0x3f0a52,_0x3d4a3c,_0x1d5ff1,_0x4a24f8,_0x5a822c){return new BPromise(function(_0x113873,_0x202194){return getAuthToken(_0x3f0a52,_0x1d5ff1,_0x5a822c)[_0x0f1a('0x14')](function(_0x4e3edc){var _0x24d1ab={'method':_0x0f1a('0x15'),'uri':_0x4a24f8+_0x0f1a('0x16'),'headers':{'Authorization':_0x0f1a('0x17')+_0x4e3edc,'OData-Version':_0x0f1a('0x18')},'json':!![]};return rp(_0x24d1ab);})[_0x0f1a('0x14')](function(_0x14f753){var _0x557ac5=_0x14f753['value'];var _0x531fa4=![];var _0x16f43d=null;if(!_[_0x0f1a('0x19')](_0x3d4a3c)){if(intUtil[_0x0f1a('0x1a')](_0x3d4a3c[_0x0f1a('0x1b')])){_0x142032[_0x0f1a('0x1c')]=_0x3d4a3c['email'];for(_0x16f43d=0x0;_0x16f43d<_0x557ac5['length'];_0x16f43d++){if(_0x557ac5[_0x16f43d][_0x0f1a('0x1d')]===_0x3d4a3c[_0x0f1a('0x1b')]&&!_0x557ac5[_0x16f43d]['isdisabled']){_0x531fa4=!![];logger[_0x0f1a('0x1e')]('['+[_0x5a822c[_0x0f1a('0x11')]()]+_0x0f1a('0x1f')+_0x557ac5[_0x16f43d][_0x0f1a('0x20')]+'!');_0x142032[_0x0f1a('0x21')]=_0x557ac5[_0x16f43d][_0x0f1a('0x20')];}}}}if(!_0x531fa4){logger['info']('['+[_0x5a822c[_0x0f1a('0x11')]()]+_0x0f1a('0x22'));_0x142032['userEmail']=_0x3f0a52[_0x0f1a('0xd')];for(_0x16f43d=0x0;_0x16f43d<_0x557ac5[_0x0f1a('0x23')];_0x16f43d++){if(_0x557ac5[_0x16f43d][_0x0f1a('0x1d')]===_0x3f0a52[_0x0f1a('0xd')]){_0x142032[_0x0f1a('0x21')]=_0x557ac5[_0x16f43d][_0x0f1a('0x20')];}}}_0x113873(_0x142032);})[_0x0f1a('0x10')](function(_0x239082){_0x202194(_0x239082[_0x0f1a('0x13')]);});});}function createEndUser(_0x4ea750,_0x25fd63,_0x138f87,_0x4615dd,_0x4eef02,_0x31dcea){return new BPromise(function(_0x901ade,_0x32a0c9){return getAuthToken(_0x25fd63,_0x138f87,_0x31dcea)[_0x0f1a('0x14')](function(_0x17e90f){var _0x3d9b39=_0x31dcea['toLowerCase']()===_0x0f1a('0x24')?_0x4eef02[_0x0f1a('0x25')]:_0x4eef02[_0x0f1a('0x26')];var _0x5dcaed={'method':_0x0f1a('0xa'),'uri':_0x4615dd+_0x0f1a('0x27'),'body':{'telephone1':_0x3d9b39,'fullname':_0x3d9b39,'firstname':_0x3d9b39,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0f1a('0x28')+_0x4ea750[_0x0f1a('0x21')]+')'},'headers':{'Authorization':_0x0f1a('0x17')+_0x17e90f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5dcaed);})[_0x0f1a('0x14')](function(_0x4b240e){var _0x4f812e=_0x4b240e[_0x0f1a('0x29')][_0x0f1a('0x2a')];var _0x37d083=_0x4f812e[_0x0f1a('0x2b')](_0x4f812e['lastIndexOf']('(')+0x1,_0x4f812e[_0x0f1a('0x2c')](')'));_0x4ea750[_0x0f1a('0x2d')]=_0x37d083;_0x901ade(_0x4ea750);})[_0x0f1a('0x10')](function(_0x5b1ec8){_0x32a0c9(_0x5b1ec8['message']);});});}function getEndUser(_0x4db7cb,_0x5f304c,_0x4f4b1c,_0x3dbacd,_0x502fd9,_0xc864d3){return new BPromise(function(_0x4d6316,_0x48c99b){var _0x32f0b0=_0xc864d3[_0x0f1a('0x2e')]()===_0x0f1a('0x24')?_0x502fd9[_0x0f1a('0x25')]:_0x502fd9[_0x0f1a('0x26')];return getAuthToken(_0x5f304c,_0x4f4b1c,_0xc864d3)['then'](function(_0x20db0d){var _0x18886f={'method':_0x0f1a('0x15'),'uri':_0x3dbacd+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x32f0b0[_0x0f1a('0x2f')]('+',_0x0f1a('0x30'))+'\x27','headers':{'Authorization':_0x0f1a('0x17')+_0x20db0d,'If-None-Match':null,'OData-Version':_0x0f1a('0x18')},'json':!![]};return rp(_0x18886f);})[_0x0f1a('0x14')](function(_0x1bd94b){var _0x4b9d0e=null;if(_0x1bd94b){var _0x333c3f=_0x1bd94b[_0x0f1a('0x31')];var _0x54db64=![];for(_0x4b9d0e=0x0;_0x4b9d0e<_0x333c3f['length'];_0x4b9d0e++){if(_0x333c3f[_0x4b9d0e][_0x0f1a('0x32')]===_0x32f0b0){_0x54db64=!![];_0x4db7cb[_0x0f1a('0x2d')]=_0x333c3f[_0x4b9d0e]['contactid'];}}if(_0x54db64){_0x4d6316(_0x4db7cb);}else{return createEndUser(_0x4db7cb,_0x5f304c,_0x4f4b1c,_0x3dbacd,_0x502fd9,_0xc864d3)[_0x0f1a('0x14')](function(_0x569d08){logger[_0x0f1a('0x1e')]('['+[_0xc864d3['toUpperCase']()]+']\x20Enduser\x20created!',_0x569d08[_0x0f1a('0x2d')]);_0x4d6316(_0x569d08);});}}else{return createEndUser(_0x4db7cb,_0x5f304c,_0x4f4b1c,_0x3dbacd,_0x502fd9,_0xc864d3)[_0x0f1a('0x14')](function(_0x1a7bcf){logger['info']('['+[_0xc864d3[_0x0f1a('0x11')]()]+_0x0f1a('0x33'),_0x1a7bcf[_0x0f1a('0x2d')]);_0x4d6316(_0x1a7bcf);});}});});}function getCustomFields(_0x459969,_0x3c7aa7,_0x550c3b){var _0x184826={};if(_0x459969[_0x0f1a('0x23')]>0x0){_[_0x0f1a('0x34')](_0x459969,function(_0x2dedde){if(_[_0x0f1a('0x35')]([_0x0f1a('0x36'),_0x0f1a('0x37')],_0x2dedde[_0x0f1a('0x38')])&&_0x2dedde[_0x0f1a('0x39')]&&!_0x2dedde[_0x0f1a('0x3a')]){var _0x23b809=_0x2dedde[_0x0f1a('0x3b')][_0x0f1a('0x2e')]();var _0x496006=_0x23b809['substring'](0x0,_0x23b809[_0x0f1a('0x3c')]('_'));var _0x4a2eec=_0x23b809['substring'](_0x23b809[_0x0f1a('0x3c')]('_')+0x1);if(_0x496006===_0x550c3b){_0x184826[_0x4a2eec]=_0x2dedde[_0x0f1a('0x3d')];}}});}return _0x184826;}function getTicket(_0x16f296,_0x58c216,_0x142e5d,_0x44f3c5,_0x1cce49,_0x339c40,_0x5342ae){return new BPromise(function(_0x4e0a5c,_0x2df6a9){var _0x37ef10;return getAuthToken(_0x58c216,_0x142e5d,_0x5342ae)['then'](function(_0x332bae){if(_0x339c40['ticketType']==='incident'){_0x37ef10={'method':_0x0f1a('0xa'),'uri':_0x44f3c5+_0x0f1a('0x3e'),'body':Object['assign']({},{'title':intUtil[_0x0f1a('0x3f')](_0x339c40[_0x0f1a('0x40')],_0x1cce49,'\x20'),'description':intUtil[_0x0f1a('0x3f')](_0x339c40[_0x0f1a('0x41')],_0x1cce49,'\x0a'),'customerid_contact@odata.bind':_0x0f1a('0x42')+_0x16f296['enduserId']+')','ownerid@odata.bind':_0x0f1a('0x28')+_0x16f296['userId']+')','caseorigincode':'1'},getCustomFields(_0x339c40[_0x0f1a('0x43')],_0x1cce49,_0x339c40[_0x0f1a('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x332bae,'OData-Version':_0x0f1a('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x339c40[_0x0f1a('0x44')]===_0x0f1a('0x45')){_0x37ef10={'method':_0x0f1a('0xa'),'uri':_0x44f3c5+_0x0f1a('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x0f1a('0x3f')](_0x339c40[_0x0f1a('0x40')],_0x1cce49,'\x20'),'phonenumber':String(_0x1cce49[_0x0f1a('0x26')]),'description':intUtil[_0x0f1a('0x3f')](_0x339c40[_0x0f1a('0x41')],_0x1cce49,'\x0a'),'regardingobjectid_contact@odata.bind':_0x0f1a('0x42')+_0x16f296[_0x0f1a('0x2d')]+')','ownerid@odata.bind':'/systemusers('+_0x16f296['userId']+')','directioncode':_0x16f296['callDirection']===_0x0f1a('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x16f296[_0x0f1a('0x21')]+')','participationtypemask':_0x16f296[_0x0f1a('0x48')]===_0x0f1a('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x0f1a('0x42')+_0x16f296[_0x0f1a('0x2d')]+')','participationtypemask':_0x16f296[_0x0f1a('0x48')]===_0x0f1a('0x47')?0x1:0x2}]},getCustomFields(_0x339c40[_0x0f1a('0x43')],_0x1cce49,_0x339c40[_0x0f1a('0x44')])),'headers':{'Authorization':_0x0f1a('0x17')+_0x332bae,'OData-Version':_0x0f1a('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x37ef10);})[_0x0f1a('0x14')](function(_0xed755d){var _0x420c57=_0xed755d['headers']['odata-entityid'];var _0x401d4a=_0x420c57[_0x0f1a('0x2b')](_0x420c57[_0x0f1a('0x2c')]('(')+0x1,_0x420c57[_0x0f1a('0x2c')](')'));_0x16f296[_0x0f1a('0x49')]=_0x401d4a;_0x4e0a5c(_0x16f296);})[_0x0f1a('0x10')](function(_0x2b2f75){_0x2df6a9(_0x2b2f75[_0x0f1a('0x13')]);});});}function emit(_0x593e35,_0x3663ca,_0x3ec12e,_0x121a69){var _0x1049ad={'uri':util[_0x0f1a('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x593e35,_0x3ec12e,_0x121a69)};io['to'](util[_0x0f1a('0x4a')]('user:%s',_0x3663ca))[_0x0f1a('0x4b')]('trigger:browser:url',_0x1049ad);}exports['cs']=function(_0x384469,_0x3f9519,_0x21109c,_0x3a3f25,_0xc37cfc,_0x100f1c,_0x142f33,_0x8ede21){var _0x37f06a={};_0x100f1c[_0x0f1a('0xc')]=intUtil['stripTrailingSlash'](_0x100f1c['remoteUri']);_0x100f1c[_0x0f1a('0x4c')]=intUtil[_0x0f1a('0x4d')](_0x100f1c[_0x0f1a('0x4c')]);_0x37f06a[_0x0f1a('0x48')]=_0x8ede21===_0x0f1a('0x47')||_0x8ede21===_0x0f1a('0x4e')?_0x0f1a('0x47'):_0x0f1a('0x24');var _0x406e43=util['format'](_0x0f1a('0x4f'),_0x100f1c[_0x0f1a('0xc')]);var _0x295de5=util[_0x0f1a('0x4a')]('https://login.microsoftonline.com/%s/oauth2/token',_0x100f1c[_0x0f1a('0x50')]);var _0x36c2bb=util['format'](_0x0f1a('0x51'),_0x100f1c[_0x0f1a('0x4c')],_0x3f9519[_0x0f1a('0x52')],md5(_0x3f9519[_0x0f1a('0x52')]));if(_0xc37cfc&&_0xc37cfc['monitor_format']){logger[_0x0f1a('0x1e')](_0x0f1a('0x53'),'Recording\x20is\x20enabled!');_0x3f9519['recordingURL']=_0x36c2bb;}else if(_0x142f33&&_0x142f33[_0x0f1a('0x54')]&&_0x142f33[_0x0f1a('0x54')]!=='none'){logger['info'](_0x0f1a('0x55'),_0x0f1a('0x56'));_0x3f9519['recordingURL']=_0x36c2bb;}else{_0x3f9519[_0x0f1a('0x57')]='';}return getUser(_0x37f06a,_0x100f1c,_0x3a3f25,_0x295de5,_0x406e43,_0x8ede21)['then'](function(_0x429c36){logger['info']('['+_0x8ede21[_0x0f1a('0x11')]()+']\x20The\x20User\x20ID\x20is:',_0x429c36[_0x0f1a('0x21')]);logger[_0x0f1a('0x1e')]('['+_0x8ede21[_0x0f1a('0x11')]()+_0x0f1a('0x58'),_0x429c36[_0x0f1a('0x1c')]);return getEndUser(_0x429c36,_0x100f1c,_0x295de5,_0x406e43,_0x3f9519,_0x8ede21);})['then'](function(_0x26c514){logger['info']('['+_0x8ede21[_0x0f1a('0x11')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x26c514['enduserId']);logger[_0x0f1a('0x1e')]('['+_0x8ede21[_0x0f1a('0x11')]()+_0x0f1a('0x59'),_0x3f9519['calleridnum']);return getTicket(_0x26c514,_0x100f1c,_0x295de5,_0x406e43,_0x3f9519,_0x21109c,_0x8ede21);})['then'](function(_0x428f7a){logger[_0x0f1a('0x1e')](util['format']('['+_0x8ede21[_0x0f1a('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x21109c[_0x0f1a('0x44')],_0x428f7a['ticketId']));logger[_0x0f1a('0x1e')](util['format']('['+_0x8ede21[_0x0f1a('0x11')]()+_0x0f1a('0x5a'),_0x8ede21));if(_0x8ede21!=='unmanaged'){logger[_0x0f1a('0x1e')]('['+_0x8ede21[_0x0f1a('0x11')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x100f1c['remoteUri'],_0x3a3f25[_0x0f1a('0x5b')],_0x21109c['ticketType'],_0x428f7a[_0x0f1a('0x49')]);}})[_0x0f1a('0x10')](function(_0x2b2e16){logger[_0x0f1a('0x5c')]('['+_0x8ede21[_0x0f1a('0x11')]()+_0x0f1a('0x5d'),util[_0x0f1a('0x5e')](_0x2b2e16,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc0e6=['contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','type','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum','calleridnum'];(function(_0x5b7ef9,_0x7cf7a){var _0x377ed5=function(_0x110b7d){while(--_0x110b7d){_0x5b7ef9['push'](_0x5b7ef9['shift']());}};_0x377ed5(++_0x7cf7a);}(_0xc0e6,0x1df));var _0x6c0e=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xc0e6[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x6c0e('0x0'));var BPromise=require(_0x6c0e('0x1'));var rp=require(_0x6c0e('0x2'));var util=require(_0x6c0e('0x3'));var intUtil=require(_0x6c0e('0x4'));var md5=require(_0x6c0e('0x5'));var Redis=require(_0x6c0e('0x6'));var logger=require(_0x6c0e('0x7'))(_0x6c0e('0x8'));var config=require(_0x6c0e('0x9'));config[_0x6c0e('0xa')]=_[_0x6c0e('0xb')](config['redis'],{'host':_0x6c0e('0xc'),'port':0x18eb});var io=require(_0x6c0e('0xd'))(new Redis(config[_0x6c0e('0xa')]));function getAuthToken(_0x2bfa96,_0x39593d,_0x412a70){var _0xa970e={'method':_0x6c0e('0xe'),'uri':_0x39593d,'form':{'client_id':_0x2bfa96[_0x6c0e('0xf')],'resource':_0x2bfa96[_0x6c0e('0x10')],'username':_0x2bfa96[_0x6c0e('0x11')],'password':_0x2bfa96['password'],'grant_type':_0x6c0e('0x12'),'client_secret':_0x2bfa96['clientSecret']},'json':!![]};return rp(_0xa970e)[_0x6c0e('0x13')](function(_0x57982e){return _0x57982e[_0x6c0e('0x14')];})[_0x6c0e('0x15')](function(_0x5ae5e8){logger[_0x6c0e('0x16')]('['+[_0x412a70['toUpperCase']()]+_0x6c0e('0x17'));return _0x5ae5e8[_0x6c0e('0x18')];});}function getUser(_0x122598,_0x3a9249,_0x2d7dcb,_0x2b6904,_0x2f1a9d,_0x39e98f){return new BPromise(function(_0x31a499,_0x2c02ae){return getAuthToken(_0x3a9249,_0x2b6904,_0x39e98f)[_0x6c0e('0x13')](function(_0x5cb0f2){var _0x221a13={'method':_0x6c0e('0x19'),'uri':_0x2f1a9d+_0x6c0e('0x1a'),'headers':{'Authorization':'Bearer\x20'+_0x5cb0f2,'OData-Version':_0x6c0e('0x1b')},'json':!![]};return rp(_0x221a13);})[_0x6c0e('0x13')](function(_0x53bd2c){var _0x3b21af=_0x53bd2c[_0x6c0e('0x1c')];var _0x203fa9=![];var _0xf655dd=null;if(!_[_0x6c0e('0x1d')](_0x2d7dcb)){if(intUtil[_0x6c0e('0x1e')](_0x2d7dcb['email'])){_0x122598[_0x6c0e('0x1f')]=_0x2d7dcb[_0x6c0e('0x20')];for(_0xf655dd=0x0;_0xf655dd<_0x3b21af[_0x6c0e('0x21')];_0xf655dd++){if(_0x3b21af[_0xf655dd][_0x6c0e('0x22')]===_0x2d7dcb[_0x6c0e('0x20')]&&!_0x3b21af[_0xf655dd][_0x6c0e('0x23')]){_0x203fa9=!![];logger[_0x6c0e('0x24')]('['+[_0x39e98f[_0x6c0e('0x25')]()]+_0x6c0e('0x26')+_0x3b21af[_0xf655dd][_0x6c0e('0x27')]+'!');_0x122598['userId']=_0x3b21af[_0xf655dd][_0x6c0e('0x27')];}}}}if(!_0x203fa9){logger[_0x6c0e('0x24')]('['+[_0x39e98f[_0x6c0e('0x25')]()]+_0x6c0e('0x28'));_0x122598[_0x6c0e('0x1f')]=_0x3a9249[_0x6c0e('0x11')];for(_0xf655dd=0x0;_0xf655dd<_0x3b21af[_0x6c0e('0x21')];_0xf655dd++){if(_0x3b21af[_0xf655dd][_0x6c0e('0x22')]===_0x3a9249['username']){_0x122598[_0x6c0e('0x29')]=_0x3b21af[_0xf655dd]['systemuserid'];}}}_0x31a499(_0x122598);})[_0x6c0e('0x15')](function(_0x3b9d27){_0x2c02ae(_0x3b9d27[_0x6c0e('0x18')]);});});}function createEndUser(_0x398ce6,_0x88c77c,_0x304aa5,_0x2a26e6,_0x218cea,_0x44f97a){return new BPromise(function(_0x4def31,_0xea664e){return getAuthToken(_0x88c77c,_0x304aa5,_0x44f97a)[_0x6c0e('0x13')](function(_0x440d60){var _0x434ed9=_0x44f97a[_0x6c0e('0x2a')]()===_0x6c0e('0x2b')?_0x218cea[_0x6c0e('0x2c')]:_0x218cea[_0x6c0e('0x2d')];var _0x4f66a5={'method':_0x6c0e('0xe'),'uri':_0x2a26e6+_0x6c0e('0x2e'),'body':{'telephone1':_0x434ed9,'fullname':_0x434ed9,'firstname':_0x434ed9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6c0e('0x2f')+_0x398ce6[_0x6c0e('0x29')]+')'},'headers':{'Authorization':_0x6c0e('0x30')+_0x440d60,'OData-Version':_0x6c0e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4f66a5);})[_0x6c0e('0x13')](function(_0x7b1dbb){var _0x475218=_0x7b1dbb[_0x6c0e('0x31')][_0x6c0e('0x32')];var _0x34ce67=_0x475218[_0x6c0e('0x33')](_0x475218[_0x6c0e('0x34')]('(')+0x1,_0x475218[_0x6c0e('0x34')](')'));_0x398ce6[_0x6c0e('0x35')]=_0x34ce67;_0x4def31(_0x398ce6);})[_0x6c0e('0x15')](function(_0x1317bf){_0xea664e(_0x1317bf['message']);});});}function getEndUser(_0x3a97d5,_0x3e74c1,_0xd210d1,_0x446f55,_0x352484,_0x265309){return new BPromise(function(_0x37d9d9,_0x2e8a39){var _0x440346=_0x265309[_0x6c0e('0x2a')]()===_0x6c0e('0x2b')?_0x352484['destcalleridnum']:_0x352484[_0x6c0e('0x2d')];return getAuthToken(_0x3e74c1,_0xd210d1,_0x265309)[_0x6c0e('0x13')](function(_0x5dccb6){var _0x335efb={'method':'GET','uri':_0x446f55+_0x6c0e('0x36')+_0x440346['replace']('+',_0x6c0e('0x37'))+'\x27','headers':{'Authorization':_0x6c0e('0x30')+_0x5dccb6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x335efb);})[_0x6c0e('0x13')](function(_0x21d0f2){var _0x38dbe8=null;if(_0x21d0f2){var _0x29e38=_0x21d0f2[_0x6c0e('0x1c')];var _0x2e6e63=![];for(_0x38dbe8=0x0;_0x38dbe8<_0x29e38[_0x6c0e('0x21')];_0x38dbe8++){if(_0x29e38[_0x38dbe8]['telephone1']===_0x440346){_0x2e6e63=!![];_0x3a97d5[_0x6c0e('0x35')]=_0x29e38[_0x38dbe8]['contactid'];}}if(_0x2e6e63){_0x37d9d9(_0x3a97d5);}else{return createEndUser(_0x3a97d5,_0x3e74c1,_0xd210d1,_0x446f55,_0x352484,_0x265309)[_0x6c0e('0x13')](function(_0x5f5995){logger[_0x6c0e('0x24')]('['+[_0x265309['toUpperCase']()]+_0x6c0e('0x38'),_0x5f5995[_0x6c0e('0x35')]);_0x37d9d9(_0x5f5995);});}}else{return createEndUser(_0x3a97d5,_0x3e74c1,_0xd210d1,_0x446f55,_0x352484,_0x265309)[_0x6c0e('0x13')](function(_0xaee586){logger[_0x6c0e('0x24')]('['+[_0x265309[_0x6c0e('0x25')]()]+_0x6c0e('0x39'),_0xaee586[_0x6c0e('0x35')]);_0x37d9d9(_0xaee586);});}});});}function getCustomFields(_0x417c37,_0x14fb76,_0x12ce53){var _0x430472={};if(_0x417c37['length']>0x0){_[_0x6c0e('0x3a')](_0x417c37,function(_0x3a257e){if(_['includes']([_0x6c0e('0x3b'),_0x6c0e('0x3c')],_0x3a257e[_0x6c0e('0x3d')])&&_0x3a257e['nameField']&&!_0x3a257e['customField']){var _0xa8b9e5=_0x3a257e[_0x6c0e('0x3e')][_0x6c0e('0x2a')]();var _0x31588d=_0xa8b9e5[_0x6c0e('0x33')](0x0,_0xa8b9e5[_0x6c0e('0x3f')]('_'));var _0x53629c=_0xa8b9e5[_0x6c0e('0x33')](_0xa8b9e5[_0x6c0e('0x3f')]('_')+0x1);if(_0x31588d===_0x12ce53){_0x430472[_0x53629c]=_0x3a257e[_0x6c0e('0x40')];}}});}return _0x430472;}function getTicket(_0x1a17fb,_0x3fde9d,_0x27b256,_0x1cecba,_0x53c2fd,_0x1bca2a,_0x302fc3){return new BPromise(function(_0x2ec2ab,_0x1ad607){var _0x4a9e3b;return getAuthToken(_0x3fde9d,_0x27b256,_0x302fc3)['then'](function(_0x1d6753){if(_0x1bca2a[_0x6c0e('0x41')]===_0x6c0e('0x42')){_0x4a9e3b={'method':_0x6c0e('0xe'),'uri':_0x1cecba+_0x6c0e('0x43'),'body':Object[_0x6c0e('0x44')]({},{'title':intUtil[_0x6c0e('0x45')](_0x1bca2a[_0x6c0e('0x46')],_0x53c2fd,'\x20'),'description':intUtil[_0x6c0e('0x45')](_0x1bca2a[_0x6c0e('0x47')],_0x53c2fd,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x1a17fb['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x1a17fb[_0x6c0e('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x1bca2a[_0x6c0e('0x48')],_0x53c2fd,_0x1bca2a[_0x6c0e('0x41')])),'headers':{'Authorization':_0x6c0e('0x30')+_0x1d6753,'OData-Version':_0x6c0e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1bca2a['ticketType']===_0x6c0e('0x49')){_0x4a9e3b={'method':'POST','uri':_0x1cecba+_0x6c0e('0x4a'),'body':Object[_0x6c0e('0x44')]({},{'subject':intUtil[_0x6c0e('0x45')](_0x1bca2a[_0x6c0e('0x46')],_0x53c2fd,'\x20'),'phonenumber':String(_0x53c2fd[_0x6c0e('0x2d')]),'description':intUtil[_0x6c0e('0x45')](_0x1bca2a[_0x6c0e('0x47')],_0x53c2fd,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c0e('0x4b')+_0x1a17fb['enduserId']+')','ownerid@odata.bind':_0x6c0e('0x2f')+_0x1a17fb[_0x6c0e('0x29')]+')','directioncode':_0x1a17fb[_0x6c0e('0x4c')]===_0x6c0e('0x4d')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6c0e('0x2f')+_0x1a17fb[_0x6c0e('0x29')]+')','participationtypemask':_0x1a17fb[_0x6c0e('0x4c')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1a17fb[_0x6c0e('0x35')]+')','participationtypemask':_0x1a17fb[_0x6c0e('0x4c')]==='queue'?0x1:0x2}]},getCustomFields(_0x1bca2a[_0x6c0e('0x48')],_0x53c2fd,_0x1bca2a[_0x6c0e('0x41')])),'headers':{'Authorization':_0x6c0e('0x30')+_0x1d6753,'OData-Version':_0x6c0e('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4a9e3b);})[_0x6c0e('0x13')](function(_0x2b4a59){var _0x51ab41=_0x2b4a59['headers'][_0x6c0e('0x32')];var _0x55e7f3=_0x51ab41[_0x6c0e('0x33')](_0x51ab41['lastIndexOf']('(')+0x1,_0x51ab41['lastIndexOf'](')'));_0x1a17fb[_0x6c0e('0x4e')]=_0x55e7f3;_0x2ec2ab(_0x1a17fb);})[_0x6c0e('0x15')](function(_0x29e325){_0x1ad607(_0x29e325[_0x6c0e('0x18')]);});});}function emit(_0x32c577,_0x36f7be,_0x401db1,_0x42e779){var _0x37352f={'uri':util[_0x6c0e('0x4f')](_0x6c0e('0x50'),_0x32c577,_0x401db1,_0x42e779)};io['to'](util[_0x6c0e('0x4f')](_0x6c0e('0x51'),_0x36f7be))[_0x6c0e('0x52')](_0x6c0e('0x53'),_0x37352f);}exports['cs']=function(_0x517c71,_0x47b71f,_0x299629,_0x4f8bf2,_0x9cd281,_0x58a44a,_0x408411,_0x57a25c){var _0x4a4577={};_0x58a44a[_0x6c0e('0x10')]=intUtil[_0x6c0e('0x54')](_0x58a44a[_0x6c0e('0x10')]);_0x58a44a[_0x6c0e('0x55')]=intUtil['stripTrailingSlash'](_0x58a44a[_0x6c0e('0x55')]);_0x4a4577[_0x6c0e('0x4c')]=_0x57a25c===_0x6c0e('0x4d')||_0x57a25c===_0x6c0e('0x56')?'queue':_0x6c0e('0x2b');var _0x433e08=util[_0x6c0e('0x4f')]('%s/api/data/v9.0/',_0x58a44a[_0x6c0e('0x10')]);var _0x3cbc3c=util['format'](_0x6c0e('0x57'),_0x58a44a[_0x6c0e('0x58')]);var _0x1a08ce=util[_0x6c0e('0x4f')](_0x6c0e('0x59'),_0x58a44a[_0x6c0e('0x55')],_0x47b71f[_0x6c0e('0x5a')],md5(_0x47b71f['uniqueid']));if(_0x9cd281&&_0x9cd281[_0x6c0e('0x5b')]){logger[_0x6c0e('0x24')](_0x6c0e('0x5c'),_0x6c0e('0x5d'));_0x47b71f[_0x6c0e('0x5e')]=_0x1a08ce;}else if(_0x408411&&_0x408411[_0x6c0e('0x5f')]&&_0x408411[_0x6c0e('0x5f')]!==_0x6c0e('0x60')){logger[_0x6c0e('0x24')](_0x6c0e('0x61'),'Recording\x20is\x20enabled!');_0x47b71f[_0x6c0e('0x5e')]=_0x1a08ce;}else{_0x47b71f[_0x6c0e('0x5e')]='';}return getUser(_0x4a4577,_0x58a44a,_0x4f8bf2,_0x3cbc3c,_0x433e08,_0x57a25c)['then'](function(_0x41b95b){logger['info']('['+_0x57a25c[_0x6c0e('0x25')]()+_0x6c0e('0x62'),_0x41b95b[_0x6c0e('0x29')]);logger['info']('['+_0x57a25c[_0x6c0e('0x25')]()+_0x6c0e('0x63'),_0x41b95b[_0x6c0e('0x1f')]);return getEndUser(_0x41b95b,_0x58a44a,_0x3cbc3c,_0x433e08,_0x47b71f,_0x57a25c);})[_0x6c0e('0x13')](function(_0x1b1be0){logger[_0x6c0e('0x24')]('['+_0x57a25c['toUpperCase']()+_0x6c0e('0x64'),_0x1b1be0['enduserId']);logger['info']('['+_0x57a25c[_0x6c0e('0x25')]()+_0x6c0e('0x65'),_0x47b71f['calleridnum']);return getTicket(_0x1b1be0,_0x58a44a,_0x3cbc3c,_0x433e08,_0x47b71f,_0x299629,_0x57a25c);})[_0x6c0e('0x13')](function(_0x3cf2dc){logger['info'](util[_0x6c0e('0x4f')]('['+_0x57a25c[_0x6c0e('0x25')]()+_0x6c0e('0x66'),_0x299629[_0x6c0e('0x41')],_0x3cf2dc['ticketId']));logger[_0x6c0e('0x24')](util[_0x6c0e('0x4f')]('['+_0x57a25c[_0x6c0e('0x25')]()+_0x6c0e('0x67'),_0x57a25c));if(_0x57a25c!==_0x6c0e('0x56')){logger[_0x6c0e('0x24')]('['+_0x57a25c[_0x6c0e('0x25')]()+']',_0x6c0e('0x68'));emit(_0x58a44a[_0x6c0e('0x10')],_0x4f8bf2['name'],_0x299629[_0x6c0e('0x41')],_0x3cf2dc[_0x6c0e('0x4e')]);}})['catch'](function(_0xf7d7b0){logger[_0x6c0e('0x16')]('['+_0x57a25c[_0x6c0e('0x25')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0xf7d7b0,{'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 b6932de..19ed82b 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 _0xddcc=['base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','content','variable','variableName','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','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.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','toString'];(function(_0x11ec27,_0x1373bc){var _0x16882f=function(_0x5e3218){while(--_0x5e3218){_0x11ec27['push'](_0x11ec27['shift']());}};_0x16882f(++_0x1373bc);}(_0xddcc,0x148));var _0xcddc=function(_0x528fef,_0x4726a5){_0x528fef=_0x528fef-0x0;var _0x5e8b5e=_0xddcc[_0x528fef];return _0x5e8b5e;};'use strict';var _=require(_0xcddc('0x0'));var rp=require('request-promise');var md5=require(_0xcddc('0x1'));var util=require(_0xcddc('0x2'));var Redis=require(_0xcddc('0x3'));var intUtil=require(_0xcddc('0x4'));var config=require(_0xcddc('0x5'));var logger=require(_0xcddc('0x6'))(_0xcddc('0x7'));config[_0xcddc('0x8')]=_['defaults'](config[_0xcddc('0x8')],{'host':_0xcddc('0x9'),'port':0x18eb});var io=require(_0xcddc('0xa'))(new Redis(config[_0xcddc('0x8')]));var headers={'Content-Type':_0xcddc('0xb'),'Accept':'application/json'};function emit(_0x335aed,_0x24092d,_0x4dd7cd){io['to'](_0x335aed)[_0xcddc('0xc')](_0x24092d,_0x4dd7cd);}function getTicket(_0x30fc94,_0x11cc1,_0x24e6ce,_0x1476e8,_0x489076){logger['info'](_0xcddc('0xd'));var _0x4e983d=_[_0xcddc('0xe')]({'responder_id':_0x11cc1['id'],'requester_id':_0x24e6ce['id'],'name':util[_0xcddc('0xf')](_0xcddc('0x10'),_0x489076[_0xcddc('0x11')]),'phone':_0x489076[_0xcddc('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcddc('0x13')](_0x1476e8[_0xcddc('0x14')],_0x489076,'\x20'),'description':intUtil[_0xcddc('0x13')](_0x1476e8[_0xcddc('0x15')],_0x489076,_0xcddc('0x16')),'tags':getTags(_0x1476e8['Tags'],_0xcddc('0x17'))},getCustomFields(_0x1476e8[_0xcddc('0x18')],_0x489076));_0x4e983d['custom_fields']=_[_0xcddc('0x19')](_['keyBy'](_0x4e983d[_0xcddc('0x1a')],'id'),_0xcddc('0x1b'));return request({'uri':util['format'](_0xcddc('0x1c'),_0x30fc94[_0xcddc('0x1d')]),'method':_0xcddc('0x1e'),'body':_0x4e983d})[_0xcddc('0x1f')](function(_0x2b1085){logger[_0xcddc('0x20')](_0xcddc('0x21'));return _0x2b1085;});}function getUser(_0x95f578,_0x21673f){if(intUtil[_0xcddc('0x22')](_0x21673f)){return request({'uri':util[_0xcddc('0xf')](_0xcddc('0x23'),_0x95f578[_0xcddc('0x1d')]),'qs':{'email':_0x21673f}})[_0xcddc('0x1f')](function(_0x3f53b9){if(_0x3f53b9[_0xcddc('0x24')]){logger[_0xcddc('0x20')](_0xcddc('0x25'));return _[_0xcddc('0x26')](_0x3f53b9,function(_0x18b871){return _0x18b871[_0xcddc('0x27')][_0xcddc('0x28')]===_0x21673f;});}else{logger[_0xcddc('0x20')](_0xcddc('0x29'));return request({'uri':util['format'](_0xcddc('0x2a'),_0x95f578[_0xcddc('0x1d')])})['then'](function(_0x480cc0){logger[_0xcddc('0x20')](_0xcddc('0x2b'));return _0x480cc0;});}});}else{logger[_0xcddc('0x20')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcddc('0xf')](_0xcddc('0x2a'),_0x95f578[_0xcddc('0x1d')])})[_0xcddc('0x1f')](function(_0x271642){logger[_0xcddc('0x20')](_0xcddc('0x2b'));return _0x271642;});}}function getEndUser(_0x107b45,_0xb9b493,_0x4178b3){logger['info'](_0xcddc('0x2c'),_0x4178b3);return request({'uri':util[_0xcddc('0xf')](_0xcddc('0x2d'),_0x107b45['remoteUri']),'qs':{'phone':_0x4178b3}})['then'](function(_0x2479f7){if(_0x2479f7[_0xcddc('0x24')]){logger[_0xcddc('0x20')]('Enduser\x20found!');return _['find'](_0x2479f7,{'phone':_0x4178b3});}else{logger[_0xcddc('0x20')](_0xcddc('0x2e'));return request({'uri':util[_0xcddc('0xf')](_0xcddc('0x2d'),_0x107b45[_0xcddc('0x1d')]),'method':_0xcddc('0x1e'),'body':{'name':_0xb9b493,'phone':_0x4178b3}})[_0xcddc('0x1f')](function(_0x4e5662){logger[_0xcddc('0x20')]('Enduser\x20created.');return _0x4e5662;});}});}function getAuth(_0x49b762){return util[_0xcddc('0xf')]('Basic\x20%s',new Buffer(_0x49b762['apiKey']+':X')[_0xcddc('0x2f')](_0xcddc('0x30')));}function request(_0x5373f2){logger[_0xcddc('0x31')](_0xcddc('0x32'),JSON[_0xcddc('0x33')](_0x5373f2));return rp(_['defaults'](_0x5373f2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4cc12d,_0x382cee){var _0x3d38fb=[];if(_0x4cc12d&&_0x4cc12d[_0xcddc('0x24')]>0x0){_0x3d38fb=_[_0xcddc('0x34')](_0x4cc12d,_0x382cee);}return _0x3d38fb;}function getCustomFields(_0x206376,_0x3fcb06){var _0x4513ca=[];var _0x101224={'custom_fields':[]};if(_0x206376[_0xcddc('0x24')]>0x0){_[_0xcddc('0x35')](_0x206376,function(_0x3ab38c){if(_[_0xcddc('0x36')]([_0xcddc('0x37'),_0xcddc('0x38')],_0x3ab38c[_0xcddc('0x39')])&&_0x3ab38c[_0xcddc('0x3a')]&&!_0x3ab38c[_0xcddc('0x3b')]){_0x101224[_0x3ab38c[_0xcddc('0x3a')][_0xcddc('0x3c')]()]=_0x3ab38c['content'][_0xcddc('0x2f')]();}else if(_['includes']([_0xcddc('0x37'),'picklist'],_0x3ab38c[_0xcddc('0x39')])&&_0x3ab38c[_0xcddc('0x3d')]&&_0x3ab38c['customField']){_0x101224[_0xcddc('0x1a')]['push']({'id':_0x3ab38c['idField'],'value':_0x3ab38c[_0xcddc('0x3e')]['toString']()});}else if(_0x3ab38c['type']===_0xcddc('0x3f')&&_0x3ab38c[_0xcddc('0x40')]&&_0x3ab38c[_0xcddc('0x3d')]&&_0x3ab38c['customField']){_0x3fcb06[_0x3ab38c[_0xcddc('0x40')]]&&_0x101224['custom_fields'][_0xcddc('0x41')]({'id':_0x3ab38c[_0xcddc('0x3d')],'value':_0x3fcb06[_0x3ab38c[_0xcddc('0x40')]][_0xcddc('0x2f')]()});}else if(_0x3ab38c[_0xcddc('0x39')]===_0xcddc('0x42')&&_0x3ab38c['Variable']&&_0x3ab38c['Variable'][_0xcddc('0x17')]&&_0x3ab38c['idField']&&_0x3ab38c['customField']){_0x3fcb06[_0x3ab38c[_0xcddc('0x43')][_0xcddc('0x17')][_0xcddc('0x3c')]()]&&_0x101224[_0xcddc('0x1a')][_0xcddc('0x41')]({'id':_0x3ab38c['idField'],'value':_0x3fcb06[_0x3ab38c[_0xcddc('0x43')][_0xcddc('0x17')]['toLowerCase']()][_0xcddc('0x2f')]()});}});}return _0x101224;}exports[_0xcddc('0x44')]=function(_0x14f046,_0x20e7fc,_0x2074cb,_0x1a03c1,_0x344f77,_0x324b75){var _0x80bef,_0x5a0e6f;_0x324b75['remoteUri']=intUtil['stripTrailingSlash'](_0x324b75[_0xcddc('0x1d')]);_0x324b75[_0xcddc('0x45')]=intUtil[_0xcddc('0x46')](_0x324b75[_0xcddc('0x45')]);if(_0x344f77&&_0x344f77[_0xcddc('0x47')]){logger[_0xcddc('0x20')]('[QUEUE]',_0xcddc('0x48'));_0x20e7fc['recordingURL']=util['format'](_0xcddc('0x49'),_0x324b75[_0xcddc('0x45')],_0x20e7fc['uniqueid'],md5(_0x20e7fc['uniqueid']));}else{_0x20e7fc[_0xcddc('0x4a')]='';}headers[_0xcddc('0x4b')]=getAuth(_0x324b75);return getUser(_0x324b75,_0x1a03c1[_0xcddc('0x28')])[_0xcddc('0x1f')](function(_0x5021d0){_0x80bef=_0x5021d0;logger[_0xcddc('0x20')](_0xcddc('0x4c'),_0x80bef['id']);return getEndUser(_0x324b75,_0x20e7fc[_0xcddc('0x11')],_0x20e7fc[_0xcddc('0x12')]);})['then'](function(_0x1a2344){_0x5a0e6f=_0x1a2344;logger[_0xcddc('0x20')](_0xcddc('0x4d'),_0x5a0e6f['id']);return getTicket(_0x324b75,_0x80bef,_0x5a0e6f,_0x2074cb,_0x20e7fc);})[_0xcddc('0x1f')](function(_0x498af4){if(_0x498af4&&_0x498af4['id']){logger['info'](_0xcddc('0x21'));logger[_0xcddc('0x20')](_0xcddc('0x4e'),_0x498af4['id']);logger[_0xcddc('0x20')](_0xcddc('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcddc('0xf')](_0xcddc('0x50'),_0x1a03c1[_0xcddc('0x17')]),_0xcddc('0x51'),{'uri':util[_0xcddc('0xf')]('%s/helpdesk/tickets/%d',_0x324b75[_0xcddc('0x1d')],_0x498af4['id'])});}})[_0xcddc('0x52')](function(_0x465170){logger['error']('[QUEUE]',JSON[_0xcddc('0x33')](_0x465170));});};exports[_0xcddc('0x53')]=function(_0x571907,_0x4f019f,_0x42ed3c,_0xe4ebaa,_0x531e78,_0x3cd527,_0x1a9140){var _0x2cc01d,_0x58f41c;_0x3cd527[_0xcddc('0x1d')]=intUtil[_0xcddc('0x46')](_0x3cd527[_0xcddc('0x1d')]);_0x3cd527[_0xcddc('0x45')]=intUtil[_0xcddc('0x46')](_0x3cd527['serverUrl']);if(_0x1a9140&&_0x1a9140[_0xcddc('0x54')]&&_0x1a9140[_0xcddc('0x54')]!==_0xcddc('0x55')){logger[_0xcddc('0x20')](_0xcddc('0x56'),_0xcddc('0x48'));_0x4f019f[_0xcddc('0x4a')]=util[_0xcddc('0xf')](_0xcddc('0x49'),_0x3cd527[_0xcddc('0x45')],_0x4f019f[_0xcddc('0x57')],md5(_0x4f019f[_0xcddc('0x57')]));}headers['Authorization']=getAuth(_0x3cd527);return getUser(_0x3cd527,_0xe4ebaa[_0xcddc('0x28')])[_0xcddc('0x1f')](function(_0x2d95e8){_0x2cc01d=_0x2d95e8;logger[_0xcddc('0x20')]('The\x20User\x20ID\x20is:',_0x2cc01d['id']);return getEndUser(_0x3cd527,_0x4f019f[_0xcddc('0x58')],_0x4f019f[_0xcddc('0x59')]);})[_0xcddc('0x1f')](function(_0x7c9e80){_0x58f41c=_0x7c9e80;logger[_0xcddc('0x20')](_0xcddc('0x4d'),_0x58f41c['id']);return getTicket(_0x3cd527,_0x2cc01d,_0x58f41c,_0x42ed3c,_0x4f019f);})['then'](function(_0x492fbb){if(_0x492fbb&&_0x492fbb['id']){logger[_0xcddc('0x20')](_0xcddc('0x21'));logger['info'](_0xcddc('0x4e'),_0x492fbb['id']);logger[_0xcddc('0x20')]('[OUTBOUND]',_0xcddc('0x5a'));emit(util[_0xcddc('0xf')](_0xcddc('0x50'),_0xe4ebaa[_0xcddc('0x17')]),_0xcddc('0x51'),{'uri':util[_0xcddc('0xf')]('%s/helpdesk/tickets/%d',_0x3cd527['remoteUri'],_0x492fbb['id'])});}})['catch'](function(_0x4394c8){logger[_0xcddc('0x5b')](_0xcddc('0x56'),JSON[_0xcddc('0x33')](_0x4394c8));});};exports['unmanaged']=function(_0x32447a,_0x1dc0db,_0x425228,_0x40c0db,_0x1526f4,_0x5c666f){var _0x3f1dee,_0x41b044;_0x5c666f[_0xcddc('0x1d')]=intUtil[_0xcddc('0x46')](_0x5c666f['remoteUri']);_0x5c666f[_0xcddc('0x45')]=intUtil[_0xcddc('0x46')](_0x5c666f['serverUrl']);if(_0x1526f4&&_0x1526f4['monitor_format']){logger[_0xcddc('0x20')]('['+_0x1dc0db[_0xcddc('0x5c')][_0xcddc('0x5d')]()+']',_0xcddc('0x48'));_0x1dc0db[_0xcddc('0x4a')]=util[_0xcddc('0xf')](_0xcddc('0x49'),_0x5c666f[_0xcddc('0x45')],_0x1dc0db[_0xcddc('0x57')],md5(_0x1dc0db[_0xcddc('0x57')]));}else{_0x1dc0db[_0xcddc('0x4a')]='';}headers[_0xcddc('0x4b')]=getAuth(_0x5c666f);return getUser(_0x5c666f,'')[_0xcddc('0x1f')](function(_0x47e408){_0x3f1dee=_0x47e408;logger[_0xcddc('0x20')](_0xcddc('0x4c'),_0x3f1dee['id']);return getEndUser(_0x5c666f,_0x1dc0db['calleridname'],_0x1dc0db[_0xcddc('0x12')]);})[_0xcddc('0x1f')](function(_0x36ae19){_0x41b044=_0x36ae19;logger[_0xcddc('0x20')](_0xcddc('0x4d'),_0x41b044['id']);return getTicket(_0x5c666f,_0x3f1dee,_0x41b044,_0x425228,_0x1dc0db);})[_0xcddc('0x1f')](function(_0x407cb8){if(_0x407cb8){logger['info'](_0xcddc('0x21'));logger[_0xcddc('0x20')]('The\x20Ticket\x20ID\x20is:',_0x407cb8['id']);}})[_0xcddc('0x52')](function(_0x51739f){logger['error']('['+_0x1dc0db[_0xcddc('0x5c')][_0xcddc('0x5d')]()+']',JSON['stringify'](_0x51739f));});}; \ No newline at end of file +var _0xb67e=['%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','base64','debug','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','content','toString','string','idField','push','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb67e,0x9e));var _0xeb67=function(_0x1a8323,_0x1aa846){_0x1a8323=_0x1a8323-0x0;var _0x302396=_0xb67e[_0x1a8323];return _0x302396;};'use strict';var _=require(_0xeb67('0x0'));var rp=require(_0xeb67('0x1'));var md5=require(_0xeb67('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xeb67('0x3'));var logger=require(_0xeb67('0x4'))(_0xeb67('0x5'));config[_0xeb67('0x6')]=_['defaults'](config[_0xeb67('0x6')],{'host':_0xeb67('0x7'),'port':0x18eb});var io=require(_0xeb67('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0xeb67('0x9'),'Accept':'application/json'};function emit(_0x4bb910,_0x3722db,_0x2f2045){io['to'](_0x4bb910)[_0xeb67('0xa')](_0x3722db,_0x2f2045);}function getTicket(_0xe1164e,_0x136649,_0x3c985e,_0x5bbd93,_0x2b75f5){logger[_0xeb67('0xb')](_0xeb67('0xc'));var _0x5787d7=_[_0xeb67('0xd')]({'responder_id':_0x136649['id'],'requester_id':_0x3c985e['id'],'name':util['format'](_0xeb67('0xe'),_0x2b75f5[_0xeb67('0xf')]),'phone':_0x2b75f5[_0xeb67('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xeb67('0x11')](_0x5bbd93['Subjects'],_0x2b75f5,'\x20'),'description':intUtil[_0xeb67('0x11')](_0x5bbd93[_0xeb67('0x12')],_0x2b75f5,_0xeb67('0x13')),'tags':getTags(_0x5bbd93[_0xeb67('0x14')],'name')},getCustomFields(_0x5bbd93[_0xeb67('0x15')],_0x2b75f5));_0x5787d7['custom_fields']=_[_0xeb67('0x16')](_[_0xeb67('0x17')](_0x5787d7[_0xeb67('0x18')],'id'),_0xeb67('0x19'));return request({'uri':util[_0xeb67('0x1a')](_0xeb67('0x1b'),_0xe1164e['remoteUri']),'method':_0xeb67('0x1c'),'body':_0x5787d7})[_0xeb67('0x1d')](function(_0x4b4e8d){logger['info'](_0xeb67('0x1e'));return _0x4b4e8d;});}function getUser(_0x26b6ea,_0x5ca68f){if(intUtil[_0xeb67('0x1f')](_0x5ca68f)){return request({'uri':util['format'](_0xeb67('0x20'),_0x26b6ea[_0xeb67('0x21')]),'qs':{'email':_0x5ca68f}})[_0xeb67('0x1d')](function(_0x53442a){if(_0x53442a[_0xeb67('0x22')]){logger[_0xeb67('0xb')](_0xeb67('0x23'));return _[_0xeb67('0x24')](_0x53442a,function(_0x39afc7){return _0x39afc7['contact']['email']===_0x5ca68f;});}else{logger[_0xeb67('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xeb67('0x25'),_0x26b6ea[_0xeb67('0x21')])})[_0xeb67('0x1d')](function(_0x388fb1){logger[_0xeb67('0xb')](_0xeb67('0x26'));return _0x388fb1;});}});}else{logger[_0xeb67('0xb')](_0xeb67('0x27'));return request({'uri':util[_0xeb67('0x1a')]('%s/api/v2/agents/me',_0x26b6ea[_0xeb67('0x21')])})[_0xeb67('0x1d')](function(_0x17d816){logger[_0xeb67('0xb')](_0xeb67('0x26'));return _0x17d816;});}}function getEndUser(_0x42189e,_0x3e6576,_0x2ae326){logger[_0xeb67('0xb')](_0xeb67('0x28'),_0x2ae326);return request({'uri':util[_0xeb67('0x1a')](_0xeb67('0x29'),_0x42189e[_0xeb67('0x21')]),'qs':{'phone':_0x2ae326}})['then'](function(_0x9782ec){if(_0x9782ec[_0xeb67('0x22')]){logger[_0xeb67('0xb')](_0xeb67('0x2a'));return _[_0xeb67('0x24')](_0x9782ec,{'phone':_0x2ae326});}else{logger[_0xeb67('0xb')](_0xeb67('0x2b'));return request({'uri':util[_0xeb67('0x1a')]('%s/api/v2/contacts',_0x42189e[_0xeb67('0x21')]),'method':'POST','body':{'name':_0x3e6576,'phone':_0x2ae326}})[_0xeb67('0x1d')](function(_0x1eb649){logger[_0xeb67('0xb')]('Enduser\x20created.');return _0x1eb649;});}});}function getAuth(_0x247620){return util['format']('Basic\x20%s',new Buffer(_0x247620[_0xeb67('0x2c')]+':X')['toString'](_0xeb67('0x2d')));}function request(_0x404042){logger[_0xeb67('0x2e')]('[HTTP]',JSON[_0xeb67('0x2f')](_0x404042));return rp(_[_0xeb67('0x30')](_0x404042,{'method':_0xeb67('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3f1d6a,_0x40c5aa){var _0x2a8174=[];if(_0x3f1d6a&&_0x3f1d6a[_0xeb67('0x22')]>0x0){_0x2a8174=_[_0xeb67('0x32')](_0x3f1d6a,_0x40c5aa);}return _0x2a8174;}function getCustomFields(_0x1b488a,_0x3bbc53){var _0x13d5d6=[];var _0x2aed08={'custom_fields':[]};if(_0x1b488a['length']>0x0){_[_0xeb67('0x33')](_0x1b488a,function(_0x27fff3){if(_[_0xeb67('0x34')](['string',_0xeb67('0x35')],_0x27fff3[_0xeb67('0x36')])&&_0x27fff3[_0xeb67('0x37')]&&!_0x27fff3[_0xeb67('0x38')]){_0x2aed08[_0x27fff3[_0xeb67('0x37')]['toLowerCase']()]=_0x27fff3[_0xeb67('0x39')][_0xeb67('0x3a')]();}else if(_[_0xeb67('0x34')]([_0xeb67('0x3b'),_0xeb67('0x35')],_0x27fff3['type'])&&_0x27fff3[_0xeb67('0x3c')]&&_0x27fff3[_0xeb67('0x38')]){_0x2aed08['custom_fields'][_0xeb67('0x3d')]({'id':_0x27fff3[_0xeb67('0x3c')],'value':_0x27fff3[_0xeb67('0x39')][_0xeb67('0x3a')]()});}else if(_0x27fff3[_0xeb67('0x36')]==='variable'&&_0x27fff3[_0xeb67('0x3e')]&&_0x27fff3[_0xeb67('0x3c')]&&_0x27fff3['customField']){_0x3bbc53[_0x27fff3['variableName']]&&_0x2aed08[_0xeb67('0x18')]['push']({'id':_0x27fff3[_0xeb67('0x3c')],'value':_0x3bbc53[_0x27fff3[_0xeb67('0x3e')]][_0xeb67('0x3a')]()});}else if(_0x27fff3[_0xeb67('0x36')]===_0xeb67('0x3f')&&_0x27fff3[_0xeb67('0x40')]&&_0x27fff3['Variable']['name']&&_0x27fff3[_0xeb67('0x3c')]&&_0x27fff3[_0xeb67('0x38')]){_0x3bbc53[_0x27fff3[_0xeb67('0x40')][_0xeb67('0x41')]['toLowerCase']()]&&_0x2aed08[_0xeb67('0x18')][_0xeb67('0x3d')]({'id':_0x27fff3[_0xeb67('0x3c')],'value':_0x3bbc53[_0x27fff3[_0xeb67('0x40')][_0xeb67('0x41')][_0xeb67('0x42')]()][_0xeb67('0x3a')]()});}});}return _0x2aed08;}exports[_0xeb67('0x43')]=function(_0xe869f6,_0x3bfa59,_0x55237b,_0x4061d0,_0x28f17c,_0x4321bb){var _0x56be9e,_0x17f775;_0x4321bb[_0xeb67('0x21')]=intUtil[_0xeb67('0x44')](_0x4321bb[_0xeb67('0x21')]);_0x4321bb['serverUrl']=intUtil[_0xeb67('0x44')](_0x4321bb[_0xeb67('0x45')]);if(_0x28f17c&&_0x28f17c[_0xeb67('0x46')]){logger[_0xeb67('0xb')](_0xeb67('0x47'),_0xeb67('0x48'));_0x3bfa59['recordingURL']=util[_0xeb67('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4321bb[_0xeb67('0x45')],_0x3bfa59[_0xeb67('0x49')],md5(_0x3bfa59[_0xeb67('0x49')]));}else{_0x3bfa59['recordingURL']='';}headers[_0xeb67('0x4a')]=getAuth(_0x4321bb);return getUser(_0x4321bb,_0x4061d0['email'])[_0xeb67('0x1d')](function(_0x3d235b){_0x56be9e=_0x3d235b;logger[_0xeb67('0xb')](_0xeb67('0x4b'),_0x56be9e['id']);return getEndUser(_0x4321bb,_0x3bfa59[_0xeb67('0xf')],_0x3bfa59['calleridnum']);})[_0xeb67('0x1d')](function(_0x2267ec){_0x17f775=_0x2267ec;logger['info'](_0xeb67('0x4c'),_0x17f775['id']);return getTicket(_0x4321bb,_0x56be9e,_0x17f775,_0x55237b,_0x3bfa59);})[_0xeb67('0x1d')](function(_0x1c8401){if(_0x1c8401&&_0x1c8401['id']){logger[_0xeb67('0xb')](_0xeb67('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1c8401['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeb67('0x1a')](_0xeb67('0x4d'),_0x4061d0[_0xeb67('0x41')]),_0xeb67('0x4e'),{'uri':util['format'](_0xeb67('0x4f'),_0x4321bb[_0xeb67('0x21')],_0x1c8401['id'])});}})[_0xeb67('0x50')](function(_0xfc3b88){logger['error'](_0xeb67('0x47'),JSON[_0xeb67('0x2f')](_0xfc3b88));});};exports[_0xeb67('0x51')]=function(_0x5d8d6,_0x2b5341,_0x5cadb9,_0xd82561,_0x39d0da,_0x10d709,_0x1b7baf){var _0x574ff9,_0x2b1c46;_0x10d709[_0xeb67('0x21')]=intUtil[_0xeb67('0x44')](_0x10d709[_0xeb67('0x21')]);_0x10d709[_0xeb67('0x45')]=intUtil[_0xeb67('0x44')](_0x10d709['serverUrl']);if(_0x1b7baf&&_0x1b7baf['recordingFormat']&&_0x1b7baf[_0xeb67('0x52')]!==_0xeb67('0x53')){logger[_0xeb67('0xb')](_0xeb67('0x54'),'Recording\x20is\x20enabled!');_0x2b5341[_0xeb67('0x55')]=util[_0xeb67('0x1a')](_0xeb67('0x56'),_0x10d709[_0xeb67('0x45')],_0x2b5341[_0xeb67('0x49')],md5(_0x2b5341['uniqueid']));}headers[_0xeb67('0x4a')]=getAuth(_0x10d709);return getUser(_0x10d709,_0xd82561[_0xeb67('0x57')])[_0xeb67('0x1d')](function(_0x2cce08){_0x574ff9=_0x2cce08;logger[_0xeb67('0xb')](_0xeb67('0x4b'),_0x574ff9['id']);return getEndUser(_0x10d709,_0x2b5341['destcalleridname'],_0x2b5341[_0xeb67('0x58')]);})['then'](function(_0x185cb3){_0x2b1c46=_0x185cb3;logger[_0xeb67('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2b1c46['id']);return getTicket(_0x10d709,_0x574ff9,_0x2b1c46,_0x5cadb9,_0x2b5341);})[_0xeb67('0x1d')](function(_0x41b62c){if(_0x41b62c&&_0x41b62c['id']){logger[_0xeb67('0xb')]('Ticket\x20created!');logger[_0xeb67('0xb')](_0xeb67('0x59'),_0x41b62c['id']);logger[_0xeb67('0xb')](_0xeb67('0x54'),_0xeb67('0x5a'));emit(util[_0xeb67('0x1a')]('user:%s',_0xd82561[_0xeb67('0x41')]),_0xeb67('0x4e'),{'uri':util[_0xeb67('0x1a')](_0xeb67('0x4f'),_0x10d709['remoteUri'],_0x41b62c['id'])});}})[_0xeb67('0x50')](function(_0x5f0e54){logger[_0xeb67('0x5b')](_0xeb67('0x54'),JSON[_0xeb67('0x2f')](_0x5f0e54));});};exports[_0xeb67('0x5c')]=function(_0x460d31,_0x45f08c,_0x3742a5,_0x159197,_0x91d5e5,_0x1eb3eb){var _0xfd9268,_0x128dcb;_0x1eb3eb[_0xeb67('0x21')]=intUtil[_0xeb67('0x44')](_0x1eb3eb[_0xeb67('0x21')]);_0x1eb3eb[_0xeb67('0x45')]=intUtil[_0xeb67('0x44')](_0x1eb3eb[_0xeb67('0x45')]);if(_0x91d5e5&&_0x91d5e5[_0xeb67('0x46')]){logger['info']('['+_0x45f08c['lastevent'][_0xeb67('0x5d')]()+']',_0xeb67('0x48'));_0x45f08c[_0xeb67('0x55')]=util[_0xeb67('0x1a')](_0xeb67('0x56'),_0x1eb3eb['serverUrl'],_0x45f08c[_0xeb67('0x49')],md5(_0x45f08c[_0xeb67('0x49')]));}else{_0x45f08c['recordingURL']='';}headers['Authorization']=getAuth(_0x1eb3eb);return getUser(_0x1eb3eb,'')['then'](function(_0x3a5890){_0xfd9268=_0x3a5890;logger[_0xeb67('0xb')](_0xeb67('0x4b'),_0xfd9268['id']);return getEndUser(_0x1eb3eb,_0x45f08c[_0xeb67('0xf')],_0x45f08c['calleridnum']);})[_0xeb67('0x1d')](function(_0x119d44){_0x128dcb=_0x119d44;logger[_0xeb67('0xb')](_0xeb67('0x4c'),_0x128dcb['id']);return getTicket(_0x1eb3eb,_0xfd9268,_0x128dcb,_0x3742a5,_0x45f08c);})[_0xeb67('0x1d')](function(_0x22d7af){if(_0x22d7af){logger[_0xeb67('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x22d7af['id']);}})['catch'](function(_0x4ef90e){logger['error']('['+_0x45f08c[_0xeb67('0x5e')][_0xeb67('0x5d')]()+']',JSON['stringify'](_0x4ef90e));});}; \ 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 f4d9d2e..856f15e 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 _0x9d4d=[']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','headers','info','users','email','adminEmail','adminId','Admin\x20found:','catch','error','message','GET','/api/selector/owners','then','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','add','format','task','toUpperCase','/contacts/','emit','trigger:browser:url','Token\x20token=','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name'];(function(_0x5d247a,_0x9f6e90){var _0x28e96a=function(_0x46be9d){while(--_0x46be9d){_0x5d247a['push'](_0x5d247a['shift']());}};_0x28e96a(++_0x9f6e90);}(_0x9d4d,0x188));var _0xd9d4=function(_0x4c74be,_0x1e5764){_0x4c74be=_0x4c74be-0x0;var _0x2cbf14=_0x9d4d[_0x4c74be];return _0x2cbf14;};'use strict';var _=require('lodash');var rp=require(_0xd9d4('0x0'));var md5=require(_0xd9d4('0x1'));var util=require(_0xd9d4('0x2'));var moment=require('moment');var Promise=require(_0xd9d4('0x3'));var Redis=require(_0xd9d4('0x4'));var intUtil=require(_0xd9d4('0x5'));var config=require(_0xd9d4('0x6'));var logger=require(_0xd9d4('0x7'))('freshsales');config['redis']=_['defaults'](config[_0xd9d4('0x8')],{'host':_0xd9d4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd9d4('0x8')]));function getAdminId(_0x45c41b,_0x1df1cc,_0x3f05d3,_0x40014d){return new Promise(function(_0x3baaa2,_0x42084c){var _0x4f7d36=![];var _0x5bfdf3={'method':'GET','uri':_0x40014d+'/api/selector/owners','json':!![]};_0x5bfdf3[_0xd9d4('0xa')]=_0x3f05d3;logger[_0xd9d4('0xb')]('Getting\x20admin\x20information');return rp(_0x5bfdf3)['then'](function(_0x33e709){if(_0x33e709){var _0x4a24bc=_0x33e709[_0xd9d4('0xc')];var _0x2e1aea=null;for(_0x2e1aea=0x0;_0x2e1aea<_0x4a24bc['length'];_0x2e1aea++){if(_0x4a24bc[_0x2e1aea][_0xd9d4('0xd')]===_0x45c41b[_0xd9d4('0xe')]){_0x45c41b[_0xd9d4('0xf')]=_0x4a24bc[_0x2e1aea]['id'];_0x4f7d36=!![];}}if(_0x4f7d36){logger[_0xd9d4('0xb')](_0xd9d4('0x10'),_0x45c41b['adminId']);_0x3baaa2(_0x45c41b);}else{_0x42084c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x42084c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xd9d4('0x11')](function(_0x2cb649){logger[_0xd9d4('0x12')]('['+[_0x1df1cc['toUpperCase']()]+']',_0x2cb649[_0xd9d4('0x13')]);_0x42084c(_0x2cb649);});});}function getUser(_0x48b557,_0x5a89d5,_0x361980){return function(_0x4ed761){return new Promise(function(_0x1f84ad,_0x4e06ee){var _0x2b1594={'method':_0xd9d4('0x14'),'uri':_0x361980+_0xd9d4('0x15'),'json':!![]};_0x2b1594[_0xd9d4('0xa')]=_0x5a89d5;logger[_0xd9d4('0xb')]('Getting\x20user\x20list');return rp(_0x2b1594)[_0xd9d4('0x16')](function(_0x3bc5df){if(_0x3bc5df){var _0x4ad6aa=_0x3bc5df['users'];var _0x1e5afa=![];var _0x2e3c1b=null;if(_0x4ed761[_0xd9d4('0x17')]!==null){logger['info'](_0xd9d4('0x18'),_0x4ed761['agentEmail']);_0x4ed761['userEmail']=_0x4ed761[_0xd9d4('0x17')];for(_0x2e3c1b=0x0;_0x2e3c1b<_0x4ad6aa['length'];_0x2e3c1b++){if(_0x4ad6aa[_0x2e3c1b][_0xd9d4('0xd')]===_0x4ed761[_0xd9d4('0x17')]){_0x1e5afa=!![];_0x4ed761[_0xd9d4('0x19')]=_0x4ad6aa[_0x2e3c1b]['id'];logger[_0xd9d4('0xb')](_0xd9d4('0x1a'),_0x4ed761[_0xd9d4('0x19')]);}}}if(!_0x1e5afa){logger[_0xd9d4('0xb')](_0xd9d4('0x1b'));_0x4ed761['userEmail']=_0x4ed761[_0xd9d4('0xe')];_0x4ed761['userId']=_0x4ed761[_0xd9d4('0xf')];_0x1e5afa=!![];}if(_0x1e5afa){_0x1f84ad(_0x4ed761);}else{_0x4e06ee({'statusCode':0x194,'message':_0xd9d4('0x1c')});}}else{_0x4e06ee({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x18eff6){logger[_0xd9d4('0x12')]('['+[_0x48b557['toUpperCase']()]+']',_0x18eff6[_0xd9d4('0x13')]);_0x4e06ee(_0x18eff6);});});};}function searchContact(_0x5981a8,_0x156e80,_0x4a24e5,_0x3ec6be){return new Promise(function(_0x4074f6,_0x2fe411){var _0x118582={'method':_0xd9d4('0x14'),'headers':_0x156e80,'uri':_0x5981a8+_0xd9d4('0x1d')+_0x3ec6be+_0xd9d4('0x1e')+_0x4a24e5+_0xd9d4('0x1f'),'json':!![]};rp(_0x118582)[_0xd9d4('0x16')](function(_0x6e5f84){var _0x1d00bf=_[_0xd9d4('0x20')](_0x6e5f84['contacts'][_0xd9d4('0x21')],[_0x4a24e5,_0x3ec6be]);_0x4074f6(_0x1d00bf);})[_0xd9d4('0x11')](function(_0x2f8507){_0x2fe411(_0x2f8507);});});}function getEndUser(_0x4b97cf,_0x3eddf0,_0x541a28){return function(_0x5e86ef){return new Promise(function(_0x2f3913,_0xee0085){logger[_0xd9d4('0xb')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x5e86ef[_0xd9d4('0x22')]));searchContact(_0x541a28,_0x3eddf0,_0xd9d4('0x23'),_0x5e86ef[_0xd9d4('0x22')])[_0xd9d4('0x16')](function(_0x197370){if(_0x197370){_0x5e86ef[_0xd9d4('0x24')]=_0x197370['id'];logger['info'](_0xd9d4('0x25'),_0x5e86ef['endUserId']);return _0x2f3913(_0x5e86ef);}searchContact(_0x541a28,_0x3eddf0,_0xd9d4('0x26'),_0x5e86ef['contactNumber'])['then'](function(_0x3291d5){if(_0x3291d5){_0x5e86ef[_0xd9d4('0x24')]=_0x3291d5['id'];logger[_0xd9d4('0xb')]('Contact\x20found\x20work_number:',_0x5e86ef['endUserId']);return _0x2f3913(_0x5e86ef);}createEndUser(_0x5e86ef,_0x4b97cf,_0x3eddf0,_0x541a28)[_0xd9d4('0x16')](function(_0x23bb99){logger[_0xd9d4('0xb')](_0xd9d4('0x27'),_0x23bb99['endUserId']);return _0x2f3913(_0x23bb99);});});})[_0xd9d4('0x11')](function(_0x2d2f19){_0xee0085(_0x2d2f19);});});};}function createEndUser(_0x1ea566,_0x4bd8df,_0xb55a84,_0x1f0ac8){return new Promise(function(_0x3d4423,_0xbb6d75){var _0x54ba4a=moment();var _0x575f3c={'method':_0xd9d4('0x28'),'uri':_0x1f0ac8+_0xd9d4('0x29'),'body':{'contact':{'last_name':_0x1ea566[_0xd9d4('0x22')],'work_number':_0x1ea566[_0xd9d4('0x22')],'mobile_number':_0x1ea566[_0xd9d4('0x22')],'owner_id':_0x1ea566[_0xd9d4('0x19')],'created_at':_0x54ba4a['format'](_0xd9d4('0x2a'))}},'json':!![]};_0x575f3c[_0xd9d4('0xa')]=_0xb55a84;logger[_0xd9d4('0xb')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x575f3c)[_0xd9d4('0x16')](function(_0x19fbf7){_0x1ea566[_0xd9d4('0x24')]=_0x19fbf7['contact']['id'];_0x3d4423(_0x1ea566);})[_0xd9d4('0x11')](function(_0x45e214){logger[_0xd9d4('0x12')]('['+[_0x4bd8df['toUpperCase']()]+']',_0x45e214[_0xd9d4('0x13')]);_0xbb6d75(_0x45e214['message']);});});}function getTicket(_0x25204a,_0x1ba7d6,_0x390fba,_0x31e293,_0x2df88b){return function(_0x5934f4){logger[_0xd9d4('0xb')](_0xd9d4('0x2b'));return new Promise(function(_0x1adfc8,_0x2a47c3){var _0x15e62f=moment();var _0x2230bb={'method':_0xd9d4('0x28'),'uri':_0x390fba+_0xd9d4('0x2c'),'body':{'title':intUtil[_0xd9d4('0x2d')](_0x31e293['Subjects'],_0x2df88b,'\x20'),'description':intUtil[_0xd9d4('0x2d')](_0x31e293['Descriptions'],_0x2df88b,'\x0a'),'owner_id':_0x5934f4['userId'],'creater_id':_0x5934f4[_0xd9d4('0xf')],'targetable_id':_0x5934f4['endUserId'],'targetable_type':'Contact','created_at':_0x15e62f['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x15e62f[_0xd9d4('0x2e')](0x1e,'m')[_0xd9d4('0x2f')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x2230bb[_0xd9d4('0xa')]=_0x1ba7d6;return rp(_0x2230bb)[_0xd9d4('0x16')](function(_0x1a5917){_0x5934f4['ticketId']=_0x1a5917[_0xd9d4('0x30')]['id'];logger[_0xd9d4('0xb')]('Task\x20created:',_0x5934f4['ticketId']);_0x1adfc8(_0x5934f4);})[_0xd9d4('0x11')](function(_0x26d83a){logger['error']('['+[_0x25204a[_0xd9d4('0x31')]()]+']',_0x26d83a[_0xd9d4('0x13')]);_0x2a47c3(_0x26d83a['message']);});});};}function emit(_0xb66385,_0x389d3f,_0x4db7ff){var _0x265535={'uri':_0xb66385+_0xd9d4('0x32')+_0x4db7ff};io['to'](util[_0xd9d4('0x2f')]('user:%s',_0x389d3f))[_0xd9d4('0x33')](_0xd9d4('0x34'),_0x265535);}exports['cs']=function(_0x2e7b35,_0x26b0e1,_0x41e6fc,_0x5e875f,_0x360a49,_0x273b54,_0x4f5b9d,_0x5a1bb5){var _0x934804={};var _0x482f95={'Authorization':_0xd9d4('0x35')+_0x273b54['apiKey']};_0x273b54['remoteUri']=intUtil[_0xd9d4('0x36')](_0x273b54[_0xd9d4('0x37')]);_0x273b54[_0xd9d4('0x38')]=intUtil[_0xd9d4('0x36')](_0x273b54[_0xd9d4('0x38')]);var _0x2a6484=_0x273b54['remoteUri'];_0x934804['adminEmail']=_0x273b54[_0xd9d4('0x39')];_0x934804['contactNumber']=_0x5a1bb5[_0xd9d4('0x3a')]()===_0xd9d4('0x3b')?_0x26b0e1[_0xd9d4('0x3c')]:_0x26b0e1['calleridnum'];_0x934804[_0xd9d4('0x3d')]=_0x5a1bb5===_0xd9d4('0x3e')||_0x5a1bb5===_0xd9d4('0x3f')?_0xd9d4('0x3e'):_0xd9d4('0x3b');if(_0x5e875f){_0x934804[_0xd9d4('0x17')]=_0x5e875f[_0xd9d4('0xd')];}var _0x19c466=util['format'](_0xd9d4('0x40'),_0x273b54['serverUrl'],_0x26b0e1[_0xd9d4('0x41')],md5(_0x26b0e1[_0xd9d4('0x41')]));if(_0x360a49&&_0x360a49[_0xd9d4('0x42')]){logger[_0xd9d4('0xb')](_0xd9d4('0x43'),_0xd9d4('0x44'));_0x26b0e1[_0xd9d4('0x45')]=_0x19c466;}else if(_0x4f5b9d&&_0x4f5b9d[_0xd9d4('0x46')]&&_0x4f5b9d[_0xd9d4('0x46')]!==_0xd9d4('0x47')){logger['info']('[OUTBOUND]',_0xd9d4('0x44'));_0x26b0e1['recordingURL']=_0x19c466;}else{_0x26b0e1[_0xd9d4('0x45')]='';}return getAdminId(_0x934804,_0x5a1bb5,_0x482f95,_0x2a6484)[_0xd9d4('0x16')](getUser(_0x5a1bb5,_0x482f95,_0x2a6484))[_0xd9d4('0x16')](getEndUser(_0x5a1bb5,_0x482f95,_0x2a6484))[_0xd9d4('0x16')](getTicket(_0x5a1bb5,_0x482f95,_0x2a6484,_0x41e6fc,_0x26b0e1))['then'](function(_0x67dfb){logger['info'](util['format'](_0xd9d4('0x48'),_0x67dfb[_0xd9d4('0x49')]));if(_0x5a1bb5!=='unmanaged'){logger['info']('['+[_0x5a1bb5['toUpperCase']()]+']',_0xd9d4('0x4a'));emit(_0x2a6484,_0x5e875f[_0xd9d4('0x4b')],_0x67dfb[_0xd9d4('0x24')]);}})[_0xd9d4('0x11')](function(_0x481b01){logger[_0xd9d4('0x12')]('['+[_0x5a1bb5[_0xd9d4('0x31')]()]+_0xd9d4('0x4c'),util[_0xd9d4('0x4d')](_0x481b01,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6df8=['localhost','socket.io-emitter','/api/selector/owners','headers','info','then','length','email','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','users','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','adminId','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','moment','./util','../../../../config/logger','freshsales','redis'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x6df8,0xe6));var _0x86df=function(_0x2384bb,_0x12f81b){_0x2384bb=_0x2384bb-0x0;var _0x3f2bac=_0x6df8[_0x2384bb];return _0x3f2bac;};'use strict';var _=require('lodash');var rp=require(_0x86df('0x0'));var md5=require(_0x86df('0x1'));var util=require('util');var moment=require(_0x86df('0x2'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x86df('0x3'));var config=require('../../../../config/environment');var logger=require(_0x86df('0x4'))(_0x86df('0x5'));config['redis']=_['defaults'](config[_0x86df('0x6')],{'host':_0x86df('0x7'),'port':0x18eb});var io=require(_0x86df('0x8'))(new Redis(config[_0x86df('0x6')]));function getAdminId(_0x5440f3,_0x44092a,_0x7bc2d0,_0x1b03ec){return new Promise(function(_0x30042c,_0x513b5a){var _0x3038ef=![];var _0x49fa33={'method':'GET','uri':_0x1b03ec+_0x86df('0x9'),'json':!![]};_0x49fa33[_0x86df('0xa')]=_0x7bc2d0;logger[_0x86df('0xb')]('Getting\x20admin\x20information');return rp(_0x49fa33)[_0x86df('0xc')](function(_0x25c7b3){if(_0x25c7b3){var _0x10f66f=_0x25c7b3['users'];var _0x34075b=null;for(_0x34075b=0x0;_0x34075b<_0x10f66f[_0x86df('0xd')];_0x34075b++){if(_0x10f66f[_0x34075b][_0x86df('0xe')]===_0x5440f3['adminEmail']){_0x5440f3['adminId']=_0x10f66f[_0x34075b]['id'];_0x3038ef=!![];}}if(_0x3038ef){logger['info'](_0x86df('0xf'),_0x5440f3['adminId']);_0x30042c(_0x5440f3);}else{_0x513b5a({'statusCode':0x194,'message':_0x86df('0x10')});}}else{_0x513b5a({'statusCode':0x194,'message':_0x86df('0x10')});}})[_0x86df('0x11')](function(_0x41e134){logger['error']('['+[_0x44092a[_0x86df('0x12')]()]+']',_0x41e134[_0x86df('0x13')]);_0x513b5a(_0x41e134);});});}function getUser(_0x26e94f,_0x40759c,_0x487311){return function(_0x56809b){return new Promise(function(_0x57f4b7,_0x2e5915){var _0x2a6017={'method':_0x86df('0x14'),'uri':_0x487311+_0x86df('0x9'),'json':!![]};_0x2a6017[_0x86df('0xa')]=_0x40759c;logger[_0x86df('0xb')]('Getting\x20user\x20list');return rp(_0x2a6017)['then'](function(_0x34f402){if(_0x34f402){var _0x2a6fc4=_0x34f402[_0x86df('0x15')];var _0x1f9398=![];var _0x14cfad=null;if(_0x56809b['agentEmail']!==null){logger[_0x86df('0xb')](_0x86df('0x16'),_0x56809b['agentEmail']);_0x56809b[_0x86df('0x17')]=_0x56809b['agentEmail'];for(_0x14cfad=0x0;_0x14cfad<_0x2a6fc4[_0x86df('0xd')];_0x14cfad++){if(_0x2a6fc4[_0x14cfad][_0x86df('0xe')]===_0x56809b['agentEmail']){_0x1f9398=!![];_0x56809b[_0x86df('0x18')]=_0x2a6fc4[_0x14cfad]['id'];logger[_0x86df('0xb')]('User\x20found:',_0x56809b[_0x86df('0x18')]);}}}if(!_0x1f9398){logger[_0x86df('0xb')](_0x86df('0x19'));_0x56809b[_0x86df('0x17')]=_0x56809b[_0x86df('0x1a')];_0x56809b['userId']=_0x56809b[_0x86df('0x1b')];_0x1f9398=!![];}if(_0x1f9398){_0x57f4b7(_0x56809b);}else{_0x2e5915({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2e5915({'statusCode':0x194,'message':_0x86df('0x10')});}})[_0x86df('0x11')](function(_0x3ec638){logger[_0x86df('0x1c')]('['+[_0x26e94f[_0x86df('0x12')]()]+']',_0x3ec638[_0x86df('0x13')]);_0x2e5915(_0x3ec638);});});};}function searchContact(_0x213f56,_0x490cea,_0x482d45,_0x31848d){return new Promise(function(_0x556bee,_0x510c90){var _0xe66c55={'method':'GET','headers':_0x490cea,'uri':_0x213f56+_0x86df('0x1d')+_0x31848d+_0x86df('0x1e')+_0x482d45+_0x86df('0x1f'),'json':!![]};rp(_0xe66c55)[_0x86df('0xc')](function(_0x1995b5){var _0x102b5d=_[_0x86df('0x20')](_0x1995b5['contacts'][_0x86df('0x21')],[_0x482d45,_0x31848d]);_0x556bee(_0x102b5d);})[_0x86df('0x11')](function(_0x13fdf3){_0x510c90(_0x13fdf3);});});}function getEndUser(_0x212566,_0x3e0164,_0xe5b02f){return function(_0x40eb96){return new Promise(function(_0x34bfb0,_0x256e9d){logger['info'](util[_0x86df('0x22')](_0x86df('0x23'),_0x40eb96[_0x86df('0x24')]));searchContact(_0xe5b02f,_0x3e0164,_0x86df('0x25'),_0x40eb96['contactNumber'])[_0x86df('0xc')](function(_0x1d646c){if(_0x1d646c){_0x40eb96[_0x86df('0x26')]=_0x1d646c['id'];logger[_0x86df('0xb')](_0x86df('0x27'),_0x40eb96[_0x86df('0x26')]);return _0x34bfb0(_0x40eb96);}searchContact(_0xe5b02f,_0x3e0164,_0x86df('0x28'),_0x40eb96[_0x86df('0x24')])[_0x86df('0xc')](function(_0x19e1f8){if(_0x19e1f8){_0x40eb96[_0x86df('0x26')]=_0x19e1f8['id'];logger[_0x86df('0xb')](_0x86df('0x29'),_0x40eb96[_0x86df('0x26')]);return _0x34bfb0(_0x40eb96);}createEndUser(_0x40eb96,_0x212566,_0x3e0164,_0xe5b02f)[_0x86df('0xc')](function(_0x2bb2d5){logger[_0x86df('0xb')](_0x86df('0x2a'),_0x2bb2d5['endUserId']);return _0x34bfb0(_0x2bb2d5);});});})[_0x86df('0x11')](function(_0x16ed57){_0x256e9d(_0x16ed57);});});};}function createEndUser(_0x56ed8a,_0x21f8f5,_0x4c63f2,_0x46dd2c){return new Promise(function(_0x79cb6c,_0x5bde3f){var _0x91e2d=moment();var _0x14c006={'method':_0x86df('0x2b'),'uri':_0x46dd2c+_0x86df('0x2c'),'body':{'contact':{'last_name':_0x56ed8a['contactNumber'],'work_number':_0x56ed8a[_0x86df('0x24')],'mobile_number':_0x56ed8a[_0x86df('0x24')],'owner_id':_0x56ed8a[_0x86df('0x18')],'created_at':_0x91e2d[_0x86df('0x22')](_0x86df('0x2d'))}},'json':!![]};_0x14c006[_0x86df('0xa')]=_0x4c63f2;logger[_0x86df('0xb')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x14c006)[_0x86df('0xc')](function(_0x2513b1){_0x56ed8a[_0x86df('0x26')]=_0x2513b1[_0x86df('0x2e')]['id'];_0x79cb6c(_0x56ed8a);})[_0x86df('0x11')](function(_0x116772){logger[_0x86df('0x1c')]('['+[_0x21f8f5['toUpperCase']()]+']',_0x116772[_0x86df('0x13')]);_0x5bde3f(_0x116772['message']);});});}function getTicket(_0x5aebff,_0x51217d,_0x3524c6,_0x2bf9dd,_0x416e24){return function(_0x239680){logger['info'](_0x86df('0x2f'));return new Promise(function(_0x748cdb,_0x2bb952){var _0x5ea6bd=moment();var _0x5dd5c5={'method':_0x86df('0x2b'),'uri':_0x3524c6+'/api/tasks','body':{'title':intUtil[_0x86df('0x30')](_0x2bf9dd['Subjects'],_0x416e24,'\x20'),'description':intUtil[_0x86df('0x30')](_0x2bf9dd[_0x86df('0x31')],_0x416e24,'\x0a'),'owner_id':_0x239680[_0x86df('0x18')],'creater_id':_0x239680[_0x86df('0x1b')],'targetable_id':_0x239680[_0x86df('0x26')],'targetable_type':_0x86df('0x32'),'created_at':_0x5ea6bd[_0x86df('0x22')](_0x86df('0x2d')),'due_date':_0x5ea6bd[_0x86df('0x33')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5dd5c5[_0x86df('0xa')]=_0x51217d;return rp(_0x5dd5c5)[_0x86df('0xc')](function(_0x4c88fe){_0x239680[_0x86df('0x34')]=_0x4c88fe['task']['id'];logger[_0x86df('0xb')](_0x86df('0x35'),_0x239680[_0x86df('0x34')]);_0x748cdb(_0x239680);})[_0x86df('0x11')](function(_0x256a3c){logger[_0x86df('0x1c')]('['+[_0x5aebff['toUpperCase']()]+']',_0x256a3c[_0x86df('0x13')]);_0x2bb952(_0x256a3c[_0x86df('0x13')]);});});};}function emit(_0x428cf3,_0x395608,_0x267c2a){var _0x22116f={'uri':_0x428cf3+_0x86df('0x36')+_0x267c2a};io['to'](util[_0x86df('0x22')](_0x86df('0x37'),_0x395608))['emit'](_0x86df('0x38'),_0x22116f);}exports['cs']=function(_0x447018,_0x1f1792,_0x561d20,_0x26697e,_0x559379,_0x3b070b,_0x25ec35,_0x1e4c0d){var _0xe1d905={};var _0x538184={'Authorization':_0x86df('0x39')+_0x3b070b[_0x86df('0x3a')]};_0x3b070b[_0x86df('0x3b')]=intUtil['stripTrailingSlash'](_0x3b070b['remoteUri']);_0x3b070b[_0x86df('0x3c')]=intUtil['stripTrailingSlash'](_0x3b070b[_0x86df('0x3c')]);var _0x3a5568=_0x3b070b[_0x86df('0x3b')];_0xe1d905[_0x86df('0x1a')]=_0x3b070b[_0x86df('0x3d')];_0xe1d905[_0x86df('0x24')]=_0x1e4c0d[_0x86df('0x3e')]()===_0x86df('0x3f')?_0x1f1792['destcalleridnum']:_0x1f1792[_0x86df('0x40')];_0xe1d905[_0x86df('0x41')]=_0x1e4c0d==='queue'||_0x1e4c0d===_0x86df('0x42')?_0x86df('0x43'):_0x86df('0x3f');if(_0x26697e){_0xe1d905['agentEmail']=_0x26697e[_0x86df('0xe')];}var _0x5d0005=util[_0x86df('0x22')](_0x86df('0x44'),_0x3b070b['serverUrl'],_0x1f1792[_0x86df('0x45')],md5(_0x1f1792[_0x86df('0x45')]));if(_0x559379&&_0x559379[_0x86df('0x46')]){logger[_0x86df('0xb')](_0x86df('0x47'),_0x86df('0x48'));_0x1f1792[_0x86df('0x49')]=_0x5d0005;}else if(_0x25ec35&&_0x25ec35[_0x86df('0x4a')]&&_0x25ec35['recordingFormat']!==_0x86df('0x4b')){logger[_0x86df('0xb')]('[OUTBOUND]',_0x86df('0x48'));_0x1f1792[_0x86df('0x49')]=_0x5d0005;}else{_0x1f1792[_0x86df('0x49')]='';}return getAdminId(_0xe1d905,_0x1e4c0d,_0x538184,_0x3a5568)[_0x86df('0xc')](getUser(_0x1e4c0d,_0x538184,_0x3a5568))['then'](getEndUser(_0x1e4c0d,_0x538184,_0x3a5568))[_0x86df('0xc')](getTicket(_0x1e4c0d,_0x538184,_0x3a5568,_0x561d20,_0x1f1792))[_0x86df('0xc')](function(_0x449833){logger['info'](util[_0x86df('0x22')]('The\x20ticket\x20ID\x20is:\x20%s',_0x449833[_0x86df('0x34')]));if(_0x1e4c0d!==_0x86df('0x42')){logger['info']('['+[_0x1e4c0d['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3a5568,_0x26697e[_0x86df('0x4c')],_0x449833[_0x86df('0x26')]);}})[_0x86df('0x11')](function(_0x25c709){logger['error']('['+[_0x1e4c0d[_0x86df('0x12')]()]+_0x86df('0x4d'),util[_0x86df('0x4e')](_0x25c709,{'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 987b4b3..20b8120 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 _0x8142=['desk','vtiger','dynamics365','freshsales','exec','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','freshdesk','zoho','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm'];(function(_0x47cbd3,_0x5e1aad){var _0x2277af=function(_0x5e0a38){while(--_0x5e0a38){_0x47cbd3['push'](_0x47cbd3['shift']());}};_0x2277af(++_0x5e1aad);}(_0x8142,0x1e1));var _0x2814=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x8142[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0x2814('0x0'));var util=require(_0x2814('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x2814('0x2'));var sugarcrm=require(_0x2814('0x3'));var freshdesk=require(_0x2814('0x4'));var zoho=require(_0x2814('0x5'));var desk=require(_0x2814('0x6'));var vtiger=require(_0x2814('0x7'));var servicenow=require(_0x2814('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x2814('0x9'));var integrations=[_0x2814('0xa'),_0x2814('0xb'),_0x2814('0xc'),'freshdesk','zoho',_0x2814('0xd'),_0x2814('0xe'),_0x2814('0xf'),_0x2814('0x10'),'servicenow'];exports[_0x2814('0x11')]=function(_0x5b9560,_0x3402a2,_0x3e76d9,_0x2c6564,_0x2b73ba,_0x1f7692){if(_0x3e76d9){if(_['includes'](integrations,_0x5b9560[_0x2814('0x12')][_0x2814('0x13')]())){try{var _0x1d4cef=null;var _0x3be8da='';var _0x609713=_0x3e76d9[_0x5b9560[_0x2814('0x12')][_0x2814('0x13')]()];if(_0x609713){var _0x3e1b16=_0x609713[_0x5b9560['data2']];if(_0x3e1b16){var _0x5c8ba2=_[_0x2814('0x14')](_0x3e1b16[_0x2814('0x15')],{'id':parseInt(_0x5b9560['data3'],0xa)});if(_0x5c8ba2){if(_0x2c6564){if(_0x2b73ba&&_0x3402a2[_0x2814('0x16')]){_0x3be8da=_0x2814('0x16');}else if(_0x3402a2[_0x2814('0x17')]){_0x3be8da=_0x2814('0x18');}else{console[_0x2814('0x19')](_0x2814('0x1a'),_0x3402a2);}}else{_0x3be8da='unmanaged';}switch(_0x5b9560[_0x2814('0x12')]['toLowerCase']()){case _0x2814('0xa'):zendesk[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0xb'):salesforce[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case'sugarcrm':sugarcrm[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0x1b'):freshdesk[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0x1c'):zoho[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0xd'):desk[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0xe'):vtiger[_0x3be8da](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692);break;case _0x2814('0x10'):freshsales['cs'](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692,_0x3be8da);break;case _0x2814('0x1d'):servicenow['cs'](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692,_0x3be8da);break;case _0x2814('0xf'):dynamics365['cs'](_0x5b9560,_0x3402a2,_0x5c8ba2,_0x2c6564,_0x2b73ba,_0x3e1b16,_0x1f7692,_0x3be8da);break;default:console[_0x2814('0x19')](_0x2814('0x1e'));}}else{_0x1d4cef=require(_0x2814('0x1f'))(_0x5b9560[_0x2814('0x12')][_0x2814('0x13')]());_0x1d4cef['error'](_0x2814('0x20'),util[_0x2814('0x21')](_0x2814('0x22'),_0x5b9560[_0x2814('0x12')][_0x2814('0x13')](),_0x5b9560[_0x2814('0x23')]));}}else{_0x1d4cef=require(_0x2814('0x1f'))(_0x5b9560[_0x2814('0x12')]['toLowerCase']());_0x1d4cef['error'](_0x2814('0x20'),util[_0x2814('0x21')](_0x2814('0x24'),_0x5b9560[_0x2814('0x12')][_0x2814('0x13')](),_0x5b9560['data2']));}}else{}}catch(_0x24160f){console[_0x2814('0x25')](_0x24160f);}}}}; \ No newline at end of file +var _0x8a24=['data2','find','Configurations','data3','queue','routeId','log','unmanaged','zoho','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase'];(function(_0xfaf611,_0xef98f7){var _0x3e18bb=function(_0x575a19){while(--_0x575a19){_0xfaf611['push'](_0xfaf611['shift']());}};_0x3e18bb(++_0xef98f7);}(_0x8a24,0x151));var _0x48a2=function(_0x48c7f7,_0x3f664e){_0x48c7f7=_0x48c7f7-0x0;var _0x41589a=_0x8a24[_0x48c7f7];return _0x41589a;};'use strict';var _=require(_0x48a2('0x0'));var util=require(_0x48a2('0x1'));var zendesk=require(_0x48a2('0x2'));var salesforce=require(_0x48a2('0x3'));var sugarcrm=require(_0x48a2('0x4'));var freshdesk=require(_0x48a2('0x5'));var zoho=require(_0x48a2('0x6'));var desk=require(_0x48a2('0x7'));var vtiger=require(_0x48a2('0x8'));var servicenow=require(_0x48a2('0x9'));var dynamics365=require('./dynamics365');var freshsales=require(_0x48a2('0xa'));var integrations=[_0x48a2('0xb'),_0x48a2('0xc'),_0x48a2('0xd'),_0x48a2('0xe'),'zoho','desk',_0x48a2('0xf'),_0x48a2('0x10'),_0x48a2('0x11'),_0x48a2('0x12')];exports[_0x48a2('0x13')]=function(_0x2d6fc1,_0x2ecebe,_0x1c950c,_0x4ef3da,_0x50bd0e,_0x5d38ba){if(_0x1c950c){if(_[_0x48a2('0x14')](integrations,_0x2d6fc1[_0x48a2('0x15')][_0x48a2('0x16')]())){try{var _0x736a13=null;var _0x3f4e54='';var _0x376581=_0x1c950c[_0x2d6fc1['data1'][_0x48a2('0x16')]()];if(_0x376581){var _0x21573d=_0x376581[_0x2d6fc1[_0x48a2('0x17')]];if(_0x21573d){var _0x3f390c=_[_0x48a2('0x18')](_0x21573d[_0x48a2('0x19')],{'id':parseInt(_0x2d6fc1[_0x48a2('0x1a')],0xa)});if(_0x3f390c){if(_0x4ef3da){if(_0x50bd0e&&_0x2ecebe[_0x48a2('0x1b')]){_0x3f4e54='queue';}else if(_0x2ecebe[_0x48a2('0x1c')]){_0x3f4e54='outbound';}else{console[_0x48a2('0x1d')]('EVENT\x20UNKNOWN',_0x2ecebe);}}else{_0x3f4e54=_0x48a2('0x1e');}switch(_0x2d6fc1[_0x48a2('0x15')]['toLowerCase']()){case _0x48a2('0xb'):zendesk[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0xc'):salesforce[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0xd'):sugarcrm[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case'freshdesk':freshdesk[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0x1f'):zoho[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0x20'):desk[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0xf'):vtiger[_0x3f4e54](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba);break;case _0x48a2('0x11'):freshsales['cs'](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba,_0x3f4e54);break;case _0x48a2('0x12'):servicenow['cs'](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba,_0x3f4e54);break;case _0x48a2('0x10'):dynamics365['cs'](_0x2d6fc1,_0x2ecebe,_0x3f390c,_0x4ef3da,_0x50bd0e,_0x21573d,_0x5d38ba,_0x3f4e54);break;default:console['log'](_0x48a2('0x21'));}}else{_0x736a13=require(_0x48a2('0x22'))(_0x2d6fc1[_0x48a2('0x15')]['toLowerCase']());_0x736a13[_0x48a2('0x23')](_0x48a2('0x24'),util[_0x48a2('0x25')](_0x48a2('0x26'),_0x2d6fc1[_0x48a2('0x15')][_0x48a2('0x16')](),_0x2d6fc1[_0x48a2('0x1a')]));}}else{_0x736a13=require(_0x48a2('0x22'))(_0x2d6fc1[_0x48a2('0x15')][_0x48a2('0x16')]());_0x736a13[_0x48a2('0x23')](_0x48a2('0x24'),util[_0x48a2('0x25')](_0x48a2('0x27'),_0x2d6fc1[_0x48a2('0x15')]['toLowerCase'](),_0x2d6fc1[_0x48a2('0x17')]));}}else{}}catch(_0x1a8e98){console['error'](_0x1a8e98);}}}}; \ 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 2ebd012..a852fac 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 _0xf5b7=['trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridnum','toUpperCase','lodash','moment','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','length','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','','Company','No\x20Company','upperFirst','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab'];(function(_0x3cb992,_0x2d1311){var _0x4ccfa4=function(_0x222662){while(--_0x222662){_0x3cb992['push'](_0x3cb992['shift']());}};_0x4ccfa4(++_0x2d1311);}(_0xf5b7,0x19a));var _0x7f5b=function(_0x4332f9,_0x283d3a){_0x4332f9=_0x4332f9-0x0;var _0x1cb20c=_0xf5b7[_0x4332f9];return _0x1cb20c;};'use strict';var _=require(_0x7f5b('0x0'));var rp=require('request-promise');var moment=require(_0x7f5b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x7f5b('0x2'));var util=require(_0x7f5b('0x3'));var Redis=require(_0x7f5b('0x4'));var intUtil=require(_0x7f5b('0x5'));var config=require(_0x7f5b('0x6'));var logger=require(_0x7f5b('0x7'))(_0x7f5b('0x8'));config[_0x7f5b('0x9')]=_[_0x7f5b('0xa')](config['redis'],{'host':_0x7f5b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7f5b('0x9')]));function emit(_0x4471c9,_0x4c4cc2,_0x3016f1){io['to'](_0x4471c9)['emit'](_0x4c4cc2,_0x3016f1);}function getTicket(_0x2e59d4,_0x2af1b2,_0x332f0c,_0x47dea8,_0x1ba801,_0x1535b8,_0x3009fa,_0x56d26d){var _0x2cf2f1=Object[_0x7f5b('0xc')]({},{'OwnerId':_0x2af1b2['id'],'Subject':intUtil[_0x7f5b('0xd')](_0x47dea8[_0x7f5b('0xe')],_0x1ba801,'\x20'),'Description':intUtil[_0x7f5b('0xd')](_0x47dea8[_0x7f5b('0xf')],_0x1ba801,'\x0a')},getCustomFields(_0x1535b8,_0x1ba801));if(_0x332f0c){if(_0x47dea8[_0x7f5b('0x10')]==='Task'){_0x2cf2f1[_0x7f5b('0x11')]=moment[_0x7f5b('0x12')]();_0x2cf2f1[_0x7f5b('0x13')]=![];_0x2cf2f1[_0x7f5b('0x14')]=![];if(_0x332f0c[_0x7f5b('0x15')]===_0x7f5b('0x16')||_0x332f0c[_0x7f5b('0x15')]===_0x7f5b('0x17')){_0x2cf2f1[_0x7f5b('0x18')]=_0x332f0c['id'];}else if(_0x332f0c[_0x7f5b('0x15')]===_0x7f5b('0x19')){_0x2cf2f1['WhatId']=_0x332f0c['id'];}}else if(_0x47dea8[_0x7f5b('0x10')]===_0x7f5b('0x1a')){if(_0x332f0c['endUserType']==='contact'){_0x2cf2f1[_0x7f5b('0x1b')]=_0x332f0c['id'];}else if(_0x332f0c['endUserType']==='account'){_0x2cf2f1[_0x7f5b('0x1c')]=_0x332f0c['id'];}else if(_0x332f0c[_0x7f5b('0x15')]===_0x7f5b('0x17')&&_0x47dea8[_0x7f5b('0x1d')]){_0x2cf2f1[_0x47dea8[_0x7f5b('0x1d')]]=_0x332f0c['id'];}else{logger['info'](_0x7f5b('0x1e'));}}}return _0x3009fa[_0x7f5b('0x1f')](_0x47dea8[_0x7f5b('0x10')])[_0x7f5b('0x20')](_0x2cf2f1);}function getUser(_0x2c8457,_0x14d3eb,_0x3aa24b){if(!_[_0x7f5b('0x21')](_0x14d3eb)&&intUtil[_0x7f5b('0x22')](_0x14d3eb)){var _0x94966f={'Email':_0x14d3eb};var _0x1c918e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3aa24b[_0x7f5b('0x1f')]('User')[_0x7f5b('0x23')](_0x94966f,_0x1c918e)[_0x7f5b('0x24')]()[_0x7f5b('0x25')](function(_0xf10fb0){if(_0xf10fb0[_0x7f5b('0x26')]){var _0x377af7=_[_0x7f5b('0x23')](_0xf10fb0,function(_0x4b8090){return _0x4b8090[_0x7f5b('0x27')]===_0x14d3eb;});if(_0x377af7){logger[_0x7f5b('0x28')](_0x7f5b('0x29'),_0x14d3eb);return BPromise['resolve']({'id':_0x377af7['Id'],'name':_0x377af7[_0x7f5b('0x2a')]});}}else{logger[_0x7f5b('0x28')](_0x7f5b('0x2b'),_0x14d3eb);return _0x3aa24b[_0x7f5b('0x2c')]()['then'](function(_0x1eb871){return BPromise['resolve']({'id':_0x1eb871[_0x7f5b('0x2d')],'name':_0x1eb871[_0x7f5b('0x2e')]});});}});}else{logger[_0x7f5b('0x28')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x14d3eb);return _0x3aa24b[_0x7f5b('0x2c')]()[_0x7f5b('0x25')](function(_0x506c31){return BPromise['resolve']({'id':_0x506c31[_0x7f5b('0x2d')],'name':_0x506c31['display_name']});});}}function getEndUser(_0x14cfc2,_0x490e51,_0x5a269f,_0x181088,_0x59151f){var _0x14e211={'$or':{'Phone':_0x181088}};var _0x54aac7={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7f5b('0x2f')]()[_0x7f5b('0x25')](function(){logger[_0x7f5b('0x28')](_0x7f5b('0x30'),_0x181088,_0x490e51[_0x7f5b('0x31')]);switch(_0x490e51['moduleSearch']){case _0x7f5b('0x32'):var _0x3a1636=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51[_0x7f5b('0x34')]){var _0x2ece8d={};_0x2ece8d[_0x490e51[_0x7f5b('0x34')]]=_0x181088;_[_0x7f5b('0x35')](_0x3a1636[_0x7f5b('0x36')],_0x2ece8d);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x37'))[_0x7f5b('0x23')](_0x3a1636,_0x54aac7)[_0x7f5b('0x24')]()[_0x7f5b('0x25')](function(_0x5d1cf8){if(_0x5d1cf8&&_0x5d1cf8[_0x7f5b('0x26')]){return _0x5d1cf8;}else{var _0x2f92bc=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51[_0x7f5b('0x38')]){var _0x365b9f={};_0x365b9f[_0x490e51[_0x7f5b('0x38')]]=_0x181088;_['merge'](_0x2f92bc[_0x7f5b('0x36')],_0x365b9f);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x39'))[_0x7f5b('0x23')](_0x2f92bc,_0x54aac7);}});case _0x7f5b('0x3a'):var _0x262820=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51['additionalSearchAccount']){var _0x2ece8d={};_0x2ece8d[_0x490e51[_0x7f5b('0x3b')]]=_0x181088;_[_0x7f5b('0x35')](_0x262820['$or'],_0x2ece8d);}return _0x59151f['sobject'](_0x7f5b('0x3c'))[_0x7f5b('0x23')](_0x262820,_0x54aac7)[_0x7f5b('0x24')]()[_0x7f5b('0x25')](function(_0x8aab66){if(_0x8aab66&&_0x8aab66[_0x7f5b('0x26')]){return _0x8aab66;}else{var _0x566bc4=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51[_0x7f5b('0x34')]){var _0x4063f4={};_0x4063f4[_0x490e51[_0x7f5b('0x34')]]=_0x181088;_[_0x7f5b('0x35')](_0x566bc4['$or'],_0x4063f4);}return _0x59151f['sobject'](_0x7f5b('0x37'))[_0x7f5b('0x23')](_0x566bc4,_0x54aac7)[_0x7f5b('0x25')](function(_0x3853d7){if(_0x3853d7&&_0x3853d7['length']){return _0x3853d7;}else{var _0x3be6ce=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51['additionalSearchLead']){var _0x327a93={};_0x327a93[_0x490e51[_0x7f5b('0x38')]]=_0x181088;_[_0x7f5b('0x35')](_0x3be6ce[_0x7f5b('0x36')],_0x327a93);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x39'))[_0x7f5b('0x23')](_0x3be6ce,_0x54aac7);}});}});case _0x7f5b('0x16'):var _0x3a1636=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51[_0x7f5b('0x34')]){var _0x2ece8d={};_0x2ece8d[_0x490e51[_0x7f5b('0x34')]]=_0x181088;_[_0x7f5b('0x35')](_0x3a1636['$or'],_0x2ece8d);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x37'))[_0x7f5b('0x23')](_0x3a1636,_0x54aac7)['execute']();case _0x7f5b('0x17'):var _0x4f566f=_['cloneDeep'](_0x14e211);if(_0x490e51['additionalSearchLead']){var _0x2ece8d={};_0x2ece8d[_0x490e51['additionalSearchLead']]=_0x181088;_[_0x7f5b('0x35')](_0x4f566f[_0x7f5b('0x36')],_0x2ece8d);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x39'))[_0x7f5b('0x23')](_0x4f566f,_0x54aac7);case _0x7f5b('0x19'):var _0x262820=_[_0x7f5b('0x33')](_0x14e211);if(_0x490e51[_0x7f5b('0x3b')]){var _0x2ece8d={};_0x2ece8d[_0x490e51[_0x7f5b('0x3b')]]=_0x181088;_['merge'](_0x262820['$or'],_0x2ece8d);}return _0x59151f[_0x7f5b('0x1f')](_0x7f5b('0x3c'))[_0x7f5b('0x23')](_0x262820,_0x54aac7);default:return null;}})[_0x7f5b('0x25')](function(_0x27bcc6){if(_0x27bcc6&&_0x27bcc6['length']){var _0x102c1d=_[_0x7f5b('0x3d')](_0x27bcc6);if(_0x102c1d){return BPromise[_0x7f5b('0x2f')]({'id':_0x102c1d['Id'],'name':_0x102c1d[_0x7f5b('0x2a')],'phone':_0x102c1d[_0x7f5b('0x3e')],'endUserType':_0x102c1d[_0x7f5b('0x3f')]['type'][_0x7f5b('0x40')]()});}}})[_0x7f5b('0x25')](function(_0xc65729){if(_0xc65729){logger[_0x7f5b('0x28')](_0x7f5b('0x41'),_0xc65729['endUserType'],_0x181088);return BPromise[_0x7f5b('0x2f')](_0xc65729);}else{logger['info'](_0x7f5b('0x42'),_0x181088);var _0x4df5ad={'Phone':_0x181088};if(_0x490e51[_0x7f5b('0x43')]){if(_0x490e51['moduleCreate']==='contact'){logger['info'](_0x7f5b('0x44'),_0x181088,_0x490e51[_0x7f5b('0x43')]);_0x4df5ad['LastName']=_0x5a269f!==''?_0x5a269f:util[_0x7f5b('0x45')](_0x7f5b('0x46'),_0x181088);}else if(_0x490e51['moduleCreate']===_0x7f5b('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x181088,_0x490e51['moduleCreate']);_0x4df5ad[_0x7f5b('0x47')]=_0x5a269f!==_0x7f5b('0x48')?_0x5a269f:util[_0x7f5b('0x45')](_0x7f5b('0x46'),_0x181088);_0x4df5ad[_0x7f5b('0x49')]=_0x7f5b('0x4a');}else if(_0x490e51[_0x7f5b('0x43')]===_0x7f5b('0x19')){logger[_0x7f5b('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x181088,_0x490e51[_0x7f5b('0x43')]);_0x4df5ad[_0x7f5b('0x2a')]=_0x5a269f!==_0x7f5b('0x48')?_0x5a269f:util[_0x7f5b('0x45')](_0x7f5b('0x46'),_0x181088);}else{return null;}}return _0x59151f[_0x7f5b('0x1f')](_[_0x7f5b('0x4b')](_0x490e51[_0x7f5b('0x43')]))[_0x7f5b('0x20')](_0x4df5ad)[_0x7f5b('0x25')](function(_0x59b067){return BPromise[_0x7f5b('0x2f')]({'id':_0x59b067['id'],'endUserType':_0x490e51['moduleCreate']});});}});}function getCustomFields(_0x1239a6,_0xe796fa){var _0x54214d={};if(_0x1239a6[_0x7f5b('0x26')]>0x0){_['forEach'](_0x1239a6,function(_0x5e76c5){if(_[_0x7f5b('0x4c')]([_0x7f5b('0x4d'),_0x7f5b('0x4e')],_0x5e76c5[_0x7f5b('0x4f')])&&_0x5e76c5[_0x7f5b('0x50')]){_0x54214d[_0x5e76c5[_0x7f5b('0x50')]]=_0x5e76c5[_0x7f5b('0x51')][_0x7f5b('0x52')]();}else if(_0x5e76c5['type']===_0x7f5b('0x53')&&_0x5e76c5[_0x7f5b('0x54')]&&_0x5e76c5['idField']){_0xe796fa[_0x5e76c5[_0x7f5b('0x54')]]&&(_0x54214d[_0x5e76c5[_0x7f5b('0x50')]]=_0xe796fa[_0x5e76c5[_0x7f5b('0x54')]][_0x7f5b('0x52')]());}else if(_0x5e76c5[_0x7f5b('0x4f')]===_0x7f5b('0x55')&&_0x5e76c5[_0x7f5b('0x56')]&&_0x5e76c5[_0x7f5b('0x56')][_0x7f5b('0x57')]&&_0x5e76c5['idField']){_0xe796fa[_0x5e76c5[_0x7f5b('0x56')][_0x7f5b('0x57')][_0x7f5b('0x40')]()]&&(_0x54214d[_0x5e76c5['idField']]=_0xe796fa[_0x5e76c5[_0x7f5b('0x56')][_0x7f5b('0x57')][_0x7f5b('0x40')]()][_0x7f5b('0x52')]());}});}return _0x54214d;}function getConnection(_0x4f70dd){var _0x3a3181=_0x4f70dd[_0x7f5b('0x58')][_0x7f5b('0x59')](_0x4f70dd[_0x7f5b('0x5a')]);var _0x23f7f4=new jsforce[(_0x7f5b('0x5b'))]({'oauth2':{'loginUrl':_0x4f70dd[_0x7f5b('0x5c')]||_0x7f5b('0x5d'),'clientId':_0x4f70dd[_0x7f5b('0x5e')],'clientSecret':_0x4f70dd[_0x7f5b('0x5f')]}});return _0x23f7f4['login'](_0x4f70dd[_0x7f5b('0x60')],_0x3a3181)['then'](function(){logger['info'](_0x7f5b('0x61'));return _0x23f7f4;});}exports[_0x7f5b('0x62')]=function(_0x255580,_0x36272c,_0x378f29,_0x2608c7,_0x2634b8,_0x3bebb1){var _0x6ca78e,_0x2c9e6f,_0x4fe7a0,_0x133f54;_0x3bebb1[_0x7f5b('0x63')]=intUtil[_0x7f5b('0x64')](_0x3bebb1[_0x7f5b('0x63')]);_0x3bebb1[_0x7f5b('0x5c')]=intUtil[_0x7f5b('0x64')](_0x3bebb1[_0x7f5b('0x5c')]);if(_0x2634b8&&_0x2634b8[_0x7f5b('0x65')]){logger[_0x7f5b('0x28')](_0x7f5b('0x66'),_0x7f5b('0x67'));_0x36272c[_0x7f5b('0x68')]=util['format'](_0x7f5b('0x69'),_0x3bebb1[_0x7f5b('0x63')],_0x36272c[_0x7f5b('0x6a')],md5(_0x36272c['uniqueid']));}else{_0x36272c['recordingURL']='';}return getConnection(_0x3bebb1)[_0x7f5b('0x25')](function(_0x2d4bea){_0x133f54=_0x2d4bea;return getUser(_0x3bebb1,_0x2608c7['email'],_0x133f54);})['then'](function(_0x487160){_0x6ca78e=_0x487160;return getEndUser(_0x3bebb1,_0x378f29,_0x36272c[_0x7f5b('0x6b')],_0x36272c['calleridnum'],_0x133f54);})[_0x7f5b('0x25')](function(_0x1033a2){_0x2c9e6f=_0x1033a2;return getTicket(_0x3bebb1,_0x6ca78e,_0x2c9e6f,_0x378f29,_0x36272c,_0x378f29['Fields'],_0x133f54,'queue');})[_0x7f5b('0x25')](function(_0x2695ee){_0x4fe7a0=_0x2695ee;logger[_0x7f5b('0x28')](_0x7f5b('0x6c'),_0x4fe7a0['id']);logger[_0x7f5b('0x28')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4fe7a0['id'],_0x2608c7[_0x7f5b('0x57')],_0x3bebb1['type']);switch(_0x3bebb1['type']){case _0x7f5b('0x6d'):emit(util[_0x7f5b('0x45')]('user:%s',_0x2608c7[_0x7f5b('0x57')]),_0x7f5b('0x6e'),{'recordId':_0x4fe7a0['id']});break;case'newTab':emit(util['format'](_0x7f5b('0x6f'),_0x2608c7[_0x7f5b('0x57')]),_0x7f5b('0x70'),{'uri':util[_0x7f5b('0x45')](_0x7f5b('0x71'),_0x133f54['instanceUrl'],_0x4fe7a0['id'])});break;default:logger[_0x7f5b('0x72')](_0x7f5b('0x73'));}})[_0x7f5b('0x74')](function(_0x1e9477){logger['error'](_0x7f5b('0x66'),_0x1e9477);});};exports[_0x7f5b('0x75')]=function(_0x621620,_0x29c255,_0x49ed24,_0x439ae5,_0x14c6a8,_0x22fb9f,_0x1c865d){var _0x2bdfdf,_0x1417e3,_0x305899,_0x65167b;_0x22fb9f[_0x7f5b('0x63')]=intUtil['stripTrailingSlash'](_0x22fb9f['serverUrl']);_0x22fb9f[_0x7f5b('0x5c')]=intUtil['stripTrailingSlash'](_0x22fb9f[_0x7f5b('0x5c')]);if(_0x1c865d&&_0x1c865d[_0x7f5b('0x76')]&&_0x1c865d[_0x7f5b('0x76')]!=='none'){logger['info'](_0x7f5b('0x77'),_0x7f5b('0x67'));_0x29c255[_0x7f5b('0x68')]=util[_0x7f5b('0x45')](_0x7f5b('0x69'),_0x22fb9f[_0x7f5b('0x63')],_0x29c255[_0x7f5b('0x6a')],md5(_0x29c255[_0x7f5b('0x6a')]));}return getConnection(_0x22fb9f)['then'](function(_0x11806c){_0x65167b=_0x11806c;return getUser(_0x22fb9f,_0x439ae5[_0x7f5b('0x78')],_0x65167b);})[_0x7f5b('0x25')](function(_0x57c530){_0x2bdfdf=_0x57c530;return getEndUser(_0x22fb9f,_0x49ed24,_0x29c255[_0x7f5b('0x79')],_0x29c255[_0x7f5b('0x7a')],_0x65167b);})['then'](function(_0x59a971){_0x1417e3=_0x59a971;return getTicket(_0x22fb9f,_0x2bdfdf,_0x1417e3,_0x49ed24,_0x29c255,_0x49ed24[_0x7f5b('0x7b')],_0x65167b,_0x7f5b('0x75'));})[_0x7f5b('0x25')](function(_0x40b20f){_0x305899=_0x40b20f;logger[_0x7f5b('0x28')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x305899['id']);logger[_0x7f5b('0x28')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x305899['id'],_0x439ae5[_0x7f5b('0x57')],_0x22fb9f[_0x7f5b('0x4f')]);switch(_0x22fb9f['type']){case'integrationTab':emit(util[_0x7f5b('0x45')](_0x7f5b('0x6f'),_0x439ae5[_0x7f5b('0x57')]),_0x7f5b('0x6e'),{'recordId':_0x305899['id']});break;case'newTab':emit(util['format']('user:%s',_0x439ae5[_0x7f5b('0x57')]),_0x7f5b('0x70'),{'uri':util['format'](_0x7f5b('0x71'),_0x65167b[_0x7f5b('0x7c')],_0x305899['id'])});break;default:logger['error'](_0x7f5b('0x77'),_0x7f5b('0x7d'));}})['catch'](function(_0x1818ea){logger[_0x7f5b('0x72')](_0x7f5b('0x77'),_0x1818ea);});};exports[_0x7f5b('0x7e')]=function(_0x1c5036,_0x41750a,_0x13bc5a,_0x30e9db,_0x19bfe4,_0x1c5f7f){var _0x5d53a6,_0x1959f7,_0x181e1f,_0x2fb9a2;_0x1c5f7f[_0x7f5b('0x63')]=intUtil[_0x7f5b('0x64')](_0x1c5f7f[_0x7f5b('0x63')]);_0x1c5f7f[_0x7f5b('0x5c')]=intUtil[_0x7f5b('0x64')](_0x1c5f7f['remoteUri']);if(_0x19bfe4&&_0x19bfe4[_0x7f5b('0x65')]){logger[_0x7f5b('0x28')]('['+_0x41750a[_0x7f5b('0x7f')]['toUpperCase']()+']',_0x7f5b('0x67'));_0x41750a[_0x7f5b('0x68')]=util[_0x7f5b('0x45')](_0x7f5b('0x69'),_0x1c5f7f[_0x7f5b('0x63')],_0x41750a['uniqueid'],md5(_0x41750a['uniqueid']));}else{_0x41750a[_0x7f5b('0x68')]='';}return getConnection(_0x1c5f7f)[_0x7f5b('0x25')](function(_0x2a42f8){_0x2fb9a2=_0x2a42f8;if(!_[_0x7f5b('0x21')](_0x30e9db)){return getUser(_0x1c5f7f,_0x30e9db[_0x7f5b('0x57')],_0x2fb9a2);}else{return getUser(_0x1c5f7f,null,_0x2fb9a2);}})['then'](function(_0x2b9ebc){_0x5d53a6=_0x2b9ebc;return getEndUser(_0x1c5f7f,_0x13bc5a,_0x41750a[_0x7f5b('0x6b')],_0x41750a[_0x7f5b('0x80')],_0x2fb9a2);})['then'](function(_0x4d0f4b){_0x1959f7=_0x4d0f4b;return getTicket(_0x1c5f7f,_0x5d53a6,_0x1959f7,_0x13bc5a,_0x41750a,_0x13bc5a[_0x7f5b('0x7b')],_0x2fb9a2);})[_0x7f5b('0x25')](function(_0x212e5c){_0x181e1f=_0x212e5c;logger[_0x7f5b('0x28')]('['+_0x41750a[_0x7f5b('0x7f')][_0x7f5b('0x81')]()+']\x20Ticket\x20%s\x20created.',_0x181e1f['id']);logger['info']('['+_0x41750a['lastevent'][_0x7f5b('0x81')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1c5f7f[_0x7f5b('0x4f')]);})['catch'](function(_0x20e90d){logger[_0x7f5b('0x72')]('['+_0x41750a[_0x7f5b('0x7f')][_0x7f5b('0x81')]()+']',_0x20e90d);});}; \ No newline at end of file +var _0x6e33=['Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Task','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','ticketType','Case','contact','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','Name','info','identity','then','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','additionalSearchContact','Lead','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','toString','variableName','customVariable','Variable','name','securityToken'];(function(_0x954b91,_0x3c102e){var _0x3051de=function(_0x1cb5cd){while(--_0x1cb5cd){_0x954b91['push'](_0x954b91['shift']());}};_0x3051de(++_0x3c102e);}(_0x6e33,0xa7));var _0x36e3=function(_0x1584de,_0x2a1240){_0x1584de=_0x1584de-0x0;var _0x75599c=_0x6e33[_0x1584de];return _0x75599c;};'use strict';var _=require(_0x36e3('0x0'));var rp=require(_0x36e3('0x1'));var moment=require(_0x36e3('0x2'));var BPromise=require(_0x36e3('0x3'));var md5=require(_0x36e3('0x4'));var jsforce=require(_0x36e3('0x5'));var util=require('util');var Redis=require(_0x36e3('0x6'));var intUtil=require(_0x36e3('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config[_0x36e3('0x8')]=_[_0x36e3('0x9')](config[_0x36e3('0x8')],{'host':_0x36e3('0xa'),'port':0x18eb});var io=require(_0x36e3('0xb'))(new Redis(config[_0x36e3('0x8')]));function emit(_0x1593f1,_0x1a4e9e,_0x2abe86){io['to'](_0x1593f1)[_0x36e3('0xc')](_0x1a4e9e,_0x2abe86);}function getTicket(_0x45a9c6,_0x553974,_0x24a64f,_0x3b3546,_0xc59aa2,_0x583ef5,_0x5c52c0,_0x118edf){var _0x3b38b7=Object[_0x36e3('0xd')]({},{'OwnerId':_0x553974['id'],'Subject':intUtil[_0x36e3('0xe')](_0x3b3546['Subjects'],_0xc59aa2,'\x20'),'Description':intUtil[_0x36e3('0xe')](_0x3b3546['Descriptions'],_0xc59aa2,'\x0a')},getCustomFields(_0x583ef5,_0xc59aa2));if(_0x24a64f){if(_0x3b3546['ticketType']===_0x36e3('0xf')){_0x3b38b7['ActivityDate']=moment[_0x36e3('0x10')]();_0x3b38b7[_0x36e3('0x11')]=![];_0x3b38b7['IsRecurrence']=![];if(_0x24a64f[_0x36e3('0x12')]==='contact'||_0x24a64f[_0x36e3('0x12')]===_0x36e3('0x13')){_0x3b38b7[_0x36e3('0x14')]=_0x24a64f['id'];}else if(_0x24a64f['endUserType']===_0x36e3('0x15')){_0x3b38b7[_0x36e3('0x16')]=_0x24a64f['id'];}}else if(_0x3b3546[_0x36e3('0x17')]===_0x36e3('0x18')){if(_0x24a64f[_0x36e3('0x12')]===_0x36e3('0x19')){_0x3b38b7[_0x36e3('0x1a')]=_0x24a64f['id'];}else if(_0x24a64f[_0x36e3('0x12')]===_0x36e3('0x15')){_0x3b38b7[_0x36e3('0x1b')]=_0x24a64f['id'];}else if(_0x24a64f[_0x36e3('0x12')]===_0x36e3('0x13')&&_0x3b3546[_0x36e3('0x1c')]){_0x3b38b7[_0x3b3546[_0x36e3('0x1c')]]=_0x24a64f['id'];}else{logger['info'](_0x36e3('0x1d'));}}}return _0x5c52c0[_0x36e3('0x1e')](_0x3b3546['ticketType'])[_0x36e3('0x1f')](_0x3b38b7);}function getUser(_0x51fd14,_0x3494cc,_0x733f86){if(!_[_0x36e3('0x20')](_0x3494cc)&&intUtil[_0x36e3('0x21')](_0x3494cc)){var _0x13068d={'Email':_0x3494cc};var _0x1a2d91={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x733f86[_0x36e3('0x1e')](_0x36e3('0x22'))[_0x36e3('0x23')](_0x13068d,_0x1a2d91)[_0x36e3('0x24')]()['then'](function(_0x4572e8){if(_0x4572e8[_0x36e3('0x25')]){var _0xd43a02=_[_0x36e3('0x23')](_0x4572e8,function(_0x441ade){return _0x441ade[_0x36e3('0x26')]===_0x3494cc;});if(_0xd43a02){logger['info'](_0x36e3('0x27'),_0x3494cc);return BPromise['resolve']({'id':_0xd43a02['Id'],'name':_0xd43a02[_0x36e3('0x28')]});}}else{logger[_0x36e3('0x29')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3494cc);return _0x733f86[_0x36e3('0x2a')]()[_0x36e3('0x2b')](function(_0x361967){return BPromise['resolve']({'id':_0x361967['user_id'],'name':_0x361967[_0x36e3('0x2c')]});});}});}else{logger[_0x36e3('0x29')](_0x36e3('0x2d'),_0x3494cc);return _0x733f86[_0x36e3('0x2a')]()[_0x36e3('0x2b')](function(_0x405e11){return BPromise[_0x36e3('0x2e')]({'id':_0x405e11['user_id'],'name':_0x405e11[_0x36e3('0x2c')]});});}}function getEndUser(_0x21f101,_0x4cf233,_0x5725a6,_0x283a01,_0x68dc41){var _0xa4e6c0={'$or':{'Phone':_0x283a01}};var _0x138af4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x36e3('0x2e')]()['then'](function(){logger[_0x36e3('0x29')](_0x36e3('0x2f'),_0x283a01,_0x4cf233[_0x36e3('0x30')]);switch(_0x4cf233[_0x36e3('0x30')]){case _0x36e3('0x31'):var _0x489cca=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233['additionalSearchContact']){var _0x15081d={};_0x15081d[_0x4cf233['additionalSearchContact']]=_0x283a01;_[_0x36e3('0x33')](_0x489cca[_0x36e3('0x34')],_0x15081d);}return _0x68dc41[_0x36e3('0x1e')](_0x36e3('0x35'))[_0x36e3('0x23')](_0x489cca,_0x138af4)[_0x36e3('0x24')]()[_0x36e3('0x2b')](function(_0x7dedc6){if(_0x7dedc6&&_0x7dedc6[_0x36e3('0x25')]){return _0x7dedc6;}else{var _0x37393d=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233['additionalSearchLead']){var _0x4da82e={};_0x4da82e[_0x4cf233[_0x36e3('0x36')]]=_0x283a01;_[_0x36e3('0x33')](_0x37393d[_0x36e3('0x34')],_0x4da82e);}return _0x68dc41[_0x36e3('0x1e')]('Lead')[_0x36e3('0x23')](_0x37393d,_0x138af4);}});case _0x36e3('0x37'):var _0xcf1293=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233[_0x36e3('0x38')]){var _0x15081d={};_0x15081d[_0x4cf233[_0x36e3('0x38')]]=_0x283a01;_[_0x36e3('0x33')](_0xcf1293['$or'],_0x15081d);}return _0x68dc41[_0x36e3('0x1e')]('Account')[_0x36e3('0x23')](_0xcf1293,_0x138af4)[_0x36e3('0x24')]()[_0x36e3('0x2b')](function(_0x2c1b63){if(_0x2c1b63&&_0x2c1b63[_0x36e3('0x25')]){return _0x2c1b63;}else{var _0x2c815c=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233[_0x36e3('0x39')]){var _0x2a3166={};_0x2a3166[_0x4cf233[_0x36e3('0x39')]]=_0x283a01;_[_0x36e3('0x33')](_0x2c815c[_0x36e3('0x34')],_0x2a3166);}return _0x68dc41['sobject']('Contact')[_0x36e3('0x23')](_0x2c815c,_0x138af4)[_0x36e3('0x2b')](function(_0x1d72e4){if(_0x1d72e4&&_0x1d72e4['length']){return _0x1d72e4;}else{var _0x2845f2=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233[_0x36e3('0x36')]){var _0x280935={};_0x280935[_0x4cf233['additionalSearchLead']]=_0x283a01;_['merge'](_0x2845f2['$or'],_0x280935);}return _0x68dc41[_0x36e3('0x1e')]('Lead')[_0x36e3('0x23')](_0x2845f2,_0x138af4);}});}});case'contact':var _0x489cca=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233[_0x36e3('0x39')]){var _0x15081d={};_0x15081d[_0x4cf233[_0x36e3('0x39')]]=_0x283a01;_['merge'](_0x489cca['$or'],_0x15081d);}return _0x68dc41[_0x36e3('0x1e')]('Contact')[_0x36e3('0x23')](_0x489cca,_0x138af4)['execute']();case'lead':var _0x279b1e=_[_0x36e3('0x32')](_0xa4e6c0);if(_0x4cf233[_0x36e3('0x36')]){var _0x15081d={};_0x15081d[_0x4cf233['additionalSearchLead']]=_0x283a01;_[_0x36e3('0x33')](_0x279b1e[_0x36e3('0x34')],_0x15081d);}return _0x68dc41[_0x36e3('0x1e')](_0x36e3('0x3a'))[_0x36e3('0x23')](_0x279b1e,_0x138af4);case _0x36e3('0x15'):var _0xcf1293=_['cloneDeep'](_0xa4e6c0);if(_0x4cf233['additionalSearchAccount']){var _0x15081d={};_0x15081d[_0x4cf233[_0x36e3('0x38')]]=_0x283a01;_[_0x36e3('0x33')](_0xcf1293[_0x36e3('0x34')],_0x15081d);}return _0x68dc41['sobject'](_0x36e3('0x3b'))[_0x36e3('0x23')](_0xcf1293,_0x138af4);default:return null;}})[_0x36e3('0x2b')](function(_0x2f41cc){if(_0x2f41cc&&_0x2f41cc[_0x36e3('0x25')]){var _0x3ef5e1=_[_0x36e3('0x3c')](_0x2f41cc);if(_0x3ef5e1){return BPromise[_0x36e3('0x2e')]({'id':_0x3ef5e1['Id'],'name':_0x3ef5e1['Name'],'phone':_0x3ef5e1[_0x36e3('0x3d')],'endUserType':_0x3ef5e1[_0x36e3('0x3e')][_0x36e3('0x3f')][_0x36e3('0x40')]()});}}})[_0x36e3('0x2b')](function(_0x49cfdf){if(_0x49cfdf){logger[_0x36e3('0x29')](_0x36e3('0x41'),_0x49cfdf[_0x36e3('0x12')],_0x283a01);return BPromise[_0x36e3('0x2e')](_0x49cfdf);}else{logger[_0x36e3('0x29')](_0x36e3('0x42'),_0x283a01);var _0x5161c6={'Phone':_0x283a01};if(_0x4cf233[_0x36e3('0x43')]){if(_0x4cf233[_0x36e3('0x43')]===_0x36e3('0x19')){logger[_0x36e3('0x29')](_0x36e3('0x44'),_0x283a01,_0x4cf233[_0x36e3('0x43')]);_0x5161c6[_0x36e3('0x45')]=_0x5725a6!==_0x36e3('0x46')?_0x5725a6:util[_0x36e3('0x47')]('Caller\x20-\x20%s',_0x283a01);}else if(_0x4cf233[_0x36e3('0x43')]===_0x36e3('0x13')){logger[_0x36e3('0x29')](_0x36e3('0x44'),_0x283a01,_0x4cf233[_0x36e3('0x43')]);_0x5161c6[_0x36e3('0x45')]=_0x5725a6!==_0x36e3('0x46')?_0x5725a6:util[_0x36e3('0x47')](_0x36e3('0x48'),_0x283a01);_0x5161c6['Company']='No\x20Company';}else if(_0x4cf233[_0x36e3('0x43')]===_0x36e3('0x15')){logger[_0x36e3('0x29')](_0x36e3('0x44'),_0x283a01,_0x4cf233[_0x36e3('0x43')]);_0x5161c6['Name']=_0x5725a6!==''?_0x5725a6:util[_0x36e3('0x47')](_0x36e3('0x48'),_0x283a01);}else{return null;}}return _0x68dc41[_0x36e3('0x1e')](_[_0x36e3('0x49')](_0x4cf233[_0x36e3('0x43')]))[_0x36e3('0x1f')](_0x5161c6)[_0x36e3('0x2b')](function(_0x102f09){return BPromise[_0x36e3('0x2e')]({'id':_0x102f09['id'],'endUserType':_0x4cf233['moduleCreate']});});}});}function getCustomFields(_0x2b19f7,_0x57d99c){var _0x3b34bc={};if(_0x2b19f7[_0x36e3('0x25')]>0x0){_[_0x36e3('0x4a')](_0x2b19f7,function(_0x3daf98){if(_[_0x36e3('0x4b')]([_0x36e3('0x4c'),_0x36e3('0x4d')],_0x3daf98[_0x36e3('0x3f')])&&_0x3daf98['idField']){_0x3b34bc[_0x3daf98[_0x36e3('0x4e')]]=_0x3daf98['content'][_0x36e3('0x4f')]();}else if(_0x3daf98[_0x36e3('0x3f')]==='variable'&&_0x3daf98[_0x36e3('0x50')]&&_0x3daf98[_0x36e3('0x4e')]){_0x57d99c[_0x3daf98[_0x36e3('0x50')]]&&(_0x3b34bc[_0x3daf98['idField']]=_0x57d99c[_0x3daf98[_0x36e3('0x50')]][_0x36e3('0x4f')]());}else if(_0x3daf98['type']===_0x36e3('0x51')&&_0x3daf98[_0x36e3('0x52')]&&_0x3daf98[_0x36e3('0x52')][_0x36e3('0x53')]&&_0x3daf98[_0x36e3('0x4e')]){_0x57d99c[_0x3daf98['Variable'][_0x36e3('0x53')][_0x36e3('0x40')]()]&&(_0x3b34bc[_0x3daf98[_0x36e3('0x4e')]]=_0x57d99c[_0x3daf98['Variable'][_0x36e3('0x53')][_0x36e3('0x40')]()]['toString']());}});}return _0x3b34bc;}function getConnection(_0x5892c1){var _0x5b0483=_0x5892c1['password']['concat'](_0x5892c1[_0x36e3('0x54')]);var _0x21a04d=new jsforce[(_0x36e3('0x55'))]({'oauth2':{'loginUrl':_0x5892c1[_0x36e3('0x56')]||_0x36e3('0x57'),'clientId':_0x5892c1[_0x36e3('0x58')],'clientSecret':_0x5892c1[_0x36e3('0x59')]}});return _0x21a04d[_0x36e3('0x5a')](_0x5892c1[_0x36e3('0x5b')],_0x5b0483)[_0x36e3('0x2b')](function(){logger['info'](_0x36e3('0x5c'));return _0x21a04d;});}exports[_0x36e3('0x5d')]=function(_0x294c7e,_0x55c1b1,_0x409229,_0xe5ff77,_0x3c38bf,_0x5973c4){var _0x271f6a,_0x224d7f,_0x3e7a05,_0x39d353;_0x5973c4[_0x36e3('0x5e')]=intUtil[_0x36e3('0x5f')](_0x5973c4['serverUrl']);_0x5973c4[_0x36e3('0x56')]=intUtil[_0x36e3('0x5f')](_0x5973c4['remoteUri']);if(_0x3c38bf&&_0x3c38bf[_0x36e3('0x60')]){logger[_0x36e3('0x29')](_0x36e3('0x61'),'Recording\x20is\x20enabled!');_0x55c1b1[_0x36e3('0x62')]=util[_0x36e3('0x47')](_0x36e3('0x63'),_0x5973c4[_0x36e3('0x5e')],_0x55c1b1[_0x36e3('0x64')],md5(_0x55c1b1[_0x36e3('0x64')]));}else{_0x55c1b1['recordingURL']='';}return getConnection(_0x5973c4)['then'](function(_0x2e28e5){_0x39d353=_0x2e28e5;return getUser(_0x5973c4,_0xe5ff77[_0x36e3('0x65')],_0x39d353);})['then'](function(_0x409ecc){_0x271f6a=_0x409ecc;return getEndUser(_0x5973c4,_0x409229,_0x55c1b1[_0x36e3('0x66')],_0x55c1b1[_0x36e3('0x67')],_0x39d353);})[_0x36e3('0x2b')](function(_0x4922b9){_0x224d7f=_0x4922b9;return getTicket(_0x5973c4,_0x271f6a,_0x224d7f,_0x409229,_0x55c1b1,_0x409229['Fields'],_0x39d353,'queue');})[_0x36e3('0x2b')](function(_0x5db0ae){_0x3e7a05=_0x5db0ae;logger['info'](_0x36e3('0x68'),_0x3e7a05['id']);logger[_0x36e3('0x29')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3e7a05['id'],_0xe5ff77['name'],_0x5973c4[_0x36e3('0x3f')]);switch(_0x5973c4['type']){case _0x36e3('0x69'):emit(util['format'](_0x36e3('0x6a'),_0xe5ff77[_0x36e3('0x53')]),'trigger:salesforce:display',{'recordId':_0x3e7a05['id']});break;case _0x36e3('0x6b'):emit(util[_0x36e3('0x47')](_0x36e3('0x6a'),_0xe5ff77[_0x36e3('0x53')]),_0x36e3('0x6c'),{'uri':util['format']('%s/%s/e',_0x39d353[_0x36e3('0x6d')],_0x3e7a05['id'])});break;default:logger[_0x36e3('0x6e')](_0x36e3('0x6f'));}})[_0x36e3('0x70')](function(_0x34c65c){logger[_0x36e3('0x6e')](_0x36e3('0x61'),_0x34c65c);});};exports[_0x36e3('0x71')]=function(_0x2680d7,_0x657660,_0x196135,_0xd51640,_0x3ae7cc,_0x3e6545,_0x113dd2){var _0x2d44d0,_0x29ddc3,_0xf7b3ef,_0x4ab52e;_0x3e6545[_0x36e3('0x5e')]=intUtil[_0x36e3('0x5f')](_0x3e6545[_0x36e3('0x5e')]);_0x3e6545['remoteUri']=intUtil[_0x36e3('0x5f')](_0x3e6545[_0x36e3('0x56')]);if(_0x113dd2&&_0x113dd2[_0x36e3('0x72')]&&_0x113dd2[_0x36e3('0x72')]!==_0x36e3('0x73')){logger['info'](_0x36e3('0x74'),'Recording\x20is\x20enabled!');_0x657660['recordingURL']=util[_0x36e3('0x47')](_0x36e3('0x63'),_0x3e6545[_0x36e3('0x5e')],_0x657660[_0x36e3('0x64')],md5(_0x657660[_0x36e3('0x64')]));}return getConnection(_0x3e6545)['then'](function(_0x3cb973){_0x4ab52e=_0x3cb973;return getUser(_0x3e6545,_0xd51640[_0x36e3('0x65')],_0x4ab52e);})[_0x36e3('0x2b')](function(_0x56af06){_0x2d44d0=_0x56af06;return getEndUser(_0x3e6545,_0x196135,_0x657660[_0x36e3('0x75')],_0x657660['destcalleridnum'],_0x4ab52e);})[_0x36e3('0x2b')](function(_0x3b2fd9){_0x29ddc3=_0x3b2fd9;return getTicket(_0x3e6545,_0x2d44d0,_0x29ddc3,_0x196135,_0x657660,_0x196135['Fields'],_0x4ab52e,_0x36e3('0x71'));})[_0x36e3('0x2b')](function(_0x2a9cd9){_0xf7b3ef=_0x2a9cd9;logger[_0x36e3('0x29')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xf7b3ef['id']);logger[_0x36e3('0x29')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xf7b3ef['id'],_0xd51640[_0x36e3('0x53')],_0x3e6545[_0x36e3('0x3f')]);switch(_0x3e6545[_0x36e3('0x3f')]){case _0x36e3('0x69'):emit(util[_0x36e3('0x47')](_0x36e3('0x6a'),_0xd51640[_0x36e3('0x53')]),'trigger:salesforce:display',{'recordId':_0xf7b3ef['id']});break;case'newTab':emit(util[_0x36e3('0x47')](_0x36e3('0x6a'),_0xd51640[_0x36e3('0x53')]),'trigger:browser:url',{'uri':util[_0x36e3('0x47')]('%s/%s/e',_0x4ab52e[_0x36e3('0x6d')],_0xf7b3ef['id'])});break;default:logger['error'](_0x36e3('0x74'),_0x36e3('0x76'));}})[_0x36e3('0x70')](function(_0x3126d7){logger['error']('[OUTBOUND]',_0x3126d7);});};exports[_0x36e3('0x77')]=function(_0x4778e0,_0x569be0,_0x495e24,_0x52ac58,_0xa9d7c8,_0x567651){var _0x1d4447,_0x6b9738,_0x41607c,_0x3531c5;_0x567651['serverUrl']=intUtil['stripTrailingSlash'](_0x567651[_0x36e3('0x5e')]);_0x567651[_0x36e3('0x56')]=intUtil[_0x36e3('0x5f')](_0x567651[_0x36e3('0x56')]);if(_0xa9d7c8&&_0xa9d7c8[_0x36e3('0x60')]){logger[_0x36e3('0x29')]('['+_0x569be0[_0x36e3('0x78')][_0x36e3('0x79')]()+']',_0x36e3('0x7a'));_0x569be0[_0x36e3('0x62')]=util[_0x36e3('0x47')](_0x36e3('0x63'),_0x567651['serverUrl'],_0x569be0[_0x36e3('0x64')],md5(_0x569be0[_0x36e3('0x64')]));}else{_0x569be0[_0x36e3('0x62')]='';}return getConnection(_0x567651)[_0x36e3('0x2b')](function(_0xf90ae0){_0x3531c5=_0xf90ae0;if(!_[_0x36e3('0x20')](_0x52ac58)){return getUser(_0x567651,_0x52ac58['name'],_0x3531c5);}else{return getUser(_0x567651,null,_0x3531c5);}})['then'](function(_0x2565a4){_0x1d4447=_0x2565a4;return getEndUser(_0x567651,_0x495e24,_0x569be0[_0x36e3('0x66')],_0x569be0['calleridnum'],_0x3531c5);})[_0x36e3('0x2b')](function(_0x146609){_0x6b9738=_0x146609;return getTicket(_0x567651,_0x1d4447,_0x6b9738,_0x495e24,_0x569be0,_0x495e24[_0x36e3('0x7b')],_0x3531c5);})[_0x36e3('0x2b')](function(_0x5bf022){_0x41607c=_0x5bf022;logger[_0x36e3('0x29')]('['+_0x569be0['lastevent']['toUpperCase']()+_0x36e3('0x7c'),_0x41607c['id']);logger[_0x36e3('0x29')]('['+_0x569be0[_0x36e3('0x78')][_0x36e3('0x79')]()+_0x36e3('0x7d'),_0x567651[_0x36e3('0x3f')]);})[_0x36e3('0x70')](function(_0x2543b9){logger[_0x36e3('0x6e')]('['+_0x569be0[_0x36e3('0x78')][_0x36e3('0x79')]()+']',_0x2543b9);});}; \ 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 385b438..7a9ee3e 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 _0x8d8d=['string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','variable','variableName','idField','Variable','name','outbound','POST','incident','assign','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','adminEmail','error',']\x20using\x20admin\x20profile','userId','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach'];(function(_0x31ca8e,_0x1d2bcf){var _0x13a648=function(_0x4d9198){while(--_0x4d9198){_0x31ca8e['push'](_0x31ca8e['shift']());}};_0x13a648(++_0x1d2bcf);}(_0x8d8d,0x18c));var _0xd8d8=function(_0x48d517,_0x4046dc){_0x48d517=_0x48d517-0x0;var _0x1a79ea=_0x8d8d[_0x48d517];return _0x1a79ea;};'use strict';var _=require(_0xd8d8('0x0'));var Promise=require('bluebird');var rp=require(_0xd8d8('0x1'));var util=require('util');var md5=require(_0xd8d8('0x2'));var Redis=require(_0xd8d8('0x3'));var intUtil=require(_0xd8d8('0x4'));var config=require(_0xd8d8('0x5'));var logger=require(_0xd8d8('0x6'))(_0xd8d8('0x7'));config[_0xd8d8('0x8')]=_['defaults'](config['redis'],{'host':_0xd8d8('0x9'),'port':0x18eb});var io=require(_0xd8d8('0xa'))(new Redis(config[_0xd8d8('0x8')]));function getAdminUser(_0x1aa3d1,_0xc6f166,_0x573972,_0x2066af,_0x56f9c0,_0x3009c1){return new Promise(function(_0x1fd9dd,_0x1419a3){var _0x33f28f={'method':_0xd8d8('0xb'),'uri':_0x2066af+_0xd8d8('0xc')+'&'+_0x56f9c0+'&'+_0x3009c1,'auth':_0xc6f166,'json':!![]};return rp(_0x33f28f)[_0xd8d8('0xd')](function(_0x8247b4){if(_0x8247b4[_0xd8d8('0xe')][_0xd8d8('0xf')]>0x0){_0x573972[_0xd8d8('0x10')]=_0x8247b4[_0xd8d8('0xe')][0x0][_0xd8d8('0x11')];}logger[_0xd8d8('0x12')]('['+[_0x1aa3d1[_0xd8d8('0x13')]()]+_0xd8d8('0x14'),_0x573972);_0x1fd9dd(_0x573972);})[_0xd8d8('0x15')](function(_0x258479){logger['error']('['+[_0x1aa3d1[_0xd8d8('0x13')]()]+']',_0x258479[_0xd8d8('0x16')]);_0x1419a3(_0x258479['message']);});});}function getUser(_0x21419b,_0x2bbc2b,_0x29fd53,_0x1f7304,_0x51367f){return function(_0x2f4470){logger[_0xd8d8('0x12')]('['+[_0x21419b['toUpperCase']()]+_0xd8d8('0x17'),_0x2f4470);return new Promise(function(_0x56d955,_0x38017a){if(intUtil[_0xd8d8('0x18')](_0x2f4470[_0xd8d8('0x19')])){var _0x3bcefc={'method':_0xd8d8('0xb'),'uri':_0x29fd53+_0xd8d8('0x1a')+_0x2f4470[_0xd8d8('0x19')]+'&'+_0x1f7304+'&'+_0x51367f,'auth':_0x2bbc2b,'json':!![]};logger[_0xd8d8('0x12')]('['+[_0x21419b[_0xd8d8('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x3bcefc);return rp(_0x3bcefc)[_0xd8d8('0xd')](function(_0x40ebe4){logger[_0xd8d8('0x12')]('['+[_0x21419b[_0xd8d8('0x13')]()]+_0xd8d8('0x1b'),_0x40ebe4);if(_0x40ebe4[_0xd8d8('0xe')][_0xd8d8('0xf')]>0x0&&String(_0x40ebe4[_0xd8d8('0xe')][0x0][_0xd8d8('0x1c')])===_0xd8d8('0x1d')){_0x2f4470['userId']=_0x40ebe4[_0xd8d8('0xe')][0x0][_0xd8d8('0x11')];}else{_0x2f4470['userId']=_0x2f4470[_0xd8d8('0x10')];_0x2f4470[_0xd8d8('0x19')]=_0x2f4470[_0xd8d8('0x1e')];}logger['info']('['+[_0x21419b[_0xd8d8('0x13')]()]+'],\x20getUser\x20crm',_0x2f4470);_0x56d955(_0x2f4470);})[_0xd8d8('0x15')](function(_0x2c1383){logger[_0xd8d8('0x1f')]('['+[_0x21419b[_0xd8d8('0x13')]()]+']',_0x2c1383['message']);_0x38017a(_0x2c1383['message']);});}else{logger[_0xd8d8('0x12')]('['+[_0x21419b[_0xd8d8('0x13')]()]+_0xd8d8('0x20'));_0x2f4470[_0xd8d8('0x21')]=_0x2f4470[_0xd8d8('0x10')];_0x2f4470[_0xd8d8('0x19')]=_0x2f4470[_0xd8d8('0x1e')];_0x56d955(_0x2f4470);}});};}function createEndUser(_0x4ac32a,_0x465fed,_0x26619c,_0x460ac5,_0x3fd230){logger['info']('['+[_0x4ac32a[_0xd8d8('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x26619c);return new Promise(function(_0x485bcf,_0x4ea0cc){var _0x4de216={'method':'POST','uri':_0x460ac5+'sys_user?'+_0x3fd230,'body':{'user_name':_0x26619c[_0xd8d8('0x22')],'roles':_0xd8d8('0x23'),'first_name':_0x26619c[_0xd8d8('0x22')],'active':_0xd8d8('0x1d'),'date_format':_0xd8d8('0x24'),'phone':_0x26619c[_0xd8d8('0x22')]},'auth':_0x465fed,'json':!![]};return rp(_0x4de216)[_0xd8d8('0xd')](function(_0x464cd2){logger[_0xd8d8('0x12')]('['+[_0x4ac32a['toUpperCase']()]+_0xd8d8('0x25'),_0x464cd2[_0xd8d8('0xe')]);_0x26619c[_0xd8d8('0x26')]=_0x464cd2[_0xd8d8('0xe')]['sys_id'];_0x485bcf(_0x26619c);})['catch'](function(_0x4b59c3){logger[_0xd8d8('0x1f')]('['+[_0x4ac32a[_0xd8d8('0x13')]()]+']',_0x4b59c3[_0xd8d8('0x16')]);_0x4ea0cc(_0x4b59c3['message']);});});}function getEndUser(_0x345a64,_0x106722,_0x25f71e,_0x1e2e91,_0x55b3ea){return function(_0x3565ba){logger[_0xd8d8('0x12')]('['+[_0x345a64['toUpperCase']()]+_0xd8d8('0x27'),_0x3565ba);return new Promise(function(_0xca502e,_0x423f5e){var _0x1c8996={'method':_0xd8d8('0xb'),'uri':_0x25f71e+_0xd8d8('0x28')+_0x3565ba[_0xd8d8('0x22')]+'&'+_0x1e2e91+'&'+_0x55b3ea,'auth':_0x106722,'json':!![]};return rp(_0x1c8996)['then'](function(_0x1d09c7){if(_0x1d09c7[_0xd8d8('0xe')][_0xd8d8('0xf')]>0x0){_0x3565ba[_0xd8d8('0x26')]=_0x1d09c7[_0xd8d8('0xe')][0x0]['sys_id'];logger[_0xd8d8('0x12')]('['+[_0x345a64[_0xd8d8('0x13')]()]+_0xd8d8('0x29'),_0x3565ba);_0xca502e(_0x3565ba);}else{return createEndUser(_0x345a64,_0x106722,_0x3565ba,_0x25f71e,_0x1e2e91)['then'](function(_0x179a31){logger[_0xd8d8('0x12')]('['+[_0x345a64[_0xd8d8('0x13')]()]+_0xd8d8('0x2a'),_0x179a31);_0xca502e(_0x179a31);});}})[_0xd8d8('0x15')](function(_0x1ec596){logger[_0xd8d8('0x1f')]('['+[_0x345a64[_0xd8d8('0x13')]()]+']',_0x1ec596[_0xd8d8('0x16')]);_0x423f5e(_0x1ec596[_0xd8d8('0x16')]);});});};}function getCustomFields(_0x5cb672,_0x27ae89){var _0x3e393a={};if(_0x5cb672[_0xd8d8('0xf')]>0x0){_[_0xd8d8('0x2b')](_0x5cb672,function(_0x13a1e6){if(_['includes']([_0xd8d8('0x2c'),_0xd8d8('0x2d')],_0x13a1e6[_0xd8d8('0x2e')])&&_0x13a1e6[_0xd8d8('0x2f')]&&!_0x13a1e6[_0xd8d8('0x30')]){_0x3e393a[_0x13a1e6[_0xd8d8('0x2f')][_0xd8d8('0x31')]()]=_0x13a1e6[_0xd8d8('0x32')][_0xd8d8('0x33')]();}else if(_[_0xd8d8('0x34')](['string',_0xd8d8('0x2d')],_0x13a1e6[_0xd8d8('0x2e')])&&_0x13a1e6['idField']&&_0x13a1e6[_0xd8d8('0x30')]){_0x3e393a[_0x13a1e6['idField'][_0xd8d8('0x31')]()]=_0x13a1e6[_0xd8d8('0x32')]['toString']();}else if(_0x13a1e6[_0xd8d8('0x2e')]===_0xd8d8('0x35')&&_0x13a1e6[_0xd8d8('0x36')]&&_0x13a1e6['idField']&&_0x13a1e6[_0xd8d8('0x30')]){_0x3e393a[_0x13a1e6[_0xd8d8('0x37')][_0xd8d8('0x31')]()]=_0x27ae89[_0x13a1e6[_0xd8d8('0x36')]][_0xd8d8('0x33')]();}else if(_0x13a1e6[_0xd8d8('0x2e')]==='customVariable'&&_0x13a1e6[_0xd8d8('0x38')]&&_0x13a1e6['Variable']['name']&&_0x13a1e6[_0xd8d8('0x37')]&&_0x13a1e6[_0xd8d8('0x30')]){_0x3e393a[_0x13a1e6[_0xd8d8('0x37')][_0xd8d8('0x31')]()]=_0x27ae89[_0x13a1e6[_0xd8d8('0x38')][_0xd8d8('0x39')][_0xd8d8('0x31')]()][_0xd8d8('0x33')]();}});}return _0x3e393a;}function getTicket(_0x182afd,_0x4be79d,_0x5c17f0,_0x370422,_0x550ea2,_0x22c3a1){return function(_0x56b7cc){logger[_0xd8d8('0x12')]('['+[_0x182afd[_0xd8d8('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x56b7cc);return new Promise(function(_0x2d99f1,_0x210cdb){var _0x4f112d=_0x182afd[_0xd8d8('0x31')]()===_0xd8d8('0x3a')?_0x56b7cc[_0xd8d8('0x21')]:_0x56b7cc[_0xd8d8('0x26')];var _0xd2f978={'method':_0xd8d8('0x3b'),'uri':_0x5c17f0+_0xd8d8('0x3c')+'?'+_0x22c3a1,'body':Object[_0xd8d8('0x3d')]({},{'active':_0xd8d8('0x1d'),'caller_id':_0x4f112d,'assigned_to':_0x56b7cc[_0xd8d8('0x21')],'short_description':intUtil['getString'](_0x370422['Subjects'],_0x550ea2,'\x20'),'description':intUtil['getString'](_0x370422[_0xd8d8('0x3e')],_0x550ea2,'\x0a')},getCustomFields(_0x370422[_0xd8d8('0x3f')],_0x550ea2)),'auth':_0x4be79d,'json':!![]};return rp(_0xd2f978)[_0xd8d8('0xd')](function(_0xb251c0){logger[_0xd8d8('0x12')]('['+[_0x182afd[_0xd8d8('0x13')]()]+_0xd8d8('0x40'),_0xb251c0['result']);_0x56b7cc[_0xd8d8('0x41')]=_0xb251c0['result'][_0xd8d8('0x11')];_0x56b7cc[_0xd8d8('0x42')]=_0xb251c0[_0xd8d8('0xe')][_0xd8d8('0x43')];logger['info']('['+[_0x182afd[_0xd8d8('0x13')]()]+_0xd8d8('0x44'),_0x56b7cc);_0x2d99f1(_0x56b7cc);})[_0xd8d8('0x15')](function(_0x323ca2){logger[_0xd8d8('0x1f')]('['+[_0x182afd[_0xd8d8('0x13')]()]+']',_0x323ca2['message']);_0x210cdb(_0x323ca2['message']);});});};}function createRemoteTag(_0x329db1,_0x55bdd8,_0x2e7146,_0x5712d6){return new Promise(function(_0x1a48b3,_0x3c641e){var _0xeec1e={'method':_0xd8d8('0x3b'),'uri':_0x2e7146+_0xd8d8('0x45')+'?'+_0x5712d6,'body':{'short_description':_0x329db1,'global':!![],'active':!![],'name':_0x329db1},'auth':_0x55bdd8,'json':!![]};return rp(_0xeec1e)['then'](function(_0x5f2d3f){var _0x13cb0c=_0x5f2d3f[_0xd8d8('0xe')]['sys_id'];_0x1a48b3(_0x13cb0c);});});}function getRemoteTag(_0x30cdc0,_0x341c93,_0x49a4ef,_0x182e69,_0x566979){return new Promise(function(_0xca7720,_0x3211ce){var _0x24e2ad={'method':_0xd8d8('0xb'),'uri':_0x49a4ef+_0xd8d8('0x45')+_0xd8d8('0x46')+_0x30cdc0+'&'+_0x182e69,'auth':_0x341c93,'json':!![]};return rp(_0x24e2ad)[_0xd8d8('0xd')](function(_0x357471){if(_0x357471[_0xd8d8('0xe')][_0xd8d8('0xf')]>0x0){var _0x479914=_0x357471['result'][0x0][_0xd8d8('0x11')];_0xca7720(_0x479914);}else{return createRemoteTag(_0x30cdc0,_0x341c93,_0x49a4ef,_0x182e69)[_0xd8d8('0xd')](function(_0x2274cb){_0xca7720(_0x2274cb);});}});});}function assignTagToIncident(_0x30043b,_0x471577,_0x5d2307,_0x42d58a,_0x4dc6dc){return new Promise(function(_0x5ad34b,_0x6b1941){var _0x3968e3={'method':_0xd8d8('0x3b'),'uri':_0x5d2307+_0xd8d8('0x47')+'?'+_0x4dc6dc,'body':{'label':_0x30043b,'table':'incident','id_type':'Incident','table_key':_0x42d58a[_0xd8d8('0x41')],'title':'Incident\x20-\x20'+_0x42d58a[_0xd8d8('0x42')],'id_display':_0x42d58a['ticketNumber']},'auth':_0x471577,'json':!![]};return rp(_0x3968e3)[_0xd8d8('0xd')](function(_0x1a98bd){_0x5ad34b();})[_0xd8d8('0x15')](function(){_0x5ad34b();});});}function manageTags(_0x1430d1,_0x388a40,_0x3f1b26,_0x1f7450,_0x26bdc6,_0x353542,_0xbbdfa0){return new Promise(function(_0x56bb07,_0x3a03ed){var _0x2d435a=[];_0x388a40['forEach'](function(_0x17c369){_0x2d435a[_0xd8d8('0x48')](getRemoteTag(_0x17c369,_0x3f1b26,_0x1f7450,_0x353542,_0xbbdfa0));});return Promise[_0xd8d8('0x49')](_0x2d435a)[_0xd8d8('0xd')](function(_0x3f2fee){if(_0x3f2fee[_0xd8d8('0xf')]){logger['info']('['+[_0x1430d1[_0xd8d8('0x13')]()]+_0xd8d8('0x4a'),_0x3f2fee);var _0x209767=[];_0x3f2fee[_0xd8d8('0x2b')](function(_0x1136a0){_0x209767[_0xd8d8('0x48')](assignTagToIncident(_0x1136a0,_0x3f1b26,_0x1f7450,_0x26bdc6,_0x353542));});return Promise['all'](_0x209767)[_0xd8d8('0xd')](function(){_0x56bb07();})[_0xd8d8('0x15')](function(){_0x56bb07();});}else{_0x56bb07();}});});}function getTags(_0x4a24a9,_0x31114a,_0x1f4a3b,_0x195957,_0x5eab5e,_0x3af739){return function(_0x285d73){return new Promise(function(_0x438b6d,_0x449017){var _0x18e61f=[];var _0x162a0e=_0x195957[_0xd8d8('0x4b')];if(_0x162a0e&&_0x162a0e[_0xd8d8('0xf')]>0x0){_0x18e61f=_['map'](_0x162a0e,_0xd8d8('0x39'));}if(_0x18e61f['length']>0x0){return manageTags(_0x4a24a9,_0x18e61f,_0x31114a,_0x1f4a3b,_0x285d73,_0x5eab5e,_0x3af739)['then'](function(){_0x438b6d(_0x285d73);});}else{_0x438b6d(_0x285d73);}});};}function emit(_0x49b62f,_0x34d7d9,_0x2c30da){var _0x5dde32=_0xd8d8('0x4c')+_0xd8d8('0x4d')+_0xd8d8('0x4e')+_0xd8d8('0x4f');var _0x3538bd={'uri':_0x49b62f+_0xd8d8('0x50')+_0x2c30da+_0x5dde32};io['to'](util['format']('user:%s',_0x34d7d9))[_0xd8d8('0x51')](_0xd8d8('0x52'),_0x3538bd);}exports['cs']=function(_0x222ba1,_0x2eea0e,_0x221906,_0x297975,_0x22a881,_0x44bba2,_0x19f1ca,_0x22d912){var _0x56d590={};var _0x5a6d6e={'user':_0x44bba2[_0xd8d8('0x53')],'pass':_0x44bba2[_0xd8d8('0x54')]};var _0x2b4f5d=_0xd8d8('0x55');var _0x2d844e='sysparm_display_value=true';_0x44bba2[_0xd8d8('0x56')]=intUtil['stripTrailingSlash'](_0x44bba2[_0xd8d8('0x56')]);_0x44bba2[_0xd8d8('0x57')]=intUtil[_0xd8d8('0x58')](_0x44bba2[_0xd8d8('0x57')]);var _0x560f91=util[_0xd8d8('0x59')](_0xd8d8('0x5a'),_0x44bba2[_0xd8d8('0x56')]);_0x56d590[_0xd8d8('0x19')]=!_[_0xd8d8('0x5b')](_0x297975)?_0x297975[_0xd8d8('0x5c')]:null;_0x56d590['adminEmail']=_0x44bba2[_0xd8d8('0x5c')];_0x56d590[_0xd8d8('0x22')]=_0x22d912[_0xd8d8('0x31')]()==='outbound'?_0x2eea0e[_0xd8d8('0x5d')]:_0x2eea0e[_0xd8d8('0x5e')];_0x56d590['callDirection']=_0x22d912==='queue'||_0x22d912===_0xd8d8('0x5f')?'queue':_0xd8d8('0x3a');var _0x58be29=util[_0xd8d8('0x59')](_0xd8d8('0x60'),_0x44bba2[_0xd8d8('0x57')],_0x2eea0e['uniqueid'],md5(_0x2eea0e[_0xd8d8('0x61')]));if(_0x22a881&&_0x22a881[_0xd8d8('0x62')]){logger[_0xd8d8('0x12')](_0xd8d8('0x63'),_0xd8d8('0x64'));_0x2eea0e[_0xd8d8('0x65')]=_0x58be29;}else if(_0x19f1ca&&_0x19f1ca[_0xd8d8('0x66')]&&_0x19f1ca[_0xd8d8('0x66')]!==_0xd8d8('0x67')){logger['info'](_0xd8d8('0x68'),_0xd8d8('0x64'));_0x2eea0e[_0xd8d8('0x65')]=_0x58be29;}else{_0x2eea0e[_0xd8d8('0x65')]='';}return getAdminUser(_0x22d912,_0x5a6d6e,_0x56d590,_0x560f91,_0x2d844e,_0x2b4f5d)[_0xd8d8('0xd')](getUser(_0x22d912,_0x5a6d6e,_0x560f91,_0x2d844e,_0x2b4f5d))[_0xd8d8('0xd')](getEndUser(_0x22d912,_0x5a6d6e,_0x560f91,_0x2d844e,_0x2b4f5d))[_0xd8d8('0xd')](getTicket(_0x22d912,_0x5a6d6e,_0x560f91,_0x221906,_0x2eea0e,_0x2d844e))[_0xd8d8('0xd')](function(_0xef9cc4){logger[_0xd8d8('0x12')](util[_0xd8d8('0x59')](_0xd8d8('0x69'),_0xef9cc4[_0xd8d8('0x41')]));logger[_0xd8d8('0x12')](util[_0xd8d8('0x59')](_0xd8d8('0x6a'),_0x22d912));if(_0x22d912!==_0xd8d8('0x5f')){logger[_0xd8d8('0x12')]('['+[_0x22d912['toUpperCase']()]+']',_0xd8d8('0x6b'));emit(_0x44bba2[_0xd8d8('0x56')],_0x297975[_0xd8d8('0x39')],_0xef9cc4[_0xd8d8('0x41')]);}})['catch'](function(_0x32d21f){logger[_0xd8d8('0x1f')]('['+[_0x22d912[_0xd8d8('0x13')]()]+_0xd8d8('0x6c'),util[_0xd8d8('0x6d')](_0x32d21f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3b39=['redis','defaults','localhost','socket.io-emitter','GET','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','validateEmail','userEmail','],\x20getUser\x20entity','length','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','catch','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow'];(function(_0x44dd65,_0x5d9533){var _0x2f391b=function(_0x44585c){while(--_0x44585c){_0x44dd65['push'](_0x44dd65['shift']());}};_0x2f391b(++_0x5d9533);}(_0x3b39,0x132));var _0x93b3=function(_0x26e89e,_0xacad9){_0x26e89e=_0x26e89e-0x0;var _0x5bf1d3=_0x3b39[_0x26e89e];return _0x5bf1d3;};'use strict';var _=require(_0x93b3('0x0'));var Promise=require('bluebird');var rp=require(_0x93b3('0x1'));var util=require(_0x93b3('0x2'));var md5=require(_0x93b3('0x3'));var Redis=require(_0x93b3('0x4'));var intUtil=require(_0x93b3('0x5'));var config=require(_0x93b3('0x6'));var logger=require(_0x93b3('0x7'))(_0x93b3('0x8'));config[_0x93b3('0x9')]=_[_0x93b3('0xa')](config['redis'],{'host':_0x93b3('0xb'),'port':0x18eb});var io=require(_0x93b3('0xc'))(new Redis(config[_0x93b3('0x9')]));function getAdminUser(_0x581e6e,_0x2c1aae,_0x4b7957,_0x1f7a37,_0x262f67,_0xae3fc4){return new Promise(function(_0x4d211f,_0x2e3430){var _0x173f21={'method':_0x93b3('0xd'),'uri':_0x1f7a37+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x262f67+'&'+_0xae3fc4,'auth':_0x2c1aae,'json':!![]};return rp(_0x173f21)[_0x93b3('0xe')](function(_0x3de90b){if(_0x3de90b[_0x93b3('0xf')]['length']>0x0){_0x4b7957['adminId']=_0x3de90b[_0x93b3('0xf')][0x0][_0x93b3('0x10')];}logger[_0x93b3('0x11')]('['+[_0x581e6e[_0x93b3('0x12')]()]+_0x93b3('0x13'),_0x4b7957);_0x4d211f(_0x4b7957);})['catch'](function(_0x54f42f){logger[_0x93b3('0x14')]('['+[_0x581e6e[_0x93b3('0x12')]()]+']',_0x54f42f[_0x93b3('0x15')]);_0x2e3430(_0x54f42f['message']);});});}function getUser(_0x4dfb6c,_0x7454fa,_0xb7cf48,_0x58cb4f,_0x39f842){return function(_0x40fbc2){logger[_0x93b3('0x11')]('['+[_0x4dfb6c[_0x93b3('0x12')]()]+'],\x20getUser\x20input\x20crm',_0x40fbc2);return new Promise(function(_0x598801,_0x1eac4d){if(intUtil[_0x93b3('0x16')](_0x40fbc2[_0x93b3('0x17')])){var _0x433101={'method':_0x93b3('0xd'),'uri':_0xb7cf48+'sys_user?sysparm_query=email%3D'+_0x40fbc2[_0x93b3('0x17')]+'&'+_0x58cb4f+'&'+_0x39f842,'auth':_0x7454fa,'json':!![]};logger[_0x93b3('0x11')]('['+[_0x4dfb6c[_0x93b3('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x433101);return rp(_0x433101)[_0x93b3('0xe')](function(_0x186395){logger['info']('['+[_0x4dfb6c[_0x93b3('0x12')]()]+_0x93b3('0x18'),_0x186395);if(_0x186395[_0x93b3('0xf')][_0x93b3('0x19')]>0x0&&String(_0x186395[_0x93b3('0xf')][0x0]['active'])===_0x93b3('0x1a')){_0x40fbc2[_0x93b3('0x1b')]=_0x186395[_0x93b3('0xf')][0x0][_0x93b3('0x10')];}else{_0x40fbc2[_0x93b3('0x1b')]=_0x40fbc2[_0x93b3('0x1c')];_0x40fbc2[_0x93b3('0x17')]=_0x40fbc2[_0x93b3('0x1d')];}logger[_0x93b3('0x11')]('['+[_0x4dfb6c[_0x93b3('0x12')]()]+_0x93b3('0x1e'),_0x40fbc2);_0x598801(_0x40fbc2);})['catch'](function(_0x174115){logger[_0x93b3('0x14')]('['+[_0x4dfb6c[_0x93b3('0x12')]()]+']',_0x174115[_0x93b3('0x15')]);_0x1eac4d(_0x174115[_0x93b3('0x15')]);});}else{logger[_0x93b3('0x11')]('['+[_0x4dfb6c[_0x93b3('0x12')]()]+_0x93b3('0x1f'));_0x40fbc2[_0x93b3('0x1b')]=_0x40fbc2[_0x93b3('0x1c')];_0x40fbc2[_0x93b3('0x17')]=_0x40fbc2[_0x93b3('0x1d')];_0x598801(_0x40fbc2);}});};}function createEndUser(_0x38b025,_0x4c81fa,_0x4627d0,_0x1310e2,_0x3240c4){logger[_0x93b3('0x11')]('['+[_0x38b025[_0x93b3('0x12')]()]+_0x93b3('0x20'),_0x4627d0);return new Promise(function(_0x50c8aa,_0x393cb4){var _0x2f6ae5={'method':'POST','uri':_0x1310e2+_0x93b3('0x21')+_0x3240c4,'body':{'user_name':_0x4627d0[_0x93b3('0x22')],'roles':_0x93b3('0x23'),'first_name':_0x4627d0[_0x93b3('0x22')],'active':_0x93b3('0x1a'),'date_format':_0x93b3('0x24'),'phone':_0x4627d0[_0x93b3('0x22')]},'auth':_0x4c81fa,'json':!![]};return rp(_0x2f6ae5)['then'](function(_0x5348f7){logger[_0x93b3('0x11')]('['+[_0x38b025[_0x93b3('0x12')]()]+_0x93b3('0x25'),_0x5348f7['result']);_0x4627d0[_0x93b3('0x26')]=_0x5348f7['result'][_0x93b3('0x10')];_0x50c8aa(_0x4627d0);})[_0x93b3('0x27')](function(_0x130a90){logger[_0x93b3('0x14')]('['+[_0x38b025[_0x93b3('0x12')]()]+']',_0x130a90[_0x93b3('0x15')]);_0x393cb4(_0x130a90[_0x93b3('0x15')]);});});}function getEndUser(_0x4d35a8,_0x2d948b,_0x12d2bb,_0x285531,_0x392827){return function(_0x23a10f){logger[_0x93b3('0x11')]('['+[_0x4d35a8['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x23a10f);return new Promise(function(_0x290e0d,_0xaf0cb2){var _0x485cf6={'method':_0x93b3('0xd'),'uri':_0x12d2bb+_0x93b3('0x28')+_0x23a10f[_0x93b3('0x22')]+'&'+_0x285531+'&'+_0x392827,'auth':_0x2d948b,'json':!![]};return rp(_0x485cf6)[_0x93b3('0xe')](function(_0xd14935){if(_0xd14935[_0x93b3('0xf')][_0x93b3('0x19')]>0x0){_0x23a10f['endUserId']=_0xd14935[_0x93b3('0xf')][0x0][_0x93b3('0x10')];logger[_0x93b3('0x11')]('['+[_0x4d35a8[_0x93b3('0x12')]()]+_0x93b3('0x29'),_0x23a10f);_0x290e0d(_0x23a10f);}else{return createEndUser(_0x4d35a8,_0x2d948b,_0x23a10f,_0x12d2bb,_0x285531)[_0x93b3('0xe')](function(_0x39c86d){logger['info']('['+[_0x4d35a8[_0x93b3('0x12')]()]+_0x93b3('0x2a'),_0x39c86d);_0x290e0d(_0x39c86d);});}})['catch'](function(_0x3db914){logger[_0x93b3('0x14')]('['+[_0x4d35a8[_0x93b3('0x12')]()]+']',_0x3db914[_0x93b3('0x15')]);_0xaf0cb2(_0x3db914[_0x93b3('0x15')]);});});};}function getCustomFields(_0xc5b37b,_0x361650){var _0x41f19e={};if(_0xc5b37b[_0x93b3('0x19')]>0x0){_[_0x93b3('0x2b')](_0xc5b37b,function(_0x15982f){if(_[_0x93b3('0x2c')]([_0x93b3('0x2d'),_0x93b3('0x2e')],_0x15982f[_0x93b3('0x2f')])&&_0x15982f[_0x93b3('0x30')]&&!_0x15982f[_0x93b3('0x31')]){_0x41f19e[_0x15982f[_0x93b3('0x30')][_0x93b3('0x32')]()]=_0x15982f[_0x93b3('0x33')][_0x93b3('0x34')]();}else if(_[_0x93b3('0x2c')]([_0x93b3('0x2d'),_0x93b3('0x2e')],_0x15982f['type'])&&_0x15982f['idField']&&_0x15982f[_0x93b3('0x31')]){_0x41f19e[_0x15982f[_0x93b3('0x35')][_0x93b3('0x32')]()]=_0x15982f[_0x93b3('0x33')][_0x93b3('0x34')]();}else if(_0x15982f[_0x93b3('0x2f')]==='variable'&&_0x15982f[_0x93b3('0x36')]&&_0x15982f['idField']&&_0x15982f[_0x93b3('0x31')]){_0x41f19e[_0x15982f['idField'][_0x93b3('0x32')]()]=_0x361650[_0x15982f[_0x93b3('0x36')]][_0x93b3('0x34')]();}else if(_0x15982f[_0x93b3('0x2f')]==='customVariable'&&_0x15982f[_0x93b3('0x37')]&&_0x15982f[_0x93b3('0x37')][_0x93b3('0x38')]&&_0x15982f[_0x93b3('0x35')]&&_0x15982f[_0x93b3('0x31')]){_0x41f19e[_0x15982f[_0x93b3('0x35')]['toLowerCase']()]=_0x361650[_0x15982f[_0x93b3('0x37')][_0x93b3('0x38')][_0x93b3('0x32')]()][_0x93b3('0x34')]();}});}return _0x41f19e;}function getTicket(_0x396298,_0x3bdfa7,_0x51b757,_0x1a4b8e,_0xf998ec,_0x15e018){return function(_0x248a8a){logger[_0x93b3('0x11')]('['+[_0x396298['toUpperCase']()]+_0x93b3('0x39'),_0x248a8a);return new Promise(function(_0x2efd2c,_0x48acba){var _0x24b623=_0x396298['toLowerCase']()===_0x93b3('0x3a')?_0x248a8a[_0x93b3('0x1b')]:_0x248a8a[_0x93b3('0x26')];var _0x55cda9={'method':_0x93b3('0x3b'),'uri':_0x51b757+_0x93b3('0x3c')+'?'+_0x15e018,'body':Object['assign']({},{'active':_0x93b3('0x1a'),'caller_id':_0x24b623,'assigned_to':_0x248a8a[_0x93b3('0x1b')],'short_description':intUtil[_0x93b3('0x3d')](_0x1a4b8e['Subjects'],_0xf998ec,'\x20'),'description':intUtil[_0x93b3('0x3d')](_0x1a4b8e[_0x93b3('0x3e')],_0xf998ec,'\x0a')},getCustomFields(_0x1a4b8e[_0x93b3('0x3f')],_0xf998ec)),'auth':_0x3bdfa7,'json':!![]};return rp(_0x55cda9)[_0x93b3('0xe')](function(_0x2289f0){logger[_0x93b3('0x11')]('['+[_0x396298[_0x93b3('0x12')]()]+_0x93b3('0x40'),_0x2289f0[_0x93b3('0xf')]);_0x248a8a['ticketId']=_0x2289f0[_0x93b3('0xf')][_0x93b3('0x10')];_0x248a8a[_0x93b3('0x41')]=_0x2289f0['result']['number'];logger['info']('['+[_0x396298['toUpperCase']()]+_0x93b3('0x42'),_0x248a8a);_0x2efd2c(_0x248a8a);})[_0x93b3('0x27')](function(_0x2ceb54){logger[_0x93b3('0x14')]('['+[_0x396298[_0x93b3('0x12')]()]+']',_0x2ceb54[_0x93b3('0x15')]);_0x48acba(_0x2ceb54[_0x93b3('0x15')]);});});};}function createRemoteTag(_0x23cfeb,_0x504898,_0x8a0e2d,_0x5e3b4d){return new Promise(function(_0x482ea5,_0xc40e8){var _0x3223e9={'method':_0x93b3('0x3b'),'uri':_0x8a0e2d+_0x93b3('0x43')+'?'+_0x5e3b4d,'body':{'short_description':_0x23cfeb,'global':!![],'active':!![],'name':_0x23cfeb},'auth':_0x504898,'json':!![]};return rp(_0x3223e9)[_0x93b3('0xe')](function(_0x2b17be){var _0x9d0ec5=_0x2b17be['result']['sys_id'];_0x482ea5(_0x9d0ec5);});});}function getRemoteTag(_0x129687,_0x3b34fa,_0x16d02c,_0x250bea,_0x4573dc){return new Promise(function(_0x331c43,_0x3232c9){var _0x2b6b75={'method':'GET','uri':_0x16d02c+_0x93b3('0x43')+_0x93b3('0x44')+_0x129687+'&'+_0x250bea,'auth':_0x3b34fa,'json':!![]};return rp(_0x2b6b75)['then'](function(_0x4e8f00){if(_0x4e8f00[_0x93b3('0xf')][_0x93b3('0x19')]>0x0){var _0x4352f5=_0x4e8f00[_0x93b3('0xf')][0x0][_0x93b3('0x10')];_0x331c43(_0x4352f5);}else{return createRemoteTag(_0x129687,_0x3b34fa,_0x16d02c,_0x250bea)[_0x93b3('0xe')](function(_0x2d2277){_0x331c43(_0x2d2277);});}});});}function assignTagToIncident(_0x5021e3,_0x2627bc,_0x55a9af,_0x24cf4a,_0x762c94){return new Promise(function(_0x42429d,_0x523d53){var _0x2e3188={'method':_0x93b3('0x3b'),'uri':_0x55a9af+_0x93b3('0x45')+'?'+_0x762c94,'body':{'label':_0x5021e3,'table':_0x93b3('0x3c'),'id_type':'Incident','table_key':_0x24cf4a[_0x93b3('0x46')],'title':_0x93b3('0x47')+_0x24cf4a[_0x93b3('0x41')],'id_display':_0x24cf4a['ticketNumber']},'auth':_0x2627bc,'json':!![]};return rp(_0x2e3188)[_0x93b3('0xe')](function(_0x218db2){_0x42429d();})[_0x93b3('0x27')](function(){_0x42429d();});});}function manageTags(_0x2c3510,_0x377c94,_0x15bcd4,_0x40ab7c,_0x20e329,_0x1f2686,_0x3dd5ea){return new Promise(function(_0x435fb7,_0x4b0068){var _0x3b21e6=[];_0x377c94['forEach'](function(_0x10afde){_0x3b21e6['push'](getRemoteTag(_0x10afde,_0x15bcd4,_0x40ab7c,_0x1f2686,_0x3dd5ea));});return Promise[_0x93b3('0x48')](_0x3b21e6)[_0x93b3('0xe')](function(_0x79c65f){if(_0x79c65f[_0x93b3('0x19')]){logger[_0x93b3('0x11')]('['+[_0x2c3510[_0x93b3('0x12')]()]+_0x93b3('0x49'),_0x79c65f);var _0x256a22=[];_0x79c65f[_0x93b3('0x2b')](function(_0x18a3ef){_0x256a22[_0x93b3('0x4a')](assignTagToIncident(_0x18a3ef,_0x15bcd4,_0x40ab7c,_0x20e329,_0x1f2686));});return Promise['all'](_0x256a22)['then'](function(){_0x435fb7();})[_0x93b3('0x27')](function(){_0x435fb7();});}else{_0x435fb7();}});});}function getTags(_0x2d3ffe,_0x4d9ce6,_0x52dc96,_0x52e4de,_0x5de408,_0x4a7730){return function(_0x2afcf1){return new Promise(function(_0x1a8c18,_0x4c4569){var _0x174a90=[];var _0x5dd455=_0x52e4de[_0x93b3('0x4b')];if(_0x5dd455&&_0x5dd455['length']>0x0){_0x174a90=_[_0x93b3('0x4c')](_0x5dd455,_0x93b3('0x38'));}if(_0x174a90[_0x93b3('0x19')]>0x0){return manageTags(_0x2d3ffe,_0x174a90,_0x4d9ce6,_0x52dc96,_0x2afcf1,_0x5de408,_0x4a7730)['then'](function(){_0x1a8c18(_0x2afcf1);});}else{_0x1a8c18(_0x2afcf1);}});};}function emit(_0x5f0a30,_0x381693,_0xa36ba3){var _0x13b89f='%26sysparm_record_target%3Dincident'+_0x93b3('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x93b3('0x4e');var _0x509c09={'uri':_0x5f0a30+_0x93b3('0x4f')+_0xa36ba3+_0x13b89f};io['to'](util[_0x93b3('0x50')]('user:%s',_0x381693))['emit'](_0x93b3('0x51'),_0x509c09);}exports['cs']=function(_0x56ea11,_0x5bccaa,_0xc32b3e,_0x195efb,_0x5d2a4d,_0x14750e,_0xff2fe5,_0x5ab9ca){var _0x117dd9={};var _0xf58c16={'user':_0x14750e[_0x93b3('0x52')],'pass':_0x14750e[_0x93b3('0x53')]};var _0x3e1517=_0x93b3('0x54');var _0x22fe63=_0x93b3('0x55');_0x14750e[_0x93b3('0x56')]=intUtil[_0x93b3('0x57')](_0x14750e[_0x93b3('0x56')]);_0x14750e[_0x93b3('0x58')]=intUtil[_0x93b3('0x57')](_0x14750e['serverUrl']);var _0x3f244d=util[_0x93b3('0x50')]('%s/api/now/table/',_0x14750e[_0x93b3('0x56')]);_0x117dd9[_0x93b3('0x17')]=!_[_0x93b3('0x59')](_0x195efb)?_0x195efb[_0x93b3('0x5a')]:null;_0x117dd9['adminEmail']=_0x14750e[_0x93b3('0x5a')];_0x117dd9[_0x93b3('0x22')]=_0x5ab9ca['toLowerCase']()===_0x93b3('0x3a')?_0x5bccaa[_0x93b3('0x5b')]:_0x5bccaa[_0x93b3('0x5c')];_0x117dd9['callDirection']=_0x5ab9ca==='queue'||_0x5ab9ca===_0x93b3('0x5d')?_0x93b3('0x5e'):_0x93b3('0x3a');var _0x2132c5=util[_0x93b3('0x50')](_0x93b3('0x5f'),_0x14750e[_0x93b3('0x58')],_0x5bccaa['uniqueid'],md5(_0x5bccaa[_0x93b3('0x60')]));if(_0x5d2a4d&&_0x5d2a4d['monitor_format']){logger[_0x93b3('0x11')]('[QUEUE]',_0x93b3('0x61'));_0x5bccaa[_0x93b3('0x62')]=_0x2132c5;}else if(_0xff2fe5&&_0xff2fe5[_0x93b3('0x63')]&&_0xff2fe5[_0x93b3('0x63')]!==_0x93b3('0x64')){logger['info']('[OUTBOUND]',_0x93b3('0x61'));_0x5bccaa['recordingURL']=_0x2132c5;}else{_0x5bccaa['recordingURL']='';}return getAdminUser(_0x5ab9ca,_0xf58c16,_0x117dd9,_0x3f244d,_0x22fe63,_0x3e1517)['then'](getUser(_0x5ab9ca,_0xf58c16,_0x3f244d,_0x22fe63,_0x3e1517))['then'](getEndUser(_0x5ab9ca,_0xf58c16,_0x3f244d,_0x22fe63,_0x3e1517))[_0x93b3('0xe')](getTicket(_0x5ab9ca,_0xf58c16,_0x3f244d,_0xc32b3e,_0x5bccaa,_0x22fe63))[_0x93b3('0xe')](function(_0x30b3e6){logger[_0x93b3('0x11')](util['format'](_0x93b3('0x65'),_0x30b3e6[_0x93b3('0x46')]));logger[_0x93b3('0x11')](util[_0x93b3('0x50')](_0x93b3('0x66'),_0x5ab9ca));if(_0x5ab9ca!==_0x93b3('0x5d')){logger[_0x93b3('0x11')]('['+[_0x5ab9ca['toUpperCase']()]+']',_0x93b3('0x67'));emit(_0x14750e['remoteUri'],_0x195efb['name'],_0x30b3e6[_0x93b3('0x46')]);}})[_0x93b3('0x27')](function(_0x2e759f){logger[_0x93b3('0x14')]('['+[_0x5ab9ca[_0x93b3('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x93b3('0x68')](_0x2e759f,{'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 0291dc6..49a1584 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 _0xb81d=['isNil','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','first_name','','Caller\x20-\x20%s','debug','[HTTP]','map','string','nameField','customField','toLowerCase','content','type','custom_fields','variable','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','%s/service/v4_1/rest.php','lastevent','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','apiKey','toString','get_server_info'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xb81d,0x1a5));var _0xdb81=function(_0x24be3e,_0x2b8568){_0x24be3e=_0x24be3e-0x0;var _0x5909cc=_0xb81d[_0x24be3e];return _0x5909cc;};'use strict';var _=require('lodash');var rp=require(_0xdb81('0x0'));var BPromise=require(_0xdb81('0x1'));var md5=require(_0xdb81('0x2'));var util=require(_0xdb81('0x3'));var Redis=require(_0xdb81('0x4'));var intUtil=require(_0xdb81('0x5'));var config=require(_0xdb81('0x6'));var logger=require(_0xdb81('0x7'))('sugarcrm');config[_0xdb81('0x8')]=_[_0xdb81('0x9')](config[_0xdb81('0x8')],{'host':_0xdb81('0xa'),'port':0x18eb});var io=require(_0xdb81('0xb'))(new Redis(config[_0xdb81('0x8')]));var def={'method':_0xdb81('0xc'),'json':!![]};function emit(_0x136e5c,_0x39fbf6,_0x42370e){io['to'](_0x136e5c)[_0xdb81('0xd')](_0x39fbf6,_0x42370e);}function getTicket(_0x4a1ee5,_0x4f2afc,_0x9e6c9b,_0x6fd076,_0x32a9df,_0xbc2f64,_0x5c404a,_0x247122){logger[_0xdb81('0xe')](_0xdb81('0xf'));var _0x1c2b34=new Date();var _0x5ea27d=[{'name':_0xdb81('0x10'),'value':intUtil['getString'](_0x6fd076[_0xdb81('0x11')],_0x32a9df,'\x20')},{'name':_0xdb81('0x12'),'value':_0x4f2afc['id']},{'name':_0xdb81('0x13'),'value':_0x4f2afc['id']},{'name':_0xdb81('0x14'),'value':intUtil['getString'](_0x6fd076[_0xdb81('0x15')],_0x32a9df,'\x0a')},{'name':'date_start','value':_0x1c2b34[_0xdb81('0x16')]()[_0xdb81('0x17')](0x0,0x13)[_0xdb81('0x18')]('T','\x20')},{'name':_0xdb81('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xdb81('0x1a'),'value':_0x9e6c9b['id']},{'name':_0xdb81('0x1b'),'value':_0xdb81('0x1c')},{'name':_0xdb81('0x1d'),'value':_0x9e6c9b[_0xdb81('0x10')]},{'name':_0xdb81('0x1e'),'value':_0x247122}];if(_0xbc2f64[_0xdb81('0x1f')]){_[_0xdb81('0x20')](_0xbc2f64,function(_0x5e8353){if(_0x32a9df[_0x5e8353['variableName']]){_0x5ea27d[_0xdb81('0x21')]({'name':_0x5e8353[_0xdb81('0x22')],'value':_0x32a9df[_0x5e8353[_0xdb81('0x23')]]});}});}return request({'form':{'method':_0xdb81('0x24'),'input_type':_0xdb81('0x25'),'response_type':'JSON','rest_data':JSON[_0xdb81('0x26')]({'session':_0x5c404a['id'],'module_name':_0xdb81('0x27'),'name_value_list':_0x5ea27d})}});}function getAuth(_0x137d9a){return util['format']('Basic\x20%s',new Buffer(_0x137d9a[_0xdb81('0x28')]+':X')[_0xdb81('0x29')]('base64'));}function getServerInfo(_0x14a6b8){return request({'form':{'method':_0xdb81('0x2a'),'input_type':_0xdb81('0x25'),'response_type':_0xdb81('0x25'),'rest_data':JSON[_0xdb81('0x26')]({'session':_0x14a6b8['id']})}});}function getUser(_0x1e2ee8,_0x25170a,_0x14c52f){if(!_[_0xdb81('0x2b')](_0x25170a)){logger['info'](_0xdb81('0x2c'),_0x25170a);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xdb81('0x26')]({'session':_0x14c52f['id'],'module_name':'Employees','query':util[_0xdb81('0x2d')](_0xdb81('0x2e'),_0x25170a),'order_by':'','offset':'0','select_fields':['id',_0xdb81('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdb81('0x2f')](function(_0x33d201){if(_0x33d201[_0xdb81('0x30')][_0xdb81('0x1f')]){var _0x1bba7f=_[_0xdb81('0x31')](_0x33d201[_0xdb81('0x30')],function(_0xcb22bb){return _0xcb22bb[_0xdb81('0x32')]['user_name']['value']===_0x25170a;});if(_0x1bba7f){logger[_0xdb81('0xe')](_0xdb81('0x33'));return BPromise[_0xdb81('0x34')]({'id':_0x1bba7f[_0xdb81('0x32')]['id'][_0xdb81('0x35')],'name':_0x1bba7f[_0xdb81('0x32')][_0xdb81('0x10')][_0xdb81('0x35')]});}}logger['info'](_0xdb81('0x36'));return BPromise[_0xdb81('0x34')]({'id':_0x14c52f[_0xdb81('0x32')][_0xdb81('0x37')][_0xdb81('0x35')],'name':_0x14c52f[_0xdb81('0x32')]['user_name']['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xdb81('0x34')]({'id':_0x14c52f['name_value_list'][_0xdb81('0x37')][_0xdb81('0x35')],'name':_0x14c52f[_0xdb81('0x32')]['user_name'][_0xdb81('0x35')]});}}function getEndUser(_0x2a7646,_0xd2c25e,_0x40d024,_0x22f029){logger[_0xdb81('0xe')](_0xdb81('0x38'),_0x40d024);return request({'form':{'method':_0xdb81('0x39'),'input_type':_0xdb81('0x25'),'response_type':'JSON','rest_data':JSON[_0xdb81('0x26')]({'session':_0x22f029['id'],'module_name':_0xdb81('0x1c'),'query':util[_0xdb81('0x2d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x40d024),'order_by':'','offset':'0','select_fields':['id','name',_0xdb81('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdb81('0x2f')](function(_0x3d8a82){if(_0x3d8a82['entry_list']['length']){var _0x4246e7=_[_0xdb81('0x31')](_0x3d8a82[_0xdb81('0x30')],function(_0x39adb2){return _0x39adb2[_0xdb81('0x32')][_0xdb81('0x3a')][_0xdb81('0x35')]===_0x40d024;});if(_0x4246e7){logger[_0xdb81('0xe')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x4246e7['name_value_list']['id'][_0xdb81('0x35')],'name':_0x4246e7[_0xdb81('0x32')][_0xdb81('0x10')][_0xdb81('0x35')],'phone':_0x4246e7['name_value_list']['phone_home'][_0xdb81('0x35')]});}}else{logger[_0xdb81('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xdb81('0x24'),'input_type':_0xdb81('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x22f029['id'],'module_name':_0xdb81('0x1c'),'name_value_list':[{'name':_0xdb81('0x3b'),'value':_0xd2c25e!==_0xdb81('0x3c')?_0xd2c25e:util['format'](_0xdb81('0x3d'),_0x40d024)},{'name':_0xdb81('0x3a'),'value':_0x40d024}]})}})[_0xdb81('0x2f')](function(_0x397c68){logger[_0xdb81('0xe')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x397c68['id'],'name':_0x397c68[_0xdb81('0x30')]['first_name'][_0xdb81('0x35')],'phone':_0x397c68['entry_list'][_0xdb81('0x3a')][_0xdb81('0x35')]});});}});}function request(_0x1b3d05){logger[_0xdb81('0x3e')](_0xdb81('0x3f'),JSON[_0xdb81('0x26')](_0x1b3d05));return rp(_['merge'](def,_0x1b3d05));}function getTags(_0x7364b2,_0x5ea28e){var _0x5bd875=[];if(_0x7364b2&&_0x7364b2[_0xdb81('0x1f')]>0x0){_0x5bd875=_[_0xdb81('0x40')](_0x7364b2,_0x5ea28e);}return _0x5bd875;}function getCustomFields(_0x1d072a,_0x1ad013){var _0x56da9c=[];var _0x888e62={'custom_fields':[]};if(_0x1d072a['length']>0x0){_[_0xdb81('0x20')](_0x1d072a,function(_0x353abd){if(_0x353abd['type']===_0xdb81('0x41')&&_0x353abd[_0xdb81('0x42')]&&!_0x353abd[_0xdb81('0x43')]){_0x888e62[_0x353abd[_0xdb81('0x42')][_0xdb81('0x44')]()]=_0x353abd[_0xdb81('0x45')][_0xdb81('0x29')]();}else if(_0x353abd[_0xdb81('0x46')]==='string'&&_0x353abd['idField']&&_0x353abd[_0xdb81('0x43')]){_0x888e62[_0xdb81('0x47')][_0xdb81('0x21')]({'id':_0x353abd['idField'],'value':_0x353abd['content']['toString']()});}else if(_0x353abd[_0xdb81('0x46')]===_0xdb81('0x48')&&_0x353abd['variableName']&&_0x353abd[_0xdb81('0x22')]&&_0x353abd['customField']){_0x1ad013[_0x353abd[_0xdb81('0x23')]]&&_0x888e62[_0xdb81('0x47')]['push']({'id':_0x353abd['idField'],'value':_0x1ad013[_0x353abd[_0xdb81('0x23')]][_0xdb81('0x29')]()});}else if(_0x353abd[_0xdb81('0x46')]===_0xdb81('0x49')&&_0x353abd[_0xdb81('0x4a')]&&_0x353abd['Variable'][_0xdb81('0x10')]&&_0x353abd['idField']&&_0x353abd[_0xdb81('0x43')]){_0x1ad013[_0x353abd['Variable'][_0xdb81('0x10')][_0xdb81('0x44')]()]&&_0x888e62[_0xdb81('0x47')]['push']({'id':_0x353abd[_0xdb81('0x22')],'value':_0x1ad013[_0x353abd[_0xdb81('0x4a')][_0xdb81('0x10')][_0xdb81('0x44')]()][_0xdb81('0x29')]()});}});}return _0x888e62;}function getConnection(_0x78128f){return request({'method':_0xdb81('0xc'),'form':{'method':_0xdb81('0x4b'),'input_type':_0xdb81('0x25'),'response_type':'JSON','rest_data':JSON[_0xdb81('0x26')]({'user_auth':{'user_name':_0x78128f[_0xdb81('0x4c')],'password':_0x78128f['password'],'encryption':'PLAIN'},'application':_0xdb81('0x4d')})}})[_0xdb81('0x2f')](function(_0x142ae9){var _0x4e71a4=_0x142ae9;if(_0x4e71a4['id']){def['sessionID']=_0x4e71a4['id'];return BPromise[_0xdb81('0x34')](_0x4e71a4);}else{throw new Error(util[_0xdb81('0x2d')](_0xdb81('0x4e'),_0x78128f['id']));}});}function setRelationship(_0x41c11e,_0x365a40,_0x247fcb,_0x9a48d6){return request({'form':{'method':_0xdb81('0x4f'),'input_type':_0xdb81('0x25'),'response_type':_0xdb81('0x25'),'rest_data':JSON[_0xdb81('0x26')]({'session':_0x41c11e['id'],'module_name':_0xdb81('0x27'),'module_id':_0x247fcb['id'],'link_field_name':_0x9a48d6,'related_ids':[_0x365a40['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0xd7864,_0x131d7d,_0x34b173,_0x4fe531,_0x2343f,_0x2d2339){var _0xbacfc9,_0x39880b,_0x4c8736,_0x18f406;_0x2d2339[_0xdb81('0x50')]=intUtil[_0xdb81('0x51')](_0x2d2339[_0xdb81('0x50')]);_0x2d2339['serverUrl']=intUtil[_0xdb81('0x51')](_0x2d2339[_0xdb81('0x52')]);def[_0xdb81('0x53')]=util[_0xdb81('0x2d')]('%s/service/v4_1/rest.php',_0x2d2339[_0xdb81('0x50')]);if(_0x2343f&&_0x2343f[_0xdb81('0x54')]){logger[_0xdb81('0xe')](_0xdb81('0x55'),_0xdb81('0x56'));_0x131d7d[_0xdb81('0x57')]=util['format'](_0xdb81('0x58'),_0x2d2339[_0xdb81('0x52')],_0x131d7d[_0xdb81('0x59')],md5(_0x131d7d[_0xdb81('0x59')]));}else{_0x131d7d[_0xdb81('0x57')]='';}return getConnection(_0x2d2339)[_0xdb81('0x2f')](function(_0x2584d4){_0x18f406=_0x2584d4;return getUser(_0x2d2339,_0x4fe531[_0xdb81('0x10')],_0x18f406);})['then'](function(_0x21ab7f){_0xbacfc9=_0x21ab7f;logger[_0xdb81('0xe')]('The\x20User\x20ID\x20is:',_0xbacfc9['id']);return getEndUser(_0x2d2339,_0x131d7d[_0xdb81('0x5a')],_0x131d7d[_0xdb81('0x5b')],_0x18f406);})[_0xdb81('0x2f')](function(_0x5404ca){_0x39880b=_0x5404ca;logger['info'](_0xdb81('0x5c'),_0x39880b['id']);return getTicket(_0x2d2339,_0xbacfc9,_0x39880b,_0x34b173,_0x131d7d,_0x34b173[_0xdb81('0x5d')],_0x18f406,_0xdb81('0x5e'));})[_0xdb81('0x2f')](function(_0x2d8b86){_0x4c8736=_0x2d8b86;logger[_0xdb81('0xe')](_0xdb81('0x5f'));logger[_0xdb81('0xe')](_0xdb81('0x60'),_0x4c8736['id']);return setRelationship(_0x18f406,_0xbacfc9,_0x4c8736,_0xdb81('0x61'));})['then'](function(){return setRelationship(_0x18f406,_0x39880b,_0x4c8736,_0xdb81('0x62'));})[_0xdb81('0x2f')](function(){return getServerInfo(_0x18f406);})[_0xdb81('0x2f')](function(_0x4f68bc){var _0x3e4114=parseInt(_0x4f68bc[_0xdb81('0x63')]['charAt'](0x0));var _0x3af393=util[_0xdb81('0x2d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2d2339[_0xdb81('0x50')],_0x4c8736['id']);if(_0x3e4114>0x6){_0x3af393=util[_0xdb81('0x2d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2d2339[_0xdb81('0x50')],_0x4c8736['id']);}logger[_0xdb81('0xe')](_0xdb81('0x55'),_0xdb81('0x64'));emit(util[_0xdb81('0x2d')](_0xdb81('0x65'),_0x4fe531['name']),_0xdb81('0x66'),{'uri':_0x3af393});})['catch'](function(_0x3e1206){logger['error'](_0xdb81('0x55'),JSON['stringify'](_0x3e1206));});};exports[_0xdb81('0x67')]=function(_0x351f4a,_0x5a3d59,_0x148e0e,_0x28d8b7,_0x6cde59,_0x316e10,_0x54868b){var _0x2c7ef9,_0x2ed51e,_0x1e8261,_0x1a73f6;_0x316e10['remoteUri']=intUtil[_0xdb81('0x51')](_0x316e10[_0xdb81('0x50')]);_0x316e10[_0xdb81('0x52')]=intUtil[_0xdb81('0x51')](_0x316e10[_0xdb81('0x52')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x316e10[_0xdb81('0x50')]);if(_0x54868b&&_0x54868b[_0xdb81('0x68')]&&_0x54868b[_0xdb81('0x68')]!==_0xdb81('0x69')){logger['info'](_0xdb81('0x6a'),'Recording\x20is\x20enabled!');_0x5a3d59[_0xdb81('0x57')]=util[_0xdb81('0x2d')](_0xdb81('0x58'),_0x316e10[_0xdb81('0x52')],_0x5a3d59['uniqueid'],md5(_0x5a3d59[_0xdb81('0x59')]));}return getConnection(_0x316e10)[_0xdb81('0x2f')](function(_0x40cc07){_0x1a73f6=_0x40cc07;return getUser(_0x316e10,_0x28d8b7[_0xdb81('0x10')],_0x1a73f6);})[_0xdb81('0x2f')](function(_0xf01b86){_0x2c7ef9=_0xf01b86;logger[_0xdb81('0xe')](_0xdb81('0x6b'),_0x2c7ef9['id']);return getEndUser(_0x316e10,_0x5a3d59[_0xdb81('0x6c')],_0x5a3d59['destcalleridnum'],_0x1a73f6);})[_0xdb81('0x2f')](function(_0x526b1c){_0x2ed51e=_0x526b1c;logger['info'](_0xdb81('0x5c'),_0x2ed51e['id']);return getTicket(_0x316e10,_0x2c7ef9,_0x2ed51e,_0x148e0e,_0x5a3d59,_0x148e0e[_0xdb81('0x5d')],_0x1a73f6,_0xdb81('0x6d'));})[_0xdb81('0x2f')](function(_0x2b66bc){_0x1e8261=_0x2b66bc;logger[_0xdb81('0xe')](_0xdb81('0x5f'));logger[_0xdb81('0xe')](_0xdb81('0x60'),_0x1e8261['id']);return setRelationship(_0x1a73f6,_0x2c7ef9,_0x1e8261,_0xdb81('0x61'));})[_0xdb81('0x2f')](function(){return setRelationship(_0x1a73f6,_0x2ed51e,_0x1e8261,_0xdb81('0x62'));})[_0xdb81('0x2f')](function(){return getServerInfo(_0x1a73f6);})['then'](function(_0x36077d){var _0x4a8e93=parseInt(_0x36077d[_0xdb81('0x63')][_0xdb81('0x6e')](0x0));var _0x2fcacf=util[_0xdb81('0x2d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x316e10[_0xdb81('0x50')],_0x1e8261['id']);if(_0x4a8e93>0x6){_0x2fcacf=util[_0xdb81('0x2d')](_0xdb81('0x6f'),_0x316e10['remoteUri'],_0x1e8261['id']);}logger[_0xdb81('0xe')](_0xdb81('0x6a'),_0xdb81('0x64'));emit(util['format']('user:%s',_0x28d8b7[_0xdb81('0x10')]),_0xdb81('0x66'),{'uri':_0x2fcacf});})[_0xdb81('0x70')](function(_0x33dba5){logger['error']('[OUTBOUND]',JSON['stringify'](_0x33dba5));});};exports['unmanaged']=function(_0x21bdde,_0x46608f,_0xf400e1,_0xdb8ac0,_0x1425bc,_0x33754c){var _0x4ec42e,_0x16ffc1,_0x232fdd,_0x1f5ba4;_0x33754c['remoteUri']=intUtil[_0xdb81('0x51')](_0x33754c[_0xdb81('0x50')]);_0x33754c[_0xdb81('0x52')]=intUtil[_0xdb81('0x51')](_0x33754c[_0xdb81('0x52')]);def[_0xdb81('0x53')]=util['format'](_0xdb81('0x71'),_0x33754c[_0xdb81('0x50')]);if(_0x1425bc&&_0x1425bc[_0xdb81('0x54')]){logger[_0xdb81('0xe')]('['+_0x46608f[_0xdb81('0x72')][_0xdb81('0x73')]()+']',_0xdb81('0x56'));_0x46608f['recordingURL']=util['format'](_0xdb81('0x58'),_0x33754c[_0xdb81('0x52')],_0x46608f[_0xdb81('0x59')],md5(_0x46608f['uniqueid']));}else{_0x46608f[_0xdb81('0x57')]='';}return getConnection(_0x33754c)[_0xdb81('0x2f')](function(_0x1df35f){_0x1f5ba4=_0x1df35f;if(!_['isNil'](_0xdb8ac0)){return getUser(_0x33754c,_0xdb8ac0[_0xdb81('0x10')],_0x1f5ba4);}else{return getUser(_0x33754c,null,_0x1f5ba4);}})[_0xdb81('0x2f')](function(_0x428e75){_0x4ec42e=_0x428e75;logger[_0xdb81('0xe')](_0xdb81('0x6b'),_0x4ec42e['id']);return getEndUser(_0x33754c,_0x46608f['calleridname'],_0x46608f[_0xdb81('0x5b')],_0x1f5ba4);})[_0xdb81('0x2f')](function(_0x55b24c){_0x16ffc1=_0x55b24c;logger['info'](_0xdb81('0x5c'),_0x16ffc1['id']);return getTicket(_0x33754c,_0x4ec42e,_0x16ffc1,_0xf400e1,_0x46608f,_0xf400e1[_0xdb81('0x5d')],_0x1f5ba4,'Inbound');})[_0xdb81('0x2f')](function(_0xb41ccd){_0x232fdd=_0xb41ccd;logger[_0xdb81('0xe')](_0xdb81('0x5f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x232fdd['id']);return setRelationship(_0x1f5ba4,_0x4ec42e,_0x232fdd,_0xdb81('0x61'));})['then'](function(){return setRelationship(_0x1f5ba4,_0x16ffc1,_0x232fdd,_0xdb81('0x62'));})[_0xdb81('0x2f')](function(){return getServerInfo(_0x1f5ba4);})['catch'](function(_0x3c81b2){logger['error']('['+_0x46608f[_0xdb81('0x72')]['toUpperCase']()+']',JSON['stringify'](_0x3c81b2));});}; \ No newline at end of file +var _0x4dbb=['error','unmanaged','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','POST','emit','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','getString','Descriptions','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','content','toString','type','custom_fields','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','uri','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Inbound','Ticket\x20created!','users','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','user:%s','trigger:browser:url','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch'];(function(_0x5e0664,_0x4307dc){var _0x51ed02=function(_0x4b5b88){while(--_0x4b5b88){_0x5e0664['push'](_0x5e0664['shift']());}};_0x51ed02(++_0x4307dc);}(_0x4dbb,0xfc));var _0xb4db=function(_0x1fc512,_0x1996db){_0x1fc512=_0x1fc512-0x0;var _0xae94b9=_0x4dbb[_0x1fc512];return _0xae94b9;};'use strict';var _=require(_0xb4db('0x0'));var rp=require(_0xb4db('0x1'));var BPromise=require(_0xb4db('0x2'));var md5=require('md5');var util=require(_0xb4db('0x3'));var Redis=require(_0xb4db('0x4'));var intUtil=require(_0xb4db('0x5'));var config=require(_0xb4db('0x6'));var logger=require(_0xb4db('0x7'))('sugarcrm');config[_0xb4db('0x8')]=_[_0xb4db('0x9')](config[_0xb4db('0x8')],{'host':_0xb4db('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb4db('0x8')]));var def={'method':_0xb4db('0xb'),'json':!![]};function emit(_0x5f28b6,_0x18d751,_0x3ef2fd){io['to'](_0x5f28b6)[_0xb4db('0xc')](_0x18d751,_0x3ef2fd);}function getTicket(_0x347089,_0x16a7b4,_0x1b777f,_0x2aea9e,_0x3d9af5,_0x16d879,_0x1e0199,_0x1aa418){logger['info'](_0xb4db('0xd'));var _0x1b4bb0=new Date();var _0x2581b2=[{'name':_0xb4db('0xe'),'value':intUtil['getString'](_0x2aea9e[_0xb4db('0xf')],_0x3d9af5,'\x20')},{'name':_0xb4db('0x10'),'value':_0x16a7b4['id']},{'name':_0xb4db('0x11'),'value':_0x16a7b4['id']},{'name':'description','value':intUtil[_0xb4db('0x12')](_0x2aea9e[_0xb4db('0x13')],_0x3d9af5,'\x0a')},{'name':'date_start','value':_0x1b4bb0['toISOString']()['slice'](0x0,0x13)[_0xb4db('0x14')]('T','\x20')},{'name':_0xb4db('0x15'),'value':'0'},{'name':_0xb4db('0x16'),'value':'15'},{'name':'parent_id','value':_0x1b777f['id']},{'name':_0xb4db('0x17'),'value':_0xb4db('0x18')},{'name':_0xb4db('0x19'),'value':_0x1b777f[_0xb4db('0xe')]},{'name':'direction','value':_0x1aa418}];if(_0x16d879[_0xb4db('0x1a')]){_[_0xb4db('0x1b')](_0x16d879,function(_0x309579){if(_0x3d9af5[_0x309579[_0xb4db('0x1c')]]){_0x2581b2[_0xb4db('0x1d')]({'name':_0x309579[_0xb4db('0x1e')],'value':_0x3d9af5[_0x309579[_0xb4db('0x1c')]]});}});}return request({'form':{'method':_0xb4db('0x1f'),'input_type':'JSON','response_type':_0xb4db('0x20'),'rest_data':JSON[_0xb4db('0x21')]({'session':_0x1e0199['id'],'module_name':_0xb4db('0x22'),'name_value_list':_0x2581b2})}});}function getAuth(_0x3c3fc6){return util[_0xb4db('0x23')](_0xb4db('0x24'),new Buffer(_0x3c3fc6[_0xb4db('0x25')]+':X')['toString']('base64'));}function getServerInfo(_0x3ebb3f){return request({'form':{'method':_0xb4db('0x26'),'input_type':_0xb4db('0x20'),'response_type':_0xb4db('0x20'),'rest_data':JSON['stringify']({'session':_0x3ebb3f['id']})}});}function getUser(_0x42ba38,_0x507bf2,_0xccf1a1){if(!_[_0xb4db('0x27')](_0x507bf2)){logger[_0xb4db('0x28')](_0xb4db('0x29'),_0x507bf2);return request({'form':{'method':_0xb4db('0x2a'),'input_type':_0xb4db('0x20'),'response_type':_0xb4db('0x20'),'rest_data':JSON[_0xb4db('0x21')]({'session':_0xccf1a1['id'],'module_name':'Employees','query':util[_0xb4db('0x23')](_0xb4db('0x2b'),_0x507bf2),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb4db('0x2c')](function(_0xf6c768){if(_0xf6c768['entry_list'][_0xb4db('0x1a')]){var _0xb8970f=_[_0xb4db('0x2d')](_0xf6c768[_0xb4db('0x2e')],function(_0x36c1e0){return _0x36c1e0['name_value_list']['user_name'][_0xb4db('0x2f')]===_0x507bf2;});if(_0xb8970f){logger[_0xb4db('0x28')](_0xb4db('0x30'));return BPromise[_0xb4db('0x31')]({'id':_0xb8970f[_0xb4db('0x32')]['id'][_0xb4db('0x2f')],'name':_0xb8970f[_0xb4db('0x32')][_0xb4db('0xe')][_0xb4db('0x2f')]});}}logger[_0xb4db('0x28')](_0xb4db('0x33'));return BPromise[_0xb4db('0x31')]({'id':_0xccf1a1[_0xb4db('0x32')][_0xb4db('0x34')][_0xb4db('0x2f')],'name':_0xccf1a1[_0xb4db('0x32')][_0xb4db('0x35')][_0xb4db('0x2f')]});});}else{logger[_0xb4db('0x28')](_0xb4db('0x36'));return BPromise[_0xb4db('0x31')]({'id':_0xccf1a1[_0xb4db('0x32')]['user_id'][_0xb4db('0x2f')],'name':_0xccf1a1[_0xb4db('0x32')][_0xb4db('0x35')][_0xb4db('0x2f')]});}}function getEndUser(_0x411b19,_0x569a26,_0x3fff3b,_0x518db8){logger[_0xb4db('0x28')]('Searching\x20enduser\x20with\x20phone',_0x3fff3b);return request({'form':{'method':_0xb4db('0x2a'),'input_type':_0xb4db('0x20'),'response_type':_0xb4db('0x20'),'rest_data':JSON[_0xb4db('0x21')]({'session':_0x518db8['id'],'module_name':_0xb4db('0x18'),'query':util[_0xb4db('0x23')](_0xb4db('0x37'),_0x3fff3b),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb4db('0x2c')](function(_0x343c94){if(_0x343c94['entry_list'][_0xb4db('0x1a')]){var _0x31b4c4=_[_0xb4db('0x2d')](_0x343c94[_0xb4db('0x2e')],function(_0x4defcb){return _0x4defcb['name_value_list'][_0xb4db('0x38')]['value']===_0x3fff3b;});if(_0x31b4c4){logger[_0xb4db('0x28')]('Enduser\x20found!');return BPromise[_0xb4db('0x31')]({'id':_0x31b4c4[_0xb4db('0x32')]['id'][_0xb4db('0x2f')],'name':_0x31b4c4[_0xb4db('0x32')][_0xb4db('0xe')]['value'],'phone':_0x31b4c4[_0xb4db('0x32')][_0xb4db('0x38')]['value']});}}else{logger['info'](_0xb4db('0x39'));return request({'form':{'method':_0xb4db('0x1f'),'input_type':_0xb4db('0x20'),'response_type':_0xb4db('0x20'),'rest_data':JSON[_0xb4db('0x21')]({'session':_0x518db8['id'],'module_name':'Contacts','name_value_list':[{'name':_0xb4db('0x3a'),'value':_0x569a26!==_0xb4db('0x3b')?_0x569a26:util['format'](_0xb4db('0x3c'),_0x3fff3b)},{'name':_0xb4db('0x38'),'value':_0x3fff3b}]})}})[_0xb4db('0x2c')](function(_0x517ea6){logger[_0xb4db('0x28')]('Enduser\x20created.');return BPromise[_0xb4db('0x31')]({'id':_0x517ea6['id'],'name':_0x517ea6['entry_list'][_0xb4db('0x3a')][_0xb4db('0x2f')],'phone':_0x517ea6[_0xb4db('0x2e')][_0xb4db('0x38')][_0xb4db('0x2f')]});});}});}function request(_0x29d777){logger[_0xb4db('0x3d')](_0xb4db('0x3e'),JSON[_0xb4db('0x21')](_0x29d777));return rp(_[_0xb4db('0x3f')](def,_0x29d777));}function getTags(_0x2bd9af,_0x52bf96){var _0x3ac7d6=[];if(_0x2bd9af&&_0x2bd9af['length']>0x0){_0x3ac7d6=_[_0xb4db('0x40')](_0x2bd9af,_0x52bf96);}return _0x3ac7d6;}function getCustomFields(_0x8b5ed1,_0x120c16){var _0x578760=[];var _0x256517={'custom_fields':[]};if(_0x8b5ed1['length']>0x0){_[_0xb4db('0x1b')](_0x8b5ed1,function(_0x1b743a){if(_0x1b743a['type']===_0xb4db('0x41')&&_0x1b743a[_0xb4db('0x42')]&&!_0x1b743a[_0xb4db('0x43')]){_0x256517[_0x1b743a['nameField'][_0xb4db('0x44')]()]=_0x1b743a[_0xb4db('0x45')][_0xb4db('0x46')]();}else if(_0x1b743a[_0xb4db('0x47')]==='string'&&_0x1b743a['idField']&&_0x1b743a[_0xb4db('0x43')]){_0x256517[_0xb4db('0x48')]['push']({'id':_0x1b743a['idField'],'value':_0x1b743a[_0xb4db('0x45')][_0xb4db('0x46')]()});}else if(_0x1b743a['type']===_0xb4db('0x49')&&_0x1b743a['variableName']&&_0x1b743a[_0xb4db('0x1e')]&&_0x1b743a[_0xb4db('0x43')]){_0x120c16[_0x1b743a[_0xb4db('0x1c')]]&&_0x256517[_0xb4db('0x48')][_0xb4db('0x1d')]({'id':_0x1b743a[_0xb4db('0x1e')],'value':_0x120c16[_0x1b743a[_0xb4db('0x1c')]][_0xb4db('0x46')]()});}else if(_0x1b743a[_0xb4db('0x47')]===_0xb4db('0x4a')&&_0x1b743a[_0xb4db('0x4b')]&&_0x1b743a[_0xb4db('0x4b')][_0xb4db('0xe')]&&_0x1b743a[_0xb4db('0x1e')]&&_0x1b743a[_0xb4db('0x43')]){_0x120c16[_0x1b743a[_0xb4db('0x4b')][_0xb4db('0xe')][_0xb4db('0x44')]()]&&_0x256517[_0xb4db('0x48')][_0xb4db('0x1d')]({'id':_0x1b743a[_0xb4db('0x1e')],'value':_0x120c16[_0x1b743a['Variable'][_0xb4db('0xe')][_0xb4db('0x44')]()][_0xb4db('0x46')]()});}});}return _0x256517;}function getConnection(_0x202604){return request({'method':_0xb4db('0xb'),'form':{'method':_0xb4db('0x4c'),'input_type':_0xb4db('0x20'),'response_type':'JSON','rest_data':JSON[_0xb4db('0x21')]({'user_auth':{'user_name':_0x202604[_0xb4db('0x4d')],'password':_0x202604['password'],'encryption':_0xb4db('0x4e')},'application':_0xb4db('0x4f')})}})[_0xb4db('0x2c')](function(_0x39f06b){var _0x4a5aff=_0x39f06b;if(_0x4a5aff['id']){def[_0xb4db('0x50')]=_0x4a5aff['id'];return BPromise['resolve'](_0x4a5aff);}else{throw new Error(util[_0xb4db('0x23')](_0xb4db('0x51'),_0x202604['id']));}});}function setRelationship(_0xec6a21,_0x2adfb2,_0x33b574,_0x191b63){return request({'form':{'method':_0xb4db('0x52'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb4db('0x21')]({'session':_0xec6a21['id'],'module_name':_0xb4db('0x22'),'module_id':_0x33b574['id'],'link_field_name':_0x191b63,'related_ids':[_0x2adfb2['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb4db('0x53')]=function(_0x4c2a5d,_0x5424b0,_0x126802,_0x23c13c,_0x4f6a42,_0x5df5cb){var _0x41c02b,_0x2c93af,_0x5bce90,_0x502e7f;_0x5df5cb['remoteUri']=intUtil[_0xb4db('0x54')](_0x5df5cb['remoteUri']);_0x5df5cb[_0xb4db('0x55')]=intUtil['stripTrailingSlash'](_0x5df5cb[_0xb4db('0x55')]);def[_0xb4db('0x56')]=util[_0xb4db('0x23')]('%s/service/v4_1/rest.php',_0x5df5cb[_0xb4db('0x57')]);if(_0x4f6a42&&_0x4f6a42[_0xb4db('0x58')]){logger[_0xb4db('0x28')](_0xb4db('0x59'),'Recording\x20is\x20enabled!');_0x5424b0[_0xb4db('0x5a')]=util[_0xb4db('0x23')](_0xb4db('0x5b'),_0x5df5cb[_0xb4db('0x55')],_0x5424b0[_0xb4db('0x5c')],md5(_0x5424b0['uniqueid']));}else{_0x5424b0[_0xb4db('0x5a')]='';}return getConnection(_0x5df5cb)[_0xb4db('0x2c')](function(_0x9ab569){_0x502e7f=_0x9ab569;return getUser(_0x5df5cb,_0x23c13c[_0xb4db('0xe')],_0x502e7f);})[_0xb4db('0x2c')](function(_0x551ca2){_0x41c02b=_0x551ca2;logger[_0xb4db('0x28')]('The\x20User\x20ID\x20is:',_0x41c02b['id']);return getEndUser(_0x5df5cb,_0x5424b0[_0xb4db('0x5d')],_0x5424b0[_0xb4db('0x5e')],_0x502e7f);})['then'](function(_0x2884d8){_0x2c93af=_0x2884d8;logger[_0xb4db('0x28')]('The\x20Enduser\x20ID\x20is:',_0x2c93af['id']);return getTicket(_0x5df5cb,_0x41c02b,_0x2c93af,_0x126802,_0x5424b0,_0x126802['Fields'],_0x502e7f,_0xb4db('0x5f'));})[_0xb4db('0x2c')](function(_0x4b3be9){_0x5bce90=_0x4b3be9;logger[_0xb4db('0x28')](_0xb4db('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5bce90['id']);return setRelationship(_0x502e7f,_0x41c02b,_0x5bce90,_0xb4db('0x61'));})[_0xb4db('0x2c')](function(){return setRelationship(_0x502e7f,_0x2c93af,_0x5bce90,_0xb4db('0x62'));})[_0xb4db('0x2c')](function(){return getServerInfo(_0x502e7f);})[_0xb4db('0x2c')](function(_0x458780){var _0x49f113=parseInt(_0x458780['version'][_0xb4db('0x63')](0x0));var _0x42f26c=util[_0xb4db('0x23')](_0xb4db('0x64'),_0x5df5cb[_0xb4db('0x57')],_0x5bce90['id']);if(_0x49f113>0x6){_0x42f26c=util['format'](_0xb4db('0x65'),_0x5df5cb['remoteUri'],_0x5bce90['id']);}logger[_0xb4db('0x28')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb4db('0x23')](_0xb4db('0x66'),_0x23c13c[_0xb4db('0xe')]),_0xb4db('0x67'),{'uri':_0x42f26c});})['catch'](function(_0x2d247b){logger['error'](_0xb4db('0x59'),JSON[_0xb4db('0x21')](_0x2d247b));});};exports[_0xb4db('0x68')]=function(_0x5d8232,_0x243785,_0x519e1b,_0xc7480b,_0xa3f250,_0x5bc493,_0xa0baeb){var _0x471e0f,_0x4344ad,_0x53ef89,_0x348098;_0x5bc493[_0xb4db('0x57')]=intUtil[_0xb4db('0x54')](_0x5bc493[_0xb4db('0x57')]);_0x5bc493[_0xb4db('0x55')]=intUtil[_0xb4db('0x54')](_0x5bc493[_0xb4db('0x55')]);def[_0xb4db('0x56')]=util[_0xb4db('0x23')](_0xb4db('0x69'),_0x5bc493[_0xb4db('0x57')]);if(_0xa0baeb&&_0xa0baeb[_0xb4db('0x6a')]&&_0xa0baeb['recordingFormat']!==_0xb4db('0x6b')){logger['info'](_0xb4db('0x6c'),'Recording\x20is\x20enabled!');_0x243785[_0xb4db('0x5a')]=util['format'](_0xb4db('0x5b'),_0x5bc493[_0xb4db('0x55')],_0x243785[_0xb4db('0x5c')],md5(_0x243785[_0xb4db('0x5c')]));}return getConnection(_0x5bc493)[_0xb4db('0x2c')](function(_0x380a04){_0x348098=_0x380a04;return getUser(_0x5bc493,_0xc7480b[_0xb4db('0xe')],_0x348098);})[_0xb4db('0x2c')](function(_0x285546){_0x471e0f=_0x285546;logger[_0xb4db('0x28')]('The\x20User\x20ID\x20is:',_0x471e0f['id']);return getEndUser(_0x5bc493,_0x243785[_0xb4db('0x6d')],_0x243785[_0xb4db('0x6e')],_0x348098);})[_0xb4db('0x2c')](function(_0xe945de){_0x4344ad=_0xe945de;logger['info'](_0xb4db('0x6f'),_0x4344ad['id']);return getTicket(_0x5bc493,_0x471e0f,_0x4344ad,_0x519e1b,_0x243785,_0x519e1b[_0xb4db('0x70')],_0x348098,_0xb4db('0x71'));})['then'](function(_0x182dfb){_0x53ef89=_0x182dfb;logger[_0xb4db('0x28')](_0xb4db('0x60'));logger[_0xb4db('0x28')](_0xb4db('0x72'),_0x53ef89['id']);return setRelationship(_0x348098,_0x471e0f,_0x53ef89,'users');})[_0xb4db('0x2c')](function(){return setRelationship(_0x348098,_0x4344ad,_0x53ef89,_0xb4db('0x62'));})[_0xb4db('0x2c')](function(){return getServerInfo(_0x348098);})[_0xb4db('0x2c')](function(_0x8b0f8){var _0x279d4e=parseInt(_0x8b0f8['version']['charAt'](0x0));var _0x2a4db4=util[_0xb4db('0x23')](_0xb4db('0x64'),_0x5bc493[_0xb4db('0x57')],_0x53ef89['id']);if(_0x279d4e>0x6){_0x2a4db4=util[_0xb4db('0x23')](_0xb4db('0x65'),_0x5bc493[_0xb4db('0x57')],_0x53ef89['id']);}logger[_0xb4db('0x28')](_0xb4db('0x6c'),_0xb4db('0x73'));emit(util['format'](_0xb4db('0x66'),_0xc7480b[_0xb4db('0xe')]),_0xb4db('0x67'),{'uri':_0x2a4db4});})[_0xb4db('0x74')](function(_0x712c6a){logger[_0xb4db('0x75')](_0xb4db('0x6c'),JSON[_0xb4db('0x21')](_0x712c6a));});};exports[_0xb4db('0x76')]=function(_0x2e3176,_0x2fe6fb,_0xf58e56,_0x49d817,_0x191377,_0x578d33){var _0x43396f,_0x59b487,_0x5f38df,_0x46547c;_0x578d33[_0xb4db('0x57')]=intUtil[_0xb4db('0x54')](_0x578d33[_0xb4db('0x57')]);_0x578d33[_0xb4db('0x55')]=intUtil[_0xb4db('0x54')](_0x578d33[_0xb4db('0x55')]);def[_0xb4db('0x56')]=util[_0xb4db('0x23')]('%s/service/v4_1/rest.php',_0x578d33[_0xb4db('0x57')]);if(_0x191377&&_0x191377[_0xb4db('0x58')]){logger[_0xb4db('0x28')]('['+_0x2fe6fb['lastevent']['toUpperCase']()+']',_0xb4db('0x77'));_0x2fe6fb[_0xb4db('0x5a')]=util[_0xb4db('0x23')](_0xb4db('0x5b'),_0x578d33[_0xb4db('0x55')],_0x2fe6fb[_0xb4db('0x5c')],md5(_0x2fe6fb[_0xb4db('0x5c')]));}else{_0x2fe6fb[_0xb4db('0x5a')]='';}return getConnection(_0x578d33)[_0xb4db('0x2c')](function(_0x1e724e){_0x46547c=_0x1e724e;if(!_[_0xb4db('0x27')](_0x49d817)){return getUser(_0x578d33,_0x49d817[_0xb4db('0xe')],_0x46547c);}else{return getUser(_0x578d33,null,_0x46547c);}})[_0xb4db('0x2c')](function(_0x4f08a1){_0x43396f=_0x4f08a1;logger['info'](_0xb4db('0x78'),_0x43396f['id']);return getEndUser(_0x578d33,_0x2fe6fb[_0xb4db('0x5d')],_0x2fe6fb[_0xb4db('0x5e')],_0x46547c);})[_0xb4db('0x2c')](function(_0xb2e175){_0x59b487=_0xb2e175;logger['info'](_0xb4db('0x6f'),_0x59b487['id']);return getTicket(_0x578d33,_0x43396f,_0x59b487,_0xf58e56,_0x2fe6fb,_0xf58e56[_0xb4db('0x70')],_0x46547c,_0xb4db('0x5f'));})['then'](function(_0x260173){_0x5f38df=_0x260173;logger[_0xb4db('0x28')](_0xb4db('0x60'));logger['info'](_0xb4db('0x72'),_0x5f38df['id']);return setRelationship(_0x46547c,_0x43396f,_0x5f38df,_0xb4db('0x61'));})['then'](function(){return setRelationship(_0x46547c,_0x59b487,_0x5f38df,_0xb4db('0x62'));})[_0xb4db('0x2c')](function(){return getServerInfo(_0x46547c);})[_0xb4db('0x74')](function(_0x4928ab){logger[_0xb4db('0x75')]('['+_0x2fe6fb[_0xb4db('0x79')][_0xb4db('0x7a')]()+']',JSON[_0xb4db('0x21')](_0x4928ab));});}; \ 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 8d570c1..2926155 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 _0xff28=['variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','lodash','util','getString','type','string','variable'];(function(_0x111965,_0x10234f){var _0x2b6d43=function(_0x58d79b){while(--_0x58d79b){_0x111965['push'](_0x111965['shift']());}};_0x2b6d43(++_0x10234f);}(_0xff28,0xc2));var _0x8ff2=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0xff28[_0x221b8c];return _0x3fab9f;};'use strict';var _=require(_0x8ff2('0x0'));var util=require(_0x8ff2('0x1'));exports[_0x8ff2('0x2')]=function(_0x36ac09,_0x19c21b,_0x552724){var _0x204244=[];if(_0x36ac09['length']>0x0){var _0x295e1a=_['sortBy'](_0x36ac09,['id']);for(var _0x2c1155=0x0;_0x2c1155<_0x295e1a['length'];_0x2c1155++){var _0x143a28=_0x295e1a[_0x2c1155];if(_0x143a28[_0x8ff2('0x3')]===_0x8ff2('0x4')){_0x204244['push'](_0x143a28['content']);}else if(_0x143a28[_0x8ff2('0x3')]===_0x8ff2('0x5')&&_0x143a28['variableName']){_0x19c21b[_0x143a28[_0x8ff2('0x6')]]&&_0x204244[_0x8ff2('0x7')](_0x19c21b[_0x143a28[_0x8ff2('0x6')]][_0x8ff2('0x8')]());}else if(_0x143a28[_0x8ff2('0x3')]===_0x8ff2('0x9')&&_0x143a28[_0x8ff2('0xa')]&&_0x143a28[_0x8ff2('0xa')]['name']){_0x19c21b[_0x143a28[_0x8ff2('0xa')][_0x8ff2('0xb')][_0x8ff2('0xc')]()]&&_0x204244['push'](_0x19c21b[_0x143a28[_0x8ff2('0xa')][_0x8ff2('0xb')]['toLowerCase']()][_0x8ff2('0x8')]());}else if(_0x143a28[_0x8ff2('0x3')]===_0x8ff2('0xd')){if(_0x143a28['keyType']===_0x8ff2('0x4')&&_0x143a28[_0x8ff2('0xe')]){_0x204244[_0x8ff2('0x7')](util[_0x8ff2('0xf')](_0x8ff2('0x10'),_0x143a28[_0x8ff2('0xe')],_0x143a28[_0x8ff2('0x11')]));}else if(_0x143a28[_0x8ff2('0x12')]===_0x8ff2('0x5')&&_0x143a28[_0x8ff2('0x6')]&&_0x143a28[_0x8ff2('0xe')]){_0x19c21b[_0x143a28['variableName']]&&_0x204244[_0x8ff2('0x7')](util['format'](_0x8ff2('0x10'),_0x143a28[_0x8ff2('0xe')],_0x19c21b[_0x143a28[_0x8ff2('0x6')]]));}else if(_0x143a28[_0x8ff2('0x12')]===_0x8ff2('0x9')&&_0x143a28[_0x8ff2('0xa')]&&_0x143a28[_0x8ff2('0xa')][_0x8ff2('0xb')]&&_0x143a28[_0x8ff2('0xe')]){_0x19c21b[_0x143a28['Variable']['name'][_0x8ff2('0xc')]()]&&_0x204244[_0x8ff2('0x7')](util[_0x8ff2('0xf')](_0x8ff2('0x10'),_0x143a28[_0x8ff2('0xe')],_0x19c21b[_0x143a28[_0x8ff2('0xa')]['name'][_0x8ff2('0xc')]()]));}}}}return _0x204244[_0x8ff2('0x13')](_0x552724);};exports[_0x8ff2('0x14')]=function(_0x1a5281){var _0x4b6dfb=_0x1a5281[_0x8ff2('0x15')](-0x1);if(_0x4b6dfb==='/'){_0x1a5281=_0x1a5281[_0x8ff2('0x16')](0x0,_0x1a5281[_0x8ff2('0x17')](_0x4b6dfb));}return _0x1a5281;};exports['validateEmail']=function(_0x54a762){if(!_[_0x8ff2('0x18')](_0x54a762)&&_0x54a762!==''){var _0x3dfea0=/^(([^<>()\[\]\\.,;:\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 _0x3dfea0['test'](String(_0x54a762)[_0x8ff2('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x98de=['type','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string'];(function(_0x1254e1,_0x509caa){var _0x37c7e1=function(_0x106be3){while(--_0x106be3){_0x1254e1['push'](_0x1254e1['shift']());}};_0x37c7e1(++_0x509caa);}(_0x98de,0xda));var _0xe98d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x98de[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe98d('0x0'));var util=require(_0xe98d('0x1'));exports[_0xe98d('0x2')]=function(_0x516cad,_0x2329d9,_0x5f5df3){var _0x1f3c4f=[];if(_0x516cad[_0xe98d('0x3')]>0x0){var _0x12486f=_[_0xe98d('0x4')](_0x516cad,['id']);for(var _0x4d841c=0x0;_0x4d841c<_0x12486f[_0xe98d('0x3')];_0x4d841c++){var _0x4d11e6=_0x12486f[_0x4d841c];if(_0x4d11e6['type']===_0xe98d('0x5')){_0x1f3c4f['push'](_0x4d11e6['content']);}else if(_0x4d11e6[_0xe98d('0x6')]===_0xe98d('0x7')&&_0x4d11e6[_0xe98d('0x8')]){_0x2329d9[_0x4d11e6[_0xe98d('0x8')]]&&_0x1f3c4f[_0xe98d('0x9')](_0x2329d9[_0x4d11e6['variableName']][_0xe98d('0xa')]());}else if(_0x4d11e6[_0xe98d('0x6')]===_0xe98d('0xb')&&_0x4d11e6[_0xe98d('0xc')]&&_0x4d11e6[_0xe98d('0xc')][_0xe98d('0xd')]){_0x2329d9[_0x4d11e6[_0xe98d('0xc')]['name'][_0xe98d('0xe')]()]&&_0x1f3c4f[_0xe98d('0x9')](_0x2329d9[_0x4d11e6['Variable'][_0xe98d('0xd')][_0xe98d('0xe')]()]['toString']());}else if(_0x4d11e6['type']===_0xe98d('0xf')){if(_0x4d11e6[_0xe98d('0x10')]===_0xe98d('0x5')&&_0x4d11e6['key']){_0x1f3c4f[_0xe98d('0x9')](util[_0xe98d('0x11')](_0xe98d('0x12'),_0x4d11e6[_0xe98d('0x13')],_0x4d11e6[_0xe98d('0x14')]));}else if(_0x4d11e6[_0xe98d('0x10')]===_0xe98d('0x7')&&_0x4d11e6[_0xe98d('0x8')]&&_0x4d11e6[_0xe98d('0x13')]){_0x2329d9[_0x4d11e6['variableName']]&&_0x1f3c4f['push'](util[_0xe98d('0x11')](_0xe98d('0x12'),_0x4d11e6[_0xe98d('0x13')],_0x2329d9[_0x4d11e6['variableName']]));}else if(_0x4d11e6['keyType']===_0xe98d('0xb')&&_0x4d11e6['Variable']&&_0x4d11e6['Variable'][_0xe98d('0xd')]&&_0x4d11e6[_0xe98d('0x13')]){_0x2329d9[_0x4d11e6['Variable'][_0xe98d('0xd')]['toLowerCase']()]&&_0x1f3c4f[_0xe98d('0x9')](util[_0xe98d('0x11')](_0xe98d('0x12'),_0x4d11e6[_0xe98d('0x13')],_0x2329d9[_0x4d11e6[_0xe98d('0xc')][_0xe98d('0xd')][_0xe98d('0xe')]()]));}}}}return _0x1f3c4f[_0xe98d('0x15')](_0x5f5df3);};exports[_0xe98d('0x16')]=function(_0x377ecc){var _0x303700=_0x377ecc['slice'](-0x1);if(_0x303700==='/'){_0x377ecc=_0x377ecc[_0xe98d('0x17')](0x0,_0x377ecc[_0xe98d('0x18')](_0x303700));}return _0x377ecc;};exports[_0xe98d('0x19')]=function(_0x4ff00d){if(!_[_0xe98d('0x1a')](_0x4ff00d)&&_0x4ff00d!==''){var _0x21ae2b=/^(([^<>()\[\]\\.,;:\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 _0x21ae2b[_0xe98d('0x1b')](String(_0x4ff00d)[_0xe98d('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index fcc6749..a0ec24c 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x369db7,_0x533389){var _0x389d97=function(_0x368b1a){while(--_0x368b1a){_0x369db7['push'](_0x369db7['shift']());}};_0x389d97(++_0x533389);}(_0x34e8,0x12c));var _0x834e=function(_0x3235a0,_0x5ced88){_0x3235a0=_0x3235a0-0x0;var _0xffd58=_0x34e8[_0x3235a0];return _0xffd58;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 0179b16..acf3ffa 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 _0xd35f=['emit','application/json','info','Creating\x20new\x20ticket...','format','POST','Tags','Descriptions','getString','Fields','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','remoteUri','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','authType','password','%s:%s','token','%s/token:%s','username','toString','base64','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridnum','newTab','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter'];(function(_0x5b2626,_0xae0c77){var _0x54c381=function(_0xd57015){while(--_0xd57015){_0x5b2626['push'](_0x5b2626['shift']());}};_0x54c381(++_0xae0c77);}(_0xd35f,0x1a8));var _0xfd35=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0xd35f[_0x14b767];return _0x22267a;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xfd35('0x0'));var util=require(_0xfd35('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xfd35('0x2'));var logger=require(_0xfd35('0x3'))(_0xfd35('0x4'));config[_0xfd35('0x5')]=_['defaults'](config[_0xfd35('0x5')],{'host':_0xfd35('0x6'),'port':0x18eb});var io=require(_0xfd35('0x7'))(new Redis(config[_0xfd35('0x5')]));function emit(_0x4161d9,_0x9021a7,_0x35a253){io['to'](_0x4161d9)[_0xfd35('0x8')](_0x9021a7,_0x35a253);}var headers={'Content-Type':_0xfd35('0x9'),'Accept':_0xfd35('0x9')};function getTicket(_0x588d13,_0x59d994,_0x55b003,_0x4c5271,_0x1daf83){logger[_0xfd35('0xa')](_0xfd35('0xb'));return request({'uri':util[_0xfd35('0xc')]('%s/tickets.json',_0x588d13['remoteUri']),'method':_0xfd35('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x55b003['id'],'submitter_id':_0x59d994?_0x59d994['id']:undefined,'assignee_id':_0x59d994?_0x59d994['id']:undefined,'tags':getTags(_0x4c5271[_0xfd35('0xe')],'name'),'subject':intUtil['getString'](_0x4c5271['Subjects'],_0x1daf83,'\x20'),'description':intUtil['getString'](_0x4c5271[_0xfd35('0xf')],_0x1daf83,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfd35('0x10')](_0x4c5271[_0xfd35('0xf')],_0x1daf83,'\x0a')}},getCustomFields(_0x4c5271[_0xfd35('0x11')],_0x1daf83))}})['then'](function(_0x51337c){logger[_0xfd35('0xa')]('Ticket\x20created!');return _0x51337c[_0xfd35('0x12')];});}function getUser(_0x22c46d,_0x22a91c){if(intUtil[_0xfd35('0x13')](_0x22a91c)){logger[_0xfd35('0xa')](_0xfd35('0x14'),_0x22a91c);return request({'uri':util[_0xfd35('0xc')](_0xfd35('0x15'),_0x22c46d['remoteUri']),'qs':{'query':util[_0xfd35('0xc')](_0xfd35('0x16'),_0x22a91c)}})[_0xfd35('0x17')](function(_0x431657){if(_0x431657[_0xfd35('0x18')]){logger[_0xfd35('0xa')](_0xfd35('0x19'));return _['find'](_0x431657[_0xfd35('0x1a')],{'email':_0x22a91c,'role':'agent'});}else{logger[_0xfd35('0xa')](_0xfd35('0x1b'));return request({'uri':util['format']('%s/users/me.json',_0x22c46d['remoteUri'])})[_0xfd35('0x17')](function(_0xa681c3){logger[_0xfd35('0xa')]('Admin\x20account\x20selected.');return _0xa681c3[_0xfd35('0x1c')];});}});}else{logger[_0xfd35('0xa')](_0xfd35('0x1b'));return request({'uri':util[_0xfd35('0xc')](_0xfd35('0x1d'),_0x22c46d['remoteUri'])})['then'](function(_0x1408a7){logger[_0xfd35('0xa')](_0xfd35('0x1e'));return _0x1408a7[_0xfd35('0x1c')];});}}function getEndUser(_0xd15535,_0x835e19,_0x1f54ee){logger[_0xfd35('0xa')](_0xfd35('0x1f'),_0x1f54ee);return request({'uri':util[_0xfd35('0xc')](_0xfd35('0x15'),_0xd15535[_0xfd35('0x20')]),'qs':{'query':util[_0xfd35('0xc')](_0xfd35('0x21'),_0x1f54ee)}})[_0xfd35('0x17')](function(_0x2a14ef){var _0x1f7707;if(_0x2a14ef[_0xfd35('0x1a')][_0xfd35('0x22')]){_0x2a14ef[_0xfd35('0x1a')]=_['filter'](_0x2a14ef[_0xfd35('0x1a')],{'suspended':![],'role':_0xfd35('0x23')});if(_0x2a14ef[_0xfd35('0x1a')][_0xfd35('0x22')]){_0x1f7707=_[_0xfd35('0x24')](_0x2a14ef[_0xfd35('0x1a')]);}}if(_0x1f7707){logger['info'](_0xfd35('0x25'));return _0x1f7707;}else{logger[_0xfd35('0xa')](_0xfd35('0x26'));return request({'uri':util['format'](_0xfd35('0x27'),_0xd15535[_0xfd35('0x20')]),'method':_0xfd35('0xd'),'body':{'user':{'role':_0xfd35('0x23'),'name':util[_0xfd35('0xc')](_0xfd35('0x28'),_0x835e19||_0x1f54ee),'phone':_0x1f54ee}}})[_0xfd35('0x17')](function(_0x3764ee){logger[_0xfd35('0xa')]('Enduser\x20created.');return _0x3764ee['user'];});}});}function getAuth(_0x2729df){var _0x428a5a;if(_0x2729df[_0xfd35('0x29')]===_0xfd35('0x2a')){_0x428a5a=util[_0xfd35('0xc')](_0xfd35('0x2b'),_0x2729df['username'],_0x2729df[_0xfd35('0x2a')]);}else if(_0x2729df[_0xfd35('0x29')]===_0xfd35('0x2c')){_0x428a5a=util[_0xfd35('0xc')](_0xfd35('0x2d'),_0x2729df[_0xfd35('0x2e')],_0x2729df[_0xfd35('0x2c')]);}return util[_0xfd35('0xc')]('Basic\x20%s',new Buffer(_0x428a5a)[_0xfd35('0x2f')](_0xfd35('0x30')));}function request(_0x9dae4e){logger['debug']('[HTTP]',JSON[_0xfd35('0x31')](_0x9dae4e));return rp(_[_0xfd35('0x32')](_0x9dae4e,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4cbc38,_0x15c971){var _0x3298ee=[];if(_0x4cbc38&&_0x4cbc38[_0xfd35('0x22')]>0x0){_0x3298ee=_[_0xfd35('0x33')](_0x4cbc38,_0x15c971);}return _0x3298ee;}function getCustomFields(_0x138a78,_0x24d866){var _0x3cfa58=[];var _0x3df9bd={'custom_fields':[]};if(_0x138a78[_0xfd35('0x22')]>0x0){_[_0xfd35('0x34')](_0x138a78,function(_0x368dd3){if(_[_0xfd35('0x35')]([_0xfd35('0x36'),_0xfd35('0x37')],_0x368dd3[_0xfd35('0x38')])&&_0x368dd3[_0xfd35('0x39')]&&!_0x368dd3['customField']){_0x3df9bd[_0x368dd3['nameField'][_0xfd35('0x3a')]()]=_0x368dd3[_0xfd35('0x3b')][_0xfd35('0x2f')]();}else if(_[_0xfd35('0x35')](['string',_0xfd35('0x37')],_0x368dd3[_0xfd35('0x38')])&&_0x368dd3[_0xfd35('0x3c')]&&_0x368dd3[_0xfd35('0x3d')]){_0x3df9bd[_0xfd35('0x3e')][_0xfd35('0x3f')]({'id':_0x368dd3['idField'],'value':_0x368dd3[_0xfd35('0x3b')][_0xfd35('0x2f')]()});}else if(_0x368dd3['type']===_0xfd35('0x40')&&_0x368dd3[_0xfd35('0x41')]&&_0x368dd3['idField']&&_0x368dd3[_0xfd35('0x3d')]){_0x24d866[_0x368dd3[_0xfd35('0x41')]]&&_0x3df9bd['custom_fields'][_0xfd35('0x3f')]({'id':_0x368dd3['idField'],'value':_0x24d866[_0x368dd3[_0xfd35('0x41')]][_0xfd35('0x2f')]()});}else if(_0x368dd3[_0xfd35('0x38')]===_0xfd35('0x42')&&_0x368dd3[_0xfd35('0x43')]&&_0x368dd3[_0xfd35('0x43')][_0xfd35('0x44')]&&_0x368dd3[_0xfd35('0x3c')]&&_0x368dd3[_0xfd35('0x3d')]){_0x24d866[_0x368dd3[_0xfd35('0x43')][_0xfd35('0x44')]['toLowerCase']()]&&_0x3df9bd[_0xfd35('0x3e')][_0xfd35('0x3f')]({'id':_0x368dd3[_0xfd35('0x3c')],'value':_0x24d866[_0x368dd3[_0xfd35('0x43')][_0xfd35('0x44')]['toLowerCase']()][_0xfd35('0x2f')]()});}});}return _0x3df9bd;}exports['queue']=function(_0x17ce5b,_0x2295c5,_0x15352d,_0xf68838,_0x2a0520,_0x284e5f){var _0x147b92,_0x296d6d;_0x284e5f[_0xfd35('0x20')]=intUtil[_0xfd35('0x45')](_0x284e5f[_0xfd35('0x20')]);_0x284e5f['serverUrl']=intUtil[_0xfd35('0x45')](_0x284e5f[_0xfd35('0x46')]);if(_0x2a0520&&_0x2a0520[_0xfd35('0x47')]){logger[_0xfd35('0xa')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2295c5[_0xfd35('0x48')]=util['format'](_0xfd35('0x49'),_0x284e5f['serverUrl'],_0x2295c5[_0xfd35('0x4a')],md5(_0x2295c5[_0xfd35('0x4a')]));}else{_0x2295c5[_0xfd35('0x48')]='';}headers[_0xfd35('0x4b')]=getAuth(_0x284e5f);return getUser(_0x284e5f,_0xf68838['email'])['then'](function(_0x496b86){_0x147b92=_0x496b86;logger[_0xfd35('0xa')]('The\x20User\x20ID\x20is:',_0x147b92['id']);return getEndUser(_0x284e5f,_0x2295c5[_0xfd35('0x4c')],_0x2295c5[_0xfd35('0x4d')]);})[_0xfd35('0x17')](function(_0x390c05){_0x296d6d=_0x390c05;logger[_0xfd35('0xa')](_0xfd35('0x4e'),_0x296d6d['id']);return getTicket(_0x284e5f,_0x147b92,_0x296d6d,_0x15352d,_0x2295c5);})['then'](function(_0x246083){if(_0x246083){logger['info'](_0xfd35('0x4f'),_0x246083['id']);switch(_0x284e5f[_0xfd35('0x38')]){case _0xfd35('0x50'):logger[_0xfd35('0xa')](_0xfd35('0x51'),_0xfd35('0x52'));return request({'uri':util[_0xfd35('0xc')](_0xfd35('0x53'),_0x284e5f['remoteUri'],_0x147b92['id'],_0x246083['id']),'method':'POST'});case'newTab':logger[_0xfd35('0xa')](_0xfd35('0x51'),_0xfd35('0x54'));emit(util[_0xfd35('0xc')](_0xfd35('0x55'),_0xf68838['name']),_0xfd35('0x56'),{'uri':util['format'](_0xfd35('0x57'),_0x284e5f[_0xfd35('0x20')]['replace'](_0xfd35('0x58'),''),_0x246083['id'])});break;default:logger[_0xfd35('0x59')](_0xfd35('0x51'),_0xfd35('0x5a'));}}})[_0xfd35('0x5b')](function(_0x41c5a6){logger['error'](_0xfd35('0x5c'),util['inspect'](_0x41c5a6,{'showHidden':!![],'depth':null}));});};exports[_0xfd35('0x5d')]=function(_0x1ff543,_0x188456,_0x11b32f,_0x212cab,_0x1af1f5,_0x1bb1cf,_0xcbf78d){var _0x31b149,_0x2e4119;_0x1bb1cf[_0xfd35('0x20')]=intUtil['stripTrailingSlash'](_0x1bb1cf['remoteUri']);_0x1bb1cf['serverUrl']=intUtil['stripTrailingSlash'](_0x1bb1cf[_0xfd35('0x46')]);if(_0xcbf78d&&_0xcbf78d[_0xfd35('0x5e')]&&_0xcbf78d[_0xfd35('0x5e')]!==_0xfd35('0x5f')){logger[_0xfd35('0xa')](_0xfd35('0x60'),'Recording\x20is\x20enabled!');_0x188456[_0xfd35('0x48')]=util[_0xfd35('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bb1cf[_0xfd35('0x46')],_0x188456[_0xfd35('0x4a')],md5(_0x188456[_0xfd35('0x4a')]));}headers[_0xfd35('0x4b')]=getAuth(_0x1bb1cf);return getUser(_0x1bb1cf,_0x212cab[_0xfd35('0x61')])['then'](function(_0x59af50){_0x31b149=_0x59af50;logger[_0xfd35('0xa')](_0xfd35('0x62'),_0x31b149['id']);return getEndUser(_0x1bb1cf,_0x188456['destcalleridname'],_0x188456[_0xfd35('0x63')]);})[_0xfd35('0x17')](function(_0x249149){_0x2e4119=_0x249149;logger['info'](_0xfd35('0x4e'),_0x2e4119['id']);return getTicket(_0x1bb1cf,_0x31b149,_0x2e4119,_0x11b32f,_0x188456);})['then'](function(_0x202776){if(_0x202776){logger[_0xfd35('0xa')](_0xfd35('0x4f'),_0x202776['id']);switch(_0x1bb1cf['type']){case _0xfd35('0x50'):logger[_0xfd35('0xa')](_0xfd35('0x60'),_0xfd35('0x52'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1bb1cf[_0xfd35('0x20')],_0x31b149['id'],_0x202776['id']),'method':_0xfd35('0xd')});case _0xfd35('0x64'):logger['info'](_0xfd35('0x60'),_0xfd35('0x54'));emit(util['format'](_0xfd35('0x55'),_0x212cab[_0xfd35('0x44')]),_0xfd35('0x56'),{'uri':util['format'](_0xfd35('0x57'),_0x1bb1cf[_0xfd35('0x20')][_0xfd35('0x65')]('/api/v2',''),_0x202776['id'])});break;default:logger[_0xfd35('0x59')](_0xfd35('0x60'),_0xfd35('0x5a'));}}})[_0xfd35('0x5b')](function(_0x1610ae){logger[_0xfd35('0x59')](_0xfd35('0x66'),util[_0xfd35('0x67')](_0x1610ae,{'showHidden':!![],'depth':null}));});};exports[_0xfd35('0x68')]=function(_0x4ac50e,_0x6fd649,_0x5cbd4c,_0x22e201,_0x2fe5d7,_0x2bbc2c){var _0x4de6eb,_0x41a64e;_0x2bbc2c['remoteUri']=intUtil[_0xfd35('0x45')](_0x2bbc2c[_0xfd35('0x20')]);_0x2bbc2c[_0xfd35('0x46')]=intUtil[_0xfd35('0x45')](_0x2bbc2c['serverUrl']);if(_0x2fe5d7&&_0x2fe5d7[_0xfd35('0x47')]){logger[_0xfd35('0xa')]('['+_0x6fd649[_0xfd35('0x69')][_0xfd35('0x6a')]()+']','Recording\x20is\x20enabled!');_0x6fd649[_0xfd35('0x48')]=util['format'](_0xfd35('0x49'),_0x2bbc2c[_0xfd35('0x46')],_0x6fd649[_0xfd35('0x4a')],md5(_0x6fd649['uniqueid']));}else{_0x6fd649[_0xfd35('0x48')]='';}headers[_0xfd35('0x4b')]=getAuth(_0x2bbc2c);return getUser(_0x2bbc2c)['then'](function(_0x5e0567){_0x4de6eb=_0x5e0567;logger[_0xfd35('0xa')](_0xfd35('0x62'),_0x4de6eb['id']);return getEndUser(_0x2bbc2c,_0x6fd649['calleridname'],_0x6fd649[_0xfd35('0x4d')]);})['then'](function(_0xcb7619){_0x41a64e=_0xcb7619;logger[_0xfd35('0xa')]('The\x20Enduser\x20ID\x20is:',_0x41a64e['id']);return getTicket(_0x2bbc2c,_0x4de6eb,_0x41a64e,_0x5cbd4c,_0x6fd649);})[_0xfd35('0x17')](function(_0x5da554){if(_0x5da554){logger[_0xfd35('0xa')]('The\x20Ticket\x20ID\x20is:',_0x5da554['id']);}})['catch'](function(_0x42e51a){logger[_0xfd35('0x59')]('['+_0x6fd649['lastevent'][_0xfd35('0x6a')]()+']'+_0xfd35('0x6b'),util[_0xfd35('0x67')](_0x42e51a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6caf=['ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','lastevent','toUpperCase','Authorization','lodash','request-promise','md5','util'];(function(_0x303549,_0x558d0f){var _0x3d908f=function(_0x17ad84){while(--_0x17ad84){_0x303549['push'](_0x303549['shift']());}};_0x3d908f(++_0x558d0f);}(_0x6caf,0x158));var _0xf6ca=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x6caf[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0xf6ca('0x0'));var rp=require(_0xf6ca('0x1'));var md5=require(_0xf6ca('0x2'));var util=require(_0xf6ca('0x3'));var Redis=require(_0xf6ca('0x4'));var intUtil=require(_0xf6ca('0x5'));var config=require(_0xf6ca('0x6'));var logger=require(_0xf6ca('0x7'))('zendesk');config[_0xf6ca('0x8')]=_[_0xf6ca('0x9')](config['redis'],{'host':_0xf6ca('0xa'),'port':0x18eb});var io=require(_0xf6ca('0xb'))(new Redis(config['redis']));function emit(_0x3bb73f,_0x449a4e,_0x4b12e7){io['to'](_0x3bb73f)[_0xf6ca('0xc')](_0x449a4e,_0x4b12e7);}var headers={'Content-Type':_0xf6ca('0xd'),'Accept':'application/json'};function getTicket(_0x72f2a6,_0x30f398,_0x5dc5b7,_0x193025,_0x535fb2){logger[_0xf6ca('0xe')](_0xf6ca('0xf'));return request({'uri':util[_0xf6ca('0x10')](_0xf6ca('0x11'),_0x72f2a6[_0xf6ca('0x12')]),'method':_0xf6ca('0x13'),'body':{'ticket':_[_0xf6ca('0x14')]({'requester_id':_0x5dc5b7['id'],'submitter_id':_0x30f398?_0x30f398['id']:undefined,'assignee_id':_0x30f398?_0x30f398['id']:undefined,'tags':getTags(_0x193025['Tags'],_0xf6ca('0x15')),'subject':intUtil[_0xf6ca('0x16')](_0x193025['Subjects'],_0x535fb2,'\x20'),'description':intUtil[_0xf6ca('0x16')](_0x193025[_0xf6ca('0x17')],_0x535fb2,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf6ca('0x16')](_0x193025[_0xf6ca('0x17')],_0x535fb2,'\x0a')}},getCustomFields(_0x193025[_0xf6ca('0x18')],_0x535fb2))}})['then'](function(_0x42ff96){logger[_0xf6ca('0xe')](_0xf6ca('0x19'));return _0x42ff96[_0xf6ca('0x1a')];});}function getUser(_0x1ce357,_0x3601cc){if(intUtil[_0xf6ca('0x1b')](_0x3601cc)){logger['info']('Getting\x20agent\x20with\x20email',_0x3601cc);return request({'uri':util[_0xf6ca('0x10')]('%s/search.json',_0x1ce357[_0xf6ca('0x12')]),'qs':{'query':util[_0xf6ca('0x10')](_0xf6ca('0x1c'),_0x3601cc)}})[_0xf6ca('0x1d')](function(_0x31e292){if(_0x31e292[_0xf6ca('0x1e')]){logger[_0xf6ca('0xe')](_0xf6ca('0x1f'));return _[_0xf6ca('0x20')](_0x31e292[_0xf6ca('0x21')],{'email':_0x3601cc,'role':_0xf6ca('0x22')});}else{logger[_0xf6ca('0xe')](_0xf6ca('0x23'));return request({'uri':util[_0xf6ca('0x10')](_0xf6ca('0x24'),_0x1ce357[_0xf6ca('0x12')])})['then'](function(_0x26568c){logger[_0xf6ca('0xe')](_0xf6ca('0x25'));return _0x26568c[_0xf6ca('0x26')];});}});}else{logger[_0xf6ca('0xe')](_0xf6ca('0x23'));return request({'uri':util[_0xf6ca('0x10')](_0xf6ca('0x24'),_0x1ce357[_0xf6ca('0x12')])})[_0xf6ca('0x1d')](function(_0x187f5c){logger[_0xf6ca('0xe')](_0xf6ca('0x25'));return _0x187f5c[_0xf6ca('0x26')];});}}function getEndUser(_0x56b2fc,_0xd6ee,_0x339e3c){logger['info'](_0xf6ca('0x27'),_0x339e3c);return request({'uri':util[_0xf6ca('0x10')]('%s/search.json',_0x56b2fc[_0xf6ca('0x12')]),'qs':{'query':util['format'](_0xf6ca('0x28'),_0x339e3c)}})[_0xf6ca('0x1d')](function(_0x3b7407){var _0x42b693;if(_0x3b7407[_0xf6ca('0x21')]['length']){_0x3b7407[_0xf6ca('0x21')]=_[_0xf6ca('0x29')](_0x3b7407[_0xf6ca('0x21')],{'suspended':![],'role':_0xf6ca('0x2a')});if(_0x3b7407[_0xf6ca('0x21')][_0xf6ca('0x2b')]){_0x42b693=_[_0xf6ca('0x2c')](_0x3b7407[_0xf6ca('0x21')]);}}if(_0x42b693){logger['info'](_0xf6ca('0x2d'));return _0x42b693;}else{logger[_0xf6ca('0xe')](_0xf6ca('0x2e'));return request({'uri':util['format'](_0xf6ca('0x2f'),_0x56b2fc[_0xf6ca('0x12')]),'method':_0xf6ca('0x13'),'body':{'user':{'role':'end-user','name':util[_0xf6ca('0x10')]('Caller\x20-\x20%s',_0xd6ee||_0x339e3c),'phone':_0x339e3c}}})[_0xf6ca('0x1d')](function(_0x23d345){logger['info'](_0xf6ca('0x30'));return _0x23d345[_0xf6ca('0x26')];});}});}function getAuth(_0x4528b6){var _0x791b9b;if(_0x4528b6[_0xf6ca('0x31')]===_0xf6ca('0x32')){_0x791b9b=util[_0xf6ca('0x10')](_0xf6ca('0x33'),_0x4528b6[_0xf6ca('0x34')],_0x4528b6['password']);}else if(_0x4528b6[_0xf6ca('0x31')]===_0xf6ca('0x35')){_0x791b9b=util[_0xf6ca('0x10')](_0xf6ca('0x36'),_0x4528b6[_0xf6ca('0x34')],_0x4528b6['token']);}return util[_0xf6ca('0x10')]('Basic\x20%s',new Buffer(_0x791b9b)[_0xf6ca('0x37')](_0xf6ca('0x38')));}function request(_0xe6f62e){logger[_0xf6ca('0x39')](_0xf6ca('0x3a'),JSON['stringify'](_0xe6f62e));return rp(_['defaults'](_0xe6f62e,{'method':_0xf6ca('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x4524f4,_0x4375cf){var _0x196360=[];if(_0x4524f4&&_0x4524f4['length']>0x0){_0x196360=_[_0xf6ca('0x3c')](_0x4524f4,_0x4375cf);}return _0x196360;}function getCustomFields(_0x8b8877,_0x3cd6e8){var _0x447b81=[];var _0x2fe802={'custom_fields':[]};if(_0x8b8877[_0xf6ca('0x2b')]>0x0){_[_0xf6ca('0x3d')](_0x8b8877,function(_0x368ec0){if(_[_0xf6ca('0x3e')]([_0xf6ca('0x3f'),_0xf6ca('0x40')],_0x368ec0['type'])&&_0x368ec0[_0xf6ca('0x41')]&&!_0x368ec0[_0xf6ca('0x42')]){_0x2fe802[_0x368ec0[_0xf6ca('0x41')][_0xf6ca('0x43')]()]=_0x368ec0[_0xf6ca('0x44')][_0xf6ca('0x37')]();}else if(_[_0xf6ca('0x3e')]([_0xf6ca('0x3f'),_0xf6ca('0x40')],_0x368ec0[_0xf6ca('0x45')])&&_0x368ec0[_0xf6ca('0x46')]&&_0x368ec0[_0xf6ca('0x42')]){_0x2fe802[_0xf6ca('0x47')][_0xf6ca('0x48')]({'id':_0x368ec0[_0xf6ca('0x46')],'value':_0x368ec0[_0xf6ca('0x44')]['toString']()});}else if(_0x368ec0[_0xf6ca('0x45')]===_0xf6ca('0x49')&&_0x368ec0['variableName']&&_0x368ec0[_0xf6ca('0x46')]&&_0x368ec0['customField']){_0x3cd6e8[_0x368ec0[_0xf6ca('0x4a')]]&&_0x2fe802[_0xf6ca('0x47')]['push']({'id':_0x368ec0[_0xf6ca('0x46')],'value':_0x3cd6e8[_0x368ec0[_0xf6ca('0x4a')]][_0xf6ca('0x37')]()});}else if(_0x368ec0[_0xf6ca('0x45')]===_0xf6ca('0x4b')&&_0x368ec0[_0xf6ca('0x4c')]&&_0x368ec0['Variable'][_0xf6ca('0x15')]&&_0x368ec0[_0xf6ca('0x46')]&&_0x368ec0[_0xf6ca('0x42')]){_0x3cd6e8[_0x368ec0[_0xf6ca('0x4c')][_0xf6ca('0x15')][_0xf6ca('0x43')]()]&&_0x2fe802['custom_fields']['push']({'id':_0x368ec0[_0xf6ca('0x46')],'value':_0x3cd6e8[_0x368ec0[_0xf6ca('0x4c')]['name'][_0xf6ca('0x43')]()][_0xf6ca('0x37')]()});}});}return _0x2fe802;}exports[_0xf6ca('0x4d')]=function(_0x179d77,_0x3c8200,_0x3ef180,_0xc7ea02,_0x5b6bec,_0x40b4bc){var _0x5d70da,_0x21413e;_0x40b4bc['remoteUri']=intUtil[_0xf6ca('0x4e')](_0x40b4bc[_0xf6ca('0x12')]);_0x40b4bc[_0xf6ca('0x4f')]=intUtil[_0xf6ca('0x4e')](_0x40b4bc[_0xf6ca('0x4f')]);if(_0x5b6bec&&_0x5b6bec[_0xf6ca('0x50')]){logger[_0xf6ca('0xe')]('[QUEUE]',_0xf6ca('0x51'));_0x3c8200[_0xf6ca('0x52')]=util[_0xf6ca('0x10')](_0xf6ca('0x53'),_0x40b4bc['serverUrl'],_0x3c8200['uniqueid'],md5(_0x3c8200[_0xf6ca('0x54')]));}else{_0x3c8200['recordingURL']='';}headers['Authorization']=getAuth(_0x40b4bc);return getUser(_0x40b4bc,_0xc7ea02[_0xf6ca('0x55')])[_0xf6ca('0x1d')](function(_0x19cd85){_0x5d70da=_0x19cd85;logger[_0xf6ca('0xe')]('The\x20User\x20ID\x20is:',_0x5d70da['id']);return getEndUser(_0x40b4bc,_0x3c8200[_0xf6ca('0x56')],_0x3c8200[_0xf6ca('0x57')]);})[_0xf6ca('0x1d')](function(_0x461cca){_0x21413e=_0x461cca;logger[_0xf6ca('0xe')](_0xf6ca('0x58'),_0x21413e['id']);return getTicket(_0x40b4bc,_0x5d70da,_0x21413e,_0x3ef180,_0x3c8200);})[_0xf6ca('0x1d')](function(_0x254dca){if(_0x254dca){logger[_0xf6ca('0xe')](_0xf6ca('0x59'),_0x254dca['id']);switch(_0x40b4bc[_0xf6ca('0x45')]){case _0xf6ca('0x5a'):logger[_0xf6ca('0xe')](_0xf6ca('0x5b'),_0xf6ca('0x5c'));return request({'uri':util['format'](_0xf6ca('0x5d'),_0x40b4bc[_0xf6ca('0x12')],_0x5d70da['id'],_0x254dca['id']),'method':'POST'});case _0xf6ca('0x5e'):logger[_0xf6ca('0xe')](_0xf6ca('0x5b'),_0xf6ca('0x5f'));emit(util['format'](_0xf6ca('0x60'),_0xc7ea02[_0xf6ca('0x15')]),_0xf6ca('0x61'),{'uri':util[_0xf6ca('0x10')]('%s/agent/tickets/%s',_0x40b4bc[_0xf6ca('0x12')][_0xf6ca('0x62')](_0xf6ca('0x63'),''),_0x254dca['id'])});break;default:logger['error'](_0xf6ca('0x5b'),_0xf6ca('0x64'));}}})[_0xf6ca('0x65')](function(_0x4919e7){logger[_0xf6ca('0x66')](_0xf6ca('0x67'),util['inspect'](_0x4919e7,{'showHidden':!![],'depth':null}));});};exports[_0xf6ca('0x68')]=function(_0x5ba201,_0x19b534,_0x32b26d,_0x35ed1e,_0x2d5651,_0x5861d3,_0x2347c4){var _0x4d4f99,_0x4b2658;_0x5861d3['remoteUri']=intUtil['stripTrailingSlash'](_0x5861d3['remoteUri']);_0x5861d3[_0xf6ca('0x4f')]=intUtil['stripTrailingSlash'](_0x5861d3[_0xf6ca('0x4f')]);if(_0x2347c4&&_0x2347c4['recordingFormat']&&_0x2347c4[_0xf6ca('0x69')]!==_0xf6ca('0x6a')){logger['info'](_0xf6ca('0x6b'),'Recording\x20is\x20enabled!');_0x19b534[_0xf6ca('0x52')]=util[_0xf6ca('0x10')](_0xf6ca('0x53'),_0x5861d3[_0xf6ca('0x4f')],_0x19b534['uniqueid'],md5(_0x19b534['uniqueid']));}headers['Authorization']=getAuth(_0x5861d3);return getUser(_0x5861d3,_0x35ed1e['email'])['then'](function(_0x1842db){_0x4d4f99=_0x1842db;logger['info'](_0xf6ca('0x6c'),_0x4d4f99['id']);return getEndUser(_0x5861d3,_0x19b534['destcalleridname'],_0x19b534[_0xf6ca('0x6d')]);})[_0xf6ca('0x1d')](function(_0x4b94d3){_0x4b2658=_0x4b94d3;logger[_0xf6ca('0xe')](_0xf6ca('0x58'),_0x4b2658['id']);return getTicket(_0x5861d3,_0x4d4f99,_0x4b2658,_0x32b26d,_0x19b534);})['then'](function(_0x709cdd){if(_0x709cdd){logger['info'](_0xf6ca('0x59'),_0x709cdd['id']);switch(_0x5861d3[_0xf6ca('0x45')]){case _0xf6ca('0x5a'):logger[_0xf6ca('0xe')](_0xf6ca('0x6b'),_0xf6ca('0x5c'));return request({'uri':util[_0xf6ca('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5861d3[_0xf6ca('0x12')],_0x4d4f99['id'],_0x709cdd['id']),'method':'POST'});case _0xf6ca('0x5e'):logger['info'](_0xf6ca('0x6b'),_0xf6ca('0x5f'));emit(util[_0xf6ca('0x10')](_0xf6ca('0x60'),_0x35ed1e[_0xf6ca('0x15')]),_0xf6ca('0x61'),{'uri':util[_0xf6ca('0x10')](_0xf6ca('0x6e'),_0x5861d3[_0xf6ca('0x12')][_0xf6ca('0x62')](_0xf6ca('0x63'),''),_0x709cdd['id'])});break;default:logger[_0xf6ca('0x66')](_0xf6ca('0x6b'),_0xf6ca('0x64'));}}})[_0xf6ca('0x65')](function(_0x519a35){logger[_0xf6ca('0x66')](_0xf6ca('0x6f'),util[_0xf6ca('0x70')](_0x519a35,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x52efdb,_0xc40074,_0x2c7a76,_0xf6a57f,_0x3c622b,_0x2a2d65){var _0x4ff5e1,_0x46e5b2;_0x2a2d65[_0xf6ca('0x12')]=intUtil[_0xf6ca('0x4e')](_0x2a2d65[_0xf6ca('0x12')]);_0x2a2d65[_0xf6ca('0x4f')]=intUtil[_0xf6ca('0x4e')](_0x2a2d65[_0xf6ca('0x4f')]);if(_0x3c622b&&_0x3c622b[_0xf6ca('0x50')]){logger[_0xf6ca('0xe')]('['+_0xc40074[_0xf6ca('0x71')][_0xf6ca('0x72')]()+']','Recording\x20is\x20enabled!');_0xc40074[_0xf6ca('0x52')]=util[_0xf6ca('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a2d65[_0xf6ca('0x4f')],_0xc40074['uniqueid'],md5(_0xc40074['uniqueid']));}else{_0xc40074[_0xf6ca('0x52')]='';}headers[_0xf6ca('0x73')]=getAuth(_0x2a2d65);return getUser(_0x2a2d65)[_0xf6ca('0x1d')](function(_0x14f1f4){_0x4ff5e1=_0x14f1f4;logger[_0xf6ca('0xe')]('The\x20User\x20ID\x20is:',_0x4ff5e1['id']);return getEndUser(_0x2a2d65,_0xc40074[_0xf6ca('0x56')],_0xc40074[_0xf6ca('0x57')]);})[_0xf6ca('0x1d')](function(_0x46e1ff){_0x46e5b2=_0x46e1ff;logger[_0xf6ca('0xe')]('The\x20Enduser\x20ID\x20is:',_0x46e5b2['id']);return getTicket(_0x2a2d65,_0x4ff5e1,_0x46e5b2,_0x2c7a76,_0xc40074);})[_0xf6ca('0x1d')](function(_0x2bf422){if(_0x2bf422){logger['info'](_0xf6ca('0x59'),_0x2bf422['id']);}})[_0xf6ca('0x65')](function(_0x11240c){logger[_0xf6ca('0x66')]('['+_0xc40074[_0xf6ca('0x71')][_0xf6ca('0x72')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xf6ca('0x70')](_0x11240c,{'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 e7f3869..c8b422d 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 _0x2121=['Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','POST','refreshToken','clientId','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','startCase','Error:\x20','log','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','lead','administrator','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','Call\x20created!','details','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','monitor_format','toUpperCase','lodash','request-promise','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName'];(function(_0x2dcaab,_0x31eaa3){var _0x5455e0=function(_0x5b1a57){while(--_0x5b1a57){_0x2dcaab['push'](_0x2dcaab['shift']());}};_0x5455e0(++_0x31eaa3);}(_0x2121,0x1b4));var _0x1212=function(_0x3e9693,_0x336200){_0x3e9693=_0x3e9693-0x0;var _0x2d1c0e=_0x2121[_0x3e9693];return _0x2d1c0e;};'use strict';var _=require(_0x1212('0x0'));var rp=require(_0x1212('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x1212('0x2'));var moment=require(_0x1212('0x3'));var Redis=require(_0x1212('0x4'));var BPromise=require(_0x1212('0x5'));var config=require(_0x1212('0x6'));var logger=require('../../../../config/logger')(_0x1212('0x7'));config['redis']=_[_0x1212('0x8')](config[_0x1212('0x9')],{'host':_0x1212('0xa'),'port':0x18eb});var io=require(_0x1212('0xb'))(new Redis(config[_0x1212('0x9')]));function emit(_0x642ed5,_0x4a3d2a,_0x1df3e1){io['to'](_0x642ed5)[_0x1212('0xc')](_0x4a3d2a,_0x1df3e1);}function request(_0x434d23){logger[_0x1212('0xd')](_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));return rp(_0x434d23);}function getCustomFields(_0x5498b0,_0x491bab){var _0x5cd5d6={};if(_0x5498b0[_0x1212('0x10')]>0x0){_[_0x1212('0x11')](_0x5498b0,function(_0x2a9d7b){if(_['includes']([_0x1212('0x12'),_0x1212('0x13')],_0x2a9d7b[_0x1212('0x14')])&&_0x2a9d7b[_0x1212('0x15')]){_0x5cd5d6[_0x2a9d7b[_0x1212('0x15')]]=_0x2a9d7b[_0x1212('0x16')][_0x1212('0x17')]();}else if(_0x2a9d7b[_0x1212('0x14')]===_0x1212('0x18')&&_0x2a9d7b[_0x1212('0x19')]&&_0x2a9d7b[_0x1212('0x15')]&&_0x491bab[_0x2a9d7b[_0x1212('0x19')]]){_0x5cd5d6[_0x2a9d7b[_0x1212('0x15')]]=_0x491bab[_0x2a9d7b[_0x1212('0x19')]][_0x1212('0x17')]();}else if(_0x2a9d7b['type']==='customVariable'&&_0x2a9d7b['Variable']&&_0x2a9d7b[_0x1212('0x1a')][_0x1212('0x1b')]&&_0x2a9d7b[_0x1212('0x15')]&&_0x491bab[_0x2a9d7b[_0x1212('0x1a')][_0x1212('0x1b')][_0x1212('0x1c')]()]){_0x5cd5d6[_0x2a9d7b[_0x1212('0x15')]]=_0x491bab[_0x2a9d7b[_0x1212('0x1a')][_0x1212('0x1b')]['toLowerCase']()][_0x1212('0x17')]();}});}return _0x5cd5d6;}function getName(_0x1333ec){if(_0x1333ec[_0x1212('0x1d')]('\x20')>0x0){var _0x2eedc9=_0x1333ec[_0x1212('0x1e')](/ (.+)/);if(_0x2eedc9[0x1]){return _0x2eedc9;}}return[_0x1333ec,_0x1333ec];}var accountsTokens={};function getAccessToken(_0x2e656f){return new Promise(function(_0x7d0810,_0x8d4002){if(!_['isNil'](accountsTokens[_0x2e656f['id']])&&!_[_0x1212('0x1f')](accountsTokens[_0x2e656f['id']][_0x1212('0x20')])){if(moment()[_0x1212('0x21')](accountsTokens[_0x2e656f['id']][_0x1212('0x22')])){_0x7d0810(accountsTokens[_0x2e656f['id']][_0x1212('0x20')]);}}var _0x24c770;switch(_0x2e656f[_0x1212('0x23')]){case'US':_0x24c770=_0x1212('0x24');break;case'AU':_0x24c770='https://accounts.zoho.com.au';break;case'EU':_0x24c770='https://accounts.zoho.eu';break;case'IN':_0x24c770='https://accounts.zoho.in';break;case'CN':_0x24c770='https://accounts.zoho.com.cn';break;default:_0x24c770='https://accounts.zoho.eu';break;}var _0xec5b8d={'method':_0x1212('0x25'),'uri':_0x24c770+'/oauth/v2/token','qs':{'refresh_token':_0x2e656f[_0x1212('0x26')],'client_id':_0x2e656f[_0x1212('0x27')],'client_secret':_0x2e656f['clientSecret'],'grant_type':_0x1212('0x28')},'json':!![]};return rp(_0xec5b8d)[_0x1212('0x29')](function(_0x4630b4){accountsTokens[_0x2e656f['id']]={'access_token':_0x4630b4[_0x1212('0x20')],'expires_in':moment()[_0x1212('0x2a')](_0x4630b4[_0x1212('0x22')],_0x1212('0x2b'))};_0x7d0810(_0x4630b4[_0x1212('0x20')]);})['catch'](function(_0x156b50){logger[_0x1212('0x2c')](_0x1212('0x2d'),_0x156b50[_0x1212('0x2e')]);_0x8d4002(_0x156b50);});});}function getUser(_0x17d0f6,_0x26446d,_0x315f00,_0x40b8f6){logger[_0x1212('0x2f')](_0x1212('0x30'));return request({'method':'GET','uri':util['format'](_0x1212('0x31'),_0x26446d),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x1212('0x32')+_0x17d0f6},'json':!![]})['then'](function(_0x229ea4){if(_0x229ea4['users']){var _0x2c9313=-0x1;if(_[_0x1212('0x33')](_0x229ea4[_0x1212('0x34')])){if(!_[_0x1212('0x1f')](_0x40b8f6)){_0x2c9313=_['findIndex'](_0x229ea4[_0x1212('0x34')],function(_0x226fd3){return _0x226fd3[_0x1212('0x35')]===_0x40b8f6;});}if(_0x2c9313>=0x0){logger[_0x1212('0x2f')](_0x1212('0x36'));}else{logger['info'](_0x1212('0x37'));_0x2c9313=_[_0x1212('0x38')](_0x229ea4[_0x1212('0x34')],function(_0x48a9ad){return _0x48a9ad[_0x1212('0x39')][_0x1212('0x1b')]===_0x1212('0x3a');});}return _0x229ea4[_0x1212('0x34')][_0x2c9313];}else{if(_0x229ea4['user'][_0x1212('0x39')][_0x1212('0x1b')]==='Administrator'){logger[_0x1212('0x2f')](_0x1212('0x37'));user=_0x229ea4[_0x1212('0x3b')];return user;}else{logger['error'](_0x1212('0x3c'),JSON[_0x1212('0xf')](_0x229ea4));throw new Error(_0x1212('0x3d')+JSON['stringify'](_0x229ea4));}}}else{logger[_0x1212('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x1212('0xf')](_0x229ea4));throw new Error(_0x1212('0x3d')+JSON['stringify'](_0x229ea4));}})['catch'](function(_0x2447c6){console['error'](_0x2447c6);});}function getZohoUser(_0x113a06,_0x20e964){return new BPromise(function(_0x31a69c,_0x23a577){request(_0x113a06)[_0x1212('0x29')](function(_0x1f3b66){var _0x42943a=null;if(_0x1f3b66){_0x42943a=_0x1f3b66[_0x1212('0x3e')][0x0];_0x42943a[_0x1212('0x3f')]=_0x20e964;}_0x31a69c(_0x42943a);})[_0x1212('0x40')](function(_0x43b21b){_0x23a577(_0x43b21b);});});}function createEndUser(_0x1bbb84,_0x4995e1,_0x3cbb43,_0x2e1c59,_0x42b95a,_0x2ab6ef){var _0x3cbb43=getName(_0x3cbb43);return request({'method':'POST','uri':_0x1212('0x41')+_0x4995e1+'/crm/v2/'+_['startCase'](_0x2ab6ef[_0x1212('0x42')])+'s','body':{'data':[{'Last_Name':_0x3cbb43[0x1],'First_Name':_0x3cbb43[0x0],'Phone':_0x2e1c59,'Owner':{'name':!_[_0x1212('0x1f')](_0x42b95a[_0x1212('0x43')][_0x1212('0x1b')])?_0x42b95a[_0x1212('0x43')]['name']:!_['isNil'](_0x42b95a[_0x1212('0x44')])?_0x42b95a[_0x1212('0x44')]+'\x20'+_0x42b95a[_0x1212('0x45')]:_0x42b95a[_0x1212('0x45')],'id':_0x42b95a['id']}}]},'headers':{'Authorization':_0x1212('0x32')+_0x1bbb84},'json':!![]})[_0x1212('0x29')](function(_0x473151){if(_0x473151&&_0x473151[_0x1212('0x3e')][0x0][_0x1212('0x46')]===_0x1212('0x47')){var _0x1af6ae=_0x473151[_0x1212('0x3e')][0x0]['details'];_0x1af6ae['enduserType']=_[_0x1212('0x48')](_0x2ab6ef[_0x1212('0x42')])+'s';return _0x1af6ae;}logger['error'](_0x1212('0x3c'),JSON['stringify'](data));throw new Error(_0x1212('0x49')+JSON[_0x1212('0xf')](data));})[_0x1212('0x40')](function(_0x1bdd6c){console[_0x1212('0x4a')]('CREATE\x20ERROR',_0x1bdd6c);});}function getEndUser(_0x15a0c3,_0xbc9304,_0x31c8ee,_0x52afc3,_0x3548a1,_0x298538,_0x4b1625){var _0x93cf49={'method':_0x1212('0x4b'),'uri':'','headers':{'Authorization':_0x1212('0x32')+_0x15a0c3},'json':!![]};switch(_0x4b1625[_0x1212('0x4c')]){case _0x1212('0x4d'):_0x93cf49[_0x1212('0x4e')]='https://www.zohoapis.'+_0xbc9304+_0x1212('0x4f')+_0x3548a1+'))';return getZohoUser(_0x93cf49,_0x1212('0x50'))[_0x1212('0x29')](function(_0x5e1aff){if(_0x5e1aff)return _0x5e1aff;_0x93cf49['uri']=_0x1212('0x41')+_0xbc9304+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3548a1+'))';return getZohoUser(_0x93cf49,_0x1212('0x51'))['then'](function(_0x50a8ef){if(_0x50a8ef)return _0x50a8ef;if(_0x4b1625[_0x1212('0x42')]!=_0x1212('0x52')){return createEndUser(_0x15a0c3,_0xbc9304,_0x52afc3,_0x3548a1,_0x298538,_0x4b1625);}else{return{};}});});break;case'contact':_0x93cf49[_0x1212('0x4e')]='https://www.zohoapis.'+_0xbc9304+_0x1212('0x4f')+_0x3548a1+'))';return getZohoUser(_0x93cf49,_0x1212('0x50'))['then'](function(_0x55b8df){if(_0x55b8df)return _0x55b8df;if(_0x4b1625[_0x1212('0x42')]!='nothing'){return createEndUser(_0x15a0c3,_0xbc9304,_0x52afc3,_0x3548a1,_0x298538,_0x4b1625);}else{return{};}});break;case _0x1212('0x53'):_0x93cf49['uri']=_0x1212('0x41')+_0xbc9304+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3548a1+'))';return getZohoUser(_0x93cf49,_0x1212('0x51'))[_0x1212('0x29')](function(_0x249066){if(_0x249066)return _0x249066;if(_0x4b1625[_0x1212('0x42')]!=_0x1212('0x52')){return createEndUser(_0x15a0c3,_0xbc9304,_0x52afc3,_0x3548a1,_0x298538,_0x4b1625);}else{return{};}});break;}}function getCall(_0xcc376d,_0x4c5f4b,_0x4b0b0f,_0x2a983e,_0x14e2ac,_0x3796ec,_0x140984,_0x9ded8b){logger[_0x1212('0x2f')]('Creating\x20new\x20call...');var _0x5e3644={};_0x5e3644['Owner']={'name':!_[_0x1212('0x1f')](_0x2a983e[_0x1212('0x43')][_0x1212('0x1b')])&&!_[_0x1212('0x1f')](_0x2a983e[_0x1212('0x39')]['name'])&&_0x2a983e[_0x1212('0x39')][_0x1212('0x1b')]===_0x1212('0x54')?_0x2a983e[_0x1212('0x43')][_0x1212('0x1b')]:!_[_0x1212('0x1f')](_0x2a983e['first_name'])?_0x2a983e[_0x1212('0x44')]+'\x20'+_0x2a983e[_0x1212('0x45')]:_0x2a983e[_0x1212('0x45')],'id':_0x2a983e['id']};_0x5e3644['Subject']=intUtil[_0x1212('0x55')](_0x3796ec[_0x1212('0x56')],_0x140984,'\x20');_0x5e3644[_0x1212('0x57')]=intUtil[_0x1212('0x55')](_0x3796ec['Descriptions'],_0x140984,'\x0a');if(_0x14e2ac[_0x1212('0x3f')]===_0x1212('0x50')){_0x5e3644[_0x1212('0x58')]={'name':!_[_0x1212('0x1f')](_0x14e2ac[_0x1212('0x59')])?_0x14e2ac[_0x1212('0x59')]:!_['isNil'](_0x14e2ac[_0x1212('0x5a')])?_0x14e2ac['First_Name']+'\x20'+_0x14e2ac['Last_Name']:_0x14e2ac[_0x1212('0x5b')],'id':_0x14e2ac['id']};}if(_0x14e2ac[_0x1212('0x3f')]==='Leads'){_0x5e3644[_0x1212('0x5c')]={'name':!_['isNil'](_0x14e2ac['Full_Name'])?_0x14e2ac['Full_Name']:!_['isNil'](_0x14e2ac['First_Name'])?_0x14e2ac[_0x1212('0x5a')]+'\x20'+_0x14e2ac[_0x1212('0x5b')]:_0x14e2ac[_0x1212('0x5b')],'id':_0x14e2ac['id']};_0x5e3644[_0x1212('0x5d')]=_[_0x1212('0x48')](_0x14e2ac[_0x1212('0x3f')]);}if(_0x140984[_0x1212('0x5e')]){_0x5e3644[_0x1212('0x5f')]=moment[_0x1212('0x60')](parseInt(_0x140984[_0x1212('0x5e')])*0x3e8)[_0x1212('0x61')](_0x1212('0x62'));}else if(_0x140984[_0x1212('0x63')]&&_0x140984['endtime']){_0x5e3644[_0x1212('0x5f')]=moment['utc'](moment(_0x140984[_0x1212('0x64')],_0x1212('0x65'))[_0x1212('0x66')](moment(_0x140984[_0x1212('0x67')],_0x1212('0x65'))))[_0x1212('0x61')](_0x1212('0x62'));}switch(_0x140984[_0x1212('0x68')]){case'called':_0x5e3644[_0x1212('0x69')]=_0x1212('0x6a');break;case _0x1212('0x6b'):case _0x1212('0x6c'):_0x5e3644['Call_Result']=_0x1212('0x6d');break;case _0x1212('0x6e'):_0x5e3644['Call_Result']=_0x1212('0x6f');break;case _0x1212('0x70'):_0x5e3644['Call_Result']=_0x1212('0x71');break;case _0x1212('0x72'):_0x5e3644[_0x1212('0x69')]=_0x1212('0x73');default:}_0x5e3644[_0x1212('0x74')]=(_0x9ded8b===_0x1212('0x75')?moment(_0x140984[_0x1212('0x67')])[_0x1212('0x61')](_0x1212('0x65')):moment(_0x140984[_0x1212('0x76')])[_0x1212('0x61')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x1212('0x61')]('YYYY-MM-DDTHH:mm:ss');_0x5e3644[_0x1212('0x77')]=_0x9ded8b||'Inbound';_0x5e3644=_[_0x1212('0x78')](_0x5e3644,getCustomFields(_0x3796ec[_0x1212('0x79')],_0x140984));return request({'method':_0x1212('0x25'),'uri':_0x1212('0x41')+_0x4c5f4b+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xcc376d},'body':{'data':[_0x5e3644]},'json':!![]})[_0x1212('0x29')](function(_0x4a2c8c){if(_0x4a2c8c&&_0x4a2c8c[_0x1212('0x3e')][0x0][_0x1212('0x46')]==='SUCCESS'){logger[_0x1212('0x2f')](_0x1212('0x7a'));return{'id':_0x4a2c8c[_0x1212('0x3e')][0x0][_0x1212('0x7b')]['id']};}})[_0x1212('0x40')](function(_0x4c14d8){logger[_0x1212('0x2f')](_0x1212('0x7c'),_0x4c14d8[_0x1212('0x2e')]);console['log'](_0x1212('0x7c'),_0x4c14d8);});}exports[_0x1212('0x7d')]=function(_0x1b778d,_0x46c3f6,_0x191781,_0x3b2ed3,_0x5c36c0,_0x1bab44){var _0x38c0c5,_0x50a239,_0x17f782;_0x1bab44[_0x1212('0x7e')]=intUtil['stripTrailingSlash'](_0x1bab44[_0x1212('0x7e')]);_0x1bab44[_0x1212('0x7f')]=intUtil[_0x1212('0x80')](_0x1bab44[_0x1212('0x7f')]);if(_0x5c36c0&&_0x5c36c0['monitor_format']){logger[_0x1212('0x2f')](_0x1212('0x81'),_0x1212('0x82'));_0x46c3f6[_0x1212('0x83')]=_0x1bab44[_0x1212('0x7f')]+_0x1212('0x84')+_0x46c3f6[_0x1212('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x46c3f6['uniqueid']);}else{_0x46c3f6[_0x1212('0x83')]='';}var _0x4110ee=_0x1bab44[_0x1212('0x7e')]===_0x1212('0x86')?'eu':_0x1212('0x87');return getAccessToken(_0x1bab44)[_0x1212('0x29')](function(_0x22bb0e){_0x17f782=_0x22bb0e;return getUser(_0x17f782,_0x4110ee,_0x1bab44,_0x3b2ed3['email']);})[_0x1212('0x29')](function(_0x457e1b){_0x38c0c5=_0x457e1b;logger['info'](_0x1212('0x88'),_0x38c0c5['id']);return getEndUser(_0x17f782,_0x4110ee,_0x1bab44,_0x46c3f6[_0x1212('0x89')],_0x46c3f6[_0x1212('0x8a')],_0x38c0c5,_0x191781);})[_0x1212('0x29')](function(_0xc49a58){_0x50a239=_0xc49a58;return getCall(_0x17f782,_0x4110ee,_0x1bab44,_0x38c0c5,_0x50a239,_0x191781,_0x46c3f6,_0x1212('0x8b'));})[_0x1212('0x29')](function(_0x4f1dc4){if(_0x4f1dc4){logger[_0x1212('0x2f')](_0x1212('0x8c'),_0x4f1dc4['id']);logger[_0x1212('0x2f')](_0x1212('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1212('0x61')](_0x1212('0x8d'),_0x3b2ed3[_0x1212('0x1b')]),_0x1212('0x8e'),{'uri':_0x1212('0x8f')+_0x1bab44[_0x1212('0x7e')]+_0x1212('0x90')+_0x4f1dc4['id']});}})['catch'](function(_0x33f9d6){logger[_0x1212('0x2c')](_0x1212('0x81'),JSON['stringify'](_0x33f9d6));});};exports[_0x1212('0x75')]=function(_0x574c71,_0x347ee0,_0x369d44,_0x46ab53,_0x268915,_0x466f0f,_0x112a9c){var _0x24f8bf,_0x1dc961,_0x116c64;_0x466f0f[_0x1212('0x7e')]=intUtil['stripTrailingSlash'](_0x466f0f['host']);_0x466f0f['serverUrl']=intUtil[_0x1212('0x80')](_0x466f0f[_0x1212('0x7f')]);if(_0x112a9c&&_0x112a9c['recordingFormat']&&_0x112a9c[_0x1212('0x91')]!==_0x1212('0x92')){logger['info'](_0x1212('0x93'),_0x1212('0x82'));_0x347ee0[_0x1212('0x83')]=_0x466f0f[_0x1212('0x7f')]+_0x1212('0x84')+_0x347ee0[_0x1212('0x85')]+_0x1212('0x94')+md5(_0x347ee0[_0x1212('0x85')]);}var _0x39cd77=_0x466f0f['host']==='zoho.eu'?'eu':_0x1212('0x87');return getAccessToken(_0x466f0f)[_0x1212('0x29')](function(_0x597c33){_0x116c64=_0x597c33;return getUser(_0x116c64,_0x39cd77,_0x466f0f,_0x46ab53[_0x1212('0x35')]);})[_0x1212('0x29')](function(_0x3b9479){_0x24f8bf=_0x3b9479;logger[_0x1212('0x2f')]('The\x20User\x20ID\x20is:',_0x24f8bf['id']);return getEndUser(_0x116c64,_0x39cd77,_0x466f0f,_0x347ee0['destcalleridname'],_0x347ee0[_0x1212('0x95')],_0x24f8bf,_0x369d44);})[_0x1212('0x29')](function(_0x416aad){_0x1dc961=_0x416aad;return getCall(_0x116c64,_0x39cd77,_0x466f0f,_0x24f8bf,_0x1dc961,_0x369d44,_0x347ee0,_0x1212('0x96'));})[_0x1212('0x29')](function(_0x40407d){if(_0x40407d){logger[_0x1212('0x2f')](_0x1212('0x8c'),_0x40407d['id']);logger[_0x1212('0x2f')]('[OUTBOUND]',_0x1212('0x97'));emit(util['format'](_0x1212('0x8d'),_0x46ab53['name']),_0x1212('0x8e'),{'uri':'https://crm.'+_0x466f0f[_0x1212('0x7e')]+_0x1212('0x90')+_0x40407d['id']});}})[_0x1212('0x40')](function(_0x6e6cb8){logger['error'](_0x1212('0x93'),JSON[_0x1212('0xf')](_0x6e6cb8));});};exports['unmanaged']=function(_0x23539b,_0x5c4354,_0x2c9a89,_0x42139c,_0x39e0f4,_0x45c25c){var _0x548bf2,_0x35f40f,_0x4992b6;_0x45c25c[_0x1212('0x7e')]=intUtil['stripTrailingSlash'](_0x45c25c[_0x1212('0x7e')]);_0x45c25c[_0x1212('0x7f')]=intUtil[_0x1212('0x80')](_0x45c25c[_0x1212('0x7f')]);if(_0x39e0f4&&_0x39e0f4[_0x1212('0x98')]){logger['info']('['+_0x5c4354[_0x1212('0x68')][_0x1212('0x99')]()+']',_0x1212('0x82'));_0x5c4354[_0x1212('0x83')]=_0x45c25c[_0x1212('0x7f')]+_0x1212('0x84')+_0x5c4354[_0x1212('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x5c4354['uniqueid']);}else{_0x5c4354['recordingURL']='';}var _0x5f5584=_0x45c25c[_0x1212('0x7e')]===_0x1212('0x86')?'eu':'com';return getAccessToken(_0x45c25c)[_0x1212('0x29')](function(_0x8298b){_0x4992b6=_0x8298b;return getUser(_0x4992b6,_0x5f5584,_0x45c25c);})[_0x1212('0x29')](function(_0x15eacb){_0x548bf2=_0x15eacb;logger['info'](_0x1212('0x88'),_0x548bf2['id']);return getEndUser(_0x4992b6,_0x5f5584,_0x45c25c,_0x5c4354['calleridname'],_0x5c4354[_0x1212('0x8a')],_0x548bf2,_0x2c9a89);})[_0x1212('0x29')](function(_0x4bb98e){_0x35f40f=_0x4bb98e;return getCall(_0x4992b6,_0x5f5584,_0x45c25c,_0x548bf2,_0x35f40f,_0x2c9a89,_0x5c4354,_0x1212('0x8b'));})[_0x1212('0x29')](function(_0x5a79db){if(_0x5a79db){logger['info']('The\x20Call\x20ID\x20is:',_0x5a79db['id']);}})['catch'](function(_0x1ed196){logger['error']('['+_0x5c4354[_0x1212('0x68')][_0x1212('0x99')]()+']',JSON['stringify'](_0x1ed196));});}; \ No newline at end of file +var _0x5022=['Creating\x20new\x20call...','Owner','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','complete','Answered','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','merge','Fields','Call\x20created!','details','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','lodash','md5','util','./util','../../../../config/environment','zoho','defaults','redis','localhost','string','picklist','type','idField','content','variable','variableName','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead'];(function(_0xdf4199,_0x5ceac9){var _0x155580=function(_0x12663d){while(--_0x12663d){_0xdf4199['push'](_0xdf4199['shift']());}};_0x155580(++_0x5ceac9);}(_0x5022,0xd0));var _0x2502=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x5022[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x2502('0x0'));var rp=require('request-promise');var md5=require(_0x2502('0x1'));var util=require(_0x2502('0x2'));var intUtil=require(_0x2502('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x2502('0x4'));var logger=require('../../../../config/logger')(_0x2502('0x5'));config['redis']=_[_0x2502('0x6')](config[_0x2502('0x7')],{'host':_0x2502('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2502('0x7')]));function emit(_0x42e5e6,_0x3b386a,_0x17520f){io['to'](_0x42e5e6)['emit'](_0x3b386a,_0x17520f);}function request(_0x29dfb6){logger['debug']('[HTTP]',JSON['stringify'](_0x29dfb6));return rp(_0x29dfb6);}function getCustomFields(_0xb7216b,_0x1b48b6){var _0x5ab85a={};if(_0xb7216b['length']>0x0){_['forEach'](_0xb7216b,function(_0x1a85dc){if(_['includes']([_0x2502('0x9'),_0x2502('0xa')],_0x1a85dc[_0x2502('0xb')])&&_0x1a85dc['idField']){_0x5ab85a[_0x1a85dc[_0x2502('0xc')]]=_0x1a85dc[_0x2502('0xd')]['toString']();}else if(_0x1a85dc[_0x2502('0xb')]===_0x2502('0xe')&&_0x1a85dc[_0x2502('0xf')]&&_0x1a85dc[_0x2502('0xc')]&&_0x1b48b6[_0x1a85dc[_0x2502('0xf')]]){_0x5ab85a[_0x1a85dc[_0x2502('0xc')]]=_0x1b48b6[_0x1a85dc[_0x2502('0xf')]]['toString']();}else if(_0x1a85dc[_0x2502('0xb')]===_0x2502('0x10')&&_0x1a85dc[_0x2502('0x11')]&&_0x1a85dc[_0x2502('0x11')]['name']&&_0x1a85dc[_0x2502('0xc')]&&_0x1b48b6[_0x1a85dc[_0x2502('0x11')]['name'][_0x2502('0x12')]()]){_0x5ab85a[_0x1a85dc[_0x2502('0xc')]]=_0x1b48b6[_0x1a85dc[_0x2502('0x11')][_0x2502('0x13')][_0x2502('0x12')]()]['toString']();}});}return _0x5ab85a;}function getName(_0x5d863e){if(_0x5d863e[_0x2502('0x14')]('\x20')>0x0){var _0x40dec9=_0x5d863e[_0x2502('0x15')](/ (.+)/);if(_0x40dec9[0x1]){return _0x40dec9;}}return[_0x5d863e,_0x5d863e];}var accountsTokens={};function getAccessToken(_0x2ad26d){return new Promise(function(_0x27d1fd,_0x248309){if(!_['isNil'](accountsTokens[_0x2ad26d['id']])&&!_[_0x2502('0x16')](accountsTokens[_0x2ad26d['id']][_0x2502('0x17')])){if(moment()[_0x2502('0x18')](accountsTokens[_0x2ad26d['id']][_0x2502('0x19')])){_0x27d1fd(accountsTokens[_0x2ad26d['id']][_0x2502('0x17')]);}}var _0x2d106b;switch(_0x2ad26d['zone']){case'US':_0x2d106b=_0x2502('0x1a');break;case'AU':_0x2d106b='https://accounts.zoho.com.au';break;case'EU':_0x2d106b=_0x2502('0x1b');break;case'IN':_0x2d106b=_0x2502('0x1c');break;case'CN':_0x2d106b=_0x2502('0x1d');break;default:_0x2d106b='https://accounts.zoho.eu';break;}var _0x5c293e={'method':_0x2502('0x1e'),'uri':_0x2d106b+_0x2502('0x1f'),'qs':{'refresh_token':_0x2ad26d[_0x2502('0x20')],'client_id':_0x2ad26d[_0x2502('0x21')],'client_secret':_0x2ad26d[_0x2502('0x22')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5c293e)[_0x2502('0x23')](function(_0x955a1b){accountsTokens[_0x2ad26d['id']]={'access_token':_0x955a1b['access_token'],'expires_in':moment()['add'](_0x955a1b[_0x2502('0x19')],_0x2502('0x24'))};_0x27d1fd(_0x955a1b[_0x2502('0x17')]);})[_0x2502('0x25')](function(_0x3a76bd){logger[_0x2502('0x26')](_0x2502('0x27'),_0x3a76bd[_0x2502('0x28')]);_0x248309(_0x3a76bd);});});}function getUser(_0x1e451c,_0x64c383,_0xd3d851,_0xd60307){logger[_0x2502('0x29')](_0x2502('0x2a'));return request({'method':_0x2502('0x2b'),'uri':util[_0x2502('0x2c')](_0x2502('0x2d'),_0x64c383),'qs':{'type':_0x2502('0x2e')},'headers':{'Authorization':_0x2502('0x2f')+_0x1e451c},'json':!![]})['then'](function(_0x2f4cc7){if(_0x2f4cc7[_0x2502('0x30')]){var _0x328d47=-0x1;if(_['isArrayLikeObject'](_0x2f4cc7[_0x2502('0x30')])){if(!_[_0x2502('0x16')](_0xd60307)){_0x328d47=_[_0x2502('0x31')](_0x2f4cc7[_0x2502('0x30')],function(_0x251cbd){return _0x251cbd[_0x2502('0x32')]===_0xd60307;});}if(_0x328d47>=0x0){logger[_0x2502('0x29')](_0x2502('0x33'));}else{logger[_0x2502('0x29')]('Using\x20the\x20admin\x20account!');_0x328d47=_[_0x2502('0x31')](_0x2f4cc7[_0x2502('0x30')],function(_0x427bd2){return _0x427bd2[_0x2502('0x34')]['name']===_0x2502('0x35');});}return _0x2f4cc7['users'][_0x328d47];}else{if(_0x2f4cc7[_0x2502('0x36')][_0x2502('0x34')][_0x2502('0x13')]===_0x2502('0x35')){logger[_0x2502('0x29')]('Using\x20the\x20admin\x20account!');user=_0x2f4cc7['user'];return user;}else{logger[_0x2502('0x26')](_0x2502('0x37'),JSON['stringify'](_0x2f4cc7));throw new Error(_0x2502('0x38')+JSON['stringify'](_0x2f4cc7));}}}else{logger[_0x2502('0x26')](_0x2502('0x37'),JSON[_0x2502('0x39')](_0x2f4cc7));throw new Error(_0x2502('0x38')+JSON[_0x2502('0x39')](_0x2f4cc7));}})[_0x2502('0x25')](function(_0x3ba348){console[_0x2502('0x26')](_0x3ba348);});}function getZohoUser(_0x14d015,_0xa5ee54){return new BPromise(function(_0x4cb6d1,_0x198f5d){request(_0x14d015)[_0x2502('0x23')](function(_0x602ff0){var _0x4f19f2=null;if(_0x602ff0){_0x4f19f2=_0x602ff0[_0x2502('0x3a')][0x0];_0x4f19f2[_0x2502('0x3b')]=_0xa5ee54;}_0x4cb6d1(_0x4f19f2);})[_0x2502('0x25')](function(_0x2df6a1){_0x198f5d(_0x2df6a1);});});}function createEndUser(_0x5d6ea4,_0x33ea09,_0x390e44,_0x37c2f0,_0x4e7120,_0x5e9375){var _0x390e44=getName(_0x390e44);return request({'method':'POST','uri':_0x2502('0x3c')+_0x33ea09+_0x2502('0x3d')+_[_0x2502('0x3e')](_0x5e9375[_0x2502('0x3f')])+'s','body':{'data':[{'Last_Name':_0x390e44[0x1],'First_Name':_0x390e44[0x0],'Phone':_0x37c2f0,'Owner':{'name':!_[_0x2502('0x16')](_0x4e7120[_0x2502('0x40')][_0x2502('0x13')])?_0x4e7120[_0x2502('0x40')][_0x2502('0x13')]:!_[_0x2502('0x16')](_0x4e7120[_0x2502('0x41')])?_0x4e7120['first_name']+'\x20'+_0x4e7120[_0x2502('0x42')]:_0x4e7120['last_name'],'id':_0x4e7120['id']}}]},'headers':{'Authorization':_0x2502('0x2f')+_0x5d6ea4},'json':!![]})[_0x2502('0x23')](function(_0x302965){if(_0x302965&&_0x302965[_0x2502('0x3a')][0x0][_0x2502('0x43')]===_0x2502('0x44')){var _0x2b4798=_0x302965[_0x2502('0x3a')][0x0]['details'];_0x2b4798[_0x2502('0x3b')]=_[_0x2502('0x3e')](_0x5e9375[_0x2502('0x3f')])+'s';return _0x2b4798;}logger[_0x2502('0x26')](_0x2502('0x37'),JSON[_0x2502('0x39')](data));throw new Error(_0x2502('0x45')+JSON[_0x2502('0x39')](data));})[_0x2502('0x25')](function(_0x681728){console[_0x2502('0x46')](_0x2502('0x47'),_0x681728);});}function getEndUser(_0x4b41a5,_0x3be3e4,_0x523a96,_0x252740,_0x1a2974,_0x4ee930,_0x1b34f4){var _0x4fb71={'method':_0x2502('0x2b'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4b41a5},'json':!![]};switch(_0x1b34f4[_0x2502('0x48')]){case _0x2502('0x49'):_0x4fb71[_0x2502('0x4a')]=_0x2502('0x3c')+_0x3be3e4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x1a2974+'))';return getZohoUser(_0x4fb71,_0x2502('0x4b'))[_0x2502('0x23')](function(_0x308b1c){if(_0x308b1c)return _0x308b1c;_0x4fb71[_0x2502('0x4a')]='https://www.zohoapis.'+_0x3be3e4+_0x2502('0x4c')+_0x1a2974+'))';return getZohoUser(_0x4fb71,'Leads')[_0x2502('0x23')](function(_0x86989e){if(_0x86989e)return _0x86989e;if(_0x1b34f4[_0x2502('0x3f')]!='nothing'){return createEndUser(_0x4b41a5,_0x3be3e4,_0x252740,_0x1a2974,_0x4ee930,_0x1b34f4);}else{return{};}});});break;case'contact':_0x4fb71[_0x2502('0x4a')]=_0x2502('0x3c')+_0x3be3e4+_0x2502('0x4d')+_0x1a2974+'))';return getZohoUser(_0x4fb71,_0x2502('0x4b'))[_0x2502('0x23')](function(_0x553467){if(_0x553467)return _0x553467;if(_0x1b34f4[_0x2502('0x3f')]!=_0x2502('0x4e')){return createEndUser(_0x4b41a5,_0x3be3e4,_0x252740,_0x1a2974,_0x4ee930,_0x1b34f4);}else{return{};}});break;case _0x2502('0x4f'):_0x4fb71[_0x2502('0x4a')]='https://www.zohoapis.'+_0x3be3e4+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1a2974+'))';return getZohoUser(_0x4fb71,'Leads')[_0x2502('0x23')](function(_0x17b767){if(_0x17b767)return _0x17b767;if(_0x1b34f4[_0x2502('0x3f')]!='nothing'){return createEndUser(_0x4b41a5,_0x3be3e4,_0x252740,_0x1a2974,_0x4ee930,_0x1b34f4);}else{return{};}});break;}}function getCall(_0x79a697,_0x2c265a,_0xc2b583,_0x3f0da1,_0xda94eb,_0x266b08,_0x39043c,_0x48f3d7){logger['info'](_0x2502('0x50'));var _0x46d78b={};_0x46d78b[_0x2502('0x51')]={'name':!_[_0x2502('0x16')](_0x3f0da1['role']['name'])&&!_['isNil'](_0x3f0da1[_0x2502('0x34')]['name'])&&_0x3f0da1[_0x2502('0x34')][_0x2502('0x13')]==='administrator'?_0x3f0da1[_0x2502('0x40')][_0x2502('0x13')]:!_['isNil'](_0x3f0da1[_0x2502('0x41')])?_0x3f0da1[_0x2502('0x41')]+'\x20'+_0x3f0da1['last_name']:_0x3f0da1[_0x2502('0x42')],'id':_0x3f0da1['id']};_0x46d78b['Subject']=intUtil['getString'](_0x266b08[_0x2502('0x52')],_0x39043c,'\x20');_0x46d78b[_0x2502('0x53')]=intUtil['getString'](_0x266b08[_0x2502('0x54')],_0x39043c,'\x0a');if(_0xda94eb['enduserType']==='Contacts'){_0x46d78b['Who_Id']={'name':!_[_0x2502('0x16')](_0xda94eb[_0x2502('0x55')])?_0xda94eb['Full_Name']:!_[_0x2502('0x16')](_0xda94eb[_0x2502('0x56')])?_0xda94eb[_0x2502('0x56')]+'\x20'+_0xda94eb[_0x2502('0x57')]:_0xda94eb['Last_Name'],'id':_0xda94eb['id']};}if(_0xda94eb['enduserType']==='Leads'){_0x46d78b[_0x2502('0x58')]={'name':!_[_0x2502('0x16')](_0xda94eb[_0x2502('0x55')])?_0xda94eb[_0x2502('0x55')]:!_['isNil'](_0xda94eb[_0x2502('0x56')])?_0xda94eb[_0x2502('0x56')]+'\x20'+_0xda94eb['Last_Name']:_0xda94eb['Last_Name'],'id':_0xda94eb['id']};_0x46d78b['$se_module']=_[_0x2502('0x3e')](_0xda94eb['enduserType']);}if(_0x39043c[_0x2502('0x59')]){_0x46d78b[_0x2502('0x5a')]=moment[_0x2502('0x5b')](parseInt(_0x39043c[_0x2502('0x59')])*0x3e8)[_0x2502('0x2c')](_0x2502('0x5c'));}else if(_0x39043c[_0x2502('0x5d')]&&_0x39043c[_0x2502('0x5e')]){_0x46d78b['Call_Duration']=moment[_0x2502('0x5b')](moment(_0x39043c['endtime'],_0x2502('0x5f'))['diff'](moment(_0x39043c[_0x2502('0x60')],_0x2502('0x5f'))))[_0x2502('0x2c')](_0x2502('0x5c'));}switch(_0x39043c[_0x2502('0x61')]){case _0x2502('0x62'):_0x46d78b[_0x2502('0x63')]='Called';break;case _0x2502('0x64'):case'connect':_0x46d78b[_0x2502('0x63')]=_0x2502('0x65');break;case'rejected':_0x46d78b[_0x2502('0x63')]=_0x2502('0x66');break;case'abandoned':_0x46d78b[_0x2502('0x63')]=_0x2502('0x67');break;case _0x2502('0x68'):_0x46d78b[_0x2502('0x63')]=_0x2502('0x69');default:}_0x46d78b[_0x2502('0x6a')]=(_0x48f3d7===_0x2502('0x6b')?moment(_0x39043c[_0x2502('0x60')])['format'](_0x2502('0x5f')):moment(_0x39043c['agentcalledAt'])[_0x2502('0x2c')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2502('0x2c')](_0x2502('0x5f'));_0x46d78b[_0x2502('0x6c')]=_0x48f3d7||'Inbound';_0x46d78b=_[_0x2502('0x6d')](_0x46d78b,getCustomFields(_0x266b08[_0x2502('0x6e')],_0x39043c));return request({'method':'POST','uri':_0x2502('0x3c')+_0x2c265a+'/crm/v2/Calls','headers':{'Authorization':_0x2502('0x2f')+_0x79a697},'body':{'data':[_0x46d78b]},'json':!![]})[_0x2502('0x23')](function(_0x24fa55){if(_0x24fa55&&_0x24fa55['data'][0x0][_0x2502('0x43')]===_0x2502('0x44')){logger[_0x2502('0x29')](_0x2502('0x6f'));return{'id':_0x24fa55[_0x2502('0x3a')][0x0][_0x2502('0x70')]['id']};}})[_0x2502('0x25')](function(_0x28102b){logger[_0x2502('0x29')]('err',_0x28102b[_0x2502('0x28')]);console[_0x2502('0x46')](_0x2502('0x71'),_0x28102b);});}exports[_0x2502('0x72')]=function(_0x58e5b6,_0x24ab47,_0x11278d,_0x28c431,_0x353a9d,_0x4495a0){var _0x1d1e12,_0x2b17e1,_0x4076f5;_0x4495a0[_0x2502('0x73')]=intUtil['stripTrailingSlash'](_0x4495a0[_0x2502('0x73')]);_0x4495a0[_0x2502('0x74')]=intUtil[_0x2502('0x75')](_0x4495a0[_0x2502('0x74')]);if(_0x353a9d&&_0x353a9d[_0x2502('0x76')]){logger[_0x2502('0x29')]('[QUEUE]',_0x2502('0x77'));_0x24ab47['recordingURL']=_0x4495a0['serverUrl']+_0x2502('0x78')+_0x24ab47[_0x2502('0x79')]+_0x2502('0x7a')+md5(_0x24ab47['uniqueid']);}else{_0x24ab47[_0x2502('0x7b')]='';}var _0x33c849=_0x4495a0[_0x2502('0x73')]===_0x2502('0x7c')?'eu':_0x2502('0x7d');return getAccessToken(_0x4495a0)['then'](function(_0x24a8f0){_0x4076f5=_0x24a8f0;return getUser(_0x4076f5,_0x33c849,_0x4495a0,_0x28c431[_0x2502('0x32')]);})['then'](function(_0x32aa88){_0x1d1e12=_0x32aa88;logger[_0x2502('0x29')](_0x2502('0x7e'),_0x1d1e12['id']);return getEndUser(_0x4076f5,_0x33c849,_0x4495a0,_0x24ab47[_0x2502('0x7f')],_0x24ab47[_0x2502('0x80')],_0x1d1e12,_0x11278d);})[_0x2502('0x23')](function(_0x4d2ff2){_0x2b17e1=_0x4d2ff2;return getCall(_0x4076f5,_0x33c849,_0x4495a0,_0x1d1e12,_0x2b17e1,_0x11278d,_0x24ab47,_0x2502('0x81'));})[_0x2502('0x23')](function(_0x119fd7){if(_0x119fd7){logger[_0x2502('0x29')](_0x2502('0x82'),_0x119fd7['id']);logger[_0x2502('0x29')](_0x2502('0x83'),_0x2502('0x84'));emit(util['format'](_0x2502('0x85'),_0x28c431[_0x2502('0x13')]),'trigger:browser:url',{'uri':_0x2502('0x86')+_0x4495a0[_0x2502('0x73')]+_0x2502('0x87')+_0x119fd7['id']});}})[_0x2502('0x25')](function(_0x175976){logger[_0x2502('0x26')](_0x2502('0x83'),JSON[_0x2502('0x39')](_0x175976));});};exports['outbound']=function(_0x14deeb,_0x188c91,_0x1c0d7c,_0x1d3b9d,_0x162cd0,_0x4034e6,_0x6e7d74){var _0x2b97d3,_0x319dcc,_0x5de7f1;_0x4034e6[_0x2502('0x73')]=intUtil['stripTrailingSlash'](_0x4034e6['host']);_0x4034e6['serverUrl']=intUtil['stripTrailingSlash'](_0x4034e6[_0x2502('0x74')]);if(_0x6e7d74&&_0x6e7d74['recordingFormat']&&_0x6e7d74[_0x2502('0x88')]!=='none'){logger[_0x2502('0x29')]('[OUTBOUND]',_0x2502('0x77'));_0x188c91['recordingURL']=_0x4034e6[_0x2502('0x74')]+'/api/voice/recordings/'+_0x188c91['uniqueid']+_0x2502('0x7a')+md5(_0x188c91[_0x2502('0x79')]);}var _0x38d96a=_0x4034e6[_0x2502('0x73')]===_0x2502('0x7c')?'eu':_0x2502('0x7d');return getAccessToken(_0x4034e6)['then'](function(_0x513d22){_0x5de7f1=_0x513d22;return getUser(_0x5de7f1,_0x38d96a,_0x4034e6,_0x1d3b9d[_0x2502('0x32')]);})[_0x2502('0x23')](function(_0xcbdf16){_0x2b97d3=_0xcbdf16;logger[_0x2502('0x29')](_0x2502('0x7e'),_0x2b97d3['id']);return getEndUser(_0x5de7f1,_0x38d96a,_0x4034e6,_0x188c91[_0x2502('0x89')],_0x188c91[_0x2502('0x8a')],_0x2b97d3,_0x1c0d7c);})[_0x2502('0x23')](function(_0x1db298){_0x319dcc=_0x1db298;return getCall(_0x5de7f1,_0x38d96a,_0x4034e6,_0x2b97d3,_0x319dcc,_0x1c0d7c,_0x188c91,_0x2502('0x8b'));})[_0x2502('0x23')](function(_0x510907){if(_0x510907){logger['info'](_0x2502('0x82'),_0x510907['id']);logger[_0x2502('0x29')](_0x2502('0x8c'),_0x2502('0x84'));emit(util['format'](_0x2502('0x85'),_0x1d3b9d[_0x2502('0x13')]),_0x2502('0x8d'),{'uri':_0x2502('0x86')+_0x4034e6[_0x2502('0x73')]+'/crm/EntityInfo.do?module=Calls&id='+_0x510907['id']});}})[_0x2502('0x25')](function(_0x51550c){logger[_0x2502('0x26')](_0x2502('0x8c'),JSON[_0x2502('0x39')](_0x51550c));});};exports[_0x2502('0x8e')]=function(_0xf306cf,_0xb1904d,_0x69bde3,_0x35905a,_0x24f04e,_0x177ad5){var _0x3ef97c,_0x61d21e,_0x5a19f3;_0x177ad5[_0x2502('0x73')]=intUtil['stripTrailingSlash'](_0x177ad5[_0x2502('0x73')]);_0x177ad5['serverUrl']=intUtil['stripTrailingSlash'](_0x177ad5['serverUrl']);if(_0x24f04e&&_0x24f04e[_0x2502('0x76')]){logger[_0x2502('0x29')]('['+_0xb1904d[_0x2502('0x61')][_0x2502('0x8f')]()+']','Recording\x20is\x20enabled!');_0xb1904d['recordingURL']=_0x177ad5[_0x2502('0x74')]+'/api/voice/recordings/'+_0xb1904d['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0xb1904d[_0x2502('0x79')]);}else{_0xb1904d[_0x2502('0x7b')]='';}var _0xf3dc3f=_0x177ad5[_0x2502('0x73')]===_0x2502('0x7c')?'eu':_0x2502('0x7d');return getAccessToken(_0x177ad5)[_0x2502('0x23')](function(_0x364154){_0x5a19f3=_0x364154;return getUser(_0x5a19f3,_0xf3dc3f,_0x177ad5);})[_0x2502('0x23')](function(_0x2ef488){_0x3ef97c=_0x2ef488;logger[_0x2502('0x29')](_0x2502('0x7e'),_0x3ef97c['id']);return getEndUser(_0x5a19f3,_0xf3dc3f,_0x177ad5,_0xb1904d[_0x2502('0x7f')],_0xb1904d['calleridnum'],_0x3ef97c,_0x69bde3);})[_0x2502('0x23')](function(_0x41ec55){_0x61d21e=_0x41ec55;return getCall(_0x5a19f3,_0xf3dc3f,_0x177ad5,_0x3ef97c,_0x61d21e,_0x69bde3,_0xb1904d,'Inbound');})[_0x2502('0x23')](function(_0x3e64ad){if(_0x3e64ad){logger[_0x2502('0x29')](_0x2502('0x82'),_0x3e64ad['id']);}})[_0x2502('0x25')](function(_0x270e28){logger[_0x2502('0x26')]('['+_0xb1904d[_0x2502('0x61')][_0x2502('0x8f')]()+']',JSON[_0x2502('0x39')](_0x270e28));});}; \ 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 fb223f9..3a1482d 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 _0xb8cc=['util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xb8cc,0x198));var _0xcb8c=function(_0x2ed42c,_0x129c0f){_0x2ed42c=_0x2ed42c-0x0;var _0x1f454e=_0xb8cc[_0x2ed42c];return _0x1f454e;};'use strict';var util=require(_0xcb8c('0x0'));var sh=require('shelljs');var Mustache=require(_0xcb8c('0x1'));var logger=require(_0xcb8c('0x2'))(_0xcb8c('0x3'));exports[_0xcb8c('0x4')]=function(_0x3fb0b3,_0x19be50){var _0x427f92=_0x3fb0b3[_0xcb8c('0x5')]?_0x3fb0b3[_0xcb8c('0x5')]:_0xcb8c('0x6');var _0x214559=_0x3fb0b3[_0xcb8c('0x7')]?Mustache[_0xcb8c('0x8')](_0x3fb0b3[_0xcb8c('0x7')],_0x19be50):_0x19be50;sh['exec'](_0x214559,function(_0x4ce1ad,_0x1c6ff4,_0x5ce49b){if(_0x4ce1ad!==0x0){logger['error'](util['format'](_0xcb8c('0x9'),_0x427f92,_0x214559,_0x4ce1ad,_0x5ce49b));}else{logger[_0xcb8c('0xa')](util['format'](_0xcb8c('0xb'),_0x427f92,_0x214559,_0x1c6ff4));}});}; \ No newline at end of file +var _0xf390=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','data2','Script','data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x3f4a8d,_0x169076){var _0xee8e1f=function(_0x573910){while(--_0x573910){_0x3f4a8d['push'](_0x3f4a8d['shift']());}};_0xee8e1f(++_0x169076);}(_0xf390,0x1ae));var _0x0f39=function(_0x50ff22,_0x565986){_0x50ff22=_0x50ff22-0x0;var _0x47064c=_0xf390[_0x50ff22];return _0x47064c;};'use strict';var util=require(_0x0f39('0x0'));var sh=require(_0x0f39('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x0f39('0x2'));exports['exec']=function(_0x2eaed7,_0xb68a1c){var _0x4a4d84=_0x2eaed7[_0x0f39('0x3')]?_0x2eaed7[_0x0f39('0x3')]:_0x0f39('0x4');var _0x544b59=_0x2eaed7[_0x0f39('0x5')]?Mustache[_0x0f39('0x6')](_0x2eaed7[_0x0f39('0x5')],_0xb68a1c):_0xb68a1c;sh[_0x0f39('0x7')](_0x544b59,function(_0xefc9af,_0x35c877,_0x6bbeaa){if(_0xefc9af!==0x0){logger[_0x0f39('0x8')](util[_0x0f39('0x9')](_0x0f39('0xa'),_0x4a4d84,_0x544b59,_0xefc9af,_0x6bbeaa));}else{logger[_0x0f39('0xb')](util[_0x0f39('0x9')](_0x0f39('0xc'),_0x4a4d84,_0x544b59,_0x35c877));}});}; \ 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 08a1852..a37de5a 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 _0x3db2=['DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack'];(function(_0x37b1f2,_0x23510b){var _0x2fbd7b=function(_0x216e5d){while(--_0x216e5d){_0x37b1f2['push'](_0x37b1f2['shift']());}};_0x2fbd7b(++_0x23510b);}(_0x3db2,0x1ef));var _0x23db=function(_0x2d9a23,_0x481dc4){_0x2d9a23=_0x2d9a23-0x0;var _0x5198ee=_0x3db2[_0x2d9a23];return _0x5198ee;};'use strict';var rp=require(_0x23db('0x0'));var util=require(_0x23db('0x1'));var _=require(_0x23db('0x2'));var Mustache=require(_0x23db('0x3'));var logger=require('../../../../config/logger')(_0x23db('0x4'));exports[_0x23db('0x5')]=function(_0x128cf3,_0x55dc2d){var _0x1a547f,_0x5975d0;var _0x4d4140={'method':_0x128cf3[_0x23db('0x6')][_0x23db('0x7')](),'uri':Mustache[_0x23db('0x8')](_0x128cf3[_0x23db('0x9')],_0x55dc2d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x128cf3[_0x23db('0xa')])===_0x23db('0xb')&&parseInt(_0x128cf3[_0x23db('0xa')])>=0x1&&parseInt(_0x128cf3['data5'])<=0xa?parseInt(_0x128cf3['data5'])*0x3e8:0x5*0x3e8};try{_0x4d4140[_0x23db('0xc')]=_0x128cf3[_0x23db('0xd')]?JSON[_0x23db('0xe')](Mustache['render'](_0x128cf3[_0x23db('0xd')],_0x55dc2d)):{};}catch(_0x3f8dbf){logger[_0x23db('0xf')](_0x3f8dbf[_0x23db('0x10')]);}switch(_0x128cf3[_0x23db('0x6')]['toUpperCase']()){case'GET':case _0x23db('0x11'):_0x1a547f=null;_0x4d4140['qs']=_0x55dc2d;break;case'POST':case _0x23db('0x12'):if(_0x128cf3[_0x23db('0x13')]){try{_0x1a547f=JSON[_0x23db('0xe')](Mustache[_0x23db('0x8')](_0x128cf3[_0x23db('0x13')],_0x55dc2d));_0x4d4140[_0x23db('0x14')]=_0x1a547f;}catch(_0x4941d4){logger['error'](_0x4941d4[_0x23db('0x10')]);logger[_0x23db('0xf')](_0x23db('0x15'));}}else{_0x1a547f=_0x55dc2d;_0x4d4140[_0x23db('0x14')]=_0x1a547f;}break;}logger[_0x23db('0x16')](util[_0x23db('0x17')](_0x23db('0x18'),_0x128cf3[_0x23db('0x6')],_0x128cf3[_0x23db('0x9')],JSON[_0x23db('0x19')](_0x4d4140)));rp(_0x4d4140)[_0x23db('0x1a')](function(_0x327966){_0x1a547f=!_[_0x23db('0x1b')](_0x1a547f)?_0x23db('0x1c')+_0x1a547f:'';_0x5975d0=typeof _0x327966['body']==='object'?JSON[_0x23db('0x19')](_0x327966[_0x23db('0x14')]):_0x327966[_0x23db('0x14')];logger[_0x23db('0x16')](util[_0x23db('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x128cf3[_0x23db('0x6')],_0x128cf3[_0x23db('0x9')],_0x327966[_0x23db('0x1d')],_0x5975d0));})['catch'](function(_0x1a1cf8){logger[_0x23db('0xf')](util[_0x23db('0x17')](_0x23db('0x1e'),_0x128cf3[_0x23db('0x6')],_0x128cf3['data2'],_0x1a1cf8['statusCode'],_0x1a1cf8[_0x23db('0x1f')],_0x1a1cf8['message']));});}; \ No newline at end of file +var _0xadd3=['stack','toUpperCase','GET','DELETE','PUT','render','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','../../../../config/logger','data1','data2','data5','headers','data6','parse','error'];(function(_0x5c427b,_0x255c1a){var _0x57b949=function(_0x2b5540){while(--_0x2b5540){_0x5c427b['push'](_0x5c427b['shift']());}};_0x57b949(++_0x255c1a);}(_0xadd3,0xe6));var _0x3add=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xadd3[_0x599f41];return _0x2e4d58;};'use strict';var rp=require(_0x3add('0x0'));var util=require(_0x3add('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x3add('0x2'))('trigger');exports['exec']=function(_0x1901af,_0xef0da0){var _0x4df567,_0x4fbf90;var _0x32e222={'method':_0x1901af[_0x3add('0x3')]['toUpperCase'](),'uri':Mustache['render'](_0x1901af[_0x3add('0x4')],_0xef0da0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1901af[_0x3add('0x5')])==='number'&&parseInt(_0x1901af[_0x3add('0x5')])>=0x1&&parseInt(_0x1901af[_0x3add('0x5')])<=0xa?parseInt(_0x1901af[_0x3add('0x5')])*0x3e8:0x5*0x3e8};try{_0x32e222[_0x3add('0x6')]=_0x1901af[_0x3add('0x7')]?JSON[_0x3add('0x8')](Mustache['render'](_0x1901af[_0x3add('0x7')],_0xef0da0)):{};}catch(_0x2b2cfd){logger[_0x3add('0x9')](_0x2b2cfd[_0x3add('0xa')]);}switch(_0x1901af[_0x3add('0x3')][_0x3add('0xb')]()){case _0x3add('0xc'):case _0x3add('0xd'):_0x4df567=null;_0x32e222['qs']=_0xef0da0;break;case'POST':case _0x3add('0xe'):if(_0x1901af['data7']){try{_0x4df567=JSON[_0x3add('0x8')](Mustache[_0x3add('0xf')](_0x1901af[_0x3add('0x10')],_0xef0da0));_0x32e222[_0x3add('0x11')]=_0x4df567;}catch(_0x221b98){logger[_0x3add('0x9')](_0x221b98[_0x3add('0xa')]);logger[_0x3add('0x9')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4df567=_0xef0da0;_0x32e222[_0x3add('0x11')]=_0x4df567;}break;}logger[_0x3add('0x12')](util['format'](_0x3add('0x13'),_0x1901af[_0x3add('0x3')],_0x1901af['data2'],JSON[_0x3add('0x14')](_0x32e222)));rp(_0x32e222)[_0x3add('0x15')](function(_0x5940d4){_0x4df567=!_[_0x3add('0x16')](_0x4df567)?',\x20request\x20body:\x20'+_0x4df567:'';_0x4fbf90=typeof _0x5940d4[_0x3add('0x11')]===_0x3add('0x17')?JSON[_0x3add('0x14')](_0x5940d4[_0x3add('0x11')]):_0x5940d4[_0x3add('0x11')];logger['info'](util[_0x3add('0x18')](_0x3add('0x19'),_0x1901af[_0x3add('0x3')],_0x1901af[_0x3add('0x4')],_0x5940d4[_0x3add('0x1a')],_0x4fbf90));})['catch'](function(_0x343fb8){logger[_0x3add('0x9')](util['format'](_0x3add('0x1b'),_0x1901af['data1'],_0x1901af['data2'],_0x343fb8['statusCode'],_0x343fb8[_0x3add('0x1c')],_0x343fb8[_0x3add('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 0a9dbda..e56da3e 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 _0x7a47=['exports','jayson/promise','../../config/logger','routing','http','Request','then','debug','rpc','error','message','result','catch'];(function(_0x25e396,_0x44642b){var _0x229ff6=function(_0x100f4f){while(--_0x100f4f){_0x25e396['push'](_0x25e396['shift']());}};_0x229ff6(++_0x44642b);}(_0x7a47,0xc4));var _0x77a4=function(_0x272d13,_0x529a33){_0x272d13=_0x272d13-0x0;var _0x500791=_0x7a47[_0x272d13];return _0x500791;};'use strict';var jayson=require(_0x77a4('0x0'));var BPromise=require('bluebird');var logger=require(_0x77a4('0x1'))(_0x77a4('0x2'));var client=jayson['client'][_0x77a4('0x3')]({'port':0x2329});client[_0x77a4('0x4')]=function(_0x211021,_0x503e27){return new BPromise(function(_0xf4bb14,_0x171041){return client['request'](_0x211021,_0x503e27)[_0x77a4('0x5')](function(_0x39f5d4){logger[_0x77a4('0x6')](_0x77a4('0x7'),_0x77a4('0x2'),_0x211021,_0x503e27,_0x39f5d4);if(_0x39f5d4[_0x77a4('0x8')]){logger[_0x77a4('0x8')](_0x77a4('0x7'),_0x77a4('0x2'),_0x211021,_0x39f5d4['error']['message'],_0x503e27);return _0x171041(_0x39f5d4[_0x77a4('0x8')][_0x77a4('0x9')]);}else{return _0xf4bb14(_0x39f5d4[_0x77a4('0xa')]);}})[_0x77a4('0xb')](function(_0x1afa06){logger[_0x77a4('0x8')](_0x77a4('0x7'),'routing',_0x211021,_0x1afa06,_0x503e27);return _0x171041(_0x1afa06);});});};module[_0x77a4('0xc')]=client; \ No newline at end of file +var _0x3673=['jayson/promise','bluebird','client','http','Request','request','then','debug','routing','error','rpc','message','result','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3673,0x1dc));var _0x3367=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x3673[_0x3ff085];return _0x2b68c3;};'use strict';var jayson=require(_0x3367('0x0'));var BPromise=require(_0x3367('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x3367('0x2')][_0x3367('0x3')]({'port':0x2329});client[_0x3367('0x4')]=function(_0x2bd431,_0x32633b){return new BPromise(function(_0x3eaccc,_0x5bb037){return client[_0x3367('0x5')](_0x2bd431,_0x32633b)[_0x3367('0x6')](function(_0x535e56){logger[_0x3367('0x7')]('rpc',_0x3367('0x8'),_0x2bd431,_0x32633b,_0x535e56);if(_0x535e56[_0x3367('0x9')]){logger[_0x3367('0x9')](_0x3367('0xa'),_0x3367('0x8'),_0x2bd431,_0x535e56[_0x3367('0x9')][_0x3367('0xb')],_0x32633b);return _0x5bb037(_0x535e56[_0x3367('0x9')][_0x3367('0xb')]);}else{return _0x3eaccc(_0x535e56[_0x3367('0xc')]);}})['catch'](function(_0x452532){logger['error'](_0x3367('0xa'),'routing',_0x2bd431,_0x452532,_0x32633b);return _0x5bb037(_0x452532);});});};module[_0x3367('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f7e4873..0a1aaca 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 _0x742b=['bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','mailAccounts','loginMailFrequency','catch','log'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x742b,0xb4));var _0xb742=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x742b[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0xb742('0x0'));var server=require(_0xb742('0x1'));var Realtime=require(_0xb742('0x2'));var EmailChannel=require(_0xb742('0x3'));var mailAccount=require(_0xb742('0x4'));var setting=require(_0xb742('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb742('0x6')]()['then'](mailAccount['getMailAccounts']())[_0xb742('0x7')](realtime['initMailAccounts']())[_0xb742('0x7')](function(){email['refresh'](realtime[_0xb742('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xb742('0x7')](function(){return initRealtime();})[_0xb742('0x7')](function(){return setting['getSettings']();})[_0xb742('0x7')](function(_0x1eb614){return setInterval(initRealtime,_0x1eb614[_0xb742('0x9')]*0x3e8);})[_0xb742('0xa')](function(_0x15b3bc){console[_0xb742('0xb')](_0x15b3bc);});}main(); \ No newline at end of file +var _0xb9c5=['getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb9c5,0x90));var _0x5b9c=function(_0x45d05e,_0x4fcb58){_0x45d05e=_0x45d05e-0x0;var _0x9ecb25=_0xb9c5[_0x45d05e];return _0x9ecb25;};'use strict';var BPromise=require('bluebird');var server=require(_0x5b9c('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x5b9c('0x1'));var mailAccount=require(_0x5b9c('0x2'));var setting=require(_0x5b9c('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5b9c('0x4')]()[_0x5b9c('0x5')](mailAccount[_0x5b9c('0x6')]())[_0x5b9c('0x5')](realtime[_0x5b9c('0x7')]())[_0x5b9c('0x5')](function(){email[_0x5b9c('0x8')](realtime[_0x5b9c('0x9')]);return realtime;});}function main(){return server[_0x5b9c('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x5b9c('0x5')](function(){return setting[_0x5b9c('0xb')]();})[_0x5b9c('0x5')](function(_0x2945c7){return setInterval(initRealtime,_0x2945c7[_0x5b9c('0xc')]*0x3e8);})[_0x5b9c('0xd')](function(_0x3ff4ea){console[_0x5b9c('0xe')](_0x3ff4ea);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 068837b..16e408f 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 _0xf765=['moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','key','active','Imap','status','messageStatus','total','stringify','emit','mailAccount:update','prototype','hasOwnProperty','box','handleImapBox','email','bind','end','handleImapEnd','error','handleImapError','isNil','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','verifySmtp','Smtp','verify','lodash'];(function(_0x11365c,_0x5edf7f){var _0x9f192d=function(_0x3bba8d){while(--_0x3bba8d){_0x11365c['push'](_0x11365c['shift']());}};_0x9f192d(++_0x5edf7f);}(_0xf765,0x67));var _0x5f76=function(_0x1aa934,_0x37cc9d){_0x1aa934=_0x1aa934-0x0;var _0x143ae3=_0xf765[_0x1aa934];return _0x143ae3;};'use strict';var _=require(_0x5f76('0x0'));var moment=require(_0x5f76('0x1'));var BPromise=require(_0x5f76('0x2'));var md5=require(_0x5f76('0x3'));var Redis=require(_0x5f76('0x4'));var config=require(_0x5f76('0x5'));var logger=require(_0x5f76('0x6'))('email');config[_0x5f76('0x7')]=_[_0x5f76('0x8')](config[_0x5f76('0x7')],{'host':_0x5f76('0x9'),'port':0x18eb});var io=require(_0x5f76('0xa'))(new Redis(config['redis']));var EmailImap=require(_0x5f76('0xb'));var EmailSmtp=require(_0x5f76('0xc'));var mailAccount=require(_0x5f76('0xd'));var md5Accounts={};function EmailChannel(_0x2bf3a3){logger[_0x5f76('0xe')](_0x5f76('0xf'));this[_0x5f76('0x10')]=_0x2bf3a3[_0x5f76('0x10')];this[_0x5f76('0x11')]={};this[_0x5f76('0x12')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x34c332){var _0x3b006e=this[_0x5f76('0x10')][_0x34c332];var _0x27bfe8={'id':_0x3b006e['id'],'name':_0x3b006e['name'],'key':_0x3b006e[_0x5f76('0x13')],'active':_0x3b006e[_0x5f76('0x14')],'Imap':{'status':_0x3b006e[_0x5f76('0x15')][_0x5f76('0x16')],'messageStatus':_0x3b006e[_0x5f76('0x15')][_0x5f76('0x17')],'total':_0x3b006e[_0x5f76('0x15')][_0x5f76('0x18')]}};if(_['isNil'](md5Accounts[_0x34c332])){md5Accounts[_0x34c332]={};}var _0x4fd7f2=md5(JSON[_0x5f76('0x19')](_0x27bfe8));if(md5Accounts[_0x34c332][_0x5f76('0x3')]!==_0x4fd7f2){md5Accounts[_0x34c332][_0x5f76('0x3')]=_0x4fd7f2;io[_0x5f76('0x1a')](_0x5f76('0x1b'),_0x27bfe8);}};EmailChannel[_0x5f76('0x1c')]['refresh']=function(_0x15c70d){for(var _0x5d537e in _0x15c70d){if(_0x15c70d['hasOwnProperty'](_0x5d537e)){if(_0x15c70d[_0x5d537e]['Imap']&&_0x15c70d[_0x5d537e][_0x5f76('0x14')]){var _0x16978b=_0x15c70d[_0x5d537e][_0x5f76('0x15')];if(!this[_0x5f76('0x11')][_0x5f76('0x1d')](_0x16978b['id'])){this['imapAccounts'][_0x16978b['id']]=new EmailImap(_0x16978b,_0x15c70d[_0x5d537e]['email']);this[_0x5f76('0x11')][_0x16978b['id']]['on'](_0x5f76('0x1e'),this[_0x5f76('0x1f')]['bind'](this,_0x5d537e));this[_0x5f76('0x11')][_0x16978b['id']]['on'](_0x5f76('0x20'),this['handleImapEmail'][_0x5f76('0x21')](this,_0x5d537e));this[_0x5f76('0x11')][_0x16978b['id']]['on'](_0x5f76('0x22'),this[_0x5f76('0x23')][_0x5f76('0x21')](this,_0x5d537e));this[_0x5f76('0x11')][_0x16978b['id']]['on'](_0x5f76('0x24'),this[_0x5f76('0x25')][_0x5f76('0x21')](this,_0x5d537e));}}else{if(_[_0x5f76('0x26')](this[_0x5f76('0x10')][_0x5d537e][_0x5f76('0x15')])){this[_0x5f76('0x10')][_0x5d537e][_0x5f76('0x15')]={};}this[_0x5f76('0x10')][_0x5d537e][_0x5f76('0x15')][_0x5f76('0x16')]=_0x5f76('0x27');this[_0x5f76('0x10')][_0x5d537e][_0x5f76('0x15')]['messageStatus']='';this[_0x5f76('0x1a')](_0x5d537e);}}}};EmailChannel[_0x5f76('0x1c')][_0x5f76('0x1f')]=function(_0x58139f,_0x6d511e){if(this['mailAccounts'][_0x58139f]){this[_0x5f76('0x10')][_0x58139f][_0x5f76('0x15')][_0x5f76('0x16')]='connected';this[_0x5f76('0x10')][_0x58139f][_0x5f76('0x15')][_0x5f76('0x17')]=_0x6d511e['name'];if(_0x6d511e[_0x5f76('0x28')]){this['mailAccounts'][_0x58139f][_0x5f76('0x15')][_0x5f76('0x18')]=_0x6d511e[_0x5f76('0x28')][_0x5f76('0x18')];}return this[_0x5f76('0x1a')](_0x58139f);}};EmailChannel[_0x5f76('0x1c')]['handleImapEmail']=function(_0x1ec70b,_0x47346c){logger[_0x5f76('0xe')](_0x5f76('0x29'),_0x47346c[_0x5f76('0x2a')],_0x47346c['lastName'],_0x47346c['from'],_0x1ec70b);if(this[_0x5f76('0x10')][_0x1ec70b]){return mailAccount[_0x5f76('0x2b')](_0x1ec70b,_0x47346c)[_0x5f76('0x2c')](function(_0x17cdac){if(_0x17cdac){logger[_0x5f76('0xe')](_0x5f76('0x2d'));}})[_0x5f76('0x2e')](function(_0x2d2ec7){logger['error'](_0x5f76('0x2f'),JSON[_0x5f76('0x19')](_0x2d2ec7));});}};EmailChannel[_0x5f76('0x1c')][_0x5f76('0x23')]=function(_0x228c44){if(this[_0x5f76('0x10')][_0x228c44]&&this[_0x5f76('0x10')][_0x228c44]['Imap']){if(this[_0x5f76('0x11')][this[_0x5f76('0x10')][_0x228c44][_0x5f76('0x15')]['id']]){delete this[_0x5f76('0x11')][this['mailAccounts'][_0x228c44][_0x5f76('0x15')]['id']];}this[_0x5f76('0x10')][_0x228c44][_0x5f76('0x15')][_0x5f76('0x30')]=moment();this[_0x5f76('0x1a')](_0x228c44);}};EmailChannel['prototype'][_0x5f76('0x25')]=function(_0x5dc18d,_0x3fec37){if(this[_0x5f76('0x10')][_0x5dc18d]){this[_0x5f76('0x10')][_0x5dc18d][_0x5f76('0x15')]['status']='error';this[_0x5f76('0x10')][_0x5dc18d][_0x5f76('0x15')]['messageStatus']=_0x3fec37;return this[_0x5f76('0x1a')](_0x5dc18d);}};EmailChannel['prototype']['sendMail']=function(_0x1eabdd,_0x3f74b2){return this[_0x5f76('0x12')]['send'](_0x1eabdd,_0x3f74b2);};EmailChannel[_0x5f76('0x1c')][_0x5f76('0x31')]=function(_0x5790e5){var _0x25cec3=this;if(this[_0x5f76('0x10')][_0x5790e5['id']]){if(_[_0x5f76('0x26')](this[_0x5f76('0x10')][_0x5790e5['id']][_0x5f76('0x32')])){this[_0x5f76('0x10')][_0x5790e5['id']]['Smtp']={};}this[_0x5f76('0x10')][_0x5790e5['id']][_0x5f76('0x32')][_0x5f76('0x30')]=moment();return new BPromise(function(_0x2366b3,_0x20f313){return _0x25cec3[_0x5f76('0x12')]['verify'](_0x5790e5)[_0x5f76('0x2c')](function(_0x10a46b){_0x25cec3[_0x5f76('0x10')][_0x5790e5['id']]['Smtp'][_0x5f76('0x16')]='verified';_0x25cec3[_0x5f76('0x10')][_0x5790e5['id']]['Smtp'][_0x5f76('0x17')]='';_0x25cec3['emit'](_0x5790e5['id']);_0x2366b3(_0x10a46b);})[_0x5f76('0x2e')](function(_0xc20e93){_0x25cec3['mailAccounts'][_0x5790e5['id']][_0x5f76('0x32')][_0x5f76('0x16')]=_0x5f76('0x24');_0x25cec3[_0x5f76('0x10')][_0x5790e5['id']]['Smtp'][_0x5f76('0x17')]=_0xc20e93;_0x25cec3[_0x5f76('0x1a')](_0x5790e5['id']);_0x20f313(_0xc20e93);});});}return this['smtp'][_0x5f76('0x33')](_0x5790e5);};module['exports']=EmailChannel; \ No newline at end of file +var _0x094c=['catch','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','error','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x094c,0x16d));var _0xc094=function(_0x1de841,_0x278c7c){_0x1de841=_0x1de841-0x0;var _0x19bce4=_0x094c[_0x1de841];return _0x19bce4;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xc094('0x0'));var md5=require('md5');var Redis=require(_0xc094('0x1'));var config=require(_0xc094('0x2'));var logger=require(_0xc094('0x3'))(_0xc094('0x4'));config[_0xc094('0x5')]=_[_0xc094('0x6')](config[_0xc094('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc094('0x7'))(new Redis(config[_0xc094('0x5')]));var EmailImap=require(_0xc094('0x8'));var EmailSmtp=require(_0xc094('0x9'));var mailAccount=require(_0xc094('0xa'));var md5Accounts={};function EmailChannel(_0x139f18){logger[_0xc094('0xb')](_0xc094('0xc'));this[_0xc094('0xd')]=_0x139f18[_0xc094('0xd')];this[_0xc094('0xe')]={};this[_0xc094('0xf')]=new EmailSmtp();}EmailChannel[_0xc094('0x10')][_0xc094('0x11')]=function(_0x17ba1b){var _0x2faaae=this[_0xc094('0xd')][_0x17ba1b];var _0x27da3b={'id':_0x2faaae['id'],'name':_0x2faaae[_0xc094('0x12')],'key':_0x2faaae[_0xc094('0x13')],'active':_0x2faaae[_0xc094('0x14')],'Imap':{'status':_0x2faaae[_0xc094('0x15')]['status'],'messageStatus':_0x2faaae['Imap'][_0xc094('0x16')],'total':_0x2faaae[_0xc094('0x15')][_0xc094('0x17')]}};if(_[_0xc094('0x18')](md5Accounts[_0x17ba1b])){md5Accounts[_0x17ba1b]={};}var _0x194ae1=md5(JSON[_0xc094('0x19')](_0x27da3b));if(md5Accounts[_0x17ba1b][_0xc094('0x1a')]!==_0x194ae1){md5Accounts[_0x17ba1b][_0xc094('0x1a')]=_0x194ae1;io[_0xc094('0x11')](_0xc094('0x1b'),_0x27da3b);}};EmailChannel['prototype'][_0xc094('0x1c')]=function(_0x1a269b){for(var _0x3aa5c4 in _0x1a269b){if(_0x1a269b[_0xc094('0x1d')](_0x3aa5c4)){if(_0x1a269b[_0x3aa5c4][_0xc094('0x15')]&&_0x1a269b[_0x3aa5c4]['active']){var _0x2ad1fd=_0x1a269b[_0x3aa5c4][_0xc094('0x15')];if(!this[_0xc094('0xe')][_0xc094('0x1d')](_0x2ad1fd['id'])){this[_0xc094('0xe')][_0x2ad1fd['id']]=new EmailImap(_0x2ad1fd,_0x1a269b[_0x3aa5c4][_0xc094('0x4')]);this[_0xc094('0xe')][_0x2ad1fd['id']]['on'](_0xc094('0x1e'),this[_0xc094('0x1f')][_0xc094('0x20')](this,_0x3aa5c4));this['imapAccounts'][_0x2ad1fd['id']]['on']('email',this[_0xc094('0x21')][_0xc094('0x20')](this,_0x3aa5c4));this[_0xc094('0xe')][_0x2ad1fd['id']]['on']('end',this['handleImapEnd']['bind'](this,_0x3aa5c4));this['imapAccounts'][_0x2ad1fd['id']]['on'](_0xc094('0x22'),this['handleImapError']['bind'](this,_0x3aa5c4));}}else{if(_[_0xc094('0x18')](this['mailAccounts'][_0x3aa5c4][_0xc094('0x15')])){this['mailAccounts'][_0x3aa5c4]['Imap']={};}this[_0xc094('0xd')][_0x3aa5c4]['Imap'][_0xc094('0x23')]='disabled';this['mailAccounts'][_0x3aa5c4]['Imap'][_0xc094('0x16')]='';this[_0xc094('0x11')](_0x3aa5c4);}}}};EmailChannel['prototype'][_0xc094('0x1f')]=function(_0x311a5a,_0x33388a){if(this['mailAccounts'][_0x311a5a]){this['mailAccounts'][_0x311a5a][_0xc094('0x15')][_0xc094('0x23')]=_0xc094('0x24');this[_0xc094('0xd')][_0x311a5a][_0xc094('0x15')][_0xc094('0x16')]=_0x33388a['name'];if(_0x33388a[_0xc094('0x25')]){this[_0xc094('0xd')][_0x311a5a]['Imap'][_0xc094('0x17')]=_0x33388a['messages'][_0xc094('0x17')];}return this[_0xc094('0x11')](_0x311a5a);}};EmailChannel[_0xc094('0x10')][_0xc094('0x21')]=function(_0x394179,_0x5b8537){logger[_0xc094('0xb')](_0xc094('0x26'),_0x5b8537[_0xc094('0x27')],_0x5b8537['lastName'],_0x5b8537[_0xc094('0x28')],_0x394179);if(this[_0xc094('0xd')][_0x394179]){return mailAccount[_0xc094('0x29')](_0x394179,_0x5b8537)['then'](function(_0x59c3df){if(_0x59c3df){logger['info'](_0xc094('0x2a'));}})['catch'](function(_0x2b599f){logger[_0xc094('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xc094('0x19')](_0x2b599f));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x442188){if(this[_0xc094('0xd')][_0x442188]&&this[_0xc094('0xd')][_0x442188][_0xc094('0x15')]){if(this['imapAccounts'][this[_0xc094('0xd')][_0x442188][_0xc094('0x15')]['id']]){delete this[_0xc094('0xe')][this[_0xc094('0xd')][_0x442188]['Imap']['id']];}this['mailAccounts'][_0x442188]['Imap'][_0xc094('0x2b')]=moment();this[_0xc094('0x11')](_0x442188);}};EmailChannel[_0xc094('0x10')]['handleImapError']=function(_0x1c5b6e,_0xcce5fe){if(this[_0xc094('0xd')][_0x1c5b6e]){this['mailAccounts'][_0x1c5b6e][_0xc094('0x15')][_0xc094('0x23')]=_0xc094('0x22');this[_0xc094('0xd')][_0x1c5b6e]['Imap'][_0xc094('0x16')]=_0xcce5fe;return this[_0xc094('0x11')](_0x1c5b6e);}};EmailChannel[_0xc094('0x10')][_0xc094('0x2c')]=function(_0x3f18b4,_0x133c3d){return this[_0xc094('0xf')][_0xc094('0x2d')](_0x3f18b4,_0x133c3d);};EmailChannel[_0xc094('0x10')][_0xc094('0x2e')]=function(_0x1d6341){var _0x1c4778=this;if(this[_0xc094('0xd')][_0x1d6341['id']]){if(_[_0xc094('0x18')](this[_0xc094('0xd')][_0x1d6341['id']]['Smtp'])){this[_0xc094('0xd')][_0x1d6341['id']][_0xc094('0x2f')]={};}this['mailAccounts'][_0x1d6341['id']][_0xc094('0x2f')]['lastSync']=moment();return new BPromise(function(_0x1effa6,_0x53c860){return _0x1c4778[_0xc094('0xf')][_0xc094('0x30')](_0x1d6341)[_0xc094('0x31')](function(_0x86843c){_0x1c4778['mailAccounts'][_0x1d6341['id']]['Smtp'][_0xc094('0x23')]=_0xc094('0x32');_0x1c4778[_0xc094('0xd')][_0x1d6341['id']][_0xc094('0x2f')][_0xc094('0x16')]='';_0x1c4778['emit'](_0x1d6341['id']);_0x1effa6(_0x86843c);})[_0xc094('0x33')](function(_0x47d6ae){_0x1c4778[_0xc094('0xd')][_0x1d6341['id']][_0xc094('0x2f')][_0xc094('0x23')]=_0xc094('0x22');_0x1c4778[_0xc094('0xd')][_0x1d6341['id']]['Smtp']['messageStatus']=_0x47d6ae;_0x1c4778[_0xc094('0x11')](_0x1d6341['id']);_0x53c860(_0x47d6ae);});});}return this[_0xc094('0xf')][_0xc094('0x30')](_0x1d6341);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 045de0b..3db8a3a 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 _0xe008=['handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','account','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','imap','lodash','randomstring','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','once','ready','handleReady','bind','end','handleEnd','connect','prototype','connTimeout','service','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN'];(function(_0x5828c6,_0x4bd80e){var _0x4a8512=function(_0x18b527){while(--_0x18b527){_0x5828c6['push'](_0x5828c6['shift']());}};_0x4a8512(++_0x4bd80e);}(_0xe008,0xcc));var _0x8e00=function(_0x5ee867,_0xaf19c0){_0x5ee867=_0x5ee867-0x0;var _0x555d02=_0xe008[_0x5ee867];return _0x555d02;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0x8e00('0x0'));var _=require(_0x8e00('0x1'));var rs=require(_0x8e00('0x2'));var simpleParser=require(_0x8e00('0x3'))[_0x8e00('0x4')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x8e00('0x5'))[_0x8e00('0x6')];var utils=require(_0x8e00('0x7'));var logger=require(_0x8e00('0x8'))(_0x8e00('0x9'));function EmailImap(_0x1b9c06,_0x3d294a){this[_0x8e00('0xa')]=_0x8e00('0xb');this['account']=this[_0x8e00('0xc')](_0x1b9c06,_0x3d294a);this[_0x8e00('0x0')]=new Imap(this['account']);this['imap'][_0x8e00('0xd')](_0x8e00('0xe'),this[_0x8e00('0xf')][_0x8e00('0x10')](this));this['imap'][_0x8e00('0xd')](_0x8e00('0x11'),this[_0x8e00('0x12')][_0x8e00('0x10')](this));this[_0x8e00('0x0')]['on']('error',this['handleError']['bind'](this));this[_0x8e00('0x0')][_0x8e00('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x8e00('0x14')][_0x8e00('0xc')]=function(_0x10ec78,_0x252768){var _0x33ad3d={'connTimeout':_0x10ec78[_0x8e00('0x15')]?_0x10ec78[_0x8e00('0x15')]*0x3e8:0x2710,'authTimeout':_0x10ec78['authTimeout']?_0x10ec78['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x10ec78[_0x8e00('0x16')])){if(_0x10ec78['authentication']){_0x33ad3d[_0x8e00('0x17')]=_0x10ec78[_0x8e00('0x17')];_0x33ad3d[_0x8e00('0x18')]=_0x10ec78[_0x8e00('0x18')];}_0x33ad3d[_0x8e00('0x19')]=_0x10ec78[_0x8e00('0x19')];_0x33ad3d['port']=_0x10ec78[_0x8e00('0x1a')]||0x3e1;if(_0x10ec78[_0x8e00('0x1b')]){_0x33ad3d[_0x8e00('0x1b')]=!![];}else{_0x33ad3d[_0x8e00('0x1b')]=![];_0x33ad3d[_0x8e00('0x1c')]=_0x8e00('0x1d');}}else{_0x33ad3d[_0x8e00('0x17')]=_0x10ec78['user'];_0x33ad3d[_0x8e00('0x18')]=_0x10ec78[_0x8e00('0x18')];_0x33ad3d[_0x8e00('0x19')]=utils['getHost'](_0x10ec78[_0x8e00('0x16')]);_0x33ad3d[_0x8e00('0x1a')]=0x3e1;_0x33ad3d[_0x8e00('0x1b')]=!![];}_0x33ad3d[_0x8e00('0x9')]=_0x252768||_0x10ec78['user']||_0x8e00('0x1e');return _0x33ad3d;};EmailImap[_0x8e00('0x14')][_0x8e00('0xf')]=function(){this[_0x8e00('0x0')][_0x8e00('0x1f')](this[_0x8e00('0xa')],![],this['handleOpenBox'][_0x8e00('0x10')](this));};EmailImap[_0x8e00('0x14')][_0x8e00('0x20')]=function(_0x1ca291,_0x324207){if(_0x1ca291){this[_0x8e00('0x21')](_0x1ca291,!![]);}else{this[_0x8e00('0x22')](_0x8e00('0x23'),_0x324207);this[_0x8e00('0x24')]();}};EmailImap['prototype'][_0x8e00('0x25')]=function(_0x57a308){if(_0x57a308){this[_0x8e00('0x21')](_0x57a308,!![]);}else{this[_0x8e00('0x0')][_0x8e00('0x11')]();}};EmailImap[_0x8e00('0x14')]['readUnseen']=function(){this[_0x8e00('0x0')][_0x8e00('0x26')]([_0x8e00('0x27')],this[_0x8e00('0x28')][_0x8e00('0x10')](this));};EmailImap[_0x8e00('0x14')][_0x8e00('0x28')]=function(_0x4c5572,_0x18161a){if(_0x4c5572){this[_0x8e00('0x21')](_0x4c5572,!![]);}else{if(_0x18161a[_0x8e00('0x29')]){try{var _0x2b54b9=this[_0x8e00('0x0')][_0x8e00('0x2a')](_0x18161a,{'bodies':'','markSeen':!![]});_0x2b54b9['on'](_0x8e00('0x2b'),this[_0x8e00('0x2c')]['bind'](this));_0x2b54b9[_0x8e00('0xd')](_0x8e00('0x2d'),this[_0x8e00('0x2e')]['bind'](this));_0x2b54b9[_0x8e00('0xd')]('end',this[_0x8e00('0x2f')][_0x8e00('0x10')](this));}catch(_0x7e05d2){logger[_0x8e00('0x2d')](_0x7e05d2);}}else{this[_0x8e00('0x0')]['closeBox'](!![],this[_0x8e00('0x25')]['bind'](this));}}};EmailImap[_0x8e00('0x14')][_0x8e00('0x2c')]=function(_0x4a66dc,_0x3e96e3){_0x4a66dc['on']('body',this[_0x8e00('0x30')]['bind'](this));_0x4a66dc[_0x8e00('0xd')](_0x8e00('0x31'),this['handleMessageAttributes'][_0x8e00('0x10')](this));_0x4a66dc[_0x8e00('0xd')]('end',this[_0x8e00('0x32')][_0x8e00('0x10')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x5d4806,_0x38bdd3){simpleParser(_0x5d4806,{'Iconv':Iconv},this[_0x8e00('0x33')]['bind'](this));};EmailImap['prototype'][_0x8e00('0x34')]=function(_0x2dbcee){};EmailImap['prototype'][_0x8e00('0x32')]=function(){};EmailImap[_0x8e00('0x14')][_0x8e00('0x33')]=function(_0x3b994e,_0x4e0100){if(_0x3b994e){logger[_0x8e00('0x2d')](_0x3b994e);}else{var _0x40c012=this;utils[_0x8e00('0x35')](this[_0x8e00('0x36')],_0x4e0100,function(_0x50de9a){_0x40c012[_0x8e00('0x22')](_0x8e00('0x9'),_0x50de9a);});}};EmailImap[_0x8e00('0x14')][_0x8e00('0x2f')]=function(){this[_0x8e00('0x0')][_0x8e00('0x37')](!![],this[_0x8e00('0x25')][_0x8e00('0x10')](this));};EmailImap[_0x8e00('0x14')]['handleFetchError']=function(_0x43083a){this[_0x8e00('0x21')](_0x43083a);this[_0x8e00('0x0')]['closeBox'](!![],this['handleCloseBox'][_0x8e00('0x10')](this));};EmailImap[_0x8e00('0x14')][_0x8e00('0x12')]=function(){this[_0x8e00('0x22')](_0x8e00('0x11'));};EmailImap[_0x8e00('0x14')][_0x8e00('0x21')]=function(_0x23d813,_0x2decef){logger[_0x8e00('0x2d')](_0x8e00('0x21'),this[_0x8e00('0x36')][_0x8e00('0x9')],JSON[_0x8e00('0x38')](_0x23d813));var _0x2d7311='';if(_0x23d813){if(_0x23d813['textCode']){_0x2d7311=_0x23d813[_0x8e00('0x39')];}else{for(var _0x5b3798 in _0x23d813){if(_0x23d813[_0x8e00('0x3a')](_0x5b3798)){_0x2d7311+=_[_0x8e00('0x3b')](_0x5b3798)+':\x20'+_0x23d813[_0x5b3798]+'\x0a';}}}}if(_0x2decef){this['imap'][_0x8e00('0x11')]();}else{this['emit'](_0x8e00('0x2d'),_0x2d7311);this[_0x8e00('0x22')](_0x8e00('0x11'));}};module[_0x8e00('0x3c')]=EmailImap; \ No newline at end of file +var _0x1f83=['path','util','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','mailbox','INBOX','getAccount','imap','account','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','getHost','service','email','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','error','parser','handleFetchEnd','handleFetchError','stringify','textCode','hasOwnProperty','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f83,0x17a));var _0x31f8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1f83[_0x42cae2];return _0x5f256f;};'use strict';var fs=require('fs');var path=require(_0x31f8('0x0'));var util=require(_0x31f8('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x31f8('0x2'));var simpleParser=require(_0x31f8('0x3'))[_0x31f8('0x4')];var Iconv=require(_0x31f8('0x5'))[_0x31f8('0x6')];var EventEmitter=require(_0x31f8('0x7'))[_0x31f8('0x8')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x3a7d30,_0x429599){this[_0x31f8('0x9')]=_0x31f8('0xa');this['account']=this[_0x31f8('0xb')](_0x3a7d30,_0x429599);this[_0x31f8('0xc')]=new Imap(this[_0x31f8('0xd')]);this['imap'][_0x31f8('0xe')](_0x31f8('0xf'),this[_0x31f8('0x10')][_0x31f8('0x11')](this));this[_0x31f8('0xc')][_0x31f8('0xe')](_0x31f8('0x12'),this[_0x31f8('0x13')]['bind'](this));this[_0x31f8('0xc')]['on']('error',this[_0x31f8('0x14')][_0x31f8('0x11')](this));this[_0x31f8('0xc')][_0x31f8('0x15')]();}util[_0x31f8('0x16')](EmailImap,EventEmitter);EmailImap[_0x31f8('0x17')][_0x31f8('0xb')]=function(_0x2148ee,_0xc8f0a8){var _0xc6b471={'connTimeout':_0x2148ee[_0x31f8('0x18')]?_0x2148ee[_0x31f8('0x18')]*0x3e8:0x2710,'authTimeout':_0x2148ee[_0x31f8('0x19')]?_0x2148ee[_0x31f8('0x19')]*0x3e8:0x1388};if(_[_0x31f8('0x1a')](_0x2148ee['service'])){if(_0x2148ee[_0x31f8('0x1b')]){_0xc6b471[_0x31f8('0x1c')]=_0x2148ee[_0x31f8('0x1c')];_0xc6b471['password']=_0x2148ee[_0x31f8('0x1d')];}_0xc6b471[_0x31f8('0x1e')]=_0x2148ee['host'];_0xc6b471[_0x31f8('0x1f')]=_0x2148ee[_0x31f8('0x1f')]||0x3e1;if(_0x2148ee[_0x31f8('0x20')]){_0xc6b471['tls']=!![];}else{_0xc6b471['tls']=![];_0xc6b471[_0x31f8('0x21')]='required';}}else{_0xc6b471[_0x31f8('0x1c')]=_0x2148ee['user'];_0xc6b471[_0x31f8('0x1d')]=_0x2148ee['password'];_0xc6b471[_0x31f8('0x1e')]=utils[_0x31f8('0x22')](_0x2148ee[_0x31f8('0x23')]);_0xc6b471[_0x31f8('0x1f')]=0x3e1;_0xc6b471[_0x31f8('0x20')]=!![];}_0xc6b471[_0x31f8('0x24')]=_0xc8f0a8||_0x2148ee[_0x31f8('0x1c')]||'anonymous@xcally.com';return _0xc6b471;};EmailImap[_0x31f8('0x17')]['handleReady']=function(){this[_0x31f8('0xc')]['openBox'](this[_0x31f8('0x9')],![],this[_0x31f8('0x25')][_0x31f8('0x11')](this));};EmailImap[_0x31f8('0x17')]['handleOpenBox']=function(_0x31c3ef,_0x27c011){if(_0x31c3ef){this['handleError'](_0x31c3ef,!![]);}else{this[_0x31f8('0x26')](_0x31f8('0x27'),_0x27c011);this[_0x31f8('0x28')]();}};EmailImap[_0x31f8('0x17')][_0x31f8('0x29')]=function(_0x32aef8){if(_0x32aef8){this[_0x31f8('0x14')](_0x32aef8,!![]);}else{this[_0x31f8('0xc')][_0x31f8('0x12')]();}};EmailImap[_0x31f8('0x17')]['readUnseen']=function(){this[_0x31f8('0xc')]['search']([_0x31f8('0x2a')],this[_0x31f8('0x2b')][_0x31f8('0x11')](this));};EmailImap['prototype'][_0x31f8('0x2b')]=function(_0x59459f,_0x273397){if(_0x59459f){this[_0x31f8('0x14')](_0x59459f,!![]);}else{if(_0x273397[_0x31f8('0x2c')]){try{var _0x521b37=this['imap'][_0x31f8('0x2d')](_0x273397,{'bodies':'','markSeen':!![]});_0x521b37['on'](_0x31f8('0x2e'),this[_0x31f8('0x2f')]['bind'](this));_0x521b37[_0x31f8('0xe')]('error',this['handleFetchError']['bind'](this));_0x521b37[_0x31f8('0xe')](_0x31f8('0x12'),this['handleFetchEnd']['bind'](this));}catch(_0x422772){logger['error'](_0x422772);}}else{this[_0x31f8('0xc')][_0x31f8('0x30')](!![],this[_0x31f8('0x29')]['bind'](this));}}};EmailImap[_0x31f8('0x17')][_0x31f8('0x2f')]=function(_0x39382d,_0x3e63a7){_0x39382d['on'](_0x31f8('0x31'),this[_0x31f8('0x32')][_0x31f8('0x11')](this));_0x39382d[_0x31f8('0xe')](_0x31f8('0x33'),this[_0x31f8('0x34')][_0x31f8('0x11')](this));_0x39382d['once'](_0x31f8('0x12'),this[_0x31f8('0x35')][_0x31f8('0x11')](this));};EmailImap[_0x31f8('0x17')][_0x31f8('0x32')]=function(_0x38fbb1,_0x24d79f){simpleParser(_0x38fbb1,{'Iconv':Iconv},this[_0x31f8('0x36')]['bind'](this));};EmailImap[_0x31f8('0x17')]['handleMessageAttributes']=function(_0x2c190b){};EmailImap[_0x31f8('0x17')][_0x31f8('0x35')]=function(){};EmailImap[_0x31f8('0x17')]['handleSimpleParser']=function(_0x1a8ee9,_0x5915cd){if(_0x1a8ee9){logger[_0x31f8('0x37')](_0x1a8ee9);}else{var _0x17d686=this;utils[_0x31f8('0x38')](this['account'],_0x5915cd,function(_0x343a5b){_0x17d686[_0x31f8('0x26')](_0x31f8('0x24'),_0x343a5b);});}};EmailImap[_0x31f8('0x17')][_0x31f8('0x39')]=function(){this[_0x31f8('0xc')]['closeBox'](!![],this[_0x31f8('0x29')][_0x31f8('0x11')](this));};EmailImap['prototype'][_0x31f8('0x3a')]=function(_0x528755){this[_0x31f8('0x14')](_0x528755);this[_0x31f8('0xc')]['closeBox'](!![],this[_0x31f8('0x29')][_0x31f8('0x11')](this));};EmailImap[_0x31f8('0x17')]['handleEnd']=function(){this[_0x31f8('0x26')](_0x31f8('0x12'));};EmailImap['prototype'][_0x31f8('0x14')]=function(_0x332e2,_0x5e8a57){logger[_0x31f8('0x37')](_0x31f8('0x14'),this[_0x31f8('0xd')]['email'],JSON[_0x31f8('0x3b')](_0x332e2));var _0x5ad5a2='';if(_0x332e2){if(_0x332e2[_0x31f8('0x3c')]){_0x5ad5a2=_0x332e2[_0x31f8('0x3c')];}else{for(var _0x1f5020 in _0x332e2){if(_0x332e2[_0x31f8('0x3d')](_0x1f5020)){_0x5ad5a2+=_['upperFirst'](_0x1f5020)+':\x20'+_0x332e2[_0x1f5020]+'\x0a';}}}}if(_0x5e8a57){this[_0x31f8('0xc')]['end']();}else{this[_0x31f8('0x26')](_0x31f8('0x37'),_0x5ad5a2);this[_0x31f8('0x26')](_0x31f8('0x12'));}};module[_0x31f8('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b8fe7d5..a4be26c 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 _0xa788=['use','compile','sendMail','toString','verify','Not\x20verifired','exports','bluebird','prototype','send','createTransport'];(function(_0x2aab3c,_0x2ce66a){var _0xeaa22e=function(_0xccd79a){while(--_0xccd79a){_0x2aab3c['push'](_0x2aab3c['shift']());}};_0xeaa22e(++_0x2ce66a);}(_0xa788,0x10f));var _0x8a78=function(_0x1dd8a3,_0x1a7f75){_0x1dd8a3=_0x1dd8a3-0x0;var _0x133d7b=_0xa788[_0x1dd8a3];return _0x133d7b;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x8a78('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8a78('0x1')][_0x8a78('0x2')]=function(_0x42d6fc,_0x5c598b){return new BPromise(function(_0x3e4359,_0x37f690){var _0x2fed56=nodemailer[_0x8a78('0x3')](_0x42d6fc);_0x2fed56[_0x8a78('0x4')](_0x8a78('0x5'),inlineBase64());_0x2fed56[_0x8a78('0x6')](_0x5c598b,function(_0x41721c,_0x3b1f7a){if(_0x41721c){_0x37f690(_0x41721c[_0x8a78('0x7')]());}else{_0x3e4359(_0x3b1f7a);}});});};EmailSmtp[_0x8a78('0x1')][_0x8a78('0x8')]=function(_0x351245){return new BPromise(function(_0x47c0f1,_0x837844){var _0x24759d=nodemailer[_0x8a78('0x3')](_0x351245);_0x24759d[_0x8a78('0x8')](function(_0x5663bf,_0x3abc6b){if(_0x5663bf){_0x837844(_0x5663bf[_0x8a78('0x7')]());}else{if(_0x3abc6b){_0x47c0f1(_0x3abc6b);}else{_0x837844(_0x8a78('0x9'));}}});});};module[_0x8a78('0xa')]=EmailSmtp; \ No newline at end of file +var _0xd27e=['Not\x20verifired','exports','nodemailer','bluebird','prototype','send','use','compile','sendMail','toString','createTransport','verify'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xd27e,0xb6));var _0xed27=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd27e[_0x19e35c];return _0x3e1fe8;};'use strict';var nodemailer=require(_0xed27('0x0'));var BPromise=require(_0xed27('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xed27('0x2')][_0xed27('0x3')]=function(_0x17fad4,_0x5d16b4){return new BPromise(function(_0x3aae36,_0x593ce7){var _0x1838cc=nodemailer['createTransport'](_0x17fad4);_0x1838cc[_0xed27('0x4')](_0xed27('0x5'),inlineBase64());_0x1838cc[_0xed27('0x6')](_0x5d16b4,function(_0x13c6fd,_0x74a5af){if(_0x13c6fd){_0x593ce7(_0x13c6fd[_0xed27('0x7')]());}else{_0x3aae36(_0x74a5af);}});});};EmailSmtp[_0xed27('0x2')]['verify']=function(_0x25e566){return new BPromise(function(_0x2f3e09,_0x267e89){var _0x4e634c=nodemailer[_0xed27('0x8')](_0x25e566);_0x4e634c[_0xed27('0x9')](function(_0x13bc64,_0x3b5d2a){if(_0x13bc64){_0x267e89(_0x13bc64[_0xed27('0x7')]());}else{if(_0x3b5d2a){_0x2f3e09(_0x3b5d2a);}else{_0x267e89(_0xed27('0xa'));}}});});};module[_0xed27('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 c125f35..10ed86a 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 _0x056b=['bcc','type','attachment','attachment-','format','%s-%s','join','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','parser','from','subject','messageId','date','filter','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','Anonymous','pop','html','test','replace','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x23513f['slice'](0x0,-0x1)['join']('\x20'):_0x539126[_0xb056('0xe')];}return _0xb056('0x13');}function getLastName(_0x51999c){var _0x81c9fc=_[_0xb056('0x8')](_0x51999c[_0xb056('0xd')]);if(_0x81c9fc&&_0x81c9fc[_0xb056('0xe')]){var _0x10dd19=_0x81c9fc[_0xb056('0xe')][_0xb056('0x11')](/\s+/);return _0x10dd19['length']>0x1?_0x10dd19[_0xb056('0x14')]():'';}return'';}function getMails(_0x43565e,_0x9e2eed){var _0x65d7ca='';for(var _0x5a4ef1=0x0;_0x5a4ef1<_0x9e2eed[_0xb056('0xd')]['length'];_0x5a4ef1+=0x1){if(_0x9e2eed[_0xb056('0xd')][_0x5a4ef1][_0xb056('0x9')]!==_0x43565e){if(!_['isEmpty'](_0x65d7ca)){_0x65d7ca+=',';}_0x65d7ca+=_0x9e2eed[_0xb056('0xd')][_0x5a4ef1]['name']||_0x9e2eed[_0xb056('0xd')][_0x5a4ef1][_0xb056('0x9')]||'';_0x65d7ca+='\x20<';_0x65d7ca+=_0x9e2eed['value'][_0x5a4ef1][_0xb056('0x9')]?_0x9e2eed['value'][_0x5a4ef1][_0xb056('0x9')]:_0xb056('0xa')+random[_0xb056('0xb')](0x6)+_0xb056('0xc');_0x65d7ca+='>';}}return _0x65d7ca;}function parseEmail(_0x4b254f,_0x1db585,_0x5b481c){if(_0x1db585[_0xb056('0x15')]){var _0x5dea90=/)<[^<]*)*<\/script>/gi;while(_0x5dea90[_0xb056('0x16')](_0x1db585[_0xb056('0x15')])){_0x1db585[_0xb056('0x15')]=_0x1db585[_0xb056('0x15')][_0xb056('0x17')](_0x5dea90,'');}if(_0x1db585[_0xb056('0x15')]['includes'](_0xb056('0x18'))){var _0x18a3f2=[];_0x1db585[_0xb056('0x19')][_0xb056('0x1a')](_0x5577a9=>{_0x18a3f2[_0xb056('0x1b')](_0x5577a9[_0xb056('0x1c')]);});var _0x5c39db=/]+>/g;var _0x6d0483=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x265782=_0x1db585[_0xb056('0x15')][_0xb056('0x17')](_0x6d0483,_0xb056('0x1d'));var _0x4024d7=_0x265782[_0xb056('0x17')](_0x5c39db,_0xb056('0x1e'));for(let _0x571e54=0x0;_0x571e54<_0x18a3f2[_0xb056('0x12')];_0x571e54++){var _0x51b06b=_0x4024d7[_0xb056('0x17')](_0xb056('0x1e'),_0xb056('0x1f')+_0x18a3f2[_0x571e54]+'\x20]');_0x4024d7=_0x51b06b;}_0x1db585[_0xb056('0x15')]=_0x4024d7;}_0x5b481c[_0xb056('0x20')]=_0x1db585['html'];}else{_0x5b481c[_0xb056('0x20')]=_0x1db585[_0xb056('0x21')];}if(_0x5b481c[_0xb056('0x20')]){_0x5b481c[_0xb056('0x20')]=_0x5b481c[_0xb056('0x20')]['replace'](/0x0){var _0x4c2b1e=[_0xb056('0x33'),'X-Auto-Response-Suppress:\x20All',_0xb056('0x34')];for(var _0x3c2249=0x0;_0x3c2249<_0x1db585[_0xb056('0x32')][_0xb056('0x12')];_0x3c2249++){var _0x1b4e99=_[_0xb056('0x10')](_0x4c2b1e,_0x1db585['headerLines'][_0x3c2249][_0xb056('0x35')]);if(_0x1b4e99>=0x0){_0x5b481c['isAutoreply']=!![];}}}return _0x5b481c;}exports[_0xb056('0x36')]=function(_0xc729f3,_0x21d98e,_0xad802f){var _0x119e8c={'from':getAddress(_0x21d98e[_0xb056('0x37')]),'firstName':getFirstName(_0x21d98e[_0xb056('0x37')]),'lastName':getLastName(_0x21d98e[_0xb056('0x37')]),'mapKey':_0xb056('0x6'),'message':{'from':getMails(_0xc729f3[_0xb056('0x6')],_0x21d98e['from']),'to':_0xc729f3[_0xb056('0x6')],'cc':'','subject':_0x21d98e[_0xb056('0x38')]||'','messageId':_0x21d98e[_0xb056('0x39')],'inReplyTo':_0x21d98e['inReplyTo'],'sentAt':moment(_0x21d98e[_0xb056('0x3a')])[_0xb056('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x21d98e['html']&&!_0x21d98e[_0xb056('0x21')]){var _0x1ef279=_[_0xb056('0x3b')](_0x21d98e[_0xb056('0x19')],{'contentType':'application/ms-tnef'});if(_0x1ef279['length']){logger['info'](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x21d98e['messageId']));tnef[_0xb056('0x3c')](_['first'](_0x1ef279)[_0xb056('0x31')],function(_0x53f231,_0x1676f5){if(_0x1676f5){_0x21d98e[_0xb056('0x15')]=_0x1676f5[_0xb056('0x3d')]||_0xb056('0x3e');if(_0x1676f5[_0xb056('0x3f')]){for(var _0x1d3f86=0x0;_0x1d3f86<_0x1676f5['Attachments'][_0xb056('0x12')];_0x1d3f86++){var _0x76d3a0=_0x1676f5['Attachments'][_0x1d3f86];_0x119e8c[_0xb056('0x23')][_0xb056('0x19')][_0xb056('0x1b')]({'filename':_0x76d3a0[_0xb056('0x40')],'content':Buffer[_0xb056('0x37')](_0x76d3a0[_0xb056('0x41')])});}}}_0xad802f(parseEmail(_0xc729f3,_0x21d98e,_0x119e8c));});}else{_0x21d98e['html']=_0xb056('0x3e');_0xad802f(parseEmail(_0xc729f3,_0x21d98e,_0x119e8c));}}else{_0xad802f(parseEmail(_0xc729f3,_0x21d98e,_0x119e8c));}};exports['getHost']=function(_0x132268){switch(_0x132268){case _0xb056('0x42'):return _0xb056('0x43');case _0xb056('0x44'):return _0xb056('0x45');case _0xb056('0x46'):return _0xb056('0x47');case _0xb056('0x48'):return'outlook.office365.com';}return _0xb056('0x49');}; \ No newline at end of file +var _0xeaab=['imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','join','Anonymous','pop','isEmpty','html','includes','','body','Empty\x20message

','getHost','imap.gmail.com'];(function(_0x275928,_0x206cfb){var _0x5b9060=function(_0x3f81c0){while(--_0x3f81c0){_0x275928['push'](_0x275928['shift']());}};_0x5b9060(++_0x206cfb);}(_0xeaab,0xd9));var _0xbeaa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xeaab[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xbeaa('0x0'));var moment=require('moment');var random=require(_0xbeaa('0x1'));var fs=require('fs');var path=require(_0xbeaa('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xbeaa('0x3'))(_0xbeaa('0x4'));var config=require(_0xbeaa('0x5'));function getAddress(_0x3e9c3b){var _0x281a29=_[_0xbeaa('0x6')](_0x3e9c3b[_0xbeaa('0x7')]);return _0x281a29&&_0x281a29[_0xbeaa('0x8')]?_0x281a29[_0xbeaa('0x8')]:_0xbeaa('0x9')+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');}function getFirstName(_0x15a826){var _0xd2a868=_['head'](_0x15a826[_0xbeaa('0x7')]);if(_0xd2a868&&_0xd2a868[_0xbeaa('0xc')]){if(_0xd2a868[_0xbeaa('0xc')]==_0xd2a868[_0xbeaa('0x8')]){return _0xd2a868[_0xbeaa('0xc')][_0xbeaa('0xd')](0x0,_0xd2a868[_0xbeaa('0xc')]['indexOf']('@'));}var _0x18fd02=_0xd2a868['name'][_0xbeaa('0xe')](/\s+/);return _0x18fd02[_0xbeaa('0xf')]>0x1?_0x18fd02['slice'](0x0,-0x1)[_0xbeaa('0x10')]('\x20'):_0xd2a868['name'];}return _0xbeaa('0x11');}function getLastName(_0x17d717){var _0x5457e5=_[_0xbeaa('0x6')](_0x17d717[_0xbeaa('0x7')]);if(_0x5457e5&&_0x5457e5[_0xbeaa('0xc')]){var _0x6fee13=_0x5457e5[_0xbeaa('0xc')][_0xbeaa('0xe')](/\s+/);return _0x6fee13[_0xbeaa('0xf')]>0x1?_0x6fee13[_0xbeaa('0x12')]():'';}return'';}function getMails(_0x2ab806,_0x34271a){var _0x1b28a5='';for(var _0x1cc387=0x0;_0x1cc387<_0x34271a[_0xbeaa('0x7')][_0xbeaa('0xf')];_0x1cc387+=0x1){if(_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]!==_0x2ab806){if(!_[_0xbeaa('0x13')](_0x1b28a5)){_0x1b28a5+=',';}_0x1b28a5+=_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0xc')]||_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]||'';_0x1b28a5+='\x20<';_0x1b28a5+=_0x34271a['value'][_0x1cc387][_0xbeaa('0x8')]?_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]:'anonymous'+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');_0x1b28a5+='>';}}return _0x1b28a5;}function parseEmail(_0x3f2827,_0x3aa812,_0x3923fd){if(_0x3aa812[_0xbeaa('0x14')]){var _0x106621=/)<[^<]*)*<\/script>/gi;while(_0x106621['test'](_0x3aa812[_0xbeaa('0x14')])){_0x3aa812[_0xbeaa('0x14')]=_0x3aa812['html']['replace'](_0x106621,'');}if(_0x3aa812['html'][_0xbeaa('0x15')](_0xbeaa('0x16'))){var _0x8eb550=[];_0x3aa812[_0xbeaa('0x17')]['forEach'](_0x5a2540=>{_0x8eb550['push'](_0x5a2540[_0xbeaa('0x18')]);});var _0x441653=/]+>/g;var _0x63d68b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xa9a88e=_0x3aa812[_0xbeaa('0x14')]['replace'](_0x63d68b,_0xbeaa('0x19'));var _0x3a4386=_0xa9a88e[_0xbeaa('0x1a')](_0x441653,'_IMG');for(let _0x2f509e=0x0;_0x2f509e<_0x8eb550[_0xbeaa('0xf')];_0x2f509e++){var _0x233094=_0x3a4386['replace'](_0xbeaa('0x1b'),'\x20[Attachment:\x20'+_0x8eb550[_0x2f509e]+_0xbeaa('0x1c'));_0x3a4386=_0x233094;}_0x3aa812[_0xbeaa('0x14')]=_0x3a4386;}_0x3923fd[_0xbeaa('0x1d')]=_0x3aa812[_0xbeaa('0x14')];}else{_0x3923fd[_0xbeaa('0x1d')]=_0x3aa812['textAsHtml'];}if(_0x3923fd[_0xbeaa('0x1d')]){_0x3923fd[_0xbeaa('0x1d')]=_0x3923fd['body'][_0xbeaa('0x1a')](/0x0){var _0x3648e4=[_0xbeaa('0x2c'),_0xbeaa('0x2d'),'Precedence:\x20auto_reply'];for(var _0x586f50=0x0;_0x586f50<_0x3aa812[_0xbeaa('0x2b')][_0xbeaa('0xf')];_0x586f50++){var _0x5c8454=_['indexOf'](_0x3648e4,_0x3aa812[_0xbeaa('0x2b')][_0x586f50][_0xbeaa('0x2e')]);if(_0x5c8454>=0x0){_0x3923fd[_0xbeaa('0x2f')]=!![];}}}return _0x3923fd;}exports[_0xbeaa('0x30')]=function(_0x35ffda,_0x459680,_0x532491){var _0x133f51={'from':getAddress(_0x459680[_0xbeaa('0x31')]),'firstName':getFirstName(_0x459680[_0xbeaa('0x31')]),'lastName':getLastName(_0x459680['from']),'mapKey':_0xbeaa('0x4'),'message':{'from':getMails(_0x35ffda[_0xbeaa('0x4')],_0x459680[_0xbeaa('0x31')]),'to':_0x35ffda['email'],'cc':'','subject':_0x459680[_0xbeaa('0x32')]||'','messageId':_0x459680['messageId'],'inReplyTo':_0x459680[_0xbeaa('0x33')],'sentAt':moment(_0x459680[_0xbeaa('0x34')])[_0xbeaa('0x24')](_0xbeaa('0x35')),'attach':![],'attachments':[]}};if(!_0x459680[_0xbeaa('0x14')]&&!_0x459680[_0xbeaa('0x36')]){var _0x4d0164=_[_0xbeaa('0x37')](_0x459680['attachments'],{'contentType':_0xbeaa('0x38')});if(_0x4d0164[_0xbeaa('0xf')]){logger[_0xbeaa('0x39')](util['format'](_0xbeaa('0x3a'),_0x459680[_0xbeaa('0x3b')]));tnef['parseBuffer'](_[_0xbeaa('0x3c')](_0x4d0164)[_0xbeaa('0x28')],function(_0x47a81a,_0x68da63){if(_0x68da63){_0x459680[_0xbeaa('0x14')]=_0x68da63['BodyHTML']||'

Empty\x20message

';if(_0x68da63['Attachments']){for(var _0x348715=0x0;_0x348715<_0x68da63[_0xbeaa('0x3d')][_0xbeaa('0xf')];_0x348715++){var _0x8bbbd3=_0x68da63[_0xbeaa('0x3d')][_0x348715];_0x133f51[_0xbeaa('0x20')][_0xbeaa('0x17')][_0xbeaa('0x29')]({'filename':_0x8bbbd3[_0xbeaa('0x3e')],'content':Buffer[_0xbeaa('0x31')](_0x8bbbd3[_0xbeaa('0x3f')])});}}}_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));});}else{_0x459680[_0xbeaa('0x14')]=_0xbeaa('0x40');_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));}}else{_0x532491(parseEmail(_0x35ffda,_0x459680,_0x133f51));}};exports[_0xbeaa('0x41')]=function(_0x3f2ea9){switch(_0x3f2ea9){case'gmail':return _0xbeaa('0x42');case'yahoo':return _0xbeaa('0x43');case'hotmail':return'imap-mail.outlook.com';case _0xbeaa('0x44'):return _0xbeaa('0x45');}return _0xbeaa('0x46');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 3ed5a8f..1634fd6 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 _0xf406=['key','SERV','active','Imap','Smtp','name'];(function(_0x286513,_0x180264){var _0xeef4e8=function(_0x3ec73a){while(--_0x3ec73a){_0x286513['push'](_0x286513['shift']());}};_0xeef4e8(++_0x180264);}(_0xf406,0x9b));var _0x6f40=function(_0x911aa,_0x5cb8b5){_0x911aa=_0x911aa-0x0;var _0x327202=_0xf406[_0x911aa];return _0x327202;};'use strict';var _=require('lodash');function MailAccount(_0x3bcfe0){this['id']=_0x3bcfe0['id']||0x0;this[_0x6f40('0x0')]=_0x3bcfe0[_0x6f40('0x0')]||'Service';this['key']=_0x3bcfe0[_0x6f40('0x1')]||_0x6f40('0x2');this[_0x6f40('0x3')]=_0x3bcfe0[_0x6f40('0x3')]||![];this[_0x6f40('0x4')]=_0x3bcfe0[_0x6f40('0x4')]||[];this[_0x6f40('0x5')]=_0x3bcfe0[_0x6f40('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xe6ce=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x547c31,_0x2fd5c2){var _0x3371e4=function(_0x528487){while(--_0x528487){_0x547c31['push'](_0x547c31['shift']());}};_0x3371e4(++_0x2fd5c2);}(_0xe6ce,0x1a8));var _0xee6c=function(_0x558d3f,_0x7cac72){_0x558d3f=_0x558d3f-0x0;var _0x50b5ba=_0xe6ce[_0x558d3f];return _0x50b5ba;};'use strict';var _=require(_0xee6c('0x0'));function MailAccount(_0x3cd43c){this['id']=_0x3cd43c['id']||0x0;this[_0xee6c('0x1')]=_0x3cd43c[_0xee6c('0x1')]||_0xee6c('0x2');this[_0xee6c('0x3')]=_0x3cd43c[_0xee6c('0x3')]||_0xee6c('0x4');this['active']=_0x3cd43c[_0xee6c('0x5')]||![];this[_0xee6c('0x6')]=_0x3cd43c[_0xee6c('0x6')]||[];this[_0xee6c('0x7')]=_0x3cd43c[_0xee6c('0x7')]||[];}module[_0xee6c('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index b1b713c..9df20d3 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 _0x0613=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','exports','lodash','mailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0613,0x11e));var _0x3061=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x0613[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0x3061('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x3061('0x1')]={};};function freeIsNotKey(_0x130fdc,_0x1d75f8,_0xb1a926){var _0x14cc8d=_['mapKeys'](_0x130fdc,function(_0x315979,_0x2a3074){return _0x315979[_0xb1a926];});for(var _0xa6cf6b in _0x1d75f8){if(_0x1d75f8[_0x3061('0x2')](_0xa6cf6b)){if(!_0x14cc8d[_0xa6cf6b]){delete _0x1d75f8[_0xa6cf6b];}}}}Realtime[_0x3061('0x3')][_0x3061('0x4')]=function(_0x2d419a,_0x1e97e7){for(var _0x41823f in _0x1e97e7){if(_0x2d419a[_0x3061('0x2')](_0x41823f)){_0x2d419a[_0x41823f]=_0x1e97e7[_0x41823f];}}};Realtime[_0x3061('0x3')][_0x3061('0x5')]=function(){var _0x524576=this;return function(_0x2cc400){if(_0x2cc400){freeIsNotKey(_0x2cc400,_0x524576[_0x3061('0x1')],'id');for(var _0x1e910f=0x0,_0x12028b={},_0x50afe8={};_0x1e910f<_0x2cc400[_0x3061('0x6')];_0x1e910f+=0x1){_0x12028b=_0x2cc400[_0x1e910f];if(_['isUndefined'](_0x524576[_0x3061('0x1')][_0x12028b['id']])){_0x524576['mailAccounts'][_0x12028b['id']]=new MailAccount(_0x12028b);}else{_['merge'](_0x524576[_0x3061('0x1')][_0x12028b['id']],_0x12028b);}}}return _0x524576['mailAccounts'];};};module[_0x3061('0x7')]=Realtime; \ No newline at end of file +var _0x72e7=['initMailAccounts','length','isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x4a1ef9,_0x37b52b){var _0x1c63e6=function(_0x128180){while(--_0x128180){_0x4a1ef9['push'](_0x4a1ef9['shift']());}};_0x1c63e6(++_0x37b52b);}(_0x72e7,0x13e));var _0x772e=function(_0x12e7fd,_0x354bad){_0x12e7fd=_0x12e7fd-0x0;var _0x414918=_0x72e7[_0x12e7fd];return _0x414918;};'use strict';var _=require(_0x772e('0x0'));var MailAccount=require(_0x772e('0x1'));var Realtime=function(){this[_0x772e('0x2')]={};};function freeIsNotKey(_0x367c79,_0x108e4f,_0x49c678){var _0x3a74a0=_[_0x772e('0x3')](_0x367c79,function(_0x3a5296,_0x5067b5){return _0x3a5296[_0x49c678];});for(var _0x33c573 in _0x108e4f){if(_0x108e4f[_0x772e('0x4')](_0x33c573)){if(!_0x3a74a0[_0x33c573]){delete _0x108e4f[_0x33c573];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x28888a,_0x4d4aaa){for(var _0x10bebd in _0x4d4aaa){if(_0x28888a[_0x772e('0x4')](_0x10bebd)){_0x28888a[_0x10bebd]=_0x4d4aaa[_0x10bebd];}}};Realtime[_0x772e('0x5')][_0x772e('0x6')]=function(){var _0x35d6cb=this;return function(_0x2b9ebc){if(_0x2b9ebc){freeIsNotKey(_0x2b9ebc,_0x35d6cb[_0x772e('0x2')],'id');for(var _0x619219=0x0,_0x4f663f={},_0x536aae={};_0x619219<_0x2b9ebc[_0x772e('0x7')];_0x619219+=0x1){_0x4f663f=_0x2b9ebc[_0x619219];if(_[_0x772e('0x8')](_0x35d6cb[_0x772e('0x2')][_0x4f663f['id']])){_0x35d6cb['mailAccounts'][_0x4f663f['id']]=new MailAccount(_0x4f663f);}else{_['merge'](_0x35d6cb[_0x772e('0x2')][_0x4f663f['id']],_0x4f663f);}}}return _0x35d6cb[_0x772e('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8767a3a..9660b90 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 _0x1241=['GetMailAccount','name','service','email','key','ListId','TemplateId','Imap','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','Request'];(function(_0x5a8c4a,_0x4878e1){var _0x5cf9fb=function(_0x5b4f44){while(--_0x5b4f44){_0x5a8c4a['push'](_0x5a8c4a['shift']());}};_0x5cf9fb(++_0x4878e1);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x1124('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x1124('0x1')](_0x1124('0x2'),{'options':{'attributes':['id',_0x1124('0x3'),_0x1124('0x4'),_0x1124('0x5'),'active',_0x1124('0x6'),_0x1124('0x7'),_0x1124('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x1124('0x9')},{'model':_0x1124('0xa'),'as':_0x1124('0xb')}]},'log':_0x1124('0xc')});};};exports['notify']=function(_0x57a179,_0x4cecf6){return client[_0x1124('0x1')]('NotifyMailAccount',{'account':{'id':_0x57a179},'body':_0x4cecf6,'log':_0x1124('0xd')});}; \ No newline at end of file +var _0x6eec=['../client','getMailAccounts','Request','GetMailAccount','service','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x1a5574,_0x4ac4fc){var _0x4c85e4=function(_0x2138dd){while(--_0x2138dd){_0x1a5574['push'](_0x1a5574['shift']());}};_0x4c85e4(++_0x4ac4fc);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc6ee('0x0'));exports[_0xc6ee('0x1')]=function(){return function(){return client[_0xc6ee('0x2')](_0xc6ee('0x3'),{'options':{'attributes':['id','name',_0xc6ee('0x4'),_0xc6ee('0x5'),'active',_0xc6ee('0x6'),_0xc6ee('0x7'),_0xc6ee('0x8')],'raw':![],'include':[{'model':_0xc6ee('0x9'),'as':_0xc6ee('0xa')},{'model':_0xc6ee('0xb'),'as':_0xc6ee('0xc')}]},'log':_0xc6ee('0xd')});};};exports[_0xc6ee('0xe')]=function(_0x59bd32,_0x5d1421){return client[_0xc6ee('0x2')](_0xc6ee('0xf'),{'account':{'id':_0x59bd32},'body':_0x5d1421,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 17d9a78..95aa90b 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 _0xb0ae=['../client','getSettings','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb0ae,0x73));var _0xeb0a=function(_0x55cd92,_0x4b9d87){_0x55cd92=_0x55cd92-0x0;var _0x2056f9=_0xb0ae[_0x55cd92];return _0x2056f9;};'use strict';var client=require(_0xeb0a('0x0'));exports[_0xeb0a('0x1')]=function(){return client['Request'](_0xeb0a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xeb0a('0x3')]},'log':_0xeb0a('0x4')});}; \ No newline at end of file +var _0xc0a4=['ShowSetting','GetSettings','getSettings','Request'];(function(_0xc38711,_0x17d467){var _0x6f15c8=function(_0x2832a1){while(--_0x2832a1){_0xc38711['push'](_0xc38711['shift']());}};_0x6f15c8(++_0x17d467);}(_0xc0a4,0x1b6));var _0x4c0a=function(_0x3b7e07,_0x26cb39){_0x3b7e07=_0x3b7e07-0x0;var _0x62fe4=_0xc0a4[_0x3b7e07];return _0x62fe4;};'use strict';var client=require('../client');exports[_0x4c0a('0x0')]=function(){return client[_0x4c0a('0x1')](_0x4c0a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x4c0a('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a6c916e..6b03128 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 76dbab9..34bdc8b 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 _0x9dc9=['polling','redis','localhost','adapter','default','../../config/express','../../routes','once','listening','log','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','websocket'];(function(_0x2c9aaf,_0x7a2068){var _0x2b633c=function(_0x2b78e8){while(--_0x2b78e8){_0x2c9aaf['push'](_0x2c9aaf['shift']());}};_0x2b633c(++_0x7a2068);}(_0x9dc9,0x19a));var _0x99dc=function(_0x150399,_0x2e0931){_0x150399=_0x150399-0x0;var _0x42a1c2=_0x9dc9[_0x150399];return _0x42a1c2;};'use strict';var _=require(_0x99dc('0x0'));var http=require(_0x99dc('0x1'));var express=require(_0x99dc('0x2'));var sticky=require(_0x99dc('0x3'));var Redis=require(_0x99dc('0x4'));var config=require(_0x99dc('0x5'));var app=express();var server=http[_0x99dc('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x99dc('0x7')](server,config[_0x99dc('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x99dc('0x9'),_0x99dc('0xa')]});config[_0x99dc('0xb')]=_['defaults'](config[_0x99dc('0xb')],{'host':_0x99dc('0xc'),'port':0x18eb});socketio[_0x99dc('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x99dc('0xb')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x99dc('0xe')]();require('../../config/socketio')[_0x99dc('0xe')](socketio);require(_0x99dc('0xf'))[_0x99dc('0xe')](app);require(_0x99dc('0x10'))[_0x99dc('0xe')](app);}else{server[_0x99dc('0x11')](_0x99dc('0x12'),function(){console[_0x99dc('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x99dc('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x4e2e=['../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4e2e,0x13e));var _0xe4e2=function(_0x1195c9,_0x260858){_0x1195c9=_0x1195c9-0x0;var _0x1c6625=_0x4e2e[_0x1195c9];return _0x1c6625;};'use strict';var _=require(_0xe4e2('0x0'));var http=require('http');var express=require(_0xe4e2('0x1'));var sticky=require(_0xe4e2('0x2'));var Redis=require(_0xe4e2('0x3'));var config=require(_0xe4e2('0x4'));var app=express();var server=http[_0xe4e2('0x5')](app);server[_0xe4e2('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xe4e2('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0xe4e2('0x8'),_0xe4e2('0x9')]});config[_0xe4e2('0xa')]=_[_0xe4e2('0xb')](config[_0xe4e2('0xa')],{'host':_0xe4e2('0xc'),'port':0x18eb});socketio[_0xe4e2('0xd')](require(_0xe4e2('0xe'))({'pubClient':new Redis(config[_0xe4e2('0xa')]),'subClient':new Redis(config[_0xe4e2('0xa')])}));require(_0xe4e2('0xf'))[_0xe4e2('0x10')]();require('../../config/socketio')[_0xe4e2('0x10')](socketio);require(_0xe4e2('0x11'))[_0xe4e2('0x10')](app);require(_0xe4e2('0x12'))[_0xe4e2('0x10')](app);}else{server['once'](_0xe4e2('0x13'),function(){console['log'](_0xe4e2('0x14'),config[_0xe4e2('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8e4f530..f24ce08 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 _0x7046=['exports','jayson/promise','../../config/logger','routing','client','Request','debug','rpc','error','message','result'];(function(_0x30f2d1,_0x5710ac){var _0x44605d=function(_0x46d60b){while(--_0x46d60b){_0x30f2d1['push'](_0x30f2d1['shift']());}};_0x44605d(++_0x5710ac);}(_0x7046,0x85));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var jayson=require(_0x6704('0x0'));var BPromise=require('bluebird');var logger=require(_0x6704('0x1'))(_0x6704('0x2'));var client=jayson[_0x6704('0x3')]['http']({'port':0x2329});client[_0x6704('0x4')]=function(_0x259c86,_0x11adc9){return new BPromise(function(_0x2449c2,_0x37ef5d){return client['request'](_0x259c86,_0x11adc9)['then'](function(_0x1013cc){logger[_0x6704('0x5')](_0x6704('0x6'),'routing',_0x259c86,_0x11adc9,_0x1013cc);if(_0x1013cc[_0x6704('0x7')]){logger[_0x6704('0x7')](_0x6704('0x6'),_0x6704('0x2'),_0x259c86,_0x1013cc[_0x6704('0x7')][_0x6704('0x8')],_0x11adc9);return _0x37ef5d(_0x1013cc[_0x6704('0x7')][_0x6704('0x8')]);}else{return _0x2449c2(_0x1013cc[_0x6704('0x9')]);}})['catch'](function(_0x3379e9){logger[_0x6704('0x7')]('rpc',_0x6704('0x2'),_0x259c86,_0x3379e9,_0x11adc9);return _0x37ef5d(_0x3379e9);});});};module[_0x6704('0xa')]=client; \ No newline at end of file +var _0x1ee7=['debug','rpc','error','message','result','exports','jayson/promise','bluebird','routing','client','http','Request','then'];(function(_0x395be3,_0xdd61a2){var _0x17c247=function(_0x215893){while(--_0x215893){_0x395be3['push'](_0x395be3['shift']());}};_0x17c247(++_0xdd61a2);}(_0x1ee7,0xaf));var _0x71ee=function(_0x5d50e7,_0x4641d5){_0x5d50e7=_0x5d50e7-0x0;var _0x509c96=_0x1ee7[_0x5d50e7];return _0x509c96;};'use strict';var jayson=require(_0x71ee('0x0'));var BPromise=require(_0x71ee('0x1'));var logger=require('../../config/logger')(_0x71ee('0x2'));var client=jayson[_0x71ee('0x3')][_0x71ee('0x4')]({'port':0x2329});client[_0x71ee('0x5')]=function(_0x3f7382,_0x2a8c26){return new BPromise(function(_0x3ca307,_0x594faf){return client['request'](_0x3f7382,_0x2a8c26)[_0x71ee('0x6')](function(_0x58840c){logger[_0x71ee('0x7')](_0x71ee('0x8'),_0x71ee('0x2'),_0x3f7382,_0x2a8c26,_0x58840c);if(_0x58840c[_0x71ee('0x9')]){logger['error'](_0x71ee('0x8'),_0x71ee('0x2'),_0x3f7382,_0x58840c[_0x71ee('0x9')]['message'],_0x2a8c26);return _0x594faf(_0x58840c[_0x71ee('0x9')][_0x71ee('0xa')]);}else{return _0x3ca307(_0x58840c[_0x71ee('0xb')]);}})['catch'](function(_0x22a04d){logger[_0x71ee('0x9')](_0x71ee('0x8'),_0x71ee('0x2'),_0x3f7382,_0x22a04d,_0x2a8c26);return _0x594faf(_0x22a04d);});});};module[_0x71ee('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index de37241..9a13d43 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 _0xc300=['initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x49ebbe,_0x4b6f6d){var _0x266849=function(_0x28d2a7){while(--_0x28d2a7){_0x49ebbe['push'](_0x49ebbe['shift']());}};_0x266849(++_0x4b6f6d);}(_0xc300,0xe7));var _0x0c30=function(_0x1ef972,_0x371719){_0x1ef972=_0x1ef972-0x0;var _0x21ac19=_0xc300[_0x1ef972];return _0x21ac19;};'use strict';var BPromise=require(_0x0c30('0x0'));var server=require(_0x0c30('0x1'));var Realtime=require(_0x0c30('0x2'));var user=require(_0x0c30('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x0c30('0x4'));var smsQueue=require(_0x0c30('0x5'));var mailQueue=require(_0x0c30('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x0c30('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())[_0x0c30('0x8')](realtime[_0x0c30('0x9')]())[_0x0c30('0x8')](interval[_0x0c30('0xa')]())[_0x0c30('0x8')](realtime[_0x0c30('0xb')]())[_0x0c30('0x8')](openchannelQueue[_0x0c30('0xc')]())['then'](realtime[_0x0c30('0xd')]())['then'](chatQueue[_0x0c30('0xe')]())[_0x0c30('0x8')](realtime[_0x0c30('0xf')]())['then'](smsQueue[_0x0c30('0x10')]())[_0x0c30('0x8')](realtime[_0x0c30('0x11')]())['then'](mailQueue[_0x0c30('0x12')]())['then'](realtime[_0x0c30('0x13')]())[_0x0c30('0x8')](faxQueue['getFaxQueues']())[_0x0c30('0x8')](realtime[_0x0c30('0x14')]())['then'](whatsappQueue[_0x0c30('0x15')]())[_0x0c30('0x8')](realtime[_0x0c30('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x0c30('0x17')](realtime)[_0x0c30('0x8')](function(_0x2e0019){return initRealtime();})[_0x0c30('0x8')](function(_0x17a6fb){return setInterval(initRealtime,0x1388);})['catch'](function(_0x3b04f3){console[_0x0c30('0x18')](_0x3b04f3);});}main(); \ No newline at end of file +var _0xfc86=['catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xfc86,0xaa));var _0x6fc8=function(_0x36c3c7,_0x52f866){_0x36c3c7=_0x36c3c7-0x0;var _0x52bc17=_0xfc86[_0x36c3c7];return _0x52bc17;};'use strict';var BPromise=require(_0x6fc8('0x0'));var server=require(_0x6fc8('0x1'));var Realtime=require(_0x6fc8('0x2'));var user=require('./rpc/user');var interval=require(_0x6fc8('0x3'));var openchannelQueue=require(_0x6fc8('0x4'));var chatQueue=require(_0x6fc8('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x6fc8('0x6'));var faxQueue=require(_0x6fc8('0x7'));var whatsappQueue=require(_0x6fc8('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x6fc8('0x9')]()[_0x6fc8('0xa')](user[_0x6fc8('0xb')]())['then'](realtime[_0x6fc8('0xc')]())['then'](interval['getIntervals']())[_0x6fc8('0xa')](realtime['initIntervals']())[_0x6fc8('0xa')](openchannelQueue[_0x6fc8('0xd')]())[_0x6fc8('0xa')](realtime[_0x6fc8('0xe')]())[_0x6fc8('0xa')](chatQueue[_0x6fc8('0xf')]())[_0x6fc8('0xa')](realtime[_0x6fc8('0x10')]())[_0x6fc8('0xa')](smsQueue[_0x6fc8('0x11')]())[_0x6fc8('0xa')](realtime[_0x6fc8('0x12')]())['then'](mailQueue[_0x6fc8('0x13')]())[_0x6fc8('0xa')](realtime[_0x6fc8('0x14')]())[_0x6fc8('0xa')](faxQueue[_0x6fc8('0x15')]())['then'](realtime[_0x6fc8('0x16')]())[_0x6fc8('0xa')](whatsappQueue[_0x6fc8('0x17')]())[_0x6fc8('0xa')](realtime[_0x6fc8('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0x6fc8('0x19')](realtime)[_0x6fc8('0xa')](function(_0xbfd52b){return initRealtime();})[_0x6fc8('0xa')](function(_0x34cef0){return setInterval(initRealtime,0x1388);})[_0x6fc8('0x1a')](function(_0x2b8ba4){console[_0x6fc8('0x1b')](_0x2b8ba4);});}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 c1cbbcf..7144172 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0xc9671e,_0x5ae235){_0xc9671e=_0xc9671e-0x0;var _0x54957a=_0x1261[_0xc9671e];return _0x54957a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _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(_0x2ed0b7,_0x43d0b6){var _0x456ef1=function(_0x20d34e){while(--_0x20d34e){_0x2ed0b7['push'](_0x2ed0b7['shift']());}};_0x456ef1(++_0x43d0b6);}(_0x2ef3,0xba));var _0x32ef=function(_0x45e4e1,_0x59abd7){_0x45e4e1=_0x45e4e1-0x0;var _0x42753a=_0x2ef3[_0x45e4e1];return _0x42753a;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1d44f6c..d07a13b 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 _0xebbf=['message','catch','bluebird','jayson/promise','client','http','request','error'];(function(_0x11893e,_0x3942a6){var _0x81c547=function(_0x487290){while(--_0x487290){_0x11893e['push'](_0x11893e['shift']());}};_0x81c547(++_0x3942a6);}(_0xebbf,0x8a));var _0xfebb=function(_0x5c4d27,_0x5b0822){_0x5c4d27=_0x5c4d27-0x0;var _0x1dda1a=_0xebbf[_0x5c4d27];return _0x1dda1a;};'use strict';var BPromise=require(_0xfebb('0x0'));var jayson=require(_0xfebb('0x1'));var client=jayson[_0xfebb('0x2')][_0xfebb('0x3')]({'port':0x232b});function request(_0x5084bf,_0x5ad25f){return new BPromise(function(_0x105412,_0x19adeb){return client[_0xfebb('0x4')](_0x5084bf,_0x5ad25f)['then'](function(_0x18e9da){if(_0x18e9da[_0xfebb('0x5')]){return _0x19adeb(_0x18e9da[_0xfebb('0x5')][_0xfebb('0x6')]);}else{return _0x105412(_0x18e9da['result']);}})[_0xfebb('0x7')](function(_0x3e1e5e){return _0x19adeb(_0x3e1e5e);});});}exports['sendMailMessage']=function(_0x2ac6db,_0x3a8e16){return request('SendMail',{'account':_0x2ac6db,'message':_0x3a8e16});}; \ No newline at end of file +var _0x7b21=['error','result','sendMailMessage','bluebird','jayson/promise','request'];(function(_0x442a2f,_0x2707a5){var _0x57fa25=function(_0x59a8b1){while(--_0x59a8b1){_0x442a2f['push'](_0x442a2f['shift']());}};_0x57fa25(++_0x2707a5);}(_0x7b21,0x87));var _0x17b2=function(_0x4c453f,_0xd8d5b8){_0x4c453f=_0x4c453f-0x0;var _0x471af6=_0x7b21[_0x4c453f];return _0x471af6;};'use strict';var BPromise=require(_0x17b2('0x0'));var jayson=require(_0x17b2('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x57f890,_0x482d0b){return new BPromise(function(_0x3d4d20,_0x17bf2b){return client[_0x17b2('0x2')](_0x57f890,_0x482d0b)['then'](function(_0x484fff){if(_0x484fff[_0x17b2('0x3')]){return _0x17bf2b(_0x484fff['error']['message']);}else{return _0x3d4d20(_0x484fff[_0x17b2('0x4')]);}})['catch'](function(_0x596902){return _0x17bf2b(_0x596902);});});}exports[_0x17b2('0x5')]=function(_0x4e4610,_0x22db07){return request('SendMail',{'account':_0x4e4610,'message':_0x22db07});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0f3fd48..c3d7872 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 _0xc8f8=['whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatus','chatCapacity','mailStatus','faxStatus','whatsappStatus','busy','stringify','emit','user:save','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc8f8[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x8c8f('0x0'));var moment=require(_0x8c8f('0x1'));var md5=require(_0x8c8f('0x2'));var Redis=require(_0x8c8f('0x3'));var config=require('../../../config/environment');config[_0x8c8f('0x4')]=_[_0x8c8f('0x5')](config['redis'],{'host':_0x8c8f('0x6'),'port':0x18eb});var io=require(_0x8c8f('0x7'))(new Redis(config[_0x8c8f('0x4')]));function Agent(_0x3ad96c){this['id']=_0x3ad96c['id']||0x0;this[_0x8c8f('0x8')]=_0x3ad96c[_0x8c8f('0x8')]||'';this[_0x8c8f('0x9')]=_0x3ad96c[_0x8c8f('0x9')]||!![];this[_0x8c8f('0xa')]=_0x3ad96c[_0x8c8f('0xa')]||![];this[_0x8c8f('0xb')]=_0x3ad96c[_0x8c8f('0xb')]||![];this[_0x8c8f('0xc')]=_0x3ad96c['mailPause']||![];this[_0x8c8f('0xd')]=_0x3ad96c['faxPause']||![];this['smsPause']=_0x3ad96c[_0x8c8f('0xe')]||![];this['openchannelPause']=_0x3ad96c[_0x8c8f('0xf')]||![];this['chatStatus']='unknown';this[_0x8c8f('0x10')]=0x0;this['chatCapacity']=_0x3ad96c['chatCapacity']||0x0;this[_0x8c8f('0x11')]=0x0;this['mailStatus']=_0x8c8f('0x12');this[_0x8c8f('0x13')]=0x0;this[_0x8c8f('0x14')]=_0x3ad96c[_0x8c8f('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x8c8f('0x12');this[_0x8c8f('0x15')]=0x0;this[_0x8c8f('0x16')]=_0x3ad96c['faxCapacity']||0x0;this[_0x8c8f('0x17')]=0x0;this[_0x8c8f('0x18')]='unknown';this[_0x8c8f('0x19')]=0x0;this[_0x8c8f('0x1a')]=_0x3ad96c[_0x8c8f('0x1a')]||0x0;this[_0x8c8f('0x1b')]=0x0;this['whatsappStatus']=_0x8c8f('0x12');this[_0x8c8f('0x1c')]=0x0;this['whatsappCapacity']=_0x3ad96c[_0x8c8f('0x1d')]||0x0;this[_0x8c8f('0x1e')]=0x0;this[_0x8c8f('0x1f')]=_0x8c8f('0x12');this[_0x8c8f('0x20')]=0x0;this[_0x8c8f('0x21')]=_0x3ad96c['openchannelCapacity']||0x0;this[_0x8c8f('0x22')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x8c8f('0x2')]='';this[_0x8c8f('0x23')]();}Agent[_0x8c8f('0x24')][_0x8c8f('0x25')]=function(_0x169fff){if(this[_0x169fff+_0x8c8f('0x26')]>0x0){if(this[_0x169fff+_0x8c8f('0x27')]>0x0&&this[_0x169fff+_0x8c8f('0x26')]>=this[_0x169fff+_0x8c8f('0x27')]){return _0x8c8f('0x28');}else{return _0x8c8f('0x29');}}else{return'idle';}};Agent[_0x8c8f('0x24')][_0x8c8f('0x23')]=function(){var _0x185f1f=[_0x8c8f('0x2a'),_0x8c8f('0x2b'),'openchannel',_0x8c8f('0x2c'),_0x8c8f('0x2d'),_0x8c8f('0x2e')];for(var _0x4bf4d6=0x0;_0x4bf4d6<_0x185f1f[_0x8c8f('0x2f')];_0x4bf4d6+=0x1){var _0x1a8c4a=this[_0x8c8f('0x25')](_0x185f1f[_0x4bf4d6]);if(this[_0x185f1f[_0x4bf4d6]+_0x8c8f('0x30')]!==_0x1a8c4a){this[_0x185f1f[_0x4bf4d6]+_0x8c8f('0x31')]=_[_0x8c8f('0x32')](moment()[_0x8c8f('0x33')]('x'));}this[_0x185f1f[_0x4bf4d6]+'Status']=_0x1a8c4a;}var _0x2a7838={'id':this['id'],'name':this[_0x8c8f('0x8')],'online':this[_0x8c8f('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x8c8f('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0x8c8f('0xe')],'faxPause':this[_0x8c8f('0xd')],'openchannelPause':this[_0x8c8f('0xf')],'chatStatus':this[_0x8c8f('0x34')],'chatStatusTime':this[_0x8c8f('0x10')],'chatCapacity':this[_0x8c8f('0x35')],'chatCurrentCapacity':this[_0x8c8f('0x11')],'mailStatus':this[_0x8c8f('0x36')],'mailStatusTime':this[_0x8c8f('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x8c8f('0x37')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x8c8f('0x17')],'smsStatus':this[_0x8c8f('0x18')],'smsStatusTime':this[_0x8c8f('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x8c8f('0x38')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x8c8f('0x1e')],'openchannelStatus':this[_0x8c8f('0x1f')],'openchannelStatusTime':this[_0x8c8f('0x20')],'openchannelCapacity':this[_0x8c8f('0x21')],'openchannelCurrentCapacity':this[_0x8c8f('0x22')],'busy':this[_0x8c8f('0x39')],'busyQueue':this['busyQueue']};var _0x3bab08=md5(JSON[_0x8c8f('0x3a')](_0x2a7838));if(this[_0x8c8f('0x2')]!==_0x3bab08){this[_0x8c8f('0x2')]=_0x3bab08;io[_0x8c8f('0x3b')](_0x8c8f('0x3c'),_0x2a7838);}};module['exports']=Agent; \ No newline at end of file +var _0x9007=['length','getChannelStatus','Status','toNumber','format','faxPause','chatStatus','chatCurrentCapacity','mailStatus','faxCurrentCapacity','smsCurrentCapacity','stringify','emit','user:save','lodash','md5','redis','defaults','localhost','name','online','chatPause','mailPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','whatsapp'];(function(_0x5d599c,_0x4ce107){var _0x48fa11=function(_0x5d55b9){while(--_0x5d55b9){_0x5d599c['push'](_0x5d599c['shift']());}};_0x48fa11(++_0x4ce107);}(_0x9007,0xb3));var _0x7900=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9007[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7900('0x0'));var moment=require('moment');var md5=require(_0x7900('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7900('0x2')]=_[_0x7900('0x3')](config[_0x7900('0x2')],{'host':_0x7900('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7900('0x2')]));function Agent(_0x3480b3){this['id']=_0x3480b3['id']||0x0;this['name']=_0x3480b3[_0x7900('0x5')]||'';this['online']=_0x3480b3[_0x7900('0x6')]||!![];this['voicePause']=_0x3480b3['voicePause']||![];this[_0x7900('0x7')]=_0x3480b3[_0x7900('0x7')]||![];this[_0x7900('0x8')]=_0x3480b3[_0x7900('0x8')]||![];this['faxPause']=_0x3480b3['faxPause']||![];this[_0x7900('0x9')]=_0x3480b3[_0x7900('0x9')]||![];this[_0x7900('0xa')]=_0x3480b3[_0x7900('0xa')]||![];this['chatStatus']=_0x7900('0xb');this[_0x7900('0xc')]=0x0;this[_0x7900('0xd')]=_0x3480b3[_0x7900('0xd')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x7900('0xb');this[_0x7900('0xe')]=0x0;this['mailCapacity']=_0x3480b3[_0x7900('0xf')]||0x0;this[_0x7900('0x10')]=0x0;this[_0x7900('0x11')]=_0x7900('0xb');this[_0x7900('0x12')]=0x0;this[_0x7900('0x13')]=_0x3480b3[_0x7900('0x13')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x7900('0x14')]='unknown';this[_0x7900('0x15')]=0x0;this[_0x7900('0x16')]=_0x3480b3[_0x7900('0x16')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x7900('0x17')]=_0x7900('0xb');this[_0x7900('0x18')]=0x0;this[_0x7900('0x19')]=_0x3480b3[_0x7900('0x19')]||0x0;this[_0x7900('0x1a')]=0x0;this[_0x7900('0x1b')]=_0x7900('0xb');this['openchannelStatusTime']=0x0;this[_0x7900('0x1c')]=_0x3480b3['openchannelCapacity']||0x0;this[_0x7900('0x1d')]=0x0;this[_0x7900('0x1e')]=![];this[_0x7900('0x1f')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0x7900('0x20')]['getChannelStatus']=function(_0x216fb7){if(this[_0x216fb7+_0x7900('0x21')]>0x0){if(this[_0x216fb7+_0x7900('0x22')]>0x0&&this[_0x216fb7+'CurrentCapacity']>=this[_0x216fb7+_0x7900('0x22')]){return _0x7900('0x23');}else{return'working';}}else{return _0x7900('0x24');}};Agent[_0x7900('0x20')]['updateRealtime']=function(){var _0x36b3dc=[_0x7900('0x25'),_0x7900('0x26'),_0x7900('0x27'),'fax','sms',_0x7900('0x28')];for(var _0x14ad77=0x0;_0x14ad77<_0x36b3dc[_0x7900('0x29')];_0x14ad77+=0x1){var _0x54464e=this[_0x7900('0x2a')](_0x36b3dc[_0x14ad77]);if(this[_0x36b3dc[_0x14ad77]+_0x7900('0x2b')]!==_0x54464e){this[_0x36b3dc[_0x14ad77]+'StatusTime']=_[_0x7900('0x2c')](moment()[_0x7900('0x2d')]('x'));}this[_0x36b3dc[_0x14ad77]+_0x7900('0x2b')]=_0x54464e;}var _0x258c9f={'id':this['id'],'name':this['name'],'online':this[_0x7900('0x6')],'voicePause':this['voicePause'],'chatPause':this[_0x7900('0x7')],'mailPause':this[_0x7900('0x8')],'smsPause':this[_0x7900('0x9')],'faxPause':this[_0x7900('0x2e')],'openchannelPause':this[_0x7900('0xa')],'chatStatus':this[_0x7900('0x2f')],'chatStatusTime':this[_0x7900('0xc')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x7900('0x30')],'mailStatus':this[_0x7900('0x31')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x7900('0xf')],'mailCurrentCapacity':this[_0x7900('0x10')],'faxStatus':this[_0x7900('0x11')],'faxStatusTime':this[_0x7900('0x12')],'faxCapacity':this[_0x7900('0x13')],'faxCurrentCapacity':this[_0x7900('0x32')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x7900('0x15')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x7900('0x33')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x7900('0x18')],'whatsappCapacity':this[_0x7900('0x19')],'whatsappCurrentCapacity':this[_0x7900('0x1a')],'openchannelStatus':this[_0x7900('0x1b')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x7900('0x1d')],'busy':this['busy'],'busyQueue':this[_0x7900('0x1f')]};var _0x227f8f=md5(JSON[_0x7900('0x34')](_0x258c9f));if(this[_0x7900('0x1')]!==_0x227f8f){this[_0x7900('0x1')]=_0x227f8f;io[_0x7900('0x35')](_0x7900('0x36'),_0x258c9f);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index a9d0dd8..ffa7ebf 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 _0xbcf9=['../../../config/environment','defaults','localhost','socket.io-emitter','redis','timeout','strategy','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','paused','length','online','loggedIn','chatPause','available','waiting','stringify','format','chat:queue:%s','name','emit','chat_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0xbcf9,0x97));var _0x9bcf=function(_0x9c183,_0x1611a6){_0x9c183=_0x9c183-0x0;var _0x46383f=_0xbcf9[_0x9c183];return _0x46383f;};'use strict';var _=require(_0x9bcf('0x0'));var md5=require(_0x9bcf('0x1'));var util=require(_0x9bcf('0x2'));var Redis=require(_0x9bcf('0x3'));var config=require(_0x9bcf('0x4'));config['redis']=_[_0x9bcf('0x5')](config['redis'],{'host':_0x9bcf('0x6'),'port':0x18eb});var io=require(_0x9bcf('0x7'))(new Redis(config[_0x9bcf('0x8')]));function ChatQueue(_0x1b9d7d){this['id']=_0x1b9d7d['id']||0x0;this['name']=_0x1b9d7d['name']||'';this[_0x9bcf('0x9')]=_0x1b9d7d[_0x9bcf('0x9')]||0xa;this[_0x9bcf('0xa')]=_0x1b9d7d[_0x9bcf('0xa')]||'beepall';this[_0x9bcf('0xb')]=_0x1b9d7d[_0x9bcf('0xb')];this[_0x9bcf('0xc')]={};this['waiting']=0x0;this[_0x9bcf('0x1')]='';this['updateRouting']();this[_0x9bcf('0xd')]();}ChatQueue[_0x9bcf('0xe')][_0x9bcf('0xf')]=function(){var _0x56f1dd=this['mapAgentsId']['_rr'];this[_0x9bcf('0xc')]=_[_0x9bcf('0x10')](this[_0x9bcf('0xb')],'id');this[_0x9bcf('0xc')]['_rr']=_0x56f1dd;};ChatQueue[_0x9bcf('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9bcf('0x11')]=0x0;for(var _0x29c869=0x0;_0x29c869=0x0?this[_0x9bcf('0x16')]:0x0;var _0x10ff44={'id':this['id'],'available':this[_0x9bcf('0x16')],'loggedIn':this[_0x9bcf('0x14')],'name':this['name'],'paused':this[_0x9bcf('0x11')],'waiting':this[_0x9bcf('0x17')]};var _0x400b16=md5(JSON[_0x9bcf('0x18')](_0x10ff44));if(this[_0x9bcf('0x1')]!==_0x400b16){this[_0x9bcf('0x1')]=_0x400b16;io['to'](util[_0x9bcf('0x19')](_0x9bcf('0x1a'),_0x10ff44[_0x9bcf('0x1b')]))[_0x9bcf('0x1c')](_0x9bcf('0x1d'),_0x10ff44);}};module[_0x9bcf('0x1e')]=ChatQueue; \ No newline at end of file +var _0xaf86=['emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s'];(function(_0x2afcf4,_0x564e66){var _0x39c239=function(_0x22a9d3){while(--_0x22a9d3){_0x2afcf4['push'](_0x2afcf4['shift']());}};_0x39c239(++_0x564e66);}(_0xaf86,0xb1));var _0x6af8=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xaf86[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0x6af8('0x0'));var md5=require('md5');var util=require(_0x6af8('0x1'));var Redis=require(_0x6af8('0x2'));var config=require(_0x6af8('0x3'));config['redis']=_['defaults'](config[_0x6af8('0x4')],{'host':_0x6af8('0x5'),'port':0x18eb});var io=require(_0x6af8('0x6'))(new Redis(config[_0x6af8('0x4')]));function ChatQueue(_0x167d87){this['id']=_0x167d87['id']||0x0;this[_0x6af8('0x7')]=_0x167d87['name']||'';this[_0x6af8('0x8')]=_0x167d87[_0x6af8('0x8')]||0xa;this[_0x6af8('0x9')]=_0x167d87[_0x6af8('0x9')]||'beepall';this[_0x6af8('0xa')]=_0x167d87['Agents'];this[_0x6af8('0xb')]={};this[_0x6af8('0xc')]=0x0;this[_0x6af8('0xd')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0x6af8('0xe')]=function(){var _0xf1eb6a=this[_0x6af8('0xb')][_0x6af8('0xf')];this[_0x6af8('0xb')]=_[_0x6af8('0x10')](this[_0x6af8('0xa')],'id');this[_0x6af8('0xb')][_0x6af8('0xf')]=_0xf1eb6a;};ChatQueue[_0x6af8('0x11')]['updateRealtime']=function(){this[_0x6af8('0x12')]=0x0;this[_0x6af8('0x13')]=0x0;for(var _0x2661c0=0x0;_0x2661c0=0x0?this[_0x6af8('0x17')]:0x0;var _0xe19311={'id':this['id'],'available':this[_0x6af8('0x17')],'loggedIn':this[_0x6af8('0x12')],'name':this[_0x6af8('0x7')],'paused':this['paused'],'waiting':this[_0x6af8('0xc')]};var _0x2769b5=md5(JSON[_0x6af8('0x18')](_0xe19311));if(this['md5']!==_0x2769b5){this['md5']=_0x2769b5;io['to'](util['format'](_0x6af8('0x19'),_0xe19311[_0x6af8('0x7')]))[_0x6af8('0x1a')](_0x6af8('0x1b'),_0xe19311);}};module[_0x6af8('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 177f87e..bc19524 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 _0x3020=['fax:queue:%s','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','online','paused','available','stringify','md5','format'];(function(_0x6da0b5,_0x3a35d9){var _0x5cca89=function(_0x4140ab){while(--_0x4140ab){_0x6da0b5['push'](_0x6da0b5['shift']());}};_0x5cca89(++_0x3a35d9);}(_0x3020,0xff));var _0x0302=function(_0x221fc3,_0x3393b0){_0x221fc3=_0x221fc3-0x0;var _0x5bbb6c=_0x3020[_0x221fc3];return _0x5bbb6c;};'use strict';var _=require(_0x0302('0x0'));var md5=require('md5');var util=require(_0x0302('0x1'));var Redis=require(_0x0302('0x2'));var config=require(_0x0302('0x3'));config[_0x0302('0x4')]=_[_0x0302('0x5')](config[_0x0302('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x0302('0x6'))(new Redis(config[_0x0302('0x4')]));function FaxQueue(_0xd2b91e){this['id']=_0xd2b91e['id']||0x0;this['name']=_0xd2b91e[_0x0302('0x7')]||'';this[_0x0302('0x8')]=_0xd2b91e['timeout']||0xa;this['strategy']=_0xd2b91e[_0x0302('0x9')]||'beepall';this[_0x0302('0xa')]=_0xd2b91e['Agents'];this[_0x0302('0xb')]={};this[_0x0302('0xc')]=0x0;this['md5']='';this[_0x0302('0xd')]();this['updateRealtime']();}FaxQueue['prototype'][_0x0302('0xd')]=function(){var _0x240140=this[_0x0302('0xb')][_0x0302('0xe')];this[_0x0302('0xb')]=_[_0x0302('0xf')](this[_0x0302('0xa')],'id');this[_0x0302('0xb')][_0x0302('0xe')]=_0x240140;};FaxQueue[_0x0302('0x10')][_0x0302('0x11')]=function(){this[_0x0302('0x12')]=0x0;this['paused']=0x0;for(var _0x53183b=0x0;_0x53183b=0x0?this['available']:0x0;var _0x4e74c4={'id':this['id'],'available':this[_0x0302('0x15')],'loggedIn':this[_0x0302('0x12')],'name':this[_0x0302('0x7')],'paused':this[_0x0302('0x14')],'waiting':this[_0x0302('0xc')]};var _0x388a1c=md5(JSON[_0x0302('0x16')](_0x4e74c4));if(this[_0x0302('0x17')]!==_0x388a1c){this[_0x0302('0x17')]=_0x388a1c;io['to'](util[_0x0302('0x18')](_0x0302('0x19'),_0x4e74c4[_0x0302('0x7')]))['emit'](_0x0302('0x1a'),_0x4e74c4);}};module[_0x0302('0x1b')]=FaxQueue; \ No newline at end of file +var _0x87b6=['updateRealtime','loggedIn','paused','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','map'];(function(_0x15547b,_0x4acca1){var _0x13199f=function(_0x38e00f){while(--_0x38e00f){_0x15547b['push'](_0x15547b['shift']());}};_0x13199f(++_0x4acca1);}(_0x87b6,0x1da));var _0x687b=function(_0x482598,_0x54c1cf){_0x482598=_0x482598-0x0;var _0x4c9aae=_0x87b6[_0x482598];return _0x4c9aae;};'use strict';var _=require(_0x687b('0x0'));var md5=require('md5');var util=require(_0x687b('0x1'));var Redis=require(_0x687b('0x2'));var config=require(_0x687b('0x3'));config[_0x687b('0x4')]=_[_0x687b('0x5')](config[_0x687b('0x4')],{'host':_0x687b('0x6'),'port':0x18eb});var io=require(_0x687b('0x7'))(new Redis(config[_0x687b('0x4')]));function FaxQueue(_0x46e697){this['id']=_0x46e697['id']||0x0;this[_0x687b('0x8')]=_0x46e697[_0x687b('0x8')]||'';this['timeout']=_0x46e697[_0x687b('0x9')]||0xa;this[_0x687b('0xa')]=_0x46e697[_0x687b('0xa')]||_0x687b('0xb');this[_0x687b('0xc')]=_0x46e697[_0x687b('0xc')];this[_0x687b('0xd')]={};this[_0x687b('0xe')]=0x0;this[_0x687b('0xf')]='';this[_0x687b('0x10')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x1cbaee=this[_0x687b('0xd')][_0x687b('0x11')];this[_0x687b('0xd')]=_[_0x687b('0x12')](this[_0x687b('0xc')],'id');this[_0x687b('0xd')]['_rr']=_0x1cbaee;};FaxQueue['prototype'][_0x687b('0x13')]=function(){this[_0x687b('0x14')]=0x0;this[_0x687b('0x15')]=0x0;for(var _0x51ab22=0x0;_0x51ab22=0x0?this[_0x687b('0x17')]:0x0;var _0xbcc953={'id':this['id'],'available':this[_0x687b('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x687b('0x8')],'paused':this[_0x687b('0x15')],'waiting':this['waiting']};var _0x1681bc=md5(JSON[_0x687b('0x18')](_0xbcc953));if(this[_0x687b('0xf')]!==_0x1681bc){this[_0x687b('0xf')]=_0x1681bc;io['to'](util[_0x687b('0x19')](_0x687b('0x1a'),_0xbcc953[_0x687b('0x8')]))['emit'](_0x687b('0x1b'),_0xbcc953);}};module[_0x687b('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 0e882ba..da5ed9c 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 _0x6b86=['name','Intervals'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6b86,0x80));var _0x66b8=function(_0x4b479b,_0x3b686f){_0x4b479b=_0x4b479b-0x0;var _0x5d2376=_0x6b86[_0x4b479b];return _0x5d2376;};'use strict';function Interval(_0x2a5bee){this['id']=_0x2a5bee['id']||0x0;this['name']=_0x2a5bee[_0x66b8('0x0')]||'';this[_0x66b8('0x1')]=_0x2a5bee[_0x66b8('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xa308=['Intervals'];(function(_0x10d863,_0x539ae4){var _0xcdd2ff=function(_0x5a31ed){while(--_0x5a31ed){_0x10d863['push'](_0x10d863['shift']());}};_0xcdd2ff(++_0x539ae4);}(_0xa308,0x1ed));var _0x8a30=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xa308[_0xacb1e2];return _0x463815;};'use strict';function Interval(_0x308e49){this['id']=_0x308e49['id']||0x0;this['name']=_0x308e49['name']||'';this[_0x8a30('0x0')]=_0x308e49[_0x8a30('0x0')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 101bcb8..c91bbe4 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 _0x1258=['beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn','mailPause','available','name','waiting','stringify','format','emit','mail_queue:save','exports','md5','util','ioredis','redis','defaults','socket.io-emitter','timeout','strategy'];(function(_0x515491,_0x3d7e6c){var _0x5aa2e2=function(_0x136472){while(--_0x136472){_0x515491['push'](_0x515491['shift']());}};_0x5aa2e2(++_0x3d7e6c);}(_0x1258,0xf4));var _0x8125=function(_0x57d101,_0x1f212e){_0x57d101=_0x57d101-0x0;var _0xe9481d=_0x1258[_0x57d101];return _0xe9481d;};'use strict';var _=require('lodash');var md5=require(_0x8125('0x0'));var util=require(_0x8125('0x1'));var Redis=require(_0x8125('0x2'));var config=require('../../../config/environment');config[_0x8125('0x3')]=_[_0x8125('0x4')](config[_0x8125('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x8125('0x5'))(new Redis(config['redis']));function MailQueue(_0x100155){this['id']=_0x100155['id']||0x0;this['name']=_0x100155['name']||'';this[_0x8125('0x6')]=_0x100155['timeout']||0xa;this[_0x8125('0x7')]=_0x100155[_0x8125('0x7')]||_0x8125('0x8');this[_0x8125('0x9')]=_0x100155[_0x8125('0x9')];this[_0x8125('0xa')]={};this['waiting']=0x0;this[_0x8125('0x0')]='';this[_0x8125('0xb')]();this[_0x8125('0xc')]();}MailQueue[_0x8125('0xd')][_0x8125('0xb')]=function(){var _0x12faca=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0x8125('0x9')],'id');this[_0x8125('0xa')][_0x8125('0xe')]=_0x12faca;};MailQueue[_0x8125('0xd')][_0x8125('0xc')]=function(){this['loggedIn']=0x0;this[_0x8125('0xf')]=0x0;for(var _0x91113c=0x0;_0x91113c=0x0?this[_0x8125('0x14')]:0x0;var _0x4fbc0b={'id':this['id'],'available':this[_0x8125('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x8125('0x15')],'paused':this['paused'],'waiting':this[_0x8125('0x16')]};var _0x36324e=md5(JSON[_0x8125('0x17')](_0x4fbc0b));if(this['md5']!==_0x36324e){this[_0x8125('0x0')]=_0x36324e;io['to'](util[_0x8125('0x18')]('mail:queue:%s',_0x4fbc0b[_0x8125('0x15')]))[_0x8125('0x19')](_0x8125('0x1a'),_0x4fbc0b);}};module[_0x8125('0x1b')]=MailQueue; \ No newline at end of file +var _0x30bd=['waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','online','mailPause','available'];(function(_0x32c4d5,_0x4c7736){var _0x3f2b2f=function(_0x1954d6){while(--_0x1954d6){_0x32c4d5['push'](_0x32c4d5['shift']());}};_0x3f2b2f(++_0x4c7736);}(_0x30bd,0x103));var _0xd30b=function(_0x56ddd5,_0x2e8531){_0x56ddd5=_0x56ddd5-0x0;var _0x10946e=_0x30bd[_0x56ddd5];return _0x10946e;};'use strict';var _=require('lodash');var md5=require(_0xd30b('0x0'));var util=require('util');var Redis=require(_0xd30b('0x1'));var config=require('../../../config/environment');config[_0xd30b('0x2')]=_[_0xd30b('0x3')](config[_0xd30b('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xd30b('0x4'))(new Redis(config['redis']));function MailQueue(_0xca48f2){this['id']=_0xca48f2['id']||0x0;this[_0xd30b('0x5')]=_0xca48f2[_0xd30b('0x5')]||'';this[_0xd30b('0x6')]=_0xca48f2[_0xd30b('0x6')]||0xa;this['strategy']=_0xca48f2[_0xd30b('0x7')]||_0xd30b('0x8');this[_0xd30b('0x9')]=_0xca48f2[_0xd30b('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xd30b('0x0')]='';this[_0xd30b('0xa')]();this['updateRealtime']();}MailQueue['prototype'][_0xd30b('0xa')]=function(){var _0x1de082=this[_0xd30b('0xb')][_0xd30b('0xc')];this['mapAgentsId']=_[_0xd30b('0xd')](this['Agents'],'id');this['mapAgentsId'][_0xd30b('0xc')]=_0x1de082;};MailQueue[_0xd30b('0xe')][_0xd30b('0xf')]=function(){this[_0xd30b('0x10')]=0x0;this[_0xd30b('0x11')]=0x0;for(var _0x11f960=0x0;_0x11f960=0x0?this[_0xd30b('0x14')]:0x0;var _0x102e4b={'id':this['id'],'available':this[_0xd30b('0x14')],'loggedIn':this[_0xd30b('0x10')],'name':this[_0xd30b('0x5')],'paused':this[_0xd30b('0x11')],'waiting':this[_0xd30b('0x15')]};var _0x101eb3=md5(JSON[_0xd30b('0x16')](_0x102e4b));if(this[_0xd30b('0x0')]!==_0x101eb3){this['md5']=_0x101eb3;io['to'](util[_0xd30b('0x17')](_0xd30b('0x18'),_0x102e4b[_0xd30b('0x5')]))[_0xd30b('0x19')](_0xd30b('0x1a'),_0x102e4b);}};module[_0xd30b('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 28fa094..a42924e 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x1b8050,_0x4d12c6){var _0x1ec2b1=function(_0x4c150a){while(--_0x4c150a){_0x1b8050['push'](_0x1b8050['shift']());}};_0x1ec2b1(++_0x4d12c6);}(_0xadb5,0xad));var _0x5adb=function(_0x452533,_0x56bc8f){_0x452533=_0x452533-0x0;var _0x2b9353=_0xadb5[_0x452533];return _0x2b9353;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 398b4ad..cd877fc 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 _0x2fed=['_rr','map','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0x2fed,0x7c));var _0xd2fe=function(_0x2cf499,_0x31e2a3){_0x2cf499=_0x2cf499-0x0;var _0x33c3cc=_0x2fed[_0x2cf499];return _0x33c3cc;};'use strict';var _=require(_0xd2fe('0x0'));var md5=require(_0xd2fe('0x1'));var util=require(_0xd2fe('0x2'));var Redis=require(_0xd2fe('0x3'));var config=require(_0xd2fe('0x4'));config['redis']=_[_0xd2fe('0x5')](config[_0xd2fe('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd2fe('0x6')]));function SmsQueue(_0x24ba90){this['id']=_0x24ba90['id']||0x0;this[_0xd2fe('0x7')]=_0x24ba90['name']||'';this[_0xd2fe('0x8')]=_0x24ba90[_0xd2fe('0x8')]||0xa;this[_0xd2fe('0x9')]=_0x24ba90[_0xd2fe('0x9')]||'beepall';this[_0xd2fe('0xa')]=_0x24ba90[_0xd2fe('0xa')];this[_0xd2fe('0xb')]={};this[_0xd2fe('0xc')]=0x0;this[_0xd2fe('0x1')]='';this[_0xd2fe('0xd')]();this[_0xd2fe('0xe')]();}SmsQueue[_0xd2fe('0xf')][_0xd2fe('0xd')]=function(){var _0x13c68f=this[_0xd2fe('0xb')][_0xd2fe('0x10')];this[_0xd2fe('0xb')]=_[_0xd2fe('0x11')](this[_0xd2fe('0xa')],'id');this[_0xd2fe('0xb')][_0xd2fe('0x10')]=_0x13c68f;};SmsQueue[_0xd2fe('0xf')]['updateRealtime']=function(){this[_0xd2fe('0x12')]=0x0;this[_0xd2fe('0x13')]=0x0;for(var _0x2a9355=0x0;_0x2a9355=0x0?this[_0xd2fe('0x16')]:0x0;var _0x40162f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd2fe('0x12')],'name':this[_0xd2fe('0x7')],'paused':this[_0xd2fe('0x13')],'waiting':this[_0xd2fe('0xc')]};var _0x34c324=md5(JSON[_0xd2fe('0x17')](_0x40162f));if(this[_0xd2fe('0x1')]!==_0x34c324){this[_0xd2fe('0x1')]=_0x34c324;io['to'](util[_0xd2fe('0x18')](_0xd2fe('0x19'),_0x40162f['name']))[_0xd2fe('0x1a')]('sms_queue:save',_0x40162f);}};module[_0xd2fe('0x1b')]=SmsQueue; \ No newline at end of file +var _0x5ad3=['sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','_rr','mapAgentsId','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit'];(function(_0x28523f,_0x8438cf){var _0x9d4414=function(_0xf99eeb){while(--_0xf99eeb){_0x28523f['push'](_0x28523f['shift']());}};_0x9d4414(++_0x8438cf);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x5ad3[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x35ad('0x0'));var md5=require(_0x35ad('0x1'));var util=require(_0x35ad('0x2'));var Redis=require(_0x35ad('0x3'));var config=require('../../../config/environment');config[_0x35ad('0x4')]=_[_0x35ad('0x5')](config[_0x35ad('0x4')],{'host':_0x35ad('0x6'),'port':0x18eb});var io=require(_0x35ad('0x7'))(new Redis(config[_0x35ad('0x4')]));function SmsQueue(_0x729a01){this['id']=_0x729a01['id']||0x0;this[_0x35ad('0x8')]=_0x729a01[_0x35ad('0x8')]||'';this[_0x35ad('0x9')]=_0x729a01['timeout']||0xa;this[_0x35ad('0xa')]=_0x729a01[_0x35ad('0xa')]||_0x35ad('0xb');this['Agents']=_0x729a01[_0x35ad('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x35ad('0x1')]='';this[_0x35ad('0xd')]();this['updateRealtime']();}SmsQueue[_0x35ad('0xe')][_0x35ad('0xd')]=function(){var _0x4ad760=this['mapAgentsId'][_0x35ad('0xf')];this[_0x35ad('0x10')]=_['map'](this[_0x35ad('0xc')],'id');this[_0x35ad('0x10')]['_rr']=_0x4ad760;};SmsQueue['prototype'][_0x35ad('0x11')]=function(){this[_0x35ad('0x12')]=0x0;this[_0x35ad('0x13')]=0x0;for(var _0x4b7ad9=0x0;_0x4b7ad9=0x0?this[_0x35ad('0x17')]:0x0;var _0x3a73c8={'id':this['id'],'available':this[_0x35ad('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x35ad('0x8')],'paused':this[_0x35ad('0x13')],'waiting':this['waiting']};var _0x53b8e3=md5(JSON[_0x35ad('0x18')](_0x3a73c8));if(this[_0x35ad('0x1')]!==_0x53b8e3){this['md5']=_0x53b8e3;io['to'](util[_0x35ad('0x19')](_0x35ad('0x1a'),_0x3a73c8['name']))[_0x35ad('0x1b')](_0x35ad('0x1c'),_0x3a73c8);}};module[_0x35ad('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index e29fb72..d3ae847 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 _0x9244=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','Agents','length','online','whatsappPause','paused','available','md5','format','emit','whatsapp_queue:save','exports','lodash'];(function(_0xa99c34,_0x539cb9){var _0x147cdd=function(_0x3d0e78){while(--_0x3d0e78){_0xa99c34['push'](_0xa99c34['shift']());}};_0x147cdd(++_0x539cb9);}(_0x9244,0x8b));var _0x4924=function(_0x47864b,_0x5d32e6){_0x47864b=_0x47864b-0x0;var _0x3a1b97=_0x9244[_0x47864b];return _0x3a1b97;};'use strict';var _=require(_0x4924('0x0'));var md5=require('md5');var util=require(_0x4924('0x1'));var Redis=require(_0x4924('0x2'));var config=require(_0x4924('0x3'));config[_0x4924('0x4')]=_['defaults'](config['redis'],{'host':_0x4924('0x5'),'port':0x18eb});var io=require(_0x4924('0x6'))(new Redis(config[_0x4924('0x4')]));function WhatsappQueue(_0xfe166f){this['id']=_0xfe166f['id']||0x0;this['name']=_0xfe166f[_0x4924('0x7')]||'';this[_0x4924('0x8')]=_0xfe166f[_0x4924('0x8')]||0xa;this['strategy']=_0xfe166f['strategy']||'beepall';this['Agents']=_0xfe166f['Agents'];this['mapAgentsId']={};this[_0x4924('0x9')]=0x0;this['md5']='';this[_0x4924('0xa')]();this['updateRealtime']();}WhatsappQueue[_0x4924('0xb')][_0x4924('0xa')]=function(){var _0x488a78=this[_0x4924('0xc')]['_rr'];this[_0x4924('0xc')]=_[_0x4924('0xd')](this['Agents'],'id');this[_0x4924('0xc')][_0x4924('0xe')]=_0x488a78;};WhatsappQueue[_0x4924('0xb')][_0x4924('0xf')]=function(){this[_0x4924('0x10')]=0x0;this['paused']=0x0;for(var _0x15c61f=0x0;_0x15c61f=0x0?this['available']:0x0;var _0x138f60={'id':this['id'],'available':this[_0x4924('0x16')],'loggedIn':this[_0x4924('0x10')],'name':this[_0x4924('0x7')],'paused':this['paused'],'waiting':this[_0x4924('0x9')]};var _0x5e01fe=md5(JSON['stringify'](_0x138f60));if(this[_0x4924('0x17')]!==_0x5e01fe){this[_0x4924('0x17')]=_0x5e01fe;io['to'](util[_0x4924('0x18')]('whatsapp:queue:%s',_0x138f60[_0x4924('0x7')]))[_0x4924('0x19')](_0x4924('0x1a'),_0x138f60);}};module[_0x4924('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x896c=['map','_rr','paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId'];(function(_0x4a1dd9,_0x177a77){var _0x3e1019=function(_0x52869c){while(--_0x52869c){_0x4a1dd9['push'](_0x4a1dd9['shift']());}};_0x3e1019(++_0x177a77);}(_0x896c,0x1a3));var _0xc896=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0x896c[_0x5d9867];return _0x7d2118;};'use strict';var _=require(_0xc896('0x0'));var md5=require(_0xc896('0x1'));var util=require(_0xc896('0x2'));var Redis=require('ioredis');var config=require(_0xc896('0x3'));config[_0xc896('0x4')]=_['defaults'](config[_0xc896('0x4')],{'host':_0xc896('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc896('0x4')]));function WhatsappQueue(_0x55c8e0){this['id']=_0x55c8e0['id']||0x0;this['name']=_0x55c8e0[_0xc896('0x6')]||'';this['timeout']=_0x55c8e0[_0xc896('0x7')]||0xa;this['strategy']=_0x55c8e0[_0xc896('0x8')]||_0xc896('0x9');this['Agents']=_0x55c8e0[_0xc896('0xa')];this['mapAgentsId']={};this[_0xc896('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xc896('0xc')]();}WhatsappQueue[_0xc896('0xd')][_0xc896('0xe')]=function(){var _0x3935ee=this[_0xc896('0xf')]['_rr'];this['mapAgentsId']=_[_0xc896('0x10')](this['Agents'],'id');this[_0xc896('0xf')][_0xc896('0x11')]=_0x3935ee;};WhatsappQueue['prototype'][_0xc896('0xc')]=function(){this['loggedIn']=0x0;this[_0xc896('0x12')]=0x0;for(var _0x330a5d=0x0;_0x330a5d=0x0?this[_0xc896('0x17')]:0x0;var _0x28f23a={'id':this['id'],'available':this[_0xc896('0x17')],'loggedIn':this[_0xc896('0x15')],'name':this[_0xc896('0x6')],'paused':this[_0xc896('0x12')],'waiting':this[_0xc896('0xb')]};var _0x5e14b8=md5(JSON[_0xc896('0x18')](_0x28f23a));if(this[_0xc896('0x1')]!==_0x5e14b8){this[_0xc896('0x1')]=_0x5e14b8;io['to'](util[_0xc896('0x19')](_0xc896('0x1a'),_0x28f23a[_0xc896('0x6')]))[_0xc896('0x1b')](_0xc896('0x1c'),_0x28f23a);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8ccf3fb..bc9f7ad 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 12f9c08..ca2d38b 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 _0xfb71=['update','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x46879b,_0x2cc1b9){var _0x61b285=function(_0x591ad9){while(--_0x591ad9){_0x46879b['push'](_0x46879b['shift']());}};_0x61b285(++_0x2cc1b9);}(_0xfb71,0x15d));var _0x1fb7=function(_0x9db041,_0x25821e){_0x9db041=_0x9db041-0x0;var _0x28c133=_0xfb71[_0x9db041];return _0x28c133;};'use strict';var client=require(_0x1fb7('0x0'));exports[_0x1fb7('0x1')]=function(_0x55c782,_0x3d74e8){return client[_0x1fb7('0x2')]('UpdateChatInteraction',{'body':_0x3d74e8,'options':{'where':{'id':_0x55c782}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x5324f1,_0x3d5b98){return client[_0x1fb7('0x2')](_0x1fb7('0x3'),{'body':_0x3d5b98,'options':{'where':{'id':_0x5324f1}},'log':_0x1fb7('0x4')});}; \ No newline at end of file +var _0xb139=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0xc01247,_0xfb9842){var _0x1e4603=function(_0xe3a18){while(--_0xe3a18){_0xc01247['push'](_0xc01247['shift']());}};_0x1e4603(++_0xfb9842);}(_0xb139,0xd0));var _0x9b13=function(_0x565df9,_0x5e4aa5){_0x565df9=_0x565df9-0x0;var _0x78beb7=_0xb139[_0x565df9];return _0x78beb7;};'use strict';var client=require(_0x9b13('0x0'));exports[_0x9b13('0x1')]=function(_0x314e9a,_0x31017a){return client[_0x9b13('0x2')]('UpdateChatInteraction',{'body':_0x31017a,'options':{'where':{'id':_0x314e9a}},'log':_0x9b13('0x3')});};exports[_0x9b13('0x4')]=function(_0x3e21e1,_0x2414f5){return client[_0x9b13('0x2')](_0x9b13('0x5'),{'body':_0x2414f5,'options':{'where':{'id':_0x3e21e1}},'log':_0x9b13('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 068dd25..e43ec4c 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 _0x9dc9=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9dc9,0x9c));var _0x99dc=function(_0x32858c,_0x2cb6c2){_0x32858c=_0x32858c-0x0;var _0x109883=_0x9dc9[_0x32858c];return _0x109883;};'use strict';var client=require(_0x99dc('0x0'));exports[_0x99dc('0x1')]=function(_0x249784){return client[_0x99dc('0x2')](_0x99dc('0x3'),{'body':_0x249784,'log':_0x99dc('0x4')});}; \ No newline at end of file +var _0xec25=['../client','create','Request','CreateChatMessage'];(function(_0x1f13e0,_0x4bf225){var _0x41be47=function(_0x13dc37){while(--_0x13dc37){_0x1f13e0['push'](_0x1f13e0['shift']());}};_0x41be47(++_0x4bf225);}(_0xec25,0x1f4));var _0x5ec2=function(_0x37704b,_0x289798){_0x37704b=_0x37704b-0x0;var _0xf28329=_0xec25[_0x37704b];return _0xf28329;};'use strict';var client=require(_0x5ec2('0x0'));exports[_0x5ec2('0x1')]=function(_0x3fcf2d){return client[_0x5ec2('0x2')](_0x5ec2('0x3'),{'body':_0x3fcf2d,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 47101ae..3b71248 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 _0x80ce=['GetChatQueue','name','strategy','User','Agents','getChatQueues'];(function(_0x20508d,_0x29e57f){var _0x278bb8=function(_0x5955cd){while(--_0x5955cd){_0x20508d['push'](_0x20508d['shift']());}};_0x278bb8(++_0x29e57f);}(_0x80ce,0xae));var _0xe80c=function(_0x2114be,_0x4b26cd){_0x2114be=_0x2114be-0x0;var _0x22c0f6=_0x80ce[_0x2114be];return _0x22c0f6;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request'](_0xe80c('0x0'),{'options':{'raw':![],'attributes':['id',_0xe80c('0x1'),'timeout',_0xe80c('0x2')],'include':[{'model':_0xe80c('0x3'),'as':_0xe80c('0x4'),'attributes':['id','name','online','chatPause']}]},'log':_0xe80c('0x5')});};}; \ No newline at end of file +var _0x85d0=['Agents','chatPause','name','timeout','strategy','User'];(function(_0x508f91,_0x526e24){var _0x15c16a=function(_0x4d00ba){while(--_0x4d00ba){_0x508f91['push'](_0x508f91['shift']());}};_0x15c16a(++_0x526e24);}(_0x85d0,0x164));var _0x085d=function(_0xde9386,_0x5b494e){_0xde9386=_0xde9386-0x0;var _0x41faad=_0x85d0[_0xde9386];return _0x41faad;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x085d('0x0'),_0x085d('0x1'),_0x085d('0x2')],'include':[{'model':_0x085d('0x3'),'as':_0x085d('0x4'),'attributes':['id',_0x085d('0x0'),'online',_0x085d('0x5')]}]},'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 e732993..fb3beab 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 _0x8696=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update','DESC'];(function(_0x20664d,_0x2e835e){var _0x26cff2=function(_0x52d185){while(--_0x52d185){_0x20664d['push'](_0x20664d['shift']());}};_0x26cff2(++_0x2e835e);}(_0x8696,0x143));var _0x6869=function(_0x13b97c,_0x1a8f4d){_0x13b97c=_0x13b97c-0x0;var _0x2f2201=_0x8696[_0x13b97c];return _0x2f2201;};'use strict';var client=require(_0x6869('0x0'));exports[_0x6869('0x1')]=function(_0x55d9c2){return client[_0x6869('0x2')]('CreateChatQueueReport',{'body':_0x55d9c2,'log':_0x6869('0x3')});};exports[_0x6869('0x4')]=function(_0x350474,_0x4dadb5){return client[_0x6869('0x2')]('UpdateChatQueueReport',{'body':_0x4dadb5,'options':{'where':{'uniqueid':_0x350474},'order':[['id',_0x6869('0x5')]],'limit':0x1},'log':_0x6869('0x6')});}; \ No newline at end of file +var _0xe920=['Request','CreateChatQueueReport','update','DESC','../client','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe920,0xbe));var _0x0e92=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xe920[_0x237546];return _0x233e29;};'use strict';var client=require(_0x0e92('0x0'));exports[_0x0e92('0x1')]=function(_0x203091){return client[_0x0e92('0x2')](_0x0e92('0x3'),{'body':_0x203091,'log':_0x0e92('0x3')});};exports[_0x0e92('0x4')]=function(_0x39e6a1,_0xfaa87e){return client[_0x0e92('0x2')]('UpdateChatQueueReport',{'body':_0xfaa87e,'options':{'where':{'uniqueid':_0x39e6a1},'order':[['id',_0x0e92('0x5')]],'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 481b14c..6fc476d 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(_0x2f7c40,_0xb36203){var _0x57a4a5=function(_0x47db35){while(--_0x47db35){_0x2f7c40['push'](_0x2f7c40['shift']());}};_0x57a4a5(++_0xb36203);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_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(_0x128f18,_0xd7ba38){var _0x28d6fb=function(_0x155986){while(--_0x155986){_0x128f18['push'](_0x128f18['shift']());}};_0x28d6fb(++_0xd7ba38);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_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 dce626f..11a549d 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 _0x3e2e=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e2e,0xb0));var _0xe3e2=function(_0x5c430e,_0x7b5ab1){_0x5c430e=_0x5c430e-0x0;var _0x46d8c5=_0x3e2e[_0x5c430e];return _0x46d8c5;};'use strict';var client=require(_0xe3e2('0x0'));exports[_0xe3e2('0x1')]=function(_0xfcd00f){return client[_0xe3e2('0x2')](_0xe3e2('0x3'),{'body':_0xfcd00f,'log':_0xe3e2('0x4')});}; \ No newline at end of file +var _0x6ae2=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0xad7f9d,_0x33d10c){var _0x591a54=function(_0x495b55){while(--_0x495b55){_0xad7f9d['push'](_0xad7f9d['shift']());}};_0x591a54(++_0x33d10c);}(_0x6ae2,0x9f));var _0x26ae=function(_0x2bf39f,_0x3641ad){_0x2bf39f=_0x2bf39f-0x0;var _0x2d1c1c=_0x6ae2[_0x2bf39f];return _0x2d1c1c;};'use strict';var client=require(_0x26ae('0x0'));exports['create']=function(_0x42fcdf){return client[_0x26ae('0x1')](_0x26ae('0x2'),{'body':_0x42fcdf,'log':_0x26ae('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4b448e7..e6e5e67 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 _0xfb23=['Request','timeout','strategy','Agents','online','faxPause','../client','getFaxQueues'];(function(_0xda2495,_0x2fc0a4){var _0x591128=function(_0x3d02f4){while(--_0x3d02f4){_0xda2495['push'](_0xda2495['shift']());}};_0x591128(++_0x2fc0a4);}(_0xfb23,0x186));var _0x3fb2=function(_0xce6b72,_0xa183e3){_0xce6b72=_0xce6b72-0x0;var _0x563dd6=_0xfb23[_0xce6b72];return _0x563dd6;};'use strict';var client=require(_0x3fb2('0x0'));exports[_0x3fb2('0x1')]=function(){return function(){return client[_0x3fb2('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x3fb2('0x3'),_0x3fb2('0x4')],'include':[{'model':'User','as':_0x3fb2('0x5'),'attributes':['id','name',_0x3fb2('0x6'),_0x3fb2('0x7')]}]},'log':_0x3fb2('0x1')});};}; \ No newline at end of file +var _0x95a6=['Agents','online','../client','getFaxQueues','GetFaxQueue','name','strategy','User'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x95a6,0xe2));var _0x695a=function(_0x1fe7b1,_0x20e9f1){_0x1fe7b1=_0x1fe7b1-0x0;var _0x2e3169=_0x95a6[_0x1fe7b1];return _0x2e3169;};'use strict';var client=require(_0x695a('0x0'));exports[_0x695a('0x1')]=function(){return function(){return client['Request'](_0x695a('0x2'),{'options':{'raw':![],'attributes':['id',_0x695a('0x3'),'timeout',_0x695a('0x4')],'include':[{'model':_0x695a('0x5'),'as':_0x695a('0x6'),'attributes':['id','name',_0x695a('0x7'),'faxPause']}]},'log':_0x695a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f7ae7e1..0774830 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 _0xe0bc=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0xd7d11e,_0x2073f2){var _0x4ed223=function(_0x4ab797){while(--_0x4ab797){_0xd7d11e['push'](_0xd7d11e['shift']());}};_0x4ed223(++_0x2073f2);}(_0xe0bc,0x1a1));var _0xce0b=function(_0x44c015,_0xd629c){_0x44c015=_0x44c015-0x0;var _0x30d452=_0xe0bc[_0x44c015];return _0x30d452;};'use strict';var client=require(_0xce0b('0x0'));exports[_0xce0b('0x1')]=function(_0x4919d8){return client[_0xce0b('0x2')](_0xce0b('0x3'),{'body':_0x4919d8,'log':_0xce0b('0x3')});};exports[_0xce0b('0x4')]=function(_0x334ceb,_0x377c4e){return client[_0xce0b('0x2')](_0xce0b('0x5'),{'body':_0x377c4e,'options':{'where':{'uniqueid':_0x334ceb},'order':[['id',_0xce0b('0x6')]],'limit':0x1},'log':_0xce0b('0x5')});}; \ No newline at end of file +var _0xa01a=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa01a,0x175));var _0xaa01=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xa01a[_0x2dea24];return _0x309d58;};'use strict';var client=require(_0xaa01('0x0'));exports['create']=function(_0x269c5c){return client[_0xaa01('0x1')](_0xaa01('0x2'),{'body':_0x269c5c,'log':_0xaa01('0x2')});};exports[_0xaa01('0x3')]=function(_0x1ee543,_0x2e8275){return client[_0xaa01('0x1')](_0xaa01('0x4'),{'body':_0x2e8275,'options':{'where':{'uniqueid':_0x1ee543},'order':[['id',_0xaa01('0x5')]],'limit':0x1},'log':_0xaa01('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6060ba9..a1df463 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 _0xb737=['GetInterval','name','interval','../client','getIntervals','Request'];(function(_0x7e3bb8,_0x27c048){var _0x44c887=function(_0x55d7c6){while(--_0x55d7c6){_0x7e3bb8['push'](_0x7e3bb8['shift']());}};_0x44c887(++_0x27c048);}(_0xb737,0x12f));var _0x7b73=function(_0x7d3039,_0x63151b){_0x7d3039=_0x7d3039-0x0;var _0x24031e=_0xb737[_0x7d3039];return _0x24031e;};'use strict';var client=require(_0x7b73('0x0'));exports[_0x7b73('0x1')]=function(){return function(){return client[_0x7b73('0x2')](_0x7b73('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7b73('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x7b73('0x4'),_0x7b73('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xb468=['../client','Request','name','Interval','Intervals'];(function(_0x32413a,_0x2fbe54){var _0x1439e0=function(_0x108320){while(--_0x108320){_0x32413a['push'](_0x32413a['shift']());}};_0x1439e0(++_0x2fbe54);}(_0xb468,0xe1));var _0x8b46=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb468[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x8b46('0x0'));exports['getIntervals']=function(){return function(){return client[_0x8b46('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8b46('0x2')],'include':[{'model':_0x8b46('0x3'),'as':_0x8b46('0x4'),'attributes':['id',_0x8b46('0x2'),'interval']}]},'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 9151dfa..d34bd3a 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 _0x7708=['update','AddTagsToMailInteraction','../client'];(function(_0x2264d8,_0x510b2b){var _0x315069=function(_0x45033e){while(--_0x45033e){_0x2264d8['push'](_0x2264d8['shift']());}};_0x315069(++_0x510b2b);}(_0x7708,0x188));var _0x8770=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7708[_0x46aff0];return _0x9d78cf;};'use strict';var client=require(_0x8770('0x0'));exports[_0x8770('0x1')]=function(_0x5ce108,_0x141ddf){return client['Request']('UpdateMailInteraction',{'body':_0x141ddf,'options':{'where':{'id':_0x5ce108}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x182d52,_0x1a796d){return client['Request'](_0x8770('0x2'),{'body':_0x1a796d,'options':{'where':{'id':_0x182d52}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x14a0=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x36ab8a,_0x549f9f){var _0x30e727=function(_0x3a95de){while(--_0x3a95de){_0x36ab8a['push'](_0x36ab8a['shift']());}};_0x30e727(++_0x549f9f);}(_0x14a0,0x8e));var _0x014a=function(_0x5a284a,_0x37acc7){_0x5a284a=_0x5a284a-0x0;var _0x352cd1=_0x14a0[_0x5a284a];return _0x352cd1;};'use strict';var client=require('../client');exports[_0x014a('0x0')]=function(_0x451138,_0x4144ed){return client[_0x014a('0x1')](_0x014a('0x2'),{'body':_0x4144ed,'options':{'where':{'id':_0x451138}},'log':_0x014a('0x3')});};exports[_0x014a('0x4')]=function(_0x521a59,_0x57a522){return client[_0x014a('0x1')](_0x014a('0x5'),{'body':_0x57a522,'options':{'where':{'id':_0x521a59}},'log':_0x014a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 5a4d0bd..b18d032 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 _0xb4d2=['Request','CreateMailMessage','../client','create'];(function(_0x410add,_0x625706){var _0xa7a4ec=function(_0x18a535){while(--_0x18a535){_0x410add['push'](_0x410add['shift']());}};_0xa7a4ec(++_0x625706);}(_0xb4d2,0x1e6));var _0x2b4d=function(_0x46063d,_0x3239ec){_0x46063d=_0x46063d-0x0;var _0x4fff0c=_0xb4d2[_0x46063d];return _0x4fff0c;};'use strict';var client=require(_0x2b4d('0x0'));exports[_0x2b4d('0x1')]=function(_0x49ee7f){return client[_0x2b4d('0x2')](_0x2b4d('0x3'),{'body':_0x49ee7f,'log':'createMailMessage'});}; \ No newline at end of file +var _0x0a32=['CreateMailMessage','createMailMessage','Request'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x0a32,0xc5));var _0x20a3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0a32[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports['create']=function(_0x52f3f4){return client[_0x20a3('0x0')](_0x20a3('0x1'),{'body':_0x52f3f4,'log':_0x20a3('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f24aab0..bc94369 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 _0x9fe4=['online','mailPause','getMailQueues','name','timeout','Agents'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x9fe4,0x164));var _0x49fe=function(_0xff7f46,_0x626af7){_0xff7f46=_0xff7f46-0x0;var _0x10edac=_0x9fe4[_0xff7f46];return _0x10edac;};'use strict';var client=require('../client');exports[_0x49fe('0x0')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x49fe('0x1'),_0x49fe('0x2'),'strategy'],'include':[{'model':'User','as':_0x49fe('0x3'),'attributes':['id','name',_0x49fe('0x4'),_0x49fe('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xe3e7=['Request','GetMailQueue','name','online','mailPause','../client','getMailQueues'];(function(_0x47fbd5,_0x2e11f8){var _0x3800c2=function(_0x5a9af8){while(--_0x5a9af8){_0x47fbd5['push'](_0x47fbd5['shift']());}};_0x3800c2(++_0x2e11f8);}(_0xe3e7,0x186));var _0x7e3e=function(_0x3e05cb,_0x2ad2db){_0x3e05cb=_0x3e05cb-0x0;var _0x4afdf5=_0xe3e7[_0x3e05cb];return _0x4afdf5;};'use strict';var client=require(_0x7e3e('0x0'));exports[_0x7e3e('0x1')]=function(){return function(){return client[_0x7e3e('0x2')](_0x7e3e('0x3'),{'options':{'raw':![],'attributes':['id',_0x7e3e('0x4'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7e3e('0x4'),_0x7e3e('0x5'),_0x7e3e('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 11cec4e..05f0660 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 _0xcb92=['UpdateMailQueueReport','DESC','Request','CreateMailQueueReport'];(function(_0x3148b6,_0x3ead64){var _0x247af0=function(_0x12f528){while(--_0x12f528){_0x3148b6['push'](_0x3148b6['shift']());}};_0x247af0(++_0x3ead64);}(_0xcb92,0x1c2));var _0x2cb9=function(_0x2a8426,_0x2ea1ac){_0x2a8426=_0x2a8426-0x0;var _0x56496c=_0xcb92[_0x2a8426];return _0x56496c;};'use strict';var client=require('../client');exports['create']=function(_0x592935){return client[_0x2cb9('0x0')]('CreateMailQueueReport',{'body':_0x592935,'log':_0x2cb9('0x1')});};exports['update']=function(_0x35ea43,_0x1dada8){return client[_0x2cb9('0x0')](_0x2cb9('0x2'),{'body':_0x1dada8,'options':{'where':{'uniqueid':_0x35ea43},'order':[['id',_0x2cb9('0x3')]],'limit':0x1},'log':_0x2cb9('0x2')});}; \ No newline at end of file +var _0xaefa=['create','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xaefa,0xe4));var _0xaaef=function(_0x46632c,_0x184d6f){_0x46632c=_0x46632c-0x0;var _0xbc6b61=_0xaefa[_0x46632c];return _0xbc6b61;};'use strict';var client=require('../client');exports[_0xaaef('0x0')]=function(_0x53f472){return client['Request'](_0xaaef('0x1'),{'body':_0x53f472,'log':_0xaaef('0x1')});};exports[_0xaaef('0x2')]=function(_0x50ae23,_0x45f977){return client['Request'](_0xaaef('0x3'),{'body':_0x45f977,'options':{'where':{'uniqueid':_0x50ae23},'order':[['id','DESC']],'limit':0x1},'log':_0xaaef('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 09bc7a0..e4ee692 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 _0x38d0=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x5f15a3,_0x504b4b){var _0x3afa59=function(_0x21d4ed){while(--_0x21d4ed){_0x5f15a3['push'](_0x5f15a3['shift']());}};_0x3afa59(++_0x504b4b);}(_0x38d0,0xc0));var _0x038d=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x38d0[_0xaa1b3e];return _0x454d7d;};'use strict';var client=require(_0x038d('0x0'));exports[_0x038d('0x1')]=function(_0x122238,_0x3c2508){return client[_0x038d('0x2')](_0x038d('0x3'),{'body':_0x3c2508,'options':{'where':{'id':_0x122238}},'log':_0x038d('0x4')});};exports[_0x038d('0x5')]=function(_0x28dc4c,_0x52a803){return client[_0x038d('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x52a803,'options':{'where':{'id':_0x28dc4c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2435=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x1603ee,_0x4270fa){var _0x5c77eb=function(_0x31299e){while(--_0x31299e){_0x1603ee['push'](_0x1603ee['shift']());}};_0x5c77eb(++_0x4270fa);}(_0x2435,0xd5));var _0x5243=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x2435[_0x2283dc];return _0x16db90;};'use strict';var client=require(_0x5243('0x0'));exports[_0x5243('0x1')]=function(_0x275487,_0xbfb6ec){return client[_0x5243('0x2')](_0x5243('0x3'),{'body':_0xbfb6ec,'options':{'where':{'id':_0x275487}},'log':_0x5243('0x4')});};exports[_0x5243('0x5')]=function(_0x3eea76,_0x34895d){return client[_0x5243('0x2')](_0x5243('0x6'),{'body':_0x34895d,'options':{'where':{'id':_0x3eea76}},'log':_0x5243('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 3a1ac99..036a04a 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 _0xdfcc=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x11db48,_0x363415){var _0x2cc224=function(_0x3ea173){while(--_0x3ea173){_0x11db48['push'](_0x11db48['shift']());}};_0x2cc224(++_0x363415);}(_0xdfcc,0x130));var _0xcdfc=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0xdfcc[_0x412c8f];return _0x27c005;};'use strict';var client=require(_0xcdfc('0x0'));exports[_0xcdfc('0x1')]=function(_0x2faae9){return client[_0xcdfc('0x2')](_0xcdfc('0x3'),{'body':_0x2faae9,'log':_0xcdfc('0x4')});}; \ No newline at end of file +var _0x7bda=['Request','create'];(function(_0x36617c,_0x52efd9){var _0x5e1c80=function(_0x18309d){while(--_0x18309d){_0x36617c['push'](_0x36617c['shift']());}};_0x5e1c80(++_0x52efd9);}(_0x7bda,0xa9));var _0xa7bd=function(_0x2e0d9a,_0x565ab0){_0x2e0d9a=_0x2e0d9a-0x0;var _0x3e984e=_0x7bda[_0x2e0d9a];return _0x3e984e;};'use strict';var client=require('../client');exports[_0xa7bd('0x0')]=function(_0x336eed){return client[_0xa7bd('0x1')]('CreateOpenchannelMessage',{'body':_0x336eed,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 549e1fe..e309868 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 _0xc31f=['timeout','User','Agents','name','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x48cc05,_0x99c831){var _0x5aa91f=function(_0x64b452){while(--_0x64b452){_0x48cc05['push'](_0x48cc05['shift']());}};_0x5aa91f(++_0x99c831);}(_0xc31f,0x146));var _0xfc31=function(_0x3eb760,_0x5d2c18){_0x3eb760=_0x3eb760-0x0;var _0x1b0e0a=_0xc31f[_0x3eb760];return _0x1b0e0a;};'use strict';var client=require(_0xfc31('0x0'));exports[_0xfc31('0x1')]=function(){return function(){return client[_0xfc31('0x2')](_0xfc31('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xfc31('0x4'),'strategy'],'include':[{'model':_0xfc31('0x5'),'as':_0xfc31('0x6'),'attributes':['id',_0xfc31('0x7'),_0xfc31('0x8'),_0xfc31('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x8e8c=['User','Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0xd1b38d,_0x4c3eba){var _0x146eb4=function(_0x2c4c84){while(--_0x2c4c84){_0xd1b38d['push'](_0xd1b38d['shift']());}};_0x146eb4(++_0x4c3eba);}(_0x8e8c,0x14c));var _0xc8e8=function(_0x4c76ad,_0x24bdab){_0x4c76ad=_0x4c76ad-0x0;var _0xde0a18=_0x8e8c[_0x4c76ad];return _0xde0a18;};'use strict';var client=require('../client');exports[_0xc8e8('0x0')]=function(){return function(){return client[_0xc8e8('0x1')](_0xc8e8('0x2'),{'options':{'raw':![],'attributes':['id',_0xc8e8('0x3'),'timeout','strategy'],'include':[{'model':_0xc8e8('0x4'),'as':_0xc8e8('0x5'),'attributes':['id',_0xc8e8('0x3'),_0xc8e8('0x6'),_0xc8e8('0x7')]}]},'log':_0xc8e8('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 62d0ee1..82a3293 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 _0xceab=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','Request'];(function(_0x45330c,_0xb37d05){var _0x26e823=function(_0xc1ac7e){while(--_0xc1ac7e){_0x45330c['push'](_0x45330c['shift']());}};_0x26e823(++_0xb37d05);}(_0xceab,0x106));var _0xbcea=function(_0x3c067e,_0x2270b1){_0x3c067e=_0x3c067e-0x0;var _0x57d340=_0xceab[_0x3c067e];return _0x57d340;};'use strict';var client=require(_0xbcea('0x0'));exports['create']=function(_0x7cd40){return client[_0xbcea('0x1')]('CreateOpenchannelQueueReport',{'body':_0x7cd40,'log':_0xbcea('0x2')});};exports[_0xbcea('0x3')]=function(_0x5cecf2,_0xd4daa4){return client[_0xbcea('0x1')]('UpdateOpenchannelQueueReport',{'body':_0xd4daa4,'options':{'where':{'uniqueid':_0x5cecf2},'order':[['id',_0xbcea('0x4')]],'limit':0x1},'log':_0xbcea('0x5')});}; \ No newline at end of file +var _0x17b9=['DESC','../client','create','CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport'];(function(_0x469498,_0x4ebfc3){var _0x31dd36=function(_0x72c068){while(--_0x72c068){_0x469498['push'](_0x469498['shift']());}};_0x31dd36(++_0x4ebfc3);}(_0x17b9,0x8b));var _0x917b=function(_0x213c54,_0x27d648){_0x213c54=_0x213c54-0x0;var _0x493268=_0x17b9[_0x213c54];return _0x493268;};'use strict';var client=require(_0x917b('0x0'));exports[_0x917b('0x1')]=function(_0x493d75){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x493d75,'log':_0x917b('0x2')});};exports['update']=function(_0x58a3d2,_0x24215a){return client[_0x917b('0x3')](_0x917b('0x4'),{'body':_0x24215a,'options':{'where':{'uniqueid':_0x58a3d2},'order':[['id',_0x917b('0x5')]],'limit':0x1},'log':_0x917b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9aec0a0..712e83c 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 _0x4491=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client'];(function(_0x4d6e96,_0x25dc9d){var _0x4d17dd=function(_0x3cec1f){while(--_0x3cec1f){_0x4d6e96['push'](_0x4d6e96['shift']());}};_0x4d17dd(++_0x25dc9d);}(_0x4491,0x1bb));var _0x1449=function(_0x1f7bc7,_0x5a662d){_0x1f7bc7=_0x1f7bc7-0x0;var _0x165214=_0x4491[_0x1f7bc7];return _0x165214;};'use strict';var client=require(_0x1449('0x0'));exports['update']=function(_0x4257f6,_0x47cccd){return client[_0x1449('0x1')](_0x1449('0x2'),{'body':_0x47cccd,'options':{'where':{'id':_0x4257f6}},'log':_0x1449('0x3')});};exports[_0x1449('0x4')]=function(_0x1ff47f,_0x1b2870){return client['Request'](_0x1449('0x5'),{'body':_0x1b2870,'options':{'where':{'id':_0x1ff47f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x0c2b=['Request','updateSmsInteraction','addTags','../client','update'];(function(_0x393e17,_0x19a0ad){var _0x18e778=function(_0x57aacf){while(--_0x57aacf){_0x393e17['push'](_0x393e17['shift']());}};_0x18e778(++_0x19a0ad);}(_0x0c2b,0x134));var _0xb0c2=function(_0x3d8162,_0x56921e){_0x3d8162=_0x3d8162-0x0;var _0xcfdabe=_0x0c2b[_0x3d8162];return _0xcfdabe;};'use strict';var client=require(_0xb0c2('0x0'));exports[_0xb0c2('0x1')]=function(_0x4fbd93,_0x5e4432){return client[_0xb0c2('0x2')]('UpdateSmsInteraction',{'body':_0x5e4432,'options':{'where':{'id':_0x4fbd93}},'log':_0xb0c2('0x3')});};exports[_0xb0c2('0x4')]=function(_0x44eec2,_0x1c2f6f){return client[_0xb0c2('0x2')]('AddTagsToSmsInteraction',{'body':_0x1c2f6f,'options':{'where':{'id':_0x44eec2}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4b63c39..4db8c49 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 _0xa37d=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x47f910,_0x137198){var _0x5b8135=function(_0x5cb321){while(--_0x5cb321){_0x47f910['push'](_0x47f910['shift']());}};_0x5b8135(++_0x137198);}(_0xa37d,0x158));var _0xda37=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0xa37d[_0x5275b8];return _0x568a9b;};'use strict';var client=require('../client');exports[_0xda37('0x0')]=function(_0x4f56a0){return client[_0xda37('0x1')](_0xda37('0x2'),{'body':_0x4f56a0,'log':_0xda37('0x3')});}; \ No newline at end of file +var _0x4faf=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x583277,_0x5ca82d){var _0x1baf2c=function(_0x11e6b1){while(--_0x11e6b1){_0x583277['push'](_0x583277['shift']());}};_0x1baf2c(++_0x5ca82d);}(_0x4faf,0x1cd));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf4fa('0x0'));exports['create']=function(_0x2945f6){return client[_0xf4fa('0x1')](_0xf4fa('0x2'),{'body':_0x2945f6,'log':_0xf4fa('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 52d0294..5d97da8 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x500041,_0x544746){var _0x302a21=function(_0x2f15cd){while(--_0x2f15cd){_0x500041['push'](_0x500041['shift']());}};_0x302a21(++_0x544746);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0xcb91[_0x2f3794];return _0x1c9fbe;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4ed07c,_0x2e1772){var _0x23c725=function(_0x542501){while(--_0x542501){_0x4ed07c['push'](_0x4ed07c['shift']());}};_0x23c725(++_0x2e1772);}(_0xe706,0xa3));var _0x6e70=function(_0x1866ea,_0x547489){_0x1866ea=_0x1866ea-0x0;var _0x34f90a=_0xe706[_0x1866ea];return _0x34f90a;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1fdd4aa..6242f34 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x59ad9d,_0x2e7e78){var _0x569738=function(_0x244ffe){while(--_0x244ffe){_0x59ad9d['push'](_0x59ad9d['shift']());}};_0x569738(++_0x2e7e78);}(_0x34e8,0x12c));var _0x834e=function(_0x37bbc2,_0x554a79){_0x37bbc2=_0x37bbc2-0x0;var _0x95a7a3=_0x34e8[_0x37bbc2];return _0x95a7a3;};'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 +var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xedd9,0xfc));var _0x9edd=function(_0x54f207,_0x49343f){_0x54f207=_0x54f207-0x0;var _0x4435c5=_0xedd9[_0x54f207];return _0x4435c5;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 473ce1b..75dd947 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(_0x179dd4,_0x14bcf4){var _0x594de6=function(_0x28be12){while(--_0x28be12){_0x179dd4['push'](_0x179dd4['shift']());}};_0x594de6(++_0x14bcf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0xcac160,_0x8521b4){var _0x4b8e51=function(_0x2705e3){while(--_0x2705e3){_0xcac160['push'](_0xcac160['shift']());}};_0x4b8e51(++_0x8521b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 7518164..a1447b9 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 _0x1261=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','update'];(function(_0x1ea0da,_0x18596b){var _0x32bf80=function(_0x7e039f){while(--_0x7e039f){_0x1ea0da['push'](_0x1ea0da['shift']());}};_0x32bf80(++_0x18596b);}(_0x1261,0x144));var _0x1126=function(_0x1e9287,_0x37f584){_0x1e9287=_0x1e9287-0x0;var _0x44342e=_0x1261[_0x1e9287];return _0x44342e;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(_0x26c6a0,_0x3f6969){return client[_0x1126('0x1')](_0x1126('0x2'),{'body':_0x3f6969,'options':{'where':{'id':_0x26c6a0}},'log':_0x1126('0x3')});};exports[_0x1126('0x4')]=function(_0x4245ca,_0x21a480){return client[_0x1126('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x21a480,'options':{'where':{'id':_0x4245ca}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x3837=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0x3837,0x1d1));var _0x7383=function(_0x3ad721,_0x4b7de5){_0x3ad721=_0x3ad721-0x0;var _0x52b183=_0x3837[_0x3ad721];return _0x52b183;};'use strict';var client=require('../client');exports[_0x7383('0x0')]=function(_0x54e81e,_0xccf9d4){return client['Request'](_0x7383('0x1'),{'body':_0xccf9d4,'options':{'where':{'id':_0x54e81e}},'log':_0x7383('0x2')});};exports[_0x7383('0x3')]=function(_0x227ab2,_0xf57468){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xf57468,'options':{'where':{'id':_0x227ab2}},'log':_0x7383('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 94a0ac8..dc1d48e 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 _0x61a8=['../client','create','Request','CreateWhatsappMessage'];(function(_0x28006d,_0x892ccd){var _0x25a2bc=function(_0x1e0de3){while(--_0x1e0de3){_0x28006d['push'](_0x28006d['shift']());}};_0x25a2bc(++_0x892ccd);}(_0x61a8,0x1e8));var _0x861a=function(_0x4a1327,_0x3642ab){_0x4a1327=_0x4a1327-0x0;var _0x2fcd03=_0x61a8[_0x4a1327];return _0x2fcd03;};'use strict';var client=require(_0x861a('0x0'));exports[_0x861a('0x1')]=function(_0x34c892){return client[_0x861a('0x2')](_0x861a('0x3'),{'body':_0x34c892,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x95aa=['create','Request','createWhatsappMessage','../client'];(function(_0x3381d4,_0x3feab9){var _0x147931=function(_0x41cefb){while(--_0x41cefb){_0x3381d4['push'](_0x3381d4['shift']());}};_0x147931(++_0x3feab9);}(_0x95aa,0x1af));var _0xa95a=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x95aa[_0x3e7e96];return _0x13f6f0;};'use strict';var client=require(_0xa95a('0x0'));exports[_0xa95a('0x1')]=function(_0x5975e7){return client[_0xa95a('0x2')]('CreateWhatsappMessage',{'body':_0x5975e7,'log':_0xa95a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 5c888a9..183e57b 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 _0x161d=['online','getWhatsappQueues','name','timeout','strategy','User','Agents'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x161d,0x7f));var _0xd161=function(_0x3e31be,_0x51f3ae){_0x3e31be=_0x3e31be-0x0;var _0x130d15=_0x161d[_0x3e31be];return _0x130d15;};'use strict';var client=require('../client');exports[_0xd161('0x0')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xd161('0x1'),_0xd161('0x2'),_0xd161('0x3')],'include':[{'model':_0xd161('0x4'),'as':_0xd161('0x5'),'attributes':['id',_0xd161('0x1'),_0xd161('0x6'),'whatsappPause']}]},'log':_0xd161('0x0')});};}; \ No newline at end of file +var _0x3724=['timeout','strategy','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x3724,0x101));var _0x4372=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0x3724[_0x1c79a7];return _0x4de69f;};'use strict';var client=require(_0x4372('0x0'));exports[_0x4372('0x1')]=function(){return function(){return client['Request'](_0x4372('0x2'),{'options':{'raw':![],'attributes':['id',_0x4372('0x3'),_0x4372('0x4'),_0x4372('0x5')],'include':[{'model':'User','as':_0x4372('0x6'),'attributes':['id',_0x4372('0x3'),_0x4372('0x7'),_0x4372('0x8')]}]},'log':_0x4372('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 24928cc..3f017ba 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 _0x1709=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x8a0dd1,_0x1e8102){var _0x4e464d=function(_0x34c5e2){while(--_0x34c5e2){_0x8a0dd1['push'](_0x8a0dd1['shift']());}};_0x4e464d(++_0x1e8102);}(_0x1709,0x199));var _0x9170=function(_0x83f529,_0x3d55d7){_0x83f529=_0x83f529-0x0;var _0x4383b8=_0x1709[_0x83f529];return _0x4383b8;};'use strict';var client=require(_0x9170('0x0'));exports[_0x9170('0x1')]=function(_0x3c2270){return client[_0x9170('0x2')](_0x9170('0x3'),{'body':_0x3c2270,'log':_0x9170('0x3')});};exports[_0x9170('0x4')]=function(_0x1a99d5,_0x3927b6){return client[_0x9170('0x2')](_0x9170('0x5'),{'body':_0x3927b6,'options':{'where':{'uniqueid':_0x1a99d5},'order':[['id',_0x9170('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x66c6=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x5c3704,_0x156da7){var _0x3767d9=function(_0x59af0b){while(--_0x59af0b){_0x5c3704['push'](_0x5c3704['shift']());}};_0x3767d9(++_0x156da7);}(_0x66c6,0x13a));var _0x666c=function(_0x1da7b,_0x3ce5ec){_0x1da7b=_0x1da7b-0x0;var _0x4bf8e3=_0x66c6[_0x1da7b];return _0x4bf8e3;};'use strict';var client=require(_0x666c('0x0'));exports[_0x666c('0x1')]=function(_0x577420){return client[_0x666c('0x2')](_0x666c('0x3'),{'body':_0x577420,'log':_0x666c('0x3')});};exports[_0x666c('0x4')]=function(_0x3b227e,_0x396029){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x396029,'options':{'where':{'uniqueid':_0x3b227e},'order':[['id',_0x666c('0x5')]],'limit':0x1},'log':_0x666c('0x6')});}; \ 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 5d4309d..d2c1179 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 _0xd1d3=['message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','complete','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','stack','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd1d3,0x7b));var _0x3d1d=function(_0x3bd9c2,_0x5c75f0){_0x3bd9c2=_0x3bd9c2-0x0;var _0x518b4c=_0xd1d3[_0x3bd9c2];return _0x518b4c;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x3d1d('0x0'))(_0x3d1d('0x1'));var strategy=require(_0x3d1d('0x2'));var queue=schema({'name':{'type':_0x3d1d('0x3'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x3d1d('0x4')}});function writeLog(_0x40b5b3,_0x574fc6,_0x496dcd){return logger[_0x3d1d('0x5')](util[_0x3d1d('0x6')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x40b5b3,_0x574fc6[_0x3d1d('0x7')],_0x496dcd));}function handleFindAgent(_0x1ba8a1){return function(_0x1a553e){return _0x1a553e[_0x3d1d('0x7')]['toLowerCase']()===_0x1ba8a1[_0x3d1d('0x8')]();};}exports[_0x3d1d('0x9')]=function(_0x38fd1,_0x3f8858,_0x2583e0,_0x45d5e1){return function(_0x34b9b4){try{var _0x4b9217={'name':_0x3f8858[0x0],'timeout':_0x3f8858[0x1]};var _0x173e84=queue[_0x3d1d('0xa')](_0x4b9217,{'typecast':!![]});if(_0x173e84[_0x3d1d('0xb')]){logger['error'](_0x3d1d('0xc'),_0x38fd1,_['map'](_0x173e84,_0x3d1d('0xd'))[_0x3d1d('0xe')](',\x20'));_0x34b9b4[_0x3d1d('0xf')]();}else{var _0xd24427=_[_0x3d1d('0x10')](_0x2583e0[_0x3d1d('0x11')],handleFindAgent(_0x4b9217[_0x3d1d('0x7')]));if(_0xd24427){var _0x31506b=(_0x4b9217[_0x3d1d('0x12')]||0xa)*0x3e8;var _0x3fb874,_0x24cfc5;var _0x251acb=seqqueue[_0x3d1d('0x13')](_0x31506b);_0x251acb['id']=_0x38fd1;_0x251acb[_0x3d1d('0x14')]=_0x31506b;_0x251acb[_0x3d1d('0x15')]=_0x45d5e1[_0x3d1d('0x15')];writeLog(_0x38fd1,_0xd24427,util[_0x3d1d('0x6')](_0x3d1d('0x16'),_0x31506b));_0x2583e0[_0x3d1d('0x17')][_0x38fd1]['on'](_0x3d1d('0x18'),function(){logger[_0x3d1d('0x5')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x38fd1);clearTimeout(_0x24cfc5);_0x24cfc5=undefined;_0x251acb['close']();if(_0x2583e0[_0x3d1d('0x17')][_0x38fd1]){delete _0x2583e0['rules'][_0x38fd1];}_0x34b9b4['stop']();});_0x2583e0[_0x3d1d('0x17')][_0x38fd1]['on'](_0x3d1d('0x19'),function(){if(_0x2583e0['rules'][_0x38fd1]){delete _0x2583e0[_0x3d1d('0x17')][_0x38fd1];}});_0x24cfc5=setTimeout(function(){logger[_0x3d1d('0x5')]('[%s][AGENT]\x20ROUTING\x20END',_0x38fd1);clearTimeout(_0x24cfc5);_0x251acb[_0x3d1d('0x1a')]();_0x34b9b4[_0x3d1d('0x1b')]();},_0x31506b);strategy[_0x3d1d('0x1c')](_0x251acb,_0xd24427,_0x2583e0,_0x45d5e1);}else{logger['error'](_0x3d1d('0x1d'),_0x38fd1,_0x4b9217[_0x3d1d('0x7')]);_0x34b9b4[_0x3d1d('0xf')]();}}}catch(_0x16cbd1){console[_0x3d1d('0x1e')](_0x16cbd1);logger[_0x3d1d('0x1f')](_0x3d1d('0x20'),_0x38fd1,_0x16cbd1[_0x3d1d('0x21')]);_0x34b9b4['stop']();}};}; \ No newline at end of file +var _0xe64b=['number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','message','join','find','agents','createQueue','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','util','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xe64b,0x14f));var _0xbe64=function(_0x2ab46c,_0x3150a1){_0x2ab46c=_0x2ab46c-0x0;var _0xfc67cf=_0xe64b[_0x2ab46c];return _0xfc67cf;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xbe64('0x0'));var seqqueue=require('seq-queue');var logger=require(_0xbe64('0x1'))(_0xbe64('0x2'));var strategy=require(_0xbe64('0x3'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xbe64('0x4')},'timeout':{'type':_0xbe64('0x5'),'message':_0xbe64('0x6')}});function writeLog(_0x5b687e,_0x2cd494,_0x5ece0e){return logger['info'](util[_0xbe64('0x7')](_0xbe64('0x8'),_0x5b687e,_0x2cd494[_0xbe64('0x9')],_0x5ece0e));}function handleFindAgent(_0x4240bc){return function(_0x511ede){return _0x511ede[_0xbe64('0x9')]['toLowerCase']()===_0x4240bc[_0xbe64('0xa')]();};}exports[_0xbe64('0xb')]=function(_0x5e8e1c,_0x37d6d8,_0x39fe11,_0x5c0273){return function(_0x49d241){try{var _0x2c04bb={'name':_0x37d6d8[0x0],'timeout':_0x37d6d8[0x1]};var _0x4e708a=queue[_0xbe64('0xc')](_0x2c04bb,{'typecast':!![]});if(_0x4e708a[_0xbe64('0xd')]){logger[_0xbe64('0xe')](_0xbe64('0xf'),_0x5e8e1c,_['map'](_0x4e708a,_0xbe64('0x10'))[_0xbe64('0x11')](',\x20'));_0x49d241['stop']();}else{var _0x5425da=_[_0xbe64('0x12')](_0x39fe11[_0xbe64('0x13')],handleFindAgent(_0x2c04bb[_0xbe64('0x9')]));if(_0x5425da){var _0x184f28=(_0x2c04bb['timeout']||0xa)*0x3e8;var _0x58b962,_0x32eb46;var _0x235e7e=seqqueue[_0xbe64('0x14')](_0x184f28);_0x235e7e['id']=_0x5e8e1c;_0x235e7e['atimeout']=_0x184f28;_0x235e7e[_0xbe64('0x15')]=_0x5c0273['channel'];writeLog(_0x5e8e1c,_0x5425da,util[_0xbe64('0x7')](_0xbe64('0x16'),_0x184f28));_0x39fe11[_0xbe64('0x17')][_0x5e8e1c]['on'](_0xbe64('0x18'),function(){logger[_0xbe64('0x19')](_0xbe64('0x1a'),_0x5e8e1c);clearTimeout(_0x32eb46);_0x32eb46=undefined;_0x235e7e[_0xbe64('0x1b')]();if(_0x39fe11[_0xbe64('0x17')][_0x5e8e1c]){delete _0x39fe11[_0xbe64('0x17')][_0x5e8e1c];}_0x49d241[_0xbe64('0x1c')]();});_0x39fe11[_0xbe64('0x17')][_0x5e8e1c]['on'](_0xbe64('0x1d'),function(){if(_0x39fe11[_0xbe64('0x17')][_0x5e8e1c]){delete _0x39fe11['rules'][_0x5e8e1c];}});_0x32eb46=setTimeout(function(){logger[_0xbe64('0x19')](_0xbe64('0x1e'),_0x5e8e1c);clearTimeout(_0x32eb46);_0x235e7e[_0xbe64('0x1b')]();_0x49d241[_0xbe64('0x1f')]();},_0x184f28);strategy['agent'](_0x235e7e,_0x5425da,_0x39fe11,_0x5c0273);}else{logger[_0xbe64('0xe')](_0xbe64('0x20'),_0x5e8e1c,_0x2c04bb[_0xbe64('0x9')]);_0x49d241[_0xbe64('0x1c')]();}}}catch(_0x124ce8){console['log'](_0x124ce8);logger['error']('[%s][QUEUE]\x20%s',_0x5e8e1c,_0x124ce8[_0xbe64('0x21')]);_0x49d241[_0xbe64('0x1c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 55b8d44..8ee91e9 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 _0xcfb9=['body','stringify','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','sms','phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','getMustacheRender','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','error','message'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xcfb9,0x65));var _0x9cfb=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xcfb9[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0x9cfb('0x0'));var moment=require(_0x9cfb('0x1'));var AWS=require(_0x9cfb('0x2'));var utils=require(_0x9cfb('0x3'));var logger=require(_0x9cfb('0x4'))(_0x9cfb('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9cfb('0x6')),'mailMessage':require(_0x9cfb('0x7')),'smsMessage':require(_0x9cfb('0x8')),'faxMessage':require(_0x9cfb('0x9')),'whatsappMessage':require(_0x9cfb('0xa'))};exports['consequence']=function(_0x4b126f,_0x4af799){return function(_0x585a34){try{if(!_[_0x9cfb('0xb')](this['interaction'][_0x9cfb('0xc')])){logger[_0x9cfb('0xd')](_0x9cfb('0xe'),_0x4b126f,_0x9cfb('0xf'));return _0x585a34[_0x9cfb('0x10')]();}var _0x3b341a={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9cfb('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9cfb('0x12')};if(this[_0x9cfb('0x13')]===_0x9cfb('0x14')||this[_0x9cfb('0x13')]==='whatsapp'){_0x3b341a[_0x9cfb('0x15')]=this[_0x9cfb('0x16')][_0x9cfb('0x15')];}var _0x427835=this['channel'];if(_0x427835==='chat'){_0x3b341a[_0x9cfb('0x17')]=this['account']['id'];}else{_0x3b341a[_[_0x9cfb('0x18')](_0x427835)+_0x9cfb('0x19')]=this[_0x9cfb('0x1a')]['id'];}_0x3b341a[_['upperFirst'](_0x427835)+_0x9cfb('0x1b')]=this[_0x9cfb('0x16')]['id'];if(this[_0x9cfb('0x16')][_0x9cfb('0x1c')]){var _0x5176b0=_0x4af799[0x4];if(!_['isEmpty'](_0x5176b0)){_0x3b341a['body']=utils[_0x9cfb('0x1d')](_0x5176b0,this);return rpc[_0x427835+'Message'][_0x9cfb('0x1e')](_0x3b341a)[_0x9cfb('0x1f')](function(_0x1787ec){logger[_0x9cfb('0xd')]('[%s][AMAZONLEX]\x20%s',_0x4b126f,_0x3b341a['body']);})[_0x9cfb('0x20')](function(_0xe3d13){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4b126f,JSON['stringify'](_0xe3d13));})[_0x9cfb('0x21')](function(){logger[_0x9cfb('0xd')](_0x9cfb('0x22'),_0x4b126f);_0x585a34[_0x9cfb('0x23')]();});}else{logger[_0x9cfb('0xd')](_0x9cfb('0x24'),_0x4b126f);_0x585a34[_0x9cfb('0x23')]();}}else{var _0x3b8e11=this;var _0x3e3ca3=new AWS[(_0x9cfb('0x25'))]({'accessKeyId':_0x4af799[0x0],'secretAccessKey':_0x4af799[0x1],'region':_0x4af799[0x2]});var _0x65b5a={'botAlias':_0x9cfb('0x26'),'botName':_0x4af799[0x3],'inputText':this['message']['body'],'userId':this['channel']+':'+this[_0x9cfb('0x16')]['id'][_0x9cfb('0x27')]()};_0x3e3ca3[_0x9cfb('0x28')](_0x65b5a,function(_0x67fd6f,_0x58bc84){if(_0x67fd6f){logger[_0x9cfb('0x29')](_0x9cfb('0xe'),_0x4b126f,_0x67fd6f[_0x9cfb('0x2a')]);_0x585a34[_0x9cfb('0x10')]();}else if(_0x58bc84&&_0x58bc84[_0x9cfb('0x2a')]){_0x3b8e11[_0x9cfb('0x2b')]['amazonlex']=_0x58bc84;_0x3b341a[_0x9cfb('0x2b')]=_0x58bc84['message'];_0x3b341a['providerName']='amazonlex';_0x3b341a['providerResponse']=JSON[_0x9cfb('0x2c')](_0x58bc84);return rpc[_0x427835+_0x9cfb('0x2d')][_0x9cfb('0x1e')](_0x3b341a)[_0x9cfb('0x1f')](function(_0x553dce){logger[_0x9cfb('0xd')](_0x9cfb('0xe'),_0x4b126f,_0x3b341a[_0x9cfb('0x2b')]);if(_0x58bc84[_0x9cfb('0x2e')]==_0x9cfb('0x2f')){_0x585a34[_0x9cfb('0x10')]();}else{_0x585a34[_0x9cfb('0x23')]();}})[_0x9cfb('0x20')](function(_0x2cbe0a){logger[_0x9cfb('0x29')](_0x9cfb('0xe'),_0x4b126f,JSON[_0x9cfb('0x2c')](_0x2cbe0a));_0x585a34[_0x9cfb('0x10')]();});}else{_0x585a34[_0x9cfb('0x10')]();}});}}catch(_0x4ca7ff){logger[_0x9cfb('0x29')](_0x9cfb('0xe'),_0x4b126f,JSON['stringify'](_0x4ca7ff));_0x585a34[_0x9cfb('0x23')]();}};}; \ No newline at end of file +var _0x3b6d=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','sms','whatsapp','channel','chat','account','upperFirst','created','body','getMustacheRender','Message','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','next','amazonlex','providerName','providerResponse','create','lodash','moment','./utils','../../../../config/logger','routing'];(function(_0x4b393c,_0x4a2293){var _0xfb036f=function(_0x3298e0){while(--_0x3298e0){_0x4b393c['push'](_0x4b393c['shift']());}};_0xfb036f(++_0x4a2293);}(_0x3b6d,0xd7));var _0xd3b6=function(_0x16e3f3,_0x59a3bf){_0x16e3f3=_0x16e3f3-0x0;var _0x18664c=_0x3b6d[_0x16e3f3];return _0x18664c;};'use strict';var _=require(_0xd3b6('0x0'));var moment=require(_0xd3b6('0x1'));var AWS=require('aws-sdk');var utils=require(_0xd3b6('0x2'));var logger=require(_0xd3b6('0x3'))(_0xd3b6('0x4'));var rpc={'chatMessage':require(_0xd3b6('0x5')),'openchannelMessage':require(_0xd3b6('0x6')),'mailMessage':require(_0xd3b6('0x7')),'smsMessage':require(_0xd3b6('0x8')),'faxMessage':require(_0xd3b6('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x3fb202,_0x4afb90){return function(_0x150d1e){try{if(!_[_0xd3b6('0xa')](this[_0xd3b6('0xb')][_0xd3b6('0xc')])){logger[_0xd3b6('0xd')](_0xd3b6('0xe'),_0x3fb202,_0xd3b6('0xf'));return _0x150d1e['next']();}var _0x369c6f={'ContactId':this[_0xd3b6('0x10')]['id'],'sentAt':moment()[_0xd3b6('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd3b6('0x12')};if(this['channel']===_0xd3b6('0x13')||this['channel']===_0xd3b6('0x14')){_0x369c6f['phone']=this['interaction']['phone'];}var _0x1adaae=this[_0xd3b6('0x15')];if(_0x1adaae===_0xd3b6('0x16')){_0x369c6f['ChatWebsiteId']=this[_0xd3b6('0x17')]['id'];}else{_0x369c6f[_[_0xd3b6('0x18')](_0x1adaae)+'AccountId']=this[_0xd3b6('0x17')]['id'];}_0x369c6f[_['upperFirst'](_0x1adaae)+'InteractionId']=this[_0xd3b6('0xb')]['id'];if(this[_0xd3b6('0xb')][_0xd3b6('0x19')]){var _0x3b14a7=_0x4afb90[0x4];if(!_['isEmpty'](_0x3b14a7)){_0x369c6f[_0xd3b6('0x1a')]=utils[_0xd3b6('0x1b')](_0x3b14a7,this);return rpc[_0x1adaae+_0xd3b6('0x1c')]['create'](_0x369c6f)[_0xd3b6('0x1d')](function(_0x5386a5){logger['info'](_0xd3b6('0xe'),_0x3fb202,_0x369c6f['body']);})[_0xd3b6('0x1e')](function(_0x1d3594){logger[_0xd3b6('0x1f')](_0xd3b6('0xe'),_0x3fb202,JSON[_0xd3b6('0x20')](_0x1d3594));})[_0xd3b6('0x21')](function(){logger[_0xd3b6('0xd')](_0xd3b6('0x22'),_0x3fb202);_0x150d1e[_0xd3b6('0x23')]();});}else{logger[_0xd3b6('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3fb202);_0x150d1e[_0xd3b6('0x23')]();}}else{var _0x32bbbe=this;var _0x90455a=new AWS[(_0xd3b6('0x24'))]({'accessKeyId':_0x4afb90[0x0],'secretAccessKey':_0x4afb90[0x1],'region':_0x4afb90[0x2]});var _0x438be3={'botAlias':'$LATEST','botName':_0x4afb90[0x3],'inputText':this[_0xd3b6('0x25')]['body'],'userId':this['channel']+':'+this[_0xd3b6('0xb')]['id'][_0xd3b6('0x26')]()};_0x90455a['postText'](_0x438be3,function(_0x3ef2a6,_0x22070b){if(_0x3ef2a6){logger[_0xd3b6('0x1f')](_0xd3b6('0xe'),_0x3fb202,_0x3ef2a6[_0xd3b6('0x25')]);_0x150d1e[_0xd3b6('0x27')]();}else if(_0x22070b&&_0x22070b['message']){_0x32bbbe[_0xd3b6('0x1a')][_0xd3b6('0x28')]=_0x22070b;_0x369c6f[_0xd3b6('0x1a')]=_0x22070b[_0xd3b6('0x25')];_0x369c6f[_0xd3b6('0x29')]=_0xd3b6('0x28');_0x369c6f[_0xd3b6('0x2a')]=JSON[_0xd3b6('0x20')](_0x22070b);return rpc[_0x1adaae+_0xd3b6('0x1c')][_0xd3b6('0x2b')](_0x369c6f)['then'](function(_0x5124c4){logger[_0xd3b6('0xd')](_0xd3b6('0xe'),_0x3fb202,_0x369c6f[_0xd3b6('0x1a')]);if(_0x22070b['dialogState']=='Failed'){_0x150d1e[_0xd3b6('0x27')]();}else{_0x150d1e['stop']();}})[_0xd3b6('0x1e')](function(_0x218ff6){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3fb202,JSON[_0xd3b6('0x20')](_0x218ff6));_0x150d1e[_0xd3b6('0x27')]();});}else{_0x150d1e[_0xd3b6('0x27')]();}});}}catch(_0x5a588c){logger[_0xd3b6('0x1f')](_0xd3b6('0xe'),_0x3fb202,JSON[_0xd3b6('0x20')](_0x5a588c));_0x150d1e[_0xd3b6('0x23')]();}};}; \ 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 a3f21c9..2558dd7 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 _0xa5c1=['auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','Re:','Re:\x20','chat','upperFirst','account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','messageId','html','','replace','','headers'];(function(_0x3adb8a,_0x4e8aac){var _0x156628=function(_0x55d394){while(--_0x55d394){_0x3adb8a['push'](_0x3adb8a['shift']());}};_0x156628(++_0x4e8aac);}(_0xa5c1,0x191));var _0x1a5c=function(_0x5c7432,_0x57bce4){_0x5c7432=_0x5c7432-0x0;var _0x12c060=_0xa5c1[_0x5c7432];return _0x12c060;};'use strict';var _=require(_0x1a5c('0x0'));var moment=require(_0x1a5c('0x1'));var utils=require(_0x1a5c('0x2'));var logger=require('../../../../config/logger')(_0x1a5c('0x3'));var rpc={'chatMessage':require(_0x1a5c('0x4')),'openchannelMessage':require(_0x1a5c('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1a5c('0x6')),'whatsappMessage':require(_0x1a5c('0x7')),'chatInteraction':require(_0x1a5c('0x8')),'openchannelInteraction':require(_0x1a5c('0x9')),'mailInteraction':require(_0x1a5c('0xa')),'smsInteraction':require(_0x1a5c('0xb')),'faxInteraction':require(_0x1a5c('0xc')),'whatsappInteraction':require(_0x1a5c('0xd'))};var mailRpc=require(_0x1a5c('0xe'));exports[_0x1a5c('0xf')]=function(_0x3b6756,_0x24fb1e,_0x58b449,_0x2e8701){return function(_0x570c64){try{var _0x354921=this[_0x1a5c('0x10')];if(_0x354921===_0x1a5c('0x11')&&_0x2e8701[_0x1a5c('0x12')][_0x1a5c('0x13')]){logger[_0x1a5c('0x14')](_0x1a5c('0x15'),_0x3b6756,_0x1a5c('0x16'));return _0x570c64[_0x1a5c('0x17')]();}if(_0x24fb1e[0x0]==='1'&&(_[_0x1a5c('0x18')](this[_0x1a5c('0x19')][_0x1a5c('0x1a')])||!this[_0x1a5c('0x19')][_0x1a5c('0x1a')])){logger[_0x1a5c('0x14')](_0x1a5c('0x15'),_0x3b6756,'Autoreply\x20already\x20sent');return _0x570c64['next']();}if(_0x24fb1e[0x0]==='2'&&this[_0x1a5c('0x19')][_0x1a5c('0x1b')]){logger[_0x1a5c('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3b6756,_0x1a5c('0x1c'));return _0x570c64[_0x1a5c('0x17')]();}var _0x5ad48b={'ContactId':this[_0x1a5c('0x1d')]['id'],'sentAt':moment()['format'](_0x1a5c('0x1e')),'direction':_0x1a5c('0x1f')};if(this[_0x1a5c('0x10')]===_0x1a5c('0x11')){_0x5ad48b[_0x1a5c('0x12')]=utils[_0x1a5c('0x20')](_0x24fb1e[0x2],this);}else{_0x5ad48b[_0x1a5c('0x12')]=utils[_0x1a5c('0x20')](_0x24fb1e[0x1],this);}if(this[_0x1a5c('0x21')]){_0x5ad48b['to']=this['message'][_0x1a5c('0x22')]||'';if(this['channel']===_0x1a5c('0x11')&&_0x24fb1e[0x1]==='1'){_0x5ad48b['cc']=this[_0x1a5c('0x21')]['cc']||'';}_0x5ad48b[_0x1a5c('0x22')]=this[_0x1a5c('0x21')]['to']||'';_0x5ad48b[_0x1a5c('0x23')]=this[_0x1a5c('0x21')][_0x1a5c('0x23')]||'';_0x5ad48b['read']=!![];if(this[_0x1a5c('0x21')][_0x1a5c('0x24')]){_0x5ad48b[_0x1a5c('0x24')]='';_0x5ad48b[_0x1a5c('0x24')]+=_['startsWith'](this[_0x1a5c('0x21')][_0x1a5c('0x24')],_0x1a5c('0x25'))?'':_0x1a5c('0x26');_0x5ad48b[_0x1a5c('0x24')]+=this[_0x1a5c('0x21')][_0x1a5c('0x24')];}}if(this[_0x1a5c('0x10')]===_0x1a5c('0x27')){_0x5ad48b['ChatWebsiteId']=this['account']['id'];}else{_0x5ad48b[_[_0x1a5c('0x28')](this['channel'])+'AccountId']=this[_0x1a5c('0x29')]['id'];}_0x5ad48b[_[_0x1a5c('0x28')](this['channel'])+_0x1a5c('0x2a')]=this[_0x1a5c('0x19')]['id'];var _0x5ebb0f=this[_0x1a5c('0x19')];if(rpc[this['channel']+_0x1a5c('0x2b')]){if(this[_0x1a5c('0x10')]===_0x1a5c('0x11')){var _0x41be4b={'tls':{'rejectUnauthorized':![]}};if(this[_0x1a5c('0x29')][_0x1a5c('0x2c')]['service']){_0x41be4b[_0x1a5c('0x2d')]=this[_0x1a5c('0x29')][_0x1a5c('0x2c')][_0x1a5c('0x2d')];}else{_0x41be4b[_0x1a5c('0x2e')]=this['account'][_0x1a5c('0x2c')][_0x1a5c('0x2e')];_0x41be4b[_0x1a5c('0x2f')]=this['account'][_0x1a5c('0x2c')][_0x1a5c('0x2f')];_0x41be4b[_0x1a5c('0x30')]=this[_0x1a5c('0x29')]['Smtp'][_0x1a5c('0x30')];}if(this['account'][_0x1a5c('0x2c')][_0x1a5c('0x31')]){_0x41be4b[_0x1a5c('0x32')]={'user':this['account'][_0x1a5c('0x2c')][_0x1a5c('0x33')],'pass':this[_0x1a5c('0x29')]['Smtp'][_0x1a5c('0x34')]};}_0x5ad48b['inReplyTo']=this[_0x1a5c('0x21')][_0x1a5c('0x35')];_0x5ad48b[_0x1a5c('0x36')]=_0x1a5c('0x37')+_[_0x1a5c('0x38')](_0x5ad48b[_0x1a5c('0x12')],_0x1a5c('0x39'),_0x1a5c('0x3a'))+_0x1a5c('0x3b');_0x5ad48b[_0x1a5c('0x3c')]={'Auto-Submitted':_0x1a5c('0x3d'),'X-Auto-Response-Suppress':'All','Precedence':_0x1a5c('0x3e')};return mailRpc['sendMailMessage'](_0x41be4b,_0x5ad48b)[_0x1a5c('0x3f')](function(_0x5068a0){logger[_0x1a5c('0x14')](_0x1a5c('0x40'),_0x3b6756);_0x5ad48b[_0x1a5c('0x35')]=_0x5068a0[_0x1a5c('0x21')][_0x1a5c('0x35')];return rpc[_0x354921+_0x1a5c('0x2b')][_0x1a5c('0x41')](_0x5ad48b);})[_0x1a5c('0x3f')](function(_0x1a7cfc){logger[_0x1a5c('0x14')]('[%s][AUTOREPLY]\x20%s',_0x3b6756,JSON[_0x1a5c('0x42')](_0x1a7cfc));})[_0x1a5c('0x43')](function(_0x5b9afa){logger[_0x1a5c('0x44')](_0x1a5c('0x45'),_0x3b6756,JSON[_0x1a5c('0x42')](_0x5b9afa));})[_0x1a5c('0x46')](function(){Promise[_0x1a5c('0x47')]()[_0x1a5c('0x3f')](function(){if(_0x24fb1e[0x0]!=='2'||_0x5ebb0f[_0x1a5c('0x1b')])return;return rpc[_0x354921+_0x1a5c('0x48')][_0x1a5c('0x49')](_0x5ebb0f['id'],{'autoreplyExecuted':!![]})[_0x1a5c('0x3f')](function(_0x30caa3){logger['info'](_0x1a5c('0x4a'),_0x3b6756,JSON['stringify'](_0x30caa3));})[_0x1a5c('0x43')](function(_0x55e4af){logger['error'](_0x1a5c('0x4b'),_0x3b6756,JSON[_0x1a5c('0x42')](_0x55e4af));});})[_0x1a5c('0x3f')](function(){_0x570c64['next']();});});}else{return rpc[this['channel']+_0x1a5c('0x2b')][_0x1a5c('0x41')](_0x5ad48b)[_0x1a5c('0x3f')](function(_0x11172f){logger[_0x1a5c('0x14')](_0x1a5c('0x15'),_0x3b6756,_0x5ad48b[_0x1a5c('0x12')]);})[_0x1a5c('0x43')](function(_0x4d4914){logger[_0x1a5c('0x44')](_0x1a5c('0x15'),_0x3b6756,JSON[_0x1a5c('0x42')](_0x4d4914));})[_0x1a5c('0x46')](function(){Promise[_0x1a5c('0x47')]()[_0x1a5c('0x3f')](function(){if(_0x24fb1e[0x0]!=='2'||_0x5ebb0f[_0x1a5c('0x1b')])return;return rpc[_0x354921+'Interaction']['update'](_0x5ebb0f['id'],{'autoreplyExecuted':!![]})[_0x1a5c('0x3f')](function(_0x57b3d7){logger['info'](_0x1a5c('0x4a'),_0x3b6756,JSON['stringify'](_0x57b3d7));})[_0x1a5c('0x43')](function(_0x895b21){logger['error'](_0x1a5c('0x4b'),_0x3b6756,JSON[_0x1a5c('0x42')](_0x895b21));});})['then'](function(){_0x570c64['next']();});});}}}catch(_0x42cc33){logger[_0x1a5c('0x44')](_0x1a5c('0x15'),_0x3b6756,JSON[_0x1a5c('0x42')](_0x42cc33));_0x570c64[_0x1a5c('0x4c')]();}};}; \ No newline at end of file +var _0x3c26=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','authentication','user','pass','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','resolve','update','error','create','finally','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat'];(function(_0x27ddfb,_0x2ae31f){var _0x3a3efd=function(_0x5c5385){while(--_0x5c5385){_0x27ddfb['push'](_0x27ddfb['shift']());}};_0x3a3efd(++_0x2ae31f);}(_0x3c26,0x73));var _0x63c2=function(_0x455748,_0x22f543){_0x455748=_0x455748-0x0;var _0x1a17b7=_0x3c26[_0x455748];return _0x1a17b7;};'use strict';var _=require(_0x63c2('0x0'));var moment=require(_0x63c2('0x1'));var utils=require(_0x63c2('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x63c2('0x3')),'openchannelMessage':require(_0x63c2('0x4')),'mailMessage':require(_0x63c2('0x5')),'smsMessage':require(_0x63c2('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x63c2('0x7')),'chatInteraction':require(_0x63c2('0x8')),'openchannelInteraction':require(_0x63c2('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x63c2('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x63c2('0xb'))};var mailRpc=require(_0x63c2('0xc'));exports[_0x63c2('0xd')]=function(_0x1d6049,_0x10c4ef,_0x36794e,_0x2ac86a){return function(_0x32355d){try{var _0x49db0c=this['channel'];if(_0x49db0c===_0x63c2('0xe')&&_0x2ac86a[_0x63c2('0xf')]['isAutoreply']){logger[_0x63c2('0x10')]('[%s][AUTOREPLY]\x20%s',_0x1d6049,_0x63c2('0x11'));return _0x32355d[_0x63c2('0x12')]();}if(_0x10c4ef[0x0]==='1'&&(_['isNil'](this[_0x63c2('0x13')]['created'])||!this[_0x63c2('0x13')][_0x63c2('0x14')])){logger[_0x63c2('0x10')](_0x63c2('0x15'),_0x1d6049,_0x63c2('0x16'));return _0x32355d[_0x63c2('0x12')]();}if(_0x10c4ef[0x0]==='2'&&this['interaction'][_0x63c2('0x17')]){logger[_0x63c2('0x10')](_0x63c2('0x18'),_0x1d6049,_0x63c2('0x19'));return _0x32355d[_0x63c2('0x12')]();}var _0x28ab89={'ContactId':this[_0x63c2('0x1a')]['id'],'sentAt':moment()[_0x63c2('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x63c2('0x1c')};if(this[_0x63c2('0x1d')]===_0x63c2('0xe')){_0x28ab89[_0x63c2('0xf')]=utils[_0x63c2('0x1e')](_0x10c4ef[0x2],this);}else{_0x28ab89[_0x63c2('0xf')]=utils[_0x63c2('0x1e')](_0x10c4ef[0x1],this);}if(this[_0x63c2('0x1f')]){_0x28ab89['to']=this[_0x63c2('0x1f')][_0x63c2('0x20')]||'';if(this[_0x63c2('0x1d')]===_0x63c2('0xe')&&_0x10c4ef[0x1]==='1'){_0x28ab89['cc']=this[_0x63c2('0x1f')]['cc']||'';}_0x28ab89[_0x63c2('0x20')]=this[_0x63c2('0x1f')]['to']||'';_0x28ab89['phone']=this[_0x63c2('0x1f')][_0x63c2('0x21')]||'';_0x28ab89[_0x63c2('0x22')]=!![];if(this[_0x63c2('0x1f')]['subject']){_0x28ab89[_0x63c2('0x23')]='';_0x28ab89[_0x63c2('0x23')]+=_[_0x63c2('0x24')](this[_0x63c2('0x1f')][_0x63c2('0x23')],_0x63c2('0x25'))?'':'Re:\x20';_0x28ab89[_0x63c2('0x23')]+=this['message'][_0x63c2('0x23')];}}if(this['channel']===_0x63c2('0x26')){_0x28ab89[_0x63c2('0x27')]=this[_0x63c2('0x28')]['id'];}else{_0x28ab89[_[_0x63c2('0x29')](this[_0x63c2('0x1d')])+_0x63c2('0x2a')]=this['account']['id'];}_0x28ab89[_['upperFirst'](this[_0x63c2('0x1d')])+_0x63c2('0x2b')]=this[_0x63c2('0x13')]['id'];var _0x56d2b2=this[_0x63c2('0x13')];if(rpc[this[_0x63c2('0x1d')]+_0x63c2('0x2c')]){if(this[_0x63c2('0x1d')]===_0x63c2('0xe')){var _0xb35892={'tls':{'rejectUnauthorized':![]}};if(this[_0x63c2('0x28')]['Smtp'][_0x63c2('0x2d')]){_0xb35892[_0x63c2('0x2d')]=this[_0x63c2('0x28')][_0x63c2('0x2e')][_0x63c2('0x2d')];}else{_0xb35892['host']=this['account'][_0x63c2('0x2e')][_0x63c2('0x2f')];_0xb35892[_0x63c2('0x30')]=this[_0x63c2('0x28')][_0x63c2('0x2e')]['port'];_0xb35892[_0x63c2('0x31')]=this[_0x63c2('0x28')][_0x63c2('0x2e')][_0x63c2('0x31')];}if(this[_0x63c2('0x28')][_0x63c2('0x2e')][_0x63c2('0x32')]){_0xb35892['auth']={'user':this[_0x63c2('0x28')]['Smtp'][_0x63c2('0x33')],'pass':this['account'][_0x63c2('0x2e')][_0x63c2('0x34')]};}_0x28ab89[_0x63c2('0x35')]=this['message'][_0x63c2('0x36')];_0x28ab89[_0x63c2('0x37')]=_0x63c2('0x38')+_[_0x63c2('0x39')](_0x28ab89['body'],']+(>|$)/g,''),'priorityTrue':_0x1f334d[0x1],'priorityFalse':_0x1f334d[0x2]};var _0x34c2a0=gotoif['validate'](_0x5b2155,{'typecast':!![]});if(_0x34c2a0[_0x385a('0xd')]){logger[_0x385a('0xe')](_0x385a('0xf'),_0x59cdc7,_[_0x385a('0x10')](_0x34c2a0,_0x385a('0x11'))[_0x385a('0x12')](',\x20'));_0x14ac4a[_0x385a('0x13')]();}else{try{var _0x40e73a=eval('('+_0x5b2155[_0x385a('0x14')]+')');var _0x555c1d=_0x40e73a?_0x5b2155[_0x385a('0x15')]:_0x5b2155[_0x385a('0x16')];logger[_0x385a('0x17')](_0x385a('0x18'),_0x59cdc7,_0x5b2155['condition'],_0x40e73a,_0x555c1d||_0x385a('0x19'));if(_0x555c1d){var _0x26ff83=_[_0x385a('0x1a')](_0x14ac4a[_0x385a('0x1b')](),{'p':_0x555c1d});if(_0x26ff83>=0x0){logger[_0x385a('0x17')](_0x385a('0x1c'),_0x59cdc7,_0x555c1d||_0x385a('0x19'),_0x26ff83);_0x14ac4a[_0x385a('0x19')](_0x26ff83);}else{logger[_0x385a('0x17')](_0x385a('0x1d'),_0x59cdc7,_0x555c1d||_0x385a('0x19'));_0x14ac4a[_0x385a('0x13')]();}}else{_0x14ac4a[_0x385a('0x19')]();}}catch(_0x66e10){logger[_0x385a('0xe')](_0x385a('0x1e'),_0x59cdc7,_0x66e10[_0x385a('0x11')]);_0x14ac4a[_0x385a('0x13')]();}}}catch(_0x3ba93b){logger[_0x385a('0xe')](_0x385a('0xf'),_0x59cdc7,JSON[_0x385a('0x1f')](_0x3ba93b));_0x14ac4a[_0x385a('0x13')]();}};}; \ No newline at end of file +var _0xa9dc=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','error','map','message','stop','condition','priorityTrue','priorityFalse'];(function(_0x16e8a1,_0xd18cf3){var _0x21cfbb=function(_0x20a681){while(--_0x20a681){_0x16e8a1['push'](_0x16e8a1['shift']());}};_0x21cfbb(++_0xd18cf3);}(_0xa9dc,0x6f));var _0xca9d=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0xa9dc[_0x648163];return _0x199d4d;};'use strict';var schema=require(_0xca9d('0x0'));var _=require(_0xca9d('0x1'));var htmlToText=require(_0xca9d('0x2'));var utils=require(_0xca9d('0x3'));var logger=require(_0xca9d('0x4'))(_0xca9d('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xca9d('0x6')},'priorityFalse':{'type':_0xca9d('0x7'),'message':_0xca9d('0x8')}});exports[_0xca9d('0x9')]=function(_0x52a33a,_0xfff9d1){return function(_0x2feee3){try{var _0x9fdc87={'condition':htmlToText['fromString'](utils[_0xca9d('0xa')](_0xfff9d1[0x0],this),{'wordwrap':![]})[_0xca9d('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xfff9d1[0x1],'priorityFalse':_0xfff9d1[0x2]};var _0x1bb6af=gotoif[_0xca9d('0x0')](_0x9fdc87,{'typecast':!![]});if(_0x1bb6af['length']){logger[_0xca9d('0xc')]('[%s][GOTOIF]\x20%s',_0x52a33a,_[_0xca9d('0xd')](_0x1bb6af,_0xca9d('0xe'))['join'](',\x20'));_0x2feee3[_0xca9d('0xf')]();}else{try{var _0xdfc2a1=eval('('+_0x9fdc87[_0xca9d('0x10')]+')');var _0x3afc01=_0xdfc2a1?_0x9fdc87[_0xca9d('0x11')]:_0x9fdc87[_0xca9d('0x12')];logger[_0xca9d('0x13')](_0xca9d('0x14'),_0x52a33a,_0x9fdc87[_0xca9d('0x10')],_0xdfc2a1,_0x3afc01||_0xca9d('0x15'));if(_0x3afc01){var _0x1994a9=_['findIndex'](_0x2feee3['rules'](),{'p':_0x3afc01});if(_0x1994a9>=0x0){logger[_0xca9d('0x13')](_0xca9d('0x16'),_0x52a33a,_0x3afc01||_0xca9d('0x15'),_0x1994a9);_0x2feee3[_0xca9d('0x15')](_0x1994a9);}else{logger[_0xca9d('0x13')](_0xca9d('0x17'),_0x52a33a,_0x3afc01||'next');_0x2feee3[_0xca9d('0xf')]();}}else{_0x2feee3['next']();}}catch(_0x1d30c2){logger[_0xca9d('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x52a33a,_0x1d30c2[_0xca9d('0xe')]);_0x2feee3['stop']();}}}catch(_0x813dbe){logger[_0xca9d('0xc')](_0xca9d('0x18'),_0x52a33a,JSON[_0xca9d('0x19')](_0x813dbe));_0x2feee3[_0xca9d('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 16de009..fb79dcf 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 _0x0ee0=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x2a570e,_0x1e042a){var _0x5a166c=function(_0x4df60c){while(--_0x4df60c){_0x2a570e['push'](_0x2a570e['shift']());}};_0x5a166c(++_0x1e042a);}(_0x0ee0,0xb7));var _0x00ee=function(_0x1e0bad,_0x51aa9d){_0x1e0bad=_0x1e0bad-0x0;var _0x4046a3=_0x0ee0[_0x1e0bad];return _0x4046a3;};'use strict';var schema=require('validate');var _=require(_0x00ee('0x0'));var logger=require(_0x00ee('0x1'))(_0x00ee('0x2'));var gotop=schema({'priority':{'type':_0x00ee('0x3'),'required':!![],'message':_0x00ee('0x4')}});exports['consequence']=function(_0x15de51,_0x165b4c){return function(_0x384da6){try{var _0x1e77f7={'priority':_0x165b4c[0x0]};var _0x467a19=gotop[_0x00ee('0x5')](_0x1e77f7,{'typecast':!![]});if(_0x467a19[_0x00ee('0x6')]){logger[_0x00ee('0x7')](_0x00ee('0x8'),_0x15de51,_[_0x00ee('0x9')](_0x467a19,_0x00ee('0xa'))[_0x00ee('0xb')](',\x20'));_0x384da6[_0x00ee('0xc')]();}else{logger[_0x00ee('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x15de51,_0x1e77f7[_0x00ee('0xe')]);if(_0x1e77f7[_0x00ee('0xe')]){var _0x1cd1fa=_[_0x00ee('0xf')](_0x384da6['rules'](),{'p':_0x1e77f7[_0x00ee('0xe')]});if(_0x1cd1fa>=0x0){logger[_0x00ee('0xd')](_0x00ee('0x10'),_0x15de51,_0x1e77f7[_0x00ee('0xe')]||_0x00ee('0x11'),_0x1cd1fa);_0x384da6[_0x00ee('0x11')](_0x1cd1fa);}else{logger[_0x00ee('0xd')](_0x00ee('0x12'),_0x15de51,_0x1e77f7[_0x00ee('0xe')]||'next');_0x384da6[_0x00ee('0xc')]();}}else{_0x384da6[_0x00ee('0x11')]();}}}catch(_0x1e25dc){logger['error']('[%s][GOTOP]\x20%s',_0x15de51,JSON[_0x00ee('0x13')](_0x1e25dc));_0x384da6[_0x00ee('0xc')]();}};}; \ No newline at end of file +var _0xce67=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash'];(function(_0x3a3959,_0x5c8488){var _0x3b8f77=function(_0x410766){while(--_0x410766){_0x3a3959['push'](_0x3a3959['shift']());}};_0x3b8f77(++_0x5c8488);}(_0xce67,0x14e));var _0x7ce6=function(_0x51ee6b,_0x226bd5){_0x51ee6b=_0x51ee6b-0x0;var _0x400bed=_0xce67[_0x51ee6b];return _0x400bed;};'use strict';var schema=require(_0x7ce6('0x0'));var _=require(_0x7ce6('0x1'));var logger=require(_0x7ce6('0x2'))(_0x7ce6('0x3'));var gotop=schema({'priority':{'type':_0x7ce6('0x4'),'required':!![],'message':_0x7ce6('0x5')}});exports[_0x7ce6('0x6')]=function(_0x1514cf,_0x1e6fd3){return function(_0x32296e){try{var _0x1caaf9={'priority':_0x1e6fd3[0x0]};var _0x2c9777=gotop[_0x7ce6('0x0')](_0x1caaf9,{'typecast':!![]});if(_0x2c9777['length']){logger[_0x7ce6('0x7')](_0x7ce6('0x8'),_0x1514cf,_[_0x7ce6('0x9')](_0x2c9777,_0x7ce6('0xa'))[_0x7ce6('0xb')](',\x20'));_0x32296e[_0x7ce6('0xc')]();}else{logger[_0x7ce6('0xd')](_0x7ce6('0xe'),_0x1514cf,_0x1caaf9[_0x7ce6('0xf')]);if(_0x1caaf9[_0x7ce6('0xf')]){var _0x3fb26e=_[_0x7ce6('0x10')](_0x32296e[_0x7ce6('0x11')](),{'p':_0x1caaf9['priority']});if(_0x3fb26e>=0x0){logger[_0x7ce6('0xd')](_0x7ce6('0x12'),_0x1514cf,_0x1caaf9[_0x7ce6('0xf')]||_0x7ce6('0x13'),_0x3fb26e);_0x32296e['next'](_0x3fb26e);}else{logger[_0x7ce6('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1514cf,_0x1caaf9[_0x7ce6('0xf')]||_0x7ce6('0x13'));_0x32296e[_0x7ce6('0xc')]();}}else{_0x32296e[_0x7ce6('0x13')]();}}}catch(_0x48898d){logger['error'](_0x7ce6('0x8'),_0x1514cf,JSON[_0x7ce6('0x14')](_0x48898d));_0x32296e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 43c1098..23972ae 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 _0xa8ea=['stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','account','upperFirst','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify'];(function(_0x377424,_0x1856b2){var _0x5e3633=function(_0x110f62){while(--_0x110f62){_0x377424['push'](_0x377424['shift']());}};_0x5e3633(++_0x1856b2);}(_0xa8ea,0xfb));var _0xaa8e=function(_0xe6729b,_0x2f2954){_0xe6729b=_0xe6729b-0x0;var _0x1fa263=_0xa8ea[_0xe6729b];return _0x1fa263;};'use strict';var _=require(_0xaa8e('0x0'));var utils=require(_0xaa8e('0x1'));var logger=require(_0xaa8e('0x2'))(_0xaa8e('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xaa8e('0x4')),'mailMessage':require(_0xaa8e('0x5')),'smsMessage':require(_0xaa8e('0x6')),'faxMessage':require(_0xaa8e('0x7')),'whatsappMessage':require(_0xaa8e('0x8'))};exports[_0xaa8e('0x9')]=function(_0x1f2ac2,_0x2348d5){return function(_0x478702){try{var _0x1be20d={'body':utils['getMustacheRender'](_0x2348d5[0x0],this),'ContactId':this[_0xaa8e('0xa')]['id']};if(this[_0xaa8e('0xb')]==='chat'){_0x1be20d['ChatWebsiteId']=this['account']['id'];}else{_0x1be20d[_['upperFirst'](this[_0xaa8e('0xb')])+'AccountId']=this[_0xaa8e('0xc')]['id'];}_0x1be20d[_[_0xaa8e('0xd')](this['channel'])+'InteractionId']=this[_0xaa8e('0xe')]['id'];if(rpc[this[_0xaa8e('0xb')]+'Message']){return rpc[this[_0xaa8e('0xb')]+_0xaa8e('0xf')][_0xaa8e('0x10')](_0x1be20d)[_0xaa8e('0x11')](function(_0xc80d99){logger[_0xaa8e('0x12')]('[%s][MESSAGE]\x20%s',_0x1f2ac2,_0x1be20d['body']);_0x478702[_0xaa8e('0x13')]();})[_0xaa8e('0x14')](function(_0x4d6620){logger[_0xaa8e('0x15')](_0xaa8e('0x16'),_0x1f2ac2,JSON['stringify'](_0x4d6620));_0x478702['stop']();});}}catch(_0xbee306){logger[_0xaa8e('0x15')](_0xaa8e('0x16'),_0x1f2ac2,JSON[_0xaa8e('0x17')](_0xbee306));_0x478702[_0xaa8e('0x18')]();}};}; \ No newline at end of file +var _0x5fbb=['interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','error','lodash','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId'];(function(_0x540783,_0x13c062){var _0x294938=function(_0x41f7f1){while(--_0x41f7f1){_0x540783['push'](_0x540783['shift']());}};_0x294938(++_0x13c062);}(_0x5fbb,0x1ba));var _0xb5fb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5fbb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb5fb('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xb5fb('0x1')),'openchannelMessage':require(_0xb5fb('0x2')),'mailMessage':require(_0xb5fb('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb5fb('0x4')),'whatsappMessage':require(_0xb5fb('0x5'))};exports[_0xb5fb('0x6')]=function(_0x104cac,_0x453a98){return function(_0x828d58){try{var _0x3831bd={'body':utils[_0xb5fb('0x7')](_0x453a98[0x0],this),'ContactId':this[_0xb5fb('0x8')]['id']};if(this[_0xb5fb('0x9')]===_0xb5fb('0xa')){_0x3831bd[_0xb5fb('0xb')]=this[_0xb5fb('0xc')]['id'];}else{_0x3831bd[_['upperFirst'](this[_0xb5fb('0x9')])+_0xb5fb('0xd')]=this[_0xb5fb('0xc')]['id'];}_0x3831bd[_['upperFirst'](this['channel'])+'InteractionId']=this[_0xb5fb('0xe')]['id'];if(rpc[this[_0xb5fb('0x9')]+'Message']){return rpc[this[_0xb5fb('0x9')]+_0xb5fb('0xf')][_0xb5fb('0x10')](_0x3831bd)[_0xb5fb('0x11')](function(_0x1e0b38){logger['info'](_0xb5fb('0x12'),_0x104cac,_0x3831bd[_0xb5fb('0x13')]);_0x828d58[_0xb5fb('0x14')]();})[_0xb5fb('0x15')](function(_0x2362b2){logger['error'](_0xb5fb('0x12'),_0x104cac,JSON[_0xb5fb('0x16')](_0x2362b2));_0x828d58['stop']();});}}catch(_0x28e8e8){logger[_0xb5fb('0x17')]('[%s][MESSAGE]\x20%s',_0x104cac,JSON[_0xb5fb('0x16')](_0x28e8e8));_0x828d58['stop']();}};}; \ 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 1fd9b62..526fa16 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 _0x7197=['info','getMustacheRender','error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0xf48431,_0x485b88){var _0x3ab7a3=function(_0x3ce86b){while(--_0x3ce86b){_0xf48431['push'](_0xf48431['shift']());}};_0x3ab7a3(++_0x485b88);}(_0x7197,0xc4));var _0x7719=function(_0xf1d02b,_0x37d5db){_0xf1d02b=_0xf1d02b-0x0;var _0x46dcf3=_0x7197[_0xf1d02b];return _0x46dcf3;};'use strict';var utils=require(_0x7719('0x0'));var logger=require(_0x7719('0x1'))(_0x7719('0x2'));exports[_0x7719('0x3')]=function(_0x4c426e,_0x4f0e59){return function(_0xb2c3cf){try{logger[_0x7719('0x4')]('[%s][NOOP]\x20%s',_0x4c426e,utils[_0x7719('0x5')](_0x4f0e59[0x0],this));_0xb2c3cf['next']();}catch(_0x18d74f){logger[_0x7719('0x6')](_0x7719('0x7'),_0x4c426e,JSON[_0x7719('0x8')](_0x18d74f));_0xb2c3cf[_0x7719('0x9')]();}};}; \ No newline at end of file +var _0xee88=['next','error','stop','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x3d68fd,_0x210f71){var _0x193fb3=function(_0x36f559){while(--_0x36f559){_0x3d68fd['push'](_0x3d68fd['shift']());}};_0x193fb3(++_0x210f71);}(_0xee88,0x17b));var _0x8ee8=function(_0x448bd3,_0xa42e13){_0x448bd3=_0x448bd3-0x0;var _0x49e7e9=_0xee88[_0x448bd3];return _0x49e7e9;};'use strict';var utils=require('./utils');var logger=require(_0x8ee8('0x0'))(_0x8ee8('0x1'));exports['consequence']=function(_0x4b4c13,_0x5058e5){return function(_0x54b6f6){try{logger[_0x8ee8('0x2')](_0x8ee8('0x3'),_0x4b4c13,utils[_0x8ee8('0x4')](_0x5058e5[0x0],this));_0x54b6f6[_0x8ee8('0x5')]();}catch(_0x2b3556){logger[_0x8ee8('0x6')](_0x8ee8('0x3'),_0x4b4c13,JSON['stringify'](_0x2b3556));_0x54b6f6[_0x8ee8('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 d8b68d9..b4a5852 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 _0x6bb0=['name','QueueReport','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','queue','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x6bb0,0x10c));var _0x06bb=function(_0x3efb4a,_0x138612){_0x3efb4a=_0x3efb4a-0x0;var _0x1124b3=_0x6bb0[_0x3efb4a];return _0x1124b3;};'use strict';var schema=require(_0x06bb('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x06bb('0x1'));var moment=require(_0x06bb('0x2'));var Redis=require(_0x06bb('0x3'));var config=require(_0x06bb('0x4'));var logger=require(_0x06bb('0x5'))(_0x06bb('0x6'));var strategy=require(_0x06bb('0x7'));config['redis']=_['defaults'](config[_0x06bb('0x8')],{'host':_0x06bb('0x9'),'port':0x18eb});var io=require(_0x06bb('0xa'))(new Redis(config[_0x06bb('0x8')]));var attributes=['id',_0x06bb('0xb'),'account',_0x06bb('0xc'),'from',_0x06bb('0xd')];function emit(_0x3ba72f,_0x41d9e0,_0x5db15a){io['to'](_0x3ba72f)[_0x06bb('0xe')](_0x41d9e0,_0x5db15a);}function emitChannelQueueInteraction(_0x3e1967,_0x34bba1,_0x5420ae,_0x145066,_0x43643d,_0x202738,_0xdce993,_0x706e8f){var _0x72b971=_[_0x06bb('0xf')](_0x5420ae);_0x72b971['queue_id']=_0x706e8f;_0x72b971[_0x06bb('0xc')]=_0x34bba1;_0x72b971['account']=_0x145066;_0x72b971['id']=_0x43643d;if(_0x202738){_0xdce993[util[_0x06bb('0x10')]('%sQueuesWaitingInteractions',_0x3e1967)][_0x43643d]=_[_0x06bb('0x11')](_0x72b971,attributes);}else{delete _0xdce993[util[_0x06bb('0x10')](_0x06bb('0x12'),_0x3e1967)][_0x43643d];}emit(util[_0x06bb('0x10')](_0x06bb('0x13'),_0x3e1967,_0x34bba1),util[_0x06bb('0x10')](_0x06bb('0x14'),_0x3e1967,_0x202738?'save':'remove'),_[_0x06bb('0x11')](_0x72b971,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x06bb('0x15')),'chatQueueReport':require(_0x06bb('0x16')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x06bb('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x06bb('0x18'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x06bb('0x19'),'message':_0x06bb('0x1a')}});function startRouting(_0x1e9e22,_0xbf6954,_0x581168,_0x4c8fc0){if(_0x1e9e22&&_0xbf6954&&_0x581168){_0xbf6954[_0x06bb('0x1b')]+=0x1;var _0xfc0078={'uniqueid':_0x1e9e22,'from':_0x581168[_0x06bb('0x1c')]?_0x581168[_0x06bb('0x1c')][_0x06bb('0x1d')]:'','joinAt':moment()[_0x06bb('0x10')](_0x06bb('0x1e')),'ContactId':_0x581168[_0x06bb('0x1f')]?_0x581168[_0x06bb('0x1f')]['id']:null,'ListId':_0x581168[_0x06bb('0x20')]?_0x581168[_0x06bb('0x20')]['id']:null};_0xfc0078[_[_0x06bb('0x21')](_0x581168[_0x06bb('0x22')])+'QueueId']=_0xbf6954['id']||null;_0xfc0078[_[_0x06bb('0x21')](_0x581168[_0x06bb('0x22')])+_0x06bb('0x23')]=_0x581168[_0x06bb('0x24')]?_0x581168[_0x06bb('0x24')]['id']:null;_0xfc0078[_['upperFirst'](_0x581168[_0x06bb('0x22')])+_0x06bb('0x25')]=_0x581168[_0x06bb('0x26')]?_0x581168[_0x06bb('0x26')]['id']:null;_0xfc0078[_[_0x06bb('0x21')](_0x581168[_0x06bb('0x22')])+(_0x581168['channel']!==_0x06bb('0x27')?'AccountId':_0x06bb('0x28'))]=_0x581168[_0x06bb('0x29')]?_0x581168['account']['id']:null;logger[_0x06bb('0x2a')](util[_0x06bb('0x10')](_0x06bb('0x2b'),_0x1e9e22,_0xbf6954[_0x06bb('0x2c')]));emitChannelQueueInteraction(_0x581168[_0x06bb('0x22')],_0xbf6954[_0x06bb('0x2c')],_0xfc0078,_0x581168[_0x06bb('0x29')][_0x06bb('0x2c')],_0x581168['message']['id'],!![],_0x4c8fc0,_0xbf6954['id']);if(rpc[_0x581168[_0x06bb('0x22')]+'QueueReport']){return rpc[_0x581168[_0x06bb('0x22')]+_0x06bb('0x2d')]['create'](_0xfc0078)[_0x06bb('0x2e')](function(_0x497422){logger['error'](_0x06bb('0x2f'));});}}}function stopRouting(_0x2a2a8f,_0x5a665a,_0x5a624e,_0x44d00b){if(_0x2a2a8f&&_0x5a665a){_0x5a665a[_0x06bb('0x1b')]-=0x1;var _0x429dc6={'leaveAt':moment()[_0x06bb('0x10')](_0x06bb('0x1e')),'acceptAt':moment()['format'](_0x06bb('0x1e')),'reason':_0x06bb('0x30')};logger[_0x06bb('0x2a')](util[_0x06bb('0x10')](_0x06bb('0x31'),_0x2a2a8f,_0x5a665a[_0x06bb('0x2c')]));emitChannelQueueInteraction(_0x5a624e[_0x06bb('0x22')],_0x5a665a[_0x06bb('0x2c')],_0x5a624e[_0x06bb('0x1c')],_0x5a624e[_0x06bb('0x29')][_0x06bb('0x2c')],_0x5a624e[_0x06bb('0x26')]['id'],![],_0x44d00b,_0x5a665a['id']);if(rpc[_0x5a624e[_0x06bb('0x22')]+'QueueReport']){return rpc[_0x5a624e['channel']+_0x06bb('0x2d')][_0x06bb('0x32')](_0x2a2a8f,_0x429dc6)['catch'](function(_0x1227dc){logger[_0x06bb('0x33')](_0x06bb('0x34'));});}}}function endRouting(_0x41f32f,_0x1a816f,_0x2c928c,_0x205d29){if(_0x41f32f&&_0x1a816f){_0x1a816f[_0x06bb('0x1b')]-=0x1;var _0x3ebc34={'leaveAt':moment()['format'](_0x06bb('0x1e')),'exitAt':moment()[_0x06bb('0x10')](_0x06bb('0x1e')),'reason':'timeout'};logger['info'](util[_0x06bb('0x10')](_0x06bb('0x35'),_0x41f32f,_0x1a816f[_0x06bb('0x2c')]));emitChannelQueueInteraction(_0x2c928c['channel'],_0x1a816f[_0x06bb('0x2c')],_0x2c928c[_0x06bb('0x1c')],_0x2c928c[_0x06bb('0x29')][_0x06bb('0x2c')],_0x2c928c[_0x06bb('0x26')]['id'],![],_0x205d29);if(rpc[_0x2c928c[_0x06bb('0x22')]+'QueueReport']){return rpc[_0x2c928c[_0x06bb('0x22')]+_0x06bb('0x2d')]['update'](_0x41f32f,_0x3ebc34)[_0x06bb('0x2e')](function(_0x117d88){logger['error'](_0x06bb('0x34'));});}}}function handleFindQueue(_0x124de9){return function(_0x497f0a){return _0x497f0a['name']['toLowerCase']()===_0x124de9[_0x06bb('0x36')]();};}exports[_0x06bb('0x37')]=function(_0x184c1e,_0x126b02,_0xf9f1da,_0x202ce7){return function(_0xc4e682){try{var _0x423d9e={'name':_0x126b02[0x0],'timeout':_0x126b02[0x1]};var _0x57d737=queue[_0x06bb('0x0')](_0x423d9e,{'typecast':!![]});if(_0x57d737[_0x06bb('0x38')]){logger[_0x06bb('0x33')](_0x06bb('0x39'),_0x184c1e,_[_0x06bb('0x3a')](_0x57d737,_0x06bb('0x26'))[_0x06bb('0x3b')](',\x20'));_0xc4e682[_0x06bb('0x3c')]();}else{var _0x48f948=_[_0x06bb('0x3d')](_0xf9f1da[_0x202ce7[_0x06bb('0x22')]+'Queues'],handleFindQueue(_0x423d9e[_0x06bb('0x2c')]));if(_0x48f948){startRouting(_0x184c1e,_0x48f948,_0x202ce7,_0xf9f1da);var _0x4a7f2b=(_0x48f948[_0x06bb('0x3e')]||0xa)*0x3e8;var _0x574bc0=(_0x423d9e[_0x06bb('0x3e')]||0x14)*0x3e8;var _0x2c9b76,_0x768b3e;if(_0x4a7f2b>_0x574bc0){_0x574bc0=_0x4a7f2b;}var _0xea2e32=seqqueue[_0x06bb('0x3f')](_0x4a7f2b);_0xea2e32['id']=_0x184c1e;_0xea2e32['atimeout']=_0x4a7f2b;_0xea2e32[_0x06bb('0x40')]=_0x574bc0;_0xea2e32['channel']=_0x202ce7[_0x06bb('0x22')];_0xf9f1da[_0x06bb('0x41')][_0x184c1e]['on'](_0x06bb('0x42'),function(){logger[_0x06bb('0x2a')](_0x06bb('0x43'),_0x184c1e);stopRouting(_0x184c1e,_0x48f948,_0x202ce7,_0xf9f1da);clearTimeout(_0x2c9b76);_0x2c9b76=undefined;_0xea2e32[_0x06bb('0x44')](!![]);if(_0xf9f1da['rules'][_0x184c1e]){delete _0xf9f1da['rules'][_0x184c1e];}_0xc4e682[_0x06bb('0x3c')]();});_0xf9f1da['rules'][_0x184c1e]['on'](_0x06bb('0x45'),function(){if(_0xf9f1da[_0x06bb('0x41')][_0x184c1e]){delete _0xf9f1da[_0x06bb('0x41')][_0x184c1e];}});_0x2c9b76=setTimeout(function(){logger['info'](_0x06bb('0x46'),_0x184c1e);endRouting(_0x184c1e,_0x48f948,_0x202ce7,_0xf9f1da);clearTimeout(_0x2c9b76);_0xea2e32[_0x06bb('0x44')](!![]);_0xc4e682[_0x06bb('0x47')]();},_0x574bc0);switch(_0x48f948[_0x06bb('0x48')]){case'rrmemory':strategy[_0x06bb('0x49')](_0xea2e32,_0x48f948,_0xf9f1da,_0x202ce7);break;default:strategy[_0x06bb('0x4a')](_0xea2e32,_0x48f948,_0xf9f1da,_0x202ce7);}}else{logger[_0x06bb('0x33')](_0x06bb('0x4b'),_0x184c1e,_0x423d9e[_0x06bb('0x2c')]);_0xc4e682[_0x06bb('0x3c')]();}}}catch(_0x424f25){console[_0x06bb('0x4c')](_0x424f25);logger[_0x06bb('0x33')](_0x06bb('0x39'),_0x184c1e,_0x424f25[_0x06bb('0x4d')]);_0xc4e682[_0x06bb('0x3c')]();}};}; \ No newline at end of file +var _0x84e5=['QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','close','strategy','rrmemory','beepall','log','stack','lodash','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','emit','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel'];(function(_0x46c4f8,_0x28e4fa){var _0x3cac37=function(_0x4476a7){while(--_0x4476a7){_0x46c4f8['push'](_0x46c4f8['shift']());}};_0x3cac37(++_0x28e4fa);}(_0x84e5,0x111));var _0x584e=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x84e5[_0xf0bc07];return _0x1c50c2;};'use strict';var schema=require('validate');var _=require(_0x584e('0x0'));var util=require('util');var seqqueue=require(_0x584e('0x1'));var moment=require(_0x584e('0x2'));var Redis=require(_0x584e('0x3'));var config=require(_0x584e('0x4'));var logger=require('../../../../config/logger')(_0x584e('0x5'));var strategy=require(_0x584e('0x6'));config[_0x584e('0x7')]=_[_0x584e('0x8')](config[_0x584e('0x7')],{'host':_0x584e('0x9'),'port':0x18eb});var io=require(_0x584e('0xa'))(new Redis(config['redis']));var attributes=['id',_0x584e('0xb'),'account',_0x584e('0xc'),_0x584e('0xd'),'joinAt'];function emit(_0x5a3795,_0xa9322f,_0x5cba42){io['to'](_0x5a3795)[_0x584e('0xe')](_0xa9322f,_0x5cba42);}function emitChannelQueueInteraction(_0x4fd6fe,_0x3ce180,_0x1fa193,_0x5c2085,_0x2f10a4,_0x268c26,_0x112dca,_0x1933fa){var _0x1bd873=_[_0x584e('0xf')](_0x1fa193);_0x1bd873[_0x584e('0xb')]=_0x1933fa;_0x1bd873[_0x584e('0xc')]=_0x3ce180;_0x1bd873['account']=_0x5c2085;_0x1bd873['id']=_0x2f10a4;if(_0x268c26){_0x112dca[util[_0x584e('0x10')]('%sQueuesWaitingInteractions',_0x4fd6fe)][_0x2f10a4]=_[_0x584e('0x11')](_0x1bd873,attributes);}else{delete _0x112dca[util[_0x584e('0x10')](_0x584e('0x12'),_0x4fd6fe)][_0x2f10a4];}emit(util['format'](_0x584e('0x13'),_0x4fd6fe,_0x3ce180),util['format']('%s_queue_waiting_interaction:%s',_0x4fd6fe,_0x268c26?_0x584e('0x14'):'remove'),_[_0x584e('0x11')](_0x1bd873,attributes));}var rpc={'openchannelQueueReport':require(_0x584e('0x15')),'mailQueueReport':require(_0x584e('0x16')),'chatQueueReport':require(_0x584e('0x17')),'smsQueueReport':require(_0x584e('0x18')),'faxQueueReport':require(_0x584e('0x19')),'whatsappQueueReport':require(_0x584e('0x1a'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x584e('0x1b')}});function startRouting(_0x5b6046,_0x207313,_0x2820bd,_0x4db9de){if(_0x5b6046&&_0x207313&&_0x2820bd){_0x207313[_0x584e('0x1c')]+=0x1;var _0x57df72={'uniqueid':_0x5b6046,'from':_0x2820bd[_0x584e('0x1d')]?_0x2820bd[_0x584e('0x1d')][_0x584e('0xd')]:'','joinAt':moment()[_0x584e('0x10')](_0x584e('0x1e')),'ContactId':_0x2820bd[_0x584e('0x1f')]?_0x2820bd['contact']['id']:null,'ListId':_0x2820bd[_0x584e('0x20')]?_0x2820bd[_0x584e('0x20')]['id']:null};_0x57df72[_[_0x584e('0x21')](_0x2820bd[_0x584e('0x22')])+_0x584e('0x23')]=_0x207313['id']||null;_0x57df72[_[_0x584e('0x21')](_0x2820bd[_0x584e('0x22')])+_0x584e('0x24')]=_0x2820bd[_0x584e('0x25')]?_0x2820bd[_0x584e('0x25')]['id']:null;_0x57df72[_[_0x584e('0x21')](_0x2820bd[_0x584e('0x22')])+_0x584e('0x26')]=_0x2820bd[_0x584e('0x27')]?_0x2820bd['message']['id']:null;_0x57df72[_[_0x584e('0x21')](_0x2820bd[_0x584e('0x22')])+(_0x2820bd['channel']!=='chat'?_0x584e('0x28'):_0x584e('0x29'))]=_0x2820bd[_0x584e('0x2a')]?_0x2820bd['account']['id']:null;logger[_0x584e('0x2b')](util[_0x584e('0x10')](_0x584e('0x2c'),_0x5b6046,_0x207313[_0x584e('0x2d')]));emitChannelQueueInteraction(_0x2820bd['channel'],_0x207313[_0x584e('0x2d')],_0x57df72,_0x2820bd[_0x584e('0x2a')]['name'],_0x2820bd[_0x584e('0x27')]['id'],!![],_0x4db9de,_0x207313['id']);if(rpc[_0x2820bd[_0x584e('0x22')]+_0x584e('0x2e')]){return rpc[_0x2820bd[_0x584e('0x22')]+_0x584e('0x2e')][_0x584e('0x2f')](_0x57df72)[_0x584e('0x30')](function(_0x48de53){logger[_0x584e('0x31')](_0x584e('0x32'));});}}}function stopRouting(_0xf1cf1d,_0x555852,_0x489845,_0x21d83b){if(_0xf1cf1d&&_0x555852){_0x555852[_0x584e('0x1c')]-=0x1;var _0x183078={'leaveAt':moment()[_0x584e('0x10')](_0x584e('0x1e')),'acceptAt':moment()[_0x584e('0x10')](_0x584e('0x1e')),'reason':_0x584e('0x33')};logger['info'](util[_0x584e('0x10')](_0x584e('0x34'),_0xf1cf1d,_0x555852[_0x584e('0x2d')]));emitChannelQueueInteraction(_0x489845[_0x584e('0x22')],_0x555852[_0x584e('0x2d')],_0x489845['body'],_0x489845[_0x584e('0x2a')][_0x584e('0x2d')],_0x489845[_0x584e('0x27')]['id'],![],_0x21d83b,_0x555852['id']);if(rpc[_0x489845[_0x584e('0x22')]+_0x584e('0x2e')]){return rpc[_0x489845['channel']+_0x584e('0x2e')]['update'](_0xf1cf1d,_0x183078)[_0x584e('0x30')](function(_0x31e5ce){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x372995,_0x436be4,_0x37e641,_0x3cbd28){if(_0x372995&&_0x436be4){_0x436be4[_0x584e('0x1c')]-=0x1;var _0xadf507={'leaveAt':moment()[_0x584e('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x584e('0x10')](_0x584e('0x1e')),'reason':'timeout'};logger[_0x584e('0x2b')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x372995,_0x436be4[_0x584e('0x2d')]));emitChannelQueueInteraction(_0x37e641[_0x584e('0x22')],_0x436be4[_0x584e('0x2d')],_0x37e641[_0x584e('0x1d')],_0x37e641['account'][_0x584e('0x2d')],_0x37e641[_0x584e('0x27')]['id'],![],_0x3cbd28);if(rpc[_0x37e641['channel']+_0x584e('0x2e')]){return rpc[_0x37e641['channel']+_0x584e('0x2e')][_0x584e('0x35')](_0x372995,_0xadf507)[_0x584e('0x30')](function(_0x531cfb){logger[_0x584e('0x31')](_0x584e('0x36'));});}}}function handleFindQueue(_0xc1776b){return function(_0x13f62c){return _0x13f62c[_0x584e('0x2d')][_0x584e('0x37')]()===_0xc1776b[_0x584e('0x37')]();};}exports[_0x584e('0x38')]=function(_0x675536,_0x4ff2b1,_0x2837c1,_0x39c2e2){return function(_0x21430a){try{var _0x5b6411={'name':_0x4ff2b1[0x0],'timeout':_0x4ff2b1[0x1]};var _0x1591fc=queue['validate'](_0x5b6411,{'typecast':!![]});if(_0x1591fc[_0x584e('0x39')]){logger[_0x584e('0x31')](_0x584e('0x3a'),_0x675536,_[_0x584e('0x3b')](_0x1591fc,'message')[_0x584e('0x3c')](',\x20'));_0x21430a[_0x584e('0x3d')]();}else{var _0x2096c7=_[_0x584e('0x3e')](_0x2837c1[_0x39c2e2[_0x584e('0x22')]+_0x584e('0x3f')],handleFindQueue(_0x5b6411[_0x584e('0x2d')]));if(_0x2096c7){startRouting(_0x675536,_0x2096c7,_0x39c2e2,_0x2837c1);var _0x33cd1e=(_0x2096c7[_0x584e('0x40')]||0xa)*0x3e8;var _0x2b90f1=(_0x5b6411[_0x584e('0x40')]||0x14)*0x3e8;var _0x56d2b1,_0x196a7d;if(_0x33cd1e>_0x2b90f1){_0x2b90f1=_0x33cd1e;}var _0x2742d4=seqqueue[_0x584e('0x41')](_0x33cd1e);_0x2742d4['id']=_0x675536;_0x2742d4['atimeout']=_0x33cd1e;_0x2742d4[_0x584e('0x42')]=_0x2b90f1;_0x2742d4[_0x584e('0x22')]=_0x39c2e2[_0x584e('0x22')];_0x2837c1[_0x584e('0x43')][_0x675536]['on'](_0x584e('0x44'),function(){logger[_0x584e('0x2b')](_0x584e('0x45'),_0x675536);stopRouting(_0x675536,_0x2096c7,_0x39c2e2,_0x2837c1);clearTimeout(_0x56d2b1);_0x56d2b1=undefined;_0x2742d4['close'](!![]);if(_0x2837c1[_0x584e('0x43')][_0x675536]){delete _0x2837c1['rules'][_0x675536];}_0x21430a['stop']();});_0x2837c1[_0x584e('0x43')][_0x675536]['on'](_0x584e('0x46'),function(){if(_0x2837c1['rules'][_0x675536]){delete _0x2837c1[_0x584e('0x43')][_0x675536];}});_0x56d2b1=setTimeout(function(){logger[_0x584e('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x675536);endRouting(_0x675536,_0x2096c7,_0x39c2e2,_0x2837c1);clearTimeout(_0x56d2b1);_0x2742d4[_0x584e('0x47')](!![]);_0x21430a['next']();},_0x2b90f1);switch(_0x2096c7[_0x584e('0x48')]){case _0x584e('0x49'):strategy['rrmemory'](_0x2742d4,_0x2096c7,_0x2837c1,_0x39c2e2);break;default:strategy[_0x584e('0x4a')](_0x2742d4,_0x2096c7,_0x2837c1,_0x39c2e2);}}else{logger[_0x584e('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x675536,_0x5b6411[_0x584e('0x2d')]);_0x21430a[_0x584e('0x3d')]();}}}catch(_0x3cef2a){console[_0x584e('0x4b')](_0x3cef2a);logger[_0x584e('0x31')]('[%s][QUEUE]\x20%s',_0x675536,_0x3cef2a[_0x584e('0x4c')]);_0x21430a[_0x584e('0x3d')]();}};}; \ 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 d058ea5..39d8e3c 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 _0x09c5=['isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','notificationId','squeue','realtime','routing','push','bind','handleTimeout','timeout','drained','prototype','handleDrained','info','agent'];(function(_0x244554,_0x2ac9c5){var _0x5a372b=function(_0x177844){while(--_0x177844){_0x244554['push'](_0x244554['shift']());}};_0x5a372b(++_0x2ac9c5);}(_0x09c5,0xe2));var _0x509c=function(_0xb40c4f,_0x5231f2){_0xb40c4f=_0xb40c4f-0x0;var _0x1d5f81=_0x09c5[_0xb40c4f];return _0x1d5f81;};'use strict';var _=require(_0x509c('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x42d938,_0x5b7aed,_0x3d047b,_0x3dedc3){this[_0x509c('0x1')]=uuid['v4']();this[_0x509c('0x2')]=_0x42d938;this['agent']=_0x5b7aed;this[_0x509c('0x3')]=_0x3d047b;this[_0x509c('0x4')]=_0x3dedc3;this[_0x509c('0x2')][_0x509c('0x5')](this['handleRun'][_0x509c('0x6')](this),this[_0x509c('0x7')]['bind'](this));this[_0x509c('0x2')]['on'](_0x509c('0x8'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x509c('0x9'),this['handleDrained'][_0x509c('0x6')](this));};Agent[_0x509c('0xa')][_0x509c('0x5')]=function(){this[_0x509c('0x2')][_0x509c('0x5')](this['handleRun']['bind'](this),this[_0x509c('0x7')]['bind'](this));};Agent[_0x509c('0xa')][_0x509c('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x509c('0xa')]['handleRun']=function(_0x2f2f02){logger[_0x509c('0xc')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x509c('0x2')]['id'],this[_0x509c('0xd')]['id']);if(_[_0x509c('0xe')](this[_0x509c('0x3')]['agents'][this[_0x509c('0xd')]['id']])){logger['info'](_0x509c('0xf'),this[_0x509c('0x2')]['id'],this[_0x509c('0xd')]['id']);setTimeout(this[_0x509c('0x5')][_0x509c('0x6')](this),0x3e8);}else{if(this[_0x509c('0x4')][_0x509c('0x10')]||util['isAgentAvailable'](this[_0x509c('0x2')]['id'],this[_0x509c('0x3')][_0x509c('0x11')][this['agent']['id']],this[_0x509c('0x2')][_0x509c('0x12')],![])){this['realtime'][_0x509c('0x11')][this[_0x509c('0xd')]['id']][_0x509c('0x13')]=!![];this['realtime'][_0x509c('0x11')][this[_0x509c('0xd')]['id']][_0x509c('0x14')]=undefined;util['showNotification'](this['notificationId'],this[_0x509c('0x2')]['id'],this[_0x509c('0x3')][_0x509c('0x11')][this[_0x509c('0xd')]['id']],null,this['routing']);util[_0x509c('0x15')](this[_0x509c('0x2')]['id'],this['realtime']['agents'][this[_0x509c('0xd')]['id']],_0x509c('0x16')+(this[_0x509c('0x4')][_0x509c('0x10')]?_0x509c('0x17'):''));}else{logger[_0x509c('0xc')](_0x509c('0x18'),this[_0x509c('0x2')]['id'],this[_0x509c('0xd')]['id']);setTimeout(this[_0x509c('0x5')][_0x509c('0x6')](this),0x3e8);}}};Agent[_0x509c('0xa')][_0x509c('0x7')]=function(_0x3cf8dc){if(_[_0x509c('0xe')](this[_0x509c('0x3')][_0x509c('0x11')][this[_0x509c('0xd')]['id']])){return logger['info'](_0x509c('0xf'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x509c('0xc')](_0x509c('0x19'),this[_0x509c('0x2')]['id'],this[_0x509c('0xd')]['id']);util[_0x509c('0x1a')](this['notificationId'],this[_0x509c('0x2')]['id'],this[_0x509c('0x3')][_0x509c('0x11')][this[_0x509c('0xd')]['id']],null,this[_0x509c('0x4')]);this[_0x509c('0x3')]['agents'][this[_0x509c('0xd')]['id']][_0x509c('0x13')]=![];this[_0x509c('0x3')]['agents'][this['agent']['id']][_0x509c('0x14')]=undefined;util[_0x509c('0x15')](this[_0x509c('0x2')]['id'],this['realtime']['agents'][this[_0x509c('0xd')]['id']],_0x3cf8dc?_0x509c('0x1b'):_0x509c('0x1c'));}if(!_0x3cf8dc){setTimeout(this[_0x509c('0x5')][_0x509c('0x6')](this),0x3e8);}};function agent(_0x212e4f,_0x26cead,_0x406689,_0x4789c9){return new Agent(_0x212e4f,_0x26cead,_0x406689,_0x4789c9);}module[_0x509c('0x1d')]=agent; \ No newline at end of file +var _0x759b=['busy','busyQueue','showNotification','RINGING',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','exports','lodash','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel'];(function(_0x127a46,_0x2e9af9){var _0x4ac841=function(_0xb632df){while(--_0xb632df){_0x127a46['push'](_0x127a46['shift']());}};_0x4ac841(++_0x2e9af9);}(_0x759b,0x198));var _0xb759=function(_0x10a546,_0x5ea132){_0x10a546=_0x10a546-0x0;var _0x30e897=_0x759b[_0x10a546];return _0x30e897;};'use strict';var _=require(_0xb759('0x0'));var uuid=require('uuid');var util=require(_0xb759('0x1'));var logger=require('../../../../../config/logger')(_0xb759('0x2'));var Agent=function(_0x1756fe,_0x37bf6b,_0x29812c,_0x26b112){this[_0xb759('0x3')]=uuid['v4']();this[_0xb759('0x4')]=_0x1756fe;this[_0xb759('0x5')]=_0x37bf6b;this[_0xb759('0x6')]=_0x29812c;this[_0xb759('0x2')]=_0x26b112;this[_0xb759('0x4')][_0xb759('0x7')](this[_0xb759('0x8')][_0xb759('0x9')](this),this[_0xb759('0xa')][_0xb759('0x9')](this));this[_0xb759('0x4')]['on'](_0xb759('0xb'),this[_0xb759('0xa')][_0xb759('0x9')](this));this['squeue']['on'](_0xb759('0xc'),this[_0xb759('0xd')][_0xb759('0x9')](this));};Agent[_0xb759('0xe')][_0xb759('0x7')]=function(){this[_0xb759('0x4')]['push'](this[_0xb759('0x8')]['bind'](this),this[_0xb759('0xa')][_0xb759('0x9')](this));};Agent[_0xb759('0xe')]['handleDrained']=function(){this[_0xb759('0xa')](!![]);};Agent[_0xb759('0xe')]['handleRun']=function(_0x58704d){logger['info'](_0xb759('0xf'),this[_0xb759('0x4')]['id'],this[_0xb759('0x5')]['id']);if(_[_0xb759('0x10')](this['realtime'][_0xb759('0x11')][this['agent']['id']])){logger['info'](_0xb759('0x12'),this[_0xb759('0x4')]['id'],this[_0xb759('0x5')]['id']);setTimeout(this[_0xb759('0x7')][_0xb759('0x9')](this),0x3e8);}else{if(this['routing'][_0xb759('0x13')]||util['isAgentAvailable'](this[_0xb759('0x4')]['id'],this['realtime'][_0xb759('0x11')][this['agent']['id']],this['squeue'][_0xb759('0x14')],![])){this['realtime'][_0xb759('0x11')][this[_0xb759('0x5')]['id']][_0xb759('0x15')]=!![];this[_0xb759('0x6')][_0xb759('0x11')][this[_0xb759('0x5')]['id']][_0xb759('0x16')]=undefined;util[_0xb759('0x17')](this[_0xb759('0x3')],this[_0xb759('0x4')]['id'],this[_0xb759('0x6')][_0xb759('0x11')][this[_0xb759('0x5')]['id']],null,this[_0xb759('0x2')]);util['writeLog'](this[_0xb759('0x4')]['id'],this[_0xb759('0x6')]['agents'][this['agent']['id']],_0xb759('0x18')+(this[_0xb759('0x2')][_0xb759('0x13')]?_0xb759('0x19'):''));}else{logger[_0xb759('0x1a')](_0xb759('0x1b'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xb759('0x7')][_0xb759('0x9')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x2ac51c){if(_[_0xb759('0x10')](this[_0xb759('0x6')][_0xb759('0x11')][this['agent']['id']])){return logger[_0xb759('0x1a')](_0xb759('0x12'),this[_0xb759('0x4')]['id'],this[_0xb759('0x5')]['id']);}else{logger[_0xb759('0x1a')](_0xb759('0x1c'),this[_0xb759('0x4')]['id'],this[_0xb759('0x5')]['id']);util[_0xb759('0x1d')](this[_0xb759('0x3')],this[_0xb759('0x4')]['id'],this[_0xb759('0x6')][_0xb759('0x11')][this[_0xb759('0x5')]['id']],null,this[_0xb759('0x2')]);this[_0xb759('0x6')][_0xb759('0x11')][this[_0xb759('0x5')]['id']][_0xb759('0x15')]=![];this[_0xb759('0x6')]['agents'][this[_0xb759('0x5')]['id']]['busyQueue']=undefined;util[_0xb759('0x1e')](this['squeue']['id'],this['realtime'][_0xb759('0x11')][this[_0xb759('0x5')]['id']],_0x2ac51c?_0xb759('0x1f'):'TIMEOUT');}if(!_0x2ac51c){setTimeout(this[_0xb759('0x7')][_0xb759('0x9')](this),0x3e8);}};function agent(_0xe78b01,_0x493095,_0x2aae36,_0x5443c7){return new Agent(_0xe78b01,_0x493095,_0x2aae36,_0x5443c7);}module[_0xb759('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index b6eaf6e..4b1d62b 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 _0x92bc=['[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','notificationId','STOP','TIMEOUT','exports','lodash','uuid','./util','squeue','queue','realtime','push','handleRun','handleTimeout','bind','drained','prototype','handleDrained','isNil','Agents','length','agents','info','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','showNotification','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92bc,0x106));var _0xc92b=function(_0x28348e,_0x21b3af){_0x28348e=_0x28348e-0x0;var _0x382058=_0x92bc[_0x28348e];return _0x382058;};'use strict';var _=require(_0xc92b('0x0'));var uuid=require(_0xc92b('0x1'));var util=require(_0xc92b('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x43af72,_0x28bc3a,_0x35903f,_0x1d7812){this['notificationId']=uuid['v4']();this[_0xc92b('0x3')]=_0x43af72;this[_0xc92b('0x4')]=_0x28bc3a;this[_0xc92b('0x5')]=_0x35903f;this['routing']=_0x1d7812;this['squeue'][_0xc92b('0x6')](this[_0xc92b('0x7')]['bind'](this),this[_0xc92b('0x8')][_0xc92b('0x9')](this));this[_0xc92b('0x3')]['on']('timeout',this[_0xc92b('0x8')]['bind'](this));this['squeue']['on'](_0xc92b('0xa'),this['handleDrained'][_0xc92b('0x9')](this));};Beepall[_0xc92b('0xb')][_0xc92b('0x6')]=function(){this[_0xc92b('0x3')][_0xc92b('0x6')](this[_0xc92b('0x7')][_0xc92b('0x9')](this),this[_0xc92b('0x8')][_0xc92b('0x9')](this));};Beepall[_0xc92b('0xb')][_0xc92b('0xc')]=function(_0x441b3e){this[_0xc92b('0x8')](!![]);};Beepall[_0xc92b('0xb')]['handleRun']=function(_0x3980f4){var _0x208570=!![];if(!_['isNil'](this[_0xc92b('0x4')])&&!_[_0xc92b('0xd')](this[_0xc92b('0x4')][_0xc92b('0xe')])&&this[_0xc92b('0x4')][_0xc92b('0xe')][_0xc92b('0xf')]>0x0){for(var _0x5d52fc=0x0,_0x72a905;_0x5d52fc0x0){for(var _0x64c62a=0x0,_0x15ebec;_0x64c62a0x0&&_0x18807b[_0x886b6+_0x511e('0x20')]>=_0x18807b[_0x886b6+_0x511e('0x21')]){writeLog(_0xaea29d,_0x18807b,_0x886b6[_0x511e('0x22')]()+_0x511e('0x23'));return![];}}return!![];};exports[_0x511e('0x24')]=function(_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d){return sendNotification(!![],_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d);};exports[_0x511e('0x25')]=function(_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f){return sendNotification(![],_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x0424=['localhost','socket.io-emitter','format','user:%s','name','emit','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','../utils','mustache','ioredis','../../../../../config/environment','routing','redis'];(function(_0x57b472,_0x3def61){var _0x1dc44e=function(_0x3d337b){while(--_0x3d337b){_0x57b472['push'](_0x57b472['shift']());}};_0x1dc44e(++_0x3def61);}(_0x0424,0x159));var _0x4042=function(_0x17158c,_0x58cb92){_0x17158c=_0x17158c-0x0;var _0x734f31=_0x0424[_0x17158c];return _0x734f31;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4042('0x0'));var Mustache=require(_0x4042('0x1'));var Redis=require(_0x4042('0x2'));var config=require(_0x4042('0x3'));var logger=require('../../../../../config/logger')(_0x4042('0x4'));config['redis']=_['defaults'](config[_0x4042('0x5')],{'host':_0x4042('0x6'),'port':0x18eb});var io=require(_0x4042('0x7'))(new Redis(config[_0x4042('0x5')]));function emit(_0x3abaf1,_0xa5310f,_0x10ec07){io['to'](_0x3abaf1)['emit'](_0xa5310f,_0x10ec07);}function sendNotification(_0x509772,_0x280cd6,_0x117143,_0x103e4a,_0x4b92d2,_0x341152){io['to'](util[_0x4042('0x8')](_0x4042('0x9'),_0x103e4a[_0x4042('0xa')]))[_0x4042('0xb')](_0x4042('0xc'),_0x103e4a);var _0x380aa0=_0x341152||{};var _0x3b5a73=_0x117143['split']('.');var _0x2c06ae={'uniqueid':_0x280cd6,'channel':_0x3b5a73[0x0],'id':_0x3b5a73[0x1],'title':_0x3b5a73[0x0]+_0x4042('0xd'),'interactionId':_0x3b5a73[0x2],'queue':_0x4b92d2?_0x4b92d2['name']:null,'sound':_0x380aa0[_0x4042('0xe')][_0x4042('0xf')],'shake':_0x380aa0[_0x4042('0xe')][_0x4042('0x10')]};try{if(!_0x380aa0[_0x4042('0x11')]){_0x380aa0[_0x4042('0x11')]={};}if(_0x4b92d2){_0x380aa0[_0x4042('0x11')]['queue']=_0x4b92d2;}else if(_0x380aa0[_0x4042('0x11')][_0x4042('0x12')]){delete _0x380aa0['body'][_0x4042('0x12')];}_0x2c06ae[_0x4042('0x13')]=utils[_0x4042('0x14')](_0x380aa0[_0x4042('0xe')][_0x4042('0x15')],_0x380aa0);}catch(_0x4532b7){_0x2c06ae[_0x4042('0x13')]=_0x4042('0x16');logger[_0x4042('0x17')](util['format'](_0x4042('0x18'),_0x280cd6,_0x4532b7['message']));}io['to'](util[_0x4042('0x8')]('user:%s',_0x103e4a[_0x4042('0xa')]))[_0x4042('0xb')](util[_0x4042('0x8')](_0x4042('0x19'),_0x509772?'save':_0x4042('0x1a')),_0x2c06ae);}function writeLog(_0x4561e3,_0x14d36c,_0xd1ddb){return logger['info'](util[_0x4042('0x8')](_0x4042('0x1b'),_0x4561e3,_0x14d36c[_0x4042('0xa')],_0xd1ddb));}exports[_0x4042('0x1c')]=function(_0x352631,_0x548093,_0x1f9d4a,_0x6d12a5){if(_0x548093['busy']){writeLog(_0x352631,_0x548093,_0x4042('0x1d'));return![];}if(!_0x548093['online']){writeLog(_0x352631,_0x548093,_0x4042('0x1e'));return![];}if(_0x548093[_0x1f9d4a+_0x4042('0x1f')]){writeLog(_0x352631,_0x548093,_0x4042('0x20'));return![];}if(_0x6d12a5&&_0x548093['hasOwnProperty'](_0x1f9d4a+_0x4042('0x21'))&&_0x548093[_0x4042('0x22')](_0x1f9d4a+_0x4042('0x23'))){if(_0x548093[_0x1f9d4a+_0x4042('0x21')]>0x0&&_0x548093[_0x1f9d4a+_0x4042('0x23')]>=_0x548093[_0x1f9d4a+'Capacity']){writeLog(_0x352631,_0x548093,_0x1f9d4a['toUpperCase']()+_0x4042('0x24'));return![];}}return!![];};exports[_0x4042('0x25')]=function(_0x26542c,_0x3e5c02,_0x332fe3,_0x473a0d,_0x5eb84b){return sendNotification(!![],_0x26542c,_0x3e5c02,_0x332fe3,_0x473a0d,_0x5eb84b);};exports[_0x4042('0x26')]=function(_0x1e9bd7,_0x4a6a6e,_0xae26c2,_0x89e16,_0xe924fe){return sendNotification(![],_0x1e9bd7,_0x4a6a6e,_0xae26c2,_0x89e16,_0xe924fe);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 71c944b..4831069 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 _0x9cbf=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x262269,_0xf179b4){var _0xbf60c9=function(_0x8554d6){while(--_0x8554d6){_0x262269['push'](_0x262269['shift']());}};_0xbf60c9(++_0xf179b4);}(_0x9cbf,0xad));var _0xf9cb=function(_0x535751,_0x4cc7bd){_0x535751=_0x535751-0x0;var _0x1a8933=_0x9cbf[_0x535751];return _0x1a8933;};'use strict';var schema=require(_0xf9cb('0x0'));var sh=require(_0xf9cb('0x1'));var _=require(_0xf9cb('0x2'));var utils=require(_0xf9cb('0x3'));var logger=require(_0xf9cb('0x4'))(_0xf9cb('0x5'));var system=schema({'command':{'type':_0xf9cb('0x6'),'required':!![],'message':_0xf9cb('0x7')}});exports[_0xf9cb('0x8')]=function(_0x11c3e0,_0x28667a){return function(_0x282d91){try{var _0x2e0647={'command':_0x28667a[0x0]};var _0x5072d8=system[_0xf9cb('0x0')](_0x2e0647,{'typecast':!![]});if(_0x5072d8[_0xf9cb('0x9')]){logger[_0xf9cb('0xa')](_0xf9cb('0xb'),_0x11c3e0,_[_0xf9cb('0xc')](_0x5072d8,_0xf9cb('0xd'))[_0xf9cb('0xe')](',\x20'));logger[_0xf9cb('0xf')](_0xf9cb('0x10'),_0x11c3e0);_0x282d91['next']();}else{var _0x218221=this;var _0x313b4d=utils[_0xf9cb('0x11')](_0x28667a[0x0],this);logger[_0xf9cb('0xf')](_0xf9cb('0x12'),_0x11c3e0,_0x313b4d);sh['exec'](_[_0xf9cb('0x13')](_0x313b4d),function(_0x116377,_0x371d20){logger[_0xf9cb('0xf')](_0xf9cb('0x14'),_0x11c3e0,_0x116377);if(_0x116377==0x0){var _0x41685d=_0x371d20[_0xf9cb('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xf9cb('0x16')](_0x28667a[0x1])||_[_0xf9cb('0x17')](_0x28667a[0x1])){logger['info'](_0xf9cb('0x18'),_0x11c3e0);_0x218221[_0xf9cb('0x19')][_0x28667a[0x1]]=_0x41685d;}else{logger[_0xf9cb('0xf')](_0xf9cb('0x1a'),_0x11c3e0,_0x28667a[0x1],_0x41685d);_0x218221[_0xf9cb('0x19')][_0x28667a[0x1]]=_0x41685d;}}_0x282d91[_0xf9cb('0x1b')]();});}}catch(_0x2dc65a){logger['error'](_0xf9cb('0xb'),_0x11c3e0,_[_0xf9cb('0x1c')](_0x2dc65a)?JSON[_0xf9cb('0x1d')](_0x2dc65a):_0x2dc65a);logger[_0xf9cb('0xf')](_0xf9cb('0x10'),_0x11c3e0);_0x282d91[_0xf9cb('0x1b')]();}};}; \ No newline at end of file +var _0xb8ef=['error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','next','getMustacheRender','exec','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable'];(function(_0x1df6fb,_0x167adb){var _0x2e2d0e=function(_0x2ed807){while(--_0x2ed807){_0x1df6fb['push'](_0x1df6fb['shift']());}};_0x2e2d0e(++_0x167adb);}(_0xb8ef,0x64));var _0xfb8e=function(_0x1a4c8e,_0x398948){_0x1a4c8e=_0x1a4c8e-0x0;var _0x31b619=_0xb8ef[_0x1a4c8e];return _0x31b619;};'use strict';var schema=require(_0xfb8e('0x0'));var sh=require('shelljs');var _=require(_0xfb8e('0x1'));var utils=require(_0xfb8e('0x2'));var logger=require(_0xfb8e('0x3'))(_0xfb8e('0x4'));var system=schema({'command':{'type':_0xfb8e('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xfb8e('0x6')]=function(_0x348ef1,_0x1d4de7){return function(_0x26219a){try{var _0x217a11={'command':_0x1d4de7[0x0]};var _0x460c83=system[_0xfb8e('0x0')](_0x217a11,{'typecast':!![]});if(_0x460c83[_0xfb8e('0x7')]){logger['error'](_0xfb8e('0x8'),_0x348ef1,_[_0xfb8e('0x9')](_0x460c83,_0xfb8e('0xa'))[_0xfb8e('0xb')](',\x20'));logger[_0xfb8e('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x348ef1);_0x26219a[_0xfb8e('0xd')]();}else{var _0x24aa82=this;var _0x32bdb1=utils[_0xfb8e('0xe')](_0x1d4de7[0x0],this);logger[_0xfb8e('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x348ef1,_0x32bdb1);sh[_0xfb8e('0xf')](_[_0xfb8e('0x10')](_0x32bdb1),function(_0x1b00a1,_0x3a7ca6){logger[_0xfb8e('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x348ef1,_0x1b00a1);if(_0x1b00a1==0x0){var _0x4a0a1e=_0x3a7ca6[_0xfb8e('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xfb8e('0x12')](_0x1d4de7[0x1])||_['isEmpty'](_0x1d4de7[0x1])){logger['info'](_0xfb8e('0x13'),_0x348ef1);_0x24aa82['body'][_0x1d4de7[0x1]]=_0x4a0a1e;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x348ef1,_0x1d4de7[0x1],_0x4a0a1e);_0x24aa82['body'][_0x1d4de7[0x1]]=_0x4a0a1e;}}_0x26219a['next']();});}}catch(_0x5eeb79){logger[_0xfb8e('0x14')](_0xfb8e('0x8'),_0x348ef1,_[_0xfb8e('0x15')](_0x5eeb79)?JSON[_0xfb8e('0x16')](_0x5eeb79):_0x5eeb79);logger[_0xfb8e('0xc')](_0xfb8e('0x17'),_0x348ef1);_0x26219a[_0xfb8e('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 8244da0..8704010 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 _0x3b07=['../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','error','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3b07,0x1d6));var _0x73b0=function(_0x55d4a0,_0x5165fe){_0x55d4a0=_0x55d4a0-0x0;var _0x282894=_0x3b07[_0x55d4a0];return _0x282894;};'use strict';var schema=require(_0x73b0('0x0'));var _=require(_0x73b0('0x1'));var rpc={'chatInteraction':require(_0x73b0('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x73b0('0x3')),'mailInteraction':require(_0x73b0('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x73b0('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x73b0('0x6'),'required':!![],'message':_0x73b0('0x7')}});exports[_0x73b0('0x8')]=function(_0x31d41e,_0x9ad534,_0x21a677,_0x53f564){return function(_0x44d152){try{var _0x38168d={'tag':_0x9ad534[0x0]};var _0x12b013=tag[_0x73b0('0x0')](_0x38168d,{'typecast':!![]});if(_0x12b013['length']){logger['error'](_0x73b0('0x9'),_0x31d41e,_[_0x73b0('0xa')](_0x12b013,_0x73b0('0xb'))[_0x73b0('0xc')](',\x20'));logger[_0x73b0('0xd')](_0x73b0('0xe'),_0x31d41e);_0x44d152[_0x73b0('0xf')]();}else{var _0x260405={'ids':[_0x9ad534[0x0]]};if(rpc[_0x53f564[_0x73b0('0x10')]+_0x73b0('0x11')]){rpc[_0x53f564[_0x73b0('0x10')]+_0x73b0('0x11')][_0x73b0('0x12')](_0x53f564[_0x73b0('0x13')]['id'],_0x260405)[_0x73b0('0x14')](function(_0x2b62bb){logger[_0x73b0('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x31d41e,_0x9ad534[0x1],_0x53f564['channel'],_0x53f564['interaction']['id']);})['catch'](function(_0x56a116){logger[_0x73b0('0x15')](_0x73b0('0x9'),_0x31d41e,JSON[_0x73b0('0x16')](_0x56a116));logger[_0x73b0('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x31d41e);})[_0x73b0('0x17')](function(){_0x44d152[_0x73b0('0xf')]();});}}}catch(_0x174e98){logger[_0x73b0('0x15')](_0x73b0('0x9'),_0x31d41e,_[_0x73b0('0x18')](_0x174e98)?JSON[_0x73b0('0x16')](_0x174e98):_0x174e98);logger[_0x73b0('0xd')](_0x73b0('0xe'),_0x31d41e);_0x44d152[_0x73b0('0xf')]();}};}; \ No newline at end of file +var _0x031d=['validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally'];(function(_0x562bcf,_0x472cc8){var _0x4cf05f=function(_0x43aff0){while(--_0x43aff0){_0x562bcf['push'](_0x562bcf['shift']());}};_0x4cf05f(++_0x472cc8);}(_0x031d,0x1e6));var _0xd031=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x031d[_0x2be8c2];return _0x97f531;};'use strict';var schema=require(_0xd031('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xd031('0x1')),'openchannelInteraction':require(_0xd031('0x2')),'smsInteraction':require(_0xd031('0x3')),'mailInteraction':require(_0xd031('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd031('0x5'))};var logger=require('../../../../config/logger')(_0xd031('0x6'));var tag=schema({'tag':{'type':_0xd031('0x7'),'required':!![],'message':_0xd031('0x8')}});exports['consequence']=function(_0x3a0313,_0x52d5a9,_0x5ef84c,_0x1c03e0){return function(_0x1c3911){try{var _0x1c0da2={'tag':_0x52d5a9[0x0]};var _0x1bbd7d=tag[_0xd031('0x0')](_0x1c0da2,{'typecast':!![]});if(_0x1bbd7d[_0xd031('0x9')]){logger[_0xd031('0xa')]('[%s][TAG]\x20%s',_0x3a0313,_[_0xd031('0xb')](_0x1bbd7d,_0xd031('0xc'))[_0xd031('0xd')](',\x20'));logger[_0xd031('0xe')](_0xd031('0xf'),_0x3a0313);_0x1c3911[_0xd031('0x10')]();}else{var _0x5720e0={'ids':[_0x52d5a9[0x0]]};if(rpc[_0x1c03e0[_0xd031('0x11')]+_0xd031('0x12')]){rpc[_0x1c03e0[_0xd031('0x11')]+_0xd031('0x12')][_0xd031('0x13')](_0x1c03e0[_0xd031('0x14')]['id'],_0x5720e0)[_0xd031('0x15')](function(_0x5e7af2){logger['info'](_0xd031('0x16'),_0x3a0313,_0x52d5a9[0x1],_0x1c03e0[_0xd031('0x11')],_0x1c03e0[_0xd031('0x14')]['id']);})[_0xd031('0x17')](function(_0x492902){logger[_0xd031('0xa')](_0xd031('0x18'),_0x3a0313,JSON[_0xd031('0x19')](_0x492902));logger['info'](_0xd031('0xf'),_0x3a0313);})[_0xd031('0x1a')](function(){_0x1c3911['next']();});}}}catch(_0x329441){logger[_0xd031('0xa')](_0xd031('0x18'),_0x3a0313,_['isObject'](_0x329441)?JSON['stringify'](_0x329441):_0x329441);logger[_0xd031('0xe')](_0xd031('0xf'),_0x3a0313);_0x1c3911[_0xd031('0x10')]();}};}; \ 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 6825c8f..d597bb0 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4b1239,_0x5cbd3a){var _0x56ffd4=function(_0x45b4ba){while(--_0x45b4ba){_0x4b1239['push'](_0x4b1239['shift']());}};_0x56ffd4(++_0x5cbd3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5293fa,_0x24533b){var _0x8163b1=function(_0x575e85){while(--_0x575e85){_0x5293fa['push'](_0x5293fa['shift']());}};_0x8163b1(++_0x24533b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 f4e26f0..fe7b90c 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 _0x31a9=['%s:%s:%s','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId'];(function(_0x41217c,_0x190555){var _0x1cce05=function(_0x41f2c7){while(--_0x41f2c7){_0x41217c['push'](_0x41217c['shift']());}};_0x1cce05(++_0x190555);}(_0x31a9,0xff));var _0x931a=function(_0x11db48,_0x363415){_0x11db48=_0x11db48-0x0;var _0x2cc224=_0x31a9[_0x11db48];return _0x2cc224;};'use strict';var _=require(_0x931a('0x0'));var util=require('util');var path=require(_0x931a('0x1'));var fs=require('fs');var jayson=require(_0x931a('0x2'));var BPromise=require(_0x931a('0x3'));var uuid=require(_0x931a('0x4'));var config=require(_0x931a('0x5'));var logger=require(_0x931a('0x6'))(_0x931a('0x7'));var rpc={'openchannelQueueReport':require(_0x931a('0x8')),'mailQueueReport':require(_0x931a('0x9')),'chatQueueReport':require(_0x931a('0xa')),'smsQueueReport':require(_0x931a('0xb')),'faxQueueReport':require(_0x931a('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x12f364,_0x283cda,_0x27c5fe){return util[_0x931a('0xd')](_0x931a('0xe'),_0x12f364,_0x283cda||0x0,_0x27c5fe||0x0);}function getIntervals(_0x40cbd7,_0x4207d7){var _0xaa1f2f=[];if(!_['isNil'](_0x4207d7[_0x931a('0xf')])&&!_[_0x931a('0x10')](_0x40cbd7[_0x4207d7[_0x931a('0xf')]])&&!_[_0x931a('0x10')](_0x40cbd7[_0x4207d7['IntervalId']][_0x931a('0x11')])){_0xaa1f2f=_['map'](_0x40cbd7[_0x4207d7[_0x931a('0xf')]]['Intervals'],_0x931a('0x12'));}else if(!_[_0x931a('0x10')](_0x4207d7['interval'])){_0xaa1f2f=[_0x4207d7[_0x931a('0x12')]];}return _0xaa1f2f;}exports[_0x931a('0x13')]=function(_0x330f91){_0x330f91[_0x931a('0x14')]={};return new BPromise(function(_0x20cf1b,_0x5f1bb0){var _0x135f45={'Start':function(_0x57df62){var _0x550c8a=this;return new Promise(function(_0x2907df,_0x15685d){if(_0x57df62){try{var _0x23a2c5=[];var _0x5f14ae=getId(_0x57df62[_0x931a('0x15')],_0x57df62[_0x931a('0x16')]?_0x57df62['message']['id']:0x0,_0x57df62[_0x931a('0x17')]?_0x57df62[_0x931a('0x17')]['id']:0x0);if(_0x57df62['applications']&&_[_0x931a('0x18')](_0x57df62[_0x931a('0x19')])&&_0x57df62['applications'][_0x931a('0x1a')]){for(var _0x1d6640=0x0;_0x1d6640<_0x57df62['applications'][_0x931a('0x1a')];_0x1d6640+=0x1){var _0x12a162=_0x57df62[_0x931a('0x19')][_0x1d6640];if(fs['existsSync'](path[_0x931a('0x1b')](__dirname,_0x931a('0x19'),_0x12a162[_0x931a('0x1c')]+_0x931a('0x1d')))){var _0x28ad59=[];switch(_0x12a162[_0x931a('0x1c')][_0x931a('0x1e')]()){case _0x931a('0x1f'):var _0x21b65a=_0x12a162['appdata'][_0x931a('0x20')](',');if(_0x57df62[_0x931a('0x15')]===_0x931a('0x21')){_0x28ad59[_0x931a('0x22')](_0x21b65a[0x0]);_0x28ad59[_0x931a('0x22')](_0x21b65a[0x1]);_0x28ad59[_0x931a('0x22')](_0x21b65a[_0x931a('0x23')](0x2,_0x21b65a['length'])[_0x931a('0x1b')](','));}else{_0x28ad59['push'](_0x21b65a[0x0]);_0x28ad59[_0x931a('0x22')](_0x21b65a['slice'](0x1,_0x21b65a[_0x931a('0x1a')])['join'](','));}break;case _0x931a('0x24'):var _0x5225cd=_0x12a162[_0x931a('0x25')]['split'](',');_0x28ad59[_0x931a('0x22')](_0x5225cd[0x0]);_0x28ad59['push'](_0x5225cd[0x1]);_0x28ad59['push'](_0x5225cd[_0x931a('0x23')](0x2,_0x5225cd[_0x931a('0x1a')])[_0x931a('0x1b')](','));break;case _0x931a('0x26'):var _0x4b9430=_0x12a162[_0x931a('0x25')][_0x931a('0x20')](',');_0x28ad59[_0x931a('0x22')](_0x4b9430[0x0]);_0x28ad59['push'](_0x4b9430[0x1]);_0x28ad59[_0x931a('0x22')](_0x4b9430[0x2]);_0x28ad59['push'](_0x4b9430[0x3]);_0x28ad59[_0x931a('0x22')](_0x4b9430['slice'](0x4,_0x4b9430[_0x931a('0x1a')])[_0x931a('0x1b')](','));break;case _0x931a('0x27'):var _0x3fc979=_0x12a162[_0x931a('0x25')][_0x931a('0x20')](',');_0x28ad59[_0x931a('0x22')](_0x3fc979[0x0]);_0x28ad59[_0x931a('0x22')](_0x3fc979[0x1]);_0x28ad59[_0x931a('0x22')](_0x3fc979[0x2]);_0x28ad59[_0x931a('0x22')](_0x3fc979[0x3]);_0x28ad59[_0x931a('0x22')](_0x3fc979['slice'](0x4,_0x3fc979[_0x931a('0x1a')])[_0x931a('0x1b')](','));break;case'message':_0x28ad59['push'](_0x12a162[_0x931a('0x25')]);break;case _0x931a('0x28'):_0x28ad59[_0x931a('0x22')](_0x12a162[_0x931a('0x29')]);_0x28ad59[_0x931a('0x22')](_0x12a162[_0x931a('0x25')]);break;default:_0x28ad59=_[_0x931a('0x10')](_0x12a162[_0x931a('0x25')])?[]:_0x12a162[_0x931a('0x25')]['split'](',');}var _0x272409={'id':util[_0x931a('0xd')](_0x931a('0x2a'),_0x5f14ae,_0x12a162['id'],_0x12a162[_0x931a('0x1c')]),'condition':require('./interval')[_0x931a('0x2b')](_0x5f14ae,getIntervals(_0x330f91['intervals'],_0x12a162),_0x330f91),'consequence':require(_0x931a('0x2c')+_0x12a162['app'])[_0x931a('0x2d')](_0x5f14ae,_0x28ad59,_0x330f91,_0x57df62),'p':_0x12a162[_0x931a('0x2e')]||0x0};logger[_0x931a('0x2f')](_0x931a('0x30'),_0x272409['id'],_0x931a('0x31'),getIntervals(_0x330f91[_0x931a('0x32')],_0x12a162)[_0x931a('0x1b')](_0x931a('0x33')));_0x23a2c5[_0x931a('0x22')](_0x272409);}else{logger[_0x931a('0x34')](_0x931a('0x35'),path[_0x931a('0x1b')](__dirname,_0x931a('0x19'),_0x12a162[_0x931a('0x1c')]+_0x931a('0x1d')));}}_0x330f91[_0x931a('0x14')][_0x5f14ae]=new RuleEngine(_0x23a2c5);_0x330f91[_0x931a('0x14')][_0x5f14ae][_0x931a('0x36')](_0x57df62,function(_0x15e3f7){logger['info'](_0x931a('0x37'),JSON[_0x931a('0x38')](_0x15e3f7[_0x931a('0x39')]));if(_0x330f91[_0x931a('0x14')][_0x5f14ae]){_0x330f91[_0x931a('0x14')][_0x5f14ae][_0x931a('0x3a')]('complete');}});return _0x2907df({'code':0xc8,'message':_0x57df62});}else{logger[_0x931a('0x2f')]('No\x20applications\x20to\x20execute');return _0x2907df({'code':0xc8,'message':_0x57df62});}}catch(_0x3f25e5){logger[_0x931a('0x34')](_0x3f25e5[_0x931a('0x3b')]);return _0x15685d(_0x550c8a['error'](0x1f4,_0x3f25e5));}}return _0x15685d(_0x931a('0x3c'));});},'AcceptMessage':function(_0x36f367){var _0x58fff9=this;return new Promise(function(_0x100a96,_0x96723e){if(_0x36f367[_0x931a('0x3d')]&&_0x36f367['agent']['id']){if(_0x330f91['agents'][_0x36f367['agent']['id']]){_0x330f91[_0x931a('0x3e')][_0x36f367[_0x931a('0x3d')]['id']][_0x931a('0x3f')]=![];_0x330f91[_0x931a('0x3e')][_0x36f367[_0x931a('0x3d')]['id']][_0x931a('0x40')]=undefined;}}if(_0x36f367[_0x931a('0x16')]&&_0x36f367[_0x931a('0x16')]['id']){try{var _0x479be4=getId(_0x36f367[_0x931a('0x15')],_0x36f367['message']?_0x36f367[_0x931a('0x16')]['id']:0x0,_0x36f367['interaction']?_0x36f367[_0x931a('0x17')]['id']:0x0);if(_0x330f91[_0x931a('0x14')][_0x479be4]){_0x330f91[_0x931a('0x14')][_0x479be4][_0x931a('0x3a')](_0x931a('0x41'));if(rpc[_0x36f367[_0x931a('0x15')]+_0x931a('0x42')]){rpc[_0x36f367[_0x931a('0x15')]+_0x931a('0x42')][_0x931a('0x43')](_0x479be4,{'UserId':_0x36f367[_0x931a('0x16')][_0x931a('0x44')]})[_0x931a('0x45')](function(_0x465de6){logger[_0x931a('0x34')](_0x931a('0x46'));});}}return _0x100a96({'code':0xc8,'message':_0x36f367});}catch(_0x241a1a){logger[_0x931a('0x34')](_0x241a1a[_0x931a('0x3b')]);return _0x96723e(_0x58fff9[_0x931a('0x34')](0x1f4,_0x241a1a));}}logger['error'](_0x931a('0x47'));return _0x96723e(_0x58fff9[_0x931a('0x34')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x568919){var _0x3f6c53=this;return new Promise(function(_0x18f640,_0x414bbe){if(_0x568919[_0x931a('0x3d')]&&_0x568919[_0x931a('0x3d')]['id']){try{if(_0x330f91[_0x931a('0x3e')][_0x568919['agent']['id']]){_0x330f91[_0x931a('0x3e')][_0x568919[_0x931a('0x3d')]['id']][_0x931a('0x3f')]=![];_0x330f91['agents'][_0x568919[_0x931a('0x3d')]['id']][_0x931a('0x40')]=undefined;}return _0x18f640({'code':0xc8,'message':_0x568919});}catch(_0x4fae69){logger[_0x931a('0x34')](_0x4fae69[_0x931a('0x3b')]);return _0x414bbe(_0x3f6c53[_0x931a('0x34')](0x1f4,_0x4fae69));}}logger[_0x931a('0x34')](_0x931a('0x47'));return _0x414bbe(_0x3f6c53[_0x931a('0x34')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x1c3ec5){var _0x16e30b=this;return new Promise(function(_0xcf3761,_0x3ab356){if(_0x1c3ec5['channel']&&_0x1c3ec5[_0x931a('0x17')]&&_0x1c3ec5[_0x931a('0x17')]['id']){try{var _0xa60b2f=getId(_0x1c3ec5['channel'],_0x1c3ec5['message']?_0x1c3ec5[_0x931a('0x16')]['id']:0x0,_0x1c3ec5[_0x931a('0x17')]?_0x1c3ec5[_0x931a('0x17')]['id']:0x0);if(_0x330f91[_0x931a('0x14')][_0xa60b2f]){_0x330f91[_0x931a('0x14')][_0xa60b2f]['emit'](_0x931a('0x41'));}return _0xcf3761({'code':0xc8,'message':_0x1c3ec5});}catch(_0x13d933){logger[_0x931a('0x34')](_0x13d933[_0x931a('0x3b')]);return _0x3ab356(_0x16e30b[_0x931a('0x34')](0x1f4,_0x13d933));}}logger[_0x931a('0x34')](_0x931a('0x47'));return _0x3ab356(_0x16e30b['error'](0x1f4,_0x931a('0x47')));});},'AgentCapacity':function(_0x149ad1){var _0x3acc3e=this;return new Promise(function(_0x137a19,_0x2f8274){if(_0x330f91['agents'][_0x931a('0x48')](_0x149ad1['id'])){for(var _0x5abb85 in _0x149ad1[_0x931a('0x49')]){if(_0x149ad1[_0x931a('0x49')][_0x931a('0x48')](_0x5abb85)){if(_0x330f91['agents'][_0x149ad1['id']]['hasOwnProperty'](_0x5abb85+_0x931a('0x4a'))){_0x330f91[_0x931a('0x3e')][_0x149ad1['id']][_0x5abb85+'CurrentCapacity']=parseInt(_0x149ad1[_0x931a('0x49')][_0x5abb85],0xa);}}}_0x330f91['agents'][_0x149ad1['id']][_0x931a('0x4b')]();return _0x137a19({'code':0xc8,'message':_0x330f91['agents'][_0x149ad1['id']]});}else{return _0x2f8274(_0x3acc3e[_0x931a('0x34')](0x1f4,_0x931a('0x4c')));}});},'Agents':function(_0x23b537){return new Promise(function(_0x19bcc8,_0x3962f4){var _0x5e3179=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x3e')]);_0x19bcc8({'count':_0x5e3179[_0x931a('0x1a')],'rows':_0x5e3179});});},'ChatQueues':function(_0x43367b){return new Promise(function(_0x1a7986,_0x5d91ae){var _0x912400=[];for(var _0x21a531 in _0x330f91['chatQueues']){if(_0x330f91[_0x931a('0x4e')][_0x931a('0x48')](_0x21a531)){var _0x1dda5e=_0x330f91[_0x931a('0x4e')][_0x21a531];var _0x2800da={'id':_0x1dda5e['id'],'available':_0x1dda5e[_0x931a('0x4f')],'loggedIn':_0x1dda5e[_0x931a('0x50')],'name':_0x1dda5e[_0x931a('0x51')],'paused':_0x1dda5e['paused'],'waiting':_0x1dda5e[_0x931a('0x52')]};_0x912400['push'](_0x2800da);}}_0x1a7986({'count':_0x912400[_0x931a('0x1a')],'rows':_0x912400});});},'MailQueues':function(_0x4e7398){return new Promise(function(_0x31849a,_0x3207c4){var _0x22e027=[];for(var _0x1e34d0 in _0x330f91[_0x931a('0x53')]){if(_0x330f91[_0x931a('0x53')][_0x931a('0x48')](_0x1e34d0)){var _0x2077f9=_0x330f91[_0x931a('0x53')][_0x1e34d0];var _0x141172={'id':_0x2077f9['id'],'available':_0x2077f9[_0x931a('0x4f')],'loggedIn':_0x2077f9[_0x931a('0x50')],'name':_0x2077f9[_0x931a('0x51')],'paused':_0x2077f9[_0x931a('0x54')],'waiting':_0x2077f9[_0x931a('0x52')]};_0x22e027[_0x931a('0x22')](_0x141172);}}_0x31849a({'count':_0x22e027[_0x931a('0x1a')],'rows':_0x22e027});});},'OpenchannelQueues':function(_0x114fa4){return new Promise(function(_0x39eb2b,_0xa54e70){var _0x100a27=[];for(var _0x362e57 in _0x330f91[_0x931a('0x55')]){if(_0x330f91[_0x931a('0x55')][_0x931a('0x48')](_0x362e57)){var _0x5ee30b=_0x330f91[_0x931a('0x55')][_0x362e57];var _0x7b3145={'id':_0x5ee30b['id'],'available':_0x5ee30b[_0x931a('0x4f')],'loggedIn':_0x5ee30b[_0x931a('0x50')],'name':_0x5ee30b[_0x931a('0x51')],'paused':_0x5ee30b[_0x931a('0x54')],'waiting':_0x5ee30b[_0x931a('0x52')]};_0x100a27[_0x931a('0x22')](_0x7b3145);}}_0x39eb2b({'count':_0x100a27[_0x931a('0x1a')],'rows':_0x100a27});});},'SmsQueues':function(_0x3f50ff){return new Promise(function(_0x42a0ff,_0x199a6a){var _0x55a238=[];for(var _0x1b5b5d in _0x330f91['smsQueues']){if(_0x330f91[_0x931a('0x56')]['hasOwnProperty'](_0x1b5b5d)){var _0x489759=_0x330f91[_0x931a('0x56')][_0x1b5b5d];var _0x598ccd={'id':_0x489759['id'],'available':_0x489759['available'],'loggedIn':_0x489759[_0x931a('0x50')],'name':_0x489759[_0x931a('0x51')],'paused':_0x489759[_0x931a('0x54')],'waiting':_0x489759[_0x931a('0x52')]};_0x55a238['push'](_0x598ccd);}}_0x42a0ff({'count':_0x55a238[_0x931a('0x1a')],'rows':_0x55a238});});},'FaxQueues':function(_0x18662b){return new Promise(function(_0x341454,_0x88cb81){var _0x2274c3=[];for(var _0x2762c4 in _0x330f91['faxQueues']){if(_0x330f91[_0x931a('0x57')][_0x931a('0x48')](_0x2762c4)){var _0x2b56dc=_0x330f91[_0x931a('0x57')][_0x2762c4];var _0x1e1a10={'id':_0x2b56dc['id'],'available':_0x2b56dc[_0x931a('0x4f')],'loggedIn':_0x2b56dc[_0x931a('0x50')],'name':_0x2b56dc['name'],'paused':_0x2b56dc['paused'],'waiting':_0x2b56dc[_0x931a('0x52')]};_0x2274c3[_0x931a('0x22')](_0x1e1a10);}}_0x341454({'count':_0x2274c3[_0x931a('0x1a')],'rows':_0x2274c3});});},'WhatsappQueues':function(_0x1a9ee7){return new Promise(function(_0x13f313,_0xe9750){var _0x2afe84=[];for(var _0x524653 in _0x330f91[_0x931a('0x58')]){if(_0x330f91[_0x931a('0x58')][_0x931a('0x48')](_0x524653)){var _0x3d2f63=_0x330f91[_0x931a('0x58')][_0x524653];var _0x55599f={'id':_0x3d2f63['id'],'available':_0x3d2f63['available'],'loggedIn':_0x3d2f63[_0x931a('0x50')],'name':_0x3d2f63[_0x931a('0x51')],'paused':_0x3d2f63[_0x931a('0x54')],'waiting':_0x3d2f63[_0x931a('0x52')]};_0x2afe84['push'](_0x55599f);}}_0x13f313({'count':_0x2afe84[_0x931a('0x1a')],'rows':_0x2afe84});});},'ChatQueuesWaitingInteractions':function(_0x5d9208){return new Promise(function(_0x4a529d,_0x6b6897){var _0x564112=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x59')]);_0x4a529d({'count':_0x564112[_0x931a('0x1a')],'rows':_0x564112});});},'MailQueuesWaitingInteractions':function(_0x1262ea){return new Promise(function(_0x3cba13,_0x340ce7){var _0x22c6ff=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x5a')]);_0x3cba13({'count':_0x22c6ff[_0x931a('0x1a')],'rows':_0x22c6ff});});},'OpenchannelQueuesWaitingInteractions':function(_0x310531){return new Promise(function(_0x72178f,_0x4a4498){var _0x4e969e=_['values'](_0x330f91['openchannelQueuesWaitingInteractions']);_0x72178f({'count':_0x4e969e[_0x931a('0x1a')],'rows':_0x4e969e});});},'SmsQueuesWaitingInteractions':function(_0x405ba9){return new Promise(function(_0x177d44,_0x3ab258){var _0x3abdcc=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x5b')]);_0x177d44({'count':_0x3abdcc['length'],'rows':_0x3abdcc});});},'FaxQueuesWaitingInteractions':function(_0x5241fd){return new Promise(function(_0x2c3566,_0x1e0bba){var _0x4e189c=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x5c')]);_0x2c3566({'count':_0x4e189c['length'],'rows':_0x4e189c});});},'WhatsappQueuesWaitingInteractions':function(_0x26c149){return new Promise(function(_0x35734a,_0x33df67){var _0x4a09ca=_[_0x931a('0x4d')](_0x330f91[_0x931a('0x5d')]);_0x35734a({'count':_0x4a09ca['length'],'rows':_0x4a09ca});});}};var _0x1bdcba=jayson[_0x931a('0x5e')](_0x135f45)[_0x931a('0x5f')]();_0x1bdcba['on']('error',function(_0x552513){logger[_0x931a('0x34')](JSON['stringify'](_0x552513));return _0x5f1bb0(_0x552513);});_0x1bdcba[_0x931a('0x13')](0x232c,_0x931a('0x60'),function(){console['log'](_0x931a('0x61'),0x232c);return _0x20cf1b(_0x931a('0x62')+0x232c);});});}; \ No newline at end of file +var _0xa8ea=['map','Intervals','interval','rules','channel','message','interaction','applications','length','join','app','.js','autoreply','appdata','push','slice','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','format','%s:%s:%s','condition','consequence','info','on\x20interval','intervals','\x20|\x20','error','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil','IntervalId'];(function(_0x36aff7,_0x2c9bd7){var _0x5ce338=function(_0x28b2d2){while(--_0x28b2d2){_0x36aff7['push'](_0x36aff7['shift']());}};_0x5ce338(++_0x2c9bd7);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x209372,_0x433298){_0x209372=_0x209372-0x0;var _0x4f0278=_0xa8ea[_0x209372];return _0x4f0278;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));var path=require(_0xaa8e('0x2'));var fs=require('fs');var jayson=require(_0xaa8e('0x3'));var BPromise=require('bluebird');var uuid=require(_0xaa8e('0x4'));var config=require(_0xaa8e('0x5'));var logger=require(_0xaa8e('0x6'))(_0xaa8e('0x7'));var rpc={'openchannelQueueReport':require(_0xaa8e('0x8')),'mailQueueReport':require(_0xaa8e('0x9')),'chatQueueReport':require(_0xaa8e('0xa')),'smsQueueReport':require(_0xaa8e('0xb')),'faxQueueReport':require(_0xaa8e('0xc')),'whatsappQueueReport':require(_0xaa8e('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3c1211,_0x17db7e,_0x4a987c){return util['format']('%s.%s.%s',_0x3c1211,_0x17db7e||0x0,_0x4a987c||0x0);}function getIntervals(_0x4c6b0a,_0x1c953b){var _0x57f7e6=[];if(!_[_0xaa8e('0xe')](_0x1c953b[_0xaa8e('0xf')])&&!_['isNil'](_0x4c6b0a[_0x1c953b['IntervalId']])&&!_[_0xaa8e('0xe')](_0x4c6b0a[_0x1c953b[_0xaa8e('0xf')]]['Intervals'])){_0x57f7e6=_[_0xaa8e('0x10')](_0x4c6b0a[_0x1c953b[_0xaa8e('0xf')]][_0xaa8e('0x11')],_0xaa8e('0x12'));}else if(!_[_0xaa8e('0xe')](_0x1c953b[_0xaa8e('0x12')])){_0x57f7e6=[_0x1c953b['interval']];}return _0x57f7e6;}exports['listen']=function(_0x33ff08){_0x33ff08[_0xaa8e('0x13')]={};return new BPromise(function(_0x4d6620,_0x1c94cf){var _0x3a41ec={'Start':function(_0x5ee3ec){var _0x593f44=this;return new Promise(function(_0xbee306,_0x36684b){if(_0x5ee3ec){try{var _0x315184=[];var _0x17bacc=getId(_0x5ee3ec[_0xaa8e('0x14')],_0x5ee3ec['message']?_0x5ee3ec[_0xaa8e('0x15')]['id']:0x0,_0x5ee3ec[_0xaa8e('0x16')]?_0x5ee3ec[_0xaa8e('0x16')]['id']:0x0);if(_0x5ee3ec[_0xaa8e('0x17')]&&_['isArray'](_0x5ee3ec[_0xaa8e('0x17')])&&_0x5ee3ec[_0xaa8e('0x17')][_0xaa8e('0x18')]){for(var _0x5e7224=0x0;_0x5e7224<_0x5ee3ec[_0xaa8e('0x17')][_0xaa8e('0x18')];_0x5e7224+=0x1){var _0x2a6dd7=_0x5ee3ec[_0xaa8e('0x17')][_0x5e7224];if(fs['existsSync'](path[_0xaa8e('0x19')](__dirname,_0xaa8e('0x17'),_0x2a6dd7[_0xaa8e('0x1a')]+_0xaa8e('0x1b')))){var _0x396181=[];switch(_0x2a6dd7[_0xaa8e('0x1a')]['toLowerCase']()){case _0xaa8e('0x1c'):var _0x240875=_0x2a6dd7[_0xaa8e('0x1d')]['split'](',');if(_0x5ee3ec[_0xaa8e('0x14')]==='mail'){_0x396181[_0xaa8e('0x1e')](_0x240875[0x0]);_0x396181[_0xaa8e('0x1e')](_0x240875[0x1]);_0x396181[_0xaa8e('0x1e')](_0x240875['slice'](0x2,_0x240875['length'])['join'](','));}else{_0x396181[_0xaa8e('0x1e')](_0x240875[0x0]);_0x396181['push'](_0x240875[_0xaa8e('0x1f')](0x1,_0x240875['length'])[_0xaa8e('0x19')](','));}break;case _0xaa8e('0x20'):var _0x4dc0af=_0x2a6dd7[_0xaa8e('0x1d')][_0xaa8e('0x21')](',');_0x396181['push'](_0x4dc0af[0x0]);_0x396181[_0xaa8e('0x1e')](_0x4dc0af[0x1]);_0x396181[_0xaa8e('0x1e')](_0x4dc0af[_0xaa8e('0x1f')](0x2,_0x4dc0af[_0xaa8e('0x18')])['join'](','));break;case _0xaa8e('0x22'):var _0x541d77=_0x2a6dd7[_0xaa8e('0x1d')][_0xaa8e('0x21')](',');_0x396181[_0xaa8e('0x1e')](_0x541d77[0x0]);_0x396181['push'](_0x541d77[0x1]);_0x396181[_0xaa8e('0x1e')](_0x541d77[0x2]);_0x396181[_0xaa8e('0x1e')](_0x541d77[0x3]);_0x396181[_0xaa8e('0x1e')](_0x541d77[_0xaa8e('0x1f')](0x4,_0x541d77[_0xaa8e('0x18')])[_0xaa8e('0x19')](','));break;case _0xaa8e('0x23'):var _0x760cb9=_0x2a6dd7['appdata'][_0xaa8e('0x21')](',');_0x396181[_0xaa8e('0x1e')](_0x760cb9[0x0]);_0x396181[_0xaa8e('0x1e')](_0x760cb9[0x1]);_0x396181[_0xaa8e('0x1e')](_0x760cb9[0x2]);_0x396181[_0xaa8e('0x1e')](_0x760cb9[0x3]);_0x396181[_0xaa8e('0x1e')](_0x760cb9[_0xaa8e('0x1f')](0x4,_0x760cb9[_0xaa8e('0x18')])[_0xaa8e('0x19')](','));break;case _0xaa8e('0x15'):_0x396181['push'](_0x2a6dd7[_0xaa8e('0x1d')]);break;case _0xaa8e('0x24'):_0x396181[_0xaa8e('0x1e')](_0x2a6dd7[_0xaa8e('0x25')]);_0x396181[_0xaa8e('0x1e')](_0x2a6dd7[_0xaa8e('0x1d')]);break;default:_0x396181=_[_0xaa8e('0xe')](_0x2a6dd7[_0xaa8e('0x1d')])?[]:_0x2a6dd7[_0xaa8e('0x1d')][_0xaa8e('0x21')](',');}var _0x3514ba={'id':util[_0xaa8e('0x26')](_0xaa8e('0x27'),_0x17bacc,_0x2a6dd7['id'],_0x2a6dd7[_0xaa8e('0x1a')]),'condition':require('./interval')[_0xaa8e('0x28')](_0x17bacc,getIntervals(_0x33ff08['intervals'],_0x2a6dd7),_0x33ff08),'consequence':require('./applications/'+_0x2a6dd7[_0xaa8e('0x1a')])[_0xaa8e('0x29')](_0x17bacc,_0x396181,_0x33ff08,_0x5ee3ec),'p':_0x2a6dd7['priority']||0x0};logger[_0xaa8e('0x2a')]('Push\x20new\x20rule',_0x3514ba['id'],_0xaa8e('0x2b'),getIntervals(_0x33ff08[_0xaa8e('0x2c')],_0x2a6dd7)[_0xaa8e('0x19')](_0xaa8e('0x2d')));_0x315184[_0xaa8e('0x1e')](_0x3514ba);}else{logger[_0xaa8e('0x2e')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0xaa8e('0x17'),_0x2a6dd7[_0xaa8e('0x1a')]+_0xaa8e('0x1b')));}}_0x33ff08[_0xaa8e('0x13')][_0x17bacc]=new RuleEngine(_0x315184);_0x33ff08[_0xaa8e('0x13')][_0x17bacc][_0xaa8e('0x2f')](_0x5ee3ec,function(_0x41edf4){logger[_0xaa8e('0x2a')]('Applications\x20executed',JSON[_0xaa8e('0x30')](_0x41edf4[_0xaa8e('0x31')]));if(_0x33ff08[_0xaa8e('0x13')][_0x17bacc]){_0x33ff08[_0xaa8e('0x13')][_0x17bacc][_0xaa8e('0x32')](_0xaa8e('0x33'));}});return _0xbee306({'code':0xc8,'message':_0x5ee3ec});}else{logger[_0xaa8e('0x2a')](_0xaa8e('0x34'));return _0xbee306({'code':0xc8,'message':_0x5ee3ec});}}catch(_0x419dea){logger[_0xaa8e('0x2e')](_0x419dea[_0xaa8e('0x35')]);return _0x36684b(_0x593f44[_0xaa8e('0x2e')](0x1f4,_0x419dea));}}return _0x36684b('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1cdb06){var _0x34525d=this;return new Promise(function(_0x1a047c,_0x2a3882){if(_0x1cdb06[_0xaa8e('0x36')]&&_0x1cdb06[_0xaa8e('0x36')]['id']){if(_0x33ff08[_0xaa8e('0x37')][_0x1cdb06[_0xaa8e('0x36')]['id']]){_0x33ff08[_0xaa8e('0x37')][_0x1cdb06['agent']['id']][_0xaa8e('0x38')]=![];_0x33ff08[_0xaa8e('0x37')][_0x1cdb06[_0xaa8e('0x36')]['id']][_0xaa8e('0x39')]=undefined;}}if(_0x1cdb06[_0xaa8e('0x15')]&&_0x1cdb06['message']['id']){try{var _0x1e7dd4=getId(_0x1cdb06[_0xaa8e('0x14')],_0x1cdb06[_0xaa8e('0x15')]?_0x1cdb06[_0xaa8e('0x15')]['id']:0x0,_0x1cdb06[_0xaa8e('0x16')]?_0x1cdb06[_0xaa8e('0x16')]['id']:0x0);if(_0x33ff08[_0xaa8e('0x13')][_0x1e7dd4]){_0x33ff08[_0xaa8e('0x13')][_0x1e7dd4][_0xaa8e('0x32')](_0xaa8e('0x3a'));if(rpc[_0x1cdb06[_0xaa8e('0x14')]+_0xaa8e('0x3b')]){rpc[_0x1cdb06[_0xaa8e('0x14')]+_0xaa8e('0x3b')][_0xaa8e('0x3c')](_0x1e7dd4,{'UserId':_0x1cdb06[_0xaa8e('0x15')]['UserId']})[_0xaa8e('0x3d')](function(_0x4555db){logger[_0xaa8e('0x2e')](_0xaa8e('0x3e'));});}}return _0x1a047c({'code':0xc8,'message':_0x1cdb06});}catch(_0x5a90e4){logger[_0xaa8e('0x2e')](_0x5a90e4[_0xaa8e('0x35')]);return _0x2a3882(_0x34525d[_0xaa8e('0x2e')](0x1f4,_0x5a90e4));}}logger[_0xaa8e('0x2e')]('message\x20is\x20empty');return _0x2a3882(_0x34525d[_0xaa8e('0x2e')](0x1f4,_0xaa8e('0x3f')));});},'RejectMessage':function(_0x26e918){var _0x441232=this;return new Promise(function(_0x5e9af3,_0x5bbb5c){if(_0x26e918['agent']&&_0x26e918[_0xaa8e('0x36')]['id']){try{if(_0x33ff08[_0xaa8e('0x37')][_0x26e918[_0xaa8e('0x36')]['id']]){_0x33ff08[_0xaa8e('0x37')][_0x26e918['agent']['id']][_0xaa8e('0x38')]=![];_0x33ff08[_0xaa8e('0x37')][_0x26e918[_0xaa8e('0x36')]['id']][_0xaa8e('0x39')]=undefined;}return _0x5e9af3({'code':0xc8,'message':_0x26e918});}catch(_0x261d8a){logger[_0xaa8e('0x2e')](_0x261d8a[_0xaa8e('0x35')]);return _0x5bbb5c(_0x441232[_0xaa8e('0x2e')](0x1f4,_0x261d8a));}}logger[_0xaa8e('0x2e')]('message\x20is\x20empty');return _0x5bbb5c(_0x441232[_0xaa8e('0x2e')](0x1f4,_0xaa8e('0x3f')));});},'AbandonInteraction':function(_0x298f51){var _0x4d6de6=this;return new Promise(function(_0xc92283,_0x53e603){if(_0x298f51[_0xaa8e('0x14')]&&_0x298f51[_0xaa8e('0x16')]&&_0x298f51['interaction']['id']){try{var _0x309b97=getId(_0x298f51[_0xaa8e('0x14')],_0x298f51[_0xaa8e('0x15')]?_0x298f51[_0xaa8e('0x15')]['id']:0x0,_0x298f51[_0xaa8e('0x16')]?_0x298f51[_0xaa8e('0x16')]['id']:0x0);if(_0x33ff08[_0xaa8e('0x13')][_0x309b97]){_0x33ff08[_0xaa8e('0x13')][_0x309b97][_0xaa8e('0x32')]('end');}return _0xc92283({'code':0xc8,'message':_0x298f51});}catch(_0x4a9b2d){logger[_0xaa8e('0x2e')](_0x4a9b2d[_0xaa8e('0x35')]);return _0x53e603(_0x4d6de6[_0xaa8e('0x2e')](0x1f4,_0x4a9b2d));}}logger[_0xaa8e('0x2e')](_0xaa8e('0x3f'));return _0x53e603(_0x4d6de6[_0xaa8e('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5a33a7){var _0x54ba2e=this;return new Promise(function(_0x4f2ac4,_0x238580){if(_0x33ff08['agents'][_0xaa8e('0x40')](_0x5a33a7['id'])){for(var _0x3ebabf in _0x5a33a7[_0xaa8e('0x41')]){if(_0x5a33a7['capacity'][_0xaa8e('0x40')](_0x3ebabf)){if(_0x33ff08['agents'][_0x5a33a7['id']][_0xaa8e('0x40')](_0x3ebabf+_0xaa8e('0x42'))){_0x33ff08['agents'][_0x5a33a7['id']][_0x3ebabf+_0xaa8e('0x42')]=parseInt(_0x5a33a7[_0xaa8e('0x41')][_0x3ebabf],0xa);}}}_0x33ff08[_0xaa8e('0x37')][_0x5a33a7['id']][_0xaa8e('0x43')]();return _0x4f2ac4({'code':0xc8,'message':_0x33ff08[_0xaa8e('0x37')][_0x5a33a7['id']]});}else{return _0x238580(_0x54ba2e[_0xaa8e('0x2e')](0x1f4,_0xaa8e('0x44')));}});},'Agents':function(_0x50b986){return new Promise(function(_0x5cc1e5,_0x113ad1){var _0x49b10d=_[_0xaa8e('0x45')](_0x33ff08[_0xaa8e('0x37')]);_0x5cc1e5({'count':_0x49b10d['length'],'rows':_0x49b10d});});},'ChatQueues':function(_0x20e7f1){return new Promise(function(_0x12b07c,_0x4c2b0d){var _0xbf4ce1=[];for(var _0x3b4a50 in _0x33ff08[_0xaa8e('0x46')]){if(_0x33ff08[_0xaa8e('0x46')][_0xaa8e('0x40')](_0x3b4a50)){var _0x914a2=_0x33ff08[_0xaa8e('0x46')][_0x3b4a50];var _0x14f79b={'id':_0x914a2['id'],'available':_0x914a2[_0xaa8e('0x47')],'loggedIn':_0x914a2[_0xaa8e('0x48')],'name':_0x914a2['name'],'paused':_0x914a2['paused'],'waiting':_0x914a2[_0xaa8e('0x49')]};_0xbf4ce1[_0xaa8e('0x1e')](_0x14f79b);}}_0x12b07c({'count':_0xbf4ce1[_0xaa8e('0x18')],'rows':_0xbf4ce1});});},'MailQueues':function(_0x474df1){return new Promise(function(_0x263ace,_0x103aa5){var _0x4182a8=[];for(var _0x5ccf0e in _0x33ff08[_0xaa8e('0x4a')]){if(_0x33ff08[_0xaa8e('0x4a')][_0xaa8e('0x40')](_0x5ccf0e)){var _0xfcfdf5=_0x33ff08[_0xaa8e('0x4a')][_0x5ccf0e];var _0x2bafc2={'id':_0xfcfdf5['id'],'available':_0xfcfdf5[_0xaa8e('0x47')],'loggedIn':_0xfcfdf5[_0xaa8e('0x48')],'name':_0xfcfdf5[_0xaa8e('0x4b')],'paused':_0xfcfdf5[_0xaa8e('0x4c')],'waiting':_0xfcfdf5[_0xaa8e('0x49')]};_0x4182a8[_0xaa8e('0x1e')](_0x2bafc2);}}_0x263ace({'count':_0x4182a8[_0xaa8e('0x18')],'rows':_0x4182a8});});},'OpenchannelQueues':function(_0x45595f){return new Promise(function(_0x2fe794,_0xefe637){var _0x367140=[];for(var _0x239f3b in _0x33ff08[_0xaa8e('0x4d')]){if(_0x33ff08[_0xaa8e('0x4d')][_0xaa8e('0x40')](_0x239f3b)){var _0x565ed6=_0x33ff08[_0xaa8e('0x4d')][_0x239f3b];var _0x1cae2e={'id':_0x565ed6['id'],'available':_0x565ed6[_0xaa8e('0x47')],'loggedIn':_0x565ed6[_0xaa8e('0x48')],'name':_0x565ed6[_0xaa8e('0x4b')],'paused':_0x565ed6[_0xaa8e('0x4c')],'waiting':_0x565ed6['waiting']};_0x367140[_0xaa8e('0x1e')](_0x1cae2e);}}_0x2fe794({'count':_0x367140[_0xaa8e('0x18')],'rows':_0x367140});});},'SmsQueues':function(_0x33d18e){return new Promise(function(_0x269d96,_0x2d5ad3){var _0x468dd1=[];for(var _0x2b81d0 in _0x33ff08[_0xaa8e('0x4e')]){if(_0x33ff08['smsQueues'][_0xaa8e('0x40')](_0x2b81d0)){var _0x284034=_0x33ff08['smsQueues'][_0x2b81d0];var _0x5555eb={'id':_0x284034['id'],'available':_0x284034[_0xaa8e('0x47')],'loggedIn':_0x284034[_0xaa8e('0x48')],'name':_0x284034[_0xaa8e('0x4b')],'paused':_0x284034[_0xaa8e('0x4c')],'waiting':_0x284034[_0xaa8e('0x49')]};_0x468dd1[_0xaa8e('0x1e')](_0x5555eb);}}_0x269d96({'count':_0x468dd1['length'],'rows':_0x468dd1});});},'FaxQueues':function(_0x7685cf){return new Promise(function(_0x1a2095,_0x13d822){var _0x12b9c8=[];for(var _0xb84274 in _0x33ff08[_0xaa8e('0x4f')]){if(_0x33ff08[_0xaa8e('0x4f')]['hasOwnProperty'](_0xb84274)){var _0x3f9b69=_0x33ff08['faxQueues'][_0xb84274];var _0x538433={'id':_0x3f9b69['id'],'available':_0x3f9b69[_0xaa8e('0x47')],'loggedIn':_0x3f9b69[_0xaa8e('0x48')],'name':_0x3f9b69[_0xaa8e('0x4b')],'paused':_0x3f9b69[_0xaa8e('0x4c')],'waiting':_0x3f9b69[_0xaa8e('0x49')]};_0x12b9c8[_0xaa8e('0x1e')](_0x538433);}}_0x1a2095({'count':_0x12b9c8['length'],'rows':_0x12b9c8});});},'WhatsappQueues':function(_0x13a1e4){return new Promise(function(_0x2e0684,_0x274ccd){var _0x33cdfc=[];for(var _0x10ab07 in _0x33ff08['whatsappQueues']){if(_0x33ff08[_0xaa8e('0x50')]['hasOwnProperty'](_0x10ab07)){var _0x4fb064=_0x33ff08[_0xaa8e('0x50')][_0x10ab07];var _0x1125d8={'id':_0x4fb064['id'],'available':_0x4fb064['available'],'loggedIn':_0x4fb064[_0xaa8e('0x48')],'name':_0x4fb064[_0xaa8e('0x4b')],'paused':_0x4fb064['paused'],'waiting':_0x4fb064[_0xaa8e('0x49')]};_0x33cdfc[_0xaa8e('0x1e')](_0x1125d8);}}_0x2e0684({'count':_0x33cdfc[_0xaa8e('0x18')],'rows':_0x33cdfc});});},'ChatQueuesWaitingInteractions':function(_0x36c907){return new Promise(function(_0x468012,_0xca5de7){var _0x494337=_[_0xaa8e('0x45')](_0x33ff08['chatQueuesWaitingInteractions']);_0x468012({'count':_0x494337['length'],'rows':_0x494337});});},'MailQueuesWaitingInteractions':function(_0x34d983){return new Promise(function(_0x240eb9,_0x2e8b12){var _0x38cb18=_[_0xaa8e('0x45')](_0x33ff08['mailQueuesWaitingInteractions']);_0x240eb9({'count':_0x38cb18[_0xaa8e('0x18')],'rows':_0x38cb18});});},'OpenchannelQueuesWaitingInteractions':function(_0x2d4497){return new Promise(function(_0x1bfac6,_0x58ea3a){var _0xf534af=_[_0xaa8e('0x45')](_0x33ff08['openchannelQueuesWaitingInteractions']);_0x1bfac6({'count':_0xf534af['length'],'rows':_0xf534af});});},'SmsQueuesWaitingInteractions':function(_0x398928){return new Promise(function(_0x5d3473,_0x41f9ae){var _0x3cbfb9=_[_0xaa8e('0x45')](_0x33ff08[_0xaa8e('0x51')]);_0x5d3473({'count':_0x3cbfb9[_0xaa8e('0x18')],'rows':_0x3cbfb9});});},'FaxQueuesWaitingInteractions':function(_0x345d7c){return new Promise(function(_0x5f309d,_0x5aab0e){var _0x3d5bc2=_[_0xaa8e('0x45')](_0x33ff08['faxQueuesWaitingInteractions']);_0x5f309d({'count':_0x3d5bc2[_0xaa8e('0x18')],'rows':_0x3d5bc2});});},'WhatsappQueuesWaitingInteractions':function(_0x4e1a47){return new Promise(function(_0x316c5f,_0x244e10){var _0x3122f7=_[_0xaa8e('0x45')](_0x33ff08[_0xaa8e('0x52')]);_0x316c5f({'count':_0x3122f7['length'],'rows':_0x3122f7});});}};var _0x38a0aa=jayson[_0xaa8e('0x53')](_0x3a41ec)[_0xaa8e('0x54')]();_0x38a0aa['on']('error',function(_0xe5f4e){logger[_0xaa8e('0x2e')](JSON[_0xaa8e('0x30')](_0xe5f4e));return _0x1c94cf(_0xe5f4e);});_0x38a0aa['listen'](0x232c,_0xaa8e('0x55'),function(){console[_0xaa8e('0x56')](_0xaa8e('0x57'),0x232c);return _0x4d6620(_0xaa8e('0x58')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 31a4710..bf9bb3d 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 _0x651e=['message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','catch','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','request','error'];(function(_0x452144,_0x170931){var _0x37f223=function(_0x32d7b8){while(--_0x32d7b8){_0x452144['push'](_0x452144['shift']());}};_0x37f223(++_0x170931);}(_0x651e,0x93));var _0xe651=function(_0x1cd31e,_0x48b34d){_0x1cd31e=_0x1cd31e-0x0;var _0x3318d5=_0x651e[_0x1cd31e];return _0x3318d5;};'use strict';var util=require(_0xe651('0x0'));var BPromise=require('bluebird');var jayson=require(_0xe651('0x1'));var _=require(_0xe651('0x2'));var logger=require(_0xe651('0x3'))(_0xe651('0x4'));var client=jayson[_0xe651('0x5')]['http']({'port':0x232a});function request(_0x290457,_0xd46791){return new BPromise(function(_0x27deb2,_0x35c486){return client[_0xe651('0x6')](_0x290457,_0xd46791)['then'](function(_0xe2f3a5){if(_0xe2f3a5['error']){return _0x35c486(_0xe2f3a5[_0xe651('0x7')][_0xe651('0x8')]);}else{return _0x27deb2(_0xe2f3a5[_0xe651('0x9')]);}})['catch'](function(_0xf591ef){return _0x35c486(_0xf591ef);});});}exports[_0xe651('0xa')]=function(_0x5bb4bd,_0x1e4698,_0x51bbe7){return function(_0x43848c){if(_0x51bbe7['rules']&&!_0x51bbe7[_0xe651('0xb')][_0x5bb4bd]){logger[_0xe651('0xc')](_0xe651('0xd'),_0x5bb4bd);return _0x43848c[_0xe651('0xe')]();}var _0x4521c5=[];for(var _0x38d83d=0x0;_0x38d83d<_0x1e4698[_0xe651('0xf')];_0x38d83d+=0x1){_0x4521c5[_0xe651('0x10')](request(_0xe651('0x11'),{'command':util[_0xe651('0x12')](_0xe651('0x13'),_0x1e4698[_0x38d83d])})['then'](function(_0x55ad23){return _0x55ad23&&_0x55ad23[_0xe651('0x8')]&&_0x55ad23['message']['indexOf'](_0xe651('0x14'))>=0x0?!![]:![];})[_0xe651('0x15')](function(_0x7c617d){logger[_0xe651('0x7')]('[%s][INTERVAL]\x20%s',_0x5bb4bd,_0x1e4698[_0x38d83d]);}));}BPromise[_0xe651('0x16')](_0x4521c5)[_0xe651('0x17')](function(_0x47849d){var _0x3b2767=_[_0xe651('0x18')](_0x47849d);logger[_0xe651('0xc')](_0xe651('0x19'),_0x5bb4bd,_0x1e4698[_0xe651('0x1a')](_0xe651('0x1b')),_0x3b2767);_0x43848c[_0xe651('0x1c')](_0x3b2767);})[_0xe651('0x15')](function(_0x84dcc6){console[_0xe651('0x1d')](_0x84dcc6);logger[_0xe651('0x7')](_0xe651('0x19'),_0x5bb4bd,_0x1e4698['join'](_0xe651('0x1b')),_0x84dcc6[_0xe651('0x1e')]);_0x43848c[_0xe651('0xe')]();});};}; \ No newline at end of file +var _0x21b3=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','then','error','message','result','catch'];(function(_0x53e3e8,_0x3d2c8c){var _0x26fe77=function(_0x1bd075){while(--_0x1bd075){_0x53e3e8['push'](_0x53e3e8['shift']());}};_0x26fe77(++_0x3d2c8c);}(_0x21b3,0x17a));var _0x321b=function(_0x5a4113,_0x466a19){_0x5a4113=_0x5a4113-0x0;var _0x50de17=_0x21b3[_0x5a4113];return _0x50de17;};'use strict';var util=require(_0x321b('0x0'));var BPromise=require(_0x321b('0x1'));var jayson=require(_0x321b('0x2'));var _=require('lodash');var logger=require(_0x321b('0x3'))(_0x321b('0x4'));var client=jayson[_0x321b('0x5')][_0x321b('0x6')]({'port':0x232a});function request(_0x2e42db,_0x421259){return new BPromise(function(_0x1be392,_0x2349e8){return client['request'](_0x2e42db,_0x421259)[_0x321b('0x7')](function(_0x4a9bb5){if(_0x4a9bb5[_0x321b('0x8')]){return _0x2349e8(_0x4a9bb5[_0x321b('0x8')][_0x321b('0x9')]);}else{return _0x1be392(_0x4a9bb5[_0x321b('0xa')]);}})[_0x321b('0xb')](function(_0x19f915){return _0x2349e8(_0x19f915);});});}exports[_0x321b('0xc')]=function(_0x3e7107,_0xd64a7e,_0x23ef39){return function(_0x291b47){if(_0x23ef39['rules']&&!_0x23ef39[_0x321b('0xd')][_0x3e7107]){logger[_0x321b('0xe')](_0x321b('0xf'),_0x3e7107);return _0x291b47[_0x321b('0x10')]();}var _0x6a3034=[];for(var _0xc00738=0x0;_0xc00738<_0xd64a7e[_0x321b('0x11')];_0xc00738+=0x1){_0x6a3034[_0x321b('0x12')](request('Command',{'command':util[_0x321b('0x13')](_0x321b('0x14'),_0xd64a7e[_0xc00738])})['then'](function(_0x226189){return _0x226189&&_0x226189[_0x321b('0x9')]&&_0x226189[_0x321b('0x9')][_0x321b('0x15')](_0x321b('0x16'))>=0x0?!![]:![];})['catch'](function(_0x30808b){logger[_0x321b('0x8')](_0x321b('0x17'),_0x3e7107,_0xd64a7e[_0xc00738]);}));}BPromise[_0x321b('0x18')](_0x6a3034)[_0x321b('0x7')](function(_0x4444cd){var _0x2e9aca=_[_0x321b('0x19')](_0x4444cd);logger[_0x321b('0xe')](_0x321b('0x1a'),_0x3e7107,_0xd64a7e['join'](_0x321b('0x1b')),_0x2e9aca);_0x291b47[_0x321b('0x1c')](_0x2e9aca);})[_0x321b('0xb')](function(_0x5d4c28){console['log'](_0x5d4c28);logger[_0x321b('0x8')](_0x321b('0x1a'),_0x3e7107,_0xd64a7e['join'](_0x321b('0x1b')),_0x5d4c28[_0x321b('0x1d')]);_0x291b47[_0x321b('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d3ee8e2..f2c90bc 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 _0x3f8c=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','[%s][agents][hangup]','./utils','info','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','format','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','indexOf','splice','agent'];(function(_0x1a6c94,_0x445053){var _0x4a2d59=function(_0x3d8b63){while(--_0x3d8b63){_0x1a6c94['push'](_0x1a6c94['shift']());}};_0x4a2d59(++_0x445053);}(_0x3f8c,0x104));var _0xc3f8=function(_0x4633d8,_0x9c9b09){_0x4633d8=_0x4633d8-0x0;var _0x163b16=_0x3f8c[_0x4633d8];return _0x163b16;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xc3f8('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1f6a,_0x2e70c4){utils[_0xc3f8('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1f6a['uniqueid'],_0x3a1f6a['channel'],_0x3a1f6a['queue'],_0x3a1f6a[_0xc3f8('0x2')],_0x3a1f6a[_0xc3f8('0x3')],_0x3a1f6a[_0xc3f8('0x4')],_0x3a1f6a[_0xc3f8('0x5')],_0x3a1f6a[_0xc3f8('0x6')]));if(_0x3a1f6a[_0xc3f8('0x7')]){utils['getVoiceQueueByName'](_0x3a1f6a[_0xc3f8('0x7')])[_0xc3f8('0x8')](function(_0x15cb3b){if(_0x15cb3b){_0x3a1f6a[_0xc3f8('0x9')]=_0x15cb3b[_0xc3f8('0x9')];_0x3a1f6a[_0xc3f8('0xa')]=_0x3a1f6a[_0xc3f8('0xb')]?_0x15cb3b['acw']:![];_0x3a1f6a[_0xc3f8('0xc')]=_0x3a1f6a[_0xc3f8('0xa')]?_0x15cb3b[_0xc3f8('0xd')]:0x0;}utils[_0xc3f8('0xe')]('CreateVoiceAgentReport',_0x3a1f6a);});}else{utils[_0xc3f8('0xe')](_0xc3f8('0xf'),_0x3a1f6a);}if(_0x2e70c4){delete transfers[_0x3a1f6a[_0xc3f8('0x10')]];}else{delete agents[_0x3a1f6a[_0xc3f8('0x11')]];}}exports['agentcalled']=function(_0x84f489){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x14'),_0x84f489[_0xc3f8('0x10')]),_0x84f489);agents[_0x84f489[_0xc3f8('0x11')]]=_0x84f489;agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();agents[_0x84f489[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x17');agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinenum']=null;agents[_0x84f489[_0xc3f8('0x11')]]['connectedlinename']=null;utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x18'),_0x84f489[_0xc3f8('0x10')],agents[_0x84f489[_0xc3f8('0x11')]]['membername'],_0x84f489[_0xc3f8('0x11')]));}catch(_0x1db809){utils['error'](util[_0xc3f8('0x13')]('[%s][agents][agentcalled]',_0x84f489[_0xc3f8('0x10')]),_0x1db809);}};exports[_0xc3f8('0x19')]=function(_0x3b2e98){try{if(!_['isNil'](agents[_0x3b2e98['destuniqueid']])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98[_0xc3f8('0x10')]),_0x3b2e98);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x1b'),_0x3b2e98[_0xc3f8('0x10')],agents[_0x3b2e98['destuniqueid']]['membername'],_0x3b2e98['destuniqueid']));agents[_0x3b2e98[_0xc3f8('0x11')]]['agentringnoanswer']=!![];agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1c')]=utils['now']();agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x6')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0xc3f8('0x1d');agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x1f')]=_0x3b2e98[_0xc3f8('0x20')]?parseInt(_0x3b2e98[_0xc3f8('0x20')])/0x3e8:0x0;agents[_0x3b2e98[_0xc3f8('0x11')]][_0xc3f8('0x21')]=0x0;unanswered[_0xc3f8('0x22')](_0x3b2e98[_0xc3f8('0x11')]);}}catch(_0x59e4dd){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x1a'),_0x3b2e98['uniqueid']),_0x59e4dd);}};exports[_0xc3f8('0x24')]=function(_0x4d39a0){try{_[_0xc3f8('0x25')](agents,function(_0x32343e,_0x47ab53){if(_0x32343e['uniqueid']==_0x4d39a0[_0xc3f8('0x10')]&&!_[_0xc3f8('0x26')](unanswered,_0x32343e[_0xc3f8('0x11')])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0[_0xc3f8('0x10')]),_0x4d39a0);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x28'),_0x4d39a0['uniqueid'],_0x32343e[_0xc3f8('0x2')],_0x32343e[_0xc3f8('0x11')]));_0x32343e[_0xc3f8('0x19')]=!![];_0x32343e[_0xc3f8('0x1c')]=utils[_0xc3f8('0x16')]();_0x32343e['lastevent']='abandoned';_0x32343e[_0xc3f8('0x1e')]=_0xc3f8('0x29');_0x32343e[_0xc3f8('0x1f')]=_0x4d39a0[_0xc3f8('0x1f')];_0x32343e[_0xc3f8('0x21')]=0x0;writeDB(_0x32343e);}});}catch(_0x4e51ac){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x27'),_0x4d39a0['uniqueid']),_0x4e51ac);}};exports[_0xc3f8('0x2a')]=function(_0x11ecc2){try{if(agents[_0x11ecc2[_0xc3f8('0x11')]]){utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x11ecc2);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x2c'),_0x11ecc2[_0xc3f8('0x10')],agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x11ecc2['destuniqueid']));agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x5')]=_0x11ecc2['connectedlinenum'];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x2e')]=_0x11ecc2[_0xc3f8('0x2e')];agents[_0x11ecc2['destuniqueid']][_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];agents[_0x11ecc2[_0xc3f8('0x11')]][_0xc3f8('0x6')]='connect';_[_0xc3f8('0x25')](agents,function(_0x45d416,_0x2df096){if(_0x45d416[_0xc3f8('0x11')]!=_0x11ecc2['destuniqueid']&&_0x45d416[_0xc3f8('0x10')]==_0x11ecc2['uniqueid']){_0x45d416['talktime']=0x0;_0x45d416[_0xc3f8('0x1f')]=_0x11ecc2[_0xc3f8('0x20')];_0x45d416[_0xc3f8('0x19')]=!![];_0x45d416[_0xc3f8('0x1c')]=utils['now']();_0x45d416['lastevent']=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x1e')]=_0xc3f8('0x2f');_0x45d416[_0xc3f8('0x30')]=_0x11ecc2[_0xc3f8('0x11')];_0x45d416[_0xc3f8('0x31')]=_0x11ecc2[_0xc3f8('0x2')];writeDB(_0x45d416);}});}}catch(_0x45e6ea){utils[_0xc3f8('0x23')](util[_0xc3f8('0x13')](_0xc3f8('0x2b'),_0x11ecc2['uniqueid']),_0x45e6ea);}};exports[_0xc3f8('0xb')]=function(_0x22e9b3){try{if(!_['isNil'](agents[_0x22e9b3[_0xc3f8('0x11')]])){utils[_0xc3f8('0x12')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0x22e9b3);utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x33'),_0x22e9b3[_0xc3f8('0x10')],agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x2')],_0x22e9b3[_0xc3f8('0x11')]));agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0xb')]=!![];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x34')],agents[_0x22e9b3['destuniqueid']]['agentconnectAt']);agents[_0x22e9b3[_0xc3f8('0x11')]][_0xc3f8('0x1e')]=_0x22e9b3[_0xc3f8('0x1e')];agents[_0x22e9b3['destuniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x36');writeDB(agents[_0x22e9b3[_0xc3f8('0x11')]]);}}catch(_0xe3d5c4){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x32'),_0x22e9b3[_0xc3f8('0x10')]),_0xe3d5c4);}};exports['blindtransfer']=function(_0x1becae){try{if(!_[_0xc3f8('0x37')](agents[_0x1becae[_0xc3f8('0x38')]])){utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae[_0xc3f8('0x10')]),_0x1becae);utils['info'](util[_0xc3f8('0x13')](_0xc3f8('0x3a'),_0x1becae['uniqueid'],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x2')],agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')]));agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3b')]=!![];agents[_0x1becae[_0xc3f8('0x38')]]['transfertype']=_0xc3f8('0x3c');agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3d')]=_0x1becae[_0xc3f8('0x3e')];agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x3f')]=agents[_0x1becae[_0xc3f8('0x38')]][_0xc3f8('0x10')];}}catch(_0x4fc02c){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x39'),_0x1becae['uniqueid']),_0x4fc02c);}};exports['attendedtransfer']=function(_0x773d56){try{utils['debug'](util[_0xc3f8('0x13')](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x773d56);if(_0x773d56['origtransfereruniqueid']==_0x773d56[_0xc3f8('0x42')]){if(!_['isNil'](agents[_0x773d56['secondtransfereruniqueid']])){utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x44')]]['membername']));agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56['secondtransfereruniqueid']]['transferexten']=_0x773d56[_0xc3f8('0x47')];agents[_0x773d56[_0xc3f8('0x44')]][_0xc3f8('0x3f')]=_0x773d56[_0xc3f8('0x41')];}if(_0x773d56[_0xc3f8('0x48')]&&agents[_0x773d56['transfereeuniqueid']]){agents[_0x773d56[_0xc3f8('0x48')]]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x48')]]=_[_0xc3f8('0x49')](agents[_0x773d56[_0xc3f8('0x48')]]);transfers[_0x773d56[_0xc3f8('0x48')]]['calleridnum']=agents[_0x773d56[_0xc3f8('0x44')]]['calleridnum'];transfers[_0x773d56['transfereeuniqueid']]['calleridname']=agents[_0x773d56['secondtransfereruniqueid']][_0xc3f8('0x4a')];transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x15')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x2d')]=utils[_0xc3f8('0x16')]();transfers[_0x773d56[_0xc3f8('0x48')]]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x48')]][_0xc3f8('0x4b')]=0x2;}}else if(_0x773d56[_0xc3f8('0x44')]==_0x773d56[_0xc3f8('0x4c')]){if(!_[_0xc3f8('0x37')](agents[_0x773d56['origtransfereruniqueid']])){utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x43'),_0x773d56[_0xc3f8('0x41')],agents[_0x773d56[_0xc3f8('0x41')]]['membername']));agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3b')]=!![];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x45')]=_0xc3f8('0x46');agents[_0x773d56[_0xc3f8('0x41')]]['transferexten']=_0x773d56[_0xc3f8('0x4d')];agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x3f')]=_0x773d56['secondtransfereruniqueid'];}if(_0x773d56[_0xc3f8('0x4e')]&&agents[_0x773d56[_0xc3f8('0x4e')]]){agents[_0x773d56['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x773d56[_0xc3f8('0x4e')]]=_[_0xc3f8('0x49')](agents[_0x773d56['transfertargetuniqueid']]);transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4')];transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4a')]=agents[_0x773d56[_0xc3f8('0x41')]][_0xc3f8('0x4a')];transfers[_0x773d56['transfertargetuniqueid']]['agentcalledAt']=utils[_0xc3f8('0x16')]();transfers[_0x773d56['transfertargetuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x773d56['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x773d56[_0xc3f8('0x4e')]][_0xc3f8('0x4b')]=0x2;}}}catch(_0x188d39){utils[_0xc3f8('0x23')](util['format'](_0xc3f8('0x40'),_0x773d56[_0xc3f8('0x41')]),_0x188d39);}};exports['hangup']=function(_0x3b9b47){try{utils[_0xc3f8('0x12')](util[_0xc3f8('0x13')]('[%s][agents][hangup]',_0x3b9b47[_0xc3f8('0x10')]),_0x3b9b47);if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47['uniqueid']]['reason']===_0xc3f8('0x1d')){if(_0x3b9b47[_0xc3f8('0x4f')]==='21'){agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')]=_0xc3f8('0x50');agents[_0x3b9b47['uniqueid']][_0xc3f8('0x6')]=_0xc3f8('0x50');}utils['info'](util[_0xc3f8('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47[_0xc3f8('0x10')]]['membername'],agents[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],agents[_0x3b9b47[_0xc3f8('0x10')]]['lastevent']));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);var _0x5de19e=unanswered[_0xc3f8('0x51')](_0x3b9b47['uniqueid']);if(_0x5de19e>-0x1){unanswered[_0xc3f8('0x52')](_0x5de19e,0x1);}}if(transfers[_0x3b9b47[_0xc3f8('0x10')]]){transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0xb')]=!![];transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils[_0xc3f8('0x16')]();transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x21')]=utils['diffTime'](transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]);transfers[_0x3b9b47[_0xc3f8('0x10')]]['reason']=_0xc3f8('0x53');transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util['format'](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],transfers[_0x3b9b47[_0xc3f8('0x10')]]['membername'],transfers[_0x3b9b47['uniqueid']][_0xc3f8('0x1e')],transfers[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(transfers[_0x3b9b47[_0xc3f8('0x10')]],!![]);}if(agents[_0x3b9b47['uniqueid']]&&agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x2d')]){agents[_0x3b9b47[_0xc3f8('0x10')]]['agentcomplete']=!![];agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x34')]=utils['now']();agents[_0x3b9b47['uniqueid']][_0xc3f8('0x21')]=utils[_0xc3f8('0x35')](agents[_0x3b9b47['uniqueid']][_0xc3f8('0x34')],agents[_0x3b9b47[_0xc3f8('0x10')]]['agentconnectAt']);agents[_0x3b9b47[_0xc3f8('0x10')]]['reason']=agents[_0x3b9b47[_0xc3f8('0x10')]]['transfer']?_0xc3f8('0x3b'):_0xc3f8('0x53');agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]=_0xc3f8('0x36');utils[_0xc3f8('0x1')](util[_0xc3f8('0x13')](_0xc3f8('0x54'),_0x3b9b47[_0xc3f8('0x10')],agents[_0x3b9b47['uniqueid']]['membername'],agents[_0x3b9b47[_0xc3f8('0x10')]]['reason'],agents[_0x3b9b47[_0xc3f8('0x10')]][_0xc3f8('0x6')]));writeDB(agents[_0x3b9b47[_0xc3f8('0x10')]]);}}catch(_0xfb05eb){utils['error'](util[_0xc3f8('0x13')](_0xc3f8('0x55'),_0x3b9b47[_0xc3f8('0x10')]),_0xfb05eb);}}; \ No newline at end of file +var _0x5c00=['queuecallerabandon','forIn','includes','agentringnoanswer','now','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','info','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push'];(function(_0x24fc2c,_0x47b500){var _0x483de4=function(_0x1c5da5){while(--_0x1c5da5){_0x24fc2c['push'](_0x24fc2c['shift']());}};_0x483de4(++_0x47b500);}(_0x5c00,0x17e));var _0x05c0=function(_0x169d7f,_0x129afd){_0x169d7f=_0x169d7f-0x0;var _0x28e8c=_0x5c00[_0x169d7f];return _0x28e8c;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var utils=require(_0x05c0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4e54ec,_0x1e76da){utils['info'](util[_0x05c0('0x3')](_0x05c0('0x4'),_0x4e54ec[_0x05c0('0x5')],_0x4e54ec[_0x05c0('0x6')],_0x4e54ec['queue'],_0x4e54ec[_0x05c0('0x7')],_0x4e54ec[_0x05c0('0x8')],_0x4e54ec[_0x05c0('0x9')],_0x4e54ec[_0x05c0('0xa')],_0x4e54ec['lastevent']));if(_0x4e54ec[_0x05c0('0xb')]){utils[_0x05c0('0xc')](_0x4e54ec[_0x05c0('0xb')])['then'](function(_0x32a795){if(_0x32a795){_0x4e54ec[_0x05c0('0xd')]=_0x32a795[_0x05c0('0xd')];_0x4e54ec[_0x05c0('0xe')]=_0x4e54ec[_0x05c0('0xf')]?_0x32a795[_0x05c0('0x10')]:![];_0x4e54ec['acwtime']=_0x4e54ec['agentacw']?_0x32a795[_0x05c0('0x11')]:0x0;}utils['request'](_0x05c0('0x12'),_0x4e54ec);});}else{utils[_0x05c0('0x13')](_0x05c0('0x12'),_0x4e54ec);}if(_0x1e76da){delete transfers[_0x4e54ec['uniqueid']];}else{delete agents[_0x4e54ec[_0x05c0('0x14')]];}}exports['agentcalled']=function(_0x16a290){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x16a290);agents[_0x16a290[_0x05c0('0x14')]]=_0x16a290;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x17')]=utils['now']();agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x18')]=_0x05c0('0x19');agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0xa')]=null;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x1a')]=null;utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x16a290[_0x05c0('0x5')],agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x7')],_0x16a290['destuniqueid']));}catch(_0x40d905){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x40d905);}};exports['agentringnoanswer']=function(_0x407c1f){try{if(!_[_0x05c0('0x1d')](agents[_0x407c1f['destuniqueid']])){utils['debug'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x407c1f);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x1f'),_0x407c1f[_0x05c0('0x5')],agents[_0x407c1f[_0x05c0('0x14')]]['membername'],_0x407c1f[_0x05c0('0x14')]));agents[_0x407c1f[_0x05c0('0x14')]]['agentringnoanswer']=!![];agents[_0x407c1f['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x407c1f['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x20');agents[_0x407c1f['destuniqueid']][_0x05c0('0x21')]=_0x05c0('0x20');agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x407c1f['ringtime']?parseInt(_0x407c1f[_0x05c0('0x23')])/0x3e8:0x0;agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x24')]=0x0;unanswered[_0x05c0('0x25')](_0x407c1f[_0x05c0('0x14')]);}}catch(_0x5d12e0){utils['error'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x5d12e0);}};exports[_0x05c0('0x26')]=function(_0xd6574e){try{_[_0x05c0('0x27')](agents,function(_0x1e00c5,_0x1c4c8f){if(_0x1e00c5[_0x05c0('0x5')]==_0xd6574e[_0x05c0('0x5')]&&!_[_0x05c0('0x28')](unanswered,_0x1e00c5[_0x05c0('0x14')])){utils[_0x05c0('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0xd6574e[_0x05c0('0x5')]),_0xd6574e);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd6574e[_0x05c0('0x5')],_0x1e00c5[_0x05c0('0x7')],_0x1e00c5['destuniqueid']));_0x1e00c5[_0x05c0('0x29')]=!![];_0x1e00c5['agentringnoanswerAt']=utils[_0x05c0('0x2a')]();_0x1e00c5[_0x05c0('0x18')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x21')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x22')]=_0xd6574e[_0x05c0('0x22')];_0x1e00c5[_0x05c0('0x24')]=0x0;writeDB(_0x1e00c5);}});}catch(_0x3d8d76){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x2c'),_0xd6574e[_0x05c0('0x5')]),_0x3d8d76);}};exports[_0x05c0('0x2d')]=function(_0x185d05){try{if(agents[_0x185d05[_0x05c0('0x14')]]){utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x2e'),_0x185d05[_0x05c0('0x5')]),_0x185d05);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x2f'),_0x185d05[_0x05c0('0x5')],agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x7')],_0x185d05[_0x05c0('0x14')]));agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x30')]=utils[_0x05c0('0x2a')]();agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0xa')]=_0x185d05[_0x05c0('0xa')];agents[_0x185d05['destuniqueid']][_0x05c0('0x1a')]=_0x185d05[_0x05c0('0x1a')];agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x185d05['ringtime'];agents[_0x185d05['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x31');_[_0x05c0('0x27')](agents,function(_0x4ced8e,_0x29dc87){if(_0x4ced8e[_0x05c0('0x14')]!=_0x185d05[_0x05c0('0x14')]&&_0x4ced8e[_0x05c0('0x5')]==_0x185d05['uniqueid']){_0x4ced8e[_0x05c0('0x24')]=0x0;_0x4ced8e[_0x05c0('0x22')]=_0x185d05['ringtime'];_0x4ced8e[_0x05c0('0x29')]=!![];_0x4ced8e[_0x05c0('0x32')]=utils[_0x05c0('0x2a')]();_0x4ced8e[_0x05c0('0x18')]=_0x05c0('0x33');_0x4ced8e[_0x05c0('0x21')]=_0x05c0('0x33');_0x4ced8e['answeredelsewheredestinationuniqueid']=_0x185d05['destuniqueid'];_0x4ced8e[_0x05c0('0x34')]=_0x185d05[_0x05c0('0x7')];writeDB(_0x4ced8e);}});}}catch(_0xaa5d53){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')]('[%s][agents][agentconnect]',_0x185d05[_0x05c0('0x5')]),_0xaa5d53);}};exports[_0x05c0('0xf')]=function(_0x2fdfe8){try{if(!_[_0x05c0('0x1d')](agents[_0x2fdfe8[_0x05c0('0x14')]])){utils[_0x05c0('0x15')](util[_0x05c0('0x3')]('[%s][agents][agentcomplete]',_0x2fdfe8[_0x05c0('0x5')]),_0x2fdfe8);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x35'),_0x2fdfe8[_0x05c0('0x5')],agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x7')],_0x2fdfe8[_0x05c0('0x14')]));agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0xf')]=!![];agents[_0x2fdfe8[_0x05c0('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x37')],agents[_0x2fdfe8[_0x05c0('0x14')]]['agentconnectAt']);agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x21')]=_0x2fdfe8[_0x05c0('0x21')];agents[_0x2fdfe8[_0x05c0('0x14')]]['lastevent']=_0x05c0('0x38');writeDB(agents[_0x2fdfe8[_0x05c0('0x14')]]);}}catch(_0x3ec0bf){utils[_0x05c0('0x1c')](util['format'](_0x05c0('0x39'),_0x2fdfe8[_0x05c0('0x5')]),_0x3ec0bf);}};exports[_0x05c0('0x3a')]=function(_0x9b521b){try{if(!_['isNil'](agents[_0x9b521b[_0x05c0('0x3b')]])){utils[_0x05c0('0x15')](util['format'](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x9b521b);utils['info'](util[_0x05c0('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x9b521b[_0x05c0('0x5')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x7')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x5')]));agents[_0x9b521b[_0x05c0('0x3b')]]['transfer']=!![];agents[_0x9b521b[_0x05c0('0x3b')]]['transfertype']=_0x05c0('0x3d');agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x3e')]=_0x9b521b[_0x05c0('0x3f')];agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x40')]=agents[_0x9b521b[_0x05c0('0x3b')]]['uniqueid'];}}catch(_0x5215b4){utils['error'](util[_0x05c0('0x3')](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x5215b4);}};exports['attendedtransfer']=function(_0xbfb9cb){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x41'),_0xbfb9cb[_0x05c0('0x42')]),_0xbfb9cb);if(_0xbfb9cb[_0x05c0('0x42')]==_0xbfb9cb[_0x05c0('0x43')]){if(!_['isNil'](agents[_0xbfb9cb[_0x05c0('0x44')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb['origtransfereruniqueid'],agents[_0xbfb9cb[_0x05c0('0x44')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb['secondtransfereruniqueid']][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x3e')]=_0xbfb9cb[_0x05c0('0x48')];agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x42')];}if(_0xbfb9cb['transfereeuniqueid']&&agents[_0xbfb9cb[_0x05c0('0x49')]]){agents[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x1;transfers[_0xbfb9cb[_0x05c0('0x49')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x49')]]);transfers[_0xbfb9cb['transfereeuniqueid']][_0x05c0('0x9')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x9')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4c')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x4c')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x17')]=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x2;}}else if(_0xbfb9cb[_0x05c0('0x44')]==_0xbfb9cb['secondtransfererlinkedid']){if(!_[_0x05c0('0x1d')](agents[_0xbfb9cb[_0x05c0('0x42')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb[_0x05c0('0x42')],agents[_0xbfb9cb[_0x05c0('0x42')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb['origtransfereruniqueid']]['transferexten']=_0xbfb9cb[_0x05c0('0x4d')];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x44')];}if(_0xbfb9cb[_0x05c0('0x4e')]&&agents[_0xbfb9cb[_0x05c0('0x4e')]]){agents[_0xbfb9cb[_0x05c0('0x4e')]]['agententerreason']=0x1;transfers[_0xbfb9cb[_0x05c0('0x4e')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x4e')]]);transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x9')]=agents[_0xbfb9cb['origtransfereruniqueid']]['calleridnum'];transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4c')]=agents[_0xbfb9cb['origtransfereruniqueid']][_0x05c0('0x4c')];transfers[_0xbfb9cb['transfertargetuniqueid']]['agentcalledAt']=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfertargetuniqueid']][_0x05c0('0x22')]=0x0;transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4a')]=0x2;}}}catch(_0x5b39cb){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0xbfb9cb['origtransfereruniqueid']),_0x5b39cb);}};exports[_0x05c0('0x4f')]=function(_0x4f43ae){try{utils['debug'](util['format'](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x4f43ae);if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae['uniqueid']][_0x05c0('0x21')]===_0x05c0('0x20')){if(_0x4f43ae['cause']==='21'){agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x21')]=_0x05c0('0x51');agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']=_0x05c0('0x51');}utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae['uniqueid']]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(agents[_0x4f43ae['uniqueid']]);var _0x3135bd=unanswered['indexOf'](_0x4f43ae['uniqueid']);if(_0x3135bd>-0x1){unanswered['splice'](_0x3135bd,0x1);}}if(transfers[_0x4f43ae['uniqueid']]){transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0xf')]=!![];transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')]=utils['now']();transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],transfers[_0x4f43ae['uniqueid']][_0x05c0('0x30')]);transfers[_0x4f43ae['uniqueid']]['reason']=_0x05c0('0x53');transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4f43ae['uniqueid'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x7')],transfers[_0x4f43ae[_0x05c0('0x5')]]['reason'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(transfers[_0x4f43ae[_0x05c0('0x5')]],!![]);}if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]){agents[_0x4f43ae['uniqueid']][_0x05c0('0xf')]=!![];agents[_0x4f43ae[_0x05c0('0x5')]]['agentcompleteAt']=utils[_0x05c0('0x2a')]();agents[_0x4f43ae[_0x05c0('0x5')]]['talktime']=utils[_0x05c0('0x36')](agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]);agents[_0x4f43ae[_0x05c0('0x5')]]['reason']=agents[_0x4f43ae[_0x05c0('0x5')]]['transfer']?_0x05c0('0x46'):_0x05c0('0x53');agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae[_0x05c0('0x5')]]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']));writeDB(agents[_0x4f43ae[_0x05c0('0x5')]]);}}catch(_0x36f82a){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x36f82a);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 430b52f..aeba5cb 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 _0x5eeb=['CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','noop','execif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5eeb,0x183));var _0xb5ee=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x5eeb[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0xb5ee('0x0'));var util=require(_0xb5ee('0x1'));var utils=require('./utils');var transfers=require(_0xb5ee('0x2'));var dispositions=[_0xb5ee('0x3'),_0xb5ee('0x4'),_0xb5ee('0x4'),_0xb5ee('0x3'),_0xb5ee('0x3'),_0xb5ee('0x3'),_0xb5ee('0x5'),'BUSY','FAILED','FAILED',_0xb5ee('0x4')];var channels={};function writeDB(_0x5983d1){var _0x35e741;if(transfers[_0xb5ee('0x6')][_0x5983d1['uniqueid']]){_0x35e741=_0x5983d1[_0xb5ee('0x7')];_0x5983d1[_0xb5ee('0x7')]=transfers[_0xb5ee('0x6')][_0x5983d1[_0xb5ee('0x7')]][_0xb5ee('0x8')];}utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x5983d1[_0xb5ee('0x7')],_0x5983d1[_0xb5ee('0xb')],_0x5983d1[_0xb5ee('0xc')],_0x5983d1[_0xb5ee('0xd')],_0x5983d1['interface'],_0x5983d1[_0xb5ee('0xe')],_0x5983d1['connectedlinenum'],_0x5983d1[_0xb5ee('0xf')]));if(_0x5983d1[_0xb5ee('0x10')]){utils[_0xb5ee('0x11')](_0x5983d1[_0xb5ee('0x10')])[_0xb5ee('0x12')](function(_0xeb2f41){if(_0xeb2f41){_0x5983d1[_0xb5ee('0x13')]=_0xeb2f41['id'];}utils[_0xb5ee('0x14')]('CreateVoiceCallReport',_0x5983d1);});}else{utils[_0xb5ee('0x14')](_0xb5ee('0x15'),_0x5983d1);}if(channels[_0x5983d1[_0xb5ee('0x7')]]){delete channels[_0x5983d1[_0xb5ee('0x7')]];}else if(_0x35e741&&channels[_0x35e741]){delete transfers['blinds'][_0x35e741];delete channels[_0x35e741];}}exports[_0xb5ee('0x16')]=function(_0x36cc95){try{utils[_0xb5ee('0x17')](util[_0xb5ee('0xa')](_0xb5ee('0x18'),_0x36cc95[_0xb5ee('0x7')]),_0x36cc95);if(_0x36cc95[_0xb5ee('0x7')]==_0x36cc95[_0xb5ee('0x19')]&&_0x36cc95[_0xb5ee('0xb')]!='OutgoingSpoolFailed'){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x1a'),_0x36cc95['uniqueid'],_0x36cc95[_0xb5ee('0x1b')],_0x36cc95[_0xb5ee('0x1c')]));channels[_0x36cc95['uniqueid']]={'uniqueid':_0x36cc95['uniqueid'],'accountcode':_0x36cc95[_0xb5ee('0x10')],'source':_0x36cc95['calleridnum'],'destination':_0x36cc95[_0xb5ee('0x1c')],'destinationcontext':_0x36cc95[_0xb5ee('0x1b')],'channel':_0x36cc95[_0xb5ee('0xb')],'starttime':utils[_0xb5ee('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xb5ee('0x1e')};}}catch(_0x3255f3){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')](_0xb5ee('0x18'),_0x36cc95[_0xb5ee('0x7')]),_0x3255f3);}};exports['newstate']=function(_0x2f6d2b){try{utils[_0xb5ee('0x17')](util['format'](_0xb5ee('0x20'),_0x2f6d2b[_0xb5ee('0x7')]),_0x2f6d2b);if(!_[_0xb5ee('0x21')](channels[_0x2f6d2b['uniqueid']])&&_0x2f6d2b[_0xb5ee('0x22')]==0x6){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x23'),_0x2f6d2b[_0xb5ee('0x7')],_0x2f6d2b[_0xb5ee('0x1b')],_0x2f6d2b[_0xb5ee('0xb')]));if(_[_0xb5ee('0x21')](channels[_0x2f6d2b[_0xb5ee('0x7')]][_0xb5ee('0x24')])){channels[_0x2f6d2b[_0xb5ee('0x7')]][_0xb5ee('0x24')]=utils['now']();}}else if(!_[_0xb5ee('0x21')](channels[_0x2f6d2b[_0xb5ee('0x19')]])&&_0x2f6d2b[_0xb5ee('0x22')]==0x6&&_0x2f6d2b[_0xb5ee('0x1b')]!=_0xb5ee('0x25')){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2f6d2b[_0xb5ee('0x7')],_0x2f6d2b[_0xb5ee('0x19')],_0x2f6d2b[_0xb5ee('0x1b')],_0x2f6d2b['channel']));channels[_0x2f6d2b[_0xb5ee('0x19')]][_0xb5ee('0x10')]=_0x2f6d2b[_0xb5ee('0x10')];channels[_0x2f6d2b['linkedid']]['destinationchannel']=_0x2f6d2b[_0xb5ee('0xb')];if(_[_0xb5ee('0x21')](channels[_0x2f6d2b['linkedid']][_0xb5ee('0x26')])){channels[_0x2f6d2b['linkedid']][_0xb5ee('0x26')]=utils[_0xb5ee('0x1d')]();}channels[_0x2f6d2b['linkedid']]['disposition']=dispositions[_[_0xb5ee('0x27')](_0x2f6d2b[_0xb5ee('0x22')])]||_0xb5ee('0x5');}}catch(_0x465bff){utils['error'](util['format'](_0xb5ee('0x20'),_0x2f6d2b[_0xb5ee('0x7')]),_0x465bff);}};exports[_0xb5ee('0x28')]=function(_0x42cac6){try{if(!_[_0xb5ee('0x21')](channels[_0x42cac6[_0xb5ee('0x7')]])){utils[_0xb5ee('0x17')](util['format'](_0xb5ee('0x29'),_0x42cac6[_0xb5ee('0x7')]),_0x42cac6);if(_['isNil'](channels[_0x42cac6[_0xb5ee('0x7')]][_0xb5ee('0x2a')])){channels[_0x42cac6[_0xb5ee('0x7')]]['callerid']=_0x42cac6['calleridname']+'\x20<'+_0x42cac6['calleridnum']+'>';}utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x42cac6[_0xb5ee('0x7')],channels[_0x42cac6['uniqueid']]['callerid'],_0x42cac6[_0xb5ee('0x2b')]));channels[_0x42cac6['uniqueid']][_0xb5ee('0x2c')]=utils[_0xb5ee('0x1d')]();channels[_0x42cac6['uniqueid']][_0xb5ee('0x2d')]=utils[_0xb5ee('0x2e')](channels[_0x42cac6['uniqueid']][_0xb5ee('0x2c')],channels[_0x42cac6[_0xb5ee('0x7')]]['starttime']);channels[_0x42cac6[_0xb5ee('0x7')]][_0xb5ee('0x2f')]=channels[_0x42cac6[_0xb5ee('0x7')]]['answertime']?utils[_0xb5ee('0x2e')](channels[_0x42cac6[_0xb5ee('0x7')]][_0xb5ee('0x2c')],channels[_0x42cac6[_0xb5ee('0x7')]][_0xb5ee('0x26')]):0x0;writeDB(channels[_0x42cac6[_0xb5ee('0x7')]]);}}catch(_0x40321d){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')]('[%s][calls][hangup]',_0x42cac6[_0xb5ee('0x7')]),_0x40321d);}};exports[_0xb5ee('0x30')]=function(_0x7333fb){try{if(!_[_0xb5ee('0x21')](channels[_0x7333fb[_0xb5ee('0x31')]])){utils[_0xb5ee('0x17')](util[_0xb5ee('0xa')](_0xb5ee('0x32'),_0x7333fb[_0xb5ee('0x33')]),_0x7333fb);if(channels[_0x7333fb[_0xb5ee('0x31')]][_0xb5ee('0xb')]==_0x7333fb[_0xb5ee('0x34')]){utils[_0xb5ee('0x9')](util['format'](_0xb5ee('0x35'),_0x7333fb[_0xb5ee('0x33')],_0x7333fb[_0xb5ee('0x31')],_0x7333fb['secondtransfererchannel']));channels[_0x7333fb[_0xb5ee('0x31')]]['destinationchannel']=_0x7333fb['secondtransfererchannel'];channels[_0x7333fb[_0xb5ee('0x31')]][_0xb5ee('0x36')]=_0xb5ee('0x37');}else if(channels[_0x7333fb['localtwolinkedid']][_0xb5ee('0xb')]=_0x7333fb[_0xb5ee('0x38')]){utils[_0xb5ee('0x9')](util['format'](_0xb5ee('0x35'),_0x7333fb[_0xb5ee('0x33')],_0x7333fb[_0xb5ee('0x31')],_0x7333fb[_0xb5ee('0x39')]));channels[_0x7333fb[_0xb5ee('0x31')]][_0xb5ee('0x3a')]=_0x7333fb['origtransfererchannel'];channels[_0x7333fb[_0xb5ee('0x31')]][_0xb5ee('0x36')]='_attended';}}}catch(_0x42f1ea){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x7333fb[_0xb5ee('0x33')]),_0x42f1ea);}};exports['musiconholdstart']=function(_0x367ccc){try{if(!_[_0xb5ee('0x21')](channels[_0x367ccc[_0xb5ee('0x7')]])){utils['debug'](util[_0xb5ee('0xa')](_0xb5ee('0x3b'),_0x367ccc[_0xb5ee('0x7')]),_0x367ccc);channels[_0x367ccc[_0xb5ee('0x7')]]['musiconholdstartAt']=utils[_0xb5ee('0x1d')]();utils[_0xb5ee('0x9')](util['format'](_0xb5ee('0x3c'),_0x367ccc[_0xb5ee('0x7')],channels[_0x367ccc[_0xb5ee('0x7')]][_0xb5ee('0x3d')]));}}catch(_0x1aaa6b){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')]('[%s][calls][musiconholdstart]',_0x367ccc[_0xb5ee('0x7')]),_0x1aaa6b);}};exports[_0xb5ee('0x3e')]=function(_0x20eea2){try{if(!_[_0xb5ee('0x21')](channels[_0x20eea2[_0xb5ee('0x7')]])){utils['debug'](util[_0xb5ee('0xa')](_0xb5ee('0x3f'),_0x20eea2[_0xb5ee('0x7')]),_0x20eea2);if(!_[_0xb5ee('0x21')](channels[_0x20eea2[_0xb5ee('0x7')]][_0xb5ee('0x3d')])){channels[_0x20eea2[_0xb5ee('0x7')]][_0xb5ee('0x40')]+=utils[_0xb5ee('0x2e')](utils['now'](),channels[_0x20eea2['uniqueid']][_0xb5ee('0x3d')]);utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x41'),_0x20eea2['uniqueid'],channels[_0x20eea2[_0xb5ee('0x7')]][_0xb5ee('0x40')]));delete channels[_0x20eea2[_0xb5ee('0x7')]][_0xb5ee('0x3d')];}}}catch(_0x5bf509){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')](_0xb5ee('0x3f'),_0x20eea2[_0xb5ee('0x7')]),_0x5bf509);}};exports[_0xb5ee('0x42')]=function(_0x28925a){try{if(!_['isNil'](channels[_0x28925a[_0xb5ee('0x7')]])){utils[_0xb5ee('0x17')](util[_0xb5ee('0xa')](_0xb5ee('0x43'),_0x28925a[_0xb5ee('0x7')]),_0x28925a);if(!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x45')])){utils[_0xb5ee('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x28925a['uniqueid'],_0x28925a[_0xb5ee('0x46')]));channels[_0x28925a[_0xb5ee('0x7')]]['source']=_0x28925a[_0xb5ee('0x46')];}if(!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x47')])){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x48'),_0x28925a['uniqueid'],_0x28925a['value']));channels[_0x28925a[_0xb5ee('0x7')]][_0xb5ee('0x49')]=_0x28925a[_0xb5ee('0x46')];channels[_0x28925a['uniqueid']][_0xb5ee('0x2a')]='\x22'+_0x28925a['value']+_0xb5ee('0x4a')+_0x28925a['value']+'>';}if(!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x4b')])||!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')]['xmd-callerid'])){utils[_0xb5ee('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x28925a['uniqueid'],!_['isNil'](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x4b')])?_0xb5ee('0x4b'):_0xb5ee('0x4c'),_0x28925a['value']));channels[_0x28925a['uniqueid']][_0xb5ee('0x2a')]=_0x28925a['value'];}if(!_[_0xb5ee('0x21')](_0x28925a['variable'][_0xb5ee('0x4d')])||!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')]['xmcs-queue'])){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x4e'),_0x28925a[_0xb5ee('0x7')],!_[_0xb5ee('0x21')](_0x28925a['variable'][_0xb5ee('0x4d')])?_0xb5ee('0x4d'):'xmcs-queue',_0x28925a[_0xb5ee('0x46')]));channels[_0x28925a[_0xb5ee('0x7')]][_0xb5ee('0x4f')]=_0xb5ee('0x50');channels[_0x28925a[_0xb5ee('0x7')]][_0xb5ee('0x51')]=_0x28925a[_0xb5ee('0x46')];channels[_0x28925a['uniqueid']][_0xb5ee('0xc')]=!![];}if(!_['isNil'](_0x28925a[_0xb5ee('0x44')]['xmd-contactid'])){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x52'),_0x28925a[_0xb5ee('0x7')],_0x28925a['value']));channels[_0x28925a[_0xb5ee('0x7')]]['ContactId']=_0x28925a[_0xb5ee('0x46')];}if(!_['isNil'](_0x28925a['variable'][_0xb5ee('0x53')])){utils['info'](util[_0xb5ee('0xa')](_0xb5ee('0x54'),_0x28925a[_0xb5ee('0x7')],_0x28925a[_0xb5ee('0x46')]));channels[_0x28925a[_0xb5ee('0x7')]]['type']=_0x28925a[_0xb5ee('0x46')];}if(!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x55')])){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x28925a[_0xb5ee('0x7')],_0x28925a['value']));channels[_0x28925a['uniqueid']][_0xb5ee('0x56')]=_0x28925a['value'];}if(!_[_0xb5ee('0x21')](_0x28925a[_0xb5ee('0x44')][_0xb5ee('0x57')])){utils[_0xb5ee('0x9')](util[_0xb5ee('0xa')](_0xb5ee('0x58'),_0x28925a[_0xb5ee('0x7')],_0x28925a[_0xb5ee('0x46')]));channels[_0x28925a[_0xb5ee('0x7')]]['sipcallid']=_0x28925a[_0xb5ee('0x46')];}}}catch(_0xed0ff0){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')](_0xb5ee('0x43'),_0x28925a[_0xb5ee('0x7')]),_0xed0ff0);}};exports[_0xb5ee('0x59')]=function(_0x52ffc4){try{if(!_[_0xb5ee('0x21')](channels[_0x52ffc4[_0xb5ee('0x7')]])){utils['debug'](util[_0xb5ee('0xa')](_0xb5ee('0x5a'),_0x52ffc4['uniqueid']),_0x52ffc4);utils['info'](util['format'](_0xb5ee('0x5b'),_0x52ffc4['uniqueid'],_0x52ffc4[_0xb5ee('0x5c')],_0x52ffc4[_0xb5ee('0x5d')]));if(_0x52ffc4[_0xb5ee('0x5c')][_0xb5ee('0x5e')]()==_0xb5ee('0x5f')&&_[_0xb5ee('0x60')](_0x52ffc4[_0xb5ee('0x5d')][_0xb5ee('0x5e')](),'cdr')){var _0x3726fd=_0x52ffc4[_0xb5ee('0x5d')][_0xb5ee('0x61')]('=');var _0x4a03bd=_0x3726fd[0x0][_0xb5ee('0x62')](_0x3726fd[0x0][_0xb5ee('0x63')]('(')+0x1,_0x3726fd[0x0][_0xb5ee('0x63')](')'));var _0xfdf810=_0x3726fd[0x1];channels[_0x52ffc4['uniqueid']][_0x4a03bd]=_0xfdf810;}if(!_['includes']([_0xb5ee('0x28'),_0xb5ee('0x64'),_0xb5ee('0x65'),'set','gotoif'],_0x52ffc4[_0xb5ee('0x5c')][_0xb5ee('0x5e')]())){channels[_0x52ffc4[_0xb5ee('0x7')]][_0xb5ee('0x4f')]=_0x52ffc4[_0xb5ee('0x5c')];channels[_0x52ffc4['uniqueid']][_0xb5ee('0x51')]=_0x52ffc4[_0xb5ee('0x5d')];}}}catch(_0x5db69a){utils[_0xb5ee('0x1f')](util[_0xb5ee('0xa')]('[%s][calls][newexten]',_0x52ffc4['uniqueid']),_0x5db69a);}}; \ No newline at end of file +var _0x2465=['lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','CreateVoiceCallReport','request','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','context','channel','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','answertime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','cdr','split','substring'];(function(_0x18582e,_0x2f6c1e){var _0x2768ae=function(_0x30aabe){while(--_0x30aabe){_0x18582e['push'](_0x18582e['shift']());}};_0x2768ae(++_0x2f6c1e);}(_0x2465,0x73));var _0x5246=function(_0x1bdfc7,_0x5993dd){_0x1bdfc7=_0x1bdfc7-0x0;var _0x48018f=_0x2465[_0x1bdfc7];return _0x48018f;};'use strict';var _=require(_0x5246('0x0'));var util=require(_0x5246('0x1'));var utils=require(_0x5246('0x2'));var transfers=require(_0x5246('0x3'));var dispositions=[_0x5246('0x4'),_0x5246('0x5'),_0x5246('0x5'),_0x5246('0x4'),_0x5246('0x4'),_0x5246('0x4'),'ANSWERED',_0x5246('0x6'),_0x5246('0x5'),'FAILED',_0x5246('0x5')];var channels={};function writeDB(_0xc444b2){var _0x44ba7e;if(transfers[_0x5246('0x7')][_0xc444b2[_0x5246('0x8')]]){_0x44ba7e=_0xc444b2[_0x5246('0x8')];_0xc444b2['uniqueid']=transfers['blinds'][_0xc444b2[_0x5246('0x8')]][_0x5246('0x9')];}utils[_0x5246('0xa')](util[_0x5246('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xc444b2['uniqueid'],_0xc444b2['channel'],_0xc444b2[_0x5246('0xc')],_0xc444b2[_0x5246('0xd')],_0xc444b2['interface'],_0xc444b2[_0x5246('0xe')],_0xc444b2[_0x5246('0xf')],_0xc444b2[_0x5246('0x10')]));if(_0xc444b2[_0x5246('0x11')]){utils['getUserByInternal'](_0xc444b2[_0x5246('0x11')])[_0x5246('0x12')](function(_0x5e92b3){if(_0x5e92b3){_0xc444b2['UserId']=_0x5e92b3['id'];}utils['request'](_0x5246('0x13'),_0xc444b2);});}else{utils[_0x5246('0x14')](_0x5246('0x13'),_0xc444b2);}if(channels[_0xc444b2[_0x5246('0x8')]]){delete channels[_0xc444b2[_0x5246('0x8')]];}else if(_0x44ba7e&&channels[_0x44ba7e]){delete transfers[_0x5246('0x7')][_0x44ba7e];delete channels[_0x44ba7e];}}exports['newchannel']=function(_0x331901){try{utils[_0x5246('0x15')](util[_0x5246('0xb')](_0x5246('0x16'),_0x331901[_0x5246('0x8')]),_0x331901);if(_0x331901['uniqueid']==_0x331901[_0x5246('0x17')]&&_0x331901['channel']!=_0x5246('0x18')){utils[_0x5246('0xa')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x331901[_0x5246('0x8')],_0x331901['context'],_0x331901[_0x5246('0x19')]));channels[_0x331901[_0x5246('0x8')]]={'uniqueid':_0x331901[_0x5246('0x8')],'accountcode':_0x331901[_0x5246('0x11')],'source':_0x331901[_0x5246('0xe')],'destination':_0x331901[_0x5246('0x19')],'destinationcontext':_0x331901[_0x5246('0x1a')],'channel':_0x331901[_0x5246('0x1b')],'starttime':utils[_0x5246('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x5246('0x1d')};}}catch(_0x8740f3){utils[_0x5246('0x1e')](util[_0x5246('0xb')](_0x5246('0x16'),_0x331901[_0x5246('0x8')]),_0x8740f3);}};exports['newstate']=function(_0x55869e){try{utils['debug'](util[_0x5246('0xb')](_0x5246('0x1f'),_0x55869e['uniqueid']),_0x55869e);if(!_[_0x5246('0x20')](channels[_0x55869e[_0x5246('0x8')]])&&_0x55869e[_0x5246('0x21')]==0x6){utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x22'),_0x55869e[_0x5246('0x8')],_0x55869e[_0x5246('0x1a')],_0x55869e[_0x5246('0x1b')]));if(_[_0x5246('0x20')](channels[_0x55869e['uniqueid']][_0x5246('0x23')])){channels[_0x55869e[_0x5246('0x8')]][_0x5246('0x23')]=utils[_0x5246('0x1c')]();}}else if(!_['isNil'](channels[_0x55869e[_0x5246('0x17')]])&&_0x55869e[_0x5246('0x21')]==0x6&&_0x55869e[_0x5246('0x1a')]!=_0x5246('0x24')){utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x25'),_0x55869e[_0x5246('0x8')],_0x55869e[_0x5246('0x17')],_0x55869e['context'],_0x55869e[_0x5246('0x1b')]));channels[_0x55869e['linkedid']][_0x5246('0x11')]=_0x55869e['accountcode'];channels[_0x55869e[_0x5246('0x17')]][_0x5246('0x26')]=_0x55869e[_0x5246('0x1b')];if(_[_0x5246('0x20')](channels[_0x55869e[_0x5246('0x17')]]['answertime'])){channels[_0x55869e[_0x5246('0x17')]]['answertime']=utils[_0x5246('0x1c')]();}channels[_0x55869e[_0x5246('0x17')]][_0x5246('0x27')]=dispositions[_[_0x5246('0x28')](_0x55869e['channelstate'])]||_0x5246('0x29');}}catch(_0x15ad3f){utils['error'](util[_0x5246('0xb')]('[%s][calls][newstate]',_0x55869e['uniqueid']),_0x15ad3f);}};exports[_0x5246('0x2a')]=function(_0x91a0a2){try{if(!_[_0x5246('0x20')](channels[_0x91a0a2['uniqueid']])){utils['debug'](util[_0x5246('0xb')](_0x5246('0x2b'),_0x91a0a2['uniqueid']),_0x91a0a2);if(_[_0x5246('0x20')](channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x2c')])){channels[_0x91a0a2[_0x5246('0x8')]]['callerid']=_0x91a0a2[_0x5246('0x2d')]+'\x20<'+_0x91a0a2[_0x5246('0xe')]+'>';}utils[_0x5246('0xa')](util['format'](_0x5246('0x2e'),_0x91a0a2['uniqueid'],channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x2c')],_0x91a0a2[_0x5246('0x2f')]));channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x30')]=utils[_0x5246('0x1c')]();channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x31')]=utils[_0x5246('0x32')](channels[_0x91a0a2[_0x5246('0x8')]]['endtime'],channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x33')]);channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x34')]=channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x35')]?utils['diffTime'](channels[_0x91a0a2[_0x5246('0x8')]]['endtime'],channels[_0x91a0a2[_0x5246('0x8')]][_0x5246('0x35')]):0x0;writeDB(channels[_0x91a0a2['uniqueid']]);}}catch(_0x4da5ff){utils[_0x5246('0x1e')](util[_0x5246('0xb')](_0x5246('0x2b'),_0x91a0a2[_0x5246('0x8')]),_0x4da5ff);}};exports[_0x5246('0x36')]=function(_0x5b6f70){try{if(!_['isNil'](channels[_0x5b6f70[_0x5246('0x37')]])){utils[_0x5246('0x15')](util[_0x5246('0xb')](_0x5246('0x38'),_0x5b6f70[_0x5246('0x39')]),_0x5b6f70);if(channels[_0x5b6f70[_0x5246('0x37')]][_0x5246('0x1b')]==_0x5b6f70[_0x5246('0x3a')]){utils[_0x5246('0xa')](util[_0x5246('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5b6f70[_0x5246('0x39')],_0x5b6f70[_0x5246('0x37')],_0x5b6f70[_0x5246('0x3b')]));channels[_0x5b6f70['localtwolinkedid']]['destinationchannel']=_0x5b6f70[_0x5246('0x3b')];channels[_0x5b6f70['localtwolinkedid']]['userfield']=_0x5246('0x3c');}else if(channels[_0x5b6f70[_0x5246('0x37')]][_0x5246('0x1b')]=_0x5b6f70['transfertargetchannel']){utils[_0x5246('0xa')](util[_0x5246('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5b6f70[_0x5246('0x39')],_0x5b6f70[_0x5246('0x37')],_0x5b6f70['origtransfererchannel']));channels[_0x5b6f70[_0x5246('0x37')]][_0x5246('0x26')]=_0x5b6f70[_0x5246('0x3d')];channels[_0x5b6f70[_0x5246('0x37')]]['userfield']=_0x5246('0x3c');}}}catch(_0x3cc843){utils[_0x5246('0x1e')](util[_0x5246('0xb')](_0x5246('0x38'),_0x5b6f70[_0x5246('0x39')]),_0x3cc843);}};exports[_0x5246('0x3e')]=function(_0x46d6f3){try{if(!_[_0x5246('0x20')](channels[_0x46d6f3[_0x5246('0x8')]])){utils[_0x5246('0x15')](util[_0x5246('0xb')]('[%s][calls][musiconholdstart]',_0x46d6f3['uniqueid']),_0x46d6f3);channels[_0x46d6f3[_0x5246('0x8')]]['musiconholdstartAt']=utils['now']();utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x3f'),_0x46d6f3[_0x5246('0x8')],channels[_0x46d6f3[_0x5246('0x8')]]['musiconholdstartAt']));}}catch(_0x20c154){utils['error'](util[_0x5246('0xb')]('[%s][calls][musiconholdstart]',_0x46d6f3['uniqueid']),_0x20c154);}};exports['musiconholdstop']=function(_0x29ab8){try{if(!_[_0x5246('0x20')](channels[_0x29ab8[_0x5246('0x8')]])){utils[_0x5246('0x15')](util[_0x5246('0xb')](_0x5246('0x40'),_0x29ab8['uniqueid']),_0x29ab8);if(!_['isNil'](channels[_0x29ab8['uniqueid']][_0x5246('0x41')])){channels[_0x29ab8[_0x5246('0x8')]][_0x5246('0x42')]+=utils[_0x5246('0x32')](utils['now'](),channels[_0x29ab8[_0x5246('0x8')]][_0x5246('0x41')]);utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x43'),_0x29ab8['uniqueid'],channels[_0x29ab8[_0x5246('0x8')]][_0x5246('0x42')]));delete channels[_0x29ab8[_0x5246('0x8')]][_0x5246('0x41')];}}}catch(_0x32aecb){utils[_0x5246('0x1e')](util[_0x5246('0xb')]('[%s][calls][musiconholdstop]',_0x29ab8[_0x5246('0x8')]),_0x32aecb);}};exports['varset']=function(_0x469d8e){try{if(!_[_0x5246('0x20')](channels[_0x469d8e[_0x5246('0x8')]])){utils[_0x5246('0x15')](util[_0x5246('0xb')](_0x5246('0x44'),_0x469d8e['uniqueid']),_0x469d8e);if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x46')])){utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x47'),_0x469d8e['uniqueid'],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e['uniqueid']][_0x5246('0x49')]=_0x469d8e['value'];}if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')]['xmd-phone'])){utils['info'](util[_0x5246('0xb')](_0x5246('0x4a'),_0x469d8e[_0x5246('0x8')],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0x4b')]=_0x469d8e[_0x5246('0x48')];channels[_0x469d8e['uniqueid']][_0x5246('0x2c')]='\x22'+_0x469d8e['value']+_0x5246('0x4c')+_0x469d8e[_0x5246('0x48')]+'>';}if(!_['isNil'](_0x469d8e[_0x5246('0x45')][_0x5246('0x4d')])||!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x4e')])){utils[_0x5246('0xa')](util['format'](_0x5246('0x4f'),_0x469d8e['uniqueid'],!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x4d')])?_0x5246('0x4d'):_0x5246('0x4e'),_0x469d8e['value']));channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0x2c')]=_0x469d8e[_0x5246('0x48')];}if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x50')])||!_['isNil'](_0x469d8e['variable']['xmcs-queue'])){utils[_0x5246('0xa')](util['format'](_0x5246('0x4f'),_0x469d8e[_0x5246('0x8')],!_['isNil'](_0x469d8e[_0x5246('0x45')][_0x5246('0x50')])?_0x5246('0x50'):_0x5246('0x51'),_0x469d8e['value']));channels[_0x469d8e['uniqueid']][_0x5246('0x52')]='Queue';channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0x53')]=_0x469d8e[_0x5246('0x48')];channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0xc')]=!![];}if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x54')])){utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x55'),_0x469d8e[_0x5246('0x8')],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e['uniqueid']][_0x5246('0x56')]=_0x469d8e[_0x5246('0x48')];}if(!_[_0x5246('0x20')](_0x469d8e['variable'][_0x5246('0x57')])){utils[_0x5246('0xa')](util[_0x5246('0xb')](_0x5246('0x58'),_0x469d8e['uniqueid'],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e['uniqueid']][_0x5246('0x59')]=_0x469d8e[_0x5246('0x48')];}if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x5a')])){utils[_0x5246('0xa')](util['format'](_0x5246('0x5b'),_0x469d8e[_0x5246('0x8')],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0x5c')]=_0x469d8e['value'];}if(!_[_0x5246('0x20')](_0x469d8e[_0x5246('0x45')][_0x5246('0x5d')])){utils['info'](util[_0x5246('0xb')](_0x5246('0x5e'),_0x469d8e[_0x5246('0x8')],_0x469d8e[_0x5246('0x48')]));channels[_0x469d8e[_0x5246('0x8')]][_0x5246('0x5d')]=_0x469d8e['value'];}}}catch(_0x2102d1){utils[_0x5246('0x1e')](util[_0x5246('0xb')]('[%s][calls][varset]',_0x469d8e[_0x5246('0x8')]),_0x2102d1);}};exports[_0x5246('0x5f')]=function(_0x4f3eb4){try{if(!_['isNil'](channels[_0x4f3eb4[_0x5246('0x8')]])){utils['debug'](util['format'](_0x5246('0x60'),_0x4f3eb4['uniqueid']),_0x4f3eb4);utils['info'](util[_0x5246('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4f3eb4[_0x5246('0x8')],_0x4f3eb4[_0x5246('0x61')],_0x4f3eb4[_0x5246('0x62')]));if(_0x4f3eb4[_0x5246('0x61')][_0x5246('0x63')]()=='set'&&_['startsWith'](_0x4f3eb4['appdata']['toLowerCase'](),_0x5246('0x64'))){var _0x8a55cd=_0x4f3eb4['appdata'][_0x5246('0x65')]('=');var _0x504d3c=_0x8a55cd[0x0][_0x5246('0x66')](_0x8a55cd[0x0][_0x5246('0x67')]('(')+0x1,_0x8a55cd[0x0][_0x5246('0x67')](')'));var _0x233198=_0x8a55cd[0x1];channels[_0x4f3eb4[_0x5246('0x8')]][_0x504d3c]=_0x233198;}if(!_[_0x5246('0x68')]([_0x5246('0x2a'),_0x5246('0x69'),_0x5246('0x6a'),_0x5246('0x6b'),_0x5246('0x6c')],_0x4f3eb4[_0x5246('0x61')][_0x5246('0x63')]())){channels[_0x4f3eb4[_0x5246('0x8')]][_0x5246('0x52')]=_0x4f3eb4[_0x5246('0x61')];channels[_0x4f3eb4[_0x5246('0x8')]]['lastdata']=_0x4f3eb4[_0x5246('0x62')];}}}catch(_0x288fff){utils[_0x5246('0x1e')](util[_0x5246('0xb')]('[%s][calls][newexten]',_0x4f3eb4['uniqueid']),_0x288fff);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e9e0740..2a6d5c1 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 _0xbe64=['[core]\x20error','[core]\x20close','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x11dbba,_0x35d4eb){var _0x1bff76=function(_0x1dc29b){while(--_0x1dc29b){_0x11dbba['push'](_0x11dbba['shift']());}};_0x1bff76(++_0x35d4eb);}(_0xbe64,0x65));var _0x4be6=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xbe64[_0x28f1de];return _0x5b5dad;};'use strict';var utils=require('./utils');exports[_0x4be6('0x0')]=function(){utils[_0x4be6('0x1')](_0x4be6('0x2'));};exports[_0x4be6('0x3')]=function(){utils['info'](_0x4be6('0x4'));};exports[_0x4be6('0x5')]=function(){utils['info'](_0x4be6('0x6'));};exports['error']=function(_0x374c6e){utils['error'](_0x4be6('0x7'),_0x374c6e);};exports['close']=function(){utils[_0x4be6('0x1')](_0x4be6('0x8'));};exports['managerevent']=function(_0x51631e){}; \ No newline at end of file +var _0x559f=['./utils','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x2531ea,_0x1d596d){var _0x14a29c=function(_0x369c95){while(--_0x369c95){_0x2531ea['push'](_0x2531ea['shift']());}};_0x14a29c(++_0x1d596d);}(_0x559f,0x1ae));var _0xf559=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x559f[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xf559('0x0'));exports['connect']=function(){utils[_0xf559('0x1')]('[core]\x20connected');};exports[_0xf559('0x2')]=function(){utils['info'](_0xf559('0x3'));};exports['fullybooted']=function(){utils[_0xf559('0x1')](_0xf559('0x4'));};exports[_0xf559('0x5')]=function(_0x5e6425){utils[_0xf559('0x5')](_0xf559('0x6'),_0x5e6425);};exports[_0xf559('0x7')]=function(){utils[_0xf559('0x1')](_0xf559('0x8'));};exports[_0xf559('0x9')]=function(_0x4d6d5d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 814684f..344de5b 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 _0x44e3=['info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','[%s][dials][newexten]','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','assign','now','lastevent','called','starttime','[%s][dials][dialend]','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils'];(function(_0x3bb650,_0x1ea09b){var _0x369794=function(_0x1c942f){while(--_0x1c942f){_0x3bb650['push'](_0x3bb650['shift']());}};_0x369794(++_0x1ea09b);}(_0x44e3,0x141));var _0x344e=function(_0x3aea29,_0x57a92b){_0x3aea29=_0x3aea29-0x0;var _0x884fd6=_0x44e3[_0x3aea29];return _0x884fd6;};'use strict';var _=require(_0x344e('0x0'));var util=require(_0x344e('0x1'));var utils=require(_0x344e('0x2'));var dials={};function writeDB(_0x5478dd){utils[_0x344e('0x3')](util[_0x344e('0x4')](_0x344e('0x5'),_0x5478dd[_0x344e('0x6')],_0x5478dd[_0x344e('0x7')],_0x5478dd[_0x344e('0x8')],_0x5478dd[_0x344e('0x9')],_0x5478dd[_0x344e('0xa')],_0x5478dd[_0x344e('0xb')]));utils[_0x344e('0xc')](_0x344e('0xd'),_0x5478dd);delete dials[_0x5478dd[_0x344e('0x6')]];}exports[_0x344e('0xe')]=function(_0x8950d9){try{utils[_0x344e('0xf')](util[_0x344e('0x4')]('[%s][dials][newexten]',_0x8950d9[_0x344e('0x6')]),_0x8950d9);utils['info'](util[_0x344e('0x4')](_0x344e('0x10'),_0x8950d9[_0x344e('0x6')],_0x8950d9['application'],_0x8950d9['appdata']));if(_0x8950d9[_0x344e('0x11')][_0x344e('0x12')]()==_0x344e('0x13')&&_[_0x344e('0x14')](_0x8950d9[_0x344e('0x15')]['toLowerCase'](),_0x344e('0x16'))){var _0x28c50e=_0x8950d9['appdata'][_0x344e('0x17')]('=');dials[_0x8950d9[_0x344e('0x6')]]={'routeId':_0x28c50e[0x1]};}}catch(_0x42f371){utils[_0x344e('0x18')](util['format'](_0x344e('0x19'),_0x8950d9[_0x344e('0x6')]),_0x42f371);}};exports['varset']=function(_0x3be3e9){try{utils[_0x344e('0xf')](util[_0x344e('0x4')](_0x344e('0x1a'),_0x3be3e9[_0x344e('0x6')]),_0x3be3e9);if(!_['isNil'](_0x3be3e9[_0x344e('0x1b')][_0x344e('0x1c')])){utils[_0x344e('0x3')](util[_0x344e('0x4')](_0x344e('0x1d'),_0x3be3e9[_0x344e('0x6')],_0x3be3e9[_0x344e('0x1e')]));dials[_0x3be3e9[_0x344e('0x6')]]={'routeId':_0x3be3e9[_0x344e('0x1e')]};}}catch(_0x4674bf){utils[_0x344e('0x18')](util[_0x344e('0x4')](_0x344e('0x1a'),_0x3be3e9[_0x344e('0x6')]),_0x4674bf);}};exports['dialbegin']=function(_0x3d8810){try{if(!_[_0x344e('0x1f')](dials[_0x3d8810[_0x344e('0x6')]])){utils[_0x344e('0xf')](util['format'](_0x344e('0x20'),_0x3d8810[_0x344e('0x6')]),_0x3d8810);dials[_0x3d8810[_0x344e('0x6')]]=_[_0x344e('0x21')](dials[_0x3d8810[_0x344e('0x6')]],_0x3d8810);dials[_0x3d8810[_0x344e('0x6')]]['starttime']=utils[_0x344e('0x22')]();dials[_0x3d8810['uniqueid']][_0x344e('0x23')]=_0x344e('0x24');utils[_0x344e('0x3')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3d8810[_0x344e('0x6')],dials[_0x3d8810['uniqueid']][_0x344e('0x25')]));}}catch(_0x52ddab){utils[_0x344e('0x18')](util['format'](_0x344e('0x20'),_0x3d8810[_0x344e('0x6')]),_0x52ddab);}};exports['dialend']=function(_0x23ff93){try{if(!_[_0x344e('0x1f')](dials[_0x23ff93['uniqueid']])){utils['debug'](util[_0x344e('0x4')](_0x344e('0x26'),_0x23ff93['uniqueid']),_0x23ff93);dials[_0x23ff93[_0x344e('0x6')]][_0x344e('0xb')]=_0x23ff93[_0x344e('0xb')];if(_0x23ff93[_0x344e('0xb')]=='ANSWER'){dials[_0x23ff93[_0x344e('0x6')]]=_['assign'](dials[_0x23ff93['uniqueid']],_0x23ff93);dials[_0x23ff93[_0x344e('0x6')]]['answertime']=utils[_0x344e('0x22')]();dials[_0x23ff93[_0x344e('0x6')]][_0x344e('0x23')]=_0x344e('0x27');utils[_0x344e('0x3')](util[_0x344e('0x4')](_0x344e('0x28'),_0x23ff93[_0x344e('0x6')],_0x23ff93[_0x344e('0xb')],dials[_0x23ff93[_0x344e('0x6')]][_0x344e('0x29')]));}else{utils[_0x344e('0x3')](util[_0x344e('0x4')](_0x344e('0x2a'),_0x23ff93[_0x344e('0x6')],_0x23ff93[_0x344e('0xb')]));}}}catch(_0x591369){utils['error'](util['format'](_0x344e('0x26'),_0x23ff93[_0x344e('0x6')]),_0x591369);}};exports[_0x344e('0x2b')]=function(_0x2c769a){try{if(!_['isNil'](dials[_0x2c769a[_0x344e('0x6')]])){utils[_0x344e('0xf')](util[_0x344e('0x4')](_0x344e('0x2c'),_0x2c769a[_0x344e('0x6')]),_0x2c769a);utils['info'](util[_0x344e('0x4')](_0x344e('0x2d'),_0x2c769a['uniqueid'],_0x2c769a[_0x344e('0x9')],_0x2c769a[_0x344e('0x2e')],_0x2c769a[_0x344e('0x2f')]));dials[_0x2c769a[_0x344e('0x6')]]=_['assign'](dials[_0x2c769a[_0x344e('0x6')]],{'endtime':utils[_0x344e('0x22')](),'lastevent':_0x344e('0x30')});dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x31')]=utils[_0x344e('0x32')](dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x33')],dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x25')]);dials[_0x2c769a['uniqueid']][_0x344e('0x34')]=utils[_0x344e('0x32')](dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x29')]||dials[_0x2c769a[_0x344e('0x6')]]['endtime'],dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x25')]);dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x35')]=dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x29')]?utils[_0x344e('0x32')](dials[_0x2c769a['uniqueid']][_0x344e('0x33')],dials[_0x2c769a[_0x344e('0x6')]][_0x344e('0x29')]):0x0;writeDB(dials[_0x2c769a[_0x344e('0x6')]]);}}catch(_0x421b30){utils[_0x344e('0x18')](util[_0x344e('0x4')](_0x344e('0x2c'),_0x2c769a[_0x344e('0x6')]),_0x421b30);}}; \ No newline at end of file +var _0x0ee8=['newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport'];(function(_0x197045,_0x37069b){var _0x692587=function(_0x338977){while(--_0x338977){_0x197045['push'](_0x197045['shift']());}};_0x692587(++_0x37069b);}(_0x0ee8,0x1b8));var _0x80ee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0ee8[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x80ee('0x0'));var util=require(_0x80ee('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x307a0d){utils[_0x80ee('0x2')](util['format'](_0x80ee('0x3'),_0x307a0d[_0x80ee('0x4')],_0x307a0d[_0x80ee('0x5')],_0x307a0d[_0x80ee('0x6')],_0x307a0d[_0x80ee('0x7')],_0x307a0d['connectedlinenum'],_0x307a0d[_0x80ee('0x8')]));utils['request'](_0x80ee('0x9'),_0x307a0d);delete dials[_0x307a0d[_0x80ee('0x4')]];}exports[_0x80ee('0xa')]=function(_0xcb0532){try{utils[_0x80ee('0xb')](util[_0x80ee('0xc')](_0x80ee('0xd'),_0xcb0532[_0x80ee('0x4')]),_0xcb0532);utils['info'](util['format'](_0x80ee('0xe'),_0xcb0532['uniqueid'],_0xcb0532[_0x80ee('0xf')],_0xcb0532[_0x80ee('0x10')]));if(_0xcb0532[_0x80ee('0xf')][_0x80ee('0x11')]()==_0x80ee('0x12')&&_[_0x80ee('0x13')](_0xcb0532[_0x80ee('0x10')][_0x80ee('0x11')](),_0x80ee('0x14'))){var _0x28a8d1=_0xcb0532['appdata']['split']('=');dials[_0xcb0532['uniqueid']]={'routeId':_0x28a8d1[0x1]};}}catch(_0x13594f){utils[_0x80ee('0x15')](util[_0x80ee('0xc')](_0x80ee('0xd'),_0xcb0532['uniqueid']),_0x13594f);}};exports[_0x80ee('0x16')]=function(_0x380170){try{utils[_0x80ee('0xb')](util['format']('[%s][dials][varset]',_0x380170[_0x80ee('0x4')]),_0x380170);if(!_[_0x80ee('0x17')](_0x380170[_0x80ee('0x18')]['outboundrouteid'])){utils[_0x80ee('0x2')](util[_0x80ee('0xc')](_0x80ee('0x19'),_0x380170[_0x80ee('0x4')],_0x380170['value']));dials[_0x380170['uniqueid']]={'routeId':_0x380170[_0x80ee('0x1a')]};}}catch(_0x1dbff2){utils['error'](util[_0x80ee('0xc')](_0x80ee('0x1b'),_0x380170[_0x80ee('0x4')]),_0x1dbff2);}};exports[_0x80ee('0x1c')]=function(_0x3225cf){try{if(!_['isNil'](dials[_0x3225cf[_0x80ee('0x4')]])){utils['debug'](util[_0x80ee('0xc')](_0x80ee('0x1d'),_0x3225cf['uniqueid']),_0x3225cf);dials[_0x3225cf[_0x80ee('0x4')]]=_[_0x80ee('0x1e')](dials[_0x3225cf[_0x80ee('0x4')]],_0x3225cf);dials[_0x3225cf[_0x80ee('0x4')]][_0x80ee('0x1f')]=utils[_0x80ee('0x20')]();dials[_0x3225cf[_0x80ee('0x4')]][_0x80ee('0x21')]=_0x80ee('0x22');utils['info'](util['format'](_0x80ee('0x23'),_0x3225cf[_0x80ee('0x4')],dials[_0x3225cf[_0x80ee('0x4')]][_0x80ee('0x1f')]));}}catch(_0x31f127){utils[_0x80ee('0x15')](util[_0x80ee('0xc')](_0x80ee('0x1d'),_0x3225cf[_0x80ee('0x4')]),_0x31f127);}};exports['dialend']=function(_0x6fbdc3){try{if(!_[_0x80ee('0x17')](dials[_0x6fbdc3[_0x80ee('0x4')]])){utils[_0x80ee('0xb')](util[_0x80ee('0xc')](_0x80ee('0x24'),_0x6fbdc3[_0x80ee('0x4')]),_0x6fbdc3);dials[_0x6fbdc3['uniqueid']][_0x80ee('0x8')]=_0x6fbdc3[_0x80ee('0x8')];if(_0x6fbdc3[_0x80ee('0x8')]==_0x80ee('0x25')){dials[_0x6fbdc3[_0x80ee('0x4')]]=_[_0x80ee('0x1e')](dials[_0x6fbdc3[_0x80ee('0x4')]],_0x6fbdc3);dials[_0x6fbdc3[_0x80ee('0x4')]][_0x80ee('0x26')]=utils[_0x80ee('0x20')]();dials[_0x6fbdc3[_0x80ee('0x4')]][_0x80ee('0x21')]=_0x80ee('0x27');utils[_0x80ee('0x2')](util[_0x80ee('0xc')](_0x80ee('0x28'),_0x6fbdc3[_0x80ee('0x4')],_0x6fbdc3[_0x80ee('0x8')],dials[_0x6fbdc3[_0x80ee('0x4')]][_0x80ee('0x26')]));}else{utils[_0x80ee('0x2')](util[_0x80ee('0xc')](_0x80ee('0x29'),_0x6fbdc3['uniqueid'],_0x6fbdc3[_0x80ee('0x8')]));}}}catch(_0x2ad32c){utils['error'](util['format'](_0x80ee('0x24'),_0x6fbdc3[_0x80ee('0x4')]),_0x2ad32c);}};exports[_0x80ee('0x2a')]=function(_0x56a6cd){try{if(!_[_0x80ee('0x17')](dials[_0x56a6cd['uniqueid']])){utils['debug'](util['format']('[%s][dials][hangup]',_0x56a6cd[_0x80ee('0x4')]),_0x56a6cd);utils[_0x80ee('0x2')](util[_0x80ee('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x56a6cd[_0x80ee('0x4')],_0x56a6cd[_0x80ee('0x7')],_0x56a6cd[_0x80ee('0x2b')],_0x56a6cd[_0x80ee('0x2c')]));dials[_0x56a6cd[_0x80ee('0x4')]]=_[_0x80ee('0x1e')](dials[_0x56a6cd[_0x80ee('0x4')]],{'endtime':utils[_0x80ee('0x20')](),'lastevent':_0x80ee('0x2d')});dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x2e')]=utils[_0x80ee('0x2f')](dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x30')],dials[_0x56a6cd[_0x80ee('0x4')]]['starttime']);dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x31')]=utils['diffTime'](dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x26')]||dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x30')],dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x1f')]);dials[_0x56a6cd[_0x80ee('0x4')]]['billableseconds']=dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x26')]?utils[_0x80ee('0x2f')](dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x30')],dials[_0x56a6cd[_0x80ee('0x4')]][_0x80ee('0x26')]):0x0;writeDB(dials[_0x56a6cd['uniqueid']]);}}catch(_0x5a7f1e){utils[_0x80ee('0x15')](util[_0x80ee('0xc')]('[%s][dials][hangup]',_0x56a6cd['uniqueid']),_0x5a7f1e);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index aa154bd..b49f78c 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 _0x9e6e=['[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','username','password','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x9e6e,0x154));var _0xe9e6=function(_0x1a0e46,_0x510f37){_0x1a0e46=_0x1a0e46-0x0;var _0x5dee50=_0x9e6e[_0x1a0e46];return _0x5dee50;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe9e6('0x0'));var utils=require(_0xe9e6('0x1'));var util=require(_0xe9e6('0x2'));var ami=new AsteriskManager(config[_0xe9e6('0x3')][_0xe9e6('0x4')],config[_0xe9e6('0x3')]['ip'],config[_0xe9e6('0x3')][_0xe9e6('0x5')],config[_0xe9e6('0x3')][_0xe9e6('0x6')],!![]);ami['keepConnected']();if(config['xdr']&&config[_0xe9e6('0x7')][_0xe9e6('0x8')]){utils[_0xe9e6('0x9')](_0xe9e6('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xe9e6('0xb'));var queues=require(_0xe9e6('0xc'));var recordings=require('./recordings.controller');var members=require(_0xe9e6('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xe9e6('0xe'),core[_0xe9e6('0xe')]);ami['on']('shutdown',core['shutdown']);ami['on']('fullybooted',core[_0xe9e6('0xf')]);ami['on']('error',core[_0xe9e6('0x10')]);ami['on']('close',core[_0xe9e6('0x11')]);ami['on'](_0xe9e6('0x12'),core[_0xe9e6('0x12')]);ami['on'](_0xe9e6('0x13'),function(_0x1f8b63){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')](_0xe9e6('0x16'),_0x1f8b63[_0xe9e6('0x17')]),_0x1f8b63);members[_0xe9e6('0x13')](_0x1f8b63);}catch(_0x8a1072){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x16'),_0x1f8b63[_0xe9e6('0x17')]),_0x8a1072);}});ami['on'](_0xe9e6('0x18'),function(_0x23bb81){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][agentcalled]',_0x23bb81['uniqueid']),_0x23bb81);agents['agentcalled'](_0x23bb81);}catch(_0x49c7d7){utils['error'](util[_0xe9e6('0x15')](_0xe9e6('0x19'),_0x23bb81[_0xe9e6('0x1a')]),_0x49c7d7);}});ami['on'](_0xe9e6('0x1b'),function(_0x108c52){try{utils[_0xe9e6('0x14')](util['format'](_0xe9e6('0x1c'),_0x108c52[_0xe9e6('0x1a')]),_0x108c52);agents[_0xe9e6('0x1b')](_0x108c52);}catch(_0x4cdc66){utils[_0xe9e6('0x10')](util['format'](_0xe9e6('0x1c'),_0x108c52[_0xe9e6('0x1a')]),_0x4cdc66);}});ami['on'](_0xe9e6('0x1d'),function(_0x4ce3ab){try{utils['debug'](util['format'](_0xe9e6('0x1e'),_0x4ce3ab[_0xe9e6('0x1a')]),_0x4ce3ab);agents[_0xe9e6('0x1d')](_0x4ce3ab);queues[_0xe9e6('0x1d')](_0x4ce3ab);}catch(_0x19a544){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x1e'),_0x4ce3ab[_0xe9e6('0x1a')]),_0x19a544);}});ami['on'](_0xe9e6('0x1f'),function(_0x29916a){try{utils[_0xe9e6('0x14')](util['format'](_0xe9e6('0x20'),_0x29916a[_0xe9e6('0x1a')]),_0x29916a);agents[_0xe9e6('0x1f')](_0x29916a);queues[_0xe9e6('0x1f')](_0x29916a);members['agentcomplete'](_0x29916a);}catch(_0x38b2a1){utils['error'](util[_0xe9e6('0x15')]('[%s][index][agentcomplete]',_0x29916a[_0xe9e6('0x1a')]),_0x38b2a1);}});ami['on']('queuecallerabandon',function(_0xa6f4b){try{utils['debug'](util[_0xe9e6('0x15')](_0xe9e6('0x21'),_0xa6f4b['uniqueid']),_0xa6f4b);agents['queuecallerabandon'](_0xa6f4b);queues[_0xe9e6('0x22')](_0xa6f4b);}catch(_0x58f80c){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x21'),_0xa6f4b['uniqueid']),_0x58f80c);}});ami['on'](_0xe9e6('0x23'),function(_0x4e4ca1){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')](_0xe9e6('0x24'),_0x4e4ca1[_0xe9e6('0x1a')]),_0x4e4ca1);queues['queuecallerjoin'](_0x4e4ca1);recordings['queuecallerjoin'](_0x4e4ca1);}catch(_0x133db1){utils['error'](util[_0xe9e6('0x15')](_0xe9e6('0x24'),_0x4e4ca1[_0xe9e6('0x1a')]),_0x133db1);}});ami['on'](_0xe9e6('0x25'),function(_0x499da1){try{utils[_0xe9e6('0x14')](util['format']('[%s][index][queuecallerleave]',_0x499da1[_0xe9e6('0x1a')]),_0x499da1);queues[_0xe9e6('0x25')](_0x499da1);}catch(_0x173613){utils[_0xe9e6('0x10')](util['format'](_0xe9e6('0x26'),_0x499da1['uniqueid']),_0x173613);}});ami['on'](_0xe9e6('0x27'),function(_0x24be4a){try{utils['debug'](util['format'](_0xe9e6('0x28'),_0x24be4a['uniqueid']),_0x24be4a);queues['musiconholdstart'](_0x24be4a);calls[_0xe9e6('0x27')](_0x24be4a);}catch(_0x26dd76){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x28'),_0x24be4a[_0xe9e6('0x1a')]),_0x26dd76);}});ami['on'](_0xe9e6('0x29'),function(_0x344455){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')](_0xe9e6('0x2a'),_0x344455[_0xe9e6('0x1a')]),_0x344455);queues['musiconholdstop'](_0x344455);calls[_0xe9e6('0x29')](_0x344455);}catch(_0x2c8e03){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x2a'),_0x344455[_0xe9e6('0x1a')]),_0x2c8e03);}});ami['on']('newstate',function(_0x41d67e){try{utils[_0xe9e6('0x14')](util['format']('[%s][index][newstate]',_0x41d67e[_0xe9e6('0x1a')]),_0x41d67e);calls[_0xe9e6('0x2b')](_0x41d67e);recordings[_0xe9e6('0x2b')](_0x41d67e);}catch(_0x547014){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x2c'),_0x41d67e[_0xe9e6('0x1a')]),_0x547014);}});ami['on'](_0xe9e6('0x2d'),function(_0xad5268){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')](_0xe9e6('0x2e'),_0xad5268[_0xe9e6('0x1a')]),_0xad5268);calls[_0xe9e6('0x2d')](_0xad5268);recordings[_0xe9e6('0x2d')](_0xad5268);dials[_0xe9e6('0x2d')](_0xad5268);agents[_0xe9e6('0x2d')](_0xad5268);queues[_0xe9e6('0x2d')](_0xad5268);}catch(_0x5acbbc){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')]('[%s][index][hangup]',_0xad5268[_0xe9e6('0x1a')]),_0x5acbbc);}});ami['on'](_0xe9e6('0x2f'),function(_0x5bd9b3){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][cdr]',_0x5bd9b3['uniqueid']),_0x5bd9b3);members['cdr'](_0x5bd9b3);}catch(_0x4701ad){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x30'),_0x5bd9b3[_0xe9e6('0x1a')]),_0x4701ad);}});ami['on']('blindtransfer',function(_0x214d54){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][blindtransfer]',_0x214d54[_0xe9e6('0x1a')]),_0x214d54);queues['blindtransfer'](_0x214d54);agents[_0xe9e6('0x31')](_0x214d54);transfers['blindtransfer'](_0x214d54);}catch(_0x4fbb90){utils[_0xe9e6('0x10')](util['format'](_0xe9e6('0x32'),_0x214d54[_0xe9e6('0x1a')]),_0x4fbb90);}});ami['on'](_0xe9e6('0x33'),function(_0x1e558b){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][attendedtransfer]',_0x1e558b['origtransfereruniqueid']),_0x1e558b);queues[_0xe9e6('0x33')](_0x1e558b);transfers['attendedtransfer'](_0x1e558b);agents[_0xe9e6('0x33')](_0x1e558b);calls[_0xe9e6('0x33')](_0x1e558b);}catch(_0x5a08c9){utils[_0xe9e6('0x10')](util['format']('[%s][index][attendedtransfer]',_0x1e558b[_0xe9e6('0x34')]),_0x5a08c9);}});ami['on']('varset',function(_0xa56c5a){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][varset]',_0xa56c5a[_0xe9e6('0x1a')]),_0xa56c5a);queues['varset'](_0xa56c5a);recordings[_0xe9e6('0x35')](_0xa56c5a);calls[_0xe9e6('0x35')](_0xa56c5a);dials[_0xe9e6('0x35')](_0xa56c5a);}catch(_0x35581f){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x36'),_0xa56c5a['uniqueid']),_0x35581f);}});ami['on'](_0xe9e6('0x37'),function(_0x30a643){try{utils[_0xe9e6('0x14')](util[_0xe9e6('0x15')]('[%s][index][newexten]',_0x30a643[_0xe9e6('0x1a')]),_0x30a643);calls[_0xe9e6('0x37')](_0x30a643);recordings[_0xe9e6('0x37')](_0x30a643);dials['newexten'](_0x30a643);}catch(_0x40ae40){utils[_0xe9e6('0x10')](util['format'](_0xe9e6('0x38'),_0x30a643[_0xe9e6('0x1a')]),_0x40ae40);}});ami['on'](_0xe9e6('0x39'),function(_0x404758){try{utils[_0xe9e6('0x14')](util['format'](_0xe9e6('0x3a'),_0x404758[_0xe9e6('0x1a')]),_0x404758);calls[_0xe9e6('0x39')](_0x404758);recordings['newchannel'](_0x404758);}catch(_0x232f1a){utils[_0xe9e6('0x10')](util['format'](_0xe9e6('0x3a'),_0x404758['uniqueid']),_0x232f1a);}});ami['on'](_0xe9e6('0x3b'),function(_0x44d94e){try{utils['debug'](util[_0xe9e6('0x15')](_0xe9e6('0x3c'),_0x44d94e[_0xe9e6('0x1a')]),_0x44d94e);dials['dialbegin'](_0x44d94e);}catch(_0x2ca42d){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')]('[%s]dialbegin',_0x44d94e['uniqueid']),_0x2ca42d);}});ami['on']('dialend',function(_0x1bba0e){try{utils['debug'](util[_0xe9e6('0x15')](_0xe9e6('0x3d'),_0x1bba0e[_0xe9e6('0x1a')]),_0x1bba0e);dials['dialend'](_0x1bba0e);}catch(_0x48ca4a){utils[_0xe9e6('0x10')](util[_0xe9e6('0x15')](_0xe9e6('0x3d'),_0x1bba0e[_0xe9e6('0x1a')]),_0x48ca4a);}});} \ No newline at end of file +var _0xe768=['varset','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','asterisk','port','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange','format','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer'];(function(_0x2d1e8e,_0x45e2d2){var _0x5e0884=function(_0x357262){while(--_0x357262){_0x2d1e8e['push'](_0x2d1e8e['shift']());}};_0x5e0884(++_0x45e2d2);}(_0xe768,0xc6));var _0x8e76=function(_0x1e9e1c,_0x2f7615){_0x1e9e1c=_0x1e9e1c-0x0;var _0x1ed91f=_0xe768[_0x1e9e1c];return _0x1ed91f;};var AsteriskManager=require(_0x8e76('0x0'));var config=require(_0x8e76('0x1'));var utils=require('./utils');var util=require('util');var ami=new AsteriskManager(config[_0x8e76('0x2')][_0x8e76('0x3')],config[_0x8e76('0x2')]['ip'],config[_0x8e76('0x2')][_0x8e76('0x4')],config[_0x8e76('0x2')]['password'],!![]);ami[_0x8e76('0x5')]();if(config['xdr']&&config[_0x8e76('0x6')][_0x8e76('0x7')]){utils[_0x8e76('0x8')](_0x8e76('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0x8e76('0xa'));var queues=require(_0x8e76('0xb'));var recordings=require(_0x8e76('0xc'));var members=require(_0x8e76('0xd'));var dials=require(_0x8e76('0xe'));var transfers=require('./transfers.controller');var core=require(_0x8e76('0xf'));ami['on'](_0x8e76('0x10'),core[_0x8e76('0x10')]);ami['on'](_0x8e76('0x11'),core[_0x8e76('0x11')]);ami['on']('fullybooted',core['fullybooted']);ami['on']('error',core[_0x8e76('0x12')]);ami['on'](_0x8e76('0x13'),core[_0x8e76('0x13')]);ami['on'](_0x8e76('0x14'),core[_0x8e76('0x14')]);ami['on']('devicestatechange',function(_0x2fb3a2){try{utils[_0x8e76('0x15')](util['format'](_0x8e76('0x16'),_0x2fb3a2[_0x8e76('0x17')]),_0x2fb3a2);members[_0x8e76('0x18')](_0x2fb3a2);}catch(_0x5a32dd){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x16'),_0x2fb3a2[_0x8e76('0x17')]),_0x5a32dd);}});ami['on'](_0x8e76('0x1a'),function(_0x47d4e4){try{utils[_0x8e76('0x15')](util['format']('[%s][index][agentcalled]',_0x47d4e4[_0x8e76('0x1b')]),_0x47d4e4);agents[_0x8e76('0x1a')](_0x47d4e4);}catch(_0x171d77){utils[_0x8e76('0x12')](util['format'](_0x8e76('0x1c'),_0x47d4e4['uniqueid']),_0x171d77);}});ami['on'](_0x8e76('0x1d'),function(_0x30cbd9){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x1e'),_0x30cbd9[_0x8e76('0x1b')]),_0x30cbd9);agents[_0x8e76('0x1d')](_0x30cbd9);}catch(_0x3f9208){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x1e'),_0x30cbd9[_0x8e76('0x1b')]),_0x3f9208);}});ami['on'](_0x8e76('0x1f'),function(_0x2ef2d0){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x20'),_0x2ef2d0['uniqueid']),_0x2ef2d0);agents[_0x8e76('0x1f')](_0x2ef2d0);queues[_0x8e76('0x1f')](_0x2ef2d0);}catch(_0x30e346){utils[_0x8e76('0x12')](util['format'](_0x8e76('0x20'),_0x2ef2d0[_0x8e76('0x1b')]),_0x30e346);}});ami['on']('agentcomplete',function(_0x936c3e){try{utils[_0x8e76('0x15')](util['format']('[%s][index][agentcomplete]',_0x936c3e[_0x8e76('0x1b')]),_0x936c3e);agents[_0x8e76('0x21')](_0x936c3e);queues[_0x8e76('0x21')](_0x936c3e);members['agentcomplete'](_0x936c3e);}catch(_0x1dd41d){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x22'),_0x936c3e['uniqueid']),_0x1dd41d);}});ami['on'](_0x8e76('0x23'),function(_0x485167){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')]('[%s][index][queuecallerabandon]',_0x485167[_0x8e76('0x1b')]),_0x485167);agents['queuecallerabandon'](_0x485167);queues['queuecallerabandon'](_0x485167);}catch(_0xce2339){utils['error'](util[_0x8e76('0x19')]('[%s][index][queuecallerabandon]',_0x485167[_0x8e76('0x1b')]),_0xce2339);}});ami['on'](_0x8e76('0x24'),function(_0x22b913){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x25'),_0x22b913['uniqueid']),_0x22b913);queues[_0x8e76('0x24')](_0x22b913);recordings[_0x8e76('0x24')](_0x22b913);}catch(_0x6949d9){utils['error'](util[_0x8e76('0x19')](_0x8e76('0x25'),_0x22b913[_0x8e76('0x1b')]),_0x6949d9);}});ami['on'](_0x8e76('0x26'),function(_0x3bf49e){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x27'),_0x3bf49e[_0x8e76('0x1b')]),_0x3bf49e);queues[_0x8e76('0x26')](_0x3bf49e);}catch(_0x41b5fa){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x3bf49e[_0x8e76('0x1b')]),_0x41b5fa);}});ami['on'](_0x8e76('0x28'),function(_0xf4b639){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x29'),_0xf4b639[_0x8e76('0x1b')]),_0xf4b639);queues[_0x8e76('0x28')](_0xf4b639);calls[_0x8e76('0x28')](_0xf4b639);}catch(_0x4e1549){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x29'),_0xf4b639[_0x8e76('0x1b')]),_0x4e1549);}});ami['on'](_0x8e76('0x2a'),function(_0x4557ef){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x2b'),_0x4557ef[_0x8e76('0x1b')]),_0x4557ef);queues[_0x8e76('0x2a')](_0x4557ef);calls['musiconholdstop'](_0x4557ef);}catch(_0x1e4855){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x2b'),_0x4557ef[_0x8e76('0x1b')]),_0x1e4855);}});ami['on'](_0x8e76('0x2c'),function(_0x3af52a){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x2d'),_0x3af52a[_0x8e76('0x1b')]),_0x3af52a);calls['newstate'](_0x3af52a);recordings[_0x8e76('0x2c')](_0x3af52a);}catch(_0x28b9ed){utils[_0x8e76('0x12')](util['format'](_0x8e76('0x2d'),_0x3af52a[_0x8e76('0x1b')]),_0x28b9ed);}});ami['on'](_0x8e76('0x2e'),function(_0x3434fb){try{utils[_0x8e76('0x15')](util['format'](_0x8e76('0x2f'),_0x3434fb[_0x8e76('0x1b')]),_0x3434fb);calls['hangup'](_0x3434fb);recordings['hangup'](_0x3434fb);dials[_0x8e76('0x2e')](_0x3434fb);agents[_0x8e76('0x2e')](_0x3434fb);queues['hangup'](_0x3434fb);}catch(_0x54fe58){utils[_0x8e76('0x12')](util['format']('[%s][index][hangup]',_0x3434fb[_0x8e76('0x1b')]),_0x54fe58);}});ami['on'](_0x8e76('0x30'),function(_0x15340d){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')]('[%s][index][cdr]',_0x15340d[_0x8e76('0x1b')]),_0x15340d);members[_0x8e76('0x30')](_0x15340d);}catch(_0x1a26d0){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x31'),_0x15340d[_0x8e76('0x1b')]),_0x1a26d0);}});ami['on'](_0x8e76('0x32'),function(_0x139ac1){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x33'),_0x139ac1['uniqueid']),_0x139ac1);queues['blindtransfer'](_0x139ac1);agents[_0x8e76('0x32')](_0x139ac1);transfers['blindtransfer'](_0x139ac1);}catch(_0x1a010a){utils['error'](util[_0x8e76('0x19')](_0x8e76('0x33'),_0x139ac1[_0x8e76('0x1b')]),_0x1a010a);}});ami['on']('attendedtransfer',function(_0x23d5f1){try{utils['debug'](util['format'](_0x8e76('0x34'),_0x23d5f1['origtransfereruniqueid']),_0x23d5f1);queues[_0x8e76('0x35')](_0x23d5f1);transfers['attendedtransfer'](_0x23d5f1);agents[_0x8e76('0x35')](_0x23d5f1);calls[_0x8e76('0x35')](_0x23d5f1);}catch(_0x5a89d2){utils[_0x8e76('0x12')](util[_0x8e76('0x19')]('[%s][index][attendedtransfer]',_0x23d5f1['origtransfereruniqueid']),_0x5a89d2);}});ami['on'](_0x8e76('0x36'),function(_0x499142){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')]('[%s][index][varset]',_0x499142[_0x8e76('0x1b')]),_0x499142);queues[_0x8e76('0x36')](_0x499142);recordings[_0x8e76('0x36')](_0x499142);calls[_0x8e76('0x36')](_0x499142);dials['varset'](_0x499142);}catch(_0x3fa06e){utils[_0x8e76('0x12')](util[_0x8e76('0x19')]('[%s][index][varset]',_0x499142[_0x8e76('0x1b')]),_0x3fa06e);}});ami['on'](_0x8e76('0x37'),function(_0x3e742d){try{utils[_0x8e76('0x15')](util['format']('[%s][index][newexten]',_0x3e742d['uniqueid']),_0x3e742d);calls[_0x8e76('0x37')](_0x3e742d);recordings[_0x8e76('0x37')](_0x3e742d);dials['newexten'](_0x3e742d);}catch(_0x14a9b3){utils['error'](util['format']('[%s][index][newexten]',_0x3e742d['uniqueid']),_0x14a9b3);}});ami['on']('newchannel',function(_0x325ecf){try{utils[_0x8e76('0x15')](util['format'](_0x8e76('0x38'),_0x325ecf[_0x8e76('0x1b')]),_0x325ecf);calls[_0x8e76('0x39')](_0x325ecf);recordings[_0x8e76('0x39')](_0x325ecf);}catch(_0x452870){utils[_0x8e76('0x12')](util[_0x8e76('0x19')]('[%s][index][newchannel]',_0x325ecf[_0x8e76('0x1b')]),_0x452870);}});ami['on'](_0x8e76('0x3a'),function(_0x3db08a){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x3b'),_0x3db08a[_0x8e76('0x1b')]),_0x3db08a);dials[_0x8e76('0x3a')](_0x3db08a);}catch(_0x425c98){utils[_0x8e76('0x12')](util[_0x8e76('0x19')](_0x8e76('0x3c'),_0x3db08a[_0x8e76('0x1b')]),_0x425c98);}});ami['on'](_0x8e76('0x3d'),function(_0x4485e7){try{utils[_0x8e76('0x15')](util[_0x8e76('0x19')](_0x8e76('0x3e'),_0x4485e7[_0x8e76('0x1b')]),_0x4485e7);dials[_0x8e76('0x3d')](_0x4485e7);}catch(_0xa4ddfd){utils[_0x8e76('0x12')](util[_0x8e76('0x19')]('[%s][index][dialend]',_0x4485e7[_0x8e76('0x1b')]),_0xa4ddfd);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c747b68..136a8bc 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 _0xec25=['membername','type','interface','then','internal','request','CreateMemberReport','getUserByName','split','name','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]','device','state','BUSY','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','error','cdr','[%s][members][cdr]','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xec25,0x1b9));var _0x5ec2=function(_0x47072e,_0x5511a1){_0x47072e=_0x47072e-0x0;var _0x3af79c=_0xec25[_0x47072e];return _0x3af79c;};'use strict';var _=require('lodash');var util=require(_0x5ec2('0x0'));var utils=require('./utils');var members={};var exclude=[_0x5ec2('0x1'),_0x5ec2('0x2')];function writeDB(_0x56f8a4){utils[_0x5ec2('0x3')](util[_0x5ec2('0x4')](_0x5ec2('0x5'),_0x56f8a4[_0x5ec2('0x6')],_0x56f8a4['interface'],_0x56f8a4[_0x5ec2('0x7')],_0x56f8a4[_0x5ec2('0x8')],_0x56f8a4[_0x5ec2('0x9')],_0x56f8a4[_0x5ec2('0xa')]));if(_0x56f8a4[_0x5ec2('0xb')]){utils['getUserByInterface'](_0x56f8a4['interface'])[_0x5ec2('0xc')](function(_0x37bb06){if(_0x37bb06){_0x56f8a4['membername']=_0x37bb06['name'];_0x56f8a4['internal']=_0x37bb06[_0x5ec2('0xd')];utils[_0x5ec2('0xe')](_0x5ec2('0xf'),_0x56f8a4);}else{utils[_0x5ec2('0x10')](_0x56f8a4['interface'][_0x5ec2('0x11')]('/')[0x1])[_0x5ec2('0xc')](function(_0x1c4e4d){if(_0x1c4e4d){_0x56f8a4[_0x5ec2('0x9')]=_0x1c4e4d[_0x5ec2('0x12')];_0x56f8a4[_0x5ec2('0xd')]=_0x1c4e4d[_0x5ec2('0xd')];utils[_0x5ec2('0xe')]('CreateMemberReport',_0x56f8a4);}});}})['catch'](function(_0x66e89){utils['error'](util[_0x5ec2('0x4')](_0x5ec2('0x13'),_0x56f8a4[_0x5ec2('0x6')]),_0x66e89);});}delete members[_0x56f8a4['interface']];}function startsWith(_0x3ebb80,_0x2e98c3){return _['some'](_0x3ebb80,function(_0x34833a){return _[_0x5ec2('0x14')](_0x2e98c3,_0x34833a);});}exports[_0x5ec2('0x15')]=function(_0x24c496){try{utils['debug'](util[_0x5ec2('0x4')](_0x5ec2('0x16'),members[_0x24c496[_0x5ec2('0x17')]]?members[_0x24c496[_0x5ec2('0x17')]][_0x5ec2('0x6')]:_0x24c496[_0x5ec2('0x17')]),_0x24c496);utils[_0x5ec2('0x3')](util[_0x5ec2('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x24c496['device']]?members[_0x24c496['device']][_0x5ec2('0x6')]:_0x24c496[_0x5ec2('0x17')],_0x24c496[_0x5ec2('0x18')],_0x24c496[_0x5ec2('0x17')]));switch(_0x24c496['state']){case'INUSE':case _0x5ec2('0x19'):if(!startsWith(exclude,_0x24c496[_0x5ec2('0x17')])){members[_0x24c496[_0x5ec2('0x17')]]={'channel':'voice','interface':_0x24c496[_0x5ec2('0x17')],'type':_0x5ec2('0x1a'),'enterAt':utils['now'](),'role':_0x5ec2('0x1b')};}break;case _0x5ec2('0x1c'):if(!_[_0x5ec2('0x1d')](members[_0x24c496[_0x5ec2('0x17')]])){members[_0x24c496['device']][_0x5ec2('0x1e')]=utils[_0x5ec2('0x1f')]();members[_0x24c496[_0x5ec2('0x17')]][_0x5ec2('0x20')]=utils[_0x5ec2('0x21')](members[_0x24c496[_0x5ec2('0x17')]]['exitAt'],members[_0x24c496[_0x5ec2('0x17')]][_0x5ec2('0x22')]);if(members[_0x24c496[_0x5ec2('0x17')]][_0x5ec2('0x6')]){writeDB(members[_0x24c496[_0x5ec2('0x17')]]);}}break;default:break;}}catch(_0x5d8de3){utils['error'](util[_0x5ec2('0x4')]('[%s][members][devicestatechange]',members[_0x24c496['device']]?members[_0x24c496['device']]['uniqueid']:_0x24c496[_0x5ec2('0x17')]),_0x5d8de3);}};exports[_0x5ec2('0x23')]=function(_0x1abec6){try{if(!_['isNil'](members[_0x1abec6[_0x5ec2('0xb')]])){utils[_0x5ec2('0x24')](util[_0x5ec2('0x4')](_0x5ec2('0x25'),_0x1abec6[_0x5ec2('0x6')]),_0x1abec6);utils[_0x5ec2('0x3')](util[_0x5ec2('0x4')](_0x5ec2('0x26'),_0x1abec6[_0x5ec2('0x6')],_0x1abec6[_0x5ec2('0xb')],_0x1abec6[_0x5ec2('0x27')]));members[_0x1abec6[_0x5ec2('0xb')]]=_[_0x5ec2('0x28')](members[_0x1abec6[_0x5ec2('0xb')]],{'data4':_0x1abec6[_0x5ec2('0x27')],'uniqueid':_0x1abec6['uniqueid']});}}catch(_0x1c78d9){utils[_0x5ec2('0x29')](util['format'](_0x5ec2('0x25'),_0x1abec6[_0x5ec2('0x6')]),_0x1c78d9);}};exports[_0x5ec2('0x2a')]=function(_0x17030e){try{utils[_0x5ec2('0x24')](util[_0x5ec2('0x4')](_0x5ec2('0x2b'),_0x17030e['uniqueid']),_0x17030e);if(_0x17030e['channel']){var _0x4cc1c4=_0x17030e[_0x5ec2('0x7')][_0x5ec2('0x11')]('-')[0x0];if(!_[_0x5ec2('0x1d')](members[_0x4cc1c4])){members[_0x4cc1c4]=_[_0x5ec2('0x28')](members[_0x4cc1c4],{'data1':members[_0x4cc1c4][_0x5ec2('0x2c')]||_0x17030e[_0x5ec2('0xa')],'data2':members[_0x4cc1c4][_0x5ec2('0x8')]||_0x17030e[_0x5ec2('0x2d')],'data3':members[_0x4cc1c4]['data3']||_0x17030e[_0x5ec2('0x2e')],'uniqueid':members[_0x4cc1c4][_0x5ec2('0x6')]||_0x17030e[_0x5ec2('0x6')]});utils[_0x5ec2('0x3')](util['format'](_0x5ec2('0x2f'),_0x17030e['uniqueid'],members[_0x4cc1c4]['data1'],members[_0x4cc1c4][_0x5ec2('0x8')],members[_0x4cc1c4][_0x5ec2('0x30')]));if(members[_0x4cc1c4][_0x5ec2('0x1e')]){writeDB(members[_0x4cc1c4]);}}}if(_0x17030e['destinationchannel']){var _0x25af46=_0x17030e[_0x5ec2('0x31')][_0x5ec2('0x11')]('-')[0x0];if(!_[_0x5ec2('0x1d')](members[_0x25af46])){members[_0x25af46]=_['assign'](members[_0x25af46],{'data1':members[_0x25af46][_0x5ec2('0x2c')]||_0x17030e[_0x5ec2('0xa')],'data2':members[_0x25af46]['data2']||_0x17030e['source'],'data3':members[_0x25af46][_0x5ec2('0x30')]||_0x17030e[_0x5ec2('0x2e')],'uniqueid':members[_0x25af46][_0x5ec2('0x6')]||_0x17030e[_0x5ec2('0x6')]});utils[_0x5ec2('0x3')](util[_0x5ec2('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x17030e[_0x5ec2('0x6')],members[_0x25af46][_0x5ec2('0x2c')],members[_0x25af46][_0x5ec2('0x8')],members[_0x25af46][_0x5ec2('0x30')]));if(members[_0x25af46]['exitAt']){writeDB(members[_0x25af46]);}}}}catch(_0x4c0e08){utils[_0x5ec2('0x29')](util[_0x5ec2('0x4')]('[%s][members][cdr]',_0x17030e[_0x5ec2('0x6')]),_0x4c0e08);}}; \ No newline at end of file +var _0x9234=['agentcomplete','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error'];(function(_0x3f04a4,_0x6c7563){var _0x1b6849=function(_0x3eba66){while(--_0x3eba66){_0x3f04a4['push'](_0x3f04a4['shift']());}};_0x1b6849(++_0x6c7563);}(_0x9234,0x1bd));var _0x4923=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x9234[_0x316904];return _0xfa9a21;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var utils=require(_0x4923('0x1'));var members={};var exclude=[_0x4923('0x2'),_0x4923('0x3')];function writeDB(_0x34915b){utils['info'](util[_0x4923('0x4')](_0x4923('0x5'),_0x34915b['uniqueid'],_0x34915b[_0x4923('0x6')],_0x34915b[_0x4923('0x7')],_0x34915b[_0x4923('0x8')],_0x34915b[_0x4923('0x9')],_0x34915b[_0x4923('0xa')]));if(_0x34915b[_0x4923('0x6')]){utils[_0x4923('0xb')](_0x34915b['interface'])[_0x4923('0xc')](function(_0x590bb6){if(_0x590bb6){_0x34915b[_0x4923('0x9')]=_0x590bb6[_0x4923('0xd')];_0x34915b[_0x4923('0xe')]=_0x590bb6['internal'];utils[_0x4923('0xf')](_0x4923('0x10'),_0x34915b);}else{utils[_0x4923('0x11')](_0x34915b[_0x4923('0x6')][_0x4923('0x12')]('/')[0x1])[_0x4923('0xc')](function(_0x3b1a18){if(_0x3b1a18){_0x34915b[_0x4923('0x9')]=_0x3b1a18[_0x4923('0xd')];_0x34915b[_0x4923('0xe')]=_0x3b1a18['internal'];utils['request'](_0x4923('0x10'),_0x34915b);}});}})[_0x4923('0x13')](function(_0x3748d1){utils['error'](util[_0x4923('0x4')](_0x4923('0x14'),_0x34915b[_0x4923('0x15')]),_0x3748d1);});}delete members[_0x34915b[_0x4923('0x6')]];}function startsWith(_0x27dbb2,_0x29a354){return _[_0x4923('0x16')](_0x27dbb2,function(_0x2897da){return _[_0x4923('0x17')](_0x29a354,_0x2897da);});}exports[_0x4923('0x18')]=function(_0x559e4a){try{utils[_0x4923('0x19')](util[_0x4923('0x4')](_0x4923('0x1a'),members[_0x559e4a[_0x4923('0x1b')]]?members[_0x559e4a['device']]['uniqueid']:_0x559e4a[_0x4923('0x1b')]),_0x559e4a);utils['info'](util[_0x4923('0x4')](_0x4923('0x1c'),members[_0x559e4a['device']]?members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x15')]:_0x559e4a[_0x4923('0x1b')],_0x559e4a[_0x4923('0x1d')],_0x559e4a['device']));switch(_0x559e4a[_0x4923('0x1d')]){case _0x4923('0x1e'):case'BUSY':if(!startsWith(exclude,_0x559e4a[_0x4923('0x1b')])){members[_0x559e4a['device']]={'channel':_0x4923('0x1f'),'interface':_0x559e4a[_0x4923('0x1b')],'type':'TALKING','enterAt':utils[_0x4923('0x20')](),'role':_0x4923('0x21')};}break;case _0x4923('0x22'):if(!_[_0x4923('0x23')](members[_0x559e4a[_0x4923('0x1b')]])){members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x24')]=utils['now']();members[_0x559e4a['device']][_0x4923('0x25')]=utils[_0x4923('0x26')](members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x24')],members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x27')]);if(members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x15')]){writeDB(members[_0x559e4a[_0x4923('0x1b')]]);}}break;default:break;}}catch(_0x18fc90){utils[_0x4923('0x28')](util['format'](_0x4923('0x1a'),members[_0x559e4a[_0x4923('0x1b')]]?members[_0x559e4a[_0x4923('0x1b')]][_0x4923('0x15')]:_0x559e4a[_0x4923('0x1b')]),_0x18fc90);}};exports[_0x4923('0x29')]=function(_0x158a30){try{if(!_[_0x4923('0x23')](members[_0x158a30[_0x4923('0x6')]])){utils[_0x4923('0x19')](util[_0x4923('0x4')](_0x4923('0x2a'),_0x158a30[_0x4923('0x15')]),_0x158a30);utils[_0x4923('0x2b')](util['format'](_0x4923('0x2c'),_0x158a30[_0x4923('0x15')],_0x158a30[_0x4923('0x6')],_0x158a30[_0x4923('0x2d')]));members[_0x158a30[_0x4923('0x6')]]=_[_0x4923('0x2e')](members[_0x158a30[_0x4923('0x6')]],{'data4':_0x158a30[_0x4923('0x2d')],'uniqueid':_0x158a30['uniqueid']});}}catch(_0x590243){utils[_0x4923('0x28')](util['format']('[%s][members][agentcomplete]',_0x158a30['uniqueid']),_0x590243);}};exports[_0x4923('0x2f')]=function(_0x39d3ae){try{utils[_0x4923('0x19')](util[_0x4923('0x4')]('[%s][members][cdr]',_0x39d3ae[_0x4923('0x15')]),_0x39d3ae);if(_0x39d3ae['channel']){var _0x436e5b=_0x39d3ae[_0x4923('0x7')][_0x4923('0x12')]('-')[0x0];if(!_[_0x4923('0x23')](members[_0x436e5b])){members[_0x436e5b]=_[_0x4923('0x2e')](members[_0x436e5b],{'data1':members[_0x436e5b]['data1']||_0x39d3ae[_0x4923('0xa')],'data2':members[_0x436e5b]['data2']||_0x39d3ae['source'],'data3':members[_0x436e5b][_0x4923('0x30')]||_0x39d3ae[_0x4923('0x31')],'uniqueid':members[_0x436e5b][_0x4923('0x15')]||_0x39d3ae[_0x4923('0x15')]});utils[_0x4923('0x2b')](util[_0x4923('0x4')](_0x4923('0x32'),_0x39d3ae['uniqueid'],members[_0x436e5b][_0x4923('0x33')],members[_0x436e5b]['data2'],members[_0x436e5b]['data3']));if(members[_0x436e5b][_0x4923('0x24')]){writeDB(members[_0x436e5b]);}}}if(_0x39d3ae[_0x4923('0x34')]){var _0x4c7425=_0x39d3ae[_0x4923('0x34')][_0x4923('0x12')]('-')[0x0];if(!_['isNil'](members[_0x4c7425])){members[_0x4c7425]=_['assign'](members[_0x4c7425],{'data1':members[_0x4c7425][_0x4923('0x33')]||_0x39d3ae[_0x4923('0xa')],'data2':members[_0x4c7425]['data2']||_0x39d3ae['source'],'data3':members[_0x4c7425][_0x4923('0x30')]||_0x39d3ae[_0x4923('0x31')],'uniqueid':members[_0x4c7425][_0x4923('0x15')]||_0x39d3ae[_0x4923('0x15')]});utils[_0x4923('0x2b')](util['format'](_0x4923('0x32'),_0x39d3ae[_0x4923('0x15')],members[_0x4c7425]['data1'],members[_0x4c7425][_0x4923('0x8')],members[_0x4c7425]['data3']));if(members[_0x4c7425][_0x4923('0x24')]){writeDB(members[_0x4c7425]);}}}}catch(_0xd4a9f1){utils['error'](util[_0x4923('0x4')](_0x4923('0x35'),_0x39d3ae[_0x4923('0x15')]),_0xd4a9f1);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8c73278..b02179f 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 _0x5175=['clone','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','isNil','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid'];(function(_0x3c9fcf,_0x4f639f){var _0x26d6a5=function(_0x352d4c){while(--_0x352d4c){_0x3c9fcf['push'](_0x3c9fcf['shift']());}};_0x26d6a5(++_0x4f639f);}(_0x5175,0x71));var _0x5517=function(_0x3daee4,_0x1c7693){_0x3daee4=_0x3daee4-0x0;var _0x3a4fa7=_0x5175[_0x3daee4];return _0x3a4fa7;};'use strict';var _=require(_0x5517('0x0'));var util=require(_0x5517('0x1'));var utils=require(_0x5517('0x2'));var queues={};function writeDB(_0x1431af){utils[_0x5517('0x3')](util[_0x5517('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x1431af[_0x5517('0x5')],_0x1431af['channel'],_0x1431af[_0x5517('0x6')],_0x1431af[_0x5517('0x7')],_0x1431af[_0x5517('0x8')],_0x1431af[_0x5517('0x9')],_0x1431af[_0x5517('0xa')]));if(_0x1431af[_0x5517('0x6')]){utils['getVoiceQueueByName'](_0x1431af[_0x5517('0x6')])[_0x5517('0xb')](function(_0x3b2b58){if(_0x3b2b58){_0x1431af['type']=_0x3b2b58[_0x5517('0xc')];}utils['request'](_0x5517('0xd'),_0x1431af);});}else{utils[_0x5517('0xe')](_0x5517('0xd'),_0x1431af);}if(_0x1431af[_0x5517('0xf')]){delete queues[_0x1431af[_0x5517('0xf')]];}else{delete queues[_0x1431af[_0x5517('0x5')]];}}exports[_0x5517('0x10')]=function(_0x81df85){try{utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x12'),_0x81df85[_0x5517('0x5')]),_0x81df85);utils[_0x5517('0x3')](util['format'](_0x5517('0x13'),_0x81df85['uniqueid'],_0x81df85['queue'],_0x81df85['position']));queues[_0x81df85['uniqueid']]=_[_0x5517('0x14')](_0x81df85,{'originalposition':_0x81df85[_0x5517('0x15')],'queuecallerjoinAt':utils[_0x5517('0x16')](),'mohtime':0x0});}catch(_0x5820fc){utils[_0x5517('0x17')](util[_0x5517('0x4')]('[%s][queues][queuecallerjoin]',_0x81df85[_0x5517('0x5')]),_0x5820fc);}};exports[_0x5517('0x18')]=function(_0x3637fc){try{if(!_['isNil'](queues[_0x3637fc[_0x5517('0x5')]])){utils[_0x5517('0x11')](util[_0x5517('0x4')]('[%s][queues][hangup]',_0x3637fc[_0x5517('0x5')]),_0x3637fc);if(queues[_0x3637fc['uniqueid']][_0x5517('0x19')]){if(!queues[_0x3637fc['uniqueid']][_0x5517('0x1a')]&&!queues[_0x3637fc[_0x5517('0x5')]][_0x5517('0x1b')]){queues[_0x3637fc['uniqueid']]['queuecallercomplete']=!![];queues[_0x3637fc[_0x5517('0x5')]][_0x5517('0x1c')]=utils[_0x5517('0x16')]();queues[_0x3637fc[_0x5517('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x5517('0x3')](util['format'](_0x5517('0x1d'),_0x3637fc[_0x5517('0x5')],queues[_0x3637fc['uniqueid']][_0x5517('0x1e')],queues[_0x3637fc['uniqueid']][_0x5517('0xa')]));writeDB(queues[_0x3637fc['uniqueid']]);}else if(queues[_0x3637fc[_0x5517('0x5')]]['transfereduniqueid']){utils[_0x5517('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3637fc['uniqueid'],queues[_0x3637fc[_0x5517('0x5')]]['name'],queues[_0x3637fc[_0x5517('0x5')]]['transfereduniqueid']));queues[queues[_0x3637fc['uniqueid']][_0x5517('0xf')]]=queues[_0x3637fc[_0x5517('0x5')]];queues[queues[_0x3637fc['uniqueid']][_0x5517('0xf')]][_0x5517('0x1f')]=0x2;delete queues[_0x3637fc[_0x5517('0x5')]];}}}catch(_0x5b01c3){utils[_0x5517('0x17')](util[_0x5517('0x4')]('[%s][queues][hangup]',_0x3637fc['uniqueid']),_0x5b01c3);}};exports['varset']=function(_0x3e46d6){try{utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x20'),_0x3e46d6[_0x5517('0x5')]),_0x3e46d6);if(!_['isNil'](_0x3e46d6[_0x5517('0x21')][_0x5517('0x22')])&&_0x3e46d6['value'][_0x5517('0x23')]()!==_0x5517('0x24')){if(!_[_0x5517('0x25')](queues[_0x3e46d6['uniqueid']])){queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1a')]=![];queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x26')]=null;queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1b')]=!![];queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x27')]=utils[_0x5517('0x16')]();queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0xa')]=_0x3e46d6[_0x5517('0x28')]['toUpperCase']();utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x29'),_0x3e46d6[_0x5517('0x5')],queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1e')],_0x3e46d6[_0x5517('0x28')],queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0xa')]));writeDB(queues[_0x3e46d6[_0x5517('0x5')]]);}}else if(!_['isNil'](_0x3e46d6[_0x5517('0x21')][_0x5517('0x2a')])){if(!_[_0x5517('0x25')](queues[_0x3e46d6[_0x5517('0x5')]])&&!queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1a')]){queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1a')]=![];queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x26')]=null;queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1b')]=!![];queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x27')]=utils[_0x5517('0x16')]();queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0xa')]='EXITWITHKEY';utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x2b'),_0x3e46d6[_0x5517('0x5')],queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0x1e')],_0x3e46d6[_0x5517('0x28')],queues[_0x3e46d6[_0x5517('0x5')]][_0x5517('0xa')]));}}}catch(_0xa12559){utils['error'](util[_0x5517('0x4')](_0x5517('0x20'),_0x3e46d6[_0x5517('0x5')]),_0xa12559);}};exports[_0x5517('0x1a')]=function(_0x11b0b7){try{if(!_[_0x5517('0x25')](queues[_0x11b0b7[_0x5517('0x5')]])){utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x2c'),_0x11b0b7['uniqueid']),_0x11b0b7);queues[_0x11b0b7[_0x5517('0x5')]][_0x5517('0x1b')]=![];queues[_0x11b0b7[_0x5517('0x5')]][_0x5517('0x27')]=null;queues[_0x11b0b7[_0x5517('0x5')]][_0x5517('0x1a')]=!![];queues[_0x11b0b7[_0x5517('0x5')]][_0x5517('0x26')]=utils[_0x5517('0x16')]();queues[_0x11b0b7['uniqueid']][_0x5517('0xa')]=_0x5517('0x2d');utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x2e'),_0x11b0b7[_0x5517('0x5')],queues[_0x11b0b7[_0x5517('0x5')]][_0x5517('0x1e')],queues[_0x11b0b7['uniqueid']]['queuecallerexitreason']));}}catch(_0x592168){utils[_0x5517('0x17')](util['format'](_0x5517('0x2c'),_0x11b0b7[_0x5517('0x5')]),_0x592168);}};exports[_0x5517('0x2f')]=function(_0x463636){try{if(!_['isNil'](queues[_0x463636['uniqueid']])){utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x30'),_0x463636[_0x5517('0x5')]),_0x463636);utils[_0x5517('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x463636[_0x5517('0x5')],queues[_0x463636['uniqueid']]['name'],_0x463636[_0x5517('0x31')],_0x463636[_0x5517('0x32')]));queues[_0x463636[_0x5517('0x5')]][_0x5517('0x2f')]=!![];queues[_0x463636[_0x5517('0x5')]][_0x5517('0x19')]=utils[_0x5517('0x16')]();queues[_0x463636['uniqueid']][_0x5517('0x33')]=utils['diffTime'](queues[_0x463636[_0x5517('0x5')]][_0x5517('0x19')],queues[_0x463636[_0x5517('0x5')]]['queuecallerjoinAt']);queues[_0x463636[_0x5517('0x5')]][_0x5517('0x15')]=_0x463636[_0x5517('0x15')];queues[_0x463636['uniqueid']][_0x5517('0x34')]=_0x463636[_0x5517('0x34')];queues[_0x463636['uniqueid']][_0x5517('0x31')]=_0x463636[_0x5517('0x31')];queues[_0x463636[_0x5517('0x5')]][_0x5517('0x32')]=_0x463636[_0x5517('0x32')];}}catch(_0x22c346){utils[_0x5517('0x17')](util[_0x5517('0x4')]('[%s][queues][queuecallerleave]',_0x463636[_0x5517('0x5')]),_0x22c346);}};exports[_0x5517('0x35')]=function(_0x19df7b){try{if(!_[_0x5517('0x25')](queues[_0x19df7b[_0x5517('0x5')]])){utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x36'),_0x19df7b[_0x5517('0x5')]),_0x19df7b);utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x37'),_0x19df7b[_0x5517('0x5')],queues[_0x19df7b[_0x5517('0x5')]][_0x5517('0x1e')],_0x19df7b[_0x5517('0x38')],_0x19df7b[_0x5517('0x39')]));queues[_0x19df7b[_0x5517('0x5')]][_0x5517('0x1a')]=![];queues[_0x19df7b[_0x5517('0x5')]][_0x5517('0x1a')]=![];queues[_0x19df7b['uniqueid']]['queuecallerabandonAt']=null;queues[_0x19df7b[_0x5517('0x5')]][_0x5517('0x1b')]=![];queues[_0x19df7b[_0x5517('0x5')]][_0x5517('0xa')]=null;queues[_0x19df7b['uniqueid']]['queuecallerexitAt']=null;queues[_0x19df7b[_0x5517('0x5')]]['assigned']=!![];queues[_0x19df7b['uniqueid']][_0x5517('0x9')]=_0x19df7b[_0x5517('0x39')];queues[_0x19df7b['uniqueid']][_0x5517('0x7')]=_0x19df7b[_0x5517('0x38')];}}catch(_0x36ebf7){utils[_0x5517('0x17')](util[_0x5517('0x4')](_0x5517('0x36'),_0x19df7b[_0x5517('0x5')]),_0x36ebf7);}};exports[_0x5517('0x3a')]=function(_0x5bf4c7){try{if(!_[_0x5517('0x25')](queues[_0x5bf4c7['uniqueid']])){if(queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x19')]){utils[_0x5517('0x11')](util['format'](_0x5517('0x3b'),_0x5bf4c7[_0x5517('0x5')]),_0x5bf4c7);queues[_0x5bf4c7['uniqueid']][_0x5517('0x1a')]=![];queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x1a')]=![];queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x26')]=null;queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x1b')]=![];queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x27')]=null;queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x3c')]=!![];queues[_0x5bf4c7[_0x5517('0x5')]]['lastAssignedTo']=_0x5bf4c7[_0x5517('0x38')];queues[_0x5bf4c7['uniqueid']]['queuecallercomplete']=!![];queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x1c')]=utils[_0x5517('0x16')]();if(_0x5bf4c7[_0x5517('0x3d')]=='transfer'){if(!queues[_0x5bf4c7['uniqueid']][_0x5517('0x3e')]){queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0xa')]='TRANSFER';}}else{queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0xa')]=_0x5517('0x3f')+_0x5bf4c7['reason'][_0x5517('0x23')]();}utils[_0x5517('0x3')](util['format'](_0x5517('0x40'),_0x5bf4c7[_0x5517('0x5')],queues[_0x5bf4c7[_0x5517('0x5')]][_0x5517('0x1e')],_0x5bf4c7[_0x5517('0x38')],queues[_0x5bf4c7[_0x5517('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x5bf4c7[_0x5517('0x5')]]);}}}catch(_0x5b8309){utils[_0x5517('0x17')](util[_0x5517('0x4')](_0x5517('0x3b'),_0x5bf4c7[_0x5517('0x5')]),_0x5b8309);}};exports['blindtransfer']=function(_0x7e3c44){try{if(!_[_0x5517('0x25')](queues[_0x7e3c44[_0x5517('0x41')]])){utils['debug'](util['format'](_0x5517('0x42'),_0x7e3c44[_0x5517('0x5')]),_0x7e3c44);queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0x3e')]=!![];queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0x43')]=_0x5517('0x44');queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0x45')]=_0x7e3c44[_0x5517('0x46')];queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0x47')]=_0x7e3c44[_0x5517('0x41')];queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0xa')]=_0x5517('0x48');utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x49'),_0x7e3c44[_0x5517('0x5')],queues[_0x7e3c44[_0x5517('0x41')]][_0x5517('0x1e')],_0x7e3c44[_0x5517('0x41')],_0x7e3c44[_0x5517('0x46')]));}}catch(_0x1d5fde){utils['error'](util['format'](_0x5517('0x42'),_0x7e3c44[_0x5517('0x5')]),_0x1d5fde);}};exports['attendedtransfer']=function(_0x37e6d7){try{utils['debug'](util[_0x5517('0x4')]('[%s][queues][attendedtransfer]',_0x37e6d7[_0x5517('0x4a')]),_0x37e6d7);if(_0x37e6d7['origtransfereruniqueid']==_0x37e6d7[_0x5517('0x4b')]){if(!_[_0x5517('0x25')](queues[_0x37e6d7[_0x5517('0x4c')]])){utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x4d'),_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7[_0x5517('0x4c')]]['name'],_0x37e6d7[_0x5517('0x4e')]));queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0x3e')]=!![];queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0x43')]=_0x5517('0x4f');queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0x45')]=_0x37e6d7['origtransfererexten'];queues[_0x37e6d7['secondtransfererlinkedid']][_0x5517('0x47')]=_0x37e6d7[_0x5517('0x4a')];queues[_0x37e6d7['secondtransfererlinkedid']][_0x5517('0xa')]=_0x5517('0x50');}if(!_[_0x5517('0x25')](queues[_0x37e6d7['origtransfererlinkedid']])){if(_0x37e6d7[_0x5517('0x51')]&&queues[_0x37e6d7[_0x5517('0x51')]]){queues[_0x37e6d7[_0x5517('0x51')]][_0x5517('0x1f')]=0x1;queues[_0x37e6d7['transfereeuniqueid']]=_['clone'](queues[_0x37e6d7['transfereelinkedid']]);queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0xf')]=_0x37e6d7[_0x5517('0x52')];queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0x1f')]=0x2;queues[_0x37e6d7['transfereeuniqueid']][_0x5517('0x8')]=queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0x8')];queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0x53')]=queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0x53')];queues[_0x37e6d7[_0x5517('0x41')]]['queuecallerjoinAt']=utils['now']();queues[_0x37e6d7['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x5517('0x16')]();queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0x33')]=0x0;queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0x54')]=0x0;utils[_0x5517('0x3')](util[_0x5517('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7[_0x5517('0x41')]][_0x5517('0x1e')],queues[_0x37e6d7['transfereeuniqueid']][_0x5517('0x8')],queues[_0x37e6d7[_0x5517('0x41')]]['calleridname']));}else{utils[_0x5517('0x3')](util['format'](_0x5517('0x55'),_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7['origtransfererlinkedid']]['name'],_0x37e6d7[_0x5517('0x4c')]));queues[_0x37e6d7['origtransfererlinkedid']][_0x5517('0xf')]=_0x37e6d7['secondtransfererlinkedid'];}}}else if(_0x37e6d7[_0x5517('0x56')]==_0x37e6d7[_0x5517('0x4c')]){if(!_[_0x5517('0x25')](queues[_0x37e6d7[_0x5517('0x4b')]])){utils[_0x5517('0x3')](util[_0x5517('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7[_0x5517('0x4b')]][_0x5517('0x1e')],_0x37e6d7[_0x5517('0x56')],_0x37e6d7['secondtransfererexten']));queues[_0x37e6d7[_0x5517('0x4b')]]['transfer']=!![];queues[_0x37e6d7[_0x5517('0x4b')]][_0x5517('0x43')]='ATTENDED';queues[_0x37e6d7['origtransfererlinkedid']][_0x5517('0x45')]=_0x37e6d7[_0x5517('0x57')];queues[_0x37e6d7[_0x5517('0x4b')]][_0x5517('0x47')]=_0x37e6d7[_0x5517('0x56')];queues[_0x37e6d7[_0x5517('0x4b')]][_0x5517('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x5517('0x25')](queues[_0x37e6d7[_0x5517('0x4c')]])){if(_0x37e6d7[_0x5517('0x58')]&&queues[_0x37e6d7[_0x5517('0x58')]]){queues[_0x37e6d7[_0x5517('0x58')]]['queuecallerenterreason']=0x1;queues[_0x37e6d7[_0x5517('0x52')]]=_[_0x5517('0x59')](queues[_0x37e6d7[_0x5517('0x58')]]);queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0xf')]=_0x37e6d7[_0x5517('0x52')];queues[_0x37e6d7['transfertargetuniqueid']][_0x5517('0x1f')]=0x2;queues[_0x37e6d7['transfertargetuniqueid']]['calleridnum']=queues[_0x37e6d7[_0x5517('0x4b')]]['calleridnum'];queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0x53')]=queues[_0x37e6d7[_0x5517('0x4b')]][_0x5517('0x53')];queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0x5a')]=utils[_0x5517('0x16')]();queues[_0x37e6d7[_0x5517('0x52')]]['queuecallerleaveAt']=utils[_0x5517('0x16')]();queues[_0x37e6d7['transfertargetuniqueid']][_0x5517('0x33')]=0x0;queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0x54')]=0x0;utils['info'](util['format'](_0x5517('0x5b'),_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7[_0x5517('0x52')]]['name'],queues[_0x37e6d7['transfertargetuniqueid']][_0x5517('0xf')],queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0x8')],queues[_0x37e6d7[_0x5517('0x52')]][_0x5517('0x53')]));}else{utils['info'](util[_0x5517('0x4')](_0x5517('0x55'),_0x37e6d7[_0x5517('0x4a')],queues[_0x37e6d7[_0x5517('0x4c')]]['name'],_0x37e6d7[_0x5517('0x4b')]));queues[_0x37e6d7[_0x5517('0x4c')]][_0x5517('0xf')]=_0x37e6d7[_0x5517('0x4b')];}}}}catch(_0x5a1dca){utils['error'](util[_0x5517('0x4')](_0x5517('0x5c'),_0x37e6d7[_0x5517('0x4a')]),_0x5a1dca);}};exports[_0x5517('0x5d')]=function(_0x313e39){try{if(!_[_0x5517('0x25')](queues[_0x313e39[_0x5517('0x5')]])){utils[_0x5517('0x11')](util[_0x5517('0x4')](_0x5517('0x5e'),_0x313e39[_0x5517('0x5')]),_0x313e39);queues[_0x313e39[_0x5517('0x5')]][_0x5517('0x5f')]=utils[_0x5517('0x16')]();utils[_0x5517('0x3')](util['format'](_0x5517('0x60'),_0x313e39[_0x5517('0x5')],queues[_0x313e39[_0x5517('0x5')]][_0x5517('0x1e')],queues[_0x313e39[_0x5517('0x5')]][_0x5517('0x5f')]));}}catch(_0x393bac){utils['error'](util[_0x5517('0x4')](_0x5517('0x5e'),_0x313e39[_0x5517('0x5')]),_0x393bac);}};exports[_0x5517('0x61')]=function(_0x40f083){try{if(!_['isNil'](queues[_0x40f083[_0x5517('0x5')]])){if(!_['isNil'](queues[_0x40f083['uniqueid']][_0x5517('0x5f')])){utils[_0x5517('0x11')](util['format']('[%s][queues][musiconholdstop]',_0x40f083[_0x5517('0x5')]),_0x40f083);queues[_0x40f083['uniqueid']][_0x5517('0x54')]+=utils[_0x5517('0x62')](utils[_0x5517('0x16')](),queues[_0x40f083['uniqueid']][_0x5517('0x5f')]);utils[_0x5517('0x3')](util[_0x5517('0x4')](_0x5517('0x63'),_0x40f083['uniqueid'],queues[_0x40f083[_0x5517('0x5')]][_0x5517('0x1e')],queues[_0x40f083[_0x5517('0x5')]][_0x5517('0x54')]));delete queues[_0x40f083[_0x5517('0x5')]][_0x5517('0x5f')];}}}catch(_0x429b37){utils[_0x5517('0x17')](util[_0x5517('0x4')](_0x5517('0x64'),_0x40f083[_0x5517('0x5')]),_0x429b37);}}; \ No newline at end of file +var _0xd436=['[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','then','type','CreateVoiceQueueReport','request','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','now','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','extension','BLINDTRANSFER'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xd436,0x157));var _0x6d43=function(_0xc6cd9,_0x24938f){_0xc6cd9=_0xc6cd9-0x0;var _0x39ca4b=_0xd436[_0xc6cd9];return _0x39ca4b;};'use strict';var _=require(_0x6d43('0x0'));var util=require(_0x6d43('0x1'));var utils=require(_0x6d43('0x2'));var queues={};function writeDB(_0x3cbce9){utils['info'](util[_0x6d43('0x3')](_0x6d43('0x4'),_0x3cbce9[_0x6d43('0x5')],_0x3cbce9[_0x6d43('0x6')],_0x3cbce9[_0x6d43('0x7')],_0x3cbce9['lastAssignedTo'],_0x3cbce9[_0x6d43('0x8')],_0x3cbce9[_0x6d43('0x9')],_0x3cbce9['queuecallerexitreason']));if(_0x3cbce9['queue']){utils['getVoiceQueueByName'](_0x3cbce9[_0x6d43('0x7')])[_0x6d43('0xa')](function(_0x507ac0){if(_0x507ac0){_0x3cbce9[_0x6d43('0xb')]=_0x507ac0[_0x6d43('0xb')];}utils['request'](_0x6d43('0xc'),_0x3cbce9);});}else{utils[_0x6d43('0xd')](_0x6d43('0xc'),_0x3cbce9);}if(_0x3cbce9['transfereduniqueid']){delete queues[_0x3cbce9['transfereduniqueid']];}else{delete queues[_0x3cbce9['uniqueid']];}}exports['queuecallerjoin']=function(_0x825cc3){try{utils[_0x6d43('0xe')](util[_0x6d43('0x3')](_0x6d43('0xf'),_0x825cc3[_0x6d43('0x5')]),_0x825cc3);utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x11'),_0x825cc3[_0x6d43('0x5')],_0x825cc3[_0x6d43('0x7')],_0x825cc3[_0x6d43('0x12')]));queues[_0x825cc3[_0x6d43('0x5')]]=_[_0x6d43('0x13')](_0x825cc3,{'originalposition':_0x825cc3[_0x6d43('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x38b3d7){utils[_0x6d43('0x14')](util['format'](_0x6d43('0xf'),_0x825cc3['uniqueid']),_0x38b3d7);}};exports[_0x6d43('0x15')]=function(_0x17f2f2){try{if(!_[_0x6d43('0x16')](queues[_0x17f2f2[_0x6d43('0x5')]])){utils[_0x6d43('0xe')](util['format']('[%s][queues][hangup]',_0x17f2f2['uniqueid']),_0x17f2f2);if(queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x17')]){if(!queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x18')]&&!queues[_0x17f2f2['uniqueid']]['queuecallerexit']){queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x19')]=!![];queues[_0x17f2f2[_0x6d43('0x5')]]['queuecallercompleteAt']=utils[_0x6d43('0x1a')]();queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x1b')]='COMPLETEDBYAGENT';}utils[_0x6d43('0x10')](util['format'](_0x6d43('0x1c'),_0x17f2f2[_0x6d43('0x5')],queues[_0x17f2f2['uniqueid']][_0x6d43('0x1d')],queues[_0x17f2f2[_0x6d43('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x17f2f2['uniqueid']]);}else if(queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x1e')]){utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x1f'),_0x17f2f2[_0x6d43('0x5')],queues[_0x17f2f2['uniqueid']][_0x6d43('0x1d')],queues[_0x17f2f2['uniqueid']][_0x6d43('0x1e')]));queues[queues[_0x17f2f2[_0x6d43('0x5')]][_0x6d43('0x1e')]]=queues[_0x17f2f2[_0x6d43('0x5')]];queues[queues[_0x17f2f2['uniqueid']]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x17f2f2[_0x6d43('0x5')]];}}}catch(_0x5e21fe){utils[_0x6d43('0x14')](util[_0x6d43('0x3')]('[%s][queues][hangup]',_0x17f2f2['uniqueid']),_0x5e21fe);}};exports[_0x6d43('0x20')]=function(_0x366af4){try{utils[_0x6d43('0xe')](util[_0x6d43('0x3')](_0x6d43('0x21'),_0x366af4[_0x6d43('0x5')]),_0x366af4);if(!_[_0x6d43('0x16')](_0x366af4[_0x6d43('0x22')][_0x6d43('0x23')])&&_0x366af4[_0x6d43('0x24')][_0x6d43('0x25')]()!==_0x6d43('0x26')){if(!_['isNil'](queues[_0x366af4[_0x6d43('0x5')]])){queues[_0x366af4[_0x6d43('0x5')]]['queuecallerabandon']=![];queues[_0x366af4['uniqueid']][_0x6d43('0x27')]=null;queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x28')]=!![];queues[_0x366af4['uniqueid']][_0x6d43('0x29')]=utils[_0x6d43('0x1a')]();queues[_0x366af4[_0x6d43('0x5')]]['queuecallerexitreason']=_0x366af4[_0x6d43('0x24')][_0x6d43('0x25')]();utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x2a'),_0x366af4[_0x6d43('0x5')],queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x1d')],_0x366af4['value'],queues[_0x366af4['uniqueid']][_0x6d43('0x1b')]));writeDB(queues[_0x366af4[_0x6d43('0x5')]]);}}else if(!_[_0x6d43('0x16')](_0x366af4[_0x6d43('0x22')][_0x6d43('0x2b')])){if(!_[_0x6d43('0x16')](queues[_0x366af4['uniqueid']])&&!queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x18')]){queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x18')]=![];queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x27')]=null;queues[_0x366af4['uniqueid']][_0x6d43('0x28')]=!![];queues[_0x366af4['uniqueid']][_0x6d43('0x29')]=utils[_0x6d43('0x1a')]();queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x1b')]=_0x6d43('0x2c');utils[_0x6d43('0x10')](util[_0x6d43('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x366af4[_0x6d43('0x5')],queues[_0x366af4[_0x6d43('0x5')]][_0x6d43('0x1d')],_0x366af4['value'],queues[_0x366af4[_0x6d43('0x5')]]['queuecallerexitreason']));}}}catch(_0x491d6a){utils[_0x6d43('0x14')](util[_0x6d43('0x3')](_0x6d43('0x21'),_0x366af4[_0x6d43('0x5')]),_0x491d6a);}};exports[_0x6d43('0x18')]=function(_0x22e7f4){try{if(!_[_0x6d43('0x16')](queues[_0x22e7f4[_0x6d43('0x5')]])){utils[_0x6d43('0xe')](util[_0x6d43('0x3')](_0x6d43('0x2d'),_0x22e7f4['uniqueid']),_0x22e7f4);queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x28')]=![];queues[_0x22e7f4['uniqueid']]['queuecallerexitAt']=null;queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x18')]=!![];queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x27')]=utils[_0x6d43('0x1a')]();queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x1b')]=_0x6d43('0x2e');utils[_0x6d43('0x10')](util[_0x6d43('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x22e7f4['uniqueid'],queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x1d')],queues[_0x22e7f4[_0x6d43('0x5')]][_0x6d43('0x1b')]));}}catch(_0x467cbb){utils[_0x6d43('0x14')](util[_0x6d43('0x3')](_0x6d43('0x2d'),_0x22e7f4[_0x6d43('0x5')]),_0x467cbb);}};exports[_0x6d43('0x2f')]=function(_0x5a860e){try{if(!_[_0x6d43('0x16')](queues[_0x5a860e['uniqueid']])){utils[_0x6d43('0xe')](util['format'](_0x6d43('0x30'),_0x5a860e[_0x6d43('0x5')]),_0x5a860e);utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x31'),_0x5a860e[_0x6d43('0x5')],queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x1d')],_0x5a860e[_0x6d43('0x32')],_0x5a860e[_0x6d43('0x33')]));queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x2f')]=!![];queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x17')]=utils[_0x6d43('0x1a')]();queues[_0x5a860e[_0x6d43('0x5')]]['holdtime']=utils['diffTime'](queues[_0x5a860e['uniqueid']]['queuecallerleaveAt'],queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x34')]);queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x12')]=_0x5a860e[_0x6d43('0x12')];queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x35')]=_0x5a860e['count'];queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x32')]=_0x5a860e[_0x6d43('0x32')];queues[_0x5a860e[_0x6d43('0x5')]][_0x6d43('0x33')]=_0x5a860e['connectedlinename'];}}catch(_0x1b4d8f){utils[_0x6d43('0x14')](util[_0x6d43('0x3')](_0x6d43('0x30'),_0x5a860e[_0x6d43('0x5')]),_0x1b4d8f);}};exports[_0x6d43('0x36')]=function(_0x301cdb){try{if(!_[_0x6d43('0x16')](queues[_0x301cdb[_0x6d43('0x5')]])){utils['debug'](util[_0x6d43('0x3')](_0x6d43('0x37'),_0x301cdb['uniqueid']),_0x301cdb);utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x38'),_0x301cdb[_0x6d43('0x5')],queues[_0x301cdb[_0x6d43('0x5')]]['name'],_0x301cdb[_0x6d43('0x39')],_0x301cdb[_0x6d43('0x3a')]));queues[_0x301cdb['uniqueid']][_0x6d43('0x18')]=![];queues[_0x301cdb['uniqueid']][_0x6d43('0x18')]=![];queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x27')]=null;queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x28')]=![];queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x1b')]=null;queues[_0x301cdb[_0x6d43('0x5')]]['queuecallerexitAt']=null;queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x3b')]=!![];queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x9')]=_0x301cdb[_0x6d43('0x3a')];queues[_0x301cdb[_0x6d43('0x5')]][_0x6d43('0x3c')]=_0x301cdb['membername'];}}catch(_0x2647d2){utils['error'](util[_0x6d43('0x3')](_0x6d43('0x37'),_0x301cdb[_0x6d43('0x5')]),_0x2647d2);}};exports[_0x6d43('0x3d')]=function(_0x475723){try{if(!_[_0x6d43('0x16')](queues[_0x475723[_0x6d43('0x5')]])){if(queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x17')]){utils[_0x6d43('0xe')](util[_0x6d43('0x3')]('[%s][queues][agentcomplete]',_0x475723[_0x6d43('0x5')]),_0x475723);queues[_0x475723[_0x6d43('0x5')]]['queuecallerabandon']=![];queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x18')]=![];queues[_0x475723[_0x6d43('0x5')]]['queuecallerabandonAt']=null;queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x28')]=![];queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x29')]=null;queues[_0x475723['uniqueid']][_0x6d43('0x3b')]=!![];queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x3c')]=_0x475723[_0x6d43('0x39')];queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x19')]=!![];queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x3e')]=utils['now']();if(_0x475723['reason']=='transfer'){if(!queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x3f')]){queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x1b')]=_0x6d43('0x40');}}else{queues[_0x475723[_0x6d43('0x5')]]['queuecallerexitreason']=_0x6d43('0x41')+_0x475723['reason']['toUpperCase']();}utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x42'),_0x475723[_0x6d43('0x5')],queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x1d')],_0x475723['membername'],queues[_0x475723[_0x6d43('0x5')]][_0x6d43('0x1b')]));writeDB(queues[_0x475723['uniqueid']]);}}}catch(_0xa92b41){utils[_0x6d43('0x14')](util[_0x6d43('0x3')](_0x6d43('0x43'),_0x475723[_0x6d43('0x5')]),_0xa92b41);}};exports[_0x6d43('0x44')]=function(_0x27a960){try{if(!_['isNil'](queues[_0x27a960['transfereeuniqueid']])){utils[_0x6d43('0xe')](util[_0x6d43('0x3')](_0x6d43('0x45'),_0x27a960[_0x6d43('0x5')]),_0x27a960);queues[_0x27a960[_0x6d43('0x46')]][_0x6d43('0x3f')]=!![];queues[_0x27a960[_0x6d43('0x46')]]['transfertype']='BLIND';queues[_0x27a960[_0x6d43('0x46')]]['transferexten']=_0x27a960[_0x6d43('0x47')];queues[_0x27a960[_0x6d43('0x46')]]['transferuniqueid']=_0x27a960[_0x6d43('0x46')];queues[_0x27a960[_0x6d43('0x46')]][_0x6d43('0x1b')]=_0x6d43('0x48');utils[_0x6d43('0x10')](util[_0x6d43('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x27a960['uniqueid'],queues[_0x27a960[_0x6d43('0x46')]][_0x6d43('0x1d')],_0x27a960['transfereeuniqueid'],_0x27a960[_0x6d43('0x47')]));}}catch(_0xbab6f2){utils[_0x6d43('0x14')](util[_0x6d43('0x3')]('[%s][queues][blindtransfer]',_0x27a960[_0x6d43('0x5')]),_0xbab6f2);}};exports['attendedtransfer']=function(_0x33932a){try{utils[_0x6d43('0xe')](util[_0x6d43('0x3')](_0x6d43('0x49'),_0x33932a[_0x6d43('0x4a')]),_0x33932a);if(_0x33932a['origtransfereruniqueid']==_0x33932a[_0x6d43('0x4b')]){if(!_[_0x6d43('0x16')](queues[_0x33932a[_0x6d43('0x4c')]])){utils['info'](util[_0x6d43('0x3')](_0x6d43('0x4d'),_0x33932a['origtransfereruniqueid'],queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x1d')],_0x33932a[_0x6d43('0x4e')]));queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x3f')]=!![];queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x4f')]=_0x6d43('0x50');queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x51')]=_0x33932a['origtransfererexten'];queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x52')]=_0x33932a[_0x6d43('0x4a')];queues[_0x33932a['secondtransfererlinkedid']][_0x6d43('0x1b')]=_0x6d43('0x53');}if(!_[_0x6d43('0x16')](queues[_0x33932a[_0x6d43('0x4b')]])){if(_0x33932a[_0x6d43('0x54')]&&queues[_0x33932a['transfereelinkedid']]){queues[_0x33932a[_0x6d43('0x54')]][_0x6d43('0x55')]=0x1;queues[_0x33932a['transfereeuniqueid']]=_[_0x6d43('0x56')](queues[_0x33932a['transfereelinkedid']]);queues[_0x33932a[_0x6d43('0x46')]][_0x6d43('0x1e')]=_0x33932a['transfertargetuniqueid'];queues[_0x33932a[_0x6d43('0x46')]][_0x6d43('0x55')]=0x2;queues[_0x33932a['transfereeuniqueid']][_0x6d43('0x8')]=queues[_0x33932a[_0x6d43('0x4c')]]['calleridnum'];queues[_0x33932a['transfereeuniqueid']]['calleridname']=queues[_0x33932a['secondtransfererlinkedid']][_0x6d43('0x57')];queues[_0x33932a[_0x6d43('0x46')]][_0x6d43('0x34')]=utils[_0x6d43('0x1a')]();queues[_0x33932a[_0x6d43('0x46')]]['queuecallerleaveAt']=utils[_0x6d43('0x1a')]();queues[_0x33932a['transfereeuniqueid']][_0x6d43('0x58')]=0x0;queues[_0x33932a[_0x6d43('0x46')]][_0x6d43('0x59')]=0x0;utils[_0x6d43('0x10')](util[_0x6d43('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x33932a[_0x6d43('0x4a')],queues[_0x33932a[_0x6d43('0x46')]]['name'],queues[_0x33932a[_0x6d43('0x46')]][_0x6d43('0x8')],queues[_0x33932a['transfereeuniqueid']][_0x6d43('0x57')]));}else{utils[_0x6d43('0x10')](util['format'](_0x6d43('0x5a'),_0x33932a[_0x6d43('0x4a')],queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x1d')],_0x33932a[_0x6d43('0x4c')]));queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x1e')]=_0x33932a[_0x6d43('0x4c')];}}}else if(_0x33932a['secondtransfereruniqueid']==_0x33932a[_0x6d43('0x4c')]){if(!_['isNil'](queues[_0x33932a[_0x6d43('0x4b')]])){utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x5b'),_0x33932a['origtransfereruniqueid'],queues[_0x33932a[_0x6d43('0x4b')]]['name'],_0x33932a[_0x6d43('0x5c')],_0x33932a[_0x6d43('0x5d')]));queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x3f')]=!![];queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x4f')]='ATTENDED';queues[_0x33932a[_0x6d43('0x4b')]]['transferexten']=_0x33932a[_0x6d43('0x5d')];queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x52')]=_0x33932a[_0x6d43('0x5c')];queues[_0x33932a[_0x6d43('0x4b')]]['queuecallerexitreason']=_0x6d43('0x53');}if(!_[_0x6d43('0x16')](queues[_0x33932a[_0x6d43('0x4c')]])){if(_0x33932a[_0x6d43('0x5e')]&&queues[_0x33932a['transfertargetlinkedid']]){queues[_0x33932a['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x33932a['transfertargetuniqueid']]=_[_0x6d43('0x56')](queues[_0x33932a['transfertargetlinkedid']]);queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x1e')]=_0x33932a['transfertargetuniqueid'];queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x55')]=0x2;queues[_0x33932a['transfertargetuniqueid']]['calleridnum']=queues[_0x33932a['origtransfererlinkedid']][_0x6d43('0x8')];queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x57')]=queues[_0x33932a[_0x6d43('0x4b')]][_0x6d43('0x57')];queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x34')]=utils[_0x6d43('0x1a')]();queues[_0x33932a['transfertargetuniqueid']][_0x6d43('0x17')]=utils['now']();queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x58')]=0x0;queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x59')]=0x0;utils[_0x6d43('0x10')](util[_0x6d43('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x33932a[_0x6d43('0x4a')],queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x1d')],queues[_0x33932a[_0x6d43('0x5f')]]['transfereduniqueid'],queues[_0x33932a[_0x6d43('0x5f')]][_0x6d43('0x8')],queues[_0x33932a['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util[_0x6d43('0x3')](_0x6d43('0x5a'),_0x33932a['origtransfereruniqueid'],queues[_0x33932a[_0x6d43('0x4c')]][_0x6d43('0x1d')],_0x33932a[_0x6d43('0x4b')]));queues[_0x33932a[_0x6d43('0x4c')]]['transfereduniqueid']=_0x33932a['origtransfererlinkedid'];}}}}catch(_0x5eb77f){utils['error'](util[_0x6d43('0x3')](_0x6d43('0x49'),_0x33932a[_0x6d43('0x4a')]),_0x5eb77f);}};exports[_0x6d43('0x60')]=function(_0x4b6c22){try{if(!_[_0x6d43('0x16')](queues[_0x4b6c22[_0x6d43('0x5')]])){utils['debug'](util[_0x6d43('0x3')](_0x6d43('0x61'),_0x4b6c22['uniqueid']),_0x4b6c22);queues[_0x4b6c22['uniqueid']][_0x6d43('0x62')]=utils['now']();utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x63'),_0x4b6c22[_0x6d43('0x5')],queues[_0x4b6c22['uniqueid']][_0x6d43('0x1d')],queues[_0x4b6c22[_0x6d43('0x5')]]['musiconholdstartAt']));}}catch(_0x42bc63){utils['error'](util[_0x6d43('0x3')](_0x6d43('0x61'),_0x4b6c22['uniqueid']),_0x42bc63);}};exports[_0x6d43('0x64')]=function(_0x44f8ac){try{if(!_[_0x6d43('0x16')](queues[_0x44f8ac[_0x6d43('0x5')]])){if(!_[_0x6d43('0x16')](queues[_0x44f8ac[_0x6d43('0x5')]]['musiconholdstartAt'])){utils[_0x6d43('0xe')](util['format'](_0x6d43('0x65'),_0x44f8ac[_0x6d43('0x5')]),_0x44f8ac);queues[_0x44f8ac[_0x6d43('0x5')]]['mohtime']+=utils[_0x6d43('0x66')](utils['now'](),queues[_0x44f8ac[_0x6d43('0x5')]][_0x6d43('0x62')]);utils[_0x6d43('0x10')](util[_0x6d43('0x3')](_0x6d43('0x67'),_0x44f8ac[_0x6d43('0x5')],queues[_0x44f8ac['uniqueid']][_0x6d43('0x1d')],queues[_0x44f8ac[_0x6d43('0x5')]][_0x6d43('0x59')]));delete queues[_0x44f8ac['uniqueid']][_0x6d43('0x62')];}}}catch(_0x354545){utils['error'](util['format'](_0x6d43('0x65'),_0x44f8ac['uniqueid']),_0x354545);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 1af5a80..e993ac8 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 _0x143d=['value','.wav49','replace','find','monitors','push','hangup','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','uniqueid','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','accountcode','exten','channel','newstate','[%s][recordings][newstate]','channelstate','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith'];(function(_0x508fc5,_0x28cdc0){var _0x26fc7b=function(_0x226f6e){while(--_0x226f6e){_0x508fc5['push'](_0x508fc5['shift']());}};_0x26fc7b(++_0x28cdc0);}(_0x143d,0x112));var _0xd143=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x143d[_0x1c2f29];return _0x258465;};'use strict';var _=require(_0xd143('0x0'));var util=require(_0xd143('0x1'));var utils=require(_0xd143('0x2'));var recordings={};function writeDB(_0x24ff49){utils[_0xd143('0x3')](util[_0xd143('0x4')]('[%s][recordings][writeDB]',_0x24ff49[_0xd143('0x5')]));if(_0x24ff49['accountcode']){utils[_0xd143('0x6')](_0x24ff49['accountcode'])[_0xd143('0x7')](function(_0x407efc){if(_0x407efc){_0x24ff49['membername']=_0x407efc[_0xd143('0x8')];_0x24ff49[_0xd143('0x9')]=_0x407efc['id'];}utils[_0xd143('0xa')](_0xd143('0xb'),_0x24ff49);});}else{utils[_0xd143('0xa')](_0xd143('0xb'),_0x24ff49);}}exports[_0xd143('0xc')]=function(_0x1492cf){try{utils[_0xd143('0xd')](util[_0xd143('0x4')](_0xd143('0xe'),_0x1492cf['uniqueid']),_0x1492cf);if(_0x1492cf['uniqueid']==_0x1492cf['linkedid']){utils[_0xd143('0x3')](util[_0xd143('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1492cf['uniqueid'],_0x1492cf[_0xd143('0xf')],_0x1492cf['exten']));recordings[_0x1492cf['uniqueid']]={'uniqueid':_0x1492cf[_0xd143('0x5')],'accountcode':_0x1492cf[_0xd143('0x10')],'exten':_0x1492cf[_0xd143('0x11')],'context':_0x1492cf[_0xd143('0xf')],'channel':_0x1492cf[_0xd143('0x12')],'monitors':[]};}}catch(_0x4a5591){utils['error'](util[_0xd143('0x4')]('[%s][recordings][newchannel]',_0x1492cf['uniqueid']),_0x4a5591);}};exports[_0xd143('0x13')]=function(_0x3e7ac9){try{utils[_0xd143('0xd')](util['format'](_0xd143('0x14'),_0x3e7ac9[_0xd143('0x5')]),_0x3e7ac9);if(!_['isNil'](recordings[_0x3e7ac9[_0xd143('0x5')]])&&_0x3e7ac9[_0xd143('0x15')]==0x6){utils['info'](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3e7ac9[_0xd143('0x5')],_0x3e7ac9[_0xd143('0xf')],_0x3e7ac9['channel']));}else if(!_[_0xd143('0x16')](recordings[_0x3e7ac9[_0xd143('0x17')]])&&_0x3e7ac9[_0xd143('0x15')]==0x6&&_0x3e7ac9[_0xd143('0xf')]!=_0xd143('0x18')){utils['info'](util[_0xd143('0x4')](_0xd143('0x19'),_0x3e7ac9[_0xd143('0x5')],_0x3e7ac9['linkedid'],_0x3e7ac9['context'],_0x3e7ac9[_0xd143('0x12')]));recordings[_0x3e7ac9[_0xd143('0x17')]][_0xd143('0x10')]=_0x3e7ac9['accountcode'];}}catch(_0x53e9d9){utils[_0xd143('0x1a')](util[_0xd143('0x4')](_0xd143('0x14'),_0x3e7ac9['uniqueid']),_0x53e9d9);}};exports[_0xd143('0x1b')]=function(_0x1d6da2){try{if(!_[_0xd143('0x16')](_0x1d6da2[_0xd143('0x1c')])&&!_[_0xd143('0x16')](_0x1d6da2[_0xd143('0x1c')]['mixmonitor_filename'])){utils['debug'](util[_0xd143('0x4')]('[%s][recordings][varset]',_0x1d6da2[_0xd143('0x5')]),_0x1d6da2);utils[_0xd143('0x3')](util[_0xd143('0x4')](_0xd143('0x1d'),_0x1d6da2[_0xd143('0x5')],_0x1d6da2[_0xd143('0x1c')],_0x1d6da2['value']));if(_[_0xd143('0x1e')](_0x1d6da2[_0xd143('0x1f')],_0xd143('0x20'))){_0x1d6da2['value']=_0x1d6da2['value'][_0xd143('0x21')](_0xd143('0x20'),'.WAV');}if(recordings[_0x1d6da2['linkedid']]){var _0x2a0bcf=_[_0xd143('0x22')](recordings[_0x1d6da2[_0xd143('0x17')]]['monitors'],{'value':_0x1d6da2['value']});if(_[_0xd143('0x16')](_0x2a0bcf)){recordings[_0x1d6da2[_0xd143('0x17')]][_0xd143('0x23')][_0xd143('0x24')]({'value':_0x1d6da2['value']});}}}}catch(_0x4bedad){utils[_0xd143('0x1a')](util[_0xd143('0x4')]('[%s][recordings][varset]',_0x1d6da2['uniqueid']),_0x4bedad);}};exports[_0xd143('0x25')]=function(_0x18e1f2){try{if(!_['isNil'](recordings[_0x18e1f2['uniqueid']])){utils[_0xd143('0xd')](util[_0xd143('0x4')]('[%s][recordings][hangup]',_0x18e1f2[_0xd143('0x5')]),_0x18e1f2);utils[_0xd143('0x3')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x18e1f2[_0xd143('0x5')],_0x18e1f2['calleridnum'],_0x18e1f2[_0xd143('0x26')],_0x18e1f2[_0xd143('0x27')]));recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x28')]=_0x18e1f2[_0xd143('0x28')];recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x26')]=_0x18e1f2[_0xd143('0x26')];recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x29')]=_0x18e1f2[_0xd143('0x29')];recordings[_0x18e1f2['uniqueid']][_0xd143('0x2a')]=_0x18e1f2['connectedlinename'];if(recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x2b')]=='outbound'&&recordings[_0x18e1f2['uniqueid']][_0xd143('0x10')]){recordings[_0x18e1f2['uniqueid']][_0xd143('0x29')]=recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x10')];recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x2a')]='';}recordings[_0x18e1f2[_0xd143('0x5')]][_0xd143('0x23')][_0xd143('0x2c')](function(_0x22b9d7){var _0x53aaf5=_[_0xd143('0x2d')](recordings[_0x18e1f2[_0xd143('0x5')]]);_0x53aaf5[_0xd143('0x1f')]=_0x22b9d7[_0xd143('0x1f')];writeDB(_0x53aaf5);});delete recordings[_0x18e1f2[_0xd143('0x5')]];}}catch(_0x1d9847){utils[_0xd143('0x1a')](util[_0xd143('0x4')](_0xd143('0x2e'),_0x18e1f2['uniqueid']),_0x1d9847);}};exports['newexten']=function(_0x4bd39c){try{if(!_[_0xd143('0x16')](recordings[_0x4bd39c['uniqueid']])){utils['debug'](util[_0xd143('0x4')]('[%s][recordings][newexten]',_0x4bd39c[_0xd143('0x5')]),_0x4bd39c);utils[_0xd143('0x3')](util[_0xd143('0x4')](_0xd143('0x2f'),_0x4bd39c['uniqueid'],_0x4bd39c[_0xd143('0x30')],_0x4bd39c[_0xd143('0x31')]));if(_0x4bd39c['application'][_0xd143('0x32')]()=='set'&&_[_0xd143('0x33')](_0x4bd39c[_0xd143('0x31')][_0xd143('0x32')](),_0xd143('0x34'))){var _0x28b0db=_0x4bd39c[_0xd143('0x31')][_0xd143('0x35')]('=');var _0x510e92=_0x28b0db[0x0][_0xd143('0x36')](_0x28b0db[0x0]['lastIndexOf']('(')+0x1,_0x28b0db[0x0][_0xd143('0x37')](')'));var _0x219433=_0x28b0db[0x1];recordings[_0x4bd39c[_0xd143('0x5')]][_0x510e92]=_0x219433;}}}catch(_0x36d643){utils['error'](util['format'](_0xd143('0x38'),_0x4bd39c[_0xd143('0x5')]),_0x36d643);}};exports[_0xd143('0x39')]=function(_0x24f183){try{if(!_[_0xd143('0x16')](recordings[_0x24f183[_0xd143('0x5')]])){utils[_0xd143('0xd')](util[_0xd143('0x4')](_0xd143('0x3a'),_0x24f183[_0xd143('0x5')]),_0x24f183);utils[_0xd143('0x3')](util[_0xd143('0x4')](_0xd143('0x3b'),_0x24f183['uniqueid'],_0x24f183['queue']));recordings[_0x24f183[_0xd143('0x5')]][_0xd143('0x3c')]=_0x24f183[_0xd143('0x3c')];}}catch(_0x5e2134){utils[_0xd143('0x1a')](util['format']('[%s][recordings][queuecallerjoin]',_0x24f183[_0xd143('0x5')]),_0x5e2134);}}; \ No newline at end of file +var _0x4b2e=['monitors','push','hangup','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace'];(function(_0xcf9f0e,_0x1b78e4){var _0x10e6ff=function(_0x455701){while(--_0x455701){_0xcf9f0e['push'](_0xcf9f0e['shift']());}};_0x10e6ff(++_0x1b78e4);}(_0x4b2e,0xda));var _0xe4b2=function(_0x3d72a4,_0x4960fc){_0x3d72a4=_0x3d72a4-0x0;var _0x311a1d=_0x4b2e[_0x3d72a4];return _0x311a1d;};'use strict';var _=require(_0xe4b2('0x0'));var util=require(_0xe4b2('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0xce86c2){utils['info'](util['format'](_0xe4b2('0x2'),_0xce86c2[_0xe4b2('0x3')]));if(_0xce86c2[_0xe4b2('0x4')]){utils[_0xe4b2('0x5')](_0xce86c2[_0xe4b2('0x4')])[_0xe4b2('0x6')](function(_0x224560){if(_0x224560){_0xce86c2[_0xe4b2('0x7')]=_0x224560[_0xe4b2('0x8')];_0xce86c2[_0xe4b2('0x9')]=_0x224560['id'];}utils[_0xe4b2('0xa')]('CreateVoiceRecording',_0xce86c2);});}else{utils[_0xe4b2('0xa')](_0xe4b2('0xb'),_0xce86c2);}}exports[_0xe4b2('0xc')]=function(_0x3728f1){try{utils[_0xe4b2('0xd')](util[_0xe4b2('0xe')](_0xe4b2('0xf'),_0x3728f1[_0xe4b2('0x3')]),_0x3728f1);if(_0x3728f1[_0xe4b2('0x3')]==_0x3728f1[_0xe4b2('0x10')]){utils['info'](util['format'](_0xe4b2('0x11'),_0x3728f1['uniqueid'],_0x3728f1[_0xe4b2('0x12')],_0x3728f1[_0xe4b2('0x13')]));recordings[_0x3728f1[_0xe4b2('0x3')]]={'uniqueid':_0x3728f1[_0xe4b2('0x3')],'accountcode':_0x3728f1[_0xe4b2('0x4')],'exten':_0x3728f1[_0xe4b2('0x13')],'context':_0x3728f1[_0xe4b2('0x12')],'channel':_0x3728f1['channel'],'monitors':[]};}}catch(_0x3f5ec1){utils[_0xe4b2('0x14')](util[_0xe4b2('0xe')]('[%s][recordings][newchannel]',_0x3728f1[_0xe4b2('0x3')]),_0x3f5ec1);}};exports[_0xe4b2('0x15')]=function(_0x74384d){try{utils[_0xe4b2('0xd')](util[_0xe4b2('0xe')]('[%s][recordings][newstate]',_0x74384d[_0xe4b2('0x3')]),_0x74384d);if(!_[_0xe4b2('0x16')](recordings[_0x74384d[_0xe4b2('0x3')]])&&_0x74384d[_0xe4b2('0x17')]==0x6){utils[_0xe4b2('0x18')](util[_0xe4b2('0xe')](_0xe4b2('0x19'),_0x74384d[_0xe4b2('0x3')],_0x74384d['context'],_0x74384d[_0xe4b2('0x1a')]));}else if(!_[_0xe4b2('0x16')](recordings[_0x74384d['linkedid']])&&_0x74384d[_0xe4b2('0x17')]==0x6&&_0x74384d[_0xe4b2('0x12')]!='transfer'){utils[_0xe4b2('0x18')](util[_0xe4b2('0xe')](_0xe4b2('0x1b'),_0x74384d[_0xe4b2('0x3')],_0x74384d[_0xe4b2('0x10')],_0x74384d[_0xe4b2('0x12')],_0x74384d['channel']));recordings[_0x74384d[_0xe4b2('0x10')]][_0xe4b2('0x4')]=_0x74384d['accountcode'];}}catch(_0x120e48){utils[_0xe4b2('0x14')](util[_0xe4b2('0xe')](_0xe4b2('0x1c'),_0x74384d['uniqueid']),_0x120e48);}};exports[_0xe4b2('0x1d')]=function(_0x45312b){try{if(!_[_0xe4b2('0x16')](_0x45312b[_0xe4b2('0x1e')])&&!_['isNil'](_0x45312b[_0xe4b2('0x1e')][_0xe4b2('0x1f')])){utils[_0xe4b2('0xd')](util['format'](_0xe4b2('0x20'),_0x45312b[_0xe4b2('0x3')]),_0x45312b);utils[_0xe4b2('0x18')](util[_0xe4b2('0xe')](_0xe4b2('0x21'),_0x45312b[_0xe4b2('0x3')],_0x45312b['variable'],_0x45312b[_0xe4b2('0x22')]));if(_[_0xe4b2('0x23')](_0x45312b[_0xe4b2('0x22')],_0xe4b2('0x24'))){_0x45312b[_0xe4b2('0x22')]=_0x45312b['value'][_0xe4b2('0x25')](_0xe4b2('0x24'),'.WAV');}if(recordings[_0x45312b[_0xe4b2('0x10')]]){var _0x378bd8=_['find'](recordings[_0x45312b[_0xe4b2('0x10')]][_0xe4b2('0x26')],{'value':_0x45312b[_0xe4b2('0x22')]});if(_[_0xe4b2('0x16')](_0x378bd8)){recordings[_0x45312b['linkedid']]['monitors'][_0xe4b2('0x27')]({'value':_0x45312b[_0xe4b2('0x22')]});}}}}catch(_0x3599a3){utils[_0xe4b2('0x14')](util[_0xe4b2('0xe')]('[%s][recordings][varset]',_0x45312b[_0xe4b2('0x3')]),_0x3599a3);}};exports[_0xe4b2('0x28')]=function(_0x1a2811){try{if(!_['isNil'](recordings[_0x1a2811[_0xe4b2('0x3')]])){utils['debug'](util[_0xe4b2('0xe')](_0xe4b2('0x29'),_0x1a2811[_0xe4b2('0x3')]),_0x1a2811);utils[_0xe4b2('0x18')](util[_0xe4b2('0xe')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1a2811['uniqueid'],_0x1a2811['calleridnum'],_0x1a2811[_0xe4b2('0x2a')],_0x1a2811['cause-txt']));recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x2b')]=_0x1a2811[_0xe4b2('0x2b')];recordings[_0x1a2811['uniqueid']]['calleridname']=_0x1a2811['calleridname'];recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x2c')]=_0x1a2811[_0xe4b2('0x2c')];recordings[_0x1a2811[_0xe4b2('0x3')]]['connectedlinename']=_0x1a2811[_0xe4b2('0x2d')];if(recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x2e')]=='outbound'&&recordings[_0x1a2811['uniqueid']][_0xe4b2('0x4')]){recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x2c')]=recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x4')];recordings[_0x1a2811['uniqueid']][_0xe4b2('0x2d')]='';}recordings[_0x1a2811[_0xe4b2('0x3')]][_0xe4b2('0x26')][_0xe4b2('0x2f')](function(_0x298854){var _0x36deb0=_[_0xe4b2('0x30')](recordings[_0x1a2811[_0xe4b2('0x3')]]);_0x36deb0[_0xe4b2('0x22')]=_0x298854['value'];writeDB(_0x36deb0);});delete recordings[_0x1a2811[_0xe4b2('0x3')]];}}catch(_0x4115a9){utils[_0xe4b2('0x14')](util[_0xe4b2('0xe')](_0xe4b2('0x29'),_0x1a2811[_0xe4b2('0x3')]),_0x4115a9);}};exports[_0xe4b2('0x31')]=function(_0x45ec4a){try{if(!_[_0xe4b2('0x16')](recordings[_0x45ec4a[_0xe4b2('0x3')]])){utils[_0xe4b2('0xd')](util['format']('[%s][recordings][newexten]',_0x45ec4a[_0xe4b2('0x3')]),_0x45ec4a);utils[_0xe4b2('0x18')](util[_0xe4b2('0xe')](_0xe4b2('0x32'),_0x45ec4a[_0xe4b2('0x3')],_0x45ec4a['application'],_0x45ec4a[_0xe4b2('0x33')]));if(_0x45ec4a[_0xe4b2('0x34')][_0xe4b2('0x35')]()==_0xe4b2('0x36')&&_[_0xe4b2('0x37')](_0x45ec4a['appdata'][_0xe4b2('0x35')](),'cdr')){var _0xb702f6=_0x45ec4a[_0xe4b2('0x33')][_0xe4b2('0x38')]('=');var _0x3506fc=_0xb702f6[0x0][_0xe4b2('0x39')](_0xb702f6[0x0][_0xe4b2('0x3a')]('(')+0x1,_0xb702f6[0x0][_0xe4b2('0x3a')](')'));var _0x23c0e1=_0xb702f6[0x1];recordings[_0x45ec4a['uniqueid']][_0x3506fc]=_0x23c0e1;}}}catch(_0x24ac34){utils['error'](util[_0xe4b2('0xe')](_0xe4b2('0x3b'),_0x45ec4a[_0xe4b2('0x3')]),_0x24ac34);}};exports[_0xe4b2('0x3c')]=function(_0x103ffd){try{if(!_['isNil'](recordings[_0x103ffd['uniqueid']])){utils[_0xe4b2('0xd')](util[_0xe4b2('0xe')](_0xe4b2('0x3d'),_0x103ffd[_0xe4b2('0x3')]),_0x103ffd);utils['info'](util[_0xe4b2('0xe')](_0xe4b2('0x3e'),_0x103ffd[_0xe4b2('0x3')],_0x103ffd[_0xe4b2('0x3f')]));recordings[_0x103ffd[_0xe4b2('0x3')]]['queue']=_0x103ffd[_0xe4b2('0x3f')];}}catch(_0x5b0917){utils[_0xe4b2('0x14')](util[_0xe4b2('0xe')](_0xe4b2('0x3d'),_0x103ffd[_0xe4b2('0x3')]),_0x5b0917);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e4592f7..526e9ba 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 _0x9901=['transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','type','blind','blinds','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x5ee336,_0x21bfbe){var _0x4ff51d=function(_0x495d23){while(--_0x495d23){_0x5ee336['push'](_0x5ee336['shift']());}};_0x4ff51d(++_0x21bfbe);}(_0x9901,0xd7));var _0x1990=function(_0x81697e,_0x552c16){_0x81697e=_0x81697e-0x0;var _0x1f6e36=_0x9901[_0x81697e];return _0x1f6e36;};'use strict';var _=require(_0x1990('0x0'));var util=require(_0x1990('0x1'));var utils=require('./utils');function writeDB(_0x40adef){utils[_0x1990('0x2')](util[_0x1990('0x3')](_0x1990('0x4'),_0x40adef['type']===_0x1990('0x5')?_0x40adef[_0x1990('0x6')]:_0x40adef[_0x1990('0x7')],_0x40adef['type']));utils[_0x1990('0x8')]('CreateVoiceTransferReport',_0x40adef);}exports['blinds']={};exports[_0x1990('0x9')]=function(_0x71e39){try{utils[_0x1990('0xa')](util[_0x1990('0x3')](_0x1990('0xb'),_0x71e39[_0x1990('0x7')]),_0x71e39);utils[_0x1990('0x2')](util[_0x1990('0x3')](_0x1990('0xc'),_0x71e39['uniqueid'],_0x71e39[_0x1990('0xd')],_0x71e39[_0x1990('0xe')],_0x71e39[_0x1990('0xf')],_0x71e39[_0x1990('0x10')]));_0x71e39[_0x1990('0x11')]=_0x1990('0x12');exports[_0x1990('0x13')][_0x71e39['transfereruniqueid']]=_0x71e39;writeDB(_0x71e39);}catch(_0x3b0081){utils[_0x1990('0x14')](util[_0x1990('0x3')](_0x1990('0xb'),_0x71e39[_0x1990('0x7')]),_0x3b0081);}};exports['attendedtransfer']=function(_0x524419){try{utils[_0x1990('0xa')](util[_0x1990('0x3')](_0x1990('0x15'),_0x524419[_0x1990('0x6')]),_0x524419);utils[_0x1990('0x2')](util[_0x1990('0x3')](_0x1990('0x16'),_0x524419['origtransfereruniqueid'],_0x524419[_0x1990('0x17')],_0x524419[_0x1990('0x18')],_0x524419[_0x1990('0x19')],_0x524419[_0x1990('0x1a')]));_0x524419=_['assign'](_0x524419,{'transfererchannel':_0x524419['origtransfererchannel'],'transferercalleridnum':_0x524419[_0x1990('0x17')],'transferercalleridname':_0x524419['origtransferercalleridname'],'transfererconnectedlinenum':_0x524419[_0x1990('0x1b')],'transfererconnectedlinename':_0x524419[_0x1990('0x1c')],'transfereraccountcode':_0x524419['origtransfereraccountcode'],'transferercontext':_0x524419['secondtransferercontext'],'transfererexten':_0x524419['secondtransfererexten'],'transfererlinkedid':_0x524419['origtransfererlinkedid'],'context':_0x524419[_0x1990('0x1d')],'extension':_0x524419[_0x1990('0x1e')],'type':'attended'});if(_[_0x1990('0x1f')](_0x524419[_0x1990('0x20')])){_0x524419=_[_0x1990('0x21')](_0x524419,{'transfereechannel':_0x524419['transfertargetchannel'],'transfereecalleridnum':_0x524419[_0x1990('0x19')],'transfereecalleridname':_0x524419[_0x1990('0x1a')],'transfereeconnectedlinenum':_0x524419['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x524419[_0x1990('0x22')],'transfereeaccountcode':_0x524419[_0x1990('0x23')],'transfereecontext':_0x524419['transfertargetcontext'],'transfereeexten':_0x524419[_0x1990('0x24')],'transfereelinkedid':_0x524419[_0x1990('0x25')]});}writeDB(_0x524419);}catch(_0x58734e){utils[_0x1990('0x14')](util['format'](_0x1990('0x15'),_0x524419[_0x1990('0x6')]),_0x58734e);}}; \ No newline at end of file +var _0x0f3d=['transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','debug','format','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0f3d,0x1c9));var _0xd0f3=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0x0f3d[_0x54b458];return _0x18d704;};'use strict';var _=require(_0xd0f3('0x0'));var util=require(_0xd0f3('0x1'));var utils=require(_0xd0f3('0x2'));function writeDB(_0x236368){utils[_0xd0f3('0x3')](util['format'](_0xd0f3('0x4'),_0x236368[_0xd0f3('0x5')]===_0xd0f3('0x6')?_0x236368[_0xd0f3('0x7')]:_0x236368['uniqueid'],_0x236368['type']));utils[_0xd0f3('0x8')](_0xd0f3('0x9'),_0x236368);}exports['blinds']={};exports['blindtransfer']=function(_0xc966a0){try{utils[_0xd0f3('0xa')](util[_0xd0f3('0xb')](_0xd0f3('0xc'),_0xc966a0[_0xd0f3('0xd')]),_0xc966a0);utils[_0xd0f3('0x3')](util[_0xd0f3('0xb')](_0xd0f3('0xe'),_0xc966a0[_0xd0f3('0xd')],_0xc966a0[_0xd0f3('0xf')],_0xc966a0[_0xd0f3('0x10')],_0xc966a0[_0xd0f3('0x11')],_0xc966a0[_0xd0f3('0x12')]));_0xc966a0['type']=_0xd0f3('0x13');exports[_0xd0f3('0x14')][_0xc966a0[_0xd0f3('0x15')]]=_0xc966a0;writeDB(_0xc966a0);}catch(_0x3a41e9){utils[_0xd0f3('0x16')](util[_0xd0f3('0xb')](_0xd0f3('0xc'),_0xc966a0['uniqueid']),_0x3a41e9);}};exports[_0xd0f3('0x17')]=function(_0x1ca133){try{utils[_0xd0f3('0xa')](util['format'](_0xd0f3('0x18'),_0x1ca133['origtransfereruniqueid']),_0x1ca133);utils[_0xd0f3('0x3')](util[_0xd0f3('0xb')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1ca133[_0xd0f3('0x7')],_0x1ca133[_0xd0f3('0x19')],_0x1ca133['origtransferercalleridname'],_0x1ca133[_0xd0f3('0x1a')],_0x1ca133[_0xd0f3('0x1b')]));_0x1ca133=_[_0xd0f3('0x1c')](_0x1ca133,{'transfererchannel':_0x1ca133['origtransfererchannel'],'transferercalleridnum':_0x1ca133[_0xd0f3('0x19')],'transferercalleridname':_0x1ca133[_0xd0f3('0x1d')],'transfererconnectedlinenum':_0x1ca133[_0xd0f3('0x1e')],'transfererconnectedlinename':_0x1ca133[_0xd0f3('0x1f')],'transfereraccountcode':_0x1ca133[_0xd0f3('0x20')],'transferercontext':_0x1ca133[_0xd0f3('0x21')],'transfererexten':_0x1ca133[_0xd0f3('0x22')],'transfererlinkedid':_0x1ca133[_0xd0f3('0x23')],'context':_0x1ca133[_0xd0f3('0x24')],'extension':_0x1ca133[_0xd0f3('0x25')],'type':'attended'});if(_['isNil'](_0x1ca133[_0xd0f3('0x26')])){_0x1ca133=_[_0xd0f3('0x1c')](_0x1ca133,{'transfereechannel':_0x1ca133['transfertargetchannel'],'transfereecalleridnum':_0x1ca133['transfertargetcalleridnum'],'transfereecalleridname':_0x1ca133['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1ca133[_0xd0f3('0x27')],'transfereeconnectedlinename':_0x1ca133['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1ca133[_0xd0f3('0x28')],'transfereecontext':_0x1ca133['transfertargetcontext'],'transfereeexten':_0x1ca133[_0xd0f3('0x29')],'transfereelinkedid':_0x1ca133[_0xd0f3('0x2a')]});}writeDB(_0x1ca133);}catch(_0x5f59cd){utils[_0xd0f3('0x16')](util['format'](_0xd0f3('0x18'),_0x1ca133['origtransfereruniqueid']),_0x5f59cd);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7bc68f2..1a1b4ad 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 _0x5a45=['isBefore','jayson/promise','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diff','sumTime','now','isAfter'];(function(_0x8ec947,_0x444fa2){var _0x115d2b=function(_0x4cbd1a){while(--_0x4cbd1a){_0x8ec947['push'](_0x8ec947['shift']());}};_0x115d2b(++_0x444fa2);}(_0x5a45,0x143));var _0x55a4=function(_0xb74bb5,_0x1a9d36){_0xb74bb5=_0xb74bb5-0x0;var _0xa52799=_0x5a45[_0xb74bb5];return _0xa52799;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x55a4('0x0'));var moment=require('moment');var util=require('util');var client=jayson[_0x55a4('0x1')][_0x55a4('0x2')]({'port':0x2329});var logger=require(_0x55a4('0x3'))('xdr');exports[_0x55a4('0x4')]=function(_0x3e5034,_0x3f8a8e){logger[_0x55a4('0x4')](_0x3e5034,_0x3f8a8e?util[_0x55a4('0x5')](_0x3f8a8e,{'showHidden':![],'depth':null}):'');};exports[_0x55a4('0x6')]=function(_0x5b8b66,_0x408d4a){logger[_0x55a4('0x6')](_0x5b8b66,_0x408d4a?util[_0x55a4('0x5')](_0x408d4a,{'showHidden':![],'depth':null}):'');};exports[_0x55a4('0x7')]=function(_0x3e4e2b,_0x44d1d0){logger[_0x55a4('0x7')](_0x3e4e2b,_0x44d1d0?util[_0x55a4('0x5')](_0x44d1d0,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x2520a6,_0x3e4a5d){return client[_0x55a4('0x8')](_0x2520a6,{'body':_0x3e4a5d})[_0x55a4('0x9')](function(_0x41db60){logger[_0x55a4('0x6')](_0x55a4('0xa'),_0x2520a6,_0x41db60?util[_0x55a4('0x5')](_0x41db60,{'showHidden':![],'depth':null}):'');})[_0x55a4('0xb')](function(_0x469da4){logger[_0x55a4('0x7')]('[utils][request]\x20name:%s',_0x2520a6,_0x469da4?util[_0x55a4('0x5')](_0x469da4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3af56c){return client[_0x55a4('0x8')](_0x55a4('0xc'),{'options':{'raw':!![],'attributes':['id',_0x55a4('0xd'),'name',_0x55a4('0xe')],'where':_0x3af56c,'limit':0x1}})[_0x55a4('0x9')](function(_0x4a86f0){logger[_0x55a4('0x6')](_0x55a4('0xf'),JSON[_0x55a4('0x10')](_0x3af56c),_0x4a86f0?util[_0x55a4('0x5')](_0x4a86f0,{'showHidden':![],'depth':null}):'');return _0x4a86f0[_0x55a4('0x11')][_0x55a4('0x12')]?_0x4a86f0[_0x55a4('0x11')][0x0]:null;});}exports[_0x55a4('0x13')]=function(_0x197719){return new BPromise(function(_0x19d2db,_0x22a169){if(_0x197719){return getUser({'internal':_0x197719})[_0x55a4('0x9')](function(_0x35e70b){logger['info'](_0x55a4('0x14'),_0x197719,_0x35e70b?_0x55a4('0x15'):_0x55a4('0x16'));return _0x19d2db(_0x35e70b);})[_0x55a4('0xb')](function(_0x10a8b1){logger[_0x55a4('0x7')](_0x55a4('0x17'),_0x10a8b1?util[_0x55a4('0x5')](_0x10a8b1,{'showHidden':![],'depth':null}):'');return _0x19d2db(null);});}return _0x19d2db(null);});};exports[_0x55a4('0x18')]=function(_0x2814f3){return new BPromise(function(_0x547531,_0x57bb92){if(_0x2814f3){return getUser({'interface':_0x2814f3})[_0x55a4('0x9')](function(_0xbe7b40){logger[_0x55a4('0x4')](_0x55a4('0x19'),_0x2814f3,_0xbe7b40?'found':_0x55a4('0x16'));return _0x547531(_0xbe7b40);})[_0x55a4('0xb')](function(_0x17e25b){logger[_0x55a4('0x7')]('[utils][getUserByInterface]',_0x17e25b?util[_0x55a4('0x5')](_0x17e25b,{'showHidden':![],'depth':null}):'');return _0x547531(null);});}return _0x547531(null);});};exports[_0x55a4('0x1a')]=function(_0x7ca07){return new BPromise(function(_0x59a8f7,_0x9527bb){if(_0x7ca07){return getUser({'name':_0x7ca07})[_0x55a4('0x9')](function(_0xf63b5c){logger[_0x55a4('0x4')](_0x55a4('0x1b'),_0x7ca07,_0xf63b5c?_0x55a4('0x15'):_0x55a4('0x16'));return _0x59a8f7(_0xf63b5c);})[_0x55a4('0xb')](function(_0x4c0fd9){logger[_0x55a4('0x7')](_0x55a4('0x1c'),_0x4c0fd9?util[_0x55a4('0x5')](_0x4c0fd9,{'showHidden':![],'depth':null}):'');return _0x59a8f7(null);});}return _0x59a8f7(null);});};exports[_0x55a4('0x1d')]=function(_0x1d833a){return new BPromise(function(_0x3dca2f,_0x3e6fba){if(_0x1d833a){return client[_0x55a4('0x8')](_0x55a4('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x55a4('0x1f'),_0x55a4('0x20'),'acw','acwTimeout'],'where':{'name':_0x1d833a},'limit':0x1}})[_0x55a4('0x9')](function(_0x124d34){logger[_0x55a4('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1d833a,_0x124d34?util[_0x55a4('0x5')](_0x124d34,{'showHidden':![],'depth':null}):'');logger[_0x55a4('0x4')](_0x55a4('0x21'),_0x1d833a,_0x124d34?_0x55a4('0x15'):_0x55a4('0x16'));return _0x3dca2f(_0x124d34[_0x55a4('0x11')][_0x55a4('0x12')]?_0x124d34[_0x55a4('0x11')][0x0]:null);})[_0x55a4('0xb')](function(_0x3b4975){logger[_0x55a4('0x7')](_0x55a4('0x22'),_0x3b4975?util['inspect'](_0x3b4975,{'showHidden':![],'depth':null}):'');return _0x3dca2f(null);});}return _0x3dca2f(null);});};exports[_0x55a4('0x23')]=function(_0x298231,_0x46a70b){return moment(_0x298231)[_0x55a4('0x24')](_0x46a70b,'seconds')[_0x55a4('0x25')](_0x55a4('0x26'));};exports['subtractTime']=function(_0x29f4d0,_0x2b636a){return moment(_0x29f4d0)[_0x55a4('0x27')](_0x2b636a,_0x55a4('0x28'))[_0x55a4('0x25')](_0x55a4('0x26'));};exports['diffTime']=function(_0x2a8d9a,_0x381461){return moment(_0x2a8d9a)[_0x55a4('0x29')](moment(_0x381461),'seconds');};exports[_0x55a4('0x2a')]=function(_0x5a2bd2,_0x259381){return parseInt(_0x5a2bd2,0xa)+parseInt(_0x259381,0xa);};exports[_0x55a4('0x2b')]=function(){return moment()[_0x55a4('0x25')](_0x55a4('0x26'));};exports[_0x55a4('0x2c')]=function(_0x37f48f,_0x55e512){if(_0x55e512){return moment(_0x37f48f)['isAfter'](_0x55e512);}return!![];};exports[_0x55a4('0x2d')]=function(_0x1ccd34,_0x2f9dcf){if(_0x2f9dcf){return moment(_0x1ccd34)['isBefore'](_0x2f9dcf);}else if(_0x1ccd34){return!![];}return![];}; \ No newline at end of file +var _0xb182=['addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','isAfter','isBefore','bluebird','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]'];(function(_0x5dddb6,_0x44e822){var _0x5303f7=function(_0x4ebb05){while(--_0x4ebb05){_0x5dddb6['push'](_0x5dddb6['shift']());}};_0x5303f7(++_0x44e822);}(_0xb182,0x19a));var _0x2b18=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0xb182[_0x1a9e78];return _0x113e06;};'use strict';var BPromise=require(_0x2b18('0x0'));var jayson=require('jayson/promise');var moment=require(_0x2b18('0x1'));var util=require('util');var client=jayson[_0x2b18('0x2')][_0x2b18('0x3')]({'port':0x2329});var logger=require(_0x2b18('0x4'))(_0x2b18('0x5'));exports[_0x2b18('0x6')]=function(_0xfb7f93,_0x2c423c){logger[_0x2b18('0x6')](_0xfb7f93,_0x2c423c?util[_0x2b18('0x7')](_0x2c423c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x13bbbc,_0x5b851c){logger[_0x2b18('0x8')](_0x13bbbc,_0x5b851c?util['inspect'](_0x5b851c,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x2c89c9,_0x1512db){logger[_0x2b18('0x9')](_0x2c89c9,_0x1512db?util[_0x2b18('0x7')](_0x1512db,{'showHidden':![],'depth':null}):'');};exports[_0x2b18('0xa')]=function(_0x492732,_0x4d76cb){return client['request'](_0x492732,{'body':_0x4d76cb})[_0x2b18('0xb')](function(_0x36e08d){logger['debug'](_0x2b18('0xc'),_0x492732,_0x36e08d?util['inspect'](_0x36e08d,{'showHidden':![],'depth':null}):'');})[_0x2b18('0xd')](function(_0x339ccb){logger[_0x2b18('0x9')]('[utils][request]\x20name:%s',_0x492732,_0x339ccb?util[_0x2b18('0x7')](_0x339ccb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x28b01b){return client[_0x2b18('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x2b18('0xe'),_0x2b18('0xf'),_0x2b18('0x10')],'where':_0x28b01b,'limit':0x1}})[_0x2b18('0xb')](function(_0x7f7e49){logger['debug'](_0x2b18('0x11'),JSON[_0x2b18('0x12')](_0x28b01b),_0x7f7e49?util[_0x2b18('0x7')](_0x7f7e49,{'showHidden':![],'depth':null}):'');return _0x7f7e49[_0x2b18('0x13')][_0x2b18('0x14')]?_0x7f7e49['result'][0x0]:null;});}exports[_0x2b18('0x15')]=function(_0x263622){return new BPromise(function(_0x51989d,_0x188fef){if(_0x263622){return getUser({'internal':_0x263622})[_0x2b18('0xb')](function(_0x5b620c){logger['info'](_0x2b18('0x16'),_0x263622,_0x5b620c?_0x2b18('0x17'):_0x2b18('0x18'));return _0x51989d(_0x5b620c);})[_0x2b18('0xd')](function(_0x54ac2a){logger[_0x2b18('0x9')](_0x2b18('0x19'),_0x54ac2a?util['inspect'](_0x54ac2a,{'showHidden':![],'depth':null}):'');return _0x51989d(null);});}return _0x51989d(null);});};exports[_0x2b18('0x1a')]=function(_0x53b6b5){return new BPromise(function(_0xdaa8fe,_0x29933f){if(_0x53b6b5){return getUser({'interface':_0x53b6b5})['then'](function(_0x38fdfb){logger[_0x2b18('0x6')](_0x2b18('0x1b'),_0x53b6b5,_0x38fdfb?_0x2b18('0x17'):_0x2b18('0x18'));return _0xdaa8fe(_0x38fdfb);})['catch'](function(_0x49a744){logger[_0x2b18('0x9')](_0x2b18('0x1c'),_0x49a744?util['inspect'](_0x49a744,{'showHidden':![],'depth':null}):'');return _0xdaa8fe(null);});}return _0xdaa8fe(null);});};exports[_0x2b18('0x1d')]=function(_0x59d65b){return new BPromise(function(_0x52b593,_0x510e63){if(_0x59d65b){return getUser({'name':_0x59d65b})[_0x2b18('0xb')](function(_0x2696ea){logger[_0x2b18('0x6')](_0x2b18('0x1e'),_0x59d65b,_0x2696ea?_0x2b18('0x17'):_0x2b18('0x18'));return _0x52b593(_0x2696ea);})[_0x2b18('0xd')](function(_0x1fe0bf){logger[_0x2b18('0x9')](_0x2b18('0x1f'),_0x1fe0bf?util[_0x2b18('0x7')](_0x1fe0bf,{'showHidden':![],'depth':null}):'');return _0x52b593(null);});}return _0x52b593(null);});};exports[_0x2b18('0x20')]=function(_0x59d93a){return new BPromise(function(_0x995f1f,_0x16d1aa){if(_0x59d93a){return client['request'](_0x2b18('0x21'),{'options':{'raw':!![],'attributes':['id','name',_0x2b18('0x22'),_0x2b18('0x23'),_0x2b18('0x24')],'where':{'name':_0x59d93a},'limit':0x1}})[_0x2b18('0xb')](function(_0x57d08f){logger['debug'](_0x2b18('0x25'),_0x59d93a,_0x57d08f?util[_0x2b18('0x7')](_0x57d08f,{'showHidden':![],'depth':null}):'');logger[_0x2b18('0x6')](_0x2b18('0x26'),_0x59d93a,_0x57d08f?_0x2b18('0x17'):_0x2b18('0x18'));return _0x995f1f(_0x57d08f[_0x2b18('0x13')]['length']?_0x57d08f['result'][0x0]:null);})[_0x2b18('0xd')](function(_0x55a1a5){logger[_0x2b18('0x9')](_0x2b18('0x27'),_0x55a1a5?util[_0x2b18('0x7')](_0x55a1a5,{'showHidden':![],'depth':null}):'');return _0x995f1f(null);});}return _0x995f1f(null);});};exports[_0x2b18('0x28')]=function(_0xf37cfd,_0x1d51df){return moment(_0xf37cfd)[_0x2b18('0x29')](_0x1d51df,'seconds')[_0x2b18('0x2a')](_0x2b18('0x2b'));};exports[_0x2b18('0x2c')]=function(_0x15c2ca,_0x46fe22){return moment(_0x15c2ca)['subtract'](_0x46fe22,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2b18('0x2d')]=function(_0x3f3e4f,_0x26c5e8){return moment(_0x3f3e4f)[_0x2b18('0x2e')](moment(_0x26c5e8),'seconds');};exports[_0x2b18('0x2f')]=function(_0x5b5310,_0x5b7e2a){return parseInt(_0x5b5310,0xa)+parseInt(_0x5b7e2a,0xa);};exports['now']=function(){return moment()['format'](_0x2b18('0x2b'));};exports[_0x2b18('0x30')]=function(_0x1165e6,_0x470158){if(_0x470158){return moment(_0x1165e6)[_0x2b18('0x30')](_0x470158);}return!![];};exports[_0x2b18('0x31')]=function(_0x1e4503,_0x38db10){if(_0x38db10){return moment(_0x1e4503)['isBefore'](_0x38db10);}else if(_0x1e4503){return!![];}return![];}; \ No newline at end of file -- 1.7.1